1 #LyX 1.6.0alpha1 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]{Contents}{}
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
64 \paperfontsize default
67 \pdf_title "LyX Configuration Manual"
68 \pdf_author "The LyX Team"
70 \pdf_bookmarksnumbered false
71 \pdf_bookmarksopen false
72 \pdf_bookmarksopenlevel 1
77 \pdf_pagebackref false
85 \paperorientation portrait
92 \paragraph_separation indent
94 \quotes_language english
97 \paperpagestyle headings
98 \tracking_changes false
102 \extra_embedded_files ""
108 Customizing LyX: Features for the Advanced User
116 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
215 \begin_inset Flex CharStyle:MenuItem
218 \begin_layout PlainLayout
224 in the remainder of this document.
228 \begin_layout Section
230 \begin_inset Flex CharStyle:Code
233 \begin_layout PlainLayout
242 \begin_layout Standard
243 \begin_inset Flex CharStyle:Code
246 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
324 contains defaults for various commands.
328 \labelwidthstring 00.00.0000
329 \begin_inset Flex CharStyle:Code
332 \begin_layout PlainLayout
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 PlainLayout
349 elp\SpecialChar \menuseparator
367 \labelwidthstring 00.00.0000
368 \begin_inset Flex CharStyle:Code
371 \begin_layout PlainLayout
377 the list of text classes that have been found in your
378 \begin_inset Flex CharStyle:Code
381 \begin_layout PlainLayout
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 PlainLayout
402 the list of layout modules found in your
403 \begin_inset Flex CharStyle:Code
406 \begin_layout PlainLayout
416 \labelwidthstring 00.00.0000
417 \begin_inset Flex CharStyle:Code
420 \begin_layout PlainLayout
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 PlainLayout
440 is automatically generated during configuration from the file
441 \begin_inset Flex CharStyle:Code
444 \begin_layout PlainLayout
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 PlainLayout
470 \begin_inset Flex CharStyle:Code
473 \begin_layout PlainLayout
480 If a particular files exists in both places, the one in
481 \begin_inset Flex CharStyle:Code
484 \begin_layout PlainLayout
494 \labelwidthstring 00.00.0000
495 \begin_inset Flex CharStyle:Code
498 \begin_layout PlainLayout
504 this directory contains files with the extension
505 \begin_inset Flex CharStyle:Code
508 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
569 contains graphics files that can be included in documents.
574 \labelwidthstring 00.00.0000
575 \begin_inset Flex CharStyle:Code
578 \begin_layout PlainLayout
584 contains LyX documentation files (including the one you are currently reading).
586 \begin_inset Flex CharStyle:Code
589 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
648 \labelwidthstring 00.00.0000
649 \begin_inset Flex CharStyle:Code
652 \begin_layout PlainLayout
658 contains image files that are used by the
659 \begin_inset Flex CharStyle:MenuItem
662 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
736 \begin_inset Flex CharStyle:Code
739 \begin_layout PlainLayout
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 PlainLayout
761 contains some files that demonstrate the capabilities of the
762 \begin_inset Flex CharStyle:MenuItem
765 \begin_layout PlainLayout
776 Also contains some scripts used by LyX itself.
780 \labelwidthstring 00.00.0000
781 \begin_inset Flex CharStyle:Code
784 \begin_layout PlainLayout
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 PlainLayout
815 contains files with the extension
816 \begin_inset Flex CharStyle:Code
819 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
868 elp\SpecialChar \menuseparator
882 \labelwidthstring 00.00.0000
883 \begin_inset Flex CharStyle:Code
886 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
941 this file contains the templates available to the new
942 \begin_inset Flex CharStyle:MenuItem
945 \begin_layout PlainLayout
959 \labelwidthstring 00.00.0000
960 \begin_inset Flex CharStyle:Code
963 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
1028 , which means that every file in
1029 \begin_inset Flex CharStyle:Code
1032 \begin_layout PlainLayout
1038 is a replacement for the corresponding file in
1039 \begin_inset Flex CharStyle:Code
1042 \begin_layout PlainLayout
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 PlainLayout
1068 ools\SpecialChar \menuseparator
1078 dialog are saved to a file
1079 \begin_inset Flex CharStyle:Code
1082 \begin_layout PlainLayout
1089 \begin_inset Flex CharStyle:Code
1092 \begin_layout PlainLayout
1101 \begin_layout Itemize
1102 When you reconfigure using
1103 \begin_inset Flex CharStyle:MenuItem
1106 \begin_layout PlainLayout
1111 ools\SpecialChar \menuseparator
1122 \begin_inset Flex CharStyle:Code
1125 \begin_layout PlainLayout
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 PlainLayout
1144 will be added to the list of classes in the
1145 \begin_inset Flex CharStyle:MenuItem
1148 \begin_layout PlainLayout
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 PlainLayout
1179 and the items in the
1180 \begin_inset Flex CharStyle:MenuItem
1183 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
1353 LyXDir/lyxrc.defaults
1359 Users should use the
1360 \begin_inset Flex CharStyle:MenuItem
1363 \begin_layout PlainLayout
1368 ools\SpecialChar \menuseparator
1378 dialog to create and modify their own
1379 \begin_inset Flex CharStyle:Code
1382 \begin_layout PlainLayout
1391 \begin_layout Standard
1393 \begin_inset Flex CharStyle:MenuItem
1396 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
1687 \begin_inset Space ~
1700 \begin_inset Flex CharStyle:MenuItem
1703 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
1812 \begin_inset Flex CharStyle:MenuItem
1815 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
2036 Simply select a different
2037 \begin_inset Flex CharStyle:Code
2040 \begin_layout PlainLayout
2047 \begin_inset Flex CharStyle:MenuItem
2050 \begin_layout PlainLayout
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 PlainLayout
2069 \begin_inset Flex CharStyle:Code
2072 \begin_layout PlainLayout
2079 \begin_inset Flex CharStyle:Code
2082 \begin_layout PlainLayout
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 PlainLayout
2103 files is straightforward: have a look at
2104 \begin_inset Flex CharStyle:Code
2107 \begin_layout PlainLayout
2115 \begin_inset Flex CharStyle:Code
2118 \begin_layout PlainLayout
2125 \begin_inset Flex CharStyle:Code
2128 \begin_layout PlainLayout
2135 \begin_inset Flex CharStyle:Code
2138 \begin_layout PlainLayout
2144 entries must be ended with an explicit
2145 \begin_inset Flex CharStyle:Code
2148 \begin_layout PlainLayout
2156 \begin_inset Flex CharStyle:Code
2159 \begin_layout PlainLayout
2166 \begin_inset Flex CharStyle:Code
2169 \begin_layout PlainLayout
2176 \begin_inset Flex CharStyle:Code
2179 \begin_layout PlainLayout
2186 \begin_inset Flex CharStyle:Code
2189 \begin_layout PlainLayout
2196 \begin_inset Flex CharStyle:Code
2199 \begin_layout PlainLayout
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 PlainLayout
2224 One small word of warning.
2226 \begin_inset Flex CharStyle:Code
2229 \begin_layout PlainLayout
2235 s may be inserted in a
2236 \begin_inset Flex CharStyle:Code
2239 \begin_layout PlainLayout
2246 \begin_inset Flex CharStyle:Code
2249 \begin_layout PlainLayout
2255 , but they are defined as
2256 \begin_inset Flex CharStyle:Code
2259 \begin_layout PlainLayout
2266 \begin_inset Flex CharStyle:Code
2269 \begin_layout PlainLayout
2277 \begin_inset Flex CharStyle:Code
2280 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
2349 Editing\SpecialChar \menuseparator
2358 \begin_inset Flex CharStyle:MenuItem
2361 \begin_layout PlainLayout
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 PlainLayout
2396 \begin_inset Flex CharStyle:Code
2399 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
2424 Editing\SpecialChar \menuseparator
2431 The changes you make here will be stored at
2432 \begin_inset Flex CharStyle:Code
2435 \begin_layout PlainLayout
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 PlainLayout
2474 directory, and LyX will use it automatically.
2477 \begin_layout Standard
2479 \begin_inset Flex CharStyle:Code
2482 \begin_layout PlainLayout
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 PlainLayout
2549 Tools\SpecialChar \menuseparator
2550 Preferences\SpecialChar \menuseparator
2551 File Handling\SpecialChar \menuseparator
2559 \begin_inset Flex CharStyle:MenuItem
2562 \begin_layout PlainLayout
2563 New\SpecialChar \ldots{}
2569 button to define your new format.
2571 \begin_inset Flex CharStyle:MenuItem
2574 \begin_layout PlainLayout
2580 field contains the named used to identify the format in the GUI.
2582 \begin_inset Flex CharStyle:MenuItem
2585 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
2616 \begin_inset Flex CharStyle:MenuItem
2619 \begin_layout PlainLayout
2620 View\SpecialChar \menuseparator
2629 \begin_layout Standard
2631 \begin_inset Flex CharStyle:MenuItem
2634 \begin_layout PlainLayout
2641 \begin_inset Flex CharStyle:MenuItem
2644 \begin_layout PlainLayout
2651 For example, you might want to use
2652 \begin_inset Flex CharStyle:MenuItem
2655 \begin_layout PlainLayout
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 PlainLayout
2677 The editor is for example launched when you press the
2678 \begin_inset Flex CharStyle:MenuItem
2681 \begin_layout PlainLayout
2688 \begin_inset Flex CharStyle:MenuItem
2691 \begin_layout PlainLayout
2698 \begin_inset Flex CharStyle:MenuItem
2701 \begin_layout PlainLayout
2710 \begin_layout Standard
2712 \begin_inset Flex CharStyle:MenuItem
2715 \begin_layout PlainLayout
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 PlainLayout
2734 File\SpecialChar \menuseparator
2741 The format will also appear in the
2742 \begin_inset Flex CharStyle:MenuItem
2745 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
2776 \begin_layout Standard
2778 \begin_inset Flex CharStyle:MenuItem
2781 \begin_layout PlainLayout
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 PlainLayout
2800 Included graphics may need to be converted to either
2801 \begin_inset Flex CharStyle:MenuItem
2804 \begin_layout PlainLayout
2811 \begin_inset Flex CharStyle:MenuItem
2814 \begin_layout PlainLayout
2821 \begin_inset Flex CharStyle:MenuItem
2824 \begin_layout PlainLayout
2831 \begin_inset Flex CharStyle:MenuItem
2834 \begin_layout PlainLayout
2840 cannot handle other image formats.
2841 If an included graphic is not already in
2842 \begin_inset Flex CharStyle:MenuItem
2845 \begin_layout PlainLayout
2852 \begin_inset Flex CharStyle:MenuItem
2855 \begin_layout PlainLayout
2862 \begin_inset Flex CharStyle:MenuItem
2865 \begin_layout PlainLayout
2871 format, it is converted to
2872 \begin_inset Flex CharStyle:MenuItem
2875 \begin_layout PlainLayout
2881 if the vector format option is set, and otherwise to
2882 \begin_inset Flex CharStyle:MenuItem
2885 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
2932 The LyX system directory (e.
2933 \begin_inset Space \thinspace{}
2937 \begin_inset Space ~
2941 \begin_inset Flex CharStyle:MenuItem
2944 \begin_layout PlainLayout
2954 \labelwidthstring 00.00.0000
2955 \begin_inset Flex CharStyle:Code
2958 \begin_layout PlainLayout
2968 \labelwidthstring 00.00.0000
2969 \begin_inset Flex CharStyle:Code
2972 \begin_layout PlainLayout
2982 \labelwidthstring 00.00.0000
2983 \begin_inset Flex CharStyle:Code
2986 \begin_layout PlainLayout
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 PlainLayout
3020 Then you could write a shell script such as this one:
3023 \begin_layout Standard
3024 \begin_inset listings
3028 \begin_layout PlainLayout
3032 \begin_layout PlainLayout
3036 \begin_layout PlainLayout
3037 TOFILE=`basename $2`
3040 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
3062 Tools\SpecialChar \menuseparator
3069 \begin_inset Flex CharStyle:MenuItem
3072 \begin_layout PlainLayout
3078 format---or one of the other pdf formats---and enter
3079 \begin_inset Flex CharStyle:Code
3082 \begin_layout PlainLayout
3083 pdfcopier.sh $$i $$o
3089 \begin_inset Flex CharStyle:MenuItem
3092 \begin_layout PlainLayout
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 PlainLayout
3116 \begin_inset Flex CharStyle:MenuItem
3119 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
3174 \begin_inset Quotes erd
3177 , so HTML generated from
3178 \begin_inset Flex CharStyle:MenuItem
3181 \begin_layout PlainLayout
3182 /path/to/filename.lyx
3188 \begin_inset Flex CharStyle:MenuItem
3191 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
3242 \begin_inset Space ~
3251 \begin_inset Space \thinspace{}
3255 \begin_inset Flex CharStyle:MenuItem
3258 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
3294 The LyX system directory
3298 \labelwidthstring 00.00.0000
3299 \begin_inset Flex CharStyle:Code
3302 \begin_layout PlainLayout
3312 \labelwidthstring 00.00.0000
3313 \begin_inset Flex CharStyle:Code
3316 \begin_layout PlainLayout
3326 \labelwidthstring 00.00.0000
3327 \begin_inset Flex CharStyle:Code
3330 \begin_layout PlainLayout
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 PlainLayout
3350 The path to the input file
3353 \begin_layout Standard
3355 \begin_inset Flex CharStyle:MenuItem
3358 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
3398 \begin_inset Flex CharStyle:MenuItem
3401 \begin_layout PlainLayout
3407 file for the conversion.
3411 \labelwidthstring 00.00.0000
3412 \begin_inset Flex CharStyle:Code
3415 \begin_layout PlainLayout
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 PlainLayout
3432 \begin_inset Space ~
3436 \begin_inset Space ~
3448 \labelwidthstring 00.00.0000
3449 \begin_inset Flex CharStyle:Code
3452 \begin_layout PlainLayout
3458 If set, the converter's standard error will be redirected to a file
3459 \begin_inset Flex CharStyle:Code
3462 \begin_layout PlainLayout
3468 , and the script given as argument will be run as:
3469 \begin_inset Flex CharStyle:Code
3472 \begin_layout PlainLayout
3473 script <infile.out >infile.log
3479 The argument may contain
3480 \begin_inset Flex CharStyle:Code
3483 \begin_layout PlainLayout
3493 \labelwidthstring 00.00.0000
3494 \begin_inset Flex CharStyle:Code
3497 \begin_layout PlainLayout
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 PlainLayout
3517 , which will be replaced by the basename of the input and output files,
3518 respectively, when the directory is copied.
3520 Note that resultdir and usetempdir
3521 make no sense together.
3522 The latter will be ignored if the former is given.
3526 \labelwidthstring 00.00.0000
3527 \begin_inset Flex CharStyle:Code
3530 \begin_layout PlainLayout
3536 Determines the output filename and may, contain
3537 \begin_inset Flex CharStyle:Code
3540 \begin_layout PlainLayout
3547 Sensible only with resultdir and optional even then; if not given, it defaults
3551 \begin_layout Standard
3552 None of these last three are presently used in any of the converters that
3553 are installed with LyX.
3557 \begin_layout Standard
3558 You do not have to define converters between all the formats between which
3559 you want to convert.
3560 For example, you will note that there is no `LyX to PostScript®' converter,
3561 but LyX will export PostScript®.
3562 It does so by first creating a LaTeX file (no converter needs to be defined
3563 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
3564 and finally converting the resulting DVI file to PostScript®.
3565 LyX finds such `chains' of converters automatically, and it will always
3566 choose the shortest possible chain.
3567 You can, though, still define multiple conversion methods between file
3569 For example, the standard LyX configuration provides three ways to convert
3570 LaTeX to PDF: Directly, using
3571 \begin_inset Flex CharStyle:MenuItem
3574 \begin_layout PlainLayout
3580 ; via (DVI and) PostScript®, using
3581 \begin_inset Flex CharStyle:MenuItem
3584 \begin_layout PlainLayout
3591 \begin_inset Flex CharStyle:MenuItem
3594 \begin_layout PlainLayout
3601 To define such alternate chains, you must define multiple target `file
3602 formats', as described in section
3603 \begin_inset CommandInset ref
3605 reference "sub:Formats"
3610 For example, in the standard configuration, the formats named
3611 \begin_inset Flex CharStyle:MenuItem
3614 \begin_layout PlainLayout
3621 \begin_inset Flex CharStyle:MenuItem
3624 \begin_layout PlainLayout
3631 \begin_inset Flex CharStyle:MenuItem
3634 \begin_layout PlainLayout
3640 are defined, all of which share the extension
3641 \begin_inset Flex CharStyle:MenuItem
3644 \begin_layout PlainLayout
3650 , and which correspond to the conversion methods just mentioned.
3653 \begin_layout Section
3657 \begin_layout Standard
3658 The settings in this section affect the output LyX produces.
3661 \begin_layout Subsection
3662 Plain text export options
3665 \begin_layout Standard
3667 There are a couple of commands that can be used to
3668 \begin_inset Quotes eld
3672 \begin_inset Quotes erd
3675 exported plain text files.
3676 Note that LyX automatically detects and tries to use the best settings
3677 for your system at installation time, but you can modify them in the
3678 \begin_inset Flex CharStyle:MenuItem
3681 \begin_layout PlainLayout
3682 Output\SpecialChar \menuseparator
3688 dialog if you disagree with its interpretation.
3691 \begin_layout Description
3692 \begin_inset Flex CharStyle:Code
3695 \begin_layout PlainLayout
3701 This option defines the command used to produce better plain text tables
3703 \begin_inset Flex CharStyle:Code
3706 \begin_layout PlainLayout
3712 UNIX-commands (refer to their manpages for more information about them).
3713 Setting this as empty tells LyX to use the internal (inferior) formatter.
3716 \begin_layout Description
3717 \begin_inset Flex CharStyle:Code
3720 \begin_layout PlainLayout
3726 With this command you can set the default line length of the plain text
3728 Setting it to 0 means that no line breaks will be inserted except between
3729 paragraphs and the like.
3732 \begin_layout Section
3736 \begin_layout Standard
3737 There are many other configuration options that can be used to customize
3739 Most of them are sufficiently self-explanatory that we have not felt it
3740 necessary to document them here.
3742 \begin_inset CommandInset href
3744 name "mailing lists"
3745 target "http://www.lyx.org/mailing.php"
3749 if you need some more information.
3752 \begin_layout Chapter
3753 Internationalizing LyX
3754 \begin_inset CommandInset label
3763 \begin_layout Standard
3764 LyX supports using a translated interface.
3765 Last time we checked, LyX provided text in thirty languages.
3766 The language of choice is called your
3771 (For further reading on locale settings, see also the documentation for
3772 locale that comes with your operating system.
3773 For Linux, the manual page for
3774 \begin_inset Flex CharStyle:Code
3777 \begin_layout PlainLayout
3783 could be a good place to start).
3786 \begin_layout Standard
3787 Notice that these translations will work, but do contain a few flaws.
3788 In particular, all dialogs have been designed with the English text in
3789 mind, which means that some of the translated text will be too large to
3790 fit within the space allocated.
3791 This is only a display problem and will not cause any harm.
3792 Also, you will find that some of the translations do not define shortcut
3793 keys for everything.
3794 Sometimes, there are simply not enough free letters to do it.
3795 Other times, the translator just hasn't got around to doing it yet.
3796 Our localization team, which you may wish to join,
3800 \begin_layout PlainLayout
3801 If you are a fluent speaker of a language other than English, joining these
3802 teams is a great way to give back to the LyX community!
3807 will of course try to fix these shortcomings in future versions of LyX.
3810 \begin_layout Section
3814 \begin_layout Subsection
3815 Translating the graphical user interface (text messages).
3818 \begin_layout Standard
3820 \begin_inset Flex CharStyle:Code
3823 \begin_layout PlainLayout
3829 library to handle the internationalization of the interface.
3830 To have LyX speak your favorite language in all menus and dialogs, you
3832 \begin_inset Flex CharStyle:Code
3835 \begin_layout PlainLayout
3841 -file for that language.
3842 When this is available, you'll have to generate a
3843 \begin_inset Flex CharStyle:Code
3846 \begin_layout PlainLayout
3852 -file from it and install the
3853 \begin_inset Flex CharStyle:Code
3856 \begin_layout PlainLayout
3863 The process of doing all of this is explained in the documentation for
3865 \begin_inset Flex CharStyle:Code
3868 \begin_layout PlainLayout
3875 It is possible to do this just for yourself, but if you're going to do
3876 it, you might as well share the results of your labors with the rest of
3878 Send a message to the LyX developers' list for more information about how
3882 \begin_layout Standard
3883 In short, this is what you should do (xx denotes the language code):
3886 \begin_layout Itemize
3887 Check out the LyX source code.
3889 \begin_inset CommandInset href
3891 name "information on the web"
3892 target "http://www.lyx.org/devel/cvs.php"
3899 \begin_layout Itemize
3901 \begin_inset Flex CharStyle:Code
3904 \begin_layout PlainLayout
3915 \begin_inset Flex CharStyle:Code
3918 \begin_layout PlainLayout
3925 \begin_inset Flex CharStyle:Code
3928 \begin_layout PlainLayout
3934 doesn't exist, it can be remade with
3935 \begin_inset Flex CharStyle:Code
3938 \begin_layout PlainLayout
3944 in that directory, or you can use an existing po-file for some other language
3948 \begin_layout Itemize
3950 \begin_inset Flex CharStyle:Code
3953 \begin_layout PlainLayout
3963 \begin_layout PlainLayout
3964 This is just a text file, so it can be edited in any text editor.
3965 But there are also specialized programs that support such editing, such
3966 as KBabel (for KDE).
3967 Emacs contains a `mode' for editing
3968 \begin_inset Flex CharStyle:Code
3971 \begin_layout PlainLayout
3982 For some menu- and widget-labels, there are also shortcut keys that should
3984 Those keys are marked after a `|', and should be translated according to
3985 the words and phrases of the language.
3986 You should also fill also out the information at the beginning of the new
3988 \begin_inset Flex CharStyle:Code
3991 \begin_layout PlainLayout
3997 -file with your email-address, etc., so people know where to reach you with
3998 suggestions and entertaining flames.
4001 \begin_layout Standard
4002 If you are just doing this on your own, then:
4005 \begin_layout Itemize
4007 \begin_inset Flex CharStyle:Code
4010 \begin_layout PlainLayout
4017 This can be done with
4018 \begin_inset Flex CharStyle:Code
4021 \begin_layout PlainLayout
4022 msgfmt -o xx.mo < xx.po
4030 \begin_layout Itemize
4032 \begin_inset Flex CharStyle:Code
4035 \begin_layout PlainLayout
4041 -file to your locale-tree, at the correct directory for application messages
4046 xx, and under the name
4047 \begin_inset Flex CharStyle:Code
4050 \begin_layout PlainLayout
4058 \begin_inset Flex CharStyle:Code
4061 \begin_layout PlainLayout
4062 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
4072 \begin_layout Standard
4073 As said, however, it would be best if the new
4074 \begin_inset Flex CharStyle:Code
4077 \begin_layout PlainLayout
4083 -file could be added to the LyX distribution, so others can use it.
4084 Adding it involves making additional changes to LyX.
4085 So send an email to the developers' mailing list if you're interested in
4089 \begin_layout Subsubsection
4093 \begin_layout Standard
4094 Sometimes it turns out that one English message needs to be translated into
4095 different messages in the target language.
4096 One example is the message
4097 \begin_inset Flex CharStyle:Code
4100 \begin_layout PlainLayout
4106 which has the German translation
4114 , depending upon exactly what the English
4115 \begin_inset Quotes eld
4119 \begin_inset Quotes erd
4124 \begin_inset Flex CharStyle:Code
4127 \begin_layout PlainLayout
4133 does not handle such ambigous translations.
4134 Therefore you have to add some context information to the message: Instead
4136 \begin_inset Flex CharStyle:Code
4139 \begin_layout PlainLayout
4146 \begin_inset Flex CharStyle:Code
4149 \begin_layout PlainLayout
4150 To[[as in 'From format x to format y']]
4156 \begin_inset Flex CharStyle:Code
4159 \begin_layout PlainLayout
4160 To[[as in 'From page x to page y']].
4165 Now the two occurences of
4166 \begin_inset Flex CharStyle:Code
4169 \begin_layout PlainLayout
4176 \begin_inset Flex CharStyle:Code
4179 \begin_layout PlainLayout
4185 and can be translated correctly to
4196 \begin_layout Standard
4197 Of course the context information needs to be stripped off the original
4198 message when no translation is used.
4199 Therefore you have to put it in double square brackets at the end of the
4200 message (see the example above).
4201 The translation mechanism of LyX ensures that everything in double square
4202 brackets at the end of messages is removed before displaying the message.
4205 \begin_layout Subsection
4206 Translating the documentation.
4209 \begin_layout Standard
4210 The online documentation (in the
4211 \begin_inset Flex CharStyle:MenuItem
4214 \begin_layout PlainLayout
4224 -menu) can (and should!) be translated.
4225 If there are translated versions of the documentation available
4229 \begin_layout PlainLayout
4230 As of March 2008, at least some of the documents have been translated into
4231 fourteen languages, with the Tutorial available in a few more.
4236 and the locale is set accordingly, these will be used automagically by
4238 LyX looks for translated versions as
4239 \begin_inset Flex CharStyle:Code
4242 \begin_layout PlainLayout
4243 LyXDir/doc/xx_DocName.lyx
4249 \begin_inset Flex CharStyle:Code
4252 \begin_layout PlainLayout
4258 is the code for the language currently in use.
4259 If there are no translated documents, the default English versions will
4261 Note that the translated versions must have the same filenames (
4262 \begin_inset Flex CharStyle:Code
4265 \begin_layout PlainLayout
4271 above) as the original.
4272 If you feel up to translating the documentation (an excellent way to proof-read
4273 the original documentation by the way!), there are a few things you should
4277 \begin_layout Itemize
4279 \begin_inset Flex CharStyle:Code
4282 \begin_layout PlainLayout
4288 , the guide to writing LyX documentation.
4289 Pay special attention to the translator's section.
4292 \begin_layout Itemize
4293 Check out the documentation translation web page at
4294 \begin_inset CommandInset href
4296 name "http://www.devel.lyx.org"
4297 target "http://www.devel.lyx.org"
4302 That way, you can find out which (if any) documents have already been translate
4303 d into your language.
4304 You can also find out who (if anyone) is organizing the effort to translate
4305 the documentation into your language.
4306 If no one is organizing the effort, please let us know that you're interested.
4309 \begin_layout Standard
4310 Once you get to actually translating, here's a few hints for you that may
4314 \begin_layout Itemize
4315 Join the documentation team! There is information on how to do that in
4316 \begin_inset Flex CharStyle:Code
4319 \begin_layout PlainLayout
4326 \begin_inset Flex CharStyle:MenuItem
4329 \begin_layout PlainLayout
4334 elp\SpecialChar \menuseparator
4344 ), which by the way is the first document you should translate.
4347 \begin_layout Itemize
4348 Learn the typographic conventions for the language you are translating to.
4349 Typography is an ancient art and over the centuries, a great variety of
4350 conventions have developed throughout different parts of the world.
4351 Also study the professional terminology amongst typographers in your country.
4352 Inventing your own terminology will only confuse the users.
4355 (Warning! Typography is addictive!)
4358 \begin_layout Itemize
4359 Make a copy of the document.
4360 This will be your working copy.
4361 You can use this as your personal translated help-file by placing it in
4363 \begin_inset Flex CharStyle:Code
4366 \begin_layout PlainLayout
4375 \begin_layout Itemize
4376 Sometimes the original document (from the LyX-team) will be updated.
4377 Use the source viewer at
4378 \begin_inset CommandInset href
4380 name "http://www.lyx.org/trac/timeline"
4381 target "http://www.lyx.org/trac/timeline"
4385 to see what has been changed.
4386 That way you can easily see which parts of the translated document need
4390 \begin_layout Standard
4391 If you ever find an error in the original document, fix it and notify the
4392 rest of the documentation team of the changes! (You didn't forget to join
4393 the documentation team, did you?)
4396 \begin_layout Standard
4397 \begin_inset Branch OutDated
4400 \begin_layout Section
4401 International Keyboard Support
4404 \begin_layout Standard
4407 [Editor's Note: The following section is by
4415 It needs to be fixed to conform to the new Documentation Style sheet and
4416 to make use of the new v1.0 features.
4417 The whole thing also needs to be merged with the section following it.-jw
4418 It may also be badly out of date.-rh (2008)]
4421 \begin_layout Subsection
4422 Defining Own Keymaps: Keymap File Format
4425 \begin_layout Standard
4426 Let's look at a keyboard definition file a little closer.
4427 It is a plain text file defining
4430 \begin_layout Itemize
4431 key-to-key or key-to-string translations
4434 \begin_layout Itemize
4438 \begin_layout Itemize
4439 dead keys exceptions
4442 \begin_layout Standard
4443 To define key-to-key or key-to-string translation, use this command:
4446 \begin_layout Quotation
4447 \begin_inset Flex CharStyle:Code
4450 \begin_layout PlainLayout
4459 \begin_inset Flex CharStyle:Code
4462 \begin_layout PlainLayout
4471 \begin_layout Standard
4473 \begin_inset Flex CharStyle:Code
4476 \begin_layout PlainLayout
4482 is the key to be translated and
4483 \begin_inset Flex CharStyle:Code
4486 \begin_layout PlainLayout
4492 is the string to be inserted into the document.
4493 To define dead keys, use:
4496 \begin_layout Quotation
4497 \begin_inset Flex CharStyle:Code
4500 \begin_layout PlainLayout
4509 \begin_inset Flex CharStyle:Code
4512 \begin_layout PlainLayout
4521 \begin_layout Standard
4523 \begin_inset Flex CharStyle:Code
4526 \begin_layout PlainLayout
4532 is a keyboard key and
4533 \begin_inset Flex CharStyle:Code
4536 \begin_layout PlainLayout
4543 The following dead keys are supported (shortcut name is in parentheses):
4546 \begin_layout Quotation
4550 \begin_inset Space \hfill{}
4556 \begin_layout Quotation
4558 \begin_inset Space \hfill{}
4564 \begin_layout Quotation
4566 \begin_inset Space \hfill{}
4572 \begin_layout Quotation
4574 \begin_inset Space \hfill{}
4580 \begin_layout Quotation
4582 \begin_inset Space \hfill{}
4588 \begin_layout Quotation
4590 \begin_inset Space \hfill{}
4597 \begin_layout PlainLayout
4609 \begin_layout Quotation
4611 \begin_inset Space \hfill{}
4617 \begin_layout Quotation
4619 \begin_inset Space \hfill{}
4626 \begin_layout PlainLayout
4638 \begin_layout Quotation
4640 \begin_inset Space \hfill{}
4646 \begin_layout Quotation
4648 \begin_inset Space \hfill{}
4654 \begin_layout Quotation
4656 \begin_inset Space \hfill{}
4663 \begin_layout PlainLayout
4675 \begin_layout Quotation
4677 \begin_inset Space \hfill{}
4684 \begin_layout PlainLayout
4696 \begin_layout Quotation
4698 \begin_inset Space \hfill{}
4704 \begin_layout Quotation
4705 hungarian umlaut (hug)
4706 \begin_inset Space \hfill{}
4712 \begin_layout Quotation
4714 \begin_inset Space \hfill{}
4720 \begin_layout Quotation
4722 \begin_inset Space \hfill{}
4729 \begin_layout PlainLayout
4741 \begin_layout Standard
4742 Since in many international keyboards there are exceptions to what some
4743 dead keys should do, you can define them using
4746 \begin_layout Quotation
4747 \begin_inset Flex CharStyle:Code
4750 \begin_layout PlainLayout
4758 deadkey key outstring
4761 \begin_layout Standard
4762 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
4766 \begin_layout Quotation
4767 \begin_inset Flex CharStyle:Code
4770 \begin_layout PlainLayout
4783 \begin_layout Standard
4784 to make it work correctly.
4785 Also, you have to define as exceptions dead keys over i and j, to remove
4786 the dot from them before inserting an accent mark.
4787 I will change this when the time comes, but so far I haven't had time.
4790 \begin_layout Standard
4791 Oh, and about characters: backslash is escaped, so to enter it, you'll need
4794 \begin_inset Flex CharStyle:Code
4797 \begin_layout PlainLayout
4803 have different meaning.
4805 \begin_inset Flex CharStyle:Code
4808 \begin_layout PlainLayout
4814 marks comments, quotes start and end LaTeX-style commands.
4815 To enter quote, you'll need to use
4816 \begin_inset Flex CharStyle:Code
4819 \begin_layout PlainLayout
4828 \begin_inset Flex CharStyle:Code
4831 \begin_layout PlainLayout
4838 \begin_inset Flex CharStyle:Code
4841 \begin_layout PlainLayout
4852 \begin_layout Standard
4853 If you make a keyboard description file that works for your language, please
4854 mail it to me, so I can include it in the next keymap distribution.
4857 \begin_layout Standard
4858 More keywords will be supported in keymap configuration file in future,
4862 \begin_layout Itemize
4863 \begin_inset Flex CharStyle:Code
4866 \begin_layout PlainLayout
4877 \begin_inset Space \hfill{}
4881 \begin_inset Flex CharStyle:Code
4884 \begin_layout PlainLayout
4893 \begin_layout Itemize
4894 \begin_inset Flex CharStyle:Code
4897 \begin_layout PlainLayout
4908 \begin_inset Space \hfill{}
4912 \begin_inset Flex CharStyle:Code
4915 \begin_layout PlainLayout
4921 an external keymap translation program
4924 \begin_layout Standard
4925 Also, it should look into
4926 \begin_inset Flex CharStyle:Code
4929 \begin_layout PlainLayout
4935 file for defaults, too (for example, a
4936 \begin_inset Flex CharStyle:Code
4939 \begin_layout PlainLayout
4947 option to include default keyboard).
4955 \begin_layout Section
4956 \begin_inset CommandInset label
4962 International Keymap Stuff
4965 \begin_layout Standard
4966 \begin_inset Note Note
4969 \begin_layout PlainLayout
4970 In doing the revisions on this document in March 2008, I did not look over
4971 this stuff, as I do not understand it.
4972 It would be good if someone else could do so.
4980 \begin_layout Standard
4981 The next two sections describe the
4982 \begin_inset Flex CharStyle:Code
4985 \begin_layout PlainLayout
4994 \begin_inset Flex CharStyle:Code
4997 \begin_layout PlainLayout
5005 file syntax in detail.
5006 These sections should help you design your own key map if the ones provided
5007 do not meet your needs.
5010 \begin_layout Subsection
5014 \begin_layout Standard
5018 \begin_inset Flex CharStyle:Code
5021 \begin_layout PlainLayout
5027 file maps keystrokes to characters or strings.
5028 As the name suggests, it sets a keyboard mapping.
5030 \begin_inset Flex CharStyle:Code
5033 \begin_layout PlainLayout
5044 \begin_inset Flex CharStyle:Code
5047 \begin_layout PlainLayout
5062 \begin_inset Flex CharStyle:Code
5065 \begin_layout PlainLayout
5078 \begin_inset Flex CharStyle:Code
5081 \begin_layout PlainLayout
5090 \begin_inset Flex CharStyle:Code
5093 \begin_layout PlainLayout
5101 are described in this section.
5105 \labelwidthstring 00.00.0000
5106 \begin_inset Flex CharStyle:Code
5109 \begin_layout PlainLayout
5117 Map a character to a string
5120 \begin_layout LyX-Code
5135 \begin_layout Standard
5168 the double-quote (")
5185 must be escaped with a preceding backslash (
5196 \begin_layout Standard
5198 \begin_inset Flex CharStyle:MenuItem
5201 \begin_layout PlainLayout
5209 statement to cause the symbol
5210 \begin_inset Flex CharStyle:MenuItem
5213 \begin_layout PlainLayout
5221 to be output for the keystroke
5222 \begin_inset Flex CharStyle:MenuItem
5225 \begin_layout PlainLayout
5236 \begin_layout LyX-Code
5243 \labelwidthstring 00.00.0000
5244 \begin_inset Flex CharStyle:Code
5247 \begin_layout PlainLayout
5255 Specify an accent character
5258 \begin_layout LyX-Code
5267 \begin_layout Standard
5268 This will make the cha
5306 This is the dead key
5310 \begin_layout PlainLayout
5317 refers to a key that does not produce a character by itself, but when followed
5318 with another key, produces the desired accent character.
5319 For example, a German characte
5321 r with an umlaut like
5331 can be produced in this manner.
5340 \begin_layout Standard
5353 and then another key not in
5370 followed by the other, unallowed key, as output.
5374 \begin_inset Flex CharStyle:MenuItem
5377 \begin_layout PlainLayout
5385 cancels a dead key, so if
5396 \begin_inset Flex CharStyle:MenuItem
5399 \begin_layout PlainLayout
5408 , the cursor will not go one position backwards but will instead cancel
5424 might have had on the next keystroke.
5428 \begin_layout Standard
5429 The following example specifies that the character ' is to be an acute accent,
5430 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
5433 \begin_layout LyX-Code
5436 kmod ' acute aeiouAEIOU
5440 \labelwidthstring 00.00.0000
5441 \begin_inset Flex CharStyle:Code
5444 \begin_layout PlainLayout
5450 Specify an exception to the accent character
5453 \begin_layout LyX-Code
5462 \begin_layout Standard
5463 This defines an exce
5504 have been assigned a keystroke with a previous
5507 \begin_inset Flex CharStyle:Code
5510 \begin_layout PlainLayout
5534 must not belong in the
5586 If such a declaration does not exist in
5594 \begin_inset Flex CharStyle:Code
5597 \begin_layout PlainLayout
5637 \begin_inset Flex CharStyle:Code
5640 \begin_layout PlainLayout
5654 \begin_layout Standard
5655 The following command produces causes äi to be produced when you enter acute-i
5659 \begin_layout LyX-Code
5674 \labelwidthstring 00.00.0000
5675 \begin_inset Flex CharStyle:Code
5678 \begin_layout PlainLayout
5684 Combine two accent characters
5687 \begin_layout LyX-Code
5693 accent1 accent2 allowed
5696 \begin_layout Standard
5697 This one is getting pretty esoteric.
5698 It allows you to combine the effect
5754 \begin_inset Flex CharStyle:Code
5757 \begin_layout PlainLayout
5785 \begin_layout Standard
5786 Consider this example from the
5787 \begin_inset Flex CharStyle:Code
5790 \begin_layout PlainLayout
5801 \begin_layout LyX-Code
5804 kmod ; acute aeioyvhAEIOYVH
5808 kcomb acute umlaut iyIY
5811 \begin_layout Standard
5812 This allows you to press
5813 \begin_inset Flex CharStyle:MenuItem
5816 \begin_layout PlainLayout
5824 and get the effect of
5825 \begin_inset Flex CharStyle:Code
5828 \begin_layout PlainLayout
5847 in this case cancels the last dead key, so if you press
5848 \begin_inset Flex CharStyle:MenuItem
5851 \begin_layout PlainLayout
5860 \begin_inset Flex CharStyle:Code
5863 \begin_layout PlainLayout
5876 \begin_layout Subsection
5880 \begin_layout Standard
5882 \begin_inset Flex CharStyle:Code
5885 \begin_layout PlainLayout
5893 mapping is performed, a
5894 \begin_inset Flex CharStyle:Code
5897 \begin_layout PlainLayout
5907 file maps the strings that the symbols generate to characters in the current
5909 The LyX distribution currently includes at least the
5910 \begin_inset Flex CharStyle:Code
5913 \begin_layout PlainLayout
5922 \begin_inset Flex CharStyle:Code
5925 \begin_layout PlainLayout
5936 \begin_layout Standard
5938 \begin_inset Flex CharStyle:Code
5941 \begin_layout PlainLayout
5949 file is a sequence of declarations of the form
5952 \begin_layout LyX-Code
5965 \begin_layout Standard
5966 For example, in order to map
5967 \begin_inset Flex CharStyle:MenuItem
5970 \begin_layout PlainLayout
5980 to the corresponding character in the iso-8859-1 set (233), the following
5984 \begin_layout LyX-Code
5992 \begin_layout Standard
5994 \begin_inset Flex CharStyle:Code
5997 \begin_layout PlainLayout
6006 \begin_inset Flex CharStyle:Code
6009 \begin_layout PlainLayout
6027 the same character can apply to more than one string.
6029 \begin_inset Flex CharStyle:Code
6032 \begin_layout PlainLayout
6043 \begin_layout LyX-Code
6069 \begin_layout Standard
6070 If LyX cannot find a mapping for the string produced by the keystroke or
6071 a deadkey sequence, it will check if it looks like an accented char and
6072 try to draw an accent over the character on screen.
6075 \begin_layout Subsection
6079 \begin_layout Standard
6080 There is a second way to add support for international characters through
6081 so-called dead-keys.
6082 A dead-key works in combination with a letter to produce an accented character.
6083 Here, we'll explain how to create a really simple dead-key to illustrate
6087 \begin_layout Standard
6088 Suppose you happen to need the circumflex character,
6089 \begin_inset Quotes eld
6093 \begin_inset Quotes erd
6098 \begin_inset Flex CharStyle:MenuItem
6101 \begin_layout PlainLayout
6108 \begin_inset Space ~
6112 \begin_inset Flex CharStyle:MenuItem
6115 \begin_layout PlainLayout
6121 ] to the LyX command
6122 \begin_inset Flex CharStyle:Code
6125 \begin_layout PlainLayout
6132 \begin_inset Flex CharStyle:Code
6135 \begin_layout PlainLayout
6142 Now, whenever you type the
6143 \begin_inset Flex CharStyle:MenuItem
6146 \begin_layout PlainLayout
6152 -key followed by a letter, that letter will have a circumflex accent on
6154 For example, the sequence
6155 \begin_inset Quotes eld
6159 \begin_inset Flex CharStyle:MenuItem
6162 \begin_layout PlainLayout
6169 \begin_inset Quotes erd
6172 produces the letter:
6173 \begin_inset Quotes eld
6177 \begin_inset Quotes erd
6181 If you tried to type
6182 \begin_inset Quotes eld
6186 \begin_inset Flex CharStyle:MenuItem
6189 \begin_layout PlainLayout
6196 \begin_inset Quotes erd
6199 , however, LyX will complain with a beep, since a
6200 \begin_inset Quotes eld
6204 \begin_inset Flex CharStyle:MenuItem
6207 \begin_layout PlainLayout
6214 \begin_inset Quotes erd
6217 never takes a circumflex accent.
6219 \begin_inset Flex CharStyle:MenuItem
6222 \begin_layout PlainLayout
6228 after a dead-key produces the bare-accent.
6229 Please note this last point! If you bind a key to a dead-key, you'll need
6230 to rebind the character on that key to yet another key.
6232 \begin_inset Flex CharStyle:MenuItem
6235 \begin_layout PlainLayout
6241 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
6244 \begin_layout Standard
6245 One common way to bind dead-keys is to use
6246 \begin_inset Flex CharStyle:MenuItem
6249 \begin_layout PlainLayout
6256 \begin_inset Flex CharStyle:MenuItem
6259 \begin_layout PlainLayout
6266 \begin_inset Flex CharStyle:MenuItem
6269 \begin_layout PlainLayout
6275 in combination with an accent, like
6276 \begin_inset Quotes eld
6280 \begin_inset Flex CharStyle:MenuItem
6283 \begin_layout PlainLayout
6290 \begin_inset Quotes erd
6294 \begin_inset Quotes eld
6298 \begin_inset Flex CharStyle:MenuItem
6301 \begin_layout PlainLayout
6308 \begin_inset Quotes erd
6312 \begin_inset Quotes eld
6316 \begin_inset Flex CharStyle:MenuItem
6319 \begin_layout PlainLayout
6326 \begin_inset Quotes erd
6330 Another way involves using
6331 \begin_inset Flex CharStyle:Code
6334 \begin_layout PlainLayout
6341 \begin_inset Flex CharStyle:Code
6344 \begin_layout PlainLayout
6350 to set up the special
6351 \begin_inset Flex CharStyle:Code
6354 \begin_layout PlainLayout
6362 \begin_inset Flex CharStyle:Code
6365 \begin_layout PlainLayout
6371 acts in some ways just like
6372 \begin_inset Flex CharStyle:MenuItem
6375 \begin_layout PlainLayout
6381 and permits you to bind keys to accented characters.
6382 You can also turn keys into dead-keys by binding them to something like
6384 \begin_inset Flex CharStyle:Code
6387 \begin_layout PlainLayout
6393 and then binding this symbolic key to the corresponding LyX command.
6397 \begin_layout PlainLayout
6402 : This is exactly what I do in my
6403 \begin_inset Flex CharStyle:Code
6406 \begin_layout PlainLayout
6413 \begin_inset Flex CharStyle:Code
6416 \begin_layout PlainLayout
6424 \begin_inset Flex CharStyle:MenuItem
6427 \begin_layout PlainLayout
6429 \begin_inset Space ~
6438 \begin_inset Flex CharStyle:Code
6441 \begin_layout PlainLayout
6447 and a bunch of these
6448 \begin_inset Quotes eld
6452 \begin_inset Flex CharStyle:Code
6455 \begin_layout PlainLayout
6462 \begin_inset Quotes erd
6465 symbolic keys bound such things as
6466 \begin_inset Flex CharStyle:MenuItem
6469 \begin_layout PlainLayout
6471 \begin_inset Space ~
6480 \begin_inset Flex CharStyle:MenuItem
6483 \begin_layout PlainLayout
6485 \begin_inset Space ~
6494 This is how I produce my accented characters.
6499 You can make just about anything into the
6500 \begin_inset Flex CharStyle:Code
6503 \begin_layout PlainLayout
6510 \begin_inset Flex CharStyle:MenuItem
6513 \begin_layout PlainLayout
6519 keys, a spare function key, etc.
6520 As for the LyX commands that produce accents, check the entry for
6521 \begin_inset Flex CharStyle:Code
6524 \begin_layout PlainLayout
6535 You'll find the complete list there.
6538 \begin_layout Subsection
6539 Saving your Language Configuration
6542 \begin_layout Standard
6543 \begin_inset CommandInset label
6549 You can edit your preferences so that your desired language environment
6550 is automatically configured when LyX starts up, via the
6551 \begin_inset Flex CharStyle:MenuItem
6554 \begin_layout PlainLayout
6559 dit\SpecialChar \menuseparator
6572 \begin_layout Chapter
6573 Installing New Document Classes, Layouts, and Templates
6574 \begin_inset CommandInset label
6576 name "chap:textclass"
6584 \begin_layout PlainLayout
6585 Installing New Document Classes
6593 \begin_layout Standard
6594 In this chapter, we describe the procedures for creating and installing
6595 new LyX layout and template files, as well as offer a refresher on correctly
6596 installing new LaTeX document classes.
6597 Some definitions: a document class is a LaTeX file (usually ending in
6598 \begin_inset Flex CharStyle:Code
6601 \begin_layout PlainLayout
6608 \begin_inset Flex CharStyle:Code
6611 \begin_layout PlainLayout
6617 ) that describes the format of a document such as an article, report, journal
6618 preprint, etc, and all the commands needed to realize that format.
6619 A layout file is a LyX file that corresponds to a LaTeX document class
6620 and that tells LyX how to
6621 \begin_inset Quotes eld
6625 \begin_inset Quotes erd
6628 things on the screen to make the display look something like the final
6630 More precisely, a layout file describes a
6631 \begin_inset Quotes eld
6635 \begin_inset Quotes erd
6638 which is the internal construct LyX uses to render the screen display.
6640 \begin_inset Quotes eld
6644 \begin_inset Quotes erd
6648 \begin_inset Quotes eld
6652 \begin_inset Quotes erd
6655 can be used somewhat interchangeably, but it is better to refer to the
6656 file as the layout, and the thing living in LyX's memory as the text class.
6657 A template file is simply a LyX document that contains a set of predefined
6658 entries for a given document class---entries that are generally required
6660 Templates are especially useful for things like journal manuscripts that
6661 are to be submitted electronically.
6664 \begin_layout Section
6665 Installing a new LaTeX package
6668 \begin_layout Standard
6669 Some installations may not include a LaTeX package that you would like to
6671 For example, you might need FoilTeX, a common (and very powerful) package
6672 for preparing slides or viewgraphs for overhead projectors.
6673 On some systems, you may have a GUI for installing such packages: MikTeX
6674 on Windows®, for example.
6677 \begin_layout Standard
6678 If you don't have such a GUI, then you can follow these steps.
6681 \begin_layout Enumerate
6682 Get the package from
6683 \begin_inset CommandInset href
6686 target "http://www.ctan.org/"
6693 \begin_layout Enumerate
6694 You can install this package in several different places.
6695 If you want it to be available for all users on your system, then you should
6696 install it in your `local' TeX tree; if you want (or need) it to be available
6697 just for you, then you can install it in your own `user' TeX tree.
6698 Where these should be created, if they do not already exist, depends upon
6699 the details of your system.
6700 To find out, look in the file
6701 \begin_inset Flex CharStyle:Code
6704 \begin_layout PlainLayout
6714 \begin_layout PlainLayout
6715 This usually lives in the directory
6716 \begin_inset Flex CharStyle:Code
6719 \begin_layout PlainLayout
6725 , though you can run
6726 \begin_inset Flex CharStyle:Code
6729 \begin_layout PlainLayout
6740 The location of the `local' TeX tree is defined by
6741 \begin_inset Flex CharStyle:Code
6744 \begin_layout PlainLayout
6750 ; this is usually somewhere like
6751 \begin_inset Flex CharStyle:Code
6754 \begin_layout PlainLayout
6755 /usr/local/share/texmf/
6761 The `user' TeX tree is defined by
6762 \begin_inset Flex CharStyle:Code
6765 \begin_layout PlainLayout
6772 \begin_inset Flex CharStyle:Code
6775 \begin_layout PlainLayout
6782 (If these variables are not predefined, you can define them.) You'll probably
6783 need root permissions to create or modify the `local' tree; but your `user'
6784 tree shouldn't have such limitations.
6787 \begin_layout Enumerate
6789 \begin_inset Flex CharStyle:Code
6792 \begin_layout PlainLayout
6799 \begin_inset Flex CharStyle:Code
6802 \begin_layout PlainLayout
6809 \begin_inset Flex CharStyle:Code
6812 \begin_layout PlainLayout
6822 \begin_inset Flex CharStyle:Code
6825 \begin_layout PlainLayout
6826 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
6833 But, again, most of this will
6834 \begin_inset Quotes eld
6838 \begin_inset Quotes erd
6844 \begin_layout Enumerate
6849 \begin_layout PlainLayout
6850 We'll assume henceforth that you're defining `local' TeX tree.
6851 If you're defining a user tree, just adjust as necessary.
6857 You must follow the directory structure of your existing
6858 \begin_inset Flex CharStyle:Code
6861 \begin_layout PlainLayout
6867 directory, which will be found at
6868 \begin_inset Flex CharStyle:Code
6871 \begin_layout PlainLayout
6878 For example, latex packages should go under
6879 \begin_inset Flex CharStyle:Code
6882 \begin_layout PlainLayout
6883 $TEXMFLOCAL/tex/latex/
6891 \begin_layout Enumerate
6892 Install the package.
6893 For example, you would unpack the FoilTeX tarball and copy it to
6894 \begin_inset Flex CharStyle:Code
6897 \begin_layout PlainLayout
6898 $TEXMFLOCAL/tex/latex/foiltex
6905 \begin_inset Flex CharStyle:Code
6908 \begin_layout PlainLayout
6914 directory contains various files.
6917 \begin_layout Enumerate
6919 \begin_inset Flex CharStyle:Code
6922 \begin_layout PlainLayout
6930 \begin_inset Flex CharStyle:Code
6933 \begin_layout PlainLayout
6942 \begin_layout Standard
6943 Your package is now installed and available to LaTeX.
6944 To make it available to LyX, you need to create a Layout file, if one is
6945 not already available.
6946 (See the next section.) Once you have a layout file, you need only reconfigure
6948 \begin_inset Flex CharStyle:MenuItem
6951 \begin_layout PlainLayout
6956 ools\SpecialChar \menuseparator
6966 ) and then restart LyX.
6967 You should then see your new package---for example
6968 \begin_inset Flex CharStyle:MenuItem
6971 \begin_layout PlainLayout
6978 \begin_inset Flex CharStyle:MenuItem
6981 \begin_layout PlainLayout
6986 ocument\SpecialChar \menuseparator
6997 \begin_inset Flex CharStyle:MenuItem
7000 \begin_layout PlainLayout
7010 \begin_layout Section
7011 \begin_inset CommandInset label
7020 \begin_layout Standard
7021 This section describes how to write and install your own LyX layout files
7022 and walks through the
7023 \begin_inset Flex CharStyle:Code
7026 \begin_layout PlainLayout
7032 text class format as an example.
7034 \begin_inset Flex CharStyle:Code
7037 \begin_layout PlainLayout
7043 files describe what paragraph and character styles are available for a
7044 given document class and how LyX should display them.
7045 We try to provide a thorough description of the process here; however,
7046 there are so many different types of documents supported by LaTeX classes
7047 that we can't hope to cover every different possibility or problem you
7049 (The LyX users' list is frequented by people with lots of experience with
7050 layout design who are willing to share what they've learned.)
7053 \begin_layout Standard
7054 As you prepare to write a new layout, it is extremely helpful to look at
7055 the example layouts distributed with LyX.
7056 If you use a nice LaTeX document class that might be of interest for others,
7057 too, and have a nice corresponding LyX layout, feel free to contribute
7058 the stuff to us, so we may put it into the distribution.
7060 \begin_inset CommandInset href
7062 name "section on the LyX wiki"
7063 target "http://wiki.lyx.org/Layouts/Layouts"
7067 for this kind of material.
7070 \begin_layout Standard
7071 All the tags described in this chapter are case-insensitive; this means
7073 \begin_inset Flex CharStyle:Code
7076 \begin_layout PlainLayout
7083 \begin_inset Flex CharStyle:Code
7086 \begin_layout PlainLayout
7093 \begin_inset Flex CharStyle:Code
7096 \begin_layout PlainLayout
7102 are really the same command.
7103 The possible values are printed in brackets after the feature's name.
7104 The default value if a feature isn't specified inside a text class-description
7106 \begin_inset Flex CharStyle:Code
7109 \begin_layout PlainLayout
7118 If the argument has a datatype like
7119 \begin_inset Quotes eld
7123 \begin_inset Quotes erd
7127 \begin_inset Quotes eld
7131 \begin_inset Quotes erd
7134 , the default is shown like this:
7135 \begin_inset Flex CharStyle:Code
7138 \begin_layout PlainLayout
7149 \begin_layout Subsection
7150 \begin_inset CommandInset label
7152 name "sub:Layout-modules"
7159 \begin_layout Standard
7160 Similar to layout files, and new with LyX 1.6, are layout
7165 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
7166 some modules---such as the Endnotes module---provide support for just such
7168 In a sense, layout modules are similar to included files---files like
7169 \begin_inset Flex CharStyle:Code
7172 \begin_layout PlainLayout
7178 ---in that modules are not specific to a given document layout but may be
7179 used with many different layouts.
7180 The difference is that using a layout module does not require editing the
7182 Rather, modules are selected in the
7183 \begin_inset Flex CharStyle:MenuItem
7186 \begin_layout PlainLayout
7191 ocument\SpecialChar \menuseparator
7204 \begin_layout Standard
7205 Building modules is the easiest way to get started with layout editing,
7206 since it can be as simple as adding a single new paragraph or flex inset.
7207 But modules may, in principle, contain anything a layout file can contain.
7210 \begin_layout Standard
7211 A module must begin with a line like the following:
7214 \begin_layout LyX-Code
7217 DeclareLyXModule[endnotes.sty]{Endnotes}
7220 \begin_layout Standard
7221 The argument in square brackets is optional: It declares any LaTeX packages
7222 on which the module depends.
7223 The mandatory argument, in curly brackets, is the name of the module, as
7225 \begin_inset Flex CharStyle:MenuItem
7228 \begin_layout PlainLayout
7229 Document\SpecialChar \menuseparator
7239 \begin_layout Standard
7240 The module declaration should then be followed by lines like the following:
7243 \begin_layout LyX-Code
7247 \begin_layout LyX-Code
7248 #Adds an endnote command, in addition to footnotes.
7252 \begin_layout LyX-Code
7253 #You will need to add
7255 theendnotes in ERT where you
7258 \begin_layout LyX-Code
7259 #want the endnotes to appear.
7263 \begin_layout LyX-Code
7267 \begin_layout LyX-Code
7268 #Requires: somemodule | othermodule
7271 \begin_layout LyX-Code
7272 #Excludes: badmodule
7275 \begin_layout Standard
7276 The description is used in
7277 \begin_inset Flex CharStyle:MenuItem
7280 \begin_layout PlainLayout
7281 Document\SpecialChar \menuseparator
7287 to provide the user with information about what the module does.
7289 \begin_inset Flex CharStyle:Code
7292 \begin_layout PlainLayout
7298 line is used to identify other modules with which this one must be used;
7300 \begin_inset Flex CharStyle:Code
7303 \begin_layout PlainLayout
7309 line is used to identify modules with which this one may not be used.
7310 Both are optional, and, as shown, multiple modules should be separated
7311 with the pipe symbol: |.
7312 Note that the required modules are treated disjunctively:
7316 of the required modules must be used.
7321 excluded module may be used.
7322 Note that modules are identified here by their
7326 without the .module extension.
7328 \begin_inset Flex CharStyle:Code
7331 \begin_layout PlainLayout
7338 \begin_inset Flex CharStyle:Code
7341 \begin_layout PlainLayout
7350 \begin_layout Standard
7351 After creating a new module, you will need to reconfigure and then restart
7352 LyX for the module to appear in the menu.
7353 However, changes you make to the module will be seen immediately, if you
7355 \begin_inset Flex CharStyle:MenuItem
7358 \begin_layout PlainLayout
7359 Document\SpecialChar \menuseparator
7365 , highlight something, and then hit
7366 \begin_inset Quotes eld
7370 \begin_inset Quotes erd
7376 It is strongly recommended that you save your work before doing so
7381 it is strongly recommended that you not attempt to edit modules while simultaneo
7382 usly working on documents
7385 Though of course the developers strive to keep LyX stable in such situations,
7386 syntax errors and the like in your module file could cause strange behavior.
7389 \begin_layout Subsection
7390 Supporting new document classes
7393 \begin_layout Standard
7394 There are two situations you are likely to encounter when wanting to support
7395 a new LaTeX document class, involving LaTeX2e class (
7396 \begin_inset Flex CharStyle:Code
7399 \begin_layout PlainLayout
7406 \begin_inset Flex CharStyle:Code
7409 \begin_layout PlainLayout
7416 Supporting a style file is usually fairly easy.
7417 Supporting a new document class is a bit harder.
7420 \begin_layout Subsection
7422 \begin_inset Flex CharStyle:MenuItem
7425 \begin_layout PlainLayout
7434 \begin_layout Standard
7435 If your new document class is provided as a style file that is used in conjuncti
7436 on with an existing, supported document class---for the sake of the example,
7437 we'll assume that the style file is called
7438 \begin_inset Flex CharStyle:MenuItem
7441 \begin_layout PlainLayout
7447 and it is meant to be used with
7448 \begin_inset Flex CharStyle:MenuItem
7451 \begin_layout PlainLayout
7457 , which is a standard class---start by copying the existing class's layout
7458 file into your local directory:
7461 \begin_layout LyX-Code
7462 cp report.layout ~/.lyx/layouts/myclass.layout
7465 \begin_layout Standard
7467 \begin_inset Flex CharStyle:Code
7470 \begin_layout PlainLayout
7476 and change the line:
7479 \begin_layout LyX-Code
7482 DeclareLaTeXClass{report}
7485 \begin_layout Standard
7489 \begin_layout LyX-Code
7492 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
7495 \begin_layout Standard
7499 \begin_layout LyX-Code
7509 \begin_layout Standard
7510 near the top of the file.
7513 \begin_layout Standard
7514 Start LyX and select
7515 \begin_inset Flex CharStyle:MenuItem
7518 \begin_layout PlainLayout
7523 ools\SpecialChar \menuseparator
7534 Then restart LyX and try creating a new document.
7536 \begin_inset Flex CharStyle:MenuItem
7539 \begin_layout PlainLayout
7545 " as a document class option in the
7546 \begin_inset Flex CharStyle:MenuItem
7549 \begin_layout PlainLayout
7554 ocument\SpecialChar \menuseparator
7565 It is likely that some of the sectioning commands and such in your new
7566 class will work differently from how they worked in the base class---
7567 \begin_inset Flex CharStyle:Code
7570 \begin_layout PlainLayout
7576 in this example---so you can fiddle around with the settings for the different
7577 sections if you wish.
7580 \begin_layout Subsection
7582 \begin_inset Flex CharStyle:MenuItem
7585 \begin_layout PlainLayout
7594 \begin_layout Standard
7595 There are two possibilities here.
7596 One is that the class file is itself based upon an existing document class.
7597 For example, many thesis classes are based upon
7598 \begin_inset Flex CharStyle:MenuItem
7601 \begin_layout PlainLayout
7608 To see whether yours is, look for a line like
7611 \begin_layout LyX-Code
7617 \begin_layout Standard
7619 If so, then you may proceed largely as in the previous section, though
7620 the DeclareLaTeXClass line will be different.
7621 If your new class is thesis, and it is based upon book, then the line should
7626 \begin_layout PlainLayout
7627 And it will be easiest if you save the file to
7628 \begin_inset Flex CharStyle:Code
7631 \begin_layout PlainLayout
7637 : LyX assumes that the document class has the same name as the layout file.
7646 \begin_layout LyX-Code
7649 DeclareLaTeXClass[thesis,book]{thesis}
7652 \begin_layout Standard
7653 If, on the other hand, the new class is not based upon an existing class,
7654 you will probably have to
7655 \begin_inset Quotes eld
7659 \begin_inset Quotes erd
7663 We strongly suggest copying an existing layout file which uses a similar
7664 LaTeX class and then modifying it, if you can do so.
7665 At least use an existing file as a starting point so you can find out what
7666 items you need to worry about.
7667 Again, the specifics are covered below.
7670 \begin_layout Section
7671 Declaring a new text class
7674 \begin_layout Standard
7675 When it's finally time to get your hands dirty and create or edit your own
7676 layout file, the following sections describe what you're up against.
7677 Our advice is to go slowly, save and test often, listen to soothing music,
7678 and enjoy one or two of your favorite adult beverages; more if you are
7679 getting particularly stuck.
7680 It's really not that hard, except that the multitude of options can become
7681 overwhelming if you try to do to much in one sitting.
7682 Go have another adult beverage, just for good measure.
7685 \begin_layout Standard
7689 \begin_layout Standard
7690 Lines in a layout file which begin with a
7691 \begin_inset Flex CharStyle:Code
7694 \begin_layout PlainLayout
7701 There is one exception to this rule: all layouts should begin with lines
7705 \begin_layout LyX-Code
7708 #% Do not delete the line below; configure depends on this
7711 \begin_layout LyX-Code
7716 DeclareLaTeXClass{article}
7719 \begin_layout Standard
7720 The second line is used when you configure LyX.
7721 The layout file is read by the LaTeX script
7722 \begin_inset Flex CharStyle:Code
7725 \begin_layout PlainLayout
7731 , in a special mode where
7732 \begin_inset Flex CharStyle:Code
7735 \begin_layout PlainLayout
7742 The first line is just a LaTeX comment, and the second one contains the
7743 declaration of the text class.
7744 If these lines appear in a file named
7745 \begin_inset Flex CharStyle:Code
7748 \begin_layout PlainLayout
7754 , then they define a text class of name
7755 \begin_inset Flex CharStyle:Code
7758 \begin_layout PlainLayout
7764 (the name of the layout file) which uses the LaTeX document class
7765 \begin_inset Flex CharStyle:Code
7768 \begin_layout PlainLayout
7774 (the default is to use the same name as the layout).
7776 \begin_inset Quotes eld
7780 \begin_inset Quotes erd
7783 that appears above is used as a description of the text class in the
7784 \begin_inset Flex CharStyle:MenuItem
7787 \begin_layout PlainLayout
7792 ocument\SpecialChar \menuseparator
7805 \begin_layout Standard
7806 Let's assume that you wrote your own text class that uses the
7807 \begin_inset Flex CharStyle:Code
7810 \begin_layout PlainLayout
7816 document class, but where you changed the appearance of the section headings.
7817 If you put it in a file
7818 \begin_inset Flex CharStyle:Code
7821 \begin_layout PlainLayout
7827 , the header of this file should be:
7830 \begin_layout LyX-Code
7833 #% Do not delete the line below; configure depends on this
7836 \begin_layout LyX-Code
7841 DeclareLaTeXClass[article]{article (with my own headings)}
7844 \begin_layout Standard
7845 This declares a text class
7846 \begin_inset Flex CharStyle:Code
7849 \begin_layout PlainLayout
7855 , associated with the LaTeX document class
7856 \begin_inset Flex CharStyle:Code
7859 \begin_layout PlainLayout
7866 \begin_inset Quotes eld
7869 article (with my own headings)
7870 \begin_inset Quotes erd
7874 If your text class depends on several packages, you can declare it as:
7877 \begin_layout LyX-Code
7880 #% Do not delete the line below; configure depends on this
7883 \begin_layout LyX-Code
7888 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7891 \begin_layout Standard
7892 This indicates that your text class uses the foo.sty package.
7893 Finally, it is also possible to declare classes for DocBook code.
7894 Typical declarations will look like
7897 \begin_layout LyX-Code
7900 #% Do not delete the line below; configure depends on this
7903 \begin_layout LyX-Code
7908 DeclareDocBookClass[article]{SGML (DocBook article)}
7911 \begin_layout Standard
7912 Note that these declarations can also be given an optional parameter declaring
7913 the name of the document class (but not a list).
7916 \begin_layout Standard
7917 So, to be as explicit as possible, the form of the layout declaration is:
7920 \begin_layout LyX-Code
7925 DeclareLaTeXClass[class,package.sty]{layout description}
7928 \begin_layout Standard
7929 The class need only be specified if the name of the LaTeX class file and
7930 the name of the layout file are different; if the name of the classfile
7931 is not specified, then LyX will simply assume that it is the same as the
7932 name of the layout file.
7935 \begin_layout Standard
7936 When the text class has been modified to your taste, all you have to do
7937 is to copy it either to
7938 \begin_inset Flex CharStyle:Code
7941 \begin_layout PlainLayout
7948 \begin_inset Flex CharStyle:Code
7951 \begin_layout PlainLayout
7958 \begin_inset Flex CharStyle:MenuItem
7961 \begin_layout PlainLayout
7966 ools\SpecialChar \menuseparator
7976 , exit LyX and restart it.
7977 Then your new text class should be available along with the others.
7980 \begin_layout Standard
7981 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
7982 you made to your layout files.
7983 As a result, editing layout files could be very time consuming.
7984 Beginning with 1.6, however, you can force a reload of the layout currently
7985 in use by using the LyX function
7986 \begin_inset Flex CharStyle:MenuItem
7989 \begin_layout PlainLayout
7996 There is no default binding for this function---though, of course, you
7997 can bind it to a key yourself (see section
7998 \begin_inset CommandInset ref
8000 reference "sec:bindings"
8005 If you want to use this function, then, you should simply enter it in the
8011 : This is very much an `advanced feature'.
8016 recommended that you save your work before using this function.
8021 recommended that you not attempt to edit your layout while simultaneously
8022 working on a document that you care about.
8023 Use a test document.
8024 Syntax errors and the like in your layout file could cause peculiar behavior.
8025 In particular, such errors could cause LyX to regard the current layout
8026 as invalid and to attempt to switch to some other layout.
8027 The LyX team strives to keep LyX stable in such situations, but safe is
8031 \begin_layout Subsection
8035 \begin_layout Standard
8036 The first non-comment line must contain the file format number:
8039 \begin_layout Description
8040 \begin_inset Flex CharStyle:Code
8043 \begin_layout PlainLayout
8050 \begin_inset Flex CharStyle:Code
8053 \begin_layout PlainLayout
8059 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
8060 don't have an explicit file format).
8061 The file format that is documented here is format 7.
8064 \begin_layout Subsection
8065 General text class parameters
8068 \begin_layout Standard
8069 These are the general parameters which describe the form of the entire document:
8072 \begin_layout Description
8073 \begin_inset Flex CharStyle:Code
8076 \begin_layout PlainLayout
8082 Adds information to the document preamble.
8084 \begin_inset Quotes eld
8088 \begin_inset Flex CharStyle:Code
8091 \begin_layout PlainLayout
8098 \begin_inset Quotes erd
8104 \begin_layout Description
8105 \begin_inset Flex CharStyle:Code
8108 \begin_layout PlainLayout
8114 Describes various global options supported by the document class.
8116 \begin_inset Space ~
8120 \begin_inset CommandInset ref
8122 reference "sec:classoptions"
8128 \begin_inset Quotes eld
8132 \begin_inset Flex CharStyle:Code
8135 \begin_layout PlainLayout
8142 \begin_inset Quotes erd
8148 \begin_layout Description
8149 \begin_inset Flex CharStyle:Code
8152 \begin_layout PlainLayout
8159 \begin_inset Flex CharStyle:Code
8162 \begin_layout PlainLayout
8171 \begin_inset Flex CharStyle:Code
8174 \begin_layout PlainLayout
8180 ] Whether the class should default to having one or two columns.
8181 Can be changed in the
8182 \begin_inset Flex CharStyle:MenuItem
8185 \begin_layout PlainLayout
8190 ocument\SpecialChar \menuseparator
8203 \begin_layout Description
8204 \begin_inset Flex CharStyle:Code
8207 \begin_layout PlainLayout
8213 This sequence defines a new counter.
8215 \begin_inset Space ~
8219 \begin_inset CommandInset ref
8221 reference "sec:counter"
8227 \begin_inset Quotes eld
8231 \begin_inset Flex CharStyle:Code
8234 \begin_layout PlainLayout
8241 \begin_inset Quotes erd
8247 \begin_layout Description
8248 \begin_inset Flex CharStyle:Code
8251 \begin_layout PlainLayout
8257 Sets the default font used to display the document.
8259 \begin_inset Space ~
8263 \begin_inset CommandInset ref
8265 reference "sec:fonts"
8269 for how to declare fonts.
8271 \begin_inset Quotes eld
8275 \begin_inset Flex CharStyle:Code
8278 \begin_layout PlainLayout
8285 \begin_inset Quotes erd
8291 \begin_layout Description
8292 \begin_inset Flex CharStyle:Code
8295 \begin_layout PlainLayout
8302 \begin_inset Flex CharStyle:Code
8305 \begin_layout PlainLayout
8311 ] This is the style that will be assigned to new paragraphs, usually
8312 \begin_inset Flex CharStyle:MenuItem
8315 \begin_layout PlainLayout
8322 This will default to the first defined style if not given, but you are
8323 highly encouraged to use this directive.
8326 \begin_layout Description
8327 \begin_inset Flex CharStyle:Code
8330 \begin_layout PlainLayout
8336 Defines a new float.
8338 \begin_inset Space ~
8342 \begin_inset CommandInset ref
8344 reference "sec:floats"
8350 \begin_inset Quotes eld
8354 \begin_inset Flex CharStyle:Code
8357 \begin_layout PlainLayout
8364 \begin_inset Quotes erd
8370 \begin_layout Description
8371 \begin_inset Flex CharStyle:Code
8374 \begin_layout PlainLayout
8380 As its name implies, this command allows you to include another layout
8381 definition file within yours to avoid duplicating commands.
8382 Common examples are the standard layout files, for example,
8383 \begin_inset Flex CharStyle:Code
8386 \begin_layout PlainLayout
8392 , which contains most of the basic layouts.
8395 \begin_layout Description
8396 \begin_inset Flex CharStyle:Code
8399 \begin_layout PlainLayout
8405 This section (re-)defines the layout of an inset.
8406 It can be applied to an existing inset of to a new, user-defined inset,
8407 e.g., a new character style.
8409 \begin_inset Space ~
8413 \begin_inset CommandInset ref
8415 reference "sec:charstyle"
8419 for more information.
8421 \begin_inset Quotes eld
8425 \begin_inset Flex CharStyle:Code
8428 \begin_layout PlainLayout
8435 \begin_inset Quotes erd
8441 \begin_layout Description
8442 \begin_inset Flex CharStyle:Code
8445 \begin_layout PlainLayout
8454 \begin_layout Description
8455 \begin_inset Flex CharStyle:Code
8458 \begin_layout PlainLayout
8464 This command deletes an existing float.
8465 This is particularly useful when you want to suppress a float that has
8466 be defined in an input file.
8469 \begin_layout Description
8470 \begin_inset Flex CharStyle:Code
8473 \begin_layout PlainLayout
8479 This command deletes an existing style.
8480 This is particularly useful when you want to suppress a style that has
8481 be defined in an input file.
8484 \begin_layout Description
8485 \begin_inset Flex CharStyle:Code
8488 \begin_layout PlainLayout
8497 \begin_layout Description
8498 \begin_inset Flex CharStyle:Code
8501 \begin_layout PlainLayout
8512 \begin_inset Flex CharStyle:Code
8515 \begin_layout PlainLayout
8526 \begin_inset Flex CharStyle:Code
8529 \begin_layout PlainLayout
8536 \begin_inset Flex CharStyle:Code
8539 \begin_layout PlainLayout
8545 ] The class default pagestyle.
8546 Can be changed in the
8547 \begin_inset Flex CharStyle:MenuItem
8550 \begin_layout PlainLayout
8555 ocument\SpecialChar \menuseparator
8568 \begin_layout Description
8569 \begin_inset Flex CharStyle:Code
8572 \begin_layout PlainLayout
8578 Sets the preamble for the LaTeX document.
8579 Note that this will completely override any prior
8580 \begin_inset Flex CharStyle:Code
8583 \begin_layout PlainLayout
8590 \begin_inset Flex CharStyle:Code
8593 \begin_layout PlainLayout
8601 \begin_inset Quotes eld
8605 \begin_inset Flex CharStyle:Code
8608 \begin_layout PlainLayout
8615 \begin_inset Quotes erd
8621 \begin_layout Description
8622 \begin_inset Flex CharStyle:Code
8625 \begin_layout PlainLayout
8632 \begin_inset CommandInset label
8639 \begin_inset Flex CharStyle:Code
8642 \begin_layout PlainLayout
8649 \begin_inset Flex CharStyle:Code
8652 \begin_layout PlainLayout
8661 \begin_inset Flex CharStyle:Code
8664 \begin_layout PlainLayout
8670 ] Whether the class already provides the feature
8671 \begin_inset Flex CharStyle:Code
8674 \begin_layout PlainLayout
8681 A feature is in general the name of a package (
8682 \begin_inset Flex CharStyle:Code
8685 \begin_layout PlainLayout
8692 \begin_inset Flex CharStyle:Code
8695 \begin_layout PlainLayout
8701 , \SpecialChar \ldots{}
8703 \begin_inset Flex CharStyle:Code
8706 \begin_layout PlainLayout
8713 \begin_inset Flex CharStyle:Code
8716 \begin_layout PlainLayout
8722 ,\SpecialChar \ldots{}
8723 ); the complete list of supported features is unfortunately not documented
8724 outside the LyX source code---but see
8725 \begin_inset Flex CharStyle:Code
8728 \begin_layout PlainLayout
8734 if you're interested.
8736 \begin_inset Flex CharStyle:MenuItem
8739 \begin_layout PlainLayout
8744 elp\SpecialChar \menuseparator
8754 also gives an overview of the supported packages.
8757 \begin_layout Description
8758 \begin_inset Flex CharStyle:Code
8761 \begin_layout PlainLayout
8768 \begin_inset Flex CharStyle:Code
8771 \begin_layout PlainLayout
8777 ] Whether the class requires the feature
8778 \begin_inset Flex CharStyle:Code
8781 \begin_layout PlainLayout
8788 Multiple features must be separated by commas.
8789 Note that you can only request supported features.
8792 \begin_layout Description
8793 \begin_inset Flex CharStyle:Code
8796 \begin_layout PlainLayout
8805 \begin_layout Description
8806 \begin_inset Flex CharStyle:Code
8809 \begin_layout PlainLayout
8818 \begin_layout Description
8819 \begin_inset Flex CharStyle:Code
8822 \begin_layout PlainLayout
8831 \begin_inset Flex CharStyle:Code
8834 \begin_layout PlainLayout
8845 \begin_inset Flex CharStyle:Code
8848 \begin_layout PlainLayout
8854 ] Whether the class-default should be printing on one or both sides of the
8856 Can be changed in the
8857 \begin_inset Flex CharStyle:MenuItem
8860 \begin_layout PlainLayout
8865 ocument\SpecialChar \menuseparator
8878 \begin_layout Description
8879 \begin_inset Flex CharStyle:Code
8882 \begin_layout PlainLayout
8888 This sequence defines a new paragraph style.
8889 If the style already exists, it will redefine some of its parameters instead.
8891 \begin_inset Space ~
8895 \begin_inset CommandInset ref
8897 reference "sec:style"
8903 \begin_inset Quotes eld
8907 \begin_inset Flex CharStyle:Code
8910 \begin_layout PlainLayout
8917 \begin_inset Quotes erd
8923 \begin_layout Description
8924 \begin_inset Flex CharStyle:Code
8927 \begin_layout PlainLayout
8934 \begin_inset Flex CharStyle:Code
8937 \begin_layout PlainLayout
8943 ] The name of the command or environment to be used with
8944 \begin_inset Flex CharStyle:Code
8947 \begin_layout PlainLayout
8956 \begin_layout Description
8957 \begin_inset Flex CharStyle:Code
8960 \begin_layout PlainLayout
8967 \begin_inset Flex CharStyle:Code
8970 \begin_layout PlainLayout
8979 \begin_inset Flex CharStyle:Code
8982 \begin_layout PlainLayout
8988 ] Indicates what kind of markup is used to define the title of a document.
8990 \begin_inset Flex CharStyle:Code
8993 \begin_layout PlainLayout
8999 means that the macro with name
9000 \begin_inset Flex CharStyle:Code
9003 \begin_layout PlainLayout
9009 will be inserted after the last layout which has
9010 \begin_inset Quotes eld
9014 \begin_inset Flex CharStyle:Code
9017 \begin_layout PlainLayout
9024 \begin_inset Quotes erd
9029 \begin_inset Flex CharStyle:Code
9032 \begin_layout PlainLayout
9038 corresponds to the case where the block of paragraphs which have
9039 \begin_inset Quotes eld
9043 \begin_inset Flex CharStyle:Code
9046 \begin_layout PlainLayout
9053 \begin_inset Quotes erd
9056 should be enclosed into the
9057 \begin_inset Flex CharStyle:Code
9060 \begin_layout PlainLayout
9069 \begin_layout Description
9070 \begin_inset Flex CharStyle:Code
9073 \begin_layout PlainLayout
9082 \begin_layout Subsection
9083 \begin_inset Flex CharStyle:Code
9086 \begin_layout PlainLayout
9095 \begin_layout Standard
9096 \begin_inset CommandInset label
9098 name "sec:classoptions"
9103 \begin_inset Flex CharStyle:Code
9106 \begin_layout PlainLayout
9112 section can contain the following entries:
9115 \begin_layout Description
9116 \begin_inset Flex CharStyle:Code
9119 \begin_layout PlainLayout
9126 \begin_inset Flex CharStyle:Code
9129 \begin_layout PlainLayout
9135 ] The list of available font sizes for the document's main font, separated
9137 \begin_inset Quotes eld
9141 \begin_inset Flex CharStyle:Code
9144 \begin_layout PlainLayout
9151 \begin_inset Quotes erd
9157 \begin_layout Description
9158 \begin_inset Flex CharStyle:Code
9161 \begin_layout PlainLayout
9170 \begin_layout Description
9171 \begin_inset Flex CharStyle:Code
9174 \begin_layout PlainLayout
9181 \begin_inset Flex CharStyle:Code
9184 \begin_layout PlainLayout
9185 string="empty|plain|headings|fancy"
9190 ] The list of available page styles, separated by
9191 \begin_inset Quotes eld
9195 \begin_inset Flex CharStyle:Code
9198 \begin_layout PlainLayout
9205 \begin_inset Quotes erd
9211 \begin_layout Description
9212 \begin_inset Flex CharStyle:Code
9215 \begin_layout PlainLayout
9222 \begin_inset Flex CharStyle:Code
9225 \begin_layout PlainLayout
9231 ] Some document class options, separated by a comma, that will be added
9232 to the optional part of the
9233 \begin_inset Flex CharStyle:Code
9236 \begin_layout PlainLayout
9247 \begin_layout Standard
9249 \begin_inset Flex CharStyle:Code
9252 \begin_layout PlainLayout
9258 section must end with
9259 \begin_inset Quotes eld
9263 \begin_inset Flex CharStyle:Code
9266 \begin_layout PlainLayout
9273 \begin_inset Quotes erd
9279 \begin_layout Subsection
9283 \begin_layout Standard
9284 \begin_inset CommandInset label
9290 A paragraph style description looks like this:
9294 \begin_layout PlainLayout
9295 Note that this will either define a new layout or modify an existing one.
9303 \begin_layout LyX-Code
9310 \begin_layout LyX-Code
9314 \begin_layout LyX-Code
9318 \begin_layout Standard
9319 where the following commands are allowed:
9322 \begin_layout Description
9323 \begin_inset Flex CharStyle:Code
9326 \begin_layout PlainLayout
9333 \begin_inset Flex CharStyle:Code
9336 \begin_layout PlainLayout
9341 , left, right, center
9346 ] Paragraph alignment.
9349 \begin_layout Description
9350 \begin_inset Flex CharStyle:Code
9353 \begin_layout PlainLayout
9360 \begin_inset Flex CharStyle:Code
9363 \begin_layout PlainLayout
9368 , left, right, center
9373 ] A comma separated list of permitted alignments.
9374 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9376 For example a right-aligned or centered enumeration isn't possible.)
9379 \begin_layout Description
9380 \begin_inset Flex CharStyle:Code
9383 \begin_layout PlainLayout
9390 \begin_inset Flex CharStyle:Code
9393 \begin_layout PlainLayout
9403 \begin_layout PlainLayout
9404 Note that a `float' here is a real number, such as: 1.5.
9409 The vertical space with which the last of a chain of paragraphs with this
9410 layout is separated from the following paragraph.
9411 If the next paragraph has another layout, the separations are not simply
9412 added, but the maximum is taken.
9415 \begin_layout Description
9416 \begin_inset Flex CharStyle:Code
9419 \begin_layout PlainLayout
9426 \begin_inset Flex CharStyle:Code
9429 \begin_layout PlainLayout
9435 The category for this style.
9436 This is used to group related styles in the Layout combobox on the toolbar.
9437 Any string can be used, but you may want to use existing categories with
9442 \begin_layout Description
9443 \begin_inset Flex CharStyle:Code
9446 \begin_layout PlainLayout
9455 \begin_layout Description
9456 \begin_inset Flex CharStyle:Code
9459 \begin_layout PlainLayout
9466 \begin_inset Flex CharStyle:Code
9469 \begin_layout PlainLayout
9475 Copies all the features of an existing style into the current one.
9479 \begin_layout Description
9480 \begin_inset Flex CharStyle:Code
9483 \begin_layout PlainLayout
9489 The name of a style whose preamble should be output
9494 This allows to ensure some ordering of the preamble snippets when macros
9495 definitions depend on one another.
9499 \begin_layout PlainLayout
9500 Note that, besides that functionality, there is no way to ensure any ordering
9502 The ordering that you see in a given version of LyX may change without
9503 warning in later versions.
9511 \begin_layout Description
9512 \begin_inset Flex CharStyle:Code
9515 \begin_layout PlainLayout
9522 \begin_inset Flex CharStyle:Code
9525 \begin_layout PlainLayout
9530 , Box, Filled_Box, Static
9535 ] The type of label that stands at the end of the paragraph (or sequence
9537 \begin_inset Flex CharStyle:Code
9540 \begin_layout PlainLayout
9547 \begin_inset Flex CharStyle:Code
9550 \begin_layout PlainLayout
9557 \begin_inset Flex CharStyle:Code
9560 \begin_layout PlainLayout
9567 \begin_inset Flex CharStyle:Code
9570 \begin_layout PlainLayout
9578 \begin_inset Flex CharStyle:Code
9581 \begin_layout PlainLayout
9588 \begin_inset Quotes eld
9592 \begin_inset Quotes erd
9596 \begin_inset Flex CharStyle:Code
9599 \begin_layout PlainLayout
9606 \begin_inset Flex CharStyle:Code
9609 \begin_layout PlainLayout
9610 \begin_inset Space ~
9619 \begin_inset Space ~
9622 black) square suitable for end of proof markers,
9623 \begin_inset Flex CharStyle:Code
9626 \begin_layout PlainLayout
9632 is an explicit text string.
9635 \begin_layout Description
9636 \begin_inset Flex CharStyle:Code
9639 \begin_layout PlainLayout
9646 \begin_inset Flex CharStyle:Code
9649 \begin_layout PlainLayout
9655 ] The string used for a label with a
9656 \begin_inset Flex CharStyle:Code
9659 \begin_layout PlainLayout
9666 \begin_inset Flex CharStyle:Code
9669 \begin_layout PlainLayout
9679 \begin_layout Description
9680 \begin_inset Flex CharStyle:Code
9683 \begin_layout PlainLayout
9690 \begin_inset Flex CharStyle:Code
9693 \begin_layout PlainLayout
9704 \begin_inset Flex CharStyle:Code
9707 \begin_layout PlainLayout
9716 \begin_layout Description
9717 \begin_inset Flex CharStyle:Code
9720 \begin_layout PlainLayout
9727 \begin_inset Flex CharStyle:Code
9730 \begin_layout PlainLayout
9740 ] With this parameter the
9741 \begin_inset Flex CharStyle:MenuItem
9744 \begin_layout PlainLayout
9751 \begin_inset Quotes eld
9754 Vertical space above
9755 \begin_inset Quotes erd
9759 \begin_inset Flex CharStyle:MenuItem
9762 \begin_layout PlainLayout
9767 dit\SpecialChar \menuseparator
9773 \begin_inset Space ~
9781 dialog can be set when initializing a paragraph with this style.
9785 \begin_layout PlainLayout
9788 Note from Jean-Marc:
9790 I'm not sure that this setting has much use, and it should probably be
9791 removed in later versions.
9799 \begin_layout Description
9800 \begin_inset Flex CharStyle:Code
9803 \begin_layout PlainLayout
9809 The font used for both the text body
9815 \begin_inset Space ~
9819 \begin_inset CommandInset ref
9821 reference "sec:fonts"
9826 Note that defining this font automatically defines the
9827 \begin_inset Flex CharStyle:Code
9830 \begin_layout PlainLayout
9837 So you should define this one first if you also want to define
9838 \begin_inset Flex CharStyle:Code
9841 \begin_layout PlainLayout
9850 \begin_layout Description
9851 \begin_inset Flex CharStyle:Code
9854 \begin_layout PlainLayout
9861 \begin_inset CommandInset label
9863 name "des:FreeSpacing"
9870 \begin_inset Flex CharStyle:Code
9873 \begin_layout PlainLayout
9884 \begin_inset Flex CharStyle:Code
9887 \begin_layout PlainLayout
9893 ] Usually LyX doesn't allow you to insert more than one space between words,
9894 since a space is considered as the separation between two words, not a
9895 character or symbol of its own.
9896 This is a very fine thing but sometimes annoying, for example, when typing
9897 program code or plain LaTeX code.
9899 \begin_inset Flex CharStyle:Code
9902 \begin_layout PlainLayout
9909 Note that LyX will create protected blanks for the additional blanks when
9910 in another mode than LaTeX-mode.
9913 \begin_layout Description
9914 \begin_inset Flex CharStyle:Code
9917 \begin_layout PlainLayout
9926 \begin_layout Description
9927 \begin_inset Flex CharStyle:Code
9930 \begin_layout PlainLayout
9937 \begin_inset Flex CharStyle:Code
9940 \begin_layout PlainLayout
9946 If 1, marks the layout as being part of a title block (see also the
9947 \begin_inset Flex CharStyle:Code
9950 \begin_layout PlainLayout
9957 \begin_inset Flex CharStyle:Code
9960 \begin_layout PlainLayout
9969 \begin_layout Description
9970 \begin_inset Flex CharStyle:Code
9973 \begin_layout PlainLayout
9980 \begin_inset Flex CharStyle:Code
9983 \begin_layout PlainLayout
9989 ] This provides extra space between paragraphs that have the same layout.
9990 If you put other layouts into an environment, each is separated with the
9992 \begin_inset Flex CharStyle:Code
9995 \begin_layout PlainLayout
10002 But the whole items of the environment are additionally separated with
10004 \begin_inset Flex CharStyle:Code
10007 \begin_layout PlainLayout
10014 Note that this is a
10019 \begin_layout Description
10020 \begin_inset Flex CharStyle:Code
10023 \begin_layout PlainLayout
10032 \begin_layout Description
10033 \begin_inset Flex CharStyle:Code
10036 \begin_layout PlainLayout
10043 \begin_inset CommandInset label
10045 name "des:KeepEmpty"
10052 \begin_inset Flex CharStyle:Code
10055 \begin_layout PlainLayout
10066 \begin_inset Flex CharStyle:Code
10069 \begin_layout PlainLayout
10075 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10076 lead to empty LaTeX output.
10077 There are some cases where this could be desirable however: in a letter
10078 template, the required fields can be provided as empty fields, so that
10079 people do not forget them; in some special classes, a layout can be used
10080 as some kind of break, which does not contain actual text.
10083 \begin_layout Description
10084 \begin_inset Flex CharStyle:Code
10087 \begin_layout PlainLayout
10093 [float=0] The vertical space between the label and the text body.
10094 Only used for labels that are above the text body (
10095 \begin_inset Flex CharStyle:Code
10098 \begin_layout PlainLayout
10105 \begin_inset Flex CharStyle:Code
10108 \begin_layout PlainLayout
10109 Centered_Top_Environment
10117 \begin_layout Description
10118 \begin_inset Flex CharStyle:Code
10121 \begin_layout PlainLayout
10128 \begin_inset Flex CharStyle:Code
10131 \begin_layout PlainLayout
10139 The name of the counter for automatic numbering (see Section
10140 \begin_inset CommandInset ref
10142 reference "sec:counter"
10147 This must be given if
10148 \begin_inset Flex CharStyle:Code
10151 \begin_layout PlainLayout
10158 \begin_inset Flex CharStyle:Code
10161 \begin_layout PlainLayout
10170 \begin_layout Description
10171 \begin_inset Flex CharStyle:Code
10174 \begin_layout PlainLayout
10180 The font used for the label.
10182 \begin_inset Space ~
10186 \begin_inset CommandInset ref
10188 reference "sec:fonts"
10195 \begin_layout Description
10196 \begin_inset Flex CharStyle:Code
10199 \begin_layout PlainLayout
10206 \begin_inset Flex CharStyle:Code
10209 \begin_layout PlainLayout
10215 ] The horizontal space between the label and the text body.
10216 Only used for labels that are not above the text body.
10219 \begin_layout Description
10220 \begin_inset Flex CharStyle:Code
10223 \begin_layout PlainLayout
10230 \begin_inset Flex CharStyle:Code
10233 \begin_layout PlainLayout
10239 ] The string used for a label with a
10240 \begin_inset Flex CharStyle:Code
10243 \begin_layout PlainLayout
10251 \begin_inset Flex CharStyle:Code
10254 \begin_layout PlainLayout
10260 is set, this string can be contain the special formatting commands described
10262 \begin_inset CommandInset ref
10264 reference "sec:counter"
10272 \begin_layout PlainLayout
10273 For the sake of backwards compatibility, the string
10274 \begin_inset Flex CharStyle:Code
10277 \begin_layout PlainLayout
10287 will be replaced by the expanded
10288 \begin_inset Flex CharStyle:Code
10291 \begin_layout PlainLayout
10298 \begin_inset Flex CharStyle:Code
10301 \begin_layout PlainLayout
10310 This feature is now obsolete and should be replaced by the mechanisms of
10312 \begin_inset CommandInset ref
10314 reference "sec:counter"
10326 \begin_layout Description
10327 \begin_inset Flex CharStyle:Code
10330 \begin_layout PlainLayout
10331 LabelStringAppendix
10337 \begin_inset Flex CharStyle:Code
10340 \begin_layout PlainLayout
10346 ] This is used inside the appendix instead of
10347 \begin_inset Flex CharStyle:Code
10350 \begin_layout PlainLayout
10358 \begin_inset Flex CharStyle:Code
10361 \begin_layout PlainLayout
10368 \begin_inset Flex CharStyle:Code
10371 \begin_layout PlainLayout
10372 LabelStringAppendix
10380 \begin_layout Description
10381 \begin_inset Flex CharStyle:Code
10384 \begin_layout PlainLayout
10391 \begin_inset Flex CharStyle:Code
10394 \begin_layout PlainLayout
10399 , Manual, Static, Top_Environment,
10401 Centered_Top_Environment, Sensitive,
10410 \begin_inset Flex CharStyle:Code
10413 \begin_layout PlainLayout
10419 means the label is the very first word (up to the first real blank).
10423 \begin_layout PlainLayout
10424 Use protected spaces if you want more than one word as the label.
10430 \begin_inset Flex CharStyle:Code
10433 \begin_layout PlainLayout
10439 means it is defined in the layout (see
10440 \begin_inset Flex CharStyle:Code
10443 \begin_layout PlainLayout
10451 \begin_inset Flex CharStyle:Code
10454 \begin_layout PlainLayout
10461 \begin_inset Flex CharStyle:Code
10464 \begin_layout PlainLayout
10465 Centered_Top_Environment
10470 are special cases of
10471 \begin_inset Flex CharStyle:Code
10474 \begin_layout PlainLayout
10481 The label will be printed above the paragraph, but only at the top of an
10482 environment or the top of a chain of paragraphs with this layout.
10483 Usage is for example the
10484 \begin_inset Flex CharStyle:MenuItem
10487 \begin_layout PlainLayout
10494 \begin_inset Flex CharStyle:MenuItem
10497 \begin_layout PlainLayout
10504 This is also the case for
10505 \begin_inset Flex CharStyle:Code
10508 \begin_layout PlainLayout
10514 labels with latex type
10515 \begin_inset Flex CharStyle:Code
10518 \begin_layout PlainLayout
10524 , in order to make layouts for theorems work correctly.
10526 \begin_inset Flex CharStyle:Code
10529 \begin_layout PlainLayout
10535 is a special case for the caption-labels
10536 \begin_inset Quotes eld
10540 \begin_inset Quotes erd
10544 \begin_inset Quotes eld
10548 \begin_inset Quotes erd
10553 \begin_inset Flex CharStyle:Code
10556 \begin_layout PlainLayout
10562 means the (hardcoded) label string depends on the kind of float.
10564 \begin_inset Flex CharStyle:Code
10567 \begin_layout PlainLayout
10573 label type defines automatically numbered labels.
10575 \begin_inset CommandInset ref
10577 reference "sec:counter"
10584 \begin_layout Description
10585 \begin_inset Flex CharStyle:Code
10588 \begin_layout PlainLayout
10597 \begin_layout Description
10598 \begin_inset Flex CharStyle:Code
10601 \begin_layout PlainLayout
10610 \begin_layout Description
10611 \begin_inset Flex CharStyle:Code
10614 \begin_layout PlainLayout
10621 \begin_inset CommandInset label
10623 name "des:LatexName"
10627 The name of the corresponding LaTeX stuff.
10628 Either the environment or command name.
10631 \begin_layout Description
10632 \begin_inset Flex CharStyle:Code
10635 \begin_layout PlainLayout
10644 \begin_layout Description
10645 \begin_inset Flex CharStyle:Code
10648 \begin_layout PlainLayout
10655 \begin_inset CommandInset label
10657 name "des:LatexParam"
10661 An optional parameter for the corresponding
10662 \begin_inset Flex CharStyle:Code
10665 \begin_layout PlainLayout
10672 This parameter cannot be changed from within LyX.
10675 \begin_layout Description
10676 \begin_inset Flex CharStyle:Code
10679 \begin_layout PlainLayout
10686 \begin_inset CommandInset label
10688 name "des:LatexType"
10693 \begin_inset Flex CharStyle:Code
10696 \begin_layout PlainLayout
10701 , Command, Environment, Item_Environment,
10707 \begin_inset Flex CharStyle:Code
10710 \begin_layout PlainLayout
10716 ] How the layout should be translated into LaTeX.
10718 \begin_inset Flex CharStyle:Code
10721 \begin_layout PlainLayout
10727 means nothing special.
10729 \begin_inset Flex CharStyle:Code
10732 \begin_layout PlainLayout
10739 \begin_inset Flex CharStyle:Code
10742 \begin_layout PlainLayout
10749 {\SpecialChar \ldots{}
10756 \begin_inset Flex CharStyle:Code
10759 \begin_layout PlainLayout
10766 \begin_inset Flex CharStyle:Code
10769 \begin_layout PlainLayout
10776 }\SpecialChar \ldots{}
10790 \begin_inset Flex CharStyle:Code
10793 \begin_layout PlainLayout
10800 \begin_inset Flex CharStyle:Code
10803 \begin_layout PlainLayout
10810 \begin_inset Flex CharStyle:Code
10813 \begin_layout PlainLayout
10821 is generated for each paragraph of this environment.
10823 \begin_inset Flex CharStyle:Code
10826 \begin_layout PlainLayout
10833 \begin_inset Flex CharStyle:Code
10836 \begin_layout PlainLayout
10843 \begin_inset Flex CharStyle:Code
10846 \begin_layout PlainLayout
10852 is passed as an argument to the environment.
10854 \begin_inset Flex CharStyle:Code
10857 \begin_layout PlainLayout
10863 can be defined in the
10864 \begin_inset Flex CharStyle:MenuItem
10867 \begin_layout PlainLayout
10872 ayout\SpecialChar \menuseparator
10884 \begin_inset Flex CharStyle:Code
10887 \begin_layout PlainLayout
10895 is perhaps a bit misleading, since these rules apply to SGML classes, too.
10896 Visit the SGML class files for specific examples.
10899 \begin_layout Standard
10900 Putting the last few things together, the LaTeX output will be either:
10903 \begin_layout LyX-Code
10906 latexname[latexparam]{\SpecialChar \ldots{}
10910 \begin_layout Standard
10914 \begin_layout LyX-Code
10917 begin{latexname}[latexparam] \SpecialChar \ldots{}
10923 \begin_layout Standard
10924 depending upon the LaTex type.
10927 \begin_layout Description
10928 \begin_inset Flex CharStyle:Code
10931 \begin_layout PlainLayout
10938 \begin_inset Flex CharStyle:Code
10941 \begin_layout PlainLayout
10947 ] If you put layouts into environments, the leftmargins are not simply added,
10948 but added with a factor
10949 \begin_inset Formula $\frac{4}{depth+4}$
10953 Note that this parameter is also used when the margin is defined as
10954 \begin_inset Flex CharStyle:Code
10957 \begin_layout PlainLayout
10964 \begin_inset Flex CharStyle:Code
10967 \begin_layout PlainLayout
10974 Then it is added to the manual or dynamic margin.
10977 The argument is passed as a string.
10979 \begin_inset Quotes eld
10983 \begin_inset Flex CharStyle:Code
10986 \begin_layout PlainLayout
10993 \begin_inset Quotes erd
10996 means that the paragraph is indented with the width of
10997 \begin_inset Quotes eld
11001 \begin_inset Flex CharStyle:Code
11004 \begin_layout PlainLayout
11011 \begin_inset Quotes erd
11014 in the normal font.
11015 You can get a negative width by prefixing the string with
11016 \begin_inset Quotes eld
11020 \begin_inset Flex CharStyle:Code
11023 \begin_layout PlainLayout
11030 \begin_inset Quotes erd
11034 This way was chosen so that the look is the same with each used screen
11039 \begin_layout Description
11040 \begin_inset Flex CharStyle:Code
11043 \begin_layout PlainLayout
11050 \begin_inset Flex CharStyle:Code
11053 \begin_layout PlainLayout
11058 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11065 The kind of margin that the layout has on the left side.
11067 \begin_inset Flex CharStyle:Code
11070 \begin_layout PlainLayout
11076 just means a fixed margin.
11078 \begin_inset Flex CharStyle:Code
11081 \begin_layout PlainLayout
11087 means that the left margin depends on the string entered in the
11088 \begin_inset Flex CharStyle:MenuItem
11091 \begin_layout PlainLayout
11096 dit\SpecialChar \menuseparator
11102 \begin_inset Space ~
11111 This is used to typeset nice lists without tabulators.
11113 \begin_inset Flex CharStyle:Code
11116 \begin_layout PlainLayout
11122 means that the margin depends on the size of the label.
11123 This is used for automatic enumerated headlines.
11124 It is obvious that the headline
11125 \begin_inset Quotes eld
11128 5.4.3.2.1 Very long headline
11129 \begin_inset Quotes erd
11132 must have a wider left margin (as wide as
11133 \begin_inset Quotes eld
11137 \begin_inset Quotes erd
11140 plus the space) than
11141 \begin_inset Quotes eld
11144 3.2 Very long headline
11145 \begin_inset Quotes erd
11149 \begin_inset Quotes eld
11153 \begin_inset Quotes erd
11156 are not able to do this.
11158 \begin_inset Flex CharStyle:Code
11161 \begin_layout PlainLayout
11167 is similar, but only the very first row of the paragraph is dynamic, while
11168 the others are static; this is used, for example, for descriptions.
11170 \begin_inset Flex CharStyle:Code
11173 \begin_layout PlainLayout
11179 means the margin is chosen in a way that the longest row of this paragraph
11180 fits to the right margin.
11181 This is used to typeset an address on the right edge of the page.
11184 \begin_layout Description
11185 \begin_inset Flex CharStyle:Code
11188 \begin_layout PlainLayout
11195 \begin_inset CommandInset label
11197 name "des:NeedProtect"
11202 \begin_inset Flex CharStyle:Code
11205 \begin_layout PlainLayout
11214 \begin_inset Flex CharStyle:Code
11217 \begin_layout PlainLayout
11223 ] Whether fragile commands in this layout should be
11224 \begin_inset Flex CharStyle:Code
11227 \begin_layout PlainLayout
11238 \begin_layout Description
11239 \begin_inset Flex CharStyle:Code
11242 \begin_layout PlainLayout
11249 \begin_inset Flex CharStyle:Code
11252 \begin_layout PlainLayout
11259 \begin_inset Flex CharStyle:Code
11262 \begin_layout PlainLayout
11270 ] Whether newlines are translated into LaTeX newlines (
11271 \begin_inset Flex CharStyle:Code
11274 \begin_layout PlainLayout
11285 The translation can be switched off to allow more comfortable LaTeX editing
11289 \begin_layout Description
11290 \begin_inset Flex CharStyle:Code
11293 \begin_layout PlainLayout
11300 \begin_inset Flex CharStyle:Code
11303 \begin_layout PlainLayout
11310 \begin_inset Flex CharStyle:Code
11313 \begin_layout PlainLayout
11321 ] Whether the following Paragraph is allowed to indent its very first row.
11323 \begin_inset Flex CharStyle:Code
11326 \begin_layout PlainLayout
11332 means that it is not allowed to do so;
11333 \begin_inset Flex CharStyle:Code
11336 \begin_layout PlainLayout
11342 means it could do so if it wants to.
11345 \begin_layout Description
11346 \begin_inset Flex CharStyle:Code
11349 \begin_layout PlainLayout
11358 \begin_layout Description
11359 \begin_inset Flex CharStyle:Code
11362 \begin_layout PlainLayout
11369 \begin_inset Flex CharStyle:Code
11372 \begin_layout PlainLayout
11378 ] The number of optional arguments that can be used with this layout.
11379 This is useful for things like section headings, and only makes sense with
11383 \begin_layout Description
11384 \begin_inset Flex CharStyle:Code
11387 \begin_layout PlainLayout
11394 \begin_inset Flex CharStyle:Code
11397 \begin_layout PlainLayout
11403 ] The indent of the very first line of a paragraph.
11405 \begin_inset Flex CharStyle:Code
11408 \begin_layout PlainLayout
11414 will be fixed for a certain layout.
11415 The exception is Standard layout, since the indentation of a Standard layout
11416 paragraph can be prohibited with
11417 \begin_inset Flex CharStyle:Code
11420 \begin_layout PlainLayout
11427 Also, Standard layout paragraphs inside environments use the
11428 \begin_inset Flex CharStyle:Code
11431 \begin_layout PlainLayout
11437 of the environment, not their native one.
11438 For example, Standard paragraphs inside an enumeration are not indented.
11441 \begin_layout Description
11442 \begin_inset Flex CharStyle:Code
11445 \begin_layout PlainLayout
11452 \begin_inset Flex CharStyle:Code
11455 \begin_layout PlainLayout
11461 ] The vertical space between two paragraphs of this layout.
11464 \begin_layout Description
11465 \begin_inset Flex CharStyle:Code
11468 \begin_layout PlainLayout
11475 \begin_inset Flex CharStyle:Code
11478 \begin_layout PlainLayout
11484 ] LyX allows the user to choose either
11485 \begin_inset Quotes eld
11489 \begin_inset Quotes erd
11493 \begin_inset Quotes eld
11497 \begin_inset Quotes erd
11500 to typeset a document.
11502 \begin_inset Quotes eld
11506 \begin_inset Quotes erd
11509 is chosen, this value is completely ignored.
11511 \begin_inset Quotes eld
11515 \begin_inset Quotes erd
11518 is chosen, the parindent of a LaTeXtype
11519 \begin_inset Quotes eld
11523 \begin_inset Quotes erd
11526 layout is ignored and all paragraphs are separated by this parskip argument.
11527 The vertical space is calculated with
11528 \begin_inset Flex CharStyle:Code
11531 \begin_layout PlainLayout
11533 \begin_inset Space ~
11542 \begin_inset Flex CharStyle:Code
11545 \begin_layout PlainLayout
11551 is the height of a row with the normal font.
11552 This way, the look stays the same with different screen fonts.
11555 \begin_layout Description
11556 \begin_inset Flex CharStyle:Code
11559 \begin_layout PlainLayout
11566 \begin_inset CommandInset label
11568 name "des:PassThru"
11575 \begin_inset Flex CharStyle:Code
11578 \begin_layout PlainLayout
11589 \begin_inset Flex CharStyle:Code
11592 \begin_layout PlainLayout
11598 ] Whether the contents of this paragraph should be output in raw form, meaning
11599 without special translations that LaTeX would require.
11602 \begin_layout Description
11603 \begin_inset Flex CharStyle:Code
11606 \begin_layout PlainLayout
11613 \begin_inset CommandInset label
11615 name "des:Preamble"
11619 Information to be included in the LaTeX preamable when this style is used.
11620 Used to define macros, load packages, etc., required by this particular
11623 \begin_inset Quotes eld
11627 \begin_inset Flex CharStyle:Code
11630 \begin_layout PlainLayout
11637 \begin_inset Quotes erd
11643 \begin_layout Description
11644 \begin_inset Flex CharStyle:Code
11647 \begin_layout PlainLayout
11654 \begin_inset Flex CharStyle:Code
11657 \begin_layout PlainLayout
11664 \begin_inset CommandInset label
11666 name "des:Requires"
11670 Whether the layout requires the feature
11671 \begin_inset Flex CharStyle:Code
11674 \begin_layout PlainLayout
11681 See the description of
11682 \begin_inset Flex CharStyle:Code
11685 \begin_layout PlainLayout
11692 \begin_inset CommandInset ref
11693 LatexCommand pageref
11694 reference "des:FreeSpacing"
11698 ) for information on `features'.
11702 \begin_layout Description
11703 \begin_inset Flex CharStyle:Code
11706 \begin_layout PlainLayout
11713 \begin_inset Flex CharStyle:Code
11716 \begin_layout PlainLayout
11723 \begin_inset Flex CharStyle:Code
11726 \begin_layout PlainLayout
11735 \begin_layout Description
11736 \begin_inset Flex CharStyle:Code
11739 \begin_layout PlainLayout
11746 \begin_inset Flex CharStyle:Code
11749 \begin_layout PlainLayout
11754 , onehalf, double, other
11763 ] This defines what the default spacing should be in the layout.
11765 \begin_inset Flex CharStyle:Code
11768 \begin_layout PlainLayout
11775 \begin_inset Flex CharStyle:Code
11778 \begin_layout PlainLayout
11785 \begin_inset Flex CharStyle:Code
11788 \begin_layout PlainLayout
11794 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
11795 If you specify the argument
11796 \begin_inset Flex CharStyle:Code
11799 \begin_layout PlainLayout
11805 , then you should also provide a numerical argument which will be the actual
11807 Note that, contrary to other parameters,
11808 \begin_inset Flex CharStyle:Code
11811 \begin_layout PlainLayout
11817 implies the generation of specific LaTeX code, using the package
11820 \begin_inset Flex CharStyle:Code
11823 \begin_layout PlainLayout
11832 \begin_layout Description
11833 \begin_inset Flex CharStyle:Code
11836 \begin_layout PlainLayout
11842 The font used for the text body .
11844 \begin_inset CommandInset ref
11846 reference "sec:fonts"
11853 \begin_layout Description
11854 \begin_inset Flex CharStyle:Code
11857 \begin_layout PlainLayout
11865 The level of the style in the table of contents.
11866 This is used for automatic numbering of section headings.
11869 \begin_layout Description
11870 \begin_inset Flex CharStyle:Code
11873 \begin_layout PlainLayout
11880 \begin_inset Flex CharStyle:Code
11883 \begin_layout PlainLayout
11889 ] The vertical space with which the very first of a chain of paragraphs
11890 with this layout is separated from the previous paragraph.
11891 If the previous paragraph has another layout, the separations are not simply
11892 added, but the maximum is taken.
11895 \begin_layout Subsection
11899 \begin_layout Standard
11900 \begin_inset CommandInset label
11906 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11907 define the floats (
11908 \begin_inset Flex CharStyle:MenuItem
11911 \begin_layout PlainLayout
11918 \begin_inset Flex CharStyle:MenuItem
11921 \begin_layout PlainLayout
11927 , \SpecialChar \ldots{}
11928 ) in the text class itself.
11929 Standard floats are included in the file
11930 \begin_inset Flex CharStyle:Code
11933 \begin_layout PlainLayout
11939 , so you may have to do no more than add
11942 \begin_layout LyX-Code
11943 Input stdfloats.inc
11946 \begin_layout Standard
11947 to your layout file.
11948 If you want to implement a text class that proposes some other float types
11949 (like the AGU class bundled with LyX), the information below will hopefully
11953 \begin_layout Description
11954 \begin_inset Flex CharStyle:Code
11957 \begin_layout PlainLayout
11964 \begin_inset Flex CharStyle:Code
11967 \begin_layout PlainLayout
11974 \begin_inset Quotes erd
11978 \begin_inset Quotes erd
11981 ] The file name extension of an auxiliary file for the list of figures (or
11983 LaTeX writes the captions to this file.
11986 \begin_layout Description
11987 \begin_inset Flex CharStyle:Code
11990 \begin_layout PlainLayout
11997 \begin_inset Flex CharStyle:Code
12000 \begin_layout PlainLayout
12007 \begin_inset Quotes erd
12011 \begin_inset Quotes erd
12014 ] The string that will be used in the menus and also for the caption.
12017 \begin_layout Description
12018 \begin_inset Flex CharStyle:Code
12021 \begin_layout PlainLayout
12028 \begin_inset Flex CharStyle:Code
12031 \begin_layout PlainLayout
12040 \begin_inset Flex CharStyle:Code
12043 \begin_layout PlainLayout
12050 \begin_inset Flex CharStyle:Code
12053 \begin_layout PlainLayout
12059 if the float is already defined by the LaTeX document class.
12061 \begin_inset Flex CharStyle:Code
12064 \begin_layout PlainLayout
12070 , the float will be defined using the LaTeX package
12071 \begin_inset Flex CharStyle:Code
12074 \begin_layout PlainLayout
12083 \begin_layout Description
12084 \begin_inset Flex CharStyle:Code
12087 \begin_layout PlainLayout
12094 \begin_inset Flex CharStyle:Code
12097 \begin_layout PlainLayout
12104 \begin_inset Quotes erd
12108 \begin_inset Quotes erd
12111 ] The heading used for the list of floats.
12114 \begin_layout Description
12115 \begin_inset Flex CharStyle:Code
12118 \begin_layout PlainLayout
12125 \begin_inset Flex CharStyle:Code
12128 \begin_layout PlainLayout
12135 \begin_inset Quotes erd
12139 \begin_inset Quotes erd
12142 ] This (optional) argument determines whether floats of this class will
12143 be numbered within some sectional unit of the document.
12144 For example, if within is equal to
12145 \begin_inset Flex CharStyle:Code
12148 \begin_layout PlainLayout
12154 , the floats will be numbered within chapters.
12158 \begin_layout Description
12159 \begin_inset Flex CharStyle:Code
12162 \begin_layout PlainLayout
12169 \begin_inset Flex CharStyle:Code
12172 \begin_layout PlainLayout
12179 \begin_inset Quotes erd
12183 \begin_inset Quotes erd
12186 ] The default placement for the given class of floats.
12187 The string should be as in standard LaTeX:
12188 \begin_inset Flex CharStyle:Code
12191 \begin_layout PlainLayout
12198 \begin_inset Flex CharStyle:Code
12201 \begin_layout PlainLayout
12208 \begin_inset Flex CharStyle:Code
12211 \begin_layout PlainLayout
12218 \begin_inset Flex CharStyle:Code
12221 \begin_layout PlainLayout
12227 for top, bottom, page, and here, respectively.
12231 \begin_layout PlainLayout
12232 Note that the order of these letters in the string is irrelevant, like in
12238 On top of that there is a new type,
12239 \begin_inset Flex CharStyle:Code
12242 \begin_layout PlainLayout
12248 , which does not really correspond to a float, since it means: put it
12249 \begin_inset Quotes eld
12253 \begin_inset Quotes erd
12257 Note however that the
12258 \begin_inset Flex CharStyle:Code
12261 \begin_layout PlainLayout
12267 specifier is special and, because of implementation details, cannot be
12268 used in non-builtin float types.
12269 If you do not understand what this means, just use
12270 \begin_inset Quotes eld
12274 \begin_inset Flex CharStyle:Code
12277 \begin_layout PlainLayout
12284 \begin_inset Quotes erd
12290 \begin_layout Description
12291 \begin_inset Flex CharStyle:Code
12294 \begin_layout PlainLayout
12301 \begin_inset Flex CharStyle:Code
12304 \begin_layout PlainLayout
12311 \begin_inset Quotes erd
12315 \begin_inset Quotes erd
12318 ] The style used when defining the float using
12319 \begin_inset Flex CharStyle:Code
12322 \begin_layout PlainLayout
12333 \begin_layout Description
12334 \begin_inset Flex CharStyle:Code
12337 \begin_layout PlainLayout
12344 \begin_inset Flex CharStyle:Code
12347 \begin_layout PlainLayout
12354 \begin_inset Quotes erd
12358 \begin_inset Quotes erd
12362 \begin_inset Quotes eld
12366 \begin_inset Quotes erd
12369 of the new class of floats, like program or algorithm.
12370 After the appropriate
12371 \begin_inset Flex CharStyle:Code
12374 \begin_layout PlainLayout
12383 \begin_inset Flex CharStyle:Code
12386 \begin_layout PlainLayout
12395 \begin_inset Flex CharStyle:Code
12398 \begin_layout PlainLayout
12409 \begin_layout Standard
12410 Note that defining a float with type
12411 \begin_inset Flex CharStyle:Code
12414 \begin_layout PlainLayout
12422 automatically defines the corresponding counter with name
12423 \begin_inset Flex CharStyle:Code
12426 \begin_layout PlainLayout
12437 \begin_layout Subsection
12438 Inset layouts and Flex insets
12441 \begin_layout Standard
12442 \begin_inset CommandInset label
12444 name "sec:charstyle"
12448 LyX has supported character styles since version 1.4.0; since version 1.6.0
12449 these are called Flex insets.
12453 \begin_layout Standard
12454 Furthermore, it is possible to define the general layout of many different
12456 Currently, InsetLayout can be used to customize the layout parameters
12457 for footnotes, marginal notes, note insets, ERT insets, branches, listings,
12458 indexes, boxes, tables, algorithms, URLs, and optional arguments, as well
12463 \begin_layout Standard
12464 Flex insets come in three different kinds:
12467 \begin_layout Itemize
12469 \begin_inset Flex CharStyle:Code
12472 \begin_layout PlainLayout
12478 ): These define semantic markup corresponding to such LaTeX commands as
12480 \begin_inset Flex CharStyle:Code
12483 \begin_layout PlainLayout
12492 \begin_inset Flex CharStyle:Code
12495 \begin_layout PlainLayout
12506 \begin_layout Itemize
12508 \begin_inset Flex CharStyle:Code
12511 \begin_layout PlainLayout
12517 ): These can be used to define custom collapsable insets, similar to ERT,
12518 footnote, and the like.
12521 \begin_layout Itemize
12523 \begin_inset Flex CharStyle:Code
12526 \begin_layout PlainLayout
12532 ): For use with DocBook classes.
12535 \begin_layout Standard
12537 \begin_inset Flex CharStyle:Code
12540 \begin_layout PlainLayout
12546 definition starting line is of the form
12549 \begin_layout LyX-Code
12550 InsetLayout <Type> <Name>
12553 \begin_layout Standard
12555 \begin_inset Flex CharStyle:Code
12558 \begin_layout PlainLayout
12565 \begin_inset Flex CharStyle:Code
12568 \begin_layout PlainLayout
12575 \begin_inset Flex CharStyle:Code
12578 \begin_layout PlainLayout
12585 \begin_inset Flex CharStyle:Code
12588 \begin_layout PlainLayout
12595 \begin_inset Flex CharStyle:Code
12598 \begin_layout PlainLayout
12605 \begin_inset Flex CharStyle:Code
12608 \begin_layout PlainLayout
12615 \begin_inset Flex CharStyle:Code
12618 \begin_layout PlainLayout
12625 \begin_inset Flex CharStyle:Code
12628 \begin_layout PlainLayout
12635 \begin_inset Flex CharStyle:Code
12638 \begin_layout PlainLayout
12645 \begin_inset Flex CharStyle:Code
12648 \begin_layout PlainLayout
12655 \begin_inset Flex CharStyle:Code
12658 \begin_layout PlainLayout
12665 \begin_inset Flex CharStyle:Code
12668 \begin_layout PlainLayout
12675 \begin_inset Flex CharStyle:Code
12678 \begin_layout PlainLayout
12685 \begin_inset Flex CharStyle:Code
12688 \begin_layout PlainLayout
12695 \begin_inset Flex CharStyle:Code
12698 \begin_layout PlainLayout
12705 \begin_inset Flex CharStyle:Code
12708 \begin_layout PlainLayout
12715 \begin_inset Flex CharStyle:Code
12718 \begin_layout PlainLayout
12726 \begin_inset Flex CharStyle:Code
12729 \begin_layout PlainLayout
12736 \begin_inset Flex CharStyle:Code
12739 \begin_layout PlainLayout
12746 \begin_inset Flex CharStyle:Code
12749 \begin_layout PlainLayout
12755 should have the form
12756 \begin_inset Flex CharStyle:Code
12759 \begin_layout PlainLayout
12766 \begin_inset Flex CharStyle:Code
12769 \begin_layout PlainLayout
12776 \begin_inset Flex CharStyle:Code
12779 \begin_layout PlainLayout
12786 \begin_inset Flex CharStyle:Code
12789 \begin_layout PlainLayout
12796 \begin_inset Flex CharStyle:Code
12799 \begin_layout PlainLayout
12806 \begin_inset Flex CharStyle:Code
12809 \begin_layout PlainLayout
12815 is any valid identifier.
12819 \begin_layout Standard
12821 \begin_inset Flex CharStyle:Code
12824 \begin_layout PlainLayout
12830 section can contain the following entries:
12833 \begin_layout Description
12834 \begin_inset Flex CharStyle:Code
12837 \begin_layout PlainLayout
12843 The color for the inset's background.
12844 These valid colors are defined in
12845 \begin_inset Flex CharStyle:Code
12848 \begin_layout PlainLayout
12857 \begin_layout Description
12858 \begin_inset Flex CharStyle:Code
12861 \begin_layout PlainLayout
12868 \begin_inset Flex CharStyle:Code
12871 \begin_layout PlainLayout
12878 \begin_inset Flex CharStyle:Code
12881 \begin_layout PlainLayout
12888 \begin_inset Flex CharStyle:Code
12891 \begin_layout PlainLayout
12897 , describing the rendering style used for the inset's frame and buttons.
12898 Footnotes generally use
12899 \begin_inset Flex CharStyle:Code
12902 \begin_layout PlainLayout
12908 ; ERT insets generally use
12909 \begin_inset Flex CharStyle:Code
12912 \begin_layout PlainLayout
12918 ; and character styles use
12919 \begin_inset Flex CharStyle:Code
12922 \begin_layout PlainLayout
12931 \begin_layout Description
12932 \begin_inset Flex CharStyle:Code
12935 \begin_layout PlainLayout
12941 The font used for both the text body
12947 \begin_inset Space ~
12951 \begin_inset CommandInset ref
12953 reference "sec:fonts"
12958 Note that defining this font automatically defines the
12959 \begin_inset Flex CharStyle:Code
12962 \begin_layout PlainLayout
12968 to the same value, so define this first and define
12969 \begin_inset Flex CharStyle:Code
12972 \begin_layout PlainLayout
12978 later if you want them to be different.
12981 \begin_layout Description
12982 \begin_inset Flex CharStyle:Code
12985 \begin_layout PlainLayout
12994 \begin_layout Description
12995 \begin_inset Flex CharStyle:Code
12998 \begin_layout PlainLayout
13004 As with paragraph styles (see page
13005 \begin_inset CommandInset ref
13006 LatexCommand pageref
13007 reference "des:FreeSpacing"
13014 \begin_layout Description
13015 \begin_inset Flex CharStyle:Code
13018 \begin_layout PlainLayout
13024 As with paragraph styles (see page
13025 \begin_inset CommandInset ref
13026 LatexCommand pageref
13027 reference "des:KeepEmpty"
13034 \begin_layout Description
13035 \begin_inset Flex CharStyle:Code
13038 \begin_layout PlainLayout
13044 What will be displayed on the button or elsewhere as the inset label.
13045 Some inset types (ERT and Branch) modify this label on the fly.
13048 \begin_layout Description
13049 \begin_inset Flex CharStyle:Code
13052 \begin_layout PlainLayout
13058 The font used for the label.
13060 \begin_inset Space ~
13064 \begin_inset CommandInset ref
13066 reference "sec:fonts"
13071 Note that this definition can never appear before
13072 \begin_inset Flex CharStyle:Code
13075 \begin_layout PlainLayout
13081 , lest it be ineffective.
13084 \begin_layout Description
13085 \begin_inset Flex CharStyle:Code
13088 \begin_layout PlainLayout
13094 The name of the corresponding LaTeX stuff.
13095 Either the environment or command name.
13098 \begin_layout Description
13099 \begin_inset Flex CharStyle:Code
13102 \begin_layout PlainLayout
13108 The optional parameter for the corresponding
13109 \begin_inset Flex CharStyle:Code
13112 \begin_layout PlainLayout
13118 stuff, including possible bracket pairs like
13119 \begin_inset Flex CharStyle:Code
13122 \begin_layout PlainLayout
13129 This parameter cannot be changed from within LyX.
13132 \begin_layout Description
13133 \begin_inset Flex CharStyle:Code
13136 \begin_layout PlainLayout
13142 As with paragraph styles (see page
13143 \begin_inset CommandInset ref
13144 LatexCommand pageref
13145 reference "des:LatexType"
13152 \begin_layout Description
13153 \begin_inset Flex CharStyle:Code
13156 \begin_layout PlainLayout
13163 \begin_inset Flex CharStyle:Code
13166 \begin_layout PlainLayout
13173 \begin_inset Flex CharStyle:Code
13176 \begin_layout PlainLayout
13183 \begin_inset Flex CharStyle:Code
13186 \begin_layout PlainLayout
13193 \begin_inset Flex CharStyle:Code
13196 \begin_layout PlainLayout
13202 (indicating a dummy definition ending definitions of charstyles etc.).
13203 This entry is only meaningful for Flex (user definable) insets.
13206 \begin_layout Description
13207 \begin_inset Flex CharStyle:Code
13210 \begin_layout PlainLayout
13216 As with paragraph styles (see page
13217 \begin_inset CommandInset ref
13218 LatexCommand pageref
13219 reference "des:Preamble"
13226 \begin_layout Description
13227 \begin_inset Flex CharStyle:Code
13230 \begin_layout PlainLayout
13237 \begin_inset Flex CharStyle:Code
13240 \begin_layout PlainLayout
13246 ] As with paragraph styles (see page
13247 \begin_inset CommandInset ref
13248 LatexCommand pageref
13249 reference "des:Requires"
13256 \begin_layout Subsection
13260 \begin_layout Standard
13261 \begin_inset CommandInset label
13267 Since version 1.3.0 of LyX, it is both possible and necessary to define the
13269 \begin_inset Flex CharStyle:MenuItem
13272 \begin_layout PlainLayout
13279 \begin_inset Flex CharStyle:MenuItem
13282 \begin_layout PlainLayout
13288 , \SpecialChar \ldots{}
13289 ) in the text class itself.
13290 The standard counters are defined in the file
13291 \begin_inset Flex CharStyle:Code
13294 \begin_layout PlainLayout
13300 , so you may have to do no more than add
13303 \begin_layout LyX-Code
13304 Input stdcounters.inc
13307 \begin_layout Standard
13308 to your layout file to get them to work.
13309 But if you want to define custom counters, then you can do so, using the
13310 following parameters:
13313 \begin_layout Description
13314 \begin_inset Flex CharStyle:Code
13317 \begin_layout PlainLayout
13318 LabelString [string=""]
13323 when this is defined, this string defines how the counter is displayed.
13324 Setting this value sets
13325 \begin_inset Flex CharStyle:Code
13328 \begin_layout PlainLayout
13329 LabelStringAppendix
13335 The following special constructs can be used in the string:
13339 \begin_layout Itemize
13340 \begin_inset Flex CharStyle:Code
13343 \begin_layout PlainLayout
13351 will be replaced by the expansion of the
13352 \begin_inset Flex CharStyle:Code
13355 \begin_layout PlainLayout
13362 \begin_inset Flex CharStyle:Code
13365 \begin_layout PlainLayout
13366 LabelStringAppendix
13372 \begin_inset Flex CharStyle:Code
13375 \begin_layout PlainLayout
13385 \begin_layout Itemize
13386 counter values can be expressed using LaTeX-like macros
13387 \begin_inset Flex CharStyle:Code
13390 \begin_layout PlainLayout
13407 \begin_inset Flex CharStyle:Code
13410 \begin_layout PlainLayout
13422 \begin_layout PlainLayout
13432 Actually, the situation is a bit more complicated: any
13451 other than those descibed below will produce arabic numerals.
13452 It would not be surprising to see this change in the future.
13458 \begin_inset Flex CharStyle:Code
13461 \begin_layout PlainLayout
13467 : 1, 2, 3,\SpecialChar \ldots{}
13469 \begin_inset Flex CharStyle:Code
13472 \begin_layout PlainLayout
13478 for lower-case letters: a, b, c, \SpecialChar \ldots{}
13480 \begin_inset Flex CharStyle:Code
13483 \begin_layout PlainLayout
13489 for upper-case letters: A, B, C, \SpecialChar \ldots{}
13491 \begin_inset Flex CharStyle:Code
13494 \begin_layout PlainLayout
13500 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13502 \begin_inset Flex CharStyle:Code
13505 \begin_layout PlainLayout
13511 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13513 \begin_inset Flex CharStyle:Code
13516 \begin_layout PlainLayout
13522 for hebrew numerals.
13526 \begin_layout Standard
13527 If LabelString is not defined, a default value is constructed as follows:
13528 if the counter has a master counter
13529 \begin_inset Flex CharStyle:Code
13532 \begin_layout PlainLayout
13539 \begin_inset Flex CharStyle:Code
13542 \begin_layout PlainLayout
13549 \begin_inset Flex CharStyle:Code
13552 \begin_layout PlainLayout
13562 is used; otherwise the string
13563 \begin_inset Flex CharStyle:Code
13566 \begin_layout PlainLayout
13577 \begin_layout Description
13578 \begin_inset Flex CharStyle:Code
13581 \begin_layout PlainLayout
13582 LabelStringAppendix [string=""]
13588 \begin_inset Flex CharStyle:Code
13591 \begin_layout PlainLayout
13600 \begin_layout Description
13601 \begin_inset Flex CharStyle:Code
13604 \begin_layout PlainLayout
13611 \begin_inset Flex CharStyle:Code
13614 \begin_layout PlainLayout
13621 \begin_inset Quotes erd
13625 \begin_inset Quotes erd
13628 ] The name of the counter.
13631 \begin_layout Description
13632 \begin_inset Flex CharStyle:Code
13635 \begin_layout PlainLayout
13642 \begin_inset Flex CharStyle:Code
13645 \begin_layout PlainLayout
13652 \begin_inset Quotes erd
13656 \begin_inset Quotes erd
13659 ] If this is set to the name of another counter, the present counter will
13660 be reset everytime the other one is increased.
13662 \begin_inset Flex CharStyle:Code
13665 \begin_layout PlainLayout
13672 \begin_inset Flex CharStyle:Code
13675 \begin_layout PlainLayout
13684 \begin_layout Subsection
13688 \begin_layout Standard
13689 \begin_inset CommandInset label
13695 A font description looks like this:
13698 \begin_layout LyX-Code
13708 \begin_layout LyX-Code
13712 \begin_layout LyX-Code
13716 \begin_layout Standard
13717 The following commands are available:
13720 \begin_layout Description
13721 \begin_inset Flex CharStyle:Code
13724 \begin_layout PlainLayout
13731 \begin_inset Flex CharStyle:Code
13734 \begin_layout PlainLayout
13743 \begin_inset Flex CharStyle:Code
13746 \begin_layout PlainLayout
13753 \begin_inset Flex CharStyle:Code
13756 \begin_layout PlainLayout
13763 \begin_inset Flex CharStyle:Code
13766 \begin_layout PlainLayout
13773 \begin_inset Flex CharStyle:Code
13776 \begin_layout PlainLayout
13783 \begin_inset Flex CharStyle:Code
13786 \begin_layout PlainLayout
13793 \begin_inset Flex CharStyle:Code
13796 \begin_layout PlainLayout
13803 \begin_inset Flex CharStyle:Code
13806 \begin_layout PlainLayout
13813 \begin_inset Flex CharStyle:Code
13816 \begin_layout PlainLayout
13825 \begin_layout Description
13826 \begin_inset Flex CharStyle:Code
13829 \begin_layout PlainLayout
13838 \begin_inset Flex CharStyle:Code
13841 \begin_layout PlainLayout
13852 \begin_inset Flex CharStyle:Code
13855 \begin_layout PlainLayout
13862 \begin_inset Flex CharStyle:Code
13865 \begin_layout PlainLayout
13874 \begin_layout Description
13875 \begin_inset Flex CharStyle:Code
13878 \begin_layout PlainLayout
13885 \begin_inset Flex CharStyle:Code
13888 \begin_layout PlainLayout
13894 ] Valid argument sare:
13895 \begin_inset Flex CharStyle:Code
13898 \begin_layout PlainLayout
13905 \begin_inset Flex CharStyle:Code
13908 \begin_layout PlainLayout
13915 \begin_inset Flex CharStyle:Code
13918 \begin_layout PlainLayout
13925 \begin_inset Flex CharStyle:Code
13928 \begin_layout PlainLayout
13935 \begin_inset Flex CharStyle:Code
13938 \begin_layout PlainLayout
13945 \begin_inset Flex CharStyle:Code
13948 \begin_layout PlainLayout
13955 Each of these turns on or off the corresponding attribute.
13958 \begin_layout Description
13959 \begin_inset Flex CharStyle:Code
13962 \begin_layout PlainLayout
13971 \begin_inset Flex CharStyle:Code
13974 \begin_layout PlainLayout
13985 \begin_inset Flex CharStyle:Code
13988 \begin_layout PlainLayout
13997 \begin_layout Description
13998 \begin_inset Flex CharStyle:Code
14001 \begin_layout PlainLayout
14010 \begin_inset Flex CharStyle:Code
14013 \begin_layout PlainLayout
14024 \begin_inset Flex CharStyle:Code
14027 \begin_layout PlainLayout
14034 \begin_inset Flex CharStyle:Code
14037 \begin_layout PlainLayout
14044 \begin_inset Flex CharStyle:Code
14047 \begin_layout PlainLayout
14056 \begin_layout Description
14057 \begin_inset Flex CharStyle:Code
14060 \begin_layout PlainLayout
14067 \begin_inset Flex CharStyle:Code
14070 \begin_layout PlainLayout
14077 \begin_inset Flex CharStyle:Code
14080 \begin_layout PlainLayout
14087 \begin_inset Flex CharStyle:Code
14090 \begin_layout PlainLayout
14099 \begin_inset Flex CharStyle:Code
14102 \begin_layout PlainLayout
14109 \begin_inset Flex CharStyle:Code
14112 \begin_layout PlainLayout
14119 \begin_inset Flex CharStyle:Code
14122 \begin_layout PlainLayout
14129 \begin_inset Flex CharStyle:Code
14132 \begin_layout PlainLayout
14139 \begin_inset Flex CharStyle:Code
14142 \begin_layout PlainLayout
14151 \begin_layout Subsection
14152 Upgrading old layout files
14155 \begin_layout Standard
14156 The file format of layout files changes from time to time, so old layout
14157 files need to be converted.
14158 This process has been automated since LyX 1.4.0: If LyX reads an old format
14159 layout file it will call the conversion tool
14160 \begin_inset Flex CharStyle:Code
14163 \begin_layout PlainLayout
14164 LyXDir/scripts/layout2layout.py
14169 and convert it to a temporary file in current format.
14170 The original file is left untouched.
14171 If you want to convert the layout file permanently, just call the converter
14175 \begin_layout LyX-Code
14176 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
14179 \begin_layout Standard
14180 (You need to replace
14181 \begin_inset Flex CharStyle:Code
14184 \begin_layout PlainLayout
14190 with the name of your LyX system directory, unless you happen to have defined
14191 such an environment variable.) Then copy
14192 \begin_inset Flex CharStyle:Code
14195 \begin_layout PlainLayout
14202 \begin_inset Flex CharStyle:Code
14205 \begin_layout PlainLayout
14214 \begin_layout Standard
14215 The automatic conversion only handles syntax changes.
14216 It cannot handle the case where the contents of included files was changed,
14217 so these will have to be converted separately.
14220 \begin_layout Section
14222 \begin_inset CommandInset label
14224 name "sec:templates"
14231 \begin_layout Standard
14232 Templates are created just like usual documents.
14233 The only difference is that usual documents contain all possible settings,
14234 including the font scheme and the paper size.
14235 Usually a user doesn't want a template to overwrite his defaults in these
14237 For that reason, the designer of a template should remove the corresponding
14239 \begin_inset Flex CharStyle:Code
14242 \begin_layout PlainLayout
14251 \begin_inset Flex CharStyle:Code
14254 \begin_layout PlainLayout
14262 from the template LyX file.
14263 This can be done with any simple text-editor, for example
14264 \begin_inset Flex CharStyle:Code
14267 \begin_layout PlainLayout
14274 \begin_inset Flex CharStyle:Code
14277 \begin_layout PlainLayout
14287 \begin_layout Standard
14288 Put the edited template files you create in
14289 \begin_inset Flex CharStyle:Code
14292 \begin_layout PlainLayout
14298 , copy the ones you use from the global template directory in
14299 \begin_inset Flex CharStyle:Code
14302 \begin_layout PlainLayout
14308 to the same place, and redefine the template path in the
14309 \begin_inset Flex CharStyle:MenuItem
14312 \begin_layout PlainLayout
14320 \SpecialChar \menuseparator
14325 references\SpecialChar \menuseparator
14334 \begin_layout Standard
14335 Note that there is a template which has a particular meaning:
14336 \begin_inset Flex CharStyle:Code
14339 \begin_layout PlainLayout
14346 This template is loaded everytime you create a new document with
14347 \begin_inset Flex CharStyle:MenuItem
14350 \begin_layout PlainLayout
14360 \SpecialChar \menuseparator
14362 \begin_inset Flex CharStyle:MenuItem
14365 \begin_layout PlainLayout
14375 in order to provide useful defaults.
14376 To create this template from inside LyX, all you have to do is to open
14377 a document with the correct settings, and use the
14378 \begin_inset Flex CharStyle:MenuItem
14381 \begin_layout PlainLayout
14386 e as Document Defaults
14394 \begin_layout Chapter
14395 Including External Material
14398 \begin_layout Standard
14399 The use of material from sources external to LyX is covered in detail in
14405 This part of the manual covers what needs to happen behind the scenes for
14406 new sorts of material to be included.
14409 \begin_layout Section
14413 \begin_layout Standard
14414 The external material feature is based on the concept of a
14419 A template is a specification of how LyX should interface with a certain
14421 As bundled, LyX comes with predefined templates for Xfig figures, various
14422 raster format images, chess diagrams, and LilyPond music notation.
14423 You can check the actual list by using the menu
14424 \begin_inset Flex CharStyle:MenuItem
14427 \begin_layout PlainLayout
14428 Insert\SpecialChar \menuseparator
14429 File\SpecialChar \menuseparator
14436 Furthermore, it is possible to roll your own template to support a specific
14438 Later we'll describe in more detail what is involved, and hopefully you
14439 will submit all the templates you create so we can include them in a later
14443 \begin_layout Standard
14444 Another basic idea of the external material feature is to distinguish between
14445 the original file that serves as a base for final material and the produced
14446 file that is included in your exported or printed document.
14447 For example, consider the case of a figure produced with
14448 \begin_inset Flex CharStyle:Code
14451 \begin_layout PlainLayout
14458 The Xfig application itself works on an original file with the
14459 \begin_inset Flex CharStyle:Code
14462 \begin_layout PlainLayout
14469 Within XFig, you create and change your figure, and when you are done,
14471 \begin_inset Flex CharStyle:Code
14474 \begin_layout PlainLayout
14481 When you want to include the figure in your document, you invoke
14482 \begin_inset Flex CharStyle:Code
14485 \begin_layout PlainLayout
14491 in order to create a PostScript file that can readily be included in your
14494 \begin_inset Flex CharStyle:Code
14497 \begin_layout PlainLayout
14503 file is the original file, and the PostScript file is the produced file.
14506 \begin_layout Standard
14507 This distinction is important in order to allow updating of the material
14508 while you are in the process of writing the document.
14509 Furthermore, it provides us with the flexibility that is needed to support
14510 multiple export formats.
14511 For instance, in the case of a plain text file, it is not exactly an award-winn
14512 ing idea to include the figure as raw PostScript®.
14513 Instead, you'd either prefer to just include a reference to the figure
14514 or try to invoke some graphics to Ascii converter to make the final result
14515 look similar to the real graphics.
14516 The external material management allows you to do this, because it is parameter
14517 ized on the different export formats that LyX supports.
14520 \begin_layout Standard
14521 Besides supporting the production of different products according to the
14522 exported format, it supports tight integration with editing and viewing
14524 In the case of an XFig figure, you are able to invoke Xfig on the original
14525 file with a single click from within the external material dialog in LyX,
14526 and also preview the produced PostScript file with ghostview with another
14528 No more fiddling around with the command line and/or file browsers to locate
14529 and manipulate the original or produced files.
14530 In this way, you are finally able to take full advantage of the many different
14531 applications that are relevant to use when you write your documents, and
14532 ultimately be more productive.
14535 \begin_layout Section
14536 The external template configuration file
14539 \begin_layout Standard
14540 It is relatively easy to add custom external template definitions to LyX.
14541 However, be aware that doing this in an careless manner most probably
14545 introduce an easily exploitable security hole.
14546 So before you do this, please read the discussion about security in section
14548 \begin_inset CommandInset ref
14550 reference "sec:Security-discussion"
14557 \begin_layout Standard
14558 Having said that, we encourage you to submit any interesting templates that
14563 \begin_layout Standard
14564 The external templates are defined in the
14565 \begin_inset Flex CharStyle:Code
14568 \begin_layout PlainLayout
14569 LyXDir/lib/external_templates
14575 You can place your own version in
14576 \begin_inset Flex CharStyle:Code
14579 \begin_layout PlainLayout
14580 UserDir/external_templates
14588 \begin_layout Standard
14589 A typical template looks like this:
14592 \begin_layout LyX-Code
14596 \begin_layout LyX-Code
14597 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14600 \begin_layout LyX-Code
14604 \begin_layout LyX-Code
14608 \begin_layout LyX-Code
14612 \begin_layout LyX-Code
14616 \begin_layout LyX-Code
14620 \begin_layout LyX-Code
14621 AutomaticProduction true
14624 \begin_layout LyX-Code
14628 \begin_layout LyX-Code
14632 \begin_layout LyX-Code
14636 \begin_layout LyX-Code
14637 TransformCommand Rotate RotationLatexCommand
14640 \begin_layout LyX-Code
14641 TransformCommand Resize ResizeLatexCommand
14644 \begin_layout LyX-Code
14645 Product "$$RotateFront$$ResizeFront
14648 \begin_layout LyX-Code
14653 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14656 \begin_layout LyX-Code
14657 $$ResizeBack$$RotateBack"
14660 \begin_layout LyX-Code
14664 \begin_layout LyX-Code
14665 UpdateResult "$$AbsPath$$Basename.pstex_t"
14668 \begin_layout LyX-Code
14669 Requirement "graphicx"
14672 \begin_layout LyX-Code
14673 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14676 \begin_layout LyX-Code
14677 ReferencedFile latex "$$AbsPath$$Basename.eps"
14680 \begin_layout LyX-Code
14681 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14684 \begin_layout LyX-Code
14688 \begin_layout LyX-Code
14692 \begin_layout LyX-Code
14693 TransformCommand Rotate RotationLatexCommand
14696 \begin_layout LyX-Code
14697 TransformCommand Resize ResizeLatexCommand
14700 \begin_layout LyX-Code
14701 Product "$$RotateFront$$ResizeFront
14704 \begin_layout LyX-Code
14709 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14712 \begin_layout LyX-Code
14713 $$ResizeBack$$RotateBack"
14716 \begin_layout LyX-Code
14717 UpdateFormat pdftex
14720 \begin_layout LyX-Code
14721 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14724 \begin_layout LyX-Code
14725 Requirement "graphicx"
14728 \begin_layout LyX-Code
14729 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14732 \begin_layout LyX-Code
14733 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14736 \begin_layout LyX-Code
14740 \begin_layout LyX-Code
14744 \begin_layout LyX-Code
14745 Product "$$Contents(
14747 "$$AbsPath$$Basename.asc
14752 \begin_layout LyX-Code
14753 UpdateFormat asciixfig
14756 \begin_layout LyX-Code
14757 UpdateResult "$$AbsPath$$Basename.asc"
14760 \begin_layout LyX-Code
14764 \begin_layout LyX-Code
14768 \begin_layout LyX-Code
14769 Product "<graphic fileref=
14771 "$$AbsOrRelPathMaster$$Basename.eps
14776 \begin_layout LyX-Code
14780 \begin_layout LyX-Code
14784 \begin_layout LyX-Code
14785 UpdateResult "$$AbsPath$$Basename.eps"
14788 \begin_layout LyX-Code
14789 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14792 \begin_layout LyX-Code
14793 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14796 \begin_layout LyX-Code
14800 \begin_layout LyX-Code
14801 Product "[XFig: $$FName]"
14804 \begin_layout LyX-Code
14808 \begin_layout LyX-Code
14812 \begin_layout Standard
14813 As you can see, the template is enclosed in
14814 \begin_inset Flex CharStyle:Code
14817 \begin_layout PlainLayout
14823 \SpecialChar \ldots{}
14825 \begin_inset Flex CharStyle:Code
14828 \begin_layout PlainLayout
14835 It contains a header specifying some general settings and, for each supported
14836 primary document file format, a section
14837 \begin_inset Flex CharStyle:Code
14840 \begin_layout PlainLayout
14846 \SpecialChar \ldots{}
14848 \begin_inset Flex CharStyle:Code
14851 \begin_layout PlainLayout
14860 \begin_layout Subsection
14861 The template header
14864 \begin_layout Description
14865 \begin_inset Flex CharStyle:Code
14868 \begin_layout PlainLayout
14869 AutomaticProduction
14870 \begin_inset Space ~
14878 Whether the file represented by the template must be generated by LyX.
14879 This command must occur exactly once.
14882 \begin_layout Description
14883 \begin_inset Flex CharStyle:Code
14886 \begin_layout PlainLayout
14888 \begin_inset Space ~
14896 A glob pattern that is used in the file dialog to filter out the desired
14898 If there is more than one possible file extension (e.g.
14899 \begin_inset Space ~
14903 \begin_inset Flex CharStyle:Code
14906 \begin_layout PlainLayout
14913 \begin_inset Flex CharStyle:Code
14916 \begin_layout PlainLayout
14922 ), use something like
14923 \begin_inset Flex CharStyle:Code
14926 \begin_layout PlainLayout
14933 This command must occur exactly once.
14936 \begin_layout Description
14937 \begin_inset Flex CharStyle:Code
14940 \begin_layout PlainLayout
14942 \begin_inset Space ~
14950 The text that is displayed on the button.
14951 This command must occur exactly once.
14954 \begin_layout Description
14955 \begin_inset Flex CharStyle:Code
14958 \begin_layout PlainLayout
14960 \begin_inset Space ~
14964 \begin_inset Space ~
14972 The help text that is used in the External dialog.
14973 Provide enough information to explain to the user just what the template
14974 can provide him with.
14975 This command must occur exactly once.
14978 \begin_layout Description
14979 \begin_inset Flex CharStyle:Code
14982 \begin_layout PlainLayout
14984 \begin_inset Space ~
14992 The file format of the original file.
14993 This must be the name of a format that is known to LyX (see section
14994 \begin_inset CommandInset ref
14996 reference "sub:Formats"
15002 \begin_inset Quotes eld
15006 \begin_inset Flex CharStyle:Code
15009 \begin_layout PlainLayout
15016 \begin_inset Quotes erd
15019 if the template can handle original files of more than one format.
15020 LyX will attempt to interrogate the file itself in order to deduce its
15021 format in this case.
15022 This command must occur exactly once.
15025 \begin_layout Description
15026 \begin_inset Flex CharStyle:Code
15029 \begin_layout PlainLayout
15031 \begin_inset Space ~
15039 A unique name for the template.
15040 It must not contain substitution macros (see below).
15043 \begin_layout Description
15044 \begin_inset Flex CharStyle:Code
15047 \begin_layout PlainLayout
15049 \begin_inset Space ~
15052 Rotate|Resize|Clip|Extra
15057 This command specifies which transformations are supported by this template.
15058 It may occur zero or more times.
15059 This command enables the corresponding tabs in the external dialog.
15061 \begin_inset Flex CharStyle:Code
15064 \begin_layout PlainLayout
15070 command must have either a corresponding
15071 \begin_inset Flex CharStyle:Code
15074 \begin_layout PlainLayout
15081 \begin_inset Flex CharStyle:Code
15084 \begin_layout PlainLayout
15091 \begin_inset Flex CharStyle:Code
15094 \begin_layout PlainLayout
15101 Otherwise the transformation will not be supported by that format.
15104 \begin_layout Subsection
15108 \begin_layout Description
15109 \begin_inset Flex CharStyle:Code
15112 \begin_layout PlainLayout
15114 \begin_inset Space ~
15117 LaTeX|PDFLaTeX|PlainText|DocBook
15122 The primary document file format that this format definition is for.
15123 Not every template has a sensible representation in all document file formats.
15124 Please define nevertheless a
15125 \begin_inset Flex CharStyle:Code
15128 \begin_layout PlainLayout
15134 section for all formats.
15135 Use a dummy text when no representation is available.
15136 Then you can at least see a reference to the external material in the exported
15140 \begin_layout Description
15141 \begin_inset Flex CharStyle:Code
15144 \begin_layout PlainLayout
15146 \begin_inset Space ~
15150 \begin_inset Space ~
15158 This command defines an additional macro
15159 \begin_inset Flex CharStyle:Code
15162 \begin_layout PlainLayout
15168 for substitution in
15169 \begin_inset Flex CharStyle:Code
15172 \begin_layout PlainLayout
15180 \begin_inset Flex CharStyle:Code
15183 \begin_layout PlainLayout
15189 itself may contain substitution macros.
15190 The advantage over using
15191 \begin_inset Flex CharStyle:Code
15194 \begin_layout PlainLayout
15201 \begin_inset Flex CharStyle:Code
15204 \begin_layout PlainLayout
15210 is that the substituted value of
15211 \begin_inset Flex CharStyle:Code
15214 \begin_layout PlainLayout
15220 is sanitized so that it is a valid optional argument in the document format.
15221 This command may occur zero or more times.
15224 \begin_layout Description
15225 \begin_inset Flex CharStyle:Code
15228 \begin_layout PlainLayout
15230 \begin_inset Space ~
15238 The text that is inserted in the exported document.
15239 This is actually the most important command and can be quite complex.
15240 This command must occur exactly once.
15243 \begin_layout Description
15244 \begin_inset Flex CharStyle:Code
15247 \begin_layout PlainLayout
15249 \begin_inset Space ~
15257 This command specifies a preamble snippet that will be included in the
15259 It has to be defined using
15260 \begin_inset Flex CharStyle:Code
15263 \begin_layout PlainLayout
15269 \SpecialChar \ldots{}
15271 \begin_inset Flex CharStyle:Code
15274 \begin_layout PlainLayout
15281 This command may occur zero or more times.
15284 \begin_layout Description
15285 \begin_inset Flex CharStyle:Code
15288 \begin_layout PlainLayout
15290 \begin_inset Space ~
15294 \begin_inset Space ~
15302 This command denotes files that are created by the conversion process and
15303 are needed for a particular export format.
15304 If the filename is relative, it is interpreted relative to the master document.
15305 This command may be given zero or more times.
15308 \begin_layout Description
15309 \begin_inset Flex CharStyle:Code
15312 \begin_layout PlainLayout
15314 \begin_inset Space ~
15322 The name of a required LaTeX package.
15323 The package is included via
15324 \begin_inset Flex CharStyle:Code
15327 \begin_layout PlainLayout
15335 in the LaTeX preamble.
15336 This command may occur zero or more times.
15339 \begin_layout Description
15340 \begin_inset Flex CharStyle:Code
15343 \begin_layout PlainLayout
15345 \begin_inset Space ~
15349 \begin_inset Space ~
15352 RotationLatexCommand
15357 This command specifies that the built in LaTeX command should be used for
15359 This command may occur once or not at all.
15362 \begin_layout Description
15363 \begin_inset Flex CharStyle:Code
15366 \begin_layout PlainLayout
15368 \begin_inset Space ~
15372 \begin_inset Space ~
15380 This command specifies that the built in LaTeX command should be used for
15382 This command may occur once or not at all.
15385 \begin_layout Description
15386 \begin_inset Flex CharStyle:Code
15389 \begin_layout PlainLayout
15391 \begin_inset Space ~
15395 \begin_inset Space ~
15398 RotationLatexOption
15403 This command specifies that rotation is done via an optional argument.
15404 This command may occur once or not at all.
15407 \begin_layout Description
15408 \begin_inset Flex CharStyle:Code
15411 \begin_layout PlainLayout
15413 \begin_inset Space ~
15417 \begin_inset Space ~
15425 This command specifies that resizing is done via an optional argument.
15426 This command may occur once or not at all.
15429 \begin_layout Description
15430 \begin_inset Flex CharStyle:Code
15433 \begin_layout PlainLayout
15435 \begin_inset Space ~
15439 \begin_inset Space ~
15447 This command specifies that clipping is done via an optional argument.
15448 This command may occur once or not at all.
15451 \begin_layout Description
15452 \begin_inset Flex CharStyle:Code
15455 \begin_layout PlainLayout
15457 \begin_inset Space ~
15461 \begin_inset Space ~
15469 This command specifies that an extra optional argument is used.
15470 This command may occur once or not at all.
15473 \begin_layout Description
15474 \begin_inset Flex CharStyle:Code
15477 \begin_layout PlainLayout
15479 \begin_inset Space ~
15487 The file format of the converted file.
15488 This must be the name of a format that is known to LyX (see the
15489 \begin_inset Flex CharStyle:MenuItem
15492 \begin_layout PlainLayout
15497 ools\SpecialChar \menuseparator
15502 references:Conversion
15508 This command must occur exactly once.
15511 \begin_layout Description
15512 \begin_inset Flex CharStyle:Code
15515 \begin_layout PlainLayout
15517 \begin_inset Space ~
15525 The file name of the converted file.
15526 The file name must be absolute.
15527 This command must occur exactly once.
15530 \begin_layout Subsection
15531 Preamble definitions
15534 \begin_layout Standard
15535 The external template configuration file may contain additional preamble
15536 definitions enclosed by
15537 \begin_inset Flex CharStyle:Code
15540 \begin_layout PlainLayout
15546 \SpecialChar \ldots{}
15548 \begin_inset Flex CharStyle:Code
15551 \begin_layout PlainLayout
15558 They can be used by the templates in the
15559 \begin_inset Flex CharStyle:Code
15562 \begin_layout PlainLayout
15571 \begin_layout Section
15572 The substitution mechanism
15575 \begin_layout Standard
15576 When the external material facility invokes an external program, it is done
15577 on the basis of a command defined in the template configuration file.
15578 These commands can contain various macros that are expanded before execution.
15579 Execution always take place in the directory of the containing document.
15582 \begin_layout Standard
15583 Also, whenever external material is to be displayed, the name will be produced
15584 by the substitution mechanism, and most other commands in the template
15585 definition support substitution as well.
15588 \begin_layout Standard
15589 The available macros are the following:
15592 \begin_layout Description
15593 \begin_inset Flex CharStyle:Code
15596 \begin_layout PlainLayout
15597 $$AbsOrRelPathMaster
15602 The file path, absolute or relative to the master LyX document.
15605 \begin_layout Description
15606 \begin_inset Flex CharStyle:Code
15609 \begin_layout PlainLayout
15610 $$AbsOrRelPathParent
15615 The file path, absolute or relative to the LyX document.
15618 \begin_layout Description
15619 \begin_inset Flex CharStyle:Code
15622 \begin_layout PlainLayout
15628 The absolute file path.
15631 \begin_layout Description
15632 \begin_inset Flex CharStyle:Code
15635 \begin_layout PlainLayout
15641 The filename without path and without the extension.
15644 \begin_layout Description
15645 \begin_inset Flex CharStyle:Code
15648 \begin_layout PlainLayout
15650 \begin_inset Quotes eld
15654 \begin_inset Quotes erd
15662 This macro will expand to the contents of the file with the name
15663 \begin_inset Flex CharStyle:Code
15666 \begin_layout PlainLayout
15675 \begin_layout Description
15676 \begin_inset Flex CharStyle:Code
15679 \begin_layout PlainLayout
15685 The file extension (including the dot).
15688 \begin_layout Description
15689 \begin_inset Flex CharStyle:Code
15692 \begin_layout PlainLayout
15698 The filename of the file specified in the external material dialog.
15699 This is either an absolute name, or it is relative to the LyX document.
15702 \begin_layout Description
15703 \begin_inset Flex CharStyle:Code
15706 \begin_layout PlainLayout
15713 \begin_inset Flex CharStyle:Code
15716 \begin_layout PlainLayout
15722 (absolute name or relative to the LyX document).
15725 \begin_layout Description
15726 \begin_inset Flex CharStyle:Code
15729 \begin_layout PlainLayout
15735 The file path, relative to the master LyX document.
15738 \begin_layout Description
15739 \begin_inset Flex CharStyle:Code
15742 \begin_layout PlainLayout
15748 The file path, relative to the LyX document.
15751 \begin_layout Description
15752 \begin_inset Flex CharStyle:Code
15755 \begin_layout PlainLayout
15761 This macro will expand to the absolute path of the system directory.
15762 This is typically used to point to the various helper scripts that are
15766 \begin_layout Description
15767 \begin_inset Flex CharStyle:Code
15770 \begin_layout PlainLayout
15776 A name and full path to a temporary file which will be automatically deleted
15777 whenever the containing document is closed, or the external material insertion
15781 \begin_layout Standard
15782 All path macros contain a trailing directory separator, so you can construct
15784 the absolute filename with
15785 \begin_inset Flex CharStyle:Code
15788 \begin_layout PlainLayout
15789 $$AbsPath$$Basename$$Extension
15797 \begin_layout Standard
15798 The macros above are substituted in all commands unless otherwise noted.
15800 \begin_inset Flex CharStyle:Code
15803 \begin_layout PlainLayout
15809 supports additionally the following substitutions if they are enabled by
15811 \begin_inset Flex CharStyle:Code
15814 \begin_layout PlainLayout
15821 \begin_inset Flex CharStyle:Code
15824 \begin_layout PlainLayout
15833 \begin_layout Description
15834 \begin_inset Flex CharStyle:Code
15837 \begin_layout PlainLayout
15843 The front part of the resize command.
15846 \begin_layout Description
15847 \begin_inset Flex CharStyle:Code
15850 \begin_layout PlainLayout
15856 The back part of the resize command.
15859 \begin_layout Description
15860 \begin_inset Flex CharStyle:Code
15863 \begin_layout PlainLayout
15869 The front part of the rotation command.
15872 \begin_layout Description
15873 \begin_inset Flex CharStyle:Code
15876 \begin_layout PlainLayout
15882 The back part of the rotation command.
15885 \begin_layout Standard
15886 The value string of the
15887 \begin_inset Flex CharStyle:Code
15890 \begin_layout PlainLayout
15896 command supports additionally the following substitutions if they are enabled
15898 \begin_inset Flex CharStyle:Code
15901 \begin_layout PlainLayout
15908 \begin_inset Flex CharStyle:Code
15911 \begin_layout PlainLayout
15920 \begin_layout Description
15921 \begin_inset Flex CharStyle:Code
15924 \begin_layout PlainLayout
15933 \begin_layout Description
15934 \begin_inset Flex CharStyle:Code
15937 \begin_layout PlainLayout
15946 \begin_layout Description
15947 \begin_inset Flex CharStyle:Code
15950 \begin_layout PlainLayout
15959 \begin_layout Description
15960 \begin_inset Flex CharStyle:Code
15963 \begin_layout PlainLayout
15969 The rotation option.
15972 \begin_layout Standard
15973 You may ask why there are so many path macros.
15974 There are mainly two reasons:
15977 \begin_layout Enumerate
15978 Relative and absolute file names should remain relative or absolute, respectivel
15980 Users may have reasons to prefer either form.
15981 Relative names are useful for portable documents that should work on different
15982 machines, for example.
15983 Absolute names may be required by some programs.
15986 \begin_layout Enumerate
15987 LaTeX treats relative file names differently than LyX and other programs
15988 in nested included files.
15989 For LyX, a relative file name is always relative to the document that contains
15991 For LaTeX, it is always relative to the master document.
15992 These two definitions are identical if you have only one document, but
15993 differ if you have a master document that includes part documents.
15994 That means that relative filenames must be transformed when presented to
15996 Fortunately LyX does this automatically for you if you choose the right
16000 \begin_layout Standard
16001 So which path macro should be used in new template definitions? The rule
16005 \begin_layout Itemize
16007 \begin_inset Flex CharStyle:Code
16010 \begin_layout PlainLayout
16016 if an absolute path is required.
16019 \begin_layout Itemize
16021 \begin_inset Flex CharStyle:Code
16024 \begin_layout PlainLayout
16025 $$AbsOrRelPathMaster
16030 if the substituted string is some kind of LaTeX input.
16033 \begin_layout Itemize
16035 \begin_inset Flex CharStyle:Code
16038 \begin_layout PlainLayout
16039 $$AbsOrRelPathParent
16044 in order to preserve the user's choice.
16047 \begin_layout Standard
16048 There are special cases where this rule does not work and e.g.
16049 \begin_inset Space ~
16052 relative names are needed, but normally it will work just fine.
16053 One example for such a case is the command
16054 \begin_inset Flex CharStyle:Code
16057 \begin_layout PlainLayout
16058 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
16063 in the XFig template above: We can't use the absolute name because the
16065 \begin_inset Flex CharStyle:Code
16068 \begin_layout PlainLayout
16074 files needs the relative name in order to rewrite the file content.
16077 \begin_layout Section
16078 \begin_inset CommandInset label
16080 name "sec:Security-discussion"
16084 Security discussion
16087 \begin_layout Standard
16088 \begin_inset Note Note
16091 \begin_layout PlainLayout
16092 This section is outdated
16097 The external material feature interfaces with a lot of external programs
16098 and does so automatically, so we have to consider the security implications
16100 In particular, since you have the option of including your own filenames
16101 and/or parameter strings and those are expanded into a command, it seems
16102 that it would be possible to create a malicious document which executes
16103 arbitrary commands when a user views or prints the document.
16104 This is something we definately want to avoid.
16107 \begin_layout Standard
16108 However, since the external program commands are specified in the template
16109 configuration file only, there are no security issues if LyX is properly
16110 configured with safe templates only.
16111 This is so because the external programs are invoked with the
16112 \begin_inset Flex CharStyle:Code
16115 \begin_layout PlainLayout
16121 -system call rather than the
16122 \begin_inset Flex CharStyle:Code
16125 \begin_layout PlainLayout
16131 system-call, so it's not possible to execute arbitrary commands from the
16132 filename or parameter section via the shell.
16135 \begin_layout Standard
16136 This also implies that you are restricted in what command strings you can
16137 use in the external material templates.
16138 In particular, pipes and redirection are not readily available.
16139 This has to be so if LyX should remain safe.
16140 If you want to use some of the shell features, you should write a safe
16141 script to do this in a controlled manner, and then invoke the script from
16142 the command string.
16144 \begin_inset Flex CharStyle:Code
16147 \begin_layout PlainLayout
16153 directory of the LyX installation, you can find a safe wrapper script
16154 \begin_inset Flex CharStyle:Code
16157 \begin_layout PlainLayout
16158 general_command_wrapper.py
16163 that supports redirection of input and output.
16164 That can serve as an example for how to write safe template scripts.
16165 For a more advanced example that uses
16166 \begin_inset Flex CharStyle:Code
16169 \begin_layout PlainLayout
16175 and friends, take a look at the
16176 \begin_inset Flex CharStyle:Code
16179 \begin_layout PlainLayout
16188 \begin_layout Standard
16189 It is possible to design a template that interacts directly with the shell,
16190 but since this would allow a malicious user to execute arbitrary commands
16191 by writing clever filenames and/or parameters, we generally recommend that
16192 you only use safe scripts that work with the
16193 \begin_inset Flex CharStyle:Code
16196 \begin_layout PlainLayout
16202 system call in a controlled manner.
16203 Of course, for use in a controlled environment, it can be tempting to just
16204 fall back to use ordinary shell scripts.
16205 If you do so, be aware that you
16209 provide an easily exploitable security hole in your system.
16210 Of course it stands to reason that such unsafe templates will never be
16211 included in the standard LyX distribution, although we do encourage people
16212 to submit new templates in the open source tradition.
16213 But LyX as shipped from the official distribution channels will never have
16217 \begin_layout Standard
16218 Including external material provides a lot of power, and you have to be
16219 careful not to introduce security hazards with this power.
16220 A subtle error in a single line in an innocent looking script can open
16221 the door to huge security problems.
16222 So if you do not fully understand the issues, we recommend that you consult
16223 a knowledgable security professional or the LyX development team if you
16224 have any questions about whether a given template is safe or not.
16225 And do this before you use it in an uncontrolled environment.
16228 \begin_layout Chapter
16232 \begin_layout Section
16236 \begin_layout Standard
16237 The LyX server is a method implemented in LyX that will enable other programs
16238 to talk to LyX, invoke LyX commands, and retrieve information about the
16239 LyX internal state.
16240 This is only intended for advanced users, but they should find it useful.
16241 Please note that, at present,
16243 the server does not work on Windows
16249 \begin_layout PlainLayout
16250 There is no principled reason it cannot do so.
16251 But none of the developers on Windows® have yet implemented this functionality
16260 \begin_layout Section
16261 Starting the LyX Server
16264 \begin_layout Standard
16265 The LyX server works through the use of a pair of named pipes.
16266 These are usually located in
16267 \begin_inset Flex CharStyle:Code
16270 \begin_layout PlainLayout
16277 \begin_inset Quotes eld
16281 \begin_inset Flex CharStyle:Code
16284 \begin_layout PlainLayout
16291 \begin_inset Quotes erd
16295 \begin_inset Quotes eld
16299 \begin_inset Flex CharStyle:Code
16302 \begin_layout PlainLayout
16309 \begin_inset Quotes erd
16313 External programs write into
16314 \begin_inset Flex CharStyle:Code
16317 \begin_layout PlainLayout
16323 and read back data from
16324 \begin_inset Flex CharStyle:Code
16327 \begin_layout PlainLayout
16334 The stem of the pipe names can be defined in the
16335 \begin_inset Flex CharStyle:MenuItem
16338 \begin_layout PlainLayout
16343 ools\SpecialChar \menuseparator
16353 dialog, for example
16354 \begin_inset Flex CharStyle:Code
16357 \begin_layout PlainLayout
16358 "/home/myhome/.lyxpipe"
16366 \begin_layout Standard
16368 \begin_inset Flex CharStyle:Code
16371 \begin_layout PlainLayout
16378 \begin_inset Flex CharStyle:Code
16381 \begin_layout PlainLayout
16387 ' to create the pipes.
16388 The above setting also has the effect of activating the LyX server.
16389 If one of the pipes already exists, LyX will assume that another LyX process
16390 is already running and will not start the server.
16391 To have several LyX processes with servers at the same time, you have to
16392 change the configuration between the start of the programs.
16395 \begin_layout Standard
16396 If you are developing a client program, you might find it useful to enable
16397 debugging information from the LyX server.
16398 Do this by starting LyX as lyx -dbg lyxserver.
16401 \begin_layout Standard
16402 Warning: if LyX crashes, it may not manage to remove the pipes; in this
16403 case you must remove them manually.
16404 If LyX starts and the pipes exist already, it will not start any server.
16407 \begin_layout Standard
16408 Other than this, there are a few points to consider:
16411 \begin_layout Itemize
16412 Both server and clients must run on UNIX or OS/2 machines.
16413 Communications between LyX on UNIX and clients on OS/2 or vice versa is
16414 not possible right now.
16417 \begin_layout Itemize
16418 On OS/2, only one client can connect to LyXServer at a time.
16421 \begin_layout Itemize
16422 On OS/2, clients must open inpipe with
16423 \begin_inset Flex CharStyle:Code
16426 \begin_layout PlainLayout
16435 \begin_layout Standard
16439 \begin_layout Standard
16440 You can find a complete example client written in C in the source distribution
16442 \begin_inset Flex CharStyle:Code
16445 \begin_layout PlainLayout
16446 development/lyxserver/server_monitor.c
16454 \begin_layout Section
16455 Normal communication
16458 \begin_layout Standard
16459 To issue a LyX call, the client writes a line of ASCII text into the input
16461 This line has the following format:
16464 \begin_layout Quote
16478 \begin_layout Description
16483 is a name that the client can choose arbitrarily.
16484 Its only use is that LyX will echo it if it sends an answer---so a client
16485 can dispatch results from different requesters.
16488 \begin_layout Description
16493 is the function you want LyX to perform.
16494 It is the same as the commands you'd use in the minibuffer.
16497 \begin_layout Description
16502 is an optional argument which is meaningful only to some functions (for
16504 \begin_inset Quotes eld
16508 \begin_inset Quotes erd
16511 which will insert the argument as text at the cursor position.)
16514 \begin_layout Standard
16515 The answer from LyX will arrive in the output pipe and be of the form
16518 \begin_layout Quote
16532 \begin_layout Standard
16541 are just echoed from the command request, while
16545 is more or less useful information filled according to how the command
16546 execution worked out.
16547 Some commands will return information about the internal state of LyX,
16549 \begin_inset Quotes eld
16553 \begin_inset Quotes erd
16556 , while other will return an empty data-response.
16557 This means that the command execution went fine.
16560 \begin_layout Standard
16561 In case of errors, the response from LyX will have this form
16564 \begin_layout Quote
16578 \begin_layout Standard
16583 should contain an explanation of why the command failed.
16586 \begin_layout Standard
16590 \begin_layout LyX-Code
16591 echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
16594 \begin_layout LyX-Code
16595 echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
16597 read a <~/.lyxpipe.out
16602 \begin_layout Section
16606 \begin_layout Standard
16607 LyX can notify clients of events going on asynchronously.
16608 Currently it will only do this if the user binds a key sequence with the
16610 \begin_inset Quotes eld
16614 \begin_inset Quotes erd
16618 The format of the string LyX sends is as follows:
16621 \begin_layout Quote
16622 \begin_inset Flex CharStyle:Code
16625 \begin_layout PlainLayout
16636 \begin_layout Standard
16641 is the printed representation of the key sequence that was actually typed
16645 \begin_layout Standard
16646 This mechanism can be used to extend LyX's command set and implement macros:
16647 bind some key sequence to
16648 \begin_inset Quotes eld
16652 \begin_inset Quotes erd
16655 , start a client that listens on the out pipe, dispatches the command according
16656 to the sequence and starts a function that may use LyX calls and LyX requests
16657 to issue a command or a series of commands to LyX.
16660 \begin_layout Section
16661 The simple LyX Server Protocol
16664 \begin_layout Standard
16665 LyX implements a simple protocol that can be used for session management.
16666 All messages are of the form
16669 \begin_layout Quote
16679 \begin_layout Standard
16685 \begin_inset Quotes eld
16689 \begin_inset Quotes erd
16693 \begin_inset Quotes eld
16697 \begin_inset Quotes erd
16702 \begin_inset Quotes eld
16706 \begin_inset Quotes erd
16709 is received from a client, LyX will report back to inform the client that
16710 it's listening to it's messages, while
16711 \begin_inset Quotes eld
16715 \begin_inset Quotes erd
16718 sent from LyX will inform clients that LyX is closing.