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 true
112 \output_changes false
113 \author "Richard Heck"
121 Customizing LyX: Features for the Advanced User
129 \begin_layout Plain Layout
131 If you have comments or error corrections, please send them to the LyX Documenta
133 \begin_inset CommandInset href
135 target "lyx-docs@lists.lyx.org"
148 \begin_layout Standard
149 \begin_inset CommandInset toc
150 LatexCommand tableofcontents
157 \begin_layout Chapter
161 \begin_layout Standard
162 This manual covers the customization features present in LyX.
163 In it, we discuss issues like keyboard shortcuts, screen previewing options,
164 printer options, sending commands to LyX via the LyX Server, internationalizati
165 on, installing new LaTeX classes and LyX layouts, etc.
166 We can't possibly hope to touch on everything you can change---our developers
167 add new features faster than we can document them---but we will explain
168 the most common customizations and hopefully point you in the right direction
169 for some of the more obscure ones.
172 \begin_layout Standard
173 \begin_inset Branch OutDated
176 \begin_layout Standard
177 Information from previous versions of this document that now seems to be
178 outdated is contained in the OutDated branch of this document.
179 By default, this information will not appear in the LaTeX output.
187 \begin_layout Chapter
188 LyX configuration files
191 \begin_layout Standard
192 This chapter aims to help you to find your way through the LyX configuration
194 Before continuing to read this chapter, you should find out where your
195 LyX library and user directories are by using
196 \begin_inset Flex CharStyle:MenuItem
199 \begin_layout Plain Layout
204 elp\SpecialChar \menuseparator
217 The library directory is the place where LyX places its system-wide configurati
218 on files; the user directory is where you can place your modified versions.
219 We will call the former
220 \begin_inset Flex CharStyle:Code
223 \begin_layout Plain Layout
230 \begin_inset Flex CharStyle:MenuItem
233 \begin_layout Plain Layout
239 in the remainder of this document.
243 \begin_layout Section
245 \begin_inset Flex CharStyle:Code
248 \begin_layout Plain Layout
257 \begin_layout Standard
258 \begin_inset Flex CharStyle:Code
261 \begin_layout Plain Layout
267 and its sub-directories contain a number of files and that can be used
268 to customise LyX's behaviour.
269 You can change many of these files from within LyX itself through the
270 \begin_inset Flex CharStyle:MenuItem
273 \begin_layout Plain Layout
278 ools\SpecialChar \menuseparator
289 Most customization that you will want to do in LyX is possible through
291 However, many other inner aspects of LyX can be customized by modifying
293 \begin_inset Flex CharStyle:Code
296 \begin_layout Plain Layout
303 These files fall in different categories, described in the following subsection
307 \begin_layout Subsection
308 Automatically generated files
311 \begin_layout Standard
312 The files, which are to be found in
313 \begin_inset Flex CharStyle:MenuItem
316 \begin_layout Plain Layout
322 , are generated when you configure LyX.
323 They contain various default values that are guessed by inspection.
324 In general, it is not a good idea to modify them, since they might be overwritt
328 \begin_layout Labeling
329 \labelwidthstring 00.00.0000
330 \begin_inset Flex CharStyle:Code
333 \begin_layout Plain Layout
339 contains defaults for various commands.
342 \begin_layout Labeling
343 \labelwidthstring 00.00.0000
344 \begin_inset Flex CharStyle:Code
347 \begin_layout Plain Layout
353 contains the list of packages that have been recognized by LyX.
354 It is currently unused by the LyX program itself, but the information extracted
355 , and more, is made available with
356 \begin_inset Flex CharStyle:MenuItem
359 \begin_layout Plain Layout
364 elp\SpecialChar \menuseparator
381 \begin_layout Labeling
382 \labelwidthstring 00.00.0000
383 \begin_inset Flex CharStyle:Code
386 \begin_layout Plain Layout
392 the list of text classes that have been found in your
393 \begin_inset Flex CharStyle:Code
396 \begin_layout Plain Layout
402 directories, along with the associated LaTeX document class and their descripti
406 \begin_layout Labeling
407 \labelwidthstring 00.00.0000
408 \begin_inset Flex CharStyle:Code
411 \begin_layout Plain Layout
417 the list of layout modules found in your
418 \begin_inset Flex CharStyle:Code
421 \begin_layout Plain Layout
430 \begin_layout Labeling
431 \labelwidthstring 00.00.0000
432 \begin_inset Flex CharStyle:Code
435 \begin_layout Plain Layout
441 lists of various sorts of LaTeX-related files found on your system
444 \begin_layout Labeling
445 \labelwidthstring 00.00.0000
446 \begin_inset Flex CharStyle:Code
449 \begin_layout Plain Layout
455 is automatically generated during configuration from the file
456 \begin_inset Flex CharStyle:Code
459 \begin_layout Plain Layout
466 It contains information on your LaTeX configuration.
469 \begin_layout Subsection
473 \begin_layout Standard
474 These directories are duplicated between
475 \begin_inset Flex CharStyle:Code
478 \begin_layout Plain Layout
485 \begin_inset Flex CharStyle:Code
488 \begin_layout Plain Layout
495 If a particular files exists in both places, the one in
496 \begin_inset Flex CharStyle:Code
499 \begin_layout Plain Layout
508 \begin_layout Labeling
509 \labelwidthstring 00.00.0000
510 \begin_inset Flex CharStyle:Code
513 \begin_layout Plain Layout
519 this directory contains files with the extension
520 \begin_inset Flex CharStyle:Code
523 \begin_layout Plain Layout
529 that define the keybindings used in LyX.
530 If there exists an internationalized version of the bind file named
531 \begin_inset Flex CharStyle:Code
534 \begin_layout Plain Layout
540 , that will be used first.
543 \begin_layout Labeling
544 \labelwidthstring 00.00.0000
545 \begin_inset Flex CharStyle:Code
548 \begin_layout Plain Layout
554 contains graphics files that can be included in documents.
558 \begin_layout Labeling
559 \labelwidthstring 00.00.0000
560 \begin_inset Flex CharStyle:Code
563 \begin_layout Plain Layout
569 contains LyX documentation files (including the one you are currently reading).
571 \begin_inset Flex CharStyle:Code
574 \begin_layout Plain Layout
580 deserves special attention, as noted above.
581 If there exists an internationalized version of the help-document with
583 \begin_inset Flex CharStyle:Code
586 \begin_layout Plain Layout
592 prepended to the name, that will be used first.
598 \begin_inset CommandInset ref
600 reference "chap:i18n"
607 \begin_layout Labeling
608 \labelwidthstring 00.00.0000
609 \begin_inset Flex CharStyle:Code
612 \begin_layout Plain Layout
618 contains example files that explain how to use some features.
619 In the file browser, press the
620 \begin_inset Flex CharStyle:MenuItem
623 \begin_layout Plain Layout
632 \begin_layout Labeling
633 \labelwidthstring 00.00.0000
634 \begin_inset Flex CharStyle:Code
637 \begin_layout Plain Layout
643 contains image files that are used by the
644 \begin_inset Flex CharStyle:MenuItem
647 \begin_layout Plain Layout
654 In addition, it also contains the individual icons used in the toolbar
655 and the banners that can be shown when LyX is launched.
658 \begin_layout Labeling
659 \labelwidthstring 00.00.0000
660 \begin_inset Flex CharStyle:Code
663 \begin_layout Plain Layout
669 contains keyboard keymapping files.
675 \begin_inset CommandInset ref
677 reference "sec:keymap"
684 \begin_layout Labeling
685 \labelwidthstring 00.00.0000
686 \begin_inset Flex CharStyle:Code
689 \begin_layout Plain Layout
695 contains the text class and module files described in Chapter
700 \begin_inset CommandInset ref
702 reference "chap:textclass"
709 \begin_layout Labeling
710 \labelwidthstring 00.00.0000
711 \begin_inset Flex CharStyle:Code
714 \begin_layout Plain Layout
721 \begin_inset Flex CharStyle:Code
724 \begin_layout Plain Layout
730 Python scripts used to convert between LyX versions.
731 These can be run from the command line if, say, you want to batch-convert
735 \begin_layout Labeling
736 \labelwidthstring 00.00.0000
737 \begin_inset Flex CharStyle:Code
740 \begin_layout Plain Layout
746 contains some files that demonstrate the capabilities of the
747 \begin_inset Flex CharStyle:MenuItem
750 \begin_layout Plain Layout
761 Also contains some scripts used by LyX itself.
764 \begin_layout Labeling
765 \labelwidthstring 00.00.0000
766 \begin_inset Flex CharStyle:Code
769 \begin_layout Plain Layout
775 contains the standard LyX template files described in Chapter
780 \begin_inset CommandInset ref
782 reference "sec:templates"
789 \begin_layout Labeling
790 \labelwidthstring 00.00.0000
791 \begin_inset Flex CharStyle:Code
794 \begin_layout Plain Layout
800 contains files with the extension
801 \begin_inset Flex CharStyle:Code
804 \begin_layout Plain Layout
810 that define the user interface to LyX.
811 That is, the files define which items appear in which menus and the items
812 appearing on the toolbar.
815 \begin_layout Subsection
816 Files you don't want to modify
819 \begin_layout Standard
820 These files are used internally by LyX and you generally do not need to
821 modify them unless you are a developer.
824 \begin_layout Labeling
825 \labelwidthstring 00.00.0000
826 \begin_inset Flex CharStyle:Code
829 \begin_layout Plain Layout
835 this file contains the list of LyX developers.
836 The contents are displayed with the menu entry
837 \begin_inset Flex CharStyle:MenuItem
840 \begin_layout Plain Layout
845 elp\SpecialChar \menuseparator
858 \begin_layout Labeling
859 \labelwidthstring 00.00.0000
860 \begin_inset Flex CharStyle:Code
863 \begin_layout Plain Layout
869 this is a LaTeX script used during the configuration process.
873 \begin_layout Labeling
874 \labelwidthstring 00.00.0000
875 \begin_inset Flex CharStyle:Code
878 \begin_layout Plain Layout
884 this is the script that is used to re-configure LyX.
885 It creates configuration files in the directory it was run from.
888 \begin_layout Subsection
889 Other files needing a line or two...
892 \begin_layout Labeling
893 \labelwidthstring 00.00.0000
894 \begin_inset Flex CharStyle:Code
897 \begin_layout Plain Layout
903 this contains tables describing how different character encodings can be
907 \begin_layout Labeling
908 \labelwidthstring 00.00.0000
909 \begin_inset Flex CharStyle:Code
912 \begin_layout Plain Layout
918 this file contains the templates available to the new
919 \begin_inset Flex CharStyle:MenuItem
922 \begin_layout Plain Layout
935 \begin_layout Labeling
936 \labelwidthstring 00.00.0000
937 \begin_inset Flex CharStyle:Code
940 \begin_layout Plain Layout
946 this file contains a list of all the languages currently supported by LyX.
949 \begin_layout Section
950 Your local configuration directory
953 \begin_layout Standard
954 Even if you are using LyX as an unprivileged user, you might want to change
955 LyX configuration for your own use.
957 \begin_inset Flex CharStyle:Code
960 \begin_layout Plain Layout
966 directory contains all your personal configuration files.
967 This is the directory described as
968 \begin_inset Quotes eld
972 \begin_inset Quotes erd
976 \begin_inset Flex CharStyle:MenuItem
979 \begin_layout Plain Layout
984 elp\SpecialChar \menuseparator
995 This directory is used as a mirror of
996 \begin_inset Flex CharStyle:Code
999 \begin_layout Plain Layout
1005 , which means that every file in
1006 \begin_inset Flex CharStyle:Code
1009 \begin_layout Plain Layout
1015 is a replacement for the corresponding file in
1016 \begin_inset Flex CharStyle:Code
1019 \begin_layout Plain Layout
1026 Any configuration file described in the above sections can be placed either
1027 in the system-wide directory, in which case it will affect all users, or
1028 in your local directory for your own use.
1031 \begin_layout Standard
1032 To make things clearer, let's provide a few examples:
1035 \begin_layout Itemize
1036 The preferences set in the
1037 \begin_inset Flex CharStyle:MenuItem
1040 \begin_layout Plain Layout
1045 ools\SpecialChar \menuseparator
1055 dialog are saved to a file
1056 \begin_inset Flex CharStyle:Code
1059 \begin_layout Plain Layout
1066 \begin_inset Flex CharStyle:Code
1069 \begin_layout Plain Layout
1078 \begin_layout Itemize
1079 When you reconfigure using
1080 \begin_inset Flex CharStyle:MenuItem
1083 \begin_layout Plain Layout
1088 ools\SpecialChar \menuseparator
1099 \begin_inset Flex CharStyle:Code
1102 \begin_layout Plain Layout
1108 script, and the resulting files are written in your local configuration
1110 This means that any additional text class file that you might have added
1112 \begin_inset Flex CharStyle:Code
1115 \begin_layout Plain Layout
1121 will be added to the list of classes in the
1122 \begin_inset Flex CharStyle:MenuItem
1125 \begin_layout Plain Layout
1130 ocument\SpecialChar \menuseparator
1143 \begin_layout Itemize
1144 If you get some updated documentation from LyX ftp site and cannot install
1145 it because you do not have sysadmin rights on your system, you can just
1147 \begin_inset Flex CharStyle:Code
1150 \begin_layout Plain Layout
1156 and the items in the
1157 \begin_inset Flex CharStyle:MenuItem
1160 \begin_layout Plain Layout
1170 menu will open them!
1173 \begin_layout Section
1174 Running LyX with multiple configurations
1177 \begin_layout Standard
1178 The configuration freedom of the local configuration directory may not suffice
1179 if you want to have more than one configuration at your disposal.
1180 For example, you may want to be use different key bindings or printer settings
1182 You can achieve this by having several such directories.
1183 You then specify which directory to use at run-time.
1186 \begin_layout Standard
1187 Invoking LyX with the command line switch
1188 \begin_inset Flex CharStyle:Code
1191 \begin_layout Plain Layout
1201 instructs the program to read the configuration from that directory, and
1202 not from the default directory.
1203 (You can determine the default directory by running LyX without the
1204 \begin_inset Flex CharStyle:Code
1207 \begin_layout Plain Layout
1213 switch.) If the specified directory does not exist, LyX offers to create
1214 it for you, just like it does for the default directory on the first time
1215 you run the program.
1216 You can modify the configuration options in this additional user directory
1217 exactly as you would for the default directory.
1218 These directories are completely independent (but read on).
1219 Note that setting the environment variable
1220 \begin_inset Flex CharStyle:Code
1223 \begin_layout Plain Layout
1229 to some value has exactly the same effect.
1232 \begin_layout Standard
1233 Having several configurations also requires more maintenance: if you want
1234 to add a new layout to
1235 \begin_inset Flex CharStyle:Code
1238 \begin_layout Plain Layout
1244 which you want available from all your configurations, you must add it
1245 to each directory separately.
1246 You can avoid this with the following trick: after LyX creates the additional
1247 directory, most of the subdirectories (see above) are empty.
1248 If you want the new configuration to mirror an existing one, replace the
1249 empty subdirectory with a symbolic link to the matching subdirectory in
1250 the existing configuration.
1252 \begin_inset Flex CharStyle:Code
1255 \begin_layout Plain Layout
1261 subirectory, however, since it contains a file written by the configuration
1262 script (also accessible through
1263 \begin_inset Flex CharStyle:MenuItem
1266 \begin_layout Plain Layout
1271 ools\SpecialChar \menuseparator
1281 ) which is configuration-specific.
1284 \begin_layout Chapter
1285 The Preferences dialog
1288 \begin_layout Standard
1289 All options of the preferences dialog are described in the Appendix
1291 The Preferences Dialog
1298 For some options you might find here more details.
1301 \begin_layout Section
1302 Using the dialog for the first time
1305 \begin_layout Standard
1307 \begin_inset Flex CharStyle:Code
1310 \begin_layout Plain Layout
1316 file will contain only changes that you have made to the default behavior,
1317 some of which is hard-coded into LyX and some of which is contained in
1319 \begin_inset Flex CharStyle:Code
1322 \begin_layout Plain Layout
1323 LyXDir/lyxrc.defaults
1329 Note that in both files lines beginning with a
1330 \begin_inset Quotes eld
1334 \begin_inset Quotes erd
1337 are just comments and are not interpreted.
1338 However, only system administrators should edit
1339 \begin_inset Flex CharStyle:Code
1342 \begin_layout Plain Layout
1343 LyXDir/lyxrc.defaults
1349 Users should use the
1350 \begin_inset Flex CharStyle:MenuItem
1353 \begin_layout Plain Layout
1354 Tools\SpecialChar \menuseparator
1360 dialog to create and modify their own
1361 \begin_inset Flex CharStyle:Code
1364 \begin_layout Plain Layout
1373 \begin_layout Standard
1375 \begin_inset Flex CharStyle:MenuItem
1378 \begin_layout Plain Layout
1379 Tools\SpecialChar \menuseparator
1385 dialog will be largely self-explanatory.
1386 Most things in the dialog have associated `tool tips': hover your mouse
1387 pointer over something for more information.
1388 Before we highlight a few of the more important commands below, however,
1389 a word of warning: Applying some of your changes (e.g., screen fonts) will
1390 have an instant effect.
1392 changing the bind file) will not.
1393 If nothing appears to have changed, just
1394 \begin_inset Flex CharStyle:MenuItem
1397 \begin_layout Plain Layout
1403 the changes and restart LyX.
1406 \begin_layout Section
1410 \begin_layout Standard
1411 LyX has a powerful mechanism to convert to and from any file format using
1416 \begin_layout Subsection
1417 \begin_inset CommandInset label
1426 \begin_layout Standard
1427 The first step is to define your file formats if they are not already defined.
1429 \begin_inset Flex CharStyle:MenuItem
1432 \begin_layout Plain Layout
1433 Tools\SpecialChar \menuseparator
1434 Preferences\SpecialChar \menuseparator
1435 File Handling\SpecialChar \menuseparator
1443 \begin_inset Flex CharStyle:MenuItem
1446 \begin_layout Plain Layout
1447 New\SpecialChar \ldots{}
1453 button to define your new format.
1455 \begin_inset Flex CharStyle:MenuItem
1458 \begin_layout Plain Layout
1464 field contains the named used to identify the format in the GUI.
1466 \begin_inset Flex CharStyle:MenuItem
1469 \begin_layout Plain Layout
1475 is used to identify the format interally.
1476 You will also need to enter a file extension.
1477 These are all required.
1479 \begin_inset Flex CharStyle:MenuItem
1482 \begin_layout Plain Layout
1488 field is used to provide a keyboard shortcut on the menus.
1489 (For example, pressing
1490 \begin_inset Flex CharStyle:MenuItem
1493 \begin_layout Plain Layout
1500 \begin_inset Flex CharStyle:MenuItem
1503 \begin_layout Plain Layout
1504 View\SpecialChar \menuseparator
1513 \begin_layout Standard
1515 \begin_inset Flex CharStyle:MenuItem
1518 \begin_layout Plain Layout
1525 \begin_inset Flex CharStyle:MenuItem
1528 \begin_layout Plain Layout
1535 For example, you might want to use
1536 \begin_inset Flex CharStyle:MenuItem
1539 \begin_layout Plain Layout
1545 to view PostScript files.
1546 You can enter the command needed to start the program in the corresponding
1548 In defining this command, you can use the four variables listed in the
1550 The viewer is launched when you view an image in LyX or use the
1551 \begin_inset Flex CharStyle:MenuItem
1554 \begin_layout Plain Layout
1561 The editor is for example launched when you press the
1562 \begin_inset Flex CharStyle:MenuItem
1565 \begin_layout Plain Layout
1572 \begin_inset Flex CharStyle:MenuItem
1575 \begin_layout Plain Layout
1582 \begin_inset Flex CharStyle:MenuItem
1585 \begin_layout Plain Layout
1594 \begin_layout Standard
1596 \begin_inset Flex CharStyle:MenuItem
1599 \begin_layout Plain Layout
1605 option tells LyX that a format is suitable for document export.
1606 If this is is set and if a suitable conversion route exists (see
1607 \begin_inset CommandInset ref
1609 reference "sub:Converters"
1613 ), the format will appear in the
1614 \begin_inset Flex CharStyle:MenuItem
1617 \begin_layout Plain Layout
1618 File\SpecialChar \menuseparator
1625 The format will also appear in the
1626 \begin_inset Flex CharStyle:MenuItem
1629 \begin_layout Plain Layout
1635 menu if a viewer is specified for the format.
1636 Pure image formats, such as
1637 \begin_inset Flex CharStyle:Code
1640 \begin_layout Plain Layout
1646 , should not use this option.
1647 Formats that can both represent vector graphics and documents like
1648 \begin_inset Flex CharStyle:Code
1651 \begin_layout Plain Layout
1660 \begin_layout Standard
1662 \begin_inset Flex CharStyle:MenuItem
1665 \begin_layout Plain Layout
1666 Vector graphics format
1671 tells LyX that a format can contain vector graphics.
1672 This information is used to determine the target format of included graphics
1674 \begin_inset Flex CharStyle:MenuItem
1677 \begin_layout Plain Layout
1684 Included graphics may need to be converted to either
1685 \begin_inset Flex CharStyle:MenuItem
1688 \begin_layout Plain Layout
1695 \begin_inset Flex CharStyle:MenuItem
1698 \begin_layout Plain Layout
1705 \begin_inset Flex CharStyle:MenuItem
1708 \begin_layout Plain Layout
1715 \begin_inset Flex CharStyle:MenuItem
1718 \begin_layout Plain Layout
1724 cannot handle other image formats.
1725 If an included graphic is not already in
1726 \begin_inset Flex CharStyle:MenuItem
1729 \begin_layout Plain Layout
1736 \begin_inset Flex CharStyle:MenuItem
1739 \begin_layout Plain Layout
1746 \begin_inset Flex CharStyle:MenuItem
1749 \begin_layout Plain Layout
1755 format, it is converted to
1756 \begin_inset Flex CharStyle:MenuItem
1759 \begin_layout Plain Layout
1765 if the vector format option is set, and otherwise to
1766 \begin_inset Flex CharStyle:MenuItem
1769 \begin_layout Plain Layout
1778 \begin_layout Subsection
1782 \begin_layout Standard
1783 Since all conversions from one format to another take place in LyX's temporary
1784 directory, it is sometimes necessary to modify a file before copying it
1785 to the temporary directory in order that the conversion may be performed.
1789 \begin_layout Plain Layout
1790 For example, the file may refer to other files---images, for example---using
1791 relative file names, and these may become invalid when the file is copied
1792 to the temporary directory.
1797 This is done by a Copier: It copies a file to (or from) the temporary directory
1798 and may modify it in the process.
1801 \begin_layout Standard
1802 The definitions of the copiers may use four variables:
1805 \begin_layout Labeling
1806 \labelwidthstring 00.00.0000
1807 \begin_inset Flex CharStyle:Code
1810 \begin_layout Plain Layout
1816 The LyX system directory (e.
1817 \begin_inset space \thinspace{}
1821 \begin_inset space ~
1825 \begin_inset Flex CharStyle:MenuItem
1828 \begin_layout Plain Layout
1837 \begin_layout Labeling
1838 \labelwidthstring 00.00.0000
1839 \begin_inset Flex CharStyle:Code
1842 \begin_layout Plain Layout
1851 \begin_layout Labeling
1852 \labelwidthstring 00.00.0000
1853 \begin_inset Flex CharStyle:Code
1856 \begin_layout Plain Layout
1865 \begin_layout Labeling
1866 \labelwidthstring 00.00.0000
1867 \begin_inset Flex CharStyle:Code
1870 \begin_layout Plain Layout
1879 \begin_layout Standard
1880 The latter is to be given in a form suitable for inclusion in a LaTeX's
1887 command and is relevant only when exporting files suitable for such inclusion.
1890 \begin_layout Standard
1891 Copiers can be used to do almost anything with output files.
1892 For example, suppose you want generated pdf files to be copied to a special
1894 \begin_inset Flex CharStyle:Code
1897 \begin_layout Plain Layout
1904 Then you could write a shell script such as this one:
1907 \begin_layout Standard
1908 \begin_inset listings
1912 \begin_layout Plain Layout
1917 \begin_layout Plain Layout
1922 \begin_layout Plain Layout
1924 TOFILE=`basename $2`
1927 \begin_layout Plain Layout
1929 cp $FROMFILE /home/you/pdf/$TOFILE
1934 Save that in your local LyX directory---say,
1935 \begin_inset Flex CharStyle:Code
1938 \begin_layout Plain Layout
1939 /home/you/.lyx/scripts/pdfcopier.sh
1944 ---and make it executable, if you need to do so on your platform.
1946 \begin_inset Flex CharStyle:MenuItem
1949 \begin_layout Plain Layout
1950 Tools\SpecialChar \menuseparator
1957 \begin_inset Flex CharStyle:MenuItem
1960 \begin_layout Plain Layout
1966 format---or one of the other pdf formats---and enter
1967 \begin_inset Flex CharStyle:Code
1970 \begin_layout Plain Layout
1971 pdfcopier.sh $$i $$o
1977 \begin_inset Flex CharStyle:MenuItem
1980 \begin_layout Plain Layout
1990 \begin_layout Standard
1991 Copiers are used by LyX in various of its own conversions.
1992 For example, if appropriate programs are found, LyX will automatically
1993 install copiers for the
1994 \begin_inset Flex CharStyle:MenuItem
1997 \begin_layout Plain Layout
2004 \begin_inset Flex CharStyle:MenuItem
2007 \begin_layout Plain Layout
2009 \begin_inset space ~
2018 When these formats are exported, the copier sees that not just the main
2019 HTML file but various associated files (style files, images, etc.) are also
2021 All these files are written to a subdirectory of the directory in which
2022 the original LyX file was found.
2026 \begin_layout Plain Layout
2027 This copier can be customized.
2029 \begin_inset Quotes eld
2033 \begin_inset Quotes erd
2036 argument takes a comma-separated list of extensions to be copied; if it
2037 is omitted, all files will be copied.
2039 \begin_inset Quotes eld
2043 \begin_inset Quotes erd
2046 argument determines the extension added to the generated directory.
2048 \begin_inset Quotes eld
2052 \begin_inset Flex CharStyle:MenuItem
2055 \begin_layout Plain Layout
2062 \begin_inset Quotes erd
2065 , so HTML generated from
2066 \begin_inset Flex CharStyle:MenuItem
2069 \begin_layout Plain Layout
2070 /path/to/filename.lyx
2076 \begin_inset Flex CharStyle:MenuItem
2079 \begin_layout Plain Layout
2080 /path/to/filename.html.LyXconv
2094 \begin_layout Subsection
2095 \begin_inset CommandInset label
2097 name "sub:Converters"
2104 \begin_layout Standard
2105 You can define your own Converters to, uhh, convert files between different
2108 \begin_inset Flex CharStyle:MenuItem
2111 \begin_layout Plain Layout
2112 Tools\SpecialChar \menuseparator
2113 Preferences\SpecialChar \menuseparator
2114 File Handling\SpecialChar \menuseparator
2123 \begin_layout Standard
2124 To define a new converter, select the
2125 \begin_inset Flex CharStyle:MenuItem
2128 \begin_layout Plain Layout
2130 \begin_inset space ~
2139 \begin_inset space \thinspace{}
2143 \begin_inset Flex CharStyle:MenuItem
2146 \begin_layout Plain Layout
2148 \begin_inset space ~
2156 from the drop-down lists, enter the command needed for the conversion,
2158 \begin_inset Flex CharStyle:MenuItem
2161 \begin_layout Plain Layout
2168 Several variables can be used in the definition of converters:
2171 \begin_layout Labeling
2172 \labelwidthstring 00.00.0000
2173 \begin_inset Flex CharStyle:Code
2176 \begin_layout Plain Layout
2182 The LyX system directory
2185 \begin_layout Labeling
2186 \labelwidthstring 00.00.0000
2187 \begin_inset Flex CharStyle:Code
2190 \begin_layout Plain Layout
2199 \begin_layout Labeling
2200 \labelwidthstring 00.00.0000
2201 \begin_inset Flex CharStyle:Code
2204 \begin_layout Plain Layout
2213 \begin_layout Labeling
2214 \labelwidthstring 00.00.0000
2215 \begin_inset Flex CharStyle:Code
2218 \begin_layout Plain Layout
2224 The base filename of the input file (i.e., without the extension)
2227 \begin_layout Labeling
2228 \labelwidthstring 00.00.0000
2229 \begin_inset Flex CharStyle:Code
2232 \begin_layout Plain Layout
2238 The path to the input file
2241 \begin_layout Standard
2243 \begin_inset Flex CharStyle:MenuItem
2246 \begin_layout Plain Layout
2248 \begin_inset space ~
2256 field you can enter the following flags, separated by commas:
2259 \begin_layout Labeling
2260 \labelwidthstring 00.00.0000
2261 \begin_inset Flex CharStyle:Code
2264 \begin_layout Plain Layout
2270 This converter runs some form of LaTeX.
2271 This will make LyX's LaTeX error logs available.
2274 \begin_layout Labeling
2275 \labelwidthstring 00.00.0000
2276 \begin_inset Flex CharStyle:Code
2279 \begin_layout Plain Layout
2286 \begin_inset Flex CharStyle:MenuItem
2289 \begin_layout Plain Layout
2295 file for the conversion.
2298 \begin_layout Labeling
2299 \labelwidthstring 00.00.0000
2300 \begin_inset Flex CharStyle:Code
2303 \begin_layout Plain Layout
2312 \begin_layout Standard
2313 The following three flags are not really flags at all because they take
2315 \begin_inset Flex CharStyle:MenuItem
2318 \begin_layout Plain Layout
2320 \begin_inset space ~
2324 \begin_inset space ~
2335 \begin_layout Labeling
2336 \labelwidthstring 00.00.0000
2337 \begin_inset Flex CharStyle:Code
2340 \begin_layout Plain Layout
2346 If set, the converter's standard error will be redirected to a file
2347 \begin_inset Flex CharStyle:Code
2350 \begin_layout Plain Layout
2356 , and the script given as argument will be run as:
2357 \begin_inset Flex CharStyle:Code
2360 \begin_layout Plain Layout
2361 script <infile.out >infile.log
2367 The argument may contain
2368 \begin_inset Flex CharStyle:Code
2371 \begin_layout Plain Layout
2380 \begin_layout Labeling
2381 \labelwidthstring 00.00.0000
2382 \begin_inset Flex CharStyle:Code
2385 \begin_layout Plain Layout
2391 The name of the directory in which the converter will dump the generated
2393 LyX will not create this directory, and it does not copy anything into
2394 it, though it will copy this directory to the destination.
2395 The argument may contain
2396 \begin_inset Flex CharStyle:Code
2399 \begin_layout Plain Layout
2405 , which will be replaced by the base name of the input and output files,
2406 respectively, when the directory is copied.
2407 \begin_inset Newline newline
2410 Note that resultdir and usetempdir make no sense together.
2411 The latter will be ignored if the former is given.
2414 \begin_layout Labeling
2415 \labelwidthstring 00.00.0000
2416 \begin_inset Flex CharStyle:Code
2419 \begin_layout Plain Layout
2425 Determines the output file name and may, contain
2426 \begin_inset Flex CharStyle:Code
2429 \begin_layout Plain Layout
2436 Sensible only with resultdir and optional even then; if not given, it defaults
2440 \begin_layout Standard
2441 None of these last three are presently used in any of the converters that
2442 are installed with LyX.
2446 \begin_layout Standard
2447 You do not have to define converters between all the formats between which
2448 you want to convert.
2449 For example, you will note that there is no `LyX to PostScript®' converter,
2450 but LyX will export PostScript®.
2451 It does so by first creating a LaTeX file (no converter needs to be defined
2452 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2453 and finally converting the resulting DVI file to PostScript®.
2454 LyX finds such `chains' of converters automatically, and it will always
2455 choose the shortest possible chain.
2456 You can, though, still define multiple conversion methods between file
2458 For example, the standard LyX configuration provides three ways to convert
2459 LaTeX to PDF: Directly, using
2460 \begin_inset Flex CharStyle:MenuItem
2463 \begin_layout Plain Layout
2469 ; via (DVI and) PostScript®, using
2470 \begin_inset Flex CharStyle:MenuItem
2473 \begin_layout Plain Layout
2480 \begin_inset Flex CharStyle:MenuItem
2483 \begin_layout Plain Layout
2490 To define such alternate chains, you must define multiple target `file
2491 formats', as described in section
2492 \begin_inset CommandInset ref
2494 reference "sub:Formats"
2499 For example, in the standard configuration, the formats named
2500 \begin_inset Flex CharStyle:MenuItem
2503 \begin_layout Plain Layout
2510 \begin_inset Flex CharStyle:MenuItem
2513 \begin_layout Plain Layout
2520 \begin_inset Flex CharStyle:MenuItem
2523 \begin_layout Plain Layout
2529 are defined, all of which share the extension
2530 \begin_inset Flex CharStyle:MenuItem
2533 \begin_layout Plain Layout
2539 , and which correspond to the conversion methods just mentioned.
2542 \begin_layout Chapter
2543 Internationalizing LyX
2544 \begin_inset CommandInset label
2553 \begin_layout Standard
2554 LyX supports using a translated interface.
2555 Last time we checked, LyX provided text in thirty languages.
2556 The language of choice is called your
2561 (For further reading on locale settings, see also the documentation for
2562 locale that comes with your operating system.
2563 For Linux, the manual page for
2564 \begin_inset Flex CharStyle:Code
2567 \begin_layout Plain Layout
2573 could be a good place to start).
2576 \begin_layout Standard
2577 Notice that these translations will work, but do contain a few flaws.
2578 In particular, all dialogs have been designed with the English text in
2579 mind, which means that some of the translated text will be too large to
2580 fit within the space allocated.
2581 This is only a display problem and will not cause any harm.
2582 Also, you will find that some of the translations do not define shortcut
2583 keys for everything.
2584 Sometimes, there are simply not enough free letters to do it.
2585 Other times, the translator just hasn't got around to doing it yet.
2586 Our localization team, which you may wish to join,
2590 \begin_layout Plain Layout
2591 If you are a fluent speaker of a language other than English, joining these
2592 teams is a great way to give back to the LyX community!
2597 will of course try to fix these shortcomings in future versions of LyX.
2600 \begin_layout Section
2604 \begin_layout Subsection
2605 Translating the graphical user interface (text messages).
2608 \begin_layout Standard
2610 \begin_inset Flex CharStyle:Code
2613 \begin_layout Plain Layout
2619 library to handle the internationalization of the interface.
2620 To have LyX speak your favorite language in all menus and dialogs, you
2622 \begin_inset Flex CharStyle:Code
2625 \begin_layout Plain Layout
2631 -file for that language.
2632 When this is available, you'll have to generate a
2633 \begin_inset Flex CharStyle:Code
2636 \begin_layout Plain Layout
2642 -file from it and install the
2643 \begin_inset Flex CharStyle:Code
2646 \begin_layout Plain Layout
2653 The process of doing all of this is explained in the documentation for
2655 \begin_inset Flex CharStyle:Code
2658 \begin_layout Plain Layout
2665 It is possible to do this just for yourself, but if you're going to do
2666 it, you might as well share the results of your labors with the rest of
2668 Send a message to the LyX developers' list for more information about how
2672 \begin_layout Standard
2673 In short, this is what you should do (xx denotes the language code):
2676 \begin_layout Itemize
2677 Check out the LyX source code.
2679 \begin_inset CommandInset href
2681 name "information on the web"
2682 target "http://www.lyx.org/devel/cvs.php"
2689 \begin_layout Itemize
2691 \begin_inset Flex CharStyle:Code
2694 \begin_layout Plain Layout
2700 to the folder of the
2701 \begin_inset Flex CharStyle:Code
2704 \begin_layout Plain Layout
2712 \begin_inset Flex CharStyle:Code
2715 \begin_layout Plain Layout
2723 \begin_inset Flex CharStyle:Code
2726 \begin_layout Plain Layout
2732 doesn't exist anywhere, it can be remade with the console command
2733 \begin_inset Flex CharStyle:Code
2736 \begin_layout Plain Layout
2742 in that directory, or you can use an existing po-file for some other language
2746 \begin_layout Itemize
2748 \begin_inset Flex CharStyle:Code
2751 \begin_layout Plain Layout
2761 \begin_layout Plain Layout
2762 This is just a text file, so it can be edited in any text editor.
2763 But there are also specialized programs that support such editing, such
2768 (for all platforms) or
2777 contains a `mode' for editing
2778 \begin_inset Flex CharStyle:Code
2781 \begin_layout Plain Layout
2792 For some menu- and widget-labels, there are also shortcut keys that should
2794 Those keys are marked after a `|', and should be translated according to
2795 the words and phrases of the language.
2796 You should also fill also out the information at the beginning of the new
2798 \begin_inset Flex CharStyle:Code
2801 \begin_layout Plain Layout
2807 -file with your email-address, etc., so people know where to reach you with
2808 suggestions and entertaining flames.
2811 \begin_layout Standard
2812 If you are just doing this on your own, then:
2815 \begin_layout Itemize
2817 \begin_inset Flex CharStyle:Code
2820 \begin_layout Plain Layout
2827 This can be done with
2828 \begin_inset Flex CharStyle:Code
2831 \begin_layout Plain Layout
2832 msgfmt -o xx.mo < xx.po
2840 \begin_layout Itemize
2842 \begin_inset Flex CharStyle:Code
2845 \begin_layout Plain Layout
2851 -file to your locale-tree, at the correct directory for application messages
2856 xx, and under the name
2857 \begin_inset Flex CharStyle:Code
2860 \begin_layout Plain Layout
2868 \begin_inset Flex CharStyle:Code
2871 \begin_layout Plain Layout
2872 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2882 \begin_layout Standard
2883 As said, however, it would be best if the new
2884 \begin_inset Flex CharStyle:Code
2887 \begin_layout Plain Layout
2893 -file could be added to the LyX distribution, so others can use it.
2894 Adding it involves making additional changes to LyX.
2895 So send an email to the developers' mailing list if you're interested in
2899 \begin_layout Subsubsection
2903 \begin_layout Standard
2904 Sometimes it turns out that one English message needs to be translated into
2905 different messages in the target language.
2906 One example is the message
2907 \begin_inset Flex CharStyle:Code
2910 \begin_layout Plain Layout
2916 which has the German translation
2924 , depending upon exactly what the English
2925 \begin_inset Quotes eld
2929 \begin_inset Quotes erd
2934 \begin_inset Flex CharStyle:Code
2937 \begin_layout Plain Layout
2943 does not handle such ambigous translations.
2944 Therefore you have to add some context information to the message: Instead
2946 \begin_inset Flex CharStyle:Code
2949 \begin_layout Plain Layout
2956 \begin_inset Flex CharStyle:Code
2959 \begin_layout Plain Layout
2960 To[[as in 'From format x to format y']]
2966 \begin_inset Flex CharStyle:Code
2969 \begin_layout Plain Layout
2970 To[[as in 'From page x to page y']].
2975 Now the two occurences of
2976 \begin_inset Flex CharStyle:Code
2979 \begin_layout Plain Layout
2986 \begin_inset Flex CharStyle:Code
2989 \begin_layout Plain Layout
2995 and can be translated correctly to
3006 \begin_layout Standard
3007 Of course the context information needs to be stripped off the original
3008 message when no translation is used.
3009 Therefore you have to put it in double square brackets at the end of the
3010 message (see the example above).
3011 The translation mechanism of LyX ensures that everything in double square
3012 brackets at the end of messages is removed before displaying the message.
3015 \begin_layout Subsection
3016 Translating the documentation.
3019 \begin_layout Standard
3020 The online documentation (in the
3021 \begin_inset Flex CharStyle:MenuItem
3024 \begin_layout Plain Layout
3034 -menu) can (and should!) be translated.
3035 If there are translated versions of the documentation available
3039 \begin_layout Plain Layout
3040 As of March 2008, at least some of the documents have been translated into
3041 fourteen languages, with the Tutorial available in a few more.
3046 and the locale is set accordingly, these will be used automagically by
3048 LyX looks for translated versions as
3049 \begin_inset Flex CharStyle:Code
3052 \begin_layout Plain Layout
3053 LyXDir/doc/xx_DocName.lyx
3059 \begin_inset Flex CharStyle:Code
3062 \begin_layout Plain Layout
3068 is the code for the language currently in use.
3069 If there are no translated documents, the default English versions will
3071 Note that the translated versions must have the same filenames (
3072 \begin_inset Flex CharStyle:Code
3075 \begin_layout Plain Layout
3081 above) as the original.
3082 If you feel up to translating the documentation (an excellent way to proof-read
3083 the original documentation by the way!), there are a few things you should
3087 \begin_layout Itemize
3089 \begin_inset Flex CharStyle:Code
3092 \begin_layout Plain Layout
3098 , the guide to writing LyX documentation.
3099 Pay special attention to the translator's section.
3102 \begin_layout Itemize
3103 Check out the documentation translation web page at
3104 \change_deleted 1 1223267367
3106 \begin_inset CommandInset href
3108 name "http://www.devel.lyx.org"
3109 target "http://www.devel.lyx.org"
3114 \change_inserted 1 1223267381
3116 \begin_inset CommandInset href
3118 name "http://www.lyx.org/Translation"
3119 target "http://www.lyx.org/Translation"
3126 That way, you can find out which (if any) documents have already been translate
3127 d into your language.
3128 You can also find out who (if anyone) is organizing the effort to translate
3129 the documentation into your language.
3130 If no one is organizing the effort, please let us know that you're interested.
3133 \begin_layout Standard
3134 Once you get to actually translating, here's a few hints for you that may
3138 \begin_layout Itemize
3139 Join the documentation team! There is information on how to do that in
3140 \begin_inset Flex CharStyle:Code
3143 \begin_layout Plain Layout
3150 \begin_inset Flex CharStyle:MenuItem
3153 \begin_layout Plain Layout
3158 elp\SpecialChar \menuseparator
3168 ), which by the way is the first document you should translate.
3171 \begin_layout Itemize
3172 Learn the typographic conventions for the language you are translating to.
3173 Typography is an ancient art and over the centuries, a great variety of
3174 conventions have developed throughout different parts of the world.
3175 Also study the professional terminology amongst typographers in your country.
3176 Inventing your own terminology will only confuse the users.
3179 (Warning! Typography is addictive!)
3182 \begin_layout Itemize
3183 Make a copy of the document.
3184 This will be your working copy.
3185 You can use this as your personal translated help-file by placing it in
3187 \begin_inset Flex CharStyle:Code
3190 \begin_layout Plain Layout
3199 \begin_layout Itemize
3200 Sometimes the original document (from the LyX-team) will be updated.
3201 Use the source viewer at
3202 \begin_inset CommandInset href
3204 name "http://www.lyx.org/trac/timeline"
3205 target "http://www.lyx.org/trac/timeline"
3209 to see what has been changed.
3210 That way you can easily see which parts of the translated document need
3214 \begin_layout Standard
3215 If you ever find an error in the original document, fix it and notify the
3216 rest of the documentation team of the changes! (You didn't forget to join
3217 the documentation team, did you?)
3220 \begin_layout Standard
3221 \begin_inset Branch OutDated
3224 \begin_layout Section
3225 International Keyboard Support
3228 \begin_layout Standard
3231 [Editor's Note: The following section is by
3239 It needs to be fixed to conform to the new Documentation Style sheet and
3240 to make use of the new v1.0 features.
3241 The whole thing also needs to be merged with the section following it.-jw
3242 It may also be badly out of date.-rh (2008)]
3245 \begin_layout Subsection
3246 Defining Own Keymaps: Keymap File Format
3249 \begin_layout Standard
3250 Let's look at a keyboard definition file a little closer.
3251 It is a plain text file defining
3254 \begin_layout Itemize
3255 key-to-key or key-to-string translations
3258 \begin_layout Itemize
3262 \begin_layout Itemize
3263 dead keys exceptions
3266 \begin_layout Standard
3267 To define key-to-key or key-to-string translation, use this command:
3270 \begin_layout Quotation
3271 \begin_inset Flex CharStyle:Code
3274 \begin_layout Plain Layout
3283 \begin_inset Flex CharStyle:Code
3286 \begin_layout Plain Layout
3295 \begin_layout Standard
3297 \begin_inset Flex CharStyle:Code
3300 \begin_layout Plain Layout
3306 is the key to be translated and
3307 \begin_inset Flex CharStyle:Code
3310 \begin_layout Plain Layout
3316 is the string to be inserted into the document.
3317 To define dead keys, use:
3320 \begin_layout Quotation
3321 \begin_inset Flex CharStyle:Code
3324 \begin_layout Plain Layout
3333 \begin_inset Flex CharStyle:Code
3336 \begin_layout Plain Layout
3345 \begin_layout Standard
3347 \begin_inset Flex CharStyle:Code
3350 \begin_layout Plain Layout
3356 is a keyboard key and
3357 \begin_inset Flex CharStyle:Code
3360 \begin_layout Plain Layout
3367 The following dead keys are supported (shortcut name is in parentheses):
3370 \begin_layout Quotation
3374 \begin_inset space \hfill{}
3380 \begin_layout Quotation
3382 \begin_inset space \hfill{}
3388 \begin_layout Quotation
3390 \begin_inset space \hfill{}
3396 \begin_layout Quotation
3398 \begin_inset space \hfill{}
3404 \begin_layout Quotation
3406 \begin_inset space \hfill{}
3412 \begin_layout Quotation
3414 \begin_inset space \hfill{}
3421 \begin_layout Plain Layout
3433 \begin_layout Quotation
3435 \begin_inset space \hfill{}
3441 \begin_layout Quotation
3443 \begin_inset space \hfill{}
3450 \begin_layout Plain Layout
3462 \begin_layout Quotation
3464 \begin_inset space \hfill{}
3470 \begin_layout Quotation
3472 \begin_inset space \hfill{}
3478 \begin_layout Quotation
3480 \begin_inset space \hfill{}
3487 \begin_layout Plain Layout
3499 \begin_layout Quotation
3501 \begin_inset space \hfill{}
3508 \begin_layout Plain Layout
3520 \begin_layout Quotation
3522 \begin_inset space \hfill{}
3528 \begin_layout Quotation
3529 hungarian umlaut (hug)
3530 \begin_inset space \hfill{}
3536 \begin_layout Quotation
3538 \begin_inset space \hfill{}
3544 \begin_layout Quotation
3546 \begin_inset space \hfill{}
3553 \begin_layout Plain Layout
3565 \begin_layout Standard
3566 Since in many international keyboards there are exceptions to what some
3567 dead keys should do, you can define them using
3570 \begin_layout Quotation
3571 \begin_inset Flex CharStyle:Code
3574 \begin_layout Plain Layout
3582 deadkey key outstring
3585 \begin_layout Standard
3586 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3590 \begin_layout Quotation
3591 \begin_inset Flex CharStyle:Code
3594 \begin_layout Plain Layout
3607 \begin_layout Standard
3608 to make it work correctly.
3609 Also, you have to define as exceptions dead keys over i and j, to remove
3610 the dot from them before inserting an accent mark.
3611 I will change this when the time comes, but so far I haven't had time.
3614 \begin_layout Standard
3615 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3618 \begin_inset Flex CharStyle:Code
3621 \begin_layout Plain Layout
3627 have different meaning.
3629 \begin_inset Flex CharStyle:Code
3632 \begin_layout Plain Layout
3638 marks comments, quotes start and end LaTeX-style commands.
3639 To enter quote, you'll need to use
3640 \begin_inset Flex CharStyle:Code
3643 \begin_layout Plain Layout
3652 \begin_inset Flex CharStyle:Code
3655 \begin_layout Plain Layout
3662 \begin_inset Flex CharStyle:Code
3665 \begin_layout Plain Layout
3676 \begin_layout Standard
3677 If you make a keyboard description file that works for your language, please
3678 mail it to me, so I can include it in the next keymap distribution.
3681 \begin_layout Standard
3682 More keywords will be supported in keymap configuration file in future,
3686 \begin_layout Itemize
3687 \begin_inset Flex CharStyle:Code
3690 \begin_layout Plain Layout
3701 \begin_inset space \hfill{}
3705 \begin_inset Flex CharStyle:Code
3708 \begin_layout Plain Layout
3717 \begin_layout Itemize
3718 \begin_inset Flex CharStyle:Code
3721 \begin_layout Plain Layout
3732 \begin_inset space \hfill{}
3736 \begin_inset Flex CharStyle:Code
3739 \begin_layout Plain Layout
3745 an external keymap translation program
3748 \begin_layout Standard
3749 Also, it should look into
3750 \begin_inset Flex CharStyle:Code
3753 \begin_layout Plain Layout
3759 file for defaults, too (for example, a
3760 \begin_inset Flex CharStyle:Code
3763 \begin_layout Plain Layout
3771 option to include default keyboard).
3779 \begin_layout Section
3780 \begin_inset CommandInset label
3786 International Keymap Stuff
3789 \begin_layout Standard
3790 \begin_inset Note Note
3793 \begin_layout Plain Layout
3794 In doing the revisions on this document in March 2008, I did not look over
3795 this stuff, as I do not understand it.
3796 It would be good if someone else could do so.
3804 \begin_layout Standard
3805 The next two sections describe the
3806 \begin_inset Flex CharStyle:Code
3809 \begin_layout Plain Layout
3818 \begin_inset Flex CharStyle:Code
3821 \begin_layout Plain Layout
3829 file syntax in detail.
3830 These sections should help you design your own key map if the ones provided
3831 do not meet your needs.
3834 \begin_layout Subsection
3838 \begin_layout Standard
3842 \begin_inset Flex CharStyle:Code
3845 \begin_layout Plain Layout
3851 file maps keystrokes to characters or strings.
3852 As the name suggests, it sets a keyboard mapping.
3854 \begin_inset Flex CharStyle:Code
3857 \begin_layout Plain Layout
3868 \begin_inset Flex CharStyle:Code
3871 \begin_layout Plain Layout
3886 \begin_inset Flex CharStyle:Code
3889 \begin_layout Plain Layout
3902 \begin_inset Flex CharStyle:Code
3905 \begin_layout Plain Layout
3914 \begin_inset Flex CharStyle:Code
3917 \begin_layout Plain Layout
3925 are described in this section.
3928 \begin_layout Labeling
3929 \labelwidthstring 00.00.0000
3930 \begin_inset Flex CharStyle:Code
3933 \begin_layout Plain Layout
3941 Map a character to a string
3944 \begin_layout LyX-Code
3959 \begin_layout Standard
3992 the double-quote (")
4009 must be escaped with a preceding backslash (
4020 \begin_layout Standard
4022 \begin_inset Flex CharStyle:MenuItem
4025 \begin_layout Plain Layout
4033 statement to cause the symbol
4034 \begin_inset Flex CharStyle:MenuItem
4037 \begin_layout Plain Layout
4045 to be output for the keystroke
4046 \begin_inset Flex CharStyle:MenuItem
4049 \begin_layout Plain Layout
4060 \begin_layout LyX-Code
4066 \begin_layout Labeling
4067 \labelwidthstring 00.00.0000
4068 \begin_inset Flex CharStyle:Code
4071 \begin_layout Plain Layout
4079 Specify an accent character
4082 \begin_layout LyX-Code
4091 \begin_layout Standard
4092 This will make the cha
4130 This is the dead key
4134 \begin_layout Plain Layout
4141 refers to a key that does not produce a character by itself, but when followed
4142 with another key, produces the desired accent character.
4143 For example, a German characte
4145 r with an umlaut like
4155 can be produced in this manner.
4164 \begin_layout Standard
4177 and then another key not in
4194 followed by the other, unallowed key, as output.
4198 \begin_inset Flex CharStyle:MenuItem
4201 \begin_layout Plain Layout
4209 cancels a dead key, so if
4220 \begin_inset Flex CharStyle:MenuItem
4223 \begin_layout Plain Layout
4232 , the cursor will not go one position backwards but will instead cancel
4248 might have had on the next keystroke.
4252 \begin_layout Standard
4253 The following example specifies that the character ' is to be an acute accent,
4254 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4257 \begin_layout LyX-Code
4260 kmod ' acute aeiouAEIOU
4263 \begin_layout Labeling
4264 \labelwidthstring 00.00.0000
4265 \begin_inset Flex CharStyle:Code
4268 \begin_layout Plain Layout
4274 Specify an exception to the accent character
4277 \begin_layout LyX-Code
4286 \begin_layout Standard
4287 This defines an exce
4328 have been assigned a keystroke with a previous
4331 \begin_inset Flex CharStyle:Code
4334 \begin_layout Plain Layout
4358 must not belong in the
4410 If such a declaration does not exist in
4418 \begin_inset Flex CharStyle:Code
4421 \begin_layout Plain Layout
4461 \begin_inset Flex CharStyle:Code
4464 \begin_layout Plain Layout
4478 \begin_layout Standard
4479 The following command produces causes äi to be produced when you enter acute-i
4483 \begin_layout LyX-Code
4497 \begin_layout Labeling
4498 \labelwidthstring 00.00.0000
4499 \begin_inset Flex CharStyle:Code
4502 \begin_layout Plain Layout
4508 Combine two accent characters
4511 \begin_layout LyX-Code
4517 accent1 accent2 allowed
4520 \begin_layout Standard
4521 This one is getting pretty esoteric.
4522 It allows you to combine the effect
4578 \begin_inset Flex CharStyle:Code
4581 \begin_layout Plain Layout
4609 \begin_layout Standard
4610 Consider this example from the
4611 \begin_inset Flex CharStyle:Code
4614 \begin_layout Plain Layout
4625 \begin_layout LyX-Code
4628 kmod ; acute aeioyvhAEIOYVH
4632 kcomb acute umlaut iyIY
4635 \begin_layout Standard
4636 This allows you to press
4637 \begin_inset Flex CharStyle:MenuItem
4640 \begin_layout Plain Layout
4648 and get the effect of
4649 \begin_inset Flex CharStyle:Code
4652 \begin_layout Plain Layout
4671 in this case cancels the last dead key, so if you press
4672 \begin_inset Flex CharStyle:MenuItem
4675 \begin_layout Plain Layout
4684 \begin_inset Flex CharStyle:Code
4687 \begin_layout Plain Layout
4700 \begin_layout Subsection
4704 \begin_layout Standard
4706 \begin_inset Flex CharStyle:Code
4709 \begin_layout Plain Layout
4717 mapping is performed, a
4718 \begin_inset Flex CharStyle:Code
4721 \begin_layout Plain Layout
4731 file maps the strings that the symbols generate to characters in the current
4733 The LyX distribution currently includes at least the
4734 \begin_inset Flex CharStyle:Code
4737 \begin_layout Plain Layout
4746 \begin_inset Flex CharStyle:Code
4749 \begin_layout Plain Layout
4760 \begin_layout Standard
4762 \begin_inset Flex CharStyle:Code
4765 \begin_layout Plain Layout
4773 file is a sequence of declarations of the form
4776 \begin_layout LyX-Code
4789 \begin_layout Standard
4790 For example, in order to map
4791 \begin_inset Flex CharStyle:MenuItem
4794 \begin_layout Plain Layout
4804 to the corresponding character in the iso-8859-1 set (233), the following
4808 \begin_layout LyX-Code
4816 \begin_layout Standard
4818 \begin_inset Flex CharStyle:Code
4821 \begin_layout Plain Layout
4830 \begin_inset Flex CharStyle:Code
4833 \begin_layout Plain Layout
4851 the same character can apply to more than one string.
4853 \begin_inset Flex CharStyle:Code
4856 \begin_layout Plain Layout
4867 \begin_layout LyX-Code
4879 \begin_inset Newline newline
4895 \begin_layout Standard
4896 If LyX cannot find a mapping for the string produced by the keystroke or
4897 a deadkey sequence, it will check if it looks like an accented char and
4898 try to draw an accent over the character on screen.
4901 \begin_layout Subsection
4905 \begin_layout Standard
4906 There is a second way to add support for international characters through
4907 so-called dead-keys.
4908 A dead-key works in combination with a letter to produce an accented character.
4909 Here, we'll explain how to create a really simple dead-key to illustrate
4913 \begin_layout Standard
4914 Suppose you happen to need the circumflex character,
4915 \begin_inset Quotes eld
4919 \begin_inset Quotes erd
4924 \begin_inset Flex CharStyle:MenuItem
4927 \begin_layout Plain Layout
4934 \begin_inset space ~
4938 \begin_inset Flex CharStyle:MenuItem
4941 \begin_layout Plain Layout
4947 ] to the LyX command
4948 \begin_inset Flex CharStyle:Code
4951 \begin_layout Plain Layout
4958 \begin_inset Flex CharStyle:Code
4961 \begin_layout Plain Layout
4968 Now, whenever you type the
4969 \begin_inset Flex CharStyle:MenuItem
4972 \begin_layout Plain Layout
4978 -key followed by a letter, that letter will have a circumflex accent on
4980 For example, the sequence
4981 \begin_inset Quotes eld
4985 \begin_inset Flex CharStyle:MenuItem
4988 \begin_layout Plain Layout
4995 \begin_inset Quotes erd
4998 produces the letter:
4999 \begin_inset Quotes eld
5003 \begin_inset Quotes erd
5007 If you tried to type
5008 \begin_inset Quotes eld
5012 \begin_inset Flex CharStyle:MenuItem
5015 \begin_layout Plain Layout
5022 \begin_inset Quotes erd
5025 , however, LyX will complain with a beep, since a
5026 \begin_inset Quotes eld
5030 \begin_inset Flex CharStyle:MenuItem
5033 \begin_layout Plain Layout
5040 \begin_inset Quotes erd
5043 never takes a circumflex accent.
5045 \begin_inset Flex CharStyle:MenuItem
5048 \begin_layout Plain Layout
5054 after a dead-key produces the bare-accent.
5055 Please note this last point! If you bind a key to a dead-key, you'll need
5056 to rebind the character on that key to yet another key.
5058 \begin_inset Flex CharStyle:MenuItem
5061 \begin_layout Plain Layout
5067 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5070 \begin_layout Standard
5071 One common way to bind dead-keys is to use
5072 \begin_inset Flex CharStyle:MenuItem
5075 \begin_layout Plain Layout
5082 \begin_inset Flex CharStyle:MenuItem
5085 \begin_layout Plain Layout
5092 \begin_inset Flex CharStyle:MenuItem
5095 \begin_layout Plain Layout
5101 in combination with an accent, like
5102 \begin_inset Quotes eld
5106 \begin_inset Flex CharStyle:MenuItem
5109 \begin_layout Plain Layout
5116 \begin_inset Quotes erd
5120 \begin_inset Quotes eld
5124 \begin_inset Flex CharStyle:MenuItem
5127 \begin_layout Plain Layout
5134 \begin_inset Quotes erd
5138 \begin_inset Quotes eld
5142 \begin_inset Flex CharStyle:MenuItem
5145 \begin_layout Plain Layout
5152 \begin_inset Quotes erd
5156 Another way involves using
5157 \begin_inset Flex CharStyle:Code
5160 \begin_layout Plain Layout
5167 \begin_inset Flex CharStyle:Code
5170 \begin_layout Plain Layout
5176 to set up the special
5177 \begin_inset Flex CharStyle:Code
5180 \begin_layout Plain Layout
5188 \begin_inset Flex CharStyle:Code
5191 \begin_layout Plain Layout
5197 acts in some ways just like
5198 \begin_inset Flex CharStyle:MenuItem
5201 \begin_layout Plain Layout
5207 and permits you to bind keys to accented characters.
5208 You can also turn keys into dead-keys by binding them to something like
5210 \begin_inset Flex CharStyle:Code
5213 \begin_layout Plain Layout
5219 and then binding this symbolic key to the corresponding LyX command.
5223 \begin_layout Plain Layout
5228 : This is exactly what I do in my
5229 \begin_inset Flex CharStyle:Code
5232 \begin_layout Plain Layout
5239 \begin_inset Flex CharStyle:Code
5242 \begin_layout Plain Layout
5250 \begin_inset Flex CharStyle:MenuItem
5253 \begin_layout Plain Layout
5255 \begin_inset space ~
5264 \begin_inset Flex CharStyle:Code
5267 \begin_layout Plain Layout
5273 and a bunch of these
5274 \begin_inset Quotes eld
5278 \begin_inset Flex CharStyle:Code
5281 \begin_layout Plain Layout
5288 \begin_inset Quotes erd
5291 symbolic keys bound such things as
5292 \begin_inset Flex CharStyle:MenuItem
5295 \begin_layout Plain Layout
5297 \begin_inset space ~
5306 \begin_inset Flex CharStyle:MenuItem
5309 \begin_layout Plain Layout
5311 \begin_inset space ~
5320 This is how I produce my accented characters.
5325 You can make just about anything into the
5326 \begin_inset Flex CharStyle:Code
5329 \begin_layout Plain Layout
5336 \begin_inset Flex CharStyle:MenuItem
5339 \begin_layout Plain Layout
5345 keys, a spare function key, etc.
5346 As for the LyX commands that produce accents, check the entry for
5347 \begin_inset Flex CharStyle:Code
5350 \begin_layout Plain Layout
5361 You'll find the complete list there.
5364 \begin_layout Subsection
5365 Saving your Language Configuration
5368 \begin_layout Standard
5369 You can edit your preferences so that your desired language environment
5370 is automatically configured when LyX starts up, via the
5371 \begin_inset Flex CharStyle:MenuItem
5374 \begin_layout Plain Layout
5379 dit\SpecialChar \menuseparator
5392 \begin_layout Chapter
5393 Installing New Document Classes, Layouts, and Templates
5394 \begin_inset CommandInset label
5396 name "chap:textclass"
5404 \begin_layout Plain Layout
5405 Installing New Document Classes
5413 \begin_layout Standard
5414 In this chapter, we describe the procedures for creating and installing
5415 new LyX layout and template files, as well as offer a refresher on correctly
5416 installing new LaTeX document classes.
5417 Some definitions: a document class is a LaTeX file (usually ending in
5418 \begin_inset Flex CharStyle:Code
5421 \begin_layout Plain Layout
5428 \begin_inset Flex CharStyle:Code
5431 \begin_layout Plain Layout
5437 ) that describes the format of a document such as an article, report, journal
5438 preprint, etc, and all the commands needed to realize that format.
5439 A layout file is a LyX file that corresponds to a LaTeX document class
5440 and that tells LyX how to
5441 \begin_inset Quotes eld
5445 \begin_inset Quotes erd
5448 things on the screen to make the display look something like the final
5450 More precisely, a layout file describes a
5451 \begin_inset Quotes eld
5455 \begin_inset Quotes erd
5458 which is the internal construct LyX uses to render the screen display.
5460 \begin_inset Quotes eld
5464 \begin_inset Quotes erd
5468 \begin_inset Quotes eld
5472 \begin_inset Quotes erd
5475 can be used somewhat interchangeably, but it is better to refer to the
5476 file as the layout, and the thing living in LyX's memory as the text class.
5477 A template file is simply a LyX document that contains a set of predefined
5478 entries for a given document class---entries that are generally required
5480 Templates are especially useful for things like journal manuscripts that
5481 are to be submitted electronically.
5484 \begin_layout Section
5485 Installing a new LaTeX package
5488 \begin_layout Standard
5489 Some installations may not include a LaTeX package that you would like to
5491 For example, you might need FoilTeX, a package for preparing slides or
5492 viewgraphs for overhead projectors.
5493 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5494 a user interface for that.
5495 For example on MiKTeX you start its program
5496 \begin_inset Quotes eld
5500 \begin_inset Quotes erd
5503 to get a list of available packages.
5504 To install one, right click on it or use the installing toolbar button.
5505 When the package you want to install is not in the list, but you have it
5507 \begin_inset Flex CharStyle:Code
5510 \begin_layout Plain Layout
5517 \begin_inset Flex CharStyle:Code
5520 \begin_layout Plain Layout
5526 -file, then copy these files to a subfolder of your LaTeX distribution,
5527 for example to the folder
5536 Then update the file name database of your LaTeX-distribution.
5537 For example on MiKTeX this is done by pressing the button
5540 \begin_inset space ~
5545 that you find in MiKTeX's
5546 \begin_inset Quotes eld
5550 \begin_inset Quotes erd
5554 In both cases you need afterwards to reconfigure LyX using the menu
5555 \begin_inset Flex CharStyle:MenuItem
5558 \begin_layout Plain Layout
5559 Tools\SpecialChar \menuseparator
5565 and then to restart LyX.
5568 \begin_layout Standard
5569 If your LaTeX distribution doesn't provide a user interface, then you can
5570 follow these steps by using a UNIX/Linux console.
5573 \begin_layout Enumerate
5574 Get the package from
5575 \begin_inset CommandInset href
5578 target "http://www.ctan.org/"
5585 \begin_layout Enumerate
5586 You can install this package in several different places.
5587 If you want it to be available for all users on your system, then you should
5588 install it in your `local' TeX tree; if you want (or need) it to be available
5589 just for you, then you can install it in your own `user' TeX tree.
5590 Where these should be created, if they do not already exist, depends upon
5591 the details of your system.
5592 To find out, look in the file
5593 \begin_inset Flex CharStyle:Code
5596 \begin_layout Plain Layout
5606 \begin_layout Plain Layout
5607 This usually lives in the directory
5608 \begin_inset Flex CharStyle:Code
5611 \begin_layout Plain Layout
5617 , though you can run
5618 \begin_inset Flex CharStyle:Code
5621 \begin_layout Plain Layout
5632 The location of the `local' TeX tree is defined by
5633 \begin_inset Flex CharStyle:Code
5636 \begin_layout Plain Layout
5642 ; this is usually somewhere like
5643 \begin_inset Flex CharStyle:Code
5646 \begin_layout Plain Layout
5647 /usr/local/share/texmf/
5653 The `user' TeX tree is defined by
5654 \begin_inset Flex CharStyle:Code
5657 \begin_layout Plain Layout
5664 \begin_inset Flex CharStyle:Code
5667 \begin_layout Plain Layout
5674 (If these variables are not predefined, you can define them.) You'll probably
5675 need root permissions to create or modify the `local' tree; but your `user'
5676 tree shouldn't have such limitations.
5679 \begin_layout Enumerate
5681 \begin_inset Flex CharStyle:Code
5684 \begin_layout Plain Layout
5691 \begin_inset Flex CharStyle:Code
5694 \begin_layout Plain Layout
5701 \begin_inset Flex CharStyle:Code
5704 \begin_layout Plain Layout
5711 \begin_inset Newline newline
5715 \begin_inset Flex CharStyle:Code
5718 \begin_layout Plain Layout
5719 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5725 \begin_inset Newline newline
5728 But, again, most of this will
5729 \begin_inset Quotes eld
5733 \begin_inset Quotes erd
5739 \begin_layout Enumerate
5744 \begin_layout Plain Layout
5745 We'll assume henceforth that you're defining `local' TeX tree.
5746 If you're defining a user tree, just adjust as necessary.
5752 You must follow the directory structure of your existing
5753 \begin_inset Flex CharStyle:Code
5756 \begin_layout Plain Layout
5762 directory, which will be found at
5763 \begin_inset Flex CharStyle:Code
5766 \begin_layout Plain Layout
5773 For example, latex packages should go under
5774 \begin_inset Flex CharStyle:Code
5777 \begin_layout Plain Layout
5778 $TEXMFLOCAL/tex/latex/
5786 \begin_layout Enumerate
5787 Install the package.
5788 For example, you would unpack the FoilTeX tarball and copy it to
5789 \begin_inset Flex CharStyle:Code
5792 \begin_layout Plain Layout
5793 $TEXMFLOCAL/tex/latex/foiltex
5800 \begin_inset Flex CharStyle:Code
5803 \begin_layout Plain Layout
5809 directory contains various files.
5812 \begin_layout Enumerate
5814 \begin_inset Flex CharStyle:Code
5817 \begin_layout Plain Layout
5825 \begin_inset Flex CharStyle:Code
5828 \begin_layout Plain Layout
5837 \begin_layout Standard
5838 Your package is now installed and available to LaTeX.
5839 To make it available to LyX, you need to create a Layout file, if one is
5840 not already available.
5841 (See the next section.) Once you have a layout file, you need only reconfigure
5843 \begin_inset Flex CharStyle:MenuItem
5846 \begin_layout Plain Layout
5847 Tools\SpecialChar \menuseparator
5853 ) and then restart LyX.
5854 You should then see your new package---for example
5855 \begin_inset Flex CharStyle:MenuItem
5858 \begin_layout Plain Layout
5865 \begin_inset Flex CharStyle:MenuItem
5868 \begin_layout Plain Layout
5869 Document\SpecialChar \menuseparator
5876 \begin_inset Flex CharStyle:MenuItem
5879 \begin_layout Plain Layout
5889 \begin_layout Section
5893 \begin_layout Standard
5894 This section describes how to write and install your own LyX layout files
5895 and walks through the
5896 \begin_inset Flex CharStyle:Code
5899 \begin_layout Plain Layout
5905 text class format as an example.
5907 \begin_inset Flex CharStyle:Code
5910 \begin_layout Plain Layout
5916 files describe what paragraph and character styles are available for a
5917 given document class and how LyX should display them.
5918 We try to provide a thorough description of the process here; however,
5919 there are so many different types of documents supported by LaTeX classes
5920 that we can't hope to cover every different possibility or problem you
5922 (The LyX users' list is frequented by people with lots of experience with
5923 layout design who are willing to share what they've learned.)
5926 \begin_layout Standard
5927 As you prepare to write a new layout, it is extremely helpful to look at
5928 the example layouts distributed with LyX.
5929 If you use a nice LaTeX document class that might be of interest for others,
5930 too, and have a nice corresponding LyX layout, feel free to contribute
5931 the stuff to us, so we may put it into the distribution.
5933 \begin_inset CommandInset href
5935 name "section on the LyX wiki"
5936 target "http://wiki.lyx.org/Layouts/Layouts"
5940 for this kind of material.
5943 \begin_layout Standard
5944 All the tags described in this chapter are case-insensitive; this means
5946 \begin_inset Flex CharStyle:Code
5949 \begin_layout Plain Layout
5956 \begin_inset Flex CharStyle:Code
5959 \begin_layout Plain Layout
5966 \begin_inset Flex CharStyle:Code
5969 \begin_layout Plain Layout
5975 are really the same command.
5976 The possible values are printed in brackets after the feature's name.
5977 The default value if a feature isn't specified inside a text class-description
5979 \begin_inset Flex CharStyle:Code
5982 \begin_layout Plain Layout
5991 If the argument has a datatype like
5992 \begin_inset Quotes eld
5996 \begin_inset Quotes erd
6000 \begin_inset Quotes eld
6004 \begin_inset Quotes erd
6007 , the default is shown like this:
6008 \begin_inset Flex CharStyle:Code
6011 \begin_layout Plain Layout
6022 \begin_layout Subsection
6026 \begin_layout Standard
6027 Similar to layout files, and new with LyX 1.6, are layout
6032 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6033 some modules---such as the Endnotes module---provide support for just such
6035 In a sense, layout modules are similar to included files---files like
6036 \begin_inset Flex CharStyle:Code
6039 \begin_layout Plain Layout
6045 ---in that modules are not specific to a given document layout but may be
6046 used with many different layouts.
6047 The difference is that using a layout module does not require editing the
6049 Rather, modules are selected in the
6050 \begin_inset Flex CharStyle:MenuItem
6053 \begin_layout Plain Layout
6054 Document\SpecialChar \menuseparator
6063 \begin_layout Standard
6064 Building modules is the easiest way to get started with layout editing,
6065 since it can be as simple as adding a single new paragraph or flex inset.
6066 But modules may, in principle, contain anything a layout file can contain.
6069 \begin_layout Standard
6070 A module must begin with a line like the following:
6073 \begin_layout LyX-Code
6076 DeclareLyXModule[endnotes.sty]{Endnotes}
6079 \begin_layout Standard
6080 The argument in square brackets is optional: It declares any LaTeX packages
6081 on which the module depends.
6082 The mandatory argument, in curly brackets, is the name of the module, as
6084 \begin_inset Flex CharStyle:MenuItem
6087 \begin_layout Plain Layout
6088 Document\SpecialChar \menuseparator
6098 \begin_layout Standard
6099 The module declaration should then be followed by lines like the following:
6102 \begin_layout LyX-Code
6106 \begin_layout LyX-Code
6107 #Adds an endnote command, in addition to footnotes.
6111 \begin_layout LyX-Code
6112 #You will need to add
6114 theendnotes in ERT where you
6117 \begin_layout LyX-Code
6118 #want the endnotes to appear.
6122 \begin_layout LyX-Code
6126 \begin_layout LyX-Code
6127 #Requires: somemodule | othermodule
6130 \begin_layout LyX-Code
6131 #Excludes: badmodule
6134 \begin_layout Standard
6135 The description is used in
6136 \begin_inset Flex CharStyle:MenuItem
6139 \begin_layout Plain Layout
6140 Document\SpecialChar \menuseparator
6146 to provide the user with information about what the module does.
6148 \begin_inset Flex CharStyle:Code
6151 \begin_layout Plain Layout
6157 line is used to identify other modules with which this one must be used;
6159 \begin_inset Flex CharStyle:Code
6162 \begin_layout Plain Layout
6168 line is used to identify modules with which this one may not be used.
6169 Both are optional, and, as shown, multiple modules should be separated
6170 with the pipe symbol: |.
6171 Note that the required modules are treated disjunctively:
6175 of the required modules must be used.
6180 excluded module may be used.
6181 Note that modules are identified here by their
6185 without the .module extension.
6187 \begin_inset Flex CharStyle:Code
6190 \begin_layout Plain Layout
6197 \begin_inset Flex CharStyle:Code
6200 \begin_layout Plain Layout
6209 \begin_layout Standard
6210 After creating a new module, you will need to reconfigure and then restart
6211 LyX for the module to appear in the menu.
6212 However, changes you make to the module will be seen immediately, if you
6214 \begin_inset Flex CharStyle:MenuItem
6217 \begin_layout Plain Layout
6218 Document\SpecialChar \menuseparator
6224 , highlight something, and then hit
6225 \begin_inset Quotes eld
6229 \begin_inset Quotes erd
6235 It is strongly recommended that you save your work before doing so
6240 it is strongly recommended that you not attempt to edit modules while simultaneo
6241 usly working on documents
6244 Though of course the developers strive to keep LyX stable in such situations,
6245 syntax errors and the like in your module file could cause strange behavior.
6248 \begin_layout Subsection
6249 Supporting new document classes
6252 \begin_layout Standard
6253 There are two situations you are likely to encounter when wanting to support
6254 a new LaTeX document class, involving LaTeX2e class (
6255 \begin_inset Flex CharStyle:Code
6258 \begin_layout Plain Layout
6265 \begin_inset Flex CharStyle:Code
6268 \begin_layout Plain Layout
6275 Supporting a style file is usually fairly easy.
6276 Supporting a new document class is a bit harder.
6279 \begin_layout Subsection
6281 \begin_inset Flex CharStyle:MenuItem
6284 \begin_layout Plain Layout
6293 \begin_layout Standard
6294 If your new document class is provided as a style file that is used in conjuncti
6295 on with an existing, supported document class---for the sake of the example,
6296 we'll assume that the style file is called
6297 \begin_inset Flex CharStyle:MenuItem
6300 \begin_layout Plain Layout
6306 and it is meant to be used with
6307 \begin_inset Flex CharStyle:MenuItem
6310 \begin_layout Plain Layout
6316 , which is a standard class---start by copying the existing class's layout
6317 file into your local directory:
6320 \begin_layout LyX-Code
6321 cp report.layout ~/.lyx/layouts/myclass.layout
6324 \begin_layout Standard
6326 \begin_inset Flex CharStyle:Code
6329 \begin_layout Plain Layout
6335 and change the line:
6338 \begin_layout LyX-Code
6341 DeclareLaTeXClass{report}
6344 \begin_layout Standard
6348 \begin_layout LyX-Code
6351 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6354 \begin_layout Standard
6358 \begin_layout LyX-Code
6360 \begin_inset Newline newline
6366 \begin_inset Newline newline
6372 \begin_layout Standard
6373 near the top of the file.
6376 \begin_layout Standard
6377 Start LyX and select
6378 \begin_inset Flex CharStyle:MenuItem
6381 \begin_layout Plain Layout
6386 ools\SpecialChar \menuseparator
6397 Then restart LyX and try creating a new document.
6399 \begin_inset Flex CharStyle:MenuItem
6402 \begin_layout Plain Layout
6408 " as a document class option in the
6409 \begin_inset Flex CharStyle:MenuItem
6412 \begin_layout Plain Layout
6417 ocument\SpecialChar \menuseparator
6428 It is likely that some of the sectioning commands and such in your new
6429 class will work differently from how they worked in the base class---
6430 \begin_inset Flex CharStyle:Code
6433 \begin_layout Plain Layout
6439 in this example---so you can fiddle around with the settings for the different
6440 sections if you wish.
6443 \begin_layout Subsection
6445 \begin_inset Flex CharStyle:MenuItem
6448 \begin_layout Plain Layout
6457 \begin_layout Standard
6458 There are two possibilities here.
6459 One is that the class file is itself based upon an existing document class.
6460 For example, many thesis classes are based upon
6461 \begin_inset Flex CharStyle:MenuItem
6464 \begin_layout Plain Layout
6471 To see whether yours is, look for a line like
6474 \begin_layout LyX-Code
6480 \begin_layout Standard
6482 If so, then you may proceed largely as in the previous section, though
6483 the DeclareLaTeXClass line will be different.
6484 If your new class is thesis, and it is based upon book, then the line should
6489 \begin_layout Plain Layout
6490 And it will be easiest if you save the file to
6491 \begin_inset Flex CharStyle:Code
6494 \begin_layout Plain Layout
6500 : LyX assumes that the document class has the same name as the layout file.
6509 \begin_layout LyX-Code
6512 DeclareLaTeXClass[thesis,book]{thesis}
6515 \begin_layout Standard
6516 If, on the other hand, the new class is not based upon an existing class,
6517 you will probably have to
6518 \begin_inset Quotes eld
6522 \begin_inset Quotes erd
6526 We strongly suggest copying an existing layout file which uses a similar
6527 LaTeX class and then modifying it, if you can do so.
6528 At least use an existing file as a starting point so you can find out what
6529 items you need to worry about.
6530 Again, the specifics are covered below.
6533 \begin_layout Section
6534 Declaring a new text class
6537 \begin_layout Standard
6538 When it's finally time to get your hands dirty and create or edit your own
6539 layout file, the following sections describe what you're up against.
6540 Our advice is to go slowly, save and test often, listen to soothing music,
6541 and enjoy one or two of your favorite adult beverages; more if you are
6542 getting particularly stuck.
6543 It's really not that hard, except that the multitude of options can become
6544 overwhelming if you try to do to much in one sitting.
6545 Go have another adult beverage, just for good measure.
6548 \begin_layout Standard
6552 \begin_layout Standard
6553 Lines in a layout file which begin with a
6554 \begin_inset Flex CharStyle:Code
6557 \begin_layout Plain Layout
6564 There is one exception to this rule: all layouts should begin with lines
6568 \begin_layout LyX-Code
6571 #% Do not delete the line below; configure depends on this
6574 \begin_layout LyX-Code
6579 DeclareLaTeXClass{article}
6582 \begin_layout Standard
6583 The second line is used when you configure LyX.
6584 The layout file is read by the LaTeX script
6585 \begin_inset Flex CharStyle:Code
6588 \begin_layout Plain Layout
6594 , in a special mode where
6595 \begin_inset Flex CharStyle:Code
6598 \begin_layout Plain Layout
6605 The first line is just a LaTeX comment, and the second one contains the
6606 declaration of the text class.
6607 If these lines appear in a file named
6608 \begin_inset Flex CharStyle:Code
6611 \begin_layout Plain Layout
6617 , then they define a text class of name
6618 \begin_inset Flex CharStyle:Code
6621 \begin_layout Plain Layout
6627 (the name of the layout file) which uses the LaTeX document class
6628 \begin_inset Flex CharStyle:Code
6631 \begin_layout Plain Layout
6637 (the default is to use the same name as the layout).
6639 \begin_inset Quotes eld
6643 \begin_inset Quotes erd
6646 that appears above is used as a description of the text class in the
6647 \begin_inset Flex CharStyle:MenuItem
6650 \begin_layout Plain Layout
6655 ocument\SpecialChar \menuseparator
6668 \begin_layout Standard
6669 Let's assume that you wrote your own text class that uses the
6670 \begin_inset Flex CharStyle:Code
6673 \begin_layout Plain Layout
6679 document class, but where you changed the appearance of the section headings.
6680 If you put it in a file
6681 \begin_inset Flex CharStyle:Code
6684 \begin_layout Plain Layout
6690 , the header of this file should be:
6693 \begin_layout LyX-Code
6696 #% Do not delete the line below; configure depends on this
6699 \begin_layout LyX-Code
6704 DeclareLaTeXClass[article]{article (with my own headings)}
6707 \begin_layout Standard
6708 This declares a text class
6709 \begin_inset Flex CharStyle:Code
6712 \begin_layout Plain Layout
6718 , associated with the LaTeX document class
6719 \begin_inset Flex CharStyle:Code
6722 \begin_layout Plain Layout
6729 \begin_inset Quotes eld
6732 article (with my own headings)
6733 \begin_inset Quotes erd
6737 If your text class depends on several packages, you can declare it as:
6740 \begin_layout LyX-Code
6743 #% Do not delete the line below; configure depends on this
6746 \begin_layout LyX-Code
6751 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6754 \begin_layout Standard
6755 This indicates that your text class uses the foo.sty package.
6756 Finally, it is also possible to declare classes for DocBook code.
6757 Typical declarations will look like
6760 \begin_layout LyX-Code
6763 #% Do not delete the line below; configure depends on this
6766 \begin_layout LyX-Code
6771 DeclareDocBookClass[article]{SGML (DocBook article)}
6774 \begin_layout Standard
6775 Note that these declarations can also be given an optional parameter declaring
6776 the name of the document class (but not a list).
6779 \begin_layout Standard
6780 So, to be as explicit as possible, the form of the layout declaration is:
6783 \begin_layout LyX-Code
6788 DeclareLaTeXClass[class,package.sty]{layout description}
6791 \begin_layout Standard
6792 The class need only be specified if the name of the LaTeX class file and
6793 the name of the layout file are different; if the name of the classfile
6794 is not specified, then LyX will simply assume that it is the same as the
6795 name of the layout file.
6798 \begin_layout Standard
6799 When the text class has been modified to your taste, all you have to do
6800 is to copy it either to
6801 \begin_inset Flex CharStyle:Code
6804 \begin_layout Plain Layout
6811 \begin_inset Flex CharStyle:Code
6814 \begin_layout Plain Layout
6821 \begin_inset Flex CharStyle:MenuItem
6824 \begin_layout Plain Layout
6829 ools\SpecialChar \menuseparator
6839 , exit LyX and restart it.
6840 Then your new text class should be available along with the others.
6843 \begin_layout Standard
6844 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6845 you made to your layout files.
6846 As a result, editing layout files could be very time consuming.
6847 Beginning with 1.6, however, you can force a reload of the layout currently
6848 in use by using the LyX function
6849 \begin_inset Flex CharStyle:MenuItem
6852 \begin_layout Plain Layout
6859 There is no default binding for this function---though, of course, you
6860 can bind it to a key yourself.
6861 If you want to use this function, then, you should simply enter it in the
6867 : This is very much an `advanced feature'.
6872 recommended that you save your work before using this function.
6877 recommended that you not attempt to edit your layout while simultaneously
6878 working on a document that you care about.
6879 Use a test document.
6880 Syntax errors and the like in your layout file could cause peculiar behavior.
6881 In particular, such errors could cause LyX to regard the current layout
6882 as invalid and to attempt to switch to some other layout.
6883 The LyX team strives to keep LyX stable in such situations, but safe is
6887 \begin_layout Subsection
6891 \begin_layout Standard
6892 The first non-comment line must contain the file format number:
6895 \begin_layout Description
6896 \begin_inset Flex CharStyle:Code
6899 \begin_layout Plain Layout
6906 \begin_inset Flex CharStyle:Code
6909 \begin_layout Plain Layout
6915 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6916 don't have an explicit file format).
6917 The file format that is documented here is format 8.
6920 \begin_layout Subsection
6921 General text class parameters
6924 \begin_layout Standard
6925 These are the general parameters which describe the form of the entire document:
6928 \begin_layout Description
6929 \begin_inset Flex CharStyle:Code
6932 \begin_layout Plain Layout
6938 Adds information to the document preamble.
6940 \begin_inset Quotes eld
6944 \begin_inset Flex CharStyle:Code
6947 \begin_layout Plain Layout
6954 \begin_inset Quotes erd
6960 \begin_layout Description
6961 \begin_inset Flex CharStyle:Code
6964 \begin_layout Plain Layout
6970 Describes various global options supported by the document class.
6972 \begin_inset space ~
6976 \begin_inset CommandInset ref
6978 reference "sec:classoptions"
6984 \begin_inset Quotes eld
6988 \begin_inset Flex CharStyle:Code
6991 \begin_layout Plain Layout
6998 \begin_inset Quotes erd
7004 \begin_layout Description
7005 \begin_inset Flex CharStyle:Code
7008 \begin_layout Plain Layout
7015 \begin_inset Flex CharStyle:Code
7018 \begin_layout Plain Layout
7027 \begin_inset Flex CharStyle:Code
7030 \begin_layout Plain Layout
7036 ] Whether the class should default to having one or two columns.
7037 Can be changed in the
7038 \begin_inset Flex CharStyle:MenuItem
7041 \begin_layout Plain Layout
7046 ocument\SpecialChar \menuseparator
7059 \begin_layout Description
7060 \begin_inset Flex CharStyle:Code
7063 \begin_layout Plain Layout
7069 This sequence defines a new counter.
7071 \begin_inset space ~
7075 \begin_inset CommandInset ref
7077 reference "sec:counter"
7083 \begin_inset Quotes eld
7087 \begin_inset Flex CharStyle:Code
7090 \begin_layout Plain Layout
7097 \begin_inset Quotes erd
7103 \begin_layout Description
7104 \begin_inset Flex CharStyle:Code
7107 \begin_layout Plain Layout
7113 Sets the default font used to display the document.
7115 \begin_inset space ~
7119 \begin_inset CommandInset ref
7121 reference "sec:fonts"
7125 for how to declare fonts.
7127 \begin_inset Quotes eld
7131 \begin_inset Flex CharStyle:Code
7134 \begin_layout Plain Layout
7141 \begin_inset Quotes erd
7147 \begin_layout Description
7148 \begin_inset Flex CharStyle:Code
7151 \begin_layout Plain Layout
7158 \begin_inset Flex CharStyle:Code
7161 \begin_layout Plain Layout
7167 ] This is the style that will be assigned to new paragraphs, usually
7168 \begin_inset Flex CharStyle:MenuItem
7171 \begin_layout Plain Layout
7178 This will default to the first defined style if not given, but you are
7179 highly encouraged to use this directive.
7182 \begin_layout Description
7183 \begin_inset Flex CharStyle:Code
7186 \begin_layout Plain Layout
7192 Defines a new float.
7194 \begin_inset space ~
7198 \begin_inset CommandInset ref
7200 reference "sec:floats"
7206 \begin_inset Quotes eld
7210 \begin_inset Flex CharStyle:Code
7213 \begin_layout Plain Layout
7220 \begin_inset Quotes erd
7226 \begin_layout Description
7227 \begin_inset Flex CharStyle:Code
7230 \begin_layout Plain Layout
7236 As its name implies, this command allows you to include another layout
7237 definition file within yours to avoid duplicating commands.
7238 Common examples are the standard layout files, for example,
7239 \begin_inset Flex CharStyle:Code
7242 \begin_layout Plain Layout
7248 , which contains most of the basic layouts.
7251 \begin_layout Description
7252 \begin_inset Flex CharStyle:Code
7255 \begin_layout Plain Layout
7261 This section (re-)defines the layout of an inset.
7262 It can be applied to an existing inset of to a new, user-defined inset,
7263 e.g., a new character style.
7265 \begin_inset space ~
7269 \begin_inset CommandInset ref
7271 reference "sec:charstyle"
7275 for more information.
7277 \begin_inset Quotes eld
7281 \begin_inset Flex CharStyle:Code
7284 \begin_layout Plain Layout
7291 \begin_inset Quotes erd
7297 \begin_layout Description
7298 \begin_inset Flex CharStyle:Code
7301 \begin_layout Plain Layout
7308 \change_deleted 1 1223264406
7310 \change_inserted 1 1223264424
7311 A string that indicates the width of the left margin on the screen, for
7313 \begin_inset Quotes eld
7317 \begin_inset Quotes erd
7325 \begin_layout Description
7326 \begin_inset Flex CharStyle:Code
7329 \begin_layout Plain Layout
7335 This command deletes an existing float.
7336 This is particularly useful when you want to suppress a float that has
7337 be defined in an input file.
7340 \begin_layout Description
7341 \begin_inset Flex CharStyle:Code
7344 \begin_layout Plain Layout
7350 This command deletes an existing style.
7351 This is particularly useful when you want to suppress a style that has
7352 be defined in an input file.
7355 \begin_layout Description
7356 \begin_inset Flex CharStyle:Code
7359 \begin_layout Plain Layout
7366 \change_deleted 1 1223264478
7368 \change_inserted 1 1223264538
7369 A string indicating what sort of output documents using this class will
7371 At present, the options are: `docbook', `latex', `linuxdoc', and `literate'.
7376 \begin_layout Description
7377 \begin_inset Flex CharStyle:Code
7380 \begin_layout Plain Layout
7391 \begin_inset Flex CharStyle:Code
7394 \begin_layout Plain Layout
7405 \begin_inset Flex CharStyle:Code
7408 \begin_layout Plain Layout
7415 \begin_inset Flex CharStyle:Code
7418 \begin_layout Plain Layout
7424 ] The class default pagestyle.
7425 Can be changed in the
7426 \begin_inset Flex CharStyle:MenuItem
7429 \begin_layout Plain Layout
7434 ocument\SpecialChar \menuseparator
7447 \begin_layout Description
7448 \begin_inset Flex CharStyle:Code
7451 \begin_layout Plain Layout
7457 Sets the preamble for the LaTeX document.
7458 Note that this will completely override any prior
7459 \begin_inset Flex CharStyle:Code
7462 \begin_layout Plain Layout
7469 \begin_inset Flex CharStyle:Code
7472 \begin_layout Plain Layout
7480 \begin_inset Quotes eld
7484 \begin_inset Flex CharStyle:Code
7487 \begin_layout Plain Layout
7494 \begin_inset Quotes erd
7500 \begin_layout Description
7501 \begin_inset Flex CharStyle:Code
7504 \begin_layout Plain Layout
7511 \begin_inset Flex CharStyle:Code
7514 \begin_layout Plain Layout
7521 \begin_inset Flex CharStyle:Code
7524 \begin_layout Plain Layout
7533 \begin_inset Flex CharStyle:Code
7536 \begin_layout Plain Layout
7542 ] Whether the class already provides the feature
7543 \begin_inset Flex CharStyle:Code
7546 \begin_layout Plain Layout
7553 A feature is in general the name of a package (
7554 \begin_inset Flex CharStyle:Code
7557 \begin_layout Plain Layout
7564 \begin_inset Flex CharStyle:Code
7567 \begin_layout Plain Layout
7573 , \SpecialChar \ldots{}
7575 \begin_inset Flex CharStyle:Code
7578 \begin_layout Plain Layout
7585 \begin_inset Flex CharStyle:Code
7588 \begin_layout Plain Layout
7594 ,\SpecialChar \ldots{}
7595 ); the complete list of supported features is unfortunately not documented
7596 outside the LyX source code---but see
7597 \begin_inset Flex CharStyle:Code
7600 \begin_layout Plain Layout
7606 if you're interested.
7608 \begin_inset Flex CharStyle:MenuItem
7611 \begin_layout Plain Layout
7616 elp\SpecialChar \menuseparator
7626 also gives an overview of the supported packages.
7629 \begin_layout Description
7630 \begin_inset Flex CharStyle:Code
7633 \begin_layout Plain Layout
7640 \begin_inset Flex CharStyle:Code
7643 \begin_layout Plain Layout
7649 ] Whether the class requires the feature
7650 \begin_inset Flex CharStyle:Code
7653 \begin_layout Plain Layout
7660 Multiple features must be separated by commas.
7661 Note that you can only request supported features.
7664 \begin_layout Description
7665 \begin_inset Flex CharStyle:Code
7668 \begin_layout Plain Layout
7675 \change_deleted 1 1223264443
7677 \change_inserted 1 1223264447
7678 A string that indicates the width of the right margin on the screen, for
7680 \begin_inset Quotes eld
7684 \begin_inset Quotes erd
7692 \begin_layout Description
7693 \begin_inset Flex CharStyle:Code
7696 \begin_layout Plain Layout
7703 \change_deleted 1 1223264553
7705 \change_inserted 1 1223264811
7706 Sets which divisions get numbered.
7708 \begin_inset Flex CharStyle:Code
7711 \begin_layout Plain Layout
7713 \change_inserted 1 1223264626
7726 \begin_layout Description
7727 \begin_inset Flex CharStyle:Code
7730 \begin_layout Plain Layout
7739 \begin_inset Flex CharStyle:Code
7742 \begin_layout Plain Layout
7753 \begin_inset Flex CharStyle:Code
7756 \begin_layout Plain Layout
7762 ] Whether the class-default should be printing on one or both sides of the
7764 Can be changed in the
7765 \begin_inset Flex CharStyle:MenuItem
7768 \begin_layout Plain Layout
7773 ocument\SpecialChar \menuseparator
7786 \begin_layout Description
7787 \begin_inset Flex CharStyle:Code
7790 \begin_layout Plain Layout
7796 This sequence defines a new paragraph style.
7797 If the style already exists, it will redefine some of its parameters instead.
7799 \begin_inset space ~
7803 \begin_inset CommandInset ref
7805 reference "sec:style"
7811 \begin_inset Quotes eld
7815 \begin_inset Flex CharStyle:Code
7818 \begin_layout Plain Layout
7825 \begin_inset Quotes erd
7831 \begin_layout Description
7832 \begin_inset Flex CharStyle:Code
7835 \begin_layout Plain Layout
7842 \begin_inset Flex CharStyle:Code
7845 \begin_layout Plain Layout
7851 ] The name of the command or environment to be used with
7852 \begin_inset Flex CharStyle:Code
7855 \begin_layout Plain Layout
7864 \begin_layout Description
7865 \begin_inset Flex CharStyle:Code
7868 \begin_layout Plain Layout
7875 \begin_inset Flex CharStyle:Code
7878 \begin_layout Plain Layout
7887 \begin_inset Flex CharStyle:Code
7890 \begin_layout Plain Layout
7896 ] Indicates what kind of markup is used to define the title of a document.
7898 \begin_inset Flex CharStyle:Code
7901 \begin_layout Plain Layout
7907 means that the macro with name
7908 \begin_inset Flex CharStyle:Code
7911 \begin_layout Plain Layout
7917 will be inserted after the last layout which has
7918 \begin_inset Quotes eld
7922 \begin_inset Flex CharStyle:Code
7925 \begin_layout Plain Layout
7932 \begin_inset Quotes erd
7937 \begin_inset Flex CharStyle:Code
7940 \begin_layout Plain Layout
7946 corresponds to the case where the block of paragraphs which have
7947 \begin_inset Quotes eld
7951 \begin_inset Flex CharStyle:Code
7954 \begin_layout Plain Layout
7961 \begin_inset Quotes erd
7964 should be enclosed into the
7965 \begin_inset Flex CharStyle:Code
7968 \begin_layout Plain Layout
7977 \begin_layout Description
7978 \begin_inset Flex CharStyle:Code
7981 \begin_layout Plain Layout
7988 \change_deleted 1 1223264639
7990 \change_inserted 1 1223264836
7991 Sets which divisions are included in the table of contents.
7993 \begin_inset Flex CharStyle:Code
7996 \begin_layout Plain Layout
7998 \change_inserted 1 1223264831
8011 \begin_layout Description
8012 \begin_inset Flex CharStyle:Code
8015 \begin_layout Plain Layout
8022 \begin_inset Flex CharStyle:Code
8025 \begin_layout Plain Layout
8031 Specifies a module to be included by default with this document class.
8032 The user can still remove the module, but it will be active at the outset.
8033 (This applies only when new files are created, or when this class is chosen
8034 for an existing document.)
8037 \begin_layout Subsection
8038 \begin_inset Flex CharStyle:Code
8041 \begin_layout Plain Layout
8050 \begin_layout Standard
8051 \begin_inset CommandInset label
8053 name "sec:classoptions"
8058 \begin_inset Flex CharStyle:Code
8061 \begin_layout Plain Layout
8067 section can contain the following entries:
8070 \begin_layout Description
8071 \begin_inset Flex CharStyle:Code
8074 \begin_layout Plain Layout
8081 \begin_inset Flex CharStyle:Code
8084 \begin_layout Plain Layout
8090 ] The list of available font sizes for the document's main font, separated
8092 \begin_inset Quotes eld
8096 \begin_inset Flex CharStyle:Code
8099 \begin_layout Plain Layout
8106 \begin_inset Quotes erd
8112 \begin_layout Description
8113 \begin_inset Flex CharStyle:Code
8116 \begin_layout Plain Layout
8123 \change_deleted 1 1223264991
8125 \change_inserted 1 1223265053
8126 Used to set the DTD line with XML-based output classes.
8128 \begin_inset Quotes eld
8131 -//OASIS//DTD DocBook V4.2//EN
8132 \begin_inset Quotes erd
8140 \begin_layout Description
8141 \begin_inset Flex CharStyle:Code
8144 \begin_layout Plain Layout
8151 \begin_inset Flex CharStyle:Code
8154 \begin_layout Plain Layout
8155 string="empty|plain|headings|fancy"
8160 ] The list of available page styles, separated by
8161 \begin_inset Quotes eld
8165 \begin_inset Flex CharStyle:Code
8168 \begin_layout Plain Layout
8175 \begin_inset Quotes erd
8181 \begin_layout Description
8182 \begin_inset Flex CharStyle:Code
8185 \begin_layout Plain Layout
8192 \begin_inset Flex CharStyle:Code
8195 \begin_layout Plain Layout
8201 ] Some document class options, separated by a comma, that will be added
8202 to the optional part of the
8203 \begin_inset Flex CharStyle:Code
8206 \begin_layout Plain Layout
8217 \begin_layout Standard
8219 \begin_inset Flex CharStyle:Code
8222 \begin_layout Plain Layout
8228 section must end with
8229 \begin_inset Quotes eld
8233 \begin_inset Flex CharStyle:Code
8236 \begin_layout Plain Layout
8243 \begin_inset Quotes erd
8249 \begin_layout Subsection
8253 \begin_layout Standard
8254 \begin_inset CommandInset label
8260 A paragraph style description looks like this:
8264 \begin_layout Plain Layout
8265 Note that this will either define a new layout or modify an existing one.
8273 \begin_layout LyX-Code
8280 \begin_layout LyX-Code
8284 \begin_layout LyX-Code
8288 \begin_layout Standard
8289 where the following commands are allowed:
8292 \begin_layout Description
8293 \begin_inset Flex CharStyle:Code
8296 \begin_layout Plain Layout
8303 \begin_inset Flex CharStyle:Code
8306 \begin_layout Plain Layout
8311 , left, right, center
8316 ] Paragraph alignment.
8319 \begin_layout Description
8320 \begin_inset Flex CharStyle:Code
8323 \begin_layout Plain Layout
8330 \begin_inset Flex CharStyle:Code
8333 \begin_layout Plain Layout
8338 , left, right, center
8343 ] A comma separated list of permitted alignments.
8344 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8346 For example a right-aligned or centered enumeration isn't possible.)
8349 \begin_layout Description
8350 \begin_inset Flex CharStyle:Code
8353 \begin_layout Plain Layout
8360 \begin_inset Flex CharStyle:Code
8363 \begin_layout Plain Layout
8373 \begin_layout Plain Layout
8374 Note that a `float' here is a real number, such as: 1.5.
8379 The vertical space with which the last of a chain of paragraphs with this
8380 layout is separated from the following paragraph.
8381 If the next paragraph has another layout, the separations are not simply
8382 added, but the maximum is taken.
8385 \begin_layout Description
8386 \begin_inset Flex CharStyle:Code
8389 \begin_layout Plain Layout
8396 \begin_inset Flex CharStyle:Code
8399 \begin_layout Plain Layout
8405 The category for this style.
8406 This is used to group related styles in the Layout combobox on the toolbar.
8407 Any string can be used, but you may want to use existing categories with
8412 \begin_layout Description
8413 \begin_inset Flex CharStyle:Code
8416 \begin_layout Plain Layout
8423 \change_deleted 1 1223265419
8425 \change_inserted 1 1223265432
8426 Depth of XML command.
8427 Used only with XML-type formats.
8432 \begin_layout Description
8433 \begin_inset Flex CharStyle:Code
8436 \begin_layout Plain Layout
8443 \begin_inset CommandInset label
8445 name "des:CopyStyle"
8450 \begin_inset Flex CharStyle:Code
8453 \begin_layout Plain Layout
8459 Copies all the features of an existing style into the current one.
8463 \begin_layout Description
8464 \begin_inset Flex CharStyle:Code
8467 \begin_layout Plain Layout
8473 The name of a style whose preamble should be output
8478 This allows to ensure some ordering of the preamble snippets when macros
8479 definitions depend on one another.
8483 \begin_layout Plain Layout
8484 Note that, besides that functionality, there is no way to ensure any ordering
8486 The ordering that you see in a given version of LyX may change without
8487 warning in later versions.
8495 \begin_layout Description
8496 \begin_inset Flex CharStyle:Code
8499 \begin_layout Plain Layout
8506 \begin_inset Flex CharStyle:Code
8509 \begin_layout Plain Layout
8514 , Box, Filled_Box, Static
8519 ] The type of label that stands at the end of the paragraph (or sequence
8521 \begin_inset Flex CharStyle:Code
8524 \begin_layout Plain Layout
8531 \begin_inset Flex CharStyle:Code
8534 \begin_layout Plain Layout
8541 \begin_inset Flex CharStyle:Code
8544 \begin_layout Plain Layout
8551 \begin_inset Flex CharStyle:Code
8554 \begin_layout Plain Layout
8562 \begin_inset Flex CharStyle:Code
8565 \begin_layout Plain Layout
8572 \begin_inset Quotes eld
8576 \begin_inset Quotes erd
8580 \begin_inset Flex CharStyle:Code
8583 \begin_layout Plain Layout
8590 \begin_inset Flex CharStyle:Code
8593 \begin_layout Plain Layout
8594 \begin_inset space ~
8603 \begin_inset space ~
8606 black) square suitable for end of proof markers,
8607 \begin_inset Flex CharStyle:Code
8610 \begin_layout Plain Layout
8616 is an explicit text string.
8619 \begin_layout Description
8620 \begin_inset Flex CharStyle:Code
8623 \begin_layout Plain Layout
8630 \begin_inset Flex CharStyle:Code
8633 \begin_layout Plain Layout
8639 ] The string used for a label with a
8640 \begin_inset Flex CharStyle:Code
8643 \begin_layout Plain Layout
8650 \begin_inset Flex CharStyle:Code
8653 \begin_layout Plain Layout
8663 \begin_layout Description
8664 \begin_inset Flex CharStyle:Code
8667 \begin_layout Plain Layout
8674 \begin_inset Flex CharStyle:Code
8677 \begin_layout Plain Layout
8688 \begin_inset Flex CharStyle:Code
8691 \begin_layout Plain Layout
8700 \begin_layout Description
8701 \begin_inset Flex CharStyle:Code
8704 \begin_layout Plain Layout
8711 \begin_inset Flex CharStyle:Code
8714 \begin_layout Plain Layout
8724 ] With this parameter the
8725 \begin_inset Flex CharStyle:MenuItem
8728 \begin_layout Plain Layout
8735 \begin_inset Quotes eld
8738 Vertical space above
8739 \begin_inset Quotes erd
8743 \begin_inset Flex CharStyle:MenuItem
8746 \begin_layout Plain Layout
8751 dit\SpecialChar \menuseparator
8757 \begin_inset space ~
8765 dialog can be set when initializing a paragraph with this style.
8769 \begin_layout Plain Layout
8772 Note from Jean-Marc:
8774 I'm not sure that this setting has much use, and it should probably be
8775 removed in later versions.
8783 \begin_layout Description
8784 \begin_inset Flex CharStyle:Code
8787 \begin_layout Plain Layout
8793 The font used for both the text body
8799 \begin_inset space ~
8803 \begin_inset CommandInset ref
8805 reference "sec:fonts"
8810 Note that defining this font automatically defines the
8811 \begin_inset Flex CharStyle:Code
8814 \begin_layout Plain Layout
8821 So you should define this one first if you also want to define
8822 \begin_inset Flex CharStyle:Code
8825 \begin_layout Plain Layout
8834 \begin_layout Description
8835 \begin_inset Flex CharStyle:Code
8838 \begin_layout Plain Layout
8845 \begin_inset CommandInset label
8847 name "des:FreeSpacing"
8854 \begin_inset Flex CharStyle:Code
8857 \begin_layout Plain Layout
8868 \begin_inset Flex CharStyle:Code
8871 \begin_layout Plain Layout
8877 ] Usually LyX doesn't allow you to insert more than one space between words,
8878 since a space is considered as the separation between two words, not a
8879 character or symbol of its own.
8880 This is a very fine thing but sometimes annoying, for example, when typing
8881 program code or plain LaTeX code.
8883 \begin_inset Flex CharStyle:Code
8886 \begin_layout Plain Layout
8893 Note that LyX will create protected blanks for the additional blanks when
8894 in another mode than LaTeX-mode.
8897 \begin_layout Description
8898 \begin_inset Flex CharStyle:Code
8901 \begin_layout Plain Layout
8908 \change_inserted 1 1223265565
8909 (Used only with XML-type formats.)
8914 \begin_layout Description
8915 \begin_inset Flex CharStyle:Code
8918 \begin_layout Plain Layout
8925 \begin_inset Flex CharStyle:Code
8928 \begin_layout Plain Layout
8934 If 1, marks the layout as being part of a title block (see also the
8935 \begin_inset Flex CharStyle:Code
8938 \begin_layout Plain Layout
8945 \begin_inset Flex CharStyle:Code
8948 \begin_layout Plain Layout
8957 \begin_layout Description
8958 \begin_inset Flex CharStyle:Code
8961 \begin_layout Plain Layout
8968 \begin_inset Flex CharStyle:Code
8971 \begin_layout Plain Layout
8977 ] This provides extra space between paragraphs that have the same layout.
8978 If you put other layouts into an environment, each is separated with the
8980 \begin_inset Flex CharStyle:Code
8983 \begin_layout Plain Layout
8990 But the whole items of the environment are additionally separated with
8992 \begin_inset Flex CharStyle:Code
8995 \begin_layout Plain Layout
9007 \begin_layout Description
9008 \begin_inset Flex CharStyle:Code
9011 \begin_layout Plain Layout
9018 \change_inserted 1 1223265576
9019 (Used only with XML-type formats.)
9024 \begin_layout Description
9025 \begin_inset Flex CharStyle:Code
9028 \begin_layout Plain Layout
9035 \begin_inset CommandInset label
9037 name "des:KeepEmpty"
9044 \begin_inset Flex CharStyle:Code
9047 \begin_layout Plain Layout
9058 \begin_inset Flex CharStyle:Code
9061 \begin_layout Plain Layout
9067 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9068 lead to empty LaTeX output.
9069 There are some cases where this could be desirable however: in a letter
9070 template, the required fields can be provided as empty fields, so that
9071 people do not forget them; in some special classes, a layout can be used
9072 as some kind of break, which does not contain actual text.
9075 \begin_layout Description
9076 \begin_inset Flex CharStyle:Code
9079 \begin_layout Plain Layout
9085 [float=0] The vertical space between the label and the text body.
9086 Only used for labels that are above the text body (
9087 \begin_inset Flex CharStyle:Code
9090 \begin_layout Plain Layout
9097 \begin_inset Flex CharStyle:Code
9100 \begin_layout Plain Layout
9101 Centered_Top_Environment
9109 \begin_layout Description
9110 \begin_inset Flex CharStyle:Code
9113 \begin_layout Plain Layout
9120 \begin_inset Flex CharStyle:Code
9123 \begin_layout Plain Layout
9130 \begin_inset Newline newline
9133 The name of the counter for automatic numbering (see Section
9134 \begin_inset CommandInset ref
9136 reference "sec:counter"
9141 This must be given if
9142 \begin_inset Flex CharStyle:Code
9145 \begin_layout Plain Layout
9152 \begin_inset Flex CharStyle:Code
9155 \begin_layout Plain Layout
9164 \begin_layout Description
9165 \begin_inset Flex CharStyle:Code
9168 \begin_layout Plain Layout
9174 The font used for the label.
9176 \begin_inset space ~
9180 \begin_inset CommandInset ref
9182 reference "sec:fonts"
9187 \change_inserted 1 1223265124
9191 \begin_layout Description
9193 \change_inserted 1 1223265614
9194 \begin_inset Flex CharStyle:Code
9197 \begin_layout Plain Layout
9199 \change_inserted 1 1223265133
9207 Text that indicates how far a label should be indented.
9212 \begin_layout Description
9213 \begin_inset Flex CharStyle:Code
9216 \begin_layout Plain Layout
9223 \begin_inset Flex CharStyle:Code
9226 \begin_layout Plain Layout
9232 ] The horizontal space between the label and the text body.
9233 Only used for labels that are not above the text body.
9236 \begin_layout Description
9237 \begin_inset Flex CharStyle:Code
9240 \begin_layout Plain Layout
9247 \begin_inset Flex CharStyle:Code
9250 \begin_layout Plain Layout
9256 ] The string used for a label with a
9257 \begin_inset Flex CharStyle:Code
9260 \begin_layout Plain Layout
9268 \begin_inset Flex CharStyle:Code
9271 \begin_layout Plain Layout
9277 is set, this string can be contain the special formatting commands described
9279 \begin_inset CommandInset ref
9281 reference "sec:counter"
9289 \begin_layout Plain Layout
9290 For the sake of backwards compatibility, the string
9291 \begin_inset Flex CharStyle:Code
9294 \begin_layout Plain Layout
9304 will be replaced by the expanded
9305 \begin_inset Flex CharStyle:Code
9308 \begin_layout Plain Layout
9315 \begin_inset Flex CharStyle:Code
9318 \begin_layout Plain Layout
9327 This feature is now obsolete and should be replaced by the mechanisms of
9329 \begin_inset CommandInset ref
9331 reference "sec:counter"
9343 \begin_layout Description
9344 \begin_inset Flex CharStyle:Code
9347 \begin_layout Plain Layout
9354 \begin_inset Flex CharStyle:Code
9357 \begin_layout Plain Layout
9363 ] This is used inside the appendix instead of
9364 \begin_inset Flex CharStyle:Code
9367 \begin_layout Plain Layout
9375 \begin_inset Flex CharStyle:Code
9378 \begin_layout Plain Layout
9385 \begin_inset Flex CharStyle:Code
9388 \begin_layout Plain Layout
9395 \change_inserted 1 1223265160
9399 \begin_layout Description
9401 \change_inserted 1 1223265640
9402 \begin_inset Flex CharStyle:Code
9405 \begin_layout Plain Layout
9407 \change_inserted 1 1223265166
9415 [FIXME] (Used only with XML-type formats.)
9420 \begin_layout Description
9421 \begin_inset Flex CharStyle:Code
9424 \begin_layout Plain Layout
9431 \begin_inset Flex CharStyle:Code
9434 \begin_layout Plain Layout
9439 , Manual, Static, Top_Environment,
9440 \begin_inset Newline newline
9443 Centered_Top_Environment, Sensitive, Counter
9449 \begin_inset Newline newline
9453 \begin_inset Flex CharStyle:Code
9456 \begin_layout Plain Layout
9462 means the label is the very first word (up to the first real blank).
9466 \begin_layout Plain Layout
9467 Use protected spaces if you want more than one word as the label.
9473 \begin_inset Flex CharStyle:Code
9476 \begin_layout Plain Layout
9482 means it is defined in the layout (see
9483 \begin_inset Flex CharStyle:Code
9486 \begin_layout Plain Layout
9494 \begin_inset Flex CharStyle:Code
9497 \begin_layout Plain Layout
9504 \begin_inset Flex CharStyle:Code
9507 \begin_layout Plain Layout
9508 Centered_Top_Environment
9513 are special cases of
9514 \begin_inset Flex CharStyle:Code
9517 \begin_layout Plain Layout
9524 The label will be printed above the paragraph, but only at the top of an
9525 environment or the top of a chain of paragraphs with this layout.
9526 Usage is for example the
9527 \begin_inset Flex CharStyle:MenuItem
9530 \begin_layout Plain Layout
9537 \begin_inset Flex CharStyle:MenuItem
9540 \begin_layout Plain Layout
9547 This is also the case for
9548 \begin_inset Flex CharStyle:Code
9551 \begin_layout Plain Layout
9557 labels with latex type
9558 \begin_inset Flex CharStyle:Code
9561 \begin_layout Plain Layout
9567 , in order to make layouts for theorems work correctly.
9569 \begin_inset Flex CharStyle:Code
9572 \begin_layout Plain Layout
9578 is a special case for the caption-labels
9579 \begin_inset Quotes eld
9583 \begin_inset Quotes erd
9587 \begin_inset Quotes eld
9591 \begin_inset Quotes erd
9596 \begin_inset Flex CharStyle:Code
9599 \begin_layout Plain Layout
9605 means the (hardcoded) label string depends on the kind of float.
9607 \begin_inset Flex CharStyle:Code
9610 \begin_layout Plain Layout
9616 label type defines automatically numbered labels.
9618 \begin_inset CommandInset ref
9620 reference "sec:counter"
9627 \begin_layout Description
9629 \change_deleted 1 1223265792
9630 \begin_inset Flex CharStyle:Code
9633 \begin_layout Plain Layout
9642 \begin_layout Description
9644 \change_deleted 1 1223265792
9645 \begin_inset Flex CharStyle:Code
9648 \begin_layout Plain Layout
9657 \begin_layout Description
9658 \begin_inset Flex CharStyle:Code
9661 \begin_layout Plain Layout
9667 The name of the corresponding LaTeX stuff.
9668 Either the environment or command name.
9671 \begin_layout Description
9673 \change_deleted 1 1223265962
9674 \begin_inset Flex CharStyle:Code
9677 \begin_layout Plain Layout
9686 \begin_layout Description
9687 \begin_inset Flex CharStyle:Code
9690 \begin_layout Plain Layout
9696 An optional parameter for the corresponding
9697 \begin_inset Flex CharStyle:Code
9700 \begin_layout Plain Layout
9707 This parameter cannot be changed from within LyX.
9710 \begin_layout Description
9711 \begin_inset Flex CharStyle:Code
9714 \begin_layout Plain Layout
9721 \begin_inset CommandInset label
9723 name "des:LatexType"
9728 \begin_inset Flex CharStyle:Code
9731 \begin_layout Plain Layout
9736 , Command, Environment, Item_Environment,
9742 \begin_inset Flex CharStyle:Code
9745 \begin_layout Plain Layout
9751 ] How the layout should be translated into LaTeX.
9753 \begin_inset Flex CharStyle:Code
9756 \begin_layout Plain Layout
9762 means nothing special.
9764 \begin_inset Flex CharStyle:Code
9767 \begin_layout Plain Layout
9774 \begin_inset Flex CharStyle:Code
9777 \begin_layout Plain Layout
9784 {\SpecialChar \ldots{}
9791 \begin_inset Flex CharStyle:Code
9794 \begin_layout Plain Layout
9801 \begin_inset Flex CharStyle:Code
9804 \begin_layout Plain Layout
9811 }\SpecialChar \ldots{}
9825 \begin_inset Flex CharStyle:Code
9828 \begin_layout Plain Layout
9835 \begin_inset Flex CharStyle:Code
9838 \begin_layout Plain Layout
9845 \begin_inset Flex CharStyle:Code
9848 \begin_layout Plain Layout
9856 is generated for each paragraph of this environment.
9858 \begin_inset Flex CharStyle:Code
9861 \begin_layout Plain Layout
9868 \begin_inset Flex CharStyle:Code
9871 \begin_layout Plain Layout
9878 \begin_inset Flex CharStyle:Code
9881 \begin_layout Plain Layout
9887 is passed as an argument to the environment.
9889 \begin_inset Flex CharStyle:Code
9892 \begin_layout Plain Layout
9898 can be defined in the
9899 \begin_inset Flex CharStyle:MenuItem
9902 \begin_layout Plain Layout
9907 ayout\SpecialChar \menuseparator
9919 \begin_inset Flex CharStyle:Code
9922 \begin_layout Plain Layout
9930 is perhaps a bit misleading, since these rules apply to SGML classes, too.
9931 Visit the SGML class files for specific examples.
9934 \begin_layout Standard
9935 Putting the last few things together, the LaTeX output will be either:
9938 \begin_layout LyX-Code
9941 latexname[latexparam]{\SpecialChar \ldots{}
9945 \begin_layout Standard
9949 \begin_layout LyX-Code
9952 begin{latexname}[latexparam] \SpecialChar \ldots{}
9958 \begin_layout Standard
9959 depending upon the LaTex type.
9962 \begin_layout Description
9963 \begin_inset Flex CharStyle:Code
9966 \begin_layout Plain Layout
9973 \begin_inset Flex CharStyle:Code
9976 \begin_layout Plain Layout
9982 ] If you put layouts into environments, the leftmargins are not simply added,
9983 but added with a factor
9984 \begin_inset Formula $\frac{4}{depth+4}$
9988 Note that this parameter is also used when the margin is defined as
9989 \begin_inset Flex CharStyle:Code
9992 \begin_layout Plain Layout
9999 \begin_inset Flex CharStyle:Code
10002 \begin_layout Plain Layout
10009 Then it is added to the manual or dynamic margin.
10011 \begin_inset Newline newline
10014 The argument is passed as a string.
10016 \begin_inset Quotes eld
10020 \begin_inset Flex CharStyle:Code
10023 \begin_layout Plain Layout
10030 \begin_inset Quotes erd
10033 means that the paragraph is indented with the width of
10034 \begin_inset Quotes eld
10038 \begin_inset Flex CharStyle:Code
10041 \begin_layout Plain Layout
10048 \begin_inset Quotes erd
10051 in the normal font.
10052 You can get a negative width by prefixing the string with
10053 \begin_inset Quotes eld
10057 \begin_inset Flex CharStyle:Code
10060 \begin_layout Plain Layout
10067 \begin_inset Quotes erd
10071 This way was chosen so that the look is the same with each used screen
10076 \begin_layout Description
10077 \begin_inset Flex CharStyle:Code
10080 \begin_layout Plain Layout
10087 \begin_inset Flex CharStyle:Code
10090 \begin_layout Plain Layout
10095 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10101 \begin_inset Newline newline
10104 The kind of margin that the layout has on the left side.
10106 \begin_inset Flex CharStyle:Code
10109 \begin_layout Plain Layout
10115 just means a fixed margin.
10117 \begin_inset Flex CharStyle:Code
10120 \begin_layout Plain Layout
10126 means that the left margin depends on the string entered in the
10127 \begin_inset Flex CharStyle:MenuItem
10130 \begin_layout Plain Layout
10135 dit\SpecialChar \menuseparator
10141 \begin_inset space ~
10150 This is used to typeset nice lists without tabulators.
10152 \begin_inset Flex CharStyle:Code
10155 \begin_layout Plain Layout
10161 means that the margin depends on the size of the label.
10162 This is used for automatic enumerated headlines.
10163 It is obvious that the headline
10164 \begin_inset Quotes eld
10167 5.4.3.2.1 Very long headline
10168 \begin_inset Quotes erd
10171 must have a wider left margin (as wide as
10172 \begin_inset Quotes eld
10176 \begin_inset Quotes erd
10179 plus the space) than
10180 \begin_inset Quotes eld
10183 3.2 Very long headline
10184 \begin_inset Quotes erd
10188 \begin_inset Quotes eld
10192 \begin_inset Quotes erd
10195 are not able to do this.
10197 \begin_inset Flex CharStyle:Code
10200 \begin_layout Plain Layout
10206 is similar, but only the very first row of the paragraph is dynamic, while
10207 the others are static; this is used, for example, for descriptions.
10209 \begin_inset Flex CharStyle:Code
10212 \begin_layout Plain Layout
10218 means the margin is chosen in a way that the longest row of this paragraph
10219 fits to the right margin.
10220 This is used to typeset an address on the right edge of the page.
10223 \begin_layout Description
10224 \begin_inset Flex CharStyle:Code
10227 \begin_layout Plain Layout
10234 \begin_inset Flex CharStyle:Code
10237 \begin_layout Plain Layout
10246 \begin_inset Flex CharStyle:Code
10249 \begin_layout Plain Layout
10255 ] Whether fragile commands in this layout should be
10256 \begin_inset Flex CharStyle:Code
10259 \begin_layout Plain Layout
10272 whether this command should itself be protected.)
10275 \begin_layout Description
10276 \begin_inset Flex CharStyle:Code
10279 \begin_layout Plain Layout
10286 \begin_inset Flex CharStyle:Code
10289 \begin_layout Plain Layout
10296 \begin_inset Flex CharStyle:Code
10299 \begin_layout Plain Layout
10307 ] Whether newlines are translated into LaTeX newlines (
10308 \begin_inset Flex CharStyle:Code
10311 \begin_layout Plain Layout
10322 The translation can be switched off to allow more comfortable LaTeX editing
10326 \begin_layout Description
10327 \begin_inset Flex CharStyle:Code
10330 \begin_layout Plain Layout
10337 \begin_inset Flex CharStyle:Code
10340 \begin_layout Plain Layout
10347 \begin_inset Flex CharStyle:Code
10350 \begin_layout Plain Layout
10358 ] Whether the following Paragraph is allowed to indent its very first row.
10360 \begin_inset Flex CharStyle:Code
10363 \begin_layout Plain Layout
10369 means that it is not allowed to do so;
10370 \begin_inset Flex CharStyle:Code
10373 \begin_layout Plain Layout
10379 means it could do so if it wants to.
10382 \begin_layout Description
10383 \begin_inset Flex CharStyle:Code
10386 \begin_layout Plain Layout
10393 \change_deleted 1 1223265997
10395 \change_inserted 1 1223266000
10396 Name of a layout that has replaced this layout.
10397 This is used to rename a layout, while keeping backward compatibility.
10402 \begin_layout Description
10403 \begin_inset Flex CharStyle:Code
10406 \begin_layout Plain Layout
10413 \begin_inset Flex CharStyle:Code
10416 \begin_layout Plain Layout
10422 ] The number of optional arguments that can be used with this layout.
10423 This is useful for things like section headings, and only makes sense with
10427 \begin_layout Description
10428 \begin_inset Flex CharStyle:Code
10431 \begin_layout Plain Layout
10438 \begin_inset Flex CharStyle:Code
10441 \begin_layout Plain Layout
10447 ] The indent of the very first line of a paragraph.
10449 \begin_inset Flex CharStyle:Code
10452 \begin_layout Plain Layout
10458 will be fixed for a certain layout.
10459 The exception is Standard layout, since the indentation of a Standard layout
10460 paragraph can be prohibited with
10461 \begin_inset Flex CharStyle:Code
10464 \begin_layout Plain Layout
10471 Also, Standard layout paragraphs inside environments use the
10472 \begin_inset Flex CharStyle:Code
10475 \begin_layout Plain Layout
10481 of the environment, not their native one.
10482 For example, Standard paragraphs inside an enumeration are not indented.
10485 \begin_layout Description
10486 \begin_inset Flex CharStyle:Code
10489 \begin_layout Plain Layout
10496 \begin_inset Flex CharStyle:Code
10499 \begin_layout Plain Layout
10505 ] The vertical space between two paragraphs of this layout.
10508 \begin_layout Description
10509 \begin_inset Flex CharStyle:Code
10512 \begin_layout Plain Layout
10519 \begin_inset Flex CharStyle:Code
10522 \begin_layout Plain Layout
10528 ] LyX allows the user to choose either
10529 \begin_inset Quotes eld
10533 \begin_inset Quotes erd
10537 \begin_inset Quotes eld
10541 \begin_inset Quotes erd
10544 to typeset a document.
10546 \begin_inset Quotes eld
10550 \begin_inset Quotes erd
10553 is chosen, this value is completely ignored.
10555 \begin_inset Quotes eld
10559 \begin_inset Quotes erd
10562 is chosen, the parindent of a LaTeXtype
10563 \begin_inset Quotes eld
10567 \begin_inset Quotes erd
10570 layout is ignored and all paragraphs are separated by this parskip argument.
10571 The vertical space is calculated with
10572 \begin_inset Flex CharStyle:Code
10575 \begin_layout Plain Layout
10577 \begin_inset space ~
10586 \begin_inset Flex CharStyle:Code
10589 \begin_layout Plain Layout
10595 is the height of a row with the normal font.
10596 This way, the look stays the same with different screen fonts.
10599 \begin_layout Description
10600 \begin_inset Flex CharStyle:Code
10603 \begin_layout Plain Layout
10610 \change_inserted 1 1223264275
10612 \begin_inset CommandInset label
10614 name "des:PathThru"
10623 \begin_inset Flex CharStyle:Code
10626 \begin_layout Plain Layout
10637 \begin_inset Flex CharStyle:Code
10640 \begin_layout Plain Layout
10646 ] Whether the contents of this paragraph should be output in raw form, meaning
10647 without special translations that LaTeX would require.
10650 \begin_layout Description
10651 \begin_inset Flex CharStyle:Code
10654 \begin_layout Plain Layout
10661 \begin_inset CommandInset label
10663 name "des:Preamble"
10667 Information to be included in the LaTeX preamable when this style is used.
10668 Used to define macros, load packages, etc., required by this particular
10671 \begin_inset Quotes eld
10675 \begin_inset Flex CharStyle:Code
10678 \begin_layout Plain Layout
10685 \begin_inset Quotes erd
10691 \begin_layout Description
10692 \begin_inset Flex CharStyle:Code
10695 \begin_layout Plain Layout
10702 \begin_inset Flex CharStyle:Code
10705 \begin_layout Plain Layout
10712 \begin_inset CommandInset label
10714 name "des:Requires"
10718 Whether the layout requires the feature
10719 \begin_inset Flex CharStyle:Code
10722 \begin_layout Plain Layout
10729 See the description of
10730 \begin_inset Flex CharStyle:Code
10733 \begin_layout Plain Layout
10740 \begin_inset CommandInset ref
10741 LatexCommand pageref
10742 reference "des:FreeSpacing"
10746 ) for information on `features'.
10750 \begin_layout Description
10751 \begin_inset Flex CharStyle:Code
10754 \begin_layout Plain Layout
10761 \begin_inset Flex CharStyle:Code
10764 \begin_layout Plain Layout
10771 \begin_inset Flex CharStyle:Code
10774 \begin_layout Plain Layout
10783 \begin_layout Description
10784 \begin_inset Flex CharStyle:Code
10787 \begin_layout Plain Layout
10794 \begin_inset Flex CharStyle:Code
10797 \begin_layout Plain Layout
10802 , onehalf, double, other
10811 ] This defines what the default spacing should be in the layout.
10813 \begin_inset Flex CharStyle:Code
10816 \begin_layout Plain Layout
10823 \begin_inset Flex CharStyle:Code
10826 \begin_layout Plain Layout
10833 \begin_inset Flex CharStyle:Code
10836 \begin_layout Plain Layout
10842 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
10843 If you specify the argument
10844 \begin_inset Flex CharStyle:Code
10847 \begin_layout Plain Layout
10853 , then you should also provide a numerical argument which will be the actual
10855 Note that, contrary to other parameters,
10856 \begin_inset Flex CharStyle:Code
10859 \begin_layout Plain Layout
10865 implies the generation of specific LaTeX code, using the package
10868 \begin_inset Flex CharStyle:Code
10871 \begin_layout Plain Layout
10880 \begin_layout Description
10881 \begin_inset Flex CharStyle:Code
10884 \begin_layout Plain Layout
10890 The font used for the text body .
10892 \begin_inset CommandInset ref
10894 reference "sec:fonts"
10901 \begin_layout Description
10903 \change_deleted 1 1223265258
10907 \begin_inset Flex CharStyle:Code
10910 \begin_layout Plain Layout
10918 The level of the style in the table of contents.
10919 This is used for automatic numbering of section headings.
10922 \begin_layout Description
10923 \begin_inset Flex CharStyle:Code
10926 \begin_layout Plain Layout
10933 \begin_inset Flex CharStyle:Code
10936 \begin_layout Plain Layout
10942 ] The vertical space with which the very first of a chain of paragraphs
10943 with this layout is separated from the previous paragraph.
10944 If the previous paragraph has another layout, the separations are not simply
10945 added, but the maximum is taken.
10948 \begin_layout Subsection
10952 \begin_layout Standard
10953 \begin_inset CommandInset label
10959 Since version 1.3.0 of LyX, it is has been both possible and necessary to
10960 define the floats (
10961 \begin_inset Flex CharStyle:MenuItem
10964 \begin_layout Plain Layout
10971 \begin_inset Flex CharStyle:MenuItem
10974 \begin_layout Plain Layout
10980 , \SpecialChar \ldots{}
10981 ) in the text class itself.
10982 Standard floats are included in the file
10983 \begin_inset Flex CharStyle:Code
10986 \begin_layout Plain Layout
10992 , so you may have to do no more than add
10995 \begin_layout LyX-Code
10996 Input stdfloats.inc
10999 \begin_layout Standard
11000 to your layout file.
11001 If you want to implement a text class that proposes some other float types
11002 (like the AGU class bundled with LyX), the information below will hopefully
11006 \begin_layout Description
11007 \begin_inset Flex CharStyle:Code
11010 \begin_layout Plain Layout
11017 \begin_inset Flex CharStyle:Code
11020 \begin_layout Plain Layout
11027 \begin_inset Quotes erd
11031 \begin_inset Quotes erd
11034 ] The file name extension of an auxiliary file for the list of figures (or
11036 LaTeX writes the captions to this file.
11039 \begin_layout Description
11040 \begin_inset Flex CharStyle:Code
11043 \begin_layout Plain Layout
11050 \begin_inset Flex CharStyle:Code
11053 \begin_layout Plain Layout
11060 \begin_inset Quotes erd
11064 \begin_inset Quotes erd
11067 ] The string that will be used in the menus and also for the caption.
11070 \begin_layout Description
11071 \begin_inset Flex CharStyle:Code
11074 \begin_layout Plain Layout
11081 \begin_inset Flex CharStyle:Code
11084 \begin_layout Plain Layout
11093 \begin_inset Flex CharStyle:Code
11096 \begin_layout Plain Layout
11103 \begin_inset Flex CharStyle:Code
11106 \begin_layout Plain Layout
11112 if the float is already defined by the LaTeX document class.
11114 \begin_inset Flex CharStyle:Code
11117 \begin_layout Plain Layout
11123 , the float will be defined using the LaTeX package
11124 \begin_inset Flex CharStyle:Code
11127 \begin_layout Plain Layout
11136 \begin_layout Description
11137 \begin_inset Flex CharStyle:Code
11140 \begin_layout Plain Layout
11147 \begin_inset Flex CharStyle:Code
11150 \begin_layout Plain Layout
11157 \begin_inset Quotes erd
11161 \begin_inset Quotes erd
11164 ] The heading used for the list of floats.
11167 \begin_layout Description
11168 \begin_inset Flex CharStyle:Code
11171 \begin_layout Plain Layout
11178 \begin_inset Flex CharStyle:Code
11181 \begin_layout Plain Layout
11188 \begin_inset Quotes erd
11192 \begin_inset Quotes erd
11195 ] This (optional) argument determines whether floats of this class will
11196 be numbered within some sectional unit of the document.
11197 For example, if within is equal to
11198 \begin_inset Flex CharStyle:Code
11201 \begin_layout Plain Layout
11207 , the floats will be numbered within chapters.
11211 \begin_layout Description
11212 \begin_inset Flex CharStyle:Code
11215 \begin_layout Plain Layout
11222 \begin_inset Flex CharStyle:Code
11225 \begin_layout Plain Layout
11232 \begin_inset Quotes erd
11236 \begin_inset Quotes erd
11239 ] The default placement for the given class of floats.
11240 The string should be as in standard LaTeX:
11241 \begin_inset Flex CharStyle:Code
11244 \begin_layout Plain Layout
11251 \begin_inset Flex CharStyle:Code
11254 \begin_layout Plain Layout
11261 \begin_inset Flex CharStyle:Code
11264 \begin_layout Plain Layout
11271 \begin_inset Flex CharStyle:Code
11274 \begin_layout Plain Layout
11280 for top, bottom, page, and here, respectively.
11284 \begin_layout Plain Layout
11285 Note that the order of these letters in the string is irrelevant, like in
11291 On top of that there is a new type,
11292 \begin_inset Flex CharStyle:Code
11295 \begin_layout Plain Layout
11301 , which does not really correspond to a float, since it means: put it
11302 \begin_inset Quotes eld
11306 \begin_inset Quotes erd
11310 Note however that the
11311 \begin_inset Flex CharStyle:Code
11314 \begin_layout Plain Layout
11320 specifier is special and, because of implementation details, cannot be
11321 used in non-builtin float types.
11322 If you do not understand what this means, just use
11323 \begin_inset Quotes eld
11327 \begin_inset Flex CharStyle:Code
11330 \begin_layout Plain Layout
11337 \begin_inset Quotes erd
11343 \begin_layout Description
11344 \begin_inset Flex CharStyle:Code
11347 \begin_layout Plain Layout
11354 \begin_inset Flex CharStyle:Code
11357 \begin_layout Plain Layout
11364 \begin_inset Quotes erd
11368 \begin_inset Quotes erd
11371 ] The style used when defining the float using
11372 \begin_inset Flex CharStyle:Code
11375 \begin_layout Plain Layout
11386 \begin_layout Description
11387 \begin_inset Flex CharStyle:Code
11390 \begin_layout Plain Layout
11397 \begin_inset Flex CharStyle:Code
11400 \begin_layout Plain Layout
11407 \begin_inset Quotes erd
11411 \begin_inset Quotes erd
11415 \begin_inset Quotes eld
11419 \begin_inset Quotes erd
11422 of the new class of floats, like program or algorithm.
11423 After the appropriate
11424 \begin_inset Flex CharStyle:Code
11427 \begin_layout Plain Layout
11436 \begin_inset Flex CharStyle:Code
11439 \begin_layout Plain Layout
11448 \begin_inset Flex CharStyle:Code
11451 \begin_layout Plain Layout
11462 \begin_layout Standard
11463 Note that defining a float with type
11464 \begin_inset Flex CharStyle:Code
11467 \begin_layout Plain Layout
11475 automatically defines the corresponding counter with name
11476 \begin_inset Flex CharStyle:Code
11479 \begin_layout Plain Layout
11490 \begin_layout Subsection
11491 Inset layouts and Flex insets
11494 \begin_layout Standard
11495 \begin_inset CommandInset label
11497 name "sec:charstyle"
11501 LyX has supported character styles since version 1.4.0; since version 1.6.0
11502 these are called Flex insets.
11506 \begin_layout Standard
11507 Furthermore, it is possible to define the general layout of many different
11509 Currently, InsetLayout can be used to customize the layout parameters
11510 for footnotes, marginal notes, note insets, ERT insets, branches, listings,
11511 indexes, boxes, tables, algorithms, URLs, and optional arguments, as well
11516 \begin_layout Standard
11517 Flex insets come in three different kinds:
11520 \begin_layout Itemize
11522 \begin_inset Flex CharStyle:Code
11525 \begin_layout Plain Layout
11531 ): These define semantic markup corresponding to such LaTeX commands as
11533 \begin_inset Flex CharStyle:Code
11536 \begin_layout Plain Layout
11545 \begin_inset Flex CharStyle:Code
11548 \begin_layout Plain Layout
11559 \begin_layout Itemize
11561 \begin_inset Flex CharStyle:Code
11564 \begin_layout Plain Layout
11570 ): These can be used to define custom collapsable insets, similar to ERT,
11571 footnote, and the like.
11574 \begin_layout Itemize
11576 \begin_inset Flex CharStyle:Code
11579 \begin_layout Plain Layout
11585 ): For use with DocBook classes.
11588 \begin_layout Standard
11590 \begin_inset Flex CharStyle:Code
11593 \begin_layout Plain Layout
11599 definition starting line is of the form
11602 \begin_layout LyX-Code
11603 InsetLayout <Type> <Name>
11606 \begin_layout Standard
11608 \begin_inset Flex CharStyle:Code
11611 \begin_layout Plain Layout
11618 \begin_inset Flex CharStyle:Code
11621 \begin_layout Plain Layout
11628 \begin_inset Flex CharStyle:Code
11631 \begin_layout Plain Layout
11638 \begin_inset Flex CharStyle:Code
11641 \begin_layout Plain Layout
11648 \begin_inset Flex CharStyle:Code
11651 \begin_layout Plain Layout
11658 \begin_inset Flex CharStyle:Code
11661 \begin_layout Plain Layout
11668 \begin_inset Flex CharStyle:Code
11671 \begin_layout Plain Layout
11678 \begin_inset Flex CharStyle:Code
11681 \begin_layout Plain Layout
11688 \begin_inset Flex CharStyle:Code
11691 \begin_layout Plain Layout
11698 \begin_inset Flex CharStyle:Code
11701 \begin_layout Plain Layout
11708 \begin_inset Flex CharStyle:Code
11711 \begin_layout Plain Layout
11718 \begin_inset Flex CharStyle:Code
11721 \begin_layout Plain Layout
11728 \begin_inset Flex CharStyle:Code
11731 \begin_layout Plain Layout
11738 \begin_inset Flex CharStyle:Code
11741 \begin_layout Plain Layout
11748 \begin_inset Flex CharStyle:Code
11751 \begin_layout Plain Layout
11758 \begin_inset Flex CharStyle:Code
11761 \begin_layout Plain Layout
11768 \begin_inset Flex CharStyle:Code
11771 \begin_layout Plain Layout
11779 \begin_inset Flex CharStyle:Code
11782 \begin_layout Plain Layout
11789 \begin_inset Flex CharStyle:Code
11792 \begin_layout Plain Layout
11799 \begin_inset Flex CharStyle:Code
11802 \begin_layout Plain Layout
11808 should have the form
11809 \begin_inset Flex CharStyle:Code
11812 \begin_layout Plain Layout
11819 \begin_inset Flex CharStyle:Code
11822 \begin_layout Plain Layout
11829 \begin_inset Flex CharStyle:Code
11832 \begin_layout Plain Layout
11839 \begin_inset Flex CharStyle:Code
11842 \begin_layout Plain Layout
11849 \begin_inset Flex CharStyle:Code
11852 \begin_layout Plain Layout
11859 \begin_inset Flex CharStyle:Code
11862 \begin_layout Plain Layout
11868 is any valid identifier.
11872 \begin_layout Standard
11874 \begin_inset Flex CharStyle:Code
11877 \begin_layout Plain Layout
11883 section can contain the following entries:
11886 \begin_layout Description
11887 \begin_inset Flex CharStyle:Code
11890 \begin_layout Plain Layout
11896 The color for the inset's background.
11897 These valid colors are defined in
11898 \begin_inset Flex CharStyle:Code
11901 \begin_layout Plain Layout
11910 \begin_layout Description
11911 \begin_inset Flex CharStyle:Code
11914 \begin_layout Plain Layout
11920 As with paragraph styles (see page
11921 \begin_inset CommandInset ref
11923 reference "des:CopyStyle"
11928 \change_inserted 1 1223263809
11932 \begin_layout Description
11934 \change_inserted 1 1223263872
11935 \begin_inset Flex CharStyle:Code
11938 \begin_layout Plain Layout
11940 \change_inserted 1 1223263814
11947 \begin_inset Flex CharStyle:Code
11950 \begin_layout Plain Layout
11952 \change_inserted 1 1223263839
11961 \begin_inset Flex CharStyle:Code
11964 \begin_layout Plain Layout
11966 \change_inserted 1 1223263839
11972 ] Indicates whether the user may employ the Paragraph Settings dialog to
11973 customize the paragraph.
11978 \begin_layout Description
11979 \begin_inset Flex CharStyle:Code
11982 \begin_layout Plain Layout
11989 \begin_inset Flex CharStyle:Code
11992 \begin_layout Plain Layout
11999 \begin_inset Flex CharStyle:Code
12002 \begin_layout Plain Layout
12009 \begin_inset Flex CharStyle:Code
12012 \begin_layout Plain Layout
12018 , describing the rendering style used for the inset's frame and buttons.
12019 Footnotes generally use
12020 \begin_inset Flex CharStyle:Code
12023 \begin_layout Plain Layout
12029 ; ERT insets generally use
12030 \begin_inset Flex CharStyle:Code
12033 \begin_layout Plain Layout
12039 ; and character styles use
12040 \begin_inset Flex CharStyle:Code
12043 \begin_layout Plain Layout
12050 \change_inserted 1 1223264047
12054 \begin_layout Description
12056 \change_inserted 1 1223264091
12057 \begin_inset Flex CharStyle:Code
12060 \begin_layout Plain Layout
12062 \change_inserted 1 1223264053
12070 Required at the end of the InsetLayout declarations.
12075 \begin_layout Description
12076 \begin_inset Flex CharStyle:Code
12079 \begin_layout Plain Layout
12085 The font used for both the text body
12091 \begin_inset space ~
12095 \begin_inset CommandInset ref
12097 reference "sec:fonts"
12102 Note that defining this font automatically defines the
12103 \begin_inset Flex CharStyle:Code
12106 \begin_layout Plain Layout
12112 to the same value, so define this first and define
12113 \begin_inset Flex CharStyle:Code
12116 \begin_layout Plain Layout
12122 later if you want them to be different.
12125 \begin_layout Description
12126 \begin_inset Flex CharStyle:Code
12129 \begin_layout Plain Layout
12136 \change_inserted 1 1223263904
12140 \begin_layout Description
12142 \change_inserted 1 1223263954
12143 \begin_inset Flex CharStyle:Code
12146 \begin_layout Plain Layout
12148 \change_inserted 1 1223263911
12157 \begin_inset Flex CharStyle:Code
12160 \begin_layout Plain Layout
12162 \change_inserted 1 1223263915
12171 \begin_inset Flex CharStyle:Code
12174 \begin_layout Plain Layout
12176 \change_inserted 1 1223263915
12182 ] Indicates whether the PlainLayout should be used or, instead, the user
12183 can change the paragraph style used in the inset.
12188 \begin_layout Description
12189 \begin_inset Flex CharStyle:Code
12192 \begin_layout Plain Layout
12198 As with paragraph styles (see page
12199 \begin_inset CommandInset ref
12200 LatexCommand pageref
12201 reference "des:FreeSpacing"
12208 \begin_layout Description
12209 \begin_inset Flex CharStyle:Code
12212 \begin_layout Plain Layout
12218 As with paragraph styles (see page
12219 \begin_inset CommandInset ref
12220 LatexCommand pageref
12221 reference "des:KeepEmpty"
12228 \begin_layout Description
12230 \change_deleted 1 1223264111
12231 \begin_inset Flex CharStyle:Code
12234 \begin_layout Plain Layout
12240 What will be displayed on the button or elsewhere as the inset label.
12241 Some inset types (ERT and Branch) modify this label on the fly.
12244 \begin_layout Description
12245 \begin_inset Flex CharStyle:Code
12248 \begin_layout Plain Layout
12254 The font used for the label.
12256 \begin_inset space ~
12260 \begin_inset CommandInset ref
12262 reference "sec:fonts"
12267 Note that this definition can never appear before
12268 \begin_inset Flex CharStyle:Code
12271 \begin_layout Plain Layout
12277 , lest it be ineffective.
12280 \begin_layout Description
12282 \change_inserted 1 1223264113
12283 \begin_inset Flex CharStyle:Code
12286 \begin_layout Plain Layout
12288 \change_inserted 1 1223264113
12294 What will be displayed on the button or elsewhere as the inset label.
12295 Some inset types (ERT and Branch) modify this label on the fly.
12298 \begin_layout Description
12299 \begin_inset Flex CharStyle:Code
12302 \begin_layout Plain Layout
12308 The name of the corresponding LaTeX stuff.
12309 Either the environment or command name.
12312 \begin_layout Description
12313 \begin_inset Flex CharStyle:Code
12316 \begin_layout Plain Layout
12322 The optional parameter for the corresponding
12323 \begin_inset Flex CharStyle:Code
12326 \begin_layout Plain Layout
12332 stuff, including possible bracket pairs like
12333 \begin_inset Flex CharStyle:Code
12336 \begin_layout Plain Layout
12343 This parameter cannot be changed from within LyX.
12346 \begin_layout Description
12347 \begin_inset Flex CharStyle:Code
12350 \begin_layout Plain Layout
12356 As with paragraph styles (see page
12357 \begin_inset CommandInset ref
12358 LatexCommand pageref
12359 reference "des:LatexType"
12366 \begin_layout Description
12367 \begin_inset Flex CharStyle:Code
12370 \begin_layout Plain Layout
12377 \begin_inset Flex CharStyle:Code
12380 \begin_layout Plain Layout
12387 \begin_inset Flex CharStyle:Code
12390 \begin_layout Plain Layout
12397 \begin_inset Flex CharStyle:Code
12400 \begin_layout Plain Layout
12407 \begin_inset Flex CharStyle:Code
12410 \begin_layout Plain Layout
12416 (indicating a dummy definition ending definitions of charstyles etc.).
12417 This entry is only meaningful for Flex (user definable) insets.
12418 \change_inserted 1 1223264124
12422 \begin_layout Description
12424 \change_inserted 1 1223264224
12425 \begin_inset Flex CharStyle:Code
12428 \begin_layout Plain Layout
12430 \change_inserted 1 1223264131
12439 \begin_inset Flex CharStyle:Code
12442 \begin_layout Plain Layout
12444 \change_inserted 1 1223264137
12453 \begin_inset Flex CharStyle:Code
12456 \begin_layout Plain Layout
12458 \change_inserted 1 1223264137
12464 ] Whether multiple paragraphs are permitted in this inset.
12465 This will also set CustomPars to the same value and ForcePlain to the opposite
12467 These can be reset to other values, if they are used
12476 \begin_layout Description
12477 \begin_inset Flex CharStyle:Code
12480 \begin_layout Plain Layout
12487 \begin_inset Flex CharStyle:Code
12490 \begin_layout Plain Layout
12499 \begin_inset Flex CharStyle:Code
12502 \begin_layout Plain Layout
12508 ] Whether fragile commands in this layout should be
12509 \begin_inset Flex CharStyle:Code
12512 \begin_layout Plain Layout
12525 whether this command should itself be protected.)
12526 \change_inserted 1 1223264245
12530 \begin_layout Description
12532 \change_inserted 1 1223264288
12533 \begin_inset Flex CharStyle:Code
12536 \begin_layout Plain Layout
12538 \change_inserted 1 1223264250
12547 \begin_inset Flex CharStyle:Code
12550 \begin_layout Plain Layout
12552 \change_inserted 1 1223264254
12561 \begin_inset Flex CharStyle:Code
12564 \begin_layout Plain Layout
12566 \change_inserted 1 1223264254
12572 ] As with paragraph styles (see page
12573 \begin_inset CommandInset ref
12575 reference "des:PathThru"
12584 \begin_layout Description
12585 \begin_inset Flex CharStyle:Code
12588 \begin_layout Plain Layout
12594 As with paragraph styles (see page
12595 \begin_inset CommandInset ref
12596 LatexCommand pageref
12597 reference "des:Preamble"
12604 \begin_layout Description
12605 \begin_inset Flex CharStyle:Code
12608 \begin_layout Plain Layout
12615 \begin_inset Flex CharStyle:Code
12618 \begin_layout Plain Layout
12624 ] As with paragraph styles (see page
12625 \begin_inset CommandInset ref
12626 LatexCommand pageref
12627 reference "des:Requires"
12634 \begin_layout Subsection
12638 \begin_layout Standard
12639 \begin_inset CommandInset label
12645 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12647 \begin_inset Flex CharStyle:MenuItem
12650 \begin_layout Plain Layout
12657 \begin_inset Flex CharStyle:MenuItem
12660 \begin_layout Plain Layout
12666 , \SpecialChar \ldots{}
12667 ) in the text class itself.
12668 The standard counters are defined in the file
12669 \begin_inset Flex CharStyle:Code
12672 \begin_layout Plain Layout
12678 , so you may have to do no more than add
12681 \begin_layout LyX-Code
12682 Input stdcounters.inc
12685 \begin_layout Standard
12686 to your layout file to get them to work.
12687 But if you want to define custom counters, then you can do so
12688 \change_inserted 0 1223303986
12690 The counter declaration must begin with:
12693 \begin_layout LyX-Code
12695 \change_inserted 0 1223304011
12699 \begin_layout Standard
12701 \change_inserted 0 1223304074
12702 where of course `name' is replaced by the name of the counter.
12703 And it must end with
12704 \begin_inset Quotes eld
12708 \begin_inset Flex CharStyle:Code
12711 \begin_layout Plain Layout
12713 \change_inserted 0 1223304038
12722 \begin_inset Quotes erd
12727 \change_deleted 0 1223304075
12728 , using the following
12731 \change_inserted 0 1223304083
12737 \begin_layout Description
12738 \begin_inset Flex CharStyle:Code
12741 \begin_layout Plain Layout
12742 LabelString [string=""]
12747 when this is defined, this string defines how the counter is displayed.
12748 Setting this value sets
12749 \begin_inset Flex CharStyle:Code
12752 \begin_layout Plain Layout
12753 LabelStringAppendix
12759 The following special constructs can be used in the string:
12763 \begin_layout Itemize
12764 \begin_inset Flex CharStyle:Code
12767 \begin_layout Plain Layout
12775 will be replaced by the expansion of the
12776 \begin_inset Flex CharStyle:Code
12779 \begin_layout Plain Layout
12786 \begin_inset Flex CharStyle:Code
12789 \begin_layout Plain Layout
12790 LabelStringAppendix
12796 \begin_inset Flex CharStyle:Code
12799 \begin_layout Plain Layout
12809 \begin_layout Itemize
12810 counter values can be expressed using LaTeX-like macros
12811 \begin_inset Flex CharStyle:Code
12814 \begin_layout Plain Layout
12831 \begin_inset Flex CharStyle:Code
12834 \begin_layout Plain Layout
12846 \begin_layout Plain Layout
12856 Actually, the situation is a bit more complicated: any
12875 other than those descibed below will produce arabic numerals.
12876 It would not be surprising to see this change in the future.
12882 \begin_inset Flex CharStyle:Code
12885 \begin_layout Plain Layout
12891 : 1, 2, 3,\SpecialChar \ldots{}
12893 \begin_inset Flex CharStyle:Code
12896 \begin_layout Plain Layout
12902 for lower-case letters: a, b, c, \SpecialChar \ldots{}
12904 \begin_inset Flex CharStyle:Code
12907 \begin_layout Plain Layout
12913 for upper-case letters: A, B, C, \SpecialChar \ldots{}
12915 \begin_inset Flex CharStyle:Code
12918 \begin_layout Plain Layout
12924 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
12926 \begin_inset Flex CharStyle:Code
12929 \begin_layout Plain Layout
12935 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
12937 \begin_inset Flex CharStyle:Code
12940 \begin_layout Plain Layout
12946 for hebrew numerals.
12950 \begin_layout Standard
12951 If LabelString is not defined, a default value is constructed as follows:
12952 if the counter has a master counter
12953 \begin_inset Flex CharStyle:Code
12956 \begin_layout Plain Layout
12963 \begin_inset Flex CharStyle:Code
12966 \begin_layout Plain Layout
12973 \begin_inset Flex CharStyle:Code
12976 \begin_layout Plain Layout
12986 is used; otherwise the string
12987 \begin_inset Flex CharStyle:Code
12990 \begin_layout Plain Layout
13001 \begin_layout Description
13002 \begin_inset Flex CharStyle:Code
13005 \begin_layout Plain Layout
13006 LabelStringAppendix [string=""]
13012 \begin_inset Flex CharStyle:Code
13015 \begin_layout Plain Layout
13022 \change_inserted 0 1223304142
13023 , but for use in the Appendix
13028 \begin_layout Description
13030 \change_deleted 0 1223303919
13031 \begin_inset Flex CharStyle:Code
13034 \begin_layout Plain Layout
13041 \begin_inset Flex CharStyle:Code
13044 \begin_layout Plain Layout
13051 \begin_inset Quotes erd
13055 \begin_inset Quotes erd
13058 ] The name of the counter.
13061 \begin_layout Description
13062 \begin_inset Flex CharStyle:Code
13065 \begin_layout Plain Layout
13072 \begin_inset Flex CharStyle:Code
13075 \begin_layout Plain Layout
13082 \begin_inset Quotes erd
13086 \begin_inset Quotes erd
13089 ] If this is set to the name of another counter, the present counter will
13090 be reset everytime the other one is increased.
13092 \begin_inset Flex CharStyle:Code
13095 \begin_layout Plain Layout
13102 \begin_inset Flex CharStyle:Code
13105 \begin_layout Plain Layout
13114 \begin_layout Subsection
13118 \begin_layout Standard
13119 \begin_inset CommandInset label
13125 A font description looks like this:
13128 \begin_layout LyX-Code
13138 \begin_layout LyX-Code
13142 \begin_layout LyX-Code
13146 \begin_layout Standard
13147 The following commands are available:
13150 \begin_layout Description
13151 \begin_inset Flex CharStyle:Code
13154 \begin_layout Plain Layout
13161 \begin_inset Flex CharStyle:Code
13164 \begin_layout Plain Layout
13173 \begin_inset Flex CharStyle:Code
13176 \begin_layout Plain Layout
13183 \begin_inset Flex CharStyle:Code
13186 \begin_layout Plain Layout
13193 \begin_inset Flex CharStyle:Code
13196 \begin_layout Plain Layout
13203 \begin_inset Flex CharStyle:Code
13206 \begin_layout Plain Layout
13213 \begin_inset Flex CharStyle:Code
13216 \begin_layout Plain Layout
13223 \begin_inset Flex CharStyle:Code
13226 \begin_layout Plain Layout
13233 \begin_inset Flex CharStyle:Code
13236 \begin_layout Plain Layout
13243 \begin_inset Flex CharStyle:Code
13246 \begin_layout Plain Layout
13255 \begin_layout Description
13256 \begin_inset Flex CharStyle:Code
13259 \begin_layout Plain Layout
13268 \begin_inset Flex CharStyle:Code
13271 \begin_layout Plain Layout
13282 \begin_inset Flex CharStyle:Code
13285 \begin_layout Plain Layout
13292 \begin_inset Flex CharStyle:Code
13295 \begin_layout Plain Layout
13304 \begin_layout Description
13305 \begin_inset Flex CharStyle:Code
13308 \begin_layout Plain Layout
13315 \begin_inset Flex CharStyle:Code
13318 \begin_layout Plain Layout
13324 ] Valid argument sare:
13325 \begin_inset Flex CharStyle:Code
13328 \begin_layout Plain Layout
13335 \begin_inset Flex CharStyle:Code
13338 \begin_layout Plain Layout
13345 \begin_inset Flex CharStyle:Code
13348 \begin_layout Plain Layout
13355 \begin_inset Flex CharStyle:Code
13358 \begin_layout Plain Layout
13365 \begin_inset Flex CharStyle:Code
13368 \begin_layout Plain Layout
13375 \begin_inset Flex CharStyle:Code
13378 \begin_layout Plain Layout
13385 Each of these turns on or off the corresponding attribute.
13388 \begin_layout Description
13389 \begin_inset Flex CharStyle:Code
13392 \begin_layout Plain Layout
13401 \begin_inset Flex CharStyle:Code
13404 \begin_layout Plain Layout
13415 \begin_inset Flex CharStyle:Code
13418 \begin_layout Plain Layout
13427 \begin_layout Description
13428 \begin_inset Flex CharStyle:Code
13431 \begin_layout Plain Layout
13440 \begin_inset Flex CharStyle:Code
13443 \begin_layout Plain Layout
13454 \begin_inset Flex CharStyle:Code
13457 \begin_layout Plain Layout
13464 \begin_inset Flex CharStyle:Code
13467 \begin_layout Plain Layout
13474 \begin_inset Flex CharStyle:Code
13477 \begin_layout Plain Layout
13486 \begin_layout Description
13487 \begin_inset Flex CharStyle:Code
13490 \begin_layout Plain Layout
13497 \begin_inset Flex CharStyle:Code
13500 \begin_layout Plain Layout
13507 \begin_inset Flex CharStyle:Code
13510 \begin_layout Plain Layout
13517 \begin_inset Flex CharStyle:Code
13520 \begin_layout Plain Layout
13529 \begin_inset Flex CharStyle:Code
13532 \begin_layout Plain Layout
13539 \begin_inset Flex CharStyle:Code
13542 \begin_layout Plain Layout
13549 \begin_inset Flex CharStyle:Code
13552 \begin_layout Plain Layout
13559 \begin_inset Flex CharStyle:Code
13562 \begin_layout Plain Layout
13569 \begin_inset Flex CharStyle:Code
13572 \begin_layout Plain Layout
13581 \begin_layout Subsection
13582 Upgrading old layout files
13585 \begin_layout Standard
13586 The file format of layout files changes from time to time, so old layout
13587 files need to be converted.
13588 This process has been automated since LyX 1.4.0: If LyX reads an old format
13589 layout file it will call the conversion tool
13590 \begin_inset Flex CharStyle:Code
13593 \begin_layout Plain Layout
13594 LyXDir/scripts/layout2layout.py
13599 and convert it to a temporary file in current format.
13600 The original file is left untouched.
13601 If you want to convert the layout file permanently, just call the converter
13605 \begin_layout LyX-Code
13606 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13609 \begin_layout Standard
13610 (You need to replace
13611 \begin_inset Flex CharStyle:Code
13614 \begin_layout Plain Layout
13620 with the name of your LyX system directory, unless you happen to have defined
13621 such an environment variable.) Then copy
13622 \begin_inset Flex CharStyle:Code
13625 \begin_layout Plain Layout
13632 \begin_inset Flex CharStyle:Code
13635 \begin_layout Plain Layout
13644 \begin_layout Standard
13645 The automatic conversion only handles syntax changes.
13646 It cannot handle the case where the contents of included files was changed,
13647 so these will have to be converted separately.
13650 \begin_layout Section
13652 \begin_inset CommandInset label
13654 name "sec:templates"
13661 \begin_layout Standard
13662 Templates are created just like usual documents.
13663 The only difference is that usual documents contain all possible settings,
13664 including the font scheme and the paper size.
13665 Usually a user doesn't want a template to overwrite his defaults in these
13667 For that reason, the designer of a template should remove the corresponding
13669 \begin_inset Flex CharStyle:Code
13672 \begin_layout Plain Layout
13681 \begin_inset Flex CharStyle:Code
13684 \begin_layout Plain Layout
13692 from the template LyX file.
13693 This can be done with any simple text-editor, for example
13694 \begin_inset Flex CharStyle:Code
13697 \begin_layout Plain Layout
13704 \begin_inset Flex CharStyle:Code
13707 \begin_layout Plain Layout
13717 \begin_layout Standard
13718 Put the edited template files you create in
13719 \begin_inset Flex CharStyle:Code
13722 \begin_layout Plain Layout
13728 , copy the ones you use from the global template directory in
13729 \begin_inset Flex CharStyle:Code
13732 \begin_layout Plain Layout
13738 to the same place, and redefine the template path in the
13739 \begin_inset Flex CharStyle:MenuItem
13742 \begin_layout Plain Layout
13750 \SpecialChar \menuseparator
13755 references\SpecialChar \menuseparator
13764 \begin_layout Standard
13765 Note that there is a template which has a particular meaning:
13766 \begin_inset Flex CharStyle:Code
13769 \begin_layout Plain Layout
13776 This template is loaded everytime you create a new document with
13777 \begin_inset Flex CharStyle:MenuItem
13780 \begin_layout Plain Layout
13790 \SpecialChar \menuseparator
13792 \begin_inset Flex CharStyle:MenuItem
13795 \begin_layout Plain Layout
13805 in order to provide useful defaults.
13806 To create this template from inside LyX, all you have to do is to open
13807 a document with the correct settings, and use the
13808 \begin_inset Flex CharStyle:MenuItem
13811 \begin_layout Plain Layout
13816 e as Document Defaults
13824 \begin_layout Chapter
13825 Including External Material
13828 \begin_layout Standard
13829 The use of material from sources external to LyX is covered in detail in
13835 This part of the manual covers what needs to happen behind the scenes for
13836 new sorts of material to be included.
13839 \begin_layout Section
13843 \begin_layout Standard
13844 The external material feature is based on the concept of a
13849 A template is a specification of how LyX should interface with a certain
13851 As bundled, LyX comes with predefined templates for Xfig figures, various
13852 raster format images, chess diagrams, and LilyPond music notation.
13853 You can check the actual list by using the menu
13854 \begin_inset Flex CharStyle:MenuItem
13857 \begin_layout Plain Layout
13858 Insert\SpecialChar \menuseparator
13859 File\SpecialChar \menuseparator
13866 Furthermore, it is possible to roll your own template to support a specific
13868 Later we'll describe in more detail what is involved, and hopefully you
13869 will submit all the templates you create so we can include them in a later
13873 \begin_layout Standard
13874 Another basic idea of the external material feature is to distinguish between
13875 the original file that serves as a base for final material and the produced
13876 file that is included in your exported or printed document.
13877 For example, consider the case of a figure produced with
13878 \begin_inset Flex CharStyle:Code
13881 \begin_layout Plain Layout
13888 The Xfig application itself works on an original file with the
13889 \begin_inset Flex CharStyle:Code
13892 \begin_layout Plain Layout
13899 Within XFig, you create and change your figure, and when you are done,
13901 \begin_inset Flex CharStyle:Code
13904 \begin_layout Plain Layout
13911 When you want to include the figure in your document, you invoke
13912 \begin_inset Flex CharStyle:Code
13915 \begin_layout Plain Layout
13921 in order to create a PostScript file that can readily be included in your
13924 \begin_inset Flex CharStyle:Code
13927 \begin_layout Plain Layout
13933 file is the original file, and the PostScript file is the produced file.
13936 \begin_layout Standard
13937 This distinction is important in order to allow updating of the material
13938 while you are in the process of writing the document.
13939 Furthermore, it provides us with the flexibility that is needed to support
13940 multiple export formats.
13941 For instance, in the case of a plain text file, it is not exactly an award-winn
13942 ing idea to include the figure as raw PostScript®.
13943 Instead, you'd either prefer to just include a reference to the figure
13944 or try to invoke some graphics to Ascii converter to make the final result
13945 look similar to the real graphics.
13946 The external material management allows you to do this, because it is parameter
13947 ized on the different export formats that LyX supports.
13950 \begin_layout Standard
13951 Besides supporting the production of different products according to the
13952 exported format, it supports tight integration with editing and viewing
13954 In the case of an XFig figure, you are able to invoke Xfig on the original
13955 file with a single click from within the external material dialog in LyX,
13956 and also preview the produced PostScript file with ghostview with another
13958 No more fiddling around with the command line and/or file browsers to locate
13959 and manipulate the original or produced files.
13960 In this way, you are finally able to take full advantage of the many different
13961 applications that are relevant to use when you write your documents, and
13962 ultimately be more productive.
13965 \begin_layout Section
13966 The external template configuration file
13969 \begin_layout Standard
13970 It is relatively easy to add custom external template definitions to LyX.
13971 However, be aware that doing this in an careless manner most probably
13975 introduce an easily exploitable security hole.
13976 So before you do this, please read the discussion about security in section
13978 \begin_inset CommandInset ref
13980 reference "sec:Security-discussion"
13987 \begin_layout Standard
13988 Having said that, we encourage you to submit any interesting templates that
13993 \begin_layout Standard
13994 The external templates are defined in the
13995 \begin_inset Flex CharStyle:Code
13998 \begin_layout Plain Layout
13999 LyXDir/lib/external_templates
14005 You can place your own version in
14006 \begin_inset Flex CharStyle:Code
14009 \begin_layout Plain Layout
14010 UserDir/external_templates
14018 \begin_layout Standard
14019 A typical template looks like this:
14022 \begin_layout LyX-Code
14026 \begin_layout LyX-Code
14027 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14030 \begin_layout LyX-Code
14034 \begin_layout LyX-Code
14038 \begin_layout LyX-Code
14042 \begin_layout LyX-Code
14046 \begin_layout LyX-Code
14050 \begin_layout LyX-Code
14051 AutomaticProduction true
14054 \begin_layout LyX-Code
14058 \begin_layout LyX-Code
14062 \begin_layout LyX-Code
14066 \begin_layout LyX-Code
14067 TransformCommand Rotate RotationLatexCommand
14070 \begin_layout LyX-Code
14071 TransformCommand Resize ResizeLatexCommand
14074 \begin_layout LyX-Code
14075 Product "$$RotateFront$$ResizeFront
14078 \begin_layout LyX-Code
14083 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14086 \begin_layout LyX-Code
14087 $$ResizeBack$$RotateBack"
14090 \begin_layout LyX-Code
14094 \begin_layout LyX-Code
14095 UpdateResult "$$AbsPath$$Basename.pstex_t"
14098 \begin_layout LyX-Code
14099 Requirement "graphicx"
14102 \begin_layout LyX-Code
14103 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14106 \begin_layout LyX-Code
14107 ReferencedFile latex "$$AbsPath$$Basename.eps"
14110 \begin_layout LyX-Code
14111 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14114 \begin_layout LyX-Code
14118 \begin_layout LyX-Code
14122 \begin_layout LyX-Code
14123 TransformCommand Rotate RotationLatexCommand
14126 \begin_layout LyX-Code
14127 TransformCommand Resize ResizeLatexCommand
14130 \begin_layout LyX-Code
14131 Product "$$RotateFront$$ResizeFront
14134 \begin_layout LyX-Code
14139 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14142 \begin_layout LyX-Code
14143 $$ResizeBack$$RotateBack"
14146 \begin_layout LyX-Code
14147 UpdateFormat pdftex
14150 \begin_layout LyX-Code
14151 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14154 \begin_layout LyX-Code
14155 Requirement "graphicx"
14158 \begin_layout LyX-Code
14159 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14162 \begin_layout LyX-Code
14163 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14166 \begin_layout LyX-Code
14170 \begin_layout LyX-Code
14174 \begin_layout LyX-Code
14175 Product "$$Contents(
14177 "$$AbsPath$$Basename.asc
14182 \begin_layout LyX-Code
14183 UpdateFormat asciixfig
14186 \begin_layout LyX-Code
14187 UpdateResult "$$AbsPath$$Basename.asc"
14190 \begin_layout LyX-Code
14194 \begin_layout LyX-Code
14198 \begin_layout LyX-Code
14199 Product "<graphic fileref=
14201 "$$AbsOrRelPathMaster$$Basename.eps
14206 \begin_layout LyX-Code
14210 \begin_layout LyX-Code
14214 \begin_layout LyX-Code
14215 UpdateResult "$$AbsPath$$Basename.eps"
14218 \begin_layout LyX-Code
14219 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14222 \begin_layout LyX-Code
14223 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14226 \begin_layout LyX-Code
14230 \begin_layout LyX-Code
14231 Product "[XFig: $$FName]"
14234 \begin_layout LyX-Code
14238 \begin_layout LyX-Code
14242 \begin_layout Standard
14243 As you can see, the template is enclosed in
14244 \begin_inset Flex CharStyle:Code
14247 \begin_layout Plain Layout
14253 \SpecialChar \ldots{}
14255 \begin_inset Flex CharStyle:Code
14258 \begin_layout Plain Layout
14265 It contains a header specifying some general settings and, for each supported
14266 primary document file format, a section
14267 \begin_inset Flex CharStyle:Code
14270 \begin_layout Plain Layout
14276 \SpecialChar \ldots{}
14278 \begin_inset Flex CharStyle:Code
14281 \begin_layout Plain Layout
14290 \begin_layout Subsection
14291 The template header
14294 \begin_layout Description
14295 \begin_inset Flex CharStyle:Code
14298 \begin_layout Plain Layout
14299 AutomaticProduction
14300 \begin_inset space ~
14308 Whether the file represented by the template must be generated by LyX.
14309 This command must occur exactly once.
14312 \begin_layout Description
14313 \begin_inset Flex CharStyle:Code
14316 \begin_layout Plain Layout
14318 \begin_inset space ~
14326 A glob pattern that is used in the file dialog to filter out the desired
14328 If there is more than one possible file extension (e.g.
14329 \begin_inset space ~
14333 \begin_inset Flex CharStyle:Code
14336 \begin_layout Plain Layout
14343 \begin_inset Flex CharStyle:Code
14346 \begin_layout Plain Layout
14352 ), use something like
14353 \begin_inset Flex CharStyle:Code
14356 \begin_layout Plain Layout
14363 This command must occur exactly once.
14366 \begin_layout Description
14367 \begin_inset Flex CharStyle:Code
14370 \begin_layout Plain Layout
14372 \begin_inset space ~
14380 The text that is displayed on the button.
14381 This command must occur exactly once.
14384 \begin_layout Description
14385 \begin_inset Flex CharStyle:Code
14388 \begin_layout Plain Layout
14390 \begin_inset space ~
14394 \begin_inset space ~
14402 The help text that is used in the External dialog.
14403 Provide enough information to explain to the user just what the template
14404 can provide him with.
14405 This command must occur exactly once.
14408 \begin_layout Description
14409 \begin_inset Flex CharStyle:Code
14412 \begin_layout Plain Layout
14414 \begin_inset space ~
14422 The file format of the original file.
14423 This must be the name of a format that is known to LyX (see section
14424 \begin_inset CommandInset ref
14426 reference "sub:Formats"
14432 \begin_inset Quotes eld
14436 \begin_inset Flex CharStyle:Code
14439 \begin_layout Plain Layout
14446 \begin_inset Quotes erd
14449 if the template can handle original files of more than one format.
14450 LyX will attempt to interrogate the file itself in order to deduce its
14451 format in this case.
14452 This command must occur exactly once.
14455 \begin_layout Description
14456 \begin_inset Flex CharStyle:Code
14459 \begin_layout Plain Layout
14461 \begin_inset space ~
14469 A unique name for the template.
14470 It must not contain substitution macros (see below).
14473 \begin_layout Description
14474 \begin_inset Flex CharStyle:Code
14477 \begin_layout Plain Layout
14479 \begin_inset space ~
14482 Rotate|Resize|Clip|Extra
14487 This command specifies which transformations are supported by this template.
14488 It may occur zero or more times.
14489 This command enables the corresponding tabs in the external dialog.
14491 \begin_inset Flex CharStyle:Code
14494 \begin_layout Plain Layout
14500 command must have either a corresponding
14501 \begin_inset Flex CharStyle:Code
14504 \begin_layout Plain Layout
14511 \begin_inset Flex CharStyle:Code
14514 \begin_layout Plain Layout
14521 \begin_inset Flex CharStyle:Code
14524 \begin_layout Plain Layout
14531 Otherwise the transformation will not be supported by that format.
14534 \begin_layout Subsection
14538 \begin_layout Description
14539 \begin_inset Flex CharStyle:Code
14542 \begin_layout Plain Layout
14544 \begin_inset space ~
14547 LaTeX|PDFLaTeX|PlainText|DocBook
14552 The primary document file format that this format definition is for.
14553 Not every template has a sensible representation in all document file formats.
14554 Please define nevertheless a
14555 \begin_inset Flex CharStyle:Code
14558 \begin_layout Plain Layout
14564 section for all formats.
14565 Use a dummy text when no representation is available.
14566 Then you can at least see a reference to the external material in the exported
14570 \begin_layout Description
14571 \begin_inset Flex CharStyle:Code
14574 \begin_layout Plain Layout
14576 \begin_inset space ~
14580 \begin_inset space ~
14588 This command defines an additional macro
14589 \begin_inset Flex CharStyle:Code
14592 \begin_layout Plain Layout
14598 for substitution in
14599 \begin_inset Flex CharStyle:Code
14602 \begin_layout Plain Layout
14610 \begin_inset Flex CharStyle:Code
14613 \begin_layout Plain Layout
14619 itself may contain substitution macros.
14620 The advantage over using
14621 \begin_inset Flex CharStyle:Code
14624 \begin_layout Plain Layout
14631 \begin_inset Flex CharStyle:Code
14634 \begin_layout Plain Layout
14640 is that the substituted value of
14641 \begin_inset Flex CharStyle:Code
14644 \begin_layout Plain Layout
14650 is sanitized so that it is a valid optional argument in the document format.
14651 This command may occur zero or more times.
14654 \begin_layout Description
14655 \begin_inset Flex CharStyle:Code
14658 \begin_layout Plain Layout
14660 \begin_inset space ~
14668 The text that is inserted in the exported document.
14669 This is actually the most important command and can be quite complex.
14670 This command must occur exactly once.
14673 \begin_layout Description
14674 \begin_inset Flex CharStyle:Code
14677 \begin_layout Plain Layout
14679 \begin_inset space ~
14687 This command specifies a preamble snippet that will be included in the
14689 It has to be defined using
14690 \begin_inset Flex CharStyle:Code
14693 \begin_layout Plain Layout
14699 \SpecialChar \ldots{}
14701 \begin_inset Flex CharStyle:Code
14704 \begin_layout Plain Layout
14711 This command may occur zero or more times.
14714 \begin_layout Description
14715 \begin_inset Flex CharStyle:Code
14718 \begin_layout Plain Layout
14720 \begin_inset space ~
14724 \begin_inset space ~
14732 This command denotes files that are created by the conversion process and
14733 are needed for a particular export format.
14734 If the filename is relative, it is interpreted relative to the master document.
14735 This command may be given zero or more times.
14738 \begin_layout Description
14739 \begin_inset Flex CharStyle:Code
14742 \begin_layout Plain Layout
14744 \begin_inset space ~
14752 The name of a required LaTeX package.
14753 The package is included via
14754 \begin_inset Flex CharStyle:Code
14757 \begin_layout Plain Layout
14765 in the LaTeX preamble.
14766 This command may occur zero or more times.
14769 \begin_layout Description
14770 \begin_inset Flex CharStyle:Code
14773 \begin_layout Plain Layout
14775 \begin_inset space ~
14779 \begin_inset space ~
14782 RotationLatexCommand
14787 This command specifies that the built in LaTeX command should be used for
14789 This command may occur once or not at all.
14792 \begin_layout Description
14793 \begin_inset Flex CharStyle:Code
14796 \begin_layout Plain Layout
14798 \begin_inset space ~
14802 \begin_inset space ~
14810 This command specifies that the built in LaTeX command should be used for
14812 This command may occur once or not at all.
14815 \begin_layout Description
14816 \begin_inset Flex CharStyle:Code
14819 \begin_layout Plain Layout
14821 \begin_inset space ~
14825 \begin_inset space ~
14828 RotationLatexOption
14833 This command specifies that rotation is done via an optional argument.
14834 This command may occur once or not at all.
14837 \begin_layout Description
14838 \begin_inset Flex CharStyle:Code
14841 \begin_layout Plain Layout
14843 \begin_inset space ~
14847 \begin_inset space ~
14855 This command specifies that resizing is done via an optional argument.
14856 This command may occur once or not at all.
14859 \begin_layout Description
14860 \begin_inset Flex CharStyle:Code
14863 \begin_layout Plain Layout
14865 \begin_inset space ~
14869 \begin_inset space ~
14877 This command specifies that clipping is done via an optional argument.
14878 This command may occur once or not at all.
14881 \begin_layout Description
14882 \begin_inset Flex CharStyle:Code
14885 \begin_layout Plain Layout
14887 \begin_inset space ~
14891 \begin_inset space ~
14899 This command specifies that an extra optional argument is used.
14900 This command may occur once or not at all.
14903 \begin_layout Description
14904 \begin_inset Flex CharStyle:Code
14907 \begin_layout Plain Layout
14909 \begin_inset space ~
14917 The file format of the converted file.
14918 This must be the name of a format that is known to LyX (see the
14919 \begin_inset Flex CharStyle:MenuItem
14922 \begin_layout Plain Layout
14927 ools\SpecialChar \menuseparator
14932 references:Conversion
14938 This command must occur exactly once.
14941 \begin_layout Description
14942 \begin_inset Flex CharStyle:Code
14945 \begin_layout Plain Layout
14947 \begin_inset space ~
14955 The file name of the converted file.
14956 The file name must be absolute.
14957 This command must occur exactly once.
14960 \begin_layout Subsection
14961 Preamble definitions
14964 \begin_layout Standard
14965 The external template configuration file may contain additional preamble
14966 definitions enclosed by
14967 \begin_inset Flex CharStyle:Code
14970 \begin_layout Plain Layout
14976 \SpecialChar \ldots{}
14978 \begin_inset Flex CharStyle:Code
14981 \begin_layout Plain Layout
14988 They can be used by the templates in the
14989 \begin_inset Flex CharStyle:Code
14992 \begin_layout Plain Layout
15001 \begin_layout Section
15002 The substitution mechanism
15005 \begin_layout Standard
15006 When the external material facility invokes an external program, it is done
15007 on the basis of a command defined in the template configuration file.
15008 These commands can contain various macros that are expanded before execution.
15009 Execution always take place in the directory of the containing document.
15012 \begin_layout Standard
15013 Also, whenever external material is to be displayed, the name will be produced
15014 by the substitution mechanism, and most other commands in the template
15015 definition support substitution as well.
15018 \begin_layout Standard
15019 The available macros are the following:
15022 \begin_layout Description
15023 \begin_inset Flex CharStyle:Code
15026 \begin_layout Plain Layout
15027 $$AbsOrRelPathMaster
15032 The file path, absolute or relative to the master LyX document.
15035 \begin_layout Description
15036 \begin_inset Flex CharStyle:Code
15039 \begin_layout Plain Layout
15040 $$AbsOrRelPathParent
15045 The file path, absolute or relative to the LyX document.
15048 \begin_layout Description
15049 \begin_inset Flex CharStyle:Code
15052 \begin_layout Plain Layout
15058 The absolute file path.
15061 \begin_layout Description
15062 \begin_inset Flex CharStyle:Code
15065 \begin_layout Plain Layout
15071 The filename without path and without the extension.
15074 \begin_layout Description
15075 \begin_inset Flex CharStyle:Code
15078 \begin_layout Plain Layout
15080 \begin_inset Quotes eld
15084 \begin_inset Quotes erd
15092 This macro will expand to the contents of the file with the name
15093 \begin_inset Flex CharStyle:Code
15096 \begin_layout Plain Layout
15105 \begin_layout Description
15106 \begin_inset Flex CharStyle:Code
15109 \begin_layout Plain Layout
15115 The file extension (including the dot).
15118 \begin_layout Description
15119 \begin_inset Flex CharStyle:Code
15122 \begin_layout Plain Layout
15128 The filename of the file specified in the external material dialog.
15129 This is either an absolute name, or it is relative to the LyX document.
15132 \begin_layout Description
15133 \begin_inset Flex CharStyle:Code
15136 \begin_layout Plain Layout
15143 \begin_inset Flex CharStyle:Code
15146 \begin_layout Plain Layout
15152 (absolute name or relative to the LyX document).
15155 \begin_layout Description
15156 \begin_inset Flex CharStyle:Code
15159 \begin_layout Plain Layout
15165 The file path, relative to the master LyX document.
15168 \begin_layout Description
15169 \begin_inset Flex CharStyle:Code
15172 \begin_layout Plain Layout
15178 The file path, relative to the LyX document.
15181 \begin_layout Description
15182 \begin_inset Flex CharStyle:Code
15185 \begin_layout Plain Layout
15191 This macro will expand to the absolute path of the system directory.
15192 This is typically used to point to the various helper scripts that are
15196 \begin_layout Description
15197 \begin_inset Flex CharStyle:Code
15200 \begin_layout Plain Layout
15206 A name and full path to a temporary file which will be automatically deleted
15207 whenever the containing document is closed, or the external material insertion
15211 \begin_layout Standard
15212 All path macros contain a trailing directory separator, so you can construct
15214 the absolute filename with
15215 \begin_inset Flex CharStyle:Code
15218 \begin_layout Plain Layout
15219 $$AbsPath$$Basename$$Extension
15227 \begin_layout Standard
15228 The macros above are substituted in all commands unless otherwise noted.
15230 \begin_inset Flex CharStyle:Code
15233 \begin_layout Plain Layout
15239 supports additionally the following substitutions if they are enabled by
15241 \begin_inset Flex CharStyle:Code
15244 \begin_layout Plain Layout
15251 \begin_inset Flex CharStyle:Code
15254 \begin_layout Plain Layout
15263 \begin_layout Description
15264 \begin_inset Flex CharStyle:Code
15267 \begin_layout Plain Layout
15273 The front part of the resize command.
15276 \begin_layout Description
15277 \begin_inset Flex CharStyle:Code
15280 \begin_layout Plain Layout
15286 The back part of the resize command.
15289 \begin_layout Description
15290 \begin_inset Flex CharStyle:Code
15293 \begin_layout Plain Layout
15299 The front part of the rotation command.
15302 \begin_layout Description
15303 \begin_inset Flex CharStyle:Code
15306 \begin_layout Plain Layout
15312 The back part of the rotation command.
15315 \begin_layout Standard
15316 The value string of the
15317 \begin_inset Flex CharStyle:Code
15320 \begin_layout Plain Layout
15326 command supports additionally the following substitutions if they are enabled
15328 \begin_inset Flex CharStyle:Code
15331 \begin_layout Plain Layout
15338 \begin_inset Flex CharStyle:Code
15341 \begin_layout Plain Layout
15350 \begin_layout Description
15351 \begin_inset Flex CharStyle:Code
15354 \begin_layout Plain Layout
15363 \begin_layout Description
15364 \begin_inset Flex CharStyle:Code
15367 \begin_layout Plain Layout
15376 \begin_layout Description
15377 \begin_inset Flex CharStyle:Code
15380 \begin_layout Plain Layout
15389 \begin_layout Description
15390 \begin_inset Flex CharStyle:Code
15393 \begin_layout Plain Layout
15399 The rotation option.
15402 \begin_layout Standard
15403 You may ask why there are so many path macros.
15404 There are mainly two reasons:
15407 \begin_layout Enumerate
15408 Relative and absolute file names should remain relative or absolute, respectivel
15410 Users may have reasons to prefer either form.
15411 Relative names are useful for portable documents that should work on different
15412 machines, for example.
15413 Absolute names may be required by some programs.
15416 \begin_layout Enumerate
15417 LaTeX treats relative file names differently than LyX and other programs
15418 in nested included files.
15419 For LyX, a relative file name is always relative to the document that contains
15421 For LaTeX, it is always relative to the master document.
15422 These two definitions are identical if you have only one document, but
15423 differ if you have a master document that includes part documents.
15424 That means that relative filenames must be transformed when presented to
15426 Fortunately LyX does this automatically for you if you choose the right
15430 \begin_layout Standard
15431 So which path macro should be used in new template definitions? The rule
15435 \begin_layout Itemize
15437 \begin_inset Flex CharStyle:Code
15440 \begin_layout Plain Layout
15446 if an absolute path is required.
15449 \begin_layout Itemize
15451 \begin_inset Flex CharStyle:Code
15454 \begin_layout Plain Layout
15455 $$AbsOrRelPathMaster
15460 if the substituted string is some kind of LaTeX input.
15463 \begin_layout Itemize
15465 \begin_inset Flex CharStyle:Code
15468 \begin_layout Plain Layout
15469 $$AbsOrRelPathParent
15474 in order to preserve the user's choice.
15477 \begin_layout Standard
15478 There are special cases where this rule does not work and e.g.
15479 \begin_inset space ~
15482 relative names are needed, but normally it will work just fine.
15483 One example for such a case is the command
15484 \begin_inset Flex CharStyle:Code
15487 \begin_layout Plain Layout
15488 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15493 in the XFig template above: We can't use the absolute name because the
15495 \begin_inset Flex CharStyle:Code
15498 \begin_layout Plain Layout
15504 files needs the relative name in order to rewrite the file content.
15507 \begin_layout Section
15508 \begin_inset CommandInset label
15510 name "sec:Security-discussion"
15514 Security discussion
15517 \begin_layout Standard
15518 \begin_inset Note Note
15521 \begin_layout Plain Layout
15522 This section is outdated
15527 The external material feature interfaces with a lot of external programs
15528 and does so automatically, so we have to consider the security implications
15530 In particular, since you have the option of including your own filenames
15531 and/or parameter strings and those are expanded into a command, it seems
15532 that it would be possible to create a malicious document which executes
15533 arbitrary commands when a user views or prints the document.
15534 This is something we definately want to avoid.
15537 \begin_layout Standard
15538 However, since the external program commands are specified in the template
15539 configuration file only, there are no security issues if LyX is properly
15540 configured with safe templates only.
15541 This is so because the external programs are invoked with the
15542 \begin_inset Flex CharStyle:Code
15545 \begin_layout Plain Layout
15551 -system call rather than the
15552 \begin_inset Flex CharStyle:Code
15555 \begin_layout Plain Layout
15561 system-call, so it's not possible to execute arbitrary commands from the
15562 filename or parameter section via the shell.
15565 \begin_layout Standard
15566 This also implies that you are restricted in what command strings you can
15567 use in the external material templates.
15568 In particular, pipes and redirection are not readily available.
15569 This has to be so if LyX should remain safe.
15570 If you want to use some of the shell features, you should write a safe
15571 script to do this in a controlled manner, and then invoke the script from
15572 the command string.
15574 \begin_inset Flex CharStyle:Code
15577 \begin_layout Plain Layout
15583 directory of the LyX installation, you can find a safe wrapper script
15584 \begin_inset Flex CharStyle:Code
15587 \begin_layout Plain Layout
15588 general_command_wrapper.py
15593 that supports redirection of input and output.
15594 That can serve as an example for how to write safe template scripts.
15595 For a more advanced example that uses
15596 \begin_inset Flex CharStyle:Code
15599 \begin_layout Plain Layout
15605 and friends, take a look at the
15606 \begin_inset Flex CharStyle:Code
15609 \begin_layout Plain Layout
15618 \begin_layout Standard
15619 It is possible to design a template that interacts directly with the shell,
15620 but since this would allow a malicious user to execute arbitrary commands
15621 by writing clever filenames and/or parameters, we generally recommend that
15622 you only use safe scripts that work with the
15623 \begin_inset Flex CharStyle:Code
15626 \begin_layout Plain Layout
15632 system call in a controlled manner.
15633 Of course, for use in a controlled environment, it can be tempting to just
15634 fall back to use ordinary shell scripts.
15635 If you do so, be aware that you
15639 provide an easily exploitable security hole in your system.
15640 Of course it stands to reason that such unsafe templates will never be
15641 included in the standard LyX distribution, although we do encourage people
15642 to submit new templates in the open source tradition.
15643 But LyX as shipped from the official distribution channels will never have
15647 \begin_layout Standard
15648 Including external material provides a lot of power, and you have to be
15649 careful not to introduce security hazards with this power.
15650 A subtle error in a single line in an innocent looking script can open
15651 the door to huge security problems.
15652 So if you do not fully understand the issues, we recommend that you consult
15653 a knowledgable security professional or the LyX development team if you
15654 have any questions about whether a given template is safe or not.
15655 And do this before you use it in an uncontrolled environment.
15658 \begin_layout Chapter
15662 \begin_layout Section
15666 \begin_layout Standard
15667 The LyX server is a method implemented in LyX that will enable other programs
15668 to talk to LyX, invoke LyX commands, and retrieve information about the
15669 LyX internal state.
15670 This is only intended for advanced users, but they should find it useful.
15671 Please note that, at present,
15673 the server does not work on Windows
15679 \begin_layout Plain Layout
15680 There is no principled reason it cannot do so.
15681 But none of the developers on Windows® have yet implemented this functionality
15690 \begin_layout Section
15691 Starting the LyX Server
15694 \begin_layout Standard
15695 The LyX server works through the use of a pair of named pipes.
15696 These are usually located in
15697 \begin_inset Flex CharStyle:Code
15700 \begin_layout Plain Layout
15707 \begin_inset Quotes eld
15711 \begin_inset Flex CharStyle:Code
15714 \begin_layout Plain Layout
15721 \begin_inset Quotes erd
15725 \begin_inset Quotes eld
15729 \begin_inset Flex CharStyle:Code
15732 \begin_layout Plain Layout
15739 \begin_inset Quotes erd
15743 External programs write into
15744 \begin_inset Flex CharStyle:Code
15747 \begin_layout Plain Layout
15753 and read back data from
15754 \begin_inset Flex CharStyle:Code
15757 \begin_layout Plain Layout
15764 The stem of the pipe names can be defined in the
15765 \begin_inset Flex CharStyle:MenuItem
15768 \begin_layout Plain Layout
15773 ools\SpecialChar \menuseparator
15783 dialog, for example
15784 \begin_inset Flex CharStyle:Code
15787 \begin_layout Plain Layout
15788 "/home/myhome/.lyxpipe"
15796 \begin_layout Standard
15798 \begin_inset Flex CharStyle:Code
15801 \begin_layout Plain Layout
15808 \begin_inset Flex CharStyle:Code
15811 \begin_layout Plain Layout
15817 ' to create the pipes.
15818 The above setting also has the effect of activating the LyX server.
15819 If one of the pipes already exists, LyX will assume that another LyX process
15820 is already running and will not start the server.
15821 To have several LyX processes with servers at the same time, you have to
15822 change the configuration between the start of the programs.
15825 \begin_layout Standard
15826 If you are developing a client program, you might find it useful to enable
15827 debugging information from the LyX server.
15828 Do this by starting LyX as lyx -dbg lyxserver.
15831 \begin_layout Standard
15832 Warning: if LyX crashes, it may not manage to remove the pipes; in this
15833 case you must remove them manually.
15834 If LyX starts and the pipes exist already, it will not start any server.
15837 \begin_layout Standard
15838 Other than this, there are a few points to consider:
15841 \begin_layout Itemize
15842 Both server and clients must run on UNIX or OS/2 machines.
15843 Communications between LyX on UNIX and clients on OS/2 or vice versa is
15844 not possible right now.
15847 \begin_layout Itemize
15848 On OS/2, only one client can connect to LyXServer at a time.
15851 \begin_layout Itemize
15852 On OS/2, clients must open inpipe with
15853 \begin_inset Flex CharStyle:Code
15856 \begin_layout Plain Layout
15865 \begin_layout Standard
15869 \begin_layout Standard
15870 You can find a complete example client written in C in the source distribution
15872 \begin_inset Flex CharStyle:Code
15875 \begin_layout Plain Layout
15876 development/lyxserver/server_monitor.c
15884 \begin_layout Section
15885 Normal communication
15888 \begin_layout Standard
15889 To issue a LyX call, the client writes a line of ASCII text into the input
15891 This line has the following format:
15894 \begin_layout Quote
15908 \begin_layout Description
15913 is a name that the client can choose arbitrarily.
15914 Its only use is that LyX will echo it if it sends an answer---so a client
15915 can dispatch results from different requesters.
15918 \begin_layout Description
15923 is the function you want LyX to perform.
15924 It is the same as the commands you'd use in the minibuffer.
15927 \begin_layout Description
15932 is an optional argument which is meaningful only to some functions (for
15934 \begin_inset Quotes eld
15938 \begin_inset Quotes erd
15941 which will insert the argument as text at the cursor position.)
15944 \begin_layout Standard
15945 The answer from LyX will arrive in the output pipe and be of the form
15948 \begin_layout Quote
15962 \begin_layout Standard
15971 are just echoed from the command request, while
15975 is more or less useful information filled according to how the command
15976 execution worked out.
15977 Some commands will return information about the internal state of LyX,
15979 \begin_inset Quotes eld
15983 \begin_inset Quotes erd
15986 , while other will return an empty data-response.
15987 This means that the command execution went fine.
15990 \begin_layout Standard
15991 In case of errors, the response from LyX will have this form
15994 \begin_layout Quote
16008 \begin_layout Standard
16013 should contain an explanation of why the command failed.
16016 \begin_layout Standard
16020 \begin_layout LyX-Code
16021 echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
16024 \begin_layout LyX-Code
16025 echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
16026 \begin_inset Newline newline
16029 read a <~/.lyxpipe.out
16030 \begin_inset Newline newline
16036 \begin_layout Section
16040 \begin_layout Standard
16041 LyX can notify clients of events going on asynchronously.
16042 Currently it will only do this if the user binds a key sequence with the
16044 \begin_inset Quotes eld
16048 \begin_inset Quotes erd
16052 The format of the string LyX sends is as follows:
16055 \begin_layout Quote
16056 \begin_inset Flex CharStyle:Code
16059 \begin_layout Plain Layout
16070 \begin_layout Standard
16075 is the printed representation of the key sequence that was actually typed
16079 \begin_layout Standard
16080 This mechanism can be used to extend LyX's command set and implement macros:
16081 bind some key sequence to
16082 \begin_inset Quotes eld
16086 \begin_inset Quotes erd
16089 , start a client that listens on the out pipe, dispatches the command according
16090 to the sequence and starts a function that may use LyX calls and LyX requests
16091 to issue a command or a series of commands to LyX.
16094 \begin_layout Section
16095 The simple LyX Server Protocol
16098 \begin_layout Standard
16099 LyX implements a simple protocol that can be used for session management.
16100 All messages are of the form
16103 \begin_layout Quote
16113 \begin_layout Standard
16119 \begin_inset Quotes eld
16123 \begin_inset Quotes erd
16127 \begin_inset Quotes eld
16131 \begin_inset Quotes erd
16136 \begin_inset Quotes eld
16140 \begin_inset Quotes erd
16143 is received from a client, LyX will report back to inform the client that
16144 it's listening to it's messages, while
16145 \begin_inset Quotes eld
16149 \begin_inset Quotes erd
16152 sent from LyX will inform clients that LyX is closing.