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 155139281 1354199102
11026 \begin_inset Flex Code
11029 \begin_layout Plain Layout
11031 \change_inserted 155139281 1354199013
11042 \begin_inset Flex Code
11045 \begin_layout Plain Layout
11047 \change_inserted 155139281 1354199102
11058 \begin_inset Flex Code
11061 \begin_layout Plain Layout
11063 \change_inserted 155139281 1354199044
11071 followed by the number (e.
11072 \begin_inset space \thinspace{}
11077 \begin_inset Flex Code
11080 \begin_layout Plain Layout
11082 \change_inserted 155139281 1354199064
11096 \begin_layout Description
11097 \begin_inset Flex Code
11100 \begin_layout Plain Layout
11106 Note that this will completely override any prior
11107 \begin_inset Flex Code
11110 \begin_layout Plain Layout
11116 declaration for this style.
11118 \begin_inset Quotes eld
11122 \begin_inset Flex Code
11125 \begin_layout Plain Layout
11132 \begin_inset Quotes erd
11137 \begin_inset CommandInset ref
11139 reference "sub:I18n"
11143 for details on its use.
11146 \begin_layout Description
11147 \begin_inset Flex Code
11150 \begin_layout Plain Layout
11157 \begin_inset Flex Code
11160 \begin_layout Plain Layout
11170 \begin_layout Plain Layout
11171 Note that a `float' here is a real number, such as: 1.5.
11176 The vertical space with which the last of a chain of paragraphs with this
11177 style is separated from the following paragraph.
11178 If the next paragraph has another style, the separations are not simply
11179 added, but the maximum is taken.
11182 \begin_layout Description
11183 \begin_inset Flex Code
11186 \begin_layout Plain Layout
11193 \begin_inset Flex Code
11196 \begin_layout Plain Layout
11202 The category for this style.
11203 This is used to group related styles in the style combobox on the toolbar.
11204 Any string can be used, but you may want to use existing categories with
11209 \begin_layout Description
11210 \begin_inset Flex Code
11213 \begin_layout Plain Layout
11219 Depth of XML command.
11220 Used only with XML-type formats.
11223 \begin_layout Description
11224 \begin_inset Flex Code
11227 \begin_layout Plain Layout
11234 \begin_inset Flex Code
11237 \begin_layout Plain Layout
11243 Copies all the features of an existing style into the current one.
11247 \begin_layout Description
11248 \begin_inset Flex Code
11251 \begin_layout Plain Layout
11257 The name of a style whose preamble should be output
11262 This allows to ensure some ordering of the preamble snippets when macros
11263 definitions depend on one another.
11267 \begin_layout Plain Layout
11268 Note that, besides that functionality, there is no way to ensure any ordering
11270 The ordering that you see in a given version of LyX may change without
11271 warning in later versions.
11279 \begin_layout Description
11280 \begin_inset Flex Code
11283 \begin_layout Plain Layout
11290 \begin_inset Flex Code
11293 \begin_layout Plain Layout
11298 , Box, Filled_Box, Static
11303 ] The type of label that stands at the end of the paragraph (or sequence
11305 \begin_inset Flex Code
11308 \begin_layout Plain Layout
11315 \begin_inset Flex Code
11318 \begin_layout Plain Layout
11325 \begin_inset Flex Code
11328 \begin_layout Plain Layout
11335 \begin_inset Flex Code
11338 \begin_layout Plain Layout
11346 \begin_inset Flex Code
11349 \begin_layout Plain Layout
11356 \begin_inset Quotes eld
11360 \begin_inset Quotes erd
11364 \begin_inset Flex Code
11367 \begin_layout Plain Layout
11374 \begin_inset Flex Code
11377 \begin_layout Plain Layout
11378 \begin_inset space ~
11386 ) is a white (resp.
11387 \begin_inset space ~
11390 black) square suitable for end of proof markers,
11391 \begin_inset Flex Code
11394 \begin_layout Plain Layout
11400 is an explicit text string.
11403 \begin_layout Description
11404 \begin_inset Flex Code
11407 \begin_layout Plain Layout
11414 \begin_inset Flex Code
11417 \begin_layout Plain Layout
11423 ] The string used for a label with a
11424 \begin_inset Flex Code
11427 \begin_layout Plain Layout
11434 \begin_inset Flex Code
11437 \begin_layout Plain Layout
11447 \begin_layout Description
11448 \begin_inset Flex Code
11451 \begin_layout Plain Layout
11457 The font used for both the text body
11463 \begin_inset space ~
11467 \begin_inset CommandInset ref
11469 reference "sub:Font-description"
11474 Note that defining this font automatically defines the
11475 \begin_inset Flex Code
11478 \begin_layout Plain Layout
11485 So you should define this one first if you also want to define
11486 \begin_inset Flex Code
11489 \begin_layout Plain Layout
11498 \begin_layout Description
11499 \begin_inset Flex Code
11502 \begin_layout Plain Layout
11509 \begin_inset CommandInset label
11511 name "des:FreeSpacing"
11516 \begin_inset Flex Code
11519 \begin_layout Plain Layout
11528 \begin_inset Flex Code
11531 \begin_layout Plain Layout
11537 ] Usually LyX doesn't allow you to insert more than one space between words,
11538 since a space is considered as the separation between two words, not a
11539 character or symbol of its own.
11540 This is a very fine thing but sometimes annoying, for example, when typing
11541 program code or plain LaTeX code.
11543 \begin_inset Flex Code
11546 \begin_layout Plain Layout
11553 Note that LyX will create protected blanks for the additional blanks when
11554 in another mode than LaTeX-mode.
11557 \begin_layout Description
11558 \begin_inset Flex Code
11561 \begin_layout Plain Layout
11567 These tags are used with XHTML output.
11569 \begin_inset CommandInset ref
11571 reference "sub:Paragraph-Style-XHTML"
11578 \begin_layout Description
11579 \begin_inset Flex Code
11582 \begin_layout Plain Layout
11588 [[FIXME]] (Used only with XML-type formats.)
11591 \begin_layout Description
11592 \begin_inset Flex Code
11595 \begin_layout Plain Layout
11602 \begin_inset Flex Code
11605 \begin_layout Plain Layout
11611 If 1, marks the style as to be included in the document preamble rather
11612 than in the document body.
11613 This is useful for document classes that want such information as the title
11614 and author to appear in the preamble.
11615 Note that this works only for styles for which the
11616 \begin_inset Flex Code
11619 \begin_layout Plain Layout
11626 \begin_inset Flex Code
11629 \begin_layout Plain Layout
11636 \begin_inset Flex Code
11639 \begin_layout Plain Layout
11648 \begin_layout Description
11649 \begin_inset Flex Code
11652 \begin_layout Plain Layout
11659 \begin_inset Flex Code
11662 \begin_layout Plain Layout
11668 If 1, marks the style as being part of a title block (see also the
11669 \begin_inset Flex Code
11672 \begin_layout Plain Layout
11679 \begin_inset Flex Code
11682 \begin_layout Plain Layout
11691 \begin_layout Description
11693 \change_inserted -712698321 1355932296
11694 \begin_inset Flex Code
11697 \begin_layout Plain Layout
11699 \change_inserted -712698321 1355932178
11706 \begin_inset Flex Code
11709 \begin_layout Plain Layout
11711 \change_inserted -712698321 1355932181
11717 ] The LaTeX command sequence declaring an item in a list.
11718 The command is to be defined without the preceding backslash (the default
11720 \begin_inset Quotes eld
11724 \begin_inset Quotes erd
11728 \begin_inset Flex Code
11731 \begin_layout Plain Layout
11733 \change_inserted -712698321 1355932279
11743 in the LaTeX output).
11746 \begin_layout Description
11747 \begin_inset Flex Code
11750 \begin_layout Plain Layout
11757 \begin_inset Flex Code
11760 \begin_layout Plain Layout
11766 ] This provides extra space between paragraphs that have the same style.
11767 If you put other styles into an environment, each is separated with the
11769 \begin_inset Flex Code
11772 \begin_layout Plain Layout
11779 But the whole items of the environment are additionally separated with
11781 \begin_inset Flex Code
11784 \begin_layout Plain Layout
11791 Note that this is a
11796 \begin_layout Description
11797 \begin_inset Flex Code
11800 \begin_layout Plain Layout
11806 [[FIXME]] (Used only with XML-type formats.)
11809 \begin_layout Description
11810 \begin_inset Flex Code
11813 \begin_layout Plain Layout
11820 \begin_inset Flex Code
11823 \begin_layout Plain Layout
11832 \begin_inset Flex Code
11835 \begin_layout Plain Layout
11841 ] Usually LyX does not allow you to leave a paragraph empty, since it would
11842 lead to empty LaTeX output.
11843 There are some cases where this could be desirable however: in a letter
11844 template, the required fields can be provided as empty fields, so that
11845 people do not forget them; in some special classes, a style can be used
11846 as some kind of break, which does not contain actual text.
11849 \begin_layout Description
11850 \begin_inset Flex Code
11853 \begin_layout Plain Layout
11859 [float=0] The vertical space between the label and the text body.
11860 Only used for labels that are above the text body (
11861 \begin_inset Flex Code
11864 \begin_layout Plain Layout
11871 \begin_inset Flex Code
11874 \begin_layout Plain Layout
11875 Centered_Top_Environment
11883 \begin_layout Description
11884 \begin_inset Flex Code
11887 \begin_layout Plain Layout
11894 \begin_inset Flex Code
11897 \begin_layout Plain Layout
11904 \begin_inset Newline newline
11907 The name of the counter for automatic numbering.
11909 \begin_inset Newline newline
11917 \begin_inset Flex Code
11920 \begin_layout Plain Layout
11927 \begin_inset Flex Code
11930 \begin_layout Plain Layout
11937 In that case, the counter will be stepped each time the style appears.
11939 \begin_inset Newline newline
11947 \begin_inset Flex Code
11950 \begin_layout Plain Layout
11957 \begin_inset Flex Code
11960 \begin_layout Plain Layout
11966 , though this case is a bit complicated.
11967 Suppose you declare
11968 \begin_inset Quotes eld
11972 \begin_inset Flex Code
11975 \begin_layout Plain Layout
11976 LabelCounter myenum
11982 \begin_inset Quotes erd
11986 Then the actual counters used are
11987 \begin_inset Flex Code
11990 \begin_layout Plain Layout
11997 \begin_inset Flex Code
12000 \begin_layout Plain Layout
12007 \begin_inset Flex Code
12010 \begin_layout Plain Layout
12017 \begin_inset Flex Code
12020 \begin_layout Plain Layout
12026 , much as in LaTeX.
12027 These counters must all be declared separately.
12028 \begin_inset Newline newline
12032 \begin_inset CommandInset ref
12034 reference "sub:Counters"
12038 for details on counters.
12041 \begin_layout Description
12042 \begin_inset Flex Code
12045 \begin_layout Plain Layout
12051 The font used for the label.
12053 \begin_inset space ~
12057 \begin_inset CommandInset ref
12059 reference "sub:Font-description"
12066 \begin_layout Description
12067 \begin_inset Flex Code
12070 \begin_layout Plain Layout
12076 Text that indicates how far a label should be indented.
12079 \begin_layout Description
12080 \begin_inset Flex Code
12083 \begin_layout Plain Layout
12090 \begin_inset Flex Code
12093 \begin_layout Plain Layout
12099 ] The horizontal space between the label and the text body.
12100 Only used for labels that are not above the text body.
12103 \begin_layout Description
12104 \begin_inset Flex Code
12107 \begin_layout Plain Layout
12114 \begin_inset Flex Code
12117 \begin_layout Plain Layout
12123 ] The string used for a label with a
12124 \begin_inset Flex Code
12127 \begin_layout Plain Layout
12135 \begin_inset Flex Code
12138 \begin_layout Plain Layout
12144 is set, this string can be contain the special formatting commands described
12146 \begin_inset CommandInset ref
12148 reference "sub:Counters"
12156 \begin_layout Plain Layout
12157 For the sake of backwards compatibility, the string
12158 \begin_inset Flex Code
12161 \begin_layout Plain Layout
12171 will be replaced by the expanded
12172 \begin_inset Flex Code
12175 \begin_layout Plain Layout
12182 \begin_inset Flex Code
12185 \begin_layout Plain Layout
12194 This feature is now obsolete and should be replaced by the mechanisms of
12196 \begin_inset CommandInset ref
12198 reference "sub:Counters"
12210 \begin_layout Description
12211 \begin_inset Flex Code
12214 \begin_layout Plain Layout
12215 LabelStringAppendix
12221 \begin_inset Flex Code
12224 \begin_layout Plain Layout
12230 ] This is used inside the appendix instead of
12231 \begin_inset Flex Code
12234 \begin_layout Plain Layout
12242 \begin_inset Flex Code
12245 \begin_layout Plain Layout
12252 \begin_inset Flex Code
12255 \begin_layout Plain Layout
12256 LabelStringAppendix
12264 \begin_layout Description
12265 \begin_inset Flex Code
12268 \begin_layout Plain Layout
12274 [FIXME] (Used only with XML-type formats.)
12277 \begin_layout Description
12278 \begin_inset Flex Code
12281 \begin_layout Plain Layout
12288 \begin_inset Flex Code
12291 \begin_layout Plain Layout
12296 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
12297 Enumerate, Itemize, Bibliography
12306 \begin_layout Itemize
12307 \begin_inset Flex Code
12310 \begin_layout Plain Layout
12316 means the label is the very first word (up to the first real blank).
12317 Use protected spaces (like
12318 \begin_inset space ~
12321 that one) if you want more than one word as the label.
12325 \begin_layout Itemize
12326 \begin_inset Flex Code
12329 \begin_layout Plain Layout
12335 means the label is simply whatever
12336 \begin_inset Flex Code
12339 \begin_layout Plain Layout
12346 Note that this really is `static'.
12349 \begin_layout Itemize
12350 \begin_inset Flex Code
12353 \begin_layout Plain Layout
12360 \begin_inset Flex Code
12363 \begin_layout Plain Layout
12364 Centered_Top_Environment
12369 are special cases of
12370 \begin_inset Flex Code
12373 \begin_layout Plain Layout
12380 The label will be printed above the paragraph, but only at the top of an
12381 environment or the top of a chain of paragraphs with this style.
12382 This might be used with the
12383 \begin_inset Flex MenuItem
12386 \begin_layout Plain Layout
12392 style, for example.
12395 \begin_layout Itemize
12396 \begin_inset Flex Code
12399 \begin_layout Plain Layout
12405 is a special case for the caption-labels
12406 \begin_inset Quotes eld
12410 \begin_inset Quotes erd
12414 \begin_inset Quotes eld
12418 \begin_inset Quotes erd
12423 \begin_inset Flex Code
12426 \begin_layout Plain Layout
12432 means the (hardcoded) label string depends on the kind of float: It is
12433 hardcoded to be `FloatType N', where N is the value of the counter associated
12437 \begin_layout Itemize
12439 \begin_inset Flex Code
12442 \begin_layout Plain Layout
12448 label type defines automatically numbered labels.
12450 \begin_inset Flex Code
12453 \begin_layout Plain Layout
12459 will be expanded to resolve any counter references it contains: For example,
12461 \begin_inset Quotes eld
12465 \begin_inset Flex Code
12468 \begin_layout Plain Layout
12479 \begin_inset Quotes erd
12484 \begin_inset CommandInset ref
12486 reference "sub:Counters"
12490 for more information on counters.
12493 \begin_layout Itemize
12494 \begin_inset Flex Code
12497 \begin_layout Plain Layout
12503 produces the usual sort of enumeration labels.
12504 At present, it is hardcoded to use Arabic numerals, lowercase letters,
12505 small Roman numerals, and uppercase letters for the four possible depths.
12508 \begin_layout Itemize
12509 \begin_inset Flex Code
12512 \begin_layout Plain Layout
12518 produces various bullets at the different levels.
12519 It is also hardcoded.
12522 \begin_layout Itemize
12523 \begin_inset Flex Code
12526 \begin_layout Plain Layout
12532 is used internally by LyX and should be used only with
12533 \begin_inset Flex Code
12536 \begin_layout Plain Layout
12537 LatexType BibEnvironment
12546 \begin_layout Description
12547 \begin_inset Flex Code
12550 \begin_layout Plain Layout
12556 Note that this will completely override any prior
12557 \begin_inset Flex Code
12560 \begin_layout Plain Layout
12566 declaration for this style.
12568 \begin_inset Quotes eld
12572 \begin_inset Flex Code
12575 \begin_layout Plain Layout
12582 \begin_inset Quotes erd
12587 \begin_inset CommandInset ref
12589 reference "sub:I18n"
12593 for details on its use.
12596 \begin_layout Description
12597 \begin_inset Flex Code
12600 \begin_layout Plain Layout
12606 The name of the corresponding LaTeX stuff.
12607 Either the environment or command name.
12610 \begin_layout Description
12611 \begin_inset Flex Code
12614 \begin_layout Plain Layout
12620 An optional parameter for the corresponding
12621 \begin_inset Flex Code
12624 \begin_layout Plain Layout
12631 This parameter cannot be changed from within LyX
12632 \change_inserted -712698321 1355144804
12634 \begin_inset Flex Code
12637 \begin_layout Plain Layout
12639 \change_inserted -712698321 1355144804
12645 for customizable parameters)
12649 \change_inserted -712698321 1355144804
12650 This will be output as is after all LaTeX
12651 \begin_inset Flex Code
12654 \begin_layout Plain Layout
12656 \change_inserted -712698321 1355144658
12669 \begin_layout Description
12670 \begin_inset Flex Code
12673 \begin_layout Plain Layout
12680 \begin_inset Flex Code
12683 \begin_layout Plain Layout
12688 , Command, Environment, Item_Environment,
12694 \begin_inset Flex Code
12697 \begin_layout Plain Layout
12698 List_Environment, Bib_Environment
12703 ] How the style should be translated into LaTeX.
12707 \begin_layout Plain Layout
12708 \begin_inset Flex Code
12711 \begin_layout Plain Layout
12717 is perhaps a bit misleading, since these rules apply to SGML classes, too.
12718 Visit the SGML class files for specific examples.
12727 \begin_layout Itemize
12728 \begin_inset Flex Code
12731 \begin_layout Plain Layout
12737 means nothing special.
12741 \begin_layout Itemize
12742 \begin_inset Flex Code
12745 \begin_layout Plain Layout
12752 \begin_inset Flex Code
12755 \begin_layout Plain Layout
12762 {\SpecialChar \ldots{}
12771 \begin_layout Itemize
12772 \begin_inset Flex Code
12775 \begin_layout Plain Layout
12782 \begin_inset Flex Code
12785 \begin_layout Plain Layout
12792 }\SpecialChar \ldots{}
12808 \begin_layout Itemize
12809 \begin_inset Flex Code
12812 \begin_layout Plain Layout
12819 \begin_inset Flex Code
12822 \begin_layout Plain Layout
12829 \begin_inset Flex Code
12832 \begin_layout Plain Layout
12840 is generated for each paragraph of this environment.
12844 \begin_layout Itemize
12845 \begin_inset Flex Code
12848 \begin_layout Plain Layout
12855 \begin_inset Flex Code
12858 \begin_layout Plain Layout
12865 \begin_inset Flex Code
12868 \begin_layout Plain Layout
12874 is passed as an argument to the environment.
12876 \begin_inset Flex Code
12879 \begin_layout Plain Layout
12885 can be defined in the
12886 \begin_inset Flex MenuItem
12889 \begin_layout Plain Layout
12890 Edit\SpecialChar \menuseparator
12892 \begin_inset space ~
12904 \begin_layout Standard
12905 Putting the last few things together, the LaTeX output will be either:
12908 \begin_layout LyX-Code
12911 latexname[latexparam]{\SpecialChar \ldots{}
12915 \begin_layout Standard
12919 \begin_layout LyX-Code
12922 begin{latexname}[latexparam] \SpecialChar \ldots{}
12928 \begin_layout Standard
12929 depending upon the LaTeX type.
12933 \begin_layout Description
12935 \change_inserted -712698321 1354263086
12936 \begin_inset Flex Code
12939 \begin_layout Plain Layout
12941 \change_inserted -712698321 1353866852
12948 \begin_inset Flex Code
12951 \begin_layout Plain Layout
12953 \change_inserted -712698321 1353866852
12959 ] A string that is put at the beginning of the style content.
12960 A line break in the output can be indicated by
12961 \begin_inset Flex Code
12964 \begin_layout Plain Layout
12966 \change_inserted -712698321 1354263086
12977 \begin_layout Description
12978 \begin_inset Flex Code
12981 \begin_layout Plain Layout
12988 \begin_inset Flex Code
12991 \begin_layout Plain Layout
12997 ] If you put styles into environments, the leftmargins are not simply added,
12998 but added with a factor
12999 \begin_inset Formula $\frac{4}{depth+4}$
13003 Note that this parameter is also used when the margin is defined as
13004 \begin_inset Flex Code
13007 \begin_layout Plain Layout
13014 \begin_inset Flex Code
13017 \begin_layout Plain Layout
13024 Then it is added to the manual or dynamic margin.
13026 \begin_inset Newline newline
13029 The argument is passed as a string.
13031 \begin_inset Quotes eld
13035 \begin_inset Flex Code
13038 \begin_layout Plain Layout
13045 \begin_inset Quotes erd
13048 means that the paragraph is indented with the width of
13049 \begin_inset Quotes eld
13053 \begin_inset Flex Code
13056 \begin_layout Plain Layout
13063 \begin_inset Quotes erd
13066 in the normal font.
13067 You can get a negative width by prefixing the string with
13068 \begin_inset Quotes eld
13072 \begin_inset Flex Code
13075 \begin_layout Plain Layout
13082 \begin_inset Quotes erd
13086 This way was chosen so that the look is the same with each used screen
13091 \begin_layout Description
13092 \begin_inset Flex Code
13095 \begin_layout Plain Layout
13102 \begin_inset Flex Code
13105 \begin_layout Plain Layout
13110 , Manual, Dynamic, First_Dynamic, Right_Address_Box
13116 \begin_inset Newline newline
13119 The kind of margin that the style has on the left side.
13121 \begin_inset Flex Code
13124 \begin_layout Plain Layout
13130 just means a fixed margin.
13132 \begin_inset Flex Code
13135 \begin_layout Plain Layout
13141 means that the left margin depends on the string entered in the
13142 \begin_inset Flex MenuItem
13145 \begin_layout Plain Layout
13146 Edit\SpecialChar \menuseparator
13148 \begin_inset space ~
13157 This is used to typeset nice lists without tabulators.
13159 \begin_inset Flex Code
13162 \begin_layout Plain Layout
13168 means that the margin depends on the size of the label.
13169 This is used for automatic enumerated headlines.
13170 It is obvious that the headline
13171 \begin_inset Quotes eld
13174 5.4.3.2.1 Very long headline
13175 \begin_inset Quotes erd
13178 must have a wider left margin (as wide as
13179 \begin_inset Quotes eld
13183 \begin_inset Quotes erd
13186 plus the space) than
13187 \begin_inset Quotes eld
13190 3.2 Very long headline
13191 \begin_inset Quotes erd
13195 \begin_inset Quotes eld
13199 \begin_inset Quotes erd
13202 are not able to do this.
13204 \begin_inset Flex Code
13207 \begin_layout Plain Layout
13213 is similar, but only the very first row of the paragraph is dynamic, while
13214 the others are static; this is used, for example, for descriptions.
13216 \begin_inset Flex Code
13219 \begin_layout Plain Layout
13225 means the margin is chosen in a way that the longest row of this paragraph
13226 fits to the right margin.
13227 This is used to typeset an address on the right edge of the page.
13230 \begin_layout Description
13231 \begin_inset Flex Code
13234 \begin_layout Plain Layout
13241 \begin_inset Flex Code
13244 \begin_layout Plain Layout
13253 \begin_inset Flex Code
13256 \begin_layout Plain Layout
13262 ] Whether fragile commands in this style should be
13263 \begin_inset Flex Code
13266 \begin_layout Plain Layout
13279 whether this command should itself be protected.)
13282 \begin_layout Description
13283 \begin_inset Flex Code
13286 \begin_layout Plain Layout
13293 \begin_inset Flex Code
13296 \begin_layout Plain Layout
13303 \begin_inset Flex Code
13306 \begin_layout Plain Layout
13314 ] Whether newlines are translated into LaTeX newlines (
13315 \begin_inset Flex Code
13318 \begin_layout Plain Layout
13329 The translation can be switched off to allow more comfortable LaTeX editing
13333 \begin_layout Description
13334 \begin_inset Flex Code
13337 \begin_layout Plain Layout
13344 \begin_inset Flex Code
13347 \begin_layout Plain Layout
13354 \begin_inset Flex Code
13357 \begin_layout Plain Layout
13365 ] If set to true, and if
13366 \begin_inset Flex Code
13369 \begin_layout Plain Layout
13376 \begin_inset Flex Code
13379 \begin_layout Plain Layout
13385 ) paragraphs are being indented, then the indentation of such a paragraph
13386 following one of this type will be suppressed.
13387 (So this will not affect the display of non-default paragraphs.)
13390 \begin_layout Description
13391 \begin_inset Flex Code
13394 \begin_layout Plain Layout
13400 Name of a style that has replaced this style.
13401 This is used to rename a style, while keeping backward compatibility.
13404 \begin_layout Description
13406 \change_deleted -712698321 1353679722
13407 \begin_inset Flex Code
13410 \begin_layout Plain Layout
13417 \begin_inset Flex Code
13420 \begin_layout Plain Layout
13426 ] The number of optional arguments that can be used with this style.
13427 This is useful for things like section headings, and only makes sense with
13429 Note that, on output, the optional arguments will all precede any required
13430 arguments (see below).
13431 So one can have constructs like:
13435 \begin_layout LyX-Code
13437 \change_deleted -712698321 1353679722
13440 mycmd[opt1]{req1}{contents of paragraph}
13443 \begin_layout Standard
13445 \change_deleted -712698321 1353679722
13446 but one cannot have things like:
13449 \begin_layout LyX-Code
13451 \change_deleted -712698321 1353679722
13454 mycmd[opt1]{req1}[opt2]{contents of paragraph}
13457 \begin_layout Standard
13459 \change_deleted -712698321 1353679722
13460 at least, not without ERT (with which you can have anything).
13467 \begin_layout Description
13468 \begin_inset Flex Code
13471 \begin_layout Plain Layout
13478 \begin_inset Flex Code
13481 \begin_layout Plain Layout
13490 \begin_inset Flex Code
13493 \begin_layout Plain Layout
13499 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
13500 output, but only by a line break; together with
13501 \begin_inset Flex Code
13504 \begin_layout Plain Layout
13510 , this allows to emulate a plain text editor (like the ERT inset).
13513 \begin_layout Description
13514 \begin_inset Flex Code
13517 \begin_layout Plain Layout
13524 \begin_inset Flex Code
13527 \begin_layout Plain Layout
13533 ] The indent of the very first line of a paragraph.
13535 \begin_inset Flex Code
13538 \begin_layout Plain Layout
13544 will be fixed for a certain style.
13545 The exception is the default style, since the indentation for these paragraphs
13546 can be prohibited with
13547 \begin_inset Flex Code
13550 \begin_layout Plain Layout
13558 \begin_inset Flex Code
13561 \begin_layout Plain Layout
13567 style paragraphs inside environments use the
13568 \begin_inset Flex Code
13571 \begin_layout Plain Layout
13577 of the environment, not their native one.
13579 \begin_inset Flex Code
13582 \begin_layout Plain Layout
13588 paragraphs inside an enumeration are not indented.
13591 \begin_layout Description
13592 \begin_inset Flex Code
13595 \begin_layout Plain Layout
13602 \begin_inset Flex Code
13605 \begin_layout Plain Layout
13611 ] The vertical space between two paragraphs of this style.
13614 \begin_layout Description
13615 \begin_inset Flex Code
13618 \begin_layout Plain Layout
13625 \begin_inset Flex Code
13628 \begin_layout Plain Layout
13634 ] LyX allows the user to choose either
13635 \begin_inset Quotes eld
13639 \begin_inset Quotes erd
13643 \begin_inset Quotes eld
13647 \begin_inset Quotes erd
13650 to typeset a document.
13652 \begin_inset Quotes eld
13656 \begin_inset Quotes erd
13659 is chosen, this value is completely ignored.
13661 \begin_inset Quotes eld
13665 \begin_inset Quotes erd
13668 is chosen, the parindent of a LaTeXtype
13669 \begin_inset Quotes eld
13673 \begin_inset Quotes erd
13676 style is ignored and all paragraphs are separated by this parskip argument.
13677 The vertical space is calculated with
13678 \begin_inset Flex Code
13681 \begin_layout Plain Layout
13683 \begin_inset space ~
13692 \begin_inset Flex Code
13695 \begin_layout Plain Layout
13701 is the height of a row with the normal font.
13702 This way, the look stays the same with different screen fonts.
13705 \begin_layout Description
13706 \begin_inset Flex Code
13709 \begin_layout Plain Layout
13716 \begin_inset Flex Code
13719 \begin_layout Plain Layout
13728 \begin_inset Flex Code
13731 \begin_layout Plain Layout
13737 ] Whether the contents of this paragraph should be output in raw form, meaning
13738 without special translations that LaTeX would require.
13741 \begin_layout Description
13742 \begin_inset Flex Code
13745 \begin_layout Plain Layout
13751 Information to be included in the LaTeX preamble when this style is used.
13752 Used to define macros, load packages, etc., required by this particular
13755 \begin_inset Quotes eld
13759 \begin_inset Flex Code
13762 \begin_layout Plain Layout
13769 \begin_inset Quotes erd
13775 \begin_layout Description
13776 \begin_inset Flex Code
13779 \begin_layout Plain Layout
13786 \begin_inset Flex Code
13789 \begin_layout Plain Layout
13795 ] The prefix to use when creating labels referring to paragraphs of this
13797 This allows the use of formatted references.
13800 \begin_layout Description
13802 \change_deleted -712698321 1353681258
13803 \begin_inset Flex Code
13806 \begin_layout Plain Layout
13813 \begin_inset Flex Code
13816 \begin_layout Plain Layout
13822 ] The number of required arguments that the LaTeX command or environment
13823 corresponding to this style expects.
13824 In the case of a command, these are required arguments
13828 that associated with the content of the paragraph itself.
13829 These do not actually have to be provided: LyX will output empty arguments
13831 Note that optional arguments will be output before required arguments.
13832 See the discussion of the
13833 \begin_inset Flex Code
13836 \begin_layout Plain Layout
13842 tag above for more information.
13847 \begin_layout Description
13848 \begin_inset Flex Code
13851 \begin_layout Plain Layout
13858 \begin_inset Flex Code
13861 \begin_layout Plain Layout
13867 ] Whether the style requires the feature
13868 \begin_inset Flex Code
13871 \begin_layout Plain Layout
13878 See the description of
13879 \begin_inset Flex Code
13882 \begin_layout Plain Layout
13889 \begin_inset CommandInset ref
13890 LatexCommand pageref
13891 reference "des:FreeSpacing"
13895 ) for information on `features'.
13897 \change_inserted -712698321 1353693134
13901 \begin_layout Description
13903 \change_inserted -712698321 1353693371
13904 \begin_inset Flex Code
13907 \begin_layout Plain Layout
13909 \change_inserted -712698321 1353693146
13918 \begin_inset Flex Code
13921 \begin_layout Plain Layout
13923 \change_inserted -712698321 1353693235
13932 \begin_inset Flex Code
13935 \begin_layout Plain Layout
13937 \change_inserted -712698321 1353693235
13943 ] Resets the LaTeX arguments of this style (as defined via the
13944 \begin_inset Flex Code
13947 \begin_layout Plain Layout
13949 \change_inserted -712698321 1353693371
13958 This is useful if you have copied a style via
13959 \begin_inset Flex Code
13962 \begin_layout Plain Layout
13964 \change_inserted -712698321 1353693302
13972 , but you do not want to inherit its (required and optional) arguments.
13977 \begin_layout Description
13979 \change_inserted -712698321 1354263074
13980 \begin_inset Flex Code
13983 \begin_layout Plain Layout
13985 \change_inserted -712698321 1353866876
13992 \begin_inset Flex Code
13995 \begin_layout Plain Layout
13997 \change_inserted -712698321 1353866873
14003 ] A string that is put at the end of the layout content.
14004 A line break in the output can be indicated by
14005 \begin_inset Flex Code
14008 \begin_layout Plain Layout
14010 \change_inserted -712698321 1354263069
14021 \begin_layout Description
14022 \begin_inset Flex Code
14025 \begin_layout Plain Layout
14032 \begin_inset Flex Code
14035 \begin_layout Plain Layout
14042 \begin_inset Flex Code
14045 \begin_layout Plain Layout
14054 \begin_layout Description
14055 \begin_inset Flex Code
14058 \begin_layout Plain Layout
14065 \begin_inset Flex Code
14068 \begin_layout Plain Layout
14073 , onehalf, double, other
14082 ] This defines what the default spacing should be in the style.
14084 \begin_inset Flex Code
14087 \begin_layout Plain Layout
14094 \begin_inset Flex Code
14097 \begin_layout Plain Layout
14104 \begin_inset Flex Code
14107 \begin_layout Plain Layout
14113 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
14114 If you specify the argument
14115 \begin_inset Flex Code
14118 \begin_layout Plain Layout
14124 , then you should also provide a numerical argument which will be the actual
14126 Note that, contrary to other parameters,
14127 \begin_inset Flex Code
14130 \begin_layout Plain Layout
14136 implies the generation of specific LaTeX code, using the package
14139 \begin_inset Flex Code
14142 \begin_layout Plain Layout
14151 \begin_layout Description
14152 \begin_inset Flex Code
14155 \begin_layout Plain Layout
14162 \begin_inset Flex Code
14165 \begin_layout Plain Layout
14172 \begin_inset Flex Code
14175 \begin_layout Plain Layout
14183 ] Spellcheck paragraphs of this style.
14187 \begin_layout Description
14188 \begin_inset Flex Code
14191 \begin_layout Plain Layout
14197 The font used for the text body .
14199 \begin_inset CommandInset ref
14201 reference "sub:Font-description"
14208 \begin_layout Description
14209 \begin_inset Flex Code
14212 \begin_layout Plain Layout
14221 \begin_inset Flex Code
14224 \begin_layout Plain Layout
14234 The level of the style in the table of contents.
14235 This is used for automatic numbering of section headings.
14238 \begin_layout Description
14239 \begin_inset Flex Code
14242 \begin_layout Plain Layout
14249 \begin_inset Flex Code
14252 \begin_layout Plain Layout
14258 ] The vertical space with which the very first of a chain of paragraphs
14259 with this style is separated from the previous paragraph.
14260 If the previous paragraph has another style, the separations are not simply
14261 added, but the maximum is taken.
14264 \begin_layout Subsection
14265 \begin_inset CommandInset label
14271 Internationalization of Paragraph Styles
14274 \begin_layout Standard
14275 LyX has long supported internationalization of layout information, but,
14276 until version 2.0, this applied only to the user interface and not to, say,
14278 Thus, French authors were forced to resort to ugly hacks if they wanted
14283 1' instead of `Theorem 1'.
14284 Thanks to Georg Baum, that is no longer the case.
14287 \begin_layout Standard
14289 \begin_inset Flex Code
14292 \begin_layout Plain Layout
14298 defines text that is to appear in the typeset document, it may use
14299 \begin_inset Flex Code
14302 \begin_layout Plain Layout
14309 \begin_inset Flex Code
14312 \begin_layout Plain Layout
14318 to support non-English and even multi-language documents correctly.
14319 The following excerpt (from the
14320 \begin_inset Flex Code
14323 \begin_layout Plain Layout
14329 file) shows how this works:
14332 \begin_layout LyX-Code
14337 \begin_layout LyX-Code
14340 theoremstyle{remark}
14343 \begin_layout LyX-Code
14346 newtheorem{claim}[thm]{
14353 \begin_layout LyX-Code
14357 \begin_layout LyX-Code
14361 \begin_layout LyX-Code
14366 claimname}{_(Claim)}
14369 \begin_layout LyX-Code
14373 \begin_layout LyX-Code
14377 \begin_layout LyX-Code
14386 claimname}{_(Claim)}}
14389 \begin_layout LyX-Code
14394 \begin_layout Standard
14395 In principle, any legal LaTeX may appear in the
14396 \begin_inset Flex Code
14399 \begin_layout Plain Layout
14406 \begin_inset Flex Code
14409 \begin_layout Plain Layout
14415 tags, but in practice they will typically look as they do here.
14416 The key to correct translation of the typeset text is the definition of
14418 \begin_inset Flex Code
14421 \begin_layout Plain Layout
14430 \begin_inset Flex Code
14433 \begin_layout Plain Layout
14445 \begin_layout Standard
14447 \begin_inset Flex Code
14450 \begin_layout Plain Layout
14456 tag provides for internationalization based upon the overall language of
14458 The contents of the tag will be included in the preamble, just as with
14460 \begin_inset Flex Code
14463 \begin_layout Plain Layout
14470 What makes it special is the use of the
14471 \begin_inset Quotes eld
14475 \begin_inset Quotes erd
14479 \begin_inset Flex Code
14482 \begin_layout Plain Layout
14488 , which will be replaced, when LyX produces LaTeX output, with the translation
14489 of its argument into the document language.
14492 \begin_layout Standard
14494 \begin_inset Flex Code
14497 \begin_layout Plain Layout
14503 tag is more complex, since it is meant to provide support for multi-language
14504 documents and so offers an interface to the
14505 \begin_inset Flex Code
14508 \begin_layout Plain Layout
14515 Its contents will be added to the preamble once for each language that
14516 appears in the document.
14517 In this case, the argument to
14518 \begin_inset Flex Code
14521 \begin_layout Plain Layout
14527 will be replaced with its translation into the language in question; the
14529 \begin_inset Flex Code
14532 \begin_layout Plain Layout
14538 is replaced by the language name (as used by the babel package).
14541 \begin_layout Standard
14542 A German document that also included a French section would thus have the
14543 following in the preamble:
14546 \begin_layout LyX-Code
14555 claimname}{Affirmation}}
14563 claimname}{Behauptung}}
14567 claimname}{Behauptung}
14570 \begin_layout Standard
14572 \begin_inset Flex Code
14575 \begin_layout Plain Layout
14581 will then conspire to produce the correct text in the output.
14584 \begin_layout Standard
14585 One important point to note here is that the translations are provided by
14586 LyX itself, through the
14587 \change_inserted -195340706 1334775793
14589 \begin_inset Flex Code
14592 \begin_layout Plain Layout
14594 \change_inserted -195340706 1334775793
14601 \change_deleted -195340706 1334775793
14602 same mechanism it uses for internationalization of the user interface
14605 This means, in effect, that
14606 \begin_inset Flex Code
14609 \begin_layout Plain Layout
14616 \begin_inset Flex Code
14619 \begin_layout Plain Layout
14625 are really only of use in layout files that are provided with LyX, since
14626 text entered in user-created layout files will not be seen by LyX's internation
14628 \change_inserted -195340706 1334775793
14630 \begin_inset Flex Code
14633 \begin_layout Plain Layout
14635 \change_inserted -195340706 1334775793
14641 file is modified accordingly
14644 That said, however, any layout created with the intention that it will
14645 be included with LyX should use these tags where appropriate.
14647 \change_inserted -195340706 1334775793
14648 Please note that the paragraph style translations provided by LyX will
14649 never change with a minor update (e.g.
14650 from version 2.1.x to 2.1.y).
14651 It is however quite likely that a major update (e.g.
14652 from 2.0.x to 2.1.y) will introduce new translations or corrections.
14657 \begin_layout Subsection
14659 \begin_inset CommandInset label
14668 \begin_layout Standard
14669 Since version 1.3.0 of LyX, it is has been both possible and necessary to
14670 define the floats (
14671 \begin_inset Flex MenuItem
14674 \begin_layout Plain Layout
14681 \begin_inset Flex MenuItem
14684 \begin_layout Plain Layout
14690 , \SpecialChar \ldots{}
14691 ) in the text class itself.
14692 Standard floats are included in the file
14693 \begin_inset Flex Code
14696 \begin_layout Plain Layout
14702 , so you may have to do no more than add
14705 \begin_layout LyX-Code
14706 Input stdfloats.inc
14709 \begin_layout Standard
14710 to your layout file.
14711 If you want to implement a text class that proposes some other float types
14712 (like the AGU class bundled with LyX), the information below will hopefully
14716 \begin_layout Description
14717 \begin_inset Flex Code
14720 \begin_layout Plain Layout
14727 \begin_inset Flex Code
14730 \begin_layout Plain Layout
14737 \begin_inset Quotes erd
14741 \begin_inset Quotes erd
14744 ] The file name extension of an auxiliary file for the list of figures (or
14746 LaTeX writes the captions to this file.
14749 \begin_layout Description
14750 \begin_inset Flex Code
14753 \begin_layout Plain Layout
14760 \begin_inset Flex Code
14763 \begin_layout Plain Layout
14770 \begin_inset Quotes erd
14774 \begin_inset Quotes erd
14777 ] The string that will be used in the menus and also for the caption.
14778 This is translated to the current language if babel is used.
14781 \begin_layout Description
14782 \begin_inset Flex Code
14785 \begin_layout Plain Layout
14791 These are used for XHTML output.
14793 \begin_inset CommandInset ref
14795 reference "sec:Tags-for-XHTML"
14802 \begin_layout Description
14803 \begin_inset Flex Code
14806 \begin_layout Plain Layout
14815 \begin_inset Flex Code
14818 \begin_layout Plain Layout
14827 \begin_inset Flex Code
14830 \begin_layout Plain Layout
14836 ] Indicates whether the float is already defined in the document class or
14837 if we instead need to load
14838 \begin_inset Flex Code
14841 \begin_layout Plain Layout
14847 and use what it provides to define it on-the-fly.
14849 \begin_inset Flex Code
14852 \begin_layout Plain Layout
14859 \begin_inset Flex Code
14862 \begin_layout Plain Layout
14869 It should be set to
14870 \begin_inset Flex Code
14873 \begin_layout Plain Layout
14879 if the float is already defined by the LaTeX document class.
14882 \begin_layout Description
14883 \begin_inset Flex Code
14886 \begin_layout Plain Layout
14893 \begin_inset Flex Code
14896 \begin_layout Plain Layout
14903 \begin_inset Quotes erd
14907 \begin_inset Quotes erd
14910 ] The command used to generate a list of floats of this type; the leading
14913 ' should be omitted.
14919 \begin_inset Flex Code
14922 \begin_layout Plain Layout
14928 is false, since there is no standard way to generate this command.
14930 \begin_inset Flex Code
14933 \begin_layout Plain Layout
14939 is true, since in that case there is a standard way to define the command.
14942 \begin_layout Description
14943 \begin_inset Flex Code
14946 \begin_layout Plain Layout
14953 \begin_inset Flex Code
14956 \begin_layout Plain Layout
14963 \begin_inset Quotes erd
14967 \begin_inset Quotes erd
14970 ] A title for a list of floats of this kind (list of figures, tables, or
14972 It is used for the screen label within LyX; it is passed to LaTeX for use
14973 as the title there; and it is used as the title in XHTML output.
14974 It will be translated to the document language.
14977 \begin_layout Description
14978 \begin_inset Flex Code
14981 \begin_layout Plain Layout
14988 \begin_inset Flex Code
14991 \begin_layout Plain Layout
14998 \begin_inset Quotes erd
15002 \begin_inset Quotes erd
15005 ] This (optional) argument determines whether floats of this class will
15006 be numbered within some sectional unit of the document.
15007 For example, if within is equal to
15008 \begin_inset Flex Code
15011 \begin_layout Plain Layout
15017 , the floats will be numbered within chapters.
15021 \begin_layout Description
15022 \begin_inset Flex Code
15025 \begin_layout Plain Layout
15032 \begin_inset Flex Code
15035 \begin_layout Plain Layout
15042 \begin_inset Quotes erd
15046 \begin_inset Quotes erd
15049 ] The default placement for the given class of floats.
15050 The string should be as in standard LaTeX:
15051 \begin_inset Flex Code
15054 \begin_layout Plain Layout
15061 \begin_inset Flex Code
15064 \begin_layout Plain Layout
15071 \begin_inset Flex Code
15074 \begin_layout Plain Layout
15081 \begin_inset Flex Code
15084 \begin_layout Plain Layout
15090 for top, bottom, page, and here, respectively.
15094 \begin_layout Plain Layout
15095 Note that the order of these letters in the string is irrelevant, like in
15101 On top of that there is a new type,
15102 \begin_inset Flex Code
15105 \begin_layout Plain Layout
15111 , which does not really correspond to a float, since it means: put it
15112 \begin_inset Quotes eld
15116 \begin_inset Quotes erd
15120 Note however that the
15121 \begin_inset Flex Code
15124 \begin_layout Plain Layout
15130 specifier is special and, because of implementation details, cannot be
15131 used in non-built in float types.
15132 If you do not understand what this means, just use
15133 \begin_inset Quotes eld
15137 \begin_inset Flex Code
15140 \begin_layout Plain Layout
15147 \begin_inset Quotes erd
15153 \begin_layout Description
15154 \begin_inset Flex Code
15157 \begin_layout Plain Layout
15164 \begin_inset Flex Code
15167 \begin_layout Plain Layout
15173 ] The prefix to use when creating labels referring to floats of this type.
15174 This allows the use of formatted references.
15175 Note that you can remove any
15176 \begin_inset Flex Code
15179 \begin_layout Plain Layout
15185 set by a copied style by using the special value
15186 \begin_inset Quotes eld
15190 \begin_inset Quotes erd
15193 , which must be all caps.
15196 \begin_layout Description
15197 \begin_inset Flex Code
15200 \begin_layout Plain Layout
15207 \begin_inset Flex Code
15210 \begin_layout Plain Layout
15217 \begin_inset Quotes erd
15221 \begin_inset Quotes erd
15224 ] The style used when defining the float using
15225 \begin_inset Flex Code
15228 \begin_layout Plain Layout
15239 \begin_layout Description
15240 \begin_inset Flex Code
15243 \begin_layout Plain Layout
15250 \begin_inset Flex Code
15253 \begin_layout Plain Layout
15260 \begin_inset Quotes erd
15264 \begin_inset Quotes erd
15268 \begin_inset Quotes eld
15272 \begin_inset Quotes erd
15275 of the new class of floats, like program or algorithm.
15276 After the appropriate
15277 \begin_inset Flex Code
15280 \begin_layout Plain Layout
15289 \begin_inset Flex Code
15292 \begin_layout Plain Layout
15301 \begin_inset Flex Code
15304 \begin_layout Plain Layout
15315 \begin_layout Description
15316 \begin_inset Flex Code
15319 \begin_layout Plain Layout
15326 \begin_inset Flex Code
15329 \begin_layout Plain Layout
15336 \begin_inset Flex Code
15339 \begin_layout Plain Layout
15347 ] Tells us whether this float is defined using the facilities provided by
15349 \begin_inset Flex Code
15352 \begin_layout Plain Layout
15358 , either by the class file or a package, or on-the-fly by LyX itself.
15361 \begin_layout Standard
15362 Note that defining a float with type
15363 \begin_inset Flex Code
15366 \begin_layout Plain Layout
15374 automatically defines the corresponding counter with name
15375 \begin_inset Flex Code
15378 \begin_layout Plain Layout
15389 \begin_layout Subsection
15390 Flex insets and InsetLayout
15391 \begin_inset CommandInset label
15393 name "sub:Flex-insets-and"
15400 \begin_layout Standard
15401 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
15402 these are called Flex insets.
15406 \begin_layout Standard
15407 Flex insets come in three different kinds:
15410 \begin_layout Itemize
15412 \begin_inset Flex Code
15415 \begin_layout Plain Layout
15421 ): These define semantic markup corresponding to such LaTeX commands as
15423 \begin_inset Flex Code
15426 \begin_layout Plain Layout
15435 \begin_inset Flex Code
15438 \begin_layout Plain Layout
15449 \begin_layout Itemize
15451 \begin_inset Flex Code
15454 \begin_layout Plain Layout
15460 ): These can be used to define custom collapsible insets, similar to TeX
15461 code, footnote, and the like.
15462 An obvious example is an endnote inset, which is defined in the
15463 \begin_inset Flex Code
15466 \begin_layout Plain Layout
15475 \begin_layout Itemize
15477 \begin_inset Flex Code
15480 \begin_layout Plain Layout
15486 ): For use with DocBook classes.
15489 \begin_layout Standard
15490 Flex insets are defined using the
15491 \begin_inset Flex Code
15494 \begin_layout Plain Layout
15500 tag, which shall be explained in a moment.
15503 \begin_layout Standard
15505 \begin_inset Flex Code
15508 \begin_layout Plain Layout
15514 tag also serves another function: It can be used to customize the general
15515 layout of many different types of insets.
15517 \begin_inset Flex Code
15520 \begin_layout Plain Layout
15526 can be used to customize the layout parameters for footnotes, marginal
15527 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
15528 boxes, tables, algorithms, URLs, and optional arguments, as well as to
15529 define Flex insets.
15532 \begin_layout Standard
15534 \begin_inset Flex Code
15537 \begin_layout Plain Layout
15543 definition must begin with a line of the form:
15546 \begin_layout LyX-Code
15550 \begin_layout Standard
15552 \begin_inset Flex Code
15555 \begin_layout Plain Layout
15561 indicates the inset whose layout is being defined, and here there are
15562 \change_inserted 5863208 1334489266
15564 \change_deleted 5863208 1334489267
15570 \begin_layout Enumerate
15571 The layout for a pre-existing inset is being modified.
15572 In this case, can be
15573 \begin_inset Flex Code
15576 \begin_layout Plain Layout
15582 any one of the following:
15583 \begin_inset Flex Code
15586 \begin_layout Plain Layout
15593 \begin_inset Flex Code
15596 \begin_layout Plain Layout
15603 \begin_inset Flex Code
15606 \begin_layout Plain Layout
15613 \begin_inset Flex Code
15616 \begin_layout Plain Layout
15623 \begin_inset Flex Code
15626 \begin_layout Plain Layout
15633 \begin_inset Flex Code
15636 \begin_layout Plain Layout
15643 \begin_inset Flex Code
15646 \begin_layout Plain Layout
15653 \begin_inset Flex Code
15656 \begin_layout Plain Layout
15663 \begin_inset Flex Code
15666 \begin_layout Plain Layout
15673 \begin_inset Flex Code
15676 \begin_layout Plain Layout
15683 \begin_inset Flex Code
15686 \begin_layout Plain Layout
15693 \begin_inset Flex Code
15696 \begin_layout Plain Layout
15703 \begin_inset Flex Code
15706 \begin_layout Plain Layout
15713 \begin_inset Flex Code
15716 \begin_layout Plain Layout
15723 \begin_inset Flex Code
15726 \begin_layout Plain Layout
15733 \begin_inset Flex Code
15736 \begin_layout Plain Layout
15743 \begin_inset Flex Code
15746 \begin_layout Plain Layout
15753 \begin_inset Flex Code
15756 \begin_layout Plain Layout
15758 \change_deleted -712698321 1353866704
15762 \change_inserted -712698321 1353866707
15771 \begin_inset Flex Code
15774 \begin_layout Plain Layout
15781 \begin_inset Flex Code
15784 \begin_layout Plain Layout
15793 \begin_layout Enumerate
15794 The layout for a Flex inset is being defined.
15796 \begin_inset Flex Code
15799 \begin_layout Plain Layout
15805 must be of the form
15806 \begin_inset Quotes eld
15810 \begin_inset Flex Code
15813 \begin_layout Plain Layout
15820 \begin_inset Quotes erd
15824 \begin_inset Flex Code
15827 \begin_layout Plain Layout
15833 may be be any valid identifier not used by a pre-existing Flex inset.
15834 The identifier may include spaces, but in that case the whole thing must
15835 be wrapped in quotes.
15836 Note that the definition of a flex inset
15841 \begin_inset Flex Code
15844 \begin_layout Plain Layout
15850 entry, declaring which type of inset it defines.
15851 \change_inserted 5863208 1334489312
15855 \begin_layout Enumerate
15857 \change_inserted 5863208 1334492248
15858 The layout for user specific branch is being defined.
15860 \begin_inset Flex Code
15863 \begin_layout Plain Layout
15865 \change_inserted 5863208 1334489384
15871 must be of the form
15872 \begin_inset Quotes eld
15876 \begin_inset Flex Code
15879 \begin_layout Plain Layout
15881 \change_inserted 5863208 1334489392
15888 \begin_inset Quotes erd
15892 \begin_inset Flex Code
15895 \begin_layout Plain Layout
15897 \change_inserted 5863208 1334489384
15903 may be be any valid identifier of branch defined in user's document.
15904 The identifier may include spaces, but in that case the whole thing must
15905 be wrapped in quotes.
15906 The main purpose of this feature is to allow LaTeX wrapping around specific
15907 branches as user needs.
15912 \begin_layout Standard
15914 \begin_inset Flex Code
15917 \begin_layout Plain Layout
15923 definition can contain the following entries:
15926 \begin_layout Description
15928 \change_inserted -712698321 1353681390
15929 \begin_inset Flex Code
15932 \begin_layout Plain Layout
15934 \change_inserted -712698321 1353681344
15941 \begin_inset Flex Code
15944 \begin_layout Plain Layout
15946 \change_inserted -712698321 1353681344
15952 ] Defines argument number <int> of a command\SpecialChar \slash{}
15953 environment associated with
15954 the current layout.
15955 The definition must end with
15956 \begin_inset Flex Code
15959 \begin_layout Plain Layout
15961 \change_inserted -712698321 1353681344
15969 \begin_inset space ~
15973 \begin_inset CommandInset ref
15975 reference "sub:Paragraph-Styles"
15982 \begin_layout Description
15984 \change_inserted -195340706 1333913893
15985 \begin_inset Flex Code
15988 \begin_layout Plain Layout
15994 Preamble for changing languages.
15996 \begin_inset space ~
16000 \begin_inset CommandInset ref
16002 reference "sub:I18n"
16009 \begin_layout Description
16010 \begin_inset Flex Code
16013 \begin_layout Plain Layout
16019 The color for the inset's background.
16020 The valid colors are defined in
16021 \begin_inset Flex Code
16024 \begin_layout Plain Layout
16033 \begin_layout Description
16034 \begin_inset Flex Code
16037 \begin_layout Plain Layout
16044 \begin_inset Flex Code
16047 \begin_layout Plain Layout
16056 \begin_inset Flex Code
16059 \begin_layout Plain Layout
16065 ] Whether to use the content of the inset as the label, when the inset is
16070 \begin_layout Description
16071 \begin_inset Flex Code
16074 \begin_layout Plain Layout
16081 \begin_inset Flex Code
16084 \begin_layout Plain Layout
16090 Copies all the features of an existing style into the current one.
16094 \begin_layout Description
16095 \begin_inset Flex Code
16098 \begin_layout Plain Layout
16105 \begin_inset Flex Code
16108 \begin_layout Plain Layout
16117 \begin_inset Flex Code
16120 \begin_layout Plain Layout
16126 ] Indicates whether the user may employ the Paragraph Settings dialog to
16127 customize the paragraph.
16130 \begin_layout Description
16131 \begin_inset Flex Code
16134 \begin_layout Plain Layout
16141 \begin_inset Flex Code
16144 \begin_layout Plain Layout
16151 \begin_inset Flex Code
16154 \begin_layout Plain Layout
16161 \begin_inset Flex Code
16164 \begin_layout Plain Layout
16170 , describing the rendering style used for the inset's frame and buttons.
16171 Footnotes generally use
16172 \begin_inset Flex Code
16175 \begin_layout Plain Layout
16181 , ERT insets generally
16182 \begin_inset Flex Code
16185 \begin_layout Plain Layout
16191 , and character styles
16192 \begin_inset Flex Code
16195 \begin_layout Plain Layout
16204 \begin_layout Description
16205 \begin_inset Flex Code
16208 \begin_layout Plain Layout
16215 \begin_inset Flex Code
16218 \begin_layout Plain Layout
16225 \begin_inset Flex Code
16228 \begin_layout Plain Layout
16237 \begin_inset Flex Code
16240 \begin_layout Plain Layout
16247 \begin_inset Flex Code
16250 \begin_layout Plain Layout
16257 Indicates whether the environment will stand on its own in LaTeX output
16258 or will appear inline with the surrounding text.
16259 If set to false, it is supposed that the LaTeX environment ignores white
16260 space (including one newline character) after the
16261 \begin_inset Flex Code
16264 \begin_layout Plain Layout
16277 \begin_inset Flex Code
16280 \begin_layout Plain Layout
16296 \begin_layout Description
16297 \begin_inset Flex Code
16300 \begin_layout Plain Layout
16306 Required at the end of the InsetLayout declarations.
16309 \begin_layout Description
16310 \begin_inset Flex Code
16313 \begin_layout Plain Layout
16319 The font used for both the text body
16325 \begin_inset space ~
16329 \begin_inset CommandInset ref
16331 reference "sub:Font-description"
16336 Note that defining this font automatically defines the
16337 \begin_inset Flex Code
16340 \begin_layout Plain Layout
16346 to the same value, so define this first and define
16347 \begin_inset Flex Code
16350 \begin_layout Plain Layout
16356 later if you want them to be different.
16357 \change_inserted 155139281 1354130923
16361 \begin_layout Description
16363 \change_inserted 155139281 1354130923
16364 \begin_inset Flex Code
16367 \begin_layout Plain Layout
16369 \change_inserted 155139281 1354130923
16370 ForceLocalFontSwitch
16376 \begin_inset Flex Code
16379 \begin_layout Plain Layout
16381 \change_inserted 155139281 1354130923
16390 \begin_inset Flex Code
16393 \begin_layout Plain Layout
16395 \change_inserted 155139281 1354130923
16401 ] When using babel, always use a local font switch (
16402 \begin_inset Flex Code
16405 \begin_layout Plain Layout
16407 \change_inserted 155139281 1354130923
16415 ), never a global one (such as
16416 \begin_inset Flex Code
16419 \begin_layout Plain Layout
16421 \change_inserted 155139281 1354130923
16434 \begin_layout Description
16435 \begin_inset Flex Code
16438 \begin_layout Plain Layout
16445 \begin_inset Quotes eld
16449 \begin_inset Quotes erd
16452 language, leading to Left-to-Right (latin) output, e.
16453 \begin_inset space \thinspace{}
16457 \begin_inset space \space{}
16460 in TeX code or URL.
16464 \begin_layout Description
16465 \begin_inset Flex Code
16468 \begin_layout Plain Layout
16475 \begin_inset Flex Code
16478 \begin_layout Plain Layout
16487 \begin_inset Flex Code
16490 \begin_layout Plain Layout
16496 ] Indicates whether the
16497 \begin_inset Flex Code
16500 \begin_layout Plain Layout
16506 should be used or, instead, the user can change the paragraph style used
16511 \begin_layout Description
16512 \begin_inset Flex Code
16515 \begin_layout Plain Layout
16522 \begin_inset Flex Code
16525 \begin_layout Plain Layout
16534 \begin_inset Flex Code
16537 \begin_layout Plain Layout
16543 ] Usually LyX doesn't allow you to insert more than one space between words,
16544 since a space is considered as the separation between two words, not a
16545 character or symbol of its own.
16546 This is a very fine thing but sometimes annoying, for example, when typing
16547 program code or plain LaTeX code.
16549 \begin_inset Flex Code
16552 \begin_layout Plain Layout
16559 Note that LyX will create protected blanks for the additional blanks when
16560 in another mode than LaTeX-mode.
16564 \begin_layout Description
16565 \begin_inset Flex Code
16568 \begin_layout Plain Layout
16574 These tags control XHTML output.
16576 \begin_inset CommandInset ref
16578 reference "sec:Tags-for-XHTML"
16585 \begin_layout Description
16586 \begin_inset Flex Code
16589 \begin_layout Plain Layout
16596 \begin_inset Flex Code
16599 \begin_layout Plain Layout
16608 \begin_inset Flex Code
16611 \begin_layout Plain Layout
16617 ] Whether to include the contents of this inset in the strings generated
16618 for the `Outline' pane.
16619 One would not, for example, want the content of a footnote in a section
16620 header to be included in the TOC displayed in the outline, but one would
16621 normally want the content of a character style displayed.
16622 Default is false: not to include.
16625 \begin_layout Description
16626 \begin_inset Flex Code
16629 \begin_layout Plain Layout
16636 \begin_inset Flex Code
16639 \begin_layout Plain Layout
16648 \begin_inset Flex Code
16651 \begin_layout Plain Layout
16657 ] Usually LyX does not allow you to leave a paragraph empty, since it would
16658 lead to empty LaTeX output.
16659 There are some cases where this could be desirable however: in a letter
16660 template, the required fields can be provided as empty fields, so that
16661 people do not forget them; in some special classes, a style can be used
16662 as some kind of break, which does not contain actual text.
16666 \begin_layout Description
16667 \begin_inset Flex Code
16670 \begin_layout Plain Layout
16676 The font used for the label.
16678 \begin_inset space ~
16682 \begin_inset CommandInset ref
16684 reference "sub:Font-description"
16689 Note that this definition can never appear before
16690 \begin_inset Flex Code
16693 \begin_layout Plain Layout
16699 , lest it be ineffective.
16702 \begin_layout Description
16703 \begin_inset Flex Code
16706 \begin_layout Plain Layout
16712 What will be displayed on the button or elsewhere as the inset label.
16714 \begin_inset Flex Code
16717 \begin_layout Plain Layout
16724 \begin_inset Flex Code
16727 \begin_layout Plain Layout
16733 ) modify this label on the fly.
16736 \begin_layout Description
16738 \change_inserted -195340706 1333913893
16739 \begin_inset Flex Code
16742 \begin_layout Plain Layout
16748 Language dependent preamble.
16750 \begin_inset space ~
16754 \begin_inset CommandInset ref
16756 reference "sub:I18n"
16763 \begin_layout Description
16764 \begin_inset Flex Code
16767 \begin_layout Plain Layout
16773 The name of the corresponding LaTeX stuff.
16774 Either the environment or command name.
16777 \begin_layout Description
16778 \begin_inset Flex Code
16781 \begin_layout Plain Layout
16787 The optional parameter for the corresponding
16788 \begin_inset Flex Code
16791 \begin_layout Plain Layout
16797 stuff, including possible bracket pairs like
16798 \begin_inset Flex Code
16801 \begin_layout Plain Layout
16809 \change_inserted -712698321 1355144715
16810 This will be output as is after all LaTeX
16811 \begin_inset Flex Code
16814 \begin_layout Plain Layout
16816 \change_inserted -712698321 1355144713
16825 This parameter cannot be changed from within LyX
16826 \change_inserted -712698321 1355144775
16828 \begin_inset Flex Code
16831 \begin_layout Plain Layout
16833 \change_inserted -712698321 1355144747
16839 for customizable parameters)
16844 \begin_layout Description
16845 \begin_inset Flex Code
16848 \begin_layout Plain Layout
16855 \begin_inset Flex Code
16858 \begin_layout Plain Layout
16860 \change_deleted -712698321 1353867544
16867 Command, Environment,
16868 \change_inserted -712698321 1353867573
16870 \change_deleted -712698321 1353867557
16879 \begin_inset Flex Code
16882 \begin_layout Plain Layout
16884 \change_deleted -712698321 1353867564
16888 \change_deleted -712698321 1353867569
16896 ] How the style should be translated into LaTeX.
16900 \begin_layout Plain Layout
16901 \begin_inset Flex Code
16904 \begin_layout Plain Layout
16910 is perhaps a bit misleading, since these rules apply to SGML classes, too.
16911 Visit the SGML class files for specific examples.
16920 \begin_layout Itemize
16921 \begin_inset Flex Code
16924 \begin_layout Plain Layout
16926 \change_deleted -712698321 1353867582
16928 \change_inserted -712698321 1353867583
16936 means nothing special.
16940 \begin_layout Itemize
16941 \begin_inset Flex Code
16944 \begin_layout Plain Layout
16951 \begin_inset Flex Code
16954 \begin_layout Plain Layout
16961 {\SpecialChar \ldots{}
16970 \begin_layout Itemize
16971 \begin_inset Flex Code
16974 \begin_layout Plain Layout
16981 \begin_inset Flex Code
16984 \begin_layout Plain Layout
16991 }\SpecialChar \ldots{}
17007 \begin_layout Itemize
17009 \change_deleted -712698321 1353867600
17010 \begin_inset Flex Code
17013 \begin_layout Plain Layout
17020 \begin_inset Flex Code
17023 \begin_layout Plain Layout
17030 \begin_inset Flex Code
17033 \begin_layout Plain Layout
17041 is generated for each paragraph of this environment.
17045 \begin_layout Itemize
17047 \change_deleted -712698321 1353867600
17048 \begin_inset Flex Code
17051 \begin_layout Plain Layout
17058 \begin_inset Flex Code
17061 \begin_layout Plain Layout
17068 \begin_inset Flex Code
17071 \begin_layout Plain Layout
17077 is passed as an argument to the environment.
17079 \begin_inset Flex Code
17082 \begin_layout Plain Layout
17088 can be defined in the
17089 \begin_inset Flex MenuItem
17092 \begin_layout Plain Layout
17097 \SpecialChar \menuseparator
17103 \begin_inset space ~
17117 \begin_layout Standard
17118 Putting the last few things together, the LaTeX output will be either:
17121 \begin_layout LyX-Code
17124 latexname[latexparam]{\SpecialChar \ldots{}
17128 \begin_layout Standard
17132 \begin_layout LyX-Code
17135 begin{latexname}[latexparam] \SpecialChar \ldots{}
17141 \begin_layout Standard
17142 depending upon the LaTeX type.
17146 \begin_layout Description
17148 \change_inserted -712698321 1354263128
17149 \begin_inset Flex Code
17152 \begin_layout Plain Layout
17154 \change_inserted -712698321 1353866742
17163 \begin_inset Flex Code
17166 \begin_layout Plain Layout
17168 \change_inserted -712698321 1353866752
17174 ] A string that is put at the beginning of the layout content.
17175 A line break in the output can be indicated by
17176 \begin_inset Flex Code
17179 \begin_layout Plain Layout
17181 \change_inserted -712698321 1354263128
17192 \begin_layout Description
17193 \begin_inset Flex Code
17196 \begin_layout Plain Layout
17203 \begin_inset Flex Code
17206 \begin_layout Plain Layout
17213 \begin_inset Flex Code
17216 \begin_layout Plain Layout
17223 \begin_inset Flex Code
17226 \begin_layout Plain Layout
17233 \begin_inset Flex Code
17236 \begin_layout Plain Layout
17242 (indicating a dummy definition ending definitions of charstyles, etc).
17243 This entry is required in and is only meaningful for Flex insets.
17244 Among other things, it determines on which menu this inset will appear.
17246 \begin_inset Flex Code
17249 \begin_layout Plain Layout
17256 \begin_inset Flex Code
17259 \begin_layout Plain Layout
17266 \begin_inset Flex Code
17269 \begin_layout Plain Layout
17277 \begin_inset Flex Code
17280 \begin_layout Plain Layout
17286 can be set to true for charstyle insets, if you wish, by setting it
17291 \begin_inset Flex Code
17294 \begin_layout Plain Layout
17303 \begin_layout Description
17304 \begin_inset Flex Code
17307 \begin_layout Plain Layout
17314 \begin_inset Flex Code
17317 \begin_layout Plain Layout
17326 \begin_inset Flex Code
17329 \begin_layout Plain Layout
17335 ] Whether multiple paragraphs are permitted in this inset.
17337 \begin_inset Flex Code
17340 \begin_layout Plain Layout
17346 to the same value and
17347 \begin_inset Flex Code
17350 \begin_layout Plain Layout
17356 to the opposite value.
17357 These can be reset to other values, if they are used
17362 \begin_inset Flex Code
17365 \begin_layout Plain Layout
17375 \begin_layout Description
17376 \begin_inset Flex Code
17379 \begin_layout Plain Layout
17386 \begin_inset Flex Code
17389 \begin_layout Plain Layout
17398 \begin_inset Flex Code
17401 \begin_layout Plain Layout
17407 ] Whether fragile commands in this inset should be
17408 \begin_inset Flex Code
17411 \begin_layout Plain Layout
17424 whether the command should itself be protected.) Default is false.
17427 \begin_layout Description
17428 \begin_inset Flex Code
17431 \begin_layout Plain Layout
17438 \begin_inset Flex Code
17441 \begin_layout Plain Layout
17450 \begin_inset Flex Code
17453 \begin_layout Plain Layout
17459 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
17460 output, but only by a line break; together with
17461 \begin_inset Flex Code
17464 \begin_layout Plain Layout
17470 , this allows to emulate a plain text editor (like the ERT inset).
17474 \begin_layout Description
17475 \begin_inset Flex Code
17478 \begin_layout Plain Layout
17485 \begin_inset Flex Code
17488 \begin_layout Plain Layout
17497 \begin_inset Flex Code
17500 \begin_layout Plain Layout
17506 ] Whether the contents of this paragraph should be output in raw form, meaning
17507 without special translations that LaTeX would require.
17510 \begin_layout Description
17511 \begin_inset Flex Code
17514 \begin_layout Plain Layout
17520 Information to be included in the LaTeX preamble when this style is used.
17521 Used to define macros, load packages, etc., required by this particular
17524 \begin_inset Quotes eld
17528 \begin_inset Flex Code
17531 \begin_layout Plain Layout
17538 \begin_inset Quotes erd
17544 \begin_layout Description
17545 \begin_inset Flex Code
17548 \begin_layout Plain Layout
17555 \begin_inset Flex Code
17558 \begin_layout Plain Layout
17564 ] The prefix to use when creating labels referring to insets of this type.
17565 This allows the use of formatted references.
17568 \begin_layout Description
17569 \begin_inset Flex Code
17572 \begin_layout Plain Layout
17579 \begin_inset Flex Code
17582 \begin_layout Plain Layout
17588 ] Whether the style requires the feature
17589 \begin_inset Flex Code
17592 \begin_layout Plain Layout
17599 See the description of
17600 \begin_inset Flex Code
17603 \begin_layout Plain Layout
17610 \begin_inset CommandInset ref
17611 LatexCommand pageref
17612 reference "des:FreeSpacing"
17616 ) for information on `features'.
17617 \change_inserted -712698321 1354439699
17621 \begin_layout Description
17623 \change_inserted -712698321 1354439705
17624 \begin_inset Flex Code
17627 \begin_layout Plain Layout
17629 \change_inserted -712698321 1354439699
17636 \begin_inset Flex Code
17639 \begin_layout Plain Layout
17641 \change_inserted -712698321 1354439699
17650 \begin_inset Flex Code
17653 \begin_layout Plain Layout
17655 \change_inserted -712698321 1354439699
17661 ] Resets the LaTeX arguments of this layout (as defined via the
17662 \begin_inset Flex Code
17665 \begin_layout Plain Layout
17667 \change_inserted -712698321 1354439699
17674 This is useful if you have copied a style via
17675 \begin_inset Flex Code
17678 \begin_layout Plain Layout
17680 \change_inserted -712698321 1354439699
17686 , but you do not want to inherit its (required and optional) arguments.
17688 \change_deleted -712698321 1354439698
17694 \begin_layout Description
17695 \begin_inset Flex Code
17698 \begin_layout Plain Layout
17705 \begin_inset Flex Code
17708 \begin_layout Plain Layout
17715 \begin_inset Flex Code
17718 \begin_layout Plain Layout
17726 ] Whether this inset should use the font of its surrounding environment
17728 Default is true: uses its own.
17729 \change_inserted -712698321 1353866806
17733 \begin_layout Description
17735 \change_inserted -712698321 1354263134
17736 \begin_inset Flex Code
17739 \begin_layout Plain Layout
17741 \change_inserted -712698321 1353866810
17748 \begin_inset Flex Code
17751 \begin_layout Plain Layout
17753 \change_inserted -712698321 1353866806
17759 ] A string that is put at the end of the layout content.
17760 A line break in the output can be indicated by
17761 \begin_inset Flex Code
17764 \begin_layout Plain Layout
17766 \change_inserted -712698321 1354263134
17777 \begin_layout Description
17778 \begin_inset Flex Code
17781 \begin_layout Plain Layout
17788 \begin_inset Flex Code
17791 \begin_layout Plain Layout
17798 \begin_inset Flex Code
17801 \begin_layout Plain Layout
17809 ] Spellcheck the contents of this inset.
17813 \begin_layout Subsection
17815 \begin_inset CommandInset label
17817 name "sub:Counters"
17824 \begin_layout Standard
17825 Since version 1.3.0 of LyX, it is both possible and necessary to define the
17827 \begin_inset Flex MenuItem
17830 \begin_layout Plain Layout
17837 \begin_inset Flex MenuItem
17840 \begin_layout Plain Layout
17846 , \SpecialChar \ldots{}
17847 ) in the text class itself.
17848 The standard counters are defined in the file
17849 \begin_inset Flex Code
17852 \begin_layout Plain Layout
17858 , so you may have to do no more than add
17861 \begin_layout LyX-Code
17862 Input stdcounters.inc
17865 \begin_layout Standard
17866 to your layout file to get them to work.
17867 But if you want to define custom counters, then you can do so.
17868 The counter declaration must begin with:
17871 \begin_layout LyX-Code
17872 Counter CounterName
17875 \begin_layout Standard
17877 \begin_inset Flex Code
17880 \begin_layout Plain Layout
17886 ' is replaced by the name of the counter.
17887 And it must end with
17888 \begin_inset Quotes eld
17892 \begin_inset Flex Code
17895 \begin_layout Plain Layout
17902 \begin_inset Quotes erd
17906 The following parameters can also be used:
17909 \begin_layout Description
17910 \begin_inset Flex Code
17913 \begin_layout Plain Layout
17920 \begin_inset Flex Code
17923 \begin_layout Plain Layout
17930 \begin_inset Quotes erd
17934 \begin_inset Quotes erd
17937 ] When defined, this string defines how the counter is displayed.
17938 Setting this value sets
17939 \begin_inset Flex Code
17942 \begin_layout Plain Layout
17943 LabelStringAppendix
17949 The following special constructs can be used in the string:
17953 \begin_layout Itemize
17954 \begin_inset Flex Code
17957 \begin_layout Plain Layout
17965 will be replaced by the expansion of the
17966 \begin_inset Flex Code
17969 \begin_layout Plain Layout
17976 \begin_inset Flex Code
17979 \begin_layout Plain Layout
17980 LabelStringAppendix
17986 \begin_inset Flex Code
17989 \begin_layout Plain Layout
17999 \begin_layout Itemize
18000 counter values can be expressed using LaTeX-like macros
18001 \begin_inset Flex Code
18004 \begin_layout Plain Layout
18021 \begin_inset Flex Code
18024 \begin_layout Plain Layout
18036 \begin_layout Plain Layout
18046 Actually, the situation is a bit more complicated: any
18065 other than those described below will produce arabic numerals.
18066 It would not be surprising to see this change in the future.
18072 \begin_inset Flex Code
18075 \begin_layout Plain Layout
18081 : 1, 2, 3,\SpecialChar \ldots{}
18083 \begin_inset Flex Code
18086 \begin_layout Plain Layout
18092 for lower-case letters: a, b, c, \SpecialChar \ldots{}
18094 \begin_inset Flex Code
18097 \begin_layout Plain Layout
18103 for upper-case letters: A, B, C, \SpecialChar \ldots{}
18105 \begin_inset Flex Code
18108 \begin_layout Plain Layout
18114 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
18116 \begin_inset Flex Code
18119 \begin_layout Plain Layout
18125 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
18127 \begin_inset Flex Code
18130 \begin_layout Plain Layout
18136 for hebrew numerals.
18140 \begin_layout Standard
18141 If LabelString is not defined, a default value is constructed as follows:
18142 if the counter has a master counter
18143 \begin_inset Flex Code
18146 \begin_layout Plain Layout
18153 \begin_inset Flex Code
18156 \begin_layout Plain Layout
18163 \begin_inset Flex Code
18166 \begin_layout Plain Layout
18176 is used; otherwise the string
18177 \begin_inset Flex Code
18180 \begin_layout Plain Layout
18191 \begin_layout Description
18192 \begin_inset Flex Code
18195 \begin_layout Plain Layout
18196 LabelStringAppendix
18202 \begin_inset Flex Code
18205 \begin_layout Plain Layout
18212 \begin_inset Quotes erd
18216 \begin_inset Quotes erd
18220 \begin_inset Flex Code
18223 \begin_layout Plain Layout
18229 , but for use in the Appendix.
18232 \begin_layout Description
18233 \begin_inset Flex Code
18236 \begin_layout Plain Layout
18243 \begin_inset Flex Code
18246 \begin_layout Plain Layout
18253 \begin_inset Quotes erd
18257 \begin_inset Quotes erd
18260 ] A format for use with formatted references to this counter.
18261 For example, one might want to have references to section numbers appear
18263 \begin_inset Quotes eld
18267 \begin_inset Quotes erd
18271 The string should contain
18272 \begin_inset Quotes eld
18276 \begin_inset Quotes erd
18280 This will be replaced by the counter number itself.
18281 So, for sections, it would be: Section ##.
18284 \begin_layout Description
18285 \begin_inset Flex Code
18288 \begin_layout Plain Layout
18295 \begin_inset Flex Code
18298 \begin_layout Plain Layout
18305 \begin_inset Quotes erd
18309 \begin_inset Quotes erd
18312 ] If this is set to the name of another counter, the present counter will
18313 be reset every time the other one is increased.
18315 \begin_inset Flex Code
18318 \begin_layout Plain Layout
18325 \begin_inset Flex Code
18328 \begin_layout Plain Layout
18337 \begin_layout Subsection
18339 \begin_inset CommandInset label
18341 name "sub:Font-description"
18348 \begin_layout Standard
18349 A font description looks like this:
18352 \begin_layout LyX-Code
18362 \begin_layout LyX-Code
18366 \begin_layout LyX-Code
18370 \begin_layout Standard
18371 The following commands are available:
18374 \begin_layout Description
18375 \begin_inset Flex Code
18378 \begin_layout Plain Layout
18385 \begin_inset Flex Code
18388 \begin_layout Plain Layout
18397 \begin_inset Flex Code
18400 \begin_layout Plain Layout
18407 \begin_inset Flex Code
18410 \begin_layout Plain Layout
18417 \begin_inset Flex Code
18420 \begin_layout Plain Layout
18427 \begin_inset Flex Code
18430 \begin_layout Plain Layout
18437 \begin_inset Flex Code
18440 \begin_layout Plain Layout
18447 \begin_inset Flex Code
18450 \begin_layout Plain Layout
18457 \begin_inset Flex Code
18460 \begin_layout Plain Layout
18467 \begin_inset Flex Code
18470 \begin_layout Plain Layout
18479 \begin_layout Description
18480 \begin_inset Flex Code
18483 \begin_layout Plain Layout
18490 \begin_inset Flex Code
18493 \begin_layout Plain Layout
18502 \begin_inset Flex Code
18505 \begin_layout Plain Layout
18512 \begin_inset Flex Code
18515 \begin_layout Plain Layout
18524 \begin_layout Description
18525 \begin_inset Flex Code
18528 \begin_layout Plain Layout
18535 \begin_inset Flex Code
18538 \begin_layout Plain Layout
18544 ] Valid arguments are:
18545 \begin_inset Flex Code
18548 \begin_layout Plain Layout
18555 \begin_inset Flex Code
18558 \begin_layout Plain Layout
18565 \begin_inset Flex Code
18568 \begin_layout Plain Layout
18575 \begin_inset Flex Code
18578 \begin_layout Plain Layout
18585 \begin_inset Flex Code
18588 \begin_layout Plain Layout
18595 \begin_inset Flex Code
18598 \begin_layout Plain Layout
18605 \begin_inset Flex Code
18608 \begin_layout Plain Layout
18615 \begin_inset Flex Code
18618 \begin_layout Plain Layout
18625 \begin_inset Flex Code
18628 \begin_layout Plain Layout
18635 \begin_inset Flex Code
18638 \begin_layout Plain Layout
18645 \begin_inset Flex Code
18648 \begin_layout Plain Layout
18655 \begin_inset Flex Code
18658 \begin_layout Plain Layout
18665 Each of these turns on or off the corresponding attribute.
18667 \begin_inset Flex Code
18670 \begin_layout Plain Layout
18676 turns on emphasis, and
18677 \begin_inset Flex Code
18680 \begin_layout Plain Layout
18688 \begin_inset Newline newline
18691 If the latter seems puzzling, remember that the font settings for the present
18692 context are generally inherited from the surrounding context.
18694 \begin_inset Flex Code
18697 \begin_layout Plain Layout
18703 would turn off the emphasis that was anyway in effect, say, in a theorem
18707 \begin_layout Description
18708 \begin_inset Flex Code
18711 \begin_layout Plain Layout
18718 \begin_inset Flex Code
18721 \begin_layout Plain Layout
18730 \begin_inset Flex Code
18733 \begin_layout Plain Layout
18742 \begin_layout Description
18743 \begin_inset Flex Code
18746 \begin_layout Plain Layout
18753 \begin_inset Flex Code
18756 \begin_layout Plain Layout
18765 \begin_inset Flex Code
18768 \begin_layout Plain Layout
18775 \begin_inset Flex Code
18778 \begin_layout Plain Layout
18785 \begin_inset Flex Code
18788 \begin_layout Plain Layout
18797 \begin_layout Description
18798 \begin_inset Flex Code
18801 \begin_layout Plain Layout
18808 \begin_inset Flex Code
18811 \begin_layout Plain Layout
18818 \begin_inset Flex Code
18821 \begin_layout Plain Layout
18828 \begin_inset Flex Code
18831 \begin_layout Plain Layout
18840 \begin_inset Flex Code
18843 \begin_layout Plain Layout
18850 \begin_inset Flex Code
18853 \begin_layout Plain Layout
18860 \begin_inset Flex Code
18863 \begin_layout Plain Layout
18870 \begin_inset Flex Code
18873 \begin_layout Plain Layout
18880 \begin_inset Flex Code
18883 \begin_layout Plain Layout
18892 \begin_layout Subsection
18893 \begin_inset CommandInset label
18895 name "sub:Citation-format-description"
18899 Citation format description
18902 \begin_layout Standard
18904 \begin_inset Flex Code
18907 \begin_layout Plain Layout
18913 blocks are used to describe how bibliographic information should be displayed,
18914 both within LyX itself (in the citation dialog and in tooltips, for example)
18915 and in XHTML output.
18916 Such a block might look like this:
18919 \begin_layout LyX-Code
18923 \begin_layout LyX-Code
18927 \begin_layout LyX-Code
18931 \begin_layout LyX-Code
18935 \begin_layout Standard
18936 The individual lines define how the bibliographic information associated
18937 with an article or book, respectively, is to be displayed, and such a definitio
18938 n can be given for any `entry type' that might be present in a BibTeX file.
18939 LyX defines a default format in the source code that will be used if no
18940 specific definition has been given.
18941 LyX predefines several formats in the file
18942 \begin_inset Flex Code
18945 \begin_layout Plain Layout
18951 , which is included in most of LyX's document classes.
18954 \begin_layout Standard
18955 The definitions use a simple language that allows BibTeX keys to be replaced
18957 Keys should be enclosed in
18958 \begin_inset Flex Code
18961 \begin_layout Plain Layout
18968 \begin_inset Flex Code
18971 \begin_layout Plain Layout
18978 So a simple definition might look like this:
18981 \begin_layout LyX-Code
18983 \begin_inset Quotes eld
18987 \begin_inset Quotes erd
18993 \begin_layout Standard
18994 This would print the author, followed by a comma, followed by the title,
18995 in quotes, followed by a period.
18998 \begin_layout Standard
18999 Of course, sometimes you may want to print a key only if it exists.
19000 This can be done by using a conditional construction, such as:
19001 \begin_inset Flex Code
19004 \begin_layout Plain Layout
19006 \begin_inset space ~
19016 \begin_inset Flex Code
19019 \begin_layout Plain Layout
19025 key exists, then print
19026 \begin_inset Quotes eld
19030 \begin_inset space ~
19034 \begin_inset Quotes erd
19037 followed by the volume key.
19038 It is also possible to have an else clause in the conditional, such as:
19040 \begin_inset Flex Code
19043 \begin_layout Plain Layout
19044 {%author%[[%author%]][[%editor%, ed.]]}
19051 \begin_inset Flex Code
19054 \begin_layout Plain Layout
19060 key is printed if it exists; otherwise, the editor key is printed, followed
19062 \begin_inset Quotes eld
19066 \begin_inset space ~
19070 \begin_inset Quotes erd
19073 Note that the key is again enclosed in
19074 \begin_inset Flex Code
19077 \begin_layout Plain Layout
19083 signs; the entire conditional is enclosed in braces; and the if and else
19084 clauses are enclosed in double brackets,
19085 \begin_inset Quotes eld
19089 \begin_inset Flex Code
19092 \begin_layout Plain Layout
19099 \begin_inset Quotes eld
19103 \begin_inset Quotes eld
19107 \begin_inset Flex Code
19110 \begin_layout Plain Layout
19117 \begin_inset Quotes erd
19121 There must be no space between any of these.
19124 \begin_layout Standard
19125 There is one other piece of syntax available in definitions, which looks
19127 \begin_inset Flex Code
19130 \begin_layout Plain Layout
19137 This defines a piece of formatting information that is to be used when
19139 \begin_inset Quotes eld
19143 \begin_inset Quotes erd
19147 Obviously, we do not want to output HTML tags when writing plain text,
19148 so they should be wrapped in
19149 \begin_inset Quotes eld
19153 \begin_inset Quotes erd
19157 \begin_inset Quotes eld
19161 \begin_inset Quotes erd
19167 \begin_layout Standard
19168 Two special sorts of definitions are also possible in a
19169 \begin_inset Flex Code
19172 \begin_layout Plain Layout
19179 An example of the first would be:
19182 \begin_layout LyX-Code
19184 \begin_inset Quotes eld
19188 \begin_inset Quotes erd
19194 \begin_layout Standard
19195 This is an abbreviation, or macro, and it can be used by treating it as
19197 \begin_inset Flex Code
19200 \begin_layout Plain Layout
19208 \begin_inset Flex Code
19211 \begin_layout Plain Layout
19217 exactly as it would treat its definition.
19218 So, let us issue the obvious
19226 \begin_layout LyX-Code
19230 \begin_layout Standard
19231 or anything like it.
19232 LyX shouldn't go into an infinite loop, but it may go into a long one before
19236 \begin_layout Standard
19237 The second sort of special definition might look like this:
19240 \begin_layout LyX-Code
19244 \begin_layout Standard
19245 This defines a translatable piece of text, which allows relevant parts of
19246 the bibliography to be translated.
19247 It can be included in a definition by treating it as a key:
19248 \begin_inset Flex Code
19251 \begin_layout Plain Layout
19258 Several of these are predefined in
19259 \begin_inset Flex Code
19262 \begin_layout Plain Layout
19269 Note that these are not macros, in the sense just defined.
19270 They will not be expanded.
19273 \begin_layout Standard
19274 So here then is an example that use all these features:
19277 \begin_layout LyX-Code
19278 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
19281 \begin_layout Standard
19282 This defines a macro that prints the author, followed by a comma, if the
19284 \begin_inset Flex Code
19287 \begin_layout Plain Layout
19293 key is defined, or else prints the name of the editor, followed by the
19295 \begin_inset Flex Code
19298 \begin_layout Plain Layout
19304 or its translation (it is by default
19305 \begin_inset Quotes eld
19309 \begin_inset Quotes erd
19313 \begin_inset Flex Code
19316 \begin_layout Plain Layout
19323 Note that this is in fact defined in
19324 \begin_inset Flex Code
19327 \begin_layout Plain Layout
19333 , so you can use it in your own definitions, or re-definitions, if you load
19337 \begin_layout Section
19338 \begin_inset CommandInset label
19340 name "sec:Tags-for-XHTML"
19344 Tags for XHTML output
19347 \begin_layout Standard
19348 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
19349 by layout information.
19350 In general, LyX provides sensible defaults and, as mentioned earlier, it
19351 will even construct default CSS style rules from the other layout tags.
19352 For example, LyX will attempt to use the information provided in the
19353 \begin_inset Flex Code
19356 \begin_layout Plain Layout
19362 declaration for the Chapter style to write CSS that will appropriately
19363 format chapter headings.
19366 \begin_layout Standard
19367 In many cases, then, you may not have to do anything at all to get acceptable
19368 XHTML output for your own environments, custom insets, and so forth.
19369 But in some cases you will, and so LyX provides a number of layout tags
19370 that can be used to customize the XHTML and CSS that are generated.
19373 \begin_layout Standard
19374 Note that there are two tags,
19375 \begin_inset Flex Code
19378 \begin_layout Plain Layout
19385 \begin_inset Flex Code
19388 \begin_layout Plain Layout
19394 that may appear outside style and inset declarations.
19396 \begin_inset CommandInset ref
19398 reference "sub:General-text-class"
19402 for details on these.
19405 \begin_layout Subsection
19406 \begin_inset CommandInset label
19408 name "sub:Paragraph-Style-XHTML"
19415 \begin_layout Standard
19416 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
19417 dealing with a normal paragraph, a command, or an environment, where this
19418 is itself determined by the contents of the corresponding
19419 \begin_inset Flex Code
19422 \begin_layout Plain Layout
19432 \begin_layout Standard
19433 For a command or normal paragraph, the output XHTML has the following form:
19436 \begin_layout LyX-Code
19438 \begin_inset Quotes erd
19442 \begin_inset Quotes erd
19448 \begin_layout LyX-Code
19450 \begin_inset Quotes erd
19454 \begin_inset Quotes erd
19460 \begin_layout LyX-Code
19461 Contents of the paragraph.
19464 \begin_layout LyX-Code
19468 \begin_layout Standard
19469 The label tags are of course omitted if the paragraph does not have a label.
19472 \begin_layout Standard
19473 For an environment that is not some sort of list, the XHTML takes this form:
19476 \begin_layout LyX-Code
19478 \begin_inset Quotes erd
19482 \begin_inset Quotes erd
19488 \begin_layout LyX-Code
19490 \begin_inset Quotes erd
19494 \begin_inset Quotes erd
19498 \begin_inset Quotes erd
19502 \begin_inset Quotes erd
19505 >Environment Label</labeltag>First paragraph.</itemtag>
19508 \begin_layout LyX-Code
19509 <itemtag>Second paragraph.</itemtag>
19512 \begin_layout LyX-Code
19516 \begin_layout Standard
19517 Note that the label is output only for the first paragraph, as it should
19518 be for a theorem, for example.
19522 \begin_layout Standard
19523 For a list, we have one of these forms:
19526 \begin_layout LyX-Code
19528 \begin_inset Quotes erd
19532 \begin_inset Quotes erd
19538 \begin_layout LyX-Code
19540 \begin_inset Quotes erd
19544 \begin_inset Quotes erd
19548 \begin_inset Quotes erd
19552 \begin_inset Quotes erd
19555 >List Label</labeltag>First item.</itemtag>
19558 \begin_layout LyX-Code
19560 \begin_inset Quotes erd
19564 \begin_inset Quotes erd
19568 \begin_inset Quotes erd
19572 \begin_inset Quotes erd
19575 >List Label</labeltag>Second item.</itemtag>
19578 \begin_layout LyX-Code
19582 \begin_layout LyX-Code
19586 \begin_layout LyX-Code
19588 \begin_inset Quotes erd
19592 \begin_inset Quotes erd
19598 \begin_layout LyX-Code
19600 \begin_inset Quotes erd
19604 \begin_inset Quotes erd
19607 >List Label</labeltag><itemtag attr=
19608 \begin_inset Quotes erd
19612 \begin_inset Quotes erd
19615 >First item.</itemtag>
19618 \begin_layout LyX-Code
19620 \begin_inset Quotes erd
19624 \begin_inset Quotes erd
19627 >List Label</labeltag><itemtag attr=
19628 \begin_inset Quotes erd
19632 \begin_inset Quotes erd
19635 >Second item.</itemtag>
19638 \begin_layout LyX-Code
19642 \begin_layout Standard
19643 Note the different orders of
19644 \begin_inset Flex Code
19647 \begin_layout Plain Layout
19654 \begin_inset Flex Code
19657 \begin_layout Plain Layout
19664 Which order we get depends upon the setting of
19665 \begin_inset Flex Code
19668 \begin_layout Plain Layout
19675 \begin_inset Flex Code
19678 \begin_layout Plain Layout
19684 is false (the default), you get the first of these, with the label within
19685 the item; if true, you get the second, with the label outside the item.
19688 \begin_layout Standard
19689 The specific tags and attributes output for each paragraph type can be controlle
19690 d by means of the layout tags we are about to describe.
19691 As mentioned earlier, however, LyX uses sensible defaults for many of these,
19692 so you often may not need to do very much to get good XHTML output.
19693 Think of the available tags as there so you can tweak things to your liking.
19696 \begin_layout Description
19697 \begin_inset Flex Code
19700 \begin_layout Plain Layout
19707 \begin_inset Flex Code
19710 \begin_layout Plain Layout
19716 ] Specifies attribute information to be output with the main tag.
19718 \begin_inset Quotes eld
19722 \begin_inset Flex Code
19725 \begin_layout Plain Layout
19732 \begin_inset Quotes erd
19736 By default, LyX will output
19737 \begin_inset Quotes eld
19741 \begin_inset Flex Code
19744 \begin_layout Plain Layout
19751 \begin_inset Quotes erd
19755 \begin_inset Flex Code
19758 \begin_layout Plain Layout
19764 is the LyX name of the layout, made lowercase, for example: chapter.
19769 contain any style information.
19771 \begin_inset Flex Code
19774 \begin_layout Plain Layout
19783 \begin_layout Description
19784 \begin_inset Flex Code
19787 \begin_layout Plain Layout
19794 \begin_inset Flex Code
19797 \begin_layout Plain Layout
19807 ] Whether to output the default CSS information LyX generates for this layout,
19808 even if additional information is explicitly provided via
19809 \begin_inset Flex Code
19812 \begin_layout Plain Layout
19820 \begin_inset Flex Code
19823 \begin_layout Plain Layout
19829 allows you to alter or augment the generated CSS, rather than to override
19832 \begin_inset Flex Code
19835 \begin_layout Plain Layout
19844 \begin_layout Description
19845 \begin_inset Flex Code
19848 \begin_layout Plain Layout
19855 \begin_inset Flex Code
19858 \begin_layout Plain Layout
19864 ] The tag to be used for individual paragraphs of environments, replacing
19866 \begin_inset Flex Code
19869 \begin_layout Plain Layout
19875 in the examples above.
19877 \begin_inset Flex Code
19880 \begin_layout Plain Layout
19889 \begin_layout Description
19890 \begin_inset Flex Code
19893 \begin_layout Plain Layout
19900 \begin_inset Flex Code
19903 \begin_layout Plain Layout
19909 ] Attributes for the item tag.
19911 \begin_inset Quotes eld
19915 \begin_inset Flex Code
19918 \begin_layout Plain Layout
19919 class=`layoutname_item'
19925 \begin_inset Quotes erd
19933 contain any style information.
19935 \begin_inset Flex Code
19938 \begin_layout Plain Layout
19947 \begin_layout Description
19948 \begin_inset Flex Code
19951 \begin_layout Plain Layout
19958 \begin_inset Flex Code
19961 \begin_layout Plain Layout
19967 ] The tag to be used for paragraph and item labels, replacing
19968 \begin_inset Flex Code
19971 \begin_layout Plain Layout
19977 in the examples above.
19979 \begin_inset Flex Code
19982 \begin_layout Plain Layout
19989 \begin_inset Flex Code
19992 \begin_layout Plain Layout
19999 \begin_inset Flex Code
20002 \begin_layout Plain Layout
20009 \begin_inset Flex Code
20012 \begin_layout Plain Layout
20013 Centered_Top_Environment
20018 , in which case it defaults to
20019 \begin_inset Flex Code
20022 \begin_layout Plain Layout
20031 \begin_layout Description
20032 \begin_inset Flex Code
20035 \begin_layout Plain Layout
20042 \begin_inset Flex Code
20045 \begin_layout Plain Layout
20051 ] Attributes for the label tag.
20053 \begin_inset Quotes eld
20057 \begin_inset Flex Code
20060 \begin_layout Plain Layout
20061 class=`layoutname_label'
20067 \begin_inset Quotes erd
20075 contain any style information.
20077 \begin_inset Flex Code
20080 \begin_layout Plain Layout
20089 \begin_layout Description
20090 \begin_inset Flex Code
20093 \begin_layout Plain Layout
20100 \begin_inset Flex Code
20103 \begin_layout Plain Layout
20113 ] Meaningful only for list-like environments, this tag controls whether
20114 the label tag is output before or inside the item tag.
20115 This is used, for example, in the description environment, where we want
20117 \begin_inset Flex Code
20120 \begin_layout Plain Layout
20121 <dt>\SpecialChar \ldots{}
20122 </dt><dd>\SpecialChar \ldots{}
20130 \begin_inset Flex Code
20133 \begin_layout Plain Layout
20139 : The label tag is output inside the item tag.
20142 \begin_layout Description
20143 \begin_inset Flex Code
20146 \begin_layout Plain Layout
20152 Information to be output in the
20153 \begin_inset Flex Code
20156 \begin_layout Plain Layout
20162 section when this style is used.
20163 This might, for example, be used to include a
20164 \begin_inset Flex Code
20167 \begin_layout Plain Layout
20174 \begin_inset Flex Code
20177 \begin_layout Plain Layout
20186 \begin_layout Description
20187 \begin_inset Flex Code
20190 \begin_layout Plain Layout
20196 CSS style information to be included when this style is used.
20197 Note that this will automatically be wrapped in a layout-generated
20198 \begin_inset Flex Code
20201 \begin_layout Plain Layout
20207 block, so only the CSS itself need be included.
20210 \begin_layout Description
20211 \begin_inset Flex Code
20214 \begin_layout Plain Layout
20221 \begin_inset Flex Code
20224 \begin_layout Plain Layout
20230 ] The tag to be used for the main label, replacing
20231 \begin_inset Flex Code
20234 \begin_layout Plain Layout
20240 in the examples above.
20242 \begin_inset Flex Code
20245 \begin_layout Plain Layout
20254 \begin_layout Description
20255 \begin_inset Flex Code
20258 \begin_layout Plain Layout
20265 \begin_inset Flex Code
20268 \begin_layout Plain Layout
20278 ] Marks this style as the one to be used to generate the
20279 \begin_inset Flex Code
20282 \begin_layout Plain Layout
20288 tag for the XHTML file.
20289 By default, it is false.
20291 \begin_inset Flex Code
20294 \begin_layout Plain Layout
20300 file sets it to true for the
20301 \begin_inset Flex Code
20304 \begin_layout Plain Layout
20314 \begin_layout Subsection
20318 \begin_layout Standard
20319 The XHTML output of insets can also be controlled by information in layout
20324 \begin_layout Plain Layout
20325 At present, this is true only for
20326 \begin_inset Quotes eld
20330 \begin_inset Quotes erd
20333 insets (insets you can type into) and is not true for
20334 \begin_inset Quotes eld
20338 \begin_inset Quotes erd
20341 insets (insets that are associated with dialog boxes).
20346 Here, too, LyX tries to provide sensible defaults, and it constructs default
20348 But everything can be customized.
20351 \begin_layout Standard
20352 The XHTML LyX outputs for an inset has the following form:
20355 \begin_layout LyX-Code
20357 \begin_inset Quotes erd
20361 \begin_inset Quotes erd
20367 \begin_layout LyX-Code
20368 <labeltag>Label</labeltag>
20371 \begin_layout LyX-Code
20373 \begin_inset Quotes erd
20377 \begin_inset Quotes erd
20380 >Contents of the inset.</innertag>
20383 \begin_layout LyX-Code
20387 \begin_layout Standard
20388 If the inset permits multiple paragraphs---that is, if
20389 \begin_inset Flex Code
20392 \begin_layout Plain Layout
20398 is true---then the contents of the inset will itself be output as paragraphs
20399 formatted according to the styles used for those paragraphs (standard,
20400 quote, and the like).
20401 The label tag is of course omitted if the paragraph does not have a label
20402 and, at present, is always
20403 \begin_inset Flex Code
20406 \begin_layout Plain Layout
20413 The inner tag is optional and, by default, does not appear.
20416 \begin_layout Standard
20417 The specific tags and attributes output for each inset can be controlled
20418 by means of the following layout tags.
20421 \begin_layout Description
20422 \begin_inset Flex Code
20425 \begin_layout Plain Layout
20432 \begin_inset Flex Code
20435 \begin_layout Plain Layout
20441 ] Specifies attribute information to be output with the main tag.
20443 \begin_inset Quotes eld
20447 \begin_inset Flex Code
20450 \begin_layout Plain Layout
20451 class=`myinset' onclick=`\SpecialChar \ldots{}
20458 \begin_inset Quotes erd
20462 By default, LyX will output
20463 \begin_inset Quotes eld
20467 \begin_inset Flex Code
20470 \begin_layout Plain Layout
20477 \begin_inset Quotes erd
20481 \begin_inset Flex Code
20484 \begin_layout Plain Layout
20490 is the LyX name of the inset, made lowercase and with non-alphanumeric
20491 characters converted to underscores, for example: footnote.
20494 \begin_layout Description
20495 \begin_inset Flex Code
20498 \begin_layout Plain Layout
20505 \begin_inset Flex Code
20508 \begin_layout Plain Layout
20518 ] Whether to output the default CSS information LyX generates for this layout,
20519 even if additional information is explicitly provided via
20520 \begin_inset Flex Code
20523 \begin_layout Plain Layout
20531 \begin_inset Flex Code
20534 \begin_layout Plain Layout
20540 allows you to alter or augment the generated CSS, rather than to override
20545 \begin_layout Description
20546 \begin_inset Flex Code
20549 \begin_layout Plain Layout
20556 \begin_inset Flex Code
20559 \begin_layout Plain Layout
20565 ] Attributes for the inner tag.
20567 \begin_inset Quotes eld
20571 \begin_inset Flex Code
20574 \begin_layout Plain Layout
20575 class=`insetname_inner'
20581 \begin_inset Quotes erd
20587 \begin_layout Description
20588 \begin_inset Flex Code
20591 \begin_layout Plain Layout
20598 \begin_inset Flex Code
20601 \begin_layout Plain Layout
20607 ] The inner tag, replacing
20608 \begin_inset Flex Code
20611 \begin_layout Plain Layout
20617 in the examples above.
20618 By default, there is none.
20621 \begin_layout Description
20622 \begin_inset Flex Code
20625 \begin_layout Plain Layout
20632 \begin_inset Flex Code
20635 \begin_layout Plain Layout
20643 ] Whether this inset represents a standalone block of text (such as a footnote)
20644 or instead represents material that is included in the surrounding text
20645 (such as a branch).
20649 \begin_layout Description
20650 \begin_inset Flex Code
20653 \begin_layout Plain Layout
20660 \begin_inset Flex Code
20663 \begin_layout Plain Layout
20669 ] A label for this inset, possibly including a reference to a counter.
20670 For example, for footnote, it might be:
20671 \begin_inset Flex Code
20674 \begin_layout Plain Layout
20683 This is optional, and there is no default.
20686 \begin_layout Description
20687 \begin_inset Flex Code
20690 \begin_layout Plain Layout
20696 Information to be output in the
20697 \begin_inset Flex Code
20700 \begin_layout Plain Layout
20706 section when this style is used.
20707 This might, for example, be used to include a
20708 \begin_inset Flex Code
20711 \begin_layout Plain Layout
20718 \begin_inset Flex Code
20721 \begin_layout Plain Layout
20730 \begin_layout Description
20731 \begin_inset Flex Code
20734 \begin_layout Plain Layout
20740 CSS style information to be included when this style is used.
20741 Note that this will automatically be wrapped in a layout-generated
20742 \begin_inset Flex Code
20745 \begin_layout Plain Layout
20751 block, so only the CSS itself need be included.
20754 \begin_layout Description
20755 \begin_inset Flex Code
20758 \begin_layout Plain Layout
20765 \begin_inset Flex Code
20768 \begin_layout Plain Layout
20774 ] The tag to be used for the main label, replacing
20775 \begin_inset Flex Code
20778 \begin_layout Plain Layout
20784 in the examples above.
20785 The default depends upon the setting of
20786 \begin_inset Flex Code
20789 \begin_layout Plain Layout
20796 \begin_inset Flex Code
20799 \begin_layout Plain Layout
20805 is true, the default is
20806 \begin_inset Flex Code
20809 \begin_layout Plain Layout
20815 ; if it is false, the default is
20816 \begin_inset Flex Code
20819 \begin_layout Plain Layout
20828 \begin_layout Subsection
20832 \begin_layout Standard
20833 The XHTML output for floats too can be controlled by layout information.
20834 The output has the following form:
20837 \begin_layout LyX-Code
20839 \begin_inset Quotes erd
20843 \begin_inset Quotes erd
20849 \begin_layout LyX-Code
20850 Contents of the float.
20853 \begin_layout LyX-Code
20857 \begin_layout Standard
20858 The caption, if there is one, is a separate inset and will be output as
20860 Its appearance can be controlled via the InsetLayout for caption insets.
20864 \begin_layout Description
20865 \begin_inset Flex Code
20868 \begin_layout Plain Layout
20875 \begin_inset Flex Code
20878 \begin_layout Plain Layout
20884 ] Specifies attribute information to be output with the main tag.
20886 \begin_inset Quotes eld
20890 \begin_inset Flex Code
20893 \begin_layout Plain Layout
20894 class=`myfloat' onclick=`\SpecialChar \ldots{}
20901 \begin_inset Quotes erd
20905 By default, LyX will output
20906 \begin_inset Quotes eld
20910 \begin_inset Flex Code
20913 \begin_layout Plain Layout
20914 class=`float float-floattype'
20920 \begin_inset Quotes erd
20924 \begin_inset Flex Code
20927 \begin_layout Plain Layout
20933 is LyX's name for this type of float, as determined by the float declaration
20935 \begin_inset CommandInset ref
20937 reference "sub:Floats"
20941 ), though made lowercase and with non-alphanumeric characters converted
20942 to underscores, for example: float-table.
20945 \begin_layout Description
20946 \begin_inset Flex Code
20949 \begin_layout Plain Layout
20955 CSS style information to be included when this float is used.
20956 Note that this will automatically be wrapped in a layout-generated
20957 \begin_inset Flex Code
20960 \begin_layout Plain Layout
20966 block, so only the CSS itself need be included.
20969 \begin_layout Description
20970 \begin_inset Flex Code
20973 \begin_layout Plain Layout
20980 \begin_inset Flex Code
20983 \begin_layout Plain Layout
20989 ] The tag to be used for this float, replacing
20990 \begin_inset Quotes eld
20994 \begin_inset Flex Code
20997 \begin_layout Plain Layout
21004 \begin_inset Quotes erd
21007 in the example above.
21009 \begin_inset Flex Code
21012 \begin_layout Plain Layout
21018 and will rarely need changing.
21021 \begin_layout Subsection
21022 Bibliography formatting
21025 \begin_layout Standard
21026 The bibliography can be formatted using
21027 \begin_inset Flex Code
21030 \begin_layout Plain Layout
21038 \begin_inset CommandInset ref
21040 reference "sub:Citation-format-description"
21047 \begin_layout Subsection
21051 \begin_layout Standard
21052 We have several times mentioned that LyX will generate default CSS style
21053 rules for both insets and paragraph styles, based upon the other layout
21054 information that is provided.
21055 In this section, we shall say a word about which layout information LyX
21059 \begin_layout Standard
21060 At present, LyX auto-generates CSS only for font information, making use
21062 \begin_inset Flex Code
21065 \begin_layout Plain Layout
21072 \begin_inset Flex Code
21075 \begin_layout Plain Layout
21082 \begin_inset Flex Code
21085 \begin_layout Plain Layout
21092 \begin_inset Flex Code
21095 \begin_layout Plain Layout
21102 \begin_inset Flex Code
21105 \begin_layout Plain Layout
21113 \begin_inset CommandInset ref
21115 reference "sub:Font-description"
21119 .) The translation is mostly straightforward and obvious.
21121 \begin_inset Quotes eld
21125 \begin_inset Flex Code
21128 \begin_layout Plain Layout
21135 \begin_inset Quotes erd
21139 \begin_inset Quotes eld
21143 \begin_inset Flex Code
21146 \begin_layout Plain Layout
21147 font-family: sans-serif;
21153 \begin_inset Quotes erd
21157 The correspondence of LyX sizes and CSS sizes is a little less obvious
21158 but nonetheless intuitive.
21160 \begin_inset Flex Code
21163 \begin_layout Plain Layout
21170 \begin_inset Flex URL
21173 \begin_layout Plain Layout
21183 \begin_layout Chapter
21184 Including External Material
21187 \begin_layout Standard
21188 \begin_inset Box Shadowbox
21198 height_special "totalheight"
21201 \begin_layout Plain Layout
21202 WARNING: This portion of the documentation has not been updated for some
21204 We certainly hope that it is still accurate, but there are no guarantees.
21212 \begin_layout Standard
21213 The use of material from sources external to LyX is covered in detail in
21219 This part of the manual covers what needs to happen behind the scenes for
21220 new sorts of material to be included.
21223 \begin_layout Section
21227 \begin_layout Standard
21228 The external material feature is based on the concept of a
21233 A template is a specification of how LyX should interface with a certain
21235 As bundled, LyX comes with predefined templates for Xfig figures, various
21236 raster format images, chess diagrams, and LilyPond music notation.
21237 You can check the actual list by using the menu
21238 \begin_inset Flex MenuItem
21241 \begin_layout Plain Layout
21242 Insert\SpecialChar \menuseparator
21243 File\SpecialChar \menuseparator
21250 Furthermore, it is possible to roll your own template to support a specific
21252 Later we'll describe in more detail what is involved, and hopefully you
21253 will submit all the templates you create so we can include them in a later
21257 \begin_layout Standard
21258 Another basic idea of the external material feature is to distinguish between
21259 the original file that serves as a base for final material and the produced
21260 file that is included in your exported or printed document.
21261 For example, consider the case of a figure produced with
21262 \begin_inset Flex Code
21265 \begin_layout Plain Layout
21272 The Xfig application itself works on an original file with the
21273 \begin_inset Flex Code
21276 \begin_layout Plain Layout
21283 Within Xfig, you create and change your figure, and when you are done,
21285 \begin_inset Flex Code
21288 \begin_layout Plain Layout
21295 When you want to include the figure in your document, you invoke
21296 \begin_inset Flex Code
21299 \begin_layout Plain Layout
21305 in order to create a PostScript file that can readily be included in your
21308 \begin_inset Flex Code
21311 \begin_layout Plain Layout
21317 file is the original file, and the PostScript file is the produced file.
21320 \begin_layout Standard
21321 This distinction is important in order to allow updating of the material
21322 while you are in the process of writing the document.
21323 Furthermore, it provides us with the flexibility that is needed to support
21324 multiple export formats.
21325 For instance, in the case of a plain text file, it is not exactly an award-winn
21326 ing idea to include the figure as raw PostScript.
21327 Instead, you would either prefer to just include a reference to the figure
21328 or try to invoke some graphics to ASCII converter to make the final result
21329 look similar to the real graphics.
21330 The external material management allows you to do this, because it is parametri
21331 zed on the different export formats that LyX supports.
21334 \begin_layout Standard
21335 Besides supporting the production of different products according to the
21336 exported format, it supports tight integration with editing and viewing
21338 In the case of an Xfig figure, you are able to invoke Xfig on the original
21339 file with a single click from within the external material dialog in LyX,
21340 and also preview the produced PostScript file with Ghostview with another
21342 No more fiddling around with the command line and/or file browsers to locate
21343 and manipulate the original or produced files.
21344 In this way, you are finally able to take full advantage of the many different
21345 applications that are relevant to use when you write your documents, and
21346 ultimately be more productive.
21349 \begin_layout Section
21350 The external template configuration file
21353 \begin_layout Standard
21354 It is relatively easy to add custom external template definitions to LyX.
21355 However, be aware that doing this in an careless manner most probably
21359 introduce an easily exploitable security hole.
21360 So before you do this, please read the discussion about security in section
21362 \begin_inset CommandInset ref
21364 reference "sec:Security-discussion"
21371 \begin_layout Standard
21372 Having said that, we encourage you to submit any interesting templates that
21377 \begin_layout Standard
21378 The external templates are defined in the
21379 \begin_inset Flex Code
21382 \begin_layout Plain Layout
21383 LyXDir/lib/external_templates
21389 You can place your own version in
21390 \begin_inset Flex Code
21393 \begin_layout Plain Layout
21394 UserDir/external_templates
21402 \begin_layout Standard
21403 A typical template looks like this:
21406 \begin_layout LyX-Code
21410 \begin_layout LyX-Code
21411 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
21414 \begin_layout LyX-Code
21418 \begin_layout LyX-Code
21422 \begin_layout LyX-Code
21426 \begin_layout LyX-Code
21430 \begin_layout LyX-Code
21434 \begin_layout LyX-Code
21435 AutomaticProduction true
21438 \begin_layout LyX-Code
21442 \begin_layout LyX-Code
21446 \begin_layout LyX-Code
21450 \begin_layout LyX-Code
21451 TransformCommand Rotate RotationLatexCommand
21454 \begin_layout LyX-Code
21455 TransformCommand Resize ResizeLatexCommand
21458 \begin_layout LyX-Code
21459 Product "$$RotateFront$$ResizeFront
21462 \begin_layout LyX-Code
21467 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
21470 \begin_layout LyX-Code
21471 $$ResizeBack$$RotateBack"
21474 \begin_layout LyX-Code
21478 \begin_layout LyX-Code
21479 UpdateResult "$$AbsPath$$Basename.pstex_t"
21482 \begin_layout LyX-Code
21483 Requirement "graphicx"
21486 \begin_layout LyX-Code
21487 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
21490 \begin_layout LyX-Code
21491 ReferencedFile latex "$$AbsPath$$Basename.eps"
21494 \begin_layout LyX-Code
21495 ReferencedFile dvi "$$AbsPath$$Basename.eps"
21498 \begin_layout LyX-Code
21502 \begin_layout LyX-Code
21506 \begin_layout LyX-Code
21507 TransformCommand Rotate RotationLatexCommand
21510 \begin_layout LyX-Code
21511 TransformCommand Resize ResizeLatexCommand
21514 \begin_layout LyX-Code
21515 Product "$$RotateFront$$ResizeFront
21518 \begin_layout LyX-Code
21523 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
21526 \begin_layout LyX-Code
21527 $$ResizeBack$$RotateBack"
21530 \begin_layout LyX-Code
21531 UpdateFormat pdftex
21534 \begin_layout LyX-Code
21535 UpdateResult "$$AbsPath$$Basename.pdftex_t"
21538 \begin_layout LyX-Code
21539 Requirement "graphicx"
21542 \begin_layout LyX-Code
21543 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
21546 \begin_layout LyX-Code
21547 ReferencedFile latex "$$AbsPath$$Basename.pdf"
21550 \begin_layout LyX-Code
21554 \begin_layout LyX-Code
21558 \begin_layout LyX-Code
21559 Product "$$Contents(
21561 "$$AbsPath$$Basename.asc
21566 \begin_layout LyX-Code
21567 UpdateFormat asciixfig
21570 \begin_layout LyX-Code
21571 UpdateResult "$$AbsPath$$Basename.asc"
21574 \begin_layout LyX-Code
21578 \begin_layout LyX-Code
21582 \begin_layout LyX-Code
21583 Product "<graphic fileref=
21585 "$$AbsOrRelPathMaster$$Basename.eps
21590 \begin_layout LyX-Code
21594 \begin_layout LyX-Code
21598 \begin_layout LyX-Code
21599 UpdateResult "$$AbsPath$$Basename.eps"
21602 \begin_layout LyX-Code
21603 ReferencedFile docbook "$$AbsPath$$Basename.eps"
21606 \begin_layout LyX-Code
21607 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
21610 \begin_layout LyX-Code
21614 \begin_layout LyX-Code
21615 Product "[XFig: $$FName]"
21618 \begin_layout LyX-Code
21622 \begin_layout LyX-Code
21626 \begin_layout Standard
21627 As you can see, the template is enclosed in
21628 \begin_inset Flex Code
21631 \begin_layout Plain Layout
21637 \SpecialChar \ldots{}
21639 \begin_inset Flex Code
21642 \begin_layout Plain Layout
21649 It contains a header specifying some general settings and, for each supported
21650 primary document file format, a section
21651 \begin_inset Flex Code
21654 \begin_layout Plain Layout
21660 \SpecialChar \ldots{}
21662 \begin_inset Flex Code
21665 \begin_layout Plain Layout
21674 \begin_layout Subsection
21675 The template header
21678 \begin_layout Description
21679 \begin_inset Flex Code
21682 \begin_layout Plain Layout
21683 AutomaticProduction
21684 \begin_inset space ~
21692 Whether the file represented by the template must be generated by LyX.
21693 This command must occur exactly once.
21696 \begin_layout Description
21697 \begin_inset Flex Code
21700 \begin_layout Plain Layout
21702 \begin_inset space ~
21710 A glob pattern that is used in the file dialog to filter out the desired
21712 If there is more than one possible file extension (e.
21713 \begin_inset space \thinspace{}
21717 \begin_inset space \space{}
21721 \begin_inset Flex Code
21724 \begin_layout Plain Layout
21731 \begin_inset Flex Code
21734 \begin_layout Plain Layout
21740 ), use something like
21741 \begin_inset Flex Code
21744 \begin_layout Plain Layout
21751 This command must occur exactly once.
21754 \begin_layout Description
21755 \begin_inset Flex Code
21758 \begin_layout Plain Layout
21760 \begin_inset space ~
21768 The text that is displayed on the button.
21769 This command must occur exactly once.
21772 \begin_layout Description
21773 \begin_inset Flex Code
21776 \begin_layout Plain Layout
21778 \begin_inset space ~
21782 \begin_inset space ~
21790 The help text that is used in the External dialog.
21791 Provide enough information to explain to the user just what the template
21792 can provide him with.
21793 This command must occur exactly once.
21796 \begin_layout Description
21797 \begin_inset Flex Code
21800 \begin_layout Plain Layout
21802 \begin_inset space ~
21810 The file format of the original file.
21811 This must be the name of a format that is known to LyX (see section
21812 \begin_inset space ~
21816 \begin_inset CommandInset ref
21818 reference "sec:Formats"
21824 \begin_inset Quotes eld
21828 \begin_inset Flex Code
21831 \begin_layout Plain Layout
21838 \begin_inset Quotes erd
21841 if the template can handle original files of more than one format.
21842 LyX will attempt to interrogate the file itself in order to deduce its
21843 format in this case.
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 A unique name for the template.
21862 It must not contain substitution macros (see below).
21865 \begin_layout Description
21866 \begin_inset Flex Code
21869 \begin_layout Plain Layout
21871 \begin_inset space ~
21874 Rotate|Resize|Clip|Extra
21879 This command specifies which transformations are supported by this template.
21880 It may occur zero or more times.
21881 This command enables the corresponding tabs in the external dialog.
21883 \begin_inset Flex Code
21886 \begin_layout Plain Layout
21892 command must have either a corresponding
21893 \begin_inset Flex Code
21896 \begin_layout Plain Layout
21903 \begin_inset Flex Code
21906 \begin_layout Plain Layout
21913 \begin_inset Flex Code
21916 \begin_layout Plain Layout
21923 Otherwise the transformation will not be supported by that format.
21926 \begin_layout Subsection
21930 \begin_layout Description
21931 \begin_inset Flex Code
21934 \begin_layout Plain Layout
21936 \begin_inset space ~
21939 LaTeX|PDFLaTeX|PlainText|DocBook
21944 The primary document file format that this format definition is for.
21945 Not every template has a sensible representation in all document file formats.
21946 Please define nevertheless a
21947 \begin_inset Flex Code
21950 \begin_layout Plain Layout
21956 section for all templates.
21957 Use a dummy text when no representation is available.
21958 Then you can at least see a reference to the external material in the exported
21962 \begin_layout Description
21963 \begin_inset Flex Code
21966 \begin_layout Plain Layout
21968 \begin_inset space ~
21972 \begin_inset space ~
21980 This command defines an additional macro
21981 \begin_inset Flex Code
21984 \begin_layout Plain Layout
21990 for substitution in
21991 \begin_inset Flex Code
21994 \begin_layout Plain Layout
22002 \begin_inset Flex Code
22005 \begin_layout Plain Layout
22011 itself may contain substitution macros.
22012 The advantage over using
22013 \begin_inset Flex Code
22016 \begin_layout Plain Layout
22023 \begin_inset Flex Code
22026 \begin_layout Plain Layout
22032 is that the substituted value of
22033 \begin_inset Flex Code
22036 \begin_layout Plain Layout
22042 is sanitized so that it is a valid optional argument in the document format.
22043 This command may occur zero or more times.
22046 \begin_layout Description
22047 \begin_inset Flex Code
22050 \begin_layout Plain Layout
22052 \begin_inset space ~
22060 The text that is inserted in the exported document.
22061 This is actually the most important command and can be quite complex.
22062 This command must occur exactly once.
22065 \begin_layout Description
22066 \begin_inset Flex Code
22069 \begin_layout Plain Layout
22071 \begin_inset space ~
22079 This command specifies a preamble snippet that will be included in the
22081 It has to be defined using
22082 \begin_inset Flex Code
22085 \begin_layout Plain Layout
22091 \SpecialChar \ldots{}
22093 \begin_inset Flex Code
22096 \begin_layout Plain Layout
22103 This command may occur zero or more times.
22106 \begin_layout Description
22107 \begin_inset Flex Code
22110 \begin_layout Plain Layout
22112 \begin_inset space ~
22116 \begin_inset space ~
22124 This command denotes files that are created by the conversion process and
22125 are needed for a particular export format.
22126 If the filename is relative, it is interpreted relative to the master document.
22127 This command may be given zero or more times.
22130 \begin_layout Description
22131 \begin_inset Flex Code
22134 \begin_layout Plain Layout
22136 \begin_inset space ~
22144 The name of a required LaTeX package.
22145 The package is included via
22146 \begin_inset Flex Code
22149 \begin_layout Plain Layout
22157 in the LaTeX preamble.
22158 This command may occur zero or more times.
22161 \begin_layout Description
22162 \begin_inset Flex Code
22165 \begin_layout Plain Layout
22167 \begin_inset space ~
22171 \begin_inset space ~
22174 RotationLatexCommand
22179 This command specifies that the built in LaTeX command should be used for
22181 This command may occur once or not at all.
22184 \begin_layout Description
22185 \begin_inset Flex Code
22188 \begin_layout Plain Layout
22190 \begin_inset space ~
22194 \begin_inset space ~
22202 This command specifies that the built in LaTeX command should be used for
22204 This command may occur once or not at all.
22207 \begin_layout Description
22208 \begin_inset Flex Code
22211 \begin_layout Plain Layout
22213 \begin_inset space ~
22217 \begin_inset space ~
22220 RotationLatexOption
22225 This command specifies that rotation is done via an optional argument.
22226 This command may occur once or not at all.
22229 \begin_layout Description
22230 \begin_inset Flex Code
22233 \begin_layout Plain Layout
22235 \begin_inset space ~
22239 \begin_inset space ~
22247 This command specifies that resizing is done via an optional argument.
22248 This command may occur once or not at all.
22251 \begin_layout Description
22252 \begin_inset Flex Code
22255 \begin_layout Plain Layout
22257 \begin_inset space ~
22261 \begin_inset space ~
22269 This command specifies that clipping is done via an optional argument.
22270 This command may occur once or not at all.
22273 \begin_layout Description
22274 \begin_inset Flex Code
22277 \begin_layout Plain Layout
22279 \begin_inset space ~
22283 \begin_inset space ~
22291 This command specifies that an extra optional argument is used.
22292 This command may occur once or not at all.
22295 \begin_layout Description
22296 \begin_inset Flex Code
22299 \begin_layout Plain Layout
22301 \begin_inset space ~
22309 The file format of the converted file.
22310 This must be the name of a format that is known to LyX (see the
22311 \begin_inset Flex MenuItem
22314 \begin_layout Plain Layout
22319 ools\SpecialChar \menuseparator
22324 references\SpecialChar \menuseparator
22325 File Handling\SpecialChar \menuseparator
22332 This command must occur exactly once.
22335 \begin_layout Description
22336 \begin_inset Flex Code
22339 \begin_layout Plain Layout
22341 \begin_inset space ~
22349 The file name of the converted file.
22350 The file name must be absolute.
22351 This command must occur exactly once.
22354 \begin_layout Subsection
22355 Preamble definitions
22358 \begin_layout Standard
22359 The external template configuration file may contain additional preamble
22360 definitions enclosed by
22361 \begin_inset Flex Code
22364 \begin_layout Plain Layout
22370 \SpecialChar \ldots{}
22372 \begin_inset Flex Code
22375 \begin_layout Plain Layout
22382 They can be used by the templates in the
22383 \begin_inset Flex Code
22386 \begin_layout Plain Layout
22395 \begin_layout Section
22396 The substitution mechanism
22399 \begin_layout Standard
22400 When the external material facility invokes an external program, it is done
22401 on the basis of a command defined in the template configuration file.
22402 These commands can contain various macros that are expanded before execution.
22403 Execution always take place in the directory of the containing document.
22406 \begin_layout Standard
22407 Also, whenever external material is to be displayed, the name will be produced
22408 by the substitution mechanism, and most other commands in the template
22409 definition support substitution as well.
22412 \begin_layout Standard
22413 The available macros are the following:
22416 \begin_layout Description
22417 \begin_inset Flex Code
22420 \begin_layout Plain Layout
22421 $$AbsOrRelPathMaster
22426 The file path, absolute or relative to the master LyX document.
22429 \begin_layout Description
22430 \begin_inset Flex Code
22433 \begin_layout Plain Layout
22434 $$AbsOrRelPathParent
22439 The file path, absolute or relative to the LyX document.
22442 \begin_layout Description
22443 \begin_inset Flex Code
22446 \begin_layout Plain Layout
22452 The absolute file path.
22455 \begin_layout Description
22456 \begin_inset Flex Code
22459 \begin_layout Plain Layout
22465 The filename without path and without the extension.
22468 \begin_layout Description
22469 \begin_inset Flex Code
22472 \begin_layout Plain Layout
22474 \begin_inset Quotes eld
22478 \begin_inset Quotes erd
22486 This macro will expand to the contents of the file with the name
22487 \begin_inset Flex Code
22490 \begin_layout Plain Layout
22499 \begin_layout Description
22500 \begin_inset Flex Code
22503 \begin_layout Plain Layout
22509 The file extension (including the dot).
22512 \begin_layout Description
22513 \begin_inset Flex Code
22516 \begin_layout Plain Layout
22522 The filename of the file specified in the external material dialog.
22523 This is either an absolute name, or it is relative to the LyX document.
22526 \begin_layout Description
22527 \begin_inset Flex Code
22530 \begin_layout Plain Layout
22537 \begin_inset Flex Code
22540 \begin_layout Plain Layout
22546 (absolute name or relative to the LyX document).
22549 \begin_layout Description
22550 \begin_inset Flex Code
22553 \begin_layout Plain Layout
22559 The file path, relative to the master LyX document.
22562 \begin_layout Description
22563 \begin_inset Flex Code
22566 \begin_layout Plain Layout
22572 The file path, relative to the LyX document.
22575 \begin_layout Description
22576 \begin_inset Flex Code
22579 \begin_layout Plain Layout
22585 This macro will expand to the absolute path of the system directory.
22586 This is typically used to point to the various helper scripts that are
22590 \begin_layout Description
22591 \begin_inset Flex Code
22594 \begin_layout Plain Layout
22600 A name and full path to a temporary file which will be automatically deleted
22601 whenever the containing document is closed, or the external material insertion
22605 \begin_layout Standard
22606 All path macros contain a trailing directory separator, so you can construct
22608 \begin_inset space \thinspace{}
22612 \begin_inset space \space{}
22615 the absolute filename with
22616 \begin_inset Flex Code
22619 \begin_layout Plain Layout
22620 $$AbsPath$$Basename$$Extension
22628 \begin_layout Standard
22629 The macros above are substituted in all commands unless otherwise noted.
22631 \begin_inset Flex Code
22634 \begin_layout Plain Layout
22640 supports additionally the following substitutions if they are enabled by
22642 \begin_inset Flex Code
22645 \begin_layout Plain Layout
22652 \begin_inset Flex Code
22655 \begin_layout Plain Layout
22664 \begin_layout Description
22665 \begin_inset Flex Code
22668 \begin_layout Plain Layout
22674 The front part of the resize command.
22677 \begin_layout Description
22678 \begin_inset Flex Code
22681 \begin_layout Plain Layout
22687 The back part of the resize command.
22690 \begin_layout Description
22691 \begin_inset Flex Code
22694 \begin_layout Plain Layout
22700 The front part of the rotation command.
22703 \begin_layout Description
22704 \begin_inset Flex Code
22707 \begin_layout Plain Layout
22713 The back part of the rotation command.
22716 \begin_layout Standard
22717 The value string of the
22718 \begin_inset Flex Code
22721 \begin_layout Plain Layout
22727 command supports additionally the following substitutions if they are enabled
22729 \begin_inset Flex Code
22732 \begin_layout Plain Layout
22739 \begin_inset Flex Code
22742 \begin_layout Plain Layout
22751 \begin_layout Description
22752 \begin_inset Flex Code
22755 \begin_layout Plain Layout
22764 \begin_layout Description
22765 \begin_inset Flex Code
22768 \begin_layout Plain Layout
22777 \begin_layout Description
22778 \begin_inset Flex Code
22781 \begin_layout Plain Layout
22790 \begin_layout Description
22791 \begin_inset Flex Code
22794 \begin_layout Plain Layout
22800 The rotation option.
22803 \begin_layout Standard
22804 You may ask why there are so many path macros.
22805 There are mainly two reasons:
22808 \begin_layout Enumerate
22809 Relative and absolute file names should remain relative or absolute, respectivel
22811 Users may have reasons to prefer either form.
22812 Relative names are useful for portable documents that should work on different
22813 machines, for example.
22814 Absolute names may be required by some programs.
22817 \begin_layout Enumerate
22818 LaTeX treats relative file names differently than LyX and other programs
22819 in nested included files.
22820 For LyX, a relative file name is always relative to the document that contains
22822 For LaTeX, it is always relative to the master document.
22823 These two definitions are identical if you have only one document, but
22824 differ if you have a master document that includes part documents.
22825 That means that relative filenames must be transformed when presented to
22827 Fortunately LyX does this automatically for you if you choose the right
22831 \begin_layout Standard
22832 So which path macro should be used in new template definitions? The rule
22836 \begin_layout Itemize
22838 \begin_inset Flex Code
22841 \begin_layout Plain Layout
22847 if an absolute path is required.
22850 \begin_layout Itemize
22852 \begin_inset Flex Code
22855 \begin_layout Plain Layout
22856 $$AbsOrRelPathMaster
22861 if the substituted string is some kind of LaTeX input.
22864 \begin_layout Itemize
22866 \begin_inset Flex Code
22869 \begin_layout Plain Layout
22870 $$AbsOrRelPathParent
22875 in order to preserve the user's choice.
22878 \begin_layout Standard
22879 There are special cases where this rule does not work and e.
22880 \begin_inset space \thinspace{}
22884 \begin_inset space \space{}
22887 relative names are needed, but normally it will work just fine.
22888 One example for such a case is the command
22889 \begin_inset Flex Code
22892 \begin_layout Plain Layout
22893 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
22898 in the XFig template above: We can't use the absolute name because the
22900 \begin_inset Flex Code
22903 \begin_layout Plain Layout
22909 files needs the relative name in order to rewrite the file content.
22912 \begin_layout Section
22913 Security discussion
22914 \begin_inset CommandInset label
22916 name "sec:Security-discussion"
22923 \begin_layout Standard
22924 The external material feature interfaces with a lot of external programs
22925 and does so automatically, so we have to consider the security implications
22927 In particular, since you have the option of including your own filenames
22928 and/or parameter strings and those are expanded into a command, it seems
22929 that it would be possible to create a malicious document which executes
22930 arbitrary commands when a user views or prints the document.
22931 This is something we definitely want to avoid.
22934 \begin_layout Standard
22935 However, since the external program commands are specified in the template
22936 configuration file only, there are no security issues if LyX is properly
22937 configured with safe templates only.
22938 This is so because the external programs are invoked with the
22939 \begin_inset Flex Code
22942 \begin_layout Plain Layout
22948 -system call rather than the
22949 \begin_inset Flex Code
22952 \begin_layout Plain Layout
22958 system-call, so it's not possible to execute arbitrary commands from the
22959 filename or parameter section via the shell.
22962 \begin_layout Standard
22963 This also implies that you are restricted in what command strings you can
22964 use in the external material templates.
22965 In particular, pipes and redirection are not readily available.
22966 This has to be so if LyX should remain safe.
22967 If you want to use some of the shell features, you should write a safe
22968 script to do this in a controlled manner, and then invoke the script from
22969 the command string.
22973 \begin_layout Standard
22974 It is possible to design a template that interacts directly with the shell,
22975 but since this would allow a malicious user to execute arbitrary commands
22976 by writing clever filenames and/or parameters, we generally recommend that
22977 you only use safe scripts that work with the
22978 \begin_inset Flex Code
22981 \begin_layout Plain Layout
22987 system call in a controlled manner.
22988 Of course, for use in a controlled environment, it can be tempting to just
22989 fall back to use ordinary shell scripts.
22990 If you do so, be aware that you
22994 provide an easily exploitable security hole in your system.
22995 Of course it stands to reason that such unsafe templates will never be
22996 included in the standard LyX distribution, although we do encourage people
22997 to submit new templates in the open source tradition.
22998 But LyX as shipped from the official distribution channels will never have
23002 \begin_layout Standard
23003 Including external material provides a lot of power, and you have to be
23004 careful not to introduce security hazards with this power.
23005 A subtle error in a single line in an innocent looking script can open
23006 the door to huge security problems.
23007 So if you do not fully understand the issues, we recommend that you consult
23008 a knowledgeable security professional or the LyX development team if you
23009 have any questions about whether a given template is safe or not.
23010 And do this before you use it in an uncontrolled environment.