1 #LyX 1.6.0 created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that the User's Guide prints
10 % out as advertised. If you mess with this preamble,
11 % parts of the User's Guide may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
39 % used for multi-column text
43 \options fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
44 \use_default_options false
50 InsetLayout CharStyle:MenuItem
59 \newcommand*{\menuitem}[1]{{\sffamily #1}}
67 \font_typewriter default
68 \font_default_family default
77 \pdf_title "LyX Configuration Manual"
78 \pdf_author "LyX Team"
79 \pdf_subject "LyX-documentation Customization"
80 \pdf_keywords "LyX, documentation, customization"
82 \pdf_bookmarksnumbered true
83 \pdf_bookmarksopen true
84 \pdf_bookmarksopenlevel 1
89 \pdf_pdfusetitle false
90 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
97 \paperorientation portrait
104 \paragraph_separation indent
106 \quotes_language english
109 \paperpagestyle headings
110 \tracking_changes false
111 \output_changes false
119 Customizing LyX: Features for the Advanced User
127 \begin_layout Plain Layout
129 If you have comments or error corrections, please send them to the LyX Documenta
131 \begin_inset CommandInset href
133 target "lyx-docs@lists.lyx.org"
140 \begin_inset Quotes eld
144 \begin_inset Quotes erd
147 in the subject header, and please cc the current maintainer of this file,
148 Richard Heck <rgheck@comcast.net>.
156 \begin_layout Standard
157 \begin_inset CommandInset toc
158 LatexCommand tableofcontents
165 \begin_layout Chapter
169 \begin_layout Standard
170 This manual covers the customization features present in LyX.
171 In it, we discuss issues like keyboard shortcuts, screen previewing options,
172 printer options, sending commands to LyX via the LyX Server, internationalizati
173 on, installing new LaTeX classes and LyX layouts, etc.
174 We can't possibly hope to touch on everything you can change---our developers
175 add new features faster than we can document them---but we will explain
176 the most common customizations and hopefully point you in the right direction
177 for some of the more obscure ones.
180 \begin_layout Standard
181 \begin_inset Branch OutDated
184 \begin_layout Standard
185 Information from previous versions of this document that now seems to be
186 outdated is contained in the OutDated branch of this document.
187 By default, this information will not appear in the LaTeX output.
195 \begin_layout Chapter
196 LyX configuration files
199 \begin_layout Standard
200 This chapter aims to help you to find your way through the LyX configuration
202 Before continuing to read this chapter, you should find out where your
203 LyX library and user directories are by using
204 \begin_inset Flex CharStyle:MenuItem
207 \begin_layout Plain Layout
212 elp\SpecialChar \menuseparator
225 The library directory is the place where LyX places its system-wide configurati
226 on files; the user directory is where you can place your modified versions.
227 We will call the former
228 \begin_inset Flex CharStyle:Code
231 \begin_layout Plain Layout
238 \begin_inset Flex CharStyle:MenuItem
241 \begin_layout Plain Layout
247 in the remainder of this document.
251 \begin_layout Section
253 \begin_inset Flex CharStyle:Code
256 \begin_layout Plain Layout
265 \begin_layout Standard
266 \begin_inset Flex CharStyle:Code
269 \begin_layout Plain Layout
275 and its sub-directories contain a number of files and that can be used
276 to customise LyX's behaviour.
277 You can change many of these files from within LyX itself through the
278 \begin_inset Flex CharStyle:MenuItem
281 \begin_layout Plain Layout
282 Tools\SpecialChar \menuseparator
289 Most customization that you will want to do in LyX is possible through
291 However, many other inner aspects of LyX can be customized by modifying
293 \begin_inset Flex CharStyle:Code
296 \begin_layout Plain Layout
303 These files fall in different categories, described in the following subsection
307 \begin_layout Subsection
308 Automatically generated files
311 \begin_layout Standard
312 The files, which are to be found in
313 \begin_inset Flex CharStyle:MenuItem
316 \begin_layout Plain Layout
322 , are generated when you configure LyX.
323 They contain various default values that are guessed by inspection.
324 In general, it is not a good idea to modify them, since they might be overwritt
328 \begin_layout Labeling
329 \labelwidthstring 00.00.0000
330 \begin_inset Flex CharStyle:Code
333 \begin_layout Plain Layout
339 contains defaults for various commands.
342 \begin_layout Labeling
343 \labelwidthstring 00.00.0000
344 \begin_inset Flex CharStyle:Code
347 \begin_layout Plain Layout
353 contains the list of packages that have been recognized by LyX.
354 It is currently unused by the LyX program itself, but the information extracted
355 , and more, is made available with
356 \begin_inset Flex CharStyle:MenuItem
359 \begin_layout Plain Layout
364 elp\SpecialChar \menuseparator
381 \begin_layout Labeling
382 \labelwidthstring 00.00.0000
383 \begin_inset Flex CharStyle:Code
386 \begin_layout Plain Layout
392 the list of text classes that have been found in your
393 \begin_inset Flex CharStyle:Code
396 \begin_layout Plain Layout
402 directories, along with the associated LaTeX document class and their descripti
406 \begin_layout Labeling
407 \labelwidthstring 00.00.0000
408 \begin_inset Flex CharStyle:Code
411 \begin_layout Plain Layout
417 the list of layout modules found in your
418 \begin_inset Flex CharStyle:Code
421 \begin_layout Plain Layout
430 \begin_layout Labeling
431 \labelwidthstring 00.00.0000
432 \begin_inset Flex CharStyle:Code
435 \begin_layout Plain Layout
441 lists of various sorts of LaTeX-related files found on your system
444 \begin_layout Labeling
445 \labelwidthstring 00.00.0000
446 \begin_inset Flex CharStyle:Code
449 \begin_layout Plain Layout
455 is automatically generated during configuration from the file
456 \begin_inset Flex CharStyle:Code
459 \begin_layout Plain Layout
466 It contains information on your LaTeX configuration.
469 \begin_layout Subsection
473 \begin_layout Standard
474 These directories are duplicated between
475 \begin_inset Flex CharStyle:Code
478 \begin_layout Plain Layout
485 \begin_inset Flex CharStyle:Code
488 \begin_layout Plain Layout
495 If a particular files exists in both places, the one in
496 \begin_inset Flex CharStyle:Code
499 \begin_layout Plain Layout
508 \begin_layout Labeling
509 \labelwidthstring 00.00.0000
510 \begin_inset Flex CharStyle:Code
513 \begin_layout Plain Layout
519 this directory contains files with the extension
520 \begin_inset Flex CharStyle:Code
523 \begin_layout Plain Layout
529 that define the keybindings used in LyX.
530 If there exists an internationalized version of the bind file named
531 \begin_inset Flex CharStyle:Code
534 \begin_layout Plain Layout
540 , that will be used first.
543 \begin_layout Labeling
544 \labelwidthstring 00.00.0000
545 \begin_inset Flex CharStyle:Code
548 \begin_layout Plain Layout
554 contains graphics files that can be included in documents.
558 \begin_layout Labeling
559 \labelwidthstring 00.00.0000
560 \begin_inset Flex CharStyle:Code
563 \begin_layout Plain Layout
569 contains LyX documentation files (including the one you are currently reading).
571 \begin_inset Flex CharStyle:Code
574 \begin_layout Plain Layout
580 deserves special attention, as noted above.
581 If there exists an internationalized version of the help-document with
583 \begin_inset Flex CharStyle:Code
586 \begin_layout Plain Layout
592 prepended to the name, that will be used first.
598 \begin_inset CommandInset ref
600 reference "chap:i18n"
607 \begin_layout Labeling
608 \labelwidthstring 00.00.0000
609 \begin_inset Flex CharStyle:Code
612 \begin_layout Plain Layout
618 contains example files that explain how to use some features.
619 In the file browser, press the
620 \begin_inset Flex CharStyle:MenuItem
623 \begin_layout Plain Layout
632 \begin_layout Labeling
633 \labelwidthstring 00.00.0000
634 \begin_inset Flex CharStyle:Code
637 \begin_layout Plain Layout
643 contains image files that are used by the
644 \begin_inset Flex CharStyle:MenuItem
647 \begin_layout Plain Layout
654 In addition, it also contains the individual icons used in the toolbar
655 and the banners that can be shown when LyX is launched.
658 \begin_layout Labeling
659 \labelwidthstring 00.00.0000
660 \begin_inset Flex CharStyle:Code
663 \begin_layout Plain Layout
669 contains keyboard keymapping files.
675 \begin_inset CommandInset ref
677 reference "sec:keymap"
684 \begin_layout Labeling
685 \labelwidthstring 00.00.0000
686 \begin_inset Flex CharStyle:Code
689 \begin_layout Plain Layout
695 contains the text class and module files described in Chapter
700 \begin_inset CommandInset ref
702 reference "chap:textclass"
709 \begin_layout Labeling
710 \labelwidthstring 00.00.0000
711 \begin_inset Flex CharStyle:Code
714 \begin_layout Plain Layout
721 \begin_inset Flex CharStyle:Code
724 \begin_layout Plain Layout
730 Python scripts used to convert between LyX versions.
731 These can be run from the command line if, say, you want to batch-convert
735 \begin_layout Labeling
736 \labelwidthstring 00.00.0000
737 \begin_inset Flex CharStyle:Code
740 \begin_layout Plain Layout
746 contains some files that demonstrate the capabilities of the
747 \begin_inset Flex CharStyle:MenuItem
750 \begin_layout Plain Layout
761 Also contains some scripts used by LyX itself.
764 \begin_layout Labeling
765 \labelwidthstring 00.00.0000
766 \begin_inset Flex CharStyle:Code
769 \begin_layout Plain Layout
775 contains the standard LyX template files described in Chapter
780 \begin_inset CommandInset ref
782 reference "sec:templates"
789 \begin_layout Labeling
790 \labelwidthstring 00.00.0000
791 \begin_inset Flex CharStyle:Code
794 \begin_layout Plain Layout
800 contains files with the extension
801 \begin_inset Flex CharStyle:Code
804 \begin_layout Plain Layout
810 that define the user interface to LyX.
811 That is, the files define which items appear in which menus and the items
812 appearing on the toolbar.
815 \begin_layout Subsection
816 Files you don't want to modify
819 \begin_layout Standard
820 These files are used internally by LyX and you generally do not need to
821 modify them unless you are a developer.
824 \begin_layout Labeling
825 \labelwidthstring 00.00.0000
826 \begin_inset Flex CharStyle:Code
829 \begin_layout Plain Layout
835 this file contains the list of LyX developers.
836 The contents are displayed with the menu entry
837 \begin_inset Flex CharStyle:MenuItem
840 \begin_layout Plain Layout
845 elp\SpecialChar \menuseparator
858 \begin_layout Labeling
859 \labelwidthstring 00.00.0000
860 \begin_inset Flex CharStyle:Code
863 \begin_layout Plain Layout
869 this is a LaTeX script used during the configuration process.
873 \begin_layout Labeling
874 \labelwidthstring 00.00.0000
875 \begin_inset Flex CharStyle:Code
878 \begin_layout Plain Layout
884 this is the script that is used to re-configure LyX.
885 It creates configuration files in the directory it was run from.
888 \begin_layout Subsection
889 Other files needing a line or two...
892 \begin_layout Labeling
893 \labelwidthstring 00.00.0000
894 \begin_inset Flex CharStyle:Code
897 \begin_layout Plain Layout
903 this contains tables describing how different character encodings can be
907 \begin_layout Labeling
908 \labelwidthstring 00.00.0000
909 \begin_inset Flex CharStyle:Code
912 \begin_layout Plain Layout
918 this file contains the templates available to the new
919 \begin_inset Flex CharStyle:MenuItem
922 \begin_layout Plain Layout
935 \begin_layout Labeling
936 \labelwidthstring 00.00.0000
937 \begin_inset Flex CharStyle:Code
940 \begin_layout Plain Layout
946 this file contains a list of all the languages currently supported by LyX.
949 \begin_layout Section
950 Your local configuration directory
953 \begin_layout Standard
954 Even if you are using LyX as an unprivileged user, you might want to change
955 LyX configuration for your own use.
957 \begin_inset Flex CharStyle:Code
960 \begin_layout Plain Layout
966 directory contains all your personal configuration files.
967 This is the directory described as
968 \begin_inset Quotes eld
972 \begin_inset Quotes erd
976 \begin_inset Flex CharStyle:MenuItem
979 \begin_layout Plain Layout
984 elp\SpecialChar \menuseparator
995 This directory is used as a mirror of
996 \begin_inset Flex CharStyle:Code
999 \begin_layout Plain Layout
1005 , which means that every file in
1006 \begin_inset Flex CharStyle:Code
1009 \begin_layout Plain Layout
1015 is a replacement for the corresponding file in
1016 \begin_inset Flex CharStyle:Code
1019 \begin_layout Plain Layout
1026 Any configuration file described in the above sections can be placed either
1027 in the system-wide directory, in which case it will affect all users, or
1028 in your local directory for your own use.
1031 \begin_layout Standard
1032 To make things clearer, let's provide a few examples:
1035 \begin_layout Itemize
1036 The preferences set in the
1037 \begin_inset Flex CharStyle:MenuItem
1040 \begin_layout Plain Layout
1045 ools\SpecialChar \menuseparator
1055 dialog are saved to a file
1056 \begin_inset Flex CharStyle:Code
1059 \begin_layout Plain Layout
1066 \begin_inset Flex CharStyle:Code
1069 \begin_layout Plain Layout
1078 \begin_layout Itemize
1079 When you reconfigure using
1080 \begin_inset Flex CharStyle:MenuItem
1083 \begin_layout Plain Layout
1088 ools\SpecialChar \menuseparator
1099 \begin_inset Flex CharStyle:Code
1102 \begin_layout Plain Layout
1108 script, and the resulting files are written in your local configuration
1110 This means that any additional text class file that you might have added
1112 \begin_inset Flex CharStyle:Code
1115 \begin_layout Plain Layout
1121 will be added to the list of classes in the
1122 \begin_inset Flex CharStyle:MenuItem
1125 \begin_layout Plain Layout
1126 Document\SpecialChar \menuseparator
1135 \begin_layout Itemize
1136 If you get some updated documentation from LyX ftp site and cannot install
1137 it because you do not have sysadmin rights on your system, you can just
1139 \begin_inset Flex CharStyle:Code
1142 \begin_layout Plain Layout
1148 and the items in the
1149 \begin_inset Flex CharStyle:MenuItem
1152 \begin_layout Plain Layout
1162 menu will open them!
1165 \begin_layout Section
1166 Running LyX with multiple configurations
1169 \begin_layout Standard
1170 The configuration freedom of the local configuration directory may not suffice
1171 if you want to have more than one configuration at your disposal.
1172 For example, you may want to be use different key bindings or printer settings
1174 You can achieve this by having several such directories.
1175 You then specify which directory to use at run-time.
1178 \begin_layout Standard
1179 Invoking LyX with the command line switch
1180 \begin_inset Flex CharStyle:Code
1183 \begin_layout Plain Layout
1193 instructs the program to read the configuration from that directory, and
1194 not from the default directory.
1195 (You can determine the default directory by running LyX without the
1196 \begin_inset Flex CharStyle:Code
1199 \begin_layout Plain Layout
1205 switch.) If the specified directory does not exist, LyX offers to create
1206 it for you, just like it does for the default directory on the first time
1207 you run the program.
1208 You can modify the configuration options in this additional user directory
1209 exactly as you would for the default directory.
1210 These directories are completely independent (but read on).
1211 Note that setting the environment variable
1212 \begin_inset Flex CharStyle:Code
1215 \begin_layout Plain Layout
1221 to some value has exactly the same effect.
1224 \begin_layout Standard
1225 Having several configurations also requires more maintenance: if you want
1226 to add a new layout to
1227 \begin_inset Flex CharStyle:Code
1230 \begin_layout Plain Layout
1236 which you want available from all your configurations, you must add it
1237 to each directory separately.
1238 You can avoid this with the following trick: after LyX creates the additional
1239 directory, most of the subdirectories (see above) are empty.
1240 If you want the new configuration to mirror an existing one, replace the
1241 empty subdirectory with a symbolic link to the matching subdirectory in
1242 the existing configuration.
1244 \begin_inset Flex CharStyle:Code
1247 \begin_layout Plain Layout
1253 subirectory, however, since it contains a file written by the configuration
1254 script (also accessible through
1255 \begin_inset Flex CharStyle:MenuItem
1258 \begin_layout Plain Layout
1263 ools\SpecialChar \menuseparator
1273 ) which is configuration-specific.
1276 \begin_layout Chapter
1277 The Preferences dialog
1280 \begin_layout Standard
1281 All options of the preferences dialog are described in the Appendix
1283 The Preferences Dialog
1290 For some options you might find here more details.
1293 \begin_layout Section
1294 Using the dialog for the first time
1297 \begin_layout Standard
1299 \begin_inset Flex CharStyle:Code
1302 \begin_layout Plain Layout
1308 file will contain only changes that you have made to the default behavior,
1309 some of which is hard-coded into LyX and some of which is contained in
1311 \begin_inset Flex CharStyle:Code
1314 \begin_layout Plain Layout
1315 LyXDir/lyxrc.defaults
1321 Note that in both files lines beginning with a
1322 \begin_inset Quotes eld
1326 \begin_inset Quotes erd
1329 are just comments and are not interpreted.
1330 However, only system administrators should edit
1331 \begin_inset Flex CharStyle:Code
1334 \begin_layout Plain Layout
1335 LyXDir/lyxrc.defaults
1341 Users should use the
1342 \begin_inset Flex CharStyle:MenuItem
1345 \begin_layout Plain Layout
1346 Tools\SpecialChar \menuseparator
1352 dialog to create and modify their own
1353 \begin_inset Flex CharStyle:Code
1356 \begin_layout Plain Layout
1365 \begin_layout Standard
1367 \begin_inset Flex CharStyle:MenuItem
1370 \begin_layout Plain Layout
1371 Tools\SpecialChar \menuseparator
1377 dialog will be largely self-explanatory.
1378 Most things in the dialog have associated `tool tips': hover your mouse
1379 pointer over something for more information.
1380 Before we highlight a few of the more important commands below, however,
1381 a word of warning: Applying some of your changes (e.
1382 \begin_inset space \thinspace{}
1386 \begin_inset space \space{}
1389 screen fonts) will have an instant effect.
1391 \begin_inset space \thinspace{}
1395 \begin_inset space \space{}
1398 changing the bind file) will not.
1399 If nothing appears to have changed, just
1400 \begin_inset Flex CharStyle:MenuItem
1403 \begin_layout Plain Layout
1409 the changes and restart LyX.
1412 \begin_layout Section
1416 \begin_layout Standard
1417 LyX has a powerful mechanism to convert to and from any file format using
1422 \begin_layout Subsection
1423 \begin_inset CommandInset label
1432 \begin_layout Standard
1433 The first step is to define your file formats if they are not already defined.
1435 \begin_inset Flex CharStyle:MenuItem
1438 \begin_layout Plain Layout
1439 Tools\SpecialChar \menuseparator
1440 Preferences\SpecialChar \menuseparator
1441 File Handling\SpecialChar \menuseparator
1449 \begin_inset Flex CharStyle:MenuItem
1452 \begin_layout Plain Layout
1453 New\SpecialChar \ldots{}
1459 button to define your new format.
1461 \begin_inset Flex CharStyle:MenuItem
1464 \begin_layout Plain Layout
1470 field contains the named used to identify the format in the GUI.
1472 \begin_inset Flex CharStyle:MenuItem
1475 \begin_layout Plain Layout
1481 is used to identify the format interally.
1482 You will also need to enter a file extension.
1483 These are all required.
1485 \begin_inset Flex CharStyle:MenuItem
1488 \begin_layout Plain Layout
1494 field is used to provide a keyboard shortcut on the menus.
1495 (For example, pressing
1496 \begin_inset Flex CharStyle:MenuItem
1499 \begin_layout Plain Layout
1506 \begin_inset Flex CharStyle:MenuItem
1509 \begin_layout Plain Layout
1510 View\SpecialChar \menuseparator
1519 \begin_layout Standard
1521 \begin_inset Flex CharStyle:MenuItem
1524 \begin_layout Plain Layout
1531 \begin_inset Flex CharStyle:MenuItem
1534 \begin_layout Plain Layout
1541 For example, you might want to use
1542 \begin_inset Flex CharStyle:MenuItem
1545 \begin_layout Plain Layout
1551 to view PostScript files.
1552 You can enter the command needed to start the program in the corresponding
1554 In defining this command, you can use the four variables listed in the
1556 The viewer is launched when you view an image in LyX or use the
1557 \begin_inset Flex CharStyle:MenuItem
1560 \begin_layout Plain Layout
1567 The editor is for example launched when you press the
1568 \begin_inset Flex CharStyle:MenuItem
1571 \begin_layout Plain Layout
1578 \begin_inset Flex CharStyle:MenuItem
1581 \begin_layout Plain Layout
1588 \begin_inset Flex CharStyle:MenuItem
1591 \begin_layout Plain Layout
1600 \begin_layout Standard
1602 \begin_inset Flex CharStyle:MenuItem
1605 \begin_layout Plain Layout
1611 option tells LyX that a format is suitable for document export.
1612 If this is is set and if a suitable conversion route exists (see
1613 \begin_inset CommandInset ref
1615 reference "sub:Converters"
1619 ), the format will appear in the
1620 \begin_inset Flex CharStyle:MenuItem
1623 \begin_layout Plain Layout
1624 File\SpecialChar \menuseparator
1631 The format will also appear in the
1632 \begin_inset Flex CharStyle:MenuItem
1635 \begin_layout Plain Layout
1641 menu if a viewer is specified for the format.
1642 Pure image formats, such as
1643 \begin_inset Flex CharStyle:Code
1646 \begin_layout Plain Layout
1652 , should not use this option.
1653 Formats that can both represent vector graphics and documents like
1654 \begin_inset Flex CharStyle:Code
1657 \begin_layout Plain Layout
1666 \begin_layout Standard
1668 \begin_inset Flex CharStyle:MenuItem
1671 \begin_layout Plain Layout
1672 Vector graphics format
1677 tells LyX that a format can contain vector graphics.
1678 This information is used to determine the target format of included graphics
1680 \begin_inset Flex CharStyle:MenuItem
1683 \begin_layout Plain Layout
1690 Included graphics may need to be converted to either
1691 \begin_inset Flex CharStyle:MenuItem
1694 \begin_layout Plain Layout
1701 \begin_inset Flex CharStyle:MenuItem
1704 \begin_layout Plain Layout
1711 \begin_inset Flex CharStyle:MenuItem
1714 \begin_layout Plain Layout
1721 \begin_inset Flex CharStyle:MenuItem
1724 \begin_layout Plain Layout
1730 cannot handle other image formats.
1731 If an included graphic is not already in
1732 \begin_inset Flex CharStyle:MenuItem
1735 \begin_layout Plain Layout
1742 \begin_inset Flex CharStyle:MenuItem
1745 \begin_layout Plain Layout
1752 \begin_inset Flex CharStyle:MenuItem
1755 \begin_layout Plain Layout
1761 format, it is converted to
1762 \begin_inset Flex CharStyle:MenuItem
1765 \begin_layout Plain Layout
1771 if the vector format option is set, and otherwise to
1772 \begin_inset Flex CharStyle:MenuItem
1775 \begin_layout Plain Layout
1784 \begin_layout Subsection
1788 \begin_layout Standard
1789 Since all conversions from one format to another take place in LyX's temporary
1790 directory, it is sometimes necessary to modify a file before copying it
1791 to the temporary directory in order that the conversion may be performed.
1795 \begin_layout Plain Layout
1796 For example, the file may refer to other files---images, for example---using
1797 relative file names, and these may become invalid when the file is copied
1798 to the temporary directory.
1803 This is done by a Copier: It copies a file to (or from) the temporary directory
1804 and may modify it in the process.
1807 \begin_layout Standard
1808 The definitions of the copiers may use four variables:
1811 \begin_layout Labeling
1812 \labelwidthstring 00.00.0000
1813 \begin_inset Flex CharStyle:Code
1816 \begin_layout Plain Layout
1822 The LyX system directory (e.
1823 \begin_inset space \thinspace{}
1827 \begin_inset space \space{}
1831 \begin_inset Flex CharStyle:MenuItem
1834 \begin_layout Plain Layout
1843 \begin_layout Labeling
1844 \labelwidthstring 00.00.0000
1845 \begin_inset Flex CharStyle:Code
1848 \begin_layout Plain Layout
1857 \begin_layout Labeling
1858 \labelwidthstring 00.00.0000
1859 \begin_inset Flex CharStyle:Code
1862 \begin_layout Plain Layout
1871 \begin_layout Labeling
1872 \labelwidthstring 00.00.0000
1873 \begin_inset Flex CharStyle:Code
1876 \begin_layout Plain Layout
1885 \begin_layout Standard
1886 The latter should be the filename as it would be used in a LaTeX's
1893 It is relevant only when exporting files suitable for such inclusion.
1896 \begin_layout Standard
1897 Copiers can be used to do almost anything with output files.
1898 For example, suppose you want generated pdf files to be copied to a special
1900 \begin_inset Flex CharStyle:Code
1903 \begin_layout Plain Layout
1910 Then you could write a shell script such as this one:
1913 \begin_layout Standard
1914 \begin_inset listings
1918 \begin_layout Plain Layout
1923 \begin_layout Plain Layout
1928 \begin_layout Plain Layout
1930 TOFILE=`basename $2`
1933 \begin_layout Plain Layout
1935 cp $FROMFILE /home/you/pdf/$TOFILE
1940 Save that in your local LyX directory---say,
1941 \begin_inset Flex CharStyle:Code
1944 \begin_layout Plain Layout
1945 /home/you/.lyx/scripts/pdfcopier.sh
1950 ---and make it executable, if you need to do so on your platform.
1952 \begin_inset Flex CharStyle:MenuItem
1955 \begin_layout Plain Layout
1956 Tools\SpecialChar \menuseparator
1963 \begin_inset Flex CharStyle:MenuItem
1966 \begin_layout Plain Layout
1972 format---or one of the other pdf formats---and enter
1973 \begin_inset Flex CharStyle:Code
1976 \begin_layout Plain Layout
1977 pdfcopier.sh $$i $$o
1983 \begin_inset Flex CharStyle:MenuItem
1986 \begin_layout Plain Layout
1996 \begin_layout Standard
1997 Copiers are used by LyX in various of its own conversions.
1998 For example, if appropriate programs are found, LyX will automatically
1999 install copiers for the
2000 \begin_inset Flex CharStyle:MenuItem
2003 \begin_layout Plain Layout
2010 \begin_inset Flex CharStyle:MenuItem
2013 \begin_layout Plain Layout
2015 \begin_inset space ~
2024 When these formats are exported, the copier sees that not just the main
2025 HTML file but various associated files (style files, images, etc.) are also
2027 All these files are written to a subdirectory of the directory in which
2028 the original LyX file was found.
2032 \begin_layout Plain Layout
2033 This copier can be customized.
2035 \begin_inset Quotes eld
2039 \begin_inset Quotes erd
2042 argument takes a comma-separated list of extensions to be copied; if it
2043 is omitted, all files will be copied.
2045 \begin_inset Quotes eld
2049 \begin_inset Quotes erd
2052 argument determines the extension added to the generated directory.
2054 \begin_inset Quotes eld
2058 \begin_inset Flex CharStyle:MenuItem
2061 \begin_layout Plain Layout
2068 \begin_inset Quotes erd
2071 , so HTML generated from
2072 \begin_inset Flex CharStyle:MenuItem
2075 \begin_layout Plain Layout
2076 /path/to/filename.lyx
2082 \begin_inset Flex CharStyle:MenuItem
2085 \begin_layout Plain Layout
2086 /path/to/filename.html.LyXconv
2100 \begin_layout Subsection
2101 \begin_inset CommandInset label
2103 name "sub:Converters"
2110 \begin_layout Standard
2111 You can define your own Converters to, uhh, convert files between different
2114 \begin_inset Flex CharStyle:MenuItem
2117 \begin_layout Plain Layout
2118 Tools\SpecialChar \menuseparator
2119 Preferences\SpecialChar \menuseparator
2120 File Handling\SpecialChar \menuseparator
2129 \begin_layout Standard
2130 To define a new converter, select the
2131 \begin_inset Flex CharStyle:MenuItem
2134 \begin_layout Plain Layout
2136 \begin_inset space ~
2145 \begin_inset Flex CharStyle:MenuItem
2148 \begin_layout Plain Layout
2150 \begin_inset space ~
2158 from the drop-down lists, enter the command needed for the conversion,
2160 \begin_inset Flex CharStyle:MenuItem
2163 \begin_layout Plain Layout
2170 Several variables can be used in the definition of converters:
2173 \begin_layout Labeling
2174 \labelwidthstring 00.00.0000
2175 \begin_inset Flex CharStyle:Code
2178 \begin_layout Plain Layout
2184 The LyX system directory
2187 \begin_layout Labeling
2188 \labelwidthstring 00.00.0000
2189 \begin_inset Flex CharStyle:Code
2192 \begin_layout Plain Layout
2201 \begin_layout Labeling
2202 \labelwidthstring 00.00.0000
2203 \begin_inset Flex CharStyle:Code
2206 \begin_layout Plain Layout
2215 \begin_layout Labeling
2216 \labelwidthstring 00.00.0000
2217 \begin_inset Flex CharStyle:Code
2220 \begin_layout Plain Layout
2226 The base filename of the input file (i.
2227 \begin_inset space \thinspace{}
2230 g., without the extension)
2233 \begin_layout Labeling
2234 \labelwidthstring 00.00.0000
2235 \begin_inset Flex CharStyle:Code
2238 \begin_layout Plain Layout
2244 The path to the input file
2247 \begin_layout Standard
2249 \begin_inset Flex CharStyle:MenuItem
2252 \begin_layout Plain Layout
2254 \begin_inset space ~
2262 field you can enter the following flags, separated by commas:
2265 \begin_layout Labeling
2266 \labelwidthstring 00.00.0000
2267 \begin_inset Flex CharStyle:Code
2270 \begin_layout Plain Layout
2276 This converter runs some form of LaTeX.
2277 This will make LyX's LaTeX error logs available.
2280 \begin_layout Labeling
2281 \labelwidthstring 00.00.0000
2282 \begin_inset Flex CharStyle:Code
2285 \begin_layout Plain Layout
2292 \begin_inset Flex CharStyle:MenuItem
2295 \begin_layout Plain Layout
2301 file for the conversion.
2304 \begin_layout Labeling
2305 \labelwidthstring 00.00.0000
2306 \begin_inset Flex CharStyle:Code
2309 \begin_layout Plain Layout
2318 \begin_layout Standard
2319 The following three flags are not really flags at all because they take
2321 \begin_inset Flex CharStyle:MenuItem
2324 \begin_layout Plain Layout
2326 \begin_inset space ~
2330 \begin_inset space ~
2341 \begin_layout Labeling
2342 \labelwidthstring 00.00.0000
2343 \begin_inset Flex CharStyle:Code
2346 \begin_layout Plain Layout
2352 If set, the converter's standard error will be redirected to a file
2353 \begin_inset Flex CharStyle:Code
2356 \begin_layout Plain Layout
2362 , and the script given as argument will be run as:
2363 \begin_inset Flex CharStyle:Code
2366 \begin_layout Plain Layout
2367 script <infile.out >infile.log
2373 The argument may contain
2374 \begin_inset Flex CharStyle:Code
2377 \begin_layout Plain Layout
2386 \begin_layout Labeling
2387 \labelwidthstring 00.00.0000
2388 \begin_inset Flex CharStyle:Code
2391 \begin_layout Plain Layout
2397 The name of the directory in which the converter will dump the generated
2399 LyX will not create this directory, and it does not copy anything into
2400 it, though it will copy this directory to the destination.
2401 The argument may contain
2402 \begin_inset Flex CharStyle:Code
2405 \begin_layout Plain Layout
2411 , which will be replaced by the base name of the input and output files,
2412 respectively, when the directory is copied.
2413 \begin_inset Newline newline
2416 Note that resultdir and usetempdir make no sense together.
2417 The latter will be ignored if the former is given.
2420 \begin_layout Labeling
2421 \labelwidthstring 00.00.0000
2422 \begin_inset Flex CharStyle:Code
2425 \begin_layout Plain Layout
2431 Determines the output file name and may, contain
2432 \begin_inset Flex CharStyle:Code
2435 \begin_layout Plain Layout
2442 Sensible only with resultdir and optional even then; if not given, it defaults
2446 \begin_layout Standard
2447 None of these last three are presently used in any of the converters that
2448 are installed with LyX.
2452 \begin_layout Standard
2453 You do not have to define converters between all the formats between which
2454 you want to convert.
2455 For example, you will note that there is no `LyX to PostScript®' converter,
2456 but LyX will export PostScript®.
2457 It does so by first creating a LaTeX file (no converter needs to be defined
2458 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2459 and finally converting the resulting DVI file to PostScript®.
2460 LyX finds such `chains' of converters automatically, and it will always
2461 choose the shortest possible chain.
2462 You can, though, still define multiple conversion methods between file
2464 For example, the standard LyX configuration provides three ways to convert
2465 LaTeX to PDF: Directly, using
2466 \begin_inset Flex CharStyle:MenuItem
2469 \begin_layout Plain Layout
2475 ; via (DVI and) PostScript®, using
2476 \begin_inset Flex CharStyle:MenuItem
2479 \begin_layout Plain Layout
2486 \begin_inset Flex CharStyle:MenuItem
2489 \begin_layout Plain Layout
2496 To define such alternate chains, you must define multiple target `file
2497 formats', as described in section
2498 \begin_inset CommandInset ref
2500 reference "sub:Formats"
2505 For example, in the standard configuration, the formats named
2506 \begin_inset Flex CharStyle:MenuItem
2509 \begin_layout Plain Layout
2516 \begin_inset Flex CharStyle:MenuItem
2519 \begin_layout Plain Layout
2526 \begin_inset Flex CharStyle:MenuItem
2529 \begin_layout Plain Layout
2535 are defined, all of which share the extension
2536 \begin_inset Flex CharStyle:MenuItem
2539 \begin_layout Plain Layout
2545 , and which correspond to the conversion methods just mentioned.
2548 \begin_layout Chapter
2549 Internationalizing LyX
2550 \begin_inset CommandInset label
2559 \begin_layout Standard
2560 LyX supports using a translated interface.
2561 Last time we checked, LyX provided text in thirty languages.
2562 The language of choice is called your
2567 (For further reading on locale settings, see also the documentation for
2568 locale that comes with your operating system.
2569 For Linux, the manual page for
2570 \begin_inset Flex CharStyle:Code
2573 \begin_layout Plain Layout
2579 could be a good place to start).
2582 \begin_layout Standard
2583 Notice that these translations will work, but do contain a few flaws.
2584 In particular, all dialogs have been designed with the English text in
2585 mind, which means that some of the translated text will be too large to
2586 fit within the space allocated.
2587 This is only a display problem and will not cause any harm.
2588 Also, you will find that some of the translations do not define shortcut
2589 keys for everything.
2590 Sometimes, there are simply not enough free letters to do it.
2591 Other times, the translator just hasn't got around to doing it yet.
2592 Our localization team, which you may wish to join,
2596 \begin_layout Plain Layout
2597 If you are a fluent speaker of a language other than English, joining these
2598 teams is a great way to give back to the LyX community!
2603 will of course try to fix these shortcomings in future versions of LyX.
2606 \begin_layout Section
2610 \begin_layout Subsection
2611 Translating the graphical user interface (text messages).
2614 \begin_layout Standard
2616 \begin_inset Flex CharStyle:Code
2619 \begin_layout Plain Layout
2625 library to handle the internationalization of the interface.
2626 To have LyX speak your favorite language in all menus and dialogs, you
2628 \begin_inset Flex CharStyle:Code
2631 \begin_layout Plain Layout
2637 -file for that language.
2638 When this is available, you'll have to generate a
2639 \begin_inset Flex CharStyle:Code
2642 \begin_layout Plain Layout
2648 -file from it and install the
2649 \begin_inset Flex CharStyle:Code
2652 \begin_layout Plain Layout
2659 The process of doing all of this is explained in the documentation for
2661 \begin_inset Flex CharStyle:Code
2664 \begin_layout Plain Layout
2671 It is possible to do this just for yourself, but if you're going to do
2672 it, you might as well share the results of your labors with the rest of
2674 Send a message to the LyX developers' list for more information about how
2678 \begin_layout Standard
2679 In short, this is what you should do (xx denotes the language code):
2682 \begin_layout Itemize
2683 Check out the LyX source code.
2685 \begin_inset CommandInset href
2687 name "information on the web"
2688 target "http://www.lyx.org/devel/cvs.php"
2695 \begin_layout Itemize
2697 \begin_inset Flex CharStyle:Code
2700 \begin_layout Plain Layout
2706 to the folder of the
2707 \begin_inset Flex CharStyle:Code
2710 \begin_layout Plain Layout
2718 \begin_inset Flex CharStyle:Code
2721 \begin_layout Plain Layout
2729 \begin_inset Flex CharStyle:Code
2732 \begin_layout Plain Layout
2738 doesn't exist anywhere, it can be remade with the console command
2739 \begin_inset Flex CharStyle:Code
2742 \begin_layout Plain Layout
2748 in that directory, or you can use an existing po-file for some other language
2752 \begin_layout Itemize
2754 \begin_inset Flex CharStyle:Code
2757 \begin_layout Plain Layout
2767 \begin_layout Plain Layout
2768 This is just a text file, so it can be edited in any text editor.
2769 But there are also specialized programs that support such editing, such
2774 (for all platforms) or
2783 contains a `mode' for editing
2784 \begin_inset Flex CharStyle:Code
2787 \begin_layout Plain Layout
2798 For some menu- and widget-labels, there are also shortcut keys that should
2800 Those keys are marked after a `|', and should be translated according to
2801 the words and phrases of the language.
2802 You should also fill also out the information at the beginning of the new
2804 \begin_inset Flex CharStyle:Code
2807 \begin_layout Plain Layout
2813 -file with your email-address, etc., so people know where to reach you with
2814 suggestions and entertaining flames.
2817 \begin_layout Standard
2818 If you are just doing this on your own, then:
2821 \begin_layout Itemize
2823 \begin_inset Flex CharStyle:Code
2826 \begin_layout Plain Layout
2833 This can be done with
2834 \begin_inset Flex CharStyle:Code
2837 \begin_layout Plain Layout
2838 msgfmt -o xx.mo < xx.po
2846 \begin_layout Itemize
2848 \begin_inset Flex CharStyle:Code
2851 \begin_layout Plain Layout
2857 -file to your locale-tree, at the correct directory for application messages
2862 xx, and under the name
2863 \begin_inset Flex CharStyle:Code
2866 \begin_layout Plain Layout
2873 \begin_inset space \thinspace{}
2877 \begin_inset space \space{}
2881 \begin_inset Flex CharStyle:Code
2884 \begin_layout Plain Layout
2885 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2895 \begin_layout Standard
2896 As said, however, it would be best if the new
2897 \begin_inset Flex CharStyle:Code
2900 \begin_layout Plain Layout
2906 -file could be added to the LyX distribution, so others can use it.
2907 Adding it involves making additional changes to LyX.
2908 So send an email to the developers' mailing list if you're interested in
2912 \begin_layout Subsubsection
2916 \begin_layout Standard
2917 Sometimes it turns out that one English message needs to be translated into
2918 different messages in the target language.
2919 One example is the message
2920 \begin_inset Flex CharStyle:Code
2923 \begin_layout Plain Layout
2929 which has the German translation
2937 , depending upon exactly what the English
2938 \begin_inset Quotes eld
2942 \begin_inset Quotes erd
2947 \begin_inset Flex CharStyle:Code
2950 \begin_layout Plain Layout
2956 does not handle such ambigous translations.
2957 Therefore you have to add some context information to the message: Instead
2959 \begin_inset Flex CharStyle:Code
2962 \begin_layout Plain Layout
2969 \begin_inset Flex CharStyle:Code
2972 \begin_layout Plain Layout
2973 To[[as in 'From format x to format y']]
2979 \begin_inset Flex CharStyle:Code
2982 \begin_layout Plain Layout
2983 To[[as in 'From page x to page y']].
2988 Now the two occurences of
2989 \begin_inset Flex CharStyle:Code
2992 \begin_layout Plain Layout
2999 \begin_inset Flex CharStyle:Code
3002 \begin_layout Plain Layout
3008 and can be translated correctly to
3019 \begin_layout Standard
3020 Of course the context information needs to be stripped off the original
3021 message when no translation is used.
3022 Therefore you have to put it in double square brackets at the end of the
3023 message (see the example above).
3024 The translation mechanism of LyX ensures that everything in double square
3025 brackets at the end of messages is removed before displaying the message.
3028 \begin_layout Subsection
3029 Translating the documentation.
3032 \begin_layout Standard
3033 The online documentation (in the
3034 \begin_inset Flex CharStyle:MenuItem
3037 \begin_layout Plain Layout
3047 -menu) can (and should!) be translated.
3048 If there are translated versions of the documentation available
3052 \begin_layout Plain Layout
3053 As of March 2008, at least some of the documents have been translated into
3054 fourteen languages, with the Tutorial available in a few more.
3059 and the locale is set accordingly, these will be used automagically by
3061 LyX looks for translated versions as
3062 \begin_inset Flex CharStyle:Code
3065 \begin_layout Plain Layout
3066 LyXDir/doc/xx_DocName.lyx
3072 \begin_inset Flex CharStyle:Code
3075 \begin_layout Plain Layout
3081 is the code for the language currently in use.
3082 If there are no translated documents, the default English versions will
3084 Note that the translated versions must have the same filenames (
3085 \begin_inset Flex CharStyle:Code
3088 \begin_layout Plain Layout
3094 above) as the original.
3095 If you feel up to translating the documentation (an excellent way to proof-read
3096 the original documentation by the way!), there are a few things you should
3100 \begin_layout Itemize
3102 \begin_inset Flex CharStyle:Code
3105 \begin_layout Plain Layout
3111 , the guide to writing LyX documentation.
3112 Pay special attention to the translator's section.
3115 \begin_layout Itemize
3116 Check out the documentation translation web page at
3117 \begin_inset CommandInset href
3119 name "http://www.lyx.org/Translation"
3120 target "http://www.lyx.org/Translation"
3125 That way, you can find out which (if any) documents have already been translate
3126 d into your language.
3127 You can also find out who (if anyone) is organizing the effort to translate
3128 the documentation into your language.
3129 If no one is organizing the effort, please let us know that you're interested.
3132 \begin_layout Standard
3133 Once you get to actually translating, here's a few hints for you that may
3137 \begin_layout Itemize
3138 Join the documentation team! There is information on how to do that in
3139 \begin_inset Flex CharStyle:Code
3142 \begin_layout Plain Layout
3149 \begin_inset Flex CharStyle:MenuItem
3152 \begin_layout Plain Layout
3157 elp\SpecialChar \menuseparator
3167 ), which by the way is the first document you should translate.
3170 \begin_layout Itemize
3171 Learn the typographic conventions for the language you are translating to.
3172 Typography is an ancient art and over the centuries, a great variety of
3173 conventions have developed throughout different parts of the world.
3174 Also study the professional terminology amongst typographers in your country.
3175 Inventing your own terminology will only confuse the users.
3178 (Warning! Typography is addictive!)
3181 \begin_layout Itemize
3182 Make a copy of the document.
3183 This will be your working copy.
3184 You can use this as your personal translated help-file by placing it in
3186 \begin_inset Flex CharStyle:Code
3189 \begin_layout Plain Layout
3198 \begin_layout Itemize
3199 Sometimes the original document (from the LyX-team) will be updated.
3200 Use the source viewer at
3201 \begin_inset CommandInset href
3203 name "http://www.lyx.org/trac/timeline"
3204 target "http://www.lyx.org/trac/timeline"
3208 to see what has been changed.
3209 That way you can easily see which parts of the translated document need
3213 \begin_layout Standard
3214 If you ever find an error in the original document, fix it and notify the
3215 rest of the documentation team of the changes! (You didn't forget to join
3216 the documentation team, did you?)
3219 \begin_layout Standard
3220 \begin_inset Branch OutDated
3223 \begin_layout Section
3224 International Keyboard Support
3227 \begin_layout Standard
3230 [Editor's Note: The following section is by
3238 It needs to be fixed to conform to the new Documentation Style sheet and
3239 to make use of the new v1.0 features.
3240 The whole thing also needs to be merged with the section following it.-jw
3241 It may also be badly out of date.-rh (2008)]
3244 \begin_layout Subsection
3245 Defining Own Keymaps: Keymap File Format
3248 \begin_layout Standard
3249 Let's look at a keyboard definition file a little closer.
3250 It is a plain text file defining
3253 \begin_layout Itemize
3254 key-to-key or key-to-string translations
3257 \begin_layout Itemize
3261 \begin_layout Itemize
3262 dead keys exceptions
3265 \begin_layout Standard
3266 To define key-to-key or key-to-string translation, use this command:
3269 \begin_layout Quotation
3270 \begin_inset Flex CharStyle:Code
3273 \begin_layout Plain Layout
3282 \begin_inset Flex CharStyle:Code
3285 \begin_layout Plain Layout
3294 \begin_layout Standard
3296 \begin_inset Flex CharStyle:Code
3299 \begin_layout Plain Layout
3305 is the key to be translated and
3306 \begin_inset Flex CharStyle:Code
3309 \begin_layout Plain Layout
3315 is the string to be inserted into the document.
3316 To define dead keys, use:
3319 \begin_layout Quotation
3320 \begin_inset Flex CharStyle:Code
3323 \begin_layout Plain Layout
3332 \begin_inset Flex CharStyle:Code
3335 \begin_layout Plain Layout
3344 \begin_layout Standard
3346 \begin_inset Flex CharStyle:Code
3349 \begin_layout Plain Layout
3355 is a keyboard key and
3356 \begin_inset Flex CharStyle:Code
3359 \begin_layout Plain Layout
3366 The following dead keys are supported (shortcut name is in parentheses):
3369 \begin_layout Quotation
3373 \begin_inset space \hfill{}
3379 \begin_layout Quotation
3381 \begin_inset space \hfill{}
3387 \begin_layout Quotation
3389 \begin_inset space \hfill{}
3395 \begin_layout Quotation
3397 \begin_inset space \hfill{}
3403 \begin_layout Quotation
3405 \begin_inset space \hfill{}
3411 \begin_layout Quotation
3413 \begin_inset space \hfill{}
3420 \begin_layout Plain Layout
3432 \begin_layout Quotation
3434 \begin_inset space \hfill{}
3440 \begin_layout Quotation
3442 \begin_inset space \hfill{}
3449 \begin_layout Plain Layout
3461 \begin_layout Quotation
3463 \begin_inset space \hfill{}
3469 \begin_layout Quotation
3471 \begin_inset space \hfill{}
3477 \begin_layout Quotation
3479 \begin_inset space \hfill{}
3486 \begin_layout Plain Layout
3498 \begin_layout Quotation
3500 \begin_inset space \hfill{}
3507 \begin_layout Plain Layout
3519 \begin_layout Quotation
3521 \begin_inset space \hfill{}
3527 \begin_layout Quotation
3528 hungarian umlaut (hug)
3529 \begin_inset space \hfill{}
3535 \begin_layout Quotation
3537 \begin_inset space \hfill{}
3543 \begin_layout Quotation
3545 \begin_inset space \hfill{}
3552 \begin_layout Plain Layout
3564 \begin_layout Standard
3565 Since in many international keyboards there are exceptions to what some
3566 dead keys should do, you can define them using
3569 \begin_layout Quotation
3570 \begin_inset Flex CharStyle:Code
3573 \begin_layout Plain Layout
3581 deadkey key outstring
3584 \begin_layout Standard
3585 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3589 \begin_layout Quotation
3590 \begin_inset Flex CharStyle:Code
3593 \begin_layout Plain Layout
3606 \begin_layout Standard
3607 to make it work correctly.
3608 Also, you have to define as exceptions dead keys over i and j, to remove
3609 the dot from them before inserting an accent mark.
3610 I will change this when the time comes, but so far I haven't had time.
3613 \begin_layout Standard
3614 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3617 \begin_inset Flex CharStyle:Code
3620 \begin_layout Plain Layout
3626 have different meaning.
3628 \begin_inset Flex CharStyle:Code
3631 \begin_layout Plain Layout
3637 marks comments, quotes start and end LaTeX-style commands.
3638 To enter quote, you'll need to use
3639 \begin_inset Flex CharStyle:Code
3642 \begin_layout Plain Layout
3651 \begin_inset Flex CharStyle:Code
3654 \begin_layout Plain Layout
3661 \begin_inset Flex CharStyle:Code
3664 \begin_layout Plain Layout
3675 \begin_layout Standard
3676 If you make a keyboard description file that works for your language, please
3677 mail it to me, so I can include it in the next keymap distribution.
3680 \begin_layout Standard
3681 More keywords will be supported in keymap configuration file in future,
3685 \begin_layout Itemize
3686 \begin_inset Flex CharStyle:Code
3689 \begin_layout Plain Layout
3700 \begin_inset space \hfill{}
3704 \begin_inset Flex CharStyle:Code
3707 \begin_layout Plain Layout
3716 \begin_layout Itemize
3717 \begin_inset Flex CharStyle:Code
3720 \begin_layout Plain Layout
3731 \begin_inset space \hfill{}
3735 \begin_inset Flex CharStyle:Code
3738 \begin_layout Plain Layout
3744 an external keymap translation program
3747 \begin_layout Standard
3748 Also, it should look into
3749 \begin_inset Flex CharStyle:Code
3752 \begin_layout Plain Layout
3758 file for defaults, too (for example, a
3759 \begin_inset Flex CharStyle:Code
3762 \begin_layout Plain Layout
3770 option to include default keyboard).
3778 \begin_layout Section
3779 \begin_inset CommandInset label
3785 International Keymap Stuff
3788 \begin_layout Standard
3789 \begin_inset Note Note
3792 \begin_layout Plain Layout
3793 In doing the revisions on this document in March 2008, I did not look over
3794 this stuff, as I do not understand it.
3795 It would be good if someone else could do so.
3803 \begin_layout Standard
3804 The next two sections describe the
3805 \begin_inset Flex CharStyle:Code
3808 \begin_layout Plain Layout
3817 \begin_inset Flex CharStyle:Code
3820 \begin_layout Plain Layout
3828 file syntax in detail.
3829 These sections should help you design your own key map if the ones provided
3830 do not meet your needs.
3833 \begin_layout Subsection
3837 \begin_layout Standard
3841 \begin_inset Flex CharStyle:Code
3844 \begin_layout Plain Layout
3850 file maps keystrokes to characters or strings.
3851 As the name suggests, it sets a keyboard mapping.
3853 \begin_inset Flex CharStyle:Code
3856 \begin_layout Plain Layout
3867 \begin_inset Flex CharStyle:Code
3870 \begin_layout Plain Layout
3885 \begin_inset Flex CharStyle:Code
3888 \begin_layout Plain Layout
3901 \begin_inset Flex CharStyle:Code
3904 \begin_layout Plain Layout
3913 \begin_inset Flex CharStyle:Code
3916 \begin_layout Plain Layout
3924 are described in this section.
3927 \begin_layout Labeling
3928 \labelwidthstring 00.00.0000
3929 \begin_inset Flex CharStyle:Code
3932 \begin_layout Plain Layout
3940 Map a character to a string
3943 \begin_layout LyX-Code
3958 \begin_layout Standard
3991 the double-quote (")
4008 must be escaped with a preceding backslash (
4019 \begin_layout Standard
4021 \begin_inset Flex CharStyle:MenuItem
4024 \begin_layout Plain Layout
4032 statement to cause the symbol
4033 \begin_inset Flex CharStyle:MenuItem
4036 \begin_layout Plain Layout
4044 to be output for the keystroke
4045 \begin_inset Flex CharStyle:MenuItem
4048 \begin_layout Plain Layout
4059 \begin_layout LyX-Code
4065 \begin_layout Labeling
4066 \labelwidthstring 00.00.0000
4067 \begin_inset Flex CharStyle:Code
4070 \begin_layout Plain Layout
4078 Specify an accent character
4081 \begin_layout LyX-Code
4090 \begin_layout Standard
4091 This will make the cha
4129 This is the dead key
4133 \begin_layout Plain Layout
4140 refers to a key that does not produce a character by itself, but when followed
4141 with another key, produces the desired accent character.
4142 For example, a German characte
4144 r with an umlaut like
4154 can be produced in this manner.
4163 \begin_layout Standard
4176 and then another key not in
4193 followed by the other, unallowed key, as output.
4197 \begin_inset Flex CharStyle:MenuItem
4200 \begin_layout Plain Layout
4208 cancels a dead key, so if
4219 \begin_inset Flex CharStyle:MenuItem
4222 \begin_layout Plain Layout
4231 , the cursor will not go one position backwards but will instead cancel
4247 might have had on the next keystroke.
4251 \begin_layout Standard
4252 The following example specifies that the character ' is to be an acute accent,
4253 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4256 \begin_layout LyX-Code
4259 kmod ' acute aeiouAEIOU
4262 \begin_layout Labeling
4263 \labelwidthstring 00.00.0000
4264 \begin_inset Flex CharStyle:Code
4267 \begin_layout Plain Layout
4273 Specify an exception to the accent character
4276 \begin_layout LyX-Code
4285 \begin_layout Standard
4286 This defines an exce
4327 have been assigned a keystroke with a previous
4330 \begin_inset Flex CharStyle:Code
4333 \begin_layout Plain Layout
4357 must not belong in the
4404 If such a declaration does not exist in
4412 \begin_inset Flex CharStyle:Code
4415 \begin_layout Plain Layout
4449 \begin_inset Flex CharStyle:Code
4452 \begin_layout Plain Layout
4466 \begin_layout Standard
4467 The following command produces causes äi to be produced when you enter acute-i
4471 \begin_layout LyX-Code
4485 \begin_layout Labeling
4486 \labelwidthstring 00.00.0000
4487 \begin_inset Flex CharStyle:Code
4490 \begin_layout Plain Layout
4496 Combine two accent characters
4499 \begin_layout LyX-Code
4505 accent1 accent2 allowed
4508 \begin_layout Standard
4509 This one is getting pretty esoteric.
4510 It allows you to combine the effect
4566 \begin_inset Flex CharStyle:Code
4569 \begin_layout Plain Layout
4597 \begin_layout Standard
4598 Consider this example from the
4599 \begin_inset Flex CharStyle:Code
4602 \begin_layout Plain Layout
4613 \begin_layout LyX-Code
4616 kmod ; acute aeioyvhAEIOYVH
4620 kcomb acute umlaut iyIY
4623 \begin_layout Standard
4624 This allows you to press
4625 \begin_inset Flex CharStyle:MenuItem
4628 \begin_layout Plain Layout
4636 and get the effect of
4637 \begin_inset Flex CharStyle:Code
4640 \begin_layout Plain Layout
4659 in this case cancels the last dead key, so if you press
4660 \begin_inset Flex CharStyle:MenuItem
4663 \begin_layout Plain Layout
4672 \begin_inset Flex CharStyle:Code
4675 \begin_layout Plain Layout
4688 \begin_layout Subsection
4692 \begin_layout Standard
4694 \begin_inset Flex CharStyle:Code
4697 \begin_layout Plain Layout
4705 mapping is performed, a
4706 \begin_inset Flex CharStyle:Code
4709 \begin_layout Plain Layout
4719 file maps the strings that the symbols generate to characters in the current
4721 The LyX distribution currently includes at least the
4722 \begin_inset Flex CharStyle:Code
4725 \begin_layout Plain Layout
4734 \begin_inset Flex CharStyle:Code
4737 \begin_layout Plain Layout
4748 \begin_layout Standard
4750 \begin_inset Flex CharStyle:Code
4753 \begin_layout Plain Layout
4761 file is a sequence of declarations of the form
4764 \begin_layout LyX-Code
4777 \begin_layout Standard
4778 For example, in order to map
4779 \begin_inset Flex CharStyle:MenuItem
4782 \begin_layout Plain Layout
4792 to the corresponding character in the iso-8859-1 set (233), the following
4796 \begin_layout LyX-Code
4804 \begin_layout Standard
4806 \begin_inset Flex CharStyle:Code
4809 \begin_layout Plain Layout
4818 \begin_inset Flex CharStyle:Code
4821 \begin_layout Plain Layout
4839 the same character can apply to more than one string.
4841 \begin_inset Flex CharStyle:Code
4844 \begin_layout Plain Layout
4855 \begin_layout LyX-Code
4867 \begin_inset Newline newline
4883 \begin_layout Standard
4884 If LyX cannot find a mapping for the string produced by the keystroke or
4885 a deadkey sequence, it will check if it looks like an accented char and
4886 try to draw an accent over the character on screen.
4889 \begin_layout Subsection
4893 \begin_layout Standard
4894 There is a second way to add support for international characters through
4895 so-called dead-keys.
4896 A dead-key works in combination with a letter to produce an accented character.
4897 Here, we'll explain how to create a really simple dead-key to illustrate
4901 \begin_layout Standard
4902 Suppose you happen to need the circumflex character,
4903 \begin_inset Quotes eld
4907 \begin_inset Quotes erd
4912 \begin_inset Flex CharStyle:MenuItem
4915 \begin_layout Plain Layout
4922 \begin_inset space ~
4926 \begin_inset Flex CharStyle:MenuItem
4929 \begin_layout Plain Layout
4935 ] to the LyX command
4936 \begin_inset Flex CharStyle:Code
4939 \begin_layout Plain Layout
4946 \begin_inset Flex CharStyle:Code
4949 \begin_layout Plain Layout
4956 Now, whenever you type the
4957 \begin_inset Flex CharStyle:MenuItem
4960 \begin_layout Plain Layout
4966 -key followed by a letter, that letter will have a circumflex accent on
4968 For example, the sequence
4969 \begin_inset Quotes eld
4973 \begin_inset Flex CharStyle:MenuItem
4976 \begin_layout Plain Layout
4983 \begin_inset Quotes erd
4986 produces the letter:
4987 \begin_inset Quotes eld
4991 \begin_inset Quotes erd
4995 If you tried to type
4996 \begin_inset Quotes eld
5000 \begin_inset Flex CharStyle:MenuItem
5003 \begin_layout Plain Layout
5010 \begin_inset Quotes erd
5013 , however, LyX will complain with a beep, since a
5014 \begin_inset Quotes eld
5018 \begin_inset Flex CharStyle:MenuItem
5021 \begin_layout Plain Layout
5028 \begin_inset Quotes erd
5031 never takes a circumflex accent.
5033 \begin_inset Flex CharStyle:MenuItem
5036 \begin_layout Plain Layout
5042 after a dead-key produces the bare-accent.
5043 Please note this last point! If you bind a key to a dead-key, you'll need
5044 to rebind the character on that key to yet another key.
5046 \begin_inset Flex CharStyle:MenuItem
5049 \begin_layout Plain Layout
5055 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5058 \begin_layout Standard
5059 One common way to bind dead-keys is to use
5060 \begin_inset Flex CharStyle:MenuItem
5063 \begin_layout Plain Layout
5070 \begin_inset Flex CharStyle:MenuItem
5073 \begin_layout Plain Layout
5080 \begin_inset Flex CharStyle:MenuItem
5083 \begin_layout Plain Layout
5089 in combination with an accent, like
5090 \begin_inset Quotes eld
5094 \begin_inset Flex CharStyle:MenuItem
5097 \begin_layout Plain Layout
5104 \begin_inset Quotes erd
5108 \begin_inset Quotes eld
5112 \begin_inset Flex CharStyle:MenuItem
5115 \begin_layout Plain Layout
5122 \begin_inset Quotes erd
5126 \begin_inset Quotes eld
5130 \begin_inset Flex CharStyle:MenuItem
5133 \begin_layout Plain Layout
5140 \begin_inset Quotes erd
5144 Another way involves using
5145 \begin_inset Flex CharStyle:Code
5148 \begin_layout Plain Layout
5155 \begin_inset Flex CharStyle:Code
5158 \begin_layout Plain Layout
5164 to set up the special
5165 \begin_inset Flex CharStyle:Code
5168 \begin_layout Plain Layout
5176 \begin_inset Flex CharStyle:Code
5179 \begin_layout Plain Layout
5185 acts in some ways just like
5186 \begin_inset Flex CharStyle:MenuItem
5189 \begin_layout Plain Layout
5195 and permits you to bind keys to accented characters.
5196 You can also turn keys into dead-keys by binding them to something like
5198 \begin_inset Flex CharStyle:Code
5201 \begin_layout Plain Layout
5207 and then binding this symbolic key to the corresponding LyX command.
5211 \begin_layout Plain Layout
5216 : This is exactly what I do in my
5217 \begin_inset Flex CharStyle:Code
5220 \begin_layout Plain Layout
5227 \begin_inset Flex CharStyle:Code
5230 \begin_layout Plain Layout
5238 \begin_inset Flex CharStyle:MenuItem
5241 \begin_layout Plain Layout
5243 \begin_inset space ~
5252 \begin_inset Flex CharStyle:Code
5255 \begin_layout Plain Layout
5261 and a bunch of these
5262 \begin_inset Quotes eld
5266 \begin_inset Flex CharStyle:Code
5269 \begin_layout Plain Layout
5276 \begin_inset Quotes erd
5279 symbolic keys bound such things as
5280 \begin_inset Flex CharStyle:MenuItem
5283 \begin_layout Plain Layout
5285 \begin_inset space ~
5294 \begin_inset Flex CharStyle:MenuItem
5297 \begin_layout Plain Layout
5299 \begin_inset space ~
5308 This is how I produce my accented characters.
5313 You can make just about anything into the
5314 \begin_inset Flex CharStyle:Code
5317 \begin_layout Plain Layout
5324 \begin_inset Flex CharStyle:MenuItem
5327 \begin_layout Plain Layout
5333 keys, a spare function key, etc.
5334 As for the LyX commands that produce accents, check the entry for
5335 \begin_inset Flex CharStyle:Code
5338 \begin_layout Plain Layout
5349 You'll find the complete list there.
5352 \begin_layout Subsection
5353 Saving your Language Configuration
5356 \begin_layout Standard
5357 You can edit your preferences so that your desired language environment
5358 is automatically configured when LyX starts up, via the
5359 \begin_inset Flex CharStyle:MenuItem
5362 \begin_layout Plain Layout
5363 Edit\SpecialChar \menuseparator
5372 \begin_layout Chapter
5373 Installing New Document Classes, Layouts, and Templates
5374 \begin_inset CommandInset label
5376 name "chap:textclass"
5384 \begin_layout Plain Layout
5385 Installing New Document Classes
5393 \begin_layout Standard
5394 In this chapter, we describe the procedures for creating and installing
5395 new LyX layout and template files, as well as offer a refresher on correctly
5396 installing new LaTeX document classes.
5397 Some definitions: a document class is a LaTeX file (usually ending in
5398 \begin_inset Flex CharStyle:Code
5401 \begin_layout Plain Layout
5408 \begin_inset Flex CharStyle:Code
5411 \begin_layout Plain Layout
5417 ) that describes the format of a document such as an article, report, journal
5418 preprint, etc, and all the commands needed to realize that format.
5419 A layout file is a LyX file that corresponds to a LaTeX document class
5420 and that tells LyX how to
5421 \begin_inset Quotes eld
5425 \begin_inset Quotes erd
5428 things on the screen to make the display look something like the final
5430 More precisely, a layout file describes a
5431 \begin_inset Quotes eld
5435 \begin_inset Quotes erd
5438 which is the internal construct LyX uses to render the screen display.
5440 \begin_inset Quotes eld
5444 \begin_inset Quotes erd
5448 \begin_inset Quotes eld
5452 \begin_inset Quotes erd
5455 can be used somewhat interchangeably, but it is better to refer to the
5456 file as the layout, and the thing living in LyX's memory as the text class.
5457 A template file is simply a LyX document that contains a set of predefined
5458 entries for a given document class---entries that are generally required
5460 Templates are especially useful for things like journal manuscripts that
5461 are to be submitted electronically.
5464 \begin_layout Section
5465 Installing a new LaTeX package
5468 \begin_layout Standard
5469 Some installations may not include a LaTeX package that you would like to
5471 For example, you might need FoilTeX, a package for preparing slides or
5472 viewgraphs for overhead projectors.
5473 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5474 a user interface for that.
5475 For example on MiKTeX you start its program
5476 \begin_inset Quotes eld
5480 \begin_inset Quotes erd
5483 to get a list of available packages.
5484 To install one, right click on it or use the installing toolbar button.
5485 When the package you want to install is not in the list, but you have it
5487 \begin_inset Flex CharStyle:Code
5490 \begin_layout Plain Layout
5497 \begin_inset Flex CharStyle:Code
5500 \begin_layout Plain Layout
5506 -file, then copy these files to a subfolder of your LaTeX distribution,
5507 for example to the folder
5516 Then update the file name database of your LaTeX-distribution.
5517 For example on MiKTeX this is done by pressing the button
5520 \begin_inset space ~
5525 that you find in MiKTeX's
5526 \begin_inset Quotes eld
5530 \begin_inset Quotes erd
5534 In both cases you need afterwards to reconfigure LyX using the menu
5535 \begin_inset Flex CharStyle:MenuItem
5538 \begin_layout Plain Layout
5539 Tools\SpecialChar \menuseparator
5545 and then to restart LyX.
5548 \begin_layout Standard
5549 If your LaTeX distribution doesn't provide a user interface, then you can
5550 follow these steps by using a UNIX/Linux console.
5553 \begin_layout Enumerate
5554 Get the package from
5555 \begin_inset CommandInset href
5558 target "http://www.ctan.org/"
5565 \begin_layout Enumerate
5566 You can install this package in several different places.
5567 If you want it to be available for all users on your system, then you should
5568 install it in your `local' TeX tree; if you want (or need) it to be available
5569 just for you, then you can install it in your own `user' TeX tree.
5570 Where these should be created, if they do not already exist, depends upon
5571 the details of your system.
5572 To find out, look in the file
5573 \begin_inset Flex CharStyle:Code
5576 \begin_layout Plain Layout
5586 \begin_layout Plain Layout
5587 This usually lives in the directory
5588 \begin_inset Flex CharStyle:Code
5591 \begin_layout Plain Layout
5597 , though you can run
5598 \begin_inset Flex CharStyle:Code
5601 \begin_layout Plain Layout
5612 The location of the `local' TeX tree is defined by
5613 \begin_inset Flex CharStyle:Code
5616 \begin_layout Plain Layout
5622 ; this is usually somewhere like
5623 \begin_inset Flex CharStyle:Code
5626 \begin_layout Plain Layout
5627 /usr/local/share/texmf/
5633 The `user' TeX tree is defined by
5634 \begin_inset Flex CharStyle:Code
5637 \begin_layout Plain Layout
5644 \begin_inset Flex CharStyle:Code
5647 \begin_layout Plain Layout
5654 (If these variables are not predefined, you can define them.) You'll probably
5655 need root permissions to create or modify the `local' tree; but your `user'
5656 tree shouldn't have such limitations.
5659 \begin_layout Enumerate
5661 \begin_inset Flex CharStyle:Code
5664 \begin_layout Plain Layout
5671 \begin_inset Flex CharStyle:Code
5674 \begin_layout Plain Layout
5681 \begin_inset Flex CharStyle:Code
5684 \begin_layout Plain Layout
5691 \begin_inset space \thinspace{}
5695 \begin_inset Newline newline
5699 \begin_inset Flex CharStyle:Code
5702 \begin_layout Plain Layout
5703 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5709 \begin_inset Newline newline
5712 But, again, most of this will
5713 \begin_inset Quotes eld
5717 \begin_inset Quotes erd
5723 \begin_layout Enumerate
5728 \begin_layout Plain Layout
5729 We'll assume henceforth that you're defining `local' TeX tree.
5730 If you're defining a user tree, just adjust as necessary.
5736 You must follow the directory structure of your existing
5737 \begin_inset Flex CharStyle:Code
5740 \begin_layout Plain Layout
5746 directory, which will be found at
5747 \begin_inset Flex CharStyle:Code
5750 \begin_layout Plain Layout
5757 For example, latex packages should go under
5758 \begin_inset Flex CharStyle:Code
5761 \begin_layout Plain Layout
5762 $TEXMFLOCAL/tex/latex/
5770 \begin_layout Enumerate
5771 Install the package.
5772 For example, you would unpack the FoilTeX tarball and copy it to
5773 \begin_inset Flex CharStyle:Code
5776 \begin_layout Plain Layout
5777 $TEXMFLOCAL/tex/latex/foiltex
5784 \begin_inset Flex CharStyle:Code
5787 \begin_layout Plain Layout
5793 directory contains various files.
5796 \begin_layout Enumerate
5798 \begin_inset Flex CharStyle:Code
5801 \begin_layout Plain Layout
5809 \begin_inset Flex CharStyle:Code
5812 \begin_layout Plain Layout
5821 \begin_layout Standard
5822 Your package is now installed and available to LaTeX.
5823 To make it available to LyX, you need to create a Layout file, if one is
5824 not already available.
5825 (See the next section.) Once you have a layout file, you need only reconfigure
5827 \begin_inset Flex CharStyle:MenuItem
5830 \begin_layout Plain Layout
5831 Tools\SpecialChar \menuseparator
5837 ) and then restart LyX.
5838 You should then see your new package---for example
5839 \begin_inset Flex CharStyle:MenuItem
5842 \begin_layout Plain Layout
5849 \begin_inset Flex CharStyle:MenuItem
5852 \begin_layout Plain Layout
5853 Document\SpecialChar \menuseparator
5860 \begin_inset Flex CharStyle:MenuItem
5863 \begin_layout Plain Layout
5873 \begin_layout Section
5877 \begin_layout Standard
5878 This section describes how to write and install your own LyX layout files
5879 and walks through the
5880 \begin_inset Flex CharStyle:Code
5883 \begin_layout Plain Layout
5889 text class format as an example.
5891 \begin_inset Flex CharStyle:Code
5894 \begin_layout Plain Layout
5900 files describe what paragraph and character styles are available for a
5901 given document class and how LyX should display them.
5902 We try to provide a thorough description of the process here; however,
5903 there are so many different types of documents supported by LaTeX classes
5904 that we can't hope to cover every different possibility or problem you
5906 (The LyX users' list is frequented by people with lots of experience with
5907 layout design who are willing to share what they've learned.)
5910 \begin_layout Standard
5911 As you prepare to write a new layout, it is extremely helpful to look at
5912 the example layouts distributed with LyX.
5913 If you use a nice LaTeX document class that might be of interest for others,
5914 too, and have a nice corresponding LyX layout, feel free to contribute
5915 the stuff to us, so we may put it into the distribution.
5917 \begin_inset CommandInset href
5919 name "section on the LyX wiki"
5920 target "http://wiki.lyx.org/Layouts/Layouts"
5924 for this kind of material.
5927 \begin_layout Standard
5928 All the tags described in this chapter are case-insensitive; this means
5930 \begin_inset Flex CharStyle:Code
5933 \begin_layout Plain Layout
5940 \begin_inset Flex CharStyle:Code
5943 \begin_layout Plain Layout
5950 \begin_inset Flex CharStyle:Code
5953 \begin_layout Plain Layout
5959 are really the same command.
5960 The possible values are printed in brackets after the feature's name.
5961 The default value if a feature isn't specified inside a text class-description
5963 \begin_inset Flex CharStyle:Code
5966 \begin_layout Plain Layout
5975 If the argument has a datatype like
5976 \begin_inset Quotes eld
5980 \begin_inset Quotes erd
5984 \begin_inset Quotes eld
5988 \begin_inset Quotes erd
5991 , the default is shown like this:
5992 \begin_inset Flex CharStyle:Code
5995 \begin_layout Plain Layout
6006 \begin_layout Subsection
6007 \begin_inset CommandInset label
6009 name "sub:Layout-modules"
6016 \begin_layout Standard
6017 Similar to layout files, and new with LyX 1.6, are layout
6022 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6023 some modules---such as the Endnotes module---provide support for just such
6025 In a sense, layout modules are similar to included files---files like
6026 \begin_inset Flex CharStyle:Code
6029 \begin_layout Plain Layout
6035 ---in that modules are not specific to a given document layout but may be
6036 used with many different layouts.
6037 The difference is that using a layout module does not require editing the
6039 Rather, modules are selected in the
6040 \begin_inset Flex CharStyle:MenuItem
6043 \begin_layout Plain Layout
6044 Document\SpecialChar \menuseparator
6053 \begin_layout Standard
6054 Building modules is the easiest way to get started with layout editing,
6055 since it can be as simple as adding a single new paragraph or flex inset.
6056 But modules may, in principle, contain anything a layout file can contain.
6059 \begin_layout Standard
6060 A module must begin with a line like the following:
6063 \begin_layout LyX-Code
6066 DeclareLyXModule[endnotes.sty]{Endnotes}
6069 \begin_layout Standard
6070 The argument in square brackets is optional: It declares any LaTeX packages
6071 on which the module depends.
6072 The mandatory argument, in curly brackets, is the name of the module, as
6074 \begin_inset Flex CharStyle:MenuItem
6077 \begin_layout Plain Layout
6078 Document\SpecialChar \menuseparator
6088 \begin_layout Standard
6089 The module declaration should then be followed by lines like the following:
6092 \begin_layout LyX-Code
6096 \begin_layout LyX-Code
6097 #Adds an endnote command, in addition to footnotes.
6101 \begin_layout LyX-Code
6102 #You will need to add
6104 theendnotes in ERT where you
6107 \begin_layout LyX-Code
6108 #want the endnotes to appear.
6112 \begin_layout LyX-Code
6116 \begin_layout LyX-Code
6117 #Requires: somemodule | othermodule
6120 \begin_layout LyX-Code
6121 #Excludes: badmodule
6124 \begin_layout Standard
6125 The description is used in
6126 \begin_inset Flex CharStyle:MenuItem
6129 \begin_layout Plain Layout
6130 Document\SpecialChar \menuseparator
6136 to provide the user with information about what the module does.
6138 \begin_inset Flex CharStyle:Code
6141 \begin_layout Plain Layout
6147 line is used to identify other modules with which this one must be used;
6149 \begin_inset Flex CharStyle:Code
6152 \begin_layout Plain Layout
6158 line is used to identify modules with which this one may not be used.
6159 Both are optional, and, as shown, multiple modules should be separated
6160 with the pipe symbol: |.
6161 Note that the required modules are treated disjunctively:
6165 of the required modules must be used.
6170 excluded module may be used.
6171 Note that modules are identified here by their
6175 without the .module extension.
6177 \begin_inset Flex CharStyle:Code
6180 \begin_layout Plain Layout
6187 \begin_inset Flex CharStyle:Code
6190 \begin_layout Plain Layout
6199 \begin_layout Standard
6200 After creating a new module, you will need to reconfigure and then restart
6201 LyX for the module to appear in the menu.
6202 However, changes you make to the module will be seen immediately, if you
6204 \begin_inset Flex CharStyle:MenuItem
6207 \begin_layout Plain Layout
6208 Document\SpecialChar \menuseparator
6214 , highlight something, and then hit
6215 \begin_inset Quotes eld
6219 \begin_inset Quotes erd
6225 It is strongly recommended that you save your work before doing so
6230 it is strongly recommended that you not attempt to edit modules while simultaneo
6231 usly working on documents
6234 Though of course the developers strive to keep LyX stable in such situations,
6235 syntax errors and the like in your module file could cause strange behavior.
6238 \begin_layout Subsection
6239 Supporting new document classes
6242 \begin_layout Standard
6243 There are two situations you are likely to encounter when wanting to support
6244 a new LaTeX document class, involving LaTeX2e class (
6245 \begin_inset Flex CharStyle:Code
6248 \begin_layout Plain Layout
6255 \begin_inset Flex CharStyle:Code
6258 \begin_layout Plain Layout
6265 Supporting a style file is usually fairly easy.
6266 Supporting a new document class is a bit harder.
6269 \begin_layout Subsection
6271 \begin_inset Flex CharStyle:MenuItem
6274 \begin_layout Plain Layout
6283 \begin_layout Standard
6284 If your new document class is provided as a style file that is used in conjuncti
6285 on with an existing, supported document class---for the sake of the example,
6286 we'll assume that the style file is called
6287 \begin_inset Flex CharStyle:MenuItem
6290 \begin_layout Plain Layout
6296 and it is meant to be used with
6297 \begin_inset Flex CharStyle:MenuItem
6300 \begin_layout Plain Layout
6306 , which is a standard class---start by copying the existing class's layout
6307 file into your local directory:
6310 \begin_layout LyX-Code
6311 cp report.layout ~/.lyx/layouts/myclass.layout
6314 \begin_layout Standard
6316 \begin_inset Flex CharStyle:Code
6319 \begin_layout Plain Layout
6325 and change the line:
6328 \begin_layout LyX-Code
6331 DeclareLaTeXClass{report}
6334 \begin_layout Standard
6338 \begin_layout LyX-Code
6341 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6344 \begin_layout Standard
6348 \begin_layout LyX-Code
6350 \begin_inset Newline newline
6356 \begin_inset Newline newline
6362 \begin_layout Standard
6363 near the top of the file.
6366 \begin_layout Standard
6367 Start LyX and select
6368 \begin_inset Flex CharStyle:MenuItem
6371 \begin_layout Plain Layout
6372 Tools\SpecialChar \menuseparator
6379 Then restart LyX and try creating a new document.
6381 \begin_inset Flex CharStyle:MenuItem
6384 \begin_layout Plain Layout
6390 " as a document class option in the
6391 \begin_inset Flex CharStyle:MenuItem
6394 \begin_layout Plain Layout
6395 Document\SpecialChar \menuseparator
6402 It is likely that some of the sectioning commands and such in your new
6403 class will work differently from how they worked in the base class---
6404 \begin_inset Flex CharStyle:Code
6407 \begin_layout Plain Layout
6413 in this example---so you can fiddle around with the settings for the different
6414 sections if you wish.
6417 \begin_layout Subsection
6419 \begin_inset Flex CharStyle:MenuItem
6422 \begin_layout Plain Layout
6431 \begin_layout Standard
6432 There are two possibilities here.
6433 One is that the class file is itself based upon an existing document class.
6434 For example, many thesis classes are based upon
6435 \begin_inset Flex CharStyle:MenuItem
6438 \begin_layout Plain Layout
6445 To see whether yours is, look for a line like
6448 \begin_layout LyX-Code
6454 \begin_layout Standard
6456 If so, then you may proceed largely as in the previous section, though
6457 the DeclareLaTeXClass line will be different.
6458 If your new class is thesis, and it is based upon book, then the line should
6463 \begin_layout Plain Layout
6464 And it will be easiest if you save the file to
6465 \begin_inset Flex CharStyle:Code
6468 \begin_layout Plain Layout
6474 : LyX assumes that the document class has the same name as the layout file.
6483 \begin_layout LyX-Code
6486 DeclareLaTeXClass[thesis,book]{thesis}
6489 \begin_layout Standard
6490 If, on the other hand, the new class is not based upon an existing class,
6491 you will probably have to
6492 \begin_inset Quotes eld
6496 \begin_inset Quotes erd
6500 We strongly suggest copying an existing layout file which uses a similar
6501 LaTeX class and then modifying it, if you can do so.
6502 At least use an existing file as a starting point so you can find out what
6503 items you need to worry about.
6504 Again, the specifics are covered below.
6507 \begin_layout Section
6508 Declaring a new text class
6511 \begin_layout Standard
6512 When it's finally time to get your hands dirty and create or edit your own
6513 layout file, the following sections describe what you're up against.
6514 Our advice is to go slowly, save and test often, listen to soothing music,
6515 and enjoy one or two of your favorite adult beverages; more if you are
6516 getting particularly stuck.
6517 It's really not that hard, except that the multitude of options can become
6518 overwhelming if you try to do to much in one sitting.
6519 Go have another adult beverage, just for good measure.
6522 \begin_layout Standard
6526 \begin_layout Standard
6527 Lines in a layout file which begin with a
6528 \begin_inset Flex CharStyle:Code
6531 \begin_layout Plain Layout
6538 There is one exception to this rule: all layouts should begin with lines
6542 \begin_layout LyX-Code
6545 #% Do not delete the line below; configure depends on this
6548 \begin_layout LyX-Code
6553 DeclareLaTeXClass{article}
6556 \begin_layout Standard
6557 The second line is used when you configure LyX.
6558 The layout file is read by the LaTeX script
6559 \begin_inset Flex CharStyle:Code
6562 \begin_layout Plain Layout
6568 , in a special mode where
6569 \begin_inset Flex CharStyle:Code
6572 \begin_layout Plain Layout
6579 The first line is just a LaTeX comment, and the second one contains the
6580 declaration of the text class.
6581 If these lines appear in a file named
6582 \begin_inset Flex CharStyle:Code
6585 \begin_layout Plain Layout
6591 , then they define a text class of name
6592 \begin_inset Flex CharStyle:Code
6595 \begin_layout Plain Layout
6601 (the name of the layout file) which uses the LaTeX document class
6602 \begin_inset Flex CharStyle:Code
6605 \begin_layout Plain Layout
6611 (the default is to use the same name as the layout).
6613 \begin_inset Quotes eld
6617 \begin_inset Quotes erd
6620 that appears above is used as a description of the text class in the
6621 \begin_inset Flex CharStyle:MenuItem
6624 \begin_layout Plain Layout
6625 Document\SpecialChar \menuseparator
6634 \begin_layout Standard
6635 Let's assume that you wrote your own text class that uses the
6636 \begin_inset Flex CharStyle:Code
6639 \begin_layout Plain Layout
6645 document class, but where you changed the appearance of the section headings.
6646 If you put it in a file
6647 \begin_inset Flex CharStyle:Code
6650 \begin_layout Plain Layout
6656 , the header of this file should be:
6659 \begin_layout LyX-Code
6662 #% Do not delete the line below; configure depends on this
6665 \begin_layout LyX-Code
6670 DeclareLaTeXClass[article]{article (with my own headings)}
6673 \begin_layout Standard
6674 This declares a text class
6675 \begin_inset Flex CharStyle:Code
6678 \begin_layout Plain Layout
6684 , associated with the LaTeX document class
6685 \begin_inset Flex CharStyle:Code
6688 \begin_layout Plain Layout
6695 \begin_inset Quotes eld
6698 article (with my own headings)
6699 \begin_inset Quotes erd
6703 If your text class depends on several packages, you can declare it as:
6706 \begin_layout LyX-Code
6709 #% Do not delete the line below; configure depends on this
6712 \begin_layout LyX-Code
6717 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6720 \begin_layout Standard
6721 This indicates that your text class uses the foo.sty package.
6722 Finally, it is also possible to declare classes for DocBook code.
6723 Typical declarations will look like
6726 \begin_layout LyX-Code
6729 #% Do not delete the line below; configure depends on this
6732 \begin_layout LyX-Code
6737 DeclareDocBookClass[article]{SGML (DocBook article)}
6740 \begin_layout Standard
6741 Note that these declarations can also be given an optional parameter declaring
6742 the name of the document class (but not a list).
6745 \begin_layout Standard
6746 So, to be as explicit as possible, the form of the layout declaration is:
6749 \begin_layout LyX-Code
6754 DeclareLaTeXClass[class,package.sty]{layout description}
6757 \begin_layout Standard
6758 The class need only be specified if the name of the LaTeX class file and
6759 the name of the layout file are different; if the name of the classfile
6760 is not specified, then LyX will simply assume that it is the same as the
6761 name of the layout file.
6764 \begin_layout Standard
6765 When the text class has been modified to your taste, all you have to do
6766 is to copy it either to
6767 \begin_inset Flex CharStyle:Code
6770 \begin_layout Plain Layout
6777 \begin_inset Flex CharStyle:Code
6780 \begin_layout Plain Layout
6787 \begin_inset Flex CharStyle:MenuItem
6790 \begin_layout Plain Layout
6795 ools\SpecialChar \menuseparator
6805 , exit LyX and restart it.
6806 Then your new text class should be available along with the others.
6809 \begin_layout Standard
6810 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6811 you made to your layout files.
6812 As a result, editing layout files could be very time consuming.
6813 Beginning with 1.6, however, you can force a reload of the layout currently
6814 in use by using the LyX function
6815 \begin_inset Flex CharStyle:MenuItem
6818 \begin_layout Plain Layout
6825 There is no default binding for this function---though, of course, you
6826 can bind it to a key yourself.
6827 If you want to use this function, then, you should simply enter it in the
6833 : This is very much an `advanced feature'.
6838 recommended that you save your work before using this function.
6843 recommended that you not attempt to edit your layout while simultaneously
6844 working on a document that you care about.
6845 Use a test document.
6846 Syntax errors and the like in your layout file could cause peculiar behavior.
6847 In particular, such errors could cause LyX to regard the current layout
6848 as invalid and to attempt to switch to some other layout.
6849 The LyX team strives to keep LyX stable in such situations, but safe is
6853 \begin_layout Subsection
6857 \begin_layout Standard
6858 The first non-comment line must contain the file format number:
6861 \begin_layout Description
6862 \begin_inset Flex CharStyle:Code
6865 \begin_layout Plain Layout
6872 \begin_inset Flex CharStyle:Code
6875 \begin_layout Plain Layout
6881 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6882 don't have an explicit file format).
6883 The file format that is documented here is format 8.
6886 \begin_layout Subsection
6887 General text class parameters
6890 \begin_layout Standard
6891 These are the general parameters which describe the form of the entire document:
6894 \begin_layout Description
6895 \begin_inset Flex CharStyle:Code
6898 \begin_layout Plain Layout
6904 Adds information to the document preamble.
6906 \begin_inset Quotes eld
6910 \begin_inset Flex CharStyle:Code
6913 \begin_layout Plain Layout
6920 \begin_inset Quotes erd
6926 \begin_layout Description
6927 \begin_inset Flex CharStyle:Code
6930 \begin_layout Plain Layout
6936 Describes various global options supported by the document class.
6938 \begin_inset space ~
6942 \begin_inset CommandInset ref
6944 reference "sec:classoptions"
6950 \begin_inset Quotes eld
6954 \begin_inset Flex CharStyle:Code
6957 \begin_layout Plain Layout
6964 \begin_inset Quotes erd
6970 \begin_layout Description
6971 \begin_inset Flex CharStyle:Code
6974 \begin_layout Plain Layout
6981 \begin_inset Flex CharStyle:Code
6984 \begin_layout Plain Layout
6993 \begin_inset Flex CharStyle:Code
6996 \begin_layout Plain Layout
7002 ] Whether the class should default to having one or two columns.
7003 Can be changed in the
7004 \begin_inset Flex CharStyle:MenuItem
7007 \begin_layout Plain Layout
7008 Document\SpecialChar \menuseparator
7017 \begin_layout Description
7018 \begin_inset Flex CharStyle:Code
7021 \begin_layout Plain Layout
7027 This sequence defines a new counter.
7029 \begin_inset space ~
7033 \begin_inset CommandInset ref
7035 reference "sec:counter"
7041 \begin_inset Quotes eld
7045 \begin_inset Flex CharStyle:Code
7048 \begin_layout Plain Layout
7055 \begin_inset Quotes erd
7061 \begin_layout Description
7062 \begin_inset Flex CharStyle:Code
7065 \begin_layout Plain Layout
7071 Sets the default font used to display the document.
7073 \begin_inset space ~
7077 \begin_inset CommandInset ref
7079 reference "sec:fonts"
7083 for how to declare fonts.
7085 \begin_inset Quotes eld
7089 \begin_inset Flex CharStyle:Code
7092 \begin_layout Plain Layout
7099 \begin_inset Quotes erd
7105 \begin_layout Description
7106 \begin_inset Flex CharStyle:Code
7109 \begin_layout Plain Layout
7116 \begin_inset Flex CharStyle:Code
7119 \begin_layout Plain Layout
7125 Specifies a module to be included by default with this document class,
7126 which should be specified by filename without the
7127 \begin_inset Flex CharStyle:Code
7130 \begin_layout Plain Layout
7137 The user can still remove the module, but it will be active at the outset.
7138 (This applies only when new files are created, or when this class is chosen
7139 for an existing document.)
7142 \begin_layout Description
7143 \begin_inset Flex CharStyle:Code
7146 \begin_layout Plain Layout
7153 \begin_inset Flex CharStyle:Code
7156 \begin_layout Plain Layout
7162 ] This is the style that will be assigned to new paragraphs, usually
7163 \begin_inset Flex CharStyle:MenuItem
7166 \begin_layout Plain Layout
7173 This will default to the first defined style if not given, but you are
7174 highly encouraged to use this directive.
7177 \begin_layout Description
7178 \begin_inset Flex CharStyle:Code
7181 \begin_layout Plain Layout
7188 \begin_inset Flex CharStyle:Code
7191 \begin_layout Plain Layout
7197 ] Indicates that the module in question---which should be specified by filename
7199 \begin_inset Flex CharStyle:Code
7202 \begin_layout Plain Layout
7208 extension---cannot be used with this document class.
7209 This might be used in a journal-specific layout file to prevent, say, the
7211 \begin_inset Flex CharStyle:Code
7214 \begin_layout Plain Layout
7220 module that numbers theorems by section.
7225 be used in a module.
7226 Modules have their own way of excluding other modules (see
7227 \begin_inset CommandInset ref
7229 reference "sub:Layout-modules"
7236 \begin_layout Description
7237 \begin_inset Flex CharStyle:Code
7240 \begin_layout Plain Layout
7246 Defines a new float.
7248 \begin_inset space ~
7252 \begin_inset CommandInset ref
7254 reference "sec:floats"
7260 \begin_inset Quotes eld
7264 \begin_inset Flex CharStyle:Code
7267 \begin_layout Plain Layout
7274 \begin_inset Quotes erd
7280 \begin_layout Description
7281 \begin_inset Flex CharStyle:Code
7284 \begin_layout Plain Layout
7290 As its name implies, this command allows you to include another layout
7291 definition file within yours to avoid duplicating commands.
7292 Common examples are the standard layout files, for example,
7293 \begin_inset Flex CharStyle:Code
7296 \begin_layout Plain Layout
7302 , which contains most of the basic layouts.
7305 \begin_layout Description
7306 \begin_inset Flex CharStyle:Code
7309 \begin_layout Plain Layout
7315 This section (re-)defines the layout of an inset.
7316 It can be applied to an existing inset of to a new, user-defined inset,
7318 \begin_inset space \thinspace{}
7322 \begin_inset space \space{}
7325 a new character style.
7327 \begin_inset space ~
7331 \begin_inset CommandInset ref
7333 reference "sec:charstyle"
7337 for more information.
7339 \begin_inset Quotes eld
7343 \begin_inset Flex CharStyle:Code
7346 \begin_layout Plain Layout
7353 \begin_inset Quotes erd
7359 \begin_layout Description
7360 \begin_inset Flex CharStyle:Code
7363 \begin_layout Plain Layout
7369 A string that indicates the width of the left margin on the screen, for
7371 \begin_inset Quotes eld
7375 \begin_inset Quotes erd
7381 \begin_layout Description
7382 \begin_inset Flex CharStyle:Code
7385 \begin_layout Plain Layout
7391 This command deletes an existing float.
7392 This is particularly useful when you want to suppress a float that has
7393 be defined in an input file.
7396 \begin_layout Description
7397 \begin_inset Flex CharStyle:Code
7400 \begin_layout Plain Layout
7406 This command deletes an existing style.
7407 This is particularly useful when you want to suppress a style that has
7408 be defined in an input file.
7411 \begin_layout Description
7412 \begin_inset Flex CharStyle:Code
7415 \begin_layout Plain Layout
7421 A string indicating what sort of output documents using this class will
7423 At present, the options are: `docbook', `latex', and `literate'.
7426 \begin_layout Description
7427 \begin_inset Flex CharStyle:Code
7430 \begin_layout Plain Layout
7441 \begin_inset Flex CharStyle:Code
7444 \begin_layout Plain Layout
7455 \begin_inset Flex CharStyle:Code
7458 \begin_layout Plain Layout
7465 \begin_inset Flex CharStyle:Code
7468 \begin_layout Plain Layout
7474 ] The class default pagestyle.
7475 Can be changed in the
7476 \begin_inset Flex CharStyle:MenuItem
7479 \begin_layout Plain Layout
7480 Document\SpecialChar \menuseparator
7489 \begin_layout Description
7490 \begin_inset Flex CharStyle:Code
7493 \begin_layout Plain Layout
7499 Sets the preamble for the LaTeX document.
7500 Note that this will completely override any prior
7501 \begin_inset Flex CharStyle:Code
7504 \begin_layout Plain Layout
7511 \begin_inset Flex CharStyle:Code
7514 \begin_layout Plain Layout
7522 \begin_inset Quotes eld
7526 \begin_inset Flex CharStyle:Code
7529 \begin_layout Plain Layout
7536 \begin_inset Quotes erd
7542 \begin_layout Description
7543 \begin_inset Flex CharStyle:Code
7546 \begin_layout Plain Layout
7553 \begin_inset Flex CharStyle:Code
7556 \begin_layout Plain Layout
7563 \begin_inset Flex CharStyle:Code
7566 \begin_layout Plain Layout
7575 \begin_inset Flex CharStyle:Code
7578 \begin_layout Plain Layout
7584 ] Whether the class already provides the feature
7585 \begin_inset Flex CharStyle:Code
7588 \begin_layout Plain Layout
7595 A feature is in general the name of a package (
7596 \begin_inset Flex CharStyle:Code
7599 \begin_layout Plain Layout
7606 \begin_inset Flex CharStyle:Code
7609 \begin_layout Plain Layout
7615 , \SpecialChar \ldots{}
7617 \begin_inset Flex CharStyle:Code
7620 \begin_layout Plain Layout
7627 \begin_inset Flex CharStyle:Code
7630 \begin_layout Plain Layout
7636 ,\SpecialChar \ldots{}
7637 ); the complete list of supported features is unfortunately not documented
7638 outside the LyX source code---but see
7639 \begin_inset Flex CharStyle:Code
7642 \begin_layout Plain Layout
7648 if you're interested.
7650 \begin_inset Flex CharStyle:MenuItem
7653 \begin_layout Plain Layout
7658 elp\SpecialChar \menuseparator
7668 also gives an overview of the supported packages.
7671 \begin_layout Description
7672 \begin_inset Flex CharStyle:Code
7675 \begin_layout Plain Layout
7682 \begin_inset Flex CharStyle:Code
7685 \begin_layout Plain Layout
7691 ] Indicates that this layout provides the functionality of the module mentioned,
7692 which should be specified by filename, which should be specified by filename
7694 \begin_inset Flex CharStyle:Code
7697 \begin_layout Plain Layout
7704 This will typically be used if the layout includes the module directly,
7705 rather than using the
7706 \begin_inset Flex CharStyle:Code
7709 \begin_layout Plain Layout
7715 tag to indicate that it ought to be used.
7716 It could be used in a module that that provided an alternate implementation
7717 of the same functionality.
7720 \begin_layout Description
7721 \begin_inset Flex CharStyle:Code
7724 \begin_layout Plain Layout
7731 \begin_inset Flex CharStyle:Code
7734 \begin_layout Plain Layout
7740 ] Whether the class requires the feature
7741 \begin_inset Flex CharStyle:Code
7744 \begin_layout Plain Layout
7751 Multiple features must be separated by commas.
7752 Note that you can only request supported features.
7755 \begin_layout Description
7756 \begin_inset Flex CharStyle:Code
7759 \begin_layout Plain Layout
7765 A string that indicates the width of the right margin on the screen, for
7767 \begin_inset Quotes eld
7771 \begin_inset Quotes erd
7777 \begin_layout Description
7778 \begin_inset Flex CharStyle:Code
7781 \begin_layout Plain Layout
7787 Sets which divisions get numbered.
7789 \begin_inset Flex CharStyle:Code
7792 \begin_layout Plain Layout
7801 \begin_layout Description
7802 \begin_inset Flex CharStyle:Code
7805 \begin_layout Plain Layout
7814 \begin_inset Flex CharStyle:Code
7817 \begin_layout Plain Layout
7828 \begin_inset Flex CharStyle:Code
7831 \begin_layout Plain Layout
7837 ] Whether the class-default should be printing on one or both sides of the
7839 Can be changed in the
7840 \begin_inset Flex CharStyle:MenuItem
7843 \begin_layout Plain Layout
7844 Document\SpecialChar \menuseparator
7853 \begin_layout Description
7854 \begin_inset Flex CharStyle:Code
7857 \begin_layout Plain Layout
7863 This sequence defines a new paragraph style.
7864 If the style already exists, it will redefine some of its parameters instead.
7866 \begin_inset space ~
7870 \begin_inset CommandInset ref
7872 reference "sec:style"
7878 \begin_inset Quotes eld
7882 \begin_inset Flex CharStyle:Code
7885 \begin_layout Plain Layout
7892 \begin_inset Quotes erd
7898 \begin_layout Description
7899 \begin_inset Flex CharStyle:Code
7902 \begin_layout Plain Layout
7909 \begin_inset Flex CharStyle:Code
7912 \begin_layout Plain Layout
7918 ] The name of the command or environment to be used with
7919 \begin_inset Flex CharStyle:Code
7922 \begin_layout Plain Layout
7931 \begin_layout Description
7932 \begin_inset Flex CharStyle:Code
7935 \begin_layout Plain Layout
7942 \begin_inset Flex CharStyle:Code
7945 \begin_layout Plain Layout
7954 \begin_inset Flex CharStyle:Code
7957 \begin_layout Plain Layout
7963 ] Indicates what kind of markup is used to define the title of a document.
7965 \begin_inset Flex CharStyle:Code
7968 \begin_layout Plain Layout
7974 means that the macro with name
7975 \begin_inset Flex CharStyle:Code
7978 \begin_layout Plain Layout
7984 will be inserted after the last layout which has
7985 \begin_inset Quotes eld
7989 \begin_inset Flex CharStyle:Code
7992 \begin_layout Plain Layout
7999 \begin_inset Quotes erd
8004 \begin_inset Flex CharStyle:Code
8007 \begin_layout Plain Layout
8013 corresponds to the case where the block of paragraphs which have
8014 \begin_inset Quotes eld
8018 \begin_inset Flex CharStyle:Code
8021 \begin_layout Plain Layout
8028 \begin_inset Quotes erd
8031 should be enclosed into the
8032 \begin_inset Flex CharStyle:Code
8035 \begin_layout Plain Layout
8044 \begin_layout Description
8045 \begin_inset Flex CharStyle:Code
8048 \begin_layout Plain Layout
8054 Sets which divisions are included in the table of contents.
8056 \begin_inset Flex CharStyle:Code
8059 \begin_layout Plain Layout
8068 \begin_layout Subsection
8069 \begin_inset Flex CharStyle:Code
8072 \begin_layout Plain Layout
8081 \begin_layout Standard
8082 \begin_inset CommandInset label
8084 name "sec:classoptions"
8089 \begin_inset Flex CharStyle:Code
8092 \begin_layout Plain Layout
8098 section can contain the following entries:
8101 \begin_layout Description
8102 \begin_inset Flex CharStyle:Code
8105 \begin_layout Plain Layout
8112 \begin_inset Flex CharStyle:Code
8115 \begin_layout Plain Layout
8121 ] The list of available font sizes for the document's main font, separated
8123 \begin_inset Quotes eld
8127 \begin_inset Flex CharStyle:Code
8130 \begin_layout Plain Layout
8137 \begin_inset Quotes erd
8143 \begin_layout Description
8144 \begin_inset Flex CharStyle:Code
8147 \begin_layout Plain Layout
8153 Used to set the DTD line with XML-based output classes.
8155 \begin_inset space \thinspace{}
8159 \begin_inset Quotes eld
8162 -//OASIS//DTD DocBook V4.2//EN
8163 \begin_inset Quotes erd
8169 \begin_layout Description
8170 \begin_inset Flex CharStyle:Code
8173 \begin_layout Plain Layout
8180 \begin_inset Flex CharStyle:Code
8183 \begin_layout Plain Layout
8184 string="empty|plain|headings|fancy"
8189 ] The list of available page styles, separated by
8190 \begin_inset Quotes eld
8194 \begin_inset Flex CharStyle:Code
8197 \begin_layout Plain Layout
8204 \begin_inset Quotes erd
8210 \begin_layout Description
8211 \begin_inset Flex CharStyle:Code
8214 \begin_layout Plain Layout
8221 \begin_inset Flex CharStyle:Code
8224 \begin_layout Plain Layout
8230 ] Some document class options, separated by a comma, that will be added
8231 to the optional part of the
8232 \begin_inset Flex CharStyle:Code
8235 \begin_layout Plain Layout
8246 \begin_layout Standard
8248 \begin_inset Flex CharStyle:Code
8251 \begin_layout Plain Layout
8257 section must end with
8258 \begin_inset Quotes eld
8262 \begin_inset Flex CharStyle:Code
8265 \begin_layout Plain Layout
8272 \begin_inset Quotes erd
8278 \begin_layout Subsection
8282 \begin_layout Standard
8283 \begin_inset CommandInset label
8289 A paragraph style description looks like this:
8293 \begin_layout Plain Layout
8294 Note that this will either define a new layout or modify an existing one.
8302 \begin_layout LyX-Code
8309 \begin_layout LyX-Code
8313 \begin_layout LyX-Code
8317 \begin_layout Standard
8318 where the following commands are allowed:
8321 \begin_layout Description
8322 \begin_inset Flex CharStyle:Code
8325 \begin_layout Plain Layout
8332 \begin_inset Flex CharStyle:Code
8335 \begin_layout Plain Layout
8340 , left, right, center
8345 ] Paragraph alignment.
8348 \begin_layout Description
8349 \begin_inset Flex CharStyle:Code
8352 \begin_layout Plain Layout
8359 \begin_inset Flex CharStyle:Code
8362 \begin_layout Plain Layout
8367 , left, right, center
8372 ] A comma separated list of permitted alignments.
8373 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8375 For example a right-aligned or centered enumeration isn't possible.)
8378 \begin_layout Description
8379 \begin_inset Flex CharStyle:Code
8382 \begin_layout Plain Layout
8389 \begin_inset Flex CharStyle:Code
8392 \begin_layout Plain Layout
8402 \begin_layout Plain Layout
8403 Note that a `float' here is a real number, such as: 1.5.
8408 The vertical space with which the last of a chain of paragraphs with this
8409 layout is separated from the following paragraph.
8410 If the next paragraph has another layout, the separations are not simply
8411 added, but the maximum is taken.
8414 \begin_layout Description
8415 \begin_inset Flex CharStyle:Code
8418 \begin_layout Plain Layout
8425 \begin_inset Flex CharStyle:Code
8428 \begin_layout Plain Layout
8434 The category for this style.
8435 This is used to group related styles in the Layout combobox on the toolbar.
8436 Any string can be used, but you may want to use existing categories with
8441 \begin_layout Description
8442 \begin_inset Flex CharStyle:Code
8445 \begin_layout Plain Layout
8451 Depth of XML command.
8452 Used only with XML-type formats.
8455 \begin_layout Description
8456 \begin_inset Flex CharStyle:Code
8459 \begin_layout Plain Layout
8466 \begin_inset CommandInset label
8468 name "des:CopyStyle"
8473 \begin_inset Flex CharStyle:Code
8476 \begin_layout Plain Layout
8482 Copies all the features of an existing style into the current one.
8486 \begin_layout Description
8487 \begin_inset Flex CharStyle:Code
8490 \begin_layout Plain Layout
8496 The name of a style whose preamble should be output
8501 This allows to ensure some ordering of the preamble snippets when macros
8502 definitions depend on one another.
8506 \begin_layout Plain Layout
8507 Note that, besides that functionality, there is no way to ensure any ordering
8509 The ordering that you see in a given version of LyX may change without
8510 warning in later versions.
8518 \begin_layout Description
8519 \begin_inset Flex CharStyle:Code
8522 \begin_layout Plain Layout
8529 \begin_inset Flex CharStyle:Code
8532 \begin_layout Plain Layout
8537 , Box, Filled_Box, Static
8542 ] The type of label that stands at the end of the paragraph (or sequence
8544 \begin_inset Flex CharStyle:Code
8547 \begin_layout Plain Layout
8554 \begin_inset Flex CharStyle:Code
8557 \begin_layout Plain Layout
8564 \begin_inset Flex CharStyle:Code
8567 \begin_layout Plain Layout
8574 \begin_inset Flex CharStyle:Code
8577 \begin_layout Plain Layout
8585 \begin_inset Flex CharStyle:Code
8588 \begin_layout Plain Layout
8595 \begin_inset Quotes eld
8599 \begin_inset Quotes erd
8603 \begin_inset Flex CharStyle:Code
8606 \begin_layout Plain Layout
8613 \begin_inset Flex CharStyle:Code
8616 \begin_layout Plain Layout
8617 \begin_inset space ~
8626 \begin_inset space ~
8629 black) square suitable for end of proof markers,
8630 \begin_inset Flex CharStyle:Code
8633 \begin_layout Plain Layout
8639 is an explicit text string.
8642 \begin_layout Description
8643 \begin_inset Flex CharStyle:Code
8646 \begin_layout Plain Layout
8653 \begin_inset Flex CharStyle:Code
8656 \begin_layout Plain Layout
8662 ] The string used for a label with a
8663 \begin_inset Flex CharStyle:Code
8666 \begin_layout Plain Layout
8673 \begin_inset Flex CharStyle:Code
8676 \begin_layout Plain Layout
8686 \begin_layout Description
8687 \begin_inset Flex CharStyle:Code
8690 \begin_layout Plain Layout
8697 \begin_inset Flex CharStyle:Code
8700 \begin_layout Plain Layout
8711 \begin_inset Flex CharStyle:Code
8714 \begin_layout Plain Layout
8723 \begin_layout Description
8724 \begin_inset Flex CharStyle:Code
8727 \begin_layout Plain Layout
8734 \begin_inset Flex CharStyle:Code
8737 \begin_layout Plain Layout
8747 ] With this parameter the
8748 \begin_inset Flex CharStyle:MenuItem
8751 \begin_layout Plain Layout
8758 \begin_inset Quotes eld
8761 Vertical space above
8762 \begin_inset Quotes erd
8766 \begin_inset Flex CharStyle:MenuItem
8769 \begin_layout Plain Layout
8770 Edit\SpecialChar \menuseparator
8772 \begin_inset space ~
8780 dialog can be set when initializing a paragraph with this style.
8784 \begin_layout Plain Layout
8787 Note from Jean-Marc:
8789 I'm not sure that this setting has much use, and it should probably be
8790 removed in later versions.
8798 \begin_layout Description
8799 \begin_inset Flex CharStyle:Code
8802 \begin_layout Plain Layout
8808 The font used for both the text body
8814 \begin_inset space ~
8818 \begin_inset CommandInset ref
8820 reference "sec:fonts"
8825 Note that defining this font automatically defines the
8826 \begin_inset Flex CharStyle:Code
8829 \begin_layout Plain Layout
8836 So you should define this one first if you also want to define
8837 \begin_inset Flex CharStyle:Code
8840 \begin_layout Plain Layout
8849 \begin_layout Description
8850 \begin_inset Flex CharStyle:Code
8853 \begin_layout Plain Layout
8860 \begin_inset CommandInset label
8862 name "des:FreeSpacing"
8869 \begin_inset Flex CharStyle:Code
8872 \begin_layout Plain Layout
8883 \begin_inset Flex CharStyle:Code
8886 \begin_layout Plain Layout
8892 ] Usually LyX doesn't allow you to insert more than one space between words,
8893 since a space is considered as the separation between two words, not a
8894 character or symbol of its own.
8895 This is a very fine thing but sometimes annoying, for example, when typing
8896 program code or plain LaTeX code.
8898 \begin_inset Flex CharStyle:Code
8901 \begin_layout Plain Layout
8908 Note that LyX will create protected blanks for the additional blanks when
8909 in another mode than LaTeX-mode.
8912 \begin_layout Description
8913 \begin_inset Flex CharStyle:Code
8916 \begin_layout Plain Layout
8922 [[FIXME]] (Used only with XML-type formats.)
8925 \begin_layout Description
8926 \begin_inset Flex CharStyle:Code
8929 \begin_layout Plain Layout
8936 \begin_inset Flex CharStyle:Code
8939 \begin_layout Plain Layout
8945 If 1, marks the layout as being part of a title block (see also the
8946 \begin_inset Flex CharStyle:Code
8949 \begin_layout Plain Layout
8956 \begin_inset Flex CharStyle:Code
8959 \begin_layout Plain Layout
8968 \begin_layout Description
8969 \begin_inset Flex CharStyle:Code
8972 \begin_layout Plain Layout
8979 \begin_inset Flex CharStyle:Code
8982 \begin_layout Plain Layout
8988 ] This provides extra space between paragraphs that have the same layout.
8989 If you put other layouts into an environment, each is separated with the
8991 \begin_inset Flex CharStyle:Code
8994 \begin_layout Plain Layout
9001 But the whole items of the environment are additionally separated with
9003 \begin_inset Flex CharStyle:Code
9006 \begin_layout Plain Layout
9018 \begin_layout Description
9019 \begin_inset Flex CharStyle:Code
9022 \begin_layout Plain Layout
9028 [[FIXME]] (Used only with XML-type formats.)
9031 \begin_layout Description
9032 \begin_inset Flex CharStyle:Code
9035 \begin_layout Plain Layout
9042 \begin_inset CommandInset label
9044 name "des:KeepEmpty"
9051 \begin_inset Flex CharStyle:Code
9054 \begin_layout Plain Layout
9065 \begin_inset Flex CharStyle:Code
9068 \begin_layout Plain Layout
9074 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9075 lead to empty LaTeX output.
9076 There are some cases where this could be desirable however: in a letter
9077 template, the required fields can be provided as empty fields, so that
9078 people do not forget them; in some special classes, a layout can be used
9079 as some kind of break, which does not contain actual text.
9082 \begin_layout Description
9083 \begin_inset Flex CharStyle:Code
9086 \begin_layout Plain Layout
9092 [float=0] The vertical space between the label and the text body.
9093 Only used for labels that are above the text body (
9094 \begin_inset Flex CharStyle:Code
9097 \begin_layout Plain Layout
9104 \begin_inset Flex CharStyle:Code
9107 \begin_layout Plain Layout
9108 Centered_Top_Environment
9116 \begin_layout Description
9117 \begin_inset Flex CharStyle:Code
9120 \begin_layout Plain Layout
9127 \begin_inset Flex CharStyle:Code
9130 \begin_layout Plain Layout
9137 \begin_inset Newline newline
9140 The name of the counter for automatic numbering (see Section
9141 \begin_inset CommandInset ref
9143 reference "sec:counter"
9148 This must be given if
9149 \begin_inset Flex CharStyle:Code
9152 \begin_layout Plain Layout
9159 \begin_inset Flex CharStyle:Code
9162 \begin_layout Plain Layout
9171 \begin_layout Description
9172 \begin_inset Flex CharStyle:Code
9175 \begin_layout Plain Layout
9181 The font used for the label.
9183 \begin_inset space ~
9187 \begin_inset CommandInset ref
9189 reference "sec:fonts"
9196 \begin_layout Description
9197 \begin_inset Flex CharStyle:Code
9200 \begin_layout Plain Layout
9206 Text that indicates how far a label should be indented.
9209 \begin_layout Description
9210 \begin_inset Flex CharStyle:Code
9213 \begin_layout Plain Layout
9220 \begin_inset Flex CharStyle:Code
9223 \begin_layout Plain Layout
9229 ] The horizontal space between the label and the text body.
9230 Only used for labels that are not above the text body.
9233 \begin_layout Description
9234 \begin_inset Flex CharStyle:Code
9237 \begin_layout Plain Layout
9244 \begin_inset Flex CharStyle:Code
9247 \begin_layout Plain Layout
9253 ] The string used for a label with a
9254 \begin_inset Flex CharStyle:Code
9257 \begin_layout Plain Layout
9265 \begin_inset Flex CharStyle:Code
9268 \begin_layout Plain Layout
9274 is set, this string can be contain the special formatting commands described
9276 \begin_inset CommandInset ref
9278 reference "sec:counter"
9286 \begin_layout Plain Layout
9287 For the sake of backwards compatibility, the string
9288 \begin_inset Flex CharStyle:Code
9291 \begin_layout Plain Layout
9301 will be replaced by the expanded
9302 \begin_inset Flex CharStyle:Code
9305 \begin_layout Plain Layout
9312 \begin_inset Flex CharStyle:Code
9315 \begin_layout Plain Layout
9324 This feature is now obsolete and should be replaced by the mechanisms of
9326 \begin_inset CommandInset ref
9328 reference "sec:counter"
9340 \begin_layout Description
9341 \begin_inset Flex CharStyle:Code
9344 \begin_layout Plain Layout
9351 \begin_inset Flex CharStyle:Code
9354 \begin_layout Plain Layout
9360 ] This is used inside the appendix instead of
9361 \begin_inset Flex CharStyle:Code
9364 \begin_layout Plain Layout
9372 \begin_inset Flex CharStyle:Code
9375 \begin_layout Plain Layout
9382 \begin_inset Flex CharStyle:Code
9385 \begin_layout Plain Layout
9394 \begin_layout Description
9395 \begin_inset Flex CharStyle:Code
9398 \begin_layout Plain Layout
9404 [FIXME] (Used only with XML-type formats.)
9407 \begin_layout Description
9408 \begin_inset Flex CharStyle:Code
9411 \begin_layout Plain Layout
9418 \begin_inset Flex CharStyle:Code
9421 \begin_layout Plain Layout
9426 , Manual, Static, Top_Environment,
9427 \begin_inset Newline newline
9430 Centered_Top_Environment, Sensitive, Counter
9436 \begin_inset Newline newline
9440 \begin_inset Flex CharStyle:Code
9443 \begin_layout Plain Layout
9449 means the label is the very first word (up to the first real blank).
9453 \begin_layout Plain Layout
9454 Use protected spaces if you want more than one word as the label.
9460 \begin_inset Flex CharStyle:Code
9463 \begin_layout Plain Layout
9469 means it is defined in the layout (see
9470 \begin_inset Flex CharStyle:Code
9473 \begin_layout Plain Layout
9481 \begin_inset Flex CharStyle:Code
9484 \begin_layout Plain Layout
9491 \begin_inset Flex CharStyle:Code
9494 \begin_layout Plain Layout
9495 Centered_Top_Environment
9500 are special cases of
9501 \begin_inset Flex CharStyle:Code
9504 \begin_layout Plain Layout
9511 The label will be printed above the paragraph, but only at the top of an
9512 environment or the top of a chain of paragraphs with this layout.
9513 Usage is for example the
9514 \begin_inset Flex CharStyle:MenuItem
9517 \begin_layout Plain Layout
9524 \begin_inset Flex CharStyle:MenuItem
9527 \begin_layout Plain Layout
9534 This is also the case for
9535 \begin_inset Flex CharStyle:Code
9538 \begin_layout Plain Layout
9544 labels with latex type
9545 \begin_inset Flex CharStyle:Code
9548 \begin_layout Plain Layout
9554 , in order to make layouts for theorems work correctly.
9556 \begin_inset Flex CharStyle:Code
9559 \begin_layout Plain Layout
9565 is a special case for the caption-labels
9566 \begin_inset Quotes eld
9570 \begin_inset Quotes erd
9574 \begin_inset Quotes eld
9578 \begin_inset Quotes erd
9583 \begin_inset Flex CharStyle:Code
9586 \begin_layout Plain Layout
9592 means the (hardcoded) label string depends on the kind of float.
9594 \begin_inset Flex CharStyle:Code
9597 \begin_layout Plain Layout
9603 label type defines automatically numbered labels.
9605 \begin_inset CommandInset ref
9607 reference "sec:counter"
9614 \begin_layout Description
9615 \begin_inset Flex CharStyle:Code
9618 \begin_layout Plain Layout
9624 The name of the corresponding LaTeX stuff.
9625 Either the environment or command name.
9628 \begin_layout Description
9629 \begin_inset Flex CharStyle:Code
9632 \begin_layout Plain Layout
9638 An optional parameter for the corresponding
9639 \begin_inset Flex CharStyle:Code
9642 \begin_layout Plain Layout
9649 This parameter cannot be changed from within LyX.
9652 \begin_layout Description
9653 \begin_inset Flex CharStyle:Code
9656 \begin_layout Plain Layout
9663 \begin_inset CommandInset label
9665 name "des:LatexType"
9670 \begin_inset Flex CharStyle:Code
9673 \begin_layout Plain Layout
9678 , Command, Environment, Item_Environment,
9684 \begin_inset Flex CharStyle:Code
9687 \begin_layout Plain Layout
9693 ] How the layout should be translated into LaTeX.
9695 \begin_inset Flex CharStyle:Code
9698 \begin_layout Plain Layout
9704 means nothing special.
9706 \begin_inset Flex CharStyle:Code
9709 \begin_layout Plain Layout
9716 \begin_inset Flex CharStyle:Code
9719 \begin_layout Plain Layout
9726 {\SpecialChar \ldots{}
9733 \begin_inset Flex CharStyle:Code
9736 \begin_layout Plain Layout
9743 \begin_inset Flex CharStyle:Code
9746 \begin_layout Plain Layout
9753 }\SpecialChar \ldots{}
9767 \begin_inset Flex CharStyle:Code
9770 \begin_layout Plain Layout
9777 \begin_inset Flex CharStyle:Code
9780 \begin_layout Plain Layout
9787 \begin_inset Flex CharStyle:Code
9790 \begin_layout Plain Layout
9798 is generated for each paragraph of this environment.
9800 \begin_inset Flex CharStyle:Code
9803 \begin_layout Plain Layout
9810 \begin_inset Flex CharStyle:Code
9813 \begin_layout Plain Layout
9820 \begin_inset Flex CharStyle:Code
9823 \begin_layout Plain Layout
9829 is passed as an argument to the environment.
9831 \begin_inset Flex CharStyle:Code
9834 \begin_layout Plain Layout
9840 can be defined in the
9841 \begin_inset Flex CharStyle:MenuItem
9844 \begin_layout Plain Layout
9849 ayout\SpecialChar \menuseparator
9861 \begin_inset Flex CharStyle:Code
9864 \begin_layout Plain Layout
9872 is perhaps a bit misleading, since these rules apply to SGML classes, too.
9873 Visit the SGML class files for specific examples.
9876 \begin_layout Standard
9877 Putting the last few things together, the LaTeX output will be either:
9880 \begin_layout LyX-Code
9883 latexname[latexparam]{\SpecialChar \ldots{}
9887 \begin_layout Standard
9891 \begin_layout LyX-Code
9894 begin{latexname}[latexparam] \SpecialChar \ldots{}
9900 \begin_layout Standard
9901 depending upon the LaTex type.
9904 \begin_layout Description
9905 \begin_inset Flex CharStyle:Code
9908 \begin_layout Plain Layout
9915 \begin_inset Flex CharStyle:Code
9918 \begin_layout Plain Layout
9924 ] If you put layouts into environments, the leftmargins are not simply added,
9925 but added with a factor
9926 \begin_inset Formula $\frac{4}{depth+4}$
9930 Note that this parameter is also used when the margin is defined as
9931 \begin_inset Flex CharStyle:Code
9934 \begin_layout Plain Layout
9941 \begin_inset Flex CharStyle:Code
9944 \begin_layout Plain Layout
9951 Then it is added to the manual or dynamic margin.
9953 \begin_inset Newline newline
9956 The argument is passed as a string.
9958 \begin_inset Quotes eld
9962 \begin_inset Flex CharStyle:Code
9965 \begin_layout Plain Layout
9972 \begin_inset Quotes erd
9975 means that the paragraph is indented with the width of
9976 \begin_inset Quotes eld
9980 \begin_inset Flex CharStyle:Code
9983 \begin_layout Plain Layout
9990 \begin_inset Quotes erd
9994 You can get a negative width by prefixing the string with
9995 \begin_inset Quotes eld
9999 \begin_inset Flex CharStyle:Code
10002 \begin_layout Plain Layout
10009 \begin_inset Quotes erd
10013 This way was chosen so that the look is the same with each used screen
10018 \begin_layout Description
10019 \begin_inset Flex CharStyle:Code
10022 \begin_layout Plain Layout
10029 \begin_inset Flex CharStyle:Code
10032 \begin_layout Plain Layout
10037 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10043 \begin_inset Newline newline
10046 The kind of margin that the layout has on the left side.
10048 \begin_inset Flex CharStyle:Code
10051 \begin_layout Plain Layout
10057 just means a fixed margin.
10059 \begin_inset Flex CharStyle:Code
10062 \begin_layout Plain Layout
10068 means that the left margin depends on the string entered in the
10069 \begin_inset Flex CharStyle:MenuItem
10072 \begin_layout Plain Layout
10073 Edit\SpecialChar \menuseparator
10075 \begin_inset space ~
10084 This is used to typeset nice lists without tabulators.
10086 \begin_inset Flex CharStyle:Code
10089 \begin_layout Plain Layout
10095 means that the margin depends on the size of the label.
10096 This is used for automatic enumerated headlines.
10097 It is obvious that the headline
10098 \begin_inset Quotes eld
10101 5.4.3.2.1 Very long headline
10102 \begin_inset Quotes erd
10105 must have a wider left margin (as wide as
10106 \begin_inset Quotes eld
10110 \begin_inset Quotes erd
10113 plus the space) than
10114 \begin_inset Quotes eld
10117 3.2 Very long headline
10118 \begin_inset Quotes erd
10122 \begin_inset Quotes eld
10126 \begin_inset Quotes erd
10129 are not able to do this.
10131 \begin_inset Flex CharStyle:Code
10134 \begin_layout Plain Layout
10140 is similar, but only the very first row of the paragraph is dynamic, while
10141 the others are static; this is used, for example, for descriptions.
10143 \begin_inset Flex CharStyle:Code
10146 \begin_layout Plain Layout
10152 means the margin is chosen in a way that the longest row of this paragraph
10153 fits to the right margin.
10154 This is used to typeset an address on the right edge of the page.
10157 \begin_layout Description
10158 \begin_inset Flex CharStyle:Code
10161 \begin_layout Plain Layout
10168 \begin_inset Flex CharStyle:Code
10171 \begin_layout Plain Layout
10180 \begin_inset Flex CharStyle:Code
10183 \begin_layout Plain Layout
10189 ] Whether fragile commands in this layout should be
10190 \begin_inset Flex CharStyle:Code
10193 \begin_layout Plain Layout
10206 whether this command should itself be protected.)
10209 \begin_layout Description
10210 \begin_inset Flex CharStyle:Code
10213 \begin_layout Plain Layout
10220 \begin_inset Flex CharStyle:Code
10223 \begin_layout Plain Layout
10230 \begin_inset Flex CharStyle:Code
10233 \begin_layout Plain Layout
10241 ] Whether newlines are translated into LaTeX newlines (
10242 \begin_inset Flex CharStyle:Code
10245 \begin_layout Plain Layout
10256 The translation can be switched off to allow more comfortable LaTeX editing
10260 \begin_layout Description
10261 \begin_inset Flex CharStyle:Code
10264 \begin_layout Plain Layout
10271 \begin_inset Flex CharStyle:Code
10274 \begin_layout Plain Layout
10281 \begin_inset Flex CharStyle:Code
10284 \begin_layout Plain Layout
10292 ] Whether the following Paragraph is allowed to indent its very first row.
10294 \begin_inset Flex CharStyle:Code
10297 \begin_layout Plain Layout
10303 means that it is not allowed to do so;
10304 \begin_inset Flex CharStyle:Code
10307 \begin_layout Plain Layout
10313 means it could do so if it wants to.
10316 \begin_layout Description
10317 \begin_inset Flex CharStyle:Code
10320 \begin_layout Plain Layout
10326 Name of a layout that has replaced this layout.
10327 This is used to rename a layout, while keeping backward compatibility.
10330 \begin_layout Description
10331 \begin_inset Flex CharStyle:Code
10334 \begin_layout Plain Layout
10341 \begin_inset Flex CharStyle:Code
10344 \begin_layout Plain Layout
10350 ] The number of optional arguments that can be used with this layout.
10351 This is useful for things like section headings, and only makes sense with
10355 \begin_layout Description
10356 \begin_inset Flex CharStyle:Code
10359 \begin_layout Plain Layout
10366 \begin_inset Flex CharStyle:Code
10369 \begin_layout Plain Layout
10375 ] The indent of the very first line of a paragraph.
10377 \begin_inset Flex CharStyle:Code
10380 \begin_layout Plain Layout
10386 will be fixed for a certain layout.
10387 The exception is Standard layout, since the indentation of a Standard layout
10388 paragraph can be prohibited with
10389 \begin_inset Flex CharStyle:Code
10392 \begin_layout Plain Layout
10399 Also, Standard layout paragraphs inside environments use the
10400 \begin_inset Flex CharStyle:Code
10403 \begin_layout Plain Layout
10409 of the environment, not their native one.
10410 For example, Standard paragraphs inside an enumeration are not indented.
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 ] The vertical space between two paragraphs of this layout.
10436 \begin_layout Description
10437 \begin_inset Flex CharStyle:Code
10440 \begin_layout Plain Layout
10447 \begin_inset Flex CharStyle:Code
10450 \begin_layout Plain Layout
10456 ] LyX allows the user to choose either
10457 \begin_inset Quotes eld
10461 \begin_inset Quotes erd
10465 \begin_inset Quotes eld
10469 \begin_inset Quotes erd
10472 to typeset a document.
10474 \begin_inset Quotes eld
10478 \begin_inset Quotes erd
10481 is chosen, this value is completely ignored.
10483 \begin_inset Quotes eld
10487 \begin_inset Quotes erd
10490 is chosen, the parindent of a LaTeXtype
10491 \begin_inset Quotes eld
10495 \begin_inset Quotes erd
10498 layout is ignored and all paragraphs are separated by this parskip argument.
10499 The vertical space is calculated with
10500 \begin_inset Flex CharStyle:Code
10503 \begin_layout Plain Layout
10505 \begin_inset space ~
10514 \begin_inset Flex CharStyle:Code
10517 \begin_layout Plain Layout
10523 is the height of a row with the normal font.
10524 This way, the look stays the same with different screen fonts.
10527 \begin_layout Description
10528 \begin_inset Flex CharStyle:Code
10531 \begin_layout Plain Layout
10538 \begin_inset CommandInset label
10540 name "des:PathThru"
10547 \begin_inset Flex CharStyle:Code
10550 \begin_layout Plain Layout
10561 \begin_inset Flex CharStyle:Code
10564 \begin_layout Plain Layout
10570 ] Whether the contents of this paragraph should be output in raw form, meaning
10571 without special translations that LaTeX would require.
10574 \begin_layout Description
10575 \begin_inset Flex CharStyle:Code
10578 \begin_layout Plain Layout
10585 \begin_inset CommandInset label
10587 name "des:Preamble"
10591 Information to be included in the LaTeX preamable when this style is used.
10592 Used to define macros, load packages, etc., required by this particular
10595 \begin_inset Quotes eld
10599 \begin_inset Flex CharStyle:Code
10602 \begin_layout Plain Layout
10609 \begin_inset Quotes erd
10615 \begin_layout Description
10616 \begin_inset Flex CharStyle:Code
10619 \begin_layout Plain Layout
10626 \begin_inset Flex CharStyle:Code
10629 \begin_layout Plain Layout
10636 \begin_inset CommandInset label
10638 name "des:Requires"
10642 Whether the layout requires the feature
10643 \begin_inset Flex CharStyle:Code
10646 \begin_layout Plain Layout
10653 See the description of
10654 \begin_inset Flex CharStyle:Code
10657 \begin_layout Plain Layout
10664 \begin_inset CommandInset ref
10665 LatexCommand pageref
10666 reference "des:FreeSpacing"
10670 ) for information on `features'.
10674 \begin_layout Description
10675 \begin_inset Flex CharStyle:Code
10678 \begin_layout Plain Layout
10685 \begin_inset Flex CharStyle:Code
10688 \begin_layout Plain Layout
10695 \begin_inset Flex CharStyle:Code
10698 \begin_layout Plain Layout
10707 \begin_layout Description
10708 \begin_inset Flex CharStyle:Code
10711 \begin_layout Plain Layout
10718 \begin_inset Flex CharStyle:Code
10721 \begin_layout Plain Layout
10726 , onehalf, double, other
10735 ] This defines what the default spacing should be in the layout.
10737 \begin_inset Flex CharStyle:Code
10740 \begin_layout Plain Layout
10747 \begin_inset Flex CharStyle:Code
10750 \begin_layout Plain Layout
10757 \begin_inset Flex CharStyle:Code
10760 \begin_layout Plain Layout
10766 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
10767 If you specify the argument
10768 \begin_inset Flex CharStyle:Code
10771 \begin_layout Plain Layout
10777 , then you should also provide a numerical argument which will be the actual
10779 Note that, contrary to other parameters,
10780 \begin_inset Flex CharStyle:Code
10783 \begin_layout Plain Layout
10789 implies the generation of specific LaTeX code, using the package
10792 \begin_inset Flex CharStyle:Code
10795 \begin_layout Plain Layout
10804 \begin_layout Description
10805 \begin_inset Flex CharStyle:Code
10808 \begin_layout Plain Layout
10814 The font used for the text body .
10816 \begin_inset CommandInset ref
10818 reference "sec:fonts"
10825 \begin_layout Description
10826 \begin_inset Flex CharStyle:Code
10829 \begin_layout Plain Layout
10837 The level of the style in the table of contents.
10838 This is used for automatic numbering of section headings.
10841 \begin_layout Description
10842 \begin_inset Flex CharStyle:Code
10845 \begin_layout Plain Layout
10852 \begin_inset Flex CharStyle:Code
10855 \begin_layout Plain Layout
10861 ] The vertical space with which the very first of a chain of paragraphs
10862 with this layout is separated from the previous paragraph.
10863 If the previous paragraph has another layout, the separations are not simply
10864 added, but the maximum is taken.
10867 \begin_layout Subsection
10871 \begin_layout Standard
10872 \begin_inset CommandInset label
10878 Since version 1.3.0 of LyX, it is has been both possible and necessary to
10879 define the floats (
10880 \begin_inset Flex CharStyle:MenuItem
10883 \begin_layout Plain Layout
10890 \begin_inset Flex CharStyle:MenuItem
10893 \begin_layout Plain Layout
10899 , \SpecialChar \ldots{}
10900 ) in the text class itself.
10901 Standard floats are included in the file
10902 \begin_inset Flex CharStyle:Code
10905 \begin_layout Plain Layout
10911 , so you may have to do no more than add
10914 \begin_layout LyX-Code
10915 Input stdfloats.inc
10918 \begin_layout Standard
10919 to your layout file.
10920 If you want to implement a text class that proposes some other float types
10921 (like the AGU class bundled with LyX), the information below will hopefully
10925 \begin_layout Description
10926 \begin_inset Flex CharStyle:Code
10929 \begin_layout Plain Layout
10936 \begin_inset Flex CharStyle:Code
10939 \begin_layout Plain Layout
10946 \begin_inset Quotes erd
10950 \begin_inset Quotes erd
10953 ] The file name extension of an auxiliary file for the list of figures (or
10955 LaTeX writes the captions to this file.
10958 \begin_layout Description
10959 \begin_inset Flex CharStyle:Code
10962 \begin_layout Plain Layout
10969 \begin_inset Flex CharStyle:Code
10972 \begin_layout Plain Layout
10979 \begin_inset Quotes erd
10983 \begin_inset Quotes erd
10986 ] The string that will be used in the menus and also for the caption.
10989 \begin_layout Description
10990 \begin_inset Flex CharStyle:Code
10993 \begin_layout Plain Layout
11000 \begin_inset Flex CharStyle:Code
11003 \begin_layout Plain Layout
11012 \begin_inset Flex CharStyle:Code
11015 \begin_layout Plain Layout
11022 \begin_inset Flex CharStyle:Code
11025 \begin_layout Plain Layout
11031 if the float is already defined by the LaTeX document class.
11033 \begin_inset Flex CharStyle:Code
11036 \begin_layout Plain Layout
11042 , the float will be defined using the LaTeX package
11043 \begin_inset Flex CharStyle:Code
11046 \begin_layout Plain Layout
11055 \begin_layout Description
11056 \begin_inset Flex CharStyle:Code
11059 \begin_layout Plain Layout
11066 \begin_inset Flex CharStyle:Code
11069 \begin_layout Plain Layout
11076 \begin_inset Quotes erd
11080 \begin_inset Quotes erd
11083 ] The heading used for the list of floats.
11086 \begin_layout Description
11087 \begin_inset Flex CharStyle:Code
11090 \begin_layout Plain Layout
11097 \begin_inset Flex CharStyle:Code
11100 \begin_layout Plain Layout
11107 \begin_inset Quotes erd
11111 \begin_inset Quotes erd
11114 ] This (optional) argument determines whether floats of this class will
11115 be numbered within some sectional unit of the document.
11116 For example, if within is equal to
11117 \begin_inset Flex CharStyle:Code
11120 \begin_layout Plain Layout
11126 , the floats will be numbered within chapters.
11130 \begin_layout Description
11131 \begin_inset Flex CharStyle:Code
11134 \begin_layout Plain Layout
11141 \begin_inset Flex CharStyle:Code
11144 \begin_layout Plain Layout
11151 \begin_inset Quotes erd
11155 \begin_inset Quotes erd
11158 ] The default placement for the given class of floats.
11159 The string should be as in standard LaTeX:
11160 \begin_inset Flex CharStyle:Code
11163 \begin_layout Plain Layout
11170 \begin_inset Flex CharStyle:Code
11173 \begin_layout Plain Layout
11180 \begin_inset Flex CharStyle:Code
11183 \begin_layout Plain Layout
11190 \begin_inset Flex CharStyle:Code
11193 \begin_layout Plain Layout
11199 for top, bottom, page, and here, respectively.
11203 \begin_layout Plain Layout
11204 Note that the order of these letters in the string is irrelevant, like in
11210 On top of that there is a new type,
11211 \begin_inset Flex CharStyle:Code
11214 \begin_layout Plain Layout
11220 , which does not really correspond to a float, since it means: put it
11221 \begin_inset Quotes eld
11225 \begin_inset Quotes erd
11229 Note however that the
11230 \begin_inset Flex CharStyle:Code
11233 \begin_layout Plain Layout
11239 specifier is special and, because of implementation details, cannot be
11240 used in non-builtin float types.
11241 If you do not understand what this means, just use
11242 \begin_inset Quotes eld
11246 \begin_inset Flex CharStyle:Code
11249 \begin_layout Plain Layout
11256 \begin_inset Quotes erd
11262 \begin_layout Description
11263 \begin_inset Flex CharStyle:Code
11266 \begin_layout Plain Layout
11273 \begin_inset Flex CharStyle:Code
11276 \begin_layout Plain Layout
11283 \begin_inset Quotes erd
11287 \begin_inset Quotes erd
11290 ] The style used when defining the float using
11291 \begin_inset Flex CharStyle:Code
11294 \begin_layout Plain Layout
11305 \begin_layout Description
11306 \begin_inset Flex CharStyle:Code
11309 \begin_layout Plain Layout
11316 \begin_inset Flex CharStyle:Code
11319 \begin_layout Plain Layout
11326 \begin_inset Quotes erd
11330 \begin_inset Quotes erd
11334 \begin_inset Quotes eld
11338 \begin_inset Quotes erd
11341 of the new class of floats, like program or algorithm.
11342 After the appropriate
11343 \begin_inset Flex CharStyle:Code
11346 \begin_layout Plain Layout
11355 \begin_inset Flex CharStyle:Code
11358 \begin_layout Plain Layout
11367 \begin_inset Flex CharStyle:Code
11370 \begin_layout Plain Layout
11381 \begin_layout Standard
11382 Note that defining a float with type
11383 \begin_inset Flex CharStyle:Code
11386 \begin_layout Plain Layout
11394 automatically defines the corresponding counter with name
11395 \begin_inset Flex CharStyle:Code
11398 \begin_layout Plain Layout
11409 \begin_layout Subsection
11410 Flex insets and InsetLayout
11413 \begin_layout Standard
11414 \begin_inset CommandInset label
11416 name "sec:charstyle"
11420 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11421 these are called Flex insets.
11425 \begin_layout Standard
11426 Flex insets come in three different kinds:
11429 \begin_layout Itemize
11431 \begin_inset Flex CharStyle:Code
11434 \begin_layout Plain Layout
11440 ): These define semantic markup corresponding to such LaTeX commands as
11442 \begin_inset Flex CharStyle:Code
11445 \begin_layout Plain Layout
11454 \begin_inset Flex CharStyle:Code
11457 \begin_layout Plain Layout
11468 \begin_layout Itemize
11470 \begin_inset Flex CharStyle:Code
11473 \begin_layout Plain Layout
11479 ): These can be used to define custom collapsable insets, similar to ERT,
11480 footnote, and the like.
11481 An obvious example is an endnote inset, which is defined in the
11482 \begin_inset Flex CharStyle:Code
11485 \begin_layout Plain Layout
11494 \begin_layout Itemize
11496 \begin_inset Flex CharStyle:Code
11499 \begin_layout Plain Layout
11505 ): For use with DocBook classes.
11508 \begin_layout Standard
11509 Flex insets are defined using the
11510 \begin_inset Flex CharStyle:Code
11513 \begin_layout Plain Layout
11519 tag, which shall be explained in a moment.
11522 \begin_layout Standard
11524 \begin_inset Flex CharStyle:Code
11527 \begin_layout Plain Layout
11533 tag also serves another function: It can be used to customize the general
11534 layout of many different types of insets.
11536 \begin_inset Flex CharStyle:Code
11539 \begin_layout Plain Layout
11545 can be used to customize the layout parameters for footnotes, marginal
11546 notes, note insets, ERT insets, branches, listings, indexes, boxes, tables,
11547 algorithms, URLs, and optional arguments, as well as to define Flex insets.
11550 \begin_layout Standard
11552 \begin_inset Flex CharStyle:Code
11555 \begin_layout Plain Layout
11561 definition must begin with a line of the form:
11564 \begin_layout LyX-Code
11568 \begin_layout Standard
11570 \begin_inset Flex CharStyle:Code
11573 \begin_layout Plain Layout
11579 indicates the inset whose layout is being defined, and here there are two
11583 \begin_layout Enumerate
11584 The layout for a pre-existing inset is being modified.
11585 In this case, can be
11586 \begin_inset Flex CharStyle:Code
11589 \begin_layout Plain Layout
11595 any one of the following:
11596 \begin_inset Flex CharStyle:Code
11599 \begin_layout Plain Layout
11606 \begin_inset Flex CharStyle:Code
11609 \begin_layout Plain Layout
11616 \begin_inset Flex CharStyle:Code
11619 \begin_layout Plain Layout
11626 \begin_inset Flex CharStyle:Code
11629 \begin_layout Plain Layout
11636 \begin_inset Flex CharStyle:Code
11639 \begin_layout Plain Layout
11646 \begin_inset Flex CharStyle:Code
11649 \begin_layout Plain Layout
11656 \begin_inset Flex CharStyle:Code
11659 \begin_layout Plain Layout
11666 \begin_inset Flex CharStyle:Code
11669 \begin_layout Plain Layout
11676 \begin_inset Flex CharStyle:Code
11679 \begin_layout Plain Layout
11686 \begin_inset Flex CharStyle:Code
11689 \begin_layout Plain Layout
11696 \begin_inset Flex CharStyle:Code
11699 \begin_layout Plain Layout
11706 \begin_inset Flex CharStyle:Code
11709 \begin_layout Plain Layout
11716 \begin_inset Flex CharStyle:Code
11719 \begin_layout Plain Layout
11726 \begin_inset Flex CharStyle:Code
11729 \begin_layout Plain Layout
11736 \begin_inset Flex CharStyle:Code
11739 \begin_layout Plain Layout
11746 \begin_inset Flex CharStyle:Code
11749 \begin_layout Plain Layout
11756 \begin_inset Flex CharStyle:Code
11759 \begin_layout Plain Layout
11766 \begin_inset Flex CharStyle:Code
11769 \begin_layout Plain Layout
11776 \begin_inset Flex CharStyle:Code
11779 \begin_layout Plain Layout
11786 \begin_inset Flex CharStyle:Code
11789 \begin_layout Plain Layout
11799 \begin_layout Enumerate
11800 The layout for a Flex inset is being defined.
11802 \begin_inset Flex CharStyle:Code
11805 \begin_layout Plain Layout
11811 can be any valid identifier not used by a pre-existing inset.
11812 Note that the definition of a flex inset must
11817 \begin_inset Flex CharStyle:Code
11820 \begin_layout Plain Layout
11829 \begin_layout Standard
11831 \begin_inset Flex CharStyle:Code
11834 \begin_layout Plain Layout
11840 definition can contain the following entries:
11843 \begin_layout Description
11844 \begin_inset Flex CharStyle:Code
11847 \begin_layout Plain Layout
11853 The color for the inset's background.
11854 The valid colors are defined in
11855 \begin_inset Flex CharStyle:Code
11858 \begin_layout Plain Layout
11867 \begin_layout Description
11868 \begin_inset Flex CharStyle:Code
11871 \begin_layout Plain Layout
11877 As with paragraph styles (see page
11878 \begin_inset CommandInset ref
11880 reference "des:CopyStyle"
11887 \begin_layout Description
11888 \begin_inset Flex CharStyle:Code
11891 \begin_layout Plain Layout
11898 \begin_inset Flex CharStyle:Code
11901 \begin_layout Plain Layout
11910 \begin_inset Flex CharStyle:Code
11913 \begin_layout Plain Layout
11919 ] Indicates whether the user may employ the Paragraph Settings dialog to
11920 customize the paragraph.
11923 \begin_layout Description
11924 \begin_inset Flex CharStyle:Code
11927 \begin_layout Plain Layout
11934 \begin_inset Flex CharStyle:Code
11937 \begin_layout Plain Layout
11944 \begin_inset Flex CharStyle:Code
11947 \begin_layout Plain Layout
11954 \begin_inset Flex CharStyle:Code
11957 \begin_layout Plain Layout
11963 , describing the rendering style used for the inset's frame and buttons.
11964 Footnotes generally use
11965 \begin_inset Flex CharStyle:Code
11968 \begin_layout Plain Layout
11974 , ERT insets generally
11975 \begin_inset Flex CharStyle:Code
11978 \begin_layout Plain Layout
11984 , and character styles
11985 \begin_inset Flex CharStyle:Code
11988 \begin_layout Plain Layout
11997 \begin_layout Description
11998 \begin_inset Flex CharStyle:Code
12001 \begin_layout Plain Layout
12007 Required at the end of the InsetLayout declarations.
12010 \begin_layout Description
12011 \begin_inset Flex CharStyle:Code
12014 \begin_layout Plain Layout
12020 The font used for both the text body
12026 \begin_inset space ~
12030 \begin_inset CommandInset ref
12032 reference "sec:fonts"
12037 Note that defining this font automatically defines the
12038 \begin_inset Flex CharStyle:Code
12041 \begin_layout Plain Layout
12047 to the same value, so define this first and define
12048 \begin_inset Flex CharStyle:Code
12051 \begin_layout Plain Layout
12057 later if you want them to be different.
12060 \begin_layout Description
12061 \begin_inset Flex CharStyle:Code
12064 \begin_layout Plain Layout
12071 \begin_inset Quotes eld
12075 \begin_inset Quotes erd
12078 language, leading to Left-to-Right (latin) output, e.
12079 \begin_inset space \thinspace{}
12083 \begin_inset space \space{}
12090 \begin_layout Description
12091 \begin_inset Flex CharStyle:Code
12094 \begin_layout Plain Layout
12101 \begin_inset Flex CharStyle:Code
12104 \begin_layout Plain Layout
12113 \begin_inset Flex CharStyle:Code
12116 \begin_layout Plain Layout
12122 ] Indicates whether the PlainLayout should be used or, instead, the user
12123 can change the paragraph style used in the inset.
12126 \begin_layout Description
12127 \begin_inset Flex CharStyle:Code
12130 \begin_layout Plain Layout
12136 As with paragraph styles (see page
12137 \begin_inset CommandInset ref
12138 LatexCommand pageref
12139 reference "des:FreeSpacing"
12146 \begin_layout Description
12147 \begin_inset Flex CharStyle:Code
12150 \begin_layout Plain Layout
12156 As with paragraph styles (see page
12157 \begin_inset CommandInset ref
12158 LatexCommand pageref
12159 reference "des:KeepEmpty"
12166 \begin_layout Description
12167 \begin_inset Flex CharStyle:Code
12170 \begin_layout Plain Layout
12176 The font used for the label.
12178 \begin_inset space ~
12182 \begin_inset CommandInset ref
12184 reference "sec:fonts"
12189 Note that this definition can never appear before
12190 \begin_inset Flex CharStyle:Code
12193 \begin_layout Plain Layout
12199 , lest it be ineffective.
12202 \begin_layout Description
12203 \begin_inset Flex CharStyle:Code
12206 \begin_layout Plain Layout
12212 What will be displayed on the button or elsewhere as the inset label.
12213 Some inset types (ERT and Branch) modify this label on the fly.
12216 \begin_layout Description
12217 \begin_inset Flex CharStyle:Code
12220 \begin_layout Plain Layout
12226 The name of the corresponding LaTeX stuff.
12227 Either the environment or command name.
12230 \begin_layout Description
12231 \begin_inset Flex CharStyle:Code
12234 \begin_layout Plain Layout
12240 The optional parameter for the corresponding
12241 \begin_inset Flex CharStyle:Code
12244 \begin_layout Plain Layout
12250 stuff, including possible bracket pairs like
12251 \begin_inset Flex CharStyle:Code
12254 \begin_layout Plain Layout
12261 This parameter cannot be changed from within LyX.
12264 \begin_layout Description
12265 \begin_inset Flex CharStyle:Code
12268 \begin_layout Plain Layout
12274 As with paragraph styles (see page
12275 \begin_inset CommandInset ref
12276 LatexCommand pageref
12277 reference "des:LatexType"
12284 \begin_layout Description
12285 \begin_inset Flex CharStyle:Code
12288 \begin_layout Plain Layout
12295 \begin_inset Flex CharStyle:Code
12298 \begin_layout Plain Layout
12305 \begin_inset Flex CharStyle:Code
12308 \begin_layout Plain Layout
12315 \begin_inset Flex CharStyle:Code
12318 \begin_layout Plain Layout
12325 \begin_inset Flex CharStyle:Code
12328 \begin_layout Plain Layout
12334 (indicating a dummy definition ending definitions of charstyles, etc).
12335 This entry is required in and is only meaningful for Flex insets.
12336 Among other things, it determines on which menu this inset will appear.
12339 \begin_layout Description
12340 \begin_inset Flex CharStyle:Code
12343 \begin_layout Plain Layout
12350 \begin_inset Flex CharStyle:Code
12353 \begin_layout Plain Layout
12362 \begin_inset Flex CharStyle:Code
12365 \begin_layout Plain Layout
12371 ] Whether multiple paragraphs are permitted in this inset.
12372 This will also set CustomPars to the same value and ForcePlain to the opposite
12374 These can be reset to other values, if they are used
12381 \begin_layout Description
12382 \begin_inset Flex CharStyle:Code
12385 \begin_layout Plain Layout
12392 \begin_inset Flex CharStyle:Code
12395 \begin_layout Plain Layout
12404 \begin_inset Flex CharStyle:Code
12407 \begin_layout Plain Layout
12413 ] Whether fragile commands in this layout should be
12414 \begin_inset Flex CharStyle:Code
12417 \begin_layout Plain Layout
12430 whether the command should itself be protected.)
12433 \begin_layout Description
12434 \begin_inset Flex CharStyle:Code
12437 \begin_layout Plain Layout
12444 \begin_inset Flex CharStyle:Code
12447 \begin_layout Plain Layout
12456 \begin_inset Flex CharStyle:Code
12459 \begin_layout Plain Layout
12465 ] As with paragraph styles (see page
12466 \begin_inset CommandInset ref
12468 reference "des:PathThru"
12475 \begin_layout Description
12476 \begin_inset Flex CharStyle:Code
12479 \begin_layout Plain Layout
12485 As with paragraph styles (see page
12486 \begin_inset CommandInset ref
12487 LatexCommand pageref
12488 reference "des:Preamble"
12495 \begin_layout Description
12496 \begin_inset Flex CharStyle:Code
12499 \begin_layout Plain Layout
12506 \begin_inset Flex CharStyle:Code
12509 \begin_layout Plain Layout
12515 ] As with paragraph styles (see page
12516 \begin_inset CommandInset ref
12517 LatexCommand pageref
12518 reference "des:Requires"
12525 \begin_layout Subsection
12529 \begin_layout Standard
12530 \begin_inset CommandInset label
12536 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12538 \begin_inset Flex CharStyle:MenuItem
12541 \begin_layout Plain Layout
12548 \begin_inset Flex CharStyle:MenuItem
12551 \begin_layout Plain Layout
12557 , \SpecialChar \ldots{}
12558 ) in the text class itself.
12559 The standard counters are defined in the file
12560 \begin_inset Flex CharStyle:Code
12563 \begin_layout Plain Layout
12569 , so you may have to do no more than add
12572 \begin_layout LyX-Code
12573 Input stdcounters.inc
12576 \begin_layout Standard
12577 to your layout file to get them to work.
12578 But if you want to define custom counters, then you can do so.
12579 The counter declaration must begin with:
12582 \begin_layout LyX-Code
12586 \begin_layout Standard
12587 where of course `name' is replaced by the name of the counter.
12588 And it must end with
12589 \begin_inset Quotes eld
12593 \begin_inset Flex CharStyle:Code
12596 \begin_layout Plain Layout
12603 \begin_inset Quotes erd
12607 The following parameters can also be used:
12610 \begin_layout Description
12611 \begin_inset Flex CharStyle:Code
12614 \begin_layout Plain Layout
12615 LabelString [string=""]
12620 when this is defined, this string defines how the counter is displayed.
12621 Setting this value sets
12622 \begin_inset Flex CharStyle:Code
12625 \begin_layout Plain Layout
12626 LabelStringAppendix
12632 The following special constructs can be used in the string:
12636 \begin_layout Itemize
12637 \begin_inset Flex CharStyle:Code
12640 \begin_layout Plain Layout
12648 will be replaced by the expansion of the
12649 \begin_inset Flex CharStyle:Code
12652 \begin_layout Plain Layout
12659 \begin_inset Flex CharStyle:Code
12662 \begin_layout Plain Layout
12663 LabelStringAppendix
12669 \begin_inset Flex CharStyle:Code
12672 \begin_layout Plain Layout
12682 \begin_layout Itemize
12683 counter values can be expressed using LaTeX-like macros
12684 \begin_inset Flex CharStyle:Code
12687 \begin_layout Plain Layout
12704 \begin_inset Flex CharStyle:Code
12707 \begin_layout Plain Layout
12719 \begin_layout Plain Layout
12729 Actually, the situation is a bit more complicated: any
12748 other than those descibed below will produce arabic numerals.
12749 It would not be surprising to see this change in the future.
12755 \begin_inset Flex CharStyle:Code
12758 \begin_layout Plain Layout
12764 : 1, 2, 3,\SpecialChar \ldots{}
12766 \begin_inset Flex CharStyle:Code
12769 \begin_layout Plain Layout
12775 for lower-case letters: a, b, c, \SpecialChar \ldots{}
12777 \begin_inset Flex CharStyle:Code
12780 \begin_layout Plain Layout
12786 for upper-case letters: A, B, C, \SpecialChar \ldots{}
12788 \begin_inset Flex CharStyle:Code
12791 \begin_layout Plain Layout
12797 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
12799 \begin_inset Flex CharStyle:Code
12802 \begin_layout Plain Layout
12808 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
12810 \begin_inset Flex CharStyle:Code
12813 \begin_layout Plain Layout
12819 for hebrew numerals.
12823 \begin_layout Standard
12824 If LabelString is not defined, a default value is constructed as follows:
12825 if the counter has a master counter
12826 \begin_inset Flex CharStyle:Code
12829 \begin_layout Plain Layout
12836 \begin_inset Flex CharStyle:Code
12839 \begin_layout Plain Layout
12846 \begin_inset Flex CharStyle:Code
12849 \begin_layout Plain Layout
12859 is used; otherwise the string
12860 \begin_inset Flex CharStyle:Code
12863 \begin_layout Plain Layout
12874 \begin_layout Description
12875 \begin_inset Flex CharStyle:Code
12878 \begin_layout Plain Layout
12879 LabelStringAppendix [string=""]
12885 \begin_inset Flex CharStyle:Code
12888 \begin_layout Plain Layout
12894 , but for use in the Appendix.
12897 \begin_layout Description
12898 \begin_inset Flex CharStyle:Code
12901 \begin_layout Plain Layout
12908 \begin_inset Flex CharStyle:Code
12911 \begin_layout Plain Layout
12918 \begin_inset Quotes erd
12922 \begin_inset Quotes erd
12925 ] If this is set to the name of another counter, the present counter will
12926 be reset everytime the other one is increased.
12928 \begin_inset Flex CharStyle:Code
12931 \begin_layout Plain Layout
12938 \begin_inset Flex CharStyle:Code
12941 \begin_layout Plain Layout
12950 \begin_layout Subsection
12954 \begin_layout Standard
12955 \begin_inset CommandInset label
12961 A font description looks like this:
12964 \begin_layout LyX-Code
12974 \begin_layout LyX-Code
12978 \begin_layout LyX-Code
12982 \begin_layout Standard
12983 The following commands are available:
12986 \begin_layout Description
12987 \begin_inset Flex CharStyle:Code
12990 \begin_layout Plain Layout
12997 \begin_inset Flex CharStyle:Code
13000 \begin_layout Plain Layout
13009 \begin_inset Flex CharStyle:Code
13012 \begin_layout Plain Layout
13019 \begin_inset Flex CharStyle:Code
13022 \begin_layout Plain Layout
13029 \begin_inset Flex CharStyle:Code
13032 \begin_layout Plain Layout
13039 \begin_inset Flex CharStyle:Code
13042 \begin_layout Plain Layout
13049 \begin_inset Flex CharStyle:Code
13052 \begin_layout Plain Layout
13059 \begin_inset Flex CharStyle:Code
13062 \begin_layout Plain Layout
13069 \begin_inset Flex CharStyle:Code
13072 \begin_layout Plain Layout
13079 \begin_inset Flex CharStyle:Code
13082 \begin_layout Plain Layout
13091 \begin_layout Description
13092 \begin_inset Flex CharStyle:Code
13095 \begin_layout Plain Layout
13104 \begin_inset Flex CharStyle:Code
13107 \begin_layout Plain Layout
13118 \begin_inset Flex CharStyle:Code
13121 \begin_layout Plain Layout
13128 \begin_inset Flex CharStyle:Code
13131 \begin_layout Plain Layout
13140 \begin_layout Description
13141 \begin_inset Flex CharStyle:Code
13144 \begin_layout Plain Layout
13151 \begin_inset Flex CharStyle:Code
13154 \begin_layout Plain Layout
13160 ] Valid argument sare:
13161 \begin_inset Flex CharStyle:Code
13164 \begin_layout Plain Layout
13171 \begin_inset Flex CharStyle:Code
13174 \begin_layout Plain Layout
13181 \begin_inset Flex CharStyle:Code
13184 \begin_layout Plain Layout
13191 \begin_inset Flex CharStyle:Code
13194 \begin_layout Plain Layout
13201 \begin_inset Flex CharStyle:Code
13204 \begin_layout Plain Layout
13211 \begin_inset Flex CharStyle:Code
13214 \begin_layout Plain Layout
13221 Each of these turns on or off the corresponding attribute.
13224 \begin_layout Description
13225 \begin_inset Flex CharStyle:Code
13228 \begin_layout Plain Layout
13237 \begin_inset Flex CharStyle:Code
13240 \begin_layout Plain Layout
13251 \begin_inset Flex CharStyle:Code
13254 \begin_layout Plain Layout
13263 \begin_layout Description
13264 \begin_inset Flex CharStyle:Code
13267 \begin_layout Plain Layout
13276 \begin_inset Flex CharStyle:Code
13279 \begin_layout Plain Layout
13290 \begin_inset Flex CharStyle:Code
13293 \begin_layout Plain Layout
13300 \begin_inset Flex CharStyle:Code
13303 \begin_layout Plain Layout
13310 \begin_inset Flex CharStyle:Code
13313 \begin_layout Plain Layout
13322 \begin_layout Description
13323 \begin_inset Flex CharStyle:Code
13326 \begin_layout Plain Layout
13333 \begin_inset Flex CharStyle:Code
13336 \begin_layout Plain Layout
13343 \begin_inset Flex CharStyle:Code
13346 \begin_layout Plain Layout
13353 \begin_inset Flex CharStyle:Code
13356 \begin_layout Plain Layout
13365 \begin_inset Flex CharStyle:Code
13368 \begin_layout Plain Layout
13375 \begin_inset Flex CharStyle:Code
13378 \begin_layout Plain Layout
13385 \begin_inset Flex CharStyle:Code
13388 \begin_layout Plain Layout
13395 \begin_inset Flex CharStyle:Code
13398 \begin_layout Plain Layout
13405 \begin_inset Flex CharStyle:Code
13408 \begin_layout Plain Layout
13417 \begin_layout Subsection
13418 Upgrading old layout files
13421 \begin_layout Standard
13422 The file format of layout files changes from time to time, so old layout
13423 files need to be converted.
13424 This process has been automated since LyX 1.4.0: If LyX reads an old format
13425 layout file it will call the conversion tool
13426 \begin_inset Flex CharStyle:Code
13429 \begin_layout Plain Layout
13430 LyXDir/scripts/layout2layout.py
13435 and convert it to a temporary file in current format.
13436 The original file is left untouched.
13437 If you want to convert the layout file permanently, just call the converter
13441 \begin_layout LyX-Code
13442 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13445 \begin_layout Standard
13446 (You need to replace
13447 \begin_inset Flex CharStyle:Code
13450 \begin_layout Plain Layout
13456 with the name of your LyX system directory, unless you happen to have defined
13457 such an environment variable.) Then copy
13458 \begin_inset Flex CharStyle:Code
13461 \begin_layout Plain Layout
13468 \begin_inset Flex CharStyle:Code
13471 \begin_layout Plain Layout
13480 \begin_layout Standard
13481 The automatic conversion only handles syntax changes.
13482 It cannot handle the case where the contents of included files was changed,
13483 so these will have to be converted separately.
13486 \begin_layout Section
13488 \begin_inset CommandInset label
13490 name "sec:templates"
13497 \begin_layout Standard
13498 Templates are created just like usual documents.
13499 The only difference is that usual documents contain all possible settings,
13500 including the font scheme and the paper size.
13501 Usually a user doesn't want a template to overwrite his defaults in these
13503 For that reason, the designer of a template should remove the corresponding
13505 \begin_inset Flex CharStyle:Code
13508 \begin_layout Plain Layout
13517 \begin_inset Flex CharStyle:Code
13520 \begin_layout Plain Layout
13528 from the template LyX file.
13529 This can be done with any simple text-editor, for example
13530 \begin_inset Flex CharStyle:Code
13533 \begin_layout Plain Layout
13540 \begin_inset Flex CharStyle:Code
13543 \begin_layout Plain Layout
13553 \begin_layout Standard
13554 Put the edited template files you create in
13555 \begin_inset Flex CharStyle:Code
13558 \begin_layout Plain Layout
13564 , copy the ones you use from the global template directory in
13565 \begin_inset Flex CharStyle:Code
13568 \begin_layout Plain Layout
13574 to the same place, and redefine the template path in the
13575 \begin_inset Flex CharStyle:MenuItem
13578 \begin_layout Plain Layout
13579 Tools\SpecialChar \menuseparator
13580 Preferences\SpecialChar \menuseparator
13589 \begin_layout Standard
13590 Note that there is a template which has a particular meaning:
13591 \begin_inset Flex CharStyle:Code
13594 \begin_layout Plain Layout
13601 This template is loaded everytime you create a new document with
13602 \begin_inset Flex CharStyle:MenuItem
13605 \begin_layout Plain Layout
13606 File\SpecialChar \menuseparator
13612 in order to provide useful defaults.
13613 To create this template from inside LyX, all you have to do is to open
13614 a document with the correct settings, and use the
13615 \begin_inset Flex CharStyle:MenuItem
13618 \begin_layout Plain Layout
13619 Save as Document Defaults
13627 \begin_layout Chapter
13628 Including External Material
13631 \begin_layout Standard
13632 \begin_inset Box Shadowbox
13641 height_special "totalheight"
13644 \begin_layout Plain Layout
13645 WARNING: This portion of the documentation has not been updated for some
13647 We certainly hope that it is still accurate, but there are no guarantees.
13655 \begin_layout Standard
13656 The use of material from sources external to LyX is covered in detail in
13662 This part of the manual covers what needs to happen behind the scenes for
13663 new sorts of material to be included.
13666 \begin_layout Section
13670 \begin_layout Standard
13671 The external material feature is based on the concept of a
13676 A template is a specification of how LyX should interface with a certain
13678 As bundled, LyX comes with predefined templates for Xfig figures, various
13679 raster format images, chess diagrams, and LilyPond music notation.
13680 You can check the actual list by using the menu
13681 \begin_inset Flex CharStyle:MenuItem
13684 \begin_layout Plain Layout
13685 Insert\SpecialChar \menuseparator
13686 File\SpecialChar \menuseparator
13693 Furthermore, it is possible to roll your own template to support a specific
13695 Later we'll describe in more detail what is involved, and hopefully you
13696 will submit all the templates you create so we can include them in a later
13700 \begin_layout Standard
13701 Another basic idea of the external material feature is to distinguish between
13702 the original file that serves as a base for final material and the produced
13703 file that is included in your exported or printed document.
13704 For example, consider the case of a figure produced with
13705 \begin_inset Flex CharStyle:Code
13708 \begin_layout Plain Layout
13715 The Xfig application itself works on an original file with the
13716 \begin_inset Flex CharStyle:Code
13719 \begin_layout Plain Layout
13726 Within XFig, you create and change your figure, and when you are done,
13728 \begin_inset Flex CharStyle:Code
13731 \begin_layout Plain Layout
13738 When you want to include the figure in your document, you invoke
13739 \begin_inset Flex CharStyle:Code
13742 \begin_layout Plain Layout
13748 in order to create a PostScript file that can readily be included in your
13751 \begin_inset Flex CharStyle:Code
13754 \begin_layout Plain Layout
13760 file is the original file, and the PostScript file is the produced file.
13763 \begin_layout Standard
13764 This distinction is important in order to allow updating of the material
13765 while you are in the process of writing the document.
13766 Furthermore, it provides us with the flexibility that is needed to support
13767 multiple export formats.
13768 For instance, in the case of a plain text file, it is not exactly an award-winn
13769 ing idea to include the figure as raw PostScript®.
13770 Instead, you'd either prefer to just include a reference to the figure
13771 or try to invoke some graphics to Ascii converter to make the final result
13772 look similar to the real graphics.
13773 The external material management allows you to do this, because it is parameter
13774 ized on the different export formats that LyX supports.
13777 \begin_layout Standard
13778 Besides supporting the production of different products according to the
13779 exported format, it supports tight integration with editing and viewing
13781 In the case of an XFig figure, you are able to invoke Xfig on the original
13782 file with a single click from within the external material dialog in LyX,
13783 and also preview the produced PostScript file with ghostview with another
13785 No more fiddling around with the command line and/or file browsers to locate
13786 and manipulate the original or produced files.
13787 In this way, you are finally able to take full advantage of the many different
13788 applications that are relevant to use when you write your documents, and
13789 ultimately be more productive.
13792 \begin_layout Section
13793 The external template configuration file
13796 \begin_layout Standard
13797 It is relatively easy to add custom external template definitions to LyX.
13798 However, be aware that doing this in an careless manner most probably
13802 introduce an easily exploitable security hole.
13803 So before you do this, please read the discussion about security in section
13805 \begin_inset CommandInset ref
13807 reference "sec:Security-discussion"
13814 \begin_layout Standard
13815 Having said that, we encourage you to submit any interesting templates that
13820 \begin_layout Standard
13821 The external templates are defined in the
13822 \begin_inset Flex CharStyle:Code
13825 \begin_layout Plain Layout
13826 LyXDir/lib/external_templates
13832 You can place your own version in
13833 \begin_inset Flex CharStyle:Code
13836 \begin_layout Plain Layout
13837 UserDir/external_templates
13845 \begin_layout Standard
13846 A typical template looks like this:
13849 \begin_layout LyX-Code
13853 \begin_layout LyX-Code
13854 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
13857 \begin_layout LyX-Code
13861 \begin_layout LyX-Code
13865 \begin_layout LyX-Code
13869 \begin_layout LyX-Code
13873 \begin_layout LyX-Code
13877 \begin_layout LyX-Code
13878 AutomaticProduction true
13881 \begin_layout LyX-Code
13885 \begin_layout LyX-Code
13889 \begin_layout LyX-Code
13893 \begin_layout LyX-Code
13894 TransformCommand Rotate RotationLatexCommand
13897 \begin_layout LyX-Code
13898 TransformCommand Resize ResizeLatexCommand
13901 \begin_layout LyX-Code
13902 Product "$$RotateFront$$ResizeFront
13905 \begin_layout LyX-Code
13910 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
13913 \begin_layout LyX-Code
13914 $$ResizeBack$$RotateBack"
13917 \begin_layout LyX-Code
13921 \begin_layout LyX-Code
13922 UpdateResult "$$AbsPath$$Basename.pstex_t"
13925 \begin_layout LyX-Code
13926 Requirement "graphicx"
13929 \begin_layout LyX-Code
13930 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
13933 \begin_layout LyX-Code
13934 ReferencedFile latex "$$AbsPath$$Basename.eps"
13937 \begin_layout LyX-Code
13938 ReferencedFile dvi "$$AbsPath$$Basename.eps"
13941 \begin_layout LyX-Code
13945 \begin_layout LyX-Code
13949 \begin_layout LyX-Code
13950 TransformCommand Rotate RotationLatexCommand
13953 \begin_layout LyX-Code
13954 TransformCommand Resize ResizeLatexCommand
13957 \begin_layout LyX-Code
13958 Product "$$RotateFront$$ResizeFront
13961 \begin_layout LyX-Code
13966 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
13969 \begin_layout LyX-Code
13970 $$ResizeBack$$RotateBack"
13973 \begin_layout LyX-Code
13974 UpdateFormat pdftex
13977 \begin_layout LyX-Code
13978 UpdateResult "$$AbsPath$$Basename.pdftex_t"
13981 \begin_layout LyX-Code
13982 Requirement "graphicx"
13985 \begin_layout LyX-Code
13986 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
13989 \begin_layout LyX-Code
13990 ReferencedFile latex "$$AbsPath$$Basename.pdf"
13993 \begin_layout LyX-Code
13997 \begin_layout LyX-Code
14001 \begin_layout LyX-Code
14002 Product "$$Contents(
14004 "$$AbsPath$$Basename.asc
14009 \begin_layout LyX-Code
14010 UpdateFormat asciixfig
14013 \begin_layout LyX-Code
14014 UpdateResult "$$AbsPath$$Basename.asc"
14017 \begin_layout LyX-Code
14021 \begin_layout LyX-Code
14025 \begin_layout LyX-Code
14026 Product "<graphic fileref=
14028 "$$AbsOrRelPathMaster$$Basename.eps
14033 \begin_layout LyX-Code
14037 \begin_layout LyX-Code
14041 \begin_layout LyX-Code
14042 UpdateResult "$$AbsPath$$Basename.eps"
14045 \begin_layout LyX-Code
14046 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14049 \begin_layout LyX-Code
14050 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14053 \begin_layout LyX-Code
14057 \begin_layout LyX-Code
14058 Product "[XFig: $$FName]"
14061 \begin_layout LyX-Code
14065 \begin_layout LyX-Code
14069 \begin_layout Standard
14070 As you can see, the template is enclosed in
14071 \begin_inset Flex CharStyle:Code
14074 \begin_layout Plain Layout
14080 \SpecialChar \ldots{}
14082 \begin_inset Flex CharStyle:Code
14085 \begin_layout Plain Layout
14092 It contains a header specifying some general settings and, for each supported
14093 primary document file format, a section
14094 \begin_inset Flex CharStyle:Code
14097 \begin_layout Plain Layout
14103 \SpecialChar \ldots{}
14105 \begin_inset Flex CharStyle:Code
14108 \begin_layout Plain Layout
14117 \begin_layout Subsection
14118 The template header
14121 \begin_layout Description
14122 \begin_inset Flex CharStyle:Code
14125 \begin_layout Plain Layout
14126 AutomaticProduction
14127 \begin_inset space ~
14135 Whether the file represented by the template must be generated by LyX.
14136 This command must occur exactly once.
14139 \begin_layout Description
14140 \begin_inset Flex CharStyle:Code
14143 \begin_layout Plain Layout
14145 \begin_inset space ~
14153 A glob pattern that is used in the file dialog to filter out the desired
14155 If there is more than one possible file extension (e.
14156 \begin_inset space \thinspace{}
14160 \begin_inset space \space{}
14164 \begin_inset Flex CharStyle:Code
14167 \begin_layout Plain Layout
14174 \begin_inset Flex CharStyle:Code
14177 \begin_layout Plain Layout
14183 ), use something like
14184 \begin_inset Flex CharStyle:Code
14187 \begin_layout Plain Layout
14194 This command must occur exactly once.
14197 \begin_layout Description
14198 \begin_inset Flex CharStyle:Code
14201 \begin_layout Plain Layout
14203 \begin_inset space ~
14211 The text that is displayed on the button.
14212 This command must occur exactly once.
14215 \begin_layout Description
14216 \begin_inset Flex CharStyle:Code
14219 \begin_layout Plain Layout
14221 \begin_inset space ~
14225 \begin_inset space ~
14233 The help text that is used in the External dialog.
14234 Provide enough information to explain to the user just what the template
14235 can provide him with.
14236 This command must occur exactly once.
14239 \begin_layout Description
14240 \begin_inset Flex CharStyle:Code
14243 \begin_layout Plain Layout
14245 \begin_inset space ~
14253 The file format of the original file.
14254 This must be the name of a format that is known to LyX (see section
14255 \begin_inset CommandInset ref
14257 reference "sub:Formats"
14263 \begin_inset Quotes eld
14267 \begin_inset Flex CharStyle:Code
14270 \begin_layout Plain Layout
14277 \begin_inset Quotes erd
14280 if the template can handle original files of more than one format.
14281 LyX will attempt to interrogate the file itself in order to deduce its
14282 format in this case.
14283 This command must occur exactly once.
14286 \begin_layout Description
14287 \begin_inset Flex CharStyle:Code
14290 \begin_layout Plain Layout
14292 \begin_inset space ~
14300 A unique name for the template.
14301 It must not contain substitution macros (see below).
14304 \begin_layout Description
14305 \begin_inset Flex CharStyle:Code
14308 \begin_layout Plain Layout
14310 \begin_inset space ~
14313 Rotate|Resize|Clip|Extra
14318 This command specifies which transformations are supported by this template.
14319 It may occur zero or more times.
14320 This command enables the corresponding tabs in the external dialog.
14322 \begin_inset Flex CharStyle:Code
14325 \begin_layout Plain Layout
14331 command must have either a corresponding
14332 \begin_inset Flex CharStyle:Code
14335 \begin_layout Plain Layout
14342 \begin_inset Flex CharStyle:Code
14345 \begin_layout Plain Layout
14352 \begin_inset Flex CharStyle:Code
14355 \begin_layout Plain Layout
14362 Otherwise the transformation will not be supported by that format.
14365 \begin_layout Subsection
14369 \begin_layout Description
14370 \begin_inset Flex CharStyle:Code
14373 \begin_layout Plain Layout
14375 \begin_inset space ~
14378 LaTeX|PDFLaTeX|PlainText|DocBook
14383 The primary document file format that this format definition is for.
14384 Not every template has a sensible representation in all document file formats.
14385 Please define nevertheless a
14386 \begin_inset Flex CharStyle:Code
14389 \begin_layout Plain Layout
14395 section for all formats.
14396 Use a dummy text when no representation is available.
14397 Then you can at least see a reference to the external material in the exported
14401 \begin_layout Description
14402 \begin_inset Flex CharStyle:Code
14405 \begin_layout Plain Layout
14407 \begin_inset space ~
14411 \begin_inset space ~
14419 This command defines an additional macro
14420 \begin_inset Flex CharStyle:Code
14423 \begin_layout Plain Layout
14429 for substitution in
14430 \begin_inset Flex CharStyle:Code
14433 \begin_layout Plain Layout
14441 \begin_inset Flex CharStyle:Code
14444 \begin_layout Plain Layout
14450 itself may contain substitution macros.
14451 The advantage over using
14452 \begin_inset Flex CharStyle:Code
14455 \begin_layout Plain Layout
14462 \begin_inset Flex CharStyle:Code
14465 \begin_layout Plain Layout
14471 is that the substituted value of
14472 \begin_inset Flex CharStyle:Code
14475 \begin_layout Plain Layout
14481 is sanitized so that it is a valid optional argument in the document format.
14482 This command may occur zero or more times.
14485 \begin_layout Description
14486 \begin_inset Flex CharStyle:Code
14489 \begin_layout Plain Layout
14491 \begin_inset space ~
14499 The text that is inserted in the exported document.
14500 This is actually the most important command and can be quite complex.
14501 This command must occur exactly once.
14504 \begin_layout Description
14505 \begin_inset Flex CharStyle:Code
14508 \begin_layout Plain Layout
14510 \begin_inset space ~
14518 This command specifies a preamble snippet that will be included in the
14520 It has to be defined using
14521 \begin_inset Flex CharStyle:Code
14524 \begin_layout Plain Layout
14530 \SpecialChar \ldots{}
14532 \begin_inset Flex CharStyle:Code
14535 \begin_layout Plain Layout
14542 This command may occur zero or more times.
14545 \begin_layout Description
14546 \begin_inset Flex CharStyle:Code
14549 \begin_layout Plain Layout
14551 \begin_inset space ~
14555 \begin_inset space ~
14563 This command denotes files that are created by the conversion process and
14564 are needed for a particular export format.
14565 If the filename is relative, it is interpreted relative to the master document.
14566 This command may be given zero or more times.
14569 \begin_layout Description
14570 \begin_inset Flex CharStyle:Code
14573 \begin_layout Plain Layout
14575 \begin_inset space ~
14583 The name of a required LaTeX package.
14584 The package is included via
14585 \begin_inset Flex CharStyle:Code
14588 \begin_layout Plain Layout
14596 in the LaTeX preamble.
14597 This command may occur zero or more times.
14600 \begin_layout Description
14601 \begin_inset Flex CharStyle:Code
14604 \begin_layout Plain Layout
14606 \begin_inset space ~
14610 \begin_inset space ~
14613 RotationLatexCommand
14618 This command specifies that the built in LaTeX command should be used for
14620 This command may occur once or not at all.
14623 \begin_layout Description
14624 \begin_inset Flex CharStyle:Code
14627 \begin_layout Plain Layout
14629 \begin_inset space ~
14633 \begin_inset space ~
14641 This command specifies that the built in LaTeX command should be used for
14643 This command may occur once or not at all.
14646 \begin_layout Description
14647 \begin_inset Flex CharStyle:Code
14650 \begin_layout Plain Layout
14652 \begin_inset space ~
14656 \begin_inset space ~
14659 RotationLatexOption
14664 This command specifies that rotation is done via an optional argument.
14665 This command may occur once or not at all.
14668 \begin_layout Description
14669 \begin_inset Flex CharStyle:Code
14672 \begin_layout Plain Layout
14674 \begin_inset space ~
14678 \begin_inset space ~
14686 This command specifies that resizing is done via an optional argument.
14687 This command may occur once or not at all.
14690 \begin_layout Description
14691 \begin_inset Flex CharStyle:Code
14694 \begin_layout Plain Layout
14696 \begin_inset space ~
14700 \begin_inset space ~
14708 This command specifies that clipping is done via an optional argument.
14709 This command may occur once or not at all.
14712 \begin_layout Description
14713 \begin_inset Flex CharStyle:Code
14716 \begin_layout Plain Layout
14718 \begin_inset space ~
14722 \begin_inset space ~
14730 This command specifies that an extra optional argument is used.
14731 This command may occur once or not at all.
14734 \begin_layout Description
14735 \begin_inset Flex CharStyle:Code
14738 \begin_layout Plain Layout
14740 \begin_inset space ~
14748 The file format of the converted file.
14749 This must be the name of a format that is known to LyX (see the
14750 \begin_inset Flex CharStyle:MenuItem
14753 \begin_layout Plain Layout
14758 ools\SpecialChar \menuseparator
14763 references:Conversion
14769 This command must occur exactly once.
14772 \begin_layout Description
14773 \begin_inset Flex CharStyle:Code
14776 \begin_layout Plain Layout
14778 \begin_inset space ~
14786 The file name of the converted file.
14787 The file name must be absolute.
14788 This command must occur exactly once.
14791 \begin_layout Subsection
14792 Preamble definitions
14795 \begin_layout Standard
14796 The external template configuration file may contain additional preamble
14797 definitions enclosed by
14798 \begin_inset Flex CharStyle:Code
14801 \begin_layout Plain Layout
14807 \SpecialChar \ldots{}
14809 \begin_inset Flex CharStyle:Code
14812 \begin_layout Plain Layout
14819 They can be used by the templates in the
14820 \begin_inset Flex CharStyle:Code
14823 \begin_layout Plain Layout
14832 \begin_layout Section
14833 The substitution mechanism
14836 \begin_layout Standard
14837 When the external material facility invokes an external program, it is done
14838 on the basis of a command defined in the template configuration file.
14839 These commands can contain various macros that are expanded before execution.
14840 Execution always take place in the directory of the containing document.
14843 \begin_layout Standard
14844 Also, whenever external material is to be displayed, the name will be produced
14845 by the substitution mechanism, and most other commands in the template
14846 definition support substitution as well.
14849 \begin_layout Standard
14850 The available macros are the following:
14853 \begin_layout Description
14854 \begin_inset Flex CharStyle:Code
14857 \begin_layout Plain Layout
14858 $$AbsOrRelPathMaster
14863 The file path, absolute or relative to the master LyX document.
14866 \begin_layout Description
14867 \begin_inset Flex CharStyle:Code
14870 \begin_layout Plain Layout
14871 $$AbsOrRelPathParent
14876 The file path, absolute or relative to the LyX document.
14879 \begin_layout Description
14880 \begin_inset Flex CharStyle:Code
14883 \begin_layout Plain Layout
14889 The absolute file path.
14892 \begin_layout Description
14893 \begin_inset Flex CharStyle:Code
14896 \begin_layout Plain Layout
14902 The filename without path and without the extension.
14905 \begin_layout Description
14906 \begin_inset Flex CharStyle:Code
14909 \begin_layout Plain Layout
14911 \begin_inset Quotes eld
14915 \begin_inset Quotes erd
14923 This macro will expand to the contents of the file with the name
14924 \begin_inset Flex CharStyle:Code
14927 \begin_layout Plain Layout
14936 \begin_layout Description
14937 \begin_inset Flex CharStyle:Code
14940 \begin_layout Plain Layout
14946 The file extension (including the dot).
14949 \begin_layout Description
14950 \begin_inset Flex CharStyle:Code
14953 \begin_layout Plain Layout
14959 The filename of the file specified in the external material dialog.
14960 This is either an absolute name, or it is relative to the LyX document.
14963 \begin_layout Description
14964 \begin_inset Flex CharStyle:Code
14967 \begin_layout Plain Layout
14974 \begin_inset Flex CharStyle:Code
14977 \begin_layout Plain Layout
14983 (absolute name or relative to the LyX document).
14986 \begin_layout Description
14987 \begin_inset Flex CharStyle:Code
14990 \begin_layout Plain Layout
14996 The file path, relative to the master LyX document.
14999 \begin_layout Description
15000 \begin_inset Flex CharStyle:Code
15003 \begin_layout Plain Layout
15009 The file path, relative to the LyX document.
15012 \begin_layout Description
15013 \begin_inset Flex CharStyle:Code
15016 \begin_layout Plain Layout
15022 This macro will expand to the absolute path of the system directory.
15023 This is typically used to point to the various helper scripts that are
15027 \begin_layout Description
15028 \begin_inset Flex CharStyle:Code
15031 \begin_layout Plain Layout
15037 A name and full path to a temporary file which will be automatically deleted
15038 whenever the containing document is closed, or the external material insertion
15042 \begin_layout Standard
15043 All path macros contain a trailing directory separator, so you can construct
15045 \begin_inset space \thinspace{}
15049 \begin_inset space \space{}
15052 the absolute filename with
15053 \begin_inset Flex CharStyle:Code
15056 \begin_layout Plain Layout
15057 $$AbsPath$$Basename$$Extension
15065 \begin_layout Standard
15066 The macros above are substituted in all commands unless otherwise noted.
15068 \begin_inset Flex CharStyle:Code
15071 \begin_layout Plain Layout
15077 supports additionally the following substitutions if they are enabled by
15079 \begin_inset Flex CharStyle:Code
15082 \begin_layout Plain Layout
15089 \begin_inset Flex CharStyle:Code
15092 \begin_layout Plain Layout
15101 \begin_layout Description
15102 \begin_inset Flex CharStyle:Code
15105 \begin_layout Plain Layout
15111 The front part of the resize command.
15114 \begin_layout Description
15115 \begin_inset Flex CharStyle:Code
15118 \begin_layout Plain Layout
15124 The back part of the resize command.
15127 \begin_layout Description
15128 \begin_inset Flex CharStyle:Code
15131 \begin_layout Plain Layout
15137 The front part of the rotation command.
15140 \begin_layout Description
15141 \begin_inset Flex CharStyle:Code
15144 \begin_layout Plain Layout
15150 The back part of the rotation command.
15153 \begin_layout Standard
15154 The value string of the
15155 \begin_inset Flex CharStyle:Code
15158 \begin_layout Plain Layout
15164 command supports additionally the following substitutions if they are enabled
15166 \begin_inset Flex CharStyle:Code
15169 \begin_layout Plain Layout
15176 \begin_inset Flex CharStyle:Code
15179 \begin_layout Plain Layout
15188 \begin_layout Description
15189 \begin_inset Flex CharStyle:Code
15192 \begin_layout Plain Layout
15201 \begin_layout Description
15202 \begin_inset Flex CharStyle:Code
15205 \begin_layout Plain Layout
15214 \begin_layout Description
15215 \begin_inset Flex CharStyle:Code
15218 \begin_layout Plain Layout
15227 \begin_layout Description
15228 \begin_inset Flex CharStyle:Code
15231 \begin_layout Plain Layout
15237 The rotation option.
15240 \begin_layout Standard
15241 You may ask why there are so many path macros.
15242 There are mainly two reasons:
15245 \begin_layout Enumerate
15246 Relative and absolute file names should remain relative or absolute, respectivel
15248 Users may have reasons to prefer either form.
15249 Relative names are useful for portable documents that should work on different
15250 machines, for example.
15251 Absolute names may be required by some programs.
15254 \begin_layout Enumerate
15255 LaTeX treats relative file names differently than LyX and other programs
15256 in nested included files.
15257 For LyX, a relative file name is always relative to the document that contains
15259 For LaTeX, it is always relative to the master document.
15260 These two definitions are identical if you have only one document, but
15261 differ if you have a master document that includes part documents.
15262 That means that relative filenames must be transformed when presented to
15264 Fortunately LyX does this automatically for you if you choose the right
15268 \begin_layout Standard
15269 So which path macro should be used in new template definitions? The rule
15273 \begin_layout Itemize
15275 \begin_inset Flex CharStyle:Code
15278 \begin_layout Plain Layout
15284 if an absolute path is required.
15287 \begin_layout Itemize
15289 \begin_inset Flex CharStyle:Code
15292 \begin_layout Plain Layout
15293 $$AbsOrRelPathMaster
15298 if the substituted string is some kind of LaTeX input.
15301 \begin_layout Itemize
15303 \begin_inset Flex CharStyle:Code
15306 \begin_layout Plain Layout
15307 $$AbsOrRelPathParent
15312 in order to preserve the user's choice.
15315 \begin_layout Standard
15316 There are special cases where this rule does not work and e.
15317 \begin_inset space \thinspace{}
15321 \begin_inset space \space{}
15324 relative names are needed, but normally it will work just fine.
15325 One example for such a case is the command
15326 \begin_inset Flex CharStyle:Code
15329 \begin_layout Plain Layout
15330 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15335 in the XFig template above: We can't use the absolute name because the
15337 \begin_inset Flex CharStyle:Code
15340 \begin_layout Plain Layout
15346 files needs the relative name in order to rewrite the file content.
15349 \begin_layout Section
15350 \begin_inset CommandInset label
15352 name "sec:Security-discussion"
15356 Security discussion
15359 \begin_layout Standard
15360 \begin_inset Box Shadowbox
15369 height_special "totalheight"
15372 \begin_layout Plain Layout
15373 WARNING: This section is definitely outdated.
15381 \begin_layout Standard
15382 The external material feature interfaces with a lot of external programs
15383 and does so automatically, so we have to consider the security implications
15385 In particular, since you have the option of including your own filenames
15386 and/or parameter strings and those are expanded into a command, it seems
15387 that it would be possible to create a malicious document which executes
15388 arbitrary commands when a user views or prints the document.
15389 This is something we definately want to avoid.
15392 \begin_layout Standard
15393 However, since the external program commands are specified in the template
15394 configuration file only, there are no security issues if LyX is properly
15395 configured with safe templates only.
15396 This is so because the external programs are invoked with the
15397 \begin_inset Flex CharStyle:Code
15400 \begin_layout Plain Layout
15406 -system call rather than the
15407 \begin_inset Flex CharStyle:Code
15410 \begin_layout Plain Layout
15416 system-call, so it's not possible to execute arbitrary commands from the
15417 filename or parameter section via the shell.
15420 \begin_layout Standard
15421 This also implies that you are restricted in what command strings you can
15422 use in the external material templates.
15423 In particular, pipes and redirection are not readily available.
15424 This has to be so if LyX should remain safe.
15425 If you want to use some of the shell features, you should write a safe
15426 script to do this in a controlled manner, and then invoke the script from
15427 the command string.
15429 \begin_inset Flex CharStyle:Code
15432 \begin_layout Plain Layout
15438 directory of the LyX installation, you can find a safe wrapper script
15439 \begin_inset Flex CharStyle:Code
15442 \begin_layout Plain Layout
15443 general_command_wrapper.py
15448 that supports redirection of input and output.
15449 That can serve as an example for how to write safe template scripts.
15450 For a more advanced example that uses
15451 \begin_inset Flex CharStyle:Code
15454 \begin_layout Plain Layout
15460 and friends, take a look at the
15461 \begin_inset Flex CharStyle:Code
15464 \begin_layout Plain Layout
15473 \begin_layout Standard
15474 It is possible to design a template that interacts directly with the shell,
15475 but since this would allow a malicious user to execute arbitrary commands
15476 by writing clever filenames and/or parameters, we generally recommend that
15477 you only use safe scripts that work with the
15478 \begin_inset Flex CharStyle:Code
15481 \begin_layout Plain Layout
15487 system call in a controlled manner.
15488 Of course, for use in a controlled environment, it can be tempting to just
15489 fall back to use ordinary shell scripts.
15490 If you do so, be aware that you
15494 provide an easily exploitable security hole in your system.
15495 Of course it stands to reason that such unsafe templates will never be
15496 included in the standard LyX distribution, although we do encourage people
15497 to submit new templates in the open source tradition.
15498 But LyX as shipped from the official distribution channels will never have
15502 \begin_layout Standard
15503 Including external material provides a lot of power, and you have to be
15504 careful not to introduce security hazards with this power.
15505 A subtle error in a single line in an innocent looking script can open
15506 the door to huge security problems.
15507 So if you do not fully understand the issues, we recommend that you consult
15508 a knowledgable security professional or the LyX development team if you
15509 have any questions about whether a given template is safe or not.
15510 And do this before you use it in an uncontrolled environment.