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
5820 \begin_inset CommandInset label
5822 name "sub:Layout-modules"
5829 \begin_layout Standard
5830 Similar to layout files, and new with LyX 1.6, are layout
5835 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5836 some modules---such as the Endnotes module---provide support for just such
5838 In a sense, layout modules are similar to included files---files like stdsectio
5839 ns.inc---in that modules are not specific to a given document layout but
5840 may be used with many different layouts.
5841 The difference is that using a layout module does not require editing the
5843 Rather, modules are selected in the
5848 ocument\SpecialChar \menuseparator
5858 \begin_layout Standard
5859 Building modules is the easiest way to get started with layout editing,
5860 since it can be as simple as adding a single new paragraph or flex inset.
5861 But modules may, in principle, contain anything a layout file can contain.
5864 \begin_layout Standard
5865 A module must begin with a line like the following:
5868 \begin_layout LyX-Code
5871 DeclareLyXModule[endnotes.sty]{Endnotes}
5874 \begin_layout Standard
5875 The argument in square brackets is optional: It declares any LaTeX packages
5876 on which the module depends.
5877 The mandatory argument, in curly brackets, is the name of the module, as
5880 Document\SpecialChar \menuseparator
5884 LyX uses the name to identify the module, so it should be unique.
5887 \begin_layout Standard
5888 The module declaration should then be followed by lines like the following:
5891 \begin_layout LyX-Code
5895 \begin_layout LyX-Code
5896 #Adds an endnote command, in addition to footnotes.
5900 \begin_layout LyX-Code
5901 #You will need to add
5903 theendnotes in ERT where you
5906 \begin_layout LyX-Code
5907 #want the endnotes to appear.
5911 \begin_layout LyX-Code
5915 \begin_layout LyX-Code
5916 #Requires: somemodule | othermodule
5919 \begin_layout LyX-Code
5920 #Excludes: badmodule
5923 \begin_layout Standard
5924 The description is used in
5926 Document\SpecialChar \menuseparator
5929 to provide the user with information about what the module does.
5930 The Requires is used to identify other modules with which this one must
5931 be used; the Excludes line is used to identify modules with which this
5932 one may not be used.
5933 Both are optional, and, as shown, multiple modules should be separated
5934 with the pipe symbol: |.
5935 Note that the required modules are treated disjunctively:
5939 of the required modules must be used.
5944 excluded module may be used.
5945 Note that modules are identified here by their
5949 without the .module extension.
5951 \begin_inset Flex CharStyle:Code
5954 \begin_layout Standard
5961 \begin_inset Flex CharStyle:Code
5964 \begin_layout Standard
5973 \begin_layout Standard
5974 After creating a new module, you will need to reconfigure and then restart
5975 LyX for it to appear in the menu.
5976 However, changes you make to the module will be seen immediately, if you
5979 Document\SpecialChar \menuseparator
5982 , highlight something, and then hit
5983 \begin_inset Quotes eld
5987 \begin_inset Quotes erd
5993 It is strongly recommended that you save your work before doing so
5996 In fact, it is strongly recommended that you not attempt to edit modules
5997 while simultaneously working on documents.
5998 Though of course the developers strive to keep LyX stable in such situations,
5999 syntax errors and the like in your module file could cause strange behavior.
6002 \begin_layout Subsection
6003 Supporting new document classes
6006 \begin_layout Standard
6007 There are two situations you are likely to encounter when wanting to support
6008 a new LaTeX document class, involving LaTeX2e class (
6017 Supporting a style file is usually fairly easy.
6018 Supporting a new document class is a bit harder.
6021 \begin_layout Subsection
6029 \begin_layout Standard
6030 If your new document class is provided as a style file that is used in conjuncti
6031 on with an existing, supported document class---for the sake of the example,
6032 we'll assume that the style file is called
6036 and it is meant to be used with
6040 , which is a standard class---start by copying the existing class's layout
6041 file into your local directory:
6044 \begin_layout LyX-Code
6045 cp report.layout ~/.lyx/layouts/myclass.layout
6048 \begin_layout Standard
6053 and change the line:
6056 \begin_layout LyX-Code
6059 DeclareLaTeXClass{report}
6062 \begin_layout Standard
6066 \begin_layout LyX-Code
6069 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6072 \begin_layout Standard
6076 \begin_layout LyX-Code
6086 \begin_layout Standard
6087 near the top of the file.
6090 \begin_layout Standard
6091 Start LyX and select
6096 ools\SpecialChar \menuseparator
6104 Then restart LyX and try creating a new document.
6109 " as a document class option in the
6114 ocument\SpecialChar \menuseparator
6122 It is likely that some of the sectioning commands and such in your new
6123 class will work differently from how they worked in the base class---
6127 in this example---so you can fiddle around with the settings for the different
6128 sections if you wish.
6129 See below for more discussion on this.
6132 \begin_layout Subsection
6140 \begin_layout Standard
6141 There are two possibilities here.
6142 One is that the class file is itself based upon an existing document class.
6143 For example, many thesis classes are based upon
6148 To see whether yours is, look for a line like
6151 \begin_layout LyX-Code
6157 \begin_layout Standard
6159 If so, then you may proceed largely as in the previous section, though
6160 the DeclareLaTeXClass line will be different.
6161 If your new class is thesis, and it is based upon book, then the line should
6165 \begin_layout LyX-Code
6168 DeclareLaTeXClass[myclass, book]{thesis}
6171 \begin_layout Standard
6172 If, on the other hand, the new class is not based upon an existing class,
6173 you will probably have to
6174 \begin_inset Quotes eld
6178 \begin_inset Quotes erd
6182 We strongly suggest copying an existing layout file which uses a similar
6183 LaTeX class and then modifying it, if you can do so.
6184 At least use an existing file as a starting point so you can find out what
6185 items you need to worry about.
6186 Again, the specifics are covered below.
6189 \begin_layout Section
6190 Declaring a new text class
6193 \begin_layout Standard
6194 When it's finally time to get your hands dirty and create or edit your own
6195 layout file, the following sections describe what you're up against.
6196 Our advice is to go slowly, save and test often, listen to soothing music,
6197 and enjoy one or two of your favorite adult beverages; more if you are
6198 getting particularly stuck.
6199 It's really not that hard, except that the multitude of options can become
6200 overwhelming if you try to do to much in one sitting.
6201 Go have another adult beverage, just for good measure.
6204 \begin_layout Standard
6208 \begin_layout Standard
6209 Lines in a layout file which begin with a
6214 There is one exception to this rule: all layouts should begin with lines
6218 \begin_layout LyX-Code
6221 #% Do not delete the line below; configure depends on this
6224 \begin_layout LyX-Code
6229 DeclareLaTeXClass{article}
6232 \begin_layout Standard
6233 The second line is used when you configure LyX.
6234 The layout file is read by the LaTeX script
6238 , in a special mode where
6243 The first line is just a LaTeX comment, and the second one contains the
6244 declaration of the text class.
6245 If these lines appear in a file named
6249 , then they define a text class of name
6253 (the name of the layout file) which uses the LaTeX document class
6257 (the default is to use the same name as the layout).
6259 \begin_inset Quotes eld
6263 \begin_inset Quotes erd
6266 that appears above is used as a description of the text class in the
6271 ocument\SpecialChar \menuseparator
6281 \begin_layout Standard
6282 Let's assume that you wrote your own text class that uses the
6286 documentclass, but where you changed the appearance of the section headings.
6287 If you put it in a file
6291 , the header of this file should be:
6294 \begin_layout LyX-Code
6297 #% Do not delete the line below; configure depends on this
6300 \begin_layout LyX-Code
6305 DeclareLaTeXClass[article]{article (with my own headings)}
6308 \begin_layout Standard
6309 This declares a text class
6313 , associated with the LaTeX document class
6318 \begin_inset Quotes eld
6321 article (with my own headings)
6322 \begin_inset Quotes erd
6326 If your text class depends on several packages, you can declare it as:
6329 \begin_layout LyX-Code
6332 #% Do not delete the line below; configure depends on this
6335 \begin_layout LyX-Code
6340 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6343 \begin_layout Standard
6344 This indicates that your text class uses the foo.sty package.
6345 Finally, it is also possible to declare classes for DocBook code.
6346 Typical declarations will look like
6349 \begin_layout LyX-Code
6352 #% Do not delete the line below; configure depends on this
6355 \begin_layout LyX-Code
6360 DeclareDocBookClass[article]{SGML (DocBook article)}
6363 \begin_layout Standard
6364 Note that these declarations can also be given an optional parameter declaring
6365 the name of the document class (but not a list).
6368 \begin_layout Standard
6369 When the text class has been modified to your taste, all you have to do
6370 is to copy it either in
6383 ools\SpecialChar \menuseparator
6391 Exit LyX and restart it; then your new text class should be available along
6395 \begin_layout Standard
6396 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6397 you made to your layout files.
6398 As a result, editing layout files could be very time consuming.
6399 Beginning with 1.6, however, you can force a reload of the layout currently
6400 in use by using the LyX function
6405 There is no default binding for this function---though, of course, you
6406 can bind it to a key yourself (see section
6407 \begin_inset CommandInset ref
6409 reference "sec:bindings"
6414 You should simply enter this command in the mini-buffer.
6419 : This is very much an `advanced feature'.
6424 recommended that you save your work before using this function.
6429 recommended that you not attempt to edit your layout while simultaneously
6430 working on a document that you care about.
6431 Use a test document.
6432 Syntax errors and the like in your layout file could cause peculiar behavior.
6433 In particular, such errors could cause LyX to regard the current layout
6434 as invalid and to attempt to switch to some other layout.
6435 The LyX team strives to keep LyX stable in such situations, but safe is
6439 \begin_layout Subsection
6443 \begin_layout Standard
6444 The first non-comment line must contain the file format number:
6447 \begin_layout Description
6458 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6459 don't have an explicit file format).
6460 The file format that is documented here is
6467 \begin_layout Subsection
6468 General text class parameters
6471 \begin_layout Standard
6472 These are the general parameters which describe the form of the entire document:
6475 \begin_layout Standard
6479 \begin_layout Standard
6491 \begin_layout Description
6505 ] Whether the class-default should have one or two columns.
6506 Can be changed in the
6511 ocument\SpecialChar \menuseparator
6519 This setting (same goes for
6523 , too) is important: if your text class has two columns by default but you
6524 forget to set it correctly, the
6532 be output when you select
6541 ocument\SpecialChar \menuseparator
6549 \begin_layout Description
6563 ] Whether the class-default should be printing on one or both sides of the
6565 Can be changed in the
6570 ocument\SpecialChar \menuseparator
6580 \begin_layout Description
6594 ] The class default pagestyle.
6595 Can be changed in the
6600 ocument\SpecialChar \menuseparator
6610 \begin_layout Description
6614 ClassOptions\SpecialChar \ldots{}
6618 This section describes various global options supported by the document
6620 See Section\InsetSpace ~
6622 \begin_inset CommandInset ref
6624 reference "sec:classoptions"
6631 \begin_layout Description
6649 ] Whether the class already provides the feature
6654 A feature is in general the name of a package (amsmath, makeidx, \SpecialChar \ldots{}
6656 macro (url, boldsymbol,\SpecialChar \ldots{}
6657 ); the complete list of supported features is unfortunat
6661 \begin_layout Description
6672 ] Whether the class requires the feature
6677 A feature is in general the name of a package (amsmath, makeidx, \SpecialChar \ldots{}
6679 macro (url, boldsymbol,\SpecialChar \ldots{}
6681 Multiple features must be separated by commas.
6682 Note that you can only request supported features; unfortunately, the complete
6683 list of supported features is not documented (however,
6688 elp\SpecialChar \menuseparator
6695 gives an overview of the supported packages).
6698 \begin_layout Description
6705 This is used to describe the default font of the document.
6706 See Section\InsetSpace ~
6708 \begin_inset CommandInset ref
6710 reference "sec:fonts"
6717 \begin_layout Description
6728 ] This is the style that will be assigned to new paragraphs, usually
6733 This will default to the first defined style if not given, but you are
6734 highly encouraged to use this directive.
6737 \begin_layout Description
6754 ] Indicates what kind of markup is used to define the title of a document.
6759 means that the macro with name
6763 will be inserted after the last layout which has
6764 \begin_inset Quotes eld
6772 \begin_inset Quotes erd
6780 corresponds to the case where the block of paragraphs which have
6781 \begin_inset Quotes eld
6789 \begin_inset Quotes erd
6792 should be enclosed into the
6801 \begin_layout Description
6812 ] The name of the command/environment mentionned above.
6815 \begin_layout Description
6819 Preamble\SpecialChar \ldots{}
6823 A set of macro definitions that will be output at the beginning of the
6825 Use this for global definitions.
6828 \begin_layout Description
6835 As its name implies, this command allows you to include another layout
6836 definition file within yours to avoid duplicating commands.
6837 Common examples are the standard layout files, for example,
6841 , which contains most of the basic layouts.
6844 \begin_layout Description
6848 Style\SpecialChar \ldots{}
6852 This sequence defines a new style.
6853 If the style already exists, it will redefine some of its parameters instead.
6854 See Section\InsetSpace ~
6856 \begin_inset CommandInset ref
6858 reference "sec:style"
6865 \begin_layout Description
6872 This command deletes an existing style.
6873 This is particularly useful when you want to suppress a style that has
6874 be defined in an input file.
6877 \begin_layout Description
6881 Float\SpecialChar \ldots{}
6885 This sequence defines a new float.
6886 See Section\InsetSpace ~
6888 \begin_inset CommandInset ref
6890 reference "sec:floats"
6897 \begin_layout Description
6904 This command deletes an existing float.
6905 This is particularly useful when you want to suppress a float that has
6906 be defined in an input file.
6909 \begin_layout Description
6913 InsetLayout\SpecialChar \ldots{}
6917 This section (re-)defines the layout of an inset.
6918 It can be applied to an existing inset of to a new, user-defined inset,
6919 e.g., a new character style.
6920 See Section\InsetSpace ~
6922 \begin_inset CommandInset ref
6924 reference "sec:charstyle"
6931 \begin_layout Description
6935 Counter\SpecialChar \ldots{}
6939 This sequence defines a new counter.
6940 See Section\InsetSpace ~
6942 \begin_inset CommandInset ref
6944 reference "sec:counter"
6951 \begin_layout Standard
6955 \begin_layout Standard
6967 \begin_layout Subsection
6975 \begin_layout Standard
6976 \begin_inset CommandInset label
6978 name "sec:classoptions"
6986 section can contain the following entries:
6989 \begin_layout Description
7000 ] The list of available font sizes for the document's main font, separated
7002 \begin_inset Quotes eld
7010 \begin_inset Quotes erd
7016 \begin_layout Description
7025 string="empty|plain|headings|fancy"
7027 ] The list of available page styles, separated by
7028 \begin_inset Quotes eld
7036 \begin_inset Quotes erd
7042 \begin_layout Description
7053 ] Some document class options, separated by a comma, that will be added
7054 to the optional part of the
7063 \begin_layout Subsection
7064 Specific Paragraph Layouts
7067 \begin_layout Standard
7068 \begin_inset CommandInset label
7074 A paragraph layout description looks like this
7078 \begin_layout Standard
7079 Note that this will either define a new layout or modify an existing one.
7087 \begin_layout LyX-Code
7094 \begin_layout LyX-Code
7098 \begin_layout LyX-Code
7102 \begin_layout Standard
7103 where the following commands are allowed:
7106 \begin_layout Standard
7110 \begin_layout Standard
7122 \begin_layout Description
7133 This is used to copy all the features of an existing layout into the current
7138 \begin_layout Description
7150 , Command, Environment, Item_Environment,
7156 ] How the layout should be translated into LaTeX.
7161 means nothing special.
7174 {\SpecialChar \ldots{}
7189 }\SpecialChar \ldots{}
7213 is generated for each paragraph of this environment.
7226 is passed as an argument to the environment.
7231 can be defined in the
7236 ayout\SpecialChar \menuseparator
7250 is perhaps a bit misleading, since these rules apply to SGML classes, too.
7251 Visit the SGML class files for specific examples.
7254 \begin_layout Description
7265 If 1, marks the layout as being part of a title block (see also the
7276 \begin_layout Description
7283 The name of the corresponding LaTeX stuff.
7284 Either the environment or command name.
7287 \begin_layout Description
7294 The optional parameter for the corresponding
7301 This parameter cannot be changed from within LyX.
7304 \begin_layout Description
7315 ] The number of optional arguments that can be used with this layout.
7316 This is useful for things like section headings, and only makes sense with
7320 \begin_layout Description
7332 , Manual, Dynamic, First_Dynamic, Right_Address_Box
7336 The kind of margin that the layout has on the left side.
7341 just means a fixed margin.
7346 means that the left margin depends on the string entered in the
7351 dit\SpecialChar \menuseparator
7356 aragraph\InsetSpace ~
7360 This is used to typeset nice lists without tabulators.
7365 means that the margin depends on the size of the label.
7366 This is used for automatic enumerated headlines.
7367 It is obvious that the headline
7368 \begin_inset Quotes eld
7371 5.4.3.2.1 Very long headline
7372 \begin_inset Quotes erd
7375 must have a wider left margin (as wide as
7376 \begin_inset Quotes eld
7380 \begin_inset Quotes erd
7383 plus the space) than
7384 \begin_inset Quotes eld
7387 3.2 Very long headline
7388 \begin_inset Quotes erd
7391 , even if other word processors are not able to do this.
7396 is similar, but only the very first row of the paragraph is dynamic, while
7397 the others are static; this is used, for example, for descriptions.
7402 means the margin is chosen in a way that the longest row of this paragraph
7403 fits to the right margin.
7404 This is used to typeset an address on the right edge of the page.
7407 \begin_layout Description
7424 ] Whether the following Paragraph is allowed to indent its very first row.
7429 means that it is not allowed to do so,
7433 means it could do so if it wants to.
7436 \begin_layout Description
7447 ] The indent of the very first line of a paragraph.
7448 The argument is passed as a string.
7453 means that the paragraph is indented with the width of
7462 You can get a negative width by prefixing the string with
7467 This way was chosen so that the look is the same with each used screen
7473 will be fixed for a certain layout.
7474 The exception is Standard layout, since the indentation of a Standard layout
7475 paragraph can be prohibited with
7480 Also, Standard layout paragraphs inside environments use the
7484 of the environment, not their native one.
7485 For example, Standard paragraphs inside an enumeration are not indented.
7488 \begin_layout Description
7499 ] LyX allows to choose either
7500 \begin_inset Quotes eld
7504 \begin_inset Quotes erd
7508 \begin_inset Quotes eld
7512 \begin_inset Quotes erd
7515 to typeset a document.
7517 \begin_inset Quotes eld
7521 \begin_inset Quotes erd
7524 is chosen, this value is completely ignored.
7526 \begin_inset Quotes eld
7530 \begin_inset Quotes erd
7533 is chosen, the parindent of a LaTeXtype
7534 \begin_inset Quotes eld
7538 \begin_inset Quotes erd
7541 layout is ignored and all paragraphs are additionally separated by this
7543 The vertical space is calculated with
7545 value*DefaultHeight()
7551 is the height of a row with the normal font.
7552 This way, the look stays the same with different screen fonts.
7555 \begin_layout Description
7566 ] The vertical space with which the very first of a chain of paragraphs
7567 with this layout is separated from the previous paragraph.
7568 If the previous paragraph has another layout, the separations are not simply
7569 added, but the maximum is taken.
7572 \begin_layout Description
7587 for the very last paragraph.
7590 \begin_layout Description
7601 ] The vertical space between two paragraphs of this layout.
7604 \begin_layout Description
7615 ] This is an extra space between the paragraphs of an environment layout.
7616 If you put other layouts into an environment, each is separated with the
7622 But the whole items of the environment are additionally separated with
7631 \begin_layout Description
7642 ] If you put layouts into environments, the leftmargins are not simply added,
7643 but added with a factor
7644 \begin_inset Formula $\frac{4}{depth+4}$
7648 Note that this parameter is also used when the border is defined as
7657 Then it is added to the manual or dynamic border.
7658 This string has the same meaning as for
7665 \begin_layout Description
7683 \begin_layout Description
7695 , Manual, Static, Top_Environment,
7697 Centered_Top_Environment, Sensitive,
7706 means the label is the very first word (up to the first real blank).
7711 means it is defined in the layout (see
7722 Centered_Top_Environment
7724 are special cases of
7729 The label will be printed above the paragraph, but only at the top of an
7730 environment or the top of a chain of paragraphs with this layout.
7731 Usage is for example the
7740 This is also the case for
7744 labels with latex type
7748 , in order to make layouts for theorems work correctly.
7753 is a special case for the caption-labels
7754 \begin_inset Quotes eld
7758 \begin_inset Quotes erd
7762 \begin_inset Quotes eld
7766 \begin_inset Quotes erd
7774 means the (hardcoded) label string depends on the kind of float.
7779 label type defines automatically numbered labels.
7782 \begin_layout Description
7795 The name of the counter for automatic numbering (see Section\InsetSpace ~
7797 \begin_inset CommandInset ref
7799 reference "sec:counter"
7804 This must be given if
7817 \begin_layout Description
7828 ] The horizontal space between the label and the text body.
7829 Only used for labels that are not above the text body.
7832 \begin_layout Description
7839 [float=0] The vertical space between the label and the text body.
7840 Only used for labels that are above the text body (
7846 Centered_Top_Environment
7851 \begin_layout Description
7862 ] The string used for a label with a
7871 this string is also used as a suggestion for the
7875 that can be set in the
7880 dit\SpecialChar \menuseparator
7885 aragraph\InsetSpace ~
7895 is set, this string can be contain the special formatting commands described
7896 in Section\InsetSpace ~
7898 \begin_inset CommandInset ref
7900 reference "sec:counter"
7905 For the sake of backwards compatibility, the string
7913 will be replaced by the expanded
7924 This feature is now obsolete and should be replaced by the mechanisms of
7925 Section\InsetSpace ~
7927 \begin_inset CommandInset ref
7929 reference "sec:counter"
7936 \begin_layout Description
7947 ] This is used inside the appendix instead of
7968 \begin_layout Description
7975 The level of the style in the table of contents.
7976 This is used for automatic numbering of section headings.
7979 \begin_layout Description
7991 , Box, Filled_Box, Static
7993 ] The type of label that stands at the end of the paragraph (or sequence
8016 \begin_inset Quotes eld
8020 \begin_inset Quotes erd
8032 ) is a white (resp.\InsetSpace ~
8033 black) square suitable for end of proof markers,
8037 is an explicit text string.
8040 \begin_layout Description
8051 ] The string used for a label with a
8063 \begin_layout Description
8075 , left, right, center
8077 ] Paragraph alignment.
8080 \begin_layout Description
8092 , left, right, center
8099 Some LaTeX styles prohibit certain alignments, since those wouldn't make
8101 For example a right-aligned or centered enumeration isn't possible.
8104 \begin_layout Description
8118 ] With this parameter the
8123 \begin_inset Quotes eld
8126 Vertical space above
8127 \begin_inset Quotes erd
8135 dit\SpecialChar \menuseparator
8140 aragraph\InsetSpace ~
8143 dialog can be set when initializing a paragraph with this layout
8147 \begin_layout Standard
8150 Note from Jean-Marc:
8152 I'm not sure that this setting has much use, and it should probably be
8153 removed in later versions.
8162 \begin_layout Description
8183 \begin_layout Description
8197 ] Whether fragile commands in this layout should be
8206 \begin_layout Description
8223 ] Whether newlines are translated into LaTeX newlines (
8232 The translation can be switched off to allow more comfortable LaTeX editing
8236 \begin_layout Description
8250 ] Whether the contents of this paragraph should be output in raw form, meaning
8251 without special translations that LaTeX would require.
8252 This somehow replaces the older
8259 \begin_layout Description
8273 ] Usually LyX doesn't allow you to insert more than one space between words,
8274 since a space is considered as the separation between two words, not a
8275 character or symbol of its own.
8276 This is a very fine thing but sometimes annoying, for example when typing
8277 program code or plain LaTeX code.
8283 Note that LyX will create protected blanks for the additional blanks when
8284 in another mode than LaTeX-mode.
8287 \begin_layout Description
8301 ] Usually LyX does not allow you to leave a paragraph empty, since it would
8302 lead to empty LaTeX output.
8303 There are some cases where this could be desirable however: in a letter
8304 template, the required fields can be provided as empty fields, so that
8305 people do not forget them; in some special classes, a layout can be used
8306 as some kind of break, which does not contain actual text.
8309 \begin_layout Description
8321 , onehalf, double, other
8327 ] This defines what the default spacing should be in the layout.
8340 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
8341 If you specify the argument
8345 , then you should also provide a numerical argument which will be the actual
8347 Note that, contrary to other parameters,
8351 implies the generation of specific LaTeX code, using the package
8358 \begin_layout Description
8365 The font used for both the text body
8370 See section\InsetSpace ~
8372 \begin_inset CommandInset ref
8374 reference "sec:fonts"
8379 Note that defining this font automatically defines the
8386 \begin_layout Description
8393 The font used for the text body .
8394 See section\InsetSpace ~
8396 \begin_inset CommandInset ref
8398 reference "sec:fonts"
8405 \begin_layout Description
8412 The font used for the label.
8413 See section\InsetSpace ~
8415 \begin_inset CommandInset ref
8417 reference "sec:fonts"
8424 \begin_layout Description
8428 Preamble\SpecialChar \ldots{}
8432 A set of macro definitions that will be output at the beginning of the
8433 LaTeX files when the layout is used.
8434 Use this to define the macros needed by this particular layout.
8437 \begin_layout Description
8448 ] Whether the layout requires the feature
8453 A feature is in general the name of a package (amsmath, makeidx, \SpecialChar \ldots{}
8455 macro (url, boldsymbol,\SpecialChar \ldots{}
8457 Multiple features must be separated by commas.
8458 Note that you can only request supported features; unfortunately, the complete
8459 list of supported features is not documented (however,
8464 elp\SpecialChar \menuseparator
8471 gives an overview of the supported packages).
8474 \begin_layout Description
8481 the name of a style which preamble should be output
8485 the one mentionned above.
8486 This allows to ensure some ordering of the preamble snippets when macros
8487 definitions depend on one another
8491 \begin_layout Standard
8492 Note that, besides that functionality, there is no way to ensure any ordering
8494 The ordering that you see in a given version of LyX may change without
8495 warning in later versions.
8503 \begin_layout Standard
8507 \begin_layout Standard
8519 \begin_layout Subsection
8523 \begin_layout Standard
8524 \begin_inset CommandInset label
8530 Since version 1.3.0 of LyX, it is necessary to define the floats (
8538 , \SpecialChar \ldots{}
8539 ) in the text class itself.
8540 If you are looking here to learn how to upgrade an existing text class,
8541 it will probably turn out that all you have to do is to add
8544 \begin_layout LyX-Code
8548 \begin_layout Standard
8549 at a reasonable location of the text class.
8553 \begin_layout Standard
8554 Don't forget to also have a look at counters in next section.
8559 If you want to implement a text class that proposes some other float types
8560 (like the AGU class bundled with LyX), the information below will hopefully
8564 \begin_layout Description
8576 \begin_inset Quotes erd
8580 \begin_inset Quotes erd
8584 \begin_inset Quotes eld
8588 \begin_inset Quotes erd
8591 of the new class of floats, like program or algorithm.
8592 After the appropriate
8613 \begin_layout Description
8625 \begin_inset Quotes erd
8629 \begin_inset Quotes erd
8632 ] The string that will be used in the menus and also for the caption.
8635 \begin_layout Description
8656 if the float is already defined by the documentclass.
8661 , the float will be defined using the LaTeX package
8668 \begin_layout Description
8680 \begin_inset Quotes erd
8684 \begin_inset Quotes erd
8687 ] This (optional) argument determines whether floats of this class will
8688 be numbered within some sectional unit of the document.
8689 For example, if within is equal to
8693 , the floats will be numbered within chapters.
8697 \begin_layout Description
8709 \begin_inset Quotes erd
8713 \begin_inset Quotes erd
8716 ] The style used when defining the float using
8725 \begin_layout Description
8737 \begin_inset Quotes erd
8741 \begin_inset Quotes erd
8744 ] The default placement for the given class of floats.
8745 They are like in standard LaTeX:
8761 for top, bottom, page, and here, respectively.
8765 \begin_layout Standard
8766 Note that the order of these letters in the string is irrelevant, like in
8772 On top of that there is a new type,
8776 , which does not really correspond to a float, since it means: put it
8777 \begin_inset Quotes eld
8781 \begin_inset Quotes erd
8785 Note, however that the
8789 specifier is special and, because of implementation details cannot be used
8790 in non-builtin float types.
8791 If you do not understand what this means, just use
8798 \begin_layout Description
8810 \begin_inset Quotes erd
8814 \begin_inset Quotes erd
8817 ] The file name extension of an auxiliary file for the list of figures (or
8819 LaTeX writes the captions to this file.
8822 \begin_layout Description
8834 \begin_inset Quotes erd
8838 \begin_inset Quotes erd
8841 ] The heading used for the list of floats.
8844 \begin_layout Standard
8845 Note that defining a float with type
8851 automatically defines the corresponding counter with name
8860 \begin_layout Subsection
8861 Inset layouts and Flex insets
8864 \begin_layout Standard
8865 \begin_inset CommandInset label
8867 name "sec:charstyle"
8871 You can define character styles since version 1.4.0 of LyX; since version
8872 1.6.0 these are called Flex insets.
8876 \begin_layout Standard
8877 Furthermore it is possible to define the general layout of many different
8879 Currently layout parameters can be defined for footnotes, marginal notes,
8880 note insets, ERT insets, branch insets, and Flex insets.
8881 The latter are definable from the user GUI and come in three different
8882 kinds: character style (
8890 ), and XML element (
8898 \begin_layout Standard
8903 definition starting line is of the form
8906 \begin_layout LyX-Code
8907 InsetLayout <Type> <Name>
8910 \begin_layout Standard
8914 \begin_layout Standard
8921 Foot, Margin, Note, Flex
8926 \begin_layout Standard
8931 can be empty (for foot- and marginal notes, branches and ERT) or one of
8949 Here, the second part of the name can be chosen freely (for CharStyle,
8950 Custom and Element), or from a predefined list (for Note).
8953 \begin_layout Standard
8958 section can contain the following entries:
8961 \begin_layout Description
8984 (indicating a dummy definition ending definitions of charstyles etc.).
8985 This entry is only meaningful for Flex (user definable) insets, the three
8986 types of which are CharStyle, Custom and Element.
8989 \begin_layout Description
9005 Minimalistic or Conglomerate
9008 , describing the rendering style used for the inset's frame and buttons.
9011 \begin_layout Description
9018 defines what will be displayed on the button or elsewhere as the inset
9020 Some inset types (ERT and Branch) modify this label on the fly.
9023 \begin_layout Description
9030 The font used for both the text body
9035 See section\InsetSpace ~
9037 \begin_inset CommandInset ref
9039 reference "sec:fonts"
9044 Note that defining this font automatically defines the
9051 \begin_layout Description
9058 The font used for the label.
9059 See section\InsetSpace ~
9061 \begin_inset CommandInset ref
9063 reference "sec:fonts"
9068 Note that this definition can never appear before
9072 , lest it be ineffective (see above)
9075 \begin_layout Description
9082 The name of the corresponding LaTeX stuff.
9083 Either the environment or command name.
9086 \begin_layout Description
9093 The optional parameter for the corresponding
9099 stuff, including possible bracket pairs like
9104 This parameter cannot be changed from within LyX.
9107 \begin_layout Description
9114 See section\InsetSpace ~
9116 \begin_inset CommandInset ref
9118 reference "sec:style"
9125 \begin_layout Description
9129 Preamble\SpecialChar \ldots{}
9133 See section\InsetSpace ~
9135 \begin_inset CommandInset ref
9137 reference "sec:style"
9144 \begin_layout Description
9155 ] See section\InsetSpace ~
9157 \begin_inset CommandInset ref
9159 reference "sec:style"
9166 \begin_layout Subsection
9170 \begin_layout Standard
9171 \begin_inset CommandInset label
9177 Since version 1.3.0 of LyX, it is necessary to define the counters (
9185 , \SpecialChar \ldots{}
9186 ) in the text class itself.
9187 If you are looking here to learn how to upgrade an existing text class,
9188 it will probably turn out that all you have to do is to add
9191 \begin_layout LyX-Code
9192 Input stdcounters.inc
9195 \begin_layout Standard
9196 The following parameters can be used:
9199 \begin_layout Description
9211 \begin_inset Quotes erd
9215 \begin_inset Quotes erd
9218 ] The name of the counter.
9221 \begin_layout Description
9233 \begin_inset Quotes erd
9237 \begin_inset Quotes erd
9240 ] If this is set to the name of another counter, the present counter will
9241 be reset everytime the other one is increased.
9253 \begin_layout Description
9257 LabelString [string=""]
9260 when this is defined, this string defines how the counter is displayed.
9261 Setting this value resets
9266 The following special constructs can be used in the string:
9270 \begin_layout Itemize
9277 will be replaced by the expansion of the
9290 If these are empty, a default value is constructed as follows: if the counter
9291 has a master counter
9303 is used; otherwise the string
9312 \begin_layout Itemize
9313 counter values can be expressed using LaTeX-like macros
9337 \begin_layout Description
9348 to arabic numerals, like 1, 2, 3\SpecialChar \ldots{}
9353 \begin_layout Standard
9363 Actually, the situation is a bit more complicated than that: any
9382 other than those descibed below will produce arabic numerals.
9383 It would not be surprising to see this change in the future.
9391 \begin_layout Description
9398 for lower-case letters: a, b, c, \SpecialChar \ldots{}
9402 \begin_layout Description
9409 for upper-case letters: A, B, C, \SpecialChar \ldots{}
9413 \begin_layout Description
9420 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
9424 \begin_layout Description
9431 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
9435 \begin_layout Description
9442 for hebrew numerals.
9447 \begin_layout Description
9451 LabelStringAppendix [string=""]
9458 , for use in appendix.
9461 \begin_layout Subsection
9465 \begin_layout Standard
9466 \begin_inset CommandInset label
9472 A font description looks like that:
9475 \begin_layout LyX-Code
9485 \begin_layout LyX-Code
9489 \begin_layout LyX-Code
9493 \begin_layout Standard
9494 and the following commands are available:
9497 \begin_layout Description
9514 \begin_layout Description
9531 \begin_layout Description
9543 , Italic, SmallCaps, Slanted
9548 \begin_layout Description
9564 , large, larger, largest, huge, giant
9569 \begin_layout Description
9581 , black, white, red, green, blue, cyan, magenta, yellow
9586 \begin_layout Subsection
9587 Upgrading old layout files
9590 \begin_layout Standard
9591 The file format of layout files changes from time to time, so old layout
9592 files need to be converted.
9593 This process has been automated in LyX 1.4.0: If LyX reads an old format
9594 layout file it will call the conversion tool
9596 $LyXDir/scripts/layout2layout.py
9598 and convert it to a temporary file in current format.
9599 The original file is left untouched, so that you can still use it with
9601 If you want to convert the layout file permanently, just call the converter
9605 \begin_layout LyX-Code
9606 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
9609 \begin_layout Standard
9621 \begin_layout Standard
9622 The automatic conversion does only handle syntax changes.
9623 It cannot handle the case where the contents of included files was changed.
9624 For example, layout files based on
9637 If you get error messages about undefined counters, try to convert your
9657 \begin_layout Section
9659 \begin_inset CommandInset label
9661 name "sec:templates"
9668 \begin_layout Standard
9669 Templates are created just like usual documents.
9670 The only difference is that usual documents contain all possible settings,
9671 including the fontscheme and the papersize.
9672 Usually a user doesn't want a template to overwrite his defaults in these
9674 For that reason, the designer of a template should remove the corresponding
9687 from the template LyX file.
9688 This can be done with any simple text-editor, for example
9700 \begin_layout Standard
9701 Put the edited template files you create in
9705 , copy the ones you use from the global template directory in
9709 to the same place, and redefine the template path in the
9714 dit\SpecialChar \menuseparator
9733 \begin_layout Standard
9734 Note that there is a template which has a particular meaning:
9739 This template is loaded everytime you create a new document with
9746 \SpecialChar \menuseparator
9754 in order to provide useful defaults.
9755 To create this template from inside LyX, all you have to do is to open
9756 a document with the correct settings, and use the
9762 e as Document Defaults
9767 \begin_layout Chapter
9768 Including External Material
9771 \begin_layout Section
9775 \begin_layout Standard
9776 \begin_inset Note Note
9779 \begin_layout Standard
9780 This section is completely outdated.
9785 One often requested feature from LyX users is to be able to interface LyX
9786 with Xfig, Dia, or other similar applications that specialize in producing
9787 a certain kind of diagram, figure, schematic or whatever material might
9788 be relevant to include in your document.
9789 Previously, it was only possible to include boring, static, fixed images
9790 in LyX documents with the graphics feature, but there are several limitations
9791 attached to this approach:
9794 \begin_layout Itemize
9795 If you want to change the figure, you have to invoke an external program
9799 \begin_layout Itemize
9800 LyX does not notice that the referenced files change, so the on-screen display
9801 can fast become obsolete, and this is aggravated by the lack of a means
9802 of updating the display
9805 \begin_layout Itemize
9806 The graphics stuff does not provide any mechanisms for coping with different
9807 exported formats such as DocBook, HTML or plain text
9810 \begin_layout Standard
9811 The external material facility attempts to solve all of these problems
9815 \begin_layout Standard
9816 Even if the graphics facility can't solve all problems, it is still valuable
9817 because it does provide in-line preview of the graphics, and supports advanced
9818 geometric transformations with a comfortable user interface.
9824 It does this by offering a general method to interface LyX to external
9826 Instead of introducing a long list of different constructs tailored for
9827 each specific application, we chose to sacrifice the in-line displaying
9828 of the included material in order to provide a general construct to cover
9829 a wide range of applications.
9830 The result is the external material construct.
9831 External material presents itself in the document simply as a button, but
9832 don't let this fool you.
9833 When you click on it, a dialog will appear that allows you to chose exactly
9834 what material to include, and in the following sections you will learn
9835 that this is indeed a powerful mechanism that can solve all of the above
9839 \begin_layout Section
9843 \begin_layout Standard
9844 The external material feature is based on the concept of a
9849 A template is a specification of how LyX should interface with a certain
9851 As bundled, LyX comes with predefined templates for Xfig figures, Dia diagrams,
9852 various raster format images, gnuplot, and more.
9853 You can check the actual list by using the menu
9855 Insert\SpecialChar \menuseparator
9856 File\SpecialChar \menuseparator
9865 Furthermore, it is possible to roll your own template to support a specific
9867 Later we'll describe in more detail what is involved, and hopefully you
9868 will submit all the templates you create so we can include them in a later
9872 \begin_layout Standard
9873 Another basic idea of the external material feature is to distinguish between
9874 the original file that serves as a base for final material and the produced
9875 file that is included in your exported or printed document.
9876 For example, consider the case of a figure produced with
9881 The Xfig application itself works on an original file with the
9886 Within XFig, you create and change your figure, and when you are done,
9892 When you want to include the figure in your document, you invoke
9896 in order to create a PostScript file that can readily be included in your
9902 file is the original file, and the PostScript file is the produced file.
9905 \begin_layout Standard
9906 This distinction is important in order to allow updating of the material
9907 while you are in the process of writing the document.
9908 Furthermore, it provides us with the flexibility that is needed to support
9909 multiple export formats.
9910 For instance, in the case of a plain text file, it is not exactly an award-winn
9911 ing idea to include the figure as raw PostScript.
9912 Instead, you'd either prefer to just include a reference to the figure,
9913 or try to invoke some graphics to Ascii converter to make the final result
9914 look similar to the real graphics.
9915 The external material management allows you to do this, because it is parameter
9916 ized on the different export formats that LyX supports.
9919 \begin_layout Standard
9920 Besides supporting the production of different products according to the
9921 exported format, it supports tight integration with editing and viewing
9923 In the case of an XFig figure, you are able to invoke
9927 on the original file with a single click from within the external material
9928 dialog in LyX, and also preview the produced PostScript file with
9933 No more fiddling around with the command line and/or file browsers to locate
9934 and manipulate the original or produced files.
9935 In this way, you are finally able to take full advantage of the many different
9936 applications that are relevant to use when you write your documents, and
9937 ultimately be more productive.
9940 \begin_layout Section
9941 External material dialog
9944 \begin_layout Standard
9949 dialog is described in the
9958 \begin_layout Section
9962 \begin_layout Standard
9963 In this section, we should include some examples of use of the external
9965 Those examples could include:
9968 \begin_layout Itemize
9969 External raster images
9972 \begin_layout Itemize
9973 External XFig figures
9976 \begin_layout Itemize
9980 \begin_layout Itemize
9984 \begin_layout Itemize
9985 The use of makefiles
9988 \begin_layout Itemize
9989 Recursive external LyX templates
9992 \begin_layout Section
9993 The external template configuration file
9996 \begin_layout Standard
9997 It is relatively easy to add custom external template definitions to LyX.
9998 However, be aware this doing this in an careless manner most probably
10002 introduce an easily exploitable security hole.
10003 So before you do this, please read the discussion about security which
10007 \begin_layout Standard
10008 Having said that, we encourage you to submit any interesting templates that
10013 \begin_layout Standard
10014 The external templates are defined in the
10016 lib/external_templates
10019 You can place your own version in
10021 .lyx/external_templates
10026 \begin_layout Standard
10027 A typical template looks like this:
10030 \begin_layout LyX-Code
10034 \begin_layout LyX-Code
10035 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
10038 \begin_layout LyX-Code
10042 \begin_layout LyX-Code
10046 \begin_layout LyX-Code
10050 \begin_layout LyX-Code
10054 \begin_layout LyX-Code
10058 \begin_layout LyX-Code
10059 AutomaticProduction true
10062 \begin_layout LyX-Code
10066 \begin_layout LyX-Code
10070 \begin_layout LyX-Code
10074 \begin_layout LyX-Code
10075 TransformCommand Rotate RotationLatexCommand
10078 \begin_layout LyX-Code
10079 TransformCommand Resize ResizeLatexCommand
10082 \begin_layout LyX-Code
10083 Product "$$RotateFront$$ResizeFront
10086 \begin_layout LyX-Code
10091 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
10094 \begin_layout LyX-Code
10095 $$ResizeBack$$RotateBack"
10098 \begin_layout LyX-Code
10102 \begin_layout LyX-Code
10103 UpdateResult "$$AbsPath$$Basename.pstex_t"
10106 \begin_layout LyX-Code
10107 Requirement "graphicx"
10110 \begin_layout LyX-Code
10111 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
10114 \begin_layout LyX-Code
10115 ReferencedFile latex "$$AbsPath$$Basename.eps"
10118 \begin_layout LyX-Code
10119 ReferencedFile dvi "$$AbsPath$$Basename.eps"
10122 \begin_layout LyX-Code
10126 \begin_layout LyX-Code
10130 \begin_layout LyX-Code
10131 TransformCommand Rotate RotationLatexCommand
10134 \begin_layout LyX-Code
10135 TransformCommand Resize ResizeLatexCommand
10138 \begin_layout LyX-Code
10139 Product "$$RotateFront$$ResizeFront
10142 \begin_layout LyX-Code
10147 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
10150 \begin_layout LyX-Code
10151 $$ResizeBack$$RotateBack"
10154 \begin_layout LyX-Code
10155 UpdateFormat pdftex
10158 \begin_layout LyX-Code
10159 UpdateResult "$$AbsPath$$Basename.pdftex_t"
10162 \begin_layout LyX-Code
10163 Requirement "graphicx"
10166 \begin_layout LyX-Code
10167 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
10170 \begin_layout LyX-Code
10171 ReferencedFile latex "$$AbsPath$$Basename.pdf"
10174 \begin_layout LyX-Code
10178 \begin_layout LyX-Code
10182 \begin_layout LyX-Code
10183 Product "$$Contents(
10185 "$$AbsPath$$Basename.asc
10190 \begin_layout LyX-Code
10191 UpdateFormat asciixfig
10194 \begin_layout LyX-Code
10195 UpdateResult "$$AbsPath$$Basename.asc"
10198 \begin_layout LyX-Code
10202 \begin_layout LyX-Code
10206 \begin_layout LyX-Code
10207 Product "<graphic fileref=
10209 "$$AbsOrRelPathMaster$$Basename.eps
10214 \begin_layout LyX-Code
10218 \begin_layout LyX-Code
10222 \begin_layout LyX-Code
10223 UpdateResult "$$AbsPath$$Basename.eps"
10226 \begin_layout LyX-Code
10227 ReferencedFile docbook "$$AbsPath$$Basename.eps"
10230 \begin_layout LyX-Code
10231 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
10234 \begin_layout LyX-Code
10238 \begin_layout LyX-Code
10239 Product "[XFig: $$FName]"
10242 \begin_layout LyX-Code
10246 \begin_layout LyX-Code
10250 \begin_layout Standard
10251 As you can see, the template is enclosed in
10255 \SpecialChar \ldots{}
10261 It contains a header specifying some general settings, and for each supported
10262 primary document file format a section
10266 \SpecialChar \ldots{}
10274 \begin_layout Subsection
10275 The template header
10278 \begin_layout Description
10282 Template\InsetSpace ~
10286 A unique name for the template.
10287 It must not contain substitution macros (see below).
10290 \begin_layout Description
10294 GuiName\InsetSpace ~
10298 The text that is displayed on the button.
10299 This command must occur exactly once.
10302 \begin_layout Description
10306 HelpText\InsetSpace ~
10307 <text>\InsetSpace ~
10311 The help text that is used in the External dialog.
10312 Provide enough information to explain to the user just what the template
10313 can provide him with.
10314 This command must occur exactly once.
10317 \begin_layout Description
10321 InputFormat\InsetSpace ~
10325 The file format of the original file.
10326 This must be the name of a format that is known to LyX (see the
10331 ools\SpecialChar \menuseparator
10336 references:Conversion
10343 if the template can handle original files of more than one format.
10344 LyX will attempt to interrogate the file itself in order to deduce its
10345 format in this case.
10346 This command must occur exactly once.
10349 \begin_layout Description
10353 FileFilter\InsetSpace ~
10357 A glob pattern that is used in the file dialog to filter out the desired
10359 If there is more than one possible file extension (e.g.\InsetSpace ~
10368 ), use something like
10373 This command must occur exactly once.
10376 \begin_layout Description
10380 AutomaticProduction\InsetSpace ~
10384 Wether the file represented by the template must be generated by LyX.
10385 This command must occur exactly once.
10388 \begin_layout Description
10392 Transform\InsetSpace ~
10393 Rotate|Resize|Clip|Extra
10396 This command specifies which transformations are supported by this template.
10397 It may occur zero or more times.
10398 This command enables the corresponding tabs in the external dialog.
10403 command must have either a corresponding
10416 Otherwise the transformation will not be supported by that format.
10419 \begin_layout Subsection
10423 \begin_layout Description
10427 Format\InsetSpace ~
10428 LaTeX|PDFLaTeX|PlainText|DocBook
10431 The primary document file format that this format definition is for.
10432 Not every template has a sensible representation in all document file formats.
10433 Please define nevertheless a
10437 section for all formats.
10438 Use a dummy text when no representation is available.
10439 Then you can at least see a reference to the external material in the exported
10443 \begin_layout Description
10447 TransformCommand\InsetSpace ~
10448 Rotate\InsetSpace ~
10449 RotationLatexCommand
10452 This command specifies that the built in LaTeX command should be used for
10454 This command may occur once or not at all.
10457 \begin_layout Description
10461 TransformCommand\InsetSpace ~
10462 Resize\InsetSpace ~
10466 This command specifies that the built in LaTeX command should be used for
10468 This command may occur once or not at all.
10471 \begin_layout Description
10475 TransformOption\InsetSpace ~
10476 Rotate\InsetSpace ~
10477 RotationLatexOption
10480 This command specifies that rotation is done via an optional argument.
10481 This command may occur once or not at all.
10484 \begin_layout Description
10488 TransformOption\InsetSpace ~
10489 Resize\InsetSpace ~
10493 This command specifies that resizing is done via an optional argument.
10494 This command may occur once or not at all.
10497 \begin_layout Description
10501 TransformOption\InsetSpace ~
10506 This command specifies that clipping is done via an optional argument.
10507 This command may occur once or not at all.
10510 \begin_layout Description
10514 TransformOption\InsetSpace ~
10519 This command specifies that an extra optional argument is used.
10520 This command may occur once or not at all.
10523 \begin_layout Description
10527 Product\InsetSpace ~
10531 The text that is inserted in the exported document.
10532 This is actually the most important command and can be quite complex.
10533 This command must occur exactly once.
10536 \begin_layout Description
10540 UpdateFormat\InsetSpace ~
10544 The file format of the converted file.
10545 This must be the name of a format that is known to LyX (see the
10550 ools\SpecialChar \menuseparator
10555 references:Conversion
10558 This command must occur exactly once.
10561 \begin_layout Description
10565 UpdateResult\InsetSpace ~
10569 The file name of the converted file.
10570 The file name must be absolute.
10571 This command must occur exactly once.
10574 \begin_layout Description
10578 ReferencedFile\InsetSpace ~
10579 <format>\InsetSpace ~
10583 This command denotes files that are created by the conversion process and
10584 are needed for a particular export format.
10585 If the filename is relative, it is interpreted relative to the master document.
10586 This command may be given zero or more times.
10589 \begin_layout Description
10593 Requirement\InsetSpace ~
10597 The name of a required LaTeX package.
10598 The package is included via
10604 in the LaTeX preamble.
10605 This command may occur zero or more times.
10608 \begin_layout Description
10612 Preamble\InsetSpace ~
10616 This command specifies a preamble snippet that will be included in the
10618 It has to be defined using
10622 \SpecialChar \ldots{}
10628 This command may occur zero or more times.
10631 \begin_layout Description
10635 Option\InsetSpace ~
10636 <name>\InsetSpace ~
10640 This command defines an additional macro
10644 for substitution in
10653 itself may contain substitution macros.
10654 The advantage over using
10662 is that the substituted value of
10666 is sanitized so that it is a valid optional argument in the document format.
10667 This command may occur zero or more times.
10670 \begin_layout Subsection
10671 Preamble definitions
10674 \begin_layout Standard
10675 The external template configuration file may contain additional preamble
10676 definitions enclosed by
10680 \SpecialChar \ldots{}
10686 They can be used by the templates in the
10693 \begin_layout Section
10694 The substitution mechanism
10697 \begin_layout Standard
10698 When the external material facility invokes an external program, it is done
10699 on the basis of a command defined in the template configuration file.
10700 These commands can contain various macros that are expanded before execution.
10701 Execution always take place in the directory of the containing document.
10704 \begin_layout Standard
10705 Also, whenever external material is to be displayed, the name will be produced
10706 by the substitution mechanism, and most other commands in the template
10707 definition support substitution as well.
10710 \begin_layout Standard
10711 The available macros are the following:
10714 \begin_layout Description
10715 $$FName The filename of the file specified in the external material dialog.
10716 This is either an absolute name, or it is relative to the LyX document.
10719 \begin_layout Description
10720 $$Basename The filename without path and without the extension.
10723 \begin_layout Description
10724 $$Extension The file extension (including the dot).
10727 \begin_layout Description
10728 $$FPath The path part of
10732 (absolute name or relative to the LyX document).
10735 \begin_layout Description
10736 $$AbsPath The absolute file path.
10739 \begin_layout Description
10740 $$RelPathMaster The file path, relative to the master LyX document.
10743 \begin_layout Description
10744 $$RelPathParent The file path, relative to the LyX document.
10747 \begin_layout Description
10748 $$AbsOrRelPathMaster The file path, absolute or relative to the master LyX
10752 \begin_layout Description
10753 $$AbsOrRelPathParent The file path, absolute or relative to the LyX document.
10756 \begin_layout Description
10757 $$Tempname A name and full path to a temporary file which will be automatically
10758 deleted whenever the containing document is closed, or the external material
10762 \begin_layout Description
10764 \begin_inset Quotes eld
10768 \begin_inset Quotes erd
10771 ) This macro will expand to the contents of the file with the name
10778 \begin_layout Description
10779 $$Sysdir This macro will expand to the absolute path of the system directory.
10780 This is typically used to point to the various helper scripts that are
10784 \begin_layout Standard
10785 All path macros contain a trailing directory separator, so you can construct
10787 the absolute filename with
10789 $$AbsPath$$Basename$$Extension
10794 \begin_layout Standard
10795 The macros above are substituted in all commands unless otherwise noted.
10800 supports additionally the following substitutions if they are enabled by
10812 \begin_layout Description
10813 $$ResizeFront The front part of the resize command.
10816 \begin_layout Description
10817 $$ResizeBack The back part of the resize command.
10820 \begin_layout Description
10821 $$RotateFront The front part of the rotation command.
10824 \begin_layout Description
10825 $$RotateBack The back part of the rotation command.
10828 \begin_layout Standard
10829 The value string of the
10833 command supports additionally the following substitutions if they are enabled
10845 \begin_layout Description
10846 $$Clip The clip option.
10849 \begin_layout Description
10850 $$Extra The extra option.
10853 \begin_layout Description
10854 $$Resize The resize option.
10857 \begin_layout Description
10858 $$Rotate The rotation option.
10861 \begin_layout Standard
10862 You may ask why there are so many path macros.
10863 There are mainly two reasons:
10866 \begin_layout Standard
10867 First, relative and absolute file names should remain relative or absolute,
10869 Users may have reasons to prefer either form.
10870 Relative names are useful for portable documents that should work on different
10871 machines, for example.
10872 Absolute names may be required by some programs.
10875 \begin_layout Standard
10876 Second, LaTeX treats relative file names differently than LyX and other
10877 programs in nested included files.
10878 For LyX, a relative file name is always relative to the document that contains
10880 For LaTeX, it is always relative to the master document.
10881 These two definitions are identical if you have only one document, but
10882 differ if you have a master document that includes part documents.
10883 That means that relative filenames must be transformed when presented to
10885 Fortunately LyX does this automatically for you if you choose the right
10889 \begin_layout Standard
10890 So which path macro should be used in new template definitions? The rule
10894 \begin_layout Itemize
10899 if an absolute path is required.
10902 \begin_layout Itemize
10905 $$AbsOrRelPathMaster
10907 if the substituted string is some kind of LaTeX input.
10910 \begin_layout Itemize
10913 $$AbsOrRelPathParent
10915 in order to preserve the user's choice.
10918 \begin_layout Standard
10919 There are special cases where this rule does not work and e.g.\InsetSpace ~
10921 are needed, but normally it will work just fine.
10922 One example for such a case is the command
10924 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
10926 in the XFig template above: We can't use the absolute name because the
10931 files needs the relative name in order to rewrite the file content.
10934 \begin_layout Section
10935 Security discussion
10938 \begin_layout Standard
10939 \begin_inset Note Note
10942 \begin_layout Standard
10943 This section is outdated
10948 The external material feature interfaces with a lot of external programs
10949 and does so automatically, so we have to consider the security implications
10951 In particular, since you have the option of including your own filenames
10952 and/or parameter strings and those are expanded into a command, it seems
10953 that it would be possible to create a malicious document which executes
10954 arbitrary commands when a user views or prints the document.
10955 This is something we definately want to avoid.
10958 \begin_layout Standard
10959 However, since the external program commands are specified in the template
10960 configuration file only, there are no security issues if LyX is properly
10961 configured with safe templates only.
10962 This is so because the external programs are invoked with the
10966 -system call rather than the
10970 system-call, so it's not possible to execute arbitrary commands from the
10971 filename or parameter section via the shell.
10974 \begin_layout Standard
10975 This also implies that you are restricted in what command strings you can
10976 use in the external material templates.
10977 In particular, pipes and redirection are not readily available.
10978 This has to be so if LyX should remain safe.
10979 If you want to use some of the shell features, you should write a safe
10980 script to do this in a controlled manner, and then invoke the script from
10981 the command string.
10986 directory of the LyX installation, you can find a safe wrapper script
10988 general_command_wrapper.py
10990 that supports redirection of input and output.
10991 That can serve as an example for how to write safe template scripts.
10992 For a more advanced example that uses
10996 and friends, take a look at the
11003 \begin_layout Standard
11004 It is possible to design a template that interacts directly with the shell,
11005 but since this would allow a malicious user to execute arbitrary commands
11006 by writing clever filenames and/or parameters, we generally recommend that
11007 you only use safe scripts that work with the
11011 system call in a controlled manner.
11012 Of course, for use in a controlled environment, it can be tempting to just
11013 fall back to use ordinary shell scripts.
11014 If you do so, be aware that you
11018 provide an easily exploitable security hole in your system.
11019 Of course it stands to reason that such unsafe templates will never be
11020 included in the standard LyX distribution, although we do encourage people
11021 to submit new templates in the open source tradition.
11022 But LyX as shipped from the official distribution channels will never have
11026 \begin_layout Standard
11027 Including external material provides a lot of power, and you have to be
11028 careful not to introduce security hazards with this power.
11029 A subtle error in a single line in an innocent looking script can open
11030 the door to huge security problems.
11031 So if you do not fully understand the issues, we recommend that you consult
11032 a knowledgable security professional or the LyX development team if you
11033 have any questions about whether a given template is safe or not.
11034 And do this before you use it in an uncontrolled environment.
11037 \begin_layout Chapter
11041 \begin_layout Section
11045 \begin_layout Standard
11046 The LyX server is a method implemented in LyX that will enable other programs
11047 to talk to LyX, invoke LyX commands, and retrieve information about the
11048 LyX internal state.
11049 This is only intended for advanced users, but they should find it useful.
11052 \begin_layout Section
11053 Starting the LyX Server
11056 \begin_layout Standard
11057 The LyX server works through the use of a pair of named pipes.
11058 These are usually located in your home directory and have the names
11059 \begin_inset Quotes eld
11067 \begin_inset Quotes erd
11071 \begin_inset Quotes eld
11079 \begin_inset Quotes erd
11083 External programs write into
11087 and read back data from
11092 The stem of the pipe names can be defined in the
11097 ools\SpecialChar \menuseparator
11104 dialog, for example
11106 "/home/myhome/.lyxpipe"
11111 \begin_layout Standard
11120 ' to create the pipes.
11121 The above setting also has the effect of activating the LyX server.
11122 If one of the pipes already exists, LyX will assume that another LyX process
11123 is already running and will not start the server.
11124 To have several LyX processes with servers at the same time, you have to
11125 change the configuration between the start of the programs.
11128 \begin_layout Standard
11129 If you are developing a client program, you might find it useful to enable
11130 debugging information from the LyX server.
11131 Do this by starting LyX as
11133 lyx -dbg lyxserver.
11136 \begin_layout Standard
11137 Warning: if LyX crashes, it may not manage to remove the pipes; in this
11138 case you must remove them manually.
11139 If LyX starts and the pipes exist already, it will not start any server.
11142 \begin_layout Standard
11143 Other than this, there are a few points to consider:
11146 \begin_layout Itemize
11147 Both server and clients must run on UNIX or OS/2 machines.
11148 Communications between LyX on UNIX and clients on OS/2 or vice versa is
11149 not possible right now.
11152 \begin_layout Itemize
11153 On OS/2, only one client can connect to LyXServer at a time.
11156 \begin_layout Itemize
11157 On OS/2, clients must open inpipe with
11164 \begin_layout Standard
11165 You can find a complete example client written in C in the source distribution
11168 development/server_monitor.c
11173 \begin_layout Section
11174 Normal communication
11177 \begin_layout Standard
11178 To issue a LyX call, the client writes a line of ASCII text into the input
11180 This line has the following format:
11183 \begin_layout Quote
11197 \begin_layout Standard
11202 is a name that the client can choose arbitrarily.
11203 Its only use is that LyX will echo it if it sends an answer - so a client
11204 can dispatch results from different requesters.
11207 \begin_layout Standard
11212 is the function you want LyX to perform.
11213 It is the same as the commands you'd use in the minibuffer.
11216 \begin_layout Standard
11221 is an optional argument which is meaningful only to some functions (for
11223 \begin_inset Quotes eld
11227 \begin_inset Quotes erd
11230 which will insert the argument as text at the cursor position.)
11233 \begin_layout Standard
11234 The answer from LyX will arrive in the output pipe and be of the form
11237 \begin_layout Quote
11251 \begin_layout Standard
11260 are just echoed from the command request, while
11264 is more or less useful information filled according to how the command
11265 execution worked out.
11266 Some commands will return information about the internal state of LyX,
11268 \begin_inset Quotes eld
11272 \begin_inset Quotes erd
11275 , while other will return an empty data-response.
11276 This means that the command execution went fine.
11279 \begin_layout Standard
11280 In case of errors, the response from LyX will have this form
11283 \begin_layout Quote
11297 \begin_layout Standard
11302 should contain an explanation of why the command failed.
11305 \begin_layout Standard
11309 \begin_layout LyX-Code
11310 echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
11313 \begin_layout LyX-Code
11314 echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
11316 read a <~/.lyxpipe.out
11321 \begin_layout Section
11325 \begin_layout Standard
11326 LyX can notify clients of events going on asynchronously.
11327 Currently it will only do this if the user binds a key sequence with the
11329 \begin_inset Quotes eld
11333 \begin_inset Quotes erd
11337 The format of the string LyX sends is as follows:
11340 \begin_layout Quote
11349 \begin_layout Standard
11354 is the printed representation of the key sequence that was actually typed
11358 \begin_layout Standard
11359 This mechanism can be used to extend LyX's command set and implement macros:
11360 bind some key sequence to
11361 \begin_inset Quotes eld
11365 \begin_inset Quotes erd
11368 , start a client that listens on the out pipe, dispatches the command according
11369 to the sequence and starts a function that may use LyX calls and LyX requests
11370 to issue a command or a series of commands to LyX.
11373 \begin_layout Section
11374 The simple LyX Server Protocol
11377 \begin_layout Standard
11378 LyX implements a simple protocol that can be used for session management.
11379 All messages are of the form
11382 \begin_layout Quote
11392 \begin_layout Standard
11398 \begin_inset Quotes eld
11402 \begin_inset Quotes erd
11406 \begin_inset Quotes eld
11410 \begin_inset Quotes erd
11415 \begin_inset Quotes eld
11419 \begin_inset Quotes erd
11422 is received from a client, LyX will report back to inform the client that
11423 it's listening to it's messages, while
11424 \begin_inset Quotes eld
11428 \begin_inset Quotes erd
11431 sent from LyX will inform clients that LyX is closing.
11434 \begin_layout Chapter
11439 \begin_layout Standard
11440 This appendix is a huge cross-reference to all the English language keybindings.
11441 Originally, we simply wanted to list all of the key bindings followed by
11442 the function it's bound to.
11443 That way, a user can look up a key to find out what it does.
11444 We then decided, what the hey, why not include the default toolbar and
11445 menu bindings, too.
11446 Please note this section is likely to be very out of date.
11449 \begin_layout Standard
11450 The form is really self-explanatory, but here are a few tips: all entries
11451 are arranged roughly alphabetically for a given modifier (
11460 For the general keyboard layout, simpler prefixes precede the more complex
11470 All entries were gleaned from the default user interface and binding files
11471 located in the directories
11473 \SpecialChar \ldots{}
11478 \SpecialChar \ldots{}
11481 ; they should be treated as the final word on the bindings.
11484 \begin_layout Standard
11485 As a final note, be aware that some window managers (such as FVWM) take
11486 control of some of the function keys or motion keys.
11491 is listed here as generating
11495 , but FVWM grabs it and uses it to change virtual desktops instead.
11496 Very annoying unless you instruct your window manager to stop intercepting
11500 \begin_layout Section
11504 \begin_layout LyX-Code
11508 \begin_layout LyX-Code
11512 \begin_layout LyX-Code
11516 \begin_layout LyX-Code
11517 Icon "buffer-write"
11520 \begin_layout LyX-Code
11521 Icon "buffer-print"
11524 \begin_layout LyX-Code
11528 \begin_layout LyX-Code
11532 \begin_layout LyX-Code
11536 \begin_layout LyX-Code
11540 \begin_layout LyX-Code
11544 \begin_layout LyX-Code
11548 \begin_layout LyX-Code
11552 \begin_layout LyX-Code
11556 \begin_layout LyX-Code
11560 \begin_layout LyX-Code
11564 \begin_layout LyX-Code
11568 \begin_layout LyX-Code
11572 \begin_layout LyX-Code
11573 Icon "footnote-insert"
11576 \begin_layout LyX-Code
11577 Icon "marginpar-insert"
11580 \begin_layout LyX-Code
11584 \begin_layout LyX-Code
11588 \begin_layout LyX-Code
11589 Icon "figure-insert"
11592 \begin_layout LyX-Code
11593 Icon "dialog-tabular-insert"
11596 \begin_layout LyX-Code
11600 \begin_layout Section
11604 \begin_layout Standard
11605 Note that the following bindings are for LyX with English menus.
11606 The second character of the binding depends on the menu language.
11608 \begin_inset Quotes eld
11616 \begin_inset Quotes erd
11619 is with German menus
11620 \begin_inset Quotes eld
11628 \begin_inset Quotes erd
11632 To find out the shortcuts of your language press the Meta (Alt)-key and
11633 press then the keys of the underlined characters of the menu names.
11636 \begin_layout Subsection
11641 \labelwidthstring 00.00.0000
11653 \labelwidthstring 00.00.0000
11665 \labelwidthstring 00.00.0000
11677 \labelwidthstring 00.00.0000
11691 \labelwidthstring 00.00.0000
11703 \labelwidthstring 00.00.0000
11717 \labelwidthstring 00.00.0000
11729 \labelwidthstring 00.00.0000
11741 \labelwidthstring 00.00.0000
11753 \labelwidthstring 00.00.0000
11765 \labelwidthstring 00.00.0000
11773 buffer-new-template
11777 \labelwidthstring 00.00.0000
11792 \labelwidthstring 00.00.0000
11803 \labelwidthstring 00.00.0000
11814 \labelwidthstring 00.00.0000
11825 \labelwidthstring 00.00.0000
11836 \labelwidthstring 00.00.0000
11847 \labelwidthstring 00.00.0000
11859 \labelwidthstring 00.00.0000
11870 \begin_layout Subsection
11875 \labelwidthstring 00.00.0000
11887 \labelwidthstring 00.00.0000
11899 \labelwidthstring 00.00.0000
11911 \labelwidthstring 00.00.0000
11923 \labelwidthstring 00.00.0000
11935 \labelwidthstring 00.00.0000
11947 \labelwidthstring 00.00.0000
11962 \labelwidthstring 00.00.0000
11969 tabular-feature append-row
11973 \labelwidthstring 00.00.0000
11980 tabular-feature toggle-line-bottom
11984 \labelwidthstring 00.00.0000
11991 tabular-feature align-center
11995 \labelwidthstring 00.00.0000
12002 tabular-feature delete-column
12006 \labelwidthstring 00.00.0000
12013 tabular-feature align-left
12017 \labelwidthstring 00.00.0000
12024 tabular-feature align-right
12028 \labelwidthstring 00.00.0000
12035 tabular-feature toggle-line-left
12039 \labelwidthstring 00.00.0000
12046 tabular-feature multicolumn
12050 \labelwidthstring 00.00.0000
12057 tabular-feature valign-center
12061 \labelwidthstring 00.00.0000
12068 tabular-feature valign-top
12072 \labelwidthstring 00.00.0000
12079 tabular-feature toggle-line-right
12083 \labelwidthstring 00.00.0000
12090 tabular-feature toggle-line-top
12094 \labelwidthstring 00.00.0000
12101 tabular-feature append-column
12105 \labelwidthstring 00.00.0000
12112 tabular-feature valign-bottom
12116 \labelwidthstring 00.00.0000
12123 tabular-feature delete-row
12128 \labelwidthstring 00.00.0000
12141 \labelwidthstring 00.00.0000
12148 floats-operate openfoot
12152 \labelwidthstring 00.00.0000
12159 floats-operate closefoot
12163 \labelwidthstring 00.00.0000
12170 floats-operate openfig
12174 \labelwidthstring 00.00.0000
12185 \labelwidthstring 00.00.0000
12196 \labelwidthstring 00.00.0000
12203 floats-operate closefig
12208 \labelwidthstring 00.00.0000
12220 \labelwidthstring 00.00.0000
12234 \labelwidthstring 00.00.0000
12246 \labelwidthstring 00.00.0000
12258 \labelwidthstring 00.00.0000
12272 \labelwidthstring 00.00.0000
12284 \labelwidthstring 00.00.0000
12299 \labelwidthstring 00.00.0000
12306 primary-selection-paste
12310 \labelwidthstring 00.00.0000
12317 primary-selection-paste paragraph
12321 \begin_layout Subsection
12326 \labelwidthstring 00.00.0000
12341 \labelwidthstring 00.00.0000
12348 buffer-float-insert algorithm
12352 \labelwidthstring 00.00.0000
12359 buffer-float-insert wide-tab
12363 \labelwidthstring 00.00.0000
12370 buffer-float-insert figure
12374 \labelwidthstring 00.00.0000
12381 buffer-float-insert table
12385 \labelwidthstring 00.00.0000
12392 buffer-float-insert wide-fig
12397 \labelwidthstring 00.00.0000
12405 dialog-tabular-insert
12409 \labelwidthstring 00.00.0000
12421 \labelwidthstring 00.00.0000
12433 \labelwidthstring 00.00.0000
12441 buffer-child-insert
12445 \labelwidthstring 00.00.0000
12457 \labelwidthstring 00.00.0000
12469 \labelwidthstring 00.00.0000
12481 \labelwidthstring 00.00.0000
12493 \labelwidthstring 00.00.0000
12505 \labelwidthstring 00.00.0000
12517 \labelwidthstring 00.00.0000
12529 \labelwidthstring 00.00.0000
12544 \labelwidthstring 00.00.0000
12555 \labelwidthstring 00.00.0000
12566 \labelwidthstring 00.00.0000
12577 \labelwidthstring 00.00.0000
12588 \labelwidthstring 00.00.0000
12599 \labelwidthstring 00.00.0000
12611 \labelwidthstring 00.00.0000
12623 \labelwidthstring 00.00.0000
12638 \labelwidthstring 00.00.0000
12645 protected-space-insert
12649 \labelwidthstring 00.00.0000
12656 end-of-sentence-period-insert
12660 \labelwidthstring 00.00.0000
12671 \labelwidthstring 00.00.0000
12682 \labelwidthstring 00.00.0000
12693 \labelwidthstring 00.00.0000
12700 menu-separator-insert
12704 \labelwidthstring 00.00.0000
12711 hyphenation-point-insert
12715 \labelwidthstring 00.00.0000
12726 \labelwidthstring 00.00.0000
12733 command-sequence math-insert ^;math-mode;
12737 \labelwidthstring 00.00.0000
12744 command-sequence math-insert _;math-mode;
12749 \labelwidthstring 00.00.0000
12764 \labelwidthstring 00.00.0000
12771 file-insert-plaintext lines
12775 \labelwidthstring 00.00.0000
12782 file-insert-plaintext paragraphs
12786 \labelwidthstring 00.00.0000
12798 \labelwidthstring 00.00.0000
12810 \labelwidthstring 00.00.0000
12822 \labelwidthstring 00.00.0000
12833 \begin_layout Subsection
12838 \labelwidthstring 00.00.0000
12850 \labelwidthstring 00.00.0000
12862 \labelwidthstring 00.00.0000
12874 \labelwidthstring 00.00.0000
12886 \labelwidthstring 00.00.0000
12898 \labelwidthstring 00.00.0000
12910 \labelwidthstring 00.00.0000
12922 \labelwidthstring 00.00.0000
12934 \labelwidthstring 00.00.0000
12942 layout-save-default
12946 \labelwidthstring 00.00.0000
12958 \labelwidthstring 00.00.0000
12970 \labelwidthstring 00.00.0000
12981 \begin_layout Subsubsection
12984 Layout\SpecialChar \menuseparator
12991 \labelwidthstring 00.00.0000
13003 \labelwidthstring 00.00.0000
13015 \labelwidthstring 00.00.0000
13027 \labelwidthstring 00.00.0000
13039 \labelwidthstring 00.00.0000
13051 \labelwidthstring 00.00.0000
13063 \labelwidthstring 00.00.0000
13075 \labelwidthstring 00.00.0000
13087 \labelwidthstring 00.00.0000
13099 \labelwidthstring 00.00.0000
13111 \labelwidthstring 00.00.0000
13123 \labelwidthstring 00.00.0000
13135 \labelwidthstring 00.00.0000
13147 \labelwidthstring 00.00.0000
13159 \labelwidthstring 00.00.0000
13171 \labelwidthstring 00.00.0000
13183 \labelwidthstring 00.00.0000
13195 \labelwidthstring 00.00.0000
13207 \labelwidthstring 00.00.0000
13219 \labelwidthstring 00.00.0000
13231 \labelwidthstring 00.00.0000
13243 \labelwidthstring 00.00.0000
13255 \labelwidthstring 00.00.0000
13267 \labelwidthstring 00.00.0000
13279 \labelwidthstring 00.00.0000
13291 \labelwidthstring 00.00.0000
13303 \labelwidthstring 00.00.0000
13315 \labelwidthstring 00.00.0000
13327 \labelwidthstring 00.00.0000
13339 \labelwidthstring 00.00.0000
13351 \labelwidthstring 00.00.0000
13363 \labelwidthstring 00.00.0000
13374 \begin_layout Subsection
13378 \begin_layout Subsection
13382 \begin_layout Subsection
13386 \begin_layout Subsection
13391 \labelwidthstring 00.00.0000
13403 \labelwidthstring 00.00.0000
13415 \labelwidthstring 00.00.0000
13427 \labelwidthstring 00.00.0000
13439 \labelwidthstring 00.00.0000
13451 \labelwidthstring 00.00.0000
13459 layout ShortFoilhead
13463 \labelwidthstring 00.00.0000
13475 \labelwidthstring 00.00.0000
13487 \labelwidthstring 00.00.0000
13499 \labelwidthstring 00.00.0000
13511 \labelwidthstring 00.00.0000
13519 layout ShortRotatefoilhead
13523 \labelwidthstring 00.00.0000
13535 \labelwidthstring 00.00.0000
13547 \labelwidthstring 00.00.0000
13559 \labelwidthstring 00.00.0000
13567 drop-layouts-choice
13571 \labelwidthstring 00.00.0000
13586 \labelwidthstring 00.00.0000
13601 \labelwidthstring 00.00.0000
13613 \labelwidthstring 00.00.0000
13625 \labelwidthstring 00.00.0000
13633 layout Subsubsection
13637 \labelwidthstring 00.00.0000
13649 \labelwidthstring 00.00.0000
13657 layout Subparagraph
13661 \labelwidthstring 00.00.0000
13665 asterisk\InsetSpace ~
13674 \labelwidthstring 00.00.0000
13678 asterisk\InsetSpace ~
13687 \labelwidthstring 00.00.0000
13691 asterisk\InsetSpace ~
13700 \labelwidthstring 00.00.0000
13704 asterisk\InsetSpace ~
13713 \labelwidthstring 00.00.0000
13717 asterisk\InsetSpace ~
13722 layout Subsubsection*
13726 \labelwidthstring 00.00.0000
13730 asterisk\InsetSpace ~
13739 \labelwidthstring 00.00.0000
13743 asterisk\InsetSpace ~
13748 layout Subparagraph*
13752 \labelwidthstring 00.00.0000
13764 \labelwidthstring 00.00.0000
13772 layout Bibliography
13776 \labelwidthstring 00.00.0000
13788 \labelwidthstring 00.00.0000
13800 \labelwidthstring 00.00.0000
13812 \labelwidthstring 00.00.0000
13824 \labelwidthstring 00.00.0000
13836 \labelwidthstring 00.00.0000
13844 layout Rotatefoilhead
13848 \labelwidthstring 00.00.0000
13856 layout RightAddress
13860 \labelwidthstring 00.00.0000
13872 \labelwidthstring 00.00.0000
13884 \labelwidthstring 00.00.0000
13896 \labelwidthstring 00.00.0000
13907 \begin_layout Standard
13908 These ones are kept for backwards compatibility, but only make sense on
13913 \labelwidthstring 00.00.0000
13925 \labelwidthstring 00.00.0000
13933 layout Subsubsection*
13937 \labelwidthstring 00.00.0000
13948 \begin_layout Section
13952 \begin_layout Subsection
13959 \labelwidthstring 00.00.0000
13970 \labelwidthstring 00.00.0000
13981 \labelwidthstring 00.00.0000
13992 \labelwidthstring 00.00.0000
14003 \labelwidthstring 00.00.0000
14014 \labelwidthstring 00.00.0000
14025 \labelwidthstring 00.00.0000
14032 hyphenation-point-insert
14036 \labelwidthstring 00.00.0000
14047 \labelwidthstring 00.00.0000
14054 line-delete-forward
14058 \labelwidthstring 00.00.0000
14069 \labelwidthstring 00.00.0000
14080 \labelwidthstring 00.00.0000
14091 \labelwidthstring 00.00.0000
14102 \labelwidthstring 00.00.0000
14113 \labelwidthstring 00.00.0000
14124 \labelwidthstring 00.00.0000
14135 \labelwidthstring 00.00.0000
14146 \labelwidthstring 00.00.0000
14157 \labelwidthstring 00.00.0000
14168 \labelwidthstring 00.00.0000
14179 \labelwidthstring 00.00.0000
14190 \labelwidthstring 00.00.0000
14202 \labelwidthstring 00.00.0000
14214 \labelwidthstring 00.00.0000
14226 \labelwidthstring 00.00.0000
14238 \labelwidthstring 00.00.0000
14251 \labelwidthstring 00.00.0000
14263 \labelwidthstring 00.00.0000
14275 \labelwidthstring 00.00.0000
14287 \labelwidthstring 00.00.0000
14299 \labelwidthstring 00.00.0000
14312 \labelwidthstring 00.00.0000
14324 \labelwidthstring 00.00.0000
14336 \labelwidthstring 00.00.0000
14349 \labelwidthstring 00.00.0000
14362 \labelwidthstring 00.00.0000
14375 \labelwidthstring 00.00.0000
14388 \labelwidthstring 00.00.0000
14401 \labelwidthstring 00.00.0000
14414 \labelwidthstring 00.00.0000
14426 \labelwidthstring 00.00.0000
14438 \labelwidthstring 00.00.0000
14450 \labelwidthstring 00.00.0000
14458 menu-open Documents
14462 \labelwidthstring 00.00.0000
14474 \labelwidthstring 00.00.0000
14486 \labelwidthstring 00.00.0000
14498 \labelwidthstring 00.00.0000
14510 \labelwidthstring 00.00.0000
14522 \labelwidthstring 00.00.0000
14530 buffer-toggle-read-only
14534 \labelwidthstring 00.00.0000
14546 \labelwidthstring 00.00.0000
14558 \labelwidthstring 00.00.0000
14570 \labelwidthstring 00.00.0000
14581 \labelwidthstring 00.00.0000
14592 \labelwidthstring 00.00.0000
14603 \labelwidthstring 00.00.0000
14614 \labelwidthstring 00.00.0000
14625 \labelwidthstring 00.00.0000
14636 \labelwidthstring 00.00.0000
14647 \labelwidthstring 00.00.0000
14658 \labelwidthstring 00.00.0000
14669 \labelwidthstring 00.00.0000
14680 \labelwidthstring 00.00.0000
14691 \labelwidthstring 00.00.0000
14702 \labelwidthstring 00.00.0000
14713 \labelwidthstring 00.00.0000
14724 \labelwidthstring 00.00.0000
14731 word-delete-forward
14735 \labelwidthstring 00.00.0000
14742 word-delete-backward
14746 \labelwidthstring 00.00.0000
14757 \labelwidthstring 00.00.0000
14764 end-of-sentence-period-insert
14768 \labelwidthstring 00.00.0000
14775 protected-space-insert
14779 \labelwidthstring 00.00.0000
14790 \labelwidthstring 00.00.0000
14801 \labelwidthstring 00.00.0000
14812 \labelwidthstring 00.00.0000
14823 \labelwidthstring 00.00.0000
14834 \labelwidthstring 00.00.0000
14845 \labelwidthstring 00.00.0000
14852 buffer-begin-select
14856 \labelwidthstring 00.00.0000
14867 \labelwidthstring 00.00.0000
14874 paragraph-up-select
14878 \labelwidthstring 00.00.0000
14885 paragraph-down-select
14889 \labelwidthstring 00.00.0000
14896 word-backward-select
14900 \labelwidthstring 00.00.0000
14907 word-forward-select
14911 \labelwidthstring 00.00.0000
14922 \labelwidthstring 00.00.0000
14929 word-delete-forward
14933 \labelwidthstring 00.00.0000
14944 \labelwidthstring 00.00.0000
14955 \labelwidthstring 00.00.0000
14966 \labelwidthstring 00.00.0000
14977 \labelwidthstring 00.00.0000
14984 break-paragraph-keep-layout
14988 \labelwidthstring 00.00.0000
14998 \begin_layout Subsection
15005 \labelwidthstring 00.00.0000
15016 \labelwidthstring 00.00.0000
15027 \labelwidthstring 00.00.0000
15038 \labelwidthstring 00.00.0000
15049 \labelwidthstring 00.00.0000
15060 \labelwidthstring 00.00.0000
15071 \labelwidthstring 00.00.0000
15082 \labelwidthstring 00.00.0000
15093 \labelwidthstring 00.00.0000
15104 \labelwidthstring 00.00.0000
15115 \labelwidthstring 00.00.0000
15126 \labelwidthstring 00.00.0000
15137 \labelwidthstring 00.00.0000
15148 \labelwidthstring 00.00.0000
15159 \labelwidthstring 00.00.0000
15170 \labelwidthstring 00.00.0000
15181 \labelwidthstring 00.00.0000
15192 \labelwidthstring 00.00.0000
15203 \labelwidthstring 00.00.0000
15214 \labelwidthstring 00.00.0000
15225 \labelwidthstring 00.00.0000
15236 \labelwidthstring 00.00.0000
15247 \labelwidthstring 00.00.0000
15254 protected-space-insert
15258 \labelwidthstring 00.00.0000
15269 \labelwidthstring 00.00.0000
15280 \labelwidthstring 00.00.0000
15291 \labelwidthstring 00.00.0000
15298 buffer-new-template
15302 \labelwidthstring 00.00.0000
15313 \labelwidthstring 00.00.0000
15324 \labelwidthstring 00.00.0000
15335 \labelwidthstring 00.00.0000
15346 \labelwidthstring 00.00.0000
15357 \labelwidthstring 00.00.0000
15368 \labelwidthstring 00.00.0000
15379 \labelwidthstring 00.00.0000
15386 end-of-sentence-period-insert
15390 \labelwidthstring 00.00.0000
15401 \labelwidthstring 00.00.0000
15412 \labelwidthstring 00.00.0000
15419 hyphenation-point-insert
15423 \labelwidthstring 00.00.0000
15434 \labelwidthstring 00.00.0000
15441 protected-space-insert
15445 \labelwidthstring 00.00.0000
15456 \labelwidthstring 00.00.0000
15467 \labelwidthstring 00.00.0000
15478 \labelwidthstring 00.00.0000
15489 \labelwidthstring 00.00.0000
15500 \labelwidthstring 00.00.0000
15511 \labelwidthstring 00.00.0000
15522 \labelwidthstring 00.00.0000
15533 \labelwidthstring 00.00.0000
15544 \labelwidthstring 00.00.0000
15555 \labelwidthstring 00.00.0000
15566 \labelwidthstring 00.00.0000
15577 \labelwidthstring 00.00.0000
15588 \labelwidthstring 00.00.0000
15599 \labelwidthstring 00.00.0000
15610 \labelwidthstring 00.00.0000
15617 word-delete-forward
15621 \labelwidthstring 00.00.0000
15628 word-delete-backward
15632 \labelwidthstring 00.00.0000
15643 \labelwidthstring 00.00.0000
15654 \labelwidthstring 00.00.0000
15665 \labelwidthstring 00.00.0000
15676 \labelwidthstring 00.00.0000
15683 paragraph-down-select
15687 \labelwidthstring 00.00.0000
15698 \labelwidthstring 00.00.0000
15705 buffer-begin-select
15709 \labelwidthstring 00.00.0000
15716 word-backward-select
15720 \labelwidthstring 00.00.0000
15727 word-forward-select
15731 \labelwidthstring 00.00.0000
15738 paragraph-up-select
15742 \labelwidthstring 00.00.0000
15753 \labelwidthstring 00.00.0000
15760 break-paragraph-keep-layout
15764 \labelwidthstring 00.00.0000
15775 \labelwidthstring 00.00.0000
15786 \labelwidthstring 00.00.0000
15797 \labelwidthstring 00.00.0000
15808 \labelwidthstring 00.00.0000
15819 \labelwidthstring 00.00.0000
15830 \labelwidthstring 00.00.0000
15841 \labelwidthstring 00.00.0000
15852 \labelwidthstring 00.00.0000
15863 \labelwidthstring 00.00.0000
15874 \labelwidthstring 00.00.0000
15884 \begin_layout Subsection
15890 \begin_layout Standard
15891 These are LyX keyboard definitions for mathematics, similar to those of
15895 \begin_layout Standard
15896 The bindings file and the present documentation were prepared by Serge Winitzki
15897 with assistance from Jean-Marc Lasgouttes.
15898 Version 1.3, for LyX 1.2.x and 1.3.x.
15901 \begin_layout Standard
15902 These definitions make it a lot easier to type equations without using the
15903 mouse, especially for people familiar with Scientific Word.
15904 The standard LyX bindings such as
15915 \begin_layout Standard
15916 Tip: to find the "LyX bind name" for a key, look at the status bar after
15917 typing some non-existent key combination.
15919 to find how "Ctrl-&" is referenced, press Ctrl-S and then Ctrl-&: the status
15920 bar shows "C-s S-C-ampersand." (This does not work in LyX 1.3.0!)
15924 \labelwidthstring 00.00.0000
15933 -- Copy, cut, paste is as in Sciword,
15949 \labelwidthstring 00.00.0000
15958 -- Display equation toggle: type
15962 to insert a displayed formula (
15967 \begin_inset Quotes eld
15971 \begin_inset Quotes erd
15979 in a displayed formula to convert it back to an inline formula.
15983 \labelwidthstring 00.00.0000
15998 to insert a fraction (
16003 \begin_inset Quotes eld
16007 \begin_inset Quotes erd
16011 You can also select an expression and type
16015 to convert it to the numerator of a fraction.
16024 end of the denominator will delete the numerator and convert the denominator
16029 \labelwidthstring 00.00.0000
16041 \begin_inset Formula $\int$
16049 \begin_inset Quotes eld
16053 \begin_inset Quotes erd
16060 \labelwidthstring 00.00.0000
16067 line-delete-forward
16069 -- Emacs-like binding: delete forward of cursor to end of line.
16073 \labelwidthstring 00.00.0000
16082 -- A text/math toggle (
16087 \begin_inset Quotes eld
16091 \begin_inset Quotes erd
16094 ): switches to math in text mode, and also inserts roman text in math mode.
16104 \begin_inset Quotes eld
16108 \begin_inset Quotes erd
16115 \labelwidthstring 00.00.0000
16124 -- Add/remove numbering in a single equation.
16128 \labelwidthstring 00.00.0000
16137 -- Add/remove numbering at a line in equation arrays.
16140 \begin_layout Standard
16141 The above commands are toggles that control the numbering of equations (
16146 \begin_inset Quotes eld
16150 \begin_inset Quotes erd
16154 Note: when deleting a number in a labeled eqnarray, the label is not really
16155 removed (the TeX code becomes
16156 \begin_inset Quotes eld
16168 \begin_inset Quotes erd
16171 ) and this generates a (harmless) LaTeX warning.
16175 \labelwidthstring 00.00.0000
16184 -- Open a new document.
16189 \labelwidthstring 00.00.0000
16198 -- Insert a quote character " (
16203 \begin_inset Quotes eld
16207 \begin_inset Quotes erd
16212 \begin_inset Quotes eld
16216 \begin_inset Quotes erd
16219 double quote character that you get by default.
16223 \labelwidthstring 00.00.0000
16234 -- Square root sign
16235 \begin_inset Formula $\sqrt{x}$
16243 \begin_inset Quotes eld
16247 \begin_inset Quotes erd
16254 \labelwidthstring 00.00.0000
16266 \begin_inset Formula $\sqrt[n]{x}$
16273 \labelwidthstring 00.00.0000
16282 -- Another binding for a switch between the text and the math mode (
16287 \begin_inset Quotes eld
16291 \begin_inset Quotes erd
16295 Note that the roman text inserted in math mode is special.
16299 \labelwidthstring 00.00.0000
16312 the selected text (text mode only, use things like
16328 \labelwidthstring 00.00.0000
16337 -- W*ndows heritage.
16341 \labelwidthstring 00.00.0000
16350 -- Close the current document (again, a W*ndows heritage).
16354 \labelwidthstring 00.00.0000
16365 \labelwidthstring 00.00.0000
16376 \labelwidthstring 00.00.0000
16386 \begin_inset Quotes eld
16390 \begin_inset Quotes erd
16394 \begin_inset Quotes eld
16398 \begin_inset Quotes erd
16404 \begin_layout Standard
16405 Bracket delimiters: press
16409 -<bracket key> to insert a matching pair of delimiters.
16414 inserts a pair of parentheses
16415 \begin_inset Formula $\left[\right]$
16423 does the same thing.) It will switch to math mode if needed.
16424 The supported characters are ( [ { < |.
16425 It is the same to press the right or the left bracket.
16426 The corresponding delimiters are
16427 \begin_inset Formula $\left(\right)$
16431 \begin_inset Formula $\left[\right]$
16435 \begin_inset Formula $\left\{ \right\} $
16439 \begin_inset Formula $\left\langle \right\rangle $
16443 \begin_inset Formula $\left|\right|$
16448 \begin_inset Quotes eld
16452 \begin_inset Quotes erd
16455 and resize with their contents.
16456 Use Math Panel to get other or non-matching delimiters.
16457 Press backspace on the
16461 delimiter to remove both
16462 \begin_inset Quotes eld
16466 \begin_inset Quotes erd
16469 delimiters without removing their contents.
16473 \labelwidthstring 00.00.0000
16482 -- for convenience, pressing
16496 \labelwidthstring 00.00.0000
16507 \labelwidthstring 00.00.0000
16518 \labelwidthstring 00.00.0000
16529 \labelwidthstring 00.00.0000
16540 \labelwidthstring 00.00.0000
16551 \labelwidthstring 00.00.0000
16558 math-delim langle rangle
16560 -- angular delimiters
16561 \begin_inset Formula $\left\langle \right\rangle $
16564 , not to confuse with ordinary < > signs.
16568 \labelwidthstring 00.00.0000
16575 math-delim langle rangle
16578 \begin_layout Standard
16579 The bar bracket: on some keyboards (e.g.\InsetSpace ~
16580 some British ones), the bar character
16585 -something and on some wayward Unices to "brokenbar".
16586 So we define all of these keys as well.
16590 \labelwidthstring 00.00.0000
16601 \labelwidthstring 00.00.0000
16612 \labelwidthstring 00.00.0000
16623 \labelwidthstring 00.00.0000
16634 \labelwidthstring 00.00.0000
16644 \begin_layout Standard
16645 Accents are in most cases
16649 -<accent key>, e.g.\InsetSpace ~
16663 for tilde (you also need to press
16669 \begin_inset Quotes eld
16681 \begin_inset Quotes erd
16685 Some accents work only in math mode and others only in text mode.
16689 \labelwidthstring 00.00.0000
16698 -- overdot accent, ȧ (text mode only).
16702 \labelwidthstring 00.00.0000
16714 \begin_inset Formula $\dot{a}$
16717 (math mode only -- in physics this denotes a first derivative).
16721 \labelwidthstring 00.00.0000
16732 -- Vector accent over math
16733 \begin_inset Formula $\overrightarrow{x}$
16740 \labelwidthstring 00.00.0000
16749 -- umlaut accent, ä (text mode only)
16753 \labelwidthstring 00.00.0000
16764 -- double dot accent,
16765 \begin_inset Formula $\ddot{a}$
16768 (math mode only -- in physics this denotes a second derivative).
16769 To get a triple dot in math mode, use
16777 \labelwidthstring 00.00.0000
16786 -- grave accent à (text mode only, use
16796 \labelwidthstring 00.00.0000
16805 -- tilde accent ã (text mode only, use
16815 \labelwidthstring 00.00.0000
16824 -- acute accent á (text mode only, use
16834 \labelwidthstring 00.00.0000
16843 -- circumflex (caret) accent â (text mode only, use
16852 \begin_layout Standard
16854 The new key S-F2 for creating a LaTeX file seems handy.
16858 \labelwidthstring 00.00.0000
16867 -- Save current document.
16871 \labelwidthstring 00.00.0000
16878 buffer-export latex
16880 -- Write a LaTeX file for the current document.
16884 \labelwidthstring 00.00.0000
16893 -- Find and replace dialog.
16897 \labelwidthstring 00.00.0000
16914 \labelwidthstring 00.00.0000
16927 to quit LyX is the W*ndows w*ndow manager's mnemonic.
16930 \begin_layout Standard
16939 are used to switch fonts.
16944 to switch back to the normal font.
16945 The non-default font switches
16953 all work as toggles.
16954 They also work on the whole word if you put the cursor in the middle of
16955 the word, or if you select some text.
16959 \labelwidthstring 00.00.0000
16968 -- stop using any special font
16972 \labelwidthstring 00.00.0000
16989 \labelwidthstring 00.00.0000
17006 \labelwidthstring 00.00.0000
17023 \labelwidthstring 00.00.0000
17037 (Used sometimes for people's names.)
17040 \begin_layout Standard
17046 \begin_inset Quotes eld
17050 \begin_inset Quotes erd
17057 key (useful e.g.\InsetSpace ~
17058 if the keyboard has no working
17065 \begin_layout Standard
17066 Here are some Sciword-inspired mnemonics for frequently used math symbols.
17067 Many symbols start with a
17076 cannot be itself bound to anything.
17080 \labelwidthstring 00.00.0000
17092 \begin_inset Quotes eld
17096 \begin_inset Quotes erd
17100 \begin_inset Formula $\prime$
17104 This is frequently unnecessary: in most cases the normal apostrophe works
17107 \begin_inset Formula $x'+2x=0$
17110 , but in some cases this would generate a double superscript error in LaTeX.
17112 \begin_inset Formula $x^{\prime2}$
17116 \begin_inset Formula $x$
17119 prime squared) must be entered with the prime character.
17123 \labelwidthstring 00.00.0000
17131 command-sequence math-superscript; math-insert
17135 -- Insert a prime as a superscript (see example above).
17139 \labelwidthstring 00.00.0000
17148 -- Insert an upper index.
17155 \labelwidthstring 00.00.0000
17164 -- Insert a lower index.
17171 \labelwidthstring 00.00.0000
17183 -- Partial derivative symbol
17184 \begin_inset Formula $\partial$
17191 \labelwidthstring 00.00.0000
17203 -- Summation symbol
17204 \begin_inset Formula $\sum$
17207 (not the same as the Greek letter uppercase Sigma
17208 \begin_inset Formula $\Sigma$
17211 because it can resize and allows smart upper/lower limits).
17215 \labelwidthstring 00.00.0000
17228 \begin_inset Formula $\prod$
17231 (not the same as the Greek letter uppercase Pi,
17232 \begin_inset Formula $\Pi$
17239 \labelwidthstring 00.00.0000
17252 \begin_inset Formula $\infty$
17259 \labelwidthstring 00.00.0000
17272 \begin_inset Formula $\times$
17279 \labelwidthstring 00.00.0000
17289 -- Insert a stacked array
17290 \begin_inset Formula $\begin{array}{c}
17292 \end{array}\end{array}$
17296 (Frequently useful in formulae.)
17300 \labelwidthstring 00.00.0000
17311 \begin_inset Formula $\times$
17315 \begin_inset Formula $\begin{array}{ccc}
17320 (Then you can modify its size using the
17322 Edit\SpecialChar \menuseparator
17329 \labelwidthstring 00.00.0000
17342 \begin_inset Quotes eld
17346 \begin_inset Quotes erd
17350 \begin_inset Formula $\dagger$
17357 \labelwidthstring 00.00.0000
17370 \begin_inset Quotes eld
17374 \begin_inset Quotes erd
17378 \begin_inset Formula $\equiv$
17385 \labelwidthstring 00.00.0000
17397 \begin_inset Quotes eld
17400 Approximate equality
17401 \begin_inset Quotes erd
17405 \begin_inset Formula $\approx$
17412 \labelwidthstring 00.00.0000
17424 \begin_inset Quotes eld
17428 \begin_inset Quotes erd
17432 \begin_inset Formula $\sim$
17439 \labelwidthstring 00.00.0000
17451 \begin_inset Formula $\rightarrow$
17455 \begin_inset Formula $\lim_{x\rightarrow0}$
17462 \labelwidthstring 00.00.0000
17474 \begin_inset Formula $\leq$
17481 \labelwidthstring 00.00.0000
17492 -- Greater-or-equal
17493 \begin_inset Formula $\geq$
17500 \labelwidthstring 00.00.0000
17513 \begin_inset Quotes eld
17517 \begin_inset Quotes erd
17521 \begin_inset Formula $\ll$
17524 (useful in physics)
17528 \labelwidthstring 00.00.0000
17541 \begin_inset Quotes eld
17545 \begin_inset Quotes erd
17549 \begin_inset Formula $\gg$
17555 \begin_layout Subsection
17556 Standard math bindings
17560 \labelwidthstring 00.00.0000
17574 \labelwidthstring 00.00.0000
17586 \labelwidthstring 00.00.0000
17598 \labelwidthstring 00.00.0000
17612 \labelwidthstring 00.00.0000
17624 \labelwidthstring 00.00.0000
17636 \labelwidthstring 00.00.0000
17650 \labelwidthstring 00.00.0000
17662 \labelwidthstring 00.00.0000
17674 \labelwidthstring 00.00.0000
17686 \labelwidthstring 00.00.0000
17700 \labelwidthstring 00.00.0000
17714 \labelwidthstring 00.00.0000
17728 \labelwidthstring 00.00.0000
17742 \labelwidthstring 00.00.0000
17756 \labelwidthstring 00.00.0000
17770 \labelwidthstring 00.00.0000
17782 \labelwidthstring 00.00.0000
17796 \labelwidthstring 00.00.0000
17808 \labelwidthstring 00.00.0000
17820 \labelwidthstring 00.00.0000
17832 \labelwidthstring 00.00.0000
17844 \labelwidthstring 00.00.0000
17858 \labelwidthstring 00.00.0000
17870 \labelwidthstring 00.00.0000
17882 \labelwidthstring 00.00.0000
17894 \labelwidthstring 00.00.0000
17902 math-delim langle rangle
17906 \labelwidthstring 00.00.0000
17914 math-delim rangle langle
17918 \labelwidthstring 00.00.0000
17930 \labelwidthstring 00.00.0000
17944 \labelwidthstring 00.00.0000
17957 \begin_layout Subsection
17962 \labelwidthstring 00.00.0000
17974 \labelwidthstring 00.00.0000
17986 \labelwidthstring 00.00.0000
17998 \labelwidthstring 00.00.0000
18010 \labelwidthstring 00.00.0000