1 #LyX 1.6.0svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that the User's Guide prints
10 % out as advertised. If you mess with this preamble,
11 % parts of the User's Guide may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}{\usepackage{lmodern}}{%
21 \usepackage[scaled=0.92]{helvet}
23 \usepackage{courier} }
25 % link all cross references and URLs in pdf output
26 \usepackage[colorlinks=true, bookmarks, bookmarksnumbered,
27 linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,
28 pdfpagelayout=OneColumn, pdfnewwindow=true,
29 pdfstartview=XYZ, plainpages=false, pdfpagelabels,
30 pdfauthor={LyX Team}, pdftex,
31 pdftitle={Customizing LyX: Features for the Advanced User},pdfsubject={LyX-documentation Customization},
32 pdfkeywords={LyX, documentation}
35 \else % if dvi or ps is produced
37 % link all cross references and URLs in dvi output
38 \usepackage[ps2pdf]{hyperref}
40 \fi % end if pdflatex is used
42 % the pages of the TOC are numbered roman
43 % and a pdf-bookmark for the TOC is added
45 \let\myTOC\tableofcontents
46 \renewcommand\tableofcontents{%
47 \pdfbookmark[1]{Contents}{}
50 \pagenumbering{arabic} }
52 % redefine the \LyX macro for PDF bookmarks
53 \def\LyX{\texorpdfstring{%
54 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
57 % used for multi-column text
64 \inputencoding default
67 \font_typewriter default
68 \font_default_family default
74 \paperfontsize default
83 \paperorientation portrait
86 \paragraph_separation indent
88 \quotes_language english
91 \paperpagestyle headings
92 \tracking_changes false
101 Customizing LyX: Features for the Advanced User
109 \begin_layout Standard
111 Principal maintainer of this file is
116 If you have comments or error corrections, please send them to the LyX
117 Documentation mailing list, <lyx-docs@lists.lyx.org>.
125 \begin_layout Standard
126 \begin_inset CommandInset toc
127 LatexCommand tableofcontents
134 \begin_layout Chapter
138 \begin_layout Standard
139 This manual covers the customization features present in LyX.
140 In it, we discuss issues like keyboard shortcuts, screen previewing options,
141 printer options, sending commands to LyX via the LyX Server, internationalizati
142 on, installing new LaTeX classes and LyX layouts, etc.
143 We can't possibly hope to touch on everything you can change---our developers
144 add new features faster than we can document them---but we will explain
145 the most common customizations and hopefully point you in the right direction
146 for some of the more obscure ones.
149 \begin_layout Chapter
150 LyX configuration files
153 \begin_layout Standard
154 \begin_inset CommandInset label
160 This chapter aims to help you to find your way through the LyX configuration
162 Before continuing to read this chapter, you should find out where your
163 LyX library directory is by using
168 elp\SpecialChar \menuseparator
176 This directory is the place where LyX places its system-wide configuration
177 files, and we will simply name it
181 in the remainder of this document.
185 \begin_layout Section
193 \begin_layout Standard
198 and its sub-directories contain a number of files and that can be used
199 to customise LyX's behaviour.
200 You can change many of these files from within LyX itself through the
205 ools\SpecialChar \menuseparator
213 Most customization that you might want to do to LyX is possible through
215 However, many other inner aspects of LyX can be customized by modifying
221 They fall in different categories, described in the following subsections.
224 \begin_layout Subsection
225 Automatically generated files
228 \begin_layout Standard
229 These files are generated when you configure LyX.
230 They contain various default values that are guessed by inspection.
231 In general, it is not a good idea to modify them, since they might be overwritt
236 \labelwidthstring 00.00.0000
243 contains defaults for various commands.
247 \labelwidthstring 00.00.0000
254 contains the list of packages that have been recognized by LyX.
255 It is currently unused by the LyX program itself, but the information extracted
256 , and more, is made available with
261 elp\SpecialChar \menuseparator
273 \labelwidthstring 00.00.0000
280 is the list of text classes that have been found in your
284 directory, along with the associated LaTeX document class and their description.
288 \labelwidthstring 00.00.0000
293 is automatically generated during configuration from the file
300 \begin_layout Subsection
305 \labelwidthstring 00.00.0000
312 this directory contains files with the extension
316 that define the keybindings used in LyX (see section\InsetSpace ~
318 \begin_inset CommandInset ref
320 reference "sec:bindings"
325 If there exists an internationalized version of the bind file named
329 , that will be used first.
330 See Chapter\InsetSpace ~
332 \begin_inset CommandInset ref
334 reference "chap:i18n"
339 \begin_inset CommandInset ref
341 reference "sec:bindings"
349 \labelwidthstring 00.00.0000
356 contains graphics files that can be included in documents.
361 \labelwidthstring 00.00.0000
368 contains LyX documentation files (including the one you are currently reading).
373 deserves special attention, as noted above.
374 If there exists an internationalized version of the help-document with
379 prepended to the name, that will be used first.
380 See Chapter\InsetSpace ~
382 \begin_inset CommandInset ref
384 reference "chap:i18n"
392 \labelwidthstring 00.00.0000
399 contains example files that explain how to use some features.
400 In the file browser, press the
408 \labelwidthstring 00.00.0000
413 contains image files that are used by the
418 In addition, it also contains the individual icons used in the toolbar
419 and the banners that can be shown when LyX is launched.
423 \labelwidthstring 00.00.0000
430 contains keyboard keymapping files.
431 See Chapter\InsetSpace ~
433 \begin_inset CommandInset ref
435 reference "sec:keymap"
443 \labelwidthstring 00.00.0000
450 contains the text class files described in Chapter\InsetSpace ~
452 \begin_inset CommandInset ref
454 reference "chap:textclass"
462 \labelwidthstring 00.00.0000
467 contains some files that demonstrate the capabilities of the
469 External\InsetSpace ~
476 \labelwidthstring 00.00.0000
481 contains the standard LyX template files described in Chapter\InsetSpace ~
483 \begin_inset CommandInset ref
485 reference "sec:templates"
493 \labelwidthstring 00.00.0000
498 contains some LaTeX cls files distributed with LyX.
502 \labelwidthstring 00.00.0000
507 contains files with the extension
511 that define the user interface to LyX.
512 That is, the files define which items appear in which menus and the items
513 appearing on the toolbar.
514 See Chapter\InsetSpace ~
516 \begin_inset CommandInset ref
525 \begin_layout Subsection
526 Files you don't want to modify
529 \begin_layout Standard
530 These files are used internally by LyX and you generally do not need to
531 modify them unless you are a developer.
535 \labelwidthstring 00.00.0000
542 this file contains the list of LyX developers.
543 The contents are displayed with the menu entry
548 elp\SpecialChar \menuseparator
556 \labelwidthstring 00.00.0000
563 this is a LaTeX script used during the configuration process.
568 \labelwidthstring 00.00.0000
575 this is the script that is used to re-configure LyX.
576 It creates configuration files in the directory it was run from.
579 \begin_layout Subsection
580 Other files needing a line or two...
584 \labelwidthstring 00.00.0000
589 this contains tables describing how different character encodings can be
594 \labelwidthstring 00.00.0000
599 this file contains the templates available to the new
601 External\InsetSpace ~
608 \labelwidthstring 00.00.0000
613 this file contains a list of all the languages currently supported by LyX.
616 \begin_layout Section
617 Your local configuration directory
620 \begin_layout Standard
621 Even if you are using LyX as an unprivileged user, you might want to change
622 LyX configuration for your own use.
627 directory contains all your personal configuration files.
628 This is the directory described as
629 \begin_inset Quotes eld
633 \begin_inset Quotes erd
641 elp\SpecialChar \menuseparator
646 This directory is used as a mirror of
650 , which means that every file in
654 is a replacement for the corresponding file in
659 Any configuration file described in the above sections can be placed either
660 in the system-wide directory, in which case it will affect all users, or
661 in your local directory for your own use.
664 \begin_layout Standard
665 To make things clearer, let's provide a few examples:
668 \begin_layout Itemize
669 The preferences set in the
674 ools\SpecialChar \menuseparator
681 dialog are saved to a file
692 \begin_layout Itemize
693 When you reconfigure using
698 ools\SpecialChar \menuseparator
709 and the resulting files are written in your local configuration directory
710 (see section\InsetSpace ~
712 \begin_inset CommandInset ref
714 reference "sec:autodetected"
718 to have a list of the
722 settings affected by this section).
723 This means that any additional text class file that you might have added
728 will be added to the list of classes in the
733 ayout\SpecialChar \menuseparator
743 \begin_layout Itemize
744 Similarly, if you have installed some LaTeX document classes in your home
745 directory, that LaTeX can find with your
749 path, they will show up in your list of text classes.
753 \begin_layout Standard
754 as long as LyX or yourself have a
758 file for it, of course.
766 \begin_layout Itemize
767 If you get some updated documentation from LyX ftp site and cannot install
768 it because you do not have sysadmin rights on your system, you can just
783 \begin_layout Section
784 Running LyX with multiple configurations
787 \begin_layout Standard
788 The configuration freedom of the local configuration directory may not suffice
789 if you want to have more than one configuration at your disposal.
790 For example, you may want to be use different key bindings or printer settings
792 You can achieve this by having several such directories.
793 You then specify which directory to use at run-time.
796 \begin_layout Standard
797 Invoking LyX with the command line switch
805 instructs the program to read the configuration from that directory, and
806 not from the default directory (you can determine the default directory
807 by running LyX without this switch as described above).
808 If this directory does not exist, LyX offers to create it for you, just
809 like it does for the default directory on the first time you run the program.
810 You can modify the configuration options in this additional
814 exactly as you would for the default directory.
815 These directories are completely independent (but read on).
816 Note that setting the environment variable
820 to some value has exactly the same effect
825 \begin_layout Standard
826 Having several configurations also requires more maintenance: if you want
827 to add a new layout to
831 which you want available from all your configurations, you must add it
832 to each directory separately.
833 You can avoid this with the following trick: after LyX creates the additional
834 directory, most of the subdirectories (see above) are empty.
835 If you want the new configuration to mirror an existing one, replace the
836 empty subdirectory with a symbolic link to the matching subdirectory in
837 the existing configuration.
844 subirectory, however, since it contains a file written by the configuration
845 script (also accessible through
850 ools\SpecialChar \menuseparator
856 \begin_inset CommandInset ref
858 reference "sec:autodetected"
864 which is configuration-specific.
867 \begin_layout Chapter
875 \begin_layout Section
876 Using the dialog for the first time
879 \begin_layout Standard
884 file will contain only changes that you have made to the default behaviour,
885 some of which is hard-coded into LyX and some of which is contained in
888 LyXDir/lyxrc.defaults
891 Note that in both files lines beginning with a
892 \begin_inset Quotes eld
900 \begin_inset Quotes erd
903 are just comments and not interpreted.
904 However, only system administrators should edit
914 ools\SpecialChar \menuseparator
921 dialog to create and modify their own
928 \begin_layout Standard
934 ools\SpecialChar \menuseparator
941 dialog will be largely self-explanatory.
942 Almost all the commands have an associated comment, so you shouldn't have
943 too much trouble modifying it to taste.
944 Before we highlight a few of the more important commands below, however,
949 ing some of your changes (e.g., screen fonts) will have an instant effect.
951 changing the bind file) will not.
952 If nothing appears to have changed, just
956 the changes and restart LyX.
959 \begin_layout Section
963 \begin_layout Standard
964 The font used to display your documents on the LyX screen is very important,
965 since you'll be reading all your documents with this font.
966 Therefore it is important that the font is as readable and good-looking
968 The LyX team tried to provide the best possible default font for you, but
969 since practically all X11 systems are different, it's likely that the default
970 fonts will be sub-optimal on your system.
971 Fortunately, you can do something about this.
972 Before we explain how to do this, you should learn a bit more about fonts
973 so that you are better prepared for choosing your fonts, because it is
974 a trade-off that is specific to your preferences and the capabilities of
978 \begin_layout Standard
979 Notice that this section only deals with the fonts on the
983 inside the LyX window.
984 The fonts that appear on the
992 are independent from these fonts, and are determined by the document class.
997 to learn how to change the font of the printed version of your document.
1000 \begin_layout Standard
1001 Basically, screen fonts come in two different kinds: scalable outline fonts
1002 and non-scalable bitmap fonts.
1003 This distinction seems a bit arbitrary, since non-scalable fonts are actually
1004 scalable in most modern font renderers.
1005 The difference lies in the
1009 of the scaling, and the
1014 The most important decision is thus whether you should use non-scalable
1015 bitmap fonts or scalable outline fonts.
1018 \begin_layout Standard
1019 The scalable fonts are built from
1023 of the single glyphs (i.e.
1024 characters) in the font.
1025 This means that each glyph is defined using mathematical curves that are
1026 well suited for scaling to any requested size.
1027 This mathematical definition is interpreted by the font renderer and turned
1028 into a small picture composed of pixels according to which size and glyph,
1029 the programmer requests.
1030 This means that scalable fonts will look pretty good in all sizes.
1031 Well, almost all sizes.
1032 Since scalable fonts are defined in an abstract way, it can be hard to
1033 provide a good rendering at small sizes, where each pixel has to be very
1034 carefully computed to provide a good image.
1035 Technically it is possible to do this from the mathematical definition,
1036 but in order to keep the rendering reasonably fast, tradeoffs have to be
1037 made, and the result is that scalable fonts can be difficult to read at
1041 \begin_layout Standard
1042 Bitmap fonts on the other hand, are defined by bitmap graphics from the
1043 start, so they will look good at all the sizes they are meant for.
1044 However, they don't scale well, because in order to scale a glyph, each
1045 pixel is enlarged into several pixels.
1046 It is the same effect that happens if you try to enlarge a picture in
1050 or any other picture manipulation program.
1051 In order to relieve this effect, bitmap fonts are typically provided in
1052 several fixed sizes typically from around 8 pixels high up to 34 pixels
1053 or so high in steps according to what is believed to be useful.
1054 The advantage of bitmap fonts is that no complicated computations are necessary
1055 to display each glyph, so bitmap fonts are thus faster displayed than scalable
1057 The disadvantage is that sizes that don't exists as fixed versions have
1058 to be scaled by doubling pixels, and thus look bad.
1061 \begin_layout Standard
1062 The net result of all this, is that bitmap fonts are generally best for
1063 the small sizes, where they are available, while scalable fonts are generally
1064 best for large sizes.
1065 The logical conclusion would thus be to use bitmap fonts for the small
1066 sizes, and scalable fonts for the large sizes.
1067 Unfortunately, this is not a good idea, since bitmap fonts and scalable
1068 fonts are not designed to be used together, so the overall look of such
1069 a scheme would be bad.
1070 The best you can do is thus to try both schemes and decide for yourself
1074 \begin_layout Standard
1075 By default, LyX uses non-scalable bitmap fonts (when using the XForms frontend).
1080 is used, for sans serif fonts,
1088 is used as the monospaced/typewriter font.
1091 \begin_layout Standard
1092 In the following, we will describe what to do if the text does not look
1094 We'll start with the most important parameters: DPI and font zoom.
1097 \begin_layout Subsection
1098 DPI setting and Font Zoom
1101 \begin_layout Standard
1102 LyX automatically tries to scale the fonts to look as close as the paper
1103 output size as possible, except for the so-called font zoom factor.
1106 \begin_layout Standard
1107 In order for this to work on all systems, it relies on the screen DPI (dots
1108 per inch) setting to be correct.
1109 The DPI setting for your system is autodetected by LyX using the information
1110 the X server can provide.
1111 You can check what LyX autodetects the DPI setting to, by running LyX as
1119 \begin_layout Standard
1120 On many systems, X is not set up correctly, so you should check that it
1123 \begin_inset Quotes eld
1131 \begin_inset Quotes erd
1134 and write down what the DPI is for the resolution you use (this will be
1135 close to the value LyX detects).
1136 It is the number mentioned as
1137 \begin_inset Quotes eld
1141 \begin_inset Quotes erd
1145 Also write down the number of pixels you have in the width (the first number
1147 \begin_inset Quotes eld
1151 \begin_inset Quotes erd
1157 \begin_layout Standard
1158 Then get the good old ruler out of the closet, and measure the width of
1159 the visible screen-image on your monitor.
1160 Convert this measurement to inches if you used a centimeter ruler by dividing
1162 Now you can determine the correct DPI setting for your screen by dividing
1163 the number of pixels in the width by the width of the screen-image on the
1165 If this number is more than, say, 5 DPI from the detected value, you should
1166 either fix the X setup, or at least tell LyX that the DPI is different
1167 than the detected value.
1170 \begin_layout Standard
1171 If you can't fix the X setup (which of course is best since other programs
1172 than LyX will benefit from this as well), you can tell LyX the correct
1180 \begin_layout Standard
1181 If the text is too small or too big for your taste, you should fiddle with
1182 the font zoom setting.
1183 This setting is used to scale the point size of the text.
1184 If your DPI setting is correct, and the font zoom setting is set to 100,
1185 this means that LyX will try to display the text exactly the same size
1186 as it will appear on the paper-output.
1187 If you set the zoom factor to 200, the text will try to be 2 times as big
1189 Of course, this will only happen if LyX can find a font that has the appropriat
1190 e size, which you can't count on.
1191 Since LyX is a WYSIWYM system anyways, this limitation isn't much of an
1195 \begin_layout Standard
1196 The default font zoom setting is 150, since a monitor is typically wider
1197 than a piece of paper, but you should try to fiddle with it through the
1211 dialog to find a size that you like.
1212 When you've found a setting that seems to work nicely for you (tip: use
1220 button to keep the dialog open while you experiment), you can make this
1221 setting the default by using the
1231 \begin_layout Standard
1232 While it is often possible to find a suitable size for the text on the screen,
1233 this doesn't necessarily mean that the fonts are the best ones available
1235 In order to help you get the most out of your system, you can use the font
1236 definition commands to fine-tune the look of the text in greater detail
1240 \begin_layout Subsection
1241 Font definition commands
1244 \begin_layout Standard
1245 As mentioned, LyX uses non-scalable bitmap fonts by default with the XForms
1251 is used, for sans serif fonts,
1259 is used as the monospaced/typewriter font.
1262 \begin_layout Standard
1263 You can change all of these from within the
1268 The number of fonts that are available on different systems vary, but the
1273 should be available everywhere.
1274 Use that program to find candidate fonts.
1275 When you've found a font that you like, try to insert the first two elements
1277 \begin_inset Quotes eld
1281 \begin_inset Quotes erd
1285 \begin_inset Quotes eld
1289 \begin_inset Quotes erd
1296 ) in the appropriate field in the
1308 LyX will then reformat your document using the new font, and if you like
1309 the font, you should
1317 One place to start for a new font is to see if the scalable font
1318 \begin_inset Quotes eld
1322 \begin_inset Quotes erd
1326 Tip: You can see whether a font is a bitmap font or a scalable font by
1328 \begin_inset Quotes eld
1332 \begin_inset Quotes erd
1336 \begin_inset Quotes eld
1340 \begin_inset Quotes erd
1348 If the value 0 is available, the font is scalable.
1349 If the value 0 isn't available, the font is a bitmap font.
1352 \begin_layout Standard
1353 Before you go about scrapping a bitmap font because the larger sizes look
1355 \begin_inset Quotes eld
1359 \begin_inset Quotes erd
1362 , you should toggle the
1363 \begin_inset Quotes eld
1367 \begin_inset Quotes erd
1371 This is only useful if you use bitmap fonts, because only these don't scale
1373 If you define this flag, LyX will only use the fixed font sizes that are
1374 available, and this guarantees that all bitmap fonts look well.
1375 (You can see which individual font sizes are available with the
1384 .) However, the prize is that the difference between the size of the fonts
1385 on screen and the size of fonts on paper will be larger because LyX will
1386 have to be satisfied with the closest available size, and not try to scale
1388 Also, you can risk that some logically different sizes, such as
1396 , will be mapped to the same screen font, making it hard for you to see
1397 the difference on screen.
1398 We've decided not to use scalable fonts by default because of these artifacts,
1399 but since LyX is a WYSIWYM system, many people like to use the flag anyways,
1400 well-knowing that the font size on the screen can't be trusted.
1401 But remember that this flag only makes a difference when you use bitmap
1403 Scalable fonts won't be affected for reasons you should understand by now.
1406 \begin_layout Standard
1407 One final note regarding this flag: you should know that there is nothing
1408 wrong with using bitmap and scalable fonts at the same time for different
1410 For instance, it's common to use the scalable
1411 \begin_inset Quotes eld
1415 \begin_inset Quotes erd
1418 for the serif text together with a bitmap version of
1419 \begin_inset Quotes eld
1423 \begin_inset Quotes erd
1427 And you can safely select the
1428 \begin_inset Quotes eld
1432 \begin_inset Quotes erd
1435 button without worries: It will only apply to the Helvetica font.
1438 \begin_layout Standard
1439 Sometimes the artifacts introduced by use of the flag can be relieved by
1440 using the fine-detail screen font sizes which defines which point sizes
1441 the different logical font sizes correspond to.
1446 to see exactly what concrete fonts the logical sizes map to, and try adjusting
1447 the corresponding entries in the
1451 dialog until you've managed to hit the nail and get the fonts you want.
1452 This can be hard to do, because LyX uses the DPI setting and the font zoom
1453 settings to calculate which exact screen font size to ask the X server
1454 for, thus obfuscating the mapping.
1455 If you can't make it by trial-and-error, you can make the process more
1456 transparent if you set both the DPI setting and font zoom settings to 100---eve
1457 n when this is known to be wrong.
1458 This will of course make your scalable fonts look weird, so use with care.
1461 \begin_layout Subsection
1465 \begin_layout Standard
1466 By default, LyX will use fonts meant to write Western European text, including
1467 all kinds of English.
1468 This is defined through the so-called
1477 If you want to use LyX to write for instance Eastern European text, Cyrillic
1478 or any other language not covered by the ISO-8859-1 font encoding, you
1479 can define a different one with the encoding setting.
1480 This requires you to have special fonts installed.
1485 to see whether this is the case: check the
1486 \begin_inset Quotes eld
1490 \begin_inset Quotes erd
1494 \begin_inset Quotes eld
1498 \begin_inset Quotes erd
1501 fields for ISO-8859-X values different from ISO-8859-1, and search for
1502 one that contains the national characters of your language.
1503 If you find any, enter this encoding in the dialog.
1504 If not, go searching the Web for appropriate fonts.
1505 For the Qt frontend, it's recommended you use an iso646 font set.
1508 \begin_layout Standard
1509 When you've set LyX up to use a different font encoding, you should also
1510 consider changing the font used by dialog windows in LyX.
1517 dialog will not be understandable unless you tell LyX to use a different
1519 By default the menu font is set to
1521 -*-helvetica-medium-r
1523 , but often Helvetica is not available in the font encoding you need, so
1524 the dialog allows this to be changed.
1527 \begin_layout Standard
1528 As you can see, there are quite a few options that can be used to fine tune
1529 the look of your fonts.
1530 This should not scare you from fiddling with the settings, because after
1531 all, you will hopefully be using LyX for many hours in the future.
1532 And contrary to real WYSIWYG word processors where you are tied to using
1533 fonts that have to look good both on paper and on screen, LyX gives you
1534 the possibility of using fonts that are designed to look good on the screen
1535 while using a different set of fonts to look good on paper.
1538 \begin_layout Section
1540 \begin_inset CommandInset label
1549 \begin_layout Standard
1550 Bindings are used to, well, bind a function to a key.
1551 Several prepackaged binding files are available: a CUA set of bindings
1552 (familiar as the typical set of PC and CDE set of keyboard shortcuts),
1553 an Emacs set of bindings, for those of us who follow the One True Way and
1554 refuse to lower our standards,
1558 \begin_layout Standard
1559 I'm kidding here, of course!
1564 as well as specialty bindings (broadway and hollywood) and other languages
1565 (French, German, etc.).
1568 \begin_layout Standard
1569 If, however, you'd like to customise the keybindings to your own exacting
1570 tastes, then copy the best-fit file in
1579 Don't forget to load this new file into LyX using the
1584 (For the moment you'll have to restart LyX for these changes to take effect.)
1587 \begin_layout Standard
1588 LyX supports internationalization of the user interface (see Chapter\InsetSpace ~
1590 \begin_inset CommandInset ref
1592 reference "chap:i18n"
1601 is set, with the environment variable
1605 , LyX will try to use bindfiles by prepending
1610 For example, you can put a translated copy of some standard bind file in
1615 directory, and LyX will use it automatically.
1618 \begin_layout Standard
1623 files is straightforward:
1626 \begin_layout Standard
1631 bind <key combination> <lyx-function>
1634 \begin_layout Standard
1635 Both key combination and lyx-function (including any arguments) must be
1636 enclosed in "double quotes".
1637 All the LyX functions are listed in the
1644 \begin_layout Section
1646 \begin_inset CommandInset label
1655 \begin_layout Standard
1656 The appearance of both the menu and toolbar may both be changed using the
1671 For the moment, only one file exists,
1675 , but feel free to experiment.
1676 Just copy the file to the
1680 directory and play! Note that, for the moment, you'll have to restart LyX
1681 for these changes to take effect.
1684 \begin_layout Standard
1689 files is straightforward: have a look at
1702 entries must be ended with an explicit
1727 s and in the case of the
1728 \begin_inset Quotes eld
1732 \begin_inset Quotes erd
1740 One small word of warning.
1745 s may be inserted in a
1753 , but they are defined as
1764 \begin_layout Section
1765 \begin_inset CommandInset label
1767 name "sec:converters-etc"
1771 Converters, Formats, and Copiers
1774 \begin_layout Standard
1775 LyX has a powerful mechanism to convert to and from any file format using
1780 \begin_layout Subsection
1784 \begin_layout Standard
1785 The first step is to define your file formats if they are not already defined.
1788 Tools\SpecialChar \menuseparator
1789 Preferences:Converters
1792 Enter a new format name; a new GUI name (used in e.\InsetSpace \thinspace{}
1802 menus); and a file extension.
1807 \begin_layout Standard
1812 option tells LyX that a format is suitable for document export.
1813 If this is is set and if a suitable conversion route exists, the format
1816 File\SpecialChar \menuseparator
1820 The format will also appear in the
1824 menu if it has a specified viewer.
1825 Pure image formats, e.\InsetSpace \thinspace{}
1831 , should not use this option.
1832 Formats that can both represent vector graphics and documents like e.\InsetSpace \thinspace{}
1841 \begin_layout Standard
1844 Vector graphics format
1846 tells LyX that a format can contain vector graphics.
1847 This information is used to determine the target format of included graphics
1853 Included graphics may need to be converted to either
1869 cannot handle other image formats.
1870 If an included graphic is not already in
1882 format, it is converted to
1886 if the vector format option is set, and otherwise to
1893 \begin_layout Standard
1894 A Format can have a Viewer and Editor program associated with it.
1895 For example, you might want to use
1899 to view PostScript files.
1900 You can enter the program call and its options to the corresponding fields.
1901 For the call you can use the four variable listed in the next section.
1902 The viewer is launched when you view an image in LyX or use the
1907 If the operating system has a default viewer associated to a format, this
1908 viewer is used instead of the one defined here when you enter in the Viewer
1910 \begin_inset Quotes eld
1918 \begin_inset Quotes erd
1922 The editor is for example launched when you press the
1937 \begin_layout Subsection
1941 \begin_layout Standard
1942 Each format can have a Copier associated with it.
1943 These are defined in the
1945 Tools\SpecialChar \menuseparator
1949 Since all conversions from one format to another take place in LyX's temporary
1950 directory, it is sometimes necessary to modify a file before copying it
1951 to the temporary directory in order that the conversion may be performed.
1955 \begin_layout Standard
1956 For example, the file may refer to other files---images, for example---using
1957 relative filenames, and these may become invalid when the file is copied
1958 to the temporary directory.
1963 This is done by the Copier: It copies a file to (or from) the temporary
1964 directory and may modify it in the process.
1967 \begin_layout Standard
1968 Copiers may also be used for other purposes.
1969 For example, if appropriate converters are found, LyX will automatically
1970 install copiers for the
1980 When these formats are exported, the copier sees that not just the main
1981 HTML file but various associated files (style files, images, etc.) are also
1983 All these files are written to a subdirectory of the directory in which
1984 the original LyX file was found.
1988 \begin_layout Standard
1989 This copier can be customized.
1991 \begin_inset Quotes eld
1995 \begin_inset Quotes erd
1998 argument takes a comma-separated list of extensions to be copied; if it
1999 is omitted, all files will be copied.
2001 \begin_inset Quotes eld
2005 \begin_inset Quotes erd
2008 argument determines the extension added to the generated directory.
2010 \begin_inset Quotes eld
2018 \begin_inset Quotes erd
2021 , so HTML generated from
2023 /path/to/filename.lyx
2027 /path/to/filename.html.LyXconv
2038 \begin_layout Standard
2039 The definitions of the copiers may use four variables:
2043 \labelwidthstring 00.00.0000
2044 $$s The LyX system directory (e.\InsetSpace \thinspace{}
2054 \labelwidthstring 00.00.0000
2059 \labelwidthstring 00.00.0000
2064 \labelwidthstring 00.00.0000
2065 $$l The `LaTeX name'
2068 \begin_layout Standard
2069 The latter is to be given in a form suitable for inclusion in a LaTeX's
2076 command and is relevant only when exporting files suitable for such inclusion.
2079 \begin_layout Standard
2080 Copiers can be used to do almost anything with output files.
2081 For example, suppose you want generated pdf files to be copied to a special
2083 \begin_inset Flex CharStyle:Code
2086 \begin_layout Standard
2093 Then you could write a shell script such as this one:
2096 \begin_layout Standard
2097 \begin_inset listings
2101 \begin_layout Standard
2105 \begin_layout Standard
2109 \begin_layout Standard
2110 TOFILE=`basename $2`
2113 \begin_layout Standard
2114 cp $FROMFILE /home/you/pdf/$TOFILE
2119 Save that in your local LyX directory---say,
2120 \begin_inset Flex CharStyle:Code
2123 \begin_layout Standard
2124 /home/you/.lyx/scripts/pdfcopier.sh
2129 ---and make it executable, if you need to do so on your platform.
2132 Tools\SpecialChar \menuseparator
2139 format---or one of the other pdf formats---and enter
2140 \begin_inset Flex CharStyle:Code
2143 \begin_layout Standard
2144 pdfcopier.sh $$i $$o
2157 \begin_layout Subsection
2161 \begin_layout Standard
2162 To define a new converter, select an existing one, select a different format
2168 and\InsetSpace \thinspace{}
2169 /\InsetSpace \thinspace{}
2175 drop-down list, modify the
2179 field, and press the
2186 \begin_layout Standard
2187 You do not have to define converters between all the formats between which
2188 you want to convert.
2189 For example, you will note that there is no `LyX to PostScript' converter,
2190 but LyX will export PostScript.
2191 It does so by first creating a LaTeX file (no converter needs to be defined
2192 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2193 and finally converts the resulting DVI file to PostScript.
2194 LyX finds such `chains' of converters automatically, and it will always
2195 choose the shortest possible chain.
2196 You can, though, still define multiple conversion methods between file
2198 For example, the standard LyX configuration provides three ways to convert
2199 LaTeX to PDF: Directly, using
2203 ; via (DVI and) PostScript, using
2212 To define such alternate chains, you must define multiple target `file
2213 formats', as described in the next section.
2214 For example in the standard configuration the formats named
2226 are defined, all of which share the extension
2233 \begin_layout Standard
2234 Several variables can be used in the definition of converters:
2238 \labelwidthstring 00.00.0000
2239 $$s The LyX system directory
2243 \labelwidthstring 00.00.0000
2248 \labelwidthstring 00.00.0000
2253 \labelwidthstring 00.00.0000
2254 $$b The base filename of the input file
2258 \labelwidthstring 00.00.0000
2259 $$p The path to the input file
2262 \begin_layout Standard
2268 field you can enter the following flags, separated by commas:
2272 \labelwidthstring 00.00.0000
2273 latex This converter runs some form of LaTeX.
2274 This will make LyX's LaTeX error logs available.
2278 \labelwidthstring 00.00.0000
2279 needaux Needs the LaTeX
2283 file for the conversion.
2287 \labelwidthstring 00.00.0000
2291 \begin_layout Standard
2292 The following three flags are not really flags at all because they take
2303 \labelwidthstring 00.00.0000
2304 parselog If set, the converter's standard error will be redirected to a
2309 , and the script given as argument will be run as:
2311 script <infile.out >infile.log
2314 The argument may contain $$s.
2318 \labelwidthstring 00.00.0000
2319 resultdir The name of the directory in which the
2323 will dump the generated files.
2324 LyX will not create this directory, and it does not copy anything into
2325 it, though it will copy this directory to the destination.
2326 The argument may contain $$b, which will be replaced by the basename of
2327 the input and output files, respectively, when the directory is copied.
2330 that resultdir and usetempdir make no sense together.
2331 The latter will be ignored if the former is given.
2335 \labelwidthstring 00.00.0000
2336 resultfile Determines the output filename and may, contain $$b.
2337 Sensible only with resultdir, and optional even then; if not given, it
2338 defaults to `index'.
2341 \begin_layout Standard
2342 None of these last three are presently used in any of the converters that
2343 are installed with LyX.
2345 \begin_inset CommandInset ref
2347 reference "sub:LyX-and-Literate"
2351 of the Extended Features guide for some examples of how you might use parselog.
2354 \begin_layout Section
2355 BibTeX and makeindex
2358 \begin_layout Standard
2359 Both the bibliography generating command (default
2363 ) and the index generating command (default
2376 As an alternative for
2388 \begin_layout Standard
2389 The command to enter is
2395 makeindex.sh -m $$lang
2398 \begin_layout Standard
2399 where the placeholder
2403 will be replaced by the chosen document (babel) language.
2407 \begin_layout Standard
2408 have installed the packages
2425 at a shell prompt for a help page.
2428 \begin_layout Section
2429 Plain text export options
2432 \begin_layout Standard
2433 \begin_inset VSpace bigskip
2439 \begin_layout Standard
2441 There are a couple of commands that can be used to
2442 \begin_inset Quotes eld
2446 \begin_inset Quotes erd
2449 exported plain text files.
2450 Note that LyX automatically detects and uses the best settings for your
2451 system at installation time, but you can modify them if you disagree with
2455 \begin_layout Description
2459 Plain text\InsetSpace ~
2463 This option defines the command used to produce better plain text tables
2468 UNIX-commands (refer to their manpages for more information about them).
2469 Setting this as empty tells LyX to use the internal (inferior) formatter.
2472 \begin_layout Description
2476 Plain text\InsetSpace ~
2481 With this command you can set the default line length of the plain text
2483 Setting it to 0 means endless lines.
2486 \begin_layout Section
2490 \begin_layout Standard
2491 There are a bunch of configuration options that are used for interaction
2492 with the external print command from LyX.
2493 Normally the defaults are fine: if, however, your print command takes different
2494 option names, you can modify them here.
2497 \begin_layout Subsection
2501 \begin_layout Standard
2502 You can change the colors used by LyX on-screen using the new
2507 Alternatively, if you're feeling particularly perverse you could use the
2512 bindable function (see the
2517 Input would have the format:
2520 \begin_layout Standard
2523 set-color LyXName X11Color
2526 \begin_layout Standard
2527 Here is a (partial) list of the functions and default colors:
2530 \begin_layout Standard
2532 \begin_inset Tabular
2533 <lyxtabular version="3" rows="10" columns="3">
2535 <column alignment="left" valignment="top" leftline="true" width="0pt">
2536 <column alignment="left" valignment="top" leftline="true" width="0pt">
2537 <column alignment="center" valignment="top" leftline="true" rightline="true" width="0pt">
2538 <row topline="true" bottomline="true">
2539 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2542 \begin_layout Standard
2557 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2560 \begin_layout Standard
2575 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2578 \begin_layout Standard
2594 <row topline="true">
2595 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2598 \begin_layout Standard
2613 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2616 \begin_layout Standard
2631 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2634 \begin_layout Standard
2650 <row topline="true">
2651 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2654 \begin_layout Standard
2669 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2672 \begin_layout Standard
2687 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2690 \begin_layout Standard
2706 <row topline="true">
2707 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2710 \begin_layout Standard
2725 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2728 \begin_layout Standard
2743 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2746 \begin_layout Standard
2762 <row topline="true">
2763 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2766 \begin_layout Standard
2781 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2784 \begin_layout Standard
2799 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2802 \begin_layout Standard
2818 <row topline="true">
2819 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2822 \begin_layout Standard
2837 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2840 \begin_layout Standard
2850 fraction Lines, brackets, etc.
2855 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2858 \begin_layout Standard
2874 <row topline="true">
2875 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2878 \begin_layout Standard
2893 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2896 \begin_layout Standard
2902 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2905 \begin_layout Standard
2921 <row topline="true">
2922 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2925 \begin_layout Standard
2940 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2943 \begin_layout Standard
2949 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2952 \begin_layout Standard
2968 <row topline="true">
2969 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2972 \begin_layout Standard
2987 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2990 \begin_layout Standard
2996 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2999 \begin_layout Standard
3015 <row topline="true" bottomline="true">
3016 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3019 \begin_layout Standard
3034 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3037 \begin_layout Standard
3047 selection background
3052 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3055 \begin_layout Standard
3078 \begin_layout Section
3079 The autodetected settings
3082 \begin_layout Standard
3083 \begin_inset CommandInset label
3085 name "sec:autodetected"
3089 There are several items that are detected for you when you run
3096 \SpecialChar \menuseparator
3102 In this section, we list those which pertain to the user preferences.
3105 \begin_layout Description
3111 plaintext_roff_command
3126 , depending on what is available.
3129 \begin_layout Description
3142 plus a bunch of options.
3145 \begin_layout Description
3158 on systems (so-called System V) who have this command, and
3162 otherwise (BSD systems).
3165 \begin_layout Description
3171 print_spool_printerprefix
3182 , depending on whether
3193 \begin_layout Description
3210 fonts are found and LaTeX has support for these fonts built-in.
3211 You can set it manually if you only have the so-called
3218 \begin_layout Section
3222 \begin_layout Standard
3223 There are many other configuration options that can be used to customize
3225 We still need to document them here, but again, most should be fairly obvious.
3226 Please ask on the mailing lists if you need some more information; it may
3227 even prompt us to expand this section.
3230 \begin_layout Chapter
3231 Internationalizing LyX
3232 \begin_inset CommandInset label
3241 \begin_layout Standard
3242 LyX supports using a translated interface.
3243 Last time we checked, LyX provided text in 14 languages together with the
3244 default English text.
3245 The language of choice is called your
3250 (For further reading on locale settings, see also the documentation for
3251 locale that comes with your operating system.
3252 For Linux, the manual page for locale(5) could be a good place to start).
3255 \begin_layout Standard
3256 Notice that these translations will work, but do contain a few flaws.
3257 In particular, all dialogs have been designed with the English text in
3258 mind, which means that some of the translated text will be too large to
3259 fit within the space allocated.
3260 This is only a display problem and will not cause any harm.
3261 Also, you will find that some of the translations do not define short-cut
3262 keys for everything.
3263 Sometimes, there are simply not enough free letters to do it.
3264 Other times, the translator just hasn't got around to doing it yet.
3265 Our localization team -- which you may wish to join -- will try to fix
3266 these shortcomings in future versions of LyX.
3269 \begin_layout Section
3270 Selecting an alternative language for the user interface
3273 \begin_layout Standard
3274 This feature is disabled by default, meaning that system default language
3276 To enable an alternative language, you have to set an appropriate environment
3284 for csh class shells
3299 with the two letter code (or four letter code, like
3303 for British English) for the language you want.
3309 Besides the user interface texts being translated, also the appropriate
3310 manuals will be presented under the Help menu -- if available.
3313 \begin_layout Standard
3314 On some systems, you may have to redefine
3326 , to override the system settings; their preference is in this order
3330 \begin_layout Standard
3331 The shell variable LANGUAGE has been disabled in LyX for technical reasons.
3337 , which corresponds to the way GNU
3342 Consult your system documentation.
3343 Normally, you'll want to put the appropriate line in a shell script run
3344 on start-up, so that the translation is on by default.
3345 Remember that this affects
3349 localized packages, not only LyX!
3352 \begin_layout Standard
3353 If LyX is configured and compiled with
3354 \begin_inset Quotes eld
3362 \begin_inset Quotes erd
3365 , this mechanism will not work.
3368 \begin_layout Section
3372 \begin_layout Subsection
3373 Translating the graphical user interface (text messages).
3376 \begin_layout Standard
3381 library to handle the internationalization of the interface.
3382 To have LyX speak your favorite language in all menus and dialogs, you
3387 -file for that language.
3388 When this is available, you'll have to generate a mo-file from it and install
3394 The process of doing all of this is explained in the documentation for
3399 , but in short, this is what you do (
3403 denotes the language code):
3406 \begin_layout Standard
3410 \begin_layout Standard
3422 \begin_layout Itemize
3425 LYX-SOURCE-DIR/po/lyx.pot
3438 doesn't exist, it can be remade with
3442 in that directory, or you can use an existing po-file for some other language
3446 \begin_layout Itemize
3453 \begin_layout Standard
3454 We recommend that you use Emacs to do this, since the
3458 distribution includes a nice mode that supports you in doing this.
3466 For some menu- and widget-labels, there are also shortcut keys that should
3468 Those keys are marked after a `|', and should be translated according to
3469 the words and phrases of the
3474 There is a tool named
3478 written in Prolog in
3480 LYX-SOURCE-DIR/development/tools/
3482 that may be useful to help determine short-cut keys.
3483 Note that XForms (version 0.86 at least) can't handle anything but 7-bit
3484 characters as shortcut keys.
3485 You should also fill also out the information at the beginning of the new
3490 -file with your email-address, etc., so people know where to reach you with
3491 suggestions and entertaining flames.
3494 \begin_layout Itemize
3503 This can be done with
3524 \begin_layout Itemize
3529 -file to your locale-tree, at the correct directory for application messages
3534 , and under the name
3543 /usr/local/share/locale/
3554 \begin_layout Standard
3558 \begin_layout Standard
3570 \begin_layout Standard
3571 Adding a new po-file to the
3575 of LyX involves altering the configure scripts and more, but the way
3579 works, you don't actually need the source-code of LyX to translate it---having
3595 \begin_layout Standard
3596 If you've written a translation file for a language that LyX does not currently
3597 support, feel free to submit it for inclusion by sending a patch.
3598 In this case, we recommend that you read the
3606 directory for more instructions.
3609 \begin_layout Subsubsection
3613 \begin_layout Standard
3614 Sometimes it turns out that one english message needs to be translated into
3615 different messages in the target language.
3616 One example is the message
3620 which has the german translation
3637 does not handle such ambigous translations.
3638 Therefore you have to add some context information to the message: Instead
3645 To[[as in 'From format x to format y']]
3649 To[[as in 'From page x to page y']].
3652 Now the two occurences of
3660 and can be translated correctly to
3675 \begin_layout Standard
3676 Of course the context information needs to be stripped off the original
3677 message when no translation is used.
3678 Therefore you have to put it in double square brackets at the end of the
3679 message (see the example above).
3680 The translation mechanism of LyX ensures that everything in double square
3681 brackets at the end of messages is removed before displaying the message.
3684 \begin_layout Subsection
3685 Translating the documentation.
3688 \begin_layout Standard
3689 The online documentation (in the
3696 -menu) can (and should!) be translated.
3697 If there are translated versions of the documentation available
3701 \begin_layout Standard
3702 As of February 2003, almost all of the docs have been translated into German
3708 has been translated into at least 12 other languages, with other translations
3710 The library of translated documents is growing rapidly.
3715 , and the locale is set accordingly, these will be used automagically by
3717 LyX looks for translated versions as
3731 denotes the language as set by the environmental variable
3736 If there are none, the default English versions will be displayed.
3737 Note that the translated versions must have the same filenames (
3741 above) as the original.
3742 If you feel up to translating the documentation (an excellent way to proof-read
3743 the original documentation BTW!), there are a few things you should do
3747 \begin_layout Itemize
3752 , the guide to writing LyX documentation.
3753 Pay special attention to the translator's section.
3756 \begin_layout Itemize
3757 Check out the documentation translation web page at
3758 \begin_inset Flex URL
3761 \begin_layout Standard
3763 http://www.devel.lyx.org
3769 That way, you can find out which (if any) documents have already been translate
3770 d into your language.
3771 You can also find out who (if anyone) is organizing the effort to translate
3772 the documentation into your language.
3773 If no one is organizing the effort, please let us know that you're interested.
3776 \begin_layout Standard
3777 Once you get to actually translating, here's a few hints for you that may
3781 \begin_layout Itemize
3782 Join the documentation team! There is information on how to do that in
3791 elp\SpecialChar \menuseparator
3798 ), which by the way is the first document you should translate.
3801 \begin_layout Itemize
3802 Learn the typographic conventions for the language you are translating to.
3803 Typography is an ancient art and over the centuries, a great variety of
3804 conventions have developed throughout different parts of the world.
3805 Also study the professional terminology amongst typographers in your country.
3806 Inventing your own terminology will only confuse the users.
3809 (Warning! Typography is addictive!)
3812 \begin_layout Itemize
3813 Make a copy of the document.
3814 This will be your working copy.
3815 You can use this as your personal translated help-file by placing it in
3823 \begin_layout Itemize
3824 Sometimes the original document (from the LyX-team) will be updated.
3825 Use the ViewCVS tool available at
3826 \begin_inset Flex URL
3829 \begin_layout Standard
3831 http://www.lyx.org/viewcvs.cgi/lyxdoc/
3836 to see what has been changed
3840 \begin_layout Standard
3841 Alternatively, you can keep a copy of the latest version of the English
3842 document which you've translated.
3848 That way you can easily see which parts of the translated document need
3852 \begin_layout Itemize
3853 If you ever find an error in the original document, fix it and notify the
3854 rest of the documentation team of the changes! (You didn't forget to join
3855 the documentation team did you?)
3858 \begin_layout Section
3859 International Keyboard Support
3862 \begin_layout Standard
3865 [Editor's Note: The following section is by
3873 It needs to be fixed to conform to the new Documentation Style sheet and
3874 to make use of the new v1.0 features.
3875 The whole thing also needs to be merged with the section following it.-jw]
3878 \begin_layout Subsection
3879 Defining Own Keymaps: Keymap File Format
3882 \begin_layout Standard
3883 Let's look at a keyboard definition file a little closer.
3884 It is a plain text file defining
3887 \begin_layout Itemize
3888 key-to-key or key-to-string translations
3891 \begin_layout Itemize
3895 \begin_layout Itemize
3896 dead keys exceptions
3899 \begin_layout Standard
3900 To define key-to-key or key-to-string translation, use this command:
3903 \begin_layout Quotation
3919 \begin_layout Standard
3924 is the key to be translated and
3928 is the string to be inserted into the document.
3929 To define dead keys, use:
3932 \begin_layout Quotation
3948 \begin_layout Standard
3958 The following dead keys are supported (shortcut name is in parentheses):
3961 \begin_layout Quotation
3969 \begin_layout Quotation
3975 \begin_layout Quotation
3981 \begin_layout Quotation
3987 \begin_layout Quotation
3993 \begin_layout Quotation
4000 \begin_layout Standard
4012 \begin_layout Quotation
4018 \begin_layout Quotation
4025 \begin_layout Standard
4037 \begin_layout Quotation
4043 \begin_layout Quotation
4049 \begin_layout Quotation
4056 \begin_layout Standard
4068 \begin_layout Quotation
4075 \begin_layout Standard
4087 \begin_layout Quotation
4093 \begin_layout Quotation
4094 hungarian umlaut (hug)
4099 \begin_layout Quotation
4105 \begin_layout Quotation
4112 \begin_layout Standard
4124 \begin_layout Standard
4125 Since in many international keyboards there are exceptions to what some
4126 dead keys should do, you can define them using
4129 \begin_layout Quotation
4138 deadkey key outstring
4141 \begin_layout Standard
4142 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
4146 \begin_layout Quotation
4160 \begin_layout Standard
4161 to make it work correctly.
4162 Also, you have to define as exceptions dead keys over i and j, to remove
4163 the dot from them before inserting an accent mark.
4164 I will change this when the time comes, but so far I haven't had time.
4167 \begin_layout Standard
4168 Oh, and about characters: backslash is escaped, so to enter it, you'll need
4174 have different meaning.
4179 marks comments, quotes start and end LaTeX-style commands.
4180 To enter quote, you'll need to use
4199 \begin_layout Standard
4200 If you make a keyboard description file that works for your language, please
4201 mail it to me, so I can include it in the next keymap distribution.
4204 \begin_layout Standard
4205 More keywords will be supported in keymap configuration file in future,
4209 \begin_layout Itemize
4227 \begin_layout Itemize
4242 an external keymap translation program
4245 \begin_layout Standard
4246 Also, it should look into
4250 file for defaults, too (for example, a
4256 option to include default keyboard).
4259 \begin_layout Section
4260 International Keymap Stuff
4261 \begin_inset CommandInset label
4270 \begin_layout Standard
4271 The next two sections describe the
4283 file syntax in detail.
4284 These sections should help you design your own key map if the ones provided
4285 do not meet your needs.
4288 \begin_layout Subsection
4292 \begin_layout Standard
4301 file maps keystrokes to characters or strings.
4302 As the name suggests it sets a keyboard mapping.
4327 are described in this section.
4331 \labelwidthstring 00.00.0000
4338 Map a character to a string
4341 \begin_layout LyX-Code
4356 \begin_layout Standard
4389 the double-quote (")
4406 must be escaped with a preceding backslash (
4417 \begin_layout Standard
4424 statement to cause the symbol
4430 to be output for the keystroke
4439 \begin_layout LyX-Code
4446 \labelwidthstring 00.00.0000
4453 Specify an accent character
4456 \begin_layout LyX-Code
4465 \begin_layout Standard
4466 This will make the cha
4504 This is the dead key
4508 \begin_layout Standard
4515 refers to a key that does not produce a character by itself, but when followed
4516 with another key, produces the desired accent character.
4517 For example, a German characte
4519 r with an umlaut like
4529 can be produced in this manner.
4538 \begin_layout Standard
4551 and then another key not in
4568 followed by the other, unallowed key, as output.
4577 cancels a dead key, so if
4594 , the cursor will not go one position backwards but will instead cancel
4611 might have had on the next keystroke.
4615 \begin_layout Standard
4616 The following example specifies that the character ' is to be an acute accent,
4617 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4620 \begin_layout LyX-Code
4623 kmod ' acute aeiouAEIOU
4627 \labelwidthstring 00.00.0000
4632 Specify an exception to the accent character
4635 \begin_layout LyX-Code
4644 \begin_layout Standard
4645 This defines an exce
4686 have been assigned a keystroke with a previous
4709 must not belong in the
4761 If such a declaration does not exist in
4817 \begin_layout Standard
4818 The following command produces causes äi to be produced when you enter acute-i
4822 \begin_layout LyX-Code
4837 \labelwidthstring 00.00.0000
4842 Combine two accent characters
4845 \begin_layout LyX-Code
4851 accent1 accent2 allowed
4854 \begin_layout Standard
4855 This one is getting pretty esoteric.
4856 It allows you to combine the effect
4937 \begin_layout Standard
4938 Consider this example from the
4947 \begin_layout LyX-Code
4950 kmod ; acute aeioyvhAEIOYVH
4954 kcomb acute umlaut iyIY
4957 \begin_layout Standard
4958 This allows you to press
4964 and get the effect of
4981 in this case cancels the last dead key, so if you press
4998 \begin_layout Subsection
5002 \begin_layout Standard
5009 mapping is performed, a
5016 file maps the strings that the symbols generate to characters in the current
5018 The LyX distribution currently includes at least the
5033 \begin_layout Standard
5040 file is a sequence of declarations of the form
5043 \begin_layout LyX-Code
5056 \begin_layout Standard
5057 For example, in order to map
5065 to the corresponding character in the iso-8859-1 set (233), the following
5069 \begin_layout LyX-Code
5077 \begin_layout Standard
5100 the same character can apply to more than one string.
5111 \begin_layout LyX-Code
5137 \begin_layout Standard
5138 If LyX cannot find a mapping for the string produced by the keystroke or
5139 a deadkey sequence, it will check if it looks like an accented char and
5140 try to draw an accent over the character on screen.
5143 \begin_layout Subsection
5147 \begin_layout Standard
5148 There is a second way to add support for international characters through
5149 so-called dead-keys.
5150 A dead-key works in combination with a letter to produce an accented character.
5151 Here, we'll explain how to create a really simple dead-key to illustrate
5155 \begin_layout Standard
5156 Suppose you happen to need the circumflex character,
5157 \begin_inset Quotes eld
5161 \begin_inset Quotes erd
5169 -key [a.k.a.\InsetSpace ~
5174 ] to the LyX command
5183 Now, whenever you type the
5187 -key followed by a letter, that letter will have a circumflex accent on
5189 For example, the sequence
5190 \begin_inset Quotes eld
5198 \begin_inset Quotes erd
5201 produces the letter:
5202 \begin_inset Quotes eld
5206 \begin_inset Quotes erd
5210 If you tried to type
5211 \begin_inset Quotes eld
5219 \begin_inset Quotes erd
5222 , however, LyX will complain with a beep, since a
5223 \begin_inset Quotes eld
5231 \begin_inset Quotes erd
5234 never takes a circumflex accent.
5239 after a dead-key produces the bare-accent.
5240 Please note this last point! If you bind a key to a dead-key, you'll need
5241 to rebind the character on that key to yet another key.
5246 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5249 \begin_layout Standard
5250 One common way to bind dead-keys is to use
5262 in combination with an accent, like
5263 \begin_inset Quotes eld
5271 \begin_inset Quotes erd
5275 \begin_inset Quotes eld
5283 \begin_inset Quotes erd
5287 \begin_inset Quotes eld
5295 \begin_inset Quotes erd
5299 Another way involves using
5307 [remember them from section?] to set up the special
5316 acts in some ways just like
5320 and permits you to bind keys to accented characters.
5321 You can also turn keys into dead-keys by binding them to something like
5326 and then binding this symbolic key to the corresponding LyX command.
5330 \begin_layout Standard
5335 : This is exactly what I do in my
5353 and a bunch of these
5354 \begin_inset Quotes eld
5362 \begin_inset Quotes erd
5365 symbolic keys bound such things as
5376 This is how I produce my accented characters.
5381 You can make just about anything into the
5389 keys, a spare function key, etc.
5390 As for the LyX commands that produce accents, check the entry for
5399 You'll find the complete list there.
5402 \begin_layout Subsection
5403 Saving your Language Configuration
5406 \begin_layout Standard
5407 \begin_inset CommandInset label
5413 You can edit your preferences so that your desired language environment
5414 is automatically configured when LyX starts up, via the
5419 dit\SpecialChar \menuseparator
5429 \begin_layout Chapter
5430 Installing New Document Classes, Layouts, and Templates
5431 \begin_inset CommandInset label
5433 name "chap:textclass"
5441 \begin_layout Standard
5442 Installing New Document Classes
5450 \begin_layout Standard
5451 In this chapter, we describe the procedures for creating and installing
5452 new LyX layout and template files, as well as offer a refresher on correctly
5453 installing new LaTeX document classes.
5454 Some definitions: a document class is a LaTeX file (usually ending in
5462 ) which describes the format of a document such as an article, report, journal
5464 and all the commands needed to realize that format.
5465 A layout file is a LyX file which corresponds to a LaTeX document class
5466 and which tells LyX how to
5467 \begin_inset Quotes eld
5471 \begin_inset Quotes erd
5474 things on the screen to make the display look something like the final
5476 More precisely, a layout file describes a
5477 \begin_inset Quotes eld
5481 \begin_inset Quotes erd
5484 which is the internal construct LyX uses to render the screen display.
5486 \begin_inset Quotes eld
5490 \begin_inset Quotes erd
5494 \begin_inset Quotes eld
5498 \begin_inset Quotes erd
5501 can be used somewhat interchangeably, but it is better to refer to the
5502 file as the layout, and the thing living in LyX's memory as the text class.
5503 A template file is simply a LyX document which contains a set of predefined
5504 entries for a given document class which are generally required for that
5506 Templates are especially useful for things like journal manuscripts which
5507 are to be submitted electronically.
5510 \begin_layout Section
5511 Installing a new LaTeX package
5514 \begin_layout Standard
5515 Some installations may not include a LaTeX package that you would like to
5517 For example, you might need FoilTeX, a common (and very powerful) package
5518 for preparing slides or viewgraphs for overhead projectors.
5519 Here are the formal steps involved in getting the package up and running
5520 if you are using teTeX or some other web2c based distribution.
5524 \begin_layout Enumerate
5525 Get the package from CTAN or wherever.
5529 \begin_layout Standard
5532 Inventory of your LaTeX configuration
5534 manual for details of what CTAN is and where supported document classes
5543 \begin_layout Enumerate
5548 (this usually lives in the directory
5552 , though you can run
5557 It describes how to add a local
5561 directory; follow the instructions.
5562 You need to insert the name of your local
5575 is a logical place to install software that did not come with your distribution
5581 Usually, you will have to modify only two things:
5585 \begin_layout Enumerate
5590 to the directory you chose; e.g.
5595 TEXMFLOCAL = /usr/local/texmf
5598 \begin_layout Enumerate
5612 TEXMF = {$HOMETEXMF,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5616 \begin_layout Enumerate
5627 You must follow the directory structure of your existing
5631 directory (for example, latex packages should go under
5633 /usr/local/texmf/tex/latex/
5638 \begin_layout Enumerate
5639 Install the package.
5640 For example, you would unpack the FoilTeX tarball and create
5642 /usr/local/texmf/tex/latex/foiltex
5649 directory contains various files.
5652 \begin_layout Enumerate
5660 /usr/local/texmf/ls-R
5665 \begin_layout Enumerate
5666 From within LyX, do:
5671 ools\SpecialChar \menuseparator
5682 \begin_layout Standard
5683 Now you should see your new package---for example
5692 ayout\SpecialChar \menuseparator
5707 Note that there are simpler ways of installing packages: you can add a
5708 link to the new package directory in the system LaTeX directory (
5712 , don't forget to then run
5716 ), or sometimes simply set the
5720 environment variable to include the new package.
5721 However, the formal procedure described in
5725 is guaranteed to work, so you should follow it unless circumstances absolutely
5726 prevent it: such as, when you don't have superuser access.
5729 \begin_layout Section
5730 \begin_inset CommandInset label
5739 \begin_layout Standard
5740 This section describes how to write and install your own LyX layout files
5741 (also known as text classes) and walks through the
5745 text class format as an example.
5750 files describe what paragraph styles are available for a given document
5751 class and how LyX should display them.
5752 We try to provide a thorough description of the process here; however,
5753 there are so many different types of documents supported by LaTeX classes
5754 that we can't hope to cover every different possibility or problem you
5756 (The LyX users' list is frequented by people with lots of experience with
5757 layout design who are willing to share what they've learned.)
5760 \begin_layout Standard
5761 As you prepare to write a new layout, it is extremely helpful to look at
5762 the example layouts distributed with LyX.
5763 If you use a nice LaTeX document class that might be of interest for others,
5764 too, and have a nice corresponding LyX layout, feel free to contribute
5765 the stuff to us, so we may put it into the distribution.
5766 There is also a section on the LyX wiki for this kind of material.
5769 \begin_layout Standard
5770 All the tags described in this chapter are case-insensitive; this means
5783 are really the same command.
5784 The possible values are printed in brackets after the feature's name.
5785 The default value if a feature isn't specified inside a text class-description
5793 If the argument has a datatype like
5794 \begin_inset Quotes eld
5798 \begin_inset Quotes erd
5802 \begin_inset Quotes eld
5806 \begin_inset Quotes erd
5809 , the default is shown like this:
5819 \begin_layout Subsection
5823 \begin_layout Standard
5824 Similar to layout files, and new with LyX 1.6, are layout
5829 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5830 some modules---such as the Endnotes module---provide support for just such
5832 In a sense, layout modules are similar to included files---files like stdsectio
5833 ns.inc---in that modules are not specific to a given document layout but
5834 may be used with many different layouts.
5835 The difference is that using a layout module does not require editing the
5837 Rather, modules are selected in the
5842 ocument\SpecialChar \menuseparator
5852 \begin_layout Standard
5853 Building modules is the easiest way to get started with layout editing,
5854 since it can be as simple as adding a single new paragraph or flex inset.
5855 But modules may, in principle, contain anything a layout file can contain.
5858 \begin_layout Standard
5859 A module must begin with a line like the following:
5862 \begin_layout LyX-Code
5865 DeclareLyXModule[endnotes.sty]{Endnotes}
5868 \begin_layout Standard
5869 The argument in square brackets is optional: It declares any LaTeX packages
5870 on which the module depends.
5871 The mandatory argument, in curly brackets, is the name of the module, as
5874 Document\SpecialChar \menuseparator
5878 LyX uses the name to identify the module, so it should be unique.
5881 \begin_layout Standard
5882 The module declaration should then be followed by lines like the following:
5885 \begin_layout LyX-Code
5889 \begin_layout LyX-Code
5890 #Adds an endnote command, in addition to footnotes.
5894 \begin_layout LyX-Code
5895 #You will need to add
5897 theendnotes in ERT where you
5900 \begin_layout LyX-Code
5901 #want the endnotes to appear.
5905 \begin_layout LyX-Code
5909 \begin_layout LyX-Code
5910 #Requires: somemodule | othermodule
5913 \begin_layout LyX-Code
5914 #Excludes: badmodule
5917 \begin_layout Standard
5918 The description is used in
5920 Document\SpecialChar \menuseparator
5923 to provide the user with information about what the module does.
5924 The Requires is used to identify other modules with which this one must
5925 be used; the Excludes line is used to identify modules with which this
5926 one may not be used.
5927 Both are optional, and, as shown, multiple modules should be separated
5928 with the pipe symbol: |.
5929 Note that the required modules are treated disjunctively:
5933 of the required modules must be used.
5938 excluded module may be used.
5939 Note that modules are identified here by their
5943 without the .module extension.
5945 \begin_inset Flex CharStyle:Code
5948 \begin_layout Standard
5955 \begin_inset Flex CharStyle:Code
5958 \begin_layout Standard
5967 \begin_layout Standard
5968 After creating a new module, you will need to reconfigure and then restart
5969 LyX for it to appear in the menu.
5970 However, changes you make to the module will be seen immediately, if you
5973 Document\SpecialChar \menuseparator
5976 , highlight something, and then hit
5977 \begin_inset Quotes eld
5981 \begin_inset Quotes erd
5987 It is strongly recommended that you save your work before doing so
5990 In fact, it is strongly recommended that you not attempt to edit modules
5991 while simultaneously working on documents.
5992 Though of course the developers strive to keep LyX stable in such situations,
5993 syntax errors and the like in your module file could cause strange behavior.
5996 \begin_layout Subsection
5997 Supporting new document classes
6000 \begin_layout Standard
6001 There are two situations you are likely to encounter when wanting to support
6002 a new LaTeX document class, involving LaTeX2e class (
6011 Supporting a style file is usually fairly easy.
6012 Supporting a new document class is a bit harder.
6015 \begin_layout Subsection
6023 \begin_layout Standard
6024 If your new document class is provided as a style file that is used in conjuncti
6025 on with an existing, supported document class---for the sake of the example,
6026 we'll assume that the style file is called
6030 and it is meant to be used with
6034 , which is a standard class---start by copying the existing class's layout
6035 file into your local directory:
6038 \begin_layout LyX-Code
6039 cp report.layout ~/.lyx/layouts/myclass.layout
6042 \begin_layout Standard
6047 and change the line:
6050 \begin_layout LyX-Code
6053 DeclareLaTeXClass{report}
6056 \begin_layout Standard
6060 \begin_layout LyX-Code
6063 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6066 \begin_layout Standard
6070 \begin_layout LyX-Code
6080 \begin_layout Standard
6081 near the top of the file.
6084 \begin_layout Standard
6085 Start LyX and select
6090 ools\SpecialChar \menuseparator
6098 Then restart LyX and try creating a new document.
6103 " as a document class option in the
6108 ocument\SpecialChar \menuseparator
6116 It is likely that some of the sectioning commands and such in your new
6117 class will work differently from how they worked in the base class---
6121 in this example---so you can fiddle around with the settings for the different
6122 sections if you wish.
6123 See below for more discussion on this.
6126 \begin_layout Subsection
6134 \begin_layout Standard
6135 There are two possibilities here.
6136 One is that the class file is itself based upon an existing document class.
6137 For example, many thesis classes are based upon
6142 To see whether yours is, look for a line like
6145 \begin_layout LyX-Code
6151 \begin_layout Standard
6153 If so, then you may proceed largely as in the previous section, though
6154 the DeclareLaTeXClass line will be different.
6155 If your new class is thesis, and it is based upon book, then the line should
6159 \begin_layout LyX-Code
6162 DeclareLaTeXClass[myclass, book]{thesis}
6165 \begin_layout Standard
6166 If, on the other hand, the new class is not based upon an existing class,
6167 you will probably have to
6168 \begin_inset Quotes eld
6172 \begin_inset Quotes erd
6176 We strongly suggest copying an existing layout file which uses a similar
6177 LaTeX class and then modifying it, if you can do so.
6178 At least use an existing file as a starting point so you can find out what
6179 items you need to worry about.
6180 Again, the specifics are covered below.
6183 \begin_layout Section
6184 Declaring a new text class
6187 \begin_layout Standard
6188 When it's finally time to get your hands dirty and create or edit your own
6189 layout file, the following sections describe what you're up against.
6190 Our advice is to go slowly, save and test often, listen to soothing music,
6191 and enjoy one or two of your favorite adult beverages; more if you are
6192 getting particularly stuck.
6193 It's really not that hard, except that the multitude of options can become
6194 overwhelming if you try to do to much in one sitting.
6195 Go have another adult beverage, just for good measure.
6198 \begin_layout Standard
6202 \begin_layout Standard
6203 Lines in a layout file which begin with a
6208 There is one exception to this rule: all layouts should begin with lines
6212 \begin_layout LyX-Code
6215 #% Do not delete the line below; configure depends on this
6218 \begin_layout LyX-Code
6223 DeclareLaTeXClass{article}
6226 \begin_layout Standard
6227 The second line is used when you configure LyX.
6228 The layout file is read by the LaTeX script
6232 , in a special mode where
6237 The first line is just a LaTeX comment, and the second one contains the
6238 declaration of the text class.
6239 If these lines appear in a file named
6243 , then they define a text class of name
6247 (the name of the layout file) which uses the LaTeX document class
6251 (the default is to use the same name as the layout).
6253 \begin_inset Quotes eld
6257 \begin_inset Quotes erd
6260 that appears above is used as a description of the text class in the
6265 ocument\SpecialChar \menuseparator
6275 \begin_layout Standard
6276 Let's assume that you wrote your own text class that uses the
6280 documentclass, but where you changed the appearance of the section headings.
6281 If you put it in a file
6285 , the header of this file should be:
6288 \begin_layout LyX-Code
6291 #% Do not delete the line below; configure depends on this
6294 \begin_layout LyX-Code
6299 DeclareLaTeXClass[article]{article (with my own headings)}
6302 \begin_layout Standard
6303 This declares a text class
6307 , associated with the LaTeX document class
6312 \begin_inset Quotes eld
6315 article (with my own headings)
6316 \begin_inset Quotes erd
6320 If your text class depends on several packages, you can declare it as:
6323 \begin_layout LyX-Code
6326 #% Do not delete the line below; configure depends on this
6329 \begin_layout LyX-Code
6334 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6337 \begin_layout Standard
6338 This indicates that your text class uses the foo.sty package.
6339 Finally, it is also possible to declare classes for DocBook code.
6340 Typical declarations will look like
6343 \begin_layout LyX-Code
6346 #% Do not delete the line below; configure depends on this
6349 \begin_layout LyX-Code
6354 DeclareDocBookClass[article]{SGML (DocBook article)}
6357 \begin_layout Standard
6358 Note that these declarations can also be given an optional parameter declaring
6359 the name of the document class (but not a list).
6362 \begin_layout Standard
6363 When the text class has been modified to your taste, all you have to do
6364 is to copy it either in
6377 ools\SpecialChar \menuseparator
6385 Exit LyX and restart it; then your new text class should be available along
6389 \begin_layout Standard
6390 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6391 you made to your layout files.
6392 As a result, editing layout files could be very time consuming.
6393 Beginning with 1.6, however, you can force a reload of the layout currently
6394 in use by using the LyX function
6399 There is no default binding for this function---though, of course, you
6400 can bind it to a key yourself (see section
6401 \begin_inset CommandInset ref
6403 reference "sec:bindings"
6408 You should simply enter this command in the mini-buffer.
6413 : This is very much an `advanced feature'.
6418 recommended that you save your work before using this function.
6423 recommended that you not attempt to edit your layout while simultaneously
6424 working on a document that you care about.
6425 Use a test document.
6426 Syntax errors and the like in your layout file could cause peculiar behavior.
6427 In particular, such errors could cause LyX to regard the current layout
6428 as invalid and to attempt to switch to some other layout.
6429 The LyX team strives to keep LyX stable in such situations, but safe is
6433 \begin_layout Subsection
6437 \begin_layout Standard
6438 The first non-comment line must contain the file format number:
6441 \begin_layout Description
6452 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6453 don't have an explicit file format).
6454 The file format that is documented here is
6461 \begin_layout Subsection
6462 General text class parameters
6465 \begin_layout Standard
6466 These are the general parameters which describe the form of the entire document:
6469 \begin_layout Standard
6473 \begin_layout Standard
6485 \begin_layout Description
6499 ] Whether the class-default should have one or two columns.
6500 Can be changed in the
6505 ocument\SpecialChar \menuseparator
6513 This setting (same goes for
6517 , too) is important: if your text class has two columns by default but you
6518 forget to set it correctly, the
6526 be output when you select
6535 ocument\SpecialChar \menuseparator
6543 \begin_layout Description
6557 ] Whether the class-default should be printing on one or both sides of the
6559 Can be changed in the
6564 ocument\SpecialChar \menuseparator
6574 \begin_layout Description
6588 ] The class default pagestyle.
6589 Can be changed in the
6594 ocument\SpecialChar \menuseparator
6604 \begin_layout Description
6608 ClassOptions\SpecialChar \ldots{}
6612 This section describes various global options supported by the document
6614 See Section\InsetSpace ~
6616 \begin_inset CommandInset ref
6618 reference "sec:classoptions"
6625 \begin_layout Description
6643 ] Whether the class already provides the feature
6648 A feature is in general the name of a package (amsmath, makeidx, \SpecialChar \ldots{}
6650 macro (url, boldsymbol,\SpecialChar \ldots{}
6651 ); the complete list of supported features is unfortunat
6655 \begin_layout Description
6666 ] Whether the class requires the feature
6671 A feature is in general the name of a package (amsmath, makeidx, \SpecialChar \ldots{}
6673 macro (url, boldsymbol,\SpecialChar \ldots{}
6675 Multiple features must be separated by commas.
6676 Note that you can only request supported features; unfortunately, the complete
6677 list of supported features is not documented (however,
6682 elp\SpecialChar \menuseparator
6689 gives an overview of the supported packages).
6692 \begin_layout Description
6699 This is used to describe the default font of the document.
6700 See Section\InsetSpace ~
6702 \begin_inset CommandInset ref
6704 reference "sec:fonts"
6711 \begin_layout Description
6722 ] This is the style that will be assigned to new paragraphs, usually
6727 This will default to the first defined style if not given, but you are
6728 highly encouraged to use this directive.
6731 \begin_layout Description
6748 ] Indicates what kind of markup is used to define the title of a document.
6753 means that the macro with name
6757 will be inserted after the last layout which has
6758 \begin_inset Quotes eld
6766 \begin_inset Quotes erd
6774 corresponds to the case where the block of paragraphs which have
6775 \begin_inset Quotes eld
6783 \begin_inset Quotes erd
6786 should be enclosed into the
6795 \begin_layout Description
6806 ] The name of the command/environment mentionned above.
6809 \begin_layout Description
6813 Preamble\SpecialChar \ldots{}
6817 A set of macro definitions that will be output at the beginning of the
6819 Use this for global definitions.
6822 \begin_layout Description
6829 As its name implies, this command allows you to include another layout
6830 definition file within yours to avoid duplicating commands.
6831 Common examples are the standard layout files, for example,
6835 , which contains most of the basic layouts.
6838 \begin_layout Description
6842 Style\SpecialChar \ldots{}
6846 This sequence defines a new style.
6847 If the style already exists, it will redefine some of its parameters instead.
6848 See Section\InsetSpace ~
6850 \begin_inset CommandInset ref
6852 reference "sec:style"
6859 \begin_layout Description
6866 This command deletes an existing style.
6867 This is particularly useful when you want to suppress a style that has
6868 be defined in an input file.
6871 \begin_layout Description
6875 Float\SpecialChar \ldots{}
6879 This sequence defines a new float.
6880 See Section\InsetSpace ~
6882 \begin_inset CommandInset ref
6884 reference "sec:floats"
6891 \begin_layout Description
6898 This command deletes an existing float.
6899 This is particularly useful when you want to suppress a float that has
6900 be defined in an input file.
6903 \begin_layout Description
6907 InsetLayout\SpecialChar \ldots{}
6911 This section (re-)defines the layout of an inset.
6912 It can be applied to an existing inset of to a new, user-defined inset,
6913 e.g., a new character style.
6914 See Section\InsetSpace ~
6916 \begin_inset CommandInset ref
6918 reference "sec:charstyle"
6925 \begin_layout Description
6929 Counter\SpecialChar \ldots{}
6933 This sequence defines a new counter.
6934 See Section\InsetSpace ~
6936 \begin_inset CommandInset ref
6938 reference "sec:counter"
6945 \begin_layout Standard
6949 \begin_layout Standard
6961 \begin_layout Subsection
6969 \begin_layout Standard
6970 \begin_inset CommandInset label
6972 name "sec:classoptions"
6980 section can contain the following entries:
6983 \begin_layout Description
6994 ] The list of available font sizes for the document's main font, separated
6996 \begin_inset Quotes eld
7004 \begin_inset Quotes erd
7010 \begin_layout Description
7019 string="empty|plain|headings|fancy"
7021 ] The list of available page styles, separated by
7022 \begin_inset Quotes eld
7030 \begin_inset Quotes erd
7036 \begin_layout Description
7047 ] Some document class options, separated by a comma, that will be added
7048 to the optional part of the
7057 \begin_layout Subsection
7058 Specific Paragraph Layouts
7061 \begin_layout Standard
7062 \begin_inset CommandInset label
7068 A paragraph layout description looks like this
7072 \begin_layout Standard
7073 Note that this will either define a new layout or modify an existing one.
7081 \begin_layout LyX-Code
7088 \begin_layout LyX-Code
7092 \begin_layout LyX-Code
7096 \begin_layout Standard
7097 where the following commands are allowed:
7100 \begin_layout Standard
7104 \begin_layout Standard
7116 \begin_layout Description
7127 This is used to copy all the features of an existing layout into the current
7132 \begin_layout Description
7144 , Command, Environment, Item_Environment,
7150 ] How the layout should be translated into LaTeX.
7155 means nothing special.
7168 {\SpecialChar \ldots{}
7183 }\SpecialChar \ldots{}
7207 is generated for each paragraph of this environment.
7220 is passed as an argument to the environment.
7225 can be defined in the
7230 ayout\SpecialChar \menuseparator
7244 is perhaps a bit misleading, since these rules apply to SGML classes, too.
7245 Visit the SGML class files for specific examples.
7248 \begin_layout Description
7259 If 1, marks the layout as being part of a title block (see also the
7270 \begin_layout Description
7277 The name of the corresponding LaTeX stuff.
7278 Either the environment or command name.
7281 \begin_layout Description
7288 The optional parameter for the corresponding
7295 This parameter cannot be changed from within LyX.
7298 \begin_layout Description
7309 ] The number of optional arguments that can be used with this layout.
7310 This is useful for things like section headings, and only makes sense with
7314 \begin_layout Description
7326 , Manual, Dynamic, First_Dynamic, Right_Address_Box
7330 The kind of margin that the layout has on the left side.
7335 just means a fixed margin.
7340 means that the left margin depends on the string entered in the
7345 dit\SpecialChar \menuseparator
7350 aragraph\InsetSpace ~
7354 This is used to typeset nice lists without tabulators.
7359 means that the margin depends on the size of the label.
7360 This is used for automatic enumerated headlines.
7361 It is obvious that the headline
7362 \begin_inset Quotes eld
7365 5.4.3.2.1 Very long headline
7366 \begin_inset Quotes erd
7369 must have a wider left margin (as wide as
7370 \begin_inset Quotes eld
7374 \begin_inset Quotes erd
7377 plus the space) than
7378 \begin_inset Quotes eld
7381 3.2 Very long headline
7382 \begin_inset Quotes erd
7385 , even if other word processors are not able to do this.
7390 is similar, but only the very first row of the paragraph is dynamic, while
7391 the others are static; this is used, for example, for descriptions.
7396 means the margin is chosen in a way that the longest row of this paragraph
7397 fits to the right margin.
7398 This is used to typeset an address on the right edge of the page.
7401 \begin_layout Description
7418 ] Whether the following Paragraph is allowed to indent its very first row.
7423 means that it is not allowed to do so,
7427 means it could do so if it wants to.
7430 \begin_layout Description
7441 ] The indent of the very first line of a paragraph.
7442 The argument is passed as a string.
7447 means that the paragraph is indented with the width of
7456 You can get a negative width by prefixing the string with
7461 This way was chosen so that the look is the same with each used screen
7467 will be fixed for a certain layout.
7468 The exception is Standard layout, since the indentation of a Standard layout
7469 paragraph can be prohibited with
7474 Also, Standard layout paragraphs inside environments use the
7478 of the environment, not their native one.
7479 For example, Standard paragraphs inside an enumeration are not indented.
7482 \begin_layout Description
7493 ] LyX allows to choose either
7494 \begin_inset Quotes eld
7498 \begin_inset Quotes erd
7502 \begin_inset Quotes eld
7506 \begin_inset Quotes erd
7509 to typeset a document.
7511 \begin_inset Quotes eld
7515 \begin_inset Quotes erd
7518 is chosen, this value is completely ignored.
7520 \begin_inset Quotes eld
7524 \begin_inset Quotes erd
7527 is chosen, the parindent of a LaTeXtype
7528 \begin_inset Quotes eld
7532 \begin_inset Quotes erd
7535 layout is ignored and all paragraphs are additionally separated by this
7537 The vertical space is calculated with
7539 value*DefaultHeight()
7545 is the height of a row with the normal font.
7546 This way, the look stays the same with different screen fonts.
7549 \begin_layout Description
7560 ] The vertical space with which the very first of a chain of paragraphs
7561 with this layout is separated from the previous paragraph.
7562 If the previous paragraph has another layout, the separations are not simply
7563 added, but the maximum is taken.
7566 \begin_layout Description
7581 for the very last paragraph.
7584 \begin_layout Description
7595 ] The vertical space between two paragraphs of this layout.
7598 \begin_layout Description
7609 ] This is an extra space between the paragraphs of an environment layout.
7610 If you put other layouts into an environment, each is separated with the
7616 But the whole items of the environment are additionally separated with
7625 \begin_layout Description
7636 ] If you put layouts into environments, the leftmargins are not simply added,
7637 but added with a factor
7638 \begin_inset Formula $\frac{4}{depth+4}$
7642 Note that this parameter is also used when the border is defined as
7651 Then it is added to the manual or dynamic border.
7652 This string has the same meaning as for
7659 \begin_layout Description
7677 \begin_layout Description
7689 , Manual, Static, Top_Environment,
7691 Centered_Top_Environment, Sensitive,
7700 means the label is the very first word (up to the first real blank).
7705 means it is defined in the layout (see
7716 Centered_Top_Environment
7718 are special cases of
7723 The label will be printed above the paragraph, but only at the top of an
7724 environment or the top of a chain of paragraphs with this layout.
7725 Usage is for example the
7734 This is also the case for
7738 labels with latex type
7742 , in order to make layouts for theorems work correctly.
7747 is a special case for the caption-labels
7748 \begin_inset Quotes eld
7752 \begin_inset Quotes erd
7756 \begin_inset Quotes eld
7760 \begin_inset Quotes erd
7768 means the (hardcoded) label string depends on the kind of float.
7773 label type defines automatically numbered labels.
7776 \begin_layout Description
7789 The name of the counter for automatic numbering (see Section\InsetSpace ~
7791 \begin_inset CommandInset ref
7793 reference "sec:counter"
7798 This must be given if
7811 \begin_layout Description
7822 ] The horizontal space between the label and the text body.
7823 Only used for labels that are not above the text body.
7826 \begin_layout Description
7833 [float=0] The vertical space between the label and the text body.
7834 Only used for labels that are above the text body (
7840 Centered_Top_Environment
7845 \begin_layout Description
7856 ] The string used for a label with a
7865 this string is also used as a suggestion for the
7869 that can be set in the
7874 dit\SpecialChar \menuseparator
7879 aragraph\InsetSpace ~
7889 is set, this string can be contain the special formatting commands described
7890 in Section\InsetSpace ~
7892 \begin_inset CommandInset ref
7894 reference "sec:counter"
7899 For the sake of backwards compatibility, the string
7907 will be replaced by the expanded
7918 This feature is now obsolete and should be replaced by the mechanisms of
7919 Section\InsetSpace ~
7921 \begin_inset CommandInset ref
7923 reference "sec:counter"
7930 \begin_layout Description
7941 ] This is used inside the appendix instead of
7962 \begin_layout Description
7969 The level of the style in the table of contents.
7970 This is used for automatic numbering of section headings.
7973 \begin_layout Description
7985 , Box, Filled_Box, Static
7987 ] The type of label that stands at the end of the paragraph (or sequence
8010 \begin_inset Quotes eld
8014 \begin_inset Quotes erd
8026 ) is a white (resp.\InsetSpace ~
8027 black) square suitable for end of proof markers,
8031 is an explicit text string.
8034 \begin_layout Description
8045 ] The string used for a label with a
8057 \begin_layout Description
8069 , left, right, center
8071 ] Paragraph alignment.
8074 \begin_layout Description
8086 , left, right, center
8093 Some LaTeX styles prohibit certain alignments, since those wouldn't make
8095 For example a right-aligned or centered enumeration isn't possible.
8098 \begin_layout Description
8112 ] With this parameter the
8117 \begin_inset Quotes eld
8120 Vertical space above
8121 \begin_inset Quotes erd
8129 dit\SpecialChar \menuseparator
8134 aragraph\InsetSpace ~
8137 dialog can be set when initializing a paragraph with this layout
8141 \begin_layout Standard
8144 Note from Jean-Marc:
8146 I'm not sure that this setting has much use, and it should probably be
8147 removed in later versions.
8156 \begin_layout Description
8177 \begin_layout Description
8191 ] Whether fragile commands in this layout should be
8200 \begin_layout Description
8217 ] Whether newlines are translated into LaTeX newlines (
8226 The translation can be switched off to allow more comfortable LaTeX editing
8230 \begin_layout Description
8244 ] Whether the contents of this paragraph should be output in raw form, meaning
8245 without special translations that LaTeX would require.
8246 This somehow replaces the older
8253 \begin_layout Description
8267 ] Usually LyX doesn't allow you to insert more than one space between words,
8268 since a space is considered as the separation between two words, not a
8269 character or symbol of its own.
8270 This is a very fine thing but sometimes annoying, for example when typing
8271 program code or plain LaTeX code.
8277 Note that LyX will create protected blanks for the additional blanks when
8278 in another mode than LaTeX-mode.
8281 \begin_layout Description
8295 ] Usually LyX does not allow you to leave a paragraph empty, since it would
8296 lead to empty LaTeX output.
8297 There are some cases where this could be desirable however: in a letter
8298 template, the required fields can be provided as empty fields, so that
8299 people do not forget them; in some special classes, a layout can be used
8300 as some kind of break, which does not contain actual text.
8303 \begin_layout Description
8315 , onehalf, double, other
8321 ] This defines what the default spacing should be in the layout.
8334 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
8335 If you specify the argument
8339 , then you should also provide a numerical argument which will be the actual
8341 Note that, contrary to other parameters,
8345 implies the generation of specific LaTeX code, using the package
8352 \begin_layout Description
8359 The font used for both the text body
8364 See section\InsetSpace ~
8366 \begin_inset CommandInset ref
8368 reference "sec:fonts"
8373 Note that defining this font automatically defines the
8380 \begin_layout Description
8387 The font used for the text body .
8388 See section\InsetSpace ~
8390 \begin_inset CommandInset ref
8392 reference "sec:fonts"
8399 \begin_layout Description
8406 The font used for the label.
8407 See section\InsetSpace ~
8409 \begin_inset CommandInset ref
8411 reference "sec:fonts"
8418 \begin_layout Description
8422 Preamble\SpecialChar \ldots{}
8426 A set of macro definitions that will be output at the beginning of the
8427 LaTeX files when the layout is used.
8428 Use this to define the macros needed by this particular layout.
8431 \begin_layout Description
8442 ] Whether the layout requires the feature
8447 A feature is in general the name of a package (amsmath, makeidx, \SpecialChar \ldots{}
8449 macro (url, boldsymbol,\SpecialChar \ldots{}
8451 Multiple features must be separated by commas.
8452 Note that you can only request supported features; unfortunately, the complete
8453 list of supported features is not documented (however,
8458 elp\SpecialChar \menuseparator
8465 gives an overview of the supported packages).
8468 \begin_layout Description
8475 the name of a style which preamble should be output
8479 the one mentionned above.
8480 This allows to ensure some ordering of the preamble snippets when macros
8481 definitions depend on one another
8485 \begin_layout Standard
8486 Note that, besides that functionality, there is no way to ensure any ordering
8488 The ordering that you see in a given version of LyX may change without
8489 warning in later versions.
8497 \begin_layout Standard
8501 \begin_layout Standard
8513 \begin_layout Subsection
8517 \begin_layout Standard
8518 \begin_inset CommandInset label
8524 Since version 1.3.0 of LyX, it is necessary to define the floats (
8532 , \SpecialChar \ldots{}
8533 ) in the text class itself.
8534 If you are looking here to learn how to upgrade an existing text class,
8535 it will probably turn out that all you have to do is to add
8538 \begin_layout LyX-Code
8542 \begin_layout Standard
8543 at a reasonable location of the text class.
8547 \begin_layout Standard
8548 Don't forget to also have a look at counters in next section.
8553 If you want to implement a text class that proposes some other float types
8554 (like the AGU class bundled with LyX), the information below will hopefully
8558 \begin_layout Description
8570 \begin_inset Quotes erd
8574 \begin_inset Quotes erd
8578 \begin_inset Quotes eld
8582 \begin_inset Quotes erd
8585 of the new class of floats, like program or algorithm.
8586 After the appropriate
8607 \begin_layout Description
8619 \begin_inset Quotes erd
8623 \begin_inset Quotes erd
8626 ] The string that will be used in the menus and also for the caption.
8629 \begin_layout Description
8650 if the float is already defined by the documentclass.
8655 , the float will be defined using the LaTeX package
8662 \begin_layout Description
8674 \begin_inset Quotes erd
8678 \begin_inset Quotes erd
8681 ] This (optional) argument determines whether floats of this class will
8682 be numbered within some sectional unit of the document.
8683 For example, if within is equal to
8687 , the floats will be numbered within chapters.
8691 \begin_layout Description
8703 \begin_inset Quotes erd
8707 \begin_inset Quotes erd
8710 ] The style used when defining the float using
8719 \begin_layout Description
8731 \begin_inset Quotes erd
8735 \begin_inset Quotes erd
8738 ] The default placement for the given class of floats.
8739 They are like in standard LaTeX:
8755 for top, bottom, page, and here, respectively.
8759 \begin_layout Standard
8760 Note that the order of these letters in the string is irrelevant, like in
8766 On top of that there is a new type,
8770 , which does not really correspond to a float, since it means: put it
8771 \begin_inset Quotes eld
8775 \begin_inset Quotes erd
8779 Note, however that the
8783 specifier is special and, because of implementation details cannot be used
8784 in non-builtin float types.
8785 If you do not understand what this means, just use
8792 \begin_layout Description
8804 \begin_inset Quotes erd
8808 \begin_inset Quotes erd
8811 ] The file name extension of an auxiliary file for the list of figures (or
8813 LaTeX writes the captions to this file.
8816 \begin_layout Description
8828 \begin_inset Quotes erd
8832 \begin_inset Quotes erd
8835 ] The heading used for the list of floats.
8838 \begin_layout Standard
8839 Note that defining a float with type
8845 automatically defines the corresponding counter with name
8854 \begin_layout Subsection
8855 Inset layouts and Flex insets
8858 \begin_layout Standard
8859 \begin_inset CommandInset label
8861 name "sec:charstyle"
8865 You can define character styles since version 1.4.0 of LyX; since version
8866 1.6.0 these are called Flex insets.
8870 \begin_layout Standard
8871 Furthermore it is possible to define the general layout of many different
8873 Currently layout parameters can be defined for footnotes, marginal notes,
8874 note insets, ERT insets, branch insets, and Flex insets.
8875 The latter are definable from the user GUI and come in three different
8876 kinds: character style (
8884 ), and XML element (
8892 \begin_layout Standard
8897 definition starting line is of the form
8900 \begin_layout LyX-Code
8901 InsetLayout <Type> <Name>
8904 \begin_layout Standard
8908 \begin_layout Standard
8915 Foot, Margin, Note, Flex
8920 \begin_layout Standard
8925 can be empty (for foot- and marginal notes, branches and ERT) or one of
8943 Here, the second part of the name can be chosen freely (for CharStyle,
8944 Custom and Element), or from a predefined list (for Note).
8947 \begin_layout Standard
8952 section can contain the following entries:
8955 \begin_layout Description
8978 (indicating a dummy definition ending definitions of charstyles etc.).
8979 This entry is only meaningful for Flex (user definable) insets, the three
8980 types of which are CharStyle, Custom and Element.
8983 \begin_layout Description
8999 Minimalistic or Conglomerate
9002 , describing the rendering style used for the inset's frame and buttons.
9005 \begin_layout Description
9012 defines what will be displayed on the button or elsewhere as the inset
9014 Some inset types (ERT and Branch) modify this label on the fly.
9017 \begin_layout Description
9024 The font used for both the text body
9029 See section\InsetSpace ~
9031 \begin_inset CommandInset ref
9033 reference "sec:fonts"
9038 Note that defining this font automatically defines the
9045 \begin_layout Description
9052 The font used for the label.
9053 See section\InsetSpace ~
9055 \begin_inset CommandInset ref
9057 reference "sec:fonts"
9062 Note that this definition can never appear before
9066 , lest it be ineffective (see above)
9069 \begin_layout Description
9076 The name of the corresponding LaTeX stuff.
9077 Either the environment or command name.
9080 \begin_layout Description
9087 The optional parameter for the corresponding
9093 stuff, including possible bracket pairs like
9098 This parameter cannot be changed from within LyX.
9101 \begin_layout Description
9108 See section\InsetSpace ~
9110 \begin_inset CommandInset ref
9112 reference "sec:style"
9119 \begin_layout Description
9123 Preamble\SpecialChar \ldots{}
9127 See section\InsetSpace ~
9129 \begin_inset CommandInset ref
9131 reference "sec:style"
9138 \begin_layout Description
9149 ] See section\InsetSpace ~
9151 \begin_inset CommandInset ref
9153 reference "sec:style"
9160 \begin_layout Subsection
9164 \begin_layout Standard
9165 \begin_inset CommandInset label
9171 Since version 1.3.0 of LyX, it is necessary to define the counters (
9179 , \SpecialChar \ldots{}
9180 ) in the text class itself.
9181 If you are looking here to learn how to upgrade an existing text class,
9182 it will probably turn out that all you have to do is to add
9185 \begin_layout LyX-Code
9186 Input stdcounters.inc
9189 \begin_layout Standard
9190 The following parameters can be used:
9193 \begin_layout Description
9205 \begin_inset Quotes erd
9209 \begin_inset Quotes erd
9212 ] The name of the counter.
9215 \begin_layout Description
9227 \begin_inset Quotes erd
9231 \begin_inset Quotes erd
9234 ] If this is set to the name of another counter, the present counter will
9235 be reset everytime the other one is increased.
9247 \begin_layout Description
9251 LabelString [string=""]
9254 when this is defined, this string defines how the counter is displayed.
9255 Setting this value resets
9260 The following special constructs can be used in the string:
9264 \begin_layout Itemize
9271 will be replaced by the expansion of the
9284 If these are empty, a default value is constructed as follows: if the counter
9285 has a master counter
9297 is used; otherwise the string
9306 \begin_layout Itemize
9307 counter values can be expressed using LaTeX-like macros
9331 \begin_layout Description
9342 to arabic numerals, like 1, 2, 3\SpecialChar \ldots{}
9347 \begin_layout Standard
9357 Actually, the situation is a bit more complicated than that: any
9376 other than those descibed below will produce arabic numerals.
9377 It would not be surprising to see this change in the future.
9385 \begin_layout Description
9392 for lower-case letters: a, b, c, \SpecialChar \ldots{}
9396 \begin_layout Description
9403 for upper-case letters: A, B, C, \SpecialChar \ldots{}
9407 \begin_layout Description
9414 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
9418 \begin_layout Description
9425 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
9429 \begin_layout Description
9436 for hebrew numerals.
9441 \begin_layout Description
9445 LabelStringAppendix [string=""]
9452 , for use in appendix.
9455 \begin_layout Subsection
9459 \begin_layout Standard
9460 \begin_inset CommandInset label
9466 A font description looks like that:
9469 \begin_layout LyX-Code
9479 \begin_layout LyX-Code
9483 \begin_layout LyX-Code
9487 \begin_layout Standard
9488 and the following commands are available:
9491 \begin_layout Description
9508 \begin_layout Description
9525 \begin_layout Description
9537 , Italic, SmallCaps, Slanted
9542 \begin_layout Description
9558 , large, larger, largest, huge, giant
9563 \begin_layout Description
9575 , black, white, red, green, blue, cyan, magenta, yellow
9580 \begin_layout Subsection
9581 Upgrading old layout files
9584 \begin_layout Standard
9585 The file format of layout files changes from time to time, so old layout
9586 files need to be converted.
9587 This process has been automated in LyX 1.4.0: If LyX reads an old format
9588 layout file it will call the conversion tool
9590 $LyXDir/scripts/layout2layout.py
9592 and convert it to a temporary file in current format.
9593 The original file is left untouched, so that you can still use it with
9595 If you want to convert the layout file permanently, just call the converter
9599 \begin_layout LyX-Code
9600 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
9603 \begin_layout Standard
9615 \begin_layout Standard
9616 The automatic conversion does only handle syntax changes.
9617 It cannot handle the case where the contents of included files was changed.
9618 For example, layout files based on
9631 If you get error messages about undefined counters, try to convert your
9651 \begin_layout Section
9653 \begin_inset CommandInset label
9655 name "sec:templates"
9662 \begin_layout Standard
9663 Templates are created just like usual documents.
9664 The only difference is that usual documents contain all possible settings,
9665 including the fontscheme and the papersize.
9666 Usually a user doesn't want a template to overwrite his defaults in these
9668 For that reason, the designer of a template should remove the corresponding
9681 from the template LyX file.
9682 This can be done with any simple text-editor, for example
9694 \begin_layout Standard
9695 Put the edited template files you create in
9699 , copy the ones you use from the global template directory in
9703 to the same place, and redefine the template path in the
9708 dit\SpecialChar \menuseparator
9727 \begin_layout Standard
9728 Note that there is a template which has a particular meaning:
9733 This template is loaded everytime you create a new document with
9740 \SpecialChar \menuseparator
9748 in order to provide useful defaults.
9749 To create this template from inside LyX, all you have to do is to open
9750 a document with the correct settings, and use the
9756 e as Document Defaults
9761 \begin_layout Chapter
9762 Including External Material
9765 \begin_layout Section
9769 \begin_layout Standard
9770 \begin_inset Note Note
9773 \begin_layout Standard
9774 This section is completely outdated.
9779 One often requested feature from LyX users is to be able to interface LyX
9780 with Xfig, Dia, or other similar applications that specialize in producing
9781 a certain kind of diagram, figure, schematic or whatever material might
9782 be relevant to include in your document.
9783 Previously, it was only possible to include boring, static, fixed images
9784 in LyX documents with the graphics feature, but there are several limitations
9785 attached to this approach:
9788 \begin_layout Itemize
9789 If you want to change the figure, you have to invoke an external program
9793 \begin_layout Itemize
9794 LyX does not notice that the referenced files change, so the on-screen display
9795 can fast become obsolete, and this is aggravated by the lack of a means
9796 of updating the display
9799 \begin_layout Itemize
9800 The graphics stuff does not provide any mechanisms for coping with different
9801 exported formats such as DocBook, HTML or plain text
9804 \begin_layout Standard
9805 The external material facility attempts to solve all of these problems
9809 \begin_layout Standard
9810 Even if the graphics facility can't solve all problems, it is still valuable
9811 because it does provide in-line preview of the graphics, and supports advanced
9812 geometric transformations with a comfortable user interface.
9818 It does this by offering a general method to interface LyX to external
9820 Instead of introducing a long list of different constructs tailored for
9821 each specific application, we chose to sacrifice the in-line displaying
9822 of the included material in order to provide a general construct to cover
9823 a wide range of applications.
9824 The result is the external material construct.
9825 External material presents itself in the document simply as a button, but
9826 don't let this fool you.
9827 When you click on it, a dialog will appear that allows you to chose exactly
9828 what material to include, and in the following sections you will learn
9829 that this is indeed a powerful mechanism that can solve all of the above
9833 \begin_layout Section
9837 \begin_layout Standard
9838 The external material feature is based on the concept of a
9843 A template is a specification of how LyX should interface with a certain
9845 As bundled, LyX comes with predefined templates for Xfig figures, Dia diagrams,
9846 various raster format images, gnuplot, and more.
9847 You can check the actual list by using the menu
9849 Insert\SpecialChar \menuseparator
9850 File\SpecialChar \menuseparator
9859 Furthermore, it is possible to roll your own template to support a specific
9861 Later we'll describe in more detail what is involved, and hopefully you
9862 will submit all the templates you create so we can include them in a later
9866 \begin_layout Standard
9867 Another basic idea of the external material feature is to distinguish between
9868 the original file that serves as a base for final material and the produced
9869 file that is included in your exported or printed document.
9870 For example, consider the case of a figure produced with
9875 The Xfig application itself works on an original file with the
9880 Within XFig, you create and change your figure, and when you are done,
9886 When you want to include the figure in your document, you invoke
9890 in order to create a PostScript file that can readily be included in your
9896 file is the original file, and the PostScript file is the produced file.
9899 \begin_layout Standard
9900 This distinction is important in order to allow updating of the material
9901 while you are in the process of writing the document.
9902 Furthermore, it provides us with the flexibility that is needed to support
9903 multiple export formats.
9904 For instance, in the case of a plain text file, it is not exactly an award-winn
9905 ing idea to include the figure as raw PostScript.
9906 Instead, you'd either prefer to just include a reference to the figure,
9907 or try to invoke some graphics to Ascii converter to make the final result
9908 look similar to the real graphics.
9909 The external material management allows you to do this, because it is parameter
9910 ized on the different export formats that LyX supports.
9913 \begin_layout Standard
9914 Besides supporting the production of different products according to the
9915 exported format, it supports tight integration with editing and viewing
9917 In the case of an XFig figure, you are able to invoke
9921 on the original file with a single click from within the external material
9922 dialog in LyX, and also preview the produced PostScript file with
9927 No more fiddling around with the command line and/or file browsers to locate
9928 and manipulate the original or produced files.
9929 In this way, you are finally able to take full advantage of the many different
9930 applications that are relevant to use when you write your documents, and
9931 ultimately be more productive.
9934 \begin_layout Section
9935 External material dialog
9938 \begin_layout Standard
9943 dialog is described in the
9952 \begin_layout Section
9956 \begin_layout Standard
9957 In this section, we should include some examples of use of the external
9959 Those examples could include:
9962 \begin_layout Itemize
9963 External raster images
9966 \begin_layout Itemize
9967 External XFig figures
9970 \begin_layout Itemize
9974 \begin_layout Itemize
9978 \begin_layout Itemize
9979 The use of makefiles
9982 \begin_layout Itemize
9983 Recursive external LyX templates
9986 \begin_layout Section
9987 The external template configuration file
9990 \begin_layout Standard
9991 It is relatively easy to add custom external template definitions to LyX.
9992 However, be aware this doing this in an careless manner most probably
9996 introduce an easily exploitable security hole.
9997 So before you do this, please read the discussion about security which
10001 \begin_layout Standard
10002 Having said that, we encourage you to submit any interesting templates that
10007 \begin_layout Standard
10008 The external templates are defined in the
10010 lib/external_templates
10013 You can place your own version in
10015 .lyx/external_templates
10020 \begin_layout Standard
10021 A typical template looks like this:
10024 \begin_layout LyX-Code
10028 \begin_layout LyX-Code
10029 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
10032 \begin_layout LyX-Code
10036 \begin_layout LyX-Code
10040 \begin_layout LyX-Code
10044 \begin_layout LyX-Code
10048 \begin_layout LyX-Code
10052 \begin_layout LyX-Code
10053 AutomaticProduction true
10056 \begin_layout LyX-Code
10060 \begin_layout LyX-Code
10064 \begin_layout LyX-Code
10068 \begin_layout LyX-Code
10069 TransformCommand Rotate RotationLatexCommand
10072 \begin_layout LyX-Code
10073 TransformCommand Resize ResizeLatexCommand
10076 \begin_layout LyX-Code
10077 Product "$$RotateFront$$ResizeFront
10080 \begin_layout LyX-Code
10085 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
10088 \begin_layout LyX-Code
10089 $$ResizeBack$$RotateBack"
10092 \begin_layout LyX-Code
10096 \begin_layout LyX-Code
10097 UpdateResult "$$AbsPath$$Basename.pstex_t"
10100 \begin_layout LyX-Code
10101 Requirement "graphicx"
10104 \begin_layout LyX-Code
10105 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
10108 \begin_layout LyX-Code
10109 ReferencedFile latex "$$AbsPath$$Basename.eps"
10112 \begin_layout LyX-Code
10113 ReferencedFile dvi "$$AbsPath$$Basename.eps"
10116 \begin_layout LyX-Code
10120 \begin_layout LyX-Code
10124 \begin_layout LyX-Code
10125 TransformCommand Rotate RotationLatexCommand
10128 \begin_layout LyX-Code
10129 TransformCommand Resize ResizeLatexCommand
10132 \begin_layout LyX-Code
10133 Product "$$RotateFront$$ResizeFront
10136 \begin_layout LyX-Code
10141 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
10144 \begin_layout LyX-Code
10145 $$ResizeBack$$RotateBack"
10148 \begin_layout LyX-Code
10149 UpdateFormat pdftex
10152 \begin_layout LyX-Code
10153 UpdateResult "$$AbsPath$$Basename.pdftex_t"
10156 \begin_layout LyX-Code
10157 Requirement "graphicx"
10160 \begin_layout LyX-Code
10161 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
10164 \begin_layout LyX-Code
10165 ReferencedFile latex "$$AbsPath$$Basename.pdf"
10168 \begin_layout LyX-Code
10172 \begin_layout LyX-Code
10176 \begin_layout LyX-Code
10177 Product "$$Contents(
10179 "$$AbsPath$$Basename.asc
10184 \begin_layout LyX-Code
10185 UpdateFormat asciixfig
10188 \begin_layout LyX-Code
10189 UpdateResult "$$AbsPath$$Basename.asc"
10192 \begin_layout LyX-Code
10196 \begin_layout LyX-Code
10200 \begin_layout LyX-Code
10201 Product "<graphic fileref=
10203 "$$AbsOrRelPathMaster$$Basename.eps
10208 \begin_layout LyX-Code
10212 \begin_layout LyX-Code
10216 \begin_layout LyX-Code
10217 UpdateResult "$$AbsPath$$Basename.eps"
10220 \begin_layout LyX-Code
10221 ReferencedFile docbook "$$AbsPath$$Basename.eps"
10224 \begin_layout LyX-Code
10225 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
10228 \begin_layout LyX-Code
10232 \begin_layout LyX-Code
10233 Product "[XFig: $$FName]"
10236 \begin_layout LyX-Code
10240 \begin_layout LyX-Code
10244 \begin_layout Standard
10245 As you can see, the template is enclosed in
10249 \SpecialChar \ldots{}
10255 It contains a header specifying some general settings, and for each supported
10256 primary document file format a section
10260 \SpecialChar \ldots{}
10268 \begin_layout Subsection
10269 The template header
10272 \begin_layout Description
10276 Template\InsetSpace ~
10280 A unique name for the template.
10281 It must not contain substitution macros (see below).
10284 \begin_layout Description
10288 GuiName\InsetSpace ~
10292 The text that is displayed on the button.
10293 This command must occur exactly once.
10296 \begin_layout Description
10300 HelpText\InsetSpace ~
10301 <text>\InsetSpace ~
10305 The help text that is used in the External dialog.
10306 Provide enough information to explain to the user just what the template
10307 can provide him with.
10308 This command must occur exactly once.
10311 \begin_layout Description
10315 InputFormat\InsetSpace ~
10319 The file format of the original file.
10320 This must be the name of a format that is known to LyX (see the
10325 ools\SpecialChar \menuseparator
10330 references:Conversion
10337 if the template can handle original files of more than one format.
10338 LyX will attempt to interrogate the file itself in order to deduce its
10339 format in this case.
10340 This command must occur exactly once.
10343 \begin_layout Description
10347 FileFilter\InsetSpace ~
10351 A glob pattern that is used in the file dialog to filter out the desired
10353 If there is more than one possible file extension (e.g.\InsetSpace ~
10362 ), use something like
10367 This command must occur exactly once.
10370 \begin_layout Description
10374 AutomaticProduction\InsetSpace ~
10378 Wether the file represented by the template must be generated by LyX.
10379 This command must occur exactly once.
10382 \begin_layout Description
10386 Transform\InsetSpace ~
10387 Rotate|Resize|Clip|Extra
10390 This command specifies which transformations are supported by this template.
10391 It may occur zero or more times.
10392 This command enables the corresponding tabs in the external dialog.
10397 command must have either a corresponding
10410 Otherwise the transformation will not be supported by that format.
10413 \begin_layout Subsection
10417 \begin_layout Description
10421 Format\InsetSpace ~
10422 LaTeX|PDFLaTeX|PlainText|DocBook
10425 The primary document file format that this format definition is for.
10426 Not every template has a sensible representation in all document file formats.
10427 Please define nevertheless a
10431 section for all formats.
10432 Use a dummy text when no representation is available.
10433 Then you can at least see a reference to the external material in the exported
10437 \begin_layout Description
10441 TransformCommand\InsetSpace ~
10442 Rotate\InsetSpace ~
10443 RotationLatexCommand
10446 This command specifies that the built in LaTeX command should be used for
10448 This command may occur once or not at all.
10451 \begin_layout Description
10455 TransformCommand\InsetSpace ~
10456 Resize\InsetSpace ~
10460 This command specifies that the built in LaTeX command should be used for
10462 This command may occur once or not at all.
10465 \begin_layout Description
10469 TransformOption\InsetSpace ~
10470 Rotate\InsetSpace ~
10471 RotationLatexOption
10474 This command specifies that rotation is done via an optional argument.
10475 This command may occur once or not at all.
10478 \begin_layout Description
10482 TransformOption\InsetSpace ~
10483 Resize\InsetSpace ~
10487 This command specifies that resizing is done via an optional argument.
10488 This command may occur once or not at all.
10491 \begin_layout Description
10495 TransformOption\InsetSpace ~
10500 This command specifies that clipping is done via an optional argument.
10501 This command may occur once or not at all.
10504 \begin_layout Description
10508 TransformOption\InsetSpace ~
10513 This command specifies that an extra optional argument is used.
10514 This command may occur once or not at all.
10517 \begin_layout Description
10521 Product\InsetSpace ~
10525 The text that is inserted in the exported document.
10526 This is actually the most important command and can be quite complex.
10527 This command must occur exactly once.
10530 \begin_layout Description
10534 UpdateFormat\InsetSpace ~
10538 The file format of the converted file.
10539 This must be the name of a format that is known to LyX (see the
10544 ools\SpecialChar \menuseparator
10549 references:Conversion
10552 This command must occur exactly once.
10555 \begin_layout Description
10559 UpdateResult\InsetSpace ~
10563 The file name of the converted file.
10564 The file name must be absolute.
10565 This command must occur exactly once.
10568 \begin_layout Description
10572 ReferencedFile\InsetSpace ~
10573 <format>\InsetSpace ~
10577 This command denotes files that are created by the conversion process and
10578 are needed for a particular export format.
10579 If the filename is relative, it is interpreted relative to the master document.
10580 This command may be given zero or more times.
10583 \begin_layout Description
10587 Requirement\InsetSpace ~
10591 The name of a required LaTeX package.
10592 The package is included via
10598 in the LaTeX preamble.
10599 This command may occur zero or more times.
10602 \begin_layout Description
10606 Preamble\InsetSpace ~
10610 This command specifies a preamble snippet that will be included in the
10612 It has to be defined using
10616 \SpecialChar \ldots{}
10622 This command may occur zero or more times.
10625 \begin_layout Description
10629 Option\InsetSpace ~
10630 <name>\InsetSpace ~
10634 This command defines an additional macro
10638 for substitution in
10647 itself may contain substitution macros.
10648 The advantage over using
10656 is that the substituted value of
10660 is sanitized so that it is a valid optional argument in the document format.
10661 This command may occur zero or more times.
10664 \begin_layout Subsection
10665 Preamble definitions
10668 \begin_layout Standard
10669 The external template configuration file may contain additional preamble
10670 definitions enclosed by
10674 \SpecialChar \ldots{}
10680 They can be used by the templates in the
10687 \begin_layout Section
10688 The substitution mechanism
10691 \begin_layout Standard
10692 When the external material facility invokes an external program, it is done
10693 on the basis of a command defined in the template configuration file.
10694 These commands can contain various macros that are expanded before execution.
10695 Execution always take place in the directory of the containing document.
10698 \begin_layout Standard
10699 Also, whenever external material is to be displayed, the name will be produced
10700 by the substitution mechanism, and most other commands in the template
10701 definition support substitution as well.
10704 \begin_layout Standard
10705 The available macros are the following:
10708 \begin_layout Description
10709 $$FName The filename of the file specified in the external material dialog.
10710 This is either an absolute name, or it is relative to the LyX document.
10713 \begin_layout Description
10714 $$Basename The filename without path and without the extension.
10717 \begin_layout Description
10718 $$Extension The file extension (including the dot).
10721 \begin_layout Description
10722 $$FPath The path part of
10726 (absolute name or relative to the LyX document).
10729 \begin_layout Description
10730 $$AbsPath The absolute file path.
10733 \begin_layout Description
10734 $$RelPathMaster The file path, relative to the master LyX document.
10737 \begin_layout Description
10738 $$RelPathParent The file path, relative to the LyX document.
10741 \begin_layout Description
10742 $$AbsOrRelPathMaster The file path, absolute or relative to the master LyX
10746 \begin_layout Description
10747 $$AbsOrRelPathParent The file path, absolute or relative to the LyX document.
10750 \begin_layout Description
10751 $$Tempname A name and full path to a temporary file which will be automatically
10752 deleted whenever the containing document is closed, or the external material
10756 \begin_layout Description
10758 \begin_inset Quotes eld
10762 \begin_inset Quotes erd
10765 ) This macro will expand to the contents of the file with the name
10772 \begin_layout Description
10773 $$Sysdir This macro will expand to the absolute path of the system directory.
10774 This is typically used to point to the various helper scripts that are
10778 \begin_layout Standard
10779 All path macros contain a trailing directory separator, so you can construct
10781 the absolute filename with
10783 $$AbsPath$$Basename$$Extension
10788 \begin_layout Standard
10789 The macros above are substituted in all commands unless otherwise noted.
10794 supports additionally the following substitutions if they are enabled by
10806 \begin_layout Description
10807 $$ResizeFront The front part of the resize command.
10810 \begin_layout Description
10811 $$ResizeBack The back part of the resize command.
10814 \begin_layout Description
10815 $$RotateFront The front part of the rotation command.
10818 \begin_layout Description
10819 $$RotateBack The back part of the rotation command.
10822 \begin_layout Standard
10823 The value string of the
10827 command supports additionally the following substitutions if they are enabled
10839 \begin_layout Description
10840 $$Clip The clip option.
10843 \begin_layout Description
10844 $$Extra The extra option.
10847 \begin_layout Description
10848 $$Resize The resize option.
10851 \begin_layout Description
10852 $$Rotate The rotation option.
10855 \begin_layout Standard
10856 You may ask why there are so many path macros.
10857 There are mainly two reasons:
10860 \begin_layout Standard
10861 First, relative and absolute file names should remain relative or absolute,
10863 Users may have reasons to prefer either form.
10864 Relative names are useful for portable documents that should work on different
10865 machines, for example.
10866 Absolute names may be required by some programs.
10869 \begin_layout Standard
10870 Second, LaTeX treats relative file names differently than LyX and other
10871 programs in nested included files.
10872 For LyX, a relative file name is always relative to the document that contains
10874 For LaTeX, it is always relative to the master document.
10875 These two definitions are identical if you have only one document, but
10876 differ if you have a master document that includes part documents.
10877 That means that relative filenames must be transformed when presented to
10879 Fortunately LyX does this automatically for you if you choose the right
10883 \begin_layout Standard
10884 So which path macro should be used in new template definitions? The rule
10888 \begin_layout Itemize
10893 if an absolute path is required.
10896 \begin_layout Itemize
10899 $$AbsOrRelPathMaster
10901 if the substituted string is some kind of LaTeX input.
10904 \begin_layout Itemize
10907 $$AbsOrRelPathParent
10909 in order to preserve the user's choice.
10912 \begin_layout Standard
10913 There are special cases where this rule does not work and e.g.\InsetSpace ~
10915 are needed, but normally it will work just fine.
10916 One example for such a case is the command
10918 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
10920 in the XFig template above: We can't use the absolute name because the
10925 files needs the relative name in order to rewrite the file content.
10928 \begin_layout Section
10929 Security discussion
10932 \begin_layout Standard
10933 \begin_inset Note Note
10936 \begin_layout Standard
10937 This section is outdated
10942 The external material feature interfaces with a lot of external programs
10943 and does so automatically, so we have to consider the security implications
10945 In particular, since you have the option of including your own filenames
10946 and/or parameter strings and those are expanded into a command, it seems
10947 that it would be possible to create a malicious document which executes
10948 arbitrary commands when a user views or prints the document.
10949 This is something we definately want to avoid.
10952 \begin_layout Standard
10953 However, since the external program commands are specified in the template
10954 configuration file only, there are no security issues if LyX is properly
10955 configured with safe templates only.
10956 This is so because the external programs are invoked with the
10960 -system call rather than the
10964 system-call, so it's not possible to execute arbitrary commands from the
10965 filename or parameter section via the shell.
10968 \begin_layout Standard
10969 This also implies that you are restricted in what command strings you can
10970 use in the external material templates.
10971 In particular, pipes and redirection are not readily available.
10972 This has to be so if LyX should remain safe.
10973 If you want to use some of the shell features, you should write a safe
10974 script to do this in a controlled manner, and then invoke the script from
10975 the command string.
10980 directory of the LyX installation, you can find a safe wrapper script
10982 general_command_wrapper.py
10984 that supports redirection of input and output.
10985 That can serve as an example for how to write safe template scripts.
10986 For a more advanced example that uses
10990 and friends, take a look at the
10997 \begin_layout Standard
10998 It is possible to design a template that interacts directly with the shell,
10999 but since this would allow a malicious user to execute arbitrary commands
11000 by writing clever filenames and/or parameters, we generally recommend that
11001 you only use safe scripts that work with the
11005 system call in a controlled manner.
11006 Of course, for use in a controlled environment, it can be tempting to just
11007 fall back to use ordinary shell scripts.
11008 If you do so, be aware that you
11012 provide an easily exploitable security hole in your system.
11013 Of course it stands to reason that such unsafe templates will never be
11014 included in the standard LyX distribution, although we do encourage people
11015 to submit new templates in the open source tradition.
11016 But LyX as shipped from the official distribution channels will never have
11020 \begin_layout Standard
11021 Including external material provides a lot of power, and you have to be
11022 careful not to introduce security hazards with this power.
11023 A subtle error in a single line in an innocent looking script can open
11024 the door to huge security problems.
11025 So if you do not fully understand the issues, we recommend that you consult
11026 a knowledgable security professional or the LyX development team if you
11027 have any questions about whether a given template is safe or not.
11028 And do this before you use it in an uncontrolled environment.
11031 \begin_layout Chapter
11035 \begin_layout Section
11039 \begin_layout Standard
11040 The LyX server is a method implemented in LyX that will enable other programs
11041 to talk to LyX, invoke LyX commands, and retrieve information about the
11042 LyX internal state.
11043 This is only intended for advanced users, but they should find it useful.
11046 \begin_layout Section
11047 Starting the LyX Server
11050 \begin_layout Standard
11051 The LyX server works through the use of a pair of named pipes.
11052 These are usually located in your home directory and have the names
11053 \begin_inset Quotes eld
11061 \begin_inset Quotes erd
11065 \begin_inset Quotes eld
11073 \begin_inset Quotes erd
11077 External programs write into
11081 and read back data from
11086 The stem of the pipe names can be defined in the
11091 ools\SpecialChar \menuseparator
11098 dialog, for example
11100 "/home/myhome/.lyxpipe"
11105 \begin_layout Standard
11114 ' to create the pipes.
11115 The above setting also has the effect of activating the LyX server.
11116 If one of the pipes already exists, LyX will assume that another LyX process
11117 is already running and will not start the server.
11118 To have several LyX processes with servers at the same time, you have to
11119 change the configuration between the start of the programs.
11122 \begin_layout Standard
11123 If you are developing a client program, you might find it useful to enable
11124 debugging information from the LyX server.
11125 Do this by starting LyX as
11127 lyx -dbg lyxserver.
11130 \begin_layout Standard
11131 Warning: if LyX crashes, it may not manage to remove the pipes; in this
11132 case you must remove them manually.
11133 If LyX starts and the pipes exist already, it will not start any server.
11136 \begin_layout Standard
11137 Other than this, there are a few points to consider:
11140 \begin_layout Itemize
11141 Both server and clients must run on UNIX or OS/2 machines.
11142 Communications between LyX on UNIX and clients on OS/2 or vice versa is
11143 not possible right now.
11146 \begin_layout Itemize
11147 On OS/2, only one client can connect to LyXServer at a time.
11150 \begin_layout Itemize
11151 On OS/2, clients must open inpipe with
11158 \begin_layout Standard
11159 You can find a complete example client written in C in the source distribution
11162 development/server_monitor.c
11167 \begin_layout Section
11168 Normal communication
11171 \begin_layout Standard
11172 To issue a LyX call, the client writes a line of ASCII text into the input
11174 This line has the following format:
11177 \begin_layout Quote
11191 \begin_layout Standard
11196 is a name that the client can choose arbitrarily.
11197 Its only use is that LyX will echo it if it sends an answer - so a client
11198 can dispatch results from different requesters.
11201 \begin_layout Standard
11206 is the function you want LyX to perform.
11207 It is the same as the commands you'd use in the minibuffer.
11210 \begin_layout Standard
11215 is an optional argument which is meaningful only to some functions (for
11217 \begin_inset Quotes eld
11221 \begin_inset Quotes erd
11224 which will insert the argument as text at the cursor position.)
11227 \begin_layout Standard
11228 The answer from LyX will arrive in the output pipe and be of the form
11231 \begin_layout Quote
11245 \begin_layout Standard
11254 are just echoed from the command request, while
11258 is more or less useful information filled according to how the command
11259 execution worked out.
11260 Some commands will return information about the internal state of LyX,
11262 \begin_inset Quotes eld
11266 \begin_inset Quotes erd
11269 , while other will return an empty data-response.
11270 This means that the command execution went fine.
11273 \begin_layout Standard
11274 In case of errors, the response from LyX will have this form
11277 \begin_layout Quote
11291 \begin_layout Standard
11296 should contain an explanation of why the command failed.
11299 \begin_layout Standard
11303 \begin_layout LyX-Code
11304 echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
11307 \begin_layout LyX-Code
11308 echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
11310 read a <~/.lyxpipe.out
11315 \begin_layout Section
11319 \begin_layout Standard
11320 LyX can notify clients of events going on asynchronously.
11321 Currently it will only do this if the user binds a key sequence with the
11323 \begin_inset Quotes eld
11327 \begin_inset Quotes erd
11331 The format of the string LyX sends is as follows:
11334 \begin_layout Quote
11343 \begin_layout Standard
11348 is the printed representation of the key sequence that was actually typed
11352 \begin_layout Standard
11353 This mechanism can be used to extend LyX's command set and implement macros:
11354 bind some key sequence to
11355 \begin_inset Quotes eld
11359 \begin_inset Quotes erd
11362 , start a client that listens on the out pipe, dispatches the command according
11363 to the sequence and starts a function that may use LyX calls and LyX requests
11364 to issue a command or a series of commands to LyX.
11367 \begin_layout Section
11368 The simple LyX Server Protocol
11371 \begin_layout Standard
11372 LyX implements a simple protocol that can be used for session management.
11373 All messages are of the form
11376 \begin_layout Quote
11386 \begin_layout Standard
11392 \begin_inset Quotes eld
11396 \begin_inset Quotes erd
11400 \begin_inset Quotes eld
11404 \begin_inset Quotes erd
11409 \begin_inset Quotes eld
11413 \begin_inset Quotes erd
11416 is received from a client, LyX will report back to inform the client that
11417 it's listening to it's messages, while
11418 \begin_inset Quotes eld
11422 \begin_inset Quotes erd
11425 sent from LyX will inform clients that LyX is closing.
11428 \begin_layout Chapter
11433 \begin_layout Standard
11434 This appendix is a huge cross-reference to all the English language keybindings.
11435 Originally, we simply wanted to list all of the key bindings followed by
11436 the function it's bound to.
11437 That way, a user can look up a key to find out what it does.
11438 We then decided, what the hey, why not include the default toolbar and
11439 menu bindings, too.
11440 Please note this section is likely to be very out of date.
11443 \begin_layout Standard
11444 The form is really self-explanatory, but here are a few tips: all entries
11445 are arranged roughly alphabetically for a given modifier (
11454 For the general keyboard layout, simpler prefixes precede the more complex
11464 All entries were gleaned from the default user interface and binding files
11465 located in the directories
11467 \SpecialChar \ldots{}
11472 \SpecialChar \ldots{}
11475 ; they should be treated as the final word on the bindings.
11478 \begin_layout Standard
11479 As a final note, be aware that some window managers (such as FVWM) take
11480 control of some of the function keys or motion keys.
11485 is listed here as generating
11489 , but FVWM grabs it and uses it to change virtual desktops instead.
11490 Very annoying unless you instruct your window manager to stop intercepting
11494 \begin_layout Section
11498 \begin_layout LyX-Code
11502 \begin_layout LyX-Code
11506 \begin_layout LyX-Code
11510 \begin_layout LyX-Code
11511 Icon "buffer-write"
11514 \begin_layout LyX-Code
11515 Icon "buffer-print"
11518 \begin_layout LyX-Code
11522 \begin_layout LyX-Code
11526 \begin_layout LyX-Code
11530 \begin_layout LyX-Code
11534 \begin_layout LyX-Code
11538 \begin_layout LyX-Code
11542 \begin_layout LyX-Code
11546 \begin_layout LyX-Code
11550 \begin_layout LyX-Code
11554 \begin_layout LyX-Code
11558 \begin_layout LyX-Code
11562 \begin_layout LyX-Code
11566 \begin_layout LyX-Code
11567 Icon "footnote-insert"
11570 \begin_layout LyX-Code
11571 Icon "marginpar-insert"
11574 \begin_layout LyX-Code
11578 \begin_layout LyX-Code
11582 \begin_layout LyX-Code
11583 Icon "figure-insert"
11586 \begin_layout LyX-Code
11587 Icon "dialog-tabular-insert"
11590 \begin_layout LyX-Code
11594 \begin_layout Section
11598 \begin_layout Standard
11599 Note that the following bindings are for LyX with English menus.
11600 The second character of the binding depends on the menu language.
11602 \begin_inset Quotes eld
11610 \begin_inset Quotes erd
11613 is with German menus
11614 \begin_inset Quotes eld
11622 \begin_inset Quotes erd
11626 To find out the shortcuts of your language press the Meta (Alt)-key and
11627 press then the keys of the underlined characters of the menu names.
11630 \begin_layout Subsection
11635 \labelwidthstring 00.00.0000
11647 \labelwidthstring 00.00.0000
11659 \labelwidthstring 00.00.0000
11671 \labelwidthstring 00.00.0000
11685 \labelwidthstring 00.00.0000
11697 \labelwidthstring 00.00.0000
11711 \labelwidthstring 00.00.0000
11723 \labelwidthstring 00.00.0000
11735 \labelwidthstring 00.00.0000
11747 \labelwidthstring 00.00.0000
11759 \labelwidthstring 00.00.0000
11767 buffer-new-template
11771 \labelwidthstring 00.00.0000
11786 \labelwidthstring 00.00.0000
11797 \labelwidthstring 00.00.0000
11808 \labelwidthstring 00.00.0000
11819 \labelwidthstring 00.00.0000
11830 \labelwidthstring 00.00.0000
11841 \labelwidthstring 00.00.0000
11853 \labelwidthstring 00.00.0000
11864 \begin_layout Subsection
11869 \labelwidthstring 00.00.0000
11881 \labelwidthstring 00.00.0000
11893 \labelwidthstring 00.00.0000
11905 \labelwidthstring 00.00.0000
11917 \labelwidthstring 00.00.0000
11929 \labelwidthstring 00.00.0000
11941 \labelwidthstring 00.00.0000
11956 \labelwidthstring 00.00.0000
11963 tabular-feature append-row
11967 \labelwidthstring 00.00.0000
11974 tabular-feature toggle-line-bottom
11978 \labelwidthstring 00.00.0000
11985 tabular-feature align-center
11989 \labelwidthstring 00.00.0000
11996 tabular-feature delete-column
12000 \labelwidthstring 00.00.0000
12007 tabular-feature align-left
12011 \labelwidthstring 00.00.0000
12018 tabular-feature align-right
12022 \labelwidthstring 00.00.0000
12029 tabular-feature toggle-line-left
12033 \labelwidthstring 00.00.0000
12040 tabular-feature multicolumn
12044 \labelwidthstring 00.00.0000
12051 tabular-feature valign-center
12055 \labelwidthstring 00.00.0000
12062 tabular-feature valign-top
12066 \labelwidthstring 00.00.0000
12073 tabular-feature toggle-line-right
12077 \labelwidthstring 00.00.0000
12084 tabular-feature toggle-line-top
12088 \labelwidthstring 00.00.0000
12095 tabular-feature append-column
12099 \labelwidthstring 00.00.0000
12106 tabular-feature valign-bottom
12110 \labelwidthstring 00.00.0000
12117 tabular-feature delete-row
12122 \labelwidthstring 00.00.0000
12135 \labelwidthstring 00.00.0000
12142 floats-operate openfoot
12146 \labelwidthstring 00.00.0000
12153 floats-operate closefoot
12157 \labelwidthstring 00.00.0000
12164 floats-operate openfig
12168 \labelwidthstring 00.00.0000
12179 \labelwidthstring 00.00.0000
12190 \labelwidthstring 00.00.0000
12197 floats-operate closefig
12202 \labelwidthstring 00.00.0000
12214 \labelwidthstring 00.00.0000
12228 \labelwidthstring 00.00.0000
12240 \labelwidthstring 00.00.0000
12252 \labelwidthstring 00.00.0000
12266 \labelwidthstring 00.00.0000
12278 \labelwidthstring 00.00.0000
12293 \labelwidthstring 00.00.0000
12300 primary-selection-paste
12304 \labelwidthstring 00.00.0000
12311 primary-selection-paste paragraph
12315 \begin_layout Subsection
12320 \labelwidthstring 00.00.0000
12335 \labelwidthstring 00.00.0000
12342 buffer-float-insert algorithm
12346 \labelwidthstring 00.00.0000
12353 buffer-float-insert wide-tab
12357 \labelwidthstring 00.00.0000
12364 buffer-float-insert figure
12368 \labelwidthstring 00.00.0000
12375 buffer-float-insert table
12379 \labelwidthstring 00.00.0000
12386 buffer-float-insert wide-fig
12391 \labelwidthstring 00.00.0000
12399 dialog-tabular-insert
12403 \labelwidthstring 00.00.0000
12415 \labelwidthstring 00.00.0000
12427 \labelwidthstring 00.00.0000
12435 buffer-child-insert
12439 \labelwidthstring 00.00.0000
12451 \labelwidthstring 00.00.0000
12463 \labelwidthstring 00.00.0000
12475 \labelwidthstring 00.00.0000
12487 \labelwidthstring 00.00.0000
12499 \labelwidthstring 00.00.0000
12511 \labelwidthstring 00.00.0000
12523 \labelwidthstring 00.00.0000
12538 \labelwidthstring 00.00.0000
12549 \labelwidthstring 00.00.0000
12560 \labelwidthstring 00.00.0000
12571 \labelwidthstring 00.00.0000
12582 \labelwidthstring 00.00.0000
12593 \labelwidthstring 00.00.0000
12605 \labelwidthstring 00.00.0000
12617 \labelwidthstring 00.00.0000
12632 \labelwidthstring 00.00.0000
12639 protected-space-insert
12643 \labelwidthstring 00.00.0000
12650 end-of-sentence-period-insert
12654 \labelwidthstring 00.00.0000
12665 \labelwidthstring 00.00.0000
12676 \labelwidthstring 00.00.0000
12687 \labelwidthstring 00.00.0000
12694 menu-separator-insert
12698 \labelwidthstring 00.00.0000
12705 hyphenation-point-insert
12709 \labelwidthstring 00.00.0000
12720 \labelwidthstring 00.00.0000
12727 command-sequence math-insert ^;math-mode;
12731 \labelwidthstring 00.00.0000
12738 command-sequence math-insert _;math-mode;
12743 \labelwidthstring 00.00.0000
12758 \labelwidthstring 00.00.0000
12765 file-insert-plaintext lines
12769 \labelwidthstring 00.00.0000
12776 file-insert-plaintext paragraphs
12780 \labelwidthstring 00.00.0000
12792 \labelwidthstring 00.00.0000
12804 \labelwidthstring 00.00.0000
12816 \labelwidthstring 00.00.0000
12827 \begin_layout Subsection
12832 \labelwidthstring 00.00.0000
12844 \labelwidthstring 00.00.0000
12856 \labelwidthstring 00.00.0000
12868 \labelwidthstring 00.00.0000
12880 \labelwidthstring 00.00.0000
12892 \labelwidthstring 00.00.0000
12904 \labelwidthstring 00.00.0000
12916 \labelwidthstring 00.00.0000
12928 \labelwidthstring 00.00.0000
12936 layout-save-default
12940 \labelwidthstring 00.00.0000
12952 \labelwidthstring 00.00.0000
12964 \labelwidthstring 00.00.0000
12975 \begin_layout Subsubsection
12978 Layout\SpecialChar \menuseparator
12985 \labelwidthstring 00.00.0000
12997 \labelwidthstring 00.00.0000
13009 \labelwidthstring 00.00.0000
13021 \labelwidthstring 00.00.0000
13033 \labelwidthstring 00.00.0000
13045 \labelwidthstring 00.00.0000
13057 \labelwidthstring 00.00.0000
13069 \labelwidthstring 00.00.0000
13081 \labelwidthstring 00.00.0000
13093 \labelwidthstring 00.00.0000
13105 \labelwidthstring 00.00.0000
13117 \labelwidthstring 00.00.0000
13129 \labelwidthstring 00.00.0000
13141 \labelwidthstring 00.00.0000
13153 \labelwidthstring 00.00.0000
13165 \labelwidthstring 00.00.0000
13177 \labelwidthstring 00.00.0000
13189 \labelwidthstring 00.00.0000
13201 \labelwidthstring 00.00.0000
13213 \labelwidthstring 00.00.0000
13225 \labelwidthstring 00.00.0000
13237 \labelwidthstring 00.00.0000
13249 \labelwidthstring 00.00.0000
13261 \labelwidthstring 00.00.0000
13273 \labelwidthstring 00.00.0000
13285 \labelwidthstring 00.00.0000
13297 \labelwidthstring 00.00.0000
13309 \labelwidthstring 00.00.0000
13321 \labelwidthstring 00.00.0000
13333 \labelwidthstring 00.00.0000
13345 \labelwidthstring 00.00.0000
13357 \labelwidthstring 00.00.0000
13368 \begin_layout Subsection
13372 \begin_layout Subsection
13376 \begin_layout Subsection
13380 \begin_layout Subsection
13385 \labelwidthstring 00.00.0000
13397 \labelwidthstring 00.00.0000
13409 \labelwidthstring 00.00.0000
13421 \labelwidthstring 00.00.0000
13433 \labelwidthstring 00.00.0000
13445 \labelwidthstring 00.00.0000
13453 layout ShortFoilhead
13457 \labelwidthstring 00.00.0000
13469 \labelwidthstring 00.00.0000
13481 \labelwidthstring 00.00.0000
13493 \labelwidthstring 00.00.0000
13505 \labelwidthstring 00.00.0000
13513 layout ShortRotatefoilhead
13517 \labelwidthstring 00.00.0000
13529 \labelwidthstring 00.00.0000
13541 \labelwidthstring 00.00.0000
13553 \labelwidthstring 00.00.0000
13561 drop-layouts-choice
13565 \labelwidthstring 00.00.0000
13580 \labelwidthstring 00.00.0000
13595 \labelwidthstring 00.00.0000
13607 \labelwidthstring 00.00.0000
13619 \labelwidthstring 00.00.0000
13627 layout Subsubsection
13631 \labelwidthstring 00.00.0000
13643 \labelwidthstring 00.00.0000
13651 layout Subparagraph
13655 \labelwidthstring 00.00.0000
13659 asterisk\InsetSpace ~
13668 \labelwidthstring 00.00.0000
13672 asterisk\InsetSpace ~
13681 \labelwidthstring 00.00.0000
13685 asterisk\InsetSpace ~
13694 \labelwidthstring 00.00.0000
13698 asterisk\InsetSpace ~
13707 \labelwidthstring 00.00.0000
13711 asterisk\InsetSpace ~
13716 layout Subsubsection*
13720 \labelwidthstring 00.00.0000
13724 asterisk\InsetSpace ~
13733 \labelwidthstring 00.00.0000
13737 asterisk\InsetSpace ~
13742 layout Subparagraph*
13746 \labelwidthstring 00.00.0000
13758 \labelwidthstring 00.00.0000
13766 layout Bibliography
13770 \labelwidthstring 00.00.0000
13782 \labelwidthstring 00.00.0000
13794 \labelwidthstring 00.00.0000
13806 \labelwidthstring 00.00.0000
13818 \labelwidthstring 00.00.0000
13830 \labelwidthstring 00.00.0000
13838 layout Rotatefoilhead
13842 \labelwidthstring 00.00.0000
13850 layout RightAddress
13854 \labelwidthstring 00.00.0000
13866 \labelwidthstring 00.00.0000
13878 \labelwidthstring 00.00.0000
13890 \labelwidthstring 00.00.0000
13901 \begin_layout Standard
13902 These ones are kept for backwards compatibility, but only make sense on
13907 \labelwidthstring 00.00.0000
13919 \labelwidthstring 00.00.0000
13927 layout Subsubsection*
13931 \labelwidthstring 00.00.0000
13942 \begin_layout Section
13946 \begin_layout Subsection
13953 \labelwidthstring 00.00.0000
13964 \labelwidthstring 00.00.0000
13975 \labelwidthstring 00.00.0000
13986 \labelwidthstring 00.00.0000
13997 \labelwidthstring 00.00.0000
14008 \labelwidthstring 00.00.0000
14019 \labelwidthstring 00.00.0000
14026 hyphenation-point-insert
14030 \labelwidthstring 00.00.0000
14041 \labelwidthstring 00.00.0000
14048 line-delete-forward
14052 \labelwidthstring 00.00.0000
14063 \labelwidthstring 00.00.0000
14074 \labelwidthstring 00.00.0000
14085 \labelwidthstring 00.00.0000
14096 \labelwidthstring 00.00.0000
14107 \labelwidthstring 00.00.0000
14118 \labelwidthstring 00.00.0000
14129 \labelwidthstring 00.00.0000
14140 \labelwidthstring 00.00.0000
14151 \labelwidthstring 00.00.0000
14162 \labelwidthstring 00.00.0000
14173 \labelwidthstring 00.00.0000
14184 \labelwidthstring 00.00.0000
14196 \labelwidthstring 00.00.0000
14208 \labelwidthstring 00.00.0000
14220 \labelwidthstring 00.00.0000
14232 \labelwidthstring 00.00.0000
14245 \labelwidthstring 00.00.0000
14257 \labelwidthstring 00.00.0000
14269 \labelwidthstring 00.00.0000
14281 \labelwidthstring 00.00.0000
14293 \labelwidthstring 00.00.0000
14306 \labelwidthstring 00.00.0000
14318 \labelwidthstring 00.00.0000
14330 \labelwidthstring 00.00.0000
14343 \labelwidthstring 00.00.0000
14356 \labelwidthstring 00.00.0000
14369 \labelwidthstring 00.00.0000
14382 \labelwidthstring 00.00.0000
14395 \labelwidthstring 00.00.0000
14408 \labelwidthstring 00.00.0000
14420 \labelwidthstring 00.00.0000
14432 \labelwidthstring 00.00.0000
14444 \labelwidthstring 00.00.0000
14452 menu-open Documents
14456 \labelwidthstring 00.00.0000
14468 \labelwidthstring 00.00.0000
14480 \labelwidthstring 00.00.0000
14492 \labelwidthstring 00.00.0000
14504 \labelwidthstring 00.00.0000
14516 \labelwidthstring 00.00.0000
14524 buffer-toggle-read-only
14528 \labelwidthstring 00.00.0000
14540 \labelwidthstring 00.00.0000
14552 \labelwidthstring 00.00.0000
14564 \labelwidthstring 00.00.0000
14575 \labelwidthstring 00.00.0000
14586 \labelwidthstring 00.00.0000
14597 \labelwidthstring 00.00.0000
14608 \labelwidthstring 00.00.0000
14619 \labelwidthstring 00.00.0000
14630 \labelwidthstring 00.00.0000
14641 \labelwidthstring 00.00.0000
14652 \labelwidthstring 00.00.0000
14663 \labelwidthstring 00.00.0000
14674 \labelwidthstring 00.00.0000
14685 \labelwidthstring 00.00.0000
14696 \labelwidthstring 00.00.0000
14707 \labelwidthstring 00.00.0000
14718 \labelwidthstring 00.00.0000
14725 word-delete-forward
14729 \labelwidthstring 00.00.0000
14736 word-delete-backward
14740 \labelwidthstring 00.00.0000
14751 \labelwidthstring 00.00.0000
14758 end-of-sentence-period-insert
14762 \labelwidthstring 00.00.0000
14769 protected-space-insert
14773 \labelwidthstring 00.00.0000
14784 \labelwidthstring 00.00.0000
14795 \labelwidthstring 00.00.0000
14806 \labelwidthstring 00.00.0000
14817 \labelwidthstring 00.00.0000
14828 \labelwidthstring 00.00.0000
14839 \labelwidthstring 00.00.0000
14846 buffer-begin-select
14850 \labelwidthstring 00.00.0000
14861 \labelwidthstring 00.00.0000
14868 paragraph-up-select
14872 \labelwidthstring 00.00.0000
14879 paragraph-down-select
14883 \labelwidthstring 00.00.0000
14890 word-backward-select
14894 \labelwidthstring 00.00.0000
14901 word-forward-select
14905 \labelwidthstring 00.00.0000
14916 \labelwidthstring 00.00.0000
14923 word-delete-forward
14927 \labelwidthstring 00.00.0000
14938 \labelwidthstring 00.00.0000
14949 \labelwidthstring 00.00.0000
14960 \labelwidthstring 00.00.0000
14971 \labelwidthstring 00.00.0000
14978 break-paragraph-keep-layout
14982 \labelwidthstring 00.00.0000
14992 \begin_layout Subsection
14999 \labelwidthstring 00.00.0000
15010 \labelwidthstring 00.00.0000
15021 \labelwidthstring 00.00.0000
15032 \labelwidthstring 00.00.0000
15043 \labelwidthstring 00.00.0000
15054 \labelwidthstring 00.00.0000
15065 \labelwidthstring 00.00.0000
15076 \labelwidthstring 00.00.0000
15087 \labelwidthstring 00.00.0000
15098 \labelwidthstring 00.00.0000
15109 \labelwidthstring 00.00.0000
15120 \labelwidthstring 00.00.0000
15131 \labelwidthstring 00.00.0000
15142 \labelwidthstring 00.00.0000
15153 \labelwidthstring 00.00.0000
15164 \labelwidthstring 00.00.0000
15175 \labelwidthstring 00.00.0000
15186 \labelwidthstring 00.00.0000
15197 \labelwidthstring 00.00.0000
15208 \labelwidthstring 00.00.0000
15219 \labelwidthstring 00.00.0000
15230 \labelwidthstring 00.00.0000
15241 \labelwidthstring 00.00.0000
15248 protected-space-insert
15252 \labelwidthstring 00.00.0000
15263 \labelwidthstring 00.00.0000
15274 \labelwidthstring 00.00.0000
15285 \labelwidthstring 00.00.0000
15292 buffer-new-template
15296 \labelwidthstring 00.00.0000
15307 \labelwidthstring 00.00.0000
15318 \labelwidthstring 00.00.0000
15329 \labelwidthstring 00.00.0000
15340 \labelwidthstring 00.00.0000
15351 \labelwidthstring 00.00.0000
15362 \labelwidthstring 00.00.0000
15373 \labelwidthstring 00.00.0000
15380 end-of-sentence-period-insert
15384 \labelwidthstring 00.00.0000
15395 \labelwidthstring 00.00.0000
15406 \labelwidthstring 00.00.0000
15413 hyphenation-point-insert
15417 \labelwidthstring 00.00.0000
15428 \labelwidthstring 00.00.0000
15435 protected-space-insert
15439 \labelwidthstring 00.00.0000
15450 \labelwidthstring 00.00.0000
15461 \labelwidthstring 00.00.0000
15472 \labelwidthstring 00.00.0000
15483 \labelwidthstring 00.00.0000
15494 \labelwidthstring 00.00.0000
15505 \labelwidthstring 00.00.0000
15516 \labelwidthstring 00.00.0000
15527 \labelwidthstring 00.00.0000
15538 \labelwidthstring 00.00.0000
15549 \labelwidthstring 00.00.0000
15560 \labelwidthstring 00.00.0000
15571 \labelwidthstring 00.00.0000
15582 \labelwidthstring 00.00.0000
15593 \labelwidthstring 00.00.0000
15604 \labelwidthstring 00.00.0000
15611 word-delete-forward
15615 \labelwidthstring 00.00.0000
15622 word-delete-backward
15626 \labelwidthstring 00.00.0000
15637 \labelwidthstring 00.00.0000
15648 \labelwidthstring 00.00.0000
15659 \labelwidthstring 00.00.0000
15670 \labelwidthstring 00.00.0000
15677 paragraph-down-select
15681 \labelwidthstring 00.00.0000
15692 \labelwidthstring 00.00.0000
15699 buffer-begin-select
15703 \labelwidthstring 00.00.0000
15710 word-backward-select
15714 \labelwidthstring 00.00.0000
15721 word-forward-select
15725 \labelwidthstring 00.00.0000
15732 paragraph-up-select
15736 \labelwidthstring 00.00.0000
15747 \labelwidthstring 00.00.0000
15754 break-paragraph-keep-layout
15758 \labelwidthstring 00.00.0000
15769 \labelwidthstring 00.00.0000
15780 \labelwidthstring 00.00.0000
15791 \labelwidthstring 00.00.0000
15802 \labelwidthstring 00.00.0000
15813 \labelwidthstring 00.00.0000
15824 \labelwidthstring 00.00.0000
15835 \labelwidthstring 00.00.0000
15846 \labelwidthstring 00.00.0000
15857 \labelwidthstring 00.00.0000
15868 \labelwidthstring 00.00.0000
15878 \begin_layout Subsection
15884 \begin_layout Standard
15885 These are LyX keyboard definitions for mathematics, similar to those of
15889 \begin_layout Standard
15890 The bindings file and the present documentation were prepared by Serge Winitzki
15891 with assistance from Jean-Marc Lasgouttes.
15892 Version 1.3, for LyX 1.2.x and 1.3.x.
15895 \begin_layout Standard
15896 These definitions make it a lot easier to type equations without using the
15897 mouse, especially for people familiar with Scientific Word.
15898 The standard LyX bindings such as
15909 \begin_layout Standard
15910 Tip: to find the "LyX bind name" for a key, look at the status bar after
15911 typing some non-existent key combination.
15913 to find how "Ctrl-&" is referenced, press Ctrl-S and then Ctrl-&: the status
15914 bar shows "C-s S-C-ampersand." (This does not work in LyX 1.3.0!)
15918 \labelwidthstring 00.00.0000
15927 -- Copy, cut, paste is as in Sciword,
15943 \labelwidthstring 00.00.0000
15952 -- Display equation toggle: type
15956 to insert a displayed formula (
15961 \begin_inset Quotes eld
15965 \begin_inset Quotes erd
15973 in a displayed formula to convert it back to an inline formula.
15977 \labelwidthstring 00.00.0000
15992 to insert a fraction (
15997 \begin_inset Quotes eld
16001 \begin_inset Quotes erd
16005 You can also select an expression and type
16009 to convert it to the numerator of a fraction.
16018 end of the denominator will delete the numerator and convert the denominator
16023 \labelwidthstring 00.00.0000
16035 \begin_inset Formula $\int$
16043 \begin_inset Quotes eld
16047 \begin_inset Quotes erd
16054 \labelwidthstring 00.00.0000
16061 line-delete-forward
16063 -- Emacs-like binding: delete forward of cursor to end of line.
16067 \labelwidthstring 00.00.0000
16076 -- A text/math toggle (
16081 \begin_inset Quotes eld
16085 \begin_inset Quotes erd
16088 ): switches to math in text mode, and also inserts roman text in math mode.
16098 \begin_inset Quotes eld
16102 \begin_inset Quotes erd
16109 \labelwidthstring 00.00.0000
16118 -- Add/remove numbering in a single equation.
16122 \labelwidthstring 00.00.0000
16131 -- Add/remove numbering at a line in equation arrays.
16134 \begin_layout Standard
16135 The above commands are toggles that control the numbering of equations (
16140 \begin_inset Quotes eld
16144 \begin_inset Quotes erd
16148 Note: when deleting a number in a labeled eqnarray, the label is not really
16149 removed (the TeX code becomes
16150 \begin_inset Quotes eld
16162 \begin_inset Quotes erd
16165 ) and this generates a (harmless) LaTeX warning.
16169 \labelwidthstring 00.00.0000
16178 -- Open a new document.
16183 \labelwidthstring 00.00.0000
16192 -- Insert a quote character " (
16197 \begin_inset Quotes eld
16201 \begin_inset Quotes erd
16206 \begin_inset Quotes eld
16210 \begin_inset Quotes erd
16213 double quote character that you get by default.
16217 \labelwidthstring 00.00.0000
16228 -- Square root sign
16229 \begin_inset Formula $\sqrt{x}$
16237 \begin_inset Quotes eld
16241 \begin_inset Quotes erd
16248 \labelwidthstring 00.00.0000
16260 \begin_inset Formula $\sqrt[n]{x}$
16267 \labelwidthstring 00.00.0000
16276 -- Another binding for a switch between the text and the math mode (
16281 \begin_inset Quotes eld
16285 \begin_inset Quotes erd
16289 Note that the roman text inserted in math mode is special.
16293 \labelwidthstring 00.00.0000
16306 the selected text (text mode only, use things like
16322 \labelwidthstring 00.00.0000
16331 -- W*ndows heritage.
16335 \labelwidthstring 00.00.0000
16344 -- Close the current document (again, a W*ndows heritage).
16348 \labelwidthstring 00.00.0000
16359 \labelwidthstring 00.00.0000
16370 \labelwidthstring 00.00.0000
16380 \begin_inset Quotes eld
16384 \begin_inset Quotes erd
16388 \begin_inset Quotes eld
16392 \begin_inset Quotes erd
16398 \begin_layout Standard
16399 Bracket delimiters: press
16403 -<bracket key> to insert a matching pair of delimiters.
16408 inserts a pair of parentheses
16409 \begin_inset Formula $\left[\right]$
16417 does the same thing.) It will switch to math mode if needed.
16418 The supported characters are ( [ { < |.
16419 It is the same to press the right or the left bracket.
16420 The corresponding delimiters are
16421 \begin_inset Formula $\left(\right)$
16425 \begin_inset Formula $\left[\right]$
16429 \begin_inset Formula $\left\{ \right\} $
16433 \begin_inset Formula $\left\langle \right\rangle $
16437 \begin_inset Formula $\left|\right|$
16442 \begin_inset Quotes eld
16446 \begin_inset Quotes erd
16449 and resize with their contents.
16450 Use Math Panel to get other or non-matching delimiters.
16451 Press backspace on the
16455 delimiter to remove both
16456 \begin_inset Quotes eld
16460 \begin_inset Quotes erd
16463 delimiters without removing their contents.
16467 \labelwidthstring 00.00.0000
16476 -- for convenience, pressing
16490 \labelwidthstring 00.00.0000
16501 \labelwidthstring 00.00.0000
16512 \labelwidthstring 00.00.0000
16523 \labelwidthstring 00.00.0000
16534 \labelwidthstring 00.00.0000
16545 \labelwidthstring 00.00.0000
16552 math-delim langle rangle
16554 -- angular delimiters
16555 \begin_inset Formula $\left\langle \right\rangle $
16558 , not to confuse with ordinary < > signs.
16562 \labelwidthstring 00.00.0000
16569 math-delim langle rangle
16572 \begin_layout Standard
16573 The bar bracket: on some keyboards (e.g.\InsetSpace ~
16574 some British ones), the bar character
16579 -something and on some wayward Unices to "brokenbar".
16580 So we define all of these keys as well.
16584 \labelwidthstring 00.00.0000
16595 \labelwidthstring 00.00.0000
16606 \labelwidthstring 00.00.0000
16617 \labelwidthstring 00.00.0000
16628 \labelwidthstring 00.00.0000
16638 \begin_layout Standard
16639 Accents are in most cases
16643 -<accent key>, e.g.\InsetSpace ~
16657 for tilde (you also need to press
16663 \begin_inset Quotes eld
16675 \begin_inset Quotes erd
16679 Some accents work only in math mode and others only in text mode.
16683 \labelwidthstring 00.00.0000
16692 -- overdot accent, ȧ (text mode only).
16696 \labelwidthstring 00.00.0000
16708 \begin_inset Formula $\dot{a}$
16711 (math mode only -- in physics this denotes a first derivative).
16715 \labelwidthstring 00.00.0000
16726 -- Vector accent over math
16727 \begin_inset Formula $\overrightarrow{x}$
16734 \labelwidthstring 00.00.0000
16743 -- umlaut accent, ä (text mode only)
16747 \labelwidthstring 00.00.0000
16758 -- double dot accent,
16759 \begin_inset Formula $\ddot{a}$
16762 (math mode only -- in physics this denotes a second derivative).
16763 To get a triple dot in math mode, use
16771 \labelwidthstring 00.00.0000
16780 -- grave accent à (text mode only, use
16790 \labelwidthstring 00.00.0000
16799 -- tilde accent ã (text mode only, use
16809 \labelwidthstring 00.00.0000
16818 -- acute accent á (text mode only, use
16828 \labelwidthstring 00.00.0000
16837 -- circumflex (caret) accent â (text mode only, use
16846 \begin_layout Standard
16848 The new key S-F2 for creating a LaTeX file seems handy.
16852 \labelwidthstring 00.00.0000
16861 -- Save current document.
16865 \labelwidthstring 00.00.0000
16872 buffer-export latex
16874 -- Write a LaTeX file for the current document.
16878 \labelwidthstring 00.00.0000
16887 -- Find and replace dialog.
16891 \labelwidthstring 00.00.0000
16908 \labelwidthstring 00.00.0000
16921 to quit LyX is the W*ndows w*ndow manager's mnemonic.
16924 \begin_layout Standard
16933 are used to switch fonts.
16938 to switch back to the normal font.
16939 The non-default font switches
16947 all work as toggles.
16948 They also work on the whole word if you put the cursor in the middle of
16949 the word, or if you select some text.
16953 \labelwidthstring 00.00.0000
16962 -- stop using any special font
16966 \labelwidthstring 00.00.0000
16983 \labelwidthstring 00.00.0000
17000 \labelwidthstring 00.00.0000
17017 \labelwidthstring 00.00.0000
17031 (Used sometimes for people's names.)
17034 \begin_layout Standard
17040 \begin_inset Quotes eld
17044 \begin_inset Quotes erd
17051 key (useful e.g.\InsetSpace ~
17052 if the keyboard has no working
17059 \begin_layout Standard
17060 Here are some Sciword-inspired mnemonics for frequently used math symbols.
17061 Many symbols start with a
17070 cannot be itself bound to anything.
17074 \labelwidthstring 00.00.0000
17086 \begin_inset Quotes eld
17090 \begin_inset Quotes erd
17094 \begin_inset Formula $\prime$
17098 This is frequently unnecessary: in most cases the normal apostrophe works
17101 \begin_inset Formula $x'+2x=0$
17104 , but in some cases this would generate a double superscript error in LaTeX.
17106 \begin_inset Formula $x^{\prime2}$
17110 \begin_inset Formula $x$
17113 prime squared) must be entered with the prime character.
17117 \labelwidthstring 00.00.0000
17125 command-sequence math-superscript; math-insert
17129 -- Insert a prime as a superscript (see example above).
17133 \labelwidthstring 00.00.0000
17142 -- Insert an upper index.
17149 \labelwidthstring 00.00.0000
17158 -- Insert a lower index.
17165 \labelwidthstring 00.00.0000
17177 -- Partial derivative symbol
17178 \begin_inset Formula $\partial$
17185 \labelwidthstring 00.00.0000
17197 -- Summation symbol
17198 \begin_inset Formula $\sum$
17201 (not the same as the Greek letter uppercase Sigma
17202 \begin_inset Formula $\Sigma$
17205 because it can resize and allows smart upper/lower limits).
17209 \labelwidthstring 00.00.0000
17222 \begin_inset Formula $\prod$
17225 (not the same as the Greek letter uppercase Pi,
17226 \begin_inset Formula $\Pi$
17233 \labelwidthstring 00.00.0000
17246 \begin_inset Formula $\infty$
17253 \labelwidthstring 00.00.0000
17266 \begin_inset Formula $\times$
17273 \labelwidthstring 00.00.0000
17283 -- Insert a stacked array
17284 \begin_inset Formula $\begin{array}{c}
17286 \end{array}\end{array}$
17290 (Frequently useful in formulae.)
17294 \labelwidthstring 00.00.0000
17305 \begin_inset Formula $\times$
17309 \begin_inset Formula $\begin{array}{ccc}
17314 (Then you can modify its size using the
17316 Edit\SpecialChar \menuseparator
17323 \labelwidthstring 00.00.0000
17336 \begin_inset Quotes eld
17340 \begin_inset Quotes erd
17344 \begin_inset Formula $\dagger$
17351 \labelwidthstring 00.00.0000
17364 \begin_inset Quotes eld
17368 \begin_inset Quotes erd
17372 \begin_inset Formula $\equiv$
17379 \labelwidthstring 00.00.0000
17391 \begin_inset Quotes eld
17394 Approximate equality
17395 \begin_inset Quotes erd
17399 \begin_inset Formula $\approx$
17406 \labelwidthstring 00.00.0000
17418 \begin_inset Quotes eld
17422 \begin_inset Quotes erd
17426 \begin_inset Formula $\sim$
17433 \labelwidthstring 00.00.0000
17445 \begin_inset Formula $\rightarrow$
17449 \begin_inset Formula $\lim_{x\rightarrow0}$
17456 \labelwidthstring 00.00.0000
17468 \begin_inset Formula $\leq$
17475 \labelwidthstring 00.00.0000
17486 -- Greater-or-equal
17487 \begin_inset Formula $\geq$
17494 \labelwidthstring 00.00.0000
17507 \begin_inset Quotes eld
17511 \begin_inset Quotes erd
17515 \begin_inset Formula $\ll$
17518 (useful in physics)
17522 \labelwidthstring 00.00.0000
17535 \begin_inset Quotes eld
17539 \begin_inset Quotes erd
17543 \begin_inset Formula $\gg$
17549 \begin_layout Subsection
17550 Standard math bindings
17554 \labelwidthstring 00.00.0000
17568 \labelwidthstring 00.00.0000
17580 \labelwidthstring 00.00.0000
17592 \labelwidthstring 00.00.0000
17606 \labelwidthstring 00.00.0000
17618 \labelwidthstring 00.00.0000
17630 \labelwidthstring 00.00.0000
17644 \labelwidthstring 00.00.0000
17656 \labelwidthstring 00.00.0000
17668 \labelwidthstring 00.00.0000
17680 \labelwidthstring 00.00.0000
17694 \labelwidthstring 00.00.0000
17708 \labelwidthstring 00.00.0000
17722 \labelwidthstring 00.00.0000
17736 \labelwidthstring 00.00.0000
17750 \labelwidthstring 00.00.0000
17764 \labelwidthstring 00.00.0000
17776 \labelwidthstring 00.00.0000
17790 \labelwidthstring 00.00.0000
17802 \labelwidthstring 00.00.0000
17814 \labelwidthstring 00.00.0000
17826 \labelwidthstring 00.00.0000
17838 \labelwidthstring 00.00.0000
17852 \labelwidthstring 00.00.0000
17864 \labelwidthstring 00.00.0000
17876 \labelwidthstring 00.00.0000
17888 \labelwidthstring 00.00.0000
17896 math-delim langle rangle
17900 \labelwidthstring 00.00.0000
17908 math-delim rangle langle
17912 \labelwidthstring 00.00.0000
17924 \labelwidthstring 00.00.0000
17938 \labelwidthstring 00.00.0000
17951 \begin_layout Subsection
17956 \labelwidthstring 00.00.0000
17968 \labelwidthstring 00.00.0000
17980 \labelwidthstring 00.00.0000
17992 \labelwidthstring 00.00.0000
18004 \labelwidthstring 00.00.0000