1 #LyX 1.6.0svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that the User's Guide prints
10 % out as advertised. If you mess with this preamble,
11 % parts of the User's Guide may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
39 % used for multi-column text
43 \options fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
44 \use_default_options false
50 InsetLayout CharStyle:MenuItem
59 \newcommand*{\menuitem}[1]{{\sffamily #1}}
67 \font_typewriter default
68 \font_default_family default
78 \pdf_title "LyX Configuration Manual"
79 \pdf_author "LyX Team"
80 \pdf_subject "LyX-documentation Customization"
81 \pdf_keywords "LyX, documentation, customization"
83 \pdf_bookmarksnumbered true
84 \pdf_bookmarksopen true
85 \pdf_bookmarksopenlevel 1
90 \pdf_pdfusetitle false
91 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
98 \paperorientation portrait
105 \paragraph_separation indent
107 \quotes_language english
110 \paperpagestyle headings
111 \tracking_changes false
112 \output_changes false
120 Customizing LyX: Features for the Advanced User
128 \begin_layout Plain Layout
130 If you have comments or error corrections, please send them to the LyX Documenta
132 \begin_inset CommandInset href
134 target "lyx-docs@lists.lyx.org"
147 \begin_layout Standard
148 \begin_inset CommandInset toc
149 LatexCommand tableofcontents
156 \begin_layout Chapter
160 \begin_layout Standard
161 This manual covers the customization features present in LyX.
162 In it, we discuss issues like keyboard shortcuts, screen previewing options,
163 printer options, sending commands to LyX via the LyX Server, internationalizati
164 on, installing new LaTeX classes and LyX layouts, etc.
165 We can't possibly hope to touch on everything you can change---our developers
166 add new features faster than we can document them---but we will explain
167 the most common customizations and hopefully point you in the right direction
168 for some of the more obscure ones.
171 \begin_layout Standard
172 \begin_inset Branch OutDated
175 \begin_layout Standard
176 Information from previous versions of this document that now seems to be
177 outdated is contained in the OutDated branch of this document.
178 By default, this information will not appear in the LaTeX output.
186 \begin_layout Chapter
187 LyX configuration files
190 \begin_layout Standard
191 This chapter aims to help you to find your way through the LyX configuration
193 Before continuing to read this chapter, you should find out where your
194 LyX library and user directories are by using
195 \begin_inset Flex CharStyle:MenuItem
198 \begin_layout Plain Layout
203 elp\SpecialChar \menuseparator
216 The library directory is the place where LyX places its system-wide configurati
217 on files; the user directory is where you can place your modified versions.
218 We will call the former
219 \begin_inset Flex CharStyle:Code
222 \begin_layout Plain Layout
229 \begin_inset Flex CharStyle:MenuItem
232 \begin_layout Plain Layout
238 in the remainder of this document.
242 \begin_layout Section
244 \begin_inset Flex CharStyle:Code
247 \begin_layout Plain Layout
256 \begin_layout Standard
257 \begin_inset Flex CharStyle:Code
260 \begin_layout Plain Layout
266 and its sub-directories contain a number of files and that can be used
267 to customise LyX's behaviour.
268 You can change many of these files from within LyX itself through the
269 \begin_inset Flex CharStyle:MenuItem
272 \begin_layout Plain Layout
273 Tools\SpecialChar \menuseparator
280 Most customization that you will want to do in LyX is possible through
282 However, many other inner aspects of LyX can be customized by modifying
284 \begin_inset Flex CharStyle:Code
287 \begin_layout Plain Layout
294 These files fall in different categories, described in the following subsection
298 \begin_layout Subsection
299 Automatically generated files
302 \begin_layout Standard
303 The files, which are to be found in
304 \begin_inset Flex CharStyle:MenuItem
307 \begin_layout Plain Layout
313 , are generated when you configure LyX.
314 They contain various default values that are guessed by inspection.
315 In general, it is not a good idea to modify them, since they might be overwritt
319 \begin_layout Labeling
320 \labelwidthstring 00.00.0000
321 \begin_inset Flex CharStyle:Code
324 \begin_layout Plain Layout
330 contains defaults for various commands.
333 \begin_layout Labeling
334 \labelwidthstring 00.00.0000
335 \begin_inset Flex CharStyle:Code
338 \begin_layout Plain Layout
344 contains the list of packages that have been recognized by LyX.
345 It is currently unused by the LyX program itself, but the information extracted
346 , and more, is made available with
347 \begin_inset Flex CharStyle:MenuItem
350 \begin_layout Plain Layout
355 elp\SpecialChar \menuseparator
372 \begin_layout Labeling
373 \labelwidthstring 00.00.0000
374 \begin_inset Flex CharStyle:Code
377 \begin_layout Plain Layout
383 the list of text classes that have been found in your
384 \begin_inset Flex CharStyle:Code
387 \begin_layout Plain Layout
393 directories, along with the associated LaTeX document class and their descripti
397 \begin_layout Labeling
398 \labelwidthstring 00.00.0000
399 \begin_inset Flex CharStyle:Code
402 \begin_layout Plain Layout
408 the list of layout modules found in your
409 \begin_inset Flex CharStyle:Code
412 \begin_layout Plain Layout
421 \begin_layout Labeling
422 \labelwidthstring 00.00.0000
423 \begin_inset Flex CharStyle:Code
426 \begin_layout Plain Layout
432 lists of various sorts of LaTeX-related files found on your system
435 \begin_layout Labeling
436 \labelwidthstring 00.00.0000
437 \begin_inset Flex CharStyle:Code
440 \begin_layout Plain Layout
446 is automatically generated during configuration from the file
447 \begin_inset Flex CharStyle:Code
450 \begin_layout Plain Layout
457 It contains information on your LaTeX configuration.
460 \begin_layout Subsection
464 \begin_layout Standard
465 These directories are duplicated between
466 \begin_inset Flex CharStyle:Code
469 \begin_layout Plain Layout
476 \begin_inset Flex CharStyle:Code
479 \begin_layout Plain Layout
486 If a particular files exists in both places, the one in
487 \begin_inset Flex CharStyle:Code
490 \begin_layout Plain Layout
499 \begin_layout Labeling
500 \labelwidthstring 00.00.0000
501 \begin_inset Flex CharStyle:Code
504 \begin_layout Plain Layout
510 this directory contains files with the extension
511 \begin_inset Flex CharStyle:Code
514 \begin_layout Plain Layout
520 that define the keybindings used in LyX.
521 If there exists an internationalized version of the bind file named
522 \begin_inset Flex CharStyle:Code
525 \begin_layout Plain Layout
531 , that will be used first.
534 \begin_layout Labeling
535 \labelwidthstring 00.00.0000
536 \begin_inset Flex CharStyle:Code
539 \begin_layout Plain Layout
545 contains graphics files that can be included in documents.
549 \begin_layout Labeling
550 \labelwidthstring 00.00.0000
551 \begin_inset Flex CharStyle:Code
554 \begin_layout Plain Layout
560 contains LyX documentation files (including the one you are currently reading).
562 \begin_inset Flex CharStyle:Code
565 \begin_layout Plain Layout
571 deserves special attention, as noted above.
572 If there exists an internationalized version of the help-document with
574 \begin_inset Flex CharStyle:Code
577 \begin_layout Plain Layout
583 prepended to the name, that will be used first.
589 \begin_inset CommandInset ref
591 reference "chap:i18n"
598 \begin_layout Labeling
599 \labelwidthstring 00.00.0000
600 \begin_inset Flex CharStyle:Code
603 \begin_layout Plain Layout
609 contains example files that explain how to use some features.
610 In the file browser, press the
611 \begin_inset Flex CharStyle:MenuItem
614 \begin_layout Plain Layout
623 \begin_layout Labeling
624 \labelwidthstring 00.00.0000
625 \begin_inset Flex CharStyle:Code
628 \begin_layout Plain Layout
634 contains image files that are used by the
635 \begin_inset Flex CharStyle:MenuItem
638 \begin_layout Plain Layout
645 In addition, it also contains the individual icons used in the toolbar
646 and the banners that can be shown when LyX is launched.
649 \begin_layout Labeling
650 \labelwidthstring 00.00.0000
651 \begin_inset Flex CharStyle:Code
654 \begin_layout Plain Layout
660 contains keyboard keymapping files.
666 \begin_inset CommandInset ref
668 reference "sec:keymap"
675 \begin_layout Labeling
676 \labelwidthstring 00.00.0000
677 \begin_inset Flex CharStyle:Code
680 \begin_layout Plain Layout
686 contains the text class and module files described in Chapter
691 \begin_inset CommandInset ref
693 reference "chap:textclass"
700 \begin_layout Labeling
701 \labelwidthstring 00.00.0000
702 \begin_inset Flex CharStyle:Code
705 \begin_layout Plain Layout
712 \begin_inset Flex CharStyle:Code
715 \begin_layout Plain Layout
721 Python scripts used to convert between LyX versions.
722 These can be run from the command line if, say, you want to batch-convert
726 \begin_layout Labeling
727 \labelwidthstring 00.00.0000
728 \begin_inset Flex CharStyle:Code
731 \begin_layout Plain Layout
737 contains some files that demonstrate the capabilities of the
738 \begin_inset Flex CharStyle:MenuItem
741 \begin_layout Plain Layout
752 Also contains some scripts used by LyX itself.
755 \begin_layout Labeling
756 \labelwidthstring 00.00.0000
757 \begin_inset Flex CharStyle:Code
760 \begin_layout Plain Layout
766 contains the standard LyX template files described in Chapter
771 \begin_inset CommandInset ref
773 reference "sec:templates"
780 \begin_layout Labeling
781 \labelwidthstring 00.00.0000
782 \begin_inset Flex CharStyle:Code
785 \begin_layout Plain Layout
791 contains files with the extension
792 \begin_inset Flex CharStyle:Code
795 \begin_layout Plain Layout
801 that define the user interface to LyX.
802 That is, the files define which items appear in which menus and the items
803 appearing on the toolbar.
806 \begin_layout Subsection
807 Files you don't want to modify
810 \begin_layout Standard
811 These files are used internally by LyX and you generally do not need to
812 modify them unless you are a developer.
815 \begin_layout Labeling
816 \labelwidthstring 00.00.0000
817 \begin_inset Flex CharStyle:Code
820 \begin_layout Plain Layout
826 this file contains the list of LyX developers.
827 The contents are displayed with the menu entry
828 \begin_inset Flex CharStyle:MenuItem
831 \begin_layout Plain Layout
836 elp\SpecialChar \menuseparator
849 \begin_layout Labeling
850 \labelwidthstring 00.00.0000
851 \begin_inset Flex CharStyle:Code
854 \begin_layout Plain Layout
860 this is a LaTeX script used during the configuration process.
864 \begin_layout Labeling
865 \labelwidthstring 00.00.0000
866 \begin_inset Flex CharStyle:Code
869 \begin_layout Plain Layout
875 this is the script that is used to re-configure LyX.
876 It creates configuration files in the directory it was run from.
879 \begin_layout Subsection
880 Other files needing a line or two...
883 \begin_layout Labeling
884 \labelwidthstring 00.00.0000
885 \begin_inset Flex CharStyle:Code
888 \begin_layout Plain Layout
894 this contains tables describing how different character encodings can be
898 \begin_layout Labeling
899 \labelwidthstring 00.00.0000
900 \begin_inset Flex CharStyle:Code
903 \begin_layout Plain Layout
909 this file contains the templates available to the new
910 \begin_inset Flex CharStyle:MenuItem
913 \begin_layout Plain Layout
926 \begin_layout Labeling
927 \labelwidthstring 00.00.0000
928 \begin_inset Flex CharStyle:Code
931 \begin_layout Plain Layout
937 this file contains a list of all the languages currently supported by LyX.
940 \begin_layout Section
941 Your local configuration directory
944 \begin_layout Standard
945 Even if you are using LyX as an unprivileged user, you might want to change
946 LyX configuration for your own use.
948 \begin_inset Flex CharStyle:Code
951 \begin_layout Plain Layout
957 directory contains all your personal configuration files.
958 This is the directory described as
959 \begin_inset Quotes eld
963 \begin_inset Quotes erd
967 \begin_inset Flex CharStyle:MenuItem
970 \begin_layout Plain Layout
975 elp\SpecialChar \menuseparator
986 This directory is used as a mirror of
987 \begin_inset Flex CharStyle:Code
990 \begin_layout Plain Layout
996 , which means that every file in
997 \begin_inset Flex CharStyle:Code
1000 \begin_layout Plain Layout
1006 is a replacement for the corresponding file in
1007 \begin_inset Flex CharStyle:Code
1010 \begin_layout Plain Layout
1017 Any configuration file described in the above sections can be placed either
1018 in the system-wide directory, in which case it will affect all users, or
1019 in your local directory for your own use.
1022 \begin_layout Standard
1023 To make things clearer, let's provide a few examples:
1026 \begin_layout Itemize
1027 The preferences set in the
1028 \begin_inset Flex CharStyle:MenuItem
1031 \begin_layout Plain Layout
1036 ools\SpecialChar \menuseparator
1046 dialog are saved to a file
1047 \begin_inset Flex CharStyle:Code
1050 \begin_layout Plain Layout
1057 \begin_inset Flex CharStyle:Code
1060 \begin_layout Plain Layout
1069 \begin_layout Itemize
1070 When you reconfigure using
1071 \begin_inset Flex CharStyle:MenuItem
1074 \begin_layout Plain Layout
1079 ools\SpecialChar \menuseparator
1090 \begin_inset Flex CharStyle:Code
1093 \begin_layout Plain Layout
1099 script, and the resulting files are written in your local configuration
1101 This means that any additional text class file that you might have added
1103 \begin_inset Flex CharStyle:Code
1106 \begin_layout Plain Layout
1112 will be added to the list of classes in the
1113 \begin_inset Flex CharStyle:MenuItem
1116 \begin_layout Plain Layout
1117 Document\SpecialChar \menuseparator
1126 \begin_layout Itemize
1127 If you get some updated documentation from LyX ftp site and cannot install
1128 it because you do not have sysadmin rights on your system, you can just
1130 \begin_inset Flex CharStyle:Code
1133 \begin_layout Plain Layout
1139 and the items in the
1140 \begin_inset Flex CharStyle:MenuItem
1143 \begin_layout Plain Layout
1153 menu will open them!
1156 \begin_layout Section
1157 Running LyX with multiple configurations
1160 \begin_layout Standard
1161 The configuration freedom of the local configuration directory may not suffice
1162 if you want to have more than one configuration at your disposal.
1163 For example, you may want to be use different key bindings or printer settings
1165 You can achieve this by having several such directories.
1166 You then specify which directory to use at run-time.
1169 \begin_layout Standard
1170 Invoking LyX with the command line switch
1171 \begin_inset Flex CharStyle:Code
1174 \begin_layout Plain Layout
1184 instructs the program to read the configuration from that directory, and
1185 not from the default directory.
1186 (You can determine the default directory by running LyX without the
1187 \begin_inset Flex CharStyle:Code
1190 \begin_layout Plain Layout
1196 switch.) If the specified directory does not exist, LyX offers to create
1197 it for you, just like it does for the default directory on the first time
1198 you run the program.
1199 You can modify the configuration options in this additional user directory
1200 exactly as you would for the default directory.
1201 These directories are completely independent (but read on).
1202 Note that setting the environment variable
1203 \begin_inset Flex CharStyle:Code
1206 \begin_layout Plain Layout
1212 to some value has exactly the same effect.
1215 \begin_layout Standard
1216 Having several configurations also requires more maintenance: if you want
1217 to add a new layout to
1218 \begin_inset Flex CharStyle:Code
1221 \begin_layout Plain Layout
1227 which you want available from all your configurations, you must add it
1228 to each directory separately.
1229 You can avoid this with the following trick: after LyX creates the additional
1230 directory, most of the subdirectories (see above) are empty.
1231 If you want the new configuration to mirror an existing one, replace the
1232 empty subdirectory with a symbolic link to the matching subdirectory in
1233 the existing configuration.
1235 \begin_inset Flex CharStyle:Code
1238 \begin_layout Plain Layout
1244 subirectory, however, since it contains a file written by the configuration
1245 script (also accessible through
1246 \begin_inset Flex CharStyle:MenuItem
1249 \begin_layout Plain Layout
1254 ools\SpecialChar \menuseparator
1264 ) which is configuration-specific.
1267 \begin_layout Chapter
1268 The Preferences dialog
1271 \begin_layout Standard
1272 All options of the preferences dialog are described in the Appendix
1274 The Preferences Dialog
1281 For some options you might find here more details.
1284 \begin_layout Section
1285 Using the dialog for the first time
1288 \begin_layout Standard
1290 \begin_inset Flex CharStyle:Code
1293 \begin_layout Plain Layout
1299 file will contain only changes that you have made to the default behavior,
1300 some of which is hard-coded into LyX and some of which is contained in
1302 \begin_inset Flex CharStyle:Code
1305 \begin_layout Plain Layout
1306 LyXDir/lyxrc.defaults
1312 Note that in both files lines beginning with a
1313 \begin_inset Quotes eld
1317 \begin_inset Quotes erd
1320 are just comments and are not interpreted.
1321 However, only system administrators should edit
1322 \begin_inset Flex CharStyle:Code
1325 \begin_layout Plain Layout
1326 LyXDir/lyxrc.defaults
1332 Users should use the
1333 \begin_inset Flex CharStyle:MenuItem
1336 \begin_layout Plain Layout
1337 Tools\SpecialChar \menuseparator
1343 dialog to create and modify their own
1344 \begin_inset Flex CharStyle:Code
1347 \begin_layout Plain Layout
1356 \begin_layout Standard
1358 \begin_inset Flex CharStyle:MenuItem
1361 \begin_layout Plain Layout
1362 Tools\SpecialChar \menuseparator
1368 dialog will be largely self-explanatory.
1369 Most things in the dialog have associated `tool tips': hover your mouse
1370 pointer over something for more information.
1371 Before we highlight a few of the more important commands below, however,
1372 a word of warning: Applying some of your changes (e.g.
1373 \begin_inset space \space{}
1376 screen fonts) will have an instant effect.
1378 \begin_inset space \space{}
1381 changing the bind file) will not.
1382 If nothing appears to have changed, just
1383 \begin_inset Flex CharStyle:MenuItem
1386 \begin_layout Plain Layout
1392 the changes and restart LyX.
1395 \begin_layout Section
1399 \begin_layout Standard
1400 LyX has a powerful mechanism to convert to and from any file format using
1405 \begin_layout Subsection
1406 \begin_inset CommandInset label
1415 \begin_layout Standard
1416 The first step is to define your file formats if they are not already defined.
1418 \begin_inset Flex CharStyle:MenuItem
1421 \begin_layout Plain Layout
1422 Tools\SpecialChar \menuseparator
1423 Preferences\SpecialChar \menuseparator
1424 File Handling\SpecialChar \menuseparator
1432 \begin_inset Flex CharStyle:MenuItem
1435 \begin_layout Plain Layout
1436 New\SpecialChar \ldots{}
1442 button to define your new format.
1444 \begin_inset Flex CharStyle:MenuItem
1447 \begin_layout Plain Layout
1453 field contains the named used to identify the format in the GUI.
1455 \begin_inset Flex CharStyle:MenuItem
1458 \begin_layout Plain Layout
1464 is used to identify the format interally.
1465 You will also need to enter a file extension.
1466 These are all required.
1468 \begin_inset Flex CharStyle:MenuItem
1471 \begin_layout Plain Layout
1477 field is used to provide a keyboard shortcut on the menus.
1478 (For example, pressing
1479 \begin_inset Flex CharStyle:MenuItem
1482 \begin_layout Plain Layout
1489 \begin_inset Flex CharStyle:MenuItem
1492 \begin_layout Plain Layout
1493 View\SpecialChar \menuseparator
1502 \begin_layout Standard
1504 \begin_inset Flex CharStyle:MenuItem
1507 \begin_layout Plain Layout
1514 \begin_inset Flex CharStyle:MenuItem
1517 \begin_layout Plain Layout
1524 For example, you might want to use
1525 \begin_inset Flex CharStyle:MenuItem
1528 \begin_layout Plain Layout
1534 to view PostScript files.
1535 You can enter the command needed to start the program in the corresponding
1537 In defining this command, you can use the four variables listed in the
1539 The viewer is launched when you view an image in LyX or use the
1540 \begin_inset Flex CharStyle:MenuItem
1543 \begin_layout Plain Layout
1550 The editor is for example launched when you press the
1551 \begin_inset Flex CharStyle:MenuItem
1554 \begin_layout Plain Layout
1561 \begin_inset Flex CharStyle:MenuItem
1564 \begin_layout Plain Layout
1571 \begin_inset Flex CharStyle:MenuItem
1574 \begin_layout Plain Layout
1583 \begin_layout Standard
1585 \begin_inset Flex CharStyle:MenuItem
1588 \begin_layout Plain Layout
1594 option tells LyX that a format is suitable for document export.
1595 If this is is set and if a suitable conversion route exists (see
1596 \begin_inset CommandInset ref
1598 reference "sub:Converters"
1602 ), the format will appear in the
1603 \begin_inset Flex CharStyle:MenuItem
1606 \begin_layout Plain Layout
1607 File\SpecialChar \menuseparator
1614 The format will also appear in the
1615 \begin_inset Flex CharStyle:MenuItem
1618 \begin_layout Plain Layout
1624 menu if a viewer is specified for the format.
1625 Pure image formats, such as
1626 \begin_inset Flex CharStyle:Code
1629 \begin_layout Plain Layout
1635 , should not use this option.
1636 Formats that can both represent vector graphics and documents like
1637 \begin_inset Flex CharStyle:Code
1640 \begin_layout Plain Layout
1649 \begin_layout Standard
1651 \begin_inset Flex CharStyle:MenuItem
1654 \begin_layout Plain Layout
1655 Vector graphics format
1660 tells LyX that a format can contain vector graphics.
1661 This information is used to determine the target format of included graphics
1663 \begin_inset Flex CharStyle:MenuItem
1666 \begin_layout Plain Layout
1673 Included graphics may need to be converted to either
1674 \begin_inset Flex CharStyle:MenuItem
1677 \begin_layout Plain Layout
1684 \begin_inset Flex CharStyle:MenuItem
1687 \begin_layout Plain Layout
1694 \begin_inset Flex CharStyle:MenuItem
1697 \begin_layout Plain Layout
1704 \begin_inset Flex CharStyle:MenuItem
1707 \begin_layout Plain Layout
1713 cannot handle other image formats.
1714 If an included graphic is not already in
1715 \begin_inset Flex CharStyle:MenuItem
1718 \begin_layout Plain Layout
1725 \begin_inset Flex CharStyle:MenuItem
1728 \begin_layout Plain Layout
1735 \begin_inset Flex CharStyle:MenuItem
1738 \begin_layout Plain Layout
1744 format, it is converted to
1745 \begin_inset Flex CharStyle:MenuItem
1748 \begin_layout Plain Layout
1754 if the vector format option is set, and otherwise to
1755 \begin_inset Flex CharStyle:MenuItem
1758 \begin_layout Plain Layout
1767 \begin_layout Subsection
1771 \begin_layout Standard
1772 Since all conversions from one format to another take place in LyX's temporary
1773 directory, it is sometimes necessary to modify a file before copying it
1774 to the temporary directory in order that the conversion may be performed.
1778 \begin_layout Plain Layout
1779 For example, the file may refer to other files---images, for example---using
1780 relative file names, and these may become invalid when the file is copied
1781 to the temporary directory.
1786 This is done by a Copier: It copies a file to (or from) the temporary directory
1787 and may modify it in the process.
1790 \begin_layout Standard
1791 The definitions of the copiers may use four variables:
1794 \begin_layout Labeling
1795 \labelwidthstring 00.00.0000
1796 \begin_inset Flex CharStyle:Code
1799 \begin_layout Plain Layout
1805 The LyX system directory (e.g.
1806 \begin_inset space \space{}
1810 \begin_inset Flex CharStyle:MenuItem
1813 \begin_layout Plain Layout
1822 \begin_layout Labeling
1823 \labelwidthstring 00.00.0000
1824 \begin_inset Flex CharStyle:Code
1827 \begin_layout Plain Layout
1836 \begin_layout Labeling
1837 \labelwidthstring 00.00.0000
1838 \begin_inset Flex CharStyle:Code
1841 \begin_layout Plain Layout
1850 \begin_layout Labeling
1851 \labelwidthstring 00.00.0000
1852 \begin_inset Flex CharStyle:Code
1855 \begin_layout Plain Layout
1864 \begin_layout Standard
1865 The latter should be the filename as it would be used in a LaTeX's
1872 It is relevant only when exporting files suitable for such inclusion.
1875 \begin_layout Standard
1876 Copiers can be used to do almost anything with output files.
1877 For example, suppose you want generated pdf files to be copied to a special
1879 \begin_inset Flex CharStyle:Code
1882 \begin_layout Plain Layout
1889 Then you could write a shell script such as this one:
1892 \begin_layout Standard
1893 \begin_inset listings
1897 \begin_layout Plain Layout
1902 \begin_layout Plain Layout
1907 \begin_layout Plain Layout
1909 TOFILE=`basename $2`
1912 \begin_layout Plain Layout
1914 cp $FROMFILE /home/you/pdf/$TOFILE
1919 Save that in your local LyX directory---say,
1920 \begin_inset Flex CharStyle:Code
1923 \begin_layout Plain Layout
1924 /home/you/.lyx/scripts/pdfcopier.sh
1929 ---and make it executable, if you need to do so on your platform.
1931 \begin_inset Flex CharStyle:MenuItem
1934 \begin_layout Plain Layout
1935 Tools\SpecialChar \menuseparator
1942 \begin_inset Flex CharStyle:MenuItem
1945 \begin_layout Plain Layout
1951 format---or one of the other pdf formats---and enter
1952 \begin_inset Flex CharStyle:Code
1955 \begin_layout Plain Layout
1956 pdfcopier.sh $$i $$o
1962 \begin_inset Flex CharStyle:MenuItem
1965 \begin_layout Plain Layout
1975 \begin_layout Standard
1976 Copiers are used by LyX in various of its own conversions.
1977 For example, if appropriate programs are found, LyX will automatically
1978 install copiers for the
1979 \begin_inset Flex CharStyle:MenuItem
1982 \begin_layout Plain Layout
1989 \begin_inset Flex CharStyle:MenuItem
1992 \begin_layout Plain Layout
1994 \begin_inset space ~
2003 When these formats are exported, the copier sees that not just the main
2004 HTML file but various associated files (style files, images, etc.) are also
2006 All these files are written to a subdirectory of the directory in which
2007 the original LyX file was found.
2011 \begin_layout Plain Layout
2012 This copier can be customized.
2014 \begin_inset Quotes eld
2018 \begin_inset Quotes erd
2021 argument takes a comma-separated list of extensions to be copied; if it
2022 is omitted, all files will be copied.
2024 \begin_inset Quotes eld
2028 \begin_inset Quotes erd
2031 argument determines the extension added to the generated directory.
2033 \begin_inset Quotes eld
2037 \begin_inset Flex CharStyle:MenuItem
2040 \begin_layout Plain Layout
2047 \begin_inset Quotes erd
2050 , so HTML generated from
2051 \begin_inset Flex CharStyle:MenuItem
2054 \begin_layout Plain Layout
2055 /path/to/filename.lyx
2061 \begin_inset Flex CharStyle:MenuItem
2064 \begin_layout Plain Layout
2065 /path/to/filename.html.LyXconv
2079 \begin_layout Subsection
2080 \begin_inset CommandInset label
2082 name "sub:Converters"
2089 \begin_layout Standard
2090 You can define your own Converters to, uhh, convert files between different
2093 \begin_inset Flex CharStyle:MenuItem
2096 \begin_layout Plain Layout
2097 Tools\SpecialChar \menuseparator
2098 Preferences\SpecialChar \menuseparator
2099 File Handling\SpecialChar \menuseparator
2108 \begin_layout Standard
2109 To define a new converter, select the
2110 \begin_inset Flex CharStyle:MenuItem
2113 \begin_layout Plain Layout
2115 \begin_inset space ~
2124 \begin_inset Flex CharStyle:MenuItem
2127 \begin_layout Plain Layout
2129 \begin_inset space ~
2137 from the drop-down lists, enter the command needed for the conversion,
2139 \begin_inset Flex CharStyle:MenuItem
2142 \begin_layout Plain Layout
2149 Several variables can be used in the definition of converters:
2152 \begin_layout Labeling
2153 \labelwidthstring 00.00.0000
2154 \begin_inset Flex CharStyle:Code
2157 \begin_layout Plain Layout
2163 The LyX system directory
2166 \begin_layout Labeling
2167 \labelwidthstring 00.00.0000
2168 \begin_inset Flex CharStyle:Code
2171 \begin_layout Plain Layout
2180 \begin_layout Labeling
2181 \labelwidthstring 00.00.0000
2182 \begin_inset Flex CharStyle:Code
2185 \begin_layout Plain Layout
2194 \begin_layout Labeling
2195 \labelwidthstring 00.00.0000
2196 \begin_inset Flex CharStyle:Code
2199 \begin_layout Plain Layout
2205 The base filename of the input file (i.e., without the extension)
2208 \begin_layout Labeling
2209 \labelwidthstring 00.00.0000
2210 \begin_inset Flex CharStyle:Code
2213 \begin_layout Plain Layout
2219 The path to the input file
2222 \begin_layout Standard
2224 \begin_inset Flex CharStyle:MenuItem
2227 \begin_layout Plain Layout
2229 \begin_inset space ~
2237 field you can enter the following flags, separated by commas:
2240 \begin_layout Labeling
2241 \labelwidthstring 00.00.0000
2242 \begin_inset Flex CharStyle:Code
2245 \begin_layout Plain Layout
2251 This converter runs some form of LaTeX.
2252 This will make LyX's LaTeX error logs available.
2255 \begin_layout Labeling
2256 \labelwidthstring 00.00.0000
2257 \begin_inset Flex CharStyle:Code
2260 \begin_layout Plain Layout
2267 \begin_inset Flex CharStyle:MenuItem
2270 \begin_layout Plain Layout
2276 file for the conversion.
2279 \begin_layout Labeling
2280 \labelwidthstring 00.00.0000
2281 \begin_inset Flex CharStyle:Code
2284 \begin_layout Plain Layout
2293 \begin_layout Standard
2294 The following three flags are not really flags at all because they take
2296 \begin_inset Flex CharStyle:MenuItem
2299 \begin_layout Plain Layout
2301 \begin_inset space ~
2305 \begin_inset space ~
2316 \begin_layout Labeling
2317 \labelwidthstring 00.00.0000
2318 \begin_inset Flex CharStyle:Code
2321 \begin_layout Plain Layout
2327 If set, the converter's standard error will be redirected to a file
2328 \begin_inset Flex CharStyle:Code
2331 \begin_layout Plain Layout
2337 , and the script given as argument will be run as:
2338 \begin_inset Flex CharStyle:Code
2341 \begin_layout Plain Layout
2342 script <infile.out >infile.log
2348 The argument may contain
2349 \begin_inset Flex CharStyle:Code
2352 \begin_layout Plain Layout
2361 \begin_layout Labeling
2362 \labelwidthstring 00.00.0000
2363 \begin_inset Flex CharStyle:Code
2366 \begin_layout Plain Layout
2372 The name of the directory in which the converter will dump the generated
2374 LyX will not create this directory, and it does not copy anything into
2375 it, though it will copy this directory to the destination.
2376 The argument may contain
2377 \begin_inset Flex CharStyle:Code
2380 \begin_layout Plain Layout
2386 , which will be replaced by the base name of the input and output files,
2387 respectively, when the directory is copied.
2388 \begin_inset Newline newline
2391 Note that resultdir and usetempdir make no sense together.
2392 The latter will be ignored if the former is given.
2395 \begin_layout Labeling
2396 \labelwidthstring 00.00.0000
2397 \begin_inset Flex CharStyle:Code
2400 \begin_layout Plain Layout
2406 Determines the output file name and may, contain
2407 \begin_inset Flex CharStyle:Code
2410 \begin_layout Plain Layout
2417 Sensible only with resultdir and optional even then; if not given, it defaults
2421 \begin_layout Standard
2422 None of these last three are presently used in any of the converters that
2423 are installed with LyX.
2427 \begin_layout Standard
2428 You do not have to define converters between all the formats between which
2429 you want to convert.
2430 For example, you will note that there is no `LyX to PostScript®' converter,
2431 but LyX will export PostScript®.
2432 It does so by first creating a LaTeX file (no converter needs to be defined
2433 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2434 and finally converting the resulting DVI file to PostScript®.
2435 LyX finds such `chains' of converters automatically, and it will always
2436 choose the shortest possible chain.
2437 You can, though, still define multiple conversion methods between file
2439 For example, the standard LyX configuration provides three ways to convert
2440 LaTeX to PDF: Directly, using
2441 \begin_inset Flex CharStyle:MenuItem
2444 \begin_layout Plain Layout
2450 ; via (DVI and) PostScript®, using
2451 \begin_inset Flex CharStyle:MenuItem
2454 \begin_layout Plain Layout
2461 \begin_inset Flex CharStyle:MenuItem
2464 \begin_layout Plain Layout
2471 To define such alternate chains, you must define multiple target `file
2472 formats', as described in section
2473 \begin_inset CommandInset ref
2475 reference "sub:Formats"
2480 For example, in the standard configuration, the formats named
2481 \begin_inset Flex CharStyle:MenuItem
2484 \begin_layout Plain Layout
2491 \begin_inset Flex CharStyle:MenuItem
2494 \begin_layout Plain Layout
2501 \begin_inset Flex CharStyle:MenuItem
2504 \begin_layout Plain Layout
2510 are defined, all of which share the extension
2511 \begin_inset Flex CharStyle:MenuItem
2514 \begin_layout Plain Layout
2520 , and which correspond to the conversion methods just mentioned.
2523 \begin_layout Chapter
2524 Internationalizing LyX
2525 \begin_inset CommandInset label
2534 \begin_layout Standard
2535 LyX supports using a translated interface.
2536 Last time we checked, LyX provided text in thirty languages.
2537 The language of choice is called your
2542 (For further reading on locale settings, see also the documentation for
2543 locale that comes with your operating system.
2544 For Linux, the manual page for
2545 \begin_inset Flex CharStyle:Code
2548 \begin_layout Plain Layout
2554 could be a good place to start).
2557 \begin_layout Standard
2558 Notice that these translations will work, but do contain a few flaws.
2559 In particular, all dialogs have been designed with the English text in
2560 mind, which means that some of the translated text will be too large to
2561 fit within the space allocated.
2562 This is only a display problem and will not cause any harm.
2563 Also, you will find that some of the translations do not define shortcut
2564 keys for everything.
2565 Sometimes, there are simply not enough free letters to do it.
2566 Other times, the translator just hasn't got around to doing it yet.
2567 Our localization team, which you may wish to join,
2571 \begin_layout Plain Layout
2572 If you are a fluent speaker of a language other than English, joining these
2573 teams is a great way to give back to the LyX community!
2578 will of course try to fix these shortcomings in future versions of LyX.
2581 \begin_layout Section
2585 \begin_layout Subsection
2586 Translating the graphical user interface (text messages).
2589 \begin_layout Standard
2591 \begin_inset Flex CharStyle:Code
2594 \begin_layout Plain Layout
2600 library to handle the internationalization of the interface.
2601 To have LyX speak your favorite language in all menus and dialogs, you
2603 \begin_inset Flex CharStyle:Code
2606 \begin_layout Plain Layout
2612 -file for that language.
2613 When this is available, you'll have to generate a
2614 \begin_inset Flex CharStyle:Code
2617 \begin_layout Plain Layout
2623 -file from it and install the
2624 \begin_inset Flex CharStyle:Code
2627 \begin_layout Plain Layout
2634 The process of doing all of this is explained in the documentation for
2636 \begin_inset Flex CharStyle:Code
2639 \begin_layout Plain Layout
2646 It is possible to do this just for yourself, but if you're going to do
2647 it, you might as well share the results of your labors with the rest of
2649 Send a message to the LyX developers' list for more information about how
2653 \begin_layout Standard
2654 In short, this is what you should do (xx denotes the language code):
2657 \begin_layout Itemize
2658 Check out the LyX source code.
2660 \begin_inset CommandInset href
2662 name "information on the web"
2663 target "http://www.lyx.org/devel/cvs.php"
2670 \begin_layout Itemize
2672 \begin_inset Flex CharStyle:Code
2675 \begin_layout Plain Layout
2681 to the folder of the
2682 \begin_inset Flex CharStyle:Code
2685 \begin_layout Plain Layout
2693 \begin_inset Flex CharStyle:Code
2696 \begin_layout Plain Layout
2704 \begin_inset Flex CharStyle:Code
2707 \begin_layout Plain Layout
2713 doesn't exist anywhere, it can be remade with the console command
2714 \begin_inset Flex CharStyle:Code
2717 \begin_layout Plain Layout
2723 in that directory, or you can use an existing po-file for some other language
2727 \begin_layout Itemize
2729 \begin_inset Flex CharStyle:Code
2732 \begin_layout Plain Layout
2742 \begin_layout Plain Layout
2743 This is just a text file, so it can be edited in any text editor.
2744 But there are also specialized programs that support such editing, such
2749 (for all platforms) or
2758 contains a `mode' for editing
2759 \begin_inset Flex CharStyle:Code
2762 \begin_layout Plain Layout
2773 For some menu- and widget-labels, there are also shortcut keys that should
2775 Those keys are marked after a `|', and should be translated according to
2776 the words and phrases of the language.
2777 You should also fill also out the information at the beginning of the new
2779 \begin_inset Flex CharStyle:Code
2782 \begin_layout Plain Layout
2788 -file with your email-address, etc., so people know where to reach you with
2789 suggestions and entertaining flames.
2792 \begin_layout Standard
2793 If you are just doing this on your own, then:
2796 \begin_layout Itemize
2798 \begin_inset Flex CharStyle:Code
2801 \begin_layout Plain Layout
2808 This can be done with
2809 \begin_inset Flex CharStyle:Code
2812 \begin_layout Plain Layout
2813 msgfmt -o xx.mo < xx.po
2821 \begin_layout Itemize
2823 \begin_inset Flex CharStyle:Code
2826 \begin_layout Plain Layout
2832 -file to your locale-tree, at the correct directory for application messages
2837 xx, and under the name
2838 \begin_inset Flex CharStyle:Code
2841 \begin_layout Plain Layout
2848 \begin_inset space \space{}
2852 \begin_inset Flex CharStyle:Code
2855 \begin_layout Plain Layout
2856 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2866 \begin_layout Standard
2867 As said, however, it would be best if the new
2868 \begin_inset Flex CharStyle:Code
2871 \begin_layout Plain Layout
2877 -file could be added to the LyX distribution, so others can use it.
2878 Adding it involves making additional changes to LyX.
2879 So send an email to the developers' mailing list if you're interested in
2883 \begin_layout Subsubsection
2887 \begin_layout Standard
2888 Sometimes it turns out that one English message needs to be translated into
2889 different messages in the target language.
2890 One example is the message
2891 \begin_inset Flex CharStyle:Code
2894 \begin_layout Plain Layout
2900 which has the German translation
2908 , depending upon exactly what the English
2909 \begin_inset Quotes eld
2913 \begin_inset Quotes erd
2918 \begin_inset Flex CharStyle:Code
2921 \begin_layout Plain Layout
2927 does not handle such ambigous translations.
2928 Therefore you have to add some context information to the message: Instead
2930 \begin_inset Flex CharStyle:Code
2933 \begin_layout Plain Layout
2940 \begin_inset Flex CharStyle:Code
2943 \begin_layout Plain Layout
2944 To[[as in 'From format x to format y']]
2950 \begin_inset Flex CharStyle:Code
2953 \begin_layout Plain Layout
2954 To[[as in 'From page x to page y']].
2959 Now the two occurences of
2960 \begin_inset Flex CharStyle:Code
2963 \begin_layout Plain Layout
2970 \begin_inset Flex CharStyle:Code
2973 \begin_layout Plain Layout
2979 and can be translated correctly to
2990 \begin_layout Standard
2991 Of course the context information needs to be stripped off the original
2992 message when no translation is used.
2993 Therefore you have to put it in double square brackets at the end of the
2994 message (see the example above).
2995 The translation mechanism of LyX ensures that everything in double square
2996 brackets at the end of messages is removed before displaying the message.
2999 \begin_layout Subsection
3000 Translating the documentation.
3003 \begin_layout Standard
3004 The online documentation (in the
3005 \begin_inset Flex CharStyle:MenuItem
3008 \begin_layout Plain Layout
3018 -menu) can (and should!) be translated.
3019 If there are translated versions of the documentation available
3023 \begin_layout Plain Layout
3024 As of March 2008, at least some of the documents have been translated into
3025 fourteen languages, with the Tutorial available in a few more.
3030 and the locale is set accordingly, these will be used automagically by
3032 LyX looks for translated versions as
3033 \begin_inset Flex CharStyle:Code
3036 \begin_layout Plain Layout
3037 LyXDir/doc/xx_DocName.lyx
3043 \begin_inset Flex CharStyle:Code
3046 \begin_layout Plain Layout
3052 is the code for the language currently in use.
3053 If there are no translated documents, the default English versions will
3055 Note that the translated versions must have the same filenames (
3056 \begin_inset Flex CharStyle:Code
3059 \begin_layout Plain Layout
3065 above) as the original.
3066 If you feel up to translating the documentation (an excellent way to proof-read
3067 the original documentation by the way!), there are a few things you should
3071 \begin_layout Itemize
3073 \begin_inset Flex CharStyle:Code
3076 \begin_layout Plain Layout
3082 , the guide to writing LyX documentation.
3083 Pay special attention to the translator's section.
3086 \begin_layout Itemize
3087 Check out the documentation translation web page at
3088 \begin_inset CommandInset href
3090 name "http://www.lyx.org/Translation"
3091 target "http://www.lyx.org/Translation"
3096 That way, you can find out which (if any) documents have already been translate
3097 d into your language.
3098 You can also find out who (if anyone) is organizing the effort to translate
3099 the documentation into your language.
3100 If no one is organizing the effort, please let us know that you're interested.
3103 \begin_layout Standard
3104 Once you get to actually translating, here's a few hints for you that may
3108 \begin_layout Itemize
3109 Join the documentation team! There is information on how to do that in
3110 \begin_inset Flex CharStyle:Code
3113 \begin_layout Plain Layout
3120 \begin_inset Flex CharStyle:MenuItem
3123 \begin_layout Plain Layout
3128 elp\SpecialChar \menuseparator
3138 ), which by the way is the first document you should translate.
3141 \begin_layout Itemize
3142 Learn the typographic conventions for the language you are translating to.
3143 Typography is an ancient art and over the centuries, a great variety of
3144 conventions have developed throughout different parts of the world.
3145 Also study the professional terminology amongst typographers in your country.
3146 Inventing your own terminology will only confuse the users.
3149 (Warning! Typography is addictive!)
3152 \begin_layout Itemize
3153 Make a copy of the document.
3154 This will be your working copy.
3155 You can use this as your personal translated help-file by placing it in
3157 \begin_inset Flex CharStyle:Code
3160 \begin_layout Plain Layout
3169 \begin_layout Itemize
3170 Sometimes the original document (from the LyX-team) will be updated.
3171 Use the source viewer at
3172 \begin_inset CommandInset href
3174 name "http://www.lyx.org/trac/timeline"
3175 target "http://www.lyx.org/trac/timeline"
3179 to see what has been changed.
3180 That way you can easily see which parts of the translated document need
3184 \begin_layout Standard
3185 If you ever find an error in the original document, fix it and notify the
3186 rest of the documentation team of the changes! (You didn't forget to join
3187 the documentation team, did you?)
3190 \begin_layout Standard
3191 \begin_inset Branch OutDated
3194 \begin_layout Section
3195 International Keyboard Support
3198 \begin_layout Standard
3201 [Editor's Note: The following section is by
3209 It needs to be fixed to conform to the new Documentation Style sheet and
3210 to make use of the new v1.0 features.
3211 The whole thing also needs to be merged with the section following it.-jw
3212 It may also be badly out of date.-rh (2008)]
3215 \begin_layout Subsection
3216 Defining Own Keymaps: Keymap File Format
3219 \begin_layout Standard
3220 Let's look at a keyboard definition file a little closer.
3221 It is a plain text file defining
3224 \begin_layout Itemize
3225 key-to-key or key-to-string translations
3228 \begin_layout Itemize
3232 \begin_layout Itemize
3233 dead keys exceptions
3236 \begin_layout Standard
3237 To define key-to-key or key-to-string translation, use this command:
3240 \begin_layout Quotation
3241 \begin_inset Flex CharStyle:Code
3244 \begin_layout Plain Layout
3253 \begin_inset Flex CharStyle:Code
3256 \begin_layout Plain Layout
3265 \begin_layout Standard
3267 \begin_inset Flex CharStyle:Code
3270 \begin_layout Plain Layout
3276 is the key to be translated and
3277 \begin_inset Flex CharStyle:Code
3280 \begin_layout Plain Layout
3286 is the string to be inserted into the document.
3287 To define dead keys, use:
3290 \begin_layout Quotation
3291 \begin_inset Flex CharStyle:Code
3294 \begin_layout Plain Layout
3303 \begin_inset Flex CharStyle:Code
3306 \begin_layout Plain Layout
3315 \begin_layout Standard
3317 \begin_inset Flex CharStyle:Code
3320 \begin_layout Plain Layout
3326 is a keyboard key and
3327 \begin_inset Flex CharStyle:Code
3330 \begin_layout Plain Layout
3337 The following dead keys are supported (shortcut name is in parentheses):
3340 \begin_layout Quotation
3344 \begin_inset space \hfill{}
3350 \begin_layout Quotation
3352 \begin_inset space \hfill{}
3358 \begin_layout Quotation
3360 \begin_inset space \hfill{}
3366 \begin_layout Quotation
3368 \begin_inset space \hfill{}
3374 \begin_layout Quotation
3376 \begin_inset space \hfill{}
3382 \begin_layout Quotation
3384 \begin_inset space \hfill{}
3391 \begin_layout Plain Layout
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{}
3448 \begin_layout Quotation
3450 \begin_inset space \hfill{}
3457 \begin_layout Plain Layout
3469 \begin_layout Quotation
3471 \begin_inset space \hfill{}
3478 \begin_layout Plain Layout
3490 \begin_layout Quotation
3492 \begin_inset space \hfill{}
3498 \begin_layout Quotation
3499 hungarian umlaut (hug)
3500 \begin_inset space \hfill{}
3506 \begin_layout Quotation
3508 \begin_inset space \hfill{}
3514 \begin_layout Quotation
3516 \begin_inset space \hfill{}
3523 \begin_layout Plain Layout
3535 \begin_layout Standard
3536 Since in many international keyboards there are exceptions to what some
3537 dead keys should do, you can define them using
3540 \begin_layout Quotation
3541 \begin_inset Flex CharStyle:Code
3544 \begin_layout Plain Layout
3552 deadkey key outstring
3555 \begin_layout Standard
3556 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3560 \begin_layout Quotation
3561 \begin_inset Flex CharStyle:Code
3564 \begin_layout Plain Layout
3577 \begin_layout Standard
3578 to make it work correctly.
3579 Also, you have to define as exceptions dead keys over i and j, to remove
3580 the dot from them before inserting an accent mark.
3581 I will change this when the time comes, but so far I haven't had time.
3584 \begin_layout Standard
3585 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3588 \begin_inset Flex CharStyle:Code
3591 \begin_layout Plain Layout
3597 have different meaning.
3599 \begin_inset Flex CharStyle:Code
3602 \begin_layout Plain Layout
3608 marks comments, quotes start and end LaTeX-style commands.
3609 To enter quote, you'll need to use
3610 \begin_inset Flex CharStyle:Code
3613 \begin_layout Plain Layout
3622 \begin_inset Flex CharStyle:Code
3625 \begin_layout Plain Layout
3632 \begin_inset Flex CharStyle:Code
3635 \begin_layout Plain Layout
3646 \begin_layout Standard
3647 If you make a keyboard description file that works for your language, please
3648 mail it to me, so I can include it in the next keymap distribution.
3651 \begin_layout Standard
3652 More keywords will be supported in keymap configuration file in future,
3656 \begin_layout Itemize
3657 \begin_inset Flex CharStyle:Code
3660 \begin_layout Plain Layout
3671 \begin_inset space \hfill{}
3675 \begin_inset Flex CharStyle:Code
3678 \begin_layout Plain Layout
3687 \begin_layout Itemize
3688 \begin_inset Flex CharStyle:Code
3691 \begin_layout Plain Layout
3702 \begin_inset space \hfill{}
3706 \begin_inset Flex CharStyle:Code
3709 \begin_layout Plain Layout
3715 an external keymap translation program
3718 \begin_layout Standard
3719 Also, it should look into
3720 \begin_inset Flex CharStyle:Code
3723 \begin_layout Plain Layout
3729 file for defaults, too (for example, a
3730 \begin_inset Flex CharStyle:Code
3733 \begin_layout Plain Layout
3741 option to include default keyboard).
3749 \begin_layout Section
3750 \begin_inset CommandInset label
3756 International Keymap Stuff
3759 \begin_layout Standard
3760 \begin_inset Note Note
3763 \begin_layout Plain Layout
3764 In doing the revisions on this document in March 2008, I did not look over
3765 this stuff, as I do not understand it.
3766 It would be good if someone else could do so.
3774 \begin_layout Standard
3775 The next two sections describe the
3776 \begin_inset Flex CharStyle:Code
3779 \begin_layout Plain Layout
3788 \begin_inset Flex CharStyle:Code
3791 \begin_layout Plain Layout
3799 file syntax in detail.
3800 These sections should help you design your own key map if the ones provided
3801 do not meet your needs.
3804 \begin_layout Subsection
3808 \begin_layout Standard
3812 \begin_inset Flex CharStyle:Code
3815 \begin_layout Plain Layout
3821 file maps keystrokes to characters or strings.
3822 As the name suggests, it sets a keyboard mapping.
3824 \begin_inset Flex CharStyle:Code
3827 \begin_layout Plain Layout
3838 \begin_inset Flex CharStyle:Code
3841 \begin_layout Plain Layout
3856 \begin_inset Flex CharStyle:Code
3859 \begin_layout Plain Layout
3872 \begin_inset Flex CharStyle:Code
3875 \begin_layout Plain Layout
3884 \begin_inset Flex CharStyle:Code
3887 \begin_layout Plain Layout
3895 are described in this section.
3898 \begin_layout Labeling
3899 \labelwidthstring 00.00.0000
3900 \begin_inset Flex CharStyle:Code
3903 \begin_layout Plain Layout
3911 Map a character to a string
3914 \begin_layout LyX-Code
3929 \begin_layout Standard
3962 the double-quote (")
3979 must be escaped with a preceding backslash (
3990 \begin_layout Standard
3992 \begin_inset Flex CharStyle:MenuItem
3995 \begin_layout Plain Layout
4003 statement to cause the symbol
4004 \begin_inset Flex CharStyle:MenuItem
4007 \begin_layout Plain Layout
4015 to be output for the keystroke
4016 \begin_inset Flex CharStyle:MenuItem
4019 \begin_layout Plain Layout
4030 \begin_layout LyX-Code
4036 \begin_layout Labeling
4037 \labelwidthstring 00.00.0000
4038 \begin_inset Flex CharStyle:Code
4041 \begin_layout Plain Layout
4049 Specify an accent character
4052 \begin_layout LyX-Code
4061 \begin_layout Standard
4062 This will make the cha
4100 This is the dead key
4104 \begin_layout Plain Layout
4111 refers to a key that does not produce a character by itself, but when followed
4112 with another key, produces the desired accent character.
4113 For example, a German characte
4115 r with an umlaut like
4125 can be produced in this manner.
4134 \begin_layout Standard
4147 and then another key not in
4164 followed by the other, unallowed key, as output.
4168 \begin_inset Flex CharStyle:MenuItem
4171 \begin_layout Plain Layout
4179 cancels a dead key, so if
4190 \begin_inset Flex CharStyle:MenuItem
4193 \begin_layout Plain Layout
4202 , the cursor will not go one position backwards but will instead cancel
4218 might have had on the next keystroke.
4222 \begin_layout Standard
4223 The following example specifies that the character ' is to be an acute accent,
4224 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4227 \begin_layout LyX-Code
4230 kmod ' acute aeiouAEIOU
4233 \begin_layout Labeling
4234 \labelwidthstring 00.00.0000
4235 \begin_inset Flex CharStyle:Code
4238 \begin_layout Plain Layout
4244 Specify an exception to the accent character
4247 \begin_layout LyX-Code
4256 \begin_layout Standard
4257 This defines an exce
4298 have been assigned a keystroke with a previous
4301 \begin_inset Flex CharStyle:Code
4304 \begin_layout Plain Layout
4328 must not belong in the
4375 If such a declaration does not exist in
4383 \begin_inset Flex CharStyle:Code
4386 \begin_layout Plain Layout
4420 \begin_inset Flex CharStyle:Code
4423 \begin_layout Plain Layout
4437 \begin_layout Standard
4438 The following command produces causes äi to be produced when you enter acute-i
4442 \begin_layout LyX-Code
4456 \begin_layout Labeling
4457 \labelwidthstring 00.00.0000
4458 \begin_inset Flex CharStyle:Code
4461 \begin_layout Plain Layout
4467 Combine two accent characters
4470 \begin_layout LyX-Code
4476 accent1 accent2 allowed
4479 \begin_layout Standard
4480 This one is getting pretty esoteric.
4481 It allows you to combine the effect
4537 \begin_inset Flex CharStyle:Code
4540 \begin_layout Plain Layout
4568 \begin_layout Standard
4569 Consider this example from the
4570 \begin_inset Flex CharStyle:Code
4573 \begin_layout Plain Layout
4584 \begin_layout LyX-Code
4587 kmod ; acute aeioyvhAEIOYVH
4591 kcomb acute umlaut iyIY
4594 \begin_layout Standard
4595 This allows you to press
4596 \begin_inset Flex CharStyle:MenuItem
4599 \begin_layout Plain Layout
4607 and get the effect of
4608 \begin_inset Flex CharStyle:Code
4611 \begin_layout Plain Layout
4630 in this case cancels the last dead key, so if you press
4631 \begin_inset Flex CharStyle:MenuItem
4634 \begin_layout Plain Layout
4643 \begin_inset Flex CharStyle:Code
4646 \begin_layout Plain Layout
4659 \begin_layout Subsection
4663 \begin_layout Standard
4665 \begin_inset Flex CharStyle:Code
4668 \begin_layout Plain Layout
4676 mapping is performed, a
4677 \begin_inset Flex CharStyle:Code
4680 \begin_layout Plain Layout
4690 file maps the strings that the symbols generate to characters in the current
4692 The LyX distribution currently includes at least the
4693 \begin_inset Flex CharStyle:Code
4696 \begin_layout Plain Layout
4705 \begin_inset Flex CharStyle:Code
4708 \begin_layout Plain Layout
4719 \begin_layout Standard
4721 \begin_inset Flex CharStyle:Code
4724 \begin_layout Plain Layout
4732 file is a sequence of declarations of the form
4735 \begin_layout LyX-Code
4748 \begin_layout Standard
4749 For example, in order to map
4750 \begin_inset Flex CharStyle:MenuItem
4753 \begin_layout Plain Layout
4763 to the corresponding character in the iso-8859-1 set (233), the following
4767 \begin_layout LyX-Code
4775 \begin_layout Standard
4777 \begin_inset Flex CharStyle:Code
4780 \begin_layout Plain Layout
4789 \begin_inset Flex CharStyle:Code
4792 \begin_layout Plain Layout
4810 the same character can apply to more than one string.
4812 \begin_inset Flex CharStyle:Code
4815 \begin_layout Plain Layout
4826 \begin_layout LyX-Code
4838 \begin_inset Newline newline
4854 \begin_layout Standard
4855 If LyX cannot find a mapping for the string produced by the keystroke or
4856 a deadkey sequence, it will check if it looks like an accented char and
4857 try to draw an accent over the character on screen.
4860 \begin_layout Subsection
4864 \begin_layout Standard
4865 There is a second way to add support for international characters through
4866 so-called dead-keys.
4867 A dead-key works in combination with a letter to produce an accented character.
4868 Here, we'll explain how to create a really simple dead-key to illustrate
4872 \begin_layout Standard
4873 Suppose you happen to need the circumflex character,
4874 \begin_inset Quotes eld
4878 \begin_inset Quotes erd
4883 \begin_inset Flex CharStyle:MenuItem
4886 \begin_layout Plain Layout
4893 \begin_inset space ~
4897 \begin_inset Flex CharStyle:MenuItem
4900 \begin_layout Plain Layout
4906 ] to the LyX command
4907 \begin_inset Flex CharStyle:Code
4910 \begin_layout Plain Layout
4917 \begin_inset Flex CharStyle:Code
4920 \begin_layout Plain Layout
4927 Now, whenever you type the
4928 \begin_inset Flex CharStyle:MenuItem
4931 \begin_layout Plain Layout
4937 -key followed by a letter, that letter will have a circumflex accent on
4939 For example, the sequence
4940 \begin_inset Quotes eld
4944 \begin_inset Flex CharStyle:MenuItem
4947 \begin_layout Plain Layout
4954 \begin_inset Quotes erd
4957 produces the letter:
4958 \begin_inset Quotes eld
4962 \begin_inset Quotes erd
4966 If you tried to type
4967 \begin_inset Quotes eld
4971 \begin_inset Flex CharStyle:MenuItem
4974 \begin_layout Plain Layout
4981 \begin_inset Quotes erd
4984 , however, LyX will complain with a beep, since a
4985 \begin_inset Quotes eld
4989 \begin_inset Flex CharStyle:MenuItem
4992 \begin_layout Plain Layout
4999 \begin_inset Quotes erd
5002 never takes a circumflex accent.
5004 \begin_inset Flex CharStyle:MenuItem
5007 \begin_layout Plain Layout
5013 after a dead-key produces the bare-accent.
5014 Please note this last point! If you bind a key to a dead-key, you'll need
5015 to rebind the character on that key to yet another key.
5017 \begin_inset Flex CharStyle:MenuItem
5020 \begin_layout Plain Layout
5026 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5029 \begin_layout Standard
5030 One common way to bind dead-keys is to use
5031 \begin_inset Flex CharStyle:MenuItem
5034 \begin_layout Plain Layout
5041 \begin_inset Flex CharStyle:MenuItem
5044 \begin_layout Plain Layout
5051 \begin_inset Flex CharStyle:MenuItem
5054 \begin_layout Plain Layout
5060 in combination with an accent, like
5061 \begin_inset Quotes eld
5065 \begin_inset Flex CharStyle:MenuItem
5068 \begin_layout Plain Layout
5075 \begin_inset Quotes erd
5079 \begin_inset Quotes eld
5083 \begin_inset Flex CharStyle:MenuItem
5086 \begin_layout Plain Layout
5093 \begin_inset Quotes erd
5097 \begin_inset Quotes eld
5101 \begin_inset Flex CharStyle:MenuItem
5104 \begin_layout Plain Layout
5111 \begin_inset Quotes erd
5115 Another way involves using
5116 \begin_inset Flex CharStyle:Code
5119 \begin_layout Plain Layout
5126 \begin_inset Flex CharStyle:Code
5129 \begin_layout Plain Layout
5135 to set up the special
5136 \begin_inset Flex CharStyle:Code
5139 \begin_layout Plain Layout
5147 \begin_inset Flex CharStyle:Code
5150 \begin_layout Plain Layout
5156 acts in some ways just like
5157 \begin_inset Flex CharStyle:MenuItem
5160 \begin_layout Plain Layout
5166 and permits you to bind keys to accented characters.
5167 You can also turn keys into dead-keys by binding them to something like
5169 \begin_inset Flex CharStyle:Code
5172 \begin_layout Plain Layout
5178 and then binding this symbolic key to the corresponding LyX command.
5182 \begin_layout Plain Layout
5187 : This is exactly what I do in my
5188 \begin_inset Flex CharStyle:Code
5191 \begin_layout Plain Layout
5198 \begin_inset Flex CharStyle:Code
5201 \begin_layout Plain Layout
5209 \begin_inset Flex CharStyle:MenuItem
5212 \begin_layout Plain Layout
5214 \begin_inset space ~
5223 \begin_inset Flex CharStyle:Code
5226 \begin_layout Plain Layout
5232 and a bunch of these
5233 \begin_inset Quotes eld
5237 \begin_inset Flex CharStyle:Code
5240 \begin_layout Plain Layout
5247 \begin_inset Quotes erd
5250 symbolic keys bound such things as
5251 \begin_inset Flex CharStyle:MenuItem
5254 \begin_layout Plain Layout
5256 \begin_inset space ~
5265 \begin_inset Flex CharStyle:MenuItem
5268 \begin_layout Plain Layout
5270 \begin_inset space ~
5279 This is how I produce my accented characters.
5284 You can make just about anything into the
5285 \begin_inset Flex CharStyle:Code
5288 \begin_layout Plain Layout
5295 \begin_inset Flex CharStyle:MenuItem
5298 \begin_layout Plain Layout
5304 keys, a spare function key, etc.
5305 As for the LyX commands that produce accents, check the entry for
5306 \begin_inset Flex CharStyle:Code
5309 \begin_layout Plain Layout
5320 You'll find the complete list there.
5323 \begin_layout Subsection
5324 Saving your Language Configuration
5327 \begin_layout Standard
5328 You can edit your preferences so that your desired language environment
5329 is automatically configured when LyX starts up, via the
5330 \begin_inset Flex CharStyle:MenuItem
5333 \begin_layout Plain Layout
5334 Edit\SpecialChar \menuseparator
5343 \begin_layout Chapter
5344 Installing New Document Classes, Layouts, and Templates
5345 \begin_inset CommandInset label
5347 name "chap:textclass"
5355 \begin_layout Plain Layout
5356 Installing New Document Classes
5364 \begin_layout Standard
5365 In this chapter, we describe the procedures for creating and installing
5366 new LyX layout and template files, as well as offer a refresher on correctly
5367 installing new LaTeX document classes.
5368 Some definitions: a document class is a LaTeX file (usually ending in
5369 \begin_inset Flex CharStyle:Code
5372 \begin_layout Plain Layout
5379 \begin_inset Flex CharStyle:Code
5382 \begin_layout Plain Layout
5388 ) that describes the format of a document such as an article, report, journal
5389 preprint, etc, and all the commands needed to realize that format.
5390 A layout file is a LyX file that corresponds to a LaTeX document class
5391 and that tells LyX how to
5392 \begin_inset Quotes eld
5396 \begin_inset Quotes erd
5399 things on the screen to make the display look something like the final
5401 More precisely, a layout file describes a
5402 \begin_inset Quotes eld
5406 \begin_inset Quotes erd
5409 which is the internal construct LyX uses to render the screen display.
5411 \begin_inset Quotes eld
5415 \begin_inset Quotes erd
5419 \begin_inset Quotes eld
5423 \begin_inset Quotes erd
5426 can be used somewhat interchangeably, but it is better to refer to the
5427 file as the layout, and the thing living in LyX's memory as the text class.
5428 A template file is simply a LyX document that contains a set of predefined
5429 entries for a given document class---entries that are generally required
5431 Templates are especially useful for things like journal manuscripts that
5432 are to be submitted electronically.
5435 \begin_layout Section
5436 Installing a new LaTeX package
5439 \begin_layout Standard
5440 Some installations may not include a LaTeX package that you would like to
5442 For example, you might need FoilTeX, a package for preparing slides or
5443 viewgraphs for overhead projectors.
5444 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5445 a user interface for that.
5446 For example on MiKTeX you start its program
5447 \begin_inset Quotes eld
5451 \begin_inset Quotes erd
5454 to get a list of available packages.
5455 To install one, right click on it or use the installing toolbar button.
5456 When the package you want to install is not in the list, but you have it
5458 \begin_inset Flex CharStyle:Code
5461 \begin_layout Plain Layout
5468 \begin_inset Flex CharStyle:Code
5471 \begin_layout Plain Layout
5477 -file, then copy these files to a subfolder of your LaTeX distribution,
5478 for example to the folder
5487 Then update the file name database of your LaTeX-distribution.
5488 For example on MiKTeX this is done by pressing the button
5491 \begin_inset space ~
5496 that you find in MiKTeX's
5497 \begin_inset Quotes eld
5501 \begin_inset Quotes erd
5505 In both cases you need afterwards to reconfigure LyX using the menu
5506 \begin_inset Flex CharStyle:MenuItem
5509 \begin_layout Plain Layout
5510 Tools\SpecialChar \menuseparator
5516 and then to restart LyX.
5519 \begin_layout Standard
5520 If your LaTeX distribution doesn't provide a user interface, then you can
5521 follow these steps by using a UNIX/Linux console.
5524 \begin_layout Enumerate
5525 Get the package from
5526 \begin_inset CommandInset href
5529 target "http://www.ctan.org/"
5536 \begin_layout Enumerate
5537 You can install this package in several different places.
5538 If you want it to be available for all users on your system, then you should
5539 install it in your `local' TeX tree; if you want (or need) it to be available
5540 just for you, then you can install it in your own `user' TeX tree.
5541 Where these should be created, if they do not already exist, depends upon
5542 the details of your system.
5543 To find out, look in the file
5544 \begin_inset Flex CharStyle:Code
5547 \begin_layout Plain Layout
5557 \begin_layout Plain Layout
5558 This usually lives in the directory
5559 \begin_inset Flex CharStyle:Code
5562 \begin_layout Plain Layout
5568 , though you can run
5569 \begin_inset Flex CharStyle:Code
5572 \begin_layout Plain Layout
5583 The location of the `local' TeX tree is defined by
5584 \begin_inset Flex CharStyle:Code
5587 \begin_layout Plain Layout
5593 ; this is usually somewhere like
5594 \begin_inset Flex CharStyle:Code
5597 \begin_layout Plain Layout
5598 /usr/local/share/texmf/
5604 The `user' TeX tree is defined by
5605 \begin_inset Flex CharStyle:Code
5608 \begin_layout Plain Layout
5615 \begin_inset Flex CharStyle:Code
5618 \begin_layout Plain Layout
5625 (If these variables are not predefined, you can define them.) You'll probably
5626 need root permissions to create or modify the `local' tree; but your `user'
5627 tree shouldn't have such limitations.
5630 \begin_layout Enumerate
5632 \begin_inset Flex CharStyle:Code
5635 \begin_layout Plain Layout
5642 \begin_inset Flex CharStyle:Code
5645 \begin_layout Plain Layout
5652 \begin_inset Flex CharStyle:Code
5655 \begin_layout Plain Layout
5662 \begin_inset Newline newline
5666 \begin_inset Flex CharStyle:Code
5669 \begin_layout Plain Layout
5670 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5676 \begin_inset Newline newline
5679 But, again, most of this will
5680 \begin_inset Quotes eld
5684 \begin_inset Quotes erd
5690 \begin_layout Enumerate
5695 \begin_layout Plain Layout
5696 We'll assume henceforth that you're defining `local' TeX tree.
5697 If you're defining a user tree, just adjust as necessary.
5703 You must follow the directory structure of your existing
5704 \begin_inset Flex CharStyle:Code
5707 \begin_layout Plain Layout
5713 directory, which will be found at
5714 \begin_inset Flex CharStyle:Code
5717 \begin_layout Plain Layout
5724 For example, latex packages should go under
5725 \begin_inset Flex CharStyle:Code
5728 \begin_layout Plain Layout
5729 $TEXMFLOCAL/tex/latex/
5737 \begin_layout Enumerate
5738 Install the package.
5739 For example, you would unpack the FoilTeX tarball and copy it to
5740 \begin_inset Flex CharStyle:Code
5743 \begin_layout Plain Layout
5744 $TEXMFLOCAL/tex/latex/foiltex
5751 \begin_inset Flex CharStyle:Code
5754 \begin_layout Plain Layout
5760 directory contains various files.
5763 \begin_layout Enumerate
5765 \begin_inset Flex CharStyle:Code
5768 \begin_layout Plain Layout
5776 \begin_inset Flex CharStyle:Code
5779 \begin_layout Plain Layout
5788 \begin_layout Standard
5789 Your package is now installed and available to LaTeX.
5790 To make it available to LyX, you need to create a Layout file, if one is
5791 not already available.
5792 (See the next section.) Once you have a layout file, you need only reconfigure
5794 \begin_inset Flex CharStyle:MenuItem
5797 \begin_layout Plain Layout
5798 Tools\SpecialChar \menuseparator
5804 ) and then restart LyX.
5805 You should then see your new package---for example
5806 \begin_inset Flex CharStyle:MenuItem
5809 \begin_layout Plain Layout
5816 \begin_inset Flex CharStyle:MenuItem
5819 \begin_layout Plain Layout
5820 Document\SpecialChar \menuseparator
5827 \begin_inset Flex CharStyle:MenuItem
5830 \begin_layout Plain Layout
5840 \begin_layout Section
5844 \begin_layout Standard
5845 This section describes how to write and install your own LyX layout files
5846 and walks through the
5847 \begin_inset Flex CharStyle:Code
5850 \begin_layout Plain Layout
5856 text class format as an example.
5858 \begin_inset Flex CharStyle:Code
5861 \begin_layout Plain Layout
5867 files describe what paragraph and character styles are available for a
5868 given document class and how LyX should display them.
5869 We try to provide a thorough description of the process here; however,
5870 there are so many different types of documents supported by LaTeX classes
5871 that we can't hope to cover every different possibility or problem you
5873 (The LyX users' list is frequented by people with lots of experience with
5874 layout design who are willing to share what they've learned.)
5877 \begin_layout Standard
5878 As you prepare to write a new layout, it is extremely helpful to look at
5879 the example layouts distributed with LyX.
5880 If you use a nice LaTeX document class that might be of interest for others,
5881 too, and have a nice corresponding LyX layout, feel free to contribute
5882 the stuff to us, so we may put it into the distribution.
5884 \begin_inset CommandInset href
5886 name "section on the LyX wiki"
5887 target "http://wiki.lyx.org/Layouts/Layouts"
5891 for this kind of material.
5894 \begin_layout Standard
5895 All the tags described in this chapter are case-insensitive; this means
5897 \begin_inset Flex CharStyle:Code
5900 \begin_layout Plain Layout
5907 \begin_inset Flex CharStyle:Code
5910 \begin_layout Plain Layout
5917 \begin_inset Flex CharStyle:Code
5920 \begin_layout Plain Layout
5926 are really the same command.
5927 The possible values are printed in brackets after the feature's name.
5928 The default value if a feature isn't specified inside a text class-description
5930 \begin_inset Flex CharStyle:Code
5933 \begin_layout Plain Layout
5942 If the argument has a datatype like
5943 \begin_inset Quotes eld
5947 \begin_inset Quotes erd
5951 \begin_inset Quotes eld
5955 \begin_inset Quotes erd
5958 , the default is shown like this:
5959 \begin_inset Flex CharStyle:Code
5962 \begin_layout Plain Layout
5973 \begin_layout Subsection
5974 \begin_inset CommandInset label
5976 name "sub:Layout-modules"
5983 \begin_layout Standard
5984 Similar to layout files, and new with LyX 1.6, are layout
5989 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5990 some modules---such as the Endnotes module---provide support for just such
5992 In a sense, layout modules are similar to included files---files like
5993 \begin_inset Flex CharStyle:Code
5996 \begin_layout Plain Layout
6002 ---in that modules are not specific to a given document layout but may be
6003 used with many different layouts.
6004 The difference is that using a layout module does not require editing the
6006 Rather, modules are selected in the
6007 \begin_inset Flex CharStyle:MenuItem
6010 \begin_layout Plain Layout
6011 Document\SpecialChar \menuseparator
6020 \begin_layout Standard
6021 Building modules is the easiest way to get started with layout editing,
6022 since it can be as simple as adding a single new paragraph or flex inset.
6023 But modules may, in principle, contain anything a layout file can contain.
6026 \begin_layout Standard
6027 A module must begin with a line like the following:
6030 \begin_layout LyX-Code
6033 DeclareLyXModule[endnotes.sty]{Endnotes}
6036 \begin_layout Standard
6037 The argument in square brackets is optional: It declares any LaTeX packages
6038 on which the module depends.
6039 The mandatory argument, in curly brackets, is the name of the module, as
6041 \begin_inset Flex CharStyle:MenuItem
6044 \begin_layout Plain Layout
6045 Document\SpecialChar \menuseparator
6055 \begin_layout Standard
6056 The module declaration should then be followed by lines like the following:
6059 \begin_layout LyX-Code
6063 \begin_layout LyX-Code
6064 #Adds an endnote command, in addition to footnotes.
6068 \begin_layout LyX-Code
6069 #You will need to add
6071 theendnotes in ERT where you
6074 \begin_layout LyX-Code
6075 #want the endnotes to appear.
6079 \begin_layout LyX-Code
6083 \begin_layout LyX-Code
6084 #Requires: somemodule | othermodule
6087 \begin_layout LyX-Code
6088 #Excludes: badmodule
6091 \begin_layout Standard
6092 The description is used in
6093 \begin_inset Flex CharStyle:MenuItem
6096 \begin_layout Plain Layout
6097 Document\SpecialChar \menuseparator
6103 to provide the user with information about what the module does.
6105 \begin_inset Flex CharStyle:Code
6108 \begin_layout Plain Layout
6114 line is used to identify other modules with which this one must be used;
6116 \begin_inset Flex CharStyle:Code
6119 \begin_layout Plain Layout
6125 line is used to identify modules with which this one may not be used.
6126 Both are optional, and, as shown, multiple modules should be separated
6127 with the pipe symbol: |.
6128 Note that the required modules are treated disjunctively:
6132 of the required modules must be used.
6137 excluded module may be used.
6138 Note that modules are identified here by their
6142 without the .module extension.
6144 \begin_inset Flex CharStyle:Code
6147 \begin_layout Plain Layout
6154 \begin_inset Flex CharStyle:Code
6157 \begin_layout Plain Layout
6166 \begin_layout Standard
6167 After creating a new module, you will need to reconfigure and then restart
6168 LyX for the module to appear in the menu.
6169 However, changes you make to the module will be seen immediately, if you
6171 \begin_inset Flex CharStyle:MenuItem
6174 \begin_layout Plain Layout
6175 Document\SpecialChar \menuseparator
6181 , highlight something, and then hit
6182 \begin_inset Quotes eld
6186 \begin_inset Quotes erd
6192 It is strongly recommended that you save your work before doing so
6197 it is strongly recommended that you not attempt to edit modules while simultaneo
6198 usly working on documents
6201 Though of course the developers strive to keep LyX stable in such situations,
6202 syntax errors and the like in your module file could cause strange behavior.
6205 \begin_layout Subsection
6206 Supporting new document classes
6209 \begin_layout Standard
6210 There are two situations you are likely to encounter when wanting to support
6211 a new LaTeX document class, involving LaTeX2e class (
6212 \begin_inset Flex CharStyle:Code
6215 \begin_layout Plain Layout
6222 \begin_inset Flex CharStyle:Code
6225 \begin_layout Plain Layout
6232 Supporting a style file is usually fairly easy.
6233 Supporting a new document class is a bit harder.
6236 \begin_layout Subsection
6238 \begin_inset Flex CharStyle:MenuItem
6241 \begin_layout Plain Layout
6250 \begin_layout Standard
6251 If your new document class is provided as a style file that is used in conjuncti
6252 on with an existing, supported document class---for the sake of the example,
6253 we'll assume that the style file is called
6254 \begin_inset Flex CharStyle:MenuItem
6257 \begin_layout Plain Layout
6263 and it is meant to be used with
6264 \begin_inset Flex CharStyle:MenuItem
6267 \begin_layout Plain Layout
6273 , which is a standard class---start by copying the existing class's layout
6274 file into your local directory:
6277 \begin_layout LyX-Code
6278 cp report.layout ~/.lyx/layouts/myclass.layout
6281 \begin_layout Standard
6283 \begin_inset Flex CharStyle:Code
6286 \begin_layout Plain Layout
6292 and change the line:
6295 \begin_layout LyX-Code
6298 DeclareLaTeXClass{report}
6301 \begin_layout Standard
6305 \begin_layout LyX-Code
6308 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6311 \begin_layout Standard
6315 \begin_layout LyX-Code
6317 \begin_inset Newline newline
6323 \begin_inset Newline newline
6329 \begin_layout Standard
6330 near the top of the file.
6333 \begin_layout Standard
6334 Start LyX and select
6335 \begin_inset Flex CharStyle:MenuItem
6338 \begin_layout Plain Layout
6339 Tools\SpecialChar \menuseparator
6346 Then restart LyX and try creating a new document.
6348 \begin_inset Flex CharStyle:MenuItem
6351 \begin_layout Plain Layout
6357 " as a document class option in the
6358 \begin_inset Flex CharStyle:MenuItem
6361 \begin_layout Plain Layout
6362 Document\SpecialChar \menuseparator
6369 It is likely that some of the sectioning commands and such in your new
6370 class will work differently from how they worked in the base class---
6371 \begin_inset Flex CharStyle:Code
6374 \begin_layout Plain Layout
6380 in this example---so you can fiddle around with the settings for the different
6381 sections if you wish.
6384 \begin_layout Subsection
6386 \begin_inset Flex CharStyle:MenuItem
6389 \begin_layout Plain Layout
6398 \begin_layout Standard
6399 There are two possibilities here.
6400 One is that the class file is itself based upon an existing document class.
6401 For example, many thesis classes are based upon
6402 \begin_inset Flex CharStyle:MenuItem
6405 \begin_layout Plain Layout
6412 To see whether yours is, look for a line like
6415 \begin_layout LyX-Code
6421 \begin_layout Standard
6423 If so, then you may proceed largely as in the previous section, though
6424 the DeclareLaTeXClass line will be different.
6425 If your new class is thesis, and it is based upon book, then the line should
6430 \begin_layout Plain Layout
6431 And it will be easiest if you save the file to
6432 \begin_inset Flex CharStyle:Code
6435 \begin_layout Plain Layout
6441 : LyX assumes that the document class has the same name as the layout file.
6450 \begin_layout LyX-Code
6453 DeclareLaTeXClass[thesis,book]{thesis}
6456 \begin_layout Standard
6457 If, on the other hand, the new class is not based upon an existing class,
6458 you will probably have to
6459 \begin_inset Quotes eld
6463 \begin_inset Quotes erd
6467 We strongly suggest copying an existing layout file which uses a similar
6468 LaTeX class and then modifying it, if you can do so.
6469 At least use an existing file as a starting point so you can find out what
6470 items you need to worry about.
6471 Again, the specifics are covered below.
6474 \begin_layout Section
6475 Declaring a new text class
6478 \begin_layout Standard
6479 When it's finally time to get your hands dirty and create or edit your own
6480 layout file, the following sections describe what you're up against.
6481 Our advice is to go slowly, save and test often, listen to soothing music,
6482 and enjoy one or two of your favorite adult beverages; more if you are
6483 getting particularly stuck.
6484 It's really not that hard, except that the multitude of options can become
6485 overwhelming if you try to do to much in one sitting.
6486 Go have another adult beverage, just for good measure.
6489 \begin_layout Standard
6493 \begin_layout Standard
6494 Lines in a layout file which begin with a
6495 \begin_inset Flex CharStyle:Code
6498 \begin_layout Plain Layout
6505 There is one exception to this rule: all layouts should begin with lines
6509 \begin_layout LyX-Code
6512 #% Do not delete the line below; configure depends on this
6515 \begin_layout LyX-Code
6520 DeclareLaTeXClass{article}
6523 \begin_layout Standard
6524 The second line is used when you configure LyX.
6525 The layout file is read by the LaTeX script
6526 \begin_inset Flex CharStyle:Code
6529 \begin_layout Plain Layout
6535 , in a special mode where
6536 \begin_inset Flex CharStyle:Code
6539 \begin_layout Plain Layout
6546 The first line is just a LaTeX comment, and the second one contains the
6547 declaration of the text class.
6548 If these lines appear in a file named
6549 \begin_inset Flex CharStyle:Code
6552 \begin_layout Plain Layout
6558 , then they define a text class of name
6559 \begin_inset Flex CharStyle:Code
6562 \begin_layout Plain Layout
6568 (the name of the layout file) which uses the LaTeX document class
6569 \begin_inset Flex CharStyle:Code
6572 \begin_layout Plain Layout
6578 (the default is to use the same name as the layout).
6580 \begin_inset Quotes eld
6584 \begin_inset Quotes erd
6587 that appears above is used as a description of the text class in the
6588 \begin_inset Flex CharStyle:MenuItem
6591 \begin_layout Plain Layout
6592 Document\SpecialChar \menuseparator
6601 \begin_layout Standard
6602 Let's assume that you wrote your own text class that uses the
6603 \begin_inset Flex CharStyle:Code
6606 \begin_layout Plain Layout
6612 document class, but where you changed the appearance of the section headings.
6613 If you put it in a file
6614 \begin_inset Flex CharStyle:Code
6617 \begin_layout Plain Layout
6623 , the header of this file should be:
6626 \begin_layout LyX-Code
6629 #% Do not delete the line below; configure depends on this
6632 \begin_layout LyX-Code
6637 DeclareLaTeXClass[article]{article (with my own headings)}
6640 \begin_layout Standard
6641 This declares a text class
6642 \begin_inset Flex CharStyle:Code
6645 \begin_layout Plain Layout
6651 , associated with the LaTeX document class
6652 \begin_inset Flex CharStyle:Code
6655 \begin_layout Plain Layout
6662 \begin_inset Quotes eld
6665 article (with my own headings)
6666 \begin_inset Quotes erd
6670 If your text class depends on several packages, you can declare it as:
6673 \begin_layout LyX-Code
6676 #% Do not delete the line below; configure depends on this
6679 \begin_layout LyX-Code
6684 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6687 \begin_layout Standard
6688 This indicates that your text class uses the foo.sty package.
6689 Finally, it is also possible to declare classes for DocBook code.
6690 Typical declarations will look like
6693 \begin_layout LyX-Code
6696 #% Do not delete the line below; configure depends on this
6699 \begin_layout LyX-Code
6704 DeclareDocBookClass[article]{SGML (DocBook article)}
6707 \begin_layout Standard
6708 Note that these declarations can also be given an optional parameter declaring
6709 the name of the document class (but not a list).
6712 \begin_layout Standard
6713 So, to be as explicit as possible, the form of the layout declaration is:
6716 \begin_layout LyX-Code
6721 DeclareLaTeXClass[class,package.sty]{layout description}
6724 \begin_layout Standard
6725 The class need only be specified if the name of the LaTeX class file and
6726 the name of the layout file are different; if the name of the classfile
6727 is not specified, then LyX will simply assume that it is the same as the
6728 name of the layout file.
6731 \begin_layout Standard
6732 When the text class has been modified to your taste, all you have to do
6733 is to copy it either to
6734 \begin_inset Flex CharStyle:Code
6737 \begin_layout Plain Layout
6744 \begin_inset Flex CharStyle:Code
6747 \begin_layout Plain Layout
6754 \begin_inset Flex CharStyle:MenuItem
6757 \begin_layout Plain Layout
6762 ools\SpecialChar \menuseparator
6772 , exit LyX and restart it.
6773 Then your new text class should be available along with the others.
6776 \begin_layout Standard
6777 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6778 you made to your layout files.
6779 As a result, editing layout files could be very time consuming.
6780 Beginning with 1.6, however, you can force a reload of the layout currently
6781 in use by using the LyX function
6782 \begin_inset Flex CharStyle:MenuItem
6785 \begin_layout Plain Layout
6792 There is no default binding for this function---though, of course, you
6793 can bind it to a key yourself.
6794 If you want to use this function, then, you should simply enter it in the
6800 : This is very much an `advanced feature'.
6805 recommended that you save your work before using this function.
6810 recommended that you not attempt to edit your layout while simultaneously
6811 working on a document that you care about.
6812 Use a test document.
6813 Syntax errors and the like in your layout file could cause peculiar behavior.
6814 In particular, such errors could cause LyX to regard the current layout
6815 as invalid and to attempt to switch to some other layout.
6816 The LyX team strives to keep LyX stable in such situations, but safe is
6820 \begin_layout Subsection
6824 \begin_layout Standard
6825 The first non-comment line must contain the file format number:
6828 \begin_layout Description
6829 \begin_inset Flex CharStyle:Code
6832 \begin_layout Plain Layout
6839 \begin_inset Flex CharStyle:Code
6842 \begin_layout Plain Layout
6848 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6849 don't have an explicit file format).
6850 The file format that is documented here is format 8.
6853 \begin_layout Subsection
6854 General text class parameters
6857 \begin_layout Standard
6858 These are the general parameters which describe the form of the entire document:
6861 \begin_layout Description
6862 \begin_inset Flex CharStyle:Code
6865 \begin_layout Plain Layout
6871 Adds information to the document preamble.
6873 \begin_inset Quotes eld
6877 \begin_inset Flex CharStyle:Code
6880 \begin_layout Plain Layout
6887 \begin_inset Quotes erd
6893 \begin_layout Description
6894 \begin_inset Flex CharStyle:Code
6897 \begin_layout Plain Layout
6903 Describes various global options supported by the document class.
6905 \begin_inset space ~
6909 \begin_inset CommandInset ref
6911 reference "sec:classoptions"
6917 \begin_inset Quotes eld
6921 \begin_inset Flex CharStyle:Code
6924 \begin_layout Plain Layout
6931 \begin_inset Quotes erd
6937 \begin_layout Description
6938 \begin_inset Flex CharStyle:Code
6941 \begin_layout Plain Layout
6948 \begin_inset Flex CharStyle:Code
6951 \begin_layout Plain Layout
6960 \begin_inset Flex CharStyle:Code
6963 \begin_layout Plain Layout
6969 ] Whether the class should default to having one or two columns.
6970 Can be changed in the
6971 \begin_inset Flex CharStyle:MenuItem
6974 \begin_layout Plain Layout
6975 Document\SpecialChar \menuseparator
6984 \begin_layout Description
6985 \begin_inset Flex CharStyle:Code
6988 \begin_layout Plain Layout
6994 This sequence defines a new counter.
6996 \begin_inset space ~
7000 \begin_inset CommandInset ref
7002 reference "sec:counter"
7008 \begin_inset Quotes eld
7012 \begin_inset Flex CharStyle:Code
7015 \begin_layout Plain Layout
7022 \begin_inset Quotes erd
7028 \begin_layout Description
7029 \begin_inset Flex CharStyle:Code
7032 \begin_layout Plain Layout
7038 Sets the default font used to display the document.
7040 \begin_inset space ~
7044 \begin_inset CommandInset ref
7046 reference "sec:fonts"
7050 for how to declare fonts.
7052 \begin_inset Quotes eld
7056 \begin_inset Flex CharStyle:Code
7059 \begin_layout Plain Layout
7066 \begin_inset Quotes erd
7072 \begin_layout Description
7073 \begin_inset Flex CharStyle:Code
7076 \begin_layout Plain Layout
7083 \begin_inset Flex CharStyle:Code
7086 \begin_layout Plain Layout
7092 Specifies a module to be included by default with this document class,
7093 which should be specified by filename without the
7094 \begin_inset Flex CharStyle:Code
7097 \begin_layout Plain Layout
7104 The user can still remove the module, but it will be active at the outset.
7105 (This applies only when new files are created, or when this class is chosen
7106 for an existing document.)
7109 \begin_layout Description
7110 \begin_inset Flex CharStyle:Code
7113 \begin_layout Plain Layout
7120 \begin_inset Flex CharStyle:Code
7123 \begin_layout Plain Layout
7129 ] This is the style that will be assigned to new paragraphs, usually
7130 \begin_inset Flex CharStyle:MenuItem
7133 \begin_layout Plain Layout
7140 This will default to the first defined style if not given, but you are
7141 highly encouraged to use this directive.
7144 \begin_layout Description
7145 \begin_inset Flex CharStyle:Code
7148 \begin_layout Plain Layout
7155 \begin_inset Flex CharStyle:Code
7158 \begin_layout Plain Layout
7164 ] Indicates that the module in question---which should be specified by filename
7166 \begin_inset Flex CharStyle:Code
7169 \begin_layout Plain Layout
7175 extension---cannot be used with this document class.
7176 This might be used in a journal-specific layout file to prevent, say, the
7178 \begin_inset Flex CharStyle:Code
7181 \begin_layout Plain Layout
7187 module that numbers theorems by section.
7192 be used in a module.
7193 Modules have their own way of excluding other modules (see
7194 \begin_inset CommandInset ref
7196 reference "sub:Layout-modules"
7203 \begin_layout Description
7204 \begin_inset Flex CharStyle:Code
7207 \begin_layout Plain Layout
7213 Defines a new float.
7215 \begin_inset space ~
7219 \begin_inset CommandInset ref
7221 reference "sec:floats"
7227 \begin_inset Quotes eld
7231 \begin_inset Flex CharStyle:Code
7234 \begin_layout Plain Layout
7241 \begin_inset Quotes erd
7247 \begin_layout Description
7248 \begin_inset Flex CharStyle:Code
7251 \begin_layout Plain Layout
7257 As its name implies, this command allows you to include another layout
7258 definition file within yours to avoid duplicating commands.
7259 Common examples are the standard layout files, for example,
7260 \begin_inset Flex CharStyle:Code
7263 \begin_layout Plain Layout
7269 , which contains most of the basic layouts.
7272 \begin_layout Description
7273 \begin_inset Flex CharStyle:Code
7276 \begin_layout Plain Layout
7282 This section (re-)defines the layout of an inset.
7283 It can be applied to an existing inset of to a new, user-defined inset,
7285 \begin_inset space \space{}
7288 a new character style.
7290 \begin_inset space ~
7294 \begin_inset CommandInset ref
7296 reference "sec:charstyle"
7300 for more information.
7302 \begin_inset Quotes eld
7306 \begin_inset Flex CharStyle:Code
7309 \begin_layout Plain Layout
7316 \begin_inset Quotes erd
7322 \begin_layout Description
7323 \begin_inset Flex CharStyle:Code
7326 \begin_layout Plain Layout
7332 A string that indicates the width of the left margin on the screen, for
7334 \begin_inset Quotes eld
7338 \begin_inset Quotes erd
7344 \begin_layout Description
7345 \begin_inset Flex CharStyle:Code
7348 \begin_layout Plain Layout
7354 This command deletes an existing float.
7355 This is particularly useful when you want to suppress a float that has
7356 be defined in an input file.
7359 \begin_layout Description
7360 \begin_inset Flex CharStyle:Code
7363 \begin_layout Plain Layout
7369 This command deletes an existing style.
7370 This is particularly useful when you want to suppress a style that has
7371 be defined in an input file.
7374 \begin_layout Description
7375 \begin_inset Flex CharStyle:Code
7378 \begin_layout Plain Layout
7384 A string indicating what sort of output documents using this class will
7386 At present, the options are: `docbook', `latex', and `literate'.
7389 \begin_layout Description
7390 \begin_inset Flex CharStyle:Code
7393 \begin_layout Plain Layout
7404 \begin_inset Flex CharStyle:Code
7407 \begin_layout Plain Layout
7418 \begin_inset Flex CharStyle:Code
7421 \begin_layout Plain Layout
7428 \begin_inset Flex CharStyle:Code
7431 \begin_layout Plain Layout
7437 ] The class default pagestyle.
7438 Can be changed in the
7439 \begin_inset Flex CharStyle:MenuItem
7442 \begin_layout Plain Layout
7443 Document\SpecialChar \menuseparator
7452 \begin_layout Description
7453 \begin_inset Flex CharStyle:Code
7456 \begin_layout Plain Layout
7462 Sets the preamble for the LaTeX document.
7463 Note that this will completely override any prior
7464 \begin_inset Flex CharStyle:Code
7467 \begin_layout Plain Layout
7474 \begin_inset Flex CharStyle:Code
7477 \begin_layout Plain Layout
7485 \begin_inset Quotes eld
7489 \begin_inset Flex CharStyle:Code
7492 \begin_layout Plain Layout
7499 \begin_inset Quotes erd
7505 \begin_layout Description
7506 \begin_inset Flex CharStyle:Code
7509 \begin_layout Plain Layout
7516 \begin_inset Flex CharStyle:Code
7519 \begin_layout Plain Layout
7526 \begin_inset Flex CharStyle:Code
7529 \begin_layout Plain Layout
7538 \begin_inset Flex CharStyle:Code
7541 \begin_layout Plain Layout
7547 ] Whether the class already provides the feature
7548 \begin_inset Flex CharStyle:Code
7551 \begin_layout Plain Layout
7558 A feature is in general the name of a package (
7559 \begin_inset Flex CharStyle:Code
7562 \begin_layout Plain Layout
7569 \begin_inset Flex CharStyle:Code
7572 \begin_layout Plain Layout
7578 , \SpecialChar \ldots{}
7580 \begin_inset Flex CharStyle:Code
7583 \begin_layout Plain Layout
7590 \begin_inset Flex CharStyle:Code
7593 \begin_layout Plain Layout
7599 ,\SpecialChar \ldots{}
7600 ); the complete list of supported features is unfortunately not documented
7601 outside the LyX source code---but see
7602 \begin_inset Flex CharStyle:Code
7605 \begin_layout Plain Layout
7611 if you're interested.
7613 \begin_inset Flex CharStyle:MenuItem
7616 \begin_layout Plain Layout
7621 elp\SpecialChar \menuseparator
7631 also gives an overview of the supported packages.
7634 \begin_layout Description
7635 \begin_inset Flex CharStyle:Code
7638 \begin_layout Plain Layout
7645 \begin_inset Flex CharStyle:Code
7648 \begin_layout Plain Layout
7654 ] Indicates that this layout provides the functionality of the module mentioned,
7655 which should be specified by filename, which should be specified by filename
7657 \begin_inset Flex CharStyle:Code
7660 \begin_layout Plain Layout
7667 This will typically be used if the layout includes the module directly,
7668 rather than using the
7669 \begin_inset Flex CharStyle:Code
7672 \begin_layout Plain Layout
7678 tag to indicate that it ought to be used.
7679 It could be used in a module that that provided an alternate implementation
7680 of the same functionality.
7683 \begin_layout Description
7684 \begin_inset Flex CharStyle:Code
7687 \begin_layout Plain Layout
7694 \begin_inset Flex CharStyle:Code
7697 \begin_layout Plain Layout
7703 ] Whether the class requires the feature
7704 \begin_inset Flex CharStyle:Code
7707 \begin_layout Plain Layout
7714 Multiple features must be separated by commas.
7715 Note that you can only request supported features.
7718 \begin_layout Description
7719 \begin_inset Flex CharStyle:Code
7722 \begin_layout Plain Layout
7728 A string that indicates the width of the right margin on the screen, for
7730 \begin_inset Quotes eld
7734 \begin_inset Quotes erd
7740 \begin_layout Description
7741 \begin_inset Flex CharStyle:Code
7744 \begin_layout Plain Layout
7750 Sets which divisions get numbered.
7752 \begin_inset Flex CharStyle:Code
7755 \begin_layout Plain Layout
7764 \begin_layout Description
7765 \begin_inset Flex CharStyle:Code
7768 \begin_layout Plain Layout
7777 \begin_inset Flex CharStyle:Code
7780 \begin_layout Plain Layout
7791 \begin_inset Flex CharStyle:Code
7794 \begin_layout Plain Layout
7800 ] Whether the class-default should be printing on one or both sides of the
7802 Can be changed in the
7803 \begin_inset Flex CharStyle:MenuItem
7806 \begin_layout Plain Layout
7807 Document\SpecialChar \menuseparator
7816 \begin_layout Description
7817 \begin_inset Flex CharStyle:Code
7820 \begin_layout Plain Layout
7826 This sequence defines a new paragraph style.
7827 If the style already exists, it will redefine some of its parameters instead.
7829 \begin_inset space ~
7833 \begin_inset CommandInset ref
7835 reference "sec:style"
7841 \begin_inset Quotes eld
7845 \begin_inset Flex CharStyle:Code
7848 \begin_layout Plain Layout
7855 \begin_inset Quotes erd
7861 \begin_layout Description
7862 \begin_inset Flex CharStyle:Code
7865 \begin_layout Plain Layout
7872 \begin_inset Flex CharStyle:Code
7875 \begin_layout Plain Layout
7881 ] The name of the command or environment to be used with
7882 \begin_inset Flex CharStyle:Code
7885 \begin_layout Plain Layout
7894 \begin_layout Description
7895 \begin_inset Flex CharStyle:Code
7898 \begin_layout Plain Layout
7905 \begin_inset Flex CharStyle:Code
7908 \begin_layout Plain Layout
7917 \begin_inset Flex CharStyle:Code
7920 \begin_layout Plain Layout
7926 ] Indicates what kind of markup is used to define the title of a document.
7928 \begin_inset Flex CharStyle:Code
7931 \begin_layout Plain Layout
7937 means that the macro with name
7938 \begin_inset Flex CharStyle:Code
7941 \begin_layout Plain Layout
7947 will be inserted after the last layout which has
7948 \begin_inset Quotes eld
7952 \begin_inset Flex CharStyle:Code
7955 \begin_layout Plain Layout
7962 \begin_inset Quotes erd
7967 \begin_inset Flex CharStyle:Code
7970 \begin_layout Plain Layout
7976 corresponds to the case where the block of paragraphs which have
7977 \begin_inset Quotes eld
7981 \begin_inset Flex CharStyle:Code
7984 \begin_layout Plain Layout
7991 \begin_inset Quotes erd
7994 should be enclosed into the
7995 \begin_inset Flex CharStyle:Code
7998 \begin_layout Plain Layout
8007 \begin_layout Description
8008 \begin_inset Flex CharStyle:Code
8011 \begin_layout Plain Layout
8017 Sets which divisions are included in the table of contents.
8019 \begin_inset Flex CharStyle:Code
8022 \begin_layout Plain Layout
8031 \begin_layout Subsection
8032 \begin_inset Flex CharStyle:Code
8035 \begin_layout Plain Layout
8044 \begin_layout Standard
8045 \begin_inset CommandInset label
8047 name "sec:classoptions"
8052 \begin_inset Flex CharStyle:Code
8055 \begin_layout Plain Layout
8061 section can contain the following entries:
8064 \begin_layout Description
8065 \begin_inset Flex CharStyle:Code
8068 \begin_layout Plain Layout
8075 \begin_inset Flex CharStyle:Code
8078 \begin_layout Plain Layout
8084 ] The list of available font sizes for the document's main font, separated
8086 \begin_inset Quotes eld
8090 \begin_inset Flex CharStyle:Code
8093 \begin_layout Plain Layout
8100 \begin_inset Quotes erd
8106 \begin_layout Description
8107 \begin_inset Flex CharStyle:Code
8110 \begin_layout Plain Layout
8116 Used to set the DTD line with XML-based output classes.
8118 \begin_inset Quotes eld
8121 -//OASIS//DTD DocBook V4.2//EN
8122 \begin_inset Quotes erd
8128 \begin_layout Description
8129 \begin_inset Flex CharStyle:Code
8132 \begin_layout Plain Layout
8139 \begin_inset Flex CharStyle:Code
8142 \begin_layout Plain Layout
8143 string="empty|plain|headings|fancy"
8148 ] The list of available page styles, separated by
8149 \begin_inset Quotes eld
8153 \begin_inset Flex CharStyle:Code
8156 \begin_layout Plain Layout
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
8189 ] Some document class options, separated by a comma, that will be added
8190 to the optional part of the
8191 \begin_inset Flex CharStyle:Code
8194 \begin_layout Plain Layout
8205 \begin_layout Standard
8207 \begin_inset Flex CharStyle:Code
8210 \begin_layout Plain Layout
8216 section must end with
8217 \begin_inset Quotes eld
8221 \begin_inset Flex CharStyle:Code
8224 \begin_layout Plain Layout
8231 \begin_inset Quotes erd
8237 \begin_layout Subsection
8241 \begin_layout Standard
8242 \begin_inset CommandInset label
8248 A paragraph style description looks like this:
8252 \begin_layout Plain Layout
8253 Note that this will either define a new layout or modify an existing one.
8261 \begin_layout LyX-Code
8268 \begin_layout LyX-Code
8272 \begin_layout LyX-Code
8276 \begin_layout Standard
8277 where the following commands are allowed:
8280 \begin_layout Description
8281 \begin_inset Flex CharStyle:Code
8284 \begin_layout Plain Layout
8291 \begin_inset Flex CharStyle:Code
8294 \begin_layout Plain Layout
8299 , left, right, center
8304 ] Paragraph alignment.
8307 \begin_layout Description
8308 \begin_inset Flex CharStyle:Code
8311 \begin_layout Plain Layout
8318 \begin_inset Flex CharStyle:Code
8321 \begin_layout Plain Layout
8326 , left, right, center
8331 ] A comma separated list of permitted alignments.
8332 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8334 For example a right-aligned or centered enumeration isn't possible.)
8337 \begin_layout Description
8338 \begin_inset Flex CharStyle:Code
8341 \begin_layout Plain Layout
8348 \begin_inset Flex CharStyle:Code
8351 \begin_layout Plain Layout
8361 \begin_layout Plain Layout
8362 Note that a `float' here is a real number, such as: 1.5.
8367 The vertical space with which the last of a chain of paragraphs with this
8368 layout is separated from the following paragraph.
8369 If the next paragraph has another layout, the separations are not simply
8370 added, but the maximum is taken.
8373 \begin_layout Description
8374 \begin_inset Flex CharStyle:Code
8377 \begin_layout Plain Layout
8384 \begin_inset Flex CharStyle:Code
8387 \begin_layout Plain Layout
8393 The category for this style.
8394 This is used to group related styles in the Layout combobox on the toolbar.
8395 Any string can be used, but you may want to use existing categories with
8400 \begin_layout Description
8401 \begin_inset Flex CharStyle:Code
8404 \begin_layout Plain Layout
8410 Depth of XML command.
8411 Used only with XML-type formats.
8414 \begin_layout Description
8415 \begin_inset Flex CharStyle:Code
8418 \begin_layout Plain Layout
8425 \begin_inset CommandInset label
8427 name "des:CopyStyle"
8432 \begin_inset Flex CharStyle:Code
8435 \begin_layout Plain Layout
8441 Copies all the features of an existing style into the current one.
8445 \begin_layout Description
8446 \begin_inset Flex CharStyle:Code
8449 \begin_layout Plain Layout
8455 The name of a style whose preamble should be output
8460 This allows to ensure some ordering of the preamble snippets when macros
8461 definitions depend on one another.
8465 \begin_layout Plain Layout
8466 Note that, besides that functionality, there is no way to ensure any ordering
8468 The ordering that you see in a given version of LyX may change without
8469 warning in later versions.
8477 \begin_layout Description
8478 \begin_inset Flex CharStyle:Code
8481 \begin_layout Plain Layout
8488 \begin_inset Flex CharStyle:Code
8491 \begin_layout Plain Layout
8496 , Box, Filled_Box, Static
8501 ] The type of label that stands at the end of the paragraph (or sequence
8503 \begin_inset Flex CharStyle:Code
8506 \begin_layout Plain Layout
8513 \begin_inset Flex CharStyle:Code
8516 \begin_layout Plain Layout
8523 \begin_inset Flex CharStyle:Code
8526 \begin_layout Plain Layout
8533 \begin_inset Flex CharStyle:Code
8536 \begin_layout Plain Layout
8544 \begin_inset Flex CharStyle:Code
8547 \begin_layout Plain Layout
8554 \begin_inset Quotes eld
8558 \begin_inset Quotes erd
8562 \begin_inset Flex CharStyle:Code
8565 \begin_layout Plain Layout
8572 \begin_inset Flex CharStyle:Code
8575 \begin_layout Plain Layout
8576 \begin_inset space ~
8585 \begin_inset space ~
8588 black) square suitable for end of proof markers,
8589 \begin_inset Flex CharStyle:Code
8592 \begin_layout Plain Layout
8598 is an explicit text string.
8601 \begin_layout Description
8602 \begin_inset Flex CharStyle:Code
8605 \begin_layout Plain Layout
8612 \begin_inset Flex CharStyle:Code
8615 \begin_layout Plain Layout
8621 ] The string used for a label with a
8622 \begin_inset Flex CharStyle:Code
8625 \begin_layout Plain Layout
8632 \begin_inset Flex CharStyle:Code
8635 \begin_layout Plain Layout
8645 \begin_layout Description
8646 \begin_inset Flex CharStyle:Code
8649 \begin_layout Plain Layout
8656 \begin_inset Flex CharStyle:Code
8659 \begin_layout Plain Layout
8670 \begin_inset Flex CharStyle:Code
8673 \begin_layout Plain Layout
8682 \begin_layout Description
8683 \begin_inset Flex CharStyle:Code
8686 \begin_layout Plain Layout
8693 \begin_inset Flex CharStyle:Code
8696 \begin_layout Plain Layout
8706 ] With this parameter the
8707 \begin_inset Flex CharStyle:MenuItem
8710 \begin_layout Plain Layout
8717 \begin_inset Quotes eld
8720 Vertical space above
8721 \begin_inset Quotes erd
8725 \begin_inset Flex CharStyle:MenuItem
8728 \begin_layout Plain Layout
8729 Edit\SpecialChar \menuseparator
8731 \begin_inset space ~
8739 dialog can be set when initializing a paragraph with this style.
8743 \begin_layout Plain Layout
8746 Note from Jean-Marc:
8748 I'm not sure that this setting has much use, and it should probably be
8749 removed in later versions.
8757 \begin_layout Description
8758 \begin_inset Flex CharStyle:Code
8761 \begin_layout Plain Layout
8767 The font used for both the text body
8773 \begin_inset space ~
8777 \begin_inset CommandInset ref
8779 reference "sec:fonts"
8784 Note that defining this font automatically defines the
8785 \begin_inset Flex CharStyle:Code
8788 \begin_layout Plain Layout
8795 So you should define this one first if you also want to define
8796 \begin_inset Flex CharStyle:Code
8799 \begin_layout Plain Layout
8808 \begin_layout Description
8809 \begin_inset Flex CharStyle:Code
8812 \begin_layout Plain Layout
8819 \begin_inset CommandInset label
8821 name "des:FreeSpacing"
8828 \begin_inset Flex CharStyle:Code
8831 \begin_layout Plain Layout
8842 \begin_inset Flex CharStyle:Code
8845 \begin_layout Plain Layout
8851 ] Usually LyX doesn't allow you to insert more than one space between words,
8852 since a space is considered as the separation between two words, not a
8853 character or symbol of its own.
8854 This is a very fine thing but sometimes annoying, for example, when typing
8855 program code or plain LaTeX code.
8857 \begin_inset Flex CharStyle:Code
8860 \begin_layout Plain Layout
8867 Note that LyX will create protected blanks for the additional blanks when
8868 in another mode than LaTeX-mode.
8871 \begin_layout Description
8872 \begin_inset Flex CharStyle:Code
8875 \begin_layout Plain Layout
8881 [[FIXME]] (Used only with XML-type formats.)
8884 \begin_layout Description
8885 \begin_inset Flex CharStyle:Code
8888 \begin_layout Plain Layout
8895 \begin_inset Flex CharStyle:Code
8898 \begin_layout Plain Layout
8904 If 1, marks the layout as being part of a title block (see also the
8905 \begin_inset Flex CharStyle:Code
8908 \begin_layout Plain Layout
8915 \begin_inset Flex CharStyle:Code
8918 \begin_layout Plain Layout
8927 \begin_layout Description
8928 \begin_inset Flex CharStyle:Code
8931 \begin_layout Plain Layout
8938 \begin_inset Flex CharStyle:Code
8941 \begin_layout Plain Layout
8947 ] This provides extra space between paragraphs that have the same layout.
8948 If you put other layouts into an environment, each is separated with the
8950 \begin_inset Flex CharStyle:Code
8953 \begin_layout Plain Layout
8960 But the whole items of the environment are additionally separated with
8962 \begin_inset Flex CharStyle:Code
8965 \begin_layout Plain Layout
8977 \begin_layout Description
8978 \begin_inset Flex CharStyle:Code
8981 \begin_layout Plain Layout
8987 [[FIXME]] (Used only with XML-type formats.)
8990 \begin_layout Description
8991 \begin_inset Flex CharStyle:Code
8994 \begin_layout Plain Layout
9001 \begin_inset CommandInset label
9003 name "des:KeepEmpty"
9010 \begin_inset Flex CharStyle:Code
9013 \begin_layout Plain Layout
9024 \begin_inset Flex CharStyle:Code
9027 \begin_layout Plain Layout
9033 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9034 lead to empty LaTeX output.
9035 There are some cases where this could be desirable however: in a letter
9036 template, the required fields can be provided as empty fields, so that
9037 people do not forget them; in some special classes, a layout can be used
9038 as some kind of break, which does not contain actual text.
9041 \begin_layout Description
9042 \begin_inset Flex CharStyle:Code
9045 \begin_layout Plain Layout
9051 [float=0] The vertical space between the label and the text body.
9052 Only used for labels that are above the text body (
9053 \begin_inset Flex CharStyle:Code
9056 \begin_layout Plain Layout
9063 \begin_inset Flex CharStyle:Code
9066 \begin_layout Plain Layout
9067 Centered_Top_Environment
9075 \begin_layout Description
9076 \begin_inset Flex CharStyle:Code
9079 \begin_layout Plain Layout
9086 \begin_inset Flex CharStyle:Code
9089 \begin_layout Plain Layout
9096 \begin_inset Newline newline
9099 The name of the counter for automatic numbering (see Section
9100 \begin_inset CommandInset ref
9102 reference "sec:counter"
9107 This must be given if
9108 \begin_inset Flex CharStyle:Code
9111 \begin_layout Plain Layout
9118 \begin_inset Flex CharStyle:Code
9121 \begin_layout Plain Layout
9130 \begin_layout Description
9131 \begin_inset Flex CharStyle:Code
9134 \begin_layout Plain Layout
9140 The font used for the label.
9142 \begin_inset space ~
9146 \begin_inset CommandInset ref
9148 reference "sec:fonts"
9155 \begin_layout Description
9156 \begin_inset Flex CharStyle:Code
9159 \begin_layout Plain Layout
9165 Text that indicates how far a label should be indented.
9168 \begin_layout Description
9169 \begin_inset Flex CharStyle:Code
9172 \begin_layout Plain Layout
9179 \begin_inset Flex CharStyle:Code
9182 \begin_layout Plain Layout
9188 ] The horizontal space between the label and the text body.
9189 Only used for labels that are not above the text body.
9192 \begin_layout Description
9193 \begin_inset Flex CharStyle:Code
9196 \begin_layout Plain Layout
9203 \begin_inset Flex CharStyle:Code
9206 \begin_layout Plain Layout
9212 ] The string used for a label with a
9213 \begin_inset Flex CharStyle:Code
9216 \begin_layout Plain Layout
9224 \begin_inset Flex CharStyle:Code
9227 \begin_layout Plain Layout
9233 is set, this string can be contain the special formatting commands described
9235 \begin_inset CommandInset ref
9237 reference "sec:counter"
9245 \begin_layout Plain Layout
9246 For the sake of backwards compatibility, the string
9247 \begin_inset Flex CharStyle:Code
9250 \begin_layout Plain Layout
9260 will be replaced by the expanded
9261 \begin_inset Flex CharStyle:Code
9264 \begin_layout Plain Layout
9271 \begin_inset Flex CharStyle:Code
9274 \begin_layout Plain Layout
9283 This feature is now obsolete and should be replaced by the mechanisms of
9285 \begin_inset CommandInset ref
9287 reference "sec:counter"
9299 \begin_layout Description
9300 \begin_inset Flex CharStyle:Code
9303 \begin_layout Plain Layout
9310 \begin_inset Flex CharStyle:Code
9313 \begin_layout Plain Layout
9319 ] This is used inside the appendix instead of
9320 \begin_inset Flex CharStyle:Code
9323 \begin_layout Plain Layout
9331 \begin_inset Flex CharStyle:Code
9334 \begin_layout Plain Layout
9341 \begin_inset Flex CharStyle:Code
9344 \begin_layout Plain Layout
9353 \begin_layout Description
9354 \begin_inset Flex CharStyle:Code
9357 \begin_layout Plain Layout
9363 [FIXME] (Used only with XML-type formats.)
9366 \begin_layout Description
9367 \begin_inset Flex CharStyle:Code
9370 \begin_layout Plain Layout
9377 \begin_inset Flex CharStyle:Code
9380 \begin_layout Plain Layout
9385 , Manual, Static, Top_Environment,
9386 \begin_inset Newline newline
9389 Centered_Top_Environment, Sensitive, Counter
9395 \begin_inset Newline newline
9399 \begin_inset Flex CharStyle:Code
9402 \begin_layout Plain Layout
9408 means the label is the very first word (up to the first real blank).
9412 \begin_layout Plain Layout
9413 Use protected spaces if you want more than one word as the label.
9419 \begin_inset Flex CharStyle:Code
9422 \begin_layout Plain Layout
9428 means it is defined in the layout (see
9429 \begin_inset Flex CharStyle:Code
9432 \begin_layout Plain Layout
9440 \begin_inset Flex CharStyle:Code
9443 \begin_layout Plain Layout
9450 \begin_inset Flex CharStyle:Code
9453 \begin_layout Plain Layout
9454 Centered_Top_Environment
9459 are special cases of
9460 \begin_inset Flex CharStyle:Code
9463 \begin_layout Plain Layout
9470 The label will be printed above the paragraph, but only at the top of an
9471 environment or the top of a chain of paragraphs with this layout.
9472 Usage is for example the
9473 \begin_inset Flex CharStyle:MenuItem
9476 \begin_layout Plain Layout
9483 \begin_inset Flex CharStyle:MenuItem
9486 \begin_layout Plain Layout
9493 This is also the case for
9494 \begin_inset Flex CharStyle:Code
9497 \begin_layout Plain Layout
9503 labels with latex type
9504 \begin_inset Flex CharStyle:Code
9507 \begin_layout Plain Layout
9513 , in order to make layouts for theorems work correctly.
9515 \begin_inset Flex CharStyle:Code
9518 \begin_layout Plain Layout
9524 is a special case for the caption-labels
9525 \begin_inset Quotes eld
9529 \begin_inset Quotes erd
9533 \begin_inset Quotes eld
9537 \begin_inset Quotes erd
9542 \begin_inset Flex CharStyle:Code
9545 \begin_layout Plain Layout
9551 means the (hardcoded) label string depends on the kind of float.
9553 \begin_inset Flex CharStyle:Code
9556 \begin_layout Plain Layout
9562 label type defines automatically numbered labels.
9564 \begin_inset CommandInset ref
9566 reference "sec:counter"
9573 \begin_layout Description
9574 \begin_inset Flex CharStyle:Code
9577 \begin_layout Plain Layout
9583 The name of the corresponding LaTeX stuff.
9584 Either the environment or command name.
9587 \begin_layout Description
9588 \begin_inset Flex CharStyle:Code
9591 \begin_layout Plain Layout
9597 An optional parameter for the corresponding
9598 \begin_inset Flex CharStyle:Code
9601 \begin_layout Plain Layout
9608 This parameter cannot be changed from within LyX.
9611 \begin_layout Description
9612 \begin_inset Flex CharStyle:Code
9615 \begin_layout Plain Layout
9622 \begin_inset CommandInset label
9624 name "des:LatexType"
9629 \begin_inset Flex CharStyle:Code
9632 \begin_layout Plain Layout
9637 , Command, Environment, Item_Environment,
9643 \begin_inset Flex CharStyle:Code
9646 \begin_layout Plain Layout
9652 ] How the layout should be translated into LaTeX.
9654 \begin_inset Flex CharStyle:Code
9657 \begin_layout Plain Layout
9663 means nothing special.
9665 \begin_inset Flex CharStyle:Code
9668 \begin_layout Plain Layout
9675 \begin_inset Flex CharStyle:Code
9678 \begin_layout Plain Layout
9685 {\SpecialChar \ldots{}
9692 \begin_inset Flex CharStyle:Code
9695 \begin_layout Plain Layout
9702 \begin_inset Flex CharStyle:Code
9705 \begin_layout Plain Layout
9712 }\SpecialChar \ldots{}
9726 \begin_inset Flex CharStyle:Code
9729 \begin_layout Plain Layout
9736 \begin_inset Flex CharStyle:Code
9739 \begin_layout Plain Layout
9746 \begin_inset Flex CharStyle:Code
9749 \begin_layout Plain Layout
9757 is generated for each paragraph of this environment.
9759 \begin_inset Flex CharStyle:Code
9762 \begin_layout Plain Layout
9769 \begin_inset Flex CharStyle:Code
9772 \begin_layout Plain Layout
9779 \begin_inset Flex CharStyle:Code
9782 \begin_layout Plain Layout
9788 is passed as an argument to the environment.
9790 \begin_inset Flex CharStyle:Code
9793 \begin_layout Plain Layout
9799 can be defined in the
9800 \begin_inset Flex CharStyle:MenuItem
9803 \begin_layout Plain Layout
9808 ayout\SpecialChar \menuseparator
9820 \begin_inset Flex CharStyle:Code
9823 \begin_layout Plain Layout
9831 is perhaps a bit misleading, since these rules apply to SGML classes, too.
9832 Visit the SGML class files for specific examples.
9835 \begin_layout Standard
9836 Putting the last few things together, the LaTeX output will be either:
9839 \begin_layout LyX-Code
9842 latexname[latexparam]{\SpecialChar \ldots{}
9846 \begin_layout Standard
9850 \begin_layout LyX-Code
9853 begin{latexname}[latexparam] \SpecialChar \ldots{}
9859 \begin_layout Standard
9860 depending upon the LaTex type.
9863 \begin_layout Description
9864 \begin_inset Flex CharStyle:Code
9867 \begin_layout Plain Layout
9874 \begin_inset Flex CharStyle:Code
9877 \begin_layout Plain Layout
9883 ] If you put layouts into environments, the leftmargins are not simply added,
9884 but added with a factor
9885 \begin_inset Formula $\frac{4}{depth+4}$
9889 Note that this parameter is also used when the margin is defined as
9890 \begin_inset Flex CharStyle:Code
9893 \begin_layout Plain Layout
9900 \begin_inset Flex CharStyle:Code
9903 \begin_layout Plain Layout
9910 Then it is added to the manual or dynamic margin.
9912 \begin_inset Newline newline
9915 The argument is passed as a string.
9917 \begin_inset Quotes eld
9921 \begin_inset Flex CharStyle:Code
9924 \begin_layout Plain Layout
9931 \begin_inset Quotes erd
9934 means that the paragraph is indented with the width of
9935 \begin_inset Quotes eld
9939 \begin_inset Flex CharStyle:Code
9942 \begin_layout Plain Layout
9949 \begin_inset Quotes erd
9953 You can get a negative width by prefixing the string with
9954 \begin_inset Quotes eld
9958 \begin_inset Flex CharStyle:Code
9961 \begin_layout Plain Layout
9968 \begin_inset Quotes erd
9972 This way was chosen so that the look is the same with each used screen
9977 \begin_layout Description
9978 \begin_inset Flex CharStyle:Code
9981 \begin_layout Plain Layout
9988 \begin_inset Flex CharStyle:Code
9991 \begin_layout Plain Layout
9996 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10002 \begin_inset Newline newline
10005 The kind of margin that the layout has on the left side.
10007 \begin_inset Flex CharStyle:Code
10010 \begin_layout Plain Layout
10016 just means a fixed margin.
10018 \begin_inset Flex CharStyle:Code
10021 \begin_layout Plain Layout
10027 means that the left margin depends on the string entered in the
10028 \begin_inset Flex CharStyle:MenuItem
10031 \begin_layout Plain Layout
10032 Edit\SpecialChar \menuseparator
10034 \begin_inset space ~
10043 This is used to typeset nice lists without tabulators.
10045 \begin_inset Flex CharStyle:Code
10048 \begin_layout Plain Layout
10054 means that the margin depends on the size of the label.
10055 This is used for automatic enumerated headlines.
10056 It is obvious that the headline
10057 \begin_inset Quotes eld
10060 5.4.3.2.1 Very long headline
10061 \begin_inset Quotes erd
10064 must have a wider left margin (as wide as
10065 \begin_inset Quotes eld
10069 \begin_inset Quotes erd
10072 plus the space) than
10073 \begin_inset Quotes eld
10076 3.2 Very long headline
10077 \begin_inset Quotes erd
10081 \begin_inset Quotes eld
10085 \begin_inset Quotes erd
10088 are not able to do this.
10090 \begin_inset Flex CharStyle:Code
10093 \begin_layout Plain Layout
10099 is similar, but only the very first row of the paragraph is dynamic, while
10100 the others are static; this is used, for example, for descriptions.
10102 \begin_inset Flex CharStyle:Code
10105 \begin_layout Plain Layout
10111 means the margin is chosen in a way that the longest row of this paragraph
10112 fits to the right margin.
10113 This is used to typeset an address on the right edge of the page.
10116 \begin_layout Description
10117 \begin_inset Flex CharStyle:Code
10120 \begin_layout Plain Layout
10127 \begin_inset Flex CharStyle:Code
10130 \begin_layout Plain Layout
10139 \begin_inset Flex CharStyle:Code
10142 \begin_layout Plain Layout
10148 ] Whether fragile commands in this layout should be
10149 \begin_inset Flex CharStyle:Code
10152 \begin_layout Plain Layout
10165 whether this command should itself be protected.)
10168 \begin_layout Description
10169 \begin_inset Flex CharStyle:Code
10172 \begin_layout Plain Layout
10179 \begin_inset Flex CharStyle:Code
10182 \begin_layout Plain Layout
10189 \begin_inset Flex CharStyle:Code
10192 \begin_layout Plain Layout
10200 ] Whether newlines are translated into LaTeX newlines (
10201 \begin_inset Flex CharStyle:Code
10204 \begin_layout Plain Layout
10215 The translation can be switched off to allow more comfortable LaTeX editing
10219 \begin_layout Description
10220 \begin_inset Flex CharStyle:Code
10223 \begin_layout Plain Layout
10230 \begin_inset Flex CharStyle:Code
10233 \begin_layout Plain Layout
10240 \begin_inset Flex CharStyle:Code
10243 \begin_layout Plain Layout
10251 ] Whether the following Paragraph is allowed to indent its very first row.
10253 \begin_inset Flex CharStyle:Code
10256 \begin_layout Plain Layout
10262 means that it is not allowed to do so;
10263 \begin_inset Flex CharStyle:Code
10266 \begin_layout Plain Layout
10272 means it could do so if it wants to.
10275 \begin_layout Description
10276 \begin_inset Flex CharStyle:Code
10279 \begin_layout Plain Layout
10285 Name of a layout that has replaced this layout.
10286 This is used to rename a layout, while keeping backward compatibility.
10289 \begin_layout Description
10290 \begin_inset Flex CharStyle:Code
10293 \begin_layout Plain Layout
10300 \begin_inset Flex CharStyle:Code
10303 \begin_layout Plain Layout
10309 ] The number of optional arguments that can be used with this layout.
10310 This is useful for things like section headings, and only makes sense with
10314 \begin_layout Description
10315 \begin_inset Flex CharStyle:Code
10318 \begin_layout Plain Layout
10325 \begin_inset Flex CharStyle:Code
10328 \begin_layout Plain Layout
10334 ] The indent of the very first line of a paragraph.
10336 \begin_inset Flex CharStyle:Code
10339 \begin_layout Plain Layout
10345 will be fixed for a certain layout.
10346 The exception is Standard layout, since the indentation of a Standard layout
10347 paragraph can be prohibited with
10348 \begin_inset Flex CharStyle:Code
10351 \begin_layout Plain Layout
10358 Also, Standard layout paragraphs inside environments use the
10359 \begin_inset Flex CharStyle:Code
10362 \begin_layout Plain Layout
10368 of the environment, not their native one.
10369 For example, Standard paragraphs inside an enumeration are not indented.
10372 \begin_layout Description
10373 \begin_inset Flex CharStyle:Code
10376 \begin_layout Plain Layout
10383 \begin_inset Flex CharStyle:Code
10386 \begin_layout Plain Layout
10392 ] The vertical space between two paragraphs of this layout.
10395 \begin_layout Description
10396 \begin_inset Flex CharStyle:Code
10399 \begin_layout Plain Layout
10406 \begin_inset Flex CharStyle:Code
10409 \begin_layout Plain Layout
10415 ] LyX allows the user to choose either
10416 \begin_inset Quotes eld
10420 \begin_inset Quotes erd
10424 \begin_inset Quotes eld
10428 \begin_inset Quotes erd
10431 to typeset a document.
10433 \begin_inset Quotes eld
10437 \begin_inset Quotes erd
10440 is chosen, this value is completely ignored.
10442 \begin_inset Quotes eld
10446 \begin_inset Quotes erd
10449 is chosen, the parindent of a LaTeXtype
10450 \begin_inset Quotes eld
10454 \begin_inset Quotes erd
10457 layout is ignored and all paragraphs are separated by this parskip argument.
10458 The vertical space is calculated with
10459 \begin_inset Flex CharStyle:Code
10462 \begin_layout Plain Layout
10464 \begin_inset space ~
10473 \begin_inset Flex CharStyle:Code
10476 \begin_layout Plain Layout
10482 is the height of a row with the normal font.
10483 This way, the look stays the same with different screen fonts.
10486 \begin_layout Description
10487 \begin_inset Flex CharStyle:Code
10490 \begin_layout Plain Layout
10497 \begin_inset CommandInset label
10499 name "des:PathThru"
10506 \begin_inset Flex CharStyle:Code
10509 \begin_layout Plain Layout
10520 \begin_inset Flex CharStyle:Code
10523 \begin_layout Plain Layout
10529 ] Whether the contents of this paragraph should be output in raw form, meaning
10530 without special translations that LaTeX would require.
10533 \begin_layout Description
10534 \begin_inset Flex CharStyle:Code
10537 \begin_layout Plain Layout
10544 \begin_inset CommandInset label
10546 name "des:Preamble"
10550 Information to be included in the LaTeX preamable when this style is used.
10551 Used to define macros, load packages, etc., required by this particular
10554 \begin_inset Quotes eld
10558 \begin_inset Flex CharStyle:Code
10561 \begin_layout Plain Layout
10568 \begin_inset Quotes erd
10574 \begin_layout Description
10575 \begin_inset Flex CharStyle:Code
10578 \begin_layout Plain Layout
10585 \begin_inset Flex CharStyle:Code
10588 \begin_layout Plain Layout
10595 \begin_inset CommandInset label
10597 name "des:Requires"
10601 Whether the layout requires the feature
10602 \begin_inset Flex CharStyle:Code
10605 \begin_layout Plain Layout
10612 See the description of
10613 \begin_inset Flex CharStyle:Code
10616 \begin_layout Plain Layout
10623 \begin_inset CommandInset ref
10624 LatexCommand pageref
10625 reference "des:FreeSpacing"
10629 ) for information on `features'.
10633 \begin_layout Description
10634 \begin_inset Flex CharStyle:Code
10637 \begin_layout Plain Layout
10644 \begin_inset Flex CharStyle:Code
10647 \begin_layout Plain Layout
10654 \begin_inset Flex CharStyle:Code
10657 \begin_layout Plain Layout
10666 \begin_layout Description
10667 \begin_inset Flex CharStyle:Code
10670 \begin_layout Plain Layout
10677 \begin_inset Flex CharStyle:Code
10680 \begin_layout Plain Layout
10685 , onehalf, double, other
10694 ] This defines what the default spacing should be in the layout.
10696 \begin_inset Flex CharStyle:Code
10699 \begin_layout Plain Layout
10706 \begin_inset Flex CharStyle:Code
10709 \begin_layout Plain Layout
10716 \begin_inset Flex CharStyle:Code
10719 \begin_layout Plain Layout
10725 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
10726 If you specify the argument
10727 \begin_inset Flex CharStyle:Code
10730 \begin_layout Plain Layout
10736 , then you should also provide a numerical argument which will be the actual
10738 Note that, contrary to other parameters,
10739 \begin_inset Flex CharStyle:Code
10742 \begin_layout Plain Layout
10748 implies the generation of specific LaTeX code, using the package
10751 \begin_inset Flex CharStyle:Code
10754 \begin_layout Plain Layout
10763 \begin_layout Description
10764 \begin_inset Flex CharStyle:Code
10767 \begin_layout Plain Layout
10773 The font used for the text body .
10775 \begin_inset CommandInset ref
10777 reference "sec:fonts"
10784 \begin_layout Description
10785 \begin_inset Flex CharStyle:Code
10788 \begin_layout Plain Layout
10796 The level of the style in the table of contents.
10797 This is used for automatic numbering of section headings.
10800 \begin_layout Description
10801 \begin_inset Flex CharStyle:Code
10804 \begin_layout Plain Layout
10811 \begin_inset Flex CharStyle:Code
10814 \begin_layout Plain Layout
10820 ] The vertical space with which the very first of a chain of paragraphs
10821 with this layout is separated from the previous paragraph.
10822 If the previous paragraph has another layout, the separations are not simply
10823 added, but the maximum is taken.
10826 \begin_layout Subsection
10830 \begin_layout Standard
10831 \begin_inset CommandInset label
10837 Since version 1.3.0 of LyX, it is has been both possible and necessary to
10838 define the floats (
10839 \begin_inset Flex CharStyle:MenuItem
10842 \begin_layout Plain Layout
10849 \begin_inset Flex CharStyle:MenuItem
10852 \begin_layout Plain Layout
10858 , \SpecialChar \ldots{}
10859 ) in the text class itself.
10860 Standard floats are included in the file
10861 \begin_inset Flex CharStyle:Code
10864 \begin_layout Plain Layout
10870 , so you may have to do no more than add
10873 \begin_layout LyX-Code
10874 Input stdfloats.inc
10877 \begin_layout Standard
10878 to your layout file.
10879 If you want to implement a text class that proposes some other float types
10880 (like the AGU class bundled with LyX), the information below will hopefully
10884 \begin_layout Description
10885 \begin_inset Flex CharStyle:Code
10888 \begin_layout Plain Layout
10895 \begin_inset Flex CharStyle:Code
10898 \begin_layout Plain Layout
10905 \begin_inset Quotes erd
10909 \begin_inset Quotes erd
10912 ] The file name extension of an auxiliary file for the list of figures (or
10914 LaTeX writes the captions to this file.
10917 \begin_layout Description
10918 \begin_inset Flex CharStyle:Code
10921 \begin_layout Plain Layout
10928 \begin_inset Flex CharStyle:Code
10931 \begin_layout Plain Layout
10938 \begin_inset Quotes erd
10942 \begin_inset Quotes erd
10945 ] The string that will be used in the menus and also for the caption.
10948 \begin_layout Description
10949 \begin_inset Flex CharStyle:Code
10952 \begin_layout Plain Layout
10959 \begin_inset Flex CharStyle:Code
10962 \begin_layout Plain Layout
10971 \begin_inset Flex CharStyle:Code
10974 \begin_layout Plain Layout
10981 \begin_inset Flex CharStyle:Code
10984 \begin_layout Plain Layout
10990 if the float is already defined by the LaTeX document class.
10992 \begin_inset Flex CharStyle:Code
10995 \begin_layout Plain Layout
11001 , the float will be defined using the LaTeX package
11002 \begin_inset Flex CharStyle:Code
11005 \begin_layout Plain Layout
11014 \begin_layout Description
11015 \begin_inset Flex CharStyle:Code
11018 \begin_layout Plain Layout
11025 \begin_inset Flex CharStyle:Code
11028 \begin_layout Plain Layout
11035 \begin_inset Quotes erd
11039 \begin_inset Quotes erd
11042 ] The heading used for the list of floats.
11045 \begin_layout Description
11046 \begin_inset Flex CharStyle:Code
11049 \begin_layout Plain Layout
11056 \begin_inset Flex CharStyle:Code
11059 \begin_layout Plain Layout
11066 \begin_inset Quotes erd
11070 \begin_inset Quotes erd
11073 ] This (optional) argument determines whether floats of this class will
11074 be numbered within some sectional unit of the document.
11075 For example, if within is equal to
11076 \begin_inset Flex CharStyle:Code
11079 \begin_layout Plain Layout
11085 , the floats will be numbered within chapters.
11089 \begin_layout Description
11090 \begin_inset Flex CharStyle:Code
11093 \begin_layout Plain Layout
11100 \begin_inset Flex CharStyle:Code
11103 \begin_layout Plain Layout
11110 \begin_inset Quotes erd
11114 \begin_inset Quotes erd
11117 ] The default placement for the given class of floats.
11118 The string should be as in standard LaTeX:
11119 \begin_inset Flex CharStyle:Code
11122 \begin_layout Plain Layout
11129 \begin_inset Flex CharStyle:Code
11132 \begin_layout Plain Layout
11139 \begin_inset Flex CharStyle:Code
11142 \begin_layout Plain Layout
11149 \begin_inset Flex CharStyle:Code
11152 \begin_layout Plain Layout
11158 for top, bottom, page, and here, respectively.
11162 \begin_layout Plain Layout
11163 Note that the order of these letters in the string is irrelevant, like in
11169 On top of that there is a new type,
11170 \begin_inset Flex CharStyle:Code
11173 \begin_layout Plain Layout
11179 , which does not really correspond to a float, since it means: put it
11180 \begin_inset Quotes eld
11184 \begin_inset Quotes erd
11188 Note however that the
11189 \begin_inset Flex CharStyle:Code
11192 \begin_layout Plain Layout
11198 specifier is special and, because of implementation details, cannot be
11199 used in non-builtin float types.
11200 If you do not understand what this means, just use
11201 \begin_inset Quotes eld
11205 \begin_inset Flex CharStyle:Code
11208 \begin_layout Plain Layout
11215 \begin_inset Quotes erd
11221 \begin_layout Description
11222 \begin_inset Flex CharStyle:Code
11225 \begin_layout Plain Layout
11232 \begin_inset Flex CharStyle:Code
11235 \begin_layout Plain Layout
11242 \begin_inset Quotes erd
11246 \begin_inset Quotes erd
11249 ] The style used when defining the float using
11250 \begin_inset Flex CharStyle:Code
11253 \begin_layout Plain Layout
11264 \begin_layout Description
11265 \begin_inset Flex CharStyle:Code
11268 \begin_layout Plain Layout
11275 \begin_inset Flex CharStyle:Code
11278 \begin_layout Plain Layout
11285 \begin_inset Quotes erd
11289 \begin_inset Quotes erd
11293 \begin_inset Quotes eld
11297 \begin_inset Quotes erd
11300 of the new class of floats, like program or algorithm.
11301 After the appropriate
11302 \begin_inset Flex CharStyle:Code
11305 \begin_layout Plain Layout
11314 \begin_inset Flex CharStyle:Code
11317 \begin_layout Plain Layout
11326 \begin_inset Flex CharStyle:Code
11329 \begin_layout Plain Layout
11340 \begin_layout Standard
11341 Note that defining a float with type
11342 \begin_inset Flex CharStyle:Code
11345 \begin_layout Plain Layout
11353 automatically defines the corresponding counter with name
11354 \begin_inset Flex CharStyle:Code
11357 \begin_layout Plain Layout
11368 \begin_layout Subsection
11369 Flex insets and InsetLayout
11372 \begin_layout Standard
11373 \begin_inset CommandInset label
11375 name "sec:charstyle"
11379 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11380 these are called Flex insets.
11384 \begin_layout Standard
11385 Flex insets come in three different kinds:
11388 \begin_layout Itemize
11390 \begin_inset Flex CharStyle:Code
11393 \begin_layout Plain Layout
11399 ): These define semantic markup corresponding to such LaTeX commands as
11401 \begin_inset Flex CharStyle:Code
11404 \begin_layout Plain Layout
11413 \begin_inset Flex CharStyle:Code
11416 \begin_layout Plain Layout
11427 \begin_layout Itemize
11429 \begin_inset Flex CharStyle:Code
11432 \begin_layout Plain Layout
11438 ): These can be used to define custom collapsable insets, similar to ERT,
11439 footnote, and the like.
11440 An obvious example is an endnote inset, which is defined in the
11441 \begin_inset Flex CharStyle:Code
11444 \begin_layout Plain Layout
11453 \begin_layout Itemize
11455 \begin_inset Flex CharStyle:Code
11458 \begin_layout Plain Layout
11464 ): For use with DocBook classes.
11467 \begin_layout Standard
11468 Flex insets are defined using the
11469 \begin_inset Flex CharStyle:Code
11472 \begin_layout Plain Layout
11478 tag, which shall be explained in a moment.
11481 \begin_layout Standard
11483 \begin_inset Flex CharStyle:Code
11486 \begin_layout Plain Layout
11492 tag also serves another function: It can be used to customize the general
11493 layout of many different types of insets.
11495 \begin_inset Flex CharStyle:Code
11498 \begin_layout Plain Layout
11504 can be used to customize the layout parameters for footnotes, marginal
11505 notes, note insets, ERT insets, branches, listings, indexes, boxes, tables,
11506 algorithms, URLs, and optional arguments, as well as to define Flex insets.
11509 \begin_layout Standard
11511 \begin_inset Flex CharStyle:Code
11514 \begin_layout Plain Layout
11520 definition must begin with a line of the form:
11523 \begin_layout LyX-Code
11527 \begin_layout Standard
11529 \begin_inset Flex CharStyle:Code
11532 \begin_layout Plain Layout
11538 indicates the inset whose layout is being defined, and here there are two
11542 \begin_layout Enumerate
11543 The layout for a pre-existing inset is being modified.
11544 In this case, can be
11545 \begin_inset Flex CharStyle:Code
11548 \begin_layout Plain Layout
11554 any one of the following:
11555 \begin_inset Flex CharStyle:Code
11558 \begin_layout Plain Layout
11565 \begin_inset Flex CharStyle:Code
11568 \begin_layout Plain Layout
11575 \begin_inset Flex CharStyle:Code
11578 \begin_layout Plain Layout
11585 \begin_inset Flex CharStyle:Code
11588 \begin_layout Plain Layout
11595 \begin_inset Flex CharStyle:Code
11598 \begin_layout Plain Layout
11605 \begin_inset Flex CharStyle:Code
11608 \begin_layout Plain Layout
11615 \begin_inset Flex CharStyle:Code
11618 \begin_layout Plain Layout
11625 \begin_inset Flex CharStyle:Code
11628 \begin_layout Plain Layout
11635 \begin_inset Flex CharStyle:Code
11638 \begin_layout Plain Layout
11645 \begin_inset Flex CharStyle:Code
11648 \begin_layout Plain Layout
11655 \begin_inset Flex CharStyle:Code
11658 \begin_layout Plain Layout
11665 \begin_inset Flex CharStyle:Code
11668 \begin_layout Plain Layout
11675 \begin_inset Flex CharStyle:Code
11678 \begin_layout Plain Layout
11685 \begin_inset Flex CharStyle:Code
11688 \begin_layout Plain Layout
11695 \begin_inset Flex CharStyle:Code
11698 \begin_layout Plain Layout
11705 \begin_inset Flex CharStyle:Code
11708 \begin_layout Plain Layout
11715 \begin_inset Flex CharStyle:Code
11718 \begin_layout Plain Layout
11725 \begin_inset Flex CharStyle:Code
11728 \begin_layout Plain Layout
11735 \begin_inset Flex CharStyle:Code
11738 \begin_layout Plain Layout
11745 \begin_inset Flex CharStyle:Code
11748 \begin_layout Plain Layout
11758 \begin_layout Enumerate
11759 The layout for a Flex inset is being defined.
11761 \begin_inset Flex CharStyle:Code
11764 \begin_layout Plain Layout
11770 should have the form
11771 \begin_inset Flex CharStyle:Code
11774 \begin_layout Plain Layout
11781 \begin_inset Flex CharStyle:Code
11784 \begin_layout Plain Layout
11791 \begin_inset Flex CharStyle:Code
11794 \begin_layout Plain Layout
11801 \begin_inset Flex CharStyle:Code
11804 \begin_layout Plain Layout
11811 \begin_inset Flex CharStyle:Code
11814 \begin_layout Plain Layout
11821 \begin_inset Flex CharStyle:Code
11824 \begin_layout Plain Layout
11830 is any valid identifier.
11832 \begin_inset Flex CharStyle:Code
11835 \begin_layout Plain Layout
11841 indicates on which menu the inset should appear: In the default menu structure,
11843 \begin_inset Flex CharStyle:Code
11846 \begin_layout Plain Layout
11853 \begin_inset Flex CharStyle:Code
11856 \begin_layout Plain Layout
11862 insets appear under
11863 \begin_inset Flex CharStyle:MenuItem
11866 \begin_layout Plain Layout
11867 Edit\SpecialChar \menuseparator
11874 \begin_inset Flex CharStyle:Code
11877 \begin_layout Plain Layout
11883 insets appear under
11884 \begin_inset Flex CharStyle:MenuItem
11887 \begin_layout Plain Layout
11888 Insert\SpecialChar \menuseparator
11895 Note that the definition of a flex inset must
11900 \begin_inset Flex CharStyle:Code
11903 \begin_layout Plain Layout
11912 \begin_layout Standard
11914 \begin_inset Flex CharStyle:Code
11917 \begin_layout Plain Layout
11923 definition can contain the following entries:
11926 \begin_layout Description
11927 \begin_inset Flex CharStyle:Code
11930 \begin_layout Plain Layout
11936 The color for the inset's background.
11937 The valid colors are defined in
11938 \begin_inset Flex CharStyle:Code
11941 \begin_layout Plain Layout
11950 \begin_layout Description
11951 \begin_inset Flex CharStyle:Code
11954 \begin_layout Plain Layout
11960 As with paragraph styles (see page
11961 \begin_inset CommandInset ref
11963 reference "des:CopyStyle"
11970 \begin_layout Description
11971 \begin_inset Flex CharStyle:Code
11974 \begin_layout Plain Layout
11981 \begin_inset Flex CharStyle:Code
11984 \begin_layout Plain Layout
11993 \begin_inset Flex CharStyle:Code
11996 \begin_layout Plain Layout
12002 ] Indicates whether the user may employ the Paragraph Settings dialog to
12003 customize the paragraph.
12006 \begin_layout Description
12007 \begin_inset Flex CharStyle:Code
12010 \begin_layout Plain Layout
12017 \begin_inset Flex CharStyle:Code
12020 \begin_layout Plain Layout
12027 \begin_inset Flex CharStyle:Code
12030 \begin_layout Plain Layout
12037 \begin_inset Flex CharStyle:Code
12040 \begin_layout Plain Layout
12046 , describing the rendering style used for the inset's frame and buttons.
12047 Footnotes generally use
12048 \begin_inset Flex CharStyle:Code
12051 \begin_layout Plain Layout
12057 , ERT insets generally
12058 \begin_inset Flex CharStyle:Code
12061 \begin_layout Plain Layout
12067 , and character styles
12068 \begin_inset Flex CharStyle:Code
12071 \begin_layout Plain Layout
12080 \begin_layout Description
12081 \begin_inset Flex CharStyle:Code
12084 \begin_layout Plain Layout
12090 Required at the end of the InsetLayout declarations.
12093 \begin_layout Description
12094 \begin_inset Flex CharStyle:Code
12097 \begin_layout Plain Layout
12103 The font used for both the text body
12109 \begin_inset space ~
12113 \begin_inset CommandInset ref
12115 reference "sec:fonts"
12120 Note that defining this font automatically defines the
12121 \begin_inset Flex CharStyle:Code
12124 \begin_layout Plain Layout
12130 to the same value, so define this first and define
12131 \begin_inset Flex CharStyle:Code
12134 \begin_layout Plain Layout
12140 later if you want them to be different.
12143 \begin_layout Description
12144 \begin_inset Flex CharStyle:Code
12147 \begin_layout Plain Layout
12154 \begin_inset Quotes eld
12158 \begin_inset Quotes erd
12161 language, leading to Left-to-Right (latin) output, e.g.
12162 \begin_inset space \space{}
12169 \begin_layout Description
12170 \begin_inset Flex CharStyle:Code
12173 \begin_layout Plain Layout
12180 \begin_inset Flex CharStyle:Code
12183 \begin_layout Plain Layout
12192 \begin_inset Flex CharStyle:Code
12195 \begin_layout Plain Layout
12201 ] Indicates whether the PlainLayout should be used or, instead, the user
12202 can change the paragraph style used in the inset.
12205 \begin_layout Description
12206 \begin_inset Flex CharStyle:Code
12209 \begin_layout Plain Layout
12215 As with paragraph styles (see page
12216 \begin_inset CommandInset ref
12217 LatexCommand pageref
12218 reference "des:FreeSpacing"
12225 \begin_layout Description
12226 \begin_inset Flex CharStyle:Code
12229 \begin_layout Plain Layout
12235 As with paragraph styles (see page
12236 \begin_inset CommandInset ref
12237 LatexCommand pageref
12238 reference "des:KeepEmpty"
12245 \begin_layout Description
12246 \begin_inset Flex CharStyle:Code
12249 \begin_layout Plain Layout
12255 The font used for the label.
12257 \begin_inset space ~
12261 \begin_inset CommandInset ref
12263 reference "sec:fonts"
12268 Note that this definition can never appear before
12269 \begin_inset Flex CharStyle:Code
12272 \begin_layout Plain Layout
12278 , lest it be ineffective.
12281 \begin_layout Description
12282 \begin_inset Flex CharStyle:Code
12285 \begin_layout Plain Layout
12291 What will be displayed on the button or elsewhere as the inset label.
12292 Some inset types (ERT and Branch) modify this label on the fly.
12295 \begin_layout Description
12296 \begin_inset Flex CharStyle:Code
12299 \begin_layout Plain Layout
12305 The name of the corresponding LaTeX stuff.
12306 Either the environment or command name.
12309 \begin_layout Description
12310 \begin_inset Flex CharStyle:Code
12313 \begin_layout Plain Layout
12319 The optional parameter for the corresponding
12320 \begin_inset Flex CharStyle:Code
12323 \begin_layout Plain Layout
12329 stuff, including possible bracket pairs like
12330 \begin_inset Flex CharStyle:Code
12333 \begin_layout Plain Layout
12340 This parameter cannot be changed from within LyX.
12343 \begin_layout Description
12344 \begin_inset Flex CharStyle:Code
12347 \begin_layout Plain Layout
12353 As with paragraph styles (see page
12354 \begin_inset CommandInset ref
12355 LatexCommand pageref
12356 reference "des:LatexType"
12363 \begin_layout Description
12364 \begin_inset Flex CharStyle:Code
12367 \begin_layout Plain Layout
12374 \begin_inset Flex CharStyle:Code
12377 \begin_layout Plain Layout
12384 \begin_inset Flex CharStyle:Code
12387 \begin_layout Plain Layout
12394 \begin_inset Flex CharStyle:Code
12397 \begin_layout Plain Layout
12404 \begin_inset Flex CharStyle:Code
12407 \begin_layout Plain Layout
12413 (indicating a dummy definition ending definitions of charstyles, etc).
12414 This entry is required in and is only meaningful for Flex insets.
12417 \begin_layout Description
12418 \begin_inset Flex CharStyle:Code
12421 \begin_layout Plain Layout
12428 \begin_inset Flex CharStyle:Code
12431 \begin_layout Plain Layout
12440 \begin_inset Flex CharStyle:Code
12443 \begin_layout Plain Layout
12449 ] Whether multiple paragraphs are permitted in this inset.
12450 This will also set CustomPars to the same value and ForcePlain to the opposite
12452 These can be reset to other values, if they are used
12459 \begin_layout Description
12460 \begin_inset Flex CharStyle:Code
12463 \begin_layout Plain Layout
12470 \begin_inset Flex CharStyle:Code
12473 \begin_layout Plain Layout
12482 \begin_inset Flex CharStyle:Code
12485 \begin_layout Plain Layout
12491 ] Whether fragile commands in this layout should be
12492 \begin_inset Flex CharStyle:Code
12495 \begin_layout Plain Layout
12508 whether the command should itself be protected.)
12511 \begin_layout Description
12512 \begin_inset Flex CharStyle:Code
12515 \begin_layout Plain Layout
12522 \begin_inset Flex CharStyle:Code
12525 \begin_layout Plain Layout
12534 \begin_inset Flex CharStyle:Code
12537 \begin_layout Plain Layout
12543 ] As with paragraph styles (see page
12544 \begin_inset CommandInset ref
12546 reference "des:PathThru"
12553 \begin_layout Description
12554 \begin_inset Flex CharStyle:Code
12557 \begin_layout Plain Layout
12563 As with paragraph styles (see page
12564 \begin_inset CommandInset ref
12565 LatexCommand pageref
12566 reference "des:Preamble"
12573 \begin_layout Description
12574 \begin_inset Flex CharStyle:Code
12577 \begin_layout Plain Layout
12584 \begin_inset Flex CharStyle:Code
12587 \begin_layout Plain Layout
12593 ] As with paragraph styles (see page
12594 \begin_inset CommandInset ref
12595 LatexCommand pageref
12596 reference "des:Requires"
12603 \begin_layout Subsection
12607 \begin_layout Standard
12608 \begin_inset CommandInset label
12614 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12616 \begin_inset Flex CharStyle:MenuItem
12619 \begin_layout Plain Layout
12626 \begin_inset Flex CharStyle:MenuItem
12629 \begin_layout Plain Layout
12635 , \SpecialChar \ldots{}
12636 ) in the text class itself.
12637 The standard counters are defined in the file
12638 \begin_inset Flex CharStyle:Code
12641 \begin_layout Plain Layout
12647 , so you may have to do no more than add
12650 \begin_layout LyX-Code
12651 Input stdcounters.inc
12654 \begin_layout Standard
12655 to your layout file to get them to work.
12656 But if you want to define custom counters, then you can do so.
12657 The counter declaration must begin with:
12660 \begin_layout LyX-Code
12664 \begin_layout Standard
12665 where of course `name' is replaced by the name of the counter.
12666 And it must end with
12667 \begin_inset Quotes eld
12671 \begin_inset Flex CharStyle:Code
12674 \begin_layout Plain Layout
12681 \begin_inset Quotes erd
12685 The following parameters can also be used:
12688 \begin_layout Description
12689 \begin_inset Flex CharStyle:Code
12692 \begin_layout Plain Layout
12693 LabelString [string=""]
12698 when this is defined, this string defines how the counter is displayed.
12699 Setting this value sets
12700 \begin_inset Flex CharStyle:Code
12703 \begin_layout Plain Layout
12704 LabelStringAppendix
12710 The following special constructs can be used in the string:
12714 \begin_layout Itemize
12715 \begin_inset Flex CharStyle:Code
12718 \begin_layout Plain Layout
12726 will be replaced by the expansion of the
12727 \begin_inset Flex CharStyle:Code
12730 \begin_layout Plain Layout
12737 \begin_inset Flex CharStyle:Code
12740 \begin_layout Plain Layout
12741 LabelStringAppendix
12747 \begin_inset Flex CharStyle:Code
12750 \begin_layout Plain Layout
12760 \begin_layout Itemize
12761 counter values can be expressed using LaTeX-like macros
12762 \begin_inset Flex CharStyle:Code
12765 \begin_layout Plain Layout
12782 \begin_inset Flex CharStyle:Code
12785 \begin_layout Plain Layout
12797 \begin_layout Plain Layout
12807 Actually, the situation is a bit more complicated: any
12826 other than those descibed below will produce arabic numerals.
12827 It would not be surprising to see this change in the future.
12833 \begin_inset Flex CharStyle:Code
12836 \begin_layout Plain Layout
12842 : 1, 2, 3,\SpecialChar \ldots{}
12844 \begin_inset Flex CharStyle:Code
12847 \begin_layout Plain Layout
12853 for lower-case letters: a, b, c, \SpecialChar \ldots{}
12855 \begin_inset Flex CharStyle:Code
12858 \begin_layout Plain Layout
12864 for upper-case letters: A, B, C, \SpecialChar \ldots{}
12866 \begin_inset Flex CharStyle:Code
12869 \begin_layout Plain Layout
12875 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
12877 \begin_inset Flex CharStyle:Code
12880 \begin_layout Plain Layout
12886 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
12888 \begin_inset Flex CharStyle:Code
12891 \begin_layout Plain Layout
12897 for hebrew numerals.
12901 \begin_layout Standard
12902 If LabelString is not defined, a default value is constructed as follows:
12903 if the counter has a master counter
12904 \begin_inset Flex CharStyle:Code
12907 \begin_layout Plain Layout
12914 \begin_inset Flex CharStyle:Code
12917 \begin_layout Plain Layout
12924 \begin_inset Flex CharStyle:Code
12927 \begin_layout Plain Layout
12937 is used; otherwise the string
12938 \begin_inset Flex CharStyle:Code
12941 \begin_layout Plain Layout
12952 \begin_layout Description
12953 \begin_inset Flex CharStyle:Code
12956 \begin_layout Plain Layout
12957 LabelStringAppendix [string=""]
12963 \begin_inset Flex CharStyle:Code
12966 \begin_layout Plain Layout
12972 , but for use in the Appendix.
12975 \begin_layout Description
12976 \begin_inset Flex CharStyle:Code
12979 \begin_layout Plain Layout
12986 \begin_inset Flex CharStyle:Code
12989 \begin_layout Plain Layout
12996 \begin_inset Quotes erd
13000 \begin_inset Quotes erd
13003 ] If this is set to the name of another counter, the present counter will
13004 be reset everytime the other one is increased.
13006 \begin_inset Flex CharStyle:Code
13009 \begin_layout Plain Layout
13016 \begin_inset Flex CharStyle:Code
13019 \begin_layout Plain Layout
13028 \begin_layout Subsection
13032 \begin_layout Standard
13033 \begin_inset CommandInset label
13039 A font description looks like this:
13042 \begin_layout LyX-Code
13052 \begin_layout LyX-Code
13056 \begin_layout LyX-Code
13060 \begin_layout Standard
13061 The following commands are available:
13064 \begin_layout Description
13065 \begin_inset Flex CharStyle:Code
13068 \begin_layout Plain Layout
13075 \begin_inset Flex CharStyle:Code
13078 \begin_layout Plain Layout
13087 \begin_inset Flex CharStyle:Code
13090 \begin_layout Plain Layout
13097 \begin_inset Flex CharStyle:Code
13100 \begin_layout Plain Layout
13107 \begin_inset Flex CharStyle:Code
13110 \begin_layout Plain Layout
13117 \begin_inset Flex CharStyle:Code
13120 \begin_layout Plain Layout
13127 \begin_inset Flex CharStyle:Code
13130 \begin_layout Plain Layout
13137 \begin_inset Flex CharStyle:Code
13140 \begin_layout Plain Layout
13147 \begin_inset Flex CharStyle:Code
13150 \begin_layout Plain Layout
13157 \begin_inset Flex CharStyle:Code
13160 \begin_layout Plain Layout
13169 \begin_layout Description
13170 \begin_inset Flex CharStyle:Code
13173 \begin_layout Plain Layout
13182 \begin_inset Flex CharStyle:Code
13185 \begin_layout Plain Layout
13196 \begin_inset Flex CharStyle:Code
13199 \begin_layout Plain Layout
13206 \begin_inset Flex CharStyle:Code
13209 \begin_layout Plain Layout
13218 \begin_layout Description
13219 \begin_inset Flex CharStyle:Code
13222 \begin_layout Plain Layout
13229 \begin_inset Flex CharStyle:Code
13232 \begin_layout Plain Layout
13238 ] Valid argument sare:
13239 \begin_inset Flex CharStyle:Code
13242 \begin_layout Plain Layout
13249 \begin_inset Flex CharStyle:Code
13252 \begin_layout Plain Layout
13259 \begin_inset Flex CharStyle:Code
13262 \begin_layout Plain Layout
13269 \begin_inset Flex CharStyle:Code
13272 \begin_layout Plain Layout
13279 \begin_inset Flex CharStyle:Code
13282 \begin_layout Plain Layout
13289 \begin_inset Flex CharStyle:Code
13292 \begin_layout Plain Layout
13299 Each of these turns on or off the corresponding attribute.
13302 \begin_layout Description
13303 \begin_inset Flex CharStyle:Code
13306 \begin_layout Plain Layout
13315 \begin_inset Flex CharStyle:Code
13318 \begin_layout Plain Layout
13329 \begin_inset Flex CharStyle:Code
13332 \begin_layout Plain Layout
13341 \begin_layout Description
13342 \begin_inset Flex CharStyle:Code
13345 \begin_layout Plain Layout
13354 \begin_inset Flex CharStyle:Code
13357 \begin_layout Plain Layout
13368 \begin_inset Flex CharStyle:Code
13371 \begin_layout Plain Layout
13378 \begin_inset Flex CharStyle:Code
13381 \begin_layout Plain Layout
13388 \begin_inset Flex CharStyle:Code
13391 \begin_layout Plain Layout
13400 \begin_layout Description
13401 \begin_inset Flex CharStyle:Code
13404 \begin_layout Plain Layout
13411 \begin_inset Flex CharStyle:Code
13414 \begin_layout Plain Layout
13421 \begin_inset Flex CharStyle:Code
13424 \begin_layout Plain Layout
13431 \begin_inset Flex CharStyle:Code
13434 \begin_layout Plain Layout
13443 \begin_inset Flex CharStyle:Code
13446 \begin_layout Plain Layout
13453 \begin_inset Flex CharStyle:Code
13456 \begin_layout Plain Layout
13463 \begin_inset Flex CharStyle:Code
13466 \begin_layout Plain Layout
13473 \begin_inset Flex CharStyle:Code
13476 \begin_layout Plain Layout
13483 \begin_inset Flex CharStyle:Code
13486 \begin_layout Plain Layout
13495 \begin_layout Subsection
13496 Upgrading old layout files
13499 \begin_layout Standard
13500 The file format of layout files changes from time to time, so old layout
13501 files need to be converted.
13502 This process has been automated since LyX 1.4.0: If LyX reads an old format
13503 layout file it will call the conversion tool
13504 \begin_inset Flex CharStyle:Code
13507 \begin_layout Plain Layout
13508 LyXDir/scripts/layout2layout.py
13513 and convert it to a temporary file in current format.
13514 The original file is left untouched.
13515 If you want to convert the layout file permanently, just call the converter
13519 \begin_layout LyX-Code
13520 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13523 \begin_layout Standard
13524 (You need to replace
13525 \begin_inset Flex CharStyle:Code
13528 \begin_layout Plain Layout
13534 with the name of your LyX system directory, unless you happen to have defined
13535 such an environment variable.) Then copy
13536 \begin_inset Flex CharStyle:Code
13539 \begin_layout Plain Layout
13546 \begin_inset Flex CharStyle:Code
13549 \begin_layout Plain Layout
13558 \begin_layout Standard
13559 The automatic conversion only handles syntax changes.
13560 It cannot handle the case where the contents of included files was changed,
13561 so these will have to be converted separately.
13564 \begin_layout Section
13566 \begin_inset CommandInset label
13568 name "sec:templates"
13575 \begin_layout Standard
13576 Templates are created just like usual documents.
13577 The only difference is that usual documents contain all possible settings,
13578 including the font scheme and the paper size.
13579 Usually a user doesn't want a template to overwrite his defaults in these
13581 For that reason, the designer of a template should remove the corresponding
13583 \begin_inset Flex CharStyle:Code
13586 \begin_layout Plain Layout
13595 \begin_inset Flex CharStyle:Code
13598 \begin_layout Plain Layout
13606 from the template LyX file.
13607 This can be done with any simple text-editor, for example
13608 \begin_inset Flex CharStyle:Code
13611 \begin_layout Plain Layout
13618 \begin_inset Flex CharStyle:Code
13621 \begin_layout Plain Layout
13631 \begin_layout Standard
13632 Put the edited template files you create in
13633 \begin_inset Flex CharStyle:Code
13636 \begin_layout Plain Layout
13642 , copy the ones you use from the global template directory in
13643 \begin_inset Flex CharStyle:Code
13646 \begin_layout Plain Layout
13652 to the same place, and redefine the template path in the
13653 \begin_inset Flex CharStyle:MenuItem
13656 \begin_layout Plain Layout
13657 Tools\SpecialChar \menuseparator
13658 Preferences\SpecialChar \menuseparator
13667 \begin_layout Standard
13668 Note that there is a template which has a particular meaning:
13669 \begin_inset Flex CharStyle:Code
13672 \begin_layout Plain Layout
13679 This template is loaded everytime you create a new document with
13680 \begin_inset Flex CharStyle:MenuItem
13683 \begin_layout Plain Layout
13684 File\SpecialChar \menuseparator
13690 in order to provide useful defaults.
13691 To create this template from inside LyX, all you have to do is to open
13692 a document with the correct settings, and use the
13693 \begin_inset Flex CharStyle:MenuItem
13696 \begin_layout Plain Layout
13697 Save as Document Defaults
13705 \begin_layout Chapter
13706 Including External Material
13709 \begin_layout Standard
13710 \begin_inset Box Shadowbox
13719 height_special "totalheight"
13722 \begin_layout Plain Layout
13723 WARNING: This portion of the documentation has not been updated for some
13725 We certainly hope that it is still accurate, but there are no guarantees.
13733 \begin_layout Standard
13734 The use of material from sources external to LyX is covered in detail in
13740 This part of the manual covers what needs to happen behind the scenes for
13741 new sorts of material to be included.
13744 \begin_layout Section
13748 \begin_layout Standard
13749 The external material feature is based on the concept of a
13754 A template is a specification of how LyX should interface with a certain
13756 As bundled, LyX comes with predefined templates for Xfig figures, various
13757 raster format images, chess diagrams, and LilyPond music notation.
13758 You can check the actual list by using the menu
13759 \begin_inset Flex CharStyle:MenuItem
13762 \begin_layout Plain Layout
13763 Insert\SpecialChar \menuseparator
13764 File\SpecialChar \menuseparator
13771 Furthermore, it is possible to roll your own template to support a specific
13773 Later we'll describe in more detail what is involved, and hopefully you
13774 will submit all the templates you create so we can include them in a later
13778 \begin_layout Standard
13779 Another basic idea of the external material feature is to distinguish between
13780 the original file that serves as a base for final material and the produced
13781 file that is included in your exported or printed document.
13782 For example, consider the case of a figure produced with
13783 \begin_inset Flex CharStyle:Code
13786 \begin_layout Plain Layout
13793 The Xfig application itself works on an original file with the
13794 \begin_inset Flex CharStyle:Code
13797 \begin_layout Plain Layout
13804 Within XFig, you create and change your figure, and when you are done,
13806 \begin_inset Flex CharStyle:Code
13809 \begin_layout Plain Layout
13816 When you want to include the figure in your document, you invoke
13817 \begin_inset Flex CharStyle:Code
13820 \begin_layout Plain Layout
13826 in order to create a PostScript file that can readily be included in your
13829 \begin_inset Flex CharStyle:Code
13832 \begin_layout Plain Layout
13838 file is the original file, and the PostScript file is the produced file.
13841 \begin_layout Standard
13842 This distinction is important in order to allow updating of the material
13843 while you are in the process of writing the document.
13844 Furthermore, it provides us with the flexibility that is needed to support
13845 multiple export formats.
13846 For instance, in the case of a plain text file, it is not exactly an award-winn
13847 ing idea to include the figure as raw PostScript®.
13848 Instead, you'd either prefer to just include a reference to the figure
13849 or try to invoke some graphics to Ascii converter to make the final result
13850 look similar to the real graphics.
13851 The external material management allows you to do this, because it is parameter
13852 ized on the different export formats that LyX supports.
13855 \begin_layout Standard
13856 Besides supporting the production of different products according to the
13857 exported format, it supports tight integration with editing and viewing
13859 In the case of an XFig figure, you are able to invoke Xfig on the original
13860 file with a single click from within the external material dialog in LyX,
13861 and also preview the produced PostScript file with ghostview with another
13863 No more fiddling around with the command line and/or file browsers to locate
13864 and manipulate the original or produced files.
13865 In this way, you are finally able to take full advantage of the many different
13866 applications that are relevant to use when you write your documents, and
13867 ultimately be more productive.
13870 \begin_layout Section
13871 The external template configuration file
13874 \begin_layout Standard
13875 It is relatively easy to add custom external template definitions to LyX.
13876 However, be aware that doing this in an careless manner most probably
13880 introduce an easily exploitable security hole.
13881 So before you do this, please read the discussion about security in section
13883 \begin_inset CommandInset ref
13885 reference "sec:Security-discussion"
13892 \begin_layout Standard
13893 Having said that, we encourage you to submit any interesting templates that
13898 \begin_layout Standard
13899 The external templates are defined in the
13900 \begin_inset Flex CharStyle:Code
13903 \begin_layout Plain Layout
13904 LyXDir/lib/external_templates
13910 You can place your own version in
13911 \begin_inset Flex CharStyle:Code
13914 \begin_layout Plain Layout
13915 UserDir/external_templates
13923 \begin_layout Standard
13924 A typical template looks like this:
13927 \begin_layout LyX-Code
13931 \begin_layout LyX-Code
13932 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
13935 \begin_layout LyX-Code
13939 \begin_layout LyX-Code
13943 \begin_layout LyX-Code
13947 \begin_layout LyX-Code
13951 \begin_layout LyX-Code
13955 \begin_layout LyX-Code
13956 AutomaticProduction true
13959 \begin_layout LyX-Code
13963 \begin_layout LyX-Code
13967 \begin_layout LyX-Code
13971 \begin_layout LyX-Code
13972 TransformCommand Rotate RotationLatexCommand
13975 \begin_layout LyX-Code
13976 TransformCommand Resize ResizeLatexCommand
13979 \begin_layout LyX-Code
13980 Product "$$RotateFront$$ResizeFront
13983 \begin_layout LyX-Code
13988 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
13991 \begin_layout LyX-Code
13992 $$ResizeBack$$RotateBack"
13995 \begin_layout LyX-Code
13999 \begin_layout LyX-Code
14000 UpdateResult "$$AbsPath$$Basename.pstex_t"
14003 \begin_layout LyX-Code
14004 Requirement "graphicx"
14007 \begin_layout LyX-Code
14008 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14011 \begin_layout LyX-Code
14012 ReferencedFile latex "$$AbsPath$$Basename.eps"
14015 \begin_layout LyX-Code
14016 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14019 \begin_layout LyX-Code
14023 \begin_layout LyX-Code
14027 \begin_layout LyX-Code
14028 TransformCommand Rotate RotationLatexCommand
14031 \begin_layout LyX-Code
14032 TransformCommand Resize ResizeLatexCommand
14035 \begin_layout LyX-Code
14036 Product "$$RotateFront$$ResizeFront
14039 \begin_layout LyX-Code
14044 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14047 \begin_layout LyX-Code
14048 $$ResizeBack$$RotateBack"
14051 \begin_layout LyX-Code
14052 UpdateFormat pdftex
14055 \begin_layout LyX-Code
14056 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14059 \begin_layout LyX-Code
14060 Requirement "graphicx"
14063 \begin_layout LyX-Code
14064 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14067 \begin_layout LyX-Code
14068 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14071 \begin_layout LyX-Code
14075 \begin_layout LyX-Code
14079 \begin_layout LyX-Code
14080 Product "$$Contents(
14082 "$$AbsPath$$Basename.asc
14087 \begin_layout LyX-Code
14088 UpdateFormat asciixfig
14091 \begin_layout LyX-Code
14092 UpdateResult "$$AbsPath$$Basename.asc"
14095 \begin_layout LyX-Code
14099 \begin_layout LyX-Code
14103 \begin_layout LyX-Code
14104 Product "<graphic fileref=
14106 "$$AbsOrRelPathMaster$$Basename.eps
14111 \begin_layout LyX-Code
14115 \begin_layout LyX-Code
14119 \begin_layout LyX-Code
14120 UpdateResult "$$AbsPath$$Basename.eps"
14123 \begin_layout LyX-Code
14124 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14127 \begin_layout LyX-Code
14128 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14131 \begin_layout LyX-Code
14135 \begin_layout LyX-Code
14136 Product "[XFig: $$FName]"
14139 \begin_layout LyX-Code
14143 \begin_layout LyX-Code
14147 \begin_layout Standard
14148 As you can see, the template is enclosed in
14149 \begin_inset Flex CharStyle:Code
14152 \begin_layout Plain Layout
14158 \SpecialChar \ldots{}
14160 \begin_inset Flex CharStyle:Code
14163 \begin_layout Plain Layout
14170 It contains a header specifying some general settings and, for each supported
14171 primary document file format, a section
14172 \begin_inset Flex CharStyle:Code
14175 \begin_layout Plain Layout
14181 \SpecialChar \ldots{}
14183 \begin_inset Flex CharStyle:Code
14186 \begin_layout Plain Layout
14195 \begin_layout Subsection
14196 The template header
14199 \begin_layout Description
14200 \begin_inset Flex CharStyle:Code
14203 \begin_layout Plain Layout
14204 AutomaticProduction
14205 \begin_inset space ~
14213 Whether the file represented by the template must be generated by LyX.
14214 This command must occur exactly once.
14217 \begin_layout Description
14218 \begin_inset Flex CharStyle:Code
14221 \begin_layout Plain Layout
14223 \begin_inset space ~
14231 A glob pattern that is used in the file dialog to filter out the desired
14233 If there is more than one possible file extension (e.g.
14234 \begin_inset space \space{}
14238 \begin_inset Flex CharStyle:Code
14241 \begin_layout Plain Layout
14248 \begin_inset Flex CharStyle:Code
14251 \begin_layout Plain Layout
14257 ), use something like
14258 \begin_inset Flex CharStyle:Code
14261 \begin_layout Plain Layout
14268 This command must occur exactly once.
14271 \begin_layout Description
14272 \begin_inset Flex CharStyle:Code
14275 \begin_layout Plain Layout
14277 \begin_inset space ~
14285 The text that is displayed on the button.
14286 This command must occur exactly once.
14289 \begin_layout Description
14290 \begin_inset Flex CharStyle:Code
14293 \begin_layout Plain Layout
14295 \begin_inset space ~
14299 \begin_inset space ~
14307 The help text that is used in the External dialog.
14308 Provide enough information to explain to the user just what the template
14309 can provide him with.
14310 This command must occur exactly once.
14313 \begin_layout Description
14314 \begin_inset Flex CharStyle:Code
14317 \begin_layout Plain Layout
14319 \begin_inset space ~
14327 The file format of the original file.
14328 This must be the name of a format that is known to LyX (see section
14329 \begin_inset CommandInset ref
14331 reference "sub:Formats"
14337 \begin_inset Quotes eld
14341 \begin_inset Flex CharStyle:Code
14344 \begin_layout Plain Layout
14351 \begin_inset Quotes erd
14354 if the template can handle original files of more than one format.
14355 LyX will attempt to interrogate the file itself in order to deduce its
14356 format in this case.
14357 This command must occur exactly once.
14360 \begin_layout Description
14361 \begin_inset Flex CharStyle:Code
14364 \begin_layout Plain Layout
14366 \begin_inset space ~
14374 A unique name for the template.
14375 It must not contain substitution macros (see below).
14378 \begin_layout Description
14379 \begin_inset Flex CharStyle:Code
14382 \begin_layout Plain Layout
14384 \begin_inset space ~
14387 Rotate|Resize|Clip|Extra
14392 This command specifies which transformations are supported by this template.
14393 It may occur zero or more times.
14394 This command enables the corresponding tabs in the external dialog.
14396 \begin_inset Flex CharStyle:Code
14399 \begin_layout Plain Layout
14405 command must have either a corresponding
14406 \begin_inset Flex CharStyle:Code
14409 \begin_layout Plain Layout
14416 \begin_inset Flex CharStyle:Code
14419 \begin_layout Plain Layout
14426 \begin_inset Flex CharStyle:Code
14429 \begin_layout Plain Layout
14436 Otherwise the transformation will not be supported by that format.
14439 \begin_layout Subsection
14443 \begin_layout Description
14444 \begin_inset Flex CharStyle:Code
14447 \begin_layout Plain Layout
14449 \begin_inset space ~
14452 LaTeX|PDFLaTeX|PlainText|DocBook
14457 The primary document file format that this format definition is for.
14458 Not every template has a sensible representation in all document file formats.
14459 Please define nevertheless a
14460 \begin_inset Flex CharStyle:Code
14463 \begin_layout Plain Layout
14469 section for all formats.
14470 Use a dummy text when no representation is available.
14471 Then you can at least see a reference to the external material in the exported
14475 \begin_layout Description
14476 \begin_inset Flex CharStyle:Code
14479 \begin_layout Plain Layout
14481 \begin_inset space ~
14485 \begin_inset space ~
14493 This command defines an additional macro
14494 \begin_inset Flex CharStyle:Code
14497 \begin_layout Plain Layout
14503 for substitution in
14504 \begin_inset Flex CharStyle:Code
14507 \begin_layout Plain Layout
14515 \begin_inset Flex CharStyle:Code
14518 \begin_layout Plain Layout
14524 itself may contain substitution macros.
14525 The advantage over using
14526 \begin_inset Flex CharStyle:Code
14529 \begin_layout Plain Layout
14536 \begin_inset Flex CharStyle:Code
14539 \begin_layout Plain Layout
14545 is that the substituted value of
14546 \begin_inset Flex CharStyle:Code
14549 \begin_layout Plain Layout
14555 is sanitized so that it is a valid optional argument in the document format.
14556 This command may occur zero or more times.
14559 \begin_layout Description
14560 \begin_inset Flex CharStyle:Code
14563 \begin_layout Plain Layout
14565 \begin_inset space ~
14573 The text that is inserted in the exported document.
14574 This is actually the most important command and can be quite complex.
14575 This command must occur exactly once.
14578 \begin_layout Description
14579 \begin_inset Flex CharStyle:Code
14582 \begin_layout Plain Layout
14584 \begin_inset space ~
14592 This command specifies a preamble snippet that will be included in the
14594 It has to be defined using
14595 \begin_inset Flex CharStyle:Code
14598 \begin_layout Plain Layout
14604 \SpecialChar \ldots{}
14606 \begin_inset Flex CharStyle:Code
14609 \begin_layout Plain Layout
14616 This command may occur zero or more times.
14619 \begin_layout Description
14620 \begin_inset Flex CharStyle:Code
14623 \begin_layout Plain Layout
14625 \begin_inset space ~
14629 \begin_inset space ~
14637 This command denotes files that are created by the conversion process and
14638 are needed for a particular export format.
14639 If the filename is relative, it is interpreted relative to the master document.
14640 This command may be given zero or more times.
14643 \begin_layout Description
14644 \begin_inset Flex CharStyle:Code
14647 \begin_layout Plain Layout
14649 \begin_inset space ~
14657 The name of a required LaTeX package.
14658 The package is included via
14659 \begin_inset Flex CharStyle:Code
14662 \begin_layout Plain Layout
14670 in the LaTeX preamble.
14671 This command may occur zero or more times.
14674 \begin_layout Description
14675 \begin_inset Flex CharStyle:Code
14678 \begin_layout Plain Layout
14680 \begin_inset space ~
14684 \begin_inset space ~
14687 RotationLatexCommand
14692 This command specifies that the built in LaTeX command should be used for
14694 This command may occur once or not at all.
14697 \begin_layout Description
14698 \begin_inset Flex CharStyle:Code
14701 \begin_layout Plain Layout
14703 \begin_inset space ~
14707 \begin_inset space ~
14715 This command specifies that the built in LaTeX command should be used for
14717 This command may occur once or not at all.
14720 \begin_layout Description
14721 \begin_inset Flex CharStyle:Code
14724 \begin_layout Plain Layout
14726 \begin_inset space ~
14730 \begin_inset space ~
14733 RotationLatexOption
14738 This command specifies that rotation is done via an optional argument.
14739 This command may occur once or not at all.
14742 \begin_layout Description
14743 \begin_inset Flex CharStyle:Code
14746 \begin_layout Plain Layout
14748 \begin_inset space ~
14752 \begin_inset space ~
14760 This command specifies that resizing is done via an optional argument.
14761 This command may occur once or not at all.
14764 \begin_layout Description
14765 \begin_inset Flex CharStyle:Code
14768 \begin_layout Plain Layout
14770 \begin_inset space ~
14774 \begin_inset space ~
14782 This command specifies that clipping is done via an optional argument.
14783 This command may occur once or not at all.
14786 \begin_layout Description
14787 \begin_inset Flex CharStyle:Code
14790 \begin_layout Plain Layout
14792 \begin_inset space ~
14796 \begin_inset space ~
14804 This command specifies that an extra optional argument is used.
14805 This command may occur once or not at all.
14808 \begin_layout Description
14809 \begin_inset Flex CharStyle:Code
14812 \begin_layout Plain Layout
14814 \begin_inset space ~
14822 The file format of the converted file.
14823 This must be the name of a format that is known to LyX (see the
14824 \begin_inset Flex CharStyle:MenuItem
14827 \begin_layout Plain Layout
14832 ools\SpecialChar \menuseparator
14837 references:Conversion
14843 This command must occur exactly once.
14846 \begin_layout Description
14847 \begin_inset Flex CharStyle:Code
14850 \begin_layout Plain Layout
14852 \begin_inset space ~
14860 The file name of the converted file.
14861 The file name must be absolute.
14862 This command must occur exactly once.
14865 \begin_layout Subsection
14866 Preamble definitions
14869 \begin_layout Standard
14870 The external template configuration file may contain additional preamble
14871 definitions enclosed by
14872 \begin_inset Flex CharStyle:Code
14875 \begin_layout Plain Layout
14881 \SpecialChar \ldots{}
14883 \begin_inset Flex CharStyle:Code
14886 \begin_layout Plain Layout
14893 They can be used by the templates in the
14894 \begin_inset Flex CharStyle:Code
14897 \begin_layout Plain Layout
14906 \begin_layout Section
14907 The substitution mechanism
14910 \begin_layout Standard
14911 When the external material facility invokes an external program, it is done
14912 on the basis of a command defined in the template configuration file.
14913 These commands can contain various macros that are expanded before execution.
14914 Execution always take place in the directory of the containing document.
14917 \begin_layout Standard
14918 Also, whenever external material is to be displayed, the name will be produced
14919 by the substitution mechanism, and most other commands in the template
14920 definition support substitution as well.
14923 \begin_layout Standard
14924 The available macros are the following:
14927 \begin_layout Description
14928 \begin_inset Flex CharStyle:Code
14931 \begin_layout Plain Layout
14932 $$AbsOrRelPathMaster
14937 The file path, absolute or relative to the master LyX document.
14940 \begin_layout Description
14941 \begin_inset Flex CharStyle:Code
14944 \begin_layout Plain Layout
14945 $$AbsOrRelPathParent
14950 The file path, absolute or relative to the LyX document.
14953 \begin_layout Description
14954 \begin_inset Flex CharStyle:Code
14957 \begin_layout Plain Layout
14963 The absolute file path.
14966 \begin_layout Description
14967 \begin_inset Flex CharStyle:Code
14970 \begin_layout Plain Layout
14976 The filename without path and without the extension.
14979 \begin_layout Description
14980 \begin_inset Flex CharStyle:Code
14983 \begin_layout Plain Layout
14985 \begin_inset Quotes eld
14989 \begin_inset Quotes erd
14997 This macro will expand to the contents of the file with the name
14998 \begin_inset Flex CharStyle:Code
15001 \begin_layout Plain Layout
15010 \begin_layout Description
15011 \begin_inset Flex CharStyle:Code
15014 \begin_layout Plain Layout
15020 The file extension (including the dot).
15023 \begin_layout Description
15024 \begin_inset Flex CharStyle:Code
15027 \begin_layout Plain Layout
15033 The filename of the file specified in the external material dialog.
15034 This is either an absolute name, or it is relative to the LyX document.
15037 \begin_layout Description
15038 \begin_inset Flex CharStyle:Code
15041 \begin_layout Plain Layout
15048 \begin_inset Flex CharStyle:Code
15051 \begin_layout Plain Layout
15057 (absolute name or relative to the LyX document).
15060 \begin_layout Description
15061 \begin_inset Flex CharStyle:Code
15064 \begin_layout Plain Layout
15070 The file path, relative to the master LyX document.
15073 \begin_layout Description
15074 \begin_inset Flex CharStyle:Code
15077 \begin_layout Plain Layout
15083 The file path, relative to the LyX document.
15086 \begin_layout Description
15087 \begin_inset Flex CharStyle:Code
15090 \begin_layout Plain Layout
15096 This macro will expand to the absolute path of the system directory.
15097 This is typically used to point to the various helper scripts that are
15101 \begin_layout Description
15102 \begin_inset Flex CharStyle:Code
15105 \begin_layout Plain Layout
15111 A name and full path to a temporary file which will be automatically deleted
15112 whenever the containing document is closed, or the external material insertion
15116 \begin_layout Standard
15117 All path macros contain a trailing directory separator, so you can construct
15119 \begin_inset space \space{}
15122 the absolute filename with
15123 \begin_inset Flex CharStyle:Code
15126 \begin_layout Plain Layout
15127 $$AbsPath$$Basename$$Extension
15135 \begin_layout Standard
15136 The macros above are substituted in all commands unless otherwise noted.
15138 \begin_inset Flex CharStyle:Code
15141 \begin_layout Plain Layout
15147 supports additionally the following substitutions if they are enabled by
15149 \begin_inset Flex CharStyle:Code
15152 \begin_layout Plain Layout
15159 \begin_inset Flex CharStyle:Code
15162 \begin_layout Plain Layout
15171 \begin_layout Description
15172 \begin_inset Flex CharStyle:Code
15175 \begin_layout Plain Layout
15181 The front part of the resize command.
15184 \begin_layout Description
15185 \begin_inset Flex CharStyle:Code
15188 \begin_layout Plain Layout
15194 The back part of the resize command.
15197 \begin_layout Description
15198 \begin_inset Flex CharStyle:Code
15201 \begin_layout Plain Layout
15207 The front part of the rotation command.
15210 \begin_layout Description
15211 \begin_inset Flex CharStyle:Code
15214 \begin_layout Plain Layout
15220 The back part of the rotation command.
15223 \begin_layout Standard
15224 The value string of the
15225 \begin_inset Flex CharStyle:Code
15228 \begin_layout Plain Layout
15234 command supports additionally the following substitutions if they are enabled
15236 \begin_inset Flex CharStyle:Code
15239 \begin_layout Plain Layout
15246 \begin_inset Flex CharStyle:Code
15249 \begin_layout Plain Layout
15258 \begin_layout Description
15259 \begin_inset Flex CharStyle:Code
15262 \begin_layout Plain Layout
15271 \begin_layout Description
15272 \begin_inset Flex CharStyle:Code
15275 \begin_layout Plain Layout
15284 \begin_layout Description
15285 \begin_inset Flex CharStyle:Code
15288 \begin_layout Plain Layout
15297 \begin_layout Description
15298 \begin_inset Flex CharStyle:Code
15301 \begin_layout Plain Layout
15307 The rotation option.
15310 \begin_layout Standard
15311 You may ask why there are so many path macros.
15312 There are mainly two reasons:
15315 \begin_layout Enumerate
15316 Relative and absolute file names should remain relative or absolute, respectivel
15318 Users may have reasons to prefer either form.
15319 Relative names are useful for portable documents that should work on different
15320 machines, for example.
15321 Absolute names may be required by some programs.
15324 \begin_layout Enumerate
15325 LaTeX treats relative file names differently than LyX and other programs
15326 in nested included files.
15327 For LyX, a relative file name is always relative to the document that contains
15329 For LaTeX, it is always relative to the master document.
15330 These two definitions are identical if you have only one document, but
15331 differ if you have a master document that includes part documents.
15332 That means that relative filenames must be transformed when presented to
15334 Fortunately LyX does this automatically for you if you choose the right
15338 \begin_layout Standard
15339 So which path macro should be used in new template definitions? The rule
15343 \begin_layout Itemize
15345 \begin_inset Flex CharStyle:Code
15348 \begin_layout Plain Layout
15354 if an absolute path is required.
15357 \begin_layout Itemize
15359 \begin_inset Flex CharStyle:Code
15362 \begin_layout Plain Layout
15363 $$AbsOrRelPathMaster
15368 if the substituted string is some kind of LaTeX input.
15371 \begin_layout Itemize
15373 \begin_inset Flex CharStyle:Code
15376 \begin_layout Plain Layout
15377 $$AbsOrRelPathParent
15382 in order to preserve the user's choice.
15385 \begin_layout Standard
15386 There are special cases where this rule does not work and e.g.
15387 \begin_inset space \space{}
15390 relative names are needed, but normally it will work just fine.
15391 One example for such a case is the command
15392 \begin_inset Flex CharStyle:Code
15395 \begin_layout Plain Layout
15396 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15401 in the XFig template above: We can't use the absolute name because the
15403 \begin_inset Flex CharStyle:Code
15406 \begin_layout Plain Layout
15412 files needs the relative name in order to rewrite the file content.
15415 \begin_layout Section
15416 \begin_inset CommandInset label
15418 name "sec:Security-discussion"
15422 Security discussion
15425 \begin_layout Standard
15426 \begin_inset Box Shadowbox
15435 height_special "totalheight"
15438 \begin_layout Plain Layout
15439 WARNING: This section is definitely outdated.
15447 \begin_layout Standard
15448 The external material feature interfaces with a lot of external programs
15449 and does so automatically, so we have to consider the security implications
15451 In particular, since you have the option of including your own filenames
15452 and/or parameter strings and those are expanded into a command, it seems
15453 that it would be possible to create a malicious document which executes
15454 arbitrary commands when a user views or prints the document.
15455 This is something we definately want to avoid.
15458 \begin_layout Standard
15459 However, since the external program commands are specified in the template
15460 configuration file only, there are no security issues if LyX is properly
15461 configured with safe templates only.
15462 This is so because the external programs are invoked with the
15463 \begin_inset Flex CharStyle:Code
15466 \begin_layout Plain Layout
15472 -system call rather than the
15473 \begin_inset Flex CharStyle:Code
15476 \begin_layout Plain Layout
15482 system-call, so it's not possible to execute arbitrary commands from the
15483 filename or parameter section via the shell.
15486 \begin_layout Standard
15487 This also implies that you are restricted in what command strings you can
15488 use in the external material templates.
15489 In particular, pipes and redirection are not readily available.
15490 This has to be so if LyX should remain safe.
15491 If you want to use some of the shell features, you should write a safe
15492 script to do this in a controlled manner, and then invoke the script from
15493 the command string.
15495 \begin_inset Flex CharStyle:Code
15498 \begin_layout Plain Layout
15504 directory of the LyX installation, you can find a safe wrapper script
15505 \begin_inset Flex CharStyle:Code
15508 \begin_layout Plain Layout
15509 general_command_wrapper.py
15514 that supports redirection of input and output.
15515 That can serve as an example for how to write safe template scripts.
15516 For a more advanced example that uses
15517 \begin_inset Flex CharStyle:Code
15520 \begin_layout Plain Layout
15526 and friends, take a look at the
15527 \begin_inset Flex CharStyle:Code
15530 \begin_layout Plain Layout
15539 \begin_layout Standard
15540 It is possible to design a template that interacts directly with the shell,
15541 but since this would allow a malicious user to execute arbitrary commands
15542 by writing clever filenames and/or parameters, we generally recommend that
15543 you only use safe scripts that work with the
15544 \begin_inset Flex CharStyle:Code
15547 \begin_layout Plain Layout
15553 system call in a controlled manner.
15554 Of course, for use in a controlled environment, it can be tempting to just
15555 fall back to use ordinary shell scripts.
15556 If you do so, be aware that you
15560 provide an easily exploitable security hole in your system.
15561 Of course it stands to reason that such unsafe templates will never be
15562 included in the standard LyX distribution, although we do encourage people
15563 to submit new templates in the open source tradition.
15564 But LyX as shipped from the official distribution channels will never have
15568 \begin_layout Standard
15569 Including external material provides a lot of power, and you have to be
15570 careful not to introduce security hazards with this power.
15571 A subtle error in a single line in an innocent looking script can open
15572 the door to huge security problems.
15573 So if you do not fully understand the issues, we recommend that you consult
15574 a knowledgable security professional or the LyX development team if you
15575 have any questions about whether a given template is safe or not.
15576 And do this before you use it in an uncontrolled environment.