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 \begin_inset CommandInset label
2347 \begin_layout Standard
2348 Bindings are used to associate a LyX function to a key.
2349 Several prepackaged binding files are available: a CUA set of bindings
2350 (familiar as the typical set of PC and CDE set of keyboard shortcuts),
2351 an Emacs set of bindings, for those of us who follow the One True Way and
2352 refuse to lower our standards,
2356 \begin_layout Plain Layout
2357 I'm kidding here, of course!
2362 as well as specialty bindings (broadway and hollywood) and bindings for
2363 languages other than English.
2364 You can select your binding in the
2365 \begin_inset Flex CharStyle:MenuItem
2368 \begin_layout Plain Layout
2369 Editing\SpecialChar \menuseparator
2378 \begin_inset Flex CharStyle:MenuItem
2381 \begin_layout Plain Layout
2386 ools\SpecialChar \menuseparator
2402 \begin_layout Standard
2403 If, however, you'd like to customise the bindings to your own exacting tastes,
2404 then there are two ways to proceed.
2405 The first, and older method, is to copy a file from
2406 \begin_inset Flex CharStyle:Code
2409 \begin_layout Plain Layout
2416 \begin_inset Flex CharStyle:Code
2419 \begin_layout Plain Layout
2425 and modify that in a text editor.
2426 Don't forget to select this file in
2427 \begin_inset Flex CharStyle:MenuItem
2430 \begin_layout Plain Layout
2431 Editing\SpecialChar \menuseparator
2438 The second method is to use the shortcut editor, which you will also find
2440 \begin_inset Flex CharStyle:MenuItem
2443 \begin_layout Plain Layout
2444 Editing\SpecialChar \menuseparator
2451 The changes you make here will be stored at
2452 \begin_inset Flex CharStyle:Code
2455 \begin_layout Plain Layout
2456 UserDir/bind/user.bind
2464 \begin_layout Standard
2465 LyX supports internationalization of the user interface (see Chapter
2466 \begin_inset space ~
2470 \begin_inset CommandInset ref
2472 reference "chap:i18n"
2481 is set, LyX will try to use bindfiles by prepending the standard language
2483 For example, you can put a translated copy of some standard bind file in
2485 \begin_inset Flex CharStyle:Code
2488 \begin_layout Plain Layout
2494 directory, and LyX will use it automatically.
2497 \begin_layout Standard
2499 \begin_inset Flex CharStyle:Code
2502 \begin_layout Plain Layout
2508 files is straightforward:
2511 \begin_layout LyX-Code
2514 bind ``<key combination>'' ``<lyx-function>
2515 \begin_inset Quotes erd
2521 \begin_layout Standard
2522 Both key combination and lyx-function (including any arguments) must be
2523 enclosed in "double quotes".
2524 The LyX functions are partially documented on listed on the
2525 \begin_inset CommandInset href
2528 target "http://wiki.lyx.org/LyX/LyxFunctions"
2533 A major effort is presently underway to improve this documentation.
2536 \begin_layout Section
2537 \begin_inset CommandInset label
2539 name "sec:converters-etc"
2546 \begin_layout Standard
2547 LyX has a powerful mechanism to convert to and from any file format using
2552 \begin_layout Subsection
2553 \begin_inset CommandInset label
2562 \begin_layout Standard
2563 The first step is to define your file formats if they are not already defined.
2565 \begin_inset Flex CharStyle:MenuItem
2568 \begin_layout Plain Layout
2569 Tools\SpecialChar \menuseparator
2570 Preferences\SpecialChar \menuseparator
2571 File Handling\SpecialChar \menuseparator
2579 \begin_inset Flex CharStyle:MenuItem
2582 \begin_layout Plain Layout
2583 New\SpecialChar \ldots{}
2589 button to define your new format.
2591 \begin_inset Flex CharStyle:MenuItem
2594 \begin_layout Plain Layout
2600 field contains the named used to identify the format in the GUI.
2602 \begin_inset Flex CharStyle:MenuItem
2605 \begin_layout Plain Layout
2611 is used to identify the format interally.
2612 You will also need to enter a file extension.
2613 These are all required.
2615 \begin_inset Flex CharStyle:MenuItem
2618 \begin_layout Plain Layout
2624 field is used to provide a keyboard shortcut on the menus.
2625 (For example, pressing
2626 \begin_inset Flex CharStyle:MenuItem
2629 \begin_layout Plain Layout
2636 \begin_inset Flex CharStyle:MenuItem
2639 \begin_layout Plain Layout
2640 View\SpecialChar \menuseparator
2649 \begin_layout Standard
2651 \begin_inset Flex CharStyle:MenuItem
2654 \begin_layout Plain Layout
2661 \begin_inset Flex CharStyle:MenuItem
2664 \begin_layout Plain Layout
2671 For example, you might want to use
2672 \begin_inset Flex CharStyle:MenuItem
2675 \begin_layout Plain Layout
2681 to view PostScript files.
2682 You can enter the command needed to start the program in the corresponding
2684 In defining this command, you can use the four variables listed in the
2686 The viewer is launched when you view an image in LyX or use the
2687 \begin_inset Flex CharStyle:MenuItem
2690 \begin_layout Plain Layout
2697 The editor is for example launched when you press the
2698 \begin_inset Flex CharStyle:MenuItem
2701 \begin_layout Plain Layout
2708 \begin_inset Flex CharStyle:MenuItem
2711 \begin_layout Plain Layout
2718 \begin_inset Flex CharStyle:MenuItem
2721 \begin_layout Plain Layout
2730 \begin_layout Standard
2732 \begin_inset Flex CharStyle:MenuItem
2735 \begin_layout Plain Layout
2741 option tells LyX that a format is suitable for document export.
2742 If this is is set and if a suitable conversion route exists (see
2743 \begin_inset CommandInset ref
2745 reference "sub:Converters"
2749 ), the format will appear in the
2750 \begin_inset Flex CharStyle:MenuItem
2753 \begin_layout Plain Layout
2754 File\SpecialChar \menuseparator
2761 The format will also appear in the
2762 \begin_inset Flex CharStyle:MenuItem
2765 \begin_layout Plain Layout
2771 menu if a viewer is specified for the format.
2772 Pure image formats, such as
2773 \begin_inset Flex CharStyle:Code
2776 \begin_layout Plain Layout
2782 , should not use this option.
2783 Formats that can both represent vector graphics and documents like
2784 \begin_inset Flex CharStyle:Code
2787 \begin_layout Plain Layout
2796 \begin_layout Standard
2798 \begin_inset Flex CharStyle:MenuItem
2801 \begin_layout Plain Layout
2802 Vector graphics format
2807 tells LyX that a format can contain vector graphics.
2808 This information is used to determine the target format of included graphics
2810 \begin_inset Flex CharStyle:MenuItem
2813 \begin_layout Plain Layout
2820 Included graphics may need to be converted to either
2821 \begin_inset Flex CharStyle:MenuItem
2824 \begin_layout Plain Layout
2831 \begin_inset Flex CharStyle:MenuItem
2834 \begin_layout Plain Layout
2841 \begin_inset Flex CharStyle:MenuItem
2844 \begin_layout Plain Layout
2851 \begin_inset Flex CharStyle:MenuItem
2854 \begin_layout Plain Layout
2860 cannot handle other image formats.
2861 If an included graphic is not already in
2862 \begin_inset Flex CharStyle:MenuItem
2865 \begin_layout Plain Layout
2872 \begin_inset Flex CharStyle:MenuItem
2875 \begin_layout Plain Layout
2882 \begin_inset Flex CharStyle:MenuItem
2885 \begin_layout Plain Layout
2891 format, it is converted to
2892 \begin_inset Flex CharStyle:MenuItem
2895 \begin_layout Plain Layout
2901 if the vector format option is set, and otherwise to
2902 \begin_inset Flex CharStyle:MenuItem
2905 \begin_layout Plain Layout
2914 \begin_layout Subsection
2918 \begin_layout Standard
2919 Since all conversions from one format to another take place in LyX's temporary
2920 directory, it is sometimes necessary to modify a file before copying it
2921 to the temporary directory in order that the conversion may be performed.
2925 \begin_layout Plain Layout
2926 For example, the file may refer to other files---images, for example---using
2927 relative filenames, and these may become invalid when the file is copied
2928 to the temporary directory.
2933 This is done by a Copier: It copies a file to (or from) the temporary directory
2934 and may modify it in the process.
2937 \begin_layout Standard
2938 The definitions of the copiers may use four variables:
2941 \begin_layout Labeling
2942 \labelwidthstring 00.00.0000
2943 \begin_inset Flex CharStyle:Code
2946 \begin_layout Plain Layout
2952 The LyX system directory (e.
2953 \begin_inset space \thinspace{}
2957 \begin_inset space ~
2961 \begin_inset Flex CharStyle:MenuItem
2964 \begin_layout Plain Layout
2973 \begin_layout Labeling
2974 \labelwidthstring 00.00.0000
2975 \begin_inset Flex CharStyle:Code
2978 \begin_layout Plain Layout
2987 \begin_layout Labeling
2988 \labelwidthstring 00.00.0000
2989 \begin_inset Flex CharStyle:Code
2992 \begin_layout Plain Layout
3001 \begin_layout Labeling
3002 \labelwidthstring 00.00.0000
3003 \begin_inset Flex CharStyle:Code
3006 \begin_layout Plain Layout
3015 \begin_layout Standard
3016 The latter is to be given in a form suitable for inclusion in a LaTeX's
3023 command and is relevant only when exporting files suitable for such inclusion.
3026 \begin_layout Standard
3027 Copiers can be used to do almost anything with output files.
3028 For example, suppose you want generated pdf files to be copied to a special
3030 \begin_inset Flex CharStyle:Code
3033 \begin_layout Plain Layout
3040 Then you could write a shell script such as this one:
3043 \begin_layout Standard
3044 \begin_inset listings
3048 \begin_layout Plain Layout
3053 \begin_layout Plain Layout
3058 \begin_layout Plain Layout
3060 TOFILE=`basename $2`
3063 \begin_layout Plain Layout
3065 cp $FROMFILE /home/you/pdf/$TOFILE
3070 Save that in your local LyX directory---say,
3071 \begin_inset Flex CharStyle:Code
3074 \begin_layout Plain Layout
3075 /home/you/.lyx/scripts/pdfcopier.sh
3080 ---and make it executable, if you need to do so on your platform.
3082 \begin_inset Flex CharStyle:MenuItem
3085 \begin_layout Plain Layout
3086 Tools\SpecialChar \menuseparator
3093 \begin_inset Flex CharStyle:MenuItem
3096 \begin_layout Plain Layout
3102 format---or one of the other pdf formats---and enter
3103 \begin_inset Flex CharStyle:Code
3106 \begin_layout Plain Layout
3107 pdfcopier.sh $$i $$o
3113 \begin_inset Flex CharStyle:MenuItem
3116 \begin_layout Plain Layout
3126 \begin_layout Standard
3127 Copiers are used by LyX in various of its own conversions.
3128 For example, if appropriate programs are found, LyX will automatically
3129 install copiers for the
3130 \begin_inset Flex CharStyle:MenuItem
3133 \begin_layout Plain Layout
3140 \begin_inset Flex CharStyle:MenuItem
3143 \begin_layout Plain Layout
3145 \begin_inset space ~
3154 When these formats are exported, the copier sees that not just the main
3155 HTML file but various associated files (style files, images, etc.) are also
3157 All these files are written to a subdirectory of the directory in which
3158 the original LyX file was found.
3162 \begin_layout Plain Layout
3163 This copier can be customized.
3165 \begin_inset Quotes eld
3169 \begin_inset Quotes erd
3172 argument takes a comma-separated list of extensions to be copied; if it
3173 is omitted, all files will be copied.
3175 \begin_inset Quotes eld
3179 \begin_inset Quotes erd
3182 argument determines the extension added to the generated directory.
3184 \begin_inset Quotes eld
3188 \begin_inset Flex CharStyle:MenuItem
3191 \begin_layout Plain Layout
3198 \begin_inset Quotes erd
3201 , so HTML generated from
3202 \begin_inset Flex CharStyle:MenuItem
3205 \begin_layout Plain Layout
3206 /path/to/filename.lyx
3212 \begin_inset Flex CharStyle:MenuItem
3215 \begin_layout Plain Layout
3216 /path/to/filename.html.LyXconv
3230 \begin_layout Subsection
3231 \begin_inset CommandInset label
3233 name "sub:Converters"
3240 \begin_layout Standard
3241 You can define your own Converters to, uhh, convert files between different
3244 \begin_inset Flex CharStyle:MenuItem
3247 \begin_layout Plain Layout
3248 Tools\SpecialChar \menuseparator
3249 Preferences\SpecialChar \menuseparator
3250 File Handling\SpecialChar \menuseparator
3259 \begin_layout Standard
3260 To define a new converter, select the
3261 \begin_inset Flex CharStyle:MenuItem
3264 \begin_layout Plain Layout
3266 \begin_inset space ~
3275 \begin_inset space \thinspace{}
3279 \begin_inset Flex CharStyle:MenuItem
3282 \begin_layout Plain Layout
3284 \begin_inset space ~
3292 from the drop-down lists, enter the command needed for the conversion,
3294 \begin_inset Flex CharStyle:MenuItem
3297 \begin_layout Plain Layout
3304 Several variables can be used in the definition of converters:
3307 \begin_layout Labeling
3308 \labelwidthstring 00.00.0000
3309 \begin_inset Flex CharStyle:Code
3312 \begin_layout Plain Layout
3318 The LyX system directory
3321 \begin_layout Labeling
3322 \labelwidthstring 00.00.0000
3323 \begin_inset Flex CharStyle:Code
3326 \begin_layout Plain Layout
3335 \begin_layout Labeling
3336 \labelwidthstring 00.00.0000
3337 \begin_inset Flex CharStyle:Code
3340 \begin_layout Plain Layout
3349 \begin_layout Labeling
3350 \labelwidthstring 00.00.0000
3351 \begin_inset Flex CharStyle:Code
3354 \begin_layout Plain Layout
3360 The base filename of the input file (i.e., without the extension)
3363 \begin_layout Labeling
3364 \labelwidthstring 00.00.0000
3365 \begin_inset Flex CharStyle:Code
3368 \begin_layout Plain Layout
3374 The path to the input file
3377 \begin_layout Standard
3379 \begin_inset Flex CharStyle:MenuItem
3382 \begin_layout Plain Layout
3384 \begin_inset space ~
3392 field you can enter the following flags, separated by commas:
3395 \begin_layout Labeling
3396 \labelwidthstring 00.00.0000
3397 \begin_inset Flex CharStyle:Code
3400 \begin_layout Plain Layout
3406 This converter runs some form of LaTeX.
3407 This will make LyX's LaTeX error logs available.
3410 \begin_layout Labeling
3411 \labelwidthstring 00.00.0000
3412 \begin_inset Flex CharStyle:Code
3415 \begin_layout Plain Layout
3422 \begin_inset Flex CharStyle:MenuItem
3425 \begin_layout Plain Layout
3431 file for the conversion.
3434 \begin_layout Labeling
3435 \labelwidthstring 00.00.0000
3436 \begin_inset Flex CharStyle:Code
3439 \begin_layout Plain Layout
3448 \begin_layout Standard
3449 The following three flags are not really flags at all because they take
3451 \begin_inset Flex CharStyle:MenuItem
3454 \begin_layout Plain Layout
3456 \begin_inset space ~
3460 \begin_inset space ~
3471 \begin_layout Labeling
3472 \labelwidthstring 00.00.0000
3473 \begin_inset Flex CharStyle:Code
3476 \begin_layout Plain Layout
3482 If set, the converter's standard error will be redirected to a file
3483 \begin_inset Flex CharStyle:Code
3486 \begin_layout Plain Layout
3492 , and the script given as argument will be run as:
3493 \begin_inset Flex CharStyle:Code
3496 \begin_layout Plain Layout
3497 script <infile.out >infile.log
3503 The argument may contain
3504 \begin_inset Flex CharStyle:Code
3507 \begin_layout Plain Layout
3516 \begin_layout Labeling
3517 \labelwidthstring 00.00.0000
3518 \begin_inset Flex CharStyle:Code
3521 \begin_layout Plain Layout
3527 The name of the directory in which the converter will dump the generated
3529 LyX will not create this directory, and it does not copy anything into
3530 it, though it will copy this directory to the destination.
3531 The argument may contain
3532 \begin_inset Flex CharStyle:Code
3535 \begin_layout Plain Layout
3541 , which will be replaced by the basename of the input and output files,
3542 respectively, when the directory is copied.
3543 \begin_inset Newline newline
3546 Note that resultdir and usetempdir make no sense together.
3547 The latter will be ignored if the former is given.
3550 \begin_layout Labeling
3551 \labelwidthstring 00.00.0000
3552 \begin_inset Flex CharStyle:Code
3555 \begin_layout Plain Layout
3561 Determines the output filename and may, contain
3562 \begin_inset Flex CharStyle:Code
3565 \begin_layout Plain Layout
3572 Sensible only with resultdir and optional even then; if not given, it defaults
3576 \begin_layout Standard
3577 None of these last three are presently used in any of the converters that
3578 are installed with LyX.
3582 \begin_layout Standard
3583 You do not have to define converters between all the formats between which
3584 you want to convert.
3585 For example, you will note that there is no `LyX to PostScript®' converter,
3586 but LyX will export PostScript®.
3587 It does so by first creating a LaTeX file (no converter needs to be defined
3588 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
3589 and finally converting the resulting DVI file to PostScript®.
3590 LyX finds such `chains' of converters automatically, and it will always
3591 choose the shortest possible chain.
3592 You can, though, still define multiple conversion methods between file
3594 For example, the standard LyX configuration provides three ways to convert
3595 LaTeX to PDF: Directly, using
3596 \begin_inset Flex CharStyle:MenuItem
3599 \begin_layout Plain Layout
3605 ; via (DVI and) PostScript®, using
3606 \begin_inset Flex CharStyle:MenuItem
3609 \begin_layout Plain Layout
3616 \begin_inset Flex CharStyle:MenuItem
3619 \begin_layout Plain Layout
3626 To define such alternate chains, you must define multiple target `file
3627 formats', as described in section
3628 \begin_inset CommandInset ref
3630 reference "sub:Formats"
3635 For example, in the standard configuration, the formats named
3636 \begin_inset Flex CharStyle:MenuItem
3639 \begin_layout Plain Layout
3646 \begin_inset Flex CharStyle:MenuItem
3649 \begin_layout Plain Layout
3656 \begin_inset Flex CharStyle:MenuItem
3659 \begin_layout Plain Layout
3665 are defined, all of which share the extension
3666 \begin_inset Flex CharStyle:MenuItem
3669 \begin_layout Plain Layout
3675 , and which correspond to the conversion methods just mentioned.
3678 \begin_layout Section
3682 \begin_layout Standard
3683 The settings in this section affect the output LyX produces.
3686 \begin_layout Subsection
3687 Plain text export options
3690 \begin_layout Standard
3692 There are a couple of commands that can be used to
3693 \begin_inset Quotes eld
3697 \begin_inset Quotes erd
3700 exported plain text files.
3701 Note that LyX automatically detects and tries to use the best settings
3702 for your system at installation time, but you can modify them in the
3703 \begin_inset Flex CharStyle:MenuItem
3706 \begin_layout Plain Layout
3707 Output\SpecialChar \menuseparator
3713 dialog if you disagree with its interpretation.
3716 \begin_layout Description
3717 \begin_inset Flex CharStyle:Code
3720 \begin_layout Plain Layout
3726 This option defines the command used to produce better plain text tables
3728 \begin_inset Flex CharStyle:Code
3731 \begin_layout Plain Layout
3737 UNIX-commands (refer to their manpages for more information about them).
3738 Setting this as empty tells LyX to use the internal (inferior) formatter.
3741 \begin_layout Description
3742 \begin_inset Flex CharStyle:Code
3745 \begin_layout Plain Layout
3751 With this command you can set the default line length of the plain text
3753 Setting it to 0 means that no line breaks will be inserted except between
3754 paragraphs and the like.
3757 \begin_layout Section
3761 \begin_layout Standard
3762 There are many other configuration options that can be used to customize
3764 Most of them are sufficiently self-explanatory that we have not felt it
3765 necessary to document them here.
3767 \begin_inset CommandInset href
3769 name "mailing lists"
3770 target "http://www.lyx.org/mailing.php"
3774 if you need some more information.
3777 \begin_layout Chapter
3778 Internationalizing LyX
3779 \begin_inset CommandInset label
3788 \begin_layout Standard
3789 LyX supports using a translated interface.
3790 Last time we checked, LyX provided text in thirty languages.
3791 The language of choice is called your
3796 (For further reading on locale settings, see also the documentation for
3797 locale that comes with your operating system.
3798 For Linux, the manual page for
3799 \begin_inset Flex CharStyle:Code
3802 \begin_layout Plain Layout
3808 could be a good place to start).
3811 \begin_layout Standard
3812 Notice that these translations will work, but do contain a few flaws.
3813 In particular, all dialogs have been designed with the English text in
3814 mind, which means that some of the translated text will be too large to
3815 fit within the space allocated.
3816 This is only a display problem and will not cause any harm.
3817 Also, you will find that some of the translations do not define shortcut
3818 keys for everything.
3819 Sometimes, there are simply not enough free letters to do it.
3820 Other times, the translator just hasn't got around to doing it yet.
3821 Our localization team, which you may wish to join,
3825 \begin_layout Plain Layout
3826 If you are a fluent speaker of a language other than English, joining these
3827 teams is a great way to give back to the LyX community!
3832 will of course try to fix these shortcomings in future versions of LyX.
3835 \begin_layout Section
3839 \begin_layout Subsection
3840 Translating the graphical user interface (text messages).
3843 \begin_layout Standard
3845 \begin_inset Flex CharStyle:Code
3848 \begin_layout Plain Layout
3854 library to handle the internationalization of the interface.
3855 To have LyX speak your favorite language in all menus and dialogs, you
3857 \begin_inset Flex CharStyle:Code
3860 \begin_layout Plain Layout
3866 -file for that language.
3867 When this is available, you'll have to generate a
3868 \begin_inset Flex CharStyle:Code
3871 \begin_layout Plain Layout
3877 -file from it and install the
3878 \begin_inset Flex CharStyle:Code
3881 \begin_layout Plain Layout
3888 The process of doing all of this is explained in the documentation for
3890 \begin_inset Flex CharStyle:Code
3893 \begin_layout Plain Layout
3900 It is possible to do this just for yourself, but if you're going to do
3901 it, you might as well share the results of your labors with the rest of
3903 Send a message to the LyX developers' list for more information about how
3907 \begin_layout Standard
3908 In short, this is what you should do (xx denotes the language code):
3911 \begin_layout Itemize
3912 Check out the LyX source code.
3914 \begin_inset CommandInset href
3916 name "information on the web"
3917 target "http://www.lyx.org/devel/cvs.php"
3924 \begin_layout Itemize
3926 \begin_inset Flex CharStyle:Code
3929 \begin_layout Plain Layout
3935 to the folder of the
3936 \begin_inset Flex CharStyle:Code
3939 \begin_layout Plain Layout
3947 \begin_inset Flex CharStyle:Code
3950 \begin_layout Plain Layout
3958 \begin_inset Flex CharStyle:Code
3961 \begin_layout Plain Layout
3967 doesn't exist anywhere, it can be remade with the console command
3968 \begin_inset Flex CharStyle:Code
3971 \begin_layout Plain Layout
3977 in that directory, or you can use an existing po-file for some other language
3981 \begin_layout Itemize
3983 \begin_inset Flex CharStyle:Code
3986 \begin_layout Plain Layout
3996 \begin_layout Plain Layout
3997 This is just a text file, so it can be edited in any text editor.
3998 But there are also specialized programs that support such editing, such
4003 (for all platforms) or
4012 contains a `mode' for editing
4013 \begin_inset Flex CharStyle:Code
4016 \begin_layout Plain Layout
4027 For some menu- and widget-labels, there are also shortcut keys that should
4029 Those keys are marked after a `|', and should be translated according to
4030 the words and phrases of the language.
4031 You should also fill also out the information at the beginning of the new
4033 \begin_inset Flex CharStyle:Code
4036 \begin_layout Plain Layout
4042 -file with your email-address, etc., so people know where to reach you with
4043 suggestions and entertaining flames.
4046 \begin_layout Standard
4047 If you are just doing this on your own, then:
4050 \begin_layout Itemize
4052 \begin_inset Flex CharStyle:Code
4055 \begin_layout Plain Layout
4062 This can be done with
4063 \begin_inset Flex CharStyle:Code
4066 \begin_layout Plain Layout
4067 msgfmt -o xx.mo < xx.po
4075 \begin_layout Itemize
4077 \begin_inset Flex CharStyle:Code
4080 \begin_layout Plain Layout
4086 -file to your locale-tree, at the correct directory for application messages
4091 xx, and under the name
4092 \begin_inset Flex CharStyle:Code
4095 \begin_layout Plain Layout
4103 \begin_inset Flex CharStyle:Code
4106 \begin_layout Plain Layout
4107 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
4117 \begin_layout Standard
4118 As said, however, it would be best if the new
4119 \begin_inset Flex CharStyle:Code
4122 \begin_layout Plain Layout
4128 -file could be added to the LyX distribution, so others can use it.
4129 Adding it involves making additional changes to LyX.
4130 So send an email to the developers' mailing list if you're interested in
4134 \begin_layout Subsubsection
4138 \begin_layout Standard
4139 Sometimes it turns out that one English message needs to be translated into
4140 different messages in the target language.
4141 One example is the message
4142 \begin_inset Flex CharStyle:Code
4145 \begin_layout Plain Layout
4151 which has the German translation
4159 , depending upon exactly what the English
4160 \begin_inset Quotes eld
4164 \begin_inset Quotes erd
4169 \begin_inset Flex CharStyle:Code
4172 \begin_layout Plain Layout
4178 does not handle such ambigous translations.
4179 Therefore you have to add some context information to the message: Instead
4181 \begin_inset Flex CharStyle:Code
4184 \begin_layout Plain Layout
4191 \begin_inset Flex CharStyle:Code
4194 \begin_layout Plain Layout
4195 To[[as in 'From format x to format y']]
4201 \begin_inset Flex CharStyle:Code
4204 \begin_layout Plain Layout
4205 To[[as in 'From page x to page y']].
4210 Now the two occurences of
4211 \begin_inset Flex CharStyle:Code
4214 \begin_layout Plain Layout
4221 \begin_inset Flex CharStyle:Code
4224 \begin_layout Plain Layout
4230 and can be translated correctly to
4241 \begin_layout Standard
4242 Of course the context information needs to be stripped off the original
4243 message when no translation is used.
4244 Therefore you have to put it in double square brackets at the end of the
4245 message (see the example above).
4246 The translation mechanism of LyX ensures that everything in double square
4247 brackets at the end of messages is removed before displaying the message.
4250 \begin_layout Subsection
4251 Translating the documentation.
4254 \begin_layout Standard
4255 The online documentation (in the
4256 \begin_inset Flex CharStyle:MenuItem
4259 \begin_layout Plain Layout
4269 -menu) can (and should!) be translated.
4270 If there are translated versions of the documentation available
4274 \begin_layout Plain Layout
4275 As of March 2008, at least some of the documents have been translated into
4276 fourteen languages, with the Tutorial available in a few more.
4281 and the locale is set accordingly, these will be used automagically by
4283 LyX looks for translated versions as
4284 \begin_inset Flex CharStyle:Code
4287 \begin_layout Plain Layout
4288 LyXDir/doc/xx_DocName.lyx
4294 \begin_inset Flex CharStyle:Code
4297 \begin_layout Plain Layout
4303 is the code for the language currently in use.
4304 If there are no translated documents, the default English versions will
4306 Note that the translated versions must have the same filenames (
4307 \begin_inset Flex CharStyle:Code
4310 \begin_layout Plain Layout
4316 above) as the original.
4317 If you feel up to translating the documentation (an excellent way to proof-read
4318 the original documentation by the way!), there are a few things you should
4322 \begin_layout Itemize
4324 \begin_inset Flex CharStyle:Code
4327 \begin_layout Plain Layout
4333 , the guide to writing LyX documentation.
4334 Pay special attention to the translator's section.
4337 \begin_layout Itemize
4338 Check out the documentation translation web page at
4339 \begin_inset CommandInset href
4341 name "http://www.devel.lyx.org"
4342 target "http://www.devel.lyx.org"
4347 That way, you can find out which (if any) documents have already been translate
4348 d into your language.
4349 You can also find out who (if anyone) is organizing the effort to translate
4350 the documentation into your language.
4351 If no one is organizing the effort, please let us know that you're interested.
4354 \begin_layout Standard
4355 Once you get to actually translating, here's a few hints for you that may
4359 \begin_layout Itemize
4360 Join the documentation team! There is information on how to do that in
4361 \begin_inset Flex CharStyle:Code
4364 \begin_layout Plain Layout
4371 \begin_inset Flex CharStyle:MenuItem
4374 \begin_layout Plain Layout
4379 elp\SpecialChar \menuseparator
4389 ), which by the way is the first document you should translate.
4392 \begin_layout Itemize
4393 Learn the typographic conventions for the language you are translating to.
4394 Typography is an ancient art and over the centuries, a great variety of
4395 conventions have developed throughout different parts of the world.
4396 Also study the professional terminology amongst typographers in your country.
4397 Inventing your own terminology will only confuse the users.
4400 (Warning! Typography is addictive!)
4403 \begin_layout Itemize
4404 Make a copy of the document.
4405 This will be your working copy.
4406 You can use this as your personal translated help-file by placing it in
4408 \begin_inset Flex CharStyle:Code
4411 \begin_layout Plain Layout
4420 \begin_layout Itemize
4421 Sometimes the original document (from the LyX-team) will be updated.
4422 Use the source viewer at
4423 \begin_inset CommandInset href
4425 name "http://www.lyx.org/trac/timeline"
4426 target "http://www.lyx.org/trac/timeline"
4430 to see what has been changed.
4431 That way you can easily see which parts of the translated document need
4435 \begin_layout Standard
4436 If you ever find an error in the original document, fix it and notify the
4437 rest of the documentation team of the changes! (You didn't forget to join
4438 the documentation team, did you?)
4441 \begin_layout Standard
4442 \begin_inset Branch OutDated
4445 \begin_layout Section
4446 International Keyboard Support
4449 \begin_layout Standard
4452 [Editor's Note: The following section is by
4460 It needs to be fixed to conform to the new Documentation Style sheet and
4461 to make use of the new v1.0 features.
4462 The whole thing also needs to be merged with the section following it.-jw
4463 It may also be badly out of date.-rh (2008)]
4466 \begin_layout Subsection
4467 Defining Own Keymaps: Keymap File Format
4470 \begin_layout Standard
4471 Let's look at a keyboard definition file a little closer.
4472 It is a plain text file defining
4475 \begin_layout Itemize
4476 key-to-key or key-to-string translations
4479 \begin_layout Itemize
4483 \begin_layout Itemize
4484 dead keys exceptions
4487 \begin_layout Standard
4488 To define key-to-key or key-to-string translation, use this command:
4491 \begin_layout Quotation
4492 \begin_inset Flex CharStyle:Code
4495 \begin_layout Plain Layout
4504 \begin_inset Flex CharStyle:Code
4507 \begin_layout Plain Layout
4516 \begin_layout Standard
4518 \begin_inset Flex CharStyle:Code
4521 \begin_layout Plain Layout
4527 is the key to be translated and
4528 \begin_inset Flex CharStyle:Code
4531 \begin_layout Plain Layout
4537 is the string to be inserted into the document.
4538 To define dead keys, use:
4541 \begin_layout Quotation
4542 \begin_inset Flex CharStyle:Code
4545 \begin_layout Plain Layout
4554 \begin_inset Flex CharStyle:Code
4557 \begin_layout Plain Layout
4566 \begin_layout Standard
4568 \begin_inset Flex CharStyle:Code
4571 \begin_layout Plain Layout
4577 is a keyboard key and
4578 \begin_inset Flex CharStyle:Code
4581 \begin_layout Plain Layout
4588 The following dead keys are supported (shortcut name is in parentheses):
4591 \begin_layout Quotation
4595 \begin_inset space \hfill{}
4601 \begin_layout Quotation
4603 \begin_inset space \hfill{}
4609 \begin_layout Quotation
4611 \begin_inset space \hfill{}
4617 \begin_layout Quotation
4619 \begin_inset space \hfill{}
4625 \begin_layout Quotation
4627 \begin_inset space \hfill{}
4633 \begin_layout Quotation
4635 \begin_inset space \hfill{}
4642 \begin_layout Plain Layout
4654 \begin_layout Quotation
4656 \begin_inset space \hfill{}
4662 \begin_layout Quotation
4664 \begin_inset space \hfill{}
4671 \begin_layout Plain Layout
4683 \begin_layout Quotation
4685 \begin_inset space \hfill{}
4691 \begin_layout Quotation
4693 \begin_inset space \hfill{}
4699 \begin_layout Quotation
4701 \begin_inset space \hfill{}
4708 \begin_layout Plain Layout
4720 \begin_layout Quotation
4722 \begin_inset space \hfill{}
4729 \begin_layout Plain Layout
4741 \begin_layout Quotation
4743 \begin_inset space \hfill{}
4749 \begin_layout Quotation
4750 hungarian umlaut (hug)
4751 \begin_inset space \hfill{}
4757 \begin_layout Quotation
4759 \begin_inset space \hfill{}
4765 \begin_layout Quotation
4767 \begin_inset space \hfill{}
4774 \begin_layout Plain Layout
4786 \begin_layout Standard
4787 Since in many international keyboards there are exceptions to what some
4788 dead keys should do, you can define them using
4791 \begin_layout Quotation
4792 \begin_inset Flex CharStyle:Code
4795 \begin_layout Plain Layout
4803 deadkey key outstring
4806 \begin_layout Standard
4807 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
4811 \begin_layout Quotation
4812 \begin_inset Flex CharStyle:Code
4815 \begin_layout Plain Layout
4828 \begin_layout Standard
4829 to make it work correctly.
4830 Also, you have to define as exceptions dead keys over i and j, to remove
4831 the dot from them before inserting an accent mark.
4832 I will change this when the time comes, but so far I haven't had time.
4835 \begin_layout Standard
4836 Oh, and about characters: backslash is escaped, so to enter it, you'll need
4839 \begin_inset Flex CharStyle:Code
4842 \begin_layout Plain Layout
4848 have different meaning.
4850 \begin_inset Flex CharStyle:Code
4853 \begin_layout Plain Layout
4859 marks comments, quotes start and end LaTeX-style commands.
4860 To enter quote, you'll need to use
4861 \begin_inset Flex CharStyle:Code
4864 \begin_layout Plain Layout
4873 \begin_inset Flex CharStyle:Code
4876 \begin_layout Plain Layout
4883 \begin_inset Flex CharStyle:Code
4886 \begin_layout Plain Layout
4897 \begin_layout Standard
4898 If you make a keyboard description file that works for your language, please
4899 mail it to me, so I can include it in the next keymap distribution.
4902 \begin_layout Standard
4903 More keywords will be supported in keymap configuration file in future,
4907 \begin_layout Itemize
4908 \begin_inset Flex CharStyle:Code
4911 \begin_layout Plain Layout
4922 \begin_inset space \hfill{}
4926 \begin_inset Flex CharStyle:Code
4929 \begin_layout Plain Layout
4938 \begin_layout Itemize
4939 \begin_inset Flex CharStyle:Code
4942 \begin_layout Plain Layout
4953 \begin_inset space \hfill{}
4957 \begin_inset Flex CharStyle:Code
4960 \begin_layout Plain Layout
4966 an external keymap translation program
4969 \begin_layout Standard
4970 Also, it should look into
4971 \begin_inset Flex CharStyle:Code
4974 \begin_layout Plain Layout
4980 file for defaults, too (for example, a
4981 \begin_inset Flex CharStyle:Code
4984 \begin_layout Plain Layout
4992 option to include default keyboard).
5000 \begin_layout Section
5001 \begin_inset CommandInset label
5007 International Keymap Stuff
5010 \begin_layout Standard
5011 \begin_inset Note Note
5014 \begin_layout Plain Layout
5015 In doing the revisions on this document in March 2008, I did not look over
5016 this stuff, as I do not understand it.
5017 It would be good if someone else could do so.
5025 \begin_layout Standard
5026 The next two sections describe the
5027 \begin_inset Flex CharStyle:Code
5030 \begin_layout Plain Layout
5039 \begin_inset Flex CharStyle:Code
5042 \begin_layout Plain Layout
5050 file syntax in detail.
5051 These sections should help you design your own key map if the ones provided
5052 do not meet your needs.
5055 \begin_layout Subsection
5059 \begin_layout Standard
5063 \begin_inset Flex CharStyle:Code
5066 \begin_layout Plain Layout
5072 file maps keystrokes to characters or strings.
5073 As the name suggests, it sets a keyboard mapping.
5075 \begin_inset Flex CharStyle:Code
5078 \begin_layout Plain Layout
5089 \begin_inset Flex CharStyle:Code
5092 \begin_layout Plain Layout
5107 \begin_inset Flex CharStyle:Code
5110 \begin_layout Plain Layout
5123 \begin_inset Flex CharStyle:Code
5126 \begin_layout Plain Layout
5135 \begin_inset Flex CharStyle:Code
5138 \begin_layout Plain Layout
5146 are described in this section.
5149 \begin_layout Labeling
5150 \labelwidthstring 00.00.0000
5151 \begin_inset Flex CharStyle:Code
5154 \begin_layout Plain Layout
5162 Map a character to a string
5165 \begin_layout LyX-Code
5180 \begin_layout Standard
5213 the double-quote (")
5230 must be escaped with a preceding backslash (
5241 \begin_layout Standard
5243 \begin_inset Flex CharStyle:MenuItem
5246 \begin_layout Plain Layout
5254 statement to cause the symbol
5255 \begin_inset Flex CharStyle:MenuItem
5258 \begin_layout Plain Layout
5266 to be output for the keystroke
5267 \begin_inset Flex CharStyle:MenuItem
5270 \begin_layout Plain Layout
5281 \begin_layout LyX-Code
5287 \begin_layout Labeling
5288 \labelwidthstring 00.00.0000
5289 \begin_inset Flex CharStyle:Code
5292 \begin_layout Plain Layout
5300 Specify an accent character
5303 \begin_layout LyX-Code
5312 \begin_layout Standard
5313 This will make the cha
5351 This is the dead key
5355 \begin_layout Plain Layout
5362 refers to a key that does not produce a character by itself, but when followed
5363 with another key, produces the desired accent character.
5364 For example, a German characte
5366 r with an umlaut like
5376 can be produced in this manner.
5385 \begin_layout Standard
5398 and then another key not in
5415 followed by the other, unallowed key, as output.
5419 \begin_inset Flex CharStyle:MenuItem
5422 \begin_layout Plain Layout
5430 cancels a dead key, so if
5441 \begin_inset Flex CharStyle:MenuItem
5444 \begin_layout Plain Layout
5453 , the cursor will not go one position backwards but will instead cancel
5469 might have had on the next keystroke.
5473 \begin_layout Standard
5474 The following example specifies that the character ' is to be an acute accent,
5475 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
5478 \begin_layout LyX-Code
5481 kmod ' acute aeiouAEIOU
5484 \begin_layout Labeling
5485 \labelwidthstring 00.00.0000
5486 \begin_inset Flex CharStyle:Code
5489 \begin_layout Plain Layout
5495 Specify an exception to the accent character
5498 \begin_layout LyX-Code
5507 \begin_layout Standard
5508 This defines an exce
5549 have been assigned a keystroke with a previous
5552 \begin_inset Flex CharStyle:Code
5555 \begin_layout Plain Layout
5579 must not belong in the
5631 If such a declaration does not exist in
5639 \begin_inset Flex CharStyle:Code
5642 \begin_layout Plain Layout
5682 \begin_inset Flex CharStyle:Code
5685 \begin_layout Plain Layout
5699 \begin_layout Standard
5700 The following command produces causes äi to be produced when you enter acute-i
5704 \begin_layout LyX-Code
5718 \begin_layout Labeling
5719 \labelwidthstring 00.00.0000
5720 \begin_inset Flex CharStyle:Code
5723 \begin_layout Plain Layout
5729 Combine two accent characters
5732 \begin_layout LyX-Code
5738 accent1 accent2 allowed
5741 \begin_layout Standard
5742 This one is getting pretty esoteric.
5743 It allows you to combine the effect
5799 \begin_inset Flex CharStyle:Code
5802 \begin_layout Plain Layout
5830 \begin_layout Standard
5831 Consider this example from the
5832 \begin_inset Flex CharStyle:Code
5835 \begin_layout Plain Layout
5846 \begin_layout LyX-Code
5849 kmod ; acute aeioyvhAEIOYVH
5853 kcomb acute umlaut iyIY
5856 \begin_layout Standard
5857 This allows you to press
5858 \begin_inset Flex CharStyle:MenuItem
5861 \begin_layout Plain Layout
5869 and get the effect of
5870 \begin_inset Flex CharStyle:Code
5873 \begin_layout Plain Layout
5892 in this case cancels the last dead key, so if you press
5893 \begin_inset Flex CharStyle:MenuItem
5896 \begin_layout Plain Layout
5905 \begin_inset Flex CharStyle:Code
5908 \begin_layout Plain Layout
5921 \begin_layout Subsection
5925 \begin_layout Standard
5927 \begin_inset Flex CharStyle:Code
5930 \begin_layout Plain Layout
5938 mapping is performed, a
5939 \begin_inset Flex CharStyle:Code
5942 \begin_layout Plain Layout
5952 file maps the strings that the symbols generate to characters in the current
5954 The LyX distribution currently includes at least the
5955 \begin_inset Flex CharStyle:Code
5958 \begin_layout Plain Layout
5967 \begin_inset Flex CharStyle:Code
5970 \begin_layout Plain Layout
5981 \begin_layout Standard
5983 \begin_inset Flex CharStyle:Code
5986 \begin_layout Plain Layout
5994 file is a sequence of declarations of the form
5997 \begin_layout LyX-Code
6010 \begin_layout Standard
6011 For example, in order to map
6012 \begin_inset Flex CharStyle:MenuItem
6015 \begin_layout Plain Layout
6025 to the corresponding character in the iso-8859-1 set (233), the following
6029 \begin_layout LyX-Code
6037 \begin_layout Standard
6039 \begin_inset Flex CharStyle:Code
6042 \begin_layout Plain Layout
6051 \begin_inset Flex CharStyle:Code
6054 \begin_layout Plain Layout
6072 the same character can apply to more than one string.
6074 \begin_inset Flex CharStyle:Code
6077 \begin_layout Plain Layout
6088 \begin_layout LyX-Code
6100 \begin_inset Newline newline
6116 \begin_layout Standard
6117 If LyX cannot find a mapping for the string produced by the keystroke or
6118 a deadkey sequence, it will check if it looks like an accented char and
6119 try to draw an accent over the character on screen.
6122 \begin_layout Subsection
6126 \begin_layout Standard
6127 There is a second way to add support for international characters through
6128 so-called dead-keys.
6129 A dead-key works in combination with a letter to produce an accented character.
6130 Here, we'll explain how to create a really simple dead-key to illustrate
6134 \begin_layout Standard
6135 Suppose you happen to need the circumflex character,
6136 \begin_inset Quotes eld
6140 \begin_inset Quotes erd
6145 \begin_inset Flex CharStyle:MenuItem
6148 \begin_layout Plain Layout
6155 \begin_inset space ~
6159 \begin_inset Flex CharStyle:MenuItem
6162 \begin_layout Plain Layout
6168 ] to the LyX command
6169 \begin_inset Flex CharStyle:Code
6172 \begin_layout Plain Layout
6179 \begin_inset Flex CharStyle:Code
6182 \begin_layout Plain Layout
6189 Now, whenever you type the
6190 \begin_inset Flex CharStyle:MenuItem
6193 \begin_layout Plain Layout
6199 -key followed by a letter, that letter will have a circumflex accent on
6201 For example, the sequence
6202 \begin_inset Quotes eld
6206 \begin_inset Flex CharStyle:MenuItem
6209 \begin_layout Plain Layout
6216 \begin_inset Quotes erd
6219 produces the letter:
6220 \begin_inset Quotes eld
6224 \begin_inset Quotes erd
6228 If you tried to type
6229 \begin_inset Quotes eld
6233 \begin_inset Flex CharStyle:MenuItem
6236 \begin_layout Plain Layout
6243 \begin_inset Quotes erd
6246 , however, LyX will complain with a beep, since a
6247 \begin_inset Quotes eld
6251 \begin_inset Flex CharStyle:MenuItem
6254 \begin_layout Plain Layout
6261 \begin_inset Quotes erd
6264 never takes a circumflex accent.
6266 \begin_inset Flex CharStyle:MenuItem
6269 \begin_layout Plain Layout
6275 after a dead-key produces the bare-accent.
6276 Please note this last point! If you bind a key to a dead-key, you'll need
6277 to rebind the character on that key to yet another key.
6279 \begin_inset Flex CharStyle:MenuItem
6282 \begin_layout Plain Layout
6288 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
6291 \begin_layout Standard
6292 One common way to bind dead-keys is to use
6293 \begin_inset Flex CharStyle:MenuItem
6296 \begin_layout Plain Layout
6303 \begin_inset Flex CharStyle:MenuItem
6306 \begin_layout Plain Layout
6313 \begin_inset Flex CharStyle:MenuItem
6316 \begin_layout Plain Layout
6322 in combination with an accent, like
6323 \begin_inset Quotes eld
6327 \begin_inset Flex CharStyle:MenuItem
6330 \begin_layout Plain Layout
6337 \begin_inset Quotes erd
6341 \begin_inset Quotes eld
6345 \begin_inset Flex CharStyle:MenuItem
6348 \begin_layout Plain Layout
6355 \begin_inset Quotes erd
6359 \begin_inset Quotes eld
6363 \begin_inset Flex CharStyle:MenuItem
6366 \begin_layout Plain Layout
6373 \begin_inset Quotes erd
6377 Another way involves using
6378 \begin_inset Flex CharStyle:Code
6381 \begin_layout Plain Layout
6388 \begin_inset Flex CharStyle:Code
6391 \begin_layout Plain Layout
6397 to set up the special
6398 \begin_inset Flex CharStyle:Code
6401 \begin_layout Plain Layout
6409 \begin_inset Flex CharStyle:Code
6412 \begin_layout Plain Layout
6418 acts in some ways just like
6419 \begin_inset Flex CharStyle:MenuItem
6422 \begin_layout Plain Layout
6428 and permits you to bind keys to accented characters.
6429 You can also turn keys into dead-keys by binding them to something like
6431 \begin_inset Flex CharStyle:Code
6434 \begin_layout Plain Layout
6440 and then binding this symbolic key to the corresponding LyX command.
6444 \begin_layout Plain Layout
6449 : This is exactly what I do in my
6450 \begin_inset Flex CharStyle:Code
6453 \begin_layout Plain Layout
6460 \begin_inset Flex CharStyle:Code
6463 \begin_layout Plain Layout
6471 \begin_inset Flex CharStyle:MenuItem
6474 \begin_layout Plain Layout
6476 \begin_inset space ~
6485 \begin_inset Flex CharStyle:Code
6488 \begin_layout Plain Layout
6494 and a bunch of these
6495 \begin_inset Quotes eld
6499 \begin_inset Flex CharStyle:Code
6502 \begin_layout Plain Layout
6509 \begin_inset Quotes erd
6512 symbolic keys bound such things as
6513 \begin_inset Flex CharStyle:MenuItem
6516 \begin_layout Plain Layout
6518 \begin_inset space ~
6527 \begin_inset Flex CharStyle:MenuItem
6530 \begin_layout Plain Layout
6532 \begin_inset space ~
6541 This is how I produce my accented characters.
6546 You can make just about anything into the
6547 \begin_inset Flex CharStyle:Code
6550 \begin_layout Plain Layout
6557 \begin_inset Flex CharStyle:MenuItem
6560 \begin_layout Plain Layout
6566 keys, a spare function key, etc.
6567 As for the LyX commands that produce accents, check the entry for
6568 \begin_inset Flex CharStyle:Code
6571 \begin_layout Plain Layout
6582 You'll find the complete list there.
6585 \begin_layout Subsection
6586 Saving your Language Configuration
6589 \begin_layout Standard
6590 \begin_inset CommandInset label
6596 You can edit your preferences so that your desired language environment
6597 is automatically configured when LyX starts up, via the
6598 \begin_inset Flex CharStyle:MenuItem
6601 \begin_layout Plain Layout
6606 dit\SpecialChar \menuseparator
6619 \begin_layout Chapter
6620 Installing New Document Classes, Layouts, and Templates
6621 \begin_inset CommandInset label
6623 name "chap:textclass"
6631 \begin_layout Plain Layout
6632 Installing New Document Classes
6640 \begin_layout Standard
6641 In this chapter, we describe the procedures for creating and installing
6642 new LyX layout and template files, as well as offer a refresher on correctly
6643 installing new LaTeX document classes.
6644 Some definitions: a document class is a LaTeX file (usually ending in
6645 \begin_inset Flex CharStyle:Code
6648 \begin_layout Plain Layout
6655 \begin_inset Flex CharStyle:Code
6658 \begin_layout Plain Layout
6664 ) that describes the format of a document such as an article, report, journal
6665 preprint, etc, and all the commands needed to realize that format.
6666 A layout file is a LyX file that corresponds to a LaTeX document class
6667 and that tells LyX how to
6668 \begin_inset Quotes eld
6672 \begin_inset Quotes erd
6675 things on the screen to make the display look something like the final
6677 More precisely, a layout file describes a
6678 \begin_inset Quotes eld
6682 \begin_inset Quotes erd
6685 which is the internal construct LyX uses to render the screen display.
6687 \begin_inset Quotes eld
6691 \begin_inset Quotes erd
6695 \begin_inset Quotes eld
6699 \begin_inset Quotes erd
6702 can be used somewhat interchangeably, but it is better to refer to the
6703 file as the layout, and the thing living in LyX's memory as the text class.
6704 A template file is simply a LyX document that contains a set of predefined
6705 entries for a given document class---entries that are generally required
6707 Templates are especially useful for things like journal manuscripts that
6708 are to be submitted electronically.
6711 \begin_layout Section
6712 Installing a new LaTeX package
6715 \begin_layout Standard
6716 Some installations may not include a LaTeX package that you would like to
6718 For example, you might need FoilTeX, a common (and very powerful) package
6719 for preparing slides or viewgraphs for overhead projectors.
6720 On some systems, you may have a GUI for installing such packages: MikTeX
6721 on Windows®, for example.
6724 \begin_layout Standard
6725 If you don't have such a GUI, then you can follow these steps.
6728 \begin_layout Enumerate
6729 Get the package from
6730 \begin_inset CommandInset href
6733 target "http://www.ctan.org/"
6740 \begin_layout Enumerate
6741 You can install this package in several different places.
6742 If you want it to be available for all users on your system, then you should
6743 install it in your `local' TeX tree; if you want (or need) it to be available
6744 just for you, then you can install it in your own `user' TeX tree.
6745 Where these should be created, if they do not already exist, depends upon
6746 the details of your system.
6747 To find out, look in the file
6748 \begin_inset Flex CharStyle:Code
6751 \begin_layout Plain Layout
6761 \begin_layout Plain Layout
6762 This usually lives in the directory
6763 \begin_inset Flex CharStyle:Code
6766 \begin_layout Plain Layout
6772 , though you can run
6773 \begin_inset Flex CharStyle:Code
6776 \begin_layout Plain Layout
6787 The location of the `local' TeX tree is defined by
6788 \begin_inset Flex CharStyle:Code
6791 \begin_layout Plain Layout
6797 ; this is usually somewhere like
6798 \begin_inset Flex CharStyle:Code
6801 \begin_layout Plain Layout
6802 /usr/local/share/texmf/
6808 The `user' TeX tree is defined by
6809 \begin_inset Flex CharStyle:Code
6812 \begin_layout Plain Layout
6819 \begin_inset Flex CharStyle:Code
6822 \begin_layout Plain Layout
6829 (If these variables are not predefined, you can define them.) You'll probably
6830 need root permissions to create or modify the `local' tree; but your `user'
6831 tree shouldn't have such limitations.
6834 \begin_layout Enumerate
6836 \begin_inset Flex CharStyle:Code
6839 \begin_layout Plain Layout
6846 \begin_inset Flex CharStyle:Code
6849 \begin_layout Plain Layout
6856 \begin_inset Flex CharStyle:Code
6859 \begin_layout Plain Layout
6867 \begin_inset Newline newline
6871 \begin_inset Flex CharStyle:Code
6874 \begin_layout Plain Layout
6875 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
6881 \begin_inset Newline newline
6884 But, again, most of this will
6885 \begin_inset Quotes eld
6889 \begin_inset Quotes erd
6895 \begin_layout Enumerate
6900 \begin_layout Plain Layout
6901 We'll assume henceforth that you're defining `local' TeX tree.
6902 If you're defining a user tree, just adjust as necessary.
6908 You must follow the directory structure of your existing
6909 \begin_inset Flex CharStyle:Code
6912 \begin_layout Plain Layout
6918 directory, which will be found at
6919 \begin_inset Flex CharStyle:Code
6922 \begin_layout Plain Layout
6929 For example, latex packages should go under
6930 \begin_inset Flex CharStyle:Code
6933 \begin_layout Plain Layout
6934 $TEXMFLOCAL/tex/latex/
6942 \begin_layout Enumerate
6943 Install the package.
6944 For example, you would unpack the FoilTeX tarball and copy it to
6945 \begin_inset Flex CharStyle:Code
6948 \begin_layout Plain Layout
6949 $TEXMFLOCAL/tex/latex/foiltex
6956 \begin_inset Flex CharStyle:Code
6959 \begin_layout Plain Layout
6965 directory contains various files.
6968 \begin_layout Enumerate
6970 \begin_inset Flex CharStyle:Code
6973 \begin_layout Plain Layout
6981 \begin_inset Flex CharStyle:Code
6984 \begin_layout Plain Layout
6993 \begin_layout Standard
6994 Your package is now installed and available to LaTeX.
6995 To make it available to LyX, you need to create a Layout file, if one is
6996 not already available.
6997 (See the next section.) Once you have a layout file, you need only reconfigure
6999 \begin_inset Flex CharStyle:MenuItem
7002 \begin_layout Plain Layout
7007 ools\SpecialChar \menuseparator
7017 ) and then restart LyX.
7018 You should then see your new package---for example
7019 \begin_inset Flex CharStyle:MenuItem
7022 \begin_layout Plain Layout
7029 \begin_inset Flex CharStyle:MenuItem
7032 \begin_layout Plain Layout
7037 ocument\SpecialChar \menuseparator
7048 \begin_inset Flex CharStyle:MenuItem
7051 \begin_layout Plain Layout
7061 \begin_layout Section
7062 \begin_inset CommandInset label
7071 \begin_layout Standard
7072 This section describes how to write and install your own LyX layout files
7073 and walks through the
7074 \begin_inset Flex CharStyle:Code
7077 \begin_layout Plain Layout
7083 text class format as an example.
7085 \begin_inset Flex CharStyle:Code
7088 \begin_layout Plain Layout
7094 files describe what paragraph and character styles are available for a
7095 given document class and how LyX should display them.
7096 We try to provide a thorough description of the process here; however,
7097 there are so many different types of documents supported by LaTeX classes
7098 that we can't hope to cover every different possibility or problem you
7100 (The LyX users' list is frequented by people with lots of experience with
7101 layout design who are willing to share what they've learned.)
7104 \begin_layout Standard
7105 As you prepare to write a new layout, it is extremely helpful to look at
7106 the example layouts distributed with LyX.
7107 If you use a nice LaTeX document class that might be of interest for others,
7108 too, and have a nice corresponding LyX layout, feel free to contribute
7109 the stuff to us, so we may put it into the distribution.
7111 \begin_inset CommandInset href
7113 name "section on the LyX wiki"
7114 target "http://wiki.lyx.org/Layouts/Layouts"
7118 for this kind of material.
7121 \begin_layout Standard
7122 All the tags described in this chapter are case-insensitive; this means
7124 \begin_inset Flex CharStyle:Code
7127 \begin_layout Plain Layout
7134 \begin_inset Flex CharStyle:Code
7137 \begin_layout Plain Layout
7144 \begin_inset Flex CharStyle:Code
7147 \begin_layout Plain Layout
7153 are really the same command.
7154 The possible values are printed in brackets after the feature's name.
7155 The default value if a feature isn't specified inside a text class-description
7157 \begin_inset Flex CharStyle:Code
7160 \begin_layout Plain Layout
7169 If the argument has a datatype like
7170 \begin_inset Quotes eld
7174 \begin_inset Quotes erd
7178 \begin_inset Quotes eld
7182 \begin_inset Quotes erd
7185 , the default is shown like this:
7186 \begin_inset Flex CharStyle:Code
7189 \begin_layout Plain Layout
7200 \begin_layout Subsection
7201 \begin_inset CommandInset label
7203 name "sub:Layout-modules"
7210 \begin_layout Standard
7211 Similar to layout files, and new with LyX 1.6, are layout
7216 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
7217 some modules---such as the Endnotes module---provide support for just such
7219 In a sense, layout modules are similar to included files---files like
7220 \begin_inset Flex CharStyle:Code
7223 \begin_layout Plain Layout
7229 ---in that modules are not specific to a given document layout but may be
7230 used with many different layouts.
7231 The difference is that using a layout module does not require editing the
7233 Rather, modules are selected in the
7234 \begin_inset Flex CharStyle:MenuItem
7237 \begin_layout Plain Layout
7242 ocument\SpecialChar \menuseparator
7255 \begin_layout Standard
7256 Building modules is the easiest way to get started with layout editing,
7257 since it can be as simple as adding a single new paragraph or flex inset.
7258 But modules may, in principle, contain anything a layout file can contain.
7261 \begin_layout Standard
7262 A module must begin with a line like the following:
7265 \begin_layout LyX-Code
7268 DeclareLyXModule[endnotes.sty]{Endnotes}
7271 \begin_layout Standard
7272 The argument in square brackets is optional: It declares any LaTeX packages
7273 on which the module depends.
7274 The mandatory argument, in curly brackets, is the name of the module, as
7276 \begin_inset Flex CharStyle:MenuItem
7279 \begin_layout Plain Layout
7280 Document\SpecialChar \menuseparator
7290 \begin_layout Standard
7291 The module declaration should then be followed by lines like the following:
7294 \begin_layout LyX-Code
7298 \begin_layout LyX-Code
7299 #Adds an endnote command, in addition to footnotes.
7303 \begin_layout LyX-Code
7304 #You will need to add
7306 theendnotes in ERT where you
7309 \begin_layout LyX-Code
7310 #want the endnotes to appear.
7314 \begin_layout LyX-Code
7318 \begin_layout LyX-Code
7319 #Requires: somemodule | othermodule
7322 \begin_layout LyX-Code
7323 #Excludes: badmodule
7326 \begin_layout Standard
7327 The description is used in
7328 \begin_inset Flex CharStyle:MenuItem
7331 \begin_layout Plain Layout
7332 Document\SpecialChar \menuseparator
7338 to provide the user with information about what the module does.
7340 \begin_inset Flex CharStyle:Code
7343 \begin_layout Plain Layout
7349 line is used to identify other modules with which this one must be used;
7351 \begin_inset Flex CharStyle:Code
7354 \begin_layout Plain Layout
7360 line is used to identify modules with which this one may not be used.
7361 Both are optional, and, as shown, multiple modules should be separated
7362 with the pipe symbol: |.
7363 Note that the required modules are treated disjunctively:
7367 of the required modules must be used.
7372 excluded module may be used.
7373 Note that modules are identified here by their
7377 without the .module extension.
7379 \begin_inset Flex CharStyle:Code
7382 \begin_layout Plain Layout
7389 \begin_inset Flex CharStyle:Code
7392 \begin_layout Plain Layout
7401 \begin_layout Standard
7402 After creating a new module, you will need to reconfigure and then restart
7403 LyX for the module to appear in the menu.
7404 However, changes you make to the module will be seen immediately, if you
7406 \begin_inset Flex CharStyle:MenuItem
7409 \begin_layout Plain Layout
7410 Document\SpecialChar \menuseparator
7416 , highlight something, and then hit
7417 \begin_inset Quotes eld
7421 \begin_inset Quotes erd
7427 It is strongly recommended that you save your work before doing so
7432 it is strongly recommended that you not attempt to edit modules while simultaneo
7433 usly working on documents
7436 Though of course the developers strive to keep LyX stable in such situations,
7437 syntax errors and the like in your module file could cause strange behavior.
7440 \begin_layout Subsection
7441 Supporting new document classes
7444 \begin_layout Standard
7445 There are two situations you are likely to encounter when wanting to support
7446 a new LaTeX document class, involving LaTeX2e class (
7447 \begin_inset Flex CharStyle:Code
7450 \begin_layout Plain Layout
7457 \begin_inset Flex CharStyle:Code
7460 \begin_layout Plain Layout
7467 Supporting a style file is usually fairly easy.
7468 Supporting a new document class is a bit harder.
7471 \begin_layout Subsection
7473 \begin_inset Flex CharStyle:MenuItem
7476 \begin_layout Plain Layout
7485 \begin_layout Standard
7486 If your new document class is provided as a style file that is used in conjuncti
7487 on with an existing, supported document class---for the sake of the example,
7488 we'll assume that the style file is called
7489 \begin_inset Flex CharStyle:MenuItem
7492 \begin_layout Plain Layout
7498 and it is meant to be used with
7499 \begin_inset Flex CharStyle:MenuItem
7502 \begin_layout Plain Layout
7508 , which is a standard class---start by copying the existing class's layout
7509 file into your local directory:
7512 \begin_layout LyX-Code
7513 cp report.layout ~/.lyx/layouts/myclass.layout
7516 \begin_layout Standard
7518 \begin_inset Flex CharStyle:Code
7521 \begin_layout Plain Layout
7527 and change the line:
7530 \begin_layout LyX-Code
7533 DeclareLaTeXClass{report}
7536 \begin_layout Standard
7540 \begin_layout LyX-Code
7543 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
7546 \begin_layout Standard
7550 \begin_layout LyX-Code
7552 \begin_inset Newline newline
7558 \begin_inset Newline newline
7564 \begin_layout Standard
7565 near the top of the file.
7568 \begin_layout Standard
7569 Start LyX and select
7570 \begin_inset Flex CharStyle:MenuItem
7573 \begin_layout Plain Layout
7578 ools\SpecialChar \menuseparator
7589 Then restart LyX and try creating a new document.
7591 \begin_inset Flex CharStyle:MenuItem
7594 \begin_layout Plain Layout
7600 " as a document class option in the
7601 \begin_inset Flex CharStyle:MenuItem
7604 \begin_layout Plain Layout
7609 ocument\SpecialChar \menuseparator
7620 It is likely that some of the sectioning commands and such in your new
7621 class will work differently from how they worked in the base class---
7622 \begin_inset Flex CharStyle:Code
7625 \begin_layout Plain Layout
7631 in this example---so you can fiddle around with the settings for the different
7632 sections if you wish.
7635 \begin_layout Subsection
7637 \begin_inset Flex CharStyle:MenuItem
7640 \begin_layout Plain Layout
7649 \begin_layout Standard
7650 There are two possibilities here.
7651 One is that the class file is itself based upon an existing document class.
7652 For example, many thesis classes are based upon
7653 \begin_inset Flex CharStyle:MenuItem
7656 \begin_layout Plain Layout
7663 To see whether yours is, look for a line like
7666 \begin_layout LyX-Code
7672 \begin_layout Standard
7674 If so, then you may proceed largely as in the previous section, though
7675 the DeclareLaTeXClass line will be different.
7676 If your new class is thesis, and it is based upon book, then the line should
7681 \begin_layout Plain Layout
7682 And it will be easiest if you save the file to
7683 \begin_inset Flex CharStyle:Code
7686 \begin_layout Plain Layout
7692 : LyX assumes that the document class has the same name as the layout file.
7701 \begin_layout LyX-Code
7704 DeclareLaTeXClass[thesis,book]{thesis}
7707 \begin_layout Standard
7708 If, on the other hand, the new class is not based upon an existing class,
7709 you will probably have to
7710 \begin_inset Quotes eld
7714 \begin_inset Quotes erd
7718 We strongly suggest copying an existing layout file which uses a similar
7719 LaTeX class and then modifying it, if you can do so.
7720 At least use an existing file as a starting point so you can find out what
7721 items you need to worry about.
7722 Again, the specifics are covered below.
7725 \begin_layout Section
7726 Declaring a new text class
7729 \begin_layout Standard
7730 When it's finally time to get your hands dirty and create or edit your own
7731 layout file, the following sections describe what you're up against.
7732 Our advice is to go slowly, save and test often, listen to soothing music,
7733 and enjoy one or two of your favorite adult beverages; more if you are
7734 getting particularly stuck.
7735 It's really not that hard, except that the multitude of options can become
7736 overwhelming if you try to do to much in one sitting.
7737 Go have another adult beverage, just for good measure.
7740 \begin_layout Standard
7744 \begin_layout Standard
7745 Lines in a layout file which begin with a
7746 \begin_inset Flex CharStyle:Code
7749 \begin_layout Plain Layout
7756 There is one exception to this rule: all layouts should begin with lines
7760 \begin_layout LyX-Code
7763 #% Do not delete the line below; configure depends on this
7766 \begin_layout LyX-Code
7771 DeclareLaTeXClass{article}
7774 \begin_layout Standard
7775 The second line is used when you configure LyX.
7776 The layout file is read by the LaTeX script
7777 \begin_inset Flex CharStyle:Code
7780 \begin_layout Plain Layout
7786 , in a special mode where
7787 \begin_inset Flex CharStyle:Code
7790 \begin_layout Plain Layout
7797 The first line is just a LaTeX comment, and the second one contains the
7798 declaration of the text class.
7799 If these lines appear in a file named
7800 \begin_inset Flex CharStyle:Code
7803 \begin_layout Plain Layout
7809 , then they define a text class of name
7810 \begin_inset Flex CharStyle:Code
7813 \begin_layout Plain Layout
7819 (the name of the layout file) which uses the LaTeX document class
7820 \begin_inset Flex CharStyle:Code
7823 \begin_layout Plain Layout
7829 (the default is to use the same name as the layout).
7831 \begin_inset Quotes eld
7835 \begin_inset Quotes erd
7838 that appears above is used as a description of the text class in the
7839 \begin_inset Flex CharStyle:MenuItem
7842 \begin_layout Plain Layout
7847 ocument\SpecialChar \menuseparator
7860 \begin_layout Standard
7861 Let's assume that you wrote your own text class that uses the
7862 \begin_inset Flex CharStyle:Code
7865 \begin_layout Plain Layout
7871 document class, but where you changed the appearance of the section headings.
7872 If you put it in a file
7873 \begin_inset Flex CharStyle:Code
7876 \begin_layout Plain Layout
7882 , the header of this file should be:
7885 \begin_layout LyX-Code
7888 #% Do not delete the line below; configure depends on this
7891 \begin_layout LyX-Code
7896 DeclareLaTeXClass[article]{article (with my own headings)}
7899 \begin_layout Standard
7900 This declares a text class
7901 \begin_inset Flex CharStyle:Code
7904 \begin_layout Plain Layout
7910 , associated with the LaTeX document class
7911 \begin_inset Flex CharStyle:Code
7914 \begin_layout Plain Layout
7921 \begin_inset Quotes eld
7924 article (with my own headings)
7925 \begin_inset Quotes erd
7929 If your text class depends on several packages, you can declare it as:
7932 \begin_layout LyX-Code
7935 #% Do not delete the line below; configure depends on this
7938 \begin_layout LyX-Code
7943 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7946 \begin_layout Standard
7947 This indicates that your text class uses the foo.sty package.
7948 Finally, it is also possible to declare classes for DocBook code.
7949 Typical declarations will look like
7952 \begin_layout LyX-Code
7955 #% Do not delete the line below; configure depends on this
7958 \begin_layout LyX-Code
7963 DeclareDocBookClass[article]{SGML (DocBook article)}
7966 \begin_layout Standard
7967 Note that these declarations can also be given an optional parameter declaring
7968 the name of the document class (but not a list).
7971 \begin_layout Standard
7972 So, to be as explicit as possible, the form of the layout declaration is:
7975 \begin_layout LyX-Code
7980 DeclareLaTeXClass[class,package.sty]{layout description}
7983 \begin_layout Standard
7984 The class need only be specified if the name of the LaTeX class file and
7985 the name of the layout file are different; if the name of the classfile
7986 is not specified, then LyX will simply assume that it is the same as the
7987 name of the layout file.
7990 \begin_layout Standard
7991 When the text class has been modified to your taste, all you have to do
7992 is to copy it either to
7993 \begin_inset Flex CharStyle:Code
7996 \begin_layout Plain Layout
8003 \begin_inset Flex CharStyle:Code
8006 \begin_layout Plain Layout
8013 \begin_inset Flex CharStyle:MenuItem
8016 \begin_layout Plain Layout
8021 ools\SpecialChar \menuseparator
8031 , exit LyX and restart it.
8032 Then your new text class should be available along with the others.
8035 \begin_layout Standard
8036 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
8037 you made to your layout files.
8038 As a result, editing layout files could be very time consuming.
8039 Beginning with 1.6, however, you can force a reload of the layout currently
8040 in use by using the LyX function
8041 \begin_inset Flex CharStyle:MenuItem
8044 \begin_layout Plain Layout
8051 There is no default binding for this function---though, of course, you
8052 can bind it to a key yourself (see section
8053 \begin_inset CommandInset ref
8055 reference "sec:bindings"
8060 If you want to use this function, then, you should simply enter it in the
8066 : This is very much an `advanced feature'.
8071 recommended that you save your work before using this function.
8076 recommended that you not attempt to edit your layout while simultaneously
8077 working on a document that you care about.
8078 Use a test document.
8079 Syntax errors and the like in your layout file could cause peculiar behavior.
8080 In particular, such errors could cause LyX to regard the current layout
8081 as invalid and to attempt to switch to some other layout.
8082 The LyX team strives to keep LyX stable in such situations, but safe is
8086 \begin_layout Subsection
8090 \begin_layout Standard
8091 The first non-comment line must contain the file format number:
8094 \begin_layout Description
8095 \begin_inset Flex CharStyle:Code
8098 \begin_layout Plain Layout
8105 \begin_inset Flex CharStyle:Code
8108 \begin_layout Plain Layout
8114 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
8115 don't have an explicit file format).
8116 The file format that is documented here is format 7.
8119 \begin_layout Subsection
8120 General text class parameters
8123 \begin_layout Standard
8124 These are the general parameters which describe the form of the entire document:
8127 \begin_layout Description
8128 \begin_inset Flex CharStyle:Code
8131 \begin_layout Plain Layout
8137 Adds information to the document preamble.
8139 \begin_inset Quotes eld
8143 \begin_inset Flex CharStyle:Code
8146 \begin_layout Plain Layout
8153 \begin_inset Quotes erd
8159 \begin_layout Description
8160 \begin_inset Flex CharStyle:Code
8163 \begin_layout Plain Layout
8169 Describes various global options supported by the document class.
8171 \begin_inset space ~
8175 \begin_inset CommandInset ref
8177 reference "sec:classoptions"
8183 \begin_inset Quotes eld
8187 \begin_inset Flex CharStyle:Code
8190 \begin_layout Plain Layout
8197 \begin_inset Quotes erd
8203 \begin_layout Description
8204 \begin_inset Flex CharStyle:Code
8207 \begin_layout Plain Layout
8214 \begin_inset Flex CharStyle:Code
8217 \begin_layout Plain Layout
8226 \begin_inset Flex CharStyle:Code
8229 \begin_layout Plain Layout
8235 ] Whether the class should default to having one or two columns.
8236 Can be changed in the
8237 \begin_inset Flex CharStyle:MenuItem
8240 \begin_layout Plain Layout
8245 ocument\SpecialChar \menuseparator
8258 \begin_layout Description
8259 \begin_inset Flex CharStyle:Code
8262 \begin_layout Plain Layout
8268 This sequence defines a new counter.
8270 \begin_inset space ~
8274 \begin_inset CommandInset ref
8276 reference "sec:counter"
8282 \begin_inset Quotes eld
8286 \begin_inset Flex CharStyle:Code
8289 \begin_layout Plain Layout
8296 \begin_inset Quotes erd
8302 \begin_layout Description
8303 \begin_inset Flex CharStyle:Code
8306 \begin_layout Plain Layout
8312 Sets the default font used to display the document.
8314 \begin_inset space ~
8318 \begin_inset CommandInset ref
8320 reference "sec:fonts"
8324 for how to declare fonts.
8326 \begin_inset Quotes eld
8330 \begin_inset Flex CharStyle:Code
8333 \begin_layout Plain Layout
8340 \begin_inset Quotes erd
8346 \begin_layout Description
8347 \begin_inset Flex CharStyle:Code
8350 \begin_layout Plain Layout
8357 \begin_inset Flex CharStyle:Code
8360 \begin_layout Plain Layout
8366 ] This is the style that will be assigned to new paragraphs, usually
8367 \begin_inset Flex CharStyle:MenuItem
8370 \begin_layout Plain Layout
8377 This will default to the first defined style if not given, but you are
8378 highly encouraged to use this directive.
8381 \begin_layout Description
8382 \begin_inset Flex CharStyle:Code
8385 \begin_layout Plain Layout
8391 Defines a new float.
8393 \begin_inset space ~
8397 \begin_inset CommandInset ref
8399 reference "sec:floats"
8405 \begin_inset Quotes eld
8409 \begin_inset Flex CharStyle:Code
8412 \begin_layout Plain Layout
8419 \begin_inset Quotes erd
8425 \begin_layout Description
8426 \begin_inset Flex CharStyle:Code
8429 \begin_layout Plain Layout
8435 As its name implies, this command allows you to include another layout
8436 definition file within yours to avoid duplicating commands.
8437 Common examples are the standard layout files, for example,
8438 \begin_inset Flex CharStyle:Code
8441 \begin_layout Plain Layout
8447 , which contains most of the basic layouts.
8450 \begin_layout Description
8451 \begin_inset Flex CharStyle:Code
8454 \begin_layout Plain Layout
8460 This section (re-)defines the layout of an inset.
8461 It can be applied to an existing inset of to a new, user-defined inset,
8462 e.g., a new character style.
8464 \begin_inset space ~
8468 \begin_inset CommandInset ref
8470 reference "sec:charstyle"
8474 for more information.
8476 \begin_inset Quotes eld
8480 \begin_inset Flex CharStyle:Code
8483 \begin_layout Plain Layout
8490 \begin_inset Quotes erd
8496 \begin_layout Description
8497 \begin_inset Flex CharStyle:Code
8500 \begin_layout Plain Layout
8509 \begin_layout Description
8510 \begin_inset Flex CharStyle:Code
8513 \begin_layout Plain Layout
8519 This command deletes an existing float.
8520 This is particularly useful when you want to suppress a float that has
8521 be defined in an input file.
8524 \begin_layout Description
8525 \begin_inset Flex CharStyle:Code
8528 \begin_layout Plain Layout
8534 This command deletes an existing style.
8535 This is particularly useful when you want to suppress a style that has
8536 be defined in an input file.
8539 \begin_layout Description
8540 \begin_inset Flex CharStyle:Code
8543 \begin_layout Plain Layout
8552 \begin_layout Description
8553 \begin_inset Flex CharStyle:Code
8556 \begin_layout Plain Layout
8567 \begin_inset Flex CharStyle:Code
8570 \begin_layout Plain Layout
8581 \begin_inset Flex CharStyle:Code
8584 \begin_layout Plain Layout
8591 \begin_inset Flex CharStyle:Code
8594 \begin_layout Plain Layout
8600 ] The class default pagestyle.
8601 Can be changed in the
8602 \begin_inset Flex CharStyle:MenuItem
8605 \begin_layout Plain Layout
8610 ocument\SpecialChar \menuseparator
8623 \begin_layout Description
8624 \begin_inset Flex CharStyle:Code
8627 \begin_layout Plain Layout
8633 Sets the preamble for the LaTeX document.
8634 Note that this will completely override any prior
8635 \begin_inset Flex CharStyle:Code
8638 \begin_layout Plain Layout
8645 \begin_inset Flex CharStyle:Code
8648 \begin_layout Plain Layout
8656 \begin_inset Quotes eld
8660 \begin_inset Flex CharStyle:Code
8663 \begin_layout Plain Layout
8670 \begin_inset Quotes erd
8676 \begin_layout Description
8677 \begin_inset Flex CharStyle:Code
8680 \begin_layout Plain Layout
8687 \begin_inset CommandInset label
8694 \begin_inset Flex CharStyle:Code
8697 \begin_layout Plain Layout
8704 \begin_inset Flex CharStyle:Code
8707 \begin_layout Plain Layout
8716 \begin_inset Flex CharStyle:Code
8719 \begin_layout Plain Layout
8725 ] Whether the class already provides the feature
8726 \begin_inset Flex CharStyle:Code
8729 \begin_layout Plain Layout
8736 A feature is in general the name of a package (
8737 \begin_inset Flex CharStyle:Code
8740 \begin_layout Plain Layout
8747 \begin_inset Flex CharStyle:Code
8750 \begin_layout Plain Layout
8756 , \SpecialChar \ldots{}
8758 \begin_inset Flex CharStyle:Code
8761 \begin_layout Plain Layout
8768 \begin_inset Flex CharStyle:Code
8771 \begin_layout Plain Layout
8777 ,\SpecialChar \ldots{}
8778 ); the complete list of supported features is unfortunately not documented
8779 outside the LyX source code---but see
8780 \begin_inset Flex CharStyle:Code
8783 \begin_layout Plain Layout
8789 if you're interested.
8791 \begin_inset Flex CharStyle:MenuItem
8794 \begin_layout Plain Layout
8799 elp\SpecialChar \menuseparator
8809 also gives an overview of the supported packages.
8812 \begin_layout Description
8813 \begin_inset Flex CharStyle:Code
8816 \begin_layout Plain Layout
8823 \begin_inset Flex CharStyle:Code
8826 \begin_layout Plain Layout
8832 ] Whether the class requires the feature
8833 \begin_inset Flex CharStyle:Code
8836 \begin_layout Plain Layout
8843 Multiple features must be separated by commas.
8844 Note that you can only request supported features.
8847 \begin_layout Description
8848 \begin_inset Flex CharStyle:Code
8851 \begin_layout Plain Layout
8860 \begin_layout Description
8861 \begin_inset Flex CharStyle:Code
8864 \begin_layout Plain Layout
8873 \begin_layout Description
8874 \begin_inset Flex CharStyle:Code
8877 \begin_layout Plain Layout
8886 \begin_inset Flex CharStyle:Code
8889 \begin_layout Plain Layout
8900 \begin_inset Flex CharStyle:Code
8903 \begin_layout Plain Layout
8909 ] Whether the class-default should be printing on one or both sides of the
8911 Can be changed in the
8912 \begin_inset Flex CharStyle:MenuItem
8915 \begin_layout Plain Layout
8920 ocument\SpecialChar \menuseparator
8933 \begin_layout Description
8934 \begin_inset Flex CharStyle:Code
8937 \begin_layout Plain Layout
8943 This sequence defines a new paragraph style.
8944 If the style already exists, it will redefine some of its parameters instead.
8946 \begin_inset space ~
8950 \begin_inset CommandInset ref
8952 reference "sec:style"
8958 \begin_inset Quotes eld
8962 \begin_inset Flex CharStyle:Code
8965 \begin_layout Plain Layout
8972 \begin_inset Quotes erd
8978 \begin_layout Description
8979 \begin_inset Flex CharStyle:Code
8982 \begin_layout Plain Layout
8989 \begin_inset Flex CharStyle:Code
8992 \begin_layout Plain Layout
8998 ] The name of the command or environment to be used with
8999 \begin_inset Flex CharStyle:Code
9002 \begin_layout Plain Layout
9011 \begin_layout Description
9012 \begin_inset Flex CharStyle:Code
9015 \begin_layout Plain Layout
9022 \begin_inset Flex CharStyle:Code
9025 \begin_layout Plain Layout
9034 \begin_inset Flex CharStyle:Code
9037 \begin_layout Plain Layout
9043 ] Indicates what kind of markup is used to define the title of a document.
9045 \begin_inset Flex CharStyle:Code
9048 \begin_layout Plain Layout
9054 means that the macro with name
9055 \begin_inset Flex CharStyle:Code
9058 \begin_layout Plain Layout
9064 will be inserted after the last layout which has
9065 \begin_inset Quotes eld
9069 \begin_inset Flex CharStyle:Code
9072 \begin_layout Plain Layout
9079 \begin_inset Quotes erd
9084 \begin_inset Flex CharStyle:Code
9087 \begin_layout Plain Layout
9093 corresponds to the case where the block of paragraphs which have
9094 \begin_inset Quotes eld
9098 \begin_inset Flex CharStyle:Code
9101 \begin_layout Plain Layout
9108 \begin_inset Quotes erd
9111 should be enclosed into the
9112 \begin_inset Flex CharStyle:Code
9115 \begin_layout Plain Layout
9124 \begin_layout Description
9125 \begin_inset Flex CharStyle:Code
9128 \begin_layout Plain Layout
9137 \begin_layout Subsection
9138 \begin_inset Flex CharStyle:Code
9141 \begin_layout Plain Layout
9150 \begin_layout Standard
9151 \begin_inset CommandInset label
9153 name "sec:classoptions"
9158 \begin_inset Flex CharStyle:Code
9161 \begin_layout Plain Layout
9167 section can contain the following entries:
9170 \begin_layout Description
9171 \begin_inset Flex CharStyle:Code
9174 \begin_layout Plain Layout
9181 \begin_inset Flex CharStyle:Code
9184 \begin_layout Plain Layout
9190 ] The list of available font sizes for the document's main font, separated
9192 \begin_inset Quotes eld
9196 \begin_inset Flex CharStyle:Code
9199 \begin_layout Plain Layout
9206 \begin_inset Quotes erd
9212 \begin_layout Description
9213 \begin_inset Flex CharStyle:Code
9216 \begin_layout Plain Layout
9225 \begin_layout Description
9226 \begin_inset Flex CharStyle:Code
9229 \begin_layout Plain Layout
9236 \begin_inset Flex CharStyle:Code
9239 \begin_layout Plain Layout
9240 string="empty|plain|headings|fancy"
9245 ] The list of available page styles, separated by
9246 \begin_inset Quotes eld
9250 \begin_inset Flex CharStyle:Code
9253 \begin_layout Plain Layout
9260 \begin_inset Quotes erd
9266 \begin_layout Description
9267 \begin_inset Flex CharStyle:Code
9270 \begin_layout Plain Layout
9277 \begin_inset Flex CharStyle:Code
9280 \begin_layout Plain Layout
9286 ] Some document class options, separated by a comma, that will be added
9287 to the optional part of the
9288 \begin_inset Flex CharStyle:Code
9291 \begin_layout Plain Layout
9302 \begin_layout Standard
9304 \begin_inset Flex CharStyle:Code
9307 \begin_layout Plain Layout
9313 section must end with
9314 \begin_inset Quotes eld
9318 \begin_inset Flex CharStyle:Code
9321 \begin_layout Plain Layout
9328 \begin_inset Quotes erd
9334 \begin_layout Subsection
9338 \begin_layout Standard
9339 \begin_inset CommandInset label
9345 A paragraph style description looks like this:
9349 \begin_layout Plain Layout
9350 Note that this will either define a new layout or modify an existing one.
9358 \begin_layout LyX-Code
9365 \begin_layout LyX-Code
9369 \begin_layout LyX-Code
9373 \begin_layout Standard
9374 where the following commands are allowed:
9377 \begin_layout Description
9378 \begin_inset Flex CharStyle:Code
9381 \begin_layout Plain Layout
9388 \begin_inset Flex CharStyle:Code
9391 \begin_layout Plain Layout
9396 , left, right, center
9401 ] Paragraph alignment.
9404 \begin_layout Description
9405 \begin_inset Flex CharStyle:Code
9408 \begin_layout Plain Layout
9415 \begin_inset Flex CharStyle:Code
9418 \begin_layout Plain Layout
9423 , left, right, center
9428 ] A comma separated list of permitted alignments.
9429 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9431 For example a right-aligned or centered enumeration isn't possible.)
9434 \begin_layout Description
9435 \begin_inset Flex CharStyle:Code
9438 \begin_layout Plain Layout
9445 \begin_inset Flex CharStyle:Code
9448 \begin_layout Plain Layout
9458 \begin_layout Plain Layout
9459 Note that a `float' here is a real number, such as: 1.5.
9464 The vertical space with which the last of a chain of paragraphs with this
9465 layout is separated from the following paragraph.
9466 If the next paragraph has another layout, the separations are not simply
9467 added, but the maximum is taken.
9470 \begin_layout Description
9471 \begin_inset Flex CharStyle:Code
9474 \begin_layout Plain Layout
9481 \begin_inset Flex CharStyle:Code
9484 \begin_layout Plain Layout
9490 The category for this style.
9491 This is used to group related styles in the Layout combobox on the toolbar.
9492 Any string can be used, but you may want to use existing categories with
9497 \begin_layout Description
9498 \begin_inset Flex CharStyle:Code
9501 \begin_layout Plain Layout
9510 \begin_layout Description
9511 \begin_inset Flex CharStyle:Code
9514 \begin_layout Plain Layout
9521 \begin_inset CommandInset label
9523 name "des:CopyStyle"
9528 \begin_inset Flex CharStyle:Code
9531 \begin_layout Plain Layout
9537 Copies all the features of an existing style into the current one.
9541 \begin_layout Description
9542 \begin_inset Flex CharStyle:Code
9545 \begin_layout Plain Layout
9551 The name of a style whose preamble should be output
9556 This allows to ensure some ordering of the preamble snippets when macros
9557 definitions depend on one another.
9561 \begin_layout Plain Layout
9562 Note that, besides that functionality, there is no way to ensure any ordering
9564 The ordering that you see in a given version of LyX may change without
9565 warning in later versions.
9573 \begin_layout Description
9574 \begin_inset Flex CharStyle:Code
9577 \begin_layout Plain Layout
9584 \begin_inset Flex CharStyle:Code
9587 \begin_layout Plain Layout
9592 , Box, Filled_Box, Static
9597 ] The type of label that stands at the end of the paragraph (or sequence
9599 \begin_inset Flex CharStyle:Code
9602 \begin_layout Plain Layout
9609 \begin_inset Flex CharStyle:Code
9612 \begin_layout Plain Layout
9619 \begin_inset Flex CharStyle:Code
9622 \begin_layout Plain Layout
9629 \begin_inset Flex CharStyle:Code
9632 \begin_layout Plain Layout
9640 \begin_inset Flex CharStyle:Code
9643 \begin_layout Plain Layout
9650 \begin_inset Quotes eld
9654 \begin_inset Quotes erd
9658 \begin_inset Flex CharStyle:Code
9661 \begin_layout Plain Layout
9668 \begin_inset Flex CharStyle:Code
9671 \begin_layout Plain Layout
9672 \begin_inset space ~
9681 \begin_inset space ~
9684 black) square suitable for end of proof markers,
9685 \begin_inset Flex CharStyle:Code
9688 \begin_layout Plain Layout
9694 is an explicit text string.
9697 \begin_layout Description
9698 \begin_inset Flex CharStyle:Code
9701 \begin_layout Plain Layout
9708 \begin_inset Flex CharStyle:Code
9711 \begin_layout Plain Layout
9717 ] The string used for a label with a
9718 \begin_inset Flex CharStyle:Code
9721 \begin_layout Plain Layout
9728 \begin_inset Flex CharStyle:Code
9731 \begin_layout Plain Layout
9741 \begin_layout Description
9742 \begin_inset Flex CharStyle:Code
9745 \begin_layout Plain Layout
9752 \begin_inset Flex CharStyle:Code
9755 \begin_layout Plain Layout
9766 \begin_inset Flex CharStyle:Code
9769 \begin_layout Plain Layout
9778 \begin_layout Description
9779 \begin_inset Flex CharStyle:Code
9782 \begin_layout Plain Layout
9789 \begin_inset Flex CharStyle:Code
9792 \begin_layout Plain Layout
9802 ] With this parameter the
9803 \begin_inset Flex CharStyle:MenuItem
9806 \begin_layout Plain Layout
9813 \begin_inset Quotes eld
9816 Vertical space above
9817 \begin_inset Quotes erd
9821 \begin_inset Flex CharStyle:MenuItem
9824 \begin_layout Plain Layout
9829 dit\SpecialChar \menuseparator
9835 \begin_inset space ~
9843 dialog can be set when initializing a paragraph with this style.
9847 \begin_layout Plain Layout
9850 Note from Jean-Marc:
9852 I'm not sure that this setting has much use, and it should probably be
9853 removed in later versions.
9861 \begin_layout Description
9862 \begin_inset Flex CharStyle:Code
9865 \begin_layout Plain Layout
9871 The font used for both the text body
9877 \begin_inset space ~
9881 \begin_inset CommandInset ref
9883 reference "sec:fonts"
9888 Note that defining this font automatically defines the
9889 \begin_inset Flex CharStyle:Code
9892 \begin_layout Plain Layout
9899 So you should define this one first if you also want to define
9900 \begin_inset Flex CharStyle:Code
9903 \begin_layout Plain Layout
9912 \begin_layout Description
9913 \begin_inset Flex CharStyle:Code
9916 \begin_layout Plain Layout
9923 \begin_inset CommandInset label
9925 name "des:FreeSpacing"
9932 \begin_inset Flex CharStyle:Code
9935 \begin_layout Plain Layout
9946 \begin_inset Flex CharStyle:Code
9949 \begin_layout Plain Layout
9955 ] Usually LyX doesn't allow you to insert more than one space between words,
9956 since a space is considered as the separation between two words, not a
9957 character or symbol of its own.
9958 This is a very fine thing but sometimes annoying, for example, when typing
9959 program code or plain LaTeX code.
9961 \begin_inset Flex CharStyle:Code
9964 \begin_layout Plain Layout
9971 Note that LyX will create protected blanks for the additional blanks when
9972 in another mode than LaTeX-mode.
9975 \begin_layout Description
9976 \begin_inset Flex CharStyle:Code
9979 \begin_layout Plain Layout
9988 \begin_layout Description
9989 \begin_inset Flex CharStyle:Code
9992 \begin_layout Plain Layout
9999 \begin_inset Flex CharStyle:Code
10002 \begin_layout Plain Layout
10008 If 1, marks the layout as being part of a title block (see also the
10009 \begin_inset Flex CharStyle:Code
10012 \begin_layout Plain Layout
10019 \begin_inset Flex CharStyle:Code
10022 \begin_layout Plain Layout
10031 \begin_layout Description
10032 \begin_inset Flex CharStyle:Code
10035 \begin_layout Plain Layout
10042 \begin_inset Flex CharStyle:Code
10045 \begin_layout Plain Layout
10051 ] This provides extra space between paragraphs that have the same layout.
10052 If you put other layouts into an environment, each is separated with the
10054 \begin_inset Flex CharStyle:Code
10057 \begin_layout Plain Layout
10064 But the whole items of the environment are additionally separated with
10066 \begin_inset Flex CharStyle:Code
10069 \begin_layout Plain Layout
10076 Note that this is a
10081 \begin_layout Description
10082 \begin_inset Flex CharStyle:Code
10085 \begin_layout Plain Layout
10094 \begin_layout Description
10095 \begin_inset Flex CharStyle:Code
10098 \begin_layout Plain Layout
10105 \begin_inset CommandInset label
10107 name "des:KeepEmpty"
10114 \begin_inset Flex CharStyle:Code
10117 \begin_layout Plain Layout
10128 \begin_inset Flex CharStyle:Code
10131 \begin_layout Plain Layout
10137 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10138 lead to empty LaTeX output.
10139 There are some cases where this could be desirable however: in a letter
10140 template, the required fields can be provided as empty fields, so that
10141 people do not forget them; in some special classes, a layout can be used
10142 as some kind of break, which does not contain actual text.
10145 \begin_layout Description
10146 \begin_inset Flex CharStyle:Code
10149 \begin_layout Plain Layout
10155 [float=0] The vertical space between the label and the text body.
10156 Only used for labels that are above the text body (
10157 \begin_inset Flex CharStyle:Code
10160 \begin_layout Plain Layout
10167 \begin_inset Flex CharStyle:Code
10170 \begin_layout Plain Layout
10171 Centered_Top_Environment
10179 \begin_layout Description
10180 \begin_inset Flex CharStyle:Code
10183 \begin_layout Plain Layout
10190 \begin_inset Flex CharStyle:Code
10193 \begin_layout Plain Layout
10200 \begin_inset Newline newline
10203 The name of the counter for automatic numbering (see Section
10204 \begin_inset CommandInset ref
10206 reference "sec:counter"
10211 This must be given if
10212 \begin_inset Flex CharStyle:Code
10215 \begin_layout Plain Layout
10222 \begin_inset Flex CharStyle:Code
10225 \begin_layout Plain Layout
10234 \begin_layout Description
10235 \begin_inset Flex CharStyle:Code
10238 \begin_layout Plain Layout
10244 The font used for the label.
10246 \begin_inset space ~
10250 \begin_inset CommandInset ref
10252 reference "sec:fonts"
10259 \begin_layout Description
10260 \begin_inset Flex CharStyle:Code
10263 \begin_layout Plain Layout
10270 \begin_inset Flex CharStyle:Code
10273 \begin_layout Plain Layout
10279 ] The horizontal space between the label and the text body.
10280 Only used for labels that are not above the text body.
10283 \begin_layout Description
10284 \begin_inset Flex CharStyle:Code
10287 \begin_layout Plain Layout
10294 \begin_inset Flex CharStyle:Code
10297 \begin_layout Plain Layout
10303 ] The string used for a label with a
10304 \begin_inset Flex CharStyle:Code
10307 \begin_layout Plain Layout
10315 \begin_inset Flex CharStyle:Code
10318 \begin_layout Plain Layout
10324 is set, this string can be contain the special formatting commands described
10326 \begin_inset CommandInset ref
10328 reference "sec:counter"
10336 \begin_layout Plain Layout
10337 For the sake of backwards compatibility, the string
10338 \begin_inset Flex CharStyle:Code
10341 \begin_layout Plain Layout
10351 will be replaced by the expanded
10352 \begin_inset Flex CharStyle:Code
10355 \begin_layout Plain Layout
10362 \begin_inset Flex CharStyle:Code
10365 \begin_layout Plain Layout
10374 This feature is now obsolete and should be replaced by the mechanisms of
10376 \begin_inset CommandInset ref
10378 reference "sec:counter"
10390 \begin_layout Description
10391 \begin_inset Flex CharStyle:Code
10394 \begin_layout Plain Layout
10395 LabelStringAppendix
10401 \begin_inset Flex CharStyle:Code
10404 \begin_layout Plain Layout
10410 ] This is used inside the appendix instead of
10411 \begin_inset Flex CharStyle:Code
10414 \begin_layout Plain Layout
10422 \begin_inset Flex CharStyle:Code
10425 \begin_layout Plain Layout
10432 \begin_inset Flex CharStyle:Code
10435 \begin_layout Plain Layout
10436 LabelStringAppendix
10444 \begin_layout Description
10445 \begin_inset Flex CharStyle:Code
10448 \begin_layout Plain Layout
10455 \begin_inset Flex CharStyle:Code
10458 \begin_layout Plain Layout
10463 , Manual, Static, Top_Environment,
10464 \begin_inset Newline newline
10467 Centered_Top_Environment, Sensitive, Counter
10473 \begin_inset Newline newline
10477 \begin_inset Flex CharStyle:Code
10480 \begin_layout Plain Layout
10486 means the label is the very first word (up to the first real blank).
10490 \begin_layout Plain Layout
10491 Use protected spaces if you want more than one word as the label.
10497 \begin_inset Flex CharStyle:Code
10500 \begin_layout Plain Layout
10506 means it is defined in the layout (see
10507 \begin_inset Flex CharStyle:Code
10510 \begin_layout Plain Layout
10518 \begin_inset Flex CharStyle:Code
10521 \begin_layout Plain Layout
10528 \begin_inset Flex CharStyle:Code
10531 \begin_layout Plain Layout
10532 Centered_Top_Environment
10537 are special cases of
10538 \begin_inset Flex CharStyle:Code
10541 \begin_layout Plain Layout
10548 The label will be printed above the paragraph, but only at the top of an
10549 environment or the top of a chain of paragraphs with this layout.
10550 Usage is for example the
10551 \begin_inset Flex CharStyle:MenuItem
10554 \begin_layout Plain Layout
10561 \begin_inset Flex CharStyle:MenuItem
10564 \begin_layout Plain Layout
10571 This is also the case for
10572 \begin_inset Flex CharStyle:Code
10575 \begin_layout Plain Layout
10581 labels with latex type
10582 \begin_inset Flex CharStyle:Code
10585 \begin_layout Plain Layout
10591 , in order to make layouts for theorems work correctly.
10593 \begin_inset Flex CharStyle:Code
10596 \begin_layout Plain Layout
10602 is a special case for the caption-labels
10603 \begin_inset Quotes eld
10607 \begin_inset Quotes erd
10611 \begin_inset Quotes eld
10615 \begin_inset Quotes erd
10620 \begin_inset Flex CharStyle:Code
10623 \begin_layout Plain Layout
10629 means the (hardcoded) label string depends on the kind of float.
10631 \begin_inset Flex CharStyle:Code
10634 \begin_layout Plain Layout
10640 label type defines automatically numbered labels.
10642 \begin_inset CommandInset ref
10644 reference "sec:counter"
10651 \begin_layout Description
10652 \begin_inset Flex CharStyle:Code
10655 \begin_layout Plain Layout
10664 \begin_layout Description
10665 \begin_inset Flex CharStyle:Code
10668 \begin_layout Plain Layout
10677 \begin_layout Description
10678 \begin_inset Flex CharStyle:Code
10681 \begin_layout Plain Layout
10688 \begin_inset CommandInset label
10690 name "des:LatexName"
10694 The name of the corresponding LaTeX stuff.
10695 Either the environment or command name.
10698 \begin_layout Description
10699 \begin_inset Flex CharStyle:Code
10702 \begin_layout Plain Layout
10711 \begin_layout Description
10712 \begin_inset Flex CharStyle:Code
10715 \begin_layout Plain Layout
10722 \begin_inset CommandInset label
10724 name "des:LatexParam"
10728 An optional parameter for the corresponding
10729 \begin_inset Flex CharStyle:Code
10732 \begin_layout Plain Layout
10739 This parameter cannot be changed from within LyX.
10742 \begin_layout Description
10743 \begin_inset Flex CharStyle:Code
10746 \begin_layout Plain Layout
10753 \begin_inset CommandInset label
10755 name "des:LatexType"
10760 \begin_inset Flex CharStyle:Code
10763 \begin_layout Plain Layout
10768 , Command, Environment, Item_Environment,
10774 \begin_inset Flex CharStyle:Code
10777 \begin_layout Plain Layout
10783 ] How the layout should be translated into LaTeX.
10785 \begin_inset Flex CharStyle:Code
10788 \begin_layout Plain Layout
10794 means nothing special.
10796 \begin_inset Flex CharStyle:Code
10799 \begin_layout Plain Layout
10806 \begin_inset Flex CharStyle:Code
10809 \begin_layout Plain Layout
10816 {\SpecialChar \ldots{}
10823 \begin_inset Flex CharStyle:Code
10826 \begin_layout Plain Layout
10833 \begin_inset Flex CharStyle:Code
10836 \begin_layout Plain Layout
10843 }\SpecialChar \ldots{}
10857 \begin_inset Flex CharStyle:Code
10860 \begin_layout Plain Layout
10867 \begin_inset Flex CharStyle:Code
10870 \begin_layout Plain Layout
10877 \begin_inset Flex CharStyle:Code
10880 \begin_layout Plain Layout
10888 is generated for each paragraph of this environment.
10890 \begin_inset Flex CharStyle:Code
10893 \begin_layout Plain Layout
10900 \begin_inset Flex CharStyle:Code
10903 \begin_layout Plain Layout
10910 \begin_inset Flex CharStyle:Code
10913 \begin_layout Plain Layout
10919 is passed as an argument to the environment.
10921 \begin_inset Flex CharStyle:Code
10924 \begin_layout Plain Layout
10930 can be defined in the
10931 \begin_inset Flex CharStyle:MenuItem
10934 \begin_layout Plain Layout
10939 ayout\SpecialChar \menuseparator
10951 \begin_inset Flex CharStyle:Code
10954 \begin_layout Plain Layout
10962 is perhaps a bit misleading, since these rules apply to SGML classes, too.
10963 Visit the SGML class files for specific examples.
10966 \begin_layout Standard
10967 Putting the last few things together, the LaTeX output will be either:
10970 \begin_layout LyX-Code
10973 latexname[latexparam]{\SpecialChar \ldots{}
10977 \begin_layout Standard
10981 \begin_layout LyX-Code
10984 begin{latexname}[latexparam] \SpecialChar \ldots{}
10990 \begin_layout Standard
10991 depending upon the LaTex type.
10994 \begin_layout Description
10995 \begin_inset Flex CharStyle:Code
10998 \begin_layout Plain Layout
11005 \begin_inset Flex CharStyle:Code
11008 \begin_layout Plain Layout
11014 ] If you put layouts into environments, the leftmargins are not simply added,
11015 but added with a factor
11016 \begin_inset Formula $\frac{4}{depth+4}$
11020 Note that this parameter is also used when the margin is defined as
11021 \begin_inset Flex CharStyle:Code
11024 \begin_layout Plain Layout
11031 \begin_inset Flex CharStyle:Code
11034 \begin_layout Plain Layout
11041 Then it is added to the manual or dynamic margin.
11043 \begin_inset Newline newline
11046 The argument is passed as a string.
11048 \begin_inset Quotes eld
11052 \begin_inset Flex CharStyle:Code
11055 \begin_layout Plain Layout
11062 \begin_inset Quotes erd
11065 means that the paragraph is indented with the width of
11066 \begin_inset Quotes eld
11070 \begin_inset Flex CharStyle:Code
11073 \begin_layout Plain Layout
11080 \begin_inset Quotes erd
11083 in the normal font.
11084 You can get a negative width by prefixing the string with
11085 \begin_inset Quotes eld
11089 \begin_inset Flex CharStyle:Code
11092 \begin_layout Plain Layout
11099 \begin_inset Quotes erd
11103 This way was chosen so that the look is the same with each used screen
11108 \begin_layout Description
11109 \begin_inset Flex CharStyle:Code
11112 \begin_layout Plain Layout
11119 \begin_inset Flex CharStyle:Code
11122 \begin_layout Plain Layout
11127 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11133 \begin_inset Newline newline
11136 The kind of margin that the layout has on the left side.
11138 \begin_inset Flex CharStyle:Code
11141 \begin_layout Plain Layout
11147 just means a fixed margin.
11149 \begin_inset Flex CharStyle:Code
11152 \begin_layout Plain Layout
11158 means that the left margin depends on the string entered in the
11159 \begin_inset Flex CharStyle:MenuItem
11162 \begin_layout Plain Layout
11167 dit\SpecialChar \menuseparator
11173 \begin_inset space ~
11182 This is used to typeset nice lists without tabulators.
11184 \begin_inset Flex CharStyle:Code
11187 \begin_layout Plain Layout
11193 means that the margin depends on the size of the label.
11194 This is used for automatic enumerated headlines.
11195 It is obvious that the headline
11196 \begin_inset Quotes eld
11199 5.4.3.2.1 Very long headline
11200 \begin_inset Quotes erd
11203 must have a wider left margin (as wide as
11204 \begin_inset Quotes eld
11208 \begin_inset Quotes erd
11211 plus the space) than
11212 \begin_inset Quotes eld
11215 3.2 Very long headline
11216 \begin_inset Quotes erd
11220 \begin_inset Quotes eld
11224 \begin_inset Quotes erd
11227 are not able to do this.
11229 \begin_inset Flex CharStyle:Code
11232 \begin_layout Plain Layout
11238 is similar, but only the very first row of the paragraph is dynamic, while
11239 the others are static; this is used, for example, for descriptions.
11241 \begin_inset Flex CharStyle:Code
11244 \begin_layout Plain Layout
11250 means the margin is chosen in a way that the longest row of this paragraph
11251 fits to the right margin.
11252 This is used to typeset an address on the right edge of the page.
11255 \begin_layout Description
11256 \begin_inset Flex CharStyle:Code
11259 \begin_layout Plain Layout
11266 \begin_inset CommandInset label
11268 name "des:NeedProtect"
11273 \begin_inset Flex CharStyle:Code
11276 \begin_layout Plain Layout
11285 \begin_inset Flex CharStyle:Code
11288 \begin_layout Plain Layout
11294 ] Whether fragile commands in this layout should be
11295 \begin_inset Flex CharStyle:Code
11298 \begin_layout Plain Layout
11309 \begin_layout Description
11310 \begin_inset Flex CharStyle:Code
11313 \begin_layout Plain Layout
11320 \begin_inset Flex CharStyle:Code
11323 \begin_layout Plain Layout
11330 \begin_inset Flex CharStyle:Code
11333 \begin_layout Plain Layout
11341 ] Whether newlines are translated into LaTeX newlines (
11342 \begin_inset Flex CharStyle:Code
11345 \begin_layout Plain Layout
11356 The translation can be switched off to allow more comfortable LaTeX editing
11360 \begin_layout Description
11361 \begin_inset Flex CharStyle:Code
11364 \begin_layout Plain Layout
11371 \begin_inset Flex CharStyle:Code
11374 \begin_layout Plain Layout
11381 \begin_inset Flex CharStyle:Code
11384 \begin_layout Plain Layout
11392 ] Whether the following Paragraph is allowed to indent its very first row.
11394 \begin_inset Flex CharStyle:Code
11397 \begin_layout Plain Layout
11403 means that it is not allowed to do so;
11404 \begin_inset Flex CharStyle:Code
11407 \begin_layout Plain Layout
11413 means it could do so if it wants to.
11416 \begin_layout Description
11417 \begin_inset Flex CharStyle:Code
11420 \begin_layout Plain Layout
11429 \begin_layout Description
11430 \begin_inset Flex CharStyle:Code
11433 \begin_layout Plain Layout
11440 \begin_inset Flex CharStyle:Code
11443 \begin_layout Plain Layout
11449 ] The number of optional arguments that can be used with this layout.
11450 This is useful for things like section headings, and only makes sense with
11454 \begin_layout Description
11455 \begin_inset Flex CharStyle:Code
11458 \begin_layout Plain Layout
11465 \begin_inset Flex CharStyle:Code
11468 \begin_layout Plain Layout
11474 ] The indent of the very first line of a paragraph.
11476 \begin_inset Flex CharStyle:Code
11479 \begin_layout Plain Layout
11485 will be fixed for a certain layout.
11486 The exception is Standard layout, since the indentation of a Standard layout
11487 paragraph can be prohibited with
11488 \begin_inset Flex CharStyle:Code
11491 \begin_layout Plain Layout
11498 Also, Standard layout paragraphs inside environments use the
11499 \begin_inset Flex CharStyle:Code
11502 \begin_layout Plain Layout
11508 of the environment, not their native one.
11509 For example, Standard paragraphs inside an enumeration are not indented.
11512 \begin_layout Description
11513 \begin_inset Flex CharStyle:Code
11516 \begin_layout Plain Layout
11523 \begin_inset Flex CharStyle:Code
11526 \begin_layout Plain Layout
11532 ] The vertical space between two paragraphs of this layout.
11535 \begin_layout Description
11536 \begin_inset Flex CharStyle:Code
11539 \begin_layout Plain Layout
11546 \begin_inset Flex CharStyle:Code
11549 \begin_layout Plain Layout
11555 ] LyX allows the user to choose either
11556 \begin_inset Quotes eld
11560 \begin_inset Quotes erd
11564 \begin_inset Quotes eld
11568 \begin_inset Quotes erd
11571 to typeset a document.
11573 \begin_inset Quotes eld
11577 \begin_inset Quotes erd
11580 is chosen, this value is completely ignored.
11582 \begin_inset Quotes eld
11586 \begin_inset Quotes erd
11589 is chosen, the parindent of a LaTeXtype
11590 \begin_inset Quotes eld
11594 \begin_inset Quotes erd
11597 layout is ignored and all paragraphs are separated by this parskip argument.
11598 The vertical space is calculated with
11599 \begin_inset Flex CharStyle:Code
11602 \begin_layout Plain Layout
11604 \begin_inset space ~
11613 \begin_inset Flex CharStyle:Code
11616 \begin_layout Plain Layout
11622 is the height of a row with the normal font.
11623 This way, the look stays the same with different screen fonts.
11626 \begin_layout Description
11627 \begin_inset Flex CharStyle:Code
11630 \begin_layout Plain Layout
11637 \begin_inset CommandInset label
11639 name "des:PassThru"
11646 \begin_inset Flex CharStyle:Code
11649 \begin_layout Plain Layout
11660 \begin_inset Flex CharStyle:Code
11663 \begin_layout Plain Layout
11669 ] Whether the contents of this paragraph should be output in raw form, meaning
11670 without special translations that LaTeX would require.
11673 \begin_layout Description
11674 \begin_inset Flex CharStyle:Code
11677 \begin_layout Plain Layout
11684 \begin_inset CommandInset label
11686 name "des:Preamble"
11690 Information to be included in the LaTeX preamable when this style is used.
11691 Used to define macros, load packages, etc., required by this particular
11694 \begin_inset Quotes eld
11698 \begin_inset Flex CharStyle:Code
11701 \begin_layout Plain Layout
11708 \begin_inset Quotes erd
11714 \begin_layout Description
11715 \begin_inset Flex CharStyle:Code
11718 \begin_layout Plain Layout
11725 \begin_inset Flex CharStyle:Code
11728 \begin_layout Plain Layout
11735 \begin_inset CommandInset label
11737 name "des:Requires"
11741 Whether the layout requires the feature
11742 \begin_inset Flex CharStyle:Code
11745 \begin_layout Plain Layout
11752 See the description of
11753 \begin_inset Flex CharStyle:Code
11756 \begin_layout Plain Layout
11763 \begin_inset CommandInset ref
11764 LatexCommand pageref
11765 reference "des:FreeSpacing"
11769 ) for information on `features'.
11773 \begin_layout Description
11774 \begin_inset Flex CharStyle:Code
11777 \begin_layout Plain Layout
11784 \begin_inset Flex CharStyle:Code
11787 \begin_layout Plain Layout
11794 \begin_inset Flex CharStyle:Code
11797 \begin_layout Plain Layout
11806 \begin_layout Description
11807 \begin_inset Flex CharStyle:Code
11810 \begin_layout Plain Layout
11817 \begin_inset Flex CharStyle:Code
11820 \begin_layout Plain Layout
11825 , onehalf, double, other
11834 ] This defines what the default spacing should be in the layout.
11836 \begin_inset Flex CharStyle:Code
11839 \begin_layout Plain Layout
11846 \begin_inset Flex CharStyle:Code
11849 \begin_layout Plain Layout
11856 \begin_inset Flex CharStyle:Code
11859 \begin_layout Plain Layout
11865 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
11866 If you specify the argument
11867 \begin_inset Flex CharStyle:Code
11870 \begin_layout Plain Layout
11876 , then you should also provide a numerical argument which will be the actual
11878 Note that, contrary to other parameters,
11879 \begin_inset Flex CharStyle:Code
11882 \begin_layout Plain Layout
11888 implies the generation of specific LaTeX code, using the package
11891 \begin_inset Flex CharStyle:Code
11894 \begin_layout Plain Layout
11903 \begin_layout Description
11904 \begin_inset Flex CharStyle:Code
11907 \begin_layout Plain Layout
11913 The font used for the text body .
11915 \begin_inset CommandInset ref
11917 reference "sec:fonts"
11924 \begin_layout Description
11925 \begin_inset Flex CharStyle:Code
11928 \begin_layout Plain Layout
11936 The level of the style in the table of contents.
11937 This is used for automatic numbering of section headings.
11940 \begin_layout Description
11941 \begin_inset Flex CharStyle:Code
11944 \begin_layout Plain Layout
11951 \begin_inset Flex CharStyle:Code
11954 \begin_layout Plain Layout
11960 ] The vertical space with which the very first of a chain of paragraphs
11961 with this layout is separated from the previous paragraph.
11962 If the previous paragraph has another layout, the separations are not simply
11963 added, but the maximum is taken.
11966 \begin_layout Subsection
11970 \begin_layout Standard
11971 \begin_inset CommandInset label
11977 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11978 define the floats (
11979 \begin_inset Flex CharStyle:MenuItem
11982 \begin_layout Plain Layout
11989 \begin_inset Flex CharStyle:MenuItem
11992 \begin_layout Plain Layout
11998 , \SpecialChar \ldots{}
11999 ) in the text class itself.
12000 Standard floats are included in the file
12001 \begin_inset Flex CharStyle:Code
12004 \begin_layout Plain Layout
12010 , so you may have to do no more than add
12013 \begin_layout LyX-Code
12014 Input stdfloats.inc
12017 \begin_layout Standard
12018 to your layout file.
12019 If you want to implement a text class that proposes some other float types
12020 (like the AGU class bundled with LyX), the information below will hopefully
12024 \begin_layout Description
12025 \begin_inset Flex CharStyle:Code
12028 \begin_layout Plain Layout
12035 \begin_inset Flex CharStyle:Code
12038 \begin_layout Plain Layout
12045 \begin_inset Quotes erd
12049 \begin_inset Quotes erd
12052 ] The file name extension of an auxiliary file for the list of figures (or
12054 LaTeX writes the captions to this file.
12057 \begin_layout Description
12058 \begin_inset Flex CharStyle:Code
12061 \begin_layout Plain Layout
12068 \begin_inset Flex CharStyle:Code
12071 \begin_layout Plain Layout
12078 \begin_inset Quotes erd
12082 \begin_inset Quotes erd
12085 ] The string that will be used in the menus and also for the caption.
12088 \begin_layout Description
12089 \begin_inset Flex CharStyle:Code
12092 \begin_layout Plain Layout
12099 \begin_inset Flex CharStyle:Code
12102 \begin_layout Plain Layout
12111 \begin_inset Flex CharStyle:Code
12114 \begin_layout Plain Layout
12121 \begin_inset Flex CharStyle:Code
12124 \begin_layout Plain Layout
12130 if the float is already defined by the LaTeX document class.
12132 \begin_inset Flex CharStyle:Code
12135 \begin_layout Plain Layout
12141 , the float will be defined using the LaTeX package
12142 \begin_inset Flex CharStyle:Code
12145 \begin_layout Plain Layout
12154 \begin_layout Description
12155 \begin_inset Flex CharStyle:Code
12158 \begin_layout Plain Layout
12165 \begin_inset Flex CharStyle:Code
12168 \begin_layout Plain Layout
12175 \begin_inset Quotes erd
12179 \begin_inset Quotes erd
12182 ] The heading used for the list of floats.
12185 \begin_layout Description
12186 \begin_inset Flex CharStyle:Code
12189 \begin_layout Plain Layout
12196 \begin_inset Flex CharStyle:Code
12199 \begin_layout Plain Layout
12206 \begin_inset Quotes erd
12210 \begin_inset Quotes erd
12213 ] This (optional) argument determines whether floats of this class will
12214 be numbered within some sectional unit of the document.
12215 For example, if within is equal to
12216 \begin_inset Flex CharStyle:Code
12219 \begin_layout Plain Layout
12225 , the floats will be numbered within chapters.
12229 \begin_layout Description
12230 \begin_inset Flex CharStyle:Code
12233 \begin_layout Plain Layout
12240 \begin_inset Flex CharStyle:Code
12243 \begin_layout Plain Layout
12250 \begin_inset Quotes erd
12254 \begin_inset Quotes erd
12257 ] The default placement for the given class of floats.
12258 The string should be as in standard LaTeX:
12259 \begin_inset Flex CharStyle:Code
12262 \begin_layout Plain Layout
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 Flex CharStyle:Code
12292 \begin_layout Plain Layout
12298 for top, bottom, page, and here, respectively.
12302 \begin_layout Plain Layout
12303 Note that the order of these letters in the string is irrelevant, like in
12309 On top of that there is a new type,
12310 \begin_inset Flex CharStyle:Code
12313 \begin_layout Plain Layout
12319 , which does not really correspond to a float, since it means: put it
12320 \begin_inset Quotes eld
12324 \begin_inset Quotes erd
12328 Note however that the
12329 \begin_inset Flex CharStyle:Code
12332 \begin_layout Plain Layout
12338 specifier is special and, because of implementation details, cannot be
12339 used in non-builtin float types.
12340 If you do not understand what this means, just use
12341 \begin_inset Quotes eld
12345 \begin_inset Flex CharStyle:Code
12348 \begin_layout Plain Layout
12355 \begin_inset Quotes erd
12361 \begin_layout Description
12362 \begin_inset Flex CharStyle:Code
12365 \begin_layout Plain Layout
12372 \begin_inset Flex CharStyle:Code
12375 \begin_layout Plain Layout
12382 \begin_inset Quotes erd
12386 \begin_inset Quotes erd
12389 ] The style used when defining the float using
12390 \begin_inset Flex CharStyle:Code
12393 \begin_layout Plain Layout
12404 \begin_layout Description
12405 \begin_inset Flex CharStyle:Code
12408 \begin_layout Plain Layout
12415 \begin_inset Flex CharStyle:Code
12418 \begin_layout Plain Layout
12425 \begin_inset Quotes erd
12429 \begin_inset Quotes erd
12433 \begin_inset Quotes eld
12437 \begin_inset Quotes erd
12440 of the new class of floats, like program or algorithm.
12441 After the appropriate
12442 \begin_inset Flex CharStyle:Code
12445 \begin_layout Plain Layout
12454 \begin_inset Flex CharStyle:Code
12457 \begin_layout Plain Layout
12466 \begin_inset Flex CharStyle:Code
12469 \begin_layout Plain Layout
12480 \begin_layout Standard
12481 Note that defining a float with type
12482 \begin_inset Flex CharStyle:Code
12485 \begin_layout Plain Layout
12493 automatically defines the corresponding counter with name
12494 \begin_inset Flex CharStyle:Code
12497 \begin_layout Plain Layout
12508 \begin_layout Subsection
12509 Inset layouts and Flex insets
12512 \begin_layout Standard
12513 \begin_inset CommandInset label
12515 name "sec:charstyle"
12519 LyX has supported character styles since version 1.4.0; since version 1.6.0
12520 these are called Flex insets.
12524 \begin_layout Standard
12525 Furthermore, it is possible to define the general layout of many different
12527 Currently, InsetLayout can be used to customize the layout parameters
12528 for footnotes, marginal notes, note insets, ERT insets, branches, listings,
12529 indexes, boxes, tables, algorithms, URLs, and optional arguments, as well
12534 \begin_layout Standard
12535 Flex insets come in three different kinds:
12538 \begin_layout Itemize
12540 \begin_inset Flex CharStyle:Code
12543 \begin_layout Plain Layout
12549 ): These define semantic markup corresponding to such LaTeX commands as
12551 \begin_inset Flex CharStyle:Code
12554 \begin_layout Plain Layout
12563 \begin_inset Flex CharStyle:Code
12566 \begin_layout Plain Layout
12577 \begin_layout Itemize
12579 \begin_inset Flex CharStyle:Code
12582 \begin_layout Plain Layout
12588 ): These can be used to define custom collapsable insets, similar to ERT,
12589 footnote, and the like.
12592 \begin_layout Itemize
12594 \begin_inset Flex CharStyle:Code
12597 \begin_layout Plain Layout
12603 ): For use with DocBook classes.
12606 \begin_layout Standard
12608 \begin_inset Flex CharStyle:Code
12611 \begin_layout Plain Layout
12617 definition starting line is of the form
12620 \begin_layout LyX-Code
12621 InsetLayout <Type> <Name>
12624 \begin_layout Standard
12626 \begin_inset Flex CharStyle:Code
12629 \begin_layout Plain Layout
12636 \begin_inset Flex CharStyle:Code
12639 \begin_layout Plain Layout
12646 \begin_inset Flex CharStyle:Code
12649 \begin_layout Plain Layout
12656 \begin_inset Flex CharStyle:Code
12659 \begin_layout Plain Layout
12666 \begin_inset Flex CharStyle:Code
12669 \begin_layout Plain Layout
12676 \begin_inset Flex CharStyle:Code
12679 \begin_layout Plain Layout
12686 \begin_inset Flex CharStyle:Code
12689 \begin_layout Plain Layout
12696 \begin_inset Flex CharStyle:Code
12699 \begin_layout Plain Layout
12706 \begin_inset Flex CharStyle:Code
12709 \begin_layout Plain Layout
12716 \begin_inset Flex CharStyle:Code
12719 \begin_layout Plain Layout
12726 \begin_inset Flex CharStyle:Code
12729 \begin_layout Plain Layout
12736 \begin_inset Flex CharStyle:Code
12739 \begin_layout Plain Layout
12746 \begin_inset Flex CharStyle:Code
12749 \begin_layout Plain Layout
12756 \begin_inset Flex CharStyle:Code
12759 \begin_layout Plain Layout
12766 \begin_inset Flex CharStyle:Code
12769 \begin_layout Plain Layout
12776 \begin_inset Flex CharStyle:Code
12779 \begin_layout Plain Layout
12786 \begin_inset Flex CharStyle:Code
12789 \begin_layout Plain Layout
12797 \begin_inset Flex CharStyle:Code
12800 \begin_layout Plain Layout
12807 \begin_inset Flex CharStyle:Code
12810 \begin_layout Plain Layout
12817 \begin_inset Flex CharStyle:Code
12820 \begin_layout Plain Layout
12826 should have the form
12827 \begin_inset Flex CharStyle:Code
12830 \begin_layout Plain Layout
12837 \begin_inset Flex CharStyle:Code
12840 \begin_layout Plain Layout
12847 \begin_inset Flex CharStyle:Code
12850 \begin_layout Plain Layout
12857 \begin_inset Flex CharStyle:Code
12860 \begin_layout Plain Layout
12867 \begin_inset Flex CharStyle:Code
12870 \begin_layout Plain Layout
12877 \begin_inset Flex CharStyle:Code
12880 \begin_layout Plain Layout
12886 is any valid identifier.
12890 \begin_layout Standard
12892 \begin_inset Flex CharStyle:Code
12895 \begin_layout Plain Layout
12901 section can contain the following entries:
12904 \begin_layout Description
12905 \begin_inset Flex CharStyle:Code
12908 \begin_layout Plain Layout
12914 The color for the inset's background.
12915 These valid colors are defined in
12916 \begin_inset Flex CharStyle:Code
12919 \begin_layout Plain Layout
12928 \begin_layout Description
12929 \begin_inset Flex CharStyle:Code
12932 \begin_layout Plain Layout
12938 As with paragraph styles (see page
12939 \begin_inset CommandInset ref
12941 reference "des:CopyStyle"
12948 \begin_layout Description
12949 \begin_inset Flex CharStyle:Code
12952 \begin_layout Plain Layout
12959 \begin_inset Flex CharStyle:Code
12962 \begin_layout Plain Layout
12969 \begin_inset Flex CharStyle:Code
12972 \begin_layout Plain Layout
12979 \begin_inset Flex CharStyle:Code
12982 \begin_layout Plain Layout
12988 , describing the rendering style used for the inset's frame and buttons.
12989 Footnotes generally use
12990 \begin_inset Flex CharStyle:Code
12993 \begin_layout Plain Layout
12999 ; ERT insets generally use
13000 \begin_inset Flex CharStyle:Code
13003 \begin_layout Plain Layout
13009 ; and character styles use
13010 \begin_inset Flex CharStyle:Code
13013 \begin_layout Plain Layout
13022 \begin_layout Description
13023 \begin_inset Flex CharStyle:Code
13026 \begin_layout Plain Layout
13032 The font used for both the text body
13038 \begin_inset space ~
13042 \begin_inset CommandInset ref
13044 reference "sec:fonts"
13049 Note that defining this font automatically defines the
13050 \begin_inset Flex CharStyle:Code
13053 \begin_layout Plain Layout
13059 to the same value, so define this first and define
13060 \begin_inset Flex CharStyle:Code
13063 \begin_layout Plain Layout
13069 later if you want them to be different.
13072 \begin_layout Description
13073 \begin_inset Flex CharStyle:Code
13076 \begin_layout Plain Layout
13085 \begin_layout Description
13086 \begin_inset Flex CharStyle:Code
13089 \begin_layout Plain Layout
13095 As with paragraph styles (see page
13096 \begin_inset CommandInset ref
13097 LatexCommand pageref
13098 reference "des:FreeSpacing"
13105 \begin_layout Description
13106 \begin_inset Flex CharStyle:Code
13109 \begin_layout Plain Layout
13115 As with paragraph styles (see page
13116 \begin_inset CommandInset ref
13117 LatexCommand pageref
13118 reference "des:KeepEmpty"
13125 \begin_layout Description
13126 \begin_inset Flex CharStyle:Code
13129 \begin_layout Plain Layout
13135 What will be displayed on the button or elsewhere as the inset label.
13136 Some inset types (ERT and Branch) modify this label on the fly.
13139 \begin_layout Description
13140 \begin_inset Flex CharStyle:Code
13143 \begin_layout Plain Layout
13149 The font used for the label.
13151 \begin_inset space ~
13155 \begin_inset CommandInset ref
13157 reference "sec:fonts"
13162 Note that this definition can never appear before
13163 \begin_inset Flex CharStyle:Code
13166 \begin_layout Plain Layout
13172 , lest it be ineffective.
13175 \begin_layout Description
13176 \begin_inset Flex CharStyle:Code
13179 \begin_layout Plain Layout
13185 The name of the corresponding LaTeX stuff.
13186 Either the environment or command name.
13189 \begin_layout Description
13190 \begin_inset Flex CharStyle:Code
13193 \begin_layout Plain Layout
13199 The optional parameter for the corresponding
13200 \begin_inset Flex CharStyle:Code
13203 \begin_layout Plain Layout
13209 stuff, including possible bracket pairs like
13210 \begin_inset Flex CharStyle:Code
13213 \begin_layout Plain Layout
13220 This parameter cannot be changed from within LyX.
13223 \begin_layout Description
13224 \begin_inset Flex CharStyle:Code
13227 \begin_layout Plain Layout
13233 As with paragraph styles (see page
13234 \begin_inset CommandInset ref
13235 LatexCommand pageref
13236 reference "des:LatexType"
13243 \begin_layout Description
13244 \begin_inset Flex CharStyle:Code
13247 \begin_layout Plain Layout
13254 \begin_inset Flex CharStyle:Code
13257 \begin_layout Plain Layout
13264 \begin_inset Flex CharStyle:Code
13267 \begin_layout Plain Layout
13274 \begin_inset Flex CharStyle:Code
13277 \begin_layout Plain Layout
13284 \begin_inset Flex CharStyle:Code
13287 \begin_layout Plain Layout
13293 (indicating a dummy definition ending definitions of charstyles etc.).
13294 This entry is only meaningful for Flex (user definable) insets.
13297 \begin_layout Description
13298 \begin_inset Flex CharStyle:Code
13301 \begin_layout Plain Layout
13307 As with paragraph styles (see page
13308 \begin_inset CommandInset ref
13309 LatexCommand pageref
13310 reference "des:Preamble"
13317 \begin_layout Description
13318 \begin_inset Flex CharStyle:Code
13321 \begin_layout Plain Layout
13328 \begin_inset Flex CharStyle:Code
13331 \begin_layout Plain Layout
13337 ] As with paragraph styles (see page
13338 \begin_inset CommandInset ref
13339 LatexCommand pageref
13340 reference "des:Requires"
13347 \begin_layout Subsection
13351 \begin_layout Standard
13352 \begin_inset CommandInset label
13358 Since version 1.3.0 of LyX, it is both possible and necessary to define the
13360 \begin_inset Flex CharStyle:MenuItem
13363 \begin_layout Plain Layout
13370 \begin_inset Flex CharStyle:MenuItem
13373 \begin_layout Plain Layout
13379 , \SpecialChar \ldots{}
13380 ) in the text class itself.
13381 The standard counters are defined in the file
13382 \begin_inset Flex CharStyle:Code
13385 \begin_layout Plain Layout
13391 , so you may have to do no more than add
13394 \begin_layout LyX-Code
13395 Input stdcounters.inc
13398 \begin_layout Standard
13399 to your layout file to get them to work.
13400 But if you want to define custom counters, then you can do so, using the
13401 following parameters:
13404 \begin_layout Description
13405 \begin_inset Flex CharStyle:Code
13408 \begin_layout Plain Layout
13409 LabelString [string=""]
13414 when this is defined, this string defines how the counter is displayed.
13415 Setting this value sets
13416 \begin_inset Flex CharStyle:Code
13419 \begin_layout Plain Layout
13420 LabelStringAppendix
13426 The following special constructs can be used in the string:
13430 \begin_layout Itemize
13431 \begin_inset Flex CharStyle:Code
13434 \begin_layout Plain Layout
13442 will be replaced by the expansion of the
13443 \begin_inset Flex CharStyle:Code
13446 \begin_layout Plain Layout
13453 \begin_inset Flex CharStyle:Code
13456 \begin_layout Plain Layout
13457 LabelStringAppendix
13463 \begin_inset Flex CharStyle:Code
13466 \begin_layout Plain Layout
13476 \begin_layout Itemize
13477 counter values can be expressed using LaTeX-like macros
13478 \begin_inset Flex CharStyle:Code
13481 \begin_layout Plain Layout
13498 \begin_inset Flex CharStyle:Code
13501 \begin_layout Plain Layout
13513 \begin_layout Plain Layout
13523 Actually, the situation is a bit more complicated: any
13542 other than those descibed below will produce arabic numerals.
13543 It would not be surprising to see this change in the future.
13549 \begin_inset Flex CharStyle:Code
13552 \begin_layout Plain Layout
13558 : 1, 2, 3,\SpecialChar \ldots{}
13560 \begin_inset Flex CharStyle:Code
13563 \begin_layout Plain Layout
13569 for lower-case letters: a, b, c, \SpecialChar \ldots{}
13571 \begin_inset Flex CharStyle:Code
13574 \begin_layout Plain Layout
13580 for upper-case letters: A, B, C, \SpecialChar \ldots{}
13582 \begin_inset Flex CharStyle:Code
13585 \begin_layout Plain Layout
13591 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13593 \begin_inset Flex CharStyle:Code
13596 \begin_layout Plain Layout
13602 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13604 \begin_inset Flex CharStyle:Code
13607 \begin_layout Plain Layout
13613 for hebrew numerals.
13617 \begin_layout Standard
13618 If LabelString is not defined, a default value is constructed as follows:
13619 if the counter has a master counter
13620 \begin_inset Flex CharStyle:Code
13623 \begin_layout Plain Layout
13630 \begin_inset Flex CharStyle:Code
13633 \begin_layout Plain Layout
13640 \begin_inset Flex CharStyle:Code
13643 \begin_layout Plain Layout
13653 is used; otherwise the string
13654 \begin_inset Flex CharStyle:Code
13657 \begin_layout Plain Layout
13668 \begin_layout Description
13669 \begin_inset Flex CharStyle:Code
13672 \begin_layout Plain Layout
13673 LabelStringAppendix [string=""]
13679 \begin_inset Flex CharStyle:Code
13682 \begin_layout Plain Layout
13691 \begin_layout Description
13692 \begin_inset Flex CharStyle:Code
13695 \begin_layout Plain Layout
13702 \begin_inset Flex CharStyle:Code
13705 \begin_layout Plain Layout
13712 \begin_inset Quotes erd
13716 \begin_inset Quotes erd
13719 ] The name of the counter.
13722 \begin_layout Description
13723 \begin_inset Flex CharStyle:Code
13726 \begin_layout Plain Layout
13733 \begin_inset Flex CharStyle:Code
13736 \begin_layout Plain Layout
13743 \begin_inset Quotes erd
13747 \begin_inset Quotes erd
13750 ] If this is set to the name of another counter, the present counter will
13751 be reset everytime the other one is increased.
13753 \begin_inset Flex CharStyle:Code
13756 \begin_layout Plain Layout
13763 \begin_inset Flex CharStyle:Code
13766 \begin_layout Plain Layout
13775 \begin_layout Subsection
13779 \begin_layout Standard
13780 \begin_inset CommandInset label
13786 A font description looks like this:
13789 \begin_layout LyX-Code
13799 \begin_layout LyX-Code
13803 \begin_layout LyX-Code
13807 \begin_layout Standard
13808 The following commands are available:
13811 \begin_layout Description
13812 \begin_inset Flex CharStyle:Code
13815 \begin_layout Plain Layout
13822 \begin_inset Flex CharStyle:Code
13825 \begin_layout Plain Layout
13834 \begin_inset Flex CharStyle:Code
13837 \begin_layout Plain Layout
13844 \begin_inset Flex CharStyle:Code
13847 \begin_layout Plain Layout
13854 \begin_inset Flex CharStyle:Code
13857 \begin_layout Plain Layout
13864 \begin_inset Flex CharStyle:Code
13867 \begin_layout Plain Layout
13874 \begin_inset Flex CharStyle:Code
13877 \begin_layout Plain Layout
13884 \begin_inset Flex CharStyle:Code
13887 \begin_layout Plain Layout
13894 \begin_inset Flex CharStyle:Code
13897 \begin_layout Plain Layout
13904 \begin_inset Flex CharStyle:Code
13907 \begin_layout Plain Layout
13916 \begin_layout Description
13917 \begin_inset Flex CharStyle:Code
13920 \begin_layout Plain Layout
13929 \begin_inset Flex CharStyle:Code
13932 \begin_layout Plain Layout
13943 \begin_inset Flex CharStyle:Code
13946 \begin_layout Plain Layout
13953 \begin_inset Flex CharStyle:Code
13956 \begin_layout Plain Layout
13965 \begin_layout Description
13966 \begin_inset Flex CharStyle:Code
13969 \begin_layout Plain Layout
13976 \begin_inset Flex CharStyle:Code
13979 \begin_layout Plain Layout
13985 ] Valid argument sare:
13986 \begin_inset Flex CharStyle:Code
13989 \begin_layout Plain Layout
13996 \begin_inset Flex CharStyle:Code
13999 \begin_layout Plain Layout
14006 \begin_inset Flex CharStyle:Code
14009 \begin_layout Plain Layout
14016 \begin_inset Flex CharStyle:Code
14019 \begin_layout Plain Layout
14026 \begin_inset Flex CharStyle:Code
14029 \begin_layout Plain Layout
14036 \begin_inset Flex CharStyle:Code
14039 \begin_layout Plain Layout
14046 Each of these turns on or off the corresponding attribute.
14049 \begin_layout Description
14050 \begin_inset Flex CharStyle:Code
14053 \begin_layout Plain Layout
14062 \begin_inset Flex CharStyle:Code
14065 \begin_layout Plain Layout
14076 \begin_inset Flex CharStyle:Code
14079 \begin_layout Plain Layout
14088 \begin_layout Description
14089 \begin_inset Flex CharStyle:Code
14092 \begin_layout Plain Layout
14101 \begin_inset Flex CharStyle:Code
14104 \begin_layout Plain Layout
14115 \begin_inset Flex CharStyle:Code
14118 \begin_layout Plain Layout
14125 \begin_inset Flex CharStyle:Code
14128 \begin_layout Plain Layout
14135 \begin_inset Flex CharStyle:Code
14138 \begin_layout Plain Layout
14147 \begin_layout Description
14148 \begin_inset Flex CharStyle:Code
14151 \begin_layout Plain Layout
14158 \begin_inset Flex CharStyle:Code
14161 \begin_layout Plain Layout
14168 \begin_inset Flex CharStyle:Code
14171 \begin_layout Plain Layout
14178 \begin_inset Flex CharStyle:Code
14181 \begin_layout Plain Layout
14190 \begin_inset Flex CharStyle:Code
14193 \begin_layout Plain Layout
14200 \begin_inset Flex CharStyle:Code
14203 \begin_layout Plain Layout
14210 \begin_inset Flex CharStyle:Code
14213 \begin_layout Plain Layout
14220 \begin_inset Flex CharStyle:Code
14223 \begin_layout Plain Layout
14230 \begin_inset Flex CharStyle:Code
14233 \begin_layout Plain Layout
14242 \begin_layout Subsection
14243 Upgrading old layout files
14246 \begin_layout Standard
14247 The file format of layout files changes from time to time, so old layout
14248 files need to be converted.
14249 This process has been automated since LyX 1.4.0: If LyX reads an old format
14250 layout file it will call the conversion tool
14251 \begin_inset Flex CharStyle:Code
14254 \begin_layout Plain Layout
14255 LyXDir/scripts/layout2layout.py
14260 and convert it to a temporary file in current format.
14261 The original file is left untouched.
14262 If you want to convert the layout file permanently, just call the converter
14266 \begin_layout LyX-Code
14267 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
14270 \begin_layout Standard
14271 (You need to replace
14272 \begin_inset Flex CharStyle:Code
14275 \begin_layout Plain Layout
14281 with the name of your LyX system directory, unless you happen to have defined
14282 such an environment variable.) Then copy
14283 \begin_inset Flex CharStyle:Code
14286 \begin_layout Plain Layout
14293 \begin_inset Flex CharStyle:Code
14296 \begin_layout Plain Layout
14305 \begin_layout Standard
14306 The automatic conversion only handles syntax changes.
14307 It cannot handle the case where the contents of included files was changed,
14308 so these will have to be converted separately.
14311 \begin_layout Section
14313 \begin_inset CommandInset label
14315 name "sec:templates"
14322 \begin_layout Standard
14323 Templates are created just like usual documents.
14324 The only difference is that usual documents contain all possible settings,
14325 including the font scheme and the paper size.
14326 Usually a user doesn't want a template to overwrite his defaults in these
14328 For that reason, the designer of a template should remove the corresponding
14330 \begin_inset Flex CharStyle:Code
14333 \begin_layout Plain Layout
14342 \begin_inset Flex CharStyle:Code
14345 \begin_layout Plain Layout
14353 from the template LyX file.
14354 This can be done with any simple text-editor, for example
14355 \begin_inset Flex CharStyle:Code
14358 \begin_layout Plain Layout
14365 \begin_inset Flex CharStyle:Code
14368 \begin_layout Plain Layout
14378 \begin_layout Standard
14379 Put the edited template files you create in
14380 \begin_inset Flex CharStyle:Code
14383 \begin_layout Plain Layout
14389 , copy the ones you use from the global template directory in
14390 \begin_inset Flex CharStyle:Code
14393 \begin_layout Plain Layout
14399 to the same place, and redefine the template path in the
14400 \begin_inset Flex CharStyle:MenuItem
14403 \begin_layout Plain Layout
14411 \SpecialChar \menuseparator
14416 references\SpecialChar \menuseparator
14425 \begin_layout Standard
14426 Note that there is a template which has a particular meaning:
14427 \begin_inset Flex CharStyle:Code
14430 \begin_layout Plain Layout
14437 This template is loaded everytime you create a new document with
14438 \begin_inset Flex CharStyle:MenuItem
14441 \begin_layout Plain Layout
14451 \SpecialChar \menuseparator
14453 \begin_inset Flex CharStyle:MenuItem
14456 \begin_layout Plain Layout
14466 in order to provide useful defaults.
14467 To create this template from inside LyX, all you have to do is to open
14468 a document with the correct settings, and use the
14469 \begin_inset Flex CharStyle:MenuItem
14472 \begin_layout Plain Layout
14477 e as Document Defaults
14485 \begin_layout Chapter
14486 Including External Material
14489 \begin_layout Standard
14490 The use of material from sources external to LyX is covered in detail in
14496 This part of the manual covers what needs to happen behind the scenes for
14497 new sorts of material to be included.
14500 \begin_layout Section
14504 \begin_layout Standard
14505 The external material feature is based on the concept of a
14510 A template is a specification of how LyX should interface with a certain
14512 As bundled, LyX comes with predefined templates for Xfig figures, various
14513 raster format images, chess diagrams, and LilyPond music notation.
14514 You can check the actual list by using the menu
14515 \begin_inset Flex CharStyle:MenuItem
14518 \begin_layout Plain Layout
14519 Insert\SpecialChar \menuseparator
14520 File\SpecialChar \menuseparator
14527 Furthermore, it is possible to roll your own template to support a specific
14529 Later we'll describe in more detail what is involved, and hopefully you
14530 will submit all the templates you create so we can include them in a later
14534 \begin_layout Standard
14535 Another basic idea of the external material feature is to distinguish between
14536 the original file that serves as a base for final material and the produced
14537 file that is included in your exported or printed document.
14538 For example, consider the case of a figure produced with
14539 \begin_inset Flex CharStyle:Code
14542 \begin_layout Plain Layout
14549 The Xfig application itself works on an original file with the
14550 \begin_inset Flex CharStyle:Code
14553 \begin_layout Plain Layout
14560 Within XFig, you create and change your figure, and when you are done,
14562 \begin_inset Flex CharStyle:Code
14565 \begin_layout Plain Layout
14572 When you want to include the figure in your document, you invoke
14573 \begin_inset Flex CharStyle:Code
14576 \begin_layout Plain Layout
14582 in order to create a PostScript file that can readily be included in your
14585 \begin_inset Flex CharStyle:Code
14588 \begin_layout Plain Layout
14594 file is the original file, and the PostScript file is the produced file.
14597 \begin_layout Standard
14598 This distinction is important in order to allow updating of the material
14599 while you are in the process of writing the document.
14600 Furthermore, it provides us with the flexibility that is needed to support
14601 multiple export formats.
14602 For instance, in the case of a plain text file, it is not exactly an award-winn
14603 ing idea to include the figure as raw PostScript®.
14604 Instead, you'd either prefer to just include a reference to the figure
14605 or try to invoke some graphics to Ascii converter to make the final result
14606 look similar to the real graphics.
14607 The external material management allows you to do this, because it is parameter
14608 ized on the different export formats that LyX supports.
14611 \begin_layout Standard
14612 Besides supporting the production of different products according to the
14613 exported format, it supports tight integration with editing and viewing
14615 In the case of an XFig figure, you are able to invoke Xfig on the original
14616 file with a single click from within the external material dialog in LyX,
14617 and also preview the produced PostScript file with ghostview with another
14619 No more fiddling around with the command line and/or file browsers to locate
14620 and manipulate the original or produced files.
14621 In this way, you are finally able to take full advantage of the many different
14622 applications that are relevant to use when you write your documents, and
14623 ultimately be more productive.
14626 \begin_layout Section
14627 The external template configuration file
14630 \begin_layout Standard
14631 It is relatively easy to add custom external template definitions to LyX.
14632 However, be aware that doing this in an careless manner most probably
14636 introduce an easily exploitable security hole.
14637 So before you do this, please read the discussion about security in section
14639 \begin_inset CommandInset ref
14641 reference "sec:Security-discussion"
14648 \begin_layout Standard
14649 Having said that, we encourage you to submit any interesting templates that
14654 \begin_layout Standard
14655 The external templates are defined in the
14656 \begin_inset Flex CharStyle:Code
14659 \begin_layout Plain Layout
14660 LyXDir/lib/external_templates
14666 You can place your own version in
14667 \begin_inset Flex CharStyle:Code
14670 \begin_layout Plain Layout
14671 UserDir/external_templates
14679 \begin_layout Standard
14680 A typical template looks like this:
14683 \begin_layout LyX-Code
14687 \begin_layout LyX-Code
14688 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14691 \begin_layout LyX-Code
14695 \begin_layout LyX-Code
14699 \begin_layout LyX-Code
14703 \begin_layout LyX-Code
14707 \begin_layout LyX-Code
14711 \begin_layout LyX-Code
14712 AutomaticProduction true
14715 \begin_layout LyX-Code
14719 \begin_layout LyX-Code
14723 \begin_layout LyX-Code
14727 \begin_layout LyX-Code
14728 TransformCommand Rotate RotationLatexCommand
14731 \begin_layout LyX-Code
14732 TransformCommand Resize ResizeLatexCommand
14735 \begin_layout LyX-Code
14736 Product "$$RotateFront$$ResizeFront
14739 \begin_layout LyX-Code
14744 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14747 \begin_layout LyX-Code
14748 $$ResizeBack$$RotateBack"
14751 \begin_layout LyX-Code
14755 \begin_layout LyX-Code
14756 UpdateResult "$$AbsPath$$Basename.pstex_t"
14759 \begin_layout LyX-Code
14760 Requirement "graphicx"
14763 \begin_layout LyX-Code
14764 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14767 \begin_layout LyX-Code
14768 ReferencedFile latex "$$AbsPath$$Basename.eps"
14771 \begin_layout LyX-Code
14772 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14775 \begin_layout LyX-Code
14779 \begin_layout LyX-Code
14783 \begin_layout LyX-Code
14784 TransformCommand Rotate RotationLatexCommand
14787 \begin_layout LyX-Code
14788 TransformCommand Resize ResizeLatexCommand
14791 \begin_layout LyX-Code
14792 Product "$$RotateFront$$ResizeFront
14795 \begin_layout LyX-Code
14800 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14803 \begin_layout LyX-Code
14804 $$ResizeBack$$RotateBack"
14807 \begin_layout LyX-Code
14808 UpdateFormat pdftex
14811 \begin_layout LyX-Code
14812 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14815 \begin_layout LyX-Code
14816 Requirement "graphicx"
14819 \begin_layout LyX-Code
14820 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14823 \begin_layout LyX-Code
14824 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14827 \begin_layout LyX-Code
14831 \begin_layout LyX-Code
14835 \begin_layout LyX-Code
14836 Product "$$Contents(
14838 "$$AbsPath$$Basename.asc
14843 \begin_layout LyX-Code
14844 UpdateFormat asciixfig
14847 \begin_layout LyX-Code
14848 UpdateResult "$$AbsPath$$Basename.asc"
14851 \begin_layout LyX-Code
14855 \begin_layout LyX-Code
14859 \begin_layout LyX-Code
14860 Product "<graphic fileref=
14862 "$$AbsOrRelPathMaster$$Basename.eps
14867 \begin_layout LyX-Code
14871 \begin_layout LyX-Code
14875 \begin_layout LyX-Code
14876 UpdateResult "$$AbsPath$$Basename.eps"
14879 \begin_layout LyX-Code
14880 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14883 \begin_layout LyX-Code
14884 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14887 \begin_layout LyX-Code
14891 \begin_layout LyX-Code
14892 Product "[XFig: $$FName]"
14895 \begin_layout LyX-Code
14899 \begin_layout LyX-Code
14903 \begin_layout Standard
14904 As you can see, the template is enclosed in
14905 \begin_inset Flex CharStyle:Code
14908 \begin_layout Plain Layout
14914 \SpecialChar \ldots{}
14916 \begin_inset Flex CharStyle:Code
14919 \begin_layout Plain Layout
14926 It contains a header specifying some general settings and, for each supported
14927 primary document file format, a section
14928 \begin_inset Flex CharStyle:Code
14931 \begin_layout Plain Layout
14937 \SpecialChar \ldots{}
14939 \begin_inset Flex CharStyle:Code
14942 \begin_layout Plain Layout
14951 \begin_layout Subsection
14952 The template header
14955 \begin_layout Description
14956 \begin_inset Flex CharStyle:Code
14959 \begin_layout Plain Layout
14960 AutomaticProduction
14961 \begin_inset space ~
14969 Whether the file represented by the template must be generated by LyX.
14970 This command must occur exactly once.
14973 \begin_layout Description
14974 \begin_inset Flex CharStyle:Code
14977 \begin_layout Plain Layout
14979 \begin_inset space ~
14987 A glob pattern that is used in the file dialog to filter out the desired
14989 If there is more than one possible file extension (e.g.
14990 \begin_inset space ~
14994 \begin_inset Flex CharStyle:Code
14997 \begin_layout Plain Layout
15004 \begin_inset Flex CharStyle:Code
15007 \begin_layout Plain Layout
15013 ), use something like
15014 \begin_inset Flex CharStyle:Code
15017 \begin_layout Plain Layout
15024 This command must occur exactly once.
15027 \begin_layout Description
15028 \begin_inset Flex CharStyle:Code
15031 \begin_layout Plain Layout
15033 \begin_inset space ~
15041 The text that is displayed on the button.
15042 This command must occur exactly once.
15045 \begin_layout Description
15046 \begin_inset Flex CharStyle:Code
15049 \begin_layout Plain Layout
15051 \begin_inset space ~
15055 \begin_inset space ~
15063 The help text that is used in the External dialog.
15064 Provide enough information to explain to the user just what the template
15065 can provide him with.
15066 This command must occur exactly once.
15069 \begin_layout Description
15070 \begin_inset Flex CharStyle:Code
15073 \begin_layout Plain Layout
15075 \begin_inset space ~
15083 The file format of the original file.
15084 This must be the name of a format that is known to LyX (see section
15085 \begin_inset CommandInset ref
15087 reference "sub:Formats"
15093 \begin_inset Quotes eld
15097 \begin_inset Flex CharStyle:Code
15100 \begin_layout Plain Layout
15107 \begin_inset Quotes erd
15110 if the template can handle original files of more than one format.
15111 LyX will attempt to interrogate the file itself in order to deduce its
15112 format in this case.
15113 This command must occur exactly once.
15116 \begin_layout Description
15117 \begin_inset Flex CharStyle:Code
15120 \begin_layout Plain Layout
15122 \begin_inset space ~
15130 A unique name for the template.
15131 It must not contain substitution macros (see below).
15134 \begin_layout Description
15135 \begin_inset Flex CharStyle:Code
15138 \begin_layout Plain Layout
15140 \begin_inset space ~
15143 Rotate|Resize|Clip|Extra
15148 This command specifies which transformations are supported by this template.
15149 It may occur zero or more times.
15150 This command enables the corresponding tabs in the external dialog.
15152 \begin_inset Flex CharStyle:Code
15155 \begin_layout Plain Layout
15161 command must have either a corresponding
15162 \begin_inset Flex CharStyle:Code
15165 \begin_layout Plain Layout
15172 \begin_inset Flex CharStyle:Code
15175 \begin_layout Plain Layout
15182 \begin_inset Flex CharStyle:Code
15185 \begin_layout Plain Layout
15192 Otherwise the transformation will not be supported by that format.
15195 \begin_layout Subsection
15199 \begin_layout Description
15200 \begin_inset Flex CharStyle:Code
15203 \begin_layout Plain Layout
15205 \begin_inset space ~
15208 LaTeX|PDFLaTeX|PlainText|DocBook
15213 The primary document file format that this format definition is for.
15214 Not every template has a sensible representation in all document file formats.
15215 Please define nevertheless a
15216 \begin_inset Flex CharStyle:Code
15219 \begin_layout Plain Layout
15225 section for all formats.
15226 Use a dummy text when no representation is available.
15227 Then you can at least see a reference to the external material in the exported
15231 \begin_layout Description
15232 \begin_inset Flex CharStyle:Code
15235 \begin_layout Plain Layout
15237 \begin_inset space ~
15241 \begin_inset space ~
15249 This command defines an additional macro
15250 \begin_inset Flex CharStyle:Code
15253 \begin_layout Plain Layout
15259 for substitution in
15260 \begin_inset Flex CharStyle:Code
15263 \begin_layout Plain Layout
15271 \begin_inset Flex CharStyle:Code
15274 \begin_layout Plain Layout
15280 itself may contain substitution macros.
15281 The advantage over using
15282 \begin_inset Flex CharStyle:Code
15285 \begin_layout Plain Layout
15292 \begin_inset Flex CharStyle:Code
15295 \begin_layout Plain Layout
15301 is that the substituted value of
15302 \begin_inset Flex CharStyle:Code
15305 \begin_layout Plain Layout
15311 is sanitized so that it is a valid optional argument in the document format.
15312 This command may occur zero or more times.
15315 \begin_layout Description
15316 \begin_inset Flex CharStyle:Code
15319 \begin_layout Plain Layout
15321 \begin_inset space ~
15329 The text that is inserted in the exported document.
15330 This is actually the most important command and can be quite complex.
15331 This command must occur exactly once.
15334 \begin_layout Description
15335 \begin_inset Flex CharStyle:Code
15338 \begin_layout Plain Layout
15340 \begin_inset space ~
15348 This command specifies a preamble snippet that will be included in the
15350 It has to be defined using
15351 \begin_inset Flex CharStyle:Code
15354 \begin_layout Plain Layout
15360 \SpecialChar \ldots{}
15362 \begin_inset Flex CharStyle:Code
15365 \begin_layout Plain Layout
15372 This command may occur zero or more times.
15375 \begin_layout Description
15376 \begin_inset Flex CharStyle:Code
15379 \begin_layout Plain Layout
15381 \begin_inset space ~
15385 \begin_inset space ~
15393 This command denotes files that are created by the conversion process and
15394 are needed for a particular export format.
15395 If the filename is relative, it is interpreted relative to the master document.
15396 This command may be given zero or more times.
15399 \begin_layout Description
15400 \begin_inset Flex CharStyle:Code
15403 \begin_layout Plain Layout
15405 \begin_inset space ~
15413 The name of a required LaTeX package.
15414 The package is included via
15415 \begin_inset Flex CharStyle:Code
15418 \begin_layout Plain Layout
15426 in the LaTeX preamble.
15427 This command may occur zero or more times.
15430 \begin_layout Description
15431 \begin_inset Flex CharStyle:Code
15434 \begin_layout Plain Layout
15436 \begin_inset space ~
15440 \begin_inset space ~
15443 RotationLatexCommand
15448 This command specifies that the built in LaTeX command should be used for
15450 This command may occur once or not at all.
15453 \begin_layout Description
15454 \begin_inset Flex CharStyle:Code
15457 \begin_layout Plain Layout
15459 \begin_inset space ~
15463 \begin_inset space ~
15471 This command specifies that the built in LaTeX command should be used for
15473 This command may occur once or not at all.
15476 \begin_layout Description
15477 \begin_inset Flex CharStyle:Code
15480 \begin_layout Plain Layout
15482 \begin_inset space ~
15486 \begin_inset space ~
15489 RotationLatexOption
15494 This command specifies that rotation is done via an optional argument.
15495 This command may occur once or not at all.
15498 \begin_layout Description
15499 \begin_inset Flex CharStyle:Code
15502 \begin_layout Plain Layout
15504 \begin_inset space ~
15508 \begin_inset space ~
15516 This command specifies that resizing is done via an optional argument.
15517 This command may occur once or not at all.
15520 \begin_layout Description
15521 \begin_inset Flex CharStyle:Code
15524 \begin_layout Plain Layout
15526 \begin_inset space ~
15530 \begin_inset space ~
15538 This command specifies that clipping is done via an optional argument.
15539 This command may occur once or not at all.
15542 \begin_layout Description
15543 \begin_inset Flex CharStyle:Code
15546 \begin_layout Plain Layout
15548 \begin_inset space ~
15552 \begin_inset space ~
15560 This command specifies that an extra optional argument is used.
15561 This command may occur once or not at all.
15564 \begin_layout Description
15565 \begin_inset Flex CharStyle:Code
15568 \begin_layout Plain Layout
15570 \begin_inset space ~
15578 The file format of the converted file.
15579 This must be the name of a format that is known to LyX (see the
15580 \begin_inset Flex CharStyle:MenuItem
15583 \begin_layout Plain Layout
15588 ools\SpecialChar \menuseparator
15593 references:Conversion
15599 This command must occur exactly once.
15602 \begin_layout Description
15603 \begin_inset Flex CharStyle:Code
15606 \begin_layout Plain Layout
15608 \begin_inset space ~
15616 The file name of the converted file.
15617 The file name must be absolute.
15618 This command must occur exactly once.
15621 \begin_layout Subsection
15622 Preamble definitions
15625 \begin_layout Standard
15626 The external template configuration file may contain additional preamble
15627 definitions enclosed by
15628 \begin_inset Flex CharStyle:Code
15631 \begin_layout Plain Layout
15637 \SpecialChar \ldots{}
15639 \begin_inset Flex CharStyle:Code
15642 \begin_layout Plain Layout
15649 They can be used by the templates in the
15650 \begin_inset Flex CharStyle:Code
15653 \begin_layout Plain Layout
15662 \begin_layout Section
15663 The substitution mechanism
15666 \begin_layout Standard
15667 When the external material facility invokes an external program, it is done
15668 on the basis of a command defined in the template configuration file.
15669 These commands can contain various macros that are expanded before execution.
15670 Execution always take place in the directory of the containing document.
15673 \begin_layout Standard
15674 Also, whenever external material is to be displayed, the name will be produced
15675 by the substitution mechanism, and most other commands in the template
15676 definition support substitution as well.
15679 \begin_layout Standard
15680 The available macros are the following:
15683 \begin_layout Description
15684 \begin_inset Flex CharStyle:Code
15687 \begin_layout Plain Layout
15688 $$AbsOrRelPathMaster
15693 The file path, absolute or relative to the master LyX document.
15696 \begin_layout Description
15697 \begin_inset Flex CharStyle:Code
15700 \begin_layout Plain Layout
15701 $$AbsOrRelPathParent
15706 The file path, absolute or relative to the LyX document.
15709 \begin_layout Description
15710 \begin_inset Flex CharStyle:Code
15713 \begin_layout Plain Layout
15719 The absolute file path.
15722 \begin_layout Description
15723 \begin_inset Flex CharStyle:Code
15726 \begin_layout Plain Layout
15732 The filename without path and without the extension.
15735 \begin_layout Description
15736 \begin_inset Flex CharStyle:Code
15739 \begin_layout Plain Layout
15741 \begin_inset Quotes eld
15745 \begin_inset Quotes erd
15753 This macro will expand to the contents of the file with the name
15754 \begin_inset Flex CharStyle:Code
15757 \begin_layout Plain Layout
15766 \begin_layout Description
15767 \begin_inset Flex CharStyle:Code
15770 \begin_layout Plain Layout
15776 The file extension (including the dot).
15779 \begin_layout Description
15780 \begin_inset Flex CharStyle:Code
15783 \begin_layout Plain Layout
15789 The filename of the file specified in the external material dialog.
15790 This is either an absolute name, or it is relative to the LyX document.
15793 \begin_layout Description
15794 \begin_inset Flex CharStyle:Code
15797 \begin_layout Plain Layout
15804 \begin_inset Flex CharStyle:Code
15807 \begin_layout Plain Layout
15813 (absolute name or relative to the LyX document).
15816 \begin_layout Description
15817 \begin_inset Flex CharStyle:Code
15820 \begin_layout Plain Layout
15826 The file path, relative to the master LyX document.
15829 \begin_layout Description
15830 \begin_inset Flex CharStyle:Code
15833 \begin_layout Plain Layout
15839 The file path, relative to the LyX document.
15842 \begin_layout Description
15843 \begin_inset Flex CharStyle:Code
15846 \begin_layout Plain Layout
15852 This macro will expand to the absolute path of the system directory.
15853 This is typically used to point to the various helper scripts that are
15857 \begin_layout Description
15858 \begin_inset Flex CharStyle:Code
15861 \begin_layout Plain Layout
15867 A name and full path to a temporary file which will be automatically deleted
15868 whenever the containing document is closed, or the external material insertion
15872 \begin_layout Standard
15873 All path macros contain a trailing directory separator, so you can construct
15875 the absolute filename with
15876 \begin_inset Flex CharStyle:Code
15879 \begin_layout Plain Layout
15880 $$AbsPath$$Basename$$Extension
15888 \begin_layout Standard
15889 The macros above are substituted in all commands unless otherwise noted.
15891 \begin_inset Flex CharStyle:Code
15894 \begin_layout Plain Layout
15900 supports additionally the following substitutions if they are enabled by
15902 \begin_inset Flex CharStyle:Code
15905 \begin_layout Plain Layout
15912 \begin_inset Flex CharStyle:Code
15915 \begin_layout Plain Layout
15924 \begin_layout Description
15925 \begin_inset Flex CharStyle:Code
15928 \begin_layout Plain Layout
15934 The front part of the resize command.
15937 \begin_layout Description
15938 \begin_inset Flex CharStyle:Code
15941 \begin_layout Plain Layout
15947 The back part of the resize command.
15950 \begin_layout Description
15951 \begin_inset Flex CharStyle:Code
15954 \begin_layout Plain Layout
15960 The front part of the rotation command.
15963 \begin_layout Description
15964 \begin_inset Flex CharStyle:Code
15967 \begin_layout Plain Layout
15973 The back part of the rotation command.
15976 \begin_layout Standard
15977 The value string of the
15978 \begin_inset Flex CharStyle:Code
15981 \begin_layout Plain Layout
15987 command supports additionally the following substitutions if they are enabled
15989 \begin_inset Flex CharStyle:Code
15992 \begin_layout Plain Layout
15999 \begin_inset Flex CharStyle:Code
16002 \begin_layout Plain Layout
16011 \begin_layout Description
16012 \begin_inset Flex CharStyle:Code
16015 \begin_layout Plain Layout
16024 \begin_layout Description
16025 \begin_inset Flex CharStyle:Code
16028 \begin_layout Plain Layout
16037 \begin_layout Description
16038 \begin_inset Flex CharStyle:Code
16041 \begin_layout Plain Layout
16050 \begin_layout Description
16051 \begin_inset Flex CharStyle:Code
16054 \begin_layout Plain Layout
16060 The rotation option.
16063 \begin_layout Standard
16064 You may ask why there are so many path macros.
16065 There are mainly two reasons:
16068 \begin_layout Enumerate
16069 Relative and absolute file names should remain relative or absolute, respectivel
16071 Users may have reasons to prefer either form.
16072 Relative names are useful for portable documents that should work on different
16073 machines, for example.
16074 Absolute names may be required by some programs.
16077 \begin_layout Enumerate
16078 LaTeX treats relative file names differently than LyX and other programs
16079 in nested included files.
16080 For LyX, a relative file name is always relative to the document that contains
16082 For LaTeX, it is always relative to the master document.
16083 These two definitions are identical if you have only one document, but
16084 differ if you have a master document that includes part documents.
16085 That means that relative filenames must be transformed when presented to
16087 Fortunately LyX does this automatically for you if you choose the right
16091 \begin_layout Standard
16092 So which path macro should be used in new template definitions? The rule
16096 \begin_layout Itemize
16098 \begin_inset Flex CharStyle:Code
16101 \begin_layout Plain Layout
16107 if an absolute path is required.
16110 \begin_layout Itemize
16112 \begin_inset Flex CharStyle:Code
16115 \begin_layout Plain Layout
16116 $$AbsOrRelPathMaster
16121 if the substituted string is some kind of LaTeX input.
16124 \begin_layout Itemize
16126 \begin_inset Flex CharStyle:Code
16129 \begin_layout Plain Layout
16130 $$AbsOrRelPathParent
16135 in order to preserve the user's choice.
16138 \begin_layout Standard
16139 There are special cases where this rule does not work and e.g.
16140 \begin_inset space ~
16143 relative names are needed, but normally it will work just fine.
16144 One example for such a case is the command
16145 \begin_inset Flex CharStyle:Code
16148 \begin_layout Plain Layout
16149 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
16154 in the XFig template above: We can't use the absolute name because the
16156 \begin_inset Flex CharStyle:Code
16159 \begin_layout Plain Layout
16165 files needs the relative name in order to rewrite the file content.
16168 \begin_layout Section
16169 \begin_inset CommandInset label
16171 name "sec:Security-discussion"
16175 Security discussion
16178 \begin_layout Standard
16179 \begin_inset Note Note
16182 \begin_layout Plain Layout
16183 This section is outdated
16188 The external material feature interfaces with a lot of external programs
16189 and does so automatically, so we have to consider the security implications
16191 In particular, since you have the option of including your own filenames
16192 and/or parameter strings and those are expanded into a command, it seems
16193 that it would be possible to create a malicious document which executes
16194 arbitrary commands when a user views or prints the document.
16195 This is something we definately want to avoid.
16198 \begin_layout Standard
16199 However, since the external program commands are specified in the template
16200 configuration file only, there are no security issues if LyX is properly
16201 configured with safe templates only.
16202 This is so because the external programs are invoked with the
16203 \begin_inset Flex CharStyle:Code
16206 \begin_layout Plain Layout
16212 -system call rather than the
16213 \begin_inset Flex CharStyle:Code
16216 \begin_layout Plain Layout
16222 system-call, so it's not possible to execute arbitrary commands from the
16223 filename or parameter section via the shell.
16226 \begin_layout Standard
16227 This also implies that you are restricted in what command strings you can
16228 use in the external material templates.
16229 In particular, pipes and redirection are not readily available.
16230 This has to be so if LyX should remain safe.
16231 If you want to use some of the shell features, you should write a safe
16232 script to do this in a controlled manner, and then invoke the script from
16233 the command string.
16235 \begin_inset Flex CharStyle:Code
16238 \begin_layout Plain Layout
16244 directory of the LyX installation, you can find a safe wrapper script
16245 \begin_inset Flex CharStyle:Code
16248 \begin_layout Plain Layout
16249 general_command_wrapper.py
16254 that supports redirection of input and output.
16255 That can serve as an example for how to write safe template scripts.
16256 For a more advanced example that uses
16257 \begin_inset Flex CharStyle:Code
16260 \begin_layout Plain Layout
16266 and friends, take a look at the
16267 \begin_inset Flex CharStyle:Code
16270 \begin_layout Plain Layout
16279 \begin_layout Standard
16280 It is possible to design a template that interacts directly with the shell,
16281 but since this would allow a malicious user to execute arbitrary commands
16282 by writing clever filenames and/or parameters, we generally recommend that
16283 you only use safe scripts that work with the
16284 \begin_inset Flex CharStyle:Code
16287 \begin_layout Plain Layout
16293 system call in a controlled manner.
16294 Of course, for use in a controlled environment, it can be tempting to just
16295 fall back to use ordinary shell scripts.
16296 If you do so, be aware that you
16300 provide an easily exploitable security hole in your system.
16301 Of course it stands to reason that such unsafe templates will never be
16302 included in the standard LyX distribution, although we do encourage people
16303 to submit new templates in the open source tradition.
16304 But LyX as shipped from the official distribution channels will never have
16308 \begin_layout Standard
16309 Including external material provides a lot of power, and you have to be
16310 careful not to introduce security hazards with this power.
16311 A subtle error in a single line in an innocent looking script can open
16312 the door to huge security problems.
16313 So if you do not fully understand the issues, we recommend that you consult
16314 a knowledgable security professional or the LyX development team if you
16315 have any questions about whether a given template is safe or not.
16316 And do this before you use it in an uncontrolled environment.
16319 \begin_layout Chapter
16323 \begin_layout Section
16327 \begin_layout Standard
16328 The LyX server is a method implemented in LyX that will enable other programs
16329 to talk to LyX, invoke LyX commands, and retrieve information about the
16330 LyX internal state.
16331 This is only intended for advanced users, but they should find it useful.
16332 Please note that, at present,
16334 the server does not work on Windows
16340 \begin_layout Plain Layout
16341 There is no principled reason it cannot do so.
16342 But none of the developers on Windows® have yet implemented this functionality
16351 \begin_layout Section
16352 Starting the LyX Server
16355 \begin_layout Standard
16356 The LyX server works through the use of a pair of named pipes.
16357 These are usually located in
16358 \begin_inset Flex CharStyle:Code
16361 \begin_layout Plain Layout
16368 \begin_inset Quotes eld
16372 \begin_inset Flex CharStyle:Code
16375 \begin_layout Plain Layout
16382 \begin_inset Quotes erd
16386 \begin_inset Quotes eld
16390 \begin_inset Flex CharStyle:Code
16393 \begin_layout Plain Layout
16400 \begin_inset Quotes erd
16404 External programs write into
16405 \begin_inset Flex CharStyle:Code
16408 \begin_layout Plain Layout
16414 and read back data from
16415 \begin_inset Flex CharStyle:Code
16418 \begin_layout Plain Layout
16425 The stem of the pipe names can be defined in the
16426 \begin_inset Flex CharStyle:MenuItem
16429 \begin_layout Plain Layout
16434 ools\SpecialChar \menuseparator
16444 dialog, for example
16445 \begin_inset Flex CharStyle:Code
16448 \begin_layout Plain Layout
16449 "/home/myhome/.lyxpipe"
16457 \begin_layout Standard
16459 \begin_inset Flex CharStyle:Code
16462 \begin_layout Plain Layout
16469 \begin_inset Flex CharStyle:Code
16472 \begin_layout Plain Layout
16478 ' to create the pipes.
16479 The above setting also has the effect of activating the LyX server.
16480 If one of the pipes already exists, LyX will assume that another LyX process
16481 is already running and will not start the server.
16482 To have several LyX processes with servers at the same time, you have to
16483 change the configuration between the start of the programs.
16486 \begin_layout Standard
16487 If you are developing a client program, you might find it useful to enable
16488 debugging information from the LyX server.
16489 Do this by starting LyX as lyx -dbg lyxserver.
16492 \begin_layout Standard
16493 Warning: if LyX crashes, it may not manage to remove the pipes; in this
16494 case you must remove them manually.
16495 If LyX starts and the pipes exist already, it will not start any server.
16498 \begin_layout Standard
16499 Other than this, there are a few points to consider:
16502 \begin_layout Itemize
16503 Both server and clients must run on UNIX or OS/2 machines.
16504 Communications between LyX on UNIX and clients on OS/2 or vice versa is
16505 not possible right now.
16508 \begin_layout Itemize
16509 On OS/2, only one client can connect to LyXServer at a time.
16512 \begin_layout Itemize
16513 On OS/2, clients must open inpipe with
16514 \begin_inset Flex CharStyle:Code
16517 \begin_layout Plain Layout
16526 \begin_layout Standard
16530 \begin_layout Standard
16531 You can find a complete example client written in C in the source distribution
16533 \begin_inset Flex CharStyle:Code
16536 \begin_layout Plain Layout
16537 development/lyxserver/server_monitor.c
16545 \begin_layout Section
16546 Normal communication
16549 \begin_layout Standard
16550 To issue a LyX call, the client writes a line of ASCII text into the input
16552 This line has the following format:
16555 \begin_layout Quote
16569 \begin_layout Description
16574 is a name that the client can choose arbitrarily.
16575 Its only use is that LyX will echo it if it sends an answer---so a client
16576 can dispatch results from different requesters.
16579 \begin_layout Description
16584 is the function you want LyX to perform.
16585 It is the same as the commands you'd use in the minibuffer.
16588 \begin_layout Description
16593 is an optional argument which is meaningful only to some functions (for
16595 \begin_inset Quotes eld
16599 \begin_inset Quotes erd
16602 which will insert the argument as text at the cursor position.)
16605 \begin_layout Standard
16606 The answer from LyX will arrive in the output pipe and be of the form
16609 \begin_layout Quote
16623 \begin_layout Standard
16632 are just echoed from the command request, while
16636 is more or less useful information filled according to how the command
16637 execution worked out.
16638 Some commands will return information about the internal state of LyX,
16640 \begin_inset Quotes eld
16644 \begin_inset Quotes erd
16647 , while other will return an empty data-response.
16648 This means that the command execution went fine.
16651 \begin_layout Standard
16652 In case of errors, the response from LyX will have this form
16655 \begin_layout Quote
16669 \begin_layout Standard
16674 should contain an explanation of why the command failed.
16677 \begin_layout Standard
16681 \begin_layout LyX-Code
16682 echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
16685 \begin_layout LyX-Code
16686 echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
16687 \begin_inset Newline newline
16690 read a <~/.lyxpipe.out
16691 \begin_inset Newline newline
16697 \begin_layout Section
16701 \begin_layout Standard
16702 LyX can notify clients of events going on asynchronously.
16703 Currently it will only do this if the user binds a key sequence with the
16705 \begin_inset Quotes eld
16709 \begin_inset Quotes erd
16713 The format of the string LyX sends is as follows:
16716 \begin_layout Quote
16717 \begin_inset Flex CharStyle:Code
16720 \begin_layout Plain Layout
16731 \begin_layout Standard
16736 is the printed representation of the key sequence that was actually typed
16740 \begin_layout Standard
16741 This mechanism can be used to extend LyX's command set and implement macros:
16742 bind some key sequence to
16743 \begin_inset Quotes eld
16747 \begin_inset Quotes erd
16750 , start a client that listens on the out pipe, dispatches the command according
16751 to the sequence and starts a function that may use LyX calls and LyX requests
16752 to issue a command or a series of commands to LyX.
16755 \begin_layout Section
16756 The simple LyX Server Protocol
16759 \begin_layout Standard
16760 LyX implements a simple protocol that can be used for session management.
16761 All messages are of the form
16764 \begin_layout Quote
16774 \begin_layout Standard
16780 \begin_inset Quotes eld
16784 \begin_inset Quotes erd
16788 \begin_inset Quotes eld
16792 \begin_inset Quotes erd
16797 \begin_inset Quotes eld
16801 \begin_inset Quotes erd
16804 is received from a client, LyX will report back to inform the client that
16805 it's listening to it's messages, while
16806 \begin_inset Quotes eld
16810 \begin_inset Quotes erd
16813 sent from LyX will inform clients that LyX is closing.