1 #LyX 1.6.0rc5 created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that the User's Guide prints
10 % out as advertised. If you mess with this preamble,
11 % parts of the User's Guide may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
39 % used for multi-column text
43 \options fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
44 \use_default_options false
50 InsetLayout CharStyle:MenuItem
59 \newcommand*{\menuitem}[1]{{\sffamily #1}}
67 \font_typewriter default
68 \font_default_family default
78 \pdf_title "LyX Configuration Manual"
79 \pdf_author "LyX Team"
80 \pdf_subject "LyX-documentation Customization"
81 \pdf_keywords "LyX, documentation, customization"
83 \pdf_bookmarksnumbered true
84 \pdf_bookmarksopen true
85 \pdf_bookmarksopenlevel 1
90 \pdf_pdfusetitle false
91 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
98 \paperorientation portrait
105 \paragraph_separation indent
107 \quotes_language english
110 \paperpagestyle headings
111 \tracking_changes false
112 \output_changes false
120 Customizing LyX: Features for the Advanced User
128 \begin_layout Plain Layout
130 If you have comments or error corrections, please send them to the LyX Documenta
132 \begin_inset CommandInset href
134 target "lyx-docs@lists.lyx.org"
141 \begin_inset Quotes eld
145 \begin_inset Quotes erd
148 in the subject header, and please cc the current maintainer of this file,
149 Richard Heck <rgheck@comcast.net>.
157 \begin_layout Standard
158 \begin_inset CommandInset toc
159 LatexCommand tableofcontents
166 \begin_layout Chapter
170 \begin_layout Standard
171 This manual covers the customization features present in LyX.
172 In it, we discuss issues like keyboard shortcuts, screen previewing options,
173 printer options, sending commands to LyX via the LyX Server, internationalizati
174 on, installing new LaTeX classes and LyX layouts, etc.
175 We can't possibly hope to touch on everything you can change---our developers
176 add new features faster than we can document them---but we will explain
177 the most common customizations and hopefully point you in the right direction
178 for some of the more obscure ones.
181 \begin_layout Standard
182 \begin_inset Branch OutDated
185 \begin_layout Standard
186 Information from previous versions of this document that now seems to be
187 outdated is contained in the OutDated branch of this document.
188 By default, this information will not appear in the LaTeX output.
196 \begin_layout Chapter
197 LyX configuration files
200 \begin_layout Standard
201 This chapter aims to help you to find your way through the LyX configuration
203 Before continuing to read this chapter, you should find out where your
204 LyX library and user directories are by using
205 \begin_inset Flex CharStyle:MenuItem
208 \begin_layout Plain Layout
213 elp\SpecialChar \menuseparator
226 The library directory is the place where LyX places its system-wide configurati
227 on files; the user directory is where you can place your modified versions.
228 We will call the former
229 \begin_inset Flex CharStyle:Code
232 \begin_layout Plain Layout
239 \begin_inset Flex CharStyle:MenuItem
242 \begin_layout Plain Layout
248 in the remainder of this document.
252 \begin_layout Section
254 \begin_inset Flex CharStyle:Code
257 \begin_layout Plain Layout
266 \begin_layout Standard
267 \begin_inset Flex CharStyle:Code
270 \begin_layout Plain Layout
276 and its sub-directories contain a number of files and that can be used
277 to customise LyX's behaviour.
278 You can change many of these files from within LyX itself through the
279 \begin_inset Flex CharStyle:MenuItem
282 \begin_layout Plain Layout
283 Tools\SpecialChar \menuseparator
290 Most customization that you will want to do in LyX is possible through
292 However, many other inner aspects of LyX can be customized by modifying
294 \begin_inset Flex CharStyle:Code
297 \begin_layout Plain Layout
304 These files fall in different categories, described in the following subsection
308 \begin_layout Subsection
309 Automatically generated files
312 \begin_layout Standard
313 The files, which are to be found in
314 \begin_inset Flex CharStyle:MenuItem
317 \begin_layout Plain Layout
323 , are generated when you configure LyX.
324 They contain various default values that are guessed by inspection.
325 In general, it is not a good idea to modify them, since they might be overwritt
329 \begin_layout Labeling
330 \labelwidthstring 00.00.0000
331 \begin_inset Flex CharStyle:Code
334 \begin_layout Plain Layout
340 contains defaults for various commands.
343 \begin_layout Labeling
344 \labelwidthstring 00.00.0000
345 \begin_inset Flex CharStyle:Code
348 \begin_layout Plain Layout
354 contains the list of packages that have been recognized by LyX.
355 It is currently unused by the LyX program itself, but the information extracted
356 , and more, is made available with
357 \begin_inset Flex CharStyle:MenuItem
360 \begin_layout Plain Layout
365 elp\SpecialChar \menuseparator
382 \begin_layout Labeling
383 \labelwidthstring 00.00.0000
384 \begin_inset Flex CharStyle:Code
387 \begin_layout Plain Layout
393 the list of text classes that have been found in your
394 \begin_inset Flex CharStyle:Code
397 \begin_layout Plain Layout
403 directories, along with the associated LaTeX document class and their descripti
407 \begin_layout Labeling
408 \labelwidthstring 00.00.0000
409 \begin_inset Flex CharStyle:Code
412 \begin_layout Plain Layout
418 the list of layout modules found in your
419 \begin_inset Flex CharStyle:Code
422 \begin_layout Plain Layout
431 \begin_layout Labeling
432 \labelwidthstring 00.00.0000
433 \begin_inset Flex CharStyle:Code
436 \begin_layout Plain Layout
442 lists of various sorts of LaTeX-related files found on your system
445 \begin_layout Labeling
446 \labelwidthstring 00.00.0000
447 \begin_inset Flex CharStyle:Code
450 \begin_layout Plain Layout
456 is automatically generated during configuration from the file
457 \begin_inset Flex CharStyle:Code
460 \begin_layout Plain Layout
467 It contains information on your LaTeX configuration.
470 \begin_layout Subsection
474 \begin_layout Standard
475 These directories are duplicated between
476 \begin_inset Flex CharStyle:Code
479 \begin_layout Plain Layout
486 \begin_inset Flex CharStyle:Code
489 \begin_layout Plain Layout
496 If a particular files exists in both places, the one in
497 \begin_inset Flex CharStyle:Code
500 \begin_layout Plain Layout
509 \begin_layout Labeling
510 \labelwidthstring 00.00.0000
511 \begin_inset Flex CharStyle:Code
514 \begin_layout Plain Layout
520 this directory contains files with the extension
521 \begin_inset Flex CharStyle:Code
524 \begin_layout Plain Layout
530 that define the keybindings used in LyX.
531 If there exists an internationalized version of the bind file named
532 \begin_inset Flex CharStyle:Code
535 \begin_layout Plain Layout
541 , that will be used first.
544 \begin_layout Labeling
545 \labelwidthstring 00.00.0000
546 \begin_inset Flex CharStyle:Code
549 \begin_layout Plain Layout
555 contains graphics files that can be included in documents.
559 \begin_layout Labeling
560 \labelwidthstring 00.00.0000
561 \begin_inset Flex CharStyle:Code
564 \begin_layout Plain Layout
570 contains LyX documentation files (including the one you are currently reading).
572 \begin_inset Flex CharStyle:Code
575 \begin_layout Plain Layout
581 deserves special attention, as noted above.
582 If there exists an internationalized version of the help-document with
584 \begin_inset Flex CharStyle:Code
587 \begin_layout Plain Layout
593 prepended to the name, that will be used first.
599 \begin_inset CommandInset ref
601 reference "chap:i18n"
608 \begin_layout Labeling
609 \labelwidthstring 00.00.0000
610 \begin_inset Flex CharStyle:Code
613 \begin_layout Plain Layout
619 contains example files that explain how to use some features.
620 In the file browser, press the
621 \begin_inset Flex CharStyle:MenuItem
624 \begin_layout Plain Layout
633 \begin_layout Labeling
634 \labelwidthstring 00.00.0000
635 \begin_inset Flex CharStyle:Code
638 \begin_layout Plain Layout
644 contains image files that are used by the
645 \begin_inset Flex CharStyle:MenuItem
648 \begin_layout Plain Layout
655 In addition, it also contains the individual icons used in the toolbar
656 and the banners that can be shown when LyX is launched.
659 \begin_layout Labeling
660 \labelwidthstring 00.00.0000
661 \begin_inset Flex CharStyle:Code
664 \begin_layout Plain Layout
670 contains keyboard keymapping files.
676 \begin_inset CommandInset ref
678 reference "sec:keymap"
685 \begin_layout Labeling
686 \labelwidthstring 00.00.0000
687 \begin_inset Flex CharStyle:Code
690 \begin_layout Plain Layout
696 contains the text class and module files described in Chapter
701 \begin_inset CommandInset ref
703 reference "chap:textclass"
710 \begin_layout Labeling
711 \labelwidthstring 00.00.0000
712 \begin_inset Flex CharStyle:Code
715 \begin_layout Plain Layout
722 \begin_inset Flex CharStyle:Code
725 \begin_layout Plain Layout
731 Python scripts used to convert between LyX versions.
732 These can be run from the command line if, say, you want to batch-convert
736 \begin_layout Labeling
737 \labelwidthstring 00.00.0000
738 \begin_inset Flex CharStyle:Code
741 \begin_layout Plain Layout
747 contains some files that demonstrate the capabilities of the
748 \begin_inset Flex CharStyle:MenuItem
751 \begin_layout Plain Layout
762 Also contains some scripts used by LyX itself.
765 \begin_layout Labeling
766 \labelwidthstring 00.00.0000
767 \begin_inset Flex CharStyle:Code
770 \begin_layout Plain Layout
776 contains the standard LyX template files described in Chapter
781 \begin_inset CommandInset ref
783 reference "sec:templates"
790 \begin_layout Labeling
791 \labelwidthstring 00.00.0000
792 \begin_inset Flex CharStyle:Code
795 \begin_layout Plain Layout
801 contains files with the extension
802 \begin_inset Flex CharStyle:Code
805 \begin_layout Plain Layout
811 that define the user interface to LyX.
812 That is, the files define which items appear in which menus and the items
813 appearing on the toolbar.
816 \begin_layout Subsection
817 Files you don't want to modify
820 \begin_layout Standard
821 These files are used internally by LyX and you generally do not need to
822 modify them unless you are a developer.
825 \begin_layout Labeling
826 \labelwidthstring 00.00.0000
827 \begin_inset Flex CharStyle:Code
830 \begin_layout Plain Layout
836 this file contains the list of LyX developers.
837 The contents are displayed with the menu entry
838 \begin_inset Flex CharStyle:MenuItem
841 \begin_layout Plain Layout
846 elp\SpecialChar \menuseparator
859 \begin_layout Labeling
860 \labelwidthstring 00.00.0000
861 \begin_inset Flex CharStyle:Code
864 \begin_layout Plain Layout
870 this is a LaTeX script used during the configuration process.
874 \begin_layout Labeling
875 \labelwidthstring 00.00.0000
876 \begin_inset Flex CharStyle:Code
879 \begin_layout Plain Layout
885 this is the script that is used to re-configure LyX.
886 It creates configuration files in the directory it was run from.
889 \begin_layout Subsection
890 Other files needing a line or two...
893 \begin_layout Labeling
894 \labelwidthstring 00.00.0000
895 \begin_inset Flex CharStyle:Code
898 \begin_layout Plain Layout
904 this contains tables describing how different character encodings can be
908 \begin_layout Labeling
909 \labelwidthstring 00.00.0000
910 \begin_inset Flex CharStyle:Code
913 \begin_layout Plain Layout
919 this file contains the templates available to the new
920 \begin_inset Flex CharStyle:MenuItem
923 \begin_layout Plain Layout
936 \begin_layout Labeling
937 \labelwidthstring 00.00.0000
938 \begin_inset Flex CharStyle:Code
941 \begin_layout Plain Layout
947 this file contains a list of all the languages currently supported by LyX.
950 \begin_layout Section
951 Your local configuration directory
954 \begin_layout Standard
955 Even if you are using LyX as an unprivileged user, you might want to change
956 LyX configuration for your own use.
958 \begin_inset Flex CharStyle:Code
961 \begin_layout Plain Layout
967 directory contains all your personal configuration files.
968 This is the directory described as
969 \begin_inset Quotes eld
973 \begin_inset Quotes erd
977 \begin_inset Flex CharStyle:MenuItem
980 \begin_layout Plain Layout
985 elp\SpecialChar \menuseparator
996 This directory is used as a mirror of
997 \begin_inset Flex CharStyle:Code
1000 \begin_layout Plain Layout
1006 , which means that every file in
1007 \begin_inset Flex CharStyle:Code
1010 \begin_layout Plain Layout
1016 is a replacement for the corresponding file in
1017 \begin_inset Flex CharStyle:Code
1020 \begin_layout Plain Layout
1027 Any configuration file described in the above sections can be placed either
1028 in the system-wide directory, in which case it will affect all users, or
1029 in your local directory for your own use.
1032 \begin_layout Standard
1033 To make things clearer, let's provide a few examples:
1036 \begin_layout Itemize
1037 The preferences set in the
1038 \begin_inset Flex CharStyle:MenuItem
1041 \begin_layout Plain Layout
1046 ools\SpecialChar \menuseparator
1056 dialog are saved to a file
1057 \begin_inset Flex CharStyle:Code
1060 \begin_layout Plain Layout
1067 \begin_inset Flex CharStyle:Code
1070 \begin_layout Plain Layout
1079 \begin_layout Itemize
1080 When you reconfigure using
1081 \begin_inset Flex CharStyle:MenuItem
1084 \begin_layout Plain Layout
1089 ools\SpecialChar \menuseparator
1100 \begin_inset Flex CharStyle:Code
1103 \begin_layout Plain Layout
1109 script, and the resulting files are written in your local configuration
1111 This means that any additional text class file that you might have added
1113 \begin_inset Flex CharStyle:Code
1116 \begin_layout Plain Layout
1122 will be added to the list of classes in the
1123 \begin_inset Flex CharStyle:MenuItem
1126 \begin_layout Plain Layout
1127 Document\SpecialChar \menuseparator
1136 \begin_layout Itemize
1137 If you get some updated documentation from LyX ftp site and cannot install
1138 it because you do not have sysadmin rights on your system, you can just
1140 \begin_inset Flex CharStyle:Code
1143 \begin_layout Plain Layout
1149 and the items in the
1150 \begin_inset Flex CharStyle:MenuItem
1153 \begin_layout Plain Layout
1163 menu will open them!
1166 \begin_layout Section
1167 Running LyX with multiple configurations
1170 \begin_layout Standard
1171 The configuration freedom of the local configuration directory may not suffice
1172 if you want to have more than one configuration at your disposal.
1173 For example, you may want to be use different key bindings or printer settings
1175 You can achieve this by having several such directories.
1176 You then specify which directory to use at run-time.
1179 \begin_layout Standard
1180 Invoking LyX with the command line switch
1181 \begin_inset Flex CharStyle:Code
1184 \begin_layout Plain Layout
1194 instructs the program to read the configuration from that directory, and
1195 not from the default directory.
1196 (You can determine the default directory by running LyX without the
1197 \begin_inset Flex CharStyle:Code
1200 \begin_layout Plain Layout
1206 switch.) If the specified directory does not exist, LyX offers to create
1207 it for you, just like it does for the default directory on the first time
1208 you run the program.
1209 You can modify the configuration options in this additional user directory
1210 exactly as you would for the default directory.
1211 These directories are completely independent (but read on).
1212 Note that setting the environment variable
1213 \begin_inset Flex CharStyle:Code
1216 \begin_layout Plain Layout
1222 to some value has exactly the same effect.
1225 \begin_layout Standard
1226 Having several configurations also requires more maintenance: if you want
1227 to add a new layout to
1228 \begin_inset Flex CharStyle:Code
1231 \begin_layout Plain Layout
1237 which you want available from all your configurations, you must add it
1238 to each directory separately.
1239 You can avoid this with the following trick: after LyX creates the additional
1240 directory, most of the subdirectories (see above) are empty.
1241 If you want the new configuration to mirror an existing one, replace the
1242 empty subdirectory with a symbolic link to the matching subdirectory in
1243 the existing configuration.
1245 \begin_inset Flex CharStyle:Code
1248 \begin_layout Plain Layout
1254 subirectory, however, since it contains a file written by the configuration
1255 script (also accessible through
1256 \begin_inset Flex CharStyle:MenuItem
1259 \begin_layout Plain Layout
1264 ools\SpecialChar \menuseparator
1274 ) which is configuration-specific.
1277 \begin_layout Chapter
1278 The Preferences dialog
1281 \begin_layout Standard
1282 All options of the preferences dialog are described in the Appendix
1284 The Preferences Dialog
1291 For some options you might find here more details.
1294 \begin_layout Section
1295 Using the dialog for the first time
1298 \begin_layout Standard
1300 \begin_inset Flex CharStyle:Code
1303 \begin_layout Plain Layout
1309 file will contain only changes that you have made to the default behavior,
1310 some of which is hard-coded into LyX and some of which is contained in
1312 \begin_inset Flex CharStyle:Code
1315 \begin_layout Plain Layout
1316 LyXDir/lyxrc.defaults
1322 Note that in both files lines beginning with a
1323 \begin_inset Quotes eld
1327 \begin_inset Quotes erd
1330 are just comments and are not interpreted.
1331 However, only system administrators should edit
1332 \begin_inset Flex CharStyle:Code
1335 \begin_layout Plain Layout
1336 LyXDir/lyxrc.defaults
1342 Users should use the
1343 \begin_inset Flex CharStyle:MenuItem
1346 \begin_layout Plain Layout
1347 Tools\SpecialChar \menuseparator
1353 dialog to create and modify their own
1354 \begin_inset Flex CharStyle:Code
1357 \begin_layout Plain Layout
1366 \begin_layout Standard
1368 \begin_inset Flex CharStyle:MenuItem
1371 \begin_layout Plain Layout
1372 Tools\SpecialChar \menuseparator
1378 dialog will be largely self-explanatory.
1379 Most things in the dialog have associated `tool tips': hover your mouse
1380 pointer over something for more information.
1381 Before we highlight a few of the more important commands below, however,
1382 a word of warning: Applying some of your changes (e.
1383 \begin_inset space \thinspace{}
1387 \begin_inset space \space{}
1390 screen fonts) will have an instant effect.
1392 \begin_inset space \thinspace{}
1396 \begin_inset space \space{}
1399 changing the bind file) will not.
1400 If nothing appears to have changed, just
1401 \begin_inset Flex CharStyle:MenuItem
1404 \begin_layout Plain Layout
1410 the changes and restart LyX.
1413 \begin_layout Section
1417 \begin_layout Standard
1418 LyX has a powerful mechanism to convert to and from any file format using
1423 \begin_layout Subsection
1424 \begin_inset CommandInset label
1433 \begin_layout Standard
1434 The first step is to define your file formats if they are not already defined.
1436 \begin_inset Flex CharStyle:MenuItem
1439 \begin_layout Plain Layout
1440 Tools\SpecialChar \menuseparator
1441 Preferences\SpecialChar \menuseparator
1442 File Handling\SpecialChar \menuseparator
1450 \begin_inset Flex CharStyle:MenuItem
1453 \begin_layout Plain Layout
1454 New\SpecialChar \ldots{}
1460 button to define your new format.
1462 \begin_inset Flex CharStyle:MenuItem
1465 \begin_layout Plain Layout
1471 field contains the named used to identify the format in the GUI.
1473 \begin_inset Flex CharStyle:MenuItem
1476 \begin_layout Plain Layout
1482 is used to identify the format interally.
1483 You will also need to enter a file extension.
1484 These are all required.
1486 \begin_inset Flex CharStyle:MenuItem
1489 \begin_layout Plain Layout
1495 field is used to provide a keyboard shortcut on the menus.
1496 (For example, pressing
1497 \begin_inset Flex CharStyle:MenuItem
1500 \begin_layout Plain Layout
1507 \begin_inset Flex CharStyle:MenuItem
1510 \begin_layout Plain Layout
1511 View\SpecialChar \menuseparator
1520 \begin_layout Standard
1522 \begin_inset Flex CharStyle:MenuItem
1525 \begin_layout Plain Layout
1532 \begin_inset Flex CharStyle:MenuItem
1535 \begin_layout Plain Layout
1542 For example, you might want to use
1543 \begin_inset Flex CharStyle:MenuItem
1546 \begin_layout Plain Layout
1552 to view PostScript files.
1553 You can enter the command needed to start the program in the corresponding
1555 In defining this command, you can use the four variables listed in the
1557 The viewer is launched when you view an image in LyX or use the
1558 \begin_inset Flex CharStyle:MenuItem
1561 \begin_layout Plain Layout
1568 The editor is for example launched when you press the
1569 \begin_inset Flex CharStyle:MenuItem
1572 \begin_layout Plain Layout
1579 \begin_inset Flex CharStyle:MenuItem
1582 \begin_layout Plain Layout
1589 \begin_inset Flex CharStyle:MenuItem
1592 \begin_layout Plain Layout
1601 \begin_layout Standard
1603 \begin_inset Flex CharStyle:MenuItem
1606 \begin_layout Plain Layout
1612 option tells LyX that a format is suitable for document export.
1613 If this is is set and if a suitable conversion route exists (see
1614 \begin_inset CommandInset ref
1616 reference "sub:Converters"
1620 ), the format will appear in the
1621 \begin_inset Flex CharStyle:MenuItem
1624 \begin_layout Plain Layout
1625 File\SpecialChar \menuseparator
1632 The format will also appear in the
1633 \begin_inset Flex CharStyle:MenuItem
1636 \begin_layout Plain Layout
1642 menu if a viewer is specified for the format.
1643 Pure image formats, such as
1644 \begin_inset Flex CharStyle:Code
1647 \begin_layout Plain Layout
1653 , should not use this option.
1654 Formats that can both represent vector graphics and documents like
1655 \begin_inset Flex CharStyle:Code
1658 \begin_layout Plain Layout
1667 \begin_layout Standard
1669 \begin_inset Flex CharStyle:MenuItem
1672 \begin_layout Plain Layout
1673 Vector graphics format
1678 tells LyX that a format can contain vector graphics.
1679 This information is used to determine the target format of included graphics
1681 \begin_inset Flex CharStyle:MenuItem
1684 \begin_layout Plain Layout
1691 Included graphics may need to be converted to either
1692 \begin_inset Flex CharStyle:MenuItem
1695 \begin_layout Plain Layout
1702 \begin_inset Flex CharStyle:MenuItem
1705 \begin_layout Plain Layout
1712 \begin_inset Flex CharStyle:MenuItem
1715 \begin_layout Plain Layout
1722 \begin_inset Flex CharStyle:MenuItem
1725 \begin_layout Plain Layout
1731 cannot handle other image formats.
1732 If an included graphic is not already in
1733 \begin_inset Flex CharStyle:MenuItem
1736 \begin_layout Plain Layout
1743 \begin_inset Flex CharStyle:MenuItem
1746 \begin_layout Plain Layout
1753 \begin_inset Flex CharStyle:MenuItem
1756 \begin_layout Plain Layout
1762 format, it is converted to
1763 \begin_inset Flex CharStyle:MenuItem
1766 \begin_layout Plain Layout
1772 if the vector format option is set, and otherwise to
1773 \begin_inset Flex CharStyle:MenuItem
1776 \begin_layout Plain Layout
1785 \begin_layout Subsection
1789 \begin_layout Standard
1790 Since all conversions from one format to another take place in LyX's temporary
1791 directory, it is sometimes necessary to modify a file before copying it
1792 to the temporary directory in order that the conversion may be performed.
1796 \begin_layout Plain Layout
1797 For example, the file may refer to other files---images, for example---using
1798 relative file names, and these may become invalid when the file is copied
1799 to the temporary directory.
1804 This is done by a Copier: It copies a file to (or from) the temporary directory
1805 and may modify it in the process.
1808 \begin_layout Standard
1809 The definitions of the copiers may use four variables:
1812 \begin_layout Labeling
1813 \labelwidthstring 00.00.0000
1814 \begin_inset Flex CharStyle:Code
1817 \begin_layout Plain Layout
1823 The LyX system directory (e.
1824 \begin_inset space \thinspace{}
1828 \begin_inset space \space{}
1832 \begin_inset Flex CharStyle:MenuItem
1835 \begin_layout Plain Layout
1844 \begin_layout Labeling
1845 \labelwidthstring 00.00.0000
1846 \begin_inset Flex CharStyle:Code
1849 \begin_layout Plain Layout
1858 \begin_layout Labeling
1859 \labelwidthstring 00.00.0000
1860 \begin_inset Flex CharStyle:Code
1863 \begin_layout Plain Layout
1872 \begin_layout Labeling
1873 \labelwidthstring 00.00.0000
1874 \begin_inset Flex CharStyle:Code
1877 \begin_layout Plain Layout
1886 \begin_layout Standard
1887 The latter should be the filename as it would be used in a LaTeX's
1894 It is relevant only when exporting files suitable for such inclusion.
1897 \begin_layout Standard
1898 Copiers can be used to do almost anything with output files.
1899 For example, suppose you want generated pdf files to be copied to a special
1901 \begin_inset Flex CharStyle:Code
1904 \begin_layout Plain Layout
1911 Then you could write a shell script such as this one:
1914 \begin_layout Standard
1915 \begin_inset listings
1919 \begin_layout Plain Layout
1924 \begin_layout Plain Layout
1929 \begin_layout Plain Layout
1931 TOFILE=`basename $2`
1934 \begin_layout Plain Layout
1936 cp $FROMFILE /home/you/pdf/$TOFILE
1941 Save that in your local LyX directory---say,
1942 \begin_inset Flex CharStyle:Code
1945 \begin_layout Plain Layout
1946 /home/you/.lyx/scripts/pdfcopier.sh
1951 ---and make it executable, if you need to do so on your platform.
1953 \begin_inset Flex CharStyle:MenuItem
1956 \begin_layout Plain Layout
1957 Tools\SpecialChar \menuseparator
1964 \begin_inset Flex CharStyle:MenuItem
1967 \begin_layout Plain Layout
1973 format---or one of the other pdf formats---and enter
1974 \begin_inset Flex CharStyle:Code
1977 \begin_layout Plain Layout
1978 pdfcopier.sh $$i $$o
1984 \begin_inset Flex CharStyle:MenuItem
1987 \begin_layout Plain Layout
1997 \begin_layout Standard
1998 Copiers are used by LyX in various of its own conversions.
1999 For example, if appropriate programs are found, LyX will automatically
2000 install copiers for the
2001 \begin_inset Flex CharStyle:MenuItem
2004 \begin_layout Plain Layout
2011 \begin_inset Flex CharStyle:MenuItem
2014 \begin_layout Plain Layout
2016 \begin_inset space ~
2025 When these formats are exported, the copier sees that not just the main
2026 HTML file but various associated files (style files, images, etc.) are also
2028 All these files are written to a subdirectory of the directory in which
2029 the original LyX file was found.
2033 \begin_layout Plain Layout
2034 This copier can be customized.
2036 \begin_inset Quotes eld
2040 \begin_inset Quotes erd
2043 argument takes a comma-separated list of extensions to be copied; if it
2044 is omitted, all files will be copied.
2046 \begin_inset Quotes eld
2050 \begin_inset Quotes erd
2053 argument determines the extension added to the generated directory.
2055 \begin_inset Quotes eld
2059 \begin_inset Flex CharStyle:MenuItem
2062 \begin_layout Plain Layout
2069 \begin_inset Quotes erd
2072 , so HTML generated from
2073 \begin_inset Flex CharStyle:MenuItem
2076 \begin_layout Plain Layout
2077 /path/to/filename.lyx
2083 \begin_inset Flex CharStyle:MenuItem
2086 \begin_layout Plain Layout
2087 /path/to/filename.html.LyXconv
2101 \begin_layout Subsection
2102 \begin_inset CommandInset label
2104 name "sub:Converters"
2111 \begin_layout Standard
2112 You can define your own Converters to, uhh, convert files between different
2115 \begin_inset Flex CharStyle:MenuItem
2118 \begin_layout Plain Layout
2119 Tools\SpecialChar \menuseparator
2120 Preferences\SpecialChar \menuseparator
2121 File Handling\SpecialChar \menuseparator
2130 \begin_layout Standard
2131 To define a new converter, select the
2132 \begin_inset Flex CharStyle:MenuItem
2135 \begin_layout Plain Layout
2137 \begin_inset space ~
2146 \begin_inset Flex CharStyle:MenuItem
2149 \begin_layout Plain Layout
2151 \begin_inset space ~
2159 from the drop-down lists, enter the command needed for the conversion,
2161 \begin_inset Flex CharStyle:MenuItem
2164 \begin_layout Plain Layout
2171 Several variables can be used in the definition of converters:
2174 \begin_layout Labeling
2175 \labelwidthstring 00.00.0000
2176 \begin_inset Flex CharStyle:Code
2179 \begin_layout Plain Layout
2185 The LyX system directory
2188 \begin_layout Labeling
2189 \labelwidthstring 00.00.0000
2190 \begin_inset Flex CharStyle:Code
2193 \begin_layout Plain Layout
2202 \begin_layout Labeling
2203 \labelwidthstring 00.00.0000
2204 \begin_inset Flex CharStyle:Code
2207 \begin_layout Plain Layout
2216 \begin_layout Labeling
2217 \labelwidthstring 00.00.0000
2218 \begin_inset Flex CharStyle:Code
2221 \begin_layout Plain Layout
2227 The base filename of the input file (i.
2228 \begin_inset space \thinspace{}
2231 g., without the extension)
2234 \begin_layout Labeling
2235 \labelwidthstring 00.00.0000
2236 \begin_inset Flex CharStyle:Code
2239 \begin_layout Plain Layout
2245 The path to the input file
2248 \begin_layout Standard
2250 \begin_inset Flex CharStyle:MenuItem
2253 \begin_layout Plain Layout
2255 \begin_inset space ~
2263 field you can enter the following flags, separated by commas:
2266 \begin_layout Labeling
2267 \labelwidthstring 00.00.0000
2268 \begin_inset Flex CharStyle:Code
2271 \begin_layout Plain Layout
2277 This converter runs some form of LaTeX.
2278 This will make LyX's LaTeX error logs available.
2281 \begin_layout Labeling
2282 \labelwidthstring 00.00.0000
2283 \begin_inset Flex CharStyle:Code
2286 \begin_layout Plain Layout
2293 \begin_inset Flex CharStyle:MenuItem
2296 \begin_layout Plain Layout
2302 file for the conversion.
2305 \begin_layout Labeling
2306 \labelwidthstring 00.00.0000
2307 \begin_inset Flex CharStyle:Code
2310 \begin_layout Plain Layout
2319 \begin_layout Standard
2320 The following three flags are not really flags at all because they take
2322 \begin_inset Flex CharStyle:MenuItem
2325 \begin_layout Plain Layout
2327 \begin_inset space ~
2331 \begin_inset space ~
2342 \begin_layout Labeling
2343 \labelwidthstring 00.00.0000
2344 \begin_inset Flex CharStyle:Code
2347 \begin_layout Plain Layout
2353 If set, the converter's standard error will be redirected to a file
2354 \begin_inset Flex CharStyle:Code
2357 \begin_layout Plain Layout
2363 , and the script given as argument will be run as:
2364 \begin_inset Flex CharStyle:Code
2367 \begin_layout Plain Layout
2368 script <infile.out >infile.log
2374 The argument may contain
2375 \begin_inset Flex CharStyle:Code
2378 \begin_layout Plain Layout
2387 \begin_layout Labeling
2388 \labelwidthstring 00.00.0000
2389 \begin_inset Flex CharStyle:Code
2392 \begin_layout Plain Layout
2398 The name of the directory in which the converter will dump the generated
2400 LyX will not create this directory, and it does not copy anything into
2401 it, though it will copy this directory to the destination.
2402 The argument may contain
2403 \begin_inset Flex CharStyle:Code
2406 \begin_layout Plain Layout
2412 , which will be replaced by the base name of the input and output files,
2413 respectively, when the directory is copied.
2414 \begin_inset Newline newline
2417 Note that resultdir and usetempdir make no sense together.
2418 The latter will be ignored if the former is given.
2421 \begin_layout Labeling
2422 \labelwidthstring 00.00.0000
2423 \begin_inset Flex CharStyle:Code
2426 \begin_layout Plain Layout
2432 Determines the output file name and may, contain
2433 \begin_inset Flex CharStyle:Code
2436 \begin_layout Plain Layout
2443 Sensible only with resultdir and optional even then; if not given, it defaults
2447 \begin_layout Standard
2448 None of these last three are presently used in any of the converters that
2449 are installed with LyX.
2453 \begin_layout Standard
2454 You do not have to define converters between all the formats between which
2455 you want to convert.
2456 For example, you will note that there is no `LyX to PostScript®' converter,
2457 but LyX will export PostScript®.
2458 It does so by first creating a LaTeX file (no converter needs to be defined
2459 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2460 and finally converting the resulting DVI file to PostScript®.
2461 LyX finds such `chains' of converters automatically, and it will always
2462 choose the shortest possible chain.
2463 You can, though, still define multiple conversion methods between file
2465 For example, the standard LyX configuration provides three ways to convert
2466 LaTeX to PDF: Directly, using
2467 \begin_inset Flex CharStyle:MenuItem
2470 \begin_layout Plain Layout
2476 ; via (DVI and) PostScript®, using
2477 \begin_inset Flex CharStyle:MenuItem
2480 \begin_layout Plain Layout
2487 \begin_inset Flex CharStyle:MenuItem
2490 \begin_layout Plain Layout
2497 To define such alternate chains, you must define multiple target `file
2498 formats', as described in section
2499 \begin_inset CommandInset ref
2501 reference "sub:Formats"
2506 For example, in the standard configuration, the formats named
2507 \begin_inset Flex CharStyle:MenuItem
2510 \begin_layout Plain Layout
2517 \begin_inset Flex CharStyle:MenuItem
2520 \begin_layout Plain Layout
2527 \begin_inset Flex CharStyle:MenuItem
2530 \begin_layout Plain Layout
2536 are defined, all of which share the extension
2537 \begin_inset Flex CharStyle:MenuItem
2540 \begin_layout Plain Layout
2546 , and which correspond to the conversion methods just mentioned.
2549 \begin_layout Chapter
2550 Internationalizing LyX
2551 \begin_inset CommandInset label
2560 \begin_layout Standard
2561 LyX supports using a translated interface.
2562 Last time we checked, LyX provided text in thirty languages.
2563 The language of choice is called your
2568 (For further reading on locale settings, see also the documentation for
2569 locale that comes with your operating system.
2570 For Linux, the manual page for
2571 \begin_inset Flex CharStyle:Code
2574 \begin_layout Plain Layout
2580 could be a good place to start).
2583 \begin_layout Standard
2584 Notice that these translations will work, but do contain a few flaws.
2585 In particular, all dialogs have been designed with the English text in
2586 mind, which means that some of the translated text will be too large to
2587 fit within the space allocated.
2588 This is only a display problem and will not cause any harm.
2589 Also, you will find that some of the translations do not define shortcut
2590 keys for everything.
2591 Sometimes, there are simply not enough free letters to do it.
2592 Other times, the translator just hasn't got around to doing it yet.
2593 Our localization team, which you may wish to join,
2597 \begin_layout Plain Layout
2598 If you are a fluent speaker of a language other than English, joining these
2599 teams is a great way to give back to the LyX community!
2604 will of course try to fix these shortcomings in future versions of LyX.
2607 \begin_layout Section
2611 \begin_layout Subsection
2612 Translating the graphical user interface (text messages).
2615 \begin_layout Standard
2617 \begin_inset Flex CharStyle:Code
2620 \begin_layout Plain Layout
2626 library to handle the internationalization of the interface.
2627 To have LyX speak your favorite language in all menus and dialogs, you
2629 \begin_inset Flex CharStyle:Code
2632 \begin_layout Plain Layout
2638 -file for that language.
2639 When this is available, you'll have to generate a
2640 \begin_inset Flex CharStyle:Code
2643 \begin_layout Plain Layout
2649 -file from it and install the
2650 \begin_inset Flex CharStyle:Code
2653 \begin_layout Plain Layout
2660 The process of doing all of this is explained in the documentation for
2662 \begin_inset Flex CharStyle:Code
2665 \begin_layout Plain Layout
2672 It is possible to do this just for yourself, but if you're going to do
2673 it, you might as well share the results of your labors with the rest of
2675 Send a message to the LyX developers' list for more information about how
2679 \begin_layout Standard
2680 In short, this is what you should do (xx denotes the language code):
2683 \begin_layout Itemize
2684 Check out the LyX source code.
2686 \begin_inset CommandInset href
2688 name "information on the web"
2689 target "http://www.lyx.org/devel/cvs.php"
2696 \begin_layout Itemize
2698 \begin_inset Flex CharStyle:Code
2701 \begin_layout Plain Layout
2707 to the folder of the
2708 \begin_inset Flex CharStyle:Code
2711 \begin_layout Plain Layout
2719 \begin_inset Flex CharStyle:Code
2722 \begin_layout Plain Layout
2730 \begin_inset Flex CharStyle:Code
2733 \begin_layout Plain Layout
2739 doesn't exist anywhere, it can be remade with the console command
2740 \begin_inset Flex CharStyle:Code
2743 \begin_layout Plain Layout
2749 in that directory, or you can use an existing po-file for some other language
2753 \begin_layout Itemize
2755 \begin_inset Flex CharStyle:Code
2758 \begin_layout Plain Layout
2768 \begin_layout Plain Layout
2769 This is just a text file, so it can be edited in any text editor.
2770 But there are also specialized programs that support such editing, such
2775 (for all platforms) or
2784 contains a `mode' for editing
2785 \begin_inset Flex CharStyle:Code
2788 \begin_layout Plain Layout
2799 For some menu- and widget-labels, there are also shortcut keys that should
2801 Those keys are marked after a `|', and should be translated according to
2802 the words and phrases of the language.
2803 You should also fill also out the information at the beginning of the new
2805 \begin_inset Flex CharStyle:Code
2808 \begin_layout Plain Layout
2814 -file with your email-address, etc., so people know where to reach you with
2815 suggestions and entertaining flames.
2818 \begin_layout Standard
2819 If you are just doing this on your own, then:
2822 \begin_layout Itemize
2824 \begin_inset Flex CharStyle:Code
2827 \begin_layout Plain Layout
2834 This can be done with
2835 \begin_inset Flex CharStyle:Code
2838 \begin_layout Plain Layout
2839 msgfmt -o xx.mo < xx.po
2847 \begin_layout Itemize
2849 \begin_inset Flex CharStyle:Code
2852 \begin_layout Plain Layout
2858 -file to your locale-tree, at the correct directory for application messages
2863 xx, and under the name
2864 \begin_inset Flex CharStyle:Code
2867 \begin_layout Plain Layout
2874 \begin_inset space \thinspace{}
2878 \begin_inset space \space{}
2882 \begin_inset Flex CharStyle:Code
2885 \begin_layout Plain Layout
2886 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2896 \begin_layout Standard
2897 As said, however, it would be best if the new
2898 \begin_inset Flex CharStyle:Code
2901 \begin_layout Plain Layout
2907 -file could be added to the LyX distribution, so others can use it.
2908 Adding it involves making additional changes to LyX.
2909 So send an email to the developers' mailing list if you're interested in
2913 \begin_layout Subsubsection
2917 \begin_layout Standard
2918 Sometimes it turns out that one English message needs to be translated into
2919 different messages in the target language.
2920 One example is the message
2921 \begin_inset Flex CharStyle:Code
2924 \begin_layout Plain Layout
2930 which has the German translation
2938 , depending upon exactly what the English
2939 \begin_inset Quotes eld
2943 \begin_inset Quotes erd
2948 \begin_inset Flex CharStyle:Code
2951 \begin_layout Plain Layout
2957 does not handle such ambigous translations.
2958 Therefore you have to add some context information to the message: Instead
2960 \begin_inset Flex CharStyle:Code
2963 \begin_layout Plain Layout
2970 \begin_inset Flex CharStyle:Code
2973 \begin_layout Plain Layout
2974 To[[as in 'From format x to format y']]
2980 \begin_inset Flex CharStyle:Code
2983 \begin_layout Plain Layout
2984 To[[as in 'From page x to page y']].
2989 Now the two occurences of
2990 \begin_inset Flex CharStyle:Code
2993 \begin_layout Plain Layout
3000 \begin_inset Flex CharStyle:Code
3003 \begin_layout Plain Layout
3009 and can be translated correctly to
3020 \begin_layout Standard
3021 Of course the context information needs to be stripped off the original
3022 message when no translation is used.
3023 Therefore you have to put it in double square brackets at the end of the
3024 message (see the example above).
3025 The translation mechanism of LyX ensures that everything in double square
3026 brackets at the end of messages is removed before displaying the message.
3029 \begin_layout Subsection
3030 Translating the documentation.
3033 \begin_layout Standard
3034 The online documentation (in the
3035 \begin_inset Flex CharStyle:MenuItem
3038 \begin_layout Plain Layout
3048 -menu) can (and should!) be translated.
3049 If there are translated versions of the documentation available
3053 \begin_layout Plain Layout
3054 As of March 2008, at least some of the documents have been translated into
3055 fourteen languages, with the Tutorial available in a few more.
3060 and the locale is set accordingly, these will be used automagically by
3062 LyX looks for translated versions as
3063 \begin_inset Flex CharStyle:Code
3066 \begin_layout Plain Layout
3067 LyXDir/doc/xx_DocName.lyx
3073 \begin_inset Flex CharStyle:Code
3076 \begin_layout Plain Layout
3082 is the code for the language currently in use.
3083 If there are no translated documents, the default English versions will
3085 Note that the translated versions must have the same filenames (
3086 \begin_inset Flex CharStyle:Code
3089 \begin_layout Plain Layout
3095 above) as the original.
3096 If you feel up to translating the documentation (an excellent way to proof-read
3097 the original documentation by the way!), there are a few things you should
3101 \begin_layout Itemize
3103 \begin_inset Flex CharStyle:Code
3106 \begin_layout Plain Layout
3112 , the guide to writing LyX documentation.
3113 Pay special attention to the translator's section.
3116 \begin_layout Itemize
3117 Check out the documentation translation web page at
3118 \begin_inset CommandInset href
3120 name "http://www.lyx.org/Translation"
3121 target "http://www.lyx.org/Translation"
3126 That way, you can find out which (if any) documents have already been translate
3127 d into your language.
3128 You can also find out who (if anyone) is organizing the effort to translate
3129 the documentation into your language.
3130 If no one is organizing the effort, please let us know that you're interested.
3133 \begin_layout Standard
3134 Once you get to actually translating, here's a few hints for you that may
3138 \begin_layout Itemize
3139 Join the documentation team! There is information on how to do that in
3140 \begin_inset Flex CharStyle:Code
3143 \begin_layout Plain Layout
3150 \begin_inset Flex CharStyle:MenuItem
3153 \begin_layout Plain Layout
3158 elp\SpecialChar \menuseparator
3168 ), which by the way is the first document you should translate.
3171 \begin_layout Itemize
3172 Learn the typographic conventions for the language you are translating to.
3173 Typography is an ancient art and over the centuries, a great variety of
3174 conventions have developed throughout different parts of the world.
3175 Also study the professional terminology amongst typographers in your country.
3176 Inventing your own terminology will only confuse the users.
3179 (Warning! Typography is addictive!)
3182 \begin_layout Itemize
3183 Make a copy of the document.
3184 This will be your working copy.
3185 You can use this as your personal translated help-file by placing it in
3187 \begin_inset Flex CharStyle:Code
3190 \begin_layout Plain Layout
3199 \begin_layout Itemize
3200 Sometimes the original document (from the LyX-team) will be updated.
3201 Use the source viewer at
3202 \begin_inset CommandInset href
3204 name "http://www.lyx.org/trac/timeline"
3205 target "http://www.lyx.org/trac/timeline"
3209 to see what has been changed.
3210 That way you can easily see which parts of the translated document need
3214 \begin_layout Standard
3215 If you ever find an error in the original document, fix it and notify the
3216 rest of the documentation team of the changes! (You didn't forget to join
3217 the documentation team, did you?)
3220 \begin_layout Standard
3221 \begin_inset Branch OutDated
3224 \begin_layout Section
3225 International Keyboard Support
3228 \begin_layout Standard
3231 [Editor's Note: The following section is by
3239 It needs to be fixed to conform to the new Documentation Style sheet and
3240 to make use of the new v1.0 features.
3241 The whole thing also needs to be merged with the section following it.-jw
3242 It may also be badly out of date.-rh (2008)]
3245 \begin_layout Subsection
3246 Defining Own Keymaps: Keymap File Format
3249 \begin_layout Standard
3250 Let's look at a keyboard definition file a little closer.
3251 It is a plain text file defining
3254 \begin_layout Itemize
3255 key-to-key or key-to-string translations
3258 \begin_layout Itemize
3262 \begin_layout Itemize
3263 dead keys exceptions
3266 \begin_layout Standard
3267 To define key-to-key or key-to-string translation, use this command:
3270 \begin_layout Quotation
3271 \begin_inset Flex CharStyle:Code
3274 \begin_layout Plain Layout
3283 \begin_inset Flex CharStyle:Code
3286 \begin_layout Plain Layout
3295 \begin_layout Standard
3297 \begin_inset Flex CharStyle:Code
3300 \begin_layout Plain Layout
3306 is the key to be translated and
3307 \begin_inset Flex CharStyle:Code
3310 \begin_layout Plain Layout
3316 is the string to be inserted into the document.
3317 To define dead keys, use:
3320 \begin_layout Quotation
3321 \begin_inset Flex CharStyle:Code
3324 \begin_layout Plain Layout
3333 \begin_inset Flex CharStyle:Code
3336 \begin_layout Plain Layout
3345 \begin_layout Standard
3347 \begin_inset Flex CharStyle:Code
3350 \begin_layout Plain Layout
3356 is a keyboard key and
3357 \begin_inset Flex CharStyle:Code
3360 \begin_layout Plain Layout
3367 The following dead keys are supported (shortcut name is in parentheses):
3370 \begin_layout Quotation
3374 \begin_inset space \hfill{}
3380 \begin_layout Quotation
3382 \begin_inset space \hfill{}
3388 \begin_layout Quotation
3390 \begin_inset space \hfill{}
3396 \begin_layout Quotation
3398 \begin_inset space \hfill{}
3404 \begin_layout Quotation
3406 \begin_inset space \hfill{}
3412 \begin_layout Quotation
3414 \begin_inset space \hfill{}
3421 \begin_layout Plain Layout
3433 \begin_layout Quotation
3435 \begin_inset space \hfill{}
3441 \begin_layout Quotation
3443 \begin_inset space \hfill{}
3450 \begin_layout Plain Layout
3462 \begin_layout Quotation
3464 \begin_inset space \hfill{}
3470 \begin_layout Quotation
3472 \begin_inset space \hfill{}
3478 \begin_layout Quotation
3480 \begin_inset space \hfill{}
3487 \begin_layout Plain Layout
3499 \begin_layout Quotation
3501 \begin_inset space \hfill{}
3508 \begin_layout Plain Layout
3520 \begin_layout Quotation
3522 \begin_inset space \hfill{}
3528 \begin_layout Quotation
3529 hungarian umlaut (hug)
3530 \begin_inset space \hfill{}
3536 \begin_layout Quotation
3538 \begin_inset space \hfill{}
3544 \begin_layout Quotation
3546 \begin_inset space \hfill{}
3553 \begin_layout Plain Layout
3565 \begin_layout Standard
3566 Since in many international keyboards there are exceptions to what some
3567 dead keys should do, you can define them using
3570 \begin_layout Quotation
3571 \begin_inset Flex CharStyle:Code
3574 \begin_layout Plain Layout
3582 deadkey key outstring
3585 \begin_layout Standard
3586 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3590 \begin_layout Quotation
3591 \begin_inset Flex CharStyle:Code
3594 \begin_layout Plain Layout
3607 \begin_layout Standard
3608 to make it work correctly.
3609 Also, you have to define as exceptions dead keys over i and j, to remove
3610 the dot from them before inserting an accent mark.
3611 I will change this when the time comes, but so far I haven't had time.
3614 \begin_layout Standard
3615 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3618 \begin_inset Flex CharStyle:Code
3621 \begin_layout Plain Layout
3627 have different meaning.
3629 \begin_inset Flex CharStyle:Code
3632 \begin_layout Plain Layout
3638 marks comments, quotes start and end LaTeX-style commands.
3639 To enter quote, you'll need to use
3640 \begin_inset Flex CharStyle:Code
3643 \begin_layout Plain Layout
3652 \begin_inset Flex CharStyle:Code
3655 \begin_layout Plain Layout
3662 \begin_inset Flex CharStyle:Code
3665 \begin_layout Plain Layout
3676 \begin_layout Standard
3677 If you make a keyboard description file that works for your language, please
3678 mail it to me, so I can include it in the next keymap distribution.
3681 \begin_layout Standard
3682 More keywords will be supported in keymap configuration file in future,
3686 \begin_layout Itemize
3687 \begin_inset Flex CharStyle:Code
3690 \begin_layout Plain Layout
3701 \begin_inset space \hfill{}
3705 \begin_inset Flex CharStyle:Code
3708 \begin_layout Plain Layout
3717 \begin_layout Itemize
3718 \begin_inset Flex CharStyle:Code
3721 \begin_layout Plain Layout
3732 \begin_inset space \hfill{}
3736 \begin_inset Flex CharStyle:Code
3739 \begin_layout Plain Layout
3745 an external keymap translation program
3748 \begin_layout Standard
3749 Also, it should look into
3750 \begin_inset Flex CharStyle:Code
3753 \begin_layout Plain Layout
3759 file for defaults, too (for example, a
3760 \begin_inset Flex CharStyle:Code
3763 \begin_layout Plain Layout
3771 option to include default keyboard).
3779 \begin_layout Section
3780 \begin_inset CommandInset label
3786 International Keymap Stuff
3789 \begin_layout Standard
3790 \begin_inset Note Note
3793 \begin_layout Plain Layout
3794 In doing the revisions on this document in March 2008, I did not look over
3795 this stuff, as I do not understand it.
3796 It would be good if someone else could do so.
3804 \begin_layout Standard
3805 The next two sections describe the
3806 \begin_inset Flex CharStyle:Code
3809 \begin_layout Plain Layout
3818 \begin_inset Flex CharStyle:Code
3821 \begin_layout Plain Layout
3829 file syntax in detail.
3830 These sections should help you design your own key map if the ones provided
3831 do not meet your needs.
3834 \begin_layout Subsection
3838 \begin_layout Standard
3842 \begin_inset Flex CharStyle:Code
3845 \begin_layout Plain Layout
3851 file maps keystrokes to characters or strings.
3852 As the name suggests, it sets a keyboard mapping.
3854 \begin_inset Flex CharStyle:Code
3857 \begin_layout Plain Layout
3868 \begin_inset Flex CharStyle:Code
3871 \begin_layout Plain Layout
3886 \begin_inset Flex CharStyle:Code
3889 \begin_layout Plain Layout
3902 \begin_inset Flex CharStyle:Code
3905 \begin_layout Plain Layout
3914 \begin_inset Flex CharStyle:Code
3917 \begin_layout Plain Layout
3925 are described in this section.
3928 \begin_layout Labeling
3929 \labelwidthstring 00.00.0000
3930 \begin_inset Flex CharStyle:Code
3933 \begin_layout Plain Layout
3941 Map a character to a string
3944 \begin_layout LyX-Code
3959 \begin_layout Standard
3992 the double-quote (")
4009 must be escaped with a preceding backslash (
4020 \begin_layout Standard
4022 \begin_inset Flex CharStyle:MenuItem
4025 \begin_layout Plain Layout
4033 statement to cause the symbol
4034 \begin_inset Flex CharStyle:MenuItem
4037 \begin_layout Plain Layout
4045 to be output for the keystroke
4046 \begin_inset Flex CharStyle:MenuItem
4049 \begin_layout Plain Layout
4060 \begin_layout LyX-Code
4066 \begin_layout Labeling
4067 \labelwidthstring 00.00.0000
4068 \begin_inset Flex CharStyle:Code
4071 \begin_layout Plain Layout
4079 Specify an accent character
4082 \begin_layout LyX-Code
4091 \begin_layout Standard
4092 This will make the cha
4130 This is the dead key
4134 \begin_layout Plain Layout
4141 refers to a key that does not produce a character by itself, but when followed
4142 with another key, produces the desired accent character.
4143 For example, a German characte
4145 r with an umlaut like
4155 can be produced in this manner.
4164 \begin_layout Standard
4177 and then another key not in
4194 followed by the other, unallowed key, as output.
4198 \begin_inset Flex CharStyle:MenuItem
4201 \begin_layout Plain Layout
4209 cancels a dead key, so if
4220 \begin_inset Flex CharStyle:MenuItem
4223 \begin_layout Plain Layout
4232 , the cursor will not go one position backwards but will instead cancel
4248 might have had on the next keystroke.
4252 \begin_layout Standard
4253 The following example specifies that the character ' is to be an acute accent,
4254 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4257 \begin_layout LyX-Code
4260 kmod ' acute aeiouAEIOU
4263 \begin_layout Labeling
4264 \labelwidthstring 00.00.0000
4265 \begin_inset Flex CharStyle:Code
4268 \begin_layout Plain Layout
4274 Specify an exception to the accent character
4277 \begin_layout LyX-Code
4286 \begin_layout Standard
4287 This defines an exce
4328 have been assigned a keystroke with a previous
4331 \begin_inset Flex CharStyle:Code
4334 \begin_layout Plain Layout
4358 must not belong in the
4405 If such a declaration does not exist in
4413 \begin_inset Flex CharStyle:Code
4416 \begin_layout Plain Layout
4450 \begin_inset Flex CharStyle:Code
4453 \begin_layout Plain Layout
4467 \begin_layout Standard
4468 The following command produces causes äi to be produced when you enter acute-i
4472 \begin_layout LyX-Code
4486 \begin_layout Labeling
4487 \labelwidthstring 00.00.0000
4488 \begin_inset Flex CharStyle:Code
4491 \begin_layout Plain Layout
4497 Combine two accent characters
4500 \begin_layout LyX-Code
4506 accent1 accent2 allowed
4509 \begin_layout Standard
4510 This one is getting pretty esoteric.
4511 It allows you to combine the effect
4567 \begin_inset Flex CharStyle:Code
4570 \begin_layout Plain Layout
4598 \begin_layout Standard
4599 Consider this example from the
4600 \begin_inset Flex CharStyle:Code
4603 \begin_layout Plain Layout
4614 \begin_layout LyX-Code
4617 kmod ; acute aeioyvhAEIOYVH
4621 kcomb acute umlaut iyIY
4624 \begin_layout Standard
4625 This allows you to press
4626 \begin_inset Flex CharStyle:MenuItem
4629 \begin_layout Plain Layout
4637 and get the effect of
4638 \begin_inset Flex CharStyle:Code
4641 \begin_layout Plain Layout
4660 in this case cancels the last dead key, so if you press
4661 \begin_inset Flex CharStyle:MenuItem
4664 \begin_layout Plain Layout
4673 \begin_inset Flex CharStyle:Code
4676 \begin_layout Plain Layout
4689 \begin_layout Subsection
4693 \begin_layout Standard
4695 \begin_inset Flex CharStyle:Code
4698 \begin_layout Plain Layout
4706 mapping is performed, a
4707 \begin_inset Flex CharStyle:Code
4710 \begin_layout Plain Layout
4720 file maps the strings that the symbols generate to characters in the current
4722 The LyX distribution currently includes at least the
4723 \begin_inset Flex CharStyle:Code
4726 \begin_layout Plain Layout
4735 \begin_inset Flex CharStyle:Code
4738 \begin_layout Plain Layout
4749 \begin_layout Standard
4751 \begin_inset Flex CharStyle:Code
4754 \begin_layout Plain Layout
4762 file is a sequence of declarations of the form
4765 \begin_layout LyX-Code
4778 \begin_layout Standard
4779 For example, in order to map
4780 \begin_inset Flex CharStyle:MenuItem
4783 \begin_layout Plain Layout
4793 to the corresponding character in the iso-8859-1 set (233), the following
4797 \begin_layout LyX-Code
4805 \begin_layout Standard
4807 \begin_inset Flex CharStyle:Code
4810 \begin_layout Plain Layout
4819 \begin_inset Flex CharStyle:Code
4822 \begin_layout Plain Layout
4840 the same character can apply to more than one string.
4842 \begin_inset Flex CharStyle:Code
4845 \begin_layout Plain Layout
4856 \begin_layout LyX-Code
4868 \begin_inset Newline newline
4884 \begin_layout Standard
4885 If LyX cannot find a mapping for the string produced by the keystroke or
4886 a deadkey sequence, it will check if it looks like an accented char and
4887 try to draw an accent over the character on screen.
4890 \begin_layout Subsection
4894 \begin_layout Standard
4895 There is a second way to add support for international characters through
4896 so-called dead-keys.
4897 A dead-key works in combination with a letter to produce an accented character.
4898 Here, we'll explain how to create a really simple dead-key to illustrate
4902 \begin_layout Standard
4903 Suppose you happen to need the circumflex character,
4904 \begin_inset Quotes eld
4908 \begin_inset Quotes erd
4913 \begin_inset Flex CharStyle:MenuItem
4916 \begin_layout Plain Layout
4923 \begin_inset space ~
4927 \begin_inset Flex CharStyle:MenuItem
4930 \begin_layout Plain Layout
4936 ] to the LyX command
4937 \begin_inset Flex CharStyle:Code
4940 \begin_layout Plain Layout
4947 \begin_inset Flex CharStyle:Code
4950 \begin_layout Plain Layout
4957 Now, whenever you type the
4958 \begin_inset Flex CharStyle:MenuItem
4961 \begin_layout Plain Layout
4967 -key followed by a letter, that letter will have a circumflex accent on
4969 For example, the sequence
4970 \begin_inset Quotes eld
4974 \begin_inset Flex CharStyle:MenuItem
4977 \begin_layout Plain Layout
4984 \begin_inset Quotes erd
4987 produces the letter:
4988 \begin_inset Quotes eld
4992 \begin_inset Quotes erd
4996 If you tried to type
4997 \begin_inset Quotes eld
5001 \begin_inset Flex CharStyle:MenuItem
5004 \begin_layout Plain Layout
5011 \begin_inset Quotes erd
5014 , however, LyX will complain with a beep, since a
5015 \begin_inset Quotes eld
5019 \begin_inset Flex CharStyle:MenuItem
5022 \begin_layout Plain Layout
5029 \begin_inset Quotes erd
5032 never takes a circumflex accent.
5034 \begin_inset Flex CharStyle:MenuItem
5037 \begin_layout Plain Layout
5043 after a dead-key produces the bare-accent.
5044 Please note this last point! If you bind a key to a dead-key, you'll need
5045 to rebind the character on that key to yet another key.
5047 \begin_inset Flex CharStyle:MenuItem
5050 \begin_layout Plain Layout
5056 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5059 \begin_layout Standard
5060 One common way to bind dead-keys is to use
5061 \begin_inset Flex CharStyle:MenuItem
5064 \begin_layout Plain Layout
5071 \begin_inset Flex CharStyle:MenuItem
5074 \begin_layout Plain Layout
5081 \begin_inset Flex CharStyle:MenuItem
5084 \begin_layout Plain Layout
5090 in combination with an accent, like
5091 \begin_inset Quotes eld
5095 \begin_inset Flex CharStyle:MenuItem
5098 \begin_layout Plain Layout
5105 \begin_inset Quotes erd
5109 \begin_inset Quotes eld
5113 \begin_inset Flex CharStyle:MenuItem
5116 \begin_layout Plain Layout
5123 \begin_inset Quotes erd
5127 \begin_inset Quotes eld
5131 \begin_inset Flex CharStyle:MenuItem
5134 \begin_layout Plain Layout
5141 \begin_inset Quotes erd
5145 Another way involves using
5146 \begin_inset Flex CharStyle:Code
5149 \begin_layout Plain Layout
5156 \begin_inset Flex CharStyle:Code
5159 \begin_layout Plain Layout
5165 to set up the special
5166 \begin_inset Flex CharStyle:Code
5169 \begin_layout Plain Layout
5177 \begin_inset Flex CharStyle:Code
5180 \begin_layout Plain Layout
5186 acts in some ways just like
5187 \begin_inset Flex CharStyle:MenuItem
5190 \begin_layout Plain Layout
5196 and permits you to bind keys to accented characters.
5197 You can also turn keys into dead-keys by binding them to something like
5199 \begin_inset Flex CharStyle:Code
5202 \begin_layout Plain Layout
5208 and then binding this symbolic key to the corresponding LyX command.
5212 \begin_layout Plain Layout
5217 : This is exactly what I do in my
5218 \begin_inset Flex CharStyle:Code
5221 \begin_layout Plain Layout
5228 \begin_inset Flex CharStyle:Code
5231 \begin_layout Plain Layout
5239 \begin_inset Flex CharStyle:MenuItem
5242 \begin_layout Plain Layout
5244 \begin_inset space ~
5253 \begin_inset Flex CharStyle:Code
5256 \begin_layout Plain Layout
5262 and a bunch of these
5263 \begin_inset Quotes eld
5267 \begin_inset Flex CharStyle:Code
5270 \begin_layout Plain Layout
5277 \begin_inset Quotes erd
5280 symbolic keys bound such things as
5281 \begin_inset Flex CharStyle:MenuItem
5284 \begin_layout Plain Layout
5286 \begin_inset space ~
5295 \begin_inset Flex CharStyle:MenuItem
5298 \begin_layout Plain Layout
5300 \begin_inset space ~
5309 This is how I produce my accented characters.
5314 You can make just about anything into the
5315 \begin_inset Flex CharStyle:Code
5318 \begin_layout Plain Layout
5325 \begin_inset Flex CharStyle:MenuItem
5328 \begin_layout Plain Layout
5334 keys, a spare function key, etc.
5335 As for the LyX commands that produce accents, check the entry for
5336 \begin_inset Flex CharStyle:Code
5339 \begin_layout Plain Layout
5350 You'll find the complete list there.
5353 \begin_layout Subsection
5354 Saving your Language Configuration
5357 \begin_layout Standard
5358 You can edit your preferences so that your desired language environment
5359 is automatically configured when LyX starts up, via the
5360 \begin_inset Flex CharStyle:MenuItem
5363 \begin_layout Plain Layout
5364 Edit\SpecialChar \menuseparator
5373 \begin_layout Chapter
5374 Installing New Document Classes, Layouts, and Templates
5375 \begin_inset CommandInset label
5377 name "chap:textclass"
5385 \begin_layout Plain Layout
5386 Installing New Document Classes
5394 \begin_layout Standard
5395 In this chapter, we describe the procedures for creating and installing
5396 new LyX layout and template files, as well as offer a refresher on correctly
5397 installing new LaTeX document classes.
5398 Some definitions: a document class is a LaTeX file (usually ending in
5399 \begin_inset Flex CharStyle:Code
5402 \begin_layout Plain Layout
5409 \begin_inset Flex CharStyle:Code
5412 \begin_layout Plain Layout
5418 ) that describes the format of a document such as an article, report, journal
5419 preprint, etc, and all the commands needed to realize that format.
5420 A layout file is a LyX file that corresponds to a LaTeX document class
5421 and that tells LyX how to
5422 \begin_inset Quotes eld
5426 \begin_inset Quotes erd
5429 things on the screen to make the display look something like the final
5431 More precisely, a layout file describes a
5432 \begin_inset Quotes eld
5436 \begin_inset Quotes erd
5439 which is the internal construct LyX uses to render the screen display.
5441 \begin_inset Quotes eld
5445 \begin_inset Quotes erd
5449 \begin_inset Quotes eld
5453 \begin_inset Quotes erd
5456 can be used somewhat interchangeably, but it is better to refer to the
5457 file as the layout, and the thing living in LyX's memory as the text class.
5458 A template file is simply a LyX document that contains a set of predefined
5459 entries for a given document class---entries that are generally required
5461 Templates are especially useful for things like journal manuscripts that
5462 are to be submitted electronically.
5465 \begin_layout Section
5466 Installing a new LaTeX package
5469 \begin_layout Standard
5470 Some installations may not include a LaTeX package that you would like to
5472 For example, you might need FoilTeX, a package for preparing slides or
5473 viewgraphs for overhead projectors.
5474 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5475 a user interface for that.
5476 For example on MiKTeX you start its program
5477 \begin_inset Quotes eld
5481 \begin_inset Quotes erd
5484 to get a list of available packages.
5485 To install one, right click on it or use the installing toolbar button.
5486 When the package you want to install is not in the list, but you have it
5488 \begin_inset Flex CharStyle:Code
5491 \begin_layout Plain Layout
5498 \begin_inset Flex CharStyle:Code
5501 \begin_layout Plain Layout
5507 -file, then copy these files to a subfolder of your LaTeX distribution,
5508 for example to the folder
5517 Then update the file name database of your LaTeX-distribution.
5518 For example on MiKTeX this is done by pressing the button
5521 \begin_inset space ~
5526 that you find in MiKTeX's
5527 \begin_inset Quotes eld
5531 \begin_inset Quotes erd
5535 In both cases you need afterwards to reconfigure LyX using the menu
5536 \begin_inset Flex CharStyle:MenuItem
5539 \begin_layout Plain Layout
5540 Tools\SpecialChar \menuseparator
5546 and then to restart LyX.
5549 \begin_layout Standard
5550 If your LaTeX distribution doesn't provide a user interface, then you can
5551 follow these steps by using a UNIX/Linux console.
5554 \begin_layout Enumerate
5555 Get the package from
5556 \begin_inset CommandInset href
5559 target "http://www.ctan.org/"
5566 \begin_layout Enumerate
5567 You can install this package in several different places.
5568 If you want it to be available for all users on your system, then you should
5569 install it in your `local' TeX tree; if you want (or need) it to be available
5570 just for you, then you can install it in your own `user' TeX tree.
5571 Where these should be created, if they do not already exist, depends upon
5572 the details of your system.
5573 To find out, look in the file
5574 \begin_inset Flex CharStyle:Code
5577 \begin_layout Plain Layout
5587 \begin_layout Plain Layout
5588 This usually lives in the directory
5589 \begin_inset Flex CharStyle:Code
5592 \begin_layout Plain Layout
5598 , though you can run
5599 \begin_inset Flex CharStyle:Code
5602 \begin_layout Plain Layout
5613 The location of the `local' TeX tree is defined by
5614 \begin_inset Flex CharStyle:Code
5617 \begin_layout Plain Layout
5623 ; this is usually somewhere like
5624 \begin_inset Flex CharStyle:Code
5627 \begin_layout Plain Layout
5628 /usr/local/share/texmf/
5634 The `user' TeX tree is defined by
5635 \begin_inset Flex CharStyle:Code
5638 \begin_layout Plain Layout
5645 \begin_inset Flex CharStyle:Code
5648 \begin_layout Plain Layout
5655 (If these variables are not predefined, you can define them.) You'll probably
5656 need root permissions to create or modify the `local' tree; but your `user'
5657 tree shouldn't have such limitations.
5660 \begin_layout Enumerate
5662 \begin_inset Flex CharStyle:Code
5665 \begin_layout Plain Layout
5672 \begin_inset Flex CharStyle:Code
5675 \begin_layout Plain Layout
5682 \begin_inset Flex CharStyle:Code
5685 \begin_layout Plain Layout
5692 \begin_inset space \thinspace{}
5696 \begin_inset Newline newline
5700 \begin_inset Flex CharStyle:Code
5703 \begin_layout Plain Layout
5704 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5710 \begin_inset Newline newline
5713 But, again, most of this will
5714 \begin_inset Quotes eld
5718 \begin_inset Quotes erd
5724 \begin_layout Enumerate
5729 \begin_layout Plain Layout
5730 We'll assume henceforth that you're defining `local' TeX tree.
5731 If you're defining a user tree, just adjust as necessary.
5737 You must follow the directory structure of your existing
5738 \begin_inset Flex CharStyle:Code
5741 \begin_layout Plain Layout
5747 directory, which will be found at
5748 \begin_inset Flex CharStyle:Code
5751 \begin_layout Plain Layout
5758 For example, latex packages should go under
5759 \begin_inset Flex CharStyle:Code
5762 \begin_layout Plain Layout
5763 $TEXMFLOCAL/tex/latex/
5771 \begin_layout Enumerate
5772 Install the package.
5773 For example, you would unpack the FoilTeX tarball and copy it to
5774 \begin_inset Flex CharStyle:Code
5777 \begin_layout Plain Layout
5778 $TEXMFLOCAL/tex/latex/foiltex
5785 \begin_inset Flex CharStyle:Code
5788 \begin_layout Plain Layout
5794 directory contains various files.
5797 \begin_layout Enumerate
5799 \begin_inset Flex CharStyle:Code
5802 \begin_layout Plain Layout
5810 \begin_inset Flex CharStyle:Code
5813 \begin_layout Plain Layout
5822 \begin_layout Standard
5823 Your package is now installed and available to LaTeX.
5824 To make it available to LyX, you need to create a Layout file, if one is
5825 not already available.
5826 (See the next section.) Once you have a layout file, you need only reconfigure
5828 \begin_inset Flex CharStyle:MenuItem
5831 \begin_layout Plain Layout
5832 Tools\SpecialChar \menuseparator
5838 ) and then restart LyX.
5839 You should then see your new package---for example
5840 \begin_inset Flex CharStyle:MenuItem
5843 \begin_layout Plain Layout
5850 \begin_inset Flex CharStyle:MenuItem
5853 \begin_layout Plain Layout
5854 Document\SpecialChar \menuseparator
5861 \begin_inset Flex CharStyle:MenuItem
5864 \begin_layout Plain Layout
5874 \begin_layout Section
5878 \begin_layout Standard
5879 This section describes how to write and install your own LyX layout files
5880 and walks through the
5881 \begin_inset Flex CharStyle:Code
5884 \begin_layout Plain Layout
5890 text class format as an example.
5892 \begin_inset Flex CharStyle:Code
5895 \begin_layout Plain Layout
5901 files describe what paragraph and character styles are available for a
5902 given document class and how LyX should display them.
5903 We try to provide a thorough description of the process here; however,
5904 there are so many different types of documents supported by LaTeX classes
5905 that we can't hope to cover every different possibility or problem you
5907 (The LyX users' list is frequented by people with lots of experience with
5908 layout design who are willing to share what they've learned.)
5911 \begin_layout Standard
5912 As you prepare to write a new layout, it is extremely helpful to look at
5913 the example layouts distributed with LyX.
5914 If you use a nice LaTeX document class that might be of interest for others,
5915 too, and have a nice corresponding LyX layout, feel free to contribute
5916 the stuff to us, so we may put it into the distribution.
5918 \begin_inset CommandInset href
5920 name "section on the LyX wiki"
5921 target "http://wiki.lyx.org/Layouts/Layouts"
5925 for this kind of material.
5928 \begin_layout Standard
5929 All the tags described in this chapter are case-insensitive; this means
5931 \begin_inset Flex CharStyle:Code
5934 \begin_layout Plain Layout
5941 \begin_inset Flex CharStyle:Code
5944 \begin_layout Plain Layout
5951 \begin_inset Flex CharStyle:Code
5954 \begin_layout Plain Layout
5960 are really the same command.
5961 The possible values are printed in brackets after the feature's name.
5962 The default value if a feature isn't specified inside a text class-description
5964 \begin_inset Flex CharStyle:Code
5967 \begin_layout Plain Layout
5976 If the argument has a datatype like
5977 \begin_inset Quotes eld
5981 \begin_inset Quotes erd
5985 \begin_inset Quotes eld
5989 \begin_inset Quotes erd
5992 , the default is shown like this:
5993 \begin_inset Flex CharStyle:Code
5996 \begin_layout Plain Layout
6007 \begin_layout Subsection
6008 \begin_inset CommandInset label
6010 name "sub:Layout-modules"
6017 \begin_layout Standard
6018 Similar to layout files, and new with LyX 1.6, are layout
6023 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6024 some modules---such as the Endnotes module---provide support for just such
6026 In a sense, layout modules are similar to included files---files like
6027 \begin_inset Flex CharStyle:Code
6030 \begin_layout Plain Layout
6036 ---in that modules are not specific to a given document layout but may be
6037 used with many different layouts.
6038 The difference is that using a layout module does not require editing the
6040 Rather, modules are selected in the
6041 \begin_inset Flex CharStyle:MenuItem
6044 \begin_layout Plain Layout
6045 Document\SpecialChar \menuseparator
6054 \begin_layout Standard
6055 Building modules is the easiest way to get started with layout editing,
6056 since it can be as simple as adding a single new paragraph or flex inset.
6057 But modules may, in principle, contain anything a layout file can contain.
6060 \begin_layout Standard
6061 A module must begin with a line like the following:
6064 \begin_layout LyX-Code
6067 DeclareLyXModule[endnotes.sty]{Endnotes}
6070 \begin_layout Standard
6071 The argument in square brackets is optional: It declares any LaTeX packages
6072 on which the module depends.
6073 The mandatory argument, in curly brackets, is the name of the module, as
6075 \begin_inset Flex CharStyle:MenuItem
6078 \begin_layout Plain Layout
6079 Document\SpecialChar \menuseparator
6089 \begin_layout Standard
6090 The module declaration should then be followed by lines like the following:
6093 \begin_layout LyX-Code
6097 \begin_layout LyX-Code
6098 #Adds an endnote command, in addition to footnotes.
6102 \begin_layout LyX-Code
6103 #You will need to add
6105 theendnotes in ERT where you
6108 \begin_layout LyX-Code
6109 #want the endnotes to appear.
6113 \begin_layout LyX-Code
6117 \begin_layout LyX-Code
6118 #Requires: somemodule | othermodule
6121 \begin_layout LyX-Code
6122 #Excludes: badmodule
6125 \begin_layout Standard
6126 The description is used in
6127 \begin_inset Flex CharStyle:MenuItem
6130 \begin_layout Plain Layout
6131 Document\SpecialChar \menuseparator
6137 to provide the user with information about what the module does.
6139 \begin_inset Flex CharStyle:Code
6142 \begin_layout Plain Layout
6148 line is used to identify other modules with which this one must be used;
6150 \begin_inset Flex CharStyle:Code
6153 \begin_layout Plain Layout
6159 line is used to identify modules with which this one may not be used.
6160 Both are optional, and, as shown, multiple modules should be separated
6161 with the pipe symbol: |.
6162 Note that the required modules are treated disjunctively:
6166 of the required modules must be used.
6171 excluded module may be used.
6172 Note that modules are identified here by their
6176 without the .module extension.
6178 \begin_inset Flex CharStyle:Code
6181 \begin_layout Plain Layout
6188 \begin_inset Flex CharStyle:Code
6191 \begin_layout Plain Layout
6200 \begin_layout Standard
6201 After creating a new module, you will need to reconfigure and then restart
6202 LyX for the module to appear in the menu.
6203 However, changes you make to the module will be seen immediately, if you
6205 \begin_inset Flex CharStyle:MenuItem
6208 \begin_layout Plain Layout
6209 Document\SpecialChar \menuseparator
6215 , highlight something, and then hit
6216 \begin_inset Quotes eld
6220 \begin_inset Quotes erd
6226 It is strongly recommended that you save your work before doing so
6231 it is strongly recommended that you not attempt to edit modules while simultaneo
6232 usly working on documents
6235 Though of course the developers strive to keep LyX stable in such situations,
6236 syntax errors and the like in your module file could cause strange behavior.
6239 \begin_layout Subsection
6240 Supporting new document classes
6243 \begin_layout Standard
6244 There are two situations you are likely to encounter when wanting to support
6245 a new LaTeX document class, involving LaTeX2e class (
6246 \begin_inset Flex CharStyle:Code
6249 \begin_layout Plain Layout
6256 \begin_inset Flex CharStyle:Code
6259 \begin_layout Plain Layout
6266 Supporting a style file is usually fairly easy.
6267 Supporting a new document class is a bit harder.
6270 \begin_layout Subsection
6272 \begin_inset Flex CharStyle:MenuItem
6275 \begin_layout Plain Layout
6284 \begin_layout Standard
6285 If your new document class is provided as a style file that is used in conjuncti
6286 on with an existing, supported document class---for the sake of the example,
6287 we'll assume that the style file is called
6288 \begin_inset Flex CharStyle:MenuItem
6291 \begin_layout Plain Layout
6297 and it is meant to be used with
6298 \begin_inset Flex CharStyle:MenuItem
6301 \begin_layout Plain Layout
6307 , which is a standard class---start by copying the existing class's layout
6308 file into your local directory:
6311 \begin_layout LyX-Code
6312 cp report.layout ~/.lyx/layouts/myclass.layout
6315 \begin_layout Standard
6317 \begin_inset Flex CharStyle:Code
6320 \begin_layout Plain Layout
6326 and change the line:
6329 \begin_layout LyX-Code
6332 DeclareLaTeXClass{report}
6335 \begin_layout Standard
6339 \begin_layout LyX-Code
6342 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6345 \begin_layout Standard
6349 \begin_layout LyX-Code
6351 \begin_inset Newline newline
6357 \begin_inset Newline newline
6363 \begin_layout Standard
6364 near the top of the file.
6367 \begin_layout Standard
6368 Start LyX and select
6369 \begin_inset Flex CharStyle:MenuItem
6372 \begin_layout Plain Layout
6373 Tools\SpecialChar \menuseparator
6380 Then restart LyX and try creating a new document.
6382 \begin_inset Flex CharStyle:MenuItem
6385 \begin_layout Plain Layout
6391 " as a document class option in the
6392 \begin_inset Flex CharStyle:MenuItem
6395 \begin_layout Plain Layout
6396 Document\SpecialChar \menuseparator
6403 It is likely that some of the sectioning commands and such in your new
6404 class will work differently from how they worked in the base class---
6405 \begin_inset Flex CharStyle:Code
6408 \begin_layout Plain Layout
6414 in this example---so you can fiddle around with the settings for the different
6415 sections if you wish.
6418 \begin_layout Subsection
6420 \begin_inset Flex CharStyle:MenuItem
6423 \begin_layout Plain Layout
6432 \begin_layout Standard
6433 There are two possibilities here.
6434 One is that the class file is itself based upon an existing document class.
6435 For example, many thesis classes are based upon
6436 \begin_inset Flex CharStyle:MenuItem
6439 \begin_layout Plain Layout
6446 To see whether yours is, look for a line like
6449 \begin_layout LyX-Code
6455 \begin_layout Standard
6457 If so, then you may proceed largely as in the previous section, though
6458 the DeclareLaTeXClass line will be different.
6459 If your new class is thesis, and it is based upon book, then the line should
6464 \begin_layout Plain Layout
6465 And it will be easiest if you save the file to
6466 \begin_inset Flex CharStyle:Code
6469 \begin_layout Plain Layout
6475 : LyX assumes that the document class has the same name as the layout file.
6484 \begin_layout LyX-Code
6487 DeclareLaTeXClass[thesis,book]{thesis}
6490 \begin_layout Standard
6491 If, on the other hand, the new class is not based upon an existing class,
6492 you will probably have to
6493 \begin_inset Quotes eld
6497 \begin_inset Quotes erd
6501 We strongly suggest copying an existing layout file which uses a similar
6502 LaTeX class and then modifying it, if you can do so.
6503 At least use an existing file as a starting point so you can find out what
6504 items you need to worry about.
6505 Again, the specifics are covered below.
6508 \begin_layout Section
6509 Declaring a new text class
6512 \begin_layout Standard
6513 When it's finally time to get your hands dirty and create or edit your own
6514 layout file, the following sections describe what you're up against.
6515 Our advice is to go slowly, save and test often, listen to soothing music,
6516 and enjoy one or two of your favorite adult beverages; more if you are
6517 getting particularly stuck.
6518 It's really not that hard, except that the multitude of options can become
6519 overwhelming if you try to do to much in one sitting.
6520 Go have another adult beverage, just for good measure.
6523 \begin_layout Standard
6527 \begin_layout Standard
6528 Lines in a layout file which begin with a
6529 \begin_inset Flex CharStyle:Code
6532 \begin_layout Plain Layout
6539 There is one exception to this rule: all layouts should begin with lines
6543 \begin_layout LyX-Code
6546 #% Do not delete the line below; configure depends on this
6549 \begin_layout LyX-Code
6554 DeclareLaTeXClass{article}
6557 \begin_layout Standard
6558 The second line is used when you configure LyX.
6559 The layout file is read by the LaTeX script
6560 \begin_inset Flex CharStyle:Code
6563 \begin_layout Plain Layout
6569 , in a special mode where
6570 \begin_inset Flex CharStyle:Code
6573 \begin_layout Plain Layout
6580 The first line is just a LaTeX comment, and the second one contains the
6581 declaration of the text class.
6582 If these lines appear in a file named
6583 \begin_inset Flex CharStyle:Code
6586 \begin_layout Plain Layout
6592 , then they define a text class of name
6593 \begin_inset Flex CharStyle:Code
6596 \begin_layout Plain Layout
6602 (the name of the layout file) which uses the LaTeX document class
6603 \begin_inset Flex CharStyle:Code
6606 \begin_layout Plain Layout
6612 (the default is to use the same name as the layout).
6614 \begin_inset Quotes eld
6618 \begin_inset Quotes erd
6621 that appears above is used as a description of the text class in the
6622 \begin_inset Flex CharStyle:MenuItem
6625 \begin_layout Plain Layout
6626 Document\SpecialChar \menuseparator
6635 \begin_layout Standard
6636 Let's assume that you wrote your own text class that uses the
6637 \begin_inset Flex CharStyle:Code
6640 \begin_layout Plain Layout
6646 document class, but where you changed the appearance of the section headings.
6647 If you put it in a file
6648 \begin_inset Flex CharStyle:Code
6651 \begin_layout Plain Layout
6657 , the header of this file should be:
6660 \begin_layout LyX-Code
6663 #% Do not delete the line below; configure depends on this
6666 \begin_layout LyX-Code
6671 DeclareLaTeXClass[article]{article (with my own headings)}
6674 \begin_layout Standard
6675 This declares a text class
6676 \begin_inset Flex CharStyle:Code
6679 \begin_layout Plain Layout
6685 , associated with the LaTeX document class
6686 \begin_inset Flex CharStyle:Code
6689 \begin_layout Plain Layout
6696 \begin_inset Quotes eld
6699 article (with my own headings)
6700 \begin_inset Quotes erd
6704 If your text class depends on several packages, you can declare it as:
6707 \begin_layout LyX-Code
6710 #% Do not delete the line below; configure depends on this
6713 \begin_layout LyX-Code
6718 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6721 \begin_layout Standard
6722 This indicates that your text class uses the foo.sty package.
6723 Finally, it is also possible to declare classes for DocBook code.
6724 Typical declarations will look like
6727 \begin_layout LyX-Code
6730 #% Do not delete the line below; configure depends on this
6733 \begin_layout LyX-Code
6738 DeclareDocBookClass[article]{SGML (DocBook article)}
6741 \begin_layout Standard
6742 Note that these declarations can also be given an optional parameter declaring
6743 the name of the document class (but not a list).
6746 \begin_layout Standard
6747 So, to be as explicit as possible, the form of the layout declaration is:
6750 \begin_layout LyX-Code
6755 DeclareLaTeXClass[class,package.sty]{layout description}
6758 \begin_layout Standard
6759 The class need only be specified if the name of the LaTeX class file and
6760 the name of the layout file are different; if the name of the classfile
6761 is not specified, then LyX will simply assume that it is the same as the
6762 name of the layout file.
6765 \begin_layout Standard
6766 When the text class has been modified to your taste, all you have to do
6767 is to copy it either to
6768 \begin_inset Flex CharStyle:Code
6771 \begin_layout Plain Layout
6778 \begin_inset Flex CharStyle:Code
6781 \begin_layout Plain Layout
6788 \begin_inset Flex CharStyle:MenuItem
6791 \begin_layout Plain Layout
6796 ools\SpecialChar \menuseparator
6806 , exit LyX and restart it.
6807 Then your new text class should be available along with the others.
6810 \begin_layout Standard
6811 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6812 you made to your layout files.
6813 As a result, editing layout files could be very time consuming.
6814 Beginning with 1.6, however, you can force a reload of the layout currently
6815 in use by using the LyX function
6816 \begin_inset Flex CharStyle:MenuItem
6819 \begin_layout Plain Layout
6826 There is no default binding for this function---though, of course, you
6827 can bind it to a key yourself.
6828 If you want to use this function, then, you should simply enter it in the
6834 : This is very much an `advanced feature'.
6839 recommended that you save your work before using this function.
6844 recommended that you not attempt to edit your layout while simultaneously
6845 working on a document that you care about.
6846 Use a test document.
6847 Syntax errors and the like in your layout file could cause peculiar behavior.
6848 In particular, such errors could cause LyX to regard the current layout
6849 as invalid and to attempt to switch to some other layout.
6850 The LyX team strives to keep LyX stable in such situations, but safe is
6854 \begin_layout Subsection
6858 \begin_layout Standard
6859 The first non-comment line must contain the file format number:
6862 \begin_layout Description
6863 \begin_inset Flex CharStyle:Code
6866 \begin_layout Plain Layout
6873 \begin_inset Flex CharStyle:Code
6876 \begin_layout Plain Layout
6882 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6883 don't have an explicit file format).
6884 The file format that is documented here is format 8.
6887 \begin_layout Subsection
6888 General text class parameters
6891 \begin_layout Standard
6892 These are the general parameters which describe the form of the entire document:
6895 \begin_layout Description
6896 \begin_inset Flex CharStyle:Code
6899 \begin_layout Plain Layout
6905 Adds information to the document preamble.
6907 \begin_inset Quotes eld
6911 \begin_inset Flex CharStyle:Code
6914 \begin_layout Plain Layout
6921 \begin_inset Quotes erd
6927 \begin_layout Description
6928 \begin_inset Flex CharStyle:Code
6931 \begin_layout Plain Layout
6937 Describes various global options supported by the document class.
6939 \begin_inset space ~
6943 \begin_inset CommandInset ref
6945 reference "sec:classoptions"
6951 \begin_inset Quotes eld
6955 \begin_inset Flex CharStyle:Code
6958 \begin_layout Plain Layout
6965 \begin_inset Quotes erd
6971 \begin_layout Description
6972 \begin_inset Flex CharStyle:Code
6975 \begin_layout Plain Layout
6982 \begin_inset Flex CharStyle:Code
6985 \begin_layout Plain Layout
6994 \begin_inset Flex CharStyle:Code
6997 \begin_layout Plain Layout
7003 ] Whether the class should default to having one or two columns.
7004 Can be changed in the
7005 \begin_inset Flex CharStyle:MenuItem
7008 \begin_layout Plain Layout
7009 Document\SpecialChar \menuseparator
7018 \begin_layout Description
7019 \begin_inset Flex CharStyle:Code
7022 \begin_layout Plain Layout
7028 This sequence defines a new counter.
7030 \begin_inset space ~
7034 \begin_inset CommandInset ref
7036 reference "sec:counter"
7042 \begin_inset Quotes eld
7046 \begin_inset Flex CharStyle:Code
7049 \begin_layout Plain Layout
7056 \begin_inset Quotes erd
7062 \begin_layout Description
7063 \begin_inset Flex CharStyle:Code
7066 \begin_layout Plain Layout
7072 Sets the default font used to display the document.
7074 \begin_inset space ~
7078 \begin_inset CommandInset ref
7080 reference "sec:fonts"
7084 for how to declare fonts.
7086 \begin_inset Quotes eld
7090 \begin_inset Flex CharStyle:Code
7093 \begin_layout Plain Layout
7100 \begin_inset Quotes erd
7106 \begin_layout Description
7107 \begin_inset Flex CharStyle:Code
7110 \begin_layout Plain Layout
7117 \begin_inset Flex CharStyle:Code
7120 \begin_layout Plain Layout
7126 Specifies a module to be included by default with this document class,
7127 which should be specified by filename without the
7128 \begin_inset Flex CharStyle:Code
7131 \begin_layout Plain Layout
7138 The user can still remove the module, but it will be active at the outset.
7139 (This applies only when new files are created, or when this class is chosen
7140 for an existing document.)
7143 \begin_layout Description
7144 \begin_inset Flex CharStyle:Code
7147 \begin_layout Plain Layout
7154 \begin_inset Flex CharStyle:Code
7157 \begin_layout Plain Layout
7163 ] This is the style that will be assigned to new paragraphs, usually
7164 \begin_inset Flex CharStyle:MenuItem
7167 \begin_layout Plain Layout
7174 This will default to the first defined style if not given, but you are
7175 highly encouraged to use this directive.
7178 \begin_layout Description
7179 \begin_inset Flex CharStyle:Code
7182 \begin_layout Plain Layout
7189 \begin_inset Flex CharStyle:Code
7192 \begin_layout Plain Layout
7198 ] Indicates that the module in question---which should be specified by filename
7200 \begin_inset Flex CharStyle:Code
7203 \begin_layout Plain Layout
7209 extension---cannot be used with this document class.
7210 This might be used in a journal-specific layout file to prevent, say, the
7212 \begin_inset Flex CharStyle:Code
7215 \begin_layout Plain Layout
7221 module that numbers theorems by section.
7226 be used in a module.
7227 Modules have their own way of excluding other modules (see
7228 \begin_inset CommandInset ref
7230 reference "sub:Layout-modules"
7237 \begin_layout Description
7238 \begin_inset Flex CharStyle:Code
7241 \begin_layout Plain Layout
7247 Defines a new float.
7249 \begin_inset space ~
7253 \begin_inset CommandInset ref
7255 reference "sec:floats"
7261 \begin_inset Quotes eld
7265 \begin_inset Flex CharStyle:Code
7268 \begin_layout Plain Layout
7275 \begin_inset Quotes erd
7281 \begin_layout Description
7282 \begin_inset Flex CharStyle:Code
7285 \begin_layout Plain Layout
7291 As its name implies, this command allows you to include another layout
7292 definition file within yours to avoid duplicating commands.
7293 Common examples are the standard layout files, for example,
7294 \begin_inset Flex CharStyle:Code
7297 \begin_layout Plain Layout
7303 , which contains most of the basic layouts.
7306 \begin_layout Description
7307 \begin_inset Flex CharStyle:Code
7310 \begin_layout Plain Layout
7316 This section (re-)defines the layout of an inset.
7317 It can be applied to an existing inset of to a new, user-defined inset,
7319 \begin_inset space \thinspace{}
7323 \begin_inset space \space{}
7326 a new character style.
7328 \begin_inset space ~
7332 \begin_inset CommandInset ref
7334 reference "sec:charstyle"
7338 for more information.
7340 \begin_inset Quotes eld
7344 \begin_inset Flex CharStyle:Code
7347 \begin_layout Plain Layout
7354 \begin_inset Quotes erd
7360 \begin_layout Description
7361 \begin_inset Flex CharStyle:Code
7364 \begin_layout Plain Layout
7370 A string that indicates the width of the left margin on the screen, for
7372 \begin_inset Quotes eld
7376 \begin_inset Quotes erd
7382 \begin_layout Description
7383 \begin_inset Flex CharStyle:Code
7386 \begin_layout Plain Layout
7392 This command deletes an existing float.
7393 This is particularly useful when you want to suppress a float that has
7394 be defined in an input file.
7397 \begin_layout Description
7398 \begin_inset Flex CharStyle:Code
7401 \begin_layout Plain Layout
7407 This command deletes an existing style.
7408 This is particularly useful when you want to suppress a style that has
7409 be defined in an input file.
7412 \begin_layout Description
7413 \begin_inset Flex CharStyle:Code
7416 \begin_layout Plain Layout
7422 A string indicating what sort of output documents using this class will
7424 At present, the options are: `docbook', `latex', and `literate'.
7427 \begin_layout Description
7428 \begin_inset Flex CharStyle:Code
7431 \begin_layout Plain Layout
7442 \begin_inset Flex CharStyle:Code
7445 \begin_layout Plain Layout
7456 \begin_inset Flex CharStyle:Code
7459 \begin_layout Plain Layout
7466 \begin_inset Flex CharStyle:Code
7469 \begin_layout Plain Layout
7475 ] The class default pagestyle.
7476 Can be changed in the
7477 \begin_inset Flex CharStyle:MenuItem
7480 \begin_layout Plain Layout
7481 Document\SpecialChar \menuseparator
7490 \begin_layout Description
7491 \begin_inset Flex CharStyle:Code
7494 \begin_layout Plain Layout
7500 Sets the preamble for the LaTeX document.
7501 Note that this will completely override any prior
7502 \begin_inset Flex CharStyle:Code
7505 \begin_layout Plain Layout
7512 \begin_inset Flex CharStyle:Code
7515 \begin_layout Plain Layout
7523 \begin_inset Quotes eld
7527 \begin_inset Flex CharStyle:Code
7530 \begin_layout Plain Layout
7537 \begin_inset Quotes erd
7543 \begin_layout Description
7544 \begin_inset Flex CharStyle:Code
7547 \begin_layout Plain Layout
7554 \begin_inset Flex CharStyle:Code
7557 \begin_layout Plain Layout
7564 \begin_inset Flex CharStyle:Code
7567 \begin_layout Plain Layout
7576 \begin_inset Flex CharStyle:Code
7579 \begin_layout Plain Layout
7585 ] Whether the class already provides the feature
7586 \begin_inset Flex CharStyle:Code
7589 \begin_layout Plain Layout
7596 A feature is in general the name of a package (
7597 \begin_inset Flex CharStyle:Code
7600 \begin_layout Plain Layout
7607 \begin_inset Flex CharStyle:Code
7610 \begin_layout Plain Layout
7616 , \SpecialChar \ldots{}
7618 \begin_inset Flex CharStyle:Code
7621 \begin_layout Plain Layout
7628 \begin_inset Flex CharStyle:Code
7631 \begin_layout Plain Layout
7637 ,\SpecialChar \ldots{}
7638 ); the complete list of supported features is unfortunately not documented
7639 outside the LyX source code---but see
7640 \begin_inset Flex CharStyle:Code
7643 \begin_layout Plain Layout
7649 if you're interested.
7651 \begin_inset Flex CharStyle:MenuItem
7654 \begin_layout Plain Layout
7659 elp\SpecialChar \menuseparator
7669 also gives an overview of the supported packages.
7672 \begin_layout Description
7673 \begin_inset Flex CharStyle:Code
7676 \begin_layout Plain Layout
7683 \begin_inset Flex CharStyle:Code
7686 \begin_layout Plain Layout
7692 ] Indicates that this layout provides the functionality of the module mentioned,
7693 which should be specified by filename, which should be specified by filename
7695 \begin_inset Flex CharStyle:Code
7698 \begin_layout Plain Layout
7705 This will typically be used if the layout includes the module directly,
7706 rather than using the
7707 \begin_inset Flex CharStyle:Code
7710 \begin_layout Plain Layout
7716 tag to indicate that it ought to be used.
7717 It could be used in a module that that provided an alternate implementation
7718 of the same functionality.
7721 \begin_layout Description
7722 \begin_inset Flex CharStyle:Code
7725 \begin_layout Plain Layout
7732 \begin_inset Flex CharStyle:Code
7735 \begin_layout Plain Layout
7741 ] Whether the class requires the feature
7742 \begin_inset Flex CharStyle:Code
7745 \begin_layout Plain Layout
7752 Multiple features must be separated by commas.
7753 Note that you can only request supported features.
7756 \begin_layout Description
7757 \begin_inset Flex CharStyle:Code
7760 \begin_layout Plain Layout
7766 A string that indicates the width of the right margin on the screen, for
7768 \begin_inset Quotes eld
7772 \begin_inset Quotes erd
7778 \begin_layout Description
7779 \begin_inset Flex CharStyle:Code
7782 \begin_layout Plain Layout
7788 Sets which divisions get numbered.
7790 \begin_inset Flex CharStyle:Code
7793 \begin_layout Plain Layout
7802 \begin_layout Description
7803 \begin_inset Flex CharStyle:Code
7806 \begin_layout Plain Layout
7815 \begin_inset Flex CharStyle:Code
7818 \begin_layout Plain Layout
7829 \begin_inset Flex CharStyle:Code
7832 \begin_layout Plain Layout
7838 ] Whether the class-default should be printing on one or both sides of the
7840 Can be changed in the
7841 \begin_inset Flex CharStyle:MenuItem
7844 \begin_layout Plain Layout
7845 Document\SpecialChar \menuseparator
7854 \begin_layout Description
7855 \begin_inset Flex CharStyle:Code
7858 \begin_layout Plain Layout
7864 This sequence defines a new paragraph style.
7865 If the style already exists, it will redefine some of its parameters instead.
7867 \begin_inset space ~
7871 \begin_inset CommandInset ref
7873 reference "sec:style"
7879 \begin_inset Quotes eld
7883 \begin_inset Flex CharStyle:Code
7886 \begin_layout Plain Layout
7893 \begin_inset Quotes erd
7899 \begin_layout Description
7900 \begin_inset Flex CharStyle:Code
7903 \begin_layout Plain Layout
7910 \begin_inset Flex CharStyle:Code
7913 \begin_layout Plain Layout
7919 ] The name of the command or environment to be used with
7920 \begin_inset Flex CharStyle:Code
7923 \begin_layout Plain Layout
7932 \begin_layout Description
7933 \begin_inset Flex CharStyle:Code
7936 \begin_layout Plain Layout
7943 \begin_inset Flex CharStyle:Code
7946 \begin_layout Plain Layout
7955 \begin_inset Flex CharStyle:Code
7958 \begin_layout Plain Layout
7964 ] Indicates what kind of markup is used to define the title of a document.
7966 \begin_inset Flex CharStyle:Code
7969 \begin_layout Plain Layout
7975 means that the macro with name
7976 \begin_inset Flex CharStyle:Code
7979 \begin_layout Plain Layout
7985 will be inserted after the last layout which has
7986 \begin_inset Quotes eld
7990 \begin_inset Flex CharStyle:Code
7993 \begin_layout Plain Layout
8000 \begin_inset Quotes erd
8005 \begin_inset Flex CharStyle:Code
8008 \begin_layout Plain Layout
8014 corresponds to the case where the block of paragraphs which have
8015 \begin_inset Quotes eld
8019 \begin_inset Flex CharStyle:Code
8022 \begin_layout Plain Layout
8029 \begin_inset Quotes erd
8032 should be enclosed into the
8033 \begin_inset Flex CharStyle:Code
8036 \begin_layout Plain Layout
8045 \begin_layout Description
8046 \begin_inset Flex CharStyle:Code
8049 \begin_layout Plain Layout
8055 Sets which divisions are included in the table of contents.
8057 \begin_inset Flex CharStyle:Code
8060 \begin_layout Plain Layout
8069 \begin_layout Subsection
8070 \begin_inset Flex CharStyle:Code
8073 \begin_layout Plain Layout
8082 \begin_layout Standard
8083 \begin_inset CommandInset label
8085 name "sec:classoptions"
8090 \begin_inset Flex CharStyle:Code
8093 \begin_layout Plain Layout
8099 section can contain the following entries:
8102 \begin_layout Description
8103 \begin_inset Flex CharStyle:Code
8106 \begin_layout Plain Layout
8113 \begin_inset Flex CharStyle:Code
8116 \begin_layout Plain Layout
8122 ] The list of available font sizes for the document's main font, separated
8124 \begin_inset Quotes eld
8128 \begin_inset Flex CharStyle:Code
8131 \begin_layout Plain Layout
8138 \begin_inset Quotes erd
8144 \begin_layout Description
8145 \begin_inset Flex CharStyle:Code
8148 \begin_layout Plain Layout
8154 Used to set the DTD line with XML-based output classes.
8156 \begin_inset space \thinspace{}
8160 \begin_inset Quotes eld
8163 -//OASIS//DTD DocBook V4.2//EN
8164 \begin_inset Quotes erd
8170 \begin_layout Description
8171 \begin_inset Flex CharStyle:Code
8174 \begin_layout Plain Layout
8181 \begin_inset Flex CharStyle:Code
8184 \begin_layout Plain Layout
8185 string="empty|plain|headings|fancy"
8190 ] The list of available page styles, separated by
8191 \begin_inset Quotes eld
8195 \begin_inset Flex CharStyle:Code
8198 \begin_layout Plain Layout
8205 \begin_inset Quotes erd
8211 \begin_layout Description
8212 \begin_inset Flex CharStyle:Code
8215 \begin_layout Plain Layout
8222 \begin_inset Flex CharStyle:Code
8225 \begin_layout Plain Layout
8231 ] Some document class options, separated by a comma, that will be added
8232 to the optional part of the
8233 \begin_inset Flex CharStyle:Code
8236 \begin_layout Plain Layout
8247 \begin_layout Standard
8249 \begin_inset Flex CharStyle:Code
8252 \begin_layout Plain Layout
8258 section must end with
8259 \begin_inset Quotes eld
8263 \begin_inset Flex CharStyle:Code
8266 \begin_layout Plain Layout
8273 \begin_inset Quotes erd
8279 \begin_layout Subsection
8283 \begin_layout Standard
8284 \begin_inset CommandInset label
8290 A paragraph style description looks like this:
8294 \begin_layout Plain Layout
8295 Note that this will either define a new layout or modify an existing one.
8303 \begin_layout LyX-Code
8310 \begin_layout LyX-Code
8314 \begin_layout LyX-Code
8318 \begin_layout Standard
8319 where the following commands are allowed:
8322 \begin_layout Description
8323 \begin_inset Flex CharStyle:Code
8326 \begin_layout Plain Layout
8333 \begin_inset Flex CharStyle:Code
8336 \begin_layout Plain Layout
8341 , left, right, center
8346 ] Paragraph alignment.
8349 \begin_layout Description
8350 \begin_inset Flex CharStyle:Code
8353 \begin_layout Plain Layout
8360 \begin_inset Flex CharStyle:Code
8363 \begin_layout Plain Layout
8368 , left, right, center
8373 ] A comma separated list of permitted alignments.
8374 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8376 For example a right-aligned or centered enumeration isn't possible.)
8379 \begin_layout Description
8380 \begin_inset Flex CharStyle:Code
8383 \begin_layout Plain Layout
8390 \begin_inset Flex CharStyle:Code
8393 \begin_layout Plain Layout
8403 \begin_layout Plain Layout
8404 Note that a `float' here is a real number, such as: 1.5.
8409 The vertical space with which the last of a chain of paragraphs with this
8410 layout is separated from the following paragraph.
8411 If the next paragraph has another layout, the separations are not simply
8412 added, but the maximum is taken.
8415 \begin_layout Description
8416 \begin_inset Flex CharStyle:Code
8419 \begin_layout Plain Layout
8426 \begin_inset Flex CharStyle:Code
8429 \begin_layout Plain Layout
8435 The category for this style.
8436 This is used to group related styles in the Layout combobox on the toolbar.
8437 Any string can be used, but you may want to use existing categories with
8442 \begin_layout Description
8443 \begin_inset Flex CharStyle:Code
8446 \begin_layout Plain Layout
8452 Depth of XML command.
8453 Used only with XML-type formats.
8456 \begin_layout Description
8457 \begin_inset Flex CharStyle:Code
8460 \begin_layout Plain Layout
8467 \begin_inset CommandInset label
8469 name "des:CopyStyle"
8474 \begin_inset Flex CharStyle:Code
8477 \begin_layout Plain Layout
8483 Copies all the features of an existing style into the current one.
8487 \begin_layout Description
8488 \begin_inset Flex CharStyle:Code
8491 \begin_layout Plain Layout
8497 The name of a style whose preamble should be output
8502 This allows to ensure some ordering of the preamble snippets when macros
8503 definitions depend on one another.
8507 \begin_layout Plain Layout
8508 Note that, besides that functionality, there is no way to ensure any ordering
8510 The ordering that you see in a given version of LyX may change without
8511 warning in later versions.
8519 \begin_layout Description
8520 \begin_inset Flex CharStyle:Code
8523 \begin_layout Plain Layout
8530 \begin_inset Flex CharStyle:Code
8533 \begin_layout Plain Layout
8538 , Box, Filled_Box, Static
8543 ] The type of label that stands at the end of the paragraph (or sequence
8545 \begin_inset Flex CharStyle:Code
8548 \begin_layout Plain Layout
8555 \begin_inset Flex CharStyle:Code
8558 \begin_layout Plain Layout
8565 \begin_inset Flex CharStyle:Code
8568 \begin_layout Plain Layout
8575 \begin_inset Flex CharStyle:Code
8578 \begin_layout Plain Layout
8586 \begin_inset Flex CharStyle:Code
8589 \begin_layout Plain Layout
8596 \begin_inset Quotes eld
8600 \begin_inset Quotes erd
8604 \begin_inset Flex CharStyle:Code
8607 \begin_layout Plain Layout
8614 \begin_inset Flex CharStyle:Code
8617 \begin_layout Plain Layout
8618 \begin_inset space ~
8627 \begin_inset space ~
8630 black) square suitable for end of proof markers,
8631 \begin_inset Flex CharStyle:Code
8634 \begin_layout Plain Layout
8640 is an explicit text string.
8643 \begin_layout Description
8644 \begin_inset Flex CharStyle:Code
8647 \begin_layout Plain Layout
8654 \begin_inset Flex CharStyle:Code
8657 \begin_layout Plain Layout
8663 ] The string used for a label with a
8664 \begin_inset Flex CharStyle:Code
8667 \begin_layout Plain Layout
8674 \begin_inset Flex CharStyle:Code
8677 \begin_layout Plain Layout
8687 \begin_layout Description
8688 \begin_inset Flex CharStyle:Code
8691 \begin_layout Plain Layout
8698 \begin_inset Flex CharStyle:Code
8701 \begin_layout Plain Layout
8712 \begin_inset Flex CharStyle:Code
8715 \begin_layout Plain Layout
8724 \begin_layout Description
8725 \begin_inset Flex CharStyle:Code
8728 \begin_layout Plain Layout
8735 \begin_inset Flex CharStyle:Code
8738 \begin_layout Plain Layout
8748 ] With this parameter the
8749 \begin_inset Flex CharStyle:MenuItem
8752 \begin_layout Plain Layout
8759 \begin_inset Quotes eld
8762 Vertical space above
8763 \begin_inset Quotes erd
8767 \begin_inset Flex CharStyle:MenuItem
8770 \begin_layout Plain Layout
8771 Edit\SpecialChar \menuseparator
8773 \begin_inset space ~
8781 dialog can be set when initializing a paragraph with this style.
8785 \begin_layout Plain Layout
8788 Note from Jean-Marc:
8790 I'm not sure that this setting has much use, and it should probably be
8791 removed in later versions.
8799 \begin_layout Description
8800 \begin_inset Flex CharStyle:Code
8803 \begin_layout Plain Layout
8809 The font used for both the text body
8815 \begin_inset space ~
8819 \begin_inset CommandInset ref
8821 reference "sec:fonts"
8826 Note that defining this font automatically defines the
8827 \begin_inset Flex CharStyle:Code
8830 \begin_layout Plain Layout
8837 So you should define this one first if you also want to define
8838 \begin_inset Flex CharStyle:Code
8841 \begin_layout Plain Layout
8850 \begin_layout Description
8851 \begin_inset Flex CharStyle:Code
8854 \begin_layout Plain Layout
8861 \begin_inset CommandInset label
8863 name "des:FreeSpacing"
8870 \begin_inset Flex CharStyle:Code
8873 \begin_layout Plain Layout
8884 \begin_inset Flex CharStyle:Code
8887 \begin_layout Plain Layout
8893 ] Usually LyX doesn't allow you to insert more than one space between words,
8894 since a space is considered as the separation between two words, not a
8895 character or symbol of its own.
8896 This is a very fine thing but sometimes annoying, for example, when typing
8897 program code or plain LaTeX code.
8899 \begin_inset Flex CharStyle:Code
8902 \begin_layout Plain Layout
8909 Note that LyX will create protected blanks for the additional blanks when
8910 in another mode than LaTeX-mode.
8913 \begin_layout Description
8914 \begin_inset Flex CharStyle:Code
8917 \begin_layout Plain Layout
8923 [[FIXME]] (Used only with XML-type formats.)
8926 \begin_layout Description
8927 \begin_inset Flex CharStyle:Code
8930 \begin_layout Plain Layout
8937 \begin_inset Flex CharStyle:Code
8940 \begin_layout Plain Layout
8946 If 1, marks the layout as being part of a title block (see also the
8947 \begin_inset Flex CharStyle:Code
8950 \begin_layout Plain Layout
8957 \begin_inset Flex CharStyle:Code
8960 \begin_layout Plain Layout
8969 \begin_layout Description
8970 \begin_inset Flex CharStyle:Code
8973 \begin_layout Plain Layout
8980 \begin_inset Flex CharStyle:Code
8983 \begin_layout Plain Layout
8989 ] This provides extra space between paragraphs that have the same layout.
8990 If you put other layouts into an environment, each is separated with the
8992 \begin_inset Flex CharStyle:Code
8995 \begin_layout Plain Layout
9002 But the whole items of the environment are additionally separated with
9004 \begin_inset Flex CharStyle:Code
9007 \begin_layout Plain Layout
9019 \begin_layout Description
9020 \begin_inset Flex CharStyle:Code
9023 \begin_layout Plain Layout
9029 [[FIXME]] (Used only with XML-type formats.)
9032 \begin_layout Description
9033 \begin_inset Flex CharStyle:Code
9036 \begin_layout Plain Layout
9043 \begin_inset CommandInset label
9045 name "des:KeepEmpty"
9052 \begin_inset Flex CharStyle:Code
9055 \begin_layout Plain Layout
9066 \begin_inset Flex CharStyle:Code
9069 \begin_layout Plain Layout
9075 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9076 lead to empty LaTeX output.
9077 There are some cases where this could be desirable however: in a letter
9078 template, the required fields can be provided as empty fields, so that
9079 people do not forget them; in some special classes, a layout can be used
9080 as some kind of break, which does not contain actual text.
9083 \begin_layout Description
9084 \begin_inset Flex CharStyle:Code
9087 \begin_layout Plain Layout
9093 [float=0] The vertical space between the label and the text body.
9094 Only used for labels that are above the text body (
9095 \begin_inset Flex CharStyle:Code
9098 \begin_layout Plain Layout
9105 \begin_inset Flex CharStyle:Code
9108 \begin_layout Plain Layout
9109 Centered_Top_Environment
9117 \begin_layout Description
9118 \begin_inset Flex CharStyle:Code
9121 \begin_layout Plain Layout
9128 \begin_inset Flex CharStyle:Code
9131 \begin_layout Plain Layout
9138 \begin_inset Newline newline
9141 The name of the counter for automatic numbering (see Section
9142 \begin_inset CommandInset ref
9144 reference "sec:counter"
9149 This must be given if
9150 \begin_inset Flex CharStyle:Code
9153 \begin_layout Plain Layout
9160 \begin_inset Flex CharStyle:Code
9163 \begin_layout Plain Layout
9172 \begin_layout Description
9173 \begin_inset Flex CharStyle:Code
9176 \begin_layout Plain Layout
9182 The font used for the label.
9184 \begin_inset space ~
9188 \begin_inset CommandInset ref
9190 reference "sec:fonts"
9197 \begin_layout Description
9198 \begin_inset Flex CharStyle:Code
9201 \begin_layout Plain Layout
9207 Text that indicates how far a label should be indented.
9210 \begin_layout Description
9211 \begin_inset Flex CharStyle:Code
9214 \begin_layout Plain Layout
9221 \begin_inset Flex CharStyle:Code
9224 \begin_layout Plain Layout
9230 ] The horizontal space between the label and the text body.
9231 Only used for labels that are not above the text body.
9234 \begin_layout Description
9235 \begin_inset Flex CharStyle:Code
9238 \begin_layout Plain Layout
9245 \begin_inset Flex CharStyle:Code
9248 \begin_layout Plain Layout
9254 ] The string used for a label with a
9255 \begin_inset Flex CharStyle:Code
9258 \begin_layout Plain Layout
9266 \begin_inset Flex CharStyle:Code
9269 \begin_layout Plain Layout
9275 is set, this string can be contain the special formatting commands described
9277 \begin_inset CommandInset ref
9279 reference "sec:counter"
9287 \begin_layout Plain Layout
9288 For the sake of backwards compatibility, the string
9289 \begin_inset Flex CharStyle:Code
9292 \begin_layout Plain Layout
9302 will be replaced by the expanded
9303 \begin_inset Flex CharStyle:Code
9306 \begin_layout Plain Layout
9313 \begin_inset Flex CharStyle:Code
9316 \begin_layout Plain Layout
9325 This feature is now obsolete and should be replaced by the mechanisms of
9327 \begin_inset CommandInset ref
9329 reference "sec:counter"
9341 \begin_layout Description
9342 \begin_inset Flex CharStyle:Code
9345 \begin_layout Plain Layout
9352 \begin_inset Flex CharStyle:Code
9355 \begin_layout Plain Layout
9361 ] This is used inside the appendix instead of
9362 \begin_inset Flex CharStyle:Code
9365 \begin_layout Plain Layout
9373 \begin_inset Flex CharStyle:Code
9376 \begin_layout Plain Layout
9383 \begin_inset Flex CharStyle:Code
9386 \begin_layout Plain Layout
9395 \begin_layout Description
9396 \begin_inset Flex CharStyle:Code
9399 \begin_layout Plain Layout
9405 [FIXME] (Used only with XML-type formats.)
9408 \begin_layout Description
9409 \begin_inset Flex CharStyle:Code
9412 \begin_layout Plain Layout
9419 \begin_inset Flex CharStyle:Code
9422 \begin_layout Plain Layout
9427 , Manual, Static, Top_Environment,
9428 \begin_inset Newline newline
9431 Centered_Top_Environment, Sensitive, Counter
9437 \begin_inset Newline newline
9441 \begin_inset Flex CharStyle:Code
9444 \begin_layout Plain Layout
9450 means the label is the very first word (up to the first real blank).
9454 \begin_layout Plain Layout
9455 Use protected spaces if you want more than one word as the label.
9461 \begin_inset Flex CharStyle:Code
9464 \begin_layout Plain Layout
9470 means it is defined in the layout (see
9471 \begin_inset Flex CharStyle:Code
9474 \begin_layout Plain Layout
9482 \begin_inset Flex CharStyle:Code
9485 \begin_layout Plain Layout
9492 \begin_inset Flex CharStyle:Code
9495 \begin_layout Plain Layout
9496 Centered_Top_Environment
9501 are special cases of
9502 \begin_inset Flex CharStyle:Code
9505 \begin_layout Plain Layout
9512 The label will be printed above the paragraph, but only at the top of an
9513 environment or the top of a chain of paragraphs with this layout.
9514 Usage is for example the
9515 \begin_inset Flex CharStyle:MenuItem
9518 \begin_layout Plain Layout
9525 \begin_inset Flex CharStyle:MenuItem
9528 \begin_layout Plain Layout
9535 This is also the case for
9536 \begin_inset Flex CharStyle:Code
9539 \begin_layout Plain Layout
9545 labels with latex type
9546 \begin_inset Flex CharStyle:Code
9549 \begin_layout Plain Layout
9555 , in order to make layouts for theorems work correctly.
9557 \begin_inset Flex CharStyle:Code
9560 \begin_layout Plain Layout
9566 is a special case for the caption-labels
9567 \begin_inset Quotes eld
9571 \begin_inset Quotes erd
9575 \begin_inset Quotes eld
9579 \begin_inset Quotes erd
9584 \begin_inset Flex CharStyle:Code
9587 \begin_layout Plain Layout
9593 means the (hardcoded) label string depends on the kind of float.
9595 \begin_inset Flex CharStyle:Code
9598 \begin_layout Plain Layout
9604 label type defines automatically numbered labels.
9606 \begin_inset CommandInset ref
9608 reference "sec:counter"
9615 \begin_layout Description
9616 \begin_inset Flex CharStyle:Code
9619 \begin_layout Plain Layout
9625 The name of the corresponding LaTeX stuff.
9626 Either the environment or command name.
9629 \begin_layout Description
9630 \begin_inset Flex CharStyle:Code
9633 \begin_layout Plain Layout
9639 An optional parameter for the corresponding
9640 \begin_inset Flex CharStyle:Code
9643 \begin_layout Plain Layout
9650 This parameter cannot be changed from within LyX.
9653 \begin_layout Description
9654 \begin_inset Flex CharStyle:Code
9657 \begin_layout Plain Layout
9664 \begin_inset CommandInset label
9666 name "des:LatexType"
9671 \begin_inset Flex CharStyle:Code
9674 \begin_layout Plain Layout
9679 , Command, Environment, Item_Environment,
9685 \begin_inset Flex CharStyle:Code
9688 \begin_layout Plain Layout
9694 ] How the layout should be translated into LaTeX.
9696 \begin_inset Flex CharStyle:Code
9699 \begin_layout Plain Layout
9705 means nothing special.
9707 \begin_inset Flex CharStyle:Code
9710 \begin_layout Plain Layout
9717 \begin_inset Flex CharStyle:Code
9720 \begin_layout Plain Layout
9727 {\SpecialChar \ldots{}
9734 \begin_inset Flex CharStyle:Code
9737 \begin_layout Plain Layout
9744 \begin_inset Flex CharStyle:Code
9747 \begin_layout Plain Layout
9754 }\SpecialChar \ldots{}
9768 \begin_inset Flex CharStyle:Code
9771 \begin_layout Plain Layout
9778 \begin_inset Flex CharStyle:Code
9781 \begin_layout Plain Layout
9788 \begin_inset Flex CharStyle:Code
9791 \begin_layout Plain Layout
9799 is generated for each paragraph of this environment.
9801 \begin_inset Flex CharStyle:Code
9804 \begin_layout Plain Layout
9811 \begin_inset Flex CharStyle:Code
9814 \begin_layout Plain Layout
9821 \begin_inset Flex CharStyle:Code
9824 \begin_layout Plain Layout
9830 is passed as an argument to the environment.
9832 \begin_inset Flex CharStyle:Code
9835 \begin_layout Plain Layout
9841 can be defined in the
9842 \begin_inset Flex CharStyle:MenuItem
9845 \begin_layout Plain Layout
9850 ayout\SpecialChar \menuseparator
9862 \begin_inset Flex CharStyle:Code
9865 \begin_layout Plain Layout
9873 is perhaps a bit misleading, since these rules apply to SGML classes, too.
9874 Visit the SGML class files for specific examples.
9877 \begin_layout Standard
9878 Putting the last few things together, the LaTeX output will be either:
9881 \begin_layout LyX-Code
9884 latexname[latexparam]{\SpecialChar \ldots{}
9888 \begin_layout Standard
9892 \begin_layout LyX-Code
9895 begin{latexname}[latexparam] \SpecialChar \ldots{}
9901 \begin_layout Standard
9902 depending upon the LaTex type.
9905 \begin_layout Description
9906 \begin_inset Flex CharStyle:Code
9909 \begin_layout Plain Layout
9916 \begin_inset Flex CharStyle:Code
9919 \begin_layout Plain Layout
9925 ] If you put layouts into environments, the leftmargins are not simply added,
9926 but added with a factor
9927 \begin_inset Formula $\frac{4}{depth+4}$
9931 Note that this parameter is also used when the margin is defined as
9932 \begin_inset Flex CharStyle:Code
9935 \begin_layout Plain Layout
9942 \begin_inset Flex CharStyle:Code
9945 \begin_layout Plain Layout
9952 Then it is added to the manual or dynamic margin.
9954 \begin_inset Newline newline
9957 The argument is passed as a string.
9959 \begin_inset Quotes eld
9963 \begin_inset Flex CharStyle:Code
9966 \begin_layout Plain Layout
9973 \begin_inset Quotes erd
9976 means that the paragraph is indented with the width of
9977 \begin_inset Quotes eld
9981 \begin_inset Flex CharStyle:Code
9984 \begin_layout Plain Layout
9991 \begin_inset Quotes erd
9995 You can get a negative width by prefixing the string with
9996 \begin_inset Quotes eld
10000 \begin_inset Flex CharStyle:Code
10003 \begin_layout Plain Layout
10010 \begin_inset Quotes erd
10014 This way was chosen so that the look is the same with each used screen
10019 \begin_layout Description
10020 \begin_inset Flex CharStyle:Code
10023 \begin_layout Plain Layout
10030 \begin_inset Flex CharStyle:Code
10033 \begin_layout Plain Layout
10038 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10044 \begin_inset Newline newline
10047 The kind of margin that the layout has on the left side.
10049 \begin_inset Flex CharStyle:Code
10052 \begin_layout Plain Layout
10058 just means a fixed margin.
10060 \begin_inset Flex CharStyle:Code
10063 \begin_layout Plain Layout
10069 means that the left margin depends on the string entered in the
10070 \begin_inset Flex CharStyle:MenuItem
10073 \begin_layout Plain Layout
10074 Edit\SpecialChar \menuseparator
10076 \begin_inset space ~
10085 This is used to typeset nice lists without tabulators.
10087 \begin_inset Flex CharStyle:Code
10090 \begin_layout Plain Layout
10096 means that the margin depends on the size of the label.
10097 This is used for automatic enumerated headlines.
10098 It is obvious that the headline
10099 \begin_inset Quotes eld
10102 5.4.3.2.1 Very long headline
10103 \begin_inset Quotes erd
10106 must have a wider left margin (as wide as
10107 \begin_inset Quotes eld
10111 \begin_inset Quotes erd
10114 plus the space) than
10115 \begin_inset Quotes eld
10118 3.2 Very long headline
10119 \begin_inset Quotes erd
10123 \begin_inset Quotes eld
10127 \begin_inset Quotes erd
10130 are not able to do this.
10132 \begin_inset Flex CharStyle:Code
10135 \begin_layout Plain Layout
10141 is similar, but only the very first row of the paragraph is dynamic, while
10142 the others are static; this is used, for example, for descriptions.
10144 \begin_inset Flex CharStyle:Code
10147 \begin_layout Plain Layout
10153 means the margin is chosen in a way that the longest row of this paragraph
10154 fits to the right margin.
10155 This is used to typeset an address on the right edge of the page.
10158 \begin_layout Description
10159 \begin_inset Flex CharStyle:Code
10162 \begin_layout Plain Layout
10169 \begin_inset Flex CharStyle:Code
10172 \begin_layout Plain Layout
10181 \begin_inset Flex CharStyle:Code
10184 \begin_layout Plain Layout
10190 ] Whether fragile commands in this layout should be
10191 \begin_inset Flex CharStyle:Code
10194 \begin_layout Plain Layout
10207 whether this command should itself be protected.)
10210 \begin_layout Description
10211 \begin_inset Flex CharStyle:Code
10214 \begin_layout Plain Layout
10221 \begin_inset Flex CharStyle:Code
10224 \begin_layout Plain Layout
10231 \begin_inset Flex CharStyle:Code
10234 \begin_layout Plain Layout
10242 ] Whether newlines are translated into LaTeX newlines (
10243 \begin_inset Flex CharStyle:Code
10246 \begin_layout Plain Layout
10257 The translation can be switched off to allow more comfortable LaTeX editing
10261 \begin_layout Description
10262 \begin_inset Flex CharStyle:Code
10265 \begin_layout Plain Layout
10272 \begin_inset Flex CharStyle:Code
10275 \begin_layout Plain Layout
10282 \begin_inset Flex CharStyle:Code
10285 \begin_layout Plain Layout
10293 ] Whether the following Paragraph is allowed to indent its very first row.
10295 \begin_inset Flex CharStyle:Code
10298 \begin_layout Plain Layout
10304 means that it is not allowed to do so;
10305 \begin_inset Flex CharStyle:Code
10308 \begin_layout Plain Layout
10314 means it could do so if it wants to.
10317 \begin_layout Description
10318 \begin_inset Flex CharStyle:Code
10321 \begin_layout Plain Layout
10327 Name of a layout that has replaced this layout.
10328 This is used to rename a layout, while keeping backward compatibility.
10331 \begin_layout Description
10332 \begin_inset Flex CharStyle:Code
10335 \begin_layout Plain Layout
10342 \begin_inset Flex CharStyle:Code
10345 \begin_layout Plain Layout
10351 ] The number of optional arguments that can be used with this layout.
10352 This is useful for things like section headings, and only makes sense with
10356 \begin_layout Description
10357 \begin_inset Flex CharStyle:Code
10360 \begin_layout Plain Layout
10367 \begin_inset Flex CharStyle:Code
10370 \begin_layout Plain Layout
10376 ] The indent of the very first line of a paragraph.
10378 \begin_inset Flex CharStyle:Code
10381 \begin_layout Plain Layout
10387 will be fixed for a certain layout.
10388 The exception is Standard layout, since the indentation of a Standard layout
10389 paragraph can be prohibited with
10390 \begin_inset Flex CharStyle:Code
10393 \begin_layout Plain Layout
10400 Also, Standard layout paragraphs inside environments use the
10401 \begin_inset Flex CharStyle:Code
10404 \begin_layout Plain Layout
10410 of the environment, not their native one.
10411 For example, Standard paragraphs inside an enumeration are not indented.
10414 \begin_layout Description
10415 \begin_inset Flex CharStyle:Code
10418 \begin_layout Plain Layout
10425 \begin_inset Flex CharStyle:Code
10428 \begin_layout Plain Layout
10434 ] The vertical space between two paragraphs of this layout.
10437 \begin_layout Description
10438 \begin_inset Flex CharStyle:Code
10441 \begin_layout Plain Layout
10448 \begin_inset Flex CharStyle:Code
10451 \begin_layout Plain Layout
10457 ] LyX allows the user to choose either
10458 \begin_inset Quotes eld
10462 \begin_inset Quotes erd
10466 \begin_inset Quotes eld
10470 \begin_inset Quotes erd
10473 to typeset a document.
10475 \begin_inset Quotes eld
10479 \begin_inset Quotes erd
10482 is chosen, this value is completely ignored.
10484 \begin_inset Quotes eld
10488 \begin_inset Quotes erd
10491 is chosen, the parindent of a LaTeXtype
10492 \begin_inset Quotes eld
10496 \begin_inset Quotes erd
10499 layout is ignored and all paragraphs are separated by this parskip argument.
10500 The vertical space is calculated with
10501 \begin_inset Flex CharStyle:Code
10504 \begin_layout Plain Layout
10506 \begin_inset space ~
10515 \begin_inset Flex CharStyle:Code
10518 \begin_layout Plain Layout
10524 is the height of a row with the normal font.
10525 This way, the look stays the same with different screen fonts.
10528 \begin_layout Description
10529 \begin_inset Flex CharStyle:Code
10532 \begin_layout Plain Layout
10539 \begin_inset CommandInset label
10541 name "des:PathThru"
10548 \begin_inset Flex CharStyle:Code
10551 \begin_layout Plain Layout
10562 \begin_inset Flex CharStyle:Code
10565 \begin_layout Plain Layout
10571 ] Whether the contents of this paragraph should be output in raw form, meaning
10572 without special translations that LaTeX would require.
10575 \begin_layout Description
10576 \begin_inset Flex CharStyle:Code
10579 \begin_layout Plain Layout
10586 \begin_inset CommandInset label
10588 name "des:Preamble"
10592 Information to be included in the LaTeX preamable when this style is used.
10593 Used to define macros, load packages, etc., required by this particular
10596 \begin_inset Quotes eld
10600 \begin_inset Flex CharStyle:Code
10603 \begin_layout Plain Layout
10610 \begin_inset Quotes erd
10616 \begin_layout Description
10617 \begin_inset Flex CharStyle:Code
10620 \begin_layout Plain Layout
10627 \begin_inset Flex CharStyle:Code
10630 \begin_layout Plain Layout
10637 \begin_inset CommandInset label
10639 name "des:Requires"
10643 Whether the layout requires the feature
10644 \begin_inset Flex CharStyle:Code
10647 \begin_layout Plain Layout
10654 See the description of
10655 \begin_inset Flex CharStyle:Code
10658 \begin_layout Plain Layout
10665 \begin_inset CommandInset ref
10666 LatexCommand pageref
10667 reference "des:FreeSpacing"
10671 ) for information on `features'.
10675 \begin_layout Description
10676 \begin_inset Flex CharStyle:Code
10679 \begin_layout Plain Layout
10686 \begin_inset Flex CharStyle:Code
10689 \begin_layout Plain Layout
10696 \begin_inset Flex CharStyle:Code
10699 \begin_layout Plain Layout
10708 \begin_layout Description
10709 \begin_inset Flex CharStyle:Code
10712 \begin_layout Plain Layout
10719 \begin_inset Flex CharStyle:Code
10722 \begin_layout Plain Layout
10727 , onehalf, double, other
10736 ] This defines what the default spacing should be in the layout.
10738 \begin_inset Flex CharStyle:Code
10741 \begin_layout Plain Layout
10748 \begin_inset Flex CharStyle:Code
10751 \begin_layout Plain Layout
10758 \begin_inset Flex CharStyle:Code
10761 \begin_layout Plain Layout
10767 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
10768 If you specify the argument
10769 \begin_inset Flex CharStyle:Code
10772 \begin_layout Plain Layout
10778 , then you should also provide a numerical argument which will be the actual
10780 Note that, contrary to other parameters,
10781 \begin_inset Flex CharStyle:Code
10784 \begin_layout Plain Layout
10790 implies the generation of specific LaTeX code, using the package
10793 \begin_inset Flex CharStyle:Code
10796 \begin_layout Plain Layout
10805 \begin_layout Description
10806 \begin_inset Flex CharStyle:Code
10809 \begin_layout Plain Layout
10815 The font used for the text body .
10817 \begin_inset CommandInset ref
10819 reference "sec:fonts"
10826 \begin_layout Description
10827 \begin_inset Flex CharStyle:Code
10830 \begin_layout Plain Layout
10838 The level of the style in the table of contents.
10839 This is used for automatic numbering of section headings.
10842 \begin_layout Description
10843 \begin_inset Flex CharStyle:Code
10846 \begin_layout Plain Layout
10853 \begin_inset Flex CharStyle:Code
10856 \begin_layout Plain Layout
10862 ] The vertical space with which the very first of a chain of paragraphs
10863 with this layout is separated from the previous paragraph.
10864 If the previous paragraph has another layout, the separations are not simply
10865 added, but the maximum is taken.
10868 \begin_layout Subsection
10872 \begin_layout Standard
10873 \begin_inset CommandInset label
10879 Since version 1.3.0 of LyX, it is has been both possible and necessary to
10880 define the floats (
10881 \begin_inset Flex CharStyle:MenuItem
10884 \begin_layout Plain Layout
10891 \begin_inset Flex CharStyle:MenuItem
10894 \begin_layout Plain Layout
10900 , \SpecialChar \ldots{}
10901 ) in the text class itself.
10902 Standard floats are included in the file
10903 \begin_inset Flex CharStyle:Code
10906 \begin_layout Plain Layout
10912 , so you may have to do no more than add
10915 \begin_layout LyX-Code
10916 Input stdfloats.inc
10919 \begin_layout Standard
10920 to your layout file.
10921 If you want to implement a text class that proposes some other float types
10922 (like the AGU class bundled with LyX), the information below will hopefully
10926 \begin_layout Description
10927 \begin_inset Flex CharStyle:Code
10930 \begin_layout Plain Layout
10937 \begin_inset Flex CharStyle:Code
10940 \begin_layout Plain Layout
10947 \begin_inset Quotes erd
10951 \begin_inset Quotes erd
10954 ] The file name extension of an auxiliary file for the list of figures (or
10956 LaTeX writes the captions to this file.
10959 \begin_layout Description
10960 \begin_inset Flex CharStyle:Code
10963 \begin_layout Plain Layout
10970 \begin_inset Flex CharStyle:Code
10973 \begin_layout Plain Layout
10980 \begin_inset Quotes erd
10984 \begin_inset Quotes erd
10987 ] The string that will be used in the menus and also for the caption.
10990 \begin_layout Description
10991 \begin_inset Flex CharStyle:Code
10994 \begin_layout Plain Layout
11001 \begin_inset Flex CharStyle:Code
11004 \begin_layout Plain Layout
11013 \begin_inset Flex CharStyle:Code
11016 \begin_layout Plain Layout
11023 \begin_inset Flex CharStyle:Code
11026 \begin_layout Plain Layout
11032 if the float is already defined by the LaTeX document class.
11034 \begin_inset Flex CharStyle:Code
11037 \begin_layout Plain Layout
11043 , the float will be defined using the LaTeX package
11044 \begin_inset Flex CharStyle:Code
11047 \begin_layout Plain Layout
11056 \begin_layout Description
11057 \begin_inset Flex CharStyle:Code
11060 \begin_layout Plain Layout
11067 \begin_inset Flex CharStyle:Code
11070 \begin_layout Plain Layout
11077 \begin_inset Quotes erd
11081 \begin_inset Quotes erd
11084 ] The heading used for the list of floats.
11087 \begin_layout Description
11088 \begin_inset Flex CharStyle:Code
11091 \begin_layout Plain Layout
11098 \begin_inset Flex CharStyle:Code
11101 \begin_layout Plain Layout
11108 \begin_inset Quotes erd
11112 \begin_inset Quotes erd
11115 ] This (optional) argument determines whether floats of this class will
11116 be numbered within some sectional unit of the document.
11117 For example, if within is equal to
11118 \begin_inset Flex CharStyle:Code
11121 \begin_layout Plain Layout
11127 , the floats will be numbered within chapters.
11131 \begin_layout Description
11132 \begin_inset Flex CharStyle:Code
11135 \begin_layout Plain Layout
11142 \begin_inset Flex CharStyle:Code
11145 \begin_layout Plain Layout
11152 \begin_inset Quotes erd
11156 \begin_inset Quotes erd
11159 ] The default placement for the given class of floats.
11160 The string should be as in standard LaTeX:
11161 \begin_inset Flex CharStyle:Code
11164 \begin_layout Plain Layout
11171 \begin_inset Flex CharStyle:Code
11174 \begin_layout Plain Layout
11181 \begin_inset Flex CharStyle:Code
11184 \begin_layout Plain Layout
11191 \begin_inset Flex CharStyle:Code
11194 \begin_layout Plain Layout
11200 for top, bottom, page, and here, respectively.
11204 \begin_layout Plain Layout
11205 Note that the order of these letters in the string is irrelevant, like in
11211 On top of that there is a new type,
11212 \begin_inset Flex CharStyle:Code
11215 \begin_layout Plain Layout
11221 , which does not really correspond to a float, since it means: put it
11222 \begin_inset Quotes eld
11226 \begin_inset Quotes erd
11230 Note however that the
11231 \begin_inset Flex CharStyle:Code
11234 \begin_layout Plain Layout
11240 specifier is special and, because of implementation details, cannot be
11241 used in non-builtin float types.
11242 If you do not understand what this means, just use
11243 \begin_inset Quotes eld
11247 \begin_inset Flex CharStyle:Code
11250 \begin_layout Plain Layout
11257 \begin_inset Quotes erd
11263 \begin_layout Description
11264 \begin_inset Flex CharStyle:Code
11267 \begin_layout Plain Layout
11274 \begin_inset Flex CharStyle:Code
11277 \begin_layout Plain Layout
11284 \begin_inset Quotes erd
11288 \begin_inset Quotes erd
11291 ] The style used when defining the float using
11292 \begin_inset Flex CharStyle:Code
11295 \begin_layout Plain Layout
11306 \begin_layout Description
11307 \begin_inset Flex CharStyle:Code
11310 \begin_layout Plain Layout
11317 \begin_inset Flex CharStyle:Code
11320 \begin_layout Plain Layout
11327 \begin_inset Quotes erd
11331 \begin_inset Quotes erd
11335 \begin_inset Quotes eld
11339 \begin_inset Quotes erd
11342 of the new class of floats, like program or algorithm.
11343 After the appropriate
11344 \begin_inset Flex CharStyle:Code
11347 \begin_layout Plain Layout
11356 \begin_inset Flex CharStyle:Code
11359 \begin_layout Plain Layout
11368 \begin_inset Flex CharStyle:Code
11371 \begin_layout Plain Layout
11382 \begin_layout Standard
11383 Note that defining a float with type
11384 \begin_inset Flex CharStyle:Code
11387 \begin_layout Plain Layout
11395 automatically defines the corresponding counter with name
11396 \begin_inset Flex CharStyle:Code
11399 \begin_layout Plain Layout
11410 \begin_layout Subsection
11411 Flex insets and InsetLayout
11414 \begin_layout Standard
11415 \begin_inset CommandInset label
11417 name "sec:charstyle"
11421 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11422 these are called Flex insets.
11426 \begin_layout Standard
11427 Flex insets come in three different kinds:
11430 \begin_layout Itemize
11432 \begin_inset Flex CharStyle:Code
11435 \begin_layout Plain Layout
11441 ): These define semantic markup corresponding to such LaTeX commands as
11443 \begin_inset Flex CharStyle:Code
11446 \begin_layout Plain Layout
11455 \begin_inset Flex CharStyle:Code
11458 \begin_layout Plain Layout
11469 \begin_layout Itemize
11471 \begin_inset Flex CharStyle:Code
11474 \begin_layout Plain Layout
11480 ): These can be used to define custom collapsable insets, similar to ERT,
11481 footnote, and the like.
11482 An obvious example is an endnote inset, which is defined in the
11483 \begin_inset Flex CharStyle:Code
11486 \begin_layout Plain Layout
11495 \begin_layout Itemize
11497 \begin_inset Flex CharStyle:Code
11500 \begin_layout Plain Layout
11506 ): For use with DocBook classes.
11509 \begin_layout Standard
11510 Flex insets are defined using the
11511 \begin_inset Flex CharStyle:Code
11514 \begin_layout Plain Layout
11520 tag, which shall be explained in a moment.
11523 \begin_layout Standard
11525 \begin_inset Flex CharStyle:Code
11528 \begin_layout Plain Layout
11534 tag also serves another function: It can be used to customize the general
11535 layout of many different types of insets.
11537 \begin_inset Flex CharStyle:Code
11540 \begin_layout Plain Layout
11546 can be used to customize the layout parameters for footnotes, marginal
11547 notes, note insets, ERT insets, branches, listings, indexes, boxes, tables,
11548 algorithms, URLs, and optional arguments, as well as to define Flex insets.
11551 \begin_layout Standard
11553 \begin_inset Flex CharStyle:Code
11556 \begin_layout Plain Layout
11562 definition must begin with a line of the form:
11565 \begin_layout LyX-Code
11569 \begin_layout Standard
11571 \begin_inset Flex CharStyle:Code
11574 \begin_layout Plain Layout
11580 indicates the inset whose layout is being defined, and here there are two
11584 \begin_layout Enumerate
11585 The layout for a pre-existing inset is being modified.
11586 In this case, can be
11587 \begin_inset Flex CharStyle:Code
11590 \begin_layout Plain Layout
11596 any one of the following:
11597 \begin_inset Flex CharStyle:Code
11600 \begin_layout Plain Layout
11607 \begin_inset Flex CharStyle:Code
11610 \begin_layout Plain Layout
11617 \begin_inset Flex CharStyle:Code
11620 \begin_layout Plain Layout
11627 \begin_inset Flex CharStyle:Code
11630 \begin_layout Plain Layout
11637 \begin_inset Flex CharStyle:Code
11640 \begin_layout Plain Layout
11647 \begin_inset Flex CharStyle:Code
11650 \begin_layout Plain Layout
11657 \begin_inset Flex CharStyle:Code
11660 \begin_layout Plain Layout
11667 \begin_inset Flex CharStyle:Code
11670 \begin_layout Plain Layout
11677 \begin_inset Flex CharStyle:Code
11680 \begin_layout Plain Layout
11687 \begin_inset Flex CharStyle:Code
11690 \begin_layout Plain Layout
11697 \begin_inset Flex CharStyle:Code
11700 \begin_layout Plain Layout
11707 \begin_inset Flex CharStyle:Code
11710 \begin_layout Plain Layout
11717 \begin_inset Flex CharStyle:Code
11720 \begin_layout Plain Layout
11727 \begin_inset Flex CharStyle:Code
11730 \begin_layout Plain Layout
11737 \begin_inset Flex CharStyle:Code
11740 \begin_layout Plain Layout
11747 \begin_inset Flex CharStyle:Code
11750 \begin_layout Plain Layout
11757 \begin_inset Flex CharStyle:Code
11760 \begin_layout Plain Layout
11767 \begin_inset Flex CharStyle:Code
11770 \begin_layout Plain Layout
11777 \begin_inset Flex CharStyle:Code
11780 \begin_layout Plain Layout
11787 \begin_inset Flex CharStyle:Code
11790 \begin_layout Plain Layout
11800 \begin_layout Enumerate
11801 The layout for a Flex inset is being defined.
11803 \begin_inset Flex CharStyle:Code
11806 \begin_layout Plain Layout
11812 can be any valid identifier not used by a pre-existing inset.
11813 Note that the definition of a flex inset must
11818 \begin_inset Flex CharStyle:Code
11821 \begin_layout Plain Layout
11830 \begin_layout Standard
11832 \begin_inset Flex CharStyle:Code
11835 \begin_layout Plain Layout
11841 definition can contain the following entries:
11844 \begin_layout Description
11845 \begin_inset Flex CharStyle:Code
11848 \begin_layout Plain Layout
11854 The color for the inset's background.
11855 The valid colors are defined in
11856 \begin_inset Flex CharStyle:Code
11859 \begin_layout Plain Layout
11868 \begin_layout Description
11869 \begin_inset Flex CharStyle:Code
11872 \begin_layout Plain Layout
11878 As with paragraph styles (see page
11879 \begin_inset CommandInset ref
11881 reference "des:CopyStyle"
11888 \begin_layout Description
11889 \begin_inset Flex CharStyle:Code
11892 \begin_layout Plain Layout
11899 \begin_inset Flex CharStyle:Code
11902 \begin_layout Plain Layout
11911 \begin_inset Flex CharStyle:Code
11914 \begin_layout Plain Layout
11920 ] Indicates whether the user may employ the Paragraph Settings dialog to
11921 customize the paragraph.
11924 \begin_layout Description
11925 \begin_inset Flex CharStyle:Code
11928 \begin_layout Plain Layout
11935 \begin_inset Flex CharStyle:Code
11938 \begin_layout Plain Layout
11945 \begin_inset Flex CharStyle:Code
11948 \begin_layout Plain Layout
11955 \begin_inset Flex CharStyle:Code
11958 \begin_layout Plain Layout
11964 , describing the rendering style used for the inset's frame and buttons.
11965 Footnotes generally use
11966 \begin_inset Flex CharStyle:Code
11969 \begin_layout Plain Layout
11975 , ERT insets generally
11976 \begin_inset Flex CharStyle:Code
11979 \begin_layout Plain Layout
11985 , and character styles
11986 \begin_inset Flex CharStyle:Code
11989 \begin_layout Plain Layout
11998 \begin_layout Description
11999 \begin_inset Flex CharStyle:Code
12002 \begin_layout Plain Layout
12008 Required at the end of the InsetLayout declarations.
12011 \begin_layout Description
12012 \begin_inset Flex CharStyle:Code
12015 \begin_layout Plain Layout
12021 The font used for both the text body
12027 \begin_inset space ~
12031 \begin_inset CommandInset ref
12033 reference "sec:fonts"
12038 Note that defining this font automatically defines the
12039 \begin_inset Flex CharStyle:Code
12042 \begin_layout Plain Layout
12048 to the same value, so define this first and define
12049 \begin_inset Flex CharStyle:Code
12052 \begin_layout Plain Layout
12058 later if you want them to be different.
12061 \begin_layout Description
12062 \begin_inset Flex CharStyle:Code
12065 \begin_layout Plain Layout
12072 \begin_inset Quotes eld
12076 \begin_inset Quotes erd
12079 language, leading to Left-to-Right (latin) output, e.
12080 \begin_inset space \thinspace{}
12084 \begin_inset space \space{}
12091 \begin_layout Description
12092 \begin_inset Flex CharStyle:Code
12095 \begin_layout Plain Layout
12102 \begin_inset Flex CharStyle:Code
12105 \begin_layout Plain Layout
12114 \begin_inset Flex CharStyle:Code
12117 \begin_layout Plain Layout
12123 ] Indicates whether the PlainLayout should be used or, instead, the user
12124 can change the paragraph style used in the inset.
12127 \begin_layout Description
12128 \begin_inset Flex CharStyle:Code
12131 \begin_layout Plain Layout
12137 As with paragraph styles (see page
12138 \begin_inset CommandInset ref
12139 LatexCommand pageref
12140 reference "des:FreeSpacing"
12147 \begin_layout Description
12148 \begin_inset Flex CharStyle:Code
12151 \begin_layout Plain Layout
12157 As with paragraph styles (see page
12158 \begin_inset CommandInset ref
12159 LatexCommand pageref
12160 reference "des:KeepEmpty"
12167 \begin_layout Description
12168 \begin_inset Flex CharStyle:Code
12171 \begin_layout Plain Layout
12177 The font used for the label.
12179 \begin_inset space ~
12183 \begin_inset CommandInset ref
12185 reference "sec:fonts"
12190 Note that this definition can never appear before
12191 \begin_inset Flex CharStyle:Code
12194 \begin_layout Plain Layout
12200 , lest it be ineffective.
12203 \begin_layout Description
12204 \begin_inset Flex CharStyle:Code
12207 \begin_layout Plain Layout
12213 What will be displayed on the button or elsewhere as the inset label.
12214 Some inset types (ERT and Branch) modify this label on the fly.
12217 \begin_layout Description
12218 \begin_inset Flex CharStyle:Code
12221 \begin_layout Plain Layout
12227 The name of the corresponding LaTeX stuff.
12228 Either the environment or command name.
12231 \begin_layout Description
12232 \begin_inset Flex CharStyle:Code
12235 \begin_layout Plain Layout
12241 The optional parameter for the corresponding
12242 \begin_inset Flex CharStyle:Code
12245 \begin_layout Plain Layout
12251 stuff, including possible bracket pairs like
12252 \begin_inset Flex CharStyle:Code
12255 \begin_layout Plain Layout
12262 This parameter cannot be changed from within LyX.
12265 \begin_layout Description
12266 \begin_inset Flex CharStyle:Code
12269 \begin_layout Plain Layout
12275 As with paragraph styles (see page
12276 \begin_inset CommandInset ref
12277 LatexCommand pageref
12278 reference "des:LatexType"
12285 \begin_layout Description
12286 \begin_inset Flex CharStyle:Code
12289 \begin_layout Plain Layout
12296 \begin_inset Flex CharStyle:Code
12299 \begin_layout Plain Layout
12306 \begin_inset Flex CharStyle:Code
12309 \begin_layout Plain Layout
12316 \begin_inset Flex CharStyle:Code
12319 \begin_layout Plain Layout
12326 \begin_inset Flex CharStyle:Code
12329 \begin_layout Plain Layout
12335 (indicating a dummy definition ending definitions of charstyles, etc).
12336 This entry is required in and is only meaningful for Flex insets.
12337 Among other things, it determines on which menu this inset will appear.
12340 \begin_layout Description
12341 \begin_inset Flex CharStyle:Code
12344 \begin_layout Plain Layout
12351 \begin_inset Flex CharStyle:Code
12354 \begin_layout Plain Layout
12363 \begin_inset Flex CharStyle:Code
12366 \begin_layout Plain Layout
12372 ] Whether multiple paragraphs are permitted in this inset.
12373 This will also set CustomPars to the same value and ForcePlain to the opposite
12375 These can be reset to other values, if they are used
12382 \begin_layout Description
12383 \begin_inset Flex CharStyle:Code
12386 \begin_layout Plain Layout
12393 \begin_inset Flex CharStyle:Code
12396 \begin_layout Plain Layout
12405 \begin_inset Flex CharStyle:Code
12408 \begin_layout Plain Layout
12414 ] Whether fragile commands in this layout should be
12415 \begin_inset Flex CharStyle:Code
12418 \begin_layout Plain Layout
12431 whether the command should itself be protected.)
12434 \begin_layout Description
12435 \begin_inset Flex CharStyle:Code
12438 \begin_layout Plain Layout
12445 \begin_inset Flex CharStyle:Code
12448 \begin_layout Plain Layout
12457 \begin_inset Flex CharStyle:Code
12460 \begin_layout Plain Layout
12466 ] As with paragraph styles (see page
12467 \begin_inset CommandInset ref
12469 reference "des:PathThru"
12476 \begin_layout Description
12477 \begin_inset Flex CharStyle:Code
12480 \begin_layout Plain Layout
12486 As with paragraph styles (see page
12487 \begin_inset CommandInset ref
12488 LatexCommand pageref
12489 reference "des:Preamble"
12496 \begin_layout Description
12497 \begin_inset Flex CharStyle:Code
12500 \begin_layout Plain Layout
12507 \begin_inset Flex CharStyle:Code
12510 \begin_layout Plain Layout
12516 ] As with paragraph styles (see page
12517 \begin_inset CommandInset ref
12518 LatexCommand pageref
12519 reference "des:Requires"
12526 \begin_layout Subsection
12530 \begin_layout Standard
12531 \begin_inset CommandInset label
12537 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12539 \begin_inset Flex CharStyle:MenuItem
12542 \begin_layout Plain Layout
12549 \begin_inset Flex CharStyle:MenuItem
12552 \begin_layout Plain Layout
12558 , \SpecialChar \ldots{}
12559 ) in the text class itself.
12560 The standard counters are defined in the file
12561 \begin_inset Flex CharStyle:Code
12564 \begin_layout Plain Layout
12570 , so you may have to do no more than add
12573 \begin_layout LyX-Code
12574 Input stdcounters.inc
12577 \begin_layout Standard
12578 to your layout file to get them to work.
12579 But if you want to define custom counters, then you can do so.
12580 The counter declaration must begin with:
12583 \begin_layout LyX-Code
12587 \begin_layout Standard
12588 where of course `name' is replaced by the name of the counter.
12589 And it must end with
12590 \begin_inset Quotes eld
12594 \begin_inset Flex CharStyle:Code
12597 \begin_layout Plain Layout
12604 \begin_inset Quotes erd
12608 The following parameters can also be used:
12611 \begin_layout Description
12612 \begin_inset Flex CharStyle:Code
12615 \begin_layout Plain Layout
12616 LabelString [string=""]
12621 when this is defined, this string defines how the counter is displayed.
12622 Setting this value sets
12623 \begin_inset Flex CharStyle:Code
12626 \begin_layout Plain Layout
12627 LabelStringAppendix
12633 The following special constructs can be used in the string:
12637 \begin_layout Itemize
12638 \begin_inset Flex CharStyle:Code
12641 \begin_layout Plain Layout
12649 will be replaced by the expansion of the
12650 \begin_inset Flex CharStyle:Code
12653 \begin_layout Plain Layout
12660 \begin_inset Flex CharStyle:Code
12663 \begin_layout Plain Layout
12664 LabelStringAppendix
12670 \begin_inset Flex CharStyle:Code
12673 \begin_layout Plain Layout
12683 \begin_layout Itemize
12684 counter values can be expressed using LaTeX-like macros
12685 \begin_inset Flex CharStyle:Code
12688 \begin_layout Plain Layout
12705 \begin_inset Flex CharStyle:Code
12708 \begin_layout Plain Layout
12720 \begin_layout Plain Layout
12730 Actually, the situation is a bit more complicated: any
12749 other than those descibed below will produce arabic numerals.
12750 It would not be surprising to see this change in the future.
12756 \begin_inset Flex CharStyle:Code
12759 \begin_layout Plain Layout
12765 : 1, 2, 3,\SpecialChar \ldots{}
12767 \begin_inset Flex CharStyle:Code
12770 \begin_layout Plain Layout
12776 for lower-case letters: a, b, c, \SpecialChar \ldots{}
12778 \begin_inset Flex CharStyle:Code
12781 \begin_layout Plain Layout
12787 for upper-case letters: A, B, C, \SpecialChar \ldots{}
12789 \begin_inset Flex CharStyle:Code
12792 \begin_layout Plain Layout
12798 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
12800 \begin_inset Flex CharStyle:Code
12803 \begin_layout Plain Layout
12809 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
12811 \begin_inset Flex CharStyle:Code
12814 \begin_layout Plain Layout
12820 for hebrew numerals.
12824 \begin_layout Standard
12825 If LabelString is not defined, a default value is constructed as follows:
12826 if the counter has a master counter
12827 \begin_inset Flex CharStyle:Code
12830 \begin_layout Plain Layout
12837 \begin_inset Flex CharStyle:Code
12840 \begin_layout Plain Layout
12847 \begin_inset Flex CharStyle:Code
12850 \begin_layout Plain Layout
12860 is used; otherwise the string
12861 \begin_inset Flex CharStyle:Code
12864 \begin_layout Plain Layout
12875 \begin_layout Description
12876 \begin_inset Flex CharStyle:Code
12879 \begin_layout Plain Layout
12880 LabelStringAppendix [string=""]
12886 \begin_inset Flex CharStyle:Code
12889 \begin_layout Plain Layout
12895 , but for use in the Appendix.
12898 \begin_layout Description
12899 \begin_inset Flex CharStyle:Code
12902 \begin_layout Plain Layout
12909 \begin_inset Flex CharStyle:Code
12912 \begin_layout Plain Layout
12919 \begin_inset Quotes erd
12923 \begin_inset Quotes erd
12926 ] If this is set to the name of another counter, the present counter will
12927 be reset everytime the other one is increased.
12929 \begin_inset Flex CharStyle:Code
12932 \begin_layout Plain Layout
12939 \begin_inset Flex CharStyle:Code
12942 \begin_layout Plain Layout
12951 \begin_layout Subsection
12955 \begin_layout Standard
12956 \begin_inset CommandInset label
12962 A font description looks like this:
12965 \begin_layout LyX-Code
12975 \begin_layout LyX-Code
12979 \begin_layout LyX-Code
12983 \begin_layout Standard
12984 The following commands are available:
12987 \begin_layout Description
12988 \begin_inset Flex CharStyle:Code
12991 \begin_layout Plain Layout
12998 \begin_inset Flex CharStyle:Code
13001 \begin_layout Plain Layout
13010 \begin_inset Flex CharStyle:Code
13013 \begin_layout Plain Layout
13020 \begin_inset Flex CharStyle:Code
13023 \begin_layout Plain Layout
13030 \begin_inset Flex CharStyle:Code
13033 \begin_layout Plain Layout
13040 \begin_inset Flex CharStyle:Code
13043 \begin_layout Plain Layout
13050 \begin_inset Flex CharStyle:Code
13053 \begin_layout Plain Layout
13060 \begin_inset Flex CharStyle:Code
13063 \begin_layout Plain Layout
13070 \begin_inset Flex CharStyle:Code
13073 \begin_layout Plain Layout
13080 \begin_inset Flex CharStyle:Code
13083 \begin_layout Plain Layout
13092 \begin_layout Description
13093 \begin_inset Flex CharStyle:Code
13096 \begin_layout Plain Layout
13105 \begin_inset Flex CharStyle:Code
13108 \begin_layout Plain Layout
13119 \begin_inset Flex CharStyle:Code
13122 \begin_layout Plain Layout
13129 \begin_inset Flex CharStyle:Code
13132 \begin_layout Plain Layout
13141 \begin_layout Description
13142 \begin_inset Flex CharStyle:Code
13145 \begin_layout Plain Layout
13152 \begin_inset Flex CharStyle:Code
13155 \begin_layout Plain Layout
13161 ] Valid argument sare:
13162 \begin_inset Flex CharStyle:Code
13165 \begin_layout Plain Layout
13172 \begin_inset Flex CharStyle:Code
13175 \begin_layout Plain Layout
13182 \begin_inset Flex CharStyle:Code
13185 \begin_layout Plain Layout
13192 \begin_inset Flex CharStyle:Code
13195 \begin_layout Plain Layout
13202 \begin_inset Flex CharStyle:Code
13205 \begin_layout Plain Layout
13212 \begin_inset Flex CharStyle:Code
13215 \begin_layout Plain Layout
13222 Each of these turns on or off the corresponding attribute.
13225 \begin_layout Description
13226 \begin_inset Flex CharStyle:Code
13229 \begin_layout Plain Layout
13238 \begin_inset Flex CharStyle:Code
13241 \begin_layout Plain Layout
13252 \begin_inset Flex CharStyle:Code
13255 \begin_layout Plain Layout
13264 \begin_layout Description
13265 \begin_inset Flex CharStyle:Code
13268 \begin_layout Plain Layout
13277 \begin_inset Flex CharStyle:Code
13280 \begin_layout Plain Layout
13291 \begin_inset Flex CharStyle:Code
13294 \begin_layout Plain Layout
13301 \begin_inset Flex CharStyle:Code
13304 \begin_layout Plain Layout
13311 \begin_inset Flex CharStyle:Code
13314 \begin_layout Plain Layout
13323 \begin_layout Description
13324 \begin_inset Flex CharStyle:Code
13327 \begin_layout Plain Layout
13334 \begin_inset Flex CharStyle:Code
13337 \begin_layout Plain Layout
13344 \begin_inset Flex CharStyle:Code
13347 \begin_layout Plain Layout
13354 \begin_inset Flex CharStyle:Code
13357 \begin_layout Plain Layout
13366 \begin_inset Flex CharStyle:Code
13369 \begin_layout Plain Layout
13376 \begin_inset Flex CharStyle:Code
13379 \begin_layout Plain Layout
13386 \begin_inset Flex CharStyle:Code
13389 \begin_layout Plain Layout
13396 \begin_inset Flex CharStyle:Code
13399 \begin_layout Plain Layout
13406 \begin_inset Flex CharStyle:Code
13409 \begin_layout Plain Layout
13418 \begin_layout Subsection
13419 Upgrading old layout files
13422 \begin_layout Standard
13423 The file format of layout files changes from time to time, so old layout
13424 files need to be converted.
13425 This process has been automated since LyX 1.4.0: If LyX reads an old format
13426 layout file it will call the conversion tool
13427 \begin_inset Flex CharStyle:Code
13430 \begin_layout Plain Layout
13431 LyXDir/scripts/layout2layout.py
13436 and convert it to a temporary file in current format.
13437 The original file is left untouched.
13438 If you want to convert the layout file permanently, just call the converter
13442 \begin_layout LyX-Code
13443 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13446 \begin_layout Standard
13447 (You need to replace
13448 \begin_inset Flex CharStyle:Code
13451 \begin_layout Plain Layout
13457 with the name of your LyX system directory, unless you happen to have defined
13458 such an environment variable.) Then copy
13459 \begin_inset Flex CharStyle:Code
13462 \begin_layout Plain Layout
13469 \begin_inset Flex CharStyle:Code
13472 \begin_layout Plain Layout
13481 \begin_layout Standard
13482 The automatic conversion only handles syntax changes.
13483 It cannot handle the case where the contents of included files was changed,
13484 so these will have to be converted separately.
13487 \begin_layout Section
13489 \begin_inset CommandInset label
13491 name "sec:templates"
13498 \begin_layout Standard
13499 Templates are created just like usual documents.
13500 The only difference is that usual documents contain all possible settings,
13501 including the font scheme and the paper size.
13502 Usually a user doesn't want a template to overwrite his defaults in these
13504 For that reason, the designer of a template should remove the corresponding
13506 \begin_inset Flex CharStyle:Code
13509 \begin_layout Plain Layout
13518 \begin_inset Flex CharStyle:Code
13521 \begin_layout Plain Layout
13529 from the template LyX file.
13530 This can be done with any simple text-editor, for example
13531 \begin_inset Flex CharStyle:Code
13534 \begin_layout Plain Layout
13541 \begin_inset Flex CharStyle:Code
13544 \begin_layout Plain Layout
13554 \begin_layout Standard
13555 Put the edited template files you create in
13556 \begin_inset Flex CharStyle:Code
13559 \begin_layout Plain Layout
13565 , copy the ones you use from the global template directory in
13566 \begin_inset Flex CharStyle:Code
13569 \begin_layout Plain Layout
13575 to the same place, and redefine the template path in the
13576 \begin_inset Flex CharStyle:MenuItem
13579 \begin_layout Plain Layout
13580 Tools\SpecialChar \menuseparator
13581 Preferences\SpecialChar \menuseparator
13590 \begin_layout Standard
13591 Note that there is a template which has a particular meaning:
13592 \begin_inset Flex CharStyle:Code
13595 \begin_layout Plain Layout
13602 This template is loaded everytime you create a new document with
13603 \begin_inset Flex CharStyle:MenuItem
13606 \begin_layout Plain Layout
13607 File\SpecialChar \menuseparator
13613 in order to provide useful defaults.
13614 To create this template from inside LyX, all you have to do is to open
13615 a document with the correct settings, and use the
13616 \begin_inset Flex CharStyle:MenuItem
13619 \begin_layout Plain Layout
13620 Save as Document Defaults
13628 \begin_layout Chapter
13629 Including External Material
13632 \begin_layout Standard
13633 \begin_inset Box Shadowbox
13642 height_special "totalheight"
13645 \begin_layout Plain Layout
13646 WARNING: This portion of the documentation has not been updated for some
13648 We certainly hope that it is still accurate, but there are no guarantees.
13656 \begin_layout Standard
13657 The use of material from sources external to LyX is covered in detail in
13663 This part of the manual covers what needs to happen behind the scenes for
13664 new sorts of material to be included.
13667 \begin_layout Section
13671 \begin_layout Standard
13672 The external material feature is based on the concept of a
13677 A template is a specification of how LyX should interface with a certain
13679 As bundled, LyX comes with predefined templates for Xfig figures, various
13680 raster format images, chess diagrams, and LilyPond music notation.
13681 You can check the actual list by using the menu
13682 \begin_inset Flex CharStyle:MenuItem
13685 \begin_layout Plain Layout
13686 Insert\SpecialChar \menuseparator
13687 File\SpecialChar \menuseparator
13694 Furthermore, it is possible to roll your own template to support a specific
13696 Later we'll describe in more detail what is involved, and hopefully you
13697 will submit all the templates you create so we can include them in a later
13701 \begin_layout Standard
13702 Another basic idea of the external material feature is to distinguish between
13703 the original file that serves as a base for final material and the produced
13704 file that is included in your exported or printed document.
13705 For example, consider the case of a figure produced with
13706 \begin_inset Flex CharStyle:Code
13709 \begin_layout Plain Layout
13716 The Xfig application itself works on an original file with the
13717 \begin_inset Flex CharStyle:Code
13720 \begin_layout Plain Layout
13727 Within XFig, you create and change your figure, and when you are done,
13729 \begin_inset Flex CharStyle:Code
13732 \begin_layout Plain Layout
13739 When you want to include the figure in your document, you invoke
13740 \begin_inset Flex CharStyle:Code
13743 \begin_layout Plain Layout
13749 in order to create a PostScript file that can readily be included in your
13752 \begin_inset Flex CharStyle:Code
13755 \begin_layout Plain Layout
13761 file is the original file, and the PostScript file is the produced file.
13764 \begin_layout Standard
13765 This distinction is important in order to allow updating of the material
13766 while you are in the process of writing the document.
13767 Furthermore, it provides us with the flexibility that is needed to support
13768 multiple export formats.
13769 For instance, in the case of a plain text file, it is not exactly an award-winn
13770 ing idea to include the figure as raw PostScript®.
13771 Instead, you'd either prefer to just include a reference to the figure
13772 or try to invoke some graphics to Ascii converter to make the final result
13773 look similar to the real graphics.
13774 The external material management allows you to do this, because it is parameter
13775 ized on the different export formats that LyX supports.
13778 \begin_layout Standard
13779 Besides supporting the production of different products according to the
13780 exported format, it supports tight integration with editing and viewing
13782 In the case of an XFig figure, you are able to invoke Xfig on the original
13783 file with a single click from within the external material dialog in LyX,
13784 and also preview the produced PostScript file with ghostview with another
13786 No more fiddling around with the command line and/or file browsers to locate
13787 and manipulate the original or produced files.
13788 In this way, you are finally able to take full advantage of the many different
13789 applications that are relevant to use when you write your documents, and
13790 ultimately be more productive.
13793 \begin_layout Section
13794 The external template configuration file
13797 \begin_layout Standard
13798 It is relatively easy to add custom external template definitions to LyX.
13799 However, be aware that doing this in an careless manner most probably
13803 introduce an easily exploitable security hole.
13804 So before you do this, please read the discussion about security in section
13806 \begin_inset CommandInset ref
13808 reference "sec:Security-discussion"
13815 \begin_layout Standard
13816 Having said that, we encourage you to submit any interesting templates that
13821 \begin_layout Standard
13822 The external templates are defined in the
13823 \begin_inset Flex CharStyle:Code
13826 \begin_layout Plain Layout
13827 LyXDir/lib/external_templates
13833 You can place your own version in
13834 \begin_inset Flex CharStyle:Code
13837 \begin_layout Plain Layout
13838 UserDir/external_templates
13846 \begin_layout Standard
13847 A typical template looks like this:
13850 \begin_layout LyX-Code
13854 \begin_layout LyX-Code
13855 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
13858 \begin_layout LyX-Code
13862 \begin_layout LyX-Code
13866 \begin_layout LyX-Code
13870 \begin_layout LyX-Code
13874 \begin_layout LyX-Code
13878 \begin_layout LyX-Code
13879 AutomaticProduction true
13882 \begin_layout LyX-Code
13886 \begin_layout LyX-Code
13890 \begin_layout LyX-Code
13894 \begin_layout LyX-Code
13895 TransformCommand Rotate RotationLatexCommand
13898 \begin_layout LyX-Code
13899 TransformCommand Resize ResizeLatexCommand
13902 \begin_layout LyX-Code
13903 Product "$$RotateFront$$ResizeFront
13906 \begin_layout LyX-Code
13911 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
13914 \begin_layout LyX-Code
13915 $$ResizeBack$$RotateBack"
13918 \begin_layout LyX-Code
13922 \begin_layout LyX-Code
13923 UpdateResult "$$AbsPath$$Basename.pstex_t"
13926 \begin_layout LyX-Code
13927 Requirement "graphicx"
13930 \begin_layout LyX-Code
13931 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
13934 \begin_layout LyX-Code
13935 ReferencedFile latex "$$AbsPath$$Basename.eps"
13938 \begin_layout LyX-Code
13939 ReferencedFile dvi "$$AbsPath$$Basename.eps"
13942 \begin_layout LyX-Code
13946 \begin_layout LyX-Code
13950 \begin_layout LyX-Code
13951 TransformCommand Rotate RotationLatexCommand
13954 \begin_layout LyX-Code
13955 TransformCommand Resize ResizeLatexCommand
13958 \begin_layout LyX-Code
13959 Product "$$RotateFront$$ResizeFront
13962 \begin_layout LyX-Code
13967 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
13970 \begin_layout LyX-Code
13971 $$ResizeBack$$RotateBack"
13974 \begin_layout LyX-Code
13975 UpdateFormat pdftex
13978 \begin_layout LyX-Code
13979 UpdateResult "$$AbsPath$$Basename.pdftex_t"
13982 \begin_layout LyX-Code
13983 Requirement "graphicx"
13986 \begin_layout LyX-Code
13987 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
13990 \begin_layout LyX-Code
13991 ReferencedFile latex "$$AbsPath$$Basename.pdf"
13994 \begin_layout LyX-Code
13998 \begin_layout LyX-Code
14002 \begin_layout LyX-Code
14003 Product "$$Contents(
14005 "$$AbsPath$$Basename.asc
14010 \begin_layout LyX-Code
14011 UpdateFormat asciixfig
14014 \begin_layout LyX-Code
14015 UpdateResult "$$AbsPath$$Basename.asc"
14018 \begin_layout LyX-Code
14022 \begin_layout LyX-Code
14026 \begin_layout LyX-Code
14027 Product "<graphic fileref=
14029 "$$AbsOrRelPathMaster$$Basename.eps
14034 \begin_layout LyX-Code
14038 \begin_layout LyX-Code
14042 \begin_layout LyX-Code
14043 UpdateResult "$$AbsPath$$Basename.eps"
14046 \begin_layout LyX-Code
14047 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14050 \begin_layout LyX-Code
14051 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14054 \begin_layout LyX-Code
14058 \begin_layout LyX-Code
14059 Product "[XFig: $$FName]"
14062 \begin_layout LyX-Code
14066 \begin_layout LyX-Code
14070 \begin_layout Standard
14071 As you can see, the template is enclosed in
14072 \begin_inset Flex CharStyle:Code
14075 \begin_layout Plain Layout
14081 \SpecialChar \ldots{}
14083 \begin_inset Flex CharStyle:Code
14086 \begin_layout Plain Layout
14093 It contains a header specifying some general settings and, for each supported
14094 primary document file format, a section
14095 \begin_inset Flex CharStyle:Code
14098 \begin_layout Plain Layout
14104 \SpecialChar \ldots{}
14106 \begin_inset Flex CharStyle:Code
14109 \begin_layout Plain Layout
14118 \begin_layout Subsection
14119 The template header
14122 \begin_layout Description
14123 \begin_inset Flex CharStyle:Code
14126 \begin_layout Plain Layout
14127 AutomaticProduction
14128 \begin_inset space ~
14136 Whether the file represented by the template must be generated by LyX.
14137 This command must occur exactly once.
14140 \begin_layout Description
14141 \begin_inset Flex CharStyle:Code
14144 \begin_layout Plain Layout
14146 \begin_inset space ~
14154 A glob pattern that is used in the file dialog to filter out the desired
14156 If there is more than one possible file extension (e.
14157 \begin_inset space \thinspace{}
14161 \begin_inset space \space{}
14165 \begin_inset Flex CharStyle:Code
14168 \begin_layout Plain Layout
14175 \begin_inset Flex CharStyle:Code
14178 \begin_layout Plain Layout
14184 ), use something like
14185 \begin_inset Flex CharStyle:Code
14188 \begin_layout Plain Layout
14195 This command must occur exactly once.
14198 \begin_layout Description
14199 \begin_inset Flex CharStyle:Code
14202 \begin_layout Plain Layout
14204 \begin_inset space ~
14212 The text that is displayed on the button.
14213 This command must occur exactly once.
14216 \begin_layout Description
14217 \begin_inset Flex CharStyle:Code
14220 \begin_layout Plain Layout
14222 \begin_inset space ~
14226 \begin_inset space ~
14234 The help text that is used in the External dialog.
14235 Provide enough information to explain to the user just what the template
14236 can provide him with.
14237 This command must occur exactly once.
14240 \begin_layout Description
14241 \begin_inset Flex CharStyle:Code
14244 \begin_layout Plain Layout
14246 \begin_inset space ~
14254 The file format of the original file.
14255 This must be the name of a format that is known to LyX (see section
14256 \begin_inset CommandInset ref
14258 reference "sub:Formats"
14264 \begin_inset Quotes eld
14268 \begin_inset Flex CharStyle:Code
14271 \begin_layout Plain Layout
14278 \begin_inset Quotes erd
14281 if the template can handle original files of more than one format.
14282 LyX will attempt to interrogate the file itself in order to deduce its
14283 format in this case.
14284 This command must occur exactly once.
14287 \begin_layout Description
14288 \begin_inset Flex CharStyle:Code
14291 \begin_layout Plain Layout
14293 \begin_inset space ~
14301 A unique name for the template.
14302 It must not contain substitution macros (see below).
14305 \begin_layout Description
14306 \begin_inset Flex CharStyle:Code
14309 \begin_layout Plain Layout
14311 \begin_inset space ~
14314 Rotate|Resize|Clip|Extra
14319 This command specifies which transformations are supported by this template.
14320 It may occur zero or more times.
14321 This command enables the corresponding tabs in the external dialog.
14323 \begin_inset Flex CharStyle:Code
14326 \begin_layout Plain Layout
14332 command must have either a corresponding
14333 \begin_inset Flex CharStyle:Code
14336 \begin_layout Plain Layout
14343 \begin_inset Flex CharStyle:Code
14346 \begin_layout Plain Layout
14353 \begin_inset Flex CharStyle:Code
14356 \begin_layout Plain Layout
14363 Otherwise the transformation will not be supported by that format.
14366 \begin_layout Subsection
14370 \begin_layout Description
14371 \begin_inset Flex CharStyle:Code
14374 \begin_layout Plain Layout
14376 \begin_inset space ~
14379 LaTeX|PDFLaTeX|PlainText|DocBook
14384 The primary document file format that this format definition is for.
14385 Not every template has a sensible representation in all document file formats.
14386 Please define nevertheless a
14387 \begin_inset Flex CharStyle:Code
14390 \begin_layout Plain Layout
14396 section for all formats.
14397 Use a dummy text when no representation is available.
14398 Then you can at least see a reference to the external material in the exported
14402 \begin_layout Description
14403 \begin_inset Flex CharStyle:Code
14406 \begin_layout Plain Layout
14408 \begin_inset space ~
14412 \begin_inset space ~
14420 This command defines an additional macro
14421 \begin_inset Flex CharStyle:Code
14424 \begin_layout Plain Layout
14430 for substitution in
14431 \begin_inset Flex CharStyle:Code
14434 \begin_layout Plain Layout
14442 \begin_inset Flex CharStyle:Code
14445 \begin_layout Plain Layout
14451 itself may contain substitution macros.
14452 The advantage over using
14453 \begin_inset Flex CharStyle:Code
14456 \begin_layout Plain Layout
14463 \begin_inset Flex CharStyle:Code
14466 \begin_layout Plain Layout
14472 is that the substituted value of
14473 \begin_inset Flex CharStyle:Code
14476 \begin_layout Plain Layout
14482 is sanitized so that it is a valid optional argument in the document format.
14483 This command may occur zero or more times.
14486 \begin_layout Description
14487 \begin_inset Flex CharStyle:Code
14490 \begin_layout Plain Layout
14492 \begin_inset space ~
14500 The text that is inserted in the exported document.
14501 This is actually the most important command and can be quite complex.
14502 This command must occur exactly once.
14505 \begin_layout Description
14506 \begin_inset Flex CharStyle:Code
14509 \begin_layout Plain Layout
14511 \begin_inset space ~
14519 This command specifies a preamble snippet that will be included in the
14521 It has to be defined using
14522 \begin_inset Flex CharStyle:Code
14525 \begin_layout Plain Layout
14531 \SpecialChar \ldots{}
14533 \begin_inset Flex CharStyle:Code
14536 \begin_layout Plain Layout
14543 This command may occur zero or more times.
14546 \begin_layout Description
14547 \begin_inset Flex CharStyle:Code
14550 \begin_layout Plain Layout
14552 \begin_inset space ~
14556 \begin_inset space ~
14564 This command denotes files that are created by the conversion process and
14565 are needed for a particular export format.
14566 If the filename is relative, it is interpreted relative to the master document.
14567 This command may be given zero or more times.
14570 \begin_layout Description
14571 \begin_inset Flex CharStyle:Code
14574 \begin_layout Plain Layout
14576 \begin_inset space ~
14584 The name of a required LaTeX package.
14585 The package is included via
14586 \begin_inset Flex CharStyle:Code
14589 \begin_layout Plain Layout
14597 in the LaTeX preamble.
14598 This command may occur zero or more times.
14601 \begin_layout Description
14602 \begin_inset Flex CharStyle:Code
14605 \begin_layout Plain Layout
14607 \begin_inset space ~
14611 \begin_inset space ~
14614 RotationLatexCommand
14619 This command specifies that the built in LaTeX command should be used for
14621 This command may occur once or not at all.
14624 \begin_layout Description
14625 \begin_inset Flex CharStyle:Code
14628 \begin_layout Plain Layout
14630 \begin_inset space ~
14634 \begin_inset space ~
14642 This command specifies that the built in LaTeX command should be used for
14644 This command may occur once or not at all.
14647 \begin_layout Description
14648 \begin_inset Flex CharStyle:Code
14651 \begin_layout Plain Layout
14653 \begin_inset space ~
14657 \begin_inset space ~
14660 RotationLatexOption
14665 This command specifies that rotation is done via an optional argument.
14666 This command may occur once or not at all.
14669 \begin_layout Description
14670 \begin_inset Flex CharStyle:Code
14673 \begin_layout Plain Layout
14675 \begin_inset space ~
14679 \begin_inset space ~
14687 This command specifies that resizing is done via an optional argument.
14688 This command may occur once or not at all.
14691 \begin_layout Description
14692 \begin_inset Flex CharStyle:Code
14695 \begin_layout Plain Layout
14697 \begin_inset space ~
14701 \begin_inset space ~
14709 This command specifies that clipping is done via an optional argument.
14710 This command may occur once or not at all.
14713 \begin_layout Description
14714 \begin_inset Flex CharStyle:Code
14717 \begin_layout Plain Layout
14719 \begin_inset space ~
14723 \begin_inset space ~
14731 This command specifies that an extra optional argument is used.
14732 This command may occur once or not at all.
14735 \begin_layout Description
14736 \begin_inset Flex CharStyle:Code
14739 \begin_layout Plain Layout
14741 \begin_inset space ~
14749 The file format of the converted file.
14750 This must be the name of a format that is known to LyX (see the
14751 \begin_inset Flex CharStyle:MenuItem
14754 \begin_layout Plain Layout
14759 ools\SpecialChar \menuseparator
14764 references:Conversion
14770 This command must occur exactly once.
14773 \begin_layout Description
14774 \begin_inset Flex CharStyle:Code
14777 \begin_layout Plain Layout
14779 \begin_inset space ~
14787 The file name of the converted file.
14788 The file name must be absolute.
14789 This command must occur exactly once.
14792 \begin_layout Subsection
14793 Preamble definitions
14796 \begin_layout Standard
14797 The external template configuration file may contain additional preamble
14798 definitions enclosed by
14799 \begin_inset Flex CharStyle:Code
14802 \begin_layout Plain Layout
14808 \SpecialChar \ldots{}
14810 \begin_inset Flex CharStyle:Code
14813 \begin_layout Plain Layout
14820 They can be used by the templates in the
14821 \begin_inset Flex CharStyle:Code
14824 \begin_layout Plain Layout
14833 \begin_layout Section
14834 The substitution mechanism
14837 \begin_layout Standard
14838 When the external material facility invokes an external program, it is done
14839 on the basis of a command defined in the template configuration file.
14840 These commands can contain various macros that are expanded before execution.
14841 Execution always take place in the directory of the containing document.
14844 \begin_layout Standard
14845 Also, whenever external material is to be displayed, the name will be produced
14846 by the substitution mechanism, and most other commands in the template
14847 definition support substitution as well.
14850 \begin_layout Standard
14851 The available macros are the following:
14854 \begin_layout Description
14855 \begin_inset Flex CharStyle:Code
14858 \begin_layout Plain Layout
14859 $$AbsOrRelPathMaster
14864 The file path, absolute or relative to the master LyX document.
14867 \begin_layout Description
14868 \begin_inset Flex CharStyle:Code
14871 \begin_layout Plain Layout
14872 $$AbsOrRelPathParent
14877 The file path, absolute or relative to the LyX document.
14880 \begin_layout Description
14881 \begin_inset Flex CharStyle:Code
14884 \begin_layout Plain Layout
14890 The absolute file path.
14893 \begin_layout Description
14894 \begin_inset Flex CharStyle:Code
14897 \begin_layout Plain Layout
14903 The filename without path and without the extension.
14906 \begin_layout Description
14907 \begin_inset Flex CharStyle:Code
14910 \begin_layout Plain Layout
14912 \begin_inset Quotes eld
14916 \begin_inset Quotes erd
14924 This macro will expand to the contents of the file with the name
14925 \begin_inset Flex CharStyle:Code
14928 \begin_layout Plain Layout
14937 \begin_layout Description
14938 \begin_inset Flex CharStyle:Code
14941 \begin_layout Plain Layout
14947 The file extension (including the dot).
14950 \begin_layout Description
14951 \begin_inset Flex CharStyle:Code
14954 \begin_layout Plain Layout
14960 The filename of the file specified in the external material dialog.
14961 This is either an absolute name, or it is relative to the LyX document.
14964 \begin_layout Description
14965 \begin_inset Flex CharStyle:Code
14968 \begin_layout Plain Layout
14975 \begin_inset Flex CharStyle:Code
14978 \begin_layout Plain Layout
14984 (absolute name or relative to the LyX document).
14987 \begin_layout Description
14988 \begin_inset Flex CharStyle:Code
14991 \begin_layout Plain Layout
14997 The file path, relative to the master LyX document.
15000 \begin_layout Description
15001 \begin_inset Flex CharStyle:Code
15004 \begin_layout Plain Layout
15010 The file path, relative to the LyX document.
15013 \begin_layout Description
15014 \begin_inset Flex CharStyle:Code
15017 \begin_layout Plain Layout
15023 This macro will expand to the absolute path of the system directory.
15024 This is typically used to point to the various helper scripts that are
15028 \begin_layout Description
15029 \begin_inset Flex CharStyle:Code
15032 \begin_layout Plain Layout
15038 A name and full path to a temporary file which will be automatically deleted
15039 whenever the containing document is closed, or the external material insertion
15043 \begin_layout Standard
15044 All path macros contain a trailing directory separator, so you can construct
15046 \begin_inset space \thinspace{}
15050 \begin_inset space \space{}
15053 the absolute filename with
15054 \begin_inset Flex CharStyle:Code
15057 \begin_layout Plain Layout
15058 $$AbsPath$$Basename$$Extension
15066 \begin_layout Standard
15067 The macros above are substituted in all commands unless otherwise noted.
15069 \begin_inset Flex CharStyle:Code
15072 \begin_layout Plain Layout
15078 supports additionally the following substitutions if they are enabled by
15080 \begin_inset Flex CharStyle:Code
15083 \begin_layout Plain Layout
15090 \begin_inset Flex CharStyle:Code
15093 \begin_layout Plain Layout
15102 \begin_layout Description
15103 \begin_inset Flex CharStyle:Code
15106 \begin_layout Plain Layout
15112 The front part of the resize command.
15115 \begin_layout Description
15116 \begin_inset Flex CharStyle:Code
15119 \begin_layout Plain Layout
15125 The back part of the resize command.
15128 \begin_layout Description
15129 \begin_inset Flex CharStyle:Code
15132 \begin_layout Plain Layout
15138 The front part of the rotation command.
15141 \begin_layout Description
15142 \begin_inset Flex CharStyle:Code
15145 \begin_layout Plain Layout
15151 The back part of the rotation command.
15154 \begin_layout Standard
15155 The value string of the
15156 \begin_inset Flex CharStyle:Code
15159 \begin_layout Plain Layout
15165 command supports additionally the following substitutions if they are enabled
15167 \begin_inset Flex CharStyle:Code
15170 \begin_layout Plain Layout
15177 \begin_inset Flex CharStyle:Code
15180 \begin_layout Plain Layout
15189 \begin_layout Description
15190 \begin_inset Flex CharStyle:Code
15193 \begin_layout Plain Layout
15202 \begin_layout Description
15203 \begin_inset Flex CharStyle:Code
15206 \begin_layout Plain Layout
15215 \begin_layout Description
15216 \begin_inset Flex CharStyle:Code
15219 \begin_layout Plain Layout
15228 \begin_layout Description
15229 \begin_inset Flex CharStyle:Code
15232 \begin_layout Plain Layout
15238 The rotation option.
15241 \begin_layout Standard
15242 You may ask why there are so many path macros.
15243 There are mainly two reasons:
15246 \begin_layout Enumerate
15247 Relative and absolute file names should remain relative or absolute, respectivel
15249 Users may have reasons to prefer either form.
15250 Relative names are useful for portable documents that should work on different
15251 machines, for example.
15252 Absolute names may be required by some programs.
15255 \begin_layout Enumerate
15256 LaTeX treats relative file names differently than LyX and other programs
15257 in nested included files.
15258 For LyX, a relative file name is always relative to the document that contains
15260 For LaTeX, it is always relative to the master document.
15261 These two definitions are identical if you have only one document, but
15262 differ if you have a master document that includes part documents.
15263 That means that relative filenames must be transformed when presented to
15265 Fortunately LyX does this automatically for you if you choose the right
15269 \begin_layout Standard
15270 So which path macro should be used in new template definitions? The rule
15274 \begin_layout Itemize
15276 \begin_inset Flex CharStyle:Code
15279 \begin_layout Plain Layout
15285 if an absolute path is required.
15288 \begin_layout Itemize
15290 \begin_inset Flex CharStyle:Code
15293 \begin_layout Plain Layout
15294 $$AbsOrRelPathMaster
15299 if the substituted string is some kind of LaTeX input.
15302 \begin_layout Itemize
15304 \begin_inset Flex CharStyle:Code
15307 \begin_layout Plain Layout
15308 $$AbsOrRelPathParent
15313 in order to preserve the user's choice.
15316 \begin_layout Standard
15317 There are special cases where this rule does not work and e.
15318 \begin_inset space \thinspace{}
15322 \begin_inset space \space{}
15325 relative names are needed, but normally it will work just fine.
15326 One example for such a case is the command
15327 \begin_inset Flex CharStyle:Code
15330 \begin_layout Plain Layout
15331 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15336 in the XFig template above: We can't use the absolute name because the
15338 \begin_inset Flex CharStyle:Code
15341 \begin_layout Plain Layout
15347 files needs the relative name in order to rewrite the file content.
15350 \begin_layout Section
15351 \begin_inset CommandInset label
15353 name "sec:Security-discussion"
15357 Security discussion
15360 \begin_layout Standard
15361 \begin_inset Box Shadowbox
15370 height_special "totalheight"
15373 \begin_layout Plain Layout
15374 WARNING: This section is definitely outdated.
15382 \begin_layout Standard
15383 The external material feature interfaces with a lot of external programs
15384 and does so automatically, so we have to consider the security implications
15386 In particular, since you have the option of including your own filenames
15387 and/or parameter strings and those are expanded into a command, it seems
15388 that it would be possible to create a malicious document which executes
15389 arbitrary commands when a user views or prints the document.
15390 This is something we definately want to avoid.
15393 \begin_layout Standard
15394 However, since the external program commands are specified in the template
15395 configuration file only, there are no security issues if LyX is properly
15396 configured with safe templates only.
15397 This is so because the external programs are invoked with the
15398 \begin_inset Flex CharStyle:Code
15401 \begin_layout Plain Layout
15407 -system call rather than the
15408 \begin_inset Flex CharStyle:Code
15411 \begin_layout Plain Layout
15417 system-call, so it's not possible to execute arbitrary commands from the
15418 filename or parameter section via the shell.
15421 \begin_layout Standard
15422 This also implies that you are restricted in what command strings you can
15423 use in the external material templates.
15424 In particular, pipes and redirection are not readily available.
15425 This has to be so if LyX should remain safe.
15426 If you want to use some of the shell features, you should write a safe
15427 script to do this in a controlled manner, and then invoke the script from
15428 the command string.
15430 \begin_inset Flex CharStyle:Code
15433 \begin_layout Plain Layout
15439 directory of the LyX installation, you can find a safe wrapper script
15440 \begin_inset Flex CharStyle:Code
15443 \begin_layout Plain Layout
15444 general_command_wrapper.py
15449 that supports redirection of input and output.
15450 That can serve as an example for how to write safe template scripts.
15451 For a more advanced example that uses
15452 \begin_inset Flex CharStyle:Code
15455 \begin_layout Plain Layout
15461 and friends, take a look at the
15462 \begin_inset Flex CharStyle:Code
15465 \begin_layout Plain Layout
15474 \begin_layout Standard
15475 It is possible to design a template that interacts directly with the shell,
15476 but since this would allow a malicious user to execute arbitrary commands
15477 by writing clever filenames and/or parameters, we generally recommend that
15478 you only use safe scripts that work with the
15479 \begin_inset Flex CharStyle:Code
15482 \begin_layout Plain Layout
15488 system call in a controlled manner.
15489 Of course, for use in a controlled environment, it can be tempting to just
15490 fall back to use ordinary shell scripts.
15491 If you do so, be aware that you
15495 provide an easily exploitable security hole in your system.
15496 Of course it stands to reason that such unsafe templates will never be
15497 included in the standard LyX distribution, although we do encourage people
15498 to submit new templates in the open source tradition.
15499 But LyX as shipped from the official distribution channels will never have
15503 \begin_layout Standard
15504 Including external material provides a lot of power, and you have to be
15505 careful not to introduce security hazards with this power.
15506 A subtle error in a single line in an innocent looking script can open
15507 the door to huge security problems.
15508 So if you do not fully understand the issues, we recommend that you consult
15509 a knowledgable security professional or the LyX development team if you
15510 have any questions about whether a given template is safe or not.
15511 And do this before you use it in an uncontrolled environment.