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}}{}
22 % link all cross references and URLs in pdf output
23 \usepackage[colorlinks=true, bookmarks, bookmarksnumbered,
24 linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,
25 pdfpagelayout=OneColumn, pdfnewwindow=true,
26 pdfstartview=XYZ, plainpages=false, pdfpagelabels,
27 pdfauthor={LyX Team}, pdftex,
28 pdftitle={Customizing LyX: Features for the Advanced User},pdfsubject={LyX-documentation Customization},
29 pdfkeywords={LyX, documentation}
32 \else % if dvi or ps is produced
34 % link all cross references and URLs in dvi output
35 \usepackage[ps2pdf]{hyperref}
37 \fi % end if pdflatex is used
39 % the pages of the TOC are numbered roman
40 % and a pdf-bookmark for the TOC is added
42 \let\myTOC\tableofcontents
43 \renewcommand\tableofcontents{%
44 \pdfbookmark[1]{Contents}{}
47 \pagenumbering{arabic} }
49 % redefine the \LyX macro for PDF bookmarks
50 \def\LyX{\texorpdfstring{%
51 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
54 % used for multi-column text
61 \inputencoding default
64 \font_typewriter default
65 \font_default_family default
71 \paperfontsize default
80 \paperorientation portrait
83 \paragraph_separation indent
85 \quotes_language english
88 \paperpagestyle headings
89 \tracking_changes false
98 Customizing LyX: Features for the Advanced User
106 \begin_layout Standard
108 Principal maintainer of this file is
113 If you have comments or error corrections, please send them to the LyX
114 Documentation mailing list, <lyx-docs@lists.lyx.org>.
122 \begin_layout Standard
123 \begin_inset CommandInset toc
124 LatexCommand tableofcontents
131 \begin_layout Chapter
135 \begin_layout Standard
136 This manual covers the customization features present in LyX.
137 In it, we discuss issues like keyboard shortcuts, screen previewing options,
138 printer options, sending commands to LyX via the LyX Server, internationalizati
139 on, installing new LaTeX classes and LyX layouts, etc.
140 We can't possibly hope to touch on everything you can change---our developers
141 add new features faster than we can document them---but we will explain
142 the most common customizations and hopefully point you in the right direction
143 for some of the more obscure ones.
146 \begin_layout Chapter
147 LyX configuration files
150 \begin_layout Standard
151 \begin_inset CommandInset label
157 This chapter aims to help you to find your way through the LyX configuration
159 Before continuing to read this chapter, you should find out where your
160 LyX library directory is by using
165 elp\SpecialChar \menuseparator
173 This directory is the place where LyX places its system-wide configuration
174 files, and we will simply name it
178 in the remainder of this document.
182 \begin_layout Section
190 \begin_layout Standard
195 and its sub-directories contain a number of files and that can be used
196 to customise LyX's behaviour.
197 You can change many of these files from within LyX itself through the
202 ools\SpecialChar \menuseparator
210 Most customization that you might want to do to LyX is possible through
212 However, many other inner aspects of LyX can be customized by modifying
218 They fall in different categories, described in the following subsections.
221 \begin_layout Subsection
222 Automatically generated files
225 \begin_layout Standard
226 These files are generated when you configure LyX.
227 They contain various default values that are guessed by inspection.
228 In general, it is not a good idea to modify them, since they might be overwritt
233 \labelwidthstring 00.00.0000
240 contains defaults for various commands.
244 \labelwidthstring 00.00.0000
251 contains the list of packages that have been recognized by LyX.
252 It is currently unused by the LyX program itself, but the information extracted
253 , and more, is made available with
258 elp\SpecialChar \menuseparator
270 \labelwidthstring 00.00.0000
277 is the list of text classes that have been found in your
281 directory, along with the associated LaTeX document class and their description.
285 \labelwidthstring 00.00.0000
290 is automatically generated during configuration from the file
297 \begin_layout Subsection
302 \labelwidthstring 00.00.0000
309 this directory contains files with the extension
313 that define the keybindings used in LyX (see section\InsetSpace ~
315 \begin_inset CommandInset ref
317 reference "sec:bindings"
322 If there exists an internationalized version of the bind file named
326 , that will be used first.
327 See Chapter\InsetSpace ~
329 \begin_inset CommandInset ref
331 reference "chap:i18n"
336 \begin_inset CommandInset ref
338 reference "sec:bindings"
346 \labelwidthstring 00.00.0000
353 contains graphics files that can be included in documents.
358 \labelwidthstring 00.00.0000
365 contains LyX documentation files (including the one you are currently reading).
370 deserves special attention, as noted above.
371 If there exists an internationalized version of the help-document with
376 prepended to the name, that will be used first.
377 See Chapter\InsetSpace ~
379 \begin_inset CommandInset ref
381 reference "chap:i18n"
389 \labelwidthstring 00.00.0000
396 contains example files that explain how to use some features.
397 In the file browser, press the
405 \labelwidthstring 00.00.0000
410 contains image files that are used by the
415 In addition, it also contains the individual icons used in the toolbar
416 and the banners that can be shown when LyX is launched.
420 \labelwidthstring 00.00.0000
427 contains keyboard keymapping files.
428 See Chapter\InsetSpace ~
430 \begin_inset CommandInset ref
432 reference "sec:keymap"
440 \labelwidthstring 00.00.0000
447 contains the text class files described in Chapter\InsetSpace ~
449 \begin_inset CommandInset ref
451 reference "chap:textclass"
459 \labelwidthstring 00.00.0000
464 contains some files that demonstrate the capabilities of the
466 External\InsetSpace ~
473 \labelwidthstring 00.00.0000
478 contains the standard LyX template files described in Chapter\InsetSpace ~
480 \begin_inset CommandInset ref
482 reference "sec:templates"
490 \labelwidthstring 00.00.0000
495 contains some LaTeX cls files distributed with LyX.
499 \labelwidthstring 00.00.0000
504 contains files with the extension
508 that define the user interface to LyX.
509 That is, the files define which items appear in which menus and the items
510 appearing on the toolbar.
511 See Chapter\InsetSpace ~
513 \begin_inset CommandInset ref
522 \begin_layout Subsection
523 Files you don't want to modify
526 \begin_layout Standard
527 These files are used internally by LyX and you generally do not need to
528 modify them unless you are a developer.
532 \labelwidthstring 00.00.0000
539 this file contains the list of LyX developers.
540 The contents are displayed with the menu entry
545 elp\SpecialChar \menuseparator
553 \labelwidthstring 00.00.0000
560 this is a LaTeX script used during the configuration process.
565 \labelwidthstring 00.00.0000
572 this is the script that is used to re-configure LyX.
573 It creates configuration files in the directory it was run from.
576 \begin_layout Subsection
577 Other files needing a line or two...
581 \labelwidthstring 00.00.0000
586 this contains tables describing how different character encodings can be
591 \labelwidthstring 00.00.0000
596 this file contains the templates available to the new
598 External\InsetSpace ~
605 \labelwidthstring 00.00.0000
610 this file contains a list of all the languages currently supported by LyX.
613 \begin_layout Section
614 Your local configuration directory
617 \begin_layout Standard
618 Even if you are using LyX as an unprivileged user, you might want to change
619 LyX configuration for your own use.
624 directory contains all your personal configuration files.
625 This is the directory described as
626 \begin_inset Quotes eld
630 \begin_inset Quotes erd
638 elp\SpecialChar \menuseparator
643 This directory is used as a mirror of
647 , which means that every file in
651 is a replacement for the corresponding file in
656 Any configuration file described in the above sections can be placed either
657 in the system-wide directory, in which case it will affect all users, or
658 in your local directory for your own use.
661 \begin_layout Standard
662 To make things clearer, let's provide a few examples:
665 \begin_layout Itemize
666 The preferences set in the
671 ools\SpecialChar \menuseparator
678 dialog are saved to a file
689 \begin_layout Itemize
690 When you reconfigure using
695 ools\SpecialChar \menuseparator
706 and the resulting files are written in your local configuration directory
707 (see section\InsetSpace ~
709 \begin_inset CommandInset ref
711 reference "sec:autodetected"
715 to have a list of the
719 settings affected by this section).
720 This means that any additional text class file that you might have added
725 will be added to the list of classes in the
730 ayout\SpecialChar \menuseparator
740 \begin_layout Itemize
741 Similarly, if you have installed some LaTeX document classes in your home
742 directory, that LaTeX can find with your
746 path, they will show up in your list of text classes.
750 \begin_layout Standard
751 as long as LyX or yourself have a
755 file for it, of course.
763 \begin_layout Itemize
764 If you get some updated documentation from LyX ftp site and cannot install
765 it because you do not have sysadmin rights on your system, you can just
780 \begin_layout Section
781 Running LyX with multiple configurations
784 \begin_layout Standard
785 The configuration freedom of the local configuration directory may not suffice
786 if you want to have more than one configuration at your disposal.
787 For example, you may want to be use different key bindings or printer settings
789 You can achieve this by having several such directories.
790 You then specify which directory to use at run-time.
793 \begin_layout Standard
794 Invoking LyX with the command line switch
802 instructs the program to read the configuration from that directory, and
803 not from the default directory (you can determine the default directory
804 by running LyX without this switch as described above).
805 If this directory does not exist, LyX offers to create it for you, just
806 like it does for the default directory on the first time you run the program.
807 You can modify the configuration options in this additional
811 exactly as you would for the default directory.
812 These directories are completely independent (but read on).
813 Note that setting the environment variable
817 to some value has exactly the same effect
822 \begin_layout Standard
823 Having several configurations also requires more maintenance: if you want
824 to add a new layout to
828 which you want available from all your configurations, you must add it
829 to each directory separately.
830 You can avoid this with the following trick: after LyX creates the additional
831 directory, most of the subdirectories (see above) are empty.
832 If you want the new configuration to mirror an existing one, replace the
833 empty subdirectory with a symbolic link to the matching subdirectory in
834 the existing configuration.
841 subirectory, however, since it contains a file written by the configuration
842 script (also accessible through
847 ools\SpecialChar \menuseparator
853 \begin_inset CommandInset ref
855 reference "sec:autodetected"
861 which is configuration-specific.
864 \begin_layout Chapter
872 \begin_layout Section
873 Using the dialog for the first time
876 \begin_layout Standard
881 file will contain only changes that you have made to the default behaviour,
882 some of which is hard-coded into LyX and some of which is contained in
885 LyXDir/lyxrc.defaults
888 Note that in both files lines beginning with a
889 \begin_inset Quotes eld
897 \begin_inset Quotes erd
900 are just comments and not interpreted.
901 However, only system administrators should edit
911 ools\SpecialChar \menuseparator
918 dialog to create and modify their own
925 \begin_layout Standard
931 ools\SpecialChar \menuseparator
938 dialog will be largely self-explanatory.
939 Almost all the commands have an associated comment, so you shouldn't have
940 too much trouble modifying it to taste.
941 Before we highlight a few of the more important commands below, however,
946 ing some of your changes (e.g., screen fonts) will have an instant effect.
948 changing the bind file) will not.
949 If nothing appears to have changed, just
953 the changes and restart LyX.
956 \begin_layout Section
960 \begin_layout Standard
961 The font used to display your documents on the LyX screen is very important,
962 since you'll be reading all your documents with this font.
963 Therefore it is important that the font is as readable and good-looking
965 The LyX team tried to provide the best possible default font for you, but
966 since practically all X11 systems are different, it's likely that the default
967 fonts will be sub-optimal on your system.
968 Fortunately, you can do something about this.
969 Before we explain how to do this, you should learn a bit more about fonts
970 so that you are better prepared for choosing your fonts, because it is
971 a trade-off that is specific to your preferences and the capabilities of
975 \begin_layout Standard
976 Notice that this section only deals with the fonts on the
980 inside the LyX window.
981 The fonts that appear on the
989 are independent from these fonts, and are determined by the document class.
994 to learn how to change the font of the printed version of your document.
997 \begin_layout Standard
998 Basically, screen fonts come in two different kinds: scalable outline fonts
999 and non-scalable bitmap fonts.
1000 This distinction seems a bit arbitrary, since non-scalable fonts are actually
1001 scalable in most modern font renderers.
1002 The difference lies in the
1006 of the scaling, and the
1011 The most important decision is thus whether you should use non-scalable
1012 bitmap fonts or scalable outline fonts.
1015 \begin_layout Standard
1016 The scalable fonts are built from
1020 of the single glyphs (i.e.
1021 characters) in the font.
1022 This means that each glyph is defined using mathematical curves that are
1023 well suited for scaling to any requested size.
1024 This mathematical definition is interpreted by the font renderer and turned
1025 into a small picture composed of pixels according to which size and glyph,
1026 the programmer requests.
1027 This means that scalable fonts will look pretty good in all sizes.
1028 Well, almost all sizes.
1029 Since scalable fonts are defined in an abstract way, it can be hard to
1030 provide a good rendering at small sizes, where each pixel has to be very
1031 carefully computed to provide a good image.
1032 Technically it is possible to do this from the mathematical definition,
1033 but in order to keep the rendering reasonably fast, tradeoffs have to be
1034 made, and the result is that scalable fonts can be difficult to read at
1038 \begin_layout Standard
1039 Bitmap fonts on the other hand, are defined by bitmap graphics from the
1040 start, so they will look good at all the sizes they are meant for.
1041 However, they don't scale well, because in order to scale a glyph, each
1042 pixel is enlarged into several pixels.
1043 It is the same effect that happens if you try to enlarge a picture in
1047 or any other picture manipulation program.
1048 In order to relieve this effect, bitmap fonts are typically provided in
1049 several fixed sizes typically from around 8 pixels high up to 34 pixels
1050 or so high in steps according to what is believed to be useful.
1051 The advantage of bitmap fonts is that no complicated computations are necessary
1052 to display each glyph, so bitmap fonts are thus faster displayed than scalable
1054 The disadvantage is that sizes that don't exists as fixed versions have
1055 to be scaled by doubling pixels, and thus look bad.
1058 \begin_layout Standard
1059 The net result of all this, is that bitmap fonts are generally best for
1060 the small sizes, where they are available, while scalable fonts are generally
1061 best for large sizes.
1062 The logical conclusion would thus be to use bitmap fonts for the small
1063 sizes, and scalable fonts for the large sizes.
1064 Unfortunately, this is not a good idea, since bitmap fonts and scalable
1065 fonts are not designed to be used together, so the overall look of such
1066 a scheme would be bad.
1067 The best you can do is thus to try both schemes and decide for yourself
1071 \begin_layout Standard
1072 By default, LyX uses non-scalable bitmap fonts (when using the XForms frontend).
1077 is used, for sans serif fonts,
1085 is used as the monospaced/typewriter font.
1088 \begin_layout Standard
1089 In the following, we will describe what to do if the text does not look
1091 We'll start with the most important parameters: DPI and font zoom.
1094 \begin_layout Subsection
1095 DPI setting and Font Zoom
1098 \begin_layout Standard
1099 LyX automatically tries to scale the fonts to look as close as the paper
1100 output size as possible, except for the so-called font zoom factor.
1103 \begin_layout Standard
1104 In order for this to work on all systems, it relies on the screen DPI (dots
1105 per inch) setting to be correct.
1106 The DPI setting for your system is autodetected by LyX using the information
1107 the X server can provide.
1108 You can check what LyX autodetects the DPI setting to, by running LyX as
1116 \begin_layout Standard
1117 On many systems, X is not set up correctly, so you should check that it
1120 \begin_inset Quotes eld
1128 \begin_inset Quotes erd
1131 and write down what the DPI is for the resolution you use (this will be
1132 close to the value LyX detects).
1133 It is the number mentioned as
1134 \begin_inset Quotes eld
1138 \begin_inset Quotes erd
1142 Also write down the number of pixels you have in the width (the first number
1144 \begin_inset Quotes eld
1148 \begin_inset Quotes erd
1154 \begin_layout Standard
1155 Then get the good old ruler out of the closet, and measure the width of
1156 the visible screen-image on your monitor.
1157 Convert this measurement to inches if you used a centimeter ruler by dividing
1159 Now you can determine the correct DPI setting for your screen by dividing
1160 the number of pixels in the width by the width of the screen-image on the
1162 If this number is more than, say, 5 DPI from the detected value, you should
1163 either fix the X setup, or at least tell LyX that the DPI is different
1164 than the detected value.
1167 \begin_layout Standard
1168 If you can't fix the X setup (which of course is best since other programs
1169 than LyX will benefit from this as well), you can tell LyX the correct
1177 \begin_layout Standard
1178 If the text is too small or too big for your taste, you should fiddle with
1179 the font zoom setting.
1180 This setting is used to scale the point size of the text.
1181 If your DPI setting is correct, and the font zoom setting is set to 100,
1182 this means that LyX will try to display the text exactly the same size
1183 as it will appear on the paper-output.
1184 If you set the zoom factor to 200, the text will try to be 2 times as big
1186 Of course, this will only happen if LyX can find a font that has the appropriat
1187 e size, which you can't count on.
1188 Since LyX is a WYSIWYM system anyways, this limitation isn't much of an
1192 \begin_layout Standard
1193 The default font zoom setting is 150, since a monitor is typically wider
1194 than a piece of paper, but you should try to fiddle with it through the
1208 dialog to find a size that you like.
1209 When you've found a setting that seems to work nicely for you (tip: use
1217 button to keep the dialog open while you experiment), you can make this
1218 setting the default by using the
1228 \begin_layout Standard
1229 While it is often possible to find a suitable size for the text on the screen,
1230 this doesn't necessarily mean that the fonts are the best ones available
1232 In order to help you get the most out of your system, you can use the font
1233 definition commands to fine-tune the look of the text in greater detail
1237 \begin_layout Subsection
1238 Font definition commands
1241 \begin_layout Standard
1242 As mentioned, LyX uses non-scalable bitmap fonts by default with the XForms
1248 is used, for sans serif fonts,
1256 is used as the monospaced/typewriter font.
1259 \begin_layout Standard
1260 You can change all of these from within the
1265 The number of fonts that are available on different systems vary, but the
1270 should be available everywhere.
1271 Use that program to find candidate fonts.
1272 When you've found a font that you like, try to insert the first two elements
1274 \begin_inset Quotes eld
1278 \begin_inset Quotes erd
1282 \begin_inset Quotes eld
1286 \begin_inset Quotes erd
1293 ) in the appropriate field in the
1305 LyX will then reformat your document using the new font, and if you like
1306 the font, you should
1314 One place to start for a new font is to see if the scalable font
1315 \begin_inset Quotes eld
1319 \begin_inset Quotes erd
1323 Tip: You can see whether a font is a bitmap font or a scalable font by
1325 \begin_inset Quotes eld
1329 \begin_inset Quotes erd
1333 \begin_inset Quotes eld
1337 \begin_inset Quotes erd
1345 If the value 0 is available, the font is scalable.
1346 If the value 0 isn't available, the font is a bitmap font.
1349 \begin_layout Standard
1350 Before you go about scrapping a bitmap font because the larger sizes look
1352 \begin_inset Quotes eld
1356 \begin_inset Quotes erd
1359 , you should toggle the
1360 \begin_inset Quotes eld
1364 \begin_inset Quotes erd
1368 This is only useful if you use bitmap fonts, because only these don't scale
1370 If you define this flag, LyX will only use the fixed font sizes that are
1371 available, and this guarantees that all bitmap fonts look well.
1372 (You can see which individual font sizes are available with the
1381 .) However, the prize is that the difference between the size of the fonts
1382 on screen and the size of fonts on paper will be larger because LyX will
1383 have to be satisfied with the closest available size, and not try to scale
1385 Also, you can risk that some logically different sizes, such as
1393 , will be mapped to the same screen font, making it hard for you to see
1394 the difference on screen.
1395 We've decided not to use scalable fonts by default because of these artifacts,
1396 but since LyX is a WYSIWYM system, many people like to use the flag anyways,
1397 well-knowing that the font size on the screen can't be trusted.
1398 But remember that this flag only makes a difference when you use bitmap
1400 Scalable fonts won't be affected for reasons you should understand by now.
1403 \begin_layout Standard
1404 One final note regarding this flag: you should know that there is nothing
1405 wrong with using bitmap and scalable fonts at the same time for different
1407 For instance, it's common to use the scalable
1408 \begin_inset Quotes eld
1412 \begin_inset Quotes erd
1415 for the serif text together with a bitmap version of
1416 \begin_inset Quotes eld
1420 \begin_inset Quotes erd
1424 And you can safely select the
1425 \begin_inset Quotes eld
1429 \begin_inset Quotes erd
1432 button without worries: It will only apply to the Helvetica font.
1435 \begin_layout Standard
1436 Sometimes the artifacts introduced by use of the flag can be relieved by
1437 using the fine-detail screen font sizes which defines which point sizes
1438 the different logical font sizes correspond to.
1443 to see exactly what concrete fonts the logical sizes map to, and try adjusting
1444 the corresponding entries in the
1448 dialog until you've managed to hit the nail and get the fonts you want.
1449 This can be hard to do, because LyX uses the DPI setting and the font zoom
1450 settings to calculate which exact screen font size to ask the X server
1451 for, thus obfuscating the mapping.
1452 If you can't make it by trial-and-error, you can make the process more
1453 transparent if you set both the DPI setting and font zoom settings to 100---eve
1454 n when this is known to be wrong.
1455 This will of course make your scalable fonts look weird, so use with care.
1458 \begin_layout Subsection
1462 \begin_layout Standard
1463 By default, LyX will use fonts meant to write Western European text, including
1464 all kinds of English.
1465 This is defined through the so-called
1474 If you want to use LyX to write for instance Eastern European text, Cyrillic
1475 or any other language not covered by the ISO-8859-1 font encoding, you
1476 can define a different one with the encoding setting.
1477 This requires you to have special fonts installed.
1482 to see whether this is the case: check the
1483 \begin_inset Quotes eld
1487 \begin_inset Quotes erd
1491 \begin_inset Quotes eld
1495 \begin_inset Quotes erd
1498 fields for ISO-8859-X values different from ISO-8859-1, and search for
1499 one that contains the national characters of your language.
1500 If you find any, enter this encoding in the dialog.
1501 If not, go searching the Web for appropriate fonts.
1502 For the Qt frontend, it's recommended you use an iso646 font set.
1505 \begin_layout Standard
1506 When you've set LyX up to use a different font encoding, you should also
1507 consider changing the font used by dialog windows in LyX.
1514 dialog will not be understandable unless you tell LyX to use a different
1516 By default the menu font is set to
1518 -*-helvetica-medium-r
1520 , but often Helvetica is not available in the font encoding you need, so
1521 the dialog allows this to be changed.
1524 \begin_layout Standard
1525 As you can see, there are quite a few options that can be used to fine tune
1526 the look of your fonts.
1527 This should not scare you from fiddling with the settings, because after
1528 all, you will hopefully be using LyX for many hours in the future.
1529 And contrary to real WYSIWYG word processors where you are tied to using
1530 fonts that have to look good both on paper and on screen, LyX gives you
1531 the possibility of using fonts that are designed to look good on the screen
1532 while using a different set of fonts to look good on paper.
1535 \begin_layout Section
1537 \begin_inset CommandInset label
1546 \begin_layout Standard
1547 Bindings are used to, well, bind a function to a key.
1548 Several prepackaged binding files are available: a CUA set of bindings
1549 (familiar as the typical set of PC and CDE set of keyboard shortcuts),
1550 an Emacs set of bindings, for those of us who follow the One True Way and
1551 refuse to lower our standards,
1555 \begin_layout Standard
1556 I'm kidding here, of course!
1561 as well as specialty bindings (broadway and hollywood) and other languages
1562 (French, German, etc.).
1565 \begin_layout Standard
1566 If, however, you'd like to customise the keybindings to your own exacting
1567 tastes, then copy the best-fit file in
1576 Don't forget to load this new file into LyX using the
1581 (For the moment you'll have to restart LyX for these changes to take effect.)
1584 \begin_layout Standard
1585 LyX supports internationalization of the user interface (see Chapter\InsetSpace ~
1587 \begin_inset CommandInset ref
1589 reference "chap:i18n"
1598 is set, with the environment variable
1602 , LyX will try to use bindfiles by prepending
1607 For example, you can put a translated copy of some standard bind file in
1612 directory, and LyX will use it automatically.
1615 \begin_layout Standard
1620 files is straightforward:
1623 \begin_layout Standard
1628 bind <key combination> <lyx-function>
1631 \begin_layout Standard
1632 Both key combination and lyx-function (including any arguments) must be
1633 enclosed in "double quotes".
1634 All the LyX functions are listed in the
1641 \begin_layout Section
1643 \begin_inset CommandInset label
1652 \begin_layout Standard
1653 The appearance of both the menu and toolbar may both be changed using the
1668 For the moment, only one file exists,
1672 , but feel free to experiment.
1673 Just copy the file to the
1677 directory and play! Note that, for the moment, you'll have to restart LyX
1678 for these changes to take effect.
1681 \begin_layout Standard
1686 files is straightforward: have a look at
1699 entries must be ended with an explicit
1724 s and in the case of the
1725 \begin_inset Quotes eld
1729 \begin_inset Quotes erd
1737 One small word of warning.
1742 s may be inserted in a
1750 , but they are defined as
1761 \begin_layout Section
1762 \begin_inset CommandInset label
1764 name "sec:converters-etc"
1768 Converters, Formats, and Copiers
1771 \begin_layout Standard
1772 LyX has a powerful mechanism to convert to and from any file format using
1777 \begin_layout Subsection
1781 \begin_layout Standard
1782 The first step is to define your file formats if they are not already defined.
1785 Tools\SpecialChar \menuseparator
1786 Preferences:Converters
1789 Enter a new format name; a new GUI name (used in e.\InsetSpace \thinspace{}
1799 menus); and a file extension.
1804 \begin_layout Standard
1809 option tells LyX that a format is suitable for document export.
1810 If this is is set and if a suitable conversion route exists, the format
1813 File\SpecialChar \menuseparator
1817 The format will also appear in the
1821 menu if it has a specified viewer.
1822 Pure image formats, e.\InsetSpace \thinspace{}
1828 , should not use this option.
1829 Formats that can both represent vector graphics and documents like e.\InsetSpace \thinspace{}
1838 \begin_layout Standard
1841 Vector graphics format
1843 tells LyX that a format can contain vector graphics.
1844 This information is used to determine the target format of included graphics
1850 Included graphics may need to be converted to either
1866 cannot handle other image formats.
1867 If an included graphic is not already in
1879 format, it is converted to
1883 if the vector format option is set, and otherwise to
1890 \begin_layout Standard
1891 A Format can have a Viewer and Editor program associated with it.
1892 For example, you might want to use
1896 to view PostScript files.
1897 You can enter the program call and its options to the corresponding fields.
1898 For the call you can use the four variable listed in the next section.
1899 The viewer is launched when you view an image in LyX or use the
1904 If the operating system has a default viewer associated to a format, this
1905 viewer is used instead of the one defined here when you enter in the Viewer
1907 \begin_inset Quotes eld
1915 \begin_inset Quotes erd
1919 The editor is for example launched when you press the
1934 \begin_layout Subsection
1938 \begin_layout Standard
1939 Each format can have a Copier associated with it.
1940 These are defined in the
1942 Tools\SpecialChar \menuseparator
1946 Since all conversions from one format to another take place in LyX's temporary
1947 directory, it is sometimes necessary to modify a file before copying it
1948 to the temporary directory in order that the conversion may be performed.
1952 \begin_layout Standard
1953 For example, the file may refer to other files---images, for example---using
1954 relative filenames, and these may become invalid when the file is copied
1955 to the temporary directory.
1960 This is done by the Copier: It copies a file to (or from) the temporary
1961 directory and may modify it in the process.
1964 \begin_layout Standard
1965 Copiers may also be used for other purposes.
1966 For example, if appropriate converters are found, LyX will automatically
1967 install copiers for the
1977 When these formats are exported, the copier sees that not just the main
1978 HTML file but various associated files (style files, images, etc.) are also
1980 All these files are written to a subdirectory of the directory in which
1981 the original LyX file was found.
1985 \begin_layout Standard
1986 This copier can be customized.
1988 \begin_inset Quotes eld
1992 \begin_inset Quotes erd
1995 argument takes a comma-separated list of extensions to be copied; if it
1996 is omitted, all files will be copied.
1998 \begin_inset Quotes eld
2002 \begin_inset Quotes erd
2005 argument determines the extension added to the generated directory.
2007 \begin_inset Quotes eld
2015 \begin_inset Quotes erd
2018 , so HTML generated from
2020 /path/to/filename.lyx
2024 /path/to/filename.html.LyXconv
2035 \begin_layout Standard
2036 The definitions of the copiers may use four variables:
2040 \labelwidthstring 00.00.0000
2041 $$s The LyX system directory (e.\InsetSpace \thinspace{}
2051 \labelwidthstring 00.00.0000
2056 \labelwidthstring 00.00.0000
2061 \labelwidthstring 00.00.0000
2062 $$l The `LaTeX name'
2065 \begin_layout Standard
2066 The latter is to be given in a form suitable for inclusion in a LaTeX's
2073 command and is relevant only when exporting files suitable for such inclusion.
2076 \begin_layout Standard
2077 Copiers can be used to do almost anything with output files.
2078 For example, suppose you want generated pdf files to be copied to a special
2080 \begin_inset Flex CharStyle:Code
2083 \begin_layout Standard
2090 Then you could write a shell script such as this one:
2093 \begin_layout Standard
2094 \begin_inset listings
2098 \begin_layout Standard
2102 \begin_layout Standard
2106 \begin_layout Standard
2107 TOFILE=`basename $2`
2110 \begin_layout Standard
2111 cp $FROMFILE /home/you/pdf/$TOFILE
2116 Save that in your local LyX directory---say,
2117 \begin_inset Flex CharStyle:Code
2120 \begin_layout Standard
2121 /home/you/.lyx/scripts/pdfcopier.sh
2126 ---and make it executable, if you need to do so on your platform.
2129 Tools\SpecialChar \menuseparator
2136 format---or one of the other pdf formats---and enter
2137 \begin_inset Flex CharStyle:Code
2140 \begin_layout Standard
2141 pdfcopier.sh $$i $$o
2154 \begin_layout Subsection
2158 \begin_layout Standard
2159 To define a new converter, select an existing one, select a different format
2165 and\InsetSpace \thinspace{}
2166 /\InsetSpace \thinspace{}
2172 drop-down list, modify the
2176 field, and press the
2183 \begin_layout Standard
2184 You do not have to define converters between all the formats between which
2185 you want to convert.
2186 For example, you will note that there is no `LyX to PostScript' converter,
2187 but LyX will export PostScript.
2188 It does so by first creating a LaTeX file (no converter needs to be defined
2189 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2190 and finally converts the resulting DVI file to PostScript.
2191 LyX finds such `chains' of converters automatically, and it will always
2192 choose the shortest possible chain.
2193 You can, though, still define multiple conversion methods between file
2195 For example, the standard LyX configuration provides three ways to convert
2196 LaTeX to PDF: Directly, using
2200 ; via (DVI and) PostScript, using
2209 To define such alternate chains, you must define multiple target `file
2210 formats', as described in the next section.
2211 For example in the standard configuration the formats named
2223 are defined, all of which share the extension
2230 \begin_layout Standard
2231 Several variables can be used in the definition of converters:
2235 \labelwidthstring 00.00.0000
2236 $$s The LyX system directory
2240 \labelwidthstring 00.00.0000
2245 \labelwidthstring 00.00.0000
2250 \labelwidthstring 00.00.0000
2251 $$b The base filename of the input file
2255 \labelwidthstring 00.00.0000
2256 $$p The path to the input file
2259 \begin_layout Standard
2265 field you can enter the following flags, separated by commas:
2269 \labelwidthstring 00.00.0000
2270 latex This converter runs some form of LaTeX.
2271 This will make LyX's LaTeX error logs available.
2275 \labelwidthstring 00.00.0000
2276 needaux Needs the LaTeX
2280 file for the conversion.
2284 \labelwidthstring 00.00.0000
2288 \begin_layout Standard
2289 The following three flags are not really flags at all because they take
2300 \labelwidthstring 00.00.0000
2301 parselog If set, the converter's standard error will be redirected to a
2306 , and the script given as argument will be run as:
2308 script <infile.out >infile.log
2311 The argument may contain $$s.
2315 \labelwidthstring 00.00.0000
2316 resultdir The name of the directory in which the
2320 will dump the generated files.
2321 LyX will not create this directory, and it does not copy anything into
2322 it, though it will copy this directory to the destination.
2323 The argument may contain $$b, which will be replaced by the basename of
2324 the input and output files, respectively, when the directory is copied.
2327 that resultdir and usetempdir make no sense together.
2328 The latter will be ignored if the former is given.
2332 \labelwidthstring 00.00.0000
2333 resultfile Determines the output filename and may, contain $$b.
2334 Sensible only with resultdir, and optional even then; if not given, it
2335 defaults to `index'.
2338 \begin_layout Standard
2339 None of these last three are presently used in any of the converters that
2340 are installed with LyX.
2342 \begin_inset CommandInset ref
2344 reference "sub:LyX-and-Literate"
2348 of the Extended Features guide for some examples of how you might use parselog.
2351 \begin_layout Section
2352 BibTeX and makeindex
2355 \begin_layout Standard
2356 Both the bibliography generating command (default
2360 ) and the index generating command (default
2373 As an alternative for
2385 \begin_layout Standard
2386 The command to enter is
2392 makeindex.sh -m $$lang
2395 \begin_layout Standard
2396 where the placeholder
2400 will be replaced by the chosen document (babel) language.
2404 \begin_layout Standard
2405 have installed the packages
2422 at a shell prompt for a help page.
2425 \begin_layout Section
2426 Plain text export options
2429 \begin_layout Standard
2430 \begin_inset VSpace bigskip
2436 \begin_layout Standard
2438 There are a couple of commands that can be used to
2439 \begin_inset Quotes eld
2443 \begin_inset Quotes erd
2446 exported plain text files.
2447 Note that LyX automatically detects and uses the best settings for your
2448 system at installation time, but you can modify them if you disagree with
2452 \begin_layout Description
2456 Plain text\InsetSpace ~
2460 This option defines the command used to produce better plain text tables
2465 UNIX-commands (refer to their manpages for more information about them).
2466 Setting this as empty tells LyX to use the internal (inferior) formatter.
2469 \begin_layout Description
2473 Plain text\InsetSpace ~
2478 With this command you can set the default line length of the plain text
2480 Setting it to 0 means endless lines.
2483 \begin_layout Section
2487 \begin_layout Standard
2488 There are a bunch of configuration options that are used for interaction
2489 with the external print command from LyX.
2490 Normally the defaults are fine: if, however, your print command takes different
2491 option names, you can modify them here.
2494 \begin_layout Subsection
2498 \begin_layout Standard
2499 You can change the colors used by LyX on-screen using the new
2504 Alternatively, if you're feeling particularly perverse you could use the
2509 bindable function (see the
2514 Input would have the format:
2517 \begin_layout Standard
2520 set-color LyXName X11Color
2523 \begin_layout Standard
2524 Here is a (partial) list of the functions and default colors:
2527 \begin_layout Standard
2529 \begin_inset Tabular
2530 <lyxtabular version="3" rows="10" columns="3">
2532 <column alignment="left" valignment="top" leftline="true" width="0pt">
2533 <column alignment="left" valignment="top" leftline="true" width="0pt">
2534 <column alignment="center" valignment="top" leftline="true" rightline="true" width="0pt">
2535 <row topline="true" bottomline="true">
2536 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2539 \begin_layout Standard
2554 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2557 \begin_layout Standard
2572 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2575 \begin_layout Standard
2591 <row topline="true">
2592 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2595 \begin_layout Standard
2610 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2613 \begin_layout Standard
2628 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2631 \begin_layout Standard
2647 <row topline="true">
2648 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2651 \begin_layout Standard
2666 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2669 \begin_layout Standard
2684 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2687 \begin_layout Standard
2703 <row topline="true">
2704 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2707 \begin_layout Standard
2722 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2725 \begin_layout Standard
2740 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2743 \begin_layout Standard
2759 <row topline="true">
2760 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2763 \begin_layout Standard
2778 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2781 \begin_layout Standard
2796 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2799 \begin_layout Standard
2815 <row topline="true">
2816 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2819 \begin_layout Standard
2834 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2837 \begin_layout Standard
2847 fraction Lines, brackets, etc.
2852 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2855 \begin_layout Standard
2871 <row topline="true">
2872 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2875 \begin_layout Standard
2890 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2893 \begin_layout Standard
2899 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2902 \begin_layout Standard
2918 <row topline="true">
2919 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2922 \begin_layout Standard
2937 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2940 \begin_layout Standard
2946 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2949 \begin_layout Standard
2965 <row topline="true">
2966 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2969 \begin_layout Standard
2984 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2987 \begin_layout Standard
2993 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2996 \begin_layout Standard
3012 <row topline="true" bottomline="true">
3013 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3016 \begin_layout Standard
3031 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3034 \begin_layout Standard
3044 selection background
3049 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3052 \begin_layout Standard
3075 \begin_layout Section
3076 The autodetected settings
3079 \begin_layout Standard
3080 \begin_inset CommandInset label
3082 name "sec:autodetected"
3086 There are several items that are detected for you when you run
3093 \SpecialChar \menuseparator
3099 In this section, we list those which pertain to the user preferences.
3102 \begin_layout Description
3108 plaintext_roff_command
3123 , depending on what is available.
3126 \begin_layout Description
3139 plus a bunch of options.
3142 \begin_layout Description
3155 on systems (so-called System V) who have this command, and
3159 otherwise (BSD systems).
3162 \begin_layout Description
3168 print_spool_printerprefix
3179 , depending on whether
3190 \begin_layout Description
3207 fonts are found and LaTeX has support for these fonts built-in.
3208 You can set it manually if you only have the so-called
3215 \begin_layout Section
3219 \begin_layout Standard
3220 There are many other configuration options that can be used to customize
3222 We still need to document them here, but again, most should be fairly obvious.
3223 Please ask on the mailing lists if you need some more information; it may
3224 even prompt us to expand this section.
3227 \begin_layout Chapter
3228 Internationalizing LyX
3229 \begin_inset CommandInset label
3238 \begin_layout Standard
3239 LyX supports using a translated interface.
3240 Last time we checked, LyX provided text in 14 languages together with the
3241 default English text.
3242 The language of choice is called your
3247 (For further reading on locale settings, see also the documentation for
3248 locale that comes with your operating system.
3249 For Linux, the manual page for locale(5) could be a good place to start).
3252 \begin_layout Standard
3253 Notice that these translations will work, but do contain a few flaws.
3254 In particular, all dialogs have been designed with the English text in
3255 mind, which means that some of the translated text will be too large to
3256 fit within the space allocated.
3257 This is only a display problem and will not cause any harm.
3258 Also, you will find that some of the translations do not define short-cut
3259 keys for everything.
3260 Sometimes, there are simply not enough free letters to do it.
3261 Other times, the translator just hasn't got around to doing it yet.
3262 Our localization team -- which you may wish to join -- will try to fix
3263 these shortcomings in future versions of LyX.
3266 \begin_layout Section
3267 Selecting an alternative language for the user interface
3270 \begin_layout Standard
3271 This feature is disabled by default, meaning that system default language
3273 To enable an alternative language, you have to set an appropriate environment
3281 for csh class shells
3296 with the two letter code (or four letter code, like
3300 for British English) for the language you want.
3306 Besides the user interface texts being translated, also the appropriate
3307 manuals will be presented under the Help menu -- if available.
3310 \begin_layout Standard
3311 On some systems, you may have to redefine
3323 , to override the system settings; their preference is in this order
3327 \begin_layout Standard
3328 The shell variable LANGUAGE has been disabled in LyX for technical reasons.
3334 , which corresponds to the way GNU
3339 Consult your system documentation.
3340 Normally, you'll want to put the appropriate line in a shell script run
3341 on start-up, so that the translation is on by default.
3342 Remember that this affects
3346 localized packages, not only LyX!
3349 \begin_layout Standard
3350 If LyX is configured and compiled with
3351 \begin_inset Quotes eld
3359 \begin_inset Quotes erd
3362 , this mechanism will not work.
3365 \begin_layout Section
3369 \begin_layout Subsection
3370 Translating the graphical user interface (text messages).
3373 \begin_layout Standard
3378 library to handle the internationalization of the interface.
3379 To have LyX speak your favorite language in all menus and dialogs, you
3384 -file for that language.
3385 When this is available, you'll have to generate a mo-file from it and install
3391 The process of doing all of this is explained in the documentation for
3396 , but in short, this is what you do (
3400 denotes the language code):
3403 \begin_layout Standard
3407 \begin_layout Standard
3419 \begin_layout Itemize
3422 LYX-SOURCE-DIR/po/lyx.pot
3435 doesn't exist, it can be remade with
3439 in that directory, or you can use an existing po-file for some other language
3443 \begin_layout Itemize
3450 \begin_layout Standard
3451 We recommend that you use Emacs to do this, since the
3455 distribution includes a nice mode that supports you in doing this.
3463 For some menu- and widget-labels, there are also shortcut keys that should
3465 Those keys are marked after a `|', and should be translated according to
3466 the words and phrases of the
3471 There is a tool named
3475 written in Prolog in
3477 LYX-SOURCE-DIR/development/tools/
3479 that may be useful to help determine short-cut keys.
3480 Note that XForms (version 0.86 at least) can't handle anything but 7-bit
3481 characters as shortcut keys.
3482 You should also fill also out the information at the beginning of the new
3487 -file with your email-address, etc., so people know where to reach you with
3488 suggestions and entertaining flames.
3491 \begin_layout Itemize
3500 This can be done with
3521 \begin_layout Itemize
3526 -file to your locale-tree, at the correct directory for application messages
3531 , and under the name
3540 /usr/local/share/locale/
3551 \begin_layout Standard
3555 \begin_layout Standard
3567 \begin_layout Standard
3568 Adding a new po-file to the
3572 of LyX involves altering the configure scripts and more, but the way
3576 works, you don't actually need the source-code of LyX to translate it---having
3592 \begin_layout Standard
3593 If you've written a translation file for a language that LyX does not currently
3594 support, feel free to submit it for inclusion by sending a patch.
3595 In this case, we recommend that you read the
3603 directory for more instructions.
3606 \begin_layout Subsubsection
3610 \begin_layout Standard
3611 Sometimes it turns out that one english message needs to be translated into
3612 different messages in the target language.
3613 One example is the message
3617 which has the german translation
3634 does not handle such ambigous translations.
3635 Therefore you have to add some context information to the message: Instead
3642 To[[as in 'From format x to format y']]
3646 To[[as in 'From page x to page y']].
3649 Now the two occurences of
3657 and can be translated correctly to
3672 \begin_layout Standard
3673 Of course the context information needs to be stripped off the original
3674 message when no translation is used.
3675 Therefore you have to put it in double square brackets at the end of the
3676 message (see the example above).
3677 The translation mechanism of LyX ensures that everything in double square
3678 brackets at the end of messages is removed before displaying the message.
3681 \begin_layout Subsection
3682 Translating the documentation.
3685 \begin_layout Standard
3686 The online documentation (in the
3693 -menu) can (and should!) be translated.
3694 If there are translated versions of the documentation available
3698 \begin_layout Standard
3699 As of February 2003, almost all of the docs have been translated into German
3705 has been translated into at least 12 other languages, with other translations
3707 The library of translated documents is growing rapidly.
3712 , and the locale is set accordingly, these will be used automagically by
3714 LyX looks for translated versions as
3728 denotes the language as set by the environmental variable
3733 If there are none, the default English versions will be displayed.
3734 Note that the translated versions must have the same filenames (
3738 above) as the original.
3739 If you feel up to translating the documentation (an excellent way to proof-read
3740 the original documentation BTW!), there are a few things you should do
3744 \begin_layout Itemize
3749 , the guide to writing LyX documentation.
3750 Pay special attention to the translator's section.
3753 \begin_layout Itemize
3754 Check out the documentation translation web page at
3755 \begin_inset Flex URL
3758 \begin_layout Standard
3760 http://www.devel.lyx.org
3766 That way, you can find out which (if any) documents have already been translate
3767 d into your language.
3768 You can also find out who (if anyone) is organizing the effort to translate
3769 the documentation into your language.
3770 If no one is organizing the effort, please let us know that you're interested.
3773 \begin_layout Standard
3774 Once you get to actually translating, here's a few hints for you that may
3778 \begin_layout Itemize
3779 Join the documentation team! There is information on how to do that in
3788 elp\SpecialChar \menuseparator
3795 ), which by the way is the first document you should translate.
3798 \begin_layout Itemize
3799 Learn the typographic conventions for the language you are translating to.
3800 Typography is an ancient art and over the centuries, a great variety of
3801 conventions have developed throughout different parts of the world.
3802 Also study the professional terminology amongst typographers in your country.
3803 Inventing your own terminology will only confuse the users.
3806 (Warning! Typography is addictive!)
3809 \begin_layout Itemize
3810 Make a copy of the document.
3811 This will be your working copy.
3812 You can use this as your personal translated help-file by placing it in
3820 \begin_layout Itemize
3821 Sometimes the original document (from the LyX-team) will be updated.
3822 Use the ViewCVS tool available at
3823 \begin_inset Flex URL
3826 \begin_layout Standard
3828 http://www.lyx.org/viewcvs.cgi/lyxdoc/
3833 to see what has been changed
3837 \begin_layout Standard
3838 Alternatively, you can keep a copy of the latest version of the English
3839 document which you've translated.
3845 That way you can easily see which parts of the translated document need
3849 \begin_layout Itemize
3850 If you ever find an error in the original document, fix it and notify the
3851 rest of the documentation team of the changes! (You didn't forget to join
3852 the documentation team did you?)
3855 \begin_layout Section
3856 International Keyboard Support
3859 \begin_layout Standard
3862 [Editor's Note: The following section is by
3870 It needs to be fixed to conform to the new Documentation Style sheet and
3871 to make use of the new v1.0 features.
3872 The whole thing also needs to be merged with the section following it.-jw]
3875 \begin_layout Subsection
3876 Defining Own Keymaps: Keymap File Format
3879 \begin_layout Standard
3880 Let's look at a keyboard definition file a little closer.
3881 It is a plain text file defining
3884 \begin_layout Itemize
3885 key-to-key or key-to-string translations
3888 \begin_layout Itemize
3892 \begin_layout Itemize
3893 dead keys exceptions
3896 \begin_layout Standard
3897 To define key-to-key or key-to-string translation, use this command:
3900 \begin_layout Quotation
3916 \begin_layout Standard
3921 is the key to be translated and
3925 is the string to be inserted into the document.
3926 To define dead keys, use:
3929 \begin_layout Quotation
3945 \begin_layout Standard
3955 The following dead keys are supported (shortcut name is in parentheses):
3958 \begin_layout Quotation
3966 \begin_layout Quotation
3972 \begin_layout Quotation
3978 \begin_layout Quotation
3984 \begin_layout Quotation
3990 \begin_layout Quotation
3997 \begin_layout Standard
4009 \begin_layout Quotation
4015 \begin_layout Quotation
4022 \begin_layout Standard
4034 \begin_layout Quotation
4040 \begin_layout Quotation
4046 \begin_layout Quotation
4053 \begin_layout Standard
4065 \begin_layout Quotation
4072 \begin_layout Standard
4084 \begin_layout Quotation
4090 \begin_layout Quotation
4091 hungarian umlaut (hug)
4096 \begin_layout Quotation
4102 \begin_layout Quotation
4109 \begin_layout Standard
4121 \begin_layout Standard
4122 Since in many international keyboards there are exceptions to what some
4123 dead keys should do, you can define them using
4126 \begin_layout Quotation
4135 deadkey key outstring
4138 \begin_layout Standard
4139 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
4143 \begin_layout Quotation
4157 \begin_layout Standard
4158 to make it work correctly.
4159 Also, you have to define as exceptions dead keys over i and j, to remove
4160 the dot from them before inserting an accent mark.
4161 I will change this when the time comes, but so far I haven't had time.
4164 \begin_layout Standard
4165 Oh, and about characters: backslash is escaped, so to enter it, you'll need
4171 have different meaning.
4176 marks comments, quotes start and end LaTeX-style commands.
4177 To enter quote, you'll need to use
4196 \begin_layout Standard
4197 If you make a keyboard description file that works for your language, please
4198 mail it to me, so I can include it in the next keymap distribution.
4201 \begin_layout Standard
4202 More keywords will be supported in keymap configuration file in future,
4206 \begin_layout Itemize
4224 \begin_layout Itemize
4239 an external keymap translation program
4242 \begin_layout Standard
4243 Also, it should look into
4247 file for defaults, too (for example, a
4253 option to include default keyboard).
4256 \begin_layout Section
4257 International Keymap Stuff
4258 \begin_inset CommandInset label
4267 \begin_layout Standard
4268 The next two sections describe the
4280 file syntax in detail.
4281 These sections should help you design your own key map if the ones provided
4282 do not meet your needs.
4285 \begin_layout Subsection
4289 \begin_layout Standard
4298 file maps keystrokes to characters or strings.
4299 As the name suggests it sets a keyboard mapping.
4324 are described in this section.
4328 \labelwidthstring 00.00.0000
4335 Map a character to a string
4338 \begin_layout LyX-Code
4353 \begin_layout Standard
4386 the double-quote (")
4403 must be escaped with a preceding backslash (
4414 \begin_layout Standard
4421 statement to cause the symbol
4427 to be output for the keystroke
4436 \begin_layout LyX-Code
4443 \labelwidthstring 00.00.0000
4450 Specify an accent character
4453 \begin_layout LyX-Code
4462 \begin_layout Standard
4463 This will make the cha
4501 This is the dead key
4505 \begin_layout Standard
4512 refers to a key that does not produce a character by itself, but when followed
4513 with another key, produces the desired accent character.
4514 For example, a German characte
4516 r with an umlaut like
4526 can be produced in this manner.
4535 \begin_layout Standard
4548 and then another key not in
4565 followed by the other, unallowed key, as output.
4574 cancels a dead key, so if
4591 , the cursor will not go one position backwards but will instead cancel
4608 might have had on the next keystroke.
4612 \begin_layout Standard
4613 The following example specifies that the character ' is to be an acute accent,
4614 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4617 \begin_layout LyX-Code
4620 kmod ' acute aeiouAEIOU
4624 \labelwidthstring 00.00.0000
4629 Specify an exception to the accent character
4632 \begin_layout LyX-Code
4641 \begin_layout Standard
4642 This defines an exce
4683 have been assigned a keystroke with a previous
4706 must not belong in the
4758 If such a declaration does not exist in
4814 \begin_layout Standard
4815 The following command produces causes äi to be produced when you enter acute-i
4819 \begin_layout LyX-Code
4834 \labelwidthstring 00.00.0000
4839 Combine two accent characters
4842 \begin_layout LyX-Code
4848 accent1 accent2 allowed
4851 \begin_layout Standard
4852 This one is getting pretty esoteric.
4853 It allows you to combine the effect
4934 \begin_layout Standard
4935 Consider this example from the
4944 \begin_layout LyX-Code
4947 kmod ; acute aeioyvhAEIOYVH
4951 kcomb acute umlaut iyIY
4954 \begin_layout Standard
4955 This allows you to press
4961 and get the effect of
4978 in this case cancels the last dead key, so if you press
4995 \begin_layout Subsection
4999 \begin_layout Standard
5006 mapping is performed, a
5013 file maps the strings that the symbols generate to characters in the current
5015 The LyX distribution currently includes at least the
5030 \begin_layout Standard
5037 file is a sequence of declarations of the form
5040 \begin_layout LyX-Code
5053 \begin_layout Standard
5054 For example, in order to map
5062 to the corresponding character in the iso-8859-1 set (233), the following
5066 \begin_layout LyX-Code
5074 \begin_layout Standard
5097 the same character can apply to more than one string.
5108 \begin_layout LyX-Code
5134 \begin_layout Standard
5135 If LyX cannot find a mapping for the string produced by the keystroke or
5136 a deadkey sequence, it will check if it looks like an accented char and
5137 try to draw an accent over the character on screen.
5140 \begin_layout Subsection
5144 \begin_layout Standard
5145 There is a second way to add support for international characters through
5146 so-called dead-keys.
5147 A dead-key works in combination with a letter to produce an accented character.
5148 Here, we'll explain how to create a really simple dead-key to illustrate
5152 \begin_layout Standard
5153 Suppose you happen to need the circumflex character,
5154 \begin_inset Quotes eld
5158 \begin_inset Quotes erd
5166 -key [a.k.a.\InsetSpace ~
5171 ] to the LyX command
5180 Now, whenever you type the
5184 -key followed by a letter, that letter will have a circumflex accent on
5186 For example, the sequence
5187 \begin_inset Quotes eld
5195 \begin_inset Quotes erd
5198 produces the letter:
5199 \begin_inset Quotes eld
5203 \begin_inset Quotes erd
5207 If you tried to type
5208 \begin_inset Quotes eld
5216 \begin_inset Quotes erd
5219 , however, LyX will complain with a beep, since a
5220 \begin_inset Quotes eld
5228 \begin_inset Quotes erd
5231 never takes a circumflex accent.
5236 after a dead-key produces the bare-accent.
5237 Please note this last point! If you bind a key to a dead-key, you'll need
5238 to rebind the character on that key to yet another key.
5243 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5246 \begin_layout Standard
5247 One common way to bind dead-keys is to use
5259 in combination with an accent, like
5260 \begin_inset Quotes eld
5268 \begin_inset Quotes erd
5272 \begin_inset Quotes eld
5280 \begin_inset Quotes erd
5284 \begin_inset Quotes eld
5292 \begin_inset Quotes erd
5296 Another way involves using
5304 [remember them from section?] to set up the special
5313 acts in some ways just like
5317 and permits you to bind keys to accented characters.
5318 You can also turn keys into dead-keys by binding them to something like
5323 and then binding this symbolic key to the corresponding LyX command.
5327 \begin_layout Standard
5332 : This is exactly what I do in my
5350 and a bunch of these
5351 \begin_inset Quotes eld
5359 \begin_inset Quotes erd
5362 symbolic keys bound such things as
5373 This is how I produce my accented characters.
5378 You can make just about anything into the
5386 keys, a spare function key, etc.
5387 As for the LyX commands that produce accents, check the entry for
5396 You'll find the complete list there.
5399 \begin_layout Subsection
5400 Saving your Language Configuration
5403 \begin_layout Standard
5404 \begin_inset CommandInset label
5410 You can edit your preferences so that your desired language environment
5411 is automatically configured when LyX starts up, via the
5416 dit\SpecialChar \menuseparator
5426 \begin_layout Chapter
5427 Installing New Document Classes, Layouts, and Templates
5428 \begin_inset CommandInset label
5430 name "chap:textclass"
5438 \begin_layout Standard
5439 Installing New Document Classes
5447 \begin_layout Standard
5448 In this chapter, we describe the procedures for creating and installing
5449 new LyX layout and template files, as well as offer a refresher on correctly
5450 installing new LaTeX document classes.
5451 Some definitions: a document class is a LaTeX file (usually ending in
5459 ) which describes the format of a document such as an article, report, journal
5461 and all the commands needed to realize that format.
5462 A layout file is a LyX file which corresponds to a LaTeX document class
5463 and which tells LyX how to
5464 \begin_inset Quotes eld
5468 \begin_inset Quotes erd
5471 things on the screen to make the display look something like the final
5473 More precisely, a layout file describes a
5474 \begin_inset Quotes eld
5478 \begin_inset Quotes erd
5481 which is the internal construct LyX uses to render the screen display.
5483 \begin_inset Quotes eld
5487 \begin_inset Quotes erd
5491 \begin_inset Quotes eld
5495 \begin_inset Quotes erd
5498 can be used somewhat interchangeably, but it is better to refer to the
5499 file as the layout, and the thing living in LyX's memory as the text class.
5500 A template file is simply a LyX document which contains a set of predefined
5501 entries for a given document class which are generally required for that
5503 Templates are especially useful for things like journal manuscripts which
5504 are to be submitted electronically.
5507 \begin_layout Section
5508 Installing a new LaTeX package
5511 \begin_layout Standard
5512 Some installations may not include a LaTeX package that you would like to
5514 For example, you might need FoilTeX, a common (and very powerful) package
5515 for preparing slides or viewgraphs for overhead projectors.
5516 Here are the formal steps involved in getting the package up and running
5517 if you are using teTeX or some other web2c based distribution.
5521 \begin_layout Enumerate
5522 Get the package from CTAN or wherever.
5526 \begin_layout Standard
5529 Inventory of your LaTeX configuration
5531 manual for details of what CTAN is and where supported document classes
5540 \begin_layout Enumerate
5545 (this usually lives in the directory
5549 , though you can run
5554 It describes how to add a local
5558 directory; follow the instructions.
5559 You need to insert the name of your local
5572 is a logical place to install software that did not come with your distribution
5578 Usually, you will have to modify only two things:
5582 \begin_layout Enumerate
5587 to the directory you chose; e.g.
5592 TEXMFLOCAL = /usr/local/texmf
5595 \begin_layout Enumerate
5609 TEXMF = {$HOMETEXMF,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5613 \begin_layout Enumerate
5624 You must follow the directory structure of your existing
5628 directory (for example, latex packages should go under
5630 /usr/local/texmf/tex/latex/
5635 \begin_layout Enumerate
5636 Install the package.
5637 For example, you would unpack the FoilTeX tarball and create
5639 /usr/local/texmf/tex/latex/foiltex
5646 directory contains various files.
5649 \begin_layout Enumerate
5657 /usr/local/texmf/ls-R
5662 \begin_layout Enumerate
5663 From within LyX, do:
5668 ools\SpecialChar \menuseparator
5679 \begin_layout Standard
5680 Now you should see your new package---for example
5689 ayout\SpecialChar \menuseparator
5704 Note that there are simpler ways of installing packages: you can add a
5705 link to the new package directory in the system LaTeX directory (
5709 , don't forget to then run
5713 ), or sometimes simply set the
5717 environment variable to include the new package.
5718 However, the formal procedure described in
5722 is guaranteed to work, so you should follow it unless circumstances absolutely
5723 prevent it: such as, when you don't have superuser access.
5726 \begin_layout Section
5727 \begin_inset CommandInset label
5736 \begin_layout Standard
5737 This section describes how to write and install your own LyX layout files
5738 (also known as text classes) and walks through the
5742 text class format as an example.
5747 files describe what paragraph styles are available for a given document
5748 class and how LyX should display them.
5749 We try to provide a thorough description of the process here; however,
5750 there are so many different types of documents supported by LaTeX classes
5751 that we can't hope to cover every different possibility or problem you
5753 (The LyX users' list is frequented by people with lots of experience with
5754 layout design who are willing to share what they've learned.)
5757 \begin_layout Standard
5758 As you prepare to write a new layout, it is extremely helpful to look at
5759 the example layouts distributed with LyX.
5760 If you use a nice LaTeX document class that might be of interest for others,
5761 too, and have a nice corresponding LyX layout, feel free to contribute
5762 the stuff to us, so we may put it into the distribution.
5763 There is also a section on the LyX wiki for this kind of material.
5766 \begin_layout Standard
5767 All the tags described in this chapter are case-insensitive; this means
5780 are really the same command.
5781 The possible values are printed in brackets after the feature's name.
5782 The default value if a feature isn't specified inside a text class-description
5790 If the argument has a datatype like
5791 \begin_inset Quotes eld
5795 \begin_inset Quotes erd
5799 \begin_inset Quotes eld
5803 \begin_inset Quotes erd
5806 , the default is shown like this:
5816 \begin_layout Subsection
5817 \begin_inset CommandInset label
5819 name "sub:Layout-modules"
5826 \begin_layout Standard
5827 Similar to layout files, and new with LyX 1.6, are layout
5832 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5833 some modules---such as the Endnotes module---provide support for just such
5835 In a sense, layout modules are similar to included files---files like stdsectio
5836 ns.inc---in that modules are not specific to a given document layout but
5837 may be used with many different layouts.
5838 The difference is that using a layout module does not require editing the
5840 Rather, modules are selected in the
5845 ocument\SpecialChar \menuseparator
5855 \begin_layout Standard
5856 Building modules is the easiest way to get started with layout editing,
5857 since it can be as simple as adding a single new paragraph or flex inset.
5858 But modules may, in principle, contain anything a layout file can contain.
5861 \begin_layout Standard
5862 A module must begin with a line like the following:
5865 \begin_layout LyX-Code
5868 DeclareLyXModule[endnotes.sty]{Endnotes}
5871 \begin_layout Standard
5872 The argument in square brackets is optional: It declares any LaTeX packages
5873 on which the module depends.
5874 The mandatory argument, in curly brackets, is the name of the module, as
5877 Document\SpecialChar \menuseparator
5881 LyX uses the name to identify the module, so it should be unique.
5884 \begin_layout Standard
5885 The module declaration should then be followed by lines like the following:
5888 \begin_layout LyX-Code
5892 \begin_layout LyX-Code
5893 #Adds an endnote command, in addition to footnotes.
5897 \begin_layout LyX-Code
5898 #You will need to add
5900 theendnotes in ERT where you
5903 \begin_layout LyX-Code
5904 #want the endnotes to appear.
5908 \begin_layout LyX-Code
5912 \begin_layout LyX-Code
5913 #Requires: somemodule | othermodule
5916 \begin_layout LyX-Code
5917 #Excludes: badmodule
5920 \begin_layout Standard
5921 The description is used in
5923 Document\SpecialChar \menuseparator
5926 to provide the user with information about what the module does.
5927 The Requires is used to identify other modules with which this one must
5928 be used; the Excludes line is used to identify modules with which this
5929 one may not be used.
5930 Both are optional, and, as shown, multiple modules should be separated
5931 with the pipe symbol: |.
5932 Note that the required modules are treated disjunctively:
5936 of the required modules must be used.
5941 excluded module may be used.
5942 Note that modules are identified here by their
5946 without the .module extension.
5948 \begin_inset Flex CharStyle:Code
5951 \begin_layout Standard
5958 \begin_inset Flex CharStyle:Code
5961 \begin_layout Standard
5970 \begin_layout Standard
5971 After creating a new module, you will need to reconfigure and then restart
5972 LyX for it to appear in the menu.
5973 However, changes you make to the module will be seen immediately, if you
5976 Document\SpecialChar \menuseparator
5979 , highlight something, and then hit
5980 \begin_inset Quotes eld
5984 \begin_inset Quotes erd
5990 It is strongly recommended that you save your work before doing so
5993 In fact, it is strongly recommended that you not attempt to edit modules
5994 while simultaneously working on documents.
5995 Though of course the developers strive to keep LyX stable in such situations,
5996 syntax errors and the like in your module file could cause strange behavior.
5999 \begin_layout Subsection
6000 Supporting new document classes
6003 \begin_layout Standard
6004 There are two situations you are likely to encounter when wanting to support
6005 a new LaTeX document class, involving LaTeX2e class (
6014 Supporting a style file is usually fairly easy.
6015 Supporting a new document class is a bit harder.
6018 \begin_layout Subsection
6026 \begin_layout Standard
6027 If your new document class is provided as a style file that is used in conjuncti
6028 on with an existing, supported document class---for the sake of the example,
6029 we'll assume that the style file is called
6033 and it is meant to be used with
6037 , which is a standard class---start by copying the existing class's layout
6038 file into your local directory:
6041 \begin_layout LyX-Code
6042 cp report.layout ~/.lyx/layouts/myclass.layout
6045 \begin_layout Standard
6050 and change the line:
6053 \begin_layout LyX-Code
6056 DeclareLaTeXClass{report}
6059 \begin_layout Standard
6063 \begin_layout LyX-Code
6066 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6069 \begin_layout Standard
6073 \begin_layout LyX-Code
6083 \begin_layout Standard
6084 near the top of the file.
6087 \begin_layout Standard
6088 Start LyX and select
6093 ools\SpecialChar \menuseparator
6101 Then restart LyX and try creating a new document.
6106 " as a document class option in the
6111 ocument\SpecialChar \menuseparator
6119 It is likely that some of the sectioning commands and such in your new
6120 class will work differently from how they worked in the base class---
6124 in this example---so you can fiddle around with the settings for the different
6125 sections if you wish.
6126 See below for more discussion on this.
6129 \begin_layout Subsection
6137 \begin_layout Standard
6138 There are two possibilities here.
6139 One is that the class file is itself based upon an existing document class.
6140 For example, many thesis classes are based upon
6145 To see whether yours is, look for a line like
6148 \begin_layout LyX-Code
6154 \begin_layout Standard
6156 If so, then you may proceed largely as in the previous section, though
6157 the DeclareLaTeXClass line will be different.
6158 If your new class is thesis, and it is based upon book, then the line should
6162 \begin_layout LyX-Code
6165 DeclareLaTeXClass[myclass, book]{thesis}
6168 \begin_layout Standard
6169 If, on the other hand, the new class is not based upon an existing class,
6170 you will probably have to
6171 \begin_inset Quotes eld
6175 \begin_inset Quotes erd
6179 We strongly suggest copying an existing layout file which uses a similar
6180 LaTeX class and then modifying it, if you can do so.
6181 At least use an existing file as a starting point so you can find out what
6182 items you need to worry about.
6183 Again, the specifics are covered below.
6186 \begin_layout Section
6187 Declaring a new text class
6190 \begin_layout Standard
6191 When it's finally time to get your hands dirty and create or edit your own
6192 layout file, the following sections describe what you're up against.
6193 Our advice is to go slowly, save and test often, listen to soothing music,
6194 and enjoy one or two of your favorite adult beverages; more if you are
6195 getting particularly stuck.
6196 It's really not that hard, except that the multitude of options can become
6197 overwhelming if you try to do to much in one sitting.
6198 Go have another adult beverage, just for good measure.
6201 \begin_layout Standard
6205 \begin_layout Standard
6206 Lines in a layout file which begin with a
6211 There is one exception to this rule: all layouts should begin with lines
6215 \begin_layout LyX-Code
6218 #% Do not delete the line below; configure depends on this
6221 \begin_layout LyX-Code
6226 DeclareLaTeXClass{article}
6229 \begin_layout Standard
6230 The second line is used when you configure LyX.
6231 The layout file is read by the LaTeX script
6235 , in a special mode where
6240 The first line is just a LaTeX comment, and the second one contains the
6241 declaration of the text class.
6242 If these lines appear in a file named
6246 , then they define a text class of name
6250 (the name of the layout file) which uses the LaTeX document class
6254 (the default is to use the same name as the layout).
6256 \begin_inset Quotes eld
6260 \begin_inset Quotes erd
6263 that appears above is used as a description of the text class in the
6268 ocument\SpecialChar \menuseparator
6278 \begin_layout Standard
6279 Let's assume that you wrote your own text class that uses the
6283 documentclass, but where you changed the appearance of the section headings.
6284 If you put it in a file
6288 , the header of this file should be:
6291 \begin_layout LyX-Code
6294 #% Do not delete the line below; configure depends on this
6297 \begin_layout LyX-Code
6302 DeclareLaTeXClass[article]{article (with my own headings)}
6305 \begin_layout Standard
6306 This declares a text class
6310 , associated with the LaTeX document class
6315 \begin_inset Quotes eld
6318 article (with my own headings)
6319 \begin_inset Quotes erd
6323 If your text class depends on several packages, you can declare it as:
6326 \begin_layout LyX-Code
6329 #% Do not delete the line below; configure depends on this
6332 \begin_layout LyX-Code
6337 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6340 \begin_layout Standard
6341 This indicates that your text class uses the foo.sty package.
6342 Finally, it is also possible to declare classes for DocBook code.
6343 Typical declarations will look like
6346 \begin_layout LyX-Code
6349 #% Do not delete the line below; configure depends on this
6352 \begin_layout LyX-Code
6357 DeclareDocBookClass[article]{SGML (DocBook article)}
6360 \begin_layout Standard
6361 Note that these declarations can also be given an optional parameter declaring
6362 the name of the document class (but not a list).
6365 \begin_layout Standard
6366 When the text class has been modified to your taste, all you have to do
6367 is to copy it either in
6380 ools\SpecialChar \menuseparator
6388 Exit LyX and restart it; then your new text class should be available along
6392 \begin_layout Standard
6393 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6394 you made to your layout files.
6395 As a result, editing layout files could be very time consuming.
6396 Beginning with 1.6, however, you can force a reload of the layout currently
6397 in use by using the LyX function
6402 There is no default binding for this function---though, of course, you
6403 can bind it to a key yourself (see section
6404 \begin_inset CommandInset ref
6406 reference "sec:bindings"
6411 You should simply enter this command in the mini-buffer.
6416 : This is very much an `advanced feature'.
6421 recommended that you save your work before using this function.
6426 recommended that you not attempt to edit your layout while simultaneously
6427 working on a document that you care about.
6428 Use a test document.
6429 Syntax errors and the like in your layout file could cause peculiar behavior.
6430 In particular, such errors could cause LyX to regard the current layout
6431 as invalid and to attempt to switch to some other layout.
6432 The LyX team strives to keep LyX stable in such situations, but safe is
6436 \begin_layout Subsection
6440 \begin_layout Standard
6441 The first non-comment line must contain the file format number:
6444 \begin_layout Description
6455 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6456 don't have an explicit file format).
6457 The file format that is documented here is
6464 \begin_layout Subsection
6465 General text class parameters
6468 \begin_layout Standard
6469 These are the general parameters which describe the form of the entire document:
6472 \begin_layout Standard
6476 \begin_layout Standard
6488 \begin_layout Description
6502 ] Whether the class-default should have one or two columns.
6503 Can be changed in the
6508 ocument\SpecialChar \menuseparator
6516 This setting (same goes for
6520 , too) is important: if your text class has two columns by default but you
6521 forget to set it correctly, the
6529 be output when you select
6538 ocument\SpecialChar \menuseparator
6546 \begin_layout Description
6560 ] Whether the class-default should be printing on one or both sides of the
6562 Can be changed in the
6567 ocument\SpecialChar \menuseparator
6577 \begin_layout Description
6591 ] The class default pagestyle.
6592 Can be changed in the
6597 ocument\SpecialChar \menuseparator
6607 \begin_layout Description
6611 ClassOptions\SpecialChar \ldots{}
6615 This section describes various global options supported by the document
6617 See Section\InsetSpace ~
6619 \begin_inset CommandInset ref
6621 reference "sec:classoptions"
6628 \begin_layout Description
6646 ] Whether the class already provides the feature
6651 A feature is in general the name of a package (amsmath, makeidx, \SpecialChar \ldots{}
6653 macro (url, boldsymbol,\SpecialChar \ldots{}
6654 ); the complete list of supported features is unfortunat
6658 \begin_layout Description
6669 ] Whether the class requires the feature
6674 A feature is in general the name of a package (amsmath, makeidx, \SpecialChar \ldots{}
6676 macro (url, boldsymbol,\SpecialChar \ldots{}
6678 Multiple features must be separated by commas.
6679 Note that you can only request supported features; unfortunately, the complete
6680 list of supported features is not documented (however,
6685 elp\SpecialChar \menuseparator
6692 gives an overview of the supported packages).
6695 \begin_layout Description
6702 This is used to describe the default font of the document.
6703 See Section\InsetSpace ~
6705 \begin_inset CommandInset ref
6707 reference "sec:fonts"
6714 \begin_layout Description
6725 ] This is the style that will be assigned to new paragraphs, usually
6730 This will default to the first defined style if not given, but you are
6731 highly encouraged to use this directive.
6734 \begin_layout Description
6751 ] Indicates what kind of markup is used to define the title of a document.
6756 means that the macro with name
6760 will be inserted after the last layout which has
6761 \begin_inset Quotes eld
6769 \begin_inset Quotes erd
6777 corresponds to the case where the block of paragraphs which have
6778 \begin_inset Quotes eld
6786 \begin_inset Quotes erd
6789 should be enclosed into the
6798 \begin_layout Description
6809 ] The name of the command/environment mentionned above.
6812 \begin_layout Description
6816 Preamble\SpecialChar \ldots{}
6820 A set of macro definitions that will be output at the beginning of the
6822 Use this for global definitions.
6825 \begin_layout Description
6832 As its name implies, this command allows you to include another layout
6833 definition file within yours to avoid duplicating commands.
6834 Common examples are the standard layout files, for example,
6838 , which contains most of the basic layouts.
6841 \begin_layout Description
6845 Style\SpecialChar \ldots{}
6849 This sequence defines a new style.
6850 If the style already exists, it will redefine some of its parameters instead.
6851 See Section\InsetSpace ~
6853 \begin_inset CommandInset ref
6855 reference "sec:style"
6862 \begin_layout Description
6869 This command deletes an existing style.
6870 This is particularly useful when you want to suppress a style that has
6871 be defined in an input file.
6874 \begin_layout Description
6878 Float\SpecialChar \ldots{}
6882 This sequence defines a new float.
6883 See Section\InsetSpace ~
6885 \begin_inset CommandInset ref
6887 reference "sec:floats"
6894 \begin_layout Description
6901 This command deletes an existing float.
6902 This is particularly useful when you want to suppress a float that has
6903 be defined in an input file.
6906 \begin_layout Description
6910 InsetLayout\SpecialChar \ldots{}
6914 This section (re-)defines the layout of an inset.
6915 It can be applied to an existing inset of to a new, user-defined inset,
6916 e.g., a new character style.
6917 See Section\InsetSpace ~
6919 \begin_inset CommandInset ref
6921 reference "sec:charstyle"
6928 \begin_layout Description
6932 Counter\SpecialChar \ldots{}
6936 This sequence defines a new counter.
6937 See Section\InsetSpace ~
6939 \begin_inset CommandInset ref
6941 reference "sec:counter"
6948 \begin_layout Standard
6952 \begin_layout Standard
6964 \begin_layout Subsection
6972 \begin_layout Standard
6973 \begin_inset CommandInset label
6975 name "sec:classoptions"
6983 section can contain the following entries:
6986 \begin_layout Description
6997 ] The list of available font sizes for the document's main font, separated
6999 \begin_inset Quotes eld
7007 \begin_inset Quotes erd
7013 \begin_layout Description
7022 string="empty|plain|headings|fancy"
7024 ] The list of available page styles, separated by
7025 \begin_inset Quotes eld
7033 \begin_inset Quotes erd
7039 \begin_layout Description
7050 ] Some document class options, separated by a comma, that will be added
7051 to the optional part of the
7060 \begin_layout Subsection
7061 Specific Paragraph Layouts
7064 \begin_layout Standard
7065 \begin_inset CommandInset label
7071 A paragraph layout description looks like this
7075 \begin_layout Standard
7076 Note that this will either define a new layout or modify an existing one.
7084 \begin_layout LyX-Code
7091 \begin_layout LyX-Code
7095 \begin_layout LyX-Code
7099 \begin_layout Standard
7100 where the following commands are allowed:
7103 \begin_layout Standard
7107 \begin_layout Standard
7119 \begin_layout Description
7130 This is used to copy all the features of an existing layout into the current
7135 \begin_layout Description
7147 , Command, Environment, Item_Environment,
7153 ] How the layout should be translated into LaTeX.
7158 means nothing special.
7171 {\SpecialChar \ldots{}
7186 }\SpecialChar \ldots{}
7210 is generated for each paragraph of this environment.
7223 is passed as an argument to the environment.
7228 can be defined in the
7233 ayout\SpecialChar \menuseparator
7247 is perhaps a bit misleading, since these rules apply to SGML classes, too.
7248 Visit the SGML class files for specific examples.
7251 \begin_layout Description
7262 If 1, marks the layout as being part of a title block (see also the
7273 \begin_layout Description
7280 The name of the corresponding LaTeX stuff.
7281 Either the environment or command name.
7284 \begin_layout Description
7291 The optional parameter for the corresponding
7298 This parameter cannot be changed from within LyX.
7301 \begin_layout Description
7312 ] The number of optional arguments that can be used with this layout.
7313 This is useful for things like section headings, and only makes sense with
7317 \begin_layout Description
7329 , Manual, Dynamic, First_Dynamic, Right_Address_Box
7333 The kind of margin that the layout has on the left side.
7338 just means a fixed margin.
7343 means that the left margin depends on the string entered in the
7348 dit\SpecialChar \menuseparator
7353 aragraph\InsetSpace ~
7357 This is used to typeset nice lists without tabulators.
7362 means that the margin depends on the size of the label.
7363 This is used for automatic enumerated headlines.
7364 It is obvious that the headline
7365 \begin_inset Quotes eld
7368 5.4.3.2.1 Very long headline
7369 \begin_inset Quotes erd
7372 must have a wider left margin (as wide as
7373 \begin_inset Quotes eld
7377 \begin_inset Quotes erd
7380 plus the space) than
7381 \begin_inset Quotes eld
7384 3.2 Very long headline
7385 \begin_inset Quotes erd
7388 , even if other word processors are not able to do this.
7393 is similar, but only the very first row of the paragraph is dynamic, while
7394 the others are static; this is used, for example, for descriptions.
7399 means the margin is chosen in a way that the longest row of this paragraph
7400 fits to the right margin.
7401 This is used to typeset an address on the right edge of the page.
7404 \begin_layout Description
7421 ] Whether the following Paragraph is allowed to indent its very first row.
7426 means that it is not allowed to do so,
7430 means it could do so if it wants to.
7433 \begin_layout Description
7444 ] The indent of the very first line of a paragraph.
7445 The argument is passed as a string.
7450 means that the paragraph is indented with the width of
7459 You can get a negative width by prefixing the string with
7464 This way was chosen so that the look is the same with each used screen
7470 will be fixed for a certain layout.
7471 The exception is Standard layout, since the indentation of a Standard layout
7472 paragraph can be prohibited with
7477 Also, Standard layout paragraphs inside environments use the
7481 of the environment, not their native one.
7482 For example, Standard paragraphs inside an enumeration are not indented.
7485 \begin_layout Description
7496 ] LyX allows to choose either
7497 \begin_inset Quotes eld
7501 \begin_inset Quotes erd
7505 \begin_inset Quotes eld
7509 \begin_inset Quotes erd
7512 to typeset a document.
7514 \begin_inset Quotes eld
7518 \begin_inset Quotes erd
7521 is chosen, this value is completely ignored.
7523 \begin_inset Quotes eld
7527 \begin_inset Quotes erd
7530 is chosen, the parindent of a LaTeXtype
7531 \begin_inset Quotes eld
7535 \begin_inset Quotes erd
7538 layout is ignored and all paragraphs are additionally separated by this
7540 The vertical space is calculated with
7542 value*DefaultHeight()
7548 is the height of a row with the normal font.
7549 This way, the look stays the same with different screen fonts.
7552 \begin_layout Description
7563 ] The vertical space with which the very first of a chain of paragraphs
7564 with this layout is separated from the previous paragraph.
7565 If the previous paragraph has another layout, the separations are not simply
7566 added, but the maximum is taken.
7569 \begin_layout Description
7584 for the very last paragraph.
7587 \begin_layout Description
7598 ] The vertical space between two paragraphs of this layout.
7601 \begin_layout Description
7612 ] This is an extra space between the paragraphs of an environment layout.
7613 If you put other layouts into an environment, each is separated with the
7619 But the whole items of the environment are additionally separated with
7628 \begin_layout Description
7639 ] If you put layouts into environments, the leftmargins are not simply added,
7640 but added with a factor
7641 \begin_inset Formula $\frac{4}{depth+4}$
7645 Note that this parameter is also used when the border is defined as
7654 Then it is added to the manual or dynamic border.
7655 This string has the same meaning as for
7662 \begin_layout Description
7680 \begin_layout Description
7692 , Manual, Static, Top_Environment,
7694 Centered_Top_Environment, Sensitive,
7703 means the label is the very first word (up to the first real blank).
7708 means it is defined in the layout (see
7719 Centered_Top_Environment
7721 are special cases of
7726 The label will be printed above the paragraph, but only at the top of an
7727 environment or the top of a chain of paragraphs with this layout.
7728 Usage is for example the
7737 This is also the case for
7741 labels with latex type
7745 , in order to make layouts for theorems work correctly.
7750 is a special case for the caption-labels
7751 \begin_inset Quotes eld
7755 \begin_inset Quotes erd
7759 \begin_inset Quotes eld
7763 \begin_inset Quotes erd
7771 means the (hardcoded) label string depends on the kind of float.
7776 label type defines automatically numbered labels.
7779 \begin_layout Description
7792 The name of the counter for automatic numbering (see Section\InsetSpace ~
7794 \begin_inset CommandInset ref
7796 reference "sec:counter"
7801 This must be given if
7814 \begin_layout Description
7825 ] The horizontal space between the label and the text body.
7826 Only used for labels that are not above the text body.
7829 \begin_layout Description
7836 [float=0] The vertical space between the label and the text body.
7837 Only used for labels that are above the text body (
7843 Centered_Top_Environment
7848 \begin_layout Description
7859 ] The string used for a label with a
7868 this string is also used as a suggestion for the
7872 that can be set in the
7877 dit\SpecialChar \menuseparator
7882 aragraph\InsetSpace ~
7892 is set, this string can be contain the special formatting commands described
7893 in Section\InsetSpace ~
7895 \begin_inset CommandInset ref
7897 reference "sec:counter"
7902 For the sake of backwards compatibility, the string
7910 will be replaced by the expanded
7921 This feature is now obsolete and should be replaced by the mechanisms of
7922 Section\InsetSpace ~
7924 \begin_inset CommandInset ref
7926 reference "sec:counter"
7933 \begin_layout Description
7944 ] This is used inside the appendix instead of
7965 \begin_layout Description
7972 The level of the style in the table of contents.
7973 This is used for automatic numbering of section headings.
7976 \begin_layout Description
7988 , Box, Filled_Box, Static
7990 ] The type of label that stands at the end of the paragraph (or sequence
8013 \begin_inset Quotes eld
8017 \begin_inset Quotes erd
8029 ) is a white (resp.\InsetSpace ~
8030 black) square suitable for end of proof markers,
8034 is an explicit text string.
8037 \begin_layout Description
8048 ] The string used for a label with a
8060 \begin_layout Description
8072 , left, right, center
8074 ] Paragraph alignment.
8077 \begin_layout Description
8089 , left, right, center
8096 Some LaTeX styles prohibit certain alignments, since those wouldn't make
8098 For example a right-aligned or centered enumeration isn't possible.
8101 \begin_layout Description
8115 ] With this parameter the
8120 \begin_inset Quotes eld
8123 Vertical space above
8124 \begin_inset Quotes erd
8132 dit\SpecialChar \menuseparator
8137 aragraph\InsetSpace ~
8140 dialog can be set when initializing a paragraph with this layout
8144 \begin_layout Standard
8147 Note from Jean-Marc:
8149 I'm not sure that this setting has much use, and it should probably be
8150 removed in later versions.
8159 \begin_layout Description
8180 \begin_layout Description
8194 ] Whether fragile commands in this layout should be
8203 \begin_layout Description
8220 ] Whether newlines are translated into LaTeX newlines (
8229 The translation can be switched off to allow more comfortable LaTeX editing
8233 \begin_layout Description
8247 ] Whether the contents of this paragraph should be output in raw form, meaning
8248 without special translations that LaTeX would require.
8249 This somehow replaces the older
8256 \begin_layout Description
8270 ] Usually LyX doesn't allow you to insert more than one space between words,
8271 since a space is considered as the separation between two words, not a
8272 character or symbol of its own.
8273 This is a very fine thing but sometimes annoying, for example when typing
8274 program code or plain LaTeX code.
8280 Note that LyX will create protected blanks for the additional blanks when
8281 in another mode than LaTeX-mode.
8284 \begin_layout Description
8298 ] Usually LyX does not allow you to leave a paragraph empty, since it would
8299 lead to empty LaTeX output.
8300 There are some cases where this could be desirable however: in a letter
8301 template, the required fields can be provided as empty fields, so that
8302 people do not forget them; in some special classes, a layout can be used
8303 as some kind of break, which does not contain actual text.
8306 \begin_layout Description
8318 , onehalf, double, other
8324 ] This defines what the default spacing should be in the layout.
8337 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
8338 If you specify the argument
8342 , then you should also provide a numerical argument which will be the actual
8344 Note that, contrary to other parameters,
8348 implies the generation of specific LaTeX code, using the package
8355 \begin_layout Description
8362 The font used for both the text body
8367 See section\InsetSpace ~
8369 \begin_inset CommandInset ref
8371 reference "sec:fonts"
8376 Note that defining this font automatically defines the
8383 \begin_layout Description
8390 The font used for the text body .
8391 See section\InsetSpace ~
8393 \begin_inset CommandInset ref
8395 reference "sec:fonts"
8402 \begin_layout Description
8409 The font used for the label.
8410 See section\InsetSpace ~
8412 \begin_inset CommandInset ref
8414 reference "sec:fonts"
8421 \begin_layout Description
8425 Preamble\SpecialChar \ldots{}
8429 A set of macro definitions that will be output at the beginning of the
8430 LaTeX files when the layout is used.
8431 Use this to define the macros needed by this particular layout.
8434 \begin_layout Description
8445 ] Whether the layout requires the feature
8450 A feature is in general the name of a package (amsmath, makeidx, \SpecialChar \ldots{}
8452 macro (url, boldsymbol,\SpecialChar \ldots{}
8454 Multiple features must be separated by commas.
8455 Note that you can only request supported features; unfortunately, the complete
8456 list of supported features is not documented (however,
8461 elp\SpecialChar \menuseparator
8468 gives an overview of the supported packages).
8471 \begin_layout Description
8478 the name of a style which preamble should be output
8482 the one mentionned above.
8483 This allows to ensure some ordering of the preamble snippets when macros
8484 definitions depend on one another
8488 \begin_layout Standard
8489 Note that, besides that functionality, there is no way to ensure any ordering
8491 The ordering that you see in a given version of LyX may change without
8492 warning in later versions.
8500 \begin_layout Standard
8504 \begin_layout Standard
8516 \begin_layout Subsection
8520 \begin_layout Standard
8521 \begin_inset CommandInset label
8527 Since version 1.3.0 of LyX, it is necessary to define the floats (
8535 , \SpecialChar \ldots{}
8536 ) in the text class itself.
8537 If you are looking here to learn how to upgrade an existing text class,
8538 it will probably turn out that all you have to do is to add
8541 \begin_layout LyX-Code
8545 \begin_layout Standard
8546 at a reasonable location of the text class.
8550 \begin_layout Standard
8551 Don't forget to also have a look at counters in next section.
8556 If you want to implement a text class that proposes some other float types
8557 (like the AGU class bundled with LyX), the information below will hopefully
8561 \begin_layout Description
8573 \begin_inset Quotes erd
8577 \begin_inset Quotes erd
8581 \begin_inset Quotes eld
8585 \begin_inset Quotes erd
8588 of the new class of floats, like program or algorithm.
8589 After the appropriate
8610 \begin_layout Description
8622 \begin_inset Quotes erd
8626 \begin_inset Quotes erd
8629 ] The string that will be used in the menus and also for the caption.
8632 \begin_layout Description
8653 if the float is already defined by the documentclass.
8658 , the float will be defined using the LaTeX package
8665 \begin_layout Description
8677 \begin_inset Quotes erd
8681 \begin_inset Quotes erd
8684 ] This (optional) argument determines whether floats of this class will
8685 be numbered within some sectional unit of the document.
8686 For example, if within is equal to
8690 , the floats will be numbered within chapters.
8694 \begin_layout Description
8706 \begin_inset Quotes erd
8710 \begin_inset Quotes erd
8713 ] The style used when defining the float using
8722 \begin_layout Description
8734 \begin_inset Quotes erd
8738 \begin_inset Quotes erd
8741 ] The default placement for the given class of floats.
8742 They are like in standard LaTeX:
8758 for top, bottom, page, and here, respectively.
8762 \begin_layout Standard
8763 Note that the order of these letters in the string is irrelevant, like in
8769 On top of that there is a new type,
8773 , which does not really correspond to a float, since it means: put it
8774 \begin_inset Quotes eld
8778 \begin_inset Quotes erd
8782 Note, however that the
8786 specifier is special and, because of implementation details cannot be used
8787 in non-builtin float types.
8788 If you do not understand what this means, just use
8795 \begin_layout Description
8807 \begin_inset Quotes erd
8811 \begin_inset Quotes erd
8814 ] The file name extension of an auxiliary file for the list of figures (or
8816 LaTeX writes the captions to this file.
8819 \begin_layout Description
8831 \begin_inset Quotes erd
8835 \begin_inset Quotes erd
8838 ] The heading used for the list of floats.
8841 \begin_layout Standard
8842 Note that defining a float with type
8848 automatically defines the corresponding counter with name
8857 \begin_layout Subsection
8858 Inset layouts and Flex insets
8861 \begin_layout Standard
8862 \begin_inset CommandInset label
8864 name "sec:charstyle"
8868 You can define character styles since version 1.4.0 of LyX; since version
8869 1.6.0 these are called Flex insets.
8873 \begin_layout Standard
8874 Furthermore it is possible to define the general layout of many different
8876 Currently layout parameters can be defined for footnotes, marginal notes,
8877 note insets, ERT insets, branch insets, and Flex insets.
8878 The latter are definable from the user GUI and come in three different
8879 kinds: character style (
8887 ), and XML element (
8895 \begin_layout Standard
8900 definition starting line is of the form
8903 \begin_layout LyX-Code
8904 InsetLayout <Type> <Name>
8907 \begin_layout Standard
8911 \begin_layout Standard
8918 Foot, Margin, Note, Flex
8923 \begin_layout Standard
8928 can be empty (for foot- and marginal notes, branches and ERT) or one of
8946 Here, the second part of the name can be chosen freely (for CharStyle,
8947 Custom and Element), or from a predefined list (for Note).
8950 \begin_layout Standard
8955 section can contain the following entries:
8958 \begin_layout Description
8981 (indicating a dummy definition ending definitions of charstyles etc.).
8982 This entry is only meaningful for Flex (user definable) insets, the three
8983 types of which are CharStyle, Custom and Element.
8986 \begin_layout Description
9002 Minimalistic or Conglomerate
9005 , describing the rendering style used for the inset's frame and buttons.
9008 \begin_layout Description
9015 defines what will be displayed on the button or elsewhere as the inset
9017 Some inset types (ERT and Branch) modify this label on the fly.
9020 \begin_layout Description
9027 The font used for both the text body
9032 See section\InsetSpace ~
9034 \begin_inset CommandInset ref
9036 reference "sec:fonts"
9041 Note that defining this font automatically defines the
9048 \begin_layout Description
9055 The font used for the label.
9056 See section\InsetSpace ~
9058 \begin_inset CommandInset ref
9060 reference "sec:fonts"
9065 Note that this definition can never appear before
9069 , lest it be ineffective (see above)
9072 \begin_layout Description
9079 The name of the corresponding LaTeX stuff.
9080 Either the environment or command name.
9083 \begin_layout Description
9090 The optional parameter for the corresponding
9096 stuff, including possible bracket pairs like
9101 This parameter cannot be changed from within LyX.
9104 \begin_layout Description
9111 See section\InsetSpace ~
9113 \begin_inset CommandInset ref
9115 reference "sec:style"
9122 \begin_layout Description
9126 Preamble\SpecialChar \ldots{}
9130 See section\InsetSpace ~
9132 \begin_inset CommandInset ref
9134 reference "sec:style"
9141 \begin_layout Description
9152 ] See section\InsetSpace ~
9154 \begin_inset CommandInset ref
9156 reference "sec:style"
9163 \begin_layout Subsection
9167 \begin_layout Standard
9168 \begin_inset CommandInset label
9174 Since version 1.3.0 of LyX, it is necessary to define the counters (
9182 , \SpecialChar \ldots{}
9183 ) in the text class itself.
9184 If you are looking here to learn how to upgrade an existing text class,
9185 it will probably turn out that all you have to do is to add
9188 \begin_layout LyX-Code
9189 Input stdcounters.inc
9192 \begin_layout Standard
9193 The following parameters can be used:
9196 \begin_layout Description
9208 \begin_inset Quotes erd
9212 \begin_inset Quotes erd
9215 ] The name of the counter.
9218 \begin_layout Description
9230 \begin_inset Quotes erd
9234 \begin_inset Quotes erd
9237 ] If this is set to the name of another counter, the present counter will
9238 be reset everytime the other one is increased.
9250 \begin_layout Description
9254 LabelString [string=""]
9257 when this is defined, this string defines how the counter is displayed.
9258 Setting this value resets
9263 The following special constructs can be used in the string:
9267 \begin_layout Itemize
9274 will be replaced by the expansion of the
9287 If these are empty, a default value is constructed as follows: if the counter
9288 has a master counter
9300 is used; otherwise the string
9309 \begin_layout Itemize
9310 counter values can be expressed using LaTeX-like macros
9334 \begin_layout Description
9345 to arabic numerals, like 1, 2, 3\SpecialChar \ldots{}
9350 \begin_layout Standard
9360 Actually, the situation is a bit more complicated than that: any
9379 other than those descibed below will produce arabic numerals.
9380 It would not be surprising to see this change in the future.
9388 \begin_layout Description
9395 for lower-case letters: a, b, c, \SpecialChar \ldots{}
9399 \begin_layout Description
9406 for upper-case letters: A, B, C, \SpecialChar \ldots{}
9410 \begin_layout Description
9417 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
9421 \begin_layout Description
9428 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
9432 \begin_layout Description
9439 for hebrew numerals.
9444 \begin_layout Description
9448 LabelStringAppendix [string=""]
9455 , for use in appendix.
9458 \begin_layout Subsection
9462 \begin_layout Standard
9463 \begin_inset CommandInset label
9469 A font description looks like that:
9472 \begin_layout LyX-Code
9482 \begin_layout LyX-Code
9486 \begin_layout LyX-Code
9490 \begin_layout Standard
9491 and the following commands are available:
9494 \begin_layout Description
9511 \begin_layout Description
9528 \begin_layout Description
9540 , Italic, SmallCaps, Slanted
9545 \begin_layout Description
9561 , large, larger, largest, huge, giant
9566 \begin_layout Description
9578 , black, white, red, green, blue, cyan, magenta, yellow
9583 \begin_layout Subsection
9584 Upgrading old layout files
9587 \begin_layout Standard
9588 The file format of layout files changes from time to time, so old layout
9589 files need to be converted.
9590 This process has been automated in LyX 1.4.0: If LyX reads an old format
9591 layout file it will call the conversion tool
9593 $LyXDir/scripts/layout2layout.py
9595 and convert it to a temporary file in current format.
9596 The original file is left untouched, so that you can still use it with
9598 If you want to convert the layout file permanently, just call the converter
9602 \begin_layout LyX-Code
9603 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
9606 \begin_layout Standard
9618 \begin_layout Standard
9619 The automatic conversion does only handle syntax changes.
9620 It cannot handle the case where the contents of included files was changed.
9621 For example, layout files based on
9634 If you get error messages about undefined counters, try to convert your
9654 \begin_layout Section
9656 \begin_inset CommandInset label
9658 name "sec:templates"
9665 \begin_layout Standard
9666 Templates are created just like usual documents.
9667 The only difference is that usual documents contain all possible settings,
9668 including the fontscheme and the papersize.
9669 Usually a user doesn't want a template to overwrite his defaults in these
9671 For that reason, the designer of a template should remove the corresponding
9684 from the template LyX file.
9685 This can be done with any simple text-editor, for example
9697 \begin_layout Standard
9698 Put the edited template files you create in
9702 , copy the ones you use from the global template directory in
9706 to the same place, and redefine the template path in the
9711 dit\SpecialChar \menuseparator
9730 \begin_layout Standard
9731 Note that there is a template which has a particular meaning:
9736 This template is loaded everytime you create a new document with
9743 \SpecialChar \menuseparator
9751 in order to provide useful defaults.
9752 To create this template from inside LyX, all you have to do is to open
9753 a document with the correct settings, and use the
9759 e as Document Defaults
9764 \begin_layout Chapter
9765 Including External Material
9768 \begin_layout Section
9772 \begin_layout Standard
9773 \begin_inset Note Note
9776 \begin_layout Standard
9777 This section is completely outdated.
9782 One often requested feature from LyX users is to be able to interface LyX
9783 with Xfig, Dia, or other similar applications that specialize in producing
9784 a certain kind of diagram, figure, schematic or whatever material might
9785 be relevant to include in your document.
9786 Previously, it was only possible to include boring, static, fixed images
9787 in LyX documents with the graphics feature, but there are several limitations
9788 attached to this approach:
9791 \begin_layout Itemize
9792 If you want to change the figure, you have to invoke an external program
9796 \begin_layout Itemize
9797 LyX does not notice that the referenced files change, so the on-screen display
9798 can fast become obsolete, and this is aggravated by the lack of a means
9799 of updating the display
9802 \begin_layout Itemize
9803 The graphics stuff does not provide any mechanisms for coping with different
9804 exported formats such as DocBook, HTML or plain text
9807 \begin_layout Standard
9808 The external material facility attempts to solve all of these problems
9812 \begin_layout Standard
9813 Even if the graphics facility can't solve all problems, it is still valuable
9814 because it does provide in-line preview of the graphics, and supports advanced
9815 geometric transformations with a comfortable user interface.
9821 It does this by offering a general method to interface LyX to external
9823 Instead of introducing a long list of different constructs tailored for
9824 each specific application, we chose to sacrifice the in-line displaying
9825 of the included material in order to provide a general construct to cover
9826 a wide range of applications.
9827 The result is the external material construct.
9828 External material presents itself in the document simply as a button, but
9829 don't let this fool you.
9830 When you click on it, a dialog will appear that allows you to chose exactly
9831 what material to include, and in the following sections you will learn
9832 that this is indeed a powerful mechanism that can solve all of the above
9836 \begin_layout Section
9840 \begin_layout Standard
9841 The external material feature is based on the concept of a
9846 A template is a specification of how LyX should interface with a certain
9848 As bundled, LyX comes with predefined templates for Xfig figures, Dia diagrams,
9849 various raster format images, gnuplot, and more.
9850 You can check the actual list by using the menu
9852 Insert\SpecialChar \menuseparator
9853 File\SpecialChar \menuseparator
9862 Furthermore, it is possible to roll your own template to support a specific
9864 Later we'll describe in more detail what is involved, and hopefully you
9865 will submit all the templates you create so we can include them in a later
9869 \begin_layout Standard
9870 Another basic idea of the external material feature is to distinguish between
9871 the original file that serves as a base for final material and the produced
9872 file that is included in your exported or printed document.
9873 For example, consider the case of a figure produced with
9878 The Xfig application itself works on an original file with the
9883 Within XFig, you create and change your figure, and when you are done,
9889 When you want to include the figure in your document, you invoke
9893 in order to create a PostScript file that can readily be included in your
9899 file is the original file, and the PostScript file is the produced file.
9902 \begin_layout Standard
9903 This distinction is important in order to allow updating of the material
9904 while you are in the process of writing the document.
9905 Furthermore, it provides us with the flexibility that is needed to support
9906 multiple export formats.
9907 For instance, in the case of a plain text file, it is not exactly an award-winn
9908 ing idea to include the figure as raw PostScript.
9909 Instead, you'd either prefer to just include a reference to the figure,
9910 or try to invoke some graphics to Ascii converter to make the final result
9911 look similar to the real graphics.
9912 The external material management allows you to do this, because it is parameter
9913 ized on the different export formats that LyX supports.
9916 \begin_layout Standard
9917 Besides supporting the production of different products according to the
9918 exported format, it supports tight integration with editing and viewing
9920 In the case of an XFig figure, you are able to invoke
9924 on the original file with a single click from within the external material
9925 dialog in LyX, and also preview the produced PostScript file with
9930 No more fiddling around with the command line and/or file browsers to locate
9931 and manipulate the original or produced files.
9932 In this way, you are finally able to take full advantage of the many different
9933 applications that are relevant to use when you write your documents, and
9934 ultimately be more productive.
9937 \begin_layout Section
9938 External material dialog
9941 \begin_layout Standard
9946 dialog is described in the
9955 \begin_layout Section
9959 \begin_layout Standard
9960 In this section, we should include some examples of use of the external
9962 Those examples could include:
9965 \begin_layout Itemize
9966 External raster images
9969 \begin_layout Itemize
9970 External XFig figures
9973 \begin_layout Itemize
9977 \begin_layout Itemize
9981 \begin_layout Itemize
9982 The use of makefiles
9985 \begin_layout Itemize
9986 Recursive external LyX templates
9989 \begin_layout Section
9990 The external template configuration file
9993 \begin_layout Standard
9994 It is relatively easy to add custom external template definitions to LyX.
9995 However, be aware this doing this in an careless manner most probably
9999 introduce an easily exploitable security hole.
10000 So before you do this, please read the discussion about security which
10004 \begin_layout Standard
10005 Having said that, we encourage you to submit any interesting templates that
10010 \begin_layout Standard
10011 The external templates are defined in the
10013 lib/external_templates
10016 You can place your own version in
10018 .lyx/external_templates
10023 \begin_layout Standard
10024 A typical template looks like this:
10027 \begin_layout LyX-Code
10031 \begin_layout LyX-Code
10032 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
10035 \begin_layout LyX-Code
10039 \begin_layout LyX-Code
10043 \begin_layout LyX-Code
10047 \begin_layout LyX-Code
10051 \begin_layout LyX-Code
10055 \begin_layout LyX-Code
10056 AutomaticProduction true
10059 \begin_layout LyX-Code
10063 \begin_layout LyX-Code
10067 \begin_layout LyX-Code
10071 \begin_layout LyX-Code
10072 TransformCommand Rotate RotationLatexCommand
10075 \begin_layout LyX-Code
10076 TransformCommand Resize ResizeLatexCommand
10079 \begin_layout LyX-Code
10080 Product "$$RotateFront$$ResizeFront
10083 \begin_layout LyX-Code
10088 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
10091 \begin_layout LyX-Code
10092 $$ResizeBack$$RotateBack"
10095 \begin_layout LyX-Code
10099 \begin_layout LyX-Code
10100 UpdateResult "$$AbsPath$$Basename.pstex_t"
10103 \begin_layout LyX-Code
10104 Requirement "graphicx"
10107 \begin_layout LyX-Code
10108 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
10111 \begin_layout LyX-Code
10112 ReferencedFile latex "$$AbsPath$$Basename.eps"
10115 \begin_layout LyX-Code
10116 ReferencedFile dvi "$$AbsPath$$Basename.eps"
10119 \begin_layout LyX-Code
10123 \begin_layout LyX-Code
10127 \begin_layout LyX-Code
10128 TransformCommand Rotate RotationLatexCommand
10131 \begin_layout LyX-Code
10132 TransformCommand Resize ResizeLatexCommand
10135 \begin_layout LyX-Code
10136 Product "$$RotateFront$$ResizeFront
10139 \begin_layout LyX-Code
10144 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
10147 \begin_layout LyX-Code
10148 $$ResizeBack$$RotateBack"
10151 \begin_layout LyX-Code
10152 UpdateFormat pdftex
10155 \begin_layout LyX-Code
10156 UpdateResult "$$AbsPath$$Basename.pdftex_t"
10159 \begin_layout LyX-Code
10160 Requirement "graphicx"
10163 \begin_layout LyX-Code
10164 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
10167 \begin_layout LyX-Code
10168 ReferencedFile latex "$$AbsPath$$Basename.pdf"
10171 \begin_layout LyX-Code
10175 \begin_layout LyX-Code
10179 \begin_layout LyX-Code
10180 Product "$$Contents(
10182 "$$AbsPath$$Basename.asc
10187 \begin_layout LyX-Code
10188 UpdateFormat asciixfig
10191 \begin_layout LyX-Code
10192 UpdateResult "$$AbsPath$$Basename.asc"
10195 \begin_layout LyX-Code
10199 \begin_layout LyX-Code
10203 \begin_layout LyX-Code
10204 Product "<graphic fileref=
10206 "$$AbsOrRelPathMaster$$Basename.eps
10211 \begin_layout LyX-Code
10215 \begin_layout LyX-Code
10219 \begin_layout LyX-Code
10220 UpdateResult "$$AbsPath$$Basename.eps"
10223 \begin_layout LyX-Code
10224 ReferencedFile docbook "$$AbsPath$$Basename.eps"
10227 \begin_layout LyX-Code
10228 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
10231 \begin_layout LyX-Code
10235 \begin_layout LyX-Code
10236 Product "[XFig: $$FName]"
10239 \begin_layout LyX-Code
10243 \begin_layout LyX-Code
10247 \begin_layout Standard
10248 As you can see, the template is enclosed in
10252 \SpecialChar \ldots{}
10258 It contains a header specifying some general settings, and for each supported
10259 primary document file format a section
10263 \SpecialChar \ldots{}
10271 \begin_layout Subsection
10272 The template header
10275 \begin_layout Description
10279 Template\InsetSpace ~
10283 A unique name for the template.
10284 It must not contain substitution macros (see below).
10287 \begin_layout Description
10291 GuiName\InsetSpace ~
10295 The text that is displayed on the button.
10296 This command must occur exactly once.
10299 \begin_layout Description
10303 HelpText\InsetSpace ~
10304 <text>\InsetSpace ~
10308 The help text that is used in the External dialog.
10309 Provide enough information to explain to the user just what the template
10310 can provide him with.
10311 This command must occur exactly once.
10314 \begin_layout Description
10318 InputFormat\InsetSpace ~
10322 The file format of the original file.
10323 This must be the name of a format that is known to LyX (see the
10328 ools\SpecialChar \menuseparator
10333 references:Conversion
10340 if the template can handle original files of more than one format.
10341 LyX will attempt to interrogate the file itself in order to deduce its
10342 format in this case.
10343 This command must occur exactly once.
10346 \begin_layout Description
10350 FileFilter\InsetSpace ~
10354 A glob pattern that is used in the file dialog to filter out the desired
10356 If there is more than one possible file extension (e.g.\InsetSpace ~
10365 ), use something like
10370 This command must occur exactly once.
10373 \begin_layout Description
10377 AutomaticProduction\InsetSpace ~
10381 Wether the file represented by the template must be generated by LyX.
10382 This command must occur exactly once.
10385 \begin_layout Description
10389 Transform\InsetSpace ~
10390 Rotate|Resize|Clip|Extra
10393 This command specifies which transformations are supported by this template.
10394 It may occur zero or more times.
10395 This command enables the corresponding tabs in the external dialog.
10400 command must have either a corresponding
10413 Otherwise the transformation will not be supported by that format.
10416 \begin_layout Subsection
10420 \begin_layout Description
10424 Format\InsetSpace ~
10425 LaTeX|PDFLaTeX|PlainText|DocBook
10428 The primary document file format that this format definition is for.
10429 Not every template has a sensible representation in all document file formats.
10430 Please define nevertheless a
10434 section for all formats.
10435 Use a dummy text when no representation is available.
10436 Then you can at least see a reference to the external material in the exported
10440 \begin_layout Description
10444 TransformCommand\InsetSpace ~
10445 Rotate\InsetSpace ~
10446 RotationLatexCommand
10449 This command specifies that the built in LaTeX command should be used for
10451 This command may occur once or not at all.
10454 \begin_layout Description
10458 TransformCommand\InsetSpace ~
10459 Resize\InsetSpace ~
10463 This command specifies that the built in LaTeX command should be used for
10465 This command may occur once or not at all.
10468 \begin_layout Description
10472 TransformOption\InsetSpace ~
10473 Rotate\InsetSpace ~
10474 RotationLatexOption
10477 This command specifies that rotation is done via an optional argument.
10478 This command may occur once or not at all.
10481 \begin_layout Description
10485 TransformOption\InsetSpace ~
10486 Resize\InsetSpace ~
10490 This command specifies that resizing is done via an optional argument.
10491 This command may occur once or not at all.
10494 \begin_layout Description
10498 TransformOption\InsetSpace ~
10503 This command specifies that clipping is done via an optional argument.
10504 This command may occur once or not at all.
10507 \begin_layout Description
10511 TransformOption\InsetSpace ~
10516 This command specifies that an extra optional argument is used.
10517 This command may occur once or not at all.
10520 \begin_layout Description
10524 Product\InsetSpace ~
10528 The text that is inserted in the exported document.
10529 This is actually the most important command and can be quite complex.
10530 This command must occur exactly once.
10533 \begin_layout Description
10537 UpdateFormat\InsetSpace ~
10541 The file format of the converted file.
10542 This must be the name of a format that is known to LyX (see the
10547 ools\SpecialChar \menuseparator
10552 references:Conversion
10555 This command must occur exactly once.
10558 \begin_layout Description
10562 UpdateResult\InsetSpace ~
10566 The file name of the converted file.
10567 The file name must be absolute.
10568 This command must occur exactly once.
10571 \begin_layout Description
10575 ReferencedFile\InsetSpace ~
10576 <format>\InsetSpace ~
10580 This command denotes files that are created by the conversion process and
10581 are needed for a particular export format.
10582 If the filename is relative, it is interpreted relative to the master document.
10583 This command may be given zero or more times.
10586 \begin_layout Description
10590 Requirement\InsetSpace ~
10594 The name of a required LaTeX package.
10595 The package is included via
10601 in the LaTeX preamble.
10602 This command may occur zero or more times.
10605 \begin_layout Description
10609 Preamble\InsetSpace ~
10613 This command specifies a preamble snippet that will be included in the
10615 It has to be defined using
10619 \SpecialChar \ldots{}
10625 This command may occur zero or more times.
10628 \begin_layout Description
10632 Option\InsetSpace ~
10633 <name>\InsetSpace ~
10637 This command defines an additional macro
10641 for substitution in
10650 itself may contain substitution macros.
10651 The advantage over using
10659 is that the substituted value of
10663 is sanitized so that it is a valid optional argument in the document format.
10664 This command may occur zero or more times.
10667 \begin_layout Subsection
10668 Preamble definitions
10671 \begin_layout Standard
10672 The external template configuration file may contain additional preamble
10673 definitions enclosed by
10677 \SpecialChar \ldots{}
10683 They can be used by the templates in the
10690 \begin_layout Section
10691 The substitution mechanism
10694 \begin_layout Standard
10695 When the external material facility invokes an external program, it is done
10696 on the basis of a command defined in the template configuration file.
10697 These commands can contain various macros that are expanded before execution.
10698 Execution always take place in the directory of the containing document.
10701 \begin_layout Standard
10702 Also, whenever external material is to be displayed, the name will be produced
10703 by the substitution mechanism, and most other commands in the template
10704 definition support substitution as well.
10707 \begin_layout Standard
10708 The available macros are the following:
10711 \begin_layout Description
10712 $$FName The filename of the file specified in the external material dialog.
10713 This is either an absolute name, or it is relative to the LyX document.
10716 \begin_layout Description
10717 $$Basename The filename without path and without the extension.
10720 \begin_layout Description
10721 $$Extension The file extension (including the dot).
10724 \begin_layout Description
10725 $$FPath The path part of
10729 (absolute name or relative to the LyX document).
10732 \begin_layout Description
10733 $$AbsPath The absolute file path.
10736 \begin_layout Description
10737 $$RelPathMaster The file path, relative to the master LyX document.
10740 \begin_layout Description
10741 $$RelPathParent The file path, relative to the LyX document.
10744 \begin_layout Description
10745 $$AbsOrRelPathMaster The file path, absolute or relative to the master LyX
10749 \begin_layout Description
10750 $$AbsOrRelPathParent The file path, absolute or relative to the LyX document.
10753 \begin_layout Description
10754 $$Tempname A name and full path to a temporary file which will be automatically
10755 deleted whenever the containing document is closed, or the external material
10759 \begin_layout Description
10761 \begin_inset Quotes eld
10765 \begin_inset Quotes erd
10768 ) This macro will expand to the contents of the file with the name
10775 \begin_layout Description
10776 $$Sysdir This macro will expand to the absolute path of the system directory.
10777 This is typically used to point to the various helper scripts that are
10781 \begin_layout Standard
10782 All path macros contain a trailing directory separator, so you can construct
10784 the absolute filename with
10786 $$AbsPath$$Basename$$Extension
10791 \begin_layout Standard
10792 The macros above are substituted in all commands unless otherwise noted.
10797 supports additionally the following substitutions if they are enabled by
10809 \begin_layout Description
10810 $$ResizeFront The front part of the resize command.
10813 \begin_layout Description
10814 $$ResizeBack The back part of the resize command.
10817 \begin_layout Description
10818 $$RotateFront The front part of the rotation command.
10821 \begin_layout Description
10822 $$RotateBack The back part of the rotation command.
10825 \begin_layout Standard
10826 The value string of the
10830 command supports additionally the following substitutions if they are enabled
10842 \begin_layout Description
10843 $$Clip The clip option.
10846 \begin_layout Description
10847 $$Extra The extra option.
10850 \begin_layout Description
10851 $$Resize The resize option.
10854 \begin_layout Description
10855 $$Rotate The rotation option.
10858 \begin_layout Standard
10859 You may ask why there are so many path macros.
10860 There are mainly two reasons:
10863 \begin_layout Standard
10864 First, relative and absolute file names should remain relative or absolute,
10866 Users may have reasons to prefer either form.
10867 Relative names are useful for portable documents that should work on different
10868 machines, for example.
10869 Absolute names may be required by some programs.
10872 \begin_layout Standard
10873 Second, LaTeX treats relative file names differently than LyX and other
10874 programs in nested included files.
10875 For LyX, a relative file name is always relative to the document that contains
10877 For LaTeX, it is always relative to the master document.
10878 These two definitions are identical if you have only one document, but
10879 differ if you have a master document that includes part documents.
10880 That means that relative filenames must be transformed when presented to
10882 Fortunately LyX does this automatically for you if you choose the right
10886 \begin_layout Standard
10887 So which path macro should be used in new template definitions? The rule
10891 \begin_layout Itemize
10896 if an absolute path is required.
10899 \begin_layout Itemize
10902 $$AbsOrRelPathMaster
10904 if the substituted string is some kind of LaTeX input.
10907 \begin_layout Itemize
10910 $$AbsOrRelPathParent
10912 in order to preserve the user's choice.
10915 \begin_layout Standard
10916 There are special cases where this rule does not work and e.g.\InsetSpace ~
10918 are needed, but normally it will work just fine.
10919 One example for such a case is the command
10921 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
10923 in the XFig template above: We can't use the absolute name because the
10928 files needs the relative name in order to rewrite the file content.
10931 \begin_layout Section
10932 Security discussion
10935 \begin_layout Standard
10936 \begin_inset Note Note
10939 \begin_layout Standard
10940 This section is outdated
10945 The external material feature interfaces with a lot of external programs
10946 and does so automatically, so we have to consider the security implications
10948 In particular, since you have the option of including your own filenames
10949 and/or parameter strings and those are expanded into a command, it seems
10950 that it would be possible to create a malicious document which executes
10951 arbitrary commands when a user views or prints the document.
10952 This is something we definately want to avoid.
10955 \begin_layout Standard
10956 However, since the external program commands are specified in the template
10957 configuration file only, there are no security issues if LyX is properly
10958 configured with safe templates only.
10959 This is so because the external programs are invoked with the
10963 -system call rather than the
10967 system-call, so it's not possible to execute arbitrary commands from the
10968 filename or parameter section via the shell.
10971 \begin_layout Standard
10972 This also implies that you are restricted in what command strings you can
10973 use in the external material templates.
10974 In particular, pipes and redirection are not readily available.
10975 This has to be so if LyX should remain safe.
10976 If you want to use some of the shell features, you should write a safe
10977 script to do this in a controlled manner, and then invoke the script from
10978 the command string.
10983 directory of the LyX installation, you can find a safe wrapper script
10985 general_command_wrapper.py
10987 that supports redirection of input and output.
10988 That can serve as an example for how to write safe template scripts.
10989 For a more advanced example that uses
10993 and friends, take a look at the
11000 \begin_layout Standard
11001 It is possible to design a template that interacts directly with the shell,
11002 but since this would allow a malicious user to execute arbitrary commands
11003 by writing clever filenames and/or parameters, we generally recommend that
11004 you only use safe scripts that work with the
11008 system call in a controlled manner.
11009 Of course, for use in a controlled environment, it can be tempting to just
11010 fall back to use ordinary shell scripts.
11011 If you do so, be aware that you
11015 provide an easily exploitable security hole in your system.
11016 Of course it stands to reason that such unsafe templates will never be
11017 included in the standard LyX distribution, although we do encourage people
11018 to submit new templates in the open source tradition.
11019 But LyX as shipped from the official distribution channels will never have
11023 \begin_layout Standard
11024 Including external material provides a lot of power, and you have to be
11025 careful not to introduce security hazards with this power.
11026 A subtle error in a single line in an innocent looking script can open
11027 the door to huge security problems.
11028 So if you do not fully understand the issues, we recommend that you consult
11029 a knowledgable security professional or the LyX development team if you
11030 have any questions about whether a given template is safe or not.
11031 And do this before you use it in an uncontrolled environment.
11034 \begin_layout Chapter
11038 \begin_layout Section
11042 \begin_layout Standard
11043 The LyX server is a method implemented in LyX that will enable other programs
11044 to talk to LyX, invoke LyX commands, and retrieve information about the
11045 LyX internal state.
11046 This is only intended for advanced users, but they should find it useful.
11049 \begin_layout Section
11050 Starting the LyX Server
11053 \begin_layout Standard
11054 The LyX server works through the use of a pair of named pipes.
11055 These are usually located in your home directory and have the names
11056 \begin_inset Quotes eld
11064 \begin_inset Quotes erd
11068 \begin_inset Quotes eld
11076 \begin_inset Quotes erd
11080 External programs write into
11084 and read back data from
11089 The stem of the pipe names can be defined in the
11094 ools\SpecialChar \menuseparator
11101 dialog, for example
11103 "/home/myhome/.lyxpipe"
11108 \begin_layout Standard
11117 ' to create the pipes.
11118 The above setting also has the effect of activating the LyX server.
11119 If one of the pipes already exists, LyX will assume that another LyX process
11120 is already running and will not start the server.
11121 To have several LyX processes with servers at the same time, you have to
11122 change the configuration between the start of the programs.
11125 \begin_layout Standard
11126 If you are developing a client program, you might find it useful to enable
11127 debugging information from the LyX server.
11128 Do this by starting LyX as
11130 lyx -dbg lyxserver.
11133 \begin_layout Standard
11134 Warning: if LyX crashes, it may not manage to remove the pipes; in this
11135 case you must remove them manually.
11136 If LyX starts and the pipes exist already, it will not start any server.
11139 \begin_layout Standard
11140 Other than this, there are a few points to consider:
11143 \begin_layout Itemize
11144 Both server and clients must run on UNIX or OS/2 machines.
11145 Communications between LyX on UNIX and clients on OS/2 or vice versa is
11146 not possible right now.
11149 \begin_layout Itemize
11150 On OS/2, only one client can connect to LyXServer at a time.
11153 \begin_layout Itemize
11154 On OS/2, clients must open inpipe with
11161 \begin_layout Standard
11162 You can find a complete example client written in C in the source distribution
11165 development/server_monitor.c
11170 \begin_layout Section
11171 Normal communication
11174 \begin_layout Standard
11175 To issue a LyX call, the client writes a line of ASCII text into the input
11177 This line has the following format:
11180 \begin_layout Quote
11194 \begin_layout Standard
11199 is a name that the client can choose arbitrarily.
11200 Its only use is that LyX will echo it if it sends an answer - so a client
11201 can dispatch results from different requesters.
11204 \begin_layout Standard
11209 is the function you want LyX to perform.
11210 It is the same as the commands you'd use in the minibuffer.
11213 \begin_layout Standard
11218 is an optional argument which is meaningful only to some functions (for
11220 \begin_inset Quotes eld
11224 \begin_inset Quotes erd
11227 which will insert the argument as text at the cursor position.)
11230 \begin_layout Standard
11231 The answer from LyX will arrive in the output pipe and be of the form
11234 \begin_layout Quote
11248 \begin_layout Standard
11257 are just echoed from the command request, while
11261 is more or less useful information filled according to how the command
11262 execution worked out.
11263 Some commands will return information about the internal state of LyX,
11265 \begin_inset Quotes eld
11269 \begin_inset Quotes erd
11272 , while other will return an empty data-response.
11273 This means that the command execution went fine.
11276 \begin_layout Standard
11277 In case of errors, the response from LyX will have this form
11280 \begin_layout Quote
11294 \begin_layout Standard
11299 should contain an explanation of why the command failed.
11302 \begin_layout Standard
11306 \begin_layout LyX-Code
11307 echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
11310 \begin_layout LyX-Code
11311 echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
11313 read a <~/.lyxpipe.out
11318 \begin_layout Section
11322 \begin_layout Standard
11323 LyX can notify clients of events going on asynchronously.
11324 Currently it will only do this if the user binds a key sequence with the
11326 \begin_inset Quotes eld
11330 \begin_inset Quotes erd
11334 The format of the string LyX sends is as follows:
11337 \begin_layout Quote
11346 \begin_layout Standard
11351 is the printed representation of the key sequence that was actually typed
11355 \begin_layout Standard
11356 This mechanism can be used to extend LyX's command set and implement macros:
11357 bind some key sequence to
11358 \begin_inset Quotes eld
11362 \begin_inset Quotes erd
11365 , start a client that listens on the out pipe, dispatches the command according
11366 to the sequence and starts a function that may use LyX calls and LyX requests
11367 to issue a command or a series of commands to LyX.
11370 \begin_layout Section
11371 The simple LyX Server Protocol
11374 \begin_layout Standard
11375 LyX implements a simple protocol that can be used for session management.
11376 All messages are of the form
11379 \begin_layout Quote
11389 \begin_layout Standard
11395 \begin_inset Quotes eld
11399 \begin_inset Quotes erd
11403 \begin_inset Quotes eld
11407 \begin_inset Quotes erd
11412 \begin_inset Quotes eld
11416 \begin_inset Quotes erd
11419 is received from a client, LyX will report back to inform the client that
11420 it's listening to it's messages, while
11421 \begin_inset Quotes eld
11425 \begin_inset Quotes erd
11428 sent from LyX will inform clients that LyX is closing.
11431 \begin_layout Chapter
11436 \begin_layout Standard
11437 This appendix is a huge cross-reference to all the English language keybindings.
11438 Originally, we simply wanted to list all of the key bindings followed by
11439 the function it's bound to.
11440 That way, a user can look up a key to find out what it does.
11441 We then decided, what the hey, why not include the default toolbar and
11442 menu bindings, too.
11443 Please note this section is likely to be very out of date.
11446 \begin_layout Standard
11447 The form is really self-explanatory, but here are a few tips: all entries
11448 are arranged roughly alphabetically for a given modifier (
11457 For the general keyboard layout, simpler prefixes precede the more complex
11467 All entries were gleaned from the default user interface and binding files
11468 located in the directories
11470 \SpecialChar \ldots{}
11475 \SpecialChar \ldots{}
11478 ; they should be treated as the final word on the bindings.
11481 \begin_layout Standard
11482 As a final note, be aware that some window managers (such as FVWM) take
11483 control of some of the function keys or motion keys.
11488 is listed here as generating
11492 , but FVWM grabs it and uses it to change virtual desktops instead.
11493 Very annoying unless you instruct your window manager to stop intercepting
11497 \begin_layout Section
11501 \begin_layout LyX-Code
11505 \begin_layout LyX-Code
11509 \begin_layout LyX-Code
11513 \begin_layout LyX-Code
11514 Icon "buffer-write"
11517 \begin_layout LyX-Code
11518 Icon "buffer-print"
11521 \begin_layout LyX-Code
11525 \begin_layout LyX-Code
11529 \begin_layout LyX-Code
11533 \begin_layout LyX-Code
11537 \begin_layout LyX-Code
11541 \begin_layout LyX-Code
11545 \begin_layout LyX-Code
11549 \begin_layout LyX-Code
11553 \begin_layout LyX-Code
11557 \begin_layout LyX-Code
11561 \begin_layout LyX-Code
11565 \begin_layout LyX-Code
11569 \begin_layout LyX-Code
11570 Icon "footnote-insert"
11573 \begin_layout LyX-Code
11574 Icon "marginpar-insert"
11577 \begin_layout LyX-Code
11581 \begin_layout LyX-Code
11585 \begin_layout LyX-Code
11586 Icon "figure-insert"
11589 \begin_layout LyX-Code
11590 Icon "dialog-tabular-insert"
11593 \begin_layout LyX-Code
11597 \begin_layout Section
11601 \begin_layout Standard
11602 Note that the following bindings are for LyX with English menus.
11603 The second character of the binding depends on the menu language.
11605 \begin_inset Quotes eld
11613 \begin_inset Quotes erd
11616 is with German menus
11617 \begin_inset Quotes eld
11625 \begin_inset Quotes erd
11629 To find out the shortcuts of your language press the Meta (Alt)-key and
11630 press then the keys of the underlined characters of the menu names.
11633 \begin_layout Subsection
11638 \labelwidthstring 00.00.0000
11650 \labelwidthstring 00.00.0000
11662 \labelwidthstring 00.00.0000
11674 \labelwidthstring 00.00.0000
11688 \labelwidthstring 00.00.0000
11700 \labelwidthstring 00.00.0000
11714 \labelwidthstring 00.00.0000
11726 \labelwidthstring 00.00.0000
11738 \labelwidthstring 00.00.0000
11750 \labelwidthstring 00.00.0000
11762 \labelwidthstring 00.00.0000
11770 buffer-new-template
11774 \labelwidthstring 00.00.0000
11789 \labelwidthstring 00.00.0000
11800 \labelwidthstring 00.00.0000
11811 \labelwidthstring 00.00.0000
11822 \labelwidthstring 00.00.0000
11833 \labelwidthstring 00.00.0000
11844 \labelwidthstring 00.00.0000
11856 \labelwidthstring 00.00.0000
11867 \begin_layout Subsection
11872 \labelwidthstring 00.00.0000
11884 \labelwidthstring 00.00.0000
11896 \labelwidthstring 00.00.0000
11908 \labelwidthstring 00.00.0000
11920 \labelwidthstring 00.00.0000
11932 \labelwidthstring 00.00.0000
11944 \labelwidthstring 00.00.0000
11959 \labelwidthstring 00.00.0000
11966 tabular-feature append-row
11970 \labelwidthstring 00.00.0000
11977 tabular-feature toggle-line-bottom
11981 \labelwidthstring 00.00.0000
11988 tabular-feature align-center
11992 \labelwidthstring 00.00.0000
11999 tabular-feature delete-column
12003 \labelwidthstring 00.00.0000
12010 tabular-feature align-left
12014 \labelwidthstring 00.00.0000
12021 tabular-feature align-right
12025 \labelwidthstring 00.00.0000
12032 tabular-feature toggle-line-left
12036 \labelwidthstring 00.00.0000
12043 tabular-feature multicolumn
12047 \labelwidthstring 00.00.0000
12054 tabular-feature valign-center
12058 \labelwidthstring 00.00.0000
12065 tabular-feature valign-top
12069 \labelwidthstring 00.00.0000
12076 tabular-feature toggle-line-right
12080 \labelwidthstring 00.00.0000
12087 tabular-feature toggle-line-top
12091 \labelwidthstring 00.00.0000
12098 tabular-feature append-column
12102 \labelwidthstring 00.00.0000
12109 tabular-feature valign-bottom
12113 \labelwidthstring 00.00.0000
12120 tabular-feature delete-row
12125 \labelwidthstring 00.00.0000
12138 \labelwidthstring 00.00.0000
12145 floats-operate openfoot
12149 \labelwidthstring 00.00.0000
12156 floats-operate closefoot
12160 \labelwidthstring 00.00.0000
12167 floats-operate openfig
12171 \labelwidthstring 00.00.0000
12182 \labelwidthstring 00.00.0000
12193 \labelwidthstring 00.00.0000
12200 floats-operate closefig
12205 \labelwidthstring 00.00.0000
12217 \labelwidthstring 00.00.0000
12231 \labelwidthstring 00.00.0000
12243 \labelwidthstring 00.00.0000
12255 \labelwidthstring 00.00.0000
12269 \labelwidthstring 00.00.0000
12281 \labelwidthstring 00.00.0000
12296 \labelwidthstring 00.00.0000
12303 primary-selection-paste
12307 \labelwidthstring 00.00.0000
12314 primary-selection-paste paragraph
12318 \begin_layout Subsection
12323 \labelwidthstring 00.00.0000
12338 \labelwidthstring 00.00.0000
12345 buffer-float-insert algorithm
12349 \labelwidthstring 00.00.0000
12356 buffer-float-insert wide-tab
12360 \labelwidthstring 00.00.0000
12367 buffer-float-insert figure
12371 \labelwidthstring 00.00.0000
12378 buffer-float-insert table
12382 \labelwidthstring 00.00.0000
12389 buffer-float-insert wide-fig
12394 \labelwidthstring 00.00.0000
12402 dialog-tabular-insert
12406 \labelwidthstring 00.00.0000
12418 \labelwidthstring 00.00.0000
12430 \labelwidthstring 00.00.0000
12438 buffer-child-insert
12442 \labelwidthstring 00.00.0000
12454 \labelwidthstring 00.00.0000
12466 \labelwidthstring 00.00.0000
12478 \labelwidthstring 00.00.0000
12490 \labelwidthstring 00.00.0000
12502 \labelwidthstring 00.00.0000
12514 \labelwidthstring 00.00.0000
12526 \labelwidthstring 00.00.0000
12541 \labelwidthstring 00.00.0000
12552 \labelwidthstring 00.00.0000
12563 \labelwidthstring 00.00.0000
12574 \labelwidthstring 00.00.0000
12585 \labelwidthstring 00.00.0000
12596 \labelwidthstring 00.00.0000
12608 \labelwidthstring 00.00.0000
12620 \labelwidthstring 00.00.0000
12635 \labelwidthstring 00.00.0000
12642 protected-space-insert
12646 \labelwidthstring 00.00.0000
12653 end-of-sentence-period-insert
12657 \labelwidthstring 00.00.0000
12668 \labelwidthstring 00.00.0000
12679 \labelwidthstring 00.00.0000
12690 \labelwidthstring 00.00.0000
12697 menu-separator-insert
12701 \labelwidthstring 00.00.0000
12708 hyphenation-point-insert
12712 \labelwidthstring 00.00.0000
12723 \labelwidthstring 00.00.0000
12730 command-sequence math-insert ^;math-mode;
12734 \labelwidthstring 00.00.0000
12741 command-sequence math-insert _;math-mode;
12746 \labelwidthstring 00.00.0000
12761 \labelwidthstring 00.00.0000
12768 file-insert-plaintext lines
12772 \labelwidthstring 00.00.0000
12779 file-insert-plaintext paragraphs
12783 \labelwidthstring 00.00.0000
12795 \labelwidthstring 00.00.0000
12807 \labelwidthstring 00.00.0000
12819 \labelwidthstring 00.00.0000
12830 \begin_layout Subsection
12835 \labelwidthstring 00.00.0000
12847 \labelwidthstring 00.00.0000
12859 \labelwidthstring 00.00.0000
12871 \labelwidthstring 00.00.0000
12883 \labelwidthstring 00.00.0000
12895 \labelwidthstring 00.00.0000
12907 \labelwidthstring 00.00.0000
12919 \labelwidthstring 00.00.0000
12931 \labelwidthstring 00.00.0000
12939 layout-save-default
12943 \labelwidthstring 00.00.0000
12955 \labelwidthstring 00.00.0000
12967 \labelwidthstring 00.00.0000
12978 \begin_layout Subsubsection
12981 Layout\SpecialChar \menuseparator
12988 \labelwidthstring 00.00.0000
13000 \labelwidthstring 00.00.0000
13012 \labelwidthstring 00.00.0000
13024 \labelwidthstring 00.00.0000
13036 \labelwidthstring 00.00.0000
13048 \labelwidthstring 00.00.0000
13060 \labelwidthstring 00.00.0000
13072 \labelwidthstring 00.00.0000
13084 \labelwidthstring 00.00.0000
13096 \labelwidthstring 00.00.0000
13108 \labelwidthstring 00.00.0000
13120 \labelwidthstring 00.00.0000
13132 \labelwidthstring 00.00.0000
13144 \labelwidthstring 00.00.0000
13156 \labelwidthstring 00.00.0000
13168 \labelwidthstring 00.00.0000
13180 \labelwidthstring 00.00.0000
13192 \labelwidthstring 00.00.0000
13204 \labelwidthstring 00.00.0000
13216 \labelwidthstring 00.00.0000
13228 \labelwidthstring 00.00.0000
13240 \labelwidthstring 00.00.0000
13252 \labelwidthstring 00.00.0000
13264 \labelwidthstring 00.00.0000
13276 \labelwidthstring 00.00.0000
13288 \labelwidthstring 00.00.0000
13300 \labelwidthstring 00.00.0000
13312 \labelwidthstring 00.00.0000
13324 \labelwidthstring 00.00.0000
13336 \labelwidthstring 00.00.0000
13348 \labelwidthstring 00.00.0000
13360 \labelwidthstring 00.00.0000
13371 \begin_layout Subsection
13375 \begin_layout Subsection
13379 \begin_layout Subsection
13383 \begin_layout Subsection
13388 \labelwidthstring 00.00.0000
13400 \labelwidthstring 00.00.0000
13412 \labelwidthstring 00.00.0000
13424 \labelwidthstring 00.00.0000
13436 \labelwidthstring 00.00.0000
13448 \labelwidthstring 00.00.0000
13456 layout ShortFoilhead
13460 \labelwidthstring 00.00.0000
13472 \labelwidthstring 00.00.0000
13484 \labelwidthstring 00.00.0000
13496 \labelwidthstring 00.00.0000
13508 \labelwidthstring 00.00.0000
13516 layout ShortRotatefoilhead
13520 \labelwidthstring 00.00.0000
13532 \labelwidthstring 00.00.0000
13544 \labelwidthstring 00.00.0000
13556 \labelwidthstring 00.00.0000
13564 drop-layouts-choice
13568 \labelwidthstring 00.00.0000
13583 \labelwidthstring 00.00.0000
13598 \labelwidthstring 00.00.0000
13610 \labelwidthstring 00.00.0000
13622 \labelwidthstring 00.00.0000
13630 layout Subsubsection
13634 \labelwidthstring 00.00.0000
13646 \labelwidthstring 00.00.0000
13654 layout Subparagraph
13658 \labelwidthstring 00.00.0000
13662 asterisk\InsetSpace ~
13671 \labelwidthstring 00.00.0000
13675 asterisk\InsetSpace ~
13684 \labelwidthstring 00.00.0000
13688 asterisk\InsetSpace ~
13697 \labelwidthstring 00.00.0000
13701 asterisk\InsetSpace ~
13710 \labelwidthstring 00.00.0000
13714 asterisk\InsetSpace ~
13719 layout Subsubsection*
13723 \labelwidthstring 00.00.0000
13727 asterisk\InsetSpace ~
13736 \labelwidthstring 00.00.0000
13740 asterisk\InsetSpace ~
13745 layout Subparagraph*
13749 \labelwidthstring 00.00.0000
13761 \labelwidthstring 00.00.0000
13769 layout Bibliography
13773 \labelwidthstring 00.00.0000
13785 \labelwidthstring 00.00.0000
13797 \labelwidthstring 00.00.0000
13809 \labelwidthstring 00.00.0000
13821 \labelwidthstring 00.00.0000
13833 \labelwidthstring 00.00.0000
13841 layout Rotatefoilhead
13845 \labelwidthstring 00.00.0000
13853 layout RightAddress
13857 \labelwidthstring 00.00.0000
13869 \labelwidthstring 00.00.0000
13881 \labelwidthstring 00.00.0000
13893 \labelwidthstring 00.00.0000
13904 \begin_layout Standard
13905 These ones are kept for backwards compatibility, but only make sense on
13910 \labelwidthstring 00.00.0000
13922 \labelwidthstring 00.00.0000
13930 layout Subsubsection*
13934 \labelwidthstring 00.00.0000
13945 \begin_layout Section
13949 \begin_layout Subsection
13956 \labelwidthstring 00.00.0000
13967 \labelwidthstring 00.00.0000
13978 \labelwidthstring 00.00.0000
13989 \labelwidthstring 00.00.0000
14000 \labelwidthstring 00.00.0000
14011 \labelwidthstring 00.00.0000
14022 \labelwidthstring 00.00.0000
14029 hyphenation-point-insert
14033 \labelwidthstring 00.00.0000
14044 \labelwidthstring 00.00.0000
14051 line-delete-forward
14055 \labelwidthstring 00.00.0000
14066 \labelwidthstring 00.00.0000
14077 \labelwidthstring 00.00.0000
14088 \labelwidthstring 00.00.0000
14099 \labelwidthstring 00.00.0000
14110 \labelwidthstring 00.00.0000
14121 \labelwidthstring 00.00.0000
14132 \labelwidthstring 00.00.0000
14143 \labelwidthstring 00.00.0000
14154 \labelwidthstring 00.00.0000
14165 \labelwidthstring 00.00.0000
14176 \labelwidthstring 00.00.0000
14187 \labelwidthstring 00.00.0000
14199 \labelwidthstring 00.00.0000
14211 \labelwidthstring 00.00.0000
14223 \labelwidthstring 00.00.0000
14235 \labelwidthstring 00.00.0000
14248 \labelwidthstring 00.00.0000
14260 \labelwidthstring 00.00.0000
14272 \labelwidthstring 00.00.0000
14284 \labelwidthstring 00.00.0000
14296 \labelwidthstring 00.00.0000
14309 \labelwidthstring 00.00.0000
14321 \labelwidthstring 00.00.0000
14333 \labelwidthstring 00.00.0000
14346 \labelwidthstring 00.00.0000
14359 \labelwidthstring 00.00.0000
14372 \labelwidthstring 00.00.0000
14385 \labelwidthstring 00.00.0000
14398 \labelwidthstring 00.00.0000
14411 \labelwidthstring 00.00.0000
14423 \labelwidthstring 00.00.0000
14435 \labelwidthstring 00.00.0000
14447 \labelwidthstring 00.00.0000
14455 menu-open Documents
14459 \labelwidthstring 00.00.0000
14471 \labelwidthstring 00.00.0000
14483 \labelwidthstring 00.00.0000
14495 \labelwidthstring 00.00.0000
14507 \labelwidthstring 00.00.0000
14519 \labelwidthstring 00.00.0000
14527 buffer-toggle-read-only
14531 \labelwidthstring 00.00.0000
14543 \labelwidthstring 00.00.0000
14555 \labelwidthstring 00.00.0000
14567 \labelwidthstring 00.00.0000
14578 \labelwidthstring 00.00.0000
14589 \labelwidthstring 00.00.0000
14600 \labelwidthstring 00.00.0000
14611 \labelwidthstring 00.00.0000
14622 \labelwidthstring 00.00.0000
14633 \labelwidthstring 00.00.0000
14644 \labelwidthstring 00.00.0000
14655 \labelwidthstring 00.00.0000
14666 \labelwidthstring 00.00.0000
14677 \labelwidthstring 00.00.0000
14688 \labelwidthstring 00.00.0000
14699 \labelwidthstring 00.00.0000
14710 \labelwidthstring 00.00.0000
14721 \labelwidthstring 00.00.0000
14728 word-delete-forward
14732 \labelwidthstring 00.00.0000
14739 word-delete-backward
14743 \labelwidthstring 00.00.0000
14754 \labelwidthstring 00.00.0000
14761 end-of-sentence-period-insert
14765 \labelwidthstring 00.00.0000
14772 protected-space-insert
14776 \labelwidthstring 00.00.0000
14787 \labelwidthstring 00.00.0000
14798 \labelwidthstring 00.00.0000
14809 \labelwidthstring 00.00.0000
14820 \labelwidthstring 00.00.0000
14831 \labelwidthstring 00.00.0000
14842 \labelwidthstring 00.00.0000
14849 buffer-begin-select
14853 \labelwidthstring 00.00.0000
14864 \labelwidthstring 00.00.0000
14871 paragraph-up-select
14875 \labelwidthstring 00.00.0000
14882 paragraph-down-select
14886 \labelwidthstring 00.00.0000
14893 word-backward-select
14897 \labelwidthstring 00.00.0000
14904 word-forward-select
14908 \labelwidthstring 00.00.0000
14919 \labelwidthstring 00.00.0000
14926 word-delete-forward
14930 \labelwidthstring 00.00.0000
14941 \labelwidthstring 00.00.0000
14952 \labelwidthstring 00.00.0000
14963 \labelwidthstring 00.00.0000
14974 \labelwidthstring 00.00.0000
14981 break-paragraph-keep-layout
14985 \labelwidthstring 00.00.0000
14995 \begin_layout Subsection
15002 \labelwidthstring 00.00.0000
15013 \labelwidthstring 00.00.0000
15024 \labelwidthstring 00.00.0000
15035 \labelwidthstring 00.00.0000
15046 \labelwidthstring 00.00.0000
15057 \labelwidthstring 00.00.0000
15068 \labelwidthstring 00.00.0000
15079 \labelwidthstring 00.00.0000
15090 \labelwidthstring 00.00.0000
15101 \labelwidthstring 00.00.0000
15112 \labelwidthstring 00.00.0000
15123 \labelwidthstring 00.00.0000
15134 \labelwidthstring 00.00.0000
15145 \labelwidthstring 00.00.0000
15156 \labelwidthstring 00.00.0000
15167 \labelwidthstring 00.00.0000
15178 \labelwidthstring 00.00.0000
15189 \labelwidthstring 00.00.0000
15200 \labelwidthstring 00.00.0000
15211 \labelwidthstring 00.00.0000
15222 \labelwidthstring 00.00.0000
15233 \labelwidthstring 00.00.0000
15244 \labelwidthstring 00.00.0000
15251 protected-space-insert
15255 \labelwidthstring 00.00.0000
15266 \labelwidthstring 00.00.0000
15277 \labelwidthstring 00.00.0000
15288 \labelwidthstring 00.00.0000
15295 buffer-new-template
15299 \labelwidthstring 00.00.0000
15310 \labelwidthstring 00.00.0000
15321 \labelwidthstring 00.00.0000
15332 \labelwidthstring 00.00.0000
15343 \labelwidthstring 00.00.0000
15354 \labelwidthstring 00.00.0000
15365 \labelwidthstring 00.00.0000
15376 \labelwidthstring 00.00.0000
15383 end-of-sentence-period-insert
15387 \labelwidthstring 00.00.0000
15398 \labelwidthstring 00.00.0000
15409 \labelwidthstring 00.00.0000
15416 hyphenation-point-insert
15420 \labelwidthstring 00.00.0000
15431 \labelwidthstring 00.00.0000
15438 protected-space-insert
15442 \labelwidthstring 00.00.0000
15453 \labelwidthstring 00.00.0000
15464 \labelwidthstring 00.00.0000
15475 \labelwidthstring 00.00.0000
15486 \labelwidthstring 00.00.0000
15497 \labelwidthstring 00.00.0000
15508 \labelwidthstring 00.00.0000
15519 \labelwidthstring 00.00.0000
15530 \labelwidthstring 00.00.0000
15541 \labelwidthstring 00.00.0000
15552 \labelwidthstring 00.00.0000
15563 \labelwidthstring 00.00.0000
15574 \labelwidthstring 00.00.0000
15585 \labelwidthstring 00.00.0000
15596 \labelwidthstring 00.00.0000
15607 \labelwidthstring 00.00.0000
15614 word-delete-forward
15618 \labelwidthstring 00.00.0000
15625 word-delete-backward
15629 \labelwidthstring 00.00.0000
15640 \labelwidthstring 00.00.0000
15651 \labelwidthstring 00.00.0000
15662 \labelwidthstring 00.00.0000
15673 \labelwidthstring 00.00.0000
15680 paragraph-down-select
15684 \labelwidthstring 00.00.0000
15695 \labelwidthstring 00.00.0000
15702 buffer-begin-select
15706 \labelwidthstring 00.00.0000
15713 word-backward-select
15717 \labelwidthstring 00.00.0000
15724 word-forward-select
15728 \labelwidthstring 00.00.0000
15735 paragraph-up-select
15739 \labelwidthstring 00.00.0000
15750 \labelwidthstring 00.00.0000
15757 break-paragraph-keep-layout
15761 \labelwidthstring 00.00.0000
15772 \labelwidthstring 00.00.0000
15783 \labelwidthstring 00.00.0000
15794 \labelwidthstring 00.00.0000
15805 \labelwidthstring 00.00.0000
15816 \labelwidthstring 00.00.0000
15827 \labelwidthstring 00.00.0000
15838 \labelwidthstring 00.00.0000
15849 \labelwidthstring 00.00.0000
15860 \labelwidthstring 00.00.0000
15871 \labelwidthstring 00.00.0000
15881 \begin_layout Subsection
15887 \begin_layout Standard
15888 These are LyX keyboard definitions for mathematics, similar to those of
15892 \begin_layout Standard
15893 The bindings file and the present documentation were prepared by Serge Winitzki
15894 with assistance from Jean-Marc Lasgouttes.
15895 Version 1.3, for LyX 1.2.x and 1.3.x.
15898 \begin_layout Standard
15899 These definitions make it a lot easier to type equations without using the
15900 mouse, especially for people familiar with Scientific Word.
15901 The standard LyX bindings such as
15912 \begin_layout Standard
15913 Tip: to find the "LyX bind name" for a key, look at the status bar after
15914 typing some non-existent key combination.
15916 to find how "Ctrl-&" is referenced, press Ctrl-S and then Ctrl-&: the status
15917 bar shows "C-s S-C-ampersand." (This does not work in LyX 1.3.0!)
15921 \labelwidthstring 00.00.0000
15930 -- Copy, cut, paste is as in Sciword,
15946 \labelwidthstring 00.00.0000
15955 -- Display equation toggle: type
15959 to insert a displayed formula (
15964 \begin_inset Quotes eld
15968 \begin_inset Quotes erd
15976 in a displayed formula to convert it back to an inline formula.
15980 \labelwidthstring 00.00.0000
15995 to insert a fraction (
16000 \begin_inset Quotes eld
16004 \begin_inset Quotes erd
16008 You can also select an expression and type
16012 to convert it to the numerator of a fraction.
16021 end of the denominator will delete the numerator and convert the denominator
16026 \labelwidthstring 00.00.0000
16038 \begin_inset Formula $\int$
16046 \begin_inset Quotes eld
16050 \begin_inset Quotes erd
16057 \labelwidthstring 00.00.0000
16064 line-delete-forward
16066 -- Emacs-like binding: delete forward of cursor to end of line.
16070 \labelwidthstring 00.00.0000
16079 -- A text/math toggle (
16084 \begin_inset Quotes eld
16088 \begin_inset Quotes erd
16091 ): switches to math in text mode, and also inserts roman text in math mode.
16101 \begin_inset Quotes eld
16105 \begin_inset Quotes erd
16112 \labelwidthstring 00.00.0000
16121 -- Add/remove numbering in a single equation.
16125 \labelwidthstring 00.00.0000
16134 -- Add/remove numbering at a line in equation arrays.
16137 \begin_layout Standard
16138 The above commands are toggles that control the numbering of equations (
16143 \begin_inset Quotes eld
16147 \begin_inset Quotes erd
16151 Note: when deleting a number in a labeled eqnarray, the label is not really
16152 removed (the TeX code becomes
16153 \begin_inset Quotes eld
16165 \begin_inset Quotes erd
16168 ) and this generates a (harmless) LaTeX warning.
16172 \labelwidthstring 00.00.0000
16181 -- Open a new document.
16186 \labelwidthstring 00.00.0000
16195 -- Insert a quote character " (
16200 \begin_inset Quotes eld
16204 \begin_inset Quotes erd
16209 \begin_inset Quotes eld
16213 \begin_inset Quotes erd
16216 double quote character that you get by default.
16220 \labelwidthstring 00.00.0000
16231 -- Square root sign
16232 \begin_inset Formula $\sqrt{x}$
16240 \begin_inset Quotes eld
16244 \begin_inset Quotes erd
16251 \labelwidthstring 00.00.0000
16263 \begin_inset Formula $\sqrt[n]{x}$
16270 \labelwidthstring 00.00.0000
16279 -- Another binding for a switch between the text and the math mode (
16284 \begin_inset Quotes eld
16288 \begin_inset Quotes erd
16292 Note that the roman text inserted in math mode is special.
16296 \labelwidthstring 00.00.0000
16309 the selected text (text mode only, use things like
16325 \labelwidthstring 00.00.0000
16334 -- W*ndows heritage.
16338 \labelwidthstring 00.00.0000
16347 -- Close the current document (again, a W*ndows heritage).
16351 \labelwidthstring 00.00.0000
16362 \labelwidthstring 00.00.0000
16373 \labelwidthstring 00.00.0000
16383 \begin_inset Quotes eld
16387 \begin_inset Quotes erd
16391 \begin_inset Quotes eld
16395 \begin_inset Quotes erd
16401 \begin_layout Standard
16402 Bracket delimiters: press
16406 -<bracket key> to insert a matching pair of delimiters.
16411 inserts a pair of parentheses
16412 \begin_inset Formula $\left[\right]$
16420 does the same thing.) It will switch to math mode if needed.
16421 The supported characters are ( [ { < |.
16422 It is the same to press the right or the left bracket.
16423 The corresponding delimiters are
16424 \begin_inset Formula $\left(\right)$
16428 \begin_inset Formula $\left[\right]$
16432 \begin_inset Formula $\left\{ \right\} $
16436 \begin_inset Formula $\left\langle \right\rangle $
16440 \begin_inset Formula $\left|\right|$
16445 \begin_inset Quotes eld
16449 \begin_inset Quotes erd
16452 and resize with their contents.
16453 Use Math Panel to get other or non-matching delimiters.
16454 Press backspace on the
16458 delimiter to remove both
16459 \begin_inset Quotes eld
16463 \begin_inset Quotes erd
16466 delimiters without removing their contents.
16470 \labelwidthstring 00.00.0000
16479 -- for convenience, pressing
16493 \labelwidthstring 00.00.0000
16504 \labelwidthstring 00.00.0000
16515 \labelwidthstring 00.00.0000
16526 \labelwidthstring 00.00.0000
16537 \labelwidthstring 00.00.0000
16548 \labelwidthstring 00.00.0000
16555 math-delim langle rangle
16557 -- angular delimiters
16558 \begin_inset Formula $\left\langle \right\rangle $
16561 , not to confuse with ordinary < > signs.
16565 \labelwidthstring 00.00.0000
16572 math-delim langle rangle
16575 \begin_layout Standard
16576 The bar bracket: on some keyboards (e.g.\InsetSpace ~
16577 some British ones), the bar character
16582 -something and on some wayward Unices to "brokenbar".
16583 So we define all of these keys as well.
16587 \labelwidthstring 00.00.0000
16598 \labelwidthstring 00.00.0000
16609 \labelwidthstring 00.00.0000
16620 \labelwidthstring 00.00.0000
16631 \labelwidthstring 00.00.0000
16641 \begin_layout Standard
16642 Accents are in most cases
16646 -<accent key>, e.g.\InsetSpace ~
16660 for tilde (you also need to press
16666 \begin_inset Quotes eld
16678 \begin_inset Quotes erd
16682 Some accents work only in math mode and others only in text mode.
16686 \labelwidthstring 00.00.0000
16695 -- overdot accent, ȧ (text mode only).
16699 \labelwidthstring 00.00.0000
16711 \begin_inset Formula $\dot{a}$
16714 (math mode only -- in physics this denotes a first derivative).
16718 \labelwidthstring 00.00.0000
16729 -- Vector accent over math
16730 \begin_inset Formula $\overrightarrow{x}$
16737 \labelwidthstring 00.00.0000
16746 -- umlaut accent, ä (text mode only)
16750 \labelwidthstring 00.00.0000
16761 -- double dot accent,
16762 \begin_inset Formula $\ddot{a}$
16765 (math mode only -- in physics this denotes a second derivative).
16766 To get a triple dot in math mode, use
16774 \labelwidthstring 00.00.0000
16783 -- grave accent à (text mode only, use
16793 \labelwidthstring 00.00.0000
16802 -- tilde accent ã (text mode only, use
16812 \labelwidthstring 00.00.0000
16821 -- acute accent á (text mode only, use
16831 \labelwidthstring 00.00.0000
16840 -- circumflex (caret) accent â (text mode only, use
16849 \begin_layout Standard
16851 The new key S-F2 for creating a LaTeX file seems handy.
16855 \labelwidthstring 00.00.0000
16864 -- Save current document.
16868 \labelwidthstring 00.00.0000
16875 buffer-export latex
16877 -- Write a LaTeX file for the current document.
16881 \labelwidthstring 00.00.0000
16890 -- Find and replace dialog.
16894 \labelwidthstring 00.00.0000
16911 \labelwidthstring 00.00.0000
16924 to quit LyX is the W*ndows w*ndow manager's mnemonic.
16927 \begin_layout Standard
16936 are used to switch fonts.
16941 to switch back to the normal font.
16942 The non-default font switches
16950 all work as toggles.
16951 They also work on the whole word if you put the cursor in the middle of
16952 the word, or if you select some text.
16956 \labelwidthstring 00.00.0000
16965 -- stop using any special font
16969 \labelwidthstring 00.00.0000
16986 \labelwidthstring 00.00.0000
17003 \labelwidthstring 00.00.0000
17020 \labelwidthstring 00.00.0000
17034 (Used sometimes for people's names.)
17037 \begin_layout Standard
17043 \begin_inset Quotes eld
17047 \begin_inset Quotes erd
17054 key (useful e.g.\InsetSpace ~
17055 if the keyboard has no working
17062 \begin_layout Standard
17063 Here are some Sciword-inspired mnemonics for frequently used math symbols.
17064 Many symbols start with a
17073 cannot be itself bound to anything.
17077 \labelwidthstring 00.00.0000
17089 \begin_inset Quotes eld
17093 \begin_inset Quotes erd
17097 \begin_inset Formula $\prime$
17101 This is frequently unnecessary: in most cases the normal apostrophe works
17104 \begin_inset Formula $x'+2x=0$
17107 , but in some cases this would generate a double superscript error in LaTeX.
17109 \begin_inset Formula $x^{\prime2}$
17113 \begin_inset Formula $x$
17116 prime squared) must be entered with the prime character.
17120 \labelwidthstring 00.00.0000
17128 command-sequence math-superscript; math-insert
17132 -- Insert a prime as a superscript (see example above).
17136 \labelwidthstring 00.00.0000
17145 -- Insert an upper index.
17152 \labelwidthstring 00.00.0000
17161 -- Insert a lower index.
17168 \labelwidthstring 00.00.0000
17180 -- Partial derivative symbol
17181 \begin_inset Formula $\partial$
17188 \labelwidthstring 00.00.0000
17200 -- Summation symbol
17201 \begin_inset Formula $\sum$
17204 (not the same as the Greek letter uppercase Sigma
17205 \begin_inset Formula $\Sigma$
17208 because it can resize and allows smart upper/lower limits).
17212 \labelwidthstring 00.00.0000
17225 \begin_inset Formula $\prod$
17228 (not the same as the Greek letter uppercase Pi,
17229 \begin_inset Formula $\Pi$
17236 \labelwidthstring 00.00.0000
17249 \begin_inset Formula $\infty$
17256 \labelwidthstring 00.00.0000
17269 \begin_inset Formula $\times$
17276 \labelwidthstring 00.00.0000
17286 -- Insert a stacked array
17287 \begin_inset Formula $\begin{array}{c}
17289 \end{array}\end{array}$
17293 (Frequently useful in formulae.)
17297 \labelwidthstring 00.00.0000
17308 \begin_inset Formula $\times$
17312 \begin_inset Formula $\begin{array}{ccc}
17317 (Then you can modify its size using the
17319 Edit\SpecialChar \menuseparator
17326 \labelwidthstring 00.00.0000
17339 \begin_inset Quotes eld
17343 \begin_inset Quotes erd
17347 \begin_inset Formula $\dagger$
17354 \labelwidthstring 00.00.0000
17367 \begin_inset Quotes eld
17371 \begin_inset Quotes erd
17375 \begin_inset Formula $\equiv$
17382 \labelwidthstring 00.00.0000
17394 \begin_inset Quotes eld
17397 Approximate equality
17398 \begin_inset Quotes erd
17402 \begin_inset Formula $\approx$
17409 \labelwidthstring 00.00.0000
17421 \begin_inset Quotes eld
17425 \begin_inset Quotes erd
17429 \begin_inset Formula $\sim$
17436 \labelwidthstring 00.00.0000
17448 \begin_inset Formula $\rightarrow$
17452 \begin_inset Formula $\lim_{x\rightarrow0}$
17459 \labelwidthstring 00.00.0000
17471 \begin_inset Formula $\leq$
17478 \labelwidthstring 00.00.0000
17489 -- Greater-or-equal
17490 \begin_inset Formula $\geq$
17497 \labelwidthstring 00.00.0000
17510 \begin_inset Quotes eld
17514 \begin_inset Quotes erd
17518 \begin_inset Formula $\ll$
17521 (useful in physics)
17525 \labelwidthstring 00.00.0000
17538 \begin_inset Quotes eld
17542 \begin_inset Quotes erd
17546 \begin_inset Formula $\gg$
17552 \begin_layout Subsection
17553 Standard math bindings
17557 \labelwidthstring 00.00.0000
17571 \labelwidthstring 00.00.0000
17583 \labelwidthstring 00.00.0000
17595 \labelwidthstring 00.00.0000
17609 \labelwidthstring 00.00.0000
17621 \labelwidthstring 00.00.0000
17633 \labelwidthstring 00.00.0000
17647 \labelwidthstring 00.00.0000
17659 \labelwidthstring 00.00.0000
17671 \labelwidthstring 00.00.0000
17683 \labelwidthstring 00.00.0000
17697 \labelwidthstring 00.00.0000
17711 \labelwidthstring 00.00.0000
17725 \labelwidthstring 00.00.0000
17739 \labelwidthstring 00.00.0000
17753 \labelwidthstring 00.00.0000
17767 \labelwidthstring 00.00.0000
17779 \labelwidthstring 00.00.0000
17793 \labelwidthstring 00.00.0000
17805 \labelwidthstring 00.00.0000
17817 \labelwidthstring 00.00.0000
17829 \labelwidthstring 00.00.0000
17841 \labelwidthstring 00.00.0000
17855 \labelwidthstring 00.00.0000
17867 \labelwidthstring 00.00.0000
17879 \labelwidthstring 00.00.0000
17891 \labelwidthstring 00.00.0000
17899 math-delim langle rangle
17903 \labelwidthstring 00.00.0000
17911 math-delim rangle langle
17915 \labelwidthstring 00.00.0000
17927 \labelwidthstring 00.00.0000
17941 \labelwidthstring 00.00.0000
17954 \begin_layout Subsection
17959 \labelwidthstring 00.00.0000
17971 \labelwidthstring 00.00.0000
17983 \labelwidthstring 00.00.0000
17995 \labelwidthstring 00.00.0000
18007 \labelwidthstring 00.00.0000