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 1355747298
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 Currently, only one argument per style\SpecialChar \slash{}
11017 layout can be automatically inserted.
11018 \change_inserted 155139281 1354198988
11022 \begin_layout Standard
11024 \change_inserted -712698321 1356689813
11025 By default, the text entered in the LyX workarea in the respective layout
11026 is the last (mandatory) argument of a command if the
11027 \begin_inset Flex Code
11030 \begin_layout Plain Layout
11032 \change_inserted -712698321 1356689619
11041 \begin_inset Flex Code
11044 \begin_layout Plain Layout
11046 \change_inserted -712698321 1356689629
11055 However, arguments with the prefix
11056 \begin_inset Flex Code
11059 \begin_layout Plain Layout
11061 \change_inserted -712698321 1356689679
11069 are output after this workarea argument.
11070 Note that post-argument numbering restarts at 1, so the first argument
11071 following the workarea argument is
11072 \begin_inset Flex Code
11075 \begin_layout Plain Layout
11077 \change_inserted -712698321 1356689813
11086 Post-arguments are ignored in any other
11087 \begin_inset Flex Code
11090 \begin_layout Plain Layout
11092 \change_inserted -712698321 1356689801
11099 \begin_inset Flex Code
11102 \begin_layout Plain Layout
11104 \change_inserted -712698321 1356689801
11115 \begin_layout Standard
11117 \change_inserted 155139281 1354199102
11119 \begin_inset Flex Code
11122 \begin_layout Plain Layout
11124 \change_inserted 155139281 1354199013
11135 \begin_inset Flex Code
11138 \begin_layout Plain Layout
11140 \change_inserted 155139281 1354199102
11151 \begin_inset Flex Code
11154 \begin_layout Plain Layout
11156 \change_inserted 155139281 1354199044
11164 followed by the number (e.
11165 \begin_inset space \thinspace{}
11170 \begin_inset Flex Code
11173 \begin_layout Plain Layout
11175 \change_inserted 155139281 1354199064
11189 \begin_layout Description
11190 \begin_inset Flex Code
11193 \begin_layout Plain Layout
11199 Note that this will completely override any prior
11200 \begin_inset Flex Code
11203 \begin_layout Plain Layout
11209 declaration for this style.
11211 \begin_inset Quotes eld
11215 \begin_inset Flex Code
11218 \begin_layout Plain Layout
11225 \begin_inset Quotes erd
11230 \begin_inset CommandInset ref
11232 reference "sub:I18n"
11236 for details on its use.
11239 \begin_layout Description
11240 \begin_inset Flex Code
11243 \begin_layout Plain Layout
11250 \begin_inset Flex Code
11253 \begin_layout Plain Layout
11263 \begin_layout Plain Layout
11264 Note that a `float' here is a real number, such as: 1.5.
11269 The vertical space with which the last of a chain of paragraphs with this
11270 style is separated from the following paragraph.
11271 If the next paragraph has another style, the separations are not simply
11272 added, but the maximum is taken.
11275 \begin_layout Description
11276 \begin_inset Flex Code
11279 \begin_layout Plain Layout
11286 \begin_inset Flex Code
11289 \begin_layout Plain Layout
11295 The category for this style.
11296 This is used to group related styles in the style combobox on the toolbar.
11297 Any string can be used, but you may want to use existing categories with
11302 \begin_layout Description
11303 \begin_inset Flex Code
11306 \begin_layout Plain Layout
11312 Depth of XML command.
11313 Used only with XML-type formats.
11316 \begin_layout Description
11317 \begin_inset Flex Code
11320 \begin_layout Plain Layout
11327 \begin_inset Flex Code
11330 \begin_layout Plain Layout
11336 Copies all the features of an existing style into the current one.
11340 \begin_layout Description
11341 \begin_inset Flex Code
11344 \begin_layout Plain Layout
11350 The name of a style whose preamble should be output
11355 This allows to ensure some ordering of the preamble snippets when macros
11356 definitions depend on one another.
11360 \begin_layout Plain Layout
11361 Note that, besides that functionality, there is no way to ensure any ordering
11363 The ordering that you see in a given version of LyX may change without
11364 warning in later versions.
11372 \begin_layout Description
11373 \begin_inset Flex Code
11376 \begin_layout Plain Layout
11383 \begin_inset Flex Code
11386 \begin_layout Plain Layout
11391 , Box, Filled_Box, Static
11396 ] The type of label that stands at the end of the paragraph (or sequence
11398 \begin_inset Flex Code
11401 \begin_layout Plain Layout
11408 \begin_inset Flex Code
11411 \begin_layout Plain Layout
11418 \begin_inset Flex Code
11421 \begin_layout Plain Layout
11428 \begin_inset Flex Code
11431 \begin_layout Plain Layout
11439 \begin_inset Flex Code
11442 \begin_layout Plain Layout
11449 \begin_inset Quotes eld
11453 \begin_inset Quotes erd
11457 \begin_inset Flex Code
11460 \begin_layout Plain Layout
11467 \begin_inset Flex Code
11470 \begin_layout Plain Layout
11471 \begin_inset space ~
11479 ) is a white (resp.
11480 \begin_inset space ~
11483 black) square suitable for end of proof markers,
11484 \begin_inset Flex Code
11487 \begin_layout Plain Layout
11493 is an explicit text string.
11496 \begin_layout Description
11497 \begin_inset Flex Code
11500 \begin_layout Plain Layout
11507 \begin_inset Flex Code
11510 \begin_layout Plain Layout
11516 ] The string used for a label with a
11517 \begin_inset Flex Code
11520 \begin_layout Plain Layout
11527 \begin_inset Flex Code
11530 \begin_layout Plain Layout
11540 \begin_layout Description
11541 \begin_inset Flex Code
11544 \begin_layout Plain Layout
11550 The font used for both the text body
11556 \begin_inset space ~
11560 \begin_inset CommandInset ref
11562 reference "sub:Font-description"
11567 Note that defining this font automatically defines the
11568 \begin_inset Flex Code
11571 \begin_layout Plain Layout
11578 So you should define this one first if you also want to define
11579 \begin_inset Flex Code
11582 \begin_layout Plain Layout
11591 \begin_layout Description
11592 \begin_inset Flex Code
11595 \begin_layout Plain Layout
11602 \begin_inset CommandInset label
11604 name "des:FreeSpacing"
11609 \begin_inset Flex Code
11612 \begin_layout Plain Layout
11621 \begin_inset Flex Code
11624 \begin_layout Plain Layout
11630 ] Usually LyX doesn't allow you to insert more than one space between words,
11631 since a space is considered as the separation between two words, not a
11632 character or symbol of its own.
11633 This is a very fine thing but sometimes annoying, for example, when typing
11634 program code or plain LaTeX code.
11636 \begin_inset Flex Code
11639 \begin_layout Plain Layout
11646 Note that LyX will create protected blanks for the additional blanks when
11647 in another mode than LaTeX-mode.
11650 \begin_layout Description
11651 \begin_inset Flex Code
11654 \begin_layout Plain Layout
11660 These tags are used with XHTML output.
11662 \begin_inset CommandInset ref
11664 reference "sub:Paragraph-Style-XHTML"
11671 \begin_layout Description
11672 \begin_inset Flex Code
11675 \begin_layout Plain Layout
11681 [[FIXME]] (Used only with XML-type formats.)
11684 \begin_layout Description
11685 \begin_inset Flex Code
11688 \begin_layout Plain Layout
11695 \begin_inset Flex Code
11698 \begin_layout Plain Layout
11704 If 1, marks the style as to be included in the document preamble rather
11705 than in the document body.
11706 This is useful for document classes that want such information as the title
11707 and author to appear in the preamble.
11708 Note that this works only for styles for which the
11709 \begin_inset Flex Code
11712 \begin_layout Plain Layout
11719 \begin_inset Flex Code
11722 \begin_layout Plain Layout
11729 \begin_inset Flex Code
11732 \begin_layout Plain Layout
11741 \begin_layout Description
11742 \begin_inset Flex Code
11745 \begin_layout Plain Layout
11752 \begin_inset Flex Code
11755 \begin_layout Plain Layout
11761 If 1, marks the style as being part of a title block (see also the
11762 \begin_inset Flex Code
11765 \begin_layout Plain Layout
11772 \begin_inset Flex Code
11775 \begin_layout Plain Layout
11784 \begin_layout Description
11786 \change_inserted -712698321 1355932296
11787 \begin_inset Flex Code
11790 \begin_layout Plain Layout
11792 \change_inserted -712698321 1355932178
11799 \begin_inset Flex Code
11802 \begin_layout Plain Layout
11804 \change_inserted -712698321 1355932181
11810 ] The LaTeX command sequence declaring an item in a list.
11811 The command is to be defined without the preceding backslash (the default
11813 \begin_inset Quotes eld
11817 \begin_inset Quotes erd
11821 \begin_inset Flex Code
11824 \begin_layout Plain Layout
11826 \change_inserted -712698321 1355932279
11836 in the LaTeX output).
11839 \begin_layout Description
11840 \begin_inset Flex Code
11843 \begin_layout Plain Layout
11850 \begin_inset Flex Code
11853 \begin_layout Plain Layout
11859 ] This provides extra space between paragraphs that have the same style.
11860 If you put other styles into an environment, each is separated with the
11862 \begin_inset Flex Code
11865 \begin_layout Plain Layout
11872 But the whole items of the environment are additionally separated with
11874 \begin_inset Flex Code
11877 \begin_layout Plain Layout
11884 Note that this is a
11889 \begin_layout Description
11890 \begin_inset Flex Code
11893 \begin_layout Plain Layout
11899 [[FIXME]] (Used only with XML-type formats.)
11902 \begin_layout Description
11903 \begin_inset Flex Code
11906 \begin_layout Plain Layout
11913 \begin_inset Flex Code
11916 \begin_layout Plain Layout
11925 \begin_inset Flex Code
11928 \begin_layout Plain Layout
11934 ] Usually LyX does not allow you to leave a paragraph empty, since it would
11935 lead to empty LaTeX output.
11936 There are some cases where this could be desirable however: in a letter
11937 template, the required fields can be provided as empty fields, so that
11938 people do not forget them; in some special classes, a style can be used
11939 as some kind of break, which does not contain actual text.
11942 \begin_layout Description
11943 \begin_inset Flex Code
11946 \begin_layout Plain Layout
11952 [float=0] The vertical space between the label and the text body.
11953 Only used for labels that are above the text body (
11954 \begin_inset Flex Code
11957 \begin_layout Plain Layout
11964 \begin_inset Flex Code
11967 \begin_layout Plain Layout
11968 Centered_Top_Environment
11976 \begin_layout Description
11977 \begin_inset Flex Code
11980 \begin_layout Plain Layout
11987 \begin_inset Flex Code
11990 \begin_layout Plain Layout
11997 \begin_inset Newline newline
12000 The name of the counter for automatic numbering.
12002 \begin_inset Newline newline
12010 \begin_inset Flex Code
12013 \begin_layout Plain Layout
12020 \begin_inset Flex Code
12023 \begin_layout Plain Layout
12030 In that case, the counter will be stepped each time the style appears.
12032 \begin_inset Newline newline
12040 \begin_inset Flex Code
12043 \begin_layout Plain Layout
12050 \begin_inset Flex Code
12053 \begin_layout Plain Layout
12059 , though this case is a bit complicated.
12060 Suppose you declare
12061 \begin_inset Quotes eld
12065 \begin_inset Flex Code
12068 \begin_layout Plain Layout
12069 LabelCounter myenum
12075 \begin_inset Quotes erd
12079 Then the actual counters used are
12080 \begin_inset Flex Code
12083 \begin_layout Plain Layout
12090 \begin_inset Flex Code
12093 \begin_layout Plain Layout
12100 \begin_inset Flex Code
12103 \begin_layout Plain Layout
12110 \begin_inset Flex Code
12113 \begin_layout Plain Layout
12119 , much as in LaTeX.
12120 These counters must all be declared separately.
12121 \begin_inset Newline newline
12125 \begin_inset CommandInset ref
12127 reference "sub:Counters"
12131 for details on counters.
12134 \begin_layout Description
12135 \begin_inset Flex Code
12138 \begin_layout Plain Layout
12144 The font used for the label.
12146 \begin_inset space ~
12150 \begin_inset CommandInset ref
12152 reference "sub:Font-description"
12159 \begin_layout Description
12160 \begin_inset Flex Code
12163 \begin_layout Plain Layout
12169 Text that indicates how far a label should be indented.
12172 \begin_layout Description
12173 \begin_inset Flex Code
12176 \begin_layout Plain Layout
12183 \begin_inset Flex Code
12186 \begin_layout Plain Layout
12192 ] The horizontal space between the label and the text body.
12193 Only used for labels that are not above the text body.
12196 \begin_layout Description
12197 \begin_inset Flex Code
12200 \begin_layout Plain Layout
12207 \begin_inset Flex Code
12210 \begin_layout Plain Layout
12216 ] The string used for a label with a
12217 \begin_inset Flex Code
12220 \begin_layout Plain Layout
12228 \begin_inset Flex Code
12231 \begin_layout Plain Layout
12237 is set, this string can be contain the special formatting commands described
12239 \begin_inset CommandInset ref
12241 reference "sub:Counters"
12249 \begin_layout Plain Layout
12250 For the sake of backwards compatibility, the string
12251 \begin_inset Flex Code
12254 \begin_layout Plain Layout
12264 will be replaced by the expanded
12265 \begin_inset Flex Code
12268 \begin_layout Plain Layout
12275 \begin_inset Flex Code
12278 \begin_layout Plain Layout
12287 This feature is now obsolete and should be replaced by the mechanisms of
12289 \begin_inset CommandInset ref
12291 reference "sub:Counters"
12303 \begin_layout Description
12304 \begin_inset Flex Code
12307 \begin_layout Plain Layout
12308 LabelStringAppendix
12314 \begin_inset Flex Code
12317 \begin_layout Plain Layout
12323 ] This is used inside the appendix instead of
12324 \begin_inset Flex Code
12327 \begin_layout Plain Layout
12335 \begin_inset Flex Code
12338 \begin_layout Plain Layout
12345 \begin_inset Flex Code
12348 \begin_layout Plain Layout
12349 LabelStringAppendix
12357 \begin_layout Description
12358 \begin_inset Flex Code
12361 \begin_layout Plain Layout
12367 [FIXME] (Used only with XML-type formats.)
12370 \begin_layout Description
12371 \begin_inset Flex Code
12374 \begin_layout Plain Layout
12381 \begin_inset Flex Code
12384 \begin_layout Plain Layout
12389 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
12390 Enumerate, Itemize, Bibliography
12399 \begin_layout Itemize
12400 \begin_inset Flex Code
12403 \begin_layout Plain Layout
12409 means the label is the very first word (up to the first real blank).
12410 Use protected spaces (like
12411 \begin_inset space ~
12414 that one) if you want more than one word as the label.
12418 \begin_layout Itemize
12419 \begin_inset Flex Code
12422 \begin_layout Plain Layout
12428 means the label is simply whatever
12429 \begin_inset Flex Code
12432 \begin_layout Plain Layout
12439 Note that this really is `static'.
12442 \begin_layout Itemize
12443 \begin_inset Flex Code
12446 \begin_layout Plain Layout
12453 \begin_inset Flex Code
12456 \begin_layout Plain Layout
12457 Centered_Top_Environment
12462 are special cases of
12463 \begin_inset Flex Code
12466 \begin_layout Plain Layout
12473 The label will be printed above the paragraph, but only at the top of an
12474 environment or the top of a chain of paragraphs with this style.
12475 This might be used with the
12476 \begin_inset Flex MenuItem
12479 \begin_layout Plain Layout
12485 style, for example.
12488 \begin_layout Itemize
12489 \begin_inset Flex Code
12492 \begin_layout Plain Layout
12498 is a special case for the caption-labels
12499 \begin_inset Quotes eld
12503 \begin_inset Quotes erd
12507 \begin_inset Quotes eld
12511 \begin_inset Quotes erd
12516 \begin_inset Flex Code
12519 \begin_layout Plain Layout
12525 means the (hardcoded) label string depends on the kind of float: It is
12526 hardcoded to be `FloatType N', where N is the value of the counter associated
12530 \begin_layout Itemize
12532 \begin_inset Flex Code
12535 \begin_layout Plain Layout
12541 label type defines automatically numbered labels.
12543 \begin_inset Flex Code
12546 \begin_layout Plain Layout
12552 will be expanded to resolve any counter references it contains: For example,
12554 \begin_inset Quotes eld
12558 \begin_inset Flex Code
12561 \begin_layout Plain Layout
12572 \begin_inset Quotes erd
12577 \begin_inset CommandInset ref
12579 reference "sub:Counters"
12583 for more information on counters.
12586 \begin_layout Itemize
12587 \begin_inset Flex Code
12590 \begin_layout Plain Layout
12596 produces the usual sort of enumeration labels.
12597 At present, it is hardcoded to use Arabic numerals, lowercase letters,
12598 small Roman numerals, and uppercase letters for the four possible depths.
12601 \begin_layout Itemize
12602 \begin_inset Flex Code
12605 \begin_layout Plain Layout
12611 produces various bullets at the different levels.
12612 It is also hardcoded.
12615 \begin_layout Itemize
12616 \begin_inset Flex Code
12619 \begin_layout Plain Layout
12625 is used internally by LyX and should be used only with
12626 \begin_inset Flex Code
12629 \begin_layout Plain Layout
12630 LatexType BibEnvironment
12639 \begin_layout Description
12640 \begin_inset Flex Code
12643 \begin_layout Plain Layout
12649 Note that this will completely override any prior
12650 \begin_inset Flex Code
12653 \begin_layout Plain Layout
12659 declaration for this style.
12661 \begin_inset Quotes eld
12665 \begin_inset Flex Code
12668 \begin_layout Plain Layout
12675 \begin_inset Quotes erd
12680 \begin_inset CommandInset ref
12682 reference "sub:I18n"
12686 for details on its use.
12689 \begin_layout Description
12690 \begin_inset Flex Code
12693 \begin_layout Plain Layout
12699 The name of the corresponding LaTeX stuff.
12700 Either the environment or command name.
12703 \begin_layout Description
12704 \begin_inset Flex Code
12707 \begin_layout Plain Layout
12713 An optional parameter for the corresponding
12714 \begin_inset Flex Code
12717 \begin_layout Plain Layout
12724 This parameter cannot be changed from within LyX
12725 \change_inserted -712698321 1355144804
12727 \begin_inset Flex Code
12730 \begin_layout Plain Layout
12732 \change_inserted -712698321 1355144804
12738 for customizable parameters)
12742 \change_inserted -712698321 1355144804
12743 This will be output as is after all LaTeX
12744 \begin_inset Flex Code
12747 \begin_layout Plain Layout
12749 \change_inserted -712698321 1355144658
12762 \begin_layout Description
12763 \begin_inset Flex Code
12766 \begin_layout Plain Layout
12773 \begin_inset Flex Code
12776 \begin_layout Plain Layout
12781 , Command, Environment, Item_Environment,
12787 \begin_inset Flex Code
12790 \begin_layout Plain Layout
12791 List_Environment, Bib_Environment
12796 ] How the style should be translated into LaTeX.
12800 \begin_layout Plain Layout
12801 \begin_inset Flex Code
12804 \begin_layout Plain Layout
12810 is perhaps a bit misleading, since these rules apply to SGML classes, too.
12811 Visit the SGML class files for specific examples.
12820 \begin_layout Itemize
12821 \begin_inset Flex Code
12824 \begin_layout Plain Layout
12830 means nothing special.
12834 \begin_layout Itemize
12835 \begin_inset Flex Code
12838 \begin_layout Plain Layout
12845 \begin_inset Flex Code
12848 \begin_layout Plain Layout
12855 {\SpecialChar \ldots{}
12864 \begin_layout Itemize
12865 \begin_inset Flex Code
12868 \begin_layout Plain Layout
12875 \begin_inset Flex Code
12878 \begin_layout Plain Layout
12885 }\SpecialChar \ldots{}
12901 \begin_layout Itemize
12902 \begin_inset Flex Code
12905 \begin_layout Plain Layout
12912 \begin_inset Flex Code
12915 \begin_layout Plain Layout
12922 \begin_inset Flex Code
12925 \begin_layout Plain Layout
12933 is generated for each paragraph of this environment.
12937 \begin_layout Itemize
12938 \begin_inset Flex Code
12941 \begin_layout Plain Layout
12948 \begin_inset Flex Code
12951 \begin_layout Plain Layout
12958 \begin_inset Flex Code
12961 \begin_layout Plain Layout
12967 is passed as an argument to the environment.
12969 \begin_inset Flex Code
12972 \begin_layout Plain Layout
12978 can be defined in the
12979 \begin_inset Flex MenuItem
12982 \begin_layout Plain Layout
12983 Edit\SpecialChar \menuseparator
12985 \begin_inset space ~
12997 \begin_layout Standard
12998 Putting the last few things together, the LaTeX output will be either:
13001 \begin_layout LyX-Code
13004 latexname[latexparam]{\SpecialChar \ldots{}
13008 \begin_layout Standard
13012 \begin_layout LyX-Code
13015 begin{latexname}[latexparam] \SpecialChar \ldots{}
13021 \begin_layout Standard
13022 depending upon the LaTeX type.
13026 \begin_layout Description
13028 \change_inserted -712698321 1354263086
13029 \begin_inset Flex Code
13032 \begin_layout Plain Layout
13034 \change_inserted -712698321 1353866852
13041 \begin_inset Flex Code
13044 \begin_layout Plain Layout
13046 \change_inserted -712698321 1353866852
13052 ] A string that is put at the beginning of the style content.
13053 A line break in the output can be indicated by
13054 \begin_inset Flex Code
13057 \begin_layout Plain Layout
13059 \change_inserted -712698321 1354263086
13070 \begin_layout Description
13071 \begin_inset Flex Code
13074 \begin_layout Plain Layout
13081 \begin_inset Flex Code
13084 \begin_layout Plain Layout
13090 ] If you put styles into environments, the leftmargins are not simply added,
13091 but added with a factor
13092 \begin_inset Formula $\frac{4}{depth+4}$
13096 Note that this parameter is also used when the margin is defined as
13097 \begin_inset Flex Code
13100 \begin_layout Plain Layout
13107 \begin_inset Flex Code
13110 \begin_layout Plain Layout
13117 Then it is added to the manual or dynamic margin.
13119 \begin_inset Newline newline
13122 The argument is passed as a string.
13124 \begin_inset Quotes eld
13128 \begin_inset Flex Code
13131 \begin_layout Plain Layout
13138 \begin_inset Quotes erd
13141 means that the paragraph is indented with the width of
13142 \begin_inset Quotes eld
13146 \begin_inset Flex Code
13149 \begin_layout Plain Layout
13156 \begin_inset Quotes erd
13159 in the normal font.
13160 You can get a negative width by prefixing the string with
13161 \begin_inset Quotes eld
13165 \begin_inset Flex Code
13168 \begin_layout Plain Layout
13175 \begin_inset Quotes erd
13179 This way was chosen so that the look is the same with each used screen
13184 \begin_layout Description
13185 \begin_inset Flex Code
13188 \begin_layout Plain Layout
13195 \begin_inset Flex Code
13198 \begin_layout Plain Layout
13203 , Manual, Dynamic, First_Dynamic, Right_Address_Box
13209 \begin_inset Newline newline
13212 The kind of margin that the style has on the left side.
13214 \begin_inset Flex Code
13217 \begin_layout Plain Layout
13223 just means a fixed margin.
13225 \begin_inset Flex Code
13228 \begin_layout Plain Layout
13234 means that the left margin depends on the string entered in the
13235 \begin_inset Flex MenuItem
13238 \begin_layout Plain Layout
13239 Edit\SpecialChar \menuseparator
13241 \begin_inset space ~
13250 This is used to typeset nice lists without tabulators.
13252 \begin_inset Flex Code
13255 \begin_layout Plain Layout
13261 means that the margin depends on the size of the label.
13262 This is used for automatic enumerated headlines.
13263 It is obvious that the headline
13264 \begin_inset Quotes eld
13267 5.4.3.2.1 Very long headline
13268 \begin_inset Quotes erd
13271 must have a wider left margin (as wide as
13272 \begin_inset Quotes eld
13276 \begin_inset Quotes erd
13279 plus the space) than
13280 \begin_inset Quotes eld
13283 3.2 Very long headline
13284 \begin_inset Quotes erd
13288 \begin_inset Quotes eld
13292 \begin_inset Quotes erd
13295 are not able to do this.
13297 \begin_inset Flex Code
13300 \begin_layout Plain Layout
13306 is similar, but only the very first row of the paragraph is dynamic, while
13307 the others are static; this is used, for example, for descriptions.
13309 \begin_inset Flex Code
13312 \begin_layout Plain Layout
13318 means the margin is chosen in a way that the longest row of this paragraph
13319 fits to the right margin.
13320 This is used to typeset an address on the right edge of the page.
13323 \begin_layout Description
13324 \begin_inset Flex Code
13327 \begin_layout Plain Layout
13334 \begin_inset Flex Code
13337 \begin_layout Plain Layout
13346 \begin_inset Flex Code
13349 \begin_layout Plain Layout
13355 ] Whether fragile commands in this style should be
13356 \begin_inset Flex Code
13359 \begin_layout Plain Layout
13372 whether this command should itself be protected.)
13375 \begin_layout Description
13376 \begin_inset Flex Code
13379 \begin_layout Plain Layout
13386 \begin_inset Flex Code
13389 \begin_layout Plain Layout
13396 \begin_inset Flex Code
13399 \begin_layout Plain Layout
13407 ] Whether newlines are translated into LaTeX newlines (
13408 \begin_inset Flex Code
13411 \begin_layout Plain Layout
13422 The translation can be switched off to allow more comfortable LaTeX editing
13426 \begin_layout Description
13427 \begin_inset Flex Code
13430 \begin_layout Plain Layout
13437 \begin_inset Flex Code
13440 \begin_layout Plain Layout
13447 \begin_inset Flex Code
13450 \begin_layout Plain Layout
13458 ] If set to true, and if
13459 \begin_inset Flex Code
13462 \begin_layout Plain Layout
13469 \begin_inset Flex Code
13472 \begin_layout Plain Layout
13478 ) paragraphs are being indented, then the indentation of such a paragraph
13479 following one of this type will be suppressed.
13480 (So this will not affect the display of non-default paragraphs.)
13483 \begin_layout Description
13484 \begin_inset Flex Code
13487 \begin_layout Plain Layout
13493 Name of a style that has replaced this style.
13494 This is used to rename a style, while keeping backward compatibility.
13497 \begin_layout Description
13499 \change_deleted -712698321 1353679722
13500 \begin_inset Flex Code
13503 \begin_layout Plain Layout
13510 \begin_inset Flex Code
13513 \begin_layout Plain Layout
13519 ] The number of optional arguments that can be used with this style.
13520 This is useful for things like section headings, and only makes sense with
13522 Note that, on output, the optional arguments will all precede any required
13523 arguments (see below).
13524 So one can have constructs like:
13528 \begin_layout LyX-Code
13530 \change_deleted -712698321 1353679722
13533 mycmd[opt1]{req1}{contents of paragraph}
13536 \begin_layout Standard
13538 \change_deleted -712698321 1353679722
13539 but one cannot have things like:
13542 \begin_layout LyX-Code
13544 \change_deleted -712698321 1353679722
13547 mycmd[opt1]{req1}[opt2]{contents of paragraph}
13550 \begin_layout Standard
13552 \change_deleted -712698321 1353679722
13553 at least, not without ERT (with which you can have anything).
13560 \begin_layout Description
13561 \begin_inset Flex Code
13564 \begin_layout Plain Layout
13571 \begin_inset Flex Code
13574 \begin_layout Plain Layout
13583 \begin_inset Flex Code
13586 \begin_layout Plain Layout
13592 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
13593 output, but only by a line break; together with
13594 \begin_inset Flex Code
13597 \begin_layout Plain Layout
13603 , this allows to emulate a plain text editor (like the ERT inset).
13606 \begin_layout Description
13607 \begin_inset Flex Code
13610 \begin_layout Plain Layout
13617 \begin_inset Flex Code
13620 \begin_layout Plain Layout
13626 ] The indent of the very first line of a paragraph.
13628 \begin_inset Flex Code
13631 \begin_layout Plain Layout
13637 will be fixed for a certain style.
13638 The exception is the default style, since the indentation for these paragraphs
13639 can be prohibited with
13640 \begin_inset Flex Code
13643 \begin_layout Plain Layout
13651 \begin_inset Flex Code
13654 \begin_layout Plain Layout
13660 style paragraphs inside environments use the
13661 \begin_inset Flex Code
13664 \begin_layout Plain Layout
13670 of the environment, not their native one.
13672 \begin_inset Flex Code
13675 \begin_layout Plain Layout
13681 paragraphs inside an enumeration are not indented.
13684 \begin_layout Description
13685 \begin_inset Flex Code
13688 \begin_layout Plain Layout
13695 \begin_inset Flex Code
13698 \begin_layout Plain Layout
13704 ] The vertical space between two paragraphs of this style.
13707 \begin_layout Description
13708 \begin_inset Flex Code
13711 \begin_layout Plain Layout
13718 \begin_inset Flex Code
13721 \begin_layout Plain Layout
13727 ] LyX allows the user to choose either
13728 \begin_inset Quotes eld
13732 \begin_inset Quotes erd
13736 \begin_inset Quotes eld
13740 \begin_inset Quotes erd
13743 to typeset a document.
13745 \begin_inset Quotes eld
13749 \begin_inset Quotes erd
13752 is chosen, this value is completely ignored.
13754 \begin_inset Quotes eld
13758 \begin_inset Quotes erd
13761 is chosen, the parindent of a LaTeXtype
13762 \begin_inset Quotes eld
13766 \begin_inset Quotes erd
13769 style is ignored and all paragraphs are separated by this parskip argument.
13770 The vertical space is calculated with
13771 \begin_inset Flex Code
13774 \begin_layout Plain Layout
13776 \begin_inset space ~
13785 \begin_inset Flex Code
13788 \begin_layout Plain Layout
13794 is the height of a row with the normal font.
13795 This way, the look stays the same with different screen fonts.
13798 \begin_layout Description
13799 \begin_inset Flex Code
13802 \begin_layout Plain Layout
13809 \begin_inset Flex Code
13812 \begin_layout Plain Layout
13821 \begin_inset Flex Code
13824 \begin_layout Plain Layout
13830 ] Whether the contents of this paragraph should be output in raw form, meaning
13831 without special translations that LaTeX would require.
13834 \begin_layout Description
13835 \begin_inset Flex Code
13838 \begin_layout Plain Layout
13844 Information to be included in the LaTeX preamble when this style is used.
13845 Used to define macros, load packages, etc., required by this particular
13848 \begin_inset Quotes eld
13852 \begin_inset Flex Code
13855 \begin_layout Plain Layout
13862 \begin_inset Quotes erd
13868 \begin_layout Description
13869 \begin_inset Flex Code
13872 \begin_layout Plain Layout
13879 \begin_inset Flex Code
13882 \begin_layout Plain Layout
13888 ] The prefix to use when creating labels referring to paragraphs of this
13890 This allows the use of formatted references.
13893 \begin_layout Description
13895 \change_deleted -712698321 1353681258
13896 \begin_inset Flex Code
13899 \begin_layout Plain Layout
13906 \begin_inset Flex Code
13909 \begin_layout Plain Layout
13915 ] The number of required arguments that the LaTeX command or environment
13916 corresponding to this style expects.
13917 In the case of a command, these are required arguments
13921 that associated with the content of the paragraph itself.
13922 These do not actually have to be provided: LyX will output empty arguments
13924 Note that optional arguments will be output before required arguments.
13925 See the discussion of the
13926 \begin_inset Flex Code
13929 \begin_layout Plain Layout
13935 tag above for more information.
13940 \begin_layout Description
13941 \begin_inset Flex Code
13944 \begin_layout Plain Layout
13951 \begin_inset Flex Code
13954 \begin_layout Plain Layout
13960 ] Whether the style requires the feature
13961 \begin_inset Flex Code
13964 \begin_layout Plain Layout
13971 See the description of
13972 \begin_inset Flex Code
13975 \begin_layout Plain Layout
13982 \begin_inset CommandInset ref
13983 LatexCommand pageref
13984 reference "des:FreeSpacing"
13988 ) for information on `features'.
13990 \change_inserted -712698321 1353693134
13994 \begin_layout Description
13996 \change_inserted -712698321 1353693371
13997 \begin_inset Flex Code
14000 \begin_layout Plain Layout
14002 \change_inserted -712698321 1353693146
14011 \begin_inset Flex Code
14014 \begin_layout Plain Layout
14016 \change_inserted -712698321 1353693235
14025 \begin_inset Flex Code
14028 \begin_layout Plain Layout
14030 \change_inserted -712698321 1353693235
14036 ] Resets the LaTeX arguments of this style (as defined via the
14037 \begin_inset Flex Code
14040 \begin_layout Plain Layout
14042 \change_inserted -712698321 1353693371
14051 This is useful if you have copied a style via
14052 \begin_inset Flex Code
14055 \begin_layout Plain Layout
14057 \change_inserted -712698321 1353693302
14065 , but you do not want to inherit its (required and optional) arguments.
14070 \begin_layout Description
14072 \change_inserted -712698321 1354263074
14073 \begin_inset Flex Code
14076 \begin_layout Plain Layout
14078 \change_inserted -712698321 1353866876
14085 \begin_inset Flex Code
14088 \begin_layout Plain Layout
14090 \change_inserted -712698321 1353866873
14096 ] A string that is put at the end of the layout content.
14097 A line break in the output can be indicated by
14098 \begin_inset Flex Code
14101 \begin_layout Plain Layout
14103 \change_inserted -712698321 1354263069
14114 \begin_layout Description
14115 \begin_inset Flex Code
14118 \begin_layout Plain Layout
14125 \begin_inset Flex Code
14128 \begin_layout Plain Layout
14135 \begin_inset Flex Code
14138 \begin_layout Plain Layout
14147 \begin_layout Description
14148 \begin_inset Flex Code
14151 \begin_layout Plain Layout
14158 \begin_inset Flex Code
14161 \begin_layout Plain Layout
14166 , onehalf, double, other
14175 ] This defines what the default spacing should be in the style.
14177 \begin_inset Flex Code
14180 \begin_layout Plain Layout
14187 \begin_inset Flex Code
14190 \begin_layout Plain Layout
14197 \begin_inset Flex Code
14200 \begin_layout Plain Layout
14206 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
14207 If you specify the argument
14208 \begin_inset Flex Code
14211 \begin_layout Plain Layout
14217 , then you should also provide a numerical argument which will be the actual
14219 Note that, contrary to other parameters,
14220 \begin_inset Flex Code
14223 \begin_layout Plain Layout
14229 implies the generation of specific LaTeX code, using the package
14232 \begin_inset Flex Code
14235 \begin_layout Plain Layout
14244 \begin_layout Description
14245 \begin_inset Flex Code
14248 \begin_layout Plain Layout
14255 \begin_inset Flex Code
14258 \begin_layout Plain Layout
14265 \begin_inset Flex Code
14268 \begin_layout Plain Layout
14276 ] Spellcheck paragraphs of this style.
14280 \begin_layout Description
14281 \begin_inset Flex Code
14284 \begin_layout Plain Layout
14290 The font used for the text body .
14292 \begin_inset CommandInset ref
14294 reference "sub:Font-description"
14301 \begin_layout Description
14302 \begin_inset Flex Code
14305 \begin_layout Plain Layout
14314 \begin_inset Flex Code
14317 \begin_layout Plain Layout
14327 The level of the style in the table of contents.
14328 This is used for automatic numbering of section headings.
14331 \begin_layout Description
14332 \begin_inset Flex Code
14335 \begin_layout Plain Layout
14342 \begin_inset Flex Code
14345 \begin_layout Plain Layout
14351 ] The vertical space with which the very first of a chain of paragraphs
14352 with this style is separated from the previous paragraph.
14353 If the previous paragraph has another style, the separations are not simply
14354 added, but the maximum is taken.
14357 \begin_layout Subsection
14358 \begin_inset CommandInset label
14364 Internationalization of Paragraph Styles
14367 \begin_layout Standard
14368 LyX has long supported internationalization of layout information, but,
14369 until version 2.0, this applied only to the user interface and not to, say,
14371 Thus, French authors were forced to resort to ugly hacks if they wanted
14376 1' instead of `Theorem 1'.
14377 Thanks to Georg Baum, that is no longer the case.
14380 \begin_layout Standard
14382 \begin_inset Flex Code
14385 \begin_layout Plain Layout
14391 defines text that is to appear in the typeset document, it may use
14392 \begin_inset Flex Code
14395 \begin_layout Plain Layout
14402 \begin_inset Flex Code
14405 \begin_layout Plain Layout
14411 to support non-English and even multi-language documents correctly.
14412 The following excerpt (from the
14413 \begin_inset Flex Code
14416 \begin_layout Plain Layout
14422 file) shows how this works:
14425 \begin_layout LyX-Code
14430 \begin_layout LyX-Code
14433 theoremstyle{remark}
14436 \begin_layout LyX-Code
14439 newtheorem{claim}[thm]{
14446 \begin_layout LyX-Code
14450 \begin_layout LyX-Code
14454 \begin_layout LyX-Code
14459 claimname}{_(Claim)}
14462 \begin_layout LyX-Code
14466 \begin_layout LyX-Code
14470 \begin_layout LyX-Code
14479 claimname}{_(Claim)}}
14482 \begin_layout LyX-Code
14487 \begin_layout Standard
14488 In principle, any legal LaTeX may appear in the
14489 \begin_inset Flex Code
14492 \begin_layout Plain Layout
14499 \begin_inset Flex Code
14502 \begin_layout Plain Layout
14508 tags, but in practice they will typically look as they do here.
14509 The key to correct translation of the typeset text is the definition of
14511 \begin_inset Flex Code
14514 \begin_layout Plain Layout
14523 \begin_inset Flex Code
14526 \begin_layout Plain Layout
14538 \begin_layout Standard
14540 \begin_inset Flex Code
14543 \begin_layout Plain Layout
14549 tag provides for internationalization based upon the overall language of
14551 The contents of the tag will be included in the preamble, just as with
14553 \begin_inset Flex Code
14556 \begin_layout Plain Layout
14563 What makes it special is the use of the
14564 \begin_inset Quotes eld
14568 \begin_inset Quotes erd
14572 \begin_inset Flex Code
14575 \begin_layout Plain Layout
14581 , which will be replaced, when LyX produces LaTeX output, with the translation
14582 of its argument into the document language.
14585 \begin_layout Standard
14587 \begin_inset Flex Code
14590 \begin_layout Plain Layout
14596 tag is more complex, since it is meant to provide support for multi-language
14597 documents and so offers an interface to the
14598 \begin_inset Flex Code
14601 \begin_layout Plain Layout
14608 Its contents will be added to the preamble once for each language that
14609 appears in the document.
14610 In this case, the argument to
14611 \begin_inset Flex Code
14614 \begin_layout Plain Layout
14620 will be replaced with its translation into the language in question; the
14622 \begin_inset Flex Code
14625 \begin_layout Plain Layout
14631 is replaced by the language name (as used by the babel package).
14634 \begin_layout Standard
14635 A German document that also included a French section would thus have the
14636 following in the preamble:
14639 \begin_layout LyX-Code
14648 claimname}{Affirmation}}
14656 claimname}{Behauptung}}
14660 claimname}{Behauptung}
14663 \begin_layout Standard
14665 \begin_inset Flex Code
14668 \begin_layout Plain Layout
14674 will then conspire to produce the correct text in the output.
14677 \begin_layout Standard
14678 One important point to note here is that the translations are provided by
14679 LyX itself, through the
14680 \change_inserted -195340706 1334775793
14682 \begin_inset Flex Code
14685 \begin_layout Plain Layout
14687 \change_inserted -195340706 1334775793
14694 \change_deleted -195340706 1334775793
14695 same mechanism it uses for internationalization of the user interface
14698 This means, in effect, that
14699 \begin_inset Flex Code
14702 \begin_layout Plain Layout
14709 \begin_inset Flex Code
14712 \begin_layout Plain Layout
14718 are really only of use in layout files that are provided with LyX, since
14719 text entered in user-created layout files will not be seen by LyX's internation
14721 \change_inserted -195340706 1334775793
14723 \begin_inset Flex Code
14726 \begin_layout Plain Layout
14728 \change_inserted -195340706 1334775793
14734 file is modified accordingly
14737 That said, however, any layout created with the intention that it will
14738 be included with LyX should use these tags where appropriate.
14740 \change_inserted -195340706 1334775793
14741 Please note that the paragraph style translations provided by LyX will
14742 never change with a minor update (e.g.
14743 from version 2.1.x to 2.1.y).
14744 It is however quite likely that a major update (e.g.
14745 from 2.0.x to 2.1.y) will introduce new translations or corrections.
14750 \begin_layout Subsection
14752 \begin_inset CommandInset label
14761 \begin_layout Standard
14762 Since version 1.3.0 of LyX, it is has been both possible and necessary to
14763 define the floats (
14764 \begin_inset Flex MenuItem
14767 \begin_layout Plain Layout
14774 \begin_inset Flex MenuItem
14777 \begin_layout Plain Layout
14783 , \SpecialChar \ldots{}
14784 ) in the text class itself.
14785 Standard floats are included in the file
14786 \begin_inset Flex Code
14789 \begin_layout Plain Layout
14795 , so you may have to do no more than add
14798 \begin_layout LyX-Code
14799 Input stdfloats.inc
14802 \begin_layout Standard
14803 to your layout file.
14804 If you want to implement a text class that proposes some other float types
14805 (like the AGU class bundled with LyX), the information below will hopefully
14809 \begin_layout Description
14810 \begin_inset Flex Code
14813 \begin_layout Plain Layout
14820 \begin_inset Flex Code
14823 \begin_layout Plain Layout
14830 \begin_inset Quotes erd
14834 \begin_inset Quotes erd
14837 ] The file name extension of an auxiliary file for the list of figures (or
14839 LaTeX writes the captions to this file.
14842 \begin_layout Description
14843 \begin_inset Flex Code
14846 \begin_layout Plain Layout
14853 \begin_inset Flex Code
14856 \begin_layout Plain Layout
14863 \begin_inset Quotes erd
14867 \begin_inset Quotes erd
14870 ] The string that will be used in the menus and also for the caption.
14871 This is translated to the current language if babel is used.
14874 \begin_layout Description
14875 \begin_inset Flex Code
14878 \begin_layout Plain Layout
14884 These are used for XHTML output.
14886 \begin_inset CommandInset ref
14888 reference "sec:Tags-for-XHTML"
14895 \begin_layout Description
14896 \begin_inset Flex Code
14899 \begin_layout Plain Layout
14908 \begin_inset Flex Code
14911 \begin_layout Plain Layout
14920 \begin_inset Flex Code
14923 \begin_layout Plain Layout
14929 ] Indicates whether the float is already defined in the document class or
14930 if we instead need to load
14931 \begin_inset Flex Code
14934 \begin_layout Plain Layout
14940 and use what it provides to define it on-the-fly.
14942 \begin_inset Flex Code
14945 \begin_layout Plain Layout
14952 \begin_inset Flex Code
14955 \begin_layout Plain Layout
14962 It should be set to
14963 \begin_inset Flex Code
14966 \begin_layout Plain Layout
14972 if the float is already defined by the LaTeX document class.
14975 \begin_layout Description
14976 \begin_inset Flex Code
14979 \begin_layout Plain Layout
14986 \begin_inset Flex Code
14989 \begin_layout Plain Layout
14996 \begin_inset Quotes erd
15000 \begin_inset Quotes erd
15003 ] The command used to generate a list of floats of this type; the leading
15006 ' should be omitted.
15012 \begin_inset Flex Code
15015 \begin_layout Plain Layout
15021 is false, since there is no standard way to generate this command.
15023 \begin_inset Flex Code
15026 \begin_layout Plain Layout
15032 is true, since in that case there is a standard way to define the command.
15035 \begin_layout Description
15036 \begin_inset Flex Code
15039 \begin_layout Plain Layout
15046 \begin_inset Flex Code
15049 \begin_layout Plain Layout
15056 \begin_inset Quotes erd
15060 \begin_inset Quotes erd
15063 ] A title for a list of floats of this kind (list of figures, tables, or
15065 It is used for the screen label within LyX; it is passed to LaTeX for use
15066 as the title there; and it is used as the title in XHTML output.
15067 It will be translated to the document language.
15070 \begin_layout Description
15071 \begin_inset Flex Code
15074 \begin_layout Plain Layout
15081 \begin_inset Flex Code
15084 \begin_layout Plain Layout
15091 \begin_inset Quotes erd
15095 \begin_inset Quotes erd
15098 ] This (optional) argument determines whether floats of this class will
15099 be numbered within some sectional unit of the document.
15100 For example, if within is equal to
15101 \begin_inset Flex Code
15104 \begin_layout Plain Layout
15110 , the floats will be numbered within chapters.
15114 \begin_layout Description
15115 \begin_inset Flex Code
15118 \begin_layout Plain Layout
15125 \begin_inset Flex Code
15128 \begin_layout Plain Layout
15135 \begin_inset Quotes erd
15139 \begin_inset Quotes erd
15142 ] The default placement for the given class of floats.
15143 The string should be as in standard LaTeX:
15144 \begin_inset Flex Code
15147 \begin_layout Plain Layout
15154 \begin_inset Flex Code
15157 \begin_layout Plain Layout
15164 \begin_inset Flex Code
15167 \begin_layout Plain Layout
15174 \begin_inset Flex Code
15177 \begin_layout Plain Layout
15183 for top, bottom, page, and here, respectively.
15187 \begin_layout Plain Layout
15188 Note that the order of these letters in the string is irrelevant, like in
15194 On top of that there is a new type,
15195 \begin_inset Flex Code
15198 \begin_layout Plain Layout
15204 , which does not really correspond to a float, since it means: put it
15205 \begin_inset Quotes eld
15209 \begin_inset Quotes erd
15213 Note however that the
15214 \begin_inset Flex Code
15217 \begin_layout Plain Layout
15223 specifier is special and, because of implementation details, cannot be
15224 used in non-built in float types.
15225 If you do not understand what this means, just use
15226 \begin_inset Quotes eld
15230 \begin_inset Flex Code
15233 \begin_layout Plain Layout
15240 \begin_inset Quotes erd
15246 \begin_layout Description
15247 \begin_inset Flex Code
15250 \begin_layout Plain Layout
15257 \begin_inset Flex Code
15260 \begin_layout Plain Layout
15266 ] The prefix to use when creating labels referring to floats of this type.
15267 This allows the use of formatted references.
15268 Note that you can remove any
15269 \begin_inset Flex Code
15272 \begin_layout Plain Layout
15278 set by a copied style by using the special value
15279 \begin_inset Quotes eld
15283 \begin_inset Quotes erd
15286 , which must be all caps.
15289 \begin_layout Description
15290 \begin_inset Flex Code
15293 \begin_layout Plain Layout
15300 \begin_inset Flex Code
15303 \begin_layout Plain Layout
15310 \begin_inset Quotes erd
15314 \begin_inset Quotes erd
15317 ] The style used when defining the float using
15318 \begin_inset Flex Code
15321 \begin_layout Plain Layout
15332 \begin_layout Description
15333 \begin_inset Flex Code
15336 \begin_layout Plain Layout
15343 \begin_inset Flex Code
15346 \begin_layout Plain Layout
15353 \begin_inset Quotes erd
15357 \begin_inset Quotes erd
15361 \begin_inset Quotes eld
15365 \begin_inset Quotes erd
15368 of the new class of floats, like program or algorithm.
15369 After the appropriate
15370 \begin_inset Flex Code
15373 \begin_layout Plain Layout
15382 \begin_inset Flex Code
15385 \begin_layout Plain Layout
15394 \begin_inset Flex Code
15397 \begin_layout Plain Layout
15408 \begin_layout Description
15409 \begin_inset Flex Code
15412 \begin_layout Plain Layout
15419 \begin_inset Flex Code
15422 \begin_layout Plain Layout
15429 \begin_inset Flex Code
15432 \begin_layout Plain Layout
15440 ] Tells us whether this float is defined using the facilities provided by
15442 \begin_inset Flex Code
15445 \begin_layout Plain Layout
15451 , either by the class file or a package, or on-the-fly by LyX itself.
15454 \begin_layout Standard
15455 Note that defining a float with type
15456 \begin_inset Flex Code
15459 \begin_layout Plain Layout
15467 automatically defines the corresponding counter with name
15468 \begin_inset Flex Code
15471 \begin_layout Plain Layout
15482 \begin_layout Subsection
15483 Flex insets and InsetLayout
15484 \begin_inset CommandInset label
15486 name "sub:Flex-insets-and"
15493 \begin_layout Standard
15494 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
15495 these are called Flex insets.
15499 \begin_layout Standard
15500 Flex insets come in three different kinds:
15503 \begin_layout Itemize
15505 \begin_inset Flex Code
15508 \begin_layout Plain Layout
15514 ): These define semantic markup corresponding to such LaTeX commands as
15516 \begin_inset Flex Code
15519 \begin_layout Plain Layout
15528 \begin_inset Flex Code
15531 \begin_layout Plain Layout
15542 \begin_layout Itemize
15544 \begin_inset Flex Code
15547 \begin_layout Plain Layout
15553 ): These can be used to define custom collapsible insets, similar to TeX
15554 code, footnote, and the like.
15555 An obvious example is an endnote inset, which is defined in the
15556 \begin_inset Flex Code
15559 \begin_layout Plain Layout
15568 \begin_layout Itemize
15570 \begin_inset Flex Code
15573 \begin_layout Plain Layout
15579 ): For use with DocBook classes.
15582 \begin_layout Standard
15583 Flex insets are defined using the
15584 \begin_inset Flex Code
15587 \begin_layout Plain Layout
15593 tag, which shall be explained in a moment.
15596 \begin_layout Standard
15598 \begin_inset Flex Code
15601 \begin_layout Plain Layout
15607 tag also serves another function: It can be used to customize the general
15608 layout of many different types of insets.
15610 \begin_inset Flex Code
15613 \begin_layout Plain Layout
15619 can be used to customize the layout parameters for footnotes, marginal
15620 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
15621 boxes, tables, algorithms, URLs, and optional arguments, as well as to
15622 define Flex insets.
15625 \begin_layout Standard
15627 \begin_inset Flex Code
15630 \begin_layout Plain Layout
15636 definition must begin with a line of the form:
15639 \begin_layout LyX-Code
15643 \begin_layout Standard
15645 \begin_inset Flex Code
15648 \begin_layout Plain Layout
15654 indicates the inset whose layout is being defined, and here there are
15655 \change_inserted 5863208 1334489266
15657 \change_deleted 5863208 1334489267
15663 \begin_layout Enumerate
15664 The layout for a pre-existing inset is being modified.
15665 In this case, can be
15666 \begin_inset Flex Code
15669 \begin_layout Plain Layout
15675 any one of the following:
15676 \begin_inset Flex Code
15679 \begin_layout Plain Layout
15686 \begin_inset Flex Code
15689 \begin_layout Plain Layout
15696 \begin_inset Flex Code
15699 \begin_layout Plain Layout
15706 \begin_inset Flex Code
15709 \begin_layout Plain Layout
15716 \begin_inset Flex Code
15719 \begin_layout Plain Layout
15726 \begin_inset Flex Code
15729 \begin_layout Plain Layout
15736 \begin_inset Flex Code
15739 \begin_layout Plain Layout
15746 \begin_inset Flex Code
15749 \begin_layout Plain Layout
15756 \begin_inset Flex Code
15759 \begin_layout Plain Layout
15766 \begin_inset Flex Code
15769 \begin_layout Plain Layout
15776 \begin_inset Flex Code
15779 \begin_layout Plain Layout
15786 \begin_inset Flex Code
15789 \begin_layout Plain Layout
15796 \begin_inset Flex Code
15799 \begin_layout Plain Layout
15806 \begin_inset Flex Code
15809 \begin_layout Plain Layout
15816 \begin_inset Flex Code
15819 \begin_layout Plain Layout
15826 \begin_inset Flex Code
15829 \begin_layout Plain Layout
15836 \begin_inset Flex Code
15839 \begin_layout Plain Layout
15846 \begin_inset Flex Code
15849 \begin_layout Plain Layout
15851 \change_deleted -712698321 1353866704
15855 \change_inserted -712698321 1353866707
15864 \begin_inset Flex Code
15867 \begin_layout Plain Layout
15874 \begin_inset Flex Code
15877 \begin_layout Plain Layout
15886 \begin_layout Enumerate
15887 The layout for a Flex inset is being defined.
15889 \begin_inset Flex Code
15892 \begin_layout Plain Layout
15898 must be of the form
15899 \begin_inset Quotes eld
15903 \begin_inset Flex Code
15906 \begin_layout Plain Layout
15913 \begin_inset Quotes erd
15917 \begin_inset Flex Code
15920 \begin_layout Plain Layout
15926 may be be any valid identifier not used by a pre-existing Flex inset.
15927 The identifier may include spaces, but in that case the whole thing must
15928 be wrapped in quotes.
15929 Note that the definition of a flex inset
15934 \begin_inset Flex Code
15937 \begin_layout Plain Layout
15943 entry, declaring which type of inset it defines.
15944 \change_inserted 5863208 1334489312
15948 \begin_layout Enumerate
15950 \change_inserted 5863208 1334492248
15951 The layout for user specific branch is being defined.
15953 \begin_inset Flex Code
15956 \begin_layout Plain Layout
15958 \change_inserted 5863208 1334489384
15964 must be of the form
15965 \begin_inset Quotes eld
15969 \begin_inset Flex Code
15972 \begin_layout Plain Layout
15974 \change_inserted 5863208 1334489392
15981 \begin_inset Quotes erd
15985 \begin_inset Flex Code
15988 \begin_layout Plain Layout
15990 \change_inserted 5863208 1334489384
15996 may be be any valid identifier of branch defined in user's document.
15997 The identifier may include spaces, but in that case the whole thing must
15998 be wrapped in quotes.
15999 The main purpose of this feature is to allow LaTeX wrapping around specific
16000 branches as user needs.
16005 \begin_layout Standard
16007 \begin_inset Flex Code
16010 \begin_layout Plain Layout
16016 definition can contain the following entries:
16019 \begin_layout Description
16021 \change_inserted -712698321 1353681390
16022 \begin_inset Flex Code
16025 \begin_layout Plain Layout
16027 \change_inserted -712698321 1353681344
16034 \begin_inset Flex Code
16037 \begin_layout Plain Layout
16039 \change_inserted -712698321 1353681344
16045 ] Defines argument number <int> of a command\SpecialChar \slash{}
16046 environment associated with
16047 the current layout.
16048 The definition must end with
16049 \begin_inset Flex Code
16052 \begin_layout Plain Layout
16054 \change_inserted -712698321 1353681344
16062 \begin_inset space ~
16066 \begin_inset CommandInset ref
16068 reference "sub:Paragraph-Styles"
16075 \begin_layout Description
16077 \change_inserted -195340706 1333913893
16078 \begin_inset Flex Code
16081 \begin_layout Plain Layout
16087 Preamble for changing languages.
16089 \begin_inset space ~
16093 \begin_inset CommandInset ref
16095 reference "sub:I18n"
16102 \begin_layout Description
16103 \begin_inset Flex Code
16106 \begin_layout Plain Layout
16112 The color for the inset's background.
16113 The valid colors are defined in
16114 \begin_inset Flex Code
16117 \begin_layout Plain Layout
16126 \begin_layout Description
16127 \begin_inset Flex Code
16130 \begin_layout Plain Layout
16137 \begin_inset Flex Code
16140 \begin_layout Plain Layout
16149 \begin_inset Flex Code
16152 \begin_layout Plain Layout
16158 ] Whether to use the content of the inset as the label, when the inset is
16163 \begin_layout Description
16164 \begin_inset Flex Code
16167 \begin_layout Plain Layout
16174 \begin_inset Flex Code
16177 \begin_layout Plain Layout
16183 Copies all the features of an existing style into the current one.
16187 \begin_layout Description
16188 \begin_inset Flex Code
16191 \begin_layout Plain Layout
16198 \begin_inset Flex Code
16201 \begin_layout Plain Layout
16210 \begin_inset Flex Code
16213 \begin_layout Plain Layout
16219 ] Indicates whether the user may employ the Paragraph Settings dialog to
16220 customize the paragraph.
16223 \begin_layout Description
16224 \begin_inset Flex Code
16227 \begin_layout Plain Layout
16234 \begin_inset Flex Code
16237 \begin_layout Plain Layout
16244 \begin_inset Flex Code
16247 \begin_layout Plain Layout
16254 \begin_inset Flex Code
16257 \begin_layout Plain Layout
16263 , describing the rendering style used for the inset's frame and buttons.
16264 Footnotes generally use
16265 \begin_inset Flex Code
16268 \begin_layout Plain Layout
16274 , ERT insets generally
16275 \begin_inset Flex Code
16278 \begin_layout Plain Layout
16284 , and character styles
16285 \begin_inset Flex Code
16288 \begin_layout Plain Layout
16297 \begin_layout Description
16298 \begin_inset Flex Code
16301 \begin_layout Plain Layout
16308 \begin_inset Flex Code
16311 \begin_layout Plain Layout
16318 \begin_inset Flex Code
16321 \begin_layout Plain Layout
16330 \begin_inset Flex Code
16333 \begin_layout Plain Layout
16340 \begin_inset Flex Code
16343 \begin_layout Plain Layout
16350 Indicates whether the environment will stand on its own in LaTeX output
16351 or will appear inline with the surrounding text.
16352 If set to false, it is supposed that the LaTeX environment ignores white
16353 space (including one newline character) after the
16354 \begin_inset Flex Code
16357 \begin_layout Plain Layout
16370 \begin_inset Flex Code
16373 \begin_layout Plain Layout
16389 \begin_layout Description
16390 \begin_inset Flex Code
16393 \begin_layout Plain Layout
16399 Required at the end of the InsetLayout declarations.
16402 \begin_layout Description
16403 \begin_inset Flex Code
16406 \begin_layout Plain Layout
16412 The font used for both the text body
16418 \begin_inset space ~
16422 \begin_inset CommandInset ref
16424 reference "sub:Font-description"
16429 Note that defining this font automatically defines the
16430 \begin_inset Flex Code
16433 \begin_layout Plain Layout
16439 to the same value, so define this first and define
16440 \begin_inset Flex Code
16443 \begin_layout Plain Layout
16449 later if you want them to be different.
16450 \change_inserted 155139281 1354130923
16454 \begin_layout Description
16456 \change_inserted 155139281 1354130923
16457 \begin_inset Flex Code
16460 \begin_layout Plain Layout
16462 \change_inserted 155139281 1354130923
16463 ForceLocalFontSwitch
16469 \begin_inset Flex Code
16472 \begin_layout Plain Layout
16474 \change_inserted 155139281 1354130923
16483 \begin_inset Flex Code
16486 \begin_layout Plain Layout
16488 \change_inserted 155139281 1354130923
16494 ] When using babel, always use a local font switch (
16495 \begin_inset Flex Code
16498 \begin_layout Plain Layout
16500 \change_inserted 155139281 1354130923
16508 ), never a global one (such as
16509 \begin_inset Flex Code
16512 \begin_layout Plain Layout
16514 \change_inserted 155139281 1354130923
16527 \begin_layout Description
16528 \begin_inset Flex Code
16531 \begin_layout Plain Layout
16538 \begin_inset Quotes eld
16542 \begin_inset Quotes erd
16545 language, leading to Left-to-Right (latin) output, e.
16546 \begin_inset space \thinspace{}
16550 \begin_inset space \space{}
16553 in TeX code or URL.
16557 \begin_layout Description
16558 \begin_inset Flex Code
16561 \begin_layout Plain Layout
16568 \begin_inset Flex Code
16571 \begin_layout Plain Layout
16580 \begin_inset Flex Code
16583 \begin_layout Plain Layout
16589 ] Indicates whether the
16590 \begin_inset Flex Code
16593 \begin_layout Plain Layout
16599 should be used or, instead, the user can change the paragraph style used
16604 \begin_layout Description
16605 \begin_inset Flex Code
16608 \begin_layout Plain Layout
16615 \begin_inset Flex Code
16618 \begin_layout Plain Layout
16627 \begin_inset Flex Code
16630 \begin_layout Plain Layout
16636 ] Usually LyX doesn't allow you to insert more than one space between words,
16637 since a space is considered as the separation between two words, not a
16638 character or symbol of its own.
16639 This is a very fine thing but sometimes annoying, for example, when typing
16640 program code or plain LaTeX code.
16642 \begin_inset Flex Code
16645 \begin_layout Plain Layout
16652 Note that LyX will create protected blanks for the additional blanks when
16653 in another mode than LaTeX-mode.
16657 \begin_layout Description
16658 \begin_inset Flex Code
16661 \begin_layout Plain Layout
16667 These tags control XHTML output.
16669 \begin_inset CommandInset ref
16671 reference "sec:Tags-for-XHTML"
16678 \begin_layout Description
16679 \begin_inset Flex Code
16682 \begin_layout Plain Layout
16689 \begin_inset Flex Code
16692 \begin_layout Plain Layout
16701 \begin_inset Flex Code
16704 \begin_layout Plain Layout
16710 ] Whether to include the contents of this inset in the strings generated
16711 for the `Outline' pane.
16712 One would not, for example, want the content of a footnote in a section
16713 header to be included in the TOC displayed in the outline, but one would
16714 normally want the content of a character style displayed.
16715 Default is false: not to include.
16718 \begin_layout Description
16719 \begin_inset Flex Code
16722 \begin_layout Plain Layout
16729 \begin_inset Flex Code
16732 \begin_layout Plain Layout
16741 \begin_inset Flex Code
16744 \begin_layout Plain Layout
16750 ] Usually LyX does not allow you to leave a paragraph empty, since it would
16751 lead to empty LaTeX output.
16752 There are some cases where this could be desirable however: in a letter
16753 template, the required fields can be provided as empty fields, so that
16754 people do not forget them; in some special classes, a style can be used
16755 as some kind of break, which does not contain actual text.
16759 \begin_layout Description
16760 \begin_inset Flex Code
16763 \begin_layout Plain Layout
16769 The font used for the label.
16771 \begin_inset space ~
16775 \begin_inset CommandInset ref
16777 reference "sub:Font-description"
16782 Note that this definition can never appear before
16783 \begin_inset Flex Code
16786 \begin_layout Plain Layout
16792 , lest it be ineffective.
16795 \begin_layout Description
16796 \begin_inset Flex Code
16799 \begin_layout Plain Layout
16805 What will be displayed on the button or elsewhere as the inset label.
16807 \begin_inset Flex Code
16810 \begin_layout Plain Layout
16817 \begin_inset Flex Code
16820 \begin_layout Plain Layout
16826 ) modify this label on the fly.
16829 \begin_layout Description
16831 \change_inserted -195340706 1333913893
16832 \begin_inset Flex Code
16835 \begin_layout Plain Layout
16841 Language dependent preamble.
16843 \begin_inset space ~
16847 \begin_inset CommandInset ref
16849 reference "sub:I18n"
16856 \begin_layout Description
16857 \begin_inset Flex Code
16860 \begin_layout Plain Layout
16866 The name of the corresponding LaTeX stuff.
16867 Either the environment or command name.
16870 \begin_layout Description
16871 \begin_inset Flex Code
16874 \begin_layout Plain Layout
16880 The optional parameter for the corresponding
16881 \begin_inset Flex Code
16884 \begin_layout Plain Layout
16890 stuff, including possible bracket pairs like
16891 \begin_inset Flex Code
16894 \begin_layout Plain Layout
16902 \change_inserted -712698321 1355144715
16903 This will be output as is after all LaTeX
16904 \begin_inset Flex Code
16907 \begin_layout Plain Layout
16909 \change_inserted -712698321 1355144713
16918 This parameter cannot be changed from within LyX
16919 \change_inserted -712698321 1355144775
16921 \begin_inset Flex Code
16924 \begin_layout Plain Layout
16926 \change_inserted -712698321 1355144747
16932 for customizable parameters)
16937 \begin_layout Description
16938 \begin_inset Flex Code
16941 \begin_layout Plain Layout
16948 \begin_inset Flex Code
16951 \begin_layout Plain Layout
16953 \change_deleted -712698321 1353867544
16960 Command, Environment,
16961 \change_inserted -712698321 1353867573
16963 \change_deleted -712698321 1353867557
16972 \begin_inset Flex Code
16975 \begin_layout Plain Layout
16977 \change_deleted -712698321 1353867564
16981 \change_deleted -712698321 1353867569
16989 ] How the style should be translated into LaTeX.
16993 \begin_layout Plain Layout
16994 \begin_inset Flex Code
16997 \begin_layout Plain Layout
17003 is perhaps a bit misleading, since these rules apply to SGML classes, too.
17004 Visit the SGML class files for specific examples.
17013 \begin_layout Itemize
17014 \begin_inset Flex Code
17017 \begin_layout Plain Layout
17019 \change_deleted -712698321 1353867582
17021 \change_inserted -712698321 1353867583
17029 means nothing special.
17033 \begin_layout Itemize
17034 \begin_inset Flex Code
17037 \begin_layout Plain Layout
17044 \begin_inset Flex Code
17047 \begin_layout Plain Layout
17054 {\SpecialChar \ldots{}
17063 \begin_layout Itemize
17064 \begin_inset Flex Code
17067 \begin_layout Plain Layout
17074 \begin_inset Flex Code
17077 \begin_layout Plain Layout
17084 }\SpecialChar \ldots{}
17100 \begin_layout Itemize
17102 \change_deleted -712698321 1353867600
17103 \begin_inset Flex Code
17106 \begin_layout Plain Layout
17113 \begin_inset Flex Code
17116 \begin_layout Plain Layout
17123 \begin_inset Flex Code
17126 \begin_layout Plain Layout
17134 is generated for each paragraph of this environment.
17138 \begin_layout Itemize
17140 \change_deleted -712698321 1353867600
17141 \begin_inset Flex Code
17144 \begin_layout Plain Layout
17151 \begin_inset Flex Code
17154 \begin_layout Plain Layout
17161 \begin_inset Flex Code
17164 \begin_layout Plain Layout
17170 is passed as an argument to the environment.
17172 \begin_inset Flex Code
17175 \begin_layout Plain Layout
17181 can be defined in the
17182 \begin_inset Flex MenuItem
17185 \begin_layout Plain Layout
17190 \SpecialChar \menuseparator
17196 \begin_inset space ~
17210 \begin_layout Standard
17211 Putting the last few things together, the LaTeX output will be either:
17214 \begin_layout LyX-Code
17217 latexname[latexparam]{\SpecialChar \ldots{}
17221 \begin_layout Standard
17225 \begin_layout LyX-Code
17228 begin{latexname}[latexparam] \SpecialChar \ldots{}
17234 \begin_layout Standard
17235 depending upon the LaTeX type.
17239 \begin_layout Description
17241 \change_inserted -712698321 1354263128
17242 \begin_inset Flex Code
17245 \begin_layout Plain Layout
17247 \change_inserted -712698321 1353866742
17256 \begin_inset Flex Code
17259 \begin_layout Plain Layout
17261 \change_inserted -712698321 1353866752
17267 ] A string that is put at the beginning of the layout content.
17268 A line break in the output can be indicated by
17269 \begin_inset Flex Code
17272 \begin_layout Plain Layout
17274 \change_inserted -712698321 1354263128
17285 \begin_layout Description
17286 \begin_inset Flex Code
17289 \begin_layout Plain Layout
17296 \begin_inset Flex Code
17299 \begin_layout Plain Layout
17306 \begin_inset Flex Code
17309 \begin_layout Plain Layout
17316 \begin_inset Flex Code
17319 \begin_layout Plain Layout
17326 \begin_inset Flex Code
17329 \begin_layout Plain Layout
17335 (indicating a dummy definition ending definitions of charstyles, etc).
17336 This entry is required in and is only meaningful for Flex insets.
17337 Among other things, it determines on which menu this inset will appear.
17339 \begin_inset Flex Code
17342 \begin_layout Plain Layout
17349 \begin_inset Flex Code
17352 \begin_layout Plain Layout
17359 \begin_inset Flex Code
17362 \begin_layout Plain Layout
17370 \begin_inset Flex Code
17373 \begin_layout Plain Layout
17379 can be set to true for charstyle insets, if you wish, by setting it
17384 \begin_inset Flex Code
17387 \begin_layout Plain Layout
17396 \begin_layout Description
17397 \begin_inset Flex Code
17400 \begin_layout Plain Layout
17407 \begin_inset Flex Code
17410 \begin_layout Plain Layout
17419 \begin_inset Flex Code
17422 \begin_layout Plain Layout
17428 ] Whether multiple paragraphs are permitted in this inset.
17430 \begin_inset Flex Code
17433 \begin_layout Plain Layout
17439 to the same value and
17440 \begin_inset Flex Code
17443 \begin_layout Plain Layout
17449 to the opposite value.
17450 These can be reset to other values, if they are used
17455 \begin_inset Flex Code
17458 \begin_layout Plain Layout
17468 \begin_layout Description
17469 \begin_inset Flex Code
17472 \begin_layout Plain Layout
17479 \begin_inset Flex Code
17482 \begin_layout Plain Layout
17491 \begin_inset Flex Code
17494 \begin_layout Plain Layout
17500 ] Whether fragile commands in this inset should be
17501 \begin_inset Flex Code
17504 \begin_layout Plain Layout
17517 whether the command should itself be protected.) Default is false.
17520 \begin_layout Description
17521 \begin_inset Flex Code
17524 \begin_layout Plain Layout
17531 \begin_inset Flex Code
17534 \begin_layout Plain Layout
17543 \begin_inset Flex Code
17546 \begin_layout Plain Layout
17552 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
17553 output, but only by a line break; together with
17554 \begin_inset Flex Code
17557 \begin_layout Plain Layout
17563 , this allows to emulate a plain text editor (like the ERT inset).
17567 \begin_layout Description
17568 \begin_inset Flex Code
17571 \begin_layout Plain Layout
17578 \begin_inset Flex Code
17581 \begin_layout Plain Layout
17590 \begin_inset Flex Code
17593 \begin_layout Plain Layout
17599 ] Whether the contents of this paragraph should be output in raw form, meaning
17600 without special translations that LaTeX would require.
17603 \begin_layout Description
17604 \begin_inset Flex Code
17607 \begin_layout Plain Layout
17613 Information to be included in the LaTeX preamble when this style is used.
17614 Used to define macros, load packages, etc., required by this particular
17617 \begin_inset Quotes eld
17621 \begin_inset Flex Code
17624 \begin_layout Plain Layout
17631 \begin_inset Quotes erd
17637 \begin_layout Description
17638 \begin_inset Flex Code
17641 \begin_layout Plain Layout
17648 \begin_inset Flex Code
17651 \begin_layout Plain Layout
17657 ] The prefix to use when creating labels referring to insets of this type.
17658 This allows the use of formatted references.
17661 \begin_layout Description
17662 \begin_inset Flex Code
17665 \begin_layout Plain Layout
17672 \begin_inset Flex Code
17675 \begin_layout Plain Layout
17681 ] Whether the style requires the feature
17682 \begin_inset Flex Code
17685 \begin_layout Plain Layout
17692 See the description of
17693 \begin_inset Flex Code
17696 \begin_layout Plain Layout
17703 \begin_inset CommandInset ref
17704 LatexCommand pageref
17705 reference "des:FreeSpacing"
17709 ) for information on `features'.
17710 \change_inserted -712698321 1354439699
17714 \begin_layout Description
17716 \change_inserted -712698321 1354439705
17717 \begin_inset Flex Code
17720 \begin_layout Plain Layout
17722 \change_inserted -712698321 1354439699
17729 \begin_inset Flex Code
17732 \begin_layout Plain Layout
17734 \change_inserted -712698321 1354439699
17743 \begin_inset Flex Code
17746 \begin_layout Plain Layout
17748 \change_inserted -712698321 1354439699
17754 ] Resets the LaTeX arguments of this layout (as defined via the
17755 \begin_inset Flex Code
17758 \begin_layout Plain Layout
17760 \change_inserted -712698321 1354439699
17767 This is useful if you have copied a style via
17768 \begin_inset Flex Code
17771 \begin_layout Plain Layout
17773 \change_inserted -712698321 1354439699
17779 , but you do not want to inherit its (required and optional) arguments.
17781 \change_deleted -712698321 1354439698
17787 \begin_layout Description
17788 \begin_inset Flex Code
17791 \begin_layout Plain Layout
17798 \begin_inset Flex Code
17801 \begin_layout Plain Layout
17808 \begin_inset Flex Code
17811 \begin_layout Plain Layout
17819 ] Whether this inset should use the font of its surrounding environment
17821 Default is true: uses its own.
17822 \change_inserted -712698321 1353866806
17826 \begin_layout Description
17828 \change_inserted -712698321 1354263134
17829 \begin_inset Flex Code
17832 \begin_layout Plain Layout
17834 \change_inserted -712698321 1353866810
17841 \begin_inset Flex Code
17844 \begin_layout Plain Layout
17846 \change_inserted -712698321 1353866806
17852 ] A string that is put at the end of the layout content.
17853 A line break in the output can be indicated by
17854 \begin_inset Flex Code
17857 \begin_layout Plain Layout
17859 \change_inserted -712698321 1354263134
17870 \begin_layout Description
17871 \begin_inset Flex Code
17874 \begin_layout Plain Layout
17881 \begin_inset Flex Code
17884 \begin_layout Plain Layout
17891 \begin_inset Flex Code
17894 \begin_layout Plain Layout
17902 ] Spellcheck the contents of this inset.
17906 \begin_layout Subsection
17908 \begin_inset CommandInset label
17910 name "sub:Counters"
17917 \begin_layout Standard
17918 Since version 1.3.0 of LyX, it is both possible and necessary to define the
17920 \begin_inset Flex MenuItem
17923 \begin_layout Plain Layout
17930 \begin_inset Flex MenuItem
17933 \begin_layout Plain Layout
17939 , \SpecialChar \ldots{}
17940 ) in the text class itself.
17941 The standard counters are defined in the file
17942 \begin_inset Flex Code
17945 \begin_layout Plain Layout
17951 , so you may have to do no more than add
17954 \begin_layout LyX-Code
17955 Input stdcounters.inc
17958 \begin_layout Standard
17959 to your layout file to get them to work.
17960 But if you want to define custom counters, then you can do so.
17961 The counter declaration must begin with:
17964 \begin_layout LyX-Code
17965 Counter CounterName
17968 \begin_layout Standard
17970 \begin_inset Flex Code
17973 \begin_layout Plain Layout
17979 ' is replaced by the name of the counter.
17980 And it must end with
17981 \begin_inset Quotes eld
17985 \begin_inset Flex Code
17988 \begin_layout Plain Layout
17995 \begin_inset Quotes erd
17999 The following parameters can also be used:
18002 \begin_layout Description
18003 \begin_inset Flex Code
18006 \begin_layout Plain Layout
18013 \begin_inset Flex Code
18016 \begin_layout Plain Layout
18023 \begin_inset Quotes erd
18027 \begin_inset Quotes erd
18030 ] When defined, this string defines how the counter is displayed.
18031 Setting this value sets
18032 \begin_inset Flex Code
18035 \begin_layout Plain Layout
18036 LabelStringAppendix
18042 The following special constructs can be used in the string:
18046 \begin_layout Itemize
18047 \begin_inset Flex Code
18050 \begin_layout Plain Layout
18058 will be replaced by the expansion of the
18059 \begin_inset Flex Code
18062 \begin_layout Plain Layout
18069 \begin_inset Flex Code
18072 \begin_layout Plain Layout
18073 LabelStringAppendix
18079 \begin_inset Flex Code
18082 \begin_layout Plain Layout
18092 \begin_layout Itemize
18093 counter values can be expressed using LaTeX-like macros
18094 \begin_inset Flex Code
18097 \begin_layout Plain Layout
18114 \begin_inset Flex Code
18117 \begin_layout Plain Layout
18129 \begin_layout Plain Layout
18139 Actually, the situation is a bit more complicated: any
18158 other than those described below will produce arabic numerals.
18159 It would not be surprising to see this change in the future.
18165 \begin_inset Flex Code
18168 \begin_layout Plain Layout
18174 : 1, 2, 3,\SpecialChar \ldots{}
18176 \begin_inset Flex Code
18179 \begin_layout Plain Layout
18185 for lower-case letters: a, b, c, \SpecialChar \ldots{}
18187 \begin_inset Flex Code
18190 \begin_layout Plain Layout
18196 for upper-case letters: A, B, C, \SpecialChar \ldots{}
18198 \begin_inset Flex Code
18201 \begin_layout Plain Layout
18207 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
18209 \begin_inset Flex Code
18212 \begin_layout Plain Layout
18218 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
18220 \begin_inset Flex Code
18223 \begin_layout Plain Layout
18229 for hebrew numerals.
18233 \begin_layout Standard
18234 If LabelString is not defined, a default value is constructed as follows:
18235 if the counter has a master counter
18236 \begin_inset Flex Code
18239 \begin_layout Plain Layout
18246 \begin_inset Flex Code
18249 \begin_layout Plain Layout
18256 \begin_inset Flex Code
18259 \begin_layout Plain Layout
18269 is used; otherwise the string
18270 \begin_inset Flex Code
18273 \begin_layout Plain Layout
18284 \begin_layout Description
18285 \begin_inset Flex Code
18288 \begin_layout Plain Layout
18289 LabelStringAppendix
18295 \begin_inset Flex Code
18298 \begin_layout Plain Layout
18305 \begin_inset Quotes erd
18309 \begin_inset Quotes erd
18313 \begin_inset Flex Code
18316 \begin_layout Plain Layout
18322 , but for use in the Appendix.
18325 \begin_layout Description
18326 \begin_inset Flex Code
18329 \begin_layout Plain Layout
18336 \begin_inset Flex Code
18339 \begin_layout Plain Layout
18346 \begin_inset Quotes erd
18350 \begin_inset Quotes erd
18353 ] A format for use with formatted references to this counter.
18354 For example, one might want to have references to section numbers appear
18356 \begin_inset Quotes eld
18360 \begin_inset Quotes erd
18364 The string should contain
18365 \begin_inset Quotes eld
18369 \begin_inset Quotes erd
18373 This will be replaced by the counter number itself.
18374 So, for sections, it would be: Section ##.
18377 \begin_layout Description
18378 \begin_inset Flex Code
18381 \begin_layout Plain Layout
18388 \begin_inset Flex Code
18391 \begin_layout Plain Layout
18398 \begin_inset Quotes erd
18402 \begin_inset Quotes erd
18405 ] If this is set to the name of another counter, the present counter will
18406 be reset every time the other one is increased.
18408 \begin_inset Flex Code
18411 \begin_layout Plain Layout
18418 \begin_inset Flex Code
18421 \begin_layout Plain Layout
18430 \begin_layout Subsection
18432 \begin_inset CommandInset label
18434 name "sub:Font-description"
18441 \begin_layout Standard
18442 A font description looks like this:
18445 \begin_layout LyX-Code
18455 \begin_layout LyX-Code
18459 \begin_layout LyX-Code
18463 \begin_layout Standard
18464 The following commands are available:
18467 \begin_layout Description
18468 \begin_inset Flex Code
18471 \begin_layout Plain Layout
18478 \begin_inset Flex Code
18481 \begin_layout Plain Layout
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
18572 \begin_layout Description
18573 \begin_inset Flex Code
18576 \begin_layout Plain Layout
18583 \begin_inset Flex Code
18586 \begin_layout Plain Layout
18595 \begin_inset Flex Code
18598 \begin_layout Plain Layout
18605 \begin_inset Flex Code
18608 \begin_layout Plain Layout
18617 \begin_layout Description
18618 \begin_inset Flex Code
18621 \begin_layout Plain Layout
18628 \begin_inset Flex Code
18631 \begin_layout Plain Layout
18637 ] Valid arguments are:
18638 \begin_inset Flex Code
18641 \begin_layout Plain Layout
18648 \begin_inset Flex Code
18651 \begin_layout Plain Layout
18658 \begin_inset Flex Code
18661 \begin_layout Plain Layout
18668 \begin_inset Flex Code
18671 \begin_layout Plain Layout
18678 \begin_inset Flex Code
18681 \begin_layout Plain Layout
18688 \begin_inset Flex Code
18691 \begin_layout Plain Layout
18698 \begin_inset Flex Code
18701 \begin_layout Plain Layout
18708 \begin_inset Flex Code
18711 \begin_layout Plain Layout
18718 \begin_inset Flex Code
18721 \begin_layout Plain Layout
18728 \begin_inset Flex Code
18731 \begin_layout Plain Layout
18738 \begin_inset Flex Code
18741 \begin_layout Plain Layout
18748 \begin_inset Flex Code
18751 \begin_layout Plain Layout
18758 Each of these turns on or off the corresponding attribute.
18760 \begin_inset Flex Code
18763 \begin_layout Plain Layout
18769 turns on emphasis, and
18770 \begin_inset Flex Code
18773 \begin_layout Plain Layout
18781 \begin_inset Newline newline
18784 If the latter seems puzzling, remember that the font settings for the present
18785 context are generally inherited from the surrounding context.
18787 \begin_inset Flex Code
18790 \begin_layout Plain Layout
18796 would turn off the emphasis that was anyway in effect, say, in a theorem
18800 \begin_layout Description
18801 \begin_inset Flex Code
18804 \begin_layout Plain Layout
18811 \begin_inset Flex Code
18814 \begin_layout Plain Layout
18823 \begin_inset Flex Code
18826 \begin_layout Plain Layout
18835 \begin_layout Description
18836 \begin_inset Flex Code
18839 \begin_layout Plain Layout
18846 \begin_inset Flex Code
18849 \begin_layout Plain Layout
18858 \begin_inset Flex Code
18861 \begin_layout Plain Layout
18868 \begin_inset Flex Code
18871 \begin_layout Plain Layout
18878 \begin_inset Flex Code
18881 \begin_layout Plain Layout
18890 \begin_layout Description
18891 \begin_inset Flex Code
18894 \begin_layout Plain Layout
18901 \begin_inset Flex Code
18904 \begin_layout Plain Layout
18911 \begin_inset Flex Code
18914 \begin_layout Plain Layout
18921 \begin_inset Flex Code
18924 \begin_layout Plain Layout
18933 \begin_inset Flex Code
18936 \begin_layout Plain Layout
18943 \begin_inset Flex Code
18946 \begin_layout Plain Layout
18953 \begin_inset Flex Code
18956 \begin_layout Plain Layout
18963 \begin_inset Flex Code
18966 \begin_layout Plain Layout
18973 \begin_inset Flex Code
18976 \begin_layout Plain Layout
18985 \begin_layout Subsection
18986 \begin_inset CommandInset label
18988 name "sub:Citation-format-description"
18992 Citation format description
18995 \begin_layout Standard
18997 \begin_inset Flex Code
19000 \begin_layout Plain Layout
19006 blocks are used to describe how bibliographic information should be displayed,
19007 both within LyX itself (in the citation dialog and in tooltips, for example)
19008 and in XHTML output.
19009 Such a block might look like this:
19012 \begin_layout LyX-Code
19016 \begin_layout LyX-Code
19020 \begin_layout LyX-Code
19024 \begin_layout LyX-Code
19028 \begin_layout Standard
19029 The individual lines define how the bibliographic information associated
19030 with an article or book, respectively, is to be displayed, and such a definitio
19031 n can be given for any `entry type' that might be present in a BibTeX file.
19032 LyX defines a default format in the source code that will be used if no
19033 specific definition has been given.
19034 LyX predefines several formats in the file
19035 \begin_inset Flex Code
19038 \begin_layout Plain Layout
19044 , which is included in most of LyX's document classes.
19047 \begin_layout Standard
19048 The definitions use a simple language that allows BibTeX keys to be replaced
19050 Keys should be enclosed in
19051 \begin_inset Flex Code
19054 \begin_layout Plain Layout
19061 \begin_inset Flex Code
19064 \begin_layout Plain Layout
19071 So a simple definition might look like this:
19074 \begin_layout LyX-Code
19076 \begin_inset Quotes eld
19080 \begin_inset Quotes erd
19086 \begin_layout Standard
19087 This would print the author, followed by a comma, followed by the title,
19088 in quotes, followed by a period.
19091 \begin_layout Standard
19092 Of course, sometimes you may want to print a key only if it exists.
19093 This can be done by using a conditional construction, such as:
19094 \begin_inset Flex Code
19097 \begin_layout Plain Layout
19099 \begin_inset space ~
19109 \begin_inset Flex Code
19112 \begin_layout Plain Layout
19118 key exists, then print
19119 \begin_inset Quotes eld
19123 \begin_inset space ~
19127 \begin_inset Quotes erd
19130 followed by the volume key.
19131 It is also possible to have an else clause in the conditional, such as:
19133 \begin_inset Flex Code
19136 \begin_layout Plain Layout
19137 {%author%[[%author%]][[%editor%, ed.]]}
19144 \begin_inset Flex Code
19147 \begin_layout Plain Layout
19153 key is printed if it exists; otherwise, the editor key is printed, followed
19155 \begin_inset Quotes eld
19159 \begin_inset space ~
19163 \begin_inset Quotes erd
19166 Note that the key is again enclosed in
19167 \begin_inset Flex Code
19170 \begin_layout Plain Layout
19176 signs; the entire conditional is enclosed in braces; and the if and else
19177 clauses are enclosed in double brackets,
19178 \begin_inset Quotes eld
19182 \begin_inset Flex Code
19185 \begin_layout Plain Layout
19192 \begin_inset Quotes eld
19196 \begin_inset Quotes eld
19200 \begin_inset Flex Code
19203 \begin_layout Plain Layout
19210 \begin_inset Quotes erd
19214 There must be no space between any of these.
19217 \begin_layout Standard
19218 There is one other piece of syntax available in definitions, which looks
19220 \begin_inset Flex Code
19223 \begin_layout Plain Layout
19230 This defines a piece of formatting information that is to be used when
19232 \begin_inset Quotes eld
19236 \begin_inset Quotes erd
19240 Obviously, we do not want to output HTML tags when writing plain text,
19241 so they should be wrapped in
19242 \begin_inset Quotes eld
19246 \begin_inset Quotes erd
19250 \begin_inset Quotes eld
19254 \begin_inset Quotes erd
19260 \begin_layout Standard
19261 Two special sorts of definitions are also possible in a
19262 \begin_inset Flex Code
19265 \begin_layout Plain Layout
19272 An example of the first would be:
19275 \begin_layout LyX-Code
19277 \begin_inset Quotes eld
19281 \begin_inset Quotes erd
19287 \begin_layout Standard
19288 This is an abbreviation, or macro, and it can be used by treating it as
19290 \begin_inset Flex Code
19293 \begin_layout Plain Layout
19301 \begin_inset Flex Code
19304 \begin_layout Plain Layout
19310 exactly as it would treat its definition.
19311 So, let us issue the obvious
19319 \begin_layout LyX-Code
19323 \begin_layout Standard
19324 or anything like it.
19325 LyX shouldn't go into an infinite loop, but it may go into a long one before
19329 \begin_layout Standard
19330 The second sort of special definition might look like this:
19333 \begin_layout LyX-Code
19337 \begin_layout Standard
19338 This defines a translatable piece of text, which allows relevant parts of
19339 the bibliography to be translated.
19340 It can be included in a definition by treating it as a key:
19341 \begin_inset Flex Code
19344 \begin_layout Plain Layout
19351 Several of these are predefined in
19352 \begin_inset Flex Code
19355 \begin_layout Plain Layout
19362 Note that these are not macros, in the sense just defined.
19363 They will not be expanded.
19366 \begin_layout Standard
19367 So here then is an example that use all these features:
19370 \begin_layout LyX-Code
19371 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
19374 \begin_layout Standard
19375 This defines a macro that prints the author, followed by a comma, if the
19377 \begin_inset Flex Code
19380 \begin_layout Plain Layout
19386 key is defined, or else prints the name of the editor, followed by the
19388 \begin_inset Flex Code
19391 \begin_layout Plain Layout
19397 or its translation (it is by default
19398 \begin_inset Quotes eld
19402 \begin_inset Quotes erd
19406 \begin_inset Flex Code
19409 \begin_layout Plain Layout
19416 Note that this is in fact defined in
19417 \begin_inset Flex Code
19420 \begin_layout Plain Layout
19426 , so you can use it in your own definitions, or re-definitions, if you load
19430 \begin_layout Section
19431 \begin_inset CommandInset label
19433 name "sec:Tags-for-XHTML"
19437 Tags for XHTML output
19440 \begin_layout Standard
19441 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
19442 by layout information.
19443 In general, LyX provides sensible defaults and, as mentioned earlier, it
19444 will even construct default CSS style rules from the other layout tags.
19445 For example, LyX will attempt to use the information provided in the
19446 \begin_inset Flex Code
19449 \begin_layout Plain Layout
19455 declaration for the Chapter style to write CSS that will appropriately
19456 format chapter headings.
19459 \begin_layout Standard
19460 In many cases, then, you may not have to do anything at all to get acceptable
19461 XHTML output for your own environments, custom insets, and so forth.
19462 But in some cases you will, and so LyX provides a number of layout tags
19463 that can be used to customize the XHTML and CSS that are generated.
19466 \begin_layout Standard
19467 Note that there are two tags,
19468 \begin_inset Flex Code
19471 \begin_layout Plain Layout
19478 \begin_inset Flex Code
19481 \begin_layout Plain Layout
19487 that may appear outside style and inset declarations.
19489 \begin_inset CommandInset ref
19491 reference "sub:General-text-class"
19495 for details on these.
19498 \begin_layout Subsection
19499 \begin_inset CommandInset label
19501 name "sub:Paragraph-Style-XHTML"
19508 \begin_layout Standard
19509 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
19510 dealing with a normal paragraph, a command, or an environment, where this
19511 is itself determined by the contents of the corresponding
19512 \begin_inset Flex Code
19515 \begin_layout Plain Layout
19525 \begin_layout Standard
19526 For a command or normal paragraph, the output XHTML has the following form:
19529 \begin_layout LyX-Code
19531 \begin_inset Quotes erd
19535 \begin_inset Quotes erd
19541 \begin_layout LyX-Code
19543 \begin_inset Quotes erd
19547 \begin_inset Quotes erd
19553 \begin_layout LyX-Code
19554 Contents of the paragraph.
19557 \begin_layout LyX-Code
19561 \begin_layout Standard
19562 The label tags are of course omitted if the paragraph does not have a label.
19565 \begin_layout Standard
19566 For an environment that is not some sort of list, the XHTML takes this form:
19569 \begin_layout LyX-Code
19571 \begin_inset Quotes erd
19575 \begin_inset Quotes erd
19581 \begin_layout LyX-Code
19583 \begin_inset Quotes erd
19587 \begin_inset Quotes erd
19591 \begin_inset Quotes erd
19595 \begin_inset Quotes erd
19598 >Environment Label</labeltag>First paragraph.</itemtag>
19601 \begin_layout LyX-Code
19602 <itemtag>Second paragraph.</itemtag>
19605 \begin_layout LyX-Code
19609 \begin_layout Standard
19610 Note that the label is output only for the first paragraph, as it should
19611 be for a theorem, for example.
19615 \begin_layout Standard
19616 For a list, we have one of these forms:
19619 \begin_layout LyX-Code
19621 \begin_inset Quotes erd
19625 \begin_inset Quotes erd
19631 \begin_layout LyX-Code
19633 \begin_inset Quotes erd
19637 \begin_inset Quotes erd
19641 \begin_inset Quotes erd
19645 \begin_inset Quotes erd
19648 >List Label</labeltag>First item.</itemtag>
19651 \begin_layout LyX-Code
19653 \begin_inset Quotes erd
19657 \begin_inset Quotes erd
19661 \begin_inset Quotes erd
19665 \begin_inset Quotes erd
19668 >List Label</labeltag>Second item.</itemtag>
19671 \begin_layout LyX-Code
19675 \begin_layout LyX-Code
19679 \begin_layout LyX-Code
19681 \begin_inset Quotes erd
19685 \begin_inset Quotes erd
19691 \begin_layout LyX-Code
19693 \begin_inset Quotes erd
19697 \begin_inset Quotes erd
19700 >List Label</labeltag><itemtag attr=
19701 \begin_inset Quotes erd
19705 \begin_inset Quotes erd
19708 >First item.</itemtag>
19711 \begin_layout LyX-Code
19713 \begin_inset Quotes erd
19717 \begin_inset Quotes erd
19720 >List Label</labeltag><itemtag attr=
19721 \begin_inset Quotes erd
19725 \begin_inset Quotes erd
19728 >Second item.</itemtag>
19731 \begin_layout LyX-Code
19735 \begin_layout Standard
19736 Note the different orders of
19737 \begin_inset Flex Code
19740 \begin_layout Plain Layout
19747 \begin_inset Flex Code
19750 \begin_layout Plain Layout
19757 Which order we get depends upon the setting of
19758 \begin_inset Flex Code
19761 \begin_layout Plain Layout
19768 \begin_inset Flex Code
19771 \begin_layout Plain Layout
19777 is false (the default), you get the first of these, with the label within
19778 the item; if true, you get the second, with the label outside the item.
19781 \begin_layout Standard
19782 The specific tags and attributes output for each paragraph type can be controlle
19783 d by means of the layout tags we are about to describe.
19784 As mentioned earlier, however, LyX uses sensible defaults for many of these,
19785 so you often may not need to do very much to get good XHTML output.
19786 Think of the available tags as there so you can tweak things to your liking.
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 ] Specifies attribute information to be output with the main tag.
19811 \begin_inset Quotes eld
19815 \begin_inset Flex Code
19818 \begin_layout Plain Layout
19825 \begin_inset Quotes erd
19829 By default, LyX will output
19830 \begin_inset Quotes eld
19834 \begin_inset Flex Code
19837 \begin_layout Plain Layout
19844 \begin_inset Quotes erd
19848 \begin_inset Flex Code
19851 \begin_layout Plain Layout
19857 is the LyX name of the layout, made lowercase, for example: chapter.
19862 contain any style information.
19864 \begin_inset Flex Code
19867 \begin_layout Plain Layout
19876 \begin_layout Description
19877 \begin_inset Flex Code
19880 \begin_layout Plain Layout
19887 \begin_inset Flex Code
19890 \begin_layout Plain Layout
19900 ] Whether to output the default CSS information LyX generates for this layout,
19901 even if additional information is explicitly provided via
19902 \begin_inset Flex Code
19905 \begin_layout Plain Layout
19913 \begin_inset Flex Code
19916 \begin_layout Plain Layout
19922 allows you to alter or augment the generated CSS, rather than to override
19925 \begin_inset Flex Code
19928 \begin_layout Plain Layout
19937 \begin_layout Description
19938 \begin_inset Flex Code
19941 \begin_layout Plain Layout
19948 \begin_inset Flex Code
19951 \begin_layout Plain Layout
19957 ] The tag to be used for individual paragraphs of environments, replacing
19959 \begin_inset Flex Code
19962 \begin_layout Plain Layout
19968 in the examples above.
19970 \begin_inset Flex Code
19973 \begin_layout Plain Layout
19982 \begin_layout Description
19983 \begin_inset Flex Code
19986 \begin_layout Plain Layout
19993 \begin_inset Flex Code
19996 \begin_layout Plain Layout
20002 ] Attributes for the item tag.
20004 \begin_inset Quotes eld
20008 \begin_inset Flex Code
20011 \begin_layout Plain Layout
20012 class=`layoutname_item'
20018 \begin_inset Quotes erd
20026 contain any style information.
20028 \begin_inset Flex Code
20031 \begin_layout Plain Layout
20040 \begin_layout Description
20041 \begin_inset Flex Code
20044 \begin_layout Plain Layout
20051 \begin_inset Flex Code
20054 \begin_layout Plain Layout
20060 ] The tag to be used for paragraph and item labels, replacing
20061 \begin_inset Flex Code
20064 \begin_layout Plain Layout
20070 in the examples above.
20072 \begin_inset Flex Code
20075 \begin_layout Plain Layout
20082 \begin_inset Flex Code
20085 \begin_layout Plain Layout
20092 \begin_inset Flex Code
20095 \begin_layout Plain Layout
20102 \begin_inset Flex Code
20105 \begin_layout Plain Layout
20106 Centered_Top_Environment
20111 , in which case it defaults to
20112 \begin_inset Flex Code
20115 \begin_layout Plain Layout
20124 \begin_layout Description
20125 \begin_inset Flex Code
20128 \begin_layout Plain Layout
20135 \begin_inset Flex Code
20138 \begin_layout Plain Layout
20144 ] Attributes for the label tag.
20146 \begin_inset Quotes eld
20150 \begin_inset Flex Code
20153 \begin_layout Plain Layout
20154 class=`layoutname_label'
20160 \begin_inset Quotes erd
20168 contain any style information.
20170 \begin_inset Flex Code
20173 \begin_layout Plain Layout
20182 \begin_layout Description
20183 \begin_inset Flex Code
20186 \begin_layout Plain Layout
20193 \begin_inset Flex Code
20196 \begin_layout Plain Layout
20206 ] Meaningful only for list-like environments, this tag controls whether
20207 the label tag is output before or inside the item tag.
20208 This is used, for example, in the description environment, where we want
20210 \begin_inset Flex Code
20213 \begin_layout Plain Layout
20214 <dt>\SpecialChar \ldots{}
20215 </dt><dd>\SpecialChar \ldots{}
20223 \begin_inset Flex Code
20226 \begin_layout Plain Layout
20232 : The label tag is output inside the item tag.
20235 \begin_layout Description
20236 \begin_inset Flex Code
20239 \begin_layout Plain Layout
20245 Information to be output in the
20246 \begin_inset Flex Code
20249 \begin_layout Plain Layout
20255 section when this style is used.
20256 This might, for example, be used to include a
20257 \begin_inset Flex Code
20260 \begin_layout Plain Layout
20267 \begin_inset Flex Code
20270 \begin_layout Plain Layout
20279 \begin_layout Description
20280 \begin_inset Flex Code
20283 \begin_layout Plain Layout
20289 CSS style information to be included when this style is used.
20290 Note that this will automatically be wrapped in a layout-generated
20291 \begin_inset Flex Code
20294 \begin_layout Plain Layout
20300 block, so only the CSS itself need be included.
20303 \begin_layout Description
20304 \begin_inset Flex Code
20307 \begin_layout Plain Layout
20314 \begin_inset Flex Code
20317 \begin_layout Plain Layout
20323 ] The tag to be used for the main label, replacing
20324 \begin_inset Flex Code
20327 \begin_layout Plain Layout
20333 in the examples above.
20335 \begin_inset Flex Code
20338 \begin_layout Plain Layout
20347 \begin_layout Description
20348 \begin_inset Flex Code
20351 \begin_layout Plain Layout
20358 \begin_inset Flex Code
20361 \begin_layout Plain Layout
20371 ] Marks this style as the one to be used to generate the
20372 \begin_inset Flex Code
20375 \begin_layout Plain Layout
20381 tag for the XHTML file.
20382 By default, it is false.
20384 \begin_inset Flex Code
20387 \begin_layout Plain Layout
20393 file sets it to true for the
20394 \begin_inset Flex Code
20397 \begin_layout Plain Layout
20407 \begin_layout Subsection
20411 \begin_layout Standard
20412 The XHTML output of insets can also be controlled by information in layout
20417 \begin_layout Plain Layout
20418 At present, this is true only for
20419 \begin_inset Quotes eld
20423 \begin_inset Quotes erd
20426 insets (insets you can type into) and is not true for
20427 \begin_inset Quotes eld
20431 \begin_inset Quotes erd
20434 insets (insets that are associated with dialog boxes).
20439 Here, too, LyX tries to provide sensible defaults, and it constructs default
20441 But everything can be customized.
20444 \begin_layout Standard
20445 The XHTML LyX outputs for an inset has the following form:
20448 \begin_layout LyX-Code
20450 \begin_inset Quotes erd
20454 \begin_inset Quotes erd
20460 \begin_layout LyX-Code
20461 <labeltag>Label</labeltag>
20464 \begin_layout LyX-Code
20466 \begin_inset Quotes erd
20470 \begin_inset Quotes erd
20473 >Contents of the inset.</innertag>
20476 \begin_layout LyX-Code
20480 \begin_layout Standard
20481 If the inset permits multiple paragraphs---that is, if
20482 \begin_inset Flex Code
20485 \begin_layout Plain Layout
20491 is true---then the contents of the inset will itself be output as paragraphs
20492 formatted according to the styles used for those paragraphs (standard,
20493 quote, and the like).
20494 The label tag is of course omitted if the paragraph does not have a label
20495 and, at present, is always
20496 \begin_inset Flex Code
20499 \begin_layout Plain Layout
20506 The inner tag is optional and, by default, does not appear.
20509 \begin_layout Standard
20510 The specific tags and attributes output for each inset can be controlled
20511 by means of the following layout tags.
20514 \begin_layout Description
20515 \begin_inset Flex Code
20518 \begin_layout Plain Layout
20525 \begin_inset Flex Code
20528 \begin_layout Plain Layout
20534 ] Specifies attribute information to be output with the main tag.
20536 \begin_inset Quotes eld
20540 \begin_inset Flex Code
20543 \begin_layout Plain Layout
20544 class=`myinset' onclick=`\SpecialChar \ldots{}
20551 \begin_inset Quotes erd
20555 By default, LyX will output
20556 \begin_inset Quotes eld
20560 \begin_inset Flex Code
20563 \begin_layout Plain Layout
20570 \begin_inset Quotes erd
20574 \begin_inset Flex Code
20577 \begin_layout Plain Layout
20583 is the LyX name of the inset, made lowercase and with non-alphanumeric
20584 characters converted to underscores, for example: footnote.
20587 \begin_layout Description
20588 \begin_inset Flex Code
20591 \begin_layout Plain Layout
20598 \begin_inset Flex Code
20601 \begin_layout Plain Layout
20611 ] Whether to output the default CSS information LyX generates for this layout,
20612 even if additional information is explicitly provided via
20613 \begin_inset Flex Code
20616 \begin_layout Plain Layout
20624 \begin_inset Flex Code
20627 \begin_layout Plain Layout
20633 allows you to alter or augment the generated CSS, rather than to override
20638 \begin_layout Description
20639 \begin_inset Flex Code
20642 \begin_layout Plain Layout
20649 \begin_inset Flex Code
20652 \begin_layout Plain Layout
20658 ] Attributes for the inner tag.
20660 \begin_inset Quotes eld
20664 \begin_inset Flex Code
20667 \begin_layout Plain Layout
20668 class=`insetname_inner'
20674 \begin_inset Quotes erd
20680 \begin_layout Description
20681 \begin_inset Flex Code
20684 \begin_layout Plain Layout
20691 \begin_inset Flex Code
20694 \begin_layout Plain Layout
20700 ] The inner tag, replacing
20701 \begin_inset Flex Code
20704 \begin_layout Plain Layout
20710 in the examples above.
20711 By default, there is none.
20714 \begin_layout Description
20715 \begin_inset Flex Code
20718 \begin_layout Plain Layout
20725 \begin_inset Flex Code
20728 \begin_layout Plain Layout
20736 ] Whether this inset represents a standalone block of text (such as a footnote)
20737 or instead represents material that is included in the surrounding text
20738 (such as a branch).
20742 \begin_layout Description
20743 \begin_inset Flex Code
20746 \begin_layout Plain Layout
20753 \begin_inset Flex Code
20756 \begin_layout Plain Layout
20762 ] A label for this inset, possibly including a reference to a counter.
20763 For example, for footnote, it might be:
20764 \begin_inset Flex Code
20767 \begin_layout Plain Layout
20776 This is optional, and there is no default.
20779 \begin_layout Description
20780 \begin_inset Flex Code
20783 \begin_layout Plain Layout
20789 Information to be output in the
20790 \begin_inset Flex Code
20793 \begin_layout Plain Layout
20799 section when this style is used.
20800 This might, for example, be used to include a
20801 \begin_inset Flex Code
20804 \begin_layout Plain Layout
20811 \begin_inset Flex Code
20814 \begin_layout Plain Layout
20823 \begin_layout Description
20824 \begin_inset Flex Code
20827 \begin_layout Plain Layout
20833 CSS style information to be included when this style is used.
20834 Note that this will automatically be wrapped in a layout-generated
20835 \begin_inset Flex Code
20838 \begin_layout Plain Layout
20844 block, so only the CSS itself need be included.
20847 \begin_layout Description
20848 \begin_inset Flex Code
20851 \begin_layout Plain Layout
20858 \begin_inset Flex Code
20861 \begin_layout Plain Layout
20867 ] The tag to be used for the main label, replacing
20868 \begin_inset Flex Code
20871 \begin_layout Plain Layout
20877 in the examples above.
20878 The default depends upon the setting of
20879 \begin_inset Flex Code
20882 \begin_layout Plain Layout
20889 \begin_inset Flex Code
20892 \begin_layout Plain Layout
20898 is true, the default is
20899 \begin_inset Flex Code
20902 \begin_layout Plain Layout
20908 ; if it is false, the default is
20909 \begin_inset Flex Code
20912 \begin_layout Plain Layout
20921 \begin_layout Subsection
20925 \begin_layout Standard
20926 The XHTML output for floats too can be controlled by layout information.
20927 The output has the following form:
20930 \begin_layout LyX-Code
20932 \begin_inset Quotes erd
20936 \begin_inset Quotes erd
20942 \begin_layout LyX-Code
20943 Contents of the float.
20946 \begin_layout LyX-Code
20950 \begin_layout Standard
20951 The caption, if there is one, is a separate inset and will be output as
20953 Its appearance can be controlled via the InsetLayout for caption insets.
20957 \begin_layout Description
20958 \begin_inset Flex Code
20961 \begin_layout Plain Layout
20968 \begin_inset Flex Code
20971 \begin_layout Plain Layout
20977 ] Specifies attribute information to be output with the main tag.
20979 \begin_inset Quotes eld
20983 \begin_inset Flex Code
20986 \begin_layout Plain Layout
20987 class=`myfloat' onclick=`\SpecialChar \ldots{}
20994 \begin_inset Quotes erd
20998 By default, LyX will output
20999 \begin_inset Quotes eld
21003 \begin_inset Flex Code
21006 \begin_layout Plain Layout
21007 class=`float float-floattype'
21013 \begin_inset Quotes erd
21017 \begin_inset Flex Code
21020 \begin_layout Plain Layout
21026 is LyX's name for this type of float, as determined by the float declaration
21028 \begin_inset CommandInset ref
21030 reference "sub:Floats"
21034 ), though made lowercase and with non-alphanumeric characters converted
21035 to underscores, for example: float-table.
21038 \begin_layout Description
21039 \begin_inset Flex Code
21042 \begin_layout Plain Layout
21048 CSS style information to be included when this float is used.
21049 Note that this will automatically be wrapped in a layout-generated
21050 \begin_inset Flex Code
21053 \begin_layout Plain Layout
21059 block, so only the CSS itself need be included.
21062 \begin_layout Description
21063 \begin_inset Flex Code
21066 \begin_layout Plain Layout
21073 \begin_inset Flex Code
21076 \begin_layout Plain Layout
21082 ] The tag to be used for this float, replacing
21083 \begin_inset Quotes eld
21087 \begin_inset Flex Code
21090 \begin_layout Plain Layout
21097 \begin_inset Quotes erd
21100 in the example above.
21102 \begin_inset Flex Code
21105 \begin_layout Plain Layout
21111 and will rarely need changing.
21114 \begin_layout Subsection
21115 Bibliography formatting
21118 \begin_layout Standard
21119 The bibliography can be formatted using
21120 \begin_inset Flex Code
21123 \begin_layout Plain Layout
21131 \begin_inset CommandInset ref
21133 reference "sub:Citation-format-description"
21140 \begin_layout Subsection
21144 \begin_layout Standard
21145 We have several times mentioned that LyX will generate default CSS style
21146 rules for both insets and paragraph styles, based upon the other layout
21147 information that is provided.
21148 In this section, we shall say a word about which layout information LyX
21152 \begin_layout Standard
21153 At present, LyX auto-generates CSS only for font information, making use
21155 \begin_inset Flex Code
21158 \begin_layout Plain Layout
21165 \begin_inset Flex Code
21168 \begin_layout Plain Layout
21175 \begin_inset Flex Code
21178 \begin_layout Plain Layout
21185 \begin_inset Flex Code
21188 \begin_layout Plain Layout
21195 \begin_inset Flex Code
21198 \begin_layout Plain Layout
21206 \begin_inset CommandInset ref
21208 reference "sub:Font-description"
21212 .) The translation is mostly straightforward and obvious.
21214 \begin_inset Quotes eld
21218 \begin_inset Flex Code
21221 \begin_layout Plain Layout
21228 \begin_inset Quotes erd
21232 \begin_inset Quotes eld
21236 \begin_inset Flex Code
21239 \begin_layout Plain Layout
21240 font-family: sans-serif;
21246 \begin_inset Quotes erd
21250 The correspondence of LyX sizes and CSS sizes is a little less obvious
21251 but nonetheless intuitive.
21253 \begin_inset Flex Code
21256 \begin_layout Plain Layout
21263 \begin_inset Flex URL
21266 \begin_layout Plain Layout
21276 \begin_layout Chapter
21277 Including External Material
21280 \begin_layout Standard
21281 \begin_inset Box Shadowbox
21291 height_special "totalheight"
21294 \begin_layout Plain Layout
21295 WARNING: This portion of the documentation has not been updated for some
21297 We certainly hope that it is still accurate, but there are no guarantees.
21305 \begin_layout Standard
21306 The use of material from sources external to LyX is covered in detail in
21312 This part of the manual covers what needs to happen behind the scenes for
21313 new sorts of material to be included.
21316 \begin_layout Section
21320 \begin_layout Standard
21321 The external material feature is based on the concept of a
21326 A template is a specification of how LyX should interface with a certain
21328 As bundled, LyX comes with predefined templates for Xfig figures, various
21329 raster format images, chess diagrams, and LilyPond music notation.
21330 You can check the actual list by using the menu
21331 \begin_inset Flex MenuItem
21334 \begin_layout Plain Layout
21335 Insert\SpecialChar \menuseparator
21336 File\SpecialChar \menuseparator
21343 Furthermore, it is possible to roll your own template to support a specific
21345 Later we'll describe in more detail what is involved, and hopefully you
21346 will submit all the templates you create so we can include them in a later
21350 \begin_layout Standard
21351 Another basic idea of the external material feature is to distinguish between
21352 the original file that serves as a base for final material and the produced
21353 file that is included in your exported or printed document.
21354 For example, consider the case of a figure produced with
21355 \begin_inset Flex Code
21358 \begin_layout Plain Layout
21365 The Xfig application itself works on an original file with the
21366 \begin_inset Flex Code
21369 \begin_layout Plain Layout
21376 Within Xfig, you create and change your figure, and when you are done,
21378 \begin_inset Flex Code
21381 \begin_layout Plain Layout
21388 When you want to include the figure in your document, you invoke
21389 \begin_inset Flex Code
21392 \begin_layout Plain Layout
21398 in order to create a PostScript file that can readily be included in your
21401 \begin_inset Flex Code
21404 \begin_layout Plain Layout
21410 file is the original file, and the PostScript file is the produced file.
21413 \begin_layout Standard
21414 This distinction is important in order to allow updating of the material
21415 while you are in the process of writing the document.
21416 Furthermore, it provides us with the flexibility that is needed to support
21417 multiple export formats.
21418 For instance, in the case of a plain text file, it is not exactly an award-winn
21419 ing idea to include the figure as raw PostScript.
21420 Instead, you would either prefer to just include a reference to the figure
21421 or try to invoke some graphics to ASCII converter to make the final result
21422 look similar to the real graphics.
21423 The external material management allows you to do this, because it is parametri
21424 zed on the different export formats that LyX supports.
21427 \begin_layout Standard
21428 Besides supporting the production of different products according to the
21429 exported format, it supports tight integration with editing and viewing
21431 In the case of an Xfig figure, you are able to invoke Xfig on the original
21432 file with a single click from within the external material dialog in LyX,
21433 and also preview the produced PostScript file with Ghostview with another
21435 No more fiddling around with the command line and/or file browsers to locate
21436 and manipulate the original or produced files.
21437 In this way, you are finally able to take full advantage of the many different
21438 applications that are relevant to use when you write your documents, and
21439 ultimately be more productive.
21442 \begin_layout Section
21443 The external template configuration file
21446 \begin_layout Standard
21447 It is relatively easy to add custom external template definitions to LyX.
21448 However, be aware that doing this in an careless manner most probably
21452 introduce an easily exploitable security hole.
21453 So before you do this, please read the discussion about security in section
21455 \begin_inset CommandInset ref
21457 reference "sec:Security-discussion"
21464 \begin_layout Standard
21465 Having said that, we encourage you to submit any interesting templates that
21470 \begin_layout Standard
21471 The external templates are defined in the
21472 \begin_inset Flex Code
21475 \begin_layout Plain Layout
21476 LyXDir/lib/external_templates
21482 You can place your own version in
21483 \begin_inset Flex Code
21486 \begin_layout Plain Layout
21487 UserDir/external_templates
21495 \begin_layout Standard
21496 A typical template looks like this:
21499 \begin_layout LyX-Code
21503 \begin_layout LyX-Code
21504 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
21507 \begin_layout LyX-Code
21511 \begin_layout LyX-Code
21515 \begin_layout LyX-Code
21519 \begin_layout LyX-Code
21523 \begin_layout LyX-Code
21527 \begin_layout LyX-Code
21528 AutomaticProduction true
21531 \begin_layout LyX-Code
21535 \begin_layout LyX-Code
21539 \begin_layout LyX-Code
21543 \begin_layout LyX-Code
21544 TransformCommand Rotate RotationLatexCommand
21547 \begin_layout LyX-Code
21548 TransformCommand Resize ResizeLatexCommand
21551 \begin_layout LyX-Code
21552 Product "$$RotateFront$$ResizeFront
21555 \begin_layout LyX-Code
21560 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
21563 \begin_layout LyX-Code
21564 $$ResizeBack$$RotateBack"
21567 \begin_layout LyX-Code
21571 \begin_layout LyX-Code
21572 UpdateResult "$$AbsPath$$Basename.pstex_t"
21575 \begin_layout LyX-Code
21576 Requirement "graphicx"
21579 \begin_layout LyX-Code
21580 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
21583 \begin_layout LyX-Code
21584 ReferencedFile latex "$$AbsPath$$Basename.eps"
21587 \begin_layout LyX-Code
21588 ReferencedFile dvi "$$AbsPath$$Basename.eps"
21591 \begin_layout LyX-Code
21595 \begin_layout LyX-Code
21599 \begin_layout LyX-Code
21600 TransformCommand Rotate RotationLatexCommand
21603 \begin_layout LyX-Code
21604 TransformCommand Resize ResizeLatexCommand
21607 \begin_layout LyX-Code
21608 Product "$$RotateFront$$ResizeFront
21611 \begin_layout LyX-Code
21616 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
21619 \begin_layout LyX-Code
21620 $$ResizeBack$$RotateBack"
21623 \begin_layout LyX-Code
21624 UpdateFormat pdftex
21627 \begin_layout LyX-Code
21628 UpdateResult "$$AbsPath$$Basename.pdftex_t"
21631 \begin_layout LyX-Code
21632 Requirement "graphicx"
21635 \begin_layout LyX-Code
21636 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
21639 \begin_layout LyX-Code
21640 ReferencedFile latex "$$AbsPath$$Basename.pdf"
21643 \begin_layout LyX-Code
21647 \begin_layout LyX-Code
21651 \begin_layout LyX-Code
21652 Product "$$Contents(
21654 "$$AbsPath$$Basename.asc
21659 \begin_layout LyX-Code
21660 UpdateFormat asciixfig
21663 \begin_layout LyX-Code
21664 UpdateResult "$$AbsPath$$Basename.asc"
21667 \begin_layout LyX-Code
21671 \begin_layout LyX-Code
21675 \begin_layout LyX-Code
21676 Product "<graphic fileref=
21678 "$$AbsOrRelPathMaster$$Basename.eps
21683 \begin_layout LyX-Code
21687 \begin_layout LyX-Code
21691 \begin_layout LyX-Code
21692 UpdateResult "$$AbsPath$$Basename.eps"
21695 \begin_layout LyX-Code
21696 ReferencedFile docbook "$$AbsPath$$Basename.eps"
21699 \begin_layout LyX-Code
21700 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
21703 \begin_layout LyX-Code
21707 \begin_layout LyX-Code
21708 Product "[XFig: $$FName]"
21711 \begin_layout LyX-Code
21715 \begin_layout LyX-Code
21719 \begin_layout Standard
21720 As you can see, the template is enclosed in
21721 \begin_inset Flex Code
21724 \begin_layout Plain Layout
21730 \SpecialChar \ldots{}
21732 \begin_inset Flex Code
21735 \begin_layout Plain Layout
21742 It contains a header specifying some general settings and, for each supported
21743 primary document file format, a section
21744 \begin_inset Flex Code
21747 \begin_layout Plain Layout
21753 \SpecialChar \ldots{}
21755 \begin_inset Flex Code
21758 \begin_layout Plain Layout
21767 \begin_layout Subsection
21768 The template header
21771 \begin_layout Description
21772 \begin_inset Flex Code
21775 \begin_layout Plain Layout
21776 AutomaticProduction
21777 \begin_inset space ~
21785 Whether the file represented by the template must be generated by LyX.
21786 This command must occur exactly once.
21789 \begin_layout Description
21790 \begin_inset Flex Code
21793 \begin_layout Plain Layout
21795 \begin_inset space ~
21803 A glob pattern that is used in the file dialog to filter out the desired
21805 If there is more than one possible file extension (e.
21806 \begin_inset space \thinspace{}
21810 \begin_inset space \space{}
21814 \begin_inset Flex Code
21817 \begin_layout Plain Layout
21824 \begin_inset Flex Code
21827 \begin_layout Plain Layout
21833 ), use something like
21834 \begin_inset Flex Code
21837 \begin_layout Plain Layout
21844 This command must occur exactly once.
21847 \begin_layout Description
21848 \begin_inset Flex Code
21851 \begin_layout Plain Layout
21853 \begin_inset space ~
21861 The text that is displayed on the button.
21862 This command must occur exactly once.
21865 \begin_layout Description
21866 \begin_inset Flex Code
21869 \begin_layout Plain Layout
21871 \begin_inset space ~
21875 \begin_inset space ~
21883 The help text that is used in the External dialog.
21884 Provide enough information to explain to the user just what the template
21885 can provide him with.
21886 This command must occur exactly once.
21889 \begin_layout Description
21890 \begin_inset Flex Code
21893 \begin_layout Plain Layout
21895 \begin_inset space ~
21903 The file format of the original file.
21904 This must be the name of a format that is known to LyX (see section
21905 \begin_inset space ~
21909 \begin_inset CommandInset ref
21911 reference "sec:Formats"
21917 \begin_inset Quotes eld
21921 \begin_inset Flex Code
21924 \begin_layout Plain Layout
21931 \begin_inset Quotes erd
21934 if the template can handle original files of more than one format.
21935 LyX will attempt to interrogate the file itself in order to deduce its
21936 format in this case.
21937 This command must occur exactly once.
21940 \begin_layout Description
21941 \begin_inset Flex Code
21944 \begin_layout Plain Layout
21946 \begin_inset space ~
21954 A unique name for the template.
21955 It must not contain substitution macros (see below).
21958 \begin_layout Description
21959 \begin_inset Flex Code
21962 \begin_layout Plain Layout
21964 \begin_inset space ~
21967 Rotate|Resize|Clip|Extra
21972 This command specifies which transformations are supported by this template.
21973 It may occur zero or more times.
21974 This command enables the corresponding tabs in the external dialog.
21976 \begin_inset Flex Code
21979 \begin_layout Plain Layout
21985 command must have either a corresponding
21986 \begin_inset Flex Code
21989 \begin_layout Plain Layout
21996 \begin_inset Flex Code
21999 \begin_layout Plain Layout
22006 \begin_inset Flex Code
22009 \begin_layout Plain Layout
22016 Otherwise the transformation will not be supported by that format.
22019 \begin_layout Subsection
22023 \begin_layout Description
22024 \begin_inset Flex Code
22027 \begin_layout Plain Layout
22029 \begin_inset space ~
22032 LaTeX|PDFLaTeX|PlainText|DocBook
22037 The primary document file format that this format definition is for.
22038 Not every template has a sensible representation in all document file formats.
22039 Please define nevertheless a
22040 \begin_inset Flex Code
22043 \begin_layout Plain Layout
22049 section for all templates.
22050 Use a dummy text when no representation is available.
22051 Then you can at least see a reference to the external material in the exported
22055 \begin_layout Description
22056 \begin_inset Flex Code
22059 \begin_layout Plain Layout
22061 \begin_inset space ~
22065 \begin_inset space ~
22073 This command defines an additional macro
22074 \begin_inset Flex Code
22077 \begin_layout Plain Layout
22083 for substitution in
22084 \begin_inset Flex Code
22087 \begin_layout Plain Layout
22095 \begin_inset Flex Code
22098 \begin_layout Plain Layout
22104 itself may contain substitution macros.
22105 The advantage over using
22106 \begin_inset Flex Code
22109 \begin_layout Plain Layout
22116 \begin_inset Flex Code
22119 \begin_layout Plain Layout
22125 is that the substituted value of
22126 \begin_inset Flex Code
22129 \begin_layout Plain Layout
22135 is sanitized so that it is a valid optional argument in the document format.
22136 This command may occur zero or more times.
22139 \begin_layout Description
22140 \begin_inset Flex Code
22143 \begin_layout Plain Layout
22145 \begin_inset space ~
22153 The text that is inserted in the exported document.
22154 This is actually the most important command and can be quite complex.
22155 This command must occur exactly once.
22158 \begin_layout Description
22159 \begin_inset Flex Code
22162 \begin_layout Plain Layout
22164 \begin_inset space ~
22172 This command specifies a preamble snippet that will be included in the
22174 It has to be defined using
22175 \begin_inset Flex Code
22178 \begin_layout Plain Layout
22184 \SpecialChar \ldots{}
22186 \begin_inset Flex Code
22189 \begin_layout Plain Layout
22196 This command may occur zero or more times.
22199 \begin_layout Description
22200 \begin_inset Flex Code
22203 \begin_layout Plain Layout
22205 \begin_inset space ~
22209 \begin_inset space ~
22217 This command denotes files that are created by the conversion process and
22218 are needed for a particular export format.
22219 If the filename is relative, it is interpreted relative to the master document.
22220 This command may be given zero or more times.
22223 \begin_layout Description
22224 \begin_inset Flex Code
22227 \begin_layout Plain Layout
22229 \begin_inset space ~
22237 The name of a required LaTeX package.
22238 The package is included via
22239 \begin_inset Flex Code
22242 \begin_layout Plain Layout
22250 in the LaTeX preamble.
22251 This command may occur zero or more times.
22254 \begin_layout Description
22255 \begin_inset Flex Code
22258 \begin_layout Plain Layout
22260 \begin_inset space ~
22264 \begin_inset space ~
22267 RotationLatexCommand
22272 This command specifies that the built in LaTeX command should be used for
22274 This command may occur once or not at all.
22277 \begin_layout Description
22278 \begin_inset Flex Code
22281 \begin_layout Plain Layout
22283 \begin_inset space ~
22287 \begin_inset space ~
22295 This command specifies that the built in LaTeX command should be used for
22297 This command may occur once or not at all.
22300 \begin_layout Description
22301 \begin_inset Flex Code
22304 \begin_layout Plain Layout
22306 \begin_inset space ~
22310 \begin_inset space ~
22313 RotationLatexOption
22318 This command specifies that rotation is done via an optional argument.
22319 This command may occur once or not at all.
22322 \begin_layout Description
22323 \begin_inset Flex Code
22326 \begin_layout Plain Layout
22328 \begin_inset space ~
22332 \begin_inset space ~
22340 This command specifies that resizing is done via an optional argument.
22341 This command may occur once or not at all.
22344 \begin_layout Description
22345 \begin_inset Flex Code
22348 \begin_layout Plain Layout
22350 \begin_inset space ~
22354 \begin_inset space ~
22362 This command specifies that clipping is done via an optional argument.
22363 This command may occur once or not at all.
22366 \begin_layout Description
22367 \begin_inset Flex Code
22370 \begin_layout Plain Layout
22372 \begin_inset space ~
22376 \begin_inset space ~
22384 This command specifies that an extra optional argument is used.
22385 This command may occur once or not at all.
22388 \begin_layout Description
22389 \begin_inset Flex Code
22392 \begin_layout Plain Layout
22394 \begin_inset space ~
22402 The file format of the converted file.
22403 This must be the name of a format that is known to LyX (see the
22404 \begin_inset Flex MenuItem
22407 \begin_layout Plain Layout
22412 ools\SpecialChar \menuseparator
22417 references\SpecialChar \menuseparator
22418 File Handling\SpecialChar \menuseparator
22425 This command must occur exactly once.
22428 \begin_layout Description
22429 \begin_inset Flex Code
22432 \begin_layout Plain Layout
22434 \begin_inset space ~
22442 The file name of the converted file.
22443 The file name must be absolute.
22444 This command must occur exactly once.
22447 \begin_layout Subsection
22448 Preamble definitions
22451 \begin_layout Standard
22452 The external template configuration file may contain additional preamble
22453 definitions enclosed by
22454 \begin_inset Flex Code
22457 \begin_layout Plain Layout
22463 \SpecialChar \ldots{}
22465 \begin_inset Flex Code
22468 \begin_layout Plain Layout
22475 They can be used by the templates in the
22476 \begin_inset Flex Code
22479 \begin_layout Plain Layout
22488 \begin_layout Section
22489 The substitution mechanism
22492 \begin_layout Standard
22493 When the external material facility invokes an external program, it is done
22494 on the basis of a command defined in the template configuration file.
22495 These commands can contain various macros that are expanded before execution.
22496 Execution always take place in the directory of the containing document.
22499 \begin_layout Standard
22500 Also, whenever external material is to be displayed, the name will be produced
22501 by the substitution mechanism, and most other commands in the template
22502 definition support substitution as well.
22505 \begin_layout Standard
22506 The available macros are the following:
22509 \begin_layout Description
22510 \begin_inset Flex Code
22513 \begin_layout Plain Layout
22514 $$AbsOrRelPathMaster
22519 The file path, absolute or relative to the master LyX document.
22522 \begin_layout Description
22523 \begin_inset Flex Code
22526 \begin_layout Plain Layout
22527 $$AbsOrRelPathParent
22532 The file path, absolute or relative to the LyX document.
22535 \begin_layout Description
22536 \begin_inset Flex Code
22539 \begin_layout Plain Layout
22545 The absolute file path.
22548 \begin_layout Description
22549 \begin_inset Flex Code
22552 \begin_layout Plain Layout
22558 The filename without path and without the extension.
22561 \begin_layout Description
22562 \begin_inset Flex Code
22565 \begin_layout Plain Layout
22567 \begin_inset Quotes eld
22571 \begin_inset Quotes erd
22579 This macro will expand to the contents of the file with the name
22580 \begin_inset Flex Code
22583 \begin_layout Plain Layout
22592 \begin_layout Description
22593 \begin_inset Flex Code
22596 \begin_layout Plain Layout
22602 The file extension (including the dot).
22605 \begin_layout Description
22606 \begin_inset Flex Code
22609 \begin_layout Plain Layout
22615 The filename of the file specified in the external material dialog.
22616 This is either an absolute name, or it is relative to the LyX document.
22619 \begin_layout Description
22620 \begin_inset Flex Code
22623 \begin_layout Plain Layout
22630 \begin_inset Flex Code
22633 \begin_layout Plain Layout
22639 (absolute name or relative to the LyX document).
22642 \begin_layout Description
22643 \begin_inset Flex Code
22646 \begin_layout Plain Layout
22652 The file path, relative to the master LyX document.
22655 \begin_layout Description
22656 \begin_inset Flex Code
22659 \begin_layout Plain Layout
22665 The file path, relative to the LyX document.
22668 \begin_layout Description
22669 \begin_inset Flex Code
22672 \begin_layout Plain Layout
22678 This macro will expand to the absolute path of the system directory.
22679 This is typically used to point to the various helper scripts that are
22683 \begin_layout Description
22684 \begin_inset Flex Code
22687 \begin_layout Plain Layout
22693 A name and full path to a temporary file which will be automatically deleted
22694 whenever the containing document is closed, or the external material insertion
22698 \begin_layout Standard
22699 All path macros contain a trailing directory separator, so you can construct
22701 \begin_inset space \thinspace{}
22705 \begin_inset space \space{}
22708 the absolute filename with
22709 \begin_inset Flex Code
22712 \begin_layout Plain Layout
22713 $$AbsPath$$Basename$$Extension
22721 \begin_layout Standard
22722 The macros above are substituted in all commands unless otherwise noted.
22724 \begin_inset Flex Code
22727 \begin_layout Plain Layout
22733 supports additionally the following substitutions if they are enabled by
22735 \begin_inset Flex Code
22738 \begin_layout Plain Layout
22745 \begin_inset Flex Code
22748 \begin_layout Plain Layout
22757 \begin_layout Description
22758 \begin_inset Flex Code
22761 \begin_layout Plain Layout
22767 The front part of the resize command.
22770 \begin_layout Description
22771 \begin_inset Flex Code
22774 \begin_layout Plain Layout
22780 The back part of the resize command.
22783 \begin_layout Description
22784 \begin_inset Flex Code
22787 \begin_layout Plain Layout
22793 The front part of the rotation command.
22796 \begin_layout Description
22797 \begin_inset Flex Code
22800 \begin_layout Plain Layout
22806 The back part of the rotation command.
22809 \begin_layout Standard
22810 The value string of the
22811 \begin_inset Flex Code
22814 \begin_layout Plain Layout
22820 command supports additionally the following substitutions if they are enabled
22822 \begin_inset Flex Code
22825 \begin_layout Plain Layout
22832 \begin_inset Flex Code
22835 \begin_layout Plain Layout
22844 \begin_layout Description
22845 \begin_inset Flex Code
22848 \begin_layout Plain Layout
22857 \begin_layout Description
22858 \begin_inset Flex Code
22861 \begin_layout Plain Layout
22870 \begin_layout Description
22871 \begin_inset Flex Code
22874 \begin_layout Plain Layout
22883 \begin_layout Description
22884 \begin_inset Flex Code
22887 \begin_layout Plain Layout
22893 The rotation option.
22896 \begin_layout Standard
22897 You may ask why there are so many path macros.
22898 There are mainly two reasons:
22901 \begin_layout Enumerate
22902 Relative and absolute file names should remain relative or absolute, respectivel
22904 Users may have reasons to prefer either form.
22905 Relative names are useful for portable documents that should work on different
22906 machines, for example.
22907 Absolute names may be required by some programs.
22910 \begin_layout Enumerate
22911 LaTeX treats relative file names differently than LyX and other programs
22912 in nested included files.
22913 For LyX, a relative file name is always relative to the document that contains
22915 For LaTeX, it is always relative to the master document.
22916 These two definitions are identical if you have only one document, but
22917 differ if you have a master document that includes part documents.
22918 That means that relative filenames must be transformed when presented to
22920 Fortunately LyX does this automatically for you if you choose the right
22924 \begin_layout Standard
22925 So which path macro should be used in new template definitions? The rule
22929 \begin_layout Itemize
22931 \begin_inset Flex Code
22934 \begin_layout Plain Layout
22940 if an absolute path is required.
22943 \begin_layout Itemize
22945 \begin_inset Flex Code
22948 \begin_layout Plain Layout
22949 $$AbsOrRelPathMaster
22954 if the substituted string is some kind of LaTeX input.
22957 \begin_layout Itemize
22959 \begin_inset Flex Code
22962 \begin_layout Plain Layout
22963 $$AbsOrRelPathParent
22968 in order to preserve the user's choice.
22971 \begin_layout Standard
22972 There are special cases where this rule does not work and e.
22973 \begin_inset space \thinspace{}
22977 \begin_inset space \space{}
22980 relative names are needed, but normally it will work just fine.
22981 One example for such a case is the command
22982 \begin_inset Flex Code
22985 \begin_layout Plain Layout
22986 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
22991 in the XFig template above: We can't use the absolute name because the
22993 \begin_inset Flex Code
22996 \begin_layout Plain Layout
23002 files needs the relative name in order to rewrite the file content.
23005 \begin_layout Section
23006 Security discussion
23007 \begin_inset CommandInset label
23009 name "sec:Security-discussion"
23016 \begin_layout Standard
23017 The external material feature interfaces with a lot of external programs
23018 and does so automatically, so we have to consider the security implications
23020 In particular, since you have the option of including your own filenames
23021 and/or parameter strings and those are expanded into a command, it seems
23022 that it would be possible to create a malicious document which executes
23023 arbitrary commands when a user views or prints the document.
23024 This is something we definitely want to avoid.
23027 \begin_layout Standard
23028 However, since the external program commands are specified in the template
23029 configuration file only, there are no security issues if LyX is properly
23030 configured with safe templates only.
23031 This is so because the external programs are invoked with the
23032 \begin_inset Flex Code
23035 \begin_layout Plain Layout
23041 -system call rather than the
23042 \begin_inset Flex Code
23045 \begin_layout Plain Layout
23051 system-call, so it's not possible to execute arbitrary commands from the
23052 filename or parameter section via the shell.
23055 \begin_layout Standard
23056 This also implies that you are restricted in what command strings you can
23057 use in the external material templates.
23058 In particular, pipes and redirection are not readily available.
23059 This has to be so if LyX should remain safe.
23060 If you want to use some of the shell features, you should write a safe
23061 script to do this in a controlled manner, and then invoke the script from
23062 the command string.
23066 \begin_layout Standard
23067 It is possible to design a template that interacts directly with the shell,
23068 but since this would allow a malicious user to execute arbitrary commands
23069 by writing clever filenames and/or parameters, we generally recommend that
23070 you only use safe scripts that work with the
23071 \begin_inset Flex Code
23074 \begin_layout Plain Layout
23080 system call in a controlled manner.
23081 Of course, for use in a controlled environment, it can be tempting to just
23082 fall back to use ordinary shell scripts.
23083 If you do so, be aware that you
23087 provide an easily exploitable security hole in your system.
23088 Of course it stands to reason that such unsafe templates will never be
23089 included in the standard LyX distribution, although we do encourage people
23090 to submit new templates in the open source tradition.
23091 But LyX as shipped from the official distribution channels will never have
23095 \begin_layout Standard
23096 Including external material provides a lot of power, and you have to be
23097 careful not to introduce security hazards with this power.
23098 A subtle error in a single line in an innocent looking script can open
23099 the door to huge security problems.
23100 So if you do not fully understand the issues, we recommend that you consult
23101 a knowledgeable security professional or the LyX development team if you
23102 have any questions about whether a given template is safe or not.
23103 And do this before you use it in an uncontrolled environment.