1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that this document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of this document may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
39 % used for multi-column text
43 \options fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
44 \use_default_options false
50 InsetLayout CharStyle:MenuItem
59 \newcommand*{\menuitem}[1]{{\sffamily #1}}
67 \font_typewriter default
68 \font_default_family default
76 \default_output_format default
77 \bibtex_command default
78 \index_command default
82 \pdf_title "LyX Configuration Manual"
83 \pdf_author "LyX Team"
84 \pdf_subject "LyX-documentation Customization"
85 \pdf_keywords "LyX, documentation, customization"
87 \pdf_bookmarksnumbered true
88 \pdf_bookmarksopen true
89 \pdf_bookmarksopenlevel 1
94 \pdf_pdfusetitle false
95 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
103 \paperorientation portrait
110 \paragraph_separation indent
112 \quotes_language english
115 \paperpagestyle headings
116 \tracking_changes true
117 \output_changes false
120 \author "Jean-Marc Lasgouttes"
127 Customizing LyX: Features for the Advanced User
135 \begin_layout Plain Layout
137 If you have comments or error corrections, please send them to the LyX Documenta
139 \begin_inset CommandInset href
141 target "lyx-docs@lists.lyx.org"
148 \begin_inset Quotes eld
152 \begin_inset Quotes erd
155 in the subject header, and please cc the current maintainer of this file,
156 Richard Heck <rgheck@comcast.net>.
162 \begin_inset Newline newline
166 \begin_inset Newline newline
172 \begin_layout Standard
173 \begin_inset CommandInset toc
174 LatexCommand tableofcontents
181 \begin_layout Standard
182 \begin_inset Note Note
185 \begin_layout Plain Layout
186 Please use change tracking when modifying this document.
187 This makes it easier for our translators to recognize things that have
188 been changed, and it helps the maintainer keep up-to-date with what's been
197 \begin_layout Chapter
201 \begin_layout Standard
202 This manual covers the customization features present in LyX.
203 In it, we discuss issues like keyboard shortcuts, screen previewing options,
204 printer options, sending commands to LyX via the LyX Server, internationalizati
205 on, installing new LaTeX classes and LyX layouts, etc.
206 We can't possibly hope to touch on everything you can change—our developers
207 add new features faster than we can document them—but we will explain the
208 most common customizations and hopefully point you in the right direction
209 for some of the more obscure ones.
212 \begin_layout Standard
213 \begin_inset Branch OutDated
216 \begin_layout Standard
217 Information from previous versions of this document that now seems to be
218 outdated is contained in the OutDated branch of this document.
219 By default, this information will not appear in the LaTeX output.
227 \begin_layout Chapter
228 LyX configuration files
231 \begin_layout Standard
232 This chapter aims to help you to find your way through the LyX configuration
234 Before continuing to read this chapter, you should find out where your
235 LyX library and user directories are by using
236 \begin_inset Flex CharStyle:MenuItem
239 \begin_layout Plain Layout
240 Help\SpecialChar \menuseparator
251 The library directory is the place where LyX places its system-wide configurati
252 on files; the user directory is where you can place your modified versions.
253 We will call the former
254 \begin_inset Flex CharStyle:Code
257 \begin_layout Plain Layout
264 \begin_inset Flex CharStyle:MenuItem
267 \begin_layout Plain Layout
273 in the remainder of this document.
277 \begin_layout Section
279 \begin_inset Flex CharStyle:Code
282 \begin_layout Plain Layout
291 \begin_layout Standard
292 \begin_inset Flex CharStyle:Code
295 \begin_layout Plain Layout
301 and its sub-directories contain a number of files and that can be used
302 to customize LyX's behavior.
303 You can change many of these files from within LyX itself through the
304 \begin_inset Flex CharStyle:MenuItem
307 \begin_layout Plain Layout
308 Tools\SpecialChar \menuseparator
315 Most customization that you will want to do in LyX is possible through
317 However, many other inner aspects of LyX can be customized by modifying
319 \begin_inset Flex CharStyle:Code
322 \begin_layout Plain Layout
329 These files fall in different categories, described in the following subsection
333 \begin_layout Subsection
334 Automatically generated files
337 \begin_layout Standard
338 The files, which are to be found in
339 \begin_inset Flex CharStyle:MenuItem
342 \begin_layout Plain Layout
348 , are generated when you configure LyX.
349 They contain various default values that are guessed by inspection.
350 In general, it is not a good idea to modify them, since they might be overwritt
354 \begin_layout Labeling
355 \labelwidthstring 00.00.0000
356 \begin_inset Flex CharStyle:Code
359 \begin_layout Plain Layout
365 contains defaults for various commands.
368 \begin_layout Labeling
369 \labelwidthstring 00.00.0000
370 \begin_inset Flex CharStyle:Code
373 \begin_layout Plain Layout
379 contains the list of packages that have been recognized by LyX.
380 It is currently unused by the LyX program itself, but the information extracted
381 , and more, is made available with
382 \begin_inset Flex CharStyle:MenuItem
385 \begin_layout Plain Layout
386 Help\SpecialChar \menuseparator
399 \begin_layout Labeling
400 \labelwidthstring 00.00.0000
401 \begin_inset Flex CharStyle:Code
404 \begin_layout Plain Layout
410 the list of text classes that have been found in your
411 \begin_inset Flex CharStyle:Code
414 \begin_layout Plain Layout
420 directories, along with the associated LaTeX document class and their descripti
424 \begin_layout Labeling
425 \labelwidthstring 00.00.0000
426 \begin_inset Flex CharStyle:Code
429 \begin_layout Plain Layout
435 the list of layout modules found in your
436 \begin_inset Flex CharStyle:Code
439 \begin_layout Plain Layout
448 \begin_layout Labeling
449 \labelwidthstring 00.00.0000
450 \begin_inset Flex CharStyle:Code
453 \begin_layout Plain Layout
459 lists of various sorts of LaTeX-related files found on your system
462 \begin_layout Labeling
463 \labelwidthstring 00.00.0000
464 \begin_inset Flex CharStyle:Code
467 \begin_layout Plain Layout
473 is automatically generated during configuration from the file
474 \begin_inset Flex CharStyle:Code
477 \begin_layout Plain Layout
484 It contains information on your LaTeX configuration.
487 \begin_layout Subsection
491 \begin_layout Standard
492 These directories are duplicated between
493 \begin_inset Flex CharStyle:Code
496 \begin_layout Plain Layout
503 \begin_inset Flex CharStyle:Code
506 \begin_layout Plain Layout
513 If a particular files exists in both places, the one in
514 \begin_inset Flex CharStyle:Code
517 \begin_layout Plain Layout
526 \begin_layout Labeling
527 \labelwidthstring 00.00.0000
528 \begin_inset Flex CharStyle:Code
531 \begin_layout Plain Layout
537 this directory contains files with the extension
538 \begin_inset Flex CharStyle:Code
541 \begin_layout Plain Layout
547 that define the keybindings used in LyX.
548 If there exists an internationalized version of the bind file named
549 \begin_inset Flex CharStyle:Code
552 \begin_layout Plain Layout
558 , that will be used first.
561 \begin_layout Labeling
562 \labelwidthstring 00.00.0000
563 \begin_inset Flex CharStyle:Code
566 \begin_layout Plain Layout
572 contains graphics files that can be included in documents.
576 \begin_layout Labeling
577 \labelwidthstring 00.00.0000
578 \begin_inset Flex CharStyle:Code
581 \begin_layout Plain Layout
587 contains LyX documentation files (including the one you are currently reading).
589 \begin_inset Flex CharStyle:Code
592 \begin_layout Plain Layout
598 deserves special attention, as noted above.
599 The internationalized help docs are in subdirectories
600 \begin_inset Flex CharStyle:Code
603 \begin_layout Plain Layout
610 \begin_inset Quotes eld
614 \begin_inset Quotes erd
617 is the ISO language code.
623 \begin_inset CommandInset ref
625 reference "cha:Internationalizing-LyX"
632 \begin_layout Labeling
633 \labelwidthstring 00.00.0000
634 \begin_inset Flex CharStyle:Code
637 \begin_layout Plain Layout
643 contains example files that explain how to use some features.
644 In the file browser, press the
645 \begin_inset Flex CharStyle:MenuItem
648 \begin_layout Plain Layout
657 \begin_layout Labeling
658 \labelwidthstring 00.00.0000
659 \begin_inset Flex CharStyle:Code
662 \begin_layout Plain Layout
668 contains image files that are used by the
669 \begin_inset Flex CharStyle:MenuItem
672 \begin_layout Plain Layout
679 In addition, it also contains the individual icons used in the toolbar
680 and the banners that can be shown when LyX is launched.
683 \begin_layout Labeling
684 \labelwidthstring 00.00.0000
685 \begin_inset Flex CharStyle:Code
688 \begin_layout Plain Layout
694 contains keyboard keymapping files.
700 \begin_inset CommandInset ref
702 reference "sec:International-Keymap-Stuff"
709 \begin_layout Labeling
710 \labelwidthstring 00.00.0000
711 \begin_inset Flex CharStyle:Code
714 \begin_layout Plain Layout
720 contains the text class and module files described in Chapter
725 \begin_inset CommandInset ref
727 reference "cha:Installing-New-Document"
734 \begin_layout Labeling
735 \labelwidthstring 00.00.0000
736 \begin_inset Flex CharStyle:Code
739 \begin_layout Plain Layout
746 \begin_inset Flex CharStyle:Code
749 \begin_layout Plain Layout
755 Python scripts used to convert between LyX versions.
756 These can be run from the command line if, say, you want to batch-convert
760 \begin_layout Labeling
761 \labelwidthstring 00.00.0000
762 \begin_inset Flex CharStyle:Code
765 \begin_layout Plain Layout
771 contains some files that demonstrate the capabilities of the
772 \begin_inset Flex CharStyle:MenuItem
775 \begin_layout Plain Layout
786 Also contains some scripts used by LyX itself.
789 \begin_layout Labeling
790 \labelwidthstring 00.00.0000
791 \begin_inset Flex CharStyle:Code
794 \begin_layout Plain Layout
800 contains the standard LyX template files described in Chapter
805 \begin_inset CommandInset ref
807 reference "sec:Creating-Templates"
814 \begin_layout Labeling
815 \labelwidthstring 00.00.0000
816 \begin_inset Flex CharStyle:Code
819 \begin_layout Plain Layout
825 contains files with the extension
826 \begin_inset Flex CharStyle:Code
829 \begin_layout Plain Layout
835 that define the user interface to LyX.
836 That is, the files define which items appear in which menus and the items
837 appearing on the toolbar.
840 \begin_layout Subsection
841 Files you don't want to modify
844 \begin_layout Standard
845 These files are used internally by LyX and you generally do not need to
846 modify them unless you are a developer.
849 \begin_layout Labeling
850 \labelwidthstring 00.00.0000
851 \begin_inset Flex CharStyle:Code
854 \begin_layout Plain Layout
860 this file contains the list of LyX developers.
861 The contents are displayed with the menu entry
862 \begin_inset Flex CharStyle:MenuItem
865 \begin_layout Plain Layout
866 Help\SpecialChar \menuseparator
879 \begin_layout Labeling
880 \labelwidthstring 00.00.0000
881 \begin_inset Flex CharStyle:Code
884 \begin_layout Plain Layout
890 this is a LaTeX script used during the configuration process.
894 \begin_layout Labeling
895 \labelwidthstring 00.00.0000
896 \begin_inset Flex CharStyle:Code
899 \begin_layout Plain Layout
905 this is the script that is used to re-configure LyX.
906 It creates configuration files in the directory it was run from.
909 \begin_layout Subsection
910 Other files needing a line or two...
913 \begin_layout Labeling
914 \labelwidthstring 00.00.0000
915 \begin_inset Flex CharStyle:Code
918 \begin_layout Plain Layout
924 this contains tables describing how different character encodings can be
928 \begin_layout Labeling
929 \labelwidthstring 00.00.0000
930 \begin_inset Flex CharStyle:Code
933 \begin_layout Plain Layout
939 this file contains the templates available to the new
940 \begin_inset Flex CharStyle:MenuItem
943 \begin_layout Plain Layout
956 \begin_layout Labeling
957 \labelwidthstring 00.00.0000
958 \begin_inset Flex CharStyle:Code
961 \begin_layout Plain Layout
967 this file contains a list of all the languages currently supported by LyX.
970 \begin_layout Section
971 Your local configuration directory
974 \begin_layout Standard
975 Even if you are using LyX as an unprivileged user, you might want to change
976 LyX configuration for your own use.
978 \begin_inset Flex CharStyle:Code
981 \begin_layout Plain Layout
987 directory contains all your personal configuration files.
988 This is the directory described as
989 \begin_inset Quotes eld
993 \begin_inset Quotes erd
997 \begin_inset Flex CharStyle:MenuItem
1000 \begin_layout Plain Layout
1001 Help\SpecialChar \menuseparator
1003 \begin_inset space ~
1012 This directory is used as a mirror of
1013 \begin_inset Flex CharStyle:Code
1016 \begin_layout Plain Layout
1022 , which means that every file in
1023 \begin_inset Flex CharStyle:Code
1026 \begin_layout Plain Layout
1032 is a replacement for the corresponding file in
1033 \begin_inset Flex CharStyle:Code
1036 \begin_layout Plain Layout
1043 Any configuration file described in the above sections can be placed either
1044 in the system-wide directory, in which case it will affect all users, or
1045 in your local directory for your own use.
1048 \begin_layout Standard
1049 To make things clearer, let's provide a few examples:
1052 \begin_layout Itemize
1053 The preferences set in the
1054 \begin_inset Flex CharStyle:MenuItem
1057 \begin_layout Plain Layout
1058 Tools\SpecialChar \menuseparator
1064 dialog are saved to a file
1065 \begin_inset Flex CharStyle:Code
1068 \begin_layout Plain Layout
1075 \begin_inset Flex CharStyle:Code
1078 \begin_layout Plain Layout
1087 \begin_layout Itemize
1088 When you reconfigure using
1089 \begin_inset Flex CharStyle:MenuItem
1092 \begin_layout Plain Layout
1093 Tools\SpecialChar \menuseparator
1100 \begin_inset Flex CharStyle:Code
1103 \begin_layout Plain Layout
1109 script, and the resulting files are written in your local configuration
1111 This means that any additional text class file that you might have added
1113 \begin_inset Flex CharStyle:Code
1116 \begin_layout Plain Layout
1122 will be added to the list of classes in the
1123 \begin_inset Flex CharStyle:MenuItem
1126 \begin_layout Plain Layout
1127 Document\SpecialChar \menuseparator
1136 \begin_layout Itemize
1137 If you get some updated documentation from LyX ftp site and cannot install
1138 it because you do not have sysadmin rights on your system, you can just
1140 \begin_inset Flex CharStyle:Code
1143 \begin_layout Plain Layout
1149 and the items in the
1150 \begin_inset Flex CharStyle:MenuItem
1153 \begin_layout Plain Layout
1159 menu will open them!
1162 \begin_layout Section
1163 Running LyX with multiple configurations
1166 \begin_layout Standard
1167 The configuration freedom of the local configuration directory may not suffice
1168 if you want to have more than one configuration at your disposal.
1169 For example, you may want to be use different key bindings or printer settings
1171 You can achieve this by having several such directories.
1172 You then specify which directory to use at run-time.
1175 \begin_layout Standard
1176 Invoking LyX with the command line switch
1177 \begin_inset Flex CharStyle:Code
1180 \begin_layout Plain Layout
1190 instructs the program to read the configuration from that directory, and
1191 not from the default directory.
1192 (You can determine the default directory by running LyX without the
1193 \begin_inset Flex CharStyle:Code
1196 \begin_layout Plain Layout
1202 switch.) If the specified directory does not exist, LyX offers to create
1203 it for you, just like it does for the default directory on the first time
1204 you run the program.
1205 You can modify the configuration options in this additional user directory
1206 exactly as you would for the default directory.
1207 These directories are completely independent (but read on).
1208 Note that setting the environment variable
1209 \begin_inset Flex CharStyle:Code
1212 \begin_layout Plain Layout
1218 to some value has exactly the same effect.
1221 \begin_layout Standard
1222 Having several configurations also requires more maintenance: if you want
1223 to add a new layout to
1224 \begin_inset Flex CharStyle:Code
1227 \begin_layout Plain Layout
1233 which you want available from all your configurations, you must add it
1234 to each directory separately.
1235 You can avoid this with the following trick: after LyX creates the additional
1236 directory, most of the subdirectories (see above) are empty.
1237 If you want the new configuration to mirror an existing one, replace the
1238 empty subdirectory with a symbolic link to the matching subdirectory in
1239 the existing configuration.
1241 \begin_inset Flex CharStyle:Code
1244 \begin_layout Plain Layout
1250 subdirectory, however, since it contains a file written by the configuration
1251 script (also accessible through
1252 \begin_inset Flex CharStyle:MenuItem
1255 \begin_layout Plain Layout
1256 Tools\SpecialChar \menuseparator
1262 ) which is configuration-specific.
1265 \begin_layout Chapter
1266 The Preferences dialog
1269 \begin_layout Standard
1270 All options of the preferences dialog are described in the Appendix
1272 The Preferences Dialog
1279 For some options you might find here more details.
1282 \begin_layout Section
1284 \begin_inset CommandInset label
1293 \begin_layout Standard
1294 The first step is to define your file formats if they are not already defined.
1296 \begin_inset Flex CharStyle:MenuItem
1299 \begin_layout Plain Layout
1300 Tools\SpecialChar \menuseparator
1308 \begin_inset Flex CharStyle:MenuItem
1311 \begin_layout Plain Layout
1312 File Handling\SpecialChar \menuseparator
1319 \begin_inset Flex CharStyle:MenuItem
1322 \begin_layout Plain Layout
1323 New\SpecialChar \ldots{}
1329 button to define your new format.
1331 \begin_inset Flex CharStyle:MenuItem
1334 \begin_layout Plain Layout
1340 field contains the name used to identify the format in the GUI.
1342 \begin_inset Flex CharStyle:MenuItem
1345 \begin_layout Plain Layout
1351 is used to identify the format internally.
1352 You will also need to enter a file extension.
1353 These are all required.
1355 \begin_inset Flex CharStyle:MenuItem
1358 \begin_layout Plain Layout
1364 field is used to provide a keyboard shortcut on the menus.
1365 (For example, pressing
1366 \begin_inset Flex CharStyle:MenuItem
1369 \begin_layout Plain Layout
1376 \begin_inset Flex CharStyle:MenuItem
1379 \begin_layout Plain Layout
1380 View\SpecialChar \menuseparator
1389 \begin_layout Standard
1391 \begin_inset Flex CharStyle:MenuItem
1394 \begin_layout Plain Layout
1401 \begin_inset Flex CharStyle:MenuItem
1404 \begin_layout Plain Layout
1411 For example, you might want to use
1412 \begin_inset Flex CharStyle:MenuItem
1415 \begin_layout Plain Layout
1421 to view PostScript files.
1422 You can enter the command needed to start the program in the corresponding
1424 In defining this command, you can use the four variables listed in the
1426 The viewer is launched when you view an image in LyX or use the
1427 \begin_inset Flex CharStyle:MenuItem
1430 \begin_layout Plain Layout
1437 The editor is for example launched when you right-click on an image and
1439 \begin_inset Flex CharStyle:MenuItem
1442 \begin_layout Plain Layout
1448 in the appearing context menu.
1451 \begin_layout Standard
1453 \begin_inset Flex CharStyle:MenuItem
1456 \begin_layout Plain Layout
1462 option tells LyX that a format is suitable for document export.
1463 If this is set and if a suitable conversion route exists (see sec.
1464 \begin_inset space \thinspace{}
1468 \begin_inset CommandInset ref
1470 reference "sec:Converters"
1474 ), the format will appear in the
1475 \begin_inset Flex CharStyle:MenuItem
1478 \begin_layout Plain Layout
1479 File\SpecialChar \menuseparator
1486 The format will also appear in the
1487 \begin_inset Flex CharStyle:MenuItem
1490 \begin_layout Plain Layout
1496 menu if a viewer is specified for the format.
1497 Pure image formats, such as
1498 \begin_inset Flex CharStyle:Code
1501 \begin_layout Plain Layout
1507 , should not use this option.
1508 Formats that can both represent vector graphics and documents like
1509 \begin_inset Flex CharStyle:Code
1512 \begin_layout Plain Layout
1521 \begin_layout Standard
1523 \begin_inset Flex CharStyle:MenuItem
1526 \begin_layout Plain Layout
1527 Vector graphics format
1532 tells LyX that a format can contain vector graphics.
1533 This information is used to determine the target format of included graphics
1535 \begin_inset Flex CharStyle:MenuItem
1538 \begin_layout Plain Layout
1545 Included graphics may need to be converted to either
1546 \begin_inset Flex CharStyle:MenuItem
1549 \begin_layout Plain Layout
1556 \begin_inset Flex CharStyle:MenuItem
1559 \begin_layout Plain Layout
1566 \begin_inset Flex CharStyle:MenuItem
1569 \begin_layout Plain Layout
1576 \begin_inset Flex CharStyle:MenuItem
1579 \begin_layout Plain Layout
1585 cannot handle other image formats.
1586 If an included graphic is not already in
1587 \begin_inset Flex CharStyle:MenuItem
1590 \begin_layout Plain Layout
1597 \begin_inset Flex CharStyle:MenuItem
1600 \begin_layout Plain Layout
1607 \begin_inset Flex CharStyle:MenuItem
1610 \begin_layout Plain Layout
1616 format, it is converted to
1617 \begin_inset Flex CharStyle:MenuItem
1620 \begin_layout Plain Layout
1626 if the vector format option is set, and otherwise to
1627 \begin_inset Flex CharStyle:MenuItem
1630 \begin_layout Plain Layout
1639 \begin_layout Section
1643 \begin_layout Standard
1644 Since all conversions from one format to another take place in LyX's temporary
1645 directory, it is sometimes necessary to modify a file before copying it
1646 to the temporary directory in order that the conversion may be performed.
1650 \begin_layout Plain Layout
1651 For example, the file may refer to other files—images, for example—using
1652 relative file names, and these may become invalid when the file is copied
1653 to the temporary directory.
1658 This is done by a Copier: It copies a file to (or from) the temporary directory
1659 and may modify it in the process.
1662 \begin_layout Standard
1663 The definitions of the copiers may use four variables:
1666 \begin_layout Labeling
1667 \labelwidthstring 00.00.0000
1668 \begin_inset Flex CharStyle:Code
1671 \begin_layout Plain Layout
1677 The LyX system directory (e.
1678 \begin_inset space \thinspace{}
1682 \begin_inset space \space{}
1686 \begin_inset Flex CharStyle:MenuItem
1689 \begin_layout Plain Layout
1698 \begin_layout Labeling
1699 \labelwidthstring 00.00.0000
1700 \begin_inset Flex CharStyle:Code
1703 \begin_layout Plain Layout
1712 \begin_layout Labeling
1713 \labelwidthstring 00.00.0000
1714 \begin_inset Flex CharStyle:Code
1717 \begin_layout Plain Layout
1726 \begin_layout Labeling
1727 \labelwidthstring 00.00.0000
1728 \begin_inset Flex CharStyle:Code
1731 \begin_layout Plain Layout
1740 \begin_layout Standard
1741 The latter should be the filename as it would be used in a LaTeX's
1748 It is relevant only when exporting files suitable for such inclusion.
1751 \begin_layout Standard
1752 Copiers can be used to do almost anything with output files.
1753 For example, suppose you want generated pdf files to be copied to a special
1755 \begin_inset Flex CharStyle:Code
1758 \begin_layout Plain Layout
1765 Then you could write a shell script such as this one:
1768 \begin_layout Standard
1769 \begin_inset listings
1773 \begin_layout Plain Layout
1778 \begin_layout Plain Layout
1783 \begin_layout Plain Layout
1785 TOFILE=`basename $2`
1788 \begin_layout Plain Layout
1790 cp $FROMFILE /home/you/pdf/$TOFILE
1795 Save it in your local LyX directory—say,
1796 \begin_inset Flex CharStyle:Code
1799 \begin_layout Plain Layout
1800 /home/you/.lyx/scripts/pdfcopier.sh
1805 —and make it executable, if you need to do so on your platform.
1807 \begin_inset Flex CharStyle:MenuItem
1810 \begin_layout Plain Layout
1811 Tools\SpecialChar \menuseparator
1817 dialog, select under
1818 \begin_inset Flex CharStyle:MenuItem
1821 \begin_layout Plain Layout
1822 File Handling\SpecialChar \menuseparator
1829 \begin_inset Flex CharStyle:MenuItem
1832 \begin_layout Plain Layout
1838 format—or one of the other pdf formats—and enter
1839 \begin_inset Flex CharStyle:Code
1842 \begin_layout Plain Layout
1843 pdfcopier.sh $$i $$o
1849 \begin_inset Flex CharStyle:MenuItem
1852 \begin_layout Plain Layout
1862 \begin_layout Standard
1863 Copiers are used by LyX in various of its own conversions.
1864 For example, if appropriate programs are found, LyX will automatically
1865 install copiers for the
1866 \begin_inset Flex CharStyle:MenuItem
1869 \begin_layout Plain Layout
1876 \begin_inset Flex CharStyle:MenuItem
1879 \begin_layout Plain Layout
1881 \begin_inset space ~
1890 When these formats are exported, the copier sees that not just the main
1891 HTML file but various associated files (style files, images, etc.) are also
1893 All these files are written to a subdirectory of the directory in which
1894 the original LyX file was found.
1898 \begin_layout Plain Layout
1899 This copier can be customized.
1901 \begin_inset Quotes eld
1905 \begin_inset Quotes erd
1908 argument takes a comma-separated list of extensions to be copied; if it
1909 is omitted, all files will be copied.
1911 \begin_inset Quotes eld
1915 \begin_inset Quotes erd
1918 argument determines the extension added to the generated directory.
1920 \begin_inset Quotes eld
1924 \begin_inset Flex CharStyle:MenuItem
1927 \begin_layout Plain Layout
1934 \begin_inset Quotes erd
1937 , so HTML generated from
1938 \begin_inset Flex CharStyle:MenuItem
1941 \begin_layout Plain Layout
1942 /path/to/filename.lyx
1948 \begin_inset Flex CharStyle:MenuItem
1951 \begin_layout Plain Layout
1952 /path/to/filename.html.LyXconv
1966 \begin_layout Section
1968 \begin_inset CommandInset label
1970 name "sec:Converters"
1977 \begin_layout Standard
1978 You can define your own Converters to convert files between different formats.
1980 \begin_inset Flex CharStyle:MenuItem
1983 \begin_layout Plain Layout
1984 Tools\SpecialChar \menuseparator
1985 Preferences\SpecialChar \menuseparator
1986 File Handling\SpecialChar \menuseparator
1995 \begin_layout Standard
1996 To define a new converter, select the
1997 \begin_inset Flex CharStyle:MenuItem
2000 \begin_layout Plain Layout
2002 \begin_inset space ~
2011 \begin_inset Flex CharStyle:MenuItem
2014 \begin_layout Plain Layout
2016 \begin_inset space ~
2024 from the drop-down lists, enter the command needed for the conversion,
2026 \begin_inset Flex CharStyle:MenuItem
2029 \begin_layout Plain Layout
2036 Several variables can be used in the definition of converters:
2039 \begin_layout Labeling
2040 \labelwidthstring 00.00.0000
2041 \begin_inset Flex CharStyle:Code
2044 \begin_layout Plain Layout
2050 The LyX system directory
2053 \begin_layout Labeling
2054 \labelwidthstring 00.00.0000
2055 \begin_inset Flex CharStyle:Code
2058 \begin_layout Plain Layout
2067 \begin_layout Labeling
2068 \labelwidthstring 00.00.0000
2069 \begin_inset Flex CharStyle:Code
2072 \begin_layout Plain Layout
2081 \begin_layout Labeling
2082 \labelwidthstring 00.00.0000
2083 \begin_inset Flex CharStyle:Code
2086 \begin_layout Plain Layout
2092 The base filename of the input file (i.
2093 \begin_inset space \thinspace{}
2096 g., without the extension)
2099 \begin_layout Labeling
2100 \labelwidthstring 00.00.0000
2101 \begin_inset Flex CharStyle:Code
2104 \begin_layout Plain Layout
2110 The path to the input file
2113 \begin_layout Labeling
2114 \labelwidthstring 00.00.0000
2115 \begin_inset Flex CharStyle:Code
2118 \begin_layout Plain Layout
2124 The path to the original input file (this is different from $$p when a
2125 chain of converters is called).
2128 \begin_layout Standard
2130 \begin_inset Flex CharStyle:MenuItem
2133 \begin_layout Plain Layout
2135 \begin_inset space ~
2143 field you can enter the following flags, separated by commas:
2146 \begin_layout Labeling
2147 \labelwidthstring 00.00.0000
2148 \begin_inset Flex CharStyle:Code
2151 \begin_layout Plain Layout
2157 This converter runs some form of LaTeX.
2158 This will make LyX's LaTeX error logs available.
2161 \begin_layout Labeling
2162 \labelwidthstring 00.00.0000
2163 \begin_inset Flex CharStyle:Code
2166 \begin_layout Plain Layout
2173 \begin_inset Flex CharStyle:MenuItem
2176 \begin_layout Plain Layout
2182 file for the conversion.
2185 \begin_layout Labeling
2186 \labelwidthstring 00.00.0000
2187 \begin_inset Flex CharStyle:Code
2190 \begin_layout Plain Layout
2199 \begin_layout Standard
2200 The following three flags are not really flags at all because they take
2202 \begin_inset Flex CharStyle:MenuItem
2205 \begin_layout Plain Layout
2207 \begin_inset space ~
2211 \begin_inset space ~
2222 \begin_layout Labeling
2223 \labelwidthstring 00.00.0000
2224 \begin_inset Flex CharStyle:Code
2227 \begin_layout Plain Layout
2233 If set, the converter's standard error will be redirected to a file
2234 \begin_inset Flex CharStyle:Code
2237 \begin_layout Plain Layout
2243 , and the script given as argument will be run as:
2244 \begin_inset Flex CharStyle:Code
2247 \begin_layout Plain Layout
2248 script < infile.out > infile.log
2254 The argument may contain
2255 \begin_inset Flex CharStyle:Code
2258 \begin_layout Plain Layout
2267 \begin_layout Labeling
2268 \labelwidthstring 00.00.0000
2269 \begin_inset Flex CharStyle:Code
2272 \begin_layout Plain Layout
2278 The name of the directory in which the converter will dump the generated
2280 LyX will not create this directory, and it does not copy anything into
2281 it, though it will copy this directory to the destination.
2282 The argument may contain
2283 \begin_inset Flex CharStyle:Code
2286 \begin_layout Plain Layout
2292 , which will be replaced by the base name of the input and output files,
2293 respectively, when the directory is copied.
2294 \begin_inset Newline newline
2297 Note that resultdir and usetempdir make no sense together.
2298 The latter will be ignored if the former is given.
2301 \begin_layout Labeling
2302 \labelwidthstring 00.00.0000
2303 \begin_inset Flex CharStyle:Code
2306 \begin_layout Plain Layout
2312 Determines the output file name and may, contain
2313 \begin_inset Flex CharStyle:Code
2316 \begin_layout Plain Layout
2323 Sensible only with resultdir and optional even then; if not given, it defaults
2327 \begin_layout Standard
2328 None of these last three are presently used in any of the converters that
2329 are installed with LyX.
2333 \begin_layout Standard
2334 You do not have to define converters for all formats between which you want
2336 For example, you will note that there is no `LyX to PostScript' converter,
2337 but LyX will export PostScript.
2338 It does so by first creating a LaTeX file (no converter needs to be defined
2339 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2340 and finally converting the resulting DVI file to PostScript.
2341 LyX finds such `chains' of converters automatically, and it will always
2342 choose the shortest possible chain.
2343 You can, though, still define multiple conversion methods between file
2345 For example, the standard LyX configuration provides three ways to convert
2346 LaTeX to PDF: Directly, using
2347 \begin_inset Flex CharStyle:MenuItem
2350 \begin_layout Plain Layout
2356 ; via (DVI and) PostScript, using
2357 \begin_inset Flex CharStyle:MenuItem
2360 \begin_layout Plain Layout
2367 \begin_inset Flex CharStyle:MenuItem
2370 \begin_layout Plain Layout
2377 To define such alternate chains, you must define multiple target `file
2378 formats', as described in section
2379 \begin_inset CommandInset ref
2381 reference "sec:Formats"
2386 For example, in the standard configuration, the formats named
2387 \begin_inset Flex CharStyle:MenuItem
2390 \begin_layout Plain Layout
2397 \begin_inset Flex CharStyle:MenuItem
2400 \begin_layout Plain Layout
2407 \begin_inset Flex CharStyle:MenuItem
2410 \begin_layout Plain Layout
2416 are defined, all of which share the extension
2417 \begin_inset Flex CharStyle:MenuItem
2420 \begin_layout Plain Layout
2426 , and which correspond to the conversion methods just mentioned.
2429 \begin_layout Chapter
2430 Internationalizing LyX
2431 \begin_inset CommandInset label
2433 name "cha:Internationalizing-LyX"
2440 \begin_layout Standard
2441 LyX supports using a translated interface.
2442 Last time we checked, LyX provided text in thirty languages.
2443 The language of choice is called your
2448 (For further reading on locale settings, see also the documentation for
2449 locale that comes with your operating system.
2450 For Linux, the manual page for
2451 \begin_inset Flex CharStyle:Code
2454 \begin_layout Plain Layout
2460 could be a good place to start).
2463 \begin_layout Standard
2464 Notice that these translations will work, but do contain a few flaws.
2465 In particular, all dialogs have been designed with the English text in
2466 mind, which means that some of the translated text will be too large to
2467 fit within the space allocated.
2468 This is only a display problem and will not cause any harm.
2469 Also, you will find that some of the translations do not define shortcut
2470 keys for everything.
2471 Sometimes, there are simply not enough free letters to do it.
2472 Other times, the translator just hasn't got around to doing it yet.
2473 Our localization team, which you may wish to join,
2477 \begin_layout Plain Layout
2478 If you are a fluent speaker of a language other than English, joining these
2479 teams is a great way to give back to the LyX community!
2484 will of course try to fix these shortcomings in future versions of LyX.
2487 \begin_layout Section
2491 \begin_layout Subsection
2492 Translating the graphical user interface (text messages).
2495 \begin_layout Standard
2497 \begin_inset Flex CharStyle:Code
2500 \begin_layout Plain Layout
2506 library to handle the internationalization of the interface.
2507 To have LyX speak your favorite language in all menus and dialogs, you
2509 \begin_inset Flex CharStyle:Code
2512 \begin_layout Plain Layout
2518 -file for that language.
2519 When this is available, you'll have to generate a
2520 \begin_inset Flex CharStyle:Code
2523 \begin_layout Plain Layout
2529 -file from it and install the
2530 \begin_inset Flex CharStyle:Code
2533 \begin_layout Plain Layout
2540 The process of doing all of this is explained in the documentation for
2542 \begin_inset Flex CharStyle:Code
2545 \begin_layout Plain Layout
2552 It is possible to do this just for yourself, but if you're going to do
2553 it, you might as well share the results of your labors with the rest of
2555 Send a message to the LyX developers' list for more information about how
2559 \begin_layout Standard
2560 In short, this is what you should do (xx denotes the language code):
2563 \begin_layout Itemize
2564 Check out the LyX source code.
2566 \begin_inset CommandInset href
2568 name "information on the web"
2569 target "http://www.lyx.org/devel/cvs.php"
2576 \begin_layout Itemize
2578 \begin_inset Flex CharStyle:Code
2581 \begin_layout Plain Layout
2587 to the folder of the
2588 \begin_inset Flex CharStyle:Code
2591 \begin_layout Plain Layout
2599 \begin_inset Flex CharStyle:Code
2602 \begin_layout Plain Layout
2610 \begin_inset Flex CharStyle:Code
2613 \begin_layout Plain Layout
2619 doesn't exist anywhere, it can be remade with the console command
2620 \begin_inset Flex CharStyle:Code
2623 \begin_layout Plain Layout
2629 in that directory, or you can use an existing po-file for some other language
2633 \begin_layout Itemize
2635 \begin_inset Flex CharStyle:Code
2638 \begin_layout Plain Layout
2648 \begin_layout Plain Layout
2649 This is just a text file, so it can be edited in any text editor.
2650 But there are also specialized programs that support such editing, such
2655 (for all platforms) or
2664 contains a `mode' for editing
2665 \begin_inset Flex CharStyle:Code
2668 \begin_layout Plain Layout
2679 For some menu- and widget-labels, there are also shortcut keys that should
2681 Those keys are marked after a `|', and should be translated according to
2682 the words and phrases of the language.
2683 You should also fill also out the information at the beginning of the new
2685 \begin_inset Flex CharStyle:Code
2688 \begin_layout Plain Layout
2694 -file with your email-address, etc., so people know where to reach you with
2695 suggestions and entertaining flames.
2698 \begin_layout Standard
2699 If you are just doing this on your own, then:
2702 \begin_layout Itemize
2704 \begin_inset Flex CharStyle:Code
2707 \begin_layout Plain Layout
2714 This can be done with
2715 \begin_inset Flex CharStyle:Code
2718 \begin_layout Plain Layout
2719 msgfmt -o xx.mo < xx.po
2727 \begin_layout Itemize
2729 \begin_inset Flex CharStyle:Code
2732 \begin_layout Plain Layout
2738 -file to your locale-tree, at the correct directory for application messages
2743 xx, and under the name
2744 \begin_inset Flex CharStyle:Code
2747 \begin_layout Plain Layout
2754 \begin_inset space \thinspace{}
2758 \begin_inset space \space{}
2762 \begin_inset Flex CharStyle:Code
2765 \begin_layout Plain Layout
2766 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2776 \begin_layout Standard
2777 As said, however, it would be best if the new
2778 \begin_inset Flex CharStyle:Code
2781 \begin_layout Plain Layout
2787 -file could be added to the LyX distribution, so others can use it.
2788 Adding it involves making additional changes to LyX.
2789 So send an email to the developers' mailing list if you're interested in
2793 \begin_layout Subsubsection
2797 \begin_layout Standard
2798 Sometimes it turns out that one English message needs to be translated into
2799 different messages in the target language.
2800 One example is the message
2801 \begin_inset Flex CharStyle:Code
2804 \begin_layout Plain Layout
2810 which has the German translation
2818 , depending upon exactly what the English
2819 \begin_inset Quotes eld
2823 \begin_inset Quotes erd
2828 \begin_inset Flex CharStyle:Code
2831 \begin_layout Plain Layout
2837 does not handle such ambiguous translations.
2838 Therefore you have to add some context information to the message: Instead
2840 \begin_inset Flex CharStyle:Code
2843 \begin_layout Plain Layout
2850 \begin_inset Flex CharStyle:Code
2853 \begin_layout Plain Layout
2854 To[[as in 'From format x to format y']]
2860 \begin_inset Flex CharStyle:Code
2863 \begin_layout Plain Layout
2864 To[[as in 'From page x to page y']].
2869 Now the two occurrences of
2870 \begin_inset Flex CharStyle:Code
2873 \begin_layout Plain Layout
2880 \begin_inset Flex CharStyle:Code
2883 \begin_layout Plain Layout
2889 and can be translated correctly to
2900 \begin_layout Standard
2901 Of course the context information needs to be stripped off the original
2902 message when no translation is used.
2903 Therefore you have to put it in double square brackets at the end of the
2904 message (see the example above).
2905 The translation mechanism of LyX ensures that everything in double square
2906 brackets at the end of messages is removed before displaying the message.
2909 \begin_layout Subsection
2910 Translating the documentation.
2913 \begin_layout Standard
2914 The online documentation (in the
2915 \begin_inset Flex CharStyle:MenuItem
2918 \begin_layout Plain Layout
2924 -menu) can (and should!) be translated.
2925 If there are translated versions of the documentation available
2929 \begin_layout Plain Layout
2930 As of March 2008, at least some of the documents have been translated into
2931 fourteen languages, with the Tutorial available in a few more.
2936 and the locale is set accordingly, these will be used automagically by
2938 LyX looks for translated versions as
2939 \begin_inset Flex CharStyle:Code
2942 \begin_layout Plain Layout
2943 LyXDir/doc/xx/DocName.lyx
2949 \begin_inset Flex CharStyle:Code
2952 \begin_layout Plain Layout
2958 is the code for the language currently in use.
2959 If there are no translated documents, the default English versions will
2961 Note that the translated versions must have the same filenames (
2962 \begin_inset Flex CharStyle:Code
2965 \begin_layout Plain Layout
2971 above) as the original.
2972 If you feel up to translating the documentation (an excellent way to proof-read
2973 the original documentation by the way!), there are a few things you should
2977 \begin_layout Itemize
2978 Check out the documentation translation web page at
2979 \begin_inset CommandInset href
2981 name "http://www.lyx.org/Translation"
2982 target "http://www.lyx.org/Translation"
2987 That way, you can find out which (if any) documents have already been translate
2988 d into your language.
2989 You can also find out who (if anyone) is organizing the effort to translate
2990 the documentation into your language.
2991 If no one is organizing the effort, please let us know that you're interested.
2994 \begin_layout Standard
2995 Once you get to actually translating, here's a few hints for you that may
2999 \begin_layout Itemize
3000 Join the documentation team! There is information on how to do that in
3001 \begin_inset Flex CharStyle:Code
3004 \begin_layout Plain Layout
3011 \begin_inset Flex CharStyle:MenuItem
3014 \begin_layout Plain Layout
3015 Help\SpecialChar \menuseparator
3021 ), which by the way is the first document you should translate.
3024 \begin_layout Itemize
3025 Learn the typographic conventions for the language you are translating to.
3026 Typography is an ancient art and over the centuries, a great variety of
3027 conventions have developed throughout different parts of the world.
3028 Also study the professional terminology amongst typographers in your country.
3029 Inventing your own terminology will only confuse the users.
3032 (Warning! Typography is addictive!)
3035 \begin_layout Itemize
3036 Make a copy of the document.
3037 This will be your working copy.
3038 You can use this as your personal translated help-file by placing it in
3040 \begin_inset Flex CharStyle:Code
3043 \begin_layout Plain Layout
3052 \begin_layout Itemize
3053 Sometimes the original document (from the LyX-team) will be updated.
3054 Use the source viewer at
3055 \begin_inset CommandInset href
3057 name "http://www.lyx.org/trac/timeline"
3058 target "http://www.lyx.org/trac/timeline"
3062 to see what has been changed.
3063 That way you can easily see which parts of the translated document need
3067 \begin_layout Standard
3068 If you ever find an error in the original document, fix it and notify the
3069 rest of the documentation team of the changes! (You didn't forget to join
3070 the documentation team, did you?)
3073 \begin_layout Standard
3074 \begin_inset Branch OutDated
3077 \begin_layout Section
3078 International Keyboard Support
3081 \begin_layout Standard
3084 [Editor's Note: The following section is by
3092 It needs to be fixed to conform to the new Documentation Style sheet and
3093 to make use of the new v1.0 features.
3094 The whole thing also needs to be merged with the section following it.-jw
3095 It may also be badly out of date.-rh (2008)]
3098 \begin_layout Subsection
3099 Defining Own Keymaps: Keymap File Format
3102 \begin_layout Standard
3103 Let's look at a keyboard definition file a little closer.
3104 It is a plain text file defining
3107 \begin_layout Itemize
3108 key-to-key or key-to-string translations
3111 \begin_layout Itemize
3115 \begin_layout Itemize
3116 dead keys exceptions
3119 \begin_layout Standard
3120 To define key-to-key or key-to-string translation, use this command:
3123 \begin_layout Quotation
3124 \begin_inset Flex CharStyle:Code
3127 \begin_layout Plain Layout
3136 \begin_inset Flex CharStyle:Code
3139 \begin_layout Plain Layout
3148 \begin_layout Standard
3150 \begin_inset Flex CharStyle:Code
3153 \begin_layout Plain Layout
3159 is the key to be translated and
3160 \begin_inset Flex CharStyle:Code
3163 \begin_layout Plain Layout
3169 is the string to be inserted into the document.
3170 To define dead keys, use:
3173 \begin_layout Quotation
3174 \begin_inset Flex CharStyle:Code
3177 \begin_layout Plain Layout
3186 \begin_inset Flex CharStyle:Code
3189 \begin_layout Plain Layout
3198 \begin_layout Standard
3200 \begin_inset Flex CharStyle:Code
3203 \begin_layout Plain Layout
3209 is a keyboard key and
3210 \begin_inset Flex CharStyle:Code
3213 \begin_layout Plain Layout
3220 The following dead keys are supported (shortcut name is in parentheses):
3223 \begin_layout Quotation
3227 \begin_inset space \hfill{}
3233 \begin_layout Quotation
3235 \begin_inset space \hfill{}
3241 \begin_layout Quotation
3243 \begin_inset space \hfill{}
3249 \begin_layout Quotation
3251 \begin_inset space \hfill{}
3257 \begin_layout Quotation
3259 \begin_inset space \hfill{}
3265 \begin_layout Quotation
3267 \begin_inset space \hfill{}
3274 \begin_layout Plain Layout
3286 \begin_layout Quotation
3288 \begin_inset space \hfill{}
3294 \begin_layout Quotation
3296 \begin_inset space \hfill{}
3303 \begin_layout Plain Layout
3315 \begin_layout Quotation
3317 \begin_inset space \hfill{}
3323 \begin_layout Quotation
3325 \begin_inset space \hfill{}
3331 \begin_layout Quotation
3333 \begin_inset space \hfill{}
3340 \begin_layout Plain Layout
3352 \begin_layout Quotation
3354 \begin_inset space \hfill{}
3361 \begin_layout Plain Layout
3373 \begin_layout Quotation
3375 \begin_inset space \hfill{}
3381 \begin_layout Quotation
3382 hungarian umlaut (hug)
3383 \begin_inset space \hfill{}
3389 \begin_layout Quotation
3391 \begin_inset space \hfill{}
3397 \begin_layout Quotation
3399 \begin_inset space \hfill{}
3406 \begin_layout Plain Layout
3418 \begin_layout Standard
3419 Since in many international keyboards there are exceptions to what some
3420 dead keys should do, you can define them using
3423 \begin_layout Quotation
3424 \begin_inset Flex CharStyle:Code
3427 \begin_layout Plain Layout
3435 deadkey key outstring
3438 \begin_layout Standard
3439 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3443 \begin_layout Quotation
3444 \begin_inset Flex CharStyle:Code
3447 \begin_layout Plain Layout
3460 \begin_layout Standard
3461 to make it work correctly.
3462 Also, you have to define as exceptions dead keys over i and j, to remove
3463 the dot from them before inserting an accent mark.
3464 I will change this when the time comes, but so far I haven't had time.
3467 \begin_layout Standard
3468 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3471 \begin_inset Flex CharStyle:Code
3474 \begin_layout Plain Layout
3480 have different meaning.
3482 \begin_inset Flex CharStyle:Code
3485 \begin_layout Plain Layout
3491 marks comments, quotes start and end LaTeX-style commands.
3492 To enter quote, you'll need to use
3493 \begin_inset Flex CharStyle:Code
3496 \begin_layout Plain Layout
3505 \begin_inset Flex CharStyle:Code
3508 \begin_layout Plain Layout
3515 \begin_inset Flex CharStyle:Code
3518 \begin_layout Plain Layout
3529 \begin_layout Standard
3530 If you make a keyboard description file that works for your language, please
3531 mail it to me, so I can include it in the next keymap distribution.
3534 \begin_layout Standard
3535 More keywords will be supported in keymap configuration file in future,
3539 \begin_layout Itemize
3540 \begin_inset Flex CharStyle:Code
3543 \begin_layout Plain Layout
3554 \begin_inset space \hfill{}
3558 \begin_inset Flex CharStyle:Code
3561 \begin_layout Plain Layout
3570 \begin_layout Itemize
3571 \begin_inset Flex CharStyle:Code
3574 \begin_layout Plain Layout
3585 \begin_inset space \hfill{}
3589 \begin_inset Flex CharStyle:Code
3592 \begin_layout Plain Layout
3598 an external keymap translation program
3601 \begin_layout Standard
3602 Also, it should look into
3603 \begin_inset Flex CharStyle:Code
3606 \begin_layout Plain Layout
3612 file for defaults, too (for example, a
3613 \begin_inset Flex CharStyle:Code
3616 \begin_layout Plain Layout
3624 option to include default keyboard).
3632 \begin_layout Section
3633 International Keymap Stuff
3634 \begin_inset CommandInset label
3636 name "sec:International-Keymap-Stuff"
3643 \begin_layout Standard
3644 \begin_inset Note Note
3647 \begin_layout Plain Layout
3648 In doing the revisions on this document in March 2008, I did not look over
3649 this stuff, as I do not understand it.
3650 It would be good if someone else could do so.
3659 \begin_layout Standard
3660 The next two sections describe the
3661 \begin_inset Flex CharStyle:Code
3664 \begin_layout Plain Layout
3673 \begin_inset Flex CharStyle:Code
3676 \begin_layout Plain Layout
3684 file syntax in detail.
3685 These sections should help you design your own key map if the ones provided
3686 do not meet your needs.
3689 \begin_layout Subsection
3693 \begin_layout Standard
3697 \begin_inset Flex CharStyle:Code
3700 \begin_layout Plain Layout
3706 file maps keystrokes to characters or strings.
3707 As the name suggests, it sets a keyboard mapping.
3709 \begin_inset Flex CharStyle:Code
3712 \begin_layout Plain Layout
3723 \begin_inset Flex CharStyle:Code
3726 \begin_layout Plain Layout
3741 \begin_inset Flex CharStyle:Code
3744 \begin_layout Plain Layout
3757 \begin_inset Flex CharStyle:Code
3760 \begin_layout Plain Layout
3769 \begin_inset Flex CharStyle:Code
3772 \begin_layout Plain Layout
3780 are described in this section.
3783 \begin_layout Labeling
3784 \labelwidthstring 00.00.0000
3785 \begin_inset Flex CharStyle:Code
3788 \begin_layout Plain Layout
3796 Map a character to a string
3799 \begin_layout LyX-Code
3814 \begin_layout Standard
3847 the double-quote (")
3864 must be escaped with a preceding backslash (
3875 \begin_layout Standard
3877 \begin_inset Flex CharStyle:MenuItem
3880 \begin_layout Plain Layout
3888 statement to cause the symbol
3889 \begin_inset Flex CharStyle:MenuItem
3892 \begin_layout Plain Layout
3900 to be output for the keystroke
3901 \begin_inset Flex CharStyle:MenuItem
3904 \begin_layout Plain Layout
3915 \begin_layout LyX-Code
3921 \begin_layout Labeling
3922 \labelwidthstring 00.00.0000
3923 \begin_inset Flex CharStyle:Code
3926 \begin_layout Plain Layout
3934 Specify an accent character
3937 \begin_layout LyX-Code
3946 \begin_layout Standard
3947 This will make the cha
3985 This is the dead key
3989 \begin_layout Plain Layout
3996 refers to a key that does not produce a character by itself, but when followed
3997 with another key, produces the desired accent character.
3998 For example, a German characte
4000 r with an umlaut like
4010 can be produced in this manner.
4019 \begin_layout Standard
4032 and then another key not in
4049 followed by the other, not allowed key, as output.
4053 \begin_inset Flex CharStyle:MenuItem
4056 \begin_layout Plain Layout
4064 cancels a dead key, so if
4075 \begin_inset Flex CharStyle:MenuItem
4078 \begin_layout Plain Layout
4087 , the cursor will not go one position backwards but will instead cancel
4103 might have had on the next keystroke.
4107 \begin_layout Standard
4108 The following example specifies that the character ' is to be an acute accent,
4109 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4112 \begin_layout LyX-Code
4115 kmod ' acute aeiouAEIOU
4118 \begin_layout Labeling
4119 \labelwidthstring 00.00.0000
4120 \begin_inset Flex CharStyle:Code
4123 \begin_layout Plain Layout
4129 Specify an exception to the accent character
4132 \begin_layout LyX-Code
4141 \begin_layout Standard
4142 This defines an exce
4183 have been assigned a keystroke with a previous
4186 \begin_inset Flex CharStyle:Code
4189 \begin_layout Plain Layout
4213 must not belong in the
4260 If such a declaration does not exist in
4268 \begin_inset Flex CharStyle:Code
4271 \begin_layout Plain Layout
4305 \begin_inset Flex CharStyle:Code
4308 \begin_layout Plain Layout
4322 \begin_layout Standard
4323 The following command produces causes äi to be produced when you enter acute-i
4327 \begin_layout LyX-Code
4341 \begin_layout Labeling
4342 \labelwidthstring 00.00.0000
4343 \begin_inset Flex CharStyle:Code
4346 \begin_layout Plain Layout
4352 Combine two accent characters
4355 \begin_layout LyX-Code
4361 accent1 accent2 allowed
4364 \begin_layout Standard
4365 This one is getting pretty esoteric.
4366 It allows you to combine the effect
4422 \begin_inset Flex CharStyle:Code
4425 \begin_layout Plain Layout
4453 \begin_layout Standard
4454 Consider this example from the
4455 \begin_inset Flex CharStyle:Code
4458 \begin_layout Plain Layout
4469 \begin_layout LyX-Code
4472 kmod ; acute aeioyvhAEIOYVH
4476 kcomb acute umlaut iyIY
4479 \begin_layout Standard
4480 This allows you to press
4481 \begin_inset Flex CharStyle:MenuItem
4484 \begin_layout Plain Layout
4492 and get the effect of
4493 \begin_inset Flex CharStyle:Code
4496 \begin_layout Plain Layout
4515 in this case cancels the last dead key, so if you press
4516 \begin_inset Flex CharStyle:MenuItem
4519 \begin_layout Plain Layout
4528 \begin_inset Flex CharStyle:Code
4531 \begin_layout Plain Layout
4544 \begin_layout Subsection
4548 \begin_layout Standard
4550 \begin_inset Flex CharStyle:Code
4553 \begin_layout Plain Layout
4561 mapping is performed, a
4562 \begin_inset Flex CharStyle:Code
4565 \begin_layout Plain Layout
4575 file maps the strings that the symbols generate to characters in the current
4577 The LyX distribution currently includes at least the
4578 \begin_inset Flex CharStyle:Code
4581 \begin_layout Plain Layout
4590 \begin_inset Flex CharStyle:Code
4593 \begin_layout Plain Layout
4604 \begin_layout Standard
4606 \begin_inset Flex CharStyle:Code
4609 \begin_layout Plain Layout
4617 file is a sequence of declarations of the form
4620 \begin_layout LyX-Code
4633 \begin_layout Standard
4634 For example, in order to map
4635 \begin_inset Flex CharStyle:MenuItem
4638 \begin_layout Plain Layout
4648 to the corresponding character in the iso-8859-1 set (233), the following
4652 \begin_layout LyX-Code
4660 \begin_layout Standard
4662 \begin_inset Flex CharStyle:Code
4665 \begin_layout Plain Layout
4674 \begin_inset Flex CharStyle:Code
4677 \begin_layout Plain Layout
4695 the same character can apply to more than one string.
4697 \begin_inset Flex CharStyle:Code
4700 \begin_layout Plain Layout
4711 \begin_layout LyX-Code
4723 \begin_inset Newline newline
4739 \begin_layout Standard
4740 If LyX cannot find a mapping for the string produced by the keystroke or
4741 a deadkey sequence, it will check if it looks like an accented char and
4742 try to draw an accent over the character on screen.
4745 \begin_layout Subsection
4749 \begin_layout Standard
4750 There is a second way to add support for international characters through
4751 so-called dead-keys.
4752 A dead-key works in combination with a letter to produce an accented character.
4753 Here, we'll explain how to create a really simple dead-key to illustrate
4757 \begin_layout Standard
4758 Suppose you happen to need the circumflex character,
4759 \begin_inset Quotes eld
4763 \begin_inset Quotes erd
4768 \begin_inset Flex CharStyle:MenuItem
4771 \begin_layout Plain Layout
4778 \begin_inset space ~
4782 \begin_inset Flex CharStyle:MenuItem
4785 \begin_layout Plain Layout
4791 ] to the LyX command
4792 \begin_inset Flex CharStyle:Code
4795 \begin_layout Plain Layout
4802 \begin_inset Flex CharStyle:Code
4805 \begin_layout Plain Layout
4812 Now, whenever you type the
4813 \begin_inset Flex CharStyle:MenuItem
4816 \begin_layout Plain Layout
4822 -key followed by a letter, that letter will have a circumflex accent on
4824 For example, the sequence
4825 \begin_inset Quotes eld
4829 \begin_inset Flex CharStyle:MenuItem
4832 \begin_layout Plain Layout
4839 \begin_inset Quotes erd
4842 produces the letter:
4843 \begin_inset Quotes eld
4847 \begin_inset Quotes erd
4851 If you tried to type
4852 \begin_inset Quotes eld
4856 \begin_inset Flex CharStyle:MenuItem
4859 \begin_layout Plain Layout
4866 \begin_inset Quotes erd
4869 , however, LyX will complain with a beep, since a
4870 \begin_inset Quotes eld
4874 \begin_inset Flex CharStyle:MenuItem
4877 \begin_layout Plain Layout
4884 \begin_inset Quotes erd
4887 never takes a circumflex accent.
4889 \begin_inset Flex CharStyle:MenuItem
4892 \begin_layout Plain Layout
4898 after a dead-key produces the bare-accent.
4899 Please note this last point! If you bind a key to a dead-key, you'll need
4900 to rebind the character on that key to yet another key.
4902 \begin_inset Flex CharStyle:MenuItem
4905 \begin_layout Plain Layout
4911 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4914 \begin_layout Standard
4915 One common way to bind dead-keys is to use
4916 \begin_inset Flex CharStyle:MenuItem
4919 \begin_layout Plain Layout
4926 \begin_inset Flex CharStyle:MenuItem
4929 \begin_layout Plain Layout
4936 \begin_inset Flex CharStyle:MenuItem
4939 \begin_layout Plain Layout
4945 in combination with an accent, like
4946 \begin_inset Quotes eld
4950 \begin_inset Flex CharStyle:MenuItem
4953 \begin_layout Plain Layout
4960 \begin_inset Quotes erd
4964 \begin_inset Quotes eld
4968 \begin_inset Flex CharStyle:MenuItem
4971 \begin_layout Plain Layout
4978 \begin_inset Quotes erd
4982 \begin_inset Quotes eld
4986 \begin_inset Flex CharStyle:MenuItem
4989 \begin_layout Plain Layout
4996 \begin_inset Quotes erd
5000 Another way involves using
5001 \begin_inset Flex CharStyle:Code
5004 \begin_layout Plain Layout
5011 \begin_inset Flex CharStyle:Code
5014 \begin_layout Plain Layout
5020 to set up the special
5021 \begin_inset Flex CharStyle:Code
5024 \begin_layout Plain Layout
5032 \begin_inset Flex CharStyle:Code
5035 \begin_layout Plain Layout
5041 acts in some ways just like
5042 \begin_inset Flex CharStyle:MenuItem
5045 \begin_layout Plain Layout
5051 and permits you to bind keys to accented characters.
5052 You can also turn keys into dead-keys by binding them to something like
5054 \begin_inset Flex CharStyle:Code
5057 \begin_layout Plain Layout
5063 and then binding this symbolic key to the corresponding LyX command.
5067 \begin_layout Plain Layout
5072 : This is exactly what I do in my
5073 \begin_inset Flex CharStyle:Code
5076 \begin_layout Plain Layout
5083 \begin_inset Flex CharStyle:Code
5086 \begin_layout Plain Layout
5094 \begin_inset Flex CharStyle:MenuItem
5097 \begin_layout Plain Layout
5099 \begin_inset space ~
5108 \begin_inset Flex CharStyle:Code
5111 \begin_layout Plain Layout
5117 and a bunch of these
5118 \begin_inset Quotes eld
5122 \begin_inset Flex CharStyle:Code
5125 \begin_layout Plain Layout
5132 \begin_inset Quotes erd
5135 symbolic keys bound such things as
5136 \begin_inset Flex CharStyle:MenuItem
5139 \begin_layout Plain Layout
5141 \begin_inset space ~
5150 \begin_inset Flex CharStyle:MenuItem
5153 \begin_layout Plain Layout
5155 \begin_inset space ~
5164 This is how I produce my accented characters.
5169 You can make just about anything into the
5170 \begin_inset Flex CharStyle:Code
5173 \begin_layout Plain Layout
5180 \begin_inset Flex CharStyle:MenuItem
5183 \begin_layout Plain Layout
5189 keys, a spare function key, etc.
5190 As for the LyX commands that produce accents, check the entry for
5191 \begin_inset Flex CharStyle:Code
5194 \begin_layout Plain Layout
5205 You'll find the complete list there.
5208 \begin_layout Subsection
5209 Saving your Language Configuration
5212 \begin_layout Standard
5213 You can edit your preferences so that your desired language environment
5214 is automatically configured when LyX starts up, via the
5215 \begin_inset Flex CharStyle:MenuItem
5218 \begin_layout Plain Layout
5219 Edit\SpecialChar \menuseparator
5228 \begin_layout Chapter
5229 Installing New Document Classes, Layouts, and Templates
5230 \begin_inset CommandInset label
5232 name "cha:Installing-New-Document"
5240 \begin_layout Plain Layout
5241 Installing New Document Classes
5249 \begin_layout Standard
5250 In this chapter, we describe the procedures for creating and installing
5251 new LyX layout and template files, as well as offer a refresher on correctly
5252 installing new LaTeX document classes.
5253 Some definitions: a document class is a LaTeX file (usually ending in
5254 \begin_inset Flex CharStyle:Code
5257 \begin_layout Plain Layout
5264 \begin_inset Flex CharStyle:Code
5267 \begin_layout Plain Layout
5273 ) that describes the format of a document such as an article, report, journal
5274 preprint, etc, and all the commands needed to realize that format.
5275 A layout file is a LyX file that corresponds to a LaTeX document class
5276 and that tells LyX how to
5277 \begin_inset Quotes eld
5281 \begin_inset Quotes erd
5284 things on the screen to make the display look something like the final
5286 More precisely, a layout file describes a
5287 \begin_inset Quotes eld
5291 \begin_inset Quotes erd
5294 which is the internal construct LyX uses to render the screen display.
5296 \begin_inset Quotes eld
5300 \begin_inset Quotes erd
5304 \begin_inset Quotes eld
5308 \begin_inset Quotes erd
5311 can be used somewhat interchangeably, but it is better to refer to the
5312 file as the layout, and the thing living in LyX's memory as the text class.
5313 A template file is simply a LyX document that contains a set of predefined
5314 entries for a given document class—entries that are generally required
5316 Templates are especially useful for things like journal manuscripts that
5317 are to be submitted electronically.
5320 \begin_layout Section
5321 Installing a new LaTeX package
5324 \begin_layout Standard
5325 Some installations may not include a LaTeX package that you would like to
5327 For example, you might need FoilTeX, a package for preparing slides or
5328 viewgraphs for overhead projectors.
5329 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5330 a user interface for that.
5331 For example on MiKTeX you start its program
5332 \begin_inset Quotes eld
5336 \begin_inset Quotes erd
5339 to get a list of available packages.
5340 To install one, right click on it or use the installing toolbar button.
5341 When the package you want to install is not in the list, but you have it
5343 \begin_inset Flex CharStyle:Code
5346 \begin_layout Plain Layout
5353 \begin_inset Flex CharStyle:Code
5356 \begin_layout Plain Layout
5362 -file, then copy these files to a subfolder of your LaTeX distribution,
5363 for example to the folder
5372 Then update the file name database of your LaTeX-distribution.
5373 For example on MiKTeX this is done by pressing the button
5376 \begin_inset space ~
5381 that you find in MiKTeX's
5382 \begin_inset Quotes eld
5386 \begin_inset Quotes erd
5390 In both cases you need afterwards to reconfigure LyX using the menu
5391 \begin_inset Flex CharStyle:MenuItem
5394 \begin_layout Plain Layout
5395 Tools\SpecialChar \menuseparator
5401 and then to restart LyX.
5404 \begin_layout Standard
5405 If your LaTeX distribution doesn't provide a user interface, then you can
5406 follow these steps by using a UNIX/Linux console.
5409 \begin_layout Enumerate
5410 Get the package from
5411 \begin_inset CommandInset href
5414 target "http://www.ctan.org/"
5421 \begin_layout Enumerate
5422 You can install this package in several different places.
5423 If you want it to be available for all users on your system, then you should
5424 install it in your `local' TeX tree; if you want (or need) it to be available
5425 just for you, then you can install it in your own `user' TeX tree.
5426 Where these should be created, if they do not already exist, depends upon
5427 the details of your system.
5428 To find out, look in the file
5429 \begin_inset Flex CharStyle:Code
5432 \begin_layout Plain Layout
5442 \begin_layout Plain Layout
5443 This usually lives in the directory
5444 \begin_inset Flex CharStyle:Code
5447 \begin_layout Plain Layout
5453 , though you can run
5454 \begin_inset Flex CharStyle:Code
5457 \begin_layout Plain Layout
5468 The location of the `local' TeX tree is defined by
5469 \begin_inset Flex CharStyle:Code
5472 \begin_layout Plain Layout
5478 ; this is usually somewhere like
5479 \begin_inset Flex CharStyle:Code
5482 \begin_layout Plain Layout
5483 /usr/local/share/texmf/
5489 The `user' TeX tree is defined by
5490 \begin_inset Flex CharStyle:Code
5493 \begin_layout Plain Layout
5500 \begin_inset Flex CharStyle:Code
5503 \begin_layout Plain Layout
5510 (If these variables are not predefined, you can define them.) You'll probably
5511 need root permissions to create or modify the `local' tree; but your `user'
5512 tree shouldn't have such limitations.
5515 \begin_layout Enumerate
5517 \begin_inset Flex CharStyle:Code
5520 \begin_layout Plain Layout
5527 \begin_inset Flex CharStyle:Code
5530 \begin_layout Plain Layout
5537 \begin_inset Flex CharStyle:Code
5540 \begin_layout Plain Layout
5547 \begin_inset space \thinspace{}
5551 \begin_inset Newline newline
5555 \begin_inset Flex CharStyle:Code
5558 \begin_layout Plain Layout
5559 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5565 \begin_inset Newline newline
5568 But, again, most of this will
5569 \begin_inset Quotes eld
5573 \begin_inset Quotes erd
5579 \begin_layout Enumerate
5584 \begin_layout Plain Layout
5585 We'll assume henceforth that you're defining `local' TeX tree.
5586 If you're defining a user tree, just adjust as necessary.
5592 You must follow the directory structure of your existing
5593 \begin_inset Flex CharStyle:Code
5596 \begin_layout Plain Layout
5602 directory, which will be found at
5603 \begin_inset Flex CharStyle:Code
5606 \begin_layout Plain Layout
5613 For example, latex packages should go under
5614 \begin_inset Flex CharStyle:Code
5617 \begin_layout Plain Layout
5618 $TEXMFLOCAL/tex/latex/
5626 \begin_layout Enumerate
5627 Install the package.
5628 For example, you would unpack the FoilTeX tarball and copy it to
5629 \begin_inset Flex CharStyle:Code
5632 \begin_layout Plain Layout
5633 $TEXMFLOCAL/tex/latex/foiltex
5640 \begin_inset Flex CharStyle:Code
5643 \begin_layout Plain Layout
5649 directory contains various files.
5652 \begin_layout Enumerate
5654 \begin_inset Flex CharStyle:Code
5657 \begin_layout Plain Layout
5665 \begin_inset Flex CharStyle:Code
5668 \begin_layout Plain Layout
5677 \begin_layout Standard
5678 Your package is now installed and available to LaTeX.
5679 To make it available to LyX, you need to create a Layout file, if one is
5680 not already available.
5681 (See the next section.) Once you have a layout file, you need only reconfigure
5683 \begin_inset Flex CharStyle:MenuItem
5686 \begin_layout Plain Layout
5687 Tools\SpecialChar \menuseparator
5693 ) and then restart LyX.
5694 You should then see your new package—for example
5695 \begin_inset Flex CharStyle:MenuItem
5698 \begin_layout Plain Layout
5705 \begin_inset Flex CharStyle:MenuItem
5708 \begin_layout Plain Layout
5709 Document\SpecialChar \menuseparator
5716 \begin_inset Flex CharStyle:MenuItem
5719 \begin_layout Plain Layout
5729 \begin_layout Section
5733 \begin_layout Standard
5734 This section describes how to write and install your own LyX layout files
5735 and walks through the
5736 \begin_inset Flex CharStyle:Code
5739 \begin_layout Plain Layout
5745 text class format as an example.
5747 \begin_inset Flex CharStyle:Code
5750 \begin_layout Plain Layout
5756 files describe what paragraph and character styles are available for a
5757 given document class and how LyX should display them.
5758 We try to provide a thorough description of the process here; however,
5759 there are so many different types of documents supported by LaTeX classes
5760 that we can't hope to cover every different possibility or problem you
5762 (The LyX users' list is frequented by people with lots of experience with
5763 layout design who are willing to share what they've learned.)
5766 \begin_layout Standard
5767 As you prepare to write a new layout, it is extremely helpful to look at
5768 the example layouts distributed with LyX.
5769 If you use a nice LaTeX document class that might be of interest for others,
5770 too, and have a nice corresponding LyX layout, feel free to contribute
5771 the stuff to us, so we may put it into the distribution.
5773 \begin_inset CommandInset href
5775 name "section on the LyX wiki"
5776 target "http://wiki.lyx.org/Layouts/Layouts"
5780 for this kind of material.
5783 \begin_layout Standard
5784 All the tags described in this chapter are case-insensitive; this means
5786 \begin_inset Flex CharStyle:Code
5789 \begin_layout Plain Layout
5796 \begin_inset Flex CharStyle:Code
5799 \begin_layout Plain Layout
5806 \begin_inset Flex CharStyle:Code
5809 \begin_layout Plain Layout
5815 are really the same command.
5816 The possible values are printed in brackets after the feature's name.
5817 The default value if a feature isn't specified inside a text class-description
5819 \begin_inset Flex CharStyle:Code
5822 \begin_layout Plain Layout
5831 If the argument has a data type like
5832 \begin_inset Quotes eld
5836 \begin_inset Quotes erd
5840 \begin_inset Quotes eld
5844 \begin_inset Quotes erd
5847 , the default is shown like this:
5848 \begin_inset Flex CharStyle:Code
5851 \begin_layout Plain Layout
5862 \begin_layout Subsection
5864 \begin_inset CommandInset label
5866 name "sub:Layout-modules"
5873 \begin_layout Standard
5874 Similar to layout files, and new with LyX 1.6, are layout
5879 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5880 some modules—such as the endnotes module—provide support for just such
5882 In a sense, layout modules are similar to included files—files like
5883 \begin_inset Flex CharStyle:Code
5886 \begin_layout Plain Layout
5892 —in that modules are not specific to a given document layout but may be
5893 used with many different layouts.
5894 The difference is that using a layout module does not require editing the
5896 Rather, modules are selected in the
5897 \begin_inset Flex CharStyle:MenuItem
5900 \begin_layout Plain Layout
5901 Document\SpecialChar \menuseparator
5910 \begin_layout Standard
5911 Building modules is the easiest way to get started with layout editing,
5912 since it can be as simple as adding a single new paragraph or flex inset.
5913 But modules may, in principle, contain anything a layout file can contain.
5916 \begin_layout Standard
5917 A module must begin with a line like the following:
5920 \begin_layout LyX-Code
5923 DeclareLyXModule[endnotes.sty]{Endnotes}
5926 \begin_layout Standard
5927 The mandatory argument, in curly brackets, is the name of the module, as
5929 \begin_inset Flex CharStyle:MenuItem
5932 \begin_layout Plain Layout
5933 Document\SpecialChar \menuseparator
5941 \change_inserted 2 1243500588
5945 \begin_layout Standard
5946 The argument in square brackets is optional: It declares any LaTeX packages
5947 on which the module depends.
5948 Please note that only packages about which LyX knows should be listed in
5949 the square brackets.
5953 \begin_layout Plain Layout
5954 The list of such packages is documented only in the source code.
5959 LyX will not check for arbitrary packages.
5961 \change_inserted 2 1243500694
5962 It is also possible to use the form
5963 \begin_inset Flex CharStyle:MenuItem
5966 \begin_layout Plain Layout
5968 \change_inserted 2 1243500706
5974 , which declares that the module can only be used when there exists a conversion
5975 chain between formats `from' and `to'.
5980 \begin_layout Standard
5981 The module declaration should then be followed by lines like the following:
5984 \begin_layout LyX-Code
5988 \begin_layout LyX-Code
5989 #Adds an endnote command, in addition to footnotes.
5993 \begin_layout LyX-Code
5994 #You will need to add
5996 theendnotes in TeX code where you
5999 \begin_layout LyX-Code
6000 #want the endnotes to appear.
6004 \begin_layout LyX-Code
6008 \begin_layout LyX-Code
6009 #Requires: somemodule | othermodule
6012 \begin_layout LyX-Code
6013 #Excludes: badmodule
6016 \begin_layout Standard
6017 The description is used in
6018 \begin_inset Flex CharStyle:MenuItem
6021 \begin_layout Plain Layout
6022 Document\SpecialChar \menuseparator
6028 to provide the user with information about what the module does.
6030 \begin_inset Flex CharStyle:Code
6033 \begin_layout Plain Layout
6039 line is used to identify other modules with which this one must be used;
6041 \begin_inset Flex CharStyle:Code
6044 \begin_layout Plain Layout
6050 line is used to identify modules with which this one may not be used.
6051 Both are optional, and, as shown, multiple modules should be separated
6052 with the pipe symbol: |.
6053 Note that the required modules are treated disjunctively:
6057 of the required modules must be used.
6062 excluded module may be used.
6063 Note that modules are identified here by their
6067 without the .module extension.
6069 \begin_inset Flex CharStyle:Code
6072 \begin_layout Plain Layout
6079 \begin_inset Flex CharStyle:Code
6082 \begin_layout Plain Layout
6091 \begin_layout Standard
6092 After creating a new module, you will need to reconfigure and then restart
6093 LyX for the module to appear in the menu.
6094 However, changes you make to the module will be seen immediately, if you
6096 \begin_inset Flex CharStyle:MenuItem
6099 \begin_layout Plain Layout
6100 Document\SpecialChar \menuseparator
6106 , highlight something, and then hit
6107 \begin_inset Quotes eld
6111 \begin_inset Quotes erd
6117 It is strongly recommended that you save your work before doing so
6122 it is strongly recommended that you not attempt to edit modules while simultaneo
6123 usly working on documents
6126 Though of course the developers strive to keep LyX stable in such situations,
6127 syntax errors and the like in your module file could cause strange behavior.
6130 \begin_layout Subsection
6131 Supporting new document classes
6134 \begin_layout Standard
6135 There are two situations you are likely to encounter when wanting to support
6136 a new LaTeX document class, involving LaTeX2e class (
6137 \begin_inset Flex CharStyle:Code
6140 \begin_layout Plain Layout
6147 \begin_inset Flex CharStyle:Code
6150 \begin_layout Plain Layout
6157 Supporting a style file is usually fairly easy.
6158 Supporting a new document class is a bit harder.
6161 \begin_layout Subsection
6163 \begin_inset Flex CharStyle:MenuItem
6166 \begin_layout Plain Layout
6175 \begin_layout Standard
6176 If your new document class is provided as a style file that is used in conjuncti
6177 on with an existing, supported document class—for the sake of the example,
6178 we'll assume that the style file is called
6179 \begin_inset Flex CharStyle:MenuItem
6182 \begin_layout Plain Layout
6188 and it is meant to be used with
6189 \begin_inset Flex CharStyle:MenuItem
6192 \begin_layout Plain Layout
6198 , which is a standard class—start by copying the existing class's layout
6199 file into your local directory:
6202 \begin_layout LyX-Code
6203 cp report.layout ~/.lyx/layouts/myclass.layout
6206 \begin_layout Standard
6208 \begin_inset Flex CharStyle:Code
6211 \begin_layout Plain Layout
6217 and change the line:
6220 \begin_layout LyX-Code
6223 DeclareLaTeXClass{report}
6226 \begin_layout Standard
6230 \begin_layout LyX-Code
6233 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6236 \begin_layout Standard
6240 \begin_layout LyX-Code
6242 \begin_inset Newline newline
6248 \begin_inset Newline newline
6254 \begin_layout Standard
6255 near the top of the file.
6258 \begin_layout Standard
6259 Start LyX and select
6260 \begin_inset Flex CharStyle:MenuItem
6263 \begin_layout Plain Layout
6264 Tools\SpecialChar \menuseparator
6271 Then restart LyX and try creating a new document.
6273 \begin_inset Flex CharStyle:MenuItem
6276 \begin_layout Plain Layout
6282 " as a document class option in the
6283 \begin_inset Flex CharStyle:MenuItem
6286 \begin_layout Plain Layout
6287 Document\SpecialChar \menuseparator
6294 It is likely that some of the sectioning commands and such in your new
6295 class will work differently from how they worked in the base class—
6296 \begin_inset Flex CharStyle:Code
6299 \begin_layout Plain Layout
6305 in this example—so you can fiddle around with the settings for the different
6306 sections if you wish.
6309 \begin_layout Subsection
6311 \begin_inset Flex CharStyle:MenuItem
6314 \begin_layout Plain Layout
6323 \begin_layout Standard
6324 There are two possibilities here.
6325 One is that the class file is itself based upon an existing document class.
6326 For example, many thesis classes are based upon
6327 \begin_inset Flex CharStyle:MenuItem
6330 \begin_layout Plain Layout
6337 To see whether yours is, look for a line like
6340 \begin_layout LyX-Code
6346 \begin_layout Standard
6348 If so, then you may proceed largely as in the previous section, though
6349 the DeclareLaTeXClass line will be different.
6350 If your new class is thesis, and it is based upon book, then the line should
6355 \begin_layout Plain Layout
6356 And it will be easiest if you save the file to
6357 \begin_inset Flex CharStyle:Code
6360 \begin_layout Plain Layout
6366 : LyX assumes that the document class has the same name as the layout file.
6375 \begin_layout LyX-Code
6378 DeclareLaTeXClass[thesis,book]{thesis}
6381 \begin_layout Standard
6382 If, on the other hand, the new class is not based upon an existing class,
6383 you will probably have to
6384 \begin_inset Quotes eld
6388 \begin_inset Quotes erd
6392 We strongly suggest copying an existing layout file which uses a similar
6393 LaTeX class and then modifying it, if you can do so.
6394 At least use an existing file as a starting point so you can find out what
6395 items you need to worry about.
6396 Again, the specifics are covered below.
6399 \begin_layout Section
6400 Declaring a new text class
6403 \begin_layout Standard
6404 When it's finally time to get your hands dirty and create or edit your own
6405 layout file, the following sections describe what you're up against.
6406 Our advice is to go slowly, save and test often, listen to soothing music,
6407 and enjoy one or two of your favorite adult beverages; more if you are
6408 getting particularly stuck.
6409 It's really not that hard, except that the multitude of options can become
6410 overwhelming if you try to do to much in one sitting.
6411 Go have another adult beverage, just for good measure.
6414 \begin_layout Standard
6418 \begin_layout Standard
6419 Lines in a layout file which begin with a
6420 \begin_inset Flex CharStyle:Code
6423 \begin_layout Plain Layout
6430 There is one exception to this rule: all layouts should begin with lines
6434 \begin_layout LyX-Code
6437 #% Do not delete the line below; configure depends on this
6440 \begin_layout LyX-Code
6445 DeclareLaTeXClass{article}
6448 \begin_layout Standard
6449 The second line is used when you configure LyX.
6450 The layout file is read by the LaTeX script
6451 \begin_inset Flex CharStyle:Code
6454 \begin_layout Plain Layout
6460 , in a special mode where
6461 \begin_inset Flex CharStyle:Code
6464 \begin_layout Plain Layout
6471 The first line is just a LaTeX comment, and the second one contains the
6472 declaration of the text class.
6473 If these lines appear in a file named
6474 \begin_inset Flex CharStyle:Code
6477 \begin_layout Plain Layout
6483 , then they define a text class of name
6484 \begin_inset Flex CharStyle:Code
6487 \begin_layout Plain Layout
6493 (the name of the layout file) which uses the LaTeX document class
6494 \begin_inset Flex CharStyle:Code
6497 \begin_layout Plain Layout
6503 (the default is to use the same name as the layout).
6505 \begin_inset Quotes eld
6509 \begin_inset Quotes erd
6512 that appears above is used as a description of the text class in the
6513 \begin_inset Flex CharStyle:MenuItem
6516 \begin_layout Plain Layout
6517 Document\SpecialChar \menuseparator
6526 \begin_layout Standard
6527 Let's assume that you wrote your own text class that uses the
6528 \begin_inset Flex CharStyle:Code
6531 \begin_layout Plain Layout
6537 document class, but where you changed the appearance of the section headings.
6538 If you put it in a file
6539 \begin_inset Flex CharStyle:Code
6542 \begin_layout Plain Layout
6548 , the header of this file should be:
6551 \begin_layout LyX-Code
6554 #% Do not delete the line below; configure depends on this
6557 \begin_layout LyX-Code
6562 DeclareLaTeXClass[article]{article (with my own headings)}
6565 \begin_layout Standard
6566 This declares a text class
6567 \begin_inset Flex CharStyle:Code
6570 \begin_layout Plain Layout
6576 , associated with the LaTeX document class
6577 \begin_inset Flex CharStyle:Code
6580 \begin_layout Plain Layout
6587 \begin_inset Quotes eld
6590 article (with my own headings)
6591 \begin_inset Quotes erd
6595 If your text class depends on several packages, you can declare it as:
6598 \begin_layout LyX-Code
6601 #% Do not delete the line below; configure depends on this
6604 \begin_layout LyX-Code
6609 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6612 \begin_layout Standard
6613 This indicates that your text class uses the foo.sty package.
6614 Finally, it is also possible to declare classes for DocBook code.
6615 Typical declarations will look like
6618 \begin_layout LyX-Code
6621 #% Do not delete the line below; configure depends on this
6624 \begin_layout LyX-Code
6629 DeclareDocBookClass[article]{SGML (DocBook article)}
6632 \begin_layout Standard
6633 Note that these declarations can also be given an optional parameter declaring
6634 the name of the document class (but not a list).
6637 \begin_layout Standard
6638 So, to be as explicit as possible, the form of the layout declaration is:
6641 \begin_layout LyX-Code
6646 DeclareLaTeXClass[class,package.sty]{layout description}
6649 \begin_layout Standard
6650 The class need only be specified if the name of the LaTeX class file and
6651 the name of the layout file are different; if the name of the class file
6652 is not specified, then LyX will simply assume that it is the same as the
6653 name of the layout file.
6656 \begin_layout Standard
6657 When the text class has been modified to your taste, all you have to do
6658 is to copy it either to
6659 \begin_inset Flex CharStyle:Code
6662 \begin_layout Plain Layout
6669 \begin_inset Flex CharStyle:Code
6672 \begin_layout Plain Layout
6679 \begin_inset Flex CharStyle:MenuItem
6682 \begin_layout Plain Layout
6683 Tools\SpecialChar \menuseparator
6689 , exit LyX and restart it.
6690 Then your new text class should be available along with the others.
6693 \begin_layout Standard
6694 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6695 you made to your layout files.
6696 As a result, editing layout files could be very time consuming.
6697 Beginning with 1.6, however, you can force a reload of the layout currently
6698 in use by using the LyX function
6699 \begin_inset Flex CharStyle:MenuItem
6702 \begin_layout Plain Layout
6709 There is no default binding for this function—though, of course, you can
6710 bind it to a key yourself.
6711 If you want to use this function, then, you should simply enter it in the
6717 : This is very much an `advanced feature'.
6722 recommended that you save your work before using this function.
6727 recommended that you not attempt to edit your layout while simultaneously
6728 working on a document that you care about.
6729 Use a test document.
6730 Syntax errors and the like in your layout file could cause peculiar behavior.
6731 In particular, such errors could cause LyX to regard the current layout
6732 as invalid and to attempt to switch to some other layout.
6733 The LyX team strives to keep LyX stable in such situations, but safe is
6737 \begin_layout Subsection
6741 \begin_layout Standard
6742 The first non-comment line must contain the file format number:
6745 \begin_layout Description
6746 \begin_inset Flex CharStyle:Code
6749 \begin_layout Plain Layout
6756 \begin_inset Flex CharStyle:Code
6759 \begin_layout Plain Layout
6765 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6766 don't have an explicit file format).
6767 The file format that is documented here is format 14.
6770 \begin_layout Subsection
6771 General text class parameters
6774 \begin_layout Standard
6775 These are the general parameters which describe the form of the entire document:
6778 \begin_layout Description
6779 \begin_inset Flex CharStyle:Code
6782 \begin_layout Plain Layout
6788 Adds information to the document preamble.
6790 \begin_inset Quotes eld
6794 \begin_inset Flex CharStyle:Code
6797 \begin_layout Plain Layout
6804 \begin_inset Quotes erd
6810 \begin_layout Description
6811 \begin_inset Flex CharStyle:Code
6814 \begin_layout Plain Layout
6820 Describes various global options supported by the document class.
6822 \begin_inset space ~
6826 \begin_inset CommandInset ref
6828 reference "sub:ClassOptions"
6834 \begin_inset Quotes eld
6838 \begin_inset Flex CharStyle:Code
6841 \begin_layout Plain Layout
6848 \begin_inset Quotes erd
6854 \begin_layout Description
6855 \begin_inset Flex CharStyle:Code
6858 \begin_layout Plain Layout
6865 \begin_inset Flex CharStyle:Code
6868 \begin_layout Plain Layout
6877 \begin_inset Flex CharStyle:Code
6880 \begin_layout Plain Layout
6886 ] Whether the class should default to having one or two columns.
6887 Can be changed in the
6888 \begin_inset Flex CharStyle:MenuItem
6891 \begin_layout Plain Layout
6892 Document\SpecialChar \menuseparator
6901 \begin_layout Description
6902 \begin_inset Flex CharStyle:Code
6905 \begin_layout Plain Layout
6911 This sequence defines a new counter.
6913 \begin_inset space ~
6917 \begin_inset CommandInset ref
6919 reference "sub:Counters"
6925 \begin_inset Quotes eld
6929 \begin_inset Flex CharStyle:Code
6932 \begin_layout Plain Layout
6939 \begin_inset Quotes erd
6945 \begin_layout Description
6946 \begin_inset Flex CharStyle:Code
6949 \begin_layout Plain Layout
6955 Sets the default font used to display the document.
6957 \begin_inset space ~
6961 \begin_inset CommandInset ref
6963 reference "sub:Font-description"
6967 for how to declare fonts.
6969 \begin_inset Quotes eld
6973 \begin_inset Flex CharStyle:Code
6976 \begin_layout Plain Layout
6983 \begin_inset Quotes erd
6989 \begin_layout Description
6990 \begin_inset Flex CharStyle:Code
6993 \begin_layout Plain Layout
7000 \begin_inset Flex CharStyle:Code
7003 \begin_layout Plain Layout
7009 Specifies a module to be included by default with this document class,
7010 which should be specified by filename without the
7011 \begin_inset Flex CharStyle:Code
7014 \begin_layout Plain Layout
7021 The user can still remove the module, but it will be active at the outset.
7022 (This applies only when new files are created, or when this class is chosen
7023 for an existing document.)
7026 \begin_layout Description
7027 \begin_inset Flex CharStyle:Code
7030 \begin_layout Plain Layout
7037 \begin_inset Flex CharStyle:Code
7040 \begin_layout Plain Layout
7046 ] This is the style that will be assigned to new paragraphs, usually
7047 \begin_inset Flex CharStyle:MenuItem
7050 \begin_layout Plain Layout
7057 This will default to the first defined style if not given, but you are
7058 highly encouraged to use this directive.
7061 \begin_layout Description
7062 \begin_inset Flex CharStyle:Code
7065 \begin_layout Plain Layout
7072 \begin_inset Flex CharStyle:Code
7075 \begin_layout Plain Layout
7081 ] Indicates that the module in question—which should be specified by filename
7083 \begin_inset Flex CharStyle:Code
7086 \begin_layout Plain Layout
7092 extension—cannot be used with this document class.
7093 This might be used in a journal-specific layout file to prevent, say, the
7095 \begin_inset Flex CharStyle:Code
7098 \begin_layout Plain Layout
7104 module that numbers theorems by section.
7109 be used in a module.
7110 Modules have their own way of excluding other modules (see
7111 \begin_inset CommandInset ref
7113 reference "sub:Layout-modules"
7120 \begin_layout Description
7121 \begin_inset Flex CharStyle:Code
7124 \begin_layout Plain Layout
7130 Defines a new float.
7132 \begin_inset space ~
7136 \begin_inset CommandInset ref
7138 reference "sub:Floats"
7144 \begin_inset Quotes eld
7148 \begin_inset Flex CharStyle:Code
7151 \begin_layout Plain Layout
7158 \begin_inset Quotes erd
7164 \begin_layout Description
7165 \begin_inset Flex CharStyle:Code
7168 \begin_layout Plain Layout
7174 As its name implies, this command allows you to include another layout
7175 definition file within yours to avoid duplicating commands.
7176 Common examples are the standard layout files, for example,
7177 \begin_inset Flex CharStyle:Code
7180 \begin_layout Plain Layout
7186 , which contains most of the basic layouts.
7189 \begin_layout Description
7190 \begin_inset Flex CharStyle:Code
7193 \begin_layout Plain Layout
7199 This section (re-)defines the layout of an inset.
7200 It can be applied to an existing inset of to a new, user-defined inset,
7202 \begin_inset space \thinspace{}
7206 \begin_inset space \space{}
7209 a new character style.
7211 \begin_inset space ~
7215 \begin_inset CommandInset ref
7217 reference "sub:Flex-insets-and"
7221 for more information.
7223 \begin_inset Quotes eld
7227 \begin_inset Flex CharStyle:Code
7230 \begin_layout Plain Layout
7237 \begin_inset Quotes erd
7243 \begin_layout Description
7244 \begin_inset Flex CharStyle:Code
7247 \begin_layout Plain Layout
7253 A string that indicates the width of the left margin on the screen, for
7255 \begin_inset Quotes eld
7259 \begin_inset Quotes erd
7265 \begin_layout Description
7266 \begin_inset Flex CharStyle:Code
7269 \begin_layout Plain Layout
7275 This command deletes an existing float.
7276 This is particularly useful when you want to suppress a float that has
7277 be defined in an input file.
7280 \begin_layout Description
7281 \begin_inset Flex CharStyle:Code
7284 \begin_layout Plain Layout
7290 This command deletes an existing style.
7291 This is particularly useful when you want to suppress a style that has
7292 be defined in an input file.
7295 \begin_layout Description
7296 \begin_inset Flex CharStyle:Code
7299 \begin_layout Plain Layout
7305 A string indicating what sort of output documents using this class will
7307 At present, the options are: `docbook', `latex', and `literate'.
7308 \change_inserted 2 1243500198
7312 \begin_layout Description
7314 \change_inserted 2 1243500505
7315 \begin_inset Flex CharStyle:Code
7318 \begin_layout Plain Layout
7320 \change_inserted 2 1243500208
7326 A string indicating the file format (as defined in the Preferences dialog)
7327 produced by this class.
7328 It is mainly useful when
7329 \begin_inset Flex CharStyle:Code
7332 \begin_layout Plain Layout
7334 \change_inserted 2 1243500394
7340 is `literate' and one wants to define a new type of literate document.
7341 This string is reset to `docbook', `latex', or `literate' when the correspondin
7343 \begin_inset Flex CharStyle:Code
7346 \begin_layout Plain Layout
7348 \change_inserted 2 1243500473
7354 parameter is encountered.
7359 \begin_layout Description
7360 \begin_inset Flex CharStyle:Code
7363 \begin_layout Plain Layout
7374 \begin_inset Flex CharStyle:Code
7377 \begin_layout Plain Layout
7388 \begin_inset Flex CharStyle:Code
7391 \begin_layout Plain Layout
7398 \begin_inset Flex CharStyle:Code
7401 \begin_layout Plain Layout
7407 ] The class default pagestyle.
7408 Can be changed in the
7409 \begin_inset Flex CharStyle:MenuItem
7412 \begin_layout Plain Layout
7413 Document\SpecialChar \menuseparator
7422 \begin_layout Description
7423 \begin_inset Flex CharStyle:Code
7426 \begin_layout Plain Layout
7432 Sets the preamble for the LaTeX document.
7433 Note that this will completely override any prior
7434 \begin_inset Flex CharStyle:Code
7437 \begin_layout Plain Layout
7444 \begin_inset Flex CharStyle:Code
7447 \begin_layout Plain Layout
7455 \begin_inset Quotes eld
7459 \begin_inset Flex CharStyle:Code
7462 \begin_layout Plain Layout
7469 \begin_inset Quotes erd
7475 \begin_layout Description
7476 \begin_inset Flex CharStyle:Code
7479 \begin_layout Plain Layout
7486 \begin_inset Flex CharStyle:Code
7489 \begin_layout Plain Layout
7496 \begin_inset Flex CharStyle:Code
7499 \begin_layout Plain Layout
7508 \begin_inset Flex CharStyle:Code
7511 \begin_layout Plain Layout
7517 ] Whether the class already provides the feature
7518 \begin_inset Flex CharStyle:Code
7521 \begin_layout Plain Layout
7528 A feature is in general the name of a package (
7529 \begin_inset Flex CharStyle:Code
7532 \begin_layout Plain Layout
7539 \begin_inset Flex CharStyle:Code
7542 \begin_layout Plain Layout
7548 , \SpecialChar \ldots{}
7550 \begin_inset Flex CharStyle:Code
7553 \begin_layout Plain Layout
7560 \begin_inset Flex CharStyle:Code
7563 \begin_layout Plain Layout
7569 ,\SpecialChar \ldots{}
7570 ); the complete list of supported features is unfortunately not documented
7571 outside the LyX source code—but see
7572 \begin_inset Flex CharStyle:Code
7575 \begin_layout Plain Layout
7581 if you're interested.
7583 \begin_inset Flex CharStyle:MenuItem
7586 \begin_layout Plain Layout
7587 Help\SpecialChar \menuseparator
7593 also gives an overview of the supported packages.
7596 \begin_layout Description
7597 \begin_inset Flex CharStyle:Code
7600 \begin_layout Plain Layout
7607 \begin_inset Flex CharStyle:Code
7610 \begin_layout Plain Layout
7616 ] Indicates that this layout provides the functionality of the module mentioned,
7617 which should be specified by the filename without the
7618 \begin_inset Flex CharStyle:Code
7621 \begin_layout Plain Layout
7628 This will typically be used if the layout includes the module directly,
7629 rather than using the
7630 \begin_inset Flex CharStyle:Code
7633 \begin_layout Plain Layout
7639 tag to indicate that it ought to be used.
7640 It could be used in a module that provided an alternate implementation
7641 of the same functionality.
7644 \begin_layout Description
7645 \begin_inset Flex CharStyle:Code
7648 \begin_layout Plain Layout
7655 \begin_inset Flex CharStyle:Code
7658 \begin_layout Plain Layout
7664 ] Whether the class requires the feature
7665 \begin_inset Flex CharStyle:Code
7668 \begin_layout Plain Layout
7675 Multiple features must be separated by commas.
7676 Note that you can only request supported features.
7679 \begin_layout Description
7680 \begin_inset Flex CharStyle:Code
7683 \begin_layout Plain Layout
7689 A string that indicates the width of the right margin on the screen, for
7691 \begin_inset Quotes eld
7695 \begin_inset Quotes erd
7701 \begin_layout Description
7702 \begin_inset Flex CharStyle:Code
7705 \begin_layout Plain Layout
7711 Sets which divisions get numbered.
7713 \begin_inset Flex CharStyle:Code
7716 \begin_layout Plain Layout
7725 \begin_layout Description
7726 \begin_inset Flex CharStyle:Code
7729 \begin_layout Plain Layout
7738 \begin_inset Flex CharStyle:Code
7741 \begin_layout Plain Layout
7752 \begin_inset Flex CharStyle:Code
7755 \begin_layout Plain Layout
7761 ] Whether the class-default should be printing on one or both sides of the
7763 Can be changed in the
7764 \begin_inset Flex CharStyle:MenuItem
7767 \begin_layout Plain Layout
7768 Document\SpecialChar \menuseparator
7777 \begin_layout Description
7778 \begin_inset Flex CharStyle:Code
7781 \begin_layout Plain Layout
7787 This sequence defines a new paragraph style.
7788 If the style already exists, it will redefine some of its parameters instead.
7790 \begin_inset space ~
7794 \begin_inset CommandInset ref
7796 reference "sub:Paragraph-Styles"
7802 \begin_inset Quotes eld
7806 \begin_inset Flex CharStyle:Code
7809 \begin_layout Plain Layout
7816 \begin_inset Quotes erd
7822 \begin_layout Description
7823 \begin_inset Flex CharStyle:Code
7826 \begin_layout Plain Layout
7833 \begin_inset Flex CharStyle:Code
7836 \begin_layout Plain Layout
7842 ] The name of the command or environment to be used with
7843 \begin_inset Flex CharStyle:Code
7846 \begin_layout Plain Layout
7855 \begin_layout Description
7856 \begin_inset Flex CharStyle:Code
7859 \begin_layout Plain Layout
7866 \begin_inset Flex CharStyle:Code
7869 \begin_layout Plain Layout
7878 \begin_inset Flex CharStyle:Code
7881 \begin_layout Plain Layout
7887 ] Indicates what kind of markup is used to define the title of a document.
7889 \begin_inset Flex CharStyle:Code
7892 \begin_layout Plain Layout
7898 means that the macro with name
7899 \begin_inset Flex CharStyle:Code
7902 \begin_layout Plain Layout
7908 will be inserted after the last layout which has
7909 \begin_inset Quotes eld
7913 \begin_inset Flex CharStyle:Code
7916 \begin_layout Plain Layout
7923 \begin_inset Quotes erd
7928 \begin_inset Flex CharStyle:Code
7931 \begin_layout Plain Layout
7937 corresponds to the case where the block of paragraphs which have
7938 \begin_inset Quotes eld
7942 \begin_inset Flex CharStyle:Code
7945 \begin_layout Plain Layout
7952 \begin_inset Quotes erd
7955 should be enclosed into the
7956 \begin_inset Flex CharStyle:Code
7959 \begin_layout Plain Layout
7968 \begin_layout Description
7969 \begin_inset Flex CharStyle:Code
7972 \begin_layout Plain Layout
7978 Sets which divisions are included in the table of contents.
7980 \begin_inset Flex CharStyle:Code
7983 \begin_layout Plain Layout
7992 \begin_layout Subsection
7993 \begin_inset Flex CharStyle:Code
7996 \begin_layout Plain Layout
8003 \begin_inset CommandInset label
8005 name "sub:ClassOptions"
8012 \begin_layout Standard
8014 \begin_inset Flex CharStyle:Code
8017 \begin_layout Plain Layout
8023 section can contain the following entries:
8026 \begin_layout Description
8027 \begin_inset Flex CharStyle:Code
8030 \begin_layout Plain Layout
8037 \begin_inset Flex CharStyle:Code
8040 \begin_layout Plain Layout
8046 ] The list of available font sizes for the document's main font, separated
8048 \begin_inset Quotes eld
8052 \begin_inset Flex CharStyle:Code
8055 \begin_layout Plain Layout
8062 \begin_inset Quotes erd
8068 \begin_layout Description
8069 \begin_inset Flex CharStyle:Code
8072 \begin_layout Plain Layout
8078 Used to set the DTD line with XML-based output classes.
8080 \begin_inset space \thinspace{}
8084 \begin_inset Quotes eld
8087 -//OASIS//DTD DocBook V4.2//EN
8088 \begin_inset Quotes erd
8094 \begin_layout Description
8095 \begin_inset Flex CharStyle:Code
8098 \begin_layout Plain Layout
8105 \begin_inset Flex CharStyle:Code
8108 \begin_layout Plain Layout
8109 string="empty|plain|headings|fancy"
8114 ] The list of available page styles, separated by
8115 \begin_inset Quotes eld
8119 \begin_inset Flex CharStyle:Code
8122 \begin_layout Plain Layout
8129 \begin_inset Quotes erd
8135 \begin_layout Description
8136 \begin_inset Flex CharStyle:Code
8139 \begin_layout Plain Layout
8146 \begin_inset Flex CharStyle:Code
8149 \begin_layout Plain Layout
8155 ] Some document class options, separated by a comma, that will be added
8156 to the optional part of the
8157 \begin_inset Flex CharStyle:Code
8160 \begin_layout Plain Layout
8171 \begin_layout Standard
8173 \begin_inset Flex CharStyle:Code
8176 \begin_layout Plain Layout
8182 section must end with
8183 \begin_inset Quotes eld
8187 \begin_inset Flex CharStyle:Code
8190 \begin_layout Plain Layout
8197 \begin_inset Quotes erd
8203 \begin_layout Subsection
8205 \begin_inset CommandInset label
8207 name "sub:Paragraph-Styles"
8214 \begin_layout Standard
8215 A paragraph style description looks like this:
8219 \begin_layout Plain Layout
8220 Note that this will either define a new layout or modify an existing one.
8228 \begin_layout LyX-Code
8235 \begin_layout LyX-Code
8239 \begin_layout LyX-Code
8243 \begin_layout Standard
8244 where the following commands are allowed:
8247 \begin_layout Description
8248 \begin_inset Flex CharStyle:Code
8251 \begin_layout Plain Layout
8258 \begin_inset Flex CharStyle:Code
8261 \begin_layout Plain Layout
8266 , left, right, center
8271 ] Paragraph alignment.
8274 \begin_layout Description
8275 \begin_inset Flex CharStyle:Code
8278 \begin_layout Plain Layout
8285 \begin_inset Flex CharStyle:Code
8288 \begin_layout Plain Layout
8293 , left, right, center
8298 ] A comma separated list of permitted alignments.
8299 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8301 For example a right-aligned or centered enumeration isn't possible.)
8304 \begin_layout Description
8305 \begin_inset Flex CharStyle:Code
8308 \begin_layout Plain Layout
8314 Language dependent information to be included in the LaTeX preamble when
8316 Note that this will completely override any prior
8317 \begin_inset Flex CharStyle:Code
8320 \begin_layout Plain Layout
8328 \begin_inset Quotes eld
8332 \begin_inset Flex CharStyle:Code
8335 \begin_layout Plain Layout
8342 \begin_inset Quotes erd
8346 The contents of this tag will occur once in the LaTeX preamble for each
8347 language used by the document.
8348 Each time, the following substitutions are made:
8352 \begin_layout Itemize
8353 \begin_inset Flex CharStyle:Code
8356 \begin_layout Plain Layout
8362 is replaced by the language name (as used by the babel package).
8365 \begin_layout Itemize
8367 \begin_inset Quotes eld
8371 \begin_inset Quotes erd
8375 \begin_inset Flex CharStyle:Code
8378 \begin_layout Plain Layout
8384 replaces its argument by the translation of the argument to the current
8388 \begin_layout Standard
8389 This preamble snippet will only be used if the document contains more than
8390 one language and the babel package is used.
8394 \begin_layout Description
8395 \begin_inset Flex CharStyle:Code
8398 \begin_layout Plain Layout
8405 \begin_inset Flex CharStyle:Code
8408 \begin_layout Plain Layout
8418 \begin_layout Plain Layout
8419 Note that a `float' here is a real number, such as: 1.5.
8424 The vertical space with which the last of a chain of paragraphs with this
8425 layout is separated from the following paragraph.
8426 If the next paragraph has another layout, the separations are not simply
8427 added, but the maximum is taken.
8430 \begin_layout Description
8431 \begin_inset Flex CharStyle:Code
8434 \begin_layout Plain Layout
8441 \begin_inset Flex CharStyle:Code
8444 \begin_layout Plain Layout
8450 The category for this style.
8451 This is used to group related styles in the Layout combobox on the toolbar.
8452 Any string can be used, but you may want to use existing categories with
8457 \begin_layout Description
8458 \begin_inset Flex CharStyle:Code
8461 \begin_layout Plain Layout
8467 Depth of XML command.
8468 Used only with XML-type formats.
8471 \begin_layout Description
8472 \begin_inset Flex CharStyle:Code
8475 \begin_layout Plain Layout
8482 \begin_inset CommandInset label
8484 name "des:CopyStyle"
8489 \begin_inset Flex CharStyle:Code
8492 \begin_layout Plain Layout
8498 Copies all the features of an existing style into the current one.
8502 \begin_layout Description
8503 \begin_inset Flex CharStyle:Code
8506 \begin_layout Plain Layout
8512 The name of a style whose preamble should be output
8517 This allows to ensure some ordering of the preamble snippets when macros
8518 definitions depend on one another.
8522 \begin_layout Plain Layout
8523 Note that, besides that functionality, there is no way to ensure any ordering
8525 The ordering that you see in a given version of LyX may change without
8526 warning in later versions.
8534 \begin_layout Description
8535 \begin_inset Flex CharStyle:Code
8538 \begin_layout Plain Layout
8545 \begin_inset Flex CharStyle:Code
8548 \begin_layout Plain Layout
8553 , Box, Filled_Box, Static
8558 ] The type of label that stands at the end of the paragraph (or sequence
8560 \begin_inset Flex CharStyle:Code
8563 \begin_layout Plain Layout
8570 \begin_inset Flex CharStyle:Code
8573 \begin_layout Plain Layout
8580 \begin_inset Flex CharStyle:Code
8583 \begin_layout Plain Layout
8590 \begin_inset Flex CharStyle:Code
8593 \begin_layout Plain Layout
8601 \begin_inset Flex CharStyle:Code
8604 \begin_layout Plain Layout
8611 \begin_inset Quotes eld
8615 \begin_inset Quotes erd
8619 \begin_inset Flex CharStyle:Code
8622 \begin_layout Plain Layout
8629 \begin_inset Flex CharStyle:Code
8632 \begin_layout Plain Layout
8633 \begin_inset space ~
8642 \begin_inset space ~
8645 black) square suitable for end of proof markers,
8646 \begin_inset Flex CharStyle:Code
8649 \begin_layout Plain Layout
8655 is an explicit text string.
8658 \begin_layout Description
8659 \begin_inset Flex CharStyle:Code
8662 \begin_layout Plain Layout
8669 \begin_inset Flex CharStyle:Code
8672 \begin_layout Plain Layout
8678 ] The string used for a label with a
8679 \begin_inset Flex CharStyle:Code
8682 \begin_layout Plain Layout
8689 \begin_inset Flex CharStyle:Code
8692 \begin_layout Plain Layout
8702 \begin_layout Description
8703 \begin_inset Flex CharStyle:Code
8706 \begin_layout Plain Layout
8713 \begin_inset Flex CharStyle:Code
8716 \begin_layout Plain Layout
8727 \begin_inset Flex CharStyle:Code
8730 \begin_layout Plain Layout
8739 \begin_layout Description
8740 \begin_inset Flex CharStyle:Code
8743 \begin_layout Plain Layout
8750 \begin_inset Flex CharStyle:Code
8753 \begin_layout Plain Layout
8763 ] With this parameter the
8764 \begin_inset Flex CharStyle:MenuItem
8767 \begin_layout Plain Layout
8774 \begin_inset Quotes eld
8777 Vertical space above
8778 \begin_inset Quotes erd
8782 \begin_inset Flex CharStyle:MenuItem
8785 \begin_layout Plain Layout
8786 Edit\SpecialChar \menuseparator
8788 \begin_inset space ~
8796 dialog can be set when initializing a paragraph with this style.
8800 \begin_layout Plain Layout
8803 Note from Jean-Marc:
8805 I'm not sure that this setting has much use, and it should probably be
8806 removed in later versions.
8814 \begin_layout Description
8815 \begin_inset Flex CharStyle:Code
8818 \begin_layout Plain Layout
8824 The font used for both the text body
8830 \begin_inset space ~
8834 \begin_inset CommandInset ref
8836 reference "sub:Font-description"
8841 Note that defining this font automatically defines the
8842 \begin_inset Flex CharStyle:Code
8845 \begin_layout Plain Layout
8852 So you should define this one first if you also want to define
8853 \begin_inset Flex CharStyle:Code
8856 \begin_layout Plain Layout
8865 \begin_layout Description
8866 \begin_inset Flex CharStyle:Code
8869 \begin_layout Plain Layout
8876 \begin_inset CommandInset label
8878 name "des:FreeSpacing"
8885 \begin_inset Flex CharStyle:Code
8888 \begin_layout Plain Layout
8899 \begin_inset Flex CharStyle:Code
8902 \begin_layout Plain Layout
8908 ] Usually LyX doesn't allow you to insert more than one space between words,
8909 since a space is considered as the separation between two words, not a
8910 character or symbol of its own.
8911 This is a very fine thing but sometimes annoying, for example, when typing
8912 program code or plain LaTeX code.
8914 \begin_inset Flex CharStyle:Code
8917 \begin_layout Plain Layout
8924 Note that LyX will create protected blanks for the additional blanks when
8925 in another mode than LaTeX-mode.
8928 \begin_layout Description
8929 \begin_inset Flex CharStyle:Code
8932 \begin_layout Plain Layout
8938 [[FIXME]] (Used only with XML-type formats.)
8941 \begin_layout Description
8942 \begin_inset Flex CharStyle:Code
8945 \begin_layout Plain Layout
8952 \begin_inset Flex CharStyle:Code
8955 \begin_layout Plain Layout
8961 If 1, marks the layout as being part of a title block (see also the
8962 \begin_inset Flex CharStyle:Code
8965 \begin_layout Plain Layout
8972 \begin_inset Flex CharStyle:Code
8975 \begin_layout Plain Layout
8984 \begin_layout Description
8985 \begin_inset Flex CharStyle:Code
8988 \begin_layout Plain Layout
8995 \begin_inset Flex CharStyle:Code
8998 \begin_layout Plain Layout
9004 ] This provides extra space between paragraphs that have the same layout.
9005 If you put other layouts into an environment, each is separated with the
9007 \begin_inset Flex CharStyle:Code
9010 \begin_layout Plain Layout
9017 But the whole items of the environment are additionally separated with
9019 \begin_inset Flex CharStyle:Code
9022 \begin_layout Plain Layout
9034 \begin_layout Description
9035 \begin_inset Flex CharStyle:Code
9038 \begin_layout Plain Layout
9044 [[FIXME]] (Used only with XML-type formats.)
9047 \begin_layout Description
9048 \begin_inset Flex CharStyle:Code
9051 \begin_layout Plain Layout
9058 \begin_inset CommandInset label
9060 name "des:KeepEmpty"
9067 \begin_inset Flex CharStyle:Code
9070 \begin_layout Plain Layout
9081 \begin_inset Flex CharStyle:Code
9084 \begin_layout Plain Layout
9090 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9091 lead to empty LaTeX output.
9092 There are some cases where this could be desirable however: in a letter
9093 template, the required fields can be provided as empty fields, so that
9094 people do not forget them; in some special classes, a layout can be used
9095 as some kind of break, which does not contain actual text.
9098 \begin_layout Description
9099 \begin_inset Flex CharStyle:Code
9102 \begin_layout Plain Layout
9108 [float=0] The vertical space between the label and the text body.
9109 Only used for labels that are above the text body (
9110 \begin_inset Flex CharStyle:Code
9113 \begin_layout Plain Layout
9120 \begin_inset Flex CharStyle:Code
9123 \begin_layout Plain Layout
9124 Centered_Top_Environment
9132 \begin_layout Description
9133 \begin_inset Flex CharStyle:Code
9136 \begin_layout Plain Layout
9143 \begin_inset Flex CharStyle:Code
9146 \begin_layout Plain Layout
9153 \begin_inset Newline newline
9156 The name of the counter for automatic numbering.
9158 \begin_inset Newline newline
9166 \begin_inset Flex CharStyle:Code
9169 \begin_layout Plain Layout
9176 \begin_inset Flex CharStyle:Code
9179 \begin_layout Plain Layout
9186 In that case, the counter will be stepped each time the layout appears.
9188 \begin_inset Newline newline
9196 \begin_inset Flex CharStyle:Code
9199 \begin_layout Plain Layout
9206 \begin_inset Flex CharStyle:Code
9209 \begin_layout Plain Layout
9215 , though this case is a bit complicated.
9217 \begin_inset Quotes eld
9221 \begin_inset Flex CharStyle:Code
9224 \begin_layout Plain Layout
9231 \begin_inset Quotes erd
9235 Then the actual counters used are
9236 \begin_inset Flex CharStyle:Code
9239 \begin_layout Plain Layout
9246 \begin_inset Flex CharStyle:Code
9249 \begin_layout Plain Layout
9256 \begin_inset Flex CharStyle:Code
9259 \begin_layout Plain Layout
9266 \begin_inset Flex CharStyle:Code
9269 \begin_layout Plain Layout
9276 These counters must all be declared separately.
9277 \begin_inset Newline newline
9281 \begin_inset CommandInset ref
9283 reference "sub:Counters"
9287 for details on counters.
9290 \begin_layout Description
9291 \begin_inset Flex CharStyle:Code
9294 \begin_layout Plain Layout
9300 The font used for the label.
9302 \begin_inset space ~
9306 \begin_inset CommandInset ref
9308 reference "sub:Font-description"
9315 \begin_layout Description
9316 \begin_inset Flex CharStyle:Code
9319 \begin_layout Plain Layout
9325 Text that indicates how far a label should be indented.
9328 \begin_layout Description
9329 \begin_inset Flex CharStyle:Code
9332 \begin_layout Plain Layout
9339 \begin_inset Flex CharStyle:Code
9342 \begin_layout Plain Layout
9348 ] The horizontal space between the label and the text body.
9349 Only used for labels that are not above the text body.
9352 \begin_layout Description
9353 \begin_inset Flex CharStyle:Code
9356 \begin_layout Plain Layout
9363 \begin_inset Flex CharStyle:Code
9366 \begin_layout Plain Layout
9372 ] The string used for a label with a
9373 \begin_inset Flex CharStyle:Code
9376 \begin_layout Plain Layout
9384 \begin_inset Flex CharStyle:Code
9387 \begin_layout Plain Layout
9393 is set, this string can be contain the special formatting commands described
9395 \begin_inset CommandInset ref
9397 reference "sub:Counters"
9405 \begin_layout Plain Layout
9406 For the sake of backwards compatibility, the string
9407 \begin_inset Flex CharStyle:Code
9410 \begin_layout Plain Layout
9420 will be replaced by the expanded
9421 \begin_inset Flex CharStyle:Code
9424 \begin_layout Plain Layout
9431 \begin_inset Flex CharStyle:Code
9434 \begin_layout Plain Layout
9443 This feature is now obsolete and should be replaced by the mechanisms of
9445 \begin_inset CommandInset ref
9447 reference "sub:Counters"
9459 \begin_layout Description
9460 \begin_inset Flex CharStyle:Code
9463 \begin_layout Plain Layout
9470 \begin_inset Flex CharStyle:Code
9473 \begin_layout Plain Layout
9479 ] This is used inside the appendix instead of
9480 \begin_inset Flex CharStyle:Code
9483 \begin_layout Plain Layout
9491 \begin_inset Flex CharStyle:Code
9494 \begin_layout Plain Layout
9501 \begin_inset Flex CharStyle:Code
9504 \begin_layout Plain Layout
9513 \begin_layout Description
9514 \begin_inset Flex CharStyle:Code
9517 \begin_layout Plain Layout
9523 [FIXME] (Used only with XML-type formats.)
9526 \begin_layout Description
9527 \begin_inset Flex CharStyle:Code
9530 \begin_layout Plain Layout
9537 \begin_inset Flex CharStyle:Code
9540 \begin_layout Plain Layout
9545 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
9546 Enumerate, Itemize, Bibliography
9555 \begin_layout Itemize
9556 \begin_inset Flex CharStyle:Code
9559 \begin_layout Plain Layout
9565 means the label is the very first word (up to the first real blank).
9566 Use protected spaces (like
9567 \begin_inset space ~
9570 that one) if you want more than one word as the label.
9574 \begin_layout Itemize
9575 \begin_inset Flex CharStyle:Code
9578 \begin_layout Plain Layout
9584 means the label is simply whatever
9585 \begin_inset Flex CharStyle:Code
9588 \begin_layout Plain Layout
9595 Note that this really is `static'.
9598 \begin_layout Itemize
9599 \begin_inset Flex CharStyle:Code
9602 \begin_layout Plain Layout
9609 \begin_inset Flex CharStyle:Code
9612 \begin_layout Plain Layout
9613 Centered_Top_Environment
9618 are special cases of
9619 \begin_inset Flex CharStyle:Code
9622 \begin_layout Plain Layout
9629 The label will be printed above the paragraph, but only at the top of an
9630 environment or the top of a chain of paragraphs with this layout.
9631 This might be used with the
9632 \begin_inset Flex CharStyle:MenuItem
9635 \begin_layout Plain Layout
9641 layout, for example.
9644 \begin_layout Itemize
9645 \begin_inset Flex CharStyle:Code
9648 \begin_layout Plain Layout
9654 is a special case for the caption-labels
9655 \begin_inset Quotes eld
9659 \begin_inset Quotes erd
9663 \begin_inset Quotes eld
9667 \begin_inset Quotes erd
9672 \begin_inset Flex CharStyle:Code
9675 \begin_layout Plain Layout
9681 means the (hardcoded) label string depends on the kind of float: It is
9682 hardcoded to be `FloatType N', where N is the value of the counter associated
9686 \begin_layout Itemize
9688 \begin_inset Flex CharStyle:Code
9691 \begin_layout Plain Layout
9697 label type defines automatically numbered labels.
9699 \begin_inset Flex CharStyle:Code
9702 \begin_layout Plain Layout
9708 will be expanded to resolve any counter references it contains: For example,
9710 \begin_inset Quotes eld
9714 \begin_inset Flex CharStyle:Code
9717 \begin_layout Plain Layout
9728 \begin_inset Quotes erd
9733 \begin_inset CommandInset ref
9735 reference "sub:Counters"
9739 for more information on counters.
9742 \begin_layout Itemize
9743 \begin_inset Flex CharStyle:Code
9746 \begin_layout Plain Layout
9752 produces the usual sort of enumeration labels.
9753 At present, it is hardcoded to use Arabic numerals, lowercase letters,
9754 small Roman numerals, and uppercase letters for the four possible depths.
9757 \begin_layout Itemize
9758 \begin_inset Flex CharStyle:Code
9761 \begin_layout Plain Layout
9767 produces various bullets at the different levels.
9768 It is also hardcoded.
9771 \begin_layout Itemize
9772 \begin_inset Flex CharStyle:Code
9775 \begin_layout Plain Layout
9781 is used internally by LyX and should be used only with
9782 \begin_inset Flex CharStyle:Code
9785 \begin_layout Plain Layout
9786 LatexType BibEnvironment
9795 \begin_layout Description
9796 \begin_inset Flex CharStyle:Code
9799 \begin_layout Plain Layout
9806 \begin_inset Flex CharStyle:Code
9809 \begin_layout Plain Layout
9815 , but this preamble snippet occurs independently from the babel package,
9816 and only for the document language.
9818 \begin_inset Quotes eld
9822 \begin_inset Flex CharStyle:Code
9825 \begin_layout Plain Layout
9832 \begin_inset Quotes erd
9839 \begin_layout Standard
9840 If the style defines text that appears in the typeset document, it may use
9842 \begin_inset Flex CharStyle:Code
9845 \begin_layout Plain Layout
9852 \begin_inset Flex CharStyle:Code
9855 \begin_layout Plain Layout
9861 to support non-english and even multilanguage documents correctly.
9862 The following excerpt (from the
9863 \begin_inset Flex CharStyle:Code
9866 \begin_layout Plain Layout
9872 file) shows how this works:
9875 \begin_layout LyX-Code
9879 \begin_layout LyX-Code
9882 theoremstyle{remark}
9885 \begin_layout LyX-Code
9888 newtheorem{claim}[thm]{
9895 \begin_layout LyX-Code
9899 \begin_layout LyX-Code
9903 \begin_layout LyX-Code
9908 claimname}{_(Claim)}
9911 \begin_layout LyX-Code
9915 \begin_layout LyX-Code
9919 \begin_layout LyX-Code
9923 \begin_layout LyX-Code
9932 claimname}{_(Claim)}}
9935 \begin_layout LyX-Code
9939 \begin_layout Standard
9940 The key to correct translation of the user visible text is the definition
9942 \begin_inset Flex CharStyle:Code
9945 \begin_layout Plain Layout
9953 in the language preamble.
9954 This command holds the name of the theorem that will appear in the output.
9956 \begin_inset Flex CharStyle:Code
9959 \begin_layout Plain Layout
9965 then uses the commands offered by the babel package to redefine
9966 \begin_inset Flex CharStyle:Code
9969 \begin_layout Plain Layout
9977 for each used language in multilanguage documents.
9981 \begin_layout Description
9982 \begin_inset Flex CharStyle:Code
9985 \begin_layout Plain Layout
9991 The name of the corresponding LaTeX stuff.
9992 Either the environment or command name.
9995 \begin_layout Description
9996 \begin_inset Flex CharStyle:Code
9999 \begin_layout Plain Layout
10005 An optional parameter for the corresponding
10006 \begin_inset Flex CharStyle:Code
10009 \begin_layout Plain Layout
10016 This parameter cannot be changed from within LyX.
10019 \begin_layout Description
10020 \begin_inset Flex CharStyle:Code
10023 \begin_layout Plain Layout
10030 \begin_inset CommandInset label
10032 name "des:LatexType"
10037 \begin_inset Flex CharStyle:Code
10040 \begin_layout Plain Layout
10045 , Command, Environment, Item_Environment,
10051 \begin_inset Flex CharStyle:Code
10054 \begin_layout Plain Layout
10055 List_Environment, Bib_Environment
10060 ] How the layout should be translated into LaTeX.
10064 \begin_layout Plain Layout
10065 \begin_inset Flex CharStyle:Code
10068 \begin_layout Plain Layout
10074 is perhaps a bit misleading, since these rules apply to SGML classes, too.
10075 Visit the SGML class files for specific examples.
10084 \begin_layout Itemize
10085 \begin_inset Flex CharStyle:Code
10088 \begin_layout Plain Layout
10094 means nothing special.
10098 \begin_layout Itemize
10099 \begin_inset Flex CharStyle:Code
10102 \begin_layout Plain Layout
10109 \begin_inset Flex CharStyle:Code
10112 \begin_layout Plain Layout
10119 {\SpecialChar \ldots{}
10128 \begin_layout Itemize
10129 \begin_inset Flex CharStyle:Code
10132 \begin_layout Plain Layout
10139 \begin_inset Flex CharStyle:Code
10142 \begin_layout Plain Layout
10149 }\SpecialChar \ldots{}
10165 \begin_layout Itemize
10166 \begin_inset Flex CharStyle:Code
10169 \begin_layout Plain Layout
10176 \begin_inset Flex CharStyle:Code
10179 \begin_layout Plain Layout
10186 \begin_inset Flex CharStyle:Code
10189 \begin_layout Plain Layout
10197 is generated for each paragraph of this environment.
10201 \begin_layout Itemize
10202 \begin_inset Flex CharStyle:Code
10205 \begin_layout Plain Layout
10212 \begin_inset Flex CharStyle:Code
10215 \begin_layout Plain Layout
10222 \begin_inset Flex CharStyle:Code
10225 \begin_layout Plain Layout
10231 is passed as an argument to the environment.
10233 \begin_inset Flex CharStyle:Code
10236 \begin_layout Plain Layout
10242 can be defined in the
10243 \begin_inset Flex CharStyle:MenuItem
10246 \begin_layout Plain Layout
10251 ayout\SpecialChar \menuseparator
10265 \begin_layout Standard
10266 Putting the last few things together, the LaTeX output will be either:
10269 \begin_layout LyX-Code
10272 latexname[latexparam]{\SpecialChar \ldots{}
10276 \begin_layout Standard
10280 \begin_layout LyX-Code
10283 begin{latexname}[latexparam] \SpecialChar \ldots{}
10289 \begin_layout Standard
10290 depending upon the LaTeX type.
10294 \begin_layout Description
10295 \begin_inset Flex CharStyle:Code
10298 \begin_layout Plain Layout
10305 \begin_inset Flex CharStyle:Code
10308 \begin_layout Plain Layout
10314 ] If you put layouts into environments, the leftmargins are not simply added,
10315 but added with a factor
10316 \begin_inset Formula $\frac{4}{depth+4}$
10320 Note that this parameter is also used when the margin is defined as
10321 \begin_inset Flex CharStyle:Code
10324 \begin_layout Plain Layout
10331 \begin_inset Flex CharStyle:Code
10334 \begin_layout Plain Layout
10341 Then it is added to the manual or dynamic margin.
10343 \begin_inset Newline newline
10346 The argument is passed as a string.
10348 \begin_inset Quotes eld
10352 \begin_inset Flex CharStyle:Code
10355 \begin_layout Plain Layout
10362 \begin_inset Quotes erd
10365 means that the paragraph is indented with the width of
10366 \begin_inset Quotes eld
10370 \begin_inset Flex CharStyle:Code
10373 \begin_layout Plain Layout
10380 \begin_inset Quotes erd
10383 in the normal font.
10384 You can get a negative width by prefixing the string with
10385 \begin_inset Quotes eld
10389 \begin_inset Flex CharStyle:Code
10392 \begin_layout Plain Layout
10399 \begin_inset Quotes erd
10403 This way was chosen so that the look is the same with each used screen
10408 \begin_layout Description
10409 \begin_inset Flex CharStyle:Code
10412 \begin_layout Plain Layout
10419 \begin_inset Flex CharStyle:Code
10422 \begin_layout Plain Layout
10427 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10433 \begin_inset Newline newline
10436 The kind of margin that the layout has on the left side.
10438 \begin_inset Flex CharStyle:Code
10441 \begin_layout Plain Layout
10447 just means a fixed margin.
10449 \begin_inset Flex CharStyle:Code
10452 \begin_layout Plain Layout
10458 means that the left margin depends on the string entered in the
10459 \begin_inset Flex CharStyle:MenuItem
10462 \begin_layout Plain Layout
10463 Edit\SpecialChar \menuseparator
10465 \begin_inset space ~
10474 This is used to typeset nice lists without tabulators.
10476 \begin_inset Flex CharStyle:Code
10479 \begin_layout Plain Layout
10485 means that the margin depends on the size of the label.
10486 This is used for automatic enumerated headlines.
10487 It is obvious that the headline
10488 \begin_inset Quotes eld
10491 5.4.3.2.1 Very long headline
10492 \begin_inset Quotes erd
10495 must have a wider left margin (as wide as
10496 \begin_inset Quotes eld
10500 \begin_inset Quotes erd
10503 plus the space) than
10504 \begin_inset Quotes eld
10507 3.2 Very long headline
10508 \begin_inset Quotes erd
10512 \begin_inset Quotes eld
10516 \begin_inset Quotes erd
10519 are not able to do this.
10521 \begin_inset Flex CharStyle:Code
10524 \begin_layout Plain Layout
10530 is similar, but only the very first row of the paragraph is dynamic, while
10531 the others are static; this is used, for example, for descriptions.
10533 \begin_inset Flex CharStyle:Code
10536 \begin_layout Plain Layout
10542 means the margin is chosen in a way that the longest row of this paragraph
10543 fits to the right margin.
10544 This is used to typeset an address on the right edge of the page.
10547 \begin_layout Description
10548 \begin_inset Flex CharStyle:Code
10551 \begin_layout Plain Layout
10558 \begin_inset Flex CharStyle:Code
10561 \begin_layout Plain Layout
10570 \begin_inset Flex CharStyle:Code
10573 \begin_layout Plain Layout
10579 ] Whether fragile commands in this layout should be
10580 \begin_inset Flex CharStyle:Code
10583 \begin_layout Plain Layout
10596 whether this command should itself be protected.)
10599 \begin_layout Description
10600 \begin_inset Flex CharStyle:Code
10603 \begin_layout Plain Layout
10610 \begin_inset Flex CharStyle:Code
10613 \begin_layout Plain Layout
10620 \begin_inset Flex CharStyle:Code
10623 \begin_layout Plain Layout
10631 ] Whether newlines are translated into LaTeX newlines (
10632 \begin_inset Flex CharStyle:Code
10635 \begin_layout Plain Layout
10646 The translation can be switched off to allow more comfortable LaTeX editing
10650 \begin_layout Description
10651 \begin_inset Flex CharStyle:Code
10654 \begin_layout Plain Layout
10661 \begin_inset Flex CharStyle:Code
10664 \begin_layout Plain Layout
10671 \begin_inset Flex CharStyle:Code
10674 \begin_layout Plain Layout
10682 ] Whether the following Paragraph is allowed to indent its very first row.
10684 \begin_inset Flex CharStyle:Code
10687 \begin_layout Plain Layout
10693 means that it is not allowed to do so;
10694 \begin_inset Flex CharStyle:Code
10697 \begin_layout Plain Layout
10703 means it could do so if it wants to.
10706 \begin_layout Description
10707 \begin_inset Flex CharStyle:Code
10710 \begin_layout Plain Layout
10716 Name of a layout that has replaced this layout.
10717 This is used to rename a layout, while keeping backward compatibility.
10720 \begin_layout Description
10721 \begin_inset Flex CharStyle:Code
10724 \begin_layout Plain Layout
10731 \begin_inset Flex CharStyle:Code
10734 \begin_layout Plain Layout
10740 ] The number of optional arguments that can be used with this layout.
10741 This is useful for things like section headings, and only makes sense with
10745 \begin_layout Description
10746 \begin_inset Flex CharStyle:Code
10749 \begin_layout Plain Layout
10756 \begin_inset Flex CharStyle:Code
10759 \begin_layout Plain Layout
10765 ] The indent of the very first line of a paragraph.
10767 \begin_inset Flex CharStyle:Code
10770 \begin_layout Plain Layout
10776 will be fixed for a certain layout.
10777 The exception is Standard layout, since the indentation of a Standard layout
10778 paragraph can be prohibited with
10779 \begin_inset Flex CharStyle:Code
10782 \begin_layout Plain Layout
10789 Also, Standard layout paragraphs inside environments use the
10790 \begin_inset Flex CharStyle:Code
10793 \begin_layout Plain Layout
10799 of the environment, not their native one.
10800 For example, Standard paragraphs inside an enumeration are not indented.
10803 \begin_layout Description
10804 \begin_inset Flex CharStyle:Code
10807 \begin_layout Plain Layout
10814 \begin_inset Flex CharStyle:Code
10817 \begin_layout Plain Layout
10823 ] The vertical space between two paragraphs of this layout.
10826 \begin_layout Description
10827 \begin_inset Flex CharStyle:Code
10830 \begin_layout Plain Layout
10837 \begin_inset Flex CharStyle:Code
10840 \begin_layout Plain Layout
10846 ] LyX allows the user to choose either
10847 \begin_inset Quotes eld
10851 \begin_inset Quotes erd
10855 \begin_inset Quotes eld
10859 \begin_inset Quotes erd
10862 to typeset a document.
10864 \begin_inset Quotes eld
10868 \begin_inset Quotes erd
10871 is chosen, this value is completely ignored.
10873 \begin_inset Quotes eld
10877 \begin_inset Quotes erd
10880 is chosen, the parindent of a LaTeXtype
10881 \begin_inset Quotes eld
10885 \begin_inset Quotes erd
10888 layout is ignored and all paragraphs are separated by this parskip argument.
10889 The vertical space is calculated with
10890 \begin_inset Flex CharStyle:Code
10893 \begin_layout Plain Layout
10895 \begin_inset space ~
10904 \begin_inset Flex CharStyle:Code
10907 \begin_layout Plain Layout
10913 is the height of a row with the normal font.
10914 This way, the look stays the same with different screen fonts.
10917 \begin_layout Description
10918 \begin_inset Flex CharStyle:Code
10921 \begin_layout Plain Layout
10928 \begin_inset CommandInset label
10930 name "des:PathThru"
10937 \begin_inset Flex CharStyle:Code
10940 \begin_layout Plain Layout
10951 \begin_inset Flex CharStyle:Code
10954 \begin_layout Plain Layout
10960 ] Whether the contents of this paragraph should be output in raw form, meaning
10961 without special translations that LaTeX would require.
10964 \begin_layout Description
10965 \begin_inset Flex CharStyle:Code
10968 \begin_layout Plain Layout
10975 \begin_inset CommandInset label
10977 name "des:Preamble"
10981 Information to be included in the LaTeX preamble when this style is used.
10982 Used to define macros, load packages, etc., required by this particular
10985 \begin_inset Quotes eld
10989 \begin_inset Flex CharStyle:Code
10992 \begin_layout Plain Layout
10999 \begin_inset Quotes erd
11005 \begin_layout Description
11006 \begin_inset Flex CharStyle:Code
11009 \begin_layout Plain Layout
11016 \begin_inset Flex CharStyle:Code
11019 \begin_layout Plain Layout
11026 \begin_inset CommandInset label
11028 name "des:Requires"
11032 Whether the layout requires the feature
11033 \begin_inset Flex CharStyle:Code
11036 \begin_layout Plain Layout
11043 See the description of
11044 \begin_inset Flex CharStyle:Code
11047 \begin_layout Plain Layout
11054 \begin_inset CommandInset ref
11055 LatexCommand pageref
11056 reference "des:FreeSpacing"
11060 ) for information on `features'.
11064 \begin_layout Description
11065 \begin_inset Flex CharStyle:Code
11068 \begin_layout Plain Layout
11075 \begin_inset Flex CharStyle:Code
11078 \begin_layout Plain Layout
11085 \begin_inset Flex CharStyle:Code
11088 \begin_layout Plain Layout
11097 \begin_layout Description
11098 \begin_inset Flex CharStyle:Code
11101 \begin_layout Plain Layout
11108 \begin_inset Flex CharStyle:Code
11111 \begin_layout Plain Layout
11116 , onehalf, double, other
11125 ] This defines what the default spacing should be in the layout.
11127 \begin_inset Flex CharStyle:Code
11130 \begin_layout Plain Layout
11137 \begin_inset Flex CharStyle:Code
11140 \begin_layout Plain Layout
11147 \begin_inset Flex CharStyle:Code
11150 \begin_layout Plain Layout
11156 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
11157 If you specify the argument
11158 \begin_inset Flex CharStyle:Code
11161 \begin_layout Plain Layout
11167 , then you should also provide a numerical argument which will be the actual
11169 Note that, contrary to other parameters,
11170 \begin_inset Flex CharStyle:Code
11173 \begin_layout Plain Layout
11179 implies the generation of specific LaTeX code, using the package
11182 \begin_inset Flex CharStyle:Code
11185 \begin_layout Plain Layout
11194 \begin_layout Description
11195 \begin_inset Flex CharStyle:Code
11198 \begin_layout Plain Layout
11204 The font used for the text body .
11206 \begin_inset CommandInset ref
11208 reference "sub:Font-description"
11215 \begin_layout Description
11216 \begin_inset Flex CharStyle:Code
11219 \begin_layout Plain Layout
11227 The level of the style in the table of contents.
11228 This is used for automatic numbering of section headings.
11231 \begin_layout Description
11232 \begin_inset Flex CharStyle:Code
11235 \begin_layout Plain Layout
11242 \begin_inset Flex CharStyle:Code
11245 \begin_layout Plain Layout
11251 ] The vertical space with which the very first of a chain of paragraphs
11252 with this layout is separated from the previous paragraph.
11253 If the previous paragraph has another layout, the separations are not simply
11254 added, but the maximum is taken.
11257 \begin_layout Subsection
11259 \begin_inset CommandInset label
11268 \begin_layout Standard
11269 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11270 define the floats (
11271 \begin_inset Flex CharStyle:MenuItem
11274 \begin_layout Plain Layout
11281 \begin_inset Flex CharStyle:MenuItem
11284 \begin_layout Plain Layout
11290 , \SpecialChar \ldots{}
11291 ) in the text class itself.
11292 Standard floats are included in the file
11293 \begin_inset Flex CharStyle:Code
11296 \begin_layout Plain Layout
11302 , so you may have to do no more than add
11305 \begin_layout LyX-Code
11306 Input stdfloats.inc
11309 \begin_layout Standard
11310 to your layout file.
11311 If you want to implement a text class that proposes some other float types
11312 (like the AGU class bundled with LyX), the information below will hopefully
11316 \begin_layout Description
11317 \begin_inset Flex CharStyle:Code
11320 \begin_layout Plain Layout
11327 \begin_inset Flex CharStyle:Code
11330 \begin_layout Plain Layout
11337 \begin_inset Quotes erd
11341 \begin_inset Quotes erd
11344 ] The file name extension of an auxiliary file for the list of figures (or
11346 LaTeX writes the captions to this file.
11349 \begin_layout Description
11350 \begin_inset Flex CharStyle:Code
11353 \begin_layout Plain Layout
11360 \begin_inset Flex CharStyle:Code
11363 \begin_layout Plain Layout
11370 \begin_inset Quotes erd
11374 \begin_inset Quotes erd
11377 ] The string that will be used in the menus and also for the caption.
11379 \change_inserted 3 1244364642
11380 This is translated to the current language if babel is used.
11385 \begin_layout Description
11386 \begin_inset Flex CharStyle:Code
11389 \begin_layout Plain Layout
11396 \begin_inset Flex CharStyle:Code
11399 \begin_layout Plain Layout
11408 \begin_inset Flex CharStyle:Code
11411 \begin_layout Plain Layout
11418 \begin_inset Flex CharStyle:Code
11421 \begin_layout Plain Layout
11427 if the float is already defined by the LaTeX document class.
11429 \begin_inset Flex CharStyle:Code
11432 \begin_layout Plain Layout
11438 , the float will be defined using the LaTeX package
11439 \begin_inset Flex CharStyle:Code
11442 \begin_layout Plain Layout
11451 \begin_layout Description
11452 \begin_inset Flex CharStyle:Code
11455 \begin_layout Plain Layout
11462 \begin_inset Flex CharStyle:Code
11465 \begin_layout Plain Layout
11472 \begin_inset Quotes erd
11476 \begin_inset Quotes erd
11479 ] The heading used for the list of floats.
11481 \change_inserted 3 1244364301
11482 This is translated to the document language.
11487 \begin_layout Description
11488 \begin_inset Flex CharStyle:Code
11491 \begin_layout Plain Layout
11498 \begin_inset Flex CharStyle:Code
11501 \begin_layout Plain Layout
11508 \begin_inset Quotes erd
11512 \begin_inset Quotes erd
11515 ] This (optional) argument determines whether floats of this class will
11516 be numbered within some sectional unit of the document.
11517 For example, if within is equal to
11518 \begin_inset Flex CharStyle:Code
11521 \begin_layout Plain Layout
11527 , the floats will be numbered within chapters.
11531 \begin_layout Description
11532 \begin_inset Flex CharStyle:Code
11535 \begin_layout Plain Layout
11542 \begin_inset Flex CharStyle:Code
11545 \begin_layout Plain Layout
11552 \begin_inset Quotes erd
11556 \begin_inset Quotes erd
11559 ] The default placement for the given class of floats.
11560 The string should be as in standard LaTeX:
11561 \begin_inset Flex CharStyle:Code
11564 \begin_layout Plain Layout
11571 \begin_inset Flex CharStyle:Code
11574 \begin_layout Plain Layout
11581 \begin_inset Flex CharStyle:Code
11584 \begin_layout Plain Layout
11591 \begin_inset Flex CharStyle:Code
11594 \begin_layout Plain Layout
11600 for top, bottom, page, and here, respectively.
11604 \begin_layout Plain Layout
11605 Note that the order of these letters in the string is irrelevant, like in
11611 On top of that there is a new type,
11612 \begin_inset Flex CharStyle:Code
11615 \begin_layout Plain Layout
11621 , which does not really correspond to a float, since it means: put it
11622 \begin_inset Quotes eld
11626 \begin_inset Quotes erd
11630 Note however that the
11631 \begin_inset Flex CharStyle:Code
11634 \begin_layout Plain Layout
11640 specifier is special and, because of implementation details, cannot be
11641 used in non-built in float types.
11642 If you do not understand what this means, just use
11643 \begin_inset Quotes eld
11647 \begin_inset Flex CharStyle:Code
11650 \begin_layout Plain Layout
11657 \begin_inset Quotes erd
11663 \begin_layout Description
11664 \begin_inset Flex CharStyle:Code
11667 \begin_layout Plain Layout
11674 \begin_inset Flex CharStyle:Code
11677 \begin_layout Plain Layout
11684 \begin_inset Quotes erd
11688 \begin_inset Quotes erd
11691 ] The style used when defining the float using
11692 \begin_inset Flex CharStyle:Code
11695 \begin_layout Plain Layout
11706 \begin_layout Description
11707 \begin_inset Flex CharStyle:Code
11710 \begin_layout Plain Layout
11717 \begin_inset Flex CharStyle:Code
11720 \begin_layout Plain Layout
11727 \begin_inset Quotes erd
11731 \begin_inset Quotes erd
11735 \begin_inset Quotes eld
11739 \begin_inset Quotes erd
11742 of the new class of floats, like program or algorithm.
11743 After the appropriate
11744 \begin_inset Flex CharStyle:Code
11747 \begin_layout Plain Layout
11756 \begin_inset Flex CharStyle:Code
11759 \begin_layout Plain Layout
11768 \begin_inset Flex CharStyle:Code
11771 \begin_layout Plain Layout
11782 \begin_layout Standard
11783 Note that defining a float with type
11784 \begin_inset Flex CharStyle:Code
11787 \begin_layout Plain Layout
11795 automatically defines the corresponding counter with name
11796 \begin_inset Flex CharStyle:Code
11799 \begin_layout Plain Layout
11810 \begin_layout Subsection
11811 Flex insets and InsetLayout
11812 \begin_inset CommandInset label
11814 name "sub:Flex-insets-and"
11821 \begin_layout Standard
11822 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11823 these are called Flex insets.
11827 \begin_layout Standard
11828 Flex insets come in three different kinds:
11831 \begin_layout Itemize
11833 \begin_inset Flex CharStyle:Code
11836 \begin_layout Plain Layout
11842 ): These define semantic markup corresponding to such LaTeX commands as
11844 \begin_inset Flex CharStyle:Code
11847 \begin_layout Plain Layout
11856 \begin_inset Flex CharStyle:Code
11859 \begin_layout Plain Layout
11870 \begin_layout Itemize
11872 \begin_inset Flex CharStyle:Code
11875 \begin_layout Plain Layout
11881 ): These can be used to define custom collapsible insets, similar to TeX
11882 code, footnote, and the like.
11883 An obvious example is an endnote inset, which is defined in the
11884 \begin_inset Flex CharStyle:Code
11887 \begin_layout Plain Layout
11896 \begin_layout Itemize
11898 \begin_inset Flex CharStyle:Code
11901 \begin_layout Plain Layout
11907 ): For use with DocBook classes.
11910 \begin_layout Standard
11911 Flex insets are defined using the
11912 \begin_inset Flex CharStyle:Code
11915 \begin_layout Plain Layout
11921 tag, which shall be explained in a moment.
11924 \begin_layout Standard
11926 \begin_inset Flex CharStyle:Code
11929 \begin_layout Plain Layout
11935 tag also serves another function: It can be used to customize the general
11936 layout of many different types of insets.
11938 \begin_inset Flex CharStyle:Code
11941 \begin_layout Plain Layout
11947 can be used to customize the layout parameters for footnotes, marginal
11948 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
11949 boxes, tables, algorithms, URLs, and optional arguments, as well as to
11950 define Flex insets.
11953 \begin_layout Standard
11955 \begin_inset Flex CharStyle:Code
11958 \begin_layout Plain Layout
11964 definition must begin with a line of the form:
11967 \begin_layout LyX-Code
11971 \begin_layout Standard
11973 \begin_inset Flex CharStyle:Code
11976 \begin_layout Plain Layout
11982 indicates the inset whose layout is being defined, and here there are two
11986 \begin_layout Enumerate
11987 The layout for a pre-existing inset is being modified.
11988 In this case, can be
11989 \begin_inset Flex CharStyle:Code
11992 \begin_layout Plain Layout
11998 any one of the following:
11999 \begin_inset Flex CharStyle:Code
12002 \begin_layout Plain Layout
12009 \begin_inset Flex CharStyle:Code
12012 \begin_layout Plain Layout
12019 \begin_inset Flex CharStyle:Code
12022 \begin_layout Plain Layout
12029 \begin_inset Flex CharStyle:Code
12032 \begin_layout Plain Layout
12039 \begin_inset Flex CharStyle:Code
12042 \begin_layout Plain Layout
12049 \begin_inset Flex CharStyle:Code
12052 \begin_layout Plain Layout
12059 \begin_inset Flex CharStyle:Code
12062 \begin_layout Plain Layout
12069 \begin_inset Flex CharStyle:Code
12072 \begin_layout Plain Layout
12079 \begin_inset Flex CharStyle:Code
12082 \begin_layout Plain Layout
12089 \begin_inset Flex CharStyle:Code
12092 \begin_layout Plain Layout
12099 \begin_inset Flex CharStyle:Code
12102 \begin_layout Plain Layout
12109 \begin_inset Flex CharStyle:Code
12112 \begin_layout Plain Layout
12119 \begin_inset Flex CharStyle:Code
12122 \begin_layout Plain Layout
12129 \begin_inset Flex CharStyle:Code
12132 \begin_layout Plain Layout
12139 \begin_inset Flex CharStyle:Code
12142 \begin_layout Plain Layout
12149 \begin_inset Flex CharStyle:Code
12152 \begin_layout Plain Layout
12159 \begin_inset Flex CharStyle:Code
12162 \begin_layout Plain Layout
12169 \begin_inset Flex CharStyle:Code
12172 \begin_layout Plain Layout
12179 \begin_inset Flex CharStyle:Code
12182 \begin_layout Plain Layout
12189 \begin_inset Flex CharStyle:Code
12192 \begin_layout Plain Layout
12202 \begin_layout Enumerate
12203 The layout for a Flex inset is being defined.
12205 \begin_inset Flex CharStyle:Code
12208 \begin_layout Plain Layout
12214 can be any valid identifier not used by a pre-existing inset.
12215 Note that the definition of a flex inset must
12220 \begin_inset Flex CharStyle:Code
12223 \begin_layout Plain Layout
12232 \begin_layout Standard
12234 \begin_inset Flex CharStyle:Code
12237 \begin_layout Plain Layout
12243 definition can contain the following entries:
12246 \begin_layout Description
12247 \begin_inset Flex CharStyle:Code
12250 \begin_layout Plain Layout
12256 The color for the inset's background.
12257 The valid colors are defined in
12258 \begin_inset Flex CharStyle:Code
12261 \begin_layout Plain Layout
12270 \begin_layout Description
12271 \begin_inset Flex CharStyle:Code
12274 \begin_layout Plain Layout
12280 As with paragraph styles (see page
12281 \begin_inset CommandInset ref
12283 reference "des:CopyStyle"
12290 \begin_layout Description
12291 \begin_inset Flex CharStyle:Code
12294 \begin_layout Plain Layout
12301 \begin_inset Flex CharStyle:Code
12304 \begin_layout Plain Layout
12313 \begin_inset Flex CharStyle:Code
12316 \begin_layout Plain Layout
12322 ] Indicates whether the user may employ the Paragraph Settings dialog to
12323 customize the paragraph.
12326 \begin_layout Description
12327 \begin_inset Flex CharStyle:Code
12330 \begin_layout Plain Layout
12337 \begin_inset Flex CharStyle:Code
12340 \begin_layout Plain Layout
12347 \begin_inset Flex CharStyle:Code
12350 \begin_layout Plain Layout
12357 \begin_inset Flex CharStyle:Code
12360 \begin_layout Plain Layout
12366 , describing the rendering style used for the inset's frame and buttons.
12367 Footnotes generally use
12368 \begin_inset Flex CharStyle:Code
12371 \begin_layout Plain Layout
12377 , ERT insets generally
12378 \begin_inset Flex CharStyle:Code
12381 \begin_layout Plain Layout
12387 , and character styles
12388 \begin_inset Flex CharStyle:Code
12391 \begin_layout Plain Layout
12400 \begin_layout Description
12401 \begin_inset Flex CharStyle:Code
12404 \begin_layout Plain Layout
12410 Required at the end of the InsetLayout declarations.
12413 \begin_layout Description
12414 \begin_inset Flex CharStyle:Code
12417 \begin_layout Plain Layout
12423 The font used for both the text body
12429 \begin_inset space ~
12433 \begin_inset CommandInset ref
12435 reference "sub:Font-description"
12440 Note that defining this font automatically defines the
12441 \begin_inset Flex CharStyle:Code
12444 \begin_layout Plain Layout
12450 to the same value, so define this first and define
12451 \begin_inset Flex CharStyle:Code
12454 \begin_layout Plain Layout
12460 later if you want them to be different.
12463 \begin_layout Description
12464 \begin_inset Flex CharStyle:Code
12467 \begin_layout Plain Layout
12474 \begin_inset Quotes eld
12478 \begin_inset Quotes erd
12481 language, leading to Left-to-Right (latin) output, e.
12482 \begin_inset space \thinspace{}
12486 \begin_inset space \space{}
12489 in TeX code or URL.
12493 \begin_layout Description
12494 \begin_inset Flex CharStyle:Code
12497 \begin_layout Plain Layout
12504 \begin_inset Flex CharStyle:Code
12507 \begin_layout Plain Layout
12516 \begin_inset Flex CharStyle:Code
12519 \begin_layout Plain Layout
12525 ] Indicates whether the PlainLayout should be used or, instead, the user
12526 can change the paragraph style used in the inset.
12529 \begin_layout Description
12530 \begin_inset Flex CharStyle:Code
12533 \begin_layout Plain Layout
12539 As with paragraph styles (see page
12540 \begin_inset CommandInset ref
12541 LatexCommand pageref
12542 reference "des:FreeSpacing"
12549 \begin_layout Description
12550 \begin_inset Flex CharStyle:Code
12553 \begin_layout Plain Layout
12560 \begin_inset Flex CharStyle:Code
12563 \begin_layout Plain Layout
12572 \begin_inset Flex CharStyle:Code
12575 \begin_layout Plain Layout
12581 ] Whether to include the contents of this inset in the strings generated
12582 for the `Outline' pane.
12583 One would not, for example, want the content of a footnote in a section
12584 header to be included in the TOC displayed in the outline, but one would
12585 normally want the content of a character style displayed.
12586 Default is false: not to include.
12589 \begin_layout Description
12590 \begin_inset Flex CharStyle:Code
12593 \begin_layout Plain Layout
12599 As with paragraph styles (see page
12600 \begin_inset CommandInset ref
12601 LatexCommand pageref
12602 reference "des:KeepEmpty"
12609 \begin_layout Description
12610 \begin_inset Flex CharStyle:Code
12613 \begin_layout Plain Layout
12619 The font used for the label.
12621 \begin_inset space ~
12625 \begin_inset CommandInset ref
12627 reference "sub:Font-description"
12632 Note that this definition can never appear before
12633 \begin_inset Flex CharStyle:Code
12636 \begin_layout Plain Layout
12642 , lest it be ineffective.
12645 \begin_layout Description
12646 \begin_inset Flex CharStyle:Code
12649 \begin_layout Plain Layout
12655 What will be displayed on the button or elsewhere as the inset label.
12656 Some inset types (TeX code and Branch) modify this label on the fly.
12659 \begin_layout Description
12660 \begin_inset Flex CharStyle:Code
12663 \begin_layout Plain Layout
12669 The name of the corresponding LaTeX stuff.
12670 Either the environment or command name.
12673 \begin_layout Description
12674 \begin_inset Flex CharStyle:Code
12677 \begin_layout Plain Layout
12683 The optional parameter for the corresponding
12684 \begin_inset Flex CharStyle:Code
12687 \begin_layout Plain Layout
12693 stuff, including possible bracket pairs like
12694 \begin_inset Flex CharStyle:Code
12697 \begin_layout Plain Layout
12704 This parameter cannot be changed from within LyX.
12707 \begin_layout Description
12708 \begin_inset Flex CharStyle:Code
12711 \begin_layout Plain Layout
12717 As with paragraph styles (see page
12718 \begin_inset CommandInset ref
12719 LatexCommand pageref
12720 reference "des:LatexType"
12727 \begin_layout Description
12728 \begin_inset Flex CharStyle:Code
12731 \begin_layout Plain Layout
12738 \begin_inset Flex CharStyle:Code
12741 \begin_layout Plain Layout
12748 \begin_inset Flex CharStyle:Code
12751 \begin_layout Plain Layout
12758 \begin_inset Flex CharStyle:Code
12761 \begin_layout Plain Layout
12768 \begin_inset Flex CharStyle:Code
12771 \begin_layout Plain Layout
12777 (indicating a dummy definition ending definitions of charstyles, etc).
12778 This entry is required in and is only meaningful for Flex insets.
12779 Among other things, it determines on which menu this inset will appear.
12782 \begin_layout Description
12783 \begin_inset Flex CharStyle:Code
12786 \begin_layout Plain Layout
12793 \begin_inset Flex CharStyle:Code
12796 \begin_layout Plain Layout
12805 \begin_inset Flex CharStyle:Code
12808 \begin_layout Plain Layout
12814 ] Whether multiple paragraphs are permitted in this inset.
12815 This will also set CustomPars to the same value and ForcePlain to the opposite
12817 These can be reset to other values, if they are used
12824 \begin_layout Description
12825 \begin_inset Flex CharStyle:Code
12828 \begin_layout Plain Layout
12835 \begin_inset Flex CharStyle:Code
12838 \begin_layout Plain Layout
12847 \begin_inset Flex CharStyle:Code
12850 \begin_layout Plain Layout
12856 ] Whether fragile commands in this layout should be
12857 \begin_inset Flex CharStyle:Code
12860 \begin_layout Plain Layout
12873 whether the command should itself be protected.)
12876 \begin_layout Description
12877 \begin_inset Flex CharStyle:Code
12880 \begin_layout Plain Layout
12887 \begin_inset Flex CharStyle:Code
12890 \begin_layout Plain Layout
12899 \begin_inset Flex CharStyle:Code
12902 \begin_layout Plain Layout
12908 ] As with paragraph styles (see page
12909 \begin_inset CommandInset ref
12911 reference "des:PathThru"
12918 \begin_layout Description
12919 \begin_inset Flex CharStyle:Code
12922 \begin_layout Plain Layout
12928 As with paragraph styles (see page
12929 \begin_inset CommandInset ref
12930 LatexCommand pageref
12931 reference "des:Preamble"
12938 \begin_layout Description
12939 \begin_inset Flex CharStyle:Code
12942 \begin_layout Plain Layout
12949 \begin_inset Flex CharStyle:Code
12952 \begin_layout Plain Layout
12958 ] As with paragraph styles (see page
12959 \begin_inset CommandInset ref
12960 LatexCommand pageref
12961 reference "des:Requires"
12968 \begin_layout Subsection
12970 \begin_inset CommandInset label
12972 name "sub:Counters"
12979 \begin_layout Standard
12980 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12982 \begin_inset Flex CharStyle:MenuItem
12985 \begin_layout Plain Layout
12992 \begin_inset Flex CharStyle:MenuItem
12995 \begin_layout Plain Layout
13001 , \SpecialChar \ldots{}
13002 ) in the text class itself.
13003 The standard counters are defined in the file
13004 \begin_inset Flex CharStyle:Code
13007 \begin_layout Plain Layout
13013 , so you may have to do no more than add
13016 \begin_layout LyX-Code
13017 Input stdcounters.inc
13020 \begin_layout Standard
13021 to your layout file to get them to work.
13022 But if you want to define custom counters, then you can do so.
13023 The counter declaration must begin with:
13026 \begin_layout LyX-Code
13030 \begin_layout Standard
13031 where of course `name' is replaced by the name of the counter.
13032 And it must end with
13033 \begin_inset Quotes eld
13037 \begin_inset Flex CharStyle:Code
13040 \begin_layout Plain Layout
13047 \begin_inset Quotes erd
13051 The following parameters can also be used:
13054 \begin_layout Description
13055 \begin_inset Flex CharStyle:Code
13058 \begin_layout Plain Layout
13059 LabelString [string=""]
13064 when this is defined, this string defines how the counter is displayed.
13065 Setting this value sets
13066 \begin_inset Flex CharStyle:Code
13069 \begin_layout Plain Layout
13070 LabelStringAppendix
13076 The following special constructs can be used in the string:
13080 \begin_layout Itemize
13081 \begin_inset Flex CharStyle:Code
13084 \begin_layout Plain Layout
13092 will be replaced by the expansion of the
13093 \begin_inset Flex CharStyle:Code
13096 \begin_layout Plain Layout
13103 \begin_inset Flex CharStyle:Code
13106 \begin_layout Plain Layout
13107 LabelStringAppendix
13113 \begin_inset Flex CharStyle:Code
13116 \begin_layout Plain Layout
13126 \begin_layout Itemize
13127 counter values can be expressed using LaTeX-like macros
13128 \begin_inset Flex CharStyle:Code
13131 \begin_layout Plain Layout
13148 \begin_inset Flex CharStyle:Code
13151 \begin_layout Plain Layout
13163 \begin_layout Plain Layout
13173 Actually, the situation is a bit more complicated: any
13192 other than those described below will produce arabic numerals.
13193 It would not be surprising to see this change in the future.
13199 \begin_inset Flex CharStyle:Code
13202 \begin_layout Plain Layout
13208 : 1, 2, 3,\SpecialChar \ldots{}
13210 \begin_inset Flex CharStyle:Code
13213 \begin_layout Plain Layout
13219 for lower-case letters: a, b, c, \SpecialChar \ldots{}
13221 \begin_inset Flex CharStyle:Code
13224 \begin_layout Plain Layout
13230 for upper-case letters: A, B, C, \SpecialChar \ldots{}
13232 \begin_inset Flex CharStyle:Code
13235 \begin_layout Plain Layout
13241 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13243 \begin_inset Flex CharStyle:Code
13246 \begin_layout Plain Layout
13252 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13254 \begin_inset Flex CharStyle:Code
13257 \begin_layout Plain Layout
13263 for hebrew numerals.
13267 \begin_layout Standard
13268 If LabelString is not defined, a default value is constructed as follows:
13269 if the counter has a master counter
13270 \begin_inset Flex CharStyle:Code
13273 \begin_layout Plain Layout
13280 \begin_inset Flex CharStyle:Code
13283 \begin_layout Plain Layout
13290 \begin_inset Flex CharStyle:Code
13293 \begin_layout Plain Layout
13303 is used; otherwise the string
13304 \begin_inset Flex CharStyle:Code
13307 \begin_layout Plain Layout
13318 \begin_layout Description
13319 \begin_inset Flex CharStyle:Code
13322 \begin_layout Plain Layout
13323 LabelStringAppendix [string=""]
13329 \begin_inset Flex CharStyle:Code
13332 \begin_layout Plain Layout
13338 , but for use in the Appendix.
13341 \begin_layout Description
13342 \begin_inset Flex CharStyle:Code
13345 \begin_layout Plain Layout
13352 \begin_inset Flex CharStyle:Code
13355 \begin_layout Plain Layout
13362 \begin_inset Quotes erd
13366 \begin_inset Quotes erd
13369 ] If this is set to the name of another counter, the present counter will
13370 be reset every time the other one is increased.
13372 \begin_inset Flex CharStyle:Code
13375 \begin_layout Plain Layout
13382 \begin_inset Flex CharStyle:Code
13385 \begin_layout Plain Layout
13394 \begin_layout Subsection
13396 \begin_inset CommandInset label
13398 name "sub:Font-description"
13405 \begin_layout Standard
13406 A font description looks like this:
13409 \begin_layout LyX-Code
13419 \begin_layout LyX-Code
13423 \begin_layout LyX-Code
13427 \begin_layout Standard
13428 The following commands are available:
13431 \begin_layout Description
13432 \begin_inset Flex CharStyle:Code
13435 \begin_layout Plain Layout
13442 \begin_inset Flex CharStyle:Code
13445 \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
13484 \begin_inset Flex CharStyle:Code
13487 \begin_layout Plain Layout
13494 \begin_inset Flex CharStyle:Code
13497 \begin_layout Plain Layout
13504 \begin_inset Flex CharStyle:Code
13507 \begin_layout Plain Layout
13514 \begin_inset Flex CharStyle:Code
13517 \begin_layout Plain Layout
13524 \begin_inset Flex CharStyle:Code
13527 \begin_layout Plain Layout
13536 \begin_layout Description
13537 \begin_inset Flex CharStyle:Code
13540 \begin_layout Plain Layout
13549 \begin_inset Flex CharStyle:Code
13552 \begin_layout Plain Layout
13563 \begin_inset Flex CharStyle:Code
13566 \begin_layout Plain Layout
13573 \begin_inset Flex CharStyle:Code
13576 \begin_layout Plain Layout
13585 \begin_layout Description
13586 \begin_inset Flex CharStyle:Code
13589 \begin_layout Plain Layout
13596 \begin_inset Flex CharStyle:Code
13599 \begin_layout Plain Layout
13605 ] Valid argument are:
13606 \begin_inset Flex CharStyle:Code
13609 \begin_layout Plain Layout
13616 \begin_inset Flex CharStyle:Code
13619 \begin_layout Plain Layout
13626 \begin_inset Flex CharStyle:Code
13629 \begin_layout Plain Layout
13636 \begin_inset Flex CharStyle:Code
13639 \begin_layout Plain Layout
13646 \begin_inset Flex CharStyle:Code
13649 \begin_layout Plain Layout
13656 \begin_inset Flex CharStyle:Code
13659 \begin_layout Plain Layout
13666 Each of these turns on or off the corresponding attribute.
13669 \begin_layout Description
13670 \begin_inset Flex CharStyle:Code
13673 \begin_layout Plain Layout
13682 \begin_inset Flex CharStyle:Code
13685 \begin_layout Plain Layout
13696 \begin_inset Flex CharStyle:Code
13699 \begin_layout Plain Layout
13708 \begin_layout Description
13709 \begin_inset Flex CharStyle:Code
13712 \begin_layout Plain Layout
13721 \begin_inset Flex CharStyle:Code
13724 \begin_layout Plain Layout
13735 \begin_inset Flex CharStyle:Code
13738 \begin_layout Plain Layout
13745 \begin_inset Flex CharStyle:Code
13748 \begin_layout Plain Layout
13755 \begin_inset Flex CharStyle:Code
13758 \begin_layout Plain Layout
13767 \begin_layout Description
13768 \begin_inset Flex CharStyle:Code
13771 \begin_layout Plain Layout
13778 \begin_inset Flex CharStyle:Code
13781 \begin_layout Plain Layout
13788 \begin_inset Flex CharStyle:Code
13791 \begin_layout Plain Layout
13798 \begin_inset Flex CharStyle:Code
13801 \begin_layout Plain Layout
13810 \begin_inset Flex CharStyle:Code
13813 \begin_layout Plain Layout
13820 \begin_inset Flex CharStyle:Code
13823 \begin_layout Plain Layout
13830 \begin_inset Flex CharStyle:Code
13833 \begin_layout Plain Layout
13840 \begin_inset Flex CharStyle:Code
13843 \begin_layout Plain Layout
13850 \begin_inset Flex CharStyle:Code
13853 \begin_layout Plain Layout
13862 \begin_layout Subsection
13863 Upgrading old layout files
13866 \begin_layout Standard
13867 The file format of layout files changes from time to time, so old layout
13868 files need to be converted.
13869 This process has been automated since LyX 1.4.0: If LyX reads an old format
13870 layout file it will call the conversion tool
13871 \begin_inset Flex CharStyle:Code
13874 \begin_layout Plain Layout
13875 LyXDir/scripts/layout2layout.py
13880 and convert it to a temporary file in current format.
13881 The original file is left untouched.
13882 If you want to convert the layout file permanently, just call the converter
13886 \begin_layout LyX-Code
13887 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13890 \begin_layout Standard
13891 (You need to replace
13892 \begin_inset Flex CharStyle:Code
13895 \begin_layout Plain Layout
13901 with the name of your LyX system directory, unless you happen to have defined
13902 such an environment variable.) Then copy
13903 \begin_inset Flex CharStyle:Code
13906 \begin_layout Plain Layout
13913 \begin_inset Flex CharStyle:Code
13916 \begin_layout Plain Layout
13925 \begin_layout Standard
13926 The automatic conversion only handles syntax changes.
13927 It cannot handle the case where the contents of included files was changed,
13928 so these will have to be converted separately.
13931 \begin_layout Section
13933 \begin_inset CommandInset label
13935 name "sec:Creating-Templates"
13942 \begin_layout Standard
13943 Templates are created just like usual documents.
13944 The only difference is that usual documents contain all possible settings,
13945 including the font scheme and the paper size.
13946 Usually a user doesn't want a template to overwrite his defaults in these
13948 For that reason, the designer of a template should remove the corresponding
13950 \begin_inset Flex CharStyle:Code
13953 \begin_layout Plain Layout
13962 \begin_inset Flex CharStyle:Code
13965 \begin_layout Plain Layout
13973 from the template LyX file.
13974 This can be done with any simple text-editor, for example
13975 \begin_inset Flex CharStyle:Code
13978 \begin_layout Plain Layout
13985 \begin_inset Flex CharStyle:Code
13988 \begin_layout Plain Layout
13998 \begin_layout Standard
13999 Put the edited template files you create in
14000 \begin_inset Flex CharStyle:Code
14003 \begin_layout Plain Layout
14009 , copy the ones you use from the global template directory in
14010 \begin_inset Flex CharStyle:Code
14013 \begin_layout Plain Layout
14019 to the same place, and redefine the template path in the
14020 \begin_inset Flex CharStyle:MenuItem
14023 \begin_layout Plain Layout
14024 Tools\SpecialChar \menuseparator
14025 Preferences\SpecialChar \menuseparator
14034 \begin_layout Standard
14035 Note that there is a template which has a particular meaning:
14036 \begin_inset Flex CharStyle:Code
14039 \begin_layout Plain Layout
14046 This template is loaded every time you create a new document with
14047 \begin_inset Flex CharStyle:MenuItem
14050 \begin_layout Plain Layout
14051 File\SpecialChar \menuseparator
14057 in order to provide useful defaults.
14058 To create this template from inside LyX, all you have to do is to open
14059 a document with the correct settings, and use the
14060 \begin_inset Flex CharStyle:MenuItem
14063 \begin_layout Plain Layout
14064 Save as Document Defaults
14072 \begin_layout Chapter
14073 Including External Material
14076 \begin_layout Standard
14077 \begin_inset Box Shadowbox
14086 height_special "totalheight"
14089 \begin_layout Plain Layout
14090 WARNING: This portion of the documentation has not been updated for some
14092 We certainly hope that it is still accurate, but there are no guarantees.
14100 \begin_layout Standard
14101 The use of material from sources external to LyX is covered in detail in
14107 This part of the manual covers what needs to happen behind the scenes for
14108 new sorts of material to be included.
14111 \begin_layout Section
14115 \begin_layout Standard
14116 The external material feature is based on the concept of a
14121 A template is a specification of how LyX should interface with a certain
14123 As bundled, LyX comes with predefined templates for Xfig figures, various
14124 raster format images, chess diagrams, and LilyPond music notation.
14125 You can check the actual list by using the menu
14126 \begin_inset Flex CharStyle:MenuItem
14129 \begin_layout Plain Layout
14130 Insert\SpecialChar \menuseparator
14131 File\SpecialChar \menuseparator
14138 Furthermore, it is possible to roll your own template to support a specific
14140 Later we'll describe in more detail what is involved, and hopefully you
14141 will submit all the templates you create so we can include them in a later
14145 \begin_layout Standard
14146 Another basic idea of the external material feature is to distinguish between
14147 the original file that serves as a base for final material and the produced
14148 file that is included in your exported or printed document.
14149 For example, consider the case of a figure produced with
14150 \begin_inset Flex CharStyle:Code
14153 \begin_layout Plain Layout
14160 The Xfig application itself works on an original file with the
14161 \begin_inset Flex CharStyle:Code
14164 \begin_layout Plain Layout
14171 Within Xfig, you create and change your figure, and when you are done,
14173 \begin_inset Flex CharStyle:Code
14176 \begin_layout Plain Layout
14183 When you want to include the figure in your document, you invoke
14184 \begin_inset Flex CharStyle:Code
14187 \begin_layout Plain Layout
14193 in order to create a PostScript file that can readily be included in your
14196 \begin_inset Flex CharStyle:Code
14199 \begin_layout Plain Layout
14205 file is the original file, and the PostScript file is the produced file.
14208 \begin_layout Standard
14209 This distinction is important in order to allow updating of the material
14210 while you are in the process of writing the document.
14211 Furthermore, it provides us with the flexibility that is needed to support
14212 multiple export formats.
14213 For instance, in the case of a plain text file, it is not exactly an award-winn
14214 ing idea to include the figure as raw PostScript.
14215 Instead, you'd either prefer to just include a reference to the figure
14216 or try to invoke some graphics to ASCII converter to make the final result
14217 look similar to the real graphics.
14218 The external material management allows you to do this, because it is parametri
14219 zed on the different export formats that LyX supports.
14222 \begin_layout Standard
14223 Besides supporting the production of different products according to the
14224 exported format, it supports tight integration with editing and viewing
14226 In the case of an Xfig figure, you are able to invoke Xfig on the original
14227 file with a single click from within the external material dialog in LyX,
14228 and also preview the produced PostScript file with Ghostview with another
14230 No more fiddling around with the command line and/or file browsers to locate
14231 and manipulate the original or produced files.
14232 In this way, you are finally able to take full advantage of the many different
14233 applications that are relevant to use when you write your documents, and
14234 ultimately be more productive.
14237 \begin_layout Section
14238 The external template configuration file
14241 \begin_layout Standard
14242 It is relatively easy to add custom external template definitions to LyX.
14243 However, be aware that doing this in an careless manner most probably
14247 introduce an easily exploitable security hole.
14248 So before you do this, please read the discussion about security in section
14250 \begin_inset CommandInset ref
14252 reference "sec:Security-discussion"
14259 \begin_layout Standard
14260 Having said that, we encourage you to submit any interesting templates that
14265 \begin_layout Standard
14266 The external templates are defined in the
14267 \begin_inset Flex CharStyle:Code
14270 \begin_layout Plain Layout
14271 LyXDir/lib/external_templates
14277 You can place your own version in
14278 \begin_inset Flex CharStyle:Code
14281 \begin_layout Plain Layout
14282 UserDir/external_templates
14290 \begin_layout Standard
14291 A typical template looks like this:
14294 \begin_layout LyX-Code
14298 \begin_layout LyX-Code
14299 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14302 \begin_layout LyX-Code
14306 \begin_layout LyX-Code
14310 \begin_layout LyX-Code
14314 \begin_layout LyX-Code
14318 \begin_layout LyX-Code
14322 \begin_layout LyX-Code
14323 AutomaticProduction true
14326 \begin_layout LyX-Code
14330 \begin_layout LyX-Code
14334 \begin_layout LyX-Code
14338 \begin_layout LyX-Code
14339 TransformCommand Rotate RotationLatexCommand
14342 \begin_layout LyX-Code
14343 TransformCommand Resize ResizeLatexCommand
14346 \begin_layout LyX-Code
14347 Product "$$RotateFront$$ResizeFront
14350 \begin_layout LyX-Code
14355 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14358 \begin_layout LyX-Code
14359 $$ResizeBack$$RotateBack"
14362 \begin_layout LyX-Code
14366 \begin_layout LyX-Code
14367 UpdateResult "$$AbsPath$$Basename.pstex_t"
14370 \begin_layout LyX-Code
14371 Requirement "graphicx"
14374 \begin_layout LyX-Code
14375 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14378 \begin_layout LyX-Code
14379 ReferencedFile latex "$$AbsPath$$Basename.eps"
14382 \begin_layout LyX-Code
14383 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14386 \begin_layout LyX-Code
14390 \begin_layout LyX-Code
14394 \begin_layout LyX-Code
14395 TransformCommand Rotate RotationLatexCommand
14398 \begin_layout LyX-Code
14399 TransformCommand Resize ResizeLatexCommand
14402 \begin_layout LyX-Code
14403 Product "$$RotateFront$$ResizeFront
14406 \begin_layout LyX-Code
14411 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14414 \begin_layout LyX-Code
14415 $$ResizeBack$$RotateBack"
14418 \begin_layout LyX-Code
14419 UpdateFormat pdftex
14422 \begin_layout LyX-Code
14423 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14426 \begin_layout LyX-Code
14427 Requirement "graphicx"
14430 \begin_layout LyX-Code
14431 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14434 \begin_layout LyX-Code
14435 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14438 \begin_layout LyX-Code
14442 \begin_layout LyX-Code
14446 \begin_layout LyX-Code
14447 Product "$$Contents(
14449 "$$AbsPath$$Basename.asc
14454 \begin_layout LyX-Code
14455 UpdateFormat asciixfig
14458 \begin_layout LyX-Code
14459 UpdateResult "$$AbsPath$$Basename.asc"
14462 \begin_layout LyX-Code
14466 \begin_layout LyX-Code
14470 \begin_layout LyX-Code
14471 Product "<graphic fileref=
14473 "$$AbsOrRelPathMaster$$Basename.eps
14478 \begin_layout LyX-Code
14482 \begin_layout LyX-Code
14486 \begin_layout LyX-Code
14487 UpdateResult "$$AbsPath$$Basename.eps"
14490 \begin_layout LyX-Code
14491 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14494 \begin_layout LyX-Code
14495 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14498 \begin_layout LyX-Code
14502 \begin_layout LyX-Code
14503 Product "[XFig: $$FName]"
14506 \begin_layout LyX-Code
14510 \begin_layout LyX-Code
14514 \begin_layout Standard
14515 As you can see, the template is enclosed in
14516 \begin_inset Flex CharStyle:Code
14519 \begin_layout Plain Layout
14525 \SpecialChar \ldots{}
14527 \begin_inset Flex CharStyle:Code
14530 \begin_layout Plain Layout
14537 It contains a header specifying some general settings and, for each supported
14538 primary document file format, a section
14539 \begin_inset Flex CharStyle:Code
14542 \begin_layout Plain Layout
14548 \SpecialChar \ldots{}
14550 \begin_inset Flex CharStyle:Code
14553 \begin_layout Plain Layout
14562 \begin_layout Subsection
14563 The template header
14566 \begin_layout Description
14567 \begin_inset Flex CharStyle:Code
14570 \begin_layout Plain Layout
14571 AutomaticProduction
14572 \begin_inset space ~
14580 Whether the file represented by the template must be generated by LyX.
14581 This command must occur exactly once.
14584 \begin_layout Description
14585 \begin_inset Flex CharStyle:Code
14588 \begin_layout Plain Layout
14590 \begin_inset space ~
14598 A glob pattern that is used in the file dialog to filter out the desired
14600 If there is more than one possible file extension (e.
14601 \begin_inset space \thinspace{}
14605 \begin_inset space \space{}
14609 \begin_inset Flex CharStyle:Code
14612 \begin_layout Plain Layout
14619 \begin_inset Flex CharStyle:Code
14622 \begin_layout Plain Layout
14628 ), use something like
14629 \begin_inset Flex CharStyle:Code
14632 \begin_layout Plain Layout
14639 This command must occur exactly once.
14642 \begin_layout Description
14643 \begin_inset Flex CharStyle:Code
14646 \begin_layout Plain Layout
14648 \begin_inset space ~
14656 The text that is displayed on the button.
14657 This command must occur exactly once.
14660 \begin_layout Description
14661 \begin_inset Flex CharStyle:Code
14664 \begin_layout Plain Layout
14666 \begin_inset space ~
14670 \begin_inset space ~
14678 The help text that is used in the External dialog.
14679 Provide enough information to explain to the user just what the template
14680 can provide him with.
14681 This command must occur exactly once.
14684 \begin_layout Description
14685 \begin_inset Flex CharStyle:Code
14688 \begin_layout Plain Layout
14690 \begin_inset space ~
14698 The file format of the original file.
14699 This must be the name of a format that is known to LyX (see section
14700 \begin_inset CommandInset ref
14702 reference "sec:Formats"
14708 \begin_inset Quotes eld
14712 \begin_inset Flex CharStyle:Code
14715 \begin_layout Plain Layout
14722 \begin_inset Quotes erd
14725 if the template can handle original files of more than one format.
14726 LyX will attempt to interrogate the file itself in order to deduce its
14727 format in this case.
14728 This command must occur exactly once.
14731 \begin_layout Description
14732 \begin_inset Flex CharStyle:Code
14735 \begin_layout Plain Layout
14737 \begin_inset space ~
14745 A unique name for the template.
14746 It must not contain substitution macros (see below).
14749 \begin_layout Description
14750 \begin_inset Flex CharStyle:Code
14753 \begin_layout Plain Layout
14755 \begin_inset space ~
14758 Rotate|Resize|Clip|Extra
14763 This command specifies which transformations are supported by this template.
14764 It may occur zero or more times.
14765 This command enables the corresponding tabs in the external dialog.
14767 \begin_inset Flex CharStyle:Code
14770 \begin_layout Plain Layout
14776 command must have either a corresponding
14777 \begin_inset Flex CharStyle:Code
14780 \begin_layout Plain Layout
14787 \begin_inset Flex CharStyle:Code
14790 \begin_layout Plain Layout
14797 \begin_inset Flex CharStyle:Code
14800 \begin_layout Plain Layout
14807 Otherwise the transformation will not be supported by that format.
14810 \begin_layout Subsection
14814 \begin_layout Description
14815 \begin_inset Flex CharStyle:Code
14818 \begin_layout Plain Layout
14820 \begin_inset space ~
14823 LaTeX|PDFLaTeX|PlainText|DocBook
14828 The primary document file format that this format definition is for.
14829 Not every template has a sensible representation in all document file formats.
14830 Please define nevertheless a
14831 \begin_inset Flex CharStyle:Code
14834 \begin_layout Plain Layout
14840 section for all formats.
14841 Use a dummy text when no representation is available.
14842 Then you can at least see a reference to the external material in the exported
14846 \begin_layout Description
14847 \begin_inset Flex CharStyle:Code
14850 \begin_layout Plain Layout
14852 \begin_inset space ~
14856 \begin_inset space ~
14864 This command defines an additional macro
14865 \begin_inset Flex CharStyle:Code
14868 \begin_layout Plain Layout
14874 for substitution in
14875 \begin_inset Flex CharStyle:Code
14878 \begin_layout Plain Layout
14886 \begin_inset Flex CharStyle:Code
14889 \begin_layout Plain Layout
14895 itself may contain substitution macros.
14896 The advantage over using
14897 \begin_inset Flex CharStyle:Code
14900 \begin_layout Plain Layout
14907 \begin_inset Flex CharStyle:Code
14910 \begin_layout Plain Layout
14916 is that the substituted value of
14917 \begin_inset Flex CharStyle:Code
14920 \begin_layout Plain Layout
14926 is sanitized so that it is a valid optional argument in the document format.
14927 This command may occur zero or more times.
14930 \begin_layout Description
14931 \begin_inset Flex CharStyle:Code
14934 \begin_layout Plain Layout
14936 \begin_inset space ~
14944 The text that is inserted in the exported document.
14945 This is actually the most important command and can be quite complex.
14946 This command must occur exactly once.
14949 \begin_layout Description
14950 \begin_inset Flex CharStyle:Code
14953 \begin_layout Plain Layout
14955 \begin_inset space ~
14963 This command specifies a preamble snippet that will be included in the
14965 It has to be defined using
14966 \begin_inset Flex CharStyle:Code
14969 \begin_layout Plain Layout
14975 \SpecialChar \ldots{}
14977 \begin_inset Flex CharStyle:Code
14980 \begin_layout Plain Layout
14987 This command may occur zero or more times.
14990 \begin_layout Description
14991 \begin_inset Flex CharStyle:Code
14994 \begin_layout Plain Layout
14996 \begin_inset space ~
15000 \begin_inset space ~
15008 This command denotes files that are created by the conversion process and
15009 are needed for a particular export format.
15010 If the filename is relative, it is interpreted relative to the master document.
15011 This command may be given zero or more times.
15014 \begin_layout Description
15015 \begin_inset Flex CharStyle:Code
15018 \begin_layout Plain Layout
15020 \begin_inset space ~
15028 The name of a required LaTeX package.
15029 The package is included via
15030 \begin_inset Flex CharStyle:Code
15033 \begin_layout Plain Layout
15041 in the LaTeX preamble.
15042 This command may occur zero or more times.
15045 \begin_layout Description
15046 \begin_inset Flex CharStyle:Code
15049 \begin_layout Plain Layout
15051 \begin_inset space ~
15055 \begin_inset space ~
15058 RotationLatexCommand
15063 This command specifies that the built in LaTeX command should be used for
15065 This command may occur once or not at all.
15068 \begin_layout Description
15069 \begin_inset Flex CharStyle:Code
15072 \begin_layout Plain Layout
15074 \begin_inset space ~
15078 \begin_inset space ~
15086 This command specifies that the built in LaTeX command should be used for
15088 This command may occur once or not at all.
15091 \begin_layout Description
15092 \begin_inset Flex CharStyle:Code
15095 \begin_layout Plain Layout
15097 \begin_inset space ~
15101 \begin_inset space ~
15104 RotationLatexOption
15109 This command specifies that rotation is done via an optional argument.
15110 This command may occur once or not at all.
15113 \begin_layout Description
15114 \begin_inset Flex CharStyle:Code
15117 \begin_layout Plain Layout
15119 \begin_inset space ~
15123 \begin_inset space ~
15131 This command specifies that resizing is done via an optional argument.
15132 This command may occur once or not at all.
15135 \begin_layout Description
15136 \begin_inset Flex CharStyle:Code
15139 \begin_layout Plain Layout
15141 \begin_inset space ~
15145 \begin_inset space ~
15153 This command specifies that clipping is done via an optional argument.
15154 This command may occur once or not at all.
15157 \begin_layout Description
15158 \begin_inset Flex CharStyle:Code
15161 \begin_layout Plain Layout
15163 \begin_inset space ~
15167 \begin_inset space ~
15175 This command specifies that an extra optional argument is used.
15176 This command may occur once or not at all.
15179 \begin_layout Description
15180 \begin_inset Flex CharStyle:Code
15183 \begin_layout Plain Layout
15185 \begin_inset space ~
15193 The file format of the converted file.
15194 This must be the name of a format that is known to LyX (see the
15195 \begin_inset Flex CharStyle:MenuItem
15198 \begin_layout Plain Layout
15203 ools\SpecialChar \menuseparator
15208 references:Conversion
15214 This command must occur exactly once.
15217 \begin_layout Description
15218 \begin_inset Flex CharStyle:Code
15221 \begin_layout Plain Layout
15223 \begin_inset space ~
15231 The file name of the converted file.
15232 The file name must be absolute.
15233 This command must occur exactly once.
15236 \begin_layout Subsection
15237 Preamble definitions
15240 \begin_layout Standard
15241 The external template configuration file may contain additional preamble
15242 definitions enclosed by
15243 \begin_inset Flex CharStyle:Code
15246 \begin_layout Plain Layout
15252 \SpecialChar \ldots{}
15254 \begin_inset Flex CharStyle:Code
15257 \begin_layout Plain Layout
15264 They can be used by the templates in the
15265 \begin_inset Flex CharStyle:Code
15268 \begin_layout Plain Layout
15277 \begin_layout Section
15278 The substitution mechanism
15281 \begin_layout Standard
15282 When the external material facility invokes an external program, it is done
15283 on the basis of a command defined in the template configuration file.
15284 These commands can contain various macros that are expanded before execution.
15285 Execution always take place in the directory of the containing document.
15288 \begin_layout Standard
15289 Also, whenever external material is to be displayed, the name will be produced
15290 by the substitution mechanism, and most other commands in the template
15291 definition support substitution as well.
15294 \begin_layout Standard
15295 The available macros are the following:
15298 \begin_layout Description
15299 \begin_inset Flex CharStyle:Code
15302 \begin_layout Plain Layout
15303 $$AbsOrRelPathMaster
15308 The file path, absolute or relative to the master LyX document.
15311 \begin_layout Description
15312 \begin_inset Flex CharStyle:Code
15315 \begin_layout Plain Layout
15316 $$AbsOrRelPathParent
15321 The file path, absolute or relative to the LyX document.
15324 \begin_layout Description
15325 \begin_inset Flex CharStyle:Code
15328 \begin_layout Plain Layout
15334 The absolute file path.
15337 \begin_layout Description
15338 \begin_inset Flex CharStyle:Code
15341 \begin_layout Plain Layout
15347 The filename without path and without the extension.
15350 \begin_layout Description
15351 \begin_inset Flex CharStyle:Code
15354 \begin_layout Plain Layout
15356 \begin_inset Quotes eld
15360 \begin_inset Quotes erd
15368 This macro will expand to the contents of the file with the name
15369 \begin_inset Flex CharStyle:Code
15372 \begin_layout Plain Layout
15381 \begin_layout Description
15382 \begin_inset Flex CharStyle:Code
15385 \begin_layout Plain Layout
15391 The file extension (including the dot).
15394 \begin_layout Description
15395 \begin_inset Flex CharStyle:Code
15398 \begin_layout Plain Layout
15404 The filename of the file specified in the external material dialog.
15405 This is either an absolute name, or it is relative to the LyX document.
15408 \begin_layout Description
15409 \begin_inset Flex CharStyle:Code
15412 \begin_layout Plain Layout
15419 \begin_inset Flex CharStyle:Code
15422 \begin_layout Plain Layout
15428 (absolute name or relative to the LyX document).
15431 \begin_layout Description
15432 \begin_inset Flex CharStyle:Code
15435 \begin_layout Plain Layout
15441 The file path, relative to the master LyX document.
15444 \begin_layout Description
15445 \begin_inset Flex CharStyle:Code
15448 \begin_layout Plain Layout
15454 The file path, relative to the LyX document.
15457 \begin_layout Description
15458 \begin_inset Flex CharStyle:Code
15461 \begin_layout Plain Layout
15467 This macro will expand to the absolute path of the system directory.
15468 This is typically used to point to the various helper scripts that are
15472 \begin_layout Description
15473 \begin_inset Flex CharStyle:Code
15476 \begin_layout Plain Layout
15482 A name and full path to a temporary file which will be automatically deleted
15483 whenever the containing document is closed, or the external material insertion
15487 \begin_layout Standard
15488 All path macros contain a trailing directory separator, so you can construct
15490 \begin_inset space \thinspace{}
15494 \begin_inset space \space{}
15497 the absolute filename with
15498 \begin_inset Flex CharStyle:Code
15501 \begin_layout Plain Layout
15502 $$AbsPath$$Basename$$Extension
15510 \begin_layout Standard
15511 The macros above are substituted in all commands unless otherwise noted.
15513 \begin_inset Flex CharStyle:Code
15516 \begin_layout Plain Layout
15522 supports additionally the following substitutions if they are enabled by
15524 \begin_inset Flex CharStyle:Code
15527 \begin_layout Plain Layout
15534 \begin_inset Flex CharStyle:Code
15537 \begin_layout Plain Layout
15546 \begin_layout Description
15547 \begin_inset Flex CharStyle:Code
15550 \begin_layout Plain Layout
15556 The front part of the resize command.
15559 \begin_layout Description
15560 \begin_inset Flex CharStyle:Code
15563 \begin_layout Plain Layout
15569 The back part of the resize command.
15572 \begin_layout Description
15573 \begin_inset Flex CharStyle:Code
15576 \begin_layout Plain Layout
15582 The front part of the rotation command.
15585 \begin_layout Description
15586 \begin_inset Flex CharStyle:Code
15589 \begin_layout Plain Layout
15595 The back part of the rotation command.
15598 \begin_layout Standard
15599 The value string of the
15600 \begin_inset Flex CharStyle:Code
15603 \begin_layout Plain Layout
15609 command supports additionally the following substitutions if they are enabled
15611 \begin_inset Flex CharStyle:Code
15614 \begin_layout Plain Layout
15621 \begin_inset Flex CharStyle:Code
15624 \begin_layout Plain Layout
15633 \begin_layout Description
15634 \begin_inset Flex CharStyle:Code
15637 \begin_layout Plain Layout
15646 \begin_layout Description
15647 \begin_inset Flex CharStyle:Code
15650 \begin_layout Plain Layout
15659 \begin_layout Description
15660 \begin_inset Flex CharStyle:Code
15663 \begin_layout Plain Layout
15672 \begin_layout Description
15673 \begin_inset Flex CharStyle:Code
15676 \begin_layout Plain Layout
15682 The rotation option.
15685 \begin_layout Standard
15686 You may ask why there are so many path macros.
15687 There are mainly two reasons:
15690 \begin_layout Enumerate
15691 Relative and absolute file names should remain relative or absolute, respectivel
15693 Users may have reasons to prefer either form.
15694 Relative names are useful for portable documents that should work on different
15695 machines, for example.
15696 Absolute names may be required by some programs.
15699 \begin_layout Enumerate
15700 LaTeX treats relative file names differently than LyX and other programs
15701 in nested included files.
15702 For LyX, a relative file name is always relative to the document that contains
15704 For LaTeX, it is always relative to the master document.
15705 These two definitions are identical if you have only one document, but
15706 differ if you have a master document that includes part documents.
15707 That means that relative filenames must be transformed when presented to
15709 Fortunately LyX does this automatically for you if you choose the right
15713 \begin_layout Standard
15714 So which path macro should be used in new template definitions? The rule
15718 \begin_layout Itemize
15720 \begin_inset Flex CharStyle:Code
15723 \begin_layout Plain Layout
15729 if an absolute path is required.
15732 \begin_layout Itemize
15734 \begin_inset Flex CharStyle:Code
15737 \begin_layout Plain Layout
15738 $$AbsOrRelPathMaster
15743 if the substituted string is some kind of LaTeX input.
15746 \begin_layout Itemize
15748 \begin_inset Flex CharStyle:Code
15751 \begin_layout Plain Layout
15752 $$AbsOrRelPathParent
15757 in order to preserve the user's choice.
15760 \begin_layout Standard
15761 There are special cases where this rule does not work and e.
15762 \begin_inset space \thinspace{}
15766 \begin_inset space \space{}
15769 relative names are needed, but normally it will work just fine.
15770 One example for such a case is the command
15771 \begin_inset Flex CharStyle:Code
15774 \begin_layout Plain Layout
15775 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15780 in the XFig template above: We can't use the absolute name because the
15782 \begin_inset Flex CharStyle:Code
15785 \begin_layout Plain Layout
15791 files needs the relative name in order to rewrite the file content.
15794 \begin_layout Section
15795 Security discussion
15796 \begin_inset CommandInset label
15798 name "sec:Security-discussion"
15805 \begin_layout Standard
15806 The external material feature interfaces with a lot of external programs
15807 and does so automatically, so we have to consider the security implications
15809 In particular, since you have the option of including your own filenames
15810 and/or parameter strings and those are expanded into a command, it seems
15811 that it would be possible to create a malicious document which executes
15812 arbitrary commands when a user views or prints the document.
15813 This is something we definitely want to avoid.
15816 \begin_layout Standard
15817 However, since the external program commands are specified in the template
15818 configuration file only, there are no security issues if LyX is properly
15819 configured with safe templates only.
15820 This is so because the external programs are invoked with the
15821 \begin_inset Flex CharStyle:Code
15824 \begin_layout Plain Layout
15830 -system call rather than the
15831 \begin_inset Flex CharStyle:Code
15834 \begin_layout Plain Layout
15840 system-call, so it's not possible to execute arbitrary commands from the
15841 filename or parameter section via the shell.
15844 \begin_layout Standard
15845 This also implies that you are restricted in what command strings you can
15846 use in the external material templates.
15847 In particular, pipes and redirection are not readily available.
15848 This has to be so if LyX should remain safe.
15849 If you want to use some of the shell features, you should write a safe
15850 script to do this in a controlled manner, and then invoke the script from
15851 the command string.
15855 \begin_layout Standard
15856 It is possible to design a template that interacts directly with the shell,
15857 but since this would allow a malicious user to execute arbitrary commands
15858 by writing clever filenames and/or parameters, we generally recommend that
15859 you only use safe scripts that work with the
15860 \begin_inset Flex CharStyle:Code
15863 \begin_layout Plain Layout
15869 system call in a controlled manner.
15870 Of course, for use in a controlled environment, it can be tempting to just
15871 fall back to use ordinary shell scripts.
15872 If you do so, be aware that you
15876 provide an easily exploitable security hole in your system.
15877 Of course it stands to reason that such unsafe templates will never be
15878 included in the standard LyX distribution, although we do encourage people
15879 to submit new templates in the open source tradition.
15880 But LyX as shipped from the official distribution channels will never have
15884 \begin_layout Standard
15885 Including external material provides a lot of power, and you have to be
15886 careful not to introduce security hazards with this power.
15887 A subtle error in a single line in an innocent looking script can open
15888 the door to huge security problems.
15889 So if you do not fully understand the issues, we recommend that you consult
15890 a knowledgeable security professional or the LyX development team if you
15891 have any questions about whether a given template is safe or not.
15892 And do this before you use it in an uncontrolled environment.