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}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
39 % used for multi-column text
43 \options fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
49 InsetLayout CharStyle:MenuItem
58 \newcommand*{\menuitem}[1]{{\sffamily #1}}
66 \font_typewriter default
67 \font_default_family default
77 \pdf_title "LyX Configuration Manual"
78 \pdf_author "LyX Team"
79 \pdf_subject "LyX-documentation Customization"
80 \pdf_keywords "LyX, documentation, customization"
82 \pdf_bookmarksnumbered true
83 \pdf_bookmarksopen true
84 \pdf_bookmarksopenlevel 1
89 \pdf_pagebackref false
90 \pdf_pdfusetitle false
91 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
98 \paperorientation portrait
105 \paragraph_separation indent
107 \quotes_language english
110 \paperpagestyle headings
111 \tracking_changes false
112 \output_changes false
120 Customizing LyX: Features for the Advanced User
128 \begin_layout Plain Layout
130 If you have comments or error corrections, please send them to the LyX Documenta
132 \begin_inset CommandInset href
134 target "lyx-docs@lists.lyx.org"
147 \begin_layout Standard
148 \begin_inset CommandInset toc
149 LatexCommand tableofcontents
156 \begin_layout Chapter
160 \begin_layout Standard
161 This manual covers the customization features present in LyX.
162 In it, we discuss issues like keyboard shortcuts, screen previewing options,
163 printer options, sending commands to LyX via the LyX Server, internationalizati
164 on, installing new LaTeX classes and LyX layouts, etc.
165 We can't possibly hope to touch on everything you can change---our developers
166 add new features faster than we can document them---but we will explain
167 the most common customizations and hopefully point you in the right direction
168 for some of the more obscure ones.
171 \begin_layout Standard
172 \begin_inset Branch OutDated
175 \begin_layout Standard
176 Information from previous versions of this document that now seems to be
177 outdated is contained in the OutDated branch of this document.
178 By default, this information will not appear in the LaTeX output.
186 \begin_layout Chapter
187 LyX configuration files
190 \begin_layout Standard
191 \begin_inset CommandInset label
197 This chapter aims to help you to find your way through the LyX configuration
199 Before continuing to read this chapter, you should find out where your
200 LyX library and user directories are by using
201 \begin_inset Flex CharStyle:MenuItem
204 \begin_layout Plain Layout
209 elp\SpecialChar \menuseparator
222 The library directory is the place where LyX places its system-wide configurati
223 on files; the user directory is where you can place your modified versions.
224 We will call the former
225 \begin_inset Flex CharStyle:Code
228 \begin_layout Plain Layout
235 \begin_inset Flex CharStyle:MenuItem
238 \begin_layout Plain Layout
244 in the remainder of this document.
248 \begin_layout Section
250 \begin_inset Flex CharStyle:Code
253 \begin_layout Plain Layout
262 \begin_layout Standard
263 \begin_inset Flex CharStyle:Code
266 \begin_layout Plain Layout
272 and its sub-directories contain a number of files and that can be used
273 to customise LyX's behaviour.
274 You can change many of these files from within LyX itself through the
275 \begin_inset Flex CharStyle:MenuItem
278 \begin_layout Plain Layout
283 ools\SpecialChar \menuseparator
294 Most customization that you will want to do in LyX is possible through
296 However, many other inner aspects of LyX can be customized by modifying
298 \begin_inset Flex CharStyle:Code
301 \begin_layout Plain Layout
308 These files fall in different categories, described in the following subsection
312 \begin_layout Subsection
313 Automatically generated files
316 \begin_layout Standard
317 The files, which are to be found in
318 \begin_inset Flex CharStyle:MenuItem
321 \begin_layout Plain Layout
327 , are generated when you configure LyX.
328 They contain various default values that are guessed by inspection.
329 In general, it is not a good idea to modify them, since they might be overwritt
333 \begin_layout Labeling
334 \labelwidthstring 00.00.0000
335 \begin_inset Flex CharStyle:Code
338 \begin_layout Plain Layout
344 contains defaults for various commands.
347 \begin_layout Labeling
348 \labelwidthstring 00.00.0000
349 \begin_inset Flex CharStyle:Code
352 \begin_layout Plain Layout
358 contains the list of packages that have been recognized by LyX.
359 It is currently unused by the LyX program itself, but the information extracted
360 , and more, is made available with
361 \begin_inset Flex CharStyle:MenuItem
364 \begin_layout Plain Layout
369 elp\SpecialChar \menuseparator
386 \begin_layout Labeling
387 \labelwidthstring 00.00.0000
388 \begin_inset Flex CharStyle:Code
391 \begin_layout Plain Layout
397 the list of text classes that have been found in your
398 \begin_inset Flex CharStyle:Code
401 \begin_layout Plain Layout
407 directories, along with the associated LaTeX document class and their descripti
411 \begin_layout Labeling
412 \labelwidthstring 00.00.0000
413 \begin_inset Flex CharStyle:Code
416 \begin_layout Plain Layout
422 the list of layout modules found in your
423 \begin_inset Flex CharStyle:Code
426 \begin_layout Plain Layout
435 \begin_layout Labeling
436 \labelwidthstring 00.00.0000
437 \begin_inset Flex CharStyle:Code
440 \begin_layout Plain Layout
446 lists of various sorts of LaTeX-related files found on your system
449 \begin_layout Labeling
450 \labelwidthstring 00.00.0000
451 \begin_inset Flex CharStyle:Code
454 \begin_layout Plain Layout
460 is automatically generated during configuration from the file
461 \begin_inset Flex CharStyle:Code
464 \begin_layout Plain Layout
471 It contains information on your LaTeX configuration.
474 \begin_layout Subsection
478 \begin_layout Standard
479 These directories are duplicated between
480 \begin_inset Flex CharStyle:Code
483 \begin_layout Plain Layout
490 \begin_inset Flex CharStyle:Code
493 \begin_layout Plain Layout
500 If a particular files exists in both places, the one in
501 \begin_inset Flex CharStyle:Code
504 \begin_layout Plain Layout
513 \begin_layout Labeling
514 \labelwidthstring 00.00.0000
515 \begin_inset Flex CharStyle:Code
518 \begin_layout Plain Layout
524 this directory contains files with the extension
525 \begin_inset Flex CharStyle:Code
528 \begin_layout Plain Layout
534 that define the keybindings used in LyX (see section
539 \begin_inset CommandInset ref
541 reference "sec:bindings"
546 If there exists an internationalized version of the bind file named
547 \begin_inset Flex CharStyle:Code
550 \begin_layout Plain Layout
556 , that will be used first.
562 \begin_inset CommandInset ref
564 reference "chap:i18n"
569 \begin_inset CommandInset ref
571 reference "sec:bindings"
578 \begin_layout Labeling
579 \labelwidthstring 00.00.0000
580 \begin_inset Flex CharStyle:Code
583 \begin_layout Plain Layout
589 contains graphics files that can be included in documents.
593 \begin_layout Labeling
594 \labelwidthstring 00.00.0000
595 \begin_inset Flex CharStyle:Code
598 \begin_layout Plain Layout
604 contains LyX documentation files (including the one you are currently reading).
606 \begin_inset Flex CharStyle:Code
609 \begin_layout Plain Layout
615 deserves special attention, as noted above.
616 If there exists an internationalized version of the help-document with
618 \begin_inset Flex CharStyle:Code
621 \begin_layout Plain Layout
627 prepended to the name, that will be used first.
633 \begin_inset CommandInset ref
635 reference "chap:i18n"
642 \begin_layout Labeling
643 \labelwidthstring 00.00.0000
644 \begin_inset Flex CharStyle:Code
647 \begin_layout Plain Layout
653 contains example files that explain how to use some features.
654 In the file browser, press the
655 \begin_inset Flex CharStyle:MenuItem
658 \begin_layout Plain Layout
667 \begin_layout Labeling
668 \labelwidthstring 00.00.0000
669 \begin_inset Flex CharStyle:Code
672 \begin_layout Plain Layout
678 contains image files that are used by the
679 \begin_inset Flex CharStyle:MenuItem
682 \begin_layout Plain Layout
689 In addition, it also contains the individual icons used in the toolbar
690 and the banners that can be shown when LyX is launched.
693 \begin_layout Labeling
694 \labelwidthstring 00.00.0000
695 \begin_inset Flex CharStyle:Code
698 \begin_layout Plain Layout
704 contains keyboard keymapping files.
710 \begin_inset CommandInset ref
712 reference "sec:keymap"
719 \begin_layout Labeling
720 \labelwidthstring 00.00.0000
721 \begin_inset Flex CharStyle:Code
724 \begin_layout Plain Layout
730 contains the text class and module files described in Chapter
735 \begin_inset CommandInset ref
737 reference "chap:textclass"
744 \begin_layout Labeling
745 \labelwidthstring 00.00.0000
746 \begin_inset Flex CharStyle:Code
749 \begin_layout Plain Layout
756 \begin_inset Flex CharStyle:Code
759 \begin_layout Plain Layout
765 Python scripts used to convert between LyX versions.
766 These can be run from the command line if, say, you want to batch-convert
770 \begin_layout Labeling
771 \labelwidthstring 00.00.0000
772 \begin_inset Flex CharStyle:Code
775 \begin_layout Plain Layout
781 contains some files that demonstrate the capabilities of the
782 \begin_inset Flex CharStyle:MenuItem
785 \begin_layout Plain Layout
796 Also contains some scripts used by LyX itself.
799 \begin_layout Labeling
800 \labelwidthstring 00.00.0000
801 \begin_inset Flex CharStyle:Code
804 \begin_layout Plain Layout
810 contains the standard LyX template files described in Chapter
815 \begin_inset CommandInset ref
817 reference "sec:templates"
824 \begin_layout Labeling
825 \labelwidthstring 00.00.0000
826 \begin_inset Flex CharStyle:Code
829 \begin_layout Plain Layout
835 contains files with the extension
836 \begin_inset Flex CharStyle:Code
839 \begin_layout Plain Layout
845 that define the user interface to LyX.
846 That is, the files define which items appear in which menus and the items
847 appearing on the toolbar.
849 \begin_inset CommandInset ref
858 \begin_layout Subsection
859 Files you don't want to modify
862 \begin_layout Standard
863 These files are used internally by LyX and you generally do not need to
864 modify them unless you are a developer.
867 \begin_layout Labeling
868 \labelwidthstring 00.00.0000
869 \begin_inset Flex CharStyle:Code
872 \begin_layout Plain Layout
878 this file contains the list of LyX developers.
879 The contents are displayed with the menu entry
880 \begin_inset Flex CharStyle:MenuItem
883 \begin_layout Plain Layout
888 elp\SpecialChar \menuseparator
901 \begin_layout Labeling
902 \labelwidthstring 00.00.0000
903 \begin_inset Flex CharStyle:Code
906 \begin_layout Plain Layout
912 this is a LaTeX script used during the configuration process.
916 \begin_layout Labeling
917 \labelwidthstring 00.00.0000
918 \begin_inset Flex CharStyle:Code
921 \begin_layout Plain Layout
927 this is the script that is used to re-configure LyX.
928 It creates configuration files in the directory it was run from.
931 \begin_layout Subsection
932 Other files needing a line or two...
935 \begin_layout Labeling
936 \labelwidthstring 00.00.0000
937 \begin_inset Flex CharStyle:Code
940 \begin_layout Plain Layout
946 this contains tables describing how different character encodings can be
950 \begin_layout Labeling
951 \labelwidthstring 00.00.0000
952 \begin_inset Flex CharStyle:Code
955 \begin_layout Plain Layout
961 this file contains the templates available to the new
962 \begin_inset Flex CharStyle:MenuItem
965 \begin_layout Plain Layout
978 \begin_layout Labeling
979 \labelwidthstring 00.00.0000
980 \begin_inset Flex CharStyle:Code
983 \begin_layout Plain Layout
989 this file contains a list of all the languages currently supported by LyX.
992 \begin_layout Section
993 Your local configuration directory
996 \begin_layout Standard
997 Even if you are using LyX as an unprivileged user, you might want to change
998 LyX configuration for your own use.
1000 \begin_inset Flex CharStyle:Code
1003 \begin_layout Plain Layout
1009 directory contains all your personal configuration files.
1010 This is the directory described as
1011 \begin_inset Quotes eld
1015 \begin_inset Quotes erd
1019 \begin_inset Flex CharStyle:MenuItem
1022 \begin_layout Plain Layout
1027 elp\SpecialChar \menuseparator
1029 \begin_inset space ~
1038 This directory is used as a mirror of
1039 \begin_inset Flex CharStyle:Code
1042 \begin_layout Plain Layout
1048 , which means that every file in
1049 \begin_inset Flex CharStyle:Code
1052 \begin_layout Plain Layout
1058 is a replacement for the corresponding file in
1059 \begin_inset Flex CharStyle:Code
1062 \begin_layout Plain Layout
1069 Any configuration file described in the above sections can be placed either
1070 in the system-wide directory, in which case it will affect all users, or
1071 in your local directory for your own use.
1074 \begin_layout Standard
1075 To make things clearer, let's provide a few examples:
1078 \begin_layout Itemize
1079 The preferences set in the
1080 \begin_inset Flex CharStyle:MenuItem
1083 \begin_layout Plain Layout
1088 ools\SpecialChar \menuseparator
1098 dialog are saved to a file
1099 \begin_inset Flex CharStyle:Code
1102 \begin_layout Plain Layout
1109 \begin_inset Flex CharStyle:Code
1112 \begin_layout Plain Layout
1121 \begin_layout Itemize
1122 When you reconfigure using
1123 \begin_inset Flex CharStyle:MenuItem
1126 \begin_layout Plain Layout
1131 ools\SpecialChar \menuseparator
1142 \begin_inset Flex CharStyle:Code
1145 \begin_layout Plain Layout
1151 script, and the resulting files are written in your local configuration
1153 This means that any additional text class file that you might have added
1155 \begin_inset Flex CharStyle:Code
1158 \begin_layout Plain Layout
1164 will be added to the list of classes in the
1165 \begin_inset Flex CharStyle:MenuItem
1168 \begin_layout Plain Layout
1173 ocument\SpecialChar \menuseparator
1186 \begin_layout Itemize
1187 If you get some updated documentation from LyX ftp site and cannot install
1188 it because you do not have sysadmin rights on your system, you can just
1190 \begin_inset Flex CharStyle:Code
1193 \begin_layout Plain Layout
1199 and the items in the
1200 \begin_inset Flex CharStyle:MenuItem
1203 \begin_layout Plain Layout
1213 menu will open them!
1216 \begin_layout Section
1217 Running LyX with multiple configurations
1220 \begin_layout Standard
1221 The configuration freedom of the local configuration directory may not suffice
1222 if you want to have more than one configuration at your disposal.
1223 For example, you may want to be use different key bindings or printer settings
1225 You can achieve this by having several such directories.
1226 You then specify which directory to use at run-time.
1229 \begin_layout Standard
1230 Invoking LyX with the command line switch
1231 \begin_inset Flex CharStyle:Code
1234 \begin_layout Plain Layout
1244 instructs the program to read the configuration from that directory, and
1245 not from the default directory.
1246 (You can determine the default directory by running LyX without the
1247 \begin_inset Flex CharStyle:Code
1250 \begin_layout Plain Layout
1256 switch.) If the specified directory does not exist, LyX offers to create
1257 it for you, just like it does for the default directory on the first time
1258 you run the program.
1259 You can modify the configuration options in this additional user directory
1260 exactly as you would for the default directory.
1261 These directories are completely independent (but read on).
1262 Note that setting the environment variable
1263 \begin_inset Flex CharStyle:Code
1266 \begin_layout Plain Layout
1272 to some value has exactly the same effect.
1275 \begin_layout Standard
1276 Having several configurations also requires more maintenance: if you want
1277 to add a new layout to
1278 \begin_inset Flex CharStyle:Code
1281 \begin_layout Plain Layout
1287 which you want available from all your configurations, you must add it
1288 to each directory separately.
1289 You can avoid this with the following trick: after LyX creates the additional
1290 directory, most of the subdirectories (see above) are empty.
1291 If you want the new configuration to mirror an existing one, replace the
1292 empty subdirectory with a symbolic link to the matching subdirectory in
1293 the existing configuration.
1295 \begin_inset Flex CharStyle:Code
1298 \begin_layout Plain Layout
1304 subirectory, however, since it contains a file written by the configuration
1305 script (also accessible through
1306 \begin_inset Flex CharStyle:MenuItem
1309 \begin_layout Plain Layout
1314 ools\SpecialChar \menuseparator
1324 ) which is configuration-specific.
1327 \begin_layout Chapter
1328 The Preferences dialog
1331 \begin_layout Section
1332 Using the dialog for the first time
1335 \begin_layout Standard
1337 \begin_inset Flex CharStyle:Code
1340 \begin_layout Plain Layout
1346 file will contain only changes that you have made to the default behaviour,
1347 some of which is hard-coded into LyX and some of which is contained in
1349 \begin_inset Flex CharStyle:Code
1352 \begin_layout Plain Layout
1353 LyXDir/lyxrc.defaults
1359 Note that in both files lines beginning with a
1360 \begin_inset Quotes eld
1364 \begin_inset Quotes erd
1367 are just comments and are not interpreted.
1368 However, only system administrators should edit
1369 \begin_inset Flex CharStyle:Code
1372 \begin_layout Plain Layout
1373 LyXDir/lyxrc.defaults
1379 Users should use the
1380 \begin_inset Flex CharStyle:MenuItem
1383 \begin_layout Plain Layout
1388 ools\SpecialChar \menuseparator
1398 dialog to create and modify their own
1399 \begin_inset Flex CharStyle:Code
1402 \begin_layout Plain Layout
1411 \begin_layout Standard
1413 \begin_inset Flex CharStyle:MenuItem
1416 \begin_layout Plain Layout
1421 ools\SpecialChar \menuseparator
1431 dialog will be largely self-explanatory.
1432 Most things in the dialog have associated `tool tips': hover your mouse
1433 pointer over something for more information.
1434 Before we highlight a few of the more important commands below, however,
1436 \begin_inset Flex CharStyle:MenuItem
1439 \begin_layout Plain Layout
1445 ing some of your changes (e.g., screen fonts) will have an instant effect.
1447 changing the bind file) will not.
1448 If nothing appears to have changed, just
1449 \begin_inset Flex CharStyle:MenuItem
1452 \begin_layout Plain Layout
1458 the changes and restart LyX.
1461 \begin_layout Section
1465 \begin_layout Subsection
1469 \begin_layout Standard
1470 The font used to display your documents on the LyX screen is very important,
1471 since you'll be reading all your documents with this font.
1472 Therefore it is important that the font be as readable and good-looking
1474 The LyX team tried to provide the best possible default font for you, but
1475 since systems can be so different, it's quite possible that the default
1476 fonts will be sub-optimal on your system.
1477 Fortunately, you can do something about this.
1478 Before we explain how, you should learn a bit more about fonts so that
1479 you are better prepared for choosing your fonts.
1480 There are trade-offs that are specific to your preferences and the capabilities
1484 \begin_layout Standard
1485 Notice that this section only deals with the fonts on the
1489 inside the LyX window.
1490 The fonts that appear on the
1498 are independent from these fonts, and are determined by the document class.
1503 to learn how to change the font of the printed version of your document.
1506 \begin_layout Standard
1507 Basically, screen fonts come in two different kinds: scalable outline fonts
1508 and non-scalable bitmap fonts.
1509 This distinction seems a bit arbitrary, since non-scalable fonts are actually
1510 scalable in most modern font renderers.
1511 The difference lies in the
1515 of the scaling and the
1520 The most important decision is thus whether you should use non-scalable
1521 bitmap fonts or scalable outline fonts.
1524 \begin_layout Standard
1525 The scalable fonts are built from
1529 of the single glyphs (i.e.
1530 characters) in the font.
1531 This means that each glyph is defined using mathematical curves that are
1532 well suited for scaling to any requested size.
1533 This mathematical definition is interpreted by the font renderer and turned
1534 into a small picture composed of pixels according to which size and glyph
1535 (or symbol) the programmer requests.
1536 This means that scalable fonts will look pretty good in most sizes.Since
1537 scalable fonts are defined in an abstract way, it can be hard to provide
1538 a good rendering at small sizes, where each pixel has to be very carefully
1539 computed to provide a good image.
1540 Technically it is possible to do this from the mathematical definition,
1541 but in order to keep the rendering reasonably fast, tradeoffs have to be
1542 made, and the result is that scalable fonts can be difficult to read at
1546 \begin_layout Standard
1547 Bitmap fonts on the other hand, are defined by bitmap graphics from the
1548 start, so they will look good at all the sizes they are meant for.
1549 However, they don't scale well, because in order to scale a glyph, each
1550 pixel is enlarged into several pixels.
1551 It is the same effect that happens if you try to enlarge a picture in an
1552 image manipulation program.
1553 In order to relieve this effect, bitmap fonts are typically provided in
1554 several fixed sizes typically from around 8 pixels high up to 34 pixels
1555 or so high in steps according to what is believed to be useful.
1556 The advantage of bitmap fonts is that no complicated computations are necessary
1557 to display each glyph, so bitmap fonts are thus faster displayed than scalable
1559 The disadvantage is that sizes that don't exists as fixed versions have
1560 to be scaled by doubling pixels, and thus look bad.
1563 \begin_layout Standard
1564 The net result of all this is that bitmap fonts are generally best for the
1565 small sizes, where they are available, while scalable fonts are generally
1566 best for large sizes.
1567 The logical conclusion would thus be to use bitmap fonts for the small
1568 sizes, and scalable fonts for the large sizes.
1569 Unfortunately, this is not a good idea, since bitmap fonts and scalable
1570 fonts are not designed to be used together, so the overall look of such
1571 a scheme would be bad.
1572 The best you can do is thus to try both schemes and decide for yourself
1576 \begin_layout Standard
1577 In the following, we will describe what to do if the text does not look
1579 We'll start with the most important parameters: DPI and font zoom.
1582 \begin_layout Subsubsection
1583 DPI setting and Font Zoom
1586 \begin_layout Standard
1587 LyX automatically tries to scale the fonts to look as close as the paper
1588 output size as possible, except for the so-called font zoom factor.
1591 \begin_layout Standard
1592 In order for this to work on all systems, it relies on the screen DPI (dots
1593 per inch) setting to be correct.
1594 The DPI setting for your system is autodetected by LyX using information
1595 provided by your system.
1596 You can check what LyX autodetects the DPI setting to, by running LyX as
1598 \begin_inset Flex CharStyle:Code
1601 \begin_layout Plain Layout
1610 \begin_layout Standard
1611 On many systems, this will not be correct, so you should check that it is
1613 On X11 systems, you can run
1614 \begin_inset Quotes eld
1618 \begin_inset Flex CharStyle:Code
1621 \begin_layout Plain Layout
1628 \begin_inset Quotes erd
1631 and write down what the DPI is for the resolution you use (this will be
1632 close to the value LyX detects).
1633 It is the number mentioned as
1634 \begin_inset Quotes eld
1638 \begin_inset Quotes erd
1642 Also write down the number of pixels you have in the width (the first number
1644 \begin_inset Quotes eld
1648 \begin_inset Quotes erd
1654 \begin_layout Standard
1655 Then get the good old ruler out of the closet, and measure the width of
1656 the visible screen-image on your monitor.
1657 Convert this measurement to inches if you used a centimeter ruler by dividing
1659 Now you can determine the correct DPI setting for your screen by dividing
1660 the number of pixels in the width by the width of the screen-image on the
1662 If this number is more than, say, 5 DPI from the detected value, you should
1663 either fix your system setup, or at least tell LyX that the DPI is different
1664 than the detected value.
1667 \begin_layout Standard
1668 If you can't fix system setup (which of course is best since other programs
1669 than LyX will benefit from this as well), you can tell LyX the correct
1671 \begin_inset Flex CharStyle:MenuItem
1674 \begin_layout Plain Layout
1683 \begin_layout Standard
1684 If the text is too small or too big for your taste, you should fiddle with
1685 the font zoom setting.
1686 This setting is used to scale the point size of the text.
1687 If your DPI setting is correct, and the font zoom setting is set to 100,
1688 this means that LyX will try to display the text exactly the same size
1689 as it will appear on the paper-output.
1690 If you set the zoom factor to 200, the text will try to be 2 times as big
1692 Of course, this will only happen if LyX can find a font that has the appropriat
1693 e size, which you can't count on.
1694 Since LyX is a WYSIWYM system anyways, this limitation isn't much of an
1698 \begin_layout Standard
1699 The default font zoom setting is 150, since a monitor is typically wider
1700 than a piece of paper, but you should try to fiddle with it through the
1702 \begin_inset Flex CharStyle:MenuItem
1705 \begin_layout Plain Layout
1707 \begin_inset space ~
1720 \begin_inset Flex CharStyle:MenuItem
1723 \begin_layout Plain Layout
1729 dialog to find a size that you like.
1730 When you've found a setting that seems to work nicely for you (tip: use
1732 \begin_inset Flex CharStyle:MenuItem
1735 \begin_layout Plain Layout
1745 button to keep the dialog open while you experiment), you can make this
1746 setting the default by using the
1747 \begin_inset Flex CharStyle:MenuItem
1750 \begin_layout Plain Layout
1763 \begin_layout Standard
1764 While it is often possible to find a suitable size for the text on the screen,
1765 this doesn't necessarily mean that the fonts are the best ones available
1767 In order to help you get the most out of your system, you can use the font
1768 definition commands to fine-tune the look of the text in greater detail
1772 \begin_layout Subsubsection
1773 Font definition commands
1776 \begin_layout Standard
1777 You can change LyX's screen fonts from within the
1778 \begin_inset Flex CharStyle:MenuItem
1781 \begin_layout Plain Layout
1788 The number of fonts that are available on different systems vary.
1792 \begin_layout Standard
1793 Before you go about scrapping a bitmap font because the larger sizes look
1795 \begin_inset Quotes eld
1799 \begin_inset Quotes erd
1802 , you should toggle the
1803 \begin_inset Flex CharStyle:Code
1806 \begin_layout Plain Layout
1813 This is only useful if you use bitmap fonts, because only these don't scale
1815 If you define this flag, LyX will only use the fixed font sizes that are
1816 available, and this guarantees that all bitmap fonts look good.
1817 However, the downside is that there will be a greater difference between
1818 the size of the fonts on screen and the size of fonts on paper because
1819 LyX will have to be satisfied with the closest available size, and not
1820 try to scale a size to fit.
1821 Also, you can risk that some logically different sizes, such as
1822 \begin_inset Flex CharStyle:MenuItem
1825 \begin_layout Plain Layout
1832 \begin_inset Flex CharStyle:MenuItem
1835 \begin_layout Plain Layout
1841 , will be mapped to the same screen font, making it hard for you to see
1842 the difference on screen.
1846 \begin_layout Standard
1847 One final note regarding the
1848 \begin_inset Flex CharStyle:Code
1851 \begin_layout Plain Layout
1857 flag: you should know that there is nothing wrong with using bitmap and
1858 scalable fonts at the same time for different purposes.
1859 For instance, it's common to use the scalable
1860 \begin_inset Quotes eld
1864 \begin_inset Quotes erd
1867 for the serif text together with a bitmap version of
1868 \begin_inset Quotes eld
1872 \begin_inset Quotes erd
1876 And you can safely select the
1877 \begin_inset Quotes eld
1881 \begin_inset Quotes erd
1884 button without worries: It will only apply to the Helvetica font.
1887 \begin_layout Standard
1888 Sometimes the artifacts introduced by use of the flag can be relieved by
1889 using the fine-detail screen font sizes which defines which point sizes
1890 the different logical font sizes correspond to.
1892 \begin_inset Flex CharStyle:Code
1895 \begin_layout Plain Layout
1901 to see exactly what concrete fonts the logical sizes map to, and try adjusting
1902 the corresponding entries in the
1903 \begin_inset Flex CharStyle:MenuItem
1906 \begin_layout Plain Layout
1912 dialog until you've managed to hit the nail and get the fonts you want.
1913 This can be hard to do, because LyX uses the DPI setting and the font zoom
1914 settings to calculate which exact screen font size to ask the X server
1915 for, thus obfuscating the mapping.
1916 If you can't make it by trial-and-error, you can make the process more
1917 transparent if you set both the DPI setting and font zoom settings to 100---eve
1918 n when this is known to be wrong.
1919 This will of course make your scalable fonts look weird, so use with care.
1922 \begin_layout Standard
1923 \begin_inset Branch OutDated
1926 \begin_layout Subsubsection
1930 \begin_layout Standard
1931 By default, LyX will use fonts meant to write Western European text, including
1932 all kinds of English.
1933 This is defined through the so-called
1942 If you want to use LyX to write for instance Eastern European text, Cyrillic
1943 or any other language not covered by the ISO-8859-1 font encoding, you
1944 can define a different one with the encoding setting.
1945 This requires you to have special fonts installed.
1947 \begin_inset Flex CharStyle:Code
1950 \begin_layout Plain Layout
1956 to see whether this is the case: check the
1957 \begin_inset Quotes eld
1961 \begin_inset Quotes erd
1965 \begin_inset Quotes eld
1969 \begin_inset Quotes erd
1972 fields for ISO-8859-X values different from ISO-8859-1, and search for
1973 one that contains the national characters of your language.
1974 If you find any, enter this encoding in the dialog.
1975 If not, go searching the Web for appropriate fonts.
1976 For the Qt frontend, it's recommended you use an iso646 font set.
1979 \begin_layout Standard
1980 When you've set LyX up to use a different font encoding, you should also
1981 consider changing the font used by dialog windows in LyX.
1983 \begin_inset Flex CharStyle:MenuItem
1986 \begin_layout Plain Layout
1988 \begin_inset space ~
1992 \begin_inset space ~
2000 dialog will not be understandable unless you tell LyX to use a different
2002 By default the menu font is set to
2003 \begin_inset Flex CharStyle:Code
2006 \begin_layout Plain Layout
2007 -*-helvetica-medium-r
2012 , but often Helvetica is not available in the font encoding you need, so
2013 the dialog allows this to be changed.
2016 \begin_layout Standard
2017 As you can see, there are quite a few options that can be used to fine tune
2018 the look of your fonts.
2019 This should not scare you from fiddling with the settings, because after
2020 all, you will hopefully be using LyX for many hours in the future.
2021 And contrary to real WYSIWYG word processors where you are tied to using
2022 fonts that have to look good both on paper and on screen, LyX gives you
2023 the possibility of using fonts that are designed to look good on the screen
2024 while using a different set of fonts to look good on paper.
2032 \begin_layout Subsection
2034 \begin_inset CommandInset label
2043 \begin_layout Standard
2044 The appearance of both the menu and toolbar may both be changed using the
2046 \begin_inset Flex CharStyle:MenuItem
2049 \begin_layout Plain Layout
2056 Simply select a different
2057 \begin_inset Flex CharStyle:Code
2060 \begin_layout Plain Layout
2067 \begin_inset Flex CharStyle:MenuItem
2070 \begin_layout Plain Layout
2071 Look & Feel\SpecialChar \menuseparator
2078 You can customize the interface by copying one of the
2079 \begin_inset Flex CharStyle:Code
2082 \begin_layout Plain Layout
2089 \begin_inset Flex CharStyle:Code
2092 \begin_layout Plain Layout
2099 \begin_inset Flex CharStyle:Code
2102 \begin_layout Plain Layout
2109 You may have to restart LyX for these changes to take effect.
2112 \begin_layout Standard
2114 \begin_inset Flex CharStyle:Code
2117 \begin_layout Plain Layout
2123 files is straightforward: have a look at
2124 \begin_inset Flex CharStyle:Code
2127 \begin_layout Plain Layout
2135 \begin_inset Flex CharStyle:Code
2138 \begin_layout Plain Layout
2145 \begin_inset Flex CharStyle:Code
2148 \begin_layout Plain Layout
2155 \begin_inset Flex CharStyle:Code
2158 \begin_layout Plain Layout
2164 entries must be ended with an explicit
2165 \begin_inset Flex CharStyle:Code
2168 \begin_layout Plain Layout
2176 \begin_inset Flex CharStyle:Code
2179 \begin_layout Plain Layout
2186 \begin_inset Flex CharStyle:Code
2189 \begin_layout Plain Layout
2196 \begin_inset Flex CharStyle:Code
2199 \begin_layout Plain Layout
2206 \begin_inset Flex CharStyle:Code
2209 \begin_layout Plain Layout
2216 \begin_inset Flex CharStyle:Code
2219 \begin_layout Plain Layout
2225 s and in the case of the
2226 \begin_inset Quotes eld
2230 \begin_inset Quotes erd
2234 \begin_inset Flex CharStyle:Code
2237 \begin_layout Plain Layout
2244 One small word of warning.
2246 \begin_inset Flex CharStyle:Code
2249 \begin_layout Plain Layout
2255 s may be inserted in a
2256 \begin_inset Flex CharStyle:Code
2259 \begin_layout Plain Layout
2266 \begin_inset Flex CharStyle:Code
2269 \begin_layout Plain Layout
2275 , but they are defined as
2276 \begin_inset Flex CharStyle:Code
2279 \begin_layout Plain Layout
2286 \begin_inset Flex CharStyle:Code
2289 \begin_layout Plain Layout
2297 \begin_inset Flex CharStyle:Code
2300 \begin_layout Plain Layout
2306 tag is used to insert context-dependent information that is generated by
2308 Unfortunately, the available tags are not documented outside the source
2312 \begin_layout Standard
2313 Note that, as of LyX 1.6, there are extensive context menus, normally accessed
2315 These are defined in the
2316 \begin_inset Flex CharStyle:Code
2319 \begin_layout Plain Layout
2328 \begin_layout Section
2332 \begin_layout Standard
2333 The settings in this section are used to customise the behavior of the LyX
2337 \begin_layout Subsection
2338 Fullscreen mode and toggling window elements
2341 \begin_layout Standard
2342 Fullscreen mode switch is done by internal call of
2343 \begin_inset Flex CharStyle:Code
2346 \begin_layout Plain Layout
2347 ui-toggle fullscreen
2353 Note that except standard switches in the preference dialog additional
2355 \begin_inset Flex CharStyle:Code
2358 \begin_layout Plain Layout
2365 \begin_inset Flex CharStyle:Code
2368 \begin_layout Plain Layout
2374 can be used for toggling.
2376 \begin_inset Flex CharStyle:Code
2379 \begin_layout Plain Layout
2380 toolbar-toggle <toolbar>
2385 LFUN for advanced settings of toolbars.
2388 \begin_layout Subsection
2389 \begin_inset CommandInset label
2398 \begin_layout Standard
2399 Bindings are used to associate a LyX function to a key.
2400 Several prepackaged binding files are available: a CUA set of bindings
2401 (familiar as the typical set of PC and CDE set of keyboard shortcuts),
2402 an Emacs set of bindings, for those of us who follow the One True Way and
2403 refuse to lower our standards,
2407 \begin_layout Plain Layout
2408 I'm kidding here, of course!
2413 as well as specialty bindings (broadway and hollywood) and bindings for
2414 languages other than English.
2415 You can select your binding in the
2416 \begin_inset Flex CharStyle:MenuItem
2419 \begin_layout Plain Layout
2420 Editing\SpecialChar \menuseparator
2429 \begin_inset Flex CharStyle:MenuItem
2432 \begin_layout Plain Layout
2437 ools\SpecialChar \menuseparator
2453 \begin_layout Standard
2454 If, however, you'd like to customise the bindings to your own exacting tastes,
2455 then there are two ways to proceed.
2456 The first, and older method, is to copy a file from
2457 \begin_inset Flex CharStyle:Code
2460 \begin_layout Plain Layout
2467 \begin_inset Flex CharStyle:Code
2470 \begin_layout Plain Layout
2476 and modify that in a text editor.
2477 Don't forget to select this file in
2478 \begin_inset Flex CharStyle:MenuItem
2481 \begin_layout Plain Layout
2482 Editing\SpecialChar \menuseparator
2489 The second method is to use the shortcut editor, which you will also find
2491 \begin_inset Flex CharStyle:MenuItem
2494 \begin_layout Plain Layout
2495 Editing\SpecialChar \menuseparator
2502 The changes you make here will be stored at
2503 \begin_inset Flex CharStyle:Code
2506 \begin_layout Plain Layout
2507 UserDir/bind/user.bind
2515 \begin_layout Standard
2516 LyX supports internationalization of the user interface (see Chapter
2517 \begin_inset space ~
2521 \begin_inset CommandInset ref
2523 reference "chap:i18n"
2532 is set, LyX will try to use bindfiles by prepending the standard language
2534 For example, you can put a translated copy of some standard bind file in
2536 \begin_inset Flex CharStyle:Code
2539 \begin_layout Plain Layout
2545 directory, and LyX will use it automatically.
2548 \begin_layout Standard
2550 \begin_inset Flex CharStyle:Code
2553 \begin_layout Plain Layout
2559 files is straightforward:
2562 \begin_layout LyX-Code
2565 bind ``<key combination>'' ``<lyx-function>
2566 \begin_inset Quotes erd
2572 \begin_layout Standard
2573 Both key combination and lyx-function (including any arguments) must be
2574 enclosed in "double quotes".
2575 The LyX functions are partially documented on listed on the
2576 \begin_inset CommandInset href
2579 target "http://wiki.lyx.org/LyX/LyxFunctions"
2584 A major effort is presently underway to improve this documentation.
2587 \begin_layout Section
2588 \begin_inset CommandInset label
2590 name "sec:converters-etc"
2597 \begin_layout Standard
2598 LyX has a powerful mechanism to convert to and from any file format using
2603 \begin_layout Subsection
2604 \begin_inset CommandInset label
2613 \begin_layout Standard
2614 The first step is to define your file formats if they are not already defined.
2616 \begin_inset Flex CharStyle:MenuItem
2619 \begin_layout Plain Layout
2620 Tools\SpecialChar \menuseparator
2621 Preferences\SpecialChar \menuseparator
2622 File Handling\SpecialChar \menuseparator
2630 \begin_inset Flex CharStyle:MenuItem
2633 \begin_layout Plain Layout
2634 New\SpecialChar \ldots{}
2640 button to define your new format.
2642 \begin_inset Flex CharStyle:MenuItem
2645 \begin_layout Plain Layout
2651 field contains the named used to identify the format in the GUI.
2653 \begin_inset Flex CharStyle:MenuItem
2656 \begin_layout Plain Layout
2662 is used to identify the format interally.
2663 You will also need to enter a file extension.
2664 These are all required.
2666 \begin_inset Flex CharStyle:MenuItem
2669 \begin_layout Plain Layout
2675 field is used to provide a keyboard shortcut on the menus.
2676 (For example, pressing
2677 \begin_inset Flex CharStyle:MenuItem
2680 \begin_layout Plain Layout
2687 \begin_inset Flex CharStyle:MenuItem
2690 \begin_layout Plain Layout
2691 View\SpecialChar \menuseparator
2700 \begin_layout Standard
2702 \begin_inset Flex CharStyle:MenuItem
2705 \begin_layout Plain Layout
2712 \begin_inset Flex CharStyle:MenuItem
2715 \begin_layout Plain Layout
2722 For example, you might want to use
2723 \begin_inset Flex CharStyle:MenuItem
2726 \begin_layout Plain Layout
2732 to view PostScript files.
2733 You can enter the command needed to start the program in the corresponding
2735 In defining this command, you can use the four variables listed in the
2737 The viewer is launched when you view an image in LyX or use the
2738 \begin_inset Flex CharStyle:MenuItem
2741 \begin_layout Plain Layout
2748 The editor is for example launched when you press the
2749 \begin_inset Flex CharStyle:MenuItem
2752 \begin_layout Plain Layout
2759 \begin_inset Flex CharStyle:MenuItem
2762 \begin_layout Plain Layout
2769 \begin_inset Flex CharStyle:MenuItem
2772 \begin_layout Plain Layout
2781 \begin_layout Standard
2783 \begin_inset Flex CharStyle:MenuItem
2786 \begin_layout Plain Layout
2792 option tells LyX that a format is suitable for document export.
2793 If this is is set and if a suitable conversion route exists (see
2794 \begin_inset CommandInset ref
2796 reference "sub:Converters"
2800 ), the format will appear in the
2801 \begin_inset Flex CharStyle:MenuItem
2804 \begin_layout Plain Layout
2805 File\SpecialChar \menuseparator
2812 The format will also appear in the
2813 \begin_inset Flex CharStyle:MenuItem
2816 \begin_layout Plain Layout
2822 menu if a viewer is specified for the format.
2823 Pure image formats, such as
2824 \begin_inset Flex CharStyle:Code
2827 \begin_layout Plain Layout
2833 , should not use this option.
2834 Formats that can both represent vector graphics and documents like
2835 \begin_inset Flex CharStyle:Code
2838 \begin_layout Plain Layout
2847 \begin_layout Standard
2849 \begin_inset Flex CharStyle:MenuItem
2852 \begin_layout Plain Layout
2853 Vector graphics format
2858 tells LyX that a format can contain vector graphics.
2859 This information is used to determine the target format of included graphics
2861 \begin_inset Flex CharStyle:MenuItem
2864 \begin_layout Plain Layout
2871 Included graphics may need to be converted to either
2872 \begin_inset Flex CharStyle:MenuItem
2875 \begin_layout Plain Layout
2882 \begin_inset Flex CharStyle:MenuItem
2885 \begin_layout Plain Layout
2892 \begin_inset Flex CharStyle:MenuItem
2895 \begin_layout Plain Layout
2902 \begin_inset Flex CharStyle:MenuItem
2905 \begin_layout Plain Layout
2911 cannot handle other image formats.
2912 If an included graphic is not already in
2913 \begin_inset Flex CharStyle:MenuItem
2916 \begin_layout Plain Layout
2923 \begin_inset Flex CharStyle:MenuItem
2926 \begin_layout Plain Layout
2933 \begin_inset Flex CharStyle:MenuItem
2936 \begin_layout Plain Layout
2942 format, it is converted to
2943 \begin_inset Flex CharStyle:MenuItem
2946 \begin_layout Plain Layout
2952 if the vector format option is set, and otherwise to
2953 \begin_inset Flex CharStyle:MenuItem
2956 \begin_layout Plain Layout
2965 \begin_layout Subsection
2969 \begin_layout Standard
2970 Since all conversions from one format to another take place in LyX's temporary
2971 directory, it is sometimes necessary to modify a file before copying it
2972 to the temporary directory in order that the conversion may be performed.
2976 \begin_layout Plain Layout
2977 For example, the file may refer to other files---images, for example---using
2978 relative filenames, and these may become invalid when the file is copied
2979 to the temporary directory.
2984 This is done by a Copier: It copies a file to (or from) the temporary directory
2985 and may modify it in the process.
2988 \begin_layout Standard
2989 The definitions of the copiers may use four variables:
2992 \begin_layout Labeling
2993 \labelwidthstring 00.00.0000
2994 \begin_inset Flex CharStyle:Code
2997 \begin_layout Plain Layout
3003 The LyX system directory (e.
3004 \begin_inset space \thinspace{}
3008 \begin_inset space ~
3012 \begin_inset Flex CharStyle:MenuItem
3015 \begin_layout Plain Layout
3024 \begin_layout Labeling
3025 \labelwidthstring 00.00.0000
3026 \begin_inset Flex CharStyle:Code
3029 \begin_layout Plain Layout
3038 \begin_layout Labeling
3039 \labelwidthstring 00.00.0000
3040 \begin_inset Flex CharStyle:Code
3043 \begin_layout Plain Layout
3052 \begin_layout Labeling
3053 \labelwidthstring 00.00.0000
3054 \begin_inset Flex CharStyle:Code
3057 \begin_layout Plain Layout
3066 \begin_layout Standard
3067 The latter is to be given in a form suitable for inclusion in a LaTeX's
3074 command and is relevant only when exporting files suitable for such inclusion.
3077 \begin_layout Standard
3078 Copiers can be used to do almost anything with output files.
3079 For example, suppose you want generated pdf files to be copied to a special
3081 \begin_inset Flex CharStyle:Code
3084 \begin_layout Plain Layout
3091 Then you could write a shell script such as this one:
3094 \begin_layout Standard
3095 \begin_inset listings
3099 \begin_layout Plain Layout
3104 \begin_layout Plain Layout
3109 \begin_layout Plain Layout
3111 TOFILE=`basename $2`
3114 \begin_layout Plain Layout
3116 cp $FROMFILE /home/you/pdf/$TOFILE
3121 Save that in your local LyX directory---say,
3122 \begin_inset Flex CharStyle:Code
3125 \begin_layout Plain Layout
3126 /home/you/.lyx/scripts/pdfcopier.sh
3131 ---and make it executable, if you need to do so on your platform.
3133 \begin_inset Flex CharStyle:MenuItem
3136 \begin_layout Plain Layout
3137 Tools\SpecialChar \menuseparator
3144 \begin_inset Flex CharStyle:MenuItem
3147 \begin_layout Plain Layout
3153 format---or one of the other pdf formats---and enter
3154 \begin_inset Flex CharStyle:Code
3157 \begin_layout Plain Layout
3158 pdfcopier.sh $$i $$o
3164 \begin_inset Flex CharStyle:MenuItem
3167 \begin_layout Plain Layout
3177 \begin_layout Standard
3178 Copiers are used by LyX in various of its own conversions.
3179 For example, if appropriate programs are found, LyX will automatically
3180 install copiers for the
3181 \begin_inset Flex CharStyle:MenuItem
3184 \begin_layout Plain Layout
3191 \begin_inset Flex CharStyle:MenuItem
3194 \begin_layout Plain Layout
3196 \begin_inset space ~
3205 When these formats are exported, the copier sees that not just the main
3206 HTML file but various associated files (style files, images, etc.) are also
3208 All these files are written to a subdirectory of the directory in which
3209 the original LyX file was found.
3213 \begin_layout Plain Layout
3214 This copier can be customized.
3216 \begin_inset Quotes eld
3220 \begin_inset Quotes erd
3223 argument takes a comma-separated list of extensions to be copied; if it
3224 is omitted, all files will be copied.
3226 \begin_inset Quotes eld
3230 \begin_inset Quotes erd
3233 argument determines the extension added to the generated directory.
3235 \begin_inset Quotes eld
3239 \begin_inset Flex CharStyle:MenuItem
3242 \begin_layout Plain Layout
3249 \begin_inset Quotes erd
3252 , so HTML generated from
3253 \begin_inset Flex CharStyle:MenuItem
3256 \begin_layout Plain Layout
3257 /path/to/filename.lyx
3263 \begin_inset Flex CharStyle:MenuItem
3266 \begin_layout Plain Layout
3267 /path/to/filename.html.LyXconv
3281 \begin_layout Subsection
3282 \begin_inset CommandInset label
3284 name "sub:Converters"
3291 \begin_layout Standard
3292 You can define your own Converters to, uhh, convert files between different
3295 \begin_inset Flex CharStyle:MenuItem
3298 \begin_layout Plain Layout
3299 Tools\SpecialChar \menuseparator
3300 Preferences\SpecialChar \menuseparator
3301 File Handling\SpecialChar \menuseparator
3310 \begin_layout Standard
3311 To define a new converter, select the
3312 \begin_inset Flex CharStyle:MenuItem
3315 \begin_layout Plain Layout
3317 \begin_inset space ~
3326 \begin_inset space \thinspace{}
3330 \begin_inset Flex CharStyle:MenuItem
3333 \begin_layout Plain Layout
3335 \begin_inset space ~
3343 from the drop-down lists, enter the command needed for the conversion,
3345 \begin_inset Flex CharStyle:MenuItem
3348 \begin_layout Plain Layout
3355 Several variables can be used in the definition of converters:
3358 \begin_layout Labeling
3359 \labelwidthstring 00.00.0000
3360 \begin_inset Flex CharStyle:Code
3363 \begin_layout Plain Layout
3369 The LyX system directory
3372 \begin_layout Labeling
3373 \labelwidthstring 00.00.0000
3374 \begin_inset Flex CharStyle:Code
3377 \begin_layout Plain Layout
3386 \begin_layout Labeling
3387 \labelwidthstring 00.00.0000
3388 \begin_inset Flex CharStyle:Code
3391 \begin_layout Plain Layout
3400 \begin_layout Labeling
3401 \labelwidthstring 00.00.0000
3402 \begin_inset Flex CharStyle:Code
3405 \begin_layout Plain Layout
3411 The base filename of the input file (i.e., without the extension)
3414 \begin_layout Labeling
3415 \labelwidthstring 00.00.0000
3416 \begin_inset Flex CharStyle:Code
3419 \begin_layout Plain Layout
3425 The path to the input file
3428 \begin_layout Standard
3430 \begin_inset Flex CharStyle:MenuItem
3433 \begin_layout Plain Layout
3435 \begin_inset space ~
3443 field you can enter the following flags, separated by commas:
3446 \begin_layout Labeling
3447 \labelwidthstring 00.00.0000
3448 \begin_inset Flex CharStyle:Code
3451 \begin_layout Plain Layout
3457 This converter runs some form of LaTeX.
3458 This will make LyX's LaTeX error logs available.
3461 \begin_layout Labeling
3462 \labelwidthstring 00.00.0000
3463 \begin_inset Flex CharStyle:Code
3466 \begin_layout Plain Layout
3473 \begin_inset Flex CharStyle:MenuItem
3476 \begin_layout Plain Layout
3482 file for the conversion.
3485 \begin_layout Labeling
3486 \labelwidthstring 00.00.0000
3487 \begin_inset Flex CharStyle:Code
3490 \begin_layout Plain Layout
3499 \begin_layout Standard
3500 The following three flags are not really flags at all because they take
3502 \begin_inset Flex CharStyle:MenuItem
3505 \begin_layout Plain Layout
3507 \begin_inset space ~
3511 \begin_inset space ~
3522 \begin_layout Labeling
3523 \labelwidthstring 00.00.0000
3524 \begin_inset Flex CharStyle:Code
3527 \begin_layout Plain Layout
3533 If set, the converter's standard error will be redirected to a file
3534 \begin_inset Flex CharStyle:Code
3537 \begin_layout Plain Layout
3543 , and the script given as argument will be run as:
3544 \begin_inset Flex CharStyle:Code
3547 \begin_layout Plain Layout
3548 script <infile.out >infile.log
3554 The argument may contain
3555 \begin_inset Flex CharStyle:Code
3558 \begin_layout Plain Layout
3567 \begin_layout Labeling
3568 \labelwidthstring 00.00.0000
3569 \begin_inset Flex CharStyle:Code
3572 \begin_layout Plain Layout
3578 The name of the directory in which the converter will dump the generated
3580 LyX will not create this directory, and it does not copy anything into
3581 it, though it will copy this directory to the destination.
3582 The argument may contain
3583 \begin_inset Flex CharStyle:Code
3586 \begin_layout Plain Layout
3592 , which will be replaced by the basename of the input and output files,
3593 respectively, when the directory is copied.
3594 \begin_inset Newline newline
3597 Note that resultdir and usetempdir make no sense together.
3598 The latter will be ignored if the former is given.
3601 \begin_layout Labeling
3602 \labelwidthstring 00.00.0000
3603 \begin_inset Flex CharStyle:Code
3606 \begin_layout Plain Layout
3612 Determines the output filename and may, contain
3613 \begin_inset Flex CharStyle:Code
3616 \begin_layout Plain Layout
3623 Sensible only with resultdir and optional even then; if not given, it defaults
3627 \begin_layout Standard
3628 None of these last three are presently used in any of the converters that
3629 are installed with LyX.
3633 \begin_layout Standard
3634 You do not have to define converters between all the formats between which
3635 you want to convert.
3636 For example, you will note that there is no `LyX to PostScript®' converter,
3637 but LyX will export PostScript®.
3638 It does so by first creating a LaTeX file (no converter needs to be defined
3639 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
3640 and finally converting the resulting DVI file to PostScript®.
3641 LyX finds such `chains' of converters automatically, and it will always
3642 choose the shortest possible chain.
3643 You can, though, still define multiple conversion methods between file
3645 For example, the standard LyX configuration provides three ways to convert
3646 LaTeX to PDF: Directly, using
3647 \begin_inset Flex CharStyle:MenuItem
3650 \begin_layout Plain Layout
3656 ; via (DVI and) PostScript®, using
3657 \begin_inset Flex CharStyle:MenuItem
3660 \begin_layout Plain Layout
3667 \begin_inset Flex CharStyle:MenuItem
3670 \begin_layout Plain Layout
3677 To define such alternate chains, you must define multiple target `file
3678 formats', as described in section
3679 \begin_inset CommandInset ref
3681 reference "sub:Formats"
3686 For example, in the standard configuration, the formats named
3687 \begin_inset Flex CharStyle:MenuItem
3690 \begin_layout Plain Layout
3697 \begin_inset Flex CharStyle:MenuItem
3700 \begin_layout Plain Layout
3707 \begin_inset Flex CharStyle:MenuItem
3710 \begin_layout Plain Layout
3716 are defined, all of which share the extension
3717 \begin_inset Flex CharStyle:MenuItem
3720 \begin_layout Plain Layout
3726 , and which correspond to the conversion methods just mentioned.
3729 \begin_layout Section
3733 \begin_layout Standard
3734 The settings in this section affect the output LyX produces.
3737 \begin_layout Subsection
3738 Plain text export options
3741 \begin_layout Standard
3743 There are a couple of commands that can be used to
3744 \begin_inset Quotes eld
3748 \begin_inset Quotes erd
3751 exported plain text files.
3752 Note that LyX automatically detects and tries to use the best settings
3753 for your system at installation time, but you can modify them in the
3754 \begin_inset Flex CharStyle:MenuItem
3757 \begin_layout Plain Layout
3758 Output\SpecialChar \menuseparator
3764 dialog if you disagree with its interpretation.
3767 \begin_layout Description
3768 \begin_inset Flex CharStyle:Code
3771 \begin_layout Plain Layout
3777 This option defines the command used to produce better plain text tables
3779 \begin_inset Flex CharStyle:Code
3782 \begin_layout Plain Layout
3788 UNIX-commands (refer to their manpages for more information about them).
3789 Setting this as empty tells LyX to use the internal (inferior) formatter.
3792 \begin_layout Description
3793 \begin_inset Flex CharStyle:Code
3796 \begin_layout Plain Layout
3802 With this command you can set the default line length of the plain text
3804 Setting it to 0 means that no line breaks will be inserted except between
3805 paragraphs and the like.
3808 \begin_layout Section
3812 \begin_layout Standard
3813 There are many other configuration options that can be used to customize
3815 Most of them are sufficiently self-explanatory that we have not felt it
3816 necessary to document them here.
3818 \begin_inset CommandInset href
3820 name "mailing lists"
3821 target "http://www.lyx.org/mailing.php"
3825 if you need some more information.
3828 \begin_layout Chapter
3829 Internationalizing LyX
3830 \begin_inset CommandInset label
3839 \begin_layout Standard
3840 LyX supports using a translated interface.
3841 Last time we checked, LyX provided text in thirty languages.
3842 The language of choice is called your
3847 (For further reading on locale settings, see also the documentation for
3848 locale that comes with your operating system.
3849 For Linux, the manual page for
3850 \begin_inset Flex CharStyle:Code
3853 \begin_layout Plain Layout
3859 could be a good place to start).
3862 \begin_layout Standard
3863 Notice that these translations will work, but do contain a few flaws.
3864 In particular, all dialogs have been designed with the English text in
3865 mind, which means that some of the translated text will be too large to
3866 fit within the space allocated.
3867 This is only a display problem and will not cause any harm.
3868 Also, you will find that some of the translations do not define shortcut
3869 keys for everything.
3870 Sometimes, there are simply not enough free letters to do it.
3871 Other times, the translator just hasn't got around to doing it yet.
3872 Our localization team, which you may wish to join,
3876 \begin_layout Plain Layout
3877 If you are a fluent speaker of a language other than English, joining these
3878 teams is a great way to give back to the LyX community!
3883 will of course try to fix these shortcomings in future versions of LyX.
3886 \begin_layout Section
3890 \begin_layout Subsection
3891 Translating the graphical user interface (text messages).
3894 \begin_layout Standard
3896 \begin_inset Flex CharStyle:Code
3899 \begin_layout Plain Layout
3905 library to handle the internationalization of the interface.
3906 To have LyX speak your favorite language in all menus and dialogs, you
3908 \begin_inset Flex CharStyle:Code
3911 \begin_layout Plain Layout
3917 -file for that language.
3918 When this is available, you'll have to generate a
3919 \begin_inset Flex CharStyle:Code
3922 \begin_layout Plain Layout
3928 -file from it and install the
3929 \begin_inset Flex CharStyle:Code
3932 \begin_layout Plain Layout
3939 The process of doing all of this is explained in the documentation for
3941 \begin_inset Flex CharStyle:Code
3944 \begin_layout Plain Layout
3951 It is possible to do this just for yourself, but if you're going to do
3952 it, you might as well share the results of your labors with the rest of
3954 Send a message to the LyX developers' list for more information about how
3958 \begin_layout Standard
3959 In short, this is what you should do (xx denotes the language code):
3962 \begin_layout Itemize
3963 Check out the LyX source code.
3965 \begin_inset CommandInset href
3967 name "information on the web"
3968 target "http://www.lyx.org/devel/cvs.php"
3975 \begin_layout Itemize
3977 \begin_inset Flex CharStyle:Code
3980 \begin_layout Plain Layout
3986 to the folder of the
3987 \begin_inset Flex CharStyle:Code
3990 \begin_layout Plain Layout
3998 \begin_inset Flex CharStyle:Code
4001 \begin_layout Plain Layout
4009 \begin_inset Flex CharStyle:Code
4012 \begin_layout Plain Layout
4018 doesn't exist anywhere, it can be remade with the console command
4019 \begin_inset Flex CharStyle:Code
4022 \begin_layout Plain Layout
4028 in that directory, or you can use an existing po-file for some other language
4032 \begin_layout Itemize
4034 \begin_inset Flex CharStyle:Code
4037 \begin_layout Plain Layout
4047 \begin_layout Plain Layout
4048 This is just a text file, so it can be edited in any text editor.
4049 But there are also specialized programs that support such editing, such
4054 (for all platforms) or
4063 contains a `mode' for editing
4064 \begin_inset Flex CharStyle:Code
4067 \begin_layout Plain Layout
4078 For some menu- and widget-labels, there are also shortcut keys that should
4080 Those keys are marked after a `|', and should be translated according to
4081 the words and phrases of the language.
4082 You should also fill also out the information at the beginning of the new
4084 \begin_inset Flex CharStyle:Code
4087 \begin_layout Plain Layout
4093 -file with your email-address, etc., so people know where to reach you with
4094 suggestions and entertaining flames.
4097 \begin_layout Standard
4098 If you are just doing this on your own, then:
4101 \begin_layout Itemize
4103 \begin_inset Flex CharStyle:Code
4106 \begin_layout Plain Layout
4113 This can be done with
4114 \begin_inset Flex CharStyle:Code
4117 \begin_layout Plain Layout
4118 msgfmt -o xx.mo < xx.po
4126 \begin_layout Itemize
4128 \begin_inset Flex CharStyle:Code
4131 \begin_layout Plain Layout
4137 -file to your locale-tree, at the correct directory for application messages
4142 xx, and under the name
4143 \begin_inset Flex CharStyle:Code
4146 \begin_layout Plain Layout
4154 \begin_inset Flex CharStyle:Code
4157 \begin_layout Plain Layout
4158 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
4168 \begin_layout Standard
4169 As said, however, it would be best if the new
4170 \begin_inset Flex CharStyle:Code
4173 \begin_layout Plain Layout
4179 -file could be added to the LyX distribution, so others can use it.
4180 Adding it involves making additional changes to LyX.
4181 So send an email to the developers' mailing list if you're interested in
4185 \begin_layout Subsubsection
4189 \begin_layout Standard
4190 Sometimes it turns out that one English message needs to be translated into
4191 different messages in the target language.
4192 One example is the message
4193 \begin_inset Flex CharStyle:Code
4196 \begin_layout Plain Layout
4202 which has the German translation
4210 , depending upon exactly what the English
4211 \begin_inset Quotes eld
4215 \begin_inset Quotes erd
4220 \begin_inset Flex CharStyle:Code
4223 \begin_layout Plain Layout
4229 does not handle such ambigous translations.
4230 Therefore you have to add some context information to the message: Instead
4232 \begin_inset Flex CharStyle:Code
4235 \begin_layout Plain Layout
4242 \begin_inset Flex CharStyle:Code
4245 \begin_layout Plain Layout
4246 To[[as in 'From format x to format y']]
4252 \begin_inset Flex CharStyle:Code
4255 \begin_layout Plain Layout
4256 To[[as in 'From page x to page y']].
4261 Now the two occurences of
4262 \begin_inset Flex CharStyle:Code
4265 \begin_layout Plain Layout
4272 \begin_inset Flex CharStyle:Code
4275 \begin_layout Plain Layout
4281 and can be translated correctly to
4292 \begin_layout Standard
4293 Of course the context information needs to be stripped off the original
4294 message when no translation is used.
4295 Therefore you have to put it in double square brackets at the end of the
4296 message (see the example above).
4297 The translation mechanism of LyX ensures that everything in double square
4298 brackets at the end of messages is removed before displaying the message.
4301 \begin_layout Subsection
4302 Translating the documentation.
4305 \begin_layout Standard
4306 The online documentation (in the
4307 \begin_inset Flex CharStyle:MenuItem
4310 \begin_layout Plain Layout
4320 -menu) can (and should!) be translated.
4321 If there are translated versions of the documentation available
4325 \begin_layout Plain Layout
4326 As of March 2008, at least some of the documents have been translated into
4327 fourteen languages, with the Tutorial available in a few more.
4332 and the locale is set accordingly, these will be used automagically by
4334 LyX looks for translated versions as
4335 \begin_inset Flex CharStyle:Code
4338 \begin_layout Plain Layout
4339 LyXDir/doc/xx_DocName.lyx
4345 \begin_inset Flex CharStyle:Code
4348 \begin_layout Plain Layout
4354 is the code for the language currently in use.
4355 If there are no translated documents, the default English versions will
4357 Note that the translated versions must have the same filenames (
4358 \begin_inset Flex CharStyle:Code
4361 \begin_layout Plain Layout
4367 above) as the original.
4368 If you feel up to translating the documentation (an excellent way to proof-read
4369 the original documentation by the way!), there are a few things you should
4373 \begin_layout Itemize
4375 \begin_inset Flex CharStyle:Code
4378 \begin_layout Plain Layout
4384 , the guide to writing LyX documentation.
4385 Pay special attention to the translator's section.
4388 \begin_layout Itemize
4389 Check out the documentation translation web page at
4390 \begin_inset CommandInset href
4392 name "http://www.devel.lyx.org"
4393 target "http://www.devel.lyx.org"
4398 That way, you can find out which (if any) documents have already been translate
4399 d into your language.
4400 You can also find out who (if anyone) is organizing the effort to translate
4401 the documentation into your language.
4402 If no one is organizing the effort, please let us know that you're interested.
4405 \begin_layout Standard
4406 Once you get to actually translating, here's a few hints for you that may
4410 \begin_layout Itemize
4411 Join the documentation team! There is information on how to do that in
4412 \begin_inset Flex CharStyle:Code
4415 \begin_layout Plain Layout
4422 \begin_inset Flex CharStyle:MenuItem
4425 \begin_layout Plain Layout
4430 elp\SpecialChar \menuseparator
4440 ), which by the way is the first document you should translate.
4443 \begin_layout Itemize
4444 Learn the typographic conventions for the language you are translating to.
4445 Typography is an ancient art and over the centuries, a great variety of
4446 conventions have developed throughout different parts of the world.
4447 Also study the professional terminology amongst typographers in your country.
4448 Inventing your own terminology will only confuse the users.
4451 (Warning! Typography is addictive!)
4454 \begin_layout Itemize
4455 Make a copy of the document.
4456 This will be your working copy.
4457 You can use this as your personal translated help-file by placing it in
4459 \begin_inset Flex CharStyle:Code
4462 \begin_layout Plain Layout
4471 \begin_layout Itemize
4472 Sometimes the original document (from the LyX-team) will be updated.
4473 Use the source viewer at
4474 \begin_inset CommandInset href
4476 name "http://www.lyx.org/trac/timeline"
4477 target "http://www.lyx.org/trac/timeline"
4481 to see what has been changed.
4482 That way you can easily see which parts of the translated document need
4486 \begin_layout Standard
4487 If you ever find an error in the original document, fix it and notify the
4488 rest of the documentation team of the changes! (You didn't forget to join
4489 the documentation team, did you?)
4492 \begin_layout Standard
4493 \begin_inset Branch OutDated
4496 \begin_layout Section
4497 International Keyboard Support
4500 \begin_layout Standard
4503 [Editor's Note: The following section is by
4511 It needs to be fixed to conform to the new Documentation Style sheet and
4512 to make use of the new v1.0 features.
4513 The whole thing also needs to be merged with the section following it.-jw
4514 It may also be badly out of date.-rh (2008)]
4517 \begin_layout Subsection
4518 Defining Own Keymaps: Keymap File Format
4521 \begin_layout Standard
4522 Let's look at a keyboard definition file a little closer.
4523 It is a plain text file defining
4526 \begin_layout Itemize
4527 key-to-key or key-to-string translations
4530 \begin_layout Itemize
4534 \begin_layout Itemize
4535 dead keys exceptions
4538 \begin_layout Standard
4539 To define key-to-key or key-to-string translation, use this command:
4542 \begin_layout Quotation
4543 \begin_inset Flex CharStyle:Code
4546 \begin_layout Plain Layout
4555 \begin_inset Flex CharStyle:Code
4558 \begin_layout Plain Layout
4567 \begin_layout Standard
4569 \begin_inset Flex CharStyle:Code
4572 \begin_layout Plain Layout
4578 is the key to be translated and
4579 \begin_inset Flex CharStyle:Code
4582 \begin_layout Plain Layout
4588 is the string to be inserted into the document.
4589 To define dead keys, use:
4592 \begin_layout Quotation
4593 \begin_inset Flex CharStyle:Code
4596 \begin_layout Plain Layout
4605 \begin_inset Flex CharStyle:Code
4608 \begin_layout Plain Layout
4617 \begin_layout Standard
4619 \begin_inset Flex CharStyle:Code
4622 \begin_layout Plain Layout
4628 is a keyboard key and
4629 \begin_inset Flex CharStyle:Code
4632 \begin_layout Plain Layout
4639 The following dead keys are supported (shortcut name is in parentheses):
4642 \begin_layout Quotation
4646 \begin_inset space \hfill{}
4652 \begin_layout Quotation
4654 \begin_inset space \hfill{}
4660 \begin_layout Quotation
4662 \begin_inset space \hfill{}
4668 \begin_layout Quotation
4670 \begin_inset space \hfill{}
4676 \begin_layout Quotation
4678 \begin_inset space \hfill{}
4684 \begin_layout Quotation
4686 \begin_inset space \hfill{}
4693 \begin_layout Plain Layout
4705 \begin_layout Quotation
4707 \begin_inset space \hfill{}
4713 \begin_layout Quotation
4715 \begin_inset space \hfill{}
4722 \begin_layout Plain Layout
4734 \begin_layout Quotation
4736 \begin_inset space \hfill{}
4742 \begin_layout Quotation
4744 \begin_inset space \hfill{}
4750 \begin_layout Quotation
4752 \begin_inset space \hfill{}
4759 \begin_layout Plain Layout
4771 \begin_layout Quotation
4773 \begin_inset space \hfill{}
4780 \begin_layout Plain Layout
4792 \begin_layout Quotation
4794 \begin_inset space \hfill{}
4800 \begin_layout Quotation
4801 hungarian umlaut (hug)
4802 \begin_inset space \hfill{}
4808 \begin_layout Quotation
4810 \begin_inset space \hfill{}
4816 \begin_layout Quotation
4818 \begin_inset space \hfill{}
4825 \begin_layout Plain Layout
4837 \begin_layout Standard
4838 Since in many international keyboards there are exceptions to what some
4839 dead keys should do, you can define them using
4842 \begin_layout Quotation
4843 \begin_inset Flex CharStyle:Code
4846 \begin_layout Plain Layout
4854 deadkey key outstring
4857 \begin_layout Standard
4858 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
4862 \begin_layout Quotation
4863 \begin_inset Flex CharStyle:Code
4866 \begin_layout Plain Layout
4879 \begin_layout Standard
4880 to make it work correctly.
4881 Also, you have to define as exceptions dead keys over i and j, to remove
4882 the dot from them before inserting an accent mark.
4883 I will change this when the time comes, but so far I haven't had time.
4886 \begin_layout Standard
4887 Oh, and about characters: backslash is escaped, so to enter it, you'll need
4890 \begin_inset Flex CharStyle:Code
4893 \begin_layout Plain Layout
4899 have different meaning.
4901 \begin_inset Flex CharStyle:Code
4904 \begin_layout Plain Layout
4910 marks comments, quotes start and end LaTeX-style commands.
4911 To enter quote, you'll need to use
4912 \begin_inset Flex CharStyle:Code
4915 \begin_layout Plain Layout
4924 \begin_inset Flex CharStyle:Code
4927 \begin_layout Plain Layout
4934 \begin_inset Flex CharStyle:Code
4937 \begin_layout Plain Layout
4948 \begin_layout Standard
4949 If you make a keyboard description file that works for your language, please
4950 mail it to me, so I can include it in the next keymap distribution.
4953 \begin_layout Standard
4954 More keywords will be supported in keymap configuration file in future,
4958 \begin_layout Itemize
4959 \begin_inset Flex CharStyle:Code
4962 \begin_layout Plain Layout
4973 \begin_inset space \hfill{}
4977 \begin_inset Flex CharStyle:Code
4980 \begin_layout Plain Layout
4989 \begin_layout Itemize
4990 \begin_inset Flex CharStyle:Code
4993 \begin_layout Plain Layout
5004 \begin_inset space \hfill{}
5008 \begin_inset Flex CharStyle:Code
5011 \begin_layout Plain Layout
5017 an external keymap translation program
5020 \begin_layout Standard
5021 Also, it should look into
5022 \begin_inset Flex CharStyle:Code
5025 \begin_layout Plain Layout
5031 file for defaults, too (for example, a
5032 \begin_inset Flex CharStyle:Code
5035 \begin_layout Plain Layout
5043 option to include default keyboard).
5051 \begin_layout Section
5052 \begin_inset CommandInset label
5058 International Keymap Stuff
5061 \begin_layout Standard
5062 \begin_inset Note Note
5065 \begin_layout Plain Layout
5066 In doing the revisions on this document in March 2008, I did not look over
5067 this stuff, as I do not understand it.
5068 It would be good if someone else could do so.
5076 \begin_layout Standard
5077 The next two sections describe the
5078 \begin_inset Flex CharStyle:Code
5081 \begin_layout Plain Layout
5090 \begin_inset Flex CharStyle:Code
5093 \begin_layout Plain Layout
5101 file syntax in detail.
5102 These sections should help you design your own key map if the ones provided
5103 do not meet your needs.
5106 \begin_layout Subsection
5110 \begin_layout Standard
5114 \begin_inset Flex CharStyle:Code
5117 \begin_layout Plain Layout
5123 file maps keystrokes to characters or strings.
5124 As the name suggests, it sets a keyboard mapping.
5126 \begin_inset Flex CharStyle:Code
5129 \begin_layout Plain Layout
5140 \begin_inset Flex CharStyle:Code
5143 \begin_layout Plain Layout
5158 \begin_inset Flex CharStyle:Code
5161 \begin_layout Plain Layout
5174 \begin_inset Flex CharStyle:Code
5177 \begin_layout Plain Layout
5186 \begin_inset Flex CharStyle:Code
5189 \begin_layout Plain Layout
5197 are described in this section.
5200 \begin_layout Labeling
5201 \labelwidthstring 00.00.0000
5202 \begin_inset Flex CharStyle:Code
5205 \begin_layout Plain Layout
5213 Map a character to a string
5216 \begin_layout LyX-Code
5231 \begin_layout Standard
5264 the double-quote (")
5281 must be escaped with a preceding backslash (
5292 \begin_layout Standard
5294 \begin_inset Flex CharStyle:MenuItem
5297 \begin_layout Plain Layout
5305 statement to cause the symbol
5306 \begin_inset Flex CharStyle:MenuItem
5309 \begin_layout Plain Layout
5317 to be output for the keystroke
5318 \begin_inset Flex CharStyle:MenuItem
5321 \begin_layout Plain Layout
5332 \begin_layout LyX-Code
5338 \begin_layout Labeling
5339 \labelwidthstring 00.00.0000
5340 \begin_inset Flex CharStyle:Code
5343 \begin_layout Plain Layout
5351 Specify an accent character
5354 \begin_layout LyX-Code
5363 \begin_layout Standard
5364 This will make the cha
5402 This is the dead key
5406 \begin_layout Plain Layout
5413 refers to a key that does not produce a character by itself, but when followed
5414 with another key, produces the desired accent character.
5415 For example, a German characte
5417 r with an umlaut like
5427 can be produced in this manner.
5436 \begin_layout Standard
5449 and then another key not in
5466 followed by the other, unallowed key, as output.
5470 \begin_inset Flex CharStyle:MenuItem
5473 \begin_layout Plain Layout
5481 cancels a dead key, so if
5492 \begin_inset Flex CharStyle:MenuItem
5495 \begin_layout Plain Layout
5504 , the cursor will not go one position backwards but will instead cancel
5520 might have had on the next keystroke.
5524 \begin_layout Standard
5525 The following example specifies that the character ' is to be an acute accent,
5526 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
5529 \begin_layout LyX-Code
5532 kmod ' acute aeiouAEIOU
5535 \begin_layout Labeling
5536 \labelwidthstring 00.00.0000
5537 \begin_inset Flex CharStyle:Code
5540 \begin_layout Plain Layout
5546 Specify an exception to the accent character
5549 \begin_layout LyX-Code
5558 \begin_layout Standard
5559 This defines an exce
5600 have been assigned a keystroke with a previous
5603 \begin_inset Flex CharStyle:Code
5606 \begin_layout Plain Layout
5630 must not belong in the
5682 If such a declaration does not exist in
5690 \begin_inset Flex CharStyle:Code
5693 \begin_layout Plain Layout
5733 \begin_inset Flex CharStyle:Code
5736 \begin_layout Plain Layout
5750 \begin_layout Standard
5751 The following command produces causes äi to be produced when you enter acute-i
5755 \begin_layout LyX-Code
5769 \begin_layout Labeling
5770 \labelwidthstring 00.00.0000
5771 \begin_inset Flex CharStyle:Code
5774 \begin_layout Plain Layout
5780 Combine two accent characters
5783 \begin_layout LyX-Code
5789 accent1 accent2 allowed
5792 \begin_layout Standard
5793 This one is getting pretty esoteric.
5794 It allows you to combine the effect
5850 \begin_inset Flex CharStyle:Code
5853 \begin_layout Plain Layout
5881 \begin_layout Standard
5882 Consider this example from the
5883 \begin_inset Flex CharStyle:Code
5886 \begin_layout Plain Layout
5897 \begin_layout LyX-Code
5900 kmod ; acute aeioyvhAEIOYVH
5904 kcomb acute umlaut iyIY
5907 \begin_layout Standard
5908 This allows you to press
5909 \begin_inset Flex CharStyle:MenuItem
5912 \begin_layout Plain Layout
5920 and get the effect of
5921 \begin_inset Flex CharStyle:Code
5924 \begin_layout Plain Layout
5943 in this case cancels the last dead key, so if you press
5944 \begin_inset Flex CharStyle:MenuItem
5947 \begin_layout Plain Layout
5956 \begin_inset Flex CharStyle:Code
5959 \begin_layout Plain Layout
5972 \begin_layout Subsection
5976 \begin_layout Standard
5978 \begin_inset Flex CharStyle:Code
5981 \begin_layout Plain Layout
5989 mapping is performed, a
5990 \begin_inset Flex CharStyle:Code
5993 \begin_layout Plain Layout
6003 file maps the strings that the symbols generate to characters in the current
6005 The LyX distribution currently includes at least the
6006 \begin_inset Flex CharStyle:Code
6009 \begin_layout Plain Layout
6018 \begin_inset Flex CharStyle:Code
6021 \begin_layout Plain Layout
6032 \begin_layout Standard
6034 \begin_inset Flex CharStyle:Code
6037 \begin_layout Plain Layout
6045 file is a sequence of declarations of the form
6048 \begin_layout LyX-Code
6061 \begin_layout Standard
6062 For example, in order to map
6063 \begin_inset Flex CharStyle:MenuItem
6066 \begin_layout Plain Layout
6076 to the corresponding character in the iso-8859-1 set (233), the following
6080 \begin_layout LyX-Code
6088 \begin_layout Standard
6090 \begin_inset Flex CharStyle:Code
6093 \begin_layout Plain Layout
6102 \begin_inset Flex CharStyle:Code
6105 \begin_layout Plain Layout
6123 the same character can apply to more than one string.
6125 \begin_inset Flex CharStyle:Code
6128 \begin_layout Plain Layout
6139 \begin_layout LyX-Code
6151 \begin_inset Newline newline
6167 \begin_layout Standard
6168 If LyX cannot find a mapping for the string produced by the keystroke or
6169 a deadkey sequence, it will check if it looks like an accented char and
6170 try to draw an accent over the character on screen.
6173 \begin_layout Subsection
6177 \begin_layout Standard
6178 There is a second way to add support for international characters through
6179 so-called dead-keys.
6180 A dead-key works in combination with a letter to produce an accented character.
6181 Here, we'll explain how to create a really simple dead-key to illustrate
6185 \begin_layout Standard
6186 Suppose you happen to need the circumflex character,
6187 \begin_inset Quotes eld
6191 \begin_inset Quotes erd
6196 \begin_inset Flex CharStyle:MenuItem
6199 \begin_layout Plain Layout
6206 \begin_inset space ~
6210 \begin_inset Flex CharStyle:MenuItem
6213 \begin_layout Plain Layout
6219 ] to the LyX command
6220 \begin_inset Flex CharStyle:Code
6223 \begin_layout Plain Layout
6230 \begin_inset Flex CharStyle:Code
6233 \begin_layout Plain Layout
6240 Now, whenever you type the
6241 \begin_inset Flex CharStyle:MenuItem
6244 \begin_layout Plain Layout
6250 -key followed by a letter, that letter will have a circumflex accent on
6252 For example, the sequence
6253 \begin_inset Quotes eld
6257 \begin_inset Flex CharStyle:MenuItem
6260 \begin_layout Plain Layout
6267 \begin_inset Quotes erd
6270 produces the letter:
6271 \begin_inset Quotes eld
6275 \begin_inset Quotes erd
6279 If you tried to type
6280 \begin_inset Quotes eld
6284 \begin_inset Flex CharStyle:MenuItem
6287 \begin_layout Plain Layout
6294 \begin_inset Quotes erd
6297 , however, LyX will complain with a beep, since a
6298 \begin_inset Quotes eld
6302 \begin_inset Flex CharStyle:MenuItem
6305 \begin_layout Plain Layout
6312 \begin_inset Quotes erd
6315 never takes a circumflex accent.
6317 \begin_inset Flex CharStyle:MenuItem
6320 \begin_layout Plain Layout
6326 after a dead-key produces the bare-accent.
6327 Please note this last point! If you bind a key to a dead-key, you'll need
6328 to rebind the character on that key to yet another key.
6330 \begin_inset Flex CharStyle:MenuItem
6333 \begin_layout Plain Layout
6339 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
6342 \begin_layout Standard
6343 One common way to bind dead-keys is to use
6344 \begin_inset Flex CharStyle:MenuItem
6347 \begin_layout Plain Layout
6354 \begin_inset Flex CharStyle:MenuItem
6357 \begin_layout Plain Layout
6364 \begin_inset Flex CharStyle:MenuItem
6367 \begin_layout Plain Layout
6373 in combination with an accent, like
6374 \begin_inset Quotes eld
6378 \begin_inset Flex CharStyle:MenuItem
6381 \begin_layout Plain Layout
6388 \begin_inset Quotes erd
6392 \begin_inset Quotes eld
6396 \begin_inset Flex CharStyle:MenuItem
6399 \begin_layout Plain Layout
6406 \begin_inset Quotes erd
6410 \begin_inset Quotes eld
6414 \begin_inset Flex CharStyle:MenuItem
6417 \begin_layout Plain Layout
6424 \begin_inset Quotes erd
6428 Another way involves using
6429 \begin_inset Flex CharStyle:Code
6432 \begin_layout Plain Layout
6439 \begin_inset Flex CharStyle:Code
6442 \begin_layout Plain Layout
6448 to set up the special
6449 \begin_inset Flex CharStyle:Code
6452 \begin_layout Plain Layout
6460 \begin_inset Flex CharStyle:Code
6463 \begin_layout Plain Layout
6469 acts in some ways just like
6470 \begin_inset Flex CharStyle:MenuItem
6473 \begin_layout Plain Layout
6479 and permits you to bind keys to accented characters.
6480 You can also turn keys into dead-keys by binding them to something like
6482 \begin_inset Flex CharStyle:Code
6485 \begin_layout Plain Layout
6491 and then binding this symbolic key to the corresponding LyX command.
6495 \begin_layout Plain Layout
6500 : This is exactly what I do in my
6501 \begin_inset Flex CharStyle:Code
6504 \begin_layout Plain Layout
6511 \begin_inset Flex CharStyle:Code
6514 \begin_layout Plain Layout
6522 \begin_inset Flex CharStyle:MenuItem
6525 \begin_layout Plain Layout
6527 \begin_inset space ~
6536 \begin_inset Flex CharStyle:Code
6539 \begin_layout Plain Layout
6545 and a bunch of these
6546 \begin_inset Quotes eld
6550 \begin_inset Flex CharStyle:Code
6553 \begin_layout Plain Layout
6560 \begin_inset Quotes erd
6563 symbolic keys bound such things as
6564 \begin_inset Flex CharStyle:MenuItem
6567 \begin_layout Plain Layout
6569 \begin_inset space ~
6578 \begin_inset Flex CharStyle:MenuItem
6581 \begin_layout Plain Layout
6583 \begin_inset space ~
6592 This is how I produce my accented characters.
6597 You can make just about anything into the
6598 \begin_inset Flex CharStyle:Code
6601 \begin_layout Plain Layout
6608 \begin_inset Flex CharStyle:MenuItem
6611 \begin_layout Plain Layout
6617 keys, a spare function key, etc.
6618 As for the LyX commands that produce accents, check the entry for
6619 \begin_inset Flex CharStyle:Code
6622 \begin_layout Plain Layout
6633 You'll find the complete list there.
6636 \begin_layout Subsection
6637 Saving your Language Configuration
6640 \begin_layout Standard
6641 \begin_inset CommandInset label
6647 You can edit your preferences so that your desired language environment
6648 is automatically configured when LyX starts up, via the
6649 \begin_inset Flex CharStyle:MenuItem
6652 \begin_layout Plain Layout
6657 dit\SpecialChar \menuseparator
6670 \begin_layout Chapter
6671 Installing New Document Classes, Layouts, and Templates
6672 \begin_inset CommandInset label
6674 name "chap:textclass"
6682 \begin_layout Plain Layout
6683 Installing New Document Classes
6691 \begin_layout Standard
6692 In this chapter, we describe the procedures for creating and installing
6693 new LyX layout and template files, as well as offer a refresher on correctly
6694 installing new LaTeX document classes.
6695 Some definitions: a document class is a LaTeX file (usually ending in
6696 \begin_inset Flex CharStyle:Code
6699 \begin_layout Plain Layout
6706 \begin_inset Flex CharStyle:Code
6709 \begin_layout Plain Layout
6715 ) that describes the format of a document such as an article, report, journal
6716 preprint, etc, and all the commands needed to realize that format.
6717 A layout file is a LyX file that corresponds to a LaTeX document class
6718 and that tells LyX how to
6719 \begin_inset Quotes eld
6723 \begin_inset Quotes erd
6726 things on the screen to make the display look something like the final
6728 More precisely, a layout file describes a
6729 \begin_inset Quotes eld
6733 \begin_inset Quotes erd
6736 which is the internal construct LyX uses to render the screen display.
6738 \begin_inset Quotes eld
6742 \begin_inset Quotes erd
6746 \begin_inset Quotes eld
6750 \begin_inset Quotes erd
6753 can be used somewhat interchangeably, but it is better to refer to the
6754 file as the layout, and the thing living in LyX's memory as the text class.
6755 A template file is simply a LyX document that contains a set of predefined
6756 entries for a given document class---entries that are generally required
6758 Templates are especially useful for things like journal manuscripts that
6759 are to be submitted electronically.
6762 \begin_layout Section
6763 Installing a new LaTeX package
6766 \begin_layout Standard
6767 Some installations may not include a LaTeX package that you would like to
6769 For example, you might need FoilTeX, a common (and very powerful) package
6770 for preparing slides or viewgraphs for overhead projectors.
6771 On some systems, you may have a GUI for installing such packages: MikTeX
6772 on Windows®, for example.
6775 \begin_layout Standard
6776 If you don't have such a GUI, then you can follow these steps.
6779 \begin_layout Enumerate
6780 Get the package from
6781 \begin_inset CommandInset href
6784 target "http://www.ctan.org/"
6791 \begin_layout Enumerate
6792 You can install this package in several different places.
6793 If you want it to be available for all users on your system, then you should
6794 install it in your `local' TeX tree; if you want (or need) it to be available
6795 just for you, then you can install it in your own `user' TeX tree.
6796 Where these should be created, if they do not already exist, depends upon
6797 the details of your system.
6798 To find out, look in the file
6799 \begin_inset Flex CharStyle:Code
6802 \begin_layout Plain Layout
6812 \begin_layout Plain Layout
6813 This usually lives in the directory
6814 \begin_inset Flex CharStyle:Code
6817 \begin_layout Plain Layout
6823 , though you can run
6824 \begin_inset Flex CharStyle:Code
6827 \begin_layout Plain Layout
6838 The location of the `local' TeX tree is defined by
6839 \begin_inset Flex CharStyle:Code
6842 \begin_layout Plain Layout
6848 ; this is usually somewhere like
6849 \begin_inset Flex CharStyle:Code
6852 \begin_layout Plain Layout
6853 /usr/local/share/texmf/
6859 The `user' TeX tree is defined by
6860 \begin_inset Flex CharStyle:Code
6863 \begin_layout Plain Layout
6870 \begin_inset Flex CharStyle:Code
6873 \begin_layout Plain Layout
6880 (If these variables are not predefined, you can define them.) You'll probably
6881 need root permissions to create or modify the `local' tree; but your `user'
6882 tree shouldn't have such limitations.
6885 \begin_layout Enumerate
6887 \begin_inset Flex CharStyle:Code
6890 \begin_layout Plain Layout
6897 \begin_inset Flex CharStyle:Code
6900 \begin_layout Plain Layout
6907 \begin_inset Flex CharStyle:Code
6910 \begin_layout Plain Layout
6918 \begin_inset Newline newline
6922 \begin_inset Flex CharStyle:Code
6925 \begin_layout Plain Layout
6926 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
6932 \begin_inset Newline newline
6935 But, again, most of this will
6936 \begin_inset Quotes eld
6940 \begin_inset Quotes erd
6946 \begin_layout Enumerate
6951 \begin_layout Plain Layout
6952 We'll assume henceforth that you're defining `local' TeX tree.
6953 If you're defining a user tree, just adjust as necessary.
6959 You must follow the directory structure of your existing
6960 \begin_inset Flex CharStyle:Code
6963 \begin_layout Plain Layout
6969 directory, which will be found at
6970 \begin_inset Flex CharStyle:Code
6973 \begin_layout Plain Layout
6980 For example, latex packages should go under
6981 \begin_inset Flex CharStyle:Code
6984 \begin_layout Plain Layout
6985 $TEXMFLOCAL/tex/latex/
6993 \begin_layout Enumerate
6994 Install the package.
6995 For example, you would unpack the FoilTeX tarball and copy it to
6996 \begin_inset Flex CharStyle:Code
6999 \begin_layout Plain Layout
7000 $TEXMFLOCAL/tex/latex/foiltex
7007 \begin_inset Flex CharStyle:Code
7010 \begin_layout Plain Layout
7016 directory contains various files.
7019 \begin_layout Enumerate
7021 \begin_inset Flex CharStyle:Code
7024 \begin_layout Plain Layout
7032 \begin_inset Flex CharStyle:Code
7035 \begin_layout Plain Layout
7044 \begin_layout Standard
7045 Your package is now installed and available to LaTeX.
7046 To make it available to LyX, you need to create a Layout file, if one is
7047 not already available.
7048 (See the next section.) Once you have a layout file, you need only reconfigure
7050 \begin_inset Flex CharStyle:MenuItem
7053 \begin_layout Plain Layout
7058 ools\SpecialChar \menuseparator
7068 ) and then restart LyX.
7069 You should then see your new package---for example
7070 \begin_inset Flex CharStyle:MenuItem
7073 \begin_layout Plain Layout
7080 \begin_inset Flex CharStyle:MenuItem
7083 \begin_layout Plain Layout
7088 ocument\SpecialChar \menuseparator
7099 \begin_inset Flex CharStyle:MenuItem
7102 \begin_layout Plain Layout
7112 \begin_layout Section
7113 \begin_inset CommandInset label
7122 \begin_layout Standard
7123 This section describes how to write and install your own LyX layout files
7124 and walks through the
7125 \begin_inset Flex CharStyle:Code
7128 \begin_layout Plain Layout
7134 text class format as an example.
7136 \begin_inset Flex CharStyle:Code
7139 \begin_layout Plain Layout
7145 files describe what paragraph and character styles are available for a
7146 given document class and how LyX should display them.
7147 We try to provide a thorough description of the process here; however,
7148 there are so many different types of documents supported by LaTeX classes
7149 that we can't hope to cover every different possibility or problem you
7151 (The LyX users' list is frequented by people with lots of experience with
7152 layout design who are willing to share what they've learned.)
7155 \begin_layout Standard
7156 As you prepare to write a new layout, it is extremely helpful to look at
7157 the example layouts distributed with LyX.
7158 If you use a nice LaTeX document class that might be of interest for others,
7159 too, and have a nice corresponding LyX layout, feel free to contribute
7160 the stuff to us, so we may put it into the distribution.
7162 \begin_inset CommandInset href
7164 name "section on the LyX wiki"
7165 target "http://wiki.lyx.org/Layouts/Layouts"
7169 for this kind of material.
7172 \begin_layout Standard
7173 All the tags described in this chapter are case-insensitive; this means
7175 \begin_inset Flex CharStyle:Code
7178 \begin_layout Plain Layout
7185 \begin_inset Flex CharStyle:Code
7188 \begin_layout Plain Layout
7195 \begin_inset Flex CharStyle:Code
7198 \begin_layout Plain Layout
7204 are really the same command.
7205 The possible values are printed in brackets after the feature's name.
7206 The default value if a feature isn't specified inside a text class-description
7208 \begin_inset Flex CharStyle:Code
7211 \begin_layout Plain Layout
7220 If the argument has a datatype like
7221 \begin_inset Quotes eld
7225 \begin_inset Quotes erd
7229 \begin_inset Quotes eld
7233 \begin_inset Quotes erd
7236 , the default is shown like this:
7237 \begin_inset Flex CharStyle:Code
7240 \begin_layout Plain Layout
7251 \begin_layout Subsection
7252 \begin_inset CommandInset label
7254 name "sub:Layout-modules"
7261 \begin_layout Standard
7262 Similar to layout files, and new with LyX 1.6, are layout
7267 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
7268 some modules---such as the Endnotes module---provide support for just such
7270 In a sense, layout modules are similar to included files---files like
7271 \begin_inset Flex CharStyle:Code
7274 \begin_layout Plain Layout
7280 ---in that modules are not specific to a given document layout but may be
7281 used with many different layouts.
7282 The difference is that using a layout module does not require editing the
7284 Rather, modules are selected in the
7285 \begin_inset Flex CharStyle:MenuItem
7288 \begin_layout Plain Layout
7293 ocument\SpecialChar \menuseparator
7306 \begin_layout Standard
7307 Building modules is the easiest way to get started with layout editing,
7308 since it can be as simple as adding a single new paragraph or flex inset.
7309 But modules may, in principle, contain anything a layout file can contain.
7312 \begin_layout Standard
7313 A module must begin with a line like the following:
7316 \begin_layout LyX-Code
7319 DeclareLyXModule[endnotes.sty]{Endnotes}
7322 \begin_layout Standard
7323 The argument in square brackets is optional: It declares any LaTeX packages
7324 on which the module depends.
7325 The mandatory argument, in curly brackets, is the name of the module, as
7327 \begin_inset Flex CharStyle:MenuItem
7330 \begin_layout Plain Layout
7331 Document\SpecialChar \menuseparator
7341 \begin_layout Standard
7342 The module declaration should then be followed by lines like the following:
7345 \begin_layout LyX-Code
7349 \begin_layout LyX-Code
7350 #Adds an endnote command, in addition to footnotes.
7354 \begin_layout LyX-Code
7355 #You will need to add
7357 theendnotes in ERT where you
7360 \begin_layout LyX-Code
7361 #want the endnotes to appear.
7365 \begin_layout LyX-Code
7369 \begin_layout LyX-Code
7370 #Requires: somemodule | othermodule
7373 \begin_layout LyX-Code
7374 #Excludes: badmodule
7377 \begin_layout Standard
7378 The description is used in
7379 \begin_inset Flex CharStyle:MenuItem
7382 \begin_layout Plain Layout
7383 Document\SpecialChar \menuseparator
7389 to provide the user with information about what the module does.
7391 \begin_inset Flex CharStyle:Code
7394 \begin_layout Plain Layout
7400 line is used to identify other modules with which this one must be used;
7402 \begin_inset Flex CharStyle:Code
7405 \begin_layout Plain Layout
7411 line is used to identify modules with which this one may not be used.
7412 Both are optional, and, as shown, multiple modules should be separated
7413 with the pipe symbol: |.
7414 Note that the required modules are treated disjunctively:
7418 of the required modules must be used.
7423 excluded module may be used.
7424 Note that modules are identified here by their
7428 without the .module extension.
7430 \begin_inset Flex CharStyle:Code
7433 \begin_layout Plain Layout
7440 \begin_inset Flex CharStyle:Code
7443 \begin_layout Plain Layout
7452 \begin_layout Standard
7453 After creating a new module, you will need to reconfigure and then restart
7454 LyX for the module to appear in the menu.
7455 However, changes you make to the module will be seen immediately, if you
7457 \begin_inset Flex CharStyle:MenuItem
7460 \begin_layout Plain Layout
7461 Document\SpecialChar \menuseparator
7467 , highlight something, and then hit
7468 \begin_inset Quotes eld
7472 \begin_inset Quotes erd
7478 It is strongly recommended that you save your work before doing so
7483 it is strongly recommended that you not attempt to edit modules while simultaneo
7484 usly working on documents
7487 Though of course the developers strive to keep LyX stable in such situations,
7488 syntax errors and the like in your module file could cause strange behavior.
7491 \begin_layout Subsection
7492 Supporting new document classes
7495 \begin_layout Standard
7496 There are two situations you are likely to encounter when wanting to support
7497 a new LaTeX document class, involving LaTeX2e class (
7498 \begin_inset Flex CharStyle:Code
7501 \begin_layout Plain Layout
7508 \begin_inset Flex CharStyle:Code
7511 \begin_layout Plain Layout
7518 Supporting a style file is usually fairly easy.
7519 Supporting a new document class is a bit harder.
7522 \begin_layout Subsection
7524 \begin_inset Flex CharStyle:MenuItem
7527 \begin_layout Plain Layout
7536 \begin_layout Standard
7537 If your new document class is provided as a style file that is used in conjuncti
7538 on with an existing, supported document class---for the sake of the example,
7539 we'll assume that the style file is called
7540 \begin_inset Flex CharStyle:MenuItem
7543 \begin_layout Plain Layout
7549 and it is meant to be used with
7550 \begin_inset Flex CharStyle:MenuItem
7553 \begin_layout Plain Layout
7559 , which is a standard class---start by copying the existing class's layout
7560 file into your local directory:
7563 \begin_layout LyX-Code
7564 cp report.layout ~/.lyx/layouts/myclass.layout
7567 \begin_layout Standard
7569 \begin_inset Flex CharStyle:Code
7572 \begin_layout Plain Layout
7578 and change the line:
7581 \begin_layout LyX-Code
7584 DeclareLaTeXClass{report}
7587 \begin_layout Standard
7591 \begin_layout LyX-Code
7594 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
7597 \begin_layout Standard
7601 \begin_layout LyX-Code
7603 \begin_inset Newline newline
7609 \begin_inset Newline newline
7615 \begin_layout Standard
7616 near the top of the file.
7619 \begin_layout Standard
7620 Start LyX and select
7621 \begin_inset Flex CharStyle:MenuItem
7624 \begin_layout Plain Layout
7629 ools\SpecialChar \menuseparator
7640 Then restart LyX and try creating a new document.
7642 \begin_inset Flex CharStyle:MenuItem
7645 \begin_layout Plain Layout
7651 " as a document class option in the
7652 \begin_inset Flex CharStyle:MenuItem
7655 \begin_layout Plain Layout
7660 ocument\SpecialChar \menuseparator
7671 It is likely that some of the sectioning commands and such in your new
7672 class will work differently from how they worked in the base class---
7673 \begin_inset Flex CharStyle:Code
7676 \begin_layout Plain Layout
7682 in this example---so you can fiddle around with the settings for the different
7683 sections if you wish.
7686 \begin_layout Subsection
7688 \begin_inset Flex CharStyle:MenuItem
7691 \begin_layout Plain Layout
7700 \begin_layout Standard
7701 There are two possibilities here.
7702 One is that the class file is itself based upon an existing document class.
7703 For example, many thesis classes are based upon
7704 \begin_inset Flex CharStyle:MenuItem
7707 \begin_layout Plain Layout
7714 To see whether yours is, look for a line like
7717 \begin_layout LyX-Code
7723 \begin_layout Standard
7725 If so, then you may proceed largely as in the previous section, though
7726 the DeclareLaTeXClass line will be different.
7727 If your new class is thesis, and it is based upon book, then the line should
7732 \begin_layout Plain Layout
7733 And it will be easiest if you save the file to
7734 \begin_inset Flex CharStyle:Code
7737 \begin_layout Plain Layout
7743 : LyX assumes that the document class has the same name as the layout file.
7752 \begin_layout LyX-Code
7755 DeclareLaTeXClass[thesis,book]{thesis}
7758 \begin_layout Standard
7759 If, on the other hand, the new class is not based upon an existing class,
7760 you will probably have to
7761 \begin_inset Quotes eld
7765 \begin_inset Quotes erd
7769 We strongly suggest copying an existing layout file which uses a similar
7770 LaTeX class and then modifying it, if you can do so.
7771 At least use an existing file as a starting point so you can find out what
7772 items you need to worry about.
7773 Again, the specifics are covered below.
7776 \begin_layout Section
7777 Declaring a new text class
7780 \begin_layout Standard
7781 When it's finally time to get your hands dirty and create or edit your own
7782 layout file, the following sections describe what you're up against.
7783 Our advice is to go slowly, save and test often, listen to soothing music,
7784 and enjoy one or two of your favorite adult beverages; more if you are
7785 getting particularly stuck.
7786 It's really not that hard, except that the multitude of options can become
7787 overwhelming if you try to do to much in one sitting.
7788 Go have another adult beverage, just for good measure.
7791 \begin_layout Standard
7795 \begin_layout Standard
7796 Lines in a layout file which begin with a
7797 \begin_inset Flex CharStyle:Code
7800 \begin_layout Plain Layout
7807 There is one exception to this rule: all layouts should begin with lines
7811 \begin_layout LyX-Code
7814 #% Do not delete the line below; configure depends on this
7817 \begin_layout LyX-Code
7822 DeclareLaTeXClass{article}
7825 \begin_layout Standard
7826 The second line is used when you configure LyX.
7827 The layout file is read by the LaTeX script
7828 \begin_inset Flex CharStyle:Code
7831 \begin_layout Plain Layout
7837 , in a special mode where
7838 \begin_inset Flex CharStyle:Code
7841 \begin_layout Plain Layout
7848 The first line is just a LaTeX comment, and the second one contains the
7849 declaration of the text class.
7850 If these lines appear in a file named
7851 \begin_inset Flex CharStyle:Code
7854 \begin_layout Plain Layout
7860 , then they define a text class of name
7861 \begin_inset Flex CharStyle:Code
7864 \begin_layout Plain Layout
7870 (the name of the layout file) which uses the LaTeX document class
7871 \begin_inset Flex CharStyle:Code
7874 \begin_layout Plain Layout
7880 (the default is to use the same name as the layout).
7882 \begin_inset Quotes eld
7886 \begin_inset Quotes erd
7889 that appears above is used as a description of the text class in the
7890 \begin_inset Flex CharStyle:MenuItem
7893 \begin_layout Plain Layout
7898 ocument\SpecialChar \menuseparator
7911 \begin_layout Standard
7912 Let's assume that you wrote your own text class that uses the
7913 \begin_inset Flex CharStyle:Code
7916 \begin_layout Plain Layout
7922 document class, but where you changed the appearance of the section headings.
7923 If you put it in a file
7924 \begin_inset Flex CharStyle:Code
7927 \begin_layout Plain Layout
7933 , the header of this file should be:
7936 \begin_layout LyX-Code
7939 #% Do not delete the line below; configure depends on this
7942 \begin_layout LyX-Code
7947 DeclareLaTeXClass[article]{article (with my own headings)}
7950 \begin_layout Standard
7951 This declares a text class
7952 \begin_inset Flex CharStyle:Code
7955 \begin_layout Plain Layout
7961 , associated with the LaTeX document class
7962 \begin_inset Flex CharStyle:Code
7965 \begin_layout Plain Layout
7972 \begin_inset Quotes eld
7975 article (with my own headings)
7976 \begin_inset Quotes erd
7980 If your text class depends on several packages, you can declare it as:
7983 \begin_layout LyX-Code
7986 #% Do not delete the line below; configure depends on this
7989 \begin_layout LyX-Code
7994 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7997 \begin_layout Standard
7998 This indicates that your text class uses the foo.sty package.
7999 Finally, it is also possible to declare classes for DocBook code.
8000 Typical declarations will look like
8003 \begin_layout LyX-Code
8006 #% Do not delete the line below; configure depends on this
8009 \begin_layout LyX-Code
8014 DeclareDocBookClass[article]{SGML (DocBook article)}
8017 \begin_layout Standard
8018 Note that these declarations can also be given an optional parameter declaring
8019 the name of the document class (but not a list).
8022 \begin_layout Standard
8023 So, to be as explicit as possible, the form of the layout declaration is:
8026 \begin_layout LyX-Code
8031 DeclareLaTeXClass[class,package.sty]{layout description}
8034 \begin_layout Standard
8035 The class need only be specified if the name of the LaTeX class file and
8036 the name of the layout file are different; if the name of the classfile
8037 is not specified, then LyX will simply assume that it is the same as the
8038 name of the layout file.
8041 \begin_layout Standard
8042 When the text class has been modified to your taste, all you have to do
8043 is to copy it either to
8044 \begin_inset Flex CharStyle:Code
8047 \begin_layout Plain Layout
8054 \begin_inset Flex CharStyle:Code
8057 \begin_layout Plain Layout
8064 \begin_inset Flex CharStyle:MenuItem
8067 \begin_layout Plain Layout
8072 ools\SpecialChar \menuseparator
8082 , exit LyX and restart it.
8083 Then your new text class should be available along with the others.
8086 \begin_layout Standard
8087 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
8088 you made to your layout files.
8089 As a result, editing layout files could be very time consuming.
8090 Beginning with 1.6, however, you can force a reload of the layout currently
8091 in use by using the LyX function
8092 \begin_inset Flex CharStyle:MenuItem
8095 \begin_layout Plain Layout
8102 There is no default binding for this function---though, of course, you
8103 can bind it to a key yourself (see section
8104 \begin_inset CommandInset ref
8106 reference "sec:bindings"
8111 If you want to use this function, then, you should simply enter it in the
8117 : This is very much an `advanced feature'.
8122 recommended that you save your work before using this function.
8127 recommended that you not attempt to edit your layout while simultaneously
8128 working on a document that you care about.
8129 Use a test document.
8130 Syntax errors and the like in your layout file could cause peculiar behavior.
8131 In particular, such errors could cause LyX to regard the current layout
8132 as invalid and to attempt to switch to some other layout.
8133 The LyX team strives to keep LyX stable in such situations, but safe is
8137 \begin_layout Subsection
8141 \begin_layout Standard
8142 The first non-comment line must contain the file format number:
8145 \begin_layout Description
8146 \begin_inset Flex CharStyle:Code
8149 \begin_layout Plain Layout
8156 \begin_inset Flex CharStyle:Code
8159 \begin_layout Plain Layout
8165 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
8166 don't have an explicit file format).
8167 The file format that is documented here is format 8.
8170 \begin_layout Subsection
8171 General text class parameters
8174 \begin_layout Standard
8175 These are the general parameters which describe the form of the entire document:
8178 \begin_layout Description
8179 \begin_inset Flex CharStyle:Code
8182 \begin_layout Plain Layout
8188 Adds information to the document preamble.
8190 \begin_inset Quotes eld
8194 \begin_inset Flex CharStyle:Code
8197 \begin_layout Plain Layout
8204 \begin_inset Quotes erd
8210 \begin_layout Description
8211 \begin_inset Flex CharStyle:Code
8214 \begin_layout Plain Layout
8220 Describes various global options supported by the document class.
8222 \begin_inset space ~
8226 \begin_inset CommandInset ref
8228 reference "sec:classoptions"
8234 \begin_inset Quotes eld
8238 \begin_inset Flex CharStyle:Code
8241 \begin_layout Plain Layout
8248 \begin_inset Quotes erd
8254 \begin_layout Description
8255 \begin_inset Flex CharStyle:Code
8258 \begin_layout Plain Layout
8265 \begin_inset Flex CharStyle:Code
8268 \begin_layout Plain Layout
8277 \begin_inset Flex CharStyle:Code
8280 \begin_layout Plain Layout
8286 ] Whether the class should default to having one or two columns.
8287 Can be changed in the
8288 \begin_inset Flex CharStyle:MenuItem
8291 \begin_layout Plain Layout
8296 ocument\SpecialChar \menuseparator
8309 \begin_layout Description
8310 \begin_inset Flex CharStyle:Code
8313 \begin_layout Plain Layout
8319 This sequence defines a new counter.
8321 \begin_inset space ~
8325 \begin_inset CommandInset ref
8327 reference "sec:counter"
8333 \begin_inset Quotes eld
8337 \begin_inset Flex CharStyle:Code
8340 \begin_layout Plain Layout
8347 \begin_inset Quotes erd
8353 \begin_layout Description
8354 \begin_inset Flex CharStyle:Code
8357 \begin_layout Plain Layout
8363 Sets the default font used to display the document.
8365 \begin_inset space ~
8369 \begin_inset CommandInset ref
8371 reference "sec:fonts"
8375 for how to declare fonts.
8377 \begin_inset Quotes eld
8381 \begin_inset Flex CharStyle:Code
8384 \begin_layout Plain Layout
8391 \begin_inset Quotes erd
8397 \begin_layout Description
8398 \begin_inset Flex CharStyle:Code
8401 \begin_layout Plain Layout
8408 \begin_inset Flex CharStyle:Code
8411 \begin_layout Plain Layout
8417 ] This is the style that will be assigned to new paragraphs, usually
8418 \begin_inset Flex CharStyle:MenuItem
8421 \begin_layout Plain Layout
8428 This will default to the first defined style if not given, but you are
8429 highly encouraged to use this directive.
8432 \begin_layout Description
8433 \begin_inset Flex CharStyle:Code
8436 \begin_layout Plain Layout
8442 Defines a new float.
8444 \begin_inset space ~
8448 \begin_inset CommandInset ref
8450 reference "sec:floats"
8456 \begin_inset Quotes eld
8460 \begin_inset Flex CharStyle:Code
8463 \begin_layout Plain Layout
8470 \begin_inset Quotes erd
8476 \begin_layout Description
8477 \begin_inset Flex CharStyle:Code
8480 \begin_layout Plain Layout
8486 As its name implies, this command allows you to include another layout
8487 definition file within yours to avoid duplicating commands.
8488 Common examples are the standard layout files, for example,
8489 \begin_inset Flex CharStyle:Code
8492 \begin_layout Plain Layout
8498 , which contains most of the basic layouts.
8501 \begin_layout Description
8502 \begin_inset Flex CharStyle:Code
8505 \begin_layout Plain Layout
8511 This section (re-)defines the layout of an inset.
8512 It can be applied to an existing inset of to a new, user-defined inset,
8513 e.g., a new character style.
8515 \begin_inset space ~
8519 \begin_inset CommandInset ref
8521 reference "sec:charstyle"
8525 for more information.
8527 \begin_inset Quotes eld
8531 \begin_inset Flex CharStyle:Code
8534 \begin_layout Plain Layout
8541 \begin_inset Quotes erd
8547 \begin_layout Description
8548 \begin_inset Flex CharStyle:Code
8551 \begin_layout Plain Layout
8560 \begin_layout Description
8561 \begin_inset Flex CharStyle:Code
8564 \begin_layout Plain Layout
8570 This command deletes an existing float.
8571 This is particularly useful when you want to suppress a float that has
8572 be defined in an input file.
8575 \begin_layout Description
8576 \begin_inset Flex CharStyle:Code
8579 \begin_layout Plain Layout
8585 This command deletes an existing style.
8586 This is particularly useful when you want to suppress a style that has
8587 be defined in an input file.
8590 \begin_layout Description
8591 \begin_inset Flex CharStyle:Code
8594 \begin_layout Plain Layout
8603 \begin_layout Description
8604 \begin_inset Flex CharStyle:Code
8607 \begin_layout Plain Layout
8618 \begin_inset Flex CharStyle:Code
8621 \begin_layout Plain Layout
8632 \begin_inset Flex CharStyle:Code
8635 \begin_layout Plain Layout
8642 \begin_inset Flex CharStyle:Code
8645 \begin_layout Plain Layout
8651 ] The class default pagestyle.
8652 Can be changed in the
8653 \begin_inset Flex CharStyle:MenuItem
8656 \begin_layout Plain Layout
8661 ocument\SpecialChar \menuseparator
8674 \begin_layout Description
8675 \begin_inset Flex CharStyle:Code
8678 \begin_layout Plain Layout
8684 Sets the preamble for the LaTeX document.
8685 Note that this will completely override any prior
8686 \begin_inset Flex CharStyle:Code
8689 \begin_layout Plain Layout
8696 \begin_inset Flex CharStyle:Code
8699 \begin_layout Plain Layout
8707 \begin_inset Quotes eld
8711 \begin_inset Flex CharStyle:Code
8714 \begin_layout Plain Layout
8721 \begin_inset Quotes erd
8727 \begin_layout Description
8728 \begin_inset Flex CharStyle:Code
8731 \begin_layout Plain Layout
8738 \begin_inset CommandInset label
8745 \begin_inset Flex CharStyle:Code
8748 \begin_layout Plain Layout
8755 \begin_inset Flex CharStyle:Code
8758 \begin_layout Plain Layout
8767 \begin_inset Flex CharStyle:Code
8770 \begin_layout Plain Layout
8776 ] Whether the class already provides the feature
8777 \begin_inset Flex CharStyle:Code
8780 \begin_layout Plain Layout
8787 A feature is in general the name of a package (
8788 \begin_inset Flex CharStyle:Code
8791 \begin_layout Plain Layout
8798 \begin_inset Flex CharStyle:Code
8801 \begin_layout Plain Layout
8807 , \SpecialChar \ldots{}
8809 \begin_inset Flex CharStyle:Code
8812 \begin_layout Plain Layout
8819 \begin_inset Flex CharStyle:Code
8822 \begin_layout Plain Layout
8828 ,\SpecialChar \ldots{}
8829 ); the complete list of supported features is unfortunately not documented
8830 outside the LyX source code---but see
8831 \begin_inset Flex CharStyle:Code
8834 \begin_layout Plain Layout
8840 if you're interested.
8842 \begin_inset Flex CharStyle:MenuItem
8845 \begin_layout Plain Layout
8850 elp\SpecialChar \menuseparator
8860 also gives an overview of the supported packages.
8863 \begin_layout Description
8864 \begin_inset Flex CharStyle:Code
8867 \begin_layout Plain Layout
8874 \begin_inset Flex CharStyle:Code
8877 \begin_layout Plain Layout
8883 ] Whether the class requires the feature
8884 \begin_inset Flex CharStyle:Code
8887 \begin_layout Plain Layout
8894 Multiple features must be separated by commas.
8895 Note that you can only request supported features.
8898 \begin_layout Description
8899 \begin_inset Flex CharStyle:Code
8902 \begin_layout Plain Layout
8911 \begin_layout Description
8912 \begin_inset Flex CharStyle:Code
8915 \begin_layout Plain Layout
8924 \begin_layout Description
8925 \begin_inset Flex CharStyle:Code
8928 \begin_layout Plain Layout
8937 \begin_inset Flex CharStyle:Code
8940 \begin_layout Plain Layout
8951 \begin_inset Flex CharStyle:Code
8954 \begin_layout Plain Layout
8960 ] Whether the class-default should be printing on one or both sides of the
8962 Can be changed in the
8963 \begin_inset Flex CharStyle:MenuItem
8966 \begin_layout Plain Layout
8971 ocument\SpecialChar \menuseparator
8984 \begin_layout Description
8985 \begin_inset Flex CharStyle:Code
8988 \begin_layout Plain Layout
8994 This sequence defines a new paragraph style.
8995 If the style already exists, it will redefine some of its parameters instead.
8997 \begin_inset space ~
9001 \begin_inset CommandInset ref
9003 reference "sec:style"
9009 \begin_inset Quotes eld
9013 \begin_inset Flex CharStyle:Code
9016 \begin_layout Plain Layout
9023 \begin_inset Quotes erd
9029 \begin_layout Description
9030 \begin_inset Flex CharStyle:Code
9033 \begin_layout Plain Layout
9040 \begin_inset Flex CharStyle:Code
9043 \begin_layout Plain Layout
9049 ] The name of the command or environment to be used with
9050 \begin_inset Flex CharStyle:Code
9053 \begin_layout Plain Layout
9062 \begin_layout Description
9063 \begin_inset Flex CharStyle:Code
9066 \begin_layout Plain Layout
9073 \begin_inset Flex CharStyle:Code
9076 \begin_layout Plain Layout
9085 \begin_inset Flex CharStyle:Code
9088 \begin_layout Plain Layout
9094 ] Indicates what kind of markup is used to define the title of a document.
9096 \begin_inset Flex CharStyle:Code
9099 \begin_layout Plain Layout
9105 means that the macro with name
9106 \begin_inset Flex CharStyle:Code
9109 \begin_layout Plain Layout
9115 will be inserted after the last layout which has
9116 \begin_inset Quotes eld
9120 \begin_inset Flex CharStyle:Code
9123 \begin_layout Plain Layout
9130 \begin_inset Quotes erd
9135 \begin_inset Flex CharStyle:Code
9138 \begin_layout Plain Layout
9144 corresponds to the case where the block of paragraphs which have
9145 \begin_inset Quotes eld
9149 \begin_inset Flex CharStyle:Code
9152 \begin_layout Plain Layout
9159 \begin_inset Quotes erd
9162 should be enclosed into the
9163 \begin_inset Flex CharStyle:Code
9166 \begin_layout Plain Layout
9175 \begin_layout Description
9176 \begin_inset Flex CharStyle:Code
9179 \begin_layout Plain Layout
9188 \begin_layout Description
9189 \begin_inset Flex CharStyle:Code
9192 \begin_layout Plain Layout
9199 \begin_inset Flex CharStyle:Code
9202 \begin_layout Plain Layout
9208 Specifies a module to be included by default with this document class.
9209 The user can still remove the module, but it will be active at the outset.
9210 (This applies only when new files are created, or when this class is chosen
9211 for an existing document.)
9214 \begin_layout Subsection
9215 \begin_inset Flex CharStyle:Code
9218 \begin_layout Plain Layout
9227 \begin_layout Standard
9228 \begin_inset CommandInset label
9230 name "sec:classoptions"
9235 \begin_inset Flex CharStyle:Code
9238 \begin_layout Plain Layout
9244 section can contain the following entries:
9247 \begin_layout Description
9248 \begin_inset Flex CharStyle:Code
9251 \begin_layout Plain Layout
9258 \begin_inset Flex CharStyle:Code
9261 \begin_layout Plain Layout
9267 ] The list of available font sizes for the document's main font, separated
9269 \begin_inset Quotes eld
9273 \begin_inset Flex CharStyle:Code
9276 \begin_layout Plain Layout
9283 \begin_inset Quotes erd
9289 \begin_layout Description
9290 \begin_inset Flex CharStyle:Code
9293 \begin_layout Plain Layout
9302 \begin_layout Description
9303 \begin_inset Flex CharStyle:Code
9306 \begin_layout Plain Layout
9313 \begin_inset Flex CharStyle:Code
9316 \begin_layout Plain Layout
9317 string="empty|plain|headings|fancy"
9322 ] The list of available page styles, separated by
9323 \begin_inset Quotes eld
9327 \begin_inset Flex CharStyle:Code
9330 \begin_layout Plain Layout
9337 \begin_inset Quotes erd
9343 \begin_layout Description
9344 \begin_inset Flex CharStyle:Code
9347 \begin_layout Plain Layout
9354 \begin_inset Flex CharStyle:Code
9357 \begin_layout Plain Layout
9363 ] Some document class options, separated by a comma, that will be added
9364 to the optional part of the
9365 \begin_inset Flex CharStyle:Code
9368 \begin_layout Plain Layout
9379 \begin_layout Standard
9381 \begin_inset Flex CharStyle:Code
9384 \begin_layout Plain Layout
9390 section must end with
9391 \begin_inset Quotes eld
9395 \begin_inset Flex CharStyle:Code
9398 \begin_layout Plain Layout
9405 \begin_inset Quotes erd
9411 \begin_layout Subsection
9415 \begin_layout Standard
9416 \begin_inset CommandInset label
9422 A paragraph style description looks like this:
9426 \begin_layout Plain Layout
9427 Note that this will either define a new layout or modify an existing one.
9435 \begin_layout LyX-Code
9442 \begin_layout LyX-Code
9446 \begin_layout LyX-Code
9450 \begin_layout Standard
9451 where the following commands are allowed:
9454 \begin_layout Description
9455 \begin_inset Flex CharStyle:Code
9458 \begin_layout Plain Layout
9465 \begin_inset Flex CharStyle:Code
9468 \begin_layout Plain Layout
9473 , left, right, center
9478 ] Paragraph alignment.
9481 \begin_layout Description
9482 \begin_inset Flex CharStyle:Code
9485 \begin_layout Plain Layout
9492 \begin_inset Flex CharStyle:Code
9495 \begin_layout Plain Layout
9500 , left, right, center
9505 ] A comma separated list of permitted alignments.
9506 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9508 For example a right-aligned or centered enumeration isn't possible.)
9511 \begin_layout Description
9512 \begin_inset Flex CharStyle:Code
9515 \begin_layout Plain Layout
9522 \begin_inset Flex CharStyle:Code
9525 \begin_layout Plain Layout
9535 \begin_layout Plain Layout
9536 Note that a `float' here is a real number, such as: 1.5.
9541 The vertical space with which the last of a chain of paragraphs with this
9542 layout is separated from the following paragraph.
9543 If the next paragraph has another layout, the separations are not simply
9544 added, but the maximum is taken.
9547 \begin_layout Description
9548 \begin_inset Flex CharStyle:Code
9551 \begin_layout Plain Layout
9558 \begin_inset Flex CharStyle:Code
9561 \begin_layout Plain Layout
9567 The category for this style.
9568 This is used to group related styles in the Layout combobox on the toolbar.
9569 Any string can be used, but you may want to use existing categories with
9574 \begin_layout Description
9575 \begin_inset Flex CharStyle:Code
9578 \begin_layout Plain Layout
9587 \begin_layout Description
9588 \begin_inset Flex CharStyle:Code
9591 \begin_layout Plain Layout
9598 \begin_inset CommandInset label
9600 name "des:CopyStyle"
9605 \begin_inset Flex CharStyle:Code
9608 \begin_layout Plain Layout
9614 Copies all the features of an existing style into the current one.
9618 \begin_layout Description
9619 \begin_inset Flex CharStyle:Code
9622 \begin_layout Plain Layout
9628 The name of a style whose preamble should be output
9633 This allows to ensure some ordering of the preamble snippets when macros
9634 definitions depend on one another.
9638 \begin_layout Plain Layout
9639 Note that, besides that functionality, there is no way to ensure any ordering
9641 The ordering that you see in a given version of LyX may change without
9642 warning in later versions.
9650 \begin_layout Description
9651 \begin_inset Flex CharStyle:Code
9654 \begin_layout Plain Layout
9661 \begin_inset Flex CharStyle:Code
9664 \begin_layout Plain Layout
9669 , Box, Filled_Box, Static
9674 ] The type of label that stands at the end of the paragraph (or sequence
9676 \begin_inset Flex CharStyle:Code
9679 \begin_layout Plain Layout
9686 \begin_inset Flex CharStyle:Code
9689 \begin_layout Plain Layout
9696 \begin_inset Flex CharStyle:Code
9699 \begin_layout Plain Layout
9706 \begin_inset Flex CharStyle:Code
9709 \begin_layout Plain Layout
9717 \begin_inset Flex CharStyle:Code
9720 \begin_layout Plain Layout
9727 \begin_inset Quotes eld
9731 \begin_inset Quotes erd
9735 \begin_inset Flex CharStyle:Code
9738 \begin_layout Plain Layout
9745 \begin_inset Flex CharStyle:Code
9748 \begin_layout Plain Layout
9749 \begin_inset space ~
9758 \begin_inset space ~
9761 black) square suitable for end of proof markers,
9762 \begin_inset Flex CharStyle:Code
9765 \begin_layout Plain Layout
9771 is an explicit text string.
9774 \begin_layout Description
9775 \begin_inset Flex CharStyle:Code
9778 \begin_layout Plain Layout
9785 \begin_inset Flex CharStyle:Code
9788 \begin_layout Plain Layout
9794 ] The string used for a label with a
9795 \begin_inset Flex CharStyle:Code
9798 \begin_layout Plain Layout
9805 \begin_inset Flex CharStyle:Code
9808 \begin_layout Plain Layout
9818 \begin_layout Description
9819 \begin_inset Flex CharStyle:Code
9822 \begin_layout Plain Layout
9829 \begin_inset Flex CharStyle:Code
9832 \begin_layout Plain Layout
9843 \begin_inset Flex CharStyle:Code
9846 \begin_layout Plain Layout
9855 \begin_layout Description
9856 \begin_inset Flex CharStyle:Code
9859 \begin_layout Plain Layout
9866 \begin_inset Flex CharStyle:Code
9869 \begin_layout Plain Layout
9879 ] With this parameter the
9880 \begin_inset Flex CharStyle:MenuItem
9883 \begin_layout Plain Layout
9890 \begin_inset Quotes eld
9893 Vertical space above
9894 \begin_inset Quotes erd
9898 \begin_inset Flex CharStyle:MenuItem
9901 \begin_layout Plain Layout
9906 dit\SpecialChar \menuseparator
9912 \begin_inset space ~
9920 dialog can be set when initializing a paragraph with this style.
9924 \begin_layout Plain Layout
9927 Note from Jean-Marc:
9929 I'm not sure that this setting has much use, and it should probably be
9930 removed in later versions.
9938 \begin_layout Description
9939 \begin_inset Flex CharStyle:Code
9942 \begin_layout Plain Layout
9948 The font used for both the text body
9954 \begin_inset space ~
9958 \begin_inset CommandInset ref
9960 reference "sec:fonts"
9965 Note that defining this font automatically defines the
9966 \begin_inset Flex CharStyle:Code
9969 \begin_layout Plain Layout
9976 So you should define this one first if you also want to define
9977 \begin_inset Flex CharStyle:Code
9980 \begin_layout Plain Layout
9989 \begin_layout Description
9990 \begin_inset Flex CharStyle:Code
9993 \begin_layout Plain Layout
10000 \begin_inset CommandInset label
10002 name "des:FreeSpacing"
10009 \begin_inset Flex CharStyle:Code
10012 \begin_layout Plain Layout
10023 \begin_inset Flex CharStyle:Code
10026 \begin_layout Plain Layout
10032 ] Usually LyX doesn't allow you to insert more than one space between words,
10033 since a space is considered as the separation between two words, not a
10034 character or symbol of its own.
10035 This is a very fine thing but sometimes annoying, for example, when typing
10036 program code or plain LaTeX code.
10038 \begin_inset Flex CharStyle:Code
10041 \begin_layout Plain Layout
10048 Note that LyX will create protected blanks for the additional blanks when
10049 in another mode than LaTeX-mode.
10052 \begin_layout Description
10053 \begin_inset Flex CharStyle:Code
10056 \begin_layout Plain Layout
10065 \begin_layout Description
10066 \begin_inset Flex CharStyle:Code
10069 \begin_layout Plain Layout
10076 \begin_inset Flex CharStyle:Code
10079 \begin_layout Plain Layout
10085 If 1, marks the layout as being part of a title block (see also the
10086 \begin_inset Flex CharStyle:Code
10089 \begin_layout Plain Layout
10096 \begin_inset Flex CharStyle:Code
10099 \begin_layout Plain Layout
10108 \begin_layout Description
10109 \begin_inset Flex CharStyle:Code
10112 \begin_layout Plain Layout
10119 \begin_inset Flex CharStyle:Code
10122 \begin_layout Plain Layout
10128 ] This provides extra space between paragraphs that have the same layout.
10129 If you put other layouts into an environment, each is separated with the
10131 \begin_inset Flex CharStyle:Code
10134 \begin_layout Plain Layout
10141 But the whole items of the environment are additionally separated with
10143 \begin_inset Flex CharStyle:Code
10146 \begin_layout Plain Layout
10153 Note that this is a
10158 \begin_layout Description
10159 \begin_inset Flex CharStyle:Code
10162 \begin_layout Plain Layout
10171 \begin_layout Description
10172 \begin_inset Flex CharStyle:Code
10175 \begin_layout Plain Layout
10182 \begin_inset CommandInset label
10184 name "des:KeepEmpty"
10191 \begin_inset Flex CharStyle:Code
10194 \begin_layout Plain Layout
10205 \begin_inset Flex CharStyle:Code
10208 \begin_layout Plain Layout
10214 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10215 lead to empty LaTeX output.
10216 There are some cases where this could be desirable however: in a letter
10217 template, the required fields can be provided as empty fields, so that
10218 people do not forget them; in some special classes, a layout can be used
10219 as some kind of break, which does not contain actual text.
10222 \begin_layout Description
10223 \begin_inset Flex CharStyle:Code
10226 \begin_layout Plain Layout
10232 [float=0] The vertical space between the label and the text body.
10233 Only used for labels that are above the text body (
10234 \begin_inset Flex CharStyle:Code
10237 \begin_layout Plain Layout
10244 \begin_inset Flex CharStyle:Code
10247 \begin_layout Plain Layout
10248 Centered_Top_Environment
10256 \begin_layout Description
10257 \begin_inset Flex CharStyle:Code
10260 \begin_layout Plain Layout
10267 \begin_inset Flex CharStyle:Code
10270 \begin_layout Plain Layout
10277 \begin_inset Newline newline
10280 The name of the counter for automatic numbering (see Section
10281 \begin_inset CommandInset ref
10283 reference "sec:counter"
10288 This must be given if
10289 \begin_inset Flex CharStyle:Code
10292 \begin_layout Plain Layout
10299 \begin_inset Flex CharStyle:Code
10302 \begin_layout Plain Layout
10311 \begin_layout Description
10312 \begin_inset Flex CharStyle:Code
10315 \begin_layout Plain Layout
10321 The font used for the label.
10323 \begin_inset space ~
10327 \begin_inset CommandInset ref
10329 reference "sec:fonts"
10336 \begin_layout Description
10337 \begin_inset Flex CharStyle:Code
10340 \begin_layout Plain Layout
10347 \begin_inset Flex CharStyle:Code
10350 \begin_layout Plain Layout
10356 ] The horizontal space between the label and the text body.
10357 Only used for labels that are not above the text body.
10360 \begin_layout Description
10361 \begin_inset Flex CharStyle:Code
10364 \begin_layout Plain Layout
10371 \begin_inset Flex CharStyle:Code
10374 \begin_layout Plain Layout
10380 ] The string used for a label with a
10381 \begin_inset Flex CharStyle:Code
10384 \begin_layout Plain Layout
10392 \begin_inset Flex CharStyle:Code
10395 \begin_layout Plain Layout
10401 is set, this string can be contain the special formatting commands described
10403 \begin_inset CommandInset ref
10405 reference "sec:counter"
10413 \begin_layout Plain Layout
10414 For the sake of backwards compatibility, the string
10415 \begin_inset Flex CharStyle:Code
10418 \begin_layout Plain Layout
10428 will be replaced by the expanded
10429 \begin_inset Flex CharStyle:Code
10432 \begin_layout Plain Layout
10439 \begin_inset Flex CharStyle:Code
10442 \begin_layout Plain Layout
10451 This feature is now obsolete and should be replaced by the mechanisms of
10453 \begin_inset CommandInset ref
10455 reference "sec:counter"
10467 \begin_layout Description
10468 \begin_inset Flex CharStyle:Code
10471 \begin_layout Plain Layout
10472 LabelStringAppendix
10478 \begin_inset Flex CharStyle:Code
10481 \begin_layout Plain Layout
10487 ] This is used inside the appendix instead of
10488 \begin_inset Flex CharStyle:Code
10491 \begin_layout Plain Layout
10499 \begin_inset Flex CharStyle:Code
10502 \begin_layout Plain Layout
10509 \begin_inset Flex CharStyle:Code
10512 \begin_layout Plain Layout
10513 LabelStringAppendix
10521 \begin_layout Description
10522 \begin_inset Flex CharStyle:Code
10525 \begin_layout Plain Layout
10532 \begin_inset Flex CharStyle:Code
10535 \begin_layout Plain Layout
10540 , Manual, Static, Top_Environment,
10541 \begin_inset Newline newline
10544 Centered_Top_Environment, Sensitive, Counter
10550 \begin_inset Newline newline
10554 \begin_inset Flex CharStyle:Code
10557 \begin_layout Plain Layout
10563 means the label is the very first word (up to the first real blank).
10567 \begin_layout Plain Layout
10568 Use protected spaces if you want more than one word as the label.
10574 \begin_inset Flex CharStyle:Code
10577 \begin_layout Plain Layout
10583 means it is defined in the layout (see
10584 \begin_inset Flex CharStyle:Code
10587 \begin_layout Plain Layout
10595 \begin_inset Flex CharStyle:Code
10598 \begin_layout Plain Layout
10605 \begin_inset Flex CharStyle:Code
10608 \begin_layout Plain Layout
10609 Centered_Top_Environment
10614 are special cases of
10615 \begin_inset Flex CharStyle:Code
10618 \begin_layout Plain Layout
10625 The label will be printed above the paragraph, but only at the top of an
10626 environment or the top of a chain of paragraphs with this layout.
10627 Usage is for example the
10628 \begin_inset Flex CharStyle:MenuItem
10631 \begin_layout Plain Layout
10638 \begin_inset Flex CharStyle:MenuItem
10641 \begin_layout Plain Layout
10648 This is also the case for
10649 \begin_inset Flex CharStyle:Code
10652 \begin_layout Plain Layout
10658 labels with latex type
10659 \begin_inset Flex CharStyle:Code
10662 \begin_layout Plain Layout
10668 , in order to make layouts for theorems work correctly.
10670 \begin_inset Flex CharStyle:Code
10673 \begin_layout Plain Layout
10679 is a special case for the caption-labels
10680 \begin_inset Quotes eld
10684 \begin_inset Quotes erd
10688 \begin_inset Quotes eld
10692 \begin_inset Quotes erd
10697 \begin_inset Flex CharStyle:Code
10700 \begin_layout Plain Layout
10706 means the (hardcoded) label string depends on the kind of float.
10708 \begin_inset Flex CharStyle:Code
10711 \begin_layout Plain Layout
10717 label type defines automatically numbered labels.
10719 \begin_inset CommandInset ref
10721 reference "sec:counter"
10728 \begin_layout Description
10729 \begin_inset Flex CharStyle:Code
10732 \begin_layout Plain Layout
10741 \begin_layout Description
10742 \begin_inset Flex CharStyle:Code
10745 \begin_layout Plain Layout
10754 \begin_layout Description
10755 \begin_inset Flex CharStyle:Code
10758 \begin_layout Plain Layout
10765 \begin_inset CommandInset label
10767 name "des:LatexName"
10771 The name of the corresponding LaTeX stuff.
10772 Either the environment or command name.
10775 \begin_layout Description
10776 \begin_inset Flex CharStyle:Code
10779 \begin_layout Plain Layout
10788 \begin_layout Description
10789 \begin_inset Flex CharStyle:Code
10792 \begin_layout Plain Layout
10799 \begin_inset CommandInset label
10801 name "des:LatexParam"
10805 An optional parameter for the corresponding
10806 \begin_inset Flex CharStyle:Code
10809 \begin_layout Plain Layout
10816 This parameter cannot be changed from within LyX.
10819 \begin_layout Description
10820 \begin_inset Flex CharStyle:Code
10823 \begin_layout Plain Layout
10830 \begin_inset CommandInset label
10832 name "des:LatexType"
10837 \begin_inset Flex CharStyle:Code
10840 \begin_layout Plain Layout
10845 , Command, Environment, Item_Environment,
10851 \begin_inset Flex CharStyle:Code
10854 \begin_layout Plain Layout
10860 ] How the layout should be translated into LaTeX.
10862 \begin_inset Flex CharStyle:Code
10865 \begin_layout Plain Layout
10871 means nothing special.
10873 \begin_inset Flex CharStyle:Code
10876 \begin_layout Plain Layout
10883 \begin_inset Flex CharStyle:Code
10886 \begin_layout Plain Layout
10893 {\SpecialChar \ldots{}
10900 \begin_inset Flex CharStyle:Code
10903 \begin_layout Plain Layout
10910 \begin_inset Flex CharStyle:Code
10913 \begin_layout Plain Layout
10920 }\SpecialChar \ldots{}
10934 \begin_inset Flex CharStyle:Code
10937 \begin_layout Plain Layout
10944 \begin_inset Flex CharStyle:Code
10947 \begin_layout Plain Layout
10954 \begin_inset Flex CharStyle:Code
10957 \begin_layout Plain Layout
10965 is generated for each paragraph of this environment.
10967 \begin_inset Flex CharStyle:Code
10970 \begin_layout Plain Layout
10977 \begin_inset Flex CharStyle:Code
10980 \begin_layout Plain Layout
10987 \begin_inset Flex CharStyle:Code
10990 \begin_layout Plain Layout
10996 is passed as an argument to the environment.
10998 \begin_inset Flex CharStyle:Code
11001 \begin_layout Plain Layout
11007 can be defined in the
11008 \begin_inset Flex CharStyle:MenuItem
11011 \begin_layout Plain Layout
11016 ayout\SpecialChar \menuseparator
11028 \begin_inset Flex CharStyle:Code
11031 \begin_layout Plain Layout
11039 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11040 Visit the SGML class files for specific examples.
11043 \begin_layout Standard
11044 Putting the last few things together, the LaTeX output will be either:
11047 \begin_layout LyX-Code
11050 latexname[latexparam]{\SpecialChar \ldots{}
11054 \begin_layout Standard
11058 \begin_layout LyX-Code
11061 begin{latexname}[latexparam] \SpecialChar \ldots{}
11067 \begin_layout Standard
11068 depending upon the LaTex type.
11071 \begin_layout Description
11072 \begin_inset Flex CharStyle:Code
11075 \begin_layout Plain Layout
11082 \begin_inset Flex CharStyle:Code
11085 \begin_layout Plain Layout
11091 ] If you put layouts into environments, the leftmargins are not simply added,
11092 but added with a factor
11093 \begin_inset Formula $\frac{4}{depth+4}$
11097 Note that this parameter is also used when the margin is defined as
11098 \begin_inset Flex CharStyle:Code
11101 \begin_layout Plain Layout
11108 \begin_inset Flex CharStyle:Code
11111 \begin_layout Plain Layout
11118 Then it is added to the manual or dynamic margin.
11120 \begin_inset Newline newline
11123 The argument is passed as a string.
11125 \begin_inset Quotes eld
11129 \begin_inset Flex CharStyle:Code
11132 \begin_layout Plain Layout
11139 \begin_inset Quotes erd
11142 means that the paragraph is indented with the width of
11143 \begin_inset Quotes eld
11147 \begin_inset Flex CharStyle:Code
11150 \begin_layout Plain Layout
11157 \begin_inset Quotes erd
11160 in the normal font.
11161 You can get a negative width by prefixing the string with
11162 \begin_inset Quotes eld
11166 \begin_inset Flex CharStyle:Code
11169 \begin_layout Plain Layout
11176 \begin_inset Quotes erd
11180 This way was chosen so that the look is the same with each used screen
11185 \begin_layout Description
11186 \begin_inset Flex CharStyle:Code
11189 \begin_layout Plain Layout
11196 \begin_inset Flex CharStyle:Code
11199 \begin_layout Plain Layout
11204 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11210 \begin_inset Newline newline
11213 The kind of margin that the layout has on the left side.
11215 \begin_inset Flex CharStyle:Code
11218 \begin_layout Plain Layout
11224 just means a fixed margin.
11226 \begin_inset Flex CharStyle:Code
11229 \begin_layout Plain Layout
11235 means that the left margin depends on the string entered in the
11236 \begin_inset Flex CharStyle:MenuItem
11239 \begin_layout Plain Layout
11244 dit\SpecialChar \menuseparator
11250 \begin_inset space ~
11259 This is used to typeset nice lists without tabulators.
11261 \begin_inset Flex CharStyle:Code
11264 \begin_layout Plain Layout
11270 means that the margin depends on the size of the label.
11271 This is used for automatic enumerated headlines.
11272 It is obvious that the headline
11273 \begin_inset Quotes eld
11276 5.4.3.2.1 Very long headline
11277 \begin_inset Quotes erd
11280 must have a wider left margin (as wide as
11281 \begin_inset Quotes eld
11285 \begin_inset Quotes erd
11288 plus the space) than
11289 \begin_inset Quotes eld
11292 3.2 Very long headline
11293 \begin_inset Quotes erd
11297 \begin_inset Quotes eld
11301 \begin_inset Quotes erd
11304 are not able to do this.
11306 \begin_inset Flex CharStyle:Code
11309 \begin_layout Plain Layout
11315 is similar, but only the very first row of the paragraph is dynamic, while
11316 the others are static; this is used, for example, for descriptions.
11318 \begin_inset Flex CharStyle:Code
11321 \begin_layout Plain Layout
11327 means the margin is chosen in a way that the longest row of this paragraph
11328 fits to the right margin.
11329 This is used to typeset an address on the right edge of the page.
11332 \begin_layout Description
11333 \begin_inset Flex CharStyle:Code
11336 \begin_layout Plain Layout
11343 \begin_inset CommandInset label
11345 name "des:NeedProtect"
11350 \begin_inset Flex CharStyle:Code
11353 \begin_layout Plain Layout
11362 \begin_inset Flex CharStyle:Code
11365 \begin_layout Plain Layout
11371 ] Whether fragile commands in this layout should be
11372 \begin_inset Flex CharStyle:Code
11375 \begin_layout Plain Layout
11388 whether this command should itself be protected.)
11391 \begin_layout Description
11392 \begin_inset Flex CharStyle:Code
11395 \begin_layout Plain Layout
11402 \begin_inset Flex CharStyle:Code
11405 \begin_layout Plain Layout
11412 \begin_inset Flex CharStyle:Code
11415 \begin_layout Plain Layout
11423 ] Whether newlines are translated into LaTeX newlines (
11424 \begin_inset Flex CharStyle:Code
11427 \begin_layout Plain Layout
11438 The translation can be switched off to allow more comfortable LaTeX editing
11442 \begin_layout Description
11443 \begin_inset Flex CharStyle:Code
11446 \begin_layout Plain Layout
11453 \begin_inset Flex CharStyle:Code
11456 \begin_layout Plain Layout
11463 \begin_inset Flex CharStyle:Code
11466 \begin_layout Plain Layout
11474 ] Whether the following Paragraph is allowed to indent its very first row.
11476 \begin_inset Flex CharStyle:Code
11479 \begin_layout Plain Layout
11485 means that it is not allowed to do so;
11486 \begin_inset Flex CharStyle:Code
11489 \begin_layout Plain Layout
11495 means it could do so if it wants to.
11498 \begin_layout Description
11499 \begin_inset Flex CharStyle:Code
11502 \begin_layout Plain Layout
11511 \begin_layout Description
11512 \begin_inset Flex CharStyle:Code
11515 \begin_layout Plain Layout
11522 \begin_inset Flex CharStyle:Code
11525 \begin_layout Plain Layout
11531 ] The number of optional arguments that can be used with this layout.
11532 This is useful for things like section headings, and only makes sense with
11536 \begin_layout Description
11537 \begin_inset Flex CharStyle:Code
11540 \begin_layout Plain Layout
11547 \begin_inset Flex CharStyle:Code
11550 \begin_layout Plain Layout
11556 ] The indent of the very first line of a paragraph.
11558 \begin_inset Flex CharStyle:Code
11561 \begin_layout Plain Layout
11567 will be fixed for a certain layout.
11568 The exception is Standard layout, since the indentation of a Standard layout
11569 paragraph can be prohibited with
11570 \begin_inset Flex CharStyle:Code
11573 \begin_layout Plain Layout
11580 Also, Standard layout paragraphs inside environments use the
11581 \begin_inset Flex CharStyle:Code
11584 \begin_layout Plain Layout
11590 of the environment, not their native one.
11591 For example, Standard paragraphs inside an enumeration are not indented.
11594 \begin_layout Description
11595 \begin_inset Flex CharStyle:Code
11598 \begin_layout Plain Layout
11605 \begin_inset Flex CharStyle:Code
11608 \begin_layout Plain Layout
11614 ] The vertical space between two paragraphs of this layout.
11617 \begin_layout Description
11618 \begin_inset Flex CharStyle:Code
11621 \begin_layout Plain Layout
11628 \begin_inset Flex CharStyle:Code
11631 \begin_layout Plain Layout
11637 ] LyX allows the user to choose either
11638 \begin_inset Quotes eld
11642 \begin_inset Quotes erd
11646 \begin_inset Quotes eld
11650 \begin_inset Quotes erd
11653 to typeset a document.
11655 \begin_inset Quotes eld
11659 \begin_inset Quotes erd
11662 is chosen, this value is completely ignored.
11664 \begin_inset Quotes eld
11668 \begin_inset Quotes erd
11671 is chosen, the parindent of a LaTeXtype
11672 \begin_inset Quotes eld
11676 \begin_inset Quotes erd
11679 layout is ignored and all paragraphs are separated by this parskip argument.
11680 The vertical space is calculated with
11681 \begin_inset Flex CharStyle:Code
11684 \begin_layout Plain Layout
11686 \begin_inset space ~
11695 \begin_inset Flex CharStyle:Code
11698 \begin_layout Plain Layout
11704 is the height of a row with the normal font.
11705 This way, the look stays the same with different screen fonts.
11708 \begin_layout Description
11709 \begin_inset Flex CharStyle:Code
11712 \begin_layout Plain Layout
11719 \begin_inset CommandInset label
11721 name "des:PassThru"
11728 \begin_inset Flex CharStyle:Code
11731 \begin_layout Plain Layout
11742 \begin_inset Flex CharStyle:Code
11745 \begin_layout Plain Layout
11751 ] Whether the contents of this paragraph should be output in raw form, meaning
11752 without special translations that LaTeX would require.
11755 \begin_layout Description
11756 \begin_inset Flex CharStyle:Code
11759 \begin_layout Plain Layout
11766 \begin_inset CommandInset label
11768 name "des:Preamble"
11772 Information to be included in the LaTeX preamable when this style is used.
11773 Used to define macros, load packages, etc., required by this particular
11776 \begin_inset Quotes eld
11780 \begin_inset Flex CharStyle:Code
11783 \begin_layout Plain Layout
11790 \begin_inset Quotes erd
11796 \begin_layout Description
11797 \begin_inset Flex CharStyle:Code
11800 \begin_layout Plain Layout
11807 \begin_inset Flex CharStyle:Code
11810 \begin_layout Plain Layout
11817 \begin_inset CommandInset label
11819 name "des:Requires"
11823 Whether the layout requires the feature
11824 \begin_inset Flex CharStyle:Code
11827 \begin_layout Plain Layout
11834 See the description of
11835 \begin_inset Flex CharStyle:Code
11838 \begin_layout Plain Layout
11845 \begin_inset CommandInset ref
11846 LatexCommand pageref
11847 reference "des:FreeSpacing"
11851 ) for information on `features'.
11855 \begin_layout Description
11856 \begin_inset Flex CharStyle:Code
11859 \begin_layout Plain Layout
11866 \begin_inset Flex CharStyle:Code
11869 \begin_layout Plain Layout
11876 \begin_inset Flex CharStyle:Code
11879 \begin_layout Plain Layout
11888 \begin_layout Description
11889 \begin_inset Flex CharStyle:Code
11892 \begin_layout Plain Layout
11899 \begin_inset Flex CharStyle:Code
11902 \begin_layout Plain Layout
11907 , onehalf, double, other
11916 ] This defines what the default spacing should be in the layout.
11918 \begin_inset Flex CharStyle:Code
11921 \begin_layout Plain Layout
11928 \begin_inset Flex CharStyle:Code
11931 \begin_layout Plain Layout
11938 \begin_inset Flex CharStyle:Code
11941 \begin_layout Plain Layout
11947 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
11948 If you specify the argument
11949 \begin_inset Flex CharStyle:Code
11952 \begin_layout Plain Layout
11958 , then you should also provide a numerical argument which will be the actual
11960 Note that, contrary to other parameters,
11961 \begin_inset Flex CharStyle:Code
11964 \begin_layout Plain Layout
11970 implies the generation of specific LaTeX code, using the package
11973 \begin_inset Flex CharStyle:Code
11976 \begin_layout Plain Layout
11985 \begin_layout Description
11986 \begin_inset Flex CharStyle:Code
11989 \begin_layout Plain Layout
11995 The font used for the text body .
11997 \begin_inset CommandInset ref
11999 reference "sec:fonts"
12006 \begin_layout Description
12008 \begin_inset Flex CharStyle:Code
12011 \begin_layout Plain Layout
12019 The level of the style in the table of contents.
12020 This is used for automatic numbering of section headings.
12023 \begin_layout Description
12024 \begin_inset Flex CharStyle:Code
12027 \begin_layout Plain Layout
12034 \begin_inset Flex CharStyle:Code
12037 \begin_layout Plain Layout
12043 ] The vertical space with which the very first of a chain of paragraphs
12044 with this layout is separated from the previous paragraph.
12045 If the previous paragraph has another layout, the separations are not simply
12046 added, but the maximum is taken.
12049 \begin_layout Subsection
12053 \begin_layout Standard
12054 \begin_inset CommandInset label
12060 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12061 define the floats (
12062 \begin_inset Flex CharStyle:MenuItem
12065 \begin_layout Plain Layout
12072 \begin_inset Flex CharStyle:MenuItem
12075 \begin_layout Plain Layout
12081 , \SpecialChar \ldots{}
12082 ) in the text class itself.
12083 Standard floats are included in the file
12084 \begin_inset Flex CharStyle:Code
12087 \begin_layout Plain Layout
12093 , so you may have to do no more than add
12096 \begin_layout LyX-Code
12097 Input stdfloats.inc
12100 \begin_layout Standard
12101 to your layout file.
12102 If you want to implement a text class that proposes some other float types
12103 (like the AGU class bundled with LyX), the information below will hopefully
12107 \begin_layout Description
12108 \begin_inset Flex CharStyle:Code
12111 \begin_layout Plain Layout
12118 \begin_inset Flex CharStyle:Code
12121 \begin_layout Plain Layout
12128 \begin_inset Quotes erd
12132 \begin_inset Quotes erd
12135 ] The file name extension of an auxiliary file for the list of figures (or
12137 LaTeX writes the captions to this file.
12140 \begin_layout Description
12141 \begin_inset Flex CharStyle:Code
12144 \begin_layout Plain Layout
12151 \begin_inset Flex CharStyle:Code
12154 \begin_layout Plain Layout
12161 \begin_inset Quotes erd
12165 \begin_inset Quotes erd
12168 ] The string that will be used in the menus and also for the caption.
12171 \begin_layout Description
12172 \begin_inset Flex CharStyle:Code
12175 \begin_layout Plain Layout
12182 \begin_inset Flex CharStyle:Code
12185 \begin_layout Plain Layout
12194 \begin_inset Flex CharStyle:Code
12197 \begin_layout Plain Layout
12204 \begin_inset Flex CharStyle:Code
12207 \begin_layout Plain Layout
12213 if the float is already defined by the LaTeX document class.
12215 \begin_inset Flex CharStyle:Code
12218 \begin_layout Plain Layout
12224 , the float will be defined using the LaTeX package
12225 \begin_inset Flex CharStyle:Code
12228 \begin_layout Plain Layout
12237 \begin_layout Description
12238 \begin_inset Flex CharStyle:Code
12241 \begin_layout Plain Layout
12248 \begin_inset Flex CharStyle:Code
12251 \begin_layout Plain Layout
12258 \begin_inset Quotes erd
12262 \begin_inset Quotes erd
12265 ] The heading used for the list of floats.
12268 \begin_layout Description
12269 \begin_inset Flex CharStyle:Code
12272 \begin_layout Plain Layout
12279 \begin_inset Flex CharStyle:Code
12282 \begin_layout Plain Layout
12289 \begin_inset Quotes erd
12293 \begin_inset Quotes erd
12296 ] This (optional) argument determines whether floats of this class will
12297 be numbered within some sectional unit of the document.
12298 For example, if within is equal to
12299 \begin_inset Flex CharStyle:Code
12302 \begin_layout Plain Layout
12308 , the floats will be numbered within chapters.
12312 \begin_layout Description
12313 \begin_inset Flex CharStyle:Code
12316 \begin_layout Plain Layout
12323 \begin_inset Flex CharStyle:Code
12326 \begin_layout Plain Layout
12333 \begin_inset Quotes erd
12337 \begin_inset Quotes erd
12340 ] The default placement for the given class of floats.
12341 The string should be as in standard LaTeX:
12342 \begin_inset Flex CharStyle:Code
12345 \begin_layout Plain Layout
12352 \begin_inset Flex CharStyle:Code
12355 \begin_layout Plain Layout
12362 \begin_inset Flex CharStyle:Code
12365 \begin_layout Plain Layout
12372 \begin_inset Flex CharStyle:Code
12375 \begin_layout Plain Layout
12381 for top, bottom, page, and here, respectively.
12385 \begin_layout Plain Layout
12386 Note that the order of these letters in the string is irrelevant, like in
12392 On top of that there is a new type,
12393 \begin_inset Flex CharStyle:Code
12396 \begin_layout Plain Layout
12402 , which does not really correspond to a float, since it means: put it
12403 \begin_inset Quotes eld
12407 \begin_inset Quotes erd
12411 Note however that the
12412 \begin_inset Flex CharStyle:Code
12415 \begin_layout Plain Layout
12421 specifier is special and, because of implementation details, cannot be
12422 used in non-builtin float types.
12423 If you do not understand what this means, just use
12424 \begin_inset Quotes eld
12428 \begin_inset Flex CharStyle:Code
12431 \begin_layout Plain Layout
12438 \begin_inset Quotes erd
12444 \begin_layout Description
12445 \begin_inset Flex CharStyle:Code
12448 \begin_layout Plain Layout
12455 \begin_inset Flex CharStyle:Code
12458 \begin_layout Plain Layout
12465 \begin_inset Quotes erd
12469 \begin_inset Quotes erd
12472 ] The style used when defining the float using
12473 \begin_inset Flex CharStyle:Code
12476 \begin_layout Plain Layout
12487 \begin_layout Description
12488 \begin_inset Flex CharStyle:Code
12491 \begin_layout Plain Layout
12498 \begin_inset Flex CharStyle:Code
12501 \begin_layout Plain Layout
12508 \begin_inset Quotes erd
12512 \begin_inset Quotes erd
12516 \begin_inset Quotes eld
12520 \begin_inset Quotes erd
12523 of the new class of floats, like program or algorithm.
12524 After the appropriate
12525 \begin_inset Flex CharStyle:Code
12528 \begin_layout Plain Layout
12537 \begin_inset Flex CharStyle:Code
12540 \begin_layout Plain Layout
12549 \begin_inset Flex CharStyle:Code
12552 \begin_layout Plain Layout
12563 \begin_layout Standard
12564 Note that defining a float with type
12565 \begin_inset Flex CharStyle:Code
12568 \begin_layout Plain Layout
12576 automatically defines the corresponding counter with name
12577 \begin_inset Flex CharStyle:Code
12580 \begin_layout Plain Layout
12591 \begin_layout Subsection
12592 Inset layouts and Flex insets
12595 \begin_layout Standard
12596 \begin_inset CommandInset label
12598 name "sec:charstyle"
12602 LyX has supported character styles since version 1.4.0; since version 1.6.0
12603 these are called Flex insets.
12607 \begin_layout Standard
12608 Furthermore, it is possible to define the general layout of many different
12610 Currently, InsetLayout can be used to customize the layout parameters
12611 for footnotes, marginal notes, note insets, ERT insets, branches, listings,
12612 indexes, boxes, tables, algorithms, URLs, and optional arguments, as well
12617 \begin_layout Standard
12618 Flex insets come in three different kinds:
12621 \begin_layout Itemize
12623 \begin_inset Flex CharStyle:Code
12626 \begin_layout Plain Layout
12632 ): These define semantic markup corresponding to such LaTeX commands as
12634 \begin_inset Flex CharStyle:Code
12637 \begin_layout Plain Layout
12646 \begin_inset Flex CharStyle:Code
12649 \begin_layout Plain Layout
12660 \begin_layout Itemize
12662 \begin_inset Flex CharStyle:Code
12665 \begin_layout Plain Layout
12671 ): These can be used to define custom collapsable insets, similar to ERT,
12672 footnote, and the like.
12675 \begin_layout Itemize
12677 \begin_inset Flex CharStyle:Code
12680 \begin_layout Plain Layout
12686 ): For use with DocBook classes.
12689 \begin_layout Standard
12691 \begin_inset Flex CharStyle:Code
12694 \begin_layout Plain Layout
12700 definition starting line is of the form
12703 \begin_layout LyX-Code
12704 InsetLayout <Type> <Name>
12707 \begin_layout Standard
12709 \begin_inset Flex CharStyle:Code
12712 \begin_layout Plain Layout
12719 \begin_inset Flex CharStyle:Code
12722 \begin_layout Plain Layout
12729 \begin_inset Flex CharStyle:Code
12732 \begin_layout Plain Layout
12739 \begin_inset Flex CharStyle:Code
12742 \begin_layout Plain Layout
12749 \begin_inset Flex CharStyle:Code
12752 \begin_layout Plain Layout
12759 \begin_inset Flex CharStyle:Code
12762 \begin_layout Plain Layout
12769 \begin_inset Flex CharStyle:Code
12772 \begin_layout Plain Layout
12779 \begin_inset Flex CharStyle:Code
12782 \begin_layout Plain Layout
12789 \begin_inset Flex CharStyle:Code
12792 \begin_layout Plain Layout
12799 \begin_inset Flex CharStyle:Code
12802 \begin_layout Plain Layout
12809 \begin_inset Flex CharStyle:Code
12812 \begin_layout Plain Layout
12819 \begin_inset Flex CharStyle:Code
12822 \begin_layout Plain Layout
12829 \begin_inset Flex CharStyle:Code
12832 \begin_layout Plain Layout
12839 \begin_inset Flex CharStyle:Code
12842 \begin_layout Plain Layout
12849 \begin_inset Flex CharStyle:Code
12852 \begin_layout Plain Layout
12859 \begin_inset Flex CharStyle:Code
12862 \begin_layout Plain Layout
12869 \begin_inset Flex CharStyle:Code
12872 \begin_layout Plain Layout
12880 \begin_inset Flex CharStyle:Code
12883 \begin_layout Plain Layout
12890 \begin_inset Flex CharStyle:Code
12893 \begin_layout Plain Layout
12900 \begin_inset Flex CharStyle:Code
12903 \begin_layout Plain Layout
12909 should have the form
12910 \begin_inset Flex CharStyle:Code
12913 \begin_layout Plain Layout
12920 \begin_inset Flex CharStyle:Code
12923 \begin_layout Plain Layout
12930 \begin_inset Flex CharStyle:Code
12933 \begin_layout Plain Layout
12940 \begin_inset Flex CharStyle:Code
12943 \begin_layout Plain Layout
12950 \begin_inset Flex CharStyle:Code
12953 \begin_layout Plain Layout
12960 \begin_inset Flex CharStyle:Code
12963 \begin_layout Plain Layout
12969 is any valid identifier.
12973 \begin_layout Standard
12975 \begin_inset Flex CharStyle:Code
12978 \begin_layout Plain Layout
12984 section can contain the following entries:
12987 \begin_layout Description
12988 \begin_inset Flex CharStyle:Code
12991 \begin_layout Plain Layout
12997 The color for the inset's background.
12998 These valid colors are defined in
12999 \begin_inset Flex CharStyle:Code
13002 \begin_layout Plain Layout
13011 \begin_layout Description
13012 \begin_inset Flex CharStyle:Code
13015 \begin_layout Plain Layout
13021 As with paragraph styles (see page
13022 \begin_inset CommandInset ref
13024 reference "des:CopyStyle"
13031 \begin_layout Description
13032 \begin_inset Flex CharStyle:Code
13035 \begin_layout Plain Layout
13042 \begin_inset Flex CharStyle:Code
13045 \begin_layout Plain Layout
13052 \begin_inset Flex CharStyle:Code
13055 \begin_layout Plain Layout
13062 \begin_inset Flex CharStyle:Code
13065 \begin_layout Plain Layout
13071 , describing the rendering style used for the inset's frame and buttons.
13072 Footnotes generally use
13073 \begin_inset Flex CharStyle:Code
13076 \begin_layout Plain Layout
13082 ; ERT insets generally use
13083 \begin_inset Flex CharStyle:Code
13086 \begin_layout Plain Layout
13092 ; and character styles use
13093 \begin_inset Flex CharStyle:Code
13096 \begin_layout Plain Layout
13105 \begin_layout Description
13106 \begin_inset Flex CharStyle:Code
13109 \begin_layout Plain Layout
13115 The font used for both the text body
13121 \begin_inset space ~
13125 \begin_inset CommandInset ref
13127 reference "sec:fonts"
13132 Note that defining this font automatically defines the
13133 \begin_inset Flex CharStyle:Code
13136 \begin_layout Plain Layout
13142 to the same value, so define this first and define
13143 \begin_inset Flex CharStyle:Code
13146 \begin_layout Plain Layout
13152 later if you want them to be different.
13155 \begin_layout Description
13156 \begin_inset Flex CharStyle:Code
13159 \begin_layout Plain Layout
13168 \begin_layout Description
13169 \begin_inset Flex CharStyle:Code
13172 \begin_layout Plain Layout
13178 As with paragraph styles (see page
13179 \begin_inset CommandInset ref
13180 LatexCommand pageref
13181 reference "des:FreeSpacing"
13188 \begin_layout Description
13189 \begin_inset Flex CharStyle:Code
13192 \begin_layout Plain Layout
13198 As with paragraph styles (see page
13199 \begin_inset CommandInset ref
13200 LatexCommand pageref
13201 reference "des:KeepEmpty"
13208 \begin_layout Description
13209 \begin_inset Flex CharStyle:Code
13212 \begin_layout Plain Layout
13218 What will be displayed on the button or elsewhere as the inset label.
13219 Some inset types (ERT and Branch) modify this label on the fly.
13222 \begin_layout Description
13223 \begin_inset Flex CharStyle:Code
13226 \begin_layout Plain Layout
13232 The font used for the label.
13234 \begin_inset space ~
13238 \begin_inset CommandInset ref
13240 reference "sec:fonts"
13245 Note that this definition can never appear before
13246 \begin_inset Flex CharStyle:Code
13249 \begin_layout Plain Layout
13255 , lest it be ineffective.
13258 \begin_layout Description
13259 \begin_inset Flex CharStyle:Code
13262 \begin_layout Plain Layout
13268 The name of the corresponding LaTeX stuff.
13269 Either the environment or command name.
13272 \begin_layout Description
13273 \begin_inset Flex CharStyle:Code
13276 \begin_layout Plain Layout
13282 The optional parameter for the corresponding
13283 \begin_inset Flex CharStyle:Code
13286 \begin_layout Plain Layout
13292 stuff, including possible bracket pairs like
13293 \begin_inset Flex CharStyle:Code
13296 \begin_layout Plain Layout
13303 This parameter cannot be changed from within LyX.
13306 \begin_layout Description
13307 \begin_inset Flex CharStyle:Code
13310 \begin_layout Plain Layout
13316 As with paragraph styles (see page
13317 \begin_inset CommandInset ref
13318 LatexCommand pageref
13319 reference "des:LatexType"
13326 \begin_layout Description
13327 \begin_inset Flex CharStyle:Code
13330 \begin_layout Plain Layout
13337 \begin_inset Flex CharStyle:Code
13340 \begin_layout Plain Layout
13347 \begin_inset Flex CharStyle:Code
13350 \begin_layout Plain Layout
13357 \begin_inset Flex CharStyle:Code
13360 \begin_layout Plain Layout
13367 \begin_inset Flex CharStyle:Code
13370 \begin_layout Plain Layout
13376 (indicating a dummy definition ending definitions of charstyles etc.).
13377 This entry is only meaningful for Flex (user definable) insets.
13380 \begin_layout Description
13381 \begin_inset Flex CharStyle:Code
13384 \begin_layout Plain Layout
13391 \begin_inset Flex CharStyle:Code
13394 \begin_layout Plain Layout
13403 \begin_inset Flex CharStyle:Code
13406 \begin_layout Plain Layout
13412 ] Whether fragile commands in this layout should be
13413 \begin_inset Flex CharStyle:Code
13416 \begin_layout Plain Layout
13429 whether this command should itself be protected.)
13432 \begin_layout Description
13433 \begin_inset Flex CharStyle:Code
13436 \begin_layout Plain Layout
13442 As with paragraph styles (see page
13443 \begin_inset CommandInset ref
13444 LatexCommand pageref
13445 reference "des:Preamble"
13452 \begin_layout Description
13453 \begin_inset Flex CharStyle:Code
13456 \begin_layout Plain Layout
13463 \begin_inset Flex CharStyle:Code
13466 \begin_layout Plain Layout
13472 ] As with paragraph styles (see page
13473 \begin_inset CommandInset ref
13474 LatexCommand pageref
13475 reference "des:Requires"
13482 \begin_layout Subsection
13486 \begin_layout Standard
13487 \begin_inset CommandInset label
13493 Since version 1.3.0 of LyX, it is both possible and necessary to define the
13495 \begin_inset Flex CharStyle:MenuItem
13498 \begin_layout Plain Layout
13505 \begin_inset Flex CharStyle:MenuItem
13508 \begin_layout Plain Layout
13514 , \SpecialChar \ldots{}
13515 ) in the text class itself.
13516 The standard counters are defined in the file
13517 \begin_inset Flex CharStyle:Code
13520 \begin_layout Plain Layout
13526 , so you may have to do no more than add
13529 \begin_layout LyX-Code
13530 Input stdcounters.inc
13533 \begin_layout Standard
13534 to your layout file to get them to work.
13535 But if you want to define custom counters, then you can do so, using the
13536 following parameters:
13539 \begin_layout Description
13540 \begin_inset Flex CharStyle:Code
13543 \begin_layout Plain Layout
13544 LabelString [string=""]
13549 when this is defined, this string defines how the counter is displayed.
13550 Setting this value sets
13551 \begin_inset Flex CharStyle:Code
13554 \begin_layout Plain Layout
13555 LabelStringAppendix
13561 The following special constructs can be used in the string:
13565 \begin_layout Itemize
13566 \begin_inset Flex CharStyle:Code
13569 \begin_layout Plain Layout
13577 will be replaced by the expansion of the
13578 \begin_inset Flex CharStyle:Code
13581 \begin_layout Plain Layout
13588 \begin_inset Flex CharStyle:Code
13591 \begin_layout Plain Layout
13592 LabelStringAppendix
13598 \begin_inset Flex CharStyle:Code
13601 \begin_layout Plain Layout
13611 \begin_layout Itemize
13612 counter values can be expressed using LaTeX-like macros
13613 \begin_inset Flex CharStyle:Code
13616 \begin_layout Plain Layout
13633 \begin_inset Flex CharStyle:Code
13636 \begin_layout Plain Layout
13648 \begin_layout Plain Layout
13658 Actually, the situation is a bit more complicated: any
13677 other than those descibed below will produce arabic numerals.
13678 It would not be surprising to see this change in the future.
13684 \begin_inset Flex CharStyle:Code
13687 \begin_layout Plain Layout
13693 : 1, 2, 3,\SpecialChar \ldots{}
13695 \begin_inset Flex CharStyle:Code
13698 \begin_layout Plain Layout
13704 for lower-case letters: a, b, c, \SpecialChar \ldots{}
13706 \begin_inset Flex CharStyle:Code
13709 \begin_layout Plain Layout
13715 for upper-case letters: A, B, C, \SpecialChar \ldots{}
13717 \begin_inset Flex CharStyle:Code
13720 \begin_layout Plain Layout
13726 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13728 \begin_inset Flex CharStyle:Code
13731 \begin_layout Plain Layout
13737 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13739 \begin_inset Flex CharStyle:Code
13742 \begin_layout Plain Layout
13748 for hebrew numerals.
13752 \begin_layout Standard
13753 If LabelString is not defined, a default value is constructed as follows:
13754 if the counter has a master counter
13755 \begin_inset Flex CharStyle:Code
13758 \begin_layout Plain Layout
13765 \begin_inset Flex CharStyle:Code
13768 \begin_layout Plain Layout
13775 \begin_inset Flex CharStyle:Code
13778 \begin_layout Plain Layout
13788 is used; otherwise the string
13789 \begin_inset Flex CharStyle:Code
13792 \begin_layout Plain Layout
13803 \begin_layout Description
13804 \begin_inset Flex CharStyle:Code
13807 \begin_layout Plain Layout
13808 LabelStringAppendix [string=""]
13814 \begin_inset Flex CharStyle:Code
13817 \begin_layout Plain Layout
13826 \begin_layout Description
13827 \begin_inset Flex CharStyle:Code
13830 \begin_layout Plain Layout
13837 \begin_inset Flex CharStyle:Code
13840 \begin_layout Plain Layout
13847 \begin_inset Quotes erd
13851 \begin_inset Quotes erd
13854 ] The name of the counter.
13857 \begin_layout Description
13858 \begin_inset Flex CharStyle:Code
13861 \begin_layout Plain Layout
13868 \begin_inset Flex CharStyle:Code
13871 \begin_layout Plain Layout
13878 \begin_inset Quotes erd
13882 \begin_inset Quotes erd
13885 ] If this is set to the name of another counter, the present counter will
13886 be reset everytime the other one is increased.
13888 \begin_inset Flex CharStyle:Code
13891 \begin_layout Plain Layout
13898 \begin_inset Flex CharStyle:Code
13901 \begin_layout Plain Layout
13910 \begin_layout Subsection
13914 \begin_layout Standard
13915 \begin_inset CommandInset label
13921 A font description looks like this:
13924 \begin_layout LyX-Code
13934 \begin_layout LyX-Code
13938 \begin_layout LyX-Code
13942 \begin_layout Standard
13943 The following commands are available:
13946 \begin_layout Description
13947 \begin_inset Flex CharStyle:Code
13950 \begin_layout Plain Layout
13957 \begin_inset Flex CharStyle:Code
13960 \begin_layout Plain Layout
13969 \begin_inset Flex CharStyle:Code
13972 \begin_layout Plain Layout
13979 \begin_inset Flex CharStyle:Code
13982 \begin_layout Plain Layout
13989 \begin_inset Flex CharStyle:Code
13992 \begin_layout Plain Layout
13999 \begin_inset Flex CharStyle:Code
14002 \begin_layout Plain Layout
14009 \begin_inset Flex CharStyle:Code
14012 \begin_layout Plain Layout
14019 \begin_inset Flex CharStyle:Code
14022 \begin_layout Plain Layout
14029 \begin_inset Flex CharStyle:Code
14032 \begin_layout Plain Layout
14039 \begin_inset Flex CharStyle:Code
14042 \begin_layout Plain Layout
14051 \begin_layout Description
14052 \begin_inset Flex CharStyle:Code
14055 \begin_layout Plain Layout
14064 \begin_inset Flex CharStyle:Code
14067 \begin_layout Plain Layout
14078 \begin_inset Flex CharStyle:Code
14081 \begin_layout Plain Layout
14088 \begin_inset Flex CharStyle:Code
14091 \begin_layout Plain Layout
14100 \begin_layout Description
14101 \begin_inset Flex CharStyle:Code
14104 \begin_layout Plain Layout
14111 \begin_inset Flex CharStyle:Code
14114 \begin_layout Plain Layout
14120 ] Valid argument sare:
14121 \begin_inset Flex CharStyle:Code
14124 \begin_layout Plain Layout
14131 \begin_inset Flex CharStyle:Code
14134 \begin_layout Plain Layout
14141 \begin_inset Flex CharStyle:Code
14144 \begin_layout Plain Layout
14151 \begin_inset Flex CharStyle:Code
14154 \begin_layout Plain Layout
14161 \begin_inset Flex CharStyle:Code
14164 \begin_layout Plain Layout
14171 \begin_inset Flex CharStyle:Code
14174 \begin_layout Plain Layout
14181 Each of these turns on or off the corresponding attribute.
14184 \begin_layout Description
14185 \begin_inset Flex CharStyle:Code
14188 \begin_layout Plain Layout
14197 \begin_inset Flex CharStyle:Code
14200 \begin_layout Plain Layout
14211 \begin_inset Flex CharStyle:Code
14214 \begin_layout Plain Layout
14223 \begin_layout Description
14224 \begin_inset Flex CharStyle:Code
14227 \begin_layout Plain Layout
14236 \begin_inset Flex CharStyle:Code
14239 \begin_layout Plain Layout
14250 \begin_inset Flex CharStyle:Code
14253 \begin_layout Plain Layout
14260 \begin_inset Flex CharStyle:Code
14263 \begin_layout Plain Layout
14270 \begin_inset Flex CharStyle:Code
14273 \begin_layout Plain Layout
14282 \begin_layout Description
14283 \begin_inset Flex CharStyle:Code
14286 \begin_layout Plain Layout
14293 \begin_inset Flex CharStyle:Code
14296 \begin_layout Plain Layout
14303 \begin_inset Flex CharStyle:Code
14306 \begin_layout Plain Layout
14313 \begin_inset Flex CharStyle:Code
14316 \begin_layout Plain Layout
14325 \begin_inset Flex CharStyle:Code
14328 \begin_layout Plain Layout
14335 \begin_inset Flex CharStyle:Code
14338 \begin_layout Plain Layout
14345 \begin_inset Flex CharStyle:Code
14348 \begin_layout Plain Layout
14355 \begin_inset Flex CharStyle:Code
14358 \begin_layout Plain Layout
14365 \begin_inset Flex CharStyle:Code
14368 \begin_layout Plain Layout
14377 \begin_layout Subsection
14378 Upgrading old layout files
14381 \begin_layout Standard
14382 The file format of layout files changes from time to time, so old layout
14383 files need to be converted.
14384 This process has been automated since LyX 1.4.0: If LyX reads an old format
14385 layout file it will call the conversion tool
14386 \begin_inset Flex CharStyle:Code
14389 \begin_layout Plain Layout
14390 LyXDir/scripts/layout2layout.py
14395 and convert it to a temporary file in current format.
14396 The original file is left untouched.
14397 If you want to convert the layout file permanently, just call the converter
14401 \begin_layout LyX-Code
14402 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
14405 \begin_layout Standard
14406 (You need to replace
14407 \begin_inset Flex CharStyle:Code
14410 \begin_layout Plain Layout
14416 with the name of your LyX system directory, unless you happen to have defined
14417 such an environment variable.) Then copy
14418 \begin_inset Flex CharStyle:Code
14421 \begin_layout Plain Layout
14428 \begin_inset Flex CharStyle:Code
14431 \begin_layout Plain Layout
14440 \begin_layout Standard
14441 The automatic conversion only handles syntax changes.
14442 It cannot handle the case where the contents of included files was changed,
14443 so these will have to be converted separately.
14446 \begin_layout Section
14448 \begin_inset CommandInset label
14450 name "sec:templates"
14457 \begin_layout Standard
14458 Templates are created just like usual documents.
14459 The only difference is that usual documents contain all possible settings,
14460 including the font scheme and the paper size.
14461 Usually a user doesn't want a template to overwrite his defaults in these
14463 For that reason, the designer of a template should remove the corresponding
14465 \begin_inset Flex CharStyle:Code
14468 \begin_layout Plain Layout
14477 \begin_inset Flex CharStyle:Code
14480 \begin_layout Plain Layout
14488 from the template LyX file.
14489 This can be done with any simple text-editor, for example
14490 \begin_inset Flex CharStyle:Code
14493 \begin_layout Plain Layout
14500 \begin_inset Flex CharStyle:Code
14503 \begin_layout Plain Layout
14513 \begin_layout Standard
14514 Put the edited template files you create in
14515 \begin_inset Flex CharStyle:Code
14518 \begin_layout Plain Layout
14524 , copy the ones you use from the global template directory in
14525 \begin_inset Flex CharStyle:Code
14528 \begin_layout Plain Layout
14534 to the same place, and redefine the template path in the
14535 \begin_inset Flex CharStyle:MenuItem
14538 \begin_layout Plain Layout
14546 \SpecialChar \menuseparator
14551 references\SpecialChar \menuseparator
14560 \begin_layout Standard
14561 Note that there is a template which has a particular meaning:
14562 \begin_inset Flex CharStyle:Code
14565 \begin_layout Plain Layout
14572 This template is loaded everytime you create a new document with
14573 \begin_inset Flex CharStyle:MenuItem
14576 \begin_layout Plain Layout
14586 \SpecialChar \menuseparator
14588 \begin_inset Flex CharStyle:MenuItem
14591 \begin_layout Plain Layout
14601 in order to provide useful defaults.
14602 To create this template from inside LyX, all you have to do is to open
14603 a document with the correct settings, and use the
14604 \begin_inset Flex CharStyle:MenuItem
14607 \begin_layout Plain Layout
14612 e as Document Defaults
14620 \begin_layout Chapter
14621 Including External Material
14624 \begin_layout Standard
14625 The use of material from sources external to LyX is covered in detail in
14631 This part of the manual covers what needs to happen behind the scenes for
14632 new sorts of material to be included.
14635 \begin_layout Section
14639 \begin_layout Standard
14640 The external material feature is based on the concept of a
14645 A template is a specification of how LyX should interface with a certain
14647 As bundled, LyX comes with predefined templates for Xfig figures, various
14648 raster format images, chess diagrams, and LilyPond music notation.
14649 You can check the actual list by using the menu
14650 \begin_inset Flex CharStyle:MenuItem
14653 \begin_layout Plain Layout
14654 Insert\SpecialChar \menuseparator
14655 File\SpecialChar \menuseparator
14662 Furthermore, it is possible to roll your own template to support a specific
14664 Later we'll describe in more detail what is involved, and hopefully you
14665 will submit all the templates you create so we can include them in a later
14669 \begin_layout Standard
14670 Another basic idea of the external material feature is to distinguish between
14671 the original file that serves as a base for final material and the produced
14672 file that is included in your exported or printed document.
14673 For example, consider the case of a figure produced with
14674 \begin_inset Flex CharStyle:Code
14677 \begin_layout Plain Layout
14684 The Xfig application itself works on an original file with the
14685 \begin_inset Flex CharStyle:Code
14688 \begin_layout Plain Layout
14695 Within XFig, you create and change your figure, and when you are done,
14697 \begin_inset Flex CharStyle:Code
14700 \begin_layout Plain Layout
14707 When you want to include the figure in your document, you invoke
14708 \begin_inset Flex CharStyle:Code
14711 \begin_layout Plain Layout
14717 in order to create a PostScript file that can readily be included in your
14720 \begin_inset Flex CharStyle:Code
14723 \begin_layout Plain Layout
14729 file is the original file, and the PostScript file is the produced file.
14732 \begin_layout Standard
14733 This distinction is important in order to allow updating of the material
14734 while you are in the process of writing the document.
14735 Furthermore, it provides us with the flexibility that is needed to support
14736 multiple export formats.
14737 For instance, in the case of a plain text file, it is not exactly an award-winn
14738 ing idea to include the figure as raw PostScript®.
14739 Instead, you'd either prefer to just include a reference to the figure
14740 or try to invoke some graphics to Ascii converter to make the final result
14741 look similar to the real graphics.
14742 The external material management allows you to do this, because it is parameter
14743 ized on the different export formats that LyX supports.
14746 \begin_layout Standard
14747 Besides supporting the production of different products according to the
14748 exported format, it supports tight integration with editing and viewing
14750 In the case of an XFig figure, you are able to invoke Xfig on the original
14751 file with a single click from within the external material dialog in LyX,
14752 and also preview the produced PostScript file with ghostview with another
14754 No more fiddling around with the command line and/or file browsers to locate
14755 and manipulate the original or produced files.
14756 In this way, you are finally able to take full advantage of the many different
14757 applications that are relevant to use when you write your documents, and
14758 ultimately be more productive.
14761 \begin_layout Section
14762 The external template configuration file
14765 \begin_layout Standard
14766 It is relatively easy to add custom external template definitions to LyX.
14767 However, be aware that doing this in an careless manner most probably
14771 introduce an easily exploitable security hole.
14772 So before you do this, please read the discussion about security in section
14774 \begin_inset CommandInset ref
14776 reference "sec:Security-discussion"
14783 \begin_layout Standard
14784 Having said that, we encourage you to submit any interesting templates that
14789 \begin_layout Standard
14790 The external templates are defined in the
14791 \begin_inset Flex CharStyle:Code
14794 \begin_layout Plain Layout
14795 LyXDir/lib/external_templates
14801 You can place your own version in
14802 \begin_inset Flex CharStyle:Code
14805 \begin_layout Plain Layout
14806 UserDir/external_templates
14814 \begin_layout Standard
14815 A typical template looks like this:
14818 \begin_layout LyX-Code
14822 \begin_layout LyX-Code
14823 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14826 \begin_layout LyX-Code
14830 \begin_layout LyX-Code
14834 \begin_layout LyX-Code
14838 \begin_layout LyX-Code
14842 \begin_layout LyX-Code
14846 \begin_layout LyX-Code
14847 AutomaticProduction true
14850 \begin_layout LyX-Code
14854 \begin_layout LyX-Code
14858 \begin_layout LyX-Code
14862 \begin_layout LyX-Code
14863 TransformCommand Rotate RotationLatexCommand
14866 \begin_layout LyX-Code
14867 TransformCommand Resize ResizeLatexCommand
14870 \begin_layout LyX-Code
14871 Product "$$RotateFront$$ResizeFront
14874 \begin_layout LyX-Code
14879 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14882 \begin_layout LyX-Code
14883 $$ResizeBack$$RotateBack"
14886 \begin_layout LyX-Code
14890 \begin_layout LyX-Code
14891 UpdateResult "$$AbsPath$$Basename.pstex_t"
14894 \begin_layout LyX-Code
14895 Requirement "graphicx"
14898 \begin_layout LyX-Code
14899 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14902 \begin_layout LyX-Code
14903 ReferencedFile latex "$$AbsPath$$Basename.eps"
14906 \begin_layout LyX-Code
14907 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14910 \begin_layout LyX-Code
14914 \begin_layout LyX-Code
14918 \begin_layout LyX-Code
14919 TransformCommand Rotate RotationLatexCommand
14922 \begin_layout LyX-Code
14923 TransformCommand Resize ResizeLatexCommand
14926 \begin_layout LyX-Code
14927 Product "$$RotateFront$$ResizeFront
14930 \begin_layout LyX-Code
14935 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14938 \begin_layout LyX-Code
14939 $$ResizeBack$$RotateBack"
14942 \begin_layout LyX-Code
14943 UpdateFormat pdftex
14946 \begin_layout LyX-Code
14947 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14950 \begin_layout LyX-Code
14951 Requirement "graphicx"
14954 \begin_layout LyX-Code
14955 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14958 \begin_layout LyX-Code
14959 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14962 \begin_layout LyX-Code
14966 \begin_layout LyX-Code
14970 \begin_layout LyX-Code
14971 Product "$$Contents(
14973 "$$AbsPath$$Basename.asc
14978 \begin_layout LyX-Code
14979 UpdateFormat asciixfig
14982 \begin_layout LyX-Code
14983 UpdateResult "$$AbsPath$$Basename.asc"
14986 \begin_layout LyX-Code
14990 \begin_layout LyX-Code
14994 \begin_layout LyX-Code
14995 Product "<graphic fileref=
14997 "$$AbsOrRelPathMaster$$Basename.eps
15002 \begin_layout LyX-Code
15006 \begin_layout LyX-Code
15010 \begin_layout LyX-Code
15011 UpdateResult "$$AbsPath$$Basename.eps"
15014 \begin_layout LyX-Code
15015 ReferencedFile docbook "$$AbsPath$$Basename.eps"
15018 \begin_layout LyX-Code
15019 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
15022 \begin_layout LyX-Code
15026 \begin_layout LyX-Code
15027 Product "[XFig: $$FName]"
15030 \begin_layout LyX-Code
15034 \begin_layout LyX-Code
15038 \begin_layout Standard
15039 As you can see, the template is enclosed in
15040 \begin_inset Flex CharStyle:Code
15043 \begin_layout Plain Layout
15049 \SpecialChar \ldots{}
15051 \begin_inset Flex CharStyle:Code
15054 \begin_layout Plain Layout
15061 It contains a header specifying some general settings and, for each supported
15062 primary document file format, a section
15063 \begin_inset Flex CharStyle:Code
15066 \begin_layout Plain Layout
15072 \SpecialChar \ldots{}
15074 \begin_inset Flex CharStyle:Code
15077 \begin_layout Plain Layout
15086 \begin_layout Subsection
15087 The template header
15090 \begin_layout Description
15091 \begin_inset Flex CharStyle:Code
15094 \begin_layout Plain Layout
15095 AutomaticProduction
15096 \begin_inset space ~
15104 Whether the file represented by the template must be generated by LyX.
15105 This command must occur exactly once.
15108 \begin_layout Description
15109 \begin_inset Flex CharStyle:Code
15112 \begin_layout Plain Layout
15114 \begin_inset space ~
15122 A glob pattern that is used in the file dialog to filter out the desired
15124 If there is more than one possible file extension (e.g.
15125 \begin_inset space ~
15129 \begin_inset Flex CharStyle:Code
15132 \begin_layout Plain Layout
15139 \begin_inset Flex CharStyle:Code
15142 \begin_layout Plain Layout
15148 ), use something like
15149 \begin_inset Flex CharStyle:Code
15152 \begin_layout Plain Layout
15159 This command must occur exactly once.
15162 \begin_layout Description
15163 \begin_inset Flex CharStyle:Code
15166 \begin_layout Plain Layout
15168 \begin_inset space ~
15176 The text that is displayed on the button.
15177 This command must occur exactly once.
15180 \begin_layout Description
15181 \begin_inset Flex CharStyle:Code
15184 \begin_layout Plain Layout
15186 \begin_inset space ~
15190 \begin_inset space ~
15198 The help text that is used in the External dialog.
15199 Provide enough information to explain to the user just what the template
15200 can provide him with.
15201 This command must occur exactly once.
15204 \begin_layout Description
15205 \begin_inset Flex CharStyle:Code
15208 \begin_layout Plain Layout
15210 \begin_inset space ~
15218 The file format of the original file.
15219 This must be the name of a format that is known to LyX (see section
15220 \begin_inset CommandInset ref
15222 reference "sub:Formats"
15228 \begin_inset Quotes eld
15232 \begin_inset Flex CharStyle:Code
15235 \begin_layout Plain Layout
15242 \begin_inset Quotes erd
15245 if the template can handle original files of more than one format.
15246 LyX will attempt to interrogate the file itself in order to deduce its
15247 format in this case.
15248 This command must occur exactly once.
15251 \begin_layout Description
15252 \begin_inset Flex CharStyle:Code
15255 \begin_layout Plain Layout
15257 \begin_inset space ~
15265 A unique name for the template.
15266 It must not contain substitution macros (see below).
15269 \begin_layout Description
15270 \begin_inset Flex CharStyle:Code
15273 \begin_layout Plain Layout
15275 \begin_inset space ~
15278 Rotate|Resize|Clip|Extra
15283 This command specifies which transformations are supported by this template.
15284 It may occur zero or more times.
15285 This command enables the corresponding tabs in the external dialog.
15287 \begin_inset Flex CharStyle:Code
15290 \begin_layout Plain Layout
15296 command must have either a corresponding
15297 \begin_inset Flex CharStyle:Code
15300 \begin_layout Plain Layout
15307 \begin_inset Flex CharStyle:Code
15310 \begin_layout Plain Layout
15317 \begin_inset Flex CharStyle:Code
15320 \begin_layout Plain Layout
15327 Otherwise the transformation will not be supported by that format.
15330 \begin_layout Subsection
15334 \begin_layout Description
15335 \begin_inset Flex CharStyle:Code
15338 \begin_layout Plain Layout
15340 \begin_inset space ~
15343 LaTeX|PDFLaTeX|PlainText|DocBook
15348 The primary document file format that this format definition is for.
15349 Not every template has a sensible representation in all document file formats.
15350 Please define nevertheless a
15351 \begin_inset Flex CharStyle:Code
15354 \begin_layout Plain Layout
15360 section for all formats.
15361 Use a dummy text when no representation is available.
15362 Then you can at least see a reference to the external material in the exported
15366 \begin_layout Description
15367 \begin_inset Flex CharStyle:Code
15370 \begin_layout Plain Layout
15372 \begin_inset space ~
15376 \begin_inset space ~
15384 This command defines an additional macro
15385 \begin_inset Flex CharStyle:Code
15388 \begin_layout Plain Layout
15394 for substitution in
15395 \begin_inset Flex CharStyle:Code
15398 \begin_layout Plain Layout
15406 \begin_inset Flex CharStyle:Code
15409 \begin_layout Plain Layout
15415 itself may contain substitution macros.
15416 The advantage over using
15417 \begin_inset Flex CharStyle:Code
15420 \begin_layout Plain Layout
15427 \begin_inset Flex CharStyle:Code
15430 \begin_layout Plain Layout
15436 is that the substituted value of
15437 \begin_inset Flex CharStyle:Code
15440 \begin_layout Plain Layout
15446 is sanitized so that it is a valid optional argument in the document format.
15447 This command may occur zero or more times.
15450 \begin_layout Description
15451 \begin_inset Flex CharStyle:Code
15454 \begin_layout Plain Layout
15456 \begin_inset space ~
15464 The text that is inserted in the exported document.
15465 This is actually the most important command and can be quite complex.
15466 This command must occur exactly once.
15469 \begin_layout Description
15470 \begin_inset Flex CharStyle:Code
15473 \begin_layout Plain Layout
15475 \begin_inset space ~
15483 This command specifies a preamble snippet that will be included in the
15485 It has to be defined using
15486 \begin_inset Flex CharStyle:Code
15489 \begin_layout Plain Layout
15495 \SpecialChar \ldots{}
15497 \begin_inset Flex CharStyle:Code
15500 \begin_layout Plain Layout
15507 This command may occur zero or more times.
15510 \begin_layout Description
15511 \begin_inset Flex CharStyle:Code
15514 \begin_layout Plain Layout
15516 \begin_inset space ~
15520 \begin_inset space ~
15528 This command denotes files that are created by the conversion process and
15529 are needed for a particular export format.
15530 If the filename is relative, it is interpreted relative to the master document.
15531 This command may be given zero or more times.
15534 \begin_layout Description
15535 \begin_inset Flex CharStyle:Code
15538 \begin_layout Plain Layout
15540 \begin_inset space ~
15548 The name of a required LaTeX package.
15549 The package is included via
15550 \begin_inset Flex CharStyle:Code
15553 \begin_layout Plain Layout
15561 in the LaTeX preamble.
15562 This command may occur zero or more times.
15565 \begin_layout Description
15566 \begin_inset Flex CharStyle:Code
15569 \begin_layout Plain Layout
15571 \begin_inset space ~
15575 \begin_inset space ~
15578 RotationLatexCommand
15583 This command specifies that the built in LaTeX command should be used for
15585 This command may occur once or not at all.
15588 \begin_layout Description
15589 \begin_inset Flex CharStyle:Code
15592 \begin_layout Plain Layout
15594 \begin_inset space ~
15598 \begin_inset space ~
15606 This command specifies that the built in LaTeX command should be used for
15608 This command may occur once or not at all.
15611 \begin_layout Description
15612 \begin_inset Flex CharStyle:Code
15615 \begin_layout Plain Layout
15617 \begin_inset space ~
15621 \begin_inset space ~
15624 RotationLatexOption
15629 This command specifies that rotation is done via an optional argument.
15630 This command may occur once or not at all.
15633 \begin_layout Description
15634 \begin_inset Flex CharStyle:Code
15637 \begin_layout Plain Layout
15639 \begin_inset space ~
15643 \begin_inset space ~
15651 This command specifies that resizing is done via an optional argument.
15652 This command may occur once or not at all.
15655 \begin_layout Description
15656 \begin_inset Flex CharStyle:Code
15659 \begin_layout Plain Layout
15661 \begin_inset space ~
15665 \begin_inset space ~
15673 This command specifies that clipping is done via an optional argument.
15674 This command may occur once or not at all.
15677 \begin_layout Description
15678 \begin_inset Flex CharStyle:Code
15681 \begin_layout Plain Layout
15683 \begin_inset space ~
15687 \begin_inset space ~
15695 This command specifies that an extra optional argument is used.
15696 This command may occur once or not at all.
15699 \begin_layout Description
15700 \begin_inset Flex CharStyle:Code
15703 \begin_layout Plain Layout
15705 \begin_inset space ~
15713 The file format of the converted file.
15714 This must be the name of a format that is known to LyX (see the
15715 \begin_inset Flex CharStyle:MenuItem
15718 \begin_layout Plain Layout
15723 ools\SpecialChar \menuseparator
15728 references:Conversion
15734 This command must occur exactly once.
15737 \begin_layout Description
15738 \begin_inset Flex CharStyle:Code
15741 \begin_layout Plain Layout
15743 \begin_inset space ~
15751 The file name of the converted file.
15752 The file name must be absolute.
15753 This command must occur exactly once.
15756 \begin_layout Subsection
15757 Preamble definitions
15760 \begin_layout Standard
15761 The external template configuration file may contain additional preamble
15762 definitions enclosed by
15763 \begin_inset Flex CharStyle:Code
15766 \begin_layout Plain Layout
15772 \SpecialChar \ldots{}
15774 \begin_inset Flex CharStyle:Code
15777 \begin_layout Plain Layout
15784 They can be used by the templates in the
15785 \begin_inset Flex CharStyle:Code
15788 \begin_layout Plain Layout
15797 \begin_layout Section
15798 The substitution mechanism
15801 \begin_layout Standard
15802 When the external material facility invokes an external program, it is done
15803 on the basis of a command defined in the template configuration file.
15804 These commands can contain various macros that are expanded before execution.
15805 Execution always take place in the directory of the containing document.
15808 \begin_layout Standard
15809 Also, whenever external material is to be displayed, the name will be produced
15810 by the substitution mechanism, and most other commands in the template
15811 definition support substitution as well.
15814 \begin_layout Standard
15815 The available macros are the following:
15818 \begin_layout Description
15819 \begin_inset Flex CharStyle:Code
15822 \begin_layout Plain Layout
15823 $$AbsOrRelPathMaster
15828 The file path, absolute or relative to the master LyX document.
15831 \begin_layout Description
15832 \begin_inset Flex CharStyle:Code
15835 \begin_layout Plain Layout
15836 $$AbsOrRelPathParent
15841 The file path, absolute or relative to the LyX document.
15844 \begin_layout Description
15845 \begin_inset Flex CharStyle:Code
15848 \begin_layout Plain Layout
15854 The absolute file path.
15857 \begin_layout Description
15858 \begin_inset Flex CharStyle:Code
15861 \begin_layout Plain Layout
15867 The filename without path and without the extension.
15870 \begin_layout Description
15871 \begin_inset Flex CharStyle:Code
15874 \begin_layout Plain Layout
15876 \begin_inset Quotes eld
15880 \begin_inset Quotes erd
15888 This macro will expand to the contents of the file with the name
15889 \begin_inset Flex CharStyle:Code
15892 \begin_layout Plain Layout
15901 \begin_layout Description
15902 \begin_inset Flex CharStyle:Code
15905 \begin_layout Plain Layout
15911 The file extension (including the dot).
15914 \begin_layout Description
15915 \begin_inset Flex CharStyle:Code
15918 \begin_layout Plain Layout
15924 The filename of the file specified in the external material dialog.
15925 This is either an absolute name, or it is relative to the LyX document.
15928 \begin_layout Description
15929 \begin_inset Flex CharStyle:Code
15932 \begin_layout Plain Layout
15939 \begin_inset Flex CharStyle:Code
15942 \begin_layout Plain Layout
15948 (absolute name or relative to the LyX document).
15951 \begin_layout Description
15952 \begin_inset Flex CharStyle:Code
15955 \begin_layout Plain Layout
15961 The file path, relative to the master LyX document.
15964 \begin_layout Description
15965 \begin_inset Flex CharStyle:Code
15968 \begin_layout Plain Layout
15974 The file path, relative to the LyX document.
15977 \begin_layout Description
15978 \begin_inset Flex CharStyle:Code
15981 \begin_layout Plain Layout
15987 This macro will expand to the absolute path of the system directory.
15988 This is typically used to point to the various helper scripts that are
15992 \begin_layout Description
15993 \begin_inset Flex CharStyle:Code
15996 \begin_layout Plain Layout
16002 A name and full path to a temporary file which will be automatically deleted
16003 whenever the containing document is closed, or the external material insertion
16007 \begin_layout Standard
16008 All path macros contain a trailing directory separator, so you can construct
16010 the absolute filename with
16011 \begin_inset Flex CharStyle:Code
16014 \begin_layout Plain Layout
16015 $$AbsPath$$Basename$$Extension
16023 \begin_layout Standard
16024 The macros above are substituted in all commands unless otherwise noted.
16026 \begin_inset Flex CharStyle:Code
16029 \begin_layout Plain Layout
16035 supports additionally the following substitutions if they are enabled by
16037 \begin_inset Flex CharStyle:Code
16040 \begin_layout Plain Layout
16047 \begin_inset Flex CharStyle:Code
16050 \begin_layout Plain Layout
16059 \begin_layout Description
16060 \begin_inset Flex CharStyle:Code
16063 \begin_layout Plain Layout
16069 The front part of the resize command.
16072 \begin_layout Description
16073 \begin_inset Flex CharStyle:Code
16076 \begin_layout Plain Layout
16082 The back part of the resize command.
16085 \begin_layout Description
16086 \begin_inset Flex CharStyle:Code
16089 \begin_layout Plain Layout
16095 The front part of the rotation command.
16098 \begin_layout Description
16099 \begin_inset Flex CharStyle:Code
16102 \begin_layout Plain Layout
16108 The back part of the rotation command.
16111 \begin_layout Standard
16112 The value string of the
16113 \begin_inset Flex CharStyle:Code
16116 \begin_layout Plain Layout
16122 command supports additionally the following substitutions if they are enabled
16124 \begin_inset Flex CharStyle:Code
16127 \begin_layout Plain Layout
16134 \begin_inset Flex CharStyle:Code
16137 \begin_layout Plain Layout
16146 \begin_layout Description
16147 \begin_inset Flex CharStyle:Code
16150 \begin_layout Plain Layout
16159 \begin_layout Description
16160 \begin_inset Flex CharStyle:Code
16163 \begin_layout Plain Layout
16172 \begin_layout Description
16173 \begin_inset Flex CharStyle:Code
16176 \begin_layout Plain Layout
16185 \begin_layout Description
16186 \begin_inset Flex CharStyle:Code
16189 \begin_layout Plain Layout
16195 The rotation option.
16198 \begin_layout Standard
16199 You may ask why there are so many path macros.
16200 There are mainly two reasons:
16203 \begin_layout Enumerate
16204 Relative and absolute file names should remain relative or absolute, respectivel
16206 Users may have reasons to prefer either form.
16207 Relative names are useful for portable documents that should work on different
16208 machines, for example.
16209 Absolute names may be required by some programs.
16212 \begin_layout Enumerate
16213 LaTeX treats relative file names differently than LyX and other programs
16214 in nested included files.
16215 For LyX, a relative file name is always relative to the document that contains
16217 For LaTeX, it is always relative to the master document.
16218 These two definitions are identical if you have only one document, but
16219 differ if you have a master document that includes part documents.
16220 That means that relative filenames must be transformed when presented to
16222 Fortunately LyX does this automatically for you if you choose the right
16226 \begin_layout Standard
16227 So which path macro should be used in new template definitions? The rule
16231 \begin_layout Itemize
16233 \begin_inset Flex CharStyle:Code
16236 \begin_layout Plain Layout
16242 if an absolute path is required.
16245 \begin_layout Itemize
16247 \begin_inset Flex CharStyle:Code
16250 \begin_layout Plain Layout
16251 $$AbsOrRelPathMaster
16256 if the substituted string is some kind of LaTeX input.
16259 \begin_layout Itemize
16261 \begin_inset Flex CharStyle:Code
16264 \begin_layout Plain Layout
16265 $$AbsOrRelPathParent
16270 in order to preserve the user's choice.
16273 \begin_layout Standard
16274 There are special cases where this rule does not work and e.g.
16275 \begin_inset space ~
16278 relative names are needed, but normally it will work just fine.
16279 One example for such a case is the command
16280 \begin_inset Flex CharStyle:Code
16283 \begin_layout Plain Layout
16284 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
16289 in the XFig template above: We can't use the absolute name because the
16291 \begin_inset Flex CharStyle:Code
16294 \begin_layout Plain Layout
16300 files needs the relative name in order to rewrite the file content.
16303 \begin_layout Section
16304 \begin_inset CommandInset label
16306 name "sec:Security-discussion"
16310 Security discussion
16313 \begin_layout Standard
16314 \begin_inset Note Note
16317 \begin_layout Plain Layout
16318 This section is outdated
16323 The external material feature interfaces with a lot of external programs
16324 and does so automatically, so we have to consider the security implications
16326 In particular, since you have the option of including your own filenames
16327 and/or parameter strings and those are expanded into a command, it seems
16328 that it would be possible to create a malicious document which executes
16329 arbitrary commands when a user views or prints the document.
16330 This is something we definately want to avoid.
16333 \begin_layout Standard
16334 However, since the external program commands are specified in the template
16335 configuration file only, there are no security issues if LyX is properly
16336 configured with safe templates only.
16337 This is so because the external programs are invoked with the
16338 \begin_inset Flex CharStyle:Code
16341 \begin_layout Plain Layout
16347 -system call rather than the
16348 \begin_inset Flex CharStyle:Code
16351 \begin_layout Plain Layout
16357 system-call, so it's not possible to execute arbitrary commands from the
16358 filename or parameter section via the shell.
16361 \begin_layout Standard
16362 This also implies that you are restricted in what command strings you can
16363 use in the external material templates.
16364 In particular, pipes and redirection are not readily available.
16365 This has to be so if LyX should remain safe.
16366 If you want to use some of the shell features, you should write a safe
16367 script to do this in a controlled manner, and then invoke the script from
16368 the command string.
16370 \begin_inset Flex CharStyle:Code
16373 \begin_layout Plain Layout
16379 directory of the LyX installation, you can find a safe wrapper script
16380 \begin_inset Flex CharStyle:Code
16383 \begin_layout Plain Layout
16384 general_command_wrapper.py
16389 that supports redirection of input and output.
16390 That can serve as an example for how to write safe template scripts.
16391 For a more advanced example that uses
16392 \begin_inset Flex CharStyle:Code
16395 \begin_layout Plain Layout
16401 and friends, take a look at the
16402 \begin_inset Flex CharStyle:Code
16405 \begin_layout Plain Layout
16414 \begin_layout Standard
16415 It is possible to design a template that interacts directly with the shell,
16416 but since this would allow a malicious user to execute arbitrary commands
16417 by writing clever filenames and/or parameters, we generally recommend that
16418 you only use safe scripts that work with the
16419 \begin_inset Flex CharStyle:Code
16422 \begin_layout Plain Layout
16428 system call in a controlled manner.
16429 Of course, for use in a controlled environment, it can be tempting to just
16430 fall back to use ordinary shell scripts.
16431 If you do so, be aware that you
16435 provide an easily exploitable security hole in your system.
16436 Of course it stands to reason that such unsafe templates will never be
16437 included in the standard LyX distribution, although we do encourage people
16438 to submit new templates in the open source tradition.
16439 But LyX as shipped from the official distribution channels will never have
16443 \begin_layout Standard
16444 Including external material provides a lot of power, and you have to be
16445 careful not to introduce security hazards with this power.
16446 A subtle error in a single line in an innocent looking script can open
16447 the door to huge security problems.
16448 So if you do not fully understand the issues, we recommend that you consult
16449 a knowledgable security professional or the LyX development team if you
16450 have any questions about whether a given template is safe or not.
16451 And do this before you use it in an uncontrolled environment.
16454 \begin_layout Chapter
16458 \begin_layout Section
16462 \begin_layout Standard
16463 The LyX server is a method implemented in LyX that will enable other programs
16464 to talk to LyX, invoke LyX commands, and retrieve information about the
16465 LyX internal state.
16466 This is only intended for advanced users, but they should find it useful.
16467 Please note that, at present,
16469 the server does not work on Windows
16475 \begin_layout Plain Layout
16476 There is no principled reason it cannot do so.
16477 But none of the developers on Windows® have yet implemented this functionality
16486 \begin_layout Section
16487 Starting the LyX Server
16490 \begin_layout Standard
16491 The LyX server works through the use of a pair of named pipes.
16492 These are usually located in
16493 \begin_inset Flex CharStyle:Code
16496 \begin_layout Plain Layout
16503 \begin_inset Quotes eld
16507 \begin_inset Flex CharStyle:Code
16510 \begin_layout Plain Layout
16517 \begin_inset Quotes erd
16521 \begin_inset Quotes eld
16525 \begin_inset Flex CharStyle:Code
16528 \begin_layout Plain Layout
16535 \begin_inset Quotes erd
16539 External programs write into
16540 \begin_inset Flex CharStyle:Code
16543 \begin_layout Plain Layout
16549 and read back data from
16550 \begin_inset Flex CharStyle:Code
16553 \begin_layout Plain Layout
16560 The stem of the pipe names can be defined in the
16561 \begin_inset Flex CharStyle:MenuItem
16564 \begin_layout Plain Layout
16569 ools\SpecialChar \menuseparator
16579 dialog, for example
16580 \begin_inset Flex CharStyle:Code
16583 \begin_layout Plain Layout
16584 "/home/myhome/.lyxpipe"
16592 \begin_layout Standard
16594 \begin_inset Flex CharStyle:Code
16597 \begin_layout Plain Layout
16604 \begin_inset Flex CharStyle:Code
16607 \begin_layout Plain Layout
16613 ' to create the pipes.
16614 The above setting also has the effect of activating the LyX server.
16615 If one of the pipes already exists, LyX will assume that another LyX process
16616 is already running and will not start the server.
16617 To have several LyX processes with servers at the same time, you have to
16618 change the configuration between the start of the programs.
16621 \begin_layout Standard
16622 If you are developing a client program, you might find it useful to enable
16623 debugging information from the LyX server.
16624 Do this by starting LyX as lyx -dbg lyxserver.
16627 \begin_layout Standard
16628 Warning: if LyX crashes, it may not manage to remove the pipes; in this
16629 case you must remove them manually.
16630 If LyX starts and the pipes exist already, it will not start any server.
16633 \begin_layout Standard
16634 Other than this, there are a few points to consider:
16637 \begin_layout Itemize
16638 Both server and clients must run on UNIX or OS/2 machines.
16639 Communications between LyX on UNIX and clients on OS/2 or vice versa is
16640 not possible right now.
16643 \begin_layout Itemize
16644 On OS/2, only one client can connect to LyXServer at a time.
16647 \begin_layout Itemize
16648 On OS/2, clients must open inpipe with
16649 \begin_inset Flex CharStyle:Code
16652 \begin_layout Plain Layout
16661 \begin_layout Standard
16665 \begin_layout Standard
16666 You can find a complete example client written in C in the source distribution
16668 \begin_inset Flex CharStyle:Code
16671 \begin_layout Plain Layout
16672 development/lyxserver/server_monitor.c
16680 \begin_layout Section
16681 Normal communication
16684 \begin_layout Standard
16685 To issue a LyX call, the client writes a line of ASCII text into the input
16687 This line has the following format:
16690 \begin_layout Quote
16704 \begin_layout Description
16709 is a name that the client can choose arbitrarily.
16710 Its only use is that LyX will echo it if it sends an answer---so a client
16711 can dispatch results from different requesters.
16714 \begin_layout Description
16719 is the function you want LyX to perform.
16720 It is the same as the commands you'd use in the minibuffer.
16723 \begin_layout Description
16728 is an optional argument which is meaningful only to some functions (for
16730 \begin_inset Quotes eld
16734 \begin_inset Quotes erd
16737 which will insert the argument as text at the cursor position.)
16740 \begin_layout Standard
16741 The answer from LyX will arrive in the output pipe and be of the form
16744 \begin_layout Quote
16758 \begin_layout Standard
16767 are just echoed from the command request, while
16771 is more or less useful information filled according to how the command
16772 execution worked out.
16773 Some commands will return information about the internal state of LyX,
16775 \begin_inset Quotes eld
16779 \begin_inset Quotes erd
16782 , while other will return an empty data-response.
16783 This means that the command execution went fine.
16786 \begin_layout Standard
16787 In case of errors, the response from LyX will have this form
16790 \begin_layout Quote
16804 \begin_layout Standard
16809 should contain an explanation of why the command failed.
16812 \begin_layout Standard
16816 \begin_layout LyX-Code
16817 echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
16820 \begin_layout LyX-Code
16821 echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
16822 \begin_inset Newline newline
16825 read a <~/.lyxpipe.out
16826 \begin_inset Newline newline
16832 \begin_layout Section
16836 \begin_layout Standard
16837 LyX can notify clients of events going on asynchronously.
16838 Currently it will only do this if the user binds a key sequence with the
16840 \begin_inset Quotes eld
16844 \begin_inset Quotes erd
16848 The format of the string LyX sends is as follows:
16851 \begin_layout Quote
16852 \begin_inset Flex CharStyle:Code
16855 \begin_layout Plain Layout
16866 \begin_layout Standard
16871 is the printed representation of the key sequence that was actually typed
16875 \begin_layout Standard
16876 This mechanism can be used to extend LyX's command set and implement macros:
16877 bind some key sequence to
16878 \begin_inset Quotes eld
16882 \begin_inset Quotes erd
16885 , start a client that listens on the out pipe, dispatches the command according
16886 to the sequence and starts a function that may use LyX calls and LyX requests
16887 to issue a command or a series of commands to LyX.
16890 \begin_layout Section
16891 The simple LyX Server Protocol
16894 \begin_layout Standard
16895 LyX implements a simple protocol that can be used for session management.
16896 All messages are of the form
16899 \begin_layout Quote
16909 \begin_layout Standard
16915 \begin_inset Quotes eld
16919 \begin_inset Quotes erd
16923 \begin_inset Quotes eld
16927 \begin_inset Quotes erd
16932 \begin_inset Quotes eld
16936 \begin_inset Quotes erd
16939 is received from a client, LyX will report back to inform the client that
16940 it's listening to it's messages, while
16941 \begin_inset Quotes eld
16945 \begin_inset Quotes erd
16948 sent from LyX will inform clients that LyX is closing.