1 #LyX 2.0.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 this document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of this document 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
44 \use_default_options false
50 InsetLayout CharStyle:MenuItem
59 \newcommand*{\menuitem}[1]{{\sffamily #1}}
67 \font_typewriter default
68 \font_default_family default
76 \default_output_format default
77 \bibtex_command default
78 \index_command default
82 \pdf_title "LyX Configuration Manual"
83 \pdf_author "LyX Team"
84 \pdf_subject "LyX-documentation Customization"
85 \pdf_keywords "LyX, documentation, customization"
87 \pdf_bookmarksnumbered true
88 \pdf_bookmarksopen true
89 \pdf_bookmarksopenlevel 1
94 \pdf_pdfusetitle false
95 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
103 \paperorientation portrait
110 \paragraph_separation indent
112 \quotes_language english
115 \paperpagestyle headings
116 \tracking_changes true
117 \output_changes false
118 \author "Jean-Marc Lasgouttes"
125 Customizing LyX: Features for the Advanced User
133 \begin_layout Plain Layout
135 If you have comments or error corrections, please send them to the LyX Documenta
137 \begin_inset CommandInset href
139 target "lyx-docs@lists.lyx.org"
146 \begin_inset Quotes eld
150 \begin_inset Quotes erd
153 in the subject header, and please cc the current maintainer of this file,
164 \begin_inset Newline newline
168 \begin_inset Newline newline
174 \begin_layout Standard
175 \begin_inset CommandInset toc
176 LatexCommand tableofcontents
183 \begin_layout Standard
184 \begin_inset Note Note
187 \begin_layout Plain Layout
188 Please use change tracking when modifying this document.
189 This makes it easier for our translators to recognize things that have
190 been changed, and it helps the maintainer keep up-to-date with what's been
199 \begin_layout Chapter
203 \begin_layout Standard
204 This manual covers the customization features present in LyX.
205 In it, we discuss issues like keyboard shortcuts, screen previewing options,
206 printer options, sending commands to LyX via the LyX Server, internationalizati
209 classes and LyX layouts, etc.
210 We can't possibly hope to touch on everything you can change—our developers
211 add new features faster than we can document them—but we will explain the
212 most common customizations and hopefully point you in the right direction
213 for some of the more obscure ones.
216 \begin_layout Standard
217 \begin_inset Branch OutDated
220 \begin_layout Standard
221 Information from previous versions of this document that now seems to be
222 outdated is contained in the
224 branch of this document.
225 By default, this information will not appear in the
235 \begin_layout Chapter
236 LyX configuration files
239 \begin_layout Standard
240 This chapter aims to help you to find your way through the LyX configuration
242 Before continuing to read this chapter, you should find out where your
243 LyX library and user directories are by using
244 \begin_inset Flex CharStyle:MenuItem
247 \begin_layout Plain Layout
248 Help\SpecialChar \menuseparator
259 The library directory is the place where LyX places its system-wide configurati
260 on files; the user directory is where you can place your modified versions.
261 We will call the former
262 \begin_inset Flex CharStyle:Code
265 \begin_layout Plain Layout
273 \begin_inset Flex CharStyle:MenuItem
276 \begin_layout Plain Layout
283 in the remainder of this document.
287 \begin_layout Section
289 \begin_inset Flex CharStyle:Code
292 \begin_layout Plain Layout
302 \begin_layout Standard
303 \begin_inset Flex CharStyle:Code
306 \begin_layout Plain Layout
313 and its sub-directories contain a number of files and that can be used
314 to customize LyX's behavior.
315 You can change many of these files from within LyX itself through the
316 \begin_inset Flex CharStyle:MenuItem
319 \begin_layout Plain Layout
320 Tools\SpecialChar \menuseparator
327 Most customization that you will want to do in LyX is possible through
329 However, many other inner aspects of LyX can be customized by modifying
331 \begin_inset Flex CharStyle:Code
334 \begin_layout Plain Layout
342 These files fall in different categories, described in the following subsection
346 \begin_layout Subsection
347 Automatically generated files
350 \begin_layout Standard
351 The files, which are to be found in
352 \begin_inset Flex CharStyle:MenuItem
355 \begin_layout Plain Layout
362 , are generated when you configure LyX.
363 They contain various default values that are guessed by inspection.
364 In general, it is not a good idea to modify them, since they might be overwritt
368 \begin_layout Labeling
369 \labelwidthstring 00.00.0000
370 \begin_inset Flex CharStyle:Code
373 \begin_layout Plain Layout
379 contains defaults for various commands.
382 \begin_layout Labeling
383 \labelwidthstring 00.00.0000
384 \begin_inset Flex CharStyle:Code
387 \begin_layout Plain Layout
394 contains the list of packages that have been recognized by LyX.
395 It is currently unused by the LyX program itself, but the information extracted
396 , and more, is made available with
397 \begin_inset Flex CharStyle:MenuItem
400 \begin_layout Plain Layout
401 Help\SpecialChar \menuseparator
416 \begin_layout Labeling
417 \labelwidthstring 00.00.0000
418 \begin_inset Flex CharStyle:Code
421 \begin_layout Plain Layout
430 the list of text classes that have been found in your
431 \begin_inset Flex CharStyle:Code
434 \begin_layout Plain Layout
440 directories, along with the associated
442 document class and their description.
445 \begin_layout Labeling
446 \labelwidthstring 00.00.0000
447 \begin_inset Flex CharStyle:Code
450 \begin_layout Plain Layout
459 the list of layout modules found in your
460 \begin_inset Flex CharStyle:Code
463 \begin_layout Plain Layout
472 \begin_layout Labeling
473 \labelwidthstring 00.00.0000
474 \begin_inset Flex CharStyle:Code
477 \begin_layout Plain Layout
484 lists of various sorts of
486 -related files found on your system
489 \begin_layout Labeling
490 \labelwidthstring 00.00.0000
491 \begin_inset Flex CharStyle:Code
494 \begin_layout Plain Layout
502 is automatically generated during configuration from the file
503 \begin_inset Flex CharStyle:Code
506 \begin_layout Plain Layout
515 It contains information on your
520 \begin_layout Subsection
524 \begin_layout Standard
525 These directories are duplicated between
526 \begin_inset Flex CharStyle:Code
529 \begin_layout Plain Layout
537 \begin_inset Flex CharStyle:Code
540 \begin_layout Plain Layout
548 If a particular files exists in both places, the one in
549 \begin_inset Flex CharStyle:Code
552 \begin_layout Plain Layout
562 \begin_layout Labeling
563 \labelwidthstring 00.00.0000
564 \begin_inset Flex CharStyle:Code
567 \begin_layout Plain Layout
573 this directory contains files with the extension
574 \begin_inset Flex CharStyle:Code
577 \begin_layout Plain Layout
586 If there exists an internationalized version of the bind file named
587 \begin_inset Flex CharStyle:Code
590 \begin_layout Plain Layout
596 , that will be used first.
599 \begin_layout Labeling
600 \labelwidthstring 00.00.0000
601 \begin_inset Flex CharStyle:Code
604 \begin_layout Plain Layout
612 contains graphics files that can be included in documents.
616 \begin_layout Labeling
617 \labelwidthstring 00.00.0000
618 \begin_inset Flex CharStyle:Code
621 \begin_layout Plain Layout
627 contains LyX documentation files (including the one you are currently reading).
629 \begin_inset Flex CharStyle:Code
632 \begin_layout Plain Layout
640 deserves special attention, as noted above.
641 The internationalized help docs are in
644 \begin_inset Flex CharStyle:Code
647 \begin_layout Plain Layout
654 \begin_inset Quotes eld
658 \begin_inset Quotes erd
661 is the ISO language code.
667 \begin_inset CommandInset ref
669 reference "cha:Internationalizing-LyX"
676 \begin_layout Labeling
677 \labelwidthstring 00.00.0000
678 \begin_inset Flex CharStyle:Code
681 \begin_layout Plain Layout
687 contains example files that explain how to use some features.
688 In the file browser, press the
689 \begin_inset Flex CharStyle:MenuItem
692 \begin_layout Plain Layout
701 \begin_layout Labeling
702 \labelwidthstring 00.00.0000
703 \begin_inset Flex CharStyle:Code
706 \begin_layout Plain Layout
712 contains image files that are used by the
713 \begin_inset Flex CharStyle:MenuItem
716 \begin_layout Plain Layout
723 In addition, it also contains the individual icons used in the toolbar
724 and the banners that can be shown when LyX is launched.
727 \begin_layout Labeling
728 \labelwidthstring 00.00.0000
729 \begin_inset Flex CharStyle:Code
732 \begin_layout Plain Layout
748 \begin_inset CommandInset ref
750 reference "sec:International-Keymap-Stuff"
757 \begin_layout Labeling
758 \labelwidthstring 00.00.0000
759 \begin_inset Flex CharStyle:Code
762 \begin_layout Plain Layout
768 contains the text class and module files described in Chapter
773 \begin_inset CommandInset ref
775 reference "cha:Installing-New-Document"
782 \begin_layout Labeling
783 \labelwidthstring 00.00.0000
784 \begin_inset Flex CharStyle:Code
787 \begin_layout Plain Layout
795 \begin_inset Flex CharStyle:Code
798 \begin_layout Plain Layout
805 Python scripts used to convert between LyX versions.
806 These can be run from the command line if, say, you want to batch-convert
810 \begin_layout Labeling
811 \labelwidthstring 00.00.0000
812 \begin_inset Flex CharStyle:Code
815 \begin_layout Plain Layout
821 contains some files that demonstrate the capabilities of the
822 \begin_inset Flex CharStyle:MenuItem
825 \begin_layout Plain Layout
836 Also contains some scripts used by LyX itself.
839 \begin_layout Labeling
840 \labelwidthstring 00.00.0000
841 \begin_inset Flex CharStyle:Code
844 \begin_layout Plain Layout
850 contains the standard LyX template files described in Chapter
855 \begin_inset CommandInset ref
857 reference "sec:Creating-Templates"
864 \begin_layout Labeling
865 \labelwidthstring 00.00.0000
866 \begin_inset Flex CharStyle:Code
869 \begin_layout Plain Layout
877 contains files with the extension
878 \begin_inset Flex CharStyle:Code
881 \begin_layout Plain Layout
888 that define the user interface to LyX.
889 That is, the files define which items appear in which menus and the items
890 appearing on the toolbar.
893 \begin_layout Subsection
894 Files you don't want to modify
897 \begin_layout Standard
898 These files are used internally by LyX and you generally do not need to
899 modify them unless you are a developer.
902 \begin_layout Labeling
903 \labelwidthstring 00.00.0000
904 \begin_inset Flex CharStyle:Code
907 \begin_layout Plain Layout
913 this file contains the list of LyX developers.
914 The contents are displayed with the menu entry
915 \begin_inset Flex CharStyle:MenuItem
918 \begin_layout Plain Layout
919 Help\SpecialChar \menuseparator
932 \begin_layout Labeling
933 \labelwidthstring 00.00.0000
934 \begin_inset Flex CharStyle:Code
937 \begin_layout Plain Layout
948 script used during the configuration process.
952 \begin_layout Labeling
953 \labelwidthstring 00.00.0000
954 \begin_inset Flex CharStyle:Code
957 \begin_layout Plain Layout
964 this is the script that is used to re-configure LyX.
965 It creates configuration files in the directory it was run from.
968 \begin_layout Subsection
969 Other files needing a line or two...
972 \begin_layout Labeling
973 \labelwidthstring 00.00.0000
974 \begin_inset Flex CharStyle:Code
977 \begin_layout Plain Layout
984 this contains tables describing how different character
986 can be mapped to Unicode
989 \begin_layout Labeling
990 \labelwidthstring 00.00.0000
991 \begin_inset Flex CharStyle:Code
994 \begin_layout Plain Layout
1000 this file contains the templates available to the new
1001 \begin_inset Flex CharStyle:MenuItem
1004 \begin_layout Plain Layout
1006 \begin_inset space ~
1017 \begin_layout Labeling
1018 \labelwidthstring 00.00.0000
1019 \begin_inset Flex CharStyle:Code
1022 \begin_layout Plain Layout
1028 this file contains a list of all the languages currently supported by LyX.
1031 \begin_layout Section
1032 Your local configuration directory
1035 \begin_layout Standard
1036 Even if you are using LyX as an unprivileged user, you might want to change
1037 LyX configuration for your own use.
1039 \begin_inset Flex CharStyle:Code
1042 \begin_layout Plain Layout
1049 directory contains all your personal configuration files.
1050 This is the directory described as
1051 \begin_inset Quotes eld
1055 \begin_inset Quotes erd
1059 \begin_inset Flex CharStyle:MenuItem
1062 \begin_layout Plain Layout
1063 Help\SpecialChar \menuseparator
1065 \begin_inset space ~
1074 This directory is used as a mirror of
1075 \begin_inset Flex CharStyle:Code
1078 \begin_layout Plain Layout
1085 , which means that every file in
1086 \begin_inset Flex CharStyle:Code
1089 \begin_layout Plain Layout
1096 is a replacement for the corresponding file in
1097 \begin_inset Flex CharStyle:Code
1100 \begin_layout Plain Layout
1108 Any configuration file described in the above sections can be placed either
1109 in the system-wide directory, in which case it will affect all users, or
1110 in your local directory for your own use.
1113 \begin_layout Standard
1114 To make things clearer, let's provide a few examples:
1117 \begin_layout Itemize
1118 The preferences set in the
1119 \begin_inset Flex CharStyle:MenuItem
1122 \begin_layout Plain Layout
1123 Tools\SpecialChar \menuseparator
1129 dialog are saved to a file
1130 \begin_inset Flex CharStyle:Code
1133 \begin_layout Plain Layout
1140 \begin_inset Flex CharStyle:Code
1143 \begin_layout Plain Layout
1153 \begin_layout Itemize
1154 When you reconfigure using
1155 \begin_inset Flex CharStyle:MenuItem
1158 \begin_layout Plain Layout
1159 Tools\SpecialChar \menuseparator
1166 \begin_inset Flex CharStyle:Code
1169 \begin_layout Plain Layout
1176 script, and the resulting files are written in your local configuration
1178 This means that any additional text class file that you might have added
1180 \begin_inset Flex CharStyle:Code
1183 \begin_layout Plain Layout
1191 will be added to the list of classes in the
1192 \begin_inset Flex CharStyle:MenuItem
1195 \begin_layout Plain Layout
1196 Document\SpecialChar \menuseparator
1205 \begin_layout Itemize
1206 If you get some updated documentation from LyX ftp site and cannot install
1207 it because you do not have sysadmin rights on your system, you can just
1209 \begin_inset Flex CharStyle:Code
1212 \begin_layout Plain Layout
1220 and the items in the
1221 \begin_inset Flex CharStyle:MenuItem
1224 \begin_layout Plain Layout
1230 menu will open them!
1233 \begin_layout Section
1234 Running LyX with multiple configurations
1237 \begin_layout Standard
1238 The configuration freedom of the local configuration directory may not suffice
1239 if you want to have more than one configuration at your disposal.
1240 For example, you may want to be use different key bindings or printer settings
1242 You can achieve this by having several such directories.
1243 You then specify which directory to use at run-time.
1246 \begin_layout Standard
1247 Invoking LyX with the command line switch
1248 \begin_inset Flex CharStyle:Code
1251 \begin_layout Plain Layout
1262 instructs the program to read the configuration from that directory, and
1263 not from the default directory.
1264 (You can determine the default directory by running LyX without the
1265 \begin_inset Flex CharStyle:Code
1268 \begin_layout Plain Layout
1275 switch.) If the specified directory does not exist, LyX offers to create
1276 it for you, just like it does for the default directory on the first time
1277 you run the program.
1278 You can modify the configuration options in this additional user directory
1279 exactly as you would for the default directory.
1280 These directories are completely independent (but read on).
1281 Note that setting the environment variable
1282 \begin_inset Flex CharStyle:Code
1285 \begin_layout Plain Layout
1294 to some value has exactly the same effect.
1297 \begin_layout Standard
1298 Having several configurations also requires more maintenance: if you want
1299 to add a new layout to
1300 \begin_inset Flex CharStyle:Code
1303 \begin_layout Plain Layout
1311 which you want available from all your configurations, you must add it
1312 to each directory separately.
1313 You can avoid this with the following trick: after LyX creates the additional
1314 directory, most of the
1316 (see above) are empty.
1317 If you want the new configuration to mirror an existing one, replace the
1320 with a symbolic link to the matching
1322 in the existing configuration.
1324 \begin_inset Flex CharStyle:Code
1327 \begin_layout Plain Layout
1335 , however, since it contains a file written by the configuration script
1336 (also accessible through
1337 \begin_inset Flex CharStyle:MenuItem
1340 \begin_layout Plain Layout
1341 Tools\SpecialChar \menuseparator
1347 ) which is configuration-specific.
1350 \begin_layout Chapter
1351 The Preferences dialog
1354 \begin_layout Standard
1355 All options of the preferences dialog are described in the Appendix
1357 The Preferences Dialog
1364 For some options you might find here more details.
1367 \begin_layout Section
1369 \begin_inset CommandInset label
1378 \begin_layout Standard
1379 The first step is to define your file formats if they are not already defined.
1381 \begin_inset Flex CharStyle:MenuItem
1384 \begin_layout Plain Layout
1385 Tools\SpecialChar \menuseparator
1393 \begin_inset Flex CharStyle:MenuItem
1396 \begin_layout Plain Layout
1397 File Handling\SpecialChar \menuseparator
1404 \begin_inset Flex CharStyle:MenuItem
1407 \begin_layout Plain Layout
1408 New\SpecialChar \ldots{}
1414 button to define your new format.
1416 \begin_inset Flex CharStyle:MenuItem
1419 \begin_layout Plain Layout
1425 field contains the name used to identify the format in the GUI.
1427 \begin_inset Flex CharStyle:MenuItem
1430 \begin_layout Plain Layout
1436 is used to identify the format internally.
1437 You will also need to enter a file extension.
1438 These are all required.
1440 \begin_inset Flex CharStyle:MenuItem
1443 \begin_layout Plain Layout
1449 field is used to provide a keyboard shortcut on the menus.
1450 (For example, pressing
1451 \begin_inset Flex CharStyle:MenuItem
1454 \begin_layout Plain Layout
1461 \begin_inset Flex CharStyle:MenuItem
1464 \begin_layout Plain Layout
1465 View\SpecialChar \menuseparator
1474 \begin_layout Standard
1476 \begin_inset Flex CharStyle:MenuItem
1479 \begin_layout Plain Layout
1486 \begin_inset Flex CharStyle:MenuItem
1489 \begin_layout Plain Layout
1496 For example, you might want to use
1497 \begin_inset Flex CharStyle:MenuItem
1500 \begin_layout Plain Layout
1507 to view PostScript files.
1508 You can enter the command needed to start the program in the corresponding
1510 In defining this command, you can use the four variables listed in the
1512 The viewer is launched when you view an image in LyX or use the
1513 \begin_inset Flex CharStyle:MenuItem
1516 \begin_layout Plain Layout
1523 The editor is for example launched when you right-click on an image and
1525 \begin_inset Flex CharStyle:MenuItem
1528 \begin_layout Plain Layout
1534 in the appearing context menu.
1537 \begin_layout Standard
1539 \begin_inset Flex CharStyle:MenuItem
1542 \begin_layout Plain Layout
1548 option tells LyX that a format is suitable for document export.
1549 If this is set and if a suitable conversion route exists (see sec.
1550 \begin_inset space \thinspace{}
1554 \begin_inset CommandInset ref
1556 reference "sec:Converters"
1560 ), the format will appear in the
1561 \begin_inset Flex CharStyle:MenuItem
1564 \begin_layout Plain Layout
1565 File\SpecialChar \menuseparator
1572 The format will also appear in the
1573 \begin_inset Flex CharStyle:MenuItem
1576 \begin_layout Plain Layout
1582 menu if a viewer is specified for the format.
1583 Pure image formats, such as
1584 \begin_inset Flex CharStyle:Code
1587 \begin_layout Plain Layout
1594 , should not use this option.
1595 Formats that can both represent vector graphics and documents like
1596 \begin_inset Flex CharStyle:Code
1599 \begin_layout Plain Layout
1609 \begin_layout Standard
1611 \begin_inset Flex CharStyle:MenuItem
1614 \begin_layout Plain Layout
1615 Vector graphics format
1620 tells LyX that a format can contain vector graphics.
1621 This information is used to determine the target format of included graphics
1623 \begin_inset Flex CharStyle:MenuItem
1626 \begin_layout Plain Layout
1634 Included graphics may need to be converted to either
1635 \begin_inset Flex CharStyle:MenuItem
1638 \begin_layout Plain Layout
1646 \begin_inset Flex CharStyle:MenuItem
1649 \begin_layout Plain Layout
1657 \begin_inset Flex CharStyle:MenuItem
1660 \begin_layout Plain Layout
1668 \begin_inset Flex CharStyle:MenuItem
1671 \begin_layout Plain Layout
1678 cannot handle other image formats.
1679 If an included graphic is not already in
1680 \begin_inset Flex CharStyle:MenuItem
1683 \begin_layout Plain Layout
1691 \begin_inset Flex CharStyle:MenuItem
1694 \begin_layout Plain Layout
1702 \begin_inset Flex CharStyle:MenuItem
1705 \begin_layout Plain Layout
1712 format, it is converted to
1713 \begin_inset Flex CharStyle:MenuItem
1716 \begin_layout Plain Layout
1723 if the vector format option is set, and otherwise to
1724 \begin_inset Flex CharStyle:MenuItem
1727 \begin_layout Plain Layout
1737 \begin_layout Section
1741 \begin_layout Standard
1742 Since all conversions from one format to another take place in LyX's temporary
1743 directory, it is sometimes necessary to modify a file before copying it
1744 to the temporary directory in order that the conversion may be performed.
1748 \begin_layout Plain Layout
1749 For example, the file may refer to other files—images, for example—using
1750 relative file names, and these may become invalid when the file is copied
1751 to the temporary directory.
1756 This is done by a Copier: It copies a file to (or from) the temporary directory
1757 and may modify it in the process.
1760 \begin_layout Standard
1761 The definitions of the copiers may use four variables:
1764 \begin_layout Labeling
1765 \labelwidthstring 00.00.0000
1766 \begin_inset Flex CharStyle:Code
1769 \begin_layout Plain Layout
1775 The LyX system directory (e.
1776 \begin_inset space \thinspace{}
1780 \begin_inset space \space{}
1784 \begin_inset Flex CharStyle:MenuItem
1787 \begin_layout Plain Layout
1796 \begin_layout Labeling
1797 \labelwidthstring 00.00.0000
1798 \begin_inset Flex CharStyle:Code
1801 \begin_layout Plain Layout
1810 \begin_layout Labeling
1811 \labelwidthstring 00.00.0000
1812 \begin_inset Flex CharStyle:Code
1815 \begin_layout Plain Layout
1824 \begin_layout Labeling
1825 \labelwidthstring 00.00.0000
1826 \begin_inset Flex CharStyle:Code
1829 \begin_layout Plain Layout
1841 \begin_layout Standard
1842 The latter should be the
1844 as it would be used in a
1853 It is relevant only when exporting files suitable for such inclusion.
1856 \begin_layout Standard
1857 Copiers can be used to do almost anything with output files.
1858 For example, suppose you want generated
1860 files to be copied to a special directory,
1861 \begin_inset Flex CharStyle:Code
1864 \begin_layout Plain Layout
1873 Then you could write a shell script such as this one:
1876 \begin_layout Standard
1877 \begin_inset listings
1881 \begin_layout Plain Layout
1886 \begin_layout Plain Layout
1891 \begin_layout Plain Layout
1893 TOFILE=`basename $2`
1896 \begin_layout Plain Layout
1898 cp $FROMFILE /home/you/pdf/$TOFILE
1903 Save it in your local LyX directory—say,
1904 \begin_inset Flex CharStyle:Code
1907 \begin_layout Plain Layout
1908 /home/you/.lyx/scripts/
1915 —and make it executable, if you need to do so on your platform.
1917 \begin_inset Flex CharStyle:MenuItem
1920 \begin_layout Plain Layout
1921 Tools\SpecialChar \menuseparator
1927 dialog, select under
1928 \begin_inset Flex CharStyle:MenuItem
1931 \begin_layout Plain Layout
1932 File Handling\SpecialChar \menuseparator
1939 \begin_inset Flex CharStyle:MenuItem
1942 \begin_layout Plain Layout
1952 format—or one of the other
1955 \begin_inset Flex CharStyle:Code
1958 \begin_layout Plain Layout
1967 \begin_inset Flex CharStyle:MenuItem
1970 \begin_layout Plain Layout
1980 \begin_layout Standard
1981 Copiers are used by LyX in various of its own conversions.
1982 For example, if appropriate programs are found, LyX will automatically
1983 install copiers for the
1984 \begin_inset Flex CharStyle:MenuItem
1987 \begin_layout Plain Layout
1994 \begin_inset Flex CharStyle:MenuItem
1997 \begin_layout Plain Layout
1999 \begin_inset space ~
2008 When these formats are exported, the copier sees that not just the main
2009 HTML file but various associated files (style files, images, etc.) are also
2011 All these files are written to a
2013 of the directory in which the original LyX file was found.
2017 \begin_layout Plain Layout
2018 This copier can be customized.
2020 \begin_inset Quotes eld
2024 \begin_inset Quotes erd
2027 argument takes a comma-separated list of extensions to be copied; if it
2028 is omitted, all files will be copied.
2030 \begin_inset Quotes eld
2034 \begin_inset Quotes erd
2037 argument determines the extension added to the generated directory.
2039 \begin_inset Quotes eld
2043 \begin_inset Flex CharStyle:MenuItem
2046 \begin_layout Plain Layout
2054 \begin_inset Quotes erd
2057 , so HTML generated from
2058 \begin_inset Flex CharStyle:MenuItem
2061 \begin_layout Plain Layout
2070 \begin_inset Flex CharStyle:MenuItem
2073 \begin_layout Plain Layout
2093 \begin_layout Section
2095 \begin_inset CommandInset label
2097 name "sec:Converters"
2104 \begin_layout Standard
2105 You can define your own Converters to convert files between different formats.
2107 \begin_inset Flex CharStyle:MenuItem
2110 \begin_layout Plain Layout
2111 Tools\SpecialChar \menuseparator
2112 Preferences\SpecialChar \menuseparator
2113 File Handling\SpecialChar \menuseparator
2122 \begin_layout Standard
2123 To define a new converter, select the
2124 \begin_inset Flex CharStyle:MenuItem
2127 \begin_layout Plain Layout
2129 \begin_inset space ~
2138 \begin_inset Flex CharStyle:MenuItem
2141 \begin_layout Plain Layout
2143 \begin_inset space ~
2151 from the drop-down lists, enter the command needed for the conversion,
2153 \begin_inset Flex CharStyle:MenuItem
2156 \begin_layout Plain Layout
2163 Several variables can be used in the definition of converters:
2166 \begin_layout Labeling
2167 \labelwidthstring 00.00.0000
2168 \begin_inset Flex CharStyle:Code
2171 \begin_layout Plain Layout
2177 The LyX system directory
2180 \begin_layout Labeling
2181 \labelwidthstring 00.00.0000
2182 \begin_inset Flex CharStyle:Code
2185 \begin_layout Plain Layout
2194 \begin_layout Labeling
2195 \labelwidthstring 00.00.0000
2196 \begin_inset Flex CharStyle:Code
2199 \begin_layout Plain Layout
2208 \begin_layout Labeling
2209 \labelwidthstring 00.00.0000
2210 \begin_inset Flex CharStyle:Code
2213 \begin_layout Plain Layout
2221 of the input file (i.
2222 \begin_inset space \thinspace{}
2225 g., without the extension)
2228 \begin_layout Labeling
2229 \labelwidthstring 00.00.0000
2230 \begin_inset Flex CharStyle:Code
2233 \begin_layout Plain Layout
2239 The path to the input file
2242 \begin_layout Labeling
2243 \labelwidthstring 00.00.0000
2244 \begin_inset Flex CharStyle:Code
2247 \begin_layout Plain Layout
2253 The path to the original input file (this is different from $$p when a
2254 chain of converters is called).
2257 \begin_layout Standard
2259 \begin_inset Flex CharStyle:MenuItem
2262 \begin_layout Plain Layout
2264 \begin_inset space ~
2272 field you can enter the following flags, separated by commas:
2275 \begin_layout Labeling
2276 \labelwidthstring 00.00.0000
2277 \begin_inset Flex CharStyle:Code
2280 \begin_layout Plain Layout
2286 This converter runs some form of
2289 This will make LyX's
2291 error logs available.
2294 \begin_layout Labeling
2295 \labelwidthstring 00.00.0000
2296 \begin_inset Flex CharStyle:Code
2299 \begin_layout Plain Layout
2309 \begin_inset Flex CharStyle:MenuItem
2312 \begin_layout Plain Layout
2318 file for the conversion.
2321 \begin_layout Labeling
2322 \labelwidthstring 00.00.0000
2323 \begin_inset Flex CharStyle:Code
2326 \begin_layout Plain Layout
2336 \begin_layout Standard
2337 The following three flags are not really flags at all because they take
2339 \begin_inset Flex CharStyle:MenuItem
2342 \begin_layout Plain Layout
2344 \begin_inset space ~
2348 \begin_inset space ~
2359 \begin_layout Labeling
2360 \labelwidthstring 00.00.0000
2361 \begin_inset Flex CharStyle:Code
2364 \begin_layout Plain Layout
2371 If set, the converter's standard error will be redirected to a file
2372 \begin_inset Flex CharStyle:Code
2375 \begin_layout Plain Layout
2383 , and the script given as argument will be run as:
2384 \begin_inset Flex CharStyle:Code
2387 \begin_layout Plain Layout
2398 The argument may contain
2399 \begin_inset Flex CharStyle:Code
2402 \begin_layout Plain Layout
2411 \begin_layout Labeling
2412 \labelwidthstring 00.00.0000
2413 \begin_inset Flex CharStyle:Code
2416 \begin_layout Plain Layout
2423 The name of the directory in which the converter will dump the generated
2425 LyX will not create this directory, and it does not copy anything into
2426 it, though it will copy this directory to the destination.
2427 The argument may contain
2428 \begin_inset Flex CharStyle:Code
2431 \begin_layout Plain Layout
2437 , which will be replaced by the base name of the input and output files,
2438 respectively, when the directory is copied.
2439 \begin_inset Newline newline
2446 make no sense together.
2447 The latter will be ignored if the former is given.
2450 \begin_layout Labeling
2451 \labelwidthstring 00.00.0000
2452 \begin_inset Flex CharStyle:Code
2455 \begin_layout Plain Layout
2462 Determines the output file name and may, contain
2463 \begin_inset Flex CharStyle:Code
2466 \begin_layout Plain Layout
2475 and optional even then; if not given, it defaults to `
2480 \begin_layout Standard
2481 None of these last three are presently used in any of the converters that
2482 are installed with LyX.
2486 \begin_layout Standard
2487 You do not have to define converters for all formats between which you want
2489 For example, you will note that there is no `LyX to
2491 converter, but LyX will export PostScript.
2492 It does so by first creating a
2494 file (no converter needs to be defined for this) which is then converted
2499 converter, and finally converting the resulting DVI file to PostScript.
2502 of converters automatically, and it will always choose the shortest possible
2504 You can, though, still define multiple conversion methods between file
2506 For example, the standard LyX configuration provides three ways to convert
2512 \begin_inset Flex CharStyle:MenuItem
2515 \begin_layout Plain Layout
2522 ; via (DVI and) PostScript, using
2523 \begin_inset Flex CharStyle:MenuItem
2526 \begin_layout Plain Layout
2534 \begin_inset Flex CharStyle:MenuItem
2537 \begin_layout Plain Layout
2545 To define such alternate chains, you must define multiple target `file
2548 , as described in section
2549 \begin_inset CommandInset ref
2551 reference "sec:Formats"
2556 For example, in the standard configuration, the formats named
2557 \begin_inset Flex CharStyle:MenuItem
2560 \begin_layout Plain Layout
2568 \begin_inset Flex CharStyle:MenuItem
2571 \begin_layout Plain Layout
2579 \begin_inset Flex CharStyle:MenuItem
2582 \begin_layout Plain Layout
2589 are defined, all of which share the extension
2590 \begin_inset Flex CharStyle:MenuItem
2593 \begin_layout Plain Layout
2600 , and which correspond to the conversion methods just mentioned.
2603 \begin_layout Chapter
2604 Internationalizing LyX
2605 \begin_inset CommandInset label
2607 name "cha:Internationalizing-LyX"
2614 \begin_layout Standard
2615 LyX supports using a translated interface.
2616 Last time we checked, LyX provided text in thirty languages.
2617 The language of choice is called your
2622 (For further reading on locale settings, see also the documentation for
2623 locale that comes with your operating system.
2624 For Linux, the manual page for
2625 \begin_inset Flex CharStyle:Code
2628 \begin_layout Plain Layout
2634 could be a good place to start).
2637 \begin_layout Standard
2638 Notice that these translations will work, but do contain a few flaws.
2639 In particular, all dialogs have been designed with the English text in
2640 mind, which means that some of the translated text will be too large to
2641 fit within the space allocated.
2642 This is only a display problem and will not cause any harm.
2643 Also, you will find that some of the translations do not define shortcut
2644 keys for everything.
2645 Sometimes, there are simply not enough free letters to do it.
2646 Other times, the translator just hasn't got around to doing it yet.
2647 Our localization team, which you may wish to join,
2651 \begin_layout Plain Layout
2652 If you are a fluent speaker of a language other than English, joining these
2653 teams is a great way to give back to the LyX community!
2658 will of course try to fix these shortcomings in future versions of LyX.
2661 \begin_layout Section
2665 \begin_layout Subsection
2666 Translating the graphical user interface (text messages).
2669 \begin_layout Standard
2671 \begin_inset Flex CharStyle:Code
2674 \begin_layout Plain Layout
2681 library to handle the internationalization of the interface.
2682 To have LyX speak your favorite language in all menus and dialogs, you
2684 \begin_inset Flex CharStyle:Code
2687 \begin_layout Plain Layout
2694 -file for that language.
2695 When this is available, you'll have to generate a
2696 \begin_inset Flex CharStyle:Code
2699 \begin_layout Plain Layout
2705 -file from it and install the
2706 \begin_inset Flex CharStyle:Code
2709 \begin_layout Plain Layout
2716 The process of doing all of this is explained in the documentation for
2718 \begin_inset Flex CharStyle:Code
2721 \begin_layout Plain Layout
2729 It is possible to do this just for yourself, but if you're going to do
2730 it, you might as well share the results of your labors with the rest of
2732 Send a message to the LyX
2734 list for more information about how to proceed.
2737 \begin_layout Standard
2738 In short, this is what you should do (xx denotes the language code):
2741 \begin_layout Itemize
2742 Check out the LyX source code.
2744 \begin_inset CommandInset href
2746 name "information on the web"
2747 target "http://www.lyx.org/devel/cvs.php"
2754 \begin_layout Itemize
2756 \begin_inset Flex CharStyle:Code
2759 \begin_layout Plain Layout
2765 to the folder of the
2766 \begin_inset Flex CharStyle:Code
2769 \begin_layout Plain Layout
2778 \begin_inset Flex CharStyle:Code
2781 \begin_layout Plain Layout
2790 \begin_inset Flex CharStyle:Code
2793 \begin_layout Plain Layout
2799 doesn't exist anywhere, it can be remade with the console command
2800 \begin_inset Flex CharStyle:Code
2803 \begin_layout Plain Layout
2809 in that directory, or you can use an existing
2811 -file for some other language as a template).
2814 \begin_layout Itemize
2816 \begin_inset Flex CharStyle:Code
2819 \begin_layout Plain Layout
2830 \begin_layout Plain Layout
2831 This is just a text file, so it can be edited in any text editor.
2832 But there are also specialized programs that support such editing, such
2837 (for all platforms) or
2851 \begin_inset Flex CharStyle:Code
2854 \begin_layout Plain Layout
2866 For some menu- and widget-labels, there are also shortcut keys that should
2868 Those keys are marked after a `|', and should be translated according to
2869 the words and phrases of the language.
2870 You should also fill also out the information at the beginning of the new
2872 \begin_inset Flex CharStyle:Code
2875 \begin_layout Plain Layout
2882 -file with your email-address, etc., so people know where to reach you with
2883 suggestions and entertaining flames.
2886 \begin_layout Standard
2887 If you are just doing this on your own, then:
2890 \begin_layout Itemize
2892 \begin_inset Flex CharStyle:Code
2895 \begin_layout Plain Layout
2902 This can be done with
2903 \begin_inset Flex CharStyle:Code
2906 \begin_layout Plain Layout
2918 \begin_layout Itemize
2920 \begin_inset Flex CharStyle:Code
2923 \begin_layout Plain Layout
2929 -file to your locale-tree, at the correct directory for application messages
2934 xx, and under the name
2935 \begin_inset Flex CharStyle:Code
2938 \begin_layout Plain Layout
2945 \begin_inset space \thinspace{}
2949 \begin_inset space \space{}
2953 \begin_inset Flex CharStyle:Code
2956 \begin_layout Plain Layout
2957 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2967 \begin_layout Standard
2968 As said, however, it would be best if the new
2969 \begin_inset Flex CharStyle:Code
2972 \begin_layout Plain Layout
2979 -file could be added to the LyX distribution, so others can use it.
2980 Adding it involves making additional changes to LyX.
2981 So send an email to the
2983 mailing list if you're interested in doing that.
2986 \begin_layout Subsubsection
2990 \begin_layout Standard
2991 Sometimes it turns out that one English message needs to be translated into
2992 different messages in the target language.
2993 One example is the message
2994 \begin_inset Flex CharStyle:Code
2997 \begin_layout Plain Layout
3003 which has the German translation
3011 , depending upon exactly what the English
3012 \begin_inset Quotes eld
3016 \begin_inset Quotes erd
3021 \begin_inset Flex CharStyle:Code
3024 \begin_layout Plain Layout
3031 does not handle such ambiguous translations.
3032 Therefore you have to add some context information to the message: Instead
3034 \begin_inset Flex CharStyle:Code
3037 \begin_layout Plain Layout
3044 \begin_inset Flex CharStyle:Code
3047 \begin_layout Plain Layout
3058 \begin_inset Flex CharStyle:Code
3061 \begin_layout Plain Layout
3071 Now the two occurrences of
3072 \begin_inset Flex CharStyle:Code
3075 \begin_layout Plain Layout
3082 \begin_inset Flex CharStyle:Code
3085 \begin_layout Plain Layout
3092 and can be translated correctly to
3103 \begin_layout Standard
3104 Of course the context information needs to be stripped off the original
3105 message when no translation is used.
3106 Therefore you have to put it in double square brackets at the end of the
3107 message (see the example above).
3108 The translation mechanism of LyX ensures that everything in double square
3109 brackets at the end of messages is removed before displaying the message.
3112 \begin_layout Subsection
3113 Translating the documentation.
3116 \begin_layout Standard
3117 The online documentation (in the
3118 \begin_inset Flex CharStyle:MenuItem
3121 \begin_layout Plain Layout
3127 -menu) can (and should!) be translated.
3128 If there are translated versions of the documentation available
3132 \begin_layout Plain Layout
3133 As of March 2008, at least some of the documents have been translated into
3134 fourteen languages, with the Tutorial available in a few more.
3139 and the locale is set accordingly, these will be used automagically by
3141 LyX looks for translated versions as
3142 \begin_inset Flex CharStyle:Code
3145 \begin_layout Plain Layout
3146 LyXDir/doc/xx/DocName.lyx
3152 \begin_inset Flex CharStyle:Code
3155 \begin_layout Plain Layout
3161 is the code for the language currently in use.
3162 If there are no translated documents, the default English versions will
3164 Note that the translated versions must have the same filenames (
3165 \begin_inset Flex CharStyle:Code
3168 \begin_layout Plain Layout
3174 above) as the original.
3175 If you feel up to translating the documentation (an excellent way to proof-read
3176 the original documentation by the way!), there are a few things you should
3180 \begin_layout Itemize
3182 \begin_inset Flex CharStyle:Code
3185 \begin_layout Plain Layout
3191 , the guide to writing LyX documentation.
3192 Pay special attention to the translator's section.
3195 \begin_layout Itemize
3196 Check out the documentation translation web page at
3197 \begin_inset CommandInset href
3199 name "http://www.lyx.org/Translation"
3200 target "http://www.lyx.org/Translation"
3205 That way, you can find out which (if any) documents have already been translate
3206 d into your language.
3207 You can also find out who (if anyone) is organizing the effort to translate
3208 the documentation into your language.
3209 If no one is organizing the effort, please let us know that you're interested.
3212 \begin_layout Standard
3213 Once you get to actually translating, here's a few hints for you that may
3217 \begin_layout Itemize
3218 Join the documentation team! There is information on how to do that in
3219 \begin_inset Flex CharStyle:Code
3222 \begin_layout Plain Layout
3229 \begin_inset Flex CharStyle:MenuItem
3232 \begin_layout Plain Layout
3233 Help\SpecialChar \menuseparator
3243 ), which by the way is the first document you should translate.
3246 \begin_layout Itemize
3247 Learn the typographic conventions for the language you are translating to.
3248 Typography is an ancient art and over the centuries, a great variety of
3249 conventions have developed throughout different parts of the world.
3250 Also study the professional terminology amongst typographers in your country.
3251 Inventing your own terminology will only confuse the users.
3254 (Warning! Typography is addictive!)
3257 \begin_layout Itemize
3258 Make a copy of the document.
3259 This will be your working copy.
3260 You can use this as your personal translated help-file by placing it in
3262 \begin_inset Flex CharStyle:Code
3265 \begin_layout Plain Layout
3274 \begin_layout Itemize
3275 Sometimes the original document (from the LyX-team) will be updated.
3276 Use the source viewer at
3277 \begin_inset CommandInset href
3279 name "http://www.lyx.org/trac/timeline"
3280 target "http://www.lyx.org/trac/timeline"
3284 to see what has been changed.
3285 That way you can easily see which parts of the translated document need
3289 \begin_layout Standard
3290 If you ever find an error in the original document, fix it and notify the
3291 rest of the documentation team of the changes! (You didn't forget to join
3292 the documentation team, did you?)
3295 \begin_layout Standard
3296 \begin_inset Branch OutDated
3299 \begin_layout Section
3300 International Keyboard Support
3303 \begin_layout Standard
3306 [Editor's Note: The following section is by
3314 It needs to be fixed to conform to the new Documentation Style sheet and
3315 to make use of the new v1.0 features.
3316 The whole thing also needs to be merged with the section following it.-jw
3317 It may also be badly out of date.-rh (2008)]
3320 \begin_layout Subsection
3321 Defining Own Keymaps: Keymap File Format
3324 \begin_layout Standard
3325 Let's look at a keyboard definition file a little closer.
3326 It is a plain text file defining
3329 \begin_layout Itemize
3330 key-to-key or key-to-string translations
3333 \begin_layout Itemize
3337 \begin_layout Itemize
3338 dead keys exceptions
3341 \begin_layout Standard
3342 To define key-to-key or key-to-string translation, use this command:
3345 \begin_layout Quotation
3346 \begin_inset Flex CharStyle:Code
3349 \begin_layout Plain Layout
3358 \begin_inset Flex CharStyle:Code
3361 \begin_layout Plain Layout
3370 \begin_layout Standard
3372 \begin_inset Flex CharStyle:Code
3375 \begin_layout Plain Layout
3381 is the key to be translated and
3382 \begin_inset Flex CharStyle:Code
3385 \begin_layout Plain Layout
3391 is the string to be inserted into the document.
3392 To define dead keys, use:
3395 \begin_layout Quotation
3396 \begin_inset Flex CharStyle:Code
3399 \begin_layout Plain Layout
3408 \begin_inset Flex CharStyle:Code
3411 \begin_layout Plain Layout
3420 \begin_layout Standard
3422 \begin_inset Flex CharStyle:Code
3425 \begin_layout Plain Layout
3431 is a keyboard key and
3432 \begin_inset Flex CharStyle:Code
3435 \begin_layout Plain Layout
3442 The following dead keys are supported (shortcut name is in parentheses):
3445 \begin_layout Quotation
3449 \begin_inset space \hfill{}
3455 \begin_layout Quotation
3457 \begin_inset space \hfill{}
3463 \begin_layout Quotation
3465 \begin_inset space \hfill{}
3471 \begin_layout Quotation
3473 \begin_inset space \hfill{}
3479 \begin_layout Quotation
3481 \begin_inset space \hfill{}
3487 \begin_layout Quotation
3489 \begin_inset space \hfill{}
3496 \begin_layout Plain Layout
3508 \begin_layout Quotation
3510 \begin_inset space \hfill{}
3516 \begin_layout Quotation
3518 \begin_inset space \hfill{}
3525 \begin_layout Plain Layout
3537 \begin_layout Quotation
3539 \begin_inset space \hfill{}
3545 \begin_layout Quotation
3547 \begin_inset space \hfill{}
3553 \begin_layout Quotation
3555 \begin_inset space \hfill{}
3562 \begin_layout Plain Layout
3574 \begin_layout Quotation
3576 \begin_inset space \hfill{}
3583 \begin_layout Plain Layout
3595 \begin_layout Quotation
3597 \begin_inset space \hfill{}
3603 \begin_layout Quotation
3604 hungarian umlaut (hug)
3605 \begin_inset space \hfill{}
3611 \begin_layout Quotation
3613 \begin_inset space \hfill{}
3619 \begin_layout Quotation
3621 \begin_inset space \hfill{}
3628 \begin_layout Plain Layout
3640 \begin_layout Standard
3641 Since in many international keyboards there are exceptions to what some
3642 dead keys should do, you can define them using
3645 \begin_layout Quotation
3646 \begin_inset Flex CharStyle:Code
3649 \begin_layout Plain Layout
3657 deadkey key outstring
3660 \begin_layout Standard
3661 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3665 \begin_layout Quotation
3666 \begin_inset Flex CharStyle:Code
3669 \begin_layout Plain Layout
3682 \begin_layout Standard
3683 to make it work correctly.
3684 Also, you have to define as exceptions dead keys over i and j, to remove
3685 the dot from them before inserting an accent mark.
3686 I will change this when the time comes, but so far I haven't had time.
3689 \begin_layout Standard
3690 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3693 \begin_inset Flex CharStyle:Code
3696 \begin_layout Plain Layout
3702 have different meaning.
3704 \begin_inset Flex CharStyle:Code
3707 \begin_layout Plain Layout
3713 marks comments, quotes start and end LaTeX-style commands.
3714 To enter quote, you'll need to use
3715 \begin_inset Flex CharStyle:Code
3718 \begin_layout Plain Layout
3727 \begin_inset Flex CharStyle:Code
3730 \begin_layout Plain Layout
3737 \begin_inset Flex CharStyle:Code
3740 \begin_layout Plain Layout
3751 \begin_layout Standard
3752 If you make a keyboard description file that works for your language, please
3753 mail it to me, so I can include it in the next keymap distribution.
3756 \begin_layout Standard
3757 More keywords will be supported in keymap configuration file in future,
3761 \begin_layout Itemize
3762 \begin_inset Flex CharStyle:Code
3765 \begin_layout Plain Layout
3776 \begin_inset space \hfill{}
3780 \begin_inset Flex CharStyle:Code
3783 \begin_layout Plain Layout
3792 \begin_layout Itemize
3793 \begin_inset Flex CharStyle:Code
3796 \begin_layout Plain Layout
3807 \begin_inset space \hfill{}
3811 \begin_inset Flex CharStyle:Code
3814 \begin_layout Plain Layout
3820 an external keymap translation program
3823 \begin_layout Standard
3824 Also, it should look into
3825 \begin_inset Flex CharStyle:Code
3828 \begin_layout Plain Layout
3834 file for defaults, too (for example, a
3835 \begin_inset Flex CharStyle:Code
3838 \begin_layout Plain Layout
3846 option to include default keyboard).
3854 \begin_layout Section
3855 International Keymap Stuff
3856 \begin_inset CommandInset label
3858 name "sec:International-Keymap-Stuff"
3865 \begin_layout Standard
3866 \begin_inset Note Note
3869 \begin_layout Plain Layout
3870 In doing the revisions on this document in March 2008, I did not look over
3871 this stuff, as I do not understand it.
3872 It would be good if someone else could do so.
3881 \begin_layout Standard
3882 The next two sections describe the
3883 \begin_inset Flex CharStyle:Code
3886 \begin_layout Plain Layout
3895 \begin_inset Flex CharStyle:Code
3898 \begin_layout Plain Layout
3906 file syntax in detail.
3907 These sections should help you design your own key map if the ones provided
3908 do not meet your needs.
3911 \begin_layout Subsection
3915 \begin_layout Standard
3919 \begin_inset Flex CharStyle:Code
3922 \begin_layout Plain Layout
3928 file maps keystrokes to characters or strings.
3929 As the name suggests, it sets a keyboard mapping.
3931 \begin_inset Flex CharStyle:Code
3934 \begin_layout Plain Layout
3945 \begin_inset Flex CharStyle:Code
3948 \begin_layout Plain Layout
3963 \begin_inset Flex CharStyle:Code
3966 \begin_layout Plain Layout
3979 \begin_inset Flex CharStyle:Code
3982 \begin_layout Plain Layout
3991 \begin_inset Flex CharStyle:Code
3994 \begin_layout Plain Layout
4002 are described in this section.
4005 \begin_layout Labeling
4006 \labelwidthstring 00.00.0000
4007 \begin_inset Flex CharStyle:Code
4010 \begin_layout Plain Layout
4018 Map a character to a string
4021 \begin_layout LyX-Code
4036 \begin_layout Standard
4069 the double-quote (")
4086 must be escaped with a preceding backslash (
4097 \begin_layout Standard
4099 \begin_inset Flex CharStyle:MenuItem
4102 \begin_layout Plain Layout
4110 statement to cause the symbol
4111 \begin_inset Flex CharStyle:MenuItem
4114 \begin_layout Plain Layout
4122 to be output for the keystroke
4123 \begin_inset Flex CharStyle:MenuItem
4126 \begin_layout Plain Layout
4137 \begin_layout LyX-Code
4143 \begin_layout Labeling
4144 \labelwidthstring 00.00.0000
4145 \begin_inset Flex CharStyle:Code
4148 \begin_layout Plain Layout
4156 Specify an accent character
4159 \begin_layout LyX-Code
4168 \begin_layout Standard
4169 This will make the cha
4207 This is the dead key
4211 \begin_layout Plain Layout
4218 refers to a key that does not produce a character by itself, but when followed
4219 with another key, produces the desired accent character.
4220 For example, a German characte
4222 r with an umlaut like
4232 can be produced in this manner.
4241 \begin_layout Standard
4254 and then another key not in
4271 followed by the other, not allowed key, as output.
4275 \begin_inset Flex CharStyle:MenuItem
4278 \begin_layout Plain Layout
4286 cancels a dead key, so if
4297 \begin_inset Flex CharStyle:MenuItem
4300 \begin_layout Plain Layout
4309 , the cursor will not go one position backwards but will instead cancel
4325 might have had on the next keystroke.
4329 \begin_layout Standard
4330 The following example specifies that the character ' is to be an acute accent,
4331 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4334 \begin_layout LyX-Code
4337 kmod ' acute aeiouAEIOU
4340 \begin_layout Labeling
4341 \labelwidthstring 00.00.0000
4342 \begin_inset Flex CharStyle:Code
4345 \begin_layout Plain Layout
4351 Specify an exception to the accent character
4354 \begin_layout LyX-Code
4363 \begin_layout Standard
4364 This defines an exce
4405 have been assigned a keystroke with a previous
4408 \begin_inset Flex CharStyle:Code
4411 \begin_layout Plain Layout
4435 must not belong in the
4482 If such a declaration does not exist in
4490 \begin_inset Flex CharStyle:Code
4493 \begin_layout Plain Layout
4527 \begin_inset Flex CharStyle:Code
4530 \begin_layout Plain Layout
4544 \begin_layout Standard
4545 The following command produces causes äi to be produced when you enter acute-i
4549 \begin_layout LyX-Code
4563 \begin_layout Labeling
4564 \labelwidthstring 00.00.0000
4565 \begin_inset Flex CharStyle:Code
4568 \begin_layout Plain Layout
4574 Combine two accent characters
4577 \begin_layout LyX-Code
4583 accent1 accent2 allowed
4586 \begin_layout Standard
4587 This one is getting pretty esoteric.
4588 It allows you to combine the effect
4644 \begin_inset Flex CharStyle:Code
4647 \begin_layout Plain Layout
4675 \begin_layout Standard
4676 Consider this example from the
4677 \begin_inset Flex CharStyle:Code
4680 \begin_layout Plain Layout
4691 \begin_layout LyX-Code
4694 kmod ; acute aeioyvhAEIOYVH
4698 kcomb acute umlaut iyIY
4701 \begin_layout Standard
4702 This allows you to press
4703 \begin_inset Flex CharStyle:MenuItem
4706 \begin_layout Plain Layout
4714 and get the effect of
4715 \begin_inset Flex CharStyle:Code
4718 \begin_layout Plain Layout
4737 in this case cancels the last dead key, so if you press
4738 \begin_inset Flex CharStyle:MenuItem
4741 \begin_layout Plain Layout
4750 \begin_inset Flex CharStyle:Code
4753 \begin_layout Plain Layout
4766 \begin_layout Subsection
4770 \begin_layout Standard
4772 \begin_inset Flex CharStyle:Code
4775 \begin_layout Plain Layout
4783 mapping is performed, a
4784 \begin_inset Flex CharStyle:Code
4787 \begin_layout Plain Layout
4797 file maps the strings that the symbols generate to characters in the current
4799 The LyX distribution currently includes at least the
4800 \begin_inset Flex CharStyle:Code
4803 \begin_layout Plain Layout
4812 \begin_inset Flex CharStyle:Code
4815 \begin_layout Plain Layout
4826 \begin_layout Standard
4828 \begin_inset Flex CharStyle:Code
4831 \begin_layout Plain Layout
4839 file is a sequence of declarations of the form
4842 \begin_layout LyX-Code
4855 \begin_layout Standard
4856 For example, in order to map
4857 \begin_inset Flex CharStyle:MenuItem
4860 \begin_layout Plain Layout
4870 to the corresponding character in the iso-8859-1 set (233), the following
4874 \begin_layout LyX-Code
4882 \begin_layout Standard
4884 \begin_inset Flex CharStyle:Code
4887 \begin_layout Plain Layout
4896 \begin_inset Flex CharStyle:Code
4899 \begin_layout Plain Layout
4917 the same character can apply to more than one string.
4919 \begin_inset Flex CharStyle:Code
4922 \begin_layout Plain Layout
4933 \begin_layout LyX-Code
4945 \begin_inset Newline newline
4961 \begin_layout Standard
4962 If LyX cannot find a mapping for the string produced by the keystroke or
4963 a deadkey sequence, it will check if it looks like an accented char and
4964 try to draw an accent over the character on screen.
4967 \begin_layout Subsection
4971 \begin_layout Standard
4972 There is a second way to add support for international characters through
4973 so-called dead-keys.
4974 A dead-key works in combination with a letter to produce an accented character.
4975 Here, we'll explain how to create a really simple dead-key to illustrate
4979 \begin_layout Standard
4980 Suppose you happen to need the circumflex character,
4981 \begin_inset Quotes eld
4985 \begin_inset Quotes erd
4990 \begin_inset Flex CharStyle:MenuItem
4993 \begin_layout Plain Layout
5000 \begin_inset space ~
5004 \begin_inset Flex CharStyle:MenuItem
5007 \begin_layout Plain Layout
5013 ] to the LyX command
5014 \begin_inset Flex CharStyle:Code
5017 \begin_layout Plain Layout
5024 \begin_inset Flex CharStyle:Code
5027 \begin_layout Plain Layout
5034 Now, whenever you type the
5035 \begin_inset Flex CharStyle:MenuItem
5038 \begin_layout Plain Layout
5044 -key followed by a letter, that letter will have a circumflex accent on
5046 For example, the sequence
5047 \begin_inset Quotes eld
5051 \begin_inset Flex CharStyle:MenuItem
5054 \begin_layout Plain Layout
5061 \begin_inset Quotes erd
5064 produces the letter:
5065 \begin_inset Quotes eld
5069 \begin_inset Quotes erd
5073 If you tried to type
5074 \begin_inset Quotes eld
5078 \begin_inset Flex CharStyle:MenuItem
5081 \begin_layout Plain Layout
5088 \begin_inset Quotes erd
5091 , however, LyX will complain with a beep, since a
5092 \begin_inset Quotes eld
5096 \begin_inset Flex CharStyle:MenuItem
5099 \begin_layout Plain Layout
5106 \begin_inset Quotes erd
5109 never takes a circumflex accent.
5111 \begin_inset Flex CharStyle:MenuItem
5114 \begin_layout Plain Layout
5120 after a dead-key produces the bare-accent.
5121 Please note this last point! If you bind a key to a dead-key, you'll need
5122 to rebind the character on that key to yet another key.
5124 \begin_inset Flex CharStyle:MenuItem
5127 \begin_layout Plain Layout
5133 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5136 \begin_layout Standard
5137 One common way to bind dead-keys is to use
5138 \begin_inset Flex CharStyle:MenuItem
5141 \begin_layout Plain Layout
5148 \begin_inset Flex CharStyle:MenuItem
5151 \begin_layout Plain Layout
5158 \begin_inset Flex CharStyle:MenuItem
5161 \begin_layout Plain Layout
5167 in combination with an accent, like
5168 \begin_inset Quotes eld
5172 \begin_inset Flex CharStyle:MenuItem
5175 \begin_layout Plain Layout
5182 \begin_inset Quotes erd
5186 \begin_inset Quotes eld
5190 \begin_inset Flex CharStyle:MenuItem
5193 \begin_layout Plain Layout
5200 \begin_inset Quotes erd
5204 \begin_inset Quotes eld
5208 \begin_inset Flex CharStyle:MenuItem
5211 \begin_layout Plain Layout
5218 \begin_inset Quotes erd
5222 Another way involves using
5223 \begin_inset Flex CharStyle:Code
5226 \begin_layout Plain Layout
5233 \begin_inset Flex CharStyle:Code
5236 \begin_layout Plain Layout
5242 to set up the special
5243 \begin_inset Flex CharStyle:Code
5246 \begin_layout Plain Layout
5254 \begin_inset Flex CharStyle:Code
5257 \begin_layout Plain Layout
5263 acts in some ways just like
5264 \begin_inset Flex CharStyle:MenuItem
5267 \begin_layout Plain Layout
5273 and permits you to bind keys to accented characters.
5274 You can also turn keys into dead-keys by binding them to something like
5276 \begin_inset Flex CharStyle:Code
5279 \begin_layout Plain Layout
5285 and then binding this symbolic key to the corresponding LyX command.
5289 \begin_layout Plain Layout
5294 : This is exactly what I do in my
5295 \begin_inset Flex CharStyle:Code
5298 \begin_layout Plain Layout
5305 \begin_inset Flex CharStyle:Code
5308 \begin_layout Plain Layout
5316 \begin_inset Flex CharStyle:MenuItem
5319 \begin_layout Plain Layout
5321 \begin_inset space ~
5330 \begin_inset Flex CharStyle:Code
5333 \begin_layout Plain Layout
5339 and a bunch of these
5340 \begin_inset Quotes eld
5344 \begin_inset Flex CharStyle:Code
5347 \begin_layout Plain Layout
5354 \begin_inset Quotes erd
5357 symbolic keys bound such things as
5358 \begin_inset Flex CharStyle:MenuItem
5361 \begin_layout Plain Layout
5363 \begin_inset space ~
5372 \begin_inset Flex CharStyle:MenuItem
5375 \begin_layout Plain Layout
5377 \begin_inset space ~
5386 This is how I produce my accented characters.
5391 You can make just about anything into the
5392 \begin_inset Flex CharStyle:Code
5395 \begin_layout Plain Layout
5402 \begin_inset Flex CharStyle:MenuItem
5405 \begin_layout Plain Layout
5411 keys, a spare function key, etc.
5412 As for the LyX commands that produce accents, check the entry for
5413 \begin_inset Flex CharStyle:Code
5416 \begin_layout Plain Layout
5427 You'll find the complete list there.
5430 \begin_layout Subsection
5431 Saving your Language Configuration
5434 \begin_layout Standard
5435 You can edit your preferences so that your desired language environment
5436 is automatically configured when LyX starts up, via the
5437 \begin_inset Flex CharStyle:MenuItem
5440 \begin_layout Plain Layout
5441 Edit\SpecialChar \menuseparator
5450 \begin_layout Chapter
5451 Installing New Document Classes, Layouts, and Templates
5452 \begin_inset CommandInset label
5454 name "cha:Installing-New-Document"
5462 \begin_layout Plain Layout
5463 Installing New Document Classes
5471 \begin_layout Standard
5472 In this chapter, we describe the procedures for creating and installing
5473 new LyX layout and template files, as well as offer a refresher on correctly
5474 installing new LaTeX document classes.
5475 Some definitions: a document class is a LaTeX file (usually ending in
5476 \begin_inset Flex CharStyle:Code
5479 \begin_layout Plain Layout
5486 \begin_inset Flex CharStyle:Code
5489 \begin_layout Plain Layout
5495 ) that describes the format of a document such as an article, report, journal
5496 preprint, etc, and all the commands needed to realize that format.
5497 A layout file is a LyX file that corresponds to a LaTeX document class
5498 and that tells LyX how to
5499 \begin_inset Quotes eld
5503 \begin_inset Quotes erd
5506 things on the screen to make the display look something like the final
5508 More precisely, a layout file describes a
5509 \begin_inset Quotes eld
5513 \begin_inset Quotes erd
5516 which is the internal construct LyX uses to render the screen display.
5518 \begin_inset Quotes eld
5522 \begin_inset Quotes erd
5526 \begin_inset Quotes eld
5530 \begin_inset Quotes erd
5533 can be used somewhat interchangeably, but it is better to refer to the
5534 file as the layout, and the thing living in LyX's memory as the text class.
5535 A template file is simply a LyX document that contains a set of predefined
5536 entries for a given document class—entries that are generally required
5538 Templates are especially useful for things like journal manuscripts that
5539 are to be submitted electronically.
5542 \begin_layout Section
5543 Installing a new LaTeX package
5546 \begin_layout Standard
5547 Some installations may not include a LaTeX package that you would like to
5549 For example, you might need FoilTeX, a package for preparing slides or
5550 viewgraphs for overhead projectors.
5551 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5552 a user interface for that.
5553 For example on MiKTeX you start its program
5554 \begin_inset Quotes eld
5558 \begin_inset Quotes erd
5561 to get a list of available packages.
5562 To install one, right click on it or use the installing toolbar button.
5563 When the package you want to install is not in the list, but you have it
5565 \begin_inset Flex CharStyle:Code
5568 \begin_layout Plain Layout
5575 \begin_inset Flex CharStyle:Code
5578 \begin_layout Plain Layout
5584 -file, then copy these files to a subfolder of your LaTeX distribution,
5585 for example to the folder
5594 Then update the file name database of your LaTeX-distribution.
5595 For example on MiKTeX this is done by pressing the button
5598 \begin_inset space ~
5603 that you find in MiKTeX's
5604 \begin_inset Quotes eld
5608 \begin_inset Quotes erd
5612 In both cases you need afterwards to reconfigure LyX using the menu
5613 \begin_inset Flex CharStyle:MenuItem
5616 \begin_layout Plain Layout
5617 Tools\SpecialChar \menuseparator
5623 and then to restart LyX.
5626 \begin_layout Standard
5627 If your LaTeX distribution doesn't provide a user interface, then you can
5628 follow these steps by using a UNIX/Linux console.
5631 \begin_layout Enumerate
5632 Get the package from
5633 \begin_inset CommandInset href
5636 target "http://www.ctan.org/"
5643 \begin_layout Enumerate
5644 You can install this package in several different places.
5645 If you want it to be available for all users on your system, then you should
5646 install it in your `local' TeX tree; if you want (or need) it to be available
5647 just for you, then you can install it in your own `user' TeX tree.
5648 Where these should be created, if they do not already exist, depends upon
5649 the details of your system.
5650 To find out, look in the file
5651 \begin_inset Flex CharStyle:Code
5654 \begin_layout Plain Layout
5664 \begin_layout Plain Layout
5665 This usually lives in the directory
5666 \begin_inset Flex CharStyle:Code
5669 \begin_layout Plain Layout
5675 , though you can run
5676 \begin_inset Flex CharStyle:Code
5679 \begin_layout Plain Layout
5690 The location of the `local' TeX tree is defined by
5691 \begin_inset Flex CharStyle:Code
5694 \begin_layout Plain Layout
5700 ; this is usually somewhere like
5701 \begin_inset Flex CharStyle:Code
5704 \begin_layout Plain Layout
5705 /usr/local/share/texmf/
5711 The `user' TeX tree is defined by
5712 \begin_inset Flex CharStyle:Code
5715 \begin_layout Plain Layout
5722 \begin_inset Flex CharStyle:Code
5725 \begin_layout Plain Layout
5732 (If these variables are not predefined, you can define them.) You'll probably
5733 need root permissions to create or modify the `local' tree; but your `user'
5734 tree shouldn't have such limitations.
5737 \begin_layout Enumerate
5739 \begin_inset Flex CharStyle:Code
5742 \begin_layout Plain Layout
5749 \begin_inset Flex CharStyle:Code
5752 \begin_layout Plain Layout
5759 \begin_inset Flex CharStyle:Code
5762 \begin_layout Plain Layout
5769 \begin_inset space \thinspace{}
5773 \begin_inset Newline newline
5777 \begin_inset Flex CharStyle:Code
5780 \begin_layout Plain Layout
5781 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5787 \begin_inset Newline newline
5790 But, again, most of this will
5791 \begin_inset Quotes eld
5795 \begin_inset Quotes erd
5801 \begin_layout Enumerate
5806 \begin_layout Plain Layout
5807 We'll assume henceforth that you're defining `local' TeX tree.
5808 If you're defining a user tree, just adjust as necessary.
5814 You must follow the directory structure of your existing
5815 \begin_inset Flex CharStyle:Code
5818 \begin_layout Plain Layout
5824 directory, which will be found at
5825 \begin_inset Flex CharStyle:Code
5828 \begin_layout Plain Layout
5835 For example, latex packages should go under
5836 \begin_inset Flex CharStyle:Code
5839 \begin_layout Plain Layout
5840 $TEXMFLOCAL/tex/latex/
5848 \begin_layout Enumerate
5849 Install the package.
5850 For example, you would unpack the FoilTeX tarball and copy it to
5851 \begin_inset Flex CharStyle:Code
5854 \begin_layout Plain Layout
5855 $TEXMFLOCAL/tex/latex/foiltex
5862 \begin_inset Flex CharStyle:Code
5865 \begin_layout Plain Layout
5871 directory contains various files.
5874 \begin_layout Enumerate
5876 \begin_inset Flex CharStyle:Code
5879 \begin_layout Plain Layout
5887 \begin_inset Flex CharStyle:Code
5890 \begin_layout Plain Layout
5899 \begin_layout Standard
5900 Your package is now installed and available to LaTeX.
5901 To make it available to LyX, you need to create a Layout file, if one is
5902 not already available.
5903 (See the next section.) Once you have a layout file, you need only reconfigure
5905 \begin_inset Flex CharStyle:MenuItem
5908 \begin_layout Plain Layout
5909 Tools\SpecialChar \menuseparator
5915 ) and then restart LyX.
5916 You should then see your new package—for example
5917 \begin_inset Flex CharStyle:MenuItem
5920 \begin_layout Plain Layout
5927 \begin_inset Flex CharStyle:MenuItem
5930 \begin_layout Plain Layout
5931 Document\SpecialChar \menuseparator
5938 \begin_inset Flex CharStyle:MenuItem
5941 \begin_layout Plain Layout
5951 \begin_layout Section
5955 \begin_layout Standard
5956 This section describes how to write and install your own LyX layout files
5957 and walks through the
5958 \begin_inset Flex CharStyle:Code
5961 \begin_layout Plain Layout
5967 text class format as an example.
5969 \begin_inset Flex CharStyle:Code
5972 \begin_layout Plain Layout
5978 files describe what paragraph and character styles are available for a
5979 given document class and how LyX should display them.
5980 We try to provide a thorough description of the process here; however,
5981 there are so many different types of documents supported by LaTeX classes
5982 that we can't hope to cover every different possibility or problem you
5984 (The LyX users' list is frequented by people with lots of experience with
5985 layout design who are willing to share what they've learned.)
5988 \begin_layout Standard
5989 As you prepare to write a new layout, it is extremely helpful to look at
5990 the example layouts distributed with LyX.
5991 If you use a nice LaTeX document class that might be of interest for others,
5992 too, and have a nice corresponding LyX layout, feel free to contribute
5993 the stuff to us, so we may put it into the distribution.
5995 \begin_inset CommandInset href
5997 name "section on the LyX wiki"
5998 target "http://wiki.lyx.org/Layouts/Layouts"
6002 for this kind of material.
6005 \begin_layout Standard
6006 All the tags described in this chapter are case-insensitive; this means
6008 \begin_inset Flex CharStyle:Code
6011 \begin_layout Plain Layout
6018 \begin_inset Flex CharStyle:Code
6021 \begin_layout Plain Layout
6028 \begin_inset Flex CharStyle:Code
6031 \begin_layout Plain Layout
6037 are really the same command.
6038 The possible values are printed in brackets after the feature's name.
6039 The default value if a feature isn't specified inside a text class-description
6041 \begin_inset Flex CharStyle:Code
6044 \begin_layout Plain Layout
6053 If the argument has a data type like
6054 \begin_inset Quotes eld
6058 \begin_inset Quotes erd
6062 \begin_inset Quotes eld
6066 \begin_inset Quotes erd
6069 , the default is shown like this:
6070 \begin_inset Flex CharStyle:Code
6073 \begin_layout Plain Layout
6084 \begin_layout Subsection
6086 \begin_inset CommandInset label
6088 name "sub:Layout-modules"
6095 \begin_layout Standard
6096 Similar to layout files, and new with LyX 1.6, are layout
6101 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6102 some modules—such as the endnotes module—provide support for just such
6104 In a sense, layout modules are similar to included files—files like
6105 \begin_inset Flex CharStyle:Code
6108 \begin_layout Plain Layout
6114 —in that modules are not specific to a given document layout but may be
6115 used with many different layouts.
6116 The difference is that using a layout module does not require editing the
6118 Rather, modules are selected in the
6119 \begin_inset Flex CharStyle:MenuItem
6122 \begin_layout Plain Layout
6123 Document\SpecialChar \menuseparator
6132 \begin_layout Standard
6133 Building modules is the easiest way to get started with layout editing,
6134 since it can be as simple as adding a single new paragraph or flex inset.
6135 But modules may, in principle, contain anything a layout file can contain.
6138 \begin_layout Standard
6139 A module must begin with a line like the following:
6142 \begin_layout LyX-Code
6145 DeclareLyXModule[endnotes.sty]{Endnotes}
6148 \begin_layout Standard
6149 The mandatory argument, in curly brackets, is the name of the module, as
6151 \begin_inset Flex CharStyle:MenuItem
6154 \begin_layout Plain Layout
6155 Document\SpecialChar \menuseparator
6163 \change_inserted 0 1243500588
6167 \begin_layout Standard
6168 The argument in square brackets is optional: It declares any LaTeX packages
6169 on which the module depends.
6170 Please note that only packages about which LyX knows should be listed in
6171 the square brackets.
6175 \begin_layout Plain Layout
6176 The list of such packages is documented only in the source code.
6181 LyX will not check for arbitrary packages.
6183 \change_inserted 0 1243500694
6184 It is also possible to use the form
6185 \begin_inset Flex CharStyle:MenuItem
6188 \begin_layout Plain Layout
6190 \change_inserted 0 1243500706
6196 , which declares that the module can only be used when there exists a conversion
6197 chain between formats `from' and `to'.
6202 \begin_layout Standard
6203 The module declaration should then be followed by lines like the following:
6206 \begin_layout LyX-Code
6210 \begin_layout LyX-Code
6211 #Adds an endnote command, in addition to footnotes.
6215 \begin_layout LyX-Code
6216 #You will need to add
6218 theendnotes in TeX code where you
6221 \begin_layout LyX-Code
6222 #want the endnotes to appear.
6226 \begin_layout LyX-Code
6230 \begin_layout LyX-Code
6231 #Requires: somemodule | othermodule
6234 \begin_layout LyX-Code
6235 #Excludes: badmodule
6238 \begin_layout Standard
6239 The description is used in
6240 \begin_inset Flex CharStyle:MenuItem
6243 \begin_layout Plain Layout
6244 Document\SpecialChar \menuseparator
6250 to provide the user with information about what the module does.
6252 \begin_inset Flex CharStyle:Code
6255 \begin_layout Plain Layout
6261 line is used to identify other modules with which this one must be used;
6263 \begin_inset Flex CharStyle:Code
6266 \begin_layout Plain Layout
6272 line is used to identify modules with which this one may not be used.
6273 Both are optional, and, as shown, multiple modules should be separated
6274 with the pipe symbol: |.
6275 Note that the required modules are treated disjunctively:
6279 of the required modules must be used.
6284 excluded module may be used.
6285 Note that modules are identified here by their
6289 without the .module extension.
6291 \begin_inset Flex CharStyle:Code
6294 \begin_layout Plain Layout
6301 \begin_inset Flex CharStyle:Code
6304 \begin_layout Plain Layout
6313 \begin_layout Standard
6314 After creating a new module, you will need to reconfigure and then restart
6315 LyX for the module to appear in the menu.
6316 However, changes you make to the module will be seen immediately, if you
6318 \begin_inset Flex CharStyle:MenuItem
6321 \begin_layout Plain Layout
6322 Document\SpecialChar \menuseparator
6328 , highlight something, and then hit
6329 \begin_inset Quotes eld
6333 \begin_inset Quotes erd
6339 It is strongly recommended that you save your work before doing so
6344 it is strongly recommended that you not attempt to edit modules while simultaneo
6345 usly working on documents
6348 Though of course the developers strive to keep LyX stable in such situations,
6349 syntax errors and the like in your module file could cause strange behavior.
6352 \begin_layout Subsection
6353 Supporting new document classes
6356 \begin_layout Standard
6357 There are two situations you are likely to encounter when wanting to support
6358 a new LaTeX document class, involving LaTeX2e class (
6359 \begin_inset Flex CharStyle:Code
6362 \begin_layout Plain Layout
6369 \begin_inset Flex CharStyle:Code
6372 \begin_layout Plain Layout
6379 Supporting a style file is usually fairly easy.
6380 Supporting a new document class is a bit harder.
6383 \begin_layout Subsection
6385 \begin_inset Flex CharStyle:MenuItem
6388 \begin_layout Plain Layout
6397 \begin_layout Standard
6398 If your new document class is provided as a style file that is used in conjuncti
6399 on with an existing, supported document class—for the sake of the example,
6400 we'll assume that the style file is called
6401 \begin_inset Flex CharStyle:MenuItem
6404 \begin_layout Plain Layout
6410 and it is meant to be used with
6411 \begin_inset Flex CharStyle:MenuItem
6414 \begin_layout Plain Layout
6420 , which is a standard class—start by copying the existing class's layout
6421 file into your local directory:
6424 \begin_layout LyX-Code
6425 cp report.layout ~/.lyx/layouts/myclass.layout
6428 \begin_layout Standard
6430 \begin_inset Flex CharStyle:Code
6433 \begin_layout Plain Layout
6439 and change the line:
6442 \begin_layout LyX-Code
6445 DeclareLaTeXClass{report}
6448 \begin_layout Standard
6452 \begin_layout LyX-Code
6455 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6458 \begin_layout Standard
6462 \begin_layout LyX-Code
6464 \begin_inset Newline newline
6470 \begin_inset Newline newline
6476 \begin_layout Standard
6477 near the top of the file.
6480 \begin_layout Standard
6481 Start LyX and select
6482 \begin_inset Flex CharStyle:MenuItem
6485 \begin_layout Plain Layout
6486 Tools\SpecialChar \menuseparator
6493 Then restart LyX and try creating a new document.
6495 \begin_inset Flex CharStyle:MenuItem
6498 \begin_layout Plain Layout
6504 " as a document class option in the
6505 \begin_inset Flex CharStyle:MenuItem
6508 \begin_layout Plain Layout
6509 Document\SpecialChar \menuseparator
6516 It is likely that some of the sectioning commands and such in your new
6517 class will work differently from how they worked in the base class—
6518 \begin_inset Flex CharStyle:Code
6521 \begin_layout Plain Layout
6527 in this example—so you can fiddle around with the settings for the different
6528 sections if you wish.
6531 \begin_layout Subsection
6533 \begin_inset Flex CharStyle:MenuItem
6536 \begin_layout Plain Layout
6545 \begin_layout Standard
6546 There are two possibilities here.
6547 One is that the class file is itself based upon an existing document class.
6548 For example, many thesis classes are based upon
6549 \begin_inset Flex CharStyle:MenuItem
6552 \begin_layout Plain Layout
6559 To see whether yours is, look for a line like
6562 \begin_layout LyX-Code
6568 \begin_layout Standard
6570 If so, then you may proceed largely as in the previous section, though
6571 the DeclareLaTeXClass line will be different.
6572 If your new class is thesis, and it is based upon book, then the line should
6577 \begin_layout Plain Layout
6578 And it will be easiest if you save the file to
6579 \begin_inset Flex CharStyle:Code
6582 \begin_layout Plain Layout
6588 : LyX assumes that the document class has the same name as the layout file.
6597 \begin_layout LyX-Code
6600 DeclareLaTeXClass[thesis,book]{thesis}
6603 \begin_layout Standard
6604 If, on the other hand, the new class is not based upon an existing class,
6605 you will probably have to
6606 \begin_inset Quotes eld
6610 \begin_inset Quotes erd
6614 We strongly suggest copying an existing layout file which uses a similar
6615 LaTeX class and then modifying it, if you can do so.
6616 At least use an existing file as a starting point so you can find out what
6617 items you need to worry about.
6618 Again, the specifics are covered below.
6621 \begin_layout Section
6622 Declaring a new text class
6625 \begin_layout Standard
6626 When it's finally time to get your hands dirty and create or edit your own
6627 layout file, the following sections describe what you're up against.
6628 Our advice is to go slowly, save and test often, listen to soothing music,
6629 and enjoy one or two of your favorite adult beverages; more if you are
6630 getting particularly stuck.
6631 It's really not that hard, except that the multitude of options can become
6632 overwhelming if you try to do to much in one sitting.
6633 Go have another adult beverage, just for good measure.
6636 \begin_layout Standard
6640 \begin_layout Standard
6641 Lines in a layout file which begin with a
6642 \begin_inset Flex CharStyle:Code
6645 \begin_layout Plain Layout
6652 There is one exception to this rule: all layouts should begin with lines
6656 \begin_layout LyX-Code
6659 #% Do not delete the line below; configure depends on this
6662 \begin_layout LyX-Code
6667 DeclareLaTeXClass{article}
6670 \begin_layout Standard
6671 The second line is used when you configure LyX.
6672 The layout file is read by the LaTeX script
6673 \begin_inset Flex CharStyle:Code
6676 \begin_layout Plain Layout
6682 , in a special mode where
6683 \begin_inset Flex CharStyle:Code
6686 \begin_layout Plain Layout
6693 The first line is just a LaTeX comment, and the second one contains the
6694 declaration of the text class.
6695 If these lines appear in a file named
6696 \begin_inset Flex CharStyle:Code
6699 \begin_layout Plain Layout
6705 , then they define a text class of name
6706 \begin_inset Flex CharStyle:Code
6709 \begin_layout Plain Layout
6715 (the name of the layout file) which uses the LaTeX document class
6716 \begin_inset Flex CharStyle:Code
6719 \begin_layout Plain Layout
6725 (the default is to use the same name as the layout).
6727 \begin_inset Quotes eld
6731 \begin_inset Quotes erd
6734 that appears above is used as a description of the text class in the
6735 \begin_inset Flex CharStyle:MenuItem
6738 \begin_layout Plain Layout
6739 Document\SpecialChar \menuseparator
6748 \begin_layout Standard
6749 Let's assume that you wrote your own text class that uses the
6750 \begin_inset Flex CharStyle:Code
6753 \begin_layout Plain Layout
6759 document class, but where you changed the appearance of the section headings.
6760 If you put it in a file
6761 \begin_inset Flex CharStyle:Code
6764 \begin_layout Plain Layout
6770 , the header of this file should be:
6773 \begin_layout LyX-Code
6776 #% Do not delete the line below; configure depends on this
6779 \begin_layout LyX-Code
6784 DeclareLaTeXClass[article]{article (with my own headings)}
6787 \begin_layout Standard
6788 This declares a text class
6789 \begin_inset Flex CharStyle:Code
6792 \begin_layout Plain Layout
6798 , associated with the LaTeX document class
6799 \begin_inset Flex CharStyle:Code
6802 \begin_layout Plain Layout
6809 \begin_inset Quotes eld
6812 article (with my own headings)
6813 \begin_inset Quotes erd
6817 If your text class depends on several packages, you can declare it as:
6820 \begin_layout LyX-Code
6823 #% Do not delete the line below; configure depends on this
6826 \begin_layout LyX-Code
6831 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6834 \begin_layout Standard
6835 This indicates that your text class uses the foo.sty package.
6836 Finally, it is also possible to declare classes for DocBook code.
6837 Typical declarations will look like
6840 \begin_layout LyX-Code
6843 #% Do not delete the line below; configure depends on this
6846 \begin_layout LyX-Code
6851 DeclareDocBookClass[article]{SGML (DocBook article)}
6854 \begin_layout Standard
6855 Note that these declarations can also be given an optional parameter declaring
6856 the name of the document class (but not a list).
6859 \begin_layout Standard
6860 So, to be as explicit as possible, the form of the layout declaration is:
6863 \begin_layout LyX-Code
6868 DeclareLaTeXClass[class,package.sty]{layout description}
6871 \begin_layout Standard
6872 The class need only be specified if the name of the LaTeX class file and
6873 the name of the layout file are different; if the name of the class file
6874 is not specified, then LyX will simply assume that it is the same as the
6875 name of the layout file.
6878 \begin_layout Standard
6879 When the text class has been modified to your taste, all you have to do
6880 is to copy it either to
6881 \begin_inset Flex CharStyle:Code
6884 \begin_layout Plain Layout
6891 \begin_inset Flex CharStyle:Code
6894 \begin_layout Plain Layout
6901 \begin_inset Flex CharStyle:MenuItem
6904 \begin_layout Plain Layout
6905 Tools\SpecialChar \menuseparator
6911 , exit LyX and restart it.
6912 Then your new text class should be available along with the others.
6915 \begin_layout Standard
6916 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6917 you made to your layout files.
6918 As a result, editing layout files could be very time consuming.
6919 Beginning with 1.6, however, you can force a reload of the layout currently
6920 in use by using the LyX function
6921 \begin_inset Flex CharStyle:MenuItem
6924 \begin_layout Plain Layout
6931 There is no default binding for this function—though, of course, you can
6932 bind it to a key yourself.
6933 If you want to use this function, then, you should simply enter it in the
6939 : This is very much an `advanced feature'.
6944 recommended that you save your work before using this function.
6949 recommended that you not attempt to edit your layout while simultaneously
6950 working on a document that you care about.
6951 Use a test document.
6952 Syntax errors and the like in your layout file could cause peculiar behavior.
6953 In particular, such errors could cause LyX to regard the current layout
6954 as invalid and to attempt to switch to some other layout.
6955 The LyX team strives to keep LyX stable in such situations, but safe is
6959 \begin_layout Subsection
6963 \begin_layout Standard
6964 The first non-comment line must contain the file format number:
6967 \begin_layout Description
6968 \begin_inset Flex CharStyle:Code
6971 \begin_layout Plain Layout
6978 \begin_inset Flex CharStyle:Code
6981 \begin_layout Plain Layout
6987 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6988 don't have an explicit file format).
6989 The file format that is documented here is format 14.
6992 \begin_layout Subsection
6993 General text class parameters
6996 \begin_layout Standard
6997 These are the general parameters which describe the form of the entire document:
7000 \begin_layout Description
7001 \begin_inset Flex CharStyle:Code
7004 \begin_layout Plain Layout
7010 Adds information to the document preamble.
7012 \begin_inset Quotes eld
7016 \begin_inset Flex CharStyle:Code
7019 \begin_layout Plain Layout
7026 \begin_inset Quotes erd
7032 \begin_layout Description
7033 \begin_inset Flex CharStyle:Code
7036 \begin_layout Plain Layout
7042 Describes various global options supported by the document class.
7044 \begin_inset space ~
7048 \begin_inset CommandInset ref
7050 reference "sub:ClassOptions"
7056 \begin_inset Quotes eld
7060 \begin_inset Flex CharStyle:Code
7063 \begin_layout Plain Layout
7070 \begin_inset Quotes erd
7076 \begin_layout Description
7077 \begin_inset Flex CharStyle:Code
7080 \begin_layout Plain Layout
7087 \begin_inset Flex CharStyle:Code
7090 \begin_layout Plain Layout
7099 \begin_inset Flex CharStyle:Code
7102 \begin_layout Plain Layout
7108 ] Whether the class should default to having one or two columns.
7109 Can be changed in the
7110 \begin_inset Flex CharStyle:MenuItem
7113 \begin_layout Plain Layout
7114 Document\SpecialChar \menuseparator
7123 \begin_layout Description
7124 \begin_inset Flex CharStyle:Code
7127 \begin_layout Plain Layout
7133 This sequence defines a new counter.
7135 \begin_inset space ~
7139 \begin_inset CommandInset ref
7141 reference "sub:Counters"
7147 \begin_inset Quotes eld
7151 \begin_inset Flex CharStyle:Code
7154 \begin_layout Plain Layout
7161 \begin_inset Quotes erd
7167 \begin_layout Description
7168 \begin_inset Flex CharStyle:Code
7171 \begin_layout Plain Layout
7177 Sets the default font used to display the document.
7179 \begin_inset space ~
7183 \begin_inset CommandInset ref
7185 reference "sub:Font-description"
7189 for how to declare fonts.
7191 \begin_inset Quotes eld
7195 \begin_inset Flex CharStyle:Code
7198 \begin_layout Plain Layout
7205 \begin_inset Quotes erd
7211 \begin_layout Description
7212 \begin_inset Flex CharStyle:Code
7215 \begin_layout Plain Layout
7222 \begin_inset Flex CharStyle:Code
7225 \begin_layout Plain Layout
7231 Specifies a module to be included by default with this document class,
7232 which should be specified by filename without the
7233 \begin_inset Flex CharStyle:Code
7236 \begin_layout Plain Layout
7243 The user can still remove the module, but it will be active at the outset.
7244 (This applies only when new files are created, or when this class is chosen
7245 for an existing document.)
7248 \begin_layout Description
7249 \begin_inset Flex CharStyle:Code
7252 \begin_layout Plain Layout
7259 \begin_inset Flex CharStyle:Code
7262 \begin_layout Plain Layout
7268 ] This is the style that will be assigned to new paragraphs, usually
7269 \begin_inset Flex CharStyle:MenuItem
7272 \begin_layout Plain Layout
7279 This will default to the first defined style if not given, but you are
7280 highly encouraged to use this directive.
7283 \begin_layout Description
7284 \begin_inset Flex CharStyle:Code
7287 \begin_layout Plain Layout
7294 \begin_inset Flex CharStyle:Code
7297 \begin_layout Plain Layout
7303 ] Indicates that the module in question—which should be specified by filename
7305 \begin_inset Flex CharStyle:Code
7308 \begin_layout Plain Layout
7314 extension—cannot be used with this document class.
7315 This might be used in a journal-specific layout file to prevent, say, the
7317 \begin_inset Flex CharStyle:Code
7320 \begin_layout Plain Layout
7326 module that numbers theorems by section.
7331 be used in a module.
7332 Modules have their own way of excluding other modules (see
7333 \begin_inset CommandInset ref
7335 reference "sub:Layout-modules"
7342 \begin_layout Description
7343 \begin_inset Flex CharStyle:Code
7346 \begin_layout Plain Layout
7352 Defines a new float.
7354 \begin_inset space ~
7358 \begin_inset CommandInset ref
7360 reference "sub:Floats"
7366 \begin_inset Quotes eld
7370 \begin_inset Flex CharStyle:Code
7373 \begin_layout Plain Layout
7380 \begin_inset Quotes erd
7386 \begin_layout Description
7387 \begin_inset Flex CharStyle:Code
7390 \begin_layout Plain Layout
7396 As its name implies, this command allows you to include another layout
7397 definition file within yours to avoid duplicating commands.
7398 Common examples are the standard layout files, for example,
7399 \begin_inset Flex CharStyle:Code
7402 \begin_layout Plain Layout
7408 , which contains most of the basic layouts.
7411 \begin_layout Description
7412 \begin_inset Flex CharStyle:Code
7415 \begin_layout Plain Layout
7421 This section (re-)defines the layout of an inset.
7422 It can be applied to an existing inset of to a new, user-defined inset,
7424 \begin_inset space \thinspace{}
7428 \begin_inset space \space{}
7431 a new character style.
7433 \begin_inset space ~
7437 \begin_inset CommandInset ref
7439 reference "sub:Flex-insets-and"
7443 for more information.
7445 \begin_inset Quotes eld
7449 \begin_inset Flex CharStyle:Code
7452 \begin_layout Plain Layout
7459 \begin_inset Quotes erd
7465 \begin_layout Description
7466 \begin_inset Flex CharStyle:Code
7469 \begin_layout Plain Layout
7475 A string that indicates the width of the left margin on the screen, for
7477 \begin_inset Quotes eld
7481 \begin_inset Quotes erd
7487 \begin_layout Description
7488 \begin_inset Flex CharStyle:Code
7491 \begin_layout Plain Layout
7497 This command deletes an existing float.
7498 This is particularly useful when you want to suppress a float that has
7499 be defined in an input file.
7502 \begin_layout Description
7503 \begin_inset Flex CharStyle:Code
7506 \begin_layout Plain Layout
7512 This command deletes an existing style.
7513 This is particularly useful when you want to suppress a style that has
7514 be defined in an input file.
7517 \begin_layout Description
7518 \begin_inset Flex CharStyle:Code
7521 \begin_layout Plain Layout
7527 A string indicating what sort of output documents using this class will
7529 At present, the options are: `docbook', `latex', and `literate'.
7530 \change_inserted 0 1243500198
7534 \begin_layout Description
7536 \change_inserted 0 1243500505
7537 \begin_inset Flex CharStyle:Code
7540 \begin_layout Plain Layout
7542 \change_inserted 0 1243500208
7548 A string indicating the file format (as defined in the Preferences dialog)
7549 produced by this class.
7550 It is mainly useful when
7551 \begin_inset Flex CharStyle:Code
7554 \begin_layout Plain Layout
7556 \change_inserted 0 1243500394
7562 is `literate' and one wants to define a new type of literate document.
7563 This string is reset to `docbook', `latex', or `literate' when the correspondin
7565 \begin_inset Flex CharStyle:Code
7568 \begin_layout Plain Layout
7570 \change_inserted 0 1243500473
7576 parameter is encountered.
7581 \begin_layout Description
7582 \begin_inset Flex CharStyle:Code
7585 \begin_layout Plain Layout
7596 \begin_inset Flex CharStyle:Code
7599 \begin_layout Plain Layout
7610 \begin_inset Flex CharStyle:Code
7613 \begin_layout Plain Layout
7620 \begin_inset Flex CharStyle:Code
7623 \begin_layout Plain Layout
7629 ] The class default pagestyle.
7630 Can be changed in the
7631 \begin_inset Flex CharStyle:MenuItem
7634 \begin_layout Plain Layout
7635 Document\SpecialChar \menuseparator
7644 \begin_layout Description
7645 \begin_inset Flex CharStyle:Code
7648 \begin_layout Plain Layout
7654 Sets the preamble for the LaTeX document.
7655 Note that this will completely override any prior
7656 \begin_inset Flex CharStyle:Code
7659 \begin_layout Plain Layout
7666 \begin_inset Flex CharStyle:Code
7669 \begin_layout Plain Layout
7677 \begin_inset Quotes eld
7681 \begin_inset Flex CharStyle:Code
7684 \begin_layout Plain Layout
7691 \begin_inset Quotes erd
7697 \begin_layout Description
7698 \begin_inset Flex CharStyle:Code
7701 \begin_layout Plain Layout
7708 \begin_inset Flex CharStyle:Code
7711 \begin_layout Plain Layout
7718 \begin_inset Flex CharStyle:Code
7721 \begin_layout Plain Layout
7730 \begin_inset Flex CharStyle:Code
7733 \begin_layout Plain Layout
7739 ] Whether the class already provides the feature
7740 \begin_inset Flex CharStyle:Code
7743 \begin_layout Plain Layout
7750 A feature is in general the name of a package (
7751 \begin_inset Flex CharStyle:Code
7754 \begin_layout Plain Layout
7761 \begin_inset Flex CharStyle:Code
7764 \begin_layout Plain Layout
7770 , \SpecialChar \ldots{}
7772 \begin_inset Flex CharStyle:Code
7775 \begin_layout Plain Layout
7782 \begin_inset Flex CharStyle:Code
7785 \begin_layout Plain Layout
7791 ,\SpecialChar \ldots{}
7792 ); the complete list of supported features is unfortunately not documented
7793 outside the LyX source code—but see
7794 \begin_inset Flex CharStyle:Code
7797 \begin_layout Plain Layout
7803 if you're interested.
7805 \begin_inset Flex CharStyle:MenuItem
7808 \begin_layout Plain Layout
7809 Help\SpecialChar \menuseparator
7815 also gives an overview of the supported packages.
7818 \begin_layout Description
7819 \begin_inset Flex CharStyle:Code
7822 \begin_layout Plain Layout
7829 \begin_inset Flex CharStyle:Code
7832 \begin_layout Plain Layout
7838 ] Indicates that this layout provides the functionality of the module mentioned,
7839 which should be specified by the filename without the
7840 \begin_inset Flex CharStyle:Code
7843 \begin_layout Plain Layout
7850 This will typically be used if the layout includes the module directly,
7851 rather than using the
7852 \begin_inset Flex CharStyle:Code
7855 \begin_layout Plain Layout
7861 tag to indicate that it ought to be used.
7862 It could be used in a module that provided an alternate implementation
7863 of the same functionality.
7866 \begin_layout Description
7867 \begin_inset Flex CharStyle:Code
7870 \begin_layout Plain Layout
7877 \begin_inset Flex CharStyle:Code
7880 \begin_layout Plain Layout
7886 ] Whether the class requires the feature
7887 \begin_inset Flex CharStyle:Code
7890 \begin_layout Plain Layout
7897 Multiple features must be separated by commas.
7898 Note that you can only request supported features.
7901 \begin_layout Description
7902 \begin_inset Flex CharStyle:Code
7905 \begin_layout Plain Layout
7911 A string that indicates the width of the right margin on the screen, for
7913 \begin_inset Quotes eld
7917 \begin_inset Quotes erd
7923 \begin_layout Description
7924 \begin_inset Flex CharStyle:Code
7927 \begin_layout Plain Layout
7933 Sets which divisions get numbered.
7935 \begin_inset Flex CharStyle:Code
7938 \begin_layout Plain Layout
7947 \begin_layout Description
7948 \begin_inset Flex CharStyle:Code
7951 \begin_layout Plain Layout
7960 \begin_inset Flex CharStyle:Code
7963 \begin_layout Plain Layout
7974 \begin_inset Flex CharStyle:Code
7977 \begin_layout Plain Layout
7983 ] Whether the class-default should be printing on one or both sides of the
7985 Can be changed in the
7986 \begin_inset Flex CharStyle:MenuItem
7989 \begin_layout Plain Layout
7990 Document\SpecialChar \menuseparator
7999 \begin_layout Description
8000 \begin_inset Flex CharStyle:Code
8003 \begin_layout Plain Layout
8009 This sequence defines a new paragraph style.
8010 If the style already exists, it will redefine some of its parameters instead.
8012 \begin_inset space ~
8016 \begin_inset CommandInset ref
8018 reference "sub:Paragraph-Styles"
8024 \begin_inset Quotes eld
8028 \begin_inset Flex CharStyle:Code
8031 \begin_layout Plain Layout
8038 \begin_inset Quotes erd
8044 \begin_layout Description
8045 \begin_inset Flex CharStyle:Code
8048 \begin_layout Plain Layout
8055 \begin_inset Flex CharStyle:Code
8058 \begin_layout Plain Layout
8064 ] The name of the command or environment to be used with
8065 \begin_inset Flex CharStyle:Code
8068 \begin_layout Plain Layout
8077 \begin_layout Description
8078 \begin_inset Flex CharStyle:Code
8081 \begin_layout Plain Layout
8088 \begin_inset Flex CharStyle:Code
8091 \begin_layout Plain Layout
8100 \begin_inset Flex CharStyle:Code
8103 \begin_layout Plain Layout
8109 ] Indicates what kind of markup is used to define the title of a document.
8111 \begin_inset Flex CharStyle:Code
8114 \begin_layout Plain Layout
8120 means that the macro with name
8121 \begin_inset Flex CharStyle:Code
8124 \begin_layout Plain Layout
8130 will be inserted after the last layout which has
8131 \begin_inset Quotes eld
8135 \begin_inset Flex CharStyle:Code
8138 \begin_layout Plain Layout
8145 \begin_inset Quotes erd
8150 \begin_inset Flex CharStyle:Code
8153 \begin_layout Plain Layout
8159 corresponds to the case where the block of paragraphs which have
8160 \begin_inset Quotes eld
8164 \begin_inset Flex CharStyle:Code
8167 \begin_layout Plain Layout
8174 \begin_inset Quotes erd
8177 should be enclosed into the
8178 \begin_inset Flex CharStyle:Code
8181 \begin_layout Plain Layout
8190 \begin_layout Description
8191 \begin_inset Flex CharStyle:Code
8194 \begin_layout Plain Layout
8200 Sets which divisions are included in the table of contents.
8202 \begin_inset Flex CharStyle:Code
8205 \begin_layout Plain Layout
8214 \begin_layout Subsection
8215 \begin_inset Flex CharStyle:Code
8218 \begin_layout Plain Layout
8225 \begin_inset CommandInset label
8227 name "sub:ClassOptions"
8234 \begin_layout Standard
8236 \begin_inset Flex CharStyle:Code
8239 \begin_layout Plain Layout
8245 section can contain the following entries:
8248 \begin_layout Description
8249 \begin_inset Flex CharStyle:Code
8252 \begin_layout Plain Layout
8259 \begin_inset Flex CharStyle:Code
8262 \begin_layout Plain Layout
8268 ] The list of available font sizes for the document's main font, separated
8270 \begin_inset Quotes eld
8274 \begin_inset Flex CharStyle:Code
8277 \begin_layout Plain Layout
8284 \begin_inset Quotes erd
8290 \begin_layout Description
8291 \begin_inset Flex CharStyle:Code
8294 \begin_layout Plain Layout
8300 Used to set the DTD line with XML-based output classes.
8302 \begin_inset space \thinspace{}
8306 \begin_inset Quotes eld
8309 -//OASIS//DTD DocBook V4.2//EN
8310 \begin_inset Quotes erd
8316 \begin_layout Description
8317 \begin_inset Flex CharStyle:Code
8320 \begin_layout Plain Layout
8327 \begin_inset Flex CharStyle:Code
8330 \begin_layout Plain Layout
8331 string="empty|plain|headings|fancy"
8336 ] The list of available page styles, separated by
8337 \begin_inset Quotes eld
8341 \begin_inset Flex CharStyle:Code
8344 \begin_layout Plain Layout
8351 \begin_inset Quotes erd
8357 \begin_layout Description
8358 \begin_inset Flex CharStyle:Code
8361 \begin_layout Plain Layout
8368 \begin_inset Flex CharStyle:Code
8371 \begin_layout Plain Layout
8377 ] Some document class options, separated by a comma, that will be added
8378 to the optional part of the
8379 \begin_inset Flex CharStyle:Code
8382 \begin_layout Plain Layout
8393 \begin_layout Standard
8395 \begin_inset Flex CharStyle:Code
8398 \begin_layout Plain Layout
8404 section must end with
8405 \begin_inset Quotes eld
8409 \begin_inset Flex CharStyle:Code
8412 \begin_layout Plain Layout
8419 \begin_inset Quotes erd
8425 \begin_layout Subsection
8427 \begin_inset CommandInset label
8429 name "sub:Paragraph-Styles"
8436 \begin_layout Standard
8437 A paragraph style description looks like this:
8441 \begin_layout Plain Layout
8442 Note that this will either define a new layout or modify an existing one.
8450 \begin_layout LyX-Code
8457 \begin_layout LyX-Code
8461 \begin_layout LyX-Code
8465 \begin_layout Standard
8466 where the following commands are allowed:
8469 \begin_layout Description
8470 \begin_inset Flex CharStyle:Code
8473 \begin_layout Plain Layout
8480 \begin_inset Flex CharStyle:Code
8483 \begin_layout Plain Layout
8488 , left, right, center
8493 ] Paragraph alignment.
8496 \begin_layout Description
8497 \begin_inset Flex CharStyle:Code
8500 \begin_layout Plain Layout
8507 \begin_inset Flex CharStyle:Code
8510 \begin_layout Plain Layout
8515 , left, right, center
8520 ] A comma separated list of permitted alignments.
8521 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8523 For example a right-aligned or centered enumeration isn't possible.)
8526 \begin_layout Description
8527 \begin_inset Flex CharStyle:Code
8530 \begin_layout Plain Layout
8537 \begin_inset Flex CharStyle:Code
8540 \begin_layout Plain Layout
8550 \begin_layout Plain Layout
8551 Note that a `float' here is a real number, such as: 1.5.
8556 The vertical space with which the last of a chain of paragraphs with this
8557 layout is separated from the following paragraph.
8558 If the next paragraph has another layout, the separations are not simply
8559 added, but the maximum is taken.
8562 \begin_layout Description
8563 \begin_inset Flex CharStyle:Code
8566 \begin_layout Plain Layout
8573 \begin_inset Flex CharStyle:Code
8576 \begin_layout Plain Layout
8582 The category for this style.
8583 This is used to group related styles in the Layout combobox on the toolbar.
8584 Any string can be used, but you may want to use existing categories with
8589 \begin_layout Description
8590 \begin_inset Flex CharStyle:Code
8593 \begin_layout Plain Layout
8599 Depth of XML command.
8600 Used only with XML-type formats.
8603 \begin_layout Description
8604 \begin_inset Flex CharStyle:Code
8607 \begin_layout Plain Layout
8614 \begin_inset CommandInset label
8616 name "des:CopyStyle"
8621 \begin_inset Flex CharStyle:Code
8624 \begin_layout Plain Layout
8630 Copies all the features of an existing style into the current one.
8634 \begin_layout Description
8635 \begin_inset Flex CharStyle:Code
8638 \begin_layout Plain Layout
8644 The name of a style whose preamble should be output
8649 This allows to ensure some ordering of the preamble snippets when macros
8650 definitions depend on one another.
8654 \begin_layout Plain Layout
8655 Note that, besides that functionality, there is no way to ensure any ordering
8657 The ordering that you see in a given version of LyX may change without
8658 warning in later versions.
8666 \begin_layout Description
8667 \begin_inset Flex CharStyle:Code
8670 \begin_layout Plain Layout
8677 \begin_inset Flex CharStyle:Code
8680 \begin_layout Plain Layout
8685 , Box, Filled_Box, Static
8690 ] The type of label that stands at the end of the paragraph (or sequence
8692 \begin_inset Flex CharStyle:Code
8695 \begin_layout Plain Layout
8702 \begin_inset Flex CharStyle:Code
8705 \begin_layout Plain Layout
8712 \begin_inset Flex CharStyle:Code
8715 \begin_layout Plain Layout
8722 \begin_inset Flex CharStyle:Code
8725 \begin_layout Plain Layout
8733 \begin_inset Flex CharStyle:Code
8736 \begin_layout Plain Layout
8743 \begin_inset Quotes eld
8747 \begin_inset Quotes erd
8751 \begin_inset Flex CharStyle:Code
8754 \begin_layout Plain Layout
8761 \begin_inset Flex CharStyle:Code
8764 \begin_layout Plain Layout
8765 \begin_inset space ~
8774 \begin_inset space ~
8777 black) square suitable for end of proof markers,
8778 \begin_inset Flex CharStyle:Code
8781 \begin_layout Plain Layout
8787 is an explicit text string.
8790 \begin_layout Description
8791 \begin_inset Flex CharStyle:Code
8794 \begin_layout Plain Layout
8801 \begin_inset Flex CharStyle:Code
8804 \begin_layout Plain Layout
8810 ] The string used for a label with a
8811 \begin_inset Flex CharStyle:Code
8814 \begin_layout Plain Layout
8821 \begin_inset Flex CharStyle:Code
8824 \begin_layout Plain Layout
8834 \begin_layout Description
8835 \begin_inset Flex CharStyle:Code
8838 \begin_layout Plain Layout
8845 \begin_inset Flex CharStyle:Code
8848 \begin_layout Plain Layout
8859 \begin_inset Flex CharStyle:Code
8862 \begin_layout Plain Layout
8871 \begin_layout Description
8872 \begin_inset Flex CharStyle:Code
8875 \begin_layout Plain Layout
8882 \begin_inset Flex CharStyle:Code
8885 \begin_layout Plain Layout
8895 ] With this parameter the
8896 \begin_inset Flex CharStyle:MenuItem
8899 \begin_layout Plain Layout
8906 \begin_inset Quotes eld
8909 Vertical space above
8910 \begin_inset Quotes erd
8914 \begin_inset Flex CharStyle:MenuItem
8917 \begin_layout Plain Layout
8918 Edit\SpecialChar \menuseparator
8920 \begin_inset space ~
8928 dialog can be set when initializing a paragraph with this style.
8932 \begin_layout Plain Layout
8935 Note from Jean-Marc:
8937 I'm not sure that this setting has much use, and it should probably be
8938 removed in later versions.
8946 \begin_layout Description
8947 \begin_inset Flex CharStyle:Code
8950 \begin_layout Plain Layout
8956 The font used for both the text body
8962 \begin_inset space ~
8966 \begin_inset CommandInset ref
8968 reference "sub:Font-description"
8973 Note that defining this font automatically defines the
8974 \begin_inset Flex CharStyle:Code
8977 \begin_layout Plain Layout
8984 So you should define this one first if you also want to define
8985 \begin_inset Flex CharStyle:Code
8988 \begin_layout Plain Layout
8997 \begin_layout Description
8998 \begin_inset Flex CharStyle:Code
9001 \begin_layout Plain Layout
9008 \begin_inset CommandInset label
9010 name "des:FreeSpacing"
9017 \begin_inset Flex CharStyle:Code
9020 \begin_layout Plain Layout
9031 \begin_inset Flex CharStyle:Code
9034 \begin_layout Plain Layout
9040 ] Usually LyX doesn't allow you to insert more than one space between words,
9041 since a space is considered as the separation between two words, not a
9042 character or symbol of its own.
9043 This is a very fine thing but sometimes annoying, for example, when typing
9044 program code or plain LaTeX code.
9046 \begin_inset Flex CharStyle:Code
9049 \begin_layout Plain Layout
9056 Note that LyX will create protected blanks for the additional blanks when
9057 in another mode than LaTeX-mode.
9060 \begin_layout Description
9061 \begin_inset Flex CharStyle:Code
9064 \begin_layout Plain Layout
9070 Language dependent information to be included in the LaTeX preamble when
9072 Note that this will completely override any prior
9073 \begin_inset Flex CharStyle:Code
9076 \begin_layout Plain Layout
9084 \begin_inset Quotes eld
9088 \begin_inset Flex CharStyle:Code
9091 \begin_layout Plain Layout
9098 \begin_inset Quotes erd
9102 The contents of this tag will occur once in the LaTeX preamble for each
9103 language used by the document.
9104 Each time, the following substitutions are made:
9108 \begin_layout Itemize
9109 \begin_inset Flex CharStyle:Code
9112 \begin_layout Plain Layout
9118 is replaced by the language name (as used by the babel package).
9121 \begin_layout Itemize
9123 \begin_inset Quotes eld
9127 \begin_inset Quotes erd
9131 \begin_inset Flex CharStyle:Code
9134 \begin_layout Plain Layout
9140 replaces its argument by the translation of the argument to the current
9144 \begin_layout Standard
9145 This preamble snippet will only be used if the document contains more than
9146 one language and the babel package is used.
9150 \begin_layout Description
9151 \begin_inset Flex CharStyle:Code
9154 \begin_layout Plain Layout
9161 \begin_inset Flex CharStyle:Code
9164 \begin_layout Plain Layout
9170 , but this preamble snippet occurs independently from the babel package,
9171 and only for the document language.
9173 \begin_inset Quotes eld
9177 \begin_inset Flex CharStyle:Code
9180 \begin_layout Plain Layout
9187 \begin_inset Quotes erd
9194 \begin_layout Standard
9195 If the style defines text that appears in the typeset document, it may use
9197 \begin_inset Flex CharStyle:Code
9200 \begin_layout Plain Layout
9207 \begin_inset Flex CharStyle:Code
9210 \begin_layout Plain Layout
9216 to support non-english and even multilanguage documents correctly.
9217 The following excerpt (from the
9218 \begin_inset Flex CharStyle:Code
9221 \begin_layout Plain Layout
9227 file) shows how this works:
9230 \begin_layout LyX-Code
9234 \begin_layout LyX-Code
9237 theoremstyle{remark}
9240 \begin_layout LyX-Code
9243 newtheorem{claim}[thm]{
9250 \begin_layout LyX-Code
9254 \begin_layout LyX-Code
9258 \begin_layout LyX-Code
9263 claimname}{_(Claim)}
9266 \begin_layout LyX-Code
9270 \begin_layout LyX-Code
9274 \begin_layout LyX-Code
9278 \begin_layout LyX-Code
9287 claimname}{_(Claim)}}
9290 \begin_layout LyX-Code
9294 \begin_layout Standard
9295 The key to correct translation of the user visible text is the definition
9297 \begin_inset Flex CharStyle:Code
9300 \begin_layout Plain Layout
9308 in the language preamble.
9309 This command holds the name of the theorem that will appear in the output.
9311 \begin_inset Flex CharStyle:Code
9314 \begin_layout Plain Layout
9320 then uses the commands offered by the babel package to redefine
9321 \begin_inset Flex CharStyle:Code
9324 \begin_layout Plain Layout
9332 for each used language in multilanguage documents.
9336 \begin_layout Description
9337 \begin_inset Flex CharStyle:Code
9340 \begin_layout Plain Layout
9346 [[FIXME]] (Used only with XML-type formats.)
9349 \begin_layout Description
9350 \begin_inset Flex CharStyle:Code
9353 \begin_layout Plain Layout
9360 \begin_inset Flex CharStyle:Code
9363 \begin_layout Plain Layout
9369 If 1, marks the layout as being part of a title block (see also the
9370 \begin_inset Flex CharStyle:Code
9373 \begin_layout Plain Layout
9380 \begin_inset Flex CharStyle:Code
9383 \begin_layout Plain Layout
9392 \begin_layout Description
9393 \begin_inset Flex CharStyle:Code
9396 \begin_layout Plain Layout
9403 \begin_inset Flex CharStyle:Code
9406 \begin_layout Plain Layout
9412 ] This provides extra space between paragraphs that have the same layout.
9413 If you put other layouts into an environment, each is separated with the
9415 \begin_inset Flex CharStyle:Code
9418 \begin_layout Plain Layout
9425 But the whole items of the environment are additionally separated with
9427 \begin_inset Flex CharStyle:Code
9430 \begin_layout Plain Layout
9442 \begin_layout Description
9443 \begin_inset Flex CharStyle:Code
9446 \begin_layout Plain Layout
9452 [[FIXME]] (Used only with XML-type formats.)
9455 \begin_layout Description
9456 \begin_inset Flex CharStyle:Code
9459 \begin_layout Plain Layout
9466 \begin_inset CommandInset label
9468 name "des:KeepEmpty"
9475 \begin_inset Flex CharStyle:Code
9478 \begin_layout Plain Layout
9489 \begin_inset Flex CharStyle:Code
9492 \begin_layout Plain Layout
9498 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9499 lead to empty LaTeX output.
9500 There are some cases where this could be desirable however: in a letter
9501 template, the required fields can be provided as empty fields, so that
9502 people do not forget them; in some special classes, a layout can be used
9503 as some kind of break, which does not contain actual text.
9506 \begin_layout Description
9507 \begin_inset Flex CharStyle:Code
9510 \begin_layout Plain Layout
9516 [float=0] The vertical space between the label and the text body.
9517 Only used for labels that are above the text body (
9518 \begin_inset Flex CharStyle:Code
9521 \begin_layout Plain Layout
9528 \begin_inset Flex CharStyle:Code
9531 \begin_layout Plain Layout
9532 Centered_Top_Environment
9540 \begin_layout Description
9541 \begin_inset Flex CharStyle:Code
9544 \begin_layout Plain Layout
9551 \begin_inset Flex CharStyle:Code
9554 \begin_layout Plain Layout
9561 \begin_inset Newline newline
9564 The name of the counter for automatic numbering (see Section
9565 \begin_inset CommandInset ref
9567 reference "sub:Counters"
9572 This must be given if
9573 \begin_inset Flex CharStyle:Code
9576 \begin_layout Plain Layout
9583 \begin_inset Flex CharStyle:Code
9586 \begin_layout Plain Layout
9595 \begin_layout Description
9596 \begin_inset Flex CharStyle:Code
9599 \begin_layout Plain Layout
9605 The font used for the label.
9607 \begin_inset space ~
9611 \begin_inset CommandInset ref
9613 reference "sub:Font-description"
9620 \begin_layout Description
9621 \begin_inset Flex CharStyle:Code
9624 \begin_layout Plain Layout
9630 Text that indicates how far a label should be indented.
9633 \begin_layout Description
9634 \begin_inset Flex CharStyle:Code
9637 \begin_layout Plain Layout
9644 \begin_inset Flex CharStyle:Code
9647 \begin_layout Plain Layout
9653 ] The horizontal space between the label and the text body.
9654 Only used for labels that are not above the text body.
9657 \begin_layout Description
9658 \begin_inset Flex CharStyle:Code
9661 \begin_layout Plain Layout
9668 \begin_inset Flex CharStyle:Code
9671 \begin_layout Plain Layout
9677 ] The string used for a label with a
9678 \begin_inset Flex CharStyle:Code
9681 \begin_layout Plain Layout
9689 \begin_inset Flex CharStyle:Code
9692 \begin_layout Plain Layout
9698 is set, this string can be contain the special formatting commands described
9700 \begin_inset CommandInset ref
9702 reference "sub:Counters"
9710 \begin_layout Plain Layout
9711 For the sake of backwards compatibility, the string
9712 \begin_inset Flex CharStyle:Code
9715 \begin_layout Plain Layout
9725 will be replaced by the expanded
9726 \begin_inset Flex CharStyle:Code
9729 \begin_layout Plain Layout
9736 \begin_inset Flex CharStyle:Code
9739 \begin_layout Plain Layout
9748 This feature is now obsolete and should be replaced by the mechanisms of
9750 \begin_inset CommandInset ref
9752 reference "sub:Counters"
9764 \begin_layout Description
9765 \begin_inset Flex CharStyle:Code
9768 \begin_layout Plain Layout
9775 \begin_inset Flex CharStyle:Code
9778 \begin_layout Plain Layout
9784 ] This is used inside the appendix instead of
9785 \begin_inset Flex CharStyle:Code
9788 \begin_layout Plain Layout
9796 \begin_inset Flex CharStyle:Code
9799 \begin_layout Plain Layout
9806 \begin_inset Flex CharStyle:Code
9809 \begin_layout Plain Layout
9818 \begin_layout Description
9819 \begin_inset Flex CharStyle:Code
9822 \begin_layout Plain Layout
9828 [FIXME] (Used only with XML-type formats.)
9831 \begin_layout Description
9832 \begin_inset Flex CharStyle:Code
9835 \begin_layout Plain Layout
9842 \begin_inset Flex CharStyle:Code
9845 \begin_layout Plain Layout
9850 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
9851 Enumerate, Itemize, Bibliography
9860 \begin_layout Itemize
9861 \begin_inset Flex CharStyle:Code
9864 \begin_layout Plain Layout
9870 means the label is the very first word (up to the first real blank).
9871 Use protected spaces (like
9872 \begin_inset space ~
9875 that one) if you want more than one word as the label.
9879 \begin_layout Itemize
9880 \begin_inset Flex CharStyle:Code
9883 \begin_layout Plain Layout
9889 means the label is simply whatever
9890 \begin_inset Flex CharStyle:Code
9893 \begin_layout Plain Layout
9900 Note that this really is `static'.
9903 \begin_layout Itemize
9904 \begin_inset Flex CharStyle:Code
9907 \begin_layout Plain Layout
9914 \begin_inset Flex CharStyle:Code
9917 \begin_layout Plain Layout
9918 Centered_Top_Environment
9923 are special cases of
9924 \begin_inset Flex CharStyle:Code
9927 \begin_layout Plain Layout
9934 The label will be printed above the paragraph, but only at the top of an
9935 environment or the top of a chain of paragraphs with this layout.
9936 This might be used with the
9937 \begin_inset Flex CharStyle:MenuItem
9940 \begin_layout Plain Layout
9946 layout, for example.
9949 \begin_layout Itemize
9950 \begin_inset Flex CharStyle:Code
9953 \begin_layout Plain Layout
9959 is a special case for the caption-labels
9960 \begin_inset Quotes eld
9964 \begin_inset Quotes erd
9968 \begin_inset Quotes eld
9972 \begin_inset Quotes erd
9977 \begin_inset Flex CharStyle:Code
9980 \begin_layout Plain Layout
9986 means the (hardcoded) label string depends on the kind of float: It is
9987 hardcoded to be `FloatType N', where N is the value of the counter associated
9991 \begin_layout Itemize
9993 \begin_inset Flex CharStyle:Code
9996 \begin_layout Plain Layout
10002 label type defines automatically numbered labels.
10004 \begin_inset Flex CharStyle:Code
10007 \begin_layout Plain Layout
10013 will be expanded to resolve any counter references it contains: For example,
10015 \begin_inset Quotes eld
10019 \begin_inset Flex CharStyle:Code
10022 \begin_layout Plain Layout
10033 \begin_inset Quotes erd
10038 \begin_inset CommandInset ref
10040 reference "sub:Counters"
10044 for more information on counters.
10047 \begin_layout Itemize
10048 \begin_inset Flex CharStyle:Code
10051 \begin_layout Plain Layout
10057 produces the usual sort of enumeration labels.
10058 At present, it is hardcoded to use Arabic numerals, lowercase letters,
10059 small Roman numerals, and uppercase letters for the four possible depths.
10062 \begin_layout Itemize
10063 \begin_inset Flex CharStyle:Code
10066 \begin_layout Plain Layout
10072 produces various bullets at the different levels.
10073 It is also hardcoded.
10076 \begin_layout Itemize
10077 \begin_inset Flex CharStyle:Code
10080 \begin_layout Plain Layout
10086 is used internally by LyX and should be used only with
10087 \begin_inset Flex CharStyle:Code
10090 \begin_layout Plain Layout
10091 LatexType BibEnvironment
10100 \begin_layout Description
10101 \begin_inset Flex CharStyle:Code
10104 \begin_layout Plain Layout
10110 The name of the corresponding LaTeX stuff.
10111 Either the environment or command name.
10114 \begin_layout Description
10115 \begin_inset Flex CharStyle:Code
10118 \begin_layout Plain Layout
10124 An optional parameter for the corresponding
10125 \begin_inset Flex CharStyle:Code
10128 \begin_layout Plain Layout
10135 This parameter cannot be changed from within LyX.
10138 \begin_layout Description
10139 \begin_inset Flex CharStyle:Code
10142 \begin_layout Plain Layout
10149 \begin_inset CommandInset label
10151 name "des:LatexType"
10156 \begin_inset Flex CharStyle:Code
10159 \begin_layout Plain Layout
10164 , Command, Environment, Item_Environment,
10170 \begin_inset Flex CharStyle:Code
10173 \begin_layout Plain Layout
10174 List_Environment, Bib_Environment
10179 ] How the layout should be translated into LaTeX.
10183 \begin_layout Plain Layout
10184 \begin_inset Flex CharStyle:Code
10187 \begin_layout Plain Layout
10193 is perhaps a bit misleading, since these rules apply to SGML classes, too.
10194 Visit the SGML class files for specific examples.
10203 \begin_layout Itemize
10204 \begin_inset Flex CharStyle:Code
10207 \begin_layout Plain Layout
10213 means nothing special.
10217 \begin_layout Itemize
10218 \begin_inset Flex CharStyle:Code
10221 \begin_layout Plain Layout
10228 \begin_inset Flex CharStyle:Code
10231 \begin_layout Plain Layout
10238 {\SpecialChar \ldots{}
10247 \begin_layout Itemize
10248 \begin_inset Flex CharStyle:Code
10251 \begin_layout Plain Layout
10258 \begin_inset Flex CharStyle:Code
10261 \begin_layout Plain Layout
10268 }\SpecialChar \ldots{}
10284 \begin_layout Itemize
10285 \begin_inset Flex CharStyle:Code
10288 \begin_layout Plain Layout
10295 \begin_inset Flex CharStyle:Code
10298 \begin_layout Plain Layout
10305 \begin_inset Flex CharStyle:Code
10308 \begin_layout Plain Layout
10316 is generated for each paragraph of this environment.
10320 \begin_layout Itemize
10321 \begin_inset Flex CharStyle:Code
10324 \begin_layout Plain Layout
10331 \begin_inset Flex CharStyle:Code
10334 \begin_layout Plain Layout
10341 \begin_inset Flex CharStyle:Code
10344 \begin_layout Plain Layout
10350 is passed as an argument to the environment.
10352 \begin_inset Flex CharStyle:Code
10355 \begin_layout Plain Layout
10361 can be defined in the
10362 \begin_inset Flex CharStyle:MenuItem
10365 \begin_layout Plain Layout
10370 ayout\SpecialChar \menuseparator
10384 \begin_layout Standard
10385 Putting the last few things together, the LaTeX output will be either:
10388 \begin_layout LyX-Code
10391 latexname[latexparam]{\SpecialChar \ldots{}
10395 \begin_layout Standard
10399 \begin_layout LyX-Code
10402 begin{latexname}[latexparam] \SpecialChar \ldots{}
10408 \begin_layout Standard
10409 depending upon the LaTeX type.
10413 \begin_layout Description
10414 \begin_inset Flex CharStyle:Code
10417 \begin_layout Plain Layout
10424 \begin_inset Flex CharStyle:Code
10427 \begin_layout Plain Layout
10433 ] If you put layouts into environments, the leftmargins are not simply added,
10434 but added with a factor
10435 \begin_inset Formula $\frac{4}{depth+4}$
10439 Note that this parameter is also used when the margin is defined as
10440 \begin_inset Flex CharStyle:Code
10443 \begin_layout Plain Layout
10450 \begin_inset Flex CharStyle:Code
10453 \begin_layout Plain Layout
10460 Then it is added to the manual or dynamic margin.
10462 \begin_inset Newline newline
10465 The argument is passed as a string.
10467 \begin_inset Quotes eld
10471 \begin_inset Flex CharStyle:Code
10474 \begin_layout Plain Layout
10481 \begin_inset Quotes erd
10484 means that the paragraph is indented with the width of
10485 \begin_inset Quotes eld
10489 \begin_inset Flex CharStyle:Code
10492 \begin_layout Plain Layout
10499 \begin_inset Quotes erd
10502 in the normal font.
10503 You can get a negative width by prefixing the string with
10504 \begin_inset Quotes eld
10508 \begin_inset Flex CharStyle:Code
10511 \begin_layout Plain Layout
10518 \begin_inset Quotes erd
10522 This way was chosen so that the look is the same with each used screen
10527 \begin_layout Description
10528 \begin_inset Flex CharStyle:Code
10531 \begin_layout Plain Layout
10538 \begin_inset Flex CharStyle:Code
10541 \begin_layout Plain Layout
10546 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10552 \begin_inset Newline newline
10555 The kind of margin that the layout has on the left side.
10557 \begin_inset Flex CharStyle:Code
10560 \begin_layout Plain Layout
10566 just means a fixed margin.
10568 \begin_inset Flex CharStyle:Code
10571 \begin_layout Plain Layout
10577 means that the left margin depends on the string entered in the
10578 \begin_inset Flex CharStyle:MenuItem
10581 \begin_layout Plain Layout
10582 Edit\SpecialChar \menuseparator
10584 \begin_inset space ~
10593 This is used to typeset nice lists without tabulators.
10595 \begin_inset Flex CharStyle:Code
10598 \begin_layout Plain Layout
10604 means that the margin depends on the size of the label.
10605 This is used for automatic enumerated headlines.
10606 It is obvious that the headline
10607 \begin_inset Quotes eld
10610 5.4.3.2.1 Very long headline
10611 \begin_inset Quotes erd
10614 must have a wider left margin (as wide as
10615 \begin_inset Quotes eld
10619 \begin_inset Quotes erd
10622 plus the space) than
10623 \begin_inset Quotes eld
10626 3.2 Very long headline
10627 \begin_inset Quotes erd
10631 \begin_inset Quotes eld
10635 \begin_inset Quotes erd
10638 are not able to do this.
10640 \begin_inset Flex CharStyle:Code
10643 \begin_layout Plain Layout
10649 is similar, but only the very first row of the paragraph is dynamic, while
10650 the others are static; this is used, for example, for descriptions.
10652 \begin_inset Flex CharStyle:Code
10655 \begin_layout Plain Layout
10661 means the margin is chosen in a way that the longest row of this paragraph
10662 fits to the right margin.
10663 This is used to typeset an address on the right edge of the page.
10666 \begin_layout Description
10667 \begin_inset Flex CharStyle:Code
10670 \begin_layout Plain Layout
10677 \begin_inset Flex CharStyle:Code
10680 \begin_layout Plain Layout
10689 \begin_inset Flex CharStyle:Code
10692 \begin_layout Plain Layout
10698 ] Whether fragile commands in this layout should be
10699 \begin_inset Flex CharStyle:Code
10702 \begin_layout Plain Layout
10715 whether this command should itself be protected.)
10718 \begin_layout Description
10719 \begin_inset Flex CharStyle:Code
10722 \begin_layout Plain Layout
10729 \begin_inset Flex CharStyle:Code
10732 \begin_layout Plain Layout
10739 \begin_inset Flex CharStyle:Code
10742 \begin_layout Plain Layout
10750 ] Whether newlines are translated into LaTeX newlines (
10751 \begin_inset Flex CharStyle:Code
10754 \begin_layout Plain Layout
10765 The translation can be switched off to allow more comfortable LaTeX editing
10769 \begin_layout Description
10770 \begin_inset Flex CharStyle:Code
10773 \begin_layout Plain Layout
10780 \begin_inset Flex CharStyle:Code
10783 \begin_layout Plain Layout
10790 \begin_inset Flex CharStyle:Code
10793 \begin_layout Plain Layout
10801 ] Whether the following Paragraph is allowed to indent its very first row.
10803 \begin_inset Flex CharStyle:Code
10806 \begin_layout Plain Layout
10812 means that it is not allowed to do so;
10813 \begin_inset Flex CharStyle:Code
10816 \begin_layout Plain Layout
10822 means it could do so if it wants to.
10825 \begin_layout Description
10826 \begin_inset Flex CharStyle:Code
10829 \begin_layout Plain Layout
10835 Name of a layout that has replaced this layout.
10836 This is used to rename a layout, while keeping backward compatibility.
10839 \begin_layout Description
10840 \begin_inset Flex CharStyle:Code
10843 \begin_layout Plain Layout
10850 \begin_inset Flex CharStyle:Code
10853 \begin_layout Plain Layout
10859 ] The number of optional arguments that can be used with this layout.
10860 This is useful for things like section headings, and only makes sense with
10864 \begin_layout Description
10865 \begin_inset Flex CharStyle:Code
10868 \begin_layout Plain Layout
10875 \begin_inset Flex CharStyle:Code
10878 \begin_layout Plain Layout
10884 ] The indent of the very first line of a paragraph.
10886 \begin_inset Flex CharStyle:Code
10889 \begin_layout Plain Layout
10895 will be fixed for a certain layout.
10896 The exception is Standard layout, since the indentation of a Standard layout
10897 paragraph can be prohibited with
10898 \begin_inset Flex CharStyle:Code
10901 \begin_layout Plain Layout
10908 Also, Standard layout paragraphs inside environments use the
10909 \begin_inset Flex CharStyle:Code
10912 \begin_layout Plain Layout
10918 of the environment, not their native one.
10919 For example, Standard paragraphs inside an enumeration are not indented.
10922 \begin_layout Description
10923 \begin_inset Flex CharStyle:Code
10926 \begin_layout Plain Layout
10933 \begin_inset Flex CharStyle:Code
10936 \begin_layout Plain Layout
10942 ] The vertical space between two paragraphs of this layout.
10945 \begin_layout Description
10946 \begin_inset Flex CharStyle:Code
10949 \begin_layout Plain Layout
10956 \begin_inset Flex CharStyle:Code
10959 \begin_layout Plain Layout
10965 ] LyX allows the user to choose either
10966 \begin_inset Quotes eld
10970 \begin_inset Quotes erd
10974 \begin_inset Quotes eld
10978 \begin_inset Quotes erd
10981 to typeset a document.
10983 \begin_inset Quotes eld
10987 \begin_inset Quotes erd
10990 is chosen, this value is completely ignored.
10992 \begin_inset Quotes eld
10996 \begin_inset Quotes erd
10999 is chosen, the parindent of a LaTeXtype
11000 \begin_inset Quotes eld
11004 \begin_inset Quotes erd
11007 layout is ignored and all paragraphs are separated by this parskip argument.
11008 The vertical space is calculated with
11009 \begin_inset Flex CharStyle:Code
11012 \begin_layout Plain Layout
11014 \begin_inset space ~
11023 \begin_inset Flex CharStyle:Code
11026 \begin_layout Plain Layout
11032 is the height of a row with the normal font.
11033 This way, the look stays the same with different screen fonts.
11036 \begin_layout Description
11037 \begin_inset Flex CharStyle:Code
11040 \begin_layout Plain Layout
11047 \begin_inset CommandInset label
11049 name "des:PathThru"
11056 \begin_inset Flex CharStyle:Code
11059 \begin_layout Plain Layout
11070 \begin_inset Flex CharStyle:Code
11073 \begin_layout Plain Layout
11079 ] Whether the contents of this paragraph should be output in raw form, meaning
11080 without special translations that LaTeX would require.
11083 \begin_layout Description
11084 \begin_inset Flex CharStyle:Code
11087 \begin_layout Plain Layout
11094 \begin_inset CommandInset label
11096 name "des:Preamble"
11100 Information to be included in the LaTeX preamble when this style is used.
11101 Used to define macros, load packages, etc., required by this particular
11104 \begin_inset Quotes eld
11108 \begin_inset Flex CharStyle:Code
11111 \begin_layout Plain Layout
11118 \begin_inset Quotes erd
11124 \begin_layout Description
11125 \begin_inset Flex CharStyle:Code
11128 \begin_layout Plain Layout
11135 \begin_inset Flex CharStyle:Code
11138 \begin_layout Plain Layout
11145 \begin_inset CommandInset label
11147 name "des:Requires"
11151 Whether the layout requires the feature
11152 \begin_inset Flex CharStyle:Code
11155 \begin_layout Plain Layout
11162 See the description of
11163 \begin_inset Flex CharStyle:Code
11166 \begin_layout Plain Layout
11173 \begin_inset CommandInset ref
11174 LatexCommand pageref
11175 reference "des:FreeSpacing"
11179 ) for information on `features'.
11183 \begin_layout Description
11184 \begin_inset Flex CharStyle:Code
11187 \begin_layout Plain Layout
11194 \begin_inset Flex CharStyle:Code
11197 \begin_layout Plain Layout
11204 \begin_inset Flex CharStyle:Code
11207 \begin_layout Plain Layout
11216 \begin_layout Description
11217 \begin_inset Flex CharStyle:Code
11220 \begin_layout Plain Layout
11227 \begin_inset Flex CharStyle:Code
11230 \begin_layout Plain Layout
11235 , onehalf, double, other
11244 ] This defines what the default spacing should be in the layout.
11246 \begin_inset Flex CharStyle:Code
11249 \begin_layout Plain Layout
11256 \begin_inset Flex CharStyle:Code
11259 \begin_layout Plain Layout
11266 \begin_inset Flex CharStyle:Code
11269 \begin_layout Plain Layout
11275 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
11276 If you specify the argument
11277 \begin_inset Flex CharStyle:Code
11280 \begin_layout Plain Layout
11286 , then you should also provide a numerical argument which will be the actual
11288 Note that, contrary to other parameters,
11289 \begin_inset Flex CharStyle:Code
11292 \begin_layout Plain Layout
11298 implies the generation of specific LaTeX code, using the package
11301 \begin_inset Flex CharStyle:Code
11304 \begin_layout Plain Layout
11313 \begin_layout Description
11314 \begin_inset Flex CharStyle:Code
11317 \begin_layout Plain Layout
11323 The font used for the text body .
11325 \begin_inset CommandInset ref
11327 reference "sub:Font-description"
11334 \begin_layout Description
11335 \begin_inset Flex CharStyle:Code
11338 \begin_layout Plain Layout
11346 The level of the style in the table of contents.
11347 This is used for automatic numbering of section headings.
11350 \begin_layout Description
11351 \begin_inset Flex CharStyle:Code
11354 \begin_layout Plain Layout
11361 \begin_inset Flex CharStyle:Code
11364 \begin_layout Plain Layout
11370 ] The vertical space with which the very first of a chain of paragraphs
11371 with this layout is separated from the previous paragraph.
11372 If the previous paragraph has another layout, the separations are not simply
11373 added, but the maximum is taken.
11376 \begin_layout Subsection
11378 \begin_inset CommandInset label
11387 \begin_layout Standard
11388 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11389 define the floats (
11390 \begin_inset Flex CharStyle:MenuItem
11393 \begin_layout Plain Layout
11400 \begin_inset Flex CharStyle:MenuItem
11403 \begin_layout Plain Layout
11409 , \SpecialChar \ldots{}
11410 ) in the text class itself.
11411 Standard floats are included in the file
11412 \begin_inset Flex CharStyle:Code
11415 \begin_layout Plain Layout
11421 , so you may have to do no more than add
11424 \begin_layout LyX-Code
11425 Input stdfloats.inc
11428 \begin_layout Standard
11429 to your layout file.
11430 If you want to implement a text class that proposes some other float types
11431 (like the AGU class bundled with LyX), the information below will hopefully
11435 \begin_layout Description
11436 \begin_inset Flex CharStyle:Code
11439 \begin_layout Plain Layout
11446 \begin_inset Flex CharStyle:Code
11449 \begin_layout Plain Layout
11456 \begin_inset Quotes erd
11460 \begin_inset Quotes erd
11463 ] The file name extension of an auxiliary file for the list of figures (or
11465 LaTeX writes the captions to this file.
11468 \begin_layout Description
11469 \begin_inset Flex CharStyle:Code
11472 \begin_layout Plain Layout
11479 \begin_inset Flex CharStyle:Code
11482 \begin_layout Plain Layout
11489 \begin_inset Quotes erd
11493 \begin_inset Quotes erd
11496 ] The string that will be used in the menus and also for the caption.
11499 \begin_layout Description
11500 \begin_inset Flex CharStyle:Code
11503 \begin_layout Plain Layout
11510 \begin_inset Flex CharStyle:Code
11513 \begin_layout Plain Layout
11522 \begin_inset Flex CharStyle:Code
11525 \begin_layout Plain Layout
11532 \begin_inset Flex CharStyle:Code
11535 \begin_layout Plain Layout
11541 if the float is already defined by the LaTeX document class.
11543 \begin_inset Flex CharStyle:Code
11546 \begin_layout Plain Layout
11552 , the float will be defined using the LaTeX package
11553 \begin_inset Flex CharStyle:Code
11556 \begin_layout Plain Layout
11565 \begin_layout Description
11566 \begin_inset Flex CharStyle:Code
11569 \begin_layout Plain Layout
11576 \begin_inset Flex CharStyle:Code
11579 \begin_layout Plain Layout
11586 \begin_inset Quotes erd
11590 \begin_inset Quotes erd
11593 ] The heading used for the list of floats.
11596 \begin_layout Description
11597 \begin_inset Flex CharStyle:Code
11600 \begin_layout Plain Layout
11607 \begin_inset Flex CharStyle:Code
11610 \begin_layout Plain Layout
11617 \begin_inset Quotes erd
11621 \begin_inset Quotes erd
11624 ] This (optional) argument determines whether floats of this class will
11625 be numbered within some sectional unit of the document.
11626 For example, if within is equal to
11627 \begin_inset Flex CharStyle:Code
11630 \begin_layout Plain Layout
11636 , the floats will be numbered within chapters.
11640 \begin_layout Description
11641 \begin_inset Flex CharStyle:Code
11644 \begin_layout Plain Layout
11651 \begin_inset Flex CharStyle:Code
11654 \begin_layout Plain Layout
11661 \begin_inset Quotes erd
11665 \begin_inset Quotes erd
11668 ] The default placement for the given class of floats.
11669 The string should be as in standard LaTeX:
11670 \begin_inset Flex CharStyle:Code
11673 \begin_layout Plain Layout
11680 \begin_inset Flex CharStyle:Code
11683 \begin_layout Plain Layout
11690 \begin_inset Flex CharStyle:Code
11693 \begin_layout Plain Layout
11700 \begin_inset Flex CharStyle:Code
11703 \begin_layout Plain Layout
11709 for top, bottom, page, and here, respectively.
11713 \begin_layout Plain Layout
11714 Note that the order of these letters in the string is irrelevant, like in
11720 On top of that there is a new type,
11721 \begin_inset Flex CharStyle:Code
11724 \begin_layout Plain Layout
11730 , which does not really correspond to a float, since it means: put it
11731 \begin_inset Quotes eld
11735 \begin_inset Quotes erd
11739 Note however that the
11740 \begin_inset Flex CharStyle:Code
11743 \begin_layout Plain Layout
11749 specifier is special and, because of implementation details, cannot be
11750 used in non-built in float types.
11751 If you do not understand what this means, just use
11752 \begin_inset Quotes eld
11756 \begin_inset Flex CharStyle:Code
11759 \begin_layout Plain Layout
11766 \begin_inset Quotes erd
11772 \begin_layout Description
11773 \begin_inset Flex CharStyle:Code
11776 \begin_layout Plain Layout
11783 \begin_inset Flex CharStyle:Code
11786 \begin_layout Plain Layout
11793 \begin_inset Quotes erd
11797 \begin_inset Quotes erd
11800 ] The style used when defining the float using
11801 \begin_inset Flex CharStyle:Code
11804 \begin_layout Plain Layout
11815 \begin_layout Description
11816 \begin_inset Flex CharStyle:Code
11819 \begin_layout Plain Layout
11826 \begin_inset Flex CharStyle:Code
11829 \begin_layout Plain Layout
11836 \begin_inset Quotes erd
11840 \begin_inset Quotes erd
11844 \begin_inset Quotes eld
11848 \begin_inset Quotes erd
11851 of the new class of floats, like program or algorithm.
11852 After the appropriate
11853 \begin_inset Flex CharStyle:Code
11856 \begin_layout Plain Layout
11865 \begin_inset Flex CharStyle:Code
11868 \begin_layout Plain Layout
11877 \begin_inset Flex CharStyle:Code
11880 \begin_layout Plain Layout
11891 \begin_layout Standard
11892 Note that defining a float with type
11893 \begin_inset Flex CharStyle:Code
11896 \begin_layout Plain Layout
11904 automatically defines the corresponding counter with name
11905 \begin_inset Flex CharStyle:Code
11908 \begin_layout Plain Layout
11919 \begin_layout Subsection
11920 Flex insets and InsetLayout
11921 \begin_inset CommandInset label
11923 name "sub:Flex-insets-and"
11930 \begin_layout Standard
11931 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11932 these are called Flex insets.
11936 \begin_layout Standard
11937 Flex insets come in three different kinds:
11940 \begin_layout Itemize
11942 \begin_inset Flex CharStyle:Code
11945 \begin_layout Plain Layout
11951 ): These define semantic markup corresponding to such LaTeX commands as
11953 \begin_inset Flex CharStyle:Code
11956 \begin_layout Plain Layout
11965 \begin_inset Flex CharStyle:Code
11968 \begin_layout Plain Layout
11979 \begin_layout Itemize
11981 \begin_inset Flex CharStyle:Code
11984 \begin_layout Plain Layout
11990 ): These can be used to define custom collapsible insets, similar to TeX
11991 code, footnote, and the like.
11992 An obvious example is an endnote inset, which is defined in the
11993 \begin_inset Flex CharStyle:Code
11996 \begin_layout Plain Layout
12005 \begin_layout Itemize
12007 \begin_inset Flex CharStyle:Code
12010 \begin_layout Plain Layout
12016 ): For use with DocBook classes.
12019 \begin_layout Standard
12020 Flex insets are defined using the
12021 \begin_inset Flex CharStyle:Code
12024 \begin_layout Plain Layout
12030 tag, which shall be explained in a moment.
12033 \begin_layout Standard
12035 \begin_inset Flex CharStyle:Code
12038 \begin_layout Plain Layout
12044 tag also serves another function: It can be used to customize the general
12045 layout of many different types of insets.
12047 \begin_inset Flex CharStyle:Code
12050 \begin_layout Plain Layout
12056 can be used to customize the layout parameters for footnotes, marginal
12057 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
12058 boxes, tables, algorithms, URLs, and optional arguments, as well as to
12059 define Flex insets.
12062 \begin_layout Standard
12064 \begin_inset Flex CharStyle:Code
12067 \begin_layout Plain Layout
12073 definition must begin with a line of the form:
12076 \begin_layout LyX-Code
12080 \begin_layout Standard
12082 \begin_inset Flex CharStyle:Code
12085 \begin_layout Plain Layout
12091 indicates the inset whose layout is being defined, and here there are two
12095 \begin_layout Enumerate
12096 The layout for a pre-existing inset is being modified.
12097 In this case, can be
12098 \begin_inset Flex CharStyle:Code
12101 \begin_layout Plain Layout
12107 any one of the following:
12108 \begin_inset Flex CharStyle:Code
12111 \begin_layout Plain Layout
12118 \begin_inset Flex CharStyle:Code
12121 \begin_layout Plain Layout
12128 \begin_inset Flex CharStyle:Code
12131 \begin_layout Plain Layout
12138 \begin_inset Flex CharStyle:Code
12141 \begin_layout Plain Layout
12148 \begin_inset Flex CharStyle:Code
12151 \begin_layout Plain Layout
12158 \begin_inset Flex CharStyle:Code
12161 \begin_layout Plain Layout
12168 \begin_inset Flex CharStyle:Code
12171 \begin_layout Plain Layout
12178 \begin_inset Flex CharStyle:Code
12181 \begin_layout Plain Layout
12188 \begin_inset Flex CharStyle:Code
12191 \begin_layout Plain Layout
12198 \begin_inset Flex CharStyle:Code
12201 \begin_layout Plain Layout
12208 \begin_inset Flex CharStyle:Code
12211 \begin_layout Plain Layout
12218 \begin_inset Flex CharStyle:Code
12221 \begin_layout Plain Layout
12228 \begin_inset Flex CharStyle:Code
12231 \begin_layout Plain Layout
12238 \begin_inset Flex CharStyle:Code
12241 \begin_layout Plain Layout
12248 \begin_inset Flex CharStyle:Code
12251 \begin_layout Plain Layout
12258 \begin_inset Flex CharStyle:Code
12261 \begin_layout Plain Layout
12268 \begin_inset Flex CharStyle:Code
12271 \begin_layout Plain Layout
12278 \begin_inset Flex CharStyle:Code
12281 \begin_layout Plain Layout
12288 \begin_inset Flex CharStyle:Code
12291 \begin_layout Plain Layout
12298 \begin_inset Flex CharStyle:Code
12301 \begin_layout Plain Layout
12311 \begin_layout Enumerate
12312 The layout for a Flex inset is being defined.
12314 \begin_inset Flex CharStyle:Code
12317 \begin_layout Plain Layout
12323 can be any valid identifier not used by a pre-existing inset.
12324 Note that the definition of a flex inset must
12329 \begin_inset Flex CharStyle:Code
12332 \begin_layout Plain Layout
12341 \begin_layout Standard
12343 \begin_inset Flex CharStyle:Code
12346 \begin_layout Plain Layout
12352 definition can contain the following entries:
12355 \begin_layout Description
12356 \begin_inset Flex CharStyle:Code
12359 \begin_layout Plain Layout
12365 The color for the inset's background.
12366 The valid colors are defined in
12367 \begin_inset Flex CharStyle:Code
12370 \begin_layout Plain Layout
12379 \begin_layout Description
12380 \begin_inset Flex CharStyle:Code
12383 \begin_layout Plain Layout
12389 As with paragraph styles (see page
12390 \begin_inset CommandInset ref
12392 reference "des:CopyStyle"
12399 \begin_layout Description
12400 \begin_inset Flex CharStyle:Code
12403 \begin_layout Plain Layout
12410 \begin_inset Flex CharStyle:Code
12413 \begin_layout Plain Layout
12422 \begin_inset Flex CharStyle:Code
12425 \begin_layout Plain Layout
12431 ] Indicates whether the user may employ the Paragraph Settings dialog to
12432 customize the paragraph.
12435 \begin_layout Description
12436 \begin_inset Flex CharStyle:Code
12439 \begin_layout Plain Layout
12446 \begin_inset Flex CharStyle:Code
12449 \begin_layout Plain Layout
12456 \begin_inset Flex CharStyle:Code
12459 \begin_layout Plain Layout
12466 \begin_inset Flex CharStyle:Code
12469 \begin_layout Plain Layout
12475 , describing the rendering style used for the inset's frame and buttons.
12476 Footnotes generally use
12477 \begin_inset Flex CharStyle:Code
12480 \begin_layout Plain Layout
12486 , ERT insets generally
12487 \begin_inset Flex CharStyle:Code
12490 \begin_layout Plain Layout
12496 , and character styles
12497 \begin_inset Flex CharStyle:Code
12500 \begin_layout Plain Layout
12509 \begin_layout Description
12510 \begin_inset Flex CharStyle:Code
12513 \begin_layout Plain Layout
12519 Required at the end of the InsetLayout declarations.
12522 \begin_layout Description
12523 \begin_inset Flex CharStyle:Code
12526 \begin_layout Plain Layout
12532 The font used for both the text body
12538 \begin_inset space ~
12542 \begin_inset CommandInset ref
12544 reference "sub:Font-description"
12549 Note that defining this font automatically defines the
12550 \begin_inset Flex CharStyle:Code
12553 \begin_layout Plain Layout
12559 to the same value, so define this first and define
12560 \begin_inset Flex CharStyle:Code
12563 \begin_layout Plain Layout
12569 later if you want them to be different.
12572 \begin_layout Description
12573 \begin_inset Flex CharStyle:Code
12576 \begin_layout Plain Layout
12583 \begin_inset Quotes eld
12587 \begin_inset Quotes erd
12590 language, leading to Left-to-Right (latin) output, e.
12591 \begin_inset space \thinspace{}
12595 \begin_inset space \space{}
12598 in TeX code or URL.
12602 \begin_layout Description
12603 \begin_inset Flex CharStyle:Code
12606 \begin_layout Plain Layout
12613 \begin_inset Flex CharStyle:Code
12616 \begin_layout Plain Layout
12625 \begin_inset Flex CharStyle:Code
12628 \begin_layout Plain Layout
12634 ] Indicates whether the PlainLayout should be used or, instead, the user
12635 can change the paragraph style used in the inset.
12638 \begin_layout Description
12639 \begin_inset Flex CharStyle:Code
12642 \begin_layout Plain Layout
12648 As with paragraph styles (see page
12649 \begin_inset CommandInset ref
12650 LatexCommand pageref
12651 reference "des:FreeSpacing"
12658 \begin_layout Description
12659 \begin_inset Flex CharStyle:Code
12662 \begin_layout Plain Layout
12669 \begin_inset Flex CharStyle:Code
12672 \begin_layout Plain Layout
12681 \begin_inset Flex CharStyle:Code
12684 \begin_layout Plain Layout
12690 ] Whether to include the contents of this inset in the strings generated
12691 for the `Outline' pane.
12692 One would not, for example, want the content of a footnote in a section
12693 header to be included in the TOC displayed in the outline, but one would
12694 normally want the content of a character style displayed.
12695 Default is false: not to include.
12698 \begin_layout Description
12699 \begin_inset Flex CharStyle:Code
12702 \begin_layout Plain Layout
12708 As with paragraph styles (see page
12709 \begin_inset CommandInset ref
12710 LatexCommand pageref
12711 reference "des:KeepEmpty"
12718 \begin_layout Description
12719 \begin_inset Flex CharStyle:Code
12722 \begin_layout Plain Layout
12728 The font used for the label.
12730 \begin_inset space ~
12734 \begin_inset CommandInset ref
12736 reference "sub:Font-description"
12741 Note that this definition can never appear before
12742 \begin_inset Flex CharStyle:Code
12745 \begin_layout Plain Layout
12751 , lest it be ineffective.
12754 \begin_layout Description
12755 \begin_inset Flex CharStyle:Code
12758 \begin_layout Plain Layout
12764 What will be displayed on the button or elsewhere as the inset label.
12765 Some inset types (TeX code and Branch) modify this label on the fly.
12768 \begin_layout Description
12769 \begin_inset Flex CharStyle:Code
12772 \begin_layout Plain Layout
12778 The name of the corresponding LaTeX stuff.
12779 Either the environment or command name.
12782 \begin_layout Description
12783 \begin_inset Flex CharStyle:Code
12786 \begin_layout Plain Layout
12792 The optional parameter for the corresponding
12793 \begin_inset Flex CharStyle:Code
12796 \begin_layout Plain Layout
12802 stuff, including possible bracket pairs like
12803 \begin_inset Flex CharStyle:Code
12806 \begin_layout Plain Layout
12813 This parameter cannot be changed from within LyX.
12816 \begin_layout Description
12817 \begin_inset Flex CharStyle:Code
12820 \begin_layout Plain Layout
12826 As with paragraph styles (see page
12827 \begin_inset CommandInset ref
12828 LatexCommand pageref
12829 reference "des:LatexType"
12836 \begin_layout Description
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 (indicating a dummy definition ending definitions of charstyles, etc).
12887 This entry is required in and is only meaningful for Flex insets.
12888 Among other things, it determines on which menu this inset will appear.
12891 \begin_layout Description
12892 \begin_inset Flex CharStyle:Code
12895 \begin_layout Plain Layout
12902 \begin_inset Flex CharStyle:Code
12905 \begin_layout Plain Layout
12914 \begin_inset Flex CharStyle:Code
12917 \begin_layout Plain Layout
12923 ] Whether multiple paragraphs are permitted in this inset.
12924 This will also set CustomPars to the same value and ForcePlain to the opposite
12926 These can be reset to other values, if they are used
12933 \begin_layout Description
12934 \begin_inset Flex CharStyle:Code
12937 \begin_layout Plain Layout
12944 \begin_inset Flex CharStyle:Code
12947 \begin_layout Plain Layout
12956 \begin_inset Flex CharStyle:Code
12959 \begin_layout Plain Layout
12965 ] Whether fragile commands in this layout should be
12966 \begin_inset Flex CharStyle:Code
12969 \begin_layout Plain Layout
12982 whether the command should itself be protected.)
12985 \begin_layout Description
12986 \begin_inset Flex CharStyle:Code
12989 \begin_layout Plain Layout
12996 \begin_inset Flex CharStyle:Code
12999 \begin_layout Plain Layout
13008 \begin_inset Flex CharStyle:Code
13011 \begin_layout Plain Layout
13017 ] As with paragraph styles (see page
13018 \begin_inset CommandInset ref
13020 reference "des:PathThru"
13027 \begin_layout Description
13028 \begin_inset Flex CharStyle:Code
13031 \begin_layout Plain Layout
13037 As with paragraph styles (see page
13038 \begin_inset CommandInset ref
13039 LatexCommand pageref
13040 reference "des:Preamble"
13047 \begin_layout Description
13048 \begin_inset Flex CharStyle:Code
13051 \begin_layout Plain Layout
13058 \begin_inset Flex CharStyle:Code
13061 \begin_layout Plain Layout
13067 ] As with paragraph styles (see page
13068 \begin_inset CommandInset ref
13069 LatexCommand pageref
13070 reference "des:Requires"
13077 \begin_layout Subsection
13079 \begin_inset CommandInset label
13081 name "sub:Counters"
13088 \begin_layout Standard
13089 Since version 1.3.0 of LyX, it is both possible and necessary to define the
13091 \begin_inset Flex CharStyle:MenuItem
13094 \begin_layout Plain Layout
13101 \begin_inset Flex CharStyle:MenuItem
13104 \begin_layout Plain Layout
13110 , \SpecialChar \ldots{}
13111 ) in the text class itself.
13112 The standard counters are defined in the file
13113 \begin_inset Flex CharStyle:Code
13116 \begin_layout Plain Layout
13122 , so you may have to do no more than add
13125 \begin_layout LyX-Code
13126 Input stdcounters.inc
13129 \begin_layout Standard
13130 to your layout file to get them to work.
13131 But if you want to define custom counters, then you can do so.
13132 The counter declaration must begin with:
13135 \begin_layout LyX-Code
13139 \begin_layout Standard
13140 where of course `name' is replaced by the name of the counter.
13141 And it must end with
13142 \begin_inset Quotes eld
13146 \begin_inset Flex CharStyle:Code
13149 \begin_layout Plain Layout
13156 \begin_inset Quotes erd
13160 The following parameters can also be used:
13163 \begin_layout Description
13164 \begin_inset Flex CharStyle:Code
13167 \begin_layout Plain Layout
13168 LabelString [string=""]
13173 when this is defined, this string defines how the counter is displayed.
13174 Setting this value sets
13175 \begin_inset Flex CharStyle:Code
13178 \begin_layout Plain Layout
13179 LabelStringAppendix
13185 The following special constructs can be used in the string:
13189 \begin_layout Itemize
13190 \begin_inset Flex CharStyle:Code
13193 \begin_layout Plain Layout
13201 will be replaced by the expansion of the
13202 \begin_inset Flex CharStyle:Code
13205 \begin_layout Plain Layout
13212 \begin_inset Flex CharStyle:Code
13215 \begin_layout Plain Layout
13216 LabelStringAppendix
13222 \begin_inset Flex CharStyle:Code
13225 \begin_layout Plain Layout
13235 \begin_layout Itemize
13236 counter values can be expressed using LaTeX-like macros
13237 \begin_inset Flex CharStyle:Code
13240 \begin_layout Plain Layout
13257 \begin_inset Flex CharStyle:Code
13260 \begin_layout Plain Layout
13272 \begin_layout Plain Layout
13282 Actually, the situation is a bit more complicated: any
13301 other than those described below will produce arabic numerals.
13302 It would not be surprising to see this change in the future.
13308 \begin_inset Flex CharStyle:Code
13311 \begin_layout Plain Layout
13317 : 1, 2, 3,\SpecialChar \ldots{}
13319 \begin_inset Flex CharStyle:Code
13322 \begin_layout Plain Layout
13328 for lower-case letters: a, b, c, \SpecialChar \ldots{}
13330 \begin_inset Flex CharStyle:Code
13333 \begin_layout Plain Layout
13339 for upper-case letters: A, B, C, \SpecialChar \ldots{}
13341 \begin_inset Flex CharStyle:Code
13344 \begin_layout Plain Layout
13350 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13352 \begin_inset Flex CharStyle:Code
13355 \begin_layout Plain Layout
13361 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13363 \begin_inset Flex CharStyle:Code
13366 \begin_layout Plain Layout
13372 for hebrew numerals.
13376 \begin_layout Standard
13377 If LabelString is not defined, a default value is constructed as follows:
13378 if the counter has a master counter
13379 \begin_inset Flex CharStyle:Code
13382 \begin_layout Plain Layout
13389 \begin_inset Flex CharStyle:Code
13392 \begin_layout Plain Layout
13399 \begin_inset Flex CharStyle:Code
13402 \begin_layout Plain Layout
13412 is used; otherwise the string
13413 \begin_inset Flex CharStyle:Code
13416 \begin_layout Plain Layout
13427 \begin_layout Description
13428 \begin_inset Flex CharStyle:Code
13431 \begin_layout Plain Layout
13432 LabelStringAppendix [string=""]
13438 \begin_inset Flex CharStyle:Code
13441 \begin_layout Plain Layout
13447 , but for use in the Appendix.
13450 \begin_layout Description
13451 \begin_inset Flex CharStyle:Code
13454 \begin_layout Plain Layout
13461 \begin_inset Flex CharStyle:Code
13464 \begin_layout Plain Layout
13471 \begin_inset Quotes erd
13475 \begin_inset Quotes erd
13478 ] If this is set to the name of another counter, the present counter will
13479 be reset every time the other one is increased.
13481 \begin_inset Flex CharStyle:Code
13484 \begin_layout Plain Layout
13491 \begin_inset Flex CharStyle:Code
13494 \begin_layout Plain Layout
13503 \begin_layout Subsection
13505 \begin_inset CommandInset label
13507 name "sub:Font-description"
13514 \begin_layout Standard
13515 A font description looks like this:
13518 \begin_layout LyX-Code
13528 \begin_layout LyX-Code
13532 \begin_layout LyX-Code
13536 \begin_layout Standard
13537 The following commands are available:
13540 \begin_layout Description
13541 \begin_inset Flex CharStyle:Code
13544 \begin_layout Plain Layout
13551 \begin_inset Flex CharStyle:Code
13554 \begin_layout Plain Layout
13563 \begin_inset Flex CharStyle:Code
13566 \begin_layout Plain Layout
13573 \begin_inset Flex CharStyle:Code
13576 \begin_layout Plain Layout
13583 \begin_inset Flex CharStyle:Code
13586 \begin_layout Plain Layout
13593 \begin_inset Flex CharStyle:Code
13596 \begin_layout Plain Layout
13603 \begin_inset Flex CharStyle:Code
13606 \begin_layout Plain Layout
13613 \begin_inset Flex CharStyle:Code
13616 \begin_layout Plain Layout
13623 \begin_inset Flex CharStyle:Code
13626 \begin_layout Plain Layout
13633 \begin_inset Flex CharStyle:Code
13636 \begin_layout Plain Layout
13645 \begin_layout Description
13646 \begin_inset Flex CharStyle:Code
13649 \begin_layout Plain Layout
13658 \begin_inset Flex CharStyle:Code
13661 \begin_layout Plain Layout
13672 \begin_inset Flex CharStyle:Code
13675 \begin_layout Plain Layout
13682 \begin_inset Flex CharStyle:Code
13685 \begin_layout Plain Layout
13694 \begin_layout Description
13695 \begin_inset Flex CharStyle:Code
13698 \begin_layout Plain Layout
13705 \begin_inset Flex CharStyle:Code
13708 \begin_layout Plain Layout
13714 ] Valid argument are:
13715 \begin_inset Flex CharStyle:Code
13718 \begin_layout Plain Layout
13725 \begin_inset Flex CharStyle:Code
13728 \begin_layout Plain Layout
13735 \begin_inset Flex CharStyle:Code
13738 \begin_layout Plain Layout
13745 \begin_inset Flex CharStyle:Code
13748 \begin_layout Plain Layout
13755 \begin_inset Flex CharStyle:Code
13758 \begin_layout Plain Layout
13765 \begin_inset Flex CharStyle:Code
13768 \begin_layout Plain Layout
13775 Each of these turns on or off the corresponding attribute.
13778 \begin_layout Description
13779 \begin_inset Flex CharStyle:Code
13782 \begin_layout Plain Layout
13791 \begin_inset Flex CharStyle:Code
13794 \begin_layout Plain Layout
13805 \begin_inset Flex CharStyle:Code
13808 \begin_layout Plain Layout
13817 \begin_layout Description
13818 \begin_inset Flex CharStyle:Code
13821 \begin_layout Plain Layout
13830 \begin_inset Flex CharStyle:Code
13833 \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
13876 \begin_layout Description
13877 \begin_inset Flex CharStyle:Code
13880 \begin_layout Plain Layout
13887 \begin_inset Flex CharStyle:Code
13890 \begin_layout Plain Layout
13897 \begin_inset Flex CharStyle:Code
13900 \begin_layout Plain Layout
13907 \begin_inset Flex CharStyle:Code
13910 \begin_layout Plain Layout
13919 \begin_inset Flex CharStyle:Code
13922 \begin_layout Plain Layout
13929 \begin_inset Flex CharStyle:Code
13932 \begin_layout Plain Layout
13939 \begin_inset Flex CharStyle:Code
13942 \begin_layout Plain Layout
13949 \begin_inset Flex CharStyle:Code
13952 \begin_layout Plain Layout
13959 \begin_inset Flex CharStyle:Code
13962 \begin_layout Plain Layout
13971 \begin_layout Subsection
13972 Upgrading old layout files
13975 \begin_layout Standard
13976 The file format of layout files changes from time to time, so old layout
13977 files need to be converted.
13978 This process has been automated since LyX 1.4.0: If LyX reads an old format
13979 layout file it will call the conversion tool
13980 \begin_inset Flex CharStyle:Code
13983 \begin_layout Plain Layout
13984 LyXDir/scripts/layout2layout.py
13989 and convert it to a temporary file in current format.
13990 The original file is left untouched.
13991 If you want to convert the layout file permanently, just call the converter
13995 \begin_layout LyX-Code
13996 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13999 \begin_layout Standard
14000 (You need to replace
14001 \begin_inset Flex CharStyle:Code
14004 \begin_layout Plain Layout
14010 with the name of your LyX system directory, unless you happen to have defined
14011 such an environment variable.) Then copy
14012 \begin_inset Flex CharStyle:Code
14015 \begin_layout Plain Layout
14022 \begin_inset Flex CharStyle:Code
14025 \begin_layout Plain Layout
14034 \begin_layout Standard
14035 The automatic conversion only handles syntax changes.
14036 It cannot handle the case where the contents of included files was changed,
14037 so these will have to be converted separately.
14040 \begin_layout Section
14042 \begin_inset CommandInset label
14044 name "sec:Creating-Templates"
14051 \begin_layout Standard
14052 Templates are created just like usual documents.
14053 The only difference is that usual documents contain all possible settings,
14054 including the font scheme and the paper size.
14055 Usually a user doesn't want a template to overwrite his defaults in these
14057 For that reason, the designer of a template should remove the corresponding
14059 \begin_inset Flex CharStyle:Code
14062 \begin_layout Plain Layout
14071 \begin_inset Flex CharStyle:Code
14074 \begin_layout Plain Layout
14082 from the template LyX file.
14083 This can be done with any simple text-editor, for example
14084 \begin_inset Flex CharStyle:Code
14087 \begin_layout Plain Layout
14094 \begin_inset Flex CharStyle:Code
14097 \begin_layout Plain Layout
14107 \begin_layout Standard
14108 Put the edited template files you create in
14109 \begin_inset Flex CharStyle:Code
14112 \begin_layout Plain Layout
14118 , copy the ones you use from the global template directory in
14119 \begin_inset Flex CharStyle:Code
14122 \begin_layout Plain Layout
14128 to the same place, and redefine the template path in the
14129 \begin_inset Flex CharStyle:MenuItem
14132 \begin_layout Plain Layout
14133 Tools\SpecialChar \menuseparator
14134 Preferences\SpecialChar \menuseparator
14143 \begin_layout Standard
14144 Note that there is a template which has a particular meaning:
14145 \begin_inset Flex CharStyle:Code
14148 \begin_layout Plain Layout
14155 This template is loaded every time you create a new document with
14156 \begin_inset Flex CharStyle:MenuItem
14159 \begin_layout Plain Layout
14160 File\SpecialChar \menuseparator
14166 in order to provide useful defaults.
14167 To create this template from inside LyX, all you have to do is to open
14168 a document with the correct settings, and use the
14169 \begin_inset Flex CharStyle:MenuItem
14172 \begin_layout Plain Layout
14173 Save as Document Defaults
14181 \begin_layout Chapter
14182 Including External Material
14185 \begin_layout Standard
14186 \begin_inset Box Shadowbox
14195 height_special "totalheight"
14198 \begin_layout Plain Layout
14199 WARNING: This portion of the documentation has not been updated for some
14201 We certainly hope that it is still accurate, but there are no guarantees.
14209 \begin_layout Standard
14210 The use of material from sources external to LyX is covered in detail in
14216 This part of the manual covers what needs to happen behind the scenes for
14217 new sorts of material to be included.
14220 \begin_layout Section
14224 \begin_layout Standard
14225 The external material feature is based on the concept of a
14230 A template is a specification of how LyX should interface with a certain
14232 As bundled, LyX comes with predefined templates for Xfig figures, various
14233 raster format images, chess diagrams, and LilyPond music notation.
14234 You can check the actual list by using the menu
14235 \begin_inset Flex CharStyle:MenuItem
14238 \begin_layout Plain Layout
14239 Insert\SpecialChar \menuseparator
14240 File\SpecialChar \menuseparator
14247 Furthermore, it is possible to roll your own template to support a specific
14249 Later we'll describe in more detail what is involved, and hopefully you
14250 will submit all the templates you create so we can include them in a later
14254 \begin_layout Standard
14255 Another basic idea of the external material feature is to distinguish between
14256 the original file that serves as a base for final material and the produced
14257 file that is included in your exported or printed document.
14258 For example, consider the case of a figure produced with
14259 \begin_inset Flex CharStyle:Code
14262 \begin_layout Plain Layout
14269 The Xfig application itself works on an original file with the
14270 \begin_inset Flex CharStyle:Code
14273 \begin_layout Plain Layout
14280 Within Xfig, you create and change your figure, and when you are done,
14282 \begin_inset Flex CharStyle:Code
14285 \begin_layout Plain Layout
14292 When you want to include the figure in your document, you invoke
14293 \begin_inset Flex CharStyle:Code
14296 \begin_layout Plain Layout
14302 in order to create a PostScript file that can readily be included in your
14305 \begin_inset Flex CharStyle:Code
14308 \begin_layout Plain Layout
14314 file is the original file, and the PostScript file is the produced file.
14317 \begin_layout Standard
14318 This distinction is important in order to allow updating of the material
14319 while you are in the process of writing the document.
14320 Furthermore, it provides us with the flexibility that is needed to support
14321 multiple export formats.
14322 For instance, in the case of a plain text file, it is not exactly an award-winn
14323 ing idea to include the figure as raw PostScript.
14324 Instead, you'd either prefer to just include a reference to the figure
14325 or try to invoke some graphics to ASCII converter to make the final result
14326 look similar to the real graphics.
14327 The external material management allows you to do this, because it is parametri
14328 zed on the different export formats that LyX supports.
14331 \begin_layout Standard
14332 Besides supporting the production of different products according to the
14333 exported format, it supports tight integration with editing and viewing
14335 In the case of an Xfig figure, you are able to invoke Xfig on the original
14336 file with a single click from within the external material dialog in LyX,
14337 and also preview the produced PostScript file with Ghostview with another
14339 No more fiddling around with the command line and/or file browsers to locate
14340 and manipulate the original or produced files.
14341 In this way, you are finally able to take full advantage of the many different
14342 applications that are relevant to use when you write your documents, and
14343 ultimately be more productive.
14346 \begin_layout Section
14347 The external template configuration file
14350 \begin_layout Standard
14351 It is relatively easy to add custom external template definitions to LyX.
14352 However, be aware that doing this in an careless manner most probably
14356 introduce an easily exploitable security hole.
14357 So before you do this, please read the discussion about security in section
14359 \begin_inset CommandInset ref
14361 reference "sec:Security-discussion"
14368 \begin_layout Standard
14369 Having said that, we encourage you to submit any interesting templates that
14374 \begin_layout Standard
14375 The external templates are defined in the
14376 \begin_inset Flex CharStyle:Code
14379 \begin_layout Plain Layout
14380 LyXDir/lib/external_templates
14386 You can place your own version in
14387 \begin_inset Flex CharStyle:Code
14390 \begin_layout Plain Layout
14391 UserDir/external_templates
14399 \begin_layout Standard
14400 A typical template looks like this:
14403 \begin_layout LyX-Code
14407 \begin_layout LyX-Code
14408 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14411 \begin_layout LyX-Code
14415 \begin_layout LyX-Code
14419 \begin_layout LyX-Code
14423 \begin_layout LyX-Code
14427 \begin_layout LyX-Code
14431 \begin_layout LyX-Code
14432 AutomaticProduction true
14435 \begin_layout LyX-Code
14439 \begin_layout LyX-Code
14443 \begin_layout LyX-Code
14447 \begin_layout LyX-Code
14448 TransformCommand Rotate RotationLatexCommand
14451 \begin_layout LyX-Code
14452 TransformCommand Resize ResizeLatexCommand
14455 \begin_layout LyX-Code
14456 Product "$$RotateFront$$ResizeFront
14459 \begin_layout LyX-Code
14464 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14467 \begin_layout LyX-Code
14468 $$ResizeBack$$RotateBack"
14471 \begin_layout LyX-Code
14475 \begin_layout LyX-Code
14476 UpdateResult "$$AbsPath$$Basename.pstex_t"
14479 \begin_layout LyX-Code
14480 Requirement "graphicx"
14483 \begin_layout LyX-Code
14484 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14487 \begin_layout LyX-Code
14488 ReferencedFile latex "$$AbsPath$$Basename.eps"
14491 \begin_layout LyX-Code
14492 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14495 \begin_layout LyX-Code
14499 \begin_layout LyX-Code
14503 \begin_layout LyX-Code
14504 TransformCommand Rotate RotationLatexCommand
14507 \begin_layout LyX-Code
14508 TransformCommand Resize ResizeLatexCommand
14511 \begin_layout LyX-Code
14512 Product "$$RotateFront$$ResizeFront
14515 \begin_layout LyX-Code
14520 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14523 \begin_layout LyX-Code
14524 $$ResizeBack$$RotateBack"
14527 \begin_layout LyX-Code
14528 UpdateFormat pdftex
14531 \begin_layout LyX-Code
14532 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14535 \begin_layout LyX-Code
14536 Requirement "graphicx"
14539 \begin_layout LyX-Code
14540 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14543 \begin_layout LyX-Code
14544 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14547 \begin_layout LyX-Code
14551 \begin_layout LyX-Code
14555 \begin_layout LyX-Code
14556 Product "$$Contents(
14558 "$$AbsPath$$Basename.asc
14563 \begin_layout LyX-Code
14564 UpdateFormat asciixfig
14567 \begin_layout LyX-Code
14568 UpdateResult "$$AbsPath$$Basename.asc"
14571 \begin_layout LyX-Code
14575 \begin_layout LyX-Code
14579 \begin_layout LyX-Code
14580 Product "<graphic fileref=
14582 "$$AbsOrRelPathMaster$$Basename.eps
14587 \begin_layout LyX-Code
14591 \begin_layout LyX-Code
14595 \begin_layout LyX-Code
14596 UpdateResult "$$AbsPath$$Basename.eps"
14599 \begin_layout LyX-Code
14600 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14603 \begin_layout LyX-Code
14604 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14607 \begin_layout LyX-Code
14611 \begin_layout LyX-Code
14612 Product "[XFig: $$FName]"
14615 \begin_layout LyX-Code
14619 \begin_layout LyX-Code
14623 \begin_layout Standard
14624 As you can see, the template is enclosed in
14625 \begin_inset Flex CharStyle:Code
14628 \begin_layout Plain Layout
14634 \SpecialChar \ldots{}
14636 \begin_inset Flex CharStyle:Code
14639 \begin_layout Plain Layout
14646 It contains a header specifying some general settings and, for each supported
14647 primary document file format, a section
14648 \begin_inset Flex CharStyle:Code
14651 \begin_layout Plain Layout
14657 \SpecialChar \ldots{}
14659 \begin_inset Flex CharStyle:Code
14662 \begin_layout Plain Layout
14671 \begin_layout Subsection
14672 The template header
14675 \begin_layout Description
14676 \begin_inset Flex CharStyle:Code
14679 \begin_layout Plain Layout
14680 AutomaticProduction
14681 \begin_inset space ~
14689 Whether the file represented by the template must be generated by LyX.
14690 This command must occur exactly once.
14693 \begin_layout Description
14694 \begin_inset Flex CharStyle:Code
14697 \begin_layout Plain Layout
14699 \begin_inset space ~
14707 A glob pattern that is used in the file dialog to filter out the desired
14709 If there is more than one possible file extension (e.
14710 \begin_inset space \thinspace{}
14714 \begin_inset space \space{}
14718 \begin_inset Flex CharStyle:Code
14721 \begin_layout Plain Layout
14728 \begin_inset Flex CharStyle:Code
14731 \begin_layout Plain Layout
14737 ), use something like
14738 \begin_inset Flex CharStyle:Code
14741 \begin_layout Plain Layout
14748 This command must occur exactly once.
14751 \begin_layout Description
14752 \begin_inset Flex CharStyle:Code
14755 \begin_layout Plain Layout
14757 \begin_inset space ~
14765 The text that is displayed on the button.
14766 This command must occur exactly once.
14769 \begin_layout Description
14770 \begin_inset Flex CharStyle:Code
14773 \begin_layout Plain Layout
14775 \begin_inset space ~
14779 \begin_inset space ~
14787 The help text that is used in the External dialog.
14788 Provide enough information to explain to the user just what the template
14789 can provide him with.
14790 This command must occur exactly once.
14793 \begin_layout Description
14794 \begin_inset Flex CharStyle:Code
14797 \begin_layout Plain Layout
14799 \begin_inset space ~
14807 The file format of the original file.
14808 This must be the name of a format that is known to LyX (see section
14809 \begin_inset CommandInset ref
14811 reference "sec:Formats"
14817 \begin_inset Quotes eld
14821 \begin_inset Flex CharStyle:Code
14824 \begin_layout Plain Layout
14831 \begin_inset Quotes erd
14834 if the template can handle original files of more than one format.
14835 LyX will attempt to interrogate the file itself in order to deduce its
14836 format in this case.
14837 This command must occur exactly once.
14840 \begin_layout Description
14841 \begin_inset Flex CharStyle:Code
14844 \begin_layout Plain Layout
14846 \begin_inset space ~
14854 A unique name for the template.
14855 It must not contain substitution macros (see below).
14858 \begin_layout Description
14859 \begin_inset Flex CharStyle:Code
14862 \begin_layout Plain Layout
14864 \begin_inset space ~
14867 Rotate|Resize|Clip|Extra
14872 This command specifies which transformations are supported by this template.
14873 It may occur zero or more times.
14874 This command enables the corresponding tabs in the external dialog.
14876 \begin_inset Flex CharStyle:Code
14879 \begin_layout Plain Layout
14885 command must have either a corresponding
14886 \begin_inset Flex CharStyle:Code
14889 \begin_layout Plain Layout
14896 \begin_inset Flex CharStyle:Code
14899 \begin_layout Plain Layout
14906 \begin_inset Flex CharStyle:Code
14909 \begin_layout Plain Layout
14916 Otherwise the transformation will not be supported by that format.
14919 \begin_layout Subsection
14923 \begin_layout Description
14924 \begin_inset Flex CharStyle:Code
14927 \begin_layout Plain Layout
14929 \begin_inset space ~
14932 LaTeX|PDFLaTeX|PlainText|DocBook
14937 The primary document file format that this format definition is for.
14938 Not every template has a sensible representation in all document file formats.
14939 Please define nevertheless a
14940 \begin_inset Flex CharStyle:Code
14943 \begin_layout Plain Layout
14949 section for all formats.
14950 Use a dummy text when no representation is available.
14951 Then you can at least see a reference to the external material in the exported
14955 \begin_layout Description
14956 \begin_inset Flex CharStyle:Code
14959 \begin_layout Plain Layout
14961 \begin_inset space ~
14965 \begin_inset space ~
14973 This command defines an additional macro
14974 \begin_inset Flex CharStyle:Code
14977 \begin_layout Plain Layout
14983 for substitution in
14984 \begin_inset Flex CharStyle:Code
14987 \begin_layout Plain Layout
14995 \begin_inset Flex CharStyle:Code
14998 \begin_layout Plain Layout
15004 itself may contain substitution macros.
15005 The advantage over using
15006 \begin_inset Flex CharStyle:Code
15009 \begin_layout Plain Layout
15016 \begin_inset Flex CharStyle:Code
15019 \begin_layout Plain Layout
15025 is that the substituted value of
15026 \begin_inset Flex CharStyle:Code
15029 \begin_layout Plain Layout
15035 is sanitized so that it is a valid optional argument in the document format.
15036 This command may occur zero or more times.
15039 \begin_layout Description
15040 \begin_inset Flex CharStyle:Code
15043 \begin_layout Plain Layout
15045 \begin_inset space ~
15053 The text that is inserted in the exported document.
15054 This is actually the most important command and can be quite complex.
15055 This command must occur exactly once.
15058 \begin_layout Description
15059 \begin_inset Flex CharStyle:Code
15062 \begin_layout Plain Layout
15064 \begin_inset space ~
15072 This command specifies a preamble snippet that will be included in the
15074 It has to be defined using
15075 \begin_inset Flex CharStyle:Code
15078 \begin_layout Plain Layout
15084 \SpecialChar \ldots{}
15086 \begin_inset Flex CharStyle:Code
15089 \begin_layout Plain Layout
15096 This command may occur zero or more times.
15099 \begin_layout Description
15100 \begin_inset Flex CharStyle:Code
15103 \begin_layout Plain Layout
15105 \begin_inset space ~
15109 \begin_inset space ~
15117 This command denotes files that are created by the conversion process and
15118 are needed for a particular export format.
15119 If the filename is relative, it is interpreted relative to the master document.
15120 This command may be given zero or more times.
15123 \begin_layout Description
15124 \begin_inset Flex CharStyle:Code
15127 \begin_layout Plain Layout
15129 \begin_inset space ~
15137 The name of a required LaTeX package.
15138 The package is included via
15139 \begin_inset Flex CharStyle:Code
15142 \begin_layout Plain Layout
15150 in the LaTeX preamble.
15151 This command may occur zero or more times.
15154 \begin_layout Description
15155 \begin_inset Flex CharStyle:Code
15158 \begin_layout Plain Layout
15160 \begin_inset space ~
15164 \begin_inset space ~
15167 RotationLatexCommand
15172 This command specifies that the built in LaTeX command should be used for
15174 This command may occur once or not at all.
15177 \begin_layout Description
15178 \begin_inset Flex CharStyle:Code
15181 \begin_layout Plain Layout
15183 \begin_inset space ~
15187 \begin_inset space ~
15195 This command specifies that the built in LaTeX command should be used for
15197 This command may occur once or not at all.
15200 \begin_layout Description
15201 \begin_inset Flex CharStyle:Code
15204 \begin_layout Plain Layout
15206 \begin_inset space ~
15210 \begin_inset space ~
15213 RotationLatexOption
15218 This command specifies that rotation is done via an optional argument.
15219 This command may occur once or not at all.
15222 \begin_layout Description
15223 \begin_inset Flex CharStyle:Code
15226 \begin_layout Plain Layout
15228 \begin_inset space ~
15232 \begin_inset space ~
15240 This command specifies that resizing is done via an optional argument.
15241 This command may occur once or not at all.
15244 \begin_layout Description
15245 \begin_inset Flex CharStyle:Code
15248 \begin_layout Plain Layout
15250 \begin_inset space ~
15254 \begin_inset space ~
15262 This command specifies that clipping is done via an optional argument.
15263 This command may occur once or not at all.
15266 \begin_layout Description
15267 \begin_inset Flex CharStyle:Code
15270 \begin_layout Plain Layout
15272 \begin_inset space ~
15276 \begin_inset space ~
15284 This command specifies that an extra optional argument is used.
15285 This command may occur once or not at all.
15288 \begin_layout Description
15289 \begin_inset Flex CharStyle:Code
15292 \begin_layout Plain Layout
15294 \begin_inset space ~
15302 The file format of the converted file.
15303 This must be the name of a format that is known to LyX (see the
15304 \begin_inset Flex CharStyle:MenuItem
15307 \begin_layout Plain Layout
15312 ools\SpecialChar \menuseparator
15317 references:Conversion
15323 This command must occur exactly once.
15326 \begin_layout Description
15327 \begin_inset Flex CharStyle:Code
15330 \begin_layout Plain Layout
15332 \begin_inset space ~
15340 The file name of the converted file.
15341 The file name must be absolute.
15342 This command must occur exactly once.
15345 \begin_layout Subsection
15346 Preamble definitions
15349 \begin_layout Standard
15350 The external template configuration file may contain additional preamble
15351 definitions enclosed by
15352 \begin_inset Flex CharStyle:Code
15355 \begin_layout Plain Layout
15361 \SpecialChar \ldots{}
15363 \begin_inset Flex CharStyle:Code
15366 \begin_layout Plain Layout
15373 They can be used by the templates in the
15374 \begin_inset Flex CharStyle:Code
15377 \begin_layout Plain Layout
15386 \begin_layout Section
15387 The substitution mechanism
15390 \begin_layout Standard
15391 When the external material facility invokes an external program, it is done
15392 on the basis of a command defined in the template configuration file.
15393 These commands can contain various macros that are expanded before execution.
15394 Execution always take place in the directory of the containing document.
15397 \begin_layout Standard
15398 Also, whenever external material is to be displayed, the name will be produced
15399 by the substitution mechanism, and most other commands in the template
15400 definition support substitution as well.
15403 \begin_layout Standard
15404 The available macros are the following:
15407 \begin_layout Description
15408 \begin_inset Flex CharStyle:Code
15411 \begin_layout Plain Layout
15412 $$AbsOrRelPathMaster
15417 The file path, absolute or relative to the master LyX document.
15420 \begin_layout Description
15421 \begin_inset Flex CharStyle:Code
15424 \begin_layout Plain Layout
15425 $$AbsOrRelPathParent
15430 The file path, absolute or relative to the LyX document.
15433 \begin_layout Description
15434 \begin_inset Flex CharStyle:Code
15437 \begin_layout Plain Layout
15443 The absolute file path.
15446 \begin_layout Description
15447 \begin_inset Flex CharStyle:Code
15450 \begin_layout Plain Layout
15456 The filename without path and without the extension.
15459 \begin_layout Description
15460 \begin_inset Flex CharStyle:Code
15463 \begin_layout Plain Layout
15465 \begin_inset Quotes eld
15469 \begin_inset Quotes erd
15477 This macro will expand to the contents of the file with the name
15478 \begin_inset Flex CharStyle:Code
15481 \begin_layout Plain Layout
15490 \begin_layout Description
15491 \begin_inset Flex CharStyle:Code
15494 \begin_layout Plain Layout
15500 The file extension (including the dot).
15503 \begin_layout Description
15504 \begin_inset Flex CharStyle:Code
15507 \begin_layout Plain Layout
15513 The filename of the file specified in the external material dialog.
15514 This is either an absolute name, or it is relative to the LyX document.
15517 \begin_layout Description
15518 \begin_inset Flex CharStyle:Code
15521 \begin_layout Plain Layout
15528 \begin_inset Flex CharStyle:Code
15531 \begin_layout Plain Layout
15537 (absolute name or relative to the LyX document).
15540 \begin_layout Description
15541 \begin_inset Flex CharStyle:Code
15544 \begin_layout Plain Layout
15550 The file path, relative to the master LyX document.
15553 \begin_layout Description
15554 \begin_inset Flex CharStyle:Code
15557 \begin_layout Plain Layout
15563 The file path, relative to the LyX document.
15566 \begin_layout Description
15567 \begin_inset Flex CharStyle:Code
15570 \begin_layout Plain Layout
15576 This macro will expand to the absolute path of the system directory.
15577 This is typically used to point to the various helper scripts that are
15581 \begin_layout Description
15582 \begin_inset Flex CharStyle:Code
15585 \begin_layout Plain Layout
15591 A name and full path to a temporary file which will be automatically deleted
15592 whenever the containing document is closed, or the external material insertion
15596 \begin_layout Standard
15597 All path macros contain a trailing directory separator, so you can construct
15599 \begin_inset space \thinspace{}
15603 \begin_inset space \space{}
15606 the absolute filename with
15607 \begin_inset Flex CharStyle:Code
15610 \begin_layout Plain Layout
15611 $$AbsPath$$Basename$$Extension
15619 \begin_layout Standard
15620 The macros above are substituted in all commands unless otherwise noted.
15622 \begin_inset Flex CharStyle:Code
15625 \begin_layout Plain Layout
15631 supports additionally the following substitutions if they are enabled by
15633 \begin_inset Flex CharStyle:Code
15636 \begin_layout Plain Layout
15643 \begin_inset Flex CharStyle:Code
15646 \begin_layout Plain Layout
15655 \begin_layout Description
15656 \begin_inset Flex CharStyle:Code
15659 \begin_layout Plain Layout
15665 The front part of the resize command.
15668 \begin_layout Description
15669 \begin_inset Flex CharStyle:Code
15672 \begin_layout Plain Layout
15678 The back part of the resize command.
15681 \begin_layout Description
15682 \begin_inset Flex CharStyle:Code
15685 \begin_layout Plain Layout
15691 The front part of the rotation command.
15694 \begin_layout Description
15695 \begin_inset Flex CharStyle:Code
15698 \begin_layout Plain Layout
15704 The back part of the rotation command.
15707 \begin_layout Standard
15708 The value string of the
15709 \begin_inset Flex CharStyle:Code
15712 \begin_layout Plain Layout
15718 command supports additionally the following substitutions if they are enabled
15720 \begin_inset Flex CharStyle:Code
15723 \begin_layout Plain Layout
15730 \begin_inset Flex CharStyle:Code
15733 \begin_layout Plain Layout
15742 \begin_layout Description
15743 \begin_inset Flex CharStyle:Code
15746 \begin_layout Plain Layout
15755 \begin_layout Description
15756 \begin_inset Flex CharStyle:Code
15759 \begin_layout Plain Layout
15768 \begin_layout Description
15769 \begin_inset Flex CharStyle:Code
15772 \begin_layout Plain Layout
15781 \begin_layout Description
15782 \begin_inset Flex CharStyle:Code
15785 \begin_layout Plain Layout
15791 The rotation option.
15794 \begin_layout Standard
15795 You may ask why there are so many path macros.
15796 There are mainly two reasons:
15799 \begin_layout Enumerate
15800 Relative and absolute file names should remain relative or absolute, respectivel
15802 Users may have reasons to prefer either form.
15803 Relative names are useful for portable documents that should work on different
15804 machines, for example.
15805 Absolute names may be required by some programs.
15808 \begin_layout Enumerate
15809 LaTeX treats relative file names differently than LyX and other programs
15810 in nested included files.
15811 For LyX, a relative file name is always relative to the document that contains
15813 For LaTeX, it is always relative to the master document.
15814 These two definitions are identical if you have only one document, but
15815 differ if you have a master document that includes part documents.
15816 That means that relative filenames must be transformed when presented to
15818 Fortunately LyX does this automatically for you if you choose the right
15822 \begin_layout Standard
15823 So which path macro should be used in new template definitions? The rule
15827 \begin_layout Itemize
15829 \begin_inset Flex CharStyle:Code
15832 \begin_layout Plain Layout
15838 if an absolute path is required.
15841 \begin_layout Itemize
15843 \begin_inset Flex CharStyle:Code
15846 \begin_layout Plain Layout
15847 $$AbsOrRelPathMaster
15852 if the substituted string is some kind of LaTeX input.
15855 \begin_layout Itemize
15857 \begin_inset Flex CharStyle:Code
15860 \begin_layout Plain Layout
15861 $$AbsOrRelPathParent
15866 in order to preserve the user's choice.
15869 \begin_layout Standard
15870 There are special cases where this rule does not work and e.
15871 \begin_inset space \thinspace{}
15875 \begin_inset space \space{}
15878 relative names are needed, but normally it will work just fine.
15879 One example for such a case is the command
15880 \begin_inset Flex CharStyle:Code
15883 \begin_layout Plain Layout
15884 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15889 in the XFig template above: We can't use the absolute name because the
15891 \begin_inset Flex CharStyle:Code
15894 \begin_layout Plain Layout
15900 files needs the relative name in order to rewrite the file content.
15903 \begin_layout Section
15904 Security discussion
15905 \begin_inset CommandInset label
15907 name "sec:Security-discussion"
15914 \begin_layout Standard
15915 The external material feature interfaces with a lot of external programs
15916 and does so automatically, so we have to consider the security implications
15918 In particular, since you have the option of including your own filenames
15919 and/or parameter strings and those are expanded into a command, it seems
15920 that it would be possible to create a malicious document which executes
15921 arbitrary commands when a user views or prints the document.
15922 This is something we definitely want to avoid.
15925 \begin_layout Standard
15926 However, since the external program commands are specified in the template
15927 configuration file only, there are no security issues if LyX is properly
15928 configured with safe templates only.
15929 This is so because the external programs are invoked with the
15930 \begin_inset Flex CharStyle:Code
15933 \begin_layout Plain Layout
15939 -system call rather than the
15940 \begin_inset Flex CharStyle:Code
15943 \begin_layout Plain Layout
15949 system-call, so it's not possible to execute arbitrary commands from the
15950 filename or parameter section via the shell.
15953 \begin_layout Standard
15954 This also implies that you are restricted in what command strings you can
15955 use in the external material templates.
15956 In particular, pipes and redirection are not readily available.
15957 This has to be so if LyX should remain safe.
15958 If you want to use some of the shell features, you should write a safe
15959 script to do this in a controlled manner, and then invoke the script from
15960 the command string.
15964 \begin_layout Standard
15965 It is possible to design a template that interacts directly with the shell,
15966 but since this would allow a malicious user to execute arbitrary commands
15967 by writing clever filenames and/or parameters, we generally recommend that
15968 you only use safe scripts that work with the
15969 \begin_inset Flex CharStyle:Code
15972 \begin_layout Plain Layout
15978 system call in a controlled manner.
15979 Of course, for use in a controlled environment, it can be tempting to just
15980 fall back to use ordinary shell scripts.
15981 If you do so, be aware that you
15985 provide an easily exploitable security hole in your system.
15986 Of course it stands to reason that such unsafe templates will never be
15987 included in the standard LyX distribution, although we do encourage people
15988 to submit new templates in the open source tradition.
15989 But LyX as shipped from the official distribution channels will never have
15993 \begin_layout Standard
15994 Including external material provides a lot of power, and you have to be
15995 careful not to introduce security hazards with this power.
15996 A subtle error in a single line in an innocent looking script can open
15997 the door to huge security problems.
15998 So if you do not fully understand the issues, we recommend that you consult
15999 a knowledgeable security professional or the LyX development team if you
16000 have any questions about whether a given template is safe or not.
16001 And do this before you use it in an uncontrolled environment.