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 false
117 \output_changes false
119 \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
2979 \begin_inset Flex CharStyle:Code
2982 \begin_layout Plain Layout
2988 , the guide to writing LyX documentation.
2989 Pay special attention to the translator's section.
2992 \begin_layout Itemize
2993 Check out the documentation translation web page at
2994 \begin_inset CommandInset href
2996 name "http://www.lyx.org/Translation"
2997 target "http://www.lyx.org/Translation"
3002 That way, you can find out which (if any) documents have already been translate
3003 d into your language.
3004 You can also find out who (if anyone) is organizing the effort to translate
3005 the documentation into your language.
3006 If no one is organizing the effort, please let us know that you're interested.
3009 \begin_layout Standard
3010 Once you get to actually translating, here's a few hints for you that may
3014 \begin_layout Itemize
3015 Join the documentation team! There is information on how to do that in
3016 \begin_inset Flex CharStyle:Code
3019 \begin_layout Plain Layout
3026 \begin_inset Flex CharStyle:MenuItem
3029 \begin_layout Plain Layout
3030 Help\SpecialChar \menuseparator
3040 ), which by the way is the first document you should translate.
3043 \begin_layout Itemize
3044 Learn the typographic conventions for the language you are translating to.
3045 Typography is an ancient art and over the centuries, a great variety of
3046 conventions have developed throughout different parts of the world.
3047 Also study the professional terminology amongst typographers in your country.
3048 Inventing your own terminology will only confuse the users.
3051 (Warning! Typography is addictive!)
3054 \begin_layout Itemize
3055 Make a copy of the document.
3056 This will be your working copy.
3057 You can use this as your personal translated help-file by placing it in
3059 \begin_inset Flex CharStyle:Code
3062 \begin_layout Plain Layout
3071 \begin_layout Itemize
3072 Sometimes the original document (from the LyX-team) will be updated.
3073 Use the source viewer at
3074 \begin_inset CommandInset href
3076 name "http://www.lyx.org/trac/timeline"
3077 target "http://www.lyx.org/trac/timeline"
3081 to see what has been changed.
3082 That way you can easily see which parts of the translated document need
3086 \begin_layout Standard
3087 If you ever find an error in the original document, fix it and notify the
3088 rest of the documentation team of the changes! (You didn't forget to join
3089 the documentation team, did you?)
3092 \begin_layout Standard
3093 \begin_inset Branch OutDated
3096 \begin_layout Section
3097 International Keyboard Support
3100 \begin_layout Standard
3103 [Editor's Note: The following section is by
3111 It needs to be fixed to conform to the new Documentation Style sheet and
3112 to make use of the new v1.0 features.
3113 The whole thing also needs to be merged with the section following it.-jw
3114 It may also be badly out of date.-rh (2008)]
3117 \begin_layout Subsection
3118 Defining Own Keymaps: Keymap File Format
3121 \begin_layout Standard
3122 Let's look at a keyboard definition file a little closer.
3123 It is a plain text file defining
3126 \begin_layout Itemize
3127 key-to-key or key-to-string translations
3130 \begin_layout Itemize
3134 \begin_layout Itemize
3135 dead keys exceptions
3138 \begin_layout Standard
3139 To define key-to-key or key-to-string translation, use this command:
3142 \begin_layout Quotation
3143 \begin_inset Flex CharStyle:Code
3146 \begin_layout Plain Layout
3155 \begin_inset Flex CharStyle:Code
3158 \begin_layout Plain Layout
3167 \begin_layout Standard
3169 \begin_inset Flex CharStyle:Code
3172 \begin_layout Plain Layout
3178 is the key to be translated and
3179 \begin_inset Flex CharStyle:Code
3182 \begin_layout Plain Layout
3188 is the string to be inserted into the document.
3189 To define dead keys, use:
3192 \begin_layout Quotation
3193 \begin_inset Flex CharStyle:Code
3196 \begin_layout Plain Layout
3205 \begin_inset Flex CharStyle:Code
3208 \begin_layout Plain Layout
3217 \begin_layout Standard
3219 \begin_inset Flex CharStyle:Code
3222 \begin_layout Plain Layout
3228 is a keyboard key and
3229 \begin_inset Flex CharStyle:Code
3232 \begin_layout Plain Layout
3239 The following dead keys are supported (shortcut name is in parentheses):
3242 \begin_layout Quotation
3246 \begin_inset space \hfill{}
3252 \begin_layout Quotation
3254 \begin_inset space \hfill{}
3260 \begin_layout Quotation
3262 \begin_inset space \hfill{}
3268 \begin_layout Quotation
3270 \begin_inset space \hfill{}
3276 \begin_layout Quotation
3278 \begin_inset space \hfill{}
3284 \begin_layout Quotation
3286 \begin_inset space \hfill{}
3293 \begin_layout Plain Layout
3305 \begin_layout Quotation
3307 \begin_inset space \hfill{}
3313 \begin_layout Quotation
3315 \begin_inset space \hfill{}
3322 \begin_layout Plain Layout
3334 \begin_layout Quotation
3336 \begin_inset space \hfill{}
3342 \begin_layout Quotation
3344 \begin_inset space \hfill{}
3350 \begin_layout Quotation
3352 \begin_inset space \hfill{}
3359 \begin_layout Plain Layout
3371 \begin_layout Quotation
3373 \begin_inset space \hfill{}
3380 \begin_layout Plain Layout
3392 \begin_layout Quotation
3394 \begin_inset space \hfill{}
3400 \begin_layout Quotation
3401 hungarian umlaut (hug)
3402 \begin_inset space \hfill{}
3408 \begin_layout Quotation
3410 \begin_inset space \hfill{}
3416 \begin_layout Quotation
3418 \begin_inset space \hfill{}
3425 \begin_layout Plain Layout
3437 \begin_layout Standard
3438 Since in many international keyboards there are exceptions to what some
3439 dead keys should do, you can define them using
3442 \begin_layout Quotation
3443 \begin_inset Flex CharStyle:Code
3446 \begin_layout Plain Layout
3454 deadkey key outstring
3457 \begin_layout Standard
3458 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3462 \begin_layout Quotation
3463 \begin_inset Flex CharStyle:Code
3466 \begin_layout Plain Layout
3479 \begin_layout Standard
3480 to make it work correctly.
3481 Also, you have to define as exceptions dead keys over i and j, to remove
3482 the dot from them before inserting an accent mark.
3483 I will change this when the time comes, but so far I haven't had time.
3486 \begin_layout Standard
3487 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3490 \begin_inset Flex CharStyle:Code
3493 \begin_layout Plain Layout
3499 have different meaning.
3501 \begin_inset Flex CharStyle:Code
3504 \begin_layout Plain Layout
3510 marks comments, quotes start and end LaTeX-style commands.
3511 To enter quote, you'll need to use
3512 \begin_inset Flex CharStyle:Code
3515 \begin_layout Plain Layout
3524 \begin_inset Flex CharStyle:Code
3527 \begin_layout Plain Layout
3534 \begin_inset Flex CharStyle:Code
3537 \begin_layout Plain Layout
3548 \begin_layout Standard
3549 If you make a keyboard description file that works for your language, please
3550 mail it to me, so I can include it in the next keymap distribution.
3553 \begin_layout Standard
3554 More keywords will be supported in keymap configuration file in future,
3558 \begin_layout Itemize
3559 \begin_inset Flex CharStyle:Code
3562 \begin_layout Plain Layout
3573 \begin_inset space \hfill{}
3577 \begin_inset Flex CharStyle:Code
3580 \begin_layout Plain Layout
3589 \begin_layout Itemize
3590 \begin_inset Flex CharStyle:Code
3593 \begin_layout Plain Layout
3604 \begin_inset space \hfill{}
3608 \begin_inset Flex CharStyle:Code
3611 \begin_layout Plain Layout
3617 an external keymap translation program
3620 \begin_layout Standard
3621 Also, it should look into
3622 \begin_inset Flex CharStyle:Code
3625 \begin_layout Plain Layout
3631 file for defaults, too (for example, a
3632 \begin_inset Flex CharStyle:Code
3635 \begin_layout Plain Layout
3643 option to include default keyboard).
3651 \begin_layout Section
3652 International Keymap Stuff
3653 \begin_inset CommandInset label
3655 name "sec:International-Keymap-Stuff"
3662 \begin_layout Standard
3663 \begin_inset Note Note
3666 \begin_layout Plain Layout
3667 In doing the revisions on this document in March 2008, I did not look over
3668 this stuff, as I do not understand it.
3669 It would be good if someone else could do so.
3678 \begin_layout Standard
3679 The next two sections describe the
3680 \begin_inset Flex CharStyle:Code
3683 \begin_layout Plain Layout
3692 \begin_inset Flex CharStyle:Code
3695 \begin_layout Plain Layout
3703 file syntax in detail.
3704 These sections should help you design your own key map if the ones provided
3705 do not meet your needs.
3708 \begin_layout Subsection
3712 \begin_layout Standard
3716 \begin_inset Flex CharStyle:Code
3719 \begin_layout Plain Layout
3725 file maps keystrokes to characters or strings.
3726 As the name suggests, it sets a keyboard mapping.
3728 \begin_inset Flex CharStyle:Code
3731 \begin_layout Plain Layout
3742 \begin_inset Flex CharStyle:Code
3745 \begin_layout Plain Layout
3760 \begin_inset Flex CharStyle:Code
3763 \begin_layout Plain Layout
3776 \begin_inset Flex CharStyle:Code
3779 \begin_layout Plain Layout
3788 \begin_inset Flex CharStyle:Code
3791 \begin_layout Plain Layout
3799 are described in this section.
3802 \begin_layout Labeling
3803 \labelwidthstring 00.00.0000
3804 \begin_inset Flex CharStyle:Code
3807 \begin_layout Plain Layout
3815 Map a character to a string
3818 \begin_layout LyX-Code
3833 \begin_layout Standard
3866 the double-quote (")
3883 must be escaped with a preceding backslash (
3894 \begin_layout Standard
3896 \begin_inset Flex CharStyle:MenuItem
3899 \begin_layout Plain Layout
3907 statement to cause the symbol
3908 \begin_inset Flex CharStyle:MenuItem
3911 \begin_layout Plain Layout
3919 to be output for the keystroke
3920 \begin_inset Flex CharStyle:MenuItem
3923 \begin_layout Plain Layout
3934 \begin_layout LyX-Code
3940 \begin_layout Labeling
3941 \labelwidthstring 00.00.0000
3942 \begin_inset Flex CharStyle:Code
3945 \begin_layout Plain Layout
3953 Specify an accent character
3956 \begin_layout LyX-Code
3965 \begin_layout Standard
3966 This will make the cha
4004 This is the dead key
4008 \begin_layout Plain Layout
4015 refers to a key that does not produce a character by itself, but when followed
4016 with another key, produces the desired accent character.
4017 For example, a German characte
4019 r with an umlaut like
4029 can be produced in this manner.
4038 \begin_layout Standard
4051 and then another key not in
4068 followed by the other, not allowed key, as output.
4072 \begin_inset Flex CharStyle:MenuItem
4075 \begin_layout Plain Layout
4083 cancels a dead key, so if
4094 \begin_inset Flex CharStyle:MenuItem
4097 \begin_layout Plain Layout
4106 , the cursor will not go one position backwards but will instead cancel
4122 might have had on the next keystroke.
4126 \begin_layout Standard
4127 The following example specifies that the character ' is to be an acute accent,
4128 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4131 \begin_layout LyX-Code
4134 kmod ' acute aeiouAEIOU
4137 \begin_layout Labeling
4138 \labelwidthstring 00.00.0000
4139 \begin_inset Flex CharStyle:Code
4142 \begin_layout Plain Layout
4148 Specify an exception to the accent character
4151 \begin_layout LyX-Code
4160 \begin_layout Standard
4161 This defines an exce
4202 have been assigned a keystroke with a previous
4205 \begin_inset Flex CharStyle:Code
4208 \begin_layout Plain Layout
4232 must not belong in the
4279 If such a declaration does not exist in
4287 \begin_inset Flex CharStyle:Code
4290 \begin_layout Plain Layout
4324 \begin_inset Flex CharStyle:Code
4327 \begin_layout Plain Layout
4341 \begin_layout Standard
4342 The following command produces causes äi to be produced when you enter acute-i
4346 \begin_layout LyX-Code
4360 \begin_layout Labeling
4361 \labelwidthstring 00.00.0000
4362 \begin_inset Flex CharStyle:Code
4365 \begin_layout Plain Layout
4371 Combine two accent characters
4374 \begin_layout LyX-Code
4380 accent1 accent2 allowed
4383 \begin_layout Standard
4384 This one is getting pretty esoteric.
4385 It allows you to combine the effect
4441 \begin_inset Flex CharStyle:Code
4444 \begin_layout Plain Layout
4472 \begin_layout Standard
4473 Consider this example from the
4474 \begin_inset Flex CharStyle:Code
4477 \begin_layout Plain Layout
4488 \begin_layout LyX-Code
4491 kmod ; acute aeioyvhAEIOYVH
4495 kcomb acute umlaut iyIY
4498 \begin_layout Standard
4499 This allows you to press
4500 \begin_inset Flex CharStyle:MenuItem
4503 \begin_layout Plain Layout
4511 and get the effect of
4512 \begin_inset Flex CharStyle:Code
4515 \begin_layout Plain Layout
4534 in this case cancels the last dead key, so if you press
4535 \begin_inset Flex CharStyle:MenuItem
4538 \begin_layout Plain Layout
4547 \begin_inset Flex CharStyle:Code
4550 \begin_layout Plain Layout
4563 \begin_layout Subsection
4567 \begin_layout Standard
4569 \begin_inset Flex CharStyle:Code
4572 \begin_layout Plain Layout
4580 mapping is performed, a
4581 \begin_inset Flex CharStyle:Code
4584 \begin_layout Plain Layout
4594 file maps the strings that the symbols generate to characters in the current
4596 The LyX distribution currently includes at least the
4597 \begin_inset Flex CharStyle:Code
4600 \begin_layout Plain Layout
4609 \begin_inset Flex CharStyle:Code
4612 \begin_layout Plain Layout
4623 \begin_layout Standard
4625 \begin_inset Flex CharStyle:Code
4628 \begin_layout Plain Layout
4636 file is a sequence of declarations of the form
4639 \begin_layout LyX-Code
4652 \begin_layout Standard
4653 For example, in order to map
4654 \begin_inset Flex CharStyle:MenuItem
4657 \begin_layout Plain Layout
4667 to the corresponding character in the iso-8859-1 set (233), the following
4671 \begin_layout LyX-Code
4679 \begin_layout Standard
4681 \begin_inset Flex CharStyle:Code
4684 \begin_layout Plain Layout
4693 \begin_inset Flex CharStyle:Code
4696 \begin_layout Plain Layout
4714 the same character can apply to more than one string.
4716 \begin_inset Flex CharStyle:Code
4719 \begin_layout Plain Layout
4730 \begin_layout LyX-Code
4742 \begin_inset Newline newline
4758 \begin_layout Standard
4759 If LyX cannot find a mapping for the string produced by the keystroke or
4760 a deadkey sequence, it will check if it looks like an accented char and
4761 try to draw an accent over the character on screen.
4764 \begin_layout Subsection
4768 \begin_layout Standard
4769 There is a second way to add support for international characters through
4770 so-called dead-keys.
4771 A dead-key works in combination with a letter to produce an accented character.
4772 Here, we'll explain how to create a really simple dead-key to illustrate
4776 \begin_layout Standard
4777 Suppose you happen to need the circumflex character,
4778 \begin_inset Quotes eld
4782 \begin_inset Quotes erd
4787 \begin_inset Flex CharStyle:MenuItem
4790 \begin_layout Plain Layout
4797 \begin_inset space ~
4801 \begin_inset Flex CharStyle:MenuItem
4804 \begin_layout Plain Layout
4810 ] to the LyX command
4811 \begin_inset Flex CharStyle:Code
4814 \begin_layout Plain Layout
4821 \begin_inset Flex CharStyle:Code
4824 \begin_layout Plain Layout
4831 Now, whenever you type the
4832 \begin_inset Flex CharStyle:MenuItem
4835 \begin_layout Plain Layout
4841 -key followed by a letter, that letter will have a circumflex accent on
4843 For example, the sequence
4844 \begin_inset Quotes eld
4848 \begin_inset Flex CharStyle:MenuItem
4851 \begin_layout Plain Layout
4858 \begin_inset Quotes erd
4861 produces the letter:
4862 \begin_inset Quotes eld
4866 \begin_inset Quotes erd
4870 If you tried to type
4871 \begin_inset Quotes eld
4875 \begin_inset Flex CharStyle:MenuItem
4878 \begin_layout Plain Layout
4885 \begin_inset Quotes erd
4888 , however, LyX will complain with a beep, since a
4889 \begin_inset Quotes eld
4893 \begin_inset Flex CharStyle:MenuItem
4896 \begin_layout Plain Layout
4903 \begin_inset Quotes erd
4906 never takes a circumflex accent.
4908 \begin_inset Flex CharStyle:MenuItem
4911 \begin_layout Plain Layout
4917 after a dead-key produces the bare-accent.
4918 Please note this last point! If you bind a key to a dead-key, you'll need
4919 to rebind the character on that key to yet another key.
4921 \begin_inset Flex CharStyle:MenuItem
4924 \begin_layout Plain Layout
4930 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4933 \begin_layout Standard
4934 One common way to bind dead-keys is to use
4935 \begin_inset Flex CharStyle:MenuItem
4938 \begin_layout Plain Layout
4945 \begin_inset Flex CharStyle:MenuItem
4948 \begin_layout Plain Layout
4955 \begin_inset Flex CharStyle:MenuItem
4958 \begin_layout Plain Layout
4964 in combination with an accent, like
4965 \begin_inset Quotes eld
4969 \begin_inset Flex CharStyle:MenuItem
4972 \begin_layout Plain Layout
4979 \begin_inset Quotes erd
4983 \begin_inset Quotes eld
4987 \begin_inset Flex CharStyle:MenuItem
4990 \begin_layout Plain Layout
4997 \begin_inset Quotes erd
5001 \begin_inset Quotes eld
5005 \begin_inset Flex CharStyle:MenuItem
5008 \begin_layout Plain Layout
5015 \begin_inset Quotes erd
5019 Another way involves using
5020 \begin_inset Flex CharStyle:Code
5023 \begin_layout Plain Layout
5030 \begin_inset Flex CharStyle:Code
5033 \begin_layout Plain Layout
5039 to set up the special
5040 \begin_inset Flex CharStyle:Code
5043 \begin_layout Plain Layout
5051 \begin_inset Flex CharStyle:Code
5054 \begin_layout Plain Layout
5060 acts in some ways just like
5061 \begin_inset Flex CharStyle:MenuItem
5064 \begin_layout Plain Layout
5070 and permits you to bind keys to accented characters.
5071 You can also turn keys into dead-keys by binding them to something like
5073 \begin_inset Flex CharStyle:Code
5076 \begin_layout Plain Layout
5082 and then binding this symbolic key to the corresponding LyX command.
5086 \begin_layout Plain Layout
5091 : This is exactly what I do in my
5092 \begin_inset Flex CharStyle:Code
5095 \begin_layout Plain Layout
5102 \begin_inset Flex CharStyle:Code
5105 \begin_layout Plain Layout
5113 \begin_inset Flex CharStyle:MenuItem
5116 \begin_layout Plain Layout
5118 \begin_inset space ~
5127 \begin_inset Flex CharStyle:Code
5130 \begin_layout Plain Layout
5136 and a bunch of these
5137 \begin_inset Quotes eld
5141 \begin_inset Flex CharStyle:Code
5144 \begin_layout Plain Layout
5151 \begin_inset Quotes erd
5154 symbolic keys bound such things as
5155 \begin_inset Flex CharStyle:MenuItem
5158 \begin_layout Plain Layout
5160 \begin_inset space ~
5169 \begin_inset Flex CharStyle:MenuItem
5172 \begin_layout Plain Layout
5174 \begin_inset space ~
5183 This is how I produce my accented characters.
5188 You can make just about anything into the
5189 \begin_inset Flex CharStyle:Code
5192 \begin_layout Plain Layout
5199 \begin_inset Flex CharStyle:MenuItem
5202 \begin_layout Plain Layout
5208 keys, a spare function key, etc.
5209 As for the LyX commands that produce accents, check the entry for
5210 \begin_inset Flex CharStyle:Code
5213 \begin_layout Plain Layout
5224 You'll find the complete list there.
5227 \begin_layout Subsection
5228 Saving your Language Configuration
5231 \begin_layout Standard
5232 You can edit your preferences so that your desired language environment
5233 is automatically configured when LyX starts up, via the
5234 \begin_inset Flex CharStyle:MenuItem
5237 \begin_layout Plain Layout
5238 Edit\SpecialChar \menuseparator
5247 \begin_layout Chapter
5248 Installing New Document Classes, Layouts, and Templates
5249 \begin_inset CommandInset label
5251 name "cha:Installing-New-Document"
5259 \begin_layout Plain Layout
5260 Installing New Document Classes
5268 \begin_layout Standard
5269 In this chapter, we describe the procedures for creating and installing
5270 new LyX layout and template files, as well as offer a refresher on correctly
5271 installing new LaTeX document classes.
5272 Some definitions: a document class is a LaTeX file (usually ending in
5273 \begin_inset Flex CharStyle:Code
5276 \begin_layout Plain Layout
5283 \begin_inset Flex CharStyle:Code
5286 \begin_layout Plain Layout
5292 ) that describes the format of a document such as an article, report, journal
5293 preprint, etc, and all the commands needed to realize that format.
5294 A layout file is a LyX file that corresponds to a LaTeX document class
5295 and that tells LyX how to
5296 \begin_inset Quotes eld
5300 \begin_inset Quotes erd
5303 things on the screen to make the display look something like the final
5305 More precisely, a layout file describes a
5306 \begin_inset Quotes eld
5310 \begin_inset Quotes erd
5313 which is the internal construct LyX uses to render the screen display.
5315 \begin_inset Quotes eld
5319 \begin_inset Quotes erd
5323 \begin_inset Quotes eld
5327 \begin_inset Quotes erd
5330 can be used somewhat interchangeably, but it is better to refer to the
5331 file as the layout, and the thing living in LyX's memory as the text class.
5332 A template file is simply a LyX document that contains a set of predefined
5333 entries for a given document class—entries that are generally required
5335 Templates are especially useful for things like journal manuscripts that
5336 are to be submitted electronically.
5339 \begin_layout Section
5340 Installing a new LaTeX package
5343 \begin_layout Standard
5344 Some installations may not include a LaTeX package that you would like to
5346 For example, you might need FoilTeX, a package for preparing slides or
5347 viewgraphs for overhead projectors.
5348 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5349 a user interface for that.
5350 For example on MiKTeX you start its program
5351 \begin_inset Quotes eld
5355 \begin_inset Quotes erd
5358 to get a list of available packages.
5359 To install one, right click on it or use the installing toolbar button.
5360 When the package you want to install is not in the list, but you have it
5362 \begin_inset Flex CharStyle:Code
5365 \begin_layout Plain Layout
5372 \begin_inset Flex CharStyle:Code
5375 \begin_layout Plain Layout
5381 -file, then copy these files to a subfolder of your LaTeX distribution,
5382 for example to the folder
5391 Then update the file name database of your LaTeX-distribution.
5392 For example on MiKTeX this is done by pressing the button
5395 \begin_inset space ~
5400 that you find in MiKTeX's
5401 \begin_inset Quotes eld
5405 \begin_inset Quotes erd
5409 In both cases you need afterwards to reconfigure LyX using the menu
5410 \begin_inset Flex CharStyle:MenuItem
5413 \begin_layout Plain Layout
5414 Tools\SpecialChar \menuseparator
5420 and then to restart LyX.
5423 \begin_layout Standard
5424 If your LaTeX distribution doesn't provide a user interface, then you can
5425 follow these steps by using a UNIX/Linux console.
5428 \begin_layout Enumerate
5429 Get the package from
5430 \begin_inset CommandInset href
5433 target "http://www.ctan.org/"
5440 \begin_layout Enumerate
5441 You can install this package in several different places.
5442 If you want it to be available for all users on your system, then you should
5443 install it in your `local' TeX tree; if you want (or need) it to be available
5444 just for you, then you can install it in your own `user' TeX tree.
5445 Where these should be created, if they do not already exist, depends upon
5446 the details of your system.
5447 To find out, look in the file
5448 \begin_inset Flex CharStyle:Code
5451 \begin_layout Plain Layout
5461 \begin_layout Plain Layout
5462 This usually lives in the directory
5463 \begin_inset Flex CharStyle:Code
5466 \begin_layout Plain Layout
5472 , though you can run
5473 \begin_inset Flex CharStyle:Code
5476 \begin_layout Plain Layout
5487 The location of the `local' TeX tree is defined by
5488 \begin_inset Flex CharStyle:Code
5491 \begin_layout Plain Layout
5497 ; this is usually somewhere like
5498 \begin_inset Flex CharStyle:Code
5501 \begin_layout Plain Layout
5502 /usr/local/share/texmf/
5508 The `user' TeX tree is defined by
5509 \begin_inset Flex CharStyle:Code
5512 \begin_layout Plain Layout
5519 \begin_inset Flex CharStyle:Code
5522 \begin_layout Plain Layout
5529 (If these variables are not predefined, you can define them.) You'll probably
5530 need root permissions to create or modify the `local' tree; but your `user'
5531 tree shouldn't have such limitations.
5534 \begin_layout Enumerate
5536 \begin_inset Flex CharStyle:Code
5539 \begin_layout Plain Layout
5546 \begin_inset Flex CharStyle:Code
5549 \begin_layout Plain Layout
5556 \begin_inset Flex CharStyle:Code
5559 \begin_layout Plain Layout
5566 \begin_inset space \thinspace{}
5570 \begin_inset Newline newline
5574 \begin_inset Flex CharStyle:Code
5577 \begin_layout Plain Layout
5578 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5584 \begin_inset Newline newline
5587 But, again, most of this will
5588 \begin_inset Quotes eld
5592 \begin_inset Quotes erd
5598 \begin_layout Enumerate
5603 \begin_layout Plain Layout
5604 We'll assume henceforth that you're defining `local' TeX tree.
5605 If you're defining a user tree, just adjust as necessary.
5611 You must follow the directory structure of your existing
5612 \begin_inset Flex CharStyle:Code
5615 \begin_layout Plain Layout
5621 directory, which will be found at
5622 \begin_inset Flex CharStyle:Code
5625 \begin_layout Plain Layout
5632 For example, latex packages should go under
5633 \begin_inset Flex CharStyle:Code
5636 \begin_layout Plain Layout
5637 $TEXMFLOCAL/tex/latex/
5645 \begin_layout Enumerate
5646 Install the package.
5647 For example, you would unpack the FoilTeX tarball and copy it to
5648 \begin_inset Flex CharStyle:Code
5651 \begin_layout Plain Layout
5652 $TEXMFLOCAL/tex/latex/foiltex
5659 \begin_inset Flex CharStyle:Code
5662 \begin_layout Plain Layout
5668 directory contains various files.
5671 \begin_layout Enumerate
5673 \begin_inset Flex CharStyle:Code
5676 \begin_layout Plain Layout
5684 \begin_inset Flex CharStyle:Code
5687 \begin_layout Plain Layout
5696 \begin_layout Standard
5697 Your package is now installed and available to LaTeX.
5698 To make it available to LyX, you need to create a Layout file, if one is
5699 not already available.
5700 (See the next section.) Once you have a layout file, you need only reconfigure
5702 \begin_inset Flex CharStyle:MenuItem
5705 \begin_layout Plain Layout
5706 Tools\SpecialChar \menuseparator
5712 ) and then restart LyX.
5713 You should then see your new package—for example
5714 \begin_inset Flex CharStyle:MenuItem
5717 \begin_layout Plain Layout
5724 \begin_inset Flex CharStyle:MenuItem
5727 \begin_layout Plain Layout
5728 Document\SpecialChar \menuseparator
5735 \begin_inset Flex CharStyle:MenuItem
5738 \begin_layout Plain Layout
5748 \begin_layout Section
5752 \begin_layout Standard
5753 This section describes how to write and install your own LyX layout files
5754 and walks through the
5755 \begin_inset Flex CharStyle:Code
5758 \begin_layout Plain Layout
5764 text class format as an example.
5766 \begin_inset Flex CharStyle:Code
5769 \begin_layout Plain Layout
5775 files describe what paragraph and character styles are available for a
5776 given document class and how LyX should display them.
5777 We try to provide a thorough description of the process here; however,
5778 there are so many different types of documents supported by LaTeX classes
5779 that we can't hope to cover every different possibility or problem you
5781 (The LyX users' list is frequented by people with lots of experience with
5782 layout design who are willing to share what they've learned.)
5785 \begin_layout Standard
5786 As you prepare to write a new layout, it is extremely helpful to look at
5787 the example layouts distributed with LyX.
5788 If you use a nice LaTeX document class that might be of interest for others,
5789 too, and have a nice corresponding LyX layout, feel free to contribute
5790 the stuff to us, so we may put it into the distribution.
5792 \begin_inset CommandInset href
5794 name "section on the LyX wiki"
5795 target "http://wiki.lyx.org/Layouts/Layouts"
5799 for this kind of material.
5802 \begin_layout Standard
5803 All the tags described in this chapter are case-insensitive; this means
5805 \begin_inset Flex CharStyle:Code
5808 \begin_layout Plain Layout
5815 \begin_inset Flex CharStyle:Code
5818 \begin_layout Plain Layout
5825 \begin_inset Flex CharStyle:Code
5828 \begin_layout Plain Layout
5834 are really the same command.
5835 The possible values are printed in brackets after the feature's name.
5836 The default value if a feature isn't specified inside a text class-description
5838 \begin_inset Flex CharStyle:Code
5841 \begin_layout Plain Layout
5850 If the argument has a data type like
5851 \begin_inset Quotes eld
5855 \begin_inset Quotes erd
5859 \begin_inset Quotes eld
5863 \begin_inset Quotes erd
5866 , the default is shown like this:
5867 \begin_inset Flex CharStyle:Code
5870 \begin_layout Plain Layout
5881 \begin_layout Subsection
5883 \begin_inset CommandInset label
5885 name "sub:Layout-modules"
5892 \begin_layout Standard
5893 Similar to layout files, and new with LyX 1.6, are layout
5898 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5899 some modules—such as the endnotes module—provide support for just such
5901 In a sense, layout modules are similar to included files—files like
5902 \begin_inset Flex CharStyle:Code
5905 \begin_layout Plain Layout
5911 —in that modules are not specific to a given document layout but may be
5912 used with many different layouts.
5913 The difference is that using a layout module does not require editing the
5915 Rather, modules are selected in the
5916 \begin_inset Flex CharStyle:MenuItem
5919 \begin_layout Plain Layout
5920 Document\SpecialChar \menuseparator
5929 \begin_layout Standard
5930 Building modules is the easiest way to get started with layout editing,
5931 since it can be as simple as adding a single new paragraph or flex inset.
5932 But modules may, in principle, contain anything a layout file can contain.
5935 \begin_layout Standard
5936 A module must begin with a line like the following:
5939 \begin_layout LyX-Code
5942 DeclareLyXModule[endnotes.sty]{Endnotes}
5945 \begin_layout Standard
5946 The mandatory argument, in curly brackets, is the name of the module, as
5948 \begin_inset Flex CharStyle:MenuItem
5951 \begin_layout Plain Layout
5952 Document\SpecialChar \menuseparator
5960 \change_inserted 1 1243500588
5964 \begin_layout Standard
5965 The argument in square brackets is optional: It declares any LaTeX packages
5966 on which the module depends.
5967 Please note that only packages about which LyX knows should be listed in
5968 the square brackets.
5972 \begin_layout Plain Layout
5973 The list of such packages is documented only in the source code.
5978 LyX will not check for arbitrary packages.
5980 \change_inserted 1 1243500694
5981 It is also possible to use the form
5982 \begin_inset Flex CharStyle:MenuItem
5985 \begin_layout Plain Layout
5987 \change_inserted 1 1243500706
5993 , which declares that the module can only be used when there exists a conversion
5994 chain between formats `from' and `to'.
5999 \begin_layout Standard
6000 The module declaration should then be followed by lines like the following:
6003 \begin_layout LyX-Code
6007 \begin_layout LyX-Code
6008 #Adds an endnote command, in addition to footnotes.
6012 \begin_layout LyX-Code
6013 #You will need to add
6015 theendnotes in TeX code where you
6018 \begin_layout LyX-Code
6019 #want the endnotes to appear.
6023 \begin_layout LyX-Code
6027 \begin_layout LyX-Code
6028 #Requires: somemodule | othermodule
6031 \begin_layout LyX-Code
6032 #Excludes: badmodule
6035 \begin_layout Standard
6036 The description is used in
6037 \begin_inset Flex CharStyle:MenuItem
6040 \begin_layout Plain Layout
6041 Document\SpecialChar \menuseparator
6047 to provide the user with information about what the module does.
6049 \begin_inset Flex CharStyle:Code
6052 \begin_layout Plain Layout
6058 line is used to identify other modules with which this one must be used;
6060 \begin_inset Flex CharStyle:Code
6063 \begin_layout Plain Layout
6069 line is used to identify modules with which this one may not be used.
6070 Both are optional, and, as shown, multiple modules should be separated
6071 with the pipe symbol: |.
6072 Note that the required modules are treated disjunctively:
6076 of the required modules must be used.
6081 excluded module may be used.
6082 Note that modules are identified here by their
6086 without the .module extension.
6088 \begin_inset Flex CharStyle:Code
6091 \begin_layout Plain Layout
6098 \begin_inset Flex CharStyle:Code
6101 \begin_layout Plain Layout
6110 \begin_layout Standard
6111 After creating a new module, you will need to reconfigure and then restart
6112 LyX for the module to appear in the menu.
6113 However, changes you make to the module will be seen immediately, if you
6115 \begin_inset Flex CharStyle:MenuItem
6118 \begin_layout Plain Layout
6119 Document\SpecialChar \menuseparator
6125 , highlight something, and then hit
6126 \begin_inset Quotes eld
6130 \begin_inset Quotes erd
6136 It is strongly recommended that you save your work before doing so
6141 it is strongly recommended that you not attempt to edit modules while simultaneo
6142 usly working on documents
6145 Though of course the developers strive to keep LyX stable in such situations,
6146 syntax errors and the like in your module file could cause strange behavior.
6149 \begin_layout Subsection
6150 Supporting new document classes
6153 \begin_layout Standard
6154 There are two situations you are likely to encounter when wanting to support
6155 a new LaTeX document class, involving LaTeX2e class (
6156 \begin_inset Flex CharStyle:Code
6159 \begin_layout Plain Layout
6166 \begin_inset Flex CharStyle:Code
6169 \begin_layout Plain Layout
6176 Supporting a style file is usually fairly easy.
6177 Supporting a new document class is a bit harder.
6180 \begin_layout Subsection
6182 \begin_inset Flex CharStyle:MenuItem
6185 \begin_layout Plain Layout
6194 \begin_layout Standard
6195 If your new document class is provided as a style file that is used in conjuncti
6196 on with an existing, supported document class—for the sake of the example,
6197 we'll assume that the style file is called
6198 \begin_inset Flex CharStyle:MenuItem
6201 \begin_layout Plain Layout
6207 and it is meant to be used with
6208 \begin_inset Flex CharStyle:MenuItem
6211 \begin_layout Plain Layout
6217 , which is a standard class—start by copying the existing class's layout
6218 file into your local directory:
6221 \begin_layout LyX-Code
6222 cp report.layout ~/.lyx/layouts/myclass.layout
6225 \begin_layout Standard
6227 \begin_inset Flex CharStyle:Code
6230 \begin_layout Plain Layout
6236 and change the line:
6239 \begin_layout LyX-Code
6242 DeclareLaTeXClass{report}
6245 \begin_layout Standard
6249 \begin_layout LyX-Code
6252 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6255 \begin_layout Standard
6259 \begin_layout LyX-Code
6261 \begin_inset Newline newline
6267 \begin_inset Newline newline
6273 \begin_layout Standard
6274 near the top of the file.
6277 \begin_layout Standard
6278 Start LyX and select
6279 \begin_inset Flex CharStyle:MenuItem
6282 \begin_layout Plain Layout
6283 Tools\SpecialChar \menuseparator
6290 Then restart LyX and try creating a new document.
6292 \begin_inset Flex CharStyle:MenuItem
6295 \begin_layout Plain Layout
6301 " as a document class option in the
6302 \begin_inset Flex CharStyle:MenuItem
6305 \begin_layout Plain Layout
6306 Document\SpecialChar \menuseparator
6313 It is likely that some of the sectioning commands and such in your new
6314 class will work differently from how they worked in the base class—
6315 \begin_inset Flex CharStyle:Code
6318 \begin_layout Plain Layout
6324 in this example—so you can fiddle around with the settings for the different
6325 sections if you wish.
6328 \begin_layout Subsection
6330 \begin_inset Flex CharStyle:MenuItem
6333 \begin_layout Plain Layout
6342 \begin_layout Standard
6343 There are two possibilities here.
6344 One is that the class file is itself based upon an existing document class.
6345 For example, many thesis classes are based upon
6346 \begin_inset Flex CharStyle:MenuItem
6349 \begin_layout Plain Layout
6356 To see whether yours is, look for a line like
6359 \begin_layout LyX-Code
6365 \begin_layout Standard
6367 If so, then you may proceed largely as in the previous section, though
6368 the DeclareLaTeXClass line will be different.
6369 If your new class is thesis, and it is based upon book, then the line should
6374 \begin_layout Plain Layout
6375 And it will be easiest if you save the file to
6376 \begin_inset Flex CharStyle:Code
6379 \begin_layout Plain Layout
6385 : LyX assumes that the document class has the same name as the layout file.
6394 \begin_layout LyX-Code
6397 DeclareLaTeXClass[thesis,book]{thesis}
6400 \begin_layout Standard
6401 If, on the other hand, the new class is not based upon an existing class,
6402 you will probably have to
6403 \begin_inset Quotes eld
6407 \begin_inset Quotes erd
6411 We strongly suggest copying an existing layout file which uses a similar
6412 LaTeX class and then modifying it, if you can do so.
6413 At least use an existing file as a starting point so you can find out what
6414 items you need to worry about.
6415 Again, the specifics are covered below.
6418 \begin_layout Section
6419 Declaring a new text class
6422 \begin_layout Standard
6423 When it's finally time to get your hands dirty and create or edit your own
6424 layout file, the following sections describe what you're up against.
6425 Our advice is to go slowly, save and test often, listen to soothing music,
6426 and enjoy one or two of your favorite adult beverages; more if you are
6427 getting particularly stuck.
6428 It's really not that hard, except that the multitude of options can become
6429 overwhelming if you try to do to much in one sitting.
6430 Go have another adult beverage, just for good measure.
6433 \begin_layout Standard
6437 \begin_layout Standard
6438 Lines in a layout file which begin with a
6439 \begin_inset Flex CharStyle:Code
6442 \begin_layout Plain Layout
6449 There is one exception to this rule: all layouts should begin with lines
6453 \begin_layout LyX-Code
6456 #% Do not delete the line below; configure depends on this
6459 \begin_layout LyX-Code
6464 DeclareLaTeXClass{article}
6467 \begin_layout Standard
6468 The second line is used when you configure LyX.
6469 The layout file is read by the LaTeX script
6470 \begin_inset Flex CharStyle:Code
6473 \begin_layout Plain Layout
6479 , in a special mode where
6480 \begin_inset Flex CharStyle:Code
6483 \begin_layout Plain Layout
6490 The first line is just a LaTeX comment, and the second one contains the
6491 declaration of the text class.
6492 If these lines appear in a file named
6493 \begin_inset Flex CharStyle:Code
6496 \begin_layout Plain Layout
6502 , then they define a text class of name
6503 \begin_inset Flex CharStyle:Code
6506 \begin_layout Plain Layout
6512 (the name of the layout file) which uses the LaTeX document class
6513 \begin_inset Flex CharStyle:Code
6516 \begin_layout Plain Layout
6522 (the default is to use the same name as the layout).
6524 \begin_inset Quotes eld
6528 \begin_inset Quotes erd
6531 that appears above is used as a description of the text class in the
6532 \begin_inset Flex CharStyle:MenuItem
6535 \begin_layout Plain Layout
6536 Document\SpecialChar \menuseparator
6545 \begin_layout Standard
6546 Let's assume that you wrote your own text class that uses the
6547 \begin_inset Flex CharStyle:Code
6550 \begin_layout Plain Layout
6556 document class, but where you changed the appearance of the section headings.
6557 If you put it in a file
6558 \begin_inset Flex CharStyle:Code
6561 \begin_layout Plain Layout
6567 , the header of this file should be:
6570 \begin_layout LyX-Code
6573 #% Do not delete the line below; configure depends on this
6576 \begin_layout LyX-Code
6581 DeclareLaTeXClass[article]{article (with my own headings)}
6584 \begin_layout Standard
6585 This declares a text class
6586 \begin_inset Flex CharStyle:Code
6589 \begin_layout Plain Layout
6595 , associated with the LaTeX document class
6596 \begin_inset Flex CharStyle:Code
6599 \begin_layout Plain Layout
6606 \begin_inset Quotes eld
6609 article (with my own headings)
6610 \begin_inset Quotes erd
6614 If your text class depends on several packages, you can declare it as:
6617 \begin_layout LyX-Code
6620 #% Do not delete the line below; configure depends on this
6623 \begin_layout LyX-Code
6628 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6631 \begin_layout Standard
6632 This indicates that your text class uses the foo.sty package.
6633 Finally, it is also possible to declare classes for DocBook code.
6634 Typical declarations will look like
6637 \begin_layout LyX-Code
6640 #% Do not delete the line below; configure depends on this
6643 \begin_layout LyX-Code
6648 DeclareDocBookClass[article]{SGML (DocBook article)}
6651 \begin_layout Standard
6652 Note that these declarations can also be given an optional parameter declaring
6653 the name of the document class (but not a list).
6656 \begin_layout Standard
6657 So, to be as explicit as possible, the form of the layout declaration is:
6660 \begin_layout LyX-Code
6665 DeclareLaTeXClass[class,package.sty]{layout description}
6668 \begin_layout Standard
6669 The class need only be specified if the name of the LaTeX class file and
6670 the name of the layout file are different; if the name of the class file
6671 is not specified, then LyX will simply assume that it is the same as the
6672 name of the layout file.
6675 \begin_layout Standard
6676 When the text class has been modified to your taste, all you have to do
6677 is to copy it either to
6678 \begin_inset Flex CharStyle:Code
6681 \begin_layout Plain Layout
6688 \begin_inset Flex CharStyle:Code
6691 \begin_layout Plain Layout
6698 \begin_inset Flex CharStyle:MenuItem
6701 \begin_layout Plain Layout
6702 Tools\SpecialChar \menuseparator
6708 , exit LyX and restart it.
6709 Then your new text class should be available along with the others.
6712 \begin_layout Standard
6713 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6714 you made to your layout files.
6715 As a result, editing layout files could be very time consuming.
6716 Beginning with 1.6, however, you can force a reload of the layout currently
6717 in use by using the LyX function
6718 \begin_inset Flex CharStyle:MenuItem
6721 \begin_layout Plain Layout
6728 There is no default binding for this function—though, of course, you can
6729 bind it to a key yourself.
6730 If you want to use this function, then, you should simply enter it in the
6736 : This is very much an `advanced feature'.
6741 recommended that you save your work before using this function.
6746 recommended that you not attempt to edit your layout while simultaneously
6747 working on a document that you care about.
6748 Use a test document.
6749 Syntax errors and the like in your layout file could cause peculiar behavior.
6750 In particular, such errors could cause LyX to regard the current layout
6751 as invalid and to attempt to switch to some other layout.
6752 The LyX team strives to keep LyX stable in such situations, but safe is
6756 \begin_layout Subsection
6760 \begin_layout Standard
6761 The first non-comment line must contain the file format number:
6764 \begin_layout Description
6765 \begin_inset Flex CharStyle:Code
6768 \begin_layout Plain Layout
6775 \begin_inset Flex CharStyle:Code
6778 \begin_layout Plain Layout
6784 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6785 don't have an explicit file format).
6786 The file format that is documented here is format 14.
6789 \begin_layout Subsection
6790 General text class parameters
6793 \begin_layout Standard
6794 These are the general parameters which describe the form of the entire document:
6797 \begin_layout Description
6798 \begin_inset Flex CharStyle:Code
6801 \begin_layout Plain Layout
6807 Adds information to the document preamble.
6809 \begin_inset Quotes eld
6813 \begin_inset Flex CharStyle:Code
6816 \begin_layout Plain Layout
6823 \begin_inset Quotes erd
6829 \begin_layout Description
6830 \begin_inset Flex CharStyle:Code
6833 \begin_layout Plain Layout
6839 Describes various global options supported by the document class.
6841 \begin_inset space ~
6845 \begin_inset CommandInset ref
6847 reference "sub:ClassOptions"
6853 \begin_inset Quotes eld
6857 \begin_inset Flex CharStyle:Code
6860 \begin_layout Plain Layout
6867 \begin_inset Quotes erd
6873 \begin_layout Description
6874 \begin_inset Flex CharStyle:Code
6877 \begin_layout Plain Layout
6884 \begin_inset Flex CharStyle:Code
6887 \begin_layout Plain Layout
6896 \begin_inset Flex CharStyle:Code
6899 \begin_layout Plain Layout
6905 ] Whether the class should default to having one or two columns.
6906 Can be changed in the
6907 \begin_inset Flex CharStyle:MenuItem
6910 \begin_layout Plain Layout
6911 Document\SpecialChar \menuseparator
6920 \begin_layout Description
6921 \begin_inset Flex CharStyle:Code
6924 \begin_layout Plain Layout
6930 This sequence defines a new counter.
6932 \begin_inset space ~
6936 \begin_inset CommandInset ref
6938 reference "sub:Counters"
6944 \begin_inset Quotes eld
6948 \begin_inset Flex CharStyle:Code
6951 \begin_layout Plain Layout
6958 \begin_inset Quotes erd
6964 \begin_layout Description
6965 \begin_inset Flex CharStyle:Code
6968 \begin_layout Plain Layout
6974 Sets the default font used to display the document.
6976 \begin_inset space ~
6980 \begin_inset CommandInset ref
6982 reference "sub:Font-description"
6986 for how to declare fonts.
6988 \begin_inset Quotes eld
6992 \begin_inset Flex CharStyle:Code
6995 \begin_layout Plain Layout
7002 \begin_inset Quotes erd
7008 \begin_layout Description
7009 \begin_inset Flex CharStyle:Code
7012 \begin_layout Plain Layout
7019 \begin_inset Flex CharStyle:Code
7022 \begin_layout Plain Layout
7028 Specifies a module to be included by default with this document class,
7029 which should be specified by filename without the
7030 \begin_inset Flex CharStyle:Code
7033 \begin_layout Plain Layout
7040 The user can still remove the module, but it will be active at the outset.
7041 (This applies only when new files are created, or when this class is chosen
7042 for an existing document.)
7045 \begin_layout Description
7046 \begin_inset Flex CharStyle:Code
7049 \begin_layout Plain Layout
7056 \begin_inset Flex CharStyle:Code
7059 \begin_layout Plain Layout
7065 ] This is the style that will be assigned to new paragraphs, usually
7066 \begin_inset Flex CharStyle:MenuItem
7069 \begin_layout Plain Layout
7076 This will default to the first defined style if not given, but you are
7077 highly encouraged to use this directive.
7080 \begin_layout Description
7081 \begin_inset Flex CharStyle:Code
7084 \begin_layout Plain Layout
7091 \begin_inset Flex CharStyle:Code
7094 \begin_layout Plain Layout
7100 ] Indicates that the module in question—which should be specified by filename
7102 \begin_inset Flex CharStyle:Code
7105 \begin_layout Plain Layout
7111 extension—cannot be used with this document class.
7112 This might be used in a journal-specific layout file to prevent, say, the
7114 \begin_inset Flex CharStyle:Code
7117 \begin_layout Plain Layout
7123 module that numbers theorems by section.
7128 be used in a module.
7129 Modules have their own way of excluding other modules (see
7130 \begin_inset CommandInset ref
7132 reference "sub:Layout-modules"
7139 \begin_layout Description
7140 \begin_inset Flex CharStyle:Code
7143 \begin_layout Plain Layout
7149 Defines a new float.
7151 \begin_inset space ~
7155 \begin_inset CommandInset ref
7157 reference "sub:Floats"
7163 \begin_inset Quotes eld
7167 \begin_inset Flex CharStyle:Code
7170 \begin_layout Plain Layout
7177 \begin_inset Quotes erd
7183 \begin_layout Description
7184 \begin_inset Flex CharStyle:Code
7187 \begin_layout Plain Layout
7193 As its name implies, this command allows you to include another layout
7194 definition file within yours to avoid duplicating commands.
7195 Common examples are the standard layout files, for example,
7196 \begin_inset Flex CharStyle:Code
7199 \begin_layout Plain Layout
7205 , which contains most of the basic layouts.
7208 \begin_layout Description
7209 \begin_inset Flex CharStyle:Code
7212 \begin_layout Plain Layout
7218 This section (re-)defines the layout of an inset.
7219 It can be applied to an existing inset of to a new, user-defined inset,
7221 \begin_inset space \thinspace{}
7225 \begin_inset space \space{}
7228 a new character style.
7230 \begin_inset space ~
7234 \begin_inset CommandInset ref
7236 reference "sub:Flex-insets-and"
7240 for more information.
7242 \begin_inset Quotes eld
7246 \begin_inset Flex CharStyle:Code
7249 \begin_layout Plain Layout
7256 \begin_inset Quotes erd
7262 \begin_layout Description
7263 \begin_inset Flex CharStyle:Code
7266 \begin_layout Plain Layout
7272 A string that indicates the width of the left margin on the screen, for
7274 \begin_inset Quotes eld
7278 \begin_inset Quotes erd
7284 \begin_layout Description
7285 \begin_inset Flex CharStyle:Code
7288 \begin_layout Plain Layout
7294 This command deletes an existing float.
7295 This is particularly useful when you want to suppress a float that has
7296 be defined in an input file.
7299 \begin_layout Description
7300 \begin_inset Flex CharStyle:Code
7303 \begin_layout Plain Layout
7309 This command deletes an existing style.
7310 This is particularly useful when you want to suppress a style that has
7311 be defined in an input file.
7314 \begin_layout Description
7315 \begin_inset Flex CharStyle:Code
7318 \begin_layout Plain Layout
7324 A string indicating what sort of output documents using this class will
7326 At present, the options are: `docbook', `latex', and `literate'.
7327 \change_inserted 1 1243500198
7331 \begin_layout Description
7333 \change_inserted 1 1243500505
7334 \begin_inset Flex CharStyle:Code
7337 \begin_layout Plain Layout
7339 \change_inserted 1 1243500208
7345 A string indicating the file format (as defined in the Preferences dialog)
7346 produced by this class.
7347 It is mainly useful when
7348 \begin_inset Flex CharStyle:Code
7351 \begin_layout Plain Layout
7353 \change_inserted 1 1243500394
7359 is `literate' and one wants to define a new type of literate document.
7360 This string is reset to `docbook', `latex', or `literate' when the correspondin
7362 \begin_inset Flex CharStyle:Code
7365 \begin_layout Plain Layout
7367 \change_inserted 1 1243500473
7373 parameter is encountered.
7378 \begin_layout Description
7379 \begin_inset Flex CharStyle:Code
7382 \begin_layout Plain Layout
7393 \begin_inset Flex CharStyle:Code
7396 \begin_layout Plain Layout
7407 \begin_inset Flex CharStyle:Code
7410 \begin_layout Plain Layout
7417 \begin_inset Flex CharStyle:Code
7420 \begin_layout Plain Layout
7426 ] The class default pagestyle.
7427 Can be changed in the
7428 \begin_inset Flex CharStyle:MenuItem
7431 \begin_layout Plain Layout
7432 Document\SpecialChar \menuseparator
7441 \begin_layout Description
7442 \begin_inset Flex CharStyle:Code
7445 \begin_layout Plain Layout
7451 Sets the preamble for the LaTeX document.
7452 Note that this will completely override any prior
7453 \begin_inset Flex CharStyle:Code
7456 \begin_layout Plain Layout
7463 \begin_inset Flex CharStyle:Code
7466 \begin_layout Plain Layout
7474 \begin_inset Quotes eld
7478 \begin_inset Flex CharStyle:Code
7481 \begin_layout Plain Layout
7488 \begin_inset Quotes erd
7494 \begin_layout Description
7495 \begin_inset Flex CharStyle:Code
7498 \begin_layout Plain Layout
7505 \begin_inset Flex CharStyle:Code
7508 \begin_layout Plain Layout
7515 \begin_inset Flex CharStyle:Code
7518 \begin_layout Plain Layout
7527 \begin_inset Flex CharStyle:Code
7530 \begin_layout Plain Layout
7536 ] Whether the class already provides the feature
7537 \begin_inset Flex CharStyle:Code
7540 \begin_layout Plain Layout
7547 A feature is in general the name of a package (
7548 \begin_inset Flex CharStyle:Code
7551 \begin_layout Plain Layout
7558 \begin_inset Flex CharStyle:Code
7561 \begin_layout Plain Layout
7567 , \SpecialChar \ldots{}
7569 \begin_inset Flex CharStyle:Code
7572 \begin_layout Plain Layout
7579 \begin_inset Flex CharStyle:Code
7582 \begin_layout Plain Layout
7588 ,\SpecialChar \ldots{}
7589 ); the complete list of supported features is unfortunately not documented
7590 outside the LyX source code—but see
7591 \begin_inset Flex CharStyle:Code
7594 \begin_layout Plain Layout
7600 if you're interested.
7602 \begin_inset Flex CharStyle:MenuItem
7605 \begin_layout Plain Layout
7606 Help\SpecialChar \menuseparator
7612 also gives an overview of the supported packages.
7615 \begin_layout Description
7616 \begin_inset Flex CharStyle:Code
7619 \begin_layout Plain Layout
7626 \begin_inset Flex CharStyle:Code
7629 \begin_layout Plain Layout
7635 ] Indicates that this layout provides the functionality of the module mentioned,
7636 which should be specified by the filename without the
7637 \begin_inset Flex CharStyle:Code
7640 \begin_layout Plain Layout
7647 This will typically be used if the layout includes the module directly,
7648 rather than using the
7649 \begin_inset Flex CharStyle:Code
7652 \begin_layout Plain Layout
7658 tag to indicate that it ought to be used.
7659 It could be used in a module that provided an alternate implementation
7660 of the same functionality.
7663 \begin_layout Description
7664 \begin_inset Flex CharStyle:Code
7667 \begin_layout Plain Layout
7674 \begin_inset Flex CharStyle:Code
7677 \begin_layout Plain Layout
7683 ] Whether the class requires the feature
7684 \begin_inset Flex CharStyle:Code
7687 \begin_layout Plain Layout
7694 Multiple features must be separated by commas.
7695 Note that you can only request supported features.
7698 \begin_layout Description
7699 \begin_inset Flex CharStyle:Code
7702 \begin_layout Plain Layout
7708 A string that indicates the width of the right margin on the screen, for
7710 \begin_inset Quotes eld
7714 \begin_inset Quotes erd
7720 \begin_layout Description
7721 \begin_inset Flex CharStyle:Code
7724 \begin_layout Plain Layout
7730 Sets which divisions get numbered.
7732 \begin_inset Flex CharStyle:Code
7735 \begin_layout Plain Layout
7744 \begin_layout Description
7745 \begin_inset Flex CharStyle:Code
7748 \begin_layout Plain Layout
7757 \begin_inset Flex CharStyle:Code
7760 \begin_layout Plain Layout
7771 \begin_inset Flex CharStyle:Code
7774 \begin_layout Plain Layout
7780 ] Whether the class-default should be printing on one or both sides of the
7782 Can be changed in the
7783 \begin_inset Flex CharStyle:MenuItem
7786 \begin_layout Plain Layout
7787 Document\SpecialChar \menuseparator
7796 \begin_layout Description
7797 \begin_inset Flex CharStyle:Code
7800 \begin_layout Plain Layout
7806 This sequence defines a new paragraph style.
7807 If the style already exists, it will redefine some of its parameters instead.
7809 \begin_inset space ~
7813 \begin_inset CommandInset ref
7815 reference "sub:Paragraph-Styles"
7821 \begin_inset Quotes eld
7825 \begin_inset Flex CharStyle:Code
7828 \begin_layout Plain Layout
7835 \begin_inset Quotes erd
7841 \begin_layout Description
7842 \begin_inset Flex CharStyle:Code
7845 \begin_layout Plain Layout
7852 \begin_inset Flex CharStyle:Code
7855 \begin_layout Plain Layout
7861 ] The name of the command or environment to be used with
7862 \begin_inset Flex CharStyle:Code
7865 \begin_layout Plain Layout
7874 \begin_layout Description
7875 \begin_inset Flex CharStyle:Code
7878 \begin_layout Plain Layout
7885 \begin_inset Flex CharStyle:Code
7888 \begin_layout Plain Layout
7897 \begin_inset Flex CharStyle:Code
7900 \begin_layout Plain Layout
7906 ] Indicates what kind of markup is used to define the title of a document.
7908 \begin_inset Flex CharStyle:Code
7911 \begin_layout Plain Layout
7917 means that the macro with name
7918 \begin_inset Flex CharStyle:Code
7921 \begin_layout Plain Layout
7927 will be inserted after the last layout which has
7928 \begin_inset Quotes eld
7932 \begin_inset Flex CharStyle:Code
7935 \begin_layout Plain Layout
7942 \begin_inset Quotes erd
7947 \begin_inset Flex CharStyle:Code
7950 \begin_layout Plain Layout
7956 corresponds to the case where the block of paragraphs which have
7957 \begin_inset Quotes eld
7961 \begin_inset Flex CharStyle:Code
7964 \begin_layout Plain Layout
7971 \begin_inset Quotes erd
7974 should be enclosed into the
7975 \begin_inset Flex CharStyle:Code
7978 \begin_layout Plain Layout
7987 \begin_layout Description
7988 \begin_inset Flex CharStyle:Code
7991 \begin_layout Plain Layout
7997 Sets which divisions are included in the table of contents.
7999 \begin_inset Flex CharStyle:Code
8002 \begin_layout Plain Layout
8011 \begin_layout Subsection
8012 \begin_inset Flex CharStyle:Code
8015 \begin_layout Plain Layout
8022 \begin_inset CommandInset label
8024 name "sub:ClassOptions"
8031 \begin_layout Standard
8033 \begin_inset Flex CharStyle:Code
8036 \begin_layout Plain Layout
8042 section can contain the following entries:
8045 \begin_layout Description
8046 \begin_inset Flex CharStyle:Code
8049 \begin_layout Plain Layout
8056 \begin_inset Flex CharStyle:Code
8059 \begin_layout Plain Layout
8065 ] The list of available font sizes for the document's main font, separated
8067 \begin_inset Quotes eld
8071 \begin_inset Flex CharStyle:Code
8074 \begin_layout Plain Layout
8081 \begin_inset Quotes erd
8087 \begin_layout Description
8088 \begin_inset Flex CharStyle:Code
8091 \begin_layout Plain Layout
8097 Used to set the DTD line with XML-based output classes.
8099 \begin_inset space \thinspace{}
8103 \begin_inset Quotes eld
8106 -//OASIS//DTD DocBook V4.2//EN
8107 \begin_inset Quotes erd
8113 \begin_layout Description
8114 \begin_inset Flex CharStyle:Code
8117 \begin_layout Plain Layout
8124 \begin_inset Flex CharStyle:Code
8127 \begin_layout Plain Layout
8128 string="empty|plain|headings|fancy"
8133 ] The list of available page styles, separated by
8134 \begin_inset Quotes eld
8138 \begin_inset Flex CharStyle:Code
8141 \begin_layout Plain Layout
8148 \begin_inset Quotes erd
8154 \begin_layout Description
8155 \begin_inset Flex CharStyle:Code
8158 \begin_layout Plain Layout
8165 \begin_inset Flex CharStyle:Code
8168 \begin_layout Plain Layout
8174 ] Some document class options, separated by a comma, that will be added
8175 to the optional part of the
8176 \begin_inset Flex CharStyle:Code
8179 \begin_layout Plain Layout
8190 \begin_layout Standard
8192 \begin_inset Flex CharStyle:Code
8195 \begin_layout Plain Layout
8201 section must end with
8202 \begin_inset Quotes eld
8206 \begin_inset Flex CharStyle:Code
8209 \begin_layout Plain Layout
8216 \begin_inset Quotes erd
8222 \begin_layout Subsection
8224 \begin_inset CommandInset label
8226 name "sub:Paragraph-Styles"
8233 \begin_layout Standard
8234 A paragraph style description looks like this:
8238 \begin_layout Plain Layout
8239 Note that this will either define a new layout or modify an existing one.
8247 \begin_layout LyX-Code
8254 \begin_layout LyX-Code
8258 \begin_layout LyX-Code
8262 \begin_layout Standard
8263 where the following commands are allowed:
8266 \begin_layout Description
8267 \begin_inset Flex CharStyle:Code
8270 \begin_layout Plain Layout
8277 \begin_inset Flex CharStyle:Code
8280 \begin_layout Plain Layout
8285 , left, right, center
8290 ] Paragraph alignment.
8293 \begin_layout Description
8294 \begin_inset Flex CharStyle:Code
8297 \begin_layout Plain Layout
8304 \begin_inset Flex CharStyle:Code
8307 \begin_layout Plain Layout
8312 , left, right, center
8317 ] A comma separated list of permitted alignments.
8318 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8320 For example a right-aligned or centered enumeration isn't possible.)
8323 \begin_layout Description
8324 \begin_inset Flex CharStyle:Code
8327 \begin_layout Plain Layout
8333 Language dependent information to be included in the LaTeX preamble when
8335 Note that this will completely override any prior
8336 \begin_inset Flex CharStyle:Code
8339 \begin_layout Plain Layout
8347 \begin_inset Quotes eld
8351 \begin_inset Flex CharStyle:Code
8354 \begin_layout Plain Layout
8361 \begin_inset Quotes erd
8365 The contents of this tag will occur once in the LaTeX preamble for each
8366 language used by the document.
8367 Each time, the following substitutions are made:
8371 \begin_layout Itemize
8372 \begin_inset Flex CharStyle:Code
8375 \begin_layout Plain Layout
8381 is replaced by the language name (as used by the babel package).
8384 \begin_layout Itemize
8386 \begin_inset Quotes eld
8390 \begin_inset Quotes erd
8394 \begin_inset Flex CharStyle:Code
8397 \begin_layout Plain Layout
8403 replaces its argument by the translation of the argument to the current
8407 \begin_layout Standard
8408 This preamble snippet will only be used if the document contains more than
8409 one language and the babel package is used.
8413 \begin_layout Description
8414 \begin_inset Flex CharStyle:Code
8417 \begin_layout Plain Layout
8424 \begin_inset Flex CharStyle:Code
8427 \begin_layout Plain Layout
8437 \begin_layout Plain Layout
8438 Note that a `float' here is a real number, such as: 1.5.
8443 The vertical space with which the last of a chain of paragraphs with this
8444 layout is separated from the following paragraph.
8445 If the next paragraph has another layout, the separations are not simply
8446 added, but the maximum is taken.
8449 \begin_layout Description
8450 \begin_inset Flex CharStyle:Code
8453 \begin_layout Plain Layout
8460 \begin_inset Flex CharStyle:Code
8463 \begin_layout Plain Layout
8469 The category for this style.
8470 This is used to group related styles in the Layout combobox on the toolbar.
8471 Any string can be used, but you may want to use existing categories with
8476 \begin_layout Description
8477 \begin_inset Flex CharStyle:Code
8480 \begin_layout Plain Layout
8486 Depth of XML command.
8487 Used only with XML-type formats.
8490 \begin_layout Description
8491 \begin_inset Flex CharStyle:Code
8494 \begin_layout Plain Layout
8501 \begin_inset CommandInset label
8503 name "des:CopyStyle"
8508 \begin_inset Flex CharStyle:Code
8511 \begin_layout Plain Layout
8517 Copies all the features of an existing style into the current one.
8521 \begin_layout Description
8522 \begin_inset Flex CharStyle:Code
8525 \begin_layout Plain Layout
8531 The name of a style whose preamble should be output
8536 This allows to ensure some ordering of the preamble snippets when macros
8537 definitions depend on one another.
8541 \begin_layout Plain Layout
8542 Note that, besides that functionality, there is no way to ensure any ordering
8544 The ordering that you see in a given version of LyX may change without
8545 warning in later versions.
8553 \begin_layout Description
8554 \begin_inset Flex CharStyle:Code
8557 \begin_layout Plain Layout
8564 \begin_inset Flex CharStyle:Code
8567 \begin_layout Plain Layout
8572 , Box, Filled_Box, Static
8577 ] The type of label that stands at the end of the paragraph (or sequence
8579 \begin_inset Flex CharStyle:Code
8582 \begin_layout Plain Layout
8589 \begin_inset Flex CharStyle:Code
8592 \begin_layout Plain Layout
8599 \begin_inset Flex CharStyle:Code
8602 \begin_layout Plain Layout
8609 \begin_inset Flex CharStyle:Code
8612 \begin_layout Plain Layout
8620 \begin_inset Flex CharStyle:Code
8623 \begin_layout Plain Layout
8630 \begin_inset Quotes eld
8634 \begin_inset Quotes erd
8638 \begin_inset Flex CharStyle:Code
8641 \begin_layout Plain Layout
8648 \begin_inset Flex CharStyle:Code
8651 \begin_layout Plain Layout
8652 \begin_inset space ~
8661 \begin_inset space ~
8664 black) square suitable for end of proof markers,
8665 \begin_inset Flex CharStyle:Code
8668 \begin_layout Plain Layout
8674 is an explicit text string.
8677 \begin_layout Description
8678 \begin_inset Flex CharStyle:Code
8681 \begin_layout Plain Layout
8688 \begin_inset Flex CharStyle:Code
8691 \begin_layout Plain Layout
8697 ] The string used for a label with a
8698 \begin_inset Flex CharStyle:Code
8701 \begin_layout Plain Layout
8708 \begin_inset Flex CharStyle:Code
8711 \begin_layout Plain Layout
8721 \begin_layout Description
8722 \begin_inset Flex CharStyle:Code
8725 \begin_layout Plain Layout
8732 \begin_inset Flex CharStyle:Code
8735 \begin_layout Plain Layout
8746 \begin_inset Flex CharStyle:Code
8749 \begin_layout Plain Layout
8758 \begin_layout Description
8759 \begin_inset Flex CharStyle:Code
8762 \begin_layout Plain Layout
8769 \begin_inset Flex CharStyle:Code
8772 \begin_layout Plain Layout
8782 ] With this parameter the
8783 \begin_inset Flex CharStyle:MenuItem
8786 \begin_layout Plain Layout
8793 \begin_inset Quotes eld
8796 Vertical space above
8797 \begin_inset Quotes erd
8801 \begin_inset Flex CharStyle:MenuItem
8804 \begin_layout Plain Layout
8805 Edit\SpecialChar \menuseparator
8807 \begin_inset space ~
8815 dialog can be set when initializing a paragraph with this style.
8819 \begin_layout Plain Layout
8822 Note from Jean-Marc:
8824 I'm not sure that this setting has much use, and it should probably be
8825 removed in later versions.
8833 \begin_layout Description
8834 \begin_inset Flex CharStyle:Code
8837 \begin_layout Plain Layout
8843 The font used for both the text body
8849 \begin_inset space ~
8853 \begin_inset CommandInset ref
8855 reference "sub:Font-description"
8860 Note that defining this font automatically defines the
8861 \begin_inset Flex CharStyle:Code
8864 \begin_layout Plain Layout
8871 So you should define this one first if you also want to define
8872 \begin_inset Flex CharStyle:Code
8875 \begin_layout Plain Layout
8884 \begin_layout Description
8885 \begin_inset Flex CharStyle:Code
8888 \begin_layout Plain Layout
8895 \begin_inset CommandInset label
8897 name "des:FreeSpacing"
8904 \begin_inset Flex CharStyle:Code
8907 \begin_layout Plain Layout
8918 \begin_inset Flex CharStyle:Code
8921 \begin_layout Plain Layout
8927 ] Usually LyX doesn't allow you to insert more than one space between words,
8928 since a space is considered as the separation between two words, not a
8929 character or symbol of its own.
8930 This is a very fine thing but sometimes annoying, for example, when typing
8931 program code or plain LaTeX code.
8933 \begin_inset Flex CharStyle:Code
8936 \begin_layout Plain Layout
8943 Note that LyX will create protected blanks for the additional blanks when
8944 in another mode than LaTeX-mode.
8947 \begin_layout Description
8948 \begin_inset Flex CharStyle:Code
8951 \begin_layout Plain Layout
8957 [[FIXME]] (Used only with XML-type formats.)
8960 \begin_layout Description
8961 \begin_inset Flex CharStyle:Code
8964 \begin_layout Plain Layout
8971 \begin_inset Flex CharStyle:Code
8974 \begin_layout Plain Layout
8980 If 1, marks the layout as being part of a title block (see also the
8981 \begin_inset Flex CharStyle:Code
8984 \begin_layout Plain Layout
8991 \begin_inset Flex CharStyle:Code
8994 \begin_layout Plain Layout
9003 \begin_layout Description
9004 \begin_inset Flex CharStyle:Code
9007 \begin_layout Plain Layout
9014 \begin_inset Flex CharStyle:Code
9017 \begin_layout Plain Layout
9023 ] This provides extra space between paragraphs that have the same layout.
9024 If you put other layouts into an environment, each is separated with the
9026 \begin_inset Flex CharStyle:Code
9029 \begin_layout Plain Layout
9036 But the whole items of the environment are additionally separated with
9038 \begin_inset Flex CharStyle:Code
9041 \begin_layout Plain Layout
9053 \begin_layout Description
9054 \begin_inset Flex CharStyle:Code
9057 \begin_layout Plain Layout
9063 [[FIXME]] (Used only with XML-type formats.)
9066 \begin_layout Description
9067 \begin_inset Flex CharStyle:Code
9070 \begin_layout Plain Layout
9077 \begin_inset CommandInset label
9079 name "des:KeepEmpty"
9086 \begin_inset Flex CharStyle:Code
9089 \begin_layout Plain Layout
9100 \begin_inset Flex CharStyle:Code
9103 \begin_layout Plain Layout
9109 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9110 lead to empty LaTeX output.
9111 There are some cases where this could be desirable however: in a letter
9112 template, the required fields can be provided as empty fields, so that
9113 people do not forget them; in some special classes, a layout can be used
9114 as some kind of break, which does not contain actual text.
9117 \begin_layout Description
9118 \begin_inset Flex CharStyle:Code
9121 \begin_layout Plain Layout
9127 [float=0] The vertical space between the label and the text body.
9128 Only used for labels that are above the text body (
9129 \begin_inset Flex CharStyle:Code
9132 \begin_layout Plain Layout
9139 \begin_inset Flex CharStyle:Code
9142 \begin_layout Plain Layout
9143 Centered_Top_Environment
9151 \begin_layout Description
9152 \begin_inset Flex CharStyle:Code
9155 \begin_layout Plain Layout
9162 \begin_inset Flex CharStyle:Code
9165 \begin_layout Plain Layout
9172 \begin_inset Newline newline
9175 The name of the counter for automatic numbering.
9177 \begin_inset Newline newline
9185 \begin_inset Flex CharStyle:Code
9188 \begin_layout Plain Layout
9195 \begin_inset Flex CharStyle:Code
9198 \begin_layout Plain Layout
9205 In that case, the counter will be stepped each time the layout appears.
9207 \begin_inset Newline newline
9215 \begin_inset Flex CharStyle:Code
9218 \begin_layout Plain Layout
9225 \begin_inset Flex CharStyle:Code
9228 \begin_layout Plain Layout
9234 , though this case is a bit complicated.
9236 \begin_inset Quotes eld
9240 \begin_inset Flex CharStyle:Code
9243 \begin_layout Plain Layout
9250 \begin_inset Quotes erd
9254 Then the actual counters used are
9255 \begin_inset Flex CharStyle:Code
9258 \begin_layout Plain Layout
9265 \begin_inset Flex CharStyle:Code
9268 \begin_layout Plain Layout
9275 \begin_inset Flex CharStyle:Code
9278 \begin_layout Plain Layout
9285 \begin_inset Flex CharStyle:Code
9288 \begin_layout Plain Layout
9295 These counters must all be declared separately.
9296 \begin_inset Newline newline
9300 \begin_inset CommandInset ref
9302 reference "sub:Counters"
9306 for details on counters.
9309 \begin_layout Description
9310 \begin_inset Flex CharStyle:Code
9313 \begin_layout Plain Layout
9319 The font used for the label.
9321 \begin_inset space ~
9325 \begin_inset CommandInset ref
9327 reference "sub:Font-description"
9334 \begin_layout Description
9335 \begin_inset Flex CharStyle:Code
9338 \begin_layout Plain Layout
9344 Text that indicates how far a label should be indented.
9347 \begin_layout Description
9348 \begin_inset Flex CharStyle:Code
9351 \begin_layout Plain Layout
9358 \begin_inset Flex CharStyle:Code
9361 \begin_layout Plain Layout
9367 ] The horizontal space between the label and the text body.
9368 Only used for labels that are not above the text body.
9371 \begin_layout Description
9372 \begin_inset Flex CharStyle:Code
9375 \begin_layout Plain Layout
9382 \begin_inset Flex CharStyle:Code
9385 \begin_layout Plain Layout
9391 ] The string used for a label with a
9392 \begin_inset Flex CharStyle:Code
9395 \begin_layout Plain Layout
9403 \begin_inset Flex CharStyle:Code
9406 \begin_layout Plain Layout
9412 is set, this string can be contain the special formatting commands described
9414 \begin_inset CommandInset ref
9416 reference "sub:Counters"
9424 \begin_layout Plain Layout
9425 For the sake of backwards compatibility, the string
9426 \begin_inset Flex CharStyle:Code
9429 \begin_layout Plain Layout
9439 will be replaced by the expanded
9440 \begin_inset Flex CharStyle:Code
9443 \begin_layout Plain Layout
9450 \begin_inset Flex CharStyle:Code
9453 \begin_layout Plain Layout
9462 This feature is now obsolete and should be replaced by the mechanisms of
9464 \begin_inset CommandInset ref
9466 reference "sub:Counters"
9478 \begin_layout Description
9479 \begin_inset Flex CharStyle:Code
9482 \begin_layout Plain Layout
9489 \begin_inset Flex CharStyle:Code
9492 \begin_layout Plain Layout
9498 ] This is used inside the appendix instead of
9499 \begin_inset Flex CharStyle:Code
9502 \begin_layout Plain Layout
9510 \begin_inset Flex CharStyle:Code
9513 \begin_layout Plain Layout
9520 \begin_inset Flex CharStyle:Code
9523 \begin_layout Plain Layout
9532 \begin_layout Description
9533 \begin_inset Flex CharStyle:Code
9536 \begin_layout Plain Layout
9542 [FIXME] (Used only with XML-type formats.)
9545 \begin_layout Description
9546 \begin_inset Flex CharStyle:Code
9549 \begin_layout Plain Layout
9556 \begin_inset Flex CharStyle:Code
9559 \begin_layout Plain Layout
9564 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
9565 Enumerate, Itemize, Bibliography
9574 \begin_layout Itemize
9575 \begin_inset Flex CharStyle:Code
9578 \begin_layout Plain Layout
9584 means the label is the very first word (up to the first real blank).
9585 Use protected spaces (like
9586 \begin_inset space ~
9589 that one) if you want more than one word as the label.
9593 \begin_layout Itemize
9594 \begin_inset Flex CharStyle:Code
9597 \begin_layout Plain Layout
9603 means the label is simply whatever
9604 \begin_inset Flex CharStyle:Code
9607 \begin_layout Plain Layout
9614 Note that this really is `static'.
9617 \begin_layout Itemize
9618 \begin_inset Flex CharStyle:Code
9621 \begin_layout Plain Layout
9628 \begin_inset Flex CharStyle:Code
9631 \begin_layout Plain Layout
9632 Centered_Top_Environment
9637 are special cases of
9638 \begin_inset Flex CharStyle:Code
9641 \begin_layout Plain Layout
9648 The label will be printed above the paragraph, but only at the top of an
9649 environment or the top of a chain of paragraphs with this layout.
9650 This might be used with the
9651 \begin_inset Flex CharStyle:MenuItem
9654 \begin_layout Plain Layout
9660 layout, for example.
9663 \begin_layout Itemize
9664 \begin_inset Flex CharStyle:Code
9667 \begin_layout Plain Layout
9673 is a special case for the caption-labels
9674 \begin_inset Quotes eld
9678 \begin_inset Quotes erd
9682 \begin_inset Quotes eld
9686 \begin_inset Quotes erd
9691 \begin_inset Flex CharStyle:Code
9694 \begin_layout Plain Layout
9700 means the (hardcoded) label string depends on the kind of float: It is
9701 hardcoded to be `FloatType N', where N is the value of the counter associated
9705 \begin_layout Itemize
9707 \begin_inset Flex CharStyle:Code
9710 \begin_layout Plain Layout
9716 label type defines automatically numbered labels.
9718 \begin_inset Flex CharStyle:Code
9721 \begin_layout Plain Layout
9727 will be expanded to resolve any counter references it contains: For example,
9729 \begin_inset Quotes eld
9733 \begin_inset Flex CharStyle:Code
9736 \begin_layout Plain Layout
9747 \begin_inset Quotes erd
9752 \begin_inset CommandInset ref
9754 reference "sub:Counters"
9758 for more information on counters.
9761 \begin_layout Itemize
9762 \begin_inset Flex CharStyle:Code
9765 \begin_layout Plain Layout
9771 produces the usual sort of enumeration labels.
9772 At present, it is hardcoded to use Arabic numerals, lowercase letters,
9773 small Roman numerals, and uppercase letters for the four possible depths.
9776 \begin_layout Itemize
9777 \begin_inset Flex CharStyle:Code
9780 \begin_layout Plain Layout
9786 produces various bullets at the different levels.
9787 It is also hardcoded.
9790 \begin_layout Itemize
9791 \begin_inset Flex CharStyle:Code
9794 \begin_layout Plain Layout
9800 is used internally by LyX and should be used only with
9801 \begin_inset Flex CharStyle:Code
9804 \begin_layout Plain Layout
9805 LatexType BibEnvironment
9814 \begin_layout Description
9815 \begin_inset Flex CharStyle:Code
9818 \begin_layout Plain Layout
9825 \begin_inset Flex CharStyle:Code
9828 \begin_layout Plain Layout
9834 , but this preamble snippet occurs independently from the babel package,
9835 and only for the document language.
9837 \begin_inset Quotes eld
9841 \begin_inset Flex CharStyle:Code
9844 \begin_layout Plain Layout
9851 \begin_inset Quotes erd
9858 \begin_layout Standard
9859 If the style defines text that appears in the typeset document, it may use
9861 \begin_inset Flex CharStyle:Code
9864 \begin_layout Plain Layout
9871 \begin_inset Flex CharStyle:Code
9874 \begin_layout Plain Layout
9880 to support non-english and even multilanguage documents correctly.
9881 The following excerpt (from the
9882 \begin_inset Flex CharStyle:Code
9885 \begin_layout Plain Layout
9891 file) shows how this works:
9894 \begin_layout LyX-Code
9898 \begin_layout LyX-Code
9901 theoremstyle{remark}
9904 \begin_layout LyX-Code
9907 newtheorem{claim}[thm]{
9914 \begin_layout LyX-Code
9918 \begin_layout LyX-Code
9922 \begin_layout LyX-Code
9927 claimname}{_(Claim)}
9930 \begin_layout LyX-Code
9934 \begin_layout LyX-Code
9938 \begin_layout LyX-Code
9942 \begin_layout LyX-Code
9951 claimname}{_(Claim)}}
9954 \begin_layout LyX-Code
9958 \begin_layout Standard
9959 The key to correct translation of the user visible text is the definition
9961 \begin_inset Flex CharStyle:Code
9964 \begin_layout Plain Layout
9972 in the language preamble.
9973 This command holds the name of the theorem that will appear in the output.
9975 \begin_inset Flex CharStyle:Code
9978 \begin_layout Plain Layout
9984 then uses the commands offered by the babel package to redefine
9985 \begin_inset Flex CharStyle:Code
9988 \begin_layout Plain Layout
9996 for each used language in multilanguage documents.
10000 \begin_layout Description
10001 \begin_inset Flex CharStyle:Code
10004 \begin_layout Plain Layout
10010 The name of the corresponding LaTeX stuff.
10011 Either the environment or command name.
10014 \begin_layout Description
10015 \begin_inset Flex CharStyle:Code
10018 \begin_layout Plain Layout
10024 An optional parameter for the corresponding
10025 \begin_inset Flex CharStyle:Code
10028 \begin_layout Plain Layout
10035 This parameter cannot be changed from within LyX.
10038 \begin_layout Description
10039 \begin_inset Flex CharStyle:Code
10042 \begin_layout Plain Layout
10049 \begin_inset CommandInset label
10051 name "des:LatexType"
10056 \begin_inset Flex CharStyle:Code
10059 \begin_layout Plain Layout
10064 , Command, Environment, Item_Environment,
10070 \begin_inset Flex CharStyle:Code
10073 \begin_layout Plain Layout
10074 List_Environment, Bib_Environment
10079 ] How the layout should be translated into LaTeX.
10083 \begin_layout Plain Layout
10084 \begin_inset Flex CharStyle:Code
10087 \begin_layout Plain Layout
10093 is perhaps a bit misleading, since these rules apply to SGML classes, too.
10094 Visit the SGML class files for specific examples.
10103 \begin_layout Itemize
10104 \begin_inset Flex CharStyle:Code
10107 \begin_layout Plain Layout
10113 means nothing special.
10117 \begin_layout Itemize
10118 \begin_inset Flex CharStyle:Code
10121 \begin_layout Plain Layout
10128 \begin_inset Flex CharStyle:Code
10131 \begin_layout Plain Layout
10138 {\SpecialChar \ldots{}
10147 \begin_layout Itemize
10148 \begin_inset Flex CharStyle:Code
10151 \begin_layout Plain Layout
10158 \begin_inset Flex CharStyle:Code
10161 \begin_layout Plain Layout
10168 }\SpecialChar \ldots{}
10184 \begin_layout Itemize
10185 \begin_inset Flex CharStyle:Code
10188 \begin_layout Plain Layout
10195 \begin_inset Flex CharStyle:Code
10198 \begin_layout Plain Layout
10205 \begin_inset Flex CharStyle:Code
10208 \begin_layout Plain Layout
10216 is generated for each paragraph of this environment.
10220 \begin_layout Itemize
10221 \begin_inset Flex CharStyle:Code
10224 \begin_layout Plain Layout
10231 \begin_inset Flex CharStyle:Code
10234 \begin_layout Plain Layout
10241 \begin_inset Flex CharStyle:Code
10244 \begin_layout Plain Layout
10250 is passed as an argument to the environment.
10252 \begin_inset Flex CharStyle:Code
10255 \begin_layout Plain Layout
10261 can be defined in the
10262 \begin_inset Flex CharStyle:MenuItem
10265 \begin_layout Plain Layout
10270 ayout\SpecialChar \menuseparator
10284 \begin_layout Standard
10285 Putting the last few things together, the LaTeX output will be either:
10288 \begin_layout LyX-Code
10291 latexname[latexparam]{\SpecialChar \ldots{}
10295 \begin_layout Standard
10299 \begin_layout LyX-Code
10302 begin{latexname}[latexparam] \SpecialChar \ldots{}
10308 \begin_layout Standard
10309 depending upon the LaTeX type.
10313 \begin_layout Description
10314 \begin_inset Flex CharStyle:Code
10317 \begin_layout Plain Layout
10324 \begin_inset Flex CharStyle:Code
10327 \begin_layout Plain Layout
10333 ] If you put layouts into environments, the leftmargins are not simply added,
10334 but added with a factor
10335 \begin_inset Formula $\frac{4}{depth+4}$
10339 Note that this parameter is also used when the margin is defined as
10340 \begin_inset Flex CharStyle:Code
10343 \begin_layout Plain Layout
10350 \begin_inset Flex CharStyle:Code
10353 \begin_layout Plain Layout
10360 Then it is added to the manual or dynamic margin.
10362 \begin_inset Newline newline
10365 The argument is passed as a string.
10367 \begin_inset Quotes eld
10371 \begin_inset Flex CharStyle:Code
10374 \begin_layout Plain Layout
10381 \begin_inset Quotes erd
10384 means that the paragraph is indented with the width of
10385 \begin_inset Quotes eld
10389 \begin_inset Flex CharStyle:Code
10392 \begin_layout Plain Layout
10399 \begin_inset Quotes erd
10402 in the normal font.
10403 You can get a negative width by prefixing the string with
10404 \begin_inset Quotes eld
10408 \begin_inset Flex CharStyle:Code
10411 \begin_layout Plain Layout
10418 \begin_inset Quotes erd
10422 This way was chosen so that the look is the same with each used screen
10427 \begin_layout Description
10428 \begin_inset Flex CharStyle:Code
10431 \begin_layout Plain Layout
10438 \begin_inset Flex CharStyle:Code
10441 \begin_layout Plain Layout
10446 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10452 \begin_inset Newline newline
10455 The kind of margin that the layout has on the left side.
10457 \begin_inset Flex CharStyle:Code
10460 \begin_layout Plain Layout
10466 just means a fixed margin.
10468 \begin_inset Flex CharStyle:Code
10471 \begin_layout Plain Layout
10477 means that the left margin depends on the string entered in the
10478 \begin_inset Flex CharStyle:MenuItem
10481 \begin_layout Plain Layout
10482 Edit\SpecialChar \menuseparator
10484 \begin_inset space ~
10493 This is used to typeset nice lists without tabulators.
10495 \begin_inset Flex CharStyle:Code
10498 \begin_layout Plain Layout
10504 means that the margin depends on the size of the label.
10505 This is used for automatic enumerated headlines.
10506 It is obvious that the headline
10507 \begin_inset Quotes eld
10510 5.4.3.2.1 Very long headline
10511 \begin_inset Quotes erd
10514 must have a wider left margin (as wide as
10515 \begin_inset Quotes eld
10519 \begin_inset Quotes erd
10522 plus the space) than
10523 \begin_inset Quotes eld
10526 3.2 Very long headline
10527 \begin_inset Quotes erd
10531 \begin_inset Quotes eld
10535 \begin_inset Quotes erd
10538 are not able to do this.
10540 \begin_inset Flex CharStyle:Code
10543 \begin_layout Plain Layout
10549 is similar, but only the very first row of the paragraph is dynamic, while
10550 the others are static; this is used, for example, for descriptions.
10552 \begin_inset Flex CharStyle:Code
10555 \begin_layout Plain Layout
10561 means the margin is chosen in a way that the longest row of this paragraph
10562 fits to the right margin.
10563 This is used to typeset an address on the right edge of the page.
10566 \begin_layout Description
10567 \begin_inset Flex CharStyle:Code
10570 \begin_layout Plain Layout
10577 \begin_inset Flex CharStyle:Code
10580 \begin_layout Plain Layout
10589 \begin_inset Flex CharStyle:Code
10592 \begin_layout Plain Layout
10598 ] Whether fragile commands in this layout should be
10599 \begin_inset Flex CharStyle:Code
10602 \begin_layout Plain Layout
10615 whether this command should itself be protected.)
10618 \begin_layout Description
10619 \begin_inset Flex CharStyle:Code
10622 \begin_layout Plain Layout
10629 \begin_inset Flex CharStyle:Code
10632 \begin_layout Plain Layout
10639 \begin_inset Flex CharStyle:Code
10642 \begin_layout Plain Layout
10650 ] Whether newlines are translated into LaTeX newlines (
10651 \begin_inset Flex CharStyle:Code
10654 \begin_layout Plain Layout
10665 The translation can be switched off to allow more comfortable LaTeX editing
10669 \begin_layout Description
10670 \begin_inset Flex CharStyle:Code
10673 \begin_layout Plain Layout
10680 \begin_inset Flex CharStyle:Code
10683 \begin_layout Plain Layout
10690 \begin_inset Flex CharStyle:Code
10693 \begin_layout Plain Layout
10701 ] Whether the following Paragraph is allowed to indent its very first row.
10703 \begin_inset Flex CharStyle:Code
10706 \begin_layout Plain Layout
10712 means that it is not allowed to do so;
10713 \begin_inset Flex CharStyle:Code
10716 \begin_layout Plain Layout
10722 means it could do so if it wants to.
10725 \begin_layout Description
10726 \begin_inset Flex CharStyle:Code
10729 \begin_layout Plain Layout
10735 Name of a layout that has replaced this layout.
10736 This is used to rename a layout, while keeping backward compatibility.
10739 \begin_layout Description
10740 \begin_inset Flex CharStyle:Code
10743 \begin_layout Plain Layout
10750 \begin_inset Flex CharStyle:Code
10753 \begin_layout Plain Layout
10759 ] The number of optional arguments that can be used with this layout.
10760 This is useful for things like section headings, and only makes sense with
10764 \begin_layout Description
10765 \begin_inset Flex CharStyle:Code
10768 \begin_layout Plain Layout
10775 \begin_inset Flex CharStyle:Code
10778 \begin_layout Plain Layout
10784 ] The indent of the very first line of a paragraph.
10786 \begin_inset Flex CharStyle:Code
10789 \begin_layout Plain Layout
10795 will be fixed for a certain layout.
10796 The exception is Standard layout, since the indentation of a Standard layout
10797 paragraph can be prohibited with
10798 \begin_inset Flex CharStyle:Code
10801 \begin_layout Plain Layout
10808 Also, Standard layout paragraphs inside environments use the
10809 \begin_inset Flex CharStyle:Code
10812 \begin_layout Plain Layout
10818 of the environment, not their native one.
10819 For example, Standard paragraphs inside an enumeration are not indented.
10822 \begin_layout Description
10823 \begin_inset Flex CharStyle:Code
10826 \begin_layout Plain Layout
10833 \begin_inset Flex CharStyle:Code
10836 \begin_layout Plain Layout
10842 ] The vertical space between two paragraphs of this layout.
10845 \begin_layout Description
10846 \begin_inset Flex CharStyle:Code
10849 \begin_layout Plain Layout
10856 \begin_inset Flex CharStyle:Code
10859 \begin_layout Plain Layout
10865 ] LyX allows the user to choose either
10866 \begin_inset Quotes eld
10870 \begin_inset Quotes erd
10874 \begin_inset Quotes eld
10878 \begin_inset Quotes erd
10881 to typeset a document.
10883 \begin_inset Quotes eld
10887 \begin_inset Quotes erd
10890 is chosen, this value is completely ignored.
10892 \begin_inset Quotes eld
10896 \begin_inset Quotes erd
10899 is chosen, the parindent of a LaTeXtype
10900 \begin_inset Quotes eld
10904 \begin_inset Quotes erd
10907 layout is ignored and all paragraphs are separated by this parskip argument.
10908 The vertical space is calculated with
10909 \begin_inset Flex CharStyle:Code
10912 \begin_layout Plain Layout
10914 \begin_inset space ~
10923 \begin_inset Flex CharStyle:Code
10926 \begin_layout Plain Layout
10932 is the height of a row with the normal font.
10933 This way, the look stays the same with different screen fonts.
10936 \begin_layout Description
10937 \begin_inset Flex CharStyle:Code
10940 \begin_layout Plain Layout
10947 \begin_inset CommandInset label
10949 name "des:PathThru"
10956 \begin_inset Flex CharStyle:Code
10959 \begin_layout Plain Layout
10970 \begin_inset Flex CharStyle:Code
10973 \begin_layout Plain Layout
10979 ] Whether the contents of this paragraph should be output in raw form, meaning
10980 without special translations that LaTeX would require.
10983 \begin_layout Description
10984 \begin_inset Flex CharStyle:Code
10987 \begin_layout Plain Layout
10994 \begin_inset CommandInset label
10996 name "des:Preamble"
11000 Information to be included in the LaTeX preamble when this style is used.
11001 Used to define macros, load packages, etc., required by this particular
11004 \begin_inset Quotes eld
11008 \begin_inset Flex CharStyle:Code
11011 \begin_layout Plain Layout
11018 \begin_inset Quotes erd
11024 \begin_layout Description
11025 \begin_inset Flex CharStyle:Code
11028 \begin_layout Plain Layout
11035 \begin_inset Flex CharStyle:Code
11038 \begin_layout Plain Layout
11045 \begin_inset CommandInset label
11047 name "des:Requires"
11051 Whether the layout requires the feature
11052 \begin_inset Flex CharStyle:Code
11055 \begin_layout Plain Layout
11062 See the description of
11063 \begin_inset Flex CharStyle:Code
11066 \begin_layout Plain Layout
11073 \begin_inset CommandInset ref
11074 LatexCommand pageref
11075 reference "des:FreeSpacing"
11079 ) for information on `features'.
11083 \begin_layout Description
11084 \begin_inset Flex CharStyle:Code
11087 \begin_layout Plain Layout
11094 \begin_inset Flex CharStyle:Code
11097 \begin_layout Plain Layout
11104 \begin_inset Flex CharStyle:Code
11107 \begin_layout Plain Layout
11116 \begin_layout Description
11117 \begin_inset Flex CharStyle:Code
11120 \begin_layout Plain Layout
11127 \begin_inset Flex CharStyle:Code
11130 \begin_layout Plain Layout
11135 , onehalf, double, other
11144 ] This defines what the default spacing should be in the layout.
11146 \begin_inset Flex CharStyle:Code
11149 \begin_layout Plain Layout
11156 \begin_inset Flex CharStyle:Code
11159 \begin_layout Plain Layout
11166 \begin_inset Flex CharStyle:Code
11169 \begin_layout Plain Layout
11175 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
11176 If you specify the argument
11177 \begin_inset Flex CharStyle:Code
11180 \begin_layout Plain Layout
11186 , then you should also provide a numerical argument which will be the actual
11188 Note that, contrary to other parameters,
11189 \begin_inset Flex CharStyle:Code
11192 \begin_layout Plain Layout
11198 implies the generation of specific LaTeX code, using the package
11201 \begin_inset Flex CharStyle:Code
11204 \begin_layout Plain Layout
11213 \begin_layout Description
11214 \begin_inset Flex CharStyle:Code
11217 \begin_layout Plain Layout
11223 The font used for the text body .
11225 \begin_inset CommandInset ref
11227 reference "sub:Font-description"
11234 \begin_layout Description
11235 \begin_inset Flex CharStyle:Code
11238 \begin_layout Plain Layout
11246 The level of the style in the table of contents.
11247 This is used for automatic numbering of section headings.
11250 \begin_layout Description
11251 \begin_inset Flex CharStyle:Code
11254 \begin_layout Plain Layout
11261 \begin_inset Flex CharStyle:Code
11264 \begin_layout Plain Layout
11270 ] The vertical space with which the very first of a chain of paragraphs
11271 with this layout is separated from the previous paragraph.
11272 If the previous paragraph has another layout, the separations are not simply
11273 added, but the maximum is taken.
11276 \begin_layout Subsection
11278 \begin_inset CommandInset label
11287 \begin_layout Standard
11288 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11289 define the floats (
11290 \begin_inset Flex CharStyle:MenuItem
11293 \begin_layout Plain Layout
11300 \begin_inset Flex CharStyle:MenuItem
11303 \begin_layout Plain Layout
11309 , \SpecialChar \ldots{}
11310 ) in the text class itself.
11311 Standard floats are included in the file
11312 \begin_inset Flex CharStyle:Code
11315 \begin_layout Plain Layout
11321 , so you may have to do no more than add
11324 \begin_layout LyX-Code
11325 Input stdfloats.inc
11328 \begin_layout Standard
11329 to your layout file.
11330 If you want to implement a text class that proposes some other float types
11331 (like the AGU class bundled with LyX), the information below will hopefully
11335 \begin_layout Description
11336 \begin_inset Flex CharStyle:Code
11339 \begin_layout Plain Layout
11346 \begin_inset Flex CharStyle:Code
11349 \begin_layout Plain Layout
11356 \begin_inset Quotes erd
11360 \begin_inset Quotes erd
11363 ] The file name extension of an auxiliary file for the list of figures (or
11365 LaTeX writes the captions to this file.
11368 \begin_layout Description
11369 \begin_inset Flex CharStyle:Code
11372 \begin_layout Plain Layout
11379 \begin_inset Flex CharStyle:Code
11382 \begin_layout Plain Layout
11389 \begin_inset Quotes erd
11393 \begin_inset Quotes erd
11396 ] The string that will be used in the menus and also for the caption.
11398 \change_inserted 2 1244364642
11399 This is translated to the current language if babel is used.
11404 \begin_layout Description
11405 \begin_inset Flex CharStyle:Code
11408 \begin_layout Plain Layout
11415 \begin_inset Flex CharStyle:Code
11418 \begin_layout Plain Layout
11427 \begin_inset Flex CharStyle:Code
11430 \begin_layout Plain Layout
11437 \begin_inset Flex CharStyle:Code
11440 \begin_layout Plain Layout
11446 if the float is already defined by the LaTeX document class.
11448 \begin_inset Flex CharStyle:Code
11451 \begin_layout Plain Layout
11457 , the float will be defined using the LaTeX package
11458 \begin_inset Flex CharStyle:Code
11461 \begin_layout Plain Layout
11470 \begin_layout Description
11471 \begin_inset Flex CharStyle:Code
11474 \begin_layout Plain Layout
11481 \begin_inset Flex CharStyle:Code
11484 \begin_layout Plain Layout
11491 \begin_inset Quotes erd
11495 \begin_inset Quotes erd
11498 ] The heading used for the list of floats.
11500 \change_inserted 2 1244364301
11501 This is translated to the document language.
11506 \begin_layout Description
11507 \begin_inset Flex CharStyle:Code
11510 \begin_layout Plain Layout
11517 \begin_inset Flex CharStyle:Code
11520 \begin_layout Plain Layout
11527 \begin_inset Quotes erd
11531 \begin_inset Quotes erd
11534 ] This (optional) argument determines whether floats of this class will
11535 be numbered within some sectional unit of the document.
11536 For example, if within is equal to
11537 \begin_inset Flex CharStyle:Code
11540 \begin_layout Plain Layout
11546 , the floats will be numbered within chapters.
11550 \begin_layout Description
11551 \begin_inset Flex CharStyle:Code
11554 \begin_layout Plain Layout
11561 \begin_inset Flex CharStyle:Code
11564 \begin_layout Plain Layout
11571 \begin_inset Quotes erd
11575 \begin_inset Quotes erd
11578 ] The default placement for the given class of floats.
11579 The string should be as in standard LaTeX:
11580 \begin_inset Flex CharStyle:Code
11583 \begin_layout Plain Layout
11590 \begin_inset Flex CharStyle:Code
11593 \begin_layout Plain Layout
11600 \begin_inset Flex CharStyle:Code
11603 \begin_layout Plain Layout
11610 \begin_inset Flex CharStyle:Code
11613 \begin_layout Plain Layout
11619 for top, bottom, page, and here, respectively.
11623 \begin_layout Plain Layout
11624 Note that the order of these letters in the string is irrelevant, like in
11630 On top of that there is a new type,
11631 \begin_inset Flex CharStyle:Code
11634 \begin_layout Plain Layout
11640 , which does not really correspond to a float, since it means: put it
11641 \begin_inset Quotes eld
11645 \begin_inset Quotes erd
11649 Note however that the
11650 \begin_inset Flex CharStyle:Code
11653 \begin_layout Plain Layout
11659 specifier is special and, because of implementation details, cannot be
11660 used in non-built in float types.
11661 If you do not understand what this means, just use
11662 \begin_inset Quotes eld
11666 \begin_inset Flex CharStyle:Code
11669 \begin_layout Plain Layout
11676 \begin_inset Quotes erd
11682 \begin_layout Description
11683 \begin_inset Flex CharStyle:Code
11686 \begin_layout Plain Layout
11693 \begin_inset Flex CharStyle:Code
11696 \begin_layout Plain Layout
11703 \begin_inset Quotes erd
11707 \begin_inset Quotes erd
11710 ] The style used when defining the float using
11711 \begin_inset Flex CharStyle:Code
11714 \begin_layout Plain Layout
11725 \begin_layout Description
11726 \begin_inset Flex CharStyle:Code
11729 \begin_layout Plain Layout
11736 \begin_inset Flex CharStyle:Code
11739 \begin_layout Plain Layout
11746 \begin_inset Quotes erd
11750 \begin_inset Quotes erd
11754 \begin_inset Quotes eld
11758 \begin_inset Quotes erd
11761 of the new class of floats, like program or algorithm.
11762 After the appropriate
11763 \begin_inset Flex CharStyle:Code
11766 \begin_layout Plain Layout
11775 \begin_inset Flex CharStyle:Code
11778 \begin_layout Plain Layout
11787 \begin_inset Flex CharStyle:Code
11790 \begin_layout Plain Layout
11801 \begin_layout Standard
11802 Note that defining a float with type
11803 \begin_inset Flex CharStyle:Code
11806 \begin_layout Plain Layout
11814 automatically defines the corresponding counter with name
11815 \begin_inset Flex CharStyle:Code
11818 \begin_layout Plain Layout
11829 \begin_layout Subsection
11830 Flex insets and InsetLayout
11831 \begin_inset CommandInset label
11833 name "sub:Flex-insets-and"
11840 \begin_layout Standard
11841 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11842 these are called Flex insets.
11846 \begin_layout Standard
11847 Flex insets come in three different kinds:
11850 \begin_layout Itemize
11852 \begin_inset Flex CharStyle:Code
11855 \begin_layout Plain Layout
11861 ): These define semantic markup corresponding to such LaTeX commands as
11863 \begin_inset Flex CharStyle:Code
11866 \begin_layout Plain Layout
11875 \begin_inset Flex CharStyle:Code
11878 \begin_layout Plain Layout
11889 \begin_layout Itemize
11891 \begin_inset Flex CharStyle:Code
11894 \begin_layout Plain Layout
11900 ): These can be used to define custom collapsible insets, similar to TeX
11901 code, footnote, and the like.
11902 An obvious example is an endnote inset, which is defined in the
11903 \begin_inset Flex CharStyle:Code
11906 \begin_layout Plain Layout
11915 \begin_layout Itemize
11917 \begin_inset Flex CharStyle:Code
11920 \begin_layout Plain Layout
11926 ): For use with DocBook classes.
11929 \begin_layout Standard
11930 Flex insets are defined using the
11931 \begin_inset Flex CharStyle:Code
11934 \begin_layout Plain Layout
11940 tag, which shall be explained in a moment.
11943 \begin_layout Standard
11945 \begin_inset Flex CharStyle:Code
11948 \begin_layout Plain Layout
11954 tag also serves another function: It can be used to customize the general
11955 layout of many different types of insets.
11957 \begin_inset Flex CharStyle:Code
11960 \begin_layout Plain Layout
11966 can be used to customize the layout parameters for footnotes, marginal
11967 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
11968 boxes, tables, algorithms, URLs, and optional arguments, as well as to
11969 define Flex insets.
11972 \begin_layout Standard
11974 \begin_inset Flex CharStyle:Code
11977 \begin_layout Plain Layout
11983 definition must begin with a line of the form:
11986 \begin_layout LyX-Code
11990 \begin_layout Standard
11992 \begin_inset Flex CharStyle:Code
11995 \begin_layout Plain Layout
12001 indicates the inset whose layout is being defined, and here there are two
12005 \begin_layout Enumerate
12006 The layout for a pre-existing inset is being modified.
12007 In this case, can be
12008 \begin_inset Flex CharStyle:Code
12011 \begin_layout Plain Layout
12017 any one of the following:
12018 \begin_inset Flex CharStyle:Code
12021 \begin_layout Plain Layout
12028 \begin_inset Flex CharStyle:Code
12031 \begin_layout Plain Layout
12038 \begin_inset Flex CharStyle:Code
12041 \begin_layout Plain Layout
12048 \begin_inset Flex CharStyle:Code
12051 \begin_layout Plain Layout
12058 \begin_inset Flex CharStyle:Code
12061 \begin_layout Plain Layout
12068 \begin_inset Flex CharStyle:Code
12071 \begin_layout Plain Layout
12078 \begin_inset Flex CharStyle:Code
12081 \begin_layout Plain Layout
12088 \begin_inset Flex CharStyle:Code
12091 \begin_layout Plain Layout
12098 \begin_inset Flex CharStyle:Code
12101 \begin_layout Plain Layout
12108 \begin_inset Flex CharStyle:Code
12111 \begin_layout Plain Layout
12118 \begin_inset Flex CharStyle:Code
12121 \begin_layout Plain Layout
12128 \begin_inset Flex CharStyle:Code
12131 \begin_layout Plain Layout
12138 \begin_inset Flex CharStyle:Code
12141 \begin_layout Plain Layout
12148 \begin_inset Flex CharStyle:Code
12151 \begin_layout Plain Layout
12158 \begin_inset Flex CharStyle:Code
12161 \begin_layout Plain Layout
12168 \begin_inset Flex CharStyle:Code
12171 \begin_layout Plain Layout
12178 \begin_inset Flex CharStyle:Code
12181 \begin_layout Plain Layout
12188 \begin_inset Flex CharStyle:Code
12191 \begin_layout Plain Layout
12198 \begin_inset Flex CharStyle:Code
12201 \begin_layout Plain Layout
12208 \begin_inset Flex CharStyle:Code
12211 \begin_layout Plain Layout
12221 \begin_layout Enumerate
12222 The layout for a Flex inset is being defined.
12224 \begin_inset Flex CharStyle:Code
12227 \begin_layout Plain Layout
12233 can be any valid identifier not used by a pre-existing inset.
12234 Note that the definition of a flex inset must
12239 \begin_inset Flex CharStyle:Code
12242 \begin_layout Plain Layout
12251 \begin_layout Standard
12253 \begin_inset Flex CharStyle:Code
12256 \begin_layout Plain Layout
12262 definition can contain the following entries:
12265 \begin_layout Description
12266 \begin_inset Flex CharStyle:Code
12269 \begin_layout Plain Layout
12275 The color for the inset's background.
12276 The valid colors are defined in
12277 \begin_inset Flex CharStyle:Code
12280 \begin_layout Plain Layout
12289 \begin_layout Description
12290 \begin_inset Flex CharStyle:Code
12293 \begin_layout Plain Layout
12299 As with paragraph styles (see page
12300 \begin_inset CommandInset ref
12302 reference "des:CopyStyle"
12309 \begin_layout Description
12310 \begin_inset Flex CharStyle:Code
12313 \begin_layout Plain Layout
12320 \begin_inset Flex CharStyle:Code
12323 \begin_layout Plain Layout
12332 \begin_inset Flex CharStyle:Code
12335 \begin_layout Plain Layout
12341 ] Indicates whether the user may employ the Paragraph Settings dialog to
12342 customize the paragraph.
12345 \begin_layout Description
12346 \begin_inset Flex CharStyle:Code
12349 \begin_layout Plain Layout
12356 \begin_inset Flex CharStyle:Code
12359 \begin_layout Plain Layout
12366 \begin_inset Flex CharStyle:Code
12369 \begin_layout Plain Layout
12376 \begin_inset Flex CharStyle:Code
12379 \begin_layout Plain Layout
12385 , describing the rendering style used for the inset's frame and buttons.
12386 Footnotes generally use
12387 \begin_inset Flex CharStyle:Code
12390 \begin_layout Plain Layout
12396 , ERT insets generally
12397 \begin_inset Flex CharStyle:Code
12400 \begin_layout Plain Layout
12406 , and character styles
12407 \begin_inset Flex CharStyle:Code
12410 \begin_layout Plain Layout
12419 \begin_layout Description
12420 \begin_inset Flex CharStyle:Code
12423 \begin_layout Plain Layout
12429 Required at the end of the InsetLayout declarations.
12432 \begin_layout Description
12433 \begin_inset Flex CharStyle:Code
12436 \begin_layout Plain Layout
12442 The font used for both the text body
12448 \begin_inset space ~
12452 \begin_inset CommandInset ref
12454 reference "sub:Font-description"
12459 Note that defining this font automatically defines the
12460 \begin_inset Flex CharStyle:Code
12463 \begin_layout Plain Layout
12469 to the same value, so define this first and define
12470 \begin_inset Flex CharStyle:Code
12473 \begin_layout Plain Layout
12479 later if you want them to be different.
12482 \begin_layout Description
12483 \begin_inset Flex CharStyle:Code
12486 \begin_layout Plain Layout
12493 \begin_inset Quotes eld
12497 \begin_inset Quotes erd
12500 language, leading to Left-to-Right (latin) output, e.
12501 \begin_inset space \thinspace{}
12505 \begin_inset space \space{}
12508 in TeX code or URL.
12512 \begin_layout Description
12513 \begin_inset Flex CharStyle:Code
12516 \begin_layout Plain Layout
12523 \begin_inset Flex CharStyle:Code
12526 \begin_layout Plain Layout
12535 \begin_inset Flex CharStyle:Code
12538 \begin_layout Plain Layout
12544 ] Indicates whether the PlainLayout should be used or, instead, the user
12545 can change the paragraph style used in the inset.
12548 \begin_layout Description
12549 \begin_inset Flex CharStyle:Code
12552 \begin_layout Plain Layout
12558 As with paragraph styles (see page
12559 \begin_inset CommandInset ref
12560 LatexCommand pageref
12561 reference "des:FreeSpacing"
12568 \begin_layout Description
12569 \begin_inset Flex CharStyle:Code
12572 \begin_layout Plain Layout
12579 \begin_inset Flex CharStyle:Code
12582 \begin_layout Plain Layout
12591 \begin_inset Flex CharStyle:Code
12594 \begin_layout Plain Layout
12600 ] Whether to include the contents of this inset in the strings generated
12601 for the `Outline' pane.
12602 One would not, for example, want the content of a footnote in a section
12603 header to be included in the TOC displayed in the outline, but one would
12604 normally want the content of a character style displayed.
12605 Default is false: not to include.
12608 \begin_layout Description
12609 \begin_inset Flex CharStyle:Code
12612 \begin_layout Plain Layout
12618 As with paragraph styles (see page
12619 \begin_inset CommandInset ref
12620 LatexCommand pageref
12621 reference "des:KeepEmpty"
12628 \begin_layout Description
12629 \begin_inset Flex CharStyle:Code
12632 \begin_layout Plain Layout
12638 The font used for the label.
12640 \begin_inset space ~
12644 \begin_inset CommandInset ref
12646 reference "sub:Font-description"
12651 Note that this definition can never appear before
12652 \begin_inset Flex CharStyle:Code
12655 \begin_layout Plain Layout
12661 , lest it be ineffective.
12664 \begin_layout Description
12665 \begin_inset Flex CharStyle:Code
12668 \begin_layout Plain Layout
12674 What will be displayed on the button or elsewhere as the inset label.
12675 Some inset types (TeX code and Branch) modify this label on the fly.
12678 \begin_layout Description
12679 \begin_inset Flex CharStyle:Code
12682 \begin_layout Plain Layout
12688 The name of the corresponding LaTeX stuff.
12689 Either the environment or command name.
12692 \begin_layout Description
12693 \begin_inset Flex CharStyle:Code
12696 \begin_layout Plain Layout
12702 The optional parameter for the corresponding
12703 \begin_inset Flex CharStyle:Code
12706 \begin_layout Plain Layout
12712 stuff, including possible bracket pairs like
12713 \begin_inset Flex CharStyle:Code
12716 \begin_layout Plain Layout
12723 This parameter cannot be changed from within LyX.
12726 \begin_layout Description
12727 \begin_inset Flex CharStyle:Code
12730 \begin_layout Plain Layout
12736 As with paragraph styles (see page
12737 \begin_inset CommandInset ref
12738 LatexCommand pageref
12739 reference "des:LatexType"
12746 \begin_layout Description
12747 \begin_inset Flex CharStyle:Code
12750 \begin_layout Plain Layout
12757 \begin_inset Flex CharStyle:Code
12760 \begin_layout Plain Layout
12767 \begin_inset Flex CharStyle:Code
12770 \begin_layout Plain Layout
12777 \begin_inset Flex CharStyle:Code
12780 \begin_layout Plain Layout
12787 \begin_inset Flex CharStyle:Code
12790 \begin_layout Plain Layout
12796 (indicating a dummy definition ending definitions of charstyles, etc).
12797 This entry is required in and is only meaningful for Flex insets.
12798 Among other things, it determines on which menu this inset will appear.
12801 \begin_layout Description
12802 \begin_inset Flex CharStyle:Code
12805 \begin_layout Plain Layout
12812 \begin_inset Flex CharStyle:Code
12815 \begin_layout Plain Layout
12824 \begin_inset Flex CharStyle:Code
12827 \begin_layout Plain Layout
12833 ] Whether multiple paragraphs are permitted in this inset.
12834 This will also set CustomPars to the same value and ForcePlain to the opposite
12836 These can be reset to other values, if they are used
12843 \begin_layout Description
12844 \begin_inset Flex CharStyle:Code
12847 \begin_layout Plain Layout
12854 \begin_inset Flex CharStyle:Code
12857 \begin_layout Plain Layout
12866 \begin_inset Flex CharStyle:Code
12869 \begin_layout Plain Layout
12875 ] Whether fragile commands in this layout should be
12876 \begin_inset Flex CharStyle:Code
12879 \begin_layout Plain Layout
12892 whether the command should itself be protected.)
12895 \begin_layout Description
12896 \begin_inset Flex CharStyle:Code
12899 \begin_layout Plain Layout
12906 \begin_inset Flex CharStyle:Code
12909 \begin_layout Plain Layout
12918 \begin_inset Flex CharStyle:Code
12921 \begin_layout Plain Layout
12927 ] As with paragraph styles (see page
12928 \begin_inset CommandInset ref
12930 reference "des:PathThru"
12937 \begin_layout Description
12938 \begin_inset Flex CharStyle:Code
12941 \begin_layout Plain Layout
12947 As with paragraph styles (see page
12948 \begin_inset CommandInset ref
12949 LatexCommand pageref
12950 reference "des:Preamble"
12957 \begin_layout Description
12958 \begin_inset Flex CharStyle:Code
12961 \begin_layout Plain Layout
12968 \begin_inset Flex CharStyle:Code
12971 \begin_layout Plain Layout
12977 ] As with paragraph styles (see page
12978 \begin_inset CommandInset ref
12979 LatexCommand pageref
12980 reference "des:Requires"
12987 \begin_layout Subsection
12989 \begin_inset CommandInset label
12991 name "sub:Counters"
12998 \begin_layout Standard
12999 Since version 1.3.0 of LyX, it is both possible and necessary to define the
13001 \begin_inset Flex CharStyle:MenuItem
13004 \begin_layout Plain Layout
13011 \begin_inset Flex CharStyle:MenuItem
13014 \begin_layout Plain Layout
13020 , \SpecialChar \ldots{}
13021 ) in the text class itself.
13022 The standard counters are defined in the file
13023 \begin_inset Flex CharStyle:Code
13026 \begin_layout Plain Layout
13032 , so you may have to do no more than add
13035 \begin_layout LyX-Code
13036 Input stdcounters.inc
13039 \begin_layout Standard
13040 to your layout file to get them to work.
13041 But if you want to define custom counters, then you can do so.
13042 The counter declaration must begin with:
13045 \begin_layout LyX-Code
13049 \begin_layout Standard
13050 where of course `name' is replaced by the name of the counter.
13051 And it must end with
13052 \begin_inset Quotes eld
13056 \begin_inset Flex CharStyle:Code
13059 \begin_layout Plain Layout
13066 \begin_inset Quotes erd
13070 The following parameters can also be used:
13073 \begin_layout Description
13074 \begin_inset Flex CharStyle:Code
13077 \begin_layout Plain Layout
13078 LabelString [string=""]
13083 when this is defined, this string defines how the counter is displayed.
13084 Setting this value sets
13085 \begin_inset Flex CharStyle:Code
13088 \begin_layout Plain Layout
13089 LabelStringAppendix
13095 The following special constructs can be used in the string:
13099 \begin_layout Itemize
13100 \begin_inset Flex CharStyle:Code
13103 \begin_layout Plain Layout
13111 will be replaced by the expansion of the
13112 \begin_inset Flex CharStyle:Code
13115 \begin_layout Plain Layout
13122 \begin_inset Flex CharStyle:Code
13125 \begin_layout Plain Layout
13126 LabelStringAppendix
13132 \begin_inset Flex CharStyle:Code
13135 \begin_layout Plain Layout
13145 \begin_layout Itemize
13146 counter values can be expressed using LaTeX-like macros
13147 \begin_inset Flex CharStyle:Code
13150 \begin_layout Plain Layout
13167 \begin_inset Flex CharStyle:Code
13170 \begin_layout Plain Layout
13182 \begin_layout Plain Layout
13192 Actually, the situation is a bit more complicated: any
13211 other than those described below will produce arabic numerals.
13212 It would not be surprising to see this change in the future.
13218 \begin_inset Flex CharStyle:Code
13221 \begin_layout Plain Layout
13227 : 1, 2, 3,\SpecialChar \ldots{}
13229 \begin_inset Flex CharStyle:Code
13232 \begin_layout Plain Layout
13238 for lower-case letters: a, b, c, \SpecialChar \ldots{}
13240 \begin_inset Flex CharStyle:Code
13243 \begin_layout Plain Layout
13249 for upper-case letters: A, B, C, \SpecialChar \ldots{}
13251 \begin_inset Flex CharStyle:Code
13254 \begin_layout Plain Layout
13260 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13262 \begin_inset Flex CharStyle:Code
13265 \begin_layout Plain Layout
13271 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13273 \begin_inset Flex CharStyle:Code
13276 \begin_layout Plain Layout
13282 for hebrew numerals.
13286 \begin_layout Standard
13287 If LabelString is not defined, a default value is constructed as follows:
13288 if the counter has a master counter
13289 \begin_inset Flex CharStyle:Code
13292 \begin_layout Plain Layout
13299 \begin_inset Flex CharStyle:Code
13302 \begin_layout Plain Layout
13309 \begin_inset Flex CharStyle:Code
13312 \begin_layout Plain Layout
13322 is used; otherwise the string
13323 \begin_inset Flex CharStyle:Code
13326 \begin_layout Plain Layout
13337 \begin_layout Description
13338 \begin_inset Flex CharStyle:Code
13341 \begin_layout Plain Layout
13342 LabelStringAppendix [string=""]
13348 \begin_inset Flex CharStyle:Code
13351 \begin_layout Plain Layout
13357 , but for use in the Appendix.
13360 \begin_layout Description
13361 \begin_inset Flex CharStyle:Code
13364 \begin_layout Plain Layout
13371 \begin_inset Flex CharStyle:Code
13374 \begin_layout Plain Layout
13381 \begin_inset Quotes erd
13385 \begin_inset Quotes erd
13388 ] If this is set to the name of another counter, the present counter will
13389 be reset every time the other one is increased.
13391 \begin_inset Flex CharStyle:Code
13394 \begin_layout Plain Layout
13401 \begin_inset Flex CharStyle:Code
13404 \begin_layout Plain Layout
13413 \begin_layout Subsection
13415 \begin_inset CommandInset label
13417 name "sub:Font-description"
13424 \begin_layout Standard
13425 A font description looks like this:
13428 \begin_layout LyX-Code
13438 \begin_layout LyX-Code
13442 \begin_layout LyX-Code
13446 \begin_layout Standard
13447 The following commands are available:
13450 \begin_layout Description
13451 \begin_inset Flex CharStyle:Code
13454 \begin_layout Plain Layout
13461 \begin_inset Flex CharStyle:Code
13464 \begin_layout Plain Layout
13473 \begin_inset Flex CharStyle:Code
13476 \begin_layout Plain Layout
13483 \begin_inset Flex CharStyle:Code
13486 \begin_layout Plain Layout
13493 \begin_inset Flex CharStyle:Code
13496 \begin_layout Plain Layout
13503 \begin_inset Flex CharStyle:Code
13506 \begin_layout Plain Layout
13513 \begin_inset Flex CharStyle:Code
13516 \begin_layout Plain Layout
13523 \begin_inset Flex CharStyle:Code
13526 \begin_layout Plain Layout
13533 \begin_inset Flex CharStyle:Code
13536 \begin_layout Plain Layout
13543 \begin_inset Flex CharStyle:Code
13546 \begin_layout Plain Layout
13555 \begin_layout Description
13556 \begin_inset Flex CharStyle:Code
13559 \begin_layout Plain Layout
13568 \begin_inset Flex CharStyle:Code
13571 \begin_layout Plain Layout
13582 \begin_inset Flex CharStyle:Code
13585 \begin_layout Plain Layout
13592 \begin_inset Flex CharStyle:Code
13595 \begin_layout Plain Layout
13604 \begin_layout Description
13605 \begin_inset Flex CharStyle:Code
13608 \begin_layout Plain Layout
13615 \begin_inset Flex CharStyle:Code
13618 \begin_layout Plain Layout
13624 ] Valid argument are:
13625 \begin_inset Flex CharStyle:Code
13628 \begin_layout Plain Layout
13635 \begin_inset Flex CharStyle:Code
13638 \begin_layout Plain Layout
13645 \begin_inset Flex CharStyle:Code
13648 \begin_layout Plain Layout
13655 \begin_inset Flex CharStyle:Code
13658 \begin_layout Plain Layout
13665 \begin_inset Flex CharStyle:Code
13668 \begin_layout Plain Layout
13675 \begin_inset Flex CharStyle:Code
13678 \begin_layout Plain Layout
13685 Each of these turns on or off the corresponding attribute.
13688 \begin_layout Description
13689 \begin_inset Flex CharStyle:Code
13692 \begin_layout Plain Layout
13701 \begin_inset Flex CharStyle:Code
13704 \begin_layout Plain Layout
13715 \begin_inset Flex CharStyle:Code
13718 \begin_layout Plain Layout
13727 \begin_layout Description
13728 \begin_inset Flex CharStyle:Code
13731 \begin_layout Plain Layout
13740 \begin_inset Flex CharStyle:Code
13743 \begin_layout Plain Layout
13754 \begin_inset Flex CharStyle:Code
13757 \begin_layout Plain Layout
13764 \begin_inset Flex CharStyle:Code
13767 \begin_layout Plain Layout
13774 \begin_inset Flex CharStyle:Code
13777 \begin_layout Plain Layout
13786 \begin_layout Description
13787 \begin_inset Flex CharStyle:Code
13790 \begin_layout Plain Layout
13797 \begin_inset Flex CharStyle:Code
13800 \begin_layout Plain Layout
13807 \begin_inset Flex CharStyle:Code
13810 \begin_layout Plain Layout
13817 \begin_inset Flex CharStyle:Code
13820 \begin_layout Plain Layout
13829 \begin_inset Flex CharStyle:Code
13832 \begin_layout Plain Layout
13839 \begin_inset Flex CharStyle:Code
13842 \begin_layout Plain Layout
13849 \begin_inset Flex CharStyle:Code
13852 \begin_layout Plain Layout
13859 \begin_inset Flex CharStyle:Code
13862 \begin_layout Plain Layout
13869 \begin_inset Flex CharStyle:Code
13872 \begin_layout Plain Layout
13881 \begin_layout Subsection
13882 Upgrading old layout files
13885 \begin_layout Standard
13886 The file format of layout files changes from time to time, so old layout
13887 files need to be converted.
13888 This process has been automated since LyX 1.4.0: If LyX reads an old format
13889 layout file it will call the conversion tool
13890 \begin_inset Flex CharStyle:Code
13893 \begin_layout Plain Layout
13894 LyXDir/scripts/layout2layout.py
13899 and convert it to a temporary file in current format.
13900 The original file is left untouched.
13901 If you want to convert the layout file permanently, just call the converter
13905 \begin_layout LyX-Code
13906 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13909 \begin_layout Standard
13910 (You need to replace
13911 \begin_inset Flex CharStyle:Code
13914 \begin_layout Plain Layout
13920 with the name of your LyX system directory, unless you happen to have defined
13921 such an environment variable.) Then copy
13922 \begin_inset Flex CharStyle:Code
13925 \begin_layout Plain Layout
13932 \begin_inset Flex CharStyle:Code
13935 \begin_layout Plain Layout
13944 \begin_layout Standard
13945 The automatic conversion only handles syntax changes.
13946 It cannot handle the case where the contents of included files was changed,
13947 so these will have to be converted separately.
13950 \begin_layout Section
13952 \begin_inset CommandInset label
13954 name "sec:Creating-Templates"
13961 \begin_layout Standard
13962 Templates are created just like usual documents.
13963 The only difference is that usual documents contain all possible settings,
13964 including the font scheme and the paper size.
13965 Usually a user doesn't want a template to overwrite his defaults in these
13967 For that reason, the designer of a template should remove the corresponding
13969 \begin_inset Flex CharStyle:Code
13972 \begin_layout Plain Layout
13981 \begin_inset Flex CharStyle:Code
13984 \begin_layout Plain Layout
13992 from the template LyX file.
13993 This can be done with any simple text-editor, for example
13994 \begin_inset Flex CharStyle:Code
13997 \begin_layout Plain Layout
14004 \begin_inset Flex CharStyle:Code
14007 \begin_layout Plain Layout
14017 \begin_layout Standard
14018 Put the edited template files you create in
14019 \begin_inset Flex CharStyle:Code
14022 \begin_layout Plain Layout
14028 , copy the ones you use from the global template directory in
14029 \begin_inset Flex CharStyle:Code
14032 \begin_layout Plain Layout
14038 to the same place, and redefine the template path in the
14039 \begin_inset Flex CharStyle:MenuItem
14042 \begin_layout Plain Layout
14043 Tools\SpecialChar \menuseparator
14044 Preferences\SpecialChar \menuseparator
14053 \begin_layout Standard
14054 Note that there is a template which has a particular meaning:
14055 \begin_inset Flex CharStyle:Code
14058 \begin_layout Plain Layout
14065 This template is loaded every time you create a new document with
14066 \begin_inset Flex CharStyle:MenuItem
14069 \begin_layout Plain Layout
14070 File\SpecialChar \menuseparator
14076 in order to provide useful defaults.
14077 To create this template from inside LyX, all you have to do is to open
14078 a document with the correct settings, and use the
14079 \begin_inset Flex CharStyle:MenuItem
14082 \begin_layout Plain Layout
14083 Save as Document Defaults
14091 \begin_layout Chapter
14092 Including External Material
14095 \begin_layout Standard
14096 \begin_inset Box Shadowbox
14105 height_special "totalheight"
14108 \begin_layout Plain Layout
14109 WARNING: This portion of the documentation has not been updated for some
14111 We certainly hope that it is still accurate, but there are no guarantees.
14119 \begin_layout Standard
14120 The use of material from sources external to LyX is covered in detail in
14126 This part of the manual covers what needs to happen behind the scenes for
14127 new sorts of material to be included.
14130 \begin_layout Section
14134 \begin_layout Standard
14135 The external material feature is based on the concept of a
14140 A template is a specification of how LyX should interface with a certain
14142 As bundled, LyX comes with predefined templates for Xfig figures, various
14143 raster format images, chess diagrams, and LilyPond music notation.
14144 You can check the actual list by using the menu
14145 \begin_inset Flex CharStyle:MenuItem
14148 \begin_layout Plain Layout
14149 Insert\SpecialChar \menuseparator
14150 File\SpecialChar \menuseparator
14157 Furthermore, it is possible to roll your own template to support a specific
14159 Later we'll describe in more detail what is involved, and hopefully you
14160 will submit all the templates you create so we can include them in a later
14164 \begin_layout Standard
14165 Another basic idea of the external material feature is to distinguish between
14166 the original file that serves as a base for final material and the produced
14167 file that is included in your exported or printed document.
14168 For example, consider the case of a figure produced with
14169 \begin_inset Flex CharStyle:Code
14172 \begin_layout Plain Layout
14179 The Xfig application itself works on an original file with the
14180 \begin_inset Flex CharStyle:Code
14183 \begin_layout Plain Layout
14190 Within Xfig, you create and change your figure, and when you are done,
14192 \begin_inset Flex CharStyle:Code
14195 \begin_layout Plain Layout
14202 When you want to include the figure in your document, you invoke
14203 \begin_inset Flex CharStyle:Code
14206 \begin_layout Plain Layout
14212 in order to create a PostScript file that can readily be included in your
14215 \begin_inset Flex CharStyle:Code
14218 \begin_layout Plain Layout
14224 file is the original file, and the PostScript file is the produced file.
14227 \begin_layout Standard
14228 This distinction is important in order to allow updating of the material
14229 while you are in the process of writing the document.
14230 Furthermore, it provides us with the flexibility that is needed to support
14231 multiple export formats.
14232 For instance, in the case of a plain text file, it is not exactly an award-winn
14233 ing idea to include the figure as raw PostScript.
14234 Instead, you'd either prefer to just include a reference to the figure
14235 or try to invoke some graphics to ASCII converter to make the final result
14236 look similar to the real graphics.
14237 The external material management allows you to do this, because it is parametri
14238 zed on the different export formats that LyX supports.
14241 \begin_layout Standard
14242 Besides supporting the production of different products according to the
14243 exported format, it supports tight integration with editing and viewing
14245 In the case of an Xfig figure, you are able to invoke Xfig on the original
14246 file with a single click from within the external material dialog in LyX,
14247 and also preview the produced PostScript file with Ghostview with another
14249 No more fiddling around with the command line and/or file browsers to locate
14250 and manipulate the original or produced files.
14251 In this way, you are finally able to take full advantage of the many different
14252 applications that are relevant to use when you write your documents, and
14253 ultimately be more productive.
14256 \begin_layout Section
14257 The external template configuration file
14260 \begin_layout Standard
14261 It is relatively easy to add custom external template definitions to LyX.
14262 However, be aware that doing this in an careless manner most probably
14266 introduce an easily exploitable security hole.
14267 So before you do this, please read the discussion about security in section
14269 \begin_inset CommandInset ref
14271 reference "sec:Security-discussion"
14278 \begin_layout Standard
14279 Having said that, we encourage you to submit any interesting templates that
14284 \begin_layout Standard
14285 The external templates are defined in the
14286 \begin_inset Flex CharStyle:Code
14289 \begin_layout Plain Layout
14290 LyXDir/lib/external_templates
14296 You can place your own version in
14297 \begin_inset Flex CharStyle:Code
14300 \begin_layout Plain Layout
14301 UserDir/external_templates
14309 \begin_layout Standard
14310 A typical template looks like this:
14313 \begin_layout LyX-Code
14317 \begin_layout LyX-Code
14318 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14321 \begin_layout LyX-Code
14325 \begin_layout LyX-Code
14329 \begin_layout LyX-Code
14333 \begin_layout LyX-Code
14337 \begin_layout LyX-Code
14341 \begin_layout LyX-Code
14342 AutomaticProduction true
14345 \begin_layout LyX-Code
14349 \begin_layout LyX-Code
14353 \begin_layout LyX-Code
14357 \begin_layout LyX-Code
14358 TransformCommand Rotate RotationLatexCommand
14361 \begin_layout LyX-Code
14362 TransformCommand Resize ResizeLatexCommand
14365 \begin_layout LyX-Code
14366 Product "$$RotateFront$$ResizeFront
14369 \begin_layout LyX-Code
14374 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14377 \begin_layout LyX-Code
14378 $$ResizeBack$$RotateBack"
14381 \begin_layout LyX-Code
14385 \begin_layout LyX-Code
14386 UpdateResult "$$AbsPath$$Basename.pstex_t"
14389 \begin_layout LyX-Code
14390 Requirement "graphicx"
14393 \begin_layout LyX-Code
14394 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14397 \begin_layout LyX-Code
14398 ReferencedFile latex "$$AbsPath$$Basename.eps"
14401 \begin_layout LyX-Code
14402 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14405 \begin_layout LyX-Code
14409 \begin_layout LyX-Code
14413 \begin_layout LyX-Code
14414 TransformCommand Rotate RotationLatexCommand
14417 \begin_layout LyX-Code
14418 TransformCommand Resize ResizeLatexCommand
14421 \begin_layout LyX-Code
14422 Product "$$RotateFront$$ResizeFront
14425 \begin_layout LyX-Code
14430 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14433 \begin_layout LyX-Code
14434 $$ResizeBack$$RotateBack"
14437 \begin_layout LyX-Code
14438 UpdateFormat pdftex
14441 \begin_layout LyX-Code
14442 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14445 \begin_layout LyX-Code
14446 Requirement "graphicx"
14449 \begin_layout LyX-Code
14450 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14453 \begin_layout LyX-Code
14454 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14457 \begin_layout LyX-Code
14461 \begin_layout LyX-Code
14465 \begin_layout LyX-Code
14466 Product "$$Contents(
14468 "$$AbsPath$$Basename.asc
14473 \begin_layout LyX-Code
14474 UpdateFormat asciixfig
14477 \begin_layout LyX-Code
14478 UpdateResult "$$AbsPath$$Basename.asc"
14481 \begin_layout LyX-Code
14485 \begin_layout LyX-Code
14489 \begin_layout LyX-Code
14490 Product "<graphic fileref=
14492 "$$AbsOrRelPathMaster$$Basename.eps
14497 \begin_layout LyX-Code
14501 \begin_layout LyX-Code
14505 \begin_layout LyX-Code
14506 UpdateResult "$$AbsPath$$Basename.eps"
14509 \begin_layout LyX-Code
14510 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14513 \begin_layout LyX-Code
14514 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14517 \begin_layout LyX-Code
14521 \begin_layout LyX-Code
14522 Product "[XFig: $$FName]"
14525 \begin_layout LyX-Code
14529 \begin_layout LyX-Code
14533 \begin_layout Standard
14534 As you can see, the template is enclosed in
14535 \begin_inset Flex CharStyle:Code
14538 \begin_layout Plain Layout
14544 \SpecialChar \ldots{}
14546 \begin_inset Flex CharStyle:Code
14549 \begin_layout Plain Layout
14556 It contains a header specifying some general settings and, for each supported
14557 primary document file format, a section
14558 \begin_inset Flex CharStyle:Code
14561 \begin_layout Plain Layout
14567 \SpecialChar \ldots{}
14569 \begin_inset Flex CharStyle:Code
14572 \begin_layout Plain Layout
14581 \begin_layout Subsection
14582 The template header
14585 \begin_layout Description
14586 \begin_inset Flex CharStyle:Code
14589 \begin_layout Plain Layout
14590 AutomaticProduction
14591 \begin_inset space ~
14599 Whether the file represented by the template must be generated by LyX.
14600 This command must occur exactly once.
14603 \begin_layout Description
14604 \begin_inset Flex CharStyle:Code
14607 \begin_layout Plain Layout
14609 \begin_inset space ~
14617 A glob pattern that is used in the file dialog to filter out the desired
14619 If there is more than one possible file extension (e.
14620 \begin_inset space \thinspace{}
14624 \begin_inset space \space{}
14628 \begin_inset Flex CharStyle:Code
14631 \begin_layout Plain Layout
14638 \begin_inset Flex CharStyle:Code
14641 \begin_layout Plain Layout
14647 ), use something like
14648 \begin_inset Flex CharStyle:Code
14651 \begin_layout Plain Layout
14658 This command must occur exactly once.
14661 \begin_layout Description
14662 \begin_inset Flex CharStyle:Code
14665 \begin_layout Plain Layout
14667 \begin_inset space ~
14675 The text that is displayed on the button.
14676 This command must occur exactly once.
14679 \begin_layout Description
14680 \begin_inset Flex CharStyle:Code
14683 \begin_layout Plain Layout
14685 \begin_inset space ~
14689 \begin_inset space ~
14697 The help text that is used in the External dialog.
14698 Provide enough information to explain to the user just what the template
14699 can provide him with.
14700 This command must occur exactly once.
14703 \begin_layout Description
14704 \begin_inset Flex CharStyle:Code
14707 \begin_layout Plain Layout
14709 \begin_inset space ~
14717 The file format of the original file.
14718 This must be the name of a format that is known to LyX (see section
14719 \begin_inset CommandInset ref
14721 reference "sec:Formats"
14727 \begin_inset Quotes eld
14731 \begin_inset Flex CharStyle:Code
14734 \begin_layout Plain Layout
14741 \begin_inset Quotes erd
14744 if the template can handle original files of more than one format.
14745 LyX will attempt to interrogate the file itself in order to deduce its
14746 format in this case.
14747 This command must occur exactly once.
14750 \begin_layout Description
14751 \begin_inset Flex CharStyle:Code
14754 \begin_layout Plain Layout
14756 \begin_inset space ~
14764 A unique name for the template.
14765 It must not contain substitution macros (see below).
14768 \begin_layout Description
14769 \begin_inset Flex CharStyle:Code
14772 \begin_layout Plain Layout
14774 \begin_inset space ~
14777 Rotate|Resize|Clip|Extra
14782 This command specifies which transformations are supported by this template.
14783 It may occur zero or more times.
14784 This command enables the corresponding tabs in the external dialog.
14786 \begin_inset Flex CharStyle:Code
14789 \begin_layout Plain Layout
14795 command must have either a corresponding
14796 \begin_inset Flex CharStyle:Code
14799 \begin_layout Plain Layout
14806 \begin_inset Flex CharStyle:Code
14809 \begin_layout Plain Layout
14816 \begin_inset Flex CharStyle:Code
14819 \begin_layout Plain Layout
14826 Otherwise the transformation will not be supported by that format.
14829 \begin_layout Subsection
14833 \begin_layout Description
14834 \begin_inset Flex CharStyle:Code
14837 \begin_layout Plain Layout
14839 \begin_inset space ~
14842 LaTeX|PDFLaTeX|PlainText|DocBook
14847 The primary document file format that this format definition is for.
14848 Not every template has a sensible representation in all document file formats.
14849 Please define nevertheless a
14850 \begin_inset Flex CharStyle:Code
14853 \begin_layout Plain Layout
14859 section for all formats.
14860 Use a dummy text when no representation is available.
14861 Then you can at least see a reference to the external material in the exported
14865 \begin_layout Description
14866 \begin_inset Flex CharStyle:Code
14869 \begin_layout Plain Layout
14871 \begin_inset space ~
14875 \begin_inset space ~
14883 This command defines an additional macro
14884 \begin_inset Flex CharStyle:Code
14887 \begin_layout Plain Layout
14893 for substitution in
14894 \begin_inset Flex CharStyle:Code
14897 \begin_layout Plain Layout
14905 \begin_inset Flex CharStyle:Code
14908 \begin_layout Plain Layout
14914 itself may contain substitution macros.
14915 The advantage over using
14916 \begin_inset Flex CharStyle:Code
14919 \begin_layout Plain Layout
14926 \begin_inset Flex CharStyle:Code
14929 \begin_layout Plain Layout
14935 is that the substituted value of
14936 \begin_inset Flex CharStyle:Code
14939 \begin_layout Plain Layout
14945 is sanitized so that it is a valid optional argument in the document format.
14946 This command may occur zero or more times.
14949 \begin_layout Description
14950 \begin_inset Flex CharStyle:Code
14953 \begin_layout Plain Layout
14955 \begin_inset space ~
14963 The text that is inserted in the exported document.
14964 This is actually the most important command and can be quite complex.
14965 This command must occur exactly once.
14968 \begin_layout Description
14969 \begin_inset Flex CharStyle:Code
14972 \begin_layout Plain Layout
14974 \begin_inset space ~
14982 This command specifies a preamble snippet that will be included in the
14984 It has to be defined using
14985 \begin_inset Flex CharStyle:Code
14988 \begin_layout Plain Layout
14994 \SpecialChar \ldots{}
14996 \begin_inset Flex CharStyle:Code
14999 \begin_layout Plain Layout
15006 This command may occur zero or more times.
15009 \begin_layout Description
15010 \begin_inset Flex CharStyle:Code
15013 \begin_layout Plain Layout
15015 \begin_inset space ~
15019 \begin_inset space ~
15027 This command denotes files that are created by the conversion process and
15028 are needed for a particular export format.
15029 If the filename is relative, it is interpreted relative to the master document.
15030 This command may be given zero or more times.
15033 \begin_layout Description
15034 \begin_inset Flex CharStyle:Code
15037 \begin_layout Plain Layout
15039 \begin_inset space ~
15047 The name of a required LaTeX package.
15048 The package is included via
15049 \begin_inset Flex CharStyle:Code
15052 \begin_layout Plain Layout
15060 in the LaTeX preamble.
15061 This command may occur zero or more times.
15064 \begin_layout Description
15065 \begin_inset Flex CharStyle:Code
15068 \begin_layout Plain Layout
15070 \begin_inset space ~
15074 \begin_inset space ~
15077 RotationLatexCommand
15082 This command specifies that the built in LaTeX command should be used for
15084 This command may occur once or not at all.
15087 \begin_layout Description
15088 \begin_inset Flex CharStyle:Code
15091 \begin_layout Plain Layout
15093 \begin_inset space ~
15097 \begin_inset space ~
15105 This command specifies that the built in LaTeX command should be used for
15107 This command may occur once or not at all.
15110 \begin_layout Description
15111 \begin_inset Flex CharStyle:Code
15114 \begin_layout Plain Layout
15116 \begin_inset space ~
15120 \begin_inset space ~
15123 RotationLatexOption
15128 This command specifies that rotation is done via an optional argument.
15129 This command may occur once or not at all.
15132 \begin_layout Description
15133 \begin_inset Flex CharStyle:Code
15136 \begin_layout Plain Layout
15138 \begin_inset space ~
15142 \begin_inset space ~
15150 This command specifies that resizing is done via an optional argument.
15151 This command may occur once or not at all.
15154 \begin_layout Description
15155 \begin_inset Flex CharStyle:Code
15158 \begin_layout Plain Layout
15160 \begin_inset space ~
15164 \begin_inset space ~
15172 This command specifies that clipping is done via an optional argument.
15173 This command may occur once or not at all.
15176 \begin_layout Description
15177 \begin_inset Flex CharStyle:Code
15180 \begin_layout Plain Layout
15182 \begin_inset space ~
15186 \begin_inset space ~
15194 This command specifies that an extra optional argument is used.
15195 This command may occur once or not at all.
15198 \begin_layout Description
15199 \begin_inset Flex CharStyle:Code
15202 \begin_layout Plain Layout
15204 \begin_inset space ~
15212 The file format of the converted file.
15213 This must be the name of a format that is known to LyX (see the
15214 \begin_inset Flex CharStyle:MenuItem
15217 \begin_layout Plain Layout
15222 ools\SpecialChar \menuseparator
15227 references:Conversion
15233 This command must occur exactly once.
15236 \begin_layout Description
15237 \begin_inset Flex CharStyle:Code
15240 \begin_layout Plain Layout
15242 \begin_inset space ~
15250 The file name of the converted file.
15251 The file name must be absolute.
15252 This command must occur exactly once.
15255 \begin_layout Subsection
15256 Preamble definitions
15259 \begin_layout Standard
15260 The external template configuration file may contain additional preamble
15261 definitions enclosed by
15262 \begin_inset Flex CharStyle:Code
15265 \begin_layout Plain Layout
15271 \SpecialChar \ldots{}
15273 \begin_inset Flex CharStyle:Code
15276 \begin_layout Plain Layout
15283 They can be used by the templates in the
15284 \begin_inset Flex CharStyle:Code
15287 \begin_layout Plain Layout
15296 \begin_layout Section
15297 The substitution mechanism
15300 \begin_layout Standard
15301 When the external material facility invokes an external program, it is done
15302 on the basis of a command defined in the template configuration file.
15303 These commands can contain various macros that are expanded before execution.
15304 Execution always take place in the directory of the containing document.
15307 \begin_layout Standard
15308 Also, whenever external material is to be displayed, the name will be produced
15309 by the substitution mechanism, and most other commands in the template
15310 definition support substitution as well.
15313 \begin_layout Standard
15314 The available macros are the following:
15317 \begin_layout Description
15318 \begin_inset Flex CharStyle:Code
15321 \begin_layout Plain Layout
15322 $$AbsOrRelPathMaster
15327 The file path, absolute or relative to the master LyX document.
15330 \begin_layout Description
15331 \begin_inset Flex CharStyle:Code
15334 \begin_layout Plain Layout
15335 $$AbsOrRelPathParent
15340 The file path, absolute or relative to the LyX document.
15343 \begin_layout Description
15344 \begin_inset Flex CharStyle:Code
15347 \begin_layout Plain Layout
15353 The absolute file path.
15356 \begin_layout Description
15357 \begin_inset Flex CharStyle:Code
15360 \begin_layout Plain Layout
15366 The filename without path and without the extension.
15369 \begin_layout Description
15370 \begin_inset Flex CharStyle:Code
15373 \begin_layout Plain Layout
15375 \begin_inset Quotes eld
15379 \begin_inset Quotes erd
15387 This macro will expand to the contents of the file with the name
15388 \begin_inset Flex CharStyle:Code
15391 \begin_layout Plain Layout
15400 \begin_layout Description
15401 \begin_inset Flex CharStyle:Code
15404 \begin_layout Plain Layout
15410 The file extension (including the dot).
15413 \begin_layout Description
15414 \begin_inset Flex CharStyle:Code
15417 \begin_layout Plain Layout
15423 The filename of the file specified in the external material dialog.
15424 This is either an absolute name, or it is relative to the LyX document.
15427 \begin_layout Description
15428 \begin_inset Flex CharStyle:Code
15431 \begin_layout Plain Layout
15438 \begin_inset Flex CharStyle:Code
15441 \begin_layout Plain Layout
15447 (absolute name or relative to the LyX document).
15450 \begin_layout Description
15451 \begin_inset Flex CharStyle:Code
15454 \begin_layout Plain Layout
15460 The file path, relative to the master LyX document.
15463 \begin_layout Description
15464 \begin_inset Flex CharStyle:Code
15467 \begin_layout Plain Layout
15473 The file path, relative to the LyX document.
15476 \begin_layout Description
15477 \begin_inset Flex CharStyle:Code
15480 \begin_layout Plain Layout
15486 This macro will expand to the absolute path of the system directory.
15487 This is typically used to point to the various helper scripts that are
15491 \begin_layout Description
15492 \begin_inset Flex CharStyle:Code
15495 \begin_layout Plain Layout
15501 A name and full path to a temporary file which will be automatically deleted
15502 whenever the containing document is closed, or the external material insertion
15506 \begin_layout Standard
15507 All path macros contain a trailing directory separator, so you can construct
15509 \begin_inset space \thinspace{}
15513 \begin_inset space \space{}
15516 the absolute filename with
15517 \begin_inset Flex CharStyle:Code
15520 \begin_layout Plain Layout
15521 $$AbsPath$$Basename$$Extension
15529 \begin_layout Standard
15530 The macros above are substituted in all commands unless otherwise noted.
15532 \begin_inset Flex CharStyle:Code
15535 \begin_layout Plain Layout
15541 supports additionally the following substitutions if they are enabled by
15543 \begin_inset Flex CharStyle:Code
15546 \begin_layout Plain Layout
15553 \begin_inset Flex CharStyle:Code
15556 \begin_layout Plain Layout
15565 \begin_layout Description
15566 \begin_inset Flex CharStyle:Code
15569 \begin_layout Plain Layout
15575 The front part of the resize command.
15578 \begin_layout Description
15579 \begin_inset Flex CharStyle:Code
15582 \begin_layout Plain Layout
15588 The back part of the resize command.
15591 \begin_layout Description
15592 \begin_inset Flex CharStyle:Code
15595 \begin_layout Plain Layout
15601 The front part of the rotation command.
15604 \begin_layout Description
15605 \begin_inset Flex CharStyle:Code
15608 \begin_layout Plain Layout
15614 The back part of the rotation command.
15617 \begin_layout Standard
15618 The value string of the
15619 \begin_inset Flex CharStyle:Code
15622 \begin_layout Plain Layout
15628 command supports additionally the following substitutions if they are enabled
15630 \begin_inset Flex CharStyle:Code
15633 \begin_layout Plain Layout
15640 \begin_inset Flex CharStyle:Code
15643 \begin_layout Plain Layout
15652 \begin_layout Description
15653 \begin_inset Flex CharStyle:Code
15656 \begin_layout Plain Layout
15665 \begin_layout Description
15666 \begin_inset Flex CharStyle:Code
15669 \begin_layout Plain Layout
15678 \begin_layout Description
15679 \begin_inset Flex CharStyle:Code
15682 \begin_layout Plain Layout
15691 \begin_layout Description
15692 \begin_inset Flex CharStyle:Code
15695 \begin_layout Plain Layout
15701 The rotation option.
15704 \begin_layout Standard
15705 You may ask why there are so many path macros.
15706 There are mainly two reasons:
15709 \begin_layout Enumerate
15710 Relative and absolute file names should remain relative or absolute, respectivel
15712 Users may have reasons to prefer either form.
15713 Relative names are useful for portable documents that should work on different
15714 machines, for example.
15715 Absolute names may be required by some programs.
15718 \begin_layout Enumerate
15719 LaTeX treats relative file names differently than LyX and other programs
15720 in nested included files.
15721 For LyX, a relative file name is always relative to the document that contains
15723 For LaTeX, it is always relative to the master document.
15724 These two definitions are identical if you have only one document, but
15725 differ if you have a master document that includes part documents.
15726 That means that relative filenames must be transformed when presented to
15728 Fortunately LyX does this automatically for you if you choose the right
15732 \begin_layout Standard
15733 So which path macro should be used in new template definitions? The rule
15737 \begin_layout Itemize
15739 \begin_inset Flex CharStyle:Code
15742 \begin_layout Plain Layout
15748 if an absolute path is required.
15751 \begin_layout Itemize
15753 \begin_inset Flex CharStyle:Code
15756 \begin_layout Plain Layout
15757 $$AbsOrRelPathMaster
15762 if the substituted string is some kind of LaTeX input.
15765 \begin_layout Itemize
15767 \begin_inset Flex CharStyle:Code
15770 \begin_layout Plain Layout
15771 $$AbsOrRelPathParent
15776 in order to preserve the user's choice.
15779 \begin_layout Standard
15780 There are special cases where this rule does not work and e.
15781 \begin_inset space \thinspace{}
15785 \begin_inset space \space{}
15788 relative names are needed, but normally it will work just fine.
15789 One example for such a case is the command
15790 \begin_inset Flex CharStyle:Code
15793 \begin_layout Plain Layout
15794 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15799 in the XFig template above: We can't use the absolute name because the
15801 \begin_inset Flex CharStyle:Code
15804 \begin_layout Plain Layout
15810 files needs the relative name in order to rewrite the file content.
15813 \begin_layout Section
15814 Security discussion
15815 \begin_inset CommandInset label
15817 name "sec:Security-discussion"
15824 \begin_layout Standard
15825 The external material feature interfaces with a lot of external programs
15826 and does so automatically, so we have to consider the security implications
15828 In particular, since you have the option of including your own filenames
15829 and/or parameter strings and those are expanded into a command, it seems
15830 that it would be possible to create a malicious document which executes
15831 arbitrary commands when a user views or prints the document.
15832 This is something we definitely want to avoid.
15835 \begin_layout Standard
15836 However, since the external program commands are specified in the template
15837 configuration file only, there are no security issues if LyX is properly
15838 configured with safe templates only.
15839 This is so because the external programs are invoked with the
15840 \begin_inset Flex CharStyle:Code
15843 \begin_layout Plain Layout
15849 -system call rather than the
15850 \begin_inset Flex CharStyle:Code
15853 \begin_layout Plain Layout
15859 system-call, so it's not possible to execute arbitrary commands from the
15860 filename or parameter section via the shell.
15863 \begin_layout Standard
15864 This also implies that you are restricted in what command strings you can
15865 use in the external material templates.
15866 In particular, pipes and redirection are not readily available.
15867 This has to be so if LyX should remain safe.
15868 If you want to use some of the shell features, you should write a safe
15869 script to do this in a controlled manner, and then invoke the script from
15870 the command string.
15874 \begin_layout Standard
15875 It is possible to design a template that interacts directly with the shell,
15876 but since this would allow a malicious user to execute arbitrary commands
15877 by writing clever filenames and/or parameters, we generally recommend that
15878 you only use safe scripts that work with the
15879 \begin_inset Flex CharStyle:Code
15882 \begin_layout Plain Layout
15888 system call in a controlled manner.
15889 Of course, for use in a controlled environment, it can be tempting to just
15890 fall back to use ordinary shell scripts.
15891 If you do so, be aware that you
15895 provide an easily exploitable security hole in your system.
15896 Of course it stands to reason that such unsafe templates will never be
15897 included in the standard LyX distribution, although we do encourage people
15898 to submit new templates in the open source tradition.
15899 But LyX as shipped from the official distribution channels will never have
15903 \begin_layout Standard
15904 Including external material provides a lot of power, and you have to be
15905 careful not to introduce security hazards with this power.
15906 A subtle error in a single line in an innocent looking script can open
15907 the door to huge security problems.
15908 So if you do not fully understand the issues, we recommend that you consult
15909 a knowledgeable security professional or the LyX development team if you
15910 have any questions about whether a given template is safe or not.
15911 And do this before you use it in an uncontrolled environment.