1 #LyX 1.6.0svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that the User's Guide prints
10 % out as advertised. If you mess with this preamble,
11 % parts of the User's Guide may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}{\usepackage{lmodern}}{%
21 \usepackage[scaled=0.92]{helvet}
23 \usepackage{courier} }
25 % link all cross references and URLs in pdf output
26 \usepackage[colorlinks=true, bookmarks, bookmarksnumbered,
27 linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,
28 pdfpagelayout=OneColumn, pdfnewwindow=true,
29 pdfstartview=XYZ, plainpages=false, pdfpagelabels,
30 pdfauthor={LyX Team}, pdftex,
31 pdftitle={Customizing LyX: Features for the Advanced User},pdfsubject={LyX-documentation Customization},
32 pdfkeywords={LyX, documentation}
35 \else % if dvi or ps is produced
37 % link all cross references and URLs in dvi output
38 \usepackage[ps2pdf]{hyperref}
40 \fi % end if pdflatex is used
42 % the pages of the TOC are numbered roman
43 % and a pdf-bookmark for the TOC is added
45 \let\myTOC\tableofcontents
46 \renewcommand\tableofcontents{%
47 \pdfbookmark[1]{Contents}{}
50 \pagenumbering{arabic} }
52 % redefine the \LyX macro for PDF bookmarks
53 \def\LyX{\texorpdfstring{%
54 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
57 % used for multi-column text
64 \inputencoding default
67 \font_typewriter default
68 \font_default_family default
74 \paperfontsize default
83 \paperorientation portrait
86 \paragraph_separation indent
88 \quotes_language english
91 \paperpagestyle headings
92 \tracking_changes false
101 Customizing LyX: Features for the Advanced User
109 \begin_layout Standard
111 Principal maintainer of this file is
116 If you have comments or error corrections, please send them to the LyX
117 Documentation mailing list, <lyx-docs@lists.lyx.org>.
125 \begin_layout Standard
126 \begin_inset CommandInset toc
127 LatexCommand tableofcontents
134 \begin_layout Chapter
138 \begin_layout Standard
139 This manual covers the customization features present in LyX.
140 In it, we discuss issues like keyboard shortcuts, screen previewing options,
141 printer options, sending commands to LyX via the LyX Server, internationalizati
142 on, installing new LaTeX classes and LyX layouts, etc.
143 We can't possibly hope to touch on everything you can change---our developers
144 add new features faster than we can document them---but we will explain
145 the most common customizations and hopefully point you in the right direction
146 for some of the more obscure ones.
149 \begin_layout Chapter
150 LyX configuration files
153 \begin_layout Standard
154 \begin_inset CommandInset label
160 This chapter aims to help you to find your way through the LyX configuration
162 Before continuing to read this chapter, you should find out where your
163 LyX library directory is by using
168 elp\SpecialChar \menuseparator
176 This directory is the place where LyX places its system-wide configuration
177 files, and we will simply name it
181 in the remainder of this document.
185 \begin_layout Section
193 \begin_layout Standard
198 and its sub-directories contain a number of files and that can be used
199 to customise LyX's behaviour.
200 You can change many of these files from within LyX itself through the
205 ools\SpecialChar \menuseparator
213 Most customization that you might want to do to LyX is possible through
215 However, many other inner aspects of LyX can be customized by modifying
221 They fall in different categories, described in the following subsections.
224 \begin_layout Subsection
225 Automatically generated files
228 \begin_layout Standard
229 These files are generated when you configure LyX.
230 They contain various default values that are guessed by inspection.
231 In general, it is not a good idea to modify them, since they might be overwritt
236 \labelwidthstring 00.00.0000
243 contains defaults for various commands.
247 \labelwidthstring 00.00.0000
254 contains the list of packages that have been recognized by LyX.
255 It is currently unused by the LyX program itself, but the information extracted
256 , and more, is made available with
261 elp\SpecialChar \menuseparator
273 \labelwidthstring 00.00.0000
280 is the list of text classes that have been found in your
284 directory, along with the associated LaTeX document class and their description.
288 \labelwidthstring 00.00.0000
293 is automatically generated during configuration from the file
300 \begin_layout Subsection
305 \labelwidthstring 00.00.0000
312 this directory contains files with the extension
316 that define the keybindings used in LyX (see section\InsetSpace ~
318 \begin_inset CommandInset ref
320 reference "sec:bindings"
325 If there exists an internationalized version of the bind file named
329 , that will be used first.
330 See Chapter\InsetSpace ~
332 \begin_inset CommandInset ref
334 reference "chap:i18n"
339 \begin_inset CommandInset ref
341 reference "sec:bindings"
349 \labelwidthstring 00.00.0000
356 contains graphics files that can be included in documents.
361 \labelwidthstring 00.00.0000
368 contains LyX documentation files (including the one you are currently reading).
373 deserves special attention, as noted above.
374 If there exists an internationalized version of the help-document with
379 prepended to the name, that will be used first.
380 See Chapter\InsetSpace ~
382 \begin_inset CommandInset ref
384 reference "chap:i18n"
392 \labelwidthstring 00.00.0000
399 contains example files that explain how to use some features.
400 In the file browser, press the
408 \labelwidthstring 00.00.0000
413 contains image files that are used by the
418 In addition, it also contains the individual icons used in the toolbar
419 and the banners that can be shown when LyX is launched.
423 \labelwidthstring 00.00.0000
430 contains keyboard keymapping files.
431 See Chapter\InsetSpace ~
433 \begin_inset CommandInset ref
435 reference "sec:keymap"
443 \labelwidthstring 00.00.0000
450 contains the text class files described in Chapter\InsetSpace ~
452 \begin_inset CommandInset ref
454 reference "chap:textclass"
462 \labelwidthstring 00.00.0000
467 contains some files that demonstrate the capabilities of the
469 External\InsetSpace ~
476 \labelwidthstring 00.00.0000
481 contains the standard LyX template files described in Chapter\InsetSpace ~
483 \begin_inset CommandInset ref
485 reference "sec:templates"
493 \labelwidthstring 00.00.0000
498 contains some LaTeX cls files distributed with LyX.
502 \labelwidthstring 00.00.0000
507 contains files with the extension
511 that define the user interface to LyX.
512 That is, the files define which items appear in which menus and the items
513 appearing on the toolbar.
514 See Chapter\InsetSpace ~
516 \begin_inset CommandInset ref
525 \begin_layout Subsection
526 Files you don't want to modify
529 \begin_layout Standard
530 These files are used internally by LyX and you generally do not need to
531 modify them unless you are a developer.
535 \labelwidthstring 00.00.0000
542 this file contains the list of LyX developers.
543 The contents are displayed with the menu entry
548 elp\SpecialChar \menuseparator
556 \labelwidthstring 00.00.0000
563 this is a LaTeX script used during the configuration process.
568 \labelwidthstring 00.00.0000
575 this is the script that is used to re-configure LyX.
576 It creates configuration files in the directory it was run from.
579 \begin_layout Subsection
580 Other files needing a line or two...
584 \labelwidthstring 00.00.0000
589 this contains tables describing how different character encodings can be
594 \labelwidthstring 00.00.0000
599 this file contains the templates available to the new
601 External\InsetSpace ~
608 \labelwidthstring 00.00.0000
613 this file contains a list of all the languages currently supported by LyX.
616 \begin_layout Section
617 Your local configuration directory
620 \begin_layout Standard
621 Even if you are using LyX as an unprivileged user, you might want to change
622 LyX configuration for your own use.
627 directory contains all your personal configuration files.
628 This is the directory described as
629 \begin_inset Quotes eld
633 \begin_inset Quotes erd
641 elp\SpecialChar \menuseparator
646 This directory is used as a mirror of
650 , which means that every file in
654 is a replacement for the corresponding file in
659 Any configuration file described in the above sections can be placed either
660 in the system-wide directory, in which case it will affect all users, or
661 in your local directory for your own use.
664 \begin_layout Standard
665 To make things clearer, let's provide a few examples:
668 \begin_layout Itemize
669 The preferences set in the
674 ools\SpecialChar \menuseparator
681 dialog are saved to a file
692 \begin_layout Itemize
693 When you reconfigure using
698 ools\SpecialChar \menuseparator
709 and the resulting files are written in your local configuration directory
710 (see section\InsetSpace ~
712 \begin_inset CommandInset ref
714 reference "sec:autodetected"
718 to have a list of the
722 settings affected by this section).
723 This means that any additional text class file that you might have added
728 will be added to the list of classes in the
733 ayout\SpecialChar \menuseparator
743 \begin_layout Itemize
744 Similarly, if you have installed some LaTeX document classes in your home
745 directory, that LaTeX can find with your
749 path, they will show up in your list of text classes.
753 \begin_layout Standard
754 as long as LyX or yourself have a
758 file for it, of course.
766 \begin_layout Itemize
767 If you get some updated documentation from LyX ftp site and cannot install
768 it because you do not have sysadmin rights on your system, you can just
783 \begin_layout Section
784 Running LyX with multiple configurations
787 \begin_layout Standard
788 The configuration freedom of the local configuration directory may not suffice
789 if you want to have more than one configuration at your disposal.
790 For example, you may want to be use different key bindings or printer settings
792 You can achieve this by having several such directories.
793 You then specify which directory to use at run-time.
796 \begin_layout Standard
797 Invoking LyX with the command line switch
805 instructs the program to read the configuration from that directory, and
806 not from the default directory (you can determine the default directory
807 by running LyX without this switch as described above).
808 If this directory does not exist, LyX offers to create it for you, just
809 like it does for the default directory on the first time you run the program.
810 You can modify the configuration options in this additional
814 exactly as you would for the default directory.
815 These directories are completely independent (but read on).
816 Note that setting the environment variable
820 to some value has exactly the same effect
825 \begin_layout Standard
826 Having several configurations also requires more maintenance: if you want
827 to add a new layout to
831 which you want available from all your configurations, you must add it
832 to each directory separately.
833 You can avoid this with the following trick: after LyX creates the additional
834 directory, most of the subdirectories (see above) are empty.
835 If you want the new configuration to mirror an existing one, replace the
836 empty subdirectory with a symbolic link to the matching subdirectory in
837 the existing configuration.
844 subirectory, however, since it contains a file written by the configuration
845 script (also accessible through
850 ools\SpecialChar \menuseparator
856 \begin_inset CommandInset ref
858 reference "sec:autodetected"
864 which is configuration-specific.
867 \begin_layout Chapter
875 \begin_layout Section
876 Using the dialog for the first time
879 \begin_layout Standard
884 file will contain only changes that you have made to the default behaviour,
885 some of which is hard-coded into LyX and some of which is contained in
888 LyXDir/lyxrc.defaults
891 Note that in both files lines beginning with a
892 \begin_inset Quotes eld
900 \begin_inset Quotes erd
903 are just comments and not interpreted.
904 However, only system administrators should edit
914 ools\SpecialChar \menuseparator
921 dialog to create and modify their own
928 \begin_layout Standard
934 ools\SpecialChar \menuseparator
941 dialog will be largely self-explanatory.
942 Almost all the commands have an associated comment, so you shouldn't have
943 too much trouble modifying it to taste.
944 Before we highlight a few of the more important commands below, however,
949 ing some of your changes (e.g., screen fonts) will have an instant effect.
951 changing the bind file) will not.
952 If nothing appears to have changed, just
956 the changes and restart LyX.
959 \begin_layout Section
963 \begin_layout Standard
964 The font used to display your documents on the LyX screen is very important,
965 since you'll be reading all your documents with this font.
966 Therefore it is important that the font is as readable and good-looking
968 The LyX team tried to provide the best possible default font for you, but
969 since practically all X11 systems are different, it's likely that the default
970 fonts will be sub-optimal on your system.
971 Fortunately, you can do something about this.
972 Before we explain how to do this, you should learn a bit more about fonts
973 so that you are better prepared for choosing your fonts, because it is
974 a trade-off that is specific to your preferences and the capabilities of
978 \begin_layout Standard
979 Notice that this section only deals with the fonts on the
983 inside the LyX window.
984 The fonts that appear on the
992 are independent from these fonts, and are determined by the document class.
997 to learn how to change the font of the printed version of your document.
1000 \begin_layout Standard
1001 Basically, screen fonts come in two different kinds: scalable outline fonts
1002 and non-scalable bitmap fonts.
1003 This distinction seems a bit arbitrary, since non-scalable fonts are actually
1004 scalable in most modern font renderers.
1005 The difference lies in the
1009 of the scaling, and the
1014 The most important decision is thus whether you should use non-scalable
1015 bitmap fonts or scalable outline fonts.
1018 \begin_layout Standard
1019 The scalable fonts are built from
1023 of the single glyphs (i.e.
1024 characters) in the font.
1025 This means that each glyph is defined using mathematical curves that are
1026 well suited for scaling to any requested size.
1027 This mathematical definition is interpreted by the font renderer and turned
1028 into a small picture composed of pixels according to which size and glyph,
1029 the programmer requests.
1030 This means that scalable fonts will look pretty good in all sizes.
1031 Well, almost all sizes.
1032 Since scalable fonts are defined in an abstract way, it can be hard to
1033 provide a good rendering at small sizes, where each pixel has to be very
1034 carefully computed to provide a good image.
1035 Technically it is possible to do this from the mathematical definition,
1036 but in order to keep the rendering reasonably fast, tradeoffs have to be
1037 made, and the result is that scalable fonts can be difficult to read at
1041 \begin_layout Standard
1042 Bitmap fonts on the other hand, are defined by bitmap graphics from the
1043 start, so they will look good at all the sizes they are meant for.
1044 However, they don't scale well, because in order to scale a glyph, each
1045 pixel is enlarged into several pixels.
1046 It is the same effect that happens if you try to enlarge a picture in
1050 or any other picture manipulation program.
1051 In order to relieve this effect, bitmap fonts are typically provided in
1052 several fixed sizes typically from around 8 pixels high up to 34 pixels
1053 or so high in steps according to what is believed to be useful.
1054 The advantage of bitmap fonts is that no complicated computations are necessary
1055 to display each glyph, so bitmap fonts are thus faster displayed than scalable
1057 The disadvantage is that sizes that don't exists as fixed versions have
1058 to be scaled by doubling pixels, and thus look bad.
1061 \begin_layout Standard
1062 The net result of all this, is that bitmap fonts are generally best for
1063 the small sizes, where they are available, while scalable fonts are generally
1064 best for large sizes.
1065 The logical conclusion would thus be to use bitmap fonts for the small
1066 sizes, and scalable fonts for the large sizes.
1067 Unfortunately, this is not a good idea, since bitmap fonts and scalable
1068 fonts are not designed to be used together, so the overall look of such
1069 a scheme would be bad.
1070 The best you can do is thus to try both schemes and decide for yourself
1074 \begin_layout Standard
1075 By default, LyX uses non-scalable bitmap fonts (when using the XForms frontend).
1080 is used, for sans serif fonts,
1088 is used as the monospaced/typewriter font.
1091 \begin_layout Standard
1092 In the following, we will describe what to do if the text does not look
1094 We'll start with the most important parameters: DPI and font zoom.
1097 \begin_layout Subsection
1098 DPI setting and Font Zoom
1101 \begin_layout Standard
1102 LyX automatically tries to scale the fonts to look as close as the paper
1103 output size as possible, except for the so-called font zoom factor.
1106 \begin_layout Standard
1107 In order for this to work on all systems, it relies on the screen DPI (dots
1108 per inch) setting to be correct.
1109 The DPI setting for your system is autodetected by LyX using the information
1110 the X server can provide.
1111 You can check what LyX autodetects the DPI setting to, by running LyX as
1119 \begin_layout Standard
1120 On many systems, X is not set up correctly, so you should check that it
1123 \begin_inset Quotes eld
1131 \begin_inset Quotes erd
1134 and write down what the DPI is for the resolution you use (this will be
1135 close to the value LyX detects).
1136 It is the number mentioned as
1137 \begin_inset Quotes eld
1141 \begin_inset Quotes erd
1145 Also write down the number of pixels you have in the width (the first number
1147 \begin_inset Quotes eld
1151 \begin_inset Quotes erd
1157 \begin_layout Standard
1158 Then get the good old ruler out of the closet, and measure the width of
1159 the visible screen-image on your monitor.
1160 Convert this measurement to inches if you used a centimeter ruler by dividing
1162 Now you can determine the correct DPI setting for your screen by dividing
1163 the number of pixels in the width by the width of the screen-image on the
1165 If this number is more than, say, 5 DPI from the detected value, you should
1166 either fix the X setup, or at least tell LyX that the DPI is different
1167 than the detected value.
1170 \begin_layout Standard
1171 If you can't fix the X setup (which of course is best since other programs
1172 than LyX will benefit from this as well), you can tell LyX the correct
1180 \begin_layout Standard
1181 If the text is too small or too big for your taste, you should fiddle with
1182 the font zoom setting.
1183 This setting is used to scale the point size of the text.
1184 If your DPI setting is correct, and the font zoom setting is set to 100,
1185 this means that LyX will try to display the text exactly the same size
1186 as it will appear on the paper-output.
1187 If you set the zoom factor to 200, the text will try to be 2 times as big
1189 Of course, this will only happen if LyX can find a font that has the appropriat
1190 e size, which you can't count on.
1191 Since LyX is a WYSIWYM system anyways, this limitation isn't much of an
1195 \begin_layout Standard
1196 The default font zoom setting is 150, since a monitor is typically wider
1197 than a piece of paper, but you should try to fiddle with it through the
1211 dialog to find a size that you like.
1212 When you've found a setting that seems to work nicely for you (tip: use
1220 button to keep the dialog open while you experiment), you can make this
1221 setting the default by using the
1231 \begin_layout Standard
1232 While it is often possible to find a suitable size for the text on the screen,
1233 this doesn't necessarily mean that the fonts are the best ones available
1235 In order to help you get the most out of your system, you can use the font
1236 definition commands to fine-tune the look of the text in greater detail
1240 \begin_layout Subsection
1241 Font definition commands
1244 \begin_layout Standard
1245 As mentioned, LyX uses non-scalable bitmap fonts by default with the XForms
1251 is used, for sans serif fonts,
1259 is used as the monospaced/typewriter font.
1262 \begin_layout Standard
1263 You can change all of these from within the
1268 The number of fonts that are available on different systems vary, but the
1273 should be available everywhere.
1274 Use that program to find candidate fonts.
1275 When you've found a font that you like, try to insert the first two elements
1277 \begin_inset Quotes eld
1281 \begin_inset Quotes erd
1285 \begin_inset Quotes eld
1289 \begin_inset Quotes erd
1296 ) in the appropriate field in the
1308 LyX will then reformat your document using the new font, and if you like
1309 the font, you should
1317 One place to start for a new font is to see if the scalable font
1318 \begin_inset Quotes eld
1322 \begin_inset Quotes erd
1326 Tip: You can see whether a font is a bitmap font or a scalable font by
1328 \begin_inset Quotes eld
1332 \begin_inset Quotes erd
1336 \begin_inset Quotes eld
1340 \begin_inset Quotes erd
1348 If the value 0 is available, the font is scalable.
1349 If the value 0 isn't available, the font is a bitmap font.
1352 \begin_layout Standard
1353 Before you go about scrapping a bitmap font because the larger sizes look
1355 \begin_inset Quotes eld
1359 \begin_inset Quotes erd
1362 , you should toggle the
1363 \begin_inset Quotes eld
1367 \begin_inset Quotes erd
1371 This is only useful if you use bitmap fonts, because only these don't scale
1373 If you define this flag, LyX will only use the fixed font sizes that are
1374 available, and this guarantees that all bitmap fonts look well.
1375 (You can see which individual font sizes are available with the
1384 .) However, the prize is that the difference between the size of the fonts
1385 on screen and the size of fonts on paper will be larger because LyX will
1386 have to be satisfied with the closest available size, and not try to scale
1388 Also, you can risk that some logically different sizes, such as
1396 , will be mapped to the same screen font, making it hard for you to see
1397 the difference on screen.
1398 We've decided not to use scalable fonts by default because of these artifacts,
1399 but since LyX is a WYSIWYM system, many people like to use the flag anyways,
1400 well-knowing that the font size on the screen can't be trusted.
1401 But remember that this flag only makes a difference when you use bitmap
1403 Scalable fonts won't be affected for reasons you should understand by now.
1406 \begin_layout Standard
1407 One final note regarding this flag: you should know that there is nothing
1408 wrong with using bitmap and scalable fonts at the same time for different
1410 For instance, it's common to use the scalable
1411 \begin_inset Quotes eld
1415 \begin_inset Quotes erd
1418 for the serif text together with a bitmap version of
1419 \begin_inset Quotes eld
1423 \begin_inset Quotes erd
1427 And you can safely select the
1428 \begin_inset Quotes eld
1432 \begin_inset Quotes erd
1435 button without worries: It will only apply to the Helvetica font.
1438 \begin_layout Standard
1439 Sometimes the artifacts introduced by use of the flag can be relieved by
1440 using the fine-detail screen font sizes which defines which point sizes
1441 the different logical font sizes correspond to.
1446 to see exactly what concrete fonts the logical sizes map to, and try adjusting
1447 the corresponding entries in the
1451 dialog until you've managed to hit the nail and get the fonts you want.
1452 This can be hard to do, because LyX uses the DPI setting and the font zoom
1453 settings to calculate which exact screen font size to ask the X server
1454 for, thus obfuscating the mapping.
1455 If you can't make it by trial-and-error, you can make the process more
1456 transparent if you set both the DPI setting and font zoom settings to 100---eve
1457 n when this is known to be wrong.
1458 This will of course make your scalable fonts look weird, so use with care.
1461 \begin_layout Subsection
1465 \begin_layout Standard
1466 By default, LyX will use fonts meant to write Western European text, including
1467 all kinds of English.
1468 This is defined through the so-called
1477 If you want to use LyX to write for instance Eastern European text, Cyrillic
1478 or any other language not covered by the ISO-8859-1 font encoding, you
1479 can define a different one with the encoding setting.
1480 This requires you to have special fonts installed.
1485 to see whether this is the case: check the
1486 \begin_inset Quotes eld
1490 \begin_inset Quotes erd
1494 \begin_inset Quotes eld
1498 \begin_inset Quotes erd
1501 fields for ISO-8859-X values different from ISO-8859-1, and search for
1502 one that contains the national characters of your language.
1503 If you find any, enter this encoding in the dialog.
1504 If not, go searching the Web for appropriate fonts.
1505 For the Qt frontend, it's recommended you use an iso646 font set.
1508 \begin_layout Standard
1509 When you've set LyX up to use a different font encoding, you should also
1510 consider changing the font used by dialog windows in LyX.
1517 dialog will not be understandable unless you tell LyX to use a different
1519 By default the menu font is set to
1521 -*-helvetica-medium-r
1523 , but often Helvetica is not available in the font encoding you need, so
1524 the dialog allows this to be changed.
1527 \begin_layout Standard
1528 As you can see, there are quite a few options that can be used to fine tune
1529 the look of your fonts.
1530 This should not scare you from fiddling with the settings, because after
1531 all, you will hopefully be using LyX for many hours in the future.
1532 And contrary to real WYSIWYG word processors where you are tied to using
1533 fonts that have to look good both on paper and on screen, LyX gives you
1534 the possibility of using fonts that are designed to look good on the screen
1535 while using a different set of fonts to look good on paper.
1538 \begin_layout Section
1540 \begin_inset CommandInset label
1549 \begin_layout Standard
1550 Bindings are used to, well, bind a function to a key.
1551 Several prepackaged binding files are available: a CUA set of bindings
1552 (familiar as the typical set of PC and CDE set of keyboard shortcuts),
1553 an Emacs set of bindings, for those of us who follow the One True Way and
1554 refuse to lower our standards,
1558 \begin_layout Standard
1559 I'm kidding here, of course!
1564 as well as specialty bindings (broadway and hollywood) and other languages
1565 (French, German, etc.).
1568 \begin_layout Standard
1569 If, however, you'd like to customise the keybindings to your own exacting
1570 tastes, then copy the best-fit file in
1579 Don't forget to load this new file into LyX using the
1584 (For the moment you'll have to restart LyX for these changes to take effect.)
1587 \begin_layout Standard
1588 LyX supports internationalization of the user interface (see Chapter\InsetSpace ~
1590 \begin_inset CommandInset ref
1592 reference "chap:i18n"
1601 is set, with the environment variable
1605 , LyX will try to use bindfiles by prepending
1610 For example, you can put a translated copy of some standard bind file in
1615 directory, and LyX will use it automatically.
1618 \begin_layout Standard
1623 files is straightforward:
1626 \begin_layout Standard
1631 bind <key combination> <lyx-function>
1634 \begin_layout Standard
1635 Both key combination and lyx-function (including any arguments) must be
1636 enclosed in "double quotes".
1637 All the LyX functions are listed in the
1644 \begin_layout Section
1646 \begin_inset CommandInset label
1655 \begin_layout Standard
1656 The appearance of both the menu and toolbar may both be changed using the
1671 For the moment, only one file exists,
1675 , but feel free to experiment.
1676 Just copy the file to the
1680 directory and play! Note that, for the moment, you'll have to restart LyX
1681 for these changes to take effect.
1684 \begin_layout Standard
1689 files is straightforward: have a look at
1702 entries must be ended with an explicit
1727 s and in the case of the
1728 \begin_inset Quotes eld
1732 \begin_inset Quotes erd
1740 One small word of warning.
1745 s may be inserted in a
1753 , but they are defined as
1764 \begin_layout Section
1765 \begin_inset CommandInset label
1767 name "sec:converters-etc"
1771 Converters, Formats, and Copiers
1774 \begin_layout Standard
1775 LyX has a powerful mechanism to convert to and from any file format using
1780 \begin_layout Subsection
1784 \begin_layout Standard
1785 The first step is to define your file formats if they are not already defined.
1788 Tools\SpecialChar \menuseparator
1789 Preferences:Converters
1792 Enter a new format name; a new GUI name (used in e.\InsetSpace \thinspace{}
1802 menus); and a file extension.
1807 \begin_layout Standard
1812 option tells LyX that a format is suitable for document export.
1813 If this is is set and if a suitable conversion route exists, the format
1816 File\SpecialChar \menuseparator
1820 The format will also appear in the
1824 menu if it has a specified viewer.
1825 Pure image formats, e.\InsetSpace \thinspace{}
1831 , should not use this option.
1832 Formats that can both represent vector graphics and documents like e.\InsetSpace \thinspace{}
1841 \begin_layout Standard
1844 Vector graphics format
1846 tells LyX that a format can contain vector graphics.
1847 This information is used to determine the target format of included graphics
1853 Included graphics may need to be converted to either
1869 cannot handle other image formats.
1870 If an included graphic is not already in
1882 format, it is converted to
1886 if the vector format option is set, and otherwise to
1893 \begin_layout Standard
1894 A Format can have a Viewer and Editor program associated with it.
1895 For example, you might want to use
1899 to view PostScript files.
1900 You can enter the program call and its options to the corresponding fields.
1901 For the call you can use the four variable listed in the next section.
1902 The viewer is launched when you view an image in LyX or use the
1907 If the operating system has a default viewer associated to a format, this
1908 viewer is used instead of the one defined here when you enter in the Viewer
1910 \begin_inset Quotes eld
1918 \begin_inset Quotes erd
1922 The editor is for example launched when you press the
1937 \begin_layout Subsection
1941 \begin_layout Standard
1942 Each format can have a Copier associated with it.
1943 These are defined in the
1945 Tools\SpecialChar \menuseparator
1949 Since all conversions from one format to another take place in LyX's temporary
1950 directory, it is sometimes necessary to modify a file before copying it
1951 to the temporary directory in order that the conversion may be performed.
1955 \begin_layout Standard
1956 For example, the file may refer to other files---images, for example---using
1957 relative filenames, and these may become invalid when the file is copied
1958 to the temporary directory.
1963 This is done by the Copier: It copies a file to (or from) the temporary
1964 directory and may modify it in the process.
1967 \begin_layout Standard
1968 Copiers may also be used for other purposes.
1969 For example, if appropriate converters are found, LyX will automatically
1970 install copiers for the
1980 When these formats are exported, the copier sees that not just the main
1981 HTML file but various associated files (style files, images, etc.) are also
1983 All these files are written to a subdirectory of the directory in which
1984 the original LyX file was found.
1988 \begin_layout Standard
1989 This copier can be customized.
1991 \begin_inset Quotes eld
1995 \begin_inset Quotes erd
1998 argument takes a comma-separated list of extensions to be copied; if it
1999 is omitted, all files will be copied.
2001 \begin_inset Quotes eld
2005 \begin_inset Quotes erd
2008 argument determines the extension added to the generated directory.
2010 \begin_inset Quotes eld
2018 \begin_inset Quotes erd
2021 , so HTML generated from
2023 /path/to/filename.lyx
2027 /path/to/filename.html.LyXconv
2038 \begin_layout Standard
2039 The definitions of the copiers may use four variables:
2043 \labelwidthstring 00.00.0000
2044 $$s The LyX system directory (e.\InsetSpace \thinspace{}
2054 \labelwidthstring 00.00.0000
2059 \labelwidthstring 00.00.0000
2064 \labelwidthstring 00.00.0000
2065 $$l The `LaTeX name'
2068 \begin_layout Standard
2069 The latter is to be given in a form suitable for inclusion in a LaTeX's
2076 command and is relevant only when exporting files suitable for such inclusion.
2079 \begin_layout Standard
2080 Copiers can be used to do almost anything with output files.
2081 For example, suppose you want generated pdf files to be copied to a special
2083 \begin_inset Flex CharStyle:Code
2086 \begin_layout Standard
2093 Then you could write a shell script such as this one:
2096 \begin_layout Standard
2097 \begin_inset listings
2101 \begin_layout Standard
2105 \begin_layout Standard
2109 \begin_layout Standard
2110 TOFILE=`basename $2`
2113 \begin_layout Standard
2114 cp $FROMFILE /home/you/pdf/$TOFILE
2119 Save that in your local LyX directory---say,
2120 \begin_inset Flex CharStyle:Code
2123 \begin_layout Standard
2124 /home/you/.lyx/scripts/pdfcopier.sh
2129 ---and make it executable, if you need to do so on your platform.
2132 Tools\SpecialChar \menuseparator
2139 format---or one of the other pdf formats---and enter
2140 \begin_inset Flex CharStyle:Code
2143 \begin_layout Standard
2144 pdfcopier.sh $$i $$o
2157 \begin_layout Subsection
2161 \begin_layout Standard
2162 To define a new converter, select an existing one, select a different format
2168 and\InsetSpace \thinspace{}
2169 /\InsetSpace \thinspace{}
2175 drop-down list, modify the
2179 field, and press the
2186 \begin_layout Standard
2187 You do not have to define converters between all the formats between which
2188 you want to convert.
2189 For example, you will note that there is no `LyX to PostScript' converter,
2190 but LyX will export PostScript.
2191 It does so by first creating a LaTeX file (no converter needs to be defined
2192 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2193 and finally converts the resulting DVI file to PostScript.
2194 LyX finds such `chains' of converters automatically, and it will always
2195 choose the shortest possible chain.
2196 You can, though, still define multiple conversion methods between file
2198 For example, the standard LyX configuration provides three ways to convert
2199 LaTeX to PDF: Directly, using
2203 ; via (DVI and) PostScript, using
2212 To define such alternate chains, you must define multiple target `file
2213 formats', as described in the next section.
2214 For example in the standard configuration the formats named
2226 are defined, all of which share the extension
2233 \begin_layout Standard
2234 Several variables can be used in the definition of converters:
2238 \labelwidthstring 00.00.0000
2239 $$s The LyX system directory
2243 \labelwidthstring 00.00.0000
2248 \labelwidthstring 00.00.0000
2253 \labelwidthstring 00.00.0000
2254 $$b The base filename of the input file
2258 \labelwidthstring 00.00.0000
2259 $$p The path to the input file
2262 \begin_layout Standard
2268 field you can enter the following flags, separated by commas:
2272 \labelwidthstring 00.00.0000
2273 latex This converter runs some form of LaTeX.
2274 This will make LyX's LaTeX error logs available.
2278 \labelwidthstring 00.00.0000
2279 needaux Needs the LaTeX
2283 file for the conversion.
2287 \labelwidthstring 00.00.0000
2291 \begin_layout Standard
2292 The following three flags are not really flags at all because they take
2303 \labelwidthstring 00.00.0000
2304 parselog If set, the converter's standard error will be redirected to a
2309 , and the script given as argument will be run as:
2311 script <infile.out >infile.log
2314 The argument may contain $$s.
2318 \labelwidthstring 00.00.0000
2319 resultdir The name of the directory in which the
2323 will dump the generated files.
2324 LyX will not create this directory, and it does not copy anything into
2325 it, though it will copy this directory to the destination.
2326 The argument may contain $$b, which will be replaced by the basename of
2327 the input and output files, respectively, when the directory is copied.
2330 that resultdir and usetempdir make no sense together.
2331 The latter will be ignored if the former is given.
2335 \labelwidthstring 00.00.0000
2336 resultfile Determines the output filename and may, contain $$b.
2337 Sensible only with resultdir, and optional even then; if not given, it
2338 defaults to `index'.
2341 \begin_layout Standard
2342 None of these last three are presently used in any of the converters that
2343 are installed with LyX.
2345 \begin_inset CommandInset ref
2347 reference "sub:LyX-and-Literate"
2351 of the Extended Features guide for some examples of how you might use parselog.
2354 \begin_layout Section
2355 BibTeX and makeindex
2358 \begin_layout Standard
2359 Both the bibliography generating command (default
2363 ) and the index generating command (default
2376 As an alternative for
2388 \begin_layout Standard
2389 The command to enter is
2395 makeindex.sh -m $$lang
2398 \begin_layout Standard
2399 where the placeholder
2403 will be replaced by the chosen document (babel) language.
2407 \begin_layout Standard
2408 have installed the packages
2425 at a shell prompt for a help page.
2428 \begin_layout Section
2429 Plain text export options
2432 \begin_layout Standard
2433 \begin_inset VSpace bigskip
2439 \begin_layout Standard
2441 There are a couple of commands that can be used to
2442 \begin_inset Quotes eld
2446 \begin_inset Quotes erd
2449 exported plain text files.
2450 Note that LyX automatically detects and uses the best settings for your
2451 system at installation time, but you can modify them if you disagree with
2455 \begin_layout Description
2459 Plain text\InsetSpace ~
2463 This option defines the command used to produce better plain text tables
2468 UNIX-commands (refer to their manpages for more information about them).
2469 Setting this as empty tells LyX to use the internal (inferior) formatter.
2472 \begin_layout Description
2476 Plain text\InsetSpace ~
2481 With this command you can set the default line length of the plain text
2483 Setting it to 0 means endless lines.
2486 \begin_layout Section
2490 \begin_layout Standard
2491 There are a bunch of configuration options that are used for interaction
2492 with the external print command from LyX.
2493 Normally the defaults are fine: if, however, your print command takes different
2494 option names, you can modify them here.
2497 \begin_layout Subsection
2501 \begin_layout Standard
2502 You can change the colors used by LyX on-screen using the new
2507 Alternatively, if you're feeling particularly perverse you could use the
2512 bindable function (see the
2517 Input would have the format:
2520 \begin_layout Standard
2523 set-color LyXName X11Color
2526 \begin_layout Standard
2527 Here is a (partial) list of the functions and default colors:
2530 \begin_layout Standard
2532 \begin_inset Tabular
2533 <lyxtabular version="3" rows="10" columns="3">
2535 <column alignment="left" valignment="top" leftline="true" width="0pt">
2536 <column alignment="left" valignment="top" leftline="true" width="0pt">
2537 <column alignment="center" valignment="top" leftline="true" rightline="true" width="0pt">
2538 <row topline="true" bottomline="true">
2539 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2542 \begin_layout Standard
2557 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2560 \begin_layout Standard
2575 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2578 \begin_layout Standard
2594 <row topline="true">
2595 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2598 \begin_layout Standard
2613 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2616 \begin_layout Standard
2631 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2634 \begin_layout Standard
2650 <row topline="true">
2651 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2654 \begin_layout Standard
2669 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2672 \begin_layout Standard
2687 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2690 \begin_layout Standard
2706 <row topline="true">
2707 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2710 \begin_layout Standard
2725 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2728 \begin_layout Standard
2743 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2746 \begin_layout Standard
2762 <row topline="true">
2763 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2766 \begin_layout Standard
2781 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2784 \begin_layout Standard
2799 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2802 \begin_layout Standard
2818 <row topline="true">
2819 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2822 \begin_layout Standard
2837 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2840 \begin_layout Standard
2850 fraction Lines, brackets, etc.
2855 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2858 \begin_layout Standard
2874 <row topline="true">
2875 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2878 \begin_layout Standard
2893 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2896 \begin_layout Standard
2902 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2905 \begin_layout Standard
2921 <row topline="true">
2922 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2925 \begin_layout Standard
2940 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2943 \begin_layout Standard
2949 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2952 \begin_layout Standard
2968 <row topline="true">
2969 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2972 \begin_layout Standard
2987 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2990 \begin_layout Standard
2996 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2999 \begin_layout Standard
3015 <row topline="true" bottomline="true">
3016 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3019 \begin_layout Standard
3034 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3037 \begin_layout Standard
3047 selection background
3052 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3055 \begin_layout Standard
3078 \begin_layout Section
3079 The autodetected settings
3082 \begin_layout Standard
3083 \begin_inset CommandInset label
3085 name "sec:autodetected"
3089 There are several items that are detected for you when you run
3096 \SpecialChar \menuseparator
3102 In this section, we list those which pertain to the user preferences.
3105 \begin_layout Description
3111 plaintext_roff_command
3126 , depending on what is available.
3129 \begin_layout Description
3142 plus a bunch of options.
3145 \begin_layout Description
3158 on systems (so-called System V) who have this command, and
3162 otherwise (BSD systems).
3165 \begin_layout Description
3171 print_spool_printerprefix
3182 , depending on whether
3193 \begin_layout Description
3210 fonts are found and LaTeX has support for these fonts built-in.
3211 You can set it manually if you only have the so-called
3218 \begin_layout Section
3222 \begin_layout Standard
3223 There are many other configuration options that can be used to customize
3225 We still need to document them here, but again, most should be fairly obvious.
3226 Please ask on the mailing lists if you need some more information; it may
3227 even prompt us to expand this section.
3230 \begin_layout Chapter
3231 Internationalizing LyX
3232 \begin_inset CommandInset label
3241 \begin_layout Standard
3242 LyX supports using a translated interface.
3243 Last time we checked, LyX provided text in 14 languages together with the
3244 default English text.
3245 The language of choice is called your
3250 (For further reading on locale settings, see also the documentation for
3251 locale that comes with your operating system.
3252 For Linux, the manual page for locale(5) could be a good place to start).
3255 \begin_layout Standard
3256 Notice that these translations will work, but do contain a few flaws.
3257 In particular, all dialogs have been designed with the English text in
3258 mind, which means that some of the translated text will be too large to
3259 fit within the space allocated.
3260 This is only a display problem and will not cause any harm.
3261 Also, you will find that some of the translations do not define short-cut
3262 keys for everything.
3263 Sometimes, there are simply not enough free letters to do it.
3264 Other times, the translator just hasn't got around to doing it yet.
3265 Our localization team -- which you may wish to join -- will try to fix
3266 these shortcomings in future versions of LyX.
3269 \begin_layout Section
3270 Selecting an alternative language for the user interface
3273 \begin_layout Standard
3274 This feature is disabled by default, meaning that system default language
3276 To enable an alternative language, you have to set an appropriate environment
3284 for csh class shells
3299 with the two letter code (or four letter code, like
3303 for British English) for the language you want.
3309 Besides the user interface texts being translated, also the appropriate
3310 manuals will be presented under the Help menu -- if available.
3313 \begin_layout Standard
3314 On some systems, you may have to redefine
3326 , to override the system settings; their preference is in this order
3330 \begin_layout Standard
3331 The shell variable LANGUAGE has been disabled in LyX for technical reasons.
3337 , which corresponds to the way GNU
3342 Consult your system documentation.
3343 Normally, you'll want to put the appropriate line in a shell script run
3344 on start-up, so that the translation is on by default.
3345 Remember that this affects
3349 localized packages, not only LyX!
3352 \begin_layout Standard
3353 If LyX is configured and compiled with
3354 \begin_inset Quotes eld
3362 \begin_inset Quotes erd
3365 , this mechanism will not work.
3368 \begin_layout Section
3372 \begin_layout Subsection
3373 Translating the graphical user interface (text messages).
3376 \begin_layout Standard
3381 library to handle the internationalization of the interface.
3382 To have LyX speak your favorite language in all menus and dialogs, you
3387 -file for that language.
3388 When this is available, you'll have to generate a mo-file from it and install
3394 The process of doing all of this is explained in the documentation for
3399 , but in short, this is what you do (
3403 denotes the language code):
3406 \begin_layout Standard
3410 \begin_layout Standard
3422 \begin_layout Itemize
3425 LYX-SOURCE-DIR/po/lyx.pot
3438 doesn't exist, it can be remade with
3442 in that directory, or you can use an existing po-file for some other language
3446 \begin_layout Itemize
3453 \begin_layout Standard
3454 We recommend that you use Emacs to do this, since the
3458 distribution includes a nice mode that supports you in doing this.
3466 For some menu- and widget-labels, there are also shortcut keys that should
3468 Those keys are marked after a `|', and should be translated according to
3469 the words and phrases of the
3474 There is a tool named
3478 written in Prolog in
3480 LYX-SOURCE-DIR/development/tools/
3482 that may be useful to help determine short-cut keys.
3483 Note that XForms (version 0.86 at least) can't handle anything but 7-bit
3484 characters as shortcut keys.
3485 You should also fill also out the information at the beginning of the new
3490 -file with your email-address, etc., so people know where to reach you with
3491 suggestions and entertaining flames.
3494 \begin_layout Itemize
3503 This can be done with
3524 \begin_layout Itemize
3529 -file to your locale-tree, at the correct directory for application messages
3534 , and under the name
3543 /usr/local/share/locale/
3554 \begin_layout Standard
3558 \begin_layout Standard
3570 \begin_layout Standard
3571 Adding a new po-file to the
3575 of LyX involves altering the configure scripts and more, but the way
3579 works, you don't actually need the source-code of LyX to translate it---having
3595 \begin_layout Standard
3596 If you've written a translation file for a language that LyX does not currently
3597 support, feel free to submit it for inclusion by sending a patch.
3598 In this case, we recommend that you read the
3606 directory for more instructions.
3609 \begin_layout Subsubsection
3613 \begin_layout Standard
3614 Sometimes it turns out that one english message needs to be translated into
3615 different messages in the target language.
3616 One example is the message
3620 which has the german translation
3637 does not handle such ambigous translations.
3638 Therefore you have to add some context information to the message: Instead
3645 To[[as in 'From format x to format y']]
3649 To[[as in 'From page x to page y']].
3652 Now the two occurences of
3660 and can be translated correctly to
3675 \begin_layout Standard
3676 Of course the context information needs to be stripped off the original
3677 message when no translation is used.
3678 Therefore you have to put it in double square brackets at the end of the
3679 message (see the example above).
3680 The translation mechanism of LyX ensures that everything in double square
3681 brackets at the end of messages is removed before displaying the message.
3684 \begin_layout Subsection
3685 Translating the documentation.
3688 \begin_layout Standard
3689 The online documentation (in the
3696 -menu) can (and should!) be translated.
3697 If there are translated versions of the documentation available
3701 \begin_layout Standard
3702 As of February 2003, almost all of the docs have been translated into German
3708 has been translated into at least 12 other languages, with other translations
3710 The library of translated documents is growing rapidly.
3715 , and the locale is set accordingly, these will be used automagically by
3717 LyX looks for translated versions as
3731 denotes the language as set by the environmental variable
3736 If there are none, the default English versions will be displayed.
3737 Note that the translated versions must have the same filenames (
3741 above) as the original.
3742 If you feel up to translating the documentation (an excellent way to proof-read
3743 the original documentation BTW!), there are a few things you should do
3747 \begin_layout Itemize
3752 , the guide to writing LyX documentation.
3753 Pay special attention to the translator's section.
3756 \begin_layout Itemize
3757 Check out the documentation translation web page at
3758 \begin_inset Flex URL
3761 \begin_layout Standard
3763 http://www.devel.lyx.org
3769 That way, you can find out which (if any) documents have already been translate
3770 d into your language.
3771 You can also find out who (if anyone) is organizing the effort to translate
3772 the documentation into your language.
3773 If no one is organizing the effort, please let us know that you're interested.
3776 \begin_layout Standard
3777 Once you get to actually translating, here's a few hints for you that may
3781 \begin_layout Itemize
3782 Join the documentation team! There is information on how to do that in
3791 elp\SpecialChar \menuseparator
3798 ), which by the way is the first document you should translate.
3801 \begin_layout Itemize
3802 Learn the typographic conventions for the language you are translating to.
3803 Typography is an ancient art and over the centuries, a great variety of
3804 conventions have developed throughout different parts of the world.
3805 Also study the professional terminology amongst typographers in your country.
3806 Inventing your own terminology will only confuse the users.
3809 (Warning! Typography is addictive!)
3812 \begin_layout Itemize
3813 Make a copy of the document.
3814 This will be your working copy.
3815 You can use this as your personal translated help-file by placing it in
3823 \begin_layout Itemize
3824 Sometimes the original document (from the LyX-team) will be updated.
3825 Use the ViewCVS tool available at
3826 \begin_inset Flex URL
3829 \begin_layout Standard
3831 http://www.lyx.org/viewcvs.cgi/lyxdoc/
3836 to see what has been changed
3840 \begin_layout Standard
3841 Alternatively, you can keep a copy of the latest version of the English
3842 document which you've translated.
3848 That way you can easily see which parts of the translated document need
3852 \begin_layout Itemize
3853 If you ever find an error in the original document, fix it and notify the
3854 rest of the documentation team of the changes! (You didn't forget to join
3855 the documentation team did you?)
3858 \begin_layout Section
3859 International Keyboard Support
3862 \begin_layout Standard
3865 [Editor's Note: The following section is by
3873 It needs to be fixed to conform to the new Documentation Style sheet and
3874 to make use of the new v1.0 features.
3875 The whole thing also needs to be merged with the section following it.-jw]
3878 \begin_layout Subsection
3879 Defining Own Keymaps: Keymap File Format
3882 \begin_layout Standard
3883 Let's look at a keyboard definition file a little closer.
3884 It is a plain text file defining
3887 \begin_layout Itemize
3888 key-to-key or key-to-string translations
3891 \begin_layout Itemize
3895 \begin_layout Itemize
3896 dead keys exceptions
3899 \begin_layout Standard
3900 To define key-to-key or key-to-string translation, use this command:
3903 \begin_layout Quotation
3919 \begin_layout Standard
3924 is the key to be translated and
3928 is the string to be inserted into the document.
3929 To define dead keys, use:
3932 \begin_layout Quotation
3948 \begin_layout Standard
3958 The following dead keys are supported (shortcut name is in parentheses):
3961 \begin_layout Quotation
3969 \begin_layout Quotation
3975 \begin_layout Quotation
3981 \begin_layout Quotation
3987 \begin_layout Quotation
3993 \begin_layout Quotation
4000 \begin_layout Standard
4012 \begin_layout Quotation
4018 \begin_layout Quotation
4025 \begin_layout Standard
4037 \begin_layout Quotation
4043 \begin_layout Quotation
4049 \begin_layout Quotation
4056 \begin_layout Standard
4068 \begin_layout Quotation
4075 \begin_layout Standard
4087 \begin_layout Quotation
4093 \begin_layout Quotation
4094 hungarian umlaut (hug)
4099 \begin_layout Quotation
4105 \begin_layout Quotation
4112 \begin_layout Standard
4124 \begin_layout Standard
4125 Since in many international keyboards there are exceptions to what some
4126 dead keys should do, you can define them using
4129 \begin_layout Quotation
4138 deadkey key outstring
4141 \begin_layout Standard
4142 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
4146 \begin_layout Quotation
4160 \begin_layout Standard
4161 to make it work correctly.
4162 Also, you have to define as exceptions dead keys over i and j, to remove
4163 the dot from them before inserting an accent mark.
4164 I will change this when the time comes, but so far I haven't had time.
4167 \begin_layout Standard
4168 Oh, and about characters: backslash is escaped, so to enter it, you'll need
4174 have different meaning.
4179 marks comments, quotes start and end LaTeX-style commands.
4180 To enter quote, you'll need to use
4199 \begin_layout Standard
4200 If you make a keyboard description file that works for your language, please
4201 mail it to me, so I can include it in the next keymap distribution.
4204 \begin_layout Standard
4205 More keywords will be supported in keymap configuration file in future,
4209 \begin_layout Itemize
4227 \begin_layout Itemize
4242 an external keymap translation program
4245 \begin_layout Standard
4246 Also, it should look into
4250 file for defaults, too (for example, a
4256 option to include default keyboard).
4259 \begin_layout Section
4260 International Keymap Stuff
4261 \begin_inset CommandInset label
4270 \begin_layout Standard
4271 The next two sections describe the
4283 file syntax in detail.
4284 These sections should help you design your own key map if the ones provided
4285 do not meet your needs.
4288 \begin_layout Subsection
4292 \begin_layout Standard
4301 file maps keystrokes to characters or strings.
4302 As the name suggests it sets a keyboard mapping.
4327 are described in this section.
4331 \labelwidthstring 00.00.0000
4338 Map a character to a string
4341 \begin_layout LyX-Code
4356 \begin_layout Standard
4389 the double-quote (")
4406 must be escaped with a preceding backslash (
4417 \begin_layout Standard
4424 statement to cause the symbol
4430 to be output for the keystroke
4439 \begin_layout LyX-Code
4446 \labelwidthstring 00.00.0000
4453 Specify an accent character
4456 \begin_layout LyX-Code
4465 \begin_layout Standard
4466 This will make the cha
4504 This is the dead key
4508 \begin_layout Standard
4515 refers to a key that does not produce a character by itself, but when followed
4516 with another key, produces the desired accent character.
4517 For example, a German characte
4519 r with an umlaut like
4529 can be produced in this manner.
4538 \begin_layout Standard
4551 and then another key not in
4568 followed by the other, unallowed key, as output.
4577 cancels a dead key, so if
4594 , the cursor will not go one position backwards but will instead cancel
4611 might have had on the next keystroke.
4615 \begin_layout Standard
4616 The following example specifies that the character ' is to be an acute accent,
4617 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4620 \begin_layout LyX-Code
4623 kmod ' acute aeiouAEIOU
4627 \labelwidthstring 00.00.0000
4632 Specify an exception to the accent character
4635 \begin_layout LyX-Code
4644 \begin_layout Standard
4645 This defines an exce
4686 have been assigned a keystroke with a previous
4709 must not belong in the
4761 If such a declaration does not exist in
4817 \begin_layout Standard
4818 The following command produces causes äi to be produced when you enter acute-i
4822 \begin_layout LyX-Code
4837 \labelwidthstring 00.00.0000
4842 Combine two accent characters
4845 \begin_layout LyX-Code
4851 accent1 accent2 allowed
4854 \begin_layout Standard
4855 This one is getting pretty esoteric.
4856 It allows you to combine the effect
4937 \begin_layout Standard
4938 Consider this example from the
4947 \begin_layout LyX-Code
4950 kmod ; acute aeioyvhAEIOYVH
4954 kcomb acute umlaut iyIY
4957 \begin_layout Standard
4958 This allows you to press
4964 and get the effect of
4981 in this case cancels the last dead key, so if you press
4998 \begin_layout Subsection
5002 \begin_layout Standard
5009 mapping is performed, a
5016 file maps the strings that the symbols generate to characters in the current
5018 The LyX distribution currently includes at least the
5033 \begin_layout Standard
5040 file is a sequence of declarations of the form
5043 \begin_layout LyX-Code
5056 \begin_layout Standard
5057 For example, in order to map
5065 to the corresponding character in the iso-8859-1 set (233), the following
5069 \begin_layout LyX-Code
5077 \begin_layout Standard
5100 the same character can apply to more than one string.
5111 \begin_layout LyX-Code
5137 \begin_layout Standard
5138 If LyX cannot find a mapping for the string produced by the keystroke or
5139 a deadkey sequence, it will check if it looks like an accented char and
5140 try to draw an accent over the character on screen.
5143 \begin_layout Subsection
5147 \begin_layout Standard
5148 There is a second way to add support for international characters through
5149 so-called dead-keys.
5150 A dead-key works in combination with a letter to produce an accented character.
5151 Here, we'll explain how to create a really simple dead-key to illustrate
5155 \begin_layout Standard
5156 Suppose you happen to need the circumflex character,
5157 \begin_inset Quotes eld
5161 \begin_inset Quotes erd
5169 -key [a.k.a.\InsetSpace ~
5174 ] to the LyX command
5183 Now, whenever you type the
5187 -key followed by a letter, that letter will have a circumflex accent on
5189 For example, the sequence
5190 \begin_inset Quotes eld
5198 \begin_inset Quotes erd
5201 produces the letter:
5202 \begin_inset Quotes eld
5206 \begin_inset Quotes erd
5210 If you tried to type
5211 \begin_inset Quotes eld
5219 \begin_inset Quotes erd
5222 , however, LyX will complain with a beep, since a
5223 \begin_inset Quotes eld
5231 \begin_inset Quotes erd
5234 never takes a circumflex accent.
5239 after a dead-key produces the bare-accent.
5240 Please note this last point! If you bind a key to a dead-key, you'll need
5241 to rebind the character on that key to yet another key.
5246 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5249 \begin_layout Standard
5250 One common way to bind dead-keys is to use
5262 in combination with an accent, like
5263 \begin_inset Quotes eld
5271 \begin_inset Quotes erd
5275 \begin_inset Quotes eld
5283 \begin_inset Quotes erd
5287 \begin_inset Quotes eld
5295 \begin_inset Quotes erd
5299 Another way involves using
5307 [remember them from section?] to set up the special
5316 acts in some ways just like
5320 and permits you to bind keys to accented characters.
5321 You can also turn keys into dead-keys by binding them to something like
5326 and then binding this symbolic key to the corresponding LyX command.
5330 \begin_layout Standard
5335 : This is exactly what I do in my
5353 and a bunch of these
5354 \begin_inset Quotes eld
5362 \begin_inset Quotes erd
5365 symbolic keys bound such things as
5376 This is how I produce my accented characters.
5381 You can make just about anything into the
5389 keys, a spare function key, etc.
5390 As for the LyX commands that produce accents, check the entry for
5399 You'll find the complete list there.
5402 \begin_layout Subsection
5403 Saving your Language Configuration
5406 \begin_layout Standard
5407 \begin_inset CommandInset label
5413 You can edit your preferences so that your desired language environment
5414 is automatically configured when LyX starts up, via the
5419 dit\SpecialChar \menuseparator
5429 \begin_layout Chapter
5430 Installing New Document Classes, Layouts, and Templates
5431 \begin_inset CommandInset label
5433 name "chap:textclass"
5441 \begin_layout Standard
5442 Installing New Document Classes
5450 \begin_layout Standard
5451 In this chapter, we describe the procedures for creating and installing
5452 new LyX layout and template files, as well as offer a refresher on correctly
5453 installing new LaTeX document classes.
5454 Some definitions: a document class is a LaTeX file (usually ending in
5462 ) which describes the format of a document such as an article, report, journal
5464 and all the commands needed to realize that format.
5465 A layout file is a LyX file which corresponds to a LaTeX document class
5466 and which tells LyX how to
5467 \begin_inset Quotes eld
5471 \begin_inset Quotes erd
5474 things on the screen to make the display look something like the final
5476 More precisely, a layout file describes a
5477 \begin_inset Quotes eld
5481 \begin_inset Quotes erd
5484 which is the internal construct LyX uses to render the screen display.
5486 \begin_inset Quotes eld
5490 \begin_inset Quotes erd
5494 \begin_inset Quotes eld
5498 \begin_inset Quotes erd
5501 can be used somewhat interchangeably, but it is better to refer to the
5502 file as the layout, and the thing living in LyX's memory as the text class.
5503 A template file is simply a LyX document which contains a set of predefined
5504 entries for a given document class which are generally required for that
5506 Templates are especially useful for things like journal manuscripts which
5507 are to be submitted electronically.
5510 \begin_layout Section
5511 Installing a new LaTeX package
5514 \begin_layout Standard
5515 Some installations may not include a LaTeX package that you would like to
5517 For example, you might need FoilTeX, a common (and very powerful) package
5518 for preparing slides or viewgraphs for overhead projectors.
5519 Here are the formal steps involved in getting the package up and running
5520 if you are using teTeX or some other web2c based distribution.
5524 \begin_layout Enumerate
5525 Get the package from CTAN or wherever.
5529 \begin_layout Standard
5532 Inventory of your LaTeX configuration
5534 manual for details of what CTAN is and where supported document classes
5543 \begin_layout Enumerate
5548 (this usually lives in the directory
5552 , though you can run
5557 It describes how to add a local
5561 directory; follow the instructions.
5562 You need to insert the name of your local
5575 is a logical place to install software that did not come with your distribution
5581 Usually, you will have to modify only two things:
5585 \begin_layout Enumerate
5590 to the directory you chose; e.g.
5595 TEXMFLOCAL = /usr/local/texmf
5598 \begin_layout Enumerate
5612 TEXMF = {$HOMETEXMF,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5616 \begin_layout Enumerate
5627 You must follow the directory structure of your existing
5631 directory (for example, latex packages should go under
5633 /usr/local/texmf/tex/latex/
5638 \begin_layout Enumerate
5639 Install the package.
5640 For example, you would unpack the FoilTeX tarball and create
5642 /usr/local/texmf/tex/latex/foiltex
5649 directory contains various files.
5652 \begin_layout Enumerate
5660 /usr/local/texmf/ls-R
5665 \begin_layout Enumerate
5666 From within LyX, do:
5671 ools\SpecialChar \menuseparator
5682 \begin_layout Standard
5683 Now you should see your new package---for example
5692 ayout\SpecialChar \menuseparator
5707 Note that there are simpler ways of installing packages: you can add a
5708 link to the new package directory in the system LaTeX directory (
5712 , don't forget to then run
5716 ), or sometimes simply set the
5720 environment variable to include the new package.
5721 However, the formal procedure described in
5725 is guaranteed to work, so you should follow it unless circumstances absolutely
5726 prevent it: such as, when you don't have superuser access.
5729 \begin_layout Section
5730 \begin_inset CommandInset label
5739 \begin_layout Standard
5740 This section describes how to write and install your own LyX layout files
5741 (also known as text classes) and walks through the
5745 text class format as an example.
5750 files describe what paragraph styles are available for a given document
5751 class and how LyX should display them.
5752 We try to provide a thorough description of the process here; however,
5753 there are so many different types of documents supported by LaTeX classes
5754 that we can't hope to cover every different possibility or problem you
5756 (The LyX users' list is frequented by people with lots of experience with
5757 layout design who are willing to share what they've learned.)
5760 \begin_layout Standard
5761 As you prepare to write a new layout, it is extremely helpful to look at
5762 the example layouts distributed with LyX.
5763 If you use a nice LaTeX document class that might be of interest for others,
5764 too, and have a nice corresponding LyX layout, feel free to contribute
5765 the stuff to us, so we may put it into the distribution.
5766 There is also a section on the LyX wiki for this kind of material.
5769 \begin_layout Standard
5770 All the tags described in this chapter are case-insensitive; this means
5783 are really the same command.
5784 The possible values are printed in brackets after the feature's name.
5785 The default value if a feature isn't specified inside a text class-description
5793 If the argument has a datatype like
5794 \begin_inset Quotes eld
5798 \begin_inset Quotes erd
5802 \begin_inset Quotes eld
5806 \begin_inset Quotes erd
5809 , the default is shown like this:
5819 \begin_layout Subsection
5823 \begin_layout Standard
5824 Similar to layout files, and new with LyX 1.6, are layout
5829 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5830 some modules---such as the Endnotes module---provide support for just such
5832 In a sense, layout modules are similar to included files---files like stdsectio
5833 ns.inc---in that modules are not specific to a given document layout but
5834 may be used with many different layouts.
5835 The difference is that using a layout module does not require editing the
5837 Rather, modules are selected in the
5842 ocument\SpecialChar \menuseparator
5852 \begin_layout Standard
5853 Building modules is the easiest way to get started with layout editing,
5854 since it can be as simple as adding a single new paragraph or flex inset.
5855 But modules may, in principle, contain anything a layout file can contain.
5858 \begin_layout Standard
5859 A module must begin with a line like the following:
5862 \begin_layout LyX-Code
5865 DeclareLyXModule[endnotes.sty]{Adds an endnote inset.}{Endnotes}
5868 \begin_layout Standard
5869 The argument in square brackets is optional: It declares any LaTeX packages
5870 on which the module depends.
5871 The two mandatory arguments, in curly brackets, are a short description
5872 of the module and the name of the module, as they should appear in
5874 Document\SpecialChar \menuseparator
5881 \begin_layout Standard
5882 After creating a new module, you will need to reconfigure and then restart
5883 LyX for it to appear in the menu.
5884 However, changes you make to the module will be seen immediately, if you
5887 Document\SpecialChar \menuseparator
5890 , make some change (or even just highlight something), and then hit
5891 \begin_inset Quotes eld
5895 \begin_inset Quotes erd
5901 It is strongly recommended that you save your work before doing so
5904 In fact, it is strongly recommended that you not attempt to create or edit
5905 modules while simultaneously working on documents.
5906 Though of course the developers strive to keep LyX stable in such situations,
5907 syntax errors and the like in your module file could cause strange behavior.
5910 \begin_layout Subsection
5911 Supporting new document classes
5914 \begin_layout Standard
5915 There are two situations you are likely to encounter when wanting to support
5916 a new LaTeX document class, involving LaTeX2e class (
5925 Supporting a style file is usually fairly easy.
5926 Supporting a new document class is a bit harder.
5929 \begin_layout Subsection
5937 \begin_layout Standard
5938 If your new document class is provided as a style file that is used in conjuncti
5939 on with an existing, supported document class---for the sake of the example,
5940 we'll assume that the style file is called
5944 and it is meant to be used with
5948 , which is a standard class---start by copying the existing class's layout
5949 file into your local directory:
5952 \begin_layout LyX-Code
5953 cp report.layout ~/.lyx/layouts/myclass.layout
5956 \begin_layout Standard
5961 and change the line:
5964 \begin_layout LyX-Code
5967 DeclareLaTeXClass{report}
5970 \begin_layout Standard
5974 \begin_layout LyX-Code
5977 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
5980 \begin_layout Standard
5984 \begin_layout LyX-Code
5994 \begin_layout Standard
5995 near the top of the file.
5998 \begin_layout Standard
5999 Start LyX and select
6004 ools\SpecialChar \menuseparator
6012 Then restart LyX and try creating a new document.
6017 " as a document class option in the
6022 ocument\SpecialChar \menuseparator
6030 It is likely that some of the sectioning commands and such in your new
6031 class will work differently from how they worked in the base class---
6035 in this example---so you can fiddle around with the settings for the different
6036 sections if you wish.
6037 See below for more discussion on this.
6040 \begin_layout Subsection
6048 \begin_layout Standard
6049 There are two possibilities here.
6050 One is that the class file is itself based upon an existing document class.
6051 For example, many thesis classes are based upon
6056 To see whether yours is, look for a line like
6059 \begin_layout LyX-Code
6065 \begin_layout Standard
6067 If so, then you may proceed largely as in the previous section, though
6068 the DeclareLaTeXClass line will be different.
6069 If your new class is thesis, and it is based upon book, then the line should
6073 \begin_layout LyX-Code
6076 DeclareLaTeXClass[myclass, book]{thesis}
6079 \begin_layout Standard
6080 If, on the other hand, the new class is not based upon an existing class,
6081 you will probably have to
6082 \begin_inset Quotes eld
6086 \begin_inset Quotes erd
6090 We strongly suggest copying an existing layout file which uses a similar
6091 LaTeX class and then modifying it, if you can do so.
6092 At least use an existing file as a starting point so you can find out what
6093 items you need to worry about.
6094 Again, the specifics are covered below.
6097 \begin_layout Section
6098 Declaring a new text class
6101 \begin_layout Standard
6102 When it's finally time to get your hands dirty and create or edit your own
6103 layout file, the following sections describe what you're up against.
6104 Our advice is to go slowly, save and test often, listen to soothing music,
6105 and enjoy one or two of your favorite adult beverages; more if you are
6106 getting particularly stuck.
6107 It's really not that hard, except that the multitude of options can become
6108 overwhelming if you try to do to much in one sitting.
6109 Go have another adult beverage, just for good measure.
6112 \begin_layout Standard
6116 \begin_layout Standard
6117 Lines in a layout file which begin with a
6122 There is one exception to this rule: all layouts should begin with lines
6126 \begin_layout LyX-Code
6129 #% Do not delete the line below; configure depends on this
6132 \begin_layout LyX-Code
6137 DeclareLaTeXClass{article}
6140 \begin_layout Standard
6141 The second line is used when you configure LyX.
6142 The layout file is read by the LaTeX script
6146 , in a special mode where
6151 The first line is just a LaTeX comment, and the second one contains the
6152 declaration of the text class.
6153 If these lines appear in a file named
6157 , then they define a text class of name
6161 (the name of the layout file) which uses the LaTeX document class
6165 (the default is to use the same name as the layout).
6167 \begin_inset Quotes eld
6171 \begin_inset Quotes erd
6174 that appears above is used as a description of the text class in the
6179 ocument\SpecialChar \menuseparator
6189 \begin_layout Standard
6190 Let's assume that you wrote your own text class that uses the
6194 documentclass, but where you changed the appearance of the section headings.
6195 If you put it in a file
6199 , the header of this file should be:
6202 \begin_layout LyX-Code
6205 #% Do not delete the line below; configure depends on this
6208 \begin_layout LyX-Code
6213 DeclareLaTeXClass[article]{article (with my own headings)}
6216 \begin_layout Standard
6217 This declares a text class
6221 , associated with the LaTeX document class
6226 \begin_inset Quotes eld
6229 article (with my own headings)
6230 \begin_inset Quotes erd
6234 If your text class depends on several packages, you can declare it as:
6237 \begin_layout LyX-Code
6240 #% Do not delete the line below; configure depends on this
6243 \begin_layout LyX-Code
6248 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6251 \begin_layout Standard
6252 This indicates that your text class uses the foo.sty package.
6253 Finally, it is also possible to declare classes for DocBook code.
6254 Typical declarations will look like
6257 \begin_layout LyX-Code
6260 #% Do not delete the line below; configure depends on this
6263 \begin_layout LyX-Code
6268 DeclareDocBookClass[article]{SGML (DocBook article)}
6271 \begin_layout Standard
6272 Note that these declarations can also be given an optional parameter declaring
6273 the name of the document class (but not a list).
6276 \begin_layout Standard
6277 When the text class has been modified to your taste, all you have to do
6278 is to copy it either in
6291 ools\SpecialChar \menuseparator
6299 Exit LyX and restart it; then your new text class should be available along
6303 \begin_layout Standard
6304 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6305 you made to your layout files.
6306 As a result, editing layout files could be very time consuming.
6307 Beginning with 1.6, however, you can force a reload of the layout currently
6308 in use by using the LyX function
6313 There is no default binding for this function---though, of course, you
6314 can bind it to a key yourself (see section
6315 \begin_inset CommandInset ref
6317 reference "sec:bindings"
6322 You should simply enter this command in the mini-buffer.
6327 : This is very much an `advanced feature'.
6332 recommended that you save your work before using this function.
6337 recommended that you not attempt to edit your layout while simultaneously
6338 working on a document that you care about.
6339 Use a test document.
6340 Syntax errors and the like in your layout file could cause peculiar behavior.
6341 In particular, such errors could cause LyX to regard the current layout
6342 as invalid and to attempt to switch to some other layout.
6343 The LyX team strives to keep LyX stable in such situations, but safe is
6347 \begin_layout Subsection
6351 \begin_layout Standard
6352 The first non-comment line must contain the file format number:
6355 \begin_layout Description
6366 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6367 don't have an explicit file format).
6368 The file format that is documented here is
6375 \begin_layout Subsection
6376 General text class parameters
6379 \begin_layout Standard
6380 These are the general parameters which describe the form of the entire document:
6383 \begin_layout Standard
6387 \begin_layout Standard
6399 \begin_layout Description
6413 ] Whether the class-default should have one or two columns.
6414 Can be changed in the
6419 ocument\SpecialChar \menuseparator
6427 This setting (same goes for
6431 , too) is important: if your text class has two columns by default but you
6432 forget to set it correctly, the
6440 be output when you select
6449 ocument\SpecialChar \menuseparator
6457 \begin_layout Description
6471 ] Whether the class-default should be printing on one or both sides of the
6473 Can be changed in the
6478 ocument\SpecialChar \menuseparator
6488 \begin_layout Description
6502 ] The class default pagestyle.
6503 Can be changed in the
6508 ocument\SpecialChar \menuseparator
6518 \begin_layout Description
6522 ClassOptions\SpecialChar \ldots{}
6526 This section describes various global options supported by the document
6528 See Section\InsetSpace ~
6530 \begin_inset CommandInset ref
6532 reference "sec:classoptions"
6539 \begin_layout Description
6557 ] Whether the class already provides the feature
6562 A feature is in general the name of a package (amsmath, makeidx, \SpecialChar \ldots{}
6564 macro (url, boldsymbol,\SpecialChar \ldots{}
6565 ); the complete list of supported features is unfortunat
6569 \begin_layout Description
6580 ] Whether the class requires the feature
6585 A feature is in general the name of a package (amsmath, makeidx, \SpecialChar \ldots{}
6587 macro (url, boldsymbol,\SpecialChar \ldots{}
6589 Multiple features must be separated by commas.
6590 Note that you can only request supported features; unfortunately, the complete
6591 list of supported features is not documented (however,
6596 elp\SpecialChar \menuseparator
6603 gives an overview of the supported packages).
6606 \begin_layout Description
6613 This is used to describe the default font of the document.
6614 See Section\InsetSpace ~
6616 \begin_inset CommandInset ref
6618 reference "sec:fonts"
6625 \begin_layout Description
6636 ] This is the style that will be assigned to new paragraphs, usually
6641 This will default to the first defined style if not given, but you are
6642 highly encouraged to use this directive.
6645 \begin_layout Description
6662 ] Indicates what kind of markup is used to define the title of a document.
6667 means that the macro with name
6671 will be inserted after the last layout which has
6672 \begin_inset Quotes eld
6680 \begin_inset Quotes erd
6688 corresponds to the case where the block of paragraphs which have
6689 \begin_inset Quotes eld
6697 \begin_inset Quotes erd
6700 should be enclosed into the
6709 \begin_layout Description
6720 ] The name of the command/environment mentionned above.
6723 \begin_layout Description
6727 Preamble\SpecialChar \ldots{}
6731 A set of macro definitions that will be output at the beginning of the
6733 Use this for global definitions.
6736 \begin_layout Description
6743 As its name implies, this command allows you to include another layout
6744 definition file within yours to avoid duplicating commands.
6745 Common examples are the standard layout files, for example,
6749 , which contains most of the basic layouts.
6752 \begin_layout Description
6756 Style\SpecialChar \ldots{}
6760 This sequence defines a new style.
6761 If the style already exists, it will redefine some of its parameters instead.
6762 See Section\InsetSpace ~
6764 \begin_inset CommandInset ref
6766 reference "sec:style"
6773 \begin_layout Description
6780 This command deletes an existing style.
6781 This is particularly useful when you want to suppress a style that has
6782 be defined in an input file.
6785 \begin_layout Description
6789 Float\SpecialChar \ldots{}
6793 This sequence defines a new float.
6794 See Section\InsetSpace ~
6796 \begin_inset CommandInset ref
6798 reference "sec:floats"
6805 \begin_layout Description
6812 This command deletes an existing float.
6813 This is particularly useful when you want to suppress a float that has
6814 be defined in an input file.
6817 \begin_layout Description
6821 InsetLayout\SpecialChar \ldots{}
6825 This section (re-)defines the layout of an inset.
6826 It can be applied to an existing inset of to a new, user-defined inset,
6827 e.g., a new character style.
6828 See Section\InsetSpace ~
6830 \begin_inset CommandInset ref
6832 reference "sec:charstyle"
6839 \begin_layout Description
6843 Counter\SpecialChar \ldots{}
6847 This sequence defines a new counter.
6848 See Section\InsetSpace ~
6850 \begin_inset CommandInset ref
6852 reference "sec:counter"
6859 \begin_layout Standard
6863 \begin_layout Standard
6875 \begin_layout Subsection
6883 \begin_layout Standard
6884 \begin_inset CommandInset label
6886 name "sec:classoptions"
6894 section can contain the following entries:
6897 \begin_layout Description
6908 ] The list of available font sizes for the document's main font, separated
6910 \begin_inset Quotes eld
6918 \begin_inset Quotes erd
6924 \begin_layout Description
6933 string="empty|plain|headings|fancy"
6935 ] The list of available page styles, separated by
6936 \begin_inset Quotes eld
6944 \begin_inset Quotes erd
6950 \begin_layout Description
6961 ] Some document class options, separated by a comma, that will be added
6962 to the optional part of the
6971 \begin_layout Subsection
6972 Specific Paragraph Layouts
6975 \begin_layout Standard
6976 \begin_inset CommandInset label
6982 A paragraph layout description looks like this
6986 \begin_layout Standard
6987 Note that this will either define a new layout or modify an existing one.
6995 \begin_layout LyX-Code
7002 \begin_layout LyX-Code
7006 \begin_layout LyX-Code
7010 \begin_layout Standard
7011 where the following commands are allowed:
7014 \begin_layout Standard
7018 \begin_layout Standard
7030 \begin_layout Description
7041 This is used to copy all the features of an existing layout into the current
7046 \begin_layout Description
7058 , Command, Environment, Item_Environment,
7064 ] How the layout should be translated into LaTeX.
7069 means nothing special.
7082 {\SpecialChar \ldots{}
7097 }\SpecialChar \ldots{}
7121 is generated for each paragraph of this environment.
7134 is passed as an argument to the environment.
7139 can be defined in the
7144 ayout\SpecialChar \menuseparator
7158 is perhaps a bit misleading, since these rules apply to SGML classes, too.
7159 Visit the SGML class files for specific examples.
7162 \begin_layout Description
7173 If 1, marks the layout as being part of a title block (see also the
7184 \begin_layout Description
7191 The name of the corresponding LaTeX stuff.
7192 Either the environment or command name.
7195 \begin_layout Description
7202 The optional parameter for the corresponding
7209 This parameter cannot be changed from within LyX.
7212 \begin_layout Description
7223 ] The number of optional arguments that can be used with this layout.
7224 This is useful for things like section headings, and only makes sense with
7228 \begin_layout Description
7240 , Manual, Dynamic, First_Dynamic, Right_Address_Box
7244 The kind of margin that the layout has on the left side.
7249 just means a fixed margin.
7254 means that the left margin depends on the string entered in the
7259 dit\SpecialChar \menuseparator
7264 aragraph\InsetSpace ~
7268 This is used to typeset nice lists without tabulators.
7273 means that the margin depends on the size of the label.
7274 This is used for automatic enumerated headlines.
7275 It is obvious that the headline
7276 \begin_inset Quotes eld
7279 5.4.3.2.1 Very long headline
7280 \begin_inset Quotes erd
7283 must have a wider left margin (as wide as
7284 \begin_inset Quotes eld
7288 \begin_inset Quotes erd
7291 plus the space) than
7292 \begin_inset Quotes eld
7295 3.2 Very long headline
7296 \begin_inset Quotes erd
7299 , even if other word processors are not able to do this.
7304 is similar, but only the very first row of the paragraph is dynamic, while
7305 the others are static; this is used, for example, for descriptions.
7310 means the margin is chosen in a way that the longest row of this paragraph
7311 fits to the right margin.
7312 This is used to typeset an address on the right edge of the page.
7315 \begin_layout Description
7332 ] Whether the following Paragraph is allowed to indent its very first row.
7337 means that it is not allowed to do so,
7341 means it could do so if it wants to.
7344 \begin_layout Description
7355 ] The indent of the very first line of a paragraph.
7356 The argument is passed as a string.
7361 means that the paragraph is indented with the width of
7370 You can get a negative width by prefixing the string with
7375 This way was chosen so that the look is the same with each used screen
7381 will be fixed for a certain layout.
7382 The exception is Standard layout, since the indentation of a Standard layout
7383 paragraph can be prohibited with
7388 Also, Standard layout paragraphs inside environments use the
7392 of the environment, not their native one.
7393 For example, Standard paragraphs inside an enumeration are not indented.
7396 \begin_layout Description
7407 ] LyX allows to choose either
7408 \begin_inset Quotes eld
7412 \begin_inset Quotes erd
7416 \begin_inset Quotes eld
7420 \begin_inset Quotes erd
7423 to typeset a document.
7425 \begin_inset Quotes eld
7429 \begin_inset Quotes erd
7432 is chosen, this value is completely ignored.
7434 \begin_inset Quotes eld
7438 \begin_inset Quotes erd
7441 is chosen, the parindent of a LaTeXtype
7442 \begin_inset Quotes eld
7446 \begin_inset Quotes erd
7449 layout is ignored and all paragraphs are additionally separated by this
7451 The vertical space is calculated with
7453 value*DefaultHeight()
7459 is the height of a row with the normal font.
7460 This way, the look stays the same with different screen fonts.
7463 \begin_layout Description
7474 ] The vertical space with which the very first of a chain of paragraphs
7475 with this layout is separated from the previous paragraph.
7476 If the previous paragraph has another layout, the separations are not simply
7477 added, but the maximum is taken.
7480 \begin_layout Description
7495 for the very last paragraph.
7498 \begin_layout Description
7509 ] The vertical space between two paragraphs of this layout.
7512 \begin_layout Description
7523 ] This is an extra space between the paragraphs of an environment layout.
7524 If you put other layouts into an environment, each is separated with the
7530 But the whole items of the environment are additionally separated with
7539 \begin_layout Description
7550 ] If you put layouts into environments, the leftmargins are not simply added,
7551 but added with a factor
7552 \begin_inset Formula $\frac{4}{depth+4}$
7556 Note that this parameter is also used when the border is defined as
7565 Then it is added to the manual or dynamic border.
7566 This string has the same meaning as for
7573 \begin_layout Description
7591 \begin_layout Description
7603 , Manual, Static, Top_Environment,
7605 Centered_Top_Environment, Sensitive,
7614 means the label is the very first word (up to the first real blank).
7619 means it is defined in the layout (see
7630 Centered_Top_Environment
7632 are special cases of
7637 The label will be printed above the paragraph, but only at the top of an
7638 environment or the top of a chain of paragraphs with this layout.
7639 Usage is for example the
7648 This is also the case for
7652 labels with latex type
7656 , in order to make layouts for theorems work correctly.
7661 is a special case for the caption-labels
7662 \begin_inset Quotes eld
7666 \begin_inset Quotes erd
7670 \begin_inset Quotes eld
7674 \begin_inset Quotes erd
7682 means the (hardcoded) label string depends on the kind of float.
7687 label type defines automatically numbered labels.
7690 \begin_layout Description
7703 The name of the counter for automatic numbering (see Section\InsetSpace ~
7705 \begin_inset CommandInset ref
7707 reference "sec:counter"
7712 This must be given if
7725 \begin_layout Description
7736 ] The horizontal space between the label and the text body.
7737 Only used for labels that are not above the text body.
7740 \begin_layout Description
7747 [float=0] The vertical space between the label and the text body.
7748 Only used for labels that are above the text body (
7754 Centered_Top_Environment
7759 \begin_layout Description
7770 ] The string used for a label with a
7779 this string is also used as a suggestion for the
7783 that can be set in the
7788 dit\SpecialChar \menuseparator
7793 aragraph\InsetSpace ~
7803 is set, this string can be contain the special formatting commands described
7804 in Section\InsetSpace ~
7806 \begin_inset CommandInset ref
7808 reference "sec:counter"
7813 For the sake of backwards compatibility, the string
7821 will be replaced by the expanded
7832 This feature is now obsolete and should be replaced by the mechanisms of
7833 Section\InsetSpace ~
7835 \begin_inset CommandInset ref
7837 reference "sec:counter"
7844 \begin_layout Description
7855 ] This is used inside the appendix instead of
7876 \begin_layout Description
7883 The level of the style in the table of contents.
7884 This is used for automatic numbering of section headings.
7887 \begin_layout Description
7899 , Box, Filled_Box, Static
7901 ] The type of label that stands at the end of the paragraph (or sequence
7924 \begin_inset Quotes eld
7928 \begin_inset Quotes erd
7940 ) is a white (resp.\InsetSpace ~
7941 black) square suitable for end of proof markers,
7945 is an explicit text string.
7948 \begin_layout Description
7959 ] The string used for a label with a
7971 \begin_layout Description
7983 , left, right, center
7985 ] Paragraph alignment.
7988 \begin_layout Description
8000 , left, right, center
8007 Some LaTeX styles prohibit certain alignments, since those wouldn't make
8009 For example a right-aligned or centered enumeration isn't possible.
8012 \begin_layout Description
8026 ] With this parameter the
8031 \begin_inset Quotes eld
8034 Vertical space above
8035 \begin_inset Quotes erd
8043 dit\SpecialChar \menuseparator
8048 aragraph\InsetSpace ~
8051 dialog can be set when initializing a paragraph with this layout
8055 \begin_layout Standard
8058 Note from Jean-Marc:
8060 I'm not sure that this setting has much use, and it should probably be
8061 removed in later versions.
8070 \begin_layout Description
8091 \begin_layout Description
8105 ] Whether fragile commands in this layout should be
8114 \begin_layout Description
8131 ] Whether newlines are translated into LaTeX newlines (
8140 The translation can be switched off to allow more comfortable LaTeX editing
8144 \begin_layout Description
8158 ] Whether the contents of this paragraph should be output in raw form, meaning
8159 without special translations that LaTeX would require.
8160 This somehow replaces the older
8167 \begin_layout Description
8181 ] Usually LyX doesn't allow you to insert more than one space between words,
8182 since a space is considered as the separation between two words, not a
8183 character or symbol of its own.
8184 This is a very fine thing but sometimes annoying, for example when typing
8185 program code or plain LaTeX code.
8191 Note that LyX will create protected blanks for the additional blanks when
8192 in another mode than LaTeX-mode.
8195 \begin_layout Description
8209 ] Usually LyX does not allow you to leave a paragraph empty, since it would
8210 lead to empty LaTeX output.
8211 There are some cases where this could be desirable however: in a letter
8212 template, the required fields can be provided as empty fields, so that
8213 people do not forget them; in some special classes, a layout can be used
8214 as some kind of break, which does not contain actual text.
8217 \begin_layout Description
8229 , onehalf, double, other
8235 ] This defines what the default spacing should be in the layout.
8248 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
8249 If you specify the argument
8253 , then you should also provide a numerical argument which will be the actual
8255 Note that, contrary to other parameters,
8259 implies the generation of specific LaTeX code, using the package
8266 \begin_layout Description
8273 The font used for both the text body
8278 See section\InsetSpace ~
8280 \begin_inset CommandInset ref
8282 reference "sec:fonts"
8287 Note that defining this font automatically defines the
8294 \begin_layout Description
8301 The font used for the text body .
8302 See section\InsetSpace ~
8304 \begin_inset CommandInset ref
8306 reference "sec:fonts"
8313 \begin_layout Description
8320 The font used for the label.
8321 See section\InsetSpace ~
8323 \begin_inset CommandInset ref
8325 reference "sec:fonts"
8332 \begin_layout Description
8336 Preamble\SpecialChar \ldots{}
8340 A set of macro definitions that will be output at the beginning of the
8341 LaTeX files when the layout is used.
8342 Use this to define the macros needed by this particular layout.
8345 \begin_layout Description
8356 ] Whether the layout requires the feature
8361 A feature is in general the name of a package (amsmath, makeidx, \SpecialChar \ldots{}
8363 macro (url, boldsymbol,\SpecialChar \ldots{}
8365 Multiple features must be separated by commas.
8366 Note that you can only request supported features; unfortunately, the complete
8367 list of supported features is not documented (however,
8372 elp\SpecialChar \menuseparator
8379 gives an overview of the supported packages).
8382 \begin_layout Description
8389 the name of a style which preamble should be output
8393 the one mentionned above.
8394 This allows to ensure some ordering of the preamble snippets when macros
8395 definitions depend on one another
8399 \begin_layout Standard
8400 Note that, besides that functionality, there is no way to ensure any ordering
8402 The ordering that you see in a given version of LyX may change without
8403 warning in later versions.
8411 \begin_layout Standard
8415 \begin_layout Standard
8427 \begin_layout Subsection
8431 \begin_layout Standard
8432 \begin_inset CommandInset label
8438 Since version 1.3.0 of LyX, it is necessary to define the floats (
8446 , \SpecialChar \ldots{}
8447 ) in the text class itself.
8448 If you are looking here to learn how to upgrade an existing text class,
8449 it will probably turn out that all you have to do is to add
8452 \begin_layout LyX-Code
8456 \begin_layout Standard
8457 at a reasonable location of the text class.
8461 \begin_layout Standard
8462 Don't forget to also have a look at counters in next section.
8467 If you want to implement a text class that proposes some other float types
8468 (like the AGU class bundled with LyX), the information below will hopefully
8472 \begin_layout Description
8484 \begin_inset Quotes erd
8488 \begin_inset Quotes erd
8492 \begin_inset Quotes eld
8496 \begin_inset Quotes erd
8499 of the new class of floats, like program or algorithm.
8500 After the appropriate
8521 \begin_layout Description
8533 \begin_inset Quotes erd
8537 \begin_inset Quotes erd
8540 ] The string that will be used in the menus and also for the caption.
8543 \begin_layout Description
8564 if the float is already defined by the documentclass.
8569 , the float will be defined using the LaTeX package
8576 \begin_layout Description
8588 \begin_inset Quotes erd
8592 \begin_inset Quotes erd
8595 ] This (optional) argument determines whether floats of this class will
8596 be numbered within some sectional unit of the document.
8597 For example, if within is equal to
8601 , the floats will be numbered within chapters.
8605 \begin_layout Description
8617 \begin_inset Quotes erd
8621 \begin_inset Quotes erd
8624 ] The style used when defining the float using
8633 \begin_layout Description
8645 \begin_inset Quotes erd
8649 \begin_inset Quotes erd
8652 ] The default placement for the given class of floats.
8653 They are like in standard LaTeX:
8669 for top, bottom, page, and here, respectively.
8673 \begin_layout Standard
8674 Note that the order of these letters in the string is irrelevant, like in
8680 On top of that there is a new type,
8684 , which does not really correspond to a float, since it means: put it
8685 \begin_inset Quotes eld
8689 \begin_inset Quotes erd
8693 Note, however that the
8697 specifier is special and, because of implementation details cannot be used
8698 in non-builtin float types.
8699 If you do not understand what this means, just use
8706 \begin_layout Description
8718 \begin_inset Quotes erd
8722 \begin_inset Quotes erd
8725 ] The file name extension of an auxiliary file for the list of figures (or
8727 LaTeX writes the captions to this file.
8730 \begin_layout Description
8742 \begin_inset Quotes erd
8746 \begin_inset Quotes erd
8749 ] The heading used for the list of floats.
8752 \begin_layout Standard
8753 Note that defining a float with type
8759 automatically defines the corresponding counter with name
8768 \begin_layout Subsection
8769 Inset layouts and Flex insets
8772 \begin_layout Standard
8773 \begin_inset CommandInset label
8775 name "sec:charstyle"
8779 You can define character styles since version 1.4.0 of LyX; since version
8780 1.6.0 these are called Flex insets.
8784 \begin_layout Standard
8785 Furthermore it is possible to define the general layout of many different
8787 Currently layout parameters can be defined for footnotes, marginal notes,
8788 note insets, ERT insets, branch insets, and Flex insets.
8789 The latter are definable from the user GUI and come in three different
8790 kinds: character style (
8798 ), and XML element (
8806 \begin_layout Standard
8811 definition starting line is of the form
8814 \begin_layout LyX-Code
8815 InsetLayout <Type> <Name>
8818 \begin_layout Standard
8822 \begin_layout Standard
8829 Foot, Margin, Note, Flex
8834 \begin_layout Standard
8839 can be empty (for foot- and marginal notes, branches and ERT) or one of
8857 Here, the second part of the name can be chosen freely (for CharStyle,
8858 Custom and Element), or from a predefined list (for Note).
8861 \begin_layout Standard
8866 section can contain the following entries:
8869 \begin_layout Description
8892 (indicating a dummy definition ending definitions of charstyles etc.).
8893 This entry is only meaningful for Flex (user definable) insets, the three
8894 types of which are CharStyle, Custom and Element.
8897 \begin_layout Description
8913 Minimalistic or Conglomerate
8916 , describing the rendering style used for the inset's frame and buttons.
8919 \begin_layout Description
8926 defines what will be displayed on the button or elsewhere as the inset
8928 Some inset types (ERT and Branch) modify this label on the fly.
8931 \begin_layout Description
8938 The font used for both the text body
8943 See section\InsetSpace ~
8945 \begin_inset CommandInset ref
8947 reference "sec:fonts"
8952 Note that defining this font automatically defines the
8959 \begin_layout Description
8966 The font used for the label.
8967 See section\InsetSpace ~
8969 \begin_inset CommandInset ref
8971 reference "sec:fonts"
8976 Note that this definition can never appear before
8980 , lest it be ineffective (see above)
8983 \begin_layout Description
8990 The name of the corresponding LaTeX stuff.
8991 Either the environment or command name.
8994 \begin_layout Description
9001 The optional parameter for the corresponding
9007 stuff, including possible bracket pairs like
9012 This parameter cannot be changed from within LyX.
9015 \begin_layout Description
9022 See section\InsetSpace ~
9024 \begin_inset CommandInset ref
9026 reference "sec:style"
9033 \begin_layout Description
9037 Preamble\SpecialChar \ldots{}
9041 See section\InsetSpace ~
9043 \begin_inset CommandInset ref
9045 reference "sec:style"
9052 \begin_layout Description
9063 ] See section\InsetSpace ~
9065 \begin_inset CommandInset ref
9067 reference "sec:style"
9074 \begin_layout Subsection
9078 \begin_layout Standard
9079 \begin_inset CommandInset label
9085 Since version 1.3.0 of LyX, it is necessary to define the counters (
9093 , \SpecialChar \ldots{}
9094 ) in the text class itself.
9095 If you are looking here to learn how to upgrade an existing text class,
9096 it will probably turn out that all you have to do is to add
9099 \begin_layout LyX-Code
9100 Input stdcounters.inc
9103 \begin_layout Standard
9104 The following parameters can be used:
9107 \begin_layout Description
9119 \begin_inset Quotes erd
9123 \begin_inset Quotes erd
9126 ] The name of the counter.
9129 \begin_layout Description
9141 \begin_inset Quotes erd
9145 \begin_inset Quotes erd
9148 ] If this is set to the name of another counter, the present counter will
9149 be reset everytime the other one is increased.
9161 \begin_layout Description
9165 LabelString [string=""]
9168 when this is defined, this string defines how the counter is displayed.
9169 Setting this value resets
9174 The following special constructs can be used in the string:
9178 \begin_layout Itemize
9185 will be replaced by the expansion of the
9198 If these are empty, a default value is constructed as follows: if the counter
9199 has a master counter
9211 is used; otherwise the string
9220 \begin_layout Itemize
9221 counter values can be expressed using LaTeX-like macros
9245 \begin_layout Description
9256 to arabic numerals, like 1, 2, 3\SpecialChar \ldots{}
9261 \begin_layout Standard
9271 Actually, the situation is a bit more complicated than that: any
9290 other than those descibed below will produce arabic numerals.
9291 It would not be surprising to see this change in the future.
9299 \begin_layout Description
9306 for lower-case letters: a, b, c, \SpecialChar \ldots{}
9310 \begin_layout Description
9317 for upper-case letters: A, B, C, \SpecialChar \ldots{}
9321 \begin_layout Description
9328 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
9332 \begin_layout Description
9339 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
9343 \begin_layout Description
9350 for hebrew numerals.
9355 \begin_layout Description
9359 LabelStringAppendix [string=""]
9366 , for use in appendix.
9369 \begin_layout Subsection
9373 \begin_layout Standard
9374 \begin_inset CommandInset label
9380 A font description looks like that:
9383 \begin_layout LyX-Code
9393 \begin_layout LyX-Code
9397 \begin_layout LyX-Code
9401 \begin_layout Standard
9402 and the following commands are available:
9405 \begin_layout Description
9422 \begin_layout Description
9439 \begin_layout Description
9451 , Italic, SmallCaps, Slanted
9456 \begin_layout Description
9472 , large, larger, largest, huge, giant
9477 \begin_layout Description
9489 , black, white, red, green, blue, cyan, magenta, yellow
9494 \begin_layout Subsection
9495 Upgrading old layout files
9498 \begin_layout Standard
9499 The file format of layout files changes from time to time, so old layout
9500 files need to be converted.
9501 This process has been automated in LyX 1.4.0: If LyX reads an old format
9502 layout file it will call the conversion tool
9504 $LyXDir/scripts/layout2layout.py
9506 and convert it to a temporary file in current format.
9507 The original file is left untouched, so that you can still use it with
9509 If you want to convert the layout file permanently, just call the converter
9513 \begin_layout LyX-Code
9514 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
9517 \begin_layout Standard
9529 \begin_layout Standard
9530 The automatic conversion does only handle syntax changes.
9531 It cannot handle the case where the contents of included files was changed.
9532 For example, layout files based on
9545 If you get error messages about undefined counters, try to convert your
9565 \begin_layout Section
9567 \begin_inset CommandInset label
9569 name "sec:templates"
9576 \begin_layout Standard
9577 Templates are created just like usual documents.
9578 The only difference is that usual documents contain all possible settings,
9579 including the fontscheme and the papersize.
9580 Usually a user doesn't want a template to overwrite his defaults in these
9582 For that reason, the designer of a template should remove the corresponding
9595 from the template LyX file.
9596 This can be done with any simple text-editor, for example
9608 \begin_layout Standard
9609 Put the edited template files you create in
9613 , copy the ones you use from the global template directory in
9617 to the same place, and redefine the template path in the
9622 dit\SpecialChar \menuseparator
9641 \begin_layout Standard
9642 Note that there is a template which has a particular meaning:
9647 This template is loaded everytime you create a new document with
9654 \SpecialChar \menuseparator
9662 in order to provide useful defaults.
9663 To create this template from inside LyX, all you have to do is to open
9664 a document with the correct settings, and use the
9670 e as Document Defaults
9675 \begin_layout Chapter
9676 Including External Material
9679 \begin_layout Section
9683 \begin_layout Standard
9684 \begin_inset Note Note
9687 \begin_layout Standard
9688 This section is completely outdated.
9693 One often requested feature from LyX users is to be able to interface LyX
9694 with Xfig, Dia, or other similar applications that specialize in producing
9695 a certain kind of diagram, figure, schematic or whatever material might
9696 be relevant to include in your document.
9697 Previously, it was only possible to include boring, static, fixed images
9698 in LyX documents with the graphics feature, but there are several limitations
9699 attached to this approach:
9702 \begin_layout Itemize
9703 If you want to change the figure, you have to invoke an external program
9707 \begin_layout Itemize
9708 LyX does not notice that the referenced files change, so the on-screen display
9709 can fast become obsolete, and this is aggravated by the lack of a means
9710 of updating the display
9713 \begin_layout Itemize
9714 The graphics stuff does not provide any mechanisms for coping with different
9715 exported formats such as DocBook, HTML or plain text
9718 \begin_layout Standard
9719 The external material facility attempts to solve all of these problems
9723 \begin_layout Standard
9724 Even if the graphics facility can't solve all problems, it is still valuable
9725 because it does provide in-line preview of the graphics, and supports advanced
9726 geometric transformations with a comfortable user interface.
9732 It does this by offering a general method to interface LyX to external
9734 Instead of introducing a long list of different constructs tailored for
9735 each specific application, we chose to sacrifice the in-line displaying
9736 of the included material in order to provide a general construct to cover
9737 a wide range of applications.
9738 The result is the external material construct.
9739 External material presents itself in the document simply as a button, but
9740 don't let this fool you.
9741 When you click on it, a dialog will appear that allows you to chose exactly
9742 what material to include, and in the following sections you will learn
9743 that this is indeed a powerful mechanism that can solve all of the above
9747 \begin_layout Section
9751 \begin_layout Standard
9752 The external material feature is based on the concept of a
9757 A template is a specification of how LyX should interface with a certain
9759 As bundled, LyX comes with predefined templates for Xfig figures, Dia diagrams,
9760 various raster format images, gnuplot, and more.
9761 You can check the actual list by using the menu
9763 Insert\SpecialChar \menuseparator
9764 File\SpecialChar \menuseparator
9773 Furthermore, it is possible to roll your own template to support a specific
9775 Later we'll describe in more detail what is involved, and hopefully you
9776 will submit all the templates you create so we can include them in a later
9780 \begin_layout Standard
9781 Another basic idea of the external material feature is to distinguish between
9782 the original file that serves as a base for final material and the produced
9783 file that is included in your exported or printed document.
9784 For example, consider the case of a figure produced with
9789 The Xfig application itself works on an original file with the
9794 Within XFig, you create and change your figure, and when you are done,
9800 When you want to include the figure in your document, you invoke
9804 in order to create a PostScript file that can readily be included in your
9810 file is the original file, and the PostScript file is the produced file.
9813 \begin_layout Standard
9814 This distinction is important in order to allow updating of the material
9815 while you are in the process of writing the document.
9816 Furthermore, it provides us with the flexibility that is needed to support
9817 multiple export formats.
9818 For instance, in the case of a plain text file, it is not exactly an award-winn
9819 ing idea to include the figure as raw PostScript.
9820 Instead, you'd either prefer to just include a reference to the figure,
9821 or try to invoke some graphics to Ascii converter to make the final result
9822 look similar to the real graphics.
9823 The external material management allows you to do this, because it is parameter
9824 ized on the different export formats that LyX supports.
9827 \begin_layout Standard
9828 Besides supporting the production of different products according to the
9829 exported format, it supports tight integration with editing and viewing
9831 In the case of an XFig figure, you are able to invoke
9835 on the original file with a single click from within the external material
9836 dialog in LyX, and also preview the produced PostScript file with
9841 No more fiddling around with the command line and/or file browsers to locate
9842 and manipulate the original or produced files.
9843 In this way, you are finally able to take full advantage of the many different
9844 applications that are relevant to use when you write your documents, and
9845 ultimately be more productive.
9848 \begin_layout Section
9849 External material dialog
9852 \begin_layout Standard
9857 dialog is described in the
9866 \begin_layout Section
9870 \begin_layout Standard
9871 In this section, we should include some examples of use of the external
9873 Those examples could include:
9876 \begin_layout Itemize
9877 External raster images
9880 \begin_layout Itemize
9881 External XFig figures
9884 \begin_layout Itemize
9888 \begin_layout Itemize
9892 \begin_layout Itemize
9893 The use of makefiles
9896 \begin_layout Itemize
9897 Recursive external LyX templates
9900 \begin_layout Section
9901 The external template configuration file
9904 \begin_layout Standard
9905 It is relatively easy to add custom external template definitions to LyX.
9906 However, be aware this doing this in an careless manner most probably
9910 introduce an easily exploitable security hole.
9911 So before you do this, please read the discussion about security which
9915 \begin_layout Standard
9916 Having said that, we encourage you to submit any interesting templates that
9921 \begin_layout Standard
9922 The external templates are defined in the
9924 lib/external_templates
9927 You can place your own version in
9929 .lyx/external_templates
9934 \begin_layout Standard
9935 A typical template looks like this:
9938 \begin_layout LyX-Code
9942 \begin_layout LyX-Code
9943 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
9946 \begin_layout LyX-Code
9950 \begin_layout LyX-Code
9954 \begin_layout LyX-Code
9958 \begin_layout LyX-Code
9962 \begin_layout LyX-Code
9966 \begin_layout LyX-Code
9967 AutomaticProduction true
9970 \begin_layout LyX-Code
9974 \begin_layout LyX-Code
9978 \begin_layout LyX-Code
9982 \begin_layout LyX-Code
9983 TransformCommand Rotate RotationLatexCommand
9986 \begin_layout LyX-Code
9987 TransformCommand Resize ResizeLatexCommand
9990 \begin_layout LyX-Code
9991 Product "$$RotateFront$$ResizeFront
9994 \begin_layout LyX-Code
9999 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
10002 \begin_layout LyX-Code
10003 $$ResizeBack$$RotateBack"
10006 \begin_layout LyX-Code
10010 \begin_layout LyX-Code
10011 UpdateResult "$$AbsPath$$Basename.pstex_t"
10014 \begin_layout LyX-Code
10015 Requirement "graphicx"
10018 \begin_layout LyX-Code
10019 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
10022 \begin_layout LyX-Code
10023 ReferencedFile latex "$$AbsPath$$Basename.eps"
10026 \begin_layout LyX-Code
10027 ReferencedFile dvi "$$AbsPath$$Basename.eps"
10030 \begin_layout LyX-Code
10034 \begin_layout LyX-Code
10038 \begin_layout LyX-Code
10039 TransformCommand Rotate RotationLatexCommand
10042 \begin_layout LyX-Code
10043 TransformCommand Resize ResizeLatexCommand
10046 \begin_layout LyX-Code
10047 Product "$$RotateFront$$ResizeFront
10050 \begin_layout LyX-Code
10055 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
10058 \begin_layout LyX-Code
10059 $$ResizeBack$$RotateBack"
10062 \begin_layout LyX-Code
10063 UpdateFormat pdftex
10066 \begin_layout LyX-Code
10067 UpdateResult "$$AbsPath$$Basename.pdftex_t"
10070 \begin_layout LyX-Code
10071 Requirement "graphicx"
10074 \begin_layout LyX-Code
10075 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
10078 \begin_layout LyX-Code
10079 ReferencedFile latex "$$AbsPath$$Basename.pdf"
10082 \begin_layout LyX-Code
10086 \begin_layout LyX-Code
10090 \begin_layout LyX-Code
10091 Product "$$Contents(
10093 "$$AbsPath$$Basename.asc
10098 \begin_layout LyX-Code
10099 UpdateFormat asciixfig
10102 \begin_layout LyX-Code
10103 UpdateResult "$$AbsPath$$Basename.asc"
10106 \begin_layout LyX-Code
10110 \begin_layout LyX-Code
10114 \begin_layout LyX-Code
10115 Product "<graphic fileref=
10117 "$$AbsOrRelPathMaster$$Basename.eps
10122 \begin_layout LyX-Code
10126 \begin_layout LyX-Code
10130 \begin_layout LyX-Code
10131 UpdateResult "$$AbsPath$$Basename.eps"
10134 \begin_layout LyX-Code
10135 ReferencedFile docbook "$$AbsPath$$Basename.eps"
10138 \begin_layout LyX-Code
10139 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
10142 \begin_layout LyX-Code
10146 \begin_layout LyX-Code
10147 Product "[XFig: $$FName]"
10150 \begin_layout LyX-Code
10154 \begin_layout LyX-Code
10158 \begin_layout Standard
10159 As you can see, the template is enclosed in
10163 \SpecialChar \ldots{}
10169 It contains a header specifying some general settings, and for each supported
10170 primary document file format a section
10174 \SpecialChar \ldots{}
10182 \begin_layout Subsection
10183 The template header
10186 \begin_layout Description
10190 Template\InsetSpace ~
10194 A unique name for the template.
10195 It must not contain substitution macros (see below).
10198 \begin_layout Description
10202 GuiName\InsetSpace ~
10206 The text that is displayed on the button.
10207 This command must occur exactly once.
10210 \begin_layout Description
10214 HelpText\InsetSpace ~
10215 <text>\InsetSpace ~
10219 The help text that is used in the External dialog.
10220 Provide enough information to explain to the user just what the template
10221 can provide him with.
10222 This command must occur exactly once.
10225 \begin_layout Description
10229 InputFormat\InsetSpace ~
10233 The file format of the original file.
10234 This must be the name of a format that is known to LyX (see the
10239 ools\SpecialChar \menuseparator
10244 references:Conversion
10251 if the template can handle original files of more than one format.
10252 LyX will attempt to interrogate the file itself in order to deduce its
10253 format in this case.
10254 This command must occur exactly once.
10257 \begin_layout Description
10261 FileFilter\InsetSpace ~
10265 A glob pattern that is used in the file dialog to filter out the desired
10267 If there is more than one possible file extension (e.g.\InsetSpace ~
10276 ), use something like
10281 This command must occur exactly once.
10284 \begin_layout Description
10288 AutomaticProduction\InsetSpace ~
10292 Wether the file represented by the template must be generated by LyX.
10293 This command must occur exactly once.
10296 \begin_layout Description
10300 Transform\InsetSpace ~
10301 Rotate|Resize|Clip|Extra
10304 This command specifies which transformations are supported by this template.
10305 It may occur zero or more times.
10306 This command enables the corresponding tabs in the external dialog.
10311 command must have either a corresponding
10324 Otherwise the transformation will not be supported by that format.
10327 \begin_layout Subsection
10331 \begin_layout Description
10335 Format\InsetSpace ~
10336 LaTeX|PDFLaTeX|PlainText|DocBook
10339 The primary document file format that this format definition is for.
10340 Not every template has a sensible representation in all document file formats.
10341 Please define nevertheless a
10345 section for all formats.
10346 Use a dummy text when no representation is available.
10347 Then you can at least see a reference to the external material in the exported
10351 \begin_layout Description
10355 TransformCommand\InsetSpace ~
10356 Rotate\InsetSpace ~
10357 RotationLatexCommand
10360 This command specifies that the built in LaTeX command should be used for
10362 This command may occur once or not at all.
10365 \begin_layout Description
10369 TransformCommand\InsetSpace ~
10370 Resize\InsetSpace ~
10374 This command specifies that the built in LaTeX command should be used for
10376 This command may occur once or not at all.
10379 \begin_layout Description
10383 TransformOption\InsetSpace ~
10384 Rotate\InsetSpace ~
10385 RotationLatexOption
10388 This command specifies that rotation is done via an optional argument.
10389 This command may occur once or not at all.
10392 \begin_layout Description
10396 TransformOption\InsetSpace ~
10397 Resize\InsetSpace ~
10401 This command specifies that resizing is done via an optional argument.
10402 This command may occur once or not at all.
10405 \begin_layout Description
10409 TransformOption\InsetSpace ~
10414 This command specifies that clipping is done via an optional argument.
10415 This command may occur once or not at all.
10418 \begin_layout Description
10422 TransformOption\InsetSpace ~
10427 This command specifies that an extra optional argument is used.
10428 This command may occur once or not at all.
10431 \begin_layout Description
10435 Product\InsetSpace ~
10439 The text that is inserted in the exported document.
10440 This is actually the most important command and can be quite complex.
10441 This command must occur exactly once.
10444 \begin_layout Description
10448 UpdateFormat\InsetSpace ~
10452 The file format of the converted file.
10453 This must be the name of a format that is known to LyX (see the
10458 ools\SpecialChar \menuseparator
10463 references:Conversion
10466 This command must occur exactly once.
10469 \begin_layout Description
10473 UpdateResult\InsetSpace ~
10477 The file name of the converted file.
10478 The file name must be absolute.
10479 This command must occur exactly once.
10482 \begin_layout Description
10486 ReferencedFile\InsetSpace ~
10487 <format>\InsetSpace ~
10491 This command denotes files that are created by the conversion process and
10492 are needed for a particular export format.
10493 If the filename is relative, it is interpreted relative to the master document.
10494 This command may be given zero or more times.
10497 \begin_layout Description
10501 Requirement\InsetSpace ~
10505 The name of a required LaTeX package.
10506 The package is included via
10512 in the LaTeX preamble.
10513 This command may occur zero or more times.
10516 \begin_layout Description
10520 Preamble\InsetSpace ~
10524 This command specifies a preamble snippet that will be included in the
10526 It has to be defined using
10530 \SpecialChar \ldots{}
10536 This command may occur zero or more times.
10539 \begin_layout Description
10543 Option\InsetSpace ~
10544 <name>\InsetSpace ~
10548 This command defines an additional macro
10552 for substitution in
10561 itself may contain substitution macros.
10562 The advantage over using
10570 is that the substituted value of
10574 is sanitized so that it is a valid optional argument in the document format.
10575 This command may occur zero or more times.
10578 \begin_layout Subsection
10579 Preamble definitions
10582 \begin_layout Standard
10583 The external template configuration file may contain additional preamble
10584 definitions enclosed by
10588 \SpecialChar \ldots{}
10594 They can be used by the templates in the
10601 \begin_layout Section
10602 The substitution mechanism
10605 \begin_layout Standard
10606 When the external material facility invokes an external program, it is done
10607 on the basis of a command defined in the template configuration file.
10608 These commands can contain various macros that are expanded before execution.
10609 Execution always take place in the directory of the containing document.
10612 \begin_layout Standard
10613 Also, whenever external material is to be displayed, the name will be produced
10614 by the substitution mechanism, and most other commands in the template
10615 definition support substitution as well.
10618 \begin_layout Standard
10619 The available macros are the following:
10622 \begin_layout Description
10623 $$FName The filename of the file specified in the external material dialog.
10624 This is either an absolute name, or it is relative to the LyX document.
10627 \begin_layout Description
10628 $$Basename The filename without path and without the extension.
10631 \begin_layout Description
10632 $$Extension The file extension (including the dot).
10635 \begin_layout Description
10636 $$FPath The path part of
10640 (absolute name or relative to the LyX document).
10643 \begin_layout Description
10644 $$AbsPath The absolute file path.
10647 \begin_layout Description
10648 $$RelPathMaster The file path, relative to the master LyX document.
10651 \begin_layout Description
10652 $$RelPathParent The file path, relative to the LyX document.
10655 \begin_layout Description
10656 $$AbsOrRelPathMaster The file path, absolute or relative to the master LyX
10660 \begin_layout Description
10661 $$AbsOrRelPathParent The file path, absolute or relative to the LyX document.
10664 \begin_layout Description
10665 $$Tempname A name and full path to a temporary file which will be automatically
10666 deleted whenever the containing document is closed, or the external material
10670 \begin_layout Description
10672 \begin_inset Quotes eld
10676 \begin_inset Quotes erd
10679 ) This macro will expand to the contents of the file with the name
10686 \begin_layout Description
10687 $$Sysdir This macro will expand to the absolute path of the system directory.
10688 This is typically used to point to the various helper scripts that are
10692 \begin_layout Standard
10693 All path macros contain a trailing directory separator, so you can construct
10695 the absolute filename with
10697 $$AbsPath$$Basename$$Extension
10702 \begin_layout Standard
10703 The macros above are substituted in all commands unless otherwise noted.
10708 supports additionally the following substitutions if they are enabled by
10720 \begin_layout Description
10721 $$ResizeFront The front part of the resize command.
10724 \begin_layout Description
10725 $$ResizeBack The back part of the resize command.
10728 \begin_layout Description
10729 $$RotateFront The front part of the rotation command.
10732 \begin_layout Description
10733 $$RotateBack The back part of the rotation command.
10736 \begin_layout Standard
10737 The value string of the
10741 command supports additionally the following substitutions if they are enabled
10753 \begin_layout Description
10754 $$Clip The clip option.
10757 \begin_layout Description
10758 $$Extra The extra option.
10761 \begin_layout Description
10762 $$Resize The resize option.
10765 \begin_layout Description
10766 $$Rotate The rotation option.
10769 \begin_layout Standard
10770 You may ask why there are so many path macros.
10771 There are mainly two reasons:
10774 \begin_layout Standard
10775 First, relative and absolute file names should remain relative or absolute,
10777 Users may have reasons to prefer either form.
10778 Relative names are useful for portable documents that should work on different
10779 machines, for example.
10780 Absolute names may be required by some programs.
10783 \begin_layout Standard
10784 Second, LaTeX treats relative file names differently than LyX and other
10785 programs in nested included files.
10786 For LyX, a relative file name is always relative to the document that contains
10788 For LaTeX, it is always relative to the master document.
10789 These two definitions are identical if you have only one document, but
10790 differ if you have a master document that includes part documents.
10791 That means that relative filenames must be transformed when presented to
10793 Fortunately LyX does this automatically for you if you choose the right
10797 \begin_layout Standard
10798 So which path macro should be used in new template definitions? The rule
10802 \begin_layout Itemize
10807 if an absolute path is required.
10810 \begin_layout Itemize
10813 $$AbsOrRelPathMaster
10815 if the substituted string is some kind of LaTeX input.
10818 \begin_layout Itemize
10821 $$AbsOrRelPathParent
10823 in order to preserve the user's choice.
10826 \begin_layout Standard
10827 There are special cases where this rule does not work and e.g.\InsetSpace ~
10829 are needed, but normally it will work just fine.
10830 One example for such a case is the command
10832 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
10834 in the XFig template above: We can't use the absolute name because the
10839 files needs the relative name in order to rewrite the file content.
10842 \begin_layout Section
10843 Security discussion
10846 \begin_layout Standard
10847 \begin_inset Note Note
10850 \begin_layout Standard
10851 This section is outdated
10856 The external material feature interfaces with a lot of external programs
10857 and does so automatically, so we have to consider the security implications
10859 In particular, since you have the option of including your own filenames
10860 and/or parameter strings and those are expanded into a command, it seems
10861 that it would be possible to create a malicious document which executes
10862 arbitrary commands when a user views or prints the document.
10863 This is something we definately want to avoid.
10866 \begin_layout Standard
10867 However, since the external program commands are specified in the template
10868 configuration file only, there are no security issues if LyX is properly
10869 configured with safe templates only.
10870 This is so because the external programs are invoked with the
10874 -system call rather than the
10878 system-call, so it's not possible to execute arbitrary commands from the
10879 filename or parameter section via the shell.
10882 \begin_layout Standard
10883 This also implies that you are restricted in what command strings you can
10884 use in the external material templates.
10885 In particular, pipes and redirection are not readily available.
10886 This has to be so if LyX should remain safe.
10887 If you want to use some of the shell features, you should write a safe
10888 script to do this in a controlled manner, and then invoke the script from
10889 the command string.
10894 directory of the LyX installation, you can find a safe wrapper script
10896 general_command_wrapper.py
10898 that supports redirection of input and output.
10899 That can serve as an example for how to write safe template scripts.
10900 For a more advanced example that uses
10904 and friends, take a look at the
10911 \begin_layout Standard
10912 It is possible to design a template that interacts directly with the shell,
10913 but since this would allow a malicious user to execute arbitrary commands
10914 by writing clever filenames and/or parameters, we generally recommend that
10915 you only use safe scripts that work with the
10919 system call in a controlled manner.
10920 Of course, for use in a controlled environment, it can be tempting to just
10921 fall back to use ordinary shell scripts.
10922 If you do so, be aware that you
10926 provide an easily exploitable security hole in your system.
10927 Of course it stands to reason that such unsafe templates will never be
10928 included in the standard LyX distribution, although we do encourage people
10929 to submit new templates in the open source tradition.
10930 But LyX as shipped from the official distribution channels will never have
10934 \begin_layout Standard
10935 Including external material provides a lot of power, and you have to be
10936 careful not to introduce security hazards with this power.
10937 A subtle error in a single line in an innocent looking script can open
10938 the door to huge security problems.
10939 So if you do not fully understand the issues, we recommend that you consult
10940 a knowledgable security professional or the LyX development team if you
10941 have any questions about whether a given template is safe or not.
10942 And do this before you use it in an uncontrolled environment.
10945 \begin_layout Chapter
10949 \begin_layout Section
10953 \begin_layout Standard
10954 The LyX server is a method implemented in LyX that will enable other programs
10955 to talk to LyX, invoke LyX commands, and retrieve information about the
10956 LyX internal state.
10957 This is only intended for advanced users, but they should find it useful.
10960 \begin_layout Section
10961 Starting the LyX Server
10964 \begin_layout Standard
10965 The LyX server works through the use of a pair of named pipes.
10966 These are usually located in your home directory and have the names
10967 \begin_inset Quotes eld
10975 \begin_inset Quotes erd
10979 \begin_inset Quotes eld
10987 \begin_inset Quotes erd
10991 External programs write into
10995 and read back data from
11000 The stem of the pipe names can be defined in the
11005 ools\SpecialChar \menuseparator
11012 dialog, for example
11014 "/home/myhome/.lyxpipe"
11019 \begin_layout Standard
11028 ' to create the pipes.
11029 The above setting also has the effect of activating the LyX server.
11030 If one of the pipes already exists, LyX will assume that another LyX process
11031 is already running and will not start the server.
11032 To have several LyX processes with servers at the same time, you have to
11033 change the configuration between the start of the programs.
11036 \begin_layout Standard
11037 If you are developing a client program, you might find it useful to enable
11038 debugging information from the LyX server.
11039 Do this by starting LyX as
11041 lyx -dbg lyxserver.
11044 \begin_layout Standard
11045 Warning: if LyX crashes, it may not manage to remove the pipes; in this
11046 case you must remove them manually.
11047 If LyX starts and the pipes exist already, it will not start any server.
11050 \begin_layout Standard
11051 Other than this, there are a few points to consider:
11054 \begin_layout Itemize
11055 Both server and clients must run on UNIX or OS/2 machines.
11056 Communications between LyX on UNIX and clients on OS/2 or vice versa is
11057 not possible right now.
11060 \begin_layout Itemize
11061 On OS/2, only one client can connect to LyXServer at a time.
11064 \begin_layout Itemize
11065 On OS/2, clients must open inpipe with
11072 \begin_layout Standard
11073 You can find a complete example client written in C in the source distribution
11076 development/server_monitor.c
11081 \begin_layout Section
11082 Normal communication
11085 \begin_layout Standard
11086 To issue a LyX call, the client writes a line of ASCII text into the input
11088 This line has the following format:
11091 \begin_layout Quote
11105 \begin_layout Standard
11110 is a name that the client can choose arbitrarily.
11111 Its only use is that LyX will echo it if it sends an answer - so a client
11112 can dispatch results from different requesters.
11115 \begin_layout Standard
11120 is the function you want LyX to perform.
11121 It is the same as the commands you'd use in the minibuffer.
11124 \begin_layout Standard
11129 is an optional argument which is meaningful only to some functions (for
11131 \begin_inset Quotes eld
11135 \begin_inset Quotes erd
11138 which will insert the argument as text at the cursor position.)
11141 \begin_layout Standard
11142 The answer from LyX will arrive in the output pipe and be of the form
11145 \begin_layout Quote
11159 \begin_layout Standard
11168 are just echoed from the command request, while
11172 is more or less useful information filled according to how the command
11173 execution worked out.
11174 Some commands will return information about the internal state of LyX,
11176 \begin_inset Quotes eld
11180 \begin_inset Quotes erd
11183 , while other will return an empty data-response.
11184 This means that the command execution went fine.
11187 \begin_layout Standard
11188 In case of errors, the response from LyX will have this form
11191 \begin_layout Quote
11205 \begin_layout Standard
11210 should contain an explanation of why the command failed.
11213 \begin_layout Standard
11217 \begin_layout LyX-Code
11218 echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
11221 \begin_layout LyX-Code
11222 echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
11224 read a <~/.lyxpipe.out
11229 \begin_layout Section
11233 \begin_layout Standard
11234 LyX can notify clients of events going on asynchronously.
11235 Currently it will only do this if the user binds a key sequence with the
11237 \begin_inset Quotes eld
11241 \begin_inset Quotes erd
11245 The format of the string LyX sends is as follows:
11248 \begin_layout Quote
11257 \begin_layout Standard
11262 is the printed representation of the key sequence that was actually typed
11266 \begin_layout Standard
11267 This mechanism can be used to extend LyX's command set and implement macros:
11268 bind some key sequence to
11269 \begin_inset Quotes eld
11273 \begin_inset Quotes erd
11276 , start a client that listens on the out pipe, dispatches the command according
11277 to the sequence and starts a function that may use LyX calls and LyX requests
11278 to issue a command or a series of commands to LyX.
11281 \begin_layout Section
11282 The simple LyX Server Protocol
11285 \begin_layout Standard
11286 LyX implements a simple protocol that can be used for session management.
11287 All messages are of the form
11290 \begin_layout Quote
11300 \begin_layout Standard
11306 \begin_inset Quotes eld
11310 \begin_inset Quotes erd
11314 \begin_inset Quotes eld
11318 \begin_inset Quotes erd
11323 \begin_inset Quotes eld
11327 \begin_inset Quotes erd
11330 is received from a client, LyX will report back to inform the client that
11331 it's listening to it's messages, while
11332 \begin_inset Quotes eld
11336 \begin_inset Quotes erd
11339 sent from LyX will inform clients that LyX is closing.
11342 \begin_layout Chapter
11347 \begin_layout Standard
11348 This appendix is a huge cross-reference to all the English language keybindings.
11349 Originally, we simply wanted to list all of the key bindings followed by
11350 the function it's bound to.
11351 That way, a user can look up a key to find out what it does.
11352 We then decided, what the hey, why not include the default toolbar and
11353 menu bindings, too.
11354 Please note this section is likely to be very out of date.
11357 \begin_layout Standard
11358 The form is really self-explanatory, but here are a few tips: all entries
11359 are arranged roughly alphabetically for a given modifier (
11368 For the general keyboard layout, simpler prefixes precede the more complex
11378 All entries were gleaned from the default user interface and binding files
11379 located in the directories
11381 \SpecialChar \ldots{}
11386 \SpecialChar \ldots{}
11389 ; they should be treated as the final word on the bindings.
11392 \begin_layout Standard
11393 As a final note, be aware that some window managers (such as FVWM) take
11394 control of some of the function keys or motion keys.
11399 is listed here as generating
11403 , but FVWM grabs it and uses it to change virtual desktops instead.
11404 Very annoying unless you instruct your window manager to stop intercepting
11408 \begin_layout Section
11412 \begin_layout LyX-Code
11416 \begin_layout LyX-Code
11420 \begin_layout LyX-Code
11424 \begin_layout LyX-Code
11425 Icon "buffer-write"
11428 \begin_layout LyX-Code
11429 Icon "buffer-print"
11432 \begin_layout LyX-Code
11436 \begin_layout LyX-Code
11440 \begin_layout LyX-Code
11444 \begin_layout LyX-Code
11448 \begin_layout LyX-Code
11452 \begin_layout LyX-Code
11456 \begin_layout LyX-Code
11460 \begin_layout LyX-Code
11464 \begin_layout LyX-Code
11468 \begin_layout LyX-Code
11472 \begin_layout LyX-Code
11476 \begin_layout LyX-Code
11480 \begin_layout LyX-Code
11481 Icon "footnote-insert"
11484 \begin_layout LyX-Code
11485 Icon "marginpar-insert"
11488 \begin_layout LyX-Code
11492 \begin_layout LyX-Code
11496 \begin_layout LyX-Code
11497 Icon "figure-insert"
11500 \begin_layout LyX-Code
11501 Icon "dialog-tabular-insert"
11504 \begin_layout LyX-Code
11508 \begin_layout Section
11512 \begin_layout Standard
11513 Note that the following bindings are for LyX with English menus.
11514 The second character of the binding depends on the menu language.
11516 \begin_inset Quotes eld
11524 \begin_inset Quotes erd
11527 is with German menus
11528 \begin_inset Quotes eld
11536 \begin_inset Quotes erd
11540 To find out the shortcuts of your language press the Meta (Alt)-key and
11541 press then the keys of the underlined characters of the menu names.
11544 \begin_layout Subsection
11549 \labelwidthstring 00.00.0000
11561 \labelwidthstring 00.00.0000
11573 \labelwidthstring 00.00.0000
11585 \labelwidthstring 00.00.0000
11599 \labelwidthstring 00.00.0000
11611 \labelwidthstring 00.00.0000
11625 \labelwidthstring 00.00.0000
11637 \labelwidthstring 00.00.0000
11649 \labelwidthstring 00.00.0000
11661 \labelwidthstring 00.00.0000
11673 \labelwidthstring 00.00.0000
11681 buffer-new-template
11685 \labelwidthstring 00.00.0000
11700 \labelwidthstring 00.00.0000
11711 \labelwidthstring 00.00.0000
11722 \labelwidthstring 00.00.0000
11733 \labelwidthstring 00.00.0000
11744 \labelwidthstring 00.00.0000
11755 \labelwidthstring 00.00.0000
11767 \labelwidthstring 00.00.0000
11778 \begin_layout Subsection
11783 \labelwidthstring 00.00.0000
11795 \labelwidthstring 00.00.0000
11807 \labelwidthstring 00.00.0000
11819 \labelwidthstring 00.00.0000
11831 \labelwidthstring 00.00.0000
11843 \labelwidthstring 00.00.0000
11855 \labelwidthstring 00.00.0000
11870 \labelwidthstring 00.00.0000
11877 tabular-feature append-row
11881 \labelwidthstring 00.00.0000
11888 tabular-feature toggle-line-bottom
11892 \labelwidthstring 00.00.0000
11899 tabular-feature align-center
11903 \labelwidthstring 00.00.0000
11910 tabular-feature delete-column
11914 \labelwidthstring 00.00.0000
11921 tabular-feature align-left
11925 \labelwidthstring 00.00.0000
11932 tabular-feature align-right
11936 \labelwidthstring 00.00.0000
11943 tabular-feature toggle-line-left
11947 \labelwidthstring 00.00.0000
11954 tabular-feature multicolumn
11958 \labelwidthstring 00.00.0000
11965 tabular-feature valign-center
11969 \labelwidthstring 00.00.0000
11976 tabular-feature valign-top
11980 \labelwidthstring 00.00.0000
11987 tabular-feature toggle-line-right
11991 \labelwidthstring 00.00.0000
11998 tabular-feature toggle-line-top
12002 \labelwidthstring 00.00.0000
12009 tabular-feature append-column
12013 \labelwidthstring 00.00.0000
12020 tabular-feature valign-bottom
12024 \labelwidthstring 00.00.0000
12031 tabular-feature delete-row
12036 \labelwidthstring 00.00.0000
12049 \labelwidthstring 00.00.0000
12056 floats-operate openfoot
12060 \labelwidthstring 00.00.0000
12067 floats-operate closefoot
12071 \labelwidthstring 00.00.0000
12078 floats-operate openfig
12082 \labelwidthstring 00.00.0000
12093 \labelwidthstring 00.00.0000
12104 \labelwidthstring 00.00.0000
12111 floats-operate closefig
12116 \labelwidthstring 00.00.0000
12128 \labelwidthstring 00.00.0000
12142 \labelwidthstring 00.00.0000
12154 \labelwidthstring 00.00.0000
12166 \labelwidthstring 00.00.0000
12180 \labelwidthstring 00.00.0000
12192 \labelwidthstring 00.00.0000
12207 \labelwidthstring 00.00.0000
12214 primary-selection-paste
12218 \labelwidthstring 00.00.0000
12225 primary-selection-paste paragraph
12229 \begin_layout Subsection
12234 \labelwidthstring 00.00.0000
12249 \labelwidthstring 00.00.0000
12256 buffer-float-insert algorithm
12260 \labelwidthstring 00.00.0000
12267 buffer-float-insert wide-tab
12271 \labelwidthstring 00.00.0000
12278 buffer-float-insert figure
12282 \labelwidthstring 00.00.0000
12289 buffer-float-insert table
12293 \labelwidthstring 00.00.0000
12300 buffer-float-insert wide-fig
12305 \labelwidthstring 00.00.0000
12313 dialog-tabular-insert
12317 \labelwidthstring 00.00.0000
12329 \labelwidthstring 00.00.0000
12341 \labelwidthstring 00.00.0000
12349 buffer-child-insert
12353 \labelwidthstring 00.00.0000
12365 \labelwidthstring 00.00.0000
12377 \labelwidthstring 00.00.0000
12389 \labelwidthstring 00.00.0000
12401 \labelwidthstring 00.00.0000
12413 \labelwidthstring 00.00.0000
12425 \labelwidthstring 00.00.0000
12437 \labelwidthstring 00.00.0000
12452 \labelwidthstring 00.00.0000
12463 \labelwidthstring 00.00.0000
12474 \labelwidthstring 00.00.0000
12485 \labelwidthstring 00.00.0000
12496 \labelwidthstring 00.00.0000
12507 \labelwidthstring 00.00.0000
12519 \labelwidthstring 00.00.0000
12531 \labelwidthstring 00.00.0000
12546 \labelwidthstring 00.00.0000
12553 protected-space-insert
12557 \labelwidthstring 00.00.0000
12564 end-of-sentence-period-insert
12568 \labelwidthstring 00.00.0000
12579 \labelwidthstring 00.00.0000
12590 \labelwidthstring 00.00.0000
12601 \labelwidthstring 00.00.0000
12608 menu-separator-insert
12612 \labelwidthstring 00.00.0000
12619 hyphenation-point-insert
12623 \labelwidthstring 00.00.0000
12634 \labelwidthstring 00.00.0000
12641 command-sequence math-insert ^;math-mode;
12645 \labelwidthstring 00.00.0000
12652 command-sequence math-insert _;math-mode;
12657 \labelwidthstring 00.00.0000
12672 \labelwidthstring 00.00.0000
12679 file-insert-plaintext lines
12683 \labelwidthstring 00.00.0000
12690 file-insert-plaintext paragraphs
12694 \labelwidthstring 00.00.0000
12706 \labelwidthstring 00.00.0000
12718 \labelwidthstring 00.00.0000
12730 \labelwidthstring 00.00.0000
12741 \begin_layout Subsection
12746 \labelwidthstring 00.00.0000
12758 \labelwidthstring 00.00.0000
12770 \labelwidthstring 00.00.0000
12782 \labelwidthstring 00.00.0000
12794 \labelwidthstring 00.00.0000
12806 \labelwidthstring 00.00.0000
12818 \labelwidthstring 00.00.0000
12830 \labelwidthstring 00.00.0000
12842 \labelwidthstring 00.00.0000
12850 layout-save-default
12854 \labelwidthstring 00.00.0000
12866 \labelwidthstring 00.00.0000
12878 \labelwidthstring 00.00.0000
12889 \begin_layout Subsubsection
12892 Layout\SpecialChar \menuseparator
12899 \labelwidthstring 00.00.0000
12911 \labelwidthstring 00.00.0000
12923 \labelwidthstring 00.00.0000
12935 \labelwidthstring 00.00.0000
12947 \labelwidthstring 00.00.0000
12959 \labelwidthstring 00.00.0000
12971 \labelwidthstring 00.00.0000
12983 \labelwidthstring 00.00.0000
12995 \labelwidthstring 00.00.0000
13007 \labelwidthstring 00.00.0000
13019 \labelwidthstring 00.00.0000
13031 \labelwidthstring 00.00.0000
13043 \labelwidthstring 00.00.0000
13055 \labelwidthstring 00.00.0000
13067 \labelwidthstring 00.00.0000
13079 \labelwidthstring 00.00.0000
13091 \labelwidthstring 00.00.0000
13103 \labelwidthstring 00.00.0000
13115 \labelwidthstring 00.00.0000
13127 \labelwidthstring 00.00.0000
13139 \labelwidthstring 00.00.0000
13151 \labelwidthstring 00.00.0000
13163 \labelwidthstring 00.00.0000
13175 \labelwidthstring 00.00.0000
13187 \labelwidthstring 00.00.0000
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
13282 \begin_layout Subsection
13286 \begin_layout Subsection
13290 \begin_layout Subsection
13294 \begin_layout Subsection
13299 \labelwidthstring 00.00.0000
13311 \labelwidthstring 00.00.0000
13323 \labelwidthstring 00.00.0000
13335 \labelwidthstring 00.00.0000
13347 \labelwidthstring 00.00.0000
13359 \labelwidthstring 00.00.0000
13367 layout ShortFoilhead
13371 \labelwidthstring 00.00.0000
13383 \labelwidthstring 00.00.0000
13395 \labelwidthstring 00.00.0000
13407 \labelwidthstring 00.00.0000
13419 \labelwidthstring 00.00.0000
13427 layout ShortRotatefoilhead
13431 \labelwidthstring 00.00.0000
13443 \labelwidthstring 00.00.0000
13455 \labelwidthstring 00.00.0000
13467 \labelwidthstring 00.00.0000
13475 drop-layouts-choice
13479 \labelwidthstring 00.00.0000
13494 \labelwidthstring 00.00.0000
13509 \labelwidthstring 00.00.0000
13521 \labelwidthstring 00.00.0000
13533 \labelwidthstring 00.00.0000
13541 layout Subsubsection
13545 \labelwidthstring 00.00.0000
13557 \labelwidthstring 00.00.0000
13565 layout Subparagraph
13569 \labelwidthstring 00.00.0000
13573 asterisk\InsetSpace ~
13582 \labelwidthstring 00.00.0000
13586 asterisk\InsetSpace ~
13595 \labelwidthstring 00.00.0000
13599 asterisk\InsetSpace ~
13608 \labelwidthstring 00.00.0000
13612 asterisk\InsetSpace ~
13621 \labelwidthstring 00.00.0000
13625 asterisk\InsetSpace ~
13630 layout Subsubsection*
13634 \labelwidthstring 00.00.0000
13638 asterisk\InsetSpace ~
13647 \labelwidthstring 00.00.0000
13651 asterisk\InsetSpace ~
13656 layout Subparagraph*
13660 \labelwidthstring 00.00.0000
13672 \labelwidthstring 00.00.0000
13680 layout Bibliography
13684 \labelwidthstring 00.00.0000
13696 \labelwidthstring 00.00.0000
13708 \labelwidthstring 00.00.0000
13720 \labelwidthstring 00.00.0000
13732 \labelwidthstring 00.00.0000
13744 \labelwidthstring 00.00.0000
13752 layout Rotatefoilhead
13756 \labelwidthstring 00.00.0000
13764 layout RightAddress
13768 \labelwidthstring 00.00.0000
13780 \labelwidthstring 00.00.0000
13792 \labelwidthstring 00.00.0000
13804 \labelwidthstring 00.00.0000
13815 \begin_layout Standard
13816 These ones are kept for backwards compatibility, but only make sense on
13821 \labelwidthstring 00.00.0000
13833 \labelwidthstring 00.00.0000
13841 layout Subsubsection*
13845 \labelwidthstring 00.00.0000
13856 \begin_layout Section
13860 \begin_layout Subsection
13867 \labelwidthstring 00.00.0000
13878 \labelwidthstring 00.00.0000
13889 \labelwidthstring 00.00.0000
13900 \labelwidthstring 00.00.0000
13911 \labelwidthstring 00.00.0000
13922 \labelwidthstring 00.00.0000
13933 \labelwidthstring 00.00.0000
13940 hyphenation-point-insert
13944 \labelwidthstring 00.00.0000
13955 \labelwidthstring 00.00.0000
13962 line-delete-forward
13966 \labelwidthstring 00.00.0000
13977 \labelwidthstring 00.00.0000
13988 \labelwidthstring 00.00.0000
13999 \labelwidthstring 00.00.0000
14010 \labelwidthstring 00.00.0000
14021 \labelwidthstring 00.00.0000
14032 \labelwidthstring 00.00.0000
14043 \labelwidthstring 00.00.0000
14054 \labelwidthstring 00.00.0000
14065 \labelwidthstring 00.00.0000
14076 \labelwidthstring 00.00.0000
14087 \labelwidthstring 00.00.0000
14098 \labelwidthstring 00.00.0000
14110 \labelwidthstring 00.00.0000
14122 \labelwidthstring 00.00.0000
14134 \labelwidthstring 00.00.0000
14146 \labelwidthstring 00.00.0000
14159 \labelwidthstring 00.00.0000
14171 \labelwidthstring 00.00.0000
14183 \labelwidthstring 00.00.0000
14195 \labelwidthstring 00.00.0000
14207 \labelwidthstring 00.00.0000
14220 \labelwidthstring 00.00.0000
14232 \labelwidthstring 00.00.0000
14244 \labelwidthstring 00.00.0000
14257 \labelwidthstring 00.00.0000
14270 \labelwidthstring 00.00.0000
14283 \labelwidthstring 00.00.0000
14296 \labelwidthstring 00.00.0000
14309 \labelwidthstring 00.00.0000
14322 \labelwidthstring 00.00.0000
14334 \labelwidthstring 00.00.0000
14346 \labelwidthstring 00.00.0000
14358 \labelwidthstring 00.00.0000
14366 menu-open Documents
14370 \labelwidthstring 00.00.0000
14382 \labelwidthstring 00.00.0000
14394 \labelwidthstring 00.00.0000
14406 \labelwidthstring 00.00.0000
14418 \labelwidthstring 00.00.0000
14430 \labelwidthstring 00.00.0000
14438 buffer-toggle-read-only
14442 \labelwidthstring 00.00.0000
14454 \labelwidthstring 00.00.0000
14466 \labelwidthstring 00.00.0000
14478 \labelwidthstring 00.00.0000
14489 \labelwidthstring 00.00.0000
14500 \labelwidthstring 00.00.0000
14511 \labelwidthstring 00.00.0000
14522 \labelwidthstring 00.00.0000
14533 \labelwidthstring 00.00.0000
14544 \labelwidthstring 00.00.0000
14555 \labelwidthstring 00.00.0000
14566 \labelwidthstring 00.00.0000
14577 \labelwidthstring 00.00.0000
14588 \labelwidthstring 00.00.0000
14599 \labelwidthstring 00.00.0000
14610 \labelwidthstring 00.00.0000
14621 \labelwidthstring 00.00.0000
14632 \labelwidthstring 00.00.0000
14639 word-delete-forward
14643 \labelwidthstring 00.00.0000
14650 word-delete-backward
14654 \labelwidthstring 00.00.0000
14665 \labelwidthstring 00.00.0000
14672 end-of-sentence-period-insert
14676 \labelwidthstring 00.00.0000
14683 protected-space-insert
14687 \labelwidthstring 00.00.0000
14698 \labelwidthstring 00.00.0000
14709 \labelwidthstring 00.00.0000
14720 \labelwidthstring 00.00.0000
14731 \labelwidthstring 00.00.0000
14742 \labelwidthstring 00.00.0000
14753 \labelwidthstring 00.00.0000
14760 buffer-begin-select
14764 \labelwidthstring 00.00.0000
14775 \labelwidthstring 00.00.0000
14782 paragraph-up-select
14786 \labelwidthstring 00.00.0000
14793 paragraph-down-select
14797 \labelwidthstring 00.00.0000
14804 word-backward-select
14808 \labelwidthstring 00.00.0000
14815 word-forward-select
14819 \labelwidthstring 00.00.0000
14830 \labelwidthstring 00.00.0000
14837 word-delete-forward
14841 \labelwidthstring 00.00.0000
14852 \labelwidthstring 00.00.0000
14863 \labelwidthstring 00.00.0000
14874 \labelwidthstring 00.00.0000
14885 \labelwidthstring 00.00.0000
14892 break-paragraph-keep-layout
14896 \labelwidthstring 00.00.0000
14906 \begin_layout Subsection
14913 \labelwidthstring 00.00.0000
14924 \labelwidthstring 00.00.0000
14935 \labelwidthstring 00.00.0000
14946 \labelwidthstring 00.00.0000
14957 \labelwidthstring 00.00.0000
14968 \labelwidthstring 00.00.0000
14979 \labelwidthstring 00.00.0000
14990 \labelwidthstring 00.00.0000
15001 \labelwidthstring 00.00.0000
15012 \labelwidthstring 00.00.0000
15023 \labelwidthstring 00.00.0000
15034 \labelwidthstring 00.00.0000
15045 \labelwidthstring 00.00.0000
15056 \labelwidthstring 00.00.0000
15067 \labelwidthstring 00.00.0000
15078 \labelwidthstring 00.00.0000
15089 \labelwidthstring 00.00.0000
15100 \labelwidthstring 00.00.0000
15111 \labelwidthstring 00.00.0000
15122 \labelwidthstring 00.00.0000
15133 \labelwidthstring 00.00.0000
15144 \labelwidthstring 00.00.0000
15155 \labelwidthstring 00.00.0000
15162 protected-space-insert
15166 \labelwidthstring 00.00.0000
15177 \labelwidthstring 00.00.0000
15188 \labelwidthstring 00.00.0000
15199 \labelwidthstring 00.00.0000
15206 buffer-new-template
15210 \labelwidthstring 00.00.0000
15221 \labelwidthstring 00.00.0000
15232 \labelwidthstring 00.00.0000
15243 \labelwidthstring 00.00.0000
15254 \labelwidthstring 00.00.0000
15265 \labelwidthstring 00.00.0000
15276 \labelwidthstring 00.00.0000
15287 \labelwidthstring 00.00.0000
15294 end-of-sentence-period-insert
15298 \labelwidthstring 00.00.0000
15309 \labelwidthstring 00.00.0000
15320 \labelwidthstring 00.00.0000
15327 hyphenation-point-insert
15331 \labelwidthstring 00.00.0000
15342 \labelwidthstring 00.00.0000
15349 protected-space-insert
15353 \labelwidthstring 00.00.0000
15364 \labelwidthstring 00.00.0000
15375 \labelwidthstring 00.00.0000
15386 \labelwidthstring 00.00.0000
15397 \labelwidthstring 00.00.0000
15408 \labelwidthstring 00.00.0000
15419 \labelwidthstring 00.00.0000
15430 \labelwidthstring 00.00.0000
15441 \labelwidthstring 00.00.0000
15452 \labelwidthstring 00.00.0000
15463 \labelwidthstring 00.00.0000
15474 \labelwidthstring 00.00.0000
15485 \labelwidthstring 00.00.0000
15496 \labelwidthstring 00.00.0000
15507 \labelwidthstring 00.00.0000
15518 \labelwidthstring 00.00.0000
15525 word-delete-forward
15529 \labelwidthstring 00.00.0000
15536 word-delete-backward
15540 \labelwidthstring 00.00.0000
15551 \labelwidthstring 00.00.0000
15562 \labelwidthstring 00.00.0000
15573 \labelwidthstring 00.00.0000
15584 \labelwidthstring 00.00.0000
15591 paragraph-down-select
15595 \labelwidthstring 00.00.0000
15606 \labelwidthstring 00.00.0000
15613 buffer-begin-select
15617 \labelwidthstring 00.00.0000
15624 word-backward-select
15628 \labelwidthstring 00.00.0000
15635 word-forward-select
15639 \labelwidthstring 00.00.0000
15646 paragraph-up-select
15650 \labelwidthstring 00.00.0000
15661 \labelwidthstring 00.00.0000
15668 break-paragraph-keep-layout
15672 \labelwidthstring 00.00.0000
15683 \labelwidthstring 00.00.0000
15694 \labelwidthstring 00.00.0000
15705 \labelwidthstring 00.00.0000
15716 \labelwidthstring 00.00.0000
15727 \labelwidthstring 00.00.0000
15738 \labelwidthstring 00.00.0000
15749 \labelwidthstring 00.00.0000
15760 \labelwidthstring 00.00.0000
15771 \labelwidthstring 00.00.0000
15782 \labelwidthstring 00.00.0000
15792 \begin_layout Subsection
15798 \begin_layout Standard
15799 These are LyX keyboard definitions for mathematics, similar to those of
15803 \begin_layout Standard
15804 The bindings file and the present documentation were prepared by Serge Winitzki
15805 with assistance from Jean-Marc Lasgouttes.
15806 Version 1.3, for LyX 1.2.x and 1.3.x.
15809 \begin_layout Standard
15810 These definitions make it a lot easier to type equations without using the
15811 mouse, especially for people familiar with Scientific Word.
15812 The standard LyX bindings such as
15823 \begin_layout Standard
15824 Tip: to find the "LyX bind name" for a key, look at the status bar after
15825 typing some non-existent key combination.
15827 to find how "Ctrl-&" is referenced, press Ctrl-S and then Ctrl-&: the status
15828 bar shows "C-s S-C-ampersand." (This does not work in LyX 1.3.0!)
15832 \labelwidthstring 00.00.0000
15841 -- Copy, cut, paste is as in Sciword,
15857 \labelwidthstring 00.00.0000
15866 -- Display equation toggle: type
15870 to insert a displayed formula (
15875 \begin_inset Quotes eld
15879 \begin_inset Quotes erd
15887 in a displayed formula to convert it back to an inline formula.
15891 \labelwidthstring 00.00.0000
15906 to insert a fraction (
15911 \begin_inset Quotes eld
15915 \begin_inset Quotes erd
15919 You can also select an expression and type
15923 to convert it to the numerator of a fraction.
15932 end of the denominator will delete the numerator and convert the denominator
15937 \labelwidthstring 00.00.0000
15949 \begin_inset Formula $\int$
15957 \begin_inset Quotes eld
15961 \begin_inset Quotes erd
15968 \labelwidthstring 00.00.0000
15975 line-delete-forward
15977 -- Emacs-like binding: delete forward of cursor to end of line.
15981 \labelwidthstring 00.00.0000
15990 -- A text/math toggle (
15995 \begin_inset Quotes eld
15999 \begin_inset Quotes erd
16002 ): switches to math in text mode, and also inserts roman text in math mode.
16012 \begin_inset Quotes eld
16016 \begin_inset Quotes erd
16023 \labelwidthstring 00.00.0000
16032 -- Add/remove numbering in a single equation.
16036 \labelwidthstring 00.00.0000
16045 -- Add/remove numbering at a line in equation arrays.
16048 \begin_layout Standard
16049 The above commands are toggles that control the numbering of equations (
16054 \begin_inset Quotes eld
16058 \begin_inset Quotes erd
16062 Note: when deleting a number in a labeled eqnarray, the label is not really
16063 removed (the TeX code becomes
16064 \begin_inset Quotes eld
16076 \begin_inset Quotes erd
16079 ) and this generates a (harmless) LaTeX warning.
16083 \labelwidthstring 00.00.0000
16092 -- Open a new document.
16097 \labelwidthstring 00.00.0000
16106 -- Insert a quote character " (
16111 \begin_inset Quotes eld
16115 \begin_inset Quotes erd
16120 \begin_inset Quotes eld
16124 \begin_inset Quotes erd
16127 double quote character that you get by default.
16131 \labelwidthstring 00.00.0000
16142 -- Square root sign
16143 \begin_inset Formula $\sqrt{x}$
16151 \begin_inset Quotes eld
16155 \begin_inset Quotes erd
16162 \labelwidthstring 00.00.0000
16174 \begin_inset Formula $\sqrt[n]{x}$
16181 \labelwidthstring 00.00.0000
16190 -- Another binding for a switch between the text and the math mode (
16195 \begin_inset Quotes eld
16199 \begin_inset Quotes erd
16203 Note that the roman text inserted in math mode is special.
16207 \labelwidthstring 00.00.0000
16220 the selected text (text mode only, use things like
16236 \labelwidthstring 00.00.0000
16245 -- W*ndows heritage.
16249 \labelwidthstring 00.00.0000
16258 -- Close the current document (again, a W*ndows heritage).
16262 \labelwidthstring 00.00.0000
16273 \labelwidthstring 00.00.0000
16284 \labelwidthstring 00.00.0000
16294 \begin_inset Quotes eld
16298 \begin_inset Quotes erd
16302 \begin_inset Quotes eld
16306 \begin_inset Quotes erd
16312 \begin_layout Standard
16313 Bracket delimiters: press
16317 -<bracket key> to insert a matching pair of delimiters.
16322 inserts a pair of parentheses
16323 \begin_inset Formula $\left[\right]$
16331 does the same thing.) It will switch to math mode if needed.
16332 The supported characters are ( [ { < |.
16333 It is the same to press the right or the left bracket.
16334 The corresponding delimiters are
16335 \begin_inset Formula $\left(\right)$
16339 \begin_inset Formula $\left[\right]$
16343 \begin_inset Formula $\left\{ \right\} $
16347 \begin_inset Formula $\left\langle \right\rangle $
16351 \begin_inset Formula $\left|\right|$
16356 \begin_inset Quotes eld
16360 \begin_inset Quotes erd
16363 and resize with their contents.
16364 Use Math Panel to get other or non-matching delimiters.
16365 Press backspace on the
16369 delimiter to remove both
16370 \begin_inset Quotes eld
16374 \begin_inset Quotes erd
16377 delimiters without removing their contents.
16381 \labelwidthstring 00.00.0000
16390 -- for convenience, pressing
16404 \labelwidthstring 00.00.0000
16415 \labelwidthstring 00.00.0000
16426 \labelwidthstring 00.00.0000
16437 \labelwidthstring 00.00.0000
16448 \labelwidthstring 00.00.0000
16459 \labelwidthstring 00.00.0000
16466 math-delim langle rangle
16468 -- angular delimiters
16469 \begin_inset Formula $\left\langle \right\rangle $
16472 , not to confuse with ordinary < > signs.
16476 \labelwidthstring 00.00.0000
16483 math-delim langle rangle
16486 \begin_layout Standard
16487 The bar bracket: on some keyboards (e.g.\InsetSpace ~
16488 some British ones), the bar character
16493 -something and on some wayward Unices to "brokenbar".
16494 So we define all of these keys as well.
16498 \labelwidthstring 00.00.0000
16509 \labelwidthstring 00.00.0000
16520 \labelwidthstring 00.00.0000
16531 \labelwidthstring 00.00.0000
16542 \labelwidthstring 00.00.0000
16552 \begin_layout Standard
16553 Accents are in most cases
16557 -<accent key>, e.g.\InsetSpace ~
16571 for tilde (you also need to press
16577 \begin_inset Quotes eld
16589 \begin_inset Quotes erd
16593 Some accents work only in math mode and others only in text mode.
16597 \labelwidthstring 00.00.0000
16606 -- overdot accent, ȧ (text mode only).
16610 \labelwidthstring 00.00.0000
16622 \begin_inset Formula $\dot{a}$
16625 (math mode only -- in physics this denotes a first derivative).
16629 \labelwidthstring 00.00.0000
16640 -- Vector accent over math
16641 \begin_inset Formula $\overrightarrow{x}$
16648 \labelwidthstring 00.00.0000
16657 -- umlaut accent, ä (text mode only)
16661 \labelwidthstring 00.00.0000
16672 -- double dot accent,
16673 \begin_inset Formula $\ddot{a}$
16676 (math mode only -- in physics this denotes a second derivative).
16677 To get a triple dot in math mode, use
16685 \labelwidthstring 00.00.0000
16694 -- grave accent à (text mode only, use
16704 \labelwidthstring 00.00.0000
16713 -- tilde accent ã (text mode only, use
16723 \labelwidthstring 00.00.0000
16732 -- acute accent á (text mode only, use
16742 \labelwidthstring 00.00.0000
16751 -- circumflex (caret) accent â (text mode only, use
16760 \begin_layout Standard
16762 The new key S-F2 for creating a LaTeX file seems handy.
16766 \labelwidthstring 00.00.0000
16775 -- Save current document.
16779 \labelwidthstring 00.00.0000
16786 buffer-export latex
16788 -- Write a LaTeX file for the current document.
16792 \labelwidthstring 00.00.0000
16801 -- Find and replace dialog.
16805 \labelwidthstring 00.00.0000
16822 \labelwidthstring 00.00.0000
16835 to quit LyX is the W*ndows w*ndow manager's mnemonic.
16838 \begin_layout Standard
16847 are used to switch fonts.
16852 to switch back to the normal font.
16853 The non-default font switches
16861 all work as toggles.
16862 They also work on the whole word if you put the cursor in the middle of
16863 the word, or if you select some text.
16867 \labelwidthstring 00.00.0000
16876 -- stop using any special font
16880 \labelwidthstring 00.00.0000
16897 \labelwidthstring 00.00.0000
16914 \labelwidthstring 00.00.0000
16931 \labelwidthstring 00.00.0000
16945 (Used sometimes for people's names.)
16948 \begin_layout Standard
16954 \begin_inset Quotes eld
16958 \begin_inset Quotes erd
16965 key (useful e.g.\InsetSpace ~
16966 if the keyboard has no working
16973 \begin_layout Standard
16974 Here are some Sciword-inspired mnemonics for frequently used math symbols.
16975 Many symbols start with a
16984 cannot be itself bound to anything.
16988 \labelwidthstring 00.00.0000
17000 \begin_inset Quotes eld
17004 \begin_inset Quotes erd
17008 \begin_inset Formula $\prime$
17012 This is frequently unnecessary: in most cases the normal apostrophe works
17015 \begin_inset Formula $x'+2x=0$
17018 , but in some cases this would generate a double superscript error in LaTeX.
17020 \begin_inset Formula $x^{\prime2}$
17024 \begin_inset Formula $x$
17027 prime squared) must be entered with the prime character.
17031 \labelwidthstring 00.00.0000
17039 command-sequence math-superscript; math-insert
17043 -- Insert a prime as a superscript (see example above).
17047 \labelwidthstring 00.00.0000
17056 -- Insert an upper index.
17063 \labelwidthstring 00.00.0000
17072 -- Insert a lower index.
17079 \labelwidthstring 00.00.0000
17091 -- Partial derivative symbol
17092 \begin_inset Formula $\partial$
17099 \labelwidthstring 00.00.0000
17111 -- Summation symbol
17112 \begin_inset Formula $\sum$
17115 (not the same as the Greek letter uppercase Sigma
17116 \begin_inset Formula $\Sigma$
17119 because it can resize and allows smart upper/lower limits).
17123 \labelwidthstring 00.00.0000
17136 \begin_inset Formula $\prod$
17139 (not the same as the Greek letter uppercase Pi,
17140 \begin_inset Formula $\Pi$
17147 \labelwidthstring 00.00.0000
17160 \begin_inset Formula $\infty$
17167 \labelwidthstring 00.00.0000
17180 \begin_inset Formula $\times$
17187 \labelwidthstring 00.00.0000
17197 -- Insert a stacked array
17198 \begin_inset Formula $\begin{array}{c}
17200 \end{array}\end{array}$
17204 (Frequently useful in formulae.)
17208 \labelwidthstring 00.00.0000
17219 \begin_inset Formula $\times$
17223 \begin_inset Formula $\begin{array}{ccc}
17228 (Then you can modify its size using the
17230 Edit\SpecialChar \menuseparator
17237 \labelwidthstring 00.00.0000
17250 \begin_inset Quotes eld
17254 \begin_inset Quotes erd
17258 \begin_inset Formula $\dagger$
17265 \labelwidthstring 00.00.0000
17278 \begin_inset Quotes eld
17282 \begin_inset Quotes erd
17286 \begin_inset Formula $\equiv$
17293 \labelwidthstring 00.00.0000
17305 \begin_inset Quotes eld
17308 Approximate equality
17309 \begin_inset Quotes erd
17313 \begin_inset Formula $\approx$
17320 \labelwidthstring 00.00.0000
17332 \begin_inset Quotes eld
17336 \begin_inset Quotes erd
17340 \begin_inset Formula $\sim$
17347 \labelwidthstring 00.00.0000
17359 \begin_inset Formula $\rightarrow$
17363 \begin_inset Formula $\lim_{x\rightarrow0}$
17370 \labelwidthstring 00.00.0000
17382 \begin_inset Formula $\leq$
17389 \labelwidthstring 00.00.0000
17400 -- Greater-or-equal
17401 \begin_inset Formula $\geq$
17408 \labelwidthstring 00.00.0000
17421 \begin_inset Quotes eld
17425 \begin_inset Quotes erd
17429 \begin_inset Formula $\ll$
17432 (useful in physics)
17436 \labelwidthstring 00.00.0000
17449 \begin_inset Quotes eld
17453 \begin_inset Quotes erd
17457 \begin_inset Formula $\gg$
17463 \begin_layout Subsection
17464 Standard math bindings
17468 \labelwidthstring 00.00.0000
17482 \labelwidthstring 00.00.0000
17494 \labelwidthstring 00.00.0000
17506 \labelwidthstring 00.00.0000
17520 \labelwidthstring 00.00.0000
17532 \labelwidthstring 00.00.0000
17544 \labelwidthstring 00.00.0000
17558 \labelwidthstring 00.00.0000
17570 \labelwidthstring 00.00.0000
17582 \labelwidthstring 00.00.0000
17594 \labelwidthstring 00.00.0000
17608 \labelwidthstring 00.00.0000
17622 \labelwidthstring 00.00.0000
17636 \labelwidthstring 00.00.0000
17650 \labelwidthstring 00.00.0000
17664 \labelwidthstring 00.00.0000
17678 \labelwidthstring 00.00.0000
17690 \labelwidthstring 00.00.0000
17704 \labelwidthstring 00.00.0000
17716 \labelwidthstring 00.00.0000
17728 \labelwidthstring 00.00.0000
17740 \labelwidthstring 00.00.0000
17752 \labelwidthstring 00.00.0000
17766 \labelwidthstring 00.00.0000
17778 \labelwidthstring 00.00.0000
17790 \labelwidthstring 00.00.0000
17802 \labelwidthstring 00.00.0000
17810 math-delim langle rangle
17814 \labelwidthstring 00.00.0000
17822 math-delim rangle langle
17826 \labelwidthstring 00.00.0000
17838 \labelwidthstring 00.00.0000
17852 \labelwidthstring 00.00.0000
17865 \begin_layout Subsection
17870 \labelwidthstring 00.00.0000
17882 \labelwidthstring 00.00.0000
17894 \labelwidthstring 00.00.0000
17906 \labelwidthstring 00.00.0000
17918 \labelwidthstring 00.00.0000