1 #LyX 2.1 created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that this document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of this document may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 \options fleqn,bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading
35 \use_default_options false
39 \maintain_unincluded_children false
42 InsetLayout Flex:MenuItem
51 \newcommand*{\menuitem}[1]{{\sffamily #1}}
54 # In case we need to do with sans...
55 #InsetLayout CharStyle:Code
60 #\renewcommand{\code}[1]{{\sffamily #1}}
65 \language_package default
70 \font_typewriter default
72 \font_default_family default
73 \use_non_tex_fonts false
79 \default_output_format default
81 \bibtex_command default
82 \index_command default
86 \pdf_title "LyX Configuration Manual"
87 \pdf_author "LyX Team"
88 \pdf_subject "LyX-documentation Customization"
89 \pdf_keywords "LyX, documentation, customization"
91 \pdf_bookmarksnumbered true
92 \pdf_bookmarksopen true
93 \pdf_bookmarksopenlevel 1
98 \pdf_pdfusetitle false
99 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
102 \use_package amsmath 0
103 \use_package amssymb 0
105 \use_package mathdots 1
106 \use_package mathtools 0
107 \use_package mhchem 0
108 \use_package stmaryrd 0
109 \use_package undertilde 0
111 \cite_engine_type numerical
115 \paperorientation portrait
130 \paragraph_separation indent
131 \paragraph_indentation default
132 \quotes_language english
135 \paperpagestyle headings
136 \tracking_changes true
137 \output_changes false
141 \author -712698321 "Jürgen Spitzmüller"
142 \author -195340706 "Georg Baum"
144 \author 155139281 "Jrgen Spitzmller"
145 \author 1082167584 "Kayvan Sylvan" kayvan@sylvan.com
146 \author 1414654397 "Richard Heck"
147 \author 2090807402 "usti"
153 Customizing LyX: Features for the Advanced User
161 \begin_layout Plain Layout
163 If you have comments or error corrections, please send them to the LyX Documenta
165 \begin_inset CommandInset href
167 target "lyx-docs@lists.lyx.org"
174 \begin_inset Quotes eld
178 \begin_inset Quotes erd
181 in the subject header, and please cc the current maintainer of this file,
182 Richard Heck <rgheck@comcast.net>.
188 \begin_inset Newline newline
192 \begin_inset Newline newline
198 \begin_layout Standard
199 \begin_inset CommandInset toc
200 LatexCommand tableofcontents
207 \begin_layout Standard
208 \begin_inset Note Note
211 \begin_layout Plain Layout
212 Please use change tracking when modifying this document.
213 This makes it easier for our translators to recognize things that have
214 been changed, and it helps the maintainer keep up-to-date with what's been
223 \begin_layout Chapter
227 \begin_layout Standard
228 This manual covers the customization features present in LyX.
229 In it, we discuss issues like keyboard shortcuts, screen previewing options,
230 printer options, sending commands to LyX via the LyX Server, internationalizati
231 on, installing new LaTeX classes and LyX layouts, etc.
232 We can't possibly hope to touch on everything you can change—our developers
233 add new features faster than we can document them—but we will explain the
234 most common customizations and hopefully point you in the right direction
235 for some of the more obscure ones.
238 \begin_layout Standard
239 \begin_inset Branch OutDated
242 \begin_layout Standard
243 Information from previous versions of this document that now seems to be
244 outdated is contained in the OutDated branch of this document.
245 By default, this information will not appear in the LaTeX output.
253 \begin_layout Chapter
254 LyX configuration files
257 \begin_layout Standard
258 This chapter aims to help you to find your way through the LyX configuration
260 Before continuing to read this chapter, you should find out where your
261 LyX library and user directories are by using
262 \begin_inset Flex MenuItem
265 \begin_layout Plain Layout
266 Help\SpecialChar \menuseparator
277 The library directory is the place where LyX places its system-wide configurati
278 on files; the user directory is where you can place your modified versions.
279 We will call the former
280 \begin_inset Flex Code
283 \begin_layout Plain Layout
290 \begin_inset Flex MenuItem
293 \begin_layout Plain Layout
299 in the remainder of this document.
303 \begin_layout Section
305 \begin_inset Flex Code
308 \begin_layout Plain Layout
317 \begin_layout Standard
318 \begin_inset Flex Code
321 \begin_layout Plain Layout
327 and its sub-directories contain a number of files and that can be used
328 to customize LyX's behavior.
329 You can change many of these files from within LyX itself through the
330 \begin_inset Flex MenuItem
333 \begin_layout Plain Layout
334 Tools\SpecialChar \menuseparator
341 Most customization that you will want to do in LyX is possible through
343 However, many other inner aspects of LyX can be customized by modifying
345 \begin_inset Flex Code
348 \begin_layout Plain Layout
355 These files fall in different categories, described in the following subsection
359 \begin_layout Subsection
360 Automatically generated files
363 \begin_layout Standard
364 The files, which are to be found in
365 \begin_inset Flex MenuItem
368 \begin_layout Plain Layout
374 , are generated when you configure LyX.
375 They contain various default values that are guessed by inspection.
376 In general, it is not a good idea to modify them, since they might be overwritt
380 \begin_layout Labeling
381 \labelwidthstring 00.00.0000
382 \begin_inset Flex Code
385 \begin_layout Plain Layout
391 contains defaults for various commands.
394 \begin_layout Labeling
395 \labelwidthstring 00.00.0000
396 \begin_inset Flex Code
399 \begin_layout Plain Layout
405 contains the list of packages that have been recognized by LyX.
406 It is currently unused by the LyX program itself, but the information extracted
407 , and more, is made available with
408 \begin_inset Flex MenuItem
411 \begin_layout Plain Layout
412 Help\SpecialChar \menuseparator
425 \begin_layout Labeling
426 \labelwidthstring 00.00.0000
427 \begin_inset Flex Code
430 \begin_layout Plain Layout
436 the list of text classes that have been found in your
437 \begin_inset Flex Code
440 \begin_layout Plain Layout
446 directories, along with the associated LaTeX document class and their descripti
450 \begin_layout Labeling
451 \labelwidthstring 00.00.0000
452 \begin_inset Flex Code
455 \begin_layout Plain Layout
461 the list of layout modules found in your
462 \begin_inset Flex Code
465 \begin_layout Plain Layout
474 \begin_layout Labeling
475 \labelwidthstring 00.00.0000
476 \begin_inset Flex Code
479 \begin_layout Plain Layout
485 lists of various sorts of LaTeX-related files found on your system
488 \begin_layout Labeling
489 \labelwidthstring 00.00.0000
490 \begin_inset Flex Code
493 \begin_layout Plain Layout
499 is automatically generated during configuration from the file
500 \begin_inset Flex Code
503 \begin_layout Plain Layout
510 It contains information on your LaTeX configuration.
513 \begin_layout Subsection
517 \begin_layout Standard
518 These directories are duplicated between
519 \begin_inset Flex Code
522 \begin_layout Plain Layout
529 \begin_inset Flex Code
532 \begin_layout Plain Layout
539 If a particular files exists in both places, the one in
540 \begin_inset Flex Code
543 \begin_layout Plain Layout
552 \begin_layout Labeling
553 \labelwidthstring 00.00.0000
554 \begin_inset Flex Code
557 \begin_layout Plain Layout
563 this directory contains files with the extension
564 \begin_inset Flex Code
567 \begin_layout Plain Layout
573 that define the keybindings used in LyX.
574 If there exists an internationalized version of the bind file named
575 \begin_inset Flex Code
578 \begin_layout Plain Layout
584 , that will be used first.
587 \begin_layout Labeling
588 \labelwidthstring 00.00.0000
589 \begin_inset Flex Code
592 \begin_layout Plain Layout
598 contains graphics files that can be included in documents.
602 \begin_layout Labeling
603 \labelwidthstring 00.00.0000
604 \begin_inset Flex Code
607 \begin_layout Plain Layout
613 contains LyX documentation files (including the one you are currently reading).
615 \begin_inset Flex Code
618 \begin_layout Plain Layout
624 deserves special attention, as noted above.
625 The internationalized help docs are in subdirectories
626 \begin_inset Flex Code
629 \begin_layout Plain Layout
636 \begin_inset Quotes eld
640 \begin_inset Quotes erd
643 is the ISO language code.
649 \begin_inset CommandInset ref
651 reference "cha:Internationalizing-LyX"
658 \begin_layout Labeling
659 \labelwidthstring 00.00.0000
660 \begin_inset Flex Code
663 \begin_layout Plain Layout
669 contains example files that explain how to use some features.
670 In the file browser, press the
671 \begin_inset Flex MenuItem
674 \begin_layout Plain Layout
683 \begin_layout Labeling
684 \labelwidthstring 00.00.0000
685 \begin_inset Flex Code
688 \begin_layout Plain Layout
694 contains image files that are used by the
695 \begin_inset Flex MenuItem
698 \begin_layout Plain Layout
705 In addition, it also contains the individual icons used in the toolbar
706 and the banners that can be shown when LyX is launched.
709 \begin_layout Labeling
710 \labelwidthstring 00.00.0000
711 \begin_inset Flex Code
714 \begin_layout Plain Layout
720 contains keyboard keymapping files.
726 \begin_inset CommandInset ref
728 reference "sec:International-Keymap-Stuff"
735 \begin_layout Labeling
736 \labelwidthstring 00.00.0000
737 \begin_inset Flex Code
740 \begin_layout Plain Layout
746 contains the text class and module files described in Chapter
751 \begin_inset CommandInset ref
753 reference "cha:Installing-New-Document"
760 \begin_layout Labeling
761 \labelwidthstring 00.00.0000
762 \begin_inset Flex Code
765 \begin_layout Plain Layout
772 \begin_inset Flex Code
775 \begin_layout Plain Layout
781 Python scripts used to convert between LyX versions.
782 These can be run from the command line if, say, you want to batch-convert
786 \begin_layout Labeling
787 \labelwidthstring 00.00.0000
788 \begin_inset Flex Code
791 \begin_layout Plain Layout
797 contains some files that demonstrate the capabilities of the
798 \begin_inset Flex MenuItem
801 \begin_layout Plain Layout
812 Also contains some scripts used by LyX itself.
815 \begin_layout Labeling
816 \labelwidthstring 00.00.0000
817 \begin_inset Flex Code
820 \begin_layout Plain Layout
826 contains the standard LyX template files described in Chapter
831 \begin_inset CommandInset ref
833 reference "sub:Creating-Templates"
840 \begin_layout Labeling
841 \labelwidthstring 00.00.0000
842 \begin_inset Flex Code
845 \begin_layout Plain Layout
851 contains files with the extension
852 \begin_inset Flex Code
855 \begin_layout Plain Layout
861 that define the user interface to LyX.
862 That is, the files define which items appear in which menus and the items
863 appearing on the toolbar.
866 \begin_layout Subsection
867 Files you don't want to modify
870 \begin_layout Standard
871 These files are used internally by LyX and you generally do not need to
872 modify them unless you are a developer.
875 \begin_layout Labeling
876 \labelwidthstring 00.00.0000
877 \begin_inset Flex Code
880 \begin_layout Plain Layout
886 this file contains the list of LyX developers.
887 The contents are displayed with the menu entry
888 \begin_inset Flex MenuItem
891 \begin_layout Plain Layout
892 Help\SpecialChar \menuseparator
905 \begin_layout Labeling
906 \labelwidthstring 00.00.0000
907 \begin_inset Flex Code
910 \begin_layout Plain Layout
916 this is a LaTeX script used during the configuration process.
920 \begin_layout Labeling
921 \labelwidthstring 00.00.0000
922 \begin_inset Flex Code
925 \begin_layout Plain Layout
931 this is the script that is used to re-configure LyX.
932 It creates configuration files in the directory it was run from.
935 \begin_layout Subsection
936 Other files needing a line or two...
939 \begin_layout Labeling
940 \labelwidthstring 00.00.0000
941 \begin_inset Flex Code
944 \begin_layout Plain Layout
950 this contains tables describing how different character encodings can be
954 \begin_layout Labeling
955 \labelwidthstring 00.00.0000
956 \begin_inset Flex Code
959 \begin_layout Plain Layout
965 this file contains the templates available to the new
966 \begin_inset Flex MenuItem
969 \begin_layout Plain Layout
982 \begin_layout Labeling
983 \labelwidthstring 00.00.0000
984 \begin_inset Flex Code
987 \begin_layout Plain Layout
993 this file contains a list of all the languages currently supported by LyX.
994 \change_inserted -195340706 1334775793
998 \begin_layout Labeling
999 \labelwidthstring 00.00.0000
1001 \change_inserted -195340706 1334775793
1002 \begin_inset Flex Code
1005 \begin_layout Plain Layout
1007 \change_inserted -195340706 1334775793
1013 this file contains translations for internationalized paragraph styles
1015 \begin_inset space \thinspace{}
1019 \begin_inset CommandInset ref
1021 reference "sub:I18n"
1030 \begin_layout Section
1031 Your local configuration directory
1034 \begin_layout Standard
1035 Even if you are using LyX as an unprivileged user, you might want to change
1036 LyX configuration for your own use.
1038 \begin_inset Flex Code
1041 \begin_layout Plain Layout
1047 directory contains all your personal configuration files.
1048 This is the directory described as
1049 \begin_inset Quotes eld
1053 \begin_inset Quotes erd
1057 \begin_inset Flex MenuItem
1060 \begin_layout Plain Layout
1061 Help\SpecialChar \menuseparator
1063 \begin_inset space ~
1072 This directory is used as a mirror of
1073 \begin_inset Flex Code
1076 \begin_layout Plain Layout
1082 , which means that every file in
1083 \begin_inset Flex Code
1086 \begin_layout Plain Layout
1092 is a replacement for the corresponding file in
1093 \begin_inset Flex Code
1096 \begin_layout Plain Layout
1103 Any configuration file described in the above sections can be placed either
1104 in the system-wide directory, in which case it will affect all users, or
1105 in your local directory for your own use.
1108 \begin_layout Standard
1109 To make things clearer, let's provide a few examples:
1112 \begin_layout Itemize
1113 The preferences set in the
1114 \begin_inset Flex MenuItem
1117 \begin_layout Plain Layout
1118 Tools\SpecialChar \menuseparator
1124 dialog are saved to a file
1125 \begin_inset Flex Code
1128 \begin_layout Plain Layout
1135 \begin_inset Flex Code
1138 \begin_layout Plain Layout
1147 \begin_layout Itemize
1148 When you reconfigure using
1149 \begin_inset Flex MenuItem
1152 \begin_layout Plain Layout
1153 Tools\SpecialChar \menuseparator
1160 \begin_inset Flex Code
1163 \begin_layout Plain Layout
1169 script, and the resulting files are written in your local configuration
1171 This means that any additional text class file that you might have added
1173 \begin_inset Flex Code
1176 \begin_layout Plain Layout
1182 will be added to the list of classes in the
1183 \begin_inset Flex MenuItem
1186 \begin_layout Plain Layout
1187 Document\SpecialChar \menuseparator
1196 \begin_layout Itemize
1197 If you get some updated documentation from LyX ftp site and cannot install
1198 it because you do not have sysadmin rights on your system, you can just
1200 \begin_inset Flex Code
1203 \begin_layout Plain Layout
1209 and the items in the
1210 \begin_inset Flex MenuItem
1213 \begin_layout Plain Layout
1219 menu will open them!
1222 \begin_layout Section
1223 Running LyX with multiple configurations
1226 \begin_layout Standard
1227 The configuration freedom of the local configuration directory may not suffice
1228 if you want to have more than one configuration at your disposal.
1229 For example, you may want to be use different key bindings or printer settings
1231 You can achieve this by having several such directories.
1232 You then specify which directory to use at run-time.
1235 \begin_layout Standard
1236 Invoking LyX with the command line switch
1237 \begin_inset Flex Code
1240 \begin_layout Plain Layout
1250 instructs the program to read the configuration from that directory, and
1251 not from the default directory.
1252 (You can determine the default directory by running LyX without the
1253 \begin_inset Flex Code
1256 \begin_layout Plain Layout
1262 switch.) If the specified directory does not exist, LyX offers to create
1263 it for you, just like it does for the default directory on the first time
1264 you run the program.
1265 You can modify the configuration options in this additional user directory
1266 exactly as you would for the default directory.
1267 These directories are completely independent (but read on).
1268 Note that setting the environment variable
1269 \begin_inset Flex Code
1272 \begin_layout Plain Layout
1278 to some value has exactly the same effect.
1281 \begin_layout Standard
1282 Having several configurations also requires more maintenance: if you want
1283 to add a new layout to
1284 \begin_inset Flex Code
1287 \begin_layout Plain Layout
1293 which you want available from all your configurations, you must add it
1294 to each directory separately.
1295 You can avoid this with the following trick: after LyX creates the additional
1296 directory, most of the subdirectories (see above) are empty.
1297 If you want the new configuration to mirror an existing one, replace the
1298 empty subdirectory with a symbolic link to the matching subdirectory in
1299 the existing configuration.
1301 \begin_inset Flex Code
1304 \begin_layout Plain Layout
1310 subdirectory, however, since it contains a file written by the configuration
1311 script (also accessible through
1312 \begin_inset Flex MenuItem
1315 \begin_layout Plain Layout
1316 Tools\SpecialChar \menuseparator
1322 ) which is configuration-specific.
1325 \begin_layout Chapter
1326 The Preferences dialog
1329 \begin_layout Standard
1330 All options of the preferences dialog are described in the Appendix
1332 The Preferences Dialog
1339 For some options you might find here more details.
1342 \begin_layout Section
1344 \begin_inset CommandInset label
1353 \begin_layout Standard
1354 The first step is to define your file formats if they are not already defined.
1356 \begin_inset Flex MenuItem
1359 \begin_layout Plain Layout
1360 Tools\SpecialChar \menuseparator
1368 \begin_inset Flex MenuItem
1371 \begin_layout Plain Layout
1372 File Handling\SpecialChar \menuseparator
1379 \begin_inset Flex MenuItem
1382 \begin_layout Plain Layout
1383 New\SpecialChar \ldots{}
1389 button to define your new format.
1391 \begin_inset Flex MenuItem
1394 \begin_layout Plain Layout
1400 field contains the name used to identify the format in the GUI.
1402 \begin_inset Flex MenuItem
1405 \begin_layout Plain Layout
1411 is used to identify the format internally.
1412 You will also need to enter a file extension.
1413 These are all required.
1415 \begin_inset Flex MenuItem
1418 \begin_layout Plain Layout
1424 field is used to provide a keyboard shortcut on the menus.
1425 (For example, pressing
1426 \begin_inset Flex MenuItem
1429 \begin_layout Plain Layout
1436 \begin_inset Flex MenuItem
1439 \begin_layout Plain Layout
1440 View\SpecialChar \menuseparator
1441 View (Other Formats)\SpecialChar \menuseparator
1450 \begin_layout Standard
1452 \begin_inset Flex MenuItem
1455 \begin_layout Plain Layout
1462 \begin_inset Flex MenuItem
1465 \begin_layout Plain Layout
1472 For example, you might want to use
1473 \begin_inset Flex MenuItem
1476 \begin_layout Plain Layout
1482 to view PostScript files.
1483 You can enter the command needed to start the program in the corresponding
1485 In defining this command, you can use the four variables listed in the
1487 The viewer is launched when you view an image in LyX or use the
1488 \begin_inset Flex MenuItem
1491 \begin_layout Plain Layout
1498 The editor is for example launched when you right-click on an image and
1500 \begin_inset Flex MenuItem
1503 \begin_layout Plain Layout
1509 in the appearing context menu.
1512 \begin_layout Standard
1514 \change_inserted -195340706 1329851811
1516 \begin_inset Flex MenuItem
1519 \begin_layout Plain Layout
1525 type of a format is optional, but if it is specified, it must be unique
1527 It is used to detect files of this format from the file contents.
1528 For some important file formats there is no MIME type officially registered
1530 \begin_inset CommandInset href
1533 target "http://www.iana.org/assignments/media-types/"
1538 Therefore LyX uses the extended list of MIME types as specified by
1539 \begin_inset CommandInset href
1541 name "freedesktop.org"
1542 target "http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec"
1549 \begin_layout Standard
1551 \begin_inset Flex MenuItem
1554 \begin_layout Plain Layout
1560 option tells LyX that a format is suitable for document export.
1561 If this is set and if a suitable conversion route exists (see sec.
1562 \begin_inset space \thinspace{}
1566 \begin_inset CommandInset ref
1568 reference "sec:Converters"
1572 ), the format will appear in the
1573 \begin_inset Flex MenuItem
1576 \begin_layout Plain Layout
1577 File\SpecialChar \menuseparator
1584 The format will also appear in the
1585 \begin_inset Flex MenuItem
1588 \begin_layout Plain Layout
1594 menu if a viewer is specified for the format.
1595 Pure image formats, such as
1596 \begin_inset Flex Code
1599 \begin_layout Plain Layout
1605 , should not use this option.
1606 Formats that can both represent vector graphics and documents like
1607 \begin_inset Flex Code
1610 \begin_layout Plain Layout
1619 \begin_layout Standard
1621 \begin_inset Flex MenuItem
1624 \begin_layout Plain Layout
1625 Vector graphics format
1630 tells LyX that a format can contain vector graphics.
1631 This information is used to determine the target format of included graphics
1633 \begin_inset Flex MenuItem
1636 \begin_layout Plain Layout
1643 Included graphics may need to be converted to either
1644 \begin_inset Flex MenuItem
1647 \begin_layout Plain Layout
1654 \begin_inset Flex MenuItem
1657 \begin_layout Plain Layout
1664 \begin_inset Flex MenuItem
1667 \begin_layout Plain Layout
1674 \begin_inset Flex MenuItem
1677 \begin_layout Plain Layout
1683 cannot handle other image formats.
1684 If an included graphic is not already in
1685 \begin_inset Flex MenuItem
1688 \begin_layout Plain Layout
1695 \begin_inset Flex MenuItem
1698 \begin_layout Plain Layout
1705 \begin_inset Flex MenuItem
1708 \begin_layout Plain Layout
1714 format, it is converted to
1715 \begin_inset Flex MenuItem
1718 \begin_layout Plain Layout
1724 if the vector format option is set, and otherwise to
1725 \begin_inset Flex MenuItem
1728 \begin_layout Plain Layout
1737 \begin_layout Section
1741 \begin_layout Standard
1742 Since all conversions from one format to another take place in LyX's temporary
1743 directory, it is sometimes necessary to modify a file before copying it
1744 to the temporary directory in order that the conversion may be performed.
1748 \begin_layout Plain Layout
1749 For example, the file may refer to other files—images, for example—using
1750 relative file names, and these may become invalid when the file is copied
1751 to the temporary directory.
1756 This is done by a Copier: It copies a file to (or from) the temporary directory
1757 and may modify it in the process.
1760 \begin_layout Standard
1761 The definitions of the copiers may use four variables:
1764 \begin_layout Labeling
1765 \labelwidthstring 00.00.0000
1766 \begin_inset Flex Code
1769 \begin_layout Plain Layout
1775 The LyX system directory (e.
1776 \begin_inset space \thinspace{}
1780 \begin_inset space \space{}
1784 \begin_inset Flex MenuItem
1787 \begin_layout Plain Layout
1796 \begin_layout Labeling
1797 \labelwidthstring 00.00.0000
1798 \begin_inset Flex Code
1801 \begin_layout Plain Layout
1810 \begin_layout Labeling
1811 \labelwidthstring 00.00.0000
1812 \begin_inset Flex Code
1815 \begin_layout Plain Layout
1822 \change_inserted 1082167584 1348453985
1826 \begin_layout Labeling
1827 \labelwidthstring 00.00.0000
1829 \change_inserted 1082167584 1348453986
1830 $$b The base name (without filename extension) in the LyX temporary directory
1833 \begin_layout Labeling
1834 \labelwidthstring 00.00.0000
1836 \change_inserted 1082167584 1348453986
1837 $$p The full directory path of the LyX temporary directory
1840 \begin_layout Labeling
1841 \labelwidthstring 00.00.0000
1843 \change_inserted 1082167584 1348453986
1844 $$r The full pathname to the original LyX file being processed
1847 \begin_layout Labeling
1848 \labelwidthstring 00.00.0000
1850 \change_inserted 1082167584 1348453986
1851 $$f The filename (without any directory path) of the LyX file.
1854 \begin_layout Labeling
1855 \labelwidthstring 00.00.0000
1856 \begin_inset Flex Code
1859 \begin_layout Plain Layout
1866 \change_inserted 1082167584 1348453720
1870 \begin_layout Standard
1871 The latter should be the filename as it would be used in a LaTeX's
1878 It is relevant only when exporting files suitable for such inclusion.
1881 \begin_layout Standard
1882 Copiers can be used to do almost anything with output files.
1883 For example, suppose you want generated pdf files to be copied to a special
1885 \begin_inset Flex Code
1888 \begin_layout Plain Layout
1895 Then you could write a shell script such as this one:
1898 \begin_layout Standard
1899 \begin_inset listings
1903 \begin_layout Plain Layout
1908 \begin_layout Plain Layout
1913 \begin_layout Plain Layout
1915 TOFILE=`basename $2`
1918 \begin_layout Plain Layout
1920 cp $FROMFILE /home/you/pdf/$TOFILE
1925 Save it in your local LyX directory—say,
1926 \begin_inset Flex Code
1929 \begin_layout Plain Layout
1930 /home/you/.lyx/scripts/pdfcopier.sh
1935 —and make it executable, if you need to do so on your platform.
1937 \begin_inset Flex MenuItem
1940 \begin_layout Plain Layout
1941 Tools\SpecialChar \menuseparator
1947 dialog, select under
1948 \begin_inset Flex MenuItem
1951 \begin_layout Plain Layout
1952 File Handling\SpecialChar \menuseparator
1959 \begin_inset Flex MenuItem
1962 \begin_layout Plain Layout
1968 format—or one of the other pdf formats—and enter
1969 \begin_inset Flex Code
1972 \begin_layout Plain Layout
1973 pdfcopier.sh $$i $$o
1979 \begin_inset Flex MenuItem
1982 \begin_layout Plain Layout
1992 \begin_layout Standard
1993 Copiers are used by LyX in various of its own conversions.
1994 For example, if appropriate programs are found, LyX will automatically
1995 install copiers for the
1996 \begin_inset Flex MenuItem
1999 \begin_layout Plain Layout
2006 \begin_inset Flex MenuItem
2009 \begin_layout Plain Layout
2011 \begin_inset space ~
2020 When these formats are exported, the copier sees that not just the main
2021 HTML file but various associated files (style files, images, etc.) are also
2023 All these files are written to a subdirectory of the directory in which
2024 the original LyX file was found.
2028 \begin_layout Plain Layout
2029 This copier can be customized.
2031 \begin_inset Quotes eld
2035 \begin_inset Quotes erd
2038 argument takes a comma-separated list of extensions to be copied; if it
2039 is omitted, all files will be copied.
2041 \begin_inset Quotes eld
2045 \begin_inset Quotes erd
2048 argument determines the extension added to the generated directory.
2050 \begin_inset Quotes eld
2054 \begin_inset Flex MenuItem
2057 \begin_layout Plain Layout
2064 \begin_inset Quotes erd
2067 , so HTML generated from
2068 \begin_inset Flex MenuItem
2071 \begin_layout Plain Layout
2072 /path/to/filename.lyx
2078 \begin_inset Flex MenuItem
2081 \begin_layout Plain Layout
2082 /path/to/filename.html.LyXconv
2096 \begin_layout Section
2098 \begin_inset CommandInset label
2100 name "sec:Converters"
2107 \begin_layout Standard
2108 You can define your own Converters to convert files between different formats.
2110 \begin_inset Flex MenuItem
2113 \begin_layout Plain Layout
2114 Tools\SpecialChar \menuseparator
2115 Preferences\SpecialChar \menuseparator
2116 File Handling\SpecialChar \menuseparator
2125 \begin_layout Standard
2126 To define a new converter, select the
2127 \begin_inset Flex MenuItem
2130 \begin_layout Plain Layout
2132 \begin_inset space ~
2141 \begin_inset Flex MenuItem
2144 \begin_layout Plain Layout
2146 \begin_inset space ~
2154 from the drop-down lists, enter the command needed for the conversion,
2156 \begin_inset Flex MenuItem
2159 \begin_layout Plain Layout
2166 Several variables can be used in the definition of converters:
2169 \begin_layout Labeling
2170 \labelwidthstring 00.00.0000
2171 \begin_inset Flex Code
2174 \begin_layout Plain Layout
2180 The LyX system directory
2183 \begin_layout Labeling
2184 \labelwidthstring 00.00.0000
2185 \begin_inset Flex Code
2188 \begin_layout Plain Layout
2197 \begin_layout Labeling
2198 \labelwidthstring 00.00.0000
2199 \begin_inset Flex Code
2202 \begin_layout Plain Layout
2211 \begin_layout Labeling
2212 \labelwidthstring 00.00.0000
2213 \begin_inset Flex Code
2216 \begin_layout Plain Layout
2222 The base filename of the input file (i.
2223 \begin_inset space \thinspace{}
2226 g., without the extension)
2229 \begin_layout Labeling
2230 \labelwidthstring 00.00.0000
2231 \begin_inset Flex Code
2234 \begin_layout Plain Layout
2240 The path to the input file
2243 \begin_layout Labeling
2244 \labelwidthstring 00.00.0000
2245 \begin_inset Flex Code
2248 \begin_layout Plain Layout
2254 The path to the original input file (this is different from $$p when a
2255 chain of converters is called)
2258 \begin_layout Labeling
2259 \labelwidthstring 00.00.0000
2260 \begin_inset Flex Code
2263 \begin_layout Plain Layout
2269 The iconv name for the encoding of the document.
2272 \begin_layout Standard
2274 \begin_inset Flex MenuItem
2277 \begin_layout Plain Layout
2279 \begin_inset space ~
2287 field you can enter the following flags, separated by commas:
2290 \begin_layout Labeling
2291 \labelwidthstring 00.00.0000
2292 \begin_inset Flex Code
2295 \begin_layout Plain Layout
2301 This converter runs some form of LaTeX.
2302 This will make LyX's LaTeX error logs available.
2305 \begin_layout Labeling
2306 \labelwidthstring 00.00.0000
2307 \begin_inset Flex Code
2310 \begin_layout Plain Layout
2317 \begin_inset Flex MenuItem
2320 \begin_layout Plain Layout
2326 file for the conversion.
2327 \change_inserted 1414654397 1337693117
2331 \begin_layout Labeling
2332 \labelwidthstring 00.00.0000
2334 \change_inserted 1414654397 1337693188
2335 \begin_inset Flex Code
2338 \begin_layout Plain Layout
2340 \change_inserted 1414654397 1337693129
2349 \begin_inset Quotes eld
2353 \begin_inset Quotes erd
2356 file from the backend, which in practice means a LaTeX file like the one
2357 we would export, without
2358 \begin_inset Flex Code
2361 \begin_layout Plain Layout
2363 \change_inserted 1414654397 1337693184
2376 \begin_layout Labeling
2377 \labelwidthstring 00.00.0000
2378 \begin_inset Flex Code
2381 \begin_layout Plain Layout
2390 \begin_layout Standard
2391 The following three flags are not really flags at all because they take
2393 \begin_inset Flex MenuItem
2396 \begin_layout Plain Layout
2398 \begin_inset space ~
2402 \begin_inset space ~
2413 \begin_layout Labeling
2414 \labelwidthstring 00.00.0000
2415 \begin_inset Flex Code
2418 \begin_layout Plain Layout
2424 If set, the converter's standard error will be redirected to a file
2425 \begin_inset Flex Code
2428 \begin_layout Plain Layout
2434 , and the script given as argument will be run as:
2435 \begin_inset Flex Code
2438 \begin_layout Plain Layout
2439 script < infile.out > infile.log
2445 The argument may contain
2446 \begin_inset Flex Code
2449 \begin_layout Plain Layout
2458 \begin_layout Labeling
2459 \labelwidthstring 00.00.0000
2460 \begin_inset Flex Code
2463 \begin_layout Plain Layout
2469 The name of the directory in which the converter will dump the generated
2471 LyX will not create this directory, and it does not copy anything into
2472 it, though it will copy this directory to the destination.
2473 The argument may contain
2474 \begin_inset Flex Code
2477 \begin_layout Plain Layout
2483 , which will be replaced by the base name of the input and output files,
2484 respectively, when the directory is copied.
2485 \begin_inset Newline newline
2488 Note that resultdir and usetempdir make no sense together.
2489 The latter will be ignored if the former is given.
2492 \begin_layout Labeling
2493 \labelwidthstring 00.00.0000
2494 \begin_inset Flex Code
2497 \begin_layout Plain Layout
2503 Determines the output file name and may, contain
2504 \begin_inset Flex Code
2507 \begin_layout Plain Layout
2514 Sensible only with resultdir and optional even then; if not given, it defaults
2518 \begin_layout Standard
2519 None of these last three are presently used in any of the converters that
2520 are installed with LyX.
2524 \begin_layout Standard
2525 You do not have to define converters for all formats between which you want
2527 For example, you will note that there is no `LyX to PostScript' converter,
2528 but LyX will export PostScript.
2529 It does so by first creating a LaTeX file (no converter needs to be defined
2530 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2531 and finally converting the resulting DVI file to PostScript.
2532 LyX finds such `chains' of converters automatically, and it will always
2533 choose the shortest possible chain.
2534 You can, though, still define multiple conversion methods between file
2536 For example, the standard LyX configuration provides three ways to convert
2537 LaTeX to PDF: Directly, using
2538 \begin_inset Flex MenuItem
2541 \begin_layout Plain Layout
2547 ; via (DVI and) PostScript, using
2548 \begin_inset Flex MenuItem
2551 \begin_layout Plain Layout
2558 \begin_inset Flex MenuItem
2561 \begin_layout Plain Layout
2568 To define such alternate chains, you must define multiple target `file
2569 formats', as described in section
2570 \begin_inset CommandInset ref
2572 reference "sec:Formats"
2577 For example, in the standard configuration, the formats named
2578 \begin_inset Flex MenuItem
2581 \begin_layout Plain Layout
2588 \begin_inset Flex MenuItem
2591 \begin_layout Plain Layout
2598 \begin_inset Flex MenuItem
2601 \begin_layout Plain Layout
2607 are defined, all of which share the extension
2608 \begin_inset Flex MenuItem
2611 \begin_layout Plain Layout
2617 , and which correspond to the conversion methods just mentioned.
2620 \begin_layout Chapter
2621 Internationalizing LyX
2622 \begin_inset CommandInset label
2624 name "cha:Internationalizing-LyX"
2631 \begin_layout Standard
2632 LyX supports using a translated interface.
2633 Last time we checked, LyX provided text in thirty languages.
2634 The language of choice is called your
2639 (For further reading on locale settings, see also the documentation for
2640 locale that comes with your operating system.
2641 For Linux, the manual page for
2642 \begin_inset Flex Code
2645 \begin_layout Plain Layout
2651 could be a good place to start).
2654 \begin_layout Standard
2655 Notice that these translations will work, but do contain a few flaws.
2656 In particular, all dialogs have been designed with the English text in
2657 mind, which means that some of the translated text will be too large to
2658 fit within the space allocated.
2659 This is only a display problem and will not cause any harm.
2660 Also, you will find that some of the translations do not define shortcut
2661 keys for everything.
2662 Sometimes, there are simply not enough free letters to do it.
2663 Other times, the translator just hasn't got around to doing it yet.
2664 Our localization team, which you may wish to join,
2668 \begin_layout Plain Layout
2669 If you are a fluent speaker of a language other than English, joining these
2670 teams is a great way to give back to the LyX community!
2675 will of course try to fix these shortcomings in future versions of LyX.
2678 \begin_layout Section
2682 \begin_layout Subsection
2683 Translating the graphical user interface (text messages).
2686 \begin_layout Standard
2688 \begin_inset Flex Code
2691 \begin_layout Plain Layout
2697 library to handle the internationalization of the interface.
2698 To have LyX speak your favorite language in all menus and dialogs, you
2700 \begin_inset Flex Code
2703 \begin_layout Plain Layout
2709 -file for that language.
2710 When this is available, you'll have to generate a
2711 \begin_inset Flex Code
2714 \begin_layout Plain Layout
2720 -file from it and install the
2721 \begin_inset Flex Code
2724 \begin_layout Plain Layout
2731 The process of doing all of this is explained in the documentation for
2733 \begin_inset Flex Code
2736 \begin_layout Plain Layout
2743 It is possible to do this just for yourself, but if you're going to do
2744 it, you might as well share the results of your labors with the rest of
2746 Send a message to the LyX developers' list for more information about how
2750 \begin_layout Standard
2751 In short, this is what you should do (xx denotes the language code):
2754 \begin_layout Itemize
2755 Check out the LyX source code.
2757 \begin_inset CommandInset href
2759 name "information on the web"
2760 target "http://www.lyx.org/HowToUseSVN"
2767 \begin_layout Itemize
2769 \begin_inset Flex Code
2772 \begin_layout Plain Layout
2778 to the folder of the
2779 \begin_inset Flex Code
2782 \begin_layout Plain Layout
2790 \begin_inset Flex Code
2793 \begin_layout Plain Layout
2801 \begin_inset Flex Code
2804 \begin_layout Plain Layout
2810 doesn't exist anywhere, it can be remade with the console command
2811 \begin_inset Flex Code
2814 \begin_layout Plain Layout
2820 in that directory, or you can use an existing po-file for some other language
2824 \begin_layout Itemize
2826 \begin_inset Flex Code
2829 \begin_layout Plain Layout
2839 \begin_layout Plain Layout
2840 This is just a text file, so it can be edited in any text editor.
2841 But there are also specialized programs that support such editing, such
2846 (for all platforms) or
2855 contains a `mode' for editing
2856 \begin_inset Flex Code
2859 \begin_layout Plain Layout
2870 For some menu- and widget-labels, there are also shortcut keys that should
2872 Those keys are marked after a `|', and should be translated according to
2873 the words and phrases of the language.
2874 You should also fill also out the information at the beginning of the new
2876 \begin_inset Flex Code
2879 \begin_layout Plain Layout
2885 -file with your email-address, etc., so people know where to reach you with
2886 suggestions and entertaining flames.
2889 \begin_layout Standard
2890 If you are just doing this on your own, then:
2893 \begin_layout Itemize
2895 \begin_inset Flex Code
2898 \begin_layout Plain Layout
2905 This can be done with
2906 \begin_inset Flex Code
2909 \begin_layout Plain Layout
2910 msgfmt -o xx.mo < xx.po
2918 \begin_layout Itemize
2920 \begin_inset Flex Code
2923 \begin_layout Plain Layout
2929 -file to your locale-tree, at the correct directory for application messages
2934 xx, and under the name
2935 \begin_inset Flex Code
2938 \begin_layout Plain Layout
2945 \begin_inset space \thinspace{}
2949 \begin_inset space \space{}
2953 \begin_inset Flex Code
2956 \begin_layout Plain Layout
2957 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2967 \begin_layout Standard
2968 As said, however, it would be best if the new
2969 \begin_inset Flex Code
2972 \begin_layout Plain Layout
2978 -file could be added to the LyX distribution, so others can use it.
2979 Adding it involves making additional changes to LyX.
2980 So send an email to the developers' mailing list if you're interested in
2984 \begin_layout Subsubsection
2988 \begin_layout Standard
2989 Sometimes it turns out that one English message needs to be translated into
2990 different messages in the target language.
2991 One example is the message
2992 \begin_inset Flex Code
2995 \begin_layout Plain Layout
3001 which has the German translation
3009 , depending upon exactly what the English
3010 \begin_inset Quotes eld
3014 \begin_inset Quotes erd
3019 \begin_inset Flex Code
3022 \begin_layout Plain Layout
3028 does not handle such ambiguous translations.
3029 Therefore you have to add some context information to the message: Instead
3031 \begin_inset Flex Code
3034 \begin_layout Plain Layout
3041 \begin_inset Flex Code
3044 \begin_layout Plain Layout
3045 To[[as in 'From format x to format y']]
3051 \begin_inset Flex Code
3054 \begin_layout Plain Layout
3055 To[[as in 'From page x to page y']].
3060 Now the two occurrences of
3061 \begin_inset Flex Code
3064 \begin_layout Plain Layout
3071 \begin_inset Flex Code
3074 \begin_layout Plain Layout
3080 and can be translated correctly to
3091 \begin_layout Standard
3092 Of course the context information needs to be stripped off the original
3093 message when no translation is used.
3094 Therefore you have to put it in double square brackets at the end of the
3095 message (see the example above).
3096 The translation mechanism of LyX ensures that everything in double square
3097 brackets at the end of messages is removed before displaying the message.
3100 \begin_layout Subsection
3101 Translating the documentation.
3104 \begin_layout Standard
3105 The online documentation (in the
3106 \begin_inset Flex MenuItem
3109 \begin_layout Plain Layout
3115 -menu) can (and should!) be translated.
3116 If there are translated versions of the documentation available
3120 \begin_layout Plain Layout
3121 As of March 2008, at least some of the documents have been translated into
3122 fourteen languages, with the Tutorial available in a few more.
3127 and the locale is set accordingly, these will be used automagically by
3129 LyX looks for translated versions as
3130 \begin_inset Flex Code
3133 \begin_layout Plain Layout
3134 LyXDir/doc/xx/DocName.lyx
3140 \begin_inset Flex Code
3143 \begin_layout Plain Layout
3149 is the code for the language currently in use.
3150 If there are no translated documents, the default English versions will
3152 Note that the translated versions must have the same filenames (
3153 \begin_inset Flex Code
3156 \begin_layout Plain Layout
3162 above) as the original.
3163 If you feel up to translating the documentation (an excellent way to proof-read
3164 the original documentation by the way!), there are a few things you should
3168 \begin_layout Itemize
3169 Check out the documentation translation web page at
3170 \begin_inset CommandInset href
3172 name "http://www.lyx.org/Translation"
3173 target "http://www.lyx.org/Translation"
3178 That way, you can find out which (if any) documents have already been translate
3179 d into your language.
3180 You can also find out who (if anyone) is organizing the effort to translate
3181 the documentation into your language.
3182 If no one is organizing the effort, please let us know that you're interested.
3185 \begin_layout Standard
3186 Once you get to actually translating, here's a few hints for you that may
3190 \begin_layout Itemize
3191 Join the documentation team! There is information on how to do that in
3192 \begin_inset Flex Code
3195 \begin_layout Plain Layout
3202 \begin_inset Flex MenuItem
3205 \begin_layout Plain Layout
3206 Help\SpecialChar \menuseparator
3212 ), which by the way is the first document you should translate.
3215 \begin_layout Itemize
3216 Learn the typographic conventions for the language you are translating to.
3217 Typography is an ancient art and over the centuries, a great variety of
3218 conventions have developed throughout different parts of the world.
3219 Also study the professional terminology amongst typographers in your country.
3220 Inventing your own terminology will only confuse the users.
3223 (Warning! Typography is addictive!)
3226 \begin_layout Itemize
3227 Make a copy of the document.
3228 This will be your working copy.
3229 You can use this as your personal translated help-file by placing it in
3231 \begin_inset Flex Code
3234 \begin_layout Plain Layout
3243 \begin_layout Itemize
3244 Sometimes the original document (from the LyX-team) will be updated.
3245 Use the source viewer at
3246 \begin_inset CommandInset href
3248 name "http://www.lyx.org/trac/timeline"
3249 target "http://www.lyx.org/trac/timeline"
3253 to see what has been changed.
3254 That way you can easily see which parts of the translated document need
3258 \begin_layout Standard
3259 If you ever find an error in the original document, fix it and notify the
3260 rest of the documentation team of the changes! (You didn't forget to join
3261 the documentation team, did you?)
3264 \begin_layout Standard
3265 \begin_inset Branch OutDated
3268 \begin_layout Section
3269 International Keyboard Support
3272 \begin_layout Standard
3275 [Editor's Note: The following section is by
3283 It needs to be fixed to conform to the new Documentation Style sheet and
3284 to make use of the new v1.0 features.
3285 The whole thing also needs to be merged with the section following it.-jw
3286 It may also be badly out of date.-rh (2008)]
3289 \begin_layout Subsection
3290 Defining Own Keymaps: Keymap File Format
3293 \begin_layout Standard
3294 Let's look at a keyboard definition file a little closer.
3295 It is a plain text file defining
3298 \begin_layout Itemize
3299 key-to-key or key-to-string translations
3302 \begin_layout Itemize
3306 \begin_layout Itemize
3307 dead keys exceptions
3310 \begin_layout Standard
3311 To define key-to-key or key-to-string translation, use this command:
3314 \begin_layout Quotation
3315 \begin_inset Flex Code
3318 \begin_layout Plain Layout
3327 \begin_inset Flex Code
3330 \begin_layout Plain Layout
3339 \begin_layout Standard
3341 \begin_inset Flex Code
3344 \begin_layout Plain Layout
3350 is the key to be translated and
3351 \begin_inset Flex Code
3354 \begin_layout Plain Layout
3360 is the string to be inserted into the document.
3361 To define dead keys, use:
3364 \begin_layout Quotation
3365 \begin_inset Flex Code
3368 \begin_layout Plain Layout
3377 \begin_inset Flex Code
3380 \begin_layout Plain Layout
3389 \begin_layout Standard
3391 \begin_inset Flex Code
3394 \begin_layout Plain Layout
3400 is a keyboard key and
3401 \begin_inset Flex Code
3404 \begin_layout Plain Layout
3411 The following dead keys are supported (shortcut name is in parentheses):
3414 \begin_layout Quotation
3418 \begin_inset space \hfill{}
3424 \begin_layout Quotation
3426 \begin_inset space \hfill{}
3432 \begin_layout Quotation
3434 \begin_inset space \hfill{}
3440 \begin_layout Quotation
3442 \begin_inset space \hfill{}
3448 \begin_layout Quotation
3450 \begin_inset space \hfill{}
3456 \begin_layout Quotation
3458 \begin_inset space \hfill{}
3465 \begin_layout Plain Layout
3477 \begin_layout Quotation
3479 \begin_inset space \hfill{}
3485 \begin_layout Quotation
3487 \begin_inset space \hfill{}
3494 \begin_layout Plain Layout
3506 \begin_layout Quotation
3508 \begin_inset space \hfill{}
3514 \begin_layout Quotation
3516 \begin_inset space \hfill{}
3522 \begin_layout Quotation
3524 \begin_inset space \hfill{}
3531 \begin_layout Plain Layout
3543 \begin_layout Quotation
3545 \begin_inset space \hfill{}
3552 \begin_layout Plain Layout
3564 \begin_layout Quotation
3566 \begin_inset space \hfill{}
3572 \begin_layout Quotation
3573 hungarian umlaut (hug)
3574 \begin_inset space \hfill{}
3580 \begin_layout Quotation
3582 \begin_inset space \hfill{}
3588 \begin_layout Quotation
3590 \begin_inset space \hfill{}
3597 \begin_layout Plain Layout
3609 \begin_layout Standard
3610 Since in many international keyboards there are exceptions to what some
3611 dead keys should do, you can define them using
3614 \begin_layout Quotation
3615 \begin_inset Flex Code
3618 \begin_layout Plain Layout
3626 deadkey key outstring
3629 \begin_layout Standard
3630 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3634 \begin_layout Quotation
3635 \begin_inset Flex Code
3638 \begin_layout Plain Layout
3651 \begin_layout Standard
3652 to make it work correctly.
3653 Also, you have to define as exceptions dead keys over i and j, to remove
3654 the dot from them before inserting an accent mark.
3655 I will change this when the time comes, but so far I haven't had time.
3658 \begin_layout Standard
3659 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3662 \begin_inset Flex Code
3665 \begin_layout Plain Layout
3671 have different meaning.
3673 \begin_inset Flex Code
3676 \begin_layout Plain Layout
3682 marks comments, quotes start and end LaTeX-style commands.
3683 To enter quote, you'll need to use
3684 \begin_inset Flex Code
3687 \begin_layout Plain Layout
3696 \begin_inset Flex Code
3699 \begin_layout Plain Layout
3706 \begin_inset Flex Code
3709 \begin_layout Plain Layout
3720 \begin_layout Standard
3721 If you make a keyboard description file that works for your language, please
3722 mail it to me, so I can include it in the next keymap distribution.
3725 \begin_layout Standard
3726 More keywords will be supported in keymap configuration file in future,
3730 \begin_layout Itemize
3731 \begin_inset Flex Code
3734 \begin_layout Plain Layout
3745 \begin_inset space \hfill{}
3749 \begin_inset Flex Code
3752 \begin_layout Plain Layout
3761 \begin_layout Itemize
3762 \begin_inset Flex Code
3765 \begin_layout Plain Layout
3776 \begin_inset space \hfill{}
3780 \begin_inset Flex Code
3783 \begin_layout Plain Layout
3789 an external keymap translation program
3792 \begin_layout Standard
3793 Also, it should look into
3794 \begin_inset Flex Code
3797 \begin_layout Plain Layout
3803 file for defaults, too (for example, a
3804 \begin_inset Flex Code
3807 \begin_layout Plain Layout
3815 option to include default keyboard).
3823 \begin_layout Section
3824 International Keymap Stuff
3825 \begin_inset CommandInset label
3827 name "sec:International-Keymap-Stuff"
3834 \begin_layout Standard
3835 \begin_inset Note Note
3838 \begin_layout Plain Layout
3839 In doing the revisions on this document in March 2008, I did not look over
3840 this stuff, as I do not understand it.
3841 It would be good if someone else could do so.
3850 \begin_layout Standard
3851 The next two sections describe the
3852 \begin_inset Flex Code
3855 \begin_layout Plain Layout
3864 \begin_inset Flex Code
3867 \begin_layout Plain Layout
3875 file syntax in detail.
3876 These sections should help you design your own key map if the ones provided
3877 do not meet your needs.
3880 \begin_layout Subsection
3884 \begin_layout Standard
3888 \begin_inset Flex Code
3891 \begin_layout Plain Layout
3897 file maps keystrokes to characters or strings.
3898 As the name suggests, it sets a keyboard mapping.
3900 \begin_inset Flex Code
3903 \begin_layout Plain Layout
3914 \begin_inset Flex Code
3917 \begin_layout Plain Layout
3932 \begin_inset Flex Code
3935 \begin_layout Plain Layout
3948 \begin_inset Flex Code
3951 \begin_layout Plain Layout
3960 \begin_inset Flex Code
3963 \begin_layout Plain Layout
3971 are described in this section.
3974 \begin_layout Labeling
3975 \labelwidthstring 00.00.0000
3976 \begin_inset Flex Code
3979 \begin_layout Plain Layout
3987 Map a character to a string
3990 \begin_layout LyX-Code
4005 \begin_layout Standard
4038 the double-quote (")
4055 must be escaped with a preceding backslash (
4066 \begin_layout Standard
4068 \begin_inset Flex MenuItem
4071 \begin_layout Plain Layout
4079 statement to cause the symbol
4080 \begin_inset Flex MenuItem
4083 \begin_layout Plain Layout
4091 to be output for the keystroke
4092 \begin_inset Flex MenuItem
4095 \begin_layout Plain Layout
4106 \begin_layout LyX-Code
4112 \begin_layout Labeling
4113 \labelwidthstring 00.00.0000
4114 \begin_inset Flex Code
4117 \begin_layout Plain Layout
4125 Specify an accent character
4128 \begin_layout LyX-Code
4137 \begin_layout Standard
4138 This will make the cha
4176 This is the dead key
4180 \begin_layout Plain Layout
4187 refers to a key that does not produce a character by itself, but when followed
4188 with another key, produces the desired accent character.
4189 For example, a German characte
4191 r with an umlaut like
4201 can be produced in this manner.
4210 \begin_layout Standard
4223 and then another key not in
4240 followed by the other, not allowed key, as output.
4244 \begin_inset Flex MenuItem
4247 \begin_layout Plain Layout
4255 cancels a dead key, so if
4266 \begin_inset Flex MenuItem
4269 \begin_layout Plain Layout
4278 , the cursor will not go one position backwards but will instead cancel
4294 might have had on the next keystroke.
4298 \begin_layout Standard
4299 The following example specifies that the character ' is to be an acute accent,
4300 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4303 \begin_layout LyX-Code
4306 kmod ' acute aeiouAEIOU
4309 \begin_layout Labeling
4310 \labelwidthstring 00.00.0000
4311 \begin_inset Flex Code
4314 \begin_layout Plain Layout
4320 Specify an exception to the accent character
4323 \begin_layout LyX-Code
4332 \begin_layout Standard
4333 This defines an exce
4374 have been assigned a keystroke with a previous
4377 \begin_inset Flex Code
4380 \begin_layout Plain Layout
4404 must not belong in the
4451 If such a declaration does not exist in
4459 \begin_inset Flex Code
4462 \begin_layout Plain Layout
4496 \begin_inset Flex Code
4499 \begin_layout Plain Layout
4513 \begin_layout Standard
4514 The following command produces causes äi to be produced when you enter acute-i
4518 \begin_layout LyX-Code
4532 \begin_layout Labeling
4533 \labelwidthstring 00.00.0000
4534 \begin_inset Flex Code
4537 \begin_layout Plain Layout
4543 Combine two accent characters
4546 \begin_layout LyX-Code
4552 accent1 accent2 allowed
4555 \begin_layout Standard
4556 This one is getting pretty esoteric.
4557 It allows you to combine the effect
4613 \begin_inset Flex Code
4616 \begin_layout Plain Layout
4644 \begin_layout Standard
4645 Consider this example from the
4646 \begin_inset Flex Code
4649 \begin_layout Plain Layout
4660 \begin_layout LyX-Code
4663 kmod ; acute aeioyvhAEIOYVH
4667 kcomb acute umlaut iyIY
4670 \begin_layout Standard
4671 This allows you to press
4672 \begin_inset Flex MenuItem
4675 \begin_layout Plain Layout
4683 and get the effect of
4684 \begin_inset Flex Code
4687 \begin_layout Plain Layout
4706 in this case cancels the last dead key, so if you press
4707 \begin_inset Flex MenuItem
4710 \begin_layout Plain Layout
4719 \begin_inset Flex Code
4722 \begin_layout Plain Layout
4735 \begin_layout Subsection
4739 \begin_layout Standard
4741 \begin_inset Flex Code
4744 \begin_layout Plain Layout
4752 mapping is performed, a
4753 \begin_inset Flex Code
4756 \begin_layout Plain Layout
4766 file maps the strings that the symbols generate to characters in the current
4768 The LyX distribution currently includes at least the
4769 \begin_inset Flex Code
4772 \begin_layout Plain Layout
4781 \begin_inset Flex Code
4784 \begin_layout Plain Layout
4795 \begin_layout Standard
4797 \begin_inset Flex Code
4800 \begin_layout Plain Layout
4808 file is a sequence of declarations of the form
4811 \begin_layout LyX-Code
4824 \begin_layout Standard
4825 For example, in order to map
4826 \begin_inset Flex MenuItem
4829 \begin_layout Plain Layout
4839 to the corresponding character in the iso-8859-1 set (233), the following
4843 \begin_layout LyX-Code
4851 \begin_layout Standard
4853 \begin_inset Flex Code
4856 \begin_layout Plain Layout
4865 \begin_inset Flex Code
4868 \begin_layout Plain Layout
4886 the same character can apply to more than one string.
4888 \begin_inset Flex Code
4891 \begin_layout Plain Layout
4902 \begin_layout LyX-Code
4914 \begin_inset Newline newline
4930 \begin_layout Standard
4931 If LyX cannot find a mapping for the string produced by the keystroke or
4932 a deadkey sequence, it will check if it looks like an accented char and
4933 try to draw an accent over the character on screen.
4936 \begin_layout Subsection
4940 \begin_layout Standard
4941 There is a second way to add support for international characters through
4942 so-called dead-keys.
4943 A dead-key works in combination with a letter to produce an accented character.
4944 Here, we'll explain how to create a really simple dead-key to illustrate
4948 \begin_layout Standard
4949 Suppose you happen to need the circumflex character,
4950 \begin_inset Quotes eld
4954 \begin_inset Quotes erd
4959 \begin_inset Flex MenuItem
4962 \begin_layout Plain Layout
4969 \begin_inset space ~
4973 \begin_inset Flex MenuItem
4976 \begin_layout Plain Layout
4982 ] to the LyX command
4983 \begin_inset Flex Code
4986 \begin_layout Plain Layout
4993 \begin_inset Flex Code
4996 \begin_layout Plain Layout
5003 Now, whenever you type the
5004 \begin_inset Flex MenuItem
5007 \begin_layout Plain Layout
5013 -key followed by a letter, that letter will have a circumflex accent on
5015 For example, the sequence
5016 \begin_inset Quotes eld
5020 \begin_inset Flex MenuItem
5023 \begin_layout Plain Layout
5030 \begin_inset Quotes erd
5033 produces the letter:
5034 \begin_inset Quotes eld
5038 \begin_inset Quotes erd
5042 If you tried to type
5043 \begin_inset Quotes eld
5047 \begin_inset Flex MenuItem
5050 \begin_layout Plain Layout
5057 \begin_inset Quotes erd
5060 , however, LyX will complain with a beep, since a
5061 \begin_inset Quotes eld
5065 \begin_inset Flex MenuItem
5068 \begin_layout Plain Layout
5075 \begin_inset Quotes erd
5078 never takes a circumflex accent.
5080 \begin_inset Flex MenuItem
5083 \begin_layout Plain Layout
5089 after a dead-key produces the bare-accent.
5090 Please note this last point! If you bind a key to a dead-key, you'll need
5091 to rebind the character on that key to yet another key.
5093 \begin_inset Flex MenuItem
5096 \begin_layout Plain Layout
5102 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5105 \begin_layout Standard
5106 One common way to bind dead-keys is to use
5107 \begin_inset Flex MenuItem
5110 \begin_layout Plain Layout
5117 \begin_inset Flex MenuItem
5120 \begin_layout Plain Layout
5127 \begin_inset Flex MenuItem
5130 \begin_layout Plain Layout
5136 in combination with an accent, like
5137 \begin_inset Quotes eld
5141 \begin_inset Flex MenuItem
5144 \begin_layout Plain Layout
5151 \begin_inset Quotes erd
5155 \begin_inset Quotes eld
5159 \begin_inset Flex MenuItem
5162 \begin_layout Plain Layout
5169 \begin_inset Quotes erd
5173 \begin_inset Quotes eld
5177 \begin_inset Flex MenuItem
5180 \begin_layout Plain Layout
5187 \begin_inset Quotes erd
5191 Another way involves using
5192 \begin_inset Flex Code
5195 \begin_layout Plain Layout
5202 \begin_inset Flex Code
5205 \begin_layout Plain Layout
5211 to set up the special
5212 \begin_inset Flex Code
5215 \begin_layout Plain Layout
5223 \begin_inset Flex Code
5226 \begin_layout Plain Layout
5232 acts in some ways just like
5233 \begin_inset Flex MenuItem
5236 \begin_layout Plain Layout
5242 and permits you to bind keys to accented characters.
5243 You can also turn keys into dead-keys by binding them to something like
5245 \begin_inset Flex Code
5248 \begin_layout Plain Layout
5254 and then binding this symbolic key to the corresponding LyX command.
5258 \begin_layout Plain Layout
5263 : This is exactly what I do in my
5264 \begin_inset Flex Code
5267 \begin_layout Plain Layout
5274 \begin_inset Flex Code
5277 \begin_layout Plain Layout
5285 \begin_inset Flex MenuItem
5288 \begin_layout Plain Layout
5290 \begin_inset space ~
5299 \begin_inset Flex Code
5302 \begin_layout Plain Layout
5308 and a bunch of these
5309 \begin_inset Quotes eld
5313 \begin_inset Flex Code
5316 \begin_layout Plain Layout
5323 \begin_inset Quotes erd
5326 symbolic keys bound such things as
5327 \begin_inset Flex MenuItem
5330 \begin_layout Plain Layout
5332 \begin_inset space ~
5341 \begin_inset Flex MenuItem
5344 \begin_layout Plain Layout
5346 \begin_inset space ~
5355 This is how I produce my accented characters.
5360 You can make just about anything into the
5361 \begin_inset Flex Code
5364 \begin_layout Plain Layout
5371 \begin_inset Flex MenuItem
5374 \begin_layout Plain Layout
5380 keys, a spare function key, etc.
5381 As for the LyX commands that produce accents, check the entry for
5382 \begin_inset Flex Code
5385 \begin_layout Plain Layout
5396 You'll find the complete list there.
5399 \begin_layout Subsection
5400 Saving your Language Configuration
5403 \begin_layout Standard
5404 You can edit your preferences so that your desired language environment
5405 is automatically configured when LyX starts up, via the
5406 \begin_inset Flex MenuItem
5409 \begin_layout Plain Layout
5410 Edit\SpecialChar \menuseparator
5419 \begin_layout Chapter
5420 Installing New Document Classes, Layouts, and Templates
5421 \begin_inset CommandInset label
5423 name "cha:Installing-New-Document"
5428 \begin_inset Argument 1
5431 \begin_layout Plain Layout
5432 Installing New Document Classes
5440 \begin_layout Standard
5441 In this chapter, we describe the procedures for creating and installing
5442 new LyX layout and template files, as well as offer a refresher on correctly
5443 installing new LaTeX document classes.
5447 \begin_layout Standard
5448 First, let us a say a few words about how one ought to think about the relation
5449 between LyX and LaTeX.
5450 The thing to understand is that, in a certain sense, LyX doesn't know anything
5452 Indeed, from LyX's point of view, LaTeX is just one of several
5453 \begin_inset Quotes eld
5457 \begin_inset Quotes erd
5460 in which it is capable of producing output.
5461 Other such formats are DocBook, plaintext, and XHTML.
5462 LaTeX is, of course, a particularly important format, but very little of
5463 the information LyX has about LaTeX is actually contained in the program
5468 \begin_layout Plain Layout
5469 Some commands are sufficiently complex that they are
5470 \begin_inset Quotes eld
5474 \begin_inset Quotes erd
5478 But the developers generally regard this as a Bad Thing.
5483 Rather, that information, even for the standard classes like
5484 \begin_inset Flex Code
5487 \begin_layout Plain Layout
5493 , is contained in `layout files'.
5494 Similarly, LyX itself does not know much about DocBook or XHTML.
5495 What it knows is contained in layout files.
5498 \begin_layout Standard
5499 You can think of the layout file for a given document class as a translation
5500 manual between LyX constructs---paragraphs with their corresponding styles,
5501 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5503 Almost everything LyX knows about
5504 \begin_inset Flex Code
5507 \begin_layout Plain Layout
5513 , for example, is contained in the file
5514 \begin_inset Flex Code
5517 \begin_layout Plain Layout
5523 and in various other files it includes.
5524 For this reason, anyone intending to write layout files should plan to
5525 study the existing files.
5526 A good place to start is with
5527 \begin_inset Flex Code
5530 \begin_layout Plain Layout
5536 , which is included in
5537 \begin_inset Flex Code
5540 \begin_layout Plain Layout
5547 \begin_inset Flex Code
5550 \begin_layout Plain Layout
5556 , and many of the other layout files for document classes.
5557 This file is where sections and the like are defined:
5558 \begin_inset Flex Code
5561 \begin_layout Plain Layout
5567 tells LyX how paragraphs that are marked with the Section, Subsection,
5568 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5571 \begin_inset Flex Code
5574 \begin_layout Plain Layout
5580 file basically just includes several of these
5581 \begin_inset Flex Code
5584 \begin_layout Plain Layout
5593 \begin_layout Standard
5594 Defining the LyX--LaTeX correspondence is not the only thing layout files
5596 Their other job is to define how the LyX constructs themselves will appear
5598 The fact that layout files have these two jobs is often a source of confusion,
5599 because they are completely separate.
5600 Telling LyX how to translate a certain paragraph style into LaTeX does
5601 not tell LyX how to display it; conversely, telling LyX how to display
5602 a certain paragraph style does not tell LyX how to translate it into LaTeX
5603 (let alone tell LaTeX how to display it).
5604 So, in general, when you define a new LyX construct, you must always do
5605 two quite separate things: (i)
5606 \begin_inset space ~
5609 tell LyX how to translate it into LaTeX and (ii)
5610 \begin_inset space ~
5613 tell LyX how to display it.
5616 \begin_layout Standard
5617 Much the same is true, of course, as regards LyX's other backend formats,
5618 though XHTML is in some ways different, because in that case LyX
5622 able, to some extent, to use information about how it should display a
5623 paragraph on the screen to output information (in the form of CSS) about
5624 how the paragraph should be displayed in a browser.
5625 Even in this case, however, the distinction between what LyX does internally
5626 and how things are rendered externally remains in force, and the two can
5627 be controlled separately.
5629 \begin_inset CommandInset ref
5631 reference "sec:Tags-for-XHTML"
5638 \begin_layout Section
5639 Installing new LaTeX files
5642 \begin_layout Standard
5643 Some installations may not include a LaTeX package or class file that you
5644 would like to use within LyX.
5645 For example, you might need FoilTeX, a package for preparing slides for
5646 overhead projectors.
5647 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5648 a user interface for installing such packages.
5649 For example, with MiKTeX, you start the program
5650 \begin_inset Quotes eld
5654 \begin_inset space ~
5658 \begin_inset Quotes erd
5661 to get a list of available packages.
5662 To install one of them, right click on it or use the corresponding toolbar
5666 \begin_layout Standard
5667 If your LaTeX distribution does not provide such a `package manager', or
5668 if the package is not available from your distribution, then follow these
5669 steps to install it manually:
5672 \begin_layout Enumerate
5673 Get the package from
5674 \begin_inset CommandInset href
5677 target "http://www.ctan.org/"
5684 \begin_layout Enumerate
5685 If the package contains a file with the ending
5686 \begin_inset Quotes eld
5690 \begin_inset Flex Code
5693 \begin_layout Plain Layout
5700 \begin_inset Quotes erd
5703 (is the case for FoilTeX) then open a console, change to the folder of
5704 this file and execute the command
5705 \begin_inset Flex Code
5708 \begin_layout Plain Layout
5715 You have now unpacked the package and have all files to install it.
5716 Most LaTeX-packages are not packed and you can skip this step.
5719 \begin_layout Enumerate
5720 Now you need to decide if the package should be available for all users
5725 \begin_layout Enumerate
5726 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5727 for all users on your system, then install it in your `local' TeX tree,
5728 otherwise install it in your own `user' TeX tree.
5729 Where these trees should be created, if they do not already exist, depends
5731 To find this out, look in the file
5732 \begin_inset Flex Code
5735 \begin_layout Plain Layout
5745 \begin_layout Plain Layout
5746 This is usually in the directory
5747 \begin_inset Flex Code
5750 \begin_layout Plain Layout
5756 , though you can execute the command
5757 \begin_inset Flex Code
5760 \begin_layout Plain Layout
5771 The location of the `local' TeX tree is defined by the
5772 \begin_inset Flex Code
5775 \begin_layout Plain Layout
5781 variable; this is usually somewhere like
5782 \begin_inset Flex Code
5785 \begin_layout Plain Layout
5786 /usr/local/share/texmf
5792 The location of the `user' TeX tree is defined by
5793 \begin_inset Flex Code
5796 \begin_layout Plain Layout
5803 \begin_inset Flex Code
5806 \begin_layout Plain Layout
5813 (If these variables are not predefined, you have to define them.) You'll
5814 probably need root permissions to create or modify the `local' tree, but
5815 not for your `user' tree.
5816 \begin_inset Newline newline
5819 In general, it is recommended to install in the user tree because your user
5820 will not be modified or even overwritten when you upgrade your system.
5821 It will typically also be backed up together with everything else when
5822 you backup your home directory (which, of course, you do on a regular basis).
5825 \begin_layout Enumerate
5826 On Windows, if you want the new package to be available for all users on
5827 your system, change to the folder where LaTeX is installed and then change
5829 \begin_inset Flex Code
5832 \begin_layout Plain Layout
5843 (For MiKTeX, this would be by default the folder
5844 \begin_inset Flex Code
5847 \begin_layout Plain Layout
5865 \begin_layout Plain Layout
5866 Note that this will be the correct path only on English installations.
5867 On a German one, it would be
5868 \begin_inset Flex Code
5871 \begin_layout Plain Layout
5885 , and similarly for other languages.
5890 Create there a new folder
5891 \begin_inset Flex Code
5894 \begin_layout Plain Layout
5900 and copy all files of the package into it.
5902 \begin_inset Newline newline
5905 If the package should only available for you or you don't have admin permissions
5906 , do the same, but in the local LaTeX folder.
5908 \begin_inset space \thinspace{}
5912 \begin_inset space ~
5915 2.8 under Windows XP, this would be the folder:
5916 \begin_inset Newline newline
5922 \begin_inset Flex Code
5925 \begin_layout Plain Layout
5928 Documents and Settings
5940 \begin_inset Newline newline
5946 \begin_inset Phantom HPhantom
5949 \begin_layout Plain Layout
5960 \begin_inset Flex Code
5963 \begin_layout Plain Layout
5976 \begin_inset Newline newline
5979 On Vista, it would be:
5980 \begin_inset Newline newline
5984 \begin_inset Flex Code
5987 \begin_layout Plain Layout
6013 \begin_layout Enumerate
6014 Now one only need to tell LaTeX that there are new files.
6015 This depends on the used LaTeX-Distribution:
6019 \begin_layout Enumerate
6020 For TeXLive execute the command
6021 \begin_inset Flex Code
6024 \begin_layout Plain Layout
6031 If you installed the package for all users, then you will probably need
6032 to have root permissions for that.
6035 \begin_layout Enumerate
6036 For MiKTeX, if you have installed the package for all users, start the program
6038 \begin_inset Quotes eld
6042 \begin_inset space ~
6046 \begin_inset Quotes erd
6049 and press the button marked
6050 \begin_inset Quotes eld
6054 \begin_inset Quotes erd
6058 Otherwise start the program
6059 \begin_inset Quotes eld
6063 \begin_inset Quotes erd
6070 \begin_layout Enumerate
6071 Finally, you need to tell LyX that there are new packages available.
6072 So, in LyX, use the menu
6073 \begin_inset Flex MenuItem
6076 \begin_layout Plain Layout
6079 \SpecialChar \menuseparator
6085 and then restart LyX.
6088 \begin_layout Standard
6089 Now the package is installed.
6090 In our example, the document class
6091 \begin_inset Flex Code
6094 \begin_layout Plain Layout
6096 \begin_inset space ~
6103 \begin_layout Plain Layout
6115 will now be available under
6116 \begin_inset Flex MenuItem
6119 \begin_layout Plain Layout
6120 Document\SpecialChar \menuseparator
6121 Settings\SpecialChar \menuseparator
6131 \begin_layout Standard
6132 If you would like to use a LaTeX document class that is not even listed
6134 \begin_inset Flex MenuItem
6137 \begin_layout Plain Layout
6138 Document\SpecialChar \menuseparator
6139 Settings\SpecialChar \menuseparator
6145 , then you need to create a `layout' file for it.
6146 That is the topic of the next section.
6149 \begin_layout Section
6150 Types of layout files
6153 \begin_layout Standard
6154 This section describes the various sorts of LyX files that contain layout
6156 These files describe various paragraph and character styles, determining
6157 how LyX should display them and how they should be translated into LaTeX,
6158 DocBook, XHTML, or whatever output format is being used.
6162 \begin_layout Standard
6163 We shall try to provide a thorough description of the process of writing
6165 However, there are so many different types of documents supported even
6166 by just LaTeX that we can't hope to cover every different possibility or
6167 problem you might encounter.
6168 The LyX users' list is frequented by people with lots of experience with
6169 layout design who are willing to share what they've learned, so please
6170 feel free to ask questions there.
6173 \begin_layout Standard
6174 As you prepare to write a new layout, it is extremely helpful to look at
6175 the layouts distributed with LyX.
6176 If you write a LyX layout for a LaTeX document class that might also be
6177 used by others, or write a module that might be useful to others, then
6178 you should consider posting your layout to the
6179 \begin_inset CommandInset href
6181 name "layout section on the LyX wiki"
6182 target "http://wiki.lyx.org/Layouts/Layouts"
6186 or even to the LyX developers' list, so that it might be included in LyX
6191 \begin_layout Plain Layout
6192 Note that LyX is licensed under the General Public License, so any material
6193 that is contributed to LyX must be similarly licensed.
6201 \begin_layout Subsection
6203 \begin_inset CommandInset label
6205 name "sub:Layout-modules"
6212 \begin_layout Standard
6213 We have spoken to this point about `layout files'.
6214 But there are different sorts of files that contain layout information.
6215 Layout files, strictly so called, have the
6216 \begin_inset Flex Code
6219 \begin_layout Plain Layout
6225 extension and provide LyX with information about document classes.
6226 As of LyX 1.6, however, layout information can also be contained in layout
6232 \begin_inset Flex Code
6235 \begin_layout Plain Layout
6242 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6243 some modules—such as the
6244 \begin_inset Flex Code
6247 \begin_layout Plain Layout
6253 module—specifically provide support for one package.
6254 In a sense, layout modules are similar to included
6258 \begin_layout Plain Layout
6259 These can have any extension, but by convention have the
6260 \begin_inset Flex Code
6263 \begin_layout Plain Layout
6275 \begin_inset Flex Code
6278 \begin_layout Plain Layout
6284 —in that modules are not specific to a given document class but may be used
6285 with many different classes.
6286 The difference is that using an included file with
6287 \begin_inset Flex Code
6290 \begin_layout Plain Layout
6296 requires editing that file.
6297 Modules, by contrast, are selected in the
6298 \begin_inset Flex MenuItem
6301 \begin_layout Plain Layout
6302 Document\SpecialChar \menuseparator
6311 \begin_layout Standard
6312 Building modules is the easiest way to get started with layout editing,
6313 since it can be as simple as adding a single new paragraph style or flex
6315 But modules may, in principle, contain anything a layout file can contain.
6318 \begin_layout Standard
6319 After creating a new module and copying it to the
6320 \begin_inset Flex Code
6323 \begin_layout Plain Layout
6329 folder, you will need to reconfigure and then restart LyX for the module
6330 to appear in the menu.
6331 However, changes you make to the module will be seen immediately, if you
6333 \begin_inset Flex MenuItem
6336 \begin_layout Plain Layout
6337 Document\SpecialChar \menuseparator
6343 , highlight something, and then hit
6344 \begin_inset Quotes eld
6348 \begin_inset Quotes erd
6354 It is strongly recommended that you save your work before doing this
6359 it is strongly recommended that you not attempt to edit modules while simultaneo
6360 usly working on actual documents
6363 Though of course the developers strive to keep LyX stable in such situations,
6364 syntax errors and the like in your module file could cause strange behavior.
6367 \begin_layout Subsubsection
6371 \begin_layout Standard
6372 Modules are to LyX as packages are to LaTeX.
6373 Sometimes, however, you find yourself wanting a specific inset or character
6374 style just for one document and writing a module that will also be available
6375 to other documents makes little sense.
6376 What you need is LyX's
6377 \begin_inset Quotes eld
6381 \begin_inset Quotes erd
6387 \begin_layout Standard
6388 You will find it under
6390 Document\SpecialChar \menuseparator
6391 Settings\SpecialChar \menuseparator
6395 The large text box allows you to enter anything that you might enter in
6396 a layout file or module.
6397 You can think of a document's local layout, in fact, as a module that belongs
6399 So, in particular, you must enter a
6400 \begin_inset Flex Code
6403 \begin_layout Plain Layout
6410 Any format is acceptable, but one would normally use the format current
6412 (In LyX 2.0, the current layout format is 35.) You should be aware that local
6413 layout is not supported by versions of LyX prior to 1.6, so you should not
6414 use it if you want to be able to export your document to LyX 1.5 or earlier
6415 (without, that is, losing the local layout information).
6416 If you wish to be able to export to 1.6---local layout is supported in 1.6,
6417 though there is no UI for it---then you should use format 11 and, of course,
6418 use only layout constructs that were available in LyX 1.6.
6421 \begin_layout Standard
6422 When you have entered something in the
6423 \begin_inset Flex Code
6426 \begin_layout Plain Layout
6432 pane, LyX will enable the
6433 \begin_inset Quotes eld
6437 \begin_inset Quotes erd
6440 button at the bottom.
6441 Clicking this button will cause LyX to determine whether what you have
6442 entered is valid layout information for the chosen format.
6443 LyX will report the result but, unfortunately, will not tell you what errors
6444 there might have been.
6445 These will be written to the terminal, however, if LyX is started from
6447 You will not be permitted to save your local layout until you have entered
6451 \begin_layout Standard
6452 The warnings at the end of the previous section apply here, too.
6453 Do not play with local layout while you are actually working, especially
6454 if you have not saved your document.
6455 That said, using local layout with a test document can be a very convenient
6456 way to try out layout ideas, or even to start developing a module.
6459 \begin_layout Subsection
6461 \begin_inset Flex MenuItem
6464 \begin_layout Plain Layout
6473 \begin_layout Standard
6474 There are two situations you are likely to encounter when wanting to support
6475 a new LaTeX document class, involving style (
6476 \begin_inset Flex Code
6479 \begin_layout Plain Layout
6485 ) files and LaTeX2e class (
6486 \begin_inset Flex Code
6489 \begin_layout Plain Layout
6496 Supporting a style file is usually fairly easy.
6497 Supporting a new class file is a bit harder.
6498 We'll discuss the former in this section and the latter in the next.
6499 Similar remarks apply, of course, if you want to support a new DocBook
6503 \begin_layout Standard
6504 The easier case is the one in which your new document class is provided
6505 as a style file that is to be used in conjunction with an already supported
6507 For the sake of the example, we'll assume that the style file is called
6509 \begin_inset Flex MenuItem
6512 \begin_layout Plain Layout
6518 and that it is meant to be used with
6519 \begin_inset Flex MenuItem
6522 \begin_layout Plain Layout
6528 , which is a standard class.
6532 \begin_layout Standard
6533 Start by copying the existing class's layout file into your local directory:
6537 \begin_layout Plain Layout
6538 Of course, which directory is your local directory will vary by platform,
6539 and LyX allows you to specify your local directory on startup, too, using
6541 \begin_inset Flex Code
6544 \begin_layout Plain Layout
6558 \begin_layout LyX-Code
6559 cp report.layout ~/.lyx/layouts/myclass.layout
6562 \begin_layout Standard
6564 \begin_inset Flex Code
6567 \begin_layout Plain Layout
6573 and change the line:
6576 \begin_layout LyX-Code
6579 DeclareLaTeXClass{report}
6582 \begin_layout Standard
6586 \begin_layout LyX-Code
6589 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6592 \begin_layout Standard
6596 \begin_layout LyX-Code
6598 \begin_inset Newline newline
6604 \begin_inset Newline newline
6610 \begin_layout Standard
6611 near the top of the file.
6614 \begin_layout Standard
6615 Start LyX and select
6616 \begin_inset Flex MenuItem
6619 \begin_layout Plain Layout
6620 Tools\SpecialChar \menuseparator
6627 Then restart LyX and try creating a new document.
6629 \begin_inset Flex MenuItem
6632 \begin_layout Plain Layout
6638 " as a document class option in the
6639 \begin_inset Flex MenuItem
6642 \begin_layout Plain Layout
6643 Document\SpecialChar \menuseparator
6650 It is likely that some of the sectioning commands and such in your new
6651 class will work differently from how they worked in the base class—
6652 \begin_inset Flex Code
6655 \begin_layout Plain Layout
6661 in this example—so you can fiddle around with the settings for the different
6662 sections if you wish.
6663 The layout information for sections is contained in
6664 \begin_inset Flex Code
6667 \begin_layout Plain Layout
6673 , but you do not need to copy and change this file.
6674 Instead, you can simply add your changes to your layout file, after the
6676 \begin_inset Flex Code
6679 \begin_layout Plain Layout
6685 , which itself includes
6686 \begin_inset Flex Code
6689 \begin_layout Plain Layout
6696 For example, you might add these lines:
6699 \begin_layout LyX-Code
6703 \begin_layout LyX-Code
6707 \begin_layout LyX-Code
6711 \begin_layout LyX-Code
6715 \begin_layout LyX-Code
6719 \begin_layout Standard
6720 to change the font for chapter headings to sans-serif.
6721 This will override (or, in this case, add to) the existing declaration
6722 for the Chapter style.
6726 \begin_layout Standard
6727 Your new package may also provide commands or environments not present in
6729 In this case, you will want to add these to the layout file.
6731 \begin_inset CommandInset ref
6733 reference "sec:TextClass"
6737 for information on how to do so.
6740 \begin_layout Standard
6742 \begin_inset Flex MenuItem
6745 \begin_layout Plain Layout
6751 can be used with several different document classes, and even if it cannot,
6752 you might find it easiest just to write a module that you can load with
6754 The simplest possible such module would be:
6757 \begin_layout LyX-Code
6760 DeclareLyXModule{My Package}
6763 \begin_layout LyX-Code
6767 \begin_layout LyX-Code
6768 #Support for mypkg.sty.
6771 \begin_layout LyX-Code
6773 \begin_inset Newline newline
6779 \begin_layout LyX-Code
6781 \begin_inset Newline newline
6787 \begin_layout LyX-Code
6789 \begin_inset Newline newline
6795 \begin_inset Newline newline
6801 \begin_layout Standard
6802 A more complex module might modify the behavior of some existing constructs
6803 or define some new ones.
6805 \begin_inset CommandInset ref
6807 reference "sec:TextClass"
6814 \begin_layout Subsection
6816 \begin_inset Flex MenuItem
6819 \begin_layout Plain Layout
6828 \begin_layout Standard
6829 There are two possibilities here.
6830 One is that the class file is itself based upon an existing document class.
6831 For example, many thesis classes are based upon
6832 \begin_inset Flex MenuItem
6835 \begin_layout Plain Layout
6842 To see whether yours is, look for a line like
6845 \begin_layout LyX-Code
6851 \begin_layout Standard
6853 If so, then you may proceed largely as in the previous section, though
6855 \begin_inset Flex Code
6858 \begin_layout Plain Layout
6864 line will be different.
6865 If your new class is
6866 \begin_inset Flex Code
6869 \begin_layout Plain Layout
6875 and it is based upon
6876 \begin_inset Flex Code
6879 \begin_layout Plain Layout
6885 , then the line should read:
6889 \begin_layout Plain Layout
6890 And it will be easiest if you save the file to
6891 \begin_inset Flex Code
6894 \begin_layout Plain Layout
6900 : LyX assumes that the document class has the same name as the layout file.
6909 \begin_layout LyX-Code
6912 DeclareLaTeXClass[thesis,book]{thesis}
6915 \begin_layout Standard
6916 If, on the other hand, the new class is not based upon an existing class,
6917 you will probably have to
6918 \begin_inset Quotes eld
6922 \begin_inset Quotes erd
6926 We strongly suggest copying an existing layout file which uses a similar
6927 LaTeX class and then modifying it, if you can do so.
6928 At least use an existing file as a starting point so you can find out what
6929 items you need to worry about.
6930 Again, the specifics are covered below.
6933 \begin_layout Subsection
6935 \begin_inset CommandInset label
6937 name "sub:Creating-Templates"
6944 \begin_layout Standard
6945 Once you have written a layout file for a new document class, you might
6946 want to consider writing a
6951 A template acts as a kind of tutorial for your layout, showing how it might
6952 be used, though containing dummy content.
6953 You can of course look at the various templates included with LyX for ideas.
6956 \begin_layout Standard
6957 Templates are created just like usual documents: using LyX.
6958 The only difference is that usual documents contain all possible settings,
6959 including the font scheme and the paper size.
6960 Usually a user doesn't want a template to overwrite his preferred settings
6961 for such parameters.
6962 For that reason, the designer of a template should remove the corresponding
6964 \begin_inset Flex Code
6967 \begin_layout Plain Layout
6976 \begin_inset Flex Code
6979 \begin_layout Plain Layout
6987 from the template LyX file.
6988 This can be done with any simple text-editor, for example
6989 \begin_inset Flex Code
6992 \begin_layout Plain Layout
6999 \begin_inset Flex Code
7002 \begin_layout Plain Layout
7012 \begin_layout Standard
7013 Put the edited template files you create in
7014 \begin_inset Flex Code
7017 \begin_layout Plain Layout
7023 , copy the ones you use from the global template directory in
7024 \begin_inset Flex Code
7027 \begin_layout Plain Layout
7033 to the same place, and redefine the template path in the
7034 \begin_inset Flex MenuItem
7037 \begin_layout Plain Layout
7038 Tools\SpecialChar \menuseparator
7039 Preferences\SpecialChar \menuseparator
7048 \begin_layout Standard
7049 Note, by the way, that there is a template which has a particular meaning:
7051 \begin_inset Flex Code
7054 \begin_layout Plain Layout
7061 This template is loaded every time you create a new document with
7062 \begin_inset Flex MenuItem
7065 \begin_layout Plain Layout
7066 File\SpecialChar \menuseparator
7072 in order to provide useful defaults.
7073 To create this template from inside LyX, all you have to do is to open
7074 a document with the correct settings, and use the
7075 \begin_inset Flex MenuItem
7078 \begin_layout Plain Layout
7079 Save as Document Defaults
7087 \begin_layout Subsection
7088 Upgrading old layout files
7091 \begin_layout Standard
7092 The format of layout files changes with each LyX release, so old layout
7093 files need to be converted to the new format.
7094 This process has been automated since LyX 1.4: If LyX reads a layout file
7095 in an older format, it automatically calls the script
7096 \begin_inset Flex Code
7099 \begin_layout Plain Layout
7105 to convert it to a temporary file in current format.
7106 The original file is left untouched.
7107 If you use the layout file often, then, you may want to convert it permanently,
7108 so that LyX does not have to do so itself every time.
7109 To do this, you can call the converter manually:
7112 \begin_layout LyX-Code
7113 mv myclass.layout myclass.old
7116 \begin_layout LyX-Code
7117 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
7120 \begin_layout Standard
7122 \begin_inset Flex Code
7125 \begin_layout Plain Layout
7131 with the name of your LyX system directory, of course.
7134 \begin_layout Standard
7135 Note that manual conversion does not affect included files, so these will
7136 have to be converted separately.
7139 \begin_layout Section
7140 \begin_inset CommandInset label
7142 name "sec:TextClass"
7146 The layout file format
7149 \begin_layout Standard
7150 When it's finally time to get your hands dirty and create or edit your own
7151 layout file, the following sections describe what you're up against.
7152 Our advice is to go slowly, save and test often, listen to soothing music,
7153 and enjoy one or two of your favorite adult beverages; more if you are
7154 getting particularly stuck.
7155 It's really not that hard, except that the multitude of options can become
7156 overwhelming if you try to do too much in one sitting.
7157 Go have another adult beverage, just for good measure.
7160 \begin_layout Standard
7161 Note that all the tags used in layout files are case-insensitive.
7163 \begin_inset Flex Code
7166 \begin_layout Plain Layout
7173 \begin_inset Flex Code
7176 \begin_layout Plain Layout
7183 \begin_inset Flex Code
7186 \begin_layout Plain Layout
7192 are really the same tag.
7193 The possible values are printed in brackets after the feature's name.
7194 The default value if a feature isn't specified inside a text class-description
7196 \begin_inset Flex Code
7199 \begin_layout Plain Layout
7208 If the argument has a data type like
7209 \begin_inset Quotes eld
7213 \begin_inset Quotes erd
7217 \begin_inset Quotes eld
7221 \begin_inset Quotes erd
7224 , the default is shown like this:
7225 \begin_inset Flex Code
7228 \begin_layout Plain Layout
7239 \begin_layout Subsection
7240 The document class declaration
7241 \change_inserted -712698321 1349766602
7247 \begin_layout Standard
7248 Lines in a layout file which begin with
7249 \begin_inset Flex Code
7252 \begin_layout Plain Layout
7259 There is one exception to this rule.
7261 \begin_inset Flex Code
7264 \begin_layout Plain Layout
7270 files should begin with
7271 \change_deleted -712698321 1349766533
7275 \change_inserted -712698321 1349766536
7281 \begin_layout LyX-Code
7284 #% Do not delete the line below; configure depends on this
7287 \begin_layout LyX-Code
7293 \change_deleted -712698321 1349766193
7295 \change_inserted -712698321 1349766201
7296 Article (Standard Class)
7299 \change_inserted -712698321 1349766538
7303 \begin_layout LyX-Code
7305 \change_inserted -712698321 1349766581
7310 DeclareCategory{Articles}
7315 \begin_layout Standard
7317 \change_inserted -712698321 1349766695
7321 \change_inserted -712698321 1349766626
7325 \change_deleted -712698321 1349766628
7327 \change_inserted -712698321 1349766628
7330 used when you (re)configure LyX.
7331 The layout file is read by the LaTeX script
7332 \begin_inset Flex Code
7335 \begin_layout Plain Layout
7341 , in a special mode where
7342 \begin_inset Flex Code
7345 \begin_layout Plain Layout
7352 The first line is just a LaTeX comment,
7353 \change_deleted -712698321 1349766656
7356 the second one contains the
7357 \change_inserted -712698321 1349766650
7360 declaration of the text class
7361 \change_inserted -712698321 1349766689
7362 , and the third line contains the optional classification of the class
7365 If these lines appear in a file named
7366 \begin_inset Flex Code
7369 \begin_layout Plain Layout
7375 , then they define a text class of name
7376 \begin_inset Flex Code
7379 \begin_layout Plain Layout
7385 (the name of the layout file) which uses the LaTeX document class
7386 \begin_inset Flex Code
7389 \begin_layout Plain Layout
7395 (the default is to use the same name as the layout).
7397 \begin_inset Quotes eld
7401 \change_deleted -712698321 1349766253
7403 \change_inserted -712698321 1349766260
7404 Article (Standard Class)
7407 \begin_inset Quotes erd
7410 that appears above is used as a description of the text class in the
7411 \begin_inset Flex MenuItem
7414 \begin_layout Plain Layout
7415 Document\SpecialChar \menuseparator
7423 \change_inserted -712698321 1349767097
7425 \begin_inset Quotes eld
7429 \begin_inset Quotes erd
7432 in the example) is also used in the
7433 \begin_inset Flex MenuItem
7436 \begin_layout Plain Layout
7438 \change_inserted -712698321 1349766801
7439 Document\SpecialChar \menuseparator
7445 dialog: the text classes are grouped by these categories (which are usually
7446 genres, so typical categories are
7447 \begin_inset Quotes eld
7451 \begin_inset Quotes erd
7455 \begin_inset Quotes eld
7459 \begin_inset Quotes erd
7463 \begin_inset Quotes eld
7467 \begin_inset Quotes erd
7471 \begin_inset Quotes eld
7475 \begin_inset Quotes erd
7479 \begin_inset Quotes eld
7483 \begin_inset Quotes erd
7487 \begin_inset Quotes eld
7491 \begin_inset Quotes erd
7495 If no category has been declared, the class will be put in the
7496 \begin_inset Quotes eld
7500 \begin_inset Quotes erd
7508 \begin_layout Standard
7509 Let's assume that you wrote your own text class that uses the
7510 \begin_inset Flex Code
7513 \begin_layout Plain Layout
7519 document class, but where you changed the appearance of the section headings.
7520 If you put it in a file
7521 \begin_inset Flex Code
7524 \begin_layout Plain Layout
7530 , the header of this file should be:
7533 \begin_layout LyX-Code
7536 #% Do not delete the line below; configure depends on this
7539 \begin_layout LyX-Code
7544 DeclareLaTeXClass[article]{
7545 \change_deleted -712698321 1349766303
7547 \change_inserted -712698321 1349766303
7551 \change_deleted -712698321 1349766338
7553 \change_inserted -712698321 1349766338
7557 \change_deleted -712698321 1349766340
7559 \change_inserted -712698321 1349766340
7563 \change_deleted -712698321 1349766343
7565 \change_inserted -712698321 1349766343
7569 \change_inserted -712698321 1349767223
7573 \begin_layout LyX-Code
7575 \change_inserted -712698321 1349767223
7580 DeclareCategory{Articles}
7585 \begin_layout Standard
7586 This declares a text class
7587 \begin_inset Flex Code
7590 \begin_layout Plain Layout
7596 , associated with the LaTeX document class
7597 \begin_inset Flex Code
7600 \begin_layout Plain Layout
7607 \begin_inset Quotes eld
7611 \change_deleted -712698321 1349766329
7613 \change_inserted -712698321 1349766329
7617 \change_deleted -712698321 1349766347
7619 \change_inserted -712698321 1349766347
7623 \change_deleted -712698321 1349766350
7625 \change_inserted -712698321 1349766350
7629 \change_deleted -712698321 1349766352
7631 \change_inserted -712698321 1349766352
7635 \begin_inset Quotes erd
7639 If your text class depends on several packages, you can declare it as:
7642 \begin_layout LyX-Code
7645 #% Do not delete the line below; configure depends on this
7648 \begin_layout LyX-Code
7653 DeclareLaTeXClass[article,foo.sty]{
7654 \change_deleted -712698321 1349766366
7656 \change_inserted -712698321 1349766366
7660 \change_deleted -712698321 1349766369
7662 \change_inserted -712698321 1349766369
7666 \change_deleted -712698321 1349766371
7668 \change_inserted -712698321 1349766371
7672 \change_deleted -712698321 1349766374
7674 \change_inserted -712698321 1349766374
7678 \change_inserted -712698321 1349767240
7682 \begin_layout LyX-Code
7684 \change_inserted -712698321 1349767240
7689 DeclareCategory{Articles}
7694 \begin_layout Standard
7695 This indicates that your text class uses the
7696 \begin_inset Flex Code
7699 \begin_layout Plain Layout
7706 Finally, it is also possible to declare classes for DocBook code.
7707 Typical declarations will look like:
7710 \begin_layout LyX-Code
7713 #% Do not delete the line below; configure depends on this
7716 \begin_layout LyX-Code
7721 DeclareDocBookClass[article]{SGML (DocBook
7722 \change_deleted -712698321 1349766387
7724 \change_inserted -712698321 1349766387
7728 \change_inserted -712698321 1349767247
7732 \begin_layout LyX-Code
7734 \change_inserted -712698321 1349767302
7739 DeclareCategory{Articles (DocBook)}
7744 \begin_layout Standard
7745 Note that these declarations can also be given an optional parameter declaring
7746 the name of the document class (but not a list).
7749 \begin_layout Standard
7750 So, to be as explicit as possible, the form of the layout declaration is:
7753 \begin_layout LyX-Code
7758 DeclareLaTeXClass[class,package.sty]{layout description}
7759 \change_inserted -712698321 1349767329
7763 \begin_layout LyX-Code
7765 \change_inserted -712698321 1349767339
7770 DeclareCategory{category}
7775 \begin_layout Standard
7776 The class need only be specified if the name of the LaTeX class file and
7777 the name of the layout file are different or if there are packages to load.
7778 If the name of the class file is not specified, then LyX will simply assume
7779 that it is the same as the name of the layout file.
7782 \begin_layout Standard
7783 When the text class has been modified to your taste, all you have to do
7784 is to copy it either to
7785 \begin_inset Flex Code
7788 \begin_layout Plain Layout
7795 \begin_inset Flex Code
7798 \begin_layout Plain Layout
7805 \begin_inset Flex MenuItem
7808 \begin_layout Plain Layout
7809 Tools\SpecialChar \menuseparator
7815 , exit LyX and restart.
7816 Then your new text class should be available along with the others.
7819 \begin_layout Standard
7820 Once the layout file is installed, you can edit it and see your changes
7821 without having to reconfigure or to restart LyX.
7826 \begin_layout Plain Layout
7827 In versions of LyX prior to 1.6, this was not true.
7828 As a result, editing layout files was very time consuming, since you had
7829 constantly to restart LyX to see changes.
7834 You can force a reload of the current layout by using the LyX function
7836 \begin_inset Flex MenuItem
7839 \begin_layout Plain Layout
7846 There is no default binding for this function—though, of course, you can
7847 bind it to a key yourself.
7848 But you will normally use this function simply by entering it in the mini-buffe
7853 \begin_layout Standard
7859 \begin_inset Flex MenuItem
7862 \begin_layout Plain Layout
7868 is very much an `advanced feature'.
7873 recommended that you save your work before using this function.
7878 recommended that you not attempt to edit layout information while simultaneousl
7879 y working on a document that you care about.
7880 Use a test document.
7881 Syntax errors and the like in your layout file could cause peculiar behavior.
7882 In particular, such errors could cause LyX to regard the current layout
7883 as invalid and to attempt to switch to some other layout.
7887 \begin_layout Plain Layout
7888 Really bad syntax errors may even caused LyX to exit.
7889 This is because certain sorts of errors may make LyX unable to read
7899 The LyX team strives to keep LyX stable in such situations, but safe is
7904 \begin_layout Plain Layout
7905 While we're giving advice: make regular backups.
7906 And be nice to your mother.
7914 \begin_layout Subsection
7915 The Module declaration
7918 \begin_layout Standard
7919 A module must begin with a line like the following:
7922 \begin_layout LyX-Code
7925 DeclareLyXModule[endnotes.sty]{Endnotes}
7928 \begin_layout Standard
7929 The mandatory argument, in curly brackets, is the name of the module, as
7931 \begin_inset Flex MenuItem
7934 \begin_layout Plain Layout
7935 Document\SpecialChar \menuseparator
7936 Settings\SpecialChar \menuseparator
7943 The argument in square brackets is optional: It declares any LaTeX packages
7944 on which the module depends.
7945 Please note that only packages about which LyX knows should be listed in
7946 the square brackets.
7950 \begin_layout Plain Layout
7951 The list of such packages is documented only in the source code.
7956 LyX will not check for arbitrary packages.
7957 It is also possible to use the form
7958 \begin_inset Flex MenuItem
7961 \begin_layout Plain Layout
7967 as an optional argument, which declares that the module can only be used
7968 when there exists a conversion chain between the formats `
7969 \begin_inset Flex Code
7972 \begin_layout Plain Layout
7979 \begin_inset Flex Code
7982 \begin_layout Plain Layout
7991 \begin_layout Standard
7992 The module declaration should then be followed by lines like the following
7996 \begin_layout Plain Layout
7997 Preferably in English if the module should be published with LyX.
7998 This description will appear in the list of messages to be translated and
7999 will be thus translated with the next interface update.
8007 \begin_layout LyX-Code
8011 \begin_layout LyX-Code
8012 #Adds an endnote command, in addition to footnotes.
8016 \begin_layout LyX-Code
8017 #You will need to add
8019 theendnotes in TeX code where you
8022 \begin_layout LyX-Code
8023 #want the endnotes to appear.
8027 \begin_layout LyX-Code
8031 \begin_layout LyX-Code
8032 #Requires: somemodule | othermodule
8035 \begin_layout LyX-Code
8036 #Excludes: badmodule
8039 \begin_layout Standard
8040 The description is used in
8041 \begin_inset Flex MenuItem
8044 \begin_layout Plain Layout
8045 Document\SpecialChar \menuseparator
8046 Settings\SpecialChar \menuseparator
8052 to provide the user with information about what the module does.
8054 \begin_inset Flex Code
8057 \begin_layout Plain Layout
8063 line is used to identify other modules with which this one must be used;
8065 \begin_inset Flex Code
8068 \begin_layout Plain Layout
8074 line is used to identify modules with which this one may not be used.
8075 Both are optional, and, as shown, multiple modules should be separated
8076 with the pipe symbol: |.
8077 Note that the required modules are treated disjunctively:
8081 of the required modules must be used.
8086 excluded module may be used.
8087 Note that modules are identified here by their
8092 \begin_inset Flex Code
8095 \begin_layout Plain Layout
8103 \begin_inset Flex Code
8106 \begin_layout Plain Layout
8113 \begin_inset Flex Code
8116 \begin_layout Plain Layout
8125 \begin_layout Subsection
8129 \begin_layout Standard
8130 The first non-comment line of any layout file, included file, or module
8135 contain the file format number:
8138 \begin_layout Description
8139 \begin_inset Flex Code
8142 \begin_layout Plain Layout
8149 \begin_inset Flex Code
8152 \begin_layout Plain Layout
8158 ] The format of the layout file.
8161 \begin_layout Standard
8162 This tag was introduced with LyX 1.4.0.
8163 Layout files from LyX 1.3.x and earlier don't have an explicit file format
8164 and are considered to be of format 1.
8165 The format for the present version of LyX is format 21.
8166 But each version of LyX is capable of reading earlier versions' layout
8167 files, just as they are capable of reading files produced by earlier versions
8169 There is, however, no provision for converting to earlier formats.
8170 So LyX 1.6.x will not read layout files in format 21 but only files in format
8174 \begin_layout Subsection
8175 \begin_inset CommandInset label
8177 name "sub:General-text-class"
8181 General text class parameters
8184 \begin_layout Standard
8185 These are general parameters that govern the behavior of an entire document
8191 mean that they must appear in
8192 \begin_inset Flex Code
8195 \begin_layout Plain Layout
8201 files rather than in modules.
8202 A module can contain any layout tag.)
8205 \begin_layout Description
8206 \begin_inset Flex Code
8209 \begin_layout Plain Layout
8215 Adds information that will be output in the
8216 \begin_inset Flex Code
8219 \begin_layout Plain Layout
8225 block when this document class is output to XHTML.
8226 Typically, this would be used to output CSS style information, but it can
8227 be used for anything that can appear in
8228 \begin_inset Flex Code
8231 \begin_layout Plain Layout
8239 \begin_inset Quotes eld
8243 \begin_inset Flex Code
8246 \begin_layout Plain Layout
8253 \begin_inset Quotes erd
8259 \begin_layout Description
8260 \begin_inset Flex Code
8263 \begin_layout Plain Layout
8269 Adds CSS styling information.
8270 This will either be output in a
8271 \begin_inset Quotes eld
8275 \begin_inset Flex Code
8278 \begin_layout Plain Layout
8285 \begin_inset Quotes erd
8288 block or, if the user has so chosen, to a separate CSS file.Must end with
8290 \begin_inset Quotes eld
8294 \begin_inset Flex Code
8297 \begin_layout Plain Layout
8304 \begin_inset Quotes erd
8310 \begin_layout Description
8311 \begin_inset Flex Code
8314 \begin_layout Plain Layout
8320 Adds information to the document preamble.
8322 \begin_inset Quotes eld
8326 \begin_inset Flex Code
8329 \begin_layout Plain Layout
8336 \begin_inset Quotes erd
8342 \begin_layout Description
8343 \begin_inset Flex Code
8346 \begin_layout Plain Layout
8352 Defines formats for use in the display of bibliographic information.
8354 \begin_inset CommandInset ref
8356 reference "sub:Citation-format-description"
8362 \begin_inset Quotes eld
8366 \begin_inset Flex Code
8369 \begin_layout Plain Layout
8376 \begin_inset Quotes erd
8382 \begin_layout Description
8383 \begin_inset Flex Code
8386 \begin_layout Plain Layout
8392 Describes various global options supported by the document class.
8394 \begin_inset space ~
8398 \begin_inset CommandInset ref
8400 reference "sub:ClassOptions"
8406 \begin_inset Quotes eld
8410 \begin_inset Flex Code
8413 \begin_layout Plain Layout
8420 \begin_inset Quotes erd
8426 \begin_layout Description
8427 \begin_inset Flex Code
8430 \begin_layout Plain Layout
8437 \begin_inset Flex Code
8440 \begin_layout Plain Layout
8449 \begin_inset Flex Code
8452 \begin_layout Plain Layout
8458 ] Whether the class should
8462 to having one or two columns.
8463 Can be changed in the
8464 \begin_inset Flex MenuItem
8467 \begin_layout Plain Layout
8468 Document\SpecialChar \menuseparator
8477 \begin_layout Description
8478 \begin_inset Flex Code
8481 \begin_layout Plain Layout
8488 \begin_inset Flex Code
8491 \begin_layout Plain Layout
8497 ] This sequence defines the properties for a counter.
8498 If the counter does not yet exist, it is created; if it does exist, it
8501 \begin_inset Quotes eld
8505 \begin_inset Flex Code
8508 \begin_layout Plain Layout
8515 \begin_inset Quotes erd
8519 \begin_inset Newline newline
8523 \begin_inset space ~
8527 \begin_inset CommandInset ref
8529 reference "sub:Counters"
8533 for details on counters.
8536 \begin_layout Description
8537 \begin_inset Flex Code
8540 \begin_layout Plain Layout
8546 Sets the default font used to display the document.
8548 \begin_inset space ~
8552 \begin_inset CommandInset ref
8554 reference "sub:Font-description"
8558 for how to declare fonts.
8560 \begin_inset Quotes eld
8564 \begin_inset Flex Code
8567 \begin_layout Plain Layout
8574 \begin_inset Quotes erd
8580 \begin_layout Description
8581 \begin_inset Flex Code
8584 \begin_layout Plain Layout
8591 \begin_inset Flex Code
8594 \begin_layout Plain Layout
8600 Specifies a module to be included by default with this document class.
8601 The module should be specified by filename without the
8602 \begin_inset Flex Code
8605 \begin_layout Plain Layout
8612 The user can still remove the module, but it will be active at the outset.
8613 (This applies only when new files are created, or when this class is chosen
8614 for an existing document.)
8617 \begin_layout Description
8618 \begin_inset Flex Code
8621 \begin_layout Plain Layout
8628 \begin_inset Flex Code
8631 \begin_layout Plain Layout
8637 ] This is the style that will be assigned to new paragraphs, usually
8638 \begin_inset Flex MenuItem
8641 \begin_layout Plain Layout
8648 This will default to the first defined style if not given, but you are
8649 encouraged to use this directive.
8652 \begin_layout Description
8653 \begin_inset Flex Code
8656 \begin_layout Plain Layout
8663 \begin_inset Flex Code
8666 \begin_layout Plain Layout
8672 ] This tag indicates that the module in question—which should be specified
8673 by filename without the
8674 \begin_inset Flex Code
8677 \begin_layout Plain Layout
8683 extension—cannot be used with this document class.
8684 This might be used in a journal-specific layout file to prevent, say, the
8686 \begin_inset Flex Code
8689 \begin_layout Plain Layout
8695 module that numbers theorems by section.
8700 be used in a module.
8701 Modules have their own way of excluding other modules (see
8702 \begin_inset CommandInset ref
8704 reference "sub:Layout-modules"
8711 \begin_layout Description
8712 \begin_inset Flex Code
8715 \begin_layout Plain Layout
8721 Defines a new float.
8723 \begin_inset space ~
8727 \begin_inset CommandInset ref
8729 reference "sub:Floats"
8735 \begin_inset Quotes eld
8739 \begin_inset Flex Code
8742 \begin_layout Plain Layout
8749 \begin_inset Quotes erd
8755 \begin_layout Description
8756 \begin_inset Flex Code
8759 \begin_layout Plain Layout
8765 Sets the information that will be output in the
8766 \begin_inset Flex Code
8769 \begin_layout Plain Layout
8775 block when this document class is output to XHTML.
8776 Note that this will completely override any prior
8777 \begin_inset Flex Code
8780 \begin_layout Plain Layout
8787 \begin_inset Flex Code
8790 \begin_layout Plain Layout
8798 \begin_inset Flex Code
8801 \begin_layout Plain Layout
8807 if you just want to add material to the preamble.) Must end with
8808 \begin_inset Quotes eld
8812 \begin_inset Flex Code
8815 \begin_layout Plain Layout
8822 \begin_inset Quotes erd
8828 \begin_layout Description
8829 \begin_inset Flex Code
8832 \begin_layout Plain Layout
8838 Sets CSS styling information.
8839 This will either be output in a
8840 \begin_inset Quotes eld
8844 \begin_inset Flex Code
8847 \begin_layout Plain Layout
8854 \begin_inset Quotes erd
8857 block or, if the user has so chosen, to a separate CSS file.
8858 Note that this will completely override any prior
8859 \begin_inset Flex Code
8862 \begin_layout Plain Layout
8869 \begin_inset Flex Code
8872 \begin_layout Plain Layout
8880 \begin_inset Flex Code
8883 \begin_layout Plain Layout
8889 if you just want to add material.) Must end with
8890 \begin_inset Quotes eld
8894 \begin_inset Flex Code
8897 \begin_layout Plain Layout
8904 \begin_inset Quotes erd
8910 \begin_layout Description
8911 \begin_inset Flex Code
8914 \begin_layout Plain Layout
8921 \begin_inset Flex Code
8924 \begin_layout Plain Layout
8930 ] The layout to use for the table of contents, bibliography, and so forth,
8931 when the document is output to HTML.
8932 For articles, this should normally be Section; for books, Chapter.
8933 If it is not given, then LyX will attempt to figure out which layout to
8937 \begin_layout Description
8938 \begin_inset Flex Code
8941 \begin_layout Plain Layout
8948 \begin_inset Flex Code
8951 \begin_layout Plain Layout
8957 ] Modifies the properties of the given counter.
8958 If the counter does not exist, the section is ignored.
8960 \begin_inset Quotes eld
8964 \begin_inset Flex Code
8967 \begin_layout Plain Layout
8974 \begin_inset Quotes erd
8978 \begin_inset Newline newline
8982 \begin_inset space ~
8986 \begin_inset CommandInset ref
8988 reference "sub:Counters"
8992 for details on counters.
8995 \begin_layout Description
8996 \begin_inset Flex Code
8999 \begin_layout Plain Layout
9006 \begin_inset Flex Code
9009 \begin_layout Plain Layout
9015 ] Modifies the properties of the given paragraph style.
9016 If the style does not exist, the section is ignored.
9018 \begin_inset Quotes eld
9022 \begin_inset Flex Code
9025 \begin_layout Plain Layout
9032 \begin_inset Quotes erd
9038 \begin_layout Description
9039 \begin_inset Flex Code
9042 \begin_layout Plain Layout
9048 As its name implies, this command allows you to include another layout
9049 definition file within yours to avoid duplicating commands.
9050 Common examples are the standard layout files, for example,
9051 \begin_inset Flex Code
9054 \begin_layout Plain Layout
9060 , which contains most of the basic layouts.
9063 \begin_layout Description
9064 \begin_inset Flex Code
9067 \begin_layout Plain Layout
9073 This section (re-)defines the layout of an inset.
9074 It can be applied to an existing inset or to a new, user-defined inset,
9075 e.g., a new character style.
9077 \begin_inset Quotes eld
9081 \begin_inset Flex Code
9084 \begin_layout Plain Layout
9091 \begin_inset Quotes erd
9095 \begin_inset Newline newline
9099 \begin_inset space ~
9103 \begin_inset CommandInset ref
9105 reference "sub:Flex-insets-and"
9109 for more information.
9113 \begin_layout Description
9114 \begin_inset Flex Code
9117 \begin_layout Plain Layout
9124 \begin_inset Flex Code
9127 \begin_layout Plain Layout
9133 ] A string that indicates the width of the left margin on the screen, for
9135 \begin_inset Quotes eld
9139 \begin_inset Quotes erd
9143 (Note that this is not a `length', like
9144 \begin_inset Quotes eld
9148 \begin_inset Quotes erd
9154 \begin_layout Description
9155 \begin_inset Flex Code
9158 \begin_layout Plain Layout
9165 \begin_inset Flex Code
9168 \begin_layout Plain Layout
9174 ] This command deletes an existing counter, usually one defined in an included
9178 \begin_layout Description
9179 \begin_inset Flex Code
9182 \begin_layout Plain Layout
9188 This command deletes an existing float.
9189 This is particularly useful when you want to suppress a float that has
9190 been defined in an input file.
9193 \begin_layout Description
9194 \begin_inset Flex Code
9197 \begin_layout Plain Layout
9203 This command deletes an existing style.
9204 This is particularly useful when you want to suppress a style that has
9205 be defined in an input file.
9208 \begin_layout Description
9209 \begin_inset Flex Code
9212 \begin_layout Plain Layout
9218 A string indicating the file format (as defined in the Preferences dialog)
9219 produced by this class.
9220 It is mainly useful when
9221 \begin_inset Flex Code
9224 \begin_layout Plain Layout
9230 is `literate' and one wants to define a new type of literate document.
9231 This string is reset to `docbook', `latex', or `literate' when the correspondin
9233 \begin_inset Flex Code
9236 \begin_layout Plain Layout
9242 parameter is encountered.
9245 \begin_layout Description
9246 \begin_inset Flex Code
9249 \begin_layout Plain Layout
9255 A string indicating what sort of output documents using this class will
9257 At present, the options are: `docbook', `latex', and `literate'.
9260 \begin_layout Description
9261 \begin_inset Flex Code
9264 \begin_layout Plain Layout
9271 \begin_inset Flex Code
9274 \begin_layout Plain Layout
9283 \begin_inset Flex Code
9286 \begin_layout Plain Layout
9293 \begin_inset Flex Code
9296 \begin_layout Plain Layout
9302 ] The default pagestyle.
9303 Can be changed in the
9304 \begin_inset Flex MenuItem
9307 \begin_layout Plain Layout
9308 Document\SpecialChar \menuseparator
9317 \begin_layout Description
9318 \begin_inset Flex Code
9321 \begin_layout Plain Layout
9327 Sets the preamble for the LaTeX document.
9328 Note that this will completely override any prior
9329 \begin_inset Flex Code
9332 \begin_layout Plain Layout
9339 \begin_inset Flex Code
9342 \begin_layout Plain Layout
9350 \begin_inset Flex Code
9353 \begin_layout Plain Layout
9359 if you just want to add material to the preamble.) Must end with
9360 \begin_inset Quotes eld
9364 \begin_inset Flex Code
9367 \begin_layout Plain Layout
9374 \begin_inset Quotes erd
9380 \begin_layout Description
9381 \begin_inset Flex Code
9384 \begin_layout Plain Layout
9391 \begin_inset Flex Code
9394 \begin_layout Plain Layout
9401 \begin_inset Flex Code
9404 \begin_layout Plain Layout
9413 \begin_inset Flex Code
9416 \begin_layout Plain Layout
9422 ] Whether the class already provides the feature
9423 \begin_inset Flex Code
9426 \begin_layout Plain Layout
9433 A feature is in general the name of a package (
9434 \begin_inset Flex Code
9437 \begin_layout Plain Layout
9444 \begin_inset Flex Code
9447 \begin_layout Plain Layout
9453 , \SpecialChar \ldots{}
9455 \begin_inset Flex Code
9458 \begin_layout Plain Layout
9465 \begin_inset Flex Code
9468 \begin_layout Plain Layout
9474 ,\SpecialChar \ldots{}
9475 ); the complete list of supported features is unfortunately not documented
9476 outside the LyX source code—but see
9477 \begin_inset Flex Code
9480 \begin_layout Plain Layout
9486 if you're interested.
9488 \begin_inset Flex MenuItem
9491 \begin_layout Plain Layout
9492 Help\SpecialChar \menuseparator
9498 also gives an overview of the supported packages.
9501 \begin_layout Description
9502 \begin_inset Flex Code
9505 \begin_layout Plain Layout
9512 \begin_inset Flex Code
9515 \begin_layout Plain Layout
9521 ] Indicates that this layout provides the functionality of the module mentioned,
9522 which should be specified by the filename without the
9523 \begin_inset Flex Code
9526 \begin_layout Plain Layout
9533 This will typically be used if the layout includes the module directly,
9534 rather than using the
9535 \begin_inset Flex Code
9538 \begin_layout Plain Layout
9544 tag to indicate that it ought to be used.
9545 It could also be used in a module that provided an alternate implementation
9546 of the same functionality.
9549 \begin_layout Description
9550 \begin_inset Flex Code
9553 \begin_layout Plain Layout
9560 \begin_inset Flex Code
9563 \begin_layout Plain Layout
9569 ] Whether the class requires the feature
9570 \begin_inset Flex Code
9573 \begin_layout Plain Layout
9580 Multiple features must be separated by commas.
9581 Note that you can only request supported features.
9583 \begin_inset Flex Code
9586 \begin_layout Plain Layout
9592 for a list of these.)
9595 \begin_layout Description
9596 \begin_inset Flex Code
9599 \begin_layout Plain Layout
9605 A string that indicates the width of the right margin on the screen, for
9607 \begin_inset Quotes eld
9611 \begin_inset Quotes erd
9617 \begin_layout Description
9618 \begin_inset Flex Code
9621 \begin_layout Plain Layout
9627 Sets which divisions get numbered.
9629 \begin_inset Flex Code
9632 \begin_layout Plain Layout
9641 \begin_layout Description
9642 \begin_inset Flex Code
9645 \begin_layout Plain Layout
9652 \begin_inset Flex Code
9655 \begin_layout Plain Layout
9664 \begin_inset Flex Code
9667 \begin_layout Plain Layout
9673 ] Whether the class-default should be printing on one or both sides of the
9675 Can be changed in the
9676 \begin_inset Flex MenuItem
9679 \begin_layout Plain Layout
9680 Document\SpecialChar \menuseparator
9689 \begin_layout Description
9690 \begin_inset Flex Code
9693 \begin_layout Plain Layout
9699 This sequence defines a paragraph style.
9700 If the style does not yet exist, it is created; if it does exist, its parameter
9703 \begin_inset Quotes eld
9707 \begin_inset Flex Code
9710 \begin_layout Plain Layout
9717 \begin_inset Quotes erd
9721 \begin_inset Newline newline
9725 \begin_inset space ~
9729 \begin_inset CommandInset ref
9731 reference "sub:Paragraph-Styles"
9735 for details on paragraph styles.
9738 \begin_layout Description
9739 \begin_inset Flex Code
9742 \begin_layout Plain Layout
9749 \begin_inset Flex Code
9752 \begin_layout Plain Layout
9758 ] The name of the command or environment to be used with
9759 \begin_inset Flex Code
9762 \begin_layout Plain Layout
9771 \begin_layout Description
9772 \begin_inset Flex Code
9775 \begin_layout Plain Layout
9782 \begin_inset Flex Code
9785 \begin_layout Plain Layout
9794 \begin_inset Flex Code
9797 \begin_layout Plain Layout
9803 ] Indicates what kind of markup is used to define the title of a document.
9805 \begin_inset Flex Code
9808 \begin_layout Plain Layout
9814 means that the macro with name
9815 \begin_inset Flex Code
9818 \begin_layout Plain Layout
9824 will be inserted after the last layout which has
9825 \begin_inset Quotes eld
9829 \begin_inset Flex Code
9832 \begin_layout Plain Layout
9839 \begin_inset Quotes erd
9844 \begin_inset Flex Code
9847 \begin_layout Plain Layout
9853 corresponds to the case where the block of paragraphs which have
9854 \begin_inset Quotes eld
9858 \begin_inset Flex Code
9861 \begin_layout Plain Layout
9868 \begin_inset Quotes erd
9871 should be enclosed into the
9872 \begin_inset Flex Code
9875 \begin_layout Plain Layout
9884 \begin_layout Description
9885 \begin_inset Flex Code
9888 \begin_layout Plain Layout
9894 Sets which divisions are included in the table of contents.
9896 \begin_inset Flex Code
9899 \begin_layout Plain Layout
9908 \begin_layout Subsection
9909 \begin_inset Flex Code
9912 \begin_layout Plain Layout
9919 \begin_inset CommandInset label
9921 name "sub:ClassOptions"
9928 \begin_layout Standard
9930 \begin_inset Flex Code
9933 \begin_layout Plain Layout
9939 section can contain the following entries:
9942 \begin_layout Description
9943 \begin_inset Flex Code
9946 \begin_layout Plain Layout
9953 \begin_inset Flex Code
9956 \begin_layout Plain Layout
9962 ] The list of available font sizes for the document's main font, separated
9964 \begin_inset Quotes eld
9968 \begin_inset Flex Code
9971 \begin_layout Plain Layout
9978 \begin_inset Quotes erd
9984 \begin_layout Description
9985 \begin_inset Flex Code
9988 \begin_layout Plain Layout
9994 Used to set the DTD line with XML-based output classes.
9996 \begin_inset space \thinspace{}
10000 \begin_inset Quotes eld
10003 -//OASIS//DTD DocBook V4.2//EN
10004 \begin_inset Quotes erd
10010 \begin_layout Description
10011 \begin_inset Flex Code
10014 \begin_layout Plain Layout
10021 \begin_inset Flex Code
10024 \begin_layout Plain Layout
10025 string="empty|plain|headings|fancy"
10030 ] The list of available page styles, separated by
10031 \begin_inset Quotes eld
10035 \begin_inset Flex Code
10038 \begin_layout Plain Layout
10045 \begin_inset Quotes erd
10051 \begin_layout Description
10052 \begin_inset Flex Code
10055 \begin_layout Plain Layout
10062 \begin_inset Flex Code
10065 \begin_layout Plain Layout
10071 ] Some document class options, separated by a comma, that will be added
10072 to the optional part of the
10073 \begin_inset Flex Code
10076 \begin_layout Plain Layout
10087 \begin_layout Standard
10089 \begin_inset Flex Code
10092 \begin_layout Plain Layout
10098 section must end with
10099 \begin_inset Quotes eld
10103 \begin_inset Flex Code
10106 \begin_layout Plain Layout
10113 \begin_inset Quotes erd
10119 \begin_layout Subsection
10121 \begin_inset CommandInset label
10123 name "sub:Paragraph-Styles"
10130 \begin_layout Standard
10131 A paragraph style description looks like this:
10135 \begin_layout Plain Layout
10136 Note that this will either define a new style or modify an existing one.
10144 \begin_layout LyX-Code
10151 \begin_layout LyX-Code
10155 \begin_layout LyX-Code
10159 \begin_layout Standard
10160 where the following commands are allowed:
10163 \begin_layout Description
10164 \begin_inset Flex Code
10167 \begin_layout Plain Layout
10174 \begin_inset Flex Code
10177 \begin_layout Plain Layout
10182 , left, right, center
10187 ] Paragraph alignment.
10190 \begin_layout Description
10191 \begin_inset Flex Code
10194 \begin_layout Plain Layout
10201 \begin_inset Flex Code
10204 \begin_layout Plain Layout
10209 , left, right, center
10214 ] A comma separated list of permitted alignments.
10215 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
10217 For example a right-aligned or centered enumeration isn't possible.)
10218 \change_inserted -712698321 1353679769
10222 \begin_layout Description
10224 \change_inserted -712698321 1353680268
10225 \begin_inset Flex Code
10228 \begin_layout Plain Layout
10230 \change_inserted -712698321 1353679781
10237 \begin_inset Flex Code
10240 \begin_layout Plain Layout
10242 \change_inserted -712698321 1353679772
10248 ] Defines argument number <int> of a command\SpecialChar \slash{}
10249 environment associated with
10251 This is useful for things like section headings, and only makes sense with
10253 Every (optional or required) argument of a command or environment -- except
10254 for the required argument that is associated with the content of the paragraph
10255 itself -- has a separate definition, where the number specifies the order
10257 The definition must end with
10258 \begin_inset Flex Code
10261 \begin_layout Plain Layout
10263 \change_inserted -712698321 1353680069
10270 So a command with two optional arguments has:
10274 \begin_layout Quote
10276 \change_inserted -712698321 1353680127
10282 \begin_layout Quote
10284 \change_inserted -712698321 1353680195
10290 \begin_layout Quote
10292 \change_inserted -712698321 1353680135
10298 \begin_layout Quote
10300 \change_inserted -712698321 1353680140
10306 \begin_layout Quote
10308 \change_inserted -712698321 1353680197
10314 \begin_layout Quote
10316 \change_inserted -712698321 1353680147
10322 \begin_layout Standard
10324 \change_inserted -712698321 1353680528
10326 \begin_inset Flex Code
10329 \begin_layout Plain Layout
10331 \change_inserted -712698321 1353680412
10337 definition, the following specifications are possible:
10340 \begin_layout Itemize
10342 \change_inserted -712698321 1355076779
10343 \begin_inset Flex Code
10346 \begin_layout Plain Layout
10348 \change_inserted -712698321 1353680543
10357 \begin_inset Flex Code
10360 \begin_layout Plain Layout
10362 \change_inserted -712698321 1353680567
10368 The string that will appear both in the menu (to insert this argument)
10369 and on the argument inset button (unless you also specify a separate
10370 \begin_inset Flex Code
10373 \begin_layout Plain Layout
10375 \change_inserted -712698321 1355076779
10382 For the menu, you can define an accelerator by appending the respective
10383 character to the string, divided by
10384 \begin_inset Quotes eld
10388 \begin_inset Quotes erd
10392 \begin_inset space \thinspace{}
10397 \begin_inset Flex Code
10400 \begin_layout Plain Layout
10402 \change_inserted -712698321 1353691482
10403 \begin_inset Quotes eld
10407 \begin_inset Quotes erd
10420 \begin_layout Itemize
10422 \change_inserted -712698321 1355076754
10423 \begin_inset Flex Code
10426 \begin_layout Plain Layout
10428 \change_inserted -712698321 1355076658
10435 \begin_inset Flex Code
10438 \begin_layout Plain Layout
10440 \change_inserted -712698321 1355076654
10446 A separate string for the menu.
10447 You can define an accelerator by appending the respective character to
10448 the string, divided by
10449 \begin_inset Quotes eld
10453 \begin_inset Quotes erd
10457 \begin_inset space \thinspace{}
10462 \begin_inset Flex Code
10465 \begin_layout Plain Layout
10467 \change_inserted -712698321 1355076654
10468 \begin_inset Quotes eld
10472 \begin_inset Quotes erd
10481 This specification is optional.
10482 If it is not given the
10483 \begin_inset Flex Code
10486 \begin_layout Plain Layout
10488 \change_inserted -712698321 1355076736
10496 will be used instead for the menu.
10499 \begin_layout Itemize
10501 \change_inserted -712698321 1353680665
10502 \begin_inset Flex Code
10505 \begin_layout Plain Layout
10507 \change_inserted -712698321 1353680616
10514 \begin_inset Flex Code
10517 \begin_layout Plain Layout
10519 \change_inserted -712698321 1353680623
10525 A longer explanatory text that appears in the tooltip when hovering over
10526 the argument inset.
10529 \begin_layout Itemize
10531 \change_inserted -712698321 1353680874
10532 \begin_inset Flex Code
10535 \begin_layout Plain Layout
10537 \change_inserted -712698321 1353680732
10544 \begin_inset Flex Code
10547 \begin_layout Plain Layout
10549 \change_inserted -712698321 1353680738
10555 Declare if this is a mandatory
10556 \change_inserted 2090807402 1353765594
10558 \change_inserted -712698321 1353680874
10560 \change_inserted 2090807402 1353765599
10562 \change_inserted -712698321 1353680874
10564 Mandatory arguments will be output empty if not given, while optional arguments
10565 will not be output at all.
10566 By default, mandatory arguments are delimited by
10567 \begin_inset Flex Code
10570 \begin_layout Plain Layout
10572 \change_inserted -712698321 1353680808
10580 , while optional arguments are delimited by
10581 \begin_inset Flex Code
10584 \begin_layout Plain Layout
10586 \change_inserted -712698321 1353680833
10595 \begin_layout Itemize
10597 \change_inserted -712698321 1353917199
10598 \begin_inset Flex Code
10601 \begin_layout Plain Layout
10603 \change_inserted -712698321 1353680879
10610 \begin_inset Flex Code
10613 \begin_layout Plain Layout
10615 \change_inserted -712698321 1353680874
10621 defines another argument (by its number) which this argument requires to
10622 be output if it is itself output.
10624 \begin_inset space \thinspace{}
10627 g., in LaTeX commands, optional arguments often require previous optional
10628 arguments to be output (at least empty), as in
10629 \begin_inset Flex Code
10632 \begin_layout Plain Layout
10634 \change_inserted -712698321 1353688183
10637 command[][arg]{text}
10645 This can be achieved by the statement
10646 \begin_inset Flex Code
10649 \begin_layout Plain Layout
10651 \change_inserted -712698321 1353681031
10660 \begin_inset Flex Code
10663 \begin_layout Plain Layout
10665 \change_inserted -712698321 1353681045
10676 \begin_layout Itemize
10678 \change_inserted -712698321 1354263104
10679 \begin_inset Flex Code
10682 \begin_layout Plain Layout
10684 \change_inserted -712698321 1353681072
10693 \begin_inset Flex Code
10696 \begin_layout Plain Layout
10698 \change_inserted -712698321 1353681067
10704 defines a custom left delimiter (instead of
10705 \begin_inset Flex Code
10708 \begin_layout Plain Layout
10710 \change_inserted -712698321 1353681127
10719 \begin_inset Flex Code
10722 \begin_layout Plain Layout
10724 \change_inserted -712698321 1353681133
10733 A line break in the output can be indicated by
10734 \begin_inset Flex Code
10737 \begin_layout Plain Layout
10739 \change_inserted -712698321 1354263104
10750 \begin_layout Itemize
10752 \change_inserted -712698321 1355144479
10753 \begin_inset Flex Code
10756 \begin_layout Plain Layout
10758 \change_inserted -712698321 1353681149
10765 \begin_inset Flex Code
10768 \begin_layout Plain Layout
10770 \change_inserted -712698321 1353681146
10776 defines a custom right delimiter (instead of
10777 \begin_inset Flex Code
10780 \begin_layout Plain Layout
10782 \change_inserted -712698321 1353681158
10789 \begin_inset Flex Code
10792 \begin_layout Plain Layout
10794 \change_inserted -712698321 1353681161
10801 A line break in the output can be indicated by
10802 \begin_inset Flex Code
10805 \begin_layout Plain Layout
10807 \change_inserted -712698321 1354263106
10816 \begin_layout Itemize
10818 \change_inserted -712698321 1355144578
10819 \begin_inset Flex Code
10822 \begin_layout Plain Layout
10824 \change_inserted -712698321 1355144487
10833 \begin_inset Flex Code
10836 \begin_layout Plain Layout
10838 \change_inserted -712698321 1355144500
10844 defines an argument that is inserted in any case (alone or in addition
10845 to user-specified arguments).
10846 Multiple arguments need to be separated by comma.
10851 \begin_layout Itemize
10853 \change_inserted -712698321 1353917320
10854 \begin_inset Flex Code
10857 \begin_layout Plain Layout
10859 \change_inserted -712698321 1353917320
10865 The font used for the argument content.
10867 \begin_inset space ~
10871 \begin_inset CommandInset ref
10873 reference "sub:Font-description"
10880 \begin_layout Itemize
10882 \change_inserted -712698321 1353917320
10883 \begin_inset Flex Code
10886 \begin_layout Plain Layout
10888 \change_inserted -712698321 1353917320
10894 The font used for the label.
10896 \begin_inset space ~
10900 \begin_inset CommandInset ref
10902 reference "sub:Font-description"
10909 \begin_layout Itemize
10911 \change_inserted -712698321 1355661048
10912 \begin_inset Flex Code
10915 \begin_layout Plain Layout
10917 \change_inserted -712698321 1353917320
10924 \begin_inset Flex Code
10927 \begin_layout Plain Layout
10929 \change_inserted -712698321 1353917320
10936 \begin_inset Flex Code
10939 \begin_layout Plain Layout
10941 \change_inserted -712698321 1353917320
10948 \begin_inset Flex Code
10951 \begin_layout Plain Layout
10953 \change_inserted -712698321 1353917320
10959 , describing the rendering style used for the inset's frame and buttons.
10961 \begin_inset Flex Code
10964 \begin_layout Plain Layout
10966 \change_inserted -712698321 1353917320
10975 \begin_layout Itemize
10977 \change_inserted -712698321 1355661160
10978 \begin_inset Flex Code
10981 \begin_layout Plain Layout
10983 \change_inserted -712698321 1355661057
10990 \begin_inset Flex Code
10993 \begin_layout Plain Layout
10995 \change_inserted -712698321 1355661049
11002 \begin_inset Flex Code
11005 \begin_layout Plain Layout
11007 \change_inserted -712698321 1355661077
11015 , this argument is automatically inserted when the respective style is selected.
11016 This option is currently only available for paragraph styles, not for InsetLayo
11018 \change_inserted 155139281 1354198988
11022 \begin_layout Standard
11024 \change_inserted 155139281 1354199102
11026 \begin_inset Flex Code
11029 \begin_layout Plain Layout
11031 \change_inserted 155139281 1354199013
11042 \begin_inset Flex Code
11045 \begin_layout Plain Layout
11047 \change_inserted 155139281 1354199102
11058 \begin_inset Flex Code
11061 \begin_layout Plain Layout
11063 \change_inserted 155139281 1354199044
11071 followed by the number (e.
11072 \begin_inset space \thinspace{}
11077 \begin_inset Flex Code
11080 \begin_layout Plain Layout
11082 \change_inserted 155139281 1354199064
11096 \begin_layout Description
11097 \begin_inset Flex Code
11100 \begin_layout Plain Layout
11106 Note that this will completely override any prior
11107 \begin_inset Flex Code
11110 \begin_layout Plain Layout
11116 declaration for this style.
11118 \begin_inset Quotes eld
11122 \begin_inset Flex Code
11125 \begin_layout Plain Layout
11132 \begin_inset Quotes erd
11137 \begin_inset CommandInset ref
11139 reference "sub:I18n"
11143 for details on its use.
11146 \begin_layout Description
11147 \begin_inset Flex Code
11150 \begin_layout Plain Layout
11157 \begin_inset Flex Code
11160 \begin_layout Plain Layout
11170 \begin_layout Plain Layout
11171 Note that a `float' here is a real number, such as: 1.5.
11176 The vertical space with which the last of a chain of paragraphs with this
11177 style is separated from the following paragraph.
11178 If the next paragraph has another style, the separations are not simply
11179 added, but the maximum is taken.
11182 \begin_layout Description
11183 \begin_inset Flex Code
11186 \begin_layout Plain Layout
11193 \begin_inset Flex Code
11196 \begin_layout Plain Layout
11202 The category for this style.
11203 This is used to group related styles in the style combobox on the toolbar.
11204 Any string can be used, but you may want to use existing categories with
11209 \begin_layout Description
11210 \begin_inset Flex Code
11213 \begin_layout Plain Layout
11219 Depth of XML command.
11220 Used only with XML-type formats.
11223 \begin_layout Description
11224 \begin_inset Flex Code
11227 \begin_layout Plain Layout
11234 \begin_inset Flex Code
11237 \begin_layout Plain Layout
11243 Copies all the features of an existing style into the current one.
11247 \begin_layout Description
11248 \begin_inset Flex Code
11251 \begin_layout Plain Layout
11257 The name of a style whose preamble should be output
11262 This allows to ensure some ordering of the preamble snippets when macros
11263 definitions depend on one another.
11267 \begin_layout Plain Layout
11268 Note that, besides that functionality, there is no way to ensure any ordering
11270 The ordering that you see in a given version of LyX may change without
11271 warning in later versions.
11279 \begin_layout Description
11280 \begin_inset Flex Code
11283 \begin_layout Plain Layout
11290 \begin_inset Flex Code
11293 \begin_layout Plain Layout
11298 , Box, Filled_Box, Static
11303 ] The type of label that stands at the end of the paragraph (or sequence
11305 \begin_inset Flex Code
11308 \begin_layout Plain Layout
11315 \begin_inset Flex Code
11318 \begin_layout Plain Layout
11325 \begin_inset Flex Code
11328 \begin_layout Plain Layout
11335 \begin_inset Flex Code
11338 \begin_layout Plain Layout
11346 \begin_inset Flex Code
11349 \begin_layout Plain Layout
11356 \begin_inset Quotes eld
11360 \begin_inset Quotes erd
11364 \begin_inset Flex Code
11367 \begin_layout Plain Layout
11374 \begin_inset Flex Code
11377 \begin_layout Plain Layout
11378 \begin_inset space ~
11386 ) is a white (resp.
11387 \begin_inset space ~
11390 black) square suitable for end of proof markers,
11391 \begin_inset Flex Code
11394 \begin_layout Plain Layout
11400 is an explicit text string.
11403 \begin_layout Description
11404 \begin_inset Flex Code
11407 \begin_layout Plain Layout
11414 \begin_inset Flex Code
11417 \begin_layout Plain Layout
11423 ] The string used for a label with a
11424 \begin_inset Flex Code
11427 \begin_layout Plain Layout
11434 \begin_inset Flex Code
11437 \begin_layout Plain Layout
11447 \begin_layout Description
11448 \begin_inset Flex Code
11451 \begin_layout Plain Layout
11457 The font used for both the text body
11463 \begin_inset space ~
11467 \begin_inset CommandInset ref
11469 reference "sub:Font-description"
11474 Note that defining this font automatically defines the
11475 \begin_inset Flex Code
11478 \begin_layout Plain Layout
11485 So you should define this one first if you also want to define
11486 \begin_inset Flex Code
11489 \begin_layout Plain Layout
11498 \begin_layout Description
11499 \begin_inset Flex Code
11502 \begin_layout Plain Layout
11509 \begin_inset CommandInset label
11511 name "des:FreeSpacing"
11516 \begin_inset Flex Code
11519 \begin_layout Plain Layout
11528 \begin_inset Flex Code
11531 \begin_layout Plain Layout
11537 ] Usually LyX doesn't allow you to insert more than one space between words,
11538 since a space is considered as the separation between two words, not a
11539 character or symbol of its own.
11540 This is a very fine thing but sometimes annoying, for example, when typing
11541 program code or plain LaTeX code.
11543 \begin_inset Flex Code
11546 \begin_layout Plain Layout
11553 Note that LyX will create protected blanks for the additional blanks when
11554 in another mode than LaTeX-mode.
11557 \begin_layout Description
11558 \begin_inset Flex Code
11561 \begin_layout Plain Layout
11567 These tags are used with XHTML output.
11569 \begin_inset CommandInset ref
11571 reference "sub:Paragraph-Style-XHTML"
11578 \begin_layout Description
11579 \begin_inset Flex Code
11582 \begin_layout Plain Layout
11588 [[FIXME]] (Used only with XML-type formats.)
11591 \begin_layout Description
11592 \begin_inset Flex Code
11595 \begin_layout Plain Layout
11602 \begin_inset Flex Code
11605 \begin_layout Plain Layout
11611 If 1, marks the style as to be included in the document preamble rather
11612 than in the document body.
11613 This is useful for document classes that want such information as the title
11614 and author to appear in the preamble.
11615 Note that this works only for styles for which the
11616 \begin_inset Flex Code
11619 \begin_layout Plain Layout
11626 \begin_inset Flex Code
11629 \begin_layout Plain Layout
11636 \begin_inset Flex Code
11639 \begin_layout Plain Layout
11648 \begin_layout Description
11649 \begin_inset Flex Code
11652 \begin_layout Plain Layout
11659 \begin_inset Flex Code
11662 \begin_layout Plain Layout
11668 If 1, marks the style as being part of a title block (see also the
11669 \begin_inset Flex Code
11672 \begin_layout Plain Layout
11679 \begin_inset Flex Code
11682 \begin_layout Plain Layout
11691 \begin_layout Description
11692 \begin_inset Flex Code
11695 \begin_layout Plain Layout
11702 \begin_inset Flex Code
11705 \begin_layout Plain Layout
11711 ] This provides extra space between paragraphs that have the same style.
11712 If you put other styles into an environment, each is separated with the
11714 \begin_inset Flex Code
11717 \begin_layout Plain Layout
11724 But the whole items of the environment are additionally separated with
11726 \begin_inset Flex Code
11729 \begin_layout Plain Layout
11736 Note that this is a
11741 \begin_layout Description
11742 \begin_inset Flex Code
11745 \begin_layout Plain Layout
11751 [[FIXME]] (Used only with XML-type formats.)
11754 \begin_layout Description
11755 \begin_inset Flex Code
11758 \begin_layout Plain Layout
11765 \begin_inset Flex Code
11768 \begin_layout Plain Layout
11777 \begin_inset Flex Code
11780 \begin_layout Plain Layout
11786 ] Usually LyX does not allow you to leave a paragraph empty, since it would
11787 lead to empty LaTeX output.
11788 There are some cases where this could be desirable however: in a letter
11789 template, the required fields can be provided as empty fields, so that
11790 people do not forget them; in some special classes, a style can be used
11791 as some kind of break, which does not contain actual text.
11794 \begin_layout Description
11795 \begin_inset Flex Code
11798 \begin_layout Plain Layout
11804 [float=0] The vertical space between the label and the text body.
11805 Only used for labels that are above the text body (
11806 \begin_inset Flex Code
11809 \begin_layout Plain Layout
11816 \begin_inset Flex Code
11819 \begin_layout Plain Layout
11820 Centered_Top_Environment
11828 \begin_layout Description
11829 \begin_inset Flex Code
11832 \begin_layout Plain Layout
11839 \begin_inset Flex Code
11842 \begin_layout Plain Layout
11849 \begin_inset Newline newline
11852 The name of the counter for automatic numbering.
11854 \begin_inset Newline newline
11862 \begin_inset Flex Code
11865 \begin_layout Plain Layout
11872 \begin_inset Flex Code
11875 \begin_layout Plain Layout
11882 In that case, the counter will be stepped each time the style appears.
11884 \begin_inset Newline newline
11892 \begin_inset Flex Code
11895 \begin_layout Plain Layout
11902 \begin_inset Flex Code
11905 \begin_layout Plain Layout
11911 , though this case is a bit complicated.
11912 Suppose you declare
11913 \begin_inset Quotes eld
11917 \begin_inset Flex Code
11920 \begin_layout Plain Layout
11921 LabelCounter myenum
11927 \begin_inset Quotes erd
11931 Then the actual counters used are
11932 \begin_inset Flex Code
11935 \begin_layout Plain Layout
11942 \begin_inset Flex Code
11945 \begin_layout Plain Layout
11952 \begin_inset Flex Code
11955 \begin_layout Plain Layout
11962 \begin_inset Flex Code
11965 \begin_layout Plain Layout
11971 , much as in LaTeX.
11972 These counters must all be declared separately.
11973 \begin_inset Newline newline
11977 \begin_inset CommandInset ref
11979 reference "sub:Counters"
11983 for details on counters.
11986 \begin_layout Description
11987 \begin_inset Flex Code
11990 \begin_layout Plain Layout
11996 The font used for the label.
11998 \begin_inset space ~
12002 \begin_inset CommandInset ref
12004 reference "sub:Font-description"
12011 \begin_layout Description
12012 \begin_inset Flex Code
12015 \begin_layout Plain Layout
12021 Text that indicates how far a label should be indented.
12024 \begin_layout Description
12025 \begin_inset Flex Code
12028 \begin_layout Plain Layout
12035 \begin_inset Flex Code
12038 \begin_layout Plain Layout
12044 ] The horizontal space between the label and the text body.
12045 Only used for labels that are not above the text body.
12048 \begin_layout Description
12049 \begin_inset Flex Code
12052 \begin_layout Plain Layout
12059 \begin_inset Flex Code
12062 \begin_layout Plain Layout
12068 ] The string used for a label with a
12069 \begin_inset Flex Code
12072 \begin_layout Plain Layout
12080 \begin_inset Flex Code
12083 \begin_layout Plain Layout
12089 is set, this string can be contain the special formatting commands described
12091 \begin_inset CommandInset ref
12093 reference "sub:Counters"
12101 \begin_layout Plain Layout
12102 For the sake of backwards compatibility, the string
12103 \begin_inset Flex Code
12106 \begin_layout Plain Layout
12116 will be replaced by the expanded
12117 \begin_inset Flex Code
12120 \begin_layout Plain Layout
12127 \begin_inset Flex Code
12130 \begin_layout Plain Layout
12139 This feature is now obsolete and should be replaced by the mechanisms of
12141 \begin_inset CommandInset ref
12143 reference "sub:Counters"
12155 \begin_layout Description
12156 \begin_inset Flex Code
12159 \begin_layout Plain Layout
12160 LabelStringAppendix
12166 \begin_inset Flex Code
12169 \begin_layout Plain Layout
12175 ] This is used inside the appendix instead of
12176 \begin_inset Flex Code
12179 \begin_layout Plain Layout
12187 \begin_inset Flex Code
12190 \begin_layout Plain Layout
12197 \begin_inset Flex Code
12200 \begin_layout Plain Layout
12201 LabelStringAppendix
12209 \begin_layout Description
12210 \begin_inset Flex Code
12213 \begin_layout Plain Layout
12219 [FIXME] (Used only with XML-type formats.)
12222 \begin_layout Description
12223 \begin_inset Flex Code
12226 \begin_layout Plain Layout
12233 \begin_inset Flex Code
12236 \begin_layout Plain Layout
12241 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
12242 Enumerate, Itemize, Bibliography
12251 \begin_layout Itemize
12252 \begin_inset Flex Code
12255 \begin_layout Plain Layout
12261 means the label is the very first word (up to the first real blank).
12262 Use protected spaces (like
12263 \begin_inset space ~
12266 that one) if you want more than one word as the label.
12270 \begin_layout Itemize
12271 \begin_inset Flex Code
12274 \begin_layout Plain Layout
12280 means the label is simply whatever
12281 \begin_inset Flex Code
12284 \begin_layout Plain Layout
12291 Note that this really is `static'.
12294 \begin_layout Itemize
12295 \begin_inset Flex Code
12298 \begin_layout Plain Layout
12305 \begin_inset Flex Code
12308 \begin_layout Plain Layout
12309 Centered_Top_Environment
12314 are special cases of
12315 \begin_inset Flex Code
12318 \begin_layout Plain Layout
12325 The label will be printed above the paragraph, but only at the top of an
12326 environment or the top of a chain of paragraphs with this style.
12327 This might be used with the
12328 \begin_inset Flex MenuItem
12331 \begin_layout Plain Layout
12337 style, for example.
12340 \begin_layout Itemize
12341 \begin_inset Flex Code
12344 \begin_layout Plain Layout
12350 is a special case for the caption-labels
12351 \begin_inset Quotes eld
12355 \begin_inset Quotes erd
12359 \begin_inset Quotes eld
12363 \begin_inset Quotes erd
12368 \begin_inset Flex Code
12371 \begin_layout Plain Layout
12377 means the (hardcoded) label string depends on the kind of float: It is
12378 hardcoded to be `FloatType N', where N is the value of the counter associated
12382 \begin_layout Itemize
12384 \begin_inset Flex Code
12387 \begin_layout Plain Layout
12393 label type defines automatically numbered labels.
12395 \begin_inset Flex Code
12398 \begin_layout Plain Layout
12404 will be expanded to resolve any counter references it contains: For example,
12406 \begin_inset Quotes eld
12410 \begin_inset Flex Code
12413 \begin_layout Plain Layout
12424 \begin_inset Quotes erd
12429 \begin_inset CommandInset ref
12431 reference "sub:Counters"
12435 for more information on counters.
12438 \begin_layout Itemize
12439 \begin_inset Flex Code
12442 \begin_layout Plain Layout
12448 produces the usual sort of enumeration labels.
12449 At present, it is hardcoded to use Arabic numerals, lowercase letters,
12450 small Roman numerals, and uppercase letters for the four possible depths.
12453 \begin_layout Itemize
12454 \begin_inset Flex Code
12457 \begin_layout Plain Layout
12463 produces various bullets at the different levels.
12464 It is also hardcoded.
12467 \begin_layout Itemize
12468 \begin_inset Flex Code
12471 \begin_layout Plain Layout
12477 is used internally by LyX and should be used only with
12478 \begin_inset Flex Code
12481 \begin_layout Plain Layout
12482 LatexType BibEnvironment
12491 \begin_layout Description
12492 \begin_inset Flex Code
12495 \begin_layout Plain Layout
12501 Note that this will completely override any prior
12502 \begin_inset Flex Code
12505 \begin_layout Plain Layout
12511 declaration for this style.
12513 \begin_inset Quotes eld
12517 \begin_inset Flex Code
12520 \begin_layout Plain Layout
12527 \begin_inset Quotes erd
12532 \begin_inset CommandInset ref
12534 reference "sub:I18n"
12538 for details on its use.
12541 \begin_layout Description
12542 \begin_inset Flex Code
12545 \begin_layout Plain Layout
12551 The name of the corresponding LaTeX stuff.
12552 Either the environment or command name.
12555 \begin_layout Description
12556 \begin_inset Flex Code
12559 \begin_layout Plain Layout
12565 An optional parameter for the corresponding
12566 \begin_inset Flex Code
12569 \begin_layout Plain Layout
12576 This parameter cannot be changed from within LyX
12577 \change_inserted -712698321 1355144804
12579 \begin_inset Flex Code
12582 \begin_layout Plain Layout
12584 \change_inserted -712698321 1355144804
12590 for customizable parameters)
12594 \change_inserted -712698321 1355144804
12595 This will be output as is after all LaTeX
12596 \begin_inset Flex Code
12599 \begin_layout Plain Layout
12601 \change_inserted -712698321 1355144658
12614 \begin_layout Description
12615 \begin_inset Flex Code
12618 \begin_layout Plain Layout
12625 \begin_inset Flex Code
12628 \begin_layout Plain Layout
12633 , Command, Environment, Item_Environment,
12639 \begin_inset Flex Code
12642 \begin_layout Plain Layout
12643 List_Environment, Bib_Environment
12648 ] How the style should be translated into LaTeX.
12652 \begin_layout Plain Layout
12653 \begin_inset Flex Code
12656 \begin_layout Plain Layout
12662 is perhaps a bit misleading, since these rules apply to SGML classes, too.
12663 Visit the SGML class files for specific examples.
12672 \begin_layout Itemize
12673 \begin_inset Flex Code
12676 \begin_layout Plain Layout
12682 means nothing special.
12686 \begin_layout Itemize
12687 \begin_inset Flex Code
12690 \begin_layout Plain Layout
12697 \begin_inset Flex Code
12700 \begin_layout Plain Layout
12707 {\SpecialChar \ldots{}
12716 \begin_layout Itemize
12717 \begin_inset Flex Code
12720 \begin_layout Plain Layout
12727 \begin_inset Flex Code
12730 \begin_layout Plain Layout
12737 }\SpecialChar \ldots{}
12753 \begin_layout Itemize
12754 \begin_inset Flex Code
12757 \begin_layout Plain Layout
12764 \begin_inset Flex Code
12767 \begin_layout Plain Layout
12774 \begin_inset Flex Code
12777 \begin_layout Plain Layout
12785 is generated for each paragraph of this environment.
12789 \begin_layout Itemize
12790 \begin_inset Flex Code
12793 \begin_layout Plain Layout
12800 \begin_inset Flex Code
12803 \begin_layout Plain Layout
12810 \begin_inset Flex Code
12813 \begin_layout Plain Layout
12819 is passed as an argument to the environment.
12821 \begin_inset Flex Code
12824 \begin_layout Plain Layout
12830 can be defined in the
12831 \begin_inset Flex MenuItem
12834 \begin_layout Plain Layout
12835 Edit\SpecialChar \menuseparator
12837 \begin_inset space ~
12849 \begin_layout Standard
12850 Putting the last few things together, the LaTeX output will be either:
12853 \begin_layout LyX-Code
12856 latexname[latexparam]{\SpecialChar \ldots{}
12860 \begin_layout Standard
12864 \begin_layout LyX-Code
12867 begin{latexname}[latexparam] \SpecialChar \ldots{}
12873 \begin_layout Standard
12874 depending upon the LaTeX type.
12878 \begin_layout Description
12880 \change_inserted -712698321 1354263086
12881 \begin_inset Flex Code
12884 \begin_layout Plain Layout
12886 \change_inserted -712698321 1353866852
12893 \begin_inset Flex Code
12896 \begin_layout Plain Layout
12898 \change_inserted -712698321 1353866852
12904 ] A string that is put at the beginning of the style content.
12905 A line break in the output can be indicated by
12906 \begin_inset Flex Code
12909 \begin_layout Plain Layout
12911 \change_inserted -712698321 1354263086
12922 \begin_layout Description
12923 \begin_inset Flex Code
12926 \begin_layout Plain Layout
12933 \begin_inset Flex Code
12936 \begin_layout Plain Layout
12942 ] If you put styles into environments, the leftmargins are not simply added,
12943 but added with a factor
12944 \begin_inset Formula $\frac{4}{depth+4}$
12948 Note that this parameter is also used when the margin is defined as
12949 \begin_inset Flex Code
12952 \begin_layout Plain Layout
12959 \begin_inset Flex Code
12962 \begin_layout Plain Layout
12969 Then it is added to the manual or dynamic margin.
12971 \begin_inset Newline newline
12974 The argument is passed as a string.
12976 \begin_inset Quotes eld
12980 \begin_inset Flex Code
12983 \begin_layout Plain Layout
12990 \begin_inset Quotes erd
12993 means that the paragraph is indented with the width of
12994 \begin_inset Quotes eld
12998 \begin_inset Flex Code
13001 \begin_layout Plain Layout
13008 \begin_inset Quotes erd
13011 in the normal font.
13012 You can get a negative width by prefixing the string with
13013 \begin_inset Quotes eld
13017 \begin_inset Flex Code
13020 \begin_layout Plain Layout
13027 \begin_inset Quotes erd
13031 This way was chosen so that the look is the same with each used screen
13036 \begin_layout Description
13037 \begin_inset Flex Code
13040 \begin_layout Plain Layout
13047 \begin_inset Flex Code
13050 \begin_layout Plain Layout
13055 , Manual, Dynamic, First_Dynamic, Right_Address_Box
13061 \begin_inset Newline newline
13064 The kind of margin that the style has on the left side.
13066 \begin_inset Flex Code
13069 \begin_layout Plain Layout
13075 just means a fixed margin.
13077 \begin_inset Flex Code
13080 \begin_layout Plain Layout
13086 means that the left margin depends on the string entered in the
13087 \begin_inset Flex MenuItem
13090 \begin_layout Plain Layout
13091 Edit\SpecialChar \menuseparator
13093 \begin_inset space ~
13102 This is used to typeset nice lists without tabulators.
13104 \begin_inset Flex Code
13107 \begin_layout Plain Layout
13113 means that the margin depends on the size of the label.
13114 This is used for automatic enumerated headlines.
13115 It is obvious that the headline
13116 \begin_inset Quotes eld
13119 5.4.3.2.1 Very long headline
13120 \begin_inset Quotes erd
13123 must have a wider left margin (as wide as
13124 \begin_inset Quotes eld
13128 \begin_inset Quotes erd
13131 plus the space) than
13132 \begin_inset Quotes eld
13135 3.2 Very long headline
13136 \begin_inset Quotes erd
13140 \begin_inset Quotes eld
13144 \begin_inset Quotes erd
13147 are not able to do this.
13149 \begin_inset Flex Code
13152 \begin_layout Plain Layout
13158 is similar, but only the very first row of the paragraph is dynamic, while
13159 the others are static; this is used, for example, for descriptions.
13161 \begin_inset Flex Code
13164 \begin_layout Plain Layout
13170 means the margin is chosen in a way that the longest row of this paragraph
13171 fits to the right margin.
13172 This is used to typeset an address on the right edge of the page.
13175 \begin_layout Description
13176 \begin_inset Flex Code
13179 \begin_layout Plain Layout
13186 \begin_inset Flex Code
13189 \begin_layout Plain Layout
13198 \begin_inset Flex Code
13201 \begin_layout Plain Layout
13207 ] Whether fragile commands in this style should be
13208 \begin_inset Flex Code
13211 \begin_layout Plain Layout
13224 whether this command should itself be protected.)
13227 \begin_layout Description
13228 \begin_inset Flex Code
13231 \begin_layout Plain Layout
13238 \begin_inset Flex Code
13241 \begin_layout Plain Layout
13248 \begin_inset Flex Code
13251 \begin_layout Plain Layout
13259 ] Whether newlines are translated into LaTeX newlines (
13260 \begin_inset Flex Code
13263 \begin_layout Plain Layout
13274 The translation can be switched off to allow more comfortable LaTeX editing
13278 \begin_layout Description
13279 \begin_inset Flex Code
13282 \begin_layout Plain Layout
13289 \begin_inset Flex Code
13292 \begin_layout Plain Layout
13299 \begin_inset Flex Code
13302 \begin_layout Plain Layout
13310 ] If set to true, and if
13311 \begin_inset Flex Code
13314 \begin_layout Plain Layout
13321 \begin_inset Flex Code
13324 \begin_layout Plain Layout
13330 ) paragraphs are being indented, then the indentation of such a paragraph
13331 following one of this type will be suppressed.
13332 (So this will not affect the display of non-default paragraphs.)
13335 \begin_layout Description
13336 \begin_inset Flex Code
13339 \begin_layout Plain Layout
13345 Name of a style that has replaced this style.
13346 This is used to rename a style, while keeping backward compatibility.
13349 \begin_layout Description
13351 \change_deleted -712698321 1353679722
13352 \begin_inset Flex Code
13355 \begin_layout Plain Layout
13362 \begin_inset Flex Code
13365 \begin_layout Plain Layout
13371 ] The number of optional arguments that can be used with this style.
13372 This is useful for things like section headings, and only makes sense with
13374 Note that, on output, the optional arguments will all precede any required
13375 arguments (see below).
13376 So one can have constructs like:
13380 \begin_layout LyX-Code
13382 \change_deleted -712698321 1353679722
13385 mycmd[opt1]{req1}{contents of paragraph}
13388 \begin_layout Standard
13390 \change_deleted -712698321 1353679722
13391 but one cannot have things like:
13394 \begin_layout LyX-Code
13396 \change_deleted -712698321 1353679722
13399 mycmd[opt1]{req1}[opt2]{contents of paragraph}
13402 \begin_layout Standard
13404 \change_deleted -712698321 1353679722
13405 at least, not without ERT (with which you can have anything).
13412 \begin_layout Description
13413 \begin_inset Flex Code
13416 \begin_layout Plain Layout
13423 \begin_inset Flex Code
13426 \begin_layout Plain Layout
13435 \begin_inset Flex Code
13438 \begin_layout Plain Layout
13444 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
13445 output, but only by a line break; together with
13446 \begin_inset Flex Code
13449 \begin_layout Plain Layout
13455 , this allows to emulate a plain text editor (like the ERT inset).
13458 \begin_layout Description
13459 \begin_inset Flex Code
13462 \begin_layout Plain Layout
13469 \begin_inset Flex Code
13472 \begin_layout Plain Layout
13478 ] The indent of the very first line of a paragraph.
13480 \begin_inset Flex Code
13483 \begin_layout Plain Layout
13489 will be fixed for a certain style.
13490 The exception is the default style, since the indentation for these paragraphs
13491 can be prohibited with
13492 \begin_inset Flex Code
13495 \begin_layout Plain Layout
13503 \begin_inset Flex Code
13506 \begin_layout Plain Layout
13512 style paragraphs inside environments use the
13513 \begin_inset Flex Code
13516 \begin_layout Plain Layout
13522 of the environment, not their native one.
13524 \begin_inset Flex Code
13527 \begin_layout Plain Layout
13533 paragraphs inside an enumeration are not indented.
13536 \begin_layout Description
13537 \begin_inset Flex Code
13540 \begin_layout Plain Layout
13547 \begin_inset Flex Code
13550 \begin_layout Plain Layout
13556 ] The vertical space between two paragraphs of this style.
13559 \begin_layout Description
13560 \begin_inset Flex Code
13563 \begin_layout Plain Layout
13570 \begin_inset Flex Code
13573 \begin_layout Plain Layout
13579 ] LyX allows the user to choose either
13580 \begin_inset Quotes eld
13584 \begin_inset Quotes erd
13588 \begin_inset Quotes eld
13592 \begin_inset Quotes erd
13595 to typeset a document.
13597 \begin_inset Quotes eld
13601 \begin_inset Quotes erd
13604 is chosen, this value is completely ignored.
13606 \begin_inset Quotes eld
13610 \begin_inset Quotes erd
13613 is chosen, the parindent of a LaTeXtype
13614 \begin_inset Quotes eld
13618 \begin_inset Quotes erd
13621 style is ignored and all paragraphs are separated by this parskip argument.
13622 The vertical space is calculated with
13623 \begin_inset Flex Code
13626 \begin_layout Plain Layout
13628 \begin_inset space ~
13637 \begin_inset Flex Code
13640 \begin_layout Plain Layout
13646 is the height of a row with the normal font.
13647 This way, the look stays the same with different screen fonts.
13650 \begin_layout Description
13651 \begin_inset Flex Code
13654 \begin_layout Plain Layout
13661 \begin_inset Flex Code
13664 \begin_layout Plain Layout
13673 \begin_inset Flex Code
13676 \begin_layout Plain Layout
13682 ] Whether the contents of this paragraph should be output in raw form, meaning
13683 without special translations that LaTeX would require.
13686 \begin_layout Description
13687 \begin_inset Flex Code
13690 \begin_layout Plain Layout
13696 Information to be included in the LaTeX preamble when this style is used.
13697 Used to define macros, load packages, etc., required by this particular
13700 \begin_inset Quotes eld
13704 \begin_inset Flex Code
13707 \begin_layout Plain Layout
13714 \begin_inset Quotes erd
13720 \begin_layout Description
13721 \begin_inset Flex Code
13724 \begin_layout Plain Layout
13731 \begin_inset Flex Code
13734 \begin_layout Plain Layout
13740 ] The prefix to use when creating labels referring to paragraphs of this
13742 This allows the use of formatted references.
13745 \begin_layout Description
13747 \change_deleted -712698321 1353681258
13748 \begin_inset Flex Code
13751 \begin_layout Plain Layout
13758 \begin_inset Flex Code
13761 \begin_layout Plain Layout
13767 ] The number of required arguments that the LaTeX command or environment
13768 corresponding to this style expects.
13769 In the case of a command, these are required arguments
13773 that associated with the content of the paragraph itself.
13774 These do not actually have to be provided: LyX will output empty arguments
13776 Note that optional arguments will be output before required arguments.
13777 See the discussion of the
13778 \begin_inset Flex Code
13781 \begin_layout Plain Layout
13787 tag above for more information.
13792 \begin_layout Description
13793 \begin_inset Flex Code
13796 \begin_layout Plain Layout
13803 \begin_inset Flex Code
13806 \begin_layout Plain Layout
13812 ] Whether the style requires the feature
13813 \begin_inset Flex Code
13816 \begin_layout Plain Layout
13823 See the description of
13824 \begin_inset Flex Code
13827 \begin_layout Plain Layout
13834 \begin_inset CommandInset ref
13835 LatexCommand pageref
13836 reference "des:FreeSpacing"
13840 ) for information on `features'.
13842 \change_inserted -712698321 1353693134
13846 \begin_layout Description
13848 \change_inserted -712698321 1353693371
13849 \begin_inset Flex Code
13852 \begin_layout Plain Layout
13854 \change_inserted -712698321 1353693146
13863 \begin_inset Flex Code
13866 \begin_layout Plain Layout
13868 \change_inserted -712698321 1353693235
13877 \begin_inset Flex Code
13880 \begin_layout Plain Layout
13882 \change_inserted -712698321 1353693235
13888 ] Resets the LaTeX arguments of this style (as defined via the
13889 \begin_inset Flex Code
13892 \begin_layout Plain Layout
13894 \change_inserted -712698321 1353693371
13903 This is useful if you have copied a style via
13904 \begin_inset Flex Code
13907 \begin_layout Plain Layout
13909 \change_inserted -712698321 1353693302
13917 , but you do not want to inherit its (required and optional) arguments.
13922 \begin_layout Description
13924 \change_inserted -712698321 1354263074
13925 \begin_inset Flex Code
13928 \begin_layout Plain Layout
13930 \change_inserted -712698321 1353866876
13937 \begin_inset Flex Code
13940 \begin_layout Plain Layout
13942 \change_inserted -712698321 1353866873
13948 ] A string that is put at the end of the layout content.
13949 A line break in the output can be indicated by
13950 \begin_inset Flex Code
13953 \begin_layout Plain Layout
13955 \change_inserted -712698321 1354263069
13966 \begin_layout Description
13967 \begin_inset Flex Code
13970 \begin_layout Plain Layout
13977 \begin_inset Flex Code
13980 \begin_layout Plain Layout
13987 \begin_inset Flex Code
13990 \begin_layout Plain Layout
13999 \begin_layout Description
14000 \begin_inset Flex Code
14003 \begin_layout Plain Layout
14010 \begin_inset Flex Code
14013 \begin_layout Plain Layout
14018 , onehalf, double, other
14027 ] This defines what the default spacing should be in the style.
14029 \begin_inset Flex Code
14032 \begin_layout Plain Layout
14039 \begin_inset Flex Code
14042 \begin_layout Plain Layout
14049 \begin_inset Flex Code
14052 \begin_layout Plain Layout
14058 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
14059 If you specify the argument
14060 \begin_inset Flex Code
14063 \begin_layout Plain Layout
14069 , then you should also provide a numerical argument which will be the actual
14071 Note that, contrary to other parameters,
14072 \begin_inset Flex Code
14075 \begin_layout Plain Layout
14081 implies the generation of specific LaTeX code, using the package
14084 \begin_inset Flex Code
14087 \begin_layout Plain Layout
14096 \begin_layout Description
14097 \begin_inset Flex Code
14100 \begin_layout Plain Layout
14107 \begin_inset Flex Code
14110 \begin_layout Plain Layout
14117 \begin_inset Flex Code
14120 \begin_layout Plain Layout
14128 ] Spellcheck paragraphs of this style.
14132 \begin_layout Description
14133 \begin_inset Flex Code
14136 \begin_layout Plain Layout
14142 The font used for the text body .
14144 \begin_inset CommandInset ref
14146 reference "sub:Font-description"
14153 \begin_layout Description
14154 \begin_inset Flex Code
14157 \begin_layout Plain Layout
14166 \begin_inset Flex Code
14169 \begin_layout Plain Layout
14179 The level of the style in the table of contents.
14180 This is used for automatic numbering of section headings.
14183 \begin_layout Description
14184 \begin_inset Flex Code
14187 \begin_layout Plain Layout
14194 \begin_inset Flex Code
14197 \begin_layout Plain Layout
14203 ] The vertical space with which the very first of a chain of paragraphs
14204 with this style is separated from the previous paragraph.
14205 If the previous paragraph has another style, the separations are not simply
14206 added, but the maximum is taken.
14209 \begin_layout Subsection
14210 \begin_inset CommandInset label
14216 Internationalization of Paragraph Styles
14219 \begin_layout Standard
14220 LyX has long supported internationalization of layout information, but,
14221 until version 2.0, this applied only to the user interface and not to, say,
14223 Thus, French authors were forced to resort to ugly hacks if they wanted
14228 1' instead of `Theorem 1'.
14229 Thanks to Georg Baum, that is no longer the case.
14232 \begin_layout Standard
14234 \begin_inset Flex Code
14237 \begin_layout Plain Layout
14243 defines text that is to appear in the typeset document, it may use
14244 \begin_inset Flex Code
14247 \begin_layout Plain Layout
14254 \begin_inset Flex Code
14257 \begin_layout Plain Layout
14263 to support non-English and even multi-language documents correctly.
14264 The following excerpt (from the
14265 \begin_inset Flex Code
14268 \begin_layout Plain Layout
14274 file) shows how this works:
14277 \begin_layout LyX-Code
14282 \begin_layout LyX-Code
14285 theoremstyle{remark}
14288 \begin_layout LyX-Code
14291 newtheorem{claim}[thm]{
14298 \begin_layout LyX-Code
14302 \begin_layout LyX-Code
14306 \begin_layout LyX-Code
14311 claimname}{_(Claim)}
14314 \begin_layout LyX-Code
14318 \begin_layout LyX-Code
14322 \begin_layout LyX-Code
14331 claimname}{_(Claim)}}
14334 \begin_layout LyX-Code
14339 \begin_layout Standard
14340 In principle, any legal LaTeX may appear in the
14341 \begin_inset Flex Code
14344 \begin_layout Plain Layout
14351 \begin_inset Flex Code
14354 \begin_layout Plain Layout
14360 tags, but in practice they will typically look as they do here.
14361 The key to correct translation of the typeset text is the definition of
14363 \begin_inset Flex Code
14366 \begin_layout Plain Layout
14375 \begin_inset Flex Code
14378 \begin_layout Plain Layout
14390 \begin_layout Standard
14392 \begin_inset Flex Code
14395 \begin_layout Plain Layout
14401 tag provides for internationalization based upon the overall language of
14403 The contents of the tag will be included in the preamble, just as with
14405 \begin_inset Flex Code
14408 \begin_layout Plain Layout
14415 What makes it special is the use of the
14416 \begin_inset Quotes eld
14420 \begin_inset Quotes erd
14424 \begin_inset Flex Code
14427 \begin_layout Plain Layout
14433 , which will be replaced, when LyX produces LaTeX output, with the translation
14434 of its argument into the document language.
14437 \begin_layout Standard
14439 \begin_inset Flex Code
14442 \begin_layout Plain Layout
14448 tag is more complex, since it is meant to provide support for multi-language
14449 documents and so offers an interface to the
14450 \begin_inset Flex Code
14453 \begin_layout Plain Layout
14460 Its contents will be added to the preamble once for each language that
14461 appears in the document.
14462 In this case, the argument to
14463 \begin_inset Flex Code
14466 \begin_layout Plain Layout
14472 will be replaced with its translation into the language in question; the
14474 \begin_inset Flex Code
14477 \begin_layout Plain Layout
14483 is replaced by the language name (as used by the babel package).
14486 \begin_layout Standard
14487 A German document that also included a French section would thus have the
14488 following in the preamble:
14491 \begin_layout LyX-Code
14500 claimname}{Affirmation}}
14508 claimname}{Behauptung}}
14512 claimname}{Behauptung}
14515 \begin_layout Standard
14517 \begin_inset Flex Code
14520 \begin_layout Plain Layout
14526 will then conspire to produce the correct text in the output.
14529 \begin_layout Standard
14530 One important point to note here is that the translations are provided by
14531 LyX itself, through the
14532 \change_inserted -195340706 1334775793
14534 \begin_inset Flex Code
14537 \begin_layout Plain Layout
14539 \change_inserted -195340706 1334775793
14546 \change_deleted -195340706 1334775793
14547 same mechanism it uses for internationalization of the user interface
14550 This means, in effect, that
14551 \begin_inset Flex Code
14554 \begin_layout Plain Layout
14561 \begin_inset Flex Code
14564 \begin_layout Plain Layout
14570 are really only of use in layout files that are provided with LyX, since
14571 text entered in user-created layout files will not be seen by LyX's internation
14573 \change_inserted -195340706 1334775793
14575 \begin_inset Flex Code
14578 \begin_layout Plain Layout
14580 \change_inserted -195340706 1334775793
14586 file is modified accordingly
14589 That said, however, any layout created with the intention that it will
14590 be included with LyX should use these tags where appropriate.
14592 \change_inserted -195340706 1334775793
14593 Please note that the paragraph style translations provided by LyX will
14594 never change with a minor update (e.g.
14595 from version 2.1.x to 2.1.y).
14596 It is however quite likely that a major update (e.g.
14597 from 2.0.x to 2.1.y) will introduce new translations or corrections.
14602 \begin_layout Subsection
14604 \begin_inset CommandInset label
14613 \begin_layout Standard
14614 Since version 1.3.0 of LyX, it is has been both possible and necessary to
14615 define the floats (
14616 \begin_inset Flex MenuItem
14619 \begin_layout Plain Layout
14626 \begin_inset Flex MenuItem
14629 \begin_layout Plain Layout
14635 , \SpecialChar \ldots{}
14636 ) in the text class itself.
14637 Standard floats are included in the file
14638 \begin_inset Flex Code
14641 \begin_layout Plain Layout
14647 , so you may have to do no more than add
14650 \begin_layout LyX-Code
14651 Input stdfloats.inc
14654 \begin_layout Standard
14655 to your layout file.
14656 If you want to implement a text class that proposes some other float types
14657 (like the AGU class bundled with LyX), the information below will hopefully
14661 \begin_layout Description
14662 \begin_inset Flex Code
14665 \begin_layout Plain Layout
14672 \begin_inset Flex Code
14675 \begin_layout Plain Layout
14682 \begin_inset Quotes erd
14686 \begin_inset Quotes erd
14689 ] The file name extension of an auxiliary file for the list of figures (or
14691 LaTeX writes the captions to this file.
14694 \begin_layout Description
14695 \begin_inset Flex Code
14698 \begin_layout Plain Layout
14705 \begin_inset Flex Code
14708 \begin_layout Plain Layout
14715 \begin_inset Quotes erd
14719 \begin_inset Quotes erd
14722 ] The string that will be used in the menus and also for the caption.
14723 This is translated to the current language if babel is used.
14726 \begin_layout Description
14727 \begin_inset Flex Code
14730 \begin_layout Plain Layout
14736 These are used for XHTML output.
14738 \begin_inset CommandInset ref
14740 reference "sec:Tags-for-XHTML"
14747 \begin_layout Description
14748 \begin_inset Flex Code
14751 \begin_layout Plain Layout
14760 \begin_inset Flex Code
14763 \begin_layout Plain Layout
14772 \begin_inset Flex Code
14775 \begin_layout Plain Layout
14781 ] Indicates whether the float is already defined in the document class or
14782 if we instead need to load
14783 \begin_inset Flex Code
14786 \begin_layout Plain Layout
14792 and use what it provides to define it on-the-fly.
14794 \begin_inset Flex Code
14797 \begin_layout Plain Layout
14804 \begin_inset Flex Code
14807 \begin_layout Plain Layout
14814 It should be set to
14815 \begin_inset Flex Code
14818 \begin_layout Plain Layout
14824 if the float is already defined by the LaTeX document class.
14827 \begin_layout Description
14828 \begin_inset Flex Code
14831 \begin_layout Plain Layout
14838 \begin_inset Flex Code
14841 \begin_layout Plain Layout
14848 \begin_inset Quotes erd
14852 \begin_inset Quotes erd
14855 ] The command used to generate a list of floats of this type; the leading
14858 ' should be omitted.
14864 \begin_inset Flex Code
14867 \begin_layout Plain Layout
14873 is false, since there is no standard way to generate this command.
14875 \begin_inset Flex Code
14878 \begin_layout Plain Layout
14884 is true, since in that case there is a standard way to define the command.
14887 \begin_layout Description
14888 \begin_inset Flex Code
14891 \begin_layout Plain Layout
14898 \begin_inset Flex Code
14901 \begin_layout Plain Layout
14908 \begin_inset Quotes erd
14912 \begin_inset Quotes erd
14915 ] A title for a list of floats of this kind (list of figures, tables, or
14917 It is used for the screen label within LyX; it is passed to LaTeX for use
14918 as the title there; and it is used as the title in XHTML output.
14919 It will be translated to the document language.
14922 \begin_layout Description
14923 \begin_inset Flex Code
14926 \begin_layout Plain Layout
14933 \begin_inset Flex Code
14936 \begin_layout Plain Layout
14943 \begin_inset Quotes erd
14947 \begin_inset Quotes erd
14950 ] This (optional) argument determines whether floats of this class will
14951 be numbered within some sectional unit of the document.
14952 For example, if within is equal to
14953 \begin_inset Flex Code
14956 \begin_layout Plain Layout
14962 , the floats will be numbered within chapters.
14966 \begin_layout Description
14967 \begin_inset Flex Code
14970 \begin_layout Plain Layout
14977 \begin_inset Flex Code
14980 \begin_layout Plain Layout
14987 \begin_inset Quotes erd
14991 \begin_inset Quotes erd
14994 ] The default placement for the given class of floats.
14995 The string should be as in standard LaTeX:
14996 \begin_inset Flex Code
14999 \begin_layout Plain Layout
15006 \begin_inset Flex Code
15009 \begin_layout Plain Layout
15016 \begin_inset Flex Code
15019 \begin_layout Plain Layout
15026 \begin_inset Flex Code
15029 \begin_layout Plain Layout
15035 for top, bottom, page, and here, respectively.
15039 \begin_layout Plain Layout
15040 Note that the order of these letters in the string is irrelevant, like in
15046 On top of that there is a new type,
15047 \begin_inset Flex Code
15050 \begin_layout Plain Layout
15056 , which does not really correspond to a float, since it means: put it
15057 \begin_inset Quotes eld
15061 \begin_inset Quotes erd
15065 Note however that the
15066 \begin_inset Flex Code
15069 \begin_layout Plain Layout
15075 specifier is special and, because of implementation details, cannot be
15076 used in non-built in float types.
15077 If you do not understand what this means, just use
15078 \begin_inset Quotes eld
15082 \begin_inset Flex Code
15085 \begin_layout Plain Layout
15092 \begin_inset Quotes erd
15098 \begin_layout Description
15099 \begin_inset Flex Code
15102 \begin_layout Plain Layout
15109 \begin_inset Flex Code
15112 \begin_layout Plain Layout
15118 ] The prefix to use when creating labels referring to floats of this type.
15119 This allows the use of formatted references.
15120 Note that you can remove any
15121 \begin_inset Flex Code
15124 \begin_layout Plain Layout
15130 set by a copied style by using the special value
15131 \begin_inset Quotes eld
15135 \begin_inset Quotes erd
15138 , which must be all caps.
15141 \begin_layout Description
15142 \begin_inset Flex Code
15145 \begin_layout Plain Layout
15152 \begin_inset Flex Code
15155 \begin_layout Plain Layout
15162 \begin_inset Quotes erd
15166 \begin_inset Quotes erd
15169 ] The style used when defining the float using
15170 \begin_inset Flex Code
15173 \begin_layout Plain Layout
15184 \begin_layout Description
15185 \begin_inset Flex Code
15188 \begin_layout Plain Layout
15195 \begin_inset Flex Code
15198 \begin_layout Plain Layout
15205 \begin_inset Quotes erd
15209 \begin_inset Quotes erd
15213 \begin_inset Quotes eld
15217 \begin_inset Quotes erd
15220 of the new class of floats, like program or algorithm.
15221 After the appropriate
15222 \begin_inset Flex Code
15225 \begin_layout Plain Layout
15234 \begin_inset Flex Code
15237 \begin_layout Plain Layout
15246 \begin_inset Flex Code
15249 \begin_layout Plain Layout
15260 \begin_layout Description
15261 \begin_inset Flex Code
15264 \begin_layout Plain Layout
15271 \begin_inset Flex Code
15274 \begin_layout Plain Layout
15281 \begin_inset Flex Code
15284 \begin_layout Plain Layout
15292 ] Tells us whether this float is defined using the facilities provided by
15294 \begin_inset Flex Code
15297 \begin_layout Plain Layout
15303 , either by the class file or a package, or on-the-fly by LyX itself.
15306 \begin_layout Standard
15307 Note that defining a float with type
15308 \begin_inset Flex Code
15311 \begin_layout Plain Layout
15319 automatically defines the corresponding counter with name
15320 \begin_inset Flex Code
15323 \begin_layout Plain Layout
15334 \begin_layout Subsection
15335 Flex insets and InsetLayout
15336 \begin_inset CommandInset label
15338 name "sub:Flex-insets-and"
15345 \begin_layout Standard
15346 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
15347 these are called Flex insets.
15351 \begin_layout Standard
15352 Flex insets come in three different kinds:
15355 \begin_layout Itemize
15357 \begin_inset Flex Code
15360 \begin_layout Plain Layout
15366 ): These define semantic markup corresponding to such LaTeX commands as
15368 \begin_inset Flex Code
15371 \begin_layout Plain Layout
15380 \begin_inset Flex Code
15383 \begin_layout Plain Layout
15394 \begin_layout Itemize
15396 \begin_inset Flex Code
15399 \begin_layout Plain Layout
15405 ): These can be used to define custom collapsible insets, similar to TeX
15406 code, footnote, and the like.
15407 An obvious example is an endnote inset, which is defined in the
15408 \begin_inset Flex Code
15411 \begin_layout Plain Layout
15420 \begin_layout Itemize
15422 \begin_inset Flex Code
15425 \begin_layout Plain Layout
15431 ): For use with DocBook classes.
15434 \begin_layout Standard
15435 Flex insets are defined using the
15436 \begin_inset Flex Code
15439 \begin_layout Plain Layout
15445 tag, which shall be explained in a moment.
15448 \begin_layout Standard
15450 \begin_inset Flex Code
15453 \begin_layout Plain Layout
15459 tag also serves another function: It can be used to customize the general
15460 layout of many different types of insets.
15462 \begin_inset Flex Code
15465 \begin_layout Plain Layout
15471 can be used to customize the layout parameters for footnotes, marginal
15472 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
15473 boxes, tables, algorithms, URLs, and optional arguments, as well as to
15474 define Flex insets.
15477 \begin_layout Standard
15479 \begin_inset Flex Code
15482 \begin_layout Plain Layout
15488 definition must begin with a line of the form:
15491 \begin_layout LyX-Code
15495 \begin_layout Standard
15497 \begin_inset Flex Code
15500 \begin_layout Plain Layout
15506 indicates the inset whose layout is being defined, and here there are
15507 \change_inserted 5863208 1334489266
15509 \change_deleted 5863208 1334489267
15515 \begin_layout Enumerate
15516 The layout for a pre-existing inset is being modified.
15517 In this case, can be
15518 \begin_inset Flex Code
15521 \begin_layout Plain Layout
15527 any one of the following:
15528 \begin_inset Flex Code
15531 \begin_layout Plain Layout
15538 \begin_inset Flex Code
15541 \begin_layout Plain Layout
15548 \begin_inset Flex Code
15551 \begin_layout Plain Layout
15558 \begin_inset Flex Code
15561 \begin_layout Plain Layout
15568 \begin_inset Flex Code
15571 \begin_layout Plain Layout
15578 \begin_inset Flex Code
15581 \begin_layout Plain Layout
15588 \begin_inset Flex Code
15591 \begin_layout Plain Layout
15598 \begin_inset Flex Code
15601 \begin_layout Plain Layout
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
15638 \begin_inset Flex Code
15641 \begin_layout Plain Layout
15648 \begin_inset Flex Code
15651 \begin_layout Plain Layout
15658 \begin_inset Flex Code
15661 \begin_layout Plain Layout
15668 \begin_inset Flex Code
15671 \begin_layout Plain Layout
15678 \begin_inset Flex Code
15681 \begin_layout Plain Layout
15688 \begin_inset Flex Code
15691 \begin_layout Plain Layout
15698 \begin_inset Flex Code
15701 \begin_layout Plain Layout
15703 \change_deleted -712698321 1353866704
15707 \change_inserted -712698321 1353866707
15716 \begin_inset Flex Code
15719 \begin_layout Plain Layout
15726 \begin_inset Flex Code
15729 \begin_layout Plain Layout
15738 \begin_layout Enumerate
15739 The layout for a Flex inset is being defined.
15741 \begin_inset Flex Code
15744 \begin_layout Plain Layout
15750 must be of the form
15751 \begin_inset Quotes eld
15755 \begin_inset Flex Code
15758 \begin_layout Plain Layout
15765 \begin_inset Quotes erd
15769 \begin_inset Flex Code
15772 \begin_layout Plain Layout
15778 may be be any valid identifier not used by a pre-existing Flex inset.
15779 The identifier may include spaces, but in that case the whole thing must
15780 be wrapped in quotes.
15781 Note that the definition of a flex inset
15786 \begin_inset Flex Code
15789 \begin_layout Plain Layout
15795 entry, declaring which type of inset it defines.
15796 \change_inserted 5863208 1334489312
15800 \begin_layout Enumerate
15802 \change_inserted 5863208 1334492248
15803 The layout for user specific branch is being defined.
15805 \begin_inset Flex Code
15808 \begin_layout Plain Layout
15810 \change_inserted 5863208 1334489384
15816 must be of the form
15817 \begin_inset Quotes eld
15821 \begin_inset Flex Code
15824 \begin_layout Plain Layout
15826 \change_inserted 5863208 1334489392
15833 \begin_inset Quotes erd
15837 \begin_inset Flex Code
15840 \begin_layout Plain Layout
15842 \change_inserted 5863208 1334489384
15848 may be be any valid identifier of branch defined in user's document.
15849 The identifier may include spaces, but in that case the whole thing must
15850 be wrapped in quotes.
15851 The main purpose of this feature is to allow LaTeX wrapping around specific
15852 branches as user needs.
15857 \begin_layout Standard
15859 \begin_inset Flex Code
15862 \begin_layout Plain Layout
15868 definition can contain the following entries:
15871 \begin_layout Description
15873 \change_inserted -712698321 1353681390
15874 \begin_inset Flex Code
15877 \begin_layout Plain Layout
15879 \change_inserted -712698321 1353681344
15886 \begin_inset Flex Code
15889 \begin_layout Plain Layout
15891 \change_inserted -712698321 1353681344
15897 ] Defines argument number <int> of a command\SpecialChar \slash{}
15898 environment associated with
15899 the current layout.
15900 The definition must end with
15901 \begin_inset Flex Code
15904 \begin_layout Plain Layout
15906 \change_inserted -712698321 1353681344
15914 \begin_inset space ~
15918 \begin_inset CommandInset ref
15920 reference "sub:Paragraph-Styles"
15927 \begin_layout Description
15929 \change_inserted -195340706 1333913893
15930 \begin_inset Flex Code
15933 \begin_layout Plain Layout
15939 Preamble for changing languages.
15941 \begin_inset space ~
15945 \begin_inset CommandInset ref
15947 reference "sub:I18n"
15954 \begin_layout Description
15955 \begin_inset Flex Code
15958 \begin_layout Plain Layout
15964 The color for the inset's background.
15965 The valid colors are defined in
15966 \begin_inset Flex Code
15969 \begin_layout Plain Layout
15978 \begin_layout Description
15979 \begin_inset Flex Code
15982 \begin_layout Plain Layout
15989 \begin_inset Flex Code
15992 \begin_layout Plain Layout
16001 \begin_inset Flex Code
16004 \begin_layout Plain Layout
16010 ] Whether to use the content of the inset as the label, when the inset is
16015 \begin_layout Description
16016 \begin_inset Flex Code
16019 \begin_layout Plain Layout
16026 \begin_inset Flex Code
16029 \begin_layout Plain Layout
16035 Copies all the features of an existing style into the current one.
16039 \begin_layout Description
16040 \begin_inset Flex Code
16043 \begin_layout Plain Layout
16050 \begin_inset Flex Code
16053 \begin_layout Plain Layout
16062 \begin_inset Flex Code
16065 \begin_layout Plain Layout
16071 ] Indicates whether the user may employ the Paragraph Settings dialog to
16072 customize the paragraph.
16075 \begin_layout Description
16076 \begin_inset Flex Code
16079 \begin_layout Plain Layout
16086 \begin_inset Flex Code
16089 \begin_layout Plain Layout
16096 \begin_inset Flex Code
16099 \begin_layout Plain Layout
16106 \begin_inset Flex Code
16109 \begin_layout Plain Layout
16115 , describing the rendering style used for the inset's frame and buttons.
16116 Footnotes generally use
16117 \begin_inset Flex Code
16120 \begin_layout Plain Layout
16126 , ERT insets generally
16127 \begin_inset Flex Code
16130 \begin_layout Plain Layout
16136 , and character styles
16137 \begin_inset Flex Code
16140 \begin_layout Plain Layout
16149 \begin_layout Description
16150 \begin_inset Flex Code
16153 \begin_layout Plain Layout
16160 \begin_inset Flex Code
16163 \begin_layout Plain Layout
16170 \begin_inset Flex Code
16173 \begin_layout Plain Layout
16182 \begin_inset Flex Code
16185 \begin_layout Plain Layout
16192 \begin_inset Flex Code
16195 \begin_layout Plain Layout
16202 Indicates whether the environment will stand on its own in LaTeX output
16203 or will appear inline with the surrounding text.
16204 If set to false, it is supposed that the LaTeX environment ignores white
16205 space (including one newline character) after the
16206 \begin_inset Flex Code
16209 \begin_layout Plain Layout
16222 \begin_inset Flex Code
16225 \begin_layout Plain Layout
16241 \begin_layout Description
16242 \begin_inset Flex Code
16245 \begin_layout Plain Layout
16251 Required at the end of the InsetLayout declarations.
16254 \begin_layout Description
16255 \begin_inset Flex Code
16258 \begin_layout Plain Layout
16264 The font used for both the text body
16270 \begin_inset space ~
16274 \begin_inset CommandInset ref
16276 reference "sub:Font-description"
16281 Note that defining this font automatically defines the
16282 \begin_inset Flex Code
16285 \begin_layout Plain Layout
16291 to the same value, so define this first and define
16292 \begin_inset Flex Code
16295 \begin_layout Plain Layout
16301 later if you want them to be different.
16302 \change_inserted 155139281 1354130923
16306 \begin_layout Description
16308 \change_inserted 155139281 1354130923
16309 \begin_inset Flex Code
16312 \begin_layout Plain Layout
16314 \change_inserted 155139281 1354130923
16315 ForceLocalFontSwitch
16321 \begin_inset Flex Code
16324 \begin_layout Plain Layout
16326 \change_inserted 155139281 1354130923
16335 \begin_inset Flex Code
16338 \begin_layout Plain Layout
16340 \change_inserted 155139281 1354130923
16346 ] When using babel, always use a local font switch (
16347 \begin_inset Flex Code
16350 \begin_layout Plain Layout
16352 \change_inserted 155139281 1354130923
16360 ), never a global one (such as
16361 \begin_inset Flex Code
16364 \begin_layout Plain Layout
16366 \change_inserted 155139281 1354130923
16379 \begin_layout Description
16380 \begin_inset Flex Code
16383 \begin_layout Plain Layout
16390 \begin_inset Quotes eld
16394 \begin_inset Quotes erd
16397 language, leading to Left-to-Right (latin) output, e.
16398 \begin_inset space \thinspace{}
16402 \begin_inset space \space{}
16405 in TeX code or URL.
16409 \begin_layout Description
16410 \begin_inset Flex Code
16413 \begin_layout Plain Layout
16420 \begin_inset Flex Code
16423 \begin_layout Plain Layout
16432 \begin_inset Flex Code
16435 \begin_layout Plain Layout
16441 ] Indicates whether the
16442 \begin_inset Flex Code
16445 \begin_layout Plain Layout
16451 should be used or, instead, the user can change the paragraph style used
16456 \begin_layout Description
16457 \begin_inset Flex Code
16460 \begin_layout Plain Layout
16467 \begin_inset Flex Code
16470 \begin_layout Plain Layout
16479 \begin_inset Flex Code
16482 \begin_layout Plain Layout
16488 ] Usually LyX doesn't allow you to insert more than one space between words,
16489 since a space is considered as the separation between two words, not a
16490 character or symbol of its own.
16491 This is a very fine thing but sometimes annoying, for example, when typing
16492 program code or plain LaTeX code.
16494 \begin_inset Flex Code
16497 \begin_layout Plain Layout
16504 Note that LyX will create protected blanks for the additional blanks when
16505 in another mode than LaTeX-mode.
16509 \begin_layout Description
16510 \begin_inset Flex Code
16513 \begin_layout Plain Layout
16519 These tags control XHTML output.
16521 \begin_inset CommandInset ref
16523 reference "sec:Tags-for-XHTML"
16530 \begin_layout Description
16531 \begin_inset Flex Code
16534 \begin_layout Plain Layout
16541 \begin_inset Flex Code
16544 \begin_layout Plain Layout
16553 \begin_inset Flex Code
16556 \begin_layout Plain Layout
16562 ] Whether to include the contents of this inset in the strings generated
16563 for the `Outline' pane.
16564 One would not, for example, want the content of a footnote in a section
16565 header to be included in the TOC displayed in the outline, but one would
16566 normally want the content of a character style displayed.
16567 Default is false: not to include.
16570 \begin_layout Description
16571 \begin_inset Flex Code
16574 \begin_layout Plain Layout
16581 \begin_inset Flex Code
16584 \begin_layout Plain Layout
16593 \begin_inset Flex Code
16596 \begin_layout Plain Layout
16602 ] Usually LyX does not allow you to leave a paragraph empty, since it would
16603 lead to empty LaTeX output.
16604 There are some cases where this could be desirable however: in a letter
16605 template, the required fields can be provided as empty fields, so that
16606 people do not forget them; in some special classes, a style can be used
16607 as some kind of break, which does not contain actual text.
16611 \begin_layout Description
16612 \begin_inset Flex Code
16615 \begin_layout Plain Layout
16621 The font used for the label.
16623 \begin_inset space ~
16627 \begin_inset CommandInset ref
16629 reference "sub:Font-description"
16634 Note that this definition can never appear before
16635 \begin_inset Flex Code
16638 \begin_layout Plain Layout
16644 , lest it be ineffective.
16647 \begin_layout Description
16648 \begin_inset Flex Code
16651 \begin_layout Plain Layout
16657 What will be displayed on the button or elsewhere as the inset label.
16659 \begin_inset Flex Code
16662 \begin_layout Plain Layout
16669 \begin_inset Flex Code
16672 \begin_layout Plain Layout
16678 ) modify this label on the fly.
16681 \begin_layout Description
16683 \change_inserted -195340706 1333913893
16684 \begin_inset Flex Code
16687 \begin_layout Plain Layout
16693 Language dependent preamble.
16695 \begin_inset space ~
16699 \begin_inset CommandInset ref
16701 reference "sub:I18n"
16708 \begin_layout Description
16709 \begin_inset Flex Code
16712 \begin_layout Plain Layout
16718 The name of the corresponding LaTeX stuff.
16719 Either the environment or command name.
16722 \begin_layout Description
16723 \begin_inset Flex Code
16726 \begin_layout Plain Layout
16732 The optional parameter for the corresponding
16733 \begin_inset Flex Code
16736 \begin_layout Plain Layout
16742 stuff, including possible bracket pairs like
16743 \begin_inset Flex Code
16746 \begin_layout Plain Layout
16754 \change_inserted -712698321 1355144715
16755 This will be output as is after all LaTeX
16756 \begin_inset Flex Code
16759 \begin_layout Plain Layout
16761 \change_inserted -712698321 1355144713
16770 This parameter cannot be changed from within LyX
16771 \change_inserted -712698321 1355144775
16773 \begin_inset Flex Code
16776 \begin_layout Plain Layout
16778 \change_inserted -712698321 1355144747
16784 for customizable parameters)
16789 \begin_layout Description
16790 \begin_inset Flex Code
16793 \begin_layout Plain Layout
16800 \begin_inset Flex Code
16803 \begin_layout Plain Layout
16805 \change_deleted -712698321 1353867544
16812 Command, Environment,
16813 \change_inserted -712698321 1353867573
16815 \change_deleted -712698321 1353867557
16824 \begin_inset Flex Code
16827 \begin_layout Plain Layout
16829 \change_deleted -712698321 1353867564
16833 \change_deleted -712698321 1353867569
16841 ] How the style should be translated into LaTeX.
16845 \begin_layout Plain Layout
16846 \begin_inset Flex Code
16849 \begin_layout Plain Layout
16855 is perhaps a bit misleading, since these rules apply to SGML classes, too.
16856 Visit the SGML class files for specific examples.
16865 \begin_layout Itemize
16866 \begin_inset Flex Code
16869 \begin_layout Plain Layout
16871 \change_deleted -712698321 1353867582
16873 \change_inserted -712698321 1353867583
16881 means nothing special.
16885 \begin_layout Itemize
16886 \begin_inset Flex Code
16889 \begin_layout Plain Layout
16896 \begin_inset Flex Code
16899 \begin_layout Plain Layout
16906 {\SpecialChar \ldots{}
16915 \begin_layout Itemize
16916 \begin_inset Flex Code
16919 \begin_layout Plain Layout
16926 \begin_inset Flex Code
16929 \begin_layout Plain Layout
16936 }\SpecialChar \ldots{}
16952 \begin_layout Itemize
16954 \change_deleted -712698321 1353867600
16955 \begin_inset Flex Code
16958 \begin_layout Plain Layout
16965 \begin_inset Flex Code
16968 \begin_layout Plain Layout
16975 \begin_inset Flex Code
16978 \begin_layout Plain Layout
16986 is generated for each paragraph of this environment.
16990 \begin_layout Itemize
16992 \change_deleted -712698321 1353867600
16993 \begin_inset Flex Code
16996 \begin_layout Plain Layout
17003 \begin_inset Flex Code
17006 \begin_layout Plain Layout
17013 \begin_inset Flex Code
17016 \begin_layout Plain Layout
17022 is passed as an argument to the environment.
17024 \begin_inset Flex Code
17027 \begin_layout Plain Layout
17033 can be defined in the
17034 \begin_inset Flex MenuItem
17037 \begin_layout Plain Layout
17042 \SpecialChar \menuseparator
17048 \begin_inset space ~
17062 \begin_layout Standard
17063 Putting the last few things together, the LaTeX output will be either:
17066 \begin_layout LyX-Code
17069 latexname[latexparam]{\SpecialChar \ldots{}
17073 \begin_layout Standard
17077 \begin_layout LyX-Code
17080 begin{latexname}[latexparam] \SpecialChar \ldots{}
17086 \begin_layout Standard
17087 depending upon the LaTeX type.
17091 \begin_layout Description
17093 \change_inserted -712698321 1354263128
17094 \begin_inset Flex Code
17097 \begin_layout Plain Layout
17099 \change_inserted -712698321 1353866742
17108 \begin_inset Flex Code
17111 \begin_layout Plain Layout
17113 \change_inserted -712698321 1353866752
17119 ] A string that is put at the beginning of the layout content.
17120 A line break in the output can be indicated by
17121 \begin_inset Flex Code
17124 \begin_layout Plain Layout
17126 \change_inserted -712698321 1354263128
17137 \begin_layout Description
17138 \begin_inset Flex Code
17141 \begin_layout Plain Layout
17148 \begin_inset Flex Code
17151 \begin_layout Plain Layout
17158 \begin_inset Flex Code
17161 \begin_layout Plain Layout
17168 \begin_inset Flex Code
17171 \begin_layout Plain Layout
17178 \begin_inset Flex Code
17181 \begin_layout Plain Layout
17187 (indicating a dummy definition ending definitions of charstyles, etc).
17188 This entry is required in and is only meaningful for Flex insets.
17189 Among other things, it determines on which menu this inset will appear.
17191 \begin_inset Flex Code
17194 \begin_layout Plain Layout
17201 \begin_inset Flex Code
17204 \begin_layout Plain Layout
17211 \begin_inset Flex Code
17214 \begin_layout Plain Layout
17222 \begin_inset Flex Code
17225 \begin_layout Plain Layout
17231 can be set to true for charstyle insets, if you wish, by setting it
17236 \begin_inset Flex Code
17239 \begin_layout Plain Layout
17248 \begin_layout Description
17249 \begin_inset Flex Code
17252 \begin_layout Plain Layout
17259 \begin_inset Flex Code
17262 \begin_layout Plain Layout
17271 \begin_inset Flex Code
17274 \begin_layout Plain Layout
17280 ] Whether multiple paragraphs are permitted in this inset.
17282 \begin_inset Flex Code
17285 \begin_layout Plain Layout
17291 to the same value and
17292 \begin_inset Flex Code
17295 \begin_layout Plain Layout
17301 to the opposite value.
17302 These can be reset to other values, if they are used
17307 \begin_inset Flex Code
17310 \begin_layout Plain Layout
17320 \begin_layout Description
17321 \begin_inset Flex Code
17324 \begin_layout Plain Layout
17331 \begin_inset Flex Code
17334 \begin_layout Plain Layout
17343 \begin_inset Flex Code
17346 \begin_layout Plain Layout
17352 ] Whether fragile commands in this inset should be
17353 \begin_inset Flex Code
17356 \begin_layout Plain Layout
17369 whether the command should itself be protected.) Default is false.
17372 \begin_layout Description
17373 \begin_inset Flex Code
17376 \begin_layout Plain Layout
17383 \begin_inset Flex Code
17386 \begin_layout Plain Layout
17395 \begin_inset Flex Code
17398 \begin_layout Plain Layout
17404 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
17405 output, but only by a line break; together with
17406 \begin_inset Flex Code
17409 \begin_layout Plain Layout
17415 , this allows to emulate a plain text editor (like the ERT inset).
17419 \begin_layout Description
17420 \begin_inset Flex Code
17423 \begin_layout Plain Layout
17430 \begin_inset Flex Code
17433 \begin_layout Plain Layout
17442 \begin_inset Flex Code
17445 \begin_layout Plain Layout
17451 ] Whether the contents of this paragraph should be output in raw form, meaning
17452 without special translations that LaTeX would require.
17455 \begin_layout Description
17456 \begin_inset Flex Code
17459 \begin_layout Plain Layout
17465 Information to be included in the LaTeX preamble when this style is used.
17466 Used to define macros, load packages, etc., required by this particular
17469 \begin_inset Quotes eld
17473 \begin_inset Flex Code
17476 \begin_layout Plain Layout
17483 \begin_inset Quotes erd
17489 \begin_layout Description
17490 \begin_inset Flex Code
17493 \begin_layout Plain Layout
17500 \begin_inset Flex Code
17503 \begin_layout Plain Layout
17509 ] The prefix to use when creating labels referring to insets of this type.
17510 This allows the use of formatted references.
17513 \begin_layout Description
17514 \begin_inset Flex Code
17517 \begin_layout Plain Layout
17524 \begin_inset Flex Code
17527 \begin_layout Plain Layout
17533 ] Whether the style requires the feature
17534 \begin_inset Flex Code
17537 \begin_layout Plain Layout
17544 See the description of
17545 \begin_inset Flex Code
17548 \begin_layout Plain Layout
17555 \begin_inset CommandInset ref
17556 LatexCommand pageref
17557 reference "des:FreeSpacing"
17561 ) for information on `features'.
17562 \change_inserted -712698321 1354439699
17566 \begin_layout Description
17568 \change_inserted -712698321 1354439705
17569 \begin_inset Flex Code
17572 \begin_layout Plain Layout
17574 \change_inserted -712698321 1354439699
17581 \begin_inset Flex Code
17584 \begin_layout Plain Layout
17586 \change_inserted -712698321 1354439699
17595 \begin_inset Flex Code
17598 \begin_layout Plain Layout
17600 \change_inserted -712698321 1354439699
17606 ] Resets the LaTeX arguments of this layout (as defined via the
17607 \begin_inset Flex Code
17610 \begin_layout Plain Layout
17612 \change_inserted -712698321 1354439699
17619 This is useful if you have copied a style via
17620 \begin_inset Flex Code
17623 \begin_layout Plain Layout
17625 \change_inserted -712698321 1354439699
17631 , but you do not want to inherit its (required and optional) arguments.
17633 \change_deleted -712698321 1354439698
17639 \begin_layout Description
17640 \begin_inset Flex Code
17643 \begin_layout Plain Layout
17650 \begin_inset Flex Code
17653 \begin_layout Plain Layout
17660 \begin_inset Flex Code
17663 \begin_layout Plain Layout
17671 ] Whether this inset should use the font of its surrounding environment
17673 Default is true: uses its own.
17674 \change_inserted -712698321 1353866806
17678 \begin_layout Description
17680 \change_inserted -712698321 1354263134
17681 \begin_inset Flex Code
17684 \begin_layout Plain Layout
17686 \change_inserted -712698321 1353866810
17693 \begin_inset Flex Code
17696 \begin_layout Plain Layout
17698 \change_inserted -712698321 1353866806
17704 ] A string that is put at the end of the layout content.
17705 A line break in the output can be indicated by
17706 \begin_inset Flex Code
17709 \begin_layout Plain Layout
17711 \change_inserted -712698321 1354263134
17722 \begin_layout Description
17723 \begin_inset Flex Code
17726 \begin_layout Plain Layout
17733 \begin_inset Flex Code
17736 \begin_layout Plain Layout
17743 \begin_inset Flex Code
17746 \begin_layout Plain Layout
17754 ] Spellcheck the contents of this inset.
17758 \begin_layout Subsection
17760 \begin_inset CommandInset label
17762 name "sub:Counters"
17769 \begin_layout Standard
17770 Since version 1.3.0 of LyX, it is both possible and necessary to define the
17772 \begin_inset Flex MenuItem
17775 \begin_layout Plain Layout
17782 \begin_inset Flex MenuItem
17785 \begin_layout Plain Layout
17791 , \SpecialChar \ldots{}
17792 ) in the text class itself.
17793 The standard counters are defined in the file
17794 \begin_inset Flex Code
17797 \begin_layout Plain Layout
17803 , so you may have to do no more than add
17806 \begin_layout LyX-Code
17807 Input stdcounters.inc
17810 \begin_layout Standard
17811 to your layout file to get them to work.
17812 But if you want to define custom counters, then you can do so.
17813 The counter declaration must begin with:
17816 \begin_layout LyX-Code
17817 Counter CounterName
17820 \begin_layout Standard
17822 \begin_inset Flex Code
17825 \begin_layout Plain Layout
17831 ' is replaced by the name of the counter.
17832 And it must end with
17833 \begin_inset Quotes eld
17837 \begin_inset Flex Code
17840 \begin_layout Plain Layout
17847 \begin_inset Quotes erd
17851 The following parameters can also be used:
17854 \begin_layout Description
17855 \begin_inset Flex Code
17858 \begin_layout Plain Layout
17865 \begin_inset Flex Code
17868 \begin_layout Plain Layout
17875 \begin_inset Quotes erd
17879 \begin_inset Quotes erd
17882 ] When defined, this string defines how the counter is displayed.
17883 Setting this value sets
17884 \begin_inset Flex Code
17887 \begin_layout Plain Layout
17888 LabelStringAppendix
17894 The following special constructs can be used in the string:
17898 \begin_layout Itemize
17899 \begin_inset Flex Code
17902 \begin_layout Plain Layout
17910 will be replaced by the expansion of the
17911 \begin_inset Flex Code
17914 \begin_layout Plain Layout
17921 \begin_inset Flex Code
17924 \begin_layout Plain Layout
17925 LabelStringAppendix
17931 \begin_inset Flex Code
17934 \begin_layout Plain Layout
17944 \begin_layout Itemize
17945 counter values can be expressed using LaTeX-like macros
17946 \begin_inset Flex Code
17949 \begin_layout Plain Layout
17966 \begin_inset Flex Code
17969 \begin_layout Plain Layout
17981 \begin_layout Plain Layout
17991 Actually, the situation is a bit more complicated: any
18010 other than those described below will produce arabic numerals.
18011 It would not be surprising to see this change in the future.
18017 \begin_inset Flex Code
18020 \begin_layout Plain Layout
18026 : 1, 2, 3,\SpecialChar \ldots{}
18028 \begin_inset Flex Code
18031 \begin_layout Plain Layout
18037 for lower-case letters: a, b, c, \SpecialChar \ldots{}
18039 \begin_inset Flex Code
18042 \begin_layout Plain Layout
18048 for upper-case letters: A, B, C, \SpecialChar \ldots{}
18050 \begin_inset Flex Code
18053 \begin_layout Plain Layout
18059 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
18061 \begin_inset Flex Code
18064 \begin_layout Plain Layout
18070 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
18072 \begin_inset Flex Code
18075 \begin_layout Plain Layout
18081 for hebrew numerals.
18085 \begin_layout Standard
18086 If LabelString is not defined, a default value is constructed as follows:
18087 if the counter has a master counter
18088 \begin_inset Flex Code
18091 \begin_layout Plain Layout
18098 \begin_inset Flex Code
18101 \begin_layout Plain Layout
18108 \begin_inset Flex Code
18111 \begin_layout Plain Layout
18121 is used; otherwise the string
18122 \begin_inset Flex Code
18125 \begin_layout Plain Layout
18136 \begin_layout Description
18137 \begin_inset Flex Code
18140 \begin_layout Plain Layout
18141 LabelStringAppendix
18147 \begin_inset Flex Code
18150 \begin_layout Plain Layout
18157 \begin_inset Quotes erd
18161 \begin_inset Quotes erd
18165 \begin_inset Flex Code
18168 \begin_layout Plain Layout
18174 , but for use in the Appendix.
18177 \begin_layout Description
18178 \begin_inset Flex Code
18181 \begin_layout Plain Layout
18188 \begin_inset Flex Code
18191 \begin_layout Plain Layout
18198 \begin_inset Quotes erd
18202 \begin_inset Quotes erd
18205 ] A format for use with formatted references to this counter.
18206 For example, one might want to have references to section numbers appear
18208 \begin_inset Quotes eld
18212 \begin_inset Quotes erd
18216 The string should contain
18217 \begin_inset Quotes eld
18221 \begin_inset Quotes erd
18225 This will be replaced by the counter number itself.
18226 So, for sections, it would be: Section ##.
18229 \begin_layout Description
18230 \begin_inset Flex Code
18233 \begin_layout Plain Layout
18240 \begin_inset Flex Code
18243 \begin_layout Plain Layout
18250 \begin_inset Quotes erd
18254 \begin_inset Quotes erd
18257 ] If this is set to the name of another counter, the present counter will
18258 be reset every time the other one is increased.
18260 \begin_inset Flex Code
18263 \begin_layout Plain Layout
18270 \begin_inset Flex Code
18273 \begin_layout Plain Layout
18282 \begin_layout Subsection
18284 \begin_inset CommandInset label
18286 name "sub:Font-description"
18293 \begin_layout Standard
18294 A font description looks like this:
18297 \begin_layout LyX-Code
18307 \begin_layout LyX-Code
18311 \begin_layout LyX-Code
18315 \begin_layout Standard
18316 The following commands are available:
18319 \begin_layout Description
18320 \begin_inset Flex Code
18323 \begin_layout Plain Layout
18330 \begin_inset Flex Code
18333 \begin_layout Plain Layout
18342 \begin_inset Flex Code
18345 \begin_layout Plain Layout
18352 \begin_inset Flex Code
18355 \begin_layout Plain Layout
18362 \begin_inset Flex Code
18365 \begin_layout Plain Layout
18372 \begin_inset Flex Code
18375 \begin_layout Plain Layout
18382 \begin_inset Flex Code
18385 \begin_layout Plain Layout
18392 \begin_inset Flex Code
18395 \begin_layout Plain Layout
18402 \begin_inset Flex Code
18405 \begin_layout Plain Layout
18412 \begin_inset Flex Code
18415 \begin_layout Plain Layout
18424 \begin_layout Description
18425 \begin_inset Flex Code
18428 \begin_layout Plain Layout
18435 \begin_inset Flex Code
18438 \begin_layout Plain Layout
18447 \begin_inset Flex Code
18450 \begin_layout Plain Layout
18457 \begin_inset Flex Code
18460 \begin_layout Plain Layout
18469 \begin_layout Description
18470 \begin_inset Flex Code
18473 \begin_layout Plain Layout
18480 \begin_inset Flex Code
18483 \begin_layout Plain Layout
18489 ] Valid arguments are:
18490 \begin_inset Flex Code
18493 \begin_layout Plain Layout
18500 \begin_inset Flex Code
18503 \begin_layout Plain Layout
18510 \begin_inset Flex Code
18513 \begin_layout Plain Layout
18520 \begin_inset Flex Code
18523 \begin_layout Plain Layout
18530 \begin_inset Flex Code
18533 \begin_layout Plain Layout
18540 \begin_inset Flex Code
18543 \begin_layout Plain Layout
18550 \begin_inset Flex Code
18553 \begin_layout Plain Layout
18560 \begin_inset Flex Code
18563 \begin_layout Plain Layout
18570 \begin_inset Flex Code
18573 \begin_layout Plain Layout
18580 \begin_inset Flex Code
18583 \begin_layout Plain Layout
18590 \begin_inset Flex Code
18593 \begin_layout Plain Layout
18600 \begin_inset Flex Code
18603 \begin_layout Plain Layout
18610 Each of these turns on or off the corresponding attribute.
18612 \begin_inset Flex Code
18615 \begin_layout Plain Layout
18621 turns on emphasis, and
18622 \begin_inset Flex Code
18625 \begin_layout Plain Layout
18633 \begin_inset Newline newline
18636 If the latter seems puzzling, remember that the font settings for the present
18637 context are generally inherited from the surrounding context.
18639 \begin_inset Flex Code
18642 \begin_layout Plain Layout
18648 would turn off the emphasis that was anyway in effect, say, in a theorem
18652 \begin_layout Description
18653 \begin_inset Flex Code
18656 \begin_layout Plain Layout
18663 \begin_inset Flex Code
18666 \begin_layout Plain Layout
18675 \begin_inset Flex Code
18678 \begin_layout Plain Layout
18687 \begin_layout Description
18688 \begin_inset Flex Code
18691 \begin_layout Plain Layout
18698 \begin_inset Flex Code
18701 \begin_layout Plain Layout
18710 \begin_inset Flex Code
18713 \begin_layout Plain Layout
18720 \begin_inset Flex Code
18723 \begin_layout Plain Layout
18730 \begin_inset Flex Code
18733 \begin_layout Plain Layout
18742 \begin_layout Description
18743 \begin_inset Flex Code
18746 \begin_layout Plain Layout
18753 \begin_inset Flex Code
18756 \begin_layout Plain Layout
18763 \begin_inset Flex Code
18766 \begin_layout Plain Layout
18773 \begin_inset Flex Code
18776 \begin_layout Plain Layout
18785 \begin_inset Flex Code
18788 \begin_layout Plain Layout
18795 \begin_inset Flex Code
18798 \begin_layout Plain Layout
18805 \begin_inset Flex Code
18808 \begin_layout Plain Layout
18815 \begin_inset Flex Code
18818 \begin_layout Plain Layout
18825 \begin_inset Flex Code
18828 \begin_layout Plain Layout
18837 \begin_layout Subsection
18838 \begin_inset CommandInset label
18840 name "sub:Citation-format-description"
18844 Citation format description
18847 \begin_layout Standard
18849 \begin_inset Flex Code
18852 \begin_layout Plain Layout
18858 blocks are used to describe how bibliographic information should be displayed,
18859 both within LyX itself (in the citation dialog and in tooltips, for example)
18860 and in XHTML output.
18861 Such a block might look like this:
18864 \begin_layout LyX-Code
18868 \begin_layout LyX-Code
18872 \begin_layout LyX-Code
18876 \begin_layout LyX-Code
18880 \begin_layout Standard
18881 The individual lines define how the bibliographic information associated
18882 with an article or book, respectively, is to be displayed, and such a definitio
18883 n can be given for any `entry type' that might be present in a BibTeX file.
18884 LyX defines a default format in the source code that will be used if no
18885 specific definition has been given.
18886 LyX predefines several formats in the file
18887 \begin_inset Flex Code
18890 \begin_layout Plain Layout
18896 , which is included in most of LyX's document classes.
18899 \begin_layout Standard
18900 The definitions use a simple language that allows BibTeX keys to be replaced
18902 Keys should be enclosed in
18903 \begin_inset Flex Code
18906 \begin_layout Plain Layout
18913 \begin_inset Flex Code
18916 \begin_layout Plain Layout
18923 So a simple definition might look like this:
18926 \begin_layout LyX-Code
18928 \begin_inset Quotes eld
18932 \begin_inset Quotes erd
18938 \begin_layout Standard
18939 This would print the author, followed by a comma, followed by the title,
18940 in quotes, followed by a period.
18943 \begin_layout Standard
18944 Of course, sometimes you may want to print a key only if it exists.
18945 This can be done by using a conditional construction, such as:
18946 \begin_inset Flex Code
18949 \begin_layout Plain Layout
18951 \begin_inset space ~
18961 \begin_inset Flex Code
18964 \begin_layout Plain Layout
18970 key exists, then print
18971 \begin_inset Quotes eld
18975 \begin_inset space ~
18979 \begin_inset Quotes erd
18982 followed by the volume key.
18983 It is also possible to have an else clause in the conditional, such as:
18985 \begin_inset Flex Code
18988 \begin_layout Plain Layout
18989 {%author%[[%author%]][[%editor%, ed.]]}
18996 \begin_inset Flex Code
18999 \begin_layout Plain Layout
19005 key is printed if it exists; otherwise, the editor key is printed, followed
19007 \begin_inset Quotes eld
19011 \begin_inset space ~
19015 \begin_inset Quotes erd
19018 Note that the key is again enclosed in
19019 \begin_inset Flex Code
19022 \begin_layout Plain Layout
19028 signs; the entire conditional is enclosed in braces; and the if and else
19029 clauses are enclosed in double brackets,
19030 \begin_inset Quotes eld
19034 \begin_inset Flex Code
19037 \begin_layout Plain Layout
19044 \begin_inset Quotes eld
19048 \begin_inset Quotes eld
19052 \begin_inset Flex Code
19055 \begin_layout Plain Layout
19062 \begin_inset Quotes erd
19066 There must be no space between any of these.
19069 \begin_layout Standard
19070 There is one other piece of syntax available in definitions, which looks
19072 \begin_inset Flex Code
19075 \begin_layout Plain Layout
19082 This defines a piece of formatting information that is to be used when
19084 \begin_inset Quotes eld
19088 \begin_inset Quotes erd
19092 Obviously, we do not want to output HTML tags when writing plain text,
19093 so they should be wrapped in
19094 \begin_inset Quotes eld
19098 \begin_inset Quotes erd
19102 \begin_inset Quotes eld
19106 \begin_inset Quotes erd
19112 \begin_layout Standard
19113 Two special sorts of definitions are also possible in a
19114 \begin_inset Flex Code
19117 \begin_layout Plain Layout
19124 An example of the first would be:
19127 \begin_layout LyX-Code
19129 \begin_inset Quotes eld
19133 \begin_inset Quotes erd
19139 \begin_layout Standard
19140 This is an abbreviation, or macro, and it can be used by treating it as
19142 \begin_inset Flex Code
19145 \begin_layout Plain Layout
19153 \begin_inset Flex Code
19156 \begin_layout Plain Layout
19162 exactly as it would treat its definition.
19163 So, let us issue the obvious
19171 \begin_layout LyX-Code
19175 \begin_layout Standard
19176 or anything like it.
19177 LyX shouldn't go into an infinite loop, but it may go into a long one before
19181 \begin_layout Standard
19182 The second sort of special definition might look like this:
19185 \begin_layout LyX-Code
19189 \begin_layout Standard
19190 This defines a translatable piece of text, which allows relevant parts of
19191 the bibliography to be translated.
19192 It can be included in a definition by treating it as a key:
19193 \begin_inset Flex Code
19196 \begin_layout Plain Layout
19203 Several of these are predefined in
19204 \begin_inset Flex Code
19207 \begin_layout Plain Layout
19214 Note that these are not macros, in the sense just defined.
19215 They will not be expanded.
19218 \begin_layout Standard
19219 So here then is an example that use all these features:
19222 \begin_layout LyX-Code
19223 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
19226 \begin_layout Standard
19227 This defines a macro that prints the author, followed by a comma, if the
19229 \begin_inset Flex Code
19232 \begin_layout Plain Layout
19238 key is defined, or else prints the name of the editor, followed by the
19240 \begin_inset Flex Code
19243 \begin_layout Plain Layout
19249 or its translation (it is by default
19250 \begin_inset Quotes eld
19254 \begin_inset Quotes erd
19258 \begin_inset Flex Code
19261 \begin_layout Plain Layout
19268 Note that this is in fact defined in
19269 \begin_inset Flex Code
19272 \begin_layout Plain Layout
19278 , so you can use it in your own definitions, or re-definitions, if you load
19282 \begin_layout Section
19283 \begin_inset CommandInset label
19285 name "sec:Tags-for-XHTML"
19289 Tags for XHTML output
19292 \begin_layout Standard
19293 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
19294 by layout information.
19295 In general, LyX provides sensible defaults and, as mentioned earlier, it
19296 will even construct default CSS style rules from the other layout tags.
19297 For example, LyX will attempt to use the information provided in the
19298 \begin_inset Flex Code
19301 \begin_layout Plain Layout
19307 declaration for the Chapter style to write CSS that will appropriately
19308 format chapter headings.
19311 \begin_layout Standard
19312 In many cases, then, you may not have to do anything at all to get acceptable
19313 XHTML output for your own environments, custom insets, and so forth.
19314 But in some cases you will, and so LyX provides a number of layout tags
19315 that can be used to customize the XHTML and CSS that are generated.
19318 \begin_layout Standard
19319 Note that there are two tags,
19320 \begin_inset Flex Code
19323 \begin_layout Plain Layout
19330 \begin_inset Flex Code
19333 \begin_layout Plain Layout
19339 that may appear outside style and inset declarations.
19341 \begin_inset CommandInset ref
19343 reference "sub:General-text-class"
19347 for details on these.
19350 \begin_layout Subsection
19351 \begin_inset CommandInset label
19353 name "sub:Paragraph-Style-XHTML"
19360 \begin_layout Standard
19361 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
19362 dealing with a normal paragraph, a command, or an environment, where this
19363 is itself determined by the contents of the corresponding
19364 \begin_inset Flex Code
19367 \begin_layout Plain Layout
19377 \begin_layout Standard
19378 For a command or normal paragraph, the output XHTML has the following form:
19381 \begin_layout LyX-Code
19383 \begin_inset Quotes erd
19387 \begin_inset Quotes erd
19393 \begin_layout LyX-Code
19395 \begin_inset Quotes erd
19399 \begin_inset Quotes erd
19405 \begin_layout LyX-Code
19406 Contents of the paragraph.
19409 \begin_layout LyX-Code
19413 \begin_layout Standard
19414 The label tags are of course omitted if the paragraph does not have a label.
19417 \begin_layout Standard
19418 For an environment that is not some sort of list, the XHTML takes this form:
19421 \begin_layout LyX-Code
19423 \begin_inset Quotes erd
19427 \begin_inset Quotes erd
19433 \begin_layout LyX-Code
19435 \begin_inset Quotes erd
19439 \begin_inset Quotes erd
19443 \begin_inset Quotes erd
19447 \begin_inset Quotes erd
19450 >Environment Label</labeltag>First paragraph.</itemtag>
19453 \begin_layout LyX-Code
19454 <itemtag>Second paragraph.</itemtag>
19457 \begin_layout LyX-Code
19461 \begin_layout Standard
19462 Note that the label is output only for the first paragraph, as it should
19463 be for a theorem, for example.
19467 \begin_layout Standard
19468 For a list, we have one of these forms:
19471 \begin_layout LyX-Code
19473 \begin_inset Quotes erd
19477 \begin_inset Quotes erd
19483 \begin_layout LyX-Code
19485 \begin_inset Quotes erd
19489 \begin_inset Quotes erd
19493 \begin_inset Quotes erd
19497 \begin_inset Quotes erd
19500 >List Label</labeltag>First item.</itemtag>
19503 \begin_layout LyX-Code
19505 \begin_inset Quotes erd
19509 \begin_inset Quotes erd
19513 \begin_inset Quotes erd
19517 \begin_inset Quotes erd
19520 >List Label</labeltag>Second item.</itemtag>
19523 \begin_layout LyX-Code
19527 \begin_layout LyX-Code
19531 \begin_layout LyX-Code
19533 \begin_inset Quotes erd
19537 \begin_inset Quotes erd
19543 \begin_layout LyX-Code
19545 \begin_inset Quotes erd
19549 \begin_inset Quotes erd
19552 >List Label</labeltag><itemtag attr=
19553 \begin_inset Quotes erd
19557 \begin_inset Quotes erd
19560 >First item.</itemtag>
19563 \begin_layout LyX-Code
19565 \begin_inset Quotes erd
19569 \begin_inset Quotes erd
19572 >List Label</labeltag><itemtag attr=
19573 \begin_inset Quotes erd
19577 \begin_inset Quotes erd
19580 >Second item.</itemtag>
19583 \begin_layout LyX-Code
19587 \begin_layout Standard
19588 Note the different orders of
19589 \begin_inset Flex Code
19592 \begin_layout Plain Layout
19599 \begin_inset Flex Code
19602 \begin_layout Plain Layout
19609 Which order we get depends upon the setting of
19610 \begin_inset Flex Code
19613 \begin_layout Plain Layout
19620 \begin_inset Flex Code
19623 \begin_layout Plain Layout
19629 is false (the default), you get the first of these, with the label within
19630 the item; if true, you get the second, with the label outside the item.
19633 \begin_layout Standard
19634 The specific tags and attributes output for each paragraph type can be controlle
19635 d by means of the layout tags we are about to describe.
19636 As mentioned earlier, however, LyX uses sensible defaults for many of these,
19637 so you often may not need to do very much to get good XHTML output.
19638 Think of the available tags as there so you can tweak things to your liking.
19641 \begin_layout Description
19642 \begin_inset Flex Code
19645 \begin_layout Plain Layout
19652 \begin_inset Flex Code
19655 \begin_layout Plain Layout
19661 ] Specifies attribute information to be output with the main tag.
19663 \begin_inset Quotes eld
19667 \begin_inset Flex Code
19670 \begin_layout Plain Layout
19677 \begin_inset Quotes erd
19681 By default, LyX will output
19682 \begin_inset Quotes eld
19686 \begin_inset Flex Code
19689 \begin_layout Plain Layout
19696 \begin_inset Quotes erd
19700 \begin_inset Flex Code
19703 \begin_layout Plain Layout
19709 is the LyX name of the layout, made lowercase, for example: chapter.
19714 contain any style information.
19716 \begin_inset Flex Code
19719 \begin_layout Plain Layout
19728 \begin_layout Description
19729 \begin_inset Flex Code
19732 \begin_layout Plain Layout
19739 \begin_inset Flex Code
19742 \begin_layout Plain Layout
19752 ] Whether to output the default CSS information LyX generates for this layout,
19753 even if additional information is explicitly provided via
19754 \begin_inset Flex Code
19757 \begin_layout Plain Layout
19765 \begin_inset Flex Code
19768 \begin_layout Plain Layout
19774 allows you to alter or augment the generated CSS, rather than to override
19777 \begin_inset Flex Code
19780 \begin_layout Plain Layout
19789 \begin_layout Description
19790 \begin_inset Flex Code
19793 \begin_layout Plain Layout
19800 \begin_inset Flex Code
19803 \begin_layout Plain Layout
19809 ] The tag to be used for individual paragraphs of environments, replacing
19811 \begin_inset Flex Code
19814 \begin_layout Plain Layout
19820 in the examples above.
19822 \begin_inset Flex Code
19825 \begin_layout Plain Layout
19834 \begin_layout Description
19835 \begin_inset Flex Code
19838 \begin_layout Plain Layout
19845 \begin_inset Flex Code
19848 \begin_layout Plain Layout
19854 ] Attributes for the item tag.
19856 \begin_inset Quotes eld
19860 \begin_inset Flex Code
19863 \begin_layout Plain Layout
19864 class=`layoutname_item'
19870 \begin_inset Quotes erd
19878 contain any style information.
19880 \begin_inset Flex Code
19883 \begin_layout Plain Layout
19892 \begin_layout Description
19893 \begin_inset Flex Code
19896 \begin_layout Plain Layout
19903 \begin_inset Flex Code
19906 \begin_layout Plain Layout
19912 ] The tag to be used for paragraph and item labels, replacing
19913 \begin_inset Flex Code
19916 \begin_layout Plain Layout
19922 in the examples above.
19924 \begin_inset Flex Code
19927 \begin_layout Plain Layout
19934 \begin_inset Flex Code
19937 \begin_layout Plain Layout
19944 \begin_inset Flex Code
19947 \begin_layout Plain Layout
19954 \begin_inset Flex Code
19957 \begin_layout Plain Layout
19958 Centered_Top_Environment
19963 , in which case it defaults to
19964 \begin_inset Flex Code
19967 \begin_layout Plain Layout
19976 \begin_layout Description
19977 \begin_inset Flex Code
19980 \begin_layout Plain Layout
19987 \begin_inset Flex Code
19990 \begin_layout Plain Layout
19996 ] Attributes for the label tag.
19998 \begin_inset Quotes eld
20002 \begin_inset Flex Code
20005 \begin_layout Plain Layout
20006 class=`layoutname_label'
20012 \begin_inset Quotes erd
20020 contain any style information.
20022 \begin_inset Flex Code
20025 \begin_layout Plain Layout
20034 \begin_layout Description
20035 \begin_inset Flex Code
20038 \begin_layout Plain Layout
20045 \begin_inset Flex Code
20048 \begin_layout Plain Layout
20058 ] Meaningful only for list-like environments, this tag controls whether
20059 the label tag is output before or inside the item tag.
20060 This is used, for example, in the description environment, where we want
20062 \begin_inset Flex Code
20065 \begin_layout Plain Layout
20066 <dt>\SpecialChar \ldots{}
20067 </dt><dd>\SpecialChar \ldots{}
20075 \begin_inset Flex Code
20078 \begin_layout Plain Layout
20084 : The label tag is output inside the item tag.
20087 \begin_layout Description
20088 \begin_inset Flex Code
20091 \begin_layout Plain Layout
20097 Information to be output in the
20098 \begin_inset Flex Code
20101 \begin_layout Plain Layout
20107 section when this style is used.
20108 This might, for example, be used to include a
20109 \begin_inset Flex Code
20112 \begin_layout Plain Layout
20119 \begin_inset Flex Code
20122 \begin_layout Plain Layout
20131 \begin_layout Description
20132 \begin_inset Flex Code
20135 \begin_layout Plain Layout
20141 CSS style information to be included when this style is used.
20142 Note that this will automatically be wrapped in a layout-generated
20143 \begin_inset Flex Code
20146 \begin_layout Plain Layout
20152 block, so only the CSS itself need be included.
20155 \begin_layout Description
20156 \begin_inset Flex Code
20159 \begin_layout Plain Layout
20166 \begin_inset Flex Code
20169 \begin_layout Plain Layout
20175 ] The tag to be used for the main label, replacing
20176 \begin_inset Flex Code
20179 \begin_layout Plain Layout
20185 in the examples above.
20187 \begin_inset Flex Code
20190 \begin_layout Plain Layout
20199 \begin_layout Description
20200 \begin_inset Flex Code
20203 \begin_layout Plain Layout
20210 \begin_inset Flex Code
20213 \begin_layout Plain Layout
20223 ] Marks this style as the one to be used to generate the
20224 \begin_inset Flex Code
20227 \begin_layout Plain Layout
20233 tag for the XHTML file.
20234 By default, it is false.
20236 \begin_inset Flex Code
20239 \begin_layout Plain Layout
20245 file sets it to true for the
20246 \begin_inset Flex Code
20249 \begin_layout Plain Layout
20259 \begin_layout Subsection
20263 \begin_layout Standard
20264 The XHTML output of insets can also be controlled by information in layout
20269 \begin_layout Plain Layout
20270 At present, this is true only for
20271 \begin_inset Quotes eld
20275 \begin_inset Quotes erd
20278 insets (insets you can type into) and is not true for
20279 \begin_inset Quotes eld
20283 \begin_inset Quotes erd
20286 insets (insets that are associated with dialog boxes).
20291 Here, too, LyX tries to provide sensible defaults, and it constructs default
20293 But everything can be customized.
20296 \begin_layout Standard
20297 The XHTML LyX outputs for an inset has the following form:
20300 \begin_layout LyX-Code
20302 \begin_inset Quotes erd
20306 \begin_inset Quotes erd
20312 \begin_layout LyX-Code
20313 <labeltag>Label</labeltag>
20316 \begin_layout LyX-Code
20318 \begin_inset Quotes erd
20322 \begin_inset Quotes erd
20325 >Contents of the inset.</innertag>
20328 \begin_layout LyX-Code
20332 \begin_layout Standard
20333 If the inset permits multiple paragraphs---that is, if
20334 \begin_inset Flex Code
20337 \begin_layout Plain Layout
20343 is true---then the contents of the inset will itself be output as paragraphs
20344 formatted according to the styles used for those paragraphs (standard,
20345 quote, and the like).
20346 The label tag is of course omitted if the paragraph does not have a label
20347 and, at present, is always
20348 \begin_inset Flex Code
20351 \begin_layout Plain Layout
20358 The inner tag is optional and, by default, does not appear.
20361 \begin_layout Standard
20362 The specific tags and attributes output for each inset can be controlled
20363 by means of the following layout tags.
20366 \begin_layout Description
20367 \begin_inset Flex Code
20370 \begin_layout Plain Layout
20377 \begin_inset Flex Code
20380 \begin_layout Plain Layout
20386 ] Specifies attribute information to be output with the main tag.
20388 \begin_inset Quotes eld
20392 \begin_inset Flex Code
20395 \begin_layout Plain Layout
20396 class=`myinset' onclick=`\SpecialChar \ldots{}
20403 \begin_inset Quotes erd
20407 By default, LyX will output
20408 \begin_inset Quotes eld
20412 \begin_inset Flex Code
20415 \begin_layout Plain Layout
20422 \begin_inset Quotes erd
20426 \begin_inset Flex Code
20429 \begin_layout Plain Layout
20435 is the LyX name of the inset, made lowercase and with non-alphanumeric
20436 characters converted to underscores, for example: footnote.
20439 \begin_layout Description
20440 \begin_inset Flex Code
20443 \begin_layout Plain Layout
20450 \begin_inset Flex Code
20453 \begin_layout Plain Layout
20463 ] Whether to output the default CSS information LyX generates for this layout,
20464 even if additional information is explicitly provided via
20465 \begin_inset Flex Code
20468 \begin_layout Plain Layout
20476 \begin_inset Flex Code
20479 \begin_layout Plain Layout
20485 allows you to alter or augment the generated CSS, rather than to override
20490 \begin_layout Description
20491 \begin_inset Flex Code
20494 \begin_layout Plain Layout
20501 \begin_inset Flex Code
20504 \begin_layout Plain Layout
20510 ] Attributes for the inner tag.
20512 \begin_inset Quotes eld
20516 \begin_inset Flex Code
20519 \begin_layout Plain Layout
20520 class=`insetname_inner'
20526 \begin_inset Quotes erd
20532 \begin_layout Description
20533 \begin_inset Flex Code
20536 \begin_layout Plain Layout
20543 \begin_inset Flex Code
20546 \begin_layout Plain Layout
20552 ] The inner tag, replacing
20553 \begin_inset Flex Code
20556 \begin_layout Plain Layout
20562 in the examples above.
20563 By default, there is none.
20566 \begin_layout Description
20567 \begin_inset Flex Code
20570 \begin_layout Plain Layout
20577 \begin_inset Flex Code
20580 \begin_layout Plain Layout
20588 ] Whether this inset represents a standalone block of text (such as a footnote)
20589 or instead represents material that is included in the surrounding text
20590 (such as a branch).
20594 \begin_layout Description
20595 \begin_inset Flex Code
20598 \begin_layout Plain Layout
20605 \begin_inset Flex Code
20608 \begin_layout Plain Layout
20614 ] A label for this inset, possibly including a reference to a counter.
20615 For example, for footnote, it might be:
20616 \begin_inset Flex Code
20619 \begin_layout Plain Layout
20628 This is optional, and there is no default.
20631 \begin_layout Description
20632 \begin_inset Flex Code
20635 \begin_layout Plain Layout
20641 Information to be output in the
20642 \begin_inset Flex Code
20645 \begin_layout Plain Layout
20651 section when this style is used.
20652 This might, for example, be used to include a
20653 \begin_inset Flex Code
20656 \begin_layout Plain Layout
20663 \begin_inset Flex Code
20666 \begin_layout Plain Layout
20675 \begin_layout Description
20676 \begin_inset Flex Code
20679 \begin_layout Plain Layout
20685 CSS style information to be included when this style is used.
20686 Note that this will automatically be wrapped in a layout-generated
20687 \begin_inset Flex Code
20690 \begin_layout Plain Layout
20696 block, so only the CSS itself need be included.
20699 \begin_layout Description
20700 \begin_inset Flex Code
20703 \begin_layout Plain Layout
20710 \begin_inset Flex Code
20713 \begin_layout Plain Layout
20719 ] The tag to be used for the main label, replacing
20720 \begin_inset Flex Code
20723 \begin_layout Plain Layout
20729 in the examples above.
20730 The default depends upon the setting of
20731 \begin_inset Flex Code
20734 \begin_layout Plain Layout
20741 \begin_inset Flex Code
20744 \begin_layout Plain Layout
20750 is true, the default is
20751 \begin_inset Flex Code
20754 \begin_layout Plain Layout
20760 ; if it is false, the default is
20761 \begin_inset Flex Code
20764 \begin_layout Plain Layout
20773 \begin_layout Subsection
20777 \begin_layout Standard
20778 The XHTML output for floats too can be controlled by layout information.
20779 The output has the following form:
20782 \begin_layout LyX-Code
20784 \begin_inset Quotes erd
20788 \begin_inset Quotes erd
20794 \begin_layout LyX-Code
20795 Contents of the float.
20798 \begin_layout LyX-Code
20802 \begin_layout Standard
20803 The caption, if there is one, is a separate inset and will be output as
20805 Its appearance can be controlled via the InsetLayout for caption insets.
20809 \begin_layout Description
20810 \begin_inset Flex Code
20813 \begin_layout Plain Layout
20820 \begin_inset Flex Code
20823 \begin_layout Plain Layout
20829 ] Specifies attribute information to be output with the main tag.
20831 \begin_inset Quotes eld
20835 \begin_inset Flex Code
20838 \begin_layout Plain Layout
20839 class=`myfloat' onclick=`\SpecialChar \ldots{}
20846 \begin_inset Quotes erd
20850 By default, LyX will output
20851 \begin_inset Quotes eld
20855 \begin_inset Flex Code
20858 \begin_layout Plain Layout
20859 class=`float float-floattype'
20865 \begin_inset Quotes erd
20869 \begin_inset Flex Code
20872 \begin_layout Plain Layout
20878 is LyX's name for this type of float, as determined by the float declaration
20880 \begin_inset CommandInset ref
20882 reference "sub:Floats"
20886 ), though made lowercase and with non-alphanumeric characters converted
20887 to underscores, for example: float-table.
20890 \begin_layout Description
20891 \begin_inset Flex Code
20894 \begin_layout Plain Layout
20900 CSS style information to be included when this float is used.
20901 Note that this will automatically be wrapped in a layout-generated
20902 \begin_inset Flex Code
20905 \begin_layout Plain Layout
20911 block, so only the CSS itself need be included.
20914 \begin_layout Description
20915 \begin_inset Flex Code
20918 \begin_layout Plain Layout
20925 \begin_inset Flex Code
20928 \begin_layout Plain Layout
20934 ] The tag to be used for this float, replacing
20935 \begin_inset Quotes eld
20939 \begin_inset Flex Code
20942 \begin_layout Plain Layout
20949 \begin_inset Quotes erd
20952 in the example above.
20954 \begin_inset Flex Code
20957 \begin_layout Plain Layout
20963 and will rarely need changing.
20966 \begin_layout Subsection
20967 Bibliography formatting
20970 \begin_layout Standard
20971 The bibliography can be formatted using
20972 \begin_inset Flex Code
20975 \begin_layout Plain Layout
20983 \begin_inset CommandInset ref
20985 reference "sub:Citation-format-description"
20992 \begin_layout Subsection
20996 \begin_layout Standard
20997 We have several times mentioned that LyX will generate default CSS style
20998 rules for both insets and paragraph styles, based upon the other layout
20999 information that is provided.
21000 In this section, we shall say a word about which layout information LyX
21004 \begin_layout Standard
21005 At present, LyX auto-generates CSS only for font information, making use
21007 \begin_inset Flex Code
21010 \begin_layout Plain Layout
21017 \begin_inset Flex Code
21020 \begin_layout Plain Layout
21027 \begin_inset Flex Code
21030 \begin_layout Plain Layout
21037 \begin_inset Flex Code
21040 \begin_layout Plain Layout
21047 \begin_inset Flex Code
21050 \begin_layout Plain Layout
21058 \begin_inset CommandInset ref
21060 reference "sub:Font-description"
21064 .) The translation is mostly straightforward and obvious.
21066 \begin_inset Quotes eld
21070 \begin_inset Flex Code
21073 \begin_layout Plain Layout
21080 \begin_inset Quotes erd
21084 \begin_inset Quotes eld
21088 \begin_inset Flex Code
21091 \begin_layout Plain Layout
21092 font-family: sans-serif;
21098 \begin_inset Quotes erd
21102 The correspondence of LyX sizes and CSS sizes is a little less obvious
21103 but nonetheless intuitive.
21105 \begin_inset Flex Code
21108 \begin_layout Plain Layout
21115 \begin_inset Flex URL
21118 \begin_layout Plain Layout
21128 \begin_layout Chapter
21129 Including External Material
21132 \begin_layout Standard
21133 \begin_inset Box Shadowbox
21143 height_special "totalheight"
21146 \begin_layout Plain Layout
21147 WARNING: This portion of the documentation has not been updated for some
21149 We certainly hope that it is still accurate, but there are no guarantees.
21157 \begin_layout Standard
21158 The use of material from sources external to LyX is covered in detail in
21164 This part of the manual covers what needs to happen behind the scenes for
21165 new sorts of material to be included.
21168 \begin_layout Section
21172 \begin_layout Standard
21173 The external material feature is based on the concept of a
21178 A template is a specification of how LyX should interface with a certain
21180 As bundled, LyX comes with predefined templates for Xfig figures, various
21181 raster format images, chess diagrams, and LilyPond music notation.
21182 You can check the actual list by using the menu
21183 \begin_inset Flex MenuItem
21186 \begin_layout Plain Layout
21187 Insert\SpecialChar \menuseparator
21188 File\SpecialChar \menuseparator
21195 Furthermore, it is possible to roll your own template to support a specific
21197 Later we'll describe in more detail what is involved, and hopefully you
21198 will submit all the templates you create so we can include them in a later
21202 \begin_layout Standard
21203 Another basic idea of the external material feature is to distinguish between
21204 the original file that serves as a base for final material and the produced
21205 file that is included in your exported or printed document.
21206 For example, consider the case of a figure produced with
21207 \begin_inset Flex Code
21210 \begin_layout Plain Layout
21217 The Xfig application itself works on an original file with the
21218 \begin_inset Flex Code
21221 \begin_layout Plain Layout
21228 Within Xfig, you create and change your figure, and when you are done,
21230 \begin_inset Flex Code
21233 \begin_layout Plain Layout
21240 When you want to include the figure in your document, you invoke
21241 \begin_inset Flex Code
21244 \begin_layout Plain Layout
21250 in order to create a PostScript file that can readily be included in your
21253 \begin_inset Flex Code
21256 \begin_layout Plain Layout
21262 file is the original file, and the PostScript file is the produced file.
21265 \begin_layout Standard
21266 This distinction is important in order to allow updating of the material
21267 while you are in the process of writing the document.
21268 Furthermore, it provides us with the flexibility that is needed to support
21269 multiple export formats.
21270 For instance, in the case of a plain text file, it is not exactly an award-winn
21271 ing idea to include the figure as raw PostScript.
21272 Instead, you would either prefer to just include a reference to the figure
21273 or try to invoke some graphics to ASCII converter to make the final result
21274 look similar to the real graphics.
21275 The external material management allows you to do this, because it is parametri
21276 zed on the different export formats that LyX supports.
21279 \begin_layout Standard
21280 Besides supporting the production of different products according to the
21281 exported format, it supports tight integration with editing and viewing
21283 In the case of an Xfig figure, you are able to invoke Xfig on the original
21284 file with a single click from within the external material dialog in LyX,
21285 and also preview the produced PostScript file with Ghostview with another
21287 No more fiddling around with the command line and/or file browsers to locate
21288 and manipulate the original or produced files.
21289 In this way, you are finally able to take full advantage of the many different
21290 applications that are relevant to use when you write your documents, and
21291 ultimately be more productive.
21294 \begin_layout Section
21295 The external template configuration file
21298 \begin_layout Standard
21299 It is relatively easy to add custom external template definitions to LyX.
21300 However, be aware that doing this in an careless manner most probably
21304 introduce an easily exploitable security hole.
21305 So before you do this, please read the discussion about security in section
21307 \begin_inset CommandInset ref
21309 reference "sec:Security-discussion"
21316 \begin_layout Standard
21317 Having said that, we encourage you to submit any interesting templates that
21322 \begin_layout Standard
21323 The external templates are defined in the
21324 \begin_inset Flex Code
21327 \begin_layout Plain Layout
21328 LyXDir/lib/external_templates
21334 You can place your own version in
21335 \begin_inset Flex Code
21338 \begin_layout Plain Layout
21339 UserDir/external_templates
21347 \begin_layout Standard
21348 A typical template looks like this:
21351 \begin_layout LyX-Code
21355 \begin_layout LyX-Code
21356 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
21359 \begin_layout LyX-Code
21363 \begin_layout LyX-Code
21367 \begin_layout LyX-Code
21371 \begin_layout LyX-Code
21375 \begin_layout LyX-Code
21379 \begin_layout LyX-Code
21380 AutomaticProduction true
21383 \begin_layout LyX-Code
21387 \begin_layout LyX-Code
21391 \begin_layout LyX-Code
21395 \begin_layout LyX-Code
21396 TransformCommand Rotate RotationLatexCommand
21399 \begin_layout LyX-Code
21400 TransformCommand Resize ResizeLatexCommand
21403 \begin_layout LyX-Code
21404 Product "$$RotateFront$$ResizeFront
21407 \begin_layout LyX-Code
21412 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
21415 \begin_layout LyX-Code
21416 $$ResizeBack$$RotateBack"
21419 \begin_layout LyX-Code
21423 \begin_layout LyX-Code
21424 UpdateResult "$$AbsPath$$Basename.pstex_t"
21427 \begin_layout LyX-Code
21428 Requirement "graphicx"
21431 \begin_layout LyX-Code
21432 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
21435 \begin_layout LyX-Code
21436 ReferencedFile latex "$$AbsPath$$Basename.eps"
21439 \begin_layout LyX-Code
21440 ReferencedFile dvi "$$AbsPath$$Basename.eps"
21443 \begin_layout LyX-Code
21447 \begin_layout LyX-Code
21451 \begin_layout LyX-Code
21452 TransformCommand Rotate RotationLatexCommand
21455 \begin_layout LyX-Code
21456 TransformCommand Resize ResizeLatexCommand
21459 \begin_layout LyX-Code
21460 Product "$$RotateFront$$ResizeFront
21463 \begin_layout LyX-Code
21468 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
21471 \begin_layout LyX-Code
21472 $$ResizeBack$$RotateBack"
21475 \begin_layout LyX-Code
21476 UpdateFormat pdftex
21479 \begin_layout LyX-Code
21480 UpdateResult "$$AbsPath$$Basename.pdftex_t"
21483 \begin_layout LyX-Code
21484 Requirement "graphicx"
21487 \begin_layout LyX-Code
21488 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
21491 \begin_layout LyX-Code
21492 ReferencedFile latex "$$AbsPath$$Basename.pdf"
21495 \begin_layout LyX-Code
21499 \begin_layout LyX-Code
21503 \begin_layout LyX-Code
21504 Product "$$Contents(
21506 "$$AbsPath$$Basename.asc
21511 \begin_layout LyX-Code
21512 UpdateFormat asciixfig
21515 \begin_layout LyX-Code
21516 UpdateResult "$$AbsPath$$Basename.asc"
21519 \begin_layout LyX-Code
21523 \begin_layout LyX-Code
21527 \begin_layout LyX-Code
21528 Product "<graphic fileref=
21530 "$$AbsOrRelPathMaster$$Basename.eps
21535 \begin_layout LyX-Code
21539 \begin_layout LyX-Code
21543 \begin_layout LyX-Code
21544 UpdateResult "$$AbsPath$$Basename.eps"
21547 \begin_layout LyX-Code
21548 ReferencedFile docbook "$$AbsPath$$Basename.eps"
21551 \begin_layout LyX-Code
21552 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
21555 \begin_layout LyX-Code
21559 \begin_layout LyX-Code
21560 Product "[XFig: $$FName]"
21563 \begin_layout LyX-Code
21567 \begin_layout LyX-Code
21571 \begin_layout Standard
21572 As you can see, the template is enclosed in
21573 \begin_inset Flex Code
21576 \begin_layout Plain Layout
21582 \SpecialChar \ldots{}
21584 \begin_inset Flex Code
21587 \begin_layout Plain Layout
21594 It contains a header specifying some general settings and, for each supported
21595 primary document file format, a section
21596 \begin_inset Flex Code
21599 \begin_layout Plain Layout
21605 \SpecialChar \ldots{}
21607 \begin_inset Flex Code
21610 \begin_layout Plain Layout
21619 \begin_layout Subsection
21620 The template header
21623 \begin_layout Description
21624 \begin_inset Flex Code
21627 \begin_layout Plain Layout
21628 AutomaticProduction
21629 \begin_inset space ~
21637 Whether the file represented by the template must be generated by LyX.
21638 This command must occur exactly once.
21641 \begin_layout Description
21642 \begin_inset Flex Code
21645 \begin_layout Plain Layout
21647 \begin_inset space ~
21655 A glob pattern that is used in the file dialog to filter out the desired
21657 If there is more than one possible file extension (e.
21658 \begin_inset space \thinspace{}
21662 \begin_inset space \space{}
21666 \begin_inset Flex Code
21669 \begin_layout Plain Layout
21676 \begin_inset Flex Code
21679 \begin_layout Plain Layout
21685 ), use something like
21686 \begin_inset Flex Code
21689 \begin_layout Plain Layout
21696 This command must occur exactly once.
21699 \begin_layout Description
21700 \begin_inset Flex Code
21703 \begin_layout Plain Layout
21705 \begin_inset space ~
21713 The text that is displayed on the button.
21714 This command must occur exactly once.
21717 \begin_layout Description
21718 \begin_inset Flex Code
21721 \begin_layout Plain Layout
21723 \begin_inset space ~
21727 \begin_inset space ~
21735 The help text that is used in the External dialog.
21736 Provide enough information to explain to the user just what the template
21737 can provide him with.
21738 This command must occur exactly once.
21741 \begin_layout Description
21742 \begin_inset Flex Code
21745 \begin_layout Plain Layout
21747 \begin_inset space ~
21755 The file format of the original file.
21756 This must be the name of a format that is known to LyX (see section
21757 \begin_inset space ~
21761 \begin_inset CommandInset ref
21763 reference "sec:Formats"
21769 \begin_inset Quotes eld
21773 \begin_inset Flex Code
21776 \begin_layout Plain Layout
21783 \begin_inset Quotes erd
21786 if the template can handle original files of more than one format.
21787 LyX will attempt to interrogate the file itself in order to deduce its
21788 format in this case.
21789 This command must occur exactly once.
21792 \begin_layout Description
21793 \begin_inset Flex Code
21796 \begin_layout Plain Layout
21798 \begin_inset space ~
21806 A unique name for the template.
21807 It must not contain substitution macros (see below).
21810 \begin_layout Description
21811 \begin_inset Flex Code
21814 \begin_layout Plain Layout
21816 \begin_inset space ~
21819 Rotate|Resize|Clip|Extra
21824 This command specifies which transformations are supported by this template.
21825 It may occur zero or more times.
21826 This command enables the corresponding tabs in the external dialog.
21828 \begin_inset Flex Code
21831 \begin_layout Plain Layout
21837 command must have either a corresponding
21838 \begin_inset Flex Code
21841 \begin_layout Plain Layout
21848 \begin_inset Flex Code
21851 \begin_layout Plain Layout
21858 \begin_inset Flex Code
21861 \begin_layout Plain Layout
21868 Otherwise the transformation will not be supported by that format.
21871 \begin_layout Subsection
21875 \begin_layout Description
21876 \begin_inset Flex Code
21879 \begin_layout Plain Layout
21881 \begin_inset space ~
21884 LaTeX|PDFLaTeX|PlainText|DocBook
21889 The primary document file format that this format definition is for.
21890 Not every template has a sensible representation in all document file formats.
21891 Please define nevertheless a
21892 \begin_inset Flex Code
21895 \begin_layout Plain Layout
21901 section for all templates.
21902 Use a dummy text when no representation is available.
21903 Then you can at least see a reference to the external material in the exported
21907 \begin_layout Description
21908 \begin_inset Flex Code
21911 \begin_layout Plain Layout
21913 \begin_inset space ~
21917 \begin_inset space ~
21925 This command defines an additional macro
21926 \begin_inset Flex Code
21929 \begin_layout Plain Layout
21935 for substitution in
21936 \begin_inset Flex Code
21939 \begin_layout Plain Layout
21947 \begin_inset Flex Code
21950 \begin_layout Plain Layout
21956 itself may contain substitution macros.
21957 The advantage over using
21958 \begin_inset Flex Code
21961 \begin_layout Plain Layout
21968 \begin_inset Flex Code
21971 \begin_layout Plain Layout
21977 is that the substituted value of
21978 \begin_inset Flex Code
21981 \begin_layout Plain Layout
21987 is sanitized so that it is a valid optional argument in the document format.
21988 This command may occur zero or more times.
21991 \begin_layout Description
21992 \begin_inset Flex Code
21995 \begin_layout Plain Layout
21997 \begin_inset space ~
22005 The text that is inserted in the exported document.
22006 This is actually the most important command and can be quite complex.
22007 This command must occur exactly once.
22010 \begin_layout Description
22011 \begin_inset Flex Code
22014 \begin_layout Plain Layout
22016 \begin_inset space ~
22024 This command specifies a preamble snippet that will be included in the
22026 It has to be defined using
22027 \begin_inset Flex Code
22030 \begin_layout Plain Layout
22036 \SpecialChar \ldots{}
22038 \begin_inset Flex Code
22041 \begin_layout Plain Layout
22048 This command may occur zero or more times.
22051 \begin_layout Description
22052 \begin_inset Flex Code
22055 \begin_layout Plain Layout
22057 \begin_inset space ~
22061 \begin_inset space ~
22069 This command denotes files that are created by the conversion process and
22070 are needed for a particular export format.
22071 If the filename is relative, it is interpreted relative to the master document.
22072 This command may be given zero or more times.
22075 \begin_layout Description
22076 \begin_inset Flex Code
22079 \begin_layout Plain Layout
22081 \begin_inset space ~
22089 The name of a required LaTeX package.
22090 The package is included via
22091 \begin_inset Flex Code
22094 \begin_layout Plain Layout
22102 in the LaTeX preamble.
22103 This command may occur zero or more times.
22106 \begin_layout Description
22107 \begin_inset Flex Code
22110 \begin_layout Plain Layout
22112 \begin_inset space ~
22116 \begin_inset space ~
22119 RotationLatexCommand
22124 This command specifies that the built in LaTeX command should be used for
22126 This command may occur once or not at all.
22129 \begin_layout Description
22130 \begin_inset Flex Code
22133 \begin_layout Plain Layout
22135 \begin_inset space ~
22139 \begin_inset space ~
22147 This command specifies that the built in LaTeX command should be used for
22149 This command may occur once or not at all.
22152 \begin_layout Description
22153 \begin_inset Flex Code
22156 \begin_layout Plain Layout
22158 \begin_inset space ~
22162 \begin_inset space ~
22165 RotationLatexOption
22170 This command specifies that rotation is done via an optional argument.
22171 This command may occur once or not at all.
22174 \begin_layout Description
22175 \begin_inset Flex Code
22178 \begin_layout Plain Layout
22180 \begin_inset space ~
22184 \begin_inset space ~
22192 This command specifies that resizing is done via an optional argument.
22193 This command may occur once or not at all.
22196 \begin_layout Description
22197 \begin_inset Flex Code
22200 \begin_layout Plain Layout
22202 \begin_inset space ~
22206 \begin_inset space ~
22214 This command specifies that clipping is done via an optional argument.
22215 This command may occur once or not at all.
22218 \begin_layout Description
22219 \begin_inset Flex Code
22222 \begin_layout Plain Layout
22224 \begin_inset space ~
22228 \begin_inset space ~
22236 This command specifies that an extra optional argument is used.
22237 This command may occur once or not at all.
22240 \begin_layout Description
22241 \begin_inset Flex Code
22244 \begin_layout Plain Layout
22246 \begin_inset space ~
22254 The file format of the converted file.
22255 This must be the name of a format that is known to LyX (see the
22256 \begin_inset Flex MenuItem
22259 \begin_layout Plain Layout
22264 ools\SpecialChar \menuseparator
22269 references\SpecialChar \menuseparator
22270 File Handling\SpecialChar \menuseparator
22277 This command must occur exactly once.
22280 \begin_layout Description
22281 \begin_inset Flex Code
22284 \begin_layout Plain Layout
22286 \begin_inset space ~
22294 The file name of the converted file.
22295 The file name must be absolute.
22296 This command must occur exactly once.
22299 \begin_layout Subsection
22300 Preamble definitions
22303 \begin_layout Standard
22304 The external template configuration file may contain additional preamble
22305 definitions enclosed by
22306 \begin_inset Flex Code
22309 \begin_layout Plain Layout
22315 \SpecialChar \ldots{}
22317 \begin_inset Flex Code
22320 \begin_layout Plain Layout
22327 They can be used by the templates in the
22328 \begin_inset Flex Code
22331 \begin_layout Plain Layout
22340 \begin_layout Section
22341 The substitution mechanism
22344 \begin_layout Standard
22345 When the external material facility invokes an external program, it is done
22346 on the basis of a command defined in the template configuration file.
22347 These commands can contain various macros that are expanded before execution.
22348 Execution always take place in the directory of the containing document.
22351 \begin_layout Standard
22352 Also, whenever external material is to be displayed, the name will be produced
22353 by the substitution mechanism, and most other commands in the template
22354 definition support substitution as well.
22357 \begin_layout Standard
22358 The available macros are the following:
22361 \begin_layout Description
22362 \begin_inset Flex Code
22365 \begin_layout Plain Layout
22366 $$AbsOrRelPathMaster
22371 The file path, absolute or relative to the master LyX document.
22374 \begin_layout Description
22375 \begin_inset Flex Code
22378 \begin_layout Plain Layout
22379 $$AbsOrRelPathParent
22384 The file path, absolute or relative to the LyX document.
22387 \begin_layout Description
22388 \begin_inset Flex Code
22391 \begin_layout Plain Layout
22397 The absolute file path.
22400 \begin_layout Description
22401 \begin_inset Flex Code
22404 \begin_layout Plain Layout
22410 The filename without path and without the extension.
22413 \begin_layout Description
22414 \begin_inset Flex Code
22417 \begin_layout Plain Layout
22419 \begin_inset Quotes eld
22423 \begin_inset Quotes erd
22431 This macro will expand to the contents of the file with the name
22432 \begin_inset Flex Code
22435 \begin_layout Plain Layout
22444 \begin_layout Description
22445 \begin_inset Flex Code
22448 \begin_layout Plain Layout
22454 The file extension (including the dot).
22457 \begin_layout Description
22458 \begin_inset Flex Code
22461 \begin_layout Plain Layout
22467 The filename of the file specified in the external material dialog.
22468 This is either an absolute name, or it is relative to the LyX document.
22471 \begin_layout Description
22472 \begin_inset Flex Code
22475 \begin_layout Plain Layout
22482 \begin_inset Flex Code
22485 \begin_layout Plain Layout
22491 (absolute name or relative to the LyX document).
22494 \begin_layout Description
22495 \begin_inset Flex Code
22498 \begin_layout Plain Layout
22504 The file path, relative to the master LyX document.
22507 \begin_layout Description
22508 \begin_inset Flex Code
22511 \begin_layout Plain Layout
22517 The file path, relative to the LyX document.
22520 \begin_layout Description
22521 \begin_inset Flex Code
22524 \begin_layout Plain Layout
22530 This macro will expand to the absolute path of the system directory.
22531 This is typically used to point to the various helper scripts that are
22535 \begin_layout Description
22536 \begin_inset Flex Code
22539 \begin_layout Plain Layout
22545 A name and full path to a temporary file which will be automatically deleted
22546 whenever the containing document is closed, or the external material insertion
22550 \begin_layout Standard
22551 All path macros contain a trailing directory separator, so you can construct
22553 \begin_inset space \thinspace{}
22557 \begin_inset space \space{}
22560 the absolute filename with
22561 \begin_inset Flex Code
22564 \begin_layout Plain Layout
22565 $$AbsPath$$Basename$$Extension
22573 \begin_layout Standard
22574 The macros above are substituted in all commands unless otherwise noted.
22576 \begin_inset Flex Code
22579 \begin_layout Plain Layout
22585 supports additionally the following substitutions if they are enabled by
22587 \begin_inset Flex Code
22590 \begin_layout Plain Layout
22597 \begin_inset Flex Code
22600 \begin_layout Plain Layout
22609 \begin_layout Description
22610 \begin_inset Flex Code
22613 \begin_layout Plain Layout
22619 The front part of the resize command.
22622 \begin_layout Description
22623 \begin_inset Flex Code
22626 \begin_layout Plain Layout
22632 The back part of the resize command.
22635 \begin_layout Description
22636 \begin_inset Flex Code
22639 \begin_layout Plain Layout
22645 The front part of the rotation command.
22648 \begin_layout Description
22649 \begin_inset Flex Code
22652 \begin_layout Plain Layout
22658 The back part of the rotation command.
22661 \begin_layout Standard
22662 The value string of the
22663 \begin_inset Flex Code
22666 \begin_layout Plain Layout
22672 command supports additionally the following substitutions if they are enabled
22674 \begin_inset Flex Code
22677 \begin_layout Plain Layout
22684 \begin_inset Flex Code
22687 \begin_layout Plain Layout
22696 \begin_layout Description
22697 \begin_inset Flex Code
22700 \begin_layout Plain Layout
22709 \begin_layout Description
22710 \begin_inset Flex Code
22713 \begin_layout Plain Layout
22722 \begin_layout Description
22723 \begin_inset Flex Code
22726 \begin_layout Plain Layout
22735 \begin_layout Description
22736 \begin_inset Flex Code
22739 \begin_layout Plain Layout
22745 The rotation option.
22748 \begin_layout Standard
22749 You may ask why there are so many path macros.
22750 There are mainly two reasons:
22753 \begin_layout Enumerate
22754 Relative and absolute file names should remain relative or absolute, respectivel
22756 Users may have reasons to prefer either form.
22757 Relative names are useful for portable documents that should work on different
22758 machines, for example.
22759 Absolute names may be required by some programs.
22762 \begin_layout Enumerate
22763 LaTeX treats relative file names differently than LyX and other programs
22764 in nested included files.
22765 For LyX, a relative file name is always relative to the document that contains
22767 For LaTeX, it is always relative to the master document.
22768 These two definitions are identical if you have only one document, but
22769 differ if you have a master document that includes part documents.
22770 That means that relative filenames must be transformed when presented to
22772 Fortunately LyX does this automatically for you if you choose the right
22776 \begin_layout Standard
22777 So which path macro should be used in new template definitions? The rule
22781 \begin_layout Itemize
22783 \begin_inset Flex Code
22786 \begin_layout Plain Layout
22792 if an absolute path is required.
22795 \begin_layout Itemize
22797 \begin_inset Flex Code
22800 \begin_layout Plain Layout
22801 $$AbsOrRelPathMaster
22806 if the substituted string is some kind of LaTeX input.
22809 \begin_layout Itemize
22811 \begin_inset Flex Code
22814 \begin_layout Plain Layout
22815 $$AbsOrRelPathParent
22820 in order to preserve the user's choice.
22823 \begin_layout Standard
22824 There are special cases where this rule does not work and e.
22825 \begin_inset space \thinspace{}
22829 \begin_inset space \space{}
22832 relative names are needed, but normally it will work just fine.
22833 One example for such a case is the command
22834 \begin_inset Flex Code
22837 \begin_layout Plain Layout
22838 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
22843 in the XFig template above: We can't use the absolute name because the
22845 \begin_inset Flex Code
22848 \begin_layout Plain Layout
22854 files needs the relative name in order to rewrite the file content.
22857 \begin_layout Section
22858 Security discussion
22859 \begin_inset CommandInset label
22861 name "sec:Security-discussion"
22868 \begin_layout Standard
22869 The external material feature interfaces with a lot of external programs
22870 and does so automatically, so we have to consider the security implications
22872 In particular, since you have the option of including your own filenames
22873 and/or parameter strings and those are expanded into a command, it seems
22874 that it would be possible to create a malicious document which executes
22875 arbitrary commands when a user views or prints the document.
22876 This is something we definitely want to avoid.
22879 \begin_layout Standard
22880 However, since the external program commands are specified in the template
22881 configuration file only, there are no security issues if LyX is properly
22882 configured with safe templates only.
22883 This is so because the external programs are invoked with the
22884 \begin_inset Flex Code
22887 \begin_layout Plain Layout
22893 -system call rather than the
22894 \begin_inset Flex Code
22897 \begin_layout Plain Layout
22903 system-call, so it's not possible to execute arbitrary commands from the
22904 filename or parameter section via the shell.
22907 \begin_layout Standard
22908 This also implies that you are restricted in what command strings you can
22909 use in the external material templates.
22910 In particular, pipes and redirection are not readily available.
22911 This has to be so if LyX should remain safe.
22912 If you want to use some of the shell features, you should write a safe
22913 script to do this in a controlled manner, and then invoke the script from
22914 the command string.
22918 \begin_layout Standard
22919 It is possible to design a template that interacts directly with the shell,
22920 but since this would allow a malicious user to execute arbitrary commands
22921 by writing clever filenames and/or parameters, we generally recommend that
22922 you only use safe scripts that work with the
22923 \begin_inset Flex Code
22926 \begin_layout Plain Layout
22932 system call in a controlled manner.
22933 Of course, for use in a controlled environment, it can be tempting to just
22934 fall back to use ordinary shell scripts.
22935 If you do so, be aware that you
22939 provide an easily exploitable security hole in your system.
22940 Of course it stands to reason that such unsafe templates will never be
22941 included in the standard LyX distribution, although we do encourage people
22942 to submit new templates in the open source tradition.
22943 But LyX as shipped from the official distribution channels will never have
22947 \begin_layout Standard
22948 Including external material provides a lot of power, and you have to be
22949 careful not to introduce security hazards with this power.
22950 A subtle error in a single line in an innocent looking script can open
22951 the door to huge security problems.
22952 So if you do not fully understand the issues, we recommend that you consult
22953 a knowledgeable security professional or the LyX development team if you
22954 have any questions about whether a given template is safe or not.
22955 And do this before you use it in an uncontrolled environment.