1 #LyX 1.6.0svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that the User's Guide prints
10 % out as advertised. If you mess with this preamble,
11 % parts of the User's Guide may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
39 % used for multi-column text
43 \options fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
49 InsetLayout CharStyle:MenuItem
58 \newcommand*{\menuitem}[1]{{\sffamily #1}}
66 \font_typewriter default
67 \font_default_family default
77 \pdf_title "LyX Configuration Manual"
78 \pdf_author "LyX Team"
79 \pdf_subject "LyX-documentation Customization"
80 \pdf_keywords "LyX, documentation, customization"
82 \pdf_bookmarksnumbered true
83 \pdf_bookmarksopen true
84 \pdf_bookmarksopenlevel 1
89 \pdf_pagebackref false
90 \pdf_pdfusetitle false
91 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
98 \paperorientation portrait
105 \paragraph_separation indent
107 \quotes_language english
110 \paperpagestyle headings
111 \tracking_changes false
112 \output_changes false
120 Customizing LyX: Features for the Advanced User
128 \begin_layout Plain Layout
130 If you have comments or error corrections, please send them to the LyX Documenta
132 \begin_inset CommandInset href
134 target "lyx-docs@lists.lyx.org"
147 \begin_layout Standard
148 \begin_inset CommandInset toc
149 LatexCommand tableofcontents
156 \begin_layout Chapter
160 \begin_layout Standard
161 This manual covers the customization features present in LyX.
162 In it, we discuss issues like keyboard shortcuts, screen previewing options,
163 printer options, sending commands to LyX via the LyX Server, internationalizati
164 on, installing new LaTeX classes and LyX layouts, etc.
165 We can't possibly hope to touch on everything you can change---our developers
166 add new features faster than we can document them---but we will explain
167 the most common customizations and hopefully point you in the right direction
168 for some of the more obscure ones.
171 \begin_layout Standard
172 \begin_inset Branch OutDated
175 \begin_layout Standard
176 Information from previous versions of this document that now seems to be
177 outdated is contained in the OutDated branch of this document.
178 By default, this information will not appear in the LaTeX output.
186 \begin_layout Chapter
187 LyX configuration files
190 \begin_layout Standard
191 \begin_inset CommandInset label
197 This chapter aims to help you to find your way through the LyX configuration
199 Before continuing to read this chapter, you should find out where your
200 LyX library and user directories are by using
201 \begin_inset Flex CharStyle:MenuItem
204 \begin_layout Plain Layout
209 elp\SpecialChar \menuseparator
222 The library directory is the place where LyX places its system-wide configurati
223 on files; the user directory is where you can place your modified versions.
224 We will call the former
225 \begin_inset Flex CharStyle:Code
228 \begin_layout Plain Layout
235 \begin_inset Flex CharStyle:MenuItem
238 \begin_layout Plain Layout
244 in the remainder of this document.
248 \begin_layout Section
250 \begin_inset Flex CharStyle:Code
253 \begin_layout Plain Layout
262 \begin_layout Standard
263 \begin_inset Flex CharStyle:Code
266 \begin_layout Plain Layout
272 and its sub-directories contain a number of files and that can be used
273 to customise LyX's behaviour.
274 You can change many of these files from within LyX itself through the
275 \begin_inset Flex CharStyle:MenuItem
278 \begin_layout Plain Layout
283 ools\SpecialChar \menuseparator
294 Most customization that you will want to do in LyX is possible through
296 However, many other inner aspects of LyX can be customized by modifying
298 \begin_inset Flex CharStyle:Code
301 \begin_layout Plain Layout
308 These files fall in different categories, described in the following subsection
312 \begin_layout Subsection
313 Automatically generated files
316 \begin_layout Standard
317 The files, which are to be found in
318 \begin_inset Flex CharStyle:MenuItem
321 \begin_layout Plain Layout
327 , are generated when you configure LyX.
328 They contain various default values that are guessed by inspection.
329 In general, it is not a good idea to modify them, since they might be overwritt
333 \begin_layout Labeling
334 \labelwidthstring 00.00.0000
335 \begin_inset Flex CharStyle:Code
338 \begin_layout Plain Layout
344 contains defaults for various commands.
347 \begin_layout Labeling
348 \labelwidthstring 00.00.0000
349 \begin_inset Flex CharStyle:Code
352 \begin_layout Plain Layout
358 contains the list of packages that have been recognized by LyX.
359 It is currently unused by the LyX program itself, but the information extracted
360 , and more, is made available with
361 \begin_inset Flex CharStyle:MenuItem
364 \begin_layout Plain Layout
369 elp\SpecialChar \menuseparator
386 \begin_layout Labeling
387 \labelwidthstring 00.00.0000
388 \begin_inset Flex CharStyle:Code
391 \begin_layout Plain Layout
397 the list of text classes that have been found in your
398 \begin_inset Flex CharStyle:Code
401 \begin_layout Plain Layout
407 directories, along with the associated LaTeX document class and their descripti
411 \begin_layout Labeling
412 \labelwidthstring 00.00.0000
413 \begin_inset Flex CharStyle:Code
416 \begin_layout Plain Layout
422 the list of layout modules found in your
423 \begin_inset Flex CharStyle:Code
426 \begin_layout Plain Layout
435 \begin_layout Labeling
436 \labelwidthstring 00.00.0000
437 \begin_inset Flex CharStyle:Code
440 \begin_layout Plain Layout
446 lists of various sorts of LaTeX-related files found on your system
449 \begin_layout Labeling
450 \labelwidthstring 00.00.0000
451 \begin_inset Flex CharStyle:Code
454 \begin_layout Plain Layout
460 is automatically generated during configuration from the file
461 \begin_inset Flex CharStyle:Code
464 \begin_layout Plain Layout
471 It contains information on your LaTeX configuration.
474 \begin_layout Subsection
478 \begin_layout Standard
479 These directories are duplicated between
480 \begin_inset Flex CharStyle:Code
483 \begin_layout Plain Layout
490 \begin_inset Flex CharStyle:Code
493 \begin_layout Plain Layout
500 If a particular files exists in both places, the one in
501 \begin_inset Flex CharStyle:Code
504 \begin_layout Plain Layout
513 \begin_layout Labeling
514 \labelwidthstring 00.00.0000
515 \begin_inset Flex CharStyle:Code
518 \begin_layout Plain Layout
524 this directory contains files with the extension
525 \begin_inset Flex CharStyle:Code
528 \begin_layout Plain Layout
534 that define the keybindings used in LyX (see section
539 \begin_inset CommandInset ref
541 reference "sec:bindings"
546 If there exists an internationalized version of the bind file named
547 \begin_inset Flex CharStyle:Code
550 \begin_layout Plain Layout
556 , that will be used first.
562 \begin_inset CommandInset ref
564 reference "chap:i18n"
569 \begin_inset CommandInset ref
571 reference "sec:bindings"
578 \begin_layout Labeling
579 \labelwidthstring 00.00.0000
580 \begin_inset Flex CharStyle:Code
583 \begin_layout Plain Layout
589 contains graphics files that can be included in documents.
593 \begin_layout Labeling
594 \labelwidthstring 00.00.0000
595 \begin_inset Flex CharStyle:Code
598 \begin_layout Plain Layout
604 contains LyX documentation files (including the one you are currently reading).
606 \begin_inset Flex CharStyle:Code
609 \begin_layout Plain Layout
615 deserves special attention, as noted above.
616 If there exists an internationalized version of the help-document with
618 \begin_inset Flex CharStyle:Code
621 \begin_layout Plain Layout
627 prepended to the name, that will be used first.
633 \begin_inset CommandInset ref
635 reference "chap:i18n"
642 \begin_layout Labeling
643 \labelwidthstring 00.00.0000
644 \begin_inset Flex CharStyle:Code
647 \begin_layout Plain Layout
653 contains example files that explain how to use some features.
654 In the file browser, press the
655 \begin_inset Flex CharStyle:MenuItem
658 \begin_layout Plain Layout
667 \begin_layout Labeling
668 \labelwidthstring 00.00.0000
669 \begin_inset Flex CharStyle:Code
672 \begin_layout Plain Layout
678 contains image files that are used by the
679 \begin_inset Flex CharStyle:MenuItem
682 \begin_layout Plain Layout
689 In addition, it also contains the individual icons used in the toolbar
690 and the banners that can be shown when LyX is launched.
693 \begin_layout Labeling
694 \labelwidthstring 00.00.0000
695 \begin_inset Flex CharStyle:Code
698 \begin_layout Plain Layout
704 contains keyboard keymapping files.
710 \begin_inset CommandInset ref
712 reference "sec:keymap"
719 \begin_layout Labeling
720 \labelwidthstring 00.00.0000
721 \begin_inset Flex CharStyle:Code
724 \begin_layout Plain Layout
730 contains the text class and module files described in Chapter
735 \begin_inset CommandInset ref
737 reference "chap:textclass"
744 \begin_layout Labeling
745 \labelwidthstring 00.00.0000
746 \begin_inset Flex CharStyle:Code
749 \begin_layout Plain Layout
756 \begin_inset Flex CharStyle:Code
759 \begin_layout Plain Layout
765 Python scripts used to convert between LyX versions.
766 These can be run from the command line if, say, you want to batch-convert
770 \begin_layout Labeling
771 \labelwidthstring 00.00.0000
772 \begin_inset Flex CharStyle:Code
775 \begin_layout Plain Layout
781 contains some files that demonstrate the capabilities of the
782 \begin_inset Flex CharStyle:MenuItem
785 \begin_layout Plain Layout
796 Also contains some scripts used by LyX itself.
799 \begin_layout Labeling
800 \labelwidthstring 00.00.0000
801 \begin_inset Flex CharStyle:Code
804 \begin_layout Plain Layout
810 contains the standard LyX template files described in Chapter
815 \begin_inset CommandInset ref
817 reference "sec:templates"
824 \begin_layout Labeling
825 \labelwidthstring 00.00.0000
826 \begin_inset Flex CharStyle:Code
829 \begin_layout Plain Layout
835 contains files with the extension
836 \begin_inset Flex CharStyle:Code
839 \begin_layout Plain Layout
845 that define the user interface to LyX.
846 That is, the files define which items appear in which menus and the items
847 appearing on the toolbar.
849 \begin_inset CommandInset ref
858 \begin_layout Subsection
859 Files you don't want to modify
862 \begin_layout Standard
863 These files are used internally by LyX and you generally do not need to
864 modify them unless you are a developer.
867 \begin_layout Labeling
868 \labelwidthstring 00.00.0000
869 \begin_inset Flex CharStyle:Code
872 \begin_layout Plain Layout
878 this file contains the list of LyX developers.
879 The contents are displayed with the menu entry
880 \begin_inset Flex CharStyle:MenuItem
883 \begin_layout Plain Layout
888 elp\SpecialChar \menuseparator
901 \begin_layout Labeling
902 \labelwidthstring 00.00.0000
903 \begin_inset Flex CharStyle:Code
906 \begin_layout Plain Layout
912 this is a LaTeX script used during the configuration process.
916 \begin_layout Labeling
917 \labelwidthstring 00.00.0000
918 \begin_inset Flex CharStyle:Code
921 \begin_layout Plain Layout
927 this is the script that is used to re-configure LyX.
928 It creates configuration files in the directory it was run from.
931 \begin_layout Subsection
932 Other files needing a line or two...
935 \begin_layout Labeling
936 \labelwidthstring 00.00.0000
937 \begin_inset Flex CharStyle:Code
940 \begin_layout Plain Layout
946 this contains tables describing how different character encodings can be
950 \begin_layout Labeling
951 \labelwidthstring 00.00.0000
952 \begin_inset Flex CharStyle:Code
955 \begin_layout Plain Layout
961 this file contains the templates available to the new
962 \begin_inset Flex CharStyle:MenuItem
965 \begin_layout Plain Layout
978 \begin_layout Labeling
979 \labelwidthstring 00.00.0000
980 \begin_inset Flex CharStyle:Code
983 \begin_layout Plain Layout
989 this file contains a list of all the languages currently supported by LyX.
992 \begin_layout Section
993 Your local configuration directory
996 \begin_layout Standard
997 Even if you are using LyX as an unprivileged user, you might want to change
998 LyX configuration for your own use.
1000 \begin_inset Flex CharStyle:Code
1003 \begin_layout Plain Layout
1009 directory contains all your personal configuration files.
1010 This is the directory described as
1011 \begin_inset Quotes eld
1015 \begin_inset Quotes erd
1019 \begin_inset Flex CharStyle:MenuItem
1022 \begin_layout Plain Layout
1027 elp\SpecialChar \menuseparator
1029 \begin_inset space ~
1038 This directory is used as a mirror of
1039 \begin_inset Flex CharStyle:Code
1042 \begin_layout Plain Layout
1048 , which means that every file in
1049 \begin_inset Flex CharStyle:Code
1052 \begin_layout Plain Layout
1058 is a replacement for the corresponding file in
1059 \begin_inset Flex CharStyle:Code
1062 \begin_layout Plain Layout
1069 Any configuration file described in the above sections can be placed either
1070 in the system-wide directory, in which case it will affect all users, or
1071 in your local directory for your own use.
1074 \begin_layout Standard
1075 To make things clearer, let's provide a few examples:
1078 \begin_layout Itemize
1079 The preferences set in the
1080 \begin_inset Flex CharStyle:MenuItem
1083 \begin_layout Plain Layout
1088 ools\SpecialChar \menuseparator
1098 dialog are saved to a file
1099 \begin_inset Flex CharStyle:Code
1102 \begin_layout Plain Layout
1109 \begin_inset Flex CharStyle:Code
1112 \begin_layout Plain Layout
1121 \begin_layout Itemize
1122 When you reconfigure using
1123 \begin_inset Flex CharStyle:MenuItem
1126 \begin_layout Plain Layout
1131 ools\SpecialChar \menuseparator
1142 \begin_inset Flex CharStyle:Code
1145 \begin_layout Plain Layout
1151 script, and the resulting files are written in your local configuration
1153 This means that any additional text class file that you might have added
1155 \begin_inset Flex CharStyle:Code
1158 \begin_layout Plain Layout
1164 will be added to the list of classes in the
1165 \begin_inset Flex CharStyle:MenuItem
1168 \begin_layout Plain Layout
1173 ocument\SpecialChar \menuseparator
1186 \begin_layout Itemize
1187 If you get some updated documentation from LyX ftp site and cannot install
1188 it because you do not have sysadmin rights on your system, you can just
1190 \begin_inset Flex CharStyle:Code
1193 \begin_layout Plain Layout
1199 and the items in the
1200 \begin_inset Flex CharStyle:MenuItem
1203 \begin_layout Plain Layout
1213 menu will open them!
1216 \begin_layout Section
1217 Running LyX with multiple configurations
1220 \begin_layout Standard
1221 The configuration freedom of the local configuration directory may not suffice
1222 if you want to have more than one configuration at your disposal.
1223 For example, you may want to be use different key bindings or printer settings
1225 You can achieve this by having several such directories.
1226 You then specify which directory to use at run-time.
1229 \begin_layout Standard
1230 Invoking LyX with the command line switch
1231 \begin_inset Flex CharStyle:Code
1234 \begin_layout Plain Layout
1244 instructs the program to read the configuration from that directory, and
1245 not from the default directory.
1246 (You can determine the default directory by running LyX without the
1247 \begin_inset Flex CharStyle:Code
1250 \begin_layout Plain Layout
1256 switch.) If the specified directory does not exist, LyX offers to create
1257 it for you, just like it does for the default directory on the first time
1258 you run the program.
1259 You can modify the configuration options in this additional user directory
1260 exactly as you would for the default directory.
1261 These directories are completely independent (but read on).
1262 Note that setting the environment variable
1263 \begin_inset Flex CharStyle:Code
1266 \begin_layout Plain Layout
1272 to some value has exactly the same effect.
1275 \begin_layout Standard
1276 Having several configurations also requires more maintenance: if you want
1277 to add a new layout to
1278 \begin_inset Flex CharStyle:Code
1281 \begin_layout Plain Layout
1287 which you want available from all your configurations, you must add it
1288 to each directory separately.
1289 You can avoid this with the following trick: after LyX creates the additional
1290 directory, most of the subdirectories (see above) are empty.
1291 If you want the new configuration to mirror an existing one, replace the
1292 empty subdirectory with a symbolic link to the matching subdirectory in
1293 the existing configuration.
1295 \begin_inset Flex CharStyle:Code
1298 \begin_layout Plain Layout
1304 subirectory, however, since it contains a file written by the configuration
1305 script (also accessible through
1306 \begin_inset Flex CharStyle:MenuItem
1309 \begin_layout Plain Layout
1314 ools\SpecialChar \menuseparator
1324 ) which is configuration-specific.
1327 \begin_layout Chapter
1328 The Preferences dialog
1331 \begin_layout Standard
1332 All options of the preferences dialog are described in the Appendix
1334 The Preferences Dialog
1341 For some options you might find here more details.
1344 \begin_layout Section
1345 Using the dialog for the first time
1348 \begin_layout Standard
1350 \begin_inset Flex CharStyle:Code
1353 \begin_layout Plain Layout
1359 file will contain only changes that you have made to the default behavior,
1360 some of which is hard-coded into LyX and some of which is contained in
1362 \begin_inset Flex CharStyle:Code
1365 \begin_layout Plain Layout
1366 LyXDir/lyxrc.defaults
1372 Note that in both files lines beginning with a
1373 \begin_inset Quotes eld
1377 \begin_inset Quotes erd
1380 are just comments and are not interpreted.
1381 However, only system administrators should edit
1382 \begin_inset Flex CharStyle:Code
1385 \begin_layout Plain Layout
1386 LyXDir/lyxrc.defaults
1392 Users should use the
1393 \begin_inset Flex CharStyle:MenuItem
1396 \begin_layout Plain Layout
1397 Tools\SpecialChar \menuseparator
1403 dialog to create and modify their own
1404 \begin_inset Flex CharStyle:Code
1407 \begin_layout Plain Layout
1416 \begin_layout Standard
1418 \begin_inset Flex CharStyle:MenuItem
1421 \begin_layout Plain Layout
1422 Tools\SpecialChar \menuseparator
1428 dialog will be largely self-explanatory.
1429 Most things in the dialog have associated `tool tips': hover your mouse
1430 pointer over something for more information.
1431 Before we highlight a few of the more important commands below, however,
1432 a word of warning: Applying some of your changes (e.g., screen fonts) will
1433 have an instant effect.
1435 changing the bind file) will not.
1436 If nothing appears to have changed, just
1437 \begin_inset Flex CharStyle:MenuItem
1440 \begin_layout Plain Layout
1446 the changes and restart LyX.
1449 \begin_layout Section
1450 \begin_inset CommandInset label
1452 name "sec:converters-etc"
1459 \begin_layout Standard
1460 LyX has a powerful mechanism to convert to and from any file format using
1465 \begin_layout Subsection
1466 \begin_inset CommandInset label
1475 \begin_layout Standard
1476 The first step is to define your file formats if they are not already defined.
1478 \begin_inset Flex CharStyle:MenuItem
1481 \begin_layout Plain Layout
1482 Tools\SpecialChar \menuseparator
1483 Preferences\SpecialChar \menuseparator
1484 File Handling\SpecialChar \menuseparator
1492 \begin_inset Flex CharStyle:MenuItem
1495 \begin_layout Plain Layout
1496 New\SpecialChar \ldots{}
1502 button to define your new format.
1504 \begin_inset Flex CharStyle:MenuItem
1507 \begin_layout Plain Layout
1513 field contains the named used to identify the format in the GUI.
1515 \begin_inset Flex CharStyle:MenuItem
1518 \begin_layout Plain Layout
1524 is used to identify the format interally.
1525 You will also need to enter a file extension.
1526 These are all required.
1528 \begin_inset Flex CharStyle:MenuItem
1531 \begin_layout Plain Layout
1537 field is used to provide a keyboard shortcut on the menus.
1538 (For example, pressing
1539 \begin_inset Flex CharStyle:MenuItem
1542 \begin_layout Plain Layout
1549 \begin_inset Flex CharStyle:MenuItem
1552 \begin_layout Plain Layout
1553 View\SpecialChar \menuseparator
1562 \begin_layout Standard
1564 \begin_inset Flex CharStyle:MenuItem
1567 \begin_layout Plain Layout
1574 \begin_inset Flex CharStyle:MenuItem
1577 \begin_layout Plain Layout
1584 For example, you might want to use
1585 \begin_inset Flex CharStyle:MenuItem
1588 \begin_layout Plain Layout
1594 to view PostScript files.
1595 You can enter the command needed to start the program in the corresponding
1597 In defining this command, you can use the four variables listed in the
1599 The viewer is launched when you view an image in LyX or use the
1600 \begin_inset Flex CharStyle:MenuItem
1603 \begin_layout Plain Layout
1610 The editor is for example launched when you press the
1611 \begin_inset Flex CharStyle:MenuItem
1614 \begin_layout Plain Layout
1621 \begin_inset Flex CharStyle:MenuItem
1624 \begin_layout Plain Layout
1631 \begin_inset Flex CharStyle:MenuItem
1634 \begin_layout Plain Layout
1643 \begin_layout Standard
1645 \begin_inset Flex CharStyle:MenuItem
1648 \begin_layout Plain Layout
1654 option tells LyX that a format is suitable for document export.
1655 If this is is set and if a suitable conversion route exists (see
1656 \begin_inset CommandInset ref
1658 reference "sub:Converters"
1662 ), the format will appear in the
1663 \begin_inset Flex CharStyle:MenuItem
1666 \begin_layout Plain Layout
1667 File\SpecialChar \menuseparator
1674 The format will also appear in the
1675 \begin_inset Flex CharStyle:MenuItem
1678 \begin_layout Plain Layout
1684 menu if a viewer is specified for the format.
1685 Pure image formats, such as
1686 \begin_inset Flex CharStyle:Code
1689 \begin_layout Plain Layout
1695 , should not use this option.
1696 Formats that can both represent vector graphics and documents like
1697 \begin_inset Flex CharStyle:Code
1700 \begin_layout Plain Layout
1709 \begin_layout Standard
1711 \begin_inset Flex CharStyle:MenuItem
1714 \begin_layout Plain Layout
1715 Vector graphics format
1720 tells LyX that a format can contain vector graphics.
1721 This information is used to determine the target format of included graphics
1723 \begin_inset Flex CharStyle:MenuItem
1726 \begin_layout Plain Layout
1733 Included graphics may need to be converted to either
1734 \begin_inset Flex CharStyle:MenuItem
1737 \begin_layout Plain Layout
1744 \begin_inset Flex CharStyle:MenuItem
1747 \begin_layout Plain Layout
1754 \begin_inset Flex CharStyle:MenuItem
1757 \begin_layout Plain Layout
1764 \begin_inset Flex CharStyle:MenuItem
1767 \begin_layout Plain Layout
1773 cannot handle other image formats.
1774 If an included graphic is not already in
1775 \begin_inset Flex CharStyle:MenuItem
1778 \begin_layout Plain Layout
1785 \begin_inset Flex CharStyle:MenuItem
1788 \begin_layout Plain Layout
1795 \begin_inset Flex CharStyle:MenuItem
1798 \begin_layout Plain Layout
1804 format, it is converted to
1805 \begin_inset Flex CharStyle:MenuItem
1808 \begin_layout Plain Layout
1814 if the vector format option is set, and otherwise to
1815 \begin_inset Flex CharStyle:MenuItem
1818 \begin_layout Plain Layout
1827 \begin_layout Subsection
1831 \begin_layout Standard
1832 Since all conversions from one format to another take place in LyX's temporary
1833 directory, it is sometimes necessary to modify a file before copying it
1834 to the temporary directory in order that the conversion may be performed.
1838 \begin_layout Plain Layout
1839 For example, the file may refer to other files---images, for example---using
1840 relative file names, and these may become invalid when the file is copied
1841 to the temporary directory.
1846 This is done by a Copier: It copies a file to (or from) the temporary directory
1847 and may modify it in the process.
1850 \begin_layout Standard
1851 The definitions of the copiers may use four variables:
1854 \begin_layout Labeling
1855 \labelwidthstring 00.00.0000
1856 \begin_inset Flex CharStyle:Code
1859 \begin_layout Plain Layout
1865 The LyX system directory (e.
1866 \begin_inset space \thinspace{}
1870 \begin_inset space ~
1874 \begin_inset Flex CharStyle:MenuItem
1877 \begin_layout Plain Layout
1886 \begin_layout Labeling
1887 \labelwidthstring 00.00.0000
1888 \begin_inset Flex CharStyle:Code
1891 \begin_layout Plain Layout
1900 \begin_layout Labeling
1901 \labelwidthstring 00.00.0000
1902 \begin_inset Flex CharStyle:Code
1905 \begin_layout Plain Layout
1914 \begin_layout Labeling
1915 \labelwidthstring 00.00.0000
1916 \begin_inset Flex CharStyle:Code
1919 \begin_layout Plain Layout
1928 \begin_layout Standard
1929 The latter is to be given in a form suitable for inclusion in a LaTeX's
1936 command and is relevant only when exporting files suitable for such inclusion.
1939 \begin_layout Standard
1940 Copiers can be used to do almost anything with output files.
1941 For example, suppose you want generated pdf files to be copied to a special
1943 \begin_inset Flex CharStyle:Code
1946 \begin_layout Plain Layout
1953 Then you could write a shell script such as this one:
1956 \begin_layout Standard
1957 \begin_inset listings
1961 \begin_layout Plain Layout
1966 \begin_layout Plain Layout
1971 \begin_layout Plain Layout
1973 TOFILE=`basename $2`
1976 \begin_layout Plain Layout
1978 cp $FROMFILE /home/you/pdf/$TOFILE
1983 Save that in your local LyX directory---say,
1984 \begin_inset Flex CharStyle:Code
1987 \begin_layout Plain Layout
1988 /home/you/.lyx/scripts/pdfcopier.sh
1993 ---and make it executable, if you need to do so on your platform.
1995 \begin_inset Flex CharStyle:MenuItem
1998 \begin_layout Plain Layout
1999 Tools\SpecialChar \menuseparator
2006 \begin_inset Flex CharStyle:MenuItem
2009 \begin_layout Plain Layout
2015 format---or one of the other pdf formats---and enter
2016 \begin_inset Flex CharStyle:Code
2019 \begin_layout Plain Layout
2020 pdfcopier.sh $$i $$o
2026 \begin_inset Flex CharStyle:MenuItem
2029 \begin_layout Plain Layout
2039 \begin_layout Standard
2040 Copiers are used by LyX in various of its own conversions.
2041 For example, if appropriate programs are found, LyX will automatically
2042 install copiers for the
2043 \begin_inset Flex CharStyle:MenuItem
2046 \begin_layout Plain Layout
2053 \begin_inset Flex CharStyle:MenuItem
2056 \begin_layout Plain Layout
2058 \begin_inset space ~
2067 When these formats are exported, the copier sees that not just the main
2068 HTML file but various associated files (style files, images, etc.) are also
2070 All these files are written to a subdirectory of the directory in which
2071 the original LyX file was found.
2075 \begin_layout Plain Layout
2076 This copier can be customized.
2078 \begin_inset Quotes eld
2082 \begin_inset Quotes erd
2085 argument takes a comma-separated list of extensions to be copied; if it
2086 is omitted, all files will be copied.
2088 \begin_inset Quotes eld
2092 \begin_inset Quotes erd
2095 argument determines the extension added to the generated directory.
2097 \begin_inset Quotes eld
2101 \begin_inset Flex CharStyle:MenuItem
2104 \begin_layout Plain Layout
2111 \begin_inset Quotes erd
2114 , so HTML generated from
2115 \begin_inset Flex CharStyle:MenuItem
2118 \begin_layout Plain Layout
2119 /path/to/filename.lyx
2125 \begin_inset Flex CharStyle:MenuItem
2128 \begin_layout Plain Layout
2129 /path/to/filename.html.LyXconv
2143 \begin_layout Subsection
2144 \begin_inset CommandInset label
2146 name "sub:Converters"
2153 \begin_layout Standard
2154 You can define your own Converters to, uhh, convert files between different
2157 \begin_inset Flex CharStyle:MenuItem
2160 \begin_layout Plain Layout
2161 Tools\SpecialChar \menuseparator
2162 Preferences\SpecialChar \menuseparator
2163 File Handling\SpecialChar \menuseparator
2172 \begin_layout Standard
2173 To define a new converter, select the
2174 \begin_inset Flex CharStyle:MenuItem
2177 \begin_layout Plain Layout
2179 \begin_inset space ~
2188 \begin_inset space \thinspace{}
2192 \begin_inset Flex CharStyle:MenuItem
2195 \begin_layout Plain Layout
2197 \begin_inset space ~
2205 from the drop-down lists, enter the command needed for the conversion,
2207 \begin_inset Flex CharStyle:MenuItem
2210 \begin_layout Plain Layout
2217 Several variables can be used in the definition of converters:
2220 \begin_layout Labeling
2221 \labelwidthstring 00.00.0000
2222 \begin_inset Flex CharStyle:Code
2225 \begin_layout Plain Layout
2231 The LyX system directory
2234 \begin_layout Labeling
2235 \labelwidthstring 00.00.0000
2236 \begin_inset Flex CharStyle:Code
2239 \begin_layout Plain Layout
2248 \begin_layout Labeling
2249 \labelwidthstring 00.00.0000
2250 \begin_inset Flex CharStyle:Code
2253 \begin_layout Plain Layout
2262 \begin_layout Labeling
2263 \labelwidthstring 00.00.0000
2264 \begin_inset Flex CharStyle:Code
2267 \begin_layout Plain Layout
2273 The base filename of the input file (i.e., without the extension)
2276 \begin_layout Labeling
2277 \labelwidthstring 00.00.0000
2278 \begin_inset Flex CharStyle:Code
2281 \begin_layout Plain Layout
2287 The path to the input file
2290 \begin_layout Standard
2292 \begin_inset Flex CharStyle:MenuItem
2295 \begin_layout Plain Layout
2297 \begin_inset space ~
2305 field you can enter the following flags, separated by commas:
2308 \begin_layout Labeling
2309 \labelwidthstring 00.00.0000
2310 \begin_inset Flex CharStyle:Code
2313 \begin_layout Plain Layout
2319 This converter runs some form of LaTeX.
2320 This will make LyX's LaTeX error logs available.
2323 \begin_layout Labeling
2324 \labelwidthstring 00.00.0000
2325 \begin_inset Flex CharStyle:Code
2328 \begin_layout Plain Layout
2335 \begin_inset Flex CharStyle:MenuItem
2338 \begin_layout Plain Layout
2344 file for the conversion.
2347 \begin_layout Labeling
2348 \labelwidthstring 00.00.0000
2349 \begin_inset Flex CharStyle:Code
2352 \begin_layout Plain Layout
2361 \begin_layout Standard
2362 The following three flags are not really flags at all because they take
2364 \begin_inset Flex CharStyle:MenuItem
2367 \begin_layout Plain Layout
2369 \begin_inset space ~
2373 \begin_inset space ~
2384 \begin_layout Labeling
2385 \labelwidthstring 00.00.0000
2386 \begin_inset Flex CharStyle:Code
2389 \begin_layout Plain Layout
2395 If set, the converter's standard error will be redirected to a file
2396 \begin_inset Flex CharStyle:Code
2399 \begin_layout Plain Layout
2405 , and the script given as argument will be run as:
2406 \begin_inset Flex CharStyle:Code
2409 \begin_layout Plain Layout
2410 script <infile.out >infile.log
2416 The argument may contain
2417 \begin_inset Flex CharStyle:Code
2420 \begin_layout Plain Layout
2429 \begin_layout Labeling
2430 \labelwidthstring 00.00.0000
2431 \begin_inset Flex CharStyle:Code
2434 \begin_layout Plain Layout
2440 The name of the directory in which the converter will dump the generated
2442 LyX will not create this directory, and it does not copy anything into
2443 it, though it will copy this directory to the destination.
2444 The argument may contain
2445 \begin_inset Flex CharStyle:Code
2448 \begin_layout Plain Layout
2454 , which will be replaced by the base name of the input and output files,
2455 respectively, when the directory is copied.
2456 \begin_inset Newline newline
2459 Note that resultdir and usetempdir make no sense together.
2460 The latter will be ignored if the former is given.
2463 \begin_layout Labeling
2464 \labelwidthstring 00.00.0000
2465 \begin_inset Flex CharStyle:Code
2468 \begin_layout Plain Layout
2474 Determines the output file name and may, contain
2475 \begin_inset Flex CharStyle:Code
2478 \begin_layout Plain Layout
2485 Sensible only with resultdir and optional even then; if not given, it defaults
2489 \begin_layout Standard
2490 None of these last three are presently used in any of the converters that
2491 are installed with LyX.
2495 \begin_layout Standard
2496 You do not have to define converters between all the formats between which
2497 you want to convert.
2498 For example, you will note that there is no `LyX to PostScript®' converter,
2499 but LyX will export PostScript®.
2500 It does so by first creating a LaTeX file (no converter needs to be defined
2501 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2502 and finally converting the resulting DVI file to PostScript®.
2503 LyX finds such `chains' of converters automatically, and it will always
2504 choose the shortest possible chain.
2505 You can, though, still define multiple conversion methods between file
2507 For example, the standard LyX configuration provides three ways to convert
2508 LaTeX to PDF: Directly, using
2509 \begin_inset Flex CharStyle:MenuItem
2512 \begin_layout Plain Layout
2518 ; via (DVI and) PostScript®, using
2519 \begin_inset Flex CharStyle:MenuItem
2522 \begin_layout Plain Layout
2529 \begin_inset Flex CharStyle:MenuItem
2532 \begin_layout Plain Layout
2539 To define such alternate chains, you must define multiple target `file
2540 formats', as described in section
2541 \begin_inset CommandInset ref
2543 reference "sub:Formats"
2548 For example, in the standard configuration, the formats named
2549 \begin_inset Flex CharStyle:MenuItem
2552 \begin_layout Plain Layout
2559 \begin_inset Flex CharStyle:MenuItem
2562 \begin_layout Plain Layout
2569 \begin_inset Flex CharStyle:MenuItem
2572 \begin_layout Plain Layout
2578 are defined, all of which share the extension
2579 \begin_inset Flex CharStyle:MenuItem
2582 \begin_layout Plain Layout
2588 , and which correspond to the conversion methods just mentioned.
2591 \begin_layout Chapter
2592 Internationalizing LyX
2593 \begin_inset CommandInset label
2602 \begin_layout Standard
2603 LyX supports using a translated interface.
2604 Last time we checked, LyX provided text in thirty languages.
2605 The language of choice is called your
2610 (For further reading on locale settings, see also the documentation for
2611 locale that comes with your operating system.
2612 For Linux, the manual page for
2613 \begin_inset Flex CharStyle:Code
2616 \begin_layout Plain Layout
2622 could be a good place to start).
2625 \begin_layout Standard
2626 Notice that these translations will work, but do contain a few flaws.
2627 In particular, all dialogs have been designed with the English text in
2628 mind, which means that some of the translated text will be too large to
2629 fit within the space allocated.
2630 This is only a display problem and will not cause any harm.
2631 Also, you will find that some of the translations do not define shortcut
2632 keys for everything.
2633 Sometimes, there are simply not enough free letters to do it.
2634 Other times, the translator just hasn't got around to doing it yet.
2635 Our localization team, which you may wish to join,
2639 \begin_layout Plain Layout
2640 If you are a fluent speaker of a language other than English, joining these
2641 teams is a great way to give back to the LyX community!
2646 will of course try to fix these shortcomings in future versions of LyX.
2649 \begin_layout Section
2653 \begin_layout Subsection
2654 Translating the graphical user interface (text messages).
2657 \begin_layout Standard
2659 \begin_inset Flex CharStyle:Code
2662 \begin_layout Plain Layout
2668 library to handle the internationalization of the interface.
2669 To have LyX speak your favorite language in all menus and dialogs, you
2671 \begin_inset Flex CharStyle:Code
2674 \begin_layout Plain Layout
2680 -file for that language.
2681 When this is available, you'll have to generate a
2682 \begin_inset Flex CharStyle:Code
2685 \begin_layout Plain Layout
2691 -file from it and install the
2692 \begin_inset Flex CharStyle:Code
2695 \begin_layout Plain Layout
2702 The process of doing all of this is explained in the documentation for
2704 \begin_inset Flex CharStyle:Code
2707 \begin_layout Plain Layout
2714 It is possible to do this just for yourself, but if you're going to do
2715 it, you might as well share the results of your labors with the rest of
2717 Send a message to the LyX developers' list for more information about how
2721 \begin_layout Standard
2722 In short, this is what you should do (xx denotes the language code):
2725 \begin_layout Itemize
2726 Check out the LyX source code.
2728 \begin_inset CommandInset href
2730 name "information on the web"
2731 target "http://www.lyx.org/devel/cvs.php"
2738 \begin_layout Itemize
2740 \begin_inset Flex CharStyle:Code
2743 \begin_layout Plain Layout
2749 to the folder of the
2750 \begin_inset Flex CharStyle:Code
2753 \begin_layout Plain Layout
2761 \begin_inset Flex CharStyle:Code
2764 \begin_layout Plain Layout
2772 \begin_inset Flex CharStyle:Code
2775 \begin_layout Plain Layout
2781 doesn't exist anywhere, it can be remade with the console command
2782 \begin_inset Flex CharStyle:Code
2785 \begin_layout Plain Layout
2791 in that directory, or you can use an existing po-file for some other language
2795 \begin_layout Itemize
2797 \begin_inset Flex CharStyle:Code
2800 \begin_layout Plain Layout
2810 \begin_layout Plain Layout
2811 This is just a text file, so it can be edited in any text editor.
2812 But there are also specialized programs that support such editing, such
2817 (for all platforms) or
2826 contains a `mode' for editing
2827 \begin_inset Flex CharStyle:Code
2830 \begin_layout Plain Layout
2841 For some menu- and widget-labels, there are also shortcut keys that should
2843 Those keys are marked after a `|', and should be translated according to
2844 the words and phrases of the language.
2845 You should also fill also out the information at the beginning of the new
2847 \begin_inset Flex CharStyle:Code
2850 \begin_layout Plain Layout
2856 -file with your email-address, etc., so people know where to reach you with
2857 suggestions and entertaining flames.
2860 \begin_layout Standard
2861 If you are just doing this on your own, then:
2864 \begin_layout Itemize
2866 \begin_inset Flex CharStyle:Code
2869 \begin_layout Plain Layout
2876 This can be done with
2877 \begin_inset Flex CharStyle:Code
2880 \begin_layout Plain Layout
2881 msgfmt -o xx.mo < xx.po
2889 \begin_layout Itemize
2891 \begin_inset Flex CharStyle:Code
2894 \begin_layout Plain Layout
2900 -file to your locale-tree, at the correct directory for application messages
2905 xx, and under the name
2906 \begin_inset Flex CharStyle:Code
2909 \begin_layout Plain Layout
2917 \begin_inset Flex CharStyle:Code
2920 \begin_layout Plain Layout
2921 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2931 \begin_layout Standard
2932 As said, however, it would be best if the new
2933 \begin_inset Flex CharStyle:Code
2936 \begin_layout Plain Layout
2942 -file could be added to the LyX distribution, so others can use it.
2943 Adding it involves making additional changes to LyX.
2944 So send an email to the developers' mailing list if you're interested in
2948 \begin_layout Subsubsection
2952 \begin_layout Standard
2953 Sometimes it turns out that one English message needs to be translated into
2954 different messages in the target language.
2955 One example is the message
2956 \begin_inset Flex CharStyle:Code
2959 \begin_layout Plain Layout
2965 which has the German translation
2973 , depending upon exactly what the English
2974 \begin_inset Quotes eld
2978 \begin_inset Quotes erd
2983 \begin_inset Flex CharStyle:Code
2986 \begin_layout Plain Layout
2992 does not handle such ambigous translations.
2993 Therefore you have to add some context information to the message: Instead
2995 \begin_inset Flex CharStyle:Code
2998 \begin_layout Plain Layout
3005 \begin_inset Flex CharStyle:Code
3008 \begin_layout Plain Layout
3009 To[[as in 'From format x to format y']]
3015 \begin_inset Flex CharStyle:Code
3018 \begin_layout Plain Layout
3019 To[[as in 'From page x to page y']].
3024 Now the two occurences of
3025 \begin_inset Flex CharStyle:Code
3028 \begin_layout Plain Layout
3035 \begin_inset Flex CharStyle:Code
3038 \begin_layout Plain Layout
3044 and can be translated correctly to
3055 \begin_layout Standard
3056 Of course the context information needs to be stripped off the original
3057 message when no translation is used.
3058 Therefore you have to put it in double square brackets at the end of the
3059 message (see the example above).
3060 The translation mechanism of LyX ensures that everything in double square
3061 brackets at the end of messages is removed before displaying the message.
3064 \begin_layout Subsection
3065 Translating the documentation.
3068 \begin_layout Standard
3069 The online documentation (in the
3070 \begin_inset Flex CharStyle:MenuItem
3073 \begin_layout Plain Layout
3083 -menu) can (and should!) be translated.
3084 If there are translated versions of the documentation available
3088 \begin_layout Plain Layout
3089 As of March 2008, at least some of the documents have been translated into
3090 fourteen languages, with the Tutorial available in a few more.
3095 and the locale is set accordingly, these will be used automagically by
3097 LyX looks for translated versions as
3098 \begin_inset Flex CharStyle:Code
3101 \begin_layout Plain Layout
3102 LyXDir/doc/xx_DocName.lyx
3108 \begin_inset Flex CharStyle:Code
3111 \begin_layout Plain Layout
3117 is the code for the language currently in use.
3118 If there are no translated documents, the default English versions will
3120 Note that the translated versions must have the same filenames (
3121 \begin_inset Flex CharStyle:Code
3124 \begin_layout Plain Layout
3130 above) as the original.
3131 If you feel up to translating the documentation (an excellent way to proof-read
3132 the original documentation by the way!), there are a few things you should
3136 \begin_layout Itemize
3138 \begin_inset Flex CharStyle:Code
3141 \begin_layout Plain Layout
3147 , the guide to writing LyX documentation.
3148 Pay special attention to the translator's section.
3151 \begin_layout Itemize
3152 Check out the documentation translation web page at
3153 \begin_inset CommandInset href
3155 name "http://www.devel.lyx.org"
3156 target "http://www.devel.lyx.org"
3161 That way, you can find out which (if any) documents have already been translate
3162 d into your language.
3163 You can also find out who (if anyone) is organizing the effort to translate
3164 the documentation into your language.
3165 If no one is organizing the effort, please let us know that you're interested.
3168 \begin_layout Standard
3169 Once you get to actually translating, here's a few hints for you that may
3173 \begin_layout Itemize
3174 Join the documentation team! There is information on how to do that in
3175 \begin_inset Flex CharStyle:Code
3178 \begin_layout Plain Layout
3185 \begin_inset Flex CharStyle:MenuItem
3188 \begin_layout Plain Layout
3193 elp\SpecialChar \menuseparator
3203 ), which by the way is the first document you should translate.
3206 \begin_layout Itemize
3207 Learn the typographic conventions for the language you are translating to.
3208 Typography is an ancient art and over the centuries, a great variety of
3209 conventions have developed throughout different parts of the world.
3210 Also study the professional terminology amongst typographers in your country.
3211 Inventing your own terminology will only confuse the users.
3214 (Warning! Typography is addictive!)
3217 \begin_layout Itemize
3218 Make a copy of the document.
3219 This will be your working copy.
3220 You can use this as your personal translated help-file by placing it in
3222 \begin_inset Flex CharStyle:Code
3225 \begin_layout Plain Layout
3234 \begin_layout Itemize
3235 Sometimes the original document (from the LyX-team) will be updated.
3236 Use the source viewer at
3237 \begin_inset CommandInset href
3239 name "http://www.lyx.org/trac/timeline"
3240 target "http://www.lyx.org/trac/timeline"
3244 to see what has been changed.
3245 That way you can easily see which parts of the translated document need
3249 \begin_layout Standard
3250 If you ever find an error in the original document, fix it and notify the
3251 rest of the documentation team of the changes! (You didn't forget to join
3252 the documentation team, did you?)
3255 \begin_layout Standard
3256 \begin_inset Branch OutDated
3259 \begin_layout Section
3260 International Keyboard Support
3263 \begin_layout Standard
3266 [Editor's Note: The following section is by
3274 It needs to be fixed to conform to the new Documentation Style sheet and
3275 to make use of the new v1.0 features.
3276 The whole thing also needs to be merged with the section following it.-jw
3277 It may also be badly out of date.-rh (2008)]
3280 \begin_layout Subsection
3281 Defining Own Keymaps: Keymap File Format
3284 \begin_layout Standard
3285 Let's look at a keyboard definition file a little closer.
3286 It is a plain text file defining
3289 \begin_layout Itemize
3290 key-to-key or key-to-string translations
3293 \begin_layout Itemize
3297 \begin_layout Itemize
3298 dead keys exceptions
3301 \begin_layout Standard
3302 To define key-to-key or key-to-string translation, use this command:
3305 \begin_layout Quotation
3306 \begin_inset Flex CharStyle:Code
3309 \begin_layout Plain Layout
3318 \begin_inset Flex CharStyle:Code
3321 \begin_layout Plain Layout
3330 \begin_layout Standard
3332 \begin_inset Flex CharStyle:Code
3335 \begin_layout Plain Layout
3341 is the key to be translated and
3342 \begin_inset Flex CharStyle:Code
3345 \begin_layout Plain Layout
3351 is the string to be inserted into the document.
3352 To define dead keys, use:
3355 \begin_layout Quotation
3356 \begin_inset Flex CharStyle:Code
3359 \begin_layout Plain Layout
3368 \begin_inset Flex CharStyle:Code
3371 \begin_layout Plain Layout
3380 \begin_layout Standard
3382 \begin_inset Flex CharStyle:Code
3385 \begin_layout Plain Layout
3391 is a keyboard key and
3392 \begin_inset Flex CharStyle:Code
3395 \begin_layout Plain Layout
3402 The following dead keys are supported (shortcut name is in parentheses):
3405 \begin_layout Quotation
3409 \begin_inset space \hfill{}
3415 \begin_layout Quotation
3417 \begin_inset space \hfill{}
3423 \begin_layout Quotation
3425 \begin_inset space \hfill{}
3431 \begin_layout Quotation
3433 \begin_inset space \hfill{}
3439 \begin_layout Quotation
3441 \begin_inset space \hfill{}
3447 \begin_layout Quotation
3449 \begin_inset space \hfill{}
3456 \begin_layout Plain Layout
3468 \begin_layout Quotation
3470 \begin_inset space \hfill{}
3476 \begin_layout Quotation
3478 \begin_inset space \hfill{}
3485 \begin_layout Plain Layout
3497 \begin_layout Quotation
3499 \begin_inset space \hfill{}
3505 \begin_layout Quotation
3507 \begin_inset space \hfill{}
3513 \begin_layout Quotation
3515 \begin_inset space \hfill{}
3522 \begin_layout Plain Layout
3534 \begin_layout Quotation
3536 \begin_inset space \hfill{}
3543 \begin_layout Plain Layout
3555 \begin_layout Quotation
3557 \begin_inset space \hfill{}
3563 \begin_layout Quotation
3564 hungarian umlaut (hug)
3565 \begin_inset space \hfill{}
3571 \begin_layout Quotation
3573 \begin_inset space \hfill{}
3579 \begin_layout Quotation
3581 \begin_inset space \hfill{}
3588 \begin_layout Plain Layout
3600 \begin_layout Standard
3601 Since in many international keyboards there are exceptions to what some
3602 dead keys should do, you can define them using
3605 \begin_layout Quotation
3606 \begin_inset Flex CharStyle:Code
3609 \begin_layout Plain Layout
3617 deadkey key outstring
3620 \begin_layout Standard
3621 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3625 \begin_layout Quotation
3626 \begin_inset Flex CharStyle:Code
3629 \begin_layout Plain Layout
3642 \begin_layout Standard
3643 to make it work correctly.
3644 Also, you have to define as exceptions dead keys over i and j, to remove
3645 the dot from them before inserting an accent mark.
3646 I will change this when the time comes, but so far I haven't had time.
3649 \begin_layout Standard
3650 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3653 \begin_inset Flex CharStyle:Code
3656 \begin_layout Plain Layout
3662 have different meaning.
3664 \begin_inset Flex CharStyle:Code
3667 \begin_layout Plain Layout
3673 marks comments, quotes start and end LaTeX-style commands.
3674 To enter quote, you'll need to use
3675 \begin_inset Flex CharStyle:Code
3678 \begin_layout Plain Layout
3687 \begin_inset Flex CharStyle:Code
3690 \begin_layout Plain Layout
3697 \begin_inset Flex CharStyle:Code
3700 \begin_layout Plain Layout
3711 \begin_layout Standard
3712 If you make a keyboard description file that works for your language, please
3713 mail it to me, so I can include it in the next keymap distribution.
3716 \begin_layout Standard
3717 More keywords will be supported in keymap configuration file in future,
3721 \begin_layout Itemize
3722 \begin_inset Flex CharStyle:Code
3725 \begin_layout Plain Layout
3736 \begin_inset space \hfill{}
3740 \begin_inset Flex CharStyle:Code
3743 \begin_layout Plain Layout
3752 \begin_layout Itemize
3753 \begin_inset Flex CharStyle:Code
3756 \begin_layout Plain Layout
3767 \begin_inset space \hfill{}
3771 \begin_inset Flex CharStyle:Code
3774 \begin_layout Plain Layout
3780 an external keymap translation program
3783 \begin_layout Standard
3784 Also, it should look into
3785 \begin_inset Flex CharStyle:Code
3788 \begin_layout Plain Layout
3794 file for defaults, too (for example, a
3795 \begin_inset Flex CharStyle:Code
3798 \begin_layout Plain Layout
3806 option to include default keyboard).
3814 \begin_layout Section
3815 \begin_inset CommandInset label
3821 International Keymap Stuff
3824 \begin_layout Standard
3825 \begin_inset Note Note
3828 \begin_layout Plain Layout
3829 In doing the revisions on this document in March 2008, I did not look over
3830 this stuff, as I do not understand it.
3831 It would be good if someone else could do so.
3839 \begin_layout Standard
3840 The next two sections describe the
3841 \begin_inset Flex CharStyle:Code
3844 \begin_layout Plain Layout
3853 \begin_inset Flex CharStyle:Code
3856 \begin_layout Plain Layout
3864 file syntax in detail.
3865 These sections should help you design your own key map if the ones provided
3866 do not meet your needs.
3869 \begin_layout Subsection
3873 \begin_layout Standard
3877 \begin_inset Flex CharStyle:Code
3880 \begin_layout Plain Layout
3886 file maps keystrokes to characters or strings.
3887 As the name suggests, it sets a keyboard mapping.
3889 \begin_inset Flex CharStyle:Code
3892 \begin_layout Plain Layout
3903 \begin_inset Flex CharStyle:Code
3906 \begin_layout Plain Layout
3921 \begin_inset Flex CharStyle:Code
3924 \begin_layout Plain Layout
3937 \begin_inset Flex CharStyle:Code
3940 \begin_layout Plain Layout
3949 \begin_inset Flex CharStyle:Code
3952 \begin_layout Plain Layout
3960 are described in this section.
3963 \begin_layout Labeling
3964 \labelwidthstring 00.00.0000
3965 \begin_inset Flex CharStyle:Code
3968 \begin_layout Plain Layout
3976 Map a character to a string
3979 \begin_layout LyX-Code
3994 \begin_layout Standard
4027 the double-quote (")
4044 must be escaped with a preceding backslash (
4055 \begin_layout Standard
4057 \begin_inset Flex CharStyle:MenuItem
4060 \begin_layout Plain Layout
4068 statement to cause the symbol
4069 \begin_inset Flex CharStyle:MenuItem
4072 \begin_layout Plain Layout
4080 to be output for the keystroke
4081 \begin_inset Flex CharStyle:MenuItem
4084 \begin_layout Plain Layout
4095 \begin_layout LyX-Code
4101 \begin_layout Labeling
4102 \labelwidthstring 00.00.0000
4103 \begin_inset Flex CharStyle:Code
4106 \begin_layout Plain Layout
4114 Specify an accent character
4117 \begin_layout LyX-Code
4126 \begin_layout Standard
4127 This will make the cha
4165 This is the dead key
4169 \begin_layout Plain Layout
4176 refers to a key that does not produce a character by itself, but when followed
4177 with another key, produces the desired accent character.
4178 For example, a German characte
4180 r with an umlaut like
4190 can be produced in this manner.
4199 \begin_layout Standard
4212 and then another key not in
4229 followed by the other, unallowed key, as output.
4233 \begin_inset Flex CharStyle:MenuItem
4236 \begin_layout Plain Layout
4244 cancels a dead key, so if
4255 \begin_inset Flex CharStyle:MenuItem
4258 \begin_layout Plain Layout
4267 , the cursor will not go one position backwards but will instead cancel
4283 might have had on the next keystroke.
4287 \begin_layout Standard
4288 The following example specifies that the character ' is to be an acute accent,
4289 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4292 \begin_layout LyX-Code
4295 kmod ' acute aeiouAEIOU
4298 \begin_layout Labeling
4299 \labelwidthstring 00.00.0000
4300 \begin_inset Flex CharStyle:Code
4303 \begin_layout Plain Layout
4309 Specify an exception to the accent character
4312 \begin_layout LyX-Code
4321 \begin_layout Standard
4322 This defines an exce
4363 have been assigned a keystroke with a previous
4366 \begin_inset Flex CharStyle:Code
4369 \begin_layout Plain Layout
4393 must not belong in the
4445 If such a declaration does not exist in
4453 \begin_inset Flex CharStyle:Code
4456 \begin_layout Plain Layout
4496 \begin_inset Flex CharStyle:Code
4499 \begin_layout Plain Layout
4513 \begin_layout Standard
4514 The following command produces causes äi to be produced when you enter acute-i
4518 \begin_layout LyX-Code
4532 \begin_layout Labeling
4533 \labelwidthstring 00.00.0000
4534 \begin_inset Flex CharStyle:Code
4537 \begin_layout Plain Layout
4543 Combine two accent characters
4546 \begin_layout LyX-Code
4552 accent1 accent2 allowed
4555 \begin_layout Standard
4556 This one is getting pretty esoteric.
4557 It allows you to combine the effect
4613 \begin_inset Flex CharStyle:Code
4616 \begin_layout Plain Layout
4644 \begin_layout Standard
4645 Consider this example from the
4646 \begin_inset Flex CharStyle:Code
4649 \begin_layout Plain Layout
4660 \begin_layout LyX-Code
4663 kmod ; acute aeioyvhAEIOYVH
4667 kcomb acute umlaut iyIY
4670 \begin_layout Standard
4671 This allows you to press
4672 \begin_inset Flex CharStyle:MenuItem
4675 \begin_layout Plain Layout
4683 and get the effect of
4684 \begin_inset Flex CharStyle:Code
4687 \begin_layout Plain Layout
4706 in this case cancels the last dead key, so if you press
4707 \begin_inset Flex CharStyle:MenuItem
4710 \begin_layout Plain Layout
4719 \begin_inset Flex CharStyle:Code
4722 \begin_layout Plain Layout
4735 \begin_layout Subsection
4739 \begin_layout Standard
4741 \begin_inset Flex CharStyle:Code
4744 \begin_layout Plain Layout
4752 mapping is performed, a
4753 \begin_inset Flex CharStyle:Code
4756 \begin_layout Plain Layout
4766 file maps the strings that the symbols generate to characters in the current
4768 The LyX distribution currently includes at least the
4769 \begin_inset Flex CharStyle:Code
4772 \begin_layout Plain Layout
4781 \begin_inset Flex CharStyle:Code
4784 \begin_layout Plain Layout
4795 \begin_layout Standard
4797 \begin_inset Flex CharStyle:Code
4800 \begin_layout Plain Layout
4808 file is a sequence of declarations of the form
4811 \begin_layout LyX-Code
4824 \begin_layout Standard
4825 For example, in order to map
4826 \begin_inset Flex CharStyle:MenuItem
4829 \begin_layout Plain Layout
4839 to the corresponding character in the iso-8859-1 set (233), the following
4843 \begin_layout LyX-Code
4851 \begin_layout Standard
4853 \begin_inset Flex CharStyle:Code
4856 \begin_layout Plain Layout
4865 \begin_inset Flex CharStyle:Code
4868 \begin_layout Plain Layout
4886 the same character can apply to more than one string.
4888 \begin_inset Flex CharStyle:Code
4891 \begin_layout Plain Layout
4902 \begin_layout LyX-Code
4914 \begin_inset Newline newline
4930 \begin_layout Standard
4931 If LyX cannot find a mapping for the string produced by the keystroke or
4932 a deadkey sequence, it will check if it looks like an accented char and
4933 try to draw an accent over the character on screen.
4936 \begin_layout Subsection
4940 \begin_layout Standard
4941 There is a second way to add support for international characters through
4942 so-called dead-keys.
4943 A dead-key works in combination with a letter to produce an accented character.
4944 Here, we'll explain how to create a really simple dead-key to illustrate
4948 \begin_layout Standard
4949 Suppose you happen to need the circumflex character,
4950 \begin_inset Quotes eld
4954 \begin_inset Quotes erd
4959 \begin_inset Flex CharStyle:MenuItem
4962 \begin_layout Plain Layout
4969 \begin_inset space ~
4973 \begin_inset Flex CharStyle:MenuItem
4976 \begin_layout Plain Layout
4982 ] to the LyX command
4983 \begin_inset Flex CharStyle:Code
4986 \begin_layout Plain Layout
4993 \begin_inset Flex CharStyle:Code
4996 \begin_layout Plain Layout
5003 Now, whenever you type the
5004 \begin_inset Flex CharStyle:MenuItem
5007 \begin_layout Plain Layout
5013 -key followed by a letter, that letter will have a circumflex accent on
5015 For example, the sequence
5016 \begin_inset Quotes eld
5020 \begin_inset Flex CharStyle:MenuItem
5023 \begin_layout Plain Layout
5030 \begin_inset Quotes erd
5033 produces the letter:
5034 \begin_inset Quotes eld
5038 \begin_inset Quotes erd
5042 If you tried to type
5043 \begin_inset Quotes eld
5047 \begin_inset Flex CharStyle:MenuItem
5050 \begin_layout Plain Layout
5057 \begin_inset Quotes erd
5060 , however, LyX will complain with a beep, since a
5061 \begin_inset Quotes eld
5065 \begin_inset Flex CharStyle:MenuItem
5068 \begin_layout Plain Layout
5075 \begin_inset Quotes erd
5078 never takes a circumflex accent.
5080 \begin_inset Flex CharStyle:MenuItem
5083 \begin_layout Plain Layout
5089 after a dead-key produces the bare-accent.
5090 Please note this last point! If you bind a key to a dead-key, you'll need
5091 to rebind the character on that key to yet another key.
5093 \begin_inset Flex CharStyle:MenuItem
5096 \begin_layout Plain Layout
5102 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5105 \begin_layout Standard
5106 One common way to bind dead-keys is to use
5107 \begin_inset Flex CharStyle:MenuItem
5110 \begin_layout Plain Layout
5117 \begin_inset Flex CharStyle:MenuItem
5120 \begin_layout Plain Layout
5127 \begin_inset Flex CharStyle:MenuItem
5130 \begin_layout Plain Layout
5136 in combination with an accent, like
5137 \begin_inset Quotes eld
5141 \begin_inset Flex CharStyle:MenuItem
5144 \begin_layout Plain Layout
5151 \begin_inset Quotes erd
5155 \begin_inset Quotes eld
5159 \begin_inset Flex CharStyle:MenuItem
5162 \begin_layout Plain Layout
5169 \begin_inset Quotes erd
5173 \begin_inset Quotes eld
5177 \begin_inset Flex CharStyle:MenuItem
5180 \begin_layout Plain Layout
5187 \begin_inset Quotes erd
5191 Another way involves using
5192 \begin_inset Flex CharStyle:Code
5195 \begin_layout Plain Layout
5202 \begin_inset Flex CharStyle:Code
5205 \begin_layout Plain Layout
5211 to set up the special
5212 \begin_inset Flex CharStyle:Code
5215 \begin_layout Plain Layout
5223 \begin_inset Flex CharStyle:Code
5226 \begin_layout Plain Layout
5232 acts in some ways just like
5233 \begin_inset Flex CharStyle:MenuItem
5236 \begin_layout Plain Layout
5242 and permits you to bind keys to accented characters.
5243 You can also turn keys into dead-keys by binding them to something like
5245 \begin_inset Flex CharStyle:Code
5248 \begin_layout Plain Layout
5254 and then binding this symbolic key to the corresponding LyX command.
5258 \begin_layout Plain Layout
5263 : This is exactly what I do in my
5264 \begin_inset Flex CharStyle:Code
5267 \begin_layout Plain Layout
5274 \begin_inset Flex CharStyle:Code
5277 \begin_layout Plain Layout
5285 \begin_inset Flex CharStyle:MenuItem
5288 \begin_layout Plain Layout
5290 \begin_inset space ~
5299 \begin_inset Flex CharStyle:Code
5302 \begin_layout Plain Layout
5308 and a bunch of these
5309 \begin_inset Quotes eld
5313 \begin_inset Flex CharStyle:Code
5316 \begin_layout Plain Layout
5323 \begin_inset Quotes erd
5326 symbolic keys bound such things as
5327 \begin_inset Flex CharStyle:MenuItem
5330 \begin_layout Plain Layout
5332 \begin_inset space ~
5341 \begin_inset Flex CharStyle:MenuItem
5344 \begin_layout Plain Layout
5346 \begin_inset space ~
5355 This is how I produce my accented characters.
5360 You can make just about anything into the
5361 \begin_inset Flex CharStyle:Code
5364 \begin_layout Plain Layout
5371 \begin_inset Flex CharStyle:MenuItem
5374 \begin_layout Plain Layout
5380 keys, a spare function key, etc.
5381 As for the LyX commands that produce accents, check the entry for
5382 \begin_inset Flex CharStyle:Code
5385 \begin_layout Plain Layout
5396 You'll find the complete list there.
5399 \begin_layout Subsection
5400 Saving your Language Configuration
5403 \begin_layout Standard
5404 \begin_inset CommandInset label
5410 You can edit your preferences so that your desired language environment
5411 is automatically configured when LyX starts up, via the
5412 \begin_inset Flex CharStyle:MenuItem
5415 \begin_layout Plain Layout
5420 dit\SpecialChar \menuseparator
5433 \begin_layout Chapter
5434 Installing New Document Classes, Layouts, and Templates
5435 \begin_inset CommandInset label
5437 name "chap:textclass"
5445 \begin_layout Plain Layout
5446 Installing New Document Classes
5454 \begin_layout Standard
5455 In this chapter, we describe the procedures for creating and installing
5456 new LyX layout and template files, as well as offer a refresher on correctly
5457 installing new LaTeX document classes.
5458 Some definitions: a document class is a LaTeX file (usually ending in
5459 \begin_inset Flex CharStyle:Code
5462 \begin_layout Plain Layout
5469 \begin_inset Flex CharStyle:Code
5472 \begin_layout Plain Layout
5478 ) that describes the format of a document such as an article, report, journal
5479 preprint, etc, and all the commands needed to realize that format.
5480 A layout file is a LyX file that corresponds to a LaTeX document class
5481 and that tells LyX how to
5482 \begin_inset Quotes eld
5486 \begin_inset Quotes erd
5489 things on the screen to make the display look something like the final
5491 More precisely, a layout file describes a
5492 \begin_inset Quotes eld
5496 \begin_inset Quotes erd
5499 which is the internal construct LyX uses to render the screen display.
5501 \begin_inset Quotes eld
5505 \begin_inset Quotes erd
5509 \begin_inset Quotes eld
5513 \begin_inset Quotes erd
5516 can be used somewhat interchangeably, but it is better to refer to the
5517 file as the layout, and the thing living in LyX's memory as the text class.
5518 A template file is simply a LyX document that contains a set of predefined
5519 entries for a given document class---entries that are generally required
5521 Templates are especially useful for things like journal manuscripts that
5522 are to be submitted electronically.
5525 \begin_layout Section
5526 Installing a new LaTeX package
5529 \begin_layout Standard
5530 Some installations may not include a LaTeX package that you would like to
5532 For example, you might need FoilTeX, a common (and very powerful) package
5533 for preparing slides or viewgraphs for overhead projectors.
5534 On some systems, you may have a GUI for installing such packages: MikTeX
5535 on Windows®, for example.
5538 \begin_layout Standard
5539 If you don't have such a GUI, then you can follow these steps.
5542 \begin_layout Enumerate
5543 Get the package from
5544 \begin_inset CommandInset href
5547 target "http://www.ctan.org/"
5554 \begin_layout Enumerate
5555 You can install this package in several different places.
5556 If you want it to be available for all users on your system, then you should
5557 install it in your `local' TeX tree; if you want (or need) it to be available
5558 just for you, then you can install it in your own `user' TeX tree.
5559 Where these should be created, if they do not already exist, depends upon
5560 the details of your system.
5561 To find out, look in the file
5562 \begin_inset Flex CharStyle:Code
5565 \begin_layout Plain Layout
5575 \begin_layout Plain Layout
5576 This usually lives in the directory
5577 \begin_inset Flex CharStyle:Code
5580 \begin_layout Plain Layout
5586 , though you can run
5587 \begin_inset Flex CharStyle:Code
5590 \begin_layout Plain Layout
5601 The location of the `local' TeX tree is defined by
5602 \begin_inset Flex CharStyle:Code
5605 \begin_layout Plain Layout
5611 ; this is usually somewhere like
5612 \begin_inset Flex CharStyle:Code
5615 \begin_layout Plain Layout
5616 /usr/local/share/texmf/
5622 The `user' TeX tree is defined by
5623 \begin_inset Flex CharStyle:Code
5626 \begin_layout Plain Layout
5633 \begin_inset Flex CharStyle:Code
5636 \begin_layout Plain Layout
5643 (If these variables are not predefined, you can define them.) You'll probably
5644 need root permissions to create or modify the `local' tree; but your `user'
5645 tree shouldn't have such limitations.
5648 \begin_layout Enumerate
5650 \begin_inset Flex CharStyle:Code
5653 \begin_layout Plain Layout
5660 \begin_inset Flex CharStyle:Code
5663 \begin_layout Plain Layout
5670 \begin_inset Flex CharStyle:Code
5673 \begin_layout Plain Layout
5681 \begin_inset Newline newline
5685 \begin_inset Flex CharStyle:Code
5688 \begin_layout Plain Layout
5689 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5695 \begin_inset Newline newline
5698 But, again, most of this will
5699 \begin_inset Quotes eld
5703 \begin_inset Quotes erd
5709 \begin_layout Enumerate
5714 \begin_layout Plain Layout
5715 We'll assume henceforth that you're defining `local' TeX tree.
5716 If you're defining a user tree, just adjust as necessary.
5722 You must follow the directory structure of your existing
5723 \begin_inset Flex CharStyle:Code
5726 \begin_layout Plain Layout
5732 directory, which will be found at
5733 \begin_inset Flex CharStyle:Code
5736 \begin_layout Plain Layout
5743 For example, latex packages should go under
5744 \begin_inset Flex CharStyle:Code
5747 \begin_layout Plain Layout
5748 $TEXMFLOCAL/tex/latex/
5756 \begin_layout Enumerate
5757 Install the package.
5758 For example, you would unpack the FoilTeX tarball and copy it to
5759 \begin_inset Flex CharStyle:Code
5762 \begin_layout Plain Layout
5763 $TEXMFLOCAL/tex/latex/foiltex
5770 \begin_inset Flex CharStyle:Code
5773 \begin_layout Plain Layout
5779 directory contains various files.
5782 \begin_layout Enumerate
5784 \begin_inset Flex CharStyle:Code
5787 \begin_layout Plain Layout
5795 \begin_inset Flex CharStyle:Code
5798 \begin_layout Plain Layout
5807 \begin_layout Standard
5808 Your package is now installed and available to LaTeX.
5809 To make it available to LyX, you need to create a Layout file, if one is
5810 not already available.
5811 (See the next section.) Once you have a layout file, you need only reconfigure
5813 \begin_inset Flex CharStyle:MenuItem
5816 \begin_layout Plain Layout
5821 ools\SpecialChar \menuseparator
5831 ) and then restart LyX.
5832 You should then see your new package---for example
5833 \begin_inset Flex CharStyle:MenuItem
5836 \begin_layout Plain Layout
5843 \begin_inset Flex CharStyle:MenuItem
5846 \begin_layout Plain Layout
5851 ocument\SpecialChar \menuseparator
5862 \begin_inset Flex CharStyle:MenuItem
5865 \begin_layout Plain Layout
5875 \begin_layout Section
5876 \begin_inset CommandInset label
5885 \begin_layout Standard
5886 This section describes how to write and install your own LyX layout files
5887 and walks through the
5888 \begin_inset Flex CharStyle:Code
5891 \begin_layout Plain Layout
5897 text class format as an example.
5899 \begin_inset Flex CharStyle:Code
5902 \begin_layout Plain Layout
5908 files describe what paragraph and character styles are available for a
5909 given document class and how LyX should display them.
5910 We try to provide a thorough description of the process here; however,
5911 there are so many different types of documents supported by LaTeX classes
5912 that we can't hope to cover every different possibility or problem you
5914 (The LyX users' list is frequented by people with lots of experience with
5915 layout design who are willing to share what they've learned.)
5918 \begin_layout Standard
5919 As you prepare to write a new layout, it is extremely helpful to look at
5920 the example layouts distributed with LyX.
5921 If you use a nice LaTeX document class that might be of interest for others,
5922 too, and have a nice corresponding LyX layout, feel free to contribute
5923 the stuff to us, so we may put it into the distribution.
5925 \begin_inset CommandInset href
5927 name "section on the LyX wiki"
5928 target "http://wiki.lyx.org/Layouts/Layouts"
5932 for this kind of material.
5935 \begin_layout Standard
5936 All the tags described in this chapter are case-insensitive; this means
5938 \begin_inset Flex CharStyle:Code
5941 \begin_layout Plain Layout
5948 \begin_inset Flex CharStyle:Code
5951 \begin_layout Plain Layout
5958 \begin_inset Flex CharStyle:Code
5961 \begin_layout Plain Layout
5967 are really the same command.
5968 The possible values are printed in brackets after the feature's name.
5969 The default value if a feature isn't specified inside a text class-description
5971 \begin_inset Flex CharStyle:Code
5974 \begin_layout Plain Layout
5983 If the argument has a datatype like
5984 \begin_inset Quotes eld
5988 \begin_inset Quotes erd
5992 \begin_inset Quotes eld
5996 \begin_inset Quotes erd
5999 , the default is shown like this:
6000 \begin_inset Flex CharStyle:Code
6003 \begin_layout Plain Layout
6014 \begin_layout Subsection
6015 \begin_inset CommandInset label
6017 name "sub:Layout-modules"
6024 \begin_layout Standard
6025 Similar to layout files, and new with LyX 1.6, are layout
6030 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6031 some modules---such as the Endnotes module---provide support for just such
6033 In a sense, layout modules are similar to included files---files like
6034 \begin_inset Flex CharStyle:Code
6037 \begin_layout Plain Layout
6043 ---in that modules are not specific to a given document layout but may be
6044 used with many different layouts.
6045 The difference is that using a layout module does not require editing the
6047 Rather, modules are selected in the
6048 \begin_inset Flex CharStyle:MenuItem
6051 \begin_layout Plain Layout
6052 Document\SpecialChar \menuseparator
6061 \begin_layout Standard
6062 Building modules is the easiest way to get started with layout editing,
6063 since it can be as simple as adding a single new paragraph or flex inset.
6064 But modules may, in principle, contain anything a layout file can contain.
6067 \begin_layout Standard
6068 A module must begin with a line like the following:
6071 \begin_layout LyX-Code
6074 DeclareLyXModule[endnotes.sty]{Endnotes}
6077 \begin_layout Standard
6078 The argument in square brackets is optional: It declares any LaTeX packages
6079 on which the module depends.
6080 The mandatory argument, in curly brackets, is the name of the module, as
6082 \begin_inset Flex CharStyle:MenuItem
6085 \begin_layout Plain Layout
6086 Document\SpecialChar \menuseparator
6096 \begin_layout Standard
6097 The module declaration should then be followed by lines like the following:
6100 \begin_layout LyX-Code
6104 \begin_layout LyX-Code
6105 #Adds an endnote command, in addition to footnotes.
6109 \begin_layout LyX-Code
6110 #You will need to add
6112 theendnotes in ERT where you
6115 \begin_layout LyX-Code
6116 #want the endnotes to appear.
6120 \begin_layout LyX-Code
6124 \begin_layout LyX-Code
6125 #Requires: somemodule | othermodule
6128 \begin_layout LyX-Code
6129 #Excludes: badmodule
6132 \begin_layout Standard
6133 The description is used in
6134 \begin_inset Flex CharStyle:MenuItem
6137 \begin_layout Plain Layout
6138 Document\SpecialChar \menuseparator
6144 to provide the user with information about what the module does.
6146 \begin_inset Flex CharStyle:Code
6149 \begin_layout Plain Layout
6155 line is used to identify other modules with which this one must be used;
6157 \begin_inset Flex CharStyle:Code
6160 \begin_layout Plain Layout
6166 line is used to identify modules with which this one may not be used.
6167 Both are optional, and, as shown, multiple modules should be separated
6168 with the pipe symbol: |.
6169 Note that the required modules are treated disjunctively:
6173 of the required modules must be used.
6178 excluded module may be used.
6179 Note that modules are identified here by their
6183 without the .module extension.
6185 \begin_inset Flex CharStyle:Code
6188 \begin_layout Plain Layout
6195 \begin_inset Flex CharStyle:Code
6198 \begin_layout Plain Layout
6207 \begin_layout Standard
6208 After creating a new module, you will need to reconfigure and then restart
6209 LyX for the module to appear in the menu.
6210 However, changes you make to the module will be seen immediately, if you
6212 \begin_inset Flex CharStyle:MenuItem
6215 \begin_layout Plain Layout
6216 Document\SpecialChar \menuseparator
6222 , highlight something, and then hit
6223 \begin_inset Quotes eld
6227 \begin_inset Quotes erd
6233 It is strongly recommended that you save your work before doing so
6238 it is strongly recommended that you not attempt to edit modules while simultaneo
6239 usly working on documents
6242 Though of course the developers strive to keep LyX stable in such situations,
6243 syntax errors and the like in your module file could cause strange behavior.
6246 \begin_layout Subsection
6247 Supporting new document classes
6250 \begin_layout Standard
6251 There are two situations you are likely to encounter when wanting to support
6252 a new LaTeX document class, involving LaTeX2e class (
6253 \begin_inset Flex CharStyle:Code
6256 \begin_layout Plain Layout
6263 \begin_inset Flex CharStyle:Code
6266 \begin_layout Plain Layout
6273 Supporting a style file is usually fairly easy.
6274 Supporting a new document class is a bit harder.
6277 \begin_layout Subsection
6279 \begin_inset Flex CharStyle:MenuItem
6282 \begin_layout Plain Layout
6291 \begin_layout Standard
6292 If your new document class is provided as a style file that is used in conjuncti
6293 on with an existing, supported document class---for the sake of the example,
6294 we'll assume that the style file is called
6295 \begin_inset Flex CharStyle:MenuItem
6298 \begin_layout Plain Layout
6304 and it is meant to be used with
6305 \begin_inset Flex CharStyle:MenuItem
6308 \begin_layout Plain Layout
6314 , which is a standard class---start by copying the existing class's layout
6315 file into your local directory:
6318 \begin_layout LyX-Code
6319 cp report.layout ~/.lyx/layouts/myclass.layout
6322 \begin_layout Standard
6324 \begin_inset Flex CharStyle:Code
6327 \begin_layout Plain Layout
6333 and change the line:
6336 \begin_layout LyX-Code
6339 DeclareLaTeXClass{report}
6342 \begin_layout Standard
6346 \begin_layout LyX-Code
6349 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6352 \begin_layout Standard
6356 \begin_layout LyX-Code
6358 \begin_inset Newline newline
6364 \begin_inset Newline newline
6370 \begin_layout Standard
6371 near the top of the file.
6374 \begin_layout Standard
6375 Start LyX and select
6376 \begin_inset Flex CharStyle:MenuItem
6379 \begin_layout Plain Layout
6384 ools\SpecialChar \menuseparator
6395 Then restart LyX and try creating a new document.
6397 \begin_inset Flex CharStyle:MenuItem
6400 \begin_layout Plain Layout
6406 " as a document class option in the
6407 \begin_inset Flex CharStyle:MenuItem
6410 \begin_layout Plain Layout
6415 ocument\SpecialChar \menuseparator
6426 It is likely that some of the sectioning commands and such in your new
6427 class will work differently from how they worked in the base class---
6428 \begin_inset Flex CharStyle:Code
6431 \begin_layout Plain Layout
6437 in this example---so you can fiddle around with the settings for the different
6438 sections if you wish.
6441 \begin_layout Subsection
6443 \begin_inset Flex CharStyle:MenuItem
6446 \begin_layout Plain Layout
6455 \begin_layout Standard
6456 There are two possibilities here.
6457 One is that the class file is itself based upon an existing document class.
6458 For example, many thesis classes are based upon
6459 \begin_inset Flex CharStyle:MenuItem
6462 \begin_layout Plain Layout
6469 To see whether yours is, look for a line like
6472 \begin_layout LyX-Code
6478 \begin_layout Standard
6480 If so, then you may proceed largely as in the previous section, though
6481 the DeclareLaTeXClass line will be different.
6482 If your new class is thesis, and it is based upon book, then the line should
6487 \begin_layout Plain Layout
6488 And it will be easiest if you save the file to
6489 \begin_inset Flex CharStyle:Code
6492 \begin_layout Plain Layout
6498 : LyX assumes that the document class has the same name as the layout file.
6507 \begin_layout LyX-Code
6510 DeclareLaTeXClass[thesis,book]{thesis}
6513 \begin_layout Standard
6514 If, on the other hand, the new class is not based upon an existing class,
6515 you will probably have to
6516 \begin_inset Quotes eld
6520 \begin_inset Quotes erd
6524 We strongly suggest copying an existing layout file which uses a similar
6525 LaTeX class and then modifying it, if you can do so.
6526 At least use an existing file as a starting point so you can find out what
6527 items you need to worry about.
6528 Again, the specifics are covered below.
6531 \begin_layout Section
6532 Declaring a new text class
6535 \begin_layout Standard
6536 When it's finally time to get your hands dirty and create or edit your own
6537 layout file, the following sections describe what you're up against.
6538 Our advice is to go slowly, save and test often, listen to soothing music,
6539 and enjoy one or two of your favorite adult beverages; more if you are
6540 getting particularly stuck.
6541 It's really not that hard, except that the multitude of options can become
6542 overwhelming if you try to do to much in one sitting.
6543 Go have another adult beverage, just for good measure.
6546 \begin_layout Standard
6550 \begin_layout Standard
6551 Lines in a layout file which begin with a
6552 \begin_inset Flex CharStyle:Code
6555 \begin_layout Plain Layout
6562 There is one exception to this rule: all layouts should begin with lines
6566 \begin_layout LyX-Code
6569 #% Do not delete the line below; configure depends on this
6572 \begin_layout LyX-Code
6577 DeclareLaTeXClass{article}
6580 \begin_layout Standard
6581 The second line is used when you configure LyX.
6582 The layout file is read by the LaTeX script
6583 \begin_inset Flex CharStyle:Code
6586 \begin_layout Plain Layout
6592 , in a special mode where
6593 \begin_inset Flex CharStyle:Code
6596 \begin_layout Plain Layout
6603 The first line is just a LaTeX comment, and the second one contains the
6604 declaration of the text class.
6605 If these lines appear in a file named
6606 \begin_inset Flex CharStyle:Code
6609 \begin_layout Plain Layout
6615 , then they define a text class of name
6616 \begin_inset Flex CharStyle:Code
6619 \begin_layout Plain Layout
6625 (the name of the layout file) which uses the LaTeX document class
6626 \begin_inset Flex CharStyle:Code
6629 \begin_layout Plain Layout
6635 (the default is to use the same name as the layout).
6637 \begin_inset Quotes eld
6641 \begin_inset Quotes erd
6644 that appears above is used as a description of the text class in the
6645 \begin_inset Flex CharStyle:MenuItem
6648 \begin_layout Plain Layout
6653 ocument\SpecialChar \menuseparator
6666 \begin_layout Standard
6667 Let's assume that you wrote your own text class that uses the
6668 \begin_inset Flex CharStyle:Code
6671 \begin_layout Plain Layout
6677 document class, but where you changed the appearance of the section headings.
6678 If you put it in a file
6679 \begin_inset Flex CharStyle:Code
6682 \begin_layout Plain Layout
6688 , the header of this file should be:
6691 \begin_layout LyX-Code
6694 #% Do not delete the line below; configure depends on this
6697 \begin_layout LyX-Code
6702 DeclareLaTeXClass[article]{article (with my own headings)}
6705 \begin_layout Standard
6706 This declares a text class
6707 \begin_inset Flex CharStyle:Code
6710 \begin_layout Plain Layout
6716 , associated with the LaTeX document class
6717 \begin_inset Flex CharStyle:Code
6720 \begin_layout Plain Layout
6727 \begin_inset Quotes eld
6730 article (with my own headings)
6731 \begin_inset Quotes erd
6735 If your text class depends on several packages, you can declare it as:
6738 \begin_layout LyX-Code
6741 #% Do not delete the line below; configure depends on this
6744 \begin_layout LyX-Code
6749 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6752 \begin_layout Standard
6753 This indicates that your text class uses the foo.sty package.
6754 Finally, it is also possible to declare classes for DocBook code.
6755 Typical declarations will look like
6758 \begin_layout LyX-Code
6761 #% Do not delete the line below; configure depends on this
6764 \begin_layout LyX-Code
6769 DeclareDocBookClass[article]{SGML (DocBook article)}
6772 \begin_layout Standard
6773 Note that these declarations can also be given an optional parameter declaring
6774 the name of the document class (but not a list).
6777 \begin_layout Standard
6778 So, to be as explicit as possible, the form of the layout declaration is:
6781 \begin_layout LyX-Code
6786 DeclareLaTeXClass[class,package.sty]{layout description}
6789 \begin_layout Standard
6790 The class need only be specified if the name of the LaTeX class file and
6791 the name of the layout file are different; if the name of the classfile
6792 is not specified, then LyX will simply assume that it is the same as the
6793 name of the layout file.
6796 \begin_layout Standard
6797 When the text class has been modified to your taste, all you have to do
6798 is to copy it either to
6799 \begin_inset Flex CharStyle:Code
6802 \begin_layout Plain Layout
6809 \begin_inset Flex CharStyle:Code
6812 \begin_layout Plain Layout
6819 \begin_inset Flex CharStyle:MenuItem
6822 \begin_layout Plain Layout
6827 ools\SpecialChar \menuseparator
6837 , exit LyX and restart it.
6838 Then your new text class should be available along with the others.
6841 \begin_layout Standard
6842 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6843 you made to your layout files.
6844 As a result, editing layout files could be very time consuming.
6845 Beginning with 1.6, however, you can force a reload of the layout currently
6846 in use by using the LyX function
6847 \begin_inset Flex CharStyle:MenuItem
6850 \begin_layout Plain Layout
6857 There is no default binding for this function---though, of course, you
6858 can bind it to a key yourself (see section
6859 \begin_inset CommandInset ref
6861 reference "sec:bindings"
6866 If you want to use this function, then, you should simply enter it in the
6872 : This is very much an `advanced feature'.
6877 recommended that you save your work before using this function.
6882 recommended that you not attempt to edit your layout while simultaneously
6883 working on a document that you care about.
6884 Use a test document.
6885 Syntax errors and the like in your layout file could cause peculiar behavior.
6886 In particular, such errors could cause LyX to regard the current layout
6887 as invalid and to attempt to switch to some other layout.
6888 The LyX team strives to keep LyX stable in such situations, but safe is
6892 \begin_layout Subsection
6896 \begin_layout Standard
6897 The first non-comment line must contain the file format number:
6900 \begin_layout Description
6901 \begin_inset Flex CharStyle:Code
6904 \begin_layout Plain Layout
6911 \begin_inset Flex CharStyle:Code
6914 \begin_layout Plain Layout
6920 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6921 don't have an explicit file format).
6922 The file format that is documented here is format 8.
6925 \begin_layout Subsection
6926 General text class parameters
6929 \begin_layout Standard
6930 These are the general parameters which describe the form of the entire document:
6933 \begin_layout Description
6934 \begin_inset Flex CharStyle:Code
6937 \begin_layout Plain Layout
6943 Adds information to the document preamble.
6945 \begin_inset Quotes eld
6949 \begin_inset Flex CharStyle:Code
6952 \begin_layout Plain Layout
6959 \begin_inset Quotes erd
6965 \begin_layout Description
6966 \begin_inset Flex CharStyle:Code
6969 \begin_layout Plain Layout
6975 Describes various global options supported by the document class.
6977 \begin_inset space ~
6981 \begin_inset CommandInset ref
6983 reference "sec:classoptions"
6989 \begin_inset Quotes eld
6993 \begin_inset Flex CharStyle:Code
6996 \begin_layout Plain Layout
7003 \begin_inset Quotes erd
7009 \begin_layout Description
7010 \begin_inset Flex CharStyle:Code
7013 \begin_layout Plain Layout
7020 \begin_inset Flex CharStyle:Code
7023 \begin_layout Plain Layout
7032 \begin_inset Flex CharStyle:Code
7035 \begin_layout Plain Layout
7041 ] Whether the class should default to having one or two columns.
7042 Can be changed in the
7043 \begin_inset Flex CharStyle:MenuItem
7046 \begin_layout Plain Layout
7051 ocument\SpecialChar \menuseparator
7064 \begin_layout Description
7065 \begin_inset Flex CharStyle:Code
7068 \begin_layout Plain Layout
7074 This sequence defines a new counter.
7076 \begin_inset space ~
7080 \begin_inset CommandInset ref
7082 reference "sec:counter"
7088 \begin_inset Quotes eld
7092 \begin_inset Flex CharStyle:Code
7095 \begin_layout Plain Layout
7102 \begin_inset Quotes erd
7108 \begin_layout Description
7109 \begin_inset Flex CharStyle:Code
7112 \begin_layout Plain Layout
7118 Sets the default font used to display the document.
7120 \begin_inset space ~
7124 \begin_inset CommandInset ref
7126 reference "sec:fonts"
7130 for how to declare fonts.
7132 \begin_inset Quotes eld
7136 \begin_inset Flex CharStyle:Code
7139 \begin_layout Plain Layout
7146 \begin_inset Quotes erd
7152 \begin_layout Description
7153 \begin_inset Flex CharStyle:Code
7156 \begin_layout Plain Layout
7163 \begin_inset Flex CharStyle:Code
7166 \begin_layout Plain Layout
7172 ] This is the style that will be assigned to new paragraphs, usually
7173 \begin_inset Flex CharStyle:MenuItem
7176 \begin_layout Plain Layout
7183 This will default to the first defined style if not given, but you are
7184 highly encouraged to use this directive.
7187 \begin_layout Description
7188 \begin_inset Flex CharStyle:Code
7191 \begin_layout Plain Layout
7197 Defines a new float.
7199 \begin_inset space ~
7203 \begin_inset CommandInset ref
7205 reference "sec:floats"
7211 \begin_inset Quotes eld
7215 \begin_inset Flex CharStyle:Code
7218 \begin_layout Plain Layout
7225 \begin_inset Quotes erd
7231 \begin_layout Description
7232 \begin_inset Flex CharStyle:Code
7235 \begin_layout Plain Layout
7241 As its name implies, this command allows you to include another layout
7242 definition file within yours to avoid duplicating commands.
7243 Common examples are the standard layout files, for example,
7244 \begin_inset Flex CharStyle:Code
7247 \begin_layout Plain Layout
7253 , which contains most of the basic layouts.
7256 \begin_layout Description
7257 \begin_inset Flex CharStyle:Code
7260 \begin_layout Plain Layout
7266 This section (re-)defines the layout of an inset.
7267 It can be applied to an existing inset of to a new, user-defined inset,
7268 e.g., a new character style.
7270 \begin_inset space ~
7274 \begin_inset CommandInset ref
7276 reference "sec:charstyle"
7280 for more information.
7282 \begin_inset Quotes eld
7286 \begin_inset Flex CharStyle:Code
7289 \begin_layout Plain Layout
7296 \begin_inset Quotes erd
7302 \begin_layout Description
7303 \begin_inset Flex CharStyle:Code
7306 \begin_layout Plain Layout
7315 \begin_layout Description
7316 \begin_inset Flex CharStyle:Code
7319 \begin_layout Plain Layout
7325 This command deletes an existing float.
7326 This is particularly useful when you want to suppress a float that has
7327 be defined in an input file.
7330 \begin_layout Description
7331 \begin_inset Flex CharStyle:Code
7334 \begin_layout Plain Layout
7340 This command deletes an existing style.
7341 This is particularly useful when you want to suppress a style that has
7342 be defined in an input file.
7345 \begin_layout Description
7346 \begin_inset Flex CharStyle:Code
7349 \begin_layout Plain Layout
7358 \begin_layout Description
7359 \begin_inset Flex CharStyle:Code
7362 \begin_layout Plain Layout
7373 \begin_inset Flex CharStyle:Code
7376 \begin_layout Plain Layout
7387 \begin_inset Flex CharStyle:Code
7390 \begin_layout Plain Layout
7397 \begin_inset Flex CharStyle:Code
7400 \begin_layout Plain Layout
7406 ] The class default pagestyle.
7407 Can be changed in the
7408 \begin_inset Flex CharStyle:MenuItem
7411 \begin_layout Plain Layout
7416 ocument\SpecialChar \menuseparator
7429 \begin_layout Description
7430 \begin_inset Flex CharStyle:Code
7433 \begin_layout Plain Layout
7439 Sets the preamble for the LaTeX document.
7440 Note that this will completely override any prior
7441 \begin_inset Flex CharStyle:Code
7444 \begin_layout Plain Layout
7451 \begin_inset Flex CharStyle:Code
7454 \begin_layout Plain Layout
7462 \begin_inset Quotes eld
7466 \begin_inset Flex CharStyle:Code
7469 \begin_layout Plain Layout
7476 \begin_inset Quotes erd
7482 \begin_layout Description
7483 \begin_inset Flex CharStyle:Code
7486 \begin_layout Plain Layout
7493 \begin_inset CommandInset label
7500 \begin_inset Flex CharStyle:Code
7503 \begin_layout Plain Layout
7510 \begin_inset Flex CharStyle:Code
7513 \begin_layout Plain Layout
7522 \begin_inset Flex CharStyle:Code
7525 \begin_layout Plain Layout
7531 ] Whether the class already provides the feature
7532 \begin_inset Flex CharStyle:Code
7535 \begin_layout Plain Layout
7542 A feature is in general the name of a package (
7543 \begin_inset Flex CharStyle:Code
7546 \begin_layout Plain Layout
7553 \begin_inset Flex CharStyle:Code
7556 \begin_layout Plain Layout
7562 , \SpecialChar \ldots{}
7564 \begin_inset Flex CharStyle:Code
7567 \begin_layout Plain Layout
7574 \begin_inset Flex CharStyle:Code
7577 \begin_layout Plain Layout
7583 ,\SpecialChar \ldots{}
7584 ); the complete list of supported features is unfortunately not documented
7585 outside the LyX source code---but see
7586 \begin_inset Flex CharStyle:Code
7589 \begin_layout Plain Layout
7595 if you're interested.
7597 \begin_inset Flex CharStyle:MenuItem
7600 \begin_layout Plain Layout
7605 elp\SpecialChar \menuseparator
7615 also gives an overview of the supported packages.
7618 \begin_layout Description
7619 \begin_inset Flex CharStyle:Code
7622 \begin_layout Plain Layout
7629 \begin_inset Flex CharStyle:Code
7632 \begin_layout Plain Layout
7638 ] Whether the class requires the feature
7639 \begin_inset Flex CharStyle:Code
7642 \begin_layout Plain Layout
7649 Multiple features must be separated by commas.
7650 Note that you can only request supported features.
7653 \begin_layout Description
7654 \begin_inset Flex CharStyle:Code
7657 \begin_layout Plain Layout
7666 \begin_layout Description
7667 \begin_inset Flex CharStyle:Code
7670 \begin_layout Plain Layout
7679 \begin_layout Description
7680 \begin_inset Flex CharStyle:Code
7683 \begin_layout Plain Layout
7692 \begin_inset Flex CharStyle:Code
7695 \begin_layout Plain Layout
7706 \begin_inset Flex CharStyle:Code
7709 \begin_layout Plain Layout
7715 ] Whether the class-default should be printing on one or both sides of the
7717 Can be changed in the
7718 \begin_inset Flex CharStyle:MenuItem
7721 \begin_layout Plain Layout
7726 ocument\SpecialChar \menuseparator
7739 \begin_layout Description
7740 \begin_inset Flex CharStyle:Code
7743 \begin_layout Plain Layout
7749 This sequence defines a new paragraph style.
7750 If the style already exists, it will redefine some of its parameters instead.
7752 \begin_inset space ~
7756 \begin_inset CommandInset ref
7758 reference "sec:style"
7764 \begin_inset Quotes eld
7768 \begin_inset Flex CharStyle:Code
7771 \begin_layout Plain Layout
7778 \begin_inset Quotes erd
7784 \begin_layout Description
7785 \begin_inset Flex CharStyle:Code
7788 \begin_layout Plain Layout
7795 \begin_inset Flex CharStyle:Code
7798 \begin_layout Plain Layout
7804 ] The name of the command or environment to be used with
7805 \begin_inset Flex CharStyle:Code
7808 \begin_layout Plain Layout
7817 \begin_layout Description
7818 \begin_inset Flex CharStyle:Code
7821 \begin_layout Plain Layout
7828 \begin_inset Flex CharStyle:Code
7831 \begin_layout Plain Layout
7840 \begin_inset Flex CharStyle:Code
7843 \begin_layout Plain Layout
7849 ] Indicates what kind of markup is used to define the title of a document.
7851 \begin_inset Flex CharStyle:Code
7854 \begin_layout Plain Layout
7860 means that the macro with name
7861 \begin_inset Flex CharStyle:Code
7864 \begin_layout Plain Layout
7870 will be inserted after the last layout which has
7871 \begin_inset Quotes eld
7875 \begin_inset Flex CharStyle:Code
7878 \begin_layout Plain Layout
7885 \begin_inset Quotes erd
7890 \begin_inset Flex CharStyle:Code
7893 \begin_layout Plain Layout
7899 corresponds to the case where the block of paragraphs which have
7900 \begin_inset Quotes eld
7904 \begin_inset Flex CharStyle:Code
7907 \begin_layout Plain Layout
7914 \begin_inset Quotes erd
7917 should be enclosed into the
7918 \begin_inset Flex CharStyle:Code
7921 \begin_layout Plain Layout
7930 \begin_layout Description
7931 \begin_inset Flex CharStyle:Code
7934 \begin_layout Plain Layout
7943 \begin_layout Description
7944 \begin_inset Flex CharStyle:Code
7947 \begin_layout Plain Layout
7954 \begin_inset Flex CharStyle:Code
7957 \begin_layout Plain Layout
7963 Specifies a module to be included by default with this document class.
7964 The user can still remove the module, but it will be active at the outset.
7965 (This applies only when new files are created, or when this class is chosen
7966 for an existing document.)
7969 \begin_layout Subsection
7970 \begin_inset Flex CharStyle:Code
7973 \begin_layout Plain Layout
7982 \begin_layout Standard
7983 \begin_inset CommandInset label
7985 name "sec:classoptions"
7990 \begin_inset Flex CharStyle:Code
7993 \begin_layout Plain Layout
7999 section can contain the following entries:
8002 \begin_layout Description
8003 \begin_inset Flex CharStyle:Code
8006 \begin_layout Plain Layout
8013 \begin_inset Flex CharStyle:Code
8016 \begin_layout Plain Layout
8022 ] The list of available font sizes for the document's main font, separated
8024 \begin_inset Quotes eld
8028 \begin_inset Flex CharStyle:Code
8031 \begin_layout Plain Layout
8038 \begin_inset Quotes erd
8044 \begin_layout Description
8045 \begin_inset Flex CharStyle:Code
8048 \begin_layout Plain Layout
8057 \begin_layout Description
8058 \begin_inset Flex CharStyle:Code
8061 \begin_layout Plain Layout
8068 \begin_inset Flex CharStyle:Code
8071 \begin_layout Plain Layout
8072 string="empty|plain|headings|fancy"
8077 ] The list of available page styles, separated by
8078 \begin_inset Quotes eld
8082 \begin_inset Flex CharStyle:Code
8085 \begin_layout Plain Layout
8092 \begin_inset Quotes erd
8098 \begin_layout Description
8099 \begin_inset Flex CharStyle:Code
8102 \begin_layout Plain Layout
8109 \begin_inset Flex CharStyle:Code
8112 \begin_layout Plain Layout
8118 ] Some document class options, separated by a comma, that will be added
8119 to the optional part of the
8120 \begin_inset Flex CharStyle:Code
8123 \begin_layout Plain Layout
8134 \begin_layout Standard
8136 \begin_inset Flex CharStyle:Code
8139 \begin_layout Plain Layout
8145 section must end with
8146 \begin_inset Quotes eld
8150 \begin_inset Flex CharStyle:Code
8153 \begin_layout Plain Layout
8160 \begin_inset Quotes erd
8166 \begin_layout Subsection
8170 \begin_layout Standard
8171 \begin_inset CommandInset label
8177 A paragraph style description looks like this:
8181 \begin_layout Plain Layout
8182 Note that this will either define a new layout or modify an existing one.
8190 \begin_layout LyX-Code
8197 \begin_layout LyX-Code
8201 \begin_layout LyX-Code
8205 \begin_layout Standard
8206 where the following commands are allowed:
8209 \begin_layout Description
8210 \begin_inset Flex CharStyle:Code
8213 \begin_layout Plain Layout
8220 \begin_inset Flex CharStyle:Code
8223 \begin_layout Plain Layout
8228 , left, right, center
8233 ] Paragraph alignment.
8236 \begin_layout Description
8237 \begin_inset Flex CharStyle:Code
8240 \begin_layout Plain Layout
8247 \begin_inset Flex CharStyle:Code
8250 \begin_layout Plain Layout
8255 , left, right, center
8260 ] A comma separated list of permitted alignments.
8261 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8263 For example a right-aligned or centered enumeration isn't possible.)
8266 \begin_layout Description
8267 \begin_inset Flex CharStyle:Code
8270 \begin_layout Plain Layout
8277 \begin_inset Flex CharStyle:Code
8280 \begin_layout Plain Layout
8290 \begin_layout Plain Layout
8291 Note that a `float' here is a real number, such as: 1.5.
8296 The vertical space with which the last of a chain of paragraphs with this
8297 layout is separated from the following paragraph.
8298 If the next paragraph has another layout, the separations are not simply
8299 added, but the maximum is taken.
8302 \begin_layout Description
8303 \begin_inset Flex CharStyle:Code
8306 \begin_layout Plain Layout
8313 \begin_inset Flex CharStyle:Code
8316 \begin_layout Plain Layout
8322 The category for this style.
8323 This is used to group related styles in the Layout combobox on the toolbar.
8324 Any string can be used, but you may want to use existing categories with
8329 \begin_layout Description
8330 \begin_inset Flex CharStyle:Code
8333 \begin_layout Plain Layout
8342 \begin_layout Description
8343 \begin_inset Flex CharStyle:Code
8346 \begin_layout Plain Layout
8353 \begin_inset CommandInset label
8355 name "des:CopyStyle"
8360 \begin_inset Flex CharStyle:Code
8363 \begin_layout Plain Layout
8369 Copies all the features of an existing style into the current one.
8373 \begin_layout Description
8374 \begin_inset Flex CharStyle:Code
8377 \begin_layout Plain Layout
8383 The name of a style whose preamble should be output
8388 This allows to ensure some ordering of the preamble snippets when macros
8389 definitions depend on one another.
8393 \begin_layout Plain Layout
8394 Note that, besides that functionality, there is no way to ensure any ordering
8396 The ordering that you see in a given version of LyX may change without
8397 warning in later versions.
8405 \begin_layout Description
8406 \begin_inset Flex CharStyle:Code
8409 \begin_layout Plain Layout
8416 \begin_inset Flex CharStyle:Code
8419 \begin_layout Plain Layout
8424 , Box, Filled_Box, Static
8429 ] The type of label that stands at the end of the paragraph (or sequence
8431 \begin_inset Flex CharStyle:Code
8434 \begin_layout Plain Layout
8441 \begin_inset Flex CharStyle:Code
8444 \begin_layout Plain Layout
8451 \begin_inset Flex CharStyle:Code
8454 \begin_layout Plain Layout
8461 \begin_inset Flex CharStyle:Code
8464 \begin_layout Plain Layout
8472 \begin_inset Flex CharStyle:Code
8475 \begin_layout Plain Layout
8482 \begin_inset Quotes eld
8486 \begin_inset Quotes erd
8490 \begin_inset Flex CharStyle:Code
8493 \begin_layout Plain Layout
8500 \begin_inset Flex CharStyle:Code
8503 \begin_layout Plain Layout
8504 \begin_inset space ~
8513 \begin_inset space ~
8516 black) square suitable for end of proof markers,
8517 \begin_inset Flex CharStyle:Code
8520 \begin_layout Plain Layout
8526 is an explicit text string.
8529 \begin_layout Description
8530 \begin_inset Flex CharStyle:Code
8533 \begin_layout Plain Layout
8540 \begin_inset Flex CharStyle:Code
8543 \begin_layout Plain Layout
8549 ] The string used for a label with a
8550 \begin_inset Flex CharStyle:Code
8553 \begin_layout Plain Layout
8560 \begin_inset Flex CharStyle:Code
8563 \begin_layout Plain Layout
8573 \begin_layout Description
8574 \begin_inset Flex CharStyle:Code
8577 \begin_layout Plain Layout
8584 \begin_inset Flex CharStyle:Code
8587 \begin_layout Plain Layout
8598 \begin_inset Flex CharStyle:Code
8601 \begin_layout Plain Layout
8610 \begin_layout Description
8611 \begin_inset Flex CharStyle:Code
8614 \begin_layout Plain Layout
8621 \begin_inset Flex CharStyle:Code
8624 \begin_layout Plain Layout
8634 ] With this parameter the
8635 \begin_inset Flex CharStyle:MenuItem
8638 \begin_layout Plain Layout
8645 \begin_inset Quotes eld
8648 Vertical space above
8649 \begin_inset Quotes erd
8653 \begin_inset Flex CharStyle:MenuItem
8656 \begin_layout Plain Layout
8661 dit\SpecialChar \menuseparator
8667 \begin_inset space ~
8675 dialog can be set when initializing a paragraph with this style.
8679 \begin_layout Plain Layout
8682 Note from Jean-Marc:
8684 I'm not sure that this setting has much use, and it should probably be
8685 removed in later versions.
8693 \begin_layout Description
8694 \begin_inset Flex CharStyle:Code
8697 \begin_layout Plain Layout
8703 The font used for both the text body
8709 \begin_inset space ~
8713 \begin_inset CommandInset ref
8715 reference "sec:fonts"
8720 Note that defining this font automatically defines the
8721 \begin_inset Flex CharStyle:Code
8724 \begin_layout Plain Layout
8731 So you should define this one first if you also want to define
8732 \begin_inset Flex CharStyle:Code
8735 \begin_layout Plain Layout
8744 \begin_layout Description
8745 \begin_inset Flex CharStyle:Code
8748 \begin_layout Plain Layout
8755 \begin_inset CommandInset label
8757 name "des:FreeSpacing"
8764 \begin_inset Flex CharStyle:Code
8767 \begin_layout Plain Layout
8778 \begin_inset Flex CharStyle:Code
8781 \begin_layout Plain Layout
8787 ] Usually LyX doesn't allow you to insert more than one space between words,
8788 since a space is considered as the separation between two words, not a
8789 character or symbol of its own.
8790 This is a very fine thing but sometimes annoying, for example, when typing
8791 program code or plain LaTeX code.
8793 \begin_inset Flex CharStyle:Code
8796 \begin_layout Plain Layout
8803 Note that LyX will create protected blanks for the additional blanks when
8804 in another mode than LaTeX-mode.
8807 \begin_layout Description
8808 \begin_inset Flex CharStyle:Code
8811 \begin_layout Plain Layout
8820 \begin_layout Description
8821 \begin_inset Flex CharStyle:Code
8824 \begin_layout Plain Layout
8831 \begin_inset Flex CharStyle:Code
8834 \begin_layout Plain Layout
8840 If 1, marks the layout as being part of a title block (see also the
8841 \begin_inset Flex CharStyle:Code
8844 \begin_layout Plain Layout
8851 \begin_inset Flex CharStyle:Code
8854 \begin_layout Plain Layout
8863 \begin_layout Description
8864 \begin_inset Flex CharStyle:Code
8867 \begin_layout Plain Layout
8874 \begin_inset Flex CharStyle:Code
8877 \begin_layout Plain Layout
8883 ] This provides extra space between paragraphs that have the same layout.
8884 If you put other layouts into an environment, each is separated with the
8886 \begin_inset Flex CharStyle:Code
8889 \begin_layout Plain Layout
8896 But the whole items of the environment are additionally separated with
8898 \begin_inset Flex CharStyle:Code
8901 \begin_layout Plain Layout
8913 \begin_layout Description
8914 \begin_inset Flex CharStyle:Code
8917 \begin_layout Plain Layout
8926 \begin_layout Description
8927 \begin_inset Flex CharStyle:Code
8930 \begin_layout Plain Layout
8937 \begin_inset CommandInset label
8939 name "des:KeepEmpty"
8946 \begin_inset Flex CharStyle:Code
8949 \begin_layout Plain Layout
8960 \begin_inset Flex CharStyle:Code
8963 \begin_layout Plain Layout
8969 ] Usually LyX does not allow you to leave a paragraph empty, since it would
8970 lead to empty LaTeX output.
8971 There are some cases where this could be desirable however: in a letter
8972 template, the required fields can be provided as empty fields, so that
8973 people do not forget them; in some special classes, a layout can be used
8974 as some kind of break, which does not contain actual text.
8977 \begin_layout Description
8978 \begin_inset Flex CharStyle:Code
8981 \begin_layout Plain Layout
8987 [float=0] The vertical space between the label and the text body.
8988 Only used for labels that are above the text body (
8989 \begin_inset Flex CharStyle:Code
8992 \begin_layout Plain Layout
8999 \begin_inset Flex CharStyle:Code
9002 \begin_layout Plain Layout
9003 Centered_Top_Environment
9011 \begin_layout Description
9012 \begin_inset Flex CharStyle:Code
9015 \begin_layout Plain Layout
9022 \begin_inset Flex CharStyle:Code
9025 \begin_layout Plain Layout
9032 \begin_inset Newline newline
9035 The name of the counter for automatic numbering (see Section
9036 \begin_inset CommandInset ref
9038 reference "sec:counter"
9043 This must be given if
9044 \begin_inset Flex CharStyle:Code
9047 \begin_layout Plain Layout
9054 \begin_inset Flex CharStyle:Code
9057 \begin_layout Plain Layout
9066 \begin_layout Description
9067 \begin_inset Flex CharStyle:Code
9070 \begin_layout Plain Layout
9076 The font used for the label.
9078 \begin_inset space ~
9082 \begin_inset CommandInset ref
9084 reference "sec:fonts"
9091 \begin_layout Description
9092 \begin_inset Flex CharStyle:Code
9095 \begin_layout Plain Layout
9102 \begin_inset Flex CharStyle:Code
9105 \begin_layout Plain Layout
9111 ] The horizontal space between the label and the text body.
9112 Only used for labels that are not above the text body.
9115 \begin_layout Description
9116 \begin_inset Flex CharStyle:Code
9119 \begin_layout Plain Layout
9126 \begin_inset Flex CharStyle:Code
9129 \begin_layout Plain Layout
9135 ] The string used for a label with a
9136 \begin_inset Flex CharStyle:Code
9139 \begin_layout Plain Layout
9147 \begin_inset Flex CharStyle:Code
9150 \begin_layout Plain Layout
9156 is set, this string can be contain the special formatting commands described
9158 \begin_inset CommandInset ref
9160 reference "sec:counter"
9168 \begin_layout Plain Layout
9169 For the sake of backwards compatibility, the string
9170 \begin_inset Flex CharStyle:Code
9173 \begin_layout Plain Layout
9183 will be replaced by the expanded
9184 \begin_inset Flex CharStyle:Code
9187 \begin_layout Plain Layout
9194 \begin_inset Flex CharStyle:Code
9197 \begin_layout Plain Layout
9206 This feature is now obsolete and should be replaced by the mechanisms of
9208 \begin_inset CommandInset ref
9210 reference "sec:counter"
9222 \begin_layout Description
9223 \begin_inset Flex CharStyle:Code
9226 \begin_layout Plain Layout
9233 \begin_inset Flex CharStyle:Code
9236 \begin_layout Plain Layout
9242 ] This is used inside the appendix instead of
9243 \begin_inset Flex CharStyle:Code
9246 \begin_layout Plain Layout
9254 \begin_inset Flex CharStyle:Code
9257 \begin_layout Plain Layout
9264 \begin_inset Flex CharStyle:Code
9267 \begin_layout Plain Layout
9276 \begin_layout Description
9277 \begin_inset Flex CharStyle:Code
9280 \begin_layout Plain Layout
9287 \begin_inset Flex CharStyle:Code
9290 \begin_layout Plain Layout
9295 , Manual, Static, Top_Environment,
9296 \begin_inset Newline newline
9299 Centered_Top_Environment, Sensitive, Counter
9305 \begin_inset Newline newline
9309 \begin_inset Flex CharStyle:Code
9312 \begin_layout Plain Layout
9318 means the label is the very first word (up to the first real blank).
9322 \begin_layout Plain Layout
9323 Use protected spaces if you want more than one word as the label.
9329 \begin_inset Flex CharStyle:Code
9332 \begin_layout Plain Layout
9338 means it is defined in the layout (see
9339 \begin_inset Flex CharStyle:Code
9342 \begin_layout Plain Layout
9350 \begin_inset Flex CharStyle:Code
9353 \begin_layout Plain Layout
9360 \begin_inset Flex CharStyle:Code
9363 \begin_layout Plain Layout
9364 Centered_Top_Environment
9369 are special cases of
9370 \begin_inset Flex CharStyle:Code
9373 \begin_layout Plain Layout
9380 The label will be printed above the paragraph, but only at the top of an
9381 environment or the top of a chain of paragraphs with this layout.
9382 Usage is for example the
9383 \begin_inset Flex CharStyle:MenuItem
9386 \begin_layout Plain Layout
9393 \begin_inset Flex CharStyle:MenuItem
9396 \begin_layout Plain Layout
9403 This is also the case for
9404 \begin_inset Flex CharStyle:Code
9407 \begin_layout Plain Layout
9413 labels with latex type
9414 \begin_inset Flex CharStyle:Code
9417 \begin_layout Plain Layout
9423 , in order to make layouts for theorems work correctly.
9425 \begin_inset Flex CharStyle:Code
9428 \begin_layout Plain Layout
9434 is a special case for the caption-labels
9435 \begin_inset Quotes eld
9439 \begin_inset Quotes erd
9443 \begin_inset Quotes eld
9447 \begin_inset Quotes erd
9452 \begin_inset Flex CharStyle:Code
9455 \begin_layout Plain Layout
9461 means the (hardcoded) label string depends on the kind of float.
9463 \begin_inset Flex CharStyle:Code
9466 \begin_layout Plain Layout
9472 label type defines automatically numbered labels.
9474 \begin_inset CommandInset ref
9476 reference "sec:counter"
9483 \begin_layout Description
9484 \begin_inset Flex CharStyle:Code
9487 \begin_layout Plain Layout
9496 \begin_layout Description
9497 \begin_inset Flex CharStyle:Code
9500 \begin_layout Plain Layout
9509 \begin_layout Description
9510 \begin_inset Flex CharStyle:Code
9513 \begin_layout Plain Layout
9520 \begin_inset CommandInset label
9522 name "des:LatexName"
9526 The name of the corresponding LaTeX stuff.
9527 Either the environment or command name.
9530 \begin_layout Description
9531 \begin_inset Flex CharStyle:Code
9534 \begin_layout Plain Layout
9543 \begin_layout Description
9544 \begin_inset Flex CharStyle:Code
9547 \begin_layout Plain Layout
9554 \begin_inset CommandInset label
9556 name "des:LatexParam"
9560 An optional parameter for the corresponding
9561 \begin_inset Flex CharStyle:Code
9564 \begin_layout Plain Layout
9571 This parameter cannot be changed from within LyX.
9574 \begin_layout Description
9575 \begin_inset Flex CharStyle:Code
9578 \begin_layout Plain Layout
9585 \begin_inset CommandInset label
9587 name "des:LatexType"
9592 \begin_inset Flex CharStyle:Code
9595 \begin_layout Plain Layout
9600 , Command, Environment, Item_Environment,
9606 \begin_inset Flex CharStyle:Code
9609 \begin_layout Plain Layout
9615 ] How the layout should be translated into LaTeX.
9617 \begin_inset Flex CharStyle:Code
9620 \begin_layout Plain Layout
9626 means nothing special.
9628 \begin_inset Flex CharStyle:Code
9631 \begin_layout Plain Layout
9638 \begin_inset Flex CharStyle:Code
9641 \begin_layout Plain Layout
9648 {\SpecialChar \ldots{}
9655 \begin_inset Flex CharStyle:Code
9658 \begin_layout Plain Layout
9665 \begin_inset Flex CharStyle:Code
9668 \begin_layout Plain Layout
9675 }\SpecialChar \ldots{}
9689 \begin_inset Flex CharStyle:Code
9692 \begin_layout Plain Layout
9699 \begin_inset Flex CharStyle:Code
9702 \begin_layout Plain Layout
9709 \begin_inset Flex CharStyle:Code
9712 \begin_layout Plain Layout
9720 is generated for each paragraph of this environment.
9722 \begin_inset Flex CharStyle:Code
9725 \begin_layout Plain Layout
9732 \begin_inset Flex CharStyle:Code
9735 \begin_layout Plain Layout
9742 \begin_inset Flex CharStyle:Code
9745 \begin_layout Plain Layout
9751 is passed as an argument to the environment.
9753 \begin_inset Flex CharStyle:Code
9756 \begin_layout Plain Layout
9762 can be defined in the
9763 \begin_inset Flex CharStyle:MenuItem
9766 \begin_layout Plain Layout
9771 ayout\SpecialChar \menuseparator
9783 \begin_inset Flex CharStyle:Code
9786 \begin_layout Plain Layout
9794 is perhaps a bit misleading, since these rules apply to SGML classes, too.
9795 Visit the SGML class files for specific examples.
9798 \begin_layout Standard
9799 Putting the last few things together, the LaTeX output will be either:
9802 \begin_layout LyX-Code
9805 latexname[latexparam]{\SpecialChar \ldots{}
9809 \begin_layout Standard
9813 \begin_layout LyX-Code
9816 begin{latexname}[latexparam] \SpecialChar \ldots{}
9822 \begin_layout Standard
9823 depending upon the LaTex type.
9826 \begin_layout Description
9827 \begin_inset Flex CharStyle:Code
9830 \begin_layout Plain Layout
9837 \begin_inset Flex CharStyle:Code
9840 \begin_layout Plain Layout
9846 ] If you put layouts into environments, the leftmargins are not simply added,
9847 but added with a factor
9848 \begin_inset Formula $\frac{4}{depth+4}$
9852 Note that this parameter is also used when the margin is defined as
9853 \begin_inset Flex CharStyle:Code
9856 \begin_layout Plain Layout
9863 \begin_inset Flex CharStyle:Code
9866 \begin_layout Plain Layout
9873 Then it is added to the manual or dynamic margin.
9875 \begin_inset Newline newline
9878 The argument is passed as a string.
9880 \begin_inset Quotes eld
9884 \begin_inset Flex CharStyle:Code
9887 \begin_layout Plain Layout
9894 \begin_inset Quotes erd
9897 means that the paragraph is indented with the width of
9898 \begin_inset Quotes eld
9902 \begin_inset Flex CharStyle:Code
9905 \begin_layout Plain Layout
9912 \begin_inset Quotes erd
9916 You can get a negative width by prefixing the string with
9917 \begin_inset Quotes eld
9921 \begin_inset Flex CharStyle:Code
9924 \begin_layout Plain Layout
9931 \begin_inset Quotes erd
9935 This way was chosen so that the look is the same with each used screen
9940 \begin_layout Description
9941 \begin_inset Flex CharStyle:Code
9944 \begin_layout Plain Layout
9951 \begin_inset Flex CharStyle:Code
9954 \begin_layout Plain Layout
9959 , Manual, Dynamic, First_Dynamic, Right_Address_Box
9965 \begin_inset Newline newline
9968 The kind of margin that the layout has on the left side.
9970 \begin_inset Flex CharStyle:Code
9973 \begin_layout Plain Layout
9979 just means a fixed margin.
9981 \begin_inset Flex CharStyle:Code
9984 \begin_layout Plain Layout
9990 means that the left margin depends on the string entered in the
9991 \begin_inset Flex CharStyle:MenuItem
9994 \begin_layout Plain Layout
9999 dit\SpecialChar \menuseparator
10005 \begin_inset space ~
10014 This is used to typeset nice lists without tabulators.
10016 \begin_inset Flex CharStyle:Code
10019 \begin_layout Plain Layout
10025 means that the margin depends on the size of the label.
10026 This is used for automatic enumerated headlines.
10027 It is obvious that the headline
10028 \begin_inset Quotes eld
10031 5.4.3.2.1 Very long headline
10032 \begin_inset Quotes erd
10035 must have a wider left margin (as wide as
10036 \begin_inset Quotes eld
10040 \begin_inset Quotes erd
10043 plus the space) than
10044 \begin_inset Quotes eld
10047 3.2 Very long headline
10048 \begin_inset Quotes erd
10052 \begin_inset Quotes eld
10056 \begin_inset Quotes erd
10059 are not able to do this.
10061 \begin_inset Flex CharStyle:Code
10064 \begin_layout Plain Layout
10070 is similar, but only the very first row of the paragraph is dynamic, while
10071 the others are static; this is used, for example, for descriptions.
10073 \begin_inset Flex CharStyle:Code
10076 \begin_layout Plain Layout
10082 means the margin is chosen in a way that the longest row of this paragraph
10083 fits to the right margin.
10084 This is used to typeset an address on the right edge of the page.
10087 \begin_layout Description
10088 \begin_inset Flex CharStyle:Code
10091 \begin_layout Plain Layout
10098 \begin_inset CommandInset label
10100 name "des:NeedProtect"
10105 \begin_inset Flex CharStyle:Code
10108 \begin_layout Plain Layout
10117 \begin_inset Flex CharStyle:Code
10120 \begin_layout Plain Layout
10126 ] Whether fragile commands in this layout should be
10127 \begin_inset Flex CharStyle:Code
10130 \begin_layout Plain Layout
10143 whether this command should itself be protected.)
10146 \begin_layout Description
10147 \begin_inset Flex CharStyle:Code
10150 \begin_layout Plain Layout
10157 \begin_inset Flex CharStyle:Code
10160 \begin_layout Plain Layout
10167 \begin_inset Flex CharStyle:Code
10170 \begin_layout Plain Layout
10178 ] Whether newlines are translated into LaTeX newlines (
10179 \begin_inset Flex CharStyle:Code
10182 \begin_layout Plain Layout
10193 The translation can be switched off to allow more comfortable LaTeX editing
10197 \begin_layout Description
10198 \begin_inset Flex CharStyle:Code
10201 \begin_layout Plain Layout
10208 \begin_inset Flex CharStyle:Code
10211 \begin_layout Plain Layout
10218 \begin_inset Flex CharStyle:Code
10221 \begin_layout Plain Layout
10229 ] Whether the following Paragraph is allowed to indent its very first row.
10231 \begin_inset Flex CharStyle:Code
10234 \begin_layout Plain Layout
10240 means that it is not allowed to do so;
10241 \begin_inset Flex CharStyle:Code
10244 \begin_layout Plain Layout
10250 means it could do so if it wants to.
10253 \begin_layout Description
10254 \begin_inset Flex CharStyle:Code
10257 \begin_layout Plain Layout
10266 \begin_layout Description
10267 \begin_inset Flex CharStyle:Code
10270 \begin_layout Plain Layout
10277 \begin_inset Flex CharStyle:Code
10280 \begin_layout Plain Layout
10286 ] The number of optional arguments that can be used with this layout.
10287 This is useful for things like section headings, and only makes sense with
10291 \begin_layout Description
10292 \begin_inset Flex CharStyle:Code
10295 \begin_layout Plain Layout
10302 \begin_inset Flex CharStyle:Code
10305 \begin_layout Plain Layout
10311 ] The indent of the very first line of a paragraph.
10313 \begin_inset Flex CharStyle:Code
10316 \begin_layout Plain Layout
10322 will be fixed for a certain layout.
10323 The exception is Standard layout, since the indentation of a Standard layout
10324 paragraph can be prohibited with
10325 \begin_inset Flex CharStyle:Code
10328 \begin_layout Plain Layout
10335 Also, Standard layout paragraphs inside environments use the
10336 \begin_inset Flex CharStyle:Code
10339 \begin_layout Plain Layout
10345 of the environment, not their native one.
10346 For example, Standard paragraphs inside an enumeration are not indented.
10349 \begin_layout Description
10350 \begin_inset Flex CharStyle:Code
10353 \begin_layout Plain Layout
10360 \begin_inset Flex CharStyle:Code
10363 \begin_layout Plain Layout
10369 ] The vertical space between two paragraphs of this layout.
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 ] LyX allows the user to choose either
10393 \begin_inset Quotes eld
10397 \begin_inset Quotes erd
10401 \begin_inset Quotes eld
10405 \begin_inset Quotes erd
10408 to typeset a document.
10410 \begin_inset Quotes eld
10414 \begin_inset Quotes erd
10417 is chosen, this value is completely ignored.
10419 \begin_inset Quotes eld
10423 \begin_inset Quotes erd
10426 is chosen, the parindent of a LaTeXtype
10427 \begin_inset Quotes eld
10431 \begin_inset Quotes erd
10434 layout is ignored and all paragraphs are separated by this parskip argument.
10435 The vertical space is calculated with
10436 \begin_inset Flex CharStyle:Code
10439 \begin_layout Plain Layout
10441 \begin_inset space ~
10450 \begin_inset Flex CharStyle:Code
10453 \begin_layout Plain Layout
10459 is the height of a row with the normal font.
10460 This way, the look stays the same with different screen fonts.
10463 \begin_layout Description
10464 \begin_inset Flex CharStyle:Code
10467 \begin_layout Plain Layout
10474 \begin_inset CommandInset label
10476 name "des:PassThru"
10483 \begin_inset Flex CharStyle:Code
10486 \begin_layout Plain Layout
10497 \begin_inset Flex CharStyle:Code
10500 \begin_layout Plain Layout
10506 ] Whether the contents of this paragraph should be output in raw form, meaning
10507 without special translations that LaTeX would require.
10510 \begin_layout Description
10511 \begin_inset Flex CharStyle:Code
10514 \begin_layout Plain Layout
10521 \begin_inset CommandInset label
10523 name "des:Preamble"
10527 Information to be included in the LaTeX preamable when this style is used.
10528 Used to define macros, load packages, etc., required by this particular
10531 \begin_inset Quotes eld
10535 \begin_inset Flex CharStyle:Code
10538 \begin_layout Plain Layout
10545 \begin_inset Quotes erd
10551 \begin_layout Description
10552 \begin_inset Flex CharStyle:Code
10555 \begin_layout Plain Layout
10562 \begin_inset Flex CharStyle:Code
10565 \begin_layout Plain Layout
10572 \begin_inset CommandInset label
10574 name "des:Requires"
10578 Whether the layout requires the feature
10579 \begin_inset Flex CharStyle:Code
10582 \begin_layout Plain Layout
10589 See the description of
10590 \begin_inset Flex CharStyle:Code
10593 \begin_layout Plain Layout
10600 \begin_inset CommandInset ref
10601 LatexCommand pageref
10602 reference "des:FreeSpacing"
10606 ) for information on `features'.
10610 \begin_layout Description
10611 \begin_inset Flex CharStyle:Code
10614 \begin_layout Plain Layout
10621 \begin_inset Flex CharStyle:Code
10624 \begin_layout Plain Layout
10631 \begin_inset Flex CharStyle:Code
10634 \begin_layout Plain Layout
10643 \begin_layout Description
10644 \begin_inset Flex CharStyle:Code
10647 \begin_layout Plain Layout
10654 \begin_inset Flex CharStyle:Code
10657 \begin_layout Plain Layout
10662 , onehalf, double, other
10671 ] This defines what the default spacing should be in the layout.
10673 \begin_inset Flex CharStyle:Code
10676 \begin_layout Plain Layout
10683 \begin_inset Flex CharStyle:Code
10686 \begin_layout Plain Layout
10693 \begin_inset Flex CharStyle:Code
10696 \begin_layout Plain Layout
10702 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
10703 If you specify the argument
10704 \begin_inset Flex CharStyle:Code
10707 \begin_layout Plain Layout
10713 , then you should also provide a numerical argument which will be the actual
10715 Note that, contrary to other parameters,
10716 \begin_inset Flex CharStyle:Code
10719 \begin_layout Plain Layout
10725 implies the generation of specific LaTeX code, using the package
10728 \begin_inset Flex CharStyle:Code
10731 \begin_layout Plain Layout
10740 \begin_layout Description
10741 \begin_inset Flex CharStyle:Code
10744 \begin_layout Plain Layout
10750 The font used for the text body .
10752 \begin_inset CommandInset ref
10754 reference "sec:fonts"
10761 \begin_layout Description
10763 \begin_inset Flex CharStyle:Code
10766 \begin_layout Plain Layout
10774 The level of the style in the table of contents.
10775 This is used for automatic numbering of section headings.
10778 \begin_layout Description
10779 \begin_inset Flex CharStyle:Code
10782 \begin_layout Plain Layout
10789 \begin_inset Flex CharStyle:Code
10792 \begin_layout Plain Layout
10798 ] The vertical space with which the very first of a chain of paragraphs
10799 with this layout is separated from the previous paragraph.
10800 If the previous paragraph has another layout, the separations are not simply
10801 added, but the maximum is taken.
10804 \begin_layout Subsection
10808 \begin_layout Standard
10809 \begin_inset CommandInset label
10815 Since version 1.3.0 of LyX, it is has been both possible and necessary to
10816 define the floats (
10817 \begin_inset Flex CharStyle:MenuItem
10820 \begin_layout Plain Layout
10827 \begin_inset Flex CharStyle:MenuItem
10830 \begin_layout Plain Layout
10836 , \SpecialChar \ldots{}
10837 ) in the text class itself.
10838 Standard floats are included in the file
10839 \begin_inset Flex CharStyle:Code
10842 \begin_layout Plain Layout
10848 , so you may have to do no more than add
10851 \begin_layout LyX-Code
10852 Input stdfloats.inc
10855 \begin_layout Standard
10856 to your layout file.
10857 If you want to implement a text class that proposes some other float types
10858 (like the AGU class bundled with LyX), the information below will hopefully
10862 \begin_layout Description
10863 \begin_inset Flex CharStyle:Code
10866 \begin_layout Plain Layout
10873 \begin_inset Flex CharStyle:Code
10876 \begin_layout Plain Layout
10883 \begin_inset Quotes erd
10887 \begin_inset Quotes erd
10890 ] The file name extension of an auxiliary file for the list of figures (or
10892 LaTeX writes the captions to this file.
10895 \begin_layout Description
10896 \begin_inset Flex CharStyle:Code
10899 \begin_layout Plain Layout
10906 \begin_inset Flex CharStyle:Code
10909 \begin_layout Plain Layout
10916 \begin_inset Quotes erd
10920 \begin_inset Quotes erd
10923 ] The string that will be used in the menus and also for the caption.
10926 \begin_layout Description
10927 \begin_inset Flex CharStyle:Code
10930 \begin_layout Plain Layout
10937 \begin_inset Flex CharStyle:Code
10940 \begin_layout Plain Layout
10949 \begin_inset Flex CharStyle:Code
10952 \begin_layout Plain Layout
10959 \begin_inset Flex CharStyle:Code
10962 \begin_layout Plain Layout
10968 if the float is already defined by the LaTeX document class.
10970 \begin_inset Flex CharStyle:Code
10973 \begin_layout Plain Layout
10979 , the float will be defined using the LaTeX package
10980 \begin_inset Flex CharStyle:Code
10983 \begin_layout Plain Layout
10992 \begin_layout Description
10993 \begin_inset Flex CharStyle:Code
10996 \begin_layout Plain Layout
11003 \begin_inset Flex CharStyle:Code
11006 \begin_layout Plain Layout
11013 \begin_inset Quotes erd
11017 \begin_inset Quotes erd
11020 ] The heading used for the list of floats.
11023 \begin_layout Description
11024 \begin_inset Flex CharStyle:Code
11027 \begin_layout Plain Layout
11034 \begin_inset Flex CharStyle:Code
11037 \begin_layout Plain Layout
11044 \begin_inset Quotes erd
11048 \begin_inset Quotes erd
11051 ] This (optional) argument determines whether floats of this class will
11052 be numbered within some sectional unit of the document.
11053 For example, if within is equal to
11054 \begin_inset Flex CharStyle:Code
11057 \begin_layout Plain Layout
11063 , the floats will be numbered within chapters.
11067 \begin_layout Description
11068 \begin_inset Flex CharStyle:Code
11071 \begin_layout Plain Layout
11078 \begin_inset Flex CharStyle:Code
11081 \begin_layout Plain Layout
11088 \begin_inset Quotes erd
11092 \begin_inset Quotes erd
11095 ] The default placement for the given class of floats.
11096 The string should be as in standard LaTeX:
11097 \begin_inset Flex CharStyle:Code
11100 \begin_layout Plain Layout
11107 \begin_inset Flex CharStyle:Code
11110 \begin_layout Plain Layout
11117 \begin_inset Flex CharStyle:Code
11120 \begin_layout Plain Layout
11127 \begin_inset Flex CharStyle:Code
11130 \begin_layout Plain Layout
11136 for top, bottom, page, and here, respectively.
11140 \begin_layout Plain Layout
11141 Note that the order of these letters in the string is irrelevant, like in
11147 On top of that there is a new type,
11148 \begin_inset Flex CharStyle:Code
11151 \begin_layout Plain Layout
11157 , which does not really correspond to a float, since it means: put it
11158 \begin_inset Quotes eld
11162 \begin_inset Quotes erd
11166 Note however that the
11167 \begin_inset Flex CharStyle:Code
11170 \begin_layout Plain Layout
11176 specifier is special and, because of implementation details, cannot be
11177 used in non-builtin float types.
11178 If you do not understand what this means, just use
11179 \begin_inset Quotes eld
11183 \begin_inset Flex CharStyle:Code
11186 \begin_layout Plain Layout
11193 \begin_inset Quotes erd
11199 \begin_layout Description
11200 \begin_inset Flex CharStyle:Code
11203 \begin_layout Plain Layout
11210 \begin_inset Flex CharStyle:Code
11213 \begin_layout Plain Layout
11220 \begin_inset Quotes erd
11224 \begin_inset Quotes erd
11227 ] The style used when defining the float using
11228 \begin_inset Flex CharStyle:Code
11231 \begin_layout Plain Layout
11242 \begin_layout Description
11243 \begin_inset Flex CharStyle:Code
11246 \begin_layout Plain Layout
11253 \begin_inset Flex CharStyle:Code
11256 \begin_layout Plain Layout
11263 \begin_inset Quotes erd
11267 \begin_inset Quotes erd
11271 \begin_inset Quotes eld
11275 \begin_inset Quotes erd
11278 of the new class of floats, like program or algorithm.
11279 After the appropriate
11280 \begin_inset Flex CharStyle:Code
11283 \begin_layout Plain Layout
11292 \begin_inset Flex CharStyle:Code
11295 \begin_layout Plain Layout
11304 \begin_inset Flex CharStyle:Code
11307 \begin_layout Plain Layout
11318 \begin_layout Standard
11319 Note that defining a float with type
11320 \begin_inset Flex CharStyle:Code
11323 \begin_layout Plain Layout
11331 automatically defines the corresponding counter with name
11332 \begin_inset Flex CharStyle:Code
11335 \begin_layout Plain Layout
11346 \begin_layout Subsection
11347 Inset layouts and Flex insets
11350 \begin_layout Standard
11351 \begin_inset CommandInset label
11353 name "sec:charstyle"
11357 LyX has supported character styles since version 1.4.0; since version 1.6.0
11358 these are called Flex insets.
11362 \begin_layout Standard
11363 Furthermore, it is possible to define the general layout of many different
11365 Currently, InsetLayout can be used to customize the layout parameters
11366 for footnotes, marginal notes, note insets, ERT insets, branches, listings,
11367 indexes, boxes, tables, algorithms, URLs, and optional arguments, as well
11372 \begin_layout Standard
11373 Flex insets come in three different kinds:
11376 \begin_layout Itemize
11378 \begin_inset Flex CharStyle:Code
11381 \begin_layout Plain Layout
11387 ): These define semantic markup corresponding to such LaTeX commands as
11389 \begin_inset Flex CharStyle:Code
11392 \begin_layout Plain Layout
11401 \begin_inset Flex CharStyle:Code
11404 \begin_layout Plain Layout
11415 \begin_layout Itemize
11417 \begin_inset Flex CharStyle:Code
11420 \begin_layout Plain Layout
11426 ): These can be used to define custom collapsable insets, similar to ERT,
11427 footnote, and the like.
11430 \begin_layout Itemize
11432 \begin_inset Flex CharStyle:Code
11435 \begin_layout Plain Layout
11441 ): For use with DocBook classes.
11444 \begin_layout Standard
11446 \begin_inset Flex CharStyle:Code
11449 \begin_layout Plain Layout
11455 definition starting line is of the form
11458 \begin_layout LyX-Code
11459 InsetLayout <Type> <Name>
11462 \begin_layout Standard
11464 \begin_inset Flex CharStyle:Code
11467 \begin_layout Plain Layout
11474 \begin_inset Flex CharStyle:Code
11477 \begin_layout Plain Layout
11484 \begin_inset Flex CharStyle:Code
11487 \begin_layout Plain Layout
11494 \begin_inset Flex CharStyle:Code
11497 \begin_layout Plain Layout
11504 \begin_inset Flex CharStyle:Code
11507 \begin_layout Plain Layout
11514 \begin_inset Flex CharStyle:Code
11517 \begin_layout Plain Layout
11524 \begin_inset Flex CharStyle:Code
11527 \begin_layout Plain Layout
11534 \begin_inset Flex CharStyle:Code
11537 \begin_layout Plain Layout
11544 \begin_inset Flex CharStyle:Code
11547 \begin_layout Plain Layout
11554 \begin_inset Flex CharStyle:Code
11557 \begin_layout Plain Layout
11564 \begin_inset Flex CharStyle:Code
11567 \begin_layout Plain Layout
11574 \begin_inset Flex CharStyle:Code
11577 \begin_layout Plain Layout
11584 \begin_inset Flex CharStyle:Code
11587 \begin_layout Plain Layout
11594 \begin_inset Flex CharStyle:Code
11597 \begin_layout Plain Layout
11604 \begin_inset Flex CharStyle:Code
11607 \begin_layout Plain Layout
11614 \begin_inset Flex CharStyle:Code
11617 \begin_layout Plain Layout
11624 \begin_inset Flex CharStyle:Code
11627 \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
11664 should have the form
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
11724 is any valid identifier.
11728 \begin_layout Standard
11730 \begin_inset Flex CharStyle:Code
11733 \begin_layout Plain Layout
11739 section can contain the following entries:
11742 \begin_layout Description
11743 \begin_inset Flex CharStyle:Code
11746 \begin_layout Plain Layout
11752 The color for the inset's background.
11753 These valid colors are defined in
11754 \begin_inset Flex CharStyle:Code
11757 \begin_layout Plain Layout
11766 \begin_layout Description
11767 \begin_inset Flex CharStyle:Code
11770 \begin_layout Plain Layout
11776 As with paragraph styles (see page
11777 \begin_inset CommandInset ref
11779 reference "des:CopyStyle"
11786 \begin_layout Description
11787 \begin_inset Flex CharStyle:Code
11790 \begin_layout Plain Layout
11797 \begin_inset Flex CharStyle:Code
11800 \begin_layout Plain Layout
11807 \begin_inset Flex CharStyle:Code
11810 \begin_layout Plain Layout
11817 \begin_inset Flex CharStyle:Code
11820 \begin_layout Plain Layout
11826 , describing the rendering style used for the inset's frame and buttons.
11827 Footnotes generally use
11828 \begin_inset Flex CharStyle:Code
11831 \begin_layout Plain Layout
11837 ; ERT insets generally use
11838 \begin_inset Flex CharStyle:Code
11841 \begin_layout Plain Layout
11847 ; and character styles use
11848 \begin_inset Flex CharStyle:Code
11851 \begin_layout Plain Layout
11860 \begin_layout Description
11861 \begin_inset Flex CharStyle:Code
11864 \begin_layout Plain Layout
11870 The font used for both the text body
11876 \begin_inset space ~
11880 \begin_inset CommandInset ref
11882 reference "sec:fonts"
11887 Note that defining this font automatically defines the
11888 \begin_inset Flex CharStyle:Code
11891 \begin_layout Plain Layout
11897 to the same value, so define this first and define
11898 \begin_inset Flex CharStyle:Code
11901 \begin_layout Plain Layout
11907 later if you want them to be different.
11910 \begin_layout Description
11911 \begin_inset Flex CharStyle:Code
11914 \begin_layout Plain Layout
11923 \begin_layout Description
11924 \begin_inset Flex CharStyle:Code
11927 \begin_layout Plain Layout
11933 As with paragraph styles (see page
11934 \begin_inset CommandInset ref
11935 LatexCommand pageref
11936 reference "des:FreeSpacing"
11943 \begin_layout Description
11944 \begin_inset Flex CharStyle:Code
11947 \begin_layout Plain Layout
11953 As with paragraph styles (see page
11954 \begin_inset CommandInset ref
11955 LatexCommand pageref
11956 reference "des:KeepEmpty"
11963 \begin_layout Description
11964 \begin_inset Flex CharStyle:Code
11967 \begin_layout Plain Layout
11973 What will be displayed on the button or elsewhere as the inset label.
11974 Some inset types (ERT and Branch) modify this label on the fly.
11977 \begin_layout Description
11978 \begin_inset Flex CharStyle:Code
11981 \begin_layout Plain Layout
11987 The font used for the label.
11989 \begin_inset space ~
11993 \begin_inset CommandInset ref
11995 reference "sec:fonts"
12000 Note that this definition can never appear before
12001 \begin_inset Flex CharStyle:Code
12004 \begin_layout Plain Layout
12010 , lest it be ineffective.
12013 \begin_layout Description
12014 \begin_inset Flex CharStyle:Code
12017 \begin_layout Plain Layout
12023 The name of the corresponding LaTeX stuff.
12024 Either the environment or command name.
12027 \begin_layout Description
12028 \begin_inset Flex CharStyle:Code
12031 \begin_layout Plain Layout
12037 The optional parameter for the corresponding
12038 \begin_inset Flex CharStyle:Code
12041 \begin_layout Plain Layout
12047 stuff, including possible bracket pairs like
12048 \begin_inset Flex CharStyle:Code
12051 \begin_layout Plain Layout
12058 This parameter cannot be changed from within LyX.
12061 \begin_layout Description
12062 \begin_inset Flex CharStyle:Code
12065 \begin_layout Plain Layout
12071 As with paragraph styles (see page
12072 \begin_inset CommandInset ref
12073 LatexCommand pageref
12074 reference "des:LatexType"
12081 \begin_layout Description
12082 \begin_inset Flex CharStyle:Code
12085 \begin_layout Plain Layout
12092 \begin_inset Flex CharStyle:Code
12095 \begin_layout Plain Layout
12102 \begin_inset Flex CharStyle:Code
12105 \begin_layout Plain Layout
12112 \begin_inset Flex CharStyle:Code
12115 \begin_layout Plain Layout
12122 \begin_inset Flex CharStyle:Code
12125 \begin_layout Plain Layout
12131 (indicating a dummy definition ending definitions of charstyles etc.).
12132 This entry is only meaningful for Flex (user definable) insets.
12135 \begin_layout Description
12136 \begin_inset Flex CharStyle:Code
12139 \begin_layout Plain Layout
12146 \begin_inset Flex CharStyle:Code
12149 \begin_layout Plain Layout
12158 \begin_inset Flex CharStyle:Code
12161 \begin_layout Plain Layout
12167 ] Whether fragile commands in this layout should be
12168 \begin_inset Flex CharStyle:Code
12171 \begin_layout Plain Layout
12184 whether this command should itself be protected.)
12187 \begin_layout Description
12188 \begin_inset Flex CharStyle:Code
12191 \begin_layout Plain Layout
12197 As with paragraph styles (see page
12198 \begin_inset CommandInset ref
12199 LatexCommand pageref
12200 reference "des:Preamble"
12207 \begin_layout Description
12208 \begin_inset Flex CharStyle:Code
12211 \begin_layout Plain Layout
12218 \begin_inset Flex CharStyle:Code
12221 \begin_layout Plain Layout
12227 ] As with paragraph styles (see page
12228 \begin_inset CommandInset ref
12229 LatexCommand pageref
12230 reference "des:Requires"
12237 \begin_layout Subsection
12241 \begin_layout Standard
12242 \begin_inset CommandInset label
12248 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12250 \begin_inset Flex CharStyle:MenuItem
12253 \begin_layout Plain Layout
12260 \begin_inset Flex CharStyle:MenuItem
12263 \begin_layout Plain Layout
12269 , \SpecialChar \ldots{}
12270 ) in the text class itself.
12271 The standard counters are defined in the file
12272 \begin_inset Flex CharStyle:Code
12275 \begin_layout Plain Layout
12281 , so you may have to do no more than add
12284 \begin_layout LyX-Code
12285 Input stdcounters.inc
12288 \begin_layout Standard
12289 to your layout file to get them to work.
12290 But if you want to define custom counters, then you can do so, using the
12291 following parameters:
12294 \begin_layout Description
12295 \begin_inset Flex CharStyle:Code
12298 \begin_layout Plain Layout
12299 LabelString [string=""]
12304 when this is defined, this string defines how the counter is displayed.
12305 Setting this value sets
12306 \begin_inset Flex CharStyle:Code
12309 \begin_layout Plain Layout
12310 LabelStringAppendix
12316 The following special constructs can be used in the string:
12320 \begin_layout Itemize
12321 \begin_inset Flex CharStyle:Code
12324 \begin_layout Plain Layout
12332 will be replaced by the expansion of the
12333 \begin_inset Flex CharStyle:Code
12336 \begin_layout Plain Layout
12343 \begin_inset Flex CharStyle:Code
12346 \begin_layout Plain Layout
12347 LabelStringAppendix
12353 \begin_inset Flex CharStyle:Code
12356 \begin_layout Plain Layout
12366 \begin_layout Itemize
12367 counter values can be expressed using LaTeX-like macros
12368 \begin_inset Flex CharStyle:Code
12371 \begin_layout Plain Layout
12388 \begin_inset Flex CharStyle:Code
12391 \begin_layout Plain Layout
12403 \begin_layout Plain Layout
12413 Actually, the situation is a bit more complicated: any
12432 other than those descibed below will produce arabic numerals.
12433 It would not be surprising to see this change in the future.
12439 \begin_inset Flex CharStyle:Code
12442 \begin_layout Plain Layout
12448 : 1, 2, 3,\SpecialChar \ldots{}
12450 \begin_inset Flex CharStyle:Code
12453 \begin_layout Plain Layout
12459 for lower-case letters: a, b, c, \SpecialChar \ldots{}
12461 \begin_inset Flex CharStyle:Code
12464 \begin_layout Plain Layout
12470 for upper-case letters: A, B, C, \SpecialChar \ldots{}
12472 \begin_inset Flex CharStyle:Code
12475 \begin_layout Plain Layout
12481 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
12483 \begin_inset Flex CharStyle:Code
12486 \begin_layout Plain Layout
12492 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
12494 \begin_inset Flex CharStyle:Code
12497 \begin_layout Plain Layout
12503 for hebrew numerals.
12507 \begin_layout Standard
12508 If LabelString is not defined, a default value is constructed as follows:
12509 if the counter has a master counter
12510 \begin_inset Flex CharStyle:Code
12513 \begin_layout Plain Layout
12520 \begin_inset Flex CharStyle:Code
12523 \begin_layout Plain Layout
12530 \begin_inset Flex CharStyle:Code
12533 \begin_layout Plain Layout
12543 is used; otherwise the string
12544 \begin_inset Flex CharStyle:Code
12547 \begin_layout Plain Layout
12558 \begin_layout Description
12559 \begin_inset Flex CharStyle:Code
12562 \begin_layout Plain Layout
12563 LabelStringAppendix [string=""]
12569 \begin_inset Flex CharStyle:Code
12572 \begin_layout Plain Layout
12581 \begin_layout Description
12582 \begin_inset Flex CharStyle:Code
12585 \begin_layout Plain Layout
12592 \begin_inset Flex CharStyle:Code
12595 \begin_layout Plain Layout
12602 \begin_inset Quotes erd
12606 \begin_inset Quotes erd
12609 ] The name of the counter.
12612 \begin_layout Description
12613 \begin_inset Flex CharStyle:Code
12616 \begin_layout Plain Layout
12623 \begin_inset Flex CharStyle:Code
12626 \begin_layout Plain Layout
12633 \begin_inset Quotes erd
12637 \begin_inset Quotes erd
12640 ] If this is set to the name of another counter, the present counter will
12641 be reset everytime the other one is increased.
12643 \begin_inset Flex CharStyle:Code
12646 \begin_layout Plain Layout
12653 \begin_inset Flex CharStyle:Code
12656 \begin_layout Plain Layout
12665 \begin_layout Subsection
12669 \begin_layout Standard
12670 \begin_inset CommandInset label
12676 A font description looks like this:
12679 \begin_layout LyX-Code
12689 \begin_layout LyX-Code
12693 \begin_layout LyX-Code
12697 \begin_layout Standard
12698 The following commands are available:
12701 \begin_layout Description
12702 \begin_inset Flex CharStyle:Code
12705 \begin_layout Plain Layout
12712 \begin_inset Flex CharStyle:Code
12715 \begin_layout Plain Layout
12724 \begin_inset Flex CharStyle:Code
12727 \begin_layout Plain Layout
12734 \begin_inset Flex CharStyle:Code
12737 \begin_layout Plain Layout
12744 \begin_inset Flex CharStyle:Code
12747 \begin_layout Plain Layout
12754 \begin_inset Flex CharStyle:Code
12757 \begin_layout Plain Layout
12764 \begin_inset Flex CharStyle:Code
12767 \begin_layout Plain Layout
12774 \begin_inset Flex CharStyle:Code
12777 \begin_layout Plain Layout
12784 \begin_inset Flex CharStyle:Code
12787 \begin_layout Plain Layout
12794 \begin_inset Flex CharStyle:Code
12797 \begin_layout Plain Layout
12806 \begin_layout Description
12807 \begin_inset Flex CharStyle:Code
12810 \begin_layout Plain Layout
12819 \begin_inset Flex CharStyle:Code
12822 \begin_layout Plain Layout
12833 \begin_inset Flex CharStyle:Code
12836 \begin_layout Plain Layout
12843 \begin_inset Flex CharStyle:Code
12846 \begin_layout Plain Layout
12855 \begin_layout Description
12856 \begin_inset Flex CharStyle:Code
12859 \begin_layout Plain Layout
12866 \begin_inset Flex CharStyle:Code
12869 \begin_layout Plain Layout
12875 ] Valid argument sare:
12876 \begin_inset Flex CharStyle:Code
12879 \begin_layout Plain Layout
12886 \begin_inset Flex CharStyle:Code
12889 \begin_layout Plain Layout
12896 \begin_inset Flex CharStyle:Code
12899 \begin_layout Plain Layout
12906 \begin_inset Flex CharStyle:Code
12909 \begin_layout Plain Layout
12916 \begin_inset Flex CharStyle:Code
12919 \begin_layout Plain Layout
12926 \begin_inset Flex CharStyle:Code
12929 \begin_layout Plain Layout
12936 Each of these turns on or off the corresponding attribute.
12939 \begin_layout Description
12940 \begin_inset Flex CharStyle:Code
12943 \begin_layout Plain Layout
12952 \begin_inset Flex CharStyle:Code
12955 \begin_layout Plain Layout
12966 \begin_inset Flex CharStyle:Code
12969 \begin_layout Plain Layout
12978 \begin_layout Description
12979 \begin_inset Flex CharStyle:Code
12982 \begin_layout Plain Layout
12991 \begin_inset Flex CharStyle:Code
12994 \begin_layout Plain Layout
13005 \begin_inset Flex CharStyle:Code
13008 \begin_layout Plain Layout
13015 \begin_inset Flex CharStyle:Code
13018 \begin_layout Plain Layout
13025 \begin_inset Flex CharStyle:Code
13028 \begin_layout Plain Layout
13037 \begin_layout Description
13038 \begin_inset Flex CharStyle:Code
13041 \begin_layout Plain Layout
13048 \begin_inset Flex CharStyle:Code
13051 \begin_layout Plain Layout
13058 \begin_inset Flex CharStyle:Code
13061 \begin_layout Plain Layout
13068 \begin_inset Flex CharStyle:Code
13071 \begin_layout Plain Layout
13080 \begin_inset Flex CharStyle:Code
13083 \begin_layout Plain Layout
13090 \begin_inset Flex CharStyle:Code
13093 \begin_layout Plain Layout
13100 \begin_inset Flex CharStyle:Code
13103 \begin_layout Plain Layout
13110 \begin_inset Flex CharStyle:Code
13113 \begin_layout Plain Layout
13120 \begin_inset Flex CharStyle:Code
13123 \begin_layout Plain Layout
13132 \begin_layout Subsection
13133 Upgrading old layout files
13136 \begin_layout Standard
13137 The file format of layout files changes from time to time, so old layout
13138 files need to be converted.
13139 This process has been automated since LyX 1.4.0: If LyX reads an old format
13140 layout file it will call the conversion tool
13141 \begin_inset Flex CharStyle:Code
13144 \begin_layout Plain Layout
13145 LyXDir/scripts/layout2layout.py
13150 and convert it to a temporary file in current format.
13151 The original file is left untouched.
13152 If you want to convert the layout file permanently, just call the converter
13156 \begin_layout LyX-Code
13157 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13160 \begin_layout Standard
13161 (You need to replace
13162 \begin_inset Flex CharStyle:Code
13165 \begin_layout Plain Layout
13171 with the name of your LyX system directory, unless you happen to have defined
13172 such an environment variable.) Then copy
13173 \begin_inset Flex CharStyle:Code
13176 \begin_layout Plain Layout
13183 \begin_inset Flex CharStyle:Code
13186 \begin_layout Plain Layout
13195 \begin_layout Standard
13196 The automatic conversion only handles syntax changes.
13197 It cannot handle the case where the contents of included files was changed,
13198 so these will have to be converted separately.
13201 \begin_layout Section
13203 \begin_inset CommandInset label
13205 name "sec:templates"
13212 \begin_layout Standard
13213 Templates are created just like usual documents.
13214 The only difference is that usual documents contain all possible settings,
13215 including the font scheme and the paper size.
13216 Usually a user doesn't want a template to overwrite his defaults in these
13218 For that reason, the designer of a template should remove the corresponding
13220 \begin_inset Flex CharStyle:Code
13223 \begin_layout Plain Layout
13232 \begin_inset Flex CharStyle:Code
13235 \begin_layout Plain Layout
13243 from the template LyX file.
13244 This can be done with any simple text-editor, for example
13245 \begin_inset Flex CharStyle:Code
13248 \begin_layout Plain Layout
13255 \begin_inset Flex CharStyle:Code
13258 \begin_layout Plain Layout
13268 \begin_layout Standard
13269 Put the edited template files you create in
13270 \begin_inset Flex CharStyle:Code
13273 \begin_layout Plain Layout
13279 , copy the ones you use from the global template directory in
13280 \begin_inset Flex CharStyle:Code
13283 \begin_layout Plain Layout
13289 to the same place, and redefine the template path in the
13290 \begin_inset Flex CharStyle:MenuItem
13293 \begin_layout Plain Layout
13301 \SpecialChar \menuseparator
13306 references\SpecialChar \menuseparator
13315 \begin_layout Standard
13316 Note that there is a template which has a particular meaning:
13317 \begin_inset Flex CharStyle:Code
13320 \begin_layout Plain Layout
13327 This template is loaded everytime you create a new document with
13328 \begin_inset Flex CharStyle:MenuItem
13331 \begin_layout Plain Layout
13341 \SpecialChar \menuseparator
13343 \begin_inset Flex CharStyle:MenuItem
13346 \begin_layout Plain Layout
13356 in order to provide useful defaults.
13357 To create this template from inside LyX, all you have to do is to open
13358 a document with the correct settings, and use the
13359 \begin_inset Flex CharStyle:MenuItem
13362 \begin_layout Plain Layout
13367 e as Document Defaults
13375 \begin_layout Chapter
13376 Including External Material
13379 \begin_layout Standard
13380 The use of material from sources external to LyX is covered in detail in
13386 This part of the manual covers what needs to happen behind the scenes for
13387 new sorts of material to be included.
13390 \begin_layout Section
13394 \begin_layout Standard
13395 The external material feature is based on the concept of a
13400 A template is a specification of how LyX should interface with a certain
13402 As bundled, LyX comes with predefined templates for Xfig figures, various
13403 raster format images, chess diagrams, and LilyPond music notation.
13404 You can check the actual list by using the menu
13405 \begin_inset Flex CharStyle:MenuItem
13408 \begin_layout Plain Layout
13409 Insert\SpecialChar \menuseparator
13410 File\SpecialChar \menuseparator
13417 Furthermore, it is possible to roll your own template to support a specific
13419 Later we'll describe in more detail what is involved, and hopefully you
13420 will submit all the templates you create so we can include them in a later
13424 \begin_layout Standard
13425 Another basic idea of the external material feature is to distinguish between
13426 the original file that serves as a base for final material and the produced
13427 file that is included in your exported or printed document.
13428 For example, consider the case of a figure produced with
13429 \begin_inset Flex CharStyle:Code
13432 \begin_layout Plain Layout
13439 The Xfig application itself works on an original file with the
13440 \begin_inset Flex CharStyle:Code
13443 \begin_layout Plain Layout
13450 Within XFig, you create and change your figure, and when you are done,
13452 \begin_inset Flex CharStyle:Code
13455 \begin_layout Plain Layout
13462 When you want to include the figure in your document, you invoke
13463 \begin_inset Flex CharStyle:Code
13466 \begin_layout Plain Layout
13472 in order to create a PostScript file that can readily be included in your
13475 \begin_inset Flex CharStyle:Code
13478 \begin_layout Plain Layout
13484 file is the original file, and the PostScript file is the produced file.
13487 \begin_layout Standard
13488 This distinction is important in order to allow updating of the material
13489 while you are in the process of writing the document.
13490 Furthermore, it provides us with the flexibility that is needed to support
13491 multiple export formats.
13492 For instance, in the case of a plain text file, it is not exactly an award-winn
13493 ing idea to include the figure as raw PostScript®.
13494 Instead, you'd either prefer to just include a reference to the figure
13495 or try to invoke some graphics to Ascii converter to make the final result
13496 look similar to the real graphics.
13497 The external material management allows you to do this, because it is parameter
13498 ized on the different export formats that LyX supports.
13501 \begin_layout Standard
13502 Besides supporting the production of different products according to the
13503 exported format, it supports tight integration with editing and viewing
13505 In the case of an XFig figure, you are able to invoke Xfig on the original
13506 file with a single click from within the external material dialog in LyX,
13507 and also preview the produced PostScript file with ghostview with another
13509 No more fiddling around with the command line and/or file browsers to locate
13510 and manipulate the original or produced files.
13511 In this way, you are finally able to take full advantage of the many different
13512 applications that are relevant to use when you write your documents, and
13513 ultimately be more productive.
13516 \begin_layout Section
13517 The external template configuration file
13520 \begin_layout Standard
13521 It is relatively easy to add custom external template definitions to LyX.
13522 However, be aware that doing this in an careless manner most probably
13526 introduce an easily exploitable security hole.
13527 So before you do this, please read the discussion about security in section
13529 \begin_inset CommandInset ref
13531 reference "sec:Security-discussion"
13538 \begin_layout Standard
13539 Having said that, we encourage you to submit any interesting templates that
13544 \begin_layout Standard
13545 The external templates are defined in the
13546 \begin_inset Flex CharStyle:Code
13549 \begin_layout Plain Layout
13550 LyXDir/lib/external_templates
13556 You can place your own version in
13557 \begin_inset Flex CharStyle:Code
13560 \begin_layout Plain Layout
13561 UserDir/external_templates
13569 \begin_layout Standard
13570 A typical template looks like this:
13573 \begin_layout LyX-Code
13577 \begin_layout LyX-Code
13578 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
13581 \begin_layout LyX-Code
13585 \begin_layout LyX-Code
13589 \begin_layout LyX-Code
13593 \begin_layout LyX-Code
13597 \begin_layout LyX-Code
13601 \begin_layout LyX-Code
13602 AutomaticProduction true
13605 \begin_layout LyX-Code
13609 \begin_layout LyX-Code
13613 \begin_layout LyX-Code
13617 \begin_layout LyX-Code
13618 TransformCommand Rotate RotationLatexCommand
13621 \begin_layout LyX-Code
13622 TransformCommand Resize ResizeLatexCommand
13625 \begin_layout LyX-Code
13626 Product "$$RotateFront$$ResizeFront
13629 \begin_layout LyX-Code
13634 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
13637 \begin_layout LyX-Code
13638 $$ResizeBack$$RotateBack"
13641 \begin_layout LyX-Code
13645 \begin_layout LyX-Code
13646 UpdateResult "$$AbsPath$$Basename.pstex_t"
13649 \begin_layout LyX-Code
13650 Requirement "graphicx"
13653 \begin_layout LyX-Code
13654 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
13657 \begin_layout LyX-Code
13658 ReferencedFile latex "$$AbsPath$$Basename.eps"
13661 \begin_layout LyX-Code
13662 ReferencedFile dvi "$$AbsPath$$Basename.eps"
13665 \begin_layout LyX-Code
13669 \begin_layout LyX-Code
13673 \begin_layout LyX-Code
13674 TransformCommand Rotate RotationLatexCommand
13677 \begin_layout LyX-Code
13678 TransformCommand Resize ResizeLatexCommand
13681 \begin_layout LyX-Code
13682 Product "$$RotateFront$$ResizeFront
13685 \begin_layout LyX-Code
13690 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
13693 \begin_layout LyX-Code
13694 $$ResizeBack$$RotateBack"
13697 \begin_layout LyX-Code
13698 UpdateFormat pdftex
13701 \begin_layout LyX-Code
13702 UpdateResult "$$AbsPath$$Basename.pdftex_t"
13705 \begin_layout LyX-Code
13706 Requirement "graphicx"
13709 \begin_layout LyX-Code
13710 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
13713 \begin_layout LyX-Code
13714 ReferencedFile latex "$$AbsPath$$Basename.pdf"
13717 \begin_layout LyX-Code
13721 \begin_layout LyX-Code
13725 \begin_layout LyX-Code
13726 Product "$$Contents(
13728 "$$AbsPath$$Basename.asc
13733 \begin_layout LyX-Code
13734 UpdateFormat asciixfig
13737 \begin_layout LyX-Code
13738 UpdateResult "$$AbsPath$$Basename.asc"
13741 \begin_layout LyX-Code
13745 \begin_layout LyX-Code
13749 \begin_layout LyX-Code
13750 Product "<graphic fileref=
13752 "$$AbsOrRelPathMaster$$Basename.eps
13757 \begin_layout LyX-Code
13761 \begin_layout LyX-Code
13765 \begin_layout LyX-Code
13766 UpdateResult "$$AbsPath$$Basename.eps"
13769 \begin_layout LyX-Code
13770 ReferencedFile docbook "$$AbsPath$$Basename.eps"
13773 \begin_layout LyX-Code
13774 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
13777 \begin_layout LyX-Code
13781 \begin_layout LyX-Code
13782 Product "[XFig: $$FName]"
13785 \begin_layout LyX-Code
13789 \begin_layout LyX-Code
13793 \begin_layout Standard
13794 As you can see, the template is enclosed in
13795 \begin_inset Flex CharStyle:Code
13798 \begin_layout Plain Layout
13804 \SpecialChar \ldots{}
13806 \begin_inset Flex CharStyle:Code
13809 \begin_layout Plain Layout
13816 It contains a header specifying some general settings and, for each supported
13817 primary document file format, a section
13818 \begin_inset Flex CharStyle:Code
13821 \begin_layout Plain Layout
13827 \SpecialChar \ldots{}
13829 \begin_inset Flex CharStyle:Code
13832 \begin_layout Plain Layout
13841 \begin_layout Subsection
13842 The template header
13845 \begin_layout Description
13846 \begin_inset Flex CharStyle:Code
13849 \begin_layout Plain Layout
13850 AutomaticProduction
13851 \begin_inset space ~
13859 Whether the file represented by the template must be generated by LyX.
13860 This command must occur exactly once.
13863 \begin_layout Description
13864 \begin_inset Flex CharStyle:Code
13867 \begin_layout Plain Layout
13869 \begin_inset space ~
13877 A glob pattern that is used in the file dialog to filter out the desired
13879 If there is more than one possible file extension (e.g.
13880 \begin_inset space ~
13884 \begin_inset Flex CharStyle:Code
13887 \begin_layout Plain Layout
13894 \begin_inset Flex CharStyle:Code
13897 \begin_layout Plain Layout
13903 ), use something like
13904 \begin_inset Flex CharStyle:Code
13907 \begin_layout Plain Layout
13914 This command must occur exactly once.
13917 \begin_layout Description
13918 \begin_inset Flex CharStyle:Code
13921 \begin_layout Plain Layout
13923 \begin_inset space ~
13931 The text that is displayed on the button.
13932 This command must occur exactly once.
13935 \begin_layout Description
13936 \begin_inset Flex CharStyle:Code
13939 \begin_layout Plain Layout
13941 \begin_inset space ~
13945 \begin_inset space ~
13953 The help text that is used in the External dialog.
13954 Provide enough information to explain to the user just what the template
13955 can provide him with.
13956 This command must occur exactly once.
13959 \begin_layout Description
13960 \begin_inset Flex CharStyle:Code
13963 \begin_layout Plain Layout
13965 \begin_inset space ~
13973 The file format of the original file.
13974 This must be the name of a format that is known to LyX (see section
13975 \begin_inset CommandInset ref
13977 reference "sub:Formats"
13983 \begin_inset Quotes eld
13987 \begin_inset Flex CharStyle:Code
13990 \begin_layout Plain Layout
13997 \begin_inset Quotes erd
14000 if the template can handle original files of more than one format.
14001 LyX will attempt to interrogate the file itself in order to deduce its
14002 format in this case.
14003 This command must occur exactly once.
14006 \begin_layout Description
14007 \begin_inset Flex CharStyle:Code
14010 \begin_layout Plain Layout
14012 \begin_inset space ~
14020 A unique name for the template.
14021 It must not contain substitution macros (see below).
14024 \begin_layout Description
14025 \begin_inset Flex CharStyle:Code
14028 \begin_layout Plain Layout
14030 \begin_inset space ~
14033 Rotate|Resize|Clip|Extra
14038 This command specifies which transformations are supported by this template.
14039 It may occur zero or more times.
14040 This command enables the corresponding tabs in the external dialog.
14042 \begin_inset Flex CharStyle:Code
14045 \begin_layout Plain Layout
14051 command must have either a corresponding
14052 \begin_inset Flex CharStyle:Code
14055 \begin_layout Plain Layout
14062 \begin_inset Flex CharStyle:Code
14065 \begin_layout Plain Layout
14072 \begin_inset Flex CharStyle:Code
14075 \begin_layout Plain Layout
14082 Otherwise the transformation will not be supported by that format.
14085 \begin_layout Subsection
14089 \begin_layout Description
14090 \begin_inset Flex CharStyle:Code
14093 \begin_layout Plain Layout
14095 \begin_inset space ~
14098 LaTeX|PDFLaTeX|PlainText|DocBook
14103 The primary document file format that this format definition is for.
14104 Not every template has a sensible representation in all document file formats.
14105 Please define nevertheless a
14106 \begin_inset Flex CharStyle:Code
14109 \begin_layout Plain Layout
14115 section for all formats.
14116 Use a dummy text when no representation is available.
14117 Then you can at least see a reference to the external material in the exported
14121 \begin_layout Description
14122 \begin_inset Flex CharStyle:Code
14125 \begin_layout Plain Layout
14127 \begin_inset space ~
14131 \begin_inset space ~
14139 This command defines an additional macro
14140 \begin_inset Flex CharStyle:Code
14143 \begin_layout Plain Layout
14149 for substitution in
14150 \begin_inset Flex CharStyle:Code
14153 \begin_layout Plain Layout
14161 \begin_inset Flex CharStyle:Code
14164 \begin_layout Plain Layout
14170 itself may contain substitution macros.
14171 The advantage over using
14172 \begin_inset Flex CharStyle:Code
14175 \begin_layout Plain Layout
14182 \begin_inset Flex CharStyle:Code
14185 \begin_layout Plain Layout
14191 is that the substituted value of
14192 \begin_inset Flex CharStyle:Code
14195 \begin_layout Plain Layout
14201 is sanitized so that it is a valid optional argument in the document format.
14202 This command may occur zero or more times.
14205 \begin_layout Description
14206 \begin_inset Flex CharStyle:Code
14209 \begin_layout Plain Layout
14211 \begin_inset space ~
14219 The text that is inserted in the exported document.
14220 This is actually the most important command and can be quite complex.
14221 This command must occur exactly once.
14224 \begin_layout Description
14225 \begin_inset Flex CharStyle:Code
14228 \begin_layout Plain Layout
14230 \begin_inset space ~
14238 This command specifies a preamble snippet that will be included in the
14240 It has to be defined using
14241 \begin_inset Flex CharStyle:Code
14244 \begin_layout Plain Layout
14250 \SpecialChar \ldots{}
14252 \begin_inset Flex CharStyle:Code
14255 \begin_layout Plain Layout
14262 This command may occur zero or more times.
14265 \begin_layout Description
14266 \begin_inset Flex CharStyle:Code
14269 \begin_layout Plain Layout
14271 \begin_inset space ~
14275 \begin_inset space ~
14283 This command denotes files that are created by the conversion process and
14284 are needed for a particular export format.
14285 If the filename is relative, it is interpreted relative to the master document.
14286 This command may be given zero or more times.
14289 \begin_layout Description
14290 \begin_inset Flex CharStyle:Code
14293 \begin_layout Plain Layout
14295 \begin_inset space ~
14303 The name of a required LaTeX package.
14304 The package is included via
14305 \begin_inset Flex CharStyle:Code
14308 \begin_layout Plain Layout
14316 in the LaTeX preamble.
14317 This command may occur zero or more times.
14320 \begin_layout Description
14321 \begin_inset Flex CharStyle:Code
14324 \begin_layout Plain Layout
14326 \begin_inset space ~
14330 \begin_inset space ~
14333 RotationLatexCommand
14338 This command specifies that the built in LaTeX command should be used for
14340 This command may occur once or not at all.
14343 \begin_layout Description
14344 \begin_inset Flex CharStyle:Code
14347 \begin_layout Plain Layout
14349 \begin_inset space ~
14353 \begin_inset space ~
14361 This command specifies that the built in LaTeX command should be used for
14363 This command may occur once or not at all.
14366 \begin_layout Description
14367 \begin_inset Flex CharStyle:Code
14370 \begin_layout Plain Layout
14372 \begin_inset space ~
14376 \begin_inset space ~
14379 RotationLatexOption
14384 This command specifies that rotation is done via an optional argument.
14385 This command may occur once or not at all.
14388 \begin_layout Description
14389 \begin_inset Flex CharStyle:Code
14392 \begin_layout Plain Layout
14394 \begin_inset space ~
14398 \begin_inset space ~
14406 This command specifies that resizing is done via an optional argument.
14407 This command may occur once or not at all.
14410 \begin_layout Description
14411 \begin_inset Flex CharStyle:Code
14414 \begin_layout Plain Layout
14416 \begin_inset space ~
14420 \begin_inset space ~
14428 This command specifies that clipping is done via an optional argument.
14429 This command may occur once or not at all.
14432 \begin_layout Description
14433 \begin_inset Flex CharStyle:Code
14436 \begin_layout Plain Layout
14438 \begin_inset space ~
14442 \begin_inset space ~
14450 This command specifies that an extra optional argument is used.
14451 This command may occur once or not at all.
14454 \begin_layout Description
14455 \begin_inset Flex CharStyle:Code
14458 \begin_layout Plain Layout
14460 \begin_inset space ~
14468 The file format of the converted file.
14469 This must be the name of a format that is known to LyX (see the
14470 \begin_inset Flex CharStyle:MenuItem
14473 \begin_layout Plain Layout
14478 ools\SpecialChar \menuseparator
14483 references:Conversion
14489 This command must occur exactly once.
14492 \begin_layout Description
14493 \begin_inset Flex CharStyle:Code
14496 \begin_layout Plain Layout
14498 \begin_inset space ~
14506 The file name of the converted file.
14507 The file name must be absolute.
14508 This command must occur exactly once.
14511 \begin_layout Subsection
14512 Preamble definitions
14515 \begin_layout Standard
14516 The external template configuration file may contain additional preamble
14517 definitions enclosed by
14518 \begin_inset Flex CharStyle:Code
14521 \begin_layout Plain Layout
14527 \SpecialChar \ldots{}
14529 \begin_inset Flex CharStyle:Code
14532 \begin_layout Plain Layout
14539 They can be used by the templates in the
14540 \begin_inset Flex CharStyle:Code
14543 \begin_layout Plain Layout
14552 \begin_layout Section
14553 The substitution mechanism
14556 \begin_layout Standard
14557 When the external material facility invokes an external program, it is done
14558 on the basis of a command defined in the template configuration file.
14559 These commands can contain various macros that are expanded before execution.
14560 Execution always take place in the directory of the containing document.
14563 \begin_layout Standard
14564 Also, whenever external material is to be displayed, the name will be produced
14565 by the substitution mechanism, and most other commands in the template
14566 definition support substitution as well.
14569 \begin_layout Standard
14570 The available macros are the following:
14573 \begin_layout Description
14574 \begin_inset Flex CharStyle:Code
14577 \begin_layout Plain Layout
14578 $$AbsOrRelPathMaster
14583 The file path, absolute or relative to the master LyX document.
14586 \begin_layout Description
14587 \begin_inset Flex CharStyle:Code
14590 \begin_layout Plain Layout
14591 $$AbsOrRelPathParent
14596 The file path, absolute or relative to the LyX document.
14599 \begin_layout Description
14600 \begin_inset Flex CharStyle:Code
14603 \begin_layout Plain Layout
14609 The absolute file path.
14612 \begin_layout Description
14613 \begin_inset Flex CharStyle:Code
14616 \begin_layout Plain Layout
14622 The filename without path and without the extension.
14625 \begin_layout Description
14626 \begin_inset Flex CharStyle:Code
14629 \begin_layout Plain Layout
14631 \begin_inset Quotes eld
14635 \begin_inset Quotes erd
14643 This macro will expand to the contents of the file with the name
14644 \begin_inset Flex CharStyle:Code
14647 \begin_layout Plain Layout
14656 \begin_layout Description
14657 \begin_inset Flex CharStyle:Code
14660 \begin_layout Plain Layout
14666 The file extension (including the dot).
14669 \begin_layout Description
14670 \begin_inset Flex CharStyle:Code
14673 \begin_layout Plain Layout
14679 The filename of the file specified in the external material dialog.
14680 This is either an absolute name, or it is relative to the LyX document.
14683 \begin_layout Description
14684 \begin_inset Flex CharStyle:Code
14687 \begin_layout Plain Layout
14694 \begin_inset Flex CharStyle:Code
14697 \begin_layout Plain Layout
14703 (absolute name or relative to the LyX document).
14706 \begin_layout Description
14707 \begin_inset Flex CharStyle:Code
14710 \begin_layout Plain Layout
14716 The file path, relative to the master LyX document.
14719 \begin_layout Description
14720 \begin_inset Flex CharStyle:Code
14723 \begin_layout Plain Layout
14729 The file path, relative to the LyX document.
14732 \begin_layout Description
14733 \begin_inset Flex CharStyle:Code
14736 \begin_layout Plain Layout
14742 This macro will expand to the absolute path of the system directory.
14743 This is typically used to point to the various helper scripts that are
14747 \begin_layout Description
14748 \begin_inset Flex CharStyle:Code
14751 \begin_layout Plain Layout
14757 A name and full path to a temporary file which will be automatically deleted
14758 whenever the containing document is closed, or the external material insertion
14762 \begin_layout Standard
14763 All path macros contain a trailing directory separator, so you can construct
14765 the absolute filename with
14766 \begin_inset Flex CharStyle:Code
14769 \begin_layout Plain Layout
14770 $$AbsPath$$Basename$$Extension
14778 \begin_layout Standard
14779 The macros above are substituted in all commands unless otherwise noted.
14781 \begin_inset Flex CharStyle:Code
14784 \begin_layout Plain Layout
14790 supports additionally the following substitutions if they are enabled by
14792 \begin_inset Flex CharStyle:Code
14795 \begin_layout Plain Layout
14802 \begin_inset Flex CharStyle:Code
14805 \begin_layout Plain Layout
14814 \begin_layout Description
14815 \begin_inset Flex CharStyle:Code
14818 \begin_layout Plain Layout
14824 The front part of the resize command.
14827 \begin_layout Description
14828 \begin_inset Flex CharStyle:Code
14831 \begin_layout Plain Layout
14837 The back part of the resize command.
14840 \begin_layout Description
14841 \begin_inset Flex CharStyle:Code
14844 \begin_layout Plain Layout
14850 The front part of the rotation command.
14853 \begin_layout Description
14854 \begin_inset Flex CharStyle:Code
14857 \begin_layout Plain Layout
14863 The back part of the rotation command.
14866 \begin_layout Standard
14867 The value string of the
14868 \begin_inset Flex CharStyle:Code
14871 \begin_layout Plain Layout
14877 command supports additionally the following substitutions if they are enabled
14879 \begin_inset Flex CharStyle:Code
14882 \begin_layout Plain Layout
14889 \begin_inset Flex CharStyle:Code
14892 \begin_layout Plain Layout
14901 \begin_layout Description
14902 \begin_inset Flex CharStyle:Code
14905 \begin_layout Plain Layout
14914 \begin_layout Description
14915 \begin_inset Flex CharStyle:Code
14918 \begin_layout Plain Layout
14927 \begin_layout Description
14928 \begin_inset Flex CharStyle:Code
14931 \begin_layout Plain Layout
14940 \begin_layout Description
14941 \begin_inset Flex CharStyle:Code
14944 \begin_layout Plain Layout
14950 The rotation option.
14953 \begin_layout Standard
14954 You may ask why there are so many path macros.
14955 There are mainly two reasons:
14958 \begin_layout Enumerate
14959 Relative and absolute file names should remain relative or absolute, respectivel
14961 Users may have reasons to prefer either form.
14962 Relative names are useful for portable documents that should work on different
14963 machines, for example.
14964 Absolute names may be required by some programs.
14967 \begin_layout Enumerate
14968 LaTeX treats relative file names differently than LyX and other programs
14969 in nested included files.
14970 For LyX, a relative file name is always relative to the document that contains
14972 For LaTeX, it is always relative to the master document.
14973 These two definitions are identical if you have only one document, but
14974 differ if you have a master document that includes part documents.
14975 That means that relative filenames must be transformed when presented to
14977 Fortunately LyX does this automatically for you if you choose the right
14981 \begin_layout Standard
14982 So which path macro should be used in new template definitions? The rule
14986 \begin_layout Itemize
14988 \begin_inset Flex CharStyle:Code
14991 \begin_layout Plain Layout
14997 if an absolute path is required.
15000 \begin_layout Itemize
15002 \begin_inset Flex CharStyle:Code
15005 \begin_layout Plain Layout
15006 $$AbsOrRelPathMaster
15011 if the substituted string is some kind of LaTeX input.
15014 \begin_layout Itemize
15016 \begin_inset Flex CharStyle:Code
15019 \begin_layout Plain Layout
15020 $$AbsOrRelPathParent
15025 in order to preserve the user's choice.
15028 \begin_layout Standard
15029 There are special cases where this rule does not work and e.g.
15030 \begin_inset space ~
15033 relative names are needed, but normally it will work just fine.
15034 One example for such a case is the command
15035 \begin_inset Flex CharStyle:Code
15038 \begin_layout Plain Layout
15039 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15044 in the XFig template above: We can't use the absolute name because the
15046 \begin_inset Flex CharStyle:Code
15049 \begin_layout Plain Layout
15055 files needs the relative name in order to rewrite the file content.
15058 \begin_layout Section
15059 \begin_inset CommandInset label
15061 name "sec:Security-discussion"
15065 Security discussion
15068 \begin_layout Standard
15069 \begin_inset Note Note
15072 \begin_layout Plain Layout
15073 This section is outdated
15078 The external material feature interfaces with a lot of external programs
15079 and does so automatically, so we have to consider the security implications
15081 In particular, since you have the option of including your own filenames
15082 and/or parameter strings and those are expanded into a command, it seems
15083 that it would be possible to create a malicious document which executes
15084 arbitrary commands when a user views or prints the document.
15085 This is something we definately want to avoid.
15088 \begin_layout Standard
15089 However, since the external program commands are specified in the template
15090 configuration file only, there are no security issues if LyX is properly
15091 configured with safe templates only.
15092 This is so because the external programs are invoked with the
15093 \begin_inset Flex CharStyle:Code
15096 \begin_layout Plain Layout
15102 -system call rather than the
15103 \begin_inset Flex CharStyle:Code
15106 \begin_layout Plain Layout
15112 system-call, so it's not possible to execute arbitrary commands from the
15113 filename or parameter section via the shell.
15116 \begin_layout Standard
15117 This also implies that you are restricted in what command strings you can
15118 use in the external material templates.
15119 In particular, pipes and redirection are not readily available.
15120 This has to be so if LyX should remain safe.
15121 If you want to use some of the shell features, you should write a safe
15122 script to do this in a controlled manner, and then invoke the script from
15123 the command string.
15125 \begin_inset Flex CharStyle:Code
15128 \begin_layout Plain Layout
15134 directory of the LyX installation, you can find a safe wrapper script
15135 \begin_inset Flex CharStyle:Code
15138 \begin_layout Plain Layout
15139 general_command_wrapper.py
15144 that supports redirection of input and output.
15145 That can serve as an example for how to write safe template scripts.
15146 For a more advanced example that uses
15147 \begin_inset Flex CharStyle:Code
15150 \begin_layout Plain Layout
15156 and friends, take a look at the
15157 \begin_inset Flex CharStyle:Code
15160 \begin_layout Plain Layout
15169 \begin_layout Standard
15170 It is possible to design a template that interacts directly with the shell,
15171 but since this would allow a malicious user to execute arbitrary commands
15172 by writing clever filenames and/or parameters, we generally recommend that
15173 you only use safe scripts that work with the
15174 \begin_inset Flex CharStyle:Code
15177 \begin_layout Plain Layout
15183 system call in a controlled manner.
15184 Of course, for use in a controlled environment, it can be tempting to just
15185 fall back to use ordinary shell scripts.
15186 If you do so, be aware that you
15190 provide an easily exploitable security hole in your system.
15191 Of course it stands to reason that such unsafe templates will never be
15192 included in the standard LyX distribution, although we do encourage people
15193 to submit new templates in the open source tradition.
15194 But LyX as shipped from the official distribution channels will never have
15198 \begin_layout Standard
15199 Including external material provides a lot of power, and you have to be
15200 careful not to introduce security hazards with this power.
15201 A subtle error in a single line in an innocent looking script can open
15202 the door to huge security problems.
15203 So if you do not fully understand the issues, we recommend that you consult
15204 a knowledgable security professional or the LyX development team if you
15205 have any questions about whether a given template is safe or not.
15206 And do this before you use it in an uncontrolled environment.
15209 \begin_layout Chapter
15213 \begin_layout Section
15217 \begin_layout Standard
15218 The LyX server is a method implemented in LyX that will enable other programs
15219 to talk to LyX, invoke LyX commands, and retrieve information about the
15220 LyX internal state.
15221 This is only intended for advanced users, but they should find it useful.
15222 Please note that, at present,
15224 the server does not work on Windows
15230 \begin_layout Plain Layout
15231 There is no principled reason it cannot do so.
15232 But none of the developers on Windows® have yet implemented this functionality
15241 \begin_layout Section
15242 Starting the LyX Server
15245 \begin_layout Standard
15246 The LyX server works through the use of a pair of named pipes.
15247 These are usually located in
15248 \begin_inset Flex CharStyle:Code
15251 \begin_layout Plain Layout
15258 \begin_inset Quotes eld
15262 \begin_inset Flex CharStyle:Code
15265 \begin_layout Plain Layout
15272 \begin_inset Quotes erd
15276 \begin_inset Quotes eld
15280 \begin_inset Flex CharStyle:Code
15283 \begin_layout Plain Layout
15290 \begin_inset Quotes erd
15294 External programs write into
15295 \begin_inset Flex CharStyle:Code
15298 \begin_layout Plain Layout
15304 and read back data from
15305 \begin_inset Flex CharStyle:Code
15308 \begin_layout Plain Layout
15315 The stem of the pipe names can be defined in the
15316 \begin_inset Flex CharStyle:MenuItem
15319 \begin_layout Plain Layout
15324 ools\SpecialChar \menuseparator
15334 dialog, for example
15335 \begin_inset Flex CharStyle:Code
15338 \begin_layout Plain Layout
15339 "/home/myhome/.lyxpipe"
15347 \begin_layout Standard
15349 \begin_inset Flex CharStyle:Code
15352 \begin_layout Plain Layout
15359 \begin_inset Flex CharStyle:Code
15362 \begin_layout Plain Layout
15368 ' to create the pipes.
15369 The above setting also has the effect of activating the LyX server.
15370 If one of the pipes already exists, LyX will assume that another LyX process
15371 is already running and will not start the server.
15372 To have several LyX processes with servers at the same time, you have to
15373 change the configuration between the start of the programs.
15376 \begin_layout Standard
15377 If you are developing a client program, you might find it useful to enable
15378 debugging information from the LyX server.
15379 Do this by starting LyX as lyx -dbg lyxserver.
15382 \begin_layout Standard
15383 Warning: if LyX crashes, it may not manage to remove the pipes; in this
15384 case you must remove them manually.
15385 If LyX starts and the pipes exist already, it will not start any server.
15388 \begin_layout Standard
15389 Other than this, there are a few points to consider:
15392 \begin_layout Itemize
15393 Both server and clients must run on UNIX or OS/2 machines.
15394 Communications between LyX on UNIX and clients on OS/2 or vice versa is
15395 not possible right now.
15398 \begin_layout Itemize
15399 On OS/2, only one client can connect to LyXServer at a time.
15402 \begin_layout Itemize
15403 On OS/2, clients must open inpipe with
15404 \begin_inset Flex CharStyle:Code
15407 \begin_layout Plain Layout
15416 \begin_layout Standard
15420 \begin_layout Standard
15421 You can find a complete example client written in C in the source distribution
15423 \begin_inset Flex CharStyle:Code
15426 \begin_layout Plain Layout
15427 development/lyxserver/server_monitor.c
15435 \begin_layout Section
15436 Normal communication
15439 \begin_layout Standard
15440 To issue a LyX call, the client writes a line of ASCII text into the input
15442 This line has the following format:
15445 \begin_layout Quote
15459 \begin_layout Description
15464 is a name that the client can choose arbitrarily.
15465 Its only use is that LyX will echo it if it sends an answer---so a client
15466 can dispatch results from different requesters.
15469 \begin_layout Description
15474 is the function you want LyX to perform.
15475 It is the same as the commands you'd use in the minibuffer.
15478 \begin_layout Description
15483 is an optional argument which is meaningful only to some functions (for
15485 \begin_inset Quotes eld
15489 \begin_inset Quotes erd
15492 which will insert the argument as text at the cursor position.)
15495 \begin_layout Standard
15496 The answer from LyX will arrive in the output pipe and be of the form
15499 \begin_layout Quote
15513 \begin_layout Standard
15522 are just echoed from the command request, while
15526 is more or less useful information filled according to how the command
15527 execution worked out.
15528 Some commands will return information about the internal state of LyX,
15530 \begin_inset Quotes eld
15534 \begin_inset Quotes erd
15537 , while other will return an empty data-response.
15538 This means that the command execution went fine.
15541 \begin_layout Standard
15542 In case of errors, the response from LyX will have this form
15545 \begin_layout Quote
15559 \begin_layout Standard
15564 should contain an explanation of why the command failed.
15567 \begin_layout Standard
15571 \begin_layout LyX-Code
15572 echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
15575 \begin_layout LyX-Code
15576 echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
15577 \begin_inset Newline newline
15580 read a <~/.lyxpipe.out
15581 \begin_inset Newline newline
15587 \begin_layout Section
15591 \begin_layout Standard
15592 LyX can notify clients of events going on asynchronously.
15593 Currently it will only do this if the user binds a key sequence with the
15595 \begin_inset Quotes eld
15599 \begin_inset Quotes erd
15603 The format of the string LyX sends is as follows:
15606 \begin_layout Quote
15607 \begin_inset Flex CharStyle:Code
15610 \begin_layout Plain Layout
15621 \begin_layout Standard
15626 is the printed representation of the key sequence that was actually typed
15630 \begin_layout Standard
15631 This mechanism can be used to extend LyX's command set and implement macros:
15632 bind some key sequence to
15633 \begin_inset Quotes eld
15637 \begin_inset Quotes erd
15640 , start a client that listens on the out pipe, dispatches the command according
15641 to the sequence and starts a function that may use LyX calls and LyX requests
15642 to issue a command or a series of commands to LyX.
15645 \begin_layout Section
15646 The simple LyX Server Protocol
15649 \begin_layout Standard
15650 LyX implements a simple protocol that can be used for session management.
15651 All messages are of the form
15654 \begin_layout Quote
15664 \begin_layout Standard
15670 \begin_inset Quotes eld
15674 \begin_inset Quotes erd
15678 \begin_inset Quotes eld
15682 \begin_inset Quotes erd
15687 \begin_inset Quotes eld
15691 \begin_inset Quotes erd
15694 is received from a client, LyX will report back to inform the client that
15695 it's listening to it's messages, while
15696 \begin_inset Quotes eld
15700 \begin_inset Quotes erd
15703 sent from LyX will inform clients that LyX is closing.