1 #LyX 1.6.0svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that 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.g.
1383 \begin_inset space \space{}
1386 screen fonts) will have an instant effect.
1388 \begin_inset space \space{}
1391 changing the bind file) will not.
1392 If nothing appears to have changed, just
1393 \begin_inset Flex CharStyle:MenuItem
1396 \begin_layout Plain Layout
1402 the changes and restart LyX.
1405 \begin_layout Section
1409 \begin_layout Standard
1410 LyX has a powerful mechanism to convert to and from any file format using
1415 \begin_layout Subsection
1416 \begin_inset CommandInset label
1425 \begin_layout Standard
1426 The first step is to define your file formats if they are not already defined.
1428 \begin_inset Flex CharStyle:MenuItem
1431 \begin_layout Plain Layout
1432 Tools\SpecialChar \menuseparator
1433 Preferences\SpecialChar \menuseparator
1434 File Handling\SpecialChar \menuseparator
1442 \begin_inset Flex CharStyle:MenuItem
1445 \begin_layout Plain Layout
1446 New\SpecialChar \ldots{}
1452 button to define your new format.
1454 \begin_inset Flex CharStyle:MenuItem
1457 \begin_layout Plain Layout
1463 field contains the named used to identify the format in the GUI.
1465 \begin_inset Flex CharStyle:MenuItem
1468 \begin_layout Plain Layout
1474 is used to identify the format interally.
1475 You will also need to enter a file extension.
1476 These are all required.
1478 \begin_inset Flex CharStyle:MenuItem
1481 \begin_layout Plain Layout
1487 field is used to provide a keyboard shortcut on the menus.
1488 (For example, pressing
1489 \begin_inset Flex CharStyle:MenuItem
1492 \begin_layout Plain Layout
1499 \begin_inset Flex CharStyle:MenuItem
1502 \begin_layout Plain Layout
1503 View\SpecialChar \menuseparator
1512 \begin_layout Standard
1514 \begin_inset Flex CharStyle:MenuItem
1517 \begin_layout Plain Layout
1524 \begin_inset Flex CharStyle:MenuItem
1527 \begin_layout Plain Layout
1534 For example, you might want to use
1535 \begin_inset Flex CharStyle:MenuItem
1538 \begin_layout Plain Layout
1544 to view PostScript files.
1545 You can enter the command needed to start the program in the corresponding
1547 In defining this command, you can use the four variables listed in the
1549 The viewer is launched when you view an image in LyX or use the
1550 \begin_inset Flex CharStyle:MenuItem
1553 \begin_layout Plain Layout
1560 The editor is for example launched when you press the
1561 \begin_inset Flex CharStyle:MenuItem
1564 \begin_layout Plain Layout
1571 \begin_inset Flex CharStyle:MenuItem
1574 \begin_layout Plain Layout
1581 \begin_inset Flex CharStyle:MenuItem
1584 \begin_layout Plain Layout
1593 \begin_layout Standard
1595 \begin_inset Flex CharStyle:MenuItem
1598 \begin_layout Plain Layout
1604 option tells LyX that a format is suitable for document export.
1605 If this is is set and if a suitable conversion route exists (see
1606 \begin_inset CommandInset ref
1608 reference "sub:Converters"
1612 ), the format will appear in the
1613 \begin_inset Flex CharStyle:MenuItem
1616 \begin_layout Plain Layout
1617 File\SpecialChar \menuseparator
1624 The format will also appear in the
1625 \begin_inset Flex CharStyle:MenuItem
1628 \begin_layout Plain Layout
1634 menu if a viewer is specified for the format.
1635 Pure image formats, such as
1636 \begin_inset Flex CharStyle:Code
1639 \begin_layout Plain Layout
1645 , should not use this option.
1646 Formats that can both represent vector graphics and documents like
1647 \begin_inset Flex CharStyle:Code
1650 \begin_layout Plain Layout
1659 \begin_layout Standard
1661 \begin_inset Flex CharStyle:MenuItem
1664 \begin_layout Plain Layout
1665 Vector graphics format
1670 tells LyX that a format can contain vector graphics.
1671 This information is used to determine the target format of included graphics
1673 \begin_inset Flex CharStyle:MenuItem
1676 \begin_layout Plain Layout
1683 Included graphics may need to be converted to either
1684 \begin_inset Flex CharStyle:MenuItem
1687 \begin_layout Plain Layout
1694 \begin_inset Flex CharStyle:MenuItem
1697 \begin_layout Plain Layout
1704 \begin_inset Flex CharStyle:MenuItem
1707 \begin_layout Plain Layout
1714 \begin_inset Flex CharStyle:MenuItem
1717 \begin_layout Plain Layout
1723 cannot handle other image formats.
1724 If an included graphic is not already in
1725 \begin_inset Flex CharStyle:MenuItem
1728 \begin_layout Plain Layout
1735 \begin_inset Flex CharStyle:MenuItem
1738 \begin_layout Plain Layout
1745 \begin_inset Flex CharStyle:MenuItem
1748 \begin_layout Plain Layout
1754 format, it is converted to
1755 \begin_inset Flex CharStyle:MenuItem
1758 \begin_layout Plain Layout
1764 if the vector format option is set, and otherwise to
1765 \begin_inset Flex CharStyle:MenuItem
1768 \begin_layout Plain Layout
1777 \begin_layout Subsection
1781 \begin_layout Standard
1782 Since all conversions from one format to another take place in LyX's temporary
1783 directory, it is sometimes necessary to modify a file before copying it
1784 to the temporary directory in order that the conversion may be performed.
1788 \begin_layout Plain Layout
1789 For example, the file may refer to other files---images, for example---using
1790 relative file names, and these may become invalid when the file is copied
1791 to the temporary directory.
1796 This is done by a Copier: It copies a file to (or from) the temporary directory
1797 and may modify it in the process.
1800 \begin_layout Standard
1801 The definitions of the copiers may use four variables:
1804 \begin_layout Labeling
1805 \labelwidthstring 00.00.0000
1806 \begin_inset Flex CharStyle:Code
1809 \begin_layout Plain Layout
1815 The LyX system directory (e.g.
1816 \begin_inset space \space{}
1820 \begin_inset Flex CharStyle:MenuItem
1823 \begin_layout Plain Layout
1832 \begin_layout Labeling
1833 \labelwidthstring 00.00.0000
1834 \begin_inset Flex CharStyle:Code
1837 \begin_layout Plain Layout
1846 \begin_layout Labeling
1847 \labelwidthstring 00.00.0000
1848 \begin_inset Flex CharStyle:Code
1851 \begin_layout Plain Layout
1860 \begin_layout Labeling
1861 \labelwidthstring 00.00.0000
1862 \begin_inset Flex CharStyle:Code
1865 \begin_layout Plain Layout
1874 \begin_layout Standard
1875 The latter should be the filename as it would be used in a LaTeX's
1882 It is relevant only when exporting files suitable for such inclusion.
1885 \begin_layout Standard
1886 Copiers can be used to do almost anything with output files.
1887 For example, suppose you want generated pdf files to be copied to a special
1889 \begin_inset Flex CharStyle:Code
1892 \begin_layout Plain Layout
1899 Then you could write a shell script such as this one:
1902 \begin_layout Standard
1903 \begin_inset listings
1907 \begin_layout Plain Layout
1912 \begin_layout Plain Layout
1917 \begin_layout Plain Layout
1919 TOFILE=`basename $2`
1922 \begin_layout Plain Layout
1924 cp $FROMFILE /home/you/pdf/$TOFILE
1929 Save that in your local LyX directory---say,
1930 \begin_inset Flex CharStyle:Code
1933 \begin_layout Plain Layout
1934 /home/you/.lyx/scripts/pdfcopier.sh
1939 ---and make it executable, if you need to do so on your platform.
1941 \begin_inset Flex CharStyle:MenuItem
1944 \begin_layout Plain Layout
1945 Tools\SpecialChar \menuseparator
1952 \begin_inset Flex CharStyle:MenuItem
1955 \begin_layout Plain Layout
1961 format---or one of the other pdf formats---and enter
1962 \begin_inset Flex CharStyle:Code
1965 \begin_layout Plain Layout
1966 pdfcopier.sh $$i $$o
1972 \begin_inset Flex CharStyle:MenuItem
1975 \begin_layout Plain Layout
1985 \begin_layout Standard
1986 Copiers are used by LyX in various of its own conversions.
1987 For example, if appropriate programs are found, LyX will automatically
1988 install copiers for the
1989 \begin_inset Flex CharStyle:MenuItem
1992 \begin_layout Plain Layout
1999 \begin_inset Flex CharStyle:MenuItem
2002 \begin_layout Plain Layout
2004 \begin_inset space ~
2013 When these formats are exported, the copier sees that not just the main
2014 HTML file but various associated files (style files, images, etc.) are also
2016 All these files are written to a subdirectory of the directory in which
2017 the original LyX file was found.
2021 \begin_layout Plain Layout
2022 This copier can be customized.
2024 \begin_inset Quotes eld
2028 \begin_inset Quotes erd
2031 argument takes a comma-separated list of extensions to be copied; if it
2032 is omitted, all files will be copied.
2034 \begin_inset Quotes eld
2038 \begin_inset Quotes erd
2041 argument determines the extension added to the generated directory.
2043 \begin_inset Quotes eld
2047 \begin_inset Flex CharStyle:MenuItem
2050 \begin_layout Plain Layout
2057 \begin_inset Quotes erd
2060 , so HTML generated from
2061 \begin_inset Flex CharStyle:MenuItem
2064 \begin_layout Plain Layout
2065 /path/to/filename.lyx
2071 \begin_inset Flex CharStyle:MenuItem
2074 \begin_layout Plain Layout
2075 /path/to/filename.html.LyXconv
2089 \begin_layout Subsection
2090 \begin_inset CommandInset label
2092 name "sub:Converters"
2099 \begin_layout Standard
2100 You can define your own Converters to, uhh, convert files between different
2103 \begin_inset Flex CharStyle:MenuItem
2106 \begin_layout Plain Layout
2107 Tools\SpecialChar \menuseparator
2108 Preferences\SpecialChar \menuseparator
2109 File Handling\SpecialChar \menuseparator
2118 \begin_layout Standard
2119 To define a new converter, select the
2120 \begin_inset Flex CharStyle:MenuItem
2123 \begin_layout Plain Layout
2125 \begin_inset space ~
2134 \begin_inset Flex CharStyle:MenuItem
2137 \begin_layout Plain Layout
2139 \begin_inset space ~
2147 from the drop-down lists, enter the command needed for the conversion,
2149 \begin_inset Flex CharStyle:MenuItem
2152 \begin_layout Plain Layout
2159 Several variables can be used in the definition of converters:
2162 \begin_layout Labeling
2163 \labelwidthstring 00.00.0000
2164 \begin_inset Flex CharStyle:Code
2167 \begin_layout Plain Layout
2173 The LyX system directory
2176 \begin_layout Labeling
2177 \labelwidthstring 00.00.0000
2178 \begin_inset Flex CharStyle:Code
2181 \begin_layout Plain Layout
2190 \begin_layout Labeling
2191 \labelwidthstring 00.00.0000
2192 \begin_inset Flex CharStyle:Code
2195 \begin_layout Plain Layout
2204 \begin_layout Labeling
2205 \labelwidthstring 00.00.0000
2206 \begin_inset Flex CharStyle:Code
2209 \begin_layout Plain Layout
2215 The base filename of the input file (i.e., without the extension)
2218 \begin_layout Labeling
2219 \labelwidthstring 00.00.0000
2220 \begin_inset Flex CharStyle:Code
2223 \begin_layout Plain Layout
2229 The path to the input file
2232 \begin_layout Standard
2234 \begin_inset Flex CharStyle:MenuItem
2237 \begin_layout Plain Layout
2239 \begin_inset space ~
2247 field you can enter the following flags, separated by commas:
2250 \begin_layout Labeling
2251 \labelwidthstring 00.00.0000
2252 \begin_inset Flex CharStyle:Code
2255 \begin_layout Plain Layout
2261 This converter runs some form of LaTeX.
2262 This will make LyX's LaTeX error logs available.
2265 \begin_layout Labeling
2266 \labelwidthstring 00.00.0000
2267 \begin_inset Flex CharStyle:Code
2270 \begin_layout Plain Layout
2277 \begin_inset Flex CharStyle:MenuItem
2280 \begin_layout Plain Layout
2286 file for the conversion.
2289 \begin_layout Labeling
2290 \labelwidthstring 00.00.0000
2291 \begin_inset Flex CharStyle:Code
2294 \begin_layout Plain Layout
2303 \begin_layout Standard
2304 The following three flags are not really flags at all because they take
2306 \begin_inset Flex CharStyle:MenuItem
2309 \begin_layout Plain Layout
2311 \begin_inset space ~
2315 \begin_inset space ~
2326 \begin_layout Labeling
2327 \labelwidthstring 00.00.0000
2328 \begin_inset Flex CharStyle:Code
2331 \begin_layout Plain Layout
2337 If set, the converter's standard error will be redirected to a file
2338 \begin_inset Flex CharStyle:Code
2341 \begin_layout Plain Layout
2347 , and the script given as argument will be run as:
2348 \begin_inset Flex CharStyle:Code
2351 \begin_layout Plain Layout
2352 script <infile.out >infile.log
2358 The argument may contain
2359 \begin_inset Flex CharStyle:Code
2362 \begin_layout Plain Layout
2371 \begin_layout Labeling
2372 \labelwidthstring 00.00.0000
2373 \begin_inset Flex CharStyle:Code
2376 \begin_layout Plain Layout
2382 The name of the directory in which the converter will dump the generated
2384 LyX will not create this directory, and it does not copy anything into
2385 it, though it will copy this directory to the destination.
2386 The argument may contain
2387 \begin_inset Flex CharStyle:Code
2390 \begin_layout Plain Layout
2396 , which will be replaced by the base name of the input and output files,
2397 respectively, when the directory is copied.
2398 \begin_inset Newline newline
2401 Note that resultdir and usetempdir make no sense together.
2402 The latter will be ignored if the former is given.
2405 \begin_layout Labeling
2406 \labelwidthstring 00.00.0000
2407 \begin_inset Flex CharStyle:Code
2410 \begin_layout Plain Layout
2416 Determines the output file name and may, contain
2417 \begin_inset Flex CharStyle:Code
2420 \begin_layout Plain Layout
2427 Sensible only with resultdir and optional even then; if not given, it defaults
2431 \begin_layout Standard
2432 None of these last three are presently used in any of the converters that
2433 are installed with LyX.
2437 \begin_layout Standard
2438 You do not have to define converters between all the formats between which
2439 you want to convert.
2440 For example, you will note that there is no `LyX to PostScript®' converter,
2441 but LyX will export PostScript®.
2442 It does so by first creating a LaTeX file (no converter needs to be defined
2443 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2444 and finally converting the resulting DVI file to PostScript®.
2445 LyX finds such `chains' of converters automatically, and it will always
2446 choose the shortest possible chain.
2447 You can, though, still define multiple conversion methods between file
2449 For example, the standard LyX configuration provides three ways to convert
2450 LaTeX to PDF: Directly, using
2451 \begin_inset Flex CharStyle:MenuItem
2454 \begin_layout Plain Layout
2460 ; via (DVI and) PostScript®, using
2461 \begin_inset Flex CharStyle:MenuItem
2464 \begin_layout Plain Layout
2471 \begin_inset Flex CharStyle:MenuItem
2474 \begin_layout Plain Layout
2481 To define such alternate chains, you must define multiple target `file
2482 formats', as described in section
2483 \begin_inset CommandInset ref
2485 reference "sub:Formats"
2490 For example, in the standard configuration, the formats named
2491 \begin_inset Flex CharStyle:MenuItem
2494 \begin_layout Plain Layout
2501 \begin_inset Flex CharStyle:MenuItem
2504 \begin_layout Plain Layout
2511 \begin_inset Flex CharStyle:MenuItem
2514 \begin_layout Plain Layout
2520 are defined, all of which share the extension
2521 \begin_inset Flex CharStyle:MenuItem
2524 \begin_layout Plain Layout
2530 , and which correspond to the conversion methods just mentioned.
2533 \begin_layout Chapter
2534 Internationalizing LyX
2535 \begin_inset CommandInset label
2544 \begin_layout Standard
2545 LyX supports using a translated interface.
2546 Last time we checked, LyX provided text in thirty languages.
2547 The language of choice is called your
2552 (For further reading on locale settings, see also the documentation for
2553 locale that comes with your operating system.
2554 For Linux, the manual page for
2555 \begin_inset Flex CharStyle:Code
2558 \begin_layout Plain Layout
2564 could be a good place to start).
2567 \begin_layout Standard
2568 Notice that these translations will work, but do contain a few flaws.
2569 In particular, all dialogs have been designed with the English text in
2570 mind, which means that some of the translated text will be too large to
2571 fit within the space allocated.
2572 This is only a display problem and will not cause any harm.
2573 Also, you will find that some of the translations do not define shortcut
2574 keys for everything.
2575 Sometimes, there are simply not enough free letters to do it.
2576 Other times, the translator just hasn't got around to doing it yet.
2577 Our localization team, which you may wish to join,
2581 \begin_layout Plain Layout
2582 If you are a fluent speaker of a language other than English, joining these
2583 teams is a great way to give back to the LyX community!
2588 will of course try to fix these shortcomings in future versions of LyX.
2591 \begin_layout Section
2595 \begin_layout Subsection
2596 Translating the graphical user interface (text messages).
2599 \begin_layout Standard
2601 \begin_inset Flex CharStyle:Code
2604 \begin_layout Plain Layout
2610 library to handle the internationalization of the interface.
2611 To have LyX speak your favorite language in all menus and dialogs, you
2613 \begin_inset Flex CharStyle:Code
2616 \begin_layout Plain Layout
2622 -file for that language.
2623 When this is available, you'll have to generate a
2624 \begin_inset Flex CharStyle:Code
2627 \begin_layout Plain Layout
2633 -file from it and install the
2634 \begin_inset Flex CharStyle:Code
2637 \begin_layout Plain Layout
2644 The process of doing all of this is explained in the documentation for
2646 \begin_inset Flex CharStyle:Code
2649 \begin_layout Plain Layout
2656 It is possible to do this just for yourself, but if you're going to do
2657 it, you might as well share the results of your labors with the rest of
2659 Send a message to the LyX developers' list for more information about how
2663 \begin_layout Standard
2664 In short, this is what you should do (xx denotes the language code):
2667 \begin_layout Itemize
2668 Check out the LyX source code.
2670 \begin_inset CommandInset href
2672 name "information on the web"
2673 target "http://www.lyx.org/devel/cvs.php"
2680 \begin_layout Itemize
2682 \begin_inset Flex CharStyle:Code
2685 \begin_layout Plain Layout
2691 to the folder of the
2692 \begin_inset Flex CharStyle:Code
2695 \begin_layout Plain Layout
2703 \begin_inset Flex CharStyle:Code
2706 \begin_layout Plain Layout
2714 \begin_inset Flex CharStyle:Code
2717 \begin_layout Plain Layout
2723 doesn't exist anywhere, it can be remade with the console command
2724 \begin_inset Flex CharStyle:Code
2727 \begin_layout Plain Layout
2733 in that directory, or you can use an existing po-file for some other language
2737 \begin_layout Itemize
2739 \begin_inset Flex CharStyle:Code
2742 \begin_layout Plain Layout
2752 \begin_layout Plain Layout
2753 This is just a text file, so it can be edited in any text editor.
2754 But there are also specialized programs that support such editing, such
2759 (for all platforms) or
2768 contains a `mode' for editing
2769 \begin_inset Flex CharStyle:Code
2772 \begin_layout Plain Layout
2783 For some menu- and widget-labels, there are also shortcut keys that should
2785 Those keys are marked after a `|', and should be translated according to
2786 the words and phrases of the language.
2787 You should also fill also out the information at the beginning of the new
2789 \begin_inset Flex CharStyle:Code
2792 \begin_layout Plain Layout
2798 -file with your email-address, etc., so people know where to reach you with
2799 suggestions and entertaining flames.
2802 \begin_layout Standard
2803 If you are just doing this on your own, then:
2806 \begin_layout Itemize
2808 \begin_inset Flex CharStyle:Code
2811 \begin_layout Plain Layout
2818 This can be done with
2819 \begin_inset Flex CharStyle:Code
2822 \begin_layout Plain Layout
2823 msgfmt -o xx.mo < xx.po
2831 \begin_layout Itemize
2833 \begin_inset Flex CharStyle:Code
2836 \begin_layout Plain Layout
2842 -file to your locale-tree, at the correct directory for application messages
2847 xx, and under the name
2848 \begin_inset Flex CharStyle:Code
2851 \begin_layout Plain Layout
2858 \begin_inset space \space{}
2862 \begin_inset Flex CharStyle:Code
2865 \begin_layout Plain Layout
2866 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2876 \begin_layout Standard
2877 As said, however, it would be best if the new
2878 \begin_inset Flex CharStyle:Code
2881 \begin_layout Plain Layout
2887 -file could be added to the LyX distribution, so others can use it.
2888 Adding it involves making additional changes to LyX.
2889 So send an email to the developers' mailing list if you're interested in
2893 \begin_layout Subsubsection
2897 \begin_layout Standard
2898 Sometimes it turns out that one English message needs to be translated into
2899 different messages in the target language.
2900 One example is the message
2901 \begin_inset Flex CharStyle:Code
2904 \begin_layout Plain Layout
2910 which has the German translation
2918 , depending upon exactly what the English
2919 \begin_inset Quotes eld
2923 \begin_inset Quotes erd
2928 \begin_inset Flex CharStyle:Code
2931 \begin_layout Plain Layout
2937 does not handle such ambigous translations.
2938 Therefore you have to add some context information to the message: Instead
2940 \begin_inset Flex CharStyle:Code
2943 \begin_layout Plain Layout
2950 \begin_inset Flex CharStyle:Code
2953 \begin_layout Plain Layout
2954 To[[as in 'From format x to format y']]
2960 \begin_inset Flex CharStyle:Code
2963 \begin_layout Plain Layout
2964 To[[as in 'From page x to page y']].
2969 Now the two occurences of
2970 \begin_inset Flex CharStyle:Code
2973 \begin_layout Plain Layout
2980 \begin_inset Flex CharStyle:Code
2983 \begin_layout Plain Layout
2989 and can be translated correctly to
3000 \begin_layout Standard
3001 Of course the context information needs to be stripped off the original
3002 message when no translation is used.
3003 Therefore you have to put it in double square brackets at the end of the
3004 message (see the example above).
3005 The translation mechanism of LyX ensures that everything in double square
3006 brackets at the end of messages is removed before displaying the message.
3009 \begin_layout Subsection
3010 Translating the documentation.
3013 \begin_layout Standard
3014 The online documentation (in the
3015 \begin_inset Flex CharStyle:MenuItem
3018 \begin_layout Plain Layout
3028 -menu) can (and should!) be translated.
3029 If there are translated versions of the documentation available
3033 \begin_layout Plain Layout
3034 As of March 2008, at least some of the documents have been translated into
3035 fourteen languages, with the Tutorial available in a few more.
3040 and the locale is set accordingly, these will be used automagically by
3042 LyX looks for translated versions as
3043 \begin_inset Flex CharStyle:Code
3046 \begin_layout Plain Layout
3047 LyXDir/doc/xx_DocName.lyx
3053 \begin_inset Flex CharStyle:Code
3056 \begin_layout Plain Layout
3062 is the code for the language currently in use.
3063 If there are no translated documents, the default English versions will
3065 Note that the translated versions must have the same filenames (
3066 \begin_inset Flex CharStyle:Code
3069 \begin_layout Plain Layout
3075 above) as the original.
3076 If you feel up to translating the documentation (an excellent way to proof-read
3077 the original documentation by the way!), there are a few things you should
3081 \begin_layout Itemize
3083 \begin_inset Flex CharStyle:Code
3086 \begin_layout Plain Layout
3092 , the guide to writing LyX documentation.
3093 Pay special attention to the translator's section.
3096 \begin_layout Itemize
3097 Check out the documentation translation web page at
3098 \begin_inset CommandInset href
3100 name "http://www.lyx.org/Translation"
3101 target "http://www.lyx.org/Translation"
3106 That way, you can find out which (if any) documents have already been translate
3107 d into your language.
3108 You can also find out who (if anyone) is organizing the effort to translate
3109 the documentation into your language.
3110 If no one is organizing the effort, please let us know that you're interested.
3113 \begin_layout Standard
3114 Once you get to actually translating, here's a few hints for you that may
3118 \begin_layout Itemize
3119 Join the documentation team! There is information on how to do that in
3120 \begin_inset Flex CharStyle:Code
3123 \begin_layout Plain Layout
3130 \begin_inset Flex CharStyle:MenuItem
3133 \begin_layout Plain Layout
3138 elp\SpecialChar \menuseparator
3148 ), which by the way is the first document you should translate.
3151 \begin_layout Itemize
3152 Learn the typographic conventions for the language you are translating to.
3153 Typography is an ancient art and over the centuries, a great variety of
3154 conventions have developed throughout different parts of the world.
3155 Also study the professional terminology amongst typographers in your country.
3156 Inventing your own terminology will only confuse the users.
3159 (Warning! Typography is addictive!)
3162 \begin_layout Itemize
3163 Make a copy of the document.
3164 This will be your working copy.
3165 You can use this as your personal translated help-file by placing it in
3167 \begin_inset Flex CharStyle:Code
3170 \begin_layout Plain Layout
3179 \begin_layout Itemize
3180 Sometimes the original document (from the LyX-team) will be updated.
3181 Use the source viewer at
3182 \begin_inset CommandInset href
3184 name "http://www.lyx.org/trac/timeline"
3185 target "http://www.lyx.org/trac/timeline"
3189 to see what has been changed.
3190 That way you can easily see which parts of the translated document need
3194 \begin_layout Standard
3195 If you ever find an error in the original document, fix it and notify the
3196 rest of the documentation team of the changes! (You didn't forget to join
3197 the documentation team, did you?)
3200 \begin_layout Standard
3201 \begin_inset Branch OutDated
3204 \begin_layout Section
3205 International Keyboard Support
3208 \begin_layout Standard
3211 [Editor's Note: The following section is by
3219 It needs to be fixed to conform to the new Documentation Style sheet and
3220 to make use of the new v1.0 features.
3221 The whole thing also needs to be merged with the section following it.-jw
3222 It may also be badly out of date.-rh (2008)]
3225 \begin_layout Subsection
3226 Defining Own Keymaps: Keymap File Format
3229 \begin_layout Standard
3230 Let's look at a keyboard definition file a little closer.
3231 It is a plain text file defining
3234 \begin_layout Itemize
3235 key-to-key or key-to-string translations
3238 \begin_layout Itemize
3242 \begin_layout Itemize
3243 dead keys exceptions
3246 \begin_layout Standard
3247 To define key-to-key or key-to-string translation, use this command:
3250 \begin_layout Quotation
3251 \begin_inset Flex CharStyle:Code
3254 \begin_layout Plain Layout
3263 \begin_inset Flex CharStyle:Code
3266 \begin_layout Plain Layout
3275 \begin_layout Standard
3277 \begin_inset Flex CharStyle:Code
3280 \begin_layout Plain Layout
3286 is the key to be translated and
3287 \begin_inset Flex CharStyle:Code
3290 \begin_layout Plain Layout
3296 is the string to be inserted into the document.
3297 To define dead keys, use:
3300 \begin_layout Quotation
3301 \begin_inset Flex CharStyle:Code
3304 \begin_layout Plain Layout
3313 \begin_inset Flex CharStyle:Code
3316 \begin_layout Plain Layout
3325 \begin_layout Standard
3327 \begin_inset Flex CharStyle:Code
3330 \begin_layout Plain Layout
3336 is a keyboard key and
3337 \begin_inset Flex CharStyle:Code
3340 \begin_layout Plain Layout
3347 The following dead keys are supported (shortcut name is in parentheses):
3350 \begin_layout Quotation
3354 \begin_inset space \hfill{}
3360 \begin_layout Quotation
3362 \begin_inset space \hfill{}
3368 \begin_layout Quotation
3370 \begin_inset space \hfill{}
3376 \begin_layout Quotation
3378 \begin_inset space \hfill{}
3384 \begin_layout Quotation
3386 \begin_inset space \hfill{}
3392 \begin_layout Quotation
3394 \begin_inset space \hfill{}
3401 \begin_layout Plain Layout
3413 \begin_layout Quotation
3415 \begin_inset space \hfill{}
3421 \begin_layout Quotation
3423 \begin_inset space \hfill{}
3430 \begin_layout Plain Layout
3442 \begin_layout Quotation
3444 \begin_inset space \hfill{}
3450 \begin_layout Quotation
3452 \begin_inset space \hfill{}
3458 \begin_layout Quotation
3460 \begin_inset space \hfill{}
3467 \begin_layout Plain Layout
3479 \begin_layout Quotation
3481 \begin_inset space \hfill{}
3488 \begin_layout Plain Layout
3500 \begin_layout Quotation
3502 \begin_inset space \hfill{}
3508 \begin_layout Quotation
3509 hungarian umlaut (hug)
3510 \begin_inset space \hfill{}
3516 \begin_layout Quotation
3518 \begin_inset space \hfill{}
3524 \begin_layout Quotation
3526 \begin_inset space \hfill{}
3533 \begin_layout Plain Layout
3545 \begin_layout Standard
3546 Since in many international keyboards there are exceptions to what some
3547 dead keys should do, you can define them using
3550 \begin_layout Quotation
3551 \begin_inset Flex CharStyle:Code
3554 \begin_layout Plain Layout
3562 deadkey key outstring
3565 \begin_layout Standard
3566 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3570 \begin_layout Quotation
3571 \begin_inset Flex CharStyle:Code
3574 \begin_layout Plain Layout
3587 \begin_layout Standard
3588 to make it work correctly.
3589 Also, you have to define as exceptions dead keys over i and j, to remove
3590 the dot from them before inserting an accent mark.
3591 I will change this when the time comes, but so far I haven't had time.
3594 \begin_layout Standard
3595 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3598 \begin_inset Flex CharStyle:Code
3601 \begin_layout Plain Layout
3607 have different meaning.
3609 \begin_inset Flex CharStyle:Code
3612 \begin_layout Plain Layout
3618 marks comments, quotes start and end LaTeX-style commands.
3619 To enter quote, you'll need to use
3620 \begin_inset Flex CharStyle:Code
3623 \begin_layout Plain Layout
3632 \begin_inset Flex CharStyle:Code
3635 \begin_layout Plain Layout
3642 \begin_inset Flex CharStyle:Code
3645 \begin_layout Plain Layout
3656 \begin_layout Standard
3657 If you make a keyboard description file that works for your language, please
3658 mail it to me, so I can include it in the next keymap distribution.
3661 \begin_layout Standard
3662 More keywords will be supported in keymap configuration file in future,
3666 \begin_layout Itemize
3667 \begin_inset Flex CharStyle:Code
3670 \begin_layout Plain Layout
3681 \begin_inset space \hfill{}
3685 \begin_inset Flex CharStyle:Code
3688 \begin_layout Plain Layout
3697 \begin_layout Itemize
3698 \begin_inset Flex CharStyle:Code
3701 \begin_layout Plain Layout
3712 \begin_inset space \hfill{}
3716 \begin_inset Flex CharStyle:Code
3719 \begin_layout Plain Layout
3725 an external keymap translation program
3728 \begin_layout Standard
3729 Also, it should look into
3730 \begin_inset Flex CharStyle:Code
3733 \begin_layout Plain Layout
3739 file for defaults, too (for example, a
3740 \begin_inset Flex CharStyle:Code
3743 \begin_layout Plain Layout
3751 option to include default keyboard).
3759 \begin_layout Section
3760 \begin_inset CommandInset label
3766 International Keymap Stuff
3769 \begin_layout Standard
3770 \begin_inset Note Note
3773 \begin_layout Plain Layout
3774 In doing the revisions on this document in March 2008, I did not look over
3775 this stuff, as I do not understand it.
3776 It would be good if someone else could do so.
3784 \begin_layout Standard
3785 The next two sections describe the
3786 \begin_inset Flex CharStyle:Code
3789 \begin_layout Plain Layout
3798 \begin_inset Flex CharStyle:Code
3801 \begin_layout Plain Layout
3809 file syntax in detail.
3810 These sections should help you design your own key map if the ones provided
3811 do not meet your needs.
3814 \begin_layout Subsection
3818 \begin_layout Standard
3822 \begin_inset Flex CharStyle:Code
3825 \begin_layout Plain Layout
3831 file maps keystrokes to characters or strings.
3832 As the name suggests, it sets a keyboard mapping.
3834 \begin_inset Flex CharStyle:Code
3837 \begin_layout Plain Layout
3848 \begin_inset Flex CharStyle:Code
3851 \begin_layout Plain Layout
3866 \begin_inset Flex CharStyle:Code
3869 \begin_layout Plain Layout
3882 \begin_inset Flex CharStyle:Code
3885 \begin_layout Plain Layout
3894 \begin_inset Flex CharStyle:Code
3897 \begin_layout Plain Layout
3905 are described in this section.
3908 \begin_layout Labeling
3909 \labelwidthstring 00.00.0000
3910 \begin_inset Flex CharStyle:Code
3913 \begin_layout Plain Layout
3921 Map a character to a string
3924 \begin_layout LyX-Code
3939 \begin_layout Standard
3972 the double-quote (")
3989 must be escaped with a preceding backslash (
4000 \begin_layout Standard
4002 \begin_inset Flex CharStyle:MenuItem
4005 \begin_layout Plain Layout
4013 statement to cause the symbol
4014 \begin_inset Flex CharStyle:MenuItem
4017 \begin_layout Plain Layout
4025 to be output for the keystroke
4026 \begin_inset Flex CharStyle:MenuItem
4029 \begin_layout Plain Layout
4040 \begin_layout LyX-Code
4046 \begin_layout Labeling
4047 \labelwidthstring 00.00.0000
4048 \begin_inset Flex CharStyle:Code
4051 \begin_layout Plain Layout
4059 Specify an accent character
4062 \begin_layout LyX-Code
4071 \begin_layout Standard
4072 This will make the cha
4110 This is the dead key
4114 \begin_layout Plain Layout
4121 refers to a key that does not produce a character by itself, but when followed
4122 with another key, produces the desired accent character.
4123 For example, a German characte
4125 r with an umlaut like
4135 can be produced in this manner.
4144 \begin_layout Standard
4157 and then another key not in
4174 followed by the other, unallowed key, as output.
4178 \begin_inset Flex CharStyle:MenuItem
4181 \begin_layout Plain Layout
4189 cancels a dead key, so if
4200 \begin_inset Flex CharStyle:MenuItem
4203 \begin_layout Plain Layout
4212 , the cursor will not go one position backwards but will instead cancel
4228 might have had on the next keystroke.
4232 \begin_layout Standard
4233 The following example specifies that the character ' is to be an acute accent,
4234 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4237 \begin_layout LyX-Code
4240 kmod ' acute aeiouAEIOU
4243 \begin_layout Labeling
4244 \labelwidthstring 00.00.0000
4245 \begin_inset Flex CharStyle:Code
4248 \begin_layout Plain Layout
4254 Specify an exception to the accent character
4257 \begin_layout LyX-Code
4266 \begin_layout Standard
4267 This defines an exce
4308 have been assigned a keystroke with a previous
4311 \begin_inset Flex CharStyle:Code
4314 \begin_layout Plain Layout
4338 must not belong in the
4385 If such a declaration does not exist in
4393 \begin_inset Flex CharStyle:Code
4396 \begin_layout Plain Layout
4430 \begin_inset Flex CharStyle:Code
4433 \begin_layout Plain Layout
4447 \begin_layout Standard
4448 The following command produces causes äi to be produced when you enter acute-i
4452 \begin_layout LyX-Code
4466 \begin_layout Labeling
4467 \labelwidthstring 00.00.0000
4468 \begin_inset Flex CharStyle:Code
4471 \begin_layout Plain Layout
4477 Combine two accent characters
4480 \begin_layout LyX-Code
4486 accent1 accent2 allowed
4489 \begin_layout Standard
4490 This one is getting pretty esoteric.
4491 It allows you to combine the effect
4547 \begin_inset Flex CharStyle:Code
4550 \begin_layout Plain Layout
4578 \begin_layout Standard
4579 Consider this example from the
4580 \begin_inset Flex CharStyle:Code
4583 \begin_layout Plain Layout
4594 \begin_layout LyX-Code
4597 kmod ; acute aeioyvhAEIOYVH
4601 kcomb acute umlaut iyIY
4604 \begin_layout Standard
4605 This allows you to press
4606 \begin_inset Flex CharStyle:MenuItem
4609 \begin_layout Plain Layout
4617 and get the effect of
4618 \begin_inset Flex CharStyle:Code
4621 \begin_layout Plain Layout
4640 in this case cancels the last dead key, so if you press
4641 \begin_inset Flex CharStyle:MenuItem
4644 \begin_layout Plain Layout
4653 \begin_inset Flex CharStyle:Code
4656 \begin_layout Plain Layout
4669 \begin_layout Subsection
4673 \begin_layout Standard
4675 \begin_inset Flex CharStyle:Code
4678 \begin_layout Plain Layout
4686 mapping is performed, a
4687 \begin_inset Flex CharStyle:Code
4690 \begin_layout Plain Layout
4700 file maps the strings that the symbols generate to characters in the current
4702 The LyX distribution currently includes at least the
4703 \begin_inset Flex CharStyle:Code
4706 \begin_layout Plain Layout
4715 \begin_inset Flex CharStyle:Code
4718 \begin_layout Plain Layout
4729 \begin_layout Standard
4731 \begin_inset Flex CharStyle:Code
4734 \begin_layout Plain Layout
4742 file is a sequence of declarations of the form
4745 \begin_layout LyX-Code
4758 \begin_layout Standard
4759 For example, in order to map
4760 \begin_inset Flex CharStyle:MenuItem
4763 \begin_layout Plain Layout
4773 to the corresponding character in the iso-8859-1 set (233), the following
4777 \begin_layout LyX-Code
4785 \begin_layout Standard
4787 \begin_inset Flex CharStyle:Code
4790 \begin_layout Plain Layout
4799 \begin_inset Flex CharStyle:Code
4802 \begin_layout Plain Layout
4820 the same character can apply to more than one string.
4822 \begin_inset Flex CharStyle:Code
4825 \begin_layout Plain Layout
4836 \begin_layout LyX-Code
4848 \begin_inset Newline newline
4864 \begin_layout Standard
4865 If LyX cannot find a mapping for the string produced by the keystroke or
4866 a deadkey sequence, it will check if it looks like an accented char and
4867 try to draw an accent over the character on screen.
4870 \begin_layout Subsection
4874 \begin_layout Standard
4875 There is a second way to add support for international characters through
4876 so-called dead-keys.
4877 A dead-key works in combination with a letter to produce an accented character.
4878 Here, we'll explain how to create a really simple dead-key to illustrate
4882 \begin_layout Standard
4883 Suppose you happen to need the circumflex character,
4884 \begin_inset Quotes eld
4888 \begin_inset Quotes erd
4893 \begin_inset Flex CharStyle:MenuItem
4896 \begin_layout Plain Layout
4903 \begin_inset space ~
4907 \begin_inset Flex CharStyle:MenuItem
4910 \begin_layout Plain Layout
4916 ] to the LyX command
4917 \begin_inset Flex CharStyle:Code
4920 \begin_layout Plain Layout
4927 \begin_inset Flex CharStyle:Code
4930 \begin_layout Plain Layout
4937 Now, whenever you type the
4938 \begin_inset Flex CharStyle:MenuItem
4941 \begin_layout Plain Layout
4947 -key followed by a letter, that letter will have a circumflex accent on
4949 For example, the sequence
4950 \begin_inset Quotes eld
4954 \begin_inset Flex CharStyle:MenuItem
4957 \begin_layout Plain Layout
4964 \begin_inset Quotes erd
4967 produces the letter:
4968 \begin_inset Quotes eld
4972 \begin_inset Quotes erd
4976 If you tried to type
4977 \begin_inset Quotes eld
4981 \begin_inset Flex CharStyle:MenuItem
4984 \begin_layout Plain Layout
4991 \begin_inset Quotes erd
4994 , however, LyX will complain with a beep, since a
4995 \begin_inset Quotes eld
4999 \begin_inset Flex CharStyle:MenuItem
5002 \begin_layout Plain Layout
5009 \begin_inset Quotes erd
5012 never takes a circumflex accent.
5014 \begin_inset Flex CharStyle:MenuItem
5017 \begin_layout Plain Layout
5023 after a dead-key produces the bare-accent.
5024 Please note this last point! If you bind a key to a dead-key, you'll need
5025 to rebind the character on that key to yet another key.
5027 \begin_inset Flex CharStyle:MenuItem
5030 \begin_layout Plain Layout
5036 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5039 \begin_layout Standard
5040 One common way to bind dead-keys is to use
5041 \begin_inset Flex CharStyle:MenuItem
5044 \begin_layout Plain Layout
5051 \begin_inset Flex CharStyle:MenuItem
5054 \begin_layout Plain Layout
5061 \begin_inset Flex CharStyle:MenuItem
5064 \begin_layout Plain Layout
5070 in combination with an accent, like
5071 \begin_inset Quotes eld
5075 \begin_inset Flex CharStyle:MenuItem
5078 \begin_layout Plain Layout
5085 \begin_inset Quotes erd
5089 \begin_inset Quotes eld
5093 \begin_inset Flex CharStyle:MenuItem
5096 \begin_layout Plain Layout
5103 \begin_inset Quotes erd
5107 \begin_inset Quotes eld
5111 \begin_inset Flex CharStyle:MenuItem
5114 \begin_layout Plain Layout
5121 \begin_inset Quotes erd
5125 Another way involves using
5126 \begin_inset Flex CharStyle:Code
5129 \begin_layout Plain Layout
5136 \begin_inset Flex CharStyle:Code
5139 \begin_layout Plain Layout
5145 to set up the special
5146 \begin_inset Flex CharStyle:Code
5149 \begin_layout Plain Layout
5157 \begin_inset Flex CharStyle:Code
5160 \begin_layout Plain Layout
5166 acts in some ways just like
5167 \begin_inset Flex CharStyle:MenuItem
5170 \begin_layout Plain Layout
5176 and permits you to bind keys to accented characters.
5177 You can also turn keys into dead-keys by binding them to something like
5179 \begin_inset Flex CharStyle:Code
5182 \begin_layout Plain Layout
5188 and then binding this symbolic key to the corresponding LyX command.
5192 \begin_layout Plain Layout
5197 : This is exactly what I do in my
5198 \begin_inset Flex CharStyle:Code
5201 \begin_layout Plain Layout
5208 \begin_inset Flex CharStyle:Code
5211 \begin_layout Plain Layout
5219 \begin_inset Flex CharStyle:MenuItem
5222 \begin_layout Plain Layout
5224 \begin_inset space ~
5233 \begin_inset Flex CharStyle:Code
5236 \begin_layout Plain Layout
5242 and a bunch of these
5243 \begin_inset Quotes eld
5247 \begin_inset Flex CharStyle:Code
5250 \begin_layout Plain Layout
5257 \begin_inset Quotes erd
5260 symbolic keys bound such things as
5261 \begin_inset Flex CharStyle:MenuItem
5264 \begin_layout Plain Layout
5266 \begin_inset space ~
5275 \begin_inset Flex CharStyle:MenuItem
5278 \begin_layout Plain Layout
5280 \begin_inset space ~
5289 This is how I produce my accented characters.
5294 You can make just about anything into the
5295 \begin_inset Flex CharStyle:Code
5298 \begin_layout Plain Layout
5305 \begin_inset Flex CharStyle:MenuItem
5308 \begin_layout Plain Layout
5314 keys, a spare function key, etc.
5315 As for the LyX commands that produce accents, check the entry for
5316 \begin_inset Flex CharStyle:Code
5319 \begin_layout Plain Layout
5330 You'll find the complete list there.
5333 \begin_layout Subsection
5334 Saving your Language Configuration
5337 \begin_layout Standard
5338 You can edit your preferences so that your desired language environment
5339 is automatically configured when LyX starts up, via the
5340 \begin_inset Flex CharStyle:MenuItem
5343 \begin_layout Plain Layout
5344 Edit\SpecialChar \menuseparator
5353 \begin_layout Chapter
5354 Installing New Document Classes, Layouts, and Templates
5355 \begin_inset CommandInset label
5357 name "chap:textclass"
5365 \begin_layout Plain Layout
5366 Installing New Document Classes
5374 \begin_layout Standard
5375 In this chapter, we describe the procedures for creating and installing
5376 new LyX layout and template files, as well as offer a refresher on correctly
5377 installing new LaTeX document classes.
5378 Some definitions: a document class is a LaTeX file (usually ending in
5379 \begin_inset Flex CharStyle:Code
5382 \begin_layout Plain Layout
5389 \begin_inset Flex CharStyle:Code
5392 \begin_layout Plain Layout
5398 ) that describes the format of a document such as an article, report, journal
5399 preprint, etc, and all the commands needed to realize that format.
5400 A layout file is a LyX file that corresponds to a LaTeX document class
5401 and that tells LyX how to
5402 \begin_inset Quotes eld
5406 \begin_inset Quotes erd
5409 things on the screen to make the display look something like the final
5411 More precisely, a layout file describes a
5412 \begin_inset Quotes eld
5416 \begin_inset Quotes erd
5419 which is the internal construct LyX uses to render the screen display.
5421 \begin_inset Quotes eld
5425 \begin_inset Quotes erd
5429 \begin_inset Quotes eld
5433 \begin_inset Quotes erd
5436 can be used somewhat interchangeably, but it is better to refer to the
5437 file as the layout, and the thing living in LyX's memory as the text class.
5438 A template file is simply a LyX document that contains a set of predefined
5439 entries for a given document class---entries that are generally required
5441 Templates are especially useful for things like journal manuscripts that
5442 are to be submitted electronically.
5445 \begin_layout Section
5446 Installing a new LaTeX package
5449 \begin_layout Standard
5450 Some installations may not include a LaTeX package that you would like to
5452 For example, you might need FoilTeX, a package for preparing slides or
5453 viewgraphs for overhead projectors.
5454 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5455 a user interface for that.
5456 For example on MiKTeX you start its program
5457 \begin_inset Quotes eld
5461 \begin_inset Quotes erd
5464 to get a list of available packages.
5465 To install one, right click on it or use the installing toolbar button.
5466 When the package you want to install is not in the list, but you have it
5468 \begin_inset Flex CharStyle:Code
5471 \begin_layout Plain Layout
5478 \begin_inset Flex CharStyle:Code
5481 \begin_layout Plain Layout
5487 -file, then copy these files to a subfolder of your LaTeX distribution,
5488 for example to the folder
5497 Then update the file name database of your LaTeX-distribution.
5498 For example on MiKTeX this is done by pressing the button
5501 \begin_inset space ~
5506 that you find in MiKTeX's
5507 \begin_inset Quotes eld
5511 \begin_inset Quotes erd
5515 In both cases you need afterwards to reconfigure LyX using the menu
5516 \begin_inset Flex CharStyle:MenuItem
5519 \begin_layout Plain Layout
5520 Tools\SpecialChar \menuseparator
5526 and then to restart LyX.
5529 \begin_layout Standard
5530 If your LaTeX distribution doesn't provide a user interface, then you can
5531 follow these steps by using a UNIX/Linux console.
5534 \begin_layout Enumerate
5535 Get the package from
5536 \begin_inset CommandInset href
5539 target "http://www.ctan.org/"
5546 \begin_layout Enumerate
5547 You can install this package in several different places.
5548 If you want it to be available for all users on your system, then you should
5549 install it in your `local' TeX tree; if you want (or need) it to be available
5550 just for you, then you can install it in your own `user' TeX tree.
5551 Where these should be created, if they do not already exist, depends upon
5552 the details of your system.
5553 To find out, look in the file
5554 \begin_inset Flex CharStyle:Code
5557 \begin_layout Plain Layout
5567 \begin_layout Plain Layout
5568 This usually lives in the directory
5569 \begin_inset Flex CharStyle:Code
5572 \begin_layout Plain Layout
5578 , though you can run
5579 \begin_inset Flex CharStyle:Code
5582 \begin_layout Plain Layout
5593 The location of the `local' TeX tree is defined by
5594 \begin_inset Flex CharStyle:Code
5597 \begin_layout Plain Layout
5603 ; this is usually somewhere like
5604 \begin_inset Flex CharStyle:Code
5607 \begin_layout Plain Layout
5608 /usr/local/share/texmf/
5614 The `user' TeX tree is defined by
5615 \begin_inset Flex CharStyle:Code
5618 \begin_layout Plain Layout
5625 \begin_inset Flex CharStyle:Code
5628 \begin_layout Plain Layout
5635 (If these variables are not predefined, you can define them.) You'll probably
5636 need root permissions to create or modify the `local' tree; but your `user'
5637 tree shouldn't have such limitations.
5640 \begin_layout Enumerate
5642 \begin_inset Flex CharStyle:Code
5645 \begin_layout Plain Layout
5652 \begin_inset Flex CharStyle:Code
5655 \begin_layout Plain Layout
5662 \begin_inset Flex CharStyle:Code
5665 \begin_layout Plain Layout
5672 \begin_inset Newline newline
5676 \begin_inset Flex CharStyle:Code
5679 \begin_layout Plain Layout
5680 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5686 \begin_inset Newline newline
5689 But, again, most of this will
5690 \begin_inset Quotes eld
5694 \begin_inset Quotes erd
5700 \begin_layout Enumerate
5705 \begin_layout Plain Layout
5706 We'll assume henceforth that you're defining `local' TeX tree.
5707 If you're defining a user tree, just adjust as necessary.
5713 You must follow the directory structure of your existing
5714 \begin_inset Flex CharStyle:Code
5717 \begin_layout Plain Layout
5723 directory, which will be found at
5724 \begin_inset Flex CharStyle:Code
5727 \begin_layout Plain Layout
5734 For example, latex packages should go under
5735 \begin_inset Flex CharStyle:Code
5738 \begin_layout Plain Layout
5739 $TEXMFLOCAL/tex/latex/
5747 \begin_layout Enumerate
5748 Install the package.
5749 For example, you would unpack the FoilTeX tarball and copy it to
5750 \begin_inset Flex CharStyle:Code
5753 \begin_layout Plain Layout
5754 $TEXMFLOCAL/tex/latex/foiltex
5761 \begin_inset Flex CharStyle:Code
5764 \begin_layout Plain Layout
5770 directory contains various files.
5773 \begin_layout Enumerate
5775 \begin_inset Flex CharStyle:Code
5778 \begin_layout Plain Layout
5786 \begin_inset Flex CharStyle:Code
5789 \begin_layout Plain Layout
5798 \begin_layout Standard
5799 Your package is now installed and available to LaTeX.
5800 To make it available to LyX, you need to create a Layout file, if one is
5801 not already available.
5802 (See the next section.) Once you have a layout file, you need only reconfigure
5804 \begin_inset Flex CharStyle:MenuItem
5807 \begin_layout Plain Layout
5808 Tools\SpecialChar \menuseparator
5814 ) and then restart LyX.
5815 You should then see your new package---for example
5816 \begin_inset Flex CharStyle:MenuItem
5819 \begin_layout Plain Layout
5826 \begin_inset Flex CharStyle:MenuItem
5829 \begin_layout Plain Layout
5830 Document\SpecialChar \menuseparator
5837 \begin_inset Flex CharStyle:MenuItem
5840 \begin_layout Plain Layout
5850 \begin_layout Section
5854 \begin_layout Standard
5855 This section describes how to write and install your own LyX layout files
5856 and walks through the
5857 \begin_inset Flex CharStyle:Code
5860 \begin_layout Plain Layout
5866 text class format as an example.
5868 \begin_inset Flex CharStyle:Code
5871 \begin_layout Plain Layout
5877 files describe what paragraph and character styles are available for a
5878 given document class and how LyX should display them.
5879 We try to provide a thorough description of the process here; however,
5880 there are so many different types of documents supported by LaTeX classes
5881 that we can't hope to cover every different possibility or problem you
5883 (The LyX users' list is frequented by people with lots of experience with
5884 layout design who are willing to share what they've learned.)
5887 \begin_layout Standard
5888 As you prepare to write a new layout, it is extremely helpful to look at
5889 the example layouts distributed with LyX.
5890 If you use a nice LaTeX document class that might be of interest for others,
5891 too, and have a nice corresponding LyX layout, feel free to contribute
5892 the stuff to us, so we may put it into the distribution.
5894 \begin_inset CommandInset href
5896 name "section on the LyX wiki"
5897 target "http://wiki.lyx.org/Layouts/Layouts"
5901 for this kind of material.
5904 \begin_layout Standard
5905 All the tags described in this chapter are case-insensitive; this means
5907 \begin_inset Flex CharStyle:Code
5910 \begin_layout Plain Layout
5917 \begin_inset Flex CharStyle:Code
5920 \begin_layout Plain Layout
5927 \begin_inset Flex CharStyle:Code
5930 \begin_layout Plain Layout
5936 are really the same command.
5937 The possible values are printed in brackets after the feature's name.
5938 The default value if a feature isn't specified inside a text class-description
5940 \begin_inset Flex CharStyle:Code
5943 \begin_layout Plain Layout
5952 If the argument has a datatype like
5953 \begin_inset Quotes eld
5957 \begin_inset Quotes erd
5961 \begin_inset Quotes eld
5965 \begin_inset Quotes erd
5968 , the default is shown like this:
5969 \begin_inset Flex CharStyle:Code
5972 \begin_layout Plain Layout
5983 \begin_layout Subsection
5984 \begin_inset CommandInset label
5986 name "sub:Layout-modules"
5993 \begin_layout Standard
5994 Similar to layout files, and new with LyX 1.6, are layout
5999 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6000 some modules---such as the Endnotes module---provide support for just such
6002 In a sense, layout modules are similar to included files---files like
6003 \begin_inset Flex CharStyle:Code
6006 \begin_layout Plain Layout
6012 ---in that modules are not specific to a given document layout but may be
6013 used with many different layouts.
6014 The difference is that using a layout module does not require editing the
6016 Rather, modules are selected in the
6017 \begin_inset Flex CharStyle:MenuItem
6020 \begin_layout Plain Layout
6021 Document\SpecialChar \menuseparator
6030 \begin_layout Standard
6031 Building modules is the easiest way to get started with layout editing,
6032 since it can be as simple as adding a single new paragraph or flex inset.
6033 But modules may, in principle, contain anything a layout file can contain.
6036 \begin_layout Standard
6037 A module must begin with a line like the following:
6040 \begin_layout LyX-Code
6043 DeclareLyXModule[endnotes.sty]{Endnotes}
6046 \begin_layout Standard
6047 The argument in square brackets is optional: It declares any LaTeX packages
6048 on which the module depends.
6049 The mandatory argument, in curly brackets, is the name of the module, as
6051 \begin_inset Flex CharStyle:MenuItem
6054 \begin_layout Plain Layout
6055 Document\SpecialChar \menuseparator
6065 \begin_layout Standard
6066 The module declaration should then be followed by lines like the following:
6069 \begin_layout LyX-Code
6073 \begin_layout LyX-Code
6074 #Adds an endnote command, in addition to footnotes.
6078 \begin_layout LyX-Code
6079 #You will need to add
6081 theendnotes in ERT where you
6084 \begin_layout LyX-Code
6085 #want the endnotes to appear.
6089 \begin_layout LyX-Code
6093 \begin_layout LyX-Code
6094 #Requires: somemodule | othermodule
6097 \begin_layout LyX-Code
6098 #Excludes: badmodule
6101 \begin_layout Standard
6102 The description is used in
6103 \begin_inset Flex CharStyle:MenuItem
6106 \begin_layout Plain Layout
6107 Document\SpecialChar \menuseparator
6113 to provide the user with information about what the module does.
6115 \begin_inset Flex CharStyle:Code
6118 \begin_layout Plain Layout
6124 line is used to identify other modules with which this one must be used;
6126 \begin_inset Flex CharStyle:Code
6129 \begin_layout Plain Layout
6135 line is used to identify modules with which this one may not be used.
6136 Both are optional, and, as shown, multiple modules should be separated
6137 with the pipe symbol: |.
6138 Note that the required modules are treated disjunctively:
6142 of the required modules must be used.
6147 excluded module may be used.
6148 Note that modules are identified here by their
6152 without the .module extension.
6154 \begin_inset Flex CharStyle:Code
6157 \begin_layout Plain Layout
6164 \begin_inset Flex CharStyle:Code
6167 \begin_layout Plain Layout
6176 \begin_layout Standard
6177 After creating a new module, you will need to reconfigure and then restart
6178 LyX for the module to appear in the menu.
6179 However, changes you make to the module will be seen immediately, if you
6181 \begin_inset Flex CharStyle:MenuItem
6184 \begin_layout Plain Layout
6185 Document\SpecialChar \menuseparator
6191 , highlight something, and then hit
6192 \begin_inset Quotes eld
6196 \begin_inset Quotes erd
6202 It is strongly recommended that you save your work before doing so
6207 it is strongly recommended that you not attempt to edit modules while simultaneo
6208 usly working on documents
6211 Though of course the developers strive to keep LyX stable in such situations,
6212 syntax errors and the like in your module file could cause strange behavior.
6215 \begin_layout Subsection
6216 Supporting new document classes
6219 \begin_layout Standard
6220 There are two situations you are likely to encounter when wanting to support
6221 a new LaTeX document class, involving LaTeX2e class (
6222 \begin_inset Flex CharStyle:Code
6225 \begin_layout Plain Layout
6232 \begin_inset Flex CharStyle:Code
6235 \begin_layout Plain Layout
6242 Supporting a style file is usually fairly easy.
6243 Supporting a new document class is a bit harder.
6246 \begin_layout Subsection
6248 \begin_inset Flex CharStyle:MenuItem
6251 \begin_layout Plain Layout
6260 \begin_layout Standard
6261 If your new document class is provided as a style file that is used in conjuncti
6262 on with an existing, supported document class---for the sake of the example,
6263 we'll assume that the style file is called
6264 \begin_inset Flex CharStyle:MenuItem
6267 \begin_layout Plain Layout
6273 and it is meant to be used with
6274 \begin_inset Flex CharStyle:MenuItem
6277 \begin_layout Plain Layout
6283 , which is a standard class---start by copying the existing class's layout
6284 file into your local directory:
6287 \begin_layout LyX-Code
6288 cp report.layout ~/.lyx/layouts/myclass.layout
6291 \begin_layout Standard
6293 \begin_inset Flex CharStyle:Code
6296 \begin_layout Plain Layout
6302 and change the line:
6305 \begin_layout LyX-Code
6308 DeclareLaTeXClass{report}
6311 \begin_layout Standard
6315 \begin_layout LyX-Code
6318 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6321 \begin_layout Standard
6325 \begin_layout LyX-Code
6327 \begin_inset Newline newline
6333 \begin_inset Newline newline
6339 \begin_layout Standard
6340 near the top of the file.
6343 \begin_layout Standard
6344 Start LyX and select
6345 \begin_inset Flex CharStyle:MenuItem
6348 \begin_layout Plain Layout
6349 Tools\SpecialChar \menuseparator
6356 Then restart LyX and try creating a new document.
6358 \begin_inset Flex CharStyle:MenuItem
6361 \begin_layout Plain Layout
6367 " as a document class option in the
6368 \begin_inset Flex CharStyle:MenuItem
6371 \begin_layout Plain Layout
6372 Document\SpecialChar \menuseparator
6379 It is likely that some of the sectioning commands and such in your new
6380 class will work differently from how they worked in the base class---
6381 \begin_inset Flex CharStyle:Code
6384 \begin_layout Plain Layout
6390 in this example---so you can fiddle around with the settings for the different
6391 sections if you wish.
6394 \begin_layout Subsection
6396 \begin_inset Flex CharStyle:MenuItem
6399 \begin_layout Plain Layout
6408 \begin_layout Standard
6409 There are two possibilities here.
6410 One is that the class file is itself based upon an existing document class.
6411 For example, many thesis classes are based upon
6412 \begin_inset Flex CharStyle:MenuItem
6415 \begin_layout Plain Layout
6422 To see whether yours is, look for a line like
6425 \begin_layout LyX-Code
6431 \begin_layout Standard
6433 If so, then you may proceed largely as in the previous section, though
6434 the DeclareLaTeXClass line will be different.
6435 If your new class is thesis, and it is based upon book, then the line should
6440 \begin_layout Plain Layout
6441 And it will be easiest if you save the file to
6442 \begin_inset Flex CharStyle:Code
6445 \begin_layout Plain Layout
6451 : LyX assumes that the document class has the same name as the layout file.
6460 \begin_layout LyX-Code
6463 DeclareLaTeXClass[thesis,book]{thesis}
6466 \begin_layout Standard
6467 If, on the other hand, the new class is not based upon an existing class,
6468 you will probably have to
6469 \begin_inset Quotes eld
6473 \begin_inset Quotes erd
6477 We strongly suggest copying an existing layout file which uses a similar
6478 LaTeX class and then modifying it, if you can do so.
6479 At least use an existing file as a starting point so you can find out what
6480 items you need to worry about.
6481 Again, the specifics are covered below.
6484 \begin_layout Section
6485 Declaring a new text class
6488 \begin_layout Standard
6489 When it's finally time to get your hands dirty and create or edit your own
6490 layout file, the following sections describe what you're up against.
6491 Our advice is to go slowly, save and test often, listen to soothing music,
6492 and enjoy one or two of your favorite adult beverages; more if you are
6493 getting particularly stuck.
6494 It's really not that hard, except that the multitude of options can become
6495 overwhelming if you try to do to much in one sitting.
6496 Go have another adult beverage, just for good measure.
6499 \begin_layout Standard
6503 \begin_layout Standard
6504 Lines in a layout file which begin with a
6505 \begin_inset Flex CharStyle:Code
6508 \begin_layout Plain Layout
6515 There is one exception to this rule: all layouts should begin with lines
6519 \begin_layout LyX-Code
6522 #% Do not delete the line below; configure depends on this
6525 \begin_layout LyX-Code
6530 DeclareLaTeXClass{article}
6533 \begin_layout Standard
6534 The second line is used when you configure LyX.
6535 The layout file is read by the LaTeX script
6536 \begin_inset Flex CharStyle:Code
6539 \begin_layout Plain Layout
6545 , in a special mode where
6546 \begin_inset Flex CharStyle:Code
6549 \begin_layout Plain Layout
6556 The first line is just a LaTeX comment, and the second one contains the
6557 declaration of the text class.
6558 If these lines appear in a file named
6559 \begin_inset Flex CharStyle:Code
6562 \begin_layout Plain Layout
6568 , then they define a text class of name
6569 \begin_inset Flex CharStyle:Code
6572 \begin_layout Plain Layout
6578 (the name of the layout file) which uses the LaTeX document class
6579 \begin_inset Flex CharStyle:Code
6582 \begin_layout Plain Layout
6588 (the default is to use the same name as the layout).
6590 \begin_inset Quotes eld
6594 \begin_inset Quotes erd
6597 that appears above is used as a description of the text class in the
6598 \begin_inset Flex CharStyle:MenuItem
6601 \begin_layout Plain Layout
6602 Document\SpecialChar \menuseparator
6611 \begin_layout Standard
6612 Let's assume that you wrote your own text class that uses the
6613 \begin_inset Flex CharStyle:Code
6616 \begin_layout Plain Layout
6622 document class, but where you changed the appearance of the section headings.
6623 If you put it in a file
6624 \begin_inset Flex CharStyle:Code
6627 \begin_layout Plain Layout
6633 , the header of this file should be:
6636 \begin_layout LyX-Code
6639 #% Do not delete the line below; configure depends on this
6642 \begin_layout LyX-Code
6647 DeclareLaTeXClass[article]{article (with my own headings)}
6650 \begin_layout Standard
6651 This declares a text class
6652 \begin_inset Flex CharStyle:Code
6655 \begin_layout Plain Layout
6661 , associated with the LaTeX document class
6662 \begin_inset Flex CharStyle:Code
6665 \begin_layout Plain Layout
6672 \begin_inset Quotes eld
6675 article (with my own headings)
6676 \begin_inset Quotes erd
6680 If your text class depends on several packages, you can declare it as:
6683 \begin_layout LyX-Code
6686 #% Do not delete the line below; configure depends on this
6689 \begin_layout LyX-Code
6694 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6697 \begin_layout Standard
6698 This indicates that your text class uses the foo.sty package.
6699 Finally, it is also possible to declare classes for DocBook code.
6700 Typical declarations will look like
6703 \begin_layout LyX-Code
6706 #% Do not delete the line below; configure depends on this
6709 \begin_layout LyX-Code
6714 DeclareDocBookClass[article]{SGML (DocBook article)}
6717 \begin_layout Standard
6718 Note that these declarations can also be given an optional parameter declaring
6719 the name of the document class (but not a list).
6722 \begin_layout Standard
6723 So, to be as explicit as possible, the form of the layout declaration is:
6726 \begin_layout LyX-Code
6731 DeclareLaTeXClass[class,package.sty]{layout description}
6734 \begin_layout Standard
6735 The class need only be specified if the name of the LaTeX class file and
6736 the name of the layout file are different; if the name of the classfile
6737 is not specified, then LyX will simply assume that it is the same as the
6738 name of the layout file.
6741 \begin_layout Standard
6742 When the text class has been modified to your taste, all you have to do
6743 is to copy it either to
6744 \begin_inset Flex CharStyle:Code
6747 \begin_layout Plain Layout
6754 \begin_inset Flex CharStyle:Code
6757 \begin_layout Plain Layout
6764 \begin_inset Flex CharStyle:MenuItem
6767 \begin_layout Plain Layout
6772 ools\SpecialChar \menuseparator
6782 , exit LyX and restart it.
6783 Then your new text class should be available along with the others.
6786 \begin_layout Standard
6787 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6788 you made to your layout files.
6789 As a result, editing layout files could be very time consuming.
6790 Beginning with 1.6, however, you can force a reload of the layout currently
6791 in use by using the LyX function
6792 \begin_inset Flex CharStyle:MenuItem
6795 \begin_layout Plain Layout
6802 There is no default binding for this function---though, of course, you
6803 can bind it to a key yourself.
6804 If you want to use this function, then, you should simply enter it in the
6810 : This is very much an `advanced feature'.
6815 recommended that you save your work before using this function.
6820 recommended that you not attempt to edit your layout while simultaneously
6821 working on a document that you care about.
6822 Use a test document.
6823 Syntax errors and the like in your layout file could cause peculiar behavior.
6824 In particular, such errors could cause LyX to regard the current layout
6825 as invalid and to attempt to switch to some other layout.
6826 The LyX team strives to keep LyX stable in such situations, but safe is
6830 \begin_layout Subsection
6834 \begin_layout Standard
6835 The first non-comment line must contain the file format number:
6838 \begin_layout Description
6839 \begin_inset Flex CharStyle:Code
6842 \begin_layout Plain Layout
6849 \begin_inset Flex CharStyle:Code
6852 \begin_layout Plain Layout
6858 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6859 don't have an explicit file format).
6860 The file format that is documented here is format 8.
6863 \begin_layout Subsection
6864 General text class parameters
6867 \begin_layout Standard
6868 These are the general parameters which describe the form of the entire document:
6871 \begin_layout Description
6872 \begin_inset Flex CharStyle:Code
6875 \begin_layout Plain Layout
6881 Adds information to the document preamble.
6883 \begin_inset Quotes eld
6887 \begin_inset Flex CharStyle:Code
6890 \begin_layout Plain Layout
6897 \begin_inset Quotes erd
6903 \begin_layout Description
6904 \begin_inset Flex CharStyle:Code
6907 \begin_layout Plain Layout
6913 Describes various global options supported by the document class.
6915 \begin_inset space ~
6919 \begin_inset CommandInset ref
6921 reference "sec:classoptions"
6927 \begin_inset Quotes eld
6931 \begin_inset Flex CharStyle:Code
6934 \begin_layout Plain Layout
6941 \begin_inset Quotes erd
6947 \begin_layout Description
6948 \begin_inset Flex CharStyle:Code
6951 \begin_layout Plain Layout
6958 \begin_inset Flex CharStyle:Code
6961 \begin_layout Plain Layout
6970 \begin_inset Flex CharStyle:Code
6973 \begin_layout Plain Layout
6979 ] Whether the class should default to having one or two columns.
6980 Can be changed in the
6981 \begin_inset Flex CharStyle:MenuItem
6984 \begin_layout Plain Layout
6985 Document\SpecialChar \menuseparator
6994 \begin_layout Description
6995 \begin_inset Flex CharStyle:Code
6998 \begin_layout Plain Layout
7004 This sequence defines a new counter.
7006 \begin_inset space ~
7010 \begin_inset CommandInset ref
7012 reference "sec:counter"
7018 \begin_inset Quotes eld
7022 \begin_inset Flex CharStyle:Code
7025 \begin_layout Plain Layout
7032 \begin_inset Quotes erd
7038 \begin_layout Description
7039 \begin_inset Flex CharStyle:Code
7042 \begin_layout Plain Layout
7048 Sets the default font used to display the document.
7050 \begin_inset space ~
7054 \begin_inset CommandInset ref
7056 reference "sec:fonts"
7060 for how to declare fonts.
7062 \begin_inset Quotes eld
7066 \begin_inset Flex CharStyle:Code
7069 \begin_layout Plain Layout
7076 \begin_inset Quotes erd
7082 \begin_layout Description
7083 \begin_inset Flex CharStyle:Code
7086 \begin_layout Plain Layout
7093 \begin_inset Flex CharStyle:Code
7096 \begin_layout Plain Layout
7102 Specifies a module to be included by default with this document class,
7103 which should be specified by filename without the
7104 \begin_inset Flex CharStyle:Code
7107 \begin_layout Plain Layout
7114 The user can still remove the module, but it will be active at the outset.
7115 (This applies only when new files are created, or when this class is chosen
7116 for an existing document.)
7119 \begin_layout Description
7120 \begin_inset Flex CharStyle:Code
7123 \begin_layout Plain Layout
7130 \begin_inset Flex CharStyle:Code
7133 \begin_layout Plain Layout
7139 ] This is the style that will be assigned to new paragraphs, usually
7140 \begin_inset Flex CharStyle:MenuItem
7143 \begin_layout Plain Layout
7150 This will default to the first defined style if not given, but you are
7151 highly encouraged to use this directive.
7154 \begin_layout Description
7155 \begin_inset Flex CharStyle:Code
7158 \begin_layout Plain Layout
7165 \begin_inset Flex CharStyle:Code
7168 \begin_layout Plain Layout
7174 ] Indicates that the module in question---which should be specified by filename
7176 \begin_inset Flex CharStyle:Code
7179 \begin_layout Plain Layout
7185 extension---cannot be used with this document class.
7186 This might be used in a journal-specific layout file to prevent, say, the
7188 \begin_inset Flex CharStyle:Code
7191 \begin_layout Plain Layout
7197 module that numbers theorems by section.
7202 be used in a module.
7203 Modules have their own way of excluding other modules (see
7204 \begin_inset CommandInset ref
7206 reference "sub:Layout-modules"
7213 \begin_layout Description
7214 \begin_inset Flex CharStyle:Code
7217 \begin_layout Plain Layout
7223 Defines a new float.
7225 \begin_inset space ~
7229 \begin_inset CommandInset ref
7231 reference "sec:floats"
7237 \begin_inset Quotes eld
7241 \begin_inset Flex CharStyle:Code
7244 \begin_layout Plain Layout
7251 \begin_inset Quotes erd
7257 \begin_layout Description
7258 \begin_inset Flex CharStyle:Code
7261 \begin_layout Plain Layout
7267 As its name implies, this command allows you to include another layout
7268 definition file within yours to avoid duplicating commands.
7269 Common examples are the standard layout files, for example,
7270 \begin_inset Flex CharStyle:Code
7273 \begin_layout Plain Layout
7279 , which contains most of the basic layouts.
7282 \begin_layout Description
7283 \begin_inset Flex CharStyle:Code
7286 \begin_layout Plain Layout
7292 This section (re-)defines the layout of an inset.
7293 It can be applied to an existing inset of to a new, user-defined inset,
7295 \begin_inset space \space{}
7298 a new character style.
7300 \begin_inset space ~
7304 \begin_inset CommandInset ref
7306 reference "sec:charstyle"
7310 for more information.
7312 \begin_inset Quotes eld
7316 \begin_inset Flex CharStyle:Code
7319 \begin_layout Plain Layout
7326 \begin_inset Quotes erd
7332 \begin_layout Description
7333 \begin_inset Flex CharStyle:Code
7336 \begin_layout Plain Layout
7342 A string that indicates the width of the left margin on the screen, for
7344 \begin_inset Quotes eld
7348 \begin_inset Quotes erd
7354 \begin_layout Description
7355 \begin_inset Flex CharStyle:Code
7358 \begin_layout Plain Layout
7364 This command deletes an existing float.
7365 This is particularly useful when you want to suppress a float that has
7366 be defined in an input file.
7369 \begin_layout Description
7370 \begin_inset Flex CharStyle:Code
7373 \begin_layout Plain Layout
7379 This command deletes an existing style.
7380 This is particularly useful when you want to suppress a style that has
7381 be defined in an input file.
7384 \begin_layout Description
7385 \begin_inset Flex CharStyle:Code
7388 \begin_layout Plain Layout
7394 A string indicating what sort of output documents using this class will
7396 At present, the options are: `docbook', `latex', and `literate'.
7399 \begin_layout Description
7400 \begin_inset Flex CharStyle:Code
7403 \begin_layout Plain Layout
7414 \begin_inset Flex CharStyle:Code
7417 \begin_layout Plain Layout
7428 \begin_inset Flex CharStyle:Code
7431 \begin_layout Plain Layout
7438 \begin_inset Flex CharStyle:Code
7441 \begin_layout Plain Layout
7447 ] The class default pagestyle.
7448 Can be changed in the
7449 \begin_inset Flex CharStyle:MenuItem
7452 \begin_layout Plain Layout
7453 Document\SpecialChar \menuseparator
7462 \begin_layout Description
7463 \begin_inset Flex CharStyle:Code
7466 \begin_layout Plain Layout
7472 Sets the preamble for the LaTeX document.
7473 Note that this will completely override any prior
7474 \begin_inset Flex CharStyle:Code
7477 \begin_layout Plain Layout
7484 \begin_inset Flex CharStyle:Code
7487 \begin_layout Plain Layout
7495 \begin_inset Quotes eld
7499 \begin_inset Flex CharStyle:Code
7502 \begin_layout Plain Layout
7509 \begin_inset Quotes erd
7515 \begin_layout Description
7516 \begin_inset Flex CharStyle:Code
7519 \begin_layout Plain Layout
7526 \begin_inset Flex CharStyle:Code
7529 \begin_layout Plain Layout
7536 \begin_inset Flex CharStyle:Code
7539 \begin_layout Plain Layout
7548 \begin_inset Flex CharStyle:Code
7551 \begin_layout Plain Layout
7557 ] Whether the class already provides the feature
7558 \begin_inset Flex CharStyle:Code
7561 \begin_layout Plain Layout
7568 A feature is in general the name of a package (
7569 \begin_inset Flex CharStyle:Code
7572 \begin_layout Plain Layout
7579 \begin_inset Flex CharStyle:Code
7582 \begin_layout Plain Layout
7588 , \SpecialChar \ldots{}
7590 \begin_inset Flex CharStyle:Code
7593 \begin_layout Plain Layout
7600 \begin_inset Flex CharStyle:Code
7603 \begin_layout Plain Layout
7609 ,\SpecialChar \ldots{}
7610 ); the complete list of supported features is unfortunately not documented
7611 outside the LyX source code---but see
7612 \begin_inset Flex CharStyle:Code
7615 \begin_layout Plain Layout
7621 if you're interested.
7623 \begin_inset Flex CharStyle:MenuItem
7626 \begin_layout Plain Layout
7631 elp\SpecialChar \menuseparator
7641 also gives an overview of the supported packages.
7644 \begin_layout Description
7645 \begin_inset Flex CharStyle:Code
7648 \begin_layout Plain Layout
7655 \begin_inset Flex CharStyle:Code
7658 \begin_layout Plain Layout
7664 ] Indicates that this layout provides the functionality of the module mentioned,
7665 which should be specified by filename, which should be specified by filename
7667 \begin_inset Flex CharStyle:Code
7670 \begin_layout Plain Layout
7677 This will typically be used if the layout includes the module directly,
7678 rather than using the
7679 \begin_inset Flex CharStyle:Code
7682 \begin_layout Plain Layout
7688 tag to indicate that it ought to be used.
7689 It could be used in a module that that provided an alternate implementation
7690 of the same functionality.
7693 \begin_layout Description
7694 \begin_inset Flex CharStyle:Code
7697 \begin_layout Plain Layout
7704 \begin_inset Flex CharStyle:Code
7707 \begin_layout Plain Layout
7713 ] Whether the class requires the feature
7714 \begin_inset Flex CharStyle:Code
7717 \begin_layout Plain Layout
7724 Multiple features must be separated by commas.
7725 Note that you can only request supported features.
7728 \begin_layout Description
7729 \begin_inset Flex CharStyle:Code
7732 \begin_layout Plain Layout
7738 A string that indicates the width of the right margin on the screen, for
7740 \begin_inset Quotes eld
7744 \begin_inset Quotes erd
7750 \begin_layout Description
7751 \begin_inset Flex CharStyle:Code
7754 \begin_layout Plain Layout
7760 Sets which divisions get numbered.
7762 \begin_inset Flex CharStyle:Code
7765 \begin_layout Plain Layout
7774 \begin_layout Description
7775 \begin_inset Flex CharStyle:Code
7778 \begin_layout Plain Layout
7787 \begin_inset Flex CharStyle:Code
7790 \begin_layout Plain Layout
7801 \begin_inset Flex CharStyle:Code
7804 \begin_layout Plain Layout
7810 ] Whether the class-default should be printing on one or both sides of the
7812 Can be changed in the
7813 \begin_inset Flex CharStyle:MenuItem
7816 \begin_layout Plain Layout
7817 Document\SpecialChar \menuseparator
7826 \begin_layout Description
7827 \begin_inset Flex CharStyle:Code
7830 \begin_layout Plain Layout
7836 This sequence defines a new paragraph style.
7837 If the style already exists, it will redefine some of its parameters instead.
7839 \begin_inset space ~
7843 \begin_inset CommandInset ref
7845 reference "sec:style"
7851 \begin_inset Quotes eld
7855 \begin_inset Flex CharStyle:Code
7858 \begin_layout Plain Layout
7865 \begin_inset Quotes erd
7871 \begin_layout Description
7872 \begin_inset Flex CharStyle:Code
7875 \begin_layout Plain Layout
7882 \begin_inset Flex CharStyle:Code
7885 \begin_layout Plain Layout
7891 ] The name of the command or environment to be used with
7892 \begin_inset Flex CharStyle:Code
7895 \begin_layout Plain Layout
7904 \begin_layout Description
7905 \begin_inset Flex CharStyle:Code
7908 \begin_layout Plain Layout
7915 \begin_inset Flex CharStyle:Code
7918 \begin_layout Plain Layout
7927 \begin_inset Flex CharStyle:Code
7930 \begin_layout Plain Layout
7936 ] Indicates what kind of markup is used to define the title of a document.
7938 \begin_inset Flex CharStyle:Code
7941 \begin_layout Plain Layout
7947 means that the macro with name
7948 \begin_inset Flex CharStyle:Code
7951 \begin_layout Plain Layout
7957 will be inserted after the last layout which has
7958 \begin_inset Quotes eld
7962 \begin_inset Flex CharStyle:Code
7965 \begin_layout Plain Layout
7972 \begin_inset Quotes erd
7977 \begin_inset Flex CharStyle:Code
7980 \begin_layout Plain Layout
7986 corresponds to the case where the block of paragraphs which have
7987 \begin_inset Quotes eld
7991 \begin_inset Flex CharStyle:Code
7994 \begin_layout Plain Layout
8001 \begin_inset Quotes erd
8004 should be enclosed into the
8005 \begin_inset Flex CharStyle:Code
8008 \begin_layout Plain Layout
8017 \begin_layout Description
8018 \begin_inset Flex CharStyle:Code
8021 \begin_layout Plain Layout
8027 Sets which divisions are included in the table of contents.
8029 \begin_inset Flex CharStyle:Code
8032 \begin_layout Plain Layout
8041 \begin_layout Subsection
8042 \begin_inset Flex CharStyle:Code
8045 \begin_layout Plain Layout
8054 \begin_layout Standard
8055 \begin_inset CommandInset label
8057 name "sec:classoptions"
8062 \begin_inset Flex CharStyle:Code
8065 \begin_layout Plain Layout
8071 section can contain the following entries:
8074 \begin_layout Description
8075 \begin_inset Flex CharStyle:Code
8078 \begin_layout Plain Layout
8085 \begin_inset Flex CharStyle:Code
8088 \begin_layout Plain Layout
8094 ] The list of available font sizes for the document's main font, separated
8096 \begin_inset Quotes eld
8100 \begin_inset Flex CharStyle:Code
8103 \begin_layout Plain Layout
8110 \begin_inset Quotes erd
8116 \begin_layout Description
8117 \begin_inset Flex CharStyle:Code
8120 \begin_layout Plain Layout
8126 Used to set the DTD line with XML-based output classes.
8128 \begin_inset Quotes eld
8131 -//OASIS//DTD DocBook V4.2//EN
8132 \begin_inset Quotes erd
8138 \begin_layout Description
8139 \begin_inset Flex CharStyle:Code
8142 \begin_layout Plain Layout
8149 \begin_inset Flex CharStyle:Code
8152 \begin_layout Plain Layout
8153 string="empty|plain|headings|fancy"
8158 ] The list of available page styles, separated by
8159 \begin_inset Quotes eld
8163 \begin_inset Flex CharStyle:Code
8166 \begin_layout Plain Layout
8173 \begin_inset Quotes erd
8179 \begin_layout Description
8180 \begin_inset Flex CharStyle:Code
8183 \begin_layout Plain Layout
8190 \begin_inset Flex CharStyle:Code
8193 \begin_layout Plain Layout
8199 ] Some document class options, separated by a comma, that will be added
8200 to the optional part of the
8201 \begin_inset Flex CharStyle:Code
8204 \begin_layout Plain Layout
8215 \begin_layout Standard
8217 \begin_inset Flex CharStyle:Code
8220 \begin_layout Plain Layout
8226 section must end with
8227 \begin_inset Quotes eld
8231 \begin_inset Flex CharStyle:Code
8234 \begin_layout Plain Layout
8241 \begin_inset Quotes erd
8247 \begin_layout Subsection
8251 \begin_layout Standard
8252 \begin_inset CommandInset label
8258 A paragraph style description looks like this:
8262 \begin_layout Plain Layout
8263 Note that this will either define a new layout or modify an existing one.
8271 \begin_layout LyX-Code
8278 \begin_layout LyX-Code
8282 \begin_layout LyX-Code
8286 \begin_layout Standard
8287 where the following commands are allowed:
8290 \begin_layout Description
8291 \begin_inset Flex CharStyle:Code
8294 \begin_layout Plain Layout
8301 \begin_inset Flex CharStyle:Code
8304 \begin_layout Plain Layout
8309 , left, right, center
8314 ] Paragraph alignment.
8317 \begin_layout Description
8318 \begin_inset Flex CharStyle:Code
8321 \begin_layout Plain Layout
8328 \begin_inset Flex CharStyle:Code
8331 \begin_layout Plain Layout
8336 , left, right, center
8341 ] A comma separated list of permitted alignments.
8342 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8344 For example a right-aligned or centered enumeration isn't possible.)
8347 \begin_layout Description
8348 \begin_inset Flex CharStyle:Code
8351 \begin_layout Plain Layout
8358 \begin_inset Flex CharStyle:Code
8361 \begin_layout Plain Layout
8371 \begin_layout Plain Layout
8372 Note that a `float' here is a real number, such as: 1.5.
8377 The vertical space with which the last of a chain of paragraphs with this
8378 layout is separated from the following paragraph.
8379 If the next paragraph has another layout, the separations are not simply
8380 added, but the maximum is taken.
8383 \begin_layout Description
8384 \begin_inset Flex CharStyle:Code
8387 \begin_layout Plain Layout
8394 \begin_inset Flex CharStyle:Code
8397 \begin_layout Plain Layout
8403 The category for this style.
8404 This is used to group related styles in the Layout combobox on the toolbar.
8405 Any string can be used, but you may want to use existing categories with
8410 \begin_layout Description
8411 \begin_inset Flex CharStyle:Code
8414 \begin_layout Plain Layout
8420 Depth of XML command.
8421 Used only with XML-type formats.
8424 \begin_layout Description
8425 \begin_inset Flex CharStyle:Code
8428 \begin_layout Plain Layout
8435 \begin_inset CommandInset label
8437 name "des:CopyStyle"
8442 \begin_inset Flex CharStyle:Code
8445 \begin_layout Plain Layout
8451 Copies all the features of an existing style into the current one.
8455 \begin_layout Description
8456 \begin_inset Flex CharStyle:Code
8459 \begin_layout Plain Layout
8465 The name of a style whose preamble should be output
8470 This allows to ensure some ordering of the preamble snippets when macros
8471 definitions depend on one another.
8475 \begin_layout Plain Layout
8476 Note that, besides that functionality, there is no way to ensure any ordering
8478 The ordering that you see in a given version of LyX may change without
8479 warning in later versions.
8487 \begin_layout Description
8488 \begin_inset Flex CharStyle:Code
8491 \begin_layout Plain Layout
8498 \begin_inset Flex CharStyle:Code
8501 \begin_layout Plain Layout
8506 , Box, Filled_Box, Static
8511 ] The type of label that stands at the end of the paragraph (or sequence
8513 \begin_inset Flex CharStyle:Code
8516 \begin_layout Plain Layout
8523 \begin_inset Flex CharStyle:Code
8526 \begin_layout Plain Layout
8533 \begin_inset Flex CharStyle:Code
8536 \begin_layout Plain Layout
8543 \begin_inset Flex CharStyle:Code
8546 \begin_layout Plain Layout
8554 \begin_inset Flex CharStyle:Code
8557 \begin_layout Plain Layout
8564 \begin_inset Quotes eld
8568 \begin_inset Quotes erd
8572 \begin_inset Flex CharStyle:Code
8575 \begin_layout Plain Layout
8582 \begin_inset Flex CharStyle:Code
8585 \begin_layout Plain Layout
8586 \begin_inset space ~
8595 \begin_inset space ~
8598 black) square suitable for end of proof markers,
8599 \begin_inset Flex CharStyle:Code
8602 \begin_layout Plain Layout
8608 is an explicit text string.
8611 \begin_layout Description
8612 \begin_inset Flex CharStyle:Code
8615 \begin_layout Plain Layout
8622 \begin_inset Flex CharStyle:Code
8625 \begin_layout Plain Layout
8631 ] The string used for a label with a
8632 \begin_inset Flex CharStyle:Code
8635 \begin_layout Plain Layout
8642 \begin_inset Flex CharStyle:Code
8645 \begin_layout Plain Layout
8655 \begin_layout Description
8656 \begin_inset Flex CharStyle:Code
8659 \begin_layout Plain Layout
8666 \begin_inset Flex CharStyle:Code
8669 \begin_layout Plain Layout
8680 \begin_inset Flex CharStyle:Code
8683 \begin_layout Plain Layout
8692 \begin_layout Description
8693 \begin_inset Flex CharStyle:Code
8696 \begin_layout Plain Layout
8703 \begin_inset Flex CharStyle:Code
8706 \begin_layout Plain Layout
8716 ] With this parameter the
8717 \begin_inset Flex CharStyle:MenuItem
8720 \begin_layout Plain Layout
8727 \begin_inset Quotes eld
8730 Vertical space above
8731 \begin_inset Quotes erd
8735 \begin_inset Flex CharStyle:MenuItem
8738 \begin_layout Plain Layout
8739 Edit\SpecialChar \menuseparator
8741 \begin_inset space ~
8749 dialog can be set when initializing a paragraph with this style.
8753 \begin_layout Plain Layout
8756 Note from Jean-Marc:
8758 I'm not sure that this setting has much use, and it should probably be
8759 removed in later versions.
8767 \begin_layout Description
8768 \begin_inset Flex CharStyle:Code
8771 \begin_layout Plain Layout
8777 The font used for both the text body
8783 \begin_inset space ~
8787 \begin_inset CommandInset ref
8789 reference "sec:fonts"
8794 Note that defining this font automatically defines the
8795 \begin_inset Flex CharStyle:Code
8798 \begin_layout Plain Layout
8805 So you should define this one first if you also want to define
8806 \begin_inset Flex CharStyle:Code
8809 \begin_layout Plain Layout
8818 \begin_layout Description
8819 \begin_inset Flex CharStyle:Code
8822 \begin_layout Plain Layout
8829 \begin_inset CommandInset label
8831 name "des:FreeSpacing"
8838 \begin_inset Flex CharStyle:Code
8841 \begin_layout Plain Layout
8852 \begin_inset Flex CharStyle:Code
8855 \begin_layout Plain Layout
8861 ] Usually LyX doesn't allow you to insert more than one space between words,
8862 since a space is considered as the separation between two words, not a
8863 character or symbol of its own.
8864 This is a very fine thing but sometimes annoying, for example, when typing
8865 program code or plain LaTeX code.
8867 \begin_inset Flex CharStyle:Code
8870 \begin_layout Plain Layout
8877 Note that LyX will create protected blanks for the additional blanks when
8878 in another mode than LaTeX-mode.
8881 \begin_layout Description
8882 \begin_inset Flex CharStyle:Code
8885 \begin_layout Plain Layout
8891 [[FIXME]] (Used only with XML-type formats.)
8894 \begin_layout Description
8895 \begin_inset Flex CharStyle:Code
8898 \begin_layout Plain Layout
8905 \begin_inset Flex CharStyle:Code
8908 \begin_layout Plain Layout
8914 If 1, marks the layout as being part of a title block (see also the
8915 \begin_inset Flex CharStyle:Code
8918 \begin_layout Plain Layout
8925 \begin_inset Flex CharStyle:Code
8928 \begin_layout Plain Layout
8937 \begin_layout Description
8938 \begin_inset Flex CharStyle:Code
8941 \begin_layout Plain Layout
8948 \begin_inset Flex CharStyle:Code
8951 \begin_layout Plain Layout
8957 ] This provides extra space between paragraphs that have the same layout.
8958 If you put other layouts into an environment, each is separated with the
8960 \begin_inset Flex CharStyle:Code
8963 \begin_layout Plain Layout
8970 But the whole items of the environment are additionally separated with
8972 \begin_inset Flex CharStyle:Code
8975 \begin_layout Plain Layout
8987 \begin_layout Description
8988 \begin_inset Flex CharStyle:Code
8991 \begin_layout Plain Layout
8997 [[FIXME]] (Used only with XML-type formats.)
9000 \begin_layout Description
9001 \begin_inset Flex CharStyle:Code
9004 \begin_layout Plain Layout
9011 \begin_inset CommandInset label
9013 name "des:KeepEmpty"
9020 \begin_inset Flex CharStyle:Code
9023 \begin_layout Plain Layout
9034 \begin_inset Flex CharStyle:Code
9037 \begin_layout Plain Layout
9043 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9044 lead to empty LaTeX output.
9045 There are some cases where this could be desirable however: in a letter
9046 template, the required fields can be provided as empty fields, so that
9047 people do not forget them; in some special classes, a layout can be used
9048 as some kind of break, which does not contain actual text.
9051 \begin_layout Description
9052 \begin_inset Flex CharStyle:Code
9055 \begin_layout Plain Layout
9061 [float=0] The vertical space between the label and the text body.
9062 Only used for labels that are above the text body (
9063 \begin_inset Flex CharStyle:Code
9066 \begin_layout Plain Layout
9073 \begin_inset Flex CharStyle:Code
9076 \begin_layout Plain Layout
9077 Centered_Top_Environment
9085 \begin_layout Description
9086 \begin_inset Flex CharStyle:Code
9089 \begin_layout Plain Layout
9096 \begin_inset Flex CharStyle:Code
9099 \begin_layout Plain Layout
9106 \begin_inset Newline newline
9109 The name of the counter for automatic numbering (see Section
9110 \begin_inset CommandInset ref
9112 reference "sec:counter"
9117 This must be given if
9118 \begin_inset Flex CharStyle:Code
9121 \begin_layout Plain Layout
9128 \begin_inset Flex CharStyle:Code
9131 \begin_layout Plain Layout
9140 \begin_layout Description
9141 \begin_inset Flex CharStyle:Code
9144 \begin_layout Plain Layout
9150 The font used for the label.
9152 \begin_inset space ~
9156 \begin_inset CommandInset ref
9158 reference "sec:fonts"
9165 \begin_layout Description
9166 \begin_inset Flex CharStyle:Code
9169 \begin_layout Plain Layout
9175 Text that indicates how far a label should be indented.
9178 \begin_layout Description
9179 \begin_inset Flex CharStyle:Code
9182 \begin_layout Plain Layout
9189 \begin_inset Flex CharStyle:Code
9192 \begin_layout Plain Layout
9198 ] The horizontal space between the label and the text body.
9199 Only used for labels that are not above the text body.
9202 \begin_layout Description
9203 \begin_inset Flex CharStyle:Code
9206 \begin_layout Plain Layout
9213 \begin_inset Flex CharStyle:Code
9216 \begin_layout Plain Layout
9222 ] The string used for a label with a
9223 \begin_inset Flex CharStyle:Code
9226 \begin_layout Plain Layout
9234 \begin_inset Flex CharStyle:Code
9237 \begin_layout Plain Layout
9243 is set, this string can be contain the special formatting commands described
9245 \begin_inset CommandInset ref
9247 reference "sec:counter"
9255 \begin_layout Plain Layout
9256 For the sake of backwards compatibility, the string
9257 \begin_inset Flex CharStyle:Code
9260 \begin_layout Plain Layout
9270 will be replaced by the expanded
9271 \begin_inset Flex CharStyle:Code
9274 \begin_layout Plain Layout
9281 \begin_inset Flex CharStyle:Code
9284 \begin_layout Plain Layout
9293 This feature is now obsolete and should be replaced by the mechanisms of
9295 \begin_inset CommandInset ref
9297 reference "sec:counter"
9309 \begin_layout Description
9310 \begin_inset Flex CharStyle:Code
9313 \begin_layout Plain Layout
9320 \begin_inset Flex CharStyle:Code
9323 \begin_layout Plain Layout
9329 ] This is used inside the appendix instead of
9330 \begin_inset Flex CharStyle:Code
9333 \begin_layout Plain Layout
9341 \begin_inset Flex CharStyle:Code
9344 \begin_layout Plain Layout
9351 \begin_inset Flex CharStyle:Code
9354 \begin_layout Plain Layout
9363 \begin_layout Description
9364 \begin_inset Flex CharStyle:Code
9367 \begin_layout Plain Layout
9373 [FIXME] (Used only with XML-type formats.)
9376 \begin_layout Description
9377 \begin_inset Flex CharStyle:Code
9380 \begin_layout Plain Layout
9387 \begin_inset Flex CharStyle:Code
9390 \begin_layout Plain Layout
9395 , Manual, Static, Top_Environment,
9396 \begin_inset Newline newline
9399 Centered_Top_Environment, Sensitive, Counter
9405 \begin_inset Newline newline
9409 \begin_inset Flex CharStyle:Code
9412 \begin_layout Plain Layout
9418 means the label is the very first word (up to the first real blank).
9422 \begin_layout Plain Layout
9423 Use protected spaces if you want more than one word as the label.
9429 \begin_inset Flex CharStyle:Code
9432 \begin_layout Plain Layout
9438 means it is defined in the layout (see
9439 \begin_inset Flex CharStyle:Code
9442 \begin_layout Plain Layout
9450 \begin_inset Flex CharStyle:Code
9453 \begin_layout Plain Layout
9460 \begin_inset Flex CharStyle:Code
9463 \begin_layout Plain Layout
9464 Centered_Top_Environment
9469 are special cases of
9470 \begin_inset Flex CharStyle:Code
9473 \begin_layout Plain Layout
9480 The label will be printed above the paragraph, but only at the top of an
9481 environment or the top of a chain of paragraphs with this layout.
9482 Usage is for example the
9483 \begin_inset Flex CharStyle:MenuItem
9486 \begin_layout Plain Layout
9493 \begin_inset Flex CharStyle:MenuItem
9496 \begin_layout Plain Layout
9503 This is also the case for
9504 \begin_inset Flex CharStyle:Code
9507 \begin_layout Plain Layout
9513 labels with latex type
9514 \begin_inset Flex CharStyle:Code
9517 \begin_layout Plain Layout
9523 , in order to make layouts for theorems work correctly.
9525 \begin_inset Flex CharStyle:Code
9528 \begin_layout Plain Layout
9534 is a special case for the caption-labels
9535 \begin_inset Quotes eld
9539 \begin_inset Quotes erd
9543 \begin_inset Quotes eld
9547 \begin_inset Quotes erd
9552 \begin_inset Flex CharStyle:Code
9555 \begin_layout Plain Layout
9561 means the (hardcoded) label string depends on the kind of float.
9563 \begin_inset Flex CharStyle:Code
9566 \begin_layout Plain Layout
9572 label type defines automatically numbered labels.
9574 \begin_inset CommandInset ref
9576 reference "sec:counter"
9583 \begin_layout Description
9584 \begin_inset Flex CharStyle:Code
9587 \begin_layout Plain Layout
9593 The name of the corresponding LaTeX stuff.
9594 Either the environment or command name.
9597 \begin_layout Description
9598 \begin_inset Flex CharStyle:Code
9601 \begin_layout Plain Layout
9607 An optional parameter for the corresponding
9608 \begin_inset Flex CharStyle:Code
9611 \begin_layout Plain Layout
9618 This parameter cannot be changed from within LyX.
9621 \begin_layout Description
9622 \begin_inset Flex CharStyle:Code
9625 \begin_layout Plain Layout
9632 \begin_inset CommandInset label
9634 name "des:LatexType"
9639 \begin_inset Flex CharStyle:Code
9642 \begin_layout Plain Layout
9647 , Command, Environment, Item_Environment,
9653 \begin_inset Flex CharStyle:Code
9656 \begin_layout Plain Layout
9662 ] How the layout should be translated into LaTeX.
9664 \begin_inset Flex CharStyle:Code
9667 \begin_layout Plain Layout
9673 means nothing special.
9675 \begin_inset Flex CharStyle:Code
9678 \begin_layout Plain Layout
9685 \begin_inset Flex CharStyle:Code
9688 \begin_layout Plain Layout
9695 {\SpecialChar \ldots{}
9702 \begin_inset Flex CharStyle:Code
9705 \begin_layout Plain Layout
9712 \begin_inset Flex CharStyle:Code
9715 \begin_layout Plain Layout
9722 }\SpecialChar \ldots{}
9736 \begin_inset Flex CharStyle:Code
9739 \begin_layout Plain Layout
9746 \begin_inset Flex CharStyle:Code
9749 \begin_layout Plain Layout
9756 \begin_inset Flex CharStyle:Code
9759 \begin_layout Plain Layout
9767 is generated for each paragraph of this environment.
9769 \begin_inset Flex CharStyle:Code
9772 \begin_layout Plain Layout
9779 \begin_inset Flex CharStyle:Code
9782 \begin_layout Plain Layout
9789 \begin_inset Flex CharStyle:Code
9792 \begin_layout Plain Layout
9798 is passed as an argument to the environment.
9800 \begin_inset Flex CharStyle:Code
9803 \begin_layout Plain Layout
9809 can be defined in the
9810 \begin_inset Flex CharStyle:MenuItem
9813 \begin_layout Plain Layout
9818 ayout\SpecialChar \menuseparator
9830 \begin_inset Flex CharStyle:Code
9833 \begin_layout Plain Layout
9841 is perhaps a bit misleading, since these rules apply to SGML classes, too.
9842 Visit the SGML class files for specific examples.
9845 \begin_layout Standard
9846 Putting the last few things together, the LaTeX output will be either:
9849 \begin_layout LyX-Code
9852 latexname[latexparam]{\SpecialChar \ldots{}
9856 \begin_layout Standard
9860 \begin_layout LyX-Code
9863 begin{latexname}[latexparam] \SpecialChar \ldots{}
9869 \begin_layout Standard
9870 depending upon the LaTex type.
9873 \begin_layout Description
9874 \begin_inset Flex CharStyle:Code
9877 \begin_layout Plain Layout
9884 \begin_inset Flex CharStyle:Code
9887 \begin_layout Plain Layout
9893 ] If you put layouts into environments, the leftmargins are not simply added,
9894 but added with a factor
9895 \begin_inset Formula $\frac{4}{depth+4}$
9899 Note that this parameter is also used when the margin is defined as
9900 \begin_inset Flex CharStyle:Code
9903 \begin_layout Plain Layout
9910 \begin_inset Flex CharStyle:Code
9913 \begin_layout Plain Layout
9920 Then it is added to the manual or dynamic margin.
9922 \begin_inset Newline newline
9925 The argument is passed as a string.
9927 \begin_inset Quotes eld
9931 \begin_inset Flex CharStyle:Code
9934 \begin_layout Plain Layout
9941 \begin_inset Quotes erd
9944 means that the paragraph is indented with the width of
9945 \begin_inset Quotes eld
9949 \begin_inset Flex CharStyle:Code
9952 \begin_layout Plain Layout
9959 \begin_inset Quotes erd
9963 You can get a negative width by prefixing the string with
9964 \begin_inset Quotes eld
9968 \begin_inset Flex CharStyle:Code
9971 \begin_layout Plain Layout
9978 \begin_inset Quotes erd
9982 This way was chosen so that the look is the same with each used screen
9987 \begin_layout Description
9988 \begin_inset Flex CharStyle:Code
9991 \begin_layout Plain Layout
9998 \begin_inset Flex CharStyle:Code
10001 \begin_layout Plain Layout
10006 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10012 \begin_inset Newline newline
10015 The kind of margin that the layout has on the left side.
10017 \begin_inset Flex CharStyle:Code
10020 \begin_layout Plain Layout
10026 just means a fixed margin.
10028 \begin_inset Flex CharStyle:Code
10031 \begin_layout Plain Layout
10037 means that the left margin depends on the string entered in the
10038 \begin_inset Flex CharStyle:MenuItem
10041 \begin_layout Plain Layout
10042 Edit\SpecialChar \menuseparator
10044 \begin_inset space ~
10053 This is used to typeset nice lists without tabulators.
10055 \begin_inset Flex CharStyle:Code
10058 \begin_layout Plain Layout
10064 means that the margin depends on the size of the label.
10065 This is used for automatic enumerated headlines.
10066 It is obvious that the headline
10067 \begin_inset Quotes eld
10070 5.4.3.2.1 Very long headline
10071 \begin_inset Quotes erd
10074 must have a wider left margin (as wide as
10075 \begin_inset Quotes eld
10079 \begin_inset Quotes erd
10082 plus the space) than
10083 \begin_inset Quotes eld
10086 3.2 Very long headline
10087 \begin_inset Quotes erd
10091 \begin_inset Quotes eld
10095 \begin_inset Quotes erd
10098 are not able to do this.
10100 \begin_inset Flex CharStyle:Code
10103 \begin_layout Plain Layout
10109 is similar, but only the very first row of the paragraph is dynamic, while
10110 the others are static; this is used, for example, for descriptions.
10112 \begin_inset Flex CharStyle:Code
10115 \begin_layout Plain Layout
10121 means the margin is chosen in a way that the longest row of this paragraph
10122 fits to the right margin.
10123 This is used to typeset an address on the right edge of the page.
10126 \begin_layout Description
10127 \begin_inset Flex CharStyle:Code
10130 \begin_layout Plain Layout
10137 \begin_inset Flex CharStyle:Code
10140 \begin_layout Plain Layout
10149 \begin_inset Flex CharStyle:Code
10152 \begin_layout Plain Layout
10158 ] Whether fragile commands in this layout should be
10159 \begin_inset Flex CharStyle:Code
10162 \begin_layout Plain Layout
10175 whether this command should itself be protected.)
10178 \begin_layout Description
10179 \begin_inset Flex CharStyle:Code
10182 \begin_layout Plain Layout
10189 \begin_inset Flex CharStyle:Code
10192 \begin_layout Plain Layout
10199 \begin_inset Flex CharStyle:Code
10202 \begin_layout Plain Layout
10210 ] Whether newlines are translated into LaTeX newlines (
10211 \begin_inset Flex CharStyle:Code
10214 \begin_layout Plain Layout
10225 The translation can be switched off to allow more comfortable LaTeX editing
10229 \begin_layout Description
10230 \begin_inset Flex CharStyle:Code
10233 \begin_layout Plain Layout
10240 \begin_inset Flex CharStyle:Code
10243 \begin_layout Plain Layout
10250 \begin_inset Flex CharStyle:Code
10253 \begin_layout Plain Layout
10261 ] Whether the following Paragraph is allowed to indent its very first row.
10263 \begin_inset Flex CharStyle:Code
10266 \begin_layout Plain Layout
10272 means that it is not allowed to do so;
10273 \begin_inset Flex CharStyle:Code
10276 \begin_layout Plain Layout
10282 means it could do so if it wants to.
10285 \begin_layout Description
10286 \begin_inset Flex CharStyle:Code
10289 \begin_layout Plain Layout
10295 Name of a layout that has replaced this layout.
10296 This is used to rename a layout, while keeping backward compatibility.
10299 \begin_layout Description
10300 \begin_inset Flex CharStyle:Code
10303 \begin_layout Plain Layout
10310 \begin_inset Flex CharStyle:Code
10313 \begin_layout Plain Layout
10319 ] The number of optional arguments that can be used with this layout.
10320 This is useful for things like section headings, and only makes sense with
10324 \begin_layout Description
10325 \begin_inset Flex CharStyle:Code
10328 \begin_layout Plain Layout
10335 \begin_inset Flex CharStyle:Code
10338 \begin_layout Plain Layout
10344 ] The indent of the very first line of a paragraph.
10346 \begin_inset Flex CharStyle:Code
10349 \begin_layout Plain Layout
10355 will be fixed for a certain layout.
10356 The exception is Standard layout, since the indentation of a Standard layout
10357 paragraph can be prohibited with
10358 \begin_inset Flex CharStyle:Code
10361 \begin_layout Plain Layout
10368 Also, Standard layout paragraphs inside environments use the
10369 \begin_inset Flex CharStyle:Code
10372 \begin_layout Plain Layout
10378 of the environment, not their native one.
10379 For example, Standard paragraphs inside an enumeration are not indented.
10382 \begin_layout Description
10383 \begin_inset Flex CharStyle:Code
10386 \begin_layout Plain Layout
10393 \begin_inset Flex CharStyle:Code
10396 \begin_layout Plain Layout
10402 ] The vertical space between two paragraphs of this layout.
10405 \begin_layout Description
10406 \begin_inset Flex CharStyle:Code
10409 \begin_layout Plain Layout
10416 \begin_inset Flex CharStyle:Code
10419 \begin_layout Plain Layout
10425 ] LyX allows the user to choose either
10426 \begin_inset Quotes eld
10430 \begin_inset Quotes erd
10434 \begin_inset Quotes eld
10438 \begin_inset Quotes erd
10441 to typeset a document.
10443 \begin_inset Quotes eld
10447 \begin_inset Quotes erd
10450 is chosen, this value is completely ignored.
10452 \begin_inset Quotes eld
10456 \begin_inset Quotes erd
10459 is chosen, the parindent of a LaTeXtype
10460 \begin_inset Quotes eld
10464 \begin_inset Quotes erd
10467 layout is ignored and all paragraphs are separated by this parskip argument.
10468 The vertical space is calculated with
10469 \begin_inset Flex CharStyle:Code
10472 \begin_layout Plain Layout
10474 \begin_inset space ~
10483 \begin_inset Flex CharStyle:Code
10486 \begin_layout Plain Layout
10492 is the height of a row with the normal font.
10493 This way, the look stays the same with different screen fonts.
10496 \begin_layout Description
10497 \begin_inset Flex CharStyle:Code
10500 \begin_layout Plain Layout
10507 \begin_inset CommandInset label
10509 name "des:PathThru"
10516 \begin_inset Flex CharStyle:Code
10519 \begin_layout Plain Layout
10530 \begin_inset Flex CharStyle:Code
10533 \begin_layout Plain Layout
10539 ] Whether the contents of this paragraph should be output in raw form, meaning
10540 without special translations that LaTeX would require.
10543 \begin_layout Description
10544 \begin_inset Flex CharStyle:Code
10547 \begin_layout Plain Layout
10554 \begin_inset CommandInset label
10556 name "des:Preamble"
10560 Information to be included in the LaTeX preamable when this style is used.
10561 Used to define macros, load packages, etc., required by this particular
10564 \begin_inset Quotes eld
10568 \begin_inset Flex CharStyle:Code
10571 \begin_layout Plain Layout
10578 \begin_inset Quotes erd
10584 \begin_layout Description
10585 \begin_inset Flex CharStyle:Code
10588 \begin_layout Plain Layout
10595 \begin_inset Flex CharStyle:Code
10598 \begin_layout Plain Layout
10605 \begin_inset CommandInset label
10607 name "des:Requires"
10611 Whether the layout requires the feature
10612 \begin_inset Flex CharStyle:Code
10615 \begin_layout Plain Layout
10622 See the description of
10623 \begin_inset Flex CharStyle:Code
10626 \begin_layout Plain Layout
10633 \begin_inset CommandInset ref
10634 LatexCommand pageref
10635 reference "des:FreeSpacing"
10639 ) for information on `features'.
10643 \begin_layout Description
10644 \begin_inset Flex CharStyle:Code
10647 \begin_layout Plain Layout
10654 \begin_inset Flex CharStyle:Code
10657 \begin_layout Plain Layout
10664 \begin_inset Flex CharStyle:Code
10667 \begin_layout Plain Layout
10676 \begin_layout Description
10677 \begin_inset Flex CharStyle:Code
10680 \begin_layout Plain Layout
10687 \begin_inset Flex CharStyle:Code
10690 \begin_layout Plain Layout
10695 , onehalf, double, other
10704 ] This defines what the default spacing should be in the layout.
10706 \begin_inset Flex CharStyle:Code
10709 \begin_layout Plain Layout
10716 \begin_inset Flex CharStyle:Code
10719 \begin_layout Plain Layout
10726 \begin_inset Flex CharStyle:Code
10729 \begin_layout Plain Layout
10735 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
10736 If you specify the argument
10737 \begin_inset Flex CharStyle:Code
10740 \begin_layout Plain Layout
10746 , then you should also provide a numerical argument which will be the actual
10748 Note that, contrary to other parameters,
10749 \begin_inset Flex CharStyle:Code
10752 \begin_layout Plain Layout
10758 implies the generation of specific LaTeX code, using the package
10761 \begin_inset Flex CharStyle:Code
10764 \begin_layout Plain Layout
10773 \begin_layout Description
10774 \begin_inset Flex CharStyle:Code
10777 \begin_layout Plain Layout
10783 The font used for the text body .
10785 \begin_inset CommandInset ref
10787 reference "sec:fonts"
10794 \begin_layout Description
10795 \begin_inset Flex CharStyle:Code
10798 \begin_layout Plain Layout
10806 The level of the style in the table of contents.
10807 This is used for automatic numbering of section headings.
10810 \begin_layout Description
10811 \begin_inset Flex CharStyle:Code
10814 \begin_layout Plain Layout
10821 \begin_inset Flex CharStyle:Code
10824 \begin_layout Plain Layout
10830 ] The vertical space with which the very first of a chain of paragraphs
10831 with this layout is separated from the previous paragraph.
10832 If the previous paragraph has another layout, the separations are not simply
10833 added, but the maximum is taken.
10836 \begin_layout Subsection
10840 \begin_layout Standard
10841 \begin_inset CommandInset label
10847 Since version 1.3.0 of LyX, it is has been both possible and necessary to
10848 define the floats (
10849 \begin_inset Flex CharStyle:MenuItem
10852 \begin_layout Plain Layout
10859 \begin_inset Flex CharStyle:MenuItem
10862 \begin_layout Plain Layout
10868 , \SpecialChar \ldots{}
10869 ) in the text class itself.
10870 Standard floats are included in the file
10871 \begin_inset Flex CharStyle:Code
10874 \begin_layout Plain Layout
10880 , so you may have to do no more than add
10883 \begin_layout LyX-Code
10884 Input stdfloats.inc
10887 \begin_layout Standard
10888 to your layout file.
10889 If you want to implement a text class that proposes some other float types
10890 (like the AGU class bundled with LyX), the information below will hopefully
10894 \begin_layout Description
10895 \begin_inset Flex CharStyle:Code
10898 \begin_layout Plain Layout
10905 \begin_inset Flex CharStyle:Code
10908 \begin_layout Plain Layout
10915 \begin_inset Quotes erd
10919 \begin_inset Quotes erd
10922 ] The file name extension of an auxiliary file for the list of figures (or
10924 LaTeX writes the captions to this file.
10927 \begin_layout Description
10928 \begin_inset Flex CharStyle:Code
10931 \begin_layout Plain Layout
10938 \begin_inset Flex CharStyle:Code
10941 \begin_layout Plain Layout
10948 \begin_inset Quotes erd
10952 \begin_inset Quotes erd
10955 ] The string that will be used in the menus and also for the caption.
10958 \begin_layout Description
10959 \begin_inset Flex CharStyle:Code
10962 \begin_layout Plain Layout
10969 \begin_inset Flex CharStyle:Code
10972 \begin_layout Plain Layout
10981 \begin_inset Flex CharStyle:Code
10984 \begin_layout Plain Layout
10991 \begin_inset Flex CharStyle:Code
10994 \begin_layout Plain Layout
11000 if the float is already defined by the LaTeX document class.
11002 \begin_inset Flex CharStyle:Code
11005 \begin_layout Plain Layout
11011 , the float will be defined using the LaTeX package
11012 \begin_inset Flex CharStyle:Code
11015 \begin_layout Plain Layout
11024 \begin_layout Description
11025 \begin_inset Flex CharStyle:Code
11028 \begin_layout Plain Layout
11035 \begin_inset Flex CharStyle:Code
11038 \begin_layout Plain Layout
11045 \begin_inset Quotes erd
11049 \begin_inset Quotes erd
11052 ] The heading used for the list of floats.
11055 \begin_layout Description
11056 \begin_inset Flex CharStyle:Code
11059 \begin_layout Plain Layout
11066 \begin_inset Flex CharStyle:Code
11069 \begin_layout Plain Layout
11076 \begin_inset Quotes erd
11080 \begin_inset Quotes erd
11083 ] This (optional) argument determines whether floats of this class will
11084 be numbered within some sectional unit of the document.
11085 For example, if within is equal to
11086 \begin_inset Flex CharStyle:Code
11089 \begin_layout Plain Layout
11095 , the floats will be numbered within chapters.
11099 \begin_layout Description
11100 \begin_inset Flex CharStyle:Code
11103 \begin_layout Plain Layout
11110 \begin_inset Flex CharStyle:Code
11113 \begin_layout Plain Layout
11120 \begin_inset Quotes erd
11124 \begin_inset Quotes erd
11127 ] The default placement for the given class of floats.
11128 The string should be as in standard LaTeX:
11129 \begin_inset Flex CharStyle:Code
11132 \begin_layout Plain Layout
11139 \begin_inset Flex CharStyle:Code
11142 \begin_layout Plain Layout
11149 \begin_inset Flex CharStyle:Code
11152 \begin_layout Plain Layout
11159 \begin_inset Flex CharStyle:Code
11162 \begin_layout Plain Layout
11168 for top, bottom, page, and here, respectively.
11172 \begin_layout Plain Layout
11173 Note that the order of these letters in the string is irrelevant, like in
11179 On top of that there is a new type,
11180 \begin_inset Flex CharStyle:Code
11183 \begin_layout Plain Layout
11189 , which does not really correspond to a float, since it means: put it
11190 \begin_inset Quotes eld
11194 \begin_inset Quotes erd
11198 Note however that the
11199 \begin_inset Flex CharStyle:Code
11202 \begin_layout Plain Layout
11208 specifier is special and, because of implementation details, cannot be
11209 used in non-builtin float types.
11210 If you do not understand what this means, just use
11211 \begin_inset Quotes eld
11215 \begin_inset Flex CharStyle:Code
11218 \begin_layout Plain Layout
11225 \begin_inset Quotes erd
11231 \begin_layout Description
11232 \begin_inset Flex CharStyle:Code
11235 \begin_layout Plain Layout
11242 \begin_inset Flex CharStyle:Code
11245 \begin_layout Plain Layout
11252 \begin_inset Quotes erd
11256 \begin_inset Quotes erd
11259 ] The style used when defining the float using
11260 \begin_inset Flex CharStyle:Code
11263 \begin_layout Plain Layout
11274 \begin_layout Description
11275 \begin_inset Flex CharStyle:Code
11278 \begin_layout Plain Layout
11285 \begin_inset Flex CharStyle:Code
11288 \begin_layout Plain Layout
11295 \begin_inset Quotes erd
11299 \begin_inset Quotes erd
11303 \begin_inset Quotes eld
11307 \begin_inset Quotes erd
11310 of the new class of floats, like program or algorithm.
11311 After the appropriate
11312 \begin_inset Flex CharStyle:Code
11315 \begin_layout Plain Layout
11324 \begin_inset Flex CharStyle:Code
11327 \begin_layout Plain Layout
11336 \begin_inset Flex CharStyle:Code
11339 \begin_layout Plain Layout
11350 \begin_layout Standard
11351 Note that defining a float with type
11352 \begin_inset Flex CharStyle:Code
11355 \begin_layout Plain Layout
11363 automatically defines the corresponding counter with name
11364 \begin_inset Flex CharStyle:Code
11367 \begin_layout Plain Layout
11378 \begin_layout Subsection
11379 Flex insets and InsetLayout
11382 \begin_layout Standard
11383 \begin_inset CommandInset label
11385 name "sec:charstyle"
11389 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11390 these are called Flex insets.
11394 \begin_layout Standard
11395 Flex insets come in three different kinds:
11398 \begin_layout Itemize
11400 \begin_inset Flex CharStyle:Code
11403 \begin_layout Plain Layout
11409 ): These define semantic markup corresponding to such LaTeX commands as
11411 \begin_inset Flex CharStyle:Code
11414 \begin_layout Plain Layout
11423 \begin_inset Flex CharStyle:Code
11426 \begin_layout Plain Layout
11437 \begin_layout Itemize
11439 \begin_inset Flex CharStyle:Code
11442 \begin_layout Plain Layout
11448 ): These can be used to define custom collapsable insets, similar to ERT,
11449 footnote, and the like.
11450 An obvious example is an endnote inset, which is defined in the
11451 \begin_inset Flex CharStyle:Code
11454 \begin_layout Plain Layout
11463 \begin_layout Itemize
11465 \begin_inset Flex CharStyle:Code
11468 \begin_layout Plain Layout
11474 ): For use with DocBook classes.
11477 \begin_layout Standard
11478 Flex insets are defined using the
11479 \begin_inset Flex CharStyle:Code
11482 \begin_layout Plain Layout
11488 tag, which shall be explained in a moment.
11491 \begin_layout Standard
11493 \begin_inset Flex CharStyle:Code
11496 \begin_layout Plain Layout
11502 tag also serves another function: It can be used to customize the general
11503 layout of many different types of insets.
11505 \begin_inset Flex CharStyle:Code
11508 \begin_layout Plain Layout
11514 can be used to customize the layout parameters for footnotes, marginal
11515 notes, note insets, ERT insets, branches, listings, indexes, boxes, tables,
11516 algorithms, URLs, and optional arguments, as well as to define Flex insets.
11519 \begin_layout Standard
11521 \begin_inset Flex CharStyle:Code
11524 \begin_layout Plain Layout
11530 definition must begin with a line of the form:
11533 \begin_layout LyX-Code
11537 \begin_layout Standard
11539 \begin_inset Flex CharStyle:Code
11542 \begin_layout Plain Layout
11548 indicates the inset whose layout is being defined, and here there are two
11552 \begin_layout Enumerate
11553 The layout for a pre-existing inset is being modified.
11554 In this case, can be
11555 \begin_inset Flex CharStyle:Code
11558 \begin_layout Plain Layout
11564 any one of the following:
11565 \begin_inset Flex CharStyle:Code
11568 \begin_layout Plain Layout
11575 \begin_inset Flex CharStyle:Code
11578 \begin_layout Plain Layout
11585 \begin_inset Flex CharStyle:Code
11588 \begin_layout Plain Layout
11595 \begin_inset Flex CharStyle:Code
11598 \begin_layout Plain Layout
11605 \begin_inset Flex CharStyle:Code
11608 \begin_layout Plain Layout
11615 \begin_inset Flex CharStyle:Code
11618 \begin_layout Plain Layout
11625 \begin_inset Flex CharStyle:Code
11628 \begin_layout Plain Layout
11635 \begin_inset Flex CharStyle:Code
11638 \begin_layout Plain Layout
11645 \begin_inset Flex CharStyle:Code
11648 \begin_layout Plain Layout
11655 \begin_inset Flex CharStyle:Code
11658 \begin_layout Plain Layout
11665 \begin_inset Flex CharStyle:Code
11668 \begin_layout Plain Layout
11675 \begin_inset Flex CharStyle:Code
11678 \begin_layout Plain Layout
11685 \begin_inset Flex CharStyle:Code
11688 \begin_layout Plain Layout
11695 \begin_inset Flex CharStyle:Code
11698 \begin_layout Plain Layout
11705 \begin_inset Flex CharStyle:Code
11708 \begin_layout Plain Layout
11715 \begin_inset Flex CharStyle:Code
11718 \begin_layout Plain Layout
11725 \begin_inset Flex CharStyle:Code
11728 \begin_layout Plain Layout
11735 \begin_inset Flex CharStyle:Code
11738 \begin_layout Plain Layout
11745 \begin_inset Flex CharStyle:Code
11748 \begin_layout Plain Layout
11755 \begin_inset Flex CharStyle:Code
11758 \begin_layout Plain Layout
11768 \begin_layout Enumerate
11769 The layout for a Flex inset is being defined.
11771 \begin_inset Flex CharStyle:Code
11774 \begin_layout Plain Layout
11780 can be any valid identifier not used by a pre-existing inset.
11781 Note that the definition of a flex inset must
11786 \begin_inset Flex CharStyle:Code
11789 \begin_layout Plain Layout
11798 \begin_layout Standard
11800 \begin_inset Flex CharStyle:Code
11803 \begin_layout Plain Layout
11809 definition can contain the following entries:
11812 \begin_layout Description
11813 \begin_inset Flex CharStyle:Code
11816 \begin_layout Plain Layout
11822 The color for the inset's background.
11823 The valid colors are defined in
11824 \begin_inset Flex CharStyle:Code
11827 \begin_layout Plain Layout
11836 \begin_layout Description
11837 \begin_inset Flex CharStyle:Code
11840 \begin_layout Plain Layout
11846 As with paragraph styles (see page
11847 \begin_inset CommandInset ref
11849 reference "des:CopyStyle"
11856 \begin_layout Description
11857 \begin_inset Flex CharStyle:Code
11860 \begin_layout Plain Layout
11867 \begin_inset Flex CharStyle:Code
11870 \begin_layout Plain Layout
11879 \begin_inset Flex CharStyle:Code
11882 \begin_layout Plain Layout
11888 ] Indicates whether the user may employ the Paragraph Settings dialog to
11889 customize the paragraph.
11892 \begin_layout Description
11893 \begin_inset Flex CharStyle:Code
11896 \begin_layout Plain Layout
11903 \begin_inset Flex CharStyle:Code
11906 \begin_layout Plain Layout
11913 \begin_inset Flex CharStyle:Code
11916 \begin_layout Plain Layout
11923 \begin_inset Flex CharStyle:Code
11926 \begin_layout Plain Layout
11932 , describing the rendering style used for the inset's frame and buttons.
11933 Footnotes generally use
11934 \begin_inset Flex CharStyle:Code
11937 \begin_layout Plain Layout
11943 , ERT insets generally
11944 \begin_inset Flex CharStyle:Code
11947 \begin_layout Plain Layout
11953 , and character styles
11954 \begin_inset Flex CharStyle:Code
11957 \begin_layout Plain Layout
11966 \begin_layout Description
11967 \begin_inset Flex CharStyle:Code
11970 \begin_layout Plain Layout
11976 Required at the end of the InsetLayout declarations.
11979 \begin_layout Description
11980 \begin_inset Flex CharStyle:Code
11983 \begin_layout Plain Layout
11989 The font used for both the text body
11995 \begin_inset space ~
11999 \begin_inset CommandInset ref
12001 reference "sec:fonts"
12006 Note that defining this font automatically defines the
12007 \begin_inset Flex CharStyle:Code
12010 \begin_layout Plain Layout
12016 to the same value, so define this first and define
12017 \begin_inset Flex CharStyle:Code
12020 \begin_layout Plain Layout
12026 later if you want them to be different.
12029 \begin_layout Description
12030 \begin_inset Flex CharStyle:Code
12033 \begin_layout Plain Layout
12040 \begin_inset Quotes eld
12044 \begin_inset Quotes erd
12047 language, leading to Left-to-Right (latin) output, e.g.
12048 \begin_inset space \space{}
12055 \begin_layout Description
12056 \begin_inset Flex CharStyle:Code
12059 \begin_layout Plain Layout
12066 \begin_inset Flex CharStyle:Code
12069 \begin_layout Plain Layout
12078 \begin_inset Flex CharStyle:Code
12081 \begin_layout Plain Layout
12087 ] Indicates whether the PlainLayout should be used or, instead, the user
12088 can change the paragraph style used in the inset.
12091 \begin_layout Description
12092 \begin_inset Flex CharStyle:Code
12095 \begin_layout Plain Layout
12101 As with paragraph styles (see page
12102 \begin_inset CommandInset ref
12103 LatexCommand pageref
12104 reference "des:FreeSpacing"
12111 \begin_layout Description
12112 \begin_inset Flex CharStyle:Code
12115 \begin_layout Plain Layout
12121 As with paragraph styles (see page
12122 \begin_inset CommandInset ref
12123 LatexCommand pageref
12124 reference "des:KeepEmpty"
12131 \begin_layout Description
12132 \begin_inset Flex CharStyle:Code
12135 \begin_layout Plain Layout
12141 The font used for the label.
12143 \begin_inset space ~
12147 \begin_inset CommandInset ref
12149 reference "sec:fonts"
12154 Note that this definition can never appear before
12155 \begin_inset Flex CharStyle:Code
12158 \begin_layout Plain Layout
12164 , lest it be ineffective.
12167 \begin_layout Description
12168 \begin_inset Flex CharStyle:Code
12171 \begin_layout Plain Layout
12177 What will be displayed on the button or elsewhere as the inset label.
12178 Some inset types (ERT and Branch) modify this label on the fly.
12181 \begin_layout Description
12182 \begin_inset Flex CharStyle:Code
12185 \begin_layout Plain Layout
12191 The name of the corresponding LaTeX stuff.
12192 Either the environment or command name.
12195 \begin_layout Description
12196 \begin_inset Flex CharStyle:Code
12199 \begin_layout Plain Layout
12205 The optional parameter for the corresponding
12206 \begin_inset Flex CharStyle:Code
12209 \begin_layout Plain Layout
12215 stuff, including possible bracket pairs like
12216 \begin_inset Flex CharStyle:Code
12219 \begin_layout Plain Layout
12226 This parameter cannot be changed from within LyX.
12229 \begin_layout Description
12230 \begin_inset Flex CharStyle:Code
12233 \begin_layout Plain Layout
12239 As with paragraph styles (see page
12240 \begin_inset CommandInset ref
12241 LatexCommand pageref
12242 reference "des:LatexType"
12249 \begin_layout Description
12250 \begin_inset Flex CharStyle:Code
12253 \begin_layout Plain Layout
12260 \begin_inset Flex CharStyle:Code
12263 \begin_layout Plain Layout
12270 \begin_inset Flex CharStyle:Code
12273 \begin_layout Plain Layout
12280 \begin_inset Flex CharStyle:Code
12283 \begin_layout Plain Layout
12290 \begin_inset Flex CharStyle:Code
12293 \begin_layout Plain Layout
12299 (indicating a dummy definition ending definitions of charstyles, etc).
12300 This entry is required in and is only meaningful for Flex insets.
12301 Among other things, it determines on which menu this inset will appear.
12304 \begin_layout Description
12305 \begin_inset Flex CharStyle:Code
12308 \begin_layout Plain Layout
12315 \begin_inset Flex CharStyle:Code
12318 \begin_layout Plain Layout
12327 \begin_inset Flex CharStyle:Code
12330 \begin_layout Plain Layout
12336 ] Whether multiple paragraphs are permitted in this inset.
12337 This will also set CustomPars to the same value and ForcePlain to the opposite
12339 These can be reset to other values, if they are used
12346 \begin_layout Description
12347 \begin_inset Flex CharStyle:Code
12350 \begin_layout Plain Layout
12357 \begin_inset Flex CharStyle:Code
12360 \begin_layout Plain Layout
12369 \begin_inset Flex CharStyle:Code
12372 \begin_layout Plain Layout
12378 ] Whether fragile commands in this layout should be
12379 \begin_inset Flex CharStyle:Code
12382 \begin_layout Plain Layout
12395 whether the command should itself be protected.)
12398 \begin_layout Description
12399 \begin_inset Flex CharStyle:Code
12402 \begin_layout Plain Layout
12409 \begin_inset Flex CharStyle:Code
12412 \begin_layout Plain Layout
12421 \begin_inset Flex CharStyle:Code
12424 \begin_layout Plain Layout
12430 ] As with paragraph styles (see page
12431 \begin_inset CommandInset ref
12433 reference "des:PathThru"
12440 \begin_layout Description
12441 \begin_inset Flex CharStyle:Code
12444 \begin_layout Plain Layout
12450 As with paragraph styles (see page
12451 \begin_inset CommandInset ref
12452 LatexCommand pageref
12453 reference "des:Preamble"
12460 \begin_layout Description
12461 \begin_inset Flex CharStyle:Code
12464 \begin_layout Plain Layout
12471 \begin_inset Flex CharStyle:Code
12474 \begin_layout Plain Layout
12480 ] As with paragraph styles (see page
12481 \begin_inset CommandInset ref
12482 LatexCommand pageref
12483 reference "des:Requires"
12490 \begin_layout Subsection
12494 \begin_layout Standard
12495 \begin_inset CommandInset label
12501 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12503 \begin_inset Flex CharStyle:MenuItem
12506 \begin_layout Plain Layout
12513 \begin_inset Flex CharStyle:MenuItem
12516 \begin_layout Plain Layout
12522 , \SpecialChar \ldots{}
12523 ) in the text class itself.
12524 The standard counters are defined in the file
12525 \begin_inset Flex CharStyle:Code
12528 \begin_layout Plain Layout
12534 , so you may have to do no more than add
12537 \begin_layout LyX-Code
12538 Input stdcounters.inc
12541 \begin_layout Standard
12542 to your layout file to get them to work.
12543 But if you want to define custom counters, then you can do so.
12544 The counter declaration must begin with:
12547 \begin_layout LyX-Code
12551 \begin_layout Standard
12552 where of course `name' is replaced by the name of the counter.
12553 And it must end with
12554 \begin_inset Quotes eld
12558 \begin_inset Flex CharStyle:Code
12561 \begin_layout Plain Layout
12568 \begin_inset Quotes erd
12572 The following parameters can also be used:
12575 \begin_layout Description
12576 \begin_inset Flex CharStyle:Code
12579 \begin_layout Plain Layout
12580 LabelString [string=""]
12585 when this is defined, this string defines how the counter is displayed.
12586 Setting this value sets
12587 \begin_inset Flex CharStyle:Code
12590 \begin_layout Plain Layout
12591 LabelStringAppendix
12597 The following special constructs can be used in the string:
12601 \begin_layout Itemize
12602 \begin_inset Flex CharStyle:Code
12605 \begin_layout Plain Layout
12613 will be replaced by the expansion of the
12614 \begin_inset Flex CharStyle:Code
12617 \begin_layout Plain Layout
12624 \begin_inset Flex CharStyle:Code
12627 \begin_layout Plain Layout
12628 LabelStringAppendix
12634 \begin_inset Flex CharStyle:Code
12637 \begin_layout Plain Layout
12647 \begin_layout Itemize
12648 counter values can be expressed using LaTeX-like macros
12649 \begin_inset Flex CharStyle:Code
12652 \begin_layout Plain Layout
12669 \begin_inset Flex CharStyle:Code
12672 \begin_layout Plain Layout
12684 \begin_layout Plain Layout
12694 Actually, the situation is a bit more complicated: any
12713 other than those descibed below will produce arabic numerals.
12714 It would not be surprising to see this change in the future.
12720 \begin_inset Flex CharStyle:Code
12723 \begin_layout Plain Layout
12729 : 1, 2, 3,\SpecialChar \ldots{}
12731 \begin_inset Flex CharStyle:Code
12734 \begin_layout Plain Layout
12740 for lower-case letters: a, b, c, \SpecialChar \ldots{}
12742 \begin_inset Flex CharStyle:Code
12745 \begin_layout Plain Layout
12751 for upper-case letters: A, B, C, \SpecialChar \ldots{}
12753 \begin_inset Flex CharStyle:Code
12756 \begin_layout Plain Layout
12762 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
12764 \begin_inset Flex CharStyle:Code
12767 \begin_layout Plain Layout
12773 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
12775 \begin_inset Flex CharStyle:Code
12778 \begin_layout Plain Layout
12784 for hebrew numerals.
12788 \begin_layout Standard
12789 If LabelString is not defined, a default value is constructed as follows:
12790 if the counter has a master counter
12791 \begin_inset Flex CharStyle:Code
12794 \begin_layout Plain Layout
12801 \begin_inset Flex CharStyle:Code
12804 \begin_layout Plain Layout
12811 \begin_inset Flex CharStyle:Code
12814 \begin_layout Plain Layout
12824 is used; otherwise the string
12825 \begin_inset Flex CharStyle:Code
12828 \begin_layout Plain Layout
12839 \begin_layout Description
12840 \begin_inset Flex CharStyle:Code
12843 \begin_layout Plain Layout
12844 LabelStringAppendix [string=""]
12850 \begin_inset Flex CharStyle:Code
12853 \begin_layout Plain Layout
12859 , but for use in the Appendix.
12862 \begin_layout Description
12863 \begin_inset Flex CharStyle:Code
12866 \begin_layout Plain Layout
12873 \begin_inset Flex CharStyle:Code
12876 \begin_layout Plain Layout
12883 \begin_inset Quotes erd
12887 \begin_inset Quotes erd
12890 ] If this is set to the name of another counter, the present counter will
12891 be reset everytime the other one is increased.
12893 \begin_inset Flex CharStyle:Code
12896 \begin_layout Plain Layout
12903 \begin_inset Flex CharStyle:Code
12906 \begin_layout Plain Layout
12915 \begin_layout Subsection
12919 \begin_layout Standard
12920 \begin_inset CommandInset label
12926 A font description looks like this:
12929 \begin_layout LyX-Code
12939 \begin_layout LyX-Code
12943 \begin_layout LyX-Code
12947 \begin_layout Standard
12948 The following commands are available:
12951 \begin_layout Description
12952 \begin_inset Flex CharStyle:Code
12955 \begin_layout Plain Layout
12962 \begin_inset Flex CharStyle:Code
12965 \begin_layout Plain Layout
12974 \begin_inset Flex CharStyle:Code
12977 \begin_layout Plain Layout
12984 \begin_inset Flex CharStyle:Code
12987 \begin_layout Plain Layout
12994 \begin_inset Flex CharStyle:Code
12997 \begin_layout Plain Layout
13004 \begin_inset Flex CharStyle:Code
13007 \begin_layout Plain Layout
13014 \begin_inset Flex CharStyle:Code
13017 \begin_layout Plain Layout
13024 \begin_inset Flex CharStyle:Code
13027 \begin_layout Plain Layout
13034 \begin_inset Flex CharStyle:Code
13037 \begin_layout Plain Layout
13044 \begin_inset Flex CharStyle:Code
13047 \begin_layout Plain Layout
13056 \begin_layout Description
13057 \begin_inset Flex CharStyle:Code
13060 \begin_layout Plain Layout
13069 \begin_inset Flex CharStyle:Code
13072 \begin_layout Plain Layout
13083 \begin_inset Flex CharStyle:Code
13086 \begin_layout Plain Layout
13093 \begin_inset Flex CharStyle:Code
13096 \begin_layout Plain Layout
13105 \begin_layout Description
13106 \begin_inset Flex CharStyle:Code
13109 \begin_layout Plain Layout
13116 \begin_inset Flex CharStyle:Code
13119 \begin_layout Plain Layout
13125 ] Valid argument sare:
13126 \begin_inset Flex CharStyle:Code
13129 \begin_layout Plain Layout
13136 \begin_inset Flex CharStyle:Code
13139 \begin_layout Plain Layout
13146 \begin_inset Flex CharStyle:Code
13149 \begin_layout Plain Layout
13156 \begin_inset Flex CharStyle:Code
13159 \begin_layout Plain Layout
13166 \begin_inset Flex CharStyle:Code
13169 \begin_layout Plain Layout
13176 \begin_inset Flex CharStyle:Code
13179 \begin_layout Plain Layout
13186 Each of these turns on or off the corresponding attribute.
13189 \begin_layout Description
13190 \begin_inset Flex CharStyle:Code
13193 \begin_layout Plain Layout
13202 \begin_inset Flex CharStyle:Code
13205 \begin_layout Plain Layout
13216 \begin_inset Flex CharStyle:Code
13219 \begin_layout Plain Layout
13228 \begin_layout Description
13229 \begin_inset Flex CharStyle:Code
13232 \begin_layout Plain Layout
13241 \begin_inset Flex CharStyle:Code
13244 \begin_layout Plain Layout
13255 \begin_inset Flex CharStyle:Code
13258 \begin_layout Plain Layout
13265 \begin_inset Flex CharStyle:Code
13268 \begin_layout Plain Layout
13275 \begin_inset Flex CharStyle:Code
13278 \begin_layout Plain Layout
13287 \begin_layout Description
13288 \begin_inset Flex CharStyle:Code
13291 \begin_layout Plain Layout
13298 \begin_inset Flex CharStyle:Code
13301 \begin_layout Plain Layout
13308 \begin_inset Flex CharStyle:Code
13311 \begin_layout Plain Layout
13318 \begin_inset Flex CharStyle:Code
13321 \begin_layout Plain Layout
13330 \begin_inset Flex CharStyle:Code
13333 \begin_layout Plain Layout
13340 \begin_inset Flex CharStyle:Code
13343 \begin_layout Plain Layout
13350 \begin_inset Flex CharStyle:Code
13353 \begin_layout Plain Layout
13360 \begin_inset Flex CharStyle:Code
13363 \begin_layout Plain Layout
13370 \begin_inset Flex CharStyle:Code
13373 \begin_layout Plain Layout
13382 \begin_layout Subsection
13383 Upgrading old layout files
13386 \begin_layout Standard
13387 The file format of layout files changes from time to time, so old layout
13388 files need to be converted.
13389 This process has been automated since LyX 1.4.0: If LyX reads an old format
13390 layout file it will call the conversion tool
13391 \begin_inset Flex CharStyle:Code
13394 \begin_layout Plain Layout
13395 LyXDir/scripts/layout2layout.py
13400 and convert it to a temporary file in current format.
13401 The original file is left untouched.
13402 If you want to convert the layout file permanently, just call the converter
13406 \begin_layout LyX-Code
13407 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13410 \begin_layout Standard
13411 (You need to replace
13412 \begin_inset Flex CharStyle:Code
13415 \begin_layout Plain Layout
13421 with the name of your LyX system directory, unless you happen to have defined
13422 such an environment variable.) Then copy
13423 \begin_inset Flex CharStyle:Code
13426 \begin_layout Plain Layout
13433 \begin_inset Flex CharStyle:Code
13436 \begin_layout Plain Layout
13445 \begin_layout Standard
13446 The automatic conversion only handles syntax changes.
13447 It cannot handle the case where the contents of included files was changed,
13448 so these will have to be converted separately.
13451 \begin_layout Section
13453 \begin_inset CommandInset label
13455 name "sec:templates"
13462 \begin_layout Standard
13463 Templates are created just like usual documents.
13464 The only difference is that usual documents contain all possible settings,
13465 including the font scheme and the paper size.
13466 Usually a user doesn't want a template to overwrite his defaults in these
13468 For that reason, the designer of a template should remove the corresponding
13470 \begin_inset Flex CharStyle:Code
13473 \begin_layout Plain Layout
13482 \begin_inset Flex CharStyle:Code
13485 \begin_layout Plain Layout
13493 from the template LyX file.
13494 This can be done with any simple text-editor, for example
13495 \begin_inset Flex CharStyle:Code
13498 \begin_layout Plain Layout
13505 \begin_inset Flex CharStyle:Code
13508 \begin_layout Plain Layout
13518 \begin_layout Standard
13519 Put the edited template files you create in
13520 \begin_inset Flex CharStyle:Code
13523 \begin_layout Plain Layout
13529 , copy the ones you use from the global template directory in
13530 \begin_inset Flex CharStyle:Code
13533 \begin_layout Plain Layout
13539 to the same place, and redefine the template path in the
13540 \begin_inset Flex CharStyle:MenuItem
13543 \begin_layout Plain Layout
13544 Tools\SpecialChar \menuseparator
13545 Preferences\SpecialChar \menuseparator
13554 \begin_layout Standard
13555 Note that there is a template which has a particular meaning:
13556 \begin_inset Flex CharStyle:Code
13559 \begin_layout Plain Layout
13566 This template is loaded everytime you create a new document with
13567 \begin_inset Flex CharStyle:MenuItem
13570 \begin_layout Plain Layout
13571 File\SpecialChar \menuseparator
13577 in order to provide useful defaults.
13578 To create this template from inside LyX, all you have to do is to open
13579 a document with the correct settings, and use the
13580 \begin_inset Flex CharStyle:MenuItem
13583 \begin_layout Plain Layout
13584 Save as Document Defaults
13592 \begin_layout Chapter
13593 Including External Material
13596 \begin_layout Standard
13597 \begin_inset Box Shadowbox
13606 height_special "totalheight"
13609 \begin_layout Plain Layout
13610 WARNING: This portion of the documentation has not been updated for some
13612 We certainly hope that it is still accurate, but there are no guarantees.
13620 \begin_layout Standard
13621 The use of material from sources external to LyX is covered in detail in
13627 This part of the manual covers what needs to happen behind the scenes for
13628 new sorts of material to be included.
13631 \begin_layout Section
13635 \begin_layout Standard
13636 The external material feature is based on the concept of a
13641 A template is a specification of how LyX should interface with a certain
13643 As bundled, LyX comes with predefined templates for Xfig figures, various
13644 raster format images, chess diagrams, and LilyPond music notation.
13645 You can check the actual list by using the menu
13646 \begin_inset Flex CharStyle:MenuItem
13649 \begin_layout Plain Layout
13650 Insert\SpecialChar \menuseparator
13651 File\SpecialChar \menuseparator
13658 Furthermore, it is possible to roll your own template to support a specific
13660 Later we'll describe in more detail what is involved, and hopefully you
13661 will submit all the templates you create so we can include them in a later
13665 \begin_layout Standard
13666 Another basic idea of the external material feature is to distinguish between
13667 the original file that serves as a base for final material and the produced
13668 file that is included in your exported or printed document.
13669 For example, consider the case of a figure produced with
13670 \begin_inset Flex CharStyle:Code
13673 \begin_layout Plain Layout
13680 The Xfig application itself works on an original file with the
13681 \begin_inset Flex CharStyle:Code
13684 \begin_layout Plain Layout
13691 Within XFig, you create and change your figure, and when you are done,
13693 \begin_inset Flex CharStyle:Code
13696 \begin_layout Plain Layout
13703 When you want to include the figure in your document, you invoke
13704 \begin_inset Flex CharStyle:Code
13707 \begin_layout Plain Layout
13713 in order to create a PostScript file that can readily be included in your
13716 \begin_inset Flex CharStyle:Code
13719 \begin_layout Plain Layout
13725 file is the original file, and the PostScript file is the produced file.
13728 \begin_layout Standard
13729 This distinction is important in order to allow updating of the material
13730 while you are in the process of writing the document.
13731 Furthermore, it provides us with the flexibility that is needed to support
13732 multiple export formats.
13733 For instance, in the case of a plain text file, it is not exactly an award-winn
13734 ing idea to include the figure as raw PostScript®.
13735 Instead, you'd either prefer to just include a reference to the figure
13736 or try to invoke some graphics to Ascii converter to make the final result
13737 look similar to the real graphics.
13738 The external material management allows you to do this, because it is parameter
13739 ized on the different export formats that LyX supports.
13742 \begin_layout Standard
13743 Besides supporting the production of different products according to the
13744 exported format, it supports tight integration with editing and viewing
13746 In the case of an XFig figure, you are able to invoke Xfig on the original
13747 file with a single click from within the external material dialog in LyX,
13748 and also preview the produced PostScript file with ghostview with another
13750 No more fiddling around with the command line and/or file browsers to locate
13751 and manipulate the original or produced files.
13752 In this way, you are finally able to take full advantage of the many different
13753 applications that are relevant to use when you write your documents, and
13754 ultimately be more productive.
13757 \begin_layout Section
13758 The external template configuration file
13761 \begin_layout Standard
13762 It is relatively easy to add custom external template definitions to LyX.
13763 However, be aware that doing this in an careless manner most probably
13767 introduce an easily exploitable security hole.
13768 So before you do this, please read the discussion about security in section
13770 \begin_inset CommandInset ref
13772 reference "sec:Security-discussion"
13779 \begin_layout Standard
13780 Having said that, we encourage you to submit any interesting templates that
13785 \begin_layout Standard
13786 The external templates are defined in the
13787 \begin_inset Flex CharStyle:Code
13790 \begin_layout Plain Layout
13791 LyXDir/lib/external_templates
13797 You can place your own version in
13798 \begin_inset Flex CharStyle:Code
13801 \begin_layout Plain Layout
13802 UserDir/external_templates
13810 \begin_layout Standard
13811 A typical template looks like this:
13814 \begin_layout LyX-Code
13818 \begin_layout LyX-Code
13819 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
13822 \begin_layout LyX-Code
13826 \begin_layout LyX-Code
13830 \begin_layout LyX-Code
13834 \begin_layout LyX-Code
13838 \begin_layout LyX-Code
13842 \begin_layout LyX-Code
13843 AutomaticProduction true
13846 \begin_layout LyX-Code
13850 \begin_layout LyX-Code
13854 \begin_layout LyX-Code
13858 \begin_layout LyX-Code
13859 TransformCommand Rotate RotationLatexCommand
13862 \begin_layout LyX-Code
13863 TransformCommand Resize ResizeLatexCommand
13866 \begin_layout LyX-Code
13867 Product "$$RotateFront$$ResizeFront
13870 \begin_layout LyX-Code
13875 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
13878 \begin_layout LyX-Code
13879 $$ResizeBack$$RotateBack"
13882 \begin_layout LyX-Code
13886 \begin_layout LyX-Code
13887 UpdateResult "$$AbsPath$$Basename.pstex_t"
13890 \begin_layout LyX-Code
13891 Requirement "graphicx"
13894 \begin_layout LyX-Code
13895 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
13898 \begin_layout LyX-Code
13899 ReferencedFile latex "$$AbsPath$$Basename.eps"
13902 \begin_layout LyX-Code
13903 ReferencedFile dvi "$$AbsPath$$Basename.eps"
13906 \begin_layout LyX-Code
13910 \begin_layout LyX-Code
13914 \begin_layout LyX-Code
13915 TransformCommand Rotate RotationLatexCommand
13918 \begin_layout LyX-Code
13919 TransformCommand Resize ResizeLatexCommand
13922 \begin_layout LyX-Code
13923 Product "$$RotateFront$$ResizeFront
13926 \begin_layout LyX-Code
13931 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
13934 \begin_layout LyX-Code
13935 $$ResizeBack$$RotateBack"
13938 \begin_layout LyX-Code
13939 UpdateFormat pdftex
13942 \begin_layout LyX-Code
13943 UpdateResult "$$AbsPath$$Basename.pdftex_t"
13946 \begin_layout LyX-Code
13947 Requirement "graphicx"
13950 \begin_layout LyX-Code
13951 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
13954 \begin_layout LyX-Code
13955 ReferencedFile latex "$$AbsPath$$Basename.pdf"
13958 \begin_layout LyX-Code
13962 \begin_layout LyX-Code
13966 \begin_layout LyX-Code
13967 Product "$$Contents(
13969 "$$AbsPath$$Basename.asc
13974 \begin_layout LyX-Code
13975 UpdateFormat asciixfig
13978 \begin_layout LyX-Code
13979 UpdateResult "$$AbsPath$$Basename.asc"
13982 \begin_layout LyX-Code
13986 \begin_layout LyX-Code
13990 \begin_layout LyX-Code
13991 Product "<graphic fileref=
13993 "$$AbsOrRelPathMaster$$Basename.eps
13998 \begin_layout LyX-Code
14002 \begin_layout LyX-Code
14006 \begin_layout LyX-Code
14007 UpdateResult "$$AbsPath$$Basename.eps"
14010 \begin_layout LyX-Code
14011 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14014 \begin_layout LyX-Code
14015 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14018 \begin_layout LyX-Code
14022 \begin_layout LyX-Code
14023 Product "[XFig: $$FName]"
14026 \begin_layout LyX-Code
14030 \begin_layout LyX-Code
14034 \begin_layout Standard
14035 As you can see, the template is enclosed in
14036 \begin_inset Flex CharStyle:Code
14039 \begin_layout Plain Layout
14045 \SpecialChar \ldots{}
14047 \begin_inset Flex CharStyle:Code
14050 \begin_layout Plain Layout
14057 It contains a header specifying some general settings and, for each supported
14058 primary document file format, a section
14059 \begin_inset Flex CharStyle:Code
14062 \begin_layout Plain Layout
14068 \SpecialChar \ldots{}
14070 \begin_inset Flex CharStyle:Code
14073 \begin_layout Plain Layout
14082 \begin_layout Subsection
14083 The template header
14086 \begin_layout Description
14087 \begin_inset Flex CharStyle:Code
14090 \begin_layout Plain Layout
14091 AutomaticProduction
14092 \begin_inset space ~
14100 Whether the file represented by the template must be generated by LyX.
14101 This command must occur exactly once.
14104 \begin_layout Description
14105 \begin_inset Flex CharStyle:Code
14108 \begin_layout Plain Layout
14110 \begin_inset space ~
14118 A glob pattern that is used in the file dialog to filter out the desired
14120 If there is more than one possible file extension (e.g.
14121 \begin_inset space \space{}
14125 \begin_inset Flex CharStyle:Code
14128 \begin_layout Plain Layout
14135 \begin_inset Flex CharStyle:Code
14138 \begin_layout Plain Layout
14144 ), use something like
14145 \begin_inset Flex CharStyle:Code
14148 \begin_layout Plain Layout
14155 This command must occur exactly once.
14158 \begin_layout Description
14159 \begin_inset Flex CharStyle:Code
14162 \begin_layout Plain Layout
14164 \begin_inset space ~
14172 The text that is displayed on the button.
14173 This command must occur exactly once.
14176 \begin_layout Description
14177 \begin_inset Flex CharStyle:Code
14180 \begin_layout Plain Layout
14182 \begin_inset space ~
14186 \begin_inset space ~
14194 The help text that is used in the External dialog.
14195 Provide enough information to explain to the user just what the template
14196 can provide him with.
14197 This command must occur exactly once.
14200 \begin_layout Description
14201 \begin_inset Flex CharStyle:Code
14204 \begin_layout Plain Layout
14206 \begin_inset space ~
14214 The file format of the original file.
14215 This must be the name of a format that is known to LyX (see section
14216 \begin_inset CommandInset ref
14218 reference "sub:Formats"
14224 \begin_inset Quotes eld
14228 \begin_inset Flex CharStyle:Code
14231 \begin_layout Plain Layout
14238 \begin_inset Quotes erd
14241 if the template can handle original files of more than one format.
14242 LyX will attempt to interrogate the file itself in order to deduce its
14243 format in this case.
14244 This command must occur exactly once.
14247 \begin_layout Description
14248 \begin_inset Flex CharStyle:Code
14251 \begin_layout Plain Layout
14253 \begin_inset space ~
14261 A unique name for the template.
14262 It must not contain substitution macros (see below).
14265 \begin_layout Description
14266 \begin_inset Flex CharStyle:Code
14269 \begin_layout Plain Layout
14271 \begin_inset space ~
14274 Rotate|Resize|Clip|Extra
14279 This command specifies which transformations are supported by this template.
14280 It may occur zero or more times.
14281 This command enables the corresponding tabs in the external dialog.
14283 \begin_inset Flex CharStyle:Code
14286 \begin_layout Plain Layout
14292 command must have either a corresponding
14293 \begin_inset Flex CharStyle:Code
14296 \begin_layout Plain Layout
14303 \begin_inset Flex CharStyle:Code
14306 \begin_layout Plain Layout
14313 \begin_inset Flex CharStyle:Code
14316 \begin_layout Plain Layout
14323 Otherwise the transformation will not be supported by that format.
14326 \begin_layout Subsection
14330 \begin_layout Description
14331 \begin_inset Flex CharStyle:Code
14334 \begin_layout Plain Layout
14336 \begin_inset space ~
14339 LaTeX|PDFLaTeX|PlainText|DocBook
14344 The primary document file format that this format definition is for.
14345 Not every template has a sensible representation in all document file formats.
14346 Please define nevertheless a
14347 \begin_inset Flex CharStyle:Code
14350 \begin_layout Plain Layout
14356 section for all formats.
14357 Use a dummy text when no representation is available.
14358 Then you can at least see a reference to the external material in the exported
14362 \begin_layout Description
14363 \begin_inset Flex CharStyle:Code
14366 \begin_layout Plain Layout
14368 \begin_inset space ~
14372 \begin_inset space ~
14380 This command defines an additional macro
14381 \begin_inset Flex CharStyle:Code
14384 \begin_layout Plain Layout
14390 for substitution in
14391 \begin_inset Flex CharStyle:Code
14394 \begin_layout Plain Layout
14402 \begin_inset Flex CharStyle:Code
14405 \begin_layout Plain Layout
14411 itself may contain substitution macros.
14412 The advantage over using
14413 \begin_inset Flex CharStyle:Code
14416 \begin_layout Plain Layout
14423 \begin_inset Flex CharStyle:Code
14426 \begin_layout Plain Layout
14432 is that the substituted value of
14433 \begin_inset Flex CharStyle:Code
14436 \begin_layout Plain Layout
14442 is sanitized so that it is a valid optional argument in the document format.
14443 This command may occur zero or more times.
14446 \begin_layout Description
14447 \begin_inset Flex CharStyle:Code
14450 \begin_layout Plain Layout
14452 \begin_inset space ~
14460 The text that is inserted in the exported document.
14461 This is actually the most important command and can be quite complex.
14462 This command must occur exactly once.
14465 \begin_layout Description
14466 \begin_inset Flex CharStyle:Code
14469 \begin_layout Plain Layout
14471 \begin_inset space ~
14479 This command specifies a preamble snippet that will be included in the
14481 It has to be defined using
14482 \begin_inset Flex CharStyle:Code
14485 \begin_layout Plain Layout
14491 \SpecialChar \ldots{}
14493 \begin_inset Flex CharStyle:Code
14496 \begin_layout Plain Layout
14503 This command may occur zero or more times.
14506 \begin_layout Description
14507 \begin_inset Flex CharStyle:Code
14510 \begin_layout Plain Layout
14512 \begin_inset space ~
14516 \begin_inset space ~
14524 This command denotes files that are created by the conversion process and
14525 are needed for a particular export format.
14526 If the filename is relative, it is interpreted relative to the master document.
14527 This command may be given zero or more times.
14530 \begin_layout Description
14531 \begin_inset Flex CharStyle:Code
14534 \begin_layout Plain Layout
14536 \begin_inset space ~
14544 The name of a required LaTeX package.
14545 The package is included via
14546 \begin_inset Flex CharStyle:Code
14549 \begin_layout Plain Layout
14557 in the LaTeX preamble.
14558 This command may occur zero or more times.
14561 \begin_layout Description
14562 \begin_inset Flex CharStyle:Code
14565 \begin_layout Plain Layout
14567 \begin_inset space ~
14571 \begin_inset space ~
14574 RotationLatexCommand
14579 This command specifies that the built in LaTeX command should be used for
14581 This command may occur once or not at all.
14584 \begin_layout Description
14585 \begin_inset Flex CharStyle:Code
14588 \begin_layout Plain Layout
14590 \begin_inset space ~
14594 \begin_inset space ~
14602 This command specifies that the built in LaTeX command should be used for
14604 This command may occur once or not at all.
14607 \begin_layout Description
14608 \begin_inset Flex CharStyle:Code
14611 \begin_layout Plain Layout
14613 \begin_inset space ~
14617 \begin_inset space ~
14620 RotationLatexOption
14625 This command specifies that rotation is done via an optional argument.
14626 This command may occur once or not at all.
14629 \begin_layout Description
14630 \begin_inset Flex CharStyle:Code
14633 \begin_layout Plain Layout
14635 \begin_inset space ~
14639 \begin_inset space ~
14647 This command specifies that resizing is done via an optional argument.
14648 This command may occur once or not at all.
14651 \begin_layout Description
14652 \begin_inset Flex CharStyle:Code
14655 \begin_layout Plain Layout
14657 \begin_inset space ~
14661 \begin_inset space ~
14669 This command specifies that clipping is done via an optional argument.
14670 This command may occur once or not at all.
14673 \begin_layout Description
14674 \begin_inset Flex CharStyle:Code
14677 \begin_layout Plain Layout
14679 \begin_inset space ~
14683 \begin_inset space ~
14691 This command specifies that an extra optional argument is used.
14692 This command may occur once or not at all.
14695 \begin_layout Description
14696 \begin_inset Flex CharStyle:Code
14699 \begin_layout Plain Layout
14701 \begin_inset space ~
14709 The file format of the converted file.
14710 This must be the name of a format that is known to LyX (see the
14711 \begin_inset Flex CharStyle:MenuItem
14714 \begin_layout Plain Layout
14719 ools\SpecialChar \menuseparator
14724 references:Conversion
14730 This command must occur exactly once.
14733 \begin_layout Description
14734 \begin_inset Flex CharStyle:Code
14737 \begin_layout Plain Layout
14739 \begin_inset space ~
14747 The file name of the converted file.
14748 The file name must be absolute.
14749 This command must occur exactly once.
14752 \begin_layout Subsection
14753 Preamble definitions
14756 \begin_layout Standard
14757 The external template configuration file may contain additional preamble
14758 definitions enclosed by
14759 \begin_inset Flex CharStyle:Code
14762 \begin_layout Plain Layout
14768 \SpecialChar \ldots{}
14770 \begin_inset Flex CharStyle:Code
14773 \begin_layout Plain Layout
14780 They can be used by the templates in the
14781 \begin_inset Flex CharStyle:Code
14784 \begin_layout Plain Layout
14793 \begin_layout Section
14794 The substitution mechanism
14797 \begin_layout Standard
14798 When the external material facility invokes an external program, it is done
14799 on the basis of a command defined in the template configuration file.
14800 These commands can contain various macros that are expanded before execution.
14801 Execution always take place in the directory of the containing document.
14804 \begin_layout Standard
14805 Also, whenever external material is to be displayed, the name will be produced
14806 by the substitution mechanism, and most other commands in the template
14807 definition support substitution as well.
14810 \begin_layout Standard
14811 The available macros are the following:
14814 \begin_layout Description
14815 \begin_inset Flex CharStyle:Code
14818 \begin_layout Plain Layout
14819 $$AbsOrRelPathMaster
14824 The file path, absolute or relative to the master LyX document.
14827 \begin_layout Description
14828 \begin_inset Flex CharStyle:Code
14831 \begin_layout Plain Layout
14832 $$AbsOrRelPathParent
14837 The file path, absolute or relative to the LyX document.
14840 \begin_layout Description
14841 \begin_inset Flex CharStyle:Code
14844 \begin_layout Plain Layout
14850 The absolute file path.
14853 \begin_layout Description
14854 \begin_inset Flex CharStyle:Code
14857 \begin_layout Plain Layout
14863 The filename without path and without the extension.
14866 \begin_layout Description
14867 \begin_inset Flex CharStyle:Code
14870 \begin_layout Plain Layout
14872 \begin_inset Quotes eld
14876 \begin_inset Quotes erd
14884 This macro will expand to the contents of the file with the name
14885 \begin_inset Flex CharStyle:Code
14888 \begin_layout Plain Layout
14897 \begin_layout Description
14898 \begin_inset Flex CharStyle:Code
14901 \begin_layout Plain Layout
14907 The file extension (including the dot).
14910 \begin_layout Description
14911 \begin_inset Flex CharStyle:Code
14914 \begin_layout Plain Layout
14920 The filename of the file specified in the external material dialog.
14921 This is either an absolute name, or it is relative to the LyX document.
14924 \begin_layout Description
14925 \begin_inset Flex CharStyle:Code
14928 \begin_layout Plain Layout
14935 \begin_inset Flex CharStyle:Code
14938 \begin_layout Plain Layout
14944 (absolute name or relative to the LyX document).
14947 \begin_layout Description
14948 \begin_inset Flex CharStyle:Code
14951 \begin_layout Plain Layout
14957 The file path, relative to the master LyX document.
14960 \begin_layout Description
14961 \begin_inset Flex CharStyle:Code
14964 \begin_layout Plain Layout
14970 The file path, relative to the LyX document.
14973 \begin_layout Description
14974 \begin_inset Flex CharStyle:Code
14977 \begin_layout Plain Layout
14983 This macro will expand to the absolute path of the system directory.
14984 This is typically used to point to the various helper scripts that are
14988 \begin_layout Description
14989 \begin_inset Flex CharStyle:Code
14992 \begin_layout Plain Layout
14998 A name and full path to a temporary file which will be automatically deleted
14999 whenever the containing document is closed, or the external material insertion
15003 \begin_layout Standard
15004 All path macros contain a trailing directory separator, so you can construct
15006 \begin_inset space \space{}
15009 the absolute filename with
15010 \begin_inset Flex CharStyle:Code
15013 \begin_layout Plain Layout
15014 $$AbsPath$$Basename$$Extension
15022 \begin_layout Standard
15023 The macros above are substituted in all commands unless otherwise noted.
15025 \begin_inset Flex CharStyle:Code
15028 \begin_layout Plain Layout
15034 supports additionally the following substitutions if they are enabled by
15036 \begin_inset Flex CharStyle:Code
15039 \begin_layout Plain Layout
15046 \begin_inset Flex CharStyle:Code
15049 \begin_layout Plain Layout
15058 \begin_layout Description
15059 \begin_inset Flex CharStyle:Code
15062 \begin_layout Plain Layout
15068 The front part of the resize command.
15071 \begin_layout Description
15072 \begin_inset Flex CharStyle:Code
15075 \begin_layout Plain Layout
15081 The back part of the resize command.
15084 \begin_layout Description
15085 \begin_inset Flex CharStyle:Code
15088 \begin_layout Plain Layout
15094 The front part of the rotation command.
15097 \begin_layout Description
15098 \begin_inset Flex CharStyle:Code
15101 \begin_layout Plain Layout
15107 The back part of the rotation command.
15110 \begin_layout Standard
15111 The value string of the
15112 \begin_inset Flex CharStyle:Code
15115 \begin_layout Plain Layout
15121 command supports additionally the following substitutions if they are enabled
15123 \begin_inset Flex CharStyle:Code
15126 \begin_layout Plain Layout
15133 \begin_inset Flex CharStyle:Code
15136 \begin_layout Plain Layout
15145 \begin_layout Description
15146 \begin_inset Flex CharStyle:Code
15149 \begin_layout Plain Layout
15158 \begin_layout Description
15159 \begin_inset Flex CharStyle:Code
15162 \begin_layout Plain Layout
15171 \begin_layout Description
15172 \begin_inset Flex CharStyle:Code
15175 \begin_layout Plain Layout
15184 \begin_layout Description
15185 \begin_inset Flex CharStyle:Code
15188 \begin_layout Plain Layout
15194 The rotation option.
15197 \begin_layout Standard
15198 You may ask why there are so many path macros.
15199 There are mainly two reasons:
15202 \begin_layout Enumerate
15203 Relative and absolute file names should remain relative or absolute, respectivel
15205 Users may have reasons to prefer either form.
15206 Relative names are useful for portable documents that should work on different
15207 machines, for example.
15208 Absolute names may be required by some programs.
15211 \begin_layout Enumerate
15212 LaTeX treats relative file names differently than LyX and other programs
15213 in nested included files.
15214 For LyX, a relative file name is always relative to the document that contains
15216 For LaTeX, it is always relative to the master document.
15217 These two definitions are identical if you have only one document, but
15218 differ if you have a master document that includes part documents.
15219 That means that relative filenames must be transformed when presented to
15221 Fortunately LyX does this automatically for you if you choose the right
15225 \begin_layout Standard
15226 So which path macro should be used in new template definitions? The rule
15230 \begin_layout Itemize
15232 \begin_inset Flex CharStyle:Code
15235 \begin_layout Plain Layout
15241 if an absolute path is required.
15244 \begin_layout Itemize
15246 \begin_inset Flex CharStyle:Code
15249 \begin_layout Plain Layout
15250 $$AbsOrRelPathMaster
15255 if the substituted string is some kind of LaTeX input.
15258 \begin_layout Itemize
15260 \begin_inset Flex CharStyle:Code
15263 \begin_layout Plain Layout
15264 $$AbsOrRelPathParent
15269 in order to preserve the user's choice.
15272 \begin_layout Standard
15273 There are special cases where this rule does not work and e.g.
15274 \begin_inset space \space{}
15277 relative names are needed, but normally it will work just fine.
15278 One example for such a case is the command
15279 \begin_inset Flex CharStyle:Code
15282 \begin_layout Plain Layout
15283 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15288 in the XFig template above: We can't use the absolute name because the
15290 \begin_inset Flex CharStyle:Code
15293 \begin_layout Plain Layout
15299 files needs the relative name in order to rewrite the file content.
15302 \begin_layout Section
15303 \begin_inset CommandInset label
15305 name "sec:Security-discussion"
15309 Security discussion
15312 \begin_layout Standard
15313 \begin_inset Box Shadowbox
15322 height_special "totalheight"
15325 \begin_layout Plain Layout
15326 WARNING: This section is definitely outdated.
15334 \begin_layout Standard
15335 The external material feature interfaces with a lot of external programs
15336 and does so automatically, so we have to consider the security implications
15338 In particular, since you have the option of including your own filenames
15339 and/or parameter strings and those are expanded into a command, it seems
15340 that it would be possible to create a malicious document which executes
15341 arbitrary commands when a user views or prints the document.
15342 This is something we definately want to avoid.
15345 \begin_layout Standard
15346 However, since the external program commands are specified in the template
15347 configuration file only, there are no security issues if LyX is properly
15348 configured with safe templates only.
15349 This is so because the external programs are invoked with the
15350 \begin_inset Flex CharStyle:Code
15353 \begin_layout Plain Layout
15359 -system call rather than the
15360 \begin_inset Flex CharStyle:Code
15363 \begin_layout Plain Layout
15369 system-call, so it's not possible to execute arbitrary commands from the
15370 filename or parameter section via the shell.
15373 \begin_layout Standard
15374 This also implies that you are restricted in what command strings you can
15375 use in the external material templates.
15376 In particular, pipes and redirection are not readily available.
15377 This has to be so if LyX should remain safe.
15378 If you want to use some of the shell features, you should write a safe
15379 script to do this in a controlled manner, and then invoke the script from
15380 the command string.
15382 \begin_inset Flex CharStyle:Code
15385 \begin_layout Plain Layout
15391 directory of the LyX installation, you can find a safe wrapper script
15392 \begin_inset Flex CharStyle:Code
15395 \begin_layout Plain Layout
15396 general_command_wrapper.py
15401 that supports redirection of input and output.
15402 That can serve as an example for how to write safe template scripts.
15403 For a more advanced example that uses
15404 \begin_inset Flex CharStyle:Code
15407 \begin_layout Plain Layout
15413 and friends, take a look at the
15414 \begin_inset Flex CharStyle:Code
15417 \begin_layout Plain Layout
15426 \begin_layout Standard
15427 It is possible to design a template that interacts directly with the shell,
15428 but since this would allow a malicious user to execute arbitrary commands
15429 by writing clever filenames and/or parameters, we generally recommend that
15430 you only use safe scripts that work with the
15431 \begin_inset Flex CharStyle:Code
15434 \begin_layout Plain Layout
15440 system call in a controlled manner.
15441 Of course, for use in a controlled environment, it can be tempting to just
15442 fall back to use ordinary shell scripts.
15443 If you do so, be aware that you
15447 provide an easily exploitable security hole in your system.
15448 Of course it stands to reason that such unsafe templates will never be
15449 included in the standard LyX distribution, although we do encourage people
15450 to submit new templates in the open source tradition.
15451 But LyX as shipped from the official distribution channels will never have
15455 \begin_layout Standard
15456 Including external material provides a lot of power, and you have to be
15457 careful not to introduce security hazards with this power.
15458 A subtle error in a single line in an innocent looking script can open
15459 the door to huge security problems.
15460 So if you do not fully understand the issues, we recommend that you consult
15461 a knowledgable security professional or the LyX development team if you
15462 have any questions about whether a given template is safe or not.
15463 And do this before you use it in an uncontrolled environment.