1 #LyX 1.6.0svn 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 the User's Guide prints
10 % out as advertised. If you mess with this preamble,
11 % parts of the User's Guide 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 % the pages of the TOC are numbered roman
17 % and a pdf-bookmark for the TOC is added
19 \let\myTOC\tableofcontents
20 \renewcommand\tableofcontents{%
21 \pdfbookmark[1]{\contentsname}{}
24 \pagenumbering{arabic} }
26 % redefine the \LyX macro for PDF bookmarks
27 \def\LyX{\texorpdfstring{%
28 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
31 % used for multi-column text
40 InsetLayout CharStyle:MenuItem
49 \newcommand*{\menuitem}[1]{{\sffamily #1}}
54 \inputencoding default
57 \font_typewriter default
58 \font_default_family default
65 \paperfontsize default
68 \pdf_title "LyX Configuration Manual"
69 \pdf_author "The LyX Team"
71 \pdf_bookmarksnumbered false
72 \pdf_bookmarksopen false
73 \pdf_bookmarksopenlevel 1
78 \pdf_pagebackref false
86 \paperorientation portrait
93 \paragraph_separation indent
95 \quotes_language english
98 \paperpagestyle headings
99 \tracking_changes false
100 \output_changes false
108 Customizing LyX: Features for the Advanced User
116 \begin_layout Plain Layout
118 If you have comments or error corrections, please send them to the LyX Documenta
119 tion mailing list, <lyx-docs@lists.lyx.org>.
127 \begin_layout Standard
128 \begin_inset CommandInset toc
129 LatexCommand tableofcontents
136 \begin_layout Chapter
140 \begin_layout Standard
141 This manual covers the customization features present in LyX.
142 In it, we discuss issues like keyboard shortcuts, screen previewing options,
143 printer options, sending commands to LyX via the LyX Server, internationalizati
144 on, installing new LaTeX classes and LyX layouts, etc.
145 We can't possibly hope to touch on everything you can change---our developers
146 add new features faster than we can document them---but we will explain
147 the most common customizations and hopefully point you in the right direction
148 for some of the more obscure ones.
151 \begin_layout Standard
152 \begin_inset Branch OutDated
155 \begin_layout Standard
156 Information from previous versions of this document that now seems to be
157 outdated is contained in the OutDated branch of this document.
158 By default, this information will not appear in the LaTeX output.
166 \begin_layout Chapter
167 LyX configuration files
170 \begin_layout Standard
171 \begin_inset CommandInset label
177 This chapter aims to help you to find your way through the LyX configuration
179 Before continuing to read this chapter, you should find out where your
180 LyX library and user directories are by using
181 \begin_inset Flex CharStyle:MenuItem
184 \begin_layout Plain Layout
189 elp\SpecialChar \menuseparator
202 The library directory is the place where LyX places its system-wide configurati
203 on files; the user directory is where you can place your modified versions.
204 We will call the former
205 \begin_inset Flex CharStyle:Code
208 \begin_layout Plain Layout
215 \begin_inset Flex CharStyle:MenuItem
218 \begin_layout Plain Layout
224 in the remainder of this document.
228 \begin_layout Section
230 \begin_inset Flex CharStyle:Code
233 \begin_layout Plain Layout
242 \begin_layout Standard
243 \begin_inset Flex CharStyle:Code
246 \begin_layout Plain Layout
252 and its sub-directories contain a number of files and that can be used
253 to customise LyX's behaviour.
254 You can change many of these files from within LyX itself through the
255 \begin_inset Flex CharStyle:MenuItem
258 \begin_layout Plain Layout
263 ools\SpecialChar \menuseparator
274 Most customization that you will want to do in LyX is possible through
276 However, many other inner aspects of LyX can be customized by modifying
278 \begin_inset Flex CharStyle:Code
281 \begin_layout Plain Layout
288 These files fall in different categories, described in the following subsection
292 \begin_layout Subsection
293 Automatically generated files
296 \begin_layout Standard
297 The files, which are to be found in
298 \begin_inset Flex CharStyle:MenuItem
301 \begin_layout Plain Layout
307 , are generated when you configure LyX.
308 They contain various default values that are guessed by inspection.
309 In general, it is not a good idea to modify them, since they might be overwritt
314 \labelwidthstring 00.00.0000
315 \begin_inset Flex CharStyle:Code
318 \begin_layout Plain Layout
324 contains defaults for various commands.
328 \labelwidthstring 00.00.0000
329 \begin_inset Flex CharStyle:Code
332 \begin_layout Plain Layout
338 contains the list of packages that have been recognized by LyX.
339 It is currently unused by the LyX program itself, but the information extracted
340 , and more, is made available with
341 \begin_inset Flex CharStyle:MenuItem
344 \begin_layout Plain Layout
349 elp\SpecialChar \menuseparator
367 \labelwidthstring 00.00.0000
368 \begin_inset Flex CharStyle:Code
371 \begin_layout Plain Layout
377 the list of text classes that have been found in your
378 \begin_inset Flex CharStyle:Code
381 \begin_layout Plain Layout
387 directories, along with the associated LaTeX document class and their descripti
392 \labelwidthstring 00.00.0000
393 \begin_inset Flex CharStyle:Code
396 \begin_layout Plain Layout
402 the list of layout modules found in your
403 \begin_inset Flex CharStyle:Code
406 \begin_layout Plain Layout
416 \labelwidthstring 00.00.0000
417 \begin_inset Flex CharStyle:Code
420 \begin_layout Plain Layout
426 lists of various sorts of LaTeX-related files found on your system
430 \labelwidthstring 00.00.0000
431 \begin_inset Flex CharStyle:Code
434 \begin_layout Plain Layout
440 is automatically generated during configuration from the file
441 \begin_inset Flex CharStyle:Code
444 \begin_layout Plain Layout
451 It contains information on your LaTeX configuration.
454 \begin_layout Subsection
458 \begin_layout Standard
459 These directories are duplicated between
460 \begin_inset Flex CharStyle:Code
463 \begin_layout Plain Layout
470 \begin_inset Flex CharStyle:Code
473 \begin_layout Plain Layout
480 If a particular files exists in both places, the one in
481 \begin_inset Flex CharStyle:Code
484 \begin_layout Plain Layout
494 \labelwidthstring 00.00.0000
495 \begin_inset Flex CharStyle:Code
498 \begin_layout Plain Layout
504 this directory contains files with the extension
505 \begin_inset Flex CharStyle:Code
508 \begin_layout Plain Layout
514 that define the keybindings used in LyX (see section
519 \begin_inset CommandInset ref
521 reference "sec:bindings"
526 If there exists an internationalized version of the bind file named
527 \begin_inset Flex CharStyle:Code
530 \begin_layout Plain Layout
536 , that will be used first.
542 \begin_inset CommandInset ref
544 reference "chap:i18n"
549 \begin_inset CommandInset ref
551 reference "sec:bindings"
559 \labelwidthstring 00.00.0000
560 \begin_inset Flex CharStyle:Code
563 \begin_layout Plain Layout
569 contains graphics files that can be included in documents.
574 \labelwidthstring 00.00.0000
575 \begin_inset Flex CharStyle:Code
578 \begin_layout Plain Layout
584 contains LyX documentation files (including the one you are currently reading).
586 \begin_inset Flex CharStyle:Code
589 \begin_layout Plain Layout
595 deserves special attention, as noted above.
596 If there exists an internationalized version of the help-document with
598 \begin_inset Flex CharStyle:Code
601 \begin_layout Plain Layout
607 prepended to the name, that will be used first.
613 \begin_inset CommandInset ref
615 reference "chap:i18n"
623 \labelwidthstring 00.00.0000
624 \begin_inset Flex CharStyle:Code
627 \begin_layout Plain Layout
633 contains example files that explain how to use some features.
634 In the file browser, press the
635 \begin_inset Flex CharStyle:MenuItem
638 \begin_layout Plain Layout
648 \labelwidthstring 00.00.0000
649 \begin_inset Flex CharStyle:Code
652 \begin_layout Plain Layout
658 contains image files that are used by the
659 \begin_inset Flex CharStyle:MenuItem
662 \begin_layout Plain Layout
669 In addition, it also contains the individual icons used in the toolbar
670 and the banners that can be shown when LyX is launched.
674 \labelwidthstring 00.00.0000
675 \begin_inset Flex CharStyle:Code
678 \begin_layout Plain Layout
684 contains keyboard keymapping files.
690 \begin_inset CommandInset ref
692 reference "sec:keymap"
700 \labelwidthstring 00.00.0000
701 \begin_inset Flex CharStyle:Code
704 \begin_layout Plain Layout
710 contains the text class and module files described in Chapter
715 \begin_inset CommandInset ref
717 reference "chap:textclass"
725 \labelwidthstring 00.00.0000
726 \begin_inset Flex CharStyle:Code
729 \begin_layout Plain Layout
736 \begin_inset Flex CharStyle:Code
739 \begin_layout Plain Layout
745 Python scripts used to convert between LyX versions.
746 These can be run from the command line if, say, you want to batch-convert
751 \labelwidthstring 00.00.0000
752 \begin_inset Flex CharStyle:Code
755 \begin_layout Plain Layout
761 contains some files that demonstrate the capabilities of the
762 \begin_inset Flex CharStyle:MenuItem
765 \begin_layout Plain Layout
776 Also contains some scripts used by LyX itself.
780 \labelwidthstring 00.00.0000
781 \begin_inset Flex CharStyle:Code
784 \begin_layout Plain Layout
790 contains the standard LyX template files described in Chapter
795 \begin_inset CommandInset ref
797 reference "sec:templates"
805 \labelwidthstring 00.00.0000
806 \begin_inset Flex CharStyle:Code
809 \begin_layout Plain Layout
815 contains files with the extension
816 \begin_inset Flex CharStyle:Code
819 \begin_layout Plain Layout
825 that define the user interface to LyX.
826 That is, the files define which items appear in which menus and the items
827 appearing on the toolbar.
829 \begin_inset CommandInset ref
838 \begin_layout Subsection
839 Files you don't want to modify
842 \begin_layout Standard
843 These files are used internally by LyX and you generally do not need to
844 modify them unless you are a developer.
848 \labelwidthstring 00.00.0000
849 \begin_inset Flex CharStyle:Code
852 \begin_layout Plain Layout
858 this file contains the list of LyX developers.
859 The contents are displayed with the menu entry
860 \begin_inset Flex CharStyle:MenuItem
863 \begin_layout Plain Layout
868 elp\SpecialChar \menuseparator
882 \labelwidthstring 00.00.0000
883 \begin_inset Flex CharStyle:Code
886 \begin_layout Plain Layout
892 this is a LaTeX script used during the configuration process.
897 \labelwidthstring 00.00.0000
898 \begin_inset Flex CharStyle:Code
901 \begin_layout Plain Layout
907 this is the script that is used to re-configure LyX.
908 It creates configuration files in the directory it was run from.
911 \begin_layout Subsection
912 Other files needing a line or two...
916 \labelwidthstring 00.00.0000
917 \begin_inset Flex CharStyle:Code
920 \begin_layout Plain Layout
926 this contains tables describing how different character encodings can be
931 \labelwidthstring 00.00.0000
932 \begin_inset Flex CharStyle:Code
935 \begin_layout Plain Layout
941 this file contains the templates available to the new
942 \begin_inset Flex CharStyle:MenuItem
945 \begin_layout Plain Layout
959 \labelwidthstring 00.00.0000
960 \begin_inset Flex CharStyle:Code
963 \begin_layout Plain Layout
969 this file contains a list of all the languages currently supported by LyX.
972 \begin_layout Section
973 Your local configuration directory
976 \begin_layout Standard
977 Even if you are using LyX as an unprivileged user, you might want to change
978 LyX configuration for your own use.
980 \begin_inset Flex CharStyle:Code
983 \begin_layout Plain Layout
989 directory contains all your personal configuration files.
990 This is the directory described as
991 \begin_inset Quotes eld
995 \begin_inset Quotes erd
999 \begin_inset Flex CharStyle:MenuItem
1002 \begin_layout Plain Layout
1007 elp\SpecialChar \menuseparator
1009 \begin_inset space ~
1018 This directory is used as a mirror of
1019 \begin_inset Flex CharStyle:Code
1022 \begin_layout Plain Layout
1028 , which means that every file in
1029 \begin_inset Flex CharStyle:Code
1032 \begin_layout Plain Layout
1038 is a replacement for the corresponding file in
1039 \begin_inset Flex CharStyle:Code
1042 \begin_layout Plain Layout
1049 Any configuration file described in the above sections can be placed either
1050 in the system-wide directory, in which case it will affect all users, or
1051 in your local directory for your own use.
1054 \begin_layout Standard
1055 To make things clearer, let's provide a few examples:
1058 \begin_layout Itemize
1059 The preferences set in the
1060 \begin_inset Flex CharStyle:MenuItem
1063 \begin_layout Plain Layout
1068 ools\SpecialChar \menuseparator
1078 dialog are saved to a file
1079 \begin_inset Flex CharStyle:Code
1082 \begin_layout Plain Layout
1089 \begin_inset Flex CharStyle:Code
1092 \begin_layout Plain Layout
1101 \begin_layout Itemize
1102 When you reconfigure using
1103 \begin_inset Flex CharStyle:MenuItem
1106 \begin_layout Plain Layout
1111 ools\SpecialChar \menuseparator
1122 \begin_inset Flex CharStyle:Code
1125 \begin_layout Plain Layout
1131 script, and the resulting files are written in your local configuration
1133 This means that any additional text class file that you might have added
1135 \begin_inset Flex CharStyle:Code
1138 \begin_layout Plain Layout
1144 will be added to the list of classes in the
1145 \begin_inset Flex CharStyle:MenuItem
1148 \begin_layout Plain Layout
1153 ocument\SpecialChar \menuseparator
1166 \begin_layout Itemize
1167 If you get some updated documentation from LyX ftp site and cannot install
1168 it because you do not have sysadmin rights on your system, you can just
1170 \begin_inset Flex CharStyle:Code
1173 \begin_layout Plain Layout
1179 and the items in the
1180 \begin_inset Flex CharStyle:MenuItem
1183 \begin_layout Plain Layout
1193 menu will open them!
1196 \begin_layout Section
1197 Running LyX with multiple configurations
1200 \begin_layout Standard
1201 The configuration freedom of the local configuration directory may not suffice
1202 if you want to have more than one configuration at your disposal.
1203 For example, you may want to be use different key bindings or printer settings
1205 You can achieve this by having several such directories.
1206 You then specify which directory to use at run-time.
1209 \begin_layout Standard
1210 Invoking LyX with the command line switch
1211 \begin_inset Flex CharStyle:Code
1214 \begin_layout Plain Layout
1224 instructs the program to read the configuration from that directory, and
1225 not from the default directory.
1226 (You can determine the default directory by running LyX without the
1227 \begin_inset Flex CharStyle:Code
1230 \begin_layout Plain Layout
1236 switch.) If the specified directory does not exist, LyX offers to create
1237 it for you, just like it does for the default directory on the first time
1238 you run the program.
1239 You can modify the configuration options in this additional user directory
1240 exactly as you would for the default directory.
1241 These directories are completely independent (but read on).
1242 Note that setting the environment variable
1243 \begin_inset Flex CharStyle:Code
1246 \begin_layout Plain Layout
1252 to some value has exactly the same effect.
1255 \begin_layout Standard
1256 Having several configurations also requires more maintenance: if you want
1257 to add a new layout to
1258 \begin_inset Flex CharStyle:Code
1261 \begin_layout Plain Layout
1267 which you want available from all your configurations, you must add it
1268 to each directory separately.
1269 You can avoid this with the following trick: after LyX creates the additional
1270 directory, most of the subdirectories (see above) are empty.
1271 If you want the new configuration to mirror an existing one, replace the
1272 empty subdirectory with a symbolic link to the matching subdirectory in
1273 the existing configuration.
1275 \begin_inset Flex CharStyle:Code
1278 \begin_layout Plain Layout
1284 subirectory, however, since it contains a file written by the configuration
1285 script (also accessible through
1286 \begin_inset Flex CharStyle:MenuItem
1289 \begin_layout Plain Layout
1294 ools\SpecialChar \menuseparator
1304 ) which is configuration-specific.
1307 \begin_layout Chapter
1308 The Preferences dialog
1311 \begin_layout Section
1312 Using the dialog for the first time
1315 \begin_layout Standard
1317 \begin_inset Flex CharStyle:Code
1320 \begin_layout Plain Layout
1326 file will contain only changes that you have made to the default behaviour,
1327 some of which is hard-coded into LyX and some of which is contained in
1329 \begin_inset Flex CharStyle:Code
1332 \begin_layout Plain Layout
1333 LyXDir/lyxrc.defaults
1339 Note that in both files lines beginning with a
1340 \begin_inset Quotes eld
1344 \begin_inset Quotes erd
1347 are just comments and are not interpreted.
1348 However, only system administrators should edit
1349 \begin_inset Flex CharStyle:Code
1352 \begin_layout Plain Layout
1353 LyXDir/lyxrc.defaults
1359 Users should use the
1360 \begin_inset Flex CharStyle:MenuItem
1363 \begin_layout Plain Layout
1368 ools\SpecialChar \menuseparator
1378 dialog to create and modify their own
1379 \begin_inset Flex CharStyle:Code
1382 \begin_layout Plain Layout
1391 \begin_layout Standard
1393 \begin_inset Flex CharStyle:MenuItem
1396 \begin_layout Plain Layout
1401 ools\SpecialChar \menuseparator
1411 dialog will be largely self-explanatory.
1412 Most things in the dialog have associated `tool tips': hover your mouse
1413 pointer over something for more information.
1414 Before we highlight a few of the more important commands below, however,
1416 \begin_inset Flex CharStyle:MenuItem
1419 \begin_layout Plain Layout
1425 ing some of your changes (e.g., screen fonts) will have an instant effect.
1427 changing the bind file) will not.
1428 If nothing appears to have changed, just
1429 \begin_inset Flex CharStyle:MenuItem
1432 \begin_layout Plain Layout
1438 the changes and restart LyX.
1441 \begin_layout Section
1445 \begin_layout Subsection
1449 \begin_layout Standard
1450 The font used to display your documents on the LyX screen is very important,
1451 since you'll be reading all your documents with this font.
1452 Therefore it is important that the font be as readable and good-looking
1454 The LyX team tried to provide the best possible default font for you, but
1455 since systems can be so different, it's quite possible that the default
1456 fonts will be sub-optimal on your system.
1457 Fortunately, you can do something about this.
1458 Before we explain how, you should learn a bit more about fonts so that
1459 you are better prepared for choosing your fonts.
1460 There are trade-offs that are specific to your preferences and the capabilities
1464 \begin_layout Standard
1465 Notice that this section only deals with the fonts on the
1469 inside the LyX window.
1470 The fonts that appear on the
1478 are independent from these fonts, and are determined by the document class.
1483 to learn how to change the font of the printed version of your document.
1486 \begin_layout Standard
1487 Basically, screen fonts come in two different kinds: scalable outline fonts
1488 and non-scalable bitmap fonts.
1489 This distinction seems a bit arbitrary, since non-scalable fonts are actually
1490 scalable in most modern font renderers.
1491 The difference lies in the
1495 of the scaling and the
1500 The most important decision is thus whether you should use non-scalable
1501 bitmap fonts or scalable outline fonts.
1504 \begin_layout Standard
1505 The scalable fonts are built from
1509 of the single glyphs (i.e.
1510 characters) in the font.
1511 This means that each glyph is defined using mathematical curves that are
1512 well suited for scaling to any requested size.
1513 This mathematical definition is interpreted by the font renderer and turned
1514 into a small picture composed of pixels according to which size and glyph
1515 (or symbol) the programmer requests.
1516 This means that scalable fonts will look pretty good in most sizes.Since
1517 scalable fonts are defined in an abstract way, it can be hard to provide
1518 a good rendering at small sizes, where each pixel has to be very carefully
1519 computed to provide a good image.
1520 Technically it is possible to do this from the mathematical definition,
1521 but in order to keep the rendering reasonably fast, tradeoffs have to be
1522 made, and the result is that scalable fonts can be difficult to read at
1526 \begin_layout Standard
1527 Bitmap fonts on the other hand, are defined by bitmap graphics from the
1528 start, so they will look good at all the sizes they are meant for.
1529 However, they don't scale well, because in order to scale a glyph, each
1530 pixel is enlarged into several pixels.
1531 It is the same effect that happens if you try to enlarge a picture in an
1532 image manipulation program.
1533 In order to relieve this effect, bitmap fonts are typically provided in
1534 several fixed sizes typically from around 8 pixels high up to 34 pixels
1535 or so high in steps according to what is believed to be useful.
1536 The advantage of bitmap fonts is that no complicated computations are necessary
1537 to display each glyph, so bitmap fonts are thus faster displayed than scalable
1539 The disadvantage is that sizes that don't exists as fixed versions have
1540 to be scaled by doubling pixels, and thus look bad.
1543 \begin_layout Standard
1544 The net result of all this is that bitmap fonts are generally best for the
1545 small sizes, where they are available, while scalable fonts are generally
1546 best for large sizes.
1547 The logical conclusion would thus be to use bitmap fonts for the small
1548 sizes, and scalable fonts for the large sizes.
1549 Unfortunately, this is not a good idea, since bitmap fonts and scalable
1550 fonts are not designed to be used together, so the overall look of such
1551 a scheme would be bad.
1552 The best you can do is thus to try both schemes and decide for yourself
1556 \begin_layout Standard
1557 In the following, we will describe what to do if the text does not look
1559 We'll start with the most important parameters: DPI and font zoom.
1562 \begin_layout Subsubsection
1563 DPI setting and Font Zoom
1566 \begin_layout Standard
1567 LyX automatically tries to scale the fonts to look as close as the paper
1568 output size as possible, except for the so-called font zoom factor.
1571 \begin_layout Standard
1572 In order for this to work on all systems, it relies on the screen DPI (dots
1573 per inch) setting to be correct.
1574 The DPI setting for your system is autodetected by LyX using information
1575 provided by your system.
1576 You can check what LyX autodetects the DPI setting to, by running LyX as
1578 \begin_inset Flex CharStyle:Code
1581 \begin_layout Plain Layout
1590 \begin_layout Standard
1591 On many systems, this will not be correct, so you should check that it is
1593 On X11 systems, you can run
1594 \begin_inset Quotes eld
1598 \begin_inset Flex CharStyle:Code
1601 \begin_layout Plain Layout
1608 \begin_inset Quotes erd
1611 and write down what the DPI is for the resolution you use (this will be
1612 close to the value LyX detects).
1613 It is the number mentioned as
1614 \begin_inset Quotes eld
1618 \begin_inset Quotes erd
1622 Also write down the number of pixels you have in the width (the first number
1624 \begin_inset Quotes eld
1628 \begin_inset Quotes erd
1634 \begin_layout Standard
1635 Then get the good old ruler out of the closet, and measure the width of
1636 the visible screen-image on your monitor.
1637 Convert this measurement to inches if you used a centimeter ruler by dividing
1639 Now you can determine the correct DPI setting for your screen by dividing
1640 the number of pixels in the width by the width of the screen-image on the
1642 If this number is more than, say, 5 DPI from the detected value, you should
1643 either fix your system setup, or at least tell LyX that the DPI is different
1644 than the detected value.
1647 \begin_layout Standard
1648 If you can't fix system setup (which of course is best since other programs
1649 than LyX will benefit from this as well), you can tell LyX the correct
1651 \begin_inset Flex CharStyle:MenuItem
1654 \begin_layout Plain Layout
1663 \begin_layout Standard
1664 If the text is too small or too big for your taste, you should fiddle with
1665 the font zoom setting.
1666 This setting is used to scale the point size of the text.
1667 If your DPI setting is correct, and the font zoom setting is set to 100,
1668 this means that LyX will try to display the text exactly the same size
1669 as it will appear on the paper-output.
1670 If you set the zoom factor to 200, the text will try to be 2 times as big
1672 Of course, this will only happen if LyX can find a font that has the appropriat
1673 e size, which you can't count on.
1674 Since LyX is a WYSIWYM system anyways, this limitation isn't much of an
1678 \begin_layout Standard
1679 The default font zoom setting is 150, since a monitor is typically wider
1680 than a piece of paper, but you should try to fiddle with it through the
1682 \begin_inset Flex CharStyle:MenuItem
1685 \begin_layout Plain Layout
1687 \begin_inset space ~
1700 \begin_inset Flex CharStyle:MenuItem
1703 \begin_layout Plain Layout
1709 dialog to find a size that you like.
1710 When you've found a setting that seems to work nicely for you (tip: use
1712 \begin_inset Flex CharStyle:MenuItem
1715 \begin_layout Plain Layout
1725 button to keep the dialog open while you experiment), you can make this
1726 setting the default by using the
1727 \begin_inset Flex CharStyle:MenuItem
1730 \begin_layout Plain Layout
1743 \begin_layout Standard
1744 While it is often possible to find a suitable size for the text on the screen,
1745 this doesn't necessarily mean that the fonts are the best ones available
1747 In order to help you get the most out of your system, you can use the font
1748 definition commands to fine-tune the look of the text in greater detail
1752 \begin_layout Subsubsection
1753 Font definition commands
1756 \begin_layout Standard
1757 You can change LyX's screen fonts from within the
1758 \begin_inset Flex CharStyle:MenuItem
1761 \begin_layout Plain Layout
1768 The number of fonts that are available on different systems vary.
1772 \begin_layout Standard
1773 Before you go about scrapping a bitmap font because the larger sizes look
1775 \begin_inset Quotes eld
1779 \begin_inset Quotes erd
1782 , you should toggle the
1783 \begin_inset Flex CharStyle:Code
1786 \begin_layout Plain Layout
1793 This is only useful if you use bitmap fonts, because only these don't scale
1795 If you define this flag, LyX will only use the fixed font sizes that are
1796 available, and this guarantees that all bitmap fonts look good.
1797 However, the downside is that there will be a greater difference between
1798 the size of the fonts on screen and the size of fonts on paper because
1799 LyX will have to be satisfied with the closest available size, and not
1800 try to scale a size to fit.
1801 Also, you can risk that some logically different sizes, such as
1802 \begin_inset Flex CharStyle:MenuItem
1805 \begin_layout Plain Layout
1812 \begin_inset Flex CharStyle:MenuItem
1815 \begin_layout Plain Layout
1821 , will be mapped to the same screen font, making it hard for you to see
1822 the difference on screen.
1826 \begin_layout Standard
1827 One final note regarding the
1828 \begin_inset Flex CharStyle:Code
1831 \begin_layout Plain Layout
1837 flag: you should know that there is nothing wrong with using bitmap and
1838 scalable fonts at the same time for different purposes.
1839 For instance, it's common to use the scalable
1840 \begin_inset Quotes eld
1844 \begin_inset Quotes erd
1847 for the serif text together with a bitmap version of
1848 \begin_inset Quotes eld
1852 \begin_inset Quotes erd
1856 And you can safely select the
1857 \begin_inset Quotes eld
1861 \begin_inset Quotes erd
1864 button without worries: It will only apply to the Helvetica font.
1867 \begin_layout Standard
1868 Sometimes the artifacts introduced by use of the flag can be relieved by
1869 using the fine-detail screen font sizes which defines which point sizes
1870 the different logical font sizes correspond to.
1872 \begin_inset Flex CharStyle:Code
1875 \begin_layout Plain Layout
1881 to see exactly what concrete fonts the logical sizes map to, and try adjusting
1882 the corresponding entries in the
1883 \begin_inset Flex CharStyle:MenuItem
1886 \begin_layout Plain Layout
1892 dialog until you've managed to hit the nail and get the fonts you want.
1893 This can be hard to do, because LyX uses the DPI setting and the font zoom
1894 settings to calculate which exact screen font size to ask the X server
1895 for, thus obfuscating the mapping.
1896 If you can't make it by trial-and-error, you can make the process more
1897 transparent if you set both the DPI setting and font zoom settings to 100---eve
1898 n when this is known to be wrong.
1899 This will of course make your scalable fonts look weird, so use with care.
1902 \begin_layout Standard
1903 \begin_inset Branch OutDated
1906 \begin_layout Subsubsection
1910 \begin_layout Standard
1911 By default, LyX will use fonts meant to write Western European text, including
1912 all kinds of English.
1913 This is defined through the so-called
1922 If you want to use LyX to write for instance Eastern European text, Cyrillic
1923 or any other language not covered by the ISO-8859-1 font encoding, you
1924 can define a different one with the encoding setting.
1925 This requires you to have special fonts installed.
1927 \begin_inset Flex CharStyle:Code
1930 \begin_layout Plain Layout
1936 to see whether this is the case: check the
1937 \begin_inset Quotes eld
1941 \begin_inset Quotes erd
1945 \begin_inset Quotes eld
1949 \begin_inset Quotes erd
1952 fields for ISO-8859-X values different from ISO-8859-1, and search for
1953 one that contains the national characters of your language.
1954 If you find any, enter this encoding in the dialog.
1955 If not, go searching the Web for appropriate fonts.
1956 For the Qt frontend, it's recommended you use an iso646 font set.
1959 \begin_layout Standard
1960 When you've set LyX up to use a different font encoding, you should also
1961 consider changing the font used by dialog windows in LyX.
1963 \begin_inset Flex CharStyle:MenuItem
1966 \begin_layout Plain Layout
1968 \begin_inset space ~
1972 \begin_inset space ~
1980 dialog will not be understandable unless you tell LyX to use a different
1982 By default the menu font is set to
1983 \begin_inset Flex CharStyle:Code
1986 \begin_layout Plain Layout
1987 -*-helvetica-medium-r
1992 , but often Helvetica is not available in the font encoding you need, so
1993 the dialog allows this to be changed.
1996 \begin_layout Standard
1997 As you can see, there are quite a few options that can be used to fine tune
1998 the look of your fonts.
1999 This should not scare you from fiddling with the settings, because after
2000 all, you will hopefully be using LyX for many hours in the future.
2001 And contrary to real WYSIWYG word processors where you are tied to using
2002 fonts that have to look good both on paper and on screen, LyX gives you
2003 the possibility of using fonts that are designed to look good on the screen
2004 while using a different set of fonts to look good on paper.
2012 \begin_layout Subsection
2014 \begin_inset CommandInset label
2023 \begin_layout Standard
2024 The appearance of both the menu and toolbar may both be changed using the
2026 \begin_inset Flex CharStyle:MenuItem
2029 \begin_layout Plain Layout
2036 Simply select a different
2037 \begin_inset Flex CharStyle:Code
2040 \begin_layout Plain Layout
2047 \begin_inset Flex CharStyle:MenuItem
2050 \begin_layout Plain Layout
2051 Look & Feel\SpecialChar \menuseparator
2058 You can customize the interface by copying one of the
2059 \begin_inset Flex CharStyle:Code
2062 \begin_layout Plain Layout
2069 \begin_inset Flex CharStyle:Code
2072 \begin_layout Plain Layout
2079 \begin_inset Flex CharStyle:Code
2082 \begin_layout Plain Layout
2089 You may have to restart LyX for these changes to take effect.
2092 \begin_layout Standard
2094 \begin_inset Flex CharStyle:Code
2097 \begin_layout Plain Layout
2103 files is straightforward: have a look at
2104 \begin_inset Flex CharStyle:Code
2107 \begin_layout Plain Layout
2115 \begin_inset Flex CharStyle:Code
2118 \begin_layout Plain Layout
2125 \begin_inset Flex CharStyle:Code
2128 \begin_layout Plain Layout
2135 \begin_inset Flex CharStyle:Code
2138 \begin_layout Plain Layout
2144 entries must be ended with an explicit
2145 \begin_inset Flex CharStyle:Code
2148 \begin_layout Plain Layout
2156 \begin_inset Flex CharStyle:Code
2159 \begin_layout Plain Layout
2166 \begin_inset Flex CharStyle:Code
2169 \begin_layout Plain Layout
2176 \begin_inset Flex CharStyle:Code
2179 \begin_layout Plain Layout
2186 \begin_inset Flex CharStyle:Code
2189 \begin_layout Plain Layout
2196 \begin_inset Flex CharStyle:Code
2199 \begin_layout Plain Layout
2205 s and in the case of the
2206 \begin_inset Quotes eld
2210 \begin_inset Quotes erd
2214 \begin_inset Flex CharStyle:Code
2217 \begin_layout Plain Layout
2224 One small word of warning.
2226 \begin_inset Flex CharStyle:Code
2229 \begin_layout Plain Layout
2235 s may be inserted in a
2236 \begin_inset Flex CharStyle:Code
2239 \begin_layout Plain Layout
2246 \begin_inset Flex CharStyle:Code
2249 \begin_layout Plain Layout
2255 , but they are defined as
2256 \begin_inset Flex CharStyle:Code
2259 \begin_layout Plain Layout
2266 \begin_inset Flex CharStyle:Code
2269 \begin_layout Plain Layout
2277 \begin_inset Flex CharStyle:Code
2280 \begin_layout Plain Layout
2286 tag is used to insert context-dependent information that is generated by
2288 Unfortunately, the available tags are not documented outside the source
2292 \begin_layout Standard
2293 Note that, as of LyX 1.6, there are extensive context menus, normally accessed
2295 These are defined in the
2296 \begin_inset Flex CharStyle:Code
2299 \begin_layout Plain Layout
2308 \begin_layout Section
2312 \begin_layout Standard
2313 The settings in this section are used to customise the behavior of the LyX
2317 \begin_layout Subsection
2318 \begin_inset CommandInset label
2327 \begin_layout Standard
2328 Bindings are used to associate a LyX function to a key.
2329 Several prepackaged binding files are available: a CUA set of bindings
2330 (familiar as the typical set of PC and CDE set of keyboard shortcuts),
2331 an Emacs set of bindings, for those of us who follow the One True Way and
2332 refuse to lower our standards,
2336 \begin_layout Plain Layout
2337 I'm kidding here, of course!
2342 as well as specialty bindings (broadway and hollywood) and bindings for
2343 languages other than English.
2344 You can select your binding in the
2345 \begin_inset Flex CharStyle:MenuItem
2348 \begin_layout Plain Layout
2349 Editing\SpecialChar \menuseparator
2358 \begin_inset Flex CharStyle:MenuItem
2361 \begin_layout Plain Layout
2366 ools\SpecialChar \menuseparator
2382 \begin_layout Standard
2383 If, however, you'd like to customise the bindings to your own exacting tastes,
2384 then there are two ways to proceed.
2385 The first, and older method, is to copy a file from
2386 \begin_inset Flex CharStyle:Code
2389 \begin_layout Plain Layout
2396 \begin_inset Flex CharStyle:Code
2399 \begin_layout Plain Layout
2405 and modify that in a text editor.
2406 Don't forget to select this file in
2407 \begin_inset Flex CharStyle:MenuItem
2410 \begin_layout Plain Layout
2411 Editing\SpecialChar \menuseparator
2418 The second method is to use the shortcut editor, which you will also find
2420 \begin_inset Flex CharStyle:MenuItem
2423 \begin_layout Plain Layout
2424 Editing\SpecialChar \menuseparator
2431 The changes you make here will be stored at
2432 \begin_inset Flex CharStyle:Code
2435 \begin_layout Plain Layout
2436 UserDir/bind/user.bind
2444 \begin_layout Standard
2445 LyX supports internationalization of the user interface (see Chapter
2446 \begin_inset space ~
2450 \begin_inset CommandInset ref
2452 reference "chap:i18n"
2461 is set, LyX will try to use bindfiles by prepending the standard language
2463 For example, you can put a translated copy of some standard bind file in
2465 \begin_inset Flex CharStyle:Code
2468 \begin_layout Plain Layout
2474 directory, and LyX will use it automatically.
2477 \begin_layout Standard
2479 \begin_inset Flex CharStyle:Code
2482 \begin_layout Plain Layout
2488 files is straightforward:
2491 \begin_layout LyX-Code
2494 bind ``<key combination>'' ``<lyx-function>
2495 \begin_inset Quotes erd
2501 \begin_layout Standard
2502 Both key combination and lyx-function (including any arguments) must be
2503 enclosed in "double quotes".
2504 The LyX functions are partially documented on listed on the
2505 \begin_inset CommandInset href
2508 target "http://wiki.lyx.org/LyX/LyxFunctions"
2513 A major effort is presently underway to improve this documentation.
2516 \begin_layout Section
2517 \begin_inset CommandInset label
2519 name "sec:converters-etc"
2526 \begin_layout Standard
2527 LyX has a powerful mechanism to convert to and from any file format using
2532 \begin_layout Subsection
2533 \begin_inset CommandInset label
2542 \begin_layout Standard
2543 The first step is to define your file formats if they are not already defined.
2545 \begin_inset Flex CharStyle:MenuItem
2548 \begin_layout Plain Layout
2549 Tools\SpecialChar \menuseparator
2550 Preferences\SpecialChar \menuseparator
2551 File Handling\SpecialChar \menuseparator
2559 \begin_inset Flex CharStyle:MenuItem
2562 \begin_layout Plain Layout
2563 New\SpecialChar \ldots{}
2569 button to define your new format.
2571 \begin_inset Flex CharStyle:MenuItem
2574 \begin_layout Plain Layout
2580 field contains the named used to identify the format in the GUI.
2582 \begin_inset Flex CharStyle:MenuItem
2585 \begin_layout Plain Layout
2591 is used to identify the format interally.
2592 You will also need to enter a file extension.
2593 These are all required.
2595 \begin_inset Flex CharStyle:MenuItem
2598 \begin_layout Plain Layout
2604 field is used to provide a keyboard shortcut on the menus.
2605 (For example, pressing
2606 \begin_inset Flex CharStyle:MenuItem
2609 \begin_layout Plain Layout
2616 \begin_inset Flex CharStyle:MenuItem
2619 \begin_layout Plain Layout
2620 View\SpecialChar \menuseparator
2629 \begin_layout Standard
2631 \begin_inset Flex CharStyle:MenuItem
2634 \begin_layout Plain Layout
2641 \begin_inset Flex CharStyle:MenuItem
2644 \begin_layout Plain Layout
2651 For example, you might want to use
2652 \begin_inset Flex CharStyle:MenuItem
2655 \begin_layout Plain Layout
2661 to view PostScript files.
2662 You can enter the command needed to start the program in the corresponding
2664 In defining this command, you can use the four variables listed in the
2666 The viewer is launched when you view an image in LyX or use the
2667 \begin_inset Flex CharStyle:MenuItem
2670 \begin_layout Plain Layout
2677 The editor is for example launched when you press the
2678 \begin_inset Flex CharStyle:MenuItem
2681 \begin_layout Plain Layout
2688 \begin_inset Flex CharStyle:MenuItem
2691 \begin_layout Plain Layout
2698 \begin_inset Flex CharStyle:MenuItem
2701 \begin_layout Plain Layout
2710 \begin_layout Standard
2712 \begin_inset Flex CharStyle:MenuItem
2715 \begin_layout Plain Layout
2721 option tells LyX that a format is suitable for document export.
2722 If this is is set and if a suitable conversion route exists (see
2723 \begin_inset CommandInset ref
2725 reference "sub:Converters"
2729 ), the format will appear in the
2730 \begin_inset Flex CharStyle:MenuItem
2733 \begin_layout Plain Layout
2734 File\SpecialChar \menuseparator
2741 The format will also appear in the
2742 \begin_inset Flex CharStyle:MenuItem
2745 \begin_layout Plain Layout
2751 menu if a viewer is specified for the format.
2752 Pure image formats, such as
2753 \begin_inset Flex CharStyle:Code
2756 \begin_layout Plain Layout
2762 , should not use this option.
2763 Formats that can both represent vector graphics and documents like
2764 \begin_inset Flex CharStyle:Code
2767 \begin_layout Plain Layout
2776 \begin_layout Standard
2778 \begin_inset Flex CharStyle:MenuItem
2781 \begin_layout Plain Layout
2782 Vector graphics format
2787 tells LyX that a format can contain vector graphics.
2788 This information is used to determine the target format of included graphics
2790 \begin_inset Flex CharStyle:MenuItem
2793 \begin_layout Plain Layout
2800 Included graphics may need to be converted to either
2801 \begin_inset Flex CharStyle:MenuItem
2804 \begin_layout Plain Layout
2811 \begin_inset Flex CharStyle:MenuItem
2814 \begin_layout Plain Layout
2821 \begin_inset Flex CharStyle:MenuItem
2824 \begin_layout Plain Layout
2831 \begin_inset Flex CharStyle:MenuItem
2834 \begin_layout Plain Layout
2840 cannot handle other image formats.
2841 If an included graphic is not already in
2842 \begin_inset Flex CharStyle:MenuItem
2845 \begin_layout Plain Layout
2852 \begin_inset Flex CharStyle:MenuItem
2855 \begin_layout Plain Layout
2862 \begin_inset Flex CharStyle:MenuItem
2865 \begin_layout Plain Layout
2871 format, it is converted to
2872 \begin_inset Flex CharStyle:MenuItem
2875 \begin_layout Plain Layout
2881 if the vector format option is set, and otherwise to
2882 \begin_inset Flex CharStyle:MenuItem
2885 \begin_layout Plain Layout
2894 \begin_layout Subsection
2898 \begin_layout Standard
2899 Since all conversions from one format to another take place in LyX's temporary
2900 directory, it is sometimes necessary to modify a file before copying it
2901 to the temporary directory in order that the conversion may be performed.
2905 \begin_layout Plain Layout
2906 For example, the file may refer to other files---images, for example---using
2907 relative filenames, and these may become invalid when the file is copied
2908 to the temporary directory.
2913 This is done by a Copier: It copies a file to (or from) the temporary directory
2914 and may modify it in the process.
2917 \begin_layout Standard
2918 The definitions of the copiers may use four variables:
2922 \labelwidthstring 00.00.0000
2923 \begin_inset Flex CharStyle:Code
2926 \begin_layout Plain Layout
2932 The LyX system directory (e.
2933 \begin_inset space \thinspace{}
2937 \begin_inset space ~
2941 \begin_inset Flex CharStyle:MenuItem
2944 \begin_layout Plain Layout
2954 \labelwidthstring 00.00.0000
2955 \begin_inset Flex CharStyle:Code
2958 \begin_layout Plain Layout
2968 \labelwidthstring 00.00.0000
2969 \begin_inset Flex CharStyle:Code
2972 \begin_layout Plain Layout
2982 \labelwidthstring 00.00.0000
2983 \begin_inset Flex CharStyle:Code
2986 \begin_layout Plain Layout
2995 \begin_layout Standard
2996 The latter is to be given in a form suitable for inclusion in a LaTeX's
3003 command and is relevant only when exporting files suitable for such inclusion.
3006 \begin_layout Standard
3007 Copiers can be used to do almost anything with output files.
3008 For example, suppose you want generated pdf files to be copied to a special
3010 \begin_inset Flex CharStyle:Code
3013 \begin_layout Plain Layout
3020 Then you could write a shell script such as this one:
3023 \begin_layout Standard
3024 \begin_inset listings
3028 \begin_layout Plain Layout
3032 \begin_layout Plain Layout
3036 \begin_layout Plain Layout
3037 TOFILE=`basename $2`
3040 \begin_layout Plain Layout
3041 cp $FROMFILE /home/you/pdf/$TOFILE
3046 Save that in your local LyX directory---say,
3047 \begin_inset Flex CharStyle:Code
3050 \begin_layout Plain Layout
3051 /home/you/.lyx/scripts/pdfcopier.sh
3056 ---and make it executable, if you need to do so on your platform.
3058 \begin_inset Flex CharStyle:MenuItem
3061 \begin_layout Plain Layout
3062 Tools\SpecialChar \menuseparator
3069 \begin_inset Flex CharStyle:MenuItem
3072 \begin_layout Plain Layout
3078 format---or one of the other pdf formats---and enter
3079 \begin_inset Flex CharStyle:Code
3082 \begin_layout Plain Layout
3083 pdfcopier.sh $$i $$o
3089 \begin_inset Flex CharStyle:MenuItem
3092 \begin_layout Plain Layout
3102 \begin_layout Standard
3103 Copiers are used by LyX in various of its own conversions.
3104 For example, if appropriate programs are found, LyX will automatically
3105 install copiers for the
3106 \begin_inset Flex CharStyle:MenuItem
3109 \begin_layout Plain Layout
3116 \begin_inset Flex CharStyle:MenuItem
3119 \begin_layout Plain Layout
3121 \begin_inset space ~
3130 When these formats are exported, the copier sees that not just the main
3131 HTML file but various associated files (style files, images, etc.) are also
3133 All these files are written to a subdirectory of the directory in which
3134 the original LyX file was found.
3138 \begin_layout Plain Layout
3139 This copier can be customized.
3141 \begin_inset Quotes eld
3145 \begin_inset Quotes erd
3148 argument takes a comma-separated list of extensions to be copied; if it
3149 is omitted, all files will be copied.
3151 \begin_inset Quotes eld
3155 \begin_inset Quotes erd
3158 argument determines the extension added to the generated directory.
3160 \begin_inset Quotes eld
3164 \begin_inset Flex CharStyle:MenuItem
3167 \begin_layout Plain Layout
3174 \begin_inset Quotes erd
3177 , so HTML generated from
3178 \begin_inset Flex CharStyle:MenuItem
3181 \begin_layout Plain Layout
3182 /path/to/filename.lyx
3188 \begin_inset Flex CharStyle:MenuItem
3191 \begin_layout Plain Layout
3192 /path/to/filename.html.LyXconv
3206 \begin_layout Subsection
3207 \begin_inset CommandInset label
3209 name "sub:Converters"
3216 \begin_layout Standard
3217 You can define your own Converters to, uhh, convert files between different
3220 \begin_inset Flex CharStyle:MenuItem
3223 \begin_layout Plain Layout
3224 Tools\SpecialChar \menuseparator
3225 Preferences\SpecialChar \menuseparator
3226 File Handling\SpecialChar \menuseparator
3235 \begin_layout Standard
3236 To define a new converter, select the
3237 \begin_inset Flex CharStyle:MenuItem
3240 \begin_layout Plain Layout
3242 \begin_inset space ~
3251 \begin_inset space \thinspace{}
3255 \begin_inset Flex CharStyle:MenuItem
3258 \begin_layout Plain Layout
3260 \begin_inset space ~
3268 from the drop-down lists, enter the command needed for the conversion,
3270 \begin_inset Flex CharStyle:MenuItem
3273 \begin_layout Plain Layout
3280 Several variables can be used in the definition of converters:
3284 \labelwidthstring 00.00.0000
3285 \begin_inset Flex CharStyle:Code
3288 \begin_layout Plain Layout
3294 The LyX system directory
3298 \labelwidthstring 00.00.0000
3299 \begin_inset Flex CharStyle:Code
3302 \begin_layout Plain Layout
3312 \labelwidthstring 00.00.0000
3313 \begin_inset Flex CharStyle:Code
3316 \begin_layout Plain Layout
3326 \labelwidthstring 00.00.0000
3327 \begin_inset Flex CharStyle:Code
3330 \begin_layout Plain Layout
3336 The base filename of the input file (i.e., without the extension)
3340 \labelwidthstring 00.00.0000
3341 \begin_inset Flex CharStyle:Code
3344 \begin_layout Plain Layout
3350 The path to the input file
3353 \begin_layout Standard
3355 \begin_inset Flex CharStyle:MenuItem
3358 \begin_layout Plain Layout
3360 \begin_inset space ~
3368 field you can enter the following flags, separated by commas:
3372 \labelwidthstring 00.00.0000
3373 \begin_inset Flex CharStyle:Code
3376 \begin_layout Plain Layout
3382 This converter runs some form of LaTeX.
3383 This will make LyX's LaTeX error logs available.
3387 \labelwidthstring 00.00.0000
3388 \begin_inset Flex CharStyle:Code
3391 \begin_layout Plain Layout
3398 \begin_inset Flex CharStyle:MenuItem
3401 \begin_layout Plain Layout
3407 file for the conversion.
3411 \labelwidthstring 00.00.0000
3412 \begin_inset Flex CharStyle:Code
3415 \begin_layout Plain Layout
3424 \begin_layout Standard
3425 The following three flags are not really flags at all because they take
3427 \begin_inset Flex CharStyle:MenuItem
3430 \begin_layout Plain Layout
3432 \begin_inset space ~
3436 \begin_inset space ~
3448 \labelwidthstring 00.00.0000
3449 \begin_inset Flex CharStyle:Code
3452 \begin_layout Plain Layout
3458 If set, the converter's standard error will be redirected to a file
3459 \begin_inset Flex CharStyle:Code
3462 \begin_layout Plain Layout
3468 , and the script given as argument will be run as:
3469 \begin_inset Flex CharStyle:Code
3472 \begin_layout Plain Layout
3473 script <infile.out >infile.log
3479 The argument may contain
3480 \begin_inset Flex CharStyle:Code
3483 \begin_layout Plain Layout
3493 \labelwidthstring 00.00.0000
3494 \begin_inset Flex CharStyle:Code
3497 \begin_layout Plain Layout
3503 The name of the directory in which the converter will dump the generated
3505 LyX will not create this directory, and it does not copy anything into
3506 it, though it will copy this directory to the destination.
3507 The argument may contain
3508 \begin_inset Flex CharStyle:Code
3511 \begin_layout Plain Layout
3517 , which will be replaced by the basename of the input and output files,
3518 respectively, when the directory is copied.
3519 \begin_inset Newline newline
3522 Note that resultdir and usetempdir make no sense together.
3523 The latter will be ignored if the former is given.
3527 \labelwidthstring 00.00.0000
3528 \begin_inset Flex CharStyle:Code
3531 \begin_layout Plain Layout
3537 Determines the output filename and may, contain
3538 \begin_inset Flex CharStyle:Code
3541 \begin_layout Plain Layout
3548 Sensible only with resultdir and optional even then; if not given, it defaults
3552 \begin_layout Standard
3553 None of these last three are presently used in any of the converters that
3554 are installed with LyX.
3558 \begin_layout Standard
3559 You do not have to define converters between all the formats between which
3560 you want to convert.
3561 For example, you will note that there is no `LyX to PostScript®' converter,
3562 but LyX will export PostScript®.
3563 It does so by first creating a LaTeX file (no converter needs to be defined
3564 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
3565 and finally converting the resulting DVI file to PostScript®.
3566 LyX finds such `chains' of converters automatically, and it will always
3567 choose the shortest possible chain.
3568 You can, though, still define multiple conversion methods between file
3570 For example, the standard LyX configuration provides three ways to convert
3571 LaTeX to PDF: Directly, using
3572 \begin_inset Flex CharStyle:MenuItem
3575 \begin_layout Plain Layout
3581 ; via (DVI and) PostScript®, using
3582 \begin_inset Flex CharStyle:MenuItem
3585 \begin_layout Plain Layout
3592 \begin_inset Flex CharStyle:MenuItem
3595 \begin_layout Plain Layout
3602 To define such alternate chains, you must define multiple target `file
3603 formats', as described in section
3604 \begin_inset CommandInset ref
3606 reference "sub:Formats"
3611 For example, in the standard configuration, the formats named
3612 \begin_inset Flex CharStyle:MenuItem
3615 \begin_layout Plain Layout
3622 \begin_inset Flex CharStyle:MenuItem
3625 \begin_layout Plain Layout
3632 \begin_inset Flex CharStyle:MenuItem
3635 \begin_layout Plain Layout
3641 are defined, all of which share the extension
3642 \begin_inset Flex CharStyle:MenuItem
3645 \begin_layout Plain Layout
3651 , and which correspond to the conversion methods just mentioned.
3654 \begin_layout Section
3658 \begin_layout Standard
3659 The settings in this section affect the output LyX produces.
3662 \begin_layout Subsection
3663 Plain text export options
3666 \begin_layout Standard
3668 There are a couple of commands that can be used to
3669 \begin_inset Quotes eld
3673 \begin_inset Quotes erd
3676 exported plain text files.
3677 Note that LyX automatically detects and tries to use the best settings
3678 for your system at installation time, but you can modify them in the
3679 \begin_inset Flex CharStyle:MenuItem
3682 \begin_layout Plain Layout
3683 Output\SpecialChar \menuseparator
3689 dialog if you disagree with its interpretation.
3692 \begin_layout Description
3693 \begin_inset Flex CharStyle:Code
3696 \begin_layout Plain Layout
3702 This option defines the command used to produce better plain text tables
3704 \begin_inset Flex CharStyle:Code
3707 \begin_layout Plain Layout
3713 UNIX-commands (refer to their manpages for more information about them).
3714 Setting this as empty tells LyX to use the internal (inferior) formatter.
3717 \begin_layout Description
3718 \begin_inset Flex CharStyle:Code
3721 \begin_layout Plain Layout
3727 With this command you can set the default line length of the plain text
3729 Setting it to 0 means that no line breaks will be inserted except between
3730 paragraphs and the like.
3733 \begin_layout Section
3737 \begin_layout Standard
3738 There are many other configuration options that can be used to customize
3740 Most of them are sufficiently self-explanatory that we have not felt it
3741 necessary to document them here.
3743 \begin_inset CommandInset href
3745 name "mailing lists"
3746 target "http://www.lyx.org/mailing.php"
3750 if you need some more information.
3753 \begin_layout Chapter
3754 Internationalizing LyX
3755 \begin_inset CommandInset label
3764 \begin_layout Standard
3765 LyX supports using a translated interface.
3766 Last time we checked, LyX provided text in thirty languages.
3767 The language of choice is called your
3772 (For further reading on locale settings, see also the documentation for
3773 locale that comes with your operating system.
3774 For Linux, the manual page for
3775 \begin_inset Flex CharStyle:Code
3778 \begin_layout Plain Layout
3784 could be a good place to start).
3787 \begin_layout Standard
3788 Notice that these translations will work, but do contain a few flaws.
3789 In particular, all dialogs have been designed with the English text in
3790 mind, which means that some of the translated text will be too large to
3791 fit within the space allocated.
3792 This is only a display problem and will not cause any harm.
3793 Also, you will find that some of the translations do not define shortcut
3794 keys for everything.
3795 Sometimes, there are simply not enough free letters to do it.
3796 Other times, the translator just hasn't got around to doing it yet.
3797 Our localization team, which you may wish to join,
3801 \begin_layout Plain Layout
3802 If you are a fluent speaker of a language other than English, joining these
3803 teams is a great way to give back to the LyX community!
3808 will of course try to fix these shortcomings in future versions of LyX.
3811 \begin_layout Section
3815 \begin_layout Subsection
3816 Translating the graphical user interface (text messages).
3819 \begin_layout Standard
3821 \begin_inset Flex CharStyle:Code
3824 \begin_layout Plain Layout
3830 library to handle the internationalization of the interface.
3831 To have LyX speak your favorite language in all menus and dialogs, you
3833 \begin_inset Flex CharStyle:Code
3836 \begin_layout Plain Layout
3842 -file for that language.
3843 When this is available, you'll have to generate a
3844 \begin_inset Flex CharStyle:Code
3847 \begin_layout Plain Layout
3853 -file from it and install the
3854 \begin_inset Flex CharStyle:Code
3857 \begin_layout Plain Layout
3864 The process of doing all of this is explained in the documentation for
3866 \begin_inset Flex CharStyle:Code
3869 \begin_layout Plain Layout
3876 It is possible to do this just for yourself, but if you're going to do
3877 it, you might as well share the results of your labors with the rest of
3879 Send a message to the LyX developers' list for more information about how
3883 \begin_layout Standard
3884 In short, this is what you should do (xx denotes the language code):
3887 \begin_layout Itemize
3888 Check out the LyX source code.
3890 \begin_inset CommandInset href
3892 name "information on the web"
3893 target "http://www.lyx.org/devel/cvs.php"
3900 \begin_layout Itemize
3902 \begin_inset Flex CharStyle:Code
3905 \begin_layout Plain Layout
3916 \begin_inset Flex CharStyle:Code
3919 \begin_layout Plain Layout
3926 \begin_inset Flex CharStyle:Code
3929 \begin_layout Plain Layout
3935 doesn't exist, it can be remade with
3936 \begin_inset Flex CharStyle:Code
3939 \begin_layout Plain Layout
3945 in that directory, or you can use an existing po-file for some other language
3949 \begin_layout Itemize
3951 \begin_inset Flex CharStyle:Code
3954 \begin_layout Plain Layout
3964 \begin_layout Plain Layout
3965 This is just a text file, so it can be edited in any text editor.
3966 But there are also specialized programs that support such editing, such
3967 as KBabel (for KDE).
3968 Emacs contains a `mode' for editing
3969 \begin_inset Flex CharStyle:Code
3972 \begin_layout Plain Layout
3983 For some menu- and widget-labels, there are also shortcut keys that should
3985 Those keys are marked after a `|', and should be translated according to
3986 the words and phrases of the language.
3987 You should also fill also out the information at the beginning of the new
3989 \begin_inset Flex CharStyle:Code
3992 \begin_layout Plain Layout
3998 -file with your email-address, etc., so people know where to reach you with
3999 suggestions and entertaining flames.
4002 \begin_layout Standard
4003 If you are just doing this on your own, then:
4006 \begin_layout Itemize
4008 \begin_inset Flex CharStyle:Code
4011 \begin_layout Plain Layout
4018 This can be done with
4019 \begin_inset Flex CharStyle:Code
4022 \begin_layout Plain Layout
4023 msgfmt -o xx.mo < xx.po
4031 \begin_layout Itemize
4033 \begin_inset Flex CharStyle:Code
4036 \begin_layout Plain Layout
4042 -file to your locale-tree, at the correct directory for application messages
4047 xx, and under the name
4048 \begin_inset Flex CharStyle:Code
4051 \begin_layout Plain Layout
4059 \begin_inset Flex CharStyle:Code
4062 \begin_layout Plain Layout
4063 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
4073 \begin_layout Standard
4074 As said, however, it would be best if the new
4075 \begin_inset Flex CharStyle:Code
4078 \begin_layout Plain Layout
4084 -file could be added to the LyX distribution, so others can use it.
4085 Adding it involves making additional changes to LyX.
4086 So send an email to the developers' mailing list if you're interested in
4090 \begin_layout Subsubsection
4094 \begin_layout Standard
4095 Sometimes it turns out that one English message needs to be translated into
4096 different messages in the target language.
4097 One example is the message
4098 \begin_inset Flex CharStyle:Code
4101 \begin_layout Plain Layout
4107 which has the German translation
4115 , depending upon exactly what the English
4116 \begin_inset Quotes eld
4120 \begin_inset Quotes erd
4125 \begin_inset Flex CharStyle:Code
4128 \begin_layout Plain Layout
4134 does not handle such ambigous translations.
4135 Therefore you have to add some context information to the message: Instead
4137 \begin_inset Flex CharStyle:Code
4140 \begin_layout Plain Layout
4147 \begin_inset Flex CharStyle:Code
4150 \begin_layout Plain Layout
4151 To[[as in 'From format x to format y']]
4157 \begin_inset Flex CharStyle:Code
4160 \begin_layout Plain Layout
4161 To[[as in 'From page x to page y']].
4166 Now the two occurences of
4167 \begin_inset Flex CharStyle:Code
4170 \begin_layout Plain Layout
4177 \begin_inset Flex CharStyle:Code
4180 \begin_layout Plain Layout
4186 and can be translated correctly to
4197 \begin_layout Standard
4198 Of course the context information needs to be stripped off the original
4199 message when no translation is used.
4200 Therefore you have to put it in double square brackets at the end of the
4201 message (see the example above).
4202 The translation mechanism of LyX ensures that everything in double square
4203 brackets at the end of messages is removed before displaying the message.
4206 \begin_layout Subsection
4207 Translating the documentation.
4210 \begin_layout Standard
4211 The online documentation (in the
4212 \begin_inset Flex CharStyle:MenuItem
4215 \begin_layout Plain Layout
4225 -menu) can (and should!) be translated.
4226 If there are translated versions of the documentation available
4230 \begin_layout Plain Layout
4231 As of March 2008, at least some of the documents have been translated into
4232 fourteen languages, with the Tutorial available in a few more.
4237 and the locale is set accordingly, these will be used automagically by
4239 LyX looks for translated versions as
4240 \begin_inset Flex CharStyle:Code
4243 \begin_layout Plain Layout
4244 LyXDir/doc/xx_DocName.lyx
4250 \begin_inset Flex CharStyle:Code
4253 \begin_layout Plain Layout
4259 is the code for the language currently in use.
4260 If there are no translated documents, the default English versions will
4262 Note that the translated versions must have the same filenames (
4263 \begin_inset Flex CharStyle:Code
4266 \begin_layout Plain Layout
4272 above) as the original.
4273 If you feel up to translating the documentation (an excellent way to proof-read
4274 the original documentation by the way!), there are a few things you should
4278 \begin_layout Itemize
4280 \begin_inset Flex CharStyle:Code
4283 \begin_layout Plain Layout
4289 , the guide to writing LyX documentation.
4290 Pay special attention to the translator's section.
4293 \begin_layout Itemize
4294 Check out the documentation translation web page at
4295 \begin_inset CommandInset href
4297 name "http://www.devel.lyx.org"
4298 target "http://www.devel.lyx.org"
4303 That way, you can find out which (if any) documents have already been translate
4304 d into your language.
4305 You can also find out who (if anyone) is organizing the effort to translate
4306 the documentation into your language.
4307 If no one is organizing the effort, please let us know that you're interested.
4310 \begin_layout Standard
4311 Once you get to actually translating, here's a few hints for you that may
4315 \begin_layout Itemize
4316 Join the documentation team! There is information on how to do that in
4317 \begin_inset Flex CharStyle:Code
4320 \begin_layout Plain Layout
4327 \begin_inset Flex CharStyle:MenuItem
4330 \begin_layout Plain Layout
4335 elp\SpecialChar \menuseparator
4345 ), which by the way is the first document you should translate.
4348 \begin_layout Itemize
4349 Learn the typographic conventions for the language you are translating to.
4350 Typography is an ancient art and over the centuries, a great variety of
4351 conventions have developed throughout different parts of the world.
4352 Also study the professional terminology amongst typographers in your country.
4353 Inventing your own terminology will only confuse the users.
4356 (Warning! Typography is addictive!)
4359 \begin_layout Itemize
4360 Make a copy of the document.
4361 This will be your working copy.
4362 You can use this as your personal translated help-file by placing it in
4364 \begin_inset Flex CharStyle:Code
4367 \begin_layout Plain Layout
4376 \begin_layout Itemize
4377 Sometimes the original document (from the LyX-team) will be updated.
4378 Use the source viewer at
4379 \begin_inset CommandInset href
4381 name "http://www.lyx.org/trac/timeline"
4382 target "http://www.lyx.org/trac/timeline"
4386 to see what has been changed.
4387 That way you can easily see which parts of the translated document need
4391 \begin_layout Standard
4392 If you ever find an error in the original document, fix it and notify the
4393 rest of the documentation team of the changes! (You didn't forget to join
4394 the documentation team, did you?)
4397 \begin_layout Standard
4398 \begin_inset Branch OutDated
4401 \begin_layout Section
4402 International Keyboard Support
4405 \begin_layout Standard
4408 [Editor's Note: The following section is by
4416 It needs to be fixed to conform to the new Documentation Style sheet and
4417 to make use of the new v1.0 features.
4418 The whole thing also needs to be merged with the section following it.-jw
4419 It may also be badly out of date.-rh (2008)]
4422 \begin_layout Subsection
4423 Defining Own Keymaps: Keymap File Format
4426 \begin_layout Standard
4427 Let's look at a keyboard definition file a little closer.
4428 It is a plain text file defining
4431 \begin_layout Itemize
4432 key-to-key or key-to-string translations
4435 \begin_layout Itemize
4439 \begin_layout Itemize
4440 dead keys exceptions
4443 \begin_layout Standard
4444 To define key-to-key or key-to-string translation, use this command:
4447 \begin_layout Quotation
4448 \begin_inset Flex CharStyle:Code
4451 \begin_layout Plain Layout
4460 \begin_inset Flex CharStyle:Code
4463 \begin_layout Plain Layout
4472 \begin_layout Standard
4474 \begin_inset Flex CharStyle:Code
4477 \begin_layout Plain Layout
4483 is the key to be translated and
4484 \begin_inset Flex CharStyle:Code
4487 \begin_layout Plain Layout
4493 is the string to be inserted into the document.
4494 To define dead keys, use:
4497 \begin_layout Quotation
4498 \begin_inset Flex CharStyle:Code
4501 \begin_layout Plain Layout
4510 \begin_inset Flex CharStyle:Code
4513 \begin_layout Plain Layout
4522 \begin_layout Standard
4524 \begin_inset Flex CharStyle:Code
4527 \begin_layout Plain Layout
4533 is a keyboard key and
4534 \begin_inset Flex CharStyle:Code
4537 \begin_layout Plain Layout
4544 The following dead keys are supported (shortcut name is in parentheses):
4547 \begin_layout Quotation
4551 \begin_inset space \hfill{}
4557 \begin_layout Quotation
4559 \begin_inset space \hfill{}
4565 \begin_layout Quotation
4567 \begin_inset space \hfill{}
4573 \begin_layout Quotation
4575 \begin_inset space \hfill{}
4581 \begin_layout Quotation
4583 \begin_inset space \hfill{}
4589 \begin_layout Quotation
4591 \begin_inset space \hfill{}
4598 \begin_layout Plain Layout
4610 \begin_layout Quotation
4612 \begin_inset space \hfill{}
4618 \begin_layout Quotation
4620 \begin_inset space \hfill{}
4627 \begin_layout Plain Layout
4639 \begin_layout Quotation
4641 \begin_inset space \hfill{}
4647 \begin_layout Quotation
4649 \begin_inset space \hfill{}
4655 \begin_layout Quotation
4657 \begin_inset space \hfill{}
4664 \begin_layout Plain Layout
4676 \begin_layout Quotation
4678 \begin_inset space \hfill{}
4685 \begin_layout Plain Layout
4697 \begin_layout Quotation
4699 \begin_inset space \hfill{}
4705 \begin_layout Quotation
4706 hungarian umlaut (hug)
4707 \begin_inset space \hfill{}
4713 \begin_layout Quotation
4715 \begin_inset space \hfill{}
4721 \begin_layout Quotation
4723 \begin_inset space \hfill{}
4730 \begin_layout Plain Layout
4742 \begin_layout Standard
4743 Since in many international keyboards there are exceptions to what some
4744 dead keys should do, you can define them using
4747 \begin_layout Quotation
4748 \begin_inset Flex CharStyle:Code
4751 \begin_layout Plain Layout
4759 deadkey key outstring
4762 \begin_layout Standard
4763 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
4767 \begin_layout Quotation
4768 \begin_inset Flex CharStyle:Code
4771 \begin_layout Plain Layout
4784 \begin_layout Standard
4785 to make it work correctly.
4786 Also, you have to define as exceptions dead keys over i and j, to remove
4787 the dot from them before inserting an accent mark.
4788 I will change this when the time comes, but so far I haven't had time.
4791 \begin_layout Standard
4792 Oh, and about characters: backslash is escaped, so to enter it, you'll need
4795 \begin_inset Flex CharStyle:Code
4798 \begin_layout Plain Layout
4804 have different meaning.
4806 \begin_inset Flex CharStyle:Code
4809 \begin_layout Plain Layout
4815 marks comments, quotes start and end LaTeX-style commands.
4816 To enter quote, you'll need to use
4817 \begin_inset Flex CharStyle:Code
4820 \begin_layout Plain Layout
4829 \begin_inset Flex CharStyle:Code
4832 \begin_layout Plain Layout
4839 \begin_inset Flex CharStyle:Code
4842 \begin_layout Plain Layout
4853 \begin_layout Standard
4854 If you make a keyboard description file that works for your language, please
4855 mail it to me, so I can include it in the next keymap distribution.
4858 \begin_layout Standard
4859 More keywords will be supported in keymap configuration file in future,
4863 \begin_layout Itemize
4864 \begin_inset Flex CharStyle:Code
4867 \begin_layout Plain Layout
4878 \begin_inset space \hfill{}
4882 \begin_inset Flex CharStyle:Code
4885 \begin_layout Plain Layout
4894 \begin_layout Itemize
4895 \begin_inset Flex CharStyle:Code
4898 \begin_layout Plain Layout
4909 \begin_inset space \hfill{}
4913 \begin_inset Flex CharStyle:Code
4916 \begin_layout Plain Layout
4922 an external keymap translation program
4925 \begin_layout Standard
4926 Also, it should look into
4927 \begin_inset Flex CharStyle:Code
4930 \begin_layout Plain Layout
4936 file for defaults, too (for example, a
4937 \begin_inset Flex CharStyle:Code
4940 \begin_layout Plain Layout
4948 option to include default keyboard).
4956 \begin_layout Section
4957 \begin_inset CommandInset label
4963 International Keymap Stuff
4966 \begin_layout Standard
4967 \begin_inset Note Note
4970 \begin_layout Plain Layout
4971 In doing the revisions on this document in March 2008, I did not look over
4972 this stuff, as I do not understand it.
4973 It would be good if someone else could do so.
4981 \begin_layout Standard
4982 The next two sections describe the
4983 \begin_inset Flex CharStyle:Code
4986 \begin_layout Plain Layout
4995 \begin_inset Flex CharStyle:Code
4998 \begin_layout Plain Layout
5006 file syntax in detail.
5007 These sections should help you design your own key map if the ones provided
5008 do not meet your needs.
5011 \begin_layout Subsection
5015 \begin_layout Standard
5019 \begin_inset Flex CharStyle:Code
5022 \begin_layout Plain Layout
5028 file maps keystrokes to characters or strings.
5029 As the name suggests, it sets a keyboard mapping.
5031 \begin_inset Flex CharStyle:Code
5034 \begin_layout Plain Layout
5045 \begin_inset Flex CharStyle:Code
5048 \begin_layout Plain Layout
5063 \begin_inset Flex CharStyle:Code
5066 \begin_layout Plain Layout
5079 \begin_inset Flex CharStyle:Code
5082 \begin_layout Plain Layout
5091 \begin_inset Flex CharStyle:Code
5094 \begin_layout Plain Layout
5102 are described in this section.
5106 \labelwidthstring 00.00.0000
5107 \begin_inset Flex CharStyle:Code
5110 \begin_layout Plain Layout
5118 Map a character to a string
5121 \begin_layout LyX-Code
5136 \begin_layout Standard
5169 the double-quote (")
5186 must be escaped with a preceding backslash (
5197 \begin_layout Standard
5199 \begin_inset Flex CharStyle:MenuItem
5202 \begin_layout Plain Layout
5210 statement to cause the symbol
5211 \begin_inset Flex CharStyle:MenuItem
5214 \begin_layout Plain Layout
5222 to be output for the keystroke
5223 \begin_inset Flex CharStyle:MenuItem
5226 \begin_layout Plain Layout
5237 \begin_layout LyX-Code
5244 \labelwidthstring 00.00.0000
5245 \begin_inset Flex CharStyle:Code
5248 \begin_layout Plain Layout
5256 Specify an accent character
5259 \begin_layout LyX-Code
5268 \begin_layout Standard
5269 This will make the cha
5307 This is the dead key
5311 \begin_layout Plain Layout
5318 refers to a key that does not produce a character by itself, but when followed
5319 with another key, produces the desired accent character.
5320 For example, a German characte
5322 r with an umlaut like
5332 can be produced in this manner.
5341 \begin_layout Standard
5354 and then another key not in
5371 followed by the other, unallowed key, as output.
5375 \begin_inset Flex CharStyle:MenuItem
5378 \begin_layout Plain Layout
5386 cancels a dead key, so if
5397 \begin_inset Flex CharStyle:MenuItem
5400 \begin_layout Plain Layout
5409 , the cursor will not go one position backwards but will instead cancel
5425 might have had on the next keystroke.
5429 \begin_layout Standard
5430 The following example specifies that the character ' is to be an acute accent,
5431 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
5434 \begin_layout LyX-Code
5437 kmod ' acute aeiouAEIOU
5441 \labelwidthstring 00.00.0000
5442 \begin_inset Flex CharStyle:Code
5445 \begin_layout Plain Layout
5451 Specify an exception to the accent character
5454 \begin_layout LyX-Code
5463 \begin_layout Standard
5464 This defines an exce
5505 have been assigned a keystroke with a previous
5508 \begin_inset Flex CharStyle:Code
5511 \begin_layout Plain Layout
5535 must not belong in the
5587 If such a declaration does not exist in
5595 \begin_inset Flex CharStyle:Code
5598 \begin_layout Plain Layout
5638 \begin_inset Flex CharStyle:Code
5641 \begin_layout Plain Layout
5655 \begin_layout Standard
5656 The following command produces causes äi to be produced when you enter acute-i
5660 \begin_layout LyX-Code
5675 \labelwidthstring 00.00.0000
5676 \begin_inset Flex CharStyle:Code
5679 \begin_layout Plain Layout
5685 Combine two accent characters
5688 \begin_layout LyX-Code
5694 accent1 accent2 allowed
5697 \begin_layout Standard
5698 This one is getting pretty esoteric.
5699 It allows you to combine the effect
5755 \begin_inset Flex CharStyle:Code
5758 \begin_layout Plain Layout
5786 \begin_layout Standard
5787 Consider this example from the
5788 \begin_inset Flex CharStyle:Code
5791 \begin_layout Plain Layout
5802 \begin_layout LyX-Code
5805 kmod ; acute aeioyvhAEIOYVH
5809 kcomb acute umlaut iyIY
5812 \begin_layout Standard
5813 This allows you to press
5814 \begin_inset Flex CharStyle:MenuItem
5817 \begin_layout Plain Layout
5825 and get the effect of
5826 \begin_inset Flex CharStyle:Code
5829 \begin_layout Plain Layout
5848 in this case cancels the last dead key, so if you press
5849 \begin_inset Flex CharStyle:MenuItem
5852 \begin_layout Plain Layout
5861 \begin_inset Flex CharStyle:Code
5864 \begin_layout Plain Layout
5877 \begin_layout Subsection
5881 \begin_layout Standard
5883 \begin_inset Flex CharStyle:Code
5886 \begin_layout Plain Layout
5894 mapping is performed, a
5895 \begin_inset Flex CharStyle:Code
5898 \begin_layout Plain Layout
5908 file maps the strings that the symbols generate to characters in the current
5910 The LyX distribution currently includes at least the
5911 \begin_inset Flex CharStyle:Code
5914 \begin_layout Plain Layout
5923 \begin_inset Flex CharStyle:Code
5926 \begin_layout Plain Layout
5937 \begin_layout Standard
5939 \begin_inset Flex CharStyle:Code
5942 \begin_layout Plain Layout
5950 file is a sequence of declarations of the form
5953 \begin_layout LyX-Code
5966 \begin_layout Standard
5967 For example, in order to map
5968 \begin_inset Flex CharStyle:MenuItem
5971 \begin_layout Plain Layout
5981 to the corresponding character in the iso-8859-1 set (233), the following
5985 \begin_layout LyX-Code
5993 \begin_layout Standard
5995 \begin_inset Flex CharStyle:Code
5998 \begin_layout Plain Layout
6007 \begin_inset Flex CharStyle:Code
6010 \begin_layout Plain Layout
6028 the same character can apply to more than one string.
6030 \begin_inset Flex CharStyle:Code
6033 \begin_layout Plain Layout
6044 \begin_layout LyX-Code
6056 \begin_inset Newline newline
6072 \begin_layout Standard
6073 If LyX cannot find a mapping for the string produced by the keystroke or
6074 a deadkey sequence, it will check if it looks like an accented char and
6075 try to draw an accent over the character on screen.
6078 \begin_layout Subsection
6082 \begin_layout Standard
6083 There is a second way to add support for international characters through
6084 so-called dead-keys.
6085 A dead-key works in combination with a letter to produce an accented character.
6086 Here, we'll explain how to create a really simple dead-key to illustrate
6090 \begin_layout Standard
6091 Suppose you happen to need the circumflex character,
6092 \begin_inset Quotes eld
6096 \begin_inset Quotes erd
6101 \begin_inset Flex CharStyle:MenuItem
6104 \begin_layout Plain Layout
6111 \begin_inset space ~
6115 \begin_inset Flex CharStyle:MenuItem
6118 \begin_layout Plain Layout
6124 ] to the LyX command
6125 \begin_inset Flex CharStyle:Code
6128 \begin_layout Plain Layout
6135 \begin_inset Flex CharStyle:Code
6138 \begin_layout Plain Layout
6145 Now, whenever you type the
6146 \begin_inset Flex CharStyle:MenuItem
6149 \begin_layout Plain Layout
6155 -key followed by a letter, that letter will have a circumflex accent on
6157 For example, the sequence
6158 \begin_inset Quotes eld
6162 \begin_inset Flex CharStyle:MenuItem
6165 \begin_layout Plain Layout
6172 \begin_inset Quotes erd
6175 produces the letter:
6176 \begin_inset Quotes eld
6180 \begin_inset Quotes erd
6184 If you tried to type
6185 \begin_inset Quotes eld
6189 \begin_inset Flex CharStyle:MenuItem
6192 \begin_layout Plain Layout
6199 \begin_inset Quotes erd
6202 , however, LyX will complain with a beep, since a
6203 \begin_inset Quotes eld
6207 \begin_inset Flex CharStyle:MenuItem
6210 \begin_layout Plain Layout
6217 \begin_inset Quotes erd
6220 never takes a circumflex accent.
6222 \begin_inset Flex CharStyle:MenuItem
6225 \begin_layout Plain Layout
6231 after a dead-key produces the bare-accent.
6232 Please note this last point! If you bind a key to a dead-key, you'll need
6233 to rebind the character on that key to yet another key.
6235 \begin_inset Flex CharStyle:MenuItem
6238 \begin_layout Plain Layout
6244 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
6247 \begin_layout Standard
6248 One common way to bind dead-keys is to use
6249 \begin_inset Flex CharStyle:MenuItem
6252 \begin_layout Plain Layout
6259 \begin_inset Flex CharStyle:MenuItem
6262 \begin_layout Plain Layout
6269 \begin_inset Flex CharStyle:MenuItem
6272 \begin_layout Plain Layout
6278 in combination with an accent, like
6279 \begin_inset Quotes eld
6283 \begin_inset Flex CharStyle:MenuItem
6286 \begin_layout Plain Layout
6293 \begin_inset Quotes erd
6297 \begin_inset Quotes eld
6301 \begin_inset Flex CharStyle:MenuItem
6304 \begin_layout Plain Layout
6311 \begin_inset Quotes erd
6315 \begin_inset Quotes eld
6319 \begin_inset Flex CharStyle:MenuItem
6322 \begin_layout Plain Layout
6329 \begin_inset Quotes erd
6333 Another way involves using
6334 \begin_inset Flex CharStyle:Code
6337 \begin_layout Plain Layout
6344 \begin_inset Flex CharStyle:Code
6347 \begin_layout Plain Layout
6353 to set up the special
6354 \begin_inset Flex CharStyle:Code
6357 \begin_layout Plain Layout
6365 \begin_inset Flex CharStyle:Code
6368 \begin_layout Plain Layout
6374 acts in some ways just like
6375 \begin_inset Flex CharStyle:MenuItem
6378 \begin_layout Plain Layout
6384 and permits you to bind keys to accented characters.
6385 You can also turn keys into dead-keys by binding them to something like
6387 \begin_inset Flex CharStyle:Code
6390 \begin_layout Plain Layout
6396 and then binding this symbolic key to the corresponding LyX command.
6400 \begin_layout Plain Layout
6405 : This is exactly what I do in my
6406 \begin_inset Flex CharStyle:Code
6409 \begin_layout Plain Layout
6416 \begin_inset Flex CharStyle:Code
6419 \begin_layout Plain Layout
6427 \begin_inset Flex CharStyle:MenuItem
6430 \begin_layout Plain Layout
6432 \begin_inset space ~
6441 \begin_inset Flex CharStyle:Code
6444 \begin_layout Plain Layout
6450 and a bunch of these
6451 \begin_inset Quotes eld
6455 \begin_inset Flex CharStyle:Code
6458 \begin_layout Plain Layout
6465 \begin_inset Quotes erd
6468 symbolic keys bound such things as
6469 \begin_inset Flex CharStyle:MenuItem
6472 \begin_layout Plain Layout
6474 \begin_inset space ~
6483 \begin_inset Flex CharStyle:MenuItem
6486 \begin_layout Plain Layout
6488 \begin_inset space ~
6497 This is how I produce my accented characters.
6502 You can make just about anything into the
6503 \begin_inset Flex CharStyle:Code
6506 \begin_layout Plain Layout
6513 \begin_inset Flex CharStyle:MenuItem
6516 \begin_layout Plain Layout
6522 keys, a spare function key, etc.
6523 As for the LyX commands that produce accents, check the entry for
6524 \begin_inset Flex CharStyle:Code
6527 \begin_layout Plain Layout
6538 You'll find the complete list there.
6541 \begin_layout Subsection
6542 Saving your Language Configuration
6545 \begin_layout Standard
6546 \begin_inset CommandInset label
6552 You can edit your preferences so that your desired language environment
6553 is automatically configured when LyX starts up, via the
6554 \begin_inset Flex CharStyle:MenuItem
6557 \begin_layout Plain Layout
6562 dit\SpecialChar \menuseparator
6575 \begin_layout Chapter
6576 Installing New Document Classes, Layouts, and Templates
6577 \begin_inset CommandInset label
6579 name "chap:textclass"
6587 \begin_layout Plain Layout
6588 Installing New Document Classes
6596 \begin_layout Standard
6597 In this chapter, we describe the procedures for creating and installing
6598 new LyX layout and template files, as well as offer a refresher on correctly
6599 installing new LaTeX document classes.
6600 Some definitions: a document class is a LaTeX file (usually ending in
6601 \begin_inset Flex CharStyle:Code
6604 \begin_layout Plain Layout
6611 \begin_inset Flex CharStyle:Code
6614 \begin_layout Plain Layout
6620 ) that describes the format of a document such as an article, report, journal
6621 preprint, etc, and all the commands needed to realize that format.
6622 A layout file is a LyX file that corresponds to a LaTeX document class
6623 and that tells LyX how to
6624 \begin_inset Quotes eld
6628 \begin_inset Quotes erd
6631 things on the screen to make the display look something like the final
6633 More precisely, a layout file describes a
6634 \begin_inset Quotes eld
6638 \begin_inset Quotes erd
6641 which is the internal construct LyX uses to render the screen display.
6643 \begin_inset Quotes eld
6647 \begin_inset Quotes erd
6651 \begin_inset Quotes eld
6655 \begin_inset Quotes erd
6658 can be used somewhat interchangeably, but it is better to refer to the
6659 file as the layout, and the thing living in LyX's memory as the text class.
6660 A template file is simply a LyX document that contains a set of predefined
6661 entries for a given document class---entries that are generally required
6663 Templates are especially useful for things like journal manuscripts that
6664 are to be submitted electronically.
6667 \begin_layout Section
6668 Installing a new LaTeX package
6671 \begin_layout Standard
6672 Some installations may not include a LaTeX package that you would like to
6674 For example, you might need FoilTeX, a common (and very powerful) package
6675 for preparing slides or viewgraphs for overhead projectors.
6676 On some systems, you may have a GUI for installing such packages: MikTeX
6677 on Windows®, for example.
6680 \begin_layout Standard
6681 If you don't have such a GUI, then you can follow these steps.
6684 \begin_layout Enumerate
6685 Get the package from
6686 \begin_inset CommandInset href
6689 target "http://www.ctan.org/"
6696 \begin_layout Enumerate
6697 You can install this package in several different places.
6698 If you want it to be available for all users on your system, then you should
6699 install it in your `local' TeX tree; if you want (or need) it to be available
6700 just for you, then you can install it in your own `user' TeX tree.
6701 Where these should be created, if they do not already exist, depends upon
6702 the details of your system.
6703 To find out, look in the file
6704 \begin_inset Flex CharStyle:Code
6707 \begin_layout Plain Layout
6717 \begin_layout Plain Layout
6718 This usually lives in the directory
6719 \begin_inset Flex CharStyle:Code
6722 \begin_layout Plain Layout
6728 , though you can run
6729 \begin_inset Flex CharStyle:Code
6732 \begin_layout Plain Layout
6743 The location of the `local' TeX tree is defined by
6744 \begin_inset Flex CharStyle:Code
6747 \begin_layout Plain Layout
6753 ; this is usually somewhere like
6754 \begin_inset Flex CharStyle:Code
6757 \begin_layout Plain Layout
6758 /usr/local/share/texmf/
6764 The `user' TeX tree is defined by
6765 \begin_inset Flex CharStyle:Code
6768 \begin_layout Plain Layout
6775 \begin_inset Flex CharStyle:Code
6778 \begin_layout Plain Layout
6785 (If these variables are not predefined, you can define them.) You'll probably
6786 need root permissions to create or modify the `local' tree; but your `user'
6787 tree shouldn't have such limitations.
6790 \begin_layout Enumerate
6792 \begin_inset Flex CharStyle:Code
6795 \begin_layout Plain Layout
6802 \begin_inset Flex CharStyle:Code
6805 \begin_layout Plain Layout
6812 \begin_inset Flex CharStyle:Code
6815 \begin_layout Plain Layout
6823 \begin_inset Newline newline
6827 \begin_inset Flex CharStyle:Code
6830 \begin_layout Plain Layout
6831 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
6837 \begin_inset Newline newline
6840 But, again, most of this will
6841 \begin_inset Quotes eld
6845 \begin_inset Quotes erd
6851 \begin_layout Enumerate
6856 \begin_layout Plain Layout
6857 We'll assume henceforth that you're defining `local' TeX tree.
6858 If you're defining a user tree, just adjust as necessary.
6864 You must follow the directory structure of your existing
6865 \begin_inset Flex CharStyle:Code
6868 \begin_layout Plain Layout
6874 directory, which will be found at
6875 \begin_inset Flex CharStyle:Code
6878 \begin_layout Plain Layout
6885 For example, latex packages should go under
6886 \begin_inset Flex CharStyle:Code
6889 \begin_layout Plain Layout
6890 $TEXMFLOCAL/tex/latex/
6898 \begin_layout Enumerate
6899 Install the package.
6900 For example, you would unpack the FoilTeX tarball and copy it to
6901 \begin_inset Flex CharStyle:Code
6904 \begin_layout Plain Layout
6905 $TEXMFLOCAL/tex/latex/foiltex
6912 \begin_inset Flex CharStyle:Code
6915 \begin_layout Plain Layout
6921 directory contains various files.
6924 \begin_layout Enumerate
6926 \begin_inset Flex CharStyle:Code
6929 \begin_layout Plain Layout
6937 \begin_inset Flex CharStyle:Code
6940 \begin_layout Plain Layout
6949 \begin_layout Standard
6950 Your package is now installed and available to LaTeX.
6951 To make it available to LyX, you need to create a Layout file, if one is
6952 not already available.
6953 (See the next section.) Once you have a layout file, you need only reconfigure
6955 \begin_inset Flex CharStyle:MenuItem
6958 \begin_layout Plain Layout
6963 ools\SpecialChar \menuseparator
6973 ) and then restart LyX.
6974 You should then see your new package---for example
6975 \begin_inset Flex CharStyle:MenuItem
6978 \begin_layout Plain Layout
6985 \begin_inset Flex CharStyle:MenuItem
6988 \begin_layout Plain Layout
6993 ocument\SpecialChar \menuseparator
7004 \begin_inset Flex CharStyle:MenuItem
7007 \begin_layout Plain Layout
7017 \begin_layout Section
7018 \begin_inset CommandInset label
7027 \begin_layout Standard
7028 This section describes how to write and install your own LyX layout files
7029 and walks through the
7030 \begin_inset Flex CharStyle:Code
7033 \begin_layout Plain Layout
7039 text class format as an example.
7041 \begin_inset Flex CharStyle:Code
7044 \begin_layout Plain Layout
7050 files describe what paragraph and character styles are available for a
7051 given document class and how LyX should display them.
7052 We try to provide a thorough description of the process here; however,
7053 there are so many different types of documents supported by LaTeX classes
7054 that we can't hope to cover every different possibility or problem you
7056 (The LyX users' list is frequented by people with lots of experience with
7057 layout design who are willing to share what they've learned.)
7060 \begin_layout Standard
7061 As you prepare to write a new layout, it is extremely helpful to look at
7062 the example layouts distributed with LyX.
7063 If you use a nice LaTeX document class that might be of interest for others,
7064 too, and have a nice corresponding LyX layout, feel free to contribute
7065 the stuff to us, so we may put it into the distribution.
7067 \begin_inset CommandInset href
7069 name "section on the LyX wiki"
7070 target "http://wiki.lyx.org/Layouts/Layouts"
7074 for this kind of material.
7077 \begin_layout Standard
7078 All the tags described in this chapter are case-insensitive; this means
7080 \begin_inset Flex CharStyle:Code
7083 \begin_layout Plain Layout
7090 \begin_inset Flex CharStyle:Code
7093 \begin_layout Plain Layout
7100 \begin_inset Flex CharStyle:Code
7103 \begin_layout Plain Layout
7109 are really the same command.
7110 The possible values are printed in brackets after the feature's name.
7111 The default value if a feature isn't specified inside a text class-description
7113 \begin_inset Flex CharStyle:Code
7116 \begin_layout Plain Layout
7125 If the argument has a datatype like
7126 \begin_inset Quotes eld
7130 \begin_inset Quotes erd
7134 \begin_inset Quotes eld
7138 \begin_inset Quotes erd
7141 , the default is shown like this:
7142 \begin_inset Flex CharStyle:Code
7145 \begin_layout Plain Layout
7156 \begin_layout Subsection
7157 \begin_inset CommandInset label
7159 name "sub:Layout-modules"
7166 \begin_layout Standard
7167 Similar to layout files, and new with LyX 1.6, are layout
7172 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
7173 some modules---such as the Endnotes module---provide support for just such
7175 In a sense, layout modules are similar to included files---files like
7176 \begin_inset Flex CharStyle:Code
7179 \begin_layout Plain Layout
7185 ---in that modules are not specific to a given document layout but may be
7186 used with many different layouts.
7187 The difference is that using a layout module does not require editing the
7189 Rather, modules are selected in the
7190 \begin_inset Flex CharStyle:MenuItem
7193 \begin_layout Plain Layout
7198 ocument\SpecialChar \menuseparator
7211 \begin_layout Standard
7212 Building modules is the easiest way to get started with layout editing,
7213 since it can be as simple as adding a single new paragraph or flex inset.
7214 But modules may, in principle, contain anything a layout file can contain.
7217 \begin_layout Standard
7218 A module must begin with a line like the following:
7221 \begin_layout LyX-Code
7224 DeclareLyXModule[endnotes.sty]{Endnotes}
7227 \begin_layout Standard
7228 The argument in square brackets is optional: It declares any LaTeX packages
7229 on which the module depends.
7230 The mandatory argument, in curly brackets, is the name of the module, as
7232 \begin_inset Flex CharStyle:MenuItem
7235 \begin_layout Plain Layout
7236 Document\SpecialChar \menuseparator
7246 \begin_layout Standard
7247 The module declaration should then be followed by lines like the following:
7250 \begin_layout LyX-Code
7254 \begin_layout LyX-Code
7255 #Adds an endnote command, in addition to footnotes.
7259 \begin_layout LyX-Code
7260 #You will need to add
7262 theendnotes in ERT where you
7265 \begin_layout LyX-Code
7266 #want the endnotes to appear.
7270 \begin_layout LyX-Code
7274 \begin_layout LyX-Code
7275 #Requires: somemodule | othermodule
7278 \begin_layout LyX-Code
7279 #Excludes: badmodule
7282 \begin_layout Standard
7283 The description is used in
7284 \begin_inset Flex CharStyle:MenuItem
7287 \begin_layout Plain Layout
7288 Document\SpecialChar \menuseparator
7294 to provide the user with information about what the module does.
7296 \begin_inset Flex CharStyle:Code
7299 \begin_layout Plain Layout
7305 line is used to identify other modules with which this one must be used;
7307 \begin_inset Flex CharStyle:Code
7310 \begin_layout Plain Layout
7316 line is used to identify modules with which this one may not be used.
7317 Both are optional, and, as shown, multiple modules should be separated
7318 with the pipe symbol: |.
7319 Note that the required modules are treated disjunctively:
7323 of the required modules must be used.
7328 excluded module may be used.
7329 Note that modules are identified here by their
7333 without the .module extension.
7335 \begin_inset Flex CharStyle:Code
7338 \begin_layout Plain Layout
7345 \begin_inset Flex CharStyle:Code
7348 \begin_layout Plain Layout
7357 \begin_layout Standard
7358 After creating a new module, you will need to reconfigure and then restart
7359 LyX for the module to appear in the menu.
7360 However, changes you make to the module will be seen immediately, if you
7362 \begin_inset Flex CharStyle:MenuItem
7365 \begin_layout Plain Layout
7366 Document\SpecialChar \menuseparator
7372 , highlight something, and then hit
7373 \begin_inset Quotes eld
7377 \begin_inset Quotes erd
7383 It is strongly recommended that you save your work before doing so
7388 it is strongly recommended that you not attempt to edit modules while simultaneo
7389 usly working on documents
7392 Though of course the developers strive to keep LyX stable in such situations,
7393 syntax errors and the like in your module file could cause strange behavior.
7396 \begin_layout Subsection
7397 Supporting new document classes
7400 \begin_layout Standard
7401 There are two situations you are likely to encounter when wanting to support
7402 a new LaTeX document class, involving LaTeX2e class (
7403 \begin_inset Flex CharStyle:Code
7406 \begin_layout Plain Layout
7413 \begin_inset Flex CharStyle:Code
7416 \begin_layout Plain Layout
7423 Supporting a style file is usually fairly easy.
7424 Supporting a new document class is a bit harder.
7427 \begin_layout Subsection
7429 \begin_inset Flex CharStyle:MenuItem
7432 \begin_layout Plain Layout
7441 \begin_layout Standard
7442 If your new document class is provided as a style file that is used in conjuncti
7443 on with an existing, supported document class---for the sake of the example,
7444 we'll assume that the style file is called
7445 \begin_inset Flex CharStyle:MenuItem
7448 \begin_layout Plain Layout
7454 and it is meant to be used with
7455 \begin_inset Flex CharStyle:MenuItem
7458 \begin_layout Plain Layout
7464 , which is a standard class---start by copying the existing class's layout
7465 file into your local directory:
7468 \begin_layout LyX-Code
7469 cp report.layout ~/.lyx/layouts/myclass.layout
7472 \begin_layout Standard
7474 \begin_inset Flex CharStyle:Code
7477 \begin_layout Plain Layout
7483 and change the line:
7486 \begin_layout LyX-Code
7489 DeclareLaTeXClass{report}
7492 \begin_layout Standard
7496 \begin_layout LyX-Code
7499 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
7502 \begin_layout Standard
7506 \begin_layout LyX-Code
7508 \begin_inset Newline newline
7514 \begin_inset Newline newline
7520 \begin_layout Standard
7521 near the top of the file.
7524 \begin_layout Standard
7525 Start LyX and select
7526 \begin_inset Flex CharStyle:MenuItem
7529 \begin_layout Plain Layout
7534 ools\SpecialChar \menuseparator
7545 Then restart LyX and try creating a new document.
7547 \begin_inset Flex CharStyle:MenuItem
7550 \begin_layout Plain Layout
7556 " as a document class option in the
7557 \begin_inset Flex CharStyle:MenuItem
7560 \begin_layout Plain Layout
7565 ocument\SpecialChar \menuseparator
7576 It is likely that some of the sectioning commands and such in your new
7577 class will work differently from how they worked in the base class---
7578 \begin_inset Flex CharStyle:Code
7581 \begin_layout Plain Layout
7587 in this example---so you can fiddle around with the settings for the different
7588 sections if you wish.
7591 \begin_layout Subsection
7593 \begin_inset Flex CharStyle:MenuItem
7596 \begin_layout Plain Layout
7605 \begin_layout Standard
7606 There are two possibilities here.
7607 One is that the class file is itself based upon an existing document class.
7608 For example, many thesis classes are based upon
7609 \begin_inset Flex CharStyle:MenuItem
7612 \begin_layout Plain Layout
7619 To see whether yours is, look for a line like
7622 \begin_layout LyX-Code
7628 \begin_layout Standard
7630 If so, then you may proceed largely as in the previous section, though
7631 the DeclareLaTeXClass line will be different.
7632 If your new class is thesis, and it is based upon book, then the line should
7637 \begin_layout Plain Layout
7638 And it will be easiest if you save the file to
7639 \begin_inset Flex CharStyle:Code
7642 \begin_layout Plain Layout
7648 : LyX assumes that the document class has the same name as the layout file.
7657 \begin_layout LyX-Code
7660 DeclareLaTeXClass[thesis,book]{thesis}
7663 \begin_layout Standard
7664 If, on the other hand, the new class is not based upon an existing class,
7665 you will probably have to
7666 \begin_inset Quotes eld
7670 \begin_inset Quotes erd
7674 We strongly suggest copying an existing layout file which uses a similar
7675 LaTeX class and then modifying it, if you can do so.
7676 At least use an existing file as a starting point so you can find out what
7677 items you need to worry about.
7678 Again, the specifics are covered below.
7681 \begin_layout Section
7682 Declaring a new text class
7685 \begin_layout Standard
7686 When it's finally time to get your hands dirty and create or edit your own
7687 layout file, the following sections describe what you're up against.
7688 Our advice is to go slowly, save and test often, listen to soothing music,
7689 and enjoy one or two of your favorite adult beverages; more if you are
7690 getting particularly stuck.
7691 It's really not that hard, except that the multitude of options can become
7692 overwhelming if you try to do to much in one sitting.
7693 Go have another adult beverage, just for good measure.
7696 \begin_layout Standard
7700 \begin_layout Standard
7701 Lines in a layout file which begin with a
7702 \begin_inset Flex CharStyle:Code
7705 \begin_layout Plain Layout
7712 There is one exception to this rule: all layouts should begin with lines
7716 \begin_layout LyX-Code
7719 #% Do not delete the line below; configure depends on this
7722 \begin_layout LyX-Code
7727 DeclareLaTeXClass{article}
7730 \begin_layout Standard
7731 The second line is used when you configure LyX.
7732 The layout file is read by the LaTeX script
7733 \begin_inset Flex CharStyle:Code
7736 \begin_layout Plain Layout
7742 , in a special mode where
7743 \begin_inset Flex CharStyle:Code
7746 \begin_layout Plain Layout
7753 The first line is just a LaTeX comment, and the second one contains the
7754 declaration of the text class.
7755 If these lines appear in a file named
7756 \begin_inset Flex CharStyle:Code
7759 \begin_layout Plain Layout
7765 , then they define a text class of name
7766 \begin_inset Flex CharStyle:Code
7769 \begin_layout Plain Layout
7775 (the name of the layout file) which uses the LaTeX document class
7776 \begin_inset Flex CharStyle:Code
7779 \begin_layout Plain Layout
7785 (the default is to use the same name as the layout).
7787 \begin_inset Quotes eld
7791 \begin_inset Quotes erd
7794 that appears above is used as a description of the text class in the
7795 \begin_inset Flex CharStyle:MenuItem
7798 \begin_layout Plain Layout
7803 ocument\SpecialChar \menuseparator
7816 \begin_layout Standard
7817 Let's assume that you wrote your own text class that uses the
7818 \begin_inset Flex CharStyle:Code
7821 \begin_layout Plain Layout
7827 document class, but where you changed the appearance of the section headings.
7828 If you put it in a file
7829 \begin_inset Flex CharStyle:Code
7832 \begin_layout Plain Layout
7838 , the header of this file should be:
7841 \begin_layout LyX-Code
7844 #% Do not delete the line below; configure depends on this
7847 \begin_layout LyX-Code
7852 DeclareLaTeXClass[article]{article (with my own headings)}
7855 \begin_layout Standard
7856 This declares a text class
7857 \begin_inset Flex CharStyle:Code
7860 \begin_layout Plain Layout
7866 , associated with the LaTeX document class
7867 \begin_inset Flex CharStyle:Code
7870 \begin_layout Plain Layout
7877 \begin_inset Quotes eld
7880 article (with my own headings)
7881 \begin_inset Quotes erd
7885 If your text class depends on several packages, you can declare it as:
7888 \begin_layout LyX-Code
7891 #% Do not delete the line below; configure depends on this
7894 \begin_layout LyX-Code
7899 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7902 \begin_layout Standard
7903 This indicates that your text class uses the foo.sty package.
7904 Finally, it is also possible to declare classes for DocBook code.
7905 Typical declarations will look like
7908 \begin_layout LyX-Code
7911 #% Do not delete the line below; configure depends on this
7914 \begin_layout LyX-Code
7919 DeclareDocBookClass[article]{SGML (DocBook article)}
7922 \begin_layout Standard
7923 Note that these declarations can also be given an optional parameter declaring
7924 the name of the document class (but not a list).
7927 \begin_layout Standard
7928 So, to be as explicit as possible, the form of the layout declaration is:
7931 \begin_layout LyX-Code
7936 DeclareLaTeXClass[class,package.sty]{layout description}
7939 \begin_layout Standard
7940 The class need only be specified if the name of the LaTeX class file and
7941 the name of the layout file are different; if the name of the classfile
7942 is not specified, then LyX will simply assume that it is the same as the
7943 name of the layout file.
7946 \begin_layout Standard
7947 When the text class has been modified to your taste, all you have to do
7948 is to copy it either to
7949 \begin_inset Flex CharStyle:Code
7952 \begin_layout Plain Layout
7959 \begin_inset Flex CharStyle:Code
7962 \begin_layout Plain Layout
7969 \begin_inset Flex CharStyle:MenuItem
7972 \begin_layout Plain Layout
7977 ools\SpecialChar \menuseparator
7987 , exit LyX and restart it.
7988 Then your new text class should be available along with the others.
7991 \begin_layout Standard
7992 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
7993 you made to your layout files.
7994 As a result, editing layout files could be very time consuming.
7995 Beginning with 1.6, however, you can force a reload of the layout currently
7996 in use by using the LyX function
7997 \begin_inset Flex CharStyle:MenuItem
8000 \begin_layout Plain Layout
8007 There is no default binding for this function---though, of course, you
8008 can bind it to a key yourself (see section
8009 \begin_inset CommandInset ref
8011 reference "sec:bindings"
8016 If you want to use this function, then, you should simply enter it in the
8022 : This is very much an `advanced feature'.
8027 recommended that you save your work before using this function.
8032 recommended that you not attempt to edit your layout while simultaneously
8033 working on a document that you care about.
8034 Use a test document.
8035 Syntax errors and the like in your layout file could cause peculiar behavior.
8036 In particular, such errors could cause LyX to regard the current layout
8037 as invalid and to attempt to switch to some other layout.
8038 The LyX team strives to keep LyX stable in such situations, but safe is
8042 \begin_layout Subsection
8046 \begin_layout Standard
8047 The first non-comment line must contain the file format number:
8050 \begin_layout Description
8051 \begin_inset Flex CharStyle:Code
8054 \begin_layout Plain Layout
8061 \begin_inset Flex CharStyle:Code
8064 \begin_layout Plain Layout
8070 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
8071 don't have an explicit file format).
8072 The file format that is documented here is format 7.
8075 \begin_layout Subsection
8076 General text class parameters
8079 \begin_layout Standard
8080 These are the general parameters which describe the form of the entire document:
8083 \begin_layout Description
8084 \begin_inset Flex CharStyle:Code
8087 \begin_layout Plain Layout
8093 Adds information to the document preamble.
8095 \begin_inset Quotes eld
8099 \begin_inset Flex CharStyle:Code
8102 \begin_layout Plain Layout
8109 \begin_inset Quotes erd
8115 \begin_layout Description
8116 \begin_inset Flex CharStyle:Code
8119 \begin_layout Plain Layout
8125 Describes various global options supported by the document class.
8127 \begin_inset space ~
8131 \begin_inset CommandInset ref
8133 reference "sec:classoptions"
8139 \begin_inset Quotes eld
8143 \begin_inset Flex CharStyle:Code
8146 \begin_layout Plain Layout
8153 \begin_inset Quotes erd
8159 \begin_layout Description
8160 \begin_inset Flex CharStyle:Code
8163 \begin_layout Plain Layout
8170 \begin_inset Flex CharStyle:Code
8173 \begin_layout Plain Layout
8182 \begin_inset Flex CharStyle:Code
8185 \begin_layout Plain Layout
8191 ] Whether the class should default to having one or two columns.
8192 Can be changed in the
8193 \begin_inset Flex CharStyle:MenuItem
8196 \begin_layout Plain Layout
8201 ocument\SpecialChar \menuseparator
8214 \begin_layout Description
8215 \begin_inset Flex CharStyle:Code
8218 \begin_layout Plain Layout
8224 This sequence defines a new counter.
8226 \begin_inset space ~
8230 \begin_inset CommandInset ref
8232 reference "sec:counter"
8238 \begin_inset Quotes eld
8242 \begin_inset Flex CharStyle:Code
8245 \begin_layout Plain Layout
8252 \begin_inset Quotes erd
8258 \begin_layout Description
8259 \begin_inset Flex CharStyle:Code
8262 \begin_layout Plain Layout
8268 Sets the default font used to display the document.
8270 \begin_inset space ~
8274 \begin_inset CommandInset ref
8276 reference "sec:fonts"
8280 for how to declare fonts.
8282 \begin_inset Quotes eld
8286 \begin_inset Flex CharStyle:Code
8289 \begin_layout Plain Layout
8296 \begin_inset Quotes erd
8302 \begin_layout Description
8303 \begin_inset Flex CharStyle:Code
8306 \begin_layout Plain Layout
8313 \begin_inset Flex CharStyle:Code
8316 \begin_layout Plain Layout
8322 ] This is the style that will be assigned to new paragraphs, usually
8323 \begin_inset Flex CharStyle:MenuItem
8326 \begin_layout Plain Layout
8333 This will default to the first defined style if not given, but you are
8334 highly encouraged to use this directive.
8337 \begin_layout Description
8338 \begin_inset Flex CharStyle:Code
8341 \begin_layout Plain Layout
8347 Defines a new float.
8349 \begin_inset space ~
8353 \begin_inset CommandInset ref
8355 reference "sec:floats"
8361 \begin_inset Quotes eld
8365 \begin_inset Flex CharStyle:Code
8368 \begin_layout Plain Layout
8375 \begin_inset Quotes erd
8381 \begin_layout Description
8382 \begin_inset Flex CharStyle:Code
8385 \begin_layout Plain Layout
8391 As its name implies, this command allows you to include another layout
8392 definition file within yours to avoid duplicating commands.
8393 Common examples are the standard layout files, for example,
8394 \begin_inset Flex CharStyle:Code
8397 \begin_layout Plain Layout
8403 , which contains most of the basic layouts.
8406 \begin_layout Description
8407 \begin_inset Flex CharStyle:Code
8410 \begin_layout Plain Layout
8416 This section (re-)defines the layout of an inset.
8417 It can be applied to an existing inset of to a new, user-defined inset,
8418 e.g., a new character style.
8420 \begin_inset space ~
8424 \begin_inset CommandInset ref
8426 reference "sec:charstyle"
8430 for more information.
8432 \begin_inset Quotes eld
8436 \begin_inset Flex CharStyle:Code
8439 \begin_layout Plain Layout
8446 \begin_inset Quotes erd
8452 \begin_layout Description
8453 \begin_inset Flex CharStyle:Code
8456 \begin_layout Plain Layout
8465 \begin_layout Description
8466 \begin_inset Flex CharStyle:Code
8469 \begin_layout Plain Layout
8475 This command deletes an existing float.
8476 This is particularly useful when you want to suppress a float that has
8477 be defined in an input file.
8480 \begin_layout Description
8481 \begin_inset Flex CharStyle:Code
8484 \begin_layout Plain Layout
8490 This command deletes an existing style.
8491 This is particularly useful when you want to suppress a style that has
8492 be defined in an input file.
8495 \begin_layout Description
8496 \begin_inset Flex CharStyle:Code
8499 \begin_layout Plain Layout
8508 \begin_layout Description
8509 \begin_inset Flex CharStyle:Code
8512 \begin_layout Plain Layout
8523 \begin_inset Flex CharStyle:Code
8526 \begin_layout Plain Layout
8537 \begin_inset Flex CharStyle:Code
8540 \begin_layout Plain Layout
8547 \begin_inset Flex CharStyle:Code
8550 \begin_layout Plain Layout
8556 ] The class default pagestyle.
8557 Can be changed in the
8558 \begin_inset Flex CharStyle:MenuItem
8561 \begin_layout Plain Layout
8566 ocument\SpecialChar \menuseparator
8579 \begin_layout Description
8580 \begin_inset Flex CharStyle:Code
8583 \begin_layout Plain Layout
8589 Sets the preamble for the LaTeX document.
8590 Note that this will completely override any prior
8591 \begin_inset Flex CharStyle:Code
8594 \begin_layout Plain Layout
8601 \begin_inset Flex CharStyle:Code
8604 \begin_layout Plain Layout
8612 \begin_inset Quotes eld
8616 \begin_inset Flex CharStyle:Code
8619 \begin_layout Plain Layout
8626 \begin_inset Quotes erd
8632 \begin_layout Description
8633 \begin_inset Flex CharStyle:Code
8636 \begin_layout Plain Layout
8643 \begin_inset CommandInset label
8650 \begin_inset Flex CharStyle:Code
8653 \begin_layout Plain Layout
8660 \begin_inset Flex CharStyle:Code
8663 \begin_layout Plain Layout
8672 \begin_inset Flex CharStyle:Code
8675 \begin_layout Plain Layout
8681 ] Whether the class already provides the feature
8682 \begin_inset Flex CharStyle:Code
8685 \begin_layout Plain Layout
8692 A feature is in general the name of a package (
8693 \begin_inset Flex CharStyle:Code
8696 \begin_layout Plain Layout
8703 \begin_inset Flex CharStyle:Code
8706 \begin_layout Plain Layout
8712 , \SpecialChar \ldots{}
8714 \begin_inset Flex CharStyle:Code
8717 \begin_layout Plain Layout
8724 \begin_inset Flex CharStyle:Code
8727 \begin_layout Plain Layout
8733 ,\SpecialChar \ldots{}
8734 ); the complete list of supported features is unfortunately not documented
8735 outside the LyX source code---but see
8736 \begin_inset Flex CharStyle:Code
8739 \begin_layout Plain Layout
8745 if you're interested.
8747 \begin_inset Flex CharStyle:MenuItem
8750 \begin_layout Plain Layout
8755 elp\SpecialChar \menuseparator
8765 also gives an overview of the supported packages.
8768 \begin_layout Description
8769 \begin_inset Flex CharStyle:Code
8772 \begin_layout Plain Layout
8779 \begin_inset Flex CharStyle:Code
8782 \begin_layout Plain Layout
8788 ] Whether the class requires the feature
8789 \begin_inset Flex CharStyle:Code
8792 \begin_layout Plain Layout
8799 Multiple features must be separated by commas.
8800 Note that you can only request supported features.
8803 \begin_layout Description
8804 \begin_inset Flex CharStyle:Code
8807 \begin_layout Plain Layout
8816 \begin_layout Description
8817 \begin_inset Flex CharStyle:Code
8820 \begin_layout Plain Layout
8829 \begin_layout Description
8830 \begin_inset Flex CharStyle:Code
8833 \begin_layout Plain Layout
8842 \begin_inset Flex CharStyle:Code
8845 \begin_layout Plain Layout
8856 \begin_inset Flex CharStyle:Code
8859 \begin_layout Plain Layout
8865 ] Whether the class-default should be printing on one or both sides of the
8867 Can be changed in the
8868 \begin_inset Flex CharStyle:MenuItem
8871 \begin_layout Plain Layout
8876 ocument\SpecialChar \menuseparator
8889 \begin_layout Description
8890 \begin_inset Flex CharStyle:Code
8893 \begin_layout Plain Layout
8899 This sequence defines a new paragraph style.
8900 If the style already exists, it will redefine some of its parameters instead.
8902 \begin_inset space ~
8906 \begin_inset CommandInset ref
8908 reference "sec:style"
8914 \begin_inset Quotes eld
8918 \begin_inset Flex CharStyle:Code
8921 \begin_layout Plain Layout
8928 \begin_inset Quotes erd
8934 \begin_layout Description
8935 \begin_inset Flex CharStyle:Code
8938 \begin_layout Plain Layout
8945 \begin_inset Flex CharStyle:Code
8948 \begin_layout Plain Layout
8954 ] The name of the command or environment to be used with
8955 \begin_inset Flex CharStyle:Code
8958 \begin_layout Plain Layout
8967 \begin_layout Description
8968 \begin_inset Flex CharStyle:Code
8971 \begin_layout Plain Layout
8978 \begin_inset Flex CharStyle:Code
8981 \begin_layout Plain Layout
8990 \begin_inset Flex CharStyle:Code
8993 \begin_layout Plain Layout
8999 ] Indicates what kind of markup is used to define the title of a document.
9001 \begin_inset Flex CharStyle:Code
9004 \begin_layout Plain Layout
9010 means that the macro with name
9011 \begin_inset Flex CharStyle:Code
9014 \begin_layout Plain Layout
9020 will be inserted after the last layout which has
9021 \begin_inset Quotes eld
9025 \begin_inset Flex CharStyle:Code
9028 \begin_layout Plain Layout
9035 \begin_inset Quotes erd
9040 \begin_inset Flex CharStyle:Code
9043 \begin_layout Plain Layout
9049 corresponds to the case where the block of paragraphs which have
9050 \begin_inset Quotes eld
9054 \begin_inset Flex CharStyle:Code
9057 \begin_layout Plain Layout
9064 \begin_inset Quotes erd
9067 should be enclosed into the
9068 \begin_inset Flex CharStyle:Code
9071 \begin_layout Plain Layout
9080 \begin_layout Description
9081 \begin_inset Flex CharStyle:Code
9084 \begin_layout Plain Layout
9093 \begin_layout Subsection
9094 \begin_inset Flex CharStyle:Code
9097 \begin_layout Plain Layout
9106 \begin_layout Standard
9107 \begin_inset CommandInset label
9109 name "sec:classoptions"
9114 \begin_inset Flex CharStyle:Code
9117 \begin_layout Plain Layout
9123 section can contain the following entries:
9126 \begin_layout Description
9127 \begin_inset Flex CharStyle:Code
9130 \begin_layout Plain Layout
9137 \begin_inset Flex CharStyle:Code
9140 \begin_layout Plain Layout
9146 ] The list of available font sizes for the document's main font, separated
9148 \begin_inset Quotes eld
9152 \begin_inset Flex CharStyle:Code
9155 \begin_layout Plain Layout
9162 \begin_inset Quotes erd
9168 \begin_layout Description
9169 \begin_inset Flex CharStyle:Code
9172 \begin_layout Plain Layout
9181 \begin_layout Description
9182 \begin_inset Flex CharStyle:Code
9185 \begin_layout Plain Layout
9192 \begin_inset Flex CharStyle:Code
9195 \begin_layout Plain Layout
9196 string="empty|plain|headings|fancy"
9201 ] The list of available page styles, separated by
9202 \begin_inset Quotes eld
9206 \begin_inset Flex CharStyle:Code
9209 \begin_layout Plain Layout
9216 \begin_inset Quotes erd
9222 \begin_layout Description
9223 \begin_inset Flex CharStyle:Code
9226 \begin_layout Plain Layout
9233 \begin_inset Flex CharStyle:Code
9236 \begin_layout Plain Layout
9242 ] Some document class options, separated by a comma, that will be added
9243 to the optional part of the
9244 \begin_inset Flex CharStyle:Code
9247 \begin_layout Plain Layout
9258 \begin_layout Standard
9260 \begin_inset Flex CharStyle:Code
9263 \begin_layout Plain Layout
9269 section must end with
9270 \begin_inset Quotes eld
9274 \begin_inset Flex CharStyle:Code
9277 \begin_layout Plain Layout
9284 \begin_inset Quotes erd
9290 \begin_layout Subsection
9294 \begin_layout Standard
9295 \begin_inset CommandInset label
9301 A paragraph style description looks like this:
9305 \begin_layout Plain Layout
9306 Note that this will either define a new layout or modify an existing one.
9314 \begin_layout LyX-Code
9321 \begin_layout LyX-Code
9325 \begin_layout LyX-Code
9329 \begin_layout Standard
9330 where the following commands are allowed:
9333 \begin_layout Description
9334 \begin_inset Flex CharStyle:Code
9337 \begin_layout Plain Layout
9344 \begin_inset Flex CharStyle:Code
9347 \begin_layout Plain Layout
9352 , left, right, center
9357 ] Paragraph alignment.
9360 \begin_layout Description
9361 \begin_inset Flex CharStyle:Code
9364 \begin_layout Plain Layout
9371 \begin_inset Flex CharStyle:Code
9374 \begin_layout Plain Layout
9379 , left, right, center
9384 ] A comma separated list of permitted alignments.
9385 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9387 For example a right-aligned or centered enumeration isn't possible.)
9390 \begin_layout Description
9391 \begin_inset Flex CharStyle:Code
9394 \begin_layout Plain Layout
9401 \begin_inset Flex CharStyle:Code
9404 \begin_layout Plain Layout
9414 \begin_layout Plain Layout
9415 Note that a `float' here is a real number, such as: 1.5.
9420 The vertical space with which the last of a chain of paragraphs with this
9421 layout is separated from the following paragraph.
9422 If the next paragraph has another layout, the separations are not simply
9423 added, but the maximum is taken.
9426 \begin_layout Description
9427 \begin_inset Flex CharStyle:Code
9430 \begin_layout Plain Layout
9437 \begin_inset Flex CharStyle:Code
9440 \begin_layout Plain Layout
9446 The category for this style.
9447 This is used to group related styles in the Layout combobox on the toolbar.
9448 Any string can be used, but you may want to use existing categories with
9453 \begin_layout Description
9454 \begin_inset Flex CharStyle:Code
9457 \begin_layout Plain Layout
9466 \begin_layout Description
9467 \begin_inset Flex CharStyle:Code
9470 \begin_layout Plain Layout
9477 \begin_inset Flex CharStyle:Code
9480 \begin_layout Plain Layout
9486 Copies all the features of an existing style into the current one.
9490 \begin_layout Description
9491 \begin_inset Flex CharStyle:Code
9494 \begin_layout Plain Layout
9500 The name of a style whose preamble should be output
9505 This allows to ensure some ordering of the preamble snippets when macros
9506 definitions depend on one another.
9510 \begin_layout Plain Layout
9511 Note that, besides that functionality, there is no way to ensure any ordering
9513 The ordering that you see in a given version of LyX may change without
9514 warning in later versions.
9522 \begin_layout Description
9523 \begin_inset Flex CharStyle:Code
9526 \begin_layout Plain Layout
9533 \begin_inset Flex CharStyle:Code
9536 \begin_layout Plain Layout
9541 , Box, Filled_Box, Static
9546 ] The type of label that stands at the end of the paragraph (or sequence
9548 \begin_inset Flex CharStyle:Code
9551 \begin_layout Plain Layout
9558 \begin_inset Flex CharStyle:Code
9561 \begin_layout Plain Layout
9568 \begin_inset Flex CharStyle:Code
9571 \begin_layout Plain Layout
9578 \begin_inset Flex CharStyle:Code
9581 \begin_layout Plain Layout
9589 \begin_inset Flex CharStyle:Code
9592 \begin_layout Plain Layout
9599 \begin_inset Quotes eld
9603 \begin_inset Quotes erd
9607 \begin_inset Flex CharStyle:Code
9610 \begin_layout Plain Layout
9617 \begin_inset Flex CharStyle:Code
9620 \begin_layout Plain Layout
9621 \begin_inset space ~
9630 \begin_inset space ~
9633 black) square suitable for end of proof markers,
9634 \begin_inset Flex CharStyle:Code
9637 \begin_layout Plain Layout
9643 is an explicit text string.
9646 \begin_layout Description
9647 \begin_inset Flex CharStyle:Code
9650 \begin_layout Plain Layout
9657 \begin_inset Flex CharStyle:Code
9660 \begin_layout Plain Layout
9666 ] The string used for a label with a
9667 \begin_inset Flex CharStyle:Code
9670 \begin_layout Plain Layout
9677 \begin_inset Flex CharStyle:Code
9680 \begin_layout Plain Layout
9690 \begin_layout Description
9691 \begin_inset Flex CharStyle:Code
9694 \begin_layout Plain Layout
9701 \begin_inset Flex CharStyle:Code
9704 \begin_layout Plain Layout
9715 \begin_inset Flex CharStyle:Code
9718 \begin_layout Plain Layout
9727 \begin_layout Description
9728 \begin_inset Flex CharStyle:Code
9731 \begin_layout Plain Layout
9738 \begin_inset Flex CharStyle:Code
9741 \begin_layout Plain Layout
9751 ] With this parameter the
9752 \begin_inset Flex CharStyle:MenuItem
9755 \begin_layout Plain Layout
9762 \begin_inset Quotes eld
9765 Vertical space above
9766 \begin_inset Quotes erd
9770 \begin_inset Flex CharStyle:MenuItem
9773 \begin_layout Plain Layout
9778 dit\SpecialChar \menuseparator
9784 \begin_inset space ~
9792 dialog can be set when initializing a paragraph with this style.
9796 \begin_layout Plain Layout
9799 Note from Jean-Marc:
9801 I'm not sure that this setting has much use, and it should probably be
9802 removed in later versions.
9810 \begin_layout Description
9811 \begin_inset Flex CharStyle:Code
9814 \begin_layout Plain Layout
9820 The font used for both the text body
9826 \begin_inset space ~
9830 \begin_inset CommandInset ref
9832 reference "sec:fonts"
9837 Note that defining this font automatically defines the
9838 \begin_inset Flex CharStyle:Code
9841 \begin_layout Plain Layout
9848 So you should define this one first if you also want to define
9849 \begin_inset Flex CharStyle:Code
9852 \begin_layout Plain Layout
9861 \begin_layout Description
9862 \begin_inset Flex CharStyle:Code
9865 \begin_layout Plain Layout
9872 \begin_inset CommandInset label
9874 name "des:FreeSpacing"
9881 \begin_inset Flex CharStyle:Code
9884 \begin_layout Plain Layout
9895 \begin_inset Flex CharStyle:Code
9898 \begin_layout Plain Layout
9904 ] Usually LyX doesn't allow you to insert more than one space between words,
9905 since a space is considered as the separation between two words, not a
9906 character or symbol of its own.
9907 This is a very fine thing but sometimes annoying, for example, when typing
9908 program code or plain LaTeX code.
9910 \begin_inset Flex CharStyle:Code
9913 \begin_layout Plain Layout
9920 Note that LyX will create protected blanks for the additional blanks when
9921 in another mode than LaTeX-mode.
9924 \begin_layout Description
9925 \begin_inset Flex CharStyle:Code
9928 \begin_layout Plain Layout
9937 \begin_layout Description
9938 \begin_inset Flex CharStyle:Code
9941 \begin_layout Plain Layout
9948 \begin_inset Flex CharStyle:Code
9951 \begin_layout Plain Layout
9957 If 1, marks the layout as being part of a title block (see also the
9958 \begin_inset Flex CharStyle:Code
9961 \begin_layout Plain Layout
9968 \begin_inset Flex CharStyle:Code
9971 \begin_layout Plain Layout
9980 \begin_layout Description
9981 \begin_inset Flex CharStyle:Code
9984 \begin_layout Plain Layout
9991 \begin_inset Flex CharStyle:Code
9994 \begin_layout Plain Layout
10000 ] This provides extra space between paragraphs that have the same layout.
10001 If you put other layouts into an environment, each is separated with the
10003 \begin_inset Flex CharStyle:Code
10006 \begin_layout Plain Layout
10013 But the whole items of the environment are additionally separated with
10015 \begin_inset Flex CharStyle:Code
10018 \begin_layout Plain Layout
10025 Note that this is a
10030 \begin_layout Description
10031 \begin_inset Flex CharStyle:Code
10034 \begin_layout Plain Layout
10043 \begin_layout Description
10044 \begin_inset Flex CharStyle:Code
10047 \begin_layout Plain Layout
10054 \begin_inset CommandInset label
10056 name "des:KeepEmpty"
10063 \begin_inset Flex CharStyle:Code
10066 \begin_layout Plain Layout
10077 \begin_inset Flex CharStyle:Code
10080 \begin_layout Plain Layout
10086 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10087 lead to empty LaTeX output.
10088 There are some cases where this could be desirable however: in a letter
10089 template, the required fields can be provided as empty fields, so that
10090 people do not forget them; in some special classes, a layout can be used
10091 as some kind of break, which does not contain actual text.
10094 \begin_layout Description
10095 \begin_inset Flex CharStyle:Code
10098 \begin_layout Plain Layout
10104 [float=0] The vertical space between the label and the text body.
10105 Only used for labels that are above the text body (
10106 \begin_inset Flex CharStyle:Code
10109 \begin_layout Plain Layout
10116 \begin_inset Flex CharStyle:Code
10119 \begin_layout Plain Layout
10120 Centered_Top_Environment
10128 \begin_layout Description
10129 \begin_inset Flex CharStyle:Code
10132 \begin_layout Plain Layout
10139 \begin_inset Flex CharStyle:Code
10142 \begin_layout Plain Layout
10149 \begin_inset Newline newline
10152 The name of the counter for automatic numbering (see Section
10153 \begin_inset CommandInset ref
10155 reference "sec:counter"
10160 This must be given if
10161 \begin_inset Flex CharStyle:Code
10164 \begin_layout Plain Layout
10171 \begin_inset Flex CharStyle:Code
10174 \begin_layout Plain Layout
10183 \begin_layout Description
10184 \begin_inset Flex CharStyle:Code
10187 \begin_layout Plain Layout
10193 The font used for the label.
10195 \begin_inset space ~
10199 \begin_inset CommandInset ref
10201 reference "sec:fonts"
10208 \begin_layout Description
10209 \begin_inset Flex CharStyle:Code
10212 \begin_layout Plain Layout
10219 \begin_inset Flex CharStyle:Code
10222 \begin_layout Plain Layout
10228 ] The horizontal space between the label and the text body.
10229 Only used for labels that are not above the text body.
10232 \begin_layout Description
10233 \begin_inset Flex CharStyle:Code
10236 \begin_layout Plain Layout
10243 \begin_inset Flex CharStyle:Code
10246 \begin_layout Plain Layout
10252 ] The string used for a label with a
10253 \begin_inset Flex CharStyle:Code
10256 \begin_layout Plain Layout
10264 \begin_inset Flex CharStyle:Code
10267 \begin_layout Plain Layout
10273 is set, this string can be contain the special formatting commands described
10275 \begin_inset CommandInset ref
10277 reference "sec:counter"
10285 \begin_layout Plain Layout
10286 For the sake of backwards compatibility, the string
10287 \begin_inset Flex CharStyle:Code
10290 \begin_layout Plain Layout
10300 will be replaced by the expanded
10301 \begin_inset Flex CharStyle:Code
10304 \begin_layout Plain Layout
10311 \begin_inset Flex CharStyle:Code
10314 \begin_layout Plain Layout
10323 This feature is now obsolete and should be replaced by the mechanisms of
10325 \begin_inset CommandInset ref
10327 reference "sec:counter"
10339 \begin_layout Description
10340 \begin_inset Flex CharStyle:Code
10343 \begin_layout Plain Layout
10344 LabelStringAppendix
10350 \begin_inset Flex CharStyle:Code
10353 \begin_layout Plain Layout
10359 ] This is used inside the appendix instead of
10360 \begin_inset Flex CharStyle:Code
10363 \begin_layout Plain Layout
10371 \begin_inset Flex CharStyle:Code
10374 \begin_layout Plain Layout
10381 \begin_inset Flex CharStyle:Code
10384 \begin_layout Plain Layout
10385 LabelStringAppendix
10393 \begin_layout Description
10394 \begin_inset Flex CharStyle:Code
10397 \begin_layout Plain Layout
10404 \begin_inset Flex CharStyle:Code
10407 \begin_layout Plain Layout
10412 , Manual, Static, Top_Environment,
10413 \begin_inset Newline newline
10416 Centered_Top_Environment, Sensitive, Counter
10422 \begin_inset Newline newline
10426 \begin_inset Flex CharStyle:Code
10429 \begin_layout Plain Layout
10435 means the label is the very first word (up to the first real blank).
10439 \begin_layout Plain Layout
10440 Use protected spaces if you want more than one word as the label.
10446 \begin_inset Flex CharStyle:Code
10449 \begin_layout Plain Layout
10455 means it is defined in the layout (see
10456 \begin_inset Flex CharStyle:Code
10459 \begin_layout Plain Layout
10467 \begin_inset Flex CharStyle:Code
10470 \begin_layout Plain Layout
10477 \begin_inset Flex CharStyle:Code
10480 \begin_layout Plain Layout
10481 Centered_Top_Environment
10486 are special cases of
10487 \begin_inset Flex CharStyle:Code
10490 \begin_layout Plain Layout
10497 The label will be printed above the paragraph, but only at the top of an
10498 environment or the top of a chain of paragraphs with this layout.
10499 Usage is for example the
10500 \begin_inset Flex CharStyle:MenuItem
10503 \begin_layout Plain Layout
10510 \begin_inset Flex CharStyle:MenuItem
10513 \begin_layout Plain Layout
10520 This is also the case for
10521 \begin_inset Flex CharStyle:Code
10524 \begin_layout Plain Layout
10530 labels with latex type
10531 \begin_inset Flex CharStyle:Code
10534 \begin_layout Plain Layout
10540 , in order to make layouts for theorems work correctly.
10542 \begin_inset Flex CharStyle:Code
10545 \begin_layout Plain Layout
10551 is a special case for the caption-labels
10552 \begin_inset Quotes eld
10556 \begin_inset Quotes erd
10560 \begin_inset Quotes eld
10564 \begin_inset Quotes erd
10569 \begin_inset Flex CharStyle:Code
10572 \begin_layout Plain Layout
10578 means the (hardcoded) label string depends on the kind of float.
10580 \begin_inset Flex CharStyle:Code
10583 \begin_layout Plain Layout
10589 label type defines automatically numbered labels.
10591 \begin_inset CommandInset ref
10593 reference "sec:counter"
10600 \begin_layout Description
10601 \begin_inset Flex CharStyle:Code
10604 \begin_layout Plain Layout
10613 \begin_layout Description
10614 \begin_inset Flex CharStyle:Code
10617 \begin_layout Plain Layout
10626 \begin_layout Description
10627 \begin_inset Flex CharStyle:Code
10630 \begin_layout Plain Layout
10637 \begin_inset CommandInset label
10639 name "des:LatexName"
10643 The name of the corresponding LaTeX stuff.
10644 Either the environment or command name.
10647 \begin_layout Description
10648 \begin_inset Flex CharStyle:Code
10651 \begin_layout Plain Layout
10660 \begin_layout Description
10661 \begin_inset Flex CharStyle:Code
10664 \begin_layout Plain Layout
10671 \begin_inset CommandInset label
10673 name "des:LatexParam"
10677 An optional parameter for the corresponding
10678 \begin_inset Flex CharStyle:Code
10681 \begin_layout Plain Layout
10688 This parameter cannot be changed from within LyX.
10691 \begin_layout Description
10692 \begin_inset Flex CharStyle:Code
10695 \begin_layout Plain Layout
10702 \begin_inset CommandInset label
10704 name "des:LatexType"
10709 \begin_inset Flex CharStyle:Code
10712 \begin_layout Plain Layout
10717 , Command, Environment, Item_Environment,
10723 \begin_inset Flex CharStyle:Code
10726 \begin_layout Plain Layout
10732 ] How the layout should be translated into LaTeX.
10734 \begin_inset Flex CharStyle:Code
10737 \begin_layout Plain Layout
10743 means nothing special.
10745 \begin_inset Flex CharStyle:Code
10748 \begin_layout Plain Layout
10755 \begin_inset Flex CharStyle:Code
10758 \begin_layout Plain Layout
10765 {\SpecialChar \ldots{}
10772 \begin_inset Flex CharStyle:Code
10775 \begin_layout Plain Layout
10782 \begin_inset Flex CharStyle:Code
10785 \begin_layout Plain Layout
10792 }\SpecialChar \ldots{}
10806 \begin_inset Flex CharStyle:Code
10809 \begin_layout Plain Layout
10816 \begin_inset Flex CharStyle:Code
10819 \begin_layout Plain Layout
10826 \begin_inset Flex CharStyle:Code
10829 \begin_layout Plain Layout
10837 is generated for each paragraph of this environment.
10839 \begin_inset Flex CharStyle:Code
10842 \begin_layout Plain Layout
10849 \begin_inset Flex CharStyle:Code
10852 \begin_layout Plain Layout
10859 \begin_inset Flex CharStyle:Code
10862 \begin_layout Plain Layout
10868 is passed as an argument to the environment.
10870 \begin_inset Flex CharStyle:Code
10873 \begin_layout Plain Layout
10879 can be defined in the
10880 \begin_inset Flex CharStyle:MenuItem
10883 \begin_layout Plain Layout
10888 ayout\SpecialChar \menuseparator
10900 \begin_inset Flex CharStyle:Code
10903 \begin_layout Plain Layout
10911 is perhaps a bit misleading, since these rules apply to SGML classes, too.
10912 Visit the SGML class files for specific examples.
10915 \begin_layout Standard
10916 Putting the last few things together, the LaTeX output will be either:
10919 \begin_layout LyX-Code
10922 latexname[latexparam]{\SpecialChar \ldots{}
10926 \begin_layout Standard
10930 \begin_layout LyX-Code
10933 begin{latexname}[latexparam] \SpecialChar \ldots{}
10939 \begin_layout Standard
10940 depending upon the LaTex type.
10943 \begin_layout Description
10944 \begin_inset Flex CharStyle:Code
10947 \begin_layout Plain Layout
10954 \begin_inset Flex CharStyle:Code
10957 \begin_layout Plain Layout
10963 ] If you put layouts into environments, the leftmargins are not simply added,
10964 but added with a factor
10965 \begin_inset Formula $\frac{4}{depth+4}$
10969 Note that this parameter is also used when the margin is defined as
10970 \begin_inset Flex CharStyle:Code
10973 \begin_layout Plain Layout
10980 \begin_inset Flex CharStyle:Code
10983 \begin_layout Plain Layout
10990 Then it is added to the manual or dynamic margin.
10992 \begin_inset Newline newline
10995 The argument is passed as a string.
10997 \begin_inset Quotes eld
11001 \begin_inset Flex CharStyle:Code
11004 \begin_layout Plain Layout
11011 \begin_inset Quotes erd
11014 means that the paragraph is indented with the width of
11015 \begin_inset Quotes eld
11019 \begin_inset Flex CharStyle:Code
11022 \begin_layout Plain Layout
11029 \begin_inset Quotes erd
11032 in the normal font.
11033 You can get a negative width by prefixing the string with
11034 \begin_inset Quotes eld
11038 \begin_inset Flex CharStyle:Code
11041 \begin_layout Plain Layout
11048 \begin_inset Quotes erd
11052 This way was chosen so that the look is the same with each used screen
11057 \begin_layout Description
11058 \begin_inset Flex CharStyle:Code
11061 \begin_layout Plain Layout
11068 \begin_inset Flex CharStyle:Code
11071 \begin_layout Plain Layout
11076 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11082 \begin_inset Newline newline
11085 The kind of margin that the layout has on the left side.
11087 \begin_inset Flex CharStyle:Code
11090 \begin_layout Plain Layout
11096 just means a fixed margin.
11098 \begin_inset Flex CharStyle:Code
11101 \begin_layout Plain Layout
11107 means that the left margin depends on the string entered in the
11108 \begin_inset Flex CharStyle:MenuItem
11111 \begin_layout Plain Layout
11116 dit\SpecialChar \menuseparator
11122 \begin_inset space ~
11131 This is used to typeset nice lists without tabulators.
11133 \begin_inset Flex CharStyle:Code
11136 \begin_layout Plain Layout
11142 means that the margin depends on the size of the label.
11143 This is used for automatic enumerated headlines.
11144 It is obvious that the headline
11145 \begin_inset Quotes eld
11148 5.4.3.2.1 Very long headline
11149 \begin_inset Quotes erd
11152 must have a wider left margin (as wide as
11153 \begin_inset Quotes eld
11157 \begin_inset Quotes erd
11160 plus the space) than
11161 \begin_inset Quotes eld
11164 3.2 Very long headline
11165 \begin_inset Quotes erd
11169 \begin_inset Quotes eld
11173 \begin_inset Quotes erd
11176 are not able to do this.
11178 \begin_inset Flex CharStyle:Code
11181 \begin_layout Plain Layout
11187 is similar, but only the very first row of the paragraph is dynamic, while
11188 the others are static; this is used, for example, for descriptions.
11190 \begin_inset Flex CharStyle:Code
11193 \begin_layout Plain Layout
11199 means the margin is chosen in a way that the longest row of this paragraph
11200 fits to the right margin.
11201 This is used to typeset an address on the right edge of the page.
11204 \begin_layout Description
11205 \begin_inset Flex CharStyle:Code
11208 \begin_layout Plain Layout
11215 \begin_inset CommandInset label
11217 name "des:NeedProtect"
11222 \begin_inset Flex CharStyle:Code
11225 \begin_layout Plain Layout
11234 \begin_inset Flex CharStyle:Code
11237 \begin_layout Plain Layout
11243 ] Whether fragile commands in this layout should be
11244 \begin_inset Flex CharStyle:Code
11247 \begin_layout Plain Layout
11258 \begin_layout Description
11259 \begin_inset Flex CharStyle:Code
11262 \begin_layout Plain Layout
11269 \begin_inset Flex CharStyle:Code
11272 \begin_layout Plain Layout
11279 \begin_inset Flex CharStyle:Code
11282 \begin_layout Plain Layout
11290 ] Whether newlines are translated into LaTeX newlines (
11291 \begin_inset Flex CharStyle:Code
11294 \begin_layout Plain Layout
11305 The translation can be switched off to allow more comfortable LaTeX editing
11309 \begin_layout Description
11310 \begin_inset Flex CharStyle:Code
11313 \begin_layout Plain Layout
11320 \begin_inset Flex CharStyle:Code
11323 \begin_layout Plain Layout
11330 \begin_inset Flex CharStyle:Code
11333 \begin_layout Plain Layout
11341 ] Whether the following Paragraph is allowed to indent its very first row.
11343 \begin_inset Flex CharStyle:Code
11346 \begin_layout Plain Layout
11352 means that it is not allowed to do so;
11353 \begin_inset Flex CharStyle:Code
11356 \begin_layout Plain Layout
11362 means it could do so if it wants to.
11365 \begin_layout Description
11366 \begin_inset Flex CharStyle:Code
11369 \begin_layout Plain Layout
11378 \begin_layout Description
11379 \begin_inset Flex CharStyle:Code
11382 \begin_layout Plain Layout
11389 \begin_inset Flex CharStyle:Code
11392 \begin_layout Plain Layout
11398 ] The number of optional arguments that can be used with this layout.
11399 This is useful for things like section headings, and only makes sense with
11403 \begin_layout Description
11404 \begin_inset Flex CharStyle:Code
11407 \begin_layout Plain Layout
11414 \begin_inset Flex CharStyle:Code
11417 \begin_layout Plain Layout
11423 ] The indent of the very first line of a paragraph.
11425 \begin_inset Flex CharStyle:Code
11428 \begin_layout Plain Layout
11434 will be fixed for a certain layout.
11435 The exception is Standard layout, since the indentation of a Standard layout
11436 paragraph can be prohibited with
11437 \begin_inset Flex CharStyle:Code
11440 \begin_layout Plain Layout
11447 Also, Standard layout paragraphs inside environments use the
11448 \begin_inset Flex CharStyle:Code
11451 \begin_layout Plain Layout
11457 of the environment, not their native one.
11458 For example, Standard paragraphs inside an enumeration are not indented.
11461 \begin_layout Description
11462 \begin_inset Flex CharStyle:Code
11465 \begin_layout Plain Layout
11472 \begin_inset Flex CharStyle:Code
11475 \begin_layout Plain Layout
11481 ] The vertical space between two paragraphs of this layout.
11484 \begin_layout Description
11485 \begin_inset Flex CharStyle:Code
11488 \begin_layout Plain Layout
11495 \begin_inset Flex CharStyle:Code
11498 \begin_layout Plain Layout
11504 ] LyX allows the user to choose either
11505 \begin_inset Quotes eld
11509 \begin_inset Quotes erd
11513 \begin_inset Quotes eld
11517 \begin_inset Quotes erd
11520 to typeset a document.
11522 \begin_inset Quotes eld
11526 \begin_inset Quotes erd
11529 is chosen, this value is completely ignored.
11531 \begin_inset Quotes eld
11535 \begin_inset Quotes erd
11538 is chosen, the parindent of a LaTeXtype
11539 \begin_inset Quotes eld
11543 \begin_inset Quotes erd
11546 layout is ignored and all paragraphs are separated by this parskip argument.
11547 The vertical space is calculated with
11548 \begin_inset Flex CharStyle:Code
11551 \begin_layout Plain Layout
11553 \begin_inset space ~
11562 \begin_inset Flex CharStyle:Code
11565 \begin_layout Plain Layout
11571 is the height of a row with the normal font.
11572 This way, the look stays the same with different screen fonts.
11575 \begin_layout Description
11576 \begin_inset Flex CharStyle:Code
11579 \begin_layout Plain Layout
11586 \begin_inset CommandInset label
11588 name "des:PassThru"
11595 \begin_inset Flex CharStyle:Code
11598 \begin_layout Plain Layout
11609 \begin_inset Flex CharStyle:Code
11612 \begin_layout Plain Layout
11618 ] Whether the contents of this paragraph should be output in raw form, meaning
11619 without special translations that LaTeX would require.
11622 \begin_layout Description
11623 \begin_inset Flex CharStyle:Code
11626 \begin_layout Plain Layout
11633 \begin_inset CommandInset label
11635 name "des:Preamble"
11639 Information to be included in the LaTeX preamable when this style is used.
11640 Used to define macros, load packages, etc., required by this particular
11643 \begin_inset Quotes eld
11647 \begin_inset Flex CharStyle:Code
11650 \begin_layout Plain Layout
11657 \begin_inset Quotes erd
11663 \begin_layout Description
11664 \begin_inset Flex CharStyle:Code
11667 \begin_layout Plain Layout
11674 \begin_inset Flex CharStyle:Code
11677 \begin_layout Plain Layout
11684 \begin_inset CommandInset label
11686 name "des:Requires"
11690 Whether the layout requires the feature
11691 \begin_inset Flex CharStyle:Code
11694 \begin_layout Plain Layout
11701 See the description of
11702 \begin_inset Flex CharStyle:Code
11705 \begin_layout Plain Layout
11712 \begin_inset CommandInset ref
11713 LatexCommand pageref
11714 reference "des:FreeSpacing"
11718 ) for information on `features'.
11722 \begin_layout Description
11723 \begin_inset Flex CharStyle:Code
11726 \begin_layout Plain Layout
11733 \begin_inset Flex CharStyle:Code
11736 \begin_layout Plain Layout
11743 \begin_inset Flex CharStyle:Code
11746 \begin_layout Plain Layout
11755 \begin_layout Description
11756 \begin_inset Flex CharStyle:Code
11759 \begin_layout Plain Layout
11766 \begin_inset Flex CharStyle:Code
11769 \begin_layout Plain Layout
11774 , onehalf, double, other
11783 ] This defines what the default spacing should be in the layout.
11785 \begin_inset Flex CharStyle:Code
11788 \begin_layout Plain Layout
11795 \begin_inset Flex CharStyle:Code
11798 \begin_layout Plain Layout
11805 \begin_inset Flex CharStyle:Code
11808 \begin_layout Plain Layout
11814 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
11815 If you specify the argument
11816 \begin_inset Flex CharStyle:Code
11819 \begin_layout Plain Layout
11825 , then you should also provide a numerical argument which will be the actual
11827 Note that, contrary to other parameters,
11828 \begin_inset Flex CharStyle:Code
11831 \begin_layout Plain Layout
11837 implies the generation of specific LaTeX code, using the package
11840 \begin_inset Flex CharStyle:Code
11843 \begin_layout Plain Layout
11852 \begin_layout Description
11853 \begin_inset Flex CharStyle:Code
11856 \begin_layout Plain Layout
11862 The font used for the text body .
11864 \begin_inset CommandInset ref
11866 reference "sec:fonts"
11873 \begin_layout Description
11874 \begin_inset Flex CharStyle:Code
11877 \begin_layout Plain Layout
11885 The level of the style in the table of contents.
11886 This is used for automatic numbering of section headings.
11889 \begin_layout Description
11890 \begin_inset Flex CharStyle:Code
11893 \begin_layout Plain Layout
11900 \begin_inset Flex CharStyle:Code
11903 \begin_layout Plain Layout
11909 ] The vertical space with which the very first of a chain of paragraphs
11910 with this layout is separated from the previous paragraph.
11911 If the previous paragraph has another layout, the separations are not simply
11912 added, but the maximum is taken.
11915 \begin_layout Subsection
11919 \begin_layout Standard
11920 \begin_inset CommandInset label
11926 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11927 define the floats (
11928 \begin_inset Flex CharStyle:MenuItem
11931 \begin_layout Plain Layout
11938 \begin_inset Flex CharStyle:MenuItem
11941 \begin_layout Plain Layout
11947 , \SpecialChar \ldots{}
11948 ) in the text class itself.
11949 Standard floats are included in the file
11950 \begin_inset Flex CharStyle:Code
11953 \begin_layout Plain Layout
11959 , so you may have to do no more than add
11962 \begin_layout LyX-Code
11963 Input stdfloats.inc
11966 \begin_layout Standard
11967 to your layout file.
11968 If you want to implement a text class that proposes some other float types
11969 (like the AGU class bundled with LyX), the information below will hopefully
11973 \begin_layout Description
11974 \begin_inset Flex CharStyle:Code
11977 \begin_layout Plain Layout
11984 \begin_inset Flex CharStyle:Code
11987 \begin_layout Plain Layout
11994 \begin_inset Quotes erd
11998 \begin_inset Quotes erd
12001 ] The file name extension of an auxiliary file for the list of figures (or
12003 LaTeX writes the captions to this file.
12006 \begin_layout Description
12007 \begin_inset Flex CharStyle:Code
12010 \begin_layout Plain Layout
12017 \begin_inset Flex CharStyle:Code
12020 \begin_layout Plain Layout
12027 \begin_inset Quotes erd
12031 \begin_inset Quotes erd
12034 ] The string that will be used in the menus and also for the caption.
12037 \begin_layout Description
12038 \begin_inset Flex CharStyle:Code
12041 \begin_layout Plain Layout
12048 \begin_inset Flex CharStyle:Code
12051 \begin_layout Plain Layout
12060 \begin_inset Flex CharStyle:Code
12063 \begin_layout Plain Layout
12070 \begin_inset Flex CharStyle:Code
12073 \begin_layout Plain Layout
12079 if the float is already defined by the LaTeX document class.
12081 \begin_inset Flex CharStyle:Code
12084 \begin_layout Plain Layout
12090 , the float will be defined using the LaTeX package
12091 \begin_inset Flex CharStyle:Code
12094 \begin_layout Plain Layout
12103 \begin_layout Description
12104 \begin_inset Flex CharStyle:Code
12107 \begin_layout Plain Layout
12114 \begin_inset Flex CharStyle:Code
12117 \begin_layout Plain Layout
12124 \begin_inset Quotes erd
12128 \begin_inset Quotes erd
12131 ] The heading used for the list of floats.
12134 \begin_layout Description
12135 \begin_inset Flex CharStyle:Code
12138 \begin_layout Plain Layout
12145 \begin_inset Flex CharStyle:Code
12148 \begin_layout Plain Layout
12155 \begin_inset Quotes erd
12159 \begin_inset Quotes erd
12162 ] This (optional) argument determines whether floats of this class will
12163 be numbered within some sectional unit of the document.
12164 For example, if within is equal to
12165 \begin_inset Flex CharStyle:Code
12168 \begin_layout Plain Layout
12174 , the floats will be numbered within chapters.
12178 \begin_layout Description
12179 \begin_inset Flex CharStyle:Code
12182 \begin_layout Plain Layout
12189 \begin_inset Flex CharStyle:Code
12192 \begin_layout Plain Layout
12199 \begin_inset Quotes erd
12203 \begin_inset Quotes erd
12206 ] The default placement for the given class of floats.
12207 The string should be as in standard LaTeX:
12208 \begin_inset Flex CharStyle:Code
12211 \begin_layout Plain Layout
12218 \begin_inset Flex CharStyle:Code
12221 \begin_layout Plain Layout
12228 \begin_inset Flex CharStyle:Code
12231 \begin_layout Plain Layout
12238 \begin_inset Flex CharStyle:Code
12241 \begin_layout Plain Layout
12247 for top, bottom, page, and here, respectively.
12251 \begin_layout Plain Layout
12252 Note that the order of these letters in the string is irrelevant, like in
12258 On top of that there is a new type,
12259 \begin_inset Flex CharStyle:Code
12262 \begin_layout Plain Layout
12268 , which does not really correspond to a float, since it means: put it
12269 \begin_inset Quotes eld
12273 \begin_inset Quotes erd
12277 Note however that the
12278 \begin_inset Flex CharStyle:Code
12281 \begin_layout Plain Layout
12287 specifier is special and, because of implementation details, cannot be
12288 used in non-builtin float types.
12289 If you do not understand what this means, just use
12290 \begin_inset Quotes eld
12294 \begin_inset Flex CharStyle:Code
12297 \begin_layout Plain Layout
12304 \begin_inset Quotes erd
12310 \begin_layout Description
12311 \begin_inset Flex CharStyle:Code
12314 \begin_layout Plain Layout
12321 \begin_inset Flex CharStyle:Code
12324 \begin_layout Plain Layout
12331 \begin_inset Quotes erd
12335 \begin_inset Quotes erd
12338 ] The style used when defining the float using
12339 \begin_inset Flex CharStyle:Code
12342 \begin_layout Plain Layout
12353 \begin_layout Description
12354 \begin_inset Flex CharStyle:Code
12357 \begin_layout Plain Layout
12364 \begin_inset Flex CharStyle:Code
12367 \begin_layout Plain Layout
12374 \begin_inset Quotes erd
12378 \begin_inset Quotes erd
12382 \begin_inset Quotes eld
12386 \begin_inset Quotes erd
12389 of the new class of floats, like program or algorithm.
12390 After the appropriate
12391 \begin_inset Flex CharStyle:Code
12394 \begin_layout Plain Layout
12403 \begin_inset Flex CharStyle:Code
12406 \begin_layout Plain Layout
12415 \begin_inset Flex CharStyle:Code
12418 \begin_layout Plain Layout
12429 \begin_layout Standard
12430 Note that defining a float with type
12431 \begin_inset Flex CharStyle:Code
12434 \begin_layout Plain Layout
12442 automatically defines the corresponding counter with name
12443 \begin_inset Flex CharStyle:Code
12446 \begin_layout Plain Layout
12457 \begin_layout Subsection
12458 Inset layouts and Flex insets
12461 \begin_layout Standard
12462 \begin_inset CommandInset label
12464 name "sec:charstyle"
12468 LyX has supported character styles since version 1.4.0; since version 1.6.0
12469 these are called Flex insets.
12473 \begin_layout Standard
12474 Furthermore, it is possible to define the general layout of many different
12476 Currently, InsetLayout can be used to customize the layout parameters
12477 for footnotes, marginal notes, note insets, ERT insets, branches, listings,
12478 indexes, boxes, tables, algorithms, URLs, and optional arguments, as well
12483 \begin_layout Standard
12484 Flex insets come in three different kinds:
12487 \begin_layout Itemize
12489 \begin_inset Flex CharStyle:Code
12492 \begin_layout Plain Layout
12498 ): These define semantic markup corresponding to such LaTeX commands as
12500 \begin_inset Flex CharStyle:Code
12503 \begin_layout Plain Layout
12512 \begin_inset Flex CharStyle:Code
12515 \begin_layout Plain Layout
12526 \begin_layout Itemize
12528 \begin_inset Flex CharStyle:Code
12531 \begin_layout Plain Layout
12537 ): These can be used to define custom collapsable insets, similar to ERT,
12538 footnote, and the like.
12541 \begin_layout Itemize
12543 \begin_inset Flex CharStyle:Code
12546 \begin_layout Plain Layout
12552 ): For use with DocBook classes.
12555 \begin_layout Standard
12557 \begin_inset Flex CharStyle:Code
12560 \begin_layout Plain Layout
12566 definition starting line is of the form
12569 \begin_layout LyX-Code
12570 InsetLayout <Type> <Name>
12573 \begin_layout Standard
12575 \begin_inset Flex CharStyle:Code
12578 \begin_layout Plain Layout
12585 \begin_inset Flex CharStyle:Code
12588 \begin_layout Plain Layout
12595 \begin_inset Flex CharStyle:Code
12598 \begin_layout Plain Layout
12605 \begin_inset Flex CharStyle:Code
12608 \begin_layout Plain Layout
12615 \begin_inset Flex CharStyle:Code
12618 \begin_layout Plain Layout
12625 \begin_inset Flex CharStyle:Code
12628 \begin_layout Plain Layout
12635 \begin_inset Flex CharStyle:Code
12638 \begin_layout Plain Layout
12645 \begin_inset Flex CharStyle:Code
12648 \begin_layout Plain Layout
12655 \begin_inset Flex CharStyle:Code
12658 \begin_layout Plain Layout
12665 \begin_inset Flex CharStyle:Code
12668 \begin_layout Plain Layout
12675 \begin_inset Flex CharStyle:Code
12678 \begin_layout Plain Layout
12685 \begin_inset Flex CharStyle:Code
12688 \begin_layout Plain Layout
12695 \begin_inset Flex CharStyle:Code
12698 \begin_layout Plain Layout
12705 \begin_inset Flex CharStyle:Code
12708 \begin_layout Plain Layout
12715 \begin_inset Flex CharStyle:Code
12718 \begin_layout Plain Layout
12725 \begin_inset Flex CharStyle:Code
12728 \begin_layout Plain Layout
12735 \begin_inset Flex CharStyle:Code
12738 \begin_layout Plain Layout
12746 \begin_inset Flex CharStyle:Code
12749 \begin_layout Plain Layout
12756 \begin_inset Flex CharStyle:Code
12759 \begin_layout Plain Layout
12766 \begin_inset Flex CharStyle:Code
12769 \begin_layout Plain Layout
12775 should have the form
12776 \begin_inset Flex CharStyle:Code
12779 \begin_layout Plain Layout
12786 \begin_inset Flex CharStyle:Code
12789 \begin_layout Plain Layout
12796 \begin_inset Flex CharStyle:Code
12799 \begin_layout Plain Layout
12806 \begin_inset Flex CharStyle:Code
12809 \begin_layout Plain Layout
12816 \begin_inset Flex CharStyle:Code
12819 \begin_layout Plain Layout
12826 \begin_inset Flex CharStyle:Code
12829 \begin_layout Plain Layout
12835 is any valid identifier.
12839 \begin_layout Standard
12841 \begin_inset Flex CharStyle:Code
12844 \begin_layout Plain Layout
12850 section can contain the following entries:
12853 \begin_layout Description
12854 \begin_inset Flex CharStyle:Code
12857 \begin_layout Plain Layout
12863 The color for the inset's background.
12864 These valid colors are defined in
12865 \begin_inset Flex CharStyle:Code
12868 \begin_layout Plain Layout
12877 \begin_layout Description
12878 \begin_inset Flex CharStyle:Code
12881 \begin_layout Plain Layout
12888 \begin_inset Flex CharStyle:Code
12891 \begin_layout Plain Layout
12898 \begin_inset Flex CharStyle:Code
12901 \begin_layout Plain Layout
12908 \begin_inset Flex CharStyle:Code
12911 \begin_layout Plain Layout
12917 , describing the rendering style used for the inset's frame and buttons.
12918 Footnotes generally use
12919 \begin_inset Flex CharStyle:Code
12922 \begin_layout Plain Layout
12928 ; ERT insets generally use
12929 \begin_inset Flex CharStyle:Code
12932 \begin_layout Plain Layout
12938 ; and character styles use
12939 \begin_inset Flex CharStyle:Code
12942 \begin_layout Plain Layout
12951 \begin_layout Description
12952 \begin_inset Flex CharStyle:Code
12955 \begin_layout Plain Layout
12961 The font used for both the text body
12967 \begin_inset space ~
12971 \begin_inset CommandInset ref
12973 reference "sec:fonts"
12978 Note that defining this font automatically defines the
12979 \begin_inset Flex CharStyle:Code
12982 \begin_layout Plain Layout
12988 to the same value, so define this first and define
12989 \begin_inset Flex CharStyle:Code
12992 \begin_layout Plain Layout
12998 later if you want them to be different.
13001 \begin_layout Description
13002 \begin_inset Flex CharStyle:Code
13005 \begin_layout Plain Layout
13014 \begin_layout Description
13015 \begin_inset Flex CharStyle:Code
13018 \begin_layout Plain Layout
13024 As with paragraph styles (see page
13025 \begin_inset CommandInset ref
13026 LatexCommand pageref
13027 reference "des:FreeSpacing"
13034 \begin_layout Description
13035 \begin_inset Flex CharStyle:Code
13038 \begin_layout Plain Layout
13044 As with paragraph styles (see page
13045 \begin_inset CommandInset ref
13046 LatexCommand pageref
13047 reference "des:KeepEmpty"
13054 \begin_layout Description
13055 \begin_inset Flex CharStyle:Code
13058 \begin_layout Plain Layout
13064 What will be displayed on the button or elsewhere as the inset label.
13065 Some inset types (ERT and Branch) modify this label on the fly.
13068 \begin_layout Description
13069 \begin_inset Flex CharStyle:Code
13072 \begin_layout Plain Layout
13078 The font used for the label.
13080 \begin_inset space ~
13084 \begin_inset CommandInset ref
13086 reference "sec:fonts"
13091 Note that this definition can never appear before
13092 \begin_inset Flex CharStyle:Code
13095 \begin_layout Plain Layout
13101 , lest it be ineffective.
13104 \begin_layout Description
13105 \begin_inset Flex CharStyle:Code
13108 \begin_layout Plain Layout
13114 The name of the corresponding LaTeX stuff.
13115 Either the environment or command name.
13118 \begin_layout Description
13119 \begin_inset Flex CharStyle:Code
13122 \begin_layout Plain Layout
13128 The optional parameter for the corresponding
13129 \begin_inset Flex CharStyle:Code
13132 \begin_layout Plain Layout
13138 stuff, including possible bracket pairs like
13139 \begin_inset Flex CharStyle:Code
13142 \begin_layout Plain Layout
13149 This parameter cannot be changed from within LyX.
13152 \begin_layout Description
13153 \begin_inset Flex CharStyle:Code
13156 \begin_layout Plain Layout
13162 As with paragraph styles (see page
13163 \begin_inset CommandInset ref
13164 LatexCommand pageref
13165 reference "des:LatexType"
13172 \begin_layout Description
13173 \begin_inset Flex CharStyle:Code
13176 \begin_layout Plain Layout
13183 \begin_inset Flex CharStyle:Code
13186 \begin_layout Plain Layout
13193 \begin_inset Flex CharStyle:Code
13196 \begin_layout Plain Layout
13203 \begin_inset Flex CharStyle:Code
13206 \begin_layout Plain Layout
13213 \begin_inset Flex CharStyle:Code
13216 \begin_layout Plain Layout
13222 (indicating a dummy definition ending definitions of charstyles etc.).
13223 This entry is only meaningful for Flex (user definable) insets.
13226 \begin_layout Description
13227 \begin_inset Flex CharStyle:Code
13230 \begin_layout Plain Layout
13236 As with paragraph styles (see page
13237 \begin_inset CommandInset ref
13238 LatexCommand pageref
13239 reference "des:Preamble"
13246 \begin_layout Description
13247 \begin_inset Flex CharStyle:Code
13250 \begin_layout Plain Layout
13257 \begin_inset Flex CharStyle:Code
13260 \begin_layout Plain Layout
13266 ] As with paragraph styles (see page
13267 \begin_inset CommandInset ref
13268 LatexCommand pageref
13269 reference "des:Requires"
13276 \begin_layout Subsection
13280 \begin_layout Standard
13281 \begin_inset CommandInset label
13287 Since version 1.3.0 of LyX, it is both possible and necessary to define the
13289 \begin_inset Flex CharStyle:MenuItem
13292 \begin_layout Plain Layout
13299 \begin_inset Flex CharStyle:MenuItem
13302 \begin_layout Plain Layout
13308 , \SpecialChar \ldots{}
13309 ) in the text class itself.
13310 The standard counters are defined in the file
13311 \begin_inset Flex CharStyle:Code
13314 \begin_layout Plain Layout
13320 , so you may have to do no more than add
13323 \begin_layout LyX-Code
13324 Input stdcounters.inc
13327 \begin_layout Standard
13328 to your layout file to get them to work.
13329 But if you want to define custom counters, then you can do so, using the
13330 following parameters:
13333 \begin_layout Description
13334 \begin_inset Flex CharStyle:Code
13337 \begin_layout Plain Layout
13338 LabelString [string=""]
13343 when this is defined, this string defines how the counter is displayed.
13344 Setting this value sets
13345 \begin_inset Flex CharStyle:Code
13348 \begin_layout Plain Layout
13349 LabelStringAppendix
13355 The following special constructs can be used in the string:
13359 \begin_layout Itemize
13360 \begin_inset Flex CharStyle:Code
13363 \begin_layout Plain Layout
13371 will be replaced by the expansion of the
13372 \begin_inset Flex CharStyle:Code
13375 \begin_layout Plain Layout
13382 \begin_inset Flex CharStyle:Code
13385 \begin_layout Plain Layout
13386 LabelStringAppendix
13392 \begin_inset Flex CharStyle:Code
13395 \begin_layout Plain Layout
13405 \begin_layout Itemize
13406 counter values can be expressed using LaTeX-like macros
13407 \begin_inset Flex CharStyle:Code
13410 \begin_layout Plain Layout
13427 \begin_inset Flex CharStyle:Code
13430 \begin_layout Plain Layout
13442 \begin_layout Plain Layout
13452 Actually, the situation is a bit more complicated: any
13471 other than those descibed below will produce arabic numerals.
13472 It would not be surprising to see this change in the future.
13478 \begin_inset Flex CharStyle:Code
13481 \begin_layout Plain Layout
13487 : 1, 2, 3,\SpecialChar \ldots{}
13489 \begin_inset Flex CharStyle:Code
13492 \begin_layout Plain Layout
13498 for lower-case letters: a, b, c, \SpecialChar \ldots{}
13500 \begin_inset Flex CharStyle:Code
13503 \begin_layout Plain Layout
13509 for upper-case letters: A, B, C, \SpecialChar \ldots{}
13511 \begin_inset Flex CharStyle:Code
13514 \begin_layout Plain Layout
13520 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13522 \begin_inset Flex CharStyle:Code
13525 \begin_layout Plain Layout
13531 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13533 \begin_inset Flex CharStyle:Code
13536 \begin_layout Plain Layout
13542 for hebrew numerals.
13546 \begin_layout Standard
13547 If LabelString is not defined, a default value is constructed as follows:
13548 if the counter has a master counter
13549 \begin_inset Flex CharStyle:Code
13552 \begin_layout Plain Layout
13559 \begin_inset Flex CharStyle:Code
13562 \begin_layout Plain Layout
13569 \begin_inset Flex CharStyle:Code
13572 \begin_layout Plain Layout
13582 is used; otherwise the string
13583 \begin_inset Flex CharStyle:Code
13586 \begin_layout Plain Layout
13597 \begin_layout Description
13598 \begin_inset Flex CharStyle:Code
13601 \begin_layout Plain Layout
13602 LabelStringAppendix [string=""]
13608 \begin_inset Flex CharStyle:Code
13611 \begin_layout Plain Layout
13620 \begin_layout Description
13621 \begin_inset Flex CharStyle:Code
13624 \begin_layout Plain Layout
13631 \begin_inset Flex CharStyle:Code
13634 \begin_layout Plain Layout
13641 \begin_inset Quotes erd
13645 \begin_inset Quotes erd
13648 ] The name of the counter.
13651 \begin_layout Description
13652 \begin_inset Flex CharStyle:Code
13655 \begin_layout Plain Layout
13662 \begin_inset Flex CharStyle:Code
13665 \begin_layout Plain Layout
13672 \begin_inset Quotes erd
13676 \begin_inset Quotes erd
13679 ] If this is set to the name of another counter, the present counter will
13680 be reset everytime the other one is increased.
13682 \begin_inset Flex CharStyle:Code
13685 \begin_layout Plain Layout
13692 \begin_inset Flex CharStyle:Code
13695 \begin_layout Plain Layout
13704 \begin_layout Subsection
13708 \begin_layout Standard
13709 \begin_inset CommandInset label
13715 A font description looks like this:
13718 \begin_layout LyX-Code
13728 \begin_layout LyX-Code
13732 \begin_layout LyX-Code
13736 \begin_layout Standard
13737 The following commands are available:
13740 \begin_layout Description
13741 \begin_inset Flex CharStyle:Code
13744 \begin_layout Plain Layout
13751 \begin_inset Flex CharStyle:Code
13754 \begin_layout Plain Layout
13763 \begin_inset Flex CharStyle:Code
13766 \begin_layout Plain Layout
13773 \begin_inset Flex CharStyle:Code
13776 \begin_layout Plain Layout
13783 \begin_inset Flex CharStyle:Code
13786 \begin_layout Plain Layout
13793 \begin_inset Flex CharStyle:Code
13796 \begin_layout Plain Layout
13803 \begin_inset Flex CharStyle:Code
13806 \begin_layout Plain Layout
13813 \begin_inset Flex CharStyle:Code
13816 \begin_layout Plain Layout
13823 \begin_inset Flex CharStyle:Code
13826 \begin_layout Plain Layout
13833 \begin_inset Flex CharStyle:Code
13836 \begin_layout Plain Layout
13845 \begin_layout Description
13846 \begin_inset Flex CharStyle:Code
13849 \begin_layout Plain Layout
13858 \begin_inset Flex CharStyle:Code
13861 \begin_layout Plain Layout
13872 \begin_inset Flex CharStyle:Code
13875 \begin_layout Plain Layout
13882 \begin_inset Flex CharStyle:Code
13885 \begin_layout Plain Layout
13894 \begin_layout Description
13895 \begin_inset Flex CharStyle:Code
13898 \begin_layout Plain Layout
13905 \begin_inset Flex CharStyle:Code
13908 \begin_layout Plain Layout
13914 ] Valid argument sare:
13915 \begin_inset Flex CharStyle:Code
13918 \begin_layout Plain Layout
13925 \begin_inset Flex CharStyle:Code
13928 \begin_layout Plain Layout
13935 \begin_inset Flex CharStyle:Code
13938 \begin_layout Plain Layout
13945 \begin_inset Flex CharStyle:Code
13948 \begin_layout Plain Layout
13955 \begin_inset Flex CharStyle:Code
13958 \begin_layout Plain Layout
13965 \begin_inset Flex CharStyle:Code
13968 \begin_layout Plain Layout
13975 Each of these turns on or off the corresponding attribute.
13978 \begin_layout Description
13979 \begin_inset Flex CharStyle:Code
13982 \begin_layout Plain Layout
13991 \begin_inset Flex CharStyle:Code
13994 \begin_layout Plain Layout
14005 \begin_inset Flex CharStyle:Code
14008 \begin_layout Plain Layout
14017 \begin_layout Description
14018 \begin_inset Flex CharStyle:Code
14021 \begin_layout Plain Layout
14030 \begin_inset Flex CharStyle:Code
14033 \begin_layout Plain Layout
14044 \begin_inset Flex CharStyle:Code
14047 \begin_layout Plain Layout
14054 \begin_inset Flex CharStyle:Code
14057 \begin_layout Plain Layout
14064 \begin_inset Flex CharStyle:Code
14067 \begin_layout Plain Layout
14076 \begin_layout Description
14077 \begin_inset Flex CharStyle:Code
14080 \begin_layout Plain Layout
14087 \begin_inset Flex CharStyle:Code
14090 \begin_layout Plain Layout
14097 \begin_inset Flex CharStyle:Code
14100 \begin_layout Plain Layout
14107 \begin_inset Flex CharStyle:Code
14110 \begin_layout Plain Layout
14119 \begin_inset Flex CharStyle:Code
14122 \begin_layout Plain Layout
14129 \begin_inset Flex CharStyle:Code
14132 \begin_layout Plain Layout
14139 \begin_inset Flex CharStyle:Code
14142 \begin_layout Plain Layout
14149 \begin_inset Flex CharStyle:Code
14152 \begin_layout Plain Layout
14159 \begin_inset Flex CharStyle:Code
14162 \begin_layout Plain Layout
14171 \begin_layout Subsection
14172 Upgrading old layout files
14175 \begin_layout Standard
14176 The file format of layout files changes from time to time, so old layout
14177 files need to be converted.
14178 This process has been automated since LyX 1.4.0: If LyX reads an old format
14179 layout file it will call the conversion tool
14180 \begin_inset Flex CharStyle:Code
14183 \begin_layout Plain Layout
14184 LyXDir/scripts/layout2layout.py
14189 and convert it to a temporary file in current format.
14190 The original file is left untouched.
14191 If you want to convert the layout file permanently, just call the converter
14195 \begin_layout LyX-Code
14196 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
14199 \begin_layout Standard
14200 (You need to replace
14201 \begin_inset Flex CharStyle:Code
14204 \begin_layout Plain Layout
14210 with the name of your LyX system directory, unless you happen to have defined
14211 such an environment variable.) Then copy
14212 \begin_inset Flex CharStyle:Code
14215 \begin_layout Plain Layout
14222 \begin_inset Flex CharStyle:Code
14225 \begin_layout Plain Layout
14234 \begin_layout Standard
14235 The automatic conversion only handles syntax changes.
14236 It cannot handle the case where the contents of included files was changed,
14237 so these will have to be converted separately.
14240 \begin_layout Section
14242 \begin_inset CommandInset label
14244 name "sec:templates"
14251 \begin_layout Standard
14252 Templates are created just like usual documents.
14253 The only difference is that usual documents contain all possible settings,
14254 including the font scheme and the paper size.
14255 Usually a user doesn't want a template to overwrite his defaults in these
14257 For that reason, the designer of a template should remove the corresponding
14259 \begin_inset Flex CharStyle:Code
14262 \begin_layout Plain Layout
14271 \begin_inset Flex CharStyle:Code
14274 \begin_layout Plain Layout
14282 from the template LyX file.
14283 This can be done with any simple text-editor, for example
14284 \begin_inset Flex CharStyle:Code
14287 \begin_layout Plain Layout
14294 \begin_inset Flex CharStyle:Code
14297 \begin_layout Plain Layout
14307 \begin_layout Standard
14308 Put the edited template files you create in
14309 \begin_inset Flex CharStyle:Code
14312 \begin_layout Plain Layout
14318 , copy the ones you use from the global template directory in
14319 \begin_inset Flex CharStyle:Code
14322 \begin_layout Plain Layout
14328 to the same place, and redefine the template path in the
14329 \begin_inset Flex CharStyle:MenuItem
14332 \begin_layout Plain Layout
14340 \SpecialChar \menuseparator
14345 references\SpecialChar \menuseparator
14354 \begin_layout Standard
14355 Note that there is a template which has a particular meaning:
14356 \begin_inset Flex CharStyle:Code
14359 \begin_layout Plain Layout
14366 This template is loaded everytime you create a new document with
14367 \begin_inset Flex CharStyle:MenuItem
14370 \begin_layout Plain Layout
14380 \SpecialChar \menuseparator
14382 \begin_inset Flex CharStyle:MenuItem
14385 \begin_layout Plain Layout
14395 in order to provide useful defaults.
14396 To create this template from inside LyX, all you have to do is to open
14397 a document with the correct settings, and use the
14398 \begin_inset Flex CharStyle:MenuItem
14401 \begin_layout Plain Layout
14406 e as Document Defaults
14414 \begin_layout Chapter
14415 Including External Material
14418 \begin_layout Standard
14419 The use of material from sources external to LyX is covered in detail in
14425 This part of the manual covers what needs to happen behind the scenes for
14426 new sorts of material to be included.
14429 \begin_layout Section
14433 \begin_layout Standard
14434 The external material feature is based on the concept of a
14439 A template is a specification of how LyX should interface with a certain
14441 As bundled, LyX comes with predefined templates for Xfig figures, various
14442 raster format images, chess diagrams, and LilyPond music notation.
14443 You can check the actual list by using the menu
14444 \begin_inset Flex CharStyle:MenuItem
14447 \begin_layout Plain Layout
14448 Insert\SpecialChar \menuseparator
14449 File\SpecialChar \menuseparator
14456 Furthermore, it is possible to roll your own template to support a specific
14458 Later we'll describe in more detail what is involved, and hopefully you
14459 will submit all the templates you create so we can include them in a later
14463 \begin_layout Standard
14464 Another basic idea of the external material feature is to distinguish between
14465 the original file that serves as a base for final material and the produced
14466 file that is included in your exported or printed document.
14467 For example, consider the case of a figure produced with
14468 \begin_inset Flex CharStyle:Code
14471 \begin_layout Plain Layout
14478 The Xfig application itself works on an original file with the
14479 \begin_inset Flex CharStyle:Code
14482 \begin_layout Plain Layout
14489 Within XFig, you create and change your figure, and when you are done,
14491 \begin_inset Flex CharStyle:Code
14494 \begin_layout Plain Layout
14501 When you want to include the figure in your document, you invoke
14502 \begin_inset Flex CharStyle:Code
14505 \begin_layout Plain Layout
14511 in order to create a PostScript file that can readily be included in your
14514 \begin_inset Flex CharStyle:Code
14517 \begin_layout Plain Layout
14523 file is the original file, and the PostScript file is the produced file.
14526 \begin_layout Standard
14527 This distinction is important in order to allow updating of the material
14528 while you are in the process of writing the document.
14529 Furthermore, it provides us with the flexibility that is needed to support
14530 multiple export formats.
14531 For instance, in the case of a plain text file, it is not exactly an award-winn
14532 ing idea to include the figure as raw PostScript®.
14533 Instead, you'd either prefer to just include a reference to the figure
14534 or try to invoke some graphics to Ascii converter to make the final result
14535 look similar to the real graphics.
14536 The external material management allows you to do this, because it is parameter
14537 ized on the different export formats that LyX supports.
14540 \begin_layout Standard
14541 Besides supporting the production of different products according to the
14542 exported format, it supports tight integration with editing and viewing
14544 In the case of an XFig figure, you are able to invoke Xfig on the original
14545 file with a single click from within the external material dialog in LyX,
14546 and also preview the produced PostScript file with ghostview with another
14548 No more fiddling around with the command line and/or file browsers to locate
14549 and manipulate the original or produced files.
14550 In this way, you are finally able to take full advantage of the many different
14551 applications that are relevant to use when you write your documents, and
14552 ultimately be more productive.
14555 \begin_layout Section
14556 The external template configuration file
14559 \begin_layout Standard
14560 It is relatively easy to add custom external template definitions to LyX.
14561 However, be aware that doing this in an careless manner most probably
14565 introduce an easily exploitable security hole.
14566 So before you do this, please read the discussion about security in section
14568 \begin_inset CommandInset ref
14570 reference "sec:Security-discussion"
14577 \begin_layout Standard
14578 Having said that, we encourage you to submit any interesting templates that
14583 \begin_layout Standard
14584 The external templates are defined in the
14585 \begin_inset Flex CharStyle:Code
14588 \begin_layout Plain Layout
14589 LyXDir/lib/external_templates
14595 You can place your own version in
14596 \begin_inset Flex CharStyle:Code
14599 \begin_layout Plain Layout
14600 UserDir/external_templates
14608 \begin_layout Standard
14609 A typical template looks like this:
14612 \begin_layout LyX-Code
14616 \begin_layout LyX-Code
14617 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14620 \begin_layout LyX-Code
14624 \begin_layout LyX-Code
14628 \begin_layout LyX-Code
14632 \begin_layout LyX-Code
14636 \begin_layout LyX-Code
14640 \begin_layout LyX-Code
14641 AutomaticProduction true
14644 \begin_layout LyX-Code
14648 \begin_layout LyX-Code
14652 \begin_layout LyX-Code
14656 \begin_layout LyX-Code
14657 TransformCommand Rotate RotationLatexCommand
14660 \begin_layout LyX-Code
14661 TransformCommand Resize ResizeLatexCommand
14664 \begin_layout LyX-Code
14665 Product "$$RotateFront$$ResizeFront
14668 \begin_layout LyX-Code
14673 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14676 \begin_layout LyX-Code
14677 $$ResizeBack$$RotateBack"
14680 \begin_layout LyX-Code
14684 \begin_layout LyX-Code
14685 UpdateResult "$$AbsPath$$Basename.pstex_t"
14688 \begin_layout LyX-Code
14689 Requirement "graphicx"
14692 \begin_layout LyX-Code
14693 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14696 \begin_layout LyX-Code
14697 ReferencedFile latex "$$AbsPath$$Basename.eps"
14700 \begin_layout LyX-Code
14701 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14704 \begin_layout LyX-Code
14708 \begin_layout LyX-Code
14712 \begin_layout LyX-Code
14713 TransformCommand Rotate RotationLatexCommand
14716 \begin_layout LyX-Code
14717 TransformCommand Resize ResizeLatexCommand
14720 \begin_layout LyX-Code
14721 Product "$$RotateFront$$ResizeFront
14724 \begin_layout LyX-Code
14729 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14732 \begin_layout LyX-Code
14733 $$ResizeBack$$RotateBack"
14736 \begin_layout LyX-Code
14737 UpdateFormat pdftex
14740 \begin_layout LyX-Code
14741 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14744 \begin_layout LyX-Code
14745 Requirement "graphicx"
14748 \begin_layout LyX-Code
14749 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14752 \begin_layout LyX-Code
14753 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14756 \begin_layout LyX-Code
14760 \begin_layout LyX-Code
14764 \begin_layout LyX-Code
14765 Product "$$Contents(
14767 "$$AbsPath$$Basename.asc
14772 \begin_layout LyX-Code
14773 UpdateFormat asciixfig
14776 \begin_layout LyX-Code
14777 UpdateResult "$$AbsPath$$Basename.asc"
14780 \begin_layout LyX-Code
14784 \begin_layout LyX-Code
14788 \begin_layout LyX-Code
14789 Product "<graphic fileref=
14791 "$$AbsOrRelPathMaster$$Basename.eps
14796 \begin_layout LyX-Code
14800 \begin_layout LyX-Code
14804 \begin_layout LyX-Code
14805 UpdateResult "$$AbsPath$$Basename.eps"
14808 \begin_layout LyX-Code
14809 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14812 \begin_layout LyX-Code
14813 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14816 \begin_layout LyX-Code
14820 \begin_layout LyX-Code
14821 Product "[XFig: $$FName]"
14824 \begin_layout LyX-Code
14828 \begin_layout LyX-Code
14832 \begin_layout Standard
14833 As you can see, the template is enclosed in
14834 \begin_inset Flex CharStyle:Code
14837 \begin_layout Plain Layout
14843 \SpecialChar \ldots{}
14845 \begin_inset Flex CharStyle:Code
14848 \begin_layout Plain Layout
14855 It contains a header specifying some general settings and, for each supported
14856 primary document file format, a section
14857 \begin_inset Flex CharStyle:Code
14860 \begin_layout Plain Layout
14866 \SpecialChar \ldots{}
14868 \begin_inset Flex CharStyle:Code
14871 \begin_layout Plain Layout
14880 \begin_layout Subsection
14881 The template header
14884 \begin_layout Description
14885 \begin_inset Flex CharStyle:Code
14888 \begin_layout Plain Layout
14889 AutomaticProduction
14890 \begin_inset space ~
14898 Whether the file represented by the template must be generated by LyX.
14899 This command must occur exactly once.
14902 \begin_layout Description
14903 \begin_inset Flex CharStyle:Code
14906 \begin_layout Plain Layout
14908 \begin_inset space ~
14916 A glob pattern that is used in the file dialog to filter out the desired
14918 If there is more than one possible file extension (e.g.
14919 \begin_inset space ~
14923 \begin_inset Flex CharStyle:Code
14926 \begin_layout Plain Layout
14933 \begin_inset Flex CharStyle:Code
14936 \begin_layout Plain Layout
14942 ), use something like
14943 \begin_inset Flex CharStyle:Code
14946 \begin_layout Plain Layout
14953 This command must occur exactly once.
14956 \begin_layout Description
14957 \begin_inset Flex CharStyle:Code
14960 \begin_layout Plain Layout
14962 \begin_inset space ~
14970 The text that is displayed on the button.
14971 This command must occur exactly once.
14974 \begin_layout Description
14975 \begin_inset Flex CharStyle:Code
14978 \begin_layout Plain Layout
14980 \begin_inset space ~
14984 \begin_inset space ~
14992 The help text that is used in the External dialog.
14993 Provide enough information to explain to the user just what the template
14994 can provide him with.
14995 This command must occur exactly once.
14998 \begin_layout Description
14999 \begin_inset Flex CharStyle:Code
15002 \begin_layout Plain Layout
15004 \begin_inset space ~
15012 The file format of the original file.
15013 This must be the name of a format that is known to LyX (see section
15014 \begin_inset CommandInset ref
15016 reference "sub:Formats"
15022 \begin_inset Quotes eld
15026 \begin_inset Flex CharStyle:Code
15029 \begin_layout Plain Layout
15036 \begin_inset Quotes erd
15039 if the template can handle original files of more than one format.
15040 LyX will attempt to interrogate the file itself in order to deduce its
15041 format in this case.
15042 This command must occur exactly once.
15045 \begin_layout Description
15046 \begin_inset Flex CharStyle:Code
15049 \begin_layout Plain Layout
15051 \begin_inset space ~
15059 A unique name for the template.
15060 It must not contain substitution macros (see below).
15063 \begin_layout Description
15064 \begin_inset Flex CharStyle:Code
15067 \begin_layout Plain Layout
15069 \begin_inset space ~
15072 Rotate|Resize|Clip|Extra
15077 This command specifies which transformations are supported by this template.
15078 It may occur zero or more times.
15079 This command enables the corresponding tabs in the external dialog.
15081 \begin_inset Flex CharStyle:Code
15084 \begin_layout Plain Layout
15090 command must have either a corresponding
15091 \begin_inset Flex CharStyle:Code
15094 \begin_layout Plain Layout
15101 \begin_inset Flex CharStyle:Code
15104 \begin_layout Plain Layout
15111 \begin_inset Flex CharStyle:Code
15114 \begin_layout Plain Layout
15121 Otherwise the transformation will not be supported by that format.
15124 \begin_layout Subsection
15128 \begin_layout Description
15129 \begin_inset Flex CharStyle:Code
15132 \begin_layout Plain Layout
15134 \begin_inset space ~
15137 LaTeX|PDFLaTeX|PlainText|DocBook
15142 The primary document file format that this format definition is for.
15143 Not every template has a sensible representation in all document file formats.
15144 Please define nevertheless a
15145 \begin_inset Flex CharStyle:Code
15148 \begin_layout Plain Layout
15154 section for all formats.
15155 Use a dummy text when no representation is available.
15156 Then you can at least see a reference to the external material in the exported
15160 \begin_layout Description
15161 \begin_inset Flex CharStyle:Code
15164 \begin_layout Plain Layout
15166 \begin_inset space ~
15170 \begin_inset space ~
15178 This command defines an additional macro
15179 \begin_inset Flex CharStyle:Code
15182 \begin_layout Plain Layout
15188 for substitution in
15189 \begin_inset Flex CharStyle:Code
15192 \begin_layout Plain Layout
15200 \begin_inset Flex CharStyle:Code
15203 \begin_layout Plain Layout
15209 itself may contain substitution macros.
15210 The advantage over using
15211 \begin_inset Flex CharStyle:Code
15214 \begin_layout Plain Layout
15221 \begin_inset Flex CharStyle:Code
15224 \begin_layout Plain Layout
15230 is that the substituted value of
15231 \begin_inset Flex CharStyle:Code
15234 \begin_layout Plain Layout
15240 is sanitized so that it is a valid optional argument in the document format.
15241 This command may occur zero or more times.
15244 \begin_layout Description
15245 \begin_inset Flex CharStyle:Code
15248 \begin_layout Plain Layout
15250 \begin_inset space ~
15258 The text that is inserted in the exported document.
15259 This is actually the most important command and can be quite complex.
15260 This command must occur exactly once.
15263 \begin_layout Description
15264 \begin_inset Flex CharStyle:Code
15267 \begin_layout Plain Layout
15269 \begin_inset space ~
15277 This command specifies a preamble snippet that will be included in the
15279 It has to be defined using
15280 \begin_inset Flex CharStyle:Code
15283 \begin_layout Plain Layout
15289 \SpecialChar \ldots{}
15291 \begin_inset Flex CharStyle:Code
15294 \begin_layout Plain Layout
15301 This command may occur zero or more times.
15304 \begin_layout Description
15305 \begin_inset Flex CharStyle:Code
15308 \begin_layout Plain Layout
15310 \begin_inset space ~
15314 \begin_inset space ~
15322 This command denotes files that are created by the conversion process and
15323 are needed for a particular export format.
15324 If the filename is relative, it is interpreted relative to the master document.
15325 This command may be given zero or more times.
15328 \begin_layout Description
15329 \begin_inset Flex CharStyle:Code
15332 \begin_layout Plain Layout
15334 \begin_inset space ~
15342 The name of a required LaTeX package.
15343 The package is included via
15344 \begin_inset Flex CharStyle:Code
15347 \begin_layout Plain Layout
15355 in the LaTeX preamble.
15356 This command may occur zero or more times.
15359 \begin_layout Description
15360 \begin_inset Flex CharStyle:Code
15363 \begin_layout Plain Layout
15365 \begin_inset space ~
15369 \begin_inset space ~
15372 RotationLatexCommand
15377 This command specifies that the built in LaTeX command should be used for
15379 This command may occur once or not at all.
15382 \begin_layout Description
15383 \begin_inset Flex CharStyle:Code
15386 \begin_layout Plain Layout
15388 \begin_inset space ~
15392 \begin_inset space ~
15400 This command specifies that the built in LaTeX command should be used for
15402 This command may occur once or not at all.
15405 \begin_layout Description
15406 \begin_inset Flex CharStyle:Code
15409 \begin_layout Plain Layout
15411 \begin_inset space ~
15415 \begin_inset space ~
15418 RotationLatexOption
15423 This command specifies that rotation is done via an optional argument.
15424 This command may occur once or not at all.
15427 \begin_layout Description
15428 \begin_inset Flex CharStyle:Code
15431 \begin_layout Plain Layout
15433 \begin_inset space ~
15437 \begin_inset space ~
15445 This command specifies that resizing is done via an optional argument.
15446 This command may occur once or not at all.
15449 \begin_layout Description
15450 \begin_inset Flex CharStyle:Code
15453 \begin_layout Plain Layout
15455 \begin_inset space ~
15459 \begin_inset space ~
15467 This command specifies that clipping is done via an optional argument.
15468 This command may occur once or not at all.
15471 \begin_layout Description
15472 \begin_inset Flex CharStyle:Code
15475 \begin_layout Plain Layout
15477 \begin_inset space ~
15481 \begin_inset space ~
15489 This command specifies that an extra optional argument is used.
15490 This command may occur once or not at all.
15493 \begin_layout Description
15494 \begin_inset Flex CharStyle:Code
15497 \begin_layout Plain Layout
15499 \begin_inset space ~
15507 The file format of the converted file.
15508 This must be the name of a format that is known to LyX (see the
15509 \begin_inset Flex CharStyle:MenuItem
15512 \begin_layout Plain Layout
15517 ools\SpecialChar \menuseparator
15522 references:Conversion
15528 This command must occur exactly once.
15531 \begin_layout Description
15532 \begin_inset Flex CharStyle:Code
15535 \begin_layout Plain Layout
15537 \begin_inset space ~
15545 The file name of the converted file.
15546 The file name must be absolute.
15547 This command must occur exactly once.
15550 \begin_layout Subsection
15551 Preamble definitions
15554 \begin_layout Standard
15555 The external template configuration file may contain additional preamble
15556 definitions enclosed by
15557 \begin_inset Flex CharStyle:Code
15560 \begin_layout Plain Layout
15566 \SpecialChar \ldots{}
15568 \begin_inset Flex CharStyle:Code
15571 \begin_layout Plain Layout
15578 They can be used by the templates in the
15579 \begin_inset Flex CharStyle:Code
15582 \begin_layout Plain Layout
15591 \begin_layout Section
15592 The substitution mechanism
15595 \begin_layout Standard
15596 When the external material facility invokes an external program, it is done
15597 on the basis of a command defined in the template configuration file.
15598 These commands can contain various macros that are expanded before execution.
15599 Execution always take place in the directory of the containing document.
15602 \begin_layout Standard
15603 Also, whenever external material is to be displayed, the name will be produced
15604 by the substitution mechanism, and most other commands in the template
15605 definition support substitution as well.
15608 \begin_layout Standard
15609 The available macros are the following:
15612 \begin_layout Description
15613 \begin_inset Flex CharStyle:Code
15616 \begin_layout Plain Layout
15617 $$AbsOrRelPathMaster
15622 The file path, absolute or relative to the master LyX document.
15625 \begin_layout Description
15626 \begin_inset Flex CharStyle:Code
15629 \begin_layout Plain Layout
15630 $$AbsOrRelPathParent
15635 The file path, absolute or relative to the LyX document.
15638 \begin_layout Description
15639 \begin_inset Flex CharStyle:Code
15642 \begin_layout Plain Layout
15648 The absolute file path.
15651 \begin_layout Description
15652 \begin_inset Flex CharStyle:Code
15655 \begin_layout Plain Layout
15661 The filename without path and without the extension.
15664 \begin_layout Description
15665 \begin_inset Flex CharStyle:Code
15668 \begin_layout Plain Layout
15670 \begin_inset Quotes eld
15674 \begin_inset Quotes erd
15682 This macro will expand to the contents of the file with the name
15683 \begin_inset Flex CharStyle:Code
15686 \begin_layout Plain Layout
15695 \begin_layout Description
15696 \begin_inset Flex CharStyle:Code
15699 \begin_layout Plain Layout
15705 The file extension (including the dot).
15708 \begin_layout Description
15709 \begin_inset Flex CharStyle:Code
15712 \begin_layout Plain Layout
15718 The filename of the file specified in the external material dialog.
15719 This is either an absolute name, or it is relative to the LyX document.
15722 \begin_layout Description
15723 \begin_inset Flex CharStyle:Code
15726 \begin_layout Plain Layout
15733 \begin_inset Flex CharStyle:Code
15736 \begin_layout Plain Layout
15742 (absolute name or relative to the LyX document).
15745 \begin_layout Description
15746 \begin_inset Flex CharStyle:Code
15749 \begin_layout Plain Layout
15755 The file path, relative to the master LyX document.
15758 \begin_layout Description
15759 \begin_inset Flex CharStyle:Code
15762 \begin_layout Plain Layout
15768 The file path, relative to the LyX document.
15771 \begin_layout Description
15772 \begin_inset Flex CharStyle:Code
15775 \begin_layout Plain Layout
15781 This macro will expand to the absolute path of the system directory.
15782 This is typically used to point to the various helper scripts that are
15786 \begin_layout Description
15787 \begin_inset Flex CharStyle:Code
15790 \begin_layout Plain Layout
15796 A name and full path to a temporary file which will be automatically deleted
15797 whenever the containing document is closed, or the external material insertion
15801 \begin_layout Standard
15802 All path macros contain a trailing directory separator, so you can construct
15804 the absolute filename with
15805 \begin_inset Flex CharStyle:Code
15808 \begin_layout Plain Layout
15809 $$AbsPath$$Basename$$Extension
15817 \begin_layout Standard
15818 The macros above are substituted in all commands unless otherwise noted.
15820 \begin_inset Flex CharStyle:Code
15823 \begin_layout Plain Layout
15829 supports additionally the following substitutions if they are enabled by
15831 \begin_inset Flex CharStyle:Code
15834 \begin_layout Plain Layout
15841 \begin_inset Flex CharStyle:Code
15844 \begin_layout Plain Layout
15853 \begin_layout Description
15854 \begin_inset Flex CharStyle:Code
15857 \begin_layout Plain Layout
15863 The front part of the resize command.
15866 \begin_layout Description
15867 \begin_inset Flex CharStyle:Code
15870 \begin_layout Plain Layout
15876 The back part of the resize command.
15879 \begin_layout Description
15880 \begin_inset Flex CharStyle:Code
15883 \begin_layout Plain Layout
15889 The front part of the rotation command.
15892 \begin_layout Description
15893 \begin_inset Flex CharStyle:Code
15896 \begin_layout Plain Layout
15902 The back part of the rotation command.
15905 \begin_layout Standard
15906 The value string of the
15907 \begin_inset Flex CharStyle:Code
15910 \begin_layout Plain Layout
15916 command supports additionally the following substitutions if they are enabled
15918 \begin_inset Flex CharStyle:Code
15921 \begin_layout Plain Layout
15928 \begin_inset Flex CharStyle:Code
15931 \begin_layout Plain Layout
15940 \begin_layout Description
15941 \begin_inset Flex CharStyle:Code
15944 \begin_layout Plain Layout
15953 \begin_layout Description
15954 \begin_inset Flex CharStyle:Code
15957 \begin_layout Plain Layout
15966 \begin_layout Description
15967 \begin_inset Flex CharStyle:Code
15970 \begin_layout Plain Layout
15979 \begin_layout Description
15980 \begin_inset Flex CharStyle:Code
15983 \begin_layout Plain Layout
15989 The rotation option.
15992 \begin_layout Standard
15993 You may ask why there are so many path macros.
15994 There are mainly two reasons:
15997 \begin_layout Enumerate
15998 Relative and absolute file names should remain relative or absolute, respectivel
16000 Users may have reasons to prefer either form.
16001 Relative names are useful for portable documents that should work on different
16002 machines, for example.
16003 Absolute names may be required by some programs.
16006 \begin_layout Enumerate
16007 LaTeX treats relative file names differently than LyX and other programs
16008 in nested included files.
16009 For LyX, a relative file name is always relative to the document that contains
16011 For LaTeX, it is always relative to the master document.
16012 These two definitions are identical if you have only one document, but
16013 differ if you have a master document that includes part documents.
16014 That means that relative filenames must be transformed when presented to
16016 Fortunately LyX does this automatically for you if you choose the right
16020 \begin_layout Standard
16021 So which path macro should be used in new template definitions? The rule
16025 \begin_layout Itemize
16027 \begin_inset Flex CharStyle:Code
16030 \begin_layout Plain Layout
16036 if an absolute path is required.
16039 \begin_layout Itemize
16041 \begin_inset Flex CharStyle:Code
16044 \begin_layout Plain Layout
16045 $$AbsOrRelPathMaster
16050 if the substituted string is some kind of LaTeX input.
16053 \begin_layout Itemize
16055 \begin_inset Flex CharStyle:Code
16058 \begin_layout Plain Layout
16059 $$AbsOrRelPathParent
16064 in order to preserve the user's choice.
16067 \begin_layout Standard
16068 There are special cases where this rule does not work and e.g.
16069 \begin_inset space ~
16072 relative names are needed, but normally it will work just fine.
16073 One example for such a case is the command
16074 \begin_inset Flex CharStyle:Code
16077 \begin_layout Plain Layout
16078 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
16083 in the XFig template above: We can't use the absolute name because the
16085 \begin_inset Flex CharStyle:Code
16088 \begin_layout Plain Layout
16094 files needs the relative name in order to rewrite the file content.
16097 \begin_layout Section
16098 \begin_inset CommandInset label
16100 name "sec:Security-discussion"
16104 Security discussion
16107 \begin_layout Standard
16108 \begin_inset Note Note
16111 \begin_layout Plain Layout
16112 This section is outdated
16117 The external material feature interfaces with a lot of external programs
16118 and does so automatically, so we have to consider the security implications
16120 In particular, since you have the option of including your own filenames
16121 and/or parameter strings and those are expanded into a command, it seems
16122 that it would be possible to create a malicious document which executes
16123 arbitrary commands when a user views or prints the document.
16124 This is something we definately want to avoid.
16127 \begin_layout Standard
16128 However, since the external program commands are specified in the template
16129 configuration file only, there are no security issues if LyX is properly
16130 configured with safe templates only.
16131 This is so because the external programs are invoked with the
16132 \begin_inset Flex CharStyle:Code
16135 \begin_layout Plain Layout
16141 -system call rather than the
16142 \begin_inset Flex CharStyle:Code
16145 \begin_layout Plain Layout
16151 system-call, so it's not possible to execute arbitrary commands from the
16152 filename or parameter section via the shell.
16155 \begin_layout Standard
16156 This also implies that you are restricted in what command strings you can
16157 use in the external material templates.
16158 In particular, pipes and redirection are not readily available.
16159 This has to be so if LyX should remain safe.
16160 If you want to use some of the shell features, you should write a safe
16161 script to do this in a controlled manner, and then invoke the script from
16162 the command string.
16164 \begin_inset Flex CharStyle:Code
16167 \begin_layout Plain Layout
16173 directory of the LyX installation, you can find a safe wrapper script
16174 \begin_inset Flex CharStyle:Code
16177 \begin_layout Plain Layout
16178 general_command_wrapper.py
16183 that supports redirection of input and output.
16184 That can serve as an example for how to write safe template scripts.
16185 For a more advanced example that uses
16186 \begin_inset Flex CharStyle:Code
16189 \begin_layout Plain Layout
16195 and friends, take a look at the
16196 \begin_inset Flex CharStyle:Code
16199 \begin_layout Plain Layout
16208 \begin_layout Standard
16209 It is possible to design a template that interacts directly with the shell,
16210 but since this would allow a malicious user to execute arbitrary commands
16211 by writing clever filenames and/or parameters, we generally recommend that
16212 you only use safe scripts that work with the
16213 \begin_inset Flex CharStyle:Code
16216 \begin_layout Plain Layout
16222 system call in a controlled manner.
16223 Of course, for use in a controlled environment, it can be tempting to just
16224 fall back to use ordinary shell scripts.
16225 If you do so, be aware that you
16229 provide an easily exploitable security hole in your system.
16230 Of course it stands to reason that such unsafe templates will never be
16231 included in the standard LyX distribution, although we do encourage people
16232 to submit new templates in the open source tradition.
16233 But LyX as shipped from the official distribution channels will never have
16237 \begin_layout Standard
16238 Including external material provides a lot of power, and you have to be
16239 careful not to introduce security hazards with this power.
16240 A subtle error in a single line in an innocent looking script can open
16241 the door to huge security problems.
16242 So if you do not fully understand the issues, we recommend that you consult
16243 a knowledgable security professional or the LyX development team if you
16244 have any questions about whether a given template is safe or not.
16245 And do this before you use it in an uncontrolled environment.
16248 \begin_layout Chapter
16252 \begin_layout Section
16256 \begin_layout Standard
16257 The LyX server is a method implemented in LyX that will enable other programs
16258 to talk to LyX, invoke LyX commands, and retrieve information about the
16259 LyX internal state.
16260 This is only intended for advanced users, but they should find it useful.
16261 Please note that, at present,
16263 the server does not work on Windows
16269 \begin_layout Plain Layout
16270 There is no principled reason it cannot do so.
16271 But none of the developers on Windows® have yet implemented this functionality
16280 \begin_layout Section
16281 Starting the LyX Server
16284 \begin_layout Standard
16285 The LyX server works through the use of a pair of named pipes.
16286 These are usually located in
16287 \begin_inset Flex CharStyle:Code
16290 \begin_layout Plain Layout
16297 \begin_inset Quotes eld
16301 \begin_inset Flex CharStyle:Code
16304 \begin_layout Plain Layout
16311 \begin_inset Quotes erd
16315 \begin_inset Quotes eld
16319 \begin_inset Flex CharStyle:Code
16322 \begin_layout Plain Layout
16329 \begin_inset Quotes erd
16333 External programs write into
16334 \begin_inset Flex CharStyle:Code
16337 \begin_layout Plain Layout
16343 and read back data from
16344 \begin_inset Flex CharStyle:Code
16347 \begin_layout Plain Layout
16354 The stem of the pipe names can be defined in the
16355 \begin_inset Flex CharStyle:MenuItem
16358 \begin_layout Plain Layout
16363 ools\SpecialChar \menuseparator
16373 dialog, for example
16374 \begin_inset Flex CharStyle:Code
16377 \begin_layout Plain Layout
16378 "/home/myhome/.lyxpipe"
16386 \begin_layout Standard
16388 \begin_inset Flex CharStyle:Code
16391 \begin_layout Plain Layout
16398 \begin_inset Flex CharStyle:Code
16401 \begin_layout Plain Layout
16407 ' to create the pipes.
16408 The above setting also has the effect of activating the LyX server.
16409 If one of the pipes already exists, LyX will assume that another LyX process
16410 is already running and will not start the server.
16411 To have several LyX processes with servers at the same time, you have to
16412 change the configuration between the start of the programs.
16415 \begin_layout Standard
16416 If you are developing a client program, you might find it useful to enable
16417 debugging information from the LyX server.
16418 Do this by starting LyX as lyx -dbg lyxserver.
16421 \begin_layout Standard
16422 Warning: if LyX crashes, it may not manage to remove the pipes; in this
16423 case you must remove them manually.
16424 If LyX starts and the pipes exist already, it will not start any server.
16427 \begin_layout Standard
16428 Other than this, there are a few points to consider:
16431 \begin_layout Itemize
16432 Both server and clients must run on UNIX or OS/2 machines.
16433 Communications between LyX on UNIX and clients on OS/2 or vice versa is
16434 not possible right now.
16437 \begin_layout Itemize
16438 On OS/2, only one client can connect to LyXServer at a time.
16441 \begin_layout Itemize
16442 On OS/2, clients must open inpipe with
16443 \begin_inset Flex CharStyle:Code
16446 \begin_layout Plain Layout
16455 \begin_layout Standard
16459 \begin_layout Standard
16460 You can find a complete example client written in C in the source distribution
16462 \begin_inset Flex CharStyle:Code
16465 \begin_layout Plain Layout
16466 development/lyxserver/server_monitor.c
16474 \begin_layout Section
16475 Normal communication
16478 \begin_layout Standard
16479 To issue a LyX call, the client writes a line of ASCII text into the input
16481 This line has the following format:
16484 \begin_layout Quote
16498 \begin_layout Description
16503 is a name that the client can choose arbitrarily.
16504 Its only use is that LyX will echo it if it sends an answer---so a client
16505 can dispatch results from different requesters.
16508 \begin_layout Description
16513 is the function you want LyX to perform.
16514 It is the same as the commands you'd use in the minibuffer.
16517 \begin_layout Description
16522 is an optional argument which is meaningful only to some functions (for
16524 \begin_inset Quotes eld
16528 \begin_inset Quotes erd
16531 which will insert the argument as text at the cursor position.)
16534 \begin_layout Standard
16535 The answer from LyX will arrive in the output pipe and be of the form
16538 \begin_layout Quote
16552 \begin_layout Standard
16561 are just echoed from the command request, while
16565 is more or less useful information filled according to how the command
16566 execution worked out.
16567 Some commands will return information about the internal state of LyX,
16569 \begin_inset Quotes eld
16573 \begin_inset Quotes erd
16576 , while other will return an empty data-response.
16577 This means that the command execution went fine.
16580 \begin_layout Standard
16581 In case of errors, the response from LyX will have this form
16584 \begin_layout Quote
16598 \begin_layout Standard
16603 should contain an explanation of why the command failed.
16606 \begin_layout Standard
16610 \begin_layout LyX-Code
16611 echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
16614 \begin_layout LyX-Code
16615 echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
16616 \begin_inset Newline newline
16619 read a <~/.lyxpipe.out
16620 \begin_inset Newline newline
16626 \begin_layout Section
16630 \begin_layout Standard
16631 LyX can notify clients of events going on asynchronously.
16632 Currently it will only do this if the user binds a key sequence with the
16634 \begin_inset Quotes eld
16638 \begin_inset Quotes erd
16642 The format of the string LyX sends is as follows:
16645 \begin_layout Quote
16646 \begin_inset Flex CharStyle:Code
16649 \begin_layout Plain Layout
16660 \begin_layout Standard
16665 is the printed representation of the key sequence that was actually typed
16669 \begin_layout Standard
16670 This mechanism can be used to extend LyX's command set and implement macros:
16671 bind some key sequence to
16672 \begin_inset Quotes eld
16676 \begin_inset Quotes erd
16679 , start a client that listens on the out pipe, dispatches the command according
16680 to the sequence and starts a function that may use LyX calls and LyX requests
16681 to issue a command or a series of commands to LyX.
16684 \begin_layout Section
16685 The simple LyX Server Protocol
16688 \begin_layout Standard
16689 LyX implements a simple protocol that can be used for session management.
16690 All messages are of the form
16693 \begin_layout Quote
16703 \begin_layout Standard
16709 \begin_inset Quotes eld
16713 \begin_inset Quotes erd
16717 \begin_inset Quotes eld
16721 \begin_inset Quotes erd
16726 \begin_inset Quotes eld
16730 \begin_inset Quotes erd
16733 is received from a client, LyX will report back to inform the client that
16734 it's listening to it's messages, while
16735 \begin_inset Quotes eld
16739 \begin_inset Quotes erd
16742 sent from LyX will inform clients that LyX is closing.