1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that this document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of this document may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
39 % used for multi-column text
43 \options fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
44 \use_default_options false
50 InsetLayout CharStyle:MenuItem
59 \newcommand*{\menuitem}[1]{{\sffamily #1}}
67 \font_typewriter default
68 \font_default_family default
76 \default_output_format default
77 \bibtex_command default
78 \index_command default
82 \pdf_title "LyX Configuration Manual"
83 \pdf_author "LyX Team"
84 \pdf_subject "LyX-documentation Customization"
85 \pdf_keywords "LyX, documentation, customization"
87 \pdf_bookmarksnumbered true
88 \pdf_bookmarksopen true
89 \pdf_bookmarksopenlevel 1
94 \pdf_pdfusetitle false
95 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
103 \paperorientation portrait
110 \paragraph_separation indent
112 \quotes_language english
115 \paperpagestyle headings
116 \tracking_changes false
117 \output_changes false
119 \author "Jean-Marc Lasgouttes"
126 Customizing LyX: Features for the Advanced User
134 \begin_layout Plain Layout
136 If you have comments or error corrections, please send them to the LyX Documenta
138 \begin_inset CommandInset href
140 target "lyx-docs@lists.lyx.org"
147 \begin_inset Quotes eld
151 \begin_inset Quotes erd
154 in the subject header, and please cc the current maintainer of this file,
155 Richard Heck <rgheck@comcast.net>.
161 \begin_inset Newline newline
165 \begin_inset Newline newline
171 \begin_layout Standard
172 \begin_inset CommandInset toc
173 LatexCommand tableofcontents
180 \begin_layout Standard
181 \begin_inset Note Note
184 \begin_layout Plain Layout
185 Please use change tracking when modifying this document.
186 This makes it easier for our translators to recognize things that have
187 been changed, and it helps the maintainer keep up-to-date with what's been
196 \begin_layout Chapter
200 \begin_layout Standard
201 This manual covers the customization features present in LyX.
202 In it, we discuss issues like keyboard shortcuts, screen previewing options,
203 printer options, sending commands to LyX via the LyX Server, internationalizati
204 on, installing new LaTeX classes and LyX layouts, etc.
205 We can't possibly hope to touch on everything you can change—our developers
206 add new features faster than we can document them—but we will explain the
207 most common customizations and hopefully point you in the right direction
208 for some of the more obscure ones.
211 \begin_layout Standard
212 \begin_inset Branch OutDated
215 \begin_layout Standard
216 Information from previous versions of this document that now seems to be
217 outdated is contained in the OutDated branch of this document.
218 By default, this information will not appear in the LaTeX output.
226 \begin_layout Chapter
227 LyX configuration files
230 \begin_layout Standard
231 This chapter aims to help you to find your way through the LyX configuration
233 Before continuing to read this chapter, you should find out where your
234 LyX library and user directories are by using
235 \begin_inset Flex CharStyle:MenuItem
238 \begin_layout Plain Layout
239 Help\SpecialChar \menuseparator
250 The library directory is the place where LyX places its system-wide configurati
251 on files; the user directory is where you can place your modified versions.
252 We will call the former
253 \begin_inset Flex CharStyle:Code
256 \begin_layout Plain Layout
263 \begin_inset Flex CharStyle:MenuItem
266 \begin_layout Plain Layout
272 in the remainder of this document.
276 \begin_layout Section
278 \begin_inset Flex CharStyle:Code
281 \begin_layout Plain Layout
290 \begin_layout Standard
291 \begin_inset Flex CharStyle:Code
294 \begin_layout Plain Layout
300 and its sub-directories contain a number of files and that can be used
301 to customize LyX's behavior.
302 You can change many of these files from within LyX itself through the
303 \begin_inset Flex CharStyle:MenuItem
306 \begin_layout Plain Layout
307 Tools\SpecialChar \menuseparator
314 Most customization that you will want to do in LyX is possible through
316 However, many other inner aspects of LyX can be customized by modifying
318 \begin_inset Flex CharStyle:Code
321 \begin_layout Plain Layout
328 These files fall in different categories, described in the following subsection
332 \begin_layout Subsection
333 Automatically generated files
336 \begin_layout Standard
337 The files, which are to be found in
338 \begin_inset Flex CharStyle:MenuItem
341 \begin_layout Plain Layout
347 , are generated when you configure LyX.
348 They contain various default values that are guessed by inspection.
349 In general, it is not a good idea to modify them, since they might be overwritt
353 \begin_layout Labeling
354 \labelwidthstring 00.00.0000
355 \begin_inset Flex CharStyle:Code
358 \begin_layout Plain Layout
364 contains defaults for various commands.
367 \begin_layout Labeling
368 \labelwidthstring 00.00.0000
369 \begin_inset Flex CharStyle:Code
372 \begin_layout Plain Layout
378 contains the list of packages that have been recognized by LyX.
379 It is currently unused by the LyX program itself, but the information extracted
380 , and more, is made available with
381 \begin_inset Flex CharStyle:MenuItem
384 \begin_layout Plain Layout
385 Help\SpecialChar \menuseparator
398 \begin_layout Labeling
399 \labelwidthstring 00.00.0000
400 \begin_inset Flex CharStyle:Code
403 \begin_layout Plain Layout
409 the list of text classes that have been found in your
410 \begin_inset Flex CharStyle:Code
413 \begin_layout Plain Layout
419 directories, along with the associated LaTeX document class and their descripti
423 \begin_layout Labeling
424 \labelwidthstring 00.00.0000
425 \begin_inset Flex CharStyle:Code
428 \begin_layout Plain Layout
434 the list of layout modules found in your
435 \begin_inset Flex CharStyle:Code
438 \begin_layout Plain Layout
447 \begin_layout Labeling
448 \labelwidthstring 00.00.0000
449 \begin_inset Flex CharStyle:Code
452 \begin_layout Plain Layout
458 lists of various sorts of LaTeX-related files found on your system
461 \begin_layout Labeling
462 \labelwidthstring 00.00.0000
463 \begin_inset Flex CharStyle:Code
466 \begin_layout Plain Layout
472 is automatically generated during configuration from the file
473 \begin_inset Flex CharStyle:Code
476 \begin_layout Plain Layout
483 It contains information on your LaTeX configuration.
486 \begin_layout Subsection
490 \begin_layout Standard
491 These directories are duplicated between
492 \begin_inset Flex CharStyle:Code
495 \begin_layout Plain Layout
502 \begin_inset Flex CharStyle:Code
505 \begin_layout Plain Layout
512 If a particular files exists in both places, the one in
513 \begin_inset Flex CharStyle:Code
516 \begin_layout Plain Layout
525 \begin_layout Labeling
526 \labelwidthstring 00.00.0000
527 \begin_inset Flex CharStyle:Code
530 \begin_layout Plain Layout
536 this directory contains files with the extension
537 \begin_inset Flex CharStyle:Code
540 \begin_layout Plain Layout
546 that define the keybindings used in LyX.
547 If there exists an internationalized version of the bind file named
548 \begin_inset Flex CharStyle:Code
551 \begin_layout Plain Layout
557 , that will be used first.
560 \begin_layout Labeling
561 \labelwidthstring 00.00.0000
562 \begin_inset Flex CharStyle:Code
565 \begin_layout Plain Layout
571 contains graphics files that can be included in documents.
575 \begin_layout Labeling
576 \labelwidthstring 00.00.0000
577 \begin_inset Flex CharStyle:Code
580 \begin_layout Plain Layout
586 contains LyX documentation files (including the one you are currently reading).
588 \begin_inset Flex CharStyle:Code
591 \begin_layout Plain Layout
597 deserves special attention, as noted above.
598 The internationalized help docs are in subdirectories
599 \begin_inset Flex CharStyle:Code
602 \begin_layout Plain Layout
609 \begin_inset Quotes eld
613 \begin_inset Quotes erd
616 is the ISO language code.
622 \begin_inset CommandInset ref
624 reference "cha:Internationalizing-LyX"
631 \begin_layout Labeling
632 \labelwidthstring 00.00.0000
633 \begin_inset Flex CharStyle:Code
636 \begin_layout Plain Layout
642 contains example files that explain how to use some features.
643 In the file browser, press the
644 \begin_inset Flex CharStyle:MenuItem
647 \begin_layout Plain Layout
656 \begin_layout Labeling
657 \labelwidthstring 00.00.0000
658 \begin_inset Flex CharStyle:Code
661 \begin_layout Plain Layout
667 contains image files that are used by the
668 \begin_inset Flex CharStyle:MenuItem
671 \begin_layout Plain Layout
678 In addition, it also contains the individual icons used in the toolbar
679 and the banners that can be shown when LyX is launched.
682 \begin_layout Labeling
683 \labelwidthstring 00.00.0000
684 \begin_inset Flex CharStyle:Code
687 \begin_layout Plain Layout
693 contains keyboard keymapping files.
699 \begin_inset CommandInset ref
701 reference "sec:International-Keymap-Stuff"
708 \begin_layout Labeling
709 \labelwidthstring 00.00.0000
710 \begin_inset Flex CharStyle:Code
713 \begin_layout Plain Layout
719 contains the text class and module files described in Chapter
724 \begin_inset CommandInset ref
726 reference "cha:Installing-New-Document"
733 \begin_layout Labeling
734 \labelwidthstring 00.00.0000
735 \begin_inset Flex CharStyle:Code
738 \begin_layout Plain Layout
745 \begin_inset Flex CharStyle:Code
748 \begin_layout Plain Layout
754 Python scripts used to convert between LyX versions.
755 These can be run from the command line if, say, you want to batch-convert
759 \begin_layout Labeling
760 \labelwidthstring 00.00.0000
761 \begin_inset Flex CharStyle:Code
764 \begin_layout Plain Layout
770 contains some files that demonstrate the capabilities of the
771 \begin_inset Flex CharStyle:MenuItem
774 \begin_layout Plain Layout
785 Also contains some scripts used by LyX itself.
788 \begin_layout Labeling
789 \labelwidthstring 00.00.0000
790 \begin_inset Flex CharStyle:Code
793 \begin_layout Plain Layout
799 contains the standard LyX template files described in Chapter
804 \begin_inset CommandInset ref
806 reference "sec:Creating-Templates"
813 \begin_layout Labeling
814 \labelwidthstring 00.00.0000
815 \begin_inset Flex CharStyle:Code
818 \begin_layout Plain Layout
824 contains files with the extension
825 \begin_inset Flex CharStyle:Code
828 \begin_layout Plain Layout
834 that define the user interface to LyX.
835 That is, the files define which items appear in which menus and the items
836 appearing on the toolbar.
839 \begin_layout Subsection
840 Files you don't want to modify
843 \begin_layout Standard
844 These files are used internally by LyX and you generally do not need to
845 modify them unless you are a developer.
848 \begin_layout Labeling
849 \labelwidthstring 00.00.0000
850 \begin_inset Flex CharStyle:Code
853 \begin_layout Plain Layout
859 this file contains the list of LyX developers.
860 The contents are displayed with the menu entry
861 \begin_inset Flex CharStyle:MenuItem
864 \begin_layout Plain Layout
865 Help\SpecialChar \menuseparator
878 \begin_layout Labeling
879 \labelwidthstring 00.00.0000
880 \begin_inset Flex CharStyle:Code
883 \begin_layout Plain Layout
889 this is a LaTeX script used during the configuration process.
893 \begin_layout Labeling
894 \labelwidthstring 00.00.0000
895 \begin_inset Flex CharStyle:Code
898 \begin_layout Plain Layout
904 this is the script that is used to re-configure LyX.
905 It creates configuration files in the directory it was run from.
908 \begin_layout Subsection
909 Other files needing a line or two...
912 \begin_layout Labeling
913 \labelwidthstring 00.00.0000
914 \begin_inset Flex CharStyle:Code
917 \begin_layout Plain Layout
923 this contains tables describing how different character encodings can be
927 \begin_layout Labeling
928 \labelwidthstring 00.00.0000
929 \begin_inset Flex CharStyle:Code
932 \begin_layout Plain Layout
938 this file contains the templates available to the new
939 \begin_inset Flex CharStyle:MenuItem
942 \begin_layout Plain Layout
955 \begin_layout Labeling
956 \labelwidthstring 00.00.0000
957 \begin_inset Flex CharStyle:Code
960 \begin_layout Plain Layout
966 this file contains a list of all the languages currently supported by LyX.
969 \begin_layout Section
970 Your local configuration directory
973 \begin_layout Standard
974 Even if you are using LyX as an unprivileged user, you might want to change
975 LyX configuration for your own use.
977 \begin_inset Flex CharStyle:Code
980 \begin_layout Plain Layout
986 directory contains all your personal configuration files.
987 This is the directory described as
988 \begin_inset Quotes eld
992 \begin_inset Quotes erd
996 \begin_inset Flex CharStyle:MenuItem
999 \begin_layout Plain Layout
1000 Help\SpecialChar \menuseparator
1002 \begin_inset space ~
1011 This directory is used as a mirror of
1012 \begin_inset Flex CharStyle:Code
1015 \begin_layout Plain Layout
1021 , which means that every file in
1022 \begin_inset Flex CharStyle:Code
1025 \begin_layout Plain Layout
1031 is a replacement for the corresponding file in
1032 \begin_inset Flex CharStyle:Code
1035 \begin_layout Plain Layout
1042 Any configuration file described in the above sections can be placed either
1043 in the system-wide directory, in which case it will affect all users, or
1044 in your local directory for your own use.
1047 \begin_layout Standard
1048 To make things clearer, let's provide a few examples:
1051 \begin_layout Itemize
1052 The preferences set in the
1053 \begin_inset Flex CharStyle:MenuItem
1056 \begin_layout Plain Layout
1057 Tools\SpecialChar \menuseparator
1063 dialog are saved to a file
1064 \begin_inset Flex CharStyle:Code
1067 \begin_layout Plain Layout
1074 \begin_inset Flex CharStyle:Code
1077 \begin_layout Plain Layout
1086 \begin_layout Itemize
1087 When you reconfigure using
1088 \begin_inset Flex CharStyle:MenuItem
1091 \begin_layout Plain Layout
1092 Tools\SpecialChar \menuseparator
1099 \begin_inset Flex CharStyle:Code
1102 \begin_layout Plain Layout
1108 script, and the resulting files are written in your local configuration
1110 This means that any additional text class file that you might have added
1112 \begin_inset Flex CharStyle:Code
1115 \begin_layout Plain Layout
1121 will be added to the list of classes in the
1122 \begin_inset Flex CharStyle:MenuItem
1125 \begin_layout Plain Layout
1126 Document\SpecialChar \menuseparator
1135 \begin_layout Itemize
1136 If you get some updated documentation from LyX ftp site and cannot install
1137 it because you do not have sysadmin rights on your system, you can just
1139 \begin_inset Flex CharStyle:Code
1142 \begin_layout Plain Layout
1148 and the items in the
1149 \begin_inset Flex CharStyle:MenuItem
1152 \begin_layout Plain Layout
1158 menu will open them!
1161 \begin_layout Section
1162 Running LyX with multiple configurations
1165 \begin_layout Standard
1166 The configuration freedom of the local configuration directory may not suffice
1167 if you want to have more than one configuration at your disposal.
1168 For example, you may want to be use different key bindings or printer settings
1170 You can achieve this by having several such directories.
1171 You then specify which directory to use at run-time.
1174 \begin_layout Standard
1175 Invoking LyX with the command line switch
1176 \begin_inset Flex CharStyle:Code
1179 \begin_layout Plain Layout
1189 instructs the program to read the configuration from that directory, and
1190 not from the default directory.
1191 (You can determine the default directory by running LyX without the
1192 \begin_inset Flex CharStyle:Code
1195 \begin_layout Plain Layout
1201 switch.) If the specified directory does not exist, LyX offers to create
1202 it for you, just like it does for the default directory on the first time
1203 you run the program.
1204 You can modify the configuration options in this additional user directory
1205 exactly as you would for the default directory.
1206 These directories are completely independent (but read on).
1207 Note that setting the environment variable
1208 \begin_inset Flex CharStyle:Code
1211 \begin_layout Plain Layout
1217 to some value has exactly the same effect.
1220 \begin_layout Standard
1221 Having several configurations also requires more maintenance: if you want
1222 to add a new layout to
1223 \begin_inset Flex CharStyle:Code
1226 \begin_layout Plain Layout
1232 which you want available from all your configurations, you must add it
1233 to each directory separately.
1234 You can avoid this with the following trick: after LyX creates the additional
1235 directory, most of the subdirectories (see above) are empty.
1236 If you want the new configuration to mirror an existing one, replace the
1237 empty subdirectory with a symbolic link to the matching subdirectory in
1238 the existing configuration.
1240 \begin_inset Flex CharStyle:Code
1243 \begin_layout Plain Layout
1249 subdirectory, however, since it contains a file written by the configuration
1250 script (also accessible through
1251 \begin_inset Flex CharStyle:MenuItem
1254 \begin_layout Plain Layout
1255 Tools\SpecialChar \menuseparator
1261 ) which is configuration-specific.
1264 \begin_layout Chapter
1265 The Preferences dialog
1268 \begin_layout Standard
1269 All options of the preferences dialog are described in the Appendix
1271 The Preferences Dialog
1278 For some options you might find here more details.
1281 \begin_layout Section
1283 \begin_inset CommandInset label
1292 \begin_layout Standard
1293 The first step is to define your file formats if they are not already defined.
1295 \begin_inset Flex CharStyle:MenuItem
1298 \begin_layout Plain Layout
1299 Tools\SpecialChar \menuseparator
1307 \begin_inset Flex CharStyle:MenuItem
1310 \begin_layout Plain Layout
1311 File Handling\SpecialChar \menuseparator
1318 \begin_inset Flex CharStyle:MenuItem
1321 \begin_layout Plain Layout
1322 New\SpecialChar \ldots{}
1328 button to define your new format.
1330 \begin_inset Flex CharStyle:MenuItem
1333 \begin_layout Plain Layout
1339 field contains the name used to identify the format in the GUI.
1341 \begin_inset Flex CharStyle:MenuItem
1344 \begin_layout Plain Layout
1350 is used to identify the format internally.
1351 You will also need to enter a file extension.
1352 These are all required.
1354 \begin_inset Flex CharStyle:MenuItem
1357 \begin_layout Plain Layout
1363 field is used to provide a keyboard shortcut on the menus.
1364 (For example, pressing
1365 \begin_inset Flex CharStyle:MenuItem
1368 \begin_layout Plain Layout
1375 \begin_inset Flex CharStyle:MenuItem
1378 \begin_layout Plain Layout
1379 View\SpecialChar \menuseparator
1388 \begin_layout Standard
1390 \begin_inset Flex CharStyle:MenuItem
1393 \begin_layout Plain Layout
1400 \begin_inset Flex CharStyle:MenuItem
1403 \begin_layout Plain Layout
1410 For example, you might want to use
1411 \begin_inset Flex CharStyle:MenuItem
1414 \begin_layout Plain Layout
1420 to view PostScript files.
1421 You can enter the command needed to start the program in the corresponding
1423 In defining this command, you can use the four variables listed in the
1425 The viewer is launched when you view an image in LyX or use the
1426 \begin_inset Flex CharStyle:MenuItem
1429 \begin_layout Plain Layout
1436 The editor is for example launched when you right-click on an image and
1438 \begin_inset Flex CharStyle:MenuItem
1441 \begin_layout Plain Layout
1447 in the appearing context menu.
1450 \begin_layout Standard
1452 \begin_inset Flex CharStyle:MenuItem
1455 \begin_layout Plain Layout
1461 option tells LyX that a format is suitable for document export.
1462 If this is set and if a suitable conversion route exists (see sec.
1463 \begin_inset space \thinspace{}
1467 \begin_inset CommandInset ref
1469 reference "sec:Converters"
1473 ), the format will appear in the
1474 \begin_inset Flex CharStyle:MenuItem
1477 \begin_layout Plain Layout
1478 File\SpecialChar \menuseparator
1485 The format will also appear in the
1486 \begin_inset Flex CharStyle:MenuItem
1489 \begin_layout Plain Layout
1495 menu if a viewer is specified for the format.
1496 Pure image formats, such as
1497 \begin_inset Flex CharStyle:Code
1500 \begin_layout Plain Layout
1506 , should not use this option.
1507 Formats that can both represent vector graphics and documents like
1508 \begin_inset Flex CharStyle:Code
1511 \begin_layout Plain Layout
1520 \begin_layout Standard
1522 \begin_inset Flex CharStyle:MenuItem
1525 \begin_layout Plain Layout
1526 Vector graphics format
1531 tells LyX that a format can contain vector graphics.
1532 This information is used to determine the target format of included graphics
1534 \begin_inset Flex CharStyle:MenuItem
1537 \begin_layout Plain Layout
1544 Included graphics may need to be converted to either
1545 \begin_inset Flex CharStyle:MenuItem
1548 \begin_layout Plain Layout
1555 \begin_inset Flex CharStyle:MenuItem
1558 \begin_layout Plain Layout
1565 \begin_inset Flex CharStyle:MenuItem
1568 \begin_layout Plain Layout
1575 \begin_inset Flex CharStyle:MenuItem
1578 \begin_layout Plain Layout
1584 cannot handle other image formats.
1585 If an included graphic is not already in
1586 \begin_inset Flex CharStyle:MenuItem
1589 \begin_layout Plain Layout
1596 \begin_inset Flex CharStyle:MenuItem
1599 \begin_layout Plain Layout
1606 \begin_inset Flex CharStyle:MenuItem
1609 \begin_layout Plain Layout
1615 format, it is converted to
1616 \begin_inset Flex CharStyle:MenuItem
1619 \begin_layout Plain Layout
1625 if the vector format option is set, and otherwise to
1626 \begin_inset Flex CharStyle:MenuItem
1629 \begin_layout Plain Layout
1638 \begin_layout Section
1642 \begin_layout Standard
1643 Since all conversions from one format to another take place in LyX's temporary
1644 directory, it is sometimes necessary to modify a file before copying it
1645 to the temporary directory in order that the conversion may be performed.
1649 \begin_layout Plain Layout
1650 For example, the file may refer to other files—images, for example—using
1651 relative file names, and these may become invalid when the file is copied
1652 to the temporary directory.
1657 This is done by a Copier: It copies a file to (or from) the temporary directory
1658 and may modify it in the process.
1661 \begin_layout Standard
1662 The definitions of the copiers may use four variables:
1665 \begin_layout Labeling
1666 \labelwidthstring 00.00.0000
1667 \begin_inset Flex CharStyle:Code
1670 \begin_layout Plain Layout
1676 The LyX system directory (e.
1677 \begin_inset space \thinspace{}
1681 \begin_inset space \space{}
1685 \begin_inset Flex CharStyle:MenuItem
1688 \begin_layout Plain Layout
1697 \begin_layout Labeling
1698 \labelwidthstring 00.00.0000
1699 \begin_inset Flex CharStyle:Code
1702 \begin_layout Plain Layout
1711 \begin_layout Labeling
1712 \labelwidthstring 00.00.0000
1713 \begin_inset Flex CharStyle:Code
1716 \begin_layout Plain Layout
1725 \begin_layout Labeling
1726 \labelwidthstring 00.00.0000
1727 \begin_inset Flex CharStyle:Code
1730 \begin_layout Plain Layout
1739 \begin_layout Standard
1740 The latter should be the filename as it would be used in a LaTeX's
1747 It is relevant only when exporting files suitable for such inclusion.
1750 \begin_layout Standard
1751 Copiers can be used to do almost anything with output files.
1752 For example, suppose you want generated pdf files to be copied to a special
1754 \begin_inset Flex CharStyle:Code
1757 \begin_layout Plain Layout
1764 Then you could write a shell script such as this one:
1767 \begin_layout Standard
1768 \begin_inset listings
1772 \begin_layout Plain Layout
1777 \begin_layout Plain Layout
1782 \begin_layout Plain Layout
1784 TOFILE=`basename $2`
1787 \begin_layout Plain Layout
1789 cp $FROMFILE /home/you/pdf/$TOFILE
1794 Save it in your local LyX directory—say,
1795 \begin_inset Flex CharStyle:Code
1798 \begin_layout Plain Layout
1799 /home/you/.lyx/scripts/pdfcopier.sh
1804 —and make it executable, if you need to do so on your platform.
1806 \begin_inset Flex CharStyle:MenuItem
1809 \begin_layout Plain Layout
1810 Tools\SpecialChar \menuseparator
1816 dialog, select under
1817 \begin_inset Flex CharStyle:MenuItem
1820 \begin_layout Plain Layout
1821 File Handling\SpecialChar \menuseparator
1828 \begin_inset Flex CharStyle:MenuItem
1831 \begin_layout Plain Layout
1837 format—or one of the other pdf formats—and enter
1838 \begin_inset Flex CharStyle:Code
1841 \begin_layout Plain Layout
1842 pdfcopier.sh $$i $$o
1848 \begin_inset Flex CharStyle:MenuItem
1851 \begin_layout Plain Layout
1861 \begin_layout Standard
1862 Copiers are used by LyX in various of its own conversions.
1863 For example, if appropriate programs are found, LyX will automatically
1864 install copiers for the
1865 \begin_inset Flex CharStyle:MenuItem
1868 \begin_layout Plain Layout
1875 \begin_inset Flex CharStyle:MenuItem
1878 \begin_layout Plain Layout
1880 \begin_inset space ~
1889 When these formats are exported, the copier sees that not just the main
1890 HTML file but various associated files (style files, images, etc.) are also
1892 All these files are written to a subdirectory of the directory in which
1893 the original LyX file was found.
1897 \begin_layout Plain Layout
1898 This copier can be customized.
1900 \begin_inset Quotes eld
1904 \begin_inset Quotes erd
1907 argument takes a comma-separated list of extensions to be copied; if it
1908 is omitted, all files will be copied.
1910 \begin_inset Quotes eld
1914 \begin_inset Quotes erd
1917 argument determines the extension added to the generated directory.
1919 \begin_inset Quotes eld
1923 \begin_inset Flex CharStyle:MenuItem
1926 \begin_layout Plain Layout
1933 \begin_inset Quotes erd
1936 , so HTML generated from
1937 \begin_inset Flex CharStyle:MenuItem
1940 \begin_layout Plain Layout
1941 /path/to/filename.lyx
1947 \begin_inset Flex CharStyle:MenuItem
1950 \begin_layout Plain Layout
1951 /path/to/filename.html.LyXconv
1965 \begin_layout Section
1967 \begin_inset CommandInset label
1969 name "sec:Converters"
1976 \begin_layout Standard
1977 You can define your own Converters to convert files between different formats.
1979 \begin_inset Flex CharStyle:MenuItem
1982 \begin_layout Plain Layout
1983 Tools\SpecialChar \menuseparator
1984 Preferences\SpecialChar \menuseparator
1985 File Handling\SpecialChar \menuseparator
1994 \begin_layout Standard
1995 To define a new converter, select the
1996 \begin_inset Flex CharStyle:MenuItem
1999 \begin_layout Plain Layout
2001 \begin_inset space ~
2010 \begin_inset Flex CharStyle:MenuItem
2013 \begin_layout Plain Layout
2015 \begin_inset space ~
2023 from the drop-down lists, enter the command needed for the conversion,
2025 \begin_inset Flex CharStyle:MenuItem
2028 \begin_layout Plain Layout
2035 Several variables can be used in the definition of converters:
2038 \begin_layout Labeling
2039 \labelwidthstring 00.00.0000
2040 \begin_inset Flex CharStyle:Code
2043 \begin_layout Plain Layout
2049 The LyX system directory
2052 \begin_layout Labeling
2053 \labelwidthstring 00.00.0000
2054 \begin_inset Flex CharStyle:Code
2057 \begin_layout Plain Layout
2066 \begin_layout Labeling
2067 \labelwidthstring 00.00.0000
2068 \begin_inset Flex CharStyle:Code
2071 \begin_layout Plain Layout
2080 \begin_layout Labeling
2081 \labelwidthstring 00.00.0000
2082 \begin_inset Flex CharStyle:Code
2085 \begin_layout Plain Layout
2091 The base filename of the input file (i.
2092 \begin_inset space \thinspace{}
2095 g., without the extension)
2098 \begin_layout Labeling
2099 \labelwidthstring 00.00.0000
2100 \begin_inset Flex CharStyle:Code
2103 \begin_layout Plain Layout
2109 The path to the input file
2112 \begin_layout Labeling
2113 \labelwidthstring 00.00.0000
2114 \begin_inset Flex CharStyle:Code
2117 \begin_layout Plain Layout
2123 The path to the original input file (this is different from $$p when a
2124 chain of converters is called).
2127 \begin_layout Standard
2129 \begin_inset Flex CharStyle:MenuItem
2132 \begin_layout Plain Layout
2134 \begin_inset space ~
2142 field you can enter the following flags, separated by commas:
2145 \begin_layout Labeling
2146 \labelwidthstring 00.00.0000
2147 \begin_inset Flex CharStyle:Code
2150 \begin_layout Plain Layout
2156 This converter runs some form of LaTeX.
2157 This will make LyX's LaTeX error logs available.
2160 \begin_layout Labeling
2161 \labelwidthstring 00.00.0000
2162 \begin_inset Flex CharStyle:Code
2165 \begin_layout Plain Layout
2172 \begin_inset Flex CharStyle:MenuItem
2175 \begin_layout Plain Layout
2181 file for the conversion.
2184 \begin_layout Labeling
2185 \labelwidthstring 00.00.0000
2186 \begin_inset Flex CharStyle:Code
2189 \begin_layout Plain Layout
2198 \begin_layout Standard
2199 The following three flags are not really flags at all because they take
2201 \begin_inset Flex CharStyle:MenuItem
2204 \begin_layout Plain Layout
2206 \begin_inset space ~
2210 \begin_inset space ~
2221 \begin_layout Labeling
2222 \labelwidthstring 00.00.0000
2223 \begin_inset Flex CharStyle:Code
2226 \begin_layout Plain Layout
2232 If set, the converter's standard error will be redirected to a file
2233 \begin_inset Flex CharStyle:Code
2236 \begin_layout Plain Layout
2242 , and the script given as argument will be run as:
2243 \begin_inset Flex CharStyle:Code
2246 \begin_layout Plain Layout
2247 script < infile.out > infile.log
2253 The argument may contain
2254 \begin_inset Flex CharStyle:Code
2257 \begin_layout Plain Layout
2266 \begin_layout Labeling
2267 \labelwidthstring 00.00.0000
2268 \begin_inset Flex CharStyle:Code
2271 \begin_layout Plain Layout
2277 The name of the directory in which the converter will dump the generated
2279 LyX will not create this directory, and it does not copy anything into
2280 it, though it will copy this directory to the destination.
2281 The argument may contain
2282 \begin_inset Flex CharStyle:Code
2285 \begin_layout Plain Layout
2291 , which will be replaced by the base name of the input and output files,
2292 respectively, when the directory is copied.
2293 \begin_inset Newline newline
2296 Note that resultdir and usetempdir make no sense together.
2297 The latter will be ignored if the former is given.
2300 \begin_layout Labeling
2301 \labelwidthstring 00.00.0000
2302 \begin_inset Flex CharStyle:Code
2305 \begin_layout Plain Layout
2311 Determines the output file name and may, contain
2312 \begin_inset Flex CharStyle:Code
2315 \begin_layout Plain Layout
2322 Sensible only with resultdir and optional even then; if not given, it defaults
2326 \begin_layout Standard
2327 None of these last three are presently used in any of the converters that
2328 are installed with LyX.
2332 \begin_layout Standard
2333 You do not have to define converters for all formats between which you want
2335 For example, you will note that there is no `LyX to PostScript' converter,
2336 but LyX will export PostScript.
2337 It does so by first creating a LaTeX file (no converter needs to be defined
2338 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2339 and finally converting the resulting DVI file to PostScript.
2340 LyX finds such `chains' of converters automatically, and it will always
2341 choose the shortest possible chain.
2342 You can, though, still define multiple conversion methods between file
2344 For example, the standard LyX configuration provides three ways to convert
2345 LaTeX to PDF: Directly, using
2346 \begin_inset Flex CharStyle:MenuItem
2349 \begin_layout Plain Layout
2355 ; via (DVI and) PostScript, using
2356 \begin_inset Flex CharStyle:MenuItem
2359 \begin_layout Plain Layout
2366 \begin_inset Flex CharStyle:MenuItem
2369 \begin_layout Plain Layout
2376 To define such alternate chains, you must define multiple target `file
2377 formats', as described in section
2378 \begin_inset CommandInset ref
2380 reference "sec:Formats"
2385 For example, in the standard configuration, the formats named
2386 \begin_inset Flex CharStyle:MenuItem
2389 \begin_layout Plain Layout
2396 \begin_inset Flex CharStyle:MenuItem
2399 \begin_layout Plain Layout
2406 \begin_inset Flex CharStyle:MenuItem
2409 \begin_layout Plain Layout
2415 are defined, all of which share the extension
2416 \begin_inset Flex CharStyle:MenuItem
2419 \begin_layout Plain Layout
2425 , and which correspond to the conversion methods just mentioned.
2428 \begin_layout Chapter
2429 Internationalizing LyX
2430 \begin_inset CommandInset label
2432 name "cha:Internationalizing-LyX"
2439 \begin_layout Standard
2440 LyX supports using a translated interface.
2441 Last time we checked, LyX provided text in thirty languages.
2442 The language of choice is called your
2447 (For further reading on locale settings, see also the documentation for
2448 locale that comes with your operating system.
2449 For Linux, the manual page for
2450 \begin_inset Flex CharStyle:Code
2453 \begin_layout Plain Layout
2459 could be a good place to start).
2462 \begin_layout Standard
2463 Notice that these translations will work, but do contain a few flaws.
2464 In particular, all dialogs have been designed with the English text in
2465 mind, which means that some of the translated text will be too large to
2466 fit within the space allocated.
2467 This is only a display problem and will not cause any harm.
2468 Also, you will find that some of the translations do not define shortcut
2469 keys for everything.
2470 Sometimes, there are simply not enough free letters to do it.
2471 Other times, the translator just hasn't got around to doing it yet.
2472 Our localization team, which you may wish to join,
2476 \begin_layout Plain Layout
2477 If you are a fluent speaker of a language other than English, joining these
2478 teams is a great way to give back to the LyX community!
2483 will of course try to fix these shortcomings in future versions of LyX.
2486 \begin_layout Section
2490 \begin_layout Subsection
2491 Translating the graphical user interface (text messages).
2494 \begin_layout Standard
2496 \begin_inset Flex CharStyle:Code
2499 \begin_layout Plain Layout
2505 library to handle the internationalization of the interface.
2506 To have LyX speak your favorite language in all menus and dialogs, you
2508 \begin_inset Flex CharStyle:Code
2511 \begin_layout Plain Layout
2517 -file for that language.
2518 When this is available, you'll have to generate a
2519 \begin_inset Flex CharStyle:Code
2522 \begin_layout Plain Layout
2528 -file from it and install the
2529 \begin_inset Flex CharStyle:Code
2532 \begin_layout Plain Layout
2539 The process of doing all of this is explained in the documentation for
2541 \begin_inset Flex CharStyle:Code
2544 \begin_layout Plain Layout
2551 It is possible to do this just for yourself, but if you're going to do
2552 it, you might as well share the results of your labors with the rest of
2554 Send a message to the LyX developers' list for more information about how
2558 \begin_layout Standard
2559 In short, this is what you should do (xx denotes the language code):
2562 \begin_layout Itemize
2563 Check out the LyX source code.
2565 \begin_inset CommandInset href
2567 name "information on the web"
2568 target "http://www.lyx.org/devel/cvs.php"
2575 \begin_layout Itemize
2577 \begin_inset Flex CharStyle:Code
2580 \begin_layout Plain Layout
2586 to the folder of the
2587 \begin_inset Flex CharStyle:Code
2590 \begin_layout Plain Layout
2598 \begin_inset Flex CharStyle:Code
2601 \begin_layout Plain Layout
2609 \begin_inset Flex CharStyle:Code
2612 \begin_layout Plain Layout
2618 doesn't exist anywhere, it can be remade with the console command
2619 \begin_inset Flex CharStyle:Code
2622 \begin_layout Plain Layout
2628 in that directory, or you can use an existing po-file for some other language
2632 \begin_layout Itemize
2634 \begin_inset Flex CharStyle:Code
2637 \begin_layout Plain Layout
2647 \begin_layout Plain Layout
2648 This is just a text file, so it can be edited in any text editor.
2649 But there are also specialized programs that support such editing, such
2654 (for all platforms) or
2663 contains a `mode' for editing
2664 \begin_inset Flex CharStyle:Code
2667 \begin_layout Plain Layout
2678 For some menu- and widget-labels, there are also shortcut keys that should
2680 Those keys are marked after a `|', and should be translated according to
2681 the words and phrases of the language.
2682 You should also fill also out the information at the beginning of the new
2684 \begin_inset Flex CharStyle:Code
2687 \begin_layout Plain Layout
2693 -file with your email-address, etc., so people know where to reach you with
2694 suggestions and entertaining flames.
2697 \begin_layout Standard
2698 If you are just doing this on your own, then:
2701 \begin_layout Itemize
2703 \begin_inset Flex CharStyle:Code
2706 \begin_layout Plain Layout
2713 This can be done with
2714 \begin_inset Flex CharStyle:Code
2717 \begin_layout Plain Layout
2718 msgfmt -o xx.mo < xx.po
2726 \begin_layout Itemize
2728 \begin_inset Flex CharStyle:Code
2731 \begin_layout Plain Layout
2737 -file to your locale-tree, at the correct directory for application messages
2742 xx, and under the name
2743 \begin_inset Flex CharStyle:Code
2746 \begin_layout Plain Layout
2753 \begin_inset space \thinspace{}
2757 \begin_inset space \space{}
2761 \begin_inset Flex CharStyle:Code
2764 \begin_layout Plain Layout
2765 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2775 \begin_layout Standard
2776 As said, however, it would be best if the new
2777 \begin_inset Flex CharStyle:Code
2780 \begin_layout Plain Layout
2786 -file could be added to the LyX distribution, so others can use it.
2787 Adding it involves making additional changes to LyX.
2788 So send an email to the developers' mailing list if you're interested in
2792 \begin_layout Subsubsection
2796 \begin_layout Standard
2797 Sometimes it turns out that one English message needs to be translated into
2798 different messages in the target language.
2799 One example is the message
2800 \begin_inset Flex CharStyle:Code
2803 \begin_layout Plain Layout
2809 which has the German translation
2817 , depending upon exactly what the English
2818 \begin_inset Quotes eld
2822 \begin_inset Quotes erd
2827 \begin_inset Flex CharStyle:Code
2830 \begin_layout Plain Layout
2836 does not handle such ambiguous translations.
2837 Therefore you have to add some context information to the message: Instead
2839 \begin_inset Flex CharStyle:Code
2842 \begin_layout Plain Layout
2849 \begin_inset Flex CharStyle:Code
2852 \begin_layout Plain Layout
2853 To[[as in 'From format x to format y']]
2859 \begin_inset Flex CharStyle:Code
2862 \begin_layout Plain Layout
2863 To[[as in 'From page x to page y']].
2868 Now the two occurrences of
2869 \begin_inset Flex CharStyle:Code
2872 \begin_layout Plain Layout
2879 \begin_inset Flex CharStyle:Code
2882 \begin_layout Plain Layout
2888 and can be translated correctly to
2899 \begin_layout Standard
2900 Of course the context information needs to be stripped off the original
2901 message when no translation is used.
2902 Therefore you have to put it in double square brackets at the end of the
2903 message (see the example above).
2904 The translation mechanism of LyX ensures that everything in double square
2905 brackets at the end of messages is removed before displaying the message.
2908 \begin_layout Subsection
2909 Translating the documentation.
2912 \begin_layout Standard
2913 The online documentation (in the
2914 \begin_inset Flex CharStyle:MenuItem
2917 \begin_layout Plain Layout
2923 -menu) can (and should!) be translated.
2924 If there are translated versions of the documentation available
2928 \begin_layout Plain Layout
2929 As of March 2008, at least some of the documents have been translated into
2930 fourteen languages, with the Tutorial available in a few more.
2935 and the locale is set accordingly, these will be used automagically by
2937 LyX looks for translated versions as
2938 \begin_inset Flex CharStyle:Code
2941 \begin_layout Plain Layout
2942 LyXDir/doc/xx/DocName.lyx
2948 \begin_inset Flex CharStyle:Code
2951 \begin_layout Plain Layout
2957 is the code for the language currently in use.
2958 If there are no translated documents, the default English versions will
2960 Note that the translated versions must have the same filenames (
2961 \begin_inset Flex CharStyle:Code
2964 \begin_layout Plain Layout
2970 above) as the original.
2971 If you feel up to translating the documentation (an excellent way to proof-read
2972 the original documentation by the way!), there are a few things you should
2976 \begin_layout Itemize
2978 \begin_inset Flex CharStyle:Code
2981 \begin_layout Plain Layout
2987 , the guide to writing LyX documentation.
2988 Pay special attention to the translator's section.
2991 \begin_layout Itemize
2992 Check out the documentation translation web page at
2993 \begin_inset CommandInset href
2995 name "http://www.lyx.org/Translation"
2996 target "http://www.lyx.org/Translation"
3001 That way, you can find out which (if any) documents have already been translate
3002 d into your language.
3003 You can also find out who (if anyone) is organizing the effort to translate
3004 the documentation into your language.
3005 If no one is organizing the effort, please let us know that you're interested.
3008 \begin_layout Standard
3009 Once you get to actually translating, here's a few hints for you that may
3013 \begin_layout Itemize
3014 Join the documentation team! There is information on how to do that in
3015 \begin_inset Flex CharStyle:Code
3018 \begin_layout Plain Layout
3025 \begin_inset Flex CharStyle:MenuItem
3028 \begin_layout Plain Layout
3029 Help\SpecialChar \menuseparator
3039 ), which by the way is the first document you should translate.
3042 \begin_layout Itemize
3043 Learn the typographic conventions for the language you are translating to.
3044 Typography is an ancient art and over the centuries, a great variety of
3045 conventions have developed throughout different parts of the world.
3046 Also study the professional terminology amongst typographers in your country.
3047 Inventing your own terminology will only confuse the users.
3050 (Warning! Typography is addictive!)
3053 \begin_layout Itemize
3054 Make a copy of the document.
3055 This will be your working copy.
3056 You can use this as your personal translated help-file by placing it in
3058 \begin_inset Flex CharStyle:Code
3061 \begin_layout Plain Layout
3070 \begin_layout Itemize
3071 Sometimes the original document (from the LyX-team) will be updated.
3072 Use the source viewer at
3073 \begin_inset CommandInset href
3075 name "http://www.lyx.org/trac/timeline"
3076 target "http://www.lyx.org/trac/timeline"
3080 to see what has been changed.
3081 That way you can easily see which parts of the translated document need
3085 \begin_layout Standard
3086 If you ever find an error in the original document, fix it and notify the
3087 rest of the documentation team of the changes! (You didn't forget to join
3088 the documentation team, did you?)
3091 \begin_layout Standard
3092 \begin_inset Branch OutDated
3095 \begin_layout Section
3096 International Keyboard Support
3099 \begin_layout Standard
3102 [Editor's Note: The following section is by
3110 It needs to be fixed to conform to the new Documentation Style sheet and
3111 to make use of the new v1.0 features.
3112 The whole thing also needs to be merged with the section following it.-jw
3113 It may also be badly out of date.-rh (2008)]
3116 \begin_layout Subsection
3117 Defining Own Keymaps: Keymap File Format
3120 \begin_layout Standard
3121 Let's look at a keyboard definition file a little closer.
3122 It is a plain text file defining
3125 \begin_layout Itemize
3126 key-to-key or key-to-string translations
3129 \begin_layout Itemize
3133 \begin_layout Itemize
3134 dead keys exceptions
3137 \begin_layout Standard
3138 To define key-to-key or key-to-string translation, use this command:
3141 \begin_layout Quotation
3142 \begin_inset Flex CharStyle:Code
3145 \begin_layout Plain Layout
3154 \begin_inset Flex CharStyle:Code
3157 \begin_layout Plain Layout
3166 \begin_layout Standard
3168 \begin_inset Flex CharStyle:Code
3171 \begin_layout Plain Layout
3177 is the key to be translated and
3178 \begin_inset Flex CharStyle:Code
3181 \begin_layout Plain Layout
3187 is the string to be inserted into the document.
3188 To define dead keys, use:
3191 \begin_layout Quotation
3192 \begin_inset Flex CharStyle:Code
3195 \begin_layout Plain Layout
3204 \begin_inset Flex CharStyle:Code
3207 \begin_layout Plain Layout
3216 \begin_layout Standard
3218 \begin_inset Flex CharStyle:Code
3221 \begin_layout Plain Layout
3227 is a keyboard key and
3228 \begin_inset Flex CharStyle:Code
3231 \begin_layout Plain Layout
3238 The following dead keys are supported (shortcut name is in parentheses):
3241 \begin_layout Quotation
3245 \begin_inset space \hfill{}
3251 \begin_layout Quotation
3253 \begin_inset space \hfill{}
3259 \begin_layout Quotation
3261 \begin_inset space \hfill{}
3267 \begin_layout Quotation
3269 \begin_inset space \hfill{}
3275 \begin_layout Quotation
3277 \begin_inset space \hfill{}
3283 \begin_layout Quotation
3285 \begin_inset space \hfill{}
3292 \begin_layout Plain Layout
3304 \begin_layout Quotation
3306 \begin_inset space \hfill{}
3312 \begin_layout Quotation
3314 \begin_inset space \hfill{}
3321 \begin_layout Plain Layout
3333 \begin_layout Quotation
3335 \begin_inset space \hfill{}
3341 \begin_layout Quotation
3343 \begin_inset space \hfill{}
3349 \begin_layout Quotation
3351 \begin_inset space \hfill{}
3358 \begin_layout Plain Layout
3370 \begin_layout Quotation
3372 \begin_inset space \hfill{}
3379 \begin_layout Plain Layout
3391 \begin_layout Quotation
3393 \begin_inset space \hfill{}
3399 \begin_layout Quotation
3400 hungarian umlaut (hug)
3401 \begin_inset space \hfill{}
3407 \begin_layout Quotation
3409 \begin_inset space \hfill{}
3415 \begin_layout Quotation
3417 \begin_inset space \hfill{}
3424 \begin_layout Plain Layout
3436 \begin_layout Standard
3437 Since in many international keyboards there are exceptions to what some
3438 dead keys should do, you can define them using
3441 \begin_layout Quotation
3442 \begin_inset Flex CharStyle:Code
3445 \begin_layout Plain Layout
3453 deadkey key outstring
3456 \begin_layout Standard
3457 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3461 \begin_layout Quotation
3462 \begin_inset Flex CharStyle:Code
3465 \begin_layout Plain Layout
3478 \begin_layout Standard
3479 to make it work correctly.
3480 Also, you have to define as exceptions dead keys over i and j, to remove
3481 the dot from them before inserting an accent mark.
3482 I will change this when the time comes, but so far I haven't had time.
3485 \begin_layout Standard
3486 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3489 \begin_inset Flex CharStyle:Code
3492 \begin_layout Plain Layout
3498 have different meaning.
3500 \begin_inset Flex CharStyle:Code
3503 \begin_layout Plain Layout
3509 marks comments, quotes start and end LaTeX-style commands.
3510 To enter quote, you'll need to use
3511 \begin_inset Flex CharStyle:Code
3514 \begin_layout Plain Layout
3523 \begin_inset Flex CharStyle:Code
3526 \begin_layout Plain Layout
3533 \begin_inset Flex CharStyle:Code
3536 \begin_layout Plain Layout
3547 \begin_layout Standard
3548 If you make a keyboard description file that works for your language, please
3549 mail it to me, so I can include it in the next keymap distribution.
3552 \begin_layout Standard
3553 More keywords will be supported in keymap configuration file in future,
3557 \begin_layout Itemize
3558 \begin_inset Flex CharStyle:Code
3561 \begin_layout Plain Layout
3572 \begin_inset space \hfill{}
3576 \begin_inset Flex CharStyle:Code
3579 \begin_layout Plain Layout
3588 \begin_layout Itemize
3589 \begin_inset Flex CharStyle:Code
3592 \begin_layout Plain Layout
3603 \begin_inset space \hfill{}
3607 \begin_inset Flex CharStyle:Code
3610 \begin_layout Plain Layout
3616 an external keymap translation program
3619 \begin_layout Standard
3620 Also, it should look into
3621 \begin_inset Flex CharStyle:Code
3624 \begin_layout Plain Layout
3630 file for defaults, too (for example, a
3631 \begin_inset Flex CharStyle:Code
3634 \begin_layout Plain Layout
3642 option to include default keyboard).
3650 \begin_layout Section
3651 International Keymap Stuff
3652 \begin_inset CommandInset label
3654 name "sec:International-Keymap-Stuff"
3661 \begin_layout Standard
3662 \begin_inset Note Note
3665 \begin_layout Plain Layout
3666 In doing the revisions on this document in March 2008, I did not look over
3667 this stuff, as I do not understand it.
3668 It would be good if someone else could do so.
3677 \begin_layout Standard
3678 The next two sections describe the
3679 \begin_inset Flex CharStyle:Code
3682 \begin_layout Plain Layout
3691 \begin_inset Flex CharStyle:Code
3694 \begin_layout Plain Layout
3702 file syntax in detail.
3703 These sections should help you design your own key map if the ones provided
3704 do not meet your needs.
3707 \begin_layout Subsection
3711 \begin_layout Standard
3715 \begin_inset Flex CharStyle:Code
3718 \begin_layout Plain Layout
3724 file maps keystrokes to characters or strings.
3725 As the name suggests, it sets a keyboard mapping.
3727 \begin_inset Flex CharStyle:Code
3730 \begin_layout Plain Layout
3741 \begin_inset Flex CharStyle:Code
3744 \begin_layout Plain Layout
3759 \begin_inset Flex CharStyle:Code
3762 \begin_layout Plain Layout
3775 \begin_inset Flex CharStyle:Code
3778 \begin_layout Plain Layout
3787 \begin_inset Flex CharStyle:Code
3790 \begin_layout Plain Layout
3798 are described in this section.
3801 \begin_layout Labeling
3802 \labelwidthstring 00.00.0000
3803 \begin_inset Flex CharStyle:Code
3806 \begin_layout Plain Layout
3814 Map a character to a string
3817 \begin_layout LyX-Code
3832 \begin_layout Standard
3865 the double-quote (")
3882 must be escaped with a preceding backslash (
3893 \begin_layout Standard
3895 \begin_inset Flex CharStyle:MenuItem
3898 \begin_layout Plain Layout
3906 statement to cause the symbol
3907 \begin_inset Flex CharStyle:MenuItem
3910 \begin_layout Plain Layout
3918 to be output for the keystroke
3919 \begin_inset Flex CharStyle:MenuItem
3922 \begin_layout Plain Layout
3933 \begin_layout LyX-Code
3939 \begin_layout Labeling
3940 \labelwidthstring 00.00.0000
3941 \begin_inset Flex CharStyle:Code
3944 \begin_layout Plain Layout
3952 Specify an accent character
3955 \begin_layout LyX-Code
3964 \begin_layout Standard
3965 This will make the cha
4003 This is the dead key
4007 \begin_layout Plain Layout
4014 refers to a key that does not produce a character by itself, but when followed
4015 with another key, produces the desired accent character.
4016 For example, a German characte
4018 r with an umlaut like
4028 can be produced in this manner.
4037 \begin_layout Standard
4050 and then another key not in
4067 followed by the other, not allowed key, as output.
4071 \begin_inset Flex CharStyle:MenuItem
4074 \begin_layout Plain Layout
4082 cancels a dead key, so if
4093 \begin_inset Flex CharStyle:MenuItem
4096 \begin_layout Plain Layout
4105 , the cursor will not go one position backwards but will instead cancel
4121 might have had on the next keystroke.
4125 \begin_layout Standard
4126 The following example specifies that the character ' is to be an acute accent,
4127 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4130 \begin_layout LyX-Code
4133 kmod ' acute aeiouAEIOU
4136 \begin_layout Labeling
4137 \labelwidthstring 00.00.0000
4138 \begin_inset Flex CharStyle:Code
4141 \begin_layout Plain Layout
4147 Specify an exception to the accent character
4150 \begin_layout LyX-Code
4159 \begin_layout Standard
4160 This defines an exce
4201 have been assigned a keystroke with a previous
4204 \begin_inset Flex CharStyle:Code
4207 \begin_layout Plain Layout
4231 must not belong in the
4278 If such a declaration does not exist in
4286 \begin_inset Flex CharStyle:Code
4289 \begin_layout Plain Layout
4323 \begin_inset Flex CharStyle:Code
4326 \begin_layout Plain Layout
4340 \begin_layout Standard
4341 The following command produces causes äi to be produced when you enter acute-i
4345 \begin_layout LyX-Code
4359 \begin_layout Labeling
4360 \labelwidthstring 00.00.0000
4361 \begin_inset Flex CharStyle:Code
4364 \begin_layout Plain Layout
4370 Combine two accent characters
4373 \begin_layout LyX-Code
4379 accent1 accent2 allowed
4382 \begin_layout Standard
4383 This one is getting pretty esoteric.
4384 It allows you to combine the effect
4440 \begin_inset Flex CharStyle:Code
4443 \begin_layout Plain Layout
4471 \begin_layout Standard
4472 Consider this example from the
4473 \begin_inset Flex CharStyle:Code
4476 \begin_layout Plain Layout
4487 \begin_layout LyX-Code
4490 kmod ; acute aeioyvhAEIOYVH
4494 kcomb acute umlaut iyIY
4497 \begin_layout Standard
4498 This allows you to press
4499 \begin_inset Flex CharStyle:MenuItem
4502 \begin_layout Plain Layout
4510 and get the effect of
4511 \begin_inset Flex CharStyle:Code
4514 \begin_layout Plain Layout
4533 in this case cancels the last dead key, so if you press
4534 \begin_inset Flex CharStyle:MenuItem
4537 \begin_layout Plain Layout
4546 \begin_inset Flex CharStyle:Code
4549 \begin_layout Plain Layout
4562 \begin_layout Subsection
4566 \begin_layout Standard
4568 \begin_inset Flex CharStyle:Code
4571 \begin_layout Plain Layout
4579 mapping is performed, a
4580 \begin_inset Flex CharStyle:Code
4583 \begin_layout Plain Layout
4593 file maps the strings that the symbols generate to characters in the current
4595 The LyX distribution currently includes at least the
4596 \begin_inset Flex CharStyle:Code
4599 \begin_layout Plain Layout
4608 \begin_inset Flex CharStyle:Code
4611 \begin_layout Plain Layout
4622 \begin_layout Standard
4624 \begin_inset Flex CharStyle:Code
4627 \begin_layout Plain Layout
4635 file is a sequence of declarations of the form
4638 \begin_layout LyX-Code
4651 \begin_layout Standard
4652 For example, in order to map
4653 \begin_inset Flex CharStyle:MenuItem
4656 \begin_layout Plain Layout
4666 to the corresponding character in the iso-8859-1 set (233), the following
4670 \begin_layout LyX-Code
4678 \begin_layout Standard
4680 \begin_inset Flex CharStyle:Code
4683 \begin_layout Plain Layout
4692 \begin_inset Flex CharStyle:Code
4695 \begin_layout Plain Layout
4713 the same character can apply to more than one string.
4715 \begin_inset Flex CharStyle:Code
4718 \begin_layout Plain Layout
4729 \begin_layout LyX-Code
4741 \begin_inset Newline newline
4757 \begin_layout Standard
4758 If LyX cannot find a mapping for the string produced by the keystroke or
4759 a deadkey sequence, it will check if it looks like an accented char and
4760 try to draw an accent over the character on screen.
4763 \begin_layout Subsection
4767 \begin_layout Standard
4768 There is a second way to add support for international characters through
4769 so-called dead-keys.
4770 A dead-key works in combination with a letter to produce an accented character.
4771 Here, we'll explain how to create a really simple dead-key to illustrate
4775 \begin_layout Standard
4776 Suppose you happen to need the circumflex character,
4777 \begin_inset Quotes eld
4781 \begin_inset Quotes erd
4786 \begin_inset Flex CharStyle:MenuItem
4789 \begin_layout Plain Layout
4796 \begin_inset space ~
4800 \begin_inset Flex CharStyle:MenuItem
4803 \begin_layout Plain Layout
4809 ] to the LyX command
4810 \begin_inset Flex CharStyle:Code
4813 \begin_layout Plain Layout
4820 \begin_inset Flex CharStyle:Code
4823 \begin_layout Plain Layout
4830 Now, whenever you type the
4831 \begin_inset Flex CharStyle:MenuItem
4834 \begin_layout Plain Layout
4840 -key followed by a letter, that letter will have a circumflex accent on
4842 For example, the sequence
4843 \begin_inset Quotes eld
4847 \begin_inset Flex CharStyle:MenuItem
4850 \begin_layout Plain Layout
4857 \begin_inset Quotes erd
4860 produces the letter:
4861 \begin_inset Quotes eld
4865 \begin_inset Quotes erd
4869 If you tried to type
4870 \begin_inset Quotes eld
4874 \begin_inset Flex CharStyle:MenuItem
4877 \begin_layout Plain Layout
4884 \begin_inset Quotes erd
4887 , however, LyX will complain with a beep, since a
4888 \begin_inset Quotes eld
4892 \begin_inset Flex CharStyle:MenuItem
4895 \begin_layout Plain Layout
4902 \begin_inset Quotes erd
4905 never takes a circumflex accent.
4907 \begin_inset Flex CharStyle:MenuItem
4910 \begin_layout Plain Layout
4916 after a dead-key produces the bare-accent.
4917 Please note this last point! If you bind a key to a dead-key, you'll need
4918 to rebind the character on that key to yet another key.
4920 \begin_inset Flex CharStyle:MenuItem
4923 \begin_layout Plain Layout
4929 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4932 \begin_layout Standard
4933 One common way to bind dead-keys is to use
4934 \begin_inset Flex CharStyle:MenuItem
4937 \begin_layout Plain Layout
4944 \begin_inset Flex CharStyle:MenuItem
4947 \begin_layout Plain Layout
4954 \begin_inset Flex CharStyle:MenuItem
4957 \begin_layout Plain Layout
4963 in combination with an accent, like
4964 \begin_inset Quotes eld
4968 \begin_inset Flex CharStyle:MenuItem
4971 \begin_layout Plain Layout
4978 \begin_inset Quotes erd
4982 \begin_inset Quotes eld
4986 \begin_inset Flex CharStyle:MenuItem
4989 \begin_layout Plain Layout
4996 \begin_inset Quotes erd
5000 \begin_inset Quotes eld
5004 \begin_inset Flex CharStyle:MenuItem
5007 \begin_layout Plain Layout
5014 \begin_inset Quotes erd
5018 Another way involves using
5019 \begin_inset Flex CharStyle:Code
5022 \begin_layout Plain Layout
5029 \begin_inset Flex CharStyle:Code
5032 \begin_layout Plain Layout
5038 to set up the special
5039 \begin_inset Flex CharStyle:Code
5042 \begin_layout Plain Layout
5050 \begin_inset Flex CharStyle:Code
5053 \begin_layout Plain Layout
5059 acts in some ways just like
5060 \begin_inset Flex CharStyle:MenuItem
5063 \begin_layout Plain Layout
5069 and permits you to bind keys to accented characters.
5070 You can also turn keys into dead-keys by binding them to something like
5072 \begin_inset Flex CharStyle:Code
5075 \begin_layout Plain Layout
5081 and then binding this symbolic key to the corresponding LyX command.
5085 \begin_layout Plain Layout
5090 : This is exactly what I do in my
5091 \begin_inset Flex CharStyle:Code
5094 \begin_layout Plain Layout
5101 \begin_inset Flex CharStyle:Code
5104 \begin_layout Plain Layout
5112 \begin_inset Flex CharStyle:MenuItem
5115 \begin_layout Plain Layout
5117 \begin_inset space ~
5126 \begin_inset Flex CharStyle:Code
5129 \begin_layout Plain Layout
5135 and a bunch of these
5136 \begin_inset Quotes eld
5140 \begin_inset Flex CharStyle:Code
5143 \begin_layout Plain Layout
5150 \begin_inset Quotes erd
5153 symbolic keys bound such things as
5154 \begin_inset Flex CharStyle:MenuItem
5157 \begin_layout Plain Layout
5159 \begin_inset space ~
5168 \begin_inset Flex CharStyle:MenuItem
5171 \begin_layout Plain Layout
5173 \begin_inset space ~
5182 This is how I produce my accented characters.
5187 You can make just about anything into the
5188 \begin_inset Flex CharStyle:Code
5191 \begin_layout Plain Layout
5198 \begin_inset Flex CharStyle:MenuItem
5201 \begin_layout Plain Layout
5207 keys, a spare function key, etc.
5208 As for the LyX commands that produce accents, check the entry for
5209 \begin_inset Flex CharStyle:Code
5212 \begin_layout Plain Layout
5223 You'll find the complete list there.
5226 \begin_layout Subsection
5227 Saving your Language Configuration
5230 \begin_layout Standard
5231 You can edit your preferences so that your desired language environment
5232 is automatically configured when LyX starts up, via the
5233 \begin_inset Flex CharStyle:MenuItem
5236 \begin_layout Plain Layout
5237 Edit\SpecialChar \menuseparator
5246 \begin_layout Chapter
5247 Installing New Document Classes, Layouts, and Templates
5248 \begin_inset CommandInset label
5250 name "cha:Installing-New-Document"
5258 \begin_layout Plain Layout
5259 Installing New Document Classes
5267 \begin_layout Standard
5268 In this chapter, we describe the procedures for creating and installing
5269 new LyX layout and template files, as well as offer a refresher on correctly
5270 installing new LaTeX document classes.
5271 Some definitions: a document class is a LaTeX file (usually ending in
5272 \begin_inset Flex CharStyle:Code
5275 \begin_layout Plain Layout
5282 \begin_inset Flex CharStyle:Code
5285 \begin_layout Plain Layout
5291 ) that describes the format of a document such as an article, report, journal
5292 preprint, etc, and all the commands needed to realize that format.
5293 A layout file is a LyX file that corresponds to a LaTeX document class
5294 and that tells LyX how to
5295 \begin_inset Quotes eld
5299 \begin_inset Quotes erd
5302 things on the screen to make the display look something like the final
5304 More precisely, a layout file describes a
5305 \begin_inset Quotes eld
5309 \begin_inset Quotes erd
5312 which is the internal construct LyX uses to render the screen display.
5314 \begin_inset Quotes eld
5318 \begin_inset Quotes erd
5322 \begin_inset Quotes eld
5326 \begin_inset Quotes erd
5329 can be used somewhat interchangeably, but it is better to refer to the
5330 file as the layout, and the thing living in LyX's memory as the text class.
5331 A template file is simply a LyX document that contains a set of predefined
5332 entries for a given document class—entries that are generally required
5334 Templates are especially useful for things like journal manuscripts that
5335 are to be submitted electronically.
5338 \begin_layout Section
5339 Installing a new LaTeX package
5342 \begin_layout Standard
5343 Some installations may not include a LaTeX package that you would like to
5345 For example, you might need FoilTeX, a package for preparing slides or
5346 viewgraphs for overhead projectors.
5347 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5348 a user interface for that.
5349 For example on MiKTeX you start its program
5350 \begin_inset Quotes eld
5354 \begin_inset Quotes erd
5357 to get a list of available packages.
5358 To install one, right click on it or use the installing toolbar button.
5359 When the package you want to install is not in the list, but you have it
5361 \begin_inset Flex CharStyle:Code
5364 \begin_layout Plain Layout
5371 \begin_inset Flex CharStyle:Code
5374 \begin_layout Plain Layout
5380 -file, then copy these files to a subfolder of your LaTeX distribution,
5381 for example to the folder
5390 Then update the file name database of your LaTeX-distribution.
5391 For example on MiKTeX this is done by pressing the button
5394 \begin_inset space ~
5399 that you find in MiKTeX's
5400 \begin_inset Quotes eld
5404 \begin_inset Quotes erd
5408 In both cases you need afterwards to reconfigure LyX using the menu
5409 \begin_inset Flex CharStyle:MenuItem
5412 \begin_layout Plain Layout
5413 Tools\SpecialChar \menuseparator
5419 and then to restart LyX.
5422 \begin_layout Standard
5423 If your LaTeX distribution doesn't provide a user interface, then you can
5424 follow these steps by using a UNIX/Linux console.
5427 \begin_layout Enumerate
5428 Get the package from
5429 \begin_inset CommandInset href
5432 target "http://www.ctan.org/"
5439 \begin_layout Enumerate
5440 You can install this package in several different places.
5441 If you want it to be available for all users on your system, then you should
5442 install it in your `local' TeX tree; if you want (or need) it to be available
5443 just for you, then you can install it in your own `user' TeX tree.
5444 Where these should be created, if they do not already exist, depends upon
5445 the details of your system.
5446 To find out, look in the file
5447 \begin_inset Flex CharStyle:Code
5450 \begin_layout Plain Layout
5460 \begin_layout Plain Layout
5461 This usually lives in the directory
5462 \begin_inset Flex CharStyle:Code
5465 \begin_layout Plain Layout
5471 , though you can run
5472 \begin_inset Flex CharStyle:Code
5475 \begin_layout Plain Layout
5486 The location of the `local' TeX tree is defined by
5487 \begin_inset Flex CharStyle:Code
5490 \begin_layout Plain Layout
5496 ; this is usually somewhere like
5497 \begin_inset Flex CharStyle:Code
5500 \begin_layout Plain Layout
5501 /usr/local/share/texmf/
5507 The `user' TeX tree is defined by
5508 \begin_inset Flex CharStyle:Code
5511 \begin_layout Plain Layout
5518 \begin_inset Flex CharStyle:Code
5521 \begin_layout Plain Layout
5528 (If these variables are not predefined, you can define them.) You'll probably
5529 need root permissions to create or modify the `local' tree; but your `user'
5530 tree shouldn't have such limitations.
5533 \begin_layout Enumerate
5535 \begin_inset Flex CharStyle:Code
5538 \begin_layout Plain Layout
5545 \begin_inset Flex CharStyle:Code
5548 \begin_layout Plain Layout
5555 \begin_inset Flex CharStyle:Code
5558 \begin_layout Plain Layout
5565 \begin_inset space \thinspace{}
5569 \begin_inset Newline newline
5573 \begin_inset Flex CharStyle:Code
5576 \begin_layout Plain Layout
5577 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5583 \begin_inset Newline newline
5586 But, again, most of this will
5587 \begin_inset Quotes eld
5591 \begin_inset Quotes erd
5597 \begin_layout Enumerate
5602 \begin_layout Plain Layout
5603 We'll assume henceforth that you're defining `local' TeX tree.
5604 If you're defining a user tree, just adjust as necessary.
5610 You must follow the directory structure of your existing
5611 \begin_inset Flex CharStyle:Code
5614 \begin_layout Plain Layout
5620 directory, which will be found at
5621 \begin_inset Flex CharStyle:Code
5624 \begin_layout Plain Layout
5631 For example, latex packages should go under
5632 \begin_inset Flex CharStyle:Code
5635 \begin_layout Plain Layout
5636 $TEXMFLOCAL/tex/latex/
5644 \begin_layout Enumerate
5645 Install the package.
5646 For example, you would unpack the FoilTeX tarball and copy it to
5647 \begin_inset Flex CharStyle:Code
5650 \begin_layout Plain Layout
5651 $TEXMFLOCAL/tex/latex/foiltex
5658 \begin_inset Flex CharStyle:Code
5661 \begin_layout Plain Layout
5667 directory contains various files.
5670 \begin_layout Enumerate
5672 \begin_inset Flex CharStyle:Code
5675 \begin_layout Plain Layout
5683 \begin_inset Flex CharStyle:Code
5686 \begin_layout Plain Layout
5695 \begin_layout Standard
5696 Your package is now installed and available to LaTeX.
5697 To make it available to LyX, you need to create a Layout file, if one is
5698 not already available.
5699 (See the next section.) Once you have a layout file, you need only reconfigure
5701 \begin_inset Flex CharStyle:MenuItem
5704 \begin_layout Plain Layout
5705 Tools\SpecialChar \menuseparator
5711 ) and then restart LyX.
5712 You should then see your new package—for example
5713 \begin_inset Flex CharStyle:MenuItem
5716 \begin_layout Plain Layout
5723 \begin_inset Flex CharStyle:MenuItem
5726 \begin_layout Plain Layout
5727 Document\SpecialChar \menuseparator
5734 \begin_inset Flex CharStyle:MenuItem
5737 \begin_layout Plain Layout
5747 \begin_layout Section
5751 \begin_layout Standard
5752 This section describes how to write and install your own LyX layout files
5753 and walks through the
5754 \begin_inset Flex CharStyle:Code
5757 \begin_layout Plain Layout
5763 text class format as an example.
5765 \begin_inset Flex CharStyle:Code
5768 \begin_layout Plain Layout
5774 files describe what paragraph and character styles are available for a
5775 given document class and how LyX should display them.
5776 We try to provide a thorough description of the process here; however,
5777 there are so many different types of documents supported by LaTeX classes
5778 that we can't hope to cover every different possibility or problem you
5780 (The LyX users' list is frequented by people with lots of experience with
5781 layout design who are willing to share what they've learned.)
5784 \begin_layout Standard
5785 As you prepare to write a new layout, it is extremely helpful to look at
5786 the example layouts distributed with LyX.
5787 If you use a nice LaTeX document class that might be of interest for others,
5788 too, and have a nice corresponding LyX layout, feel free to contribute
5789 the stuff to us, so we may put it into the distribution.
5791 \begin_inset CommandInset href
5793 name "section on the LyX wiki"
5794 target "http://wiki.lyx.org/Layouts/Layouts"
5798 for this kind of material.
5801 \begin_layout Standard
5802 All the tags described in this chapter are case-insensitive; this means
5804 \begin_inset Flex CharStyle:Code
5807 \begin_layout Plain Layout
5814 \begin_inset Flex CharStyle:Code
5817 \begin_layout Plain Layout
5824 \begin_inset Flex CharStyle:Code
5827 \begin_layout Plain Layout
5833 are really the same command.
5834 The possible values are printed in brackets after the feature's name.
5835 The default value if a feature isn't specified inside a text class-description
5837 \begin_inset Flex CharStyle:Code
5840 \begin_layout Plain Layout
5849 If the argument has a data type like
5850 \begin_inset Quotes eld
5854 \begin_inset Quotes erd
5858 \begin_inset Quotes eld
5862 \begin_inset Quotes erd
5865 , the default is shown like this:
5866 \begin_inset Flex CharStyle:Code
5869 \begin_layout Plain Layout
5880 \begin_layout Subsection
5882 \begin_inset CommandInset label
5884 name "sub:Layout-modules"
5891 \begin_layout Standard
5892 Similar to layout files, and new with LyX 1.6, are layout
5897 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5898 some modules—such as the endnotes module—provide support for just such
5900 In a sense, layout modules are similar to included files—files like
5901 \begin_inset Flex CharStyle:Code
5904 \begin_layout Plain Layout
5910 —in that modules are not specific to a given document layout but may be
5911 used with many different layouts.
5912 The difference is that using a layout module does not require editing the
5914 Rather, modules are selected in the
5915 \begin_inset Flex CharStyle:MenuItem
5918 \begin_layout Plain Layout
5919 Document\SpecialChar \menuseparator
5928 \begin_layout Standard
5929 Building modules is the easiest way to get started with layout editing,
5930 since it can be as simple as adding a single new paragraph or flex inset.
5931 But modules may, in principle, contain anything a layout file can contain.
5934 \begin_layout Standard
5935 A module must begin with a line like the following:
5938 \begin_layout LyX-Code
5941 DeclareLyXModule[endnotes.sty]{Endnotes}
5944 \begin_layout Standard
5945 The mandatory argument, in curly brackets, is the name of the module, as
5947 \begin_inset Flex CharStyle:MenuItem
5950 \begin_layout Plain Layout
5951 Document\SpecialChar \menuseparator
5959 \change_inserted 1 1243500588
5963 \begin_layout Standard
5964 The argument in square brackets is optional: It declares any LaTeX packages
5965 on which the module depends.
5966 Please note that only packages about which LyX knows should be listed in
5967 the square brackets.
5971 \begin_layout Plain Layout
5972 The list of such packages is documented only in the source code.
5977 LyX will not check for arbitrary packages.
5979 \change_inserted 1 1243500694
5980 It is also possible to use the form
5981 \begin_inset Flex CharStyle:MenuItem
5984 \begin_layout Plain Layout
5986 \change_inserted 1 1243500706
5992 , which declares that the module can only be used when there exists a conversion
5993 chain between formats `from' and `to'.
5998 \begin_layout Standard
5999 The module declaration should then be followed by lines like the following:
6002 \begin_layout LyX-Code
6006 \begin_layout LyX-Code
6007 #Adds an endnote command, in addition to footnotes.
6011 \begin_layout LyX-Code
6012 #You will need to add
6014 theendnotes in TeX code where you
6017 \begin_layout LyX-Code
6018 #want the endnotes to appear.
6022 \begin_layout LyX-Code
6026 \begin_layout LyX-Code
6027 #Requires: somemodule | othermodule
6030 \begin_layout LyX-Code
6031 #Excludes: badmodule
6034 \begin_layout Standard
6035 The description is used in
6036 \begin_inset Flex CharStyle:MenuItem
6039 \begin_layout Plain Layout
6040 Document\SpecialChar \menuseparator
6046 to provide the user with information about what the module does.
6048 \begin_inset Flex CharStyle:Code
6051 \begin_layout Plain Layout
6057 line is used to identify other modules with which this one must be used;
6059 \begin_inset Flex CharStyle:Code
6062 \begin_layout Plain Layout
6068 line is used to identify modules with which this one may not be used.
6069 Both are optional, and, as shown, multiple modules should be separated
6070 with the pipe symbol: |.
6071 Note that the required modules are treated disjunctively:
6075 of the required modules must be used.
6080 excluded module may be used.
6081 Note that modules are identified here by their
6085 without the .module extension.
6087 \begin_inset Flex CharStyle:Code
6090 \begin_layout Plain Layout
6097 \begin_inset Flex CharStyle:Code
6100 \begin_layout Plain Layout
6109 \begin_layout Standard
6110 After creating a new module, you will need to reconfigure and then restart
6111 LyX for the module to appear in the menu.
6112 However, changes you make to the module will be seen immediately, if you
6114 \begin_inset Flex CharStyle:MenuItem
6117 \begin_layout Plain Layout
6118 Document\SpecialChar \menuseparator
6124 , highlight something, and then hit
6125 \begin_inset Quotes eld
6129 \begin_inset Quotes erd
6135 It is strongly recommended that you save your work before doing so
6140 it is strongly recommended that you not attempt to edit modules while simultaneo
6141 usly working on documents
6144 Though of course the developers strive to keep LyX stable in such situations,
6145 syntax errors and the like in your module file could cause strange behavior.
6148 \begin_layout Subsection
6149 Supporting new document classes
6152 \begin_layout Standard
6153 There are two situations you are likely to encounter when wanting to support
6154 a new LaTeX document class, involving LaTeX2e class (
6155 \begin_inset Flex CharStyle:Code
6158 \begin_layout Plain Layout
6165 \begin_inset Flex CharStyle:Code
6168 \begin_layout Plain Layout
6175 Supporting a style file is usually fairly easy.
6176 Supporting a new document class is a bit harder.
6179 \begin_layout Subsection
6181 \begin_inset Flex CharStyle:MenuItem
6184 \begin_layout Plain Layout
6193 \begin_layout Standard
6194 If your new document class is provided as a style file that is used in conjuncti
6195 on with an existing, supported document class—for the sake of the example,
6196 we'll assume that the style file is called
6197 \begin_inset Flex CharStyle:MenuItem
6200 \begin_layout Plain Layout
6206 and it is meant to be used with
6207 \begin_inset Flex CharStyle:MenuItem
6210 \begin_layout Plain Layout
6216 , which is a standard class—start by copying the existing class's layout
6217 file into your local directory:
6220 \begin_layout LyX-Code
6221 cp report.layout ~/.lyx/layouts/myclass.layout
6224 \begin_layout Standard
6226 \begin_inset Flex CharStyle:Code
6229 \begin_layout Plain Layout
6235 and change the line:
6238 \begin_layout LyX-Code
6241 DeclareLaTeXClass{report}
6244 \begin_layout Standard
6248 \begin_layout LyX-Code
6251 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6254 \begin_layout Standard
6258 \begin_layout LyX-Code
6260 \begin_inset Newline newline
6266 \begin_inset Newline newline
6272 \begin_layout Standard
6273 near the top of the file.
6276 \begin_layout Standard
6277 Start LyX and select
6278 \begin_inset Flex CharStyle:MenuItem
6281 \begin_layout Plain Layout
6282 Tools\SpecialChar \menuseparator
6289 Then restart LyX and try creating a new document.
6291 \begin_inset Flex CharStyle:MenuItem
6294 \begin_layout Plain Layout
6300 " as a document class option in the
6301 \begin_inset Flex CharStyle:MenuItem
6304 \begin_layout Plain Layout
6305 Document\SpecialChar \menuseparator
6312 It is likely that some of the sectioning commands and such in your new
6313 class will work differently from how they worked in the base class—
6314 \begin_inset Flex CharStyle:Code
6317 \begin_layout Plain Layout
6323 in this example—so you can fiddle around with the settings for the different
6324 sections if you wish.
6327 \begin_layout Subsection
6329 \begin_inset Flex CharStyle:MenuItem
6332 \begin_layout Plain Layout
6341 \begin_layout Standard
6342 There are two possibilities here.
6343 One is that the class file is itself based upon an existing document class.
6344 For example, many thesis classes are based upon
6345 \begin_inset Flex CharStyle:MenuItem
6348 \begin_layout Plain Layout
6355 To see whether yours is, look for a line like
6358 \begin_layout LyX-Code
6364 \begin_layout Standard
6366 If so, then you may proceed largely as in the previous section, though
6367 the DeclareLaTeXClass line will be different.
6368 If your new class is thesis, and it is based upon book, then the line should
6373 \begin_layout Plain Layout
6374 And it will be easiest if you save the file to
6375 \begin_inset Flex CharStyle:Code
6378 \begin_layout Plain Layout
6384 : LyX assumes that the document class has the same name as the layout file.
6393 \begin_layout LyX-Code
6396 DeclareLaTeXClass[thesis,book]{thesis}
6399 \begin_layout Standard
6400 If, on the other hand, the new class is not based upon an existing class,
6401 you will probably have to
6402 \begin_inset Quotes eld
6406 \begin_inset Quotes erd
6410 We strongly suggest copying an existing layout file which uses a similar
6411 LaTeX class and then modifying it, if you can do so.
6412 At least use an existing file as a starting point so you can find out what
6413 items you need to worry about.
6414 Again, the specifics are covered below.
6417 \begin_layout Section
6418 Declaring a new text class
6421 \begin_layout Standard
6422 When it's finally time to get your hands dirty and create or edit your own
6423 layout file, the following sections describe what you're up against.
6424 Our advice is to go slowly, save and test often, listen to soothing music,
6425 and enjoy one or two of your favorite adult beverages; more if you are
6426 getting particularly stuck.
6427 It's really not that hard, except that the multitude of options can become
6428 overwhelming if you try to do to much in one sitting.
6429 Go have another adult beverage, just for good measure.
6432 \begin_layout Standard
6436 \begin_layout Standard
6437 Lines in a layout file which begin with a
6438 \begin_inset Flex CharStyle:Code
6441 \begin_layout Plain Layout
6448 There is one exception to this rule: all layouts should begin with lines
6452 \begin_layout LyX-Code
6455 #% Do not delete the line below; configure depends on this
6458 \begin_layout LyX-Code
6463 DeclareLaTeXClass{article}
6466 \begin_layout Standard
6467 The second line is used when you configure LyX.
6468 The layout file is read by the LaTeX script
6469 \begin_inset Flex CharStyle:Code
6472 \begin_layout Plain Layout
6478 , in a special mode where
6479 \begin_inset Flex CharStyle:Code
6482 \begin_layout Plain Layout
6489 The first line is just a LaTeX comment, and the second one contains the
6490 declaration of the text class.
6491 If these lines appear in a file named
6492 \begin_inset Flex CharStyle:Code
6495 \begin_layout Plain Layout
6501 , then they define a text class of name
6502 \begin_inset Flex CharStyle:Code
6505 \begin_layout Plain Layout
6511 (the name of the layout file) which uses the LaTeX document class
6512 \begin_inset Flex CharStyle:Code
6515 \begin_layout Plain Layout
6521 (the default is to use the same name as the layout).
6523 \begin_inset Quotes eld
6527 \begin_inset Quotes erd
6530 that appears above is used as a description of the text class in the
6531 \begin_inset Flex CharStyle:MenuItem
6534 \begin_layout Plain Layout
6535 Document\SpecialChar \menuseparator
6544 \begin_layout Standard
6545 Let's assume that you wrote your own text class that uses the
6546 \begin_inset Flex CharStyle:Code
6549 \begin_layout Plain Layout
6555 document class, but where you changed the appearance of the section headings.
6556 If you put it in a file
6557 \begin_inset Flex CharStyle:Code
6560 \begin_layout Plain Layout
6566 , the header of this file should be:
6569 \begin_layout LyX-Code
6572 #% Do not delete the line below; configure depends on this
6575 \begin_layout LyX-Code
6580 DeclareLaTeXClass[article]{article (with my own headings)}
6583 \begin_layout Standard
6584 This declares a text class
6585 \begin_inset Flex CharStyle:Code
6588 \begin_layout Plain Layout
6594 , associated with the LaTeX document class
6595 \begin_inset Flex CharStyle:Code
6598 \begin_layout Plain Layout
6605 \begin_inset Quotes eld
6608 article (with my own headings)
6609 \begin_inset Quotes erd
6613 If your text class depends on several packages, you can declare it as:
6616 \begin_layout LyX-Code
6619 #% Do not delete the line below; configure depends on this
6622 \begin_layout LyX-Code
6627 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6630 \begin_layout Standard
6631 This indicates that your text class uses the foo.sty package.
6632 Finally, it is also possible to declare classes for DocBook code.
6633 Typical declarations will look like
6636 \begin_layout LyX-Code
6639 #% Do not delete the line below; configure depends on this
6642 \begin_layout LyX-Code
6647 DeclareDocBookClass[article]{SGML (DocBook article)}
6650 \begin_layout Standard
6651 Note that these declarations can also be given an optional parameter declaring
6652 the name of the document class (but not a list).
6655 \begin_layout Standard
6656 So, to be as explicit as possible, the form of the layout declaration is:
6659 \begin_layout LyX-Code
6664 DeclareLaTeXClass[class,package.sty]{layout description}
6667 \begin_layout Standard
6668 The class need only be specified if the name of the LaTeX class file and
6669 the name of the layout file are different; if the name of the class file
6670 is not specified, then LyX will simply assume that it is the same as the
6671 name of the layout file.
6674 \begin_layout Standard
6675 When the text class has been modified to your taste, all you have to do
6676 is to copy it either to
6677 \begin_inset Flex CharStyle:Code
6680 \begin_layout Plain Layout
6687 \begin_inset Flex CharStyle:Code
6690 \begin_layout Plain Layout
6697 \begin_inset Flex CharStyle:MenuItem
6700 \begin_layout Plain Layout
6701 Tools\SpecialChar \menuseparator
6707 , exit LyX and restart it.
6708 Then your new text class should be available along with the others.
6711 \begin_layout Standard
6712 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6713 you made to your layout files.
6714 As a result, editing layout files could be very time consuming.
6715 Beginning with 1.6, however, you can force a reload of the layout currently
6716 in use by using the LyX function
6717 \begin_inset Flex CharStyle:MenuItem
6720 \begin_layout Plain Layout
6727 There is no default binding for this function—though, of course, you can
6728 bind it to a key yourself.
6729 If you want to use this function, then, you should simply enter it in the
6735 : This is very much an `advanced feature'.
6740 recommended that you save your work before using this function.
6745 recommended that you not attempt to edit your layout while simultaneously
6746 working on a document that you care about.
6747 Use a test document.
6748 Syntax errors and the like in your layout file could cause peculiar behavior.
6749 In particular, such errors could cause LyX to regard the current layout
6750 as invalid and to attempt to switch to some other layout.
6751 The LyX team strives to keep LyX stable in such situations, but safe is
6755 \begin_layout Subsection
6759 \begin_layout Standard
6760 The first non-comment line must contain the file format number:
6763 \begin_layout Description
6764 \begin_inset Flex CharStyle:Code
6767 \begin_layout Plain Layout
6774 \begin_inset Flex CharStyle:Code
6777 \begin_layout Plain Layout
6783 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6784 don't have an explicit file format).
6785 The file format that is documented here is format 14.
6788 \begin_layout Subsection
6789 General text class parameters
6792 \begin_layout Standard
6793 These are the general parameters which describe the form of the entire document:
6796 \begin_layout Description
6797 \begin_inset Flex CharStyle:Code
6800 \begin_layout Plain Layout
6806 Adds information to the document preamble.
6808 \begin_inset Quotes eld
6812 \begin_inset Flex CharStyle:Code
6815 \begin_layout Plain Layout
6822 \begin_inset Quotes erd
6828 \begin_layout Description
6829 \begin_inset Flex CharStyle:Code
6832 \begin_layout Plain Layout
6838 Describes various global options supported by the document class.
6840 \begin_inset space ~
6844 \begin_inset CommandInset ref
6846 reference "sub:ClassOptions"
6852 \begin_inset Quotes eld
6856 \begin_inset Flex CharStyle:Code
6859 \begin_layout Plain Layout
6866 \begin_inset Quotes erd
6872 \begin_layout Description
6873 \begin_inset Flex CharStyle:Code
6876 \begin_layout Plain Layout
6883 \begin_inset Flex CharStyle:Code
6886 \begin_layout Plain Layout
6895 \begin_inset Flex CharStyle:Code
6898 \begin_layout Plain Layout
6904 ] Whether the class should default to having one or two columns.
6905 Can be changed in the
6906 \begin_inset Flex CharStyle:MenuItem
6909 \begin_layout Plain Layout
6910 Document\SpecialChar \menuseparator
6919 \begin_layout Description
6920 \begin_inset Flex CharStyle:Code
6923 \begin_layout Plain Layout
6929 This sequence defines a new counter.
6931 \begin_inset space ~
6935 \begin_inset CommandInset ref
6937 reference "sub:Counters"
6943 \begin_inset Quotes eld
6947 \begin_inset Flex CharStyle:Code
6950 \begin_layout Plain Layout
6957 \begin_inset Quotes erd
6963 \begin_layout Description
6964 \begin_inset Flex CharStyle:Code
6967 \begin_layout Plain Layout
6973 Sets the default font used to display the document.
6975 \begin_inset space ~
6979 \begin_inset CommandInset ref
6981 reference "sub:Font-description"
6985 for how to declare fonts.
6987 \begin_inset Quotes eld
6991 \begin_inset Flex CharStyle:Code
6994 \begin_layout Plain Layout
7001 \begin_inset Quotes erd
7007 \begin_layout Description
7008 \begin_inset Flex CharStyle:Code
7011 \begin_layout Plain Layout
7018 \begin_inset Flex CharStyle:Code
7021 \begin_layout Plain Layout
7027 Specifies a module to be included by default with this document class,
7028 which should be specified by filename without the
7029 \begin_inset Flex CharStyle:Code
7032 \begin_layout Plain Layout
7039 The user can still remove the module, but it will be active at the outset.
7040 (This applies only when new files are created, or when this class is chosen
7041 for an existing document.)
7044 \begin_layout Description
7045 \begin_inset Flex CharStyle:Code
7048 \begin_layout Plain Layout
7055 \begin_inset Flex CharStyle:Code
7058 \begin_layout Plain Layout
7064 ] This is the style that will be assigned to new paragraphs, usually
7065 \begin_inset Flex CharStyle:MenuItem
7068 \begin_layout Plain Layout
7075 This will default to the first defined style if not given, but you are
7076 highly encouraged to use this directive.
7079 \begin_layout Description
7080 \begin_inset Flex CharStyle:Code
7083 \begin_layout Plain Layout
7090 \begin_inset Flex CharStyle:Code
7093 \begin_layout Plain Layout
7099 ] Indicates that the module in question—which should be specified by filename
7101 \begin_inset Flex CharStyle:Code
7104 \begin_layout Plain Layout
7110 extension—cannot be used with this document class.
7111 This might be used in a journal-specific layout file to prevent, say, the
7113 \begin_inset Flex CharStyle:Code
7116 \begin_layout Plain Layout
7122 module that numbers theorems by section.
7127 be used in a module.
7128 Modules have their own way of excluding other modules (see
7129 \begin_inset CommandInset ref
7131 reference "sub:Layout-modules"
7138 \begin_layout Description
7139 \begin_inset Flex CharStyle:Code
7142 \begin_layout Plain Layout
7148 Defines a new float.
7150 \begin_inset space ~
7154 \begin_inset CommandInset ref
7156 reference "sub:Floats"
7162 \begin_inset Quotes eld
7166 \begin_inset Flex CharStyle:Code
7169 \begin_layout Plain Layout
7176 \begin_inset Quotes erd
7182 \begin_layout Description
7183 \begin_inset Flex CharStyle:Code
7186 \begin_layout Plain Layout
7192 As its name implies, this command allows you to include another layout
7193 definition file within yours to avoid duplicating commands.
7194 Common examples are the standard layout files, for example,
7195 \begin_inset Flex CharStyle:Code
7198 \begin_layout Plain Layout
7204 , which contains most of the basic layouts.
7207 \begin_layout Description
7208 \begin_inset Flex CharStyle:Code
7211 \begin_layout Plain Layout
7217 This section (re-)defines the layout of an inset.
7218 It can be applied to an existing inset of to a new, user-defined inset,
7220 \begin_inset space \thinspace{}
7224 \begin_inset space \space{}
7227 a new character style.
7229 \begin_inset space ~
7233 \begin_inset CommandInset ref
7235 reference "sub:Flex-insets-and"
7239 for more information.
7241 \begin_inset Quotes eld
7245 \begin_inset Flex CharStyle:Code
7248 \begin_layout Plain Layout
7255 \begin_inset Quotes erd
7261 \begin_layout Description
7262 \begin_inset Flex CharStyle:Code
7265 \begin_layout Plain Layout
7271 A string that indicates the width of the left margin on the screen, for
7273 \begin_inset Quotes eld
7277 \begin_inset Quotes erd
7283 \begin_layout Description
7284 \begin_inset Flex CharStyle:Code
7287 \begin_layout Plain Layout
7293 This command deletes an existing float.
7294 This is particularly useful when you want to suppress a float that has
7295 be defined in an input file.
7298 \begin_layout Description
7299 \begin_inset Flex CharStyle:Code
7302 \begin_layout Plain Layout
7308 This command deletes an existing style.
7309 This is particularly useful when you want to suppress a style that has
7310 be defined in an input file.
7313 \begin_layout Description
7314 \begin_inset Flex CharStyle:Code
7317 \begin_layout Plain Layout
7323 A string indicating what sort of output documents using this class will
7325 At present, the options are: `docbook', `latex', and `literate'.
7326 \change_inserted 1 1243500198
7330 \begin_layout Description
7332 \change_inserted 1 1243500505
7333 \begin_inset Flex CharStyle:Code
7336 \begin_layout Plain Layout
7338 \change_inserted 1 1243500208
7344 A string indicating the file format (as defined in the Preferences dialog)
7345 produced by this class.
7346 It is mainly useful when
7347 \begin_inset Flex CharStyle:Code
7350 \begin_layout Plain Layout
7352 \change_inserted 1 1243500394
7358 is `literate' and one wants to define a new type of literate document.
7359 This string is reset to `docbook', `latex', or `literate' when the correspondin
7361 \begin_inset Flex CharStyle:Code
7364 \begin_layout Plain Layout
7366 \change_inserted 1 1243500473
7372 parameter is encountered.
7377 \begin_layout Description
7378 \begin_inset Flex CharStyle:Code
7381 \begin_layout Plain Layout
7392 \begin_inset Flex CharStyle:Code
7395 \begin_layout Plain Layout
7406 \begin_inset Flex CharStyle:Code
7409 \begin_layout Plain Layout
7416 \begin_inset Flex CharStyle:Code
7419 \begin_layout Plain Layout
7425 ] The class default pagestyle.
7426 Can be changed in the
7427 \begin_inset Flex CharStyle:MenuItem
7430 \begin_layout Plain Layout
7431 Document\SpecialChar \menuseparator
7440 \begin_layout Description
7441 \begin_inset Flex CharStyle:Code
7444 \begin_layout Plain Layout
7450 Sets the preamble for the LaTeX document.
7451 Note that this will completely override any prior
7452 \begin_inset Flex CharStyle:Code
7455 \begin_layout Plain Layout
7462 \begin_inset Flex CharStyle:Code
7465 \begin_layout Plain Layout
7473 \begin_inset Quotes eld
7477 \begin_inset Flex CharStyle:Code
7480 \begin_layout Plain Layout
7487 \begin_inset Quotes erd
7493 \begin_layout Description
7494 \begin_inset Flex CharStyle:Code
7497 \begin_layout Plain Layout
7504 \begin_inset Flex CharStyle:Code
7507 \begin_layout Plain Layout
7514 \begin_inset Flex CharStyle:Code
7517 \begin_layout Plain Layout
7526 \begin_inset Flex CharStyle:Code
7529 \begin_layout Plain Layout
7535 ] Whether the class already provides the feature
7536 \begin_inset Flex CharStyle:Code
7539 \begin_layout Plain Layout
7546 A feature is in general the name of a package (
7547 \begin_inset Flex CharStyle:Code
7550 \begin_layout Plain Layout
7557 \begin_inset Flex CharStyle:Code
7560 \begin_layout Plain Layout
7566 , \SpecialChar \ldots{}
7568 \begin_inset Flex CharStyle:Code
7571 \begin_layout Plain Layout
7578 \begin_inset Flex CharStyle:Code
7581 \begin_layout Plain Layout
7587 ,\SpecialChar \ldots{}
7588 ); the complete list of supported features is unfortunately not documented
7589 outside the LyX source code—but see
7590 \begin_inset Flex CharStyle:Code
7593 \begin_layout Plain Layout
7599 if you're interested.
7601 \begin_inset Flex CharStyle:MenuItem
7604 \begin_layout Plain Layout
7605 Help\SpecialChar \menuseparator
7611 also gives an overview of the supported packages.
7614 \begin_layout Description
7615 \begin_inset Flex CharStyle:Code
7618 \begin_layout Plain Layout
7625 \begin_inset Flex CharStyle:Code
7628 \begin_layout Plain Layout
7634 ] Indicates that this layout provides the functionality of the module mentioned,
7635 which should be specified by the filename without the
7636 \begin_inset Flex CharStyle:Code
7639 \begin_layout Plain Layout
7646 This will typically be used if the layout includes the module directly,
7647 rather than using the
7648 \begin_inset Flex CharStyle:Code
7651 \begin_layout Plain Layout
7657 tag to indicate that it ought to be used.
7658 It could be used in a module that provided an alternate implementation
7659 of the same functionality.
7662 \begin_layout Description
7663 \begin_inset Flex CharStyle:Code
7666 \begin_layout Plain Layout
7673 \begin_inset Flex CharStyle:Code
7676 \begin_layout Plain Layout
7682 ] Whether the class requires the feature
7683 \begin_inset Flex CharStyle:Code
7686 \begin_layout Plain Layout
7693 Multiple features must be separated by commas.
7694 Note that you can only request supported features.
7697 \begin_layout Description
7698 \begin_inset Flex CharStyle:Code
7701 \begin_layout Plain Layout
7707 A string that indicates the width of the right margin on the screen, for
7709 \begin_inset Quotes eld
7713 \begin_inset Quotes erd
7719 \begin_layout Description
7720 \begin_inset Flex CharStyle:Code
7723 \begin_layout Plain Layout
7729 Sets which divisions get numbered.
7731 \begin_inset Flex CharStyle:Code
7734 \begin_layout Plain Layout
7743 \begin_layout Description
7744 \begin_inset Flex CharStyle:Code
7747 \begin_layout Plain Layout
7756 \begin_inset Flex CharStyle:Code
7759 \begin_layout Plain Layout
7770 \begin_inset Flex CharStyle:Code
7773 \begin_layout Plain Layout
7779 ] Whether the class-default should be printing on one or both sides of the
7781 Can be changed in the
7782 \begin_inset Flex CharStyle:MenuItem
7785 \begin_layout Plain Layout
7786 Document\SpecialChar \menuseparator
7795 \begin_layout Description
7796 \begin_inset Flex CharStyle:Code
7799 \begin_layout Plain Layout
7805 This sequence defines a new paragraph style.
7806 If the style already exists, it will redefine some of its parameters instead.
7808 \begin_inset space ~
7812 \begin_inset CommandInset ref
7814 reference "sub:Paragraph-Styles"
7820 \begin_inset Quotes eld
7824 \begin_inset Flex CharStyle:Code
7827 \begin_layout Plain Layout
7834 \begin_inset Quotes erd
7840 \begin_layout Description
7841 \begin_inset Flex CharStyle:Code
7844 \begin_layout Plain Layout
7851 \begin_inset Flex CharStyle:Code
7854 \begin_layout Plain Layout
7860 ] The name of the command or environment to be used with
7861 \begin_inset Flex CharStyle:Code
7864 \begin_layout Plain Layout
7873 \begin_layout Description
7874 \begin_inset Flex CharStyle:Code
7877 \begin_layout Plain Layout
7884 \begin_inset Flex CharStyle:Code
7887 \begin_layout Plain Layout
7896 \begin_inset Flex CharStyle:Code
7899 \begin_layout Plain Layout
7905 ] Indicates what kind of markup is used to define the title of a document.
7907 \begin_inset Flex CharStyle:Code
7910 \begin_layout Plain Layout
7916 means that the macro with name
7917 \begin_inset Flex CharStyle:Code
7920 \begin_layout Plain Layout
7926 will be inserted after the last layout which has
7927 \begin_inset Quotes eld
7931 \begin_inset Flex CharStyle:Code
7934 \begin_layout Plain Layout
7941 \begin_inset Quotes erd
7946 \begin_inset Flex CharStyle:Code
7949 \begin_layout Plain Layout
7955 corresponds to the case where the block of paragraphs which have
7956 \begin_inset Quotes eld
7960 \begin_inset Flex CharStyle:Code
7963 \begin_layout Plain Layout
7970 \begin_inset Quotes erd
7973 should be enclosed into the
7974 \begin_inset Flex CharStyle:Code
7977 \begin_layout Plain Layout
7986 \begin_layout Description
7987 \begin_inset Flex CharStyle:Code
7990 \begin_layout Plain Layout
7996 Sets which divisions are included in the table of contents.
7998 \begin_inset Flex CharStyle:Code
8001 \begin_layout Plain Layout
8010 \begin_layout Subsection
8011 \begin_inset Flex CharStyle:Code
8014 \begin_layout Plain Layout
8021 \begin_inset CommandInset label
8023 name "sub:ClassOptions"
8030 \begin_layout Standard
8032 \begin_inset Flex CharStyle:Code
8035 \begin_layout Plain Layout
8041 section can contain the following entries:
8044 \begin_layout Description
8045 \begin_inset Flex CharStyle:Code
8048 \begin_layout Plain Layout
8055 \begin_inset Flex CharStyle:Code
8058 \begin_layout Plain Layout
8064 ] The list of available font sizes for the document's main font, separated
8066 \begin_inset Quotes eld
8070 \begin_inset Flex CharStyle:Code
8073 \begin_layout Plain Layout
8080 \begin_inset Quotes erd
8086 \begin_layout Description
8087 \begin_inset Flex CharStyle:Code
8090 \begin_layout Plain Layout
8096 Used to set the DTD line with XML-based output classes.
8098 \begin_inset space \thinspace{}
8102 \begin_inset Quotes eld
8105 -//OASIS//DTD DocBook V4.2//EN
8106 \begin_inset Quotes erd
8112 \begin_layout Description
8113 \begin_inset Flex CharStyle:Code
8116 \begin_layout Plain Layout
8123 \begin_inset Flex CharStyle:Code
8126 \begin_layout Plain Layout
8127 string="empty|plain|headings|fancy"
8132 ] The list of available page styles, separated by
8133 \begin_inset Quotes eld
8137 \begin_inset Flex CharStyle:Code
8140 \begin_layout Plain Layout
8147 \begin_inset Quotes erd
8153 \begin_layout Description
8154 \begin_inset Flex CharStyle:Code
8157 \begin_layout Plain Layout
8164 \begin_inset Flex CharStyle:Code
8167 \begin_layout Plain Layout
8173 ] Some document class options, separated by a comma, that will be added
8174 to the optional part of the
8175 \begin_inset Flex CharStyle:Code
8178 \begin_layout Plain Layout
8189 \begin_layout Standard
8191 \begin_inset Flex CharStyle:Code
8194 \begin_layout Plain Layout
8200 section must end with
8201 \begin_inset Quotes eld
8205 \begin_inset Flex CharStyle:Code
8208 \begin_layout Plain Layout
8215 \begin_inset Quotes erd
8221 \begin_layout Subsection
8223 \begin_inset CommandInset label
8225 name "sub:Paragraph-Styles"
8232 \begin_layout Standard
8233 A paragraph style description looks like this:
8237 \begin_layout Plain Layout
8238 Note that this will either define a new layout or modify an existing one.
8246 \begin_layout LyX-Code
8253 \begin_layout LyX-Code
8257 \begin_layout LyX-Code
8261 \begin_layout Standard
8262 where the following commands are allowed:
8265 \begin_layout Description
8266 \begin_inset Flex CharStyle:Code
8269 \begin_layout Plain Layout
8276 \begin_inset Flex CharStyle:Code
8279 \begin_layout Plain Layout
8284 , left, right, center
8289 ] Paragraph alignment.
8292 \begin_layout Description
8293 \begin_inset Flex CharStyle:Code
8296 \begin_layout Plain Layout
8303 \begin_inset Flex CharStyle:Code
8306 \begin_layout Plain Layout
8311 , left, right, center
8316 ] A comma separated list of permitted alignments.
8317 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8319 For example a right-aligned or centered enumeration isn't possible.)
8322 \begin_layout Description
8323 \begin_inset Flex CharStyle:Code
8326 \begin_layout Plain Layout
8332 Language dependent information to be included in the LaTeX preamble when
8334 Note that this will completely override any prior
8335 \begin_inset Flex CharStyle:Code
8338 \begin_layout Plain Layout
8346 \begin_inset Quotes eld
8350 \begin_inset Flex CharStyle:Code
8353 \begin_layout Plain Layout
8360 \begin_inset Quotes erd
8364 The contents of this tag will occur once in the LaTeX preamble for each
8365 language used by the document.
8366 Each time, the following substitutions are made:
8370 \begin_layout Itemize
8371 \begin_inset Flex CharStyle:Code
8374 \begin_layout Plain Layout
8380 is replaced by the language name (as used by the babel package).
8383 \begin_layout Itemize
8385 \begin_inset Quotes eld
8389 \begin_inset Quotes erd
8393 \begin_inset Flex CharStyle:Code
8396 \begin_layout Plain Layout
8402 replaces its argument by the translation of the argument to the current
8406 \begin_layout Standard
8407 This preamble snippet will only be used if the document contains more than
8408 one language and the babel package is used.
8412 \begin_layout Description
8413 \begin_inset Flex CharStyle:Code
8416 \begin_layout Plain Layout
8423 \begin_inset Flex CharStyle:Code
8426 \begin_layout Plain Layout
8436 \begin_layout Plain Layout
8437 Note that a `float' here is a real number, such as: 1.5.
8442 The vertical space with which the last of a chain of paragraphs with this
8443 layout is separated from the following paragraph.
8444 If the next paragraph has another layout, the separations are not simply
8445 added, but the maximum is taken.
8448 \begin_layout Description
8449 \begin_inset Flex CharStyle:Code
8452 \begin_layout Plain Layout
8459 \begin_inset Flex CharStyle:Code
8462 \begin_layout Plain Layout
8468 The category for this style.
8469 This is used to group related styles in the Layout combobox on the toolbar.
8470 Any string can be used, but you may want to use existing categories with
8475 \begin_layout Description
8476 \begin_inset Flex CharStyle:Code
8479 \begin_layout Plain Layout
8485 Depth of XML command.
8486 Used only with XML-type formats.
8489 \begin_layout Description
8490 \begin_inset Flex CharStyle:Code
8493 \begin_layout Plain Layout
8500 \begin_inset CommandInset label
8502 name "des:CopyStyle"
8507 \begin_inset Flex CharStyle:Code
8510 \begin_layout Plain Layout
8516 Copies all the features of an existing style into the current one.
8520 \begin_layout Description
8521 \begin_inset Flex CharStyle:Code
8524 \begin_layout Plain Layout
8530 The name of a style whose preamble should be output
8535 This allows to ensure some ordering of the preamble snippets when macros
8536 definitions depend on one another.
8540 \begin_layout Plain Layout
8541 Note that, besides that functionality, there is no way to ensure any ordering
8543 The ordering that you see in a given version of LyX may change without
8544 warning in later versions.
8552 \begin_layout Description
8553 \begin_inset Flex CharStyle:Code
8556 \begin_layout Plain Layout
8563 \begin_inset Flex CharStyle:Code
8566 \begin_layout Plain Layout
8571 , Box, Filled_Box, Static
8576 ] The type of label that stands at the end of the paragraph (or sequence
8578 \begin_inset Flex CharStyle:Code
8581 \begin_layout Plain Layout
8588 \begin_inset Flex CharStyle:Code
8591 \begin_layout Plain Layout
8598 \begin_inset Flex CharStyle:Code
8601 \begin_layout Plain Layout
8608 \begin_inset Flex CharStyle:Code
8611 \begin_layout Plain Layout
8619 \begin_inset Flex CharStyle:Code
8622 \begin_layout Plain Layout
8629 \begin_inset Quotes eld
8633 \begin_inset Quotes erd
8637 \begin_inset Flex CharStyle:Code
8640 \begin_layout Plain Layout
8647 \begin_inset Flex CharStyle:Code
8650 \begin_layout Plain Layout
8651 \begin_inset space ~
8660 \begin_inset space ~
8663 black) square suitable for end of proof markers,
8664 \begin_inset Flex CharStyle:Code
8667 \begin_layout Plain Layout
8673 is an explicit text string.
8676 \begin_layout Description
8677 \begin_inset Flex CharStyle:Code
8680 \begin_layout Plain Layout
8687 \begin_inset Flex CharStyle:Code
8690 \begin_layout Plain Layout
8696 ] The string used for a label with a
8697 \begin_inset Flex CharStyle:Code
8700 \begin_layout Plain Layout
8707 \begin_inset Flex CharStyle:Code
8710 \begin_layout Plain Layout
8720 \begin_layout Description
8721 \begin_inset Flex CharStyle:Code
8724 \begin_layout Plain Layout
8731 \begin_inset Flex CharStyle:Code
8734 \begin_layout Plain Layout
8745 \begin_inset Flex CharStyle:Code
8748 \begin_layout Plain Layout
8757 \begin_layout Description
8758 \begin_inset Flex CharStyle:Code
8761 \begin_layout Plain Layout
8768 \begin_inset Flex CharStyle:Code
8771 \begin_layout Plain Layout
8781 ] With this parameter the
8782 \begin_inset Flex CharStyle:MenuItem
8785 \begin_layout Plain Layout
8792 \begin_inset Quotes eld
8795 Vertical space above
8796 \begin_inset Quotes erd
8800 \begin_inset Flex CharStyle:MenuItem
8803 \begin_layout Plain Layout
8804 Edit\SpecialChar \menuseparator
8806 \begin_inset space ~
8814 dialog can be set when initializing a paragraph with this style.
8818 \begin_layout Plain Layout
8821 Note from Jean-Marc:
8823 I'm not sure that this setting has much use, and it should probably be
8824 removed in later versions.
8832 \begin_layout Description
8833 \begin_inset Flex CharStyle:Code
8836 \begin_layout Plain Layout
8842 The font used for both the text body
8848 \begin_inset space ~
8852 \begin_inset CommandInset ref
8854 reference "sub:Font-description"
8859 Note that defining this font automatically defines the
8860 \begin_inset Flex CharStyle:Code
8863 \begin_layout Plain Layout
8870 So you should define this one first if you also want to define
8871 \begin_inset Flex CharStyle:Code
8874 \begin_layout Plain Layout
8883 \begin_layout Description
8884 \begin_inset Flex CharStyle:Code
8887 \begin_layout Plain Layout
8894 \begin_inset CommandInset label
8896 name "des:FreeSpacing"
8903 \begin_inset Flex CharStyle:Code
8906 \begin_layout Plain Layout
8917 \begin_inset Flex CharStyle:Code
8920 \begin_layout Plain Layout
8926 ] Usually LyX doesn't allow you to insert more than one space between words,
8927 since a space is considered as the separation between two words, not a
8928 character or symbol of its own.
8929 This is a very fine thing but sometimes annoying, for example, when typing
8930 program code or plain LaTeX code.
8932 \begin_inset Flex CharStyle:Code
8935 \begin_layout Plain Layout
8942 Note that LyX will create protected blanks for the additional blanks when
8943 in another mode than LaTeX-mode.
8946 \begin_layout Description
8947 \begin_inset Flex CharStyle:Code
8950 \begin_layout Plain Layout
8956 [[FIXME]] (Used only with XML-type formats.)
8959 \begin_layout Description
8960 \begin_inset Flex CharStyle:Code
8963 \begin_layout Plain Layout
8970 \begin_inset Flex CharStyle:Code
8973 \begin_layout Plain Layout
8979 If 1, marks the layout as being part of a title block (see also the
8980 \begin_inset Flex CharStyle:Code
8983 \begin_layout Plain Layout
8990 \begin_inset Flex CharStyle:Code
8993 \begin_layout Plain Layout
9002 \begin_layout Description
9003 \begin_inset Flex CharStyle:Code
9006 \begin_layout Plain Layout
9013 \begin_inset Flex CharStyle:Code
9016 \begin_layout Plain Layout
9022 ] This provides extra space between paragraphs that have the same layout.
9023 If you put other layouts into an environment, each is separated with the
9025 \begin_inset Flex CharStyle:Code
9028 \begin_layout Plain Layout
9035 But the whole items of the environment are additionally separated with
9037 \begin_inset Flex CharStyle:Code
9040 \begin_layout Plain Layout
9052 \begin_layout Description
9053 \begin_inset Flex CharStyle:Code
9056 \begin_layout Plain Layout
9062 [[FIXME]] (Used only with XML-type formats.)
9065 \begin_layout Description
9066 \begin_inset Flex CharStyle:Code
9069 \begin_layout Plain Layout
9076 \begin_inset CommandInset label
9078 name "des:KeepEmpty"
9085 \begin_inset Flex CharStyle:Code
9088 \begin_layout Plain Layout
9099 \begin_inset Flex CharStyle:Code
9102 \begin_layout Plain Layout
9108 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9109 lead to empty LaTeX output.
9110 There are some cases where this could be desirable however: in a letter
9111 template, the required fields can be provided as empty fields, so that
9112 people do not forget them; in some special classes, a layout can be used
9113 as some kind of break, which does not contain actual text.
9116 \begin_layout Description
9117 \begin_inset Flex CharStyle:Code
9120 \begin_layout Plain Layout
9126 [float=0] The vertical space between the label and the text body.
9127 Only used for labels that are above the text body (
9128 \begin_inset Flex CharStyle:Code
9131 \begin_layout Plain Layout
9138 \begin_inset Flex CharStyle:Code
9141 \begin_layout Plain Layout
9142 Centered_Top_Environment
9150 \begin_layout Description
9151 \begin_inset Flex CharStyle:Code
9154 \begin_layout Plain Layout
9161 \begin_inset Flex CharStyle:Code
9164 \begin_layout Plain Layout
9171 \begin_inset Newline newline
9174 The name of the counter for automatic numbering.
9176 \begin_inset Newline newline
9184 \begin_inset Flex CharStyle:Code
9187 \begin_layout Plain Layout
9194 \begin_inset Flex CharStyle:Code
9197 \begin_layout Plain Layout
9204 In that case, the counter will be stepped each time the layout appears.
9206 \begin_inset Newline newline
9214 \begin_inset Flex CharStyle:Code
9217 \begin_layout Plain Layout
9224 \begin_inset Flex CharStyle:Code
9227 \begin_layout Plain Layout
9233 , though this case is a bit complicated.
9235 \begin_inset Quotes eld
9239 \begin_inset Flex CharStyle:Code
9242 \begin_layout Plain Layout
9249 \begin_inset Quotes erd
9253 Then the actual counters used are
9254 \begin_inset Flex CharStyle:Code
9257 \begin_layout Plain Layout
9264 \begin_inset Flex CharStyle:Code
9267 \begin_layout Plain Layout
9274 \begin_inset Flex CharStyle:Code
9277 \begin_layout Plain Layout
9284 \begin_inset Flex CharStyle:Code
9287 \begin_layout Plain Layout
9294 These counters must all be declared separately.
9295 \begin_inset Newline newline
9299 \begin_inset CommandInset ref
9301 reference "sub:Counters"
9305 for details on counters.
9308 \begin_layout Description
9309 \begin_inset Flex CharStyle:Code
9312 \begin_layout Plain Layout
9318 The font used for the label.
9320 \begin_inset space ~
9324 \begin_inset CommandInset ref
9326 reference "sub:Font-description"
9333 \begin_layout Description
9334 \begin_inset Flex CharStyle:Code
9337 \begin_layout Plain Layout
9343 Text that indicates how far a label should be indented.
9346 \begin_layout Description
9347 \begin_inset Flex CharStyle:Code
9350 \begin_layout Plain Layout
9357 \begin_inset Flex CharStyle:Code
9360 \begin_layout Plain Layout
9366 ] The horizontal space between the label and the text body.
9367 Only used for labels that are not above the text body.
9370 \begin_layout Description
9371 \begin_inset Flex CharStyle:Code
9374 \begin_layout Plain Layout
9381 \begin_inset Flex CharStyle:Code
9384 \begin_layout Plain Layout
9390 ] The string used for a label with a
9391 \begin_inset Flex CharStyle:Code
9394 \begin_layout Plain Layout
9402 \begin_inset Flex CharStyle:Code
9405 \begin_layout Plain Layout
9411 is set, this string can be contain the special formatting commands described
9413 \begin_inset CommandInset ref
9415 reference "sub:Counters"
9423 \begin_layout Plain Layout
9424 For the sake of backwards compatibility, the string
9425 \begin_inset Flex CharStyle:Code
9428 \begin_layout Plain Layout
9438 will be replaced by the expanded
9439 \begin_inset Flex CharStyle:Code
9442 \begin_layout Plain Layout
9449 \begin_inset Flex CharStyle:Code
9452 \begin_layout Plain Layout
9461 This feature is now obsolete and should be replaced by the mechanisms of
9463 \begin_inset CommandInset ref
9465 reference "sub:Counters"
9477 \begin_layout Description
9478 \begin_inset Flex CharStyle:Code
9481 \begin_layout Plain Layout
9488 \begin_inset Flex CharStyle:Code
9491 \begin_layout Plain Layout
9497 ] This is used inside the appendix instead of
9498 \begin_inset Flex CharStyle:Code
9501 \begin_layout Plain Layout
9509 \begin_inset Flex CharStyle:Code
9512 \begin_layout Plain Layout
9519 \begin_inset Flex CharStyle:Code
9522 \begin_layout Plain Layout
9531 \begin_layout Description
9532 \begin_inset Flex CharStyle:Code
9535 \begin_layout Plain Layout
9541 [FIXME] (Used only with XML-type formats.)
9544 \begin_layout Description
9545 \begin_inset Flex CharStyle:Code
9548 \begin_layout Plain Layout
9555 \begin_inset Flex CharStyle:Code
9558 \begin_layout Plain Layout
9563 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
9564 Enumerate, Itemize, Bibliography
9573 \begin_layout Itemize
9574 \begin_inset Flex CharStyle:Code
9577 \begin_layout Plain Layout
9583 means the label is the very first word (up to the first real blank).
9584 Use protected spaces (like
9585 \begin_inset space ~
9588 that one) if you want more than one word as the label.
9592 \begin_layout Itemize
9593 \begin_inset Flex CharStyle:Code
9596 \begin_layout Plain Layout
9602 means the label is simply whatever
9603 \begin_inset Flex CharStyle:Code
9606 \begin_layout Plain Layout
9613 Note that this really is `static'.
9616 \begin_layout Itemize
9617 \begin_inset Flex CharStyle:Code
9620 \begin_layout Plain Layout
9627 \begin_inset Flex CharStyle:Code
9630 \begin_layout Plain Layout
9631 Centered_Top_Environment
9636 are special cases of
9637 \begin_inset Flex CharStyle:Code
9640 \begin_layout Plain Layout
9647 The label will be printed above the paragraph, but only at the top of an
9648 environment or the top of a chain of paragraphs with this layout.
9649 This might be used with the
9650 \begin_inset Flex CharStyle:MenuItem
9653 \begin_layout Plain Layout
9659 layout, for example.
9662 \begin_layout Itemize
9663 \begin_inset Flex CharStyle:Code
9666 \begin_layout Plain Layout
9672 is a special case for the caption-labels
9673 \begin_inset Quotes eld
9677 \begin_inset Quotes erd
9681 \begin_inset Quotes eld
9685 \begin_inset Quotes erd
9690 \begin_inset Flex CharStyle:Code
9693 \begin_layout Plain Layout
9699 means the (hardcoded) label string depends on the kind of float: It is
9700 hardcoded to be `FloatType N', where N is the value of the counter associated
9704 \begin_layout Itemize
9706 \begin_inset Flex CharStyle:Code
9709 \begin_layout Plain Layout
9715 label type defines automatically numbered labels.
9717 \begin_inset Flex CharStyle:Code
9720 \begin_layout Plain Layout
9726 will be expanded to resolve any counter references it contains: For example,
9728 \begin_inset Quotes eld
9732 \begin_inset Flex CharStyle:Code
9735 \begin_layout Plain Layout
9746 \begin_inset Quotes erd
9751 \begin_inset CommandInset ref
9753 reference "sub:Counters"
9757 for more information on counters.
9760 \begin_layout Itemize
9761 \begin_inset Flex CharStyle:Code
9764 \begin_layout Plain Layout
9770 produces the usual sort of enumeration labels.
9771 At present, it is hardcoded to use Arabic numerals, lowercase letters,
9772 small Roman numerals, and uppercase letters for the four possible depths.
9775 \begin_layout Itemize
9776 \begin_inset Flex CharStyle:Code
9779 \begin_layout Plain Layout
9785 produces various bullets at the different levels.
9786 It is also hardcoded.
9789 \begin_layout Itemize
9790 \begin_inset Flex CharStyle:Code
9793 \begin_layout Plain Layout
9799 is used internally by LyX and should be used only with
9800 \begin_inset Flex CharStyle:Code
9803 \begin_layout Plain Layout
9804 LatexType BibEnvironment
9813 \begin_layout Description
9814 \begin_inset Flex CharStyle:Code
9817 \begin_layout Plain Layout
9824 \begin_inset Flex CharStyle:Code
9827 \begin_layout Plain Layout
9833 , but this preamble snippet occurs independently from the babel package,
9834 and only for the document language.
9836 \begin_inset Quotes eld
9840 \begin_inset Flex CharStyle:Code
9843 \begin_layout Plain Layout
9850 \begin_inset Quotes erd
9857 \begin_layout Standard
9858 If the style defines text that appears in the typeset document, it may use
9860 \begin_inset Flex CharStyle:Code
9863 \begin_layout Plain Layout
9870 \begin_inset Flex CharStyle:Code
9873 \begin_layout Plain Layout
9879 to support non-english and even multilanguage documents correctly.
9880 The following excerpt (from the
9881 \begin_inset Flex CharStyle:Code
9884 \begin_layout Plain Layout
9890 file) shows how this works:
9893 \begin_layout LyX-Code
9897 \begin_layout LyX-Code
9900 theoremstyle{remark}
9903 \begin_layout LyX-Code
9906 newtheorem{claim}[thm]{
9913 \begin_layout LyX-Code
9917 \begin_layout LyX-Code
9921 \begin_layout LyX-Code
9926 claimname}{_(Claim)}
9929 \begin_layout LyX-Code
9933 \begin_layout LyX-Code
9937 \begin_layout LyX-Code
9941 \begin_layout LyX-Code
9950 claimname}{_(Claim)}}
9953 \begin_layout LyX-Code
9957 \begin_layout Standard
9958 The key to correct translation of the user visible text is the definition
9960 \begin_inset Flex CharStyle:Code
9963 \begin_layout Plain Layout
9971 in the language preamble.
9972 This command holds the name of the theorem that will appear in the output.
9974 \begin_inset Flex CharStyle:Code
9977 \begin_layout Plain Layout
9983 then uses the commands offered by the babel package to redefine
9984 \begin_inset Flex CharStyle:Code
9987 \begin_layout Plain Layout
9995 for each used language in multilanguage documents.
9999 \begin_layout Description
10000 \begin_inset Flex CharStyle:Code
10003 \begin_layout Plain Layout
10009 The name of the corresponding LaTeX stuff.
10010 Either the environment or command name.
10013 \begin_layout Description
10014 \begin_inset Flex CharStyle:Code
10017 \begin_layout Plain Layout
10023 An optional parameter for the corresponding
10024 \begin_inset Flex CharStyle:Code
10027 \begin_layout Plain Layout
10034 This parameter cannot be changed from within LyX.
10037 \begin_layout Description
10038 \begin_inset Flex CharStyle:Code
10041 \begin_layout Plain Layout
10048 \begin_inset CommandInset label
10050 name "des:LatexType"
10055 \begin_inset Flex CharStyle:Code
10058 \begin_layout Plain Layout
10063 , Command, Environment, Item_Environment,
10069 \begin_inset Flex CharStyle:Code
10072 \begin_layout Plain Layout
10073 List_Environment, Bib_Environment
10078 ] How the layout should be translated into LaTeX.
10082 \begin_layout Plain Layout
10083 \begin_inset Flex CharStyle:Code
10086 \begin_layout Plain Layout
10092 is perhaps a bit misleading, since these rules apply to SGML classes, too.
10093 Visit the SGML class files for specific examples.
10102 \begin_layout Itemize
10103 \begin_inset Flex CharStyle:Code
10106 \begin_layout Plain Layout
10112 means nothing special.
10116 \begin_layout Itemize
10117 \begin_inset Flex CharStyle:Code
10120 \begin_layout Plain Layout
10127 \begin_inset Flex CharStyle:Code
10130 \begin_layout Plain Layout
10137 {\SpecialChar \ldots{}
10146 \begin_layout Itemize
10147 \begin_inset Flex CharStyle:Code
10150 \begin_layout Plain Layout
10157 \begin_inset Flex CharStyle:Code
10160 \begin_layout Plain Layout
10167 }\SpecialChar \ldots{}
10183 \begin_layout Itemize
10184 \begin_inset Flex CharStyle:Code
10187 \begin_layout Plain Layout
10194 \begin_inset Flex CharStyle:Code
10197 \begin_layout Plain Layout
10204 \begin_inset Flex CharStyle:Code
10207 \begin_layout Plain Layout
10215 is generated for each paragraph of this environment.
10219 \begin_layout Itemize
10220 \begin_inset Flex CharStyle:Code
10223 \begin_layout Plain Layout
10230 \begin_inset Flex CharStyle:Code
10233 \begin_layout Plain Layout
10240 \begin_inset Flex CharStyle:Code
10243 \begin_layout Plain Layout
10249 is passed as an argument to the environment.
10251 \begin_inset Flex CharStyle:Code
10254 \begin_layout Plain Layout
10260 can be defined in the
10261 \begin_inset Flex CharStyle:MenuItem
10264 \begin_layout Plain Layout
10269 ayout\SpecialChar \menuseparator
10283 \begin_layout Standard
10284 Putting the last few things together, the LaTeX output will be either:
10287 \begin_layout LyX-Code
10290 latexname[latexparam]{\SpecialChar \ldots{}
10294 \begin_layout Standard
10298 \begin_layout LyX-Code
10301 begin{latexname}[latexparam] \SpecialChar \ldots{}
10307 \begin_layout Standard
10308 depending upon the LaTeX type.
10312 \begin_layout Description
10313 \begin_inset Flex CharStyle:Code
10316 \begin_layout Plain Layout
10323 \begin_inset Flex CharStyle:Code
10326 \begin_layout Plain Layout
10332 ] If you put layouts into environments, the leftmargins are not simply added,
10333 but added with a factor
10334 \begin_inset Formula $\frac{4}{depth+4}$
10338 Note that this parameter is also used when the margin is defined as
10339 \begin_inset Flex CharStyle:Code
10342 \begin_layout Plain Layout
10349 \begin_inset Flex CharStyle:Code
10352 \begin_layout Plain Layout
10359 Then it is added to the manual or dynamic margin.
10361 \begin_inset Newline newline
10364 The argument is passed as a string.
10366 \begin_inset Quotes eld
10370 \begin_inset Flex CharStyle:Code
10373 \begin_layout Plain Layout
10380 \begin_inset Quotes erd
10383 means that the paragraph is indented with the width of
10384 \begin_inset Quotes eld
10388 \begin_inset Flex CharStyle:Code
10391 \begin_layout Plain Layout
10398 \begin_inset Quotes erd
10401 in the normal font.
10402 You can get a negative width by prefixing the string with
10403 \begin_inset Quotes eld
10407 \begin_inset Flex CharStyle:Code
10410 \begin_layout Plain Layout
10417 \begin_inset Quotes erd
10421 This way was chosen so that the look is the same with each used screen
10426 \begin_layout Description
10427 \begin_inset Flex CharStyle:Code
10430 \begin_layout Plain Layout
10437 \begin_inset Flex CharStyle:Code
10440 \begin_layout Plain Layout
10445 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10451 \begin_inset Newline newline
10454 The kind of margin that the layout has on the left side.
10456 \begin_inset Flex CharStyle:Code
10459 \begin_layout Plain Layout
10465 just means a fixed margin.
10467 \begin_inset Flex CharStyle:Code
10470 \begin_layout Plain Layout
10476 means that the left margin depends on the string entered in the
10477 \begin_inset Flex CharStyle:MenuItem
10480 \begin_layout Plain Layout
10481 Edit\SpecialChar \menuseparator
10483 \begin_inset space ~
10492 This is used to typeset nice lists without tabulators.
10494 \begin_inset Flex CharStyle:Code
10497 \begin_layout Plain Layout
10503 means that the margin depends on the size of the label.
10504 This is used for automatic enumerated headlines.
10505 It is obvious that the headline
10506 \begin_inset Quotes eld
10509 5.4.3.2.1 Very long headline
10510 \begin_inset Quotes erd
10513 must have a wider left margin (as wide as
10514 \begin_inset Quotes eld
10518 \begin_inset Quotes erd
10521 plus the space) than
10522 \begin_inset Quotes eld
10525 3.2 Very long headline
10526 \begin_inset Quotes erd
10530 \begin_inset Quotes eld
10534 \begin_inset Quotes erd
10537 are not able to do this.
10539 \begin_inset Flex CharStyle:Code
10542 \begin_layout Plain Layout
10548 is similar, but only the very first row of the paragraph is dynamic, while
10549 the others are static; this is used, for example, for descriptions.
10551 \begin_inset Flex CharStyle:Code
10554 \begin_layout Plain Layout
10560 means the margin is chosen in a way that the longest row of this paragraph
10561 fits to the right margin.
10562 This is used to typeset an address on the right edge of the page.
10565 \begin_layout Description
10566 \begin_inset Flex CharStyle:Code
10569 \begin_layout Plain Layout
10576 \begin_inset Flex CharStyle:Code
10579 \begin_layout Plain Layout
10588 \begin_inset Flex CharStyle:Code
10591 \begin_layout Plain Layout
10597 ] Whether fragile commands in this layout should be
10598 \begin_inset Flex CharStyle:Code
10601 \begin_layout Plain Layout
10614 whether this command should itself be protected.)
10617 \begin_layout Description
10618 \begin_inset Flex CharStyle:Code
10621 \begin_layout Plain Layout
10628 \begin_inset Flex CharStyle:Code
10631 \begin_layout Plain Layout
10638 \begin_inset Flex CharStyle:Code
10641 \begin_layout Plain Layout
10649 ] Whether newlines are translated into LaTeX newlines (
10650 \begin_inset Flex CharStyle:Code
10653 \begin_layout Plain Layout
10664 The translation can be switched off to allow more comfortable LaTeX editing
10668 \begin_layout Description
10669 \begin_inset Flex CharStyle:Code
10672 \begin_layout Plain Layout
10679 \begin_inset Flex CharStyle:Code
10682 \begin_layout Plain Layout
10689 \begin_inset Flex CharStyle:Code
10692 \begin_layout Plain Layout
10700 ] Whether the following Paragraph is allowed to indent its very first row.
10702 \begin_inset Flex CharStyle:Code
10705 \begin_layout Plain Layout
10711 means that it is not allowed to do so;
10712 \begin_inset Flex CharStyle:Code
10715 \begin_layout Plain Layout
10721 means it could do so if it wants to.
10724 \begin_layout Description
10725 \begin_inset Flex CharStyle:Code
10728 \begin_layout Plain Layout
10734 Name of a layout that has replaced this layout.
10735 This is used to rename a layout, while keeping backward compatibility.
10738 \begin_layout Description
10739 \begin_inset Flex CharStyle:Code
10742 \begin_layout Plain Layout
10749 \begin_inset Flex CharStyle:Code
10752 \begin_layout Plain Layout
10758 ] The number of optional arguments that can be used with this layout.
10759 This is useful for things like section headings, and only makes sense with
10763 \begin_layout Description
10764 \begin_inset Flex CharStyle:Code
10767 \begin_layout Plain Layout
10774 \begin_inset Flex CharStyle:Code
10777 \begin_layout Plain Layout
10783 ] The indent of the very first line of a paragraph.
10785 \begin_inset Flex CharStyle:Code
10788 \begin_layout Plain Layout
10794 will be fixed for a certain layout.
10795 The exception is Standard layout, since the indentation of a Standard layout
10796 paragraph can be prohibited with
10797 \begin_inset Flex CharStyle:Code
10800 \begin_layout Plain Layout
10807 Also, Standard layout paragraphs inside environments use the
10808 \begin_inset Flex CharStyle:Code
10811 \begin_layout Plain Layout
10817 of the environment, not their native one.
10818 For example, Standard paragraphs inside an enumeration are not indented.
10821 \begin_layout Description
10822 \begin_inset Flex CharStyle:Code
10825 \begin_layout Plain Layout
10832 \begin_inset Flex CharStyle:Code
10835 \begin_layout Plain Layout
10841 ] The vertical space between two paragraphs of this layout.
10844 \begin_layout Description
10845 \begin_inset Flex CharStyle:Code
10848 \begin_layout Plain Layout
10855 \begin_inset Flex CharStyle:Code
10858 \begin_layout Plain Layout
10864 ] LyX allows the user to choose either
10865 \begin_inset Quotes eld
10869 \begin_inset Quotes erd
10873 \begin_inset Quotes eld
10877 \begin_inset Quotes erd
10880 to typeset a document.
10882 \begin_inset Quotes eld
10886 \begin_inset Quotes erd
10889 is chosen, this value is completely ignored.
10891 \begin_inset Quotes eld
10895 \begin_inset Quotes erd
10898 is chosen, the parindent of a LaTeXtype
10899 \begin_inset Quotes eld
10903 \begin_inset Quotes erd
10906 layout is ignored and all paragraphs are separated by this parskip argument.
10907 The vertical space is calculated with
10908 \begin_inset Flex CharStyle:Code
10911 \begin_layout Plain Layout
10913 \begin_inset space ~
10922 \begin_inset Flex CharStyle:Code
10925 \begin_layout Plain Layout
10931 is the height of a row with the normal font.
10932 This way, the look stays the same with different screen fonts.
10935 \begin_layout Description
10936 \begin_inset Flex CharStyle:Code
10939 \begin_layout Plain Layout
10946 \begin_inset CommandInset label
10948 name "des:PathThru"
10955 \begin_inset Flex CharStyle:Code
10958 \begin_layout Plain Layout
10969 \begin_inset Flex CharStyle:Code
10972 \begin_layout Plain Layout
10978 ] Whether the contents of this paragraph should be output in raw form, meaning
10979 without special translations that LaTeX would require.
10982 \begin_layout Description
10983 \begin_inset Flex CharStyle:Code
10986 \begin_layout Plain Layout
10993 \begin_inset CommandInset label
10995 name "des:Preamble"
10999 Information to be included in the LaTeX preamble when this style is used.
11000 Used to define macros, load packages, etc., required by this particular
11003 \begin_inset Quotes eld
11007 \begin_inset Flex CharStyle:Code
11010 \begin_layout Plain Layout
11017 \begin_inset Quotes erd
11023 \begin_layout Description
11024 \begin_inset Flex CharStyle:Code
11027 \begin_layout Plain Layout
11034 \begin_inset Flex CharStyle:Code
11037 \begin_layout Plain Layout
11044 \begin_inset CommandInset label
11046 name "des:Requires"
11050 Whether the layout requires the feature
11051 \begin_inset Flex CharStyle:Code
11054 \begin_layout Plain Layout
11061 See the description of
11062 \begin_inset Flex CharStyle:Code
11065 \begin_layout Plain Layout
11072 \begin_inset CommandInset ref
11073 LatexCommand pageref
11074 reference "des:FreeSpacing"
11078 ) for information on `features'.
11082 \begin_layout Description
11083 \begin_inset Flex CharStyle:Code
11086 \begin_layout Plain Layout
11093 \begin_inset Flex CharStyle:Code
11096 \begin_layout Plain Layout
11103 \begin_inset Flex CharStyle:Code
11106 \begin_layout Plain Layout
11115 \begin_layout Description
11116 \begin_inset Flex CharStyle:Code
11119 \begin_layout Plain Layout
11126 \begin_inset Flex CharStyle:Code
11129 \begin_layout Plain Layout
11134 , onehalf, double, other
11143 ] This defines what the default spacing should be in the layout.
11145 \begin_inset Flex CharStyle:Code
11148 \begin_layout Plain Layout
11155 \begin_inset Flex CharStyle:Code
11158 \begin_layout Plain Layout
11165 \begin_inset Flex CharStyle:Code
11168 \begin_layout Plain Layout
11174 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
11175 If you specify the argument
11176 \begin_inset Flex CharStyle:Code
11179 \begin_layout Plain Layout
11185 , then you should also provide a numerical argument which will be the actual
11187 Note that, contrary to other parameters,
11188 \begin_inset Flex CharStyle:Code
11191 \begin_layout Plain Layout
11197 implies the generation of specific LaTeX code, using the package
11200 \begin_inset Flex CharStyle:Code
11203 \begin_layout Plain Layout
11212 \begin_layout Description
11213 \begin_inset Flex CharStyle:Code
11216 \begin_layout Plain Layout
11222 The font used for the text body .
11224 \begin_inset CommandInset ref
11226 reference "sub:Font-description"
11233 \begin_layout Description
11234 \begin_inset Flex CharStyle:Code
11237 \begin_layout Plain Layout
11245 The level of the style in the table of contents.
11246 This is used for automatic numbering of section headings.
11249 \begin_layout Description
11250 \begin_inset Flex CharStyle:Code
11253 \begin_layout Plain Layout
11260 \begin_inset Flex CharStyle:Code
11263 \begin_layout Plain Layout
11269 ] The vertical space with which the very first of a chain of paragraphs
11270 with this layout is separated from the previous paragraph.
11271 If the previous paragraph has another layout, the separations are not simply
11272 added, but the maximum is taken.
11275 \begin_layout Subsection
11277 \begin_inset CommandInset label
11286 \begin_layout Standard
11287 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11288 define the floats (
11289 \begin_inset Flex CharStyle:MenuItem
11292 \begin_layout Plain Layout
11299 \begin_inset Flex CharStyle:MenuItem
11302 \begin_layout Plain Layout
11308 , \SpecialChar \ldots{}
11309 ) in the text class itself.
11310 Standard floats are included in the file
11311 \begin_inset Flex CharStyle:Code
11314 \begin_layout Plain Layout
11320 , so you may have to do no more than add
11323 \begin_layout LyX-Code
11324 Input stdfloats.inc
11327 \begin_layout Standard
11328 to your layout file.
11329 If you want to implement a text class that proposes some other float types
11330 (like the AGU class bundled with LyX), the information below will hopefully
11334 \begin_layout Description
11335 \begin_inset Flex CharStyle:Code
11338 \begin_layout Plain Layout
11345 \begin_inset Flex CharStyle:Code
11348 \begin_layout Plain Layout
11355 \begin_inset Quotes erd
11359 \begin_inset Quotes erd
11362 ] The file name extension of an auxiliary file for the list of figures (or
11364 LaTeX writes the captions to this file.
11367 \begin_layout Description
11368 \begin_inset Flex CharStyle:Code
11371 \begin_layout Plain Layout
11378 \begin_inset Flex CharStyle:Code
11381 \begin_layout Plain Layout
11388 \begin_inset Quotes erd
11392 \begin_inset Quotes erd
11395 ] The string that will be used in the menus and also for the caption.
11398 \begin_layout Description
11399 \begin_inset Flex CharStyle:Code
11402 \begin_layout Plain Layout
11409 \begin_inset Flex CharStyle:Code
11412 \begin_layout Plain Layout
11421 \begin_inset Flex CharStyle:Code
11424 \begin_layout Plain Layout
11431 \begin_inset Flex CharStyle:Code
11434 \begin_layout Plain Layout
11440 if the float is already defined by the LaTeX document class.
11442 \begin_inset Flex CharStyle:Code
11445 \begin_layout Plain Layout
11451 , the float will be defined using the LaTeX package
11452 \begin_inset Flex CharStyle:Code
11455 \begin_layout Plain Layout
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
11485 \begin_inset Quotes erd
11489 \begin_inset Quotes erd
11492 ] The heading used for the list of floats.
11495 \begin_layout Description
11496 \begin_inset Flex CharStyle:Code
11499 \begin_layout Plain Layout
11506 \begin_inset Flex CharStyle:Code
11509 \begin_layout Plain Layout
11516 \begin_inset Quotes erd
11520 \begin_inset Quotes erd
11523 ] This (optional) argument determines whether floats of this class will
11524 be numbered within some sectional unit of the document.
11525 For example, if within is equal to
11526 \begin_inset Flex CharStyle:Code
11529 \begin_layout Plain Layout
11535 , the floats will be numbered within chapters.
11539 \begin_layout Description
11540 \begin_inset Flex CharStyle:Code
11543 \begin_layout Plain Layout
11550 \begin_inset Flex CharStyle:Code
11553 \begin_layout Plain Layout
11560 \begin_inset Quotes erd
11564 \begin_inset Quotes erd
11567 ] The default placement for the given class of floats.
11568 The string should be as in standard LaTeX:
11569 \begin_inset Flex CharStyle:Code
11572 \begin_layout Plain Layout
11579 \begin_inset Flex CharStyle:Code
11582 \begin_layout Plain Layout
11589 \begin_inset Flex CharStyle:Code
11592 \begin_layout Plain Layout
11599 \begin_inset Flex CharStyle:Code
11602 \begin_layout Plain Layout
11608 for top, bottom, page, and here, respectively.
11612 \begin_layout Plain Layout
11613 Note that the order of these letters in the string is irrelevant, like in
11619 On top of that there is a new type,
11620 \begin_inset Flex CharStyle:Code
11623 \begin_layout Plain Layout
11629 , which does not really correspond to a float, since it means: put it
11630 \begin_inset Quotes eld
11634 \begin_inset Quotes erd
11638 Note however that the
11639 \begin_inset Flex CharStyle:Code
11642 \begin_layout Plain Layout
11648 specifier is special and, because of implementation details, cannot be
11649 used in non-built in float types.
11650 If you do not understand what this means, just use
11651 \begin_inset Quotes eld
11655 \begin_inset Flex CharStyle:Code
11658 \begin_layout Plain Layout
11665 \begin_inset Quotes erd
11671 \begin_layout Description
11672 \begin_inset Flex CharStyle:Code
11675 \begin_layout Plain Layout
11682 \begin_inset Flex CharStyle:Code
11685 \begin_layout Plain Layout
11692 \begin_inset Quotes erd
11696 \begin_inset Quotes erd
11699 ] The style used when defining the float using
11700 \begin_inset Flex CharStyle:Code
11703 \begin_layout Plain Layout
11714 \begin_layout Description
11715 \begin_inset Flex CharStyle:Code
11718 \begin_layout Plain Layout
11725 \begin_inset Flex CharStyle:Code
11728 \begin_layout Plain Layout
11735 \begin_inset Quotes erd
11739 \begin_inset Quotes erd
11743 \begin_inset Quotes eld
11747 \begin_inset Quotes erd
11750 of the new class of floats, like program or algorithm.
11751 After the appropriate
11752 \begin_inset Flex CharStyle:Code
11755 \begin_layout Plain Layout
11764 \begin_inset Flex CharStyle:Code
11767 \begin_layout Plain Layout
11776 \begin_inset Flex CharStyle:Code
11779 \begin_layout Plain Layout
11790 \begin_layout Standard
11791 Note that defining a float with type
11792 \begin_inset Flex CharStyle:Code
11795 \begin_layout Plain Layout
11803 automatically defines the corresponding counter with name
11804 \begin_inset Flex CharStyle:Code
11807 \begin_layout Plain Layout
11818 \begin_layout Subsection
11819 Flex insets and InsetLayout
11820 \begin_inset CommandInset label
11822 name "sub:Flex-insets-and"
11829 \begin_layout Standard
11830 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11831 these are called Flex insets.
11835 \begin_layout Standard
11836 Flex insets come in three different kinds:
11839 \begin_layout Itemize
11841 \begin_inset Flex CharStyle:Code
11844 \begin_layout Plain Layout
11850 ): These define semantic markup corresponding to such LaTeX commands as
11852 \begin_inset Flex CharStyle:Code
11855 \begin_layout Plain Layout
11864 \begin_inset Flex CharStyle:Code
11867 \begin_layout Plain Layout
11878 \begin_layout Itemize
11880 \begin_inset Flex CharStyle:Code
11883 \begin_layout Plain Layout
11889 ): These can be used to define custom collapsible insets, similar to TeX
11890 code, footnote, and the like.
11891 An obvious example is an endnote inset, which is defined in the
11892 \begin_inset Flex CharStyle:Code
11895 \begin_layout Plain Layout
11904 \begin_layout Itemize
11906 \begin_inset Flex CharStyle:Code
11909 \begin_layout Plain Layout
11915 ): For use with DocBook classes.
11918 \begin_layout Standard
11919 Flex insets are defined using the
11920 \begin_inset Flex CharStyle:Code
11923 \begin_layout Plain Layout
11929 tag, which shall be explained in a moment.
11932 \begin_layout Standard
11934 \begin_inset Flex CharStyle:Code
11937 \begin_layout Plain Layout
11943 tag also serves another function: It can be used to customize the general
11944 layout of many different types of insets.
11946 \begin_inset Flex CharStyle:Code
11949 \begin_layout Plain Layout
11955 can be used to customize the layout parameters for footnotes, marginal
11956 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
11957 boxes, tables, algorithms, URLs, and optional arguments, as well as to
11958 define Flex insets.
11961 \begin_layout Standard
11963 \begin_inset Flex CharStyle:Code
11966 \begin_layout Plain Layout
11972 definition must begin with a line of the form:
11975 \begin_layout LyX-Code
11979 \begin_layout Standard
11981 \begin_inset Flex CharStyle:Code
11984 \begin_layout Plain Layout
11990 indicates the inset whose layout is being defined, and here there are two
11994 \begin_layout Enumerate
11995 The layout for a pre-existing inset is being modified.
11996 In this case, can be
11997 \begin_inset Flex CharStyle:Code
12000 \begin_layout Plain Layout
12006 any one of the following:
12007 \begin_inset Flex CharStyle:Code
12010 \begin_layout Plain Layout
12017 \begin_inset Flex CharStyle:Code
12020 \begin_layout Plain Layout
12027 \begin_inset Flex CharStyle:Code
12030 \begin_layout Plain Layout
12037 \begin_inset Flex CharStyle:Code
12040 \begin_layout Plain Layout
12047 \begin_inset Flex CharStyle:Code
12050 \begin_layout Plain Layout
12057 \begin_inset Flex CharStyle:Code
12060 \begin_layout Plain Layout
12067 \begin_inset Flex CharStyle:Code
12070 \begin_layout Plain Layout
12077 \begin_inset Flex CharStyle:Code
12080 \begin_layout Plain Layout
12087 \begin_inset Flex CharStyle:Code
12090 \begin_layout Plain Layout
12097 \begin_inset Flex CharStyle:Code
12100 \begin_layout Plain Layout
12107 \begin_inset Flex CharStyle:Code
12110 \begin_layout Plain Layout
12117 \begin_inset Flex CharStyle:Code
12120 \begin_layout Plain Layout
12127 \begin_inset Flex CharStyle:Code
12130 \begin_layout Plain Layout
12137 \begin_inset Flex CharStyle:Code
12140 \begin_layout Plain Layout
12147 \begin_inset Flex CharStyle:Code
12150 \begin_layout Plain Layout
12157 \begin_inset Flex CharStyle:Code
12160 \begin_layout Plain Layout
12167 \begin_inset Flex CharStyle:Code
12170 \begin_layout Plain Layout
12177 \begin_inset Flex CharStyle:Code
12180 \begin_layout Plain Layout
12187 \begin_inset Flex CharStyle:Code
12190 \begin_layout Plain Layout
12197 \begin_inset Flex CharStyle:Code
12200 \begin_layout Plain Layout
12210 \begin_layout Enumerate
12211 The layout for a Flex inset is being defined.
12213 \begin_inset Flex CharStyle:Code
12216 \begin_layout Plain Layout
12222 can be any valid identifier not used by a pre-existing inset.
12223 Note that the definition of a flex inset must
12228 \begin_inset Flex CharStyle:Code
12231 \begin_layout Plain Layout
12240 \begin_layout Standard
12242 \begin_inset Flex CharStyle:Code
12245 \begin_layout Plain Layout
12251 definition can contain the following entries:
12254 \begin_layout Description
12255 \begin_inset Flex CharStyle:Code
12258 \begin_layout Plain Layout
12264 The color for the inset's background.
12265 The valid colors are defined in
12266 \begin_inset Flex CharStyle:Code
12269 \begin_layout Plain Layout
12278 \begin_layout Description
12279 \begin_inset Flex CharStyle:Code
12282 \begin_layout Plain Layout
12288 As with paragraph styles (see page
12289 \begin_inset CommandInset ref
12291 reference "des:CopyStyle"
12298 \begin_layout Description
12299 \begin_inset Flex CharStyle:Code
12302 \begin_layout Plain Layout
12309 \begin_inset Flex CharStyle:Code
12312 \begin_layout Plain Layout
12321 \begin_inset Flex CharStyle:Code
12324 \begin_layout Plain Layout
12330 ] Indicates whether the user may employ the Paragraph Settings dialog to
12331 customize the paragraph.
12334 \begin_layout Description
12335 \begin_inset Flex CharStyle:Code
12338 \begin_layout Plain Layout
12345 \begin_inset Flex CharStyle:Code
12348 \begin_layout Plain Layout
12355 \begin_inset Flex CharStyle:Code
12358 \begin_layout Plain Layout
12365 \begin_inset Flex CharStyle:Code
12368 \begin_layout Plain Layout
12374 , describing the rendering style used for the inset's frame and buttons.
12375 Footnotes generally use
12376 \begin_inset Flex CharStyle:Code
12379 \begin_layout Plain Layout
12385 , ERT insets generally
12386 \begin_inset Flex CharStyle:Code
12389 \begin_layout Plain Layout
12395 , and character styles
12396 \begin_inset Flex CharStyle:Code
12399 \begin_layout Plain Layout
12408 \begin_layout Description
12409 \begin_inset Flex CharStyle:Code
12412 \begin_layout Plain Layout
12418 Required at the end of the InsetLayout declarations.
12421 \begin_layout Description
12422 \begin_inset Flex CharStyle:Code
12425 \begin_layout Plain Layout
12431 The font used for both the text body
12437 \begin_inset space ~
12441 \begin_inset CommandInset ref
12443 reference "sub:Font-description"
12448 Note that defining this font automatically defines the
12449 \begin_inset Flex CharStyle:Code
12452 \begin_layout Plain Layout
12458 to the same value, so define this first and define
12459 \begin_inset Flex CharStyle:Code
12462 \begin_layout Plain Layout
12468 later if you want them to be different.
12471 \begin_layout Description
12472 \begin_inset Flex CharStyle:Code
12475 \begin_layout Plain Layout
12482 \begin_inset Quotes eld
12486 \begin_inset Quotes erd
12489 language, leading to Left-to-Right (latin) output, e.
12490 \begin_inset space \thinspace{}
12494 \begin_inset space \space{}
12497 in TeX code or URL.
12501 \begin_layout Description
12502 \begin_inset Flex CharStyle:Code
12505 \begin_layout Plain Layout
12512 \begin_inset Flex CharStyle:Code
12515 \begin_layout Plain Layout
12524 \begin_inset Flex CharStyle:Code
12527 \begin_layout Plain Layout
12533 ] Indicates whether the PlainLayout should be used or, instead, the user
12534 can change the paragraph style used in the inset.
12537 \begin_layout Description
12538 \begin_inset Flex CharStyle:Code
12541 \begin_layout Plain Layout
12547 As with paragraph styles (see page
12548 \begin_inset CommandInset ref
12549 LatexCommand pageref
12550 reference "des:FreeSpacing"
12557 \begin_layout Description
12558 \begin_inset Flex CharStyle:Code
12561 \begin_layout Plain Layout
12568 \begin_inset Flex CharStyle:Code
12571 \begin_layout Plain Layout
12580 \begin_inset Flex CharStyle:Code
12583 \begin_layout Plain Layout
12589 ] Whether to include the contents of this inset in the strings generated
12590 for the `Outline' pane.
12591 One would not, for example, want the content of a footnote in a section
12592 header to be included in the TOC displayed in the outline, but one would
12593 normally want the content of a character style displayed.
12594 Default is false: not to include.
12597 \begin_layout Description
12598 \begin_inset Flex CharStyle:Code
12601 \begin_layout Plain Layout
12607 As with paragraph styles (see page
12608 \begin_inset CommandInset ref
12609 LatexCommand pageref
12610 reference "des:KeepEmpty"
12617 \begin_layout Description
12618 \begin_inset Flex CharStyle:Code
12621 \begin_layout Plain Layout
12627 The font used for the label.
12629 \begin_inset space ~
12633 \begin_inset CommandInset ref
12635 reference "sub:Font-description"
12640 Note that this definition can never appear before
12641 \begin_inset Flex CharStyle:Code
12644 \begin_layout Plain Layout
12650 , lest it be ineffective.
12653 \begin_layout Description
12654 \begin_inset Flex CharStyle:Code
12657 \begin_layout Plain Layout
12663 What will be displayed on the button or elsewhere as the inset label.
12664 Some inset types (TeX code and Branch) modify this label on the fly.
12667 \begin_layout Description
12668 \begin_inset Flex CharStyle:Code
12671 \begin_layout Plain Layout
12677 The name of the corresponding LaTeX stuff.
12678 Either the environment or command name.
12681 \begin_layout Description
12682 \begin_inset Flex CharStyle:Code
12685 \begin_layout Plain Layout
12691 The optional parameter for the corresponding
12692 \begin_inset Flex CharStyle:Code
12695 \begin_layout Plain Layout
12701 stuff, including possible bracket pairs like
12702 \begin_inset Flex CharStyle:Code
12705 \begin_layout Plain Layout
12712 This parameter cannot be changed from within LyX.
12715 \begin_layout Description
12716 \begin_inset Flex CharStyle:Code
12719 \begin_layout Plain Layout
12725 As with paragraph styles (see page
12726 \begin_inset CommandInset ref
12727 LatexCommand pageref
12728 reference "des:LatexType"
12735 \begin_layout Description
12736 \begin_inset Flex CharStyle:Code
12739 \begin_layout Plain Layout
12746 \begin_inset Flex CharStyle:Code
12749 \begin_layout Plain Layout
12756 \begin_inset Flex CharStyle:Code
12759 \begin_layout Plain Layout
12766 \begin_inset Flex CharStyle:Code
12769 \begin_layout Plain Layout
12776 \begin_inset Flex CharStyle:Code
12779 \begin_layout Plain Layout
12785 (indicating a dummy definition ending definitions of charstyles, etc).
12786 This entry is required in and is only meaningful for Flex insets.
12787 Among other things, it determines on which menu this inset will appear.
12790 \begin_layout Description
12791 \begin_inset Flex CharStyle:Code
12794 \begin_layout Plain Layout
12801 \begin_inset Flex CharStyle:Code
12804 \begin_layout Plain Layout
12813 \begin_inset Flex CharStyle:Code
12816 \begin_layout Plain Layout
12822 ] Whether multiple paragraphs are permitted in this inset.
12823 This will also set CustomPars to the same value and ForcePlain to the opposite
12825 These can be reset to other values, if they are used
12832 \begin_layout Description
12833 \begin_inset Flex CharStyle:Code
12836 \begin_layout Plain Layout
12843 \begin_inset Flex CharStyle:Code
12846 \begin_layout Plain Layout
12855 \begin_inset Flex CharStyle:Code
12858 \begin_layout Plain Layout
12864 ] Whether fragile commands in this layout should be
12865 \begin_inset Flex CharStyle:Code
12868 \begin_layout Plain Layout
12881 whether the command should itself be protected.)
12884 \begin_layout Description
12885 \begin_inset Flex CharStyle:Code
12888 \begin_layout Plain Layout
12895 \begin_inset Flex CharStyle:Code
12898 \begin_layout Plain Layout
12907 \begin_inset Flex CharStyle:Code
12910 \begin_layout Plain Layout
12916 ] As with paragraph styles (see page
12917 \begin_inset CommandInset ref
12919 reference "des:PathThru"
12926 \begin_layout Description
12927 \begin_inset Flex CharStyle:Code
12930 \begin_layout Plain Layout
12936 As with paragraph styles (see page
12937 \begin_inset CommandInset ref
12938 LatexCommand pageref
12939 reference "des:Preamble"
12946 \begin_layout Description
12947 \begin_inset Flex CharStyle:Code
12950 \begin_layout Plain Layout
12957 \begin_inset Flex CharStyle:Code
12960 \begin_layout Plain Layout
12966 ] As with paragraph styles (see page
12967 \begin_inset CommandInset ref
12968 LatexCommand pageref
12969 reference "des:Requires"
12976 \begin_layout Subsection
12978 \begin_inset CommandInset label
12980 name "sub:Counters"
12987 \begin_layout Standard
12988 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12990 \begin_inset Flex CharStyle:MenuItem
12993 \begin_layout Plain Layout
13000 \begin_inset Flex CharStyle:MenuItem
13003 \begin_layout Plain Layout
13009 , \SpecialChar \ldots{}
13010 ) in the text class itself.
13011 The standard counters are defined in the file
13012 \begin_inset Flex CharStyle:Code
13015 \begin_layout Plain Layout
13021 , so you may have to do no more than add
13024 \begin_layout LyX-Code
13025 Input stdcounters.inc
13028 \begin_layout Standard
13029 to your layout file to get them to work.
13030 But if you want to define custom counters, then you can do so.
13031 The counter declaration must begin with:
13034 \begin_layout LyX-Code
13038 \begin_layout Standard
13039 where of course `name' is replaced by the name of the counter.
13040 And it must end with
13041 \begin_inset Quotes eld
13045 \begin_inset Flex CharStyle:Code
13048 \begin_layout Plain Layout
13055 \begin_inset Quotes erd
13059 The following parameters can also be used:
13062 \begin_layout Description
13063 \begin_inset Flex CharStyle:Code
13066 \begin_layout Plain Layout
13067 LabelString [string=""]
13072 when this is defined, this string defines how the counter is displayed.
13073 Setting this value sets
13074 \begin_inset Flex CharStyle:Code
13077 \begin_layout Plain Layout
13078 LabelStringAppendix
13084 The following special constructs can be used in the string:
13088 \begin_layout Itemize
13089 \begin_inset Flex CharStyle:Code
13092 \begin_layout Plain Layout
13100 will be replaced by the expansion of the
13101 \begin_inset Flex CharStyle:Code
13104 \begin_layout Plain Layout
13111 \begin_inset Flex CharStyle:Code
13114 \begin_layout Plain Layout
13115 LabelStringAppendix
13121 \begin_inset Flex CharStyle:Code
13124 \begin_layout Plain Layout
13134 \begin_layout Itemize
13135 counter values can be expressed using LaTeX-like macros
13136 \begin_inset Flex CharStyle:Code
13139 \begin_layout Plain Layout
13156 \begin_inset Flex CharStyle:Code
13159 \begin_layout Plain Layout
13171 \begin_layout Plain Layout
13181 Actually, the situation is a bit more complicated: any
13200 other than those described below will produce arabic numerals.
13201 It would not be surprising to see this change in the future.
13207 \begin_inset Flex CharStyle:Code
13210 \begin_layout Plain Layout
13216 : 1, 2, 3,\SpecialChar \ldots{}
13218 \begin_inset Flex CharStyle:Code
13221 \begin_layout Plain Layout
13227 for lower-case letters: a, b, c, \SpecialChar \ldots{}
13229 \begin_inset Flex CharStyle:Code
13232 \begin_layout Plain Layout
13238 for upper-case letters: A, B, C, \SpecialChar \ldots{}
13240 \begin_inset Flex CharStyle:Code
13243 \begin_layout Plain Layout
13249 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13251 \begin_inset Flex CharStyle:Code
13254 \begin_layout Plain Layout
13260 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13262 \begin_inset Flex CharStyle:Code
13265 \begin_layout Plain Layout
13271 for hebrew numerals.
13275 \begin_layout Standard
13276 If LabelString is not defined, a default value is constructed as follows:
13277 if the counter has a master counter
13278 \begin_inset Flex CharStyle:Code
13281 \begin_layout Plain Layout
13288 \begin_inset Flex CharStyle:Code
13291 \begin_layout Plain Layout
13298 \begin_inset Flex CharStyle:Code
13301 \begin_layout Plain Layout
13311 is used; otherwise the string
13312 \begin_inset Flex CharStyle:Code
13315 \begin_layout Plain Layout
13326 \begin_layout Description
13327 \begin_inset Flex CharStyle:Code
13330 \begin_layout Plain Layout
13331 LabelStringAppendix [string=""]
13337 \begin_inset Flex CharStyle:Code
13340 \begin_layout Plain Layout
13346 , but for use in the Appendix.
13349 \begin_layout Description
13350 \begin_inset Flex CharStyle:Code
13353 \begin_layout Plain Layout
13360 \begin_inset Flex CharStyle:Code
13363 \begin_layout Plain Layout
13370 \begin_inset Quotes erd
13374 \begin_inset Quotes erd
13377 ] If this is set to the name of another counter, the present counter will
13378 be reset every time the other one is increased.
13380 \begin_inset Flex CharStyle:Code
13383 \begin_layout Plain Layout
13390 \begin_inset Flex CharStyle:Code
13393 \begin_layout Plain Layout
13402 \begin_layout Subsection
13404 \begin_inset CommandInset label
13406 name "sub:Font-description"
13413 \begin_layout Standard
13414 A font description looks like this:
13417 \begin_layout LyX-Code
13427 \begin_layout LyX-Code
13431 \begin_layout LyX-Code
13435 \begin_layout Standard
13436 The following commands are available:
13439 \begin_layout Description
13440 \begin_inset Flex CharStyle:Code
13443 \begin_layout Plain Layout
13450 \begin_inset Flex CharStyle:Code
13453 \begin_layout Plain Layout
13462 \begin_inset Flex CharStyle:Code
13465 \begin_layout Plain Layout
13472 \begin_inset Flex CharStyle:Code
13475 \begin_layout Plain Layout
13482 \begin_inset Flex CharStyle:Code
13485 \begin_layout Plain Layout
13492 \begin_inset Flex CharStyle:Code
13495 \begin_layout Plain Layout
13502 \begin_inset Flex CharStyle:Code
13505 \begin_layout Plain Layout
13512 \begin_inset Flex CharStyle:Code
13515 \begin_layout Plain Layout
13522 \begin_inset Flex CharStyle:Code
13525 \begin_layout Plain Layout
13532 \begin_inset Flex CharStyle:Code
13535 \begin_layout Plain Layout
13544 \begin_layout Description
13545 \begin_inset Flex CharStyle:Code
13548 \begin_layout Plain Layout
13557 \begin_inset Flex CharStyle:Code
13560 \begin_layout Plain Layout
13571 \begin_inset Flex CharStyle:Code
13574 \begin_layout Plain Layout
13581 \begin_inset Flex CharStyle:Code
13584 \begin_layout Plain Layout
13593 \begin_layout Description
13594 \begin_inset Flex CharStyle:Code
13597 \begin_layout Plain Layout
13604 \begin_inset Flex CharStyle:Code
13607 \begin_layout Plain Layout
13613 ] Valid argument are:
13614 \begin_inset Flex CharStyle:Code
13617 \begin_layout Plain Layout
13624 \begin_inset Flex CharStyle:Code
13627 \begin_layout Plain Layout
13634 \begin_inset Flex CharStyle:Code
13637 \begin_layout Plain Layout
13644 \begin_inset Flex CharStyle:Code
13647 \begin_layout Plain Layout
13654 \begin_inset Flex CharStyle:Code
13657 \begin_layout Plain Layout
13664 \begin_inset Flex CharStyle:Code
13667 \begin_layout Plain Layout
13674 Each of these turns on or off the corresponding attribute.
13677 \begin_layout Description
13678 \begin_inset Flex CharStyle:Code
13681 \begin_layout Plain Layout
13690 \begin_inset Flex CharStyle:Code
13693 \begin_layout Plain Layout
13704 \begin_inset Flex CharStyle:Code
13707 \begin_layout Plain Layout
13716 \begin_layout Description
13717 \begin_inset Flex CharStyle:Code
13720 \begin_layout Plain Layout
13729 \begin_inset Flex CharStyle:Code
13732 \begin_layout Plain Layout
13743 \begin_inset Flex CharStyle:Code
13746 \begin_layout Plain Layout
13753 \begin_inset Flex CharStyle:Code
13756 \begin_layout Plain Layout
13763 \begin_inset Flex CharStyle:Code
13766 \begin_layout Plain Layout
13775 \begin_layout Description
13776 \begin_inset Flex CharStyle:Code
13779 \begin_layout Plain Layout
13786 \begin_inset Flex CharStyle:Code
13789 \begin_layout Plain Layout
13796 \begin_inset Flex CharStyle:Code
13799 \begin_layout Plain Layout
13806 \begin_inset Flex CharStyle:Code
13809 \begin_layout Plain Layout
13818 \begin_inset Flex CharStyle:Code
13821 \begin_layout Plain Layout
13828 \begin_inset Flex CharStyle:Code
13831 \begin_layout Plain Layout
13838 \begin_inset Flex CharStyle:Code
13841 \begin_layout Plain Layout
13848 \begin_inset Flex CharStyle:Code
13851 \begin_layout Plain Layout
13858 \begin_inset Flex CharStyle:Code
13861 \begin_layout Plain Layout
13870 \begin_layout Subsection
13871 Upgrading old layout files
13874 \begin_layout Standard
13875 The file format of layout files changes from time to time, so old layout
13876 files need to be converted.
13877 This process has been automated since LyX 1.4.0: If LyX reads an old format
13878 layout file it will call the conversion tool
13879 \begin_inset Flex CharStyle:Code
13882 \begin_layout Plain Layout
13883 LyXDir/scripts/layout2layout.py
13888 and convert it to a temporary file in current format.
13889 The original file is left untouched.
13890 If you want to convert the layout file permanently, just call the converter
13894 \begin_layout LyX-Code
13895 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13898 \begin_layout Standard
13899 (You need to replace
13900 \begin_inset Flex CharStyle:Code
13903 \begin_layout Plain Layout
13909 with the name of your LyX system directory, unless you happen to have defined
13910 such an environment variable.) Then copy
13911 \begin_inset Flex CharStyle:Code
13914 \begin_layout Plain Layout
13921 \begin_inset Flex CharStyle:Code
13924 \begin_layout Plain Layout
13933 \begin_layout Standard
13934 The automatic conversion only handles syntax changes.
13935 It cannot handle the case where the contents of included files was changed,
13936 so these will have to be converted separately.
13939 \begin_layout Section
13941 \begin_inset CommandInset label
13943 name "sec:Creating-Templates"
13950 \begin_layout Standard
13951 Templates are created just like usual documents.
13952 The only difference is that usual documents contain all possible settings,
13953 including the font scheme and the paper size.
13954 Usually a user doesn't want a template to overwrite his defaults in these
13956 For that reason, the designer of a template should remove the corresponding
13958 \begin_inset Flex CharStyle:Code
13961 \begin_layout Plain Layout
13970 \begin_inset Flex CharStyle:Code
13973 \begin_layout Plain Layout
13981 from the template LyX file.
13982 This can be done with any simple text-editor, for example
13983 \begin_inset Flex CharStyle:Code
13986 \begin_layout Plain Layout
13993 \begin_inset Flex CharStyle:Code
13996 \begin_layout Plain Layout
14006 \begin_layout Standard
14007 Put the edited template files you create in
14008 \begin_inset Flex CharStyle:Code
14011 \begin_layout Plain Layout
14017 , copy the ones you use from the global template directory in
14018 \begin_inset Flex CharStyle:Code
14021 \begin_layout Plain Layout
14027 to the same place, and redefine the template path in the
14028 \begin_inset Flex CharStyle:MenuItem
14031 \begin_layout Plain Layout
14032 Tools\SpecialChar \menuseparator
14033 Preferences\SpecialChar \menuseparator
14042 \begin_layout Standard
14043 Note that there is a template which has a particular meaning:
14044 \begin_inset Flex CharStyle:Code
14047 \begin_layout Plain Layout
14054 This template is loaded every time you create a new document with
14055 \begin_inset Flex CharStyle:MenuItem
14058 \begin_layout Plain Layout
14059 File\SpecialChar \menuseparator
14065 in order to provide useful defaults.
14066 To create this template from inside LyX, all you have to do is to open
14067 a document with the correct settings, and use the
14068 \begin_inset Flex CharStyle:MenuItem
14071 \begin_layout Plain Layout
14072 Save as Document Defaults
14080 \begin_layout Chapter
14081 Including External Material
14084 \begin_layout Standard
14085 \begin_inset Box Shadowbox
14094 height_special "totalheight"
14097 \begin_layout Plain Layout
14098 WARNING: This portion of the documentation has not been updated for some
14100 We certainly hope that it is still accurate, but there are no guarantees.
14108 \begin_layout Standard
14109 The use of material from sources external to LyX is covered in detail in
14115 This part of the manual covers what needs to happen behind the scenes for
14116 new sorts of material to be included.
14119 \begin_layout Section
14123 \begin_layout Standard
14124 The external material feature is based on the concept of a
14129 A template is a specification of how LyX should interface with a certain
14131 As bundled, LyX comes with predefined templates for Xfig figures, various
14132 raster format images, chess diagrams, and LilyPond music notation.
14133 You can check the actual list by using the menu
14134 \begin_inset Flex CharStyle:MenuItem
14137 \begin_layout Plain Layout
14138 Insert\SpecialChar \menuseparator
14139 File\SpecialChar \menuseparator
14146 Furthermore, it is possible to roll your own template to support a specific
14148 Later we'll describe in more detail what is involved, and hopefully you
14149 will submit all the templates you create so we can include them in a later
14153 \begin_layout Standard
14154 Another basic idea of the external material feature is to distinguish between
14155 the original file that serves as a base for final material and the produced
14156 file that is included in your exported or printed document.
14157 For example, consider the case of a figure produced with
14158 \begin_inset Flex CharStyle:Code
14161 \begin_layout Plain Layout
14168 The Xfig application itself works on an original file with the
14169 \begin_inset Flex CharStyle:Code
14172 \begin_layout Plain Layout
14179 Within Xfig, you create and change your figure, and when you are done,
14181 \begin_inset Flex CharStyle:Code
14184 \begin_layout Plain Layout
14191 When you want to include the figure in your document, you invoke
14192 \begin_inset Flex CharStyle:Code
14195 \begin_layout Plain Layout
14201 in order to create a PostScript file that can readily be included in your
14204 \begin_inset Flex CharStyle:Code
14207 \begin_layout Plain Layout
14213 file is the original file, and the PostScript file is the produced file.
14216 \begin_layout Standard
14217 This distinction is important in order to allow updating of the material
14218 while you are in the process of writing the document.
14219 Furthermore, it provides us with the flexibility that is needed to support
14220 multiple export formats.
14221 For instance, in the case of a plain text file, it is not exactly an award-winn
14222 ing idea to include the figure as raw PostScript.
14223 Instead, you'd either prefer to just include a reference to the figure
14224 or try to invoke some graphics to ASCII converter to make the final result
14225 look similar to the real graphics.
14226 The external material management allows you to do this, because it is parametri
14227 zed on the different export formats that LyX supports.
14230 \begin_layout Standard
14231 Besides supporting the production of different products according to the
14232 exported format, it supports tight integration with editing and viewing
14234 In the case of an Xfig figure, you are able to invoke Xfig on the original
14235 file with a single click from within the external material dialog in LyX,
14236 and also preview the produced PostScript file with Ghostview with another
14238 No more fiddling around with the command line and/or file browsers to locate
14239 and manipulate the original or produced files.
14240 In this way, you are finally able to take full advantage of the many different
14241 applications that are relevant to use when you write your documents, and
14242 ultimately be more productive.
14245 \begin_layout Section
14246 The external template configuration file
14249 \begin_layout Standard
14250 It is relatively easy to add custom external template definitions to LyX.
14251 However, be aware that doing this in an careless manner most probably
14255 introduce an easily exploitable security hole.
14256 So before you do this, please read the discussion about security in section
14258 \begin_inset CommandInset ref
14260 reference "sec:Security-discussion"
14267 \begin_layout Standard
14268 Having said that, we encourage you to submit any interesting templates that
14273 \begin_layout Standard
14274 The external templates are defined in the
14275 \begin_inset Flex CharStyle:Code
14278 \begin_layout Plain Layout
14279 LyXDir/lib/external_templates
14285 You can place your own version in
14286 \begin_inset Flex CharStyle:Code
14289 \begin_layout Plain Layout
14290 UserDir/external_templates
14298 \begin_layout Standard
14299 A typical template looks like this:
14302 \begin_layout LyX-Code
14306 \begin_layout LyX-Code
14307 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14310 \begin_layout LyX-Code
14314 \begin_layout LyX-Code
14318 \begin_layout LyX-Code
14322 \begin_layout LyX-Code
14326 \begin_layout LyX-Code
14330 \begin_layout LyX-Code
14331 AutomaticProduction true
14334 \begin_layout LyX-Code
14338 \begin_layout LyX-Code
14342 \begin_layout LyX-Code
14346 \begin_layout LyX-Code
14347 TransformCommand Rotate RotationLatexCommand
14350 \begin_layout LyX-Code
14351 TransformCommand Resize ResizeLatexCommand
14354 \begin_layout LyX-Code
14355 Product "$$RotateFront$$ResizeFront
14358 \begin_layout LyX-Code
14363 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14366 \begin_layout LyX-Code
14367 $$ResizeBack$$RotateBack"
14370 \begin_layout LyX-Code
14374 \begin_layout LyX-Code
14375 UpdateResult "$$AbsPath$$Basename.pstex_t"
14378 \begin_layout LyX-Code
14379 Requirement "graphicx"
14382 \begin_layout LyX-Code
14383 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14386 \begin_layout LyX-Code
14387 ReferencedFile latex "$$AbsPath$$Basename.eps"
14390 \begin_layout LyX-Code
14391 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14394 \begin_layout LyX-Code
14398 \begin_layout LyX-Code
14402 \begin_layout LyX-Code
14403 TransformCommand Rotate RotationLatexCommand
14406 \begin_layout LyX-Code
14407 TransformCommand Resize ResizeLatexCommand
14410 \begin_layout LyX-Code
14411 Product "$$RotateFront$$ResizeFront
14414 \begin_layout LyX-Code
14419 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14422 \begin_layout LyX-Code
14423 $$ResizeBack$$RotateBack"
14426 \begin_layout LyX-Code
14427 UpdateFormat pdftex
14430 \begin_layout LyX-Code
14431 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14434 \begin_layout LyX-Code
14435 Requirement "graphicx"
14438 \begin_layout LyX-Code
14439 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14442 \begin_layout LyX-Code
14443 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14446 \begin_layout LyX-Code
14450 \begin_layout LyX-Code
14454 \begin_layout LyX-Code
14455 Product "$$Contents(
14457 "$$AbsPath$$Basename.asc
14462 \begin_layout LyX-Code
14463 UpdateFormat asciixfig
14466 \begin_layout LyX-Code
14467 UpdateResult "$$AbsPath$$Basename.asc"
14470 \begin_layout LyX-Code
14474 \begin_layout LyX-Code
14478 \begin_layout LyX-Code
14479 Product "<graphic fileref=
14481 "$$AbsOrRelPathMaster$$Basename.eps
14486 \begin_layout LyX-Code
14490 \begin_layout LyX-Code
14494 \begin_layout LyX-Code
14495 UpdateResult "$$AbsPath$$Basename.eps"
14498 \begin_layout LyX-Code
14499 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14502 \begin_layout LyX-Code
14503 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14506 \begin_layout LyX-Code
14510 \begin_layout LyX-Code
14511 Product "[XFig: $$FName]"
14514 \begin_layout LyX-Code
14518 \begin_layout LyX-Code
14522 \begin_layout Standard
14523 As you can see, the template is enclosed in
14524 \begin_inset Flex CharStyle:Code
14527 \begin_layout Plain Layout
14533 \SpecialChar \ldots{}
14535 \begin_inset Flex CharStyle:Code
14538 \begin_layout Plain Layout
14545 It contains a header specifying some general settings and, for each supported
14546 primary document file format, a section
14547 \begin_inset Flex CharStyle:Code
14550 \begin_layout Plain Layout
14556 \SpecialChar \ldots{}
14558 \begin_inset Flex CharStyle:Code
14561 \begin_layout Plain Layout
14570 \begin_layout Subsection
14571 The template header
14574 \begin_layout Description
14575 \begin_inset Flex CharStyle:Code
14578 \begin_layout Plain Layout
14579 AutomaticProduction
14580 \begin_inset space ~
14588 Whether the file represented by the template must be generated by LyX.
14589 This command must occur exactly once.
14592 \begin_layout Description
14593 \begin_inset Flex CharStyle:Code
14596 \begin_layout Plain Layout
14598 \begin_inset space ~
14606 A glob pattern that is used in the file dialog to filter out the desired
14608 If there is more than one possible file extension (e.
14609 \begin_inset space \thinspace{}
14613 \begin_inset space \space{}
14617 \begin_inset Flex CharStyle:Code
14620 \begin_layout Plain Layout
14627 \begin_inset Flex CharStyle:Code
14630 \begin_layout Plain Layout
14636 ), use something like
14637 \begin_inset Flex CharStyle:Code
14640 \begin_layout Plain Layout
14647 This command must occur exactly once.
14650 \begin_layout Description
14651 \begin_inset Flex CharStyle:Code
14654 \begin_layout Plain Layout
14656 \begin_inset space ~
14664 The text that is displayed on the button.
14665 This command must occur exactly once.
14668 \begin_layout Description
14669 \begin_inset Flex CharStyle:Code
14672 \begin_layout Plain Layout
14674 \begin_inset space ~
14678 \begin_inset space ~
14686 The help text that is used in the External dialog.
14687 Provide enough information to explain to the user just what the template
14688 can provide him with.
14689 This command must occur exactly once.
14692 \begin_layout Description
14693 \begin_inset Flex CharStyle:Code
14696 \begin_layout Plain Layout
14698 \begin_inset space ~
14706 The file format of the original file.
14707 This must be the name of a format that is known to LyX (see section
14708 \begin_inset CommandInset ref
14710 reference "sec:Formats"
14716 \begin_inset Quotes eld
14720 \begin_inset Flex CharStyle:Code
14723 \begin_layout Plain Layout
14730 \begin_inset Quotes erd
14733 if the template can handle original files of more than one format.
14734 LyX will attempt to interrogate the file itself in order to deduce its
14735 format in this case.
14736 This command must occur exactly once.
14739 \begin_layout Description
14740 \begin_inset Flex CharStyle:Code
14743 \begin_layout Plain Layout
14745 \begin_inset space ~
14753 A unique name for the template.
14754 It must not contain substitution macros (see below).
14757 \begin_layout Description
14758 \begin_inset Flex CharStyle:Code
14761 \begin_layout Plain Layout
14763 \begin_inset space ~
14766 Rotate|Resize|Clip|Extra
14771 This command specifies which transformations are supported by this template.
14772 It may occur zero or more times.
14773 This command enables the corresponding tabs in the external dialog.
14775 \begin_inset Flex CharStyle:Code
14778 \begin_layout Plain Layout
14784 command must have either a corresponding
14785 \begin_inset Flex CharStyle:Code
14788 \begin_layout Plain Layout
14795 \begin_inset Flex CharStyle:Code
14798 \begin_layout Plain Layout
14805 \begin_inset Flex CharStyle:Code
14808 \begin_layout Plain Layout
14815 Otherwise the transformation will not be supported by that format.
14818 \begin_layout Subsection
14822 \begin_layout Description
14823 \begin_inset Flex CharStyle:Code
14826 \begin_layout Plain Layout
14828 \begin_inset space ~
14831 LaTeX|PDFLaTeX|PlainText|DocBook
14836 The primary document file format that this format definition is for.
14837 Not every template has a sensible representation in all document file formats.
14838 Please define nevertheless a
14839 \begin_inset Flex CharStyle:Code
14842 \begin_layout Plain Layout
14848 section for all formats.
14849 Use a dummy text when no representation is available.
14850 Then you can at least see a reference to the external material in the exported
14854 \begin_layout Description
14855 \begin_inset Flex CharStyle:Code
14858 \begin_layout Plain Layout
14860 \begin_inset space ~
14864 \begin_inset space ~
14872 This command defines an additional macro
14873 \begin_inset Flex CharStyle:Code
14876 \begin_layout Plain Layout
14882 for substitution in
14883 \begin_inset Flex CharStyle:Code
14886 \begin_layout Plain Layout
14894 \begin_inset Flex CharStyle:Code
14897 \begin_layout Plain Layout
14903 itself may contain substitution macros.
14904 The advantage over using
14905 \begin_inset Flex CharStyle:Code
14908 \begin_layout Plain Layout
14915 \begin_inset Flex CharStyle:Code
14918 \begin_layout Plain Layout
14924 is that the substituted value of
14925 \begin_inset Flex CharStyle:Code
14928 \begin_layout Plain Layout
14934 is sanitized so that it is a valid optional argument in the document format.
14935 This command may occur zero or more times.
14938 \begin_layout Description
14939 \begin_inset Flex CharStyle:Code
14942 \begin_layout Plain Layout
14944 \begin_inset space ~
14952 The text that is inserted in the exported document.
14953 This is actually the most important command and can be quite complex.
14954 This command must occur exactly once.
14957 \begin_layout Description
14958 \begin_inset Flex CharStyle:Code
14961 \begin_layout Plain Layout
14963 \begin_inset space ~
14971 This command specifies a preamble snippet that will be included in the
14973 It has to be defined using
14974 \begin_inset Flex CharStyle:Code
14977 \begin_layout Plain Layout
14983 \SpecialChar \ldots{}
14985 \begin_inset Flex CharStyle:Code
14988 \begin_layout Plain Layout
14995 This command may occur zero or more times.
14998 \begin_layout Description
14999 \begin_inset Flex CharStyle:Code
15002 \begin_layout Plain Layout
15004 \begin_inset space ~
15008 \begin_inset space ~
15016 This command denotes files that are created by the conversion process and
15017 are needed for a particular export format.
15018 If the filename is relative, it is interpreted relative to the master document.
15019 This command may be given zero or more times.
15022 \begin_layout Description
15023 \begin_inset Flex CharStyle:Code
15026 \begin_layout Plain Layout
15028 \begin_inset space ~
15036 The name of a required LaTeX package.
15037 The package is included via
15038 \begin_inset Flex CharStyle:Code
15041 \begin_layout Plain Layout
15049 in the LaTeX preamble.
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 ~
15063 \begin_inset space ~
15066 RotationLatexCommand
15071 This command specifies that the built in LaTeX command should be used for
15073 This command may occur once or not at all.
15076 \begin_layout Description
15077 \begin_inset Flex CharStyle:Code
15080 \begin_layout Plain Layout
15082 \begin_inset space ~
15086 \begin_inset space ~
15094 This command specifies that the built in LaTeX command should be used for
15096 This command may occur once or not at all.
15099 \begin_layout Description
15100 \begin_inset Flex CharStyle:Code
15103 \begin_layout Plain Layout
15105 \begin_inset space ~
15109 \begin_inset space ~
15112 RotationLatexOption
15117 This command specifies that rotation is done via an optional argument.
15118 This command may occur once or not at all.
15121 \begin_layout Description
15122 \begin_inset Flex CharStyle:Code
15125 \begin_layout Plain Layout
15127 \begin_inset space ~
15131 \begin_inset space ~
15139 This command specifies that resizing is done via an optional argument.
15140 This command may occur once or not at all.
15143 \begin_layout Description
15144 \begin_inset Flex CharStyle:Code
15147 \begin_layout Plain Layout
15149 \begin_inset space ~
15153 \begin_inset space ~
15161 This command specifies that clipping is done via an optional argument.
15162 This command may occur once or not at all.
15165 \begin_layout Description
15166 \begin_inset Flex CharStyle:Code
15169 \begin_layout Plain Layout
15171 \begin_inset space ~
15175 \begin_inset space ~
15183 This command specifies that an extra optional argument is used.
15184 This command may occur once or not at all.
15187 \begin_layout Description
15188 \begin_inset Flex CharStyle:Code
15191 \begin_layout Plain Layout
15193 \begin_inset space ~
15201 The file format of the converted file.
15202 This must be the name of a format that is known to LyX (see the
15203 \begin_inset Flex CharStyle:MenuItem
15206 \begin_layout Plain Layout
15211 ools\SpecialChar \menuseparator
15216 references:Conversion
15222 This command must occur exactly once.
15225 \begin_layout Description
15226 \begin_inset Flex CharStyle:Code
15229 \begin_layout Plain Layout
15231 \begin_inset space ~
15239 The file name of the converted file.
15240 The file name must be absolute.
15241 This command must occur exactly once.
15244 \begin_layout Subsection
15245 Preamble definitions
15248 \begin_layout Standard
15249 The external template configuration file may contain additional preamble
15250 definitions enclosed by
15251 \begin_inset Flex CharStyle:Code
15254 \begin_layout Plain Layout
15260 \SpecialChar \ldots{}
15262 \begin_inset Flex CharStyle:Code
15265 \begin_layout Plain Layout
15272 They can be used by the templates in the
15273 \begin_inset Flex CharStyle:Code
15276 \begin_layout Plain Layout
15285 \begin_layout Section
15286 The substitution mechanism
15289 \begin_layout Standard
15290 When the external material facility invokes an external program, it is done
15291 on the basis of a command defined in the template configuration file.
15292 These commands can contain various macros that are expanded before execution.
15293 Execution always take place in the directory of the containing document.
15296 \begin_layout Standard
15297 Also, whenever external material is to be displayed, the name will be produced
15298 by the substitution mechanism, and most other commands in the template
15299 definition support substitution as well.
15302 \begin_layout Standard
15303 The available macros are the following:
15306 \begin_layout Description
15307 \begin_inset Flex CharStyle:Code
15310 \begin_layout Plain Layout
15311 $$AbsOrRelPathMaster
15316 The file path, absolute or relative to the master LyX document.
15319 \begin_layout Description
15320 \begin_inset Flex CharStyle:Code
15323 \begin_layout Plain Layout
15324 $$AbsOrRelPathParent
15329 The file path, absolute or relative to the LyX document.
15332 \begin_layout Description
15333 \begin_inset Flex CharStyle:Code
15336 \begin_layout Plain Layout
15342 The absolute file path.
15345 \begin_layout Description
15346 \begin_inset Flex CharStyle:Code
15349 \begin_layout Plain Layout
15355 The filename without path and without the extension.
15358 \begin_layout Description
15359 \begin_inset Flex CharStyle:Code
15362 \begin_layout Plain Layout
15364 \begin_inset Quotes eld
15368 \begin_inset Quotes erd
15376 This macro will expand to the contents of the file with the name
15377 \begin_inset Flex CharStyle:Code
15380 \begin_layout Plain Layout
15389 \begin_layout Description
15390 \begin_inset Flex CharStyle:Code
15393 \begin_layout Plain Layout
15399 The file extension (including the dot).
15402 \begin_layout Description
15403 \begin_inset Flex CharStyle:Code
15406 \begin_layout Plain Layout
15412 The filename of the file specified in the external material dialog.
15413 This is either an absolute name, or it is relative to the LyX document.
15416 \begin_layout Description
15417 \begin_inset Flex CharStyle:Code
15420 \begin_layout Plain Layout
15427 \begin_inset Flex CharStyle:Code
15430 \begin_layout Plain Layout
15436 (absolute name or relative to the LyX document).
15439 \begin_layout Description
15440 \begin_inset Flex CharStyle:Code
15443 \begin_layout Plain Layout
15449 The file path, relative to the master LyX document.
15452 \begin_layout Description
15453 \begin_inset Flex CharStyle:Code
15456 \begin_layout Plain Layout
15462 The file path, relative to the LyX document.
15465 \begin_layout Description
15466 \begin_inset Flex CharStyle:Code
15469 \begin_layout Plain Layout
15475 This macro will expand to the absolute path of the system directory.
15476 This is typically used to point to the various helper scripts that are
15480 \begin_layout Description
15481 \begin_inset Flex CharStyle:Code
15484 \begin_layout Plain Layout
15490 A name and full path to a temporary file which will be automatically deleted
15491 whenever the containing document is closed, or the external material insertion
15495 \begin_layout Standard
15496 All path macros contain a trailing directory separator, so you can construct
15498 \begin_inset space \thinspace{}
15502 \begin_inset space \space{}
15505 the absolute filename with
15506 \begin_inset Flex CharStyle:Code
15509 \begin_layout Plain Layout
15510 $$AbsPath$$Basename$$Extension
15518 \begin_layout Standard
15519 The macros above are substituted in all commands unless otherwise noted.
15521 \begin_inset Flex CharStyle:Code
15524 \begin_layout Plain Layout
15530 supports additionally the following substitutions if they are enabled by
15532 \begin_inset Flex CharStyle:Code
15535 \begin_layout Plain Layout
15542 \begin_inset Flex CharStyle:Code
15545 \begin_layout Plain Layout
15554 \begin_layout Description
15555 \begin_inset Flex CharStyle:Code
15558 \begin_layout Plain Layout
15564 The front part of the resize command.
15567 \begin_layout Description
15568 \begin_inset Flex CharStyle:Code
15571 \begin_layout Plain Layout
15577 The back part of the resize command.
15580 \begin_layout Description
15581 \begin_inset Flex CharStyle:Code
15584 \begin_layout Plain Layout
15590 The front part of the rotation command.
15593 \begin_layout Description
15594 \begin_inset Flex CharStyle:Code
15597 \begin_layout Plain Layout
15603 The back part of the rotation command.
15606 \begin_layout Standard
15607 The value string of the
15608 \begin_inset Flex CharStyle:Code
15611 \begin_layout Plain Layout
15617 command supports additionally the following substitutions if they are enabled
15619 \begin_inset Flex CharStyle:Code
15622 \begin_layout Plain Layout
15629 \begin_inset Flex CharStyle:Code
15632 \begin_layout Plain Layout
15641 \begin_layout Description
15642 \begin_inset Flex CharStyle:Code
15645 \begin_layout Plain Layout
15654 \begin_layout Description
15655 \begin_inset Flex CharStyle:Code
15658 \begin_layout Plain Layout
15667 \begin_layout Description
15668 \begin_inset Flex CharStyle:Code
15671 \begin_layout Plain Layout
15680 \begin_layout Description
15681 \begin_inset Flex CharStyle:Code
15684 \begin_layout Plain Layout
15690 The rotation option.
15693 \begin_layout Standard
15694 You may ask why there are so many path macros.
15695 There are mainly two reasons:
15698 \begin_layout Enumerate
15699 Relative and absolute file names should remain relative or absolute, respectivel
15701 Users may have reasons to prefer either form.
15702 Relative names are useful for portable documents that should work on different
15703 machines, for example.
15704 Absolute names may be required by some programs.
15707 \begin_layout Enumerate
15708 LaTeX treats relative file names differently than LyX and other programs
15709 in nested included files.
15710 For LyX, a relative file name is always relative to the document that contains
15712 For LaTeX, it is always relative to the master document.
15713 These two definitions are identical if you have only one document, but
15714 differ if you have a master document that includes part documents.
15715 That means that relative filenames must be transformed when presented to
15717 Fortunately LyX does this automatically for you if you choose the right
15721 \begin_layout Standard
15722 So which path macro should be used in new template definitions? The rule
15726 \begin_layout Itemize
15728 \begin_inset Flex CharStyle:Code
15731 \begin_layout Plain Layout
15737 if an absolute path is required.
15740 \begin_layout Itemize
15742 \begin_inset Flex CharStyle:Code
15745 \begin_layout Plain Layout
15746 $$AbsOrRelPathMaster
15751 if the substituted string is some kind of LaTeX input.
15754 \begin_layout Itemize
15756 \begin_inset Flex CharStyle:Code
15759 \begin_layout Plain Layout
15760 $$AbsOrRelPathParent
15765 in order to preserve the user's choice.
15768 \begin_layout Standard
15769 There are special cases where this rule does not work and e.
15770 \begin_inset space \thinspace{}
15774 \begin_inset space \space{}
15777 relative names are needed, but normally it will work just fine.
15778 One example for such a case is the command
15779 \begin_inset Flex CharStyle:Code
15782 \begin_layout Plain Layout
15783 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15788 in the XFig template above: We can't use the absolute name because the
15790 \begin_inset Flex CharStyle:Code
15793 \begin_layout Plain Layout
15799 files needs the relative name in order to rewrite the file content.
15802 \begin_layout Section
15803 Security discussion
15804 \begin_inset CommandInset label
15806 name "sec:Security-discussion"
15813 \begin_layout Standard
15814 The external material feature interfaces with a lot of external programs
15815 and does so automatically, so we have to consider the security implications
15817 In particular, since you have the option of including your own filenames
15818 and/or parameter strings and those are expanded into a command, it seems
15819 that it would be possible to create a malicious document which executes
15820 arbitrary commands when a user views or prints the document.
15821 This is something we definitely want to avoid.
15824 \begin_layout Standard
15825 However, since the external program commands are specified in the template
15826 configuration file only, there are no security issues if LyX is properly
15827 configured with safe templates only.
15828 This is so because the external programs are invoked with the
15829 \begin_inset Flex CharStyle:Code
15832 \begin_layout Plain Layout
15838 -system call rather than the
15839 \begin_inset Flex CharStyle:Code
15842 \begin_layout Plain Layout
15848 system-call, so it's not possible to execute arbitrary commands from the
15849 filename or parameter section via the shell.
15852 \begin_layout Standard
15853 This also implies that you are restricted in what command strings you can
15854 use in the external material templates.
15855 In particular, pipes and redirection are not readily available.
15856 This has to be so if LyX should remain safe.
15857 If you want to use some of the shell features, you should write a safe
15858 script to do this in a controlled manner, and then invoke the script from
15859 the command string.
15863 \begin_layout Standard
15864 It is possible to design a template that interacts directly with the shell,
15865 but since this would allow a malicious user to execute arbitrary commands
15866 by writing clever filenames and/or parameters, we generally recommend that
15867 you only use safe scripts that work with the
15868 \begin_inset Flex CharStyle:Code
15871 \begin_layout Plain Layout
15877 system call in a controlled manner.
15878 Of course, for use in a controlled environment, it can be tempting to just
15879 fall back to use ordinary shell scripts.
15880 If you do so, be aware that you
15884 provide an easily exploitable security hole in your system.
15885 Of course it stands to reason that such unsafe templates will never be
15886 included in the standard LyX distribution, although we do encourage people
15887 to submit new templates in the open source tradition.
15888 But LyX as shipped from the official distribution channels will never have
15892 \begin_layout Standard
15893 Including external material provides a lot of power, and you have to be
15894 careful not to introduce security hazards with this power.
15895 A subtle error in a single line in an innocent looking script can open
15896 the door to huge security problems.
15897 So if you do not fully understand the issues, we recommend that you consult
15898 a knowledgeable security professional or the LyX development team if you
15899 have any questions about whether a given template is safe or not.
15900 And do this before you use it in an uncontrolled environment.