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"
104 \paperorientation portrait
117 \paragraph_separation indent
118 \paragraph_indentation default
119 \quotes_language english
122 \paperpagestyle headings
123 \tracking_changes false
124 \output_changes false
130 Customizing LyX: Features for the Advanced User
138 \begin_layout Plain Layout
140 If you have comments or error corrections, please send them to the LyX Documenta
142 \begin_inset CommandInset href
144 target "lyx-docs@lists.lyx.org"
151 \begin_inset Quotes eld
155 \begin_inset Quotes erd
158 in the subject header, and please cc the current maintainer of this file,
159 Richard Heck <rgheck@comcast.net>.
165 \begin_inset Newline newline
169 \begin_inset Newline newline
175 \begin_layout Standard
176 \begin_inset CommandInset toc
177 LatexCommand tableofcontents
184 \begin_layout Standard
185 \begin_inset Note Note
188 \begin_layout Plain Layout
189 Please use change tracking when modifying this document.
190 This makes it easier for our translators to recognize things that have
191 been changed, and it helps the maintainer keep up-to-date with what's been
200 \begin_layout Chapter
204 \begin_layout Standard
205 This manual covers the customization features present in LyX.
206 In it, we discuss issues like keyboard shortcuts, screen previewing options,
207 printer options, sending commands to LyX via the LyX Server, internationalizati
208 on, installing new LaTeX classes and LyX layouts, etc.
209 We can't possibly hope to touch on everything you can change—our developers
210 add new features faster than we can document them—but we will explain the
211 most common customizations and hopefully point you in the right direction
212 for some of the more obscure ones.
215 \begin_layout Standard
216 \begin_inset Branch OutDated
219 \begin_layout Standard
220 Information from previous versions of this document that now seems to be
221 outdated is contained in the OutDated branch of this document.
222 By default, this information will not appear in the LaTeX output.
230 \begin_layout Chapter
231 LyX configuration files
234 \begin_layout Standard
235 This chapter aims to help you to find your way through the LyX configuration
237 Before continuing to read this chapter, you should find out where your
238 LyX library and user directories are by using
239 \begin_inset Flex CharStyle:MenuItem
242 \begin_layout Plain Layout
243 Help\SpecialChar \menuseparator
254 The library directory is the place where LyX places its system-wide configurati
255 on files; the user directory is where you can place your modified versions.
256 We will call the former
257 \begin_inset Flex CharStyle:Code
260 \begin_layout Plain Layout
267 \begin_inset Flex CharStyle:MenuItem
270 \begin_layout Plain Layout
276 in the remainder of this document.
280 \begin_layout Section
282 \begin_inset Flex CharStyle:Code
285 \begin_layout Plain Layout
294 \begin_layout Standard
295 \begin_inset Flex CharStyle:Code
298 \begin_layout Plain Layout
304 and its sub-directories contain a number of files and that can be used
305 to customize LyX's behavior.
306 You can change many of these files from within LyX itself through the
307 \begin_inset Flex CharStyle:MenuItem
310 \begin_layout Plain Layout
311 Tools\SpecialChar \menuseparator
318 Most customization that you will want to do in LyX is possible through
320 However, many other inner aspects of LyX can be customized by modifying
322 \begin_inset Flex CharStyle:Code
325 \begin_layout Plain Layout
332 These files fall in different categories, described in the following subsection
336 \begin_layout Subsection
337 Automatically generated files
340 \begin_layout Standard
341 The files, which are to be found in
342 \begin_inset Flex CharStyle:MenuItem
345 \begin_layout Plain Layout
351 , are generated when you configure LyX.
352 They contain various default values that are guessed by inspection.
353 In general, it is not a good idea to modify them, since they might be overwritt
357 \begin_layout Labeling
358 \labelwidthstring 00.00.0000
359 \begin_inset Flex CharStyle:Code
362 \begin_layout Plain Layout
368 contains defaults for various commands.
371 \begin_layout Labeling
372 \labelwidthstring 00.00.0000
373 \begin_inset Flex CharStyle:Code
376 \begin_layout Plain Layout
382 contains the list of packages that have been recognized by LyX.
383 It is currently unused by the LyX program itself, but the information extracted
384 , and more, is made available with
385 \begin_inset Flex CharStyle:MenuItem
388 \begin_layout Plain Layout
389 Help\SpecialChar \menuseparator
402 \begin_layout Labeling
403 \labelwidthstring 00.00.0000
404 \begin_inset Flex CharStyle:Code
407 \begin_layout Plain Layout
413 the list of text classes that have been found in your
414 \begin_inset Flex CharStyle:Code
417 \begin_layout Plain Layout
423 directories, along with the associated LaTeX document class and their descripti
427 \begin_layout Labeling
428 \labelwidthstring 00.00.0000
429 \begin_inset Flex CharStyle:Code
432 \begin_layout Plain Layout
438 the list of layout modules found in your
439 \begin_inset Flex CharStyle:Code
442 \begin_layout Plain Layout
451 \begin_layout Labeling
452 \labelwidthstring 00.00.0000
453 \begin_inset Flex CharStyle:Code
456 \begin_layout Plain Layout
462 lists of various sorts of LaTeX-related files found on your system
465 \begin_layout Labeling
466 \labelwidthstring 00.00.0000
467 \begin_inset Flex CharStyle:Code
470 \begin_layout Plain Layout
476 is automatically generated during configuration from the file
477 \begin_inset Flex CharStyle:Code
480 \begin_layout Plain Layout
487 It contains information on your LaTeX configuration.
490 \begin_layout Subsection
494 \begin_layout Standard
495 These directories are duplicated between
496 \begin_inset Flex CharStyle:Code
499 \begin_layout Plain Layout
506 \begin_inset Flex CharStyle:Code
509 \begin_layout Plain Layout
516 If a particular files exists in both places, the one in
517 \begin_inset Flex CharStyle:Code
520 \begin_layout Plain Layout
529 \begin_layout Labeling
530 \labelwidthstring 00.00.0000
531 \begin_inset Flex CharStyle:Code
534 \begin_layout Plain Layout
540 this directory contains files with the extension
541 \begin_inset Flex CharStyle:Code
544 \begin_layout Plain Layout
550 that define the keybindings used in LyX.
551 If there exists an internationalized version of the bind file named
552 \begin_inset Flex CharStyle:Code
555 \begin_layout Plain Layout
561 , that will be used first.
564 \begin_layout Labeling
565 \labelwidthstring 00.00.0000
566 \begin_inset Flex CharStyle:Code
569 \begin_layout Plain Layout
575 contains graphics files that can be included in documents.
579 \begin_layout Labeling
580 \labelwidthstring 00.00.0000
581 \begin_inset Flex CharStyle:Code
584 \begin_layout Plain Layout
590 contains LyX documentation files (including the one you are currently reading).
592 \begin_inset Flex CharStyle:Code
595 \begin_layout Plain Layout
601 deserves special attention, as noted above.
602 The internationalized help docs are in subdirectories
603 \begin_inset Flex CharStyle:Code
606 \begin_layout Plain Layout
613 \begin_inset Quotes eld
617 \begin_inset Quotes erd
620 is the ISO language code.
626 \begin_inset CommandInset ref
628 reference "cha:Internationalizing-LyX"
635 \begin_layout Labeling
636 \labelwidthstring 00.00.0000
637 \begin_inset Flex CharStyle:Code
640 \begin_layout Plain Layout
646 contains example files that explain how to use some features.
647 In the file browser, press the
648 \begin_inset Flex CharStyle:MenuItem
651 \begin_layout Plain Layout
660 \begin_layout Labeling
661 \labelwidthstring 00.00.0000
662 \begin_inset Flex CharStyle:Code
665 \begin_layout Plain Layout
671 contains image files that are used by the
672 \begin_inset Flex CharStyle:MenuItem
675 \begin_layout Plain Layout
682 In addition, it also contains the individual icons used in the toolbar
683 and the banners that can be shown when LyX is launched.
686 \begin_layout Labeling
687 \labelwidthstring 00.00.0000
688 \begin_inset Flex CharStyle:Code
691 \begin_layout Plain Layout
697 contains keyboard keymapping files.
703 \begin_inset CommandInset ref
705 reference "sec:International-Keymap-Stuff"
712 \begin_layout Labeling
713 \labelwidthstring 00.00.0000
714 \begin_inset Flex CharStyle:Code
717 \begin_layout Plain Layout
723 contains the text class and module files described in Chapter
728 \begin_inset CommandInset ref
730 reference "cha:Installing-New-Document"
737 \begin_layout Labeling
738 \labelwidthstring 00.00.0000
739 \begin_inset Flex CharStyle:Code
742 \begin_layout Plain Layout
749 \begin_inset Flex CharStyle:Code
752 \begin_layout Plain Layout
758 Python scripts used to convert between LyX versions.
759 These can be run from the command line if, say, you want to batch-convert
763 \begin_layout Labeling
764 \labelwidthstring 00.00.0000
765 \begin_inset Flex CharStyle:Code
768 \begin_layout Plain Layout
774 contains some files that demonstrate the capabilities of the
775 \begin_inset Flex CharStyle:MenuItem
778 \begin_layout Plain Layout
789 Also contains some scripts used by LyX itself.
792 \begin_layout Labeling
793 \labelwidthstring 00.00.0000
794 \begin_inset Flex CharStyle:Code
797 \begin_layout Plain Layout
803 contains the standard LyX template files described in Chapter
808 \begin_inset CommandInset ref
810 reference "sec:Creating-Templates"
817 \begin_layout Labeling
818 \labelwidthstring 00.00.0000
819 \begin_inset Flex CharStyle:Code
822 \begin_layout Plain Layout
828 contains files with the extension
829 \begin_inset Flex CharStyle:Code
832 \begin_layout Plain Layout
838 that define the user interface to LyX.
839 That is, the files define which items appear in which menus and the items
840 appearing on the toolbar.
843 \begin_layout Subsection
844 Files you don't want to modify
847 \begin_layout Standard
848 These files are used internally by LyX and you generally do not need to
849 modify them unless you are a developer.
852 \begin_layout Labeling
853 \labelwidthstring 00.00.0000
854 \begin_inset Flex CharStyle:Code
857 \begin_layout Plain Layout
863 this file contains the list of LyX developers.
864 The contents are displayed with the menu entry
865 \begin_inset Flex CharStyle:MenuItem
868 \begin_layout Plain Layout
869 Help\SpecialChar \menuseparator
882 \begin_layout Labeling
883 \labelwidthstring 00.00.0000
884 \begin_inset Flex CharStyle:Code
887 \begin_layout Plain Layout
893 this is a LaTeX script used during the configuration process.
897 \begin_layout Labeling
898 \labelwidthstring 00.00.0000
899 \begin_inset Flex CharStyle:Code
902 \begin_layout Plain Layout
908 this is the script that is used to re-configure LyX.
909 It creates configuration files in the directory it was run from.
912 \begin_layout Subsection
913 Other files needing a line or two...
916 \begin_layout Labeling
917 \labelwidthstring 00.00.0000
918 \begin_inset Flex CharStyle:Code
921 \begin_layout Plain Layout
927 this contains tables describing how different character encodings can be
931 \begin_layout Labeling
932 \labelwidthstring 00.00.0000
933 \begin_inset Flex CharStyle:Code
936 \begin_layout Plain Layout
942 this file contains the templates available to the new
943 \begin_inset Flex CharStyle:MenuItem
946 \begin_layout Plain Layout
959 \begin_layout Labeling
960 \labelwidthstring 00.00.0000
961 \begin_inset Flex CharStyle:Code
964 \begin_layout Plain Layout
970 this file contains a list of all the languages currently supported by LyX.
973 \begin_layout Section
974 Your local configuration directory
977 \begin_layout Standard
978 Even if you are using LyX as an unprivileged user, you might want to change
979 LyX configuration for your own use.
981 \begin_inset Flex CharStyle:Code
984 \begin_layout Plain Layout
990 directory contains all your personal configuration files.
991 This is the directory described as
992 \begin_inset Quotes eld
996 \begin_inset Quotes erd
1000 \begin_inset Flex CharStyle:MenuItem
1003 \begin_layout Plain Layout
1004 Help\SpecialChar \menuseparator
1006 \begin_inset space ~
1015 This directory is used as a mirror of
1016 \begin_inset Flex CharStyle:Code
1019 \begin_layout Plain Layout
1025 , which means that every file in
1026 \begin_inset Flex CharStyle:Code
1029 \begin_layout Plain Layout
1035 is a replacement for the corresponding file in
1036 \begin_inset Flex CharStyle:Code
1039 \begin_layout Plain Layout
1046 Any configuration file described in the above sections can be placed either
1047 in the system-wide directory, in which case it will affect all users, or
1048 in your local directory for your own use.
1051 \begin_layout Standard
1052 To make things clearer, let's provide a few examples:
1055 \begin_layout Itemize
1056 The preferences set in the
1057 \begin_inset Flex CharStyle:MenuItem
1060 \begin_layout Plain Layout
1061 Tools\SpecialChar \menuseparator
1067 dialog are saved to a file
1068 \begin_inset Flex CharStyle:Code
1071 \begin_layout Plain Layout
1078 \begin_inset Flex CharStyle:Code
1081 \begin_layout Plain Layout
1090 \begin_layout Itemize
1091 When you reconfigure using
1092 \begin_inset Flex CharStyle:MenuItem
1095 \begin_layout Plain Layout
1096 Tools\SpecialChar \menuseparator
1103 \begin_inset Flex CharStyle:Code
1106 \begin_layout Plain Layout
1112 script, and the resulting files are written in your local configuration
1114 This means that any additional text class file that you might have added
1116 \begin_inset Flex CharStyle:Code
1119 \begin_layout Plain Layout
1125 will be added to the list of classes in the
1126 \begin_inset Flex CharStyle:MenuItem
1129 \begin_layout Plain Layout
1130 Document\SpecialChar \menuseparator
1139 \begin_layout Itemize
1140 If you get some updated documentation from LyX ftp site and cannot install
1141 it because you do not have sysadmin rights on your system, you can just
1143 \begin_inset Flex CharStyle:Code
1146 \begin_layout Plain Layout
1152 and the items in the
1153 \begin_inset Flex CharStyle:MenuItem
1156 \begin_layout Plain Layout
1162 menu will open them!
1165 \begin_layout Section
1166 Running LyX with multiple configurations
1169 \begin_layout Standard
1170 The configuration freedom of the local configuration directory may not suffice
1171 if you want to have more than one configuration at your disposal.
1172 For example, you may want to be use different key bindings or printer settings
1174 You can achieve this by having several such directories.
1175 You then specify which directory to use at run-time.
1178 \begin_layout Standard
1179 Invoking LyX with the command line switch
1180 \begin_inset Flex CharStyle:Code
1183 \begin_layout Plain Layout
1193 instructs the program to read the configuration from that directory, and
1194 not from the default directory.
1195 (You can determine the default directory by running LyX without the
1196 \begin_inset Flex CharStyle:Code
1199 \begin_layout Plain Layout
1205 switch.) If the specified directory does not exist, LyX offers to create
1206 it for you, just like it does for the default directory on the first time
1207 you run the program.
1208 You can modify the configuration options in this additional user directory
1209 exactly as you would for the default directory.
1210 These directories are completely independent (but read on).
1211 Note that setting the environment variable
1212 \begin_inset Flex CharStyle:Code
1215 \begin_layout Plain Layout
1221 to some value has exactly the same effect.
1224 \begin_layout Standard
1225 Having several configurations also requires more maintenance: if you want
1226 to add a new layout to
1227 \begin_inset Flex CharStyle:Code
1230 \begin_layout Plain Layout
1236 which you want available from all your configurations, you must add it
1237 to each directory separately.
1238 You can avoid this with the following trick: after LyX creates the additional
1239 directory, most of the subdirectories (see above) are empty.
1240 If you want the new configuration to mirror an existing one, replace the
1241 empty subdirectory with a symbolic link to the matching subdirectory in
1242 the existing configuration.
1244 \begin_inset Flex CharStyle:Code
1247 \begin_layout Plain Layout
1253 subdirectory, however, since it contains a file written by the configuration
1254 script (also accessible through
1255 \begin_inset Flex CharStyle:MenuItem
1258 \begin_layout Plain Layout
1259 Tools\SpecialChar \menuseparator
1265 ) which is configuration-specific.
1268 \begin_layout Chapter
1269 The Preferences dialog
1272 \begin_layout Standard
1273 All options of the preferences dialog are described in the Appendix
1275 The Preferences Dialog
1282 For some options you might find here more details.
1285 \begin_layout Section
1287 \begin_inset CommandInset label
1296 \begin_layout Standard
1297 The first step is to define your file formats if they are not already defined.
1299 \begin_inset Flex CharStyle:MenuItem
1302 \begin_layout Plain Layout
1303 Tools\SpecialChar \menuseparator
1311 \begin_inset Flex CharStyle:MenuItem
1314 \begin_layout Plain Layout
1315 File Handling\SpecialChar \menuseparator
1322 \begin_inset Flex CharStyle:MenuItem
1325 \begin_layout Plain Layout
1326 New\SpecialChar \ldots{}
1332 button to define your new format.
1334 \begin_inset Flex CharStyle:MenuItem
1337 \begin_layout Plain Layout
1343 field contains the name used to identify the format in the GUI.
1345 \begin_inset Flex CharStyle:MenuItem
1348 \begin_layout Plain Layout
1354 is used to identify the format internally.
1355 You will also need to enter a file extension.
1356 These are all required.
1358 \begin_inset Flex CharStyle:MenuItem
1361 \begin_layout Plain Layout
1367 field is used to provide a keyboard shortcut on the menus.
1368 (For example, pressing
1369 \begin_inset Flex CharStyle:MenuItem
1372 \begin_layout Plain Layout
1379 \begin_inset Flex CharStyle:MenuItem
1382 \begin_layout Plain Layout
1383 View\SpecialChar \menuseparator
1392 \begin_layout Standard
1394 \begin_inset Flex CharStyle:MenuItem
1397 \begin_layout Plain Layout
1404 \begin_inset Flex CharStyle:MenuItem
1407 \begin_layout Plain Layout
1414 For example, you might want to use
1415 \begin_inset Flex CharStyle:MenuItem
1418 \begin_layout Plain Layout
1424 to view PostScript files.
1425 You can enter the command needed to start the program in the corresponding
1427 In defining this command, you can use the four variables listed in the
1429 The viewer is launched when you view an image in LyX or use the
1430 \begin_inset Flex CharStyle:MenuItem
1433 \begin_layout Plain Layout
1440 The editor is for example launched when you right-click on an image and
1442 \begin_inset Flex CharStyle:MenuItem
1445 \begin_layout Plain Layout
1451 in the appearing context menu.
1454 \begin_layout Standard
1456 \begin_inset Flex CharStyle:MenuItem
1459 \begin_layout Plain Layout
1465 option tells LyX that a format is suitable for document export.
1466 If this is set and if a suitable conversion route exists (see sec.
1467 \begin_inset space \thinspace{}
1471 \begin_inset CommandInset ref
1473 reference "sec:Converters"
1477 ), the format will appear in the
1478 \begin_inset Flex CharStyle:MenuItem
1481 \begin_layout Plain Layout
1482 File\SpecialChar \menuseparator
1489 The format will also appear in the
1490 \begin_inset Flex CharStyle:MenuItem
1493 \begin_layout Plain Layout
1499 menu if a viewer is specified for the format.
1500 Pure image formats, such as
1501 \begin_inset Flex CharStyle:Code
1504 \begin_layout Plain Layout
1510 , should not use this option.
1511 Formats that can both represent vector graphics and documents like
1512 \begin_inset Flex CharStyle:Code
1515 \begin_layout Plain Layout
1524 \begin_layout Standard
1526 \begin_inset Flex CharStyle:MenuItem
1529 \begin_layout Plain Layout
1530 Vector graphics format
1535 tells LyX that a format can contain vector graphics.
1536 This information is used to determine the target format of included graphics
1538 \begin_inset Flex CharStyle:MenuItem
1541 \begin_layout Plain Layout
1548 Included graphics may need to be converted to either
1549 \begin_inset Flex CharStyle:MenuItem
1552 \begin_layout Plain Layout
1559 \begin_inset Flex CharStyle:MenuItem
1562 \begin_layout Plain Layout
1569 \begin_inset Flex CharStyle:MenuItem
1572 \begin_layout Plain Layout
1579 \begin_inset Flex CharStyle:MenuItem
1582 \begin_layout Plain Layout
1588 cannot handle other image formats.
1589 If an included graphic is not already in
1590 \begin_inset Flex CharStyle:MenuItem
1593 \begin_layout Plain Layout
1600 \begin_inset Flex CharStyle:MenuItem
1603 \begin_layout Plain Layout
1610 \begin_inset Flex CharStyle:MenuItem
1613 \begin_layout Plain Layout
1619 format, it is converted to
1620 \begin_inset Flex CharStyle:MenuItem
1623 \begin_layout Plain Layout
1629 if the vector format option is set, and otherwise to
1630 \begin_inset Flex CharStyle:MenuItem
1633 \begin_layout Plain Layout
1642 \begin_layout Section
1646 \begin_layout Standard
1647 Since all conversions from one format to another take place in LyX's temporary
1648 directory, it is sometimes necessary to modify a file before copying it
1649 to the temporary directory in order that the conversion may be performed.
1653 \begin_layout Plain Layout
1654 For example, the file may refer to other files—images, for example—using
1655 relative file names, and these may become invalid when the file is copied
1656 to the temporary directory.
1661 This is done by a Copier: It copies a file to (or from) the temporary directory
1662 and may modify it in the process.
1665 \begin_layout Standard
1666 The definitions of the copiers may use four variables:
1669 \begin_layout Labeling
1670 \labelwidthstring 00.00.0000
1671 \begin_inset Flex CharStyle:Code
1674 \begin_layout Plain Layout
1680 The LyX system directory (e.
1681 \begin_inset space \thinspace{}
1685 \begin_inset space \space{}
1689 \begin_inset Flex CharStyle:MenuItem
1692 \begin_layout Plain Layout
1701 \begin_layout Labeling
1702 \labelwidthstring 00.00.0000
1703 \begin_inset Flex CharStyle:Code
1706 \begin_layout Plain Layout
1715 \begin_layout Labeling
1716 \labelwidthstring 00.00.0000
1717 \begin_inset Flex CharStyle:Code
1720 \begin_layout Plain Layout
1729 \begin_layout Labeling
1730 \labelwidthstring 00.00.0000
1731 \begin_inset Flex CharStyle:Code
1734 \begin_layout Plain Layout
1743 \begin_layout Standard
1744 The latter should be the filename as it would be used in a LaTeX's
1751 It is relevant only when exporting files suitable for such inclusion.
1754 \begin_layout Standard
1755 Copiers can be used to do almost anything with output files.
1756 For example, suppose you want generated pdf files to be copied to a special
1758 \begin_inset Flex CharStyle:Code
1761 \begin_layout Plain Layout
1768 Then you could write a shell script such as this one:
1771 \begin_layout Standard
1772 \begin_inset listings
1776 \begin_layout Plain Layout
1781 \begin_layout Plain Layout
1786 \begin_layout Plain Layout
1788 TOFILE=`basename $2`
1791 \begin_layout Plain Layout
1793 cp $FROMFILE /home/you/pdf/$TOFILE
1798 Save it in your local LyX directory—say,
1799 \begin_inset Flex CharStyle:Code
1802 \begin_layout Plain Layout
1803 /home/you/.lyx/scripts/pdfcopier.sh
1808 —and make it executable, if you need to do so on your platform.
1810 \begin_inset Flex CharStyle:MenuItem
1813 \begin_layout Plain Layout
1814 Tools\SpecialChar \menuseparator
1820 dialog, select under
1821 \begin_inset Flex CharStyle:MenuItem
1824 \begin_layout Plain Layout
1825 File Handling\SpecialChar \menuseparator
1832 \begin_inset Flex CharStyle:MenuItem
1835 \begin_layout Plain Layout
1841 format—or one of the other pdf formats—and enter
1842 \begin_inset Flex CharStyle:Code
1845 \begin_layout Plain Layout
1846 pdfcopier.sh $$i $$o
1852 \begin_inset Flex CharStyle:MenuItem
1855 \begin_layout Plain Layout
1865 \begin_layout Standard
1866 Copiers are used by LyX in various of its own conversions.
1867 For example, if appropriate programs are found, LyX will automatically
1868 install copiers for the
1869 \begin_inset Flex CharStyle:MenuItem
1872 \begin_layout Plain Layout
1879 \begin_inset Flex CharStyle:MenuItem
1882 \begin_layout Plain Layout
1884 \begin_inset space ~
1893 When these formats are exported, the copier sees that not just the main
1894 HTML file but various associated files (style files, images, etc.) are also
1896 All these files are written to a subdirectory of the directory in which
1897 the original LyX file was found.
1901 \begin_layout Plain Layout
1902 This copier can be customized.
1904 \begin_inset Quotes eld
1908 \begin_inset Quotes erd
1911 argument takes a comma-separated list of extensions to be copied; if it
1912 is omitted, all files will be copied.
1914 \begin_inset Quotes eld
1918 \begin_inset Quotes erd
1921 argument determines the extension added to the generated directory.
1923 \begin_inset Quotes eld
1927 \begin_inset Flex CharStyle:MenuItem
1930 \begin_layout Plain Layout
1937 \begin_inset Quotes erd
1940 , so HTML generated from
1941 \begin_inset Flex CharStyle:MenuItem
1944 \begin_layout Plain Layout
1945 /path/to/filename.lyx
1951 \begin_inset Flex CharStyle:MenuItem
1954 \begin_layout Plain Layout
1955 /path/to/filename.html.LyXconv
1969 \begin_layout Section
1971 \begin_inset CommandInset label
1973 name "sec:Converters"
1980 \begin_layout Standard
1981 You can define your own Converters to convert files between different formats.
1983 \begin_inset Flex CharStyle:MenuItem
1986 \begin_layout Plain Layout
1987 Tools\SpecialChar \menuseparator
1988 Preferences\SpecialChar \menuseparator
1989 File Handling\SpecialChar \menuseparator
1998 \begin_layout Standard
1999 To define a new converter, select the
2000 \begin_inset Flex CharStyle:MenuItem
2003 \begin_layout Plain Layout
2005 \begin_inset space ~
2014 \begin_inset Flex CharStyle:MenuItem
2017 \begin_layout Plain Layout
2019 \begin_inset space ~
2027 from the drop-down lists, enter the command needed for the conversion,
2029 \begin_inset Flex CharStyle:MenuItem
2032 \begin_layout Plain Layout
2039 Several variables can be used in the definition of converters:
2042 \begin_layout Labeling
2043 \labelwidthstring 00.00.0000
2044 \begin_inset Flex CharStyle:Code
2047 \begin_layout Plain Layout
2053 The LyX system directory
2056 \begin_layout Labeling
2057 \labelwidthstring 00.00.0000
2058 \begin_inset Flex CharStyle:Code
2061 \begin_layout Plain Layout
2070 \begin_layout Labeling
2071 \labelwidthstring 00.00.0000
2072 \begin_inset Flex CharStyle:Code
2075 \begin_layout Plain Layout
2084 \begin_layout Labeling
2085 \labelwidthstring 00.00.0000
2086 \begin_inset Flex CharStyle:Code
2089 \begin_layout Plain Layout
2095 The base filename of the input file (i.
2096 \begin_inset space \thinspace{}
2099 g., without the extension)
2102 \begin_layout Labeling
2103 \labelwidthstring 00.00.0000
2104 \begin_inset Flex CharStyle:Code
2107 \begin_layout Plain Layout
2113 The path to the input file
2116 \begin_layout Labeling
2117 \labelwidthstring 00.00.0000
2118 \begin_inset Flex CharStyle:Code
2121 \begin_layout Plain Layout
2127 The path to the original input file (this is different from $$p when a
2128 chain of converters is called).
2131 \begin_layout Standard
2133 \begin_inset Flex CharStyle:MenuItem
2136 \begin_layout Plain Layout
2138 \begin_inset space ~
2146 field you can enter the following flags, separated by commas:
2149 \begin_layout Labeling
2150 \labelwidthstring 00.00.0000
2151 \begin_inset Flex CharStyle:Code
2154 \begin_layout Plain Layout
2160 This converter runs some form of LaTeX.
2161 This will make LyX's LaTeX error logs available.
2164 \begin_layout Labeling
2165 \labelwidthstring 00.00.0000
2166 \begin_inset Flex CharStyle:Code
2169 \begin_layout Plain Layout
2176 \begin_inset Flex CharStyle:MenuItem
2179 \begin_layout Plain Layout
2185 file for the conversion.
2188 \begin_layout Labeling
2189 \labelwidthstring 00.00.0000
2190 \begin_inset Flex CharStyle:Code
2193 \begin_layout Plain Layout
2202 \begin_layout Standard
2203 The following three flags are not really flags at all because they take
2205 \begin_inset Flex CharStyle:MenuItem
2208 \begin_layout Plain Layout
2210 \begin_inset space ~
2214 \begin_inset space ~
2225 \begin_layout Labeling
2226 \labelwidthstring 00.00.0000
2227 \begin_inset Flex CharStyle:Code
2230 \begin_layout Plain Layout
2236 If set, the converter's standard error will be redirected to a file
2237 \begin_inset Flex CharStyle:Code
2240 \begin_layout Plain Layout
2246 , and the script given as argument will be run as:
2247 \begin_inset Flex CharStyle:Code
2250 \begin_layout Plain Layout
2251 script < infile.out > infile.log
2257 The argument may contain
2258 \begin_inset Flex CharStyle:Code
2261 \begin_layout Plain Layout
2270 \begin_layout Labeling
2271 \labelwidthstring 00.00.0000
2272 \begin_inset Flex CharStyle:Code
2275 \begin_layout Plain Layout
2281 The name of the directory in which the converter will dump the generated
2283 LyX will not create this directory, and it does not copy anything into
2284 it, though it will copy this directory to the destination.
2285 The argument may contain
2286 \begin_inset Flex CharStyle:Code
2289 \begin_layout Plain Layout
2295 , which will be replaced by the base name of the input and output files,
2296 respectively, when the directory is copied.
2297 \begin_inset Newline newline
2300 Note that resultdir and usetempdir make no sense together.
2301 The latter will be ignored if the former is given.
2304 \begin_layout Labeling
2305 \labelwidthstring 00.00.0000
2306 \begin_inset Flex CharStyle:Code
2309 \begin_layout Plain Layout
2315 Determines the output file name and may, contain
2316 \begin_inset Flex CharStyle:Code
2319 \begin_layout Plain Layout
2326 Sensible only with resultdir and optional even then; if not given, it defaults
2330 \begin_layout Standard
2331 None of these last three are presently used in any of the converters that
2332 are installed with LyX.
2336 \begin_layout Standard
2337 You do not have to define converters for all formats between which you want
2339 For example, you will note that there is no `LyX to PostScript' converter,
2340 but LyX will export PostScript.
2341 It does so by first creating a LaTeX file (no converter needs to be defined
2342 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2343 and finally converting the resulting DVI file to PostScript.
2344 LyX finds such `chains' of converters automatically, and it will always
2345 choose the shortest possible chain.
2346 You can, though, still define multiple conversion methods between file
2348 For example, the standard LyX configuration provides three ways to convert
2349 LaTeX to PDF: Directly, using
2350 \begin_inset Flex CharStyle:MenuItem
2353 \begin_layout Plain Layout
2359 ; via (DVI and) PostScript, using
2360 \begin_inset Flex CharStyle:MenuItem
2363 \begin_layout Plain Layout
2370 \begin_inset Flex CharStyle:MenuItem
2373 \begin_layout Plain Layout
2380 To define such alternate chains, you must define multiple target `file
2381 formats', as described in section
2382 \begin_inset CommandInset ref
2384 reference "sec:Formats"
2389 For example, in the standard configuration, the formats named
2390 \begin_inset Flex CharStyle:MenuItem
2393 \begin_layout Plain Layout
2400 \begin_inset Flex CharStyle:MenuItem
2403 \begin_layout Plain Layout
2410 \begin_inset Flex CharStyle:MenuItem
2413 \begin_layout Plain Layout
2419 are defined, all of which share the extension
2420 \begin_inset Flex CharStyle:MenuItem
2423 \begin_layout Plain Layout
2429 , and which correspond to the conversion methods just mentioned.
2432 \begin_layout Chapter
2433 Internationalizing LyX
2434 \begin_inset CommandInset label
2436 name "cha:Internationalizing-LyX"
2443 \begin_layout Standard
2444 LyX supports using a translated interface.
2445 Last time we checked, LyX provided text in thirty languages.
2446 The language of choice is called your
2451 (For further reading on locale settings, see also the documentation for
2452 locale that comes with your operating system.
2453 For Linux, the manual page for
2454 \begin_inset Flex CharStyle:Code
2457 \begin_layout Plain Layout
2463 could be a good place to start).
2466 \begin_layout Standard
2467 Notice that these translations will work, but do contain a few flaws.
2468 In particular, all dialogs have been designed with the English text in
2469 mind, which means that some of the translated text will be too large to
2470 fit within the space allocated.
2471 This is only a display problem and will not cause any harm.
2472 Also, you will find that some of the translations do not define shortcut
2473 keys for everything.
2474 Sometimes, there are simply not enough free letters to do it.
2475 Other times, the translator just hasn't got around to doing it yet.
2476 Our localization team, which you may wish to join,
2480 \begin_layout Plain Layout
2481 If you are a fluent speaker of a language other than English, joining these
2482 teams is a great way to give back to the LyX community!
2487 will of course try to fix these shortcomings in future versions of LyX.
2490 \begin_layout Section
2494 \begin_layout Subsection
2495 Translating the graphical user interface (text messages).
2498 \begin_layout Standard
2500 \begin_inset Flex CharStyle:Code
2503 \begin_layout Plain Layout
2509 library to handle the internationalization of the interface.
2510 To have LyX speak your favorite language in all menus and dialogs, you
2512 \begin_inset Flex CharStyle:Code
2515 \begin_layout Plain Layout
2521 -file for that language.
2522 When this is available, you'll have to generate a
2523 \begin_inset Flex CharStyle:Code
2526 \begin_layout Plain Layout
2532 -file from it and install the
2533 \begin_inset Flex CharStyle:Code
2536 \begin_layout Plain Layout
2543 The process of doing all of this is explained in the documentation for
2545 \begin_inset Flex CharStyle:Code
2548 \begin_layout Plain Layout
2555 It is possible to do this just for yourself, but if you're going to do
2556 it, you might as well share the results of your labors with the rest of
2558 Send a message to the LyX developers' list for more information about how
2562 \begin_layout Standard
2563 In short, this is what you should do (xx denotes the language code):
2566 \begin_layout Itemize
2567 Check out the LyX source code.
2569 \begin_inset CommandInset href
2571 name "information on the web"
2572 target "http://www.lyx.org/devel/cvs.php"
2579 \begin_layout Itemize
2581 \begin_inset Flex CharStyle:Code
2584 \begin_layout Plain Layout
2590 to the folder of the
2591 \begin_inset Flex CharStyle:Code
2594 \begin_layout Plain Layout
2602 \begin_inset Flex CharStyle:Code
2605 \begin_layout Plain Layout
2613 \begin_inset Flex CharStyle:Code
2616 \begin_layout Plain Layout
2622 doesn't exist anywhere, it can be remade with the console command
2623 \begin_inset Flex CharStyle:Code
2626 \begin_layout Plain Layout
2632 in that directory, or you can use an existing po-file for some other language
2636 \begin_layout Itemize
2638 \begin_inset Flex CharStyle:Code
2641 \begin_layout Plain Layout
2651 \begin_layout Plain Layout
2652 This is just a text file, so it can be edited in any text editor.
2653 But there are also specialized programs that support such editing, such
2658 (for all platforms) or
2667 contains a `mode' for editing
2668 \begin_inset Flex CharStyle:Code
2671 \begin_layout Plain Layout
2682 For some menu- and widget-labels, there are also shortcut keys that should
2684 Those keys are marked after a `|', and should be translated according to
2685 the words and phrases of the language.
2686 You should also fill also out the information at the beginning of the new
2688 \begin_inset Flex CharStyle:Code
2691 \begin_layout Plain Layout
2697 -file with your email-address, etc., so people know where to reach you with
2698 suggestions and entertaining flames.
2701 \begin_layout Standard
2702 If you are just doing this on your own, then:
2705 \begin_layout Itemize
2707 \begin_inset Flex CharStyle:Code
2710 \begin_layout Plain Layout
2717 This can be done with
2718 \begin_inset Flex CharStyle:Code
2721 \begin_layout Plain Layout
2722 msgfmt -o xx.mo < xx.po
2730 \begin_layout Itemize
2732 \begin_inset Flex CharStyle:Code
2735 \begin_layout Plain Layout
2741 -file to your locale-tree, at the correct directory for application messages
2746 xx, and under the name
2747 \begin_inset Flex CharStyle:Code
2750 \begin_layout Plain Layout
2757 \begin_inset space \thinspace{}
2761 \begin_inset space \space{}
2765 \begin_inset Flex CharStyle:Code
2768 \begin_layout Plain Layout
2769 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2779 \begin_layout Standard
2780 As said, however, it would be best if the new
2781 \begin_inset Flex CharStyle:Code
2784 \begin_layout Plain Layout
2790 -file could be added to the LyX distribution, so others can use it.
2791 Adding it involves making additional changes to LyX.
2792 So send an email to the developers' mailing list if you're interested in
2796 \begin_layout Subsubsection
2800 \begin_layout Standard
2801 Sometimes it turns out that one English message needs to be translated into
2802 different messages in the target language.
2803 One example is the message
2804 \begin_inset Flex CharStyle:Code
2807 \begin_layout Plain Layout
2813 which has the German translation
2821 , depending upon exactly what the English
2822 \begin_inset Quotes eld
2826 \begin_inset Quotes erd
2831 \begin_inset Flex CharStyle:Code
2834 \begin_layout Plain Layout
2840 does not handle such ambiguous translations.
2841 Therefore you have to add some context information to the message: Instead
2843 \begin_inset Flex CharStyle:Code
2846 \begin_layout Plain Layout
2853 \begin_inset Flex CharStyle:Code
2856 \begin_layout Plain Layout
2857 To[[as in 'From format x to format y']]
2863 \begin_inset Flex CharStyle:Code
2866 \begin_layout Plain Layout
2867 To[[as in 'From page x to page y']].
2872 Now the two occurrences of
2873 \begin_inset Flex CharStyle:Code
2876 \begin_layout Plain Layout
2883 \begin_inset Flex CharStyle:Code
2886 \begin_layout Plain Layout
2892 and can be translated correctly to
2903 \begin_layout Standard
2904 Of course the context information needs to be stripped off the original
2905 message when no translation is used.
2906 Therefore you have to put it in double square brackets at the end of the
2907 message (see the example above).
2908 The translation mechanism of LyX ensures that everything in double square
2909 brackets at the end of messages is removed before displaying the message.
2912 \begin_layout Subsection
2913 Translating the documentation.
2916 \begin_layout Standard
2917 The online documentation (in the
2918 \begin_inset Flex CharStyle:MenuItem
2921 \begin_layout Plain Layout
2927 -menu) can (and should!) be translated.
2928 If there are translated versions of the documentation available
2932 \begin_layout Plain Layout
2933 As of March 2008, at least some of the documents have been translated into
2934 fourteen languages, with the Tutorial available in a few more.
2939 and the locale is set accordingly, these will be used automagically by
2941 LyX looks for translated versions as
2942 \begin_inset Flex CharStyle:Code
2945 \begin_layout Plain Layout
2946 LyXDir/doc/xx/DocName.lyx
2952 \begin_inset Flex CharStyle:Code
2955 \begin_layout Plain Layout
2961 is the code for the language currently in use.
2962 If there are no translated documents, the default English versions will
2964 Note that the translated versions must have the same filenames (
2965 \begin_inset Flex CharStyle:Code
2968 \begin_layout Plain Layout
2974 above) as the original.
2975 If you feel up to translating the documentation (an excellent way to proof-read
2976 the original documentation by the way!), there are a few things you should
2980 \begin_layout Itemize
2981 Check out the documentation translation web page at
2982 \begin_inset CommandInset href
2984 name "http://www.lyx.org/Translation"
2985 target "http://www.lyx.org/Translation"
2990 That way, you can find out which (if any) documents have already been translate
2991 d into your language.
2992 You can also find out who (if anyone) is organizing the effort to translate
2993 the documentation into your language.
2994 If no one is organizing the effort, please let us know that you're interested.
2997 \begin_layout Standard
2998 Once you get to actually translating, here's a few hints for you that may
3002 \begin_layout Itemize
3003 Join the documentation team! There is information on how to do that in
3004 \begin_inset Flex CharStyle:Code
3007 \begin_layout Plain Layout
3014 \begin_inset Flex CharStyle:MenuItem
3017 \begin_layout Plain Layout
3018 Help\SpecialChar \menuseparator
3024 ), which by the way is the first document you should translate.
3027 \begin_layout Itemize
3028 Learn the typographic conventions for the language you are translating to.
3029 Typography is an ancient art and over the centuries, a great variety of
3030 conventions have developed throughout different parts of the world.
3031 Also study the professional terminology amongst typographers in your country.
3032 Inventing your own terminology will only confuse the users.
3035 (Warning! Typography is addictive!)
3038 \begin_layout Itemize
3039 Make a copy of the document.
3040 This will be your working copy.
3041 You can use this as your personal translated help-file by placing it in
3043 \begin_inset Flex CharStyle:Code
3046 \begin_layout Plain Layout
3055 \begin_layout Itemize
3056 Sometimes the original document (from the LyX-team) will be updated.
3057 Use the source viewer at
3058 \begin_inset CommandInset href
3060 name "http://www.lyx.org/trac/timeline"
3061 target "http://www.lyx.org/trac/timeline"
3065 to see what has been changed.
3066 That way you can easily see which parts of the translated document need
3070 \begin_layout Standard
3071 If you ever find an error in the original document, fix it and notify the
3072 rest of the documentation team of the changes! (You didn't forget to join
3073 the documentation team, did you?)
3076 \begin_layout Standard
3077 \begin_inset Branch OutDated
3080 \begin_layout Section
3081 International Keyboard Support
3084 \begin_layout Standard
3087 [Editor's Note: The following section is by
3095 It needs to be fixed to conform to the new Documentation Style sheet and
3096 to make use of the new v1.0 features.
3097 The whole thing also needs to be merged with the section following it.-jw
3098 It may also be badly out of date.-rh (2008)]
3101 \begin_layout Subsection
3102 Defining Own Keymaps: Keymap File Format
3105 \begin_layout Standard
3106 Let's look at a keyboard definition file a little closer.
3107 It is a plain text file defining
3110 \begin_layout Itemize
3111 key-to-key or key-to-string translations
3114 \begin_layout Itemize
3118 \begin_layout Itemize
3119 dead keys exceptions
3122 \begin_layout Standard
3123 To define key-to-key or key-to-string translation, use this command:
3126 \begin_layout Quotation
3127 \begin_inset Flex CharStyle:Code
3130 \begin_layout Plain Layout
3139 \begin_inset Flex CharStyle:Code
3142 \begin_layout Plain Layout
3151 \begin_layout Standard
3153 \begin_inset Flex CharStyle:Code
3156 \begin_layout Plain Layout
3162 is the key to be translated and
3163 \begin_inset Flex CharStyle:Code
3166 \begin_layout Plain Layout
3172 is the string to be inserted into the document.
3173 To define dead keys, use:
3176 \begin_layout Quotation
3177 \begin_inset Flex CharStyle:Code
3180 \begin_layout Plain Layout
3189 \begin_inset Flex CharStyle:Code
3192 \begin_layout Plain Layout
3201 \begin_layout Standard
3203 \begin_inset Flex CharStyle:Code
3206 \begin_layout Plain Layout
3212 is a keyboard key and
3213 \begin_inset Flex CharStyle:Code
3216 \begin_layout Plain Layout
3223 The following dead keys are supported (shortcut name is in parentheses):
3226 \begin_layout Quotation
3230 \begin_inset space \hfill{}
3236 \begin_layout Quotation
3238 \begin_inset space \hfill{}
3244 \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{}
3277 \begin_layout Plain Layout
3289 \begin_layout Quotation
3291 \begin_inset space \hfill{}
3297 \begin_layout Quotation
3299 \begin_inset space \hfill{}
3306 \begin_layout Plain Layout
3318 \begin_layout Quotation
3320 \begin_inset space \hfill{}
3326 \begin_layout Quotation
3328 \begin_inset space \hfill{}
3334 \begin_layout Quotation
3336 \begin_inset space \hfill{}
3343 \begin_layout Plain Layout
3355 \begin_layout Quotation
3357 \begin_inset space \hfill{}
3364 \begin_layout Plain Layout
3376 \begin_layout Quotation
3378 \begin_inset space \hfill{}
3384 \begin_layout Quotation
3385 hungarian umlaut (hug)
3386 \begin_inset space \hfill{}
3392 \begin_layout Quotation
3394 \begin_inset space \hfill{}
3400 \begin_layout Quotation
3402 \begin_inset space \hfill{}
3409 \begin_layout Plain Layout
3421 \begin_layout Standard
3422 Since in many international keyboards there are exceptions to what some
3423 dead keys should do, you can define them using
3426 \begin_layout Quotation
3427 \begin_inset Flex CharStyle:Code
3430 \begin_layout Plain Layout
3438 deadkey key outstring
3441 \begin_layout Standard
3442 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3446 \begin_layout Quotation
3447 \begin_inset Flex CharStyle:Code
3450 \begin_layout Plain Layout
3463 \begin_layout Standard
3464 to make it work correctly.
3465 Also, you have to define as exceptions dead keys over i and j, to remove
3466 the dot from them before inserting an accent mark.
3467 I will change this when the time comes, but so far I haven't had time.
3470 \begin_layout Standard
3471 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3474 \begin_inset Flex CharStyle:Code
3477 \begin_layout Plain Layout
3483 have different meaning.
3485 \begin_inset Flex CharStyle:Code
3488 \begin_layout Plain Layout
3494 marks comments, quotes start and end LaTeX-style commands.
3495 To enter quote, you'll need to use
3496 \begin_inset Flex CharStyle:Code
3499 \begin_layout Plain Layout
3508 \begin_inset Flex CharStyle:Code
3511 \begin_layout Plain Layout
3518 \begin_inset Flex CharStyle:Code
3521 \begin_layout Plain Layout
3532 \begin_layout Standard
3533 If you make a keyboard description file that works for your language, please
3534 mail it to me, so I can include it in the next keymap distribution.
3537 \begin_layout Standard
3538 More keywords will be supported in keymap configuration file in future,
3542 \begin_layout Itemize
3543 \begin_inset Flex CharStyle:Code
3546 \begin_layout Plain Layout
3557 \begin_inset space \hfill{}
3561 \begin_inset Flex CharStyle:Code
3564 \begin_layout Plain Layout
3573 \begin_layout Itemize
3574 \begin_inset Flex CharStyle:Code
3577 \begin_layout Plain Layout
3588 \begin_inset space \hfill{}
3592 \begin_inset Flex CharStyle:Code
3595 \begin_layout Plain Layout
3601 an external keymap translation program
3604 \begin_layout Standard
3605 Also, it should look into
3606 \begin_inset Flex CharStyle:Code
3609 \begin_layout Plain Layout
3615 file for defaults, too (for example, a
3616 \begin_inset Flex CharStyle:Code
3619 \begin_layout Plain Layout
3627 option to include default keyboard).
3635 \begin_layout Section
3636 International Keymap Stuff
3637 \begin_inset CommandInset label
3639 name "sec:International-Keymap-Stuff"
3646 \begin_layout Standard
3647 \begin_inset Note Note
3650 \begin_layout Plain Layout
3651 In doing the revisions on this document in March 2008, I did not look over
3652 this stuff, as I do not understand it.
3653 It would be good if someone else could do so.
3662 \begin_layout Standard
3663 The next two sections describe the
3664 \begin_inset Flex CharStyle:Code
3667 \begin_layout Plain Layout
3676 \begin_inset Flex CharStyle:Code
3679 \begin_layout Plain Layout
3687 file syntax in detail.
3688 These sections should help you design your own key map if the ones provided
3689 do not meet your needs.
3692 \begin_layout Subsection
3696 \begin_layout Standard
3700 \begin_inset Flex CharStyle:Code
3703 \begin_layout Plain Layout
3709 file maps keystrokes to characters or strings.
3710 As the name suggests, it sets a keyboard mapping.
3712 \begin_inset Flex CharStyle:Code
3715 \begin_layout Plain Layout
3726 \begin_inset Flex CharStyle:Code
3729 \begin_layout Plain Layout
3744 \begin_inset Flex CharStyle:Code
3747 \begin_layout Plain Layout
3760 \begin_inset Flex CharStyle:Code
3763 \begin_layout Plain Layout
3772 \begin_inset Flex CharStyle:Code
3775 \begin_layout Plain Layout
3783 are described in this section.
3786 \begin_layout Labeling
3787 \labelwidthstring 00.00.0000
3788 \begin_inset Flex CharStyle:Code
3791 \begin_layout Plain Layout
3799 Map a character to a string
3802 \begin_layout LyX-Code
3817 \begin_layout Standard
3850 the double-quote (")
3867 must be escaped with a preceding backslash (
3878 \begin_layout Standard
3880 \begin_inset Flex CharStyle:MenuItem
3883 \begin_layout Plain Layout
3891 statement to cause the symbol
3892 \begin_inset Flex CharStyle:MenuItem
3895 \begin_layout Plain Layout
3903 to be output for the keystroke
3904 \begin_inset Flex CharStyle:MenuItem
3907 \begin_layout Plain Layout
3918 \begin_layout LyX-Code
3924 \begin_layout Labeling
3925 \labelwidthstring 00.00.0000
3926 \begin_inset Flex CharStyle:Code
3929 \begin_layout Plain Layout
3937 Specify an accent character
3940 \begin_layout LyX-Code
3949 \begin_layout Standard
3950 This will make the cha
3988 This is the dead key
3992 \begin_layout Plain Layout
3999 refers to a key that does not produce a character by itself, but when followed
4000 with another key, produces the desired accent character.
4001 For example, a German characte
4003 r with an umlaut like
4013 can be produced in this manner.
4022 \begin_layout Standard
4035 and then another key not in
4052 followed by the other, not allowed key, as output.
4056 \begin_inset Flex CharStyle:MenuItem
4059 \begin_layout Plain Layout
4067 cancels a dead key, so if
4078 \begin_inset Flex CharStyle:MenuItem
4081 \begin_layout Plain Layout
4090 , the cursor will not go one position backwards but will instead cancel
4106 might have had on the next keystroke.
4110 \begin_layout Standard
4111 The following example specifies that the character ' is to be an acute accent,
4112 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4115 \begin_layout LyX-Code
4118 kmod ' acute aeiouAEIOU
4121 \begin_layout Labeling
4122 \labelwidthstring 00.00.0000
4123 \begin_inset Flex CharStyle:Code
4126 \begin_layout Plain Layout
4132 Specify an exception to the accent character
4135 \begin_layout LyX-Code
4144 \begin_layout Standard
4145 This defines an exce
4186 have been assigned a keystroke with a previous
4189 \begin_inset Flex CharStyle:Code
4192 \begin_layout Plain Layout
4216 must not belong in the
4263 If such a declaration does not exist in
4271 \begin_inset Flex CharStyle:Code
4274 \begin_layout Plain Layout
4308 \begin_inset Flex CharStyle:Code
4311 \begin_layout Plain Layout
4325 \begin_layout Standard
4326 The following command produces causes äi to be produced when you enter acute-i
4330 \begin_layout LyX-Code
4344 \begin_layout Labeling
4345 \labelwidthstring 00.00.0000
4346 \begin_inset Flex CharStyle:Code
4349 \begin_layout Plain Layout
4355 Combine two accent characters
4358 \begin_layout LyX-Code
4364 accent1 accent2 allowed
4367 \begin_layout Standard
4368 This one is getting pretty esoteric.
4369 It allows you to combine the effect
4425 \begin_inset Flex CharStyle:Code
4428 \begin_layout Plain Layout
4456 \begin_layout Standard
4457 Consider this example from the
4458 \begin_inset Flex CharStyle:Code
4461 \begin_layout Plain Layout
4472 \begin_layout LyX-Code
4475 kmod ; acute aeioyvhAEIOYVH
4479 kcomb acute umlaut iyIY
4482 \begin_layout Standard
4483 This allows you to press
4484 \begin_inset Flex CharStyle:MenuItem
4487 \begin_layout Plain Layout
4495 and get the effect of
4496 \begin_inset Flex CharStyle:Code
4499 \begin_layout Plain Layout
4518 in this case cancels the last dead key, so if you press
4519 \begin_inset Flex CharStyle:MenuItem
4522 \begin_layout Plain Layout
4531 \begin_inset Flex CharStyle:Code
4534 \begin_layout Plain Layout
4547 \begin_layout Subsection
4551 \begin_layout Standard
4553 \begin_inset Flex CharStyle:Code
4556 \begin_layout Plain Layout
4564 mapping is performed, a
4565 \begin_inset Flex CharStyle:Code
4568 \begin_layout Plain Layout
4578 file maps the strings that the symbols generate to characters in the current
4580 The LyX distribution currently includes at least the
4581 \begin_inset Flex CharStyle:Code
4584 \begin_layout Plain Layout
4593 \begin_inset Flex CharStyle:Code
4596 \begin_layout Plain Layout
4607 \begin_layout Standard
4609 \begin_inset Flex CharStyle:Code
4612 \begin_layout Plain Layout
4620 file is a sequence of declarations of the form
4623 \begin_layout LyX-Code
4636 \begin_layout Standard
4637 For example, in order to map
4638 \begin_inset Flex CharStyle:MenuItem
4641 \begin_layout Plain Layout
4651 to the corresponding character in the iso-8859-1 set (233), the following
4655 \begin_layout LyX-Code
4663 \begin_layout Standard
4665 \begin_inset Flex CharStyle:Code
4668 \begin_layout Plain Layout
4677 \begin_inset Flex CharStyle:Code
4680 \begin_layout Plain Layout
4698 the same character can apply to more than one string.
4700 \begin_inset Flex CharStyle:Code
4703 \begin_layout Plain Layout
4714 \begin_layout LyX-Code
4726 \begin_inset Newline newline
4742 \begin_layout Standard
4743 If LyX cannot find a mapping for the string produced by the keystroke or
4744 a deadkey sequence, it will check if it looks like an accented char and
4745 try to draw an accent over the character on screen.
4748 \begin_layout Subsection
4752 \begin_layout Standard
4753 There is a second way to add support for international characters through
4754 so-called dead-keys.
4755 A dead-key works in combination with a letter to produce an accented character.
4756 Here, we'll explain how to create a really simple dead-key to illustrate
4760 \begin_layout Standard
4761 Suppose you happen to need the circumflex character,
4762 \begin_inset Quotes eld
4766 \begin_inset Quotes erd
4771 \begin_inset Flex CharStyle:MenuItem
4774 \begin_layout Plain Layout
4781 \begin_inset space ~
4785 \begin_inset Flex CharStyle:MenuItem
4788 \begin_layout Plain Layout
4794 ] to the LyX command
4795 \begin_inset Flex CharStyle:Code
4798 \begin_layout Plain Layout
4805 \begin_inset Flex CharStyle:Code
4808 \begin_layout Plain Layout
4815 Now, whenever you type the
4816 \begin_inset Flex CharStyle:MenuItem
4819 \begin_layout Plain Layout
4825 -key followed by a letter, that letter will have a circumflex accent on
4827 For example, the sequence
4828 \begin_inset Quotes eld
4832 \begin_inset Flex CharStyle:MenuItem
4835 \begin_layout Plain Layout
4842 \begin_inset Quotes erd
4845 produces the letter:
4846 \begin_inset Quotes eld
4850 \begin_inset Quotes erd
4854 If you tried to type
4855 \begin_inset Quotes eld
4859 \begin_inset Flex CharStyle:MenuItem
4862 \begin_layout Plain Layout
4869 \begin_inset Quotes erd
4872 , however, LyX will complain with a beep, since a
4873 \begin_inset Quotes eld
4877 \begin_inset Flex CharStyle:MenuItem
4880 \begin_layout Plain Layout
4887 \begin_inset Quotes erd
4890 never takes a circumflex accent.
4892 \begin_inset Flex CharStyle:MenuItem
4895 \begin_layout Plain Layout
4901 after a dead-key produces the bare-accent.
4902 Please note this last point! If you bind a key to a dead-key, you'll need
4903 to rebind the character on that key to yet another key.
4905 \begin_inset Flex CharStyle:MenuItem
4908 \begin_layout Plain Layout
4914 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4917 \begin_layout Standard
4918 One common way to bind dead-keys is to use
4919 \begin_inset Flex CharStyle:MenuItem
4922 \begin_layout Plain Layout
4929 \begin_inset Flex CharStyle:MenuItem
4932 \begin_layout Plain Layout
4939 \begin_inset Flex CharStyle:MenuItem
4942 \begin_layout Plain Layout
4948 in combination with an accent, like
4949 \begin_inset Quotes eld
4953 \begin_inset Flex CharStyle:MenuItem
4956 \begin_layout Plain Layout
4963 \begin_inset Quotes erd
4967 \begin_inset Quotes eld
4971 \begin_inset Flex CharStyle:MenuItem
4974 \begin_layout Plain Layout
4981 \begin_inset Quotes erd
4985 \begin_inset Quotes eld
4989 \begin_inset Flex CharStyle:MenuItem
4992 \begin_layout Plain Layout
4999 \begin_inset Quotes erd
5003 Another way involves using
5004 \begin_inset Flex CharStyle:Code
5007 \begin_layout Plain Layout
5014 \begin_inset Flex CharStyle:Code
5017 \begin_layout Plain Layout
5023 to set up the special
5024 \begin_inset Flex CharStyle:Code
5027 \begin_layout Plain Layout
5035 \begin_inset Flex CharStyle:Code
5038 \begin_layout Plain Layout
5044 acts in some ways just like
5045 \begin_inset Flex CharStyle:MenuItem
5048 \begin_layout Plain Layout
5054 and permits you to bind keys to accented characters.
5055 You can also turn keys into dead-keys by binding them to something like
5057 \begin_inset Flex CharStyle:Code
5060 \begin_layout Plain Layout
5066 and then binding this symbolic key to the corresponding LyX command.
5070 \begin_layout Plain Layout
5075 : This is exactly what I do in my
5076 \begin_inset Flex CharStyle:Code
5079 \begin_layout Plain Layout
5086 \begin_inset Flex CharStyle:Code
5089 \begin_layout Plain Layout
5097 \begin_inset Flex CharStyle:MenuItem
5100 \begin_layout Plain Layout
5102 \begin_inset space ~
5111 \begin_inset Flex CharStyle:Code
5114 \begin_layout Plain Layout
5120 and a bunch of these
5121 \begin_inset Quotes eld
5125 \begin_inset Flex CharStyle:Code
5128 \begin_layout Plain Layout
5135 \begin_inset Quotes erd
5138 symbolic keys bound such things as
5139 \begin_inset Flex CharStyle:MenuItem
5142 \begin_layout Plain Layout
5144 \begin_inset space ~
5153 \begin_inset Flex CharStyle:MenuItem
5156 \begin_layout Plain Layout
5158 \begin_inset space ~
5167 This is how I produce my accented characters.
5172 You can make just about anything into the
5173 \begin_inset Flex CharStyle:Code
5176 \begin_layout Plain Layout
5183 \begin_inset Flex CharStyle:MenuItem
5186 \begin_layout Plain Layout
5192 keys, a spare function key, etc.
5193 As for the LyX commands that produce accents, check the entry for
5194 \begin_inset Flex CharStyle:Code
5197 \begin_layout Plain Layout
5208 You'll find the complete list there.
5211 \begin_layout Subsection
5212 Saving your Language Configuration
5215 \begin_layout Standard
5216 You can edit your preferences so that your desired language environment
5217 is automatically configured when LyX starts up, via the
5218 \begin_inset Flex CharStyle:MenuItem
5221 \begin_layout Plain Layout
5222 Edit\SpecialChar \menuseparator
5231 \begin_layout Chapter
5232 Installing New Document Classes, Layouts, and Templates
5233 \begin_inset CommandInset label
5235 name "cha:Installing-New-Document"
5243 \begin_layout Plain Layout
5244 Installing New Document Classes
5252 \begin_layout Standard
5253 In this chapter, we describe the procedures for creating and installing
5254 new LyX layout and template files, as well as offer a refresher on correctly
5255 installing new LaTeX document classes.
5256 Some definitions: a document class is a LaTeX file (usually ending in
5257 \begin_inset Flex CharStyle:Code
5260 \begin_layout Plain Layout
5267 \begin_inset Flex CharStyle:Code
5270 \begin_layout Plain Layout
5276 ) that describes the format of a document such as an article, report, journal
5277 preprint, etc, and all the commands needed to realize that format.
5278 A layout file is a LyX file that corresponds to a LaTeX document class
5279 and that tells LyX how to
5280 \begin_inset Quotes eld
5284 \begin_inset Quotes erd
5287 things on the screen to make the display look something like the final
5289 More precisely, a layout file describes a
5290 \begin_inset Quotes eld
5294 \begin_inset Quotes erd
5297 which is the internal construct LyX uses to render the screen display.
5299 \begin_inset Quotes eld
5303 \begin_inset Quotes erd
5307 \begin_inset Quotes eld
5311 \begin_inset Quotes erd
5314 can be used somewhat interchangeably, but it is better to refer to the
5315 file as the layout, and the thing living in LyX's memory as the text class.
5316 A template file is simply a LyX document that contains a set of predefined
5317 entries for a given document class—entries that are generally required
5319 Templates are especially useful for things like journal manuscripts that
5320 are to be submitted electronically.
5323 \begin_layout Section
5324 Installing a new LaTeX package
5327 \begin_layout Standard
5328 Some installations may not include a LaTeX package that you would like to
5330 For example, you might need FoilTeX, a package for preparing slides or
5331 viewgraphs for overhead projectors.
5332 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5333 a user interface for that.
5334 For example on MiKTeX you start its program
5335 \begin_inset Quotes eld
5339 \begin_inset Quotes erd
5342 to get a list of available packages.
5343 To install one, right click on it or use the installing toolbar button.
5344 When the package you want to install is not in the list, but you have it
5346 \begin_inset Flex CharStyle:Code
5349 \begin_layout Plain Layout
5356 \begin_inset Flex CharStyle:Code
5359 \begin_layout Plain Layout
5365 -file, then copy these files to a subfolder of your LaTeX distribution,
5366 for example to the folder
5375 Then update the file name database of your LaTeX-distribution.
5376 For example on MiKTeX this is done by pressing the button
5379 \begin_inset space ~
5384 that you find in MiKTeX's
5385 \begin_inset Quotes eld
5389 \begin_inset Quotes erd
5393 In both cases you need afterwards to reconfigure LyX using the menu
5394 \begin_inset Flex CharStyle:MenuItem
5397 \begin_layout Plain Layout
5398 Tools\SpecialChar \menuseparator
5404 and then to restart LyX.
5407 \begin_layout Standard
5408 If your LaTeX distribution doesn't provide a user interface, then you can
5409 follow these steps by using a UNIX/Linux console.
5412 \begin_layout Enumerate
5413 Get the package from
5414 \begin_inset CommandInset href
5417 target "http://www.ctan.org/"
5424 \begin_layout Enumerate
5425 You can install this package in several different places.
5426 If you want it to be available for all users on your system, then you should
5427 install it in your `local' TeX tree; if you want (or need) it to be available
5428 just for you, then you can install it in your own `user' TeX tree.
5429 Where these should be created, if they do not already exist, depends upon
5430 the details of your system.
5431 To find out, look in the file
5432 \begin_inset Flex CharStyle:Code
5435 \begin_layout Plain Layout
5445 \begin_layout Plain Layout
5446 This usually lives in the directory
5447 \begin_inset Flex CharStyle:Code
5450 \begin_layout Plain Layout
5456 , though you can run
5457 \begin_inset Flex CharStyle:Code
5460 \begin_layout Plain Layout
5471 The location of the `local' TeX tree is defined by
5472 \begin_inset Flex CharStyle:Code
5475 \begin_layout Plain Layout
5481 ; this is usually somewhere like
5482 \begin_inset Flex CharStyle:Code
5485 \begin_layout Plain Layout
5486 /usr/local/share/texmf/
5492 The `user' TeX tree is defined by
5493 \begin_inset Flex CharStyle:Code
5496 \begin_layout Plain Layout
5503 \begin_inset Flex CharStyle:Code
5506 \begin_layout Plain Layout
5513 (If these variables are not predefined, you can define them.) You'll probably
5514 need root permissions to create or modify the `local' tree; but your `user'
5515 tree shouldn't have such limitations.
5518 \begin_layout Enumerate
5520 \begin_inset Flex CharStyle:Code
5523 \begin_layout Plain Layout
5530 \begin_inset Flex CharStyle:Code
5533 \begin_layout Plain Layout
5540 \begin_inset Flex CharStyle:Code
5543 \begin_layout Plain Layout
5550 \begin_inset space \thinspace{}
5554 \begin_inset Newline newline
5558 \begin_inset Flex CharStyle:Code
5561 \begin_layout Plain Layout
5562 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5568 \begin_inset Newline newline
5571 But, again, most of this will
5572 \begin_inset Quotes eld
5576 \begin_inset Quotes erd
5582 \begin_layout Enumerate
5587 \begin_layout Plain Layout
5588 We'll assume henceforth that you're defining `local' TeX tree.
5589 If you're defining a user tree, just adjust as necessary.
5595 You must follow the directory structure of your existing
5596 \begin_inset Flex CharStyle:Code
5599 \begin_layout Plain Layout
5605 directory, which will be found at
5606 \begin_inset Flex CharStyle:Code
5609 \begin_layout Plain Layout
5616 For example, latex packages should go under
5617 \begin_inset Flex CharStyle:Code
5620 \begin_layout Plain Layout
5621 $TEXMFLOCAL/tex/latex/
5629 \begin_layout Enumerate
5630 Install the package.
5631 For example, you would unpack the FoilTeX tarball and copy it to
5632 \begin_inset Flex CharStyle:Code
5635 \begin_layout Plain Layout
5636 $TEXMFLOCAL/tex/latex/foiltex
5643 \begin_inset Flex CharStyle:Code
5646 \begin_layout Plain Layout
5652 directory contains various files.
5655 \begin_layout Enumerate
5657 \begin_inset Flex CharStyle:Code
5660 \begin_layout Plain Layout
5668 \begin_inset Flex CharStyle:Code
5671 \begin_layout Plain Layout
5680 \begin_layout Standard
5681 Your package is now installed and available to LaTeX.
5682 To make it available to LyX, you need to create a Layout file, if one is
5683 not already available.
5684 (See the next section.) Once you have a layout file, you need only reconfigure
5686 \begin_inset Flex CharStyle:MenuItem
5689 \begin_layout Plain Layout
5690 Tools\SpecialChar \menuseparator
5696 ) and then restart LyX.
5697 You should then see your new package—for example
5698 \begin_inset Flex CharStyle:MenuItem
5701 \begin_layout Plain Layout
5708 \begin_inset Flex CharStyle:MenuItem
5711 \begin_layout Plain Layout
5712 Document\SpecialChar \menuseparator
5719 \begin_inset Flex CharStyle:MenuItem
5722 \begin_layout Plain Layout
5732 \begin_layout Section
5736 \begin_layout Standard
5737 This section describes how to write and install your own LyX layout files
5738 and walks through the
5739 \begin_inset Flex CharStyle:Code
5742 \begin_layout Plain Layout
5748 text class format as an example.
5750 \begin_inset Flex CharStyle:Code
5753 \begin_layout Plain Layout
5759 files describe what paragraph and character styles are available for a
5760 given document class and how LyX should display them.
5761 We try to provide a thorough description of the process here; however,
5762 there are so many different types of documents supported by LaTeX classes
5763 that we can't hope to cover every different possibility or problem you
5765 (The LyX users' list is frequented by people with lots of experience with
5766 layout design who are willing to share what they've learned.)
5769 \begin_layout Standard
5770 As you prepare to write a new layout, it is extremely helpful to look at
5771 the example layouts distributed with LyX.
5772 If you use a nice LaTeX document class that might be of interest for others,
5773 too, and have a nice corresponding LyX layout, feel free to contribute
5774 the stuff to us, so we may put it into the distribution.
5776 \begin_inset CommandInset href
5778 name "section on the LyX wiki"
5779 target "http://wiki.lyx.org/Layouts/Layouts"
5783 for this kind of material.
5786 \begin_layout Standard
5787 All the tags described in this chapter are case-insensitive; this means
5789 \begin_inset Flex CharStyle:Code
5792 \begin_layout Plain Layout
5799 \begin_inset Flex CharStyle:Code
5802 \begin_layout Plain Layout
5809 \begin_inset Flex CharStyle:Code
5812 \begin_layout Plain Layout
5818 are really the same command.
5819 The possible values are printed in brackets after the feature's name.
5820 The default value if a feature isn't specified inside a text class-description
5822 \begin_inset Flex CharStyle:Code
5825 \begin_layout Plain Layout
5834 If the argument has a data type like
5835 \begin_inset Quotes eld
5839 \begin_inset Quotes erd
5843 \begin_inset Quotes eld
5847 \begin_inset Quotes erd
5850 , the default is shown like this:
5851 \begin_inset Flex CharStyle:Code
5854 \begin_layout Plain Layout
5865 \begin_layout Subsection
5867 \begin_inset CommandInset label
5869 name "sub:Layout-modules"
5876 \begin_layout Standard
5877 Similar to layout files, and new with LyX 1.6, are layout
5882 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5883 some modules—such as the endnotes module—provide support for just such
5885 In a sense, layout modules are similar to included files—files like
5886 \begin_inset Flex CharStyle:Code
5889 \begin_layout Plain Layout
5895 —in that modules are not specific to a given document layout but may be
5896 used with many different layouts.
5897 The difference is that using a layout module does not require editing the
5899 Rather, modules are selected in the
5900 \begin_inset Flex CharStyle:MenuItem
5903 \begin_layout Plain Layout
5904 Document\SpecialChar \menuseparator
5913 \begin_layout Standard
5914 Building modules is the easiest way to get started with layout editing,
5915 since it can be as simple as adding a single new paragraph or flex inset.
5916 But modules may, in principle, contain anything a layout file can contain.
5919 \begin_layout Standard
5920 A module must begin with a line like the following:
5923 \begin_layout LyX-Code
5926 DeclareLyXModule[endnotes.sty]{Endnotes}
5929 \begin_layout Standard
5930 The mandatory argument, in curly brackets, is the name of the module, as
5932 \begin_inset Flex CharStyle:MenuItem
5935 \begin_layout Plain Layout
5936 Document\SpecialChar \menuseparator
5943 The argument in square brackets is optional: It declares any LaTeX packages
5944 on which the module depends.
5945 Please note that only packages about which LyX knows should be listed in
5946 the square brackets.
5950 \begin_layout Plain Layout
5951 The list of such packages is documented only in the source code.
5956 LyX will not check for arbitrary packages.
5957 It is also possible to use the form
5958 \begin_inset Flex CharStyle:MenuItem
5961 \begin_layout Plain Layout
5967 , which declares that the module can only be used when there exists a conversion
5968 chain between formats `from' and `to'.
5971 \begin_layout Standard
5972 The module declaration should then be followed by lines like the following:
5975 \begin_layout LyX-Code
5979 \begin_layout LyX-Code
5980 #Adds an endnote command, in addition to footnotes.
5984 \begin_layout LyX-Code
5985 #You will need to add
5987 theendnotes in TeX code where you
5990 \begin_layout LyX-Code
5991 #want the endnotes to appear.
5995 \begin_layout LyX-Code
5999 \begin_layout LyX-Code
6000 #Requires: somemodule | othermodule
6003 \begin_layout LyX-Code
6004 #Excludes: badmodule
6007 \begin_layout Standard
6008 The description is used in
6009 \begin_inset Flex CharStyle:MenuItem
6012 \begin_layout Plain Layout
6013 Document\SpecialChar \menuseparator
6019 to provide the user with information about what the module does.
6021 \begin_inset Flex CharStyle:Code
6024 \begin_layout Plain Layout
6030 line is used to identify other modules with which this one must be used;
6032 \begin_inset Flex CharStyle:Code
6035 \begin_layout Plain Layout
6041 line is used to identify modules with which this one may not be used.
6042 Both are optional, and, as shown, multiple modules should be separated
6043 with the pipe symbol: |.
6044 Note that the required modules are treated disjunctively:
6048 of the required modules must be used.
6053 excluded module may be used.
6054 Note that modules are identified here by their
6058 without the .module extension.
6060 \begin_inset Flex CharStyle:Code
6063 \begin_layout Plain Layout
6070 \begin_inset Flex CharStyle:Code
6073 \begin_layout Plain Layout
6082 \begin_layout Standard
6083 After creating a new module, you will need to reconfigure and then restart
6084 LyX for the module to appear in the menu.
6085 However, changes you make to the module will be seen immediately, if you
6087 \begin_inset Flex CharStyle:MenuItem
6090 \begin_layout Plain Layout
6091 Document\SpecialChar \menuseparator
6097 , highlight something, and then hit
6098 \begin_inset Quotes eld
6102 \begin_inset Quotes erd
6108 It is strongly recommended that you save your work before doing so
6113 it is strongly recommended that you not attempt to edit modules while simultaneo
6114 usly working on documents
6117 Though of course the developers strive to keep LyX stable in such situations,
6118 syntax errors and the like in your module file could cause strange behavior.
6121 \begin_layout Subsection
6122 Supporting new document classes
6125 \begin_layout Standard
6126 There are two situations you are likely to encounter when wanting to support
6127 a new LaTeX document class, involving LaTeX2e class (
6128 \begin_inset Flex CharStyle:Code
6131 \begin_layout Plain Layout
6138 \begin_inset Flex CharStyle:Code
6141 \begin_layout Plain Layout
6148 Supporting a style file is usually fairly easy.
6149 Supporting a new document class is a bit harder.
6152 \begin_layout Subsection
6154 \begin_inset Flex CharStyle:MenuItem
6157 \begin_layout Plain Layout
6166 \begin_layout Standard
6167 If your new document class is provided as a style file that is used in conjuncti
6168 on with an existing, supported document class—for the sake of the example,
6169 we'll assume that the style file is called
6170 \begin_inset Flex CharStyle:MenuItem
6173 \begin_layout Plain Layout
6179 and it is meant to be used with
6180 \begin_inset Flex CharStyle:MenuItem
6183 \begin_layout Plain Layout
6189 , which is a standard class—start by copying the existing class's layout
6190 file into your local directory:
6193 \begin_layout LyX-Code
6194 cp report.layout ~/.lyx/layouts/myclass.layout
6197 \begin_layout Standard
6199 \begin_inset Flex CharStyle:Code
6202 \begin_layout Plain Layout
6208 and change the line:
6211 \begin_layout LyX-Code
6214 DeclareLaTeXClass{report}
6217 \begin_layout Standard
6221 \begin_layout LyX-Code
6224 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6227 \begin_layout Standard
6231 \begin_layout LyX-Code
6233 \begin_inset Newline newline
6239 \begin_inset Newline newline
6245 \begin_layout Standard
6246 near the top of the file.
6249 \begin_layout Standard
6250 Start LyX and select
6251 \begin_inset Flex CharStyle:MenuItem
6254 \begin_layout Plain Layout
6255 Tools\SpecialChar \menuseparator
6262 Then restart LyX and try creating a new document.
6264 \begin_inset Flex CharStyle:MenuItem
6267 \begin_layout Plain Layout
6273 " as a document class option in the
6274 \begin_inset Flex CharStyle:MenuItem
6277 \begin_layout Plain Layout
6278 Document\SpecialChar \menuseparator
6285 It is likely that some of the sectioning commands and such in your new
6286 class will work differently from how they worked in the base class—
6287 \begin_inset Flex CharStyle:Code
6290 \begin_layout Plain Layout
6296 in this example—so you can fiddle around with the settings for the different
6297 sections if you wish.
6300 \begin_layout Subsection
6302 \begin_inset Flex CharStyle:MenuItem
6305 \begin_layout Plain Layout
6314 \begin_layout Standard
6315 There are two possibilities here.
6316 One is that the class file is itself based upon an existing document class.
6317 For example, many thesis classes are based upon
6318 \begin_inset Flex CharStyle:MenuItem
6321 \begin_layout Plain Layout
6328 To see whether yours is, look for a line like
6331 \begin_layout LyX-Code
6337 \begin_layout Standard
6339 If so, then you may proceed largely as in the previous section, though
6340 the DeclareLaTeXClass line will be different.
6341 If your new class is thesis, and it is based upon book, then the line should
6346 \begin_layout Plain Layout
6347 And it will be easiest if you save the file to
6348 \begin_inset Flex CharStyle:Code
6351 \begin_layout Plain Layout
6357 : LyX assumes that the document class has the same name as the layout file.
6366 \begin_layout LyX-Code
6369 DeclareLaTeXClass[thesis,book]{thesis}
6372 \begin_layout Standard
6373 If, on the other hand, the new class is not based upon an existing class,
6374 you will probably have to
6375 \begin_inset Quotes eld
6379 \begin_inset Quotes erd
6383 We strongly suggest copying an existing layout file which uses a similar
6384 LaTeX class and then modifying it, if you can do so.
6385 At least use an existing file as a starting point so you can find out what
6386 items you need to worry about.
6387 Again, the specifics are covered below.
6390 \begin_layout Section
6391 Declaring a new text class
6394 \begin_layout Standard
6395 When it's finally time to get your hands dirty and create or edit your own
6396 layout file, the following sections describe what you're up against.
6397 Our advice is to go slowly, save and test often, listen to soothing music,
6398 and enjoy one or two of your favorite adult beverages; more if you are
6399 getting particularly stuck.
6400 It's really not that hard, except that the multitude of options can become
6401 overwhelming if you try to do to much in one sitting.
6402 Go have another adult beverage, just for good measure.
6405 \begin_layout Standard
6409 \begin_layout Standard
6410 Lines in a layout file which begin with a
6411 \begin_inset Flex CharStyle:Code
6414 \begin_layout Plain Layout
6421 There is one exception to this rule: all layouts should begin with lines
6425 \begin_layout LyX-Code
6428 #% Do not delete the line below; configure depends on this
6431 \begin_layout LyX-Code
6436 DeclareLaTeXClass{article}
6439 \begin_layout Standard
6440 The second line is used when you configure LyX.
6441 The layout file is read by the LaTeX script
6442 \begin_inset Flex CharStyle:Code
6445 \begin_layout Plain Layout
6451 , in a special mode where
6452 \begin_inset Flex CharStyle:Code
6455 \begin_layout Plain Layout
6462 The first line is just a LaTeX comment, and the second one contains the
6463 declaration of the text class.
6464 If these lines appear in a file named
6465 \begin_inset Flex CharStyle:Code
6468 \begin_layout Plain Layout
6474 , then they define a text class of name
6475 \begin_inset Flex CharStyle:Code
6478 \begin_layout Plain Layout
6484 (the name of the layout file) which uses the LaTeX document class
6485 \begin_inset Flex CharStyle:Code
6488 \begin_layout Plain Layout
6494 (the default is to use the same name as the layout).
6496 \begin_inset Quotes eld
6500 \begin_inset Quotes erd
6503 that appears above is used as a description of the text class in the
6504 \begin_inset Flex CharStyle:MenuItem
6507 \begin_layout Plain Layout
6508 Document\SpecialChar \menuseparator
6517 \begin_layout Standard
6518 Let's assume that you wrote your own text class that uses the
6519 \begin_inset Flex CharStyle:Code
6522 \begin_layout Plain Layout
6528 document class, but where you changed the appearance of the section headings.
6529 If you put it in a file
6530 \begin_inset Flex CharStyle:Code
6533 \begin_layout Plain Layout
6539 , the header of this file should be:
6542 \begin_layout LyX-Code
6545 #% Do not delete the line below; configure depends on this
6548 \begin_layout LyX-Code
6553 DeclareLaTeXClass[article]{article (with my own headings)}
6556 \begin_layout Standard
6557 This declares a text class
6558 \begin_inset Flex CharStyle:Code
6561 \begin_layout Plain Layout
6567 , associated with the LaTeX document class
6568 \begin_inset Flex CharStyle:Code
6571 \begin_layout Plain Layout
6578 \begin_inset Quotes eld
6581 article (with my own headings)
6582 \begin_inset Quotes erd
6586 If your text class depends on several packages, you can declare it as:
6589 \begin_layout LyX-Code
6592 #% Do not delete the line below; configure depends on this
6595 \begin_layout LyX-Code
6600 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6603 \begin_layout Standard
6604 This indicates that your text class uses the foo.sty package.
6605 Finally, it is also possible to declare classes for DocBook code.
6606 Typical declarations will look like
6609 \begin_layout LyX-Code
6612 #% Do not delete the line below; configure depends on this
6615 \begin_layout LyX-Code
6620 DeclareDocBookClass[article]{SGML (DocBook article)}
6623 \begin_layout Standard
6624 Note that these declarations can also be given an optional parameter declaring
6625 the name of the document class (but not a list).
6628 \begin_layout Standard
6629 So, to be as explicit as possible, the form of the layout declaration is:
6632 \begin_layout LyX-Code
6637 DeclareLaTeXClass[class,package.sty]{layout description}
6640 \begin_layout Standard
6641 The class need only be specified if the name of the LaTeX class file and
6642 the name of the layout file are different; if the name of the class file
6643 is not specified, then LyX will simply assume that it is the same as the
6644 name of the layout file.
6647 \begin_layout Standard
6648 When the text class has been modified to your taste, all you have to do
6649 is to copy it either to
6650 \begin_inset Flex CharStyle:Code
6653 \begin_layout Plain Layout
6660 \begin_inset Flex CharStyle:Code
6663 \begin_layout Plain Layout
6670 \begin_inset Flex CharStyle:MenuItem
6673 \begin_layout Plain Layout
6674 Tools\SpecialChar \menuseparator
6680 , exit LyX and restart it.
6681 Then your new text class should be available along with the others.
6684 \begin_layout Standard
6685 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6686 you made to your layout files.
6687 As a result, editing layout files could be very time consuming.
6688 Beginning with 1.6, however, you can force a reload of the layout currently
6689 in use by using the LyX function
6690 \begin_inset Flex CharStyle:MenuItem
6693 \begin_layout Plain Layout
6700 There is no default binding for this function—though, of course, you can
6701 bind it to a key yourself.
6702 If you want to use this function, then, you should simply enter it in the
6708 : This is very much an `advanced feature'.
6713 recommended that you save your work before using this function.
6718 recommended that you not attempt to edit your layout while simultaneously
6719 working on a document that you care about.
6720 Use a test document.
6721 Syntax errors and the like in your layout file could cause peculiar behavior.
6722 In particular, such errors could cause LyX to regard the current layout
6723 as invalid and to attempt to switch to some other layout.
6724 The LyX team strives to keep LyX stable in such situations, but safe is
6728 \begin_layout Subsection
6732 \begin_layout Standard
6733 The first non-comment line must contain the file format number:
6736 \begin_layout Description
6737 \begin_inset Flex CharStyle:Code
6740 \begin_layout Plain Layout
6747 \begin_inset Flex CharStyle:Code
6750 \begin_layout Plain Layout
6756 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6757 don't have an explicit file format).
6758 The file format that is documented here is format 14.
6761 \begin_layout Subsection
6762 General text class parameters
6765 \begin_layout Standard
6766 These are the general parameters which describe the form of the entire document:
6769 \begin_layout Description
6770 \begin_inset Flex CharStyle:Code
6773 \begin_layout Plain Layout
6779 Adds information to the document preamble.
6781 \begin_inset Quotes eld
6785 \begin_inset Flex CharStyle:Code
6788 \begin_layout Plain Layout
6795 \begin_inset Quotes erd
6801 \begin_layout Description
6802 \begin_inset Flex CharStyle:Code
6805 \begin_layout Plain Layout
6811 Describes various global options supported by the document class.
6813 \begin_inset space ~
6817 \begin_inset CommandInset ref
6819 reference "sub:ClassOptions"
6825 \begin_inset Quotes eld
6829 \begin_inset Flex CharStyle:Code
6832 \begin_layout Plain Layout
6839 \begin_inset Quotes erd
6845 \begin_layout Description
6846 \begin_inset Flex CharStyle:Code
6849 \begin_layout Plain Layout
6856 \begin_inset Flex CharStyle:Code
6859 \begin_layout Plain Layout
6868 \begin_inset Flex CharStyle:Code
6871 \begin_layout Plain Layout
6877 ] Whether the class should default to having one or two columns.
6878 Can be changed in the
6879 \begin_inset Flex CharStyle:MenuItem
6882 \begin_layout Plain Layout
6883 Document\SpecialChar \menuseparator
6892 \begin_layout Description
6893 \begin_inset Flex CharStyle:Code
6896 \begin_layout Plain Layout
6903 \begin_inset Flex CharStyle:Code
6906 \begin_layout Plain Layout
6912 ] This sequence defines the properties for a counter.
6913 If the counter does not yet exist, it is created; if it does exist, it
6916 \begin_inset Quotes eld
6920 \begin_inset Flex CharStyle:Code
6923 \begin_layout Plain Layout
6930 \begin_inset Quotes erd
6934 \begin_inset Newline newline
6938 \begin_inset space ~
6942 \begin_inset CommandInset ref
6944 reference "sub:Counters"
6948 for details on counters.
6951 \begin_layout Description
6952 \begin_inset Flex CharStyle:Code
6955 \begin_layout Plain Layout
6961 Sets the default font used to display the document.
6963 \begin_inset space ~
6967 \begin_inset CommandInset ref
6969 reference "sub:Font-description"
6973 for how to declare fonts.
6975 \begin_inset Quotes eld
6979 \begin_inset Flex CharStyle:Code
6982 \begin_layout Plain Layout
6989 \begin_inset Quotes erd
6995 \begin_layout Description
6996 \begin_inset Flex CharStyle:Code
6999 \begin_layout Plain Layout
7006 \begin_inset Flex CharStyle:Code
7009 \begin_layout Plain Layout
7015 Specifies a module to be included by default with this document class,
7016 which should be specified by filename without the
7017 \begin_inset Flex CharStyle:Code
7020 \begin_layout Plain Layout
7027 The user can still remove the module, but it will be active at the outset.
7028 (This applies only when new files are created, or when this class is chosen
7029 for an existing document.)
7032 \begin_layout Description
7033 \begin_inset Flex CharStyle:Code
7036 \begin_layout Plain Layout
7043 \begin_inset Flex CharStyle:Code
7046 \begin_layout Plain Layout
7052 ] This is the style that will be assigned to new paragraphs, usually
7053 \begin_inset Flex CharStyle:MenuItem
7056 \begin_layout Plain Layout
7063 This will default to the first defined style if not given, but you are
7064 highly encouraged to use this directive.
7067 \begin_layout Description
7068 \begin_inset Flex CharStyle:Code
7071 \begin_layout Plain Layout
7078 \begin_inset Flex CharStyle:Code
7081 \begin_layout Plain Layout
7087 ] Indicates that the module in question—which should be specified by filename
7089 \begin_inset Flex CharStyle:Code
7092 \begin_layout Plain Layout
7098 extension—cannot be used with this document class.
7099 This might be used in a journal-specific layout file to prevent, say, the
7101 \begin_inset Flex CharStyle:Code
7104 \begin_layout Plain Layout
7110 module that numbers theorems by section.
7115 be used in a module.
7116 Modules have their own way of excluding other modules (see
7117 \begin_inset CommandInset ref
7119 reference "sub:Layout-modules"
7126 \begin_layout Description
7127 \begin_inset Flex CharStyle:Code
7130 \begin_layout Plain Layout
7136 Defines a new float.
7138 \begin_inset space ~
7142 \begin_inset CommandInset ref
7144 reference "sub:Floats"
7150 \begin_inset Quotes eld
7154 \begin_inset Flex CharStyle:Code
7157 \begin_layout Plain Layout
7164 \begin_inset Quotes erd
7170 \begin_layout Description
7171 \begin_inset Flex CharStyle:Code
7174 \begin_layout Plain Layout
7181 \begin_inset Flex CharStyle:Code
7184 \begin_layout Plain Layout
7190 ] Modifies the properties of the given counter.
7191 If the counter does not exist, the section is ignored.
7193 \begin_inset Quotes eld
7197 \begin_inset Flex CharStyle:Code
7200 \begin_layout Plain Layout
7207 \begin_inset Quotes erd
7213 \begin_layout Description
7214 \begin_inset Flex CharStyle:Code
7217 \begin_layout Plain Layout
7224 \begin_inset Flex CharStyle:Code
7227 \begin_layout Plain Layout
7233 ] Modifies the properties of the given paragraph style.
7234 If the style does not exist, the section is ignored.
7236 \begin_inset Quotes eld
7240 \begin_inset Flex CharStyle:Code
7243 \begin_layout Plain Layout
7250 \begin_inset Quotes erd
7256 \begin_layout Description
7257 \begin_inset Flex CharStyle:Code
7260 \begin_layout Plain Layout
7266 As its name implies, this command allows you to include another layout
7267 definition file within yours to avoid duplicating commands.
7268 Common examples are the standard layout files, for example,
7269 \begin_inset Flex CharStyle:Code
7272 \begin_layout Plain Layout
7278 , which contains most of the basic layouts.
7281 \begin_layout Description
7282 \begin_inset Flex CharStyle:Code
7285 \begin_layout Plain Layout
7291 This section (re-)defines the layout of an inset.
7292 It can be applied to an existing inset of to a new, user-defined inset,
7294 \begin_inset space \thinspace{}
7298 \begin_inset space \space{}
7301 a new character style.
7303 \begin_inset space ~
7307 \begin_inset CommandInset ref
7309 reference "sub:Flex-insets-and"
7313 for more information.
7315 \begin_inset Quotes eld
7319 \begin_inset Flex CharStyle:Code
7322 \begin_layout Plain Layout
7329 \begin_inset Quotes erd
7335 \begin_layout Description
7336 \begin_inset Flex CharStyle:Code
7339 \begin_layout Plain Layout
7345 A string that indicates the width of the left margin on the screen, for
7347 \begin_inset Quotes eld
7351 \begin_inset Quotes erd
7357 \begin_layout Description
7358 \begin_inset Flex CharStyle:Code
7361 \begin_layout Plain Layout
7367 This command deletes an existing float.
7368 This is particularly useful when you want to suppress a float that has
7369 be defined in an input file.
7372 \begin_layout Description
7373 \begin_inset Flex CharStyle:Code
7376 \begin_layout Plain Layout
7382 This command deletes an existing style.
7383 This is particularly useful when you want to suppress a style that has
7384 be defined in an input file.
7387 \begin_layout Description
7388 \begin_inset Flex CharStyle:Code
7391 \begin_layout Plain Layout
7397 A string indicating the file format (as defined in the Preferences dialog)
7398 produced by this class.
7399 It is mainly useful when
7400 \begin_inset Flex CharStyle:Code
7403 \begin_layout Plain Layout
7409 is `literate' and one wants to define a new type of literate document.
7410 This string is reset to `docbook', `latex', or `literate' when the correspondin
7412 \begin_inset Flex CharStyle:Code
7415 \begin_layout Plain Layout
7421 parameter is encountered.
7424 \begin_layout Description
7425 \begin_inset Flex CharStyle:Code
7428 \begin_layout Plain Layout
7434 A string indicating what sort of output documents using this class will
7436 At present, the options are: `docbook', `latex', and `literate'.
7439 \begin_layout Description
7440 \begin_inset Flex CharStyle:Code
7443 \begin_layout Plain Layout
7454 \begin_inset Flex CharStyle:Code
7457 \begin_layout Plain Layout
7468 \begin_inset Flex CharStyle:Code
7471 \begin_layout Plain Layout
7478 \begin_inset Flex CharStyle:Code
7481 \begin_layout Plain Layout
7487 ] The class default pagestyle.
7488 Can be changed in the
7489 \begin_inset Flex CharStyle:MenuItem
7492 \begin_layout Plain Layout
7493 Document\SpecialChar \menuseparator
7502 \begin_layout Description
7503 \begin_inset Flex CharStyle:Code
7506 \begin_layout Plain Layout
7512 Sets the preamble for the LaTeX document.
7513 Note that this will completely override any prior
7514 \begin_inset Flex CharStyle:Code
7517 \begin_layout Plain Layout
7524 \begin_inset Flex CharStyle:Code
7527 \begin_layout Plain Layout
7535 \begin_inset Quotes eld
7539 \begin_inset Flex CharStyle:Code
7542 \begin_layout Plain Layout
7549 \begin_inset Quotes erd
7555 \begin_layout Description
7556 \begin_inset Flex CharStyle:Code
7559 \begin_layout Plain Layout
7566 \begin_inset Flex CharStyle:Code
7569 \begin_layout Plain Layout
7576 \begin_inset Flex CharStyle:Code
7579 \begin_layout Plain Layout
7588 \begin_inset Flex CharStyle:Code
7591 \begin_layout Plain Layout
7597 ] Whether the class already provides the feature
7598 \begin_inset Flex CharStyle:Code
7601 \begin_layout Plain Layout
7608 A feature is in general the name of a package (
7609 \begin_inset Flex CharStyle:Code
7612 \begin_layout Plain Layout
7619 \begin_inset Flex CharStyle:Code
7622 \begin_layout Plain Layout
7628 , \SpecialChar \ldots{}
7630 \begin_inset Flex CharStyle:Code
7633 \begin_layout Plain Layout
7640 \begin_inset Flex CharStyle:Code
7643 \begin_layout Plain Layout
7649 ,\SpecialChar \ldots{}
7650 ); the complete list of supported features is unfortunately not documented
7651 outside the LyX source code—but see
7652 \begin_inset Flex CharStyle:Code
7655 \begin_layout Plain Layout
7661 if you're interested.
7663 \begin_inset Flex CharStyle:MenuItem
7666 \begin_layout Plain Layout
7667 Help\SpecialChar \menuseparator
7673 also gives an overview of the supported packages.
7676 \begin_layout Description
7677 \begin_inset Flex CharStyle:Code
7680 \begin_layout Plain Layout
7687 \begin_inset Flex CharStyle:Code
7690 \begin_layout Plain Layout
7696 ] Indicates that this layout provides the functionality of the module mentioned,
7697 which should be specified by the filename without the
7698 \begin_inset Flex CharStyle:Code
7701 \begin_layout Plain Layout
7708 This will typically be used if the layout includes the module directly,
7709 rather than using the
7710 \begin_inset Flex CharStyle:Code
7713 \begin_layout Plain Layout
7719 tag to indicate that it ought to be used.
7720 It could be used in a module that provided an alternate implementation
7721 of the same functionality.
7724 \begin_layout Description
7725 \begin_inset Flex CharStyle:Code
7728 \begin_layout Plain Layout
7735 \begin_inset Flex CharStyle:Code
7738 \begin_layout Plain Layout
7744 ] Whether the class requires the feature
7745 \begin_inset Flex CharStyle:Code
7748 \begin_layout Plain Layout
7755 Multiple features must be separated by commas.
7756 Note that you can only request supported features.
7759 \begin_layout Description
7760 \begin_inset Flex CharStyle:Code
7763 \begin_layout Plain Layout
7769 A string that indicates the width of the right margin on the screen, for
7771 \begin_inset Quotes eld
7775 \begin_inset Quotes erd
7781 \begin_layout Description
7782 \begin_inset Flex CharStyle:Code
7785 \begin_layout Plain Layout
7791 Sets which divisions get numbered.
7793 \begin_inset Flex CharStyle:Code
7796 \begin_layout Plain Layout
7805 \begin_layout Description
7806 \begin_inset Flex CharStyle:Code
7809 \begin_layout Plain Layout
7818 \begin_inset Flex CharStyle:Code
7821 \begin_layout Plain Layout
7832 \begin_inset Flex CharStyle:Code
7835 \begin_layout Plain Layout
7841 ] Whether the class-default should be printing on one or both sides of the
7843 Can be changed in the
7844 \begin_inset Flex CharStyle:MenuItem
7847 \begin_layout Plain Layout
7848 Document\SpecialChar \menuseparator
7857 \begin_layout Description
7858 \begin_inset Flex CharStyle:Code
7861 \begin_layout Plain Layout
7867 This sequence defines a paragraph style.
7868 If the style does not yet exist, it is created; if it does exist, its parameter
7869 s are redefined Must end with
7870 \begin_inset Quotes eld
7874 \begin_inset Flex CharStyle:Code
7877 \begin_layout Plain Layout
7884 \begin_inset Quotes erd
7888 \begin_inset Newline newline
7892 \begin_inset space ~
7896 \begin_inset CommandInset ref
7898 reference "sub:Paragraph-Styles"
7902 for details on paragraph styles.
7905 \begin_layout Description
7906 \begin_inset Flex CharStyle:Code
7909 \begin_layout Plain Layout
7916 \begin_inset Flex CharStyle:Code
7919 \begin_layout Plain Layout
7925 ] The name of the command or environment to be used with
7926 \begin_inset Flex CharStyle:Code
7929 \begin_layout Plain Layout
7938 \begin_layout Description
7939 \begin_inset Flex CharStyle:Code
7942 \begin_layout Plain Layout
7949 \begin_inset Flex CharStyle:Code
7952 \begin_layout Plain Layout
7961 \begin_inset Flex CharStyle:Code
7964 \begin_layout Plain Layout
7970 ] Indicates what kind of markup is used to define the title of a document.
7972 \begin_inset Flex CharStyle:Code
7975 \begin_layout Plain Layout
7981 means that the macro with name
7982 \begin_inset Flex CharStyle:Code
7985 \begin_layout Plain Layout
7991 will be inserted after the last layout which has
7992 \begin_inset Quotes eld
7996 \begin_inset Flex CharStyle:Code
7999 \begin_layout Plain Layout
8006 \begin_inset Quotes erd
8011 \begin_inset Flex CharStyle:Code
8014 \begin_layout Plain Layout
8020 corresponds to the case where the block of paragraphs which have
8021 \begin_inset Quotes eld
8025 \begin_inset Flex CharStyle:Code
8028 \begin_layout Plain Layout
8035 \begin_inset Quotes erd
8038 should be enclosed into the
8039 \begin_inset Flex CharStyle:Code
8042 \begin_layout Plain Layout
8051 \begin_layout Description
8052 \begin_inset Flex CharStyle:Code
8055 \begin_layout Plain Layout
8061 Sets which divisions are included in the table of contents.
8063 \begin_inset Flex CharStyle:Code
8066 \begin_layout Plain Layout
8075 \begin_layout Subsection
8076 \begin_inset Flex CharStyle:Code
8079 \begin_layout Plain Layout
8086 \begin_inset CommandInset label
8088 name "sub:ClassOptions"
8095 \begin_layout Standard
8097 \begin_inset Flex CharStyle:Code
8100 \begin_layout Plain Layout
8106 section can contain the following entries:
8109 \begin_layout Description
8110 \begin_inset Flex CharStyle:Code
8113 \begin_layout Plain Layout
8120 \begin_inset Flex CharStyle:Code
8123 \begin_layout Plain Layout
8129 ] The list of available font sizes for the document's main font, separated
8131 \begin_inset Quotes eld
8135 \begin_inset Flex CharStyle:Code
8138 \begin_layout Plain Layout
8145 \begin_inset Quotes erd
8151 \begin_layout Description
8152 \begin_inset Flex CharStyle:Code
8155 \begin_layout Plain Layout
8161 Used to set the DTD line with XML-based output classes.
8163 \begin_inset space \thinspace{}
8167 \begin_inset Quotes eld
8170 -//OASIS//DTD DocBook V4.2//EN
8171 \begin_inset Quotes erd
8177 \begin_layout Description
8178 \begin_inset Flex CharStyle:Code
8181 \begin_layout Plain Layout
8188 \begin_inset Flex CharStyle:Code
8191 \begin_layout Plain Layout
8192 string="empty|plain|headings|fancy"
8197 ] The list of available page styles, separated by
8198 \begin_inset Quotes eld
8202 \begin_inset Flex CharStyle:Code
8205 \begin_layout Plain Layout
8212 \begin_inset Quotes erd
8218 \begin_layout Description
8219 \begin_inset Flex CharStyle:Code
8222 \begin_layout Plain Layout
8229 \begin_inset Flex CharStyle:Code
8232 \begin_layout Plain Layout
8238 ] Some document class options, separated by a comma, that will be added
8239 to the optional part of the
8240 \begin_inset Flex CharStyle:Code
8243 \begin_layout Plain Layout
8254 \begin_layout Standard
8256 \begin_inset Flex CharStyle:Code
8259 \begin_layout Plain Layout
8265 section must end with
8266 \begin_inset Quotes eld
8270 \begin_inset Flex CharStyle:Code
8273 \begin_layout Plain Layout
8280 \begin_inset Quotes erd
8286 \begin_layout Subsection
8288 \begin_inset CommandInset label
8290 name "sub:Paragraph-Styles"
8297 \begin_layout Standard
8298 A paragraph style description looks like this:
8302 \begin_layout Plain Layout
8303 Note that this will either define a new layout or modify an existing one.
8311 \begin_layout LyX-Code
8318 \begin_layout LyX-Code
8322 \begin_layout LyX-Code
8326 \begin_layout Standard
8327 where the following commands are allowed:
8330 \begin_layout Description
8331 \begin_inset Flex CharStyle:Code
8334 \begin_layout Plain Layout
8341 \begin_inset Flex CharStyle:Code
8344 \begin_layout Plain Layout
8349 , left, right, center
8354 ] Paragraph alignment.
8357 \begin_layout Description
8358 \begin_inset Flex CharStyle:Code
8361 \begin_layout Plain Layout
8368 \begin_inset Flex CharStyle:Code
8371 \begin_layout Plain Layout
8376 , left, right, center
8381 ] A comma separated list of permitted alignments.
8382 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8384 For example a right-aligned or centered enumeration isn't possible.)
8387 \begin_layout Description
8388 \begin_inset Flex CharStyle:Code
8391 \begin_layout Plain Layout
8397 Language dependent information to be included in the LaTeX preamble when
8399 Note that this will completely override any prior
8400 \begin_inset Flex CharStyle:Code
8403 \begin_layout Plain Layout
8411 \begin_inset Quotes eld
8415 \begin_inset Flex CharStyle:Code
8418 \begin_layout Plain Layout
8425 \begin_inset Quotes erd
8429 The contents of this tag will occur once in the LaTeX preamble for each
8430 language used by the document.
8431 Each time, the following substitutions are made:
8435 \begin_layout Itemize
8436 \begin_inset Flex CharStyle:Code
8439 \begin_layout Plain Layout
8445 is replaced by the language name (as used by the babel package).
8448 \begin_layout Itemize
8450 \begin_inset Quotes eld
8454 \begin_inset Quotes erd
8458 \begin_inset Flex CharStyle:Code
8461 \begin_layout Plain Layout
8467 replaces its argument by the translation of the argument to the current
8471 \begin_layout Standard
8472 This preamble snippet will only be used if the document contains more than
8473 one language and the babel package is used.
8477 \begin_layout Description
8478 \begin_inset Flex CharStyle:Code
8481 \begin_layout Plain Layout
8488 \begin_inset Flex CharStyle:Code
8491 \begin_layout Plain Layout
8501 \begin_layout Plain Layout
8502 Note that a `float' here is a real number, such as: 1.5.
8507 The vertical space with which the last of a chain of paragraphs with this
8508 layout is separated from the following paragraph.
8509 If the next paragraph has another layout, the separations are not simply
8510 added, but the maximum is taken.
8513 \begin_layout Description
8514 \begin_inset Flex CharStyle:Code
8517 \begin_layout Plain Layout
8524 \begin_inset Flex CharStyle:Code
8527 \begin_layout Plain Layout
8533 The category for this style.
8534 This is used to group related styles in the Layout combobox on the toolbar.
8535 Any string can be used, but you may want to use existing categories with
8540 \begin_layout Description
8541 \begin_inset Flex CharStyle:Code
8544 \begin_layout Plain Layout
8550 Depth of XML command.
8551 Used only with XML-type formats.
8554 \begin_layout Description
8555 \begin_inset Flex CharStyle:Code
8558 \begin_layout Plain Layout
8565 \begin_inset CommandInset label
8567 name "des:CopyStyle"
8572 \begin_inset Flex CharStyle:Code
8575 \begin_layout Plain Layout
8581 Copies all the features of an existing style into the current one.
8585 \begin_layout Description
8586 \begin_inset Flex CharStyle:Code
8589 \begin_layout Plain Layout
8595 The name of a style whose preamble should be output
8600 This allows to ensure some ordering of the preamble snippets when macros
8601 definitions depend on one another.
8605 \begin_layout Plain Layout
8606 Note that, besides that functionality, there is no way to ensure any ordering
8608 The ordering that you see in a given version of LyX may change without
8609 warning in later versions.
8617 \begin_layout Description
8618 \begin_inset Flex CharStyle:Code
8621 \begin_layout Plain Layout
8628 \begin_inset Flex CharStyle:Code
8631 \begin_layout Plain Layout
8636 , Box, Filled_Box, Static
8641 ] The type of label that stands at the end of the paragraph (or sequence
8643 \begin_inset Flex CharStyle:Code
8646 \begin_layout Plain Layout
8653 \begin_inset Flex CharStyle:Code
8656 \begin_layout Plain Layout
8663 \begin_inset Flex CharStyle:Code
8666 \begin_layout Plain Layout
8673 \begin_inset Flex CharStyle:Code
8676 \begin_layout Plain Layout
8684 \begin_inset Flex CharStyle:Code
8687 \begin_layout Plain Layout
8694 \begin_inset Quotes eld
8698 \begin_inset Quotes erd
8702 \begin_inset Flex CharStyle:Code
8705 \begin_layout Plain Layout
8712 \begin_inset Flex CharStyle:Code
8715 \begin_layout Plain Layout
8716 \begin_inset space ~
8725 \begin_inset space ~
8728 black) square suitable for end of proof markers,
8729 \begin_inset Flex CharStyle:Code
8732 \begin_layout Plain Layout
8738 is an explicit text string.
8741 \begin_layout Description
8742 \begin_inset Flex CharStyle:Code
8745 \begin_layout Plain Layout
8752 \begin_inset Flex CharStyle:Code
8755 \begin_layout Plain Layout
8761 ] The string used for a label with a
8762 \begin_inset Flex CharStyle:Code
8765 \begin_layout Plain Layout
8772 \begin_inset Flex CharStyle:Code
8775 \begin_layout Plain Layout
8785 \begin_layout Description
8786 \begin_inset Flex CharStyle:Code
8789 \begin_layout Plain Layout
8796 \begin_inset Flex CharStyle:Code
8799 \begin_layout Plain Layout
8810 \begin_inset Flex CharStyle:Code
8813 \begin_layout Plain Layout
8822 \begin_layout Description
8823 \begin_inset Flex CharStyle:Code
8826 \begin_layout Plain Layout
8833 \begin_inset Flex CharStyle:Code
8836 \begin_layout Plain Layout
8846 ] With this parameter the
8847 \begin_inset Flex CharStyle:MenuItem
8850 \begin_layout Plain Layout
8857 \begin_inset Quotes eld
8860 Vertical space above
8861 \begin_inset Quotes erd
8865 \begin_inset Flex CharStyle:MenuItem
8868 \begin_layout Plain Layout
8869 Edit\SpecialChar \menuseparator
8871 \begin_inset space ~
8879 dialog can be set when initializing a paragraph with this style.
8883 \begin_layout Plain Layout
8886 Note from Jean-Marc:
8888 I'm not sure that this setting has much use, and it should probably be
8889 removed in later versions.
8897 \begin_layout Description
8898 \begin_inset Flex CharStyle:Code
8901 \begin_layout Plain Layout
8907 The font used for both the text body
8913 \begin_inset space ~
8917 \begin_inset CommandInset ref
8919 reference "sub:Font-description"
8924 Note that defining this font automatically defines the
8925 \begin_inset Flex CharStyle:Code
8928 \begin_layout Plain Layout
8935 So you should define this one first if you also want to define
8936 \begin_inset Flex CharStyle:Code
8939 \begin_layout Plain Layout
8948 \begin_layout Description
8949 \begin_inset Flex CharStyle:Code
8952 \begin_layout Plain Layout
8959 \begin_inset CommandInset label
8961 name "des:FreeSpacing"
8968 \begin_inset Flex CharStyle:Code
8971 \begin_layout Plain Layout
8982 \begin_inset Flex CharStyle:Code
8985 \begin_layout Plain Layout
8991 ] Usually LyX doesn't allow you to insert more than one space between words,
8992 since a space is considered as the separation between two words, not a
8993 character or symbol of its own.
8994 This is a very fine thing but sometimes annoying, for example, when typing
8995 program code or plain LaTeX code.
8997 \begin_inset Flex CharStyle:Code
9000 \begin_layout Plain Layout
9007 Note that LyX will create protected blanks for the additional blanks when
9008 in another mode than LaTeX-mode.
9011 \begin_layout Description
9012 \begin_inset Flex CharStyle:Code
9015 \begin_layout Plain Layout
9021 [[FIXME]] (Used only with XML-type formats.)
9024 \begin_layout Description
9025 \begin_inset Flex CharStyle:Code
9028 \begin_layout Plain Layout
9035 \begin_inset Flex CharStyle:Code
9038 \begin_layout Plain Layout
9044 If 1, marks the layout as being part of a title block (see also the
9045 \begin_inset Flex CharStyle:Code
9048 \begin_layout Plain Layout
9055 \begin_inset Flex CharStyle:Code
9058 \begin_layout Plain Layout
9067 \begin_layout Description
9068 \begin_inset Flex CharStyle:Code
9071 \begin_layout Plain Layout
9078 \begin_inset Flex CharStyle:Code
9081 \begin_layout Plain Layout
9087 ] This provides extra space between paragraphs that have the same layout.
9088 If you put other layouts into an environment, each is separated with the
9090 \begin_inset Flex CharStyle:Code
9093 \begin_layout Plain Layout
9100 But the whole items of the environment are additionally separated with
9102 \begin_inset Flex CharStyle:Code
9105 \begin_layout Plain Layout
9117 \begin_layout Description
9118 \begin_inset Flex CharStyle:Code
9121 \begin_layout Plain Layout
9127 [[FIXME]] (Used only with XML-type formats.)
9130 \begin_layout Description
9131 \begin_inset Flex CharStyle:Code
9134 \begin_layout Plain Layout
9141 \begin_inset CommandInset label
9143 name "des:KeepEmpty"
9150 \begin_inset Flex CharStyle:Code
9153 \begin_layout Plain Layout
9164 \begin_inset Flex CharStyle:Code
9167 \begin_layout Plain Layout
9173 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9174 lead to empty LaTeX output.
9175 There are some cases where this could be desirable however: in a letter
9176 template, the required fields can be provided as empty fields, so that
9177 people do not forget them; in some special classes, a layout can be used
9178 as some kind of break, which does not contain actual text.
9181 \begin_layout Description
9182 \begin_inset Flex CharStyle:Code
9185 \begin_layout Plain Layout
9191 [float=0] The vertical space between the label and the text body.
9192 Only used for labels that are above the text body (
9193 \begin_inset Flex CharStyle:Code
9196 \begin_layout Plain Layout
9203 \begin_inset Flex CharStyle:Code
9206 \begin_layout Plain Layout
9207 Centered_Top_Environment
9215 \begin_layout Description
9216 \begin_inset Flex CharStyle:Code
9219 \begin_layout Plain Layout
9226 \begin_inset Flex CharStyle:Code
9229 \begin_layout Plain Layout
9236 \begin_inset Newline newline
9239 The name of the counter for automatic numbering.
9241 \begin_inset Newline newline
9249 \begin_inset Flex CharStyle:Code
9252 \begin_layout Plain Layout
9259 \begin_inset Flex CharStyle:Code
9262 \begin_layout Plain Layout
9269 In that case, the counter will be stepped each time the layout appears.
9271 \begin_inset Newline newline
9279 \begin_inset Flex CharStyle:Code
9282 \begin_layout Plain Layout
9289 \begin_inset Flex CharStyle:Code
9292 \begin_layout Plain Layout
9298 , though this case is a bit complicated.
9300 \begin_inset Quotes eld
9304 \begin_inset Flex CharStyle:Code
9307 \begin_layout Plain Layout
9314 \begin_inset Quotes erd
9318 Then the actual counters used are
9319 \begin_inset Flex CharStyle:Code
9322 \begin_layout Plain Layout
9329 \begin_inset Flex CharStyle:Code
9332 \begin_layout Plain Layout
9339 \begin_inset Flex CharStyle:Code
9342 \begin_layout Plain Layout
9349 \begin_inset Flex CharStyle:Code
9352 \begin_layout Plain Layout
9359 These counters must all be declared separately.
9360 \begin_inset Newline newline
9364 \begin_inset CommandInset ref
9366 reference "sub:Counters"
9370 for details on counters.
9373 \begin_layout Description
9374 \begin_inset Flex CharStyle:Code
9377 \begin_layout Plain Layout
9383 The font used for the label.
9385 \begin_inset space ~
9389 \begin_inset CommandInset ref
9391 reference "sub:Font-description"
9398 \begin_layout Description
9399 \begin_inset Flex CharStyle:Code
9402 \begin_layout Plain Layout
9408 Text that indicates how far a label should be indented.
9411 \begin_layout Description
9412 \begin_inset Flex CharStyle:Code
9415 \begin_layout Plain Layout
9422 \begin_inset Flex CharStyle:Code
9425 \begin_layout Plain Layout
9431 ] The horizontal space between the label and the text body.
9432 Only used for labels that are not above the text body.
9435 \begin_layout Description
9436 \begin_inset Flex CharStyle:Code
9439 \begin_layout Plain Layout
9446 \begin_inset Flex CharStyle:Code
9449 \begin_layout Plain Layout
9455 ] The string used for a label with a
9456 \begin_inset Flex CharStyle:Code
9459 \begin_layout Plain Layout
9467 \begin_inset Flex CharStyle:Code
9470 \begin_layout Plain Layout
9476 is set, this string can be contain the special formatting commands described
9478 \begin_inset CommandInset ref
9480 reference "sub:Counters"
9488 \begin_layout Plain Layout
9489 For the sake of backwards compatibility, the string
9490 \begin_inset Flex CharStyle:Code
9493 \begin_layout Plain Layout
9503 will be replaced by the expanded
9504 \begin_inset Flex CharStyle:Code
9507 \begin_layout Plain Layout
9514 \begin_inset Flex CharStyle:Code
9517 \begin_layout Plain Layout
9526 This feature is now obsolete and should be replaced by the mechanisms of
9528 \begin_inset CommandInset ref
9530 reference "sub:Counters"
9542 \begin_layout Description
9543 \begin_inset Flex CharStyle:Code
9546 \begin_layout Plain Layout
9553 \begin_inset Flex CharStyle:Code
9556 \begin_layout Plain Layout
9562 ] This is used inside the appendix instead of
9563 \begin_inset Flex CharStyle:Code
9566 \begin_layout Plain Layout
9574 \begin_inset Flex CharStyle:Code
9577 \begin_layout Plain Layout
9584 \begin_inset Flex CharStyle:Code
9587 \begin_layout Plain Layout
9596 \begin_layout Description
9597 \begin_inset Flex CharStyle:Code
9600 \begin_layout Plain Layout
9606 [FIXME] (Used only with XML-type formats.)
9609 \begin_layout Description
9610 \begin_inset Flex CharStyle:Code
9613 \begin_layout Plain Layout
9620 \begin_inset Flex CharStyle:Code
9623 \begin_layout Plain Layout
9628 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
9629 Enumerate, Itemize, Bibliography
9638 \begin_layout Itemize
9639 \begin_inset Flex CharStyle:Code
9642 \begin_layout Plain Layout
9648 means the label is the very first word (up to the first real blank).
9649 Use protected spaces (like
9650 \begin_inset space ~
9653 that one) if you want more than one word as the label.
9657 \begin_layout Itemize
9658 \begin_inset Flex CharStyle:Code
9661 \begin_layout Plain Layout
9667 means the label is simply whatever
9668 \begin_inset Flex CharStyle:Code
9671 \begin_layout Plain Layout
9678 Note that this really is `static'.
9681 \begin_layout Itemize
9682 \begin_inset Flex CharStyle:Code
9685 \begin_layout Plain Layout
9692 \begin_inset Flex CharStyle:Code
9695 \begin_layout Plain Layout
9696 Centered_Top_Environment
9701 are special cases of
9702 \begin_inset Flex CharStyle:Code
9705 \begin_layout Plain Layout
9712 The label will be printed above the paragraph, but only at the top of an
9713 environment or the top of a chain of paragraphs with this layout.
9714 This might be used with the
9715 \begin_inset Flex CharStyle:MenuItem
9718 \begin_layout Plain Layout
9724 layout, for example.
9727 \begin_layout Itemize
9728 \begin_inset Flex CharStyle:Code
9731 \begin_layout Plain Layout
9737 is a special case for the caption-labels
9738 \begin_inset Quotes eld
9742 \begin_inset Quotes erd
9746 \begin_inset Quotes eld
9750 \begin_inset Quotes erd
9755 \begin_inset Flex CharStyle:Code
9758 \begin_layout Plain Layout
9764 means the (hardcoded) label string depends on the kind of float: It is
9765 hardcoded to be `FloatType N', where N is the value of the counter associated
9769 \begin_layout Itemize
9771 \begin_inset Flex CharStyle:Code
9774 \begin_layout Plain Layout
9780 label type defines automatically numbered labels.
9782 \begin_inset Flex CharStyle:Code
9785 \begin_layout Plain Layout
9791 will be expanded to resolve any counter references it contains: For example,
9793 \begin_inset Quotes eld
9797 \begin_inset Flex CharStyle:Code
9800 \begin_layout Plain Layout
9811 \begin_inset Quotes erd
9816 \begin_inset CommandInset ref
9818 reference "sub:Counters"
9822 for more information on counters.
9825 \begin_layout Itemize
9826 \begin_inset Flex CharStyle:Code
9829 \begin_layout Plain Layout
9835 produces the usual sort of enumeration labels.
9836 At present, it is hardcoded to use Arabic numerals, lowercase letters,
9837 small Roman numerals, and uppercase letters for the four possible depths.
9840 \begin_layout Itemize
9841 \begin_inset Flex CharStyle:Code
9844 \begin_layout Plain Layout
9850 produces various bullets at the different levels.
9851 It is also hardcoded.
9854 \begin_layout Itemize
9855 \begin_inset Flex CharStyle:Code
9858 \begin_layout Plain Layout
9864 is used internally by LyX and should be used only with
9865 \begin_inset Flex CharStyle:Code
9868 \begin_layout Plain Layout
9869 LatexType BibEnvironment
9878 \begin_layout Description
9879 \begin_inset Flex CharStyle:Code
9882 \begin_layout Plain Layout
9889 \begin_inset Flex CharStyle:Code
9892 \begin_layout Plain Layout
9898 , but this preamble snippet occurs independently from the babel package,
9899 and only for the document language.
9901 \begin_inset Quotes eld
9905 \begin_inset Flex CharStyle:Code
9908 \begin_layout Plain Layout
9915 \begin_inset Quotes erd
9922 \begin_layout Standard
9923 If the style defines text that appears in the typeset document, it may use
9925 \begin_inset Flex CharStyle:Code
9928 \begin_layout Plain Layout
9935 \begin_inset Flex CharStyle:Code
9938 \begin_layout Plain Layout
9944 to support non-english and even multilanguage documents correctly.
9945 The following excerpt (from the
9946 \begin_inset Flex CharStyle:Code
9949 \begin_layout Plain Layout
9955 file) shows how this works:
9958 \begin_layout LyX-Code
9962 \begin_layout LyX-Code
9965 theoremstyle{remark}
9968 \begin_layout LyX-Code
9971 newtheorem{claim}[thm]{
9978 \begin_layout LyX-Code
9982 \begin_layout LyX-Code
9986 \begin_layout LyX-Code
9991 claimname}{_(Claim)}
9994 \begin_layout LyX-Code
9998 \begin_layout LyX-Code
10002 \begin_layout LyX-Code
10006 \begin_layout LyX-Code
10015 claimname}{_(Claim)}}
10018 \begin_layout LyX-Code
10022 \begin_layout Standard
10023 The key to correct translation of the user visible text is the definition
10025 \begin_inset Flex CharStyle:Code
10028 \begin_layout Plain Layout
10036 in the language preamble.
10037 This command holds the name of the theorem that will appear in the output.
10039 \begin_inset Flex CharStyle:Code
10042 \begin_layout Plain Layout
10048 then uses the commands offered by the babel package to redefine
10049 \begin_inset Flex CharStyle:Code
10052 \begin_layout Plain Layout
10060 for each used language in multilanguage documents.
10064 \begin_layout Description
10065 \begin_inset Flex CharStyle:Code
10068 \begin_layout Plain Layout
10074 The name of the corresponding LaTeX stuff.
10075 Either the environment or command name.
10078 \begin_layout Description
10079 \begin_inset Flex CharStyle:Code
10082 \begin_layout Plain Layout
10088 An optional parameter for the corresponding
10089 \begin_inset Flex CharStyle:Code
10092 \begin_layout Plain Layout
10099 This parameter cannot be changed from within LyX.
10102 \begin_layout Description
10103 \begin_inset Flex CharStyle:Code
10106 \begin_layout Plain Layout
10113 \begin_inset CommandInset label
10115 name "des:LatexType"
10120 \begin_inset Flex CharStyle:Code
10123 \begin_layout Plain Layout
10128 , Command, Environment, Item_Environment,
10134 \begin_inset Flex CharStyle:Code
10137 \begin_layout Plain Layout
10138 List_Environment, Bib_Environment
10143 ] How the layout should be translated into LaTeX.
10147 \begin_layout Plain Layout
10148 \begin_inset Flex CharStyle:Code
10151 \begin_layout Plain Layout
10157 is perhaps a bit misleading, since these rules apply to SGML classes, too.
10158 Visit the SGML class files for specific examples.
10167 \begin_layout Itemize
10168 \begin_inset Flex CharStyle:Code
10171 \begin_layout Plain Layout
10177 means nothing special.
10181 \begin_layout Itemize
10182 \begin_inset Flex CharStyle:Code
10185 \begin_layout Plain Layout
10192 \begin_inset Flex CharStyle:Code
10195 \begin_layout Plain Layout
10202 {\SpecialChar \ldots{}
10211 \begin_layout Itemize
10212 \begin_inset Flex CharStyle:Code
10215 \begin_layout Plain Layout
10222 \begin_inset Flex CharStyle:Code
10225 \begin_layout Plain Layout
10232 }\SpecialChar \ldots{}
10248 \begin_layout Itemize
10249 \begin_inset Flex CharStyle:Code
10252 \begin_layout Plain Layout
10259 \begin_inset Flex CharStyle:Code
10262 \begin_layout Plain Layout
10269 \begin_inset Flex CharStyle:Code
10272 \begin_layout Plain Layout
10280 is generated for each paragraph of this environment.
10284 \begin_layout Itemize
10285 \begin_inset Flex CharStyle:Code
10288 \begin_layout Plain Layout
10295 \begin_inset Flex CharStyle:Code
10298 \begin_layout Plain Layout
10305 \begin_inset Flex CharStyle:Code
10308 \begin_layout Plain Layout
10314 is passed as an argument to the environment.
10316 \begin_inset Flex CharStyle:Code
10319 \begin_layout Plain Layout
10325 can be defined in the
10326 \begin_inset Flex CharStyle:MenuItem
10329 \begin_layout Plain Layout
10334 ayout\SpecialChar \menuseparator
10348 \begin_layout Standard
10349 Putting the last few things together, the LaTeX output will be either:
10352 \begin_layout LyX-Code
10355 latexname[latexparam]{\SpecialChar \ldots{}
10359 \begin_layout Standard
10363 \begin_layout LyX-Code
10366 begin{latexname}[latexparam] \SpecialChar \ldots{}
10372 \begin_layout Standard
10373 depending upon the LaTeX type.
10377 \begin_layout Description
10378 \begin_inset Flex CharStyle:Code
10381 \begin_layout Plain Layout
10388 \begin_inset Flex CharStyle:Code
10391 \begin_layout Plain Layout
10397 ] If you put layouts into environments, the leftmargins are not simply added,
10398 but added with a factor
10399 \begin_inset Formula $\frac{4}{depth+4}$
10403 Note that this parameter is also used when the margin is defined as
10404 \begin_inset Flex CharStyle:Code
10407 \begin_layout Plain Layout
10414 \begin_inset Flex CharStyle:Code
10417 \begin_layout Plain Layout
10424 Then it is added to the manual or dynamic margin.
10426 \begin_inset Newline newline
10429 The argument is passed as a string.
10431 \begin_inset Quotes eld
10435 \begin_inset Flex CharStyle:Code
10438 \begin_layout Plain Layout
10445 \begin_inset Quotes erd
10448 means that the paragraph is indented with the width of
10449 \begin_inset Quotes eld
10453 \begin_inset Flex CharStyle:Code
10456 \begin_layout Plain Layout
10463 \begin_inset Quotes erd
10466 in the normal font.
10467 You can get a negative width by prefixing the string with
10468 \begin_inset Quotes eld
10472 \begin_inset Flex CharStyle:Code
10475 \begin_layout Plain Layout
10482 \begin_inset Quotes erd
10486 This way was chosen so that the look is the same with each used screen
10491 \begin_layout Description
10492 \begin_inset Flex CharStyle:Code
10495 \begin_layout Plain Layout
10502 \begin_inset Flex CharStyle:Code
10505 \begin_layout Plain Layout
10510 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10516 \begin_inset Newline newline
10519 The kind of margin that the layout has on the left side.
10521 \begin_inset Flex CharStyle:Code
10524 \begin_layout Plain Layout
10530 just means a fixed margin.
10532 \begin_inset Flex CharStyle:Code
10535 \begin_layout Plain Layout
10541 means that the left margin depends on the string entered in the
10542 \begin_inset Flex CharStyle:MenuItem
10545 \begin_layout Plain Layout
10546 Edit\SpecialChar \menuseparator
10548 \begin_inset space ~
10557 This is used to typeset nice lists without tabulators.
10559 \begin_inset Flex CharStyle:Code
10562 \begin_layout Plain Layout
10568 means that the margin depends on the size of the label.
10569 This is used for automatic enumerated headlines.
10570 It is obvious that the headline
10571 \begin_inset Quotes eld
10574 5.4.3.2.1 Very long headline
10575 \begin_inset Quotes erd
10578 must have a wider left margin (as wide as
10579 \begin_inset Quotes eld
10583 \begin_inset Quotes erd
10586 plus the space) than
10587 \begin_inset Quotes eld
10590 3.2 Very long headline
10591 \begin_inset Quotes erd
10595 \begin_inset Quotes eld
10599 \begin_inset Quotes erd
10602 are not able to do this.
10604 \begin_inset Flex CharStyle:Code
10607 \begin_layout Plain Layout
10613 is similar, but only the very first row of the paragraph is dynamic, while
10614 the others are static; this is used, for example, for descriptions.
10616 \begin_inset Flex CharStyle:Code
10619 \begin_layout Plain Layout
10625 means the margin is chosen in a way that the longest row of this paragraph
10626 fits to the right margin.
10627 This is used to typeset an address on the right edge of the page.
10630 \begin_layout Description
10631 \begin_inset Flex CharStyle:Code
10634 \begin_layout Plain Layout
10641 \begin_inset Flex CharStyle:Code
10644 \begin_layout Plain Layout
10653 \begin_inset Flex CharStyle:Code
10656 \begin_layout Plain Layout
10662 ] Whether fragile commands in this layout should be
10663 \begin_inset Flex CharStyle:Code
10666 \begin_layout Plain Layout
10679 whether this command should itself be protected.)
10682 \begin_layout Description
10683 \begin_inset Flex CharStyle:Code
10686 \begin_layout Plain Layout
10693 \begin_inset Flex CharStyle:Code
10696 \begin_layout Plain Layout
10703 \begin_inset Flex CharStyle:Code
10706 \begin_layout Plain Layout
10714 ] Whether newlines are translated into LaTeX newlines (
10715 \begin_inset Flex CharStyle:Code
10718 \begin_layout Plain Layout
10729 The translation can be switched off to allow more comfortable LaTeX editing
10733 \begin_layout Description
10734 \begin_inset Flex CharStyle:Code
10737 \begin_layout Plain Layout
10744 \begin_inset Flex CharStyle:Code
10747 \begin_layout Plain Layout
10754 \begin_inset Flex CharStyle:Code
10757 \begin_layout Plain Layout
10765 ] Whether the following Paragraph is allowed to indent its very first row.
10767 \begin_inset Flex CharStyle:Code
10770 \begin_layout Plain Layout
10776 means that it is not allowed to do so;
10777 \begin_inset Flex CharStyle:Code
10780 \begin_layout Plain Layout
10786 means it could do so if it wants to.
10789 \begin_layout Description
10790 \begin_inset Flex CharStyle:Code
10793 \begin_layout Plain Layout
10799 Name of a layout that has replaced this layout.
10800 This is used to rename a layout, while keeping backward compatibility.
10803 \begin_layout Description
10804 \begin_inset Flex CharStyle:Code
10807 \begin_layout Plain Layout
10814 \begin_inset Flex CharStyle:Code
10817 \begin_layout Plain Layout
10823 ] The number of optional arguments that can be used with this layout.
10824 This is useful for things like section headings, and only makes sense with
10828 \begin_layout Description
10829 \begin_inset Flex CharStyle:Code
10832 \begin_layout Plain Layout
10839 \begin_inset Flex CharStyle:Code
10842 \begin_layout Plain Layout
10848 ] The indent of the very first line of a paragraph.
10850 \begin_inset Flex CharStyle:Code
10853 \begin_layout Plain Layout
10859 will be fixed for a certain layout.
10860 The exception is Standard layout, since the indentation of a Standard layout
10861 paragraph can be prohibited with
10862 \begin_inset Flex CharStyle:Code
10865 \begin_layout Plain Layout
10872 Also, Standard layout paragraphs inside environments use the
10873 \begin_inset Flex CharStyle:Code
10876 \begin_layout Plain Layout
10882 of the environment, not their native one.
10883 For example, Standard paragraphs inside an enumeration are not indented.
10886 \begin_layout Description
10887 \begin_inset Flex CharStyle:Code
10890 \begin_layout Plain Layout
10897 \begin_inset Flex CharStyle:Code
10900 \begin_layout Plain Layout
10906 ] The vertical space between two paragraphs of this layout.
10909 \begin_layout Description
10910 \begin_inset Flex CharStyle:Code
10913 \begin_layout Plain Layout
10920 \begin_inset Flex CharStyle:Code
10923 \begin_layout Plain Layout
10929 ] LyX allows the user to choose either
10930 \begin_inset Quotes eld
10934 \begin_inset Quotes erd
10938 \begin_inset Quotes eld
10942 \begin_inset Quotes erd
10945 to typeset a document.
10947 \begin_inset Quotes eld
10951 \begin_inset Quotes erd
10954 is chosen, this value is completely ignored.
10956 \begin_inset Quotes eld
10960 \begin_inset Quotes erd
10963 is chosen, the parindent of a LaTeXtype
10964 \begin_inset Quotes eld
10968 \begin_inset Quotes erd
10971 layout is ignored and all paragraphs are separated by this parskip argument.
10972 The vertical space is calculated with
10973 \begin_inset Flex CharStyle:Code
10976 \begin_layout Plain Layout
10978 \begin_inset space ~
10987 \begin_inset Flex CharStyle:Code
10990 \begin_layout Plain Layout
10996 is the height of a row with the normal font.
10997 This way, the look stays the same with different screen fonts.
11000 \begin_layout Description
11001 \begin_inset Flex CharStyle:Code
11004 \begin_layout Plain Layout
11011 \begin_inset CommandInset label
11013 name "des:PathThru"
11020 \begin_inset Flex CharStyle:Code
11023 \begin_layout Plain Layout
11034 \begin_inset Flex CharStyle:Code
11037 \begin_layout Plain Layout
11043 ] Whether the contents of this paragraph should be output in raw form, meaning
11044 without special translations that LaTeX would require.
11047 \begin_layout Description
11048 \begin_inset Flex CharStyle:Code
11051 \begin_layout Plain Layout
11058 \begin_inset CommandInset label
11060 name "des:Preamble"
11064 Information to be included in the LaTeX preamble when this style is used.
11065 Used to define macros, load packages, etc., required by this particular
11068 \begin_inset Quotes eld
11072 \begin_inset Flex CharStyle:Code
11075 \begin_layout Plain Layout
11082 \begin_inset Quotes erd
11088 \begin_layout Description
11089 \begin_inset Flex CharStyle:Code
11092 \begin_layout Plain Layout
11099 \begin_inset Flex CharStyle:Code
11102 \begin_layout Plain Layout
11109 \begin_inset CommandInset label
11111 name "des:Requires"
11115 Whether the layout requires the feature
11116 \begin_inset Flex CharStyle:Code
11119 \begin_layout Plain Layout
11126 See the description of
11127 \begin_inset Flex CharStyle:Code
11130 \begin_layout Plain Layout
11137 \begin_inset CommandInset ref
11138 LatexCommand pageref
11139 reference "des:FreeSpacing"
11143 ) for information on `features'.
11147 \begin_layout Description
11148 \begin_inset Flex CharStyle:Code
11151 \begin_layout Plain Layout
11158 \begin_inset Flex CharStyle:Code
11161 \begin_layout Plain Layout
11168 \begin_inset Flex CharStyle:Code
11171 \begin_layout Plain Layout
11180 \begin_layout Description
11181 \begin_inset Flex CharStyle:Code
11184 \begin_layout Plain Layout
11191 \begin_inset Flex CharStyle:Code
11194 \begin_layout Plain Layout
11199 , onehalf, double, other
11208 ] This defines what the default spacing should be in the layout.
11210 \begin_inset Flex CharStyle:Code
11213 \begin_layout Plain Layout
11220 \begin_inset Flex CharStyle:Code
11223 \begin_layout Plain Layout
11230 \begin_inset Flex CharStyle:Code
11233 \begin_layout Plain Layout
11239 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
11240 If you specify the argument
11241 \begin_inset Flex CharStyle:Code
11244 \begin_layout Plain Layout
11250 , then you should also provide a numerical argument which will be the actual
11252 Note that, contrary to other parameters,
11253 \begin_inset Flex CharStyle:Code
11256 \begin_layout Plain Layout
11262 implies the generation of specific LaTeX code, using the package
11265 \begin_inset Flex CharStyle:Code
11268 \begin_layout Plain Layout
11277 \begin_layout Description
11278 \begin_inset Flex CharStyle:Code
11281 \begin_layout Plain Layout
11287 The font used for the text body .
11289 \begin_inset CommandInset ref
11291 reference "sub:Font-description"
11298 \begin_layout Description
11299 \begin_inset Flex CharStyle:Code
11302 \begin_layout Plain Layout
11310 The level of the style in the table of contents.
11311 This is used for automatic numbering of section headings.
11314 \begin_layout Description
11315 \begin_inset Flex CharStyle:Code
11318 \begin_layout Plain Layout
11325 \begin_inset Flex CharStyle:Code
11328 \begin_layout Plain Layout
11334 ] The vertical space with which the very first of a chain of paragraphs
11335 with this layout is separated from the previous paragraph.
11336 If the previous paragraph has another layout, the separations are not simply
11337 added, but the maximum is taken.
11340 \begin_layout Subsection
11342 \begin_inset CommandInset label
11351 \begin_layout Standard
11352 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11353 define the floats (
11354 \begin_inset Flex CharStyle:MenuItem
11357 \begin_layout Plain Layout
11364 \begin_inset Flex CharStyle:MenuItem
11367 \begin_layout Plain Layout
11373 , \SpecialChar \ldots{}
11374 ) in the text class itself.
11375 Standard floats are included in the file
11376 \begin_inset Flex CharStyle:Code
11379 \begin_layout Plain Layout
11385 , so you may have to do no more than add
11388 \begin_layout LyX-Code
11389 Input stdfloats.inc
11392 \begin_layout Standard
11393 to your layout file.
11394 If you want to implement a text class that proposes some other float types
11395 (like the AGU class bundled with LyX), the information below will hopefully
11399 \begin_layout Description
11400 \begin_inset Flex CharStyle:Code
11403 \begin_layout Plain Layout
11410 \begin_inset Flex CharStyle:Code
11413 \begin_layout Plain Layout
11420 \begin_inset Quotes erd
11424 \begin_inset Quotes erd
11427 ] The file name extension of an auxiliary file for the list of figures (or
11429 LaTeX writes the captions to this file.
11432 \begin_layout Description
11433 \begin_inset Flex CharStyle:Code
11436 \begin_layout Plain Layout
11443 \begin_inset Flex CharStyle:Code
11446 \begin_layout Plain Layout
11453 \begin_inset Quotes erd
11457 \begin_inset Quotes erd
11460 ] The string that will be used in the menus and also for the caption.
11461 This is translated to the current language if babel is used.
11464 \begin_layout Description
11465 \begin_inset Flex CharStyle:Code
11468 \begin_layout Plain Layout
11475 \begin_inset Flex CharStyle:Code
11478 \begin_layout Plain Layout
11487 \begin_inset Flex CharStyle:Code
11490 \begin_layout Plain Layout
11497 \begin_inset Flex CharStyle:Code
11500 \begin_layout Plain Layout
11506 if the float is already defined by the LaTeX document class.
11508 \begin_inset Flex CharStyle:Code
11511 \begin_layout Plain Layout
11517 , the float will be defined using the LaTeX package
11518 \begin_inset Flex CharStyle:Code
11521 \begin_layout Plain Layout
11530 \begin_layout Description
11531 \begin_inset Flex CharStyle:Code
11534 \begin_layout Plain Layout
11541 \begin_inset Flex CharStyle:Code
11544 \begin_layout Plain Layout
11551 \begin_inset Quotes erd
11555 \begin_inset Quotes erd
11558 ] The heading used for the list of floats.
11559 This is translated to the document language.
11562 \begin_layout Description
11563 \begin_inset Flex CharStyle:Code
11566 \begin_layout Plain Layout
11573 \begin_inset Flex CharStyle:Code
11576 \begin_layout Plain Layout
11583 \begin_inset Quotes erd
11587 \begin_inset Quotes erd
11590 ] This (optional) argument determines whether floats of this class will
11591 be numbered within some sectional unit of the document.
11592 For example, if within is equal to
11593 \begin_inset Flex CharStyle:Code
11596 \begin_layout Plain Layout
11602 , the floats will be numbered within chapters.
11606 \begin_layout Description
11607 \begin_inset Flex CharStyle:Code
11610 \begin_layout Plain Layout
11617 \begin_inset Flex CharStyle:Code
11620 \begin_layout Plain Layout
11627 \begin_inset Quotes erd
11631 \begin_inset Quotes erd
11634 ] The default placement for the given class of floats.
11635 The string should be as in standard LaTeX:
11636 \begin_inset Flex CharStyle:Code
11639 \begin_layout Plain Layout
11646 \begin_inset Flex CharStyle:Code
11649 \begin_layout Plain Layout
11656 \begin_inset Flex CharStyle:Code
11659 \begin_layout Plain Layout
11666 \begin_inset Flex CharStyle:Code
11669 \begin_layout Plain Layout
11675 for top, bottom, page, and here, respectively.
11679 \begin_layout Plain Layout
11680 Note that the order of these letters in the string is irrelevant, like in
11686 On top of that there is a new type,
11687 \begin_inset Flex CharStyle:Code
11690 \begin_layout Plain Layout
11696 , which does not really correspond to a float, since it means: put it
11697 \begin_inset Quotes eld
11701 \begin_inset Quotes erd
11705 Note however that the
11706 \begin_inset Flex CharStyle:Code
11709 \begin_layout Plain Layout
11715 specifier is special and, because of implementation details, cannot be
11716 used in non-built in float types.
11717 If you do not understand what this means, just use
11718 \begin_inset Quotes eld
11722 \begin_inset Flex CharStyle:Code
11725 \begin_layout Plain Layout
11732 \begin_inset Quotes erd
11738 \begin_layout Description
11739 \begin_inset Flex CharStyle:Code
11742 \begin_layout Plain Layout
11749 \begin_inset Flex CharStyle:Code
11752 \begin_layout Plain Layout
11759 \begin_inset Quotes erd
11763 \begin_inset Quotes erd
11766 ] The style used when defining the float using
11767 \begin_inset Flex CharStyle:Code
11770 \begin_layout Plain Layout
11781 \begin_layout Description
11782 \begin_inset Flex CharStyle:Code
11785 \begin_layout Plain Layout
11792 \begin_inset Flex CharStyle:Code
11795 \begin_layout Plain Layout
11802 \begin_inset Quotes erd
11806 \begin_inset Quotes erd
11810 \begin_inset Quotes eld
11814 \begin_inset Quotes erd
11817 of the new class of floats, like program or algorithm.
11818 After the appropriate
11819 \begin_inset Flex CharStyle:Code
11822 \begin_layout Plain Layout
11831 \begin_inset Flex CharStyle:Code
11834 \begin_layout Plain Layout
11843 \begin_inset Flex CharStyle:Code
11846 \begin_layout Plain Layout
11857 \begin_layout Standard
11858 Note that defining a float with type
11859 \begin_inset Flex CharStyle:Code
11862 \begin_layout Plain Layout
11870 automatically defines the corresponding counter with name
11871 \begin_inset Flex CharStyle:Code
11874 \begin_layout Plain Layout
11885 \begin_layout Subsection
11886 Flex insets and InsetLayout
11887 \begin_inset CommandInset label
11889 name "sub:Flex-insets-and"
11896 \begin_layout Standard
11897 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11898 these are called Flex insets.
11902 \begin_layout Standard
11903 Flex insets come in three different kinds:
11906 \begin_layout Itemize
11908 \begin_inset Flex CharStyle:Code
11911 \begin_layout Plain Layout
11917 ): These define semantic markup corresponding to such LaTeX commands as
11919 \begin_inset Flex CharStyle:Code
11922 \begin_layout Plain Layout
11931 \begin_inset Flex CharStyle:Code
11934 \begin_layout Plain Layout
11945 \begin_layout Itemize
11947 \begin_inset Flex CharStyle:Code
11950 \begin_layout Plain Layout
11956 ): These can be used to define custom collapsible insets, similar to TeX
11957 code, footnote, and the like.
11958 An obvious example is an endnote inset, which is defined in the
11959 \begin_inset Flex CharStyle:Code
11962 \begin_layout Plain Layout
11971 \begin_layout Itemize
11973 \begin_inset Flex CharStyle:Code
11976 \begin_layout Plain Layout
11982 ): For use with DocBook classes.
11985 \begin_layout Standard
11986 Flex insets are defined using the
11987 \begin_inset Flex CharStyle:Code
11990 \begin_layout Plain Layout
11996 tag, which shall be explained in a moment.
11999 \begin_layout Standard
12001 \begin_inset Flex CharStyle:Code
12004 \begin_layout Plain Layout
12010 tag also serves another function: It can be used to customize the general
12011 layout of many different types of insets.
12013 \begin_inset Flex CharStyle:Code
12016 \begin_layout Plain Layout
12022 can be used to customize the layout parameters for footnotes, marginal
12023 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
12024 boxes, tables, algorithms, URLs, and optional arguments, as well as to
12025 define Flex insets.
12028 \begin_layout Standard
12030 \begin_inset Flex CharStyle:Code
12033 \begin_layout Plain Layout
12039 definition must begin with a line of the form:
12042 \begin_layout LyX-Code
12046 \begin_layout Standard
12048 \begin_inset Flex CharStyle:Code
12051 \begin_layout Plain Layout
12057 indicates the inset whose layout is being defined, and here there are two
12061 \begin_layout Enumerate
12062 The layout for a pre-existing inset is being modified.
12063 In this case, can be
12064 \begin_inset Flex CharStyle:Code
12067 \begin_layout Plain Layout
12073 any one of the following:
12074 \begin_inset Flex CharStyle:Code
12077 \begin_layout Plain Layout
12084 \begin_inset Flex CharStyle:Code
12087 \begin_layout Plain Layout
12094 \begin_inset Flex CharStyle:Code
12097 \begin_layout Plain Layout
12104 \begin_inset Flex CharStyle:Code
12107 \begin_layout Plain Layout
12114 \begin_inset Flex CharStyle:Code
12117 \begin_layout Plain Layout
12124 \begin_inset Flex CharStyle:Code
12127 \begin_layout Plain Layout
12134 \begin_inset Flex CharStyle:Code
12137 \begin_layout Plain Layout
12144 \begin_inset Flex CharStyle:Code
12147 \begin_layout Plain Layout
12154 \begin_inset Flex CharStyle:Code
12157 \begin_layout Plain Layout
12164 \begin_inset Flex CharStyle:Code
12167 \begin_layout Plain Layout
12174 \begin_inset Flex CharStyle:Code
12177 \begin_layout Plain Layout
12184 \begin_inset Flex CharStyle:Code
12187 \begin_layout Plain Layout
12194 \begin_inset Flex CharStyle:Code
12197 \begin_layout Plain Layout
12204 \begin_inset Flex CharStyle:Code
12207 \begin_layout Plain Layout
12214 \begin_inset Flex CharStyle:Code
12217 \begin_layout Plain Layout
12224 \begin_inset Flex CharStyle:Code
12227 \begin_layout Plain Layout
12234 \begin_inset Flex CharStyle:Code
12237 \begin_layout Plain Layout
12244 \begin_inset Flex CharStyle:Code
12247 \begin_layout Plain Layout
12254 \begin_inset Flex CharStyle:Code
12257 \begin_layout Plain Layout
12264 \begin_inset Flex CharStyle:Code
12267 \begin_layout Plain Layout
12276 \begin_layout Enumerate
12277 The layout for a Flex inset is being defined.
12279 \begin_inset Flex CharStyle:Code
12282 \begin_layout Plain Layout
12288 can be any valid identifier not used by a pre-existing inset.
12289 Note that the definition of a flex inset must
12294 \begin_inset Flex CharStyle:Code
12297 \begin_layout Plain Layout
12306 \begin_layout Standard
12308 \begin_inset Flex CharStyle:Code
12311 \begin_layout Plain Layout
12317 definition can contain the following entries:
12320 \begin_layout Description
12321 \begin_inset Flex CharStyle:Code
12324 \begin_layout Plain Layout
12330 The color for the inset's background.
12331 The valid colors are defined in
12332 \begin_inset Flex CharStyle:Code
12335 \begin_layout Plain Layout
12344 \begin_layout Description
12345 \begin_inset Flex CharStyle:Code
12348 \begin_layout Plain Layout
12354 As with paragraph styles (see page
12355 \begin_inset CommandInset ref
12357 reference "des:CopyStyle"
12364 \begin_layout Description
12365 \begin_inset Flex CharStyle:Code
12368 \begin_layout Plain Layout
12375 \begin_inset Flex CharStyle:Code
12378 \begin_layout Plain Layout
12387 \begin_inset Flex CharStyle:Code
12390 \begin_layout Plain Layout
12396 ] Indicates whether the user may employ the Paragraph Settings dialog to
12397 customize the paragraph.
12400 \begin_layout Description
12401 \begin_inset Flex CharStyle:Code
12404 \begin_layout Plain Layout
12411 \begin_inset Flex CharStyle:Code
12414 \begin_layout Plain Layout
12421 \begin_inset Flex CharStyle:Code
12424 \begin_layout Plain Layout
12431 \begin_inset Flex CharStyle:Code
12434 \begin_layout Plain Layout
12440 , describing the rendering style used for the inset's frame and buttons.
12441 Footnotes generally use
12442 \begin_inset Flex CharStyle:Code
12445 \begin_layout Plain Layout
12451 , ERT insets generally
12452 \begin_inset Flex CharStyle:Code
12455 \begin_layout Plain Layout
12461 , and character styles
12462 \begin_inset Flex CharStyle:Code
12465 \begin_layout Plain Layout
12474 \begin_layout Description
12475 \begin_inset Flex CharStyle:Code
12478 \begin_layout Plain Layout
12484 Required at the end of the InsetLayout declarations.
12487 \begin_layout Description
12488 \begin_inset Flex CharStyle:Code
12491 \begin_layout Plain Layout
12497 The font used for both the text body
12503 \begin_inset space ~
12507 \begin_inset CommandInset ref
12509 reference "sub:Font-description"
12514 Note that defining this font automatically defines the
12515 \begin_inset Flex CharStyle:Code
12518 \begin_layout Plain Layout
12524 to the same value, so define this first and define
12525 \begin_inset Flex CharStyle:Code
12528 \begin_layout Plain Layout
12534 later if you want them to be different.
12537 \begin_layout Description
12538 \begin_inset Flex CharStyle:Code
12541 \begin_layout Plain Layout
12548 \begin_inset Quotes eld
12552 \begin_inset Quotes erd
12555 language, leading to Left-to-Right (latin) output, e.
12556 \begin_inset space \thinspace{}
12560 \begin_inset space \space{}
12563 in TeX code or URL.
12567 \begin_layout Description
12568 \begin_inset Flex CharStyle:Code
12571 \begin_layout Plain Layout
12578 \begin_inset Flex CharStyle:Code
12581 \begin_layout Plain Layout
12590 \begin_inset Flex CharStyle:Code
12593 \begin_layout Plain Layout
12599 ] Indicates whether the PlainLayout should be used or, instead, the user
12600 can change the paragraph style used in the inset.
12603 \begin_layout Description
12604 \begin_inset Flex CharStyle:Code
12607 \begin_layout Plain Layout
12613 As with paragraph styles (see page
12614 \begin_inset CommandInset ref
12615 LatexCommand pageref
12616 reference "des:FreeSpacing"
12623 \begin_layout Description
12624 \begin_inset Flex CharStyle:Code
12627 \begin_layout Plain Layout
12634 \begin_inset Flex CharStyle:Code
12637 \begin_layout Plain Layout
12646 \begin_inset Flex CharStyle:Code
12649 \begin_layout Plain Layout
12655 ] Whether to include the contents of this inset in the strings generated
12656 for the `Outline' pane.
12657 One would not, for example, want the content of a footnote in a section
12658 header to be included in the TOC displayed in the outline, but one would
12659 normally want the content of a character style displayed.
12660 Default is false: not to include.
12663 \begin_layout Description
12664 \begin_inset Flex CharStyle:Code
12667 \begin_layout Plain Layout
12673 As with paragraph styles (see page
12674 \begin_inset CommandInset ref
12675 LatexCommand pageref
12676 reference "des:KeepEmpty"
12683 \begin_layout Description
12684 \begin_inset Flex CharStyle:Code
12687 \begin_layout Plain Layout
12693 The font used for the label.
12695 \begin_inset space ~
12699 \begin_inset CommandInset ref
12701 reference "sub:Font-description"
12706 Note that this definition can never appear before
12707 \begin_inset Flex CharStyle:Code
12710 \begin_layout Plain Layout
12716 , lest it be ineffective.
12719 \begin_layout Description
12720 \begin_inset Flex CharStyle:Code
12723 \begin_layout Plain Layout
12729 What will be displayed on the button or elsewhere as the inset label.
12730 Some inset types (TeX code and Branch) modify this label on the fly.
12733 \begin_layout Description
12734 \begin_inset Flex CharStyle:Code
12737 \begin_layout Plain Layout
12743 The name of the corresponding LaTeX stuff.
12744 Either the environment or command name.
12747 \begin_layout Description
12748 \begin_inset Flex CharStyle:Code
12751 \begin_layout Plain Layout
12757 The optional parameter for the corresponding
12758 \begin_inset Flex CharStyle:Code
12761 \begin_layout Plain Layout
12767 stuff, including possible bracket pairs like
12768 \begin_inset Flex CharStyle:Code
12771 \begin_layout Plain Layout
12778 This parameter cannot be changed from within LyX.
12781 \begin_layout Description
12782 \begin_inset Flex CharStyle:Code
12785 \begin_layout Plain Layout
12791 As with paragraph styles (see page
12792 \begin_inset CommandInset ref
12793 LatexCommand pageref
12794 reference "des:LatexType"
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
12822 \begin_inset Flex CharStyle:Code
12825 \begin_layout Plain Layout
12832 \begin_inset Flex CharStyle:Code
12835 \begin_layout Plain Layout
12842 \begin_inset Flex CharStyle:Code
12845 \begin_layout Plain Layout
12851 (indicating a dummy definition ending definitions of charstyles, etc).
12852 This entry is required in and is only meaningful for Flex insets.
12853 Among other things, it determines on which menu this inset will appear.
12856 \begin_layout Description
12857 \begin_inset Flex CharStyle:Code
12860 \begin_layout Plain Layout
12867 \begin_inset Flex CharStyle:Code
12870 \begin_layout Plain Layout
12879 \begin_inset Flex CharStyle:Code
12882 \begin_layout Plain Layout
12888 ] Whether multiple paragraphs are permitted in this inset.
12889 This will also set CustomPars to the same value and ForcePlain to the opposite
12891 These can be reset to other values, if they are used
12898 \begin_layout Description
12899 \begin_inset Flex CharStyle:Code
12902 \begin_layout Plain Layout
12909 \begin_inset Flex CharStyle:Code
12912 \begin_layout Plain Layout
12921 \begin_inset Flex CharStyle:Code
12924 \begin_layout Plain Layout
12930 ] Whether fragile commands in this layout should be
12931 \begin_inset Flex CharStyle:Code
12934 \begin_layout Plain Layout
12947 whether the command should itself be protected.)
12950 \begin_layout Description
12951 \begin_inset Flex CharStyle:Code
12954 \begin_layout Plain Layout
12961 \begin_inset Flex CharStyle:Code
12964 \begin_layout Plain Layout
12973 \begin_inset Flex CharStyle:Code
12976 \begin_layout Plain Layout
12982 ] As with paragraph styles (see page
12983 \begin_inset CommandInset ref
12985 reference "des:PathThru"
12992 \begin_layout Description
12993 \begin_inset Flex CharStyle:Code
12996 \begin_layout Plain Layout
13002 As with paragraph styles (see page
13003 \begin_inset CommandInset ref
13004 LatexCommand pageref
13005 reference "des:Preamble"
13012 \begin_layout Description
13013 \begin_inset Flex CharStyle:Code
13016 \begin_layout Plain Layout
13023 \begin_inset Flex CharStyle:Code
13026 \begin_layout Plain Layout
13032 ] As with paragraph styles (see page
13033 \begin_inset CommandInset ref
13034 LatexCommand pageref
13035 reference "des:Requires"
13042 \begin_layout Subsection
13044 \begin_inset CommandInset label
13046 name "sub:Counters"
13053 \begin_layout Standard
13054 Since version 1.3.0 of LyX, it is both possible and necessary to define the
13056 \begin_inset Flex CharStyle:MenuItem
13059 \begin_layout Plain Layout
13066 \begin_inset Flex CharStyle:MenuItem
13069 \begin_layout Plain Layout
13075 , \SpecialChar \ldots{}
13076 ) in the text class itself.
13077 The standard counters are defined in the file
13078 \begin_inset Flex CharStyle:Code
13081 \begin_layout Plain Layout
13087 , so you may have to do no more than add
13090 \begin_layout LyX-Code
13091 Input stdcounters.inc
13094 \begin_layout Standard
13095 to your layout file to get them to work.
13096 But if you want to define custom counters, then you can do so.
13097 The counter declaration must begin with:
13100 \begin_layout LyX-Code
13101 Counter CounterName
13104 \begin_layout Standard
13106 \begin_inset Flex CharStyle:Code
13109 \begin_layout Plain Layout
13115 ' is replaced by the name of the counter.
13116 And it must end with
13117 \begin_inset Quotes eld
13121 \begin_inset Flex CharStyle:Code
13124 \begin_layout Plain Layout
13131 \begin_inset Quotes erd
13135 The following parameters can also be used:
13138 \begin_layout Description
13139 \begin_inset Flex CharStyle:Code
13142 \begin_layout Plain Layout
13143 LabelString [string=""]
13148 when this is defined, this string defines how the counter is displayed.
13149 Setting this value sets
13150 \begin_inset Flex CharStyle:Code
13153 \begin_layout Plain Layout
13154 LabelStringAppendix
13160 The following special constructs can be used in the string:
13164 \begin_layout Itemize
13165 \begin_inset Flex CharStyle:Code
13168 \begin_layout Plain Layout
13176 will be replaced by the expansion of the
13177 \begin_inset Flex CharStyle:Code
13180 \begin_layout Plain Layout
13187 \begin_inset Flex CharStyle:Code
13190 \begin_layout Plain Layout
13191 LabelStringAppendix
13197 \begin_inset Flex CharStyle:Code
13200 \begin_layout Plain Layout
13210 \begin_layout Itemize
13211 counter values can be expressed using LaTeX-like macros
13212 \begin_inset Flex CharStyle:Code
13215 \begin_layout Plain Layout
13232 \begin_inset Flex CharStyle:Code
13235 \begin_layout Plain Layout
13247 \begin_layout Plain Layout
13257 Actually, the situation is a bit more complicated: any
13276 other than those described below will produce arabic numerals.
13277 It would not be surprising to see this change in the future.
13283 \begin_inset Flex CharStyle:Code
13286 \begin_layout Plain Layout
13292 : 1, 2, 3,\SpecialChar \ldots{}
13294 \begin_inset Flex CharStyle:Code
13297 \begin_layout Plain Layout
13303 for lower-case letters: a, b, c, \SpecialChar \ldots{}
13305 \begin_inset Flex CharStyle:Code
13308 \begin_layout Plain Layout
13314 for upper-case letters: A, B, C, \SpecialChar \ldots{}
13316 \begin_inset Flex CharStyle:Code
13319 \begin_layout Plain Layout
13325 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13327 \begin_inset Flex CharStyle:Code
13330 \begin_layout Plain Layout
13336 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13338 \begin_inset Flex CharStyle:Code
13341 \begin_layout Plain Layout
13347 for hebrew numerals.
13351 \begin_layout Standard
13352 If LabelString is not defined, a default value is constructed as follows:
13353 if the counter has a master counter
13354 \begin_inset Flex CharStyle:Code
13357 \begin_layout Plain Layout
13364 \begin_inset Flex CharStyle:Code
13367 \begin_layout Plain Layout
13374 \begin_inset Flex CharStyle:Code
13377 \begin_layout Plain Layout
13387 is used; otherwise the string
13388 \begin_inset Flex CharStyle:Code
13391 \begin_layout Plain Layout
13402 \begin_layout Description
13403 \begin_inset Flex CharStyle:Code
13406 \begin_layout Plain Layout
13407 LabelStringAppendix [string=""]
13413 \begin_inset Flex CharStyle:Code
13416 \begin_layout Plain Layout
13422 , but for use in the Appendix.
13425 \begin_layout Description
13426 \begin_inset Flex CharStyle:Code
13429 \begin_layout Plain Layout
13436 \begin_inset Flex CharStyle:Code
13439 \begin_layout Plain Layout
13446 \begin_inset Quotes erd
13450 \begin_inset Quotes erd
13453 ] If this is set to the name of another counter, the present counter will
13454 be reset every time the other one is increased.
13456 \begin_inset Flex CharStyle:Code
13459 \begin_layout Plain Layout
13466 \begin_inset Flex CharStyle:Code
13469 \begin_layout Plain Layout
13478 \begin_layout Subsection
13480 \begin_inset CommandInset label
13482 name "sub:Font-description"
13489 \begin_layout Standard
13490 A font description looks like this:
13493 \begin_layout LyX-Code
13503 \begin_layout LyX-Code
13507 \begin_layout LyX-Code
13511 \begin_layout Standard
13512 The following commands are available:
13515 \begin_layout Description
13516 \begin_inset Flex CharStyle:Code
13519 \begin_layout Plain Layout
13526 \begin_inset Flex CharStyle:Code
13529 \begin_layout Plain Layout
13538 \begin_inset Flex CharStyle:Code
13541 \begin_layout Plain Layout
13548 \begin_inset Flex CharStyle:Code
13551 \begin_layout Plain Layout
13558 \begin_inset Flex CharStyle:Code
13561 \begin_layout Plain Layout
13568 \begin_inset Flex CharStyle:Code
13571 \begin_layout Plain Layout
13578 \begin_inset Flex CharStyle:Code
13581 \begin_layout Plain Layout
13588 \begin_inset Flex CharStyle:Code
13591 \begin_layout Plain Layout
13598 \begin_inset Flex CharStyle:Code
13601 \begin_layout Plain Layout
13608 \begin_inset Flex CharStyle:Code
13611 \begin_layout Plain Layout
13620 \begin_layout Description
13621 \begin_inset Flex CharStyle:Code
13624 \begin_layout Plain Layout
13633 \begin_inset Flex CharStyle:Code
13636 \begin_layout Plain Layout
13647 \begin_inset Flex CharStyle:Code
13650 \begin_layout Plain Layout
13657 \begin_inset Flex CharStyle:Code
13660 \begin_layout Plain Layout
13669 \begin_layout Description
13670 \begin_inset Flex CharStyle:Code
13673 \begin_layout Plain Layout
13680 \begin_inset Flex CharStyle:Code
13683 \begin_layout Plain Layout
13689 ] Valid arguments are:
13690 \begin_inset Flex CharStyle:Code
13693 \begin_layout Plain Layout
13700 \begin_inset Flex CharStyle:Code
13703 \begin_layout Plain Layout
13710 \begin_inset Flex CharStyle:Code
13713 \begin_layout Plain Layout
13720 \begin_inset Flex CharStyle:Code
13723 \begin_layout Plain Layout
13730 \begin_inset Flex CharStyle:Code
13733 \begin_layout Plain Layout
13740 \begin_inset Flex CharStyle:Code
13743 \begin_layout Plain Layout
13750 Each of these turns on or off the corresponding attribute.
13752 \begin_inset Flex CharStyle:Code
13755 \begin_layout Plain Layout
13761 turns on emphasis, and
13762 \begin_inset Flex CharStyle:Code
13765 \begin_layout Plain Layout
13773 \begin_inset Newline newline
13776 If the latter seems puzzling, remember that the font settings for the present
13777 context are generally inherited from the surrounding context.
13779 \begin_inset Flex CharStyle:Code
13782 \begin_layout Plain Layout
13788 would turn off the emphasis that was anyway in effect, say, in a theorem
13792 \begin_layout Description
13793 \begin_inset Flex CharStyle:Code
13796 \begin_layout Plain Layout
13805 \begin_inset Flex CharStyle:Code
13808 \begin_layout Plain Layout
13819 \begin_inset Flex CharStyle:Code
13822 \begin_layout Plain Layout
13831 \begin_layout Description
13832 \begin_inset Flex CharStyle:Code
13835 \begin_layout Plain Layout
13844 \begin_inset Flex CharStyle:Code
13847 \begin_layout Plain Layout
13858 \begin_inset Flex CharStyle:Code
13861 \begin_layout Plain Layout
13868 \begin_inset Flex CharStyle:Code
13871 \begin_layout Plain Layout
13878 \begin_inset Flex CharStyle:Code
13881 \begin_layout Plain Layout
13890 \begin_layout Description
13891 \begin_inset Flex CharStyle:Code
13894 \begin_layout Plain Layout
13901 \begin_inset Flex CharStyle:Code
13904 \begin_layout Plain Layout
13911 \begin_inset Flex CharStyle:Code
13914 \begin_layout Plain Layout
13921 \begin_inset Flex CharStyle:Code
13924 \begin_layout Plain Layout
13933 \begin_inset Flex CharStyle:Code
13936 \begin_layout Plain Layout
13943 \begin_inset Flex CharStyle:Code
13946 \begin_layout Plain Layout
13953 \begin_inset Flex CharStyle:Code
13956 \begin_layout Plain Layout
13963 \begin_inset Flex CharStyle:Code
13966 \begin_layout Plain Layout
13973 \begin_inset Flex CharStyle:Code
13976 \begin_layout Plain Layout
13985 \begin_layout Subsection
13986 Upgrading old layout files
13989 \begin_layout Standard
13990 The file format of layout files changes from time to time, so old layout
13991 files need to be converted.
13992 This process has been automated since LyX 1.4.0: If LyX reads an old format
13993 layout file it will call the conversion tool
13994 \begin_inset Flex CharStyle:Code
13997 \begin_layout Plain Layout
13998 LyXDir/scripts/layout2layout.py
14003 and convert it to a temporary file in current format.
14004 The original file is left untouched.
14005 If you want to convert the layout file permanently, just call the converter
14009 \begin_layout LyX-Code
14010 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
14013 \begin_layout Standard
14014 (You need to replace
14015 \begin_inset Flex CharStyle:Code
14018 \begin_layout Plain Layout
14024 with the name of your LyX system directory, unless you happen to have defined
14025 such an environment variable.) Then copy
14026 \begin_inset Flex CharStyle:Code
14029 \begin_layout Plain Layout
14036 \begin_inset Flex CharStyle:Code
14039 \begin_layout Plain Layout
14048 \begin_layout Standard
14049 The automatic conversion only handles syntax changes.
14050 It cannot handle the case where the contents of included files was changed,
14051 so these will have to be converted separately.
14054 \begin_layout Section
14056 \begin_inset CommandInset label
14058 name "sec:Creating-Templates"
14065 \begin_layout Standard
14066 Templates are created just like usual documents.
14067 The only difference is that usual documents contain all possible settings,
14068 including the font scheme and the paper size.
14069 Usually a user doesn't want a template to overwrite his defaults in these
14071 For that reason, the designer of a template should remove the corresponding
14073 \begin_inset Flex CharStyle:Code
14076 \begin_layout Plain Layout
14085 \begin_inset Flex CharStyle:Code
14088 \begin_layout Plain Layout
14096 from the template LyX file.
14097 This can be done with any simple text-editor, for example
14098 \begin_inset Flex CharStyle:Code
14101 \begin_layout Plain Layout
14108 \begin_inset Flex CharStyle:Code
14111 \begin_layout Plain Layout
14121 \begin_layout Standard
14122 Put the edited template files you create in
14123 \begin_inset Flex CharStyle:Code
14126 \begin_layout Plain Layout
14132 , copy the ones you use from the global template directory in
14133 \begin_inset Flex CharStyle:Code
14136 \begin_layout Plain Layout
14142 to the same place, and redefine the template path in the
14143 \begin_inset Flex CharStyle:MenuItem
14146 \begin_layout Plain Layout
14147 Tools\SpecialChar \menuseparator
14148 Preferences\SpecialChar \menuseparator
14157 \begin_layout Standard
14158 Note that there is a template which has a particular meaning:
14159 \begin_inset Flex CharStyle:Code
14162 \begin_layout Plain Layout
14169 This template is loaded every time you create a new document with
14170 \begin_inset Flex CharStyle:MenuItem
14173 \begin_layout Plain Layout
14174 File\SpecialChar \menuseparator
14180 in order to provide useful defaults.
14181 To create this template from inside LyX, all you have to do is to open
14182 a document with the correct settings, and use the
14183 \begin_inset Flex CharStyle:MenuItem
14186 \begin_layout Plain Layout
14187 Save as Document Defaults
14195 \begin_layout Chapter
14196 Including External Material
14199 \begin_layout Standard
14200 \begin_inset Box Shadowbox
14209 height_special "totalheight"
14212 \begin_layout Plain Layout
14213 WARNING: This portion of the documentation has not been updated for some
14215 We certainly hope that it is still accurate, but there are no guarantees.
14223 \begin_layout Standard
14224 The use of material from sources external to LyX is covered in detail in
14230 This part of the manual covers what needs to happen behind the scenes for
14231 new sorts of material to be included.
14234 \begin_layout Section
14238 \begin_layout Standard
14239 The external material feature is based on the concept of a
14244 A template is a specification of how LyX should interface with a certain
14246 As bundled, LyX comes with predefined templates for Xfig figures, various
14247 raster format images, chess diagrams, and LilyPond music notation.
14248 You can check the actual list by using the menu
14249 \begin_inset Flex CharStyle:MenuItem
14252 \begin_layout Plain Layout
14253 Insert\SpecialChar \menuseparator
14254 File\SpecialChar \menuseparator
14261 Furthermore, it is possible to roll your own template to support a specific
14263 Later we'll describe in more detail what is involved, and hopefully you
14264 will submit all the templates you create so we can include them in a later
14268 \begin_layout Standard
14269 Another basic idea of the external material feature is to distinguish between
14270 the original file that serves as a base for final material and the produced
14271 file that is included in your exported or printed document.
14272 For example, consider the case of a figure produced with
14273 \begin_inset Flex CharStyle:Code
14276 \begin_layout Plain Layout
14283 The Xfig application itself works on an original file with the
14284 \begin_inset Flex CharStyle:Code
14287 \begin_layout Plain Layout
14294 Within Xfig, you create and change your figure, and when you are done,
14296 \begin_inset Flex CharStyle:Code
14299 \begin_layout Plain Layout
14306 When you want to include the figure in your document, you invoke
14307 \begin_inset Flex CharStyle:Code
14310 \begin_layout Plain Layout
14316 in order to create a PostScript file that can readily be included in your
14319 \begin_inset Flex CharStyle:Code
14322 \begin_layout Plain Layout
14328 file is the original file, and the PostScript file is the produced file.
14331 \begin_layout Standard
14332 This distinction is important in order to allow updating of the material
14333 while you are in the process of writing the document.
14334 Furthermore, it provides us with the flexibility that is needed to support
14335 multiple export formats.
14336 For instance, in the case of a plain text file, it is not exactly an award-winn
14337 ing idea to include the figure as raw PostScript.
14338 Instead, you'd either prefer to just include a reference to the figure
14339 or try to invoke some graphics to ASCII converter to make the final result
14340 look similar to the real graphics.
14341 The external material management allows you to do this, because it is parametri
14342 zed on the different export formats that LyX supports.
14345 \begin_layout Standard
14346 Besides supporting the production of different products according to the
14347 exported format, it supports tight integration with editing and viewing
14349 In the case of an Xfig figure, you are able to invoke Xfig on the original
14350 file with a single click from within the external material dialog in LyX,
14351 and also preview the produced PostScript file with Ghostview with another
14353 No more fiddling around with the command line and/or file browsers to locate
14354 and manipulate the original or produced files.
14355 In this way, you are finally able to take full advantage of the many different
14356 applications that are relevant to use when you write your documents, and
14357 ultimately be more productive.
14360 \begin_layout Section
14361 The external template configuration file
14364 \begin_layout Standard
14365 It is relatively easy to add custom external template definitions to LyX.
14366 However, be aware that doing this in an careless manner most probably
14370 introduce an easily exploitable security hole.
14371 So before you do this, please read the discussion about security in section
14373 \begin_inset CommandInset ref
14375 reference "sec:Security-discussion"
14382 \begin_layout Standard
14383 Having said that, we encourage you to submit any interesting templates that
14388 \begin_layout Standard
14389 The external templates are defined in the
14390 \begin_inset Flex CharStyle:Code
14393 \begin_layout Plain Layout
14394 LyXDir/lib/external_templates
14400 You can place your own version in
14401 \begin_inset Flex CharStyle:Code
14404 \begin_layout Plain Layout
14405 UserDir/external_templates
14413 \begin_layout Standard
14414 A typical template looks like this:
14417 \begin_layout LyX-Code
14421 \begin_layout LyX-Code
14422 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14425 \begin_layout LyX-Code
14429 \begin_layout LyX-Code
14433 \begin_layout LyX-Code
14437 \begin_layout LyX-Code
14441 \begin_layout LyX-Code
14445 \begin_layout LyX-Code
14446 AutomaticProduction true
14449 \begin_layout LyX-Code
14453 \begin_layout LyX-Code
14457 \begin_layout LyX-Code
14461 \begin_layout LyX-Code
14462 TransformCommand Rotate RotationLatexCommand
14465 \begin_layout LyX-Code
14466 TransformCommand Resize ResizeLatexCommand
14469 \begin_layout LyX-Code
14470 Product "$$RotateFront$$ResizeFront
14473 \begin_layout LyX-Code
14478 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14481 \begin_layout LyX-Code
14482 $$ResizeBack$$RotateBack"
14485 \begin_layout LyX-Code
14489 \begin_layout LyX-Code
14490 UpdateResult "$$AbsPath$$Basename.pstex_t"
14493 \begin_layout LyX-Code
14494 Requirement "graphicx"
14497 \begin_layout LyX-Code
14498 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14501 \begin_layout LyX-Code
14502 ReferencedFile latex "$$AbsPath$$Basename.eps"
14505 \begin_layout LyX-Code
14506 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14509 \begin_layout LyX-Code
14513 \begin_layout LyX-Code
14517 \begin_layout LyX-Code
14518 TransformCommand Rotate RotationLatexCommand
14521 \begin_layout LyX-Code
14522 TransformCommand Resize ResizeLatexCommand
14525 \begin_layout LyX-Code
14526 Product "$$RotateFront$$ResizeFront
14529 \begin_layout LyX-Code
14534 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14537 \begin_layout LyX-Code
14538 $$ResizeBack$$RotateBack"
14541 \begin_layout LyX-Code
14542 UpdateFormat pdftex
14545 \begin_layout LyX-Code
14546 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14549 \begin_layout LyX-Code
14550 Requirement "graphicx"
14553 \begin_layout LyX-Code
14554 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14557 \begin_layout LyX-Code
14558 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14561 \begin_layout LyX-Code
14565 \begin_layout LyX-Code
14569 \begin_layout LyX-Code
14570 Product "$$Contents(
14572 "$$AbsPath$$Basename.asc
14577 \begin_layout LyX-Code
14578 UpdateFormat asciixfig
14581 \begin_layout LyX-Code
14582 UpdateResult "$$AbsPath$$Basename.asc"
14585 \begin_layout LyX-Code
14589 \begin_layout LyX-Code
14593 \begin_layout LyX-Code
14594 Product "<graphic fileref=
14596 "$$AbsOrRelPathMaster$$Basename.eps
14601 \begin_layout LyX-Code
14605 \begin_layout LyX-Code
14609 \begin_layout LyX-Code
14610 UpdateResult "$$AbsPath$$Basename.eps"
14613 \begin_layout LyX-Code
14614 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14617 \begin_layout LyX-Code
14618 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14621 \begin_layout LyX-Code
14625 \begin_layout LyX-Code
14626 Product "[XFig: $$FName]"
14629 \begin_layout LyX-Code
14633 \begin_layout LyX-Code
14637 \begin_layout Standard
14638 As you can see, the template is enclosed in
14639 \begin_inset Flex CharStyle:Code
14642 \begin_layout Plain Layout
14648 \SpecialChar \ldots{}
14650 \begin_inset Flex CharStyle:Code
14653 \begin_layout Plain Layout
14660 It contains a header specifying some general settings and, for each supported
14661 primary document file format, a section
14662 \begin_inset Flex CharStyle:Code
14665 \begin_layout Plain Layout
14671 \SpecialChar \ldots{}
14673 \begin_inset Flex CharStyle:Code
14676 \begin_layout Plain Layout
14685 \begin_layout Subsection
14686 The template header
14689 \begin_layout Description
14690 \begin_inset Flex CharStyle:Code
14693 \begin_layout Plain Layout
14694 AutomaticProduction
14695 \begin_inset space ~
14703 Whether the file represented by the template must be generated by LyX.
14704 This command must occur exactly once.
14707 \begin_layout Description
14708 \begin_inset Flex CharStyle:Code
14711 \begin_layout Plain Layout
14713 \begin_inset space ~
14721 A glob pattern that is used in the file dialog to filter out the desired
14723 If there is more than one possible file extension (e.
14724 \begin_inset space \thinspace{}
14728 \begin_inset space \space{}
14732 \begin_inset Flex CharStyle:Code
14735 \begin_layout Plain Layout
14742 \begin_inset Flex CharStyle:Code
14745 \begin_layout Plain Layout
14751 ), use something like
14752 \begin_inset Flex CharStyle:Code
14755 \begin_layout Plain Layout
14762 This command must occur exactly once.
14765 \begin_layout Description
14766 \begin_inset Flex CharStyle:Code
14769 \begin_layout Plain Layout
14771 \begin_inset space ~
14779 The text that is displayed on the button.
14780 This command must occur exactly once.
14783 \begin_layout Description
14784 \begin_inset Flex CharStyle:Code
14787 \begin_layout Plain Layout
14789 \begin_inset space ~
14793 \begin_inset space ~
14801 The help text that is used in the External dialog.
14802 Provide enough information to explain to the user just what the template
14803 can provide him with.
14804 This command must occur exactly once.
14807 \begin_layout Description
14808 \begin_inset Flex CharStyle:Code
14811 \begin_layout Plain Layout
14813 \begin_inset space ~
14821 The file format of the original file.
14822 This must be the name of a format that is known to LyX (see section
14823 \begin_inset CommandInset ref
14825 reference "sec:Formats"
14831 \begin_inset Quotes eld
14835 \begin_inset Flex CharStyle:Code
14838 \begin_layout Plain Layout
14845 \begin_inset Quotes erd
14848 if the template can handle original files of more than one format.
14849 LyX will attempt to interrogate the file itself in order to deduce its
14850 format in this case.
14851 This command must occur exactly once.
14854 \begin_layout Description
14855 \begin_inset Flex CharStyle:Code
14858 \begin_layout Plain Layout
14860 \begin_inset space ~
14868 A unique name for the template.
14869 It must not contain substitution macros (see below).
14872 \begin_layout Description
14873 \begin_inset Flex CharStyle:Code
14876 \begin_layout Plain Layout
14878 \begin_inset space ~
14881 Rotate|Resize|Clip|Extra
14886 This command specifies which transformations are supported by this template.
14887 It may occur zero or more times.
14888 This command enables the corresponding tabs in the external dialog.
14890 \begin_inset Flex CharStyle:Code
14893 \begin_layout Plain Layout
14899 command must have either a corresponding
14900 \begin_inset Flex CharStyle:Code
14903 \begin_layout Plain Layout
14910 \begin_inset Flex CharStyle:Code
14913 \begin_layout Plain Layout
14920 \begin_inset Flex CharStyle:Code
14923 \begin_layout Plain Layout
14930 Otherwise the transformation will not be supported by that format.
14933 \begin_layout Subsection
14937 \begin_layout Description
14938 \begin_inset Flex CharStyle:Code
14941 \begin_layout Plain Layout
14943 \begin_inset space ~
14946 LaTeX|PDFLaTeX|PlainText|DocBook
14951 The primary document file format that this format definition is for.
14952 Not every template has a sensible representation in all document file formats.
14953 Please define nevertheless a
14954 \begin_inset Flex CharStyle:Code
14957 \begin_layout Plain Layout
14963 section for all formats.
14964 Use a dummy text when no representation is available.
14965 Then you can at least see a reference to the external material in the exported
14969 \begin_layout Description
14970 \begin_inset Flex CharStyle:Code
14973 \begin_layout Plain Layout
14975 \begin_inset space ~
14979 \begin_inset space ~
14987 This command defines an additional macro
14988 \begin_inset Flex CharStyle:Code
14991 \begin_layout Plain Layout
14997 for substitution in
14998 \begin_inset Flex CharStyle:Code
15001 \begin_layout Plain Layout
15009 \begin_inset Flex CharStyle:Code
15012 \begin_layout Plain Layout
15018 itself may contain substitution macros.
15019 The advantage over using
15020 \begin_inset Flex CharStyle:Code
15023 \begin_layout Plain Layout
15030 \begin_inset Flex CharStyle:Code
15033 \begin_layout Plain Layout
15039 is that the substituted value of
15040 \begin_inset Flex CharStyle:Code
15043 \begin_layout Plain Layout
15049 is sanitized so that it is a valid optional argument in the document format.
15050 This command may occur zero or more times.
15053 \begin_layout Description
15054 \begin_inset Flex CharStyle:Code
15057 \begin_layout Plain Layout
15059 \begin_inset space ~
15067 The text that is inserted in the exported document.
15068 This is actually the most important command and can be quite complex.
15069 This command must occur exactly once.
15072 \begin_layout Description
15073 \begin_inset Flex CharStyle:Code
15076 \begin_layout Plain Layout
15078 \begin_inset space ~
15086 This command specifies a preamble snippet that will be included in the
15088 It has to be defined using
15089 \begin_inset Flex CharStyle:Code
15092 \begin_layout Plain Layout
15098 \SpecialChar \ldots{}
15100 \begin_inset Flex CharStyle:Code
15103 \begin_layout Plain Layout
15110 This command may occur zero or more times.
15113 \begin_layout Description
15114 \begin_inset Flex CharStyle:Code
15117 \begin_layout Plain Layout
15119 \begin_inset space ~
15123 \begin_inset space ~
15131 This command denotes files that are created by the conversion process and
15132 are needed for a particular export format.
15133 If the filename is relative, it is interpreted relative to the master document.
15134 This command may be given zero or more times.
15137 \begin_layout Description
15138 \begin_inset Flex CharStyle:Code
15141 \begin_layout Plain Layout
15143 \begin_inset space ~
15151 The name of a required LaTeX package.
15152 The package is included via
15153 \begin_inset Flex CharStyle:Code
15156 \begin_layout Plain Layout
15164 in the LaTeX preamble.
15165 This command may occur zero or more times.
15168 \begin_layout Description
15169 \begin_inset Flex CharStyle:Code
15172 \begin_layout Plain Layout
15174 \begin_inset space ~
15178 \begin_inset space ~
15181 RotationLatexCommand
15186 This command specifies that the built in LaTeX command should be used for
15188 This command may occur once or not at all.
15191 \begin_layout Description
15192 \begin_inset Flex CharStyle:Code
15195 \begin_layout Plain Layout
15197 \begin_inset space ~
15201 \begin_inset space ~
15209 This command specifies that the built in LaTeX command should be used for
15211 This command may occur once or not at all.
15214 \begin_layout Description
15215 \begin_inset Flex CharStyle:Code
15218 \begin_layout Plain Layout
15220 \begin_inset space ~
15224 \begin_inset space ~
15227 RotationLatexOption
15232 This command specifies that rotation is done via an optional argument.
15233 This command may occur once or not at all.
15236 \begin_layout Description
15237 \begin_inset Flex CharStyle:Code
15240 \begin_layout Plain Layout
15242 \begin_inset space ~
15246 \begin_inset space ~
15254 This command specifies that resizing is done via an optional argument.
15255 This command may occur once or not at all.
15258 \begin_layout Description
15259 \begin_inset Flex CharStyle:Code
15262 \begin_layout Plain Layout
15264 \begin_inset space ~
15268 \begin_inset space ~
15276 This command specifies that clipping is done via an optional argument.
15277 This command may occur once or not at all.
15280 \begin_layout Description
15281 \begin_inset Flex CharStyle:Code
15284 \begin_layout Plain Layout
15286 \begin_inset space ~
15290 \begin_inset space ~
15298 This command specifies that an extra optional argument is used.
15299 This command may occur once or not at all.
15302 \begin_layout Description
15303 \begin_inset Flex CharStyle:Code
15306 \begin_layout Plain Layout
15308 \begin_inset space ~
15316 The file format of the converted file.
15317 This must be the name of a format that is known to LyX (see the
15318 \begin_inset Flex CharStyle:MenuItem
15321 \begin_layout Plain Layout
15326 ools\SpecialChar \menuseparator
15331 references:Conversion
15337 This command must occur exactly once.
15340 \begin_layout Description
15341 \begin_inset Flex CharStyle:Code
15344 \begin_layout Plain Layout
15346 \begin_inset space ~
15354 The file name of the converted file.
15355 The file name must be absolute.
15356 This command must occur exactly once.
15359 \begin_layout Subsection
15360 Preamble definitions
15363 \begin_layout Standard
15364 The external template configuration file may contain additional preamble
15365 definitions enclosed by
15366 \begin_inset Flex CharStyle:Code
15369 \begin_layout Plain Layout
15375 \SpecialChar \ldots{}
15377 \begin_inset Flex CharStyle:Code
15380 \begin_layout Plain Layout
15387 They can be used by the templates in the
15388 \begin_inset Flex CharStyle:Code
15391 \begin_layout Plain Layout
15400 \begin_layout Section
15401 The substitution mechanism
15404 \begin_layout Standard
15405 When the external material facility invokes an external program, it is done
15406 on the basis of a command defined in the template configuration file.
15407 These commands can contain various macros that are expanded before execution.
15408 Execution always take place in the directory of the containing document.
15411 \begin_layout Standard
15412 Also, whenever external material is to be displayed, the name will be produced
15413 by the substitution mechanism, and most other commands in the template
15414 definition support substitution as well.
15417 \begin_layout Standard
15418 The available macros are the following:
15421 \begin_layout Description
15422 \begin_inset Flex CharStyle:Code
15425 \begin_layout Plain Layout
15426 $$AbsOrRelPathMaster
15431 The file path, absolute or relative to the master LyX document.
15434 \begin_layout Description
15435 \begin_inset Flex CharStyle:Code
15438 \begin_layout Plain Layout
15439 $$AbsOrRelPathParent
15444 The file path, absolute or relative to the LyX document.
15447 \begin_layout Description
15448 \begin_inset Flex CharStyle:Code
15451 \begin_layout Plain Layout
15457 The absolute file path.
15460 \begin_layout Description
15461 \begin_inset Flex CharStyle:Code
15464 \begin_layout Plain Layout
15470 The filename without path and without the extension.
15473 \begin_layout Description
15474 \begin_inset Flex CharStyle:Code
15477 \begin_layout Plain Layout
15479 \begin_inset Quotes eld
15483 \begin_inset Quotes erd
15491 This macro will expand to the contents of the file with the name
15492 \begin_inset Flex CharStyle:Code
15495 \begin_layout Plain Layout
15504 \begin_layout Description
15505 \begin_inset Flex CharStyle:Code
15508 \begin_layout Plain Layout
15514 The file extension (including the dot).
15517 \begin_layout Description
15518 \begin_inset Flex CharStyle:Code
15521 \begin_layout Plain Layout
15527 The filename of the file specified in the external material dialog.
15528 This is either an absolute name, or it is relative to the LyX document.
15531 \begin_layout Description
15532 \begin_inset Flex CharStyle:Code
15535 \begin_layout Plain Layout
15542 \begin_inset Flex CharStyle:Code
15545 \begin_layout Plain Layout
15551 (absolute name or relative to the LyX document).
15554 \begin_layout Description
15555 \begin_inset Flex CharStyle:Code
15558 \begin_layout Plain Layout
15564 The file path, relative to the master LyX document.
15567 \begin_layout Description
15568 \begin_inset Flex CharStyle:Code
15571 \begin_layout Plain Layout
15577 The file path, relative to the LyX document.
15580 \begin_layout Description
15581 \begin_inset Flex CharStyle:Code
15584 \begin_layout Plain Layout
15590 This macro will expand to the absolute path of the system directory.
15591 This is typically used to point to the various helper scripts that are
15595 \begin_layout Description
15596 \begin_inset Flex CharStyle:Code
15599 \begin_layout Plain Layout
15605 A name and full path to a temporary file which will be automatically deleted
15606 whenever the containing document is closed, or the external material insertion
15610 \begin_layout Standard
15611 All path macros contain a trailing directory separator, so you can construct
15613 \begin_inset space \thinspace{}
15617 \begin_inset space \space{}
15620 the absolute filename with
15621 \begin_inset Flex CharStyle:Code
15624 \begin_layout Plain Layout
15625 $$AbsPath$$Basename$$Extension
15633 \begin_layout Standard
15634 The macros above are substituted in all commands unless otherwise noted.
15636 \begin_inset Flex CharStyle:Code
15639 \begin_layout Plain Layout
15645 supports additionally the following substitutions if they are enabled by
15647 \begin_inset Flex CharStyle:Code
15650 \begin_layout Plain Layout
15657 \begin_inset Flex CharStyle:Code
15660 \begin_layout Plain Layout
15669 \begin_layout Description
15670 \begin_inset Flex CharStyle:Code
15673 \begin_layout Plain Layout
15679 The front part of the resize command.
15682 \begin_layout Description
15683 \begin_inset Flex CharStyle:Code
15686 \begin_layout Plain Layout
15692 The back part of the resize command.
15695 \begin_layout Description
15696 \begin_inset Flex CharStyle:Code
15699 \begin_layout Plain Layout
15705 The front part of the rotation command.
15708 \begin_layout Description
15709 \begin_inset Flex CharStyle:Code
15712 \begin_layout Plain Layout
15718 The back part of the rotation command.
15721 \begin_layout Standard
15722 The value string of the
15723 \begin_inset Flex CharStyle:Code
15726 \begin_layout Plain Layout
15732 command supports additionally the following substitutions if they are enabled
15734 \begin_inset Flex CharStyle:Code
15737 \begin_layout Plain Layout
15744 \begin_inset Flex CharStyle:Code
15747 \begin_layout Plain Layout
15756 \begin_layout Description
15757 \begin_inset Flex CharStyle:Code
15760 \begin_layout Plain Layout
15769 \begin_layout Description
15770 \begin_inset Flex CharStyle:Code
15773 \begin_layout Plain Layout
15782 \begin_layout Description
15783 \begin_inset Flex CharStyle:Code
15786 \begin_layout Plain Layout
15795 \begin_layout Description
15796 \begin_inset Flex CharStyle:Code
15799 \begin_layout Plain Layout
15805 The rotation option.
15808 \begin_layout Standard
15809 You may ask why there are so many path macros.
15810 There are mainly two reasons:
15813 \begin_layout Enumerate
15814 Relative and absolute file names should remain relative or absolute, respectivel
15816 Users may have reasons to prefer either form.
15817 Relative names are useful for portable documents that should work on different
15818 machines, for example.
15819 Absolute names may be required by some programs.
15822 \begin_layout Enumerate
15823 LaTeX treats relative file names differently than LyX and other programs
15824 in nested included files.
15825 For LyX, a relative file name is always relative to the document that contains
15827 For LaTeX, it is always relative to the master document.
15828 These two definitions are identical if you have only one document, but
15829 differ if you have a master document that includes part documents.
15830 That means that relative filenames must be transformed when presented to
15832 Fortunately LyX does this automatically for you if you choose the right
15836 \begin_layout Standard
15837 So which path macro should be used in new template definitions? The rule
15841 \begin_layout Itemize
15843 \begin_inset Flex CharStyle:Code
15846 \begin_layout Plain Layout
15852 if an absolute path is required.
15855 \begin_layout Itemize
15857 \begin_inset Flex CharStyle:Code
15860 \begin_layout Plain Layout
15861 $$AbsOrRelPathMaster
15866 if the substituted string is some kind of LaTeX input.
15869 \begin_layout Itemize
15871 \begin_inset Flex CharStyle:Code
15874 \begin_layout Plain Layout
15875 $$AbsOrRelPathParent
15880 in order to preserve the user's choice.
15883 \begin_layout Standard
15884 There are special cases where this rule does not work and e.
15885 \begin_inset space \thinspace{}
15889 \begin_inset space \space{}
15892 relative names are needed, but normally it will work just fine.
15893 One example for such a case is the command
15894 \begin_inset Flex CharStyle:Code
15897 \begin_layout Plain Layout
15898 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15903 in the XFig template above: We can't use the absolute name because the
15905 \begin_inset Flex CharStyle:Code
15908 \begin_layout Plain Layout
15914 files needs the relative name in order to rewrite the file content.
15917 \begin_layout Section
15918 Security discussion
15919 \begin_inset CommandInset label
15921 name "sec:Security-discussion"
15928 \begin_layout Standard
15929 The external material feature interfaces with a lot of external programs
15930 and does so automatically, so we have to consider the security implications
15932 In particular, since you have the option of including your own filenames
15933 and/or parameter strings and those are expanded into a command, it seems
15934 that it would be possible to create a malicious document which executes
15935 arbitrary commands when a user views or prints the document.
15936 This is something we definitely want to avoid.
15939 \begin_layout Standard
15940 However, since the external program commands are specified in the template
15941 configuration file only, there are no security issues if LyX is properly
15942 configured with safe templates only.
15943 This is so because the external programs are invoked with the
15944 \begin_inset Flex CharStyle:Code
15947 \begin_layout Plain Layout
15953 -system call rather than the
15954 \begin_inset Flex CharStyle:Code
15957 \begin_layout Plain Layout
15963 system-call, so it's not possible to execute arbitrary commands from the
15964 filename or parameter section via the shell.
15967 \begin_layout Standard
15968 This also implies that you are restricted in what command strings you can
15969 use in the external material templates.
15970 In particular, pipes and redirection are not readily available.
15971 This has to be so if LyX should remain safe.
15972 If you want to use some of the shell features, you should write a safe
15973 script to do this in a controlled manner, and then invoke the script from
15974 the command string.
15978 \begin_layout Standard
15979 It is possible to design a template that interacts directly with the shell,
15980 but since this would allow a malicious user to execute arbitrary commands
15981 by writing clever filenames and/or parameters, we generally recommend that
15982 you only use safe scripts that work with the
15983 \begin_inset Flex CharStyle:Code
15986 \begin_layout Plain Layout
15992 system call in a controlled manner.
15993 Of course, for use in a controlled environment, it can be tempting to just
15994 fall back to use ordinary shell scripts.
15995 If you do so, be aware that you
15999 provide an easily exploitable security hole in your system.
16000 Of course it stands to reason that such unsafe templates will never be
16001 included in the standard LyX distribution, although we do encourage people
16002 to submit new templates in the open source tradition.
16003 But LyX as shipped from the official distribution channels will never have
16007 \begin_layout Standard
16008 Including external material provides a lot of power, and you have to be
16009 careful not to introduce security hazards with this power.
16010 A subtle error in a single line in an innocent looking script can open
16011 the door to huge security problems.
16012 So if you do not fully understand the issues, we recommend that you consult
16013 a knowledgeable security professional or the LyX development team if you
16014 have any questions about whether a given template is safe or not.
16015 And do this before you use it in an uncontrolled environment.