1 #LyX 1.4.0cvs created this file. For more info see http://www.lyx.org/
8 \IfFileExists{isolatin.def}
9 {\usepackage[isolatin]{inputenc}}
10 {\usepackage[latin1]{inputenc}}
13 \inputencoding default
16 \paperfontsize default
23 \paperorientation portrait
26 \paragraph_separation indent
28 \quotes_language english
32 \paperpagestyle headings
33 \tracking_changes false
41 Customizing LyX: Features for the Advanced User
50 \begin_layout Standard
52 Principal maintainer of this file is
57 If you have comments or error corrections, please send them to the LyX
58 Documentation mailing list, <lyx-docs@lists.lyx.org>.
66 \begin_layout Standard
69 \begin_inset LatexCommand \tableofcontents{}
81 \begin_layout Standard
83 This manual covers the customization features present in LyX.
84 In it, we discuss issues like keyboard shortcuts, screen previewing options,
85 printer options, sending commands to LyX via the LyX Server, internationalizati
86 on, installing new LaTeX classes and LyX layouts, etc.
87 We can't possibly hope to touch on everything you can change---our developers
88 add new features faster than we can document them---but we will explain
89 the most common customizations and hopefully point you in the right direction
90 for some of the more obscure ones.
95 LyX configuration files
98 \begin_layout Standard
101 \begin_inset LatexCommand \label{chap:config}
105 This chapter aims to help you to find your way through the LyX configuration
107 Before continuing to read this chapter, you should find out where your
108 LyX library directory is by using
113 elp\SpecialChar \menuseparator
121 This directory is the place where LyX places its system-wide configuration
122 files, and we will simply name it
126 in the remainder of this document.
130 \begin_layout Section
139 \begin_layout Standard
145 and its sub-directories contain a number of files and that can be used
146 to customise LyX's behaviour.
147 You can change many of these files from within LyX itself through the
152 ools\SpecialChar \menuseparator
160 Most customization that you might want to do to LyX is possible through
162 However, many other inner aspects of LyX can be customized by modifying
168 They fall in different categories, described in the following subsections.
171 \begin_layout Subsection
173 Automatically generated files
176 \begin_layout Standard
178 These files are generated when you configure LyX.
179 They contain various default values that are guessed by inspection.
180 In general, it is not a good idea to modify them, since they might be overwritt
185 \labelwidthstring 00.00.0000
193 contains defaults for various commands.
197 \labelwidthstring 00.00.0000
205 contains the list of packages that have been recognized by LyX.
206 It is currently unused by the LyX program itself, but the information extracted
207 , and more, is made available with
212 elp\SpecialChar \menuseparator
224 \labelwidthstring 00.00.0000
232 is the list of text classes that have been found in your
236 directory, along with the associated LaTeX document class and their description.
240 \labelwidthstring 00.00.0000
246 is automatically generated during configuration from the file
253 \begin_layout Subsection
259 \labelwidthstring 00.00.0000
267 this directory contains files with the extension
271 that define the keybindings used in LyX (see section\InsetSpace ~
273 \begin_inset LatexCommand \ref{sec:bindings}
278 If there exists an internationalized version of the bindfile named
282 , that will be used first.
283 See Chapter\InsetSpace ~
285 \begin_inset LatexCommand \ref{chap:i18n}
290 \begin_inset LatexCommand \ref{sec:bindings}
298 \labelwidthstring 00.00.0000
306 contains graphics files that can be included in documents.
311 \labelwidthstring 00.00.0000
319 contains LyX documentation files (including the one you are currently reading).
324 deserves special attention, as noted above.
325 If there exists an internationalized version of the help-document with
330 prepended to the name, that will be used first.
331 See Chapter\InsetSpace ~
333 \begin_inset LatexCommand \ref{chap:i18n}
341 \labelwidthstring 00.00.0000
349 contains example files that explain how to use some features.
350 In the file browser, press the
358 \labelwidthstring 00.00.0000
364 contains image files that are used by the
369 In addition, it also contains the individual icons used in the toolbar
370 and the banners that can be shown when LyX is launched.
374 \labelwidthstring 00.00.0000
382 contains keyboard keymapping files.
383 See Chapter\InsetSpace ~
385 \begin_inset LatexCommand \ref{sec:keymap}
393 \labelwidthstring 00.00.0000
401 contains the text class files described in Chapter\InsetSpace ~
403 \begin_inset LatexCommand \ref{chap:textclass}
411 \labelwidthstring 00.00.0000
417 contains lots of files that together make up reLyX, the translator of
418 \begin_inset Quotes eld
422 \begin_inset Quotes erd
429 \labelwidthstring 00.00.0000
435 contains some files that demonstrate the capabilities of the
437 External\InsetSpace ~
444 \labelwidthstring 00.00.0000
450 contains the standard LyX template files described in Chapter\InsetSpace ~
452 \begin_inset LatexCommand \ref{sec:templates}
460 \labelwidthstring 00.00.0000
466 contains some LaTeX cls files distributed with LyX.
470 \labelwidthstring 00.00.0000
476 contains files with the extension
480 that define the user interface to LyX.
481 That is, the files define which items appear in which menus and the items
482 appearing on the toolbar.
483 See Chapter\InsetSpace ~
485 \begin_inset LatexCommand \ref{sec:ui}
492 \begin_layout Subsection
494 Files you don't want to modify
497 \begin_layout Standard
499 These files are used internally by LyX and you generally do not need to
500 modify them unless you are a developer.
504 \labelwidthstring 00.00.0000
512 this file contains the list of LyX developers.
513 The contents are displayed with the menu entry
518 elp\SpecialChar \menuseparator
526 \labelwidthstring 00.00.0000
534 this is a LaTeX script used during the configuration process.
539 \labelwidthstring 00.00.0000
547 this is the script that is used to re-configure LyX.
548 It creates configuration files in the directory it was run from.
551 \begin_layout Subsection
553 Other files needing a line or two...
557 \labelwidthstring 00.00.0000
563 this contains tables describing how different character encodings can be
568 \labelwidthstring 00.00.0000
574 this file contains the templates available to the new
576 External\InsetSpace ~
583 \labelwidthstring 00.00.0000
589 this file contains a list of all the languages currently supported by LyX.
593 \labelwidthstring 00.00.0000
599 Deprecated and definitely obfuscated.
600 This is the old style preferences file.
601 It will probably disappear in the near future.
604 \begin_layout Section
606 Your local configuration directory
609 \begin_layout Standard
611 Even if you are using LyX as an unprivileged user, you might want to change
612 LyX configuration for your own use.
617 directory contains all your personal configuration files.
618 This is the directory described as
619 \begin_inset Quotes eld
623 \begin_inset Quotes erd
631 elp\SpecialChar \menuseparator
636 This directory is used as a mirror of
640 , which means that every file in
644 is a replacement for the corresponding file in
649 Any configuration file described in the above sections can be placed either
650 in the system-wide directory, in which case it will affect all users, or
651 in your local directory for your own use.
654 \begin_layout Standard
656 To make things clearer, let's provide a few examples:
659 \begin_layout Itemize
661 The preferences set in the
666 ools\SpecialChar \menuseparator
673 dialog are saved to a file
684 \begin_layout Itemize
686 When you reconfigure using
691 ools\SpecialChar \menuseparator
702 and the resulting files are written in your local configuration directory
703 (see section\InsetSpace ~
705 \begin_inset LatexCommand \ref{sec:autodetected}
709 to have a list of the
713 settings affected by this section).
714 This means that any additional text class file that you might have added
719 will be added to the list of classes in the
724 ayout\SpecialChar \menuseparator
734 \begin_layout Itemize
736 Similarly, if you have installed some LaTeX document classes in your home
737 directory, that LaTeX can find with your
741 path, they will show up in your list of text classes.
745 \begin_layout Standard
747 as long as LyX or yourself have a
751 file for it, of course.
759 \begin_layout Itemize
761 If you get some updated documentation from LyX ftp site and cannot install
762 it because you do not have sysadmin rights on your system, you can just
777 \begin_layout Section
779 Running LyX with multiple configurations
782 \begin_layout Standard
784 The configuration freedom of the local configuration directory may not suffice
785 if you want to have more than one configuration at your disposal.
786 For example, you may want to be use different key bindings or printer settings
788 You can achieve this by having several such directories.
789 You then specify which directory to use at run-time.
792 \begin_layout Standard
794 Invoking LyX with the command line switch
801 instructs the program to read the configuration from that directory, and
802 not from the default directory (you can determine the default directory
803 by running LyX without this switch as described above).
804 If this directory does not exist, LyX offers to create it for you, just
805 like it does for the default directory on the first time you run the program.
806 You can modify the configuration options in this additional
810 exactly as you would for the default directory.
811 These directories are completely independent (but read on).
812 Note that setting the environment variable
816 to some value has exactly the same effect
821 \begin_layout Standard
823 Having several configurations also requires more maintenance: if you want
824 to add a new layout to
828 which you want available from all your configurations, you must add it
829 to each directory separately.
830 You can avoid this with the following trick: after LyX creates the additional
831 directory, most of the subdirectories (see above) are empty.
832 If you want the new configuration to mirror an existing one, replace the
833 empty subdirectory with a symbolic link to the matching subdirectory in
834 the existing configuration.
841 subirectory, however, since it contains a file written by the configuration
842 script (also accessible through
847 ools\SpecialChar \menuseparator
853 \begin_inset LatexCommand \ref{sec:autodetected}
859 which is configuration-specific.
862 \begin_layout Chapter
874 \begin_layout Section
876 Using the dialog for the first time
879 \begin_layout Standard
885 file will contain only changes that you have made to the default behaviour,
886 some of which is hard-coded into LyX and some of which is contained in
889 LyXDir/lyxrc.defaults
892 Note that in both files lines beginning with a
893 \begin_inset Quotes eld
901 \begin_inset Quotes erd
904 are just comments and not interpreted.
905 However, only system administrators should edit
916 ools\SpecialChar \menuseparator
923 dialog to create and modify their own
930 \begin_layout Standard
937 ools\SpecialChar \menuseparator
944 dialog will be largely self-explanatory.
945 Almost all the commands have an associated comment, so you shouldn't have
946 too much trouble modifying it to taste.
947 Before we highlight a few of the more important commands below, however,
952 ing some of your changes (e.g., screen fonts) will have an instant effect.
954 changing the bind file) will not.
955 If nothing appears to have changed, just
959 the changes and restart LyX.
962 \begin_layout Section
967 \begin_layout Standard
969 The font used to display your documents on the LyX screen is very important,
970 since you'll be reading all your documents with this font.
971 Therefore it is important that the font is as readable and good-looking
973 The LyX team tried to provide the best possible default font for you, but
974 since practically all X11 systems are different, it's likely that the default
975 fonts will be sub-optimal on your system.
976 Fortunately, you can do something about this.
977 Before we explain how to do this, you should learn a bit more about fonts
978 so that you are better prepared for choosing your fonts, because it is
979 a trade-off that is specific to your preferences and the capabilities of
983 \begin_layout Standard
985 Notice that this section only deals with the fonts on the
989 inside the LyX window.
990 The fonts that appear on the
998 are independent from these fonts, and are determined by the document class.
1003 to learn how to change the font of the printed version of your document.
1006 \begin_layout Standard
1008 Basically, screen fonts come in two different kinds: scalable outline fonts
1009 and non-scalable bitmap fonts.
1010 This distinction seems a bit arbitrary, since non-scalable fonts are actually
1011 scalable in most modern font renderers.
1012 The difference lies in the
1016 of the scaling, and the
1021 The most important decision is thus whether you should use non-scalable
1022 bitmap fonts or scalable outline fonts.
1025 \begin_layout Standard
1027 The scalable fonts are built from
1031 of the single glyphs (i.e.
1032 characters) in the font.
1033 This means that each glyph is defined using mathematical curves that are
1034 well suited for scaling to any requested size.
1035 This mathematical definition is interpreted by the font renderer and turned
1036 into a small picture composed of pixels according to which size and glyph,
1037 the programmer requests.
1038 This means that scalable fonts will look pretty good in all sizes.
1039 Well, almost all sizes.
1040 Since scalable fonts are defined in an abstract way, it can be hard to
1041 provide a good rendering at small sizes, where each pixel has to be very
1042 carefully computed to provide a good image.
1043 Technically it is possible to do this from the mathematical definition,
1044 but in order to keep the rendering reasonably fast, tradeoffs have to be
1045 made, and the result is that scalable fonts can be difficult to read at
1049 \begin_layout Standard
1051 Bitmap fonts on the other hand, are defined by bitmap graphics from the
1052 start, so they will look good at all the sizes they are meant for.
1053 However, they don't scale well, because in order to scale a glyph, each
1054 pixel is enlarged into several pixels.
1055 It is the same effect that happens if you try to enlarge a picture in
1059 or any other picture manipulation program.
1060 In order to relieve this effect, bitmap fonts are typically provided in
1061 several fixed sizes typically from around 8 pixels high up to 34 pixels
1062 or so high in steps according to what is believed to be useful.
1063 The advantage of bitmap fonts is that no complicated computations are necessary
1064 to display each glyph, so bitmap fonts are thus faster displayed than scalable
1066 The disadvantage is that sizes that don't exists as fixed versions have
1067 to be scaled by doubling pixels, and thus look bad.
1070 \begin_layout Standard
1072 The net result of all this, is that bitmap fonts are generally best for
1073 the small sizes, where they are available, while scalable fonts are generally
1074 best for large sizes.
1075 The logical conclusion would thus be to use bitmap fonts for the small
1076 sizes, and scalable fonts for the large sizes.
1077 Unfortunately, this is not a good idea, since bitmap fonts and scalable
1078 fonts are not designed to be used together, so the overall look of such
1079 a scheme would be bad.
1080 The best you can do is thus to try both schemes and decide for yourself
1084 \begin_layout Standard
1086 By default, LyX uses non-scalable bitmap fonts (when using the XForms frontend).
1091 is used, for sans serif fonts,
1099 is used as the monospaced/typewriter font.
1102 \begin_layout Standard
1104 In the following, we will describe what to do if the text does not look
1106 We'll start with the most important parameters: DPI and font zoom.
1109 \begin_layout Subsection
1111 DPI setting and Font Zoom
1114 \begin_layout Standard
1116 LyX automatically tries to scale the fonts to look as close as the paper
1117 output size as possible, except for the so-called font zoom factor.
1120 \begin_layout Standard
1122 In order for this to work on all systems, it relies on the screen DPI (dots
1123 per inch) setting to be correct.
1124 The DPI setting for your system is autodetected by LyX using the information
1125 the X server can provide.
1126 You can check what LyX autodetects the DPI setting to, by running LyX as
1134 \begin_layout Standard
1136 On many systems, X is not set up correctly, so you should check that it
1139 \begin_inset Quotes eld
1147 \begin_inset Quotes erd
1150 and write down what the DPI is for the resolution you use (this will be
1151 close to the value LyX detects).
1152 It is the number mentioned as
1153 \begin_inset Quotes eld
1157 \begin_inset Quotes erd
1161 Also write down the number of pixels you have in the width (the first number
1163 \begin_inset Quotes eld
1167 \begin_inset Quotes erd
1173 \begin_layout Standard
1175 Then get the good old ruler out of the closet, and measure the width of
1176 the visible screen-image on your monitor.
1177 Convert this measurement to inches if you used a centimeter ruler by dividing
1179 Now you can determine the correct DPI setting for your screen by dividing
1180 the number of pixels in the width by the width of the screen-image on the
1182 If this number is more than, say, 5 DPI from the detected value, you should
1183 either fix the X setup, or at least tell LyX that the DPI is different
1184 than the detected value.
1187 \begin_layout Standard
1189 If you can't fix the X setup (which of course is best since other programs
1190 than LyX will benefit from this as well), you can tell LyX the correct
1198 \begin_layout Standard
1200 If the text is too small or too big for your taste, you should fiddle with
1201 the font zoom setting.
1202 This setting is used to scale the point size of the text.
1203 If your DPI setting is correct, and the font zoom setting is set to 100,
1204 this means that LyX will try to display the text exactly the same size
1205 as it will appear on the paper-output.
1206 If you set the zoom factor to 200, the text will try to be 2 times as big
1208 Of course, this will only happen if LyX can find a font that has the appropriat
1209 e size, which you can't count on.
1210 Since LyX is a WYSIWYM system anyways, this limitation isn't much of an
1214 \begin_layout Standard
1216 The default font zoom setting is 150, since a monitor is typically wider
1217 than a piece of paper, but you should try to fiddle with it through the
1231 dialog to find a size that you like.
1232 When you've found a setting that seems to work nicely for you (tip: use
1240 button to keep the dialog open while you experiment), you can make this
1241 setting the default by using the
1251 \begin_layout Standard
1253 While it is often possible to find a suitable size for the text on the screen,
1254 this doesn't necessarily mean that the fonts are the best ones available
1256 In order to help you get the most out of your system, you can use the font
1257 definition commands to fine-tune the look of the text in greater detail
1261 \begin_layout Subsection
1263 Font definition commands
1266 \begin_layout Standard
1268 As mentioned, LyX uses non-scalable bitmap fonts by default with the XForms
1274 is used, for sans serif fonts,
1282 is used as the monospaced/typewriter font.
1285 \begin_layout Standard
1287 You can change all of these from within the
1292 The number of fonts that are available on different systems vary, but the
1297 should be available everywhere.
1298 Use that program to find candidate fonts.
1299 When you've found a font that you like, try to insert the first two elements
1301 \begin_inset Quotes eld
1305 \begin_inset Quotes erd
1309 \begin_inset Quotes eld
1313 \begin_inset Quotes erd
1320 ) in the appropriate field in the
1332 LyX will then reformat your document using the new font, and if you like
1333 the font, you should
1341 One place to start for a new font is to see if the scalable font
1342 \begin_inset Quotes eld
1346 \begin_inset Quotes erd
1350 Tip: You can see whether a font is a bitmap font or a scalable font by
1352 \begin_inset Quotes eld
1356 \begin_inset Quotes erd
1360 \begin_inset Quotes eld
1364 \begin_inset Quotes erd
1372 If the value 0 is available, the font is scalable.
1373 If the value 0 isn't available, the font is a bitmap font.
1376 \begin_layout Standard
1378 Before you go about scrapping a bitmap font because the larger sizes look
1380 \begin_inset Quotes eld
1384 \begin_inset Quotes erd
1387 , you should toggle the
1388 \begin_inset Quotes eld
1392 \begin_inset Quotes erd
1396 This is only useful if you use bitmap fonts, because only these don't scale
1398 If you define this flag, LyX will only use the fixed font sizes that are
1399 available, and this guarantees that all bitmap fonts look well.
1400 (You can see which individual font sizes are available with the
1409 .) However, the prize is that the difference between the size of the fonts
1410 on screen and the size of fonts on paper will be larger because LyX will
1411 have to be satisfied with the closest available size, and not try to scale
1413 Also, you can risk that some logically different sizes, such as
1421 , will be mapped to the same screen font, making it hard for you to see
1422 the difference on screen.
1423 We've decided not to use scalable fonts by default because of these artifacts,
1424 but since LyX is a WYSIWYM system, many people like to use the flag anyways,
1425 well-knowing that the font size on the screen can't be trusted.
1426 But remember that this flag only makes a difference when you use bitmap
1428 Scalable fonts won't be affected for reasons you should understand by now.
1431 \begin_layout Standard
1433 One final note regarding this flag: you should know that there is nothing
1434 wrong with using bitmap and scalable fonts at the same time for different
1436 For instance, it's common to use the scalable
1437 \begin_inset Quotes eld
1441 \begin_inset Quotes erd
1444 for the serif text together with a bitmap version of
1445 \begin_inset Quotes eld
1449 \begin_inset Quotes erd
1453 And you can safely select the
1454 \begin_inset Quotes eld
1458 \begin_inset Quotes erd
1461 button without worries: It will only apply to the Helvetica font.
1464 \begin_layout Standard
1466 Sometimes the artifacts introduced by use of the flag can be relieved by
1467 using the fine-detail screen font sizes which defines which point sizes
1468 the different logical font sizes correspond to.
1473 to see exactly what concrete fonts the logical sizes map to, and try adjusting
1474 the corresponding entries in the
1478 dialog until you've managed to hit the nail and get the fonts you want.
1479 This can be hard to do, because LyX uses the DPI setting and the font zoom
1480 settings to calculate which exact screen font size to ask the X server
1481 for, thus obfuscating the mapping.
1482 If you can't make it by trial-and-error, you can make the process more
1483 transparent if you set both the DPI setting and font zoom settings to 100---eve
1484 n when this is known to be wrong.
1485 This will of course make your scalable fonts look weird, so use with care.
1488 \begin_layout Subsection
1493 \begin_layout Standard
1495 By default, LyX will use fonts meant to write Western European text, including
1496 all kinds of English.
1497 This is defined through the so-called
1506 If you want to use LyX to write for instance Eastern European text, Cyrillic
1507 or any other language not covered by the ISO-8859-1 font encoding, you
1508 can define a different one with the encoding setting.
1509 This requires you to have special fonts installed.
1514 to see whether this is the case: check the
1515 \begin_inset Quotes eld
1519 \begin_inset Quotes erd
1523 \begin_inset Quotes eld
1527 \begin_inset Quotes erd
1530 fields for ISO-8859-X values different from ISO-8859-1, and search for
1531 one that contains the national characters of your language.
1532 If you find any, enter this encoding in the dialog.
1533 If not, go searching the Web for appropriate fonts.
1534 For the Qt frontend, it's recommended you use an iso646 font set.
1537 \begin_layout Standard
1539 When you've set LyX up to use a different font encoding, you should also
1540 consider changing the font used by dialog windows in LyX.
1547 dialog will not be understandable unless you tell LyX to use a different
1549 By default the menu font is set to
1551 -*-helvetica-medium-r
1553 , but often Helvetica is not available in the font encoding you need, so
1554 the dialog allows this to be changed.
1557 \begin_layout Standard
1559 As you can see, there are quite a few options that can be used to fine tune
1560 the look of your fonts.
1561 This should not scare you from fiddling with the settings, because after
1562 all, you will hopefully be using LyX for many hours in the future.
1563 And contrary to real WYSIWYG word processors where you are tied to using
1564 fonts that have to look good both on paper and on screen, LyX gives you
1565 the possibility of using fonts that are designed to look good on the screen
1566 while using a different set of fonts to look good on paper.
1569 \begin_layout Section
1572 \begin_inset LatexCommand \label{sec:bindings}
1579 \begin_layout Standard
1581 Bindings are used to, well, bind a function to a key.
1582 Several prepackaged binding files are available: a CUA set of bindings
1583 (familiar as the typical set of PC and CDE set of keyboard shortcuts),
1584 an Emacs set of bindings, for those of us who follow the One True Way and
1585 refuse to lower our standards,
1589 \begin_layout Standard
1591 I'm kidding here, of course!
1596 as well as specialty bindings (broadway and hollywood) and other languages
1597 (French, German, etc.).
1600 \begin_layout Standard
1602 If, however, you'd like to customise the keybindings to your own exacting
1603 tastes, then copy the best-fit file in
1612 Don't forget to load this new file into LyX using the
1617 (For the moment you'll have to restart LyX for these changes to take effect.)
1620 \begin_layout Standard
1622 LyX supports internationalization of the user interface (see Chapter\InsetSpace ~
1624 \begin_inset LatexCommand \ref{chap:i18n}
1633 is set, with the environment variable
1637 , LyX will try to use bindfiles by prepending
1642 For example, you can put a translated copy of some standard bind file in
1647 directory, and LyX will use it automatically.
1650 \begin_layout Standard
1656 files is straightforward:
1659 \begin_layout Standard
1665 bind <key combination> <lyx-function>
1668 \begin_layout Standard
1670 Both key combination and lyx-function (including any arguments) must be
1671 enclosed in "double quotes".
1672 All the LyX functions are listed in the
1679 \begin_layout Section
1682 \begin_inset LatexCommand \label{sec:ui}
1689 \begin_layout Standard
1691 The appearance of both the menu and toolbar may both be changed using the
1706 For the moment, only one file exists,
1710 , but feel free to experiment.
1711 Just copy the file to the
1715 directory and play! Note that, for the moment, you'll have to restart LyX
1716 for these changes to take effect.
1719 \begin_layout Standard
1725 files is straightforward: have a look at
1738 entries must be ended with an explicit
1763 s and in the case of the
1764 \begin_inset Quotes eld
1768 \begin_inset Quotes erd
1776 One small word of warning.
1781 s may be inserted in a
1789 , but they are defined as
1800 \begin_layout Section
1802 Converters, Formats, Viewers, Editors and Copiers
1805 \begin_layout Standard
1807 LyX has a powerful mechanism to convert to and from any file format using
1809 Define a pair of formats, e.g.
1819 Now define a converter from one format to the other.
1820 In our example, two possible mechanisms exist.
1823 \begin_layout Enumerate
1825 A direct conversion, from LaTeX to PDF using pdflatex
1828 \begin_layout Enumerate
1830 A more convoluted route using intermediate formats and converters: LaTeX
1831 to DVI (using latex) to PostScript® (using dvips) to PDF (using ps2pdf).
1834 \begin_layout Standard
1836 LyX will always choose the shortest possible route, so you must specify
1837 two different Format names for
1841 files to be able to use either.
1842 Both are included by default in the
1847 Have a look and then invent your own!
1850 \begin_layout Standard
1852 Moreover, each Format can have a Viewer associated with it.
1853 For example, you might want to use
1857 to examine PostScript® files, or
1861 to preview the LaTeX output.
1862 You can alter the viewer to use (and what options to pass to it) via the
1868 ools\SpecialChar \menuseparator
1873 references:Conversion
1876 For example, to change the
1884 format in the dialog, change the viewer to be
1888 (or whatever), and hit
1898 \begin_layout Standard
1900 Editors are like viewers: Each Format can have an Editor associated to it,
1901 and they can be altered via the
1906 ools\SpecialChar \menuseparator
1911 references:Conversion
1914 LyX uses them whenever an included file
1918 \begin_layout Standard
1920 This can be an included
1924 file, a verbatim included text file, external material or an included graphics
1933 \begin_layout Standard
1935 Finally, each Format can have a Copier associated to it.
1936 Since all conversions from one Format to another take place in a temporary
1937 directory, it is sometimes necessary to modify a file before copying it
1938 to the temporary directory
1942 \begin_layout Standard
1944 For example, the file may reference other files with relative filenames,
1945 which will become invalid in the temporary directory
1951 This is done by the Copier: It copies a file to (or from) the temporary
1952 directory and may modify it in the process.
1955 \begin_layout Section
1957 BibTeX and makeindex
1960 \begin_layout Standard
1962 Both the bibliography generating command (default
1966 ) and the index generating command (default
1979 As an alternative for
1991 \begin_layout Standard
1993 The command to enter is
2000 makeindex.sh -m $$lang
2003 \begin_layout Standard
2005 where the placeholder
2009 will be replaced by the chosen document (babel) language.
2013 \begin_layout Standard
2015 have installed the packages
2032 at a shell prompt for a help page.
2035 \begin_layout Section
2037 ASCII export options
2041 \begin_layout Standard
2044 \begin_inset VSpace bigskip
2050 \begin_layout Standard
2052 There are a couple of commands that can be used to
2053 \begin_inset Quotes eld
2057 \begin_inset Quotes erd
2060 exported ASCII text files.
2061 Note that LyX automatically detects and uses the best settings for your
2062 system at installation time, but you can modify them if you disagree with
2066 \begin_layout Description
2076 This option defines the command used to produce better ASCII tables with
2081 UNIX-commands (refer to their manpages for more information about them).
2082 Setting this as empty tells LyX to use the internal (inferior) formatter.
2085 \begin_layout Description
2096 With this command you can set the default line length of the ASCII output
2098 Setting it to 0 means endless lines.
2101 \begin_layout Section
2106 \begin_layout Standard
2108 There are a bunch of configuration options that are used for interaction
2109 with the external print command from LyX.
2110 Normally the defaults are fine: if, however, your print command takes different
2111 option names, you can modify them here.
2114 \begin_layout Subsection
2119 \begin_layout Standard
2121 You can change the colors used by LyX on-screen using the new
2126 Alternatively, if you're feeling particularly perverse you could use the
2131 bindable function (see the
2136 Input would have the format:
2139 \begin_layout Standard
2143 set-color LyXName X11Color
2146 \begin_layout Standard
2148 Here is a (partial) list of the functions and default colors:
2151 \begin_layout Standard
2154 \begin_inset Tabular
2155 <lyxtabular version="3" rows="10" columns="3">
2157 <column alignment="left" valignment="top" leftline="true" width="0pt">
2158 <column alignment="left" valignment="top" leftline="true" width="0pt">
2159 <column alignment="center" valignment="top" leftline="true" rightline="true" width="0pt">
2160 <row topline="true" bottomline="true">
2161 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2164 \begin_layout Standard
2180 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2183 \begin_layout Standard
2199 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2202 \begin_layout Standard
2219 <row topline="true">
2220 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2223 \begin_layout Standard
2239 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2242 \begin_layout Standard
2258 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2261 \begin_layout Standard
2278 <row topline="true">
2279 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2282 \begin_layout Standard
2298 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2301 \begin_layout Standard
2317 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2320 \begin_layout Standard
2337 <row topline="true">
2338 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2341 \begin_layout Standard
2357 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2360 \begin_layout Standard
2376 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2379 \begin_layout Standard
2396 <row topline="true">
2397 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2400 \begin_layout Standard
2416 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2419 \begin_layout Standard
2435 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2438 \begin_layout Standard
2455 <row topline="true">
2456 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2459 \begin_layout Standard
2475 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2478 \begin_layout Standard
2489 fraction Lines, brackets, etc.
2494 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2497 \begin_layout Standard
2514 <row topline="true">
2515 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2518 \begin_layout Standard
2534 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2537 \begin_layout Standard
2543 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2546 \begin_layout Standard
2563 <row topline="true">
2564 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2567 \begin_layout Standard
2583 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2586 \begin_layout Standard
2592 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2595 \begin_layout Standard
2612 <row topline="true">
2613 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2616 \begin_layout Standard
2632 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2635 \begin_layout Standard
2641 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2644 \begin_layout Standard
2661 <row topline="true" bottomline="true">
2662 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2665 \begin_layout Standard
2681 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2684 \begin_layout Standard
2695 selection background
2700 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2703 \begin_layout Standard
2727 \begin_layout Section
2729 The autodetected settings
2732 \begin_layout Standard
2735 \begin_inset LatexCommand \label{sec:autodetected}
2739 There are several items that are detected for you when you run
2746 \SpecialChar \menuseparator
2752 In this section, we list those which pertain to the user preferences.
2755 \begin_layout Description
2777 , depending on what is available.
2780 \begin_layout Description
2794 plus a bunch of options.
2797 \begin_layout Description
2811 on systems (so-called System V) who have this command, and
2815 otherwise (BSD systems).
2818 \begin_layout Description
2825 print_spool_printerprefix
2836 , depending on whether
2847 \begin_layout Description
2865 fonts are found and LaTeX has support for these fonts built-in.
2866 You can set it manually if you only have the so-called
2873 \begin_layout Section
2878 \begin_layout Standard
2880 There are many other configuration options that can be used to customize
2882 We still need to document them here, but again, most should be fairly obvious.
2883 Please ask on the mailing lists if you need some more information; it may
2884 even prompt us to expand this section.
2887 \begin_layout Chapter
2889 Internationalizing LyX
2890 \begin_inset LatexCommand \label{chap:i18n}
2897 \begin_layout Standard
2899 LyX supports using a translated interface.
2900 Last time we checked, LyX provided text in 14 languages together with the
2901 default English text.
2902 The language of choice is called your
2907 (For further reading on locale settings, see also the documentation for
2908 locale that comes with your operating system.
2909 For Linux, the manual page for locale(5) could be a good place to start).
2912 \begin_layout Standard
2914 Notice that these translations will work, but do contain a few flaws.
2915 In particular, all dialogs have been designed with the English text in
2916 mind, which means that some of the translated text will be too large to
2917 fit within the space allocated.
2918 This is only a display problem and will not cause any harm.
2919 Also, you will find that some of the translations do not define short-cut
2920 keys for everything.
2921 Sometimes, there are simply not enough free letters to do it.
2922 Other times, the translator just hasn't got around to doing it yet.
2923 Our localization team -- which you may wish to join -- will try to fix
2924 these shortcomings in future versions of LyX.
2927 \begin_layout Section
2929 Selecting an alternative language for the user interface
2932 \begin_layout Standard
2934 This feature is disabled by default, meaning that system default language
2936 To enable an alternative language, you have to set an appropriate environment
2944 for csh class shells
2959 with the two letter code (or four letter code, like
2963 for British English) for the language you want.
2969 Besides the user interface texts being translated, also the appropriate
2970 manuals will be presented under the Help menu -- if available.
2973 \begin_layout Standard
2975 On some systems, you may have to redefine
2987 , to override the system settings; their preference is in this order
2991 \begin_layout Standard
2993 The shell variable LANGUAGE has been disabled in LyX for technical reasons.
2999 , which corresponds to the way GNU
3004 Consult your system documentation.
3005 Normally, you'll want to put the appropriate line in a shell script run
3006 on start-up, so that the translation is on by default.
3007 Remember that this affects
3011 localized packages, not only LyX!
3014 \begin_layout Standard
3016 If LyX is configured and compiled with
3017 \begin_inset Quotes eld
3025 \begin_inset Quotes erd
3028 , this mechanism will not work.
3031 \begin_layout Section
3036 \begin_layout Subsection
3038 Translating the graphical user interface (text messages).
3041 \begin_layout Standard
3047 library to handle the internationalization of the interface.
3048 To have LyX speak your favorite language in all menus and dialogs, you
3053 -file for that language.
3054 When this is available, you'll have to generate a mo-file from it and install
3060 The process of doing all of this is explained in the documentation for
3065 , but in short, this is what you do (
3069 denotes the language code):
3072 \begin_layout Standard
3078 \begin_layout Standard
3089 \begin_layout Itemize
3093 LYX-SOURCE-DIR/po/lyx.pot
3106 doesn't exist, it can be remade with
3110 in that directory, or you can use an existing po-file for some other language
3114 \begin_layout Itemize
3122 \begin_layout Standard
3124 We recommend that you use Emacs to do this, since the
3128 distribution includes a nice mode that supports you in doing this.
3136 For some menu- and widget-labels, there are also shortcut keys that should
3138 Those keys are marked after a `|', and should be translated according to
3139 the words and phrases of the
3144 There is a tool named
3148 written in Prolog in
3150 LYX-SOURCE-DIR/development/tools/
3152 that may be useful to help determine short-cut keys.
3153 Note that XForms (version 0.86 at least) can't handle anything but 7-bit
3154 characters as shortcut keys.
3155 You should also fill also out the information at the beginning of the new
3160 -file with your email-address, etc., so people know where to reach you with
3161 suggestions and entertaining flames.
3164 \begin_layout Itemize
3174 This can be done with
3193 \begin_layout Itemize
3199 -file to your locale-tree, at the correct directory for application messages
3204 , and under the name
3213 /usr/local/share/locale/
3224 \begin_layout Standard
3230 \begin_layout Standard
3241 \begin_layout Standard
3243 Adding a new po-file to the
3247 of LyX involves altering the configure scripts and more, but the way
3251 works, you don't actually need the source-code of LyX to translate it---having
3267 \begin_layout Standard
3269 If you've written a translation file for a language that LyX does not currently
3270 support, feel free to submit it for inclusion by sending a patch.
3271 In this case, we recommend that you read the
3279 directory for more instructions.
3282 \begin_layout Subsubsection
3287 \begin_layout Standard
3289 Sometimes it turns out that one english message needs to be translated into
3290 different messages in the target language.
3291 One example is the message
3295 which has the german translation
3312 does not handle such ambigous translations.
3313 Therefore you have to add some context information to the message: Instead
3320 To[[as in 'From format x to format y']]
3324 To[[as in 'From page x to page y']].
3327 Now the two occurences of
3335 and can be translated correctly to
3350 \begin_layout Standard
3352 Of course the context information needs to be stripped off the original
3353 message when no translation is used.
3354 Therefore you have to put it in double square brackets at the end of the
3355 message (see the example above).
3356 The translation mechanism of LyX ensures that everything in double square
3357 brackets at the end of messages is removed before displaying the message.
3360 \begin_layout Subsection
3362 Translating the documentation.
3365 \begin_layout Standard
3367 The online documentation (in the
3374 -menu) can (and should!) be translated.
3375 If there are translated versions of the documentation available
3379 \begin_layout Standard
3381 As of February 2003, almost all of the docs have been translated into German
3387 has been translated into at least 12 other languages, with other translations
3389 The library of translated documents is growing rapidly.
3394 , and the locale is set accordingly, these will be used automagically by
3396 LyX looks for translated versions as
3410 denotes the language as set by the environmental variable
3415 If there are none, the default English versions will be displayed.
3416 Note that the translated versions must have the same filenames (
3420 above) as the original.
3421 If you feel up to translating the documentation (an excellent way to proof-read
3422 the original documentation BTW!), there are a few things you should do
3426 \begin_layout Itemize
3432 , the guide to writing LyX documentation.
3433 Pay special attention to the translator's section.
3436 \begin_layout Itemize
3438 Check out the documentation translation web page at
3439 \begin_inset LatexCommand \url[The LyX Developer's Web Site]{http://www.devel.lyx.org}
3444 That way, you can find out which (if any) documents have already been translate
3445 d into your language.
3446 You can also find out who (if anyone) is organizing the effort to translate
3447 the documentation into your language.
3448 If no one is organizing the effort, please let us know that you're interested.
3451 \begin_layout Standard
3453 Once you get to actually translating, here's a few hints for you that may
3457 \begin_layout Itemize
3459 Join the documentation team! There is information on how to do that in
3468 elp\SpecialChar \menuseparator
3475 ), which by the way is the first document you should translate.
3478 \begin_layout Itemize
3480 Learn the typographic conventions for the language you are translating to.
3481 Typography is an ancient art and over the centuries, a great variety of
3482 conventions have developed throughout different parts of the world.
3483 Also study the professional terminology amongst typographers in your country.
3484 Inventing your own terminology will only confuse the users.
3487 (Warning! Typography is addictive!)
3490 \begin_layout Itemize
3492 Make a copy of the document.
3493 This will be your working copy.
3494 You can use this as your personal translated help-file by placing it in
3502 \begin_layout Itemize
3504 Sometimes the original document (from the LyX-team) will be updated.
3505 Use the ViewCVS tool available at
3506 \begin_inset LatexCommand \htmlurl{http://www.lyx.org/viewcvs.cgi/lyxdoc/}
3510 to see what has been changed
3514 \begin_layout Standard
3516 Alternatively, you can keep a copy of the latest version of the English
3517 document which you've translated.
3523 That way you can easily see which parts of the translated document need
3527 \begin_layout Itemize
3529 If you ever find an error in the original document, fix it and notify the
3530 rest of the documentation team of the changes! (You didn't forget to join
3531 the documentation team did you?)
3534 \begin_layout Section
3536 International Keyboard Support
3539 \begin_layout Standard
3543 [Editor's Note: The following section is by
3548 It needs to be fixed to conform to the new Documentation Style sheet and
3549 to make use of the new v1.0 features.
3550 The whole thing also needs to be merged with the section following it.-jw]
3553 \begin_layout Subsection
3555 Defining Own Keymaps: Keymap File Format
3558 \begin_layout Standard
3560 Let's look at a keyboard definition file a little closer.
3561 It is a plain ASCII file defining
3564 \begin_layout Itemize
3566 key-to-key or key-to-string translations
3569 \begin_layout Itemize
3574 \begin_layout Itemize
3576 dead keys exceptions
3579 \begin_layout Standard
3581 To define key-to-key or key-to-string translation, use this command:
3584 \begin_layout Quotation
3601 \begin_layout Standard
3607 is the key to be translated and
3611 is the string to be inserted into the document.
3612 To define dead keys, use:
3615 \begin_layout Quotation
3632 \begin_layout Standard
3643 The following dead keys are supported (shortcut name is in parentheses):
3646 \begin_layout Quotation
3655 \begin_layout Quotation
3662 \begin_layout Quotation
3669 \begin_layout Quotation
3677 \begin_layout Quotation
3684 \begin_layout Quotation
3692 \begin_layout Standard
3703 \begin_layout Quotation
3710 \begin_layout Quotation
3718 \begin_layout Standard
3729 \begin_layout Quotation
3736 \begin_layout Quotation
3745 \begin_layout Quotation
3753 \begin_layout Standard
3764 \begin_layout Quotation
3773 \begin_layout Standard
3784 \begin_layout Quotation
3794 \begin_layout Quotation
3796 hungarian umlaut (hug)
3803 \begin_layout Quotation
3810 \begin_layout Quotation
3819 \begin_layout Standard
3830 \begin_layout Standard
3832 Since in many international keyboards there are exceptions to what some
3833 dead keys should do, you can define them using
3836 \begin_layout Quotation
3846 deadkey key outstring
3849 \begin_layout Standard
3851 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3855 \begin_layout Quotation
3870 \begin_layout Standard
3872 to make it work correctly.
3873 Also, you have to define as exceptions dead keys over i and j, to remove
3874 the dot from them before inserting an accent mark.
3875 I will change this when the time comes, but so far I haven't had time.
3878 \begin_layout Standard
3880 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3886 have different meaning.
3891 marks comments, quotes start and end LaTeX-style commands.
3892 To enter quote, you'll need to use
3911 \begin_layout Standard
3913 If you make a keyboard description file that works for your language, please
3914 mail it to me, so I can include it in the next keymap distribution.
3917 \begin_layout Standard
3919 More keywords will be supported in keymap configuration file in future,
3923 \begin_layout Itemize
3942 \begin_layout Itemize
3958 an external keymap translation program
3961 \begin_layout Standard
3963 Also, it should look into
3967 file for defaults, too (for example, a
3973 option to include default keyboard).
3976 \begin_layout Section
3978 International Keymap Stuff
3979 \begin_inset LatexCommand \label{sec:keymap}
3986 \begin_layout Standard
3988 The next two sections describe the
4000 file syntax in detail.
4001 These sections should help you design your own key map if the ones provided
4002 do not meet your needs.
4005 \begin_layout Subsection
4010 \begin_layout Standard
4020 file maps keystrokes to characters or strings.
4021 As the name suggests it sets a keyboard mapping.
4046 are described in this section.
4050 \labelwidthstring 00.00.0000
4058 Map a character to a string
4061 \begin_layout LyX-Code
4075 \begin_layout Standard
4094 the double-quote (")
4102 must be escaped with a preceding backslash (
4113 \begin_layout Standard
4121 statement to cause the symbol
4127 to be output for the keystroke
4136 \begin_layout LyX-Code
4144 \labelwidthstring 00.00.0000
4152 Specify an accent character
4155 \begin_layout LyX-Code
4166 \begin_layout Standard
4168 This will make the cha
4183 This is the dead key
4187 \begin_layout Standard
4195 refers to a key that does not produce a character by itself, but when followed
4196 with another key, produces the desired accent character.
4197 For example, a German characte
4199 r with an umlaut like
4203 can be produced in this manner.
4212 \begin_layout Standard
4220 and then another key not in
4228 followed by the other, unallowed key, as output.
4237 cancels a dead key, so if
4248 , the cursor will not go one position backwards but will instead cancel
4255 might have had on the next keystroke.
4259 \begin_layout Standard
4261 The following example specifies that the character ' is to be an acute accent,
4262 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4265 \begin_layout LyX-Code
4269 kmod ' acute aeiouAEIOU
4273 \labelwidthstring 00.00.0000
4279 Specify an exception to the accent character
4282 \begin_layout LyX-Code
4294 \begin_layout Standard
4296 This defines an exce
4315 have been assigned a keystroke with a previous
4329 must not belong in the
4349 If such a declaration does not exist in
4386 \begin_layout Standard
4388 The following command produces causes äi to be produced when you enter acute-i
4392 \begin_layout LyX-Code
4408 \labelwidthstring 00.00.0000
4414 Combine two accent characters
4417 \begin_layout LyX-Code
4424 accent1 accent2 allowed
4427 \begin_layout Standard
4429 This one is getting pretty esoteric.
4430 It allows you to combine the effect
4475 \begin_layout Standard
4477 Consider this example from the
4486 \begin_layout LyX-Code
4490 kmod ; acute aeioyvhAEIOYVH
4494 kcomb acute umlaut iyIY
4497 \begin_layout Standard
4499 This allows you to press
4505 and get the effect of
4522 in this case cancels the last dead key, so if you press
4539 \begin_layout Subsection
4544 \begin_layout Standard
4554 mapping is performed, a
4561 file maps the strings that the symbols generate to characters in the current
4563 The LyX distribution currently includes at least the
4578 \begin_layout Standard
4588 file is a sequence of declarations of the form
4591 \begin_layout LyX-Code
4603 \begin_layout Standard
4605 For example, in order to map
4613 to the corresponding character in the iso-8859-1 set (233), the following
4617 \begin_layout LyX-Code
4626 \begin_layout Standard
4647 the same character can apply to more than one string.
4660 \begin_layout LyX-Code
4687 \begin_layout Standard
4689 If LyX cannot find a mapping for the string produced by the keystroke or
4690 a deadkey sequence, it will check if it looks like an accented char and
4691 try to draw an accent over the character on screen.
4694 \begin_layout Subsection
4699 \begin_layout Standard
4701 There is a second way to add support for international characters through
4702 so-called dead-keys.
4703 A dead-key works in combination with a letter to produce an accented character.
4704 Here, we'll explain how to create a really simple dead-key to illustrate
4708 \begin_layout Standard
4710 Suppose you happen to need the circumflex character,
4711 \begin_inset Quotes eld
4716 \begin_inset Quotes erd
4724 -key [a.k.a.\InsetSpace ~
4729 ] to the LyX command
4738 Now, whenever you type the
4742 -key followed by a letter, that letter will have a circumflex accent on
4744 For example, the sequence
4745 \begin_inset Quotes eld
4753 \begin_inset Quotes erd
4756 produces the letter:
4757 \begin_inset Quotes eld
4761 \begin_inset Quotes erd
4765 If you tried to type
4766 \begin_inset Quotes eld
4774 \begin_inset Quotes erd
4777 , however, LyX will complain with a beep, since a
4778 \begin_inset Quotes eld
4786 \begin_inset Quotes erd
4789 never takes a circumflex accent.
4794 after a dead-key produces the bare-accent.
4795 Please note this last point! If you bind a key to a dead-key, you'll need
4796 to rebind the character on that key to yet another key.
4801 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4804 \begin_layout Standard
4806 One common way to bind dead-keys is to use
4818 in combination with an accent, like
4819 \begin_inset Quotes eld
4827 \begin_inset Quotes erd
4831 \begin_inset Quotes eld
4839 \begin_inset Quotes erd
4843 \begin_inset Quotes eld
4851 \begin_inset Quotes erd
4855 Another way involves using
4863 [remember them from section?] to set up the special
4872 acts in some ways just like
4876 and permits you to bind keys to accented characters.
4877 You can also turn keys into dead-keys by binding them to something like
4882 and then binding this symbolic key to the corresponding LyX command.
4886 \begin_layout Standard
4892 : This is exactly what I do in my
4910 and a bunch of these
4911 \begin_inset Quotes eld
4919 \begin_inset Quotes erd
4922 symbolic keys bound such things as
4933 This is how I produce my accented characters.
4938 You can make just about anything into the
4946 keys, a spare function key, etc.
4947 As for the LyX commands that produce accents, check the entry for
4956 You'll find the complete list there.
4959 \begin_layout Subsection
4961 Saving your Language Configuration
4964 \begin_layout Standard
4967 \begin_inset LatexCommand \label{sec:savlang}
4971 You can edit your preferences so that your desired language environment
4972 is automatically configured when LyX starts up, via the
4977 dit\SpecialChar \menuseparator
4987 \begin_layout Chapter
4989 Installing New Document Classes, Layouts, and Templates
4990 \begin_inset LatexCommand \label{chap:textclass}
4998 \begin_layout Standard
5000 Installing New Document Classes
5008 \begin_layout Standard
5010 In this chapter, we describe the procedures for creating and installing
5011 new LyX layout and template files, as well as offer a refresher on correctly
5012 installing new LaTeX document classes.
5013 Some definitions: a document class is a LaTeX file (usually ending in
5021 ) which describes the format of a document such as an article, report, journal
5023 and all the commands needed to realize that format.
5024 A layout file is a LyX file which corresponds to a LaTeX document class
5025 and which tells LyX how to
5026 \begin_inset Quotes eld
5030 \begin_inset Quotes erd
5033 things on the screen to make the display look something like the final
5035 More precisely, a layout file describes a
5036 \begin_inset Quotes eld
5040 \begin_inset Quotes erd
5043 which is the internal construct LyX uses to render the screen display.
5045 \begin_inset Quotes eld
5049 \begin_inset Quotes erd
5053 \begin_inset Quotes eld
5057 \begin_inset Quotes erd
5060 can be used somewhat interchangeably, but it is better to refer to the
5061 file as the layout, and the thing living in LyX's memory as the text class.
5062 A template file is simply a LyX document which contains a set of predefined
5063 entries for a given document class which are generally required for that
5065 Templates are especially useful for things like journal manuscripts which
5066 are to be submitted electronically.
5069 \begin_layout Section
5071 Installing a new LaTeX package
5074 \begin_layout Standard
5076 Some installations may not include a LaTeX package that you would like to
5078 For example, you might need FoilTeX, a common (and very powerful) package
5079 for preparing slides or viewgraphs for overhead projectors.
5080 Here are the formal steps involved in getting the package up and running
5081 if you are using teTeX or some other web2c based distribution.
5085 \begin_layout Enumerate
5087 Get the package from CTAN or wherever.
5091 \begin_layout Standard
5095 Inventory of your LaTeX configuration
5097 manual for details of what CTAN is and where supported document classes
5106 \begin_layout Enumerate
5112 (this usually lives in the directory
5116 , though you can run
5121 It describes how to add a local
5125 directory; follow the instructions.
5126 You need to insert the name of your local
5139 is a logical place to install software that did not come with your distribution
5145 Usually, you will have to modify only two things:
5149 \begin_layout Enumerate
5155 to the directory you chose; e.g.
5160 TEXMFLOCAL = /usr/local/texmf
5163 \begin_layout Enumerate
5178 TEXMF = {$HOMETEXMF,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5181 \begin_layout Enumerate
5193 You must follow the directory structure of your existing
5197 directory (for example, latex packages should go under
5199 /usr/local/texmf/tex/latex/
5204 \begin_layout Enumerate
5206 Install the package.
5207 For example, you would unpack the FoilTeX tarball and create
5209 /usr/local/texmf/tex/latex/foiltex
5216 directory contains various files.
5219 \begin_layout Enumerate
5228 /usr/local/texmf/ls-R
5233 \begin_layout Enumerate
5235 From within LyX, do:
5240 ools\SpecialChar \menuseparator
5251 \begin_layout Standard
5253 Now you should see your new package---for example
5262 ayout\SpecialChar \menuseparator
5277 Note that there are simpler ways of installing packages: you can add a
5278 link to the new package directory in the system LaTeX directory (
5282 , don't forget to then run
5286 ), or sometimes simply set the
5290 environment variable to include the new package.
5291 However, the formal procedure described in
5295 is guaranteed to work, so you should follow it unless circumstances absolutely
5296 prevent it: such as, when you don't have superuser access.
5299 \begin_layout Section
5304 \begin_layout Standard
5306 This section describes how to write and install your own LyX layout files
5307 (also known as text classes) and walks through the
5311 text class format as an example.
5316 files describe what paragraph styles are available for a given document
5317 class and how LyX should display them.
5318 We try to provide a thorough description of the process here; however,
5319 there are so many different types of documents supported by LaTeX classes
5320 we can't hope to cover every different possibility or problem you might
5325 \begin_layout Standard
5327 When you plan to write a new layout, it is extremely helpful to look at
5328 the example layouts distributed with LyX.
5329 If you use a nice LaTeX document class that might be of interest for others,
5330 too, and have a nice corresponding LyX layout, feel free to contribute
5331 the stuff to us, so we may put it into the distribution.
5334 \begin_layout Standard
5336 All the tags described in this chapter are case-insensitive; this means
5349 are really the same command.
5350 The possible values are printed in brackets after the feature's name.
5351 The default value if a feature isn't specified inside a text class-description
5359 If the argument has a datatype like
5360 \begin_inset Quotes eld
5364 \begin_inset Quotes erd
5368 \begin_inset Quotes eld
5372 \begin_inset Quotes erd
5375 , the default is shown like this:
5385 \begin_layout Subsection
5387 Supporting new document classes
5390 \begin_layout Standard
5392 There are two situations you are likely to encounter when wanting to support
5393 a new LaTeX document class, involving LaTeX2e class (
5404 \begin_layout Subsection
5413 \begin_layout Standard
5415 If your new document class is provided as a style file that is used in conjuncti
5416 on with an existing, supported document class, start by copying the existing
5417 class's layout file into your local directory.
5418 For the sake of example we'll assume that the style file is called
5422 and it is meant to be used with
5426 which is a standard class.
5429 \begin_layout LyX-Code
5431 cp report.layout ~/.lyx/layouts/myclass.layout
5434 \begin_layout Standard
5440 and change the line:
5443 \begin_layout LyX-Code
5447 DeclareLaTeXClass{report}
5450 \begin_layout Standard
5455 \begin_layout LyX-Code
5459 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
5462 \begin_layout Standard
5467 \begin_layout LyX-Code
5478 \begin_layout Standard
5480 near the top of the file.
5483 \begin_layout Standard
5485 Start LyX and select
5490 ools\SpecialChar \menuseparator
5498 Restart LyX and try creating a new document.
5503 " as a document class option in the
5508 ocument\SpecialChar \menuseparator
5516 It is likely that some of the sectioning commands and such will differ
5517 from how the base class
5521 \begin_layout Standard
5532 works, so you can fiddle around with the settings for the different sections
5534 See below for more discussion on this.
5537 \begin_layout Subsection
5546 \begin_layout Standard
5548 In this case, you will probably have to
5549 \begin_inset Quotes eld
5553 \begin_inset Quotes erd
5557 We strongly suggest copying an existing layout file which uses a similar
5558 LaTeX class and modifying it if at all possible.
5559 At least use an existing file as a starting point so you can find out what
5560 items you need to worry about.
5561 Again, the specifics are covered below.
5564 \begin_layout Section
5566 Declaring a new text class
5569 \begin_layout Standard
5571 When it's finally time to get your hands dirty and create or edit your own
5572 layout file, the following sections describe what you're up against.
5573 Our advice is to go slowly, save and test often, listen to soothing music,
5574 and enjoy one or two of your favorite adult beverages; more if you are
5575 getting particularly stuck.
5576 It's really not that hard, except that the multitude of options can become
5577 overwhelming if you try to do to much in one sitting.
5578 Go have another adult beverage, just for good measure.
5581 \begin_layout Standard
5586 \begin_layout Standard
5588 Lines in a layout file which begin with a
5593 There is one exception to this rule: all layouts should begin with lines
5597 \begin_layout LyX-Code
5601 #% Do not delete the line below; configure depends on this
5604 \begin_layout LyX-Code
5610 DeclareLaTeXClass{article}
5613 \begin_layout Standard
5615 The second line is used when you configure LyX.
5616 The layout file is read by the LaTeX script
5620 , in a special mode where
5625 The first line is just a LaTeX comment, and the second one contains the
5626 declaration of the text class.
5627 If these lines appear in a file named
5631 , then they define a text class of name
5635 (the name of the layout file) which uses the LaTeX document class
5639 (the default is to use the same name as the layout).
5641 \begin_inset Quotes eld
5645 \begin_inset Quotes erd
5648 that appears above is used as a description of the text class in the
5653 ocument\SpecialChar \menuseparator
5663 \begin_layout Standard
5665 Let's assume that you wrote your own text class that uses the
5669 documentclass, but where you changed the appearance of the section headings.
5670 If you put it in a file
5674 , the header of this file should be:
5677 \begin_layout LyX-Code
5681 #% Do not delete the line below; configure depends on this
5684 \begin_layout LyX-Code
5690 DeclareLaTeXClass[article]{article (with my own headings)}
5693 \begin_layout Standard
5695 This declares a text class
5699 , associated with the LaTeX document class
5704 \begin_inset Quotes eld
5707 article (with my own headings)
5708 \begin_inset Quotes erd
5712 If your text class depends on several packages, you can declare it as:
5715 \begin_layout LyX-Code
5719 #% Do not delete the line below; configure depends on this
5722 \begin_layout LyX-Code
5728 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
5731 \begin_layout Standard
5733 This indicates that your text class uses the foo.sty package.
5734 Finally, it is also possible to declare classes for SGML and DocBook code.
5735 Typical declarations will look like
5738 \begin_layout LyX-Code
5742 #% Do not delete the line below; configure depends on this
5745 \begin_layout LyX-Code
5751 DeclareSGMLClass{SGML (LinuxDoc)}
5754 \begin_layout Standard
5759 \begin_layout LyX-Code
5761 #% Do not delete the line below; configure depends on this
5764 \begin_layout LyX-Code
5768 DeclareDocBookClass[article]{SGML (DocBook article)}
5771 \begin_layout Standard
5773 Note that these declarations can also be given an optional parameter declaring
5774 the name of the document class (but not a list).
5777 \begin_layout Standard
5779 When the text class has been modified to your taste, all you have to do
5780 is to copy it either in
5793 ools\SpecialChar \menuseparator
5801 Exit LyX and restart it; then your new text class should be available along
5805 \begin_layout Subsection
5807 General text class parameters
5810 \begin_layout Standard
5812 These are the general parameters which describe the form of the entire document:
5815 \begin_layout Standard
5821 \begin_layout Standard
5832 \begin_layout Description
5847 ] Whether the class-default should have one or two columns.
5848 Can be changed in the
5853 ocument\SpecialChar \menuseparator
5864 This setting (same goes for
5868 , too) is important: if your text class has two columns by default but you
5869 forget to set it correctly, the
5877 be output when you select
5886 ocument\SpecialChar \menuseparator
5894 \begin_layout Description
5909 ] Whether the class-default should be printing on one or both sides of the
5911 Can be changed in the
5919 ocument\SpecialChar \menuseparator
5929 \begin_layout Description
5945 ] The class default pagestyle.
5946 Can be changed in the
5951 ocument\SpecialChar \menuseparator
5964 \begin_layout Description
5977 , Counter_Section, Counter_Subsection, Counter_Subsubsection, Counter_Paragraph,
5980 Counter_Subparagraph, Counter_EnumI, Counter_EnumII,
5982 Counter_EnumIII, Counter_EnumIV
5984 ] The highest level of automatic enumeration.
5989 for a book or report and
5994 If there is no enumeration needed at all, for example inside a letter class,
6007 \begin_layout Description
6012 ClassOptions\SpecialChar \ldots{}
6016 This section describes various global options supported by the document
6018 See Section\InsetSpace ~
6020 \begin_inset LatexCommand \ref{sec:classoptions}
6027 \begin_layout Description
6042 ] Whether the class already loads the
6047 This is the case of the
6058 \begin_layout Description
6073 ] Whether the class already provides the functionality of the
6078 This is the case of the
6089 \begin_layout Description
6104 ] Whether the class already provides the functionality of the
6109 This is the case of the
6116 \begin_layout Description
6124 This is used to describe the default font of the document.
6125 See Section\InsetSpace ~
6127 \begin_inset LatexCommand \ref{sec:fonts}
6134 \begin_layout Description
6146 ] This is the style that will be assigned to new paragraphs, usually
6151 This will default to the first defined style if not given, but you are
6152 highly encouraged to use this directive.
6155 \begin_layout Description
6173 ] Indicates what kind of markup is used to define the title of a document.
6178 means that the macro with name
6182 will be inserted after the last layout which has
6183 \begin_inset Quotes eld
6191 \begin_inset Quotes erd
6199 corresponds to the case where the block of paragraphs which have
6200 \begin_inset Quotes eld
6208 \begin_inset Quotes erd
6211 should be enclosed into the
6220 \begin_layout Description
6232 ] The name of the command/environment mentionned above.
6235 \begin_layout Description
6240 Preamble\SpecialChar \ldots{}
6244 A set of macro definitions that will be output at the beginning of the
6246 Use this for global definitions.
6249 \begin_layout Description
6257 As its name implies, this command allows you to include another layout
6258 definition file within yours to avoid duplicating commands.
6259 Common examples are the standard layout files, for example,
6263 , which contains most of the basic layouts.
6266 \begin_layout Description
6271 Style\SpecialChar \ldots{}
6275 This sequence defines a new style.
6276 See Section\InsetSpace ~
6278 \begin_inset LatexCommand \ref{sec:style}
6285 \begin_layout Description
6293 This command deletes an existing style.
6294 This is particularly useful when you want to suppress a style that has
6295 be defined in an input file.
6298 \begin_layout Description
6303 Float\SpecialChar \ldots{}
6307 This sequance defines a new float.
6308 See Section\InsetSpace ~
6310 \begin_inset LatexCommand \ref{sec:floats}
6317 \begin_layout Description
6325 This command deletes an existing float.
6326 This is particularly useful when you want to suppress a float that has
6327 be defined in an input file.
6330 \begin_layout Description
6335 Counter\SpecialChar \ldots{}
6339 This sequence defines a new counter.
6340 See Section\InsetSpace ~
6342 \begin_inset LatexCommand \ref{sec:counter}
6349 \begin_layout Standard
6355 \begin_layout Standard
6366 \begin_layout Subsection
6375 \begin_layout Standard
6378 \begin_inset LatexCommand \label{sec:classoptions}
6386 section can contain the following entries:
6389 \begin_layout Description
6401 ] The list of available font sizes for the document's main font, separated
6403 \begin_inset Quotes eld
6411 \begin_inset Quotes erd
6417 \begin_layout Description
6427 string="empty|plain|headings|fancy"
6429 ] The list of available page styles, separated by
6430 \begin_inset Quotes eld
6438 \begin_inset Quotes erd
6444 \begin_layout Description
6456 ] Some document class options, separated by a comma, that will be added
6457 to the optional part of the
6466 \begin_layout Subsection
6468 Specific Paragraph Layouts
6471 \begin_layout Standard
6474 \begin_inset LatexCommand \label{sec:style}
6478 A paragraph layout description looks like this
6482 \begin_layout Standard
6484 Note that this will either define a new layout or modify an existing one.
6492 \begin_layout LyX-Code
6500 \begin_layout LyX-Code
6505 \begin_layout LyX-Code
6510 \begin_layout Standard
6512 where the following commands are allowed:
6515 \begin_layout Standard
6521 \begin_layout Standard
6532 \begin_layout Description
6540 This is used to copy all the features of an existing layout into the current
6545 \begin_layout Description
6558 , Command, Environment, Item_Environment,
6564 ] How the layout should be translated into LaTeX.
6569 means nothing special.
6582 {\SpecialChar \ldots{}
6597 }\SpecialChar \ldots{}
6621 is generated for each paragraph of this environment.
6634 is passed as an argument to the environment.
6639 can be defined in the
6644 ayout\SpecialChar \menuseparator
6658 is perhaps a bit misleading, since these rules apply to SGML classes, too.
6659 Visit the SGML class files for specific examples.
6662 \begin_layout Description
6671 If 1, marks the layout as being part of a title block (see also the
6682 \begin_layout Description
6690 The name of the corresponding LaTeX stuff.
6691 Either the environment or command name.
6694 \begin_layout Description
6702 The optional parameter for the corresponding
6709 This parameter cannot be changed from within LyX.
6712 \begin_layout Description
6724 ] The number of optional arguments that can be used with this layout.
6725 This is useful for things like section headings, and only makes sense with
6729 \begin_layout Description
6742 , Manual, Dynamic, First_Dynamic, Right_Address_Box
6746 The kind of margin that the layout has on the left side.
6751 just means a fixed margin.
6756 means that the left margin depends on the string entered in the
6761 dit\SpecialChar \menuseparator
6766 aragraph\InsetSpace ~
6770 This is used to typeset nice lists without tabulators.
6775 means that the margin depends on the size of the label.
6776 This is used for automatic enumerated headlines.
6777 It is obvious that the headline
6778 \begin_inset Quotes eld
6781 5.4.3.2.1 Very long headline
6782 \begin_inset Quotes erd
6785 must have a wider left margin (as wide as
6786 \begin_inset Quotes eld
6790 \begin_inset Quotes erd
6793 plus the space) than
6794 \begin_inset Quotes eld
6797 3.2 Very long headline
6798 \begin_inset Quotes erd
6801 , even if other word processors are not able to do this.
6806 is similar, but only the very first row of the paragraph is dynamic, while
6807 the others are static; this is used, for example, for descriptions.
6812 means the margin is chosen in a way that the longest row of this paragraph
6813 fits to the right margin.
6814 This is used to typeset an address on the right edge of the page.
6817 \begin_layout Description
6832 ] Whether the following Paragraph is allowed to indent its very first row.
6837 means that it is not allowed to do so,
6841 means it could do so if it wants to.
6844 \begin_layout Description
6856 ] The indent of the very first line of a paragraph.
6857 The argument is passed as a string.
6862 means that the paragraph is indented with the width of
6871 You can get a negative width by prefixing the string with
6876 This way was chosen so that the look is the same with each used screen
6882 will be fixed for a certain layout.
6883 The exception is Standard layout, since the indentation of a Standard layout
6884 paragraph can be prohibited with
6889 Also, Standard layout paragraphs inside environments use the
6893 of the environment, not their native one.
6894 For example, Standard paragraphs inside an enumeration are not indented.
6897 \begin_layout Description
6909 ] LyX allows to choose either
6910 \begin_inset Quotes eld
6914 \begin_inset Quotes erd
6918 \begin_inset Quotes eld
6922 \begin_inset Quotes erd
6925 to typeset a document.
6927 \begin_inset Quotes eld
6931 \begin_inset Quotes erd
6934 is chosen, this value is completely ignored.
6936 \begin_inset Quotes eld
6940 \begin_inset Quotes erd
6943 is chosen, the parindent of a LaTeXtype
6944 \begin_inset Quotes eld
6948 \begin_inset Quotes erd
6951 layout is ignored and all paragraphs are additionally separated by this
6953 The vertical space is calculated with
6955 value*DefaultHeight()
6961 is the height of a row with the normal font.
6962 This way, the look stays the same with different screen fonts.
6965 \begin_layout Description
6977 ] The vertical space with which the very first of a chain of paragraphs
6978 with this layout is separated from the previous paragraph.
6979 If the previous paragraph has another layout, the separations are not simply
6980 added, but the maximum is taken.
6983 \begin_layout Description
6999 for the very last paragraph.
7002 \begin_layout Description
7014 ] The vertical space between two paragraphs of this layout.
7017 \begin_layout Description
7029 ] This is an extra space between the paragraphs of an environment layout.
7030 If you put other layouts into an environment, each is separated with the
7036 But the whole items of the environment are additionally separated with
7045 \begin_layout Description
7057 ] If you put layouts into environments, the leftmargins are not simply added,
7058 but added with a factor
7059 \begin_inset Formula $\frac{4}{depth+4}$
7063 Note that this parameter is also used when the border is defined as
7072 Then it is added to the manual or dynamic border.
7073 This string has the same meaning as for
7080 \begin_layout Description
7099 \begin_layout Description
7112 , Manual, Static, Top_Environment,
7114 Centered_Top_Environment, Sensitive, Counter_Chapter,
7116 Counter_Section, Counter_Subsection, Counter_Subsubsection,
7118 Counter_Paragraph, Counter_Subparagraph, Counter_EnumI,
7124 Counter_EnumII, Counter_EnumIII, Counter_EnumIV
7132 means the label is the very first word (up to the first real blank).
7137 means it is defined in the layout (see
7148 Centered_Top_Environment
7150 are special cases of
7155 The label will be printed above the paragraph, but only at the top of an
7156 environment or the top of a chain of paragraphs with this layout.
7157 Usage is for example the
7166 This is also the case for
7170 labels with latex type
7174 , in order to make layouts for theorems work correctly.
7179 is a special case for the caption-labels
7180 \begin_inset Quotes eld
7184 \begin_inset Quotes erd
7188 \begin_inset Quotes eld
7192 \begin_inset Quotes erd
7200 means the (hardcoded) label string depends on the kind of float.
7205 label types should be self explanatory.
7208 \begin_layout Description
7220 ] The horizontal space between the label and the text body.
7221 Only used for labels that are not above the text body.
7224 \begin_layout Description
7232 [float=0] The vertical space between the label and the text body.
7233 Only used for labels that are above the text body (
7239 Centered_Top_Environment
7244 \begin_layout Description
7256 ] The string used for a label with a
7265 this string is also used as a suggestion for the
7269 that can be set in the
7274 dit\SpecialChar \menuseparator
7279 aragraph\InsetSpace ~
7283 When the labeltype is
7290 , this string is prepended to the counter.
7293 \begin_layout Description
7306 , Box, Filled_Box, Static
7308 ] The type of label that stands at the end of the paragraph (or sequence
7331 \begin_inset Quotes eld
7335 \begin_inset Quotes erd
7347 ) is a white (resp.\InsetSpace ~
7348 black) square suitable for end of proof markers,
7352 is an explicit text string.
7355 \begin_layout Description
7367 ] The string used for a label with a
7379 \begin_layout Description
7392 , left, right, center
7394 ] Paragraph alignment.
7397 \begin_layout Description
7410 , left, right, center
7417 Some LaTeX styles prohibit certain alignments, since those wouldn't make
7419 For example a right-aligned or centered enumeration isn't possible.
7422 \begin_layout Description
7437 ] With this parameter the
7442 \begin_inset Quotes eld
7445 Vertical space above
7446 \begin_inset Quotes erd
7454 dit\SpecialChar \menuseparator
7459 aragraph\InsetSpace ~
7462 dialog can be set when initializing a paragraph with this layout
7466 \begin_layout Standard
7470 Note from Jean-Marc:
7472 I'm not sure that this setting has much use, and it should probably be removed
7482 \begin_layout Description
7504 \begin_layout Description
7519 ] Whether fragile commands in this layout should be
7528 \begin_layout Description
7543 ] Whether newlines are translated into LaTeX newlines (
7552 The translation can be switched off to allow more comfortable LaTeX editing
7556 \begin_layout Description
7571 ] Whether the contents of this paragraph should be output in raw form, meaning
7572 without special translations that LaTeX would require.
7573 This somehow replaces the older
7580 \begin_layout Description
7595 ] Usually LyX doesn't allow you to insert more than one space between words,
7596 since a space is considered as the separation between two words, not a
7597 character or symbol of its own.
7598 This is a very fine thing but sometimes annoying, for example when typing
7599 program code or plain LaTeX code.
7605 Note that LyX will create protected blanks for the additional blanks when
7606 in another mode than LaTeX-mode.
7609 \begin_layout Description
7624 ] Usually LyX does not allow you to leave a paragraph empty, since it would
7625 lead to empty LaTeX output.
7626 There are some cases where this could be desirable however: in a letter
7627 template, the required fields can be provided as empty fields, so that
7628 people do not forget them; in some special classes, a layout can be used
7629 as some kind of break, which does not contain actual text.
7632 \begin_layout Description
7645 , onehalf, double, other
7650 ] This defines what the default spacing should be in the layout.
7663 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
7664 If you specify the argument
7668 , then you should also provide a numerical argument which will be the actual
7670 Note that, contrary to other parameters,
7674 implies the generation of specific LaTeX code, using the package
7681 \begin_layout Description
7690 The font used for both the text body
7695 See section\InsetSpace ~
7697 \begin_inset LatexCommand \ref{sec:fonts}
7702 Note that defining this font automatically defines the
7709 \begin_layout Description
7717 The font used for the text body .
7718 See section\InsetSpace ~
7720 \begin_inset LatexCommand \ref{sec:fonts}
7727 \begin_layout Description
7735 The font used for the label.
7736 See section\InsetSpace ~
7738 \begin_inset LatexCommand \ref{sec:fonts}
7745 \begin_layout Description
7750 Preamble\SpecialChar \ldots{}
7754 A set of macro definitions that will be output at the beginning of the
7755 LaTeX files when the layout is used.
7756 Use this to define the macros needed by this particular layout.
7759 \begin_layout Description
7767 the name of a style which preamble should be output
7771 the one mentionned above.
7772 This allows to ensure some ordering of the preamble snippets when macros
7773 definitions depend on one another
7777 \begin_layout Standard
7779 Note that, besides that functionality, there is no way to ensure any ordering
7781 The ordering that you see in a given version of LyX may change without
7782 warning in later versions).
7790 \begin_layout Standard
7796 \begin_layout Standard
7807 \begin_layout Subsection
7812 \begin_layout Standard
7815 \begin_inset LatexCommand \label{sec:floats}
7819 Since version 1.3.0 of LyX, it is necessary to define the floats (
7827 , \SpecialChar \ldots{}
7828 ) in the text class itself.
7829 If you are looking here to learn how to upgrade an existing text class,
7830 it will probably turn out that all you have to do is to add
7833 \begin_layout LyX-Code
7838 \begin_layout Standard
7840 at a reasonable location of the text class.
7844 \begin_layout Standard
7846 Don't forget to also have a look at counters in next section.
7851 If you want to implement a text class that proposes some other float types
7852 (like the AGU class bundled with LyX), the information below will hopefully
7856 \begin_layout Description
7869 \begin_inset Quotes erd
7873 \begin_inset Quotes erd
7877 \begin_inset Quotes eld
7881 \begin_inset Quotes erd
7884 of the new class of floats, like program or algorithm.
7885 After the appropriate
7906 \begin_layout Description
7919 \begin_inset Quotes erd
7923 \begin_inset Quotes erd
7926 ] The string that will be used in the menus and also for the caption.
7929 \begin_layout Description
7951 if the float is already defined by the documentclass.
7956 , the float will be defined using the LaTeX package
7963 \begin_layout Description
7976 \begin_inset Quotes erd
7980 \begin_inset Quotes erd
7983 ] This (optional) argument determines whether floats of this class will
7984 be numbered within some sectional unit of the document.
7985 For example, if within is equal to
7989 , the floats will be numbered within chapters.
7993 \begin_layout Description
8006 \begin_inset Quotes erd
8010 \begin_inset Quotes erd
8013 ] The style used when defining the float using
8022 \begin_layout Description
8035 \begin_inset Quotes erd
8039 \begin_inset Quotes erd
8042 ] The default placement for the given class of floats.
8043 They are like in standard LaTeX:
8059 for top, bottom, page, and here, respectively.
8063 \begin_layout Standard
8065 Note that the order of these letters in the string is irrelevant, like in
8071 On top of that there is a new type,
8075 , which does not really correspond to a float, since it means: put it
8076 \begin_inset Quotes eld
8080 \begin_inset Quotes erd
8084 Note, however that the
8088 specifier is special and, because of implementation details cannot be used
8089 in non-builtin float types.
8090 If you do not understand what this means, just use
8097 \begin_layout Description
8110 \begin_inset Quotes erd
8114 \begin_inset Quotes erd
8117 ] The file name extension of an auxiliary file for the list of figures (or
8119 LaTeX writes the captions to this file.
8122 \begin_layout Description
8135 \begin_inset Quotes erd
8139 \begin_inset Quotes erd
8142 ] The heading used for the list of floats.
8145 \begin_layout Subsection
8150 \begin_layout Standard
8153 \begin_inset LatexCommand \label{sec:counter}
8157 Since version 1.3.0 of LyX, it is necessary to define the counters (
8165 , \SpecialChar \ldots{}
8166 ) in the text class itself.
8167 If you are looking here to learn how to upgrade an existing text class,
8168 it will probably turn out that all you have to do is to add
8171 \begin_layout LyX-Code
8173 Input stdcounters.inc
8176 \begin_layout Standard
8178 The definition of counters if presently a bit primitive in LyX, since many
8179 things are still hardcoded.
8180 The following two parameters can be used:
8183 \begin_layout Description
8196 \begin_inset Quotes erd
8200 \begin_inset Quotes erd
8203 ] The name of the counter
8206 \begin_layout Description
8219 \begin_inset Quotes erd
8223 \begin_inset Quotes erd
8226 ] If this is set to the name of another counter, the present counter will
8227 be reset everytime the other one is increased (is that unclear enough?).
8230 \begin_layout Subsection
8235 \begin_layout Standard
8238 \begin_inset LatexCommand \label{sec:fonts}
8242 A font description looks like that:
8245 \begin_layout LyX-Code
8256 \begin_layout LyX-Code
8261 \begin_layout LyX-Code
8266 \begin_layout Standard
8268 and the following commands are available:
8271 \begin_layout Description
8289 \begin_layout Description
8307 \begin_layout Description
8320 , Italic, SmallCaps, Slanted
8325 \begin_layout Description
8339 , large, larger, largest, huge, giant
8344 \begin_layout Description
8358 , black, white, red, green, blue, cyan, magenta, yellow
8363 \begin_layout Section
8366 \begin_inset LatexCommand \label{sec:templates}
8373 \begin_layout Standard
8375 Templates are created just like usual documents.
8376 The only difference is that usual documents contain all possible settings,
8377 including the fontscheme and the papersize.
8378 Usually a user doesn't want a template to overwrite his defaults in these
8380 For that reason, the designer of a template should remove the corresponding
8393 from the template LyX file.
8394 This can be done with any simple text-editor, for example
8406 \begin_layout Standard
8408 Put the edited template files you create in
8412 , copy the ones you use from the global template directory in
8416 to the same place, and redefine the template path in the
8421 dit\SpecialChar \menuseparator
8440 \begin_layout Standard
8442 Note that there is a template which has a particular meaning:
8447 This template is loaded everytime you create a new document with
8454 \SpecialChar \menuseparator
8462 in order to provide useful defaults.
8463 To create this template from inside LyX, all you have to do is to open
8464 a document with the correct settings, and use the
8470 e as Document Defaults
8475 \begin_layout Chapter
8477 Including External Material
8480 \begin_layout Section
8485 \begin_layout Standard
8488 \begin_inset Note Note
8491 \begin_layout Standard
8493 This section is completely outdated.
8498 One often requested feature from LyX users is to be able to interface LyX
8499 with XFig, Dia, or other similar applications that specialize in producing
8500 a certain kind of diagram, figure, schematic or whatever material might
8501 be relevant to include in your document.
8502 Previously, it was only possible to include boring, static, fixed images
8503 in LyX documents with the graphics feature, but there are several limitations
8504 attached to this approach:
8507 \begin_layout Itemize
8509 If you want to change the figure, you have to invoke an external program
8513 \begin_layout Itemize
8515 LyX does not notice that the referenced files change, so the on-screen display
8516 can fast become obsolete, and this is aggravated by the lack of a means
8517 of updating the display
8520 \begin_layout Itemize
8522 The graphics stuff does not provide any mechanisms for coping with different
8523 exported formats such as DocBook, HTML or raw Ascii
8526 \begin_layout Standard
8528 The external material facility attempts to solve all of these problems
8532 \begin_layout Standard
8534 Even if the graphics facility can't solve all problems, it is still valuable
8535 because it does provide in-line preview of the graphics, and supports advanced
8536 geometric transformations with a comfortable user interface.
8542 It does this by offering a general method to interface LyX to external
8544 Instead of introducing a long list of different constructs tailored for
8545 each specific application, we chose to sacrifice the in-line displaying
8546 of the included material in order to provide a general construct to cover
8547 a wide range of applications.
8548 The result is the external material construct.
8549 External material presents itself in the document simply as a button, but
8550 don't let this fool you.
8551 When you click on it, a dialog will appear that allows you to chose exactly
8552 what material to include, and in the following sections you will learn
8553 that this is indeed a powerful mechanism that can solve all of the above
8557 \begin_layout Section
8562 \begin_layout Standard
8564 The external material feature is based on the concept of a
8569 A template is a specification of how LyX should interface with a certain
8571 As bundled, LyX comes with predefined templates for XFig figures, Dia diagrams,
8572 various raster format images, gnuplot, and more.
8573 You can check the actual list by using the
8575 Insert\SpecialChar \menuseparator
8584 Furthermore, it is possible to roll your own template to support a specific
8586 Later we'll describe in more detail what is involved, and hopefully you
8587 will submit all the templates you create so we can include them in a later
8591 \begin_layout Standard
8593 Another basic idea of the external material feature is to distinguish between
8594 the original file that serves as a base for final material and the produced
8595 file that is included in your exported or printed document.
8596 For example, consider the case of a figure produced with XFig.
8597 The XFig application itself works on an original file with the
8602 Within XFig, you create and change your figure, and when you are done,
8608 When you want to include the figure in your document, you invoke
8612 in order to create a PostScript file that can readily be included in your
8618 file is the original file, and the PostScript file is the produced file.
8621 \begin_layout Standard
8623 This distinction is important in order to allow updating of the material
8624 while you are in the process of writing the document.
8625 Furthermore, it provides us with the flexibility that is needed to support
8626 multiple export formats.
8627 For instance, in the case of an Ascii resulting file, it is not exactly
8628 an award-winning idea to include the figure as raw PostScript.
8629 Instead, you'd either prefer to just include a reference to the figure,
8630 or try to invoke some graphics to Ascii converter to make the final result
8631 look similar to the real graphics.
8632 The external material management allows you to do this, because it is parameter
8633 ized on the different export formats that LyX supports.
8636 \begin_layout Standard
8638 Besides supporting the production of different products according to the
8639 exported format, it supports tight integration with editing and viewing
8641 In the case of an XFig figure, you are able to invoke
8645 on the original file with a single click from within the external material
8646 dialog in LyX, and also preview the produced PostScript file with
8651 No more fiddling around with the command line and/or file browsers to locate
8652 and manipulate the original or produced files.
8653 In this way, you are finally able to take full advantage of the many different
8654 applications that are relevant to use when you write your documents, and
8655 ultimately be more productive.
8658 \begin_layout Standard
8661 \begin_inset Note Note
8664 \begin_layout Standard
8666 This paragraph is outdated
8671 So, all in all, LyX has information about a number of different programs
8672 to use behind the scenes in order to realize all of this machinery.
8673 This information, in fact, is exactly what is contained in the templates.
8674 To each template, there is associated a list of command lines that are
8675 used to invoke applications, convert the original file to the produced
8677 This mechanism allows the advanced user to extend the capabilities of LyX
8678 without fiddling with the source code.
8679 It requires some footwork to define all the different commands and flags,
8680 but luckily, the LyX team did all the hard work and specified these for
8684 \begin_layout Standard
8686 But before the trees grow into the skies, we have to admit that we did take
8688 Since you can produce many different kinds of files to go with each exported
8689 format, one could also expect that it would be possible to preview each
8691 The LyX team decided against this in order to keep the user interface simple.
8692 Instead of providing a button for each exported file format, we decided
8693 to introduce the concept of the primary file format and just have one button.
8703 in the external material dialog, you will get a view of the produced file
8704 in the primary file format.
8705 And the primary file format is specified by your document class.
8706 For most document classes, the primary file format is LaTeX, but for the
8707 DocBook document classes, the primary file format is DocBook.
8708 So, when you view the produced file, keep in mind that it will only be
8709 a preview of what the main result will be.
8710 If you want to see how other exported formats turn out, you have to export
8711 them and preview them by hand.
8714 \begin_layout Section
8716 The external material dialog
8719 \begin_layout Standard
8721 You insert external material from the
8729 When you do this, a button is inserted into your document, and the external
8730 material dialog is shown.
8731 This dialog allows you to describe exactly what material should be included,
8732 and also how it should be included.
8733 Furthermore, it provides access to the external applications to either
8734 view, edit or produce the material that is used in the resulting file.
8737 \begin_layout Standard
8740 \begin_inset Note Note
8743 \begin_layout Standard
8745 This paragraph is outdated
8750 At the top of this dialog, there is a drop-down list where you can chose
8751 which template should be used.
8752 Just below the template drop-down, there's a text area with a short blurb
8753 about the chosen template that should help you use it.
8754 Most often, it will provide a short description of the template, and a
8755 few hints on how to parameterize the use of it.
8756 Further down, you'll find a filename input field along with a
8757 \begin_inset Quotes eld
8761 \begin_inset Quotes erd
8764 button that allows you to chose which file should be included with the
8765 standard file browser.
8766 Thus this field specifies the original file.
8767 Since the produced file is automatically generated when needed, there is
8768 no need to give access to it in the user interface.
8771 \begin_layout Standard
8774 \begin_inset Note Note
8777 \begin_layout Standard
8779 This paragraph is outdated
8784 At the bottom of the dialog, you'll find a general input box called
8789 This box is generally used to parameterize the specific template.
8790 The specific use should be covered in the help blurb associated with the
8791 template, but it typically allows you to define variations on how the produced
8792 file should be generated.
8795 \begin_layout Standard
8798 \begin_inset Note Note
8801 \begin_layout Standard
8803 This paragraph is outdated
8808 At the right side of the dialog, you'll find three buttons:
8836 These in turn allow you to edit your original file with the appropriate
8837 editing application, view the produced file as included in the primary
8838 format document, and finally force an update of the resulting material
8839 in the primary format.
8849 button will be disabled, because most templates are configured to automatically
8850 update the produced file when needed.
8851 In those cases, there is no need to force the production of a new produced
8853 However, some templates are configured to not be automatically producing
8854 the residual product, because the cost of producing the produced file might
8855 be so large that it would be a pain to do it all the time.
8856 Those types are known as
8861 In those cases, you can use the button to force the production of the produced
8862 file exactly when you need it, and thus control the amount of work that
8868 responsibility to do this to keep the produced files current at all times:
8869 before printing, before exporting, before viewing, etc.
8870 At some time in the future, it might be possible that LyX will help you
8871 with this task.Any changes in the template, filename or parameters are actually
8872 applied whenever you press
8897 \begin_layout Section
8902 \begin_layout Standard
8904 In this section, we should include some examples of use of the external
8906 Those examples could include:
8909 \begin_layout Itemize
8911 External raster images
8914 \begin_layout Itemize
8916 External XFig figures
8919 \begin_layout Itemize
8924 \begin_layout Itemize
8929 \begin_layout Itemize
8931 The use of makefiles
8934 \begin_layout Itemize
8936 Recursive external LyX templates
8939 \begin_layout Section
8941 The external template configuration file
8944 \begin_layout Standard
8946 It is relatively easy to add custom external template definitions to LyX.
8947 However, be aware this doing this in an careless manner most probably
8951 introduce an easily exploitable security hole.
8952 So before you do this, please read the discussion about security which
8956 \begin_layout Standard
8958 Having said that, we encourage you to submit any interesting templates that
8963 \begin_layout Standard
8965 The external templates are defined in the
8967 lib/external_templates
8970 You can place your own version in
8972 .lyx/external_templates
8977 \begin_layout Standard
8979 A typical template looks like this:
8982 \begin_layout LyX-Code
8987 \begin_layout LyX-Code
8989 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
8992 \begin_layout LyX-Code
8997 \begin_layout LyX-Code
9002 \begin_layout LyX-Code
9007 \begin_layout LyX-Code
9012 \begin_layout LyX-Code
9017 \begin_layout LyX-Code
9019 AutomaticProduction true
9022 \begin_layout LyX-Code
9027 \begin_layout LyX-Code
9032 \begin_layout LyX-Code
9037 \begin_layout LyX-Code
9039 TransformCommand Rotate RotationLatexCommand
9042 \begin_layout LyX-Code
9044 TransformCommand Resize ResizeLatexCommand
9047 \begin_layout LyX-Code
9049 Product "$$RotateFront$$ResizeFront
9052 \begin_layout LyX-Code
9058 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
9061 \begin_layout LyX-Code
9063 $$ResizeBack$$RotateBack"
9066 \begin_layout LyX-Code
9071 \begin_layout LyX-Code
9073 UpdateResult "$$AbsPath$$Basename.pstex_t"
9076 \begin_layout LyX-Code
9078 Requirement "graphicx"
9081 \begin_layout LyX-Code
9083 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
9086 \begin_layout LyX-Code
9088 ReferencedFile latex "$$AbsPath$$Basename.eps"
9091 \begin_layout LyX-Code
9093 ReferencedFile dvi "$$AbsPath$$Basename.eps"
9096 \begin_layout LyX-Code
9101 \begin_layout LyX-Code
9106 \begin_layout LyX-Code
9108 TransformCommand Rotate RotationLatexCommand
9111 \begin_layout LyX-Code
9113 TransformCommand Resize ResizeLatexCommand
9116 \begin_layout LyX-Code
9118 Product "$$RotateFront$$ResizeFront
9121 \begin_layout LyX-Code
9127 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
9130 \begin_layout LyX-Code
9132 $$ResizeBack$$RotateBack"
9135 \begin_layout LyX-Code
9140 \begin_layout LyX-Code
9142 UpdateResult "$$AbsPath$$Basename.pdftex_t"
9145 \begin_layout LyX-Code
9147 Requirement "graphicx"
9150 \begin_layout LyX-Code
9152 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
9155 \begin_layout LyX-Code
9157 ReferencedFile latex "$$AbsPath$$Basename.pdf"
9160 \begin_layout LyX-Code
9165 \begin_layout LyX-Code
9170 \begin_layout LyX-Code
9172 Product "$$Contents(
9174 "$$AbsPath$$Basename.asc
9179 \begin_layout LyX-Code
9181 UpdateFormat asciixfig
9184 \begin_layout LyX-Code
9186 UpdateResult "$$AbsPath$$Basename.asc"
9189 \begin_layout LyX-Code
9194 \begin_layout LyX-Code
9199 \begin_layout LyX-Code
9201 Product "<graphic fileref=
9203 "$$AbsOrRelPathMaster$$Basename.eps
9208 \begin_layout LyX-Code
9213 \begin_layout LyX-Code
9218 \begin_layout LyX-Code
9220 UpdateResult "$$AbsPath$$Basename.eps"
9223 \begin_layout LyX-Code
9225 ReferencedFile docbook "$$AbsPath$$Basename.eps"
9228 \begin_layout LyX-Code
9230 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
9233 \begin_layout LyX-Code
9238 \begin_layout LyX-Code
9243 \begin_layout LyX-Code
9245 Product "[XFig: $$FName]"
9248 \begin_layout LyX-Code
9253 \begin_layout LyX-Code
9258 \begin_layout Standard
9260 As you can see, the template is enclosed in
9264 \SpecialChar \ldots{}
9270 It contains a header specifying some general settings, and for each supported
9271 primary document file format a section
9275 \SpecialChar \ldots{}
9283 \begin_layout Subsection
9288 \begin_layout Description
9293 Template\InsetSpace ~
9297 A unique name for the template.
9298 It must not contain substitution macros (see below).
9301 \begin_layout Description
9306 GuiName\InsetSpace ~
9310 The text that is displayed on the button.
9311 This command must occur exactly once.
9314 \begin_layout Description
9319 HelpText\InsetSpace ~
9324 The help text that is used in the External dialog.
9325 Provide enough information to explain to the user just what the template
9326 can provide him with.
9327 This command must occur exactly once.
9330 \begin_layout Description
9335 InputFormat\InsetSpace ~
9339 The file format of the original file.
9340 This must be the name of a format that is known to LyX (see the
9345 ools\SpecialChar \menuseparator
9350 references:Conversion
9357 if the template can handle original files of more than one format.
9358 LyX will attempt to interrogate the file itself in order to deduce its
9359 format in this case.
9360 This command must occur exactly once.
9363 \begin_layout Description
9368 FileFilter\InsetSpace ~
9372 A glob pattern that is used in the file dialog to filter out the desired
9374 If there is more than one possible file extension (e.g.\InsetSpace ~
9383 ), use something like
9388 This command must occur exactly once.
9391 \begin_layout Description
9396 AutomaticProduction\InsetSpace ~
9400 Wether the file represented by the template must be generated by LyX.
9401 This command must occur exactly once.
9404 \begin_layout Description
9409 Transform\InsetSpace ~
9410 Rotate|Resize|Clip|Extra
9413 This command specifies which transformations are supported by this template.
9414 It may occur zero or more times.
9415 This command enables the corresponding tabs in the external dialog.
9420 command must have either a corresponding
9433 Otherwise the transformation will not be supported by that format.
9436 \begin_layout Subsection
9441 \begin_layout Description
9447 LaTeX|PDFLaTeX|Ascii|DocBook|LinuxDoc
9450 The primary document file format that this format definition is for.
9451 Not every template has a sensible representation in all document file formats.
9452 Please define nevertheless a
9456 section for all formats.
9457 Use a dummy text when no representation is available (see the LinuxDoc
9458 format in the example above).
9459 Then you can at least see a reference to the external material in the exported
9463 \begin_layout Description
9468 TransformCommand\InsetSpace ~
9470 RotationLatexCommand
9473 This command specifies that the built in LaTeX command should be used for
9475 This command may occur once or not at all.
9478 \begin_layout Description
9483 TransformCommand\InsetSpace ~
9488 This command specifies that the built in LaTeX command should be used for
9490 This command may occur once or not at all.
9493 \begin_layout Description
9498 TransformOption\InsetSpace ~
9503 This command specifies that rotation is done via an optional argument.
9504 This command may occur once or not at all.
9507 \begin_layout Description
9512 TransformOption\InsetSpace ~
9517 This command specifies that resizing is done via an optional argument.
9518 This command may occur once or not at all.
9521 \begin_layout Description
9526 TransformOption\InsetSpace ~
9531 This command specifies that clipping is done via an optional argument.
9532 This command may occur once or not at all.
9535 \begin_layout Description
9540 TransformOption\InsetSpace ~
9545 This command specifies that an extra optional argument is used.
9546 This command may occur once or not at all.
9549 \begin_layout Description
9554 Product\InsetSpace ~
9558 The text that is inserted in the exported document.
9559 This is actually the most important command and can be quite complex.
9560 This command must occur exactly once.
9563 \begin_layout Description
9568 UpdateFormat\InsetSpace ~
9572 The file format of the converted file.
9573 This must be the name of a format that is known to LyX (see the
9578 ools\SpecialChar \menuseparator
9583 references:Conversion
9586 This command must occur exactly once.
9589 \begin_layout Description
9594 UpdateResult\InsetSpace ~
9598 The file name of the converted file.
9599 The file name must be absolute.
9600 This command must occur exactly once.
9603 \begin_layout Description
9608 ReferencedFile\InsetSpace ~
9609 <format>\InsetSpace ~
9613 This command denotes files that are created by the conversion process and
9614 are needed for a particular export format.
9615 If the filename is relative, it is interpreted relative to the master document.
9616 This command may be given zero or more times.
9619 \begin_layout Description
9624 Requirement\InsetSpace ~
9628 The name of a required LaTeX package.
9629 The package is included via
9635 in the LaTeX preamble.
9636 This command may occur zero or more times.
9639 \begin_layout Description
9644 Preamble\InsetSpace ~
9648 This command specifies a preamble snippet that will be included in the
9650 It has to be defined using
9654 \SpecialChar \ldots{}
9660 This command may occur zero or more times.
9663 \begin_layout Description
9673 This command defines an additional macro
9686 itself may contain substitution macros.
9687 The advantage over using
9695 is that the substituted value of
9699 is sanitized so that it is a valid optional argument in the document format.
9700 This command may occur zero or more times.
9703 \begin_layout Subsection
9705 Preamble definitions
9708 \begin_layout Standard
9710 The external template configuration file may contain additional preamble
9711 definitions enclosed by
9715 \SpecialChar \ldots{}
9721 They can be used by the templates in the
9728 \begin_layout Section
9730 The substitution mechanism
9733 \begin_layout Standard
9735 When the external material facility invokes an external program, it is done
9736 on the basis of a command defined in the template configuration file.
9737 These commands can contain various macros that are expanded before execution.
9738 Execution always take place in the directory of the containing document.
9741 \begin_layout Standard
9743 Also, whenever external material is to be displayed, the name will be produced
9744 by the substitution mechanism, and most other commands in the template
9745 definition support substitution as well.
9748 \begin_layout Standard
9750 The available macros are the following:
9753 \begin_layout Description
9755 $$FName The filename of the file specified in the external material dialog.
9756 This is either an absolute name, or it is relative to the LyX document.
9759 \begin_layout Description
9761 $$Basename The filename without path and without the extension.
9764 \begin_layout Description
9766 $$Extension The file extension (including the dot).
9769 \begin_layout Description
9771 $$FPath The path part of
9775 (absolute name or relative to the LyX document).
9778 \begin_layout Description
9780 $$AbsPath The absolute file path.
9783 \begin_layout Description
9785 $$RelPathMaster The file path, relative to the master LyX document.
9788 \begin_layout Description
9790 $$RelPathParent The file path, relative to the LyX document.
9793 \begin_layout Description
9795 $$AbsOrRelPathMaster The file path, absolute or relative to the master LyX
9799 \begin_layout Description
9801 $$AbsOrRelPathParent The file path, absolute or relative to the LyX document.
9804 \begin_layout Description
9806 $$Tempname A name and full path to a temporary file which will be automatically
9807 deleted whenever the containing document is closed, or the external material
9811 \begin_layout Description
9814 \begin_inset Quotes eld
9818 \begin_inset Quotes erd
9821 ) This macro will expand to the contents of the file with the name
9828 \begin_layout Description
9830 $$Sysdir This macro will expand to the absolute path of the system directory.
9831 This is typically used to point to the various helper scripts that are
9835 \begin_layout Standard
9837 All path macros contain a trailing directory separator, so you can construct
9839 the absolute filename with
9841 $$AbsPath$$Basename$$Extension
9846 \begin_layout Standard
9848 The macros above are substituted in all commands unless otherwise noted.
9853 supports additionally the following substitutions if they are enabled by
9865 \begin_layout Description
9867 $$ResizeFront The front part of the resize command.
9870 \begin_layout Description
9872 $$ResizeBack The back part of the resize command.
9875 \begin_layout Description
9877 $$RotateFront The front part of the rotation command.
9880 \begin_layout Description
9882 $$RotateBack The back part of the rotation command.
9885 \begin_layout Standard
9887 The value string of the
9891 command supports additionally the following substitutions if they are enabled
9903 \begin_layout Description
9905 $$Clip The clip option.
9908 \begin_layout Description
9910 $$Extra The extra option.
9913 \begin_layout Description
9915 $$Resize The resize option.
9918 \begin_layout Description
9920 $$Rotate The rotation option.
9923 \begin_layout Standard
9925 You may ask why there are so many path macros.
9926 There are mainly two reasons:
9929 \begin_layout Standard
9931 First, relative and absolute file names should remain relative or absolute,
9933 Users may have reasons to prefer either form.
9934 Relative names are useful for portable documents that should work on different
9935 machines, for example.
9936 Absolute names may be required by some programs.
9939 \begin_layout Standard
9941 Second, LaTeX treats relative file names differently than LyX and other
9942 programs in nested included files.
9943 For LyX, a relative file name is always relative to the document that contains
9945 For LaTeX, it is always relative to the master document.
9946 These two definitions are identical if you have only one document, but
9947 differ if you have a master document that includes part documents.
9948 That means that relative filenames must be transformed when presented to
9950 Fortunately LyX does this automatically for you if you choose the right
9954 \begin_layout Standard
9956 So which path macro should be used in new template definitions? The rule
9960 \begin_layout Itemize
9966 if an absolute path is required.
9969 \begin_layout Itemize
9973 $$AbsOrRelPathMaster
9975 if the substituted string is some kind of LaTeX input.
9978 \begin_layout Itemize
9982 $$AbsOrRelPathParent
9984 in order to preserve the user's choice.
9987 \begin_layout Standard
9989 There are special cases where this rule does not work and e.g.\InsetSpace ~
9991 are needed, but normally it will work just fine.
9992 One example for such a case is the command
9994 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
9996 in the XFig template above: We can't use the absolute name because the
10001 files needs the relative name in order to rewrite the file content.
10004 \begin_layout Section
10006 Security discussion
10009 \begin_layout Standard
10012 \begin_inset Note Note
10015 \begin_layout Standard
10017 This section is outdated
10022 The external material feature interfaces with a lot of external programs
10023 and does so automatically, so we have to consider the security implications
10025 In particular, since you have the option of including your own filenames
10026 and/or parameter strings and those are expanded into a command, it seems
10027 that it would be possible to create a malicious document which executes
10028 arbitrary commands when a user views or prints the document.
10029 This is something we definately want to avoid.
10032 \begin_layout Standard
10034 However, since the external program commands are specified in the template
10035 configuration file only, there are no security issues if LyX is properly
10036 configured with safe templates only.
10037 This is so because the external programs are invoked with the
10041 -system call rather than the
10045 system-call, so it's not possible to execute arbitrary commands from the
10046 filename or parameter section via the shell.
10049 \begin_layout Standard
10051 This also implies that you are restricted in what command strings you can
10052 use in the external material templates.
10053 In particular, pipes and redirection are not readily available.
10054 This has to be so if LyX should remain safe.
10055 If you want to use some of the shell features, you should write a safe
10056 script to do this in a controlled manner, and then invoke the script from
10057 the command string.
10062 directory of the LyX installation, you can find a safe wrapper script
10064 general_command_wrapper.py
10066 that supports redirection of input and output.
10067 That can serve as an example for how to write safe template scripts.
10068 For a more advanced example that uses
10072 and friends, take a look at the
10079 \begin_layout Standard
10081 It is possible to design a template that interacts directly with the shell,
10082 but since this would allow a malicious user to execute arbitrary commands
10083 by writing clever filenames and/or parameters, we generally recommend that
10084 you only use safe scripts that work with the
10088 system call in a controlled manner.
10089 Of course, for use in a controlled environment, it can be tempting to just
10090 fall back to use ordinary shell scripts.
10091 If you do so, be aware that you
10095 provide an easily exploitable security hole in your system.
10096 Of course it stands to reason that such unsafe templates will never be
10097 included in the standard LyX distribution, although we do encourage people
10098 to submit new templates in the open source tradition.
10099 But LyX as shipped from the official distribution channels will never have
10103 \begin_layout Standard
10105 Including external material provides a lot of power, and you have to be
10106 careful not to introduce security hazards with this power.
10107 A subtle error in a single line in an innocent looking script can open
10108 the door to huge security problems.
10109 So if you do not fully understand the issues, we recommend that you consult
10110 a knowledgable security professional or the LyX development team if you
10111 have any questions about whether a given template is safe or not.
10112 And do this before you use it in an uncontrolled environment.
10115 \begin_layout Chapter
10120 \begin_layout Section
10125 \begin_layout Standard
10127 The LyX server is a method implemented in LyX that will enable other programs
10128 to talk to LyX, invoke LyX commands, and retrieve information about the
10129 LyX internal state.
10130 This is only intended for advanced users, but they should find it useful.
10133 \begin_layout Section
10135 Starting the LyX Server
10138 \begin_layout Standard
10140 The LyX server works through the use of a pair of named pipes.
10141 These are usually located in your home directory and have the names
10142 \begin_inset Quotes eld
10150 \begin_inset Quotes erd
10154 \begin_inset Quotes eld
10162 \begin_inset Quotes erd
10166 External programs write into
10170 and read back data from
10175 The stem of the pipe names can be defined in the
10180 ools\SpecialChar \menuseparator
10187 dialog, for example
10189 "/home/myhome/.lyxpipe"
10194 \begin_layout Standard
10204 ' to create the pipes.
10205 The above setting also has the effect of activating the LyX server.
10206 If one of the pipes already exists, LyX will assume that another LyX process
10207 is already running and will not start the server.
10208 To have several LyX processes with servers at the same time, you have to
10209 change the configuration between the start of the programs.
10212 \begin_layout Standard
10214 If you are developing a client program, you might find it useful to enable
10215 debugging information from the LyX server.
10216 Do this by starting LyX as
10218 lyx -dbg lyxserver.
10221 \begin_layout Standard
10223 Warning: if LyX crashes, it may not manage to remove the pipes; in this
10224 case you must remove them manually.
10225 If LyX starts and the pipes exist already, it will not start any server.
10228 \begin_layout Standard
10230 Other than this, there are a few points to consider:
10233 \begin_layout Itemize
10235 Both server and clients must run on UNIX or OS/2 machines.
10236 Communications between LyX on UNIX and clients on OS/2 or vice versa is
10237 not possible right now.
10240 \begin_layout Itemize
10242 On OS/2, only one client can connect to LyXServer at a time.
10245 \begin_layout Itemize
10247 On OS/2, clients must open inpipe with
10254 \begin_layout Standard
10256 You can find a complete example client written in C in the source distribution
10259 development/server_monitor.c
10264 \begin_layout Section
10266 Normal communication
10269 \begin_layout Standard
10271 To issue a LyX call, the client writes a line of ASCII text into the input
10273 This line has the following format:
10276 \begin_layout Quote
10291 \begin_layout Standard
10297 is a name that the client can choose arbitrarily.
10298 Its only use is that LyX will echo it if it sends an answer - so a client
10299 can dispatch results from different requesters.
10302 \begin_layout Standard
10308 is the function you want LyX to perform.
10309 It is the same as the commands you'd use in the minibuffer.
10312 \begin_layout Standard
10318 is an optional argument which is meaningful only to some functions (for
10320 \begin_inset Quotes eld
10324 \begin_inset Quotes erd
10327 which will insert the argument as text at the cursor position.)
10330 \begin_layout Standard
10332 The answer from LyX will arrive in the output pipe and be of the form
10335 \begin_layout Quote
10350 \begin_layout Standard
10360 are just echoed from the command request, while
10364 is more or less useful information filled according to how the command
10365 execution worked out.
10366 Some commands will return information about the internal state of LyX,
10368 \begin_inset Quotes eld
10372 \begin_inset Quotes erd
10375 , while other will return an empty data-response.
10376 This means that the command execution went fine.
10379 \begin_layout Standard
10381 In case of errors, the response from LyX will have this form
10384 \begin_layout Quote
10399 \begin_layout Standard
10405 should contain an explanation of why the command failed.
10408 \begin_layout Standard
10413 \begin_layout LyX-Code
10415 echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
10418 \begin_layout LyX-Code
10420 echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
10422 read a <~/.lyxpipe.out
10427 \begin_layout Section
10432 \begin_layout Standard
10434 LyX can notify clients of events going on asynchronously.
10435 Currently it will only do this if the user binds a key sequence with the
10437 \begin_inset Quotes eld
10441 \begin_inset Quotes erd
10445 The format of the string LyX sends is as follows:
10448 \begin_layout Quote
10458 \begin_layout Standard
10464 is the printed representation of the key sequence that was actually typed
10468 \begin_layout Standard
10470 This mechanism can be used to extend LyX's command set and implement macros:
10471 bind some key sequence to
10472 \begin_inset Quotes eld
10476 \begin_inset Quotes erd
10479 , start a client that listens on the out pipe, dispatches the command according
10480 to the sequence and starts a function that may use LyX calls and LyX requests
10481 to issue a command or a series of commands to LyX.
10484 \begin_layout Section
10486 The simple LyX Server Protocol
10489 \begin_layout Standard
10491 LyX implements a simple protocol that can be used for session management.
10492 All messages are of the form
10495 \begin_layout Quote
10506 \begin_layout Standard
10513 \begin_inset Quotes eld
10517 \begin_inset Quotes erd
10521 \begin_inset Quotes eld
10525 \begin_inset Quotes erd
10530 \begin_inset Quotes eld
10534 \begin_inset Quotes erd
10537 is received from a client, LyX will report back to inform the client that
10538 it's listening to it's messages, while
10539 \begin_inset Quotes eld
10543 \begin_inset Quotes erd
10546 sent from LyX will inform clients that LyX is closing.
10549 \begin_layout Chapter
10554 \begin_layout Standard
10556 This appendix is a huge cross-reference to all the English language keybindings.
10557 Originally, we simply wanted to list all of the key bindings followed by
10558 the function it's bound to.
10559 That way, a user can look up a key to find out what it does.
10560 We then decided, what the hey, why not include the default toolbar and
10561 menu bindings, too.
10562 Please note this section is likely to be very out of date.
10565 \begin_layout Standard
10567 The form is really self-explanatory, but here are a few tips: all entries
10568 are arranged roughly alphabetically for a given modifier (
10577 For the general keyboard layout, simpler prefixes precede the more complex
10587 All entries were gleaned from the default user interface and binding files
10588 located in the directories
10590 \SpecialChar \ldots{}
10595 \SpecialChar \ldots{}
10598 ; they should be treated as the final word on the bindings.
10601 \begin_layout Standard
10603 As a final note, be aware that some window managers (such as FVWM) take
10604 control of some of the function keys or motion keys.
10609 is listed here as generating
10613 , but FVWM grabs it and uses it to change virtual desktops instead.
10614 Very annoying unless you instruct your window manager to stop intercepting
10618 \begin_layout Section
10623 \begin_layout LyX-Code
10628 \begin_layout LyX-Code
10633 \begin_layout LyX-Code
10638 \begin_layout LyX-Code
10640 Icon "buffer-write"
10643 \begin_layout LyX-Code
10645 Icon "buffer-print"
10648 \begin_layout LyX-Code
10653 \begin_layout LyX-Code
10658 \begin_layout LyX-Code
10663 \begin_layout LyX-Code
10668 \begin_layout LyX-Code
10673 \begin_layout LyX-Code
10678 \begin_layout LyX-Code
10683 \begin_layout LyX-Code
10688 \begin_layout LyX-Code
10693 \begin_layout LyX-Code
10698 \begin_layout LyX-Code
10703 \begin_layout LyX-Code
10708 \begin_layout LyX-Code
10710 Icon "footnote-insert"
10713 \begin_layout LyX-Code
10715 Icon "marginpar-insert"
10718 \begin_layout LyX-Code
10723 \begin_layout LyX-Code
10728 \begin_layout LyX-Code
10730 Icon "figure-insert"
10733 \begin_layout LyX-Code
10735 Icon "dialog-tabular-insert"
10738 \begin_layout LyX-Code
10743 \begin_layout Section
10748 \begin_layout Subsection
10754 \labelwidthstring 00.00.0000
10765 \labelwidthstring 00.00.0000
10778 \labelwidthstring 00.00.0000
10791 \labelwidthstring 00.00.0000
10806 \labelwidthstring 00.00.0000
10817 \labelwidthstring 00.00.0000
10832 \labelwidthstring 00.00.0000
10843 \labelwidthstring 00.00.0000
10856 \labelwidthstring 00.00.0000
10869 \labelwidthstring 00.00.0000
10882 \labelwidthstring 00.00.0000
10889 buffer-new-template
10893 \labelwidthstring 00.00.0000
10907 \labelwidthstring 00.00.0000
10917 \labelwidthstring 00.00.0000
10927 \labelwidthstring 00.00.0000
10937 \labelwidthstring 00.00.0000
10947 \labelwidthstring 00.00.0000
10957 \labelwidthstring 00.00.0000
10967 \labelwidthstring 00.00.0000
10977 \begin_layout Subsection
10983 \labelwidthstring 00.00.0000
10996 \labelwidthstring 00.00.0000
11009 \labelwidthstring 00.00.0000
11022 \labelwidthstring 00.00.0000
11035 \labelwidthstring 00.00.0000
11048 \labelwidthstring 00.00.0000
11061 \labelwidthstring 00.00.0000
11077 \labelwidthstring 00.00.0000
11085 tabular-feature append-row
11089 \labelwidthstring 00.00.0000
11097 tabular-feature toggle-line-bottom
11101 \labelwidthstring 00.00.0000
11109 tabular-feature align-center
11113 \labelwidthstring 00.00.0000
11121 tabular-feature delete-column
11125 \labelwidthstring 00.00.0000
11133 tabular-feature align-left
11137 \labelwidthstring 00.00.0000
11145 tabular-feature align-right
11149 \labelwidthstring 00.00.0000
11157 tabular-feature toggle-line-left
11161 \labelwidthstring 00.00.0000
11169 tabular-feature multicolumn
11173 \labelwidthstring 00.00.0000
11181 tabular-feature valign-center
11185 \labelwidthstring 00.00.0000
11193 tabular-feature valign-top
11197 \labelwidthstring 00.00.0000
11205 tabular-feature toggle-line-right
11209 \labelwidthstring 00.00.0000
11217 tabular-feature toggle-line-top
11221 \labelwidthstring 00.00.0000
11229 tabular-feature append-column
11233 \labelwidthstring 00.00.0000
11241 tabular-feature valign-bottom
11245 \labelwidthstring 00.00.0000
11253 tabular-feature delete-row
11257 \labelwidthstring 00.00.0000
11271 \labelwidthstring 00.00.0000
11277 floats-operate openfoot
11281 \labelwidthstring 00.00.0000
11287 floats-operate closefoot
11291 \labelwidthstring 00.00.0000
11297 floats-operate openfig
11301 \labelwidthstring 00.00.0000
11311 \labelwidthstring 00.00.0000
11321 \labelwidthstring 00.00.0000
11327 floats-operate closefig
11331 \labelwidthstring 00.00.0000
11344 \labelwidthstring 00.00.0000
11359 \labelwidthstring 00.00.0000
11372 \labelwidthstring 00.00.0000
11385 \labelwidthstring 00.00.0000
11400 \labelwidthstring 00.00.0000
11411 \labelwidthstring 00.00.0000
11425 \labelwidthstring 00.00.0000
11433 primary-selection-paste
11437 \labelwidthstring 00.00.0000
11445 primary-selection-paste paragraph
11448 \begin_layout Subsection
11454 \labelwidthstring 00.00.0000
11470 \labelwidthstring 00.00.0000
11478 buffer-float-insert algorithm
11482 \labelwidthstring 00.00.0000
11490 buffer-float-insert wide-tab
11494 \labelwidthstring 00.00.0000
11502 buffer-float-insert figure
11506 \labelwidthstring 00.00.0000
11514 buffer-float-insert table
11518 \labelwidthstring 00.00.0000
11526 buffer-float-insert wide-fig
11530 \labelwidthstring 00.00.0000
11539 dialog-tabular-insert
11543 \labelwidthstring 00.00.0000
11556 \labelwidthstring 00.00.0000
11569 \labelwidthstring 00.00.0000
11578 buffer-child-insert
11582 \labelwidthstring 00.00.0000
11595 \labelwidthstring 00.00.0000
11608 \labelwidthstring 00.00.0000
11621 \labelwidthstring 00.00.0000
11634 \labelwidthstring 00.00.0000
11647 \labelwidthstring 00.00.0000
11660 \labelwidthstring 00.00.0000
11673 \labelwidthstring 00.00.0000
11689 \labelwidthstring 00.00.0000
11701 \labelwidthstring 00.00.0000
11713 \labelwidthstring 00.00.0000
11725 \labelwidthstring 00.00.0000
11737 \labelwidthstring 00.00.0000
11749 \labelwidthstring 00.00.0000
11761 \labelwidthstring 00.00.0000
11774 \labelwidthstring 00.00.0000
11790 \labelwidthstring 00.00.0000
11798 protected-space-insert
11802 \labelwidthstring 00.00.0000
11810 end-of-sentence-period-insert
11814 \labelwidthstring 00.00.0000
11826 \labelwidthstring 00.00.0000
11838 \labelwidthstring 00.00.0000
11850 \labelwidthstring 00.00.0000
11858 menu-separator-insert
11862 \labelwidthstring 00.00.0000
11870 hyphenation-point-insert
11874 \labelwidthstring 00.00.0000
11886 \labelwidthstring 00.00.0000
11894 command-sequence math-insert ^;math-mode;
11898 \labelwidthstring 00.00.0000
11906 command-sequence math-insert _;math-mode;
11910 \labelwidthstring 00.00.0000
11926 \labelwidthstring 00.00.0000
11934 file-insert-ascii lines
11938 \labelwidthstring 00.00.0000
11946 file-insert-ascii paragraphs
11950 \labelwidthstring 00.00.0000
11962 \labelwidthstring 00.00.0000
11975 \labelwidthstring 00.00.0000
11988 \labelwidthstring 00.00.0000
12000 \begin_layout Subsection
12006 \labelwidthstring 00.00.0000
12019 \labelwidthstring 00.00.0000
12032 \labelwidthstring 00.00.0000
12045 \labelwidthstring 00.00.0000
12058 \labelwidthstring 00.00.0000
12071 \labelwidthstring 00.00.0000
12084 \labelwidthstring 00.00.0000
12097 \labelwidthstring 00.00.0000
12110 \labelwidthstring 00.00.0000
12119 layout-save-default
12123 \labelwidthstring 00.00.0000
12136 \labelwidthstring 00.00.0000
12149 \labelwidthstring 00.00.0000
12161 \begin_layout Subsubsection
12165 ayout\SpecialChar \menuseparator
12172 \labelwidthstring 00.00.0000
12183 \labelwidthstring 00.00.0000
12194 \labelwidthstring 00.00.0000
12205 \labelwidthstring 00.00.0000
12216 \labelwidthstring 00.00.0000
12229 \labelwidthstring 00.00.0000
12240 \labelwidthstring 00.00.0000
12251 \labelwidthstring 00.00.0000
12262 \labelwidthstring 00.00.0000
12273 \labelwidthstring 00.00.0000
12284 \labelwidthstring 00.00.0000
12295 \labelwidthstring 00.00.0000
12306 \labelwidthstring 00.00.0000
12317 \labelwidthstring 00.00.0000
12328 \labelwidthstring 00.00.0000
12341 \labelwidthstring 00.00.0000
12354 \labelwidthstring 00.00.0000
12367 \labelwidthstring 00.00.0000
12380 \labelwidthstring 00.00.0000
12391 \labelwidthstring 00.00.0000
12404 \labelwidthstring 00.00.0000
12417 \labelwidthstring 00.00.0000
12428 \labelwidthstring 00.00.0000
12441 \labelwidthstring 00.00.0000
12454 \labelwidthstring 00.00.0000
12467 \labelwidthstring 00.00.0000
12480 \labelwidthstring 00.00.0000
12491 \labelwidthstring 00.00.0000
12502 \labelwidthstring 00.00.0000
12515 \labelwidthstring 00.00.0000
12528 \labelwidthstring 00.00.0000
12541 \labelwidthstring 00.00.0000
12552 \labelwidthstring 00.00.0000
12562 \begin_layout Subsection
12567 \begin_layout Subsection
12572 \begin_layout Subsection
12577 \begin_layout Subsection
12583 \labelwidthstring 00.00.0000
12596 \labelwidthstring 00.00.0000
12609 \labelwidthstring 00.00.0000
12622 \labelwidthstring 00.00.0000
12635 \labelwidthstring 00.00.0000
12648 \labelwidthstring 00.00.0000
12657 layout ShortFoilhead
12661 \labelwidthstring 00.00.0000
12674 \labelwidthstring 00.00.0000
12687 \labelwidthstring 00.00.0000
12700 \labelwidthstring 00.00.0000
12713 \labelwidthstring 00.00.0000
12722 layout ShortRotatefoilhead
12726 \labelwidthstring 00.00.0000
12739 \labelwidthstring 00.00.0000
12752 \labelwidthstring 00.00.0000
12765 \labelwidthstring 00.00.0000
12774 drop-layouts-choice
12778 \labelwidthstring 00.00.0000
12794 \labelwidthstring 00.00.0000
12810 \labelwidthstring 00.00.0000
12823 \labelwidthstring 00.00.0000
12836 \labelwidthstring 00.00.0000
12845 layout Subsubsection
12849 \labelwidthstring 00.00.0000
12862 \labelwidthstring 00.00.0000
12871 layout Subparagraph
12875 \labelwidthstring 00.00.0000
12880 asterisk\InsetSpace ~
12889 \labelwidthstring 00.00.0000
12894 asterisk\InsetSpace ~
12903 \labelwidthstring 00.00.0000
12908 asterisk\InsetSpace ~
12917 \labelwidthstring 00.00.0000
12922 asterisk\InsetSpace ~
12931 \labelwidthstring 00.00.0000
12936 asterisk\InsetSpace ~
12941 layout Subsubsection*
12945 \labelwidthstring 00.00.0000
12950 asterisk\InsetSpace ~
12959 \labelwidthstring 00.00.0000
12964 asterisk\InsetSpace ~
12969 layout Subparagraph*
12973 \labelwidthstring 00.00.0000
12986 \labelwidthstring 00.00.0000
12995 layout Bibliography
12999 \labelwidthstring 00.00.0000
13012 \labelwidthstring 00.00.0000
13025 \labelwidthstring 00.00.0000
13038 \labelwidthstring 00.00.0000
13051 \labelwidthstring 00.00.0000
13064 \labelwidthstring 00.00.0000
13073 layout Rotatefoilhead
13077 \labelwidthstring 00.00.0000
13086 layout RightAddress
13090 \labelwidthstring 00.00.0000
13103 \labelwidthstring 00.00.0000
13116 \labelwidthstring 00.00.0000
13129 \labelwidthstring 00.00.0000
13141 \begin_layout Standard
13143 These ones are kept for backwards compatibility, but only make sense on
13148 \labelwidthstring 00.00.0000
13161 \labelwidthstring 00.00.0000
13170 layout Subsubsection*
13174 \labelwidthstring 00.00.0000
13186 \begin_layout Section
13191 \begin_layout Subsection
13199 \labelwidthstring 00.00.0000
13211 \labelwidthstring 00.00.0000
13223 \labelwidthstring 00.00.0000
13235 \labelwidthstring 00.00.0000
13247 \labelwidthstring 00.00.0000
13259 \labelwidthstring 00.00.0000
13271 \labelwidthstring 00.00.0000
13279 hyphenation-point-insert
13283 \labelwidthstring 00.00.0000
13295 \labelwidthstring 00.00.0000
13303 line-delete-forward
13307 \labelwidthstring 00.00.0000
13319 \labelwidthstring 00.00.0000
13331 \labelwidthstring 00.00.0000
13343 \labelwidthstring 00.00.0000
13355 \labelwidthstring 00.00.0000
13367 \labelwidthstring 00.00.0000
13377 \labelwidthstring 00.00.0000
13389 \labelwidthstring 00.00.0000
13401 \labelwidthstring 00.00.0000
13413 \labelwidthstring 00.00.0000
13425 \labelwidthstring 00.00.0000
13437 \labelwidthstring 00.00.0000
13449 \labelwidthstring 00.00.0000
13462 \labelwidthstring 00.00.0000
13475 \labelwidthstring 00.00.0000
13488 \labelwidthstring 00.00.0000
13501 \labelwidthstring 00.00.0000
13515 \labelwidthstring 00.00.0000
13528 \labelwidthstring 00.00.0000
13541 \labelwidthstring 00.00.0000
13554 \labelwidthstring 00.00.0000
13567 \labelwidthstring 00.00.0000
13581 \labelwidthstring 00.00.0000
13594 \labelwidthstring 00.00.0000
13607 \labelwidthstring 00.00.0000
13621 \labelwidthstring 00.00.0000
13635 \labelwidthstring 00.00.0000
13649 \labelwidthstring 00.00.0000
13663 \labelwidthstring 00.00.0000
13677 \labelwidthstring 00.00.0000
13691 \labelwidthstring 00.00.0000
13704 \labelwidthstring 00.00.0000
13717 \labelwidthstring 00.00.0000
13730 \labelwidthstring 00.00.0000
13739 menu-open Documents
13743 \labelwidthstring 00.00.0000
13756 \labelwidthstring 00.00.0000
13769 \labelwidthstring 00.00.0000
13782 \labelwidthstring 00.00.0000
13795 \labelwidthstring 00.00.0000
13808 \labelwidthstring 00.00.0000
13817 buffer-toggle-read-only
13821 \labelwidthstring 00.00.0000
13834 \labelwidthstring 00.00.0000
13847 \labelwidthstring 00.00.0000
13860 \labelwidthstring 00.00.0000
13872 \labelwidthstring 00.00.0000
13884 \labelwidthstring 00.00.0000
13896 \labelwidthstring 00.00.0000
13908 \labelwidthstring 00.00.0000
13920 \labelwidthstring 00.00.0000
13932 \labelwidthstring 00.00.0000
13944 \labelwidthstring 00.00.0000
13956 \labelwidthstring 00.00.0000
13968 \labelwidthstring 00.00.0000
13980 \labelwidthstring 00.00.0000
13992 \labelwidthstring 00.00.0000
14004 \labelwidthstring 00.00.0000
14016 \labelwidthstring 00.00.0000
14028 \labelwidthstring 00.00.0000
14036 word-delete-forward
14040 \labelwidthstring 00.00.0000
14048 word-delete-backward
14052 \labelwidthstring 00.00.0000
14064 \labelwidthstring 00.00.0000
14072 end-of-sentence-period-insert
14076 \labelwidthstring 00.00.0000
14084 protected-space-insert
14088 \labelwidthstring 00.00.0000
14100 \labelwidthstring 00.00.0000
14112 \labelwidthstring 00.00.0000
14124 \labelwidthstring 00.00.0000
14136 \labelwidthstring 00.00.0000
14148 \labelwidthstring 00.00.0000
14160 \labelwidthstring 00.00.0000
14168 buffer-begin-select
14172 \labelwidthstring 00.00.0000
14184 \labelwidthstring 00.00.0000
14192 paragraph-up-select
14196 \labelwidthstring 00.00.0000
14204 paragraph-down-select
14208 \labelwidthstring 00.00.0000
14216 word-backward-select
14220 \labelwidthstring 00.00.0000
14228 word-forward-select
14232 \labelwidthstring 00.00.0000
14244 \labelwidthstring 00.00.0000
14252 word-delete-forward
14256 \labelwidthstring 00.00.0000
14268 \labelwidthstring 00.00.0000
14280 \labelwidthstring 00.00.0000
14292 \labelwidthstring 00.00.0000
14304 \labelwidthstring 00.00.0000
14312 break-paragraph-keep-layout
14316 \labelwidthstring 00.00.0000
14325 \begin_layout Subsection
14333 \labelwidthstring 00.00.0000
14345 \labelwidthstring 00.00.0000
14357 \labelwidthstring 00.00.0000
14369 \labelwidthstring 00.00.0000
14381 \labelwidthstring 00.00.0000
14393 \labelwidthstring 00.00.0000
14405 \labelwidthstring 00.00.0000
14417 \labelwidthstring 00.00.0000
14429 \labelwidthstring 00.00.0000
14441 \labelwidthstring 00.00.0000
14453 \labelwidthstring 00.00.0000
14465 \labelwidthstring 00.00.0000
14477 \labelwidthstring 00.00.0000
14489 \labelwidthstring 00.00.0000
14501 \labelwidthstring 00.00.0000
14513 \labelwidthstring 00.00.0000
14525 \labelwidthstring 00.00.0000
14537 \labelwidthstring 00.00.0000
14549 \labelwidthstring 00.00.0000
14561 \labelwidthstring 00.00.0000
14573 \labelwidthstring 00.00.0000
14585 \labelwidthstring 00.00.0000
14597 \labelwidthstring 00.00.0000
14605 protected-space-insert
14609 \labelwidthstring 00.00.0000
14621 \labelwidthstring 00.00.0000
14633 \labelwidthstring 00.00.0000
14645 \labelwidthstring 00.00.0000
14653 buffer-new-template
14657 \labelwidthstring 00.00.0000
14669 \labelwidthstring 00.00.0000
14681 \labelwidthstring 00.00.0000
14693 \labelwidthstring 00.00.0000
14705 \labelwidthstring 00.00.0000
14717 \labelwidthstring 00.00.0000
14729 \labelwidthstring 00.00.0000
14741 \labelwidthstring 00.00.0000
14749 end-of-sentence-period-insert
14753 \labelwidthstring 00.00.0000
14765 \labelwidthstring 00.00.0000
14777 \labelwidthstring 00.00.0000
14785 hyphenation-point-insert
14789 \labelwidthstring 00.00.0000
14801 \labelwidthstring 00.00.0000
14809 protected-space-insert
14813 \labelwidthstring 00.00.0000
14825 \labelwidthstring 00.00.0000
14837 \labelwidthstring 00.00.0000
14849 \labelwidthstring 00.00.0000
14861 \labelwidthstring 00.00.0000
14873 \labelwidthstring 00.00.0000
14885 \labelwidthstring 00.00.0000
14897 \labelwidthstring 00.00.0000
14909 \labelwidthstring 00.00.0000
14921 \labelwidthstring 00.00.0000
14933 \labelwidthstring 00.00.0000
14945 \labelwidthstring 00.00.0000
14957 \labelwidthstring 00.00.0000
14969 \labelwidthstring 00.00.0000
14981 \labelwidthstring 00.00.0000
14993 \labelwidthstring 00.00.0000
15001 word-delete-forward
15005 \labelwidthstring 00.00.0000
15013 word-delete-backward
15017 \labelwidthstring 00.00.0000
15029 \labelwidthstring 00.00.0000
15041 \labelwidthstring 00.00.0000
15053 \labelwidthstring 00.00.0000
15065 \labelwidthstring 00.00.0000
15073 paragraph-down-select
15077 \labelwidthstring 00.00.0000
15089 \labelwidthstring 00.00.0000
15097 buffer-begin-select
15101 \labelwidthstring 00.00.0000
15109 word-backward-select
15113 \labelwidthstring 00.00.0000
15121 word-forward-select
15125 \labelwidthstring 00.00.0000
15133 paragraph-up-select
15137 \labelwidthstring 00.00.0000
15149 \labelwidthstring 00.00.0000
15157 break-paragraph-keep-layout
15161 \labelwidthstring 00.00.0000
15173 \labelwidthstring 00.00.0000
15185 \labelwidthstring 00.00.0000
15197 \labelwidthstring 00.00.0000
15209 \labelwidthstring 00.00.0000
15221 \labelwidthstring 00.00.0000
15231 \labelwidthstring 00.00.0000
15243 \labelwidthstring 00.00.0000
15255 \labelwidthstring 00.00.0000
15267 \labelwidthstring 00.00.0000
15279 \labelwidthstring 00.00.0000
15290 \begin_layout Subsection
15297 \begin_layout Standard
15299 These are LyX keyboard definitions for mathematics, similar to those of
15303 \begin_layout Standard
15305 The bindings file and the present documentation were prepared by Serge Winitzki
15306 with assistance from Jean-Marc Lasgouttes.
15307 Version 1.3, for LyX 1.2.x and 1.3.x.
15310 \begin_layout Standard
15312 These definitions make it a lot easier to type equations without using the
15313 mouse, especially for people familiar with Scientific Word.
15314 The standard LyX bindings such as
15325 \begin_layout Standard
15327 Tip: to find the "LyX bind name" for a key, look at the status bar after
15328 typing some non-existent key combination.
15330 to find how "Ctrl-&" is referenced, press Ctrl-S and then Ctrl-&: the status
15331 bar shows "C-s S-C-ampersand." (This does not work in LyX 1.3.0!)
15335 \labelwidthstring 00.00.0000
15345 -- Copy, cut, paste is as in Sciword,
15361 \labelwidthstring 00.00.0000
15371 -- Display equation toggle: type
15375 to insert a displayed formula (
15380 \begin_inset Quotes eld
15384 \begin_inset Quotes erd
15392 in a displayed formula to convert it back to an inline formula.
15396 \labelwidthstring 00.00.0000
15412 to insert a fraction (
15417 \begin_inset Quotes eld
15421 \begin_inset Quotes erd
15425 You can also select an expression and type
15429 to convert it to the numerator of a fraction.
15438 end of the denominator will delete the numerator and convert the denominator
15443 \labelwidthstring 00.00.0000
15456 \begin_inset Formula $\int$
15464 \begin_inset Quotes eld
15468 \begin_inset Quotes erd
15475 \labelwidthstring 00.00.0000
15483 line-delete-forward
15485 -- Emacs-like binding: delete forward of cursor to end of line.
15489 \labelwidthstring 00.00.0000
15499 -- A text/math toggle (
15504 \begin_inset Quotes eld
15508 \begin_inset Quotes erd
15511 ): switches to math in text mode, and also inserts roman text in math mode.
15521 \begin_inset Quotes eld
15525 \begin_inset Quotes erd
15532 \labelwidthstring 00.00.0000
15542 -- Add/remove numbering in a single equation.
15546 \labelwidthstring 00.00.0000
15556 -- Add/remove numbering at a line in equation arrays.
15559 \begin_layout Standard
15561 The above commands are toggles that control the numbering of equations (
15566 \begin_inset Quotes eld
15570 \begin_inset Quotes erd
15574 Note: when deleting a number in a labeled eqnarray, the label is not really
15575 removed (the TeX code becomes
15576 \begin_inset Quotes eld
15588 \begin_inset Quotes erd
15591 ) and this generates a (harmless) LaTeX warning.
15595 \labelwidthstring 00.00.0000
15605 -- Open a new document.
15610 \labelwidthstring 00.00.0000
15620 -- Insert a quote character " (
15625 \begin_inset Quotes eld
15629 \begin_inset Quotes erd
15634 \begin_inset Quotes eld
15638 \begin_inset Quotes erd
15641 double quote character that you get by default.
15645 \labelwidthstring 00.00.0000
15657 -- Square root sign
15658 \begin_inset Formula $\sqrt{x}$
15666 \begin_inset Quotes eld
15670 \begin_inset Quotes erd
15677 \labelwidthstring 00.00.0000
15690 \begin_inset Formula $\sqrt[n]{x}$
15697 \labelwidthstring 00.00.0000
15707 -- Another binding for a switch between the text and the math mode (
15712 \begin_inset Quotes eld
15716 \begin_inset Quotes erd
15720 Note that the roman text inserted in math mode is special.
15724 \labelwidthstring 00.00.0000
15738 the selected text (text mode only, use things like
15754 \labelwidthstring 00.00.0000
15764 -- W*ndows heritage.
15768 \labelwidthstring 00.00.0000
15778 -- Close the current document (again, a W*ndows heritage).
15782 \labelwidthstring 00.00.0000
15794 \labelwidthstring 00.00.0000
15806 \labelwidthstring 00.00.0000
15817 \begin_inset Quotes eld
15821 \begin_inset Quotes erd
15825 \begin_inset Quotes eld
15829 \begin_inset Quotes erd
15835 \begin_layout Standard
15837 Bracket delimiters: press
15841 -<bracket key> to insert a matching pair of delimiters.
15846 inserts a pair of parentheses
15847 \begin_inset Formula $\left[\right]$
15855 does the same thing.) It will switch to math mode if needed.
15856 The supported characters are ( [ { < |.
15857 It is the same to press the right or the left bracket.
15858 The corresponding delimiters are
15859 \begin_inset Formula $\left(\right)$
15863 \begin_inset Formula $\left[\right]$
15867 \begin_inset Formula $\left\{ \right\} $
15871 \begin_inset Formula $\left\langle \right\rangle $
15875 \begin_inset Formula $\left|\right|$
15880 \begin_inset Quotes eld
15884 \begin_inset Quotes erd
15887 and resize with their contents.
15888 Use Math Panel to get other or non-matching delimiters.
15889 Press backspace on the
15893 delimiter to remove both
15894 \begin_inset Quotes eld
15898 \begin_inset Quotes erd
15901 delimiters without removing their contents.
15905 \labelwidthstring 00.00.0000
15915 -- for convenience, pressing
15929 \labelwidthstring 00.00.0000
15941 \labelwidthstring 00.00.0000
15953 \labelwidthstring 00.00.0000
15965 \labelwidthstring 00.00.0000
15977 \labelwidthstring 00.00.0000
15989 \labelwidthstring 00.00.0000
15997 math-delim langle rangle
15999 -- angular delimiters
16000 \begin_inset Formula $\left\langle \right\rangle $
16003 , not to confuse with ordinary < > signs.
16007 \labelwidthstring 00.00.0000
16015 math-delim langle rangle
16018 \begin_layout Standard
16020 The bar bracket: on some keyboards (e.g.\InsetSpace ~
16021 some British ones), the bar character
16026 -something and on some wayward Unices to "brokenbar".
16027 So we define all of these keys as well.
16031 \labelwidthstring 00.00.0000
16043 \labelwidthstring 00.00.0000
16055 \labelwidthstring 00.00.0000
16067 \labelwidthstring 00.00.0000
16079 \labelwidthstring 00.00.0000
16090 \begin_layout Standard
16092 Accents are in most cases
16096 -<accent key>, e.g.\InsetSpace ~
16110 for tilde (you also need to press
16116 \begin_inset Quotes eld
16128 \begin_inset Quotes erd
16132 Some accents work only in math mode and others only in text mode.
16136 \labelwidthstring 00.00.0000
16146 -- overdot accent, \i \.{a}
16151 \labelwidthstring 00.00.0000
16164 \begin_inset Formula $\dot{a}$
16167 (math mode only -- in physics this denotes a first derivative).
16171 \labelwidthstring 00.00.0000
16183 -- Vector accent over math
16184 \begin_inset Formula $\overrightarrow{x}$
16191 \labelwidthstring 00.00.0000
16201 -- umlaut accent, ä (text mode only)
16205 \labelwidthstring 00.00.0000
16217 -- double dot accent,
16218 \begin_inset Formula $\ddot{a}$
16221 (math mode only -- in physics this denotes a second derivative).
16222 To get a triple dot in math mode, use
16230 \labelwidthstring 00.00.0000
16240 -- grave accent à (text mode only, use
16250 \labelwidthstring 00.00.0000
16260 -- tilde accent ã (text mode only, use
16270 \labelwidthstring 00.00.0000
16280 -- acute accent á (text mode only, use
16290 \labelwidthstring 00.00.0000
16300 -- circumflex (caret) accent â (text mode only, use
16309 \begin_layout Standard
16312 The new key S-F2 for creating a LaTeX file seems handy.
16316 \labelwidthstring 00.00.0000
16326 -- Save current document.
16330 \labelwidthstring 00.00.0000
16338 buffer-export latex
16340 -- Write a LaTeX file for the current document.
16344 \labelwidthstring 00.00.0000
16354 -- Find and replace dialog.
16358 \labelwidthstring 00.00.0000
16376 \labelwidthstring 00.00.0000
16390 to quit LyX is the W*ndows w*ndow manager's mnemonic.
16393 \begin_layout Standard
16403 are used to switch fonts.
16408 to switch back to the normal font.
16409 The non-default font switches
16417 all work as toggles.
16418 They also work on the whole word if you put the cursor in the middle of
16419 the word, or if you select some text.
16423 \labelwidthstring 00.00.0000
16433 -- stop using any special font
16437 \labelwidthstring 00.00.0000
16455 \labelwidthstring 00.00.0000
16473 \labelwidthstring 00.00.0000
16491 \labelwidthstring 00.00.0000
16506 (Used sometimes for people's names.)
16509 \begin_layout Standard
16516 \begin_inset Quotes eld
16520 \begin_inset Quotes erd
16527 key (useful e.g.\InsetSpace ~
16528 if the keyboard has no working
16535 \begin_layout Standard
16537 Here are some Sciword-inspired mnemonics for frequently used math symbols.
16538 Many symbols start with a
16547 cannot be itself bound to anything.
16551 \labelwidthstring 00.00.0000
16564 \begin_inset Quotes eld
16568 \begin_inset Quotes erd
16572 \begin_inset Formula $\prime$
16576 This is frequently unnecessary: in most cases the normal apostrophe works
16579 \begin_inset Formula $x'+2x=0$
16582 , but in some cases this would generate a double superscript error in LaTeX.
16584 \begin_inset Formula $x^{\prime2}$
16588 \begin_inset Formula $x$
16591 prime squared) must be entered with the prime character.
16595 \labelwidthstring 00.00.0000
16604 command-sequence math-superscript; math-insert
16608 -- Insert a prime as a superscript (see example above).
16612 \labelwidthstring 00.00.0000
16622 -- Insert an upper index.
16629 \labelwidthstring 00.00.0000
16639 -- Insert a lower index.
16646 \labelwidthstring 00.00.0000
16659 -- Partial derivative symbol
16660 \begin_inset Formula $\partial$
16667 \labelwidthstring 00.00.0000
16680 -- Summation symbol
16681 \begin_inset Formula $\sum$
16684 (not the same as the Greek letter uppercase Sigma
16685 \begin_inset Formula $\Sigma$
16688 because it can resize and allows smart upper/lower limits).
16692 \labelwidthstring 00.00.0000
16706 \begin_inset Formula $\prod$
16709 (not the same as the Greek letter uppercase Pi,
16710 \begin_inset Formula $\Pi$
16717 \labelwidthstring 00.00.0000
16731 \begin_inset Formula $\infty$
16738 \labelwidthstring 00.00.0000
16752 \begin_inset Formula $\times$
16759 \labelwidthstring 00.00.0000
16770 -- Insert a stacked array
16771 \begin_inset Formula $\begin{array}{c}
16773 \\\end{array}\end{array}$
16777 (Frequently useful in formulae.)
16781 \labelwidthstring 00.00.0000
16793 \begin_inset Formula $\times$
16797 \begin_inset Formula $\begin{array}{ccc}
16802 (Then you can modify its size using the
16804 Edit\SpecialChar \menuseparator
16811 \labelwidthstring 00.00.0000
16825 \begin_inset Quotes eld
16829 \begin_inset Quotes erd
16833 \begin_inset Formula $\dagger$
16840 \labelwidthstring 00.00.0000
16854 \begin_inset Quotes eld
16858 \begin_inset Quotes erd
16862 \begin_inset Formula $\equiv$
16869 \labelwidthstring 00.00.0000
16882 \begin_inset Quotes eld
16885 Approximate equality
16886 \begin_inset Quotes erd
16890 \begin_inset Formula $\approx$
16897 \labelwidthstring 00.00.0000
16910 \begin_inset Quotes eld
16914 \begin_inset Quotes erd
16918 \begin_inset Formula $\sim$
16925 \labelwidthstring 00.00.0000
16938 \begin_inset Formula $\rightarrow$
16942 \begin_inset Formula $\lim_{x\rightarrow0}$
16949 \labelwidthstring 00.00.0000
16962 \begin_inset Formula $\leq$
16969 \labelwidthstring 00.00.0000
16981 -- Greater-or-equal
16982 \begin_inset Formula $\geq$
16989 \labelwidthstring 00.00.0000
17003 \begin_inset Quotes eld
17007 \begin_inset Quotes erd
17011 \begin_inset Formula $\ll$
17014 (useful in physics)
17018 \labelwidthstring 00.00.0000
17032 \begin_inset Quotes eld
17036 \begin_inset Quotes erd
17040 \begin_inset Formula $\gg$
17046 \begin_layout Subsection
17048 Standard math bindings
17052 \labelwidthstring 00.00.0000
17067 \labelwidthstring 00.00.0000
17080 \labelwidthstring 00.00.0000
17093 \labelwidthstring 00.00.0000
17108 \labelwidthstring 00.00.0000
17121 \labelwidthstring 00.00.0000
17134 \labelwidthstring 00.00.0000
17149 \labelwidthstring 00.00.0000
17162 \labelwidthstring 00.00.0000
17175 \labelwidthstring 00.00.0000
17188 \labelwidthstring 00.00.0000
17203 \labelwidthstring 00.00.0000
17218 \labelwidthstring 00.00.0000
17233 \labelwidthstring 00.00.0000
17248 \labelwidthstring 00.00.0000
17263 \labelwidthstring 00.00.0000
17278 \labelwidthstring 00.00.0000
17291 \labelwidthstring 00.00.0000
17306 \labelwidthstring 00.00.0000
17319 \labelwidthstring 00.00.0000
17332 \labelwidthstring 00.00.0000
17345 \labelwidthstring 00.00.0000
17358 \labelwidthstring 00.00.0000
17373 \labelwidthstring 00.00.0000
17386 \labelwidthstring 00.00.0000
17399 \labelwidthstring 00.00.0000
17412 \labelwidthstring 00.00.0000
17421 math-delim langle rangle
17425 \labelwidthstring 00.00.0000
17434 math-delim rangle langle
17438 \labelwidthstring 00.00.0000
17451 \labelwidthstring 00.00.0000
17466 \labelwidthstring 00.00.0000
17480 \begin_layout Subsection
17486 \labelwidthstring 00.00.0000
17497 \labelwidthstring 00.00.0000
17508 \labelwidthstring 00.00.0000
17519 \labelwidthstring 00.00.0000
17530 \labelwidthstring 00.00.0000