1 #LyX 1.6.1 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>.
155 \begin_inset Newline newline
159 \begin_inset Newline newline
165 \begin_layout Standard
166 \begin_inset CommandInset toc
167 LatexCommand tableofcontents
174 \begin_layout Chapter
178 \begin_layout Standard
179 This manual covers the customization features present in LyX.
180 In it, we discuss issues like keyboard shortcuts, screen previewing options,
181 printer options, sending commands to LyX via the LyX Server, internationalizati
182 on, installing new LaTeX classes and LyX layouts, etc.
183 We can't possibly hope to touch on everything you can change—our developers
184 add new features faster than we can document them—but we will explain the
185 most common customizations and hopefully point you in the right direction
186 for some of the more obscure ones.
189 \begin_layout Standard
190 \begin_inset Branch OutDated
193 \begin_layout Standard
194 Information from previous versions of this document that now seems to be
195 outdated is contained in the OutDated branch of this document.
196 By default, this information will not appear in the LaTeX output.
204 \begin_layout Chapter
205 LyX configuration files
208 \begin_layout Standard
209 This chapter aims to help you to find your way through the LyX configuration
211 Before continuing to read this chapter, you should find out where your
212 LyX library and user directories are by using
213 \begin_inset Flex CharStyle:MenuItem
216 \begin_layout Plain Layout
217 Help\SpecialChar \menuseparator
228 The library directory is the place where LyX places its system-wide configurati
229 on files; the user directory is where you can place your modified versions.
230 We will call the former
231 \begin_inset Flex CharStyle:Code
234 \begin_layout Plain Layout
241 \begin_inset Flex CharStyle:MenuItem
244 \begin_layout Plain Layout
250 in the remainder of this document.
254 \begin_layout Section
256 \begin_inset Flex CharStyle:Code
259 \begin_layout Plain Layout
268 \begin_layout Standard
269 \begin_inset Flex CharStyle:Code
272 \begin_layout Plain Layout
278 and its sub-directories contain a number of files and that can be used
279 to customize LyX's behavior.
280 You can change many of these files from within LyX itself through the
281 \begin_inset Flex CharStyle:MenuItem
284 \begin_layout Plain Layout
285 Tools\SpecialChar \menuseparator
292 Most customization that you will want to do in LyX is possible through
294 However, many other inner aspects of LyX can be customized by modifying
296 \begin_inset Flex CharStyle:Code
299 \begin_layout Plain Layout
306 These files fall in different categories, described in the following subsection
310 \begin_layout Subsection
311 Automatically generated files
314 \begin_layout Standard
315 The files, which are to be found in
316 \begin_inset Flex CharStyle:MenuItem
319 \begin_layout Plain Layout
325 , are generated when you configure LyX.
326 They contain various default values that are guessed by inspection.
327 In general, it is not a good idea to modify them, since they might be overwritt
331 \begin_layout Labeling
332 \labelwidthstring 00.00.0000
333 \begin_inset Flex CharStyle:Code
336 \begin_layout Plain Layout
342 contains defaults for various commands.
345 \begin_layout Labeling
346 \labelwidthstring 00.00.0000
347 \begin_inset Flex CharStyle:Code
350 \begin_layout Plain Layout
356 contains the list of packages that have been recognized by LyX.
357 It is currently unused by the LyX program itself, but the information extracted
358 , and more, is made available with
359 \begin_inset Flex CharStyle:MenuItem
362 \begin_layout Plain Layout
363 Help\SpecialChar \menuseparator
376 \begin_layout Labeling
377 \labelwidthstring 00.00.0000
378 \begin_inset Flex CharStyle:Code
381 \begin_layout Plain Layout
387 the list of text classes that have been found in your
388 \begin_inset Flex CharStyle:Code
391 \begin_layout Plain Layout
397 directories, along with the associated LaTeX document class and their descripti
401 \begin_layout Labeling
402 \labelwidthstring 00.00.0000
403 \begin_inset Flex CharStyle:Code
406 \begin_layout Plain Layout
412 the list of layout modules found in your
413 \begin_inset Flex CharStyle:Code
416 \begin_layout Plain Layout
425 \begin_layout Labeling
426 \labelwidthstring 00.00.0000
427 \begin_inset Flex CharStyle:Code
430 \begin_layout Plain Layout
436 lists of various sorts of LaTeX-related files found on your system
439 \begin_layout Labeling
440 \labelwidthstring 00.00.0000
441 \begin_inset Flex CharStyle:Code
444 \begin_layout Plain Layout
450 is automatically generated during configuration from the file
451 \begin_inset Flex CharStyle:Code
454 \begin_layout Plain Layout
461 It contains information on your LaTeX configuration.
464 \begin_layout Subsection
468 \begin_layout Standard
469 These directories are duplicated between
470 \begin_inset Flex CharStyle:Code
473 \begin_layout Plain Layout
480 \begin_inset Flex CharStyle:Code
483 \begin_layout Plain Layout
490 If a particular files exists in both places, the one in
491 \begin_inset Flex CharStyle:Code
494 \begin_layout Plain Layout
503 \begin_layout Labeling
504 \labelwidthstring 00.00.0000
505 \begin_inset Flex CharStyle:Code
508 \begin_layout Plain Layout
514 this directory contains files with the extension
515 \begin_inset Flex CharStyle:Code
518 \begin_layout Plain Layout
524 that define the keybindings used in LyX.
525 If there exists an internationalized version of the bind file named
526 \begin_inset Flex CharStyle:Code
529 \begin_layout Plain Layout
535 , that will be used first.
538 \begin_layout Labeling
539 \labelwidthstring 00.00.0000
540 \begin_inset Flex CharStyle:Code
543 \begin_layout Plain Layout
549 contains graphics files that can be included in documents.
553 \begin_layout Labeling
554 \labelwidthstring 00.00.0000
555 \begin_inset Flex CharStyle:Code
558 \begin_layout Plain Layout
564 contains LyX documentation files (including the one you are currently reading).
566 \begin_inset Flex CharStyle:Code
569 \begin_layout Plain Layout
575 deserves special attention, as noted above.
576 The internationalized help docs are in subdirectories
577 \begin_inset Flex CharStyle:Code
580 \begin_layout Plain Layout
587 \begin_inset Quotes eld
591 \begin_inset Quotes erd
594 is the ISO language code.
600 \begin_inset CommandInset ref
602 reference "chap:i18n"
609 \begin_layout Labeling
610 \labelwidthstring 00.00.0000
611 \begin_inset Flex CharStyle:Code
614 \begin_layout Plain Layout
620 contains example files that explain how to use some features.
621 In the file browser, press the
622 \begin_inset Flex CharStyle:MenuItem
625 \begin_layout Plain Layout
634 \begin_layout Labeling
635 \labelwidthstring 00.00.0000
636 \begin_inset Flex CharStyle:Code
639 \begin_layout Plain Layout
645 contains image files that are used by the
646 \begin_inset Flex CharStyle:MenuItem
649 \begin_layout Plain Layout
656 In addition, it also contains the individual icons used in the toolbar
657 and the banners that can be shown when LyX is launched.
660 \begin_layout Labeling
661 \labelwidthstring 00.00.0000
662 \begin_inset Flex CharStyle:Code
665 \begin_layout Plain Layout
671 contains keyboard keymapping files.
677 \begin_inset CommandInset ref
679 reference "sec:keymap"
686 \begin_layout Labeling
687 \labelwidthstring 00.00.0000
688 \begin_inset Flex CharStyle:Code
691 \begin_layout Plain Layout
697 contains the text class and module files described in Chapter
702 \begin_inset CommandInset ref
704 reference "chap:textclass"
711 \begin_layout Labeling
712 \labelwidthstring 00.00.0000
713 \begin_inset Flex CharStyle:Code
716 \begin_layout Plain Layout
723 \begin_inset Flex CharStyle:Code
726 \begin_layout Plain Layout
732 Python scripts used to convert between LyX versions.
733 These can be run from the command line if, say, you want to batch-convert
737 \begin_layout Labeling
738 \labelwidthstring 00.00.0000
739 \begin_inset Flex CharStyle:Code
742 \begin_layout Plain Layout
748 contains some files that demonstrate the capabilities of the
749 \begin_inset Flex CharStyle:MenuItem
752 \begin_layout Plain Layout
763 Also contains some scripts used by LyX itself.
766 \begin_layout Labeling
767 \labelwidthstring 00.00.0000
768 \begin_inset Flex CharStyle:Code
771 \begin_layout Plain Layout
777 contains the standard LyX template files described in Chapter
782 \begin_inset CommandInset ref
784 reference "sec:templates"
791 \begin_layout Labeling
792 \labelwidthstring 00.00.0000
793 \begin_inset Flex CharStyle:Code
796 \begin_layout Plain Layout
802 contains files with the extension
803 \begin_inset Flex CharStyle:Code
806 \begin_layout Plain Layout
812 that define the user interface to LyX.
813 That is, the files define which items appear in which menus and the items
814 appearing on the toolbar.
817 \begin_layout Subsection
818 Files you don't want to modify
821 \begin_layout Standard
822 These files are used internally by LyX and you generally do not need to
823 modify them unless you are a developer.
826 \begin_layout Labeling
827 \labelwidthstring 00.00.0000
828 \begin_inset Flex CharStyle:Code
831 \begin_layout Plain Layout
837 this file contains the list of LyX developers.
838 The contents are displayed with the menu entry
839 \begin_inset Flex CharStyle:MenuItem
842 \begin_layout Plain Layout
843 Help\SpecialChar \menuseparator
856 \begin_layout Labeling
857 \labelwidthstring 00.00.0000
858 \begin_inset Flex CharStyle:Code
861 \begin_layout Plain Layout
867 this is a LaTeX script used during the configuration process.
871 \begin_layout Labeling
872 \labelwidthstring 00.00.0000
873 \begin_inset Flex CharStyle:Code
876 \begin_layout Plain Layout
882 this is the script that is used to re-configure LyX.
883 It creates configuration files in the directory it was run from.
886 \begin_layout Subsection
887 Other files needing a line or two...
890 \begin_layout Labeling
891 \labelwidthstring 00.00.0000
892 \begin_inset Flex CharStyle:Code
895 \begin_layout Plain Layout
901 this contains tables describing how different character encodings can be
905 \begin_layout Labeling
906 \labelwidthstring 00.00.0000
907 \begin_inset Flex CharStyle:Code
910 \begin_layout Plain Layout
916 this file contains the templates available to the new
917 \begin_inset Flex CharStyle:MenuItem
920 \begin_layout Plain Layout
933 \begin_layout Labeling
934 \labelwidthstring 00.00.0000
935 \begin_inset Flex CharStyle:Code
938 \begin_layout Plain Layout
944 this file contains a list of all the languages currently supported by LyX.
947 \begin_layout Section
948 Your local configuration directory
951 \begin_layout Standard
952 Even if you are using LyX as an unprivileged user, you might want to change
953 LyX configuration for your own use.
955 \begin_inset Flex CharStyle:Code
958 \begin_layout Plain Layout
964 directory contains all your personal configuration files.
965 This is the directory described as
966 \begin_inset Quotes eld
970 \begin_inset Quotes erd
974 \begin_inset Flex CharStyle:MenuItem
977 \begin_layout Plain Layout
978 Help\SpecialChar \menuseparator
989 This directory is used as a mirror of
990 \begin_inset Flex CharStyle:Code
993 \begin_layout Plain Layout
999 , which means that every file in
1000 \begin_inset Flex CharStyle:Code
1003 \begin_layout Plain Layout
1009 is a replacement for the corresponding file in
1010 \begin_inset Flex CharStyle:Code
1013 \begin_layout Plain Layout
1020 Any configuration file described in the above sections can be placed either
1021 in the system-wide directory, in which case it will affect all users, or
1022 in your local directory for your own use.
1025 \begin_layout Standard
1026 To make things clearer, let's provide a few examples:
1029 \begin_layout Itemize
1030 The preferences set in the
1031 \begin_inset Flex CharStyle:MenuItem
1034 \begin_layout Plain Layout
1035 Tools\SpecialChar \menuseparator
1041 dialog are saved to a file
1042 \begin_inset Flex CharStyle:Code
1045 \begin_layout Plain Layout
1052 \begin_inset Flex CharStyle:Code
1055 \begin_layout Plain Layout
1064 \begin_layout Itemize
1065 When you reconfigure using
1066 \begin_inset Flex CharStyle:MenuItem
1069 \begin_layout Plain Layout
1070 Tools\SpecialChar \menuseparator
1077 \begin_inset Flex CharStyle:Code
1080 \begin_layout Plain Layout
1086 script, and the resulting files are written in your local configuration
1088 This means that any additional text class file that you might have added
1090 \begin_inset Flex CharStyle:Code
1093 \begin_layout Plain Layout
1099 will be added to the list of classes in the
1100 \begin_inset Flex CharStyle:MenuItem
1103 \begin_layout Plain Layout
1104 Document\SpecialChar \menuseparator
1113 \begin_layout Itemize
1114 If you get some updated documentation from LyX ftp site and cannot install
1115 it because you do not have sysadmin rights on your system, you can just
1117 \begin_inset Flex CharStyle:Code
1120 \begin_layout Plain Layout
1126 and the items in the
1127 \begin_inset Flex CharStyle:MenuItem
1130 \begin_layout Plain Layout
1136 menu will open them!
1139 \begin_layout Section
1140 Running LyX with multiple configurations
1143 \begin_layout Standard
1144 The configuration freedom of the local configuration directory may not suffice
1145 if you want to have more than one configuration at your disposal.
1146 For example, you may want to be use different key bindings or printer settings
1148 You can achieve this by having several such directories.
1149 You then specify which directory to use at run-time.
1152 \begin_layout Standard
1153 Invoking LyX with the command line switch
1154 \begin_inset Flex CharStyle:Code
1157 \begin_layout Plain Layout
1167 instructs the program to read the configuration from that directory, and
1168 not from the default directory.
1169 (You can determine the default directory by running LyX without the
1170 \begin_inset Flex CharStyle:Code
1173 \begin_layout Plain Layout
1179 switch.) If the specified directory does not exist, LyX offers to create
1180 it for you, just like it does for the default directory on the first time
1181 you run the program.
1182 You can modify the configuration options in this additional user directory
1183 exactly as you would for the default directory.
1184 These directories are completely independent (but read on).
1185 Note that setting the environment variable
1186 \begin_inset Flex CharStyle:Code
1189 \begin_layout Plain Layout
1195 to some value has exactly the same effect.
1198 \begin_layout Standard
1199 Having several configurations also requires more maintenance: if you want
1200 to add a new layout to
1201 \begin_inset Flex CharStyle:Code
1204 \begin_layout Plain Layout
1210 which you want available from all your configurations, you must add it
1211 to each directory separately.
1212 You can avoid this with the following trick: after LyX creates the additional
1213 directory, most of the subdirectories (see above) are empty.
1214 If you want the new configuration to mirror an existing one, replace the
1215 empty subdirectory with a symbolic link to the matching subdirectory in
1216 the existing configuration.
1218 \begin_inset Flex CharStyle:Code
1221 \begin_layout Plain Layout
1227 subdirectory, however, since it contains a file written by the configuration
1228 script (also accessible through
1229 \begin_inset Flex CharStyle:MenuItem
1232 \begin_layout Plain Layout
1233 Tools\SpecialChar \menuseparator
1239 ) which is configuration-specific.
1242 \begin_layout Chapter
1243 The Preferences dialog
1246 \begin_layout Standard
1247 All options of the preferences dialog are described in the Appendix
1249 The Preferences Dialog
1256 For some options you might find here more details.
1259 \begin_layout Section
1260 Using the dialog for the first time
1263 \begin_layout Standard
1265 \begin_inset Flex CharStyle:Code
1268 \begin_layout Plain Layout
1274 file will contain only changes that you have made to the default behavior,
1275 some of which is hard-coded into LyX and some of which is contained in
1277 \begin_inset Flex CharStyle:Code
1280 \begin_layout Plain Layout
1281 LyXDir/lyxrc.defaults
1287 Note that in both files lines beginning with a
1288 \begin_inset Quotes eld
1292 \begin_inset Quotes erd
1295 are just comments and are not interpreted.
1296 However, only system administrators should edit
1297 \begin_inset Flex CharStyle:Code
1300 \begin_layout Plain Layout
1301 LyXDir/lyxrc.defaults
1307 Users should use the
1308 \begin_inset Flex CharStyle:MenuItem
1311 \begin_layout Plain Layout
1312 Tools\SpecialChar \menuseparator
1318 dialog to create and modify their own
1319 \begin_inset Flex CharStyle:Code
1322 \begin_layout Plain Layout
1331 \begin_layout Standard
1333 \begin_inset Flex CharStyle:MenuItem
1336 \begin_layout Plain Layout
1337 Tools\SpecialChar \menuseparator
1343 dialog will be largely self-explanatory.
1344 Most things in the dialog have associated `tool tips': hover your mouse
1345 pointer over something for more information.
1346 Before we highlight a few of the more important commands below, however,
1347 a word of warning: Applying some of your changes (e.
1348 \begin_inset space \thinspace{}
1352 \begin_inset space \space{}
1355 screen fonts) will have an instant effect.
1357 \begin_inset space \thinspace{}
1361 \begin_inset space \space{}
1364 changing the bind file) will not.
1365 If nothing appears to have changed, just
1366 \begin_inset Flex CharStyle:MenuItem
1369 \begin_layout Plain Layout
1375 the changes and restart LyX.
1378 \begin_layout Section
1382 \begin_layout Standard
1383 LyX has a powerful mechanism to convert to and from any file format using
1388 \begin_layout Subsection
1389 \begin_inset CommandInset label
1398 \begin_layout Standard
1399 The first step is to define your file formats if they are not already defined.
1401 \begin_inset Flex CharStyle:MenuItem
1404 \begin_layout Plain Layout
1405 Tools\SpecialChar \menuseparator
1413 \begin_inset Flex CharStyle:MenuItem
1416 \begin_layout Plain Layout
1417 File Handling\SpecialChar \menuseparator
1424 \begin_inset Flex CharStyle:MenuItem
1427 \begin_layout Plain Layout
1428 New\SpecialChar \ldots{}
1434 button to define your new format.
1436 \begin_inset Flex CharStyle:MenuItem
1439 \begin_layout Plain Layout
1445 field contains the named used to identify the format in the GUI.
1447 \begin_inset Flex CharStyle:MenuItem
1450 \begin_layout Plain Layout
1456 is used to identify the format internally.
1457 You will also need to enter a file extension.
1458 These are all required.
1460 \begin_inset Flex CharStyle:MenuItem
1463 \begin_layout Plain Layout
1469 field is used to provide a keyboard shortcut on the menus.
1470 (For example, pressing
1471 \begin_inset Flex CharStyle:MenuItem
1474 \begin_layout Plain Layout
1481 \begin_inset Flex CharStyle:MenuItem
1484 \begin_layout Plain Layout
1485 View\SpecialChar \menuseparator
1494 \begin_layout Standard
1496 \begin_inset Flex CharStyle:MenuItem
1499 \begin_layout Plain Layout
1506 \begin_inset Flex CharStyle:MenuItem
1509 \begin_layout Plain Layout
1516 For example, you might want to use
1517 \begin_inset Flex CharStyle:MenuItem
1520 \begin_layout Plain Layout
1526 to view PostScript files.
1527 You can enter the command needed to start the program in the corresponding
1529 In defining this command, you can use the four variables listed in the
1531 The viewer is launched when you view an image in LyX or use the
1532 \begin_inset Flex CharStyle:MenuItem
1535 \begin_layout Plain Layout
1542 The editor is for example launched when you press the
1543 \begin_inset Flex CharStyle:MenuItem
1546 \begin_layout Plain Layout
1553 \begin_inset Flex CharStyle:MenuItem
1556 \begin_layout Plain Layout
1563 \begin_inset Flex CharStyle:MenuItem
1566 \begin_layout Plain Layout
1575 \begin_layout Standard
1577 \begin_inset Flex CharStyle:MenuItem
1580 \begin_layout Plain Layout
1586 option tells LyX that a format is suitable for document export.
1587 If this is is set and if a suitable conversion route exists (see
1588 \begin_inset CommandInset ref
1590 reference "sub:Converters"
1594 ), the format will appear in the
1595 \begin_inset Flex CharStyle:MenuItem
1598 \begin_layout Plain Layout
1599 File\SpecialChar \menuseparator
1606 The format will also appear in the
1607 \begin_inset Flex CharStyle:MenuItem
1610 \begin_layout Plain Layout
1616 menu if a viewer is specified for the format.
1617 Pure image formats, such as
1618 \begin_inset Flex CharStyle:Code
1621 \begin_layout Plain Layout
1627 , should not use this option.
1628 Formats that can both represent vector graphics and documents like
1629 \begin_inset Flex CharStyle:Code
1632 \begin_layout Plain Layout
1641 \begin_layout Standard
1643 \begin_inset Flex CharStyle:MenuItem
1646 \begin_layout Plain Layout
1647 Vector graphics format
1652 tells LyX that a format can contain vector graphics.
1653 This information is used to determine the target format of included graphics
1655 \begin_inset Flex CharStyle:MenuItem
1658 \begin_layout Plain Layout
1665 Included graphics may need to be converted to either
1666 \begin_inset Flex CharStyle:MenuItem
1669 \begin_layout Plain Layout
1676 \begin_inset Flex CharStyle:MenuItem
1679 \begin_layout Plain Layout
1686 \begin_inset Flex CharStyle:MenuItem
1689 \begin_layout Plain Layout
1696 \begin_inset Flex CharStyle:MenuItem
1699 \begin_layout Plain Layout
1705 cannot handle other image formats.
1706 If an included graphic is not already in
1707 \begin_inset Flex CharStyle:MenuItem
1710 \begin_layout Plain Layout
1717 \begin_inset Flex CharStyle:MenuItem
1720 \begin_layout Plain Layout
1727 \begin_inset Flex CharStyle:MenuItem
1730 \begin_layout Plain Layout
1736 format, it is converted to
1737 \begin_inset Flex CharStyle:MenuItem
1740 \begin_layout Plain Layout
1746 if the vector format option is set, and otherwise to
1747 \begin_inset Flex CharStyle:MenuItem
1750 \begin_layout Plain Layout
1759 \begin_layout Subsection
1763 \begin_layout Standard
1764 Since all conversions from one format to another take place in LyX's temporary
1765 directory, it is sometimes necessary to modify a file before copying it
1766 to the temporary directory in order that the conversion may be performed.
1770 \begin_layout Plain Layout
1771 For example, the file may refer to other files—images, for example—using
1772 relative file names, and these may become invalid when the file is copied
1773 to the temporary directory.
1778 This is done by a Copier: It copies a file to (or from) the temporary directory
1779 and may modify it in the process.
1782 \begin_layout Standard
1783 The definitions of the copiers may use four variables:
1786 \begin_layout Labeling
1787 \labelwidthstring 00.00.0000
1788 \begin_inset Flex CharStyle:Code
1791 \begin_layout Plain Layout
1797 The LyX system directory (e.
1798 \begin_inset space \thinspace{}
1802 \begin_inset space \space{}
1806 \begin_inset Flex CharStyle:MenuItem
1809 \begin_layout Plain Layout
1818 \begin_layout Labeling
1819 \labelwidthstring 00.00.0000
1820 \begin_inset Flex CharStyle:Code
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 Standard
1861 The latter should be the filename as it would be used in a LaTeX's
1868 It is relevant only when exporting files suitable for such inclusion.
1871 \begin_layout Standard
1872 Copiers can be used to do almost anything with output files.
1873 For example, suppose you want generated pdf files to be copied to a special
1875 \begin_inset Flex CharStyle:Code
1878 \begin_layout Plain Layout
1885 Then you could write a shell script such as this one:
1888 \begin_layout Standard
1889 \begin_inset listings
1893 \begin_layout Plain Layout
1898 \begin_layout Plain Layout
1903 \begin_layout Plain Layout
1905 TOFILE=`basename $2`
1908 \begin_layout Plain Layout
1910 cp $FROMFILE /home/you/pdf/$TOFILE
1915 Save that in your local LyX directory—say,
1916 \begin_inset Flex CharStyle:Code
1919 \begin_layout Plain Layout
1920 /home/you/.lyx/scripts/pdfcopier.sh
1925 —and make it executable, if you need to do so on your platform.
1927 \begin_inset Flex CharStyle:MenuItem
1930 \begin_layout Plain Layout
1931 Tools\SpecialChar \menuseparator
1937 dialog, select under
1938 \begin_inset Flex CharStyle:MenuItem
1941 \begin_layout Plain Layout
1942 File Handling\SpecialChar \menuseparator
1949 \begin_inset Flex CharStyle:MenuItem
1952 \begin_layout Plain Layout
1958 format—or one of the other pdf formats—and enter
1959 \begin_inset Flex CharStyle:Code
1962 \begin_layout Plain Layout
1963 pdfcopier.sh $$i $$o
1969 \begin_inset Flex CharStyle:MenuItem
1972 \begin_layout Plain Layout
1982 \begin_layout Standard
1983 Copiers are used by LyX in various of its own conversions.
1984 For example, if appropriate programs are found, LyX will automatically
1985 install copiers for the
1986 \begin_inset Flex CharStyle:MenuItem
1989 \begin_layout Plain Layout
1996 \begin_inset Flex CharStyle:MenuItem
1999 \begin_layout Plain Layout
2001 \begin_inset space ~
2010 When these formats are exported, the copier sees that not just the main
2011 HTML file but various associated files (style files, images, etc.) are also
2013 All these files are written to a subdirectory of the directory in which
2014 the original LyX file was found.
2018 \begin_layout Plain Layout
2019 This copier can be customized.
2021 \begin_inset Quotes eld
2025 \begin_inset Quotes erd
2028 argument takes a comma-separated list of extensions to be copied; if it
2029 is omitted, all files will be copied.
2031 \begin_inset Quotes eld
2035 \begin_inset Quotes erd
2038 argument determines the extension added to the generated directory.
2040 \begin_inset Quotes eld
2044 \begin_inset Flex CharStyle:MenuItem
2047 \begin_layout Plain Layout
2054 \begin_inset Quotes erd
2057 , so HTML generated from
2058 \begin_inset Flex CharStyle:MenuItem
2061 \begin_layout Plain Layout
2062 /path/to/filename.lyx
2068 \begin_inset Flex CharStyle:MenuItem
2071 \begin_layout Plain Layout
2072 /path/to/filename.html.LyXconv
2086 \begin_layout Subsection
2087 \begin_inset CommandInset label
2089 name "sub:Converters"
2096 \begin_layout Standard
2097 You can define your own Converters to convert files between different formats.
2099 \begin_inset Flex CharStyle:MenuItem
2102 \begin_layout Plain Layout
2103 Tools\SpecialChar \menuseparator
2104 Preferences\SpecialChar \menuseparator
2105 File Handling\SpecialChar \menuseparator
2114 \begin_layout Standard
2115 To define a new converter, select the
2116 \begin_inset Flex CharStyle:MenuItem
2119 \begin_layout Plain Layout
2121 \begin_inset space ~
2130 \begin_inset Flex CharStyle:MenuItem
2133 \begin_layout Plain Layout
2135 \begin_inset space ~
2143 from the drop-down lists, enter the command needed for the conversion,
2145 \begin_inset Flex CharStyle:MenuItem
2148 \begin_layout Plain Layout
2155 Several variables can be used in the definition of converters:
2158 \begin_layout Labeling
2159 \labelwidthstring 00.00.0000
2160 \begin_inset Flex CharStyle:Code
2163 \begin_layout Plain Layout
2169 The LyX system directory
2172 \begin_layout Labeling
2173 \labelwidthstring 00.00.0000
2174 \begin_inset Flex CharStyle:Code
2177 \begin_layout Plain Layout
2186 \begin_layout Labeling
2187 \labelwidthstring 00.00.0000
2188 \begin_inset Flex CharStyle:Code
2191 \begin_layout Plain Layout
2200 \begin_layout Labeling
2201 \labelwidthstring 00.00.0000
2202 \begin_inset Flex CharStyle:Code
2205 \begin_layout Plain Layout
2211 The base filename of the input file (i.
2212 \begin_inset space \thinspace{}
2215 g., 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 Labeling
2233 \labelwidthstring 00.00.0000
2234 \begin_inset Flex CharStyle:Code
2237 \begin_layout Plain Layout
2243 The path to the original input file (this is different from $$p when chain
2244 of converters is called).
2247 \begin_layout Standard
2249 \begin_inset Flex CharStyle:MenuItem
2252 \begin_layout Plain Layout
2254 \begin_inset space ~
2262 field you can enter the following flags, separated by commas:
2265 \begin_layout Labeling
2266 \labelwidthstring 00.00.0000
2267 \begin_inset Flex CharStyle:Code
2270 \begin_layout Plain Layout
2276 This converter runs some form of LaTeX.
2277 This will make LyX's LaTeX error logs available.
2280 \begin_layout Labeling
2281 \labelwidthstring 00.00.0000
2282 \begin_inset Flex CharStyle:Code
2285 \begin_layout Plain Layout
2292 \begin_inset Flex CharStyle:MenuItem
2295 \begin_layout Plain Layout
2301 file for the conversion.
2304 \begin_layout Labeling
2305 \labelwidthstring 00.00.0000
2306 \begin_inset Flex CharStyle:Code
2309 \begin_layout Plain Layout
2318 \begin_layout Standard
2319 The following three flags are not really flags at all because they take
2321 \begin_inset Flex CharStyle:MenuItem
2324 \begin_layout Plain Layout
2326 \begin_inset space ~
2330 \begin_inset space ~
2341 \begin_layout Labeling
2342 \labelwidthstring 00.00.0000
2343 \begin_inset Flex CharStyle:Code
2346 \begin_layout Plain Layout
2352 If set, the converter's standard error will be redirected to a file
2353 \begin_inset Flex CharStyle:Code
2356 \begin_layout Plain Layout
2362 , and the script given as argument will be run as:
2363 \begin_inset Flex CharStyle:Code
2366 \begin_layout Plain Layout
2367 script <infile.out >infile.log
2373 The argument may contain
2374 \begin_inset Flex CharStyle:Code
2377 \begin_layout Plain Layout
2386 \begin_layout Labeling
2387 \labelwidthstring 00.00.0000
2388 \begin_inset Flex CharStyle:Code
2391 \begin_layout Plain Layout
2397 The name of the directory in which the converter will dump the generated
2399 LyX will not create this directory, and it does not copy anything into
2400 it, though it will copy this directory to the destination.
2401 The argument may contain
2402 \begin_inset Flex CharStyle:Code
2405 \begin_layout Plain Layout
2411 , which will be replaced by the base name of the input and output files,
2412 respectively, when the directory is copied.
2413 \begin_inset Newline newline
2416 Note that resultdir and usetempdir make no sense together.
2417 The latter will be ignored if the former is given.
2420 \begin_layout Labeling
2421 \labelwidthstring 00.00.0000
2422 \begin_inset Flex CharStyle:Code
2425 \begin_layout Plain Layout
2431 Determines the output file name and may, contain
2432 \begin_inset Flex CharStyle:Code
2435 \begin_layout Plain Layout
2442 Sensible only with resultdir and optional even then; if not given, it defaults
2446 \begin_layout Standard
2447 None of these last three are presently used in any of the converters that
2448 are installed with LyX.
2452 \begin_layout Standard
2453 You do not have to define converters between all the formats between which
2454 you want to convert.
2455 For example, you will note that there is no `LyX to PostScript' converter,
2456 but LyX will export PostScript.
2457 It does so by first creating a LaTeX file (no converter needs to be defined
2458 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2459 and finally converting the resulting DVI file to PostScript.
2460 LyX finds such `chains' of converters automatically, and it will always
2461 choose the shortest possible chain.
2462 You can, though, still define multiple conversion methods between file
2464 For example, the standard LyX configuration provides three ways to convert
2465 LaTeX to PDF: Directly, using
2466 \begin_inset Flex CharStyle:MenuItem
2469 \begin_layout Plain Layout
2475 ; via (DVI and) PostScript, using
2476 \begin_inset Flex CharStyle:MenuItem
2479 \begin_layout Plain Layout
2486 \begin_inset Flex CharStyle:MenuItem
2489 \begin_layout Plain Layout
2496 To define such alternate chains, you must define multiple target `file
2497 formats', as described in section
2498 \begin_inset CommandInset ref
2500 reference "sub:Formats"
2505 For example, in the standard configuration, the formats named
2506 \begin_inset Flex CharStyle:MenuItem
2509 \begin_layout Plain Layout
2516 \begin_inset Flex CharStyle:MenuItem
2519 \begin_layout Plain Layout
2526 \begin_inset Flex CharStyle:MenuItem
2529 \begin_layout Plain Layout
2535 are defined, all of which share the extension
2536 \begin_inset Flex CharStyle:MenuItem
2539 \begin_layout Plain Layout
2545 , and which correspond to the conversion methods just mentioned.
2548 \begin_layout Chapter
2549 Internationalizing LyX
2550 \begin_inset CommandInset label
2559 \begin_layout Standard
2560 LyX supports using a translated interface.
2561 Last time we checked, LyX provided text in thirty languages.
2562 The language of choice is called your
2567 (For further reading on locale settings, see also the documentation for
2568 locale that comes with your operating system.
2569 For Linux, the manual page for
2570 \begin_inset Flex CharStyle:Code
2573 \begin_layout Plain Layout
2579 could be a good place to start).
2582 \begin_layout Standard
2583 Notice that these translations will work, but do contain a few flaws.
2584 In particular, all dialogs have been designed with the English text in
2585 mind, which means that some of the translated text will be too large to
2586 fit within the space allocated.
2587 This is only a display problem and will not cause any harm.
2588 Also, you will find that some of the translations do not define shortcut
2589 keys for everything.
2590 Sometimes, there are simply not enough free letters to do it.
2591 Other times, the translator just hasn't got around to doing it yet.
2592 Our localization team, which you may wish to join,
2596 \begin_layout Plain Layout
2597 If you are a fluent speaker of a language other than English, joining these
2598 teams is a great way to give back to the LyX community!
2603 will of course try to fix these shortcomings in future versions of LyX.
2606 \begin_layout Section
2610 \begin_layout Subsection
2611 Translating the graphical user interface (text messages).
2614 \begin_layout Standard
2616 \begin_inset Flex CharStyle:Code
2619 \begin_layout Plain Layout
2625 library to handle the internationalization of the interface.
2626 To have LyX speak your favorite language in all menus and dialogs, you
2628 \begin_inset Flex CharStyle:Code
2631 \begin_layout Plain Layout
2637 -file for that language.
2638 When this is available, you'll have to generate a
2639 \begin_inset Flex CharStyle:Code
2642 \begin_layout Plain Layout
2648 -file from it and install the
2649 \begin_inset Flex CharStyle:Code
2652 \begin_layout Plain Layout
2659 The process of doing all of this is explained in the documentation for
2661 \begin_inset Flex CharStyle:Code
2664 \begin_layout Plain Layout
2671 It is possible to do this just for yourself, but if you're going to do
2672 it, you might as well share the results of your labors with the rest of
2674 Send a message to the LyX developers' list for more information about how
2678 \begin_layout Standard
2679 In short, this is what you should do (xx denotes the language code):
2682 \begin_layout Itemize
2683 Check out the LyX source code.
2685 \begin_inset CommandInset href
2687 name "information on the web"
2688 target "http://www.lyx.org/devel/cvs.php"
2695 \begin_layout Itemize
2697 \begin_inset Flex CharStyle:Code
2700 \begin_layout Plain Layout
2706 to the folder of the
2707 \begin_inset Flex CharStyle:Code
2710 \begin_layout Plain Layout
2718 \begin_inset Flex CharStyle:Code
2721 \begin_layout Plain Layout
2729 \begin_inset Flex CharStyle:Code
2732 \begin_layout Plain Layout
2738 doesn't exist anywhere, it can be remade with the console command
2739 \begin_inset Flex CharStyle:Code
2742 \begin_layout Plain Layout
2748 in that directory, or you can use an existing po-file for some other language
2752 \begin_layout Itemize
2754 \begin_inset Flex CharStyle:Code
2757 \begin_layout Plain Layout
2767 \begin_layout Plain Layout
2768 This is just a text file, so it can be edited in any text editor.
2769 But there are also specialized programs that support such editing, such
2774 (for all platforms) or
2783 contains a `mode' for editing
2784 \begin_inset Flex CharStyle:Code
2787 \begin_layout Plain Layout
2798 For some menu- and widget-labels, there are also shortcut keys that should
2800 Those keys are marked after a `|', and should be translated according to
2801 the words and phrases of the language.
2802 You should also fill also out the information at the beginning of the new
2804 \begin_inset Flex CharStyle:Code
2807 \begin_layout Plain Layout
2813 -file with your email-address, etc., so people know where to reach you with
2814 suggestions and entertaining flames.
2817 \begin_layout Standard
2818 If you are just doing this on your own, then:
2821 \begin_layout Itemize
2823 \begin_inset Flex CharStyle:Code
2826 \begin_layout Plain Layout
2833 This can be done with
2834 \begin_inset Flex CharStyle:Code
2837 \begin_layout Plain Layout
2838 msgfmt -o xx.mo < xx.po
2846 \begin_layout Itemize
2848 \begin_inset Flex CharStyle:Code
2851 \begin_layout Plain Layout
2857 -file to your locale-tree, at the correct directory for application messages
2862 xx, and under the name
2863 \begin_inset Flex CharStyle:Code
2866 \begin_layout Plain Layout
2873 \begin_inset space \thinspace{}
2877 \begin_inset space \space{}
2881 \begin_inset Flex CharStyle:Code
2884 \begin_layout Plain Layout
2885 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2895 \begin_layout Standard
2896 As said, however, it would be best if the new
2897 \begin_inset Flex CharStyle:Code
2900 \begin_layout Plain Layout
2906 -file could be added to the LyX distribution, so others can use it.
2907 Adding it involves making additional changes to LyX.
2908 So send an email to the developers' mailing list if you're interested in
2912 \begin_layout Subsubsection
2916 \begin_layout Standard
2917 Sometimes it turns out that one English message needs to be translated into
2918 different messages in the target language.
2919 One example is the message
2920 \begin_inset Flex CharStyle:Code
2923 \begin_layout Plain Layout
2929 which has the German translation
2937 , depending upon exactly what the English
2938 \begin_inset Quotes eld
2942 \begin_inset Quotes erd
2947 \begin_inset Flex CharStyle:Code
2950 \begin_layout Plain Layout
2956 does not handle such ambiguous translations.
2957 Therefore you have to add some context information to the message: Instead
2959 \begin_inset Flex CharStyle:Code
2962 \begin_layout Plain Layout
2969 \begin_inset Flex CharStyle:Code
2972 \begin_layout Plain Layout
2973 To[[as in 'From format x to format y']]
2979 \begin_inset Flex CharStyle:Code
2982 \begin_layout Plain Layout
2983 To[[as in 'From page x to page y']].
2988 Now the two occurrences of
2989 \begin_inset Flex CharStyle:Code
2992 \begin_layout Plain Layout
2999 \begin_inset Flex CharStyle:Code
3002 \begin_layout Plain Layout
3008 and can be translated correctly to
3019 \begin_layout Standard
3020 Of course the context information needs to be stripped off the original
3021 message when no translation is used.
3022 Therefore you have to put it in double square brackets at the end of the
3023 message (see the example above).
3024 The translation mechanism of LyX ensures that everything in double square
3025 brackets at the end of messages is removed before displaying the message.
3028 \begin_layout Subsection
3029 Translating the documentation.
3032 \begin_layout Standard
3033 The online documentation (in the
3034 \begin_inset Flex CharStyle:MenuItem
3037 \begin_layout Plain Layout
3043 -menu) can (and should!) be translated.
3044 If there are translated versions of the documentation available
3048 \begin_layout Plain Layout
3049 As of March 2008, at least some of the documents have been translated into
3050 fourteen languages, with the Tutorial available in a few more.
3055 and the locale is set accordingly, these will be used automagically by
3057 LyX looks for translated versions as
3058 \begin_inset Flex CharStyle:Code
3061 \begin_layout Plain Layout
3062 LyXDir/doc/xx/DocName.lyx
3068 \begin_inset Flex CharStyle:Code
3071 \begin_layout Plain Layout
3077 is the code for the language currently in use.
3078 If there are no translated documents, the default English versions will
3080 Note that the translated versions must have the same filenames (
3081 \begin_inset Flex CharStyle:Code
3084 \begin_layout Plain Layout
3090 above) as the original.
3091 If you feel up to translating the documentation (an excellent way to proof-read
3092 the original documentation by the way!), there are a few things you should
3096 \begin_layout Itemize
3098 \begin_inset Flex CharStyle:Code
3101 \begin_layout Plain Layout
3107 , the guide to writing LyX documentation.
3108 Pay special attention to the translator's section.
3111 \begin_layout Itemize
3112 Check out the documentation translation web page at
3113 \begin_inset CommandInset href
3115 name "http://www.lyx.org/Translation"
3116 target "http://www.lyx.org/Translation"
3121 That way, you can find out which (if any) documents have already been translate
3122 d into your language.
3123 You can also find out who (if anyone) is organizing the effort to translate
3124 the documentation into your language.
3125 If no one is organizing the effort, please let us know that you're interested.
3128 \begin_layout Standard
3129 Once you get to actually translating, here's a few hints for you that may
3133 \begin_layout Itemize
3134 Join the documentation team! There is information on how to do that in
3135 \begin_inset Flex CharStyle:Code
3138 \begin_layout Plain Layout
3145 \begin_inset Flex CharStyle:MenuItem
3148 \begin_layout Plain Layout
3149 Help\SpecialChar \menuseparator
3159 ), which by the way is the first document you should translate.
3162 \begin_layout Itemize
3163 Learn the typographic conventions for the language you are translating to.
3164 Typography is an ancient art and over the centuries, a great variety of
3165 conventions have developed throughout different parts of the world.
3166 Also study the professional terminology amongst typographers in your country.
3167 Inventing your own terminology will only confuse the users.
3170 (Warning! Typography is addictive!)
3173 \begin_layout Itemize
3174 Make a copy of the document.
3175 This will be your working copy.
3176 You can use this as your personal translated help-file by placing it in
3178 \begin_inset Flex CharStyle:Code
3181 \begin_layout Plain Layout
3190 \begin_layout Itemize
3191 Sometimes the original document (from the LyX-team) will be updated.
3192 Use the source viewer at
3193 \begin_inset CommandInset href
3195 name "http://www.lyx.org/trac/timeline"
3196 target "http://www.lyx.org/trac/timeline"
3200 to see what has been changed.
3201 That way you can easily see which parts of the translated document need
3205 \begin_layout Standard
3206 If you ever find an error in the original document, fix it and notify the
3207 rest of the documentation team of the changes! (You didn't forget to join
3208 the documentation team, did you?)
3211 \begin_layout Standard
3212 \begin_inset Branch OutDated
3215 \begin_layout Section
3216 International Keyboard Support
3219 \begin_layout Standard
3222 [Editor's Note: The following section is by
3230 It needs to be fixed to conform to the new Documentation Style sheet and
3231 to make use of the new v1.0 features.
3232 The whole thing also needs to be merged with the section following it.-jw
3233 It may also be badly out of date.-rh (2008)]
3236 \begin_layout Subsection
3237 Defining Own Keymaps: Keymap File Format
3240 \begin_layout Standard
3241 Let's look at a keyboard definition file a little closer.
3242 It is a plain text file defining
3245 \begin_layout Itemize
3246 key-to-key or key-to-string translations
3249 \begin_layout Itemize
3253 \begin_layout Itemize
3254 dead keys exceptions
3257 \begin_layout Standard
3258 To define key-to-key or key-to-string translation, use this command:
3261 \begin_layout Quotation
3262 \begin_inset Flex CharStyle:Code
3265 \begin_layout Plain Layout
3274 \begin_inset Flex CharStyle:Code
3277 \begin_layout Plain Layout
3286 \begin_layout Standard
3288 \begin_inset Flex CharStyle:Code
3291 \begin_layout Plain Layout
3297 is the key to be translated and
3298 \begin_inset Flex CharStyle:Code
3301 \begin_layout Plain Layout
3307 is the string to be inserted into the document.
3308 To define dead keys, use:
3311 \begin_layout Quotation
3312 \begin_inset Flex CharStyle:Code
3315 \begin_layout Plain Layout
3324 \begin_inset Flex CharStyle:Code
3327 \begin_layout Plain Layout
3336 \begin_layout Standard
3338 \begin_inset Flex CharStyle:Code
3341 \begin_layout Plain Layout
3347 is a keyboard key and
3348 \begin_inset Flex CharStyle:Code
3351 \begin_layout Plain Layout
3358 The following dead keys are supported (shortcut name is in parentheses):
3361 \begin_layout Quotation
3365 \begin_inset space \hfill{}
3371 \begin_layout Quotation
3373 \begin_inset space \hfill{}
3379 \begin_layout Quotation
3381 \begin_inset space \hfill{}
3387 \begin_layout Quotation
3389 \begin_inset space \hfill{}
3395 \begin_layout Quotation
3397 \begin_inset space \hfill{}
3403 \begin_layout Quotation
3405 \begin_inset space \hfill{}
3412 \begin_layout Plain Layout
3424 \begin_layout Quotation
3426 \begin_inset space \hfill{}
3432 \begin_layout Quotation
3434 \begin_inset space \hfill{}
3441 \begin_layout Plain Layout
3453 \begin_layout Quotation
3455 \begin_inset space \hfill{}
3461 \begin_layout Quotation
3463 \begin_inset space \hfill{}
3469 \begin_layout Quotation
3471 \begin_inset space \hfill{}
3478 \begin_layout Plain Layout
3490 \begin_layout Quotation
3492 \begin_inset space \hfill{}
3499 \begin_layout Plain Layout
3511 \begin_layout Quotation
3513 \begin_inset space \hfill{}
3519 \begin_layout Quotation
3520 hungarian umlaut (hug)
3521 \begin_inset space \hfill{}
3527 \begin_layout Quotation
3529 \begin_inset space \hfill{}
3535 \begin_layout Quotation
3537 \begin_inset space \hfill{}
3544 \begin_layout Plain Layout
3556 \begin_layout Standard
3557 Since in many international keyboards there are exceptions to what some
3558 dead keys should do, you can define them using
3561 \begin_layout Quotation
3562 \begin_inset Flex CharStyle:Code
3565 \begin_layout Plain Layout
3573 deadkey key outstring
3576 \begin_layout Standard
3577 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3581 \begin_layout Quotation
3582 \begin_inset Flex CharStyle:Code
3585 \begin_layout Plain Layout
3598 \begin_layout Standard
3599 to make it work correctly.
3600 Also, you have to define as exceptions dead keys over i and j, to remove
3601 the dot from them before inserting an accent mark.
3602 I will change this when the time comes, but so far I haven't had time.
3605 \begin_layout Standard
3606 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3609 \begin_inset Flex CharStyle:Code
3612 \begin_layout Plain Layout
3618 have different meaning.
3620 \begin_inset Flex CharStyle:Code
3623 \begin_layout Plain Layout
3629 marks comments, quotes start and end LaTeX-style commands.
3630 To enter quote, you'll need to use
3631 \begin_inset Flex CharStyle:Code
3634 \begin_layout Plain Layout
3643 \begin_inset Flex CharStyle:Code
3646 \begin_layout Plain Layout
3653 \begin_inset Flex CharStyle:Code
3656 \begin_layout Plain Layout
3667 \begin_layout Standard
3668 If you make a keyboard description file that works for your language, please
3669 mail it to me, so I can include it in the next keymap distribution.
3672 \begin_layout Standard
3673 More keywords will be supported in keymap configuration file in future,
3677 \begin_layout Itemize
3678 \begin_inset Flex CharStyle:Code
3681 \begin_layout Plain Layout
3692 \begin_inset space \hfill{}
3696 \begin_inset Flex CharStyle:Code
3699 \begin_layout Plain Layout
3708 \begin_layout Itemize
3709 \begin_inset Flex CharStyle:Code
3712 \begin_layout Plain Layout
3723 \begin_inset space \hfill{}
3727 \begin_inset Flex CharStyle:Code
3730 \begin_layout Plain Layout
3736 an external keymap translation program
3739 \begin_layout Standard
3740 Also, it should look into
3741 \begin_inset Flex CharStyle:Code
3744 \begin_layout Plain Layout
3750 file for defaults, too (for example, a
3751 \begin_inset Flex CharStyle:Code
3754 \begin_layout Plain Layout
3762 option to include default keyboard).
3770 \begin_layout Section
3771 \begin_inset CommandInset label
3777 International Keymap Stuff
3780 \begin_layout Standard
3781 \begin_inset Note Note
3784 \begin_layout Plain Layout
3785 In doing the revisions on this document in March 2008, I did not look over
3786 this stuff, as I do not understand it.
3787 It would be good if someone else could do so.
3795 \begin_layout Standard
3796 The next two sections describe the
3797 \begin_inset Flex CharStyle:Code
3800 \begin_layout Plain Layout
3809 \begin_inset Flex CharStyle:Code
3812 \begin_layout Plain Layout
3820 file syntax in detail.
3821 These sections should help you design your own key map if the ones provided
3822 do not meet your needs.
3825 \begin_layout Subsection
3829 \begin_layout Standard
3833 \begin_inset Flex CharStyle:Code
3836 \begin_layout Plain Layout
3842 file maps keystrokes to characters or strings.
3843 As the name suggests, it sets a keyboard mapping.
3845 \begin_inset Flex CharStyle:Code
3848 \begin_layout Plain Layout
3859 \begin_inset Flex CharStyle:Code
3862 \begin_layout Plain Layout
3877 \begin_inset Flex CharStyle:Code
3880 \begin_layout Plain Layout
3893 \begin_inset Flex CharStyle:Code
3896 \begin_layout Plain Layout
3905 \begin_inset Flex CharStyle:Code
3908 \begin_layout Plain Layout
3916 are described in this section.
3919 \begin_layout Labeling
3920 \labelwidthstring 00.00.0000
3921 \begin_inset Flex CharStyle:Code
3924 \begin_layout Plain Layout
3932 Map a character to a string
3935 \begin_layout LyX-Code
3950 \begin_layout Standard
3983 the double-quote (")
4000 must be escaped with a preceding backslash (
4011 \begin_layout Standard
4013 \begin_inset Flex CharStyle:MenuItem
4016 \begin_layout Plain Layout
4024 statement to cause the symbol
4025 \begin_inset Flex CharStyle:MenuItem
4028 \begin_layout Plain Layout
4036 to be output for the keystroke
4037 \begin_inset Flex CharStyle:MenuItem
4040 \begin_layout Plain Layout
4051 \begin_layout LyX-Code
4057 \begin_layout Labeling
4058 \labelwidthstring 00.00.0000
4059 \begin_inset Flex CharStyle:Code
4062 \begin_layout Plain Layout
4070 Specify an accent character
4073 \begin_layout LyX-Code
4082 \begin_layout Standard
4083 This will make the cha
4121 This is the dead key
4125 \begin_layout Plain Layout
4132 refers to a key that does not produce a character by itself, but when followed
4133 with another key, produces the desired accent character.
4134 For example, a German characte
4136 r with an umlaut like
4146 can be produced in this manner.
4155 \begin_layout Standard
4168 and then another key not in
4185 followed by the other, not allowed key, as output.
4189 \begin_inset Flex CharStyle:MenuItem
4192 \begin_layout Plain Layout
4200 cancels a dead key, so if
4211 \begin_inset Flex CharStyle:MenuItem
4214 \begin_layout Plain Layout
4223 , the cursor will not go one position backwards but will instead cancel
4239 might have had on the next keystroke.
4243 \begin_layout Standard
4244 The following example specifies that the character ' is to be an acute accent,
4245 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4248 \begin_layout LyX-Code
4251 kmod ' acute aeiouAEIOU
4254 \begin_layout Labeling
4255 \labelwidthstring 00.00.0000
4256 \begin_inset Flex CharStyle:Code
4259 \begin_layout Plain Layout
4265 Specify an exception to the accent character
4268 \begin_layout LyX-Code
4277 \begin_layout Standard
4278 This defines an exce
4319 have been assigned a keystroke with a previous
4322 \begin_inset Flex CharStyle:Code
4325 \begin_layout Plain Layout
4349 must not belong in the
4396 If such a declaration does not exist in
4404 \begin_inset Flex CharStyle:Code
4407 \begin_layout Plain Layout
4441 \begin_inset Flex CharStyle:Code
4444 \begin_layout Plain Layout
4458 \begin_layout Standard
4459 The following command produces causes äi to be produced when you enter acute-i
4463 \begin_layout LyX-Code
4477 \begin_layout Labeling
4478 \labelwidthstring 00.00.0000
4479 \begin_inset Flex CharStyle:Code
4482 \begin_layout Plain Layout
4488 Combine two accent characters
4491 \begin_layout LyX-Code
4497 accent1 accent2 allowed
4500 \begin_layout Standard
4501 This one is getting pretty esoteric.
4502 It allows you to combine the effect
4558 \begin_inset Flex CharStyle:Code
4561 \begin_layout Plain Layout
4589 \begin_layout Standard
4590 Consider this example from the
4591 \begin_inset Flex CharStyle:Code
4594 \begin_layout Plain Layout
4605 \begin_layout LyX-Code
4608 kmod ; acute aeioyvhAEIOYVH
4612 kcomb acute umlaut iyIY
4615 \begin_layout Standard
4616 This allows you to press
4617 \begin_inset Flex CharStyle:MenuItem
4620 \begin_layout Plain Layout
4628 and get the effect of
4629 \begin_inset Flex CharStyle:Code
4632 \begin_layout Plain Layout
4651 in this case cancels the last dead key, so if you press
4652 \begin_inset Flex CharStyle:MenuItem
4655 \begin_layout Plain Layout
4664 \begin_inset Flex CharStyle:Code
4667 \begin_layout Plain Layout
4680 \begin_layout Subsection
4684 \begin_layout Standard
4686 \begin_inset Flex CharStyle:Code
4689 \begin_layout Plain Layout
4697 mapping is performed, a
4698 \begin_inset Flex CharStyle:Code
4701 \begin_layout Plain Layout
4711 file maps the strings that the symbols generate to characters in the current
4713 The LyX distribution currently includes at least the
4714 \begin_inset Flex CharStyle:Code
4717 \begin_layout Plain Layout
4726 \begin_inset Flex CharStyle:Code
4729 \begin_layout Plain Layout
4740 \begin_layout Standard
4742 \begin_inset Flex CharStyle:Code
4745 \begin_layout Plain Layout
4753 file is a sequence of declarations of the form
4756 \begin_layout LyX-Code
4769 \begin_layout Standard
4770 For example, in order to map
4771 \begin_inset Flex CharStyle:MenuItem
4774 \begin_layout Plain Layout
4784 to the corresponding character in the iso-8859-1 set (233), the following
4788 \begin_layout LyX-Code
4796 \begin_layout Standard
4798 \begin_inset Flex CharStyle:Code
4801 \begin_layout Plain Layout
4810 \begin_inset Flex CharStyle:Code
4813 \begin_layout Plain Layout
4831 the same character can apply to more than one string.
4833 \begin_inset Flex CharStyle:Code
4836 \begin_layout Plain Layout
4847 \begin_layout LyX-Code
4859 \begin_inset Newline newline
4875 \begin_layout Standard
4876 If LyX cannot find a mapping for the string produced by the keystroke or
4877 a deadkey sequence, it will check if it looks like an accented char and
4878 try to draw an accent over the character on screen.
4881 \begin_layout Subsection
4885 \begin_layout Standard
4886 There is a second way to add support for international characters through
4887 so-called dead-keys.
4888 A dead-key works in combination with a letter to produce an accented character.
4889 Here, we'll explain how to create a really simple dead-key to illustrate
4893 \begin_layout Standard
4894 Suppose you happen to need the circumflex character,
4895 \begin_inset Quotes eld
4899 \begin_inset Quotes erd
4904 \begin_inset Flex CharStyle:MenuItem
4907 \begin_layout Plain Layout
4914 \begin_inset space ~
4918 \begin_inset Flex CharStyle:MenuItem
4921 \begin_layout Plain Layout
4927 ] to the LyX command
4928 \begin_inset Flex CharStyle:Code
4931 \begin_layout Plain Layout
4938 \begin_inset Flex CharStyle:Code
4941 \begin_layout Plain Layout
4948 Now, whenever you type the
4949 \begin_inset Flex CharStyle:MenuItem
4952 \begin_layout Plain Layout
4958 -key followed by a letter, that letter will have a circumflex accent on
4960 For example, the sequence
4961 \begin_inset Quotes eld
4965 \begin_inset Flex CharStyle:MenuItem
4968 \begin_layout Plain Layout
4975 \begin_inset Quotes erd
4978 produces the letter:
4979 \begin_inset Quotes eld
4983 \begin_inset Quotes erd
4987 If you tried to type
4988 \begin_inset Quotes eld
4992 \begin_inset Flex CharStyle:MenuItem
4995 \begin_layout Plain Layout
5002 \begin_inset Quotes erd
5005 , however, LyX will complain with a beep, since a
5006 \begin_inset Quotes eld
5010 \begin_inset Flex CharStyle:MenuItem
5013 \begin_layout Plain Layout
5020 \begin_inset Quotes erd
5023 never takes a circumflex accent.
5025 \begin_inset Flex CharStyle:MenuItem
5028 \begin_layout Plain Layout
5034 after a dead-key produces the bare-accent.
5035 Please note this last point! If you bind a key to a dead-key, you'll need
5036 to rebind the character on that key to yet another key.
5038 \begin_inset Flex CharStyle:MenuItem
5041 \begin_layout Plain Layout
5047 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5050 \begin_layout Standard
5051 One common way to bind dead-keys is to use
5052 \begin_inset Flex CharStyle:MenuItem
5055 \begin_layout Plain Layout
5062 \begin_inset Flex CharStyle:MenuItem
5065 \begin_layout Plain Layout
5072 \begin_inset Flex CharStyle:MenuItem
5075 \begin_layout Plain Layout
5081 in combination with an accent, like
5082 \begin_inset Quotes eld
5086 \begin_inset Flex CharStyle:MenuItem
5089 \begin_layout Plain Layout
5096 \begin_inset Quotes erd
5100 \begin_inset Quotes eld
5104 \begin_inset Flex CharStyle:MenuItem
5107 \begin_layout Plain Layout
5114 \begin_inset Quotes erd
5118 \begin_inset Quotes eld
5122 \begin_inset Flex CharStyle:MenuItem
5125 \begin_layout Plain Layout
5132 \begin_inset Quotes erd
5136 Another way involves using
5137 \begin_inset Flex CharStyle:Code
5140 \begin_layout Plain Layout
5147 \begin_inset Flex CharStyle:Code
5150 \begin_layout Plain Layout
5156 to set up the special
5157 \begin_inset Flex CharStyle:Code
5160 \begin_layout Plain Layout
5168 \begin_inset Flex CharStyle:Code
5171 \begin_layout Plain Layout
5177 acts in some ways just like
5178 \begin_inset Flex CharStyle:MenuItem
5181 \begin_layout Plain Layout
5187 and permits you to bind keys to accented characters.
5188 You can also turn keys into dead-keys by binding them to something like
5190 \begin_inset Flex CharStyle:Code
5193 \begin_layout Plain Layout
5199 and then binding this symbolic key to the corresponding LyX command.
5203 \begin_layout Plain Layout
5208 : This is exactly what I do in my
5209 \begin_inset Flex CharStyle:Code
5212 \begin_layout Plain Layout
5219 \begin_inset Flex CharStyle:Code
5222 \begin_layout Plain Layout
5230 \begin_inset Flex CharStyle:MenuItem
5233 \begin_layout Plain Layout
5235 \begin_inset space ~
5244 \begin_inset Flex CharStyle:Code
5247 \begin_layout Plain Layout
5253 and a bunch of these
5254 \begin_inset Quotes eld
5258 \begin_inset Flex CharStyle:Code
5261 \begin_layout Plain Layout
5268 \begin_inset Quotes erd
5271 symbolic keys bound such things as
5272 \begin_inset Flex CharStyle:MenuItem
5275 \begin_layout Plain Layout
5277 \begin_inset space ~
5286 \begin_inset Flex CharStyle:MenuItem
5289 \begin_layout Plain Layout
5291 \begin_inset space ~
5300 This is how I produce my accented characters.
5305 You can make just about anything into the
5306 \begin_inset Flex CharStyle:Code
5309 \begin_layout Plain Layout
5316 \begin_inset Flex CharStyle:MenuItem
5319 \begin_layout Plain Layout
5325 keys, a spare function key, etc.
5326 As for the LyX commands that produce accents, check the entry for
5327 \begin_inset Flex CharStyle:Code
5330 \begin_layout Plain Layout
5341 You'll find the complete list there.
5344 \begin_layout Subsection
5345 Saving your Language Configuration
5348 \begin_layout Standard
5349 You can edit your preferences so that your desired language environment
5350 is automatically configured when LyX starts up, via the
5351 \begin_inset Flex CharStyle:MenuItem
5354 \begin_layout Plain Layout
5355 Edit\SpecialChar \menuseparator
5364 \begin_layout Chapter
5365 Installing New Document Classes, Layouts, and Templates
5366 \begin_inset CommandInset label
5368 name "chap:textclass"
5376 \begin_layout Plain Layout
5377 Installing New Document Classes
5385 \begin_layout Standard
5386 In this chapter, we describe the procedures for creating and installing
5387 new LyX layout and template files, as well as offer a refresher on correctly
5388 installing new LaTeX document classes.
5389 Some definitions: a document class is a LaTeX file (usually ending in
5390 \begin_inset Flex CharStyle:Code
5393 \begin_layout Plain Layout
5400 \begin_inset Flex CharStyle:Code
5403 \begin_layout Plain Layout
5409 ) that describes the format of a document such as an article, report, journal
5410 preprint, etc, and all the commands needed to realize that format.
5411 A layout file is a LyX file that corresponds to a LaTeX document class
5412 and that tells LyX how to
5413 \begin_inset Quotes eld
5417 \begin_inset Quotes erd
5420 things on the screen to make the display look something like the final
5422 More precisely, a layout file describes a
5423 \begin_inset Quotes eld
5427 \begin_inset Quotes erd
5430 which is the internal construct LyX uses to render the screen display.
5432 \begin_inset Quotes eld
5436 \begin_inset Quotes erd
5440 \begin_inset Quotes eld
5444 \begin_inset Quotes erd
5447 can be used somewhat interchangeably, but it is better to refer to the
5448 file as the layout, and the thing living in LyX's memory as the text class.
5449 A template file is simply a LyX document that contains a set of predefined
5450 entries for a given document class—entries that are generally required
5452 Templates are especially useful for things like journal manuscripts that
5453 are to be submitted electronically.
5456 \begin_layout Section
5457 Installing a new LaTeX package
5460 \begin_layout Standard
5461 Some installations may not include a LaTeX package that you would like to
5463 For example, you might need FoilTeX, a package for preparing slides or
5464 viewgraphs for overhead projectors.
5465 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5466 a user interface for that.
5467 For example on MiKTeX you start its program
5468 \begin_inset Quotes eld
5472 \begin_inset Quotes erd
5475 to get a list of available packages.
5476 To install one, right click on it or use the installing toolbar button.
5477 When the package you want to install is not in the list, but you have it
5479 \begin_inset Flex CharStyle:Code
5482 \begin_layout Plain Layout
5489 \begin_inset Flex CharStyle:Code
5492 \begin_layout Plain Layout
5498 -file, then copy these files to a subfolder of your LaTeX distribution,
5499 for example to the folder
5508 Then update the file name database of your LaTeX-distribution.
5509 For example on MiKTeX this is done by pressing the button
5512 \begin_inset space ~
5517 that you find in MiKTeX's
5518 \begin_inset Quotes eld
5522 \begin_inset Quotes erd
5526 In both cases you need afterwards to reconfigure LyX using the menu
5527 \begin_inset Flex CharStyle:MenuItem
5530 \begin_layout Plain Layout
5531 Tools\SpecialChar \menuseparator
5537 and then to restart LyX.
5540 \begin_layout Standard
5541 If your LaTeX distribution doesn't provide a user interface, then you can
5542 follow these steps by using a UNIX/Linux console.
5545 \begin_layout Enumerate
5546 Get the package from
5547 \begin_inset CommandInset href
5550 target "http://www.ctan.org/"
5557 \begin_layout Enumerate
5558 You can install this package in several different places.
5559 If you want it to be available for all users on your system, then you should
5560 install it in your `local' TeX tree; if you want (or need) it to be available
5561 just for you, then you can install it in your own `user' TeX tree.
5562 Where these should be created, if they do not already exist, depends upon
5563 the details of your system.
5564 To find out, look in the file
5565 \begin_inset Flex CharStyle:Code
5568 \begin_layout Plain Layout
5578 \begin_layout Plain Layout
5579 This usually lives in the directory
5580 \begin_inset Flex CharStyle:Code
5583 \begin_layout Plain Layout
5589 , though you can run
5590 \begin_inset Flex CharStyle:Code
5593 \begin_layout Plain Layout
5604 The location of the `local' TeX tree is defined by
5605 \begin_inset Flex CharStyle:Code
5608 \begin_layout Plain Layout
5614 ; this is usually somewhere like
5615 \begin_inset Flex CharStyle:Code
5618 \begin_layout Plain Layout
5619 /usr/local/share/texmf/
5625 The `user' TeX tree is defined by
5626 \begin_inset Flex CharStyle:Code
5629 \begin_layout Plain Layout
5636 \begin_inset Flex CharStyle:Code
5639 \begin_layout Plain Layout
5646 (If these variables are not predefined, you can define them.) You'll probably
5647 need root permissions to create or modify the `local' tree; but your `user'
5648 tree shouldn't have such limitations.
5651 \begin_layout Enumerate
5653 \begin_inset Flex CharStyle:Code
5656 \begin_layout Plain Layout
5663 \begin_inset Flex CharStyle:Code
5666 \begin_layout Plain Layout
5673 \begin_inset Flex CharStyle:Code
5676 \begin_layout Plain Layout
5683 \begin_inset space \thinspace{}
5687 \begin_inset Newline newline
5691 \begin_inset Flex CharStyle:Code
5694 \begin_layout Plain Layout
5695 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5701 \begin_inset Newline newline
5704 But, again, most of this will
5705 \begin_inset Quotes eld
5709 \begin_inset Quotes erd
5715 \begin_layout Enumerate
5720 \begin_layout Plain Layout
5721 We'll assume henceforth that you're defining `local' TeX tree.
5722 If you're defining a user tree, just adjust as necessary.
5728 You must follow the directory structure of your existing
5729 \begin_inset Flex CharStyle:Code
5732 \begin_layout Plain Layout
5738 directory, which will be found at
5739 \begin_inset Flex CharStyle:Code
5742 \begin_layout Plain Layout
5749 For example, latex packages should go under
5750 \begin_inset Flex CharStyle:Code
5753 \begin_layout Plain Layout
5754 $TEXMFLOCAL/tex/latex/
5762 \begin_layout Enumerate
5763 Install the package.
5764 For example, you would unpack the FoilTeX tarball and copy it to
5765 \begin_inset Flex CharStyle:Code
5768 \begin_layout Plain Layout
5769 $TEXMFLOCAL/tex/latex/foiltex
5776 \begin_inset Flex CharStyle:Code
5779 \begin_layout Plain Layout
5785 directory contains various files.
5788 \begin_layout Enumerate
5790 \begin_inset Flex CharStyle:Code
5793 \begin_layout Plain Layout
5801 \begin_inset Flex CharStyle:Code
5804 \begin_layout Plain Layout
5813 \begin_layout Standard
5814 Your package is now installed and available to LaTeX.
5815 To make it available to LyX, you need to create a Layout file, if one is
5816 not already available.
5817 (See the next section.) Once you have a layout file, you need only reconfigure
5819 \begin_inset Flex CharStyle:MenuItem
5822 \begin_layout Plain Layout
5823 Tools\SpecialChar \menuseparator
5829 ) and then restart LyX.
5830 You should then see your new package—for example
5831 \begin_inset Flex CharStyle:MenuItem
5834 \begin_layout Plain Layout
5841 \begin_inset Flex CharStyle:MenuItem
5844 \begin_layout Plain Layout
5845 Document\SpecialChar \menuseparator
5852 \begin_inset Flex CharStyle:MenuItem
5855 \begin_layout Plain Layout
5865 \begin_layout Section
5869 \begin_layout Standard
5870 This section describes how to write and install your own LyX layout files
5871 and walks through the
5872 \begin_inset Flex CharStyle:Code
5875 \begin_layout Plain Layout
5881 text class format as an example.
5883 \begin_inset Flex CharStyle:Code
5886 \begin_layout Plain Layout
5892 files describe what paragraph and character styles are available for a
5893 given document class and how LyX should display them.
5894 We try to provide a thorough description of the process here; however,
5895 there are so many different types of documents supported by LaTeX classes
5896 that we can't hope to cover every different possibility or problem you
5898 (The LyX users' list is frequented by people with lots of experience with
5899 layout design who are willing to share what they've learned.)
5902 \begin_layout Standard
5903 As you prepare to write a new layout, it is extremely helpful to look at
5904 the example layouts distributed with LyX.
5905 If you use a nice LaTeX document class that might be of interest for others,
5906 too, and have a nice corresponding LyX layout, feel free to contribute
5907 the stuff to us, so we may put it into the distribution.
5909 \begin_inset CommandInset href
5911 name "section on the LyX wiki"
5912 target "http://wiki.lyx.org/Layouts/Layouts"
5916 for this kind of material.
5919 \begin_layout Standard
5920 All the tags described in this chapter are case-insensitive; this means
5922 \begin_inset Flex CharStyle:Code
5925 \begin_layout Plain Layout
5932 \begin_inset Flex CharStyle:Code
5935 \begin_layout Plain Layout
5942 \begin_inset Flex CharStyle:Code
5945 \begin_layout Plain Layout
5951 are really the same command.
5952 The possible values are printed in brackets after the feature's name.
5953 The default value if a feature isn't specified inside a text class-description
5955 \begin_inset Flex CharStyle:Code
5958 \begin_layout Plain Layout
5967 If the argument has a data type like
5968 \begin_inset Quotes eld
5972 \begin_inset Quotes erd
5976 \begin_inset Quotes eld
5980 \begin_inset Quotes erd
5983 , the default is shown like this:
5984 \begin_inset Flex CharStyle:Code
5987 \begin_layout Plain Layout
5998 \begin_layout Subsection
5999 \begin_inset CommandInset label
6001 name "sub:Layout-modules"
6008 \begin_layout Standard
6009 Similar to layout files, and new with LyX 1.6, are layout
6014 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6015 some modules—such as the endnotes module—provide support for just such
6017 In a sense, layout modules are similar to included files—files like
6018 \begin_inset Flex CharStyle:Code
6021 \begin_layout Plain Layout
6027 —in that modules are not specific to a given document layout but may be
6028 used with many different layouts.
6029 The difference is that using a layout module does not require editing the
6031 Rather, modules are selected in the
6032 \begin_inset Flex CharStyle:MenuItem
6035 \begin_layout Plain Layout
6036 Document\SpecialChar \menuseparator
6045 \begin_layout Standard
6046 Building modules is the easiest way to get started with layout editing,
6047 since it can be as simple as adding a single new paragraph or flex inset.
6048 But modules may, in principle, contain anything a layout file can contain.
6051 \begin_layout Standard
6052 A module must begin with a line like the following:
6055 \begin_layout LyX-Code
6058 DeclareLyXModule[endnotes.sty]{Endnotes}
6061 \begin_layout Standard
6062 The argument in square brackets is optional: It declares any LaTeX packages
6063 on which the module depends.
6064 The mandatory argument, in curly brackets, is the name of the module, as
6066 \begin_inset Flex CharStyle:MenuItem
6069 \begin_layout Plain Layout
6070 Document\SpecialChar \menuseparator
6080 \begin_layout Standard
6081 The module declaration should then be followed by lines like the following:
6084 \begin_layout LyX-Code
6088 \begin_layout LyX-Code
6089 #Adds an endnote command, in addition to footnotes.
6093 \begin_layout LyX-Code
6094 #You will need to add
6096 theendnotes in TeX code where you
6099 \begin_layout LyX-Code
6100 #want the endnotes to appear.
6104 \begin_layout LyX-Code
6108 \begin_layout LyX-Code
6109 #Requires: somemodule | othermodule
6112 \begin_layout LyX-Code
6113 #Excludes: badmodule
6116 \begin_layout Standard
6117 The description is used in
6118 \begin_inset Flex CharStyle:MenuItem
6121 \begin_layout Plain Layout
6122 Document\SpecialChar \menuseparator
6128 to provide the user with information about what the module does.
6130 \begin_inset Flex CharStyle:Code
6133 \begin_layout Plain Layout
6139 line is used to identify other modules with which this one must be used;
6141 \begin_inset Flex CharStyle:Code
6144 \begin_layout Plain Layout
6150 line is used to identify modules with which this one may not be used.
6151 Both are optional, and, as shown, multiple modules should be separated
6152 with the pipe symbol: |.
6153 Note that the required modules are treated disjunctively:
6157 of the required modules must be used.
6162 excluded module may be used.
6163 Note that modules are identified here by their
6167 without the .module extension.
6169 \begin_inset Flex CharStyle:Code
6172 \begin_layout Plain Layout
6179 \begin_inset Flex CharStyle:Code
6182 \begin_layout Plain Layout
6191 \begin_layout Standard
6192 After creating a new module, you will need to reconfigure and then restart
6193 LyX for the module to appear in the menu.
6194 However, changes you make to the module will be seen immediately, if you
6196 \begin_inset Flex CharStyle:MenuItem
6199 \begin_layout Plain Layout
6200 Document\SpecialChar \menuseparator
6206 , highlight something, and then hit
6207 \begin_inset Quotes eld
6211 \begin_inset Quotes erd
6217 It is strongly recommended that you save your work before doing so
6222 it is strongly recommended that you not attempt to edit modules while simultaneo
6223 usly working on documents
6226 Though of course the developers strive to keep LyX stable in such situations,
6227 syntax errors and the like in your module file could cause strange behavior.
6230 \begin_layout Subsection
6231 Supporting new document classes
6234 \begin_layout Standard
6235 There are two situations you are likely to encounter when wanting to support
6236 a new LaTeX document class, involving LaTeX2e class (
6237 \begin_inset Flex CharStyle:Code
6240 \begin_layout Plain Layout
6247 \begin_inset Flex CharStyle:Code
6250 \begin_layout Plain Layout
6257 Supporting a style file is usually fairly easy.
6258 Supporting a new document class is a bit harder.
6261 \begin_layout Subsection
6263 \begin_inset Flex CharStyle:MenuItem
6266 \begin_layout Plain Layout
6275 \begin_layout Standard
6276 If your new document class is provided as a style file that is used in conjuncti
6277 on with an existing, supported document class—for the sake of the example,
6278 we'll assume that the style file is called
6279 \begin_inset Flex CharStyle:MenuItem
6282 \begin_layout Plain Layout
6288 and it is meant to be used with
6289 \begin_inset Flex CharStyle:MenuItem
6292 \begin_layout Plain Layout
6298 , which is a standard class—start by copying the existing class's layout
6299 file into your local directory:
6302 \begin_layout LyX-Code
6303 cp report.layout ~/.lyx/layouts/myclass.layout
6306 \begin_layout Standard
6308 \begin_inset Flex CharStyle:Code
6311 \begin_layout Plain Layout
6317 and change the line:
6320 \begin_layout LyX-Code
6323 DeclareLaTeXClass{report}
6326 \begin_layout Standard
6330 \begin_layout LyX-Code
6333 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6336 \begin_layout Standard
6340 \begin_layout LyX-Code
6342 \begin_inset Newline newline
6348 \begin_inset Newline newline
6354 \begin_layout Standard
6355 near the top of the file.
6358 \begin_layout Standard
6359 Start LyX and select
6360 \begin_inset Flex CharStyle:MenuItem
6363 \begin_layout Plain Layout
6364 Tools\SpecialChar \menuseparator
6371 Then restart LyX and try creating a new document.
6373 \begin_inset Flex CharStyle:MenuItem
6376 \begin_layout Plain Layout
6382 " as a document class option in the
6383 \begin_inset Flex CharStyle:MenuItem
6386 \begin_layout Plain Layout
6387 Document\SpecialChar \menuseparator
6394 It is likely that some of the sectioning commands and such in your new
6395 class will work differently from how they worked in the base class—
6396 \begin_inset Flex CharStyle:Code
6399 \begin_layout Plain Layout
6405 in this example—so you can fiddle around with the settings for the different
6406 sections if you wish.
6409 \begin_layout Subsection
6411 \begin_inset Flex CharStyle:MenuItem
6414 \begin_layout Plain Layout
6423 \begin_layout Standard
6424 There are two possibilities here.
6425 One is that the class file is itself based upon an existing document class.
6426 For example, many thesis classes are based upon
6427 \begin_inset Flex CharStyle:MenuItem
6430 \begin_layout Plain Layout
6437 To see whether yours is, look for a line like
6440 \begin_layout LyX-Code
6446 \begin_layout Standard
6448 If so, then you may proceed largely as in the previous section, though
6449 the DeclareLaTeXClass line will be different.
6450 If your new class is thesis, and it is based upon book, then the line should
6455 \begin_layout Plain Layout
6456 And it will be easiest if you save the file to
6457 \begin_inset Flex CharStyle:Code
6460 \begin_layout Plain Layout
6466 : LyX assumes that the document class has the same name as the layout file.
6475 \begin_layout LyX-Code
6478 DeclareLaTeXClass[thesis,book]{thesis}
6481 \begin_layout Standard
6482 If, on the other hand, the new class is not based upon an existing class,
6483 you will probably have to
6484 \begin_inset Quotes eld
6488 \begin_inset Quotes erd
6492 We strongly suggest copying an existing layout file which uses a similar
6493 LaTeX class and then modifying it, if you can do so.
6494 At least use an existing file as a starting point so you can find out what
6495 items you need to worry about.
6496 Again, the specifics are covered below.
6499 \begin_layout Section
6500 Declaring a new text class
6503 \begin_layout Standard
6504 When it's finally time to get your hands dirty and create or edit your own
6505 layout file, the following sections describe what you're up against.
6506 Our advice is to go slowly, save and test often, listen to soothing music,
6507 and enjoy one or two of your favorite adult beverages; more if you are
6508 getting particularly stuck.
6509 It's really not that hard, except that the multitude of options can become
6510 overwhelming if you try to do to much in one sitting.
6511 Go have another adult beverage, just for good measure.
6514 \begin_layout Standard
6518 \begin_layout Standard
6519 Lines in a layout file which begin with a
6520 \begin_inset Flex CharStyle:Code
6523 \begin_layout Plain Layout
6530 There is one exception to this rule: all layouts should begin with lines
6534 \begin_layout LyX-Code
6537 #% Do not delete the line below; configure depends on this
6540 \begin_layout LyX-Code
6545 DeclareLaTeXClass{article}
6548 \begin_layout Standard
6549 The second line is used when you configure LyX.
6550 The layout file is read by the LaTeX script
6551 \begin_inset Flex CharStyle:Code
6554 \begin_layout Plain Layout
6560 , in a special mode where
6561 \begin_inset Flex CharStyle:Code
6564 \begin_layout Plain Layout
6571 The first line is just a LaTeX comment, and the second one contains the
6572 declaration of the text class.
6573 If these lines appear in a file named
6574 \begin_inset Flex CharStyle:Code
6577 \begin_layout Plain Layout
6583 , then they define a text class of name
6584 \begin_inset Flex CharStyle:Code
6587 \begin_layout Plain Layout
6593 (the name of the layout file) which uses the LaTeX document class
6594 \begin_inset Flex CharStyle:Code
6597 \begin_layout Plain Layout
6603 (the default is to use the same name as the layout).
6605 \begin_inset Quotes eld
6609 \begin_inset Quotes erd
6612 that appears above is used as a description of the text class in the
6613 \begin_inset Flex CharStyle:MenuItem
6616 \begin_layout Plain Layout
6617 Document\SpecialChar \menuseparator
6626 \begin_layout Standard
6627 Let's assume that you wrote your own text class that uses the
6628 \begin_inset Flex CharStyle:Code
6631 \begin_layout Plain Layout
6637 document class, but where you changed the appearance of the section headings.
6638 If you put it in a file
6639 \begin_inset Flex CharStyle:Code
6642 \begin_layout Plain Layout
6648 , the header of this file should be:
6651 \begin_layout LyX-Code
6654 #% Do not delete the line below; configure depends on this
6657 \begin_layout LyX-Code
6662 DeclareLaTeXClass[article]{article (with my own headings)}
6665 \begin_layout Standard
6666 This declares a text class
6667 \begin_inset Flex CharStyle:Code
6670 \begin_layout Plain Layout
6676 , associated with the LaTeX document class
6677 \begin_inset Flex CharStyle:Code
6680 \begin_layout Plain Layout
6687 \begin_inset Quotes eld
6690 article (with my own headings)
6691 \begin_inset Quotes erd
6695 If your text class depends on several packages, you can declare it as:
6698 \begin_layout LyX-Code
6701 #% Do not delete the line below; configure depends on this
6704 \begin_layout LyX-Code
6709 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6712 \begin_layout Standard
6713 This indicates that your text class uses the foo.sty package.
6714 Finally, it is also possible to declare classes for DocBook code.
6715 Typical declarations will look like
6718 \begin_layout LyX-Code
6721 #% Do not delete the line below; configure depends on this
6724 \begin_layout LyX-Code
6729 DeclareDocBookClass[article]{SGML (DocBook article)}
6732 \begin_layout Standard
6733 Note that these declarations can also be given an optional parameter declaring
6734 the name of the document class (but not a list).
6737 \begin_layout Standard
6738 So, to be as explicit as possible, the form of the layout declaration is:
6741 \begin_layout LyX-Code
6746 DeclareLaTeXClass[class,package.sty]{layout description}
6749 \begin_layout Standard
6750 The class need only be specified if the name of the LaTeX class file and
6751 the name of the layout file are different; if the name of the class file
6752 is not specified, then LyX will simply assume that it is the same as the
6753 name of the layout file.
6756 \begin_layout Standard
6757 When the text class has been modified to your taste, all you have to do
6758 is to copy it either to
6759 \begin_inset Flex CharStyle:Code
6762 \begin_layout Plain Layout
6769 \begin_inset Flex CharStyle:Code
6772 \begin_layout Plain Layout
6779 \begin_inset Flex CharStyle:MenuItem
6782 \begin_layout Plain Layout
6783 Tools\SpecialChar \menuseparator
6789 , exit LyX and restart it.
6790 Then your new text class should be available along with the others.
6793 \begin_layout Standard
6794 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6795 you made to your layout files.
6796 As a result, editing layout files could be very time consuming.
6797 Beginning with 1.6, however, you can force a reload of the layout currently
6798 in use by using the LyX function
6799 \begin_inset Flex CharStyle:MenuItem
6802 \begin_layout Plain Layout
6809 There is no default binding for this function—though, of course, you can
6810 bind it to a key yourself.
6811 If you want to use this function, then, you should simply enter it in the
6817 : This is very much an `advanced feature'.
6822 recommended that you save your work before using this function.
6827 recommended that you not attempt to edit your layout while simultaneously
6828 working on a document that you care about.
6829 Use a test document.
6830 Syntax errors and the like in your layout file could cause peculiar behavior.
6831 In particular, such errors could cause LyX to regard the current layout
6832 as invalid and to attempt to switch to some other layout.
6833 The LyX team strives to keep LyX stable in such situations, but safe is
6837 \begin_layout Subsection
6841 \begin_layout Standard
6842 The first non-comment line must contain the file format number:
6845 \begin_layout Description
6846 \begin_inset Flex CharStyle:Code
6849 \begin_layout Plain Layout
6856 \begin_inset Flex CharStyle:Code
6859 \begin_layout Plain Layout
6865 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6866 don't have an explicit file format).
6867 The file format that is documented here is format 8.
6870 \begin_layout Subsection
6871 General text class parameters
6874 \begin_layout Standard
6875 These are the general parameters which describe the form of the entire document:
6878 \begin_layout Description
6879 \begin_inset Flex CharStyle:Code
6882 \begin_layout Plain Layout
6888 Adds information to the document preamble.
6890 \begin_inset Quotes eld
6894 \begin_inset Flex CharStyle:Code
6897 \begin_layout Plain Layout
6904 \begin_inset Quotes erd
6910 \begin_layout Description
6911 \begin_inset Flex CharStyle:Code
6914 \begin_layout Plain Layout
6920 Describes various global options supported by the document class.
6922 \begin_inset space ~
6926 \begin_inset CommandInset ref
6928 reference "sec:classoptions"
6934 \begin_inset Quotes eld
6938 \begin_inset Flex CharStyle:Code
6941 \begin_layout Plain Layout
6948 \begin_inset Quotes erd
6954 \begin_layout Description
6955 \begin_inset Flex CharStyle:Code
6958 \begin_layout Plain Layout
6965 \begin_inset Flex CharStyle:Code
6968 \begin_layout Plain Layout
6977 \begin_inset Flex CharStyle:Code
6980 \begin_layout Plain Layout
6986 ] Whether the class should default to having one or two columns.
6987 Can be changed in the
6988 \begin_inset Flex CharStyle:MenuItem
6991 \begin_layout Plain Layout
6992 Document\SpecialChar \menuseparator
7001 \begin_layout Description
7002 \begin_inset Flex CharStyle:Code
7005 \begin_layout Plain Layout
7011 This sequence defines a new counter.
7013 \begin_inset space ~
7017 \begin_inset CommandInset ref
7019 reference "sec:counter"
7025 \begin_inset Quotes eld
7029 \begin_inset Flex CharStyle:Code
7032 \begin_layout Plain Layout
7039 \begin_inset Quotes erd
7045 \begin_layout Description
7046 \begin_inset Flex CharStyle:Code
7049 \begin_layout Plain Layout
7055 Sets the default font used to display the document.
7057 \begin_inset space ~
7061 \begin_inset CommandInset ref
7063 reference "sec:fonts"
7067 for how to declare fonts.
7069 \begin_inset Quotes eld
7073 \begin_inset Flex CharStyle:Code
7076 \begin_layout Plain Layout
7083 \begin_inset Quotes erd
7089 \begin_layout Description
7090 \begin_inset Flex CharStyle:Code
7093 \begin_layout Plain Layout
7100 \begin_inset Flex CharStyle:Code
7103 \begin_layout Plain Layout
7109 Specifies a module to be included by default with this document class,
7110 which should be specified by filename without the
7111 \begin_inset Flex CharStyle:Code
7114 \begin_layout Plain Layout
7121 The user can still remove the module, but it will be active at the outset.
7122 (This applies only when new files are created, or when this class is chosen
7123 for an existing document.)
7126 \begin_layout Description
7127 \begin_inset Flex CharStyle:Code
7130 \begin_layout Plain Layout
7137 \begin_inset Flex CharStyle:Code
7140 \begin_layout Plain Layout
7146 ] This is the style that will be assigned to new paragraphs, usually
7147 \begin_inset Flex CharStyle:MenuItem
7150 \begin_layout Plain Layout
7157 This will default to the first defined style if not given, but you are
7158 highly encouraged to use this directive.
7161 \begin_layout Description
7162 \begin_inset Flex CharStyle:Code
7165 \begin_layout Plain Layout
7172 \begin_inset Flex CharStyle:Code
7175 \begin_layout Plain Layout
7181 ] Indicates that the module in question—which should be specified by filename
7183 \begin_inset Flex CharStyle:Code
7186 \begin_layout Plain Layout
7192 extension—cannot be used with this document class.
7193 This might be used in a journal-specific layout file to prevent, say, the
7195 \begin_inset Flex CharStyle:Code
7198 \begin_layout Plain Layout
7204 module that numbers theorems by section.
7209 be used in a module.
7210 Modules have their own way of excluding other modules (see
7211 \begin_inset CommandInset ref
7213 reference "sub:Layout-modules"
7220 \begin_layout Description
7221 \begin_inset Flex CharStyle:Code
7224 \begin_layout Plain Layout
7230 Defines a new float.
7232 \begin_inset space ~
7236 \begin_inset CommandInset ref
7238 reference "sec:floats"
7244 \begin_inset Quotes eld
7248 \begin_inset Flex CharStyle:Code
7251 \begin_layout Plain Layout
7258 \begin_inset Quotes erd
7264 \begin_layout Description
7265 \begin_inset Flex CharStyle:Code
7268 \begin_layout Plain Layout
7274 As its name implies, this command allows you to include another layout
7275 definition file within yours to avoid duplicating commands.
7276 Common examples are the standard layout files, for example,
7277 \begin_inset Flex CharStyle:Code
7280 \begin_layout Plain Layout
7286 , which contains most of the basic layouts.
7289 \begin_layout Description
7290 \begin_inset Flex CharStyle:Code
7293 \begin_layout Plain Layout
7299 This section (re-)defines the layout of an inset.
7300 It can be applied to an existing inset of to a new, user-defined inset,
7302 \begin_inset space \thinspace{}
7306 \begin_inset space \space{}
7309 a new character style.
7311 \begin_inset space ~
7315 \begin_inset CommandInset ref
7317 reference "sec:charstyle"
7321 for more information.
7323 \begin_inset Quotes eld
7327 \begin_inset Flex CharStyle:Code
7330 \begin_layout Plain Layout
7337 \begin_inset Quotes erd
7343 \begin_layout Description
7344 \begin_inset Flex CharStyle:Code
7347 \begin_layout Plain Layout
7353 A string that indicates the width of the left margin on the screen, for
7355 \begin_inset Quotes eld
7359 \begin_inset Quotes erd
7365 \begin_layout Description
7366 \begin_inset Flex CharStyle:Code
7369 \begin_layout Plain Layout
7375 This command deletes an existing float.
7376 This is particularly useful when you want to suppress a float that has
7377 be defined in an input file.
7380 \begin_layout Description
7381 \begin_inset Flex CharStyle:Code
7384 \begin_layout Plain Layout
7390 This command deletes an existing style.
7391 This is particularly useful when you want to suppress a style that has
7392 be defined in an input file.
7395 \begin_layout Description
7396 \begin_inset Flex CharStyle:Code
7399 \begin_layout Plain Layout
7405 A string indicating what sort of output documents using this class will
7407 At present, the options are: `docbook', `latex', and `literate'.
7410 \begin_layout Description
7411 \begin_inset Flex CharStyle:Code
7414 \begin_layout Plain Layout
7425 \begin_inset Flex CharStyle:Code
7428 \begin_layout Plain Layout
7439 \begin_inset Flex CharStyle:Code
7442 \begin_layout Plain Layout
7449 \begin_inset Flex CharStyle:Code
7452 \begin_layout Plain Layout
7458 ] The class default pagestyle.
7459 Can be changed in the
7460 \begin_inset Flex CharStyle:MenuItem
7463 \begin_layout Plain Layout
7464 Document\SpecialChar \menuseparator
7473 \begin_layout Description
7474 \begin_inset Flex CharStyle:Code
7477 \begin_layout Plain Layout
7483 Sets the preamble for the LaTeX document.
7484 Note that this will completely override any prior
7485 \begin_inset Flex CharStyle:Code
7488 \begin_layout Plain Layout
7495 \begin_inset Flex CharStyle:Code
7498 \begin_layout Plain Layout
7506 \begin_inset Quotes eld
7510 \begin_inset Flex CharStyle:Code
7513 \begin_layout Plain Layout
7520 \begin_inset Quotes erd
7526 \begin_layout Description
7527 \begin_inset Flex CharStyle:Code
7530 \begin_layout Plain Layout
7537 \begin_inset Flex CharStyle:Code
7540 \begin_layout Plain Layout
7547 \begin_inset Flex CharStyle:Code
7550 \begin_layout Plain Layout
7559 \begin_inset Flex CharStyle:Code
7562 \begin_layout Plain Layout
7568 ] Whether the class already provides the feature
7569 \begin_inset Flex CharStyle:Code
7572 \begin_layout Plain Layout
7579 A feature is in general the name of a package (
7580 \begin_inset Flex CharStyle:Code
7583 \begin_layout Plain Layout
7590 \begin_inset Flex CharStyle:Code
7593 \begin_layout Plain Layout
7599 , \SpecialChar \ldots{}
7601 \begin_inset Flex CharStyle:Code
7604 \begin_layout Plain Layout
7611 \begin_inset Flex CharStyle:Code
7614 \begin_layout Plain Layout
7620 ,\SpecialChar \ldots{}
7621 ); the complete list of supported features is unfortunately not documented
7622 outside the LyX source code—but see
7623 \begin_inset Flex CharStyle:Code
7626 \begin_layout Plain Layout
7632 if you're interested.
7634 \begin_inset Flex CharStyle:MenuItem
7637 \begin_layout Plain Layout
7638 Help\SpecialChar \menuseparator
7644 also gives an overview of the supported packages.
7647 \begin_layout Description
7648 \begin_inset Flex CharStyle:Code
7651 \begin_layout Plain Layout
7658 \begin_inset Flex CharStyle:Code
7661 \begin_layout Plain Layout
7667 ] Indicates that this layout provides the functionality of the module mentioned,
7668 which should be specified by the filename without the
7669 \begin_inset Flex CharStyle:Code
7672 \begin_layout Plain Layout
7679 This will typically be used if the layout includes the module directly,
7680 rather than using the
7681 \begin_inset Flex CharStyle:Code
7684 \begin_layout Plain Layout
7690 tag to indicate that it ought to be used.
7691 It could be used in a module that provided an alternate implementation
7692 of the same functionality.
7695 \begin_layout Description
7696 \begin_inset Flex CharStyle:Code
7699 \begin_layout Plain Layout
7706 \begin_inset Flex CharStyle:Code
7709 \begin_layout Plain Layout
7715 ] Whether the class requires the feature
7716 \begin_inset Flex CharStyle:Code
7719 \begin_layout Plain Layout
7726 Multiple features must be separated by commas.
7727 Note that you can only request supported features.
7730 \begin_layout Description
7731 \begin_inset Flex CharStyle:Code
7734 \begin_layout Plain Layout
7740 A string that indicates the width of the right margin on the screen, for
7742 \begin_inset Quotes eld
7746 \begin_inset Quotes erd
7752 \begin_layout Description
7753 \begin_inset Flex CharStyle:Code
7756 \begin_layout Plain Layout
7762 Sets which divisions get numbered.
7764 \begin_inset Flex CharStyle:Code
7767 \begin_layout Plain Layout
7776 \begin_layout Description
7777 \begin_inset Flex CharStyle:Code
7780 \begin_layout Plain Layout
7789 \begin_inset Flex CharStyle:Code
7792 \begin_layout Plain Layout
7803 \begin_inset Flex CharStyle:Code
7806 \begin_layout Plain Layout
7812 ] Whether the class-default should be printing on one or both sides of the
7814 Can be changed in the
7815 \begin_inset Flex CharStyle:MenuItem
7818 \begin_layout Plain Layout
7819 Document\SpecialChar \menuseparator
7828 \begin_layout Description
7829 \begin_inset Flex CharStyle:Code
7832 \begin_layout Plain Layout
7838 This sequence defines a new paragraph style.
7839 If the style already exists, it will redefine some of its parameters instead.
7841 \begin_inset space ~
7845 \begin_inset CommandInset ref
7847 reference "sec:style"
7853 \begin_inset Quotes eld
7857 \begin_inset Flex CharStyle:Code
7860 \begin_layout Plain Layout
7867 \begin_inset Quotes erd
7873 \begin_layout Description
7874 \begin_inset Flex CharStyle:Code
7877 \begin_layout Plain Layout
7884 \begin_inset Flex CharStyle:Code
7887 \begin_layout Plain Layout
7893 ] The name of the command or environment to be used with
7894 \begin_inset Flex CharStyle:Code
7897 \begin_layout Plain Layout
7906 \begin_layout Description
7907 \begin_inset Flex CharStyle:Code
7910 \begin_layout Plain Layout
7917 \begin_inset Flex CharStyle:Code
7920 \begin_layout Plain Layout
7929 \begin_inset Flex CharStyle:Code
7932 \begin_layout Plain Layout
7938 ] Indicates what kind of markup is used to define the title of a document.
7940 \begin_inset Flex CharStyle:Code
7943 \begin_layout Plain Layout
7949 means that the macro with name
7950 \begin_inset Flex CharStyle:Code
7953 \begin_layout Plain Layout
7959 will be inserted after the last layout which has
7960 \begin_inset Quotes eld
7964 \begin_inset Flex CharStyle:Code
7967 \begin_layout Plain Layout
7974 \begin_inset Quotes erd
7979 \begin_inset Flex CharStyle:Code
7982 \begin_layout Plain Layout
7988 corresponds to the case where the block of paragraphs which have
7989 \begin_inset Quotes eld
7993 \begin_inset Flex CharStyle:Code
7996 \begin_layout Plain Layout
8003 \begin_inset Quotes erd
8006 should be enclosed into the
8007 \begin_inset Flex CharStyle:Code
8010 \begin_layout Plain Layout
8019 \begin_layout Description
8020 \begin_inset Flex CharStyle:Code
8023 \begin_layout Plain Layout
8029 Sets which divisions are included in the table of contents.
8031 \begin_inset Flex CharStyle:Code
8034 \begin_layout Plain Layout
8043 \begin_layout Subsection
8044 \begin_inset Flex CharStyle:Code
8047 \begin_layout Plain Layout
8056 \begin_layout Standard
8057 \begin_inset CommandInset label
8059 name "sec:classoptions"
8064 \begin_inset Flex CharStyle:Code
8067 \begin_layout Plain Layout
8073 section can contain the following entries:
8076 \begin_layout Description
8077 \begin_inset Flex CharStyle:Code
8080 \begin_layout Plain Layout
8087 \begin_inset Flex CharStyle:Code
8090 \begin_layout Plain Layout
8096 ] The list of available font sizes for the document's main font, separated
8098 \begin_inset Quotes eld
8102 \begin_inset Flex CharStyle:Code
8105 \begin_layout Plain Layout
8112 \begin_inset Quotes erd
8118 \begin_layout Description
8119 \begin_inset Flex CharStyle:Code
8122 \begin_layout Plain Layout
8128 Used to set the DTD line with XML-based output classes.
8130 \begin_inset space \thinspace{}
8134 \begin_inset Quotes eld
8137 -//OASIS//DTD DocBook V4.2//EN
8138 \begin_inset Quotes erd
8144 \begin_layout Description
8145 \begin_inset Flex CharStyle:Code
8148 \begin_layout Plain Layout
8155 \begin_inset Flex CharStyle:Code
8158 \begin_layout Plain Layout
8159 string="empty|plain|headings|fancy"
8164 ] The list of available page styles, separated by
8165 \begin_inset Quotes eld
8169 \begin_inset Flex CharStyle:Code
8172 \begin_layout Plain Layout
8179 \begin_inset Quotes erd
8185 \begin_layout Description
8186 \begin_inset Flex CharStyle:Code
8189 \begin_layout Plain Layout
8196 \begin_inset Flex CharStyle:Code
8199 \begin_layout Plain Layout
8205 ] Some document class options, separated by a comma, that will be added
8206 to the optional part of the
8207 \begin_inset Flex CharStyle:Code
8210 \begin_layout Plain Layout
8221 \begin_layout Standard
8223 \begin_inset Flex CharStyle:Code
8226 \begin_layout Plain Layout
8232 section must end with
8233 \begin_inset Quotes eld
8237 \begin_inset Flex CharStyle:Code
8240 \begin_layout Plain Layout
8247 \begin_inset Quotes erd
8253 \begin_layout Subsection
8257 \begin_layout Standard
8258 \begin_inset CommandInset label
8264 A paragraph style description looks like this:
8268 \begin_layout Plain Layout
8269 Note that this will either define a new layout or modify an existing one.
8277 \begin_layout LyX-Code
8284 \begin_layout LyX-Code
8288 \begin_layout LyX-Code
8292 \begin_layout Standard
8293 where the following commands are allowed:
8296 \begin_layout Description
8297 \begin_inset Flex CharStyle:Code
8300 \begin_layout Plain Layout
8307 \begin_inset Flex CharStyle:Code
8310 \begin_layout Plain Layout
8315 , left, right, center
8320 ] Paragraph alignment.
8323 \begin_layout Description
8324 \begin_inset Flex CharStyle:Code
8327 \begin_layout Plain Layout
8334 \begin_inset Flex CharStyle:Code
8337 \begin_layout Plain Layout
8342 , left, right, center
8347 ] A comma separated list of permitted alignments.
8348 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8350 For example a right-aligned or centered enumeration isn't possible.)
8353 \begin_layout Description
8354 \begin_inset Flex CharStyle:Code
8357 \begin_layout Plain Layout
8364 \begin_inset Flex CharStyle:Code
8367 \begin_layout Plain Layout
8377 \begin_layout Plain Layout
8378 Note that a `float' here is a real number, such as: 1.5.
8383 The vertical space with which the last of a chain of paragraphs with this
8384 layout is separated from the following paragraph.
8385 If the next paragraph has another layout, the separations are not simply
8386 added, but the maximum is taken.
8389 \begin_layout Description
8390 \begin_inset Flex CharStyle:Code
8393 \begin_layout Plain Layout
8400 \begin_inset Flex CharStyle:Code
8403 \begin_layout Plain Layout
8409 The category for this style.
8410 This is used to group related styles in the Layout combobox on the toolbar.
8411 Any string can be used, but you may want to use existing categories with
8416 \begin_layout Description
8417 \begin_inset Flex CharStyle:Code
8420 \begin_layout Plain Layout
8426 Depth of XML command.
8427 Used only with XML-type formats.
8430 \begin_layout Description
8431 \begin_inset Flex CharStyle:Code
8434 \begin_layout Plain Layout
8441 \begin_inset CommandInset label
8443 name "des:CopyStyle"
8448 \begin_inset Flex CharStyle:Code
8451 \begin_layout Plain Layout
8457 Copies all the features of an existing style into the current one.
8461 \begin_layout Description
8462 \begin_inset Flex CharStyle:Code
8465 \begin_layout Plain Layout
8471 The name of a style whose preamble should be output
8476 This allows to ensure some ordering of the preamble snippets when macros
8477 definitions depend on one another.
8481 \begin_layout Plain Layout
8482 Note that, besides that functionality, there is no way to ensure any ordering
8484 The ordering that you see in a given version of LyX may change without
8485 warning in later versions.
8493 \begin_layout Description
8494 \begin_inset Flex CharStyle:Code
8497 \begin_layout Plain Layout
8504 \begin_inset Flex CharStyle:Code
8507 \begin_layout Plain Layout
8512 , Box, Filled_Box, Static
8517 ] The type of label that stands at the end of the paragraph (or sequence
8519 \begin_inset Flex CharStyle:Code
8522 \begin_layout Plain Layout
8529 \begin_inset Flex CharStyle:Code
8532 \begin_layout Plain Layout
8539 \begin_inset Flex CharStyle:Code
8542 \begin_layout Plain Layout
8549 \begin_inset Flex CharStyle:Code
8552 \begin_layout Plain Layout
8560 \begin_inset Flex CharStyle:Code
8563 \begin_layout Plain Layout
8570 \begin_inset Quotes eld
8574 \begin_inset Quotes erd
8578 \begin_inset Flex CharStyle:Code
8581 \begin_layout Plain Layout
8588 \begin_inset Flex CharStyle:Code
8591 \begin_layout Plain Layout
8592 \begin_inset space ~
8601 \begin_inset space ~
8604 black) square suitable for end of proof markers,
8605 \begin_inset Flex CharStyle:Code
8608 \begin_layout Plain Layout
8614 is an explicit text string.
8617 \begin_layout Description
8618 \begin_inset Flex CharStyle:Code
8621 \begin_layout Plain Layout
8628 \begin_inset Flex CharStyle:Code
8631 \begin_layout Plain Layout
8637 ] The string used for a label with a
8638 \begin_inset Flex CharStyle:Code
8641 \begin_layout Plain Layout
8648 \begin_inset Flex CharStyle:Code
8651 \begin_layout Plain Layout
8661 \begin_layout Description
8662 \begin_inset Flex CharStyle:Code
8665 \begin_layout Plain Layout
8672 \begin_inset Flex CharStyle:Code
8675 \begin_layout Plain Layout
8686 \begin_inset Flex CharStyle:Code
8689 \begin_layout Plain Layout
8698 \begin_layout Description
8699 \begin_inset Flex CharStyle:Code
8702 \begin_layout Plain Layout
8709 \begin_inset Flex CharStyle:Code
8712 \begin_layout Plain Layout
8722 ] With this parameter the
8723 \begin_inset Flex CharStyle:MenuItem
8726 \begin_layout Plain Layout
8733 \begin_inset Quotes eld
8736 Vertical space above
8737 \begin_inset Quotes erd
8741 \begin_inset Flex CharStyle:MenuItem
8744 \begin_layout Plain Layout
8745 Edit\SpecialChar \menuseparator
8747 \begin_inset space ~
8755 dialog can be set when initializing a paragraph with this style.
8759 \begin_layout Plain Layout
8762 Note from Jean-Marc:
8764 I'm not sure that this setting has much use, and it should probably be
8765 removed in later versions.
8773 \begin_layout Description
8774 \begin_inset Flex CharStyle:Code
8777 \begin_layout Plain Layout
8783 The font used for both the text body
8789 \begin_inset space ~
8793 \begin_inset CommandInset ref
8795 reference "sec:fonts"
8800 Note that defining this font automatically defines the
8801 \begin_inset Flex CharStyle:Code
8804 \begin_layout Plain Layout
8811 So you should define this one first if you also want to define
8812 \begin_inset Flex CharStyle:Code
8815 \begin_layout Plain Layout
8824 \begin_layout Description
8825 \begin_inset Flex CharStyle:Code
8828 \begin_layout Plain Layout
8835 \begin_inset CommandInset label
8837 name "des:FreeSpacing"
8844 \begin_inset Flex CharStyle:Code
8847 \begin_layout Plain Layout
8858 \begin_inset Flex CharStyle:Code
8861 \begin_layout Plain Layout
8867 ] Usually LyX doesn't allow you to insert more than one space between words,
8868 since a space is considered as the separation between two words, not a
8869 character or symbol of its own.
8870 This is a very fine thing but sometimes annoying, for example, when typing
8871 program code or plain LaTeX code.
8873 \begin_inset Flex CharStyle:Code
8876 \begin_layout Plain Layout
8883 Note that LyX will create protected blanks for the additional blanks when
8884 in another mode than LaTeX-mode.
8887 \begin_layout Description
8888 \begin_inset Flex CharStyle:Code
8891 \begin_layout Plain Layout
8897 [[FIXME]] (Used only with XML-type formats.)
8900 \begin_layout Description
8901 \begin_inset Flex CharStyle:Code
8904 \begin_layout Plain Layout
8911 \begin_inset Flex CharStyle:Code
8914 \begin_layout Plain Layout
8920 If 1, marks the layout as being part of a title block (see also the
8921 \begin_inset Flex CharStyle:Code
8924 \begin_layout Plain Layout
8931 \begin_inset Flex CharStyle:Code
8934 \begin_layout Plain Layout
8943 \begin_layout Description
8944 \begin_inset Flex CharStyle:Code
8947 \begin_layout Plain Layout
8954 \begin_inset Flex CharStyle:Code
8957 \begin_layout Plain Layout
8963 ] This provides extra space between paragraphs that have the same layout.
8964 If you put other layouts into an environment, each is separated with the
8966 \begin_inset Flex CharStyle:Code
8969 \begin_layout Plain Layout
8976 But the whole items of the environment are additionally separated with
8978 \begin_inset Flex CharStyle:Code
8981 \begin_layout Plain Layout
8993 \begin_layout Description
8994 \begin_inset Flex CharStyle:Code
8997 \begin_layout Plain Layout
9003 [[FIXME]] (Used only with XML-type formats.)
9006 \begin_layout Description
9007 \begin_inset Flex CharStyle:Code
9010 \begin_layout Plain Layout
9017 \begin_inset CommandInset label
9019 name "des:KeepEmpty"
9026 \begin_inset Flex CharStyle:Code
9029 \begin_layout Plain Layout
9040 \begin_inset Flex CharStyle:Code
9043 \begin_layout Plain Layout
9049 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9050 lead to empty LaTeX output.
9051 There are some cases where this could be desirable however: in a letter
9052 template, the required fields can be provided as empty fields, so that
9053 people do not forget them; in some special classes, a layout can be used
9054 as some kind of break, which does not contain actual text.
9057 \begin_layout Description
9058 \begin_inset Flex CharStyle:Code
9061 \begin_layout Plain Layout
9067 [float=0] The vertical space between the label and the text body.
9068 Only used for labels that are above the text body (
9069 \begin_inset Flex CharStyle:Code
9072 \begin_layout Plain Layout
9079 \begin_inset Flex CharStyle:Code
9082 \begin_layout Plain Layout
9083 Centered_Top_Environment
9091 \begin_layout Description
9092 \begin_inset Flex CharStyle:Code
9095 \begin_layout Plain Layout
9102 \begin_inset Flex CharStyle:Code
9105 \begin_layout Plain Layout
9112 \begin_inset Newline newline
9115 The name of the counter for automatic numbering (see Section
9116 \begin_inset CommandInset ref
9118 reference "sec:counter"
9123 This must be given if
9124 \begin_inset Flex CharStyle:Code
9127 \begin_layout Plain Layout
9134 \begin_inset Flex CharStyle:Code
9137 \begin_layout Plain Layout
9146 \begin_layout Description
9147 \begin_inset Flex CharStyle:Code
9150 \begin_layout Plain Layout
9156 The font used for the label.
9158 \begin_inset space ~
9162 \begin_inset CommandInset ref
9164 reference "sec:fonts"
9171 \begin_layout Description
9172 \begin_inset Flex CharStyle:Code
9175 \begin_layout Plain Layout
9181 Text that indicates how far a label should be indented.
9184 \begin_layout Description
9185 \begin_inset Flex CharStyle:Code
9188 \begin_layout Plain Layout
9195 \begin_inset Flex CharStyle:Code
9198 \begin_layout Plain Layout
9204 ] The horizontal space between the label and the text body.
9205 Only used for labels that are not above the text body.
9208 \begin_layout Description
9209 \begin_inset Flex CharStyle:Code
9212 \begin_layout Plain Layout
9219 \begin_inset Flex CharStyle:Code
9222 \begin_layout Plain Layout
9228 ] The string used for a label with a
9229 \begin_inset Flex CharStyle:Code
9232 \begin_layout Plain Layout
9240 \begin_inset Flex CharStyle:Code
9243 \begin_layout Plain Layout
9249 is set, this string can be contain the special formatting commands described
9251 \begin_inset CommandInset ref
9253 reference "sec:counter"
9261 \begin_layout Plain Layout
9262 For the sake of backwards compatibility, the string
9263 \begin_inset Flex CharStyle:Code
9266 \begin_layout Plain Layout
9276 will be replaced by the expanded
9277 \begin_inset Flex CharStyle:Code
9280 \begin_layout Plain Layout
9287 \begin_inset Flex CharStyle:Code
9290 \begin_layout Plain Layout
9299 This feature is now obsolete and should be replaced by the mechanisms of
9301 \begin_inset CommandInset ref
9303 reference "sec:counter"
9315 \begin_layout Description
9316 \begin_inset Flex CharStyle:Code
9319 \begin_layout Plain Layout
9326 \begin_inset Flex CharStyle:Code
9329 \begin_layout Plain Layout
9335 ] This is used inside the appendix instead of
9336 \begin_inset Flex CharStyle:Code
9339 \begin_layout Plain Layout
9347 \begin_inset Flex CharStyle:Code
9350 \begin_layout Plain Layout
9357 \begin_inset Flex CharStyle:Code
9360 \begin_layout Plain Layout
9369 \begin_layout Description
9370 \begin_inset Flex CharStyle:Code
9373 \begin_layout Plain Layout
9379 [FIXME] (Used only with XML-type formats.)
9382 \begin_layout Description
9383 \begin_inset Flex CharStyle:Code
9386 \begin_layout Plain Layout
9393 \begin_inset Flex CharStyle:Code
9396 \begin_layout Plain Layout
9401 , Manual, Static, Top_Environment,
9402 \begin_inset Newline newline
9405 Centered_Top_Environment, Sensitive, Counter
9411 \begin_inset Newline newline
9415 \begin_inset Flex CharStyle:Code
9418 \begin_layout Plain Layout
9424 means the label is the very first word (up to the first real blank).
9428 \begin_layout Plain Layout
9429 Use protected spaces if you want more than one word as the label.
9435 \begin_inset Flex CharStyle:Code
9438 \begin_layout Plain Layout
9444 means it is defined in the layout (see
9445 \begin_inset Flex CharStyle:Code
9448 \begin_layout Plain Layout
9456 \begin_inset Flex CharStyle:Code
9459 \begin_layout Plain Layout
9466 \begin_inset Flex CharStyle:Code
9469 \begin_layout Plain Layout
9470 Centered_Top_Environment
9475 are special cases of
9476 \begin_inset Flex CharStyle:Code
9479 \begin_layout Plain Layout
9486 The label will be printed above the paragraph, but only at the top of an
9487 environment or the top of a chain of paragraphs with this layout.
9488 Usage is for example the
9489 \begin_inset Flex CharStyle:MenuItem
9492 \begin_layout Plain Layout
9499 \begin_inset Flex CharStyle:MenuItem
9502 \begin_layout Plain Layout
9509 This is also the case for
9510 \begin_inset Flex CharStyle:Code
9513 \begin_layout Plain Layout
9519 labels with latex type
9520 \begin_inset Flex CharStyle:Code
9523 \begin_layout Plain Layout
9529 , in order to make layouts for theorems work correctly.
9531 \begin_inset Flex CharStyle:Code
9534 \begin_layout Plain Layout
9540 is a special case for the caption-labels
9541 \begin_inset Quotes eld
9545 \begin_inset Quotes erd
9549 \begin_inset Quotes eld
9553 \begin_inset Quotes erd
9558 \begin_inset Flex CharStyle:Code
9561 \begin_layout Plain Layout
9567 means the (hardcoded) label string depends on the kind of float.
9569 \begin_inset Flex CharStyle:Code
9572 \begin_layout Plain Layout
9578 label type defines automatically numbered labels.
9580 \begin_inset CommandInset ref
9582 reference "sec:counter"
9589 \begin_layout Description
9590 \begin_inset Flex CharStyle:Code
9593 \begin_layout Plain Layout
9599 The name of the corresponding LaTeX stuff.
9600 Either the environment or command name.
9603 \begin_layout Description
9604 \begin_inset Flex CharStyle:Code
9607 \begin_layout Plain Layout
9613 An optional parameter for the corresponding
9614 \begin_inset Flex CharStyle:Code
9617 \begin_layout Plain Layout
9624 This parameter cannot be changed from within LyX.
9627 \begin_layout Description
9628 \begin_inset Flex CharStyle:Code
9631 \begin_layout Plain Layout
9638 \begin_inset CommandInset label
9640 name "des:LatexType"
9645 \begin_inset Flex CharStyle:Code
9648 \begin_layout Plain Layout
9653 , Command, Environment, Item_Environment,
9659 \begin_inset Flex CharStyle:Code
9662 \begin_layout Plain Layout
9668 ] How the layout should be translated into LaTeX.
9670 \begin_inset Flex CharStyle:Code
9673 \begin_layout Plain Layout
9679 means nothing special.
9681 \begin_inset Flex CharStyle:Code
9684 \begin_layout Plain Layout
9691 \begin_inset Flex CharStyle:Code
9694 \begin_layout Plain Layout
9701 {\SpecialChar \ldots{}
9708 \begin_inset Flex CharStyle:Code
9711 \begin_layout Plain Layout
9718 \begin_inset Flex CharStyle:Code
9721 \begin_layout Plain Layout
9728 }\SpecialChar \ldots{}
9742 \begin_inset Flex CharStyle:Code
9745 \begin_layout Plain Layout
9752 \begin_inset Flex CharStyle:Code
9755 \begin_layout Plain Layout
9762 \begin_inset Flex CharStyle:Code
9765 \begin_layout Plain Layout
9773 is generated for each paragraph of this environment.
9775 \begin_inset Flex CharStyle:Code
9778 \begin_layout Plain Layout
9785 \begin_inset Flex CharStyle:Code
9788 \begin_layout Plain Layout
9795 \begin_inset Flex CharStyle:Code
9798 \begin_layout Plain Layout
9804 is passed as an argument to the environment.
9806 \begin_inset Flex CharStyle:Code
9809 \begin_layout Plain Layout
9815 can be defined in the
9816 \begin_inset Flex CharStyle:MenuItem
9819 \begin_layout Plain Layout
9824 ayout\SpecialChar \menuseparator
9836 \begin_inset Flex CharStyle:Code
9839 \begin_layout Plain Layout
9847 is perhaps a bit misleading, since these rules apply to SGML classes, too.
9848 Visit the SGML class files for specific examples.
9851 \begin_layout Standard
9852 Putting the last few things together, the LaTeX output will be either:
9855 \begin_layout LyX-Code
9858 latexname[latexparam]{\SpecialChar \ldots{}
9862 \begin_layout Standard
9866 \begin_layout LyX-Code
9869 begin{latexname}[latexparam] \SpecialChar \ldots{}
9875 \begin_layout Standard
9876 depending upon the LaTeX type.
9879 \begin_layout Description
9880 \begin_inset Flex CharStyle:Code
9883 \begin_layout Plain Layout
9890 \begin_inset Flex CharStyle:Code
9893 \begin_layout Plain Layout
9899 ] If you put layouts into environments, the leftmargins are not simply added,
9900 but added with a factor
9901 \begin_inset Formula $\frac{4}{depth+4}$
9905 Note that this parameter is also used when the margin is defined as
9906 \begin_inset Flex CharStyle:Code
9909 \begin_layout Plain Layout
9916 \begin_inset Flex CharStyle:Code
9919 \begin_layout Plain Layout
9926 Then it is added to the manual or dynamic margin.
9928 \begin_inset Newline newline
9931 The argument is passed as a string.
9933 \begin_inset Quotes eld
9937 \begin_inset Flex CharStyle:Code
9940 \begin_layout Plain Layout
9947 \begin_inset Quotes erd
9950 means that the paragraph is indented with the width of
9951 \begin_inset Quotes eld
9955 \begin_inset Flex CharStyle:Code
9958 \begin_layout Plain Layout
9965 \begin_inset Quotes erd
9969 You can get a negative width by prefixing the string with
9970 \begin_inset Quotes eld
9974 \begin_inset Flex CharStyle:Code
9977 \begin_layout Plain Layout
9984 \begin_inset Quotes erd
9988 This way was chosen so that the look is the same with each used screen
9993 \begin_layout Description
9994 \begin_inset Flex CharStyle:Code
9997 \begin_layout Plain Layout
10004 \begin_inset Flex CharStyle:Code
10007 \begin_layout Plain Layout
10012 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10018 \begin_inset Newline newline
10021 The kind of margin that the layout has on the left side.
10023 \begin_inset Flex CharStyle:Code
10026 \begin_layout Plain Layout
10032 just means a fixed margin.
10034 \begin_inset Flex CharStyle:Code
10037 \begin_layout Plain Layout
10043 means that the left margin depends on the string entered in the
10044 \begin_inset Flex CharStyle:MenuItem
10047 \begin_layout Plain Layout
10048 Edit\SpecialChar \menuseparator
10050 \begin_inset space ~
10059 This is used to typeset nice lists without tabulators.
10061 \begin_inset Flex CharStyle:Code
10064 \begin_layout Plain Layout
10070 means that the margin depends on the size of the label.
10071 This is used for automatic enumerated headlines.
10072 It is obvious that the headline
10073 \begin_inset Quotes eld
10076 5.4.3.2.1 Very long headline
10077 \begin_inset Quotes erd
10080 must have a wider left margin (as wide as
10081 \begin_inset Quotes eld
10085 \begin_inset Quotes erd
10088 plus the space) than
10089 \begin_inset Quotes eld
10092 3.2 Very long headline
10093 \begin_inset Quotes erd
10097 \begin_inset Quotes eld
10101 \begin_inset Quotes erd
10104 are not able to do this.
10106 \begin_inset Flex CharStyle:Code
10109 \begin_layout Plain Layout
10115 is similar, but only the very first row of the paragraph is dynamic, while
10116 the others are static; this is used, for example, for descriptions.
10118 \begin_inset Flex CharStyle:Code
10121 \begin_layout Plain Layout
10127 means the margin is chosen in a way that the longest row of this paragraph
10128 fits to the right margin.
10129 This is used to typeset an address on the right edge of the page.
10132 \begin_layout Description
10133 \begin_inset Flex CharStyle:Code
10136 \begin_layout Plain Layout
10143 \begin_inset Flex CharStyle:Code
10146 \begin_layout Plain Layout
10155 \begin_inset Flex CharStyle:Code
10158 \begin_layout Plain Layout
10164 ] Whether fragile commands in this layout should be
10165 \begin_inset Flex CharStyle:Code
10168 \begin_layout Plain Layout
10181 whether this command should itself be protected.)
10184 \begin_layout Description
10185 \begin_inset Flex CharStyle:Code
10188 \begin_layout Plain Layout
10195 \begin_inset Flex CharStyle:Code
10198 \begin_layout Plain Layout
10205 \begin_inset Flex CharStyle:Code
10208 \begin_layout Plain Layout
10216 ] Whether newlines are translated into LaTeX newlines (
10217 \begin_inset Flex CharStyle:Code
10220 \begin_layout Plain Layout
10231 The translation can be switched off to allow more comfortable LaTeX editing
10235 \begin_layout Description
10236 \begin_inset Flex CharStyle:Code
10239 \begin_layout Plain Layout
10246 \begin_inset Flex CharStyle:Code
10249 \begin_layout Plain Layout
10256 \begin_inset Flex CharStyle:Code
10259 \begin_layout Plain Layout
10267 ] Whether the following Paragraph is allowed to indent its very first row.
10269 \begin_inset Flex CharStyle:Code
10272 \begin_layout Plain Layout
10278 means that it is not allowed to do so;
10279 \begin_inset Flex CharStyle:Code
10282 \begin_layout Plain Layout
10288 means it could do so if it wants to.
10291 \begin_layout Description
10292 \begin_inset Flex CharStyle:Code
10295 \begin_layout Plain Layout
10301 Name of a layout that has replaced this layout.
10302 This is used to rename a layout, while keeping backward compatibility.
10305 \begin_layout Description
10306 \begin_inset Flex CharStyle:Code
10309 \begin_layout Plain Layout
10316 \begin_inset Flex CharStyle:Code
10319 \begin_layout Plain Layout
10325 ] The number of optional arguments that can be used with this layout.
10326 This is useful for things like section headings, and only makes sense with
10330 \begin_layout Description
10331 \begin_inset Flex CharStyle:Code
10334 \begin_layout Plain Layout
10341 \begin_inset Flex CharStyle:Code
10344 \begin_layout Plain Layout
10350 ] The indent of the very first line of a paragraph.
10352 \begin_inset Flex CharStyle:Code
10355 \begin_layout Plain Layout
10361 will be fixed for a certain layout.
10362 The exception is Standard layout, since the indentation of a Standard layout
10363 paragraph can be prohibited with
10364 \begin_inset Flex CharStyle:Code
10367 \begin_layout Plain Layout
10374 Also, Standard layout paragraphs inside environments use the
10375 \begin_inset Flex CharStyle:Code
10378 \begin_layout Plain Layout
10384 of the environment, not their native one.
10385 For example, Standard paragraphs inside an enumeration are not indented.
10388 \begin_layout Description
10389 \begin_inset Flex CharStyle:Code
10392 \begin_layout Plain Layout
10399 \begin_inset Flex CharStyle:Code
10402 \begin_layout Plain Layout
10408 ] The vertical space between two paragraphs of this layout.
10411 \begin_layout Description
10412 \begin_inset Flex CharStyle:Code
10415 \begin_layout Plain Layout
10422 \begin_inset Flex CharStyle:Code
10425 \begin_layout Plain Layout
10431 ] LyX allows the user to choose either
10432 \begin_inset Quotes eld
10436 \begin_inset Quotes erd
10440 \begin_inset Quotes eld
10444 \begin_inset Quotes erd
10447 to typeset a document.
10449 \begin_inset Quotes eld
10453 \begin_inset Quotes erd
10456 is chosen, this value is completely ignored.
10458 \begin_inset Quotes eld
10462 \begin_inset Quotes erd
10465 is chosen, the parindent of a LaTeXtype
10466 \begin_inset Quotes eld
10470 \begin_inset Quotes erd
10473 layout is ignored and all paragraphs are separated by this parskip argument.
10474 The vertical space is calculated with
10475 \begin_inset Flex CharStyle:Code
10478 \begin_layout Plain Layout
10480 \begin_inset space ~
10489 \begin_inset Flex CharStyle:Code
10492 \begin_layout Plain Layout
10498 is the height of a row with the normal font.
10499 This way, the look stays the same with different screen fonts.
10502 \begin_layout Description
10503 \begin_inset Flex CharStyle:Code
10506 \begin_layout Plain Layout
10513 \begin_inset CommandInset label
10515 name "des:PathThru"
10522 \begin_inset Flex CharStyle:Code
10525 \begin_layout Plain Layout
10536 \begin_inset Flex CharStyle:Code
10539 \begin_layout Plain Layout
10545 ] Whether the contents of this paragraph should be output in raw form, meaning
10546 without special translations that LaTeX would require.
10549 \begin_layout Description
10550 \begin_inset Flex CharStyle:Code
10553 \begin_layout Plain Layout
10560 \begin_inset CommandInset label
10562 name "des:Preamble"
10566 Information to be included in the LaTeX preamble when this style is used.
10567 Used to define macros, load packages, etc., required by this particular
10570 \begin_inset Quotes eld
10574 \begin_inset Flex CharStyle:Code
10577 \begin_layout Plain Layout
10584 \begin_inset Quotes erd
10590 \begin_layout Description
10591 \begin_inset Flex CharStyle:Code
10594 \begin_layout Plain Layout
10601 \begin_inset Flex CharStyle:Code
10604 \begin_layout Plain Layout
10611 \begin_inset CommandInset label
10613 name "des:Requires"
10617 Whether the layout requires the feature
10618 \begin_inset Flex CharStyle:Code
10621 \begin_layout Plain Layout
10628 See the description of
10629 \begin_inset Flex CharStyle:Code
10632 \begin_layout Plain Layout
10639 \begin_inset CommandInset ref
10640 LatexCommand pageref
10641 reference "des:FreeSpacing"
10645 ) for information on `features'.
10649 \begin_layout Description
10650 \begin_inset Flex CharStyle:Code
10653 \begin_layout Plain Layout
10660 \begin_inset Flex CharStyle:Code
10663 \begin_layout Plain Layout
10670 \begin_inset Flex CharStyle:Code
10673 \begin_layout Plain Layout
10682 \begin_layout Description
10683 \begin_inset Flex CharStyle:Code
10686 \begin_layout Plain Layout
10693 \begin_inset Flex CharStyle:Code
10696 \begin_layout Plain Layout
10701 , onehalf, double, other
10710 ] This defines what the default spacing should be in the layout.
10712 \begin_inset Flex CharStyle:Code
10715 \begin_layout Plain Layout
10722 \begin_inset Flex CharStyle:Code
10725 \begin_layout Plain Layout
10732 \begin_inset Flex CharStyle:Code
10735 \begin_layout Plain Layout
10741 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
10742 If you specify the argument
10743 \begin_inset Flex CharStyle:Code
10746 \begin_layout Plain Layout
10752 , then you should also provide a numerical argument which will be the actual
10754 Note that, contrary to other parameters,
10755 \begin_inset Flex CharStyle:Code
10758 \begin_layout Plain Layout
10764 implies the generation of specific LaTeX code, using the package
10767 \begin_inset Flex CharStyle:Code
10770 \begin_layout Plain Layout
10779 \begin_layout Description
10780 \begin_inset Flex CharStyle:Code
10783 \begin_layout Plain Layout
10789 The font used for the text body .
10791 \begin_inset CommandInset ref
10793 reference "sec:fonts"
10800 \begin_layout Description
10801 \begin_inset Flex CharStyle:Code
10804 \begin_layout Plain Layout
10812 The level of the style in the table of contents.
10813 This is used for automatic numbering of section headings.
10816 \begin_layout Description
10817 \begin_inset Flex CharStyle:Code
10820 \begin_layout Plain Layout
10827 \begin_inset Flex CharStyle:Code
10830 \begin_layout Plain Layout
10836 ] The vertical space with which the very first of a chain of paragraphs
10837 with this layout is separated from the previous paragraph.
10838 If the previous paragraph has another layout, the separations are not simply
10839 added, but the maximum is taken.
10842 \begin_layout Subsection
10846 \begin_layout Standard
10847 \begin_inset CommandInset label
10853 Since version 1.3.0 of LyX, it is has been both possible and necessary to
10854 define the floats (
10855 \begin_inset Flex CharStyle:MenuItem
10858 \begin_layout Plain Layout
10865 \begin_inset Flex CharStyle:MenuItem
10868 \begin_layout Plain Layout
10874 , \SpecialChar \ldots{}
10875 ) in the text class itself.
10876 Standard floats are included in the file
10877 \begin_inset Flex CharStyle:Code
10880 \begin_layout Plain Layout
10886 , so you may have to do no more than add
10889 \begin_layout LyX-Code
10890 Input stdfloats.inc
10893 \begin_layout Standard
10894 to your layout file.
10895 If you want to implement a text class that proposes some other float types
10896 (like the AGU class bundled with LyX), the information below will hopefully
10900 \begin_layout Description
10901 \begin_inset Flex CharStyle:Code
10904 \begin_layout Plain Layout
10911 \begin_inset Flex CharStyle:Code
10914 \begin_layout Plain Layout
10921 \begin_inset Quotes erd
10925 \begin_inset Quotes erd
10928 ] The file name extension of an auxiliary file for the list of figures (or
10930 LaTeX writes the captions to this file.
10933 \begin_layout Description
10934 \begin_inset Flex CharStyle:Code
10937 \begin_layout Plain Layout
10944 \begin_inset Flex CharStyle:Code
10947 \begin_layout Plain Layout
10954 \begin_inset Quotes erd
10958 \begin_inset Quotes erd
10961 ] The string that will be used in the menus and also for the caption.
10964 \begin_layout Description
10965 \begin_inset Flex CharStyle:Code
10968 \begin_layout Plain Layout
10975 \begin_inset Flex CharStyle:Code
10978 \begin_layout Plain Layout
10987 \begin_inset Flex CharStyle:Code
10990 \begin_layout Plain Layout
10997 \begin_inset Flex CharStyle:Code
11000 \begin_layout Plain Layout
11006 if the float is already defined by the LaTeX document class.
11008 \begin_inset Flex CharStyle:Code
11011 \begin_layout Plain Layout
11017 , the float will be defined using the LaTeX package
11018 \begin_inset Flex CharStyle:Code
11021 \begin_layout Plain Layout
11030 \begin_layout Description
11031 \begin_inset Flex CharStyle:Code
11034 \begin_layout Plain Layout
11041 \begin_inset Flex CharStyle:Code
11044 \begin_layout Plain Layout
11051 \begin_inset Quotes erd
11055 \begin_inset Quotes erd
11058 ] The heading used for the list of floats.
11061 \begin_layout Description
11062 \begin_inset Flex CharStyle:Code
11065 \begin_layout Plain Layout
11072 \begin_inset Flex CharStyle:Code
11075 \begin_layout Plain Layout
11082 \begin_inset Quotes erd
11086 \begin_inset Quotes erd
11089 ] This (optional) argument determines whether floats of this class will
11090 be numbered within some sectional unit of the document.
11091 For example, if within is equal to
11092 \begin_inset Flex CharStyle:Code
11095 \begin_layout Plain Layout
11101 , the floats will be numbered within chapters.
11105 \begin_layout Description
11106 \begin_inset Flex CharStyle:Code
11109 \begin_layout Plain Layout
11116 \begin_inset Flex CharStyle:Code
11119 \begin_layout Plain Layout
11126 \begin_inset Quotes erd
11130 \begin_inset Quotes erd
11133 ] The default placement for the given class of floats.
11134 The string should be as in standard LaTeX:
11135 \begin_inset Flex CharStyle:Code
11138 \begin_layout Plain Layout
11145 \begin_inset Flex CharStyle:Code
11148 \begin_layout Plain Layout
11155 \begin_inset Flex CharStyle:Code
11158 \begin_layout Plain Layout
11165 \begin_inset Flex CharStyle:Code
11168 \begin_layout Plain Layout
11174 for top, bottom, page, and here, respectively.
11178 \begin_layout Plain Layout
11179 Note that the order of these letters in the string is irrelevant, like in
11185 On top of that there is a new type,
11186 \begin_inset Flex CharStyle:Code
11189 \begin_layout Plain Layout
11195 , which does not really correspond to a float, since it means: put it
11196 \begin_inset Quotes eld
11200 \begin_inset Quotes erd
11204 Note however that the
11205 \begin_inset Flex CharStyle:Code
11208 \begin_layout Plain Layout
11214 specifier is special and, because of implementation details, cannot be
11215 used in non-built in float types.
11216 If you do not understand what this means, just use
11217 \begin_inset Quotes eld
11221 \begin_inset Flex CharStyle:Code
11224 \begin_layout Plain Layout
11231 \begin_inset Quotes erd
11237 \begin_layout Description
11238 \begin_inset Flex CharStyle:Code
11241 \begin_layout Plain Layout
11248 \begin_inset Flex CharStyle:Code
11251 \begin_layout Plain Layout
11258 \begin_inset Quotes erd
11262 \begin_inset Quotes erd
11265 ] The style used when defining the float using
11266 \begin_inset Flex CharStyle:Code
11269 \begin_layout Plain Layout
11280 \begin_layout Description
11281 \begin_inset Flex CharStyle:Code
11284 \begin_layout Plain Layout
11291 \begin_inset Flex CharStyle:Code
11294 \begin_layout Plain Layout
11301 \begin_inset Quotes erd
11305 \begin_inset Quotes erd
11309 \begin_inset Quotes eld
11313 \begin_inset Quotes erd
11316 of the new class of floats, like program or algorithm.
11317 After the appropriate
11318 \begin_inset Flex CharStyle:Code
11321 \begin_layout Plain Layout
11330 \begin_inset Flex CharStyle:Code
11333 \begin_layout Plain Layout
11342 \begin_inset Flex CharStyle:Code
11345 \begin_layout Plain Layout
11356 \begin_layout Standard
11357 Note that defining a float with type
11358 \begin_inset Flex CharStyle:Code
11361 \begin_layout Plain Layout
11369 automatically defines the corresponding counter with name
11370 \begin_inset Flex CharStyle:Code
11373 \begin_layout Plain Layout
11384 \begin_layout Subsection
11385 Flex insets and InsetLayout
11388 \begin_layout Standard
11389 \begin_inset CommandInset label
11391 name "sec:charstyle"
11395 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11396 these are called Flex insets.
11400 \begin_layout Standard
11401 Flex insets come in three different kinds:
11404 \begin_layout Itemize
11406 \begin_inset Flex CharStyle:Code
11409 \begin_layout Plain Layout
11415 ): These define semantic markup corresponding to such LaTeX commands as
11417 \begin_inset Flex CharStyle:Code
11420 \begin_layout Plain Layout
11429 \begin_inset Flex CharStyle:Code
11432 \begin_layout Plain Layout
11443 \begin_layout Itemize
11445 \begin_inset Flex CharStyle:Code
11448 \begin_layout Plain Layout
11454 ): These can be used to define custom collapsible insets, similar to TeX
11455 code, footnote, and the like.
11456 An obvious example is an endnote inset, which is defined in the
11457 \begin_inset Flex CharStyle:Code
11460 \begin_layout Plain Layout
11469 \begin_layout Itemize
11471 \begin_inset Flex CharStyle:Code
11474 \begin_layout Plain Layout
11480 ): For use with DocBook classes.
11483 \begin_layout Standard
11484 Flex insets are defined using the
11485 \begin_inset Flex CharStyle:Code
11488 \begin_layout Plain Layout
11494 tag, which shall be explained in a moment.
11497 \begin_layout Standard
11499 \begin_inset Flex CharStyle:Code
11502 \begin_layout Plain Layout
11508 tag also serves another function: It can be used to customize the general
11509 layout of many different types of insets.
11511 \begin_inset Flex CharStyle:Code
11514 \begin_layout Plain Layout
11520 can be used to customize the layout parameters for footnotes, marginal
11521 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
11522 boxes, tables, algorithms, URLs, and optional arguments, as well as to
11523 define Flex insets.
11526 \begin_layout Standard
11528 \begin_inset Flex CharStyle:Code
11531 \begin_layout Plain Layout
11537 definition must begin with a line of the form:
11540 \begin_layout LyX-Code
11544 \begin_layout Standard
11546 \begin_inset Flex CharStyle:Code
11549 \begin_layout Plain Layout
11555 indicates the inset whose layout is being defined, and here there are two
11559 \begin_layout Enumerate
11560 The layout for a pre-existing inset is being modified.
11561 In this case, can be
11562 \begin_inset Flex CharStyle:Code
11565 \begin_layout Plain Layout
11571 any one of the following:
11572 \begin_inset Flex CharStyle:Code
11575 \begin_layout Plain Layout
11582 \begin_inset Flex CharStyle:Code
11585 \begin_layout Plain Layout
11592 \begin_inset Flex CharStyle:Code
11595 \begin_layout Plain Layout
11602 \begin_inset Flex CharStyle:Code
11605 \begin_layout Plain Layout
11612 \begin_inset Flex CharStyle:Code
11615 \begin_layout Plain Layout
11622 \begin_inset Flex CharStyle:Code
11625 \begin_layout Plain Layout
11632 \begin_inset Flex CharStyle:Code
11635 \begin_layout Plain Layout
11642 \begin_inset Flex CharStyle:Code
11645 \begin_layout Plain Layout
11652 \begin_inset Flex CharStyle:Code
11655 \begin_layout Plain Layout
11662 \begin_inset Flex CharStyle:Code
11665 \begin_layout Plain Layout
11672 \begin_inset Flex CharStyle:Code
11675 \begin_layout Plain Layout
11682 \begin_inset Flex CharStyle:Code
11685 \begin_layout Plain Layout
11692 \begin_inset Flex CharStyle:Code
11695 \begin_layout Plain Layout
11702 \begin_inset Flex CharStyle:Code
11705 \begin_layout Plain Layout
11712 \begin_inset Flex CharStyle:Code
11715 \begin_layout Plain Layout
11722 \begin_inset Flex CharStyle:Code
11725 \begin_layout Plain Layout
11732 \begin_inset Flex CharStyle:Code
11735 \begin_layout Plain Layout
11742 \begin_inset Flex CharStyle:Code
11745 \begin_layout Plain Layout
11752 \begin_inset Flex CharStyle:Code
11755 \begin_layout Plain Layout
11762 \begin_inset Flex CharStyle:Code
11765 \begin_layout Plain Layout
11775 \begin_layout Enumerate
11776 The layout for a Flex inset is being defined.
11778 \begin_inset Flex CharStyle:Code
11781 \begin_layout Plain Layout
11787 can be any valid identifier not used by a pre-existing inset.
11788 Note that the definition of a flex inset must
11793 \begin_inset Flex CharStyle:Code
11796 \begin_layout Plain Layout
11805 \begin_layout Standard
11807 \begin_inset Flex CharStyle:Code
11810 \begin_layout Plain Layout
11816 definition can contain the following entries:
11819 \begin_layout Description
11820 \begin_inset Flex CharStyle:Code
11823 \begin_layout Plain Layout
11829 The color for the inset's background.
11830 The valid colors are defined in
11831 \begin_inset Flex CharStyle:Code
11834 \begin_layout Plain Layout
11843 \begin_layout Description
11844 \begin_inset Flex CharStyle:Code
11847 \begin_layout Plain Layout
11853 As with paragraph styles (see page
11854 \begin_inset CommandInset ref
11856 reference "des:CopyStyle"
11863 \begin_layout Description
11864 \begin_inset Flex CharStyle:Code
11867 \begin_layout Plain Layout
11874 \begin_inset Flex CharStyle:Code
11877 \begin_layout Plain Layout
11886 \begin_inset Flex CharStyle:Code
11889 \begin_layout Plain Layout
11895 ] Indicates whether the user may employ the Paragraph Settings dialog to
11896 customize the paragraph.
11899 \begin_layout Description
11900 \begin_inset Flex CharStyle:Code
11903 \begin_layout Plain Layout
11910 \begin_inset Flex CharStyle:Code
11913 \begin_layout Plain Layout
11920 \begin_inset Flex CharStyle:Code
11923 \begin_layout Plain Layout
11930 \begin_inset Flex CharStyle:Code
11933 \begin_layout Plain Layout
11939 , describing the rendering style used for the inset's frame and buttons.
11940 Footnotes generally use
11941 \begin_inset Flex CharStyle:Code
11944 \begin_layout Plain Layout
11950 , ERT insets generally
11951 \begin_inset Flex CharStyle:Code
11954 \begin_layout Plain Layout
11960 , and character styles
11961 \begin_inset Flex CharStyle:Code
11964 \begin_layout Plain Layout
11973 \begin_layout Description
11974 \begin_inset Flex CharStyle:Code
11977 \begin_layout Plain Layout
11983 Required at the end of the InsetLayout declarations.
11986 \begin_layout Description
11987 \begin_inset Flex CharStyle:Code
11990 \begin_layout Plain Layout
11996 The font used for both the text body
12002 \begin_inset space ~
12006 \begin_inset CommandInset ref
12008 reference "sec:fonts"
12013 Note that defining this font automatically defines the
12014 \begin_inset Flex CharStyle:Code
12017 \begin_layout Plain Layout
12023 to the same value, so define this first and define
12024 \begin_inset Flex CharStyle:Code
12027 \begin_layout Plain Layout
12033 later if you want them to be different.
12036 \begin_layout Description
12037 \begin_inset Flex CharStyle:Code
12040 \begin_layout Plain Layout
12047 \begin_inset Quotes eld
12051 \begin_inset Quotes erd
12054 language, leading to Left-to-Right (latin) output, e.
12055 \begin_inset space \thinspace{}
12059 \begin_inset space \space{}
12062 in TeX code or URL.
12066 \begin_layout Description
12067 \begin_inset Flex CharStyle:Code
12070 \begin_layout Plain Layout
12077 \begin_inset Flex CharStyle:Code
12080 \begin_layout Plain Layout
12089 \begin_inset Flex CharStyle:Code
12092 \begin_layout Plain Layout
12098 ] Indicates whether the PlainLayout should be used or, instead, the user
12099 can change the paragraph style used in the inset.
12102 \begin_layout Description
12103 \begin_inset Flex CharStyle:Code
12106 \begin_layout Plain Layout
12112 As with paragraph styles (see page
12113 \begin_inset CommandInset ref
12114 LatexCommand pageref
12115 reference "des:FreeSpacing"
12122 \begin_layout Description
12123 \begin_inset Flex CharStyle:Code
12126 \begin_layout Plain Layout
12132 As with paragraph styles (see page
12133 \begin_inset CommandInset ref
12134 LatexCommand pageref
12135 reference "des:KeepEmpty"
12142 \begin_layout Description
12143 \begin_inset Flex CharStyle:Code
12146 \begin_layout Plain Layout
12152 The font used for the label.
12154 \begin_inset space ~
12158 \begin_inset CommandInset ref
12160 reference "sec:fonts"
12165 Note that this definition can never appear before
12166 \begin_inset Flex CharStyle:Code
12169 \begin_layout Plain Layout
12175 , lest it be ineffective.
12178 \begin_layout Description
12179 \begin_inset Flex CharStyle:Code
12182 \begin_layout Plain Layout
12188 What will be displayed on the button or elsewhere as the inset label.
12189 Some inset types (TeX code and Branch) modify this label on the fly.
12192 \begin_layout Description
12193 \begin_inset Flex CharStyle:Code
12196 \begin_layout Plain Layout
12202 The name of the corresponding LaTeX stuff.
12203 Either the environment or command name.
12206 \begin_layout Description
12207 \begin_inset Flex CharStyle:Code
12210 \begin_layout Plain Layout
12216 The optional parameter for the corresponding
12217 \begin_inset Flex CharStyle:Code
12220 \begin_layout Plain Layout
12226 stuff, including possible bracket pairs like
12227 \begin_inset Flex CharStyle:Code
12230 \begin_layout Plain Layout
12237 This parameter cannot be changed from within LyX.
12240 \begin_layout Description
12241 \begin_inset Flex CharStyle:Code
12244 \begin_layout Plain Layout
12250 As with paragraph styles (see page
12251 \begin_inset CommandInset ref
12252 LatexCommand pageref
12253 reference "des:LatexType"
12260 \begin_layout Description
12261 \begin_inset Flex CharStyle:Code
12264 \begin_layout Plain Layout
12271 \begin_inset Flex CharStyle:Code
12274 \begin_layout Plain Layout
12281 \begin_inset Flex CharStyle:Code
12284 \begin_layout Plain Layout
12291 \begin_inset Flex CharStyle:Code
12294 \begin_layout Plain Layout
12301 \begin_inset Flex CharStyle:Code
12304 \begin_layout Plain Layout
12310 (indicating a dummy definition ending definitions of charstyles, etc).
12311 This entry is required in and is only meaningful for Flex insets.
12312 Among other things, it determines on which menu this inset will appear.
12315 \begin_layout Description
12316 \begin_inset Flex CharStyle:Code
12319 \begin_layout Plain Layout
12326 \begin_inset Flex CharStyle:Code
12329 \begin_layout Plain Layout
12338 \begin_inset Flex CharStyle:Code
12341 \begin_layout Plain Layout
12347 ] Whether multiple paragraphs are permitted in this inset.
12348 This will also set CustomPars to the same value and ForcePlain to the opposite
12350 These can be reset to other values, if they are used
12357 \begin_layout Description
12358 \begin_inset Flex CharStyle:Code
12361 \begin_layout Plain Layout
12368 \begin_inset Flex CharStyle:Code
12371 \begin_layout Plain Layout
12380 \begin_inset Flex CharStyle:Code
12383 \begin_layout Plain Layout
12389 ] Whether fragile commands in this layout should be
12390 \begin_inset Flex CharStyle:Code
12393 \begin_layout Plain Layout
12406 whether the command should itself be protected.)
12409 \begin_layout Description
12410 \begin_inset Flex CharStyle:Code
12413 \begin_layout Plain Layout
12420 \begin_inset Flex CharStyle:Code
12423 \begin_layout Plain Layout
12432 \begin_inset Flex CharStyle:Code
12435 \begin_layout Plain Layout
12441 ] As with paragraph styles (see page
12442 \begin_inset CommandInset ref
12444 reference "des:PathThru"
12451 \begin_layout Description
12452 \begin_inset Flex CharStyle:Code
12455 \begin_layout Plain Layout
12461 As with paragraph styles (see page
12462 \begin_inset CommandInset ref
12463 LatexCommand pageref
12464 reference "des:Preamble"
12471 \begin_layout Description
12472 \begin_inset Flex CharStyle:Code
12475 \begin_layout Plain Layout
12482 \begin_inset Flex CharStyle:Code
12485 \begin_layout Plain Layout
12491 ] As with paragraph styles (see page
12492 \begin_inset CommandInset ref
12493 LatexCommand pageref
12494 reference "des:Requires"
12501 \begin_layout Subsection
12505 \begin_layout Standard
12506 \begin_inset CommandInset label
12512 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12514 \begin_inset Flex CharStyle:MenuItem
12517 \begin_layout Plain Layout
12524 \begin_inset Flex CharStyle:MenuItem
12527 \begin_layout Plain Layout
12533 , \SpecialChar \ldots{}
12534 ) in the text class itself.
12535 The standard counters are defined in the file
12536 \begin_inset Flex CharStyle:Code
12539 \begin_layout Plain Layout
12545 , so you may have to do no more than add
12548 \begin_layout LyX-Code
12549 Input stdcounters.inc
12552 \begin_layout Standard
12553 to your layout file to get them to work.
12554 But if you want to define custom counters, then you can do so.
12555 The counter declaration must begin with:
12558 \begin_layout LyX-Code
12562 \begin_layout Standard
12563 where of course `name' is replaced by the name of the counter.
12564 And it must end with
12565 \begin_inset Quotes eld
12569 \begin_inset Flex CharStyle:Code
12572 \begin_layout Plain Layout
12579 \begin_inset Quotes erd
12583 The following parameters can also be used:
12586 \begin_layout Description
12587 \begin_inset Flex CharStyle:Code
12590 \begin_layout Plain Layout
12591 LabelString [string=""]
12596 when this is defined, this string defines how the counter is displayed.
12597 Setting this value sets
12598 \begin_inset Flex CharStyle:Code
12601 \begin_layout Plain Layout
12602 LabelStringAppendix
12608 The following special constructs can be used in the string:
12612 \begin_layout Itemize
12613 \begin_inset Flex CharStyle:Code
12616 \begin_layout Plain Layout
12624 will be replaced by the expansion of the
12625 \begin_inset Flex CharStyle:Code
12628 \begin_layout Plain Layout
12635 \begin_inset Flex CharStyle:Code
12638 \begin_layout Plain Layout
12639 LabelStringAppendix
12645 \begin_inset Flex CharStyle:Code
12648 \begin_layout Plain Layout
12658 \begin_layout Itemize
12659 counter values can be expressed using LaTeX-like macros
12660 \begin_inset Flex CharStyle:Code
12663 \begin_layout Plain Layout
12680 \begin_inset Flex CharStyle:Code
12683 \begin_layout Plain Layout
12695 \begin_layout Plain Layout
12705 Actually, the situation is a bit more complicated: any
12724 other than those described below will produce arabic numerals.
12725 It would not be surprising to see this change in the future.
12731 \begin_inset Flex CharStyle:Code
12734 \begin_layout Plain Layout
12740 : 1, 2, 3,\SpecialChar \ldots{}
12742 \begin_inset Flex CharStyle:Code
12745 \begin_layout Plain Layout
12751 for lower-case letters: a, b, c, \SpecialChar \ldots{}
12753 \begin_inset Flex CharStyle:Code
12756 \begin_layout Plain Layout
12762 for upper-case letters: A, B, C, \SpecialChar \ldots{}
12764 \begin_inset Flex CharStyle:Code
12767 \begin_layout Plain Layout
12773 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
12775 \begin_inset Flex CharStyle:Code
12778 \begin_layout Plain Layout
12784 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
12786 \begin_inset Flex CharStyle:Code
12789 \begin_layout Plain Layout
12795 for hebrew numerals.
12799 \begin_layout Standard
12800 If LabelString is not defined, a default value is constructed as follows:
12801 if the counter has a master counter
12802 \begin_inset Flex CharStyle:Code
12805 \begin_layout Plain Layout
12812 \begin_inset Flex CharStyle:Code
12815 \begin_layout Plain Layout
12822 \begin_inset Flex CharStyle:Code
12825 \begin_layout Plain Layout
12835 is used; otherwise the string
12836 \begin_inset Flex CharStyle:Code
12839 \begin_layout Plain Layout
12850 \begin_layout Description
12851 \begin_inset Flex CharStyle:Code
12854 \begin_layout Plain Layout
12855 LabelStringAppendix [string=""]
12861 \begin_inset Flex CharStyle:Code
12864 \begin_layout Plain Layout
12870 , but for use in the Appendix.
12873 \begin_layout Description
12874 \begin_inset Flex CharStyle:Code
12877 \begin_layout Plain Layout
12884 \begin_inset Flex CharStyle:Code
12887 \begin_layout Plain Layout
12894 \begin_inset Quotes erd
12898 \begin_inset Quotes erd
12901 ] If this is set to the name of another counter, the present counter will
12902 be reset every time the other one is increased.
12904 \begin_inset Flex CharStyle:Code
12907 \begin_layout Plain Layout
12914 \begin_inset Flex CharStyle:Code
12917 \begin_layout Plain Layout
12926 \begin_layout Subsection
12930 \begin_layout Standard
12931 \begin_inset CommandInset label
12937 A font description looks like this:
12940 \begin_layout LyX-Code
12950 \begin_layout LyX-Code
12954 \begin_layout LyX-Code
12958 \begin_layout Standard
12959 The following commands are available:
12962 \begin_layout Description
12963 \begin_inset Flex CharStyle:Code
12966 \begin_layout Plain Layout
12973 \begin_inset Flex CharStyle:Code
12976 \begin_layout Plain Layout
12985 \begin_inset Flex CharStyle:Code
12988 \begin_layout Plain Layout
12995 \begin_inset Flex CharStyle:Code
12998 \begin_layout Plain Layout
13005 \begin_inset Flex CharStyle:Code
13008 \begin_layout Plain Layout
13015 \begin_inset Flex CharStyle:Code
13018 \begin_layout Plain Layout
13025 \begin_inset Flex CharStyle:Code
13028 \begin_layout Plain Layout
13035 \begin_inset Flex CharStyle:Code
13038 \begin_layout Plain Layout
13045 \begin_inset Flex CharStyle:Code
13048 \begin_layout Plain Layout
13055 \begin_inset Flex CharStyle:Code
13058 \begin_layout Plain Layout
13067 \begin_layout Description
13068 \begin_inset Flex CharStyle:Code
13071 \begin_layout Plain Layout
13080 \begin_inset Flex CharStyle:Code
13083 \begin_layout Plain Layout
13094 \begin_inset Flex CharStyle:Code
13097 \begin_layout Plain Layout
13104 \begin_inset Flex CharStyle:Code
13107 \begin_layout Plain Layout
13116 \begin_layout Description
13117 \begin_inset Flex CharStyle:Code
13120 \begin_layout Plain Layout
13127 \begin_inset Flex CharStyle:Code
13130 \begin_layout Plain Layout
13136 ] Valid argument are:
13137 \begin_inset Flex CharStyle:Code
13140 \begin_layout Plain Layout
13147 \begin_inset Flex CharStyle:Code
13150 \begin_layout Plain Layout
13157 \begin_inset Flex CharStyle:Code
13160 \begin_layout Plain Layout
13167 \begin_inset Flex CharStyle:Code
13170 \begin_layout Plain Layout
13177 \begin_inset Flex CharStyle:Code
13180 \begin_layout Plain Layout
13187 \begin_inset Flex CharStyle:Code
13190 \begin_layout Plain Layout
13197 Each of these turns on or off the corresponding attribute.
13200 \begin_layout Description
13201 \begin_inset Flex CharStyle:Code
13204 \begin_layout Plain Layout
13213 \begin_inset Flex CharStyle:Code
13216 \begin_layout Plain Layout
13227 \begin_inset Flex CharStyle:Code
13230 \begin_layout Plain Layout
13239 \begin_layout Description
13240 \begin_inset Flex CharStyle:Code
13243 \begin_layout Plain Layout
13252 \begin_inset Flex CharStyle:Code
13255 \begin_layout Plain Layout
13266 \begin_inset Flex CharStyle:Code
13269 \begin_layout Plain Layout
13276 \begin_inset Flex CharStyle:Code
13279 \begin_layout Plain Layout
13286 \begin_inset Flex CharStyle:Code
13289 \begin_layout Plain Layout
13298 \begin_layout Description
13299 \begin_inset Flex CharStyle:Code
13302 \begin_layout Plain Layout
13309 \begin_inset Flex CharStyle:Code
13312 \begin_layout Plain Layout
13319 \begin_inset Flex CharStyle:Code
13322 \begin_layout Plain Layout
13329 \begin_inset Flex CharStyle:Code
13332 \begin_layout Plain Layout
13341 \begin_inset Flex CharStyle:Code
13344 \begin_layout Plain Layout
13351 \begin_inset Flex CharStyle:Code
13354 \begin_layout Plain Layout
13361 \begin_inset Flex CharStyle:Code
13364 \begin_layout Plain Layout
13371 \begin_inset Flex CharStyle:Code
13374 \begin_layout Plain Layout
13381 \begin_inset Flex CharStyle:Code
13384 \begin_layout Plain Layout
13393 \begin_layout Subsection
13394 Upgrading old layout files
13397 \begin_layout Standard
13398 The file format of layout files changes from time to time, so old layout
13399 files need to be converted.
13400 This process has been automated since LyX 1.4.0: If LyX reads an old format
13401 layout file it will call the conversion tool
13402 \begin_inset Flex CharStyle:Code
13405 \begin_layout Plain Layout
13406 LyXDir/scripts/layout2layout.py
13411 and convert it to a temporary file in current format.
13412 The original file is left untouched.
13413 If you want to convert the layout file permanently, just call the converter
13417 \begin_layout LyX-Code
13418 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13421 \begin_layout Standard
13422 (You need to replace
13423 \begin_inset Flex CharStyle:Code
13426 \begin_layout Plain Layout
13432 with the name of your LyX system directory, unless you happen to have defined
13433 such an environment variable.) Then copy
13434 \begin_inset Flex CharStyle:Code
13437 \begin_layout Plain Layout
13444 \begin_inset Flex CharStyle:Code
13447 \begin_layout Plain Layout
13456 \begin_layout Standard
13457 The automatic conversion only handles syntax changes.
13458 It cannot handle the case where the contents of included files was changed,
13459 so these will have to be converted separately.
13462 \begin_layout Section
13464 \begin_inset CommandInset label
13466 name "sec:templates"
13473 \begin_layout Standard
13474 Templates are created just like usual documents.
13475 The only difference is that usual documents contain all possible settings,
13476 including the font scheme and the paper size.
13477 Usually a user doesn't want a template to overwrite his defaults in these
13479 For that reason, the designer of a template should remove the corresponding
13481 \begin_inset Flex CharStyle:Code
13484 \begin_layout Plain Layout
13493 \begin_inset Flex CharStyle:Code
13496 \begin_layout Plain Layout
13504 from the template LyX file.
13505 This can be done with any simple text-editor, for example
13506 \begin_inset Flex CharStyle:Code
13509 \begin_layout Plain Layout
13516 \begin_inset Flex CharStyle:Code
13519 \begin_layout Plain Layout
13529 \begin_layout Standard
13530 Put the edited template files you create in
13531 \begin_inset Flex CharStyle:Code
13534 \begin_layout Plain Layout
13540 , copy the ones you use from the global template directory in
13541 \begin_inset Flex CharStyle:Code
13544 \begin_layout Plain Layout
13550 to the same place, and redefine the template path in the
13551 \begin_inset Flex CharStyle:MenuItem
13554 \begin_layout Plain Layout
13555 Tools\SpecialChar \menuseparator
13556 Preferences\SpecialChar \menuseparator
13565 \begin_layout Standard
13566 Note that there is a template which has a particular meaning:
13567 \begin_inset Flex CharStyle:Code
13570 \begin_layout Plain Layout
13577 This template is loaded every time you create a new document with
13578 \begin_inset Flex CharStyle:MenuItem
13581 \begin_layout Plain Layout
13582 File\SpecialChar \menuseparator
13588 in order to provide useful defaults.
13589 To create this template from inside LyX, all you have to do is to open
13590 a document with the correct settings, and use the
13591 \begin_inset Flex CharStyle:MenuItem
13594 \begin_layout Plain Layout
13595 Save as Document Defaults
13603 \begin_layout Chapter
13604 Including External Material
13607 \begin_layout Standard
13608 \begin_inset Box Shadowbox
13617 height_special "totalheight"
13620 \begin_layout Plain Layout
13621 WARNING: This portion of the documentation has not been updated for some
13623 We certainly hope that it is still accurate, but there are no guarantees.
13631 \begin_layout Standard
13632 The use of material from sources external to LyX is covered in detail in
13638 This part of the manual covers what needs to happen behind the scenes for
13639 new sorts of material to be included.
13642 \begin_layout Section
13646 \begin_layout Standard
13647 The external material feature is based on the concept of a
13652 A template is a specification of how LyX should interface with a certain
13654 As bundled, LyX comes with predefined templates for Xfig figures, various
13655 raster format images, chess diagrams, and LilyPond music notation.
13656 You can check the actual list by using the menu
13657 \begin_inset Flex CharStyle:MenuItem
13660 \begin_layout Plain Layout
13661 Insert\SpecialChar \menuseparator
13662 File\SpecialChar \menuseparator
13669 Furthermore, it is possible to roll your own template to support a specific
13671 Later we'll describe in more detail what is involved, and hopefully you
13672 will submit all the templates you create so we can include them in a later
13676 \begin_layout Standard
13677 Another basic idea of the external material feature is to distinguish between
13678 the original file that serves as a base for final material and the produced
13679 file that is included in your exported or printed document.
13680 For example, consider the case of a figure produced with
13681 \begin_inset Flex CharStyle:Code
13684 \begin_layout Plain Layout
13691 The Xfig application itself works on an original file with the
13692 \begin_inset Flex CharStyle:Code
13695 \begin_layout Plain Layout
13702 Within Xfig, you create and change your figure, and when you are done,
13704 \begin_inset Flex CharStyle:Code
13707 \begin_layout Plain Layout
13714 When you want to include the figure in your document, you invoke
13715 \begin_inset Flex CharStyle:Code
13718 \begin_layout Plain Layout
13724 in order to create a PostScript file that can readily be included in your
13727 \begin_inset Flex CharStyle:Code
13730 \begin_layout Plain Layout
13736 file is the original file, and the PostScript file is the produced file.
13739 \begin_layout Standard
13740 This distinction is important in order to allow updating of the material
13741 while you are in the process of writing the document.
13742 Furthermore, it provides us with the flexibility that is needed to support
13743 multiple export formats.
13744 For instance, in the case of a plain text file, it is not exactly an award-winn
13745 ing idea to include the figure as raw PostScript.
13746 Instead, you'd either prefer to just include a reference to the figure
13747 or try to invoke some graphics to ASCII converter to make the final result
13748 look similar to the real graphics.
13749 The external material management allows you to do this, because it is parametri
13750 zed on the different export formats that LyX supports.
13753 \begin_layout Standard
13754 Besides supporting the production of different products according to the
13755 exported format, it supports tight integration with editing and viewing
13757 In the case of an Xfig figure, you are able to invoke Xfig on the original
13758 file with a single click from within the external material dialog in LyX,
13759 and also preview the produced PostScript file with Ghostview with another
13761 No more fiddling around with the command line and/or file browsers to locate
13762 and manipulate the original or produced files.
13763 In this way, you are finally able to take full advantage of the many different
13764 applications that are relevant to use when you write your documents, and
13765 ultimately be more productive.
13768 \begin_layout Section
13769 The external template configuration file
13772 \begin_layout Standard
13773 It is relatively easy to add custom external template definitions to LyX.
13774 However, be aware that doing this in an careless manner most probably
13778 introduce an easily exploitable security hole.
13779 So before you do this, please read the discussion about security in section
13781 \begin_inset CommandInset ref
13783 reference "sec:Security-discussion"
13790 \begin_layout Standard
13791 Having said that, we encourage you to submit any interesting templates that
13796 \begin_layout Standard
13797 The external templates are defined in the
13798 \begin_inset Flex CharStyle:Code
13801 \begin_layout Plain Layout
13802 LyXDir/lib/external_templates
13808 You can place your own version in
13809 \begin_inset Flex CharStyle:Code
13812 \begin_layout Plain Layout
13813 UserDir/external_templates
13821 \begin_layout Standard
13822 A typical template looks like this:
13825 \begin_layout LyX-Code
13829 \begin_layout LyX-Code
13830 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
13833 \begin_layout LyX-Code
13837 \begin_layout LyX-Code
13841 \begin_layout LyX-Code
13845 \begin_layout LyX-Code
13849 \begin_layout LyX-Code
13853 \begin_layout LyX-Code
13854 AutomaticProduction true
13857 \begin_layout LyX-Code
13861 \begin_layout LyX-Code
13865 \begin_layout LyX-Code
13869 \begin_layout LyX-Code
13870 TransformCommand Rotate RotationLatexCommand
13873 \begin_layout LyX-Code
13874 TransformCommand Resize ResizeLatexCommand
13877 \begin_layout LyX-Code
13878 Product "$$RotateFront$$ResizeFront
13881 \begin_layout LyX-Code
13886 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
13889 \begin_layout LyX-Code
13890 $$ResizeBack$$RotateBack"
13893 \begin_layout LyX-Code
13897 \begin_layout LyX-Code
13898 UpdateResult "$$AbsPath$$Basename.pstex_t"
13901 \begin_layout LyX-Code
13902 Requirement "graphicx"
13905 \begin_layout LyX-Code
13906 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
13909 \begin_layout LyX-Code
13910 ReferencedFile latex "$$AbsPath$$Basename.eps"
13913 \begin_layout LyX-Code
13914 ReferencedFile dvi "$$AbsPath$$Basename.eps"
13917 \begin_layout LyX-Code
13921 \begin_layout LyX-Code
13925 \begin_layout LyX-Code
13926 TransformCommand Rotate RotationLatexCommand
13929 \begin_layout LyX-Code
13930 TransformCommand Resize ResizeLatexCommand
13933 \begin_layout LyX-Code
13934 Product "$$RotateFront$$ResizeFront
13937 \begin_layout LyX-Code
13942 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
13945 \begin_layout LyX-Code
13946 $$ResizeBack$$RotateBack"
13949 \begin_layout LyX-Code
13950 UpdateFormat pdftex
13953 \begin_layout LyX-Code
13954 UpdateResult "$$AbsPath$$Basename.pdftex_t"
13957 \begin_layout LyX-Code
13958 Requirement "graphicx"
13961 \begin_layout LyX-Code
13962 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
13965 \begin_layout LyX-Code
13966 ReferencedFile latex "$$AbsPath$$Basename.pdf"
13969 \begin_layout LyX-Code
13973 \begin_layout LyX-Code
13977 \begin_layout LyX-Code
13978 Product "$$Contents(
13980 "$$AbsPath$$Basename.asc
13985 \begin_layout LyX-Code
13986 UpdateFormat asciixfig
13989 \begin_layout LyX-Code
13990 UpdateResult "$$AbsPath$$Basename.asc"
13993 \begin_layout LyX-Code
13997 \begin_layout LyX-Code
14001 \begin_layout LyX-Code
14002 Product "<graphic fileref=
14004 "$$AbsOrRelPathMaster$$Basename.eps
14009 \begin_layout LyX-Code
14013 \begin_layout LyX-Code
14017 \begin_layout LyX-Code
14018 UpdateResult "$$AbsPath$$Basename.eps"
14021 \begin_layout LyX-Code
14022 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14025 \begin_layout LyX-Code
14026 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14029 \begin_layout LyX-Code
14033 \begin_layout LyX-Code
14034 Product "[XFig: $$FName]"
14037 \begin_layout LyX-Code
14041 \begin_layout LyX-Code
14045 \begin_layout Standard
14046 As you can see, the template is enclosed in
14047 \begin_inset Flex CharStyle:Code
14050 \begin_layout Plain Layout
14056 \SpecialChar \ldots{}
14058 \begin_inset Flex CharStyle:Code
14061 \begin_layout Plain Layout
14068 It contains a header specifying some general settings and, for each supported
14069 primary document file format, a section
14070 \begin_inset Flex CharStyle:Code
14073 \begin_layout Plain Layout
14079 \SpecialChar \ldots{}
14081 \begin_inset Flex CharStyle:Code
14084 \begin_layout Plain Layout
14093 \begin_layout Subsection
14094 The template header
14097 \begin_layout Description
14098 \begin_inset Flex CharStyle:Code
14101 \begin_layout Plain Layout
14102 AutomaticProduction
14103 \begin_inset space ~
14111 Whether the file represented by the template must be generated by LyX.
14112 This command must occur exactly once.
14115 \begin_layout Description
14116 \begin_inset Flex CharStyle:Code
14119 \begin_layout Plain Layout
14121 \begin_inset space ~
14129 A glob pattern that is used in the file dialog to filter out the desired
14131 If there is more than one possible file extension (e.
14132 \begin_inset space \thinspace{}
14136 \begin_inset space \space{}
14140 \begin_inset Flex CharStyle:Code
14143 \begin_layout Plain Layout
14150 \begin_inset Flex CharStyle:Code
14153 \begin_layout Plain Layout
14159 ), use something like
14160 \begin_inset Flex CharStyle:Code
14163 \begin_layout Plain Layout
14170 This command must occur exactly once.
14173 \begin_layout Description
14174 \begin_inset Flex CharStyle:Code
14177 \begin_layout Plain Layout
14179 \begin_inset space ~
14187 The text that is displayed on the button.
14188 This command must occur exactly once.
14191 \begin_layout Description
14192 \begin_inset Flex CharStyle:Code
14195 \begin_layout Plain Layout
14197 \begin_inset space ~
14201 \begin_inset space ~
14209 The help text that is used in the External dialog.
14210 Provide enough information to explain to the user just what the template
14211 can provide him with.
14212 This command must occur exactly once.
14215 \begin_layout Description
14216 \begin_inset Flex CharStyle:Code
14219 \begin_layout Plain Layout
14221 \begin_inset space ~
14229 The file format of the original file.
14230 This must be the name of a format that is known to LyX (see section
14231 \begin_inset CommandInset ref
14233 reference "sub:Formats"
14239 \begin_inset Quotes eld
14243 \begin_inset Flex CharStyle:Code
14246 \begin_layout Plain Layout
14253 \begin_inset Quotes erd
14256 if the template can handle original files of more than one format.
14257 LyX will attempt to interrogate the file itself in order to deduce its
14258 format in this case.
14259 This command must occur exactly once.
14262 \begin_layout Description
14263 \begin_inset Flex CharStyle:Code
14266 \begin_layout Plain Layout
14268 \begin_inset space ~
14276 A unique name for the template.
14277 It must not contain substitution macros (see below).
14280 \begin_layout Description
14281 \begin_inset Flex CharStyle:Code
14284 \begin_layout Plain Layout
14286 \begin_inset space ~
14289 Rotate|Resize|Clip|Extra
14294 This command specifies which transformations are supported by this template.
14295 It may occur zero or more times.
14296 This command enables the corresponding tabs in the external dialog.
14298 \begin_inset Flex CharStyle:Code
14301 \begin_layout Plain Layout
14307 command must have either a corresponding
14308 \begin_inset Flex CharStyle:Code
14311 \begin_layout Plain Layout
14318 \begin_inset Flex CharStyle:Code
14321 \begin_layout Plain Layout
14328 \begin_inset Flex CharStyle:Code
14331 \begin_layout Plain Layout
14338 Otherwise the transformation will not be supported by that format.
14341 \begin_layout Subsection
14345 \begin_layout Description
14346 \begin_inset Flex CharStyle:Code
14349 \begin_layout Plain Layout
14351 \begin_inset space ~
14354 LaTeX|PDFLaTeX|PlainText|DocBook
14359 The primary document file format that this format definition is for.
14360 Not every template has a sensible representation in all document file formats.
14361 Please define nevertheless a
14362 \begin_inset Flex CharStyle:Code
14365 \begin_layout Plain Layout
14371 section for all formats.
14372 Use a dummy text when no representation is available.
14373 Then you can at least see a reference to the external material in the exported
14377 \begin_layout Description
14378 \begin_inset Flex CharStyle:Code
14381 \begin_layout Plain Layout
14383 \begin_inset space ~
14387 \begin_inset space ~
14395 This command defines an additional macro
14396 \begin_inset Flex CharStyle:Code
14399 \begin_layout Plain Layout
14405 for substitution in
14406 \begin_inset Flex CharStyle:Code
14409 \begin_layout Plain Layout
14417 \begin_inset Flex CharStyle:Code
14420 \begin_layout Plain Layout
14426 itself may contain substitution macros.
14427 The advantage over using
14428 \begin_inset Flex CharStyle:Code
14431 \begin_layout Plain Layout
14438 \begin_inset Flex CharStyle:Code
14441 \begin_layout Plain Layout
14447 is that the substituted value of
14448 \begin_inset Flex CharStyle:Code
14451 \begin_layout Plain Layout
14457 is sanitized so that it is a valid optional argument in the document format.
14458 This command may occur zero or more times.
14461 \begin_layout Description
14462 \begin_inset Flex CharStyle:Code
14465 \begin_layout Plain Layout
14467 \begin_inset space ~
14475 The text that is inserted in the exported document.
14476 This is actually the most important command and can be quite complex.
14477 This command must occur exactly once.
14480 \begin_layout Description
14481 \begin_inset Flex CharStyle:Code
14484 \begin_layout Plain Layout
14486 \begin_inset space ~
14494 This command specifies a preamble snippet that will be included in the
14496 It has to be defined using
14497 \begin_inset Flex CharStyle:Code
14500 \begin_layout Plain Layout
14506 \SpecialChar \ldots{}
14508 \begin_inset Flex CharStyle:Code
14511 \begin_layout Plain Layout
14518 This command may occur zero or more times.
14521 \begin_layout Description
14522 \begin_inset Flex CharStyle:Code
14525 \begin_layout Plain Layout
14527 \begin_inset space ~
14531 \begin_inset space ~
14539 This command denotes files that are created by the conversion process and
14540 are needed for a particular export format.
14541 If the filename is relative, it is interpreted relative to the master document.
14542 This command may be given zero or more times.
14545 \begin_layout Description
14546 \begin_inset Flex CharStyle:Code
14549 \begin_layout Plain Layout
14551 \begin_inset space ~
14559 The name of a required LaTeX package.
14560 The package is included via
14561 \begin_inset Flex CharStyle:Code
14564 \begin_layout Plain Layout
14572 in the LaTeX preamble.
14573 This command may occur zero or more times.
14576 \begin_layout Description
14577 \begin_inset Flex CharStyle:Code
14580 \begin_layout Plain Layout
14582 \begin_inset space ~
14586 \begin_inset space ~
14589 RotationLatexCommand
14594 This command specifies that the built in LaTeX command should be used for
14596 This command may occur once or not at all.
14599 \begin_layout Description
14600 \begin_inset Flex CharStyle:Code
14603 \begin_layout Plain Layout
14605 \begin_inset space ~
14609 \begin_inset space ~
14617 This command specifies that the built in LaTeX command should be used for
14619 This command may occur once or not at all.
14622 \begin_layout Description
14623 \begin_inset Flex CharStyle:Code
14626 \begin_layout Plain Layout
14628 \begin_inset space ~
14632 \begin_inset space ~
14635 RotationLatexOption
14640 This command specifies that rotation is done via an optional argument.
14641 This command may occur once or not at all.
14644 \begin_layout Description
14645 \begin_inset Flex CharStyle:Code
14648 \begin_layout Plain Layout
14650 \begin_inset space ~
14654 \begin_inset space ~
14662 This command specifies that resizing is done via an optional argument.
14663 This command may occur once or not at all.
14666 \begin_layout Description
14667 \begin_inset Flex CharStyle:Code
14670 \begin_layout Plain Layout
14672 \begin_inset space ~
14676 \begin_inset space ~
14684 This command specifies that clipping is done via an optional argument.
14685 This command may occur once or not at all.
14688 \begin_layout Description
14689 \begin_inset Flex CharStyle:Code
14692 \begin_layout Plain Layout
14694 \begin_inset space ~
14698 \begin_inset space ~
14706 This command specifies that an extra optional argument is used.
14707 This command may occur once or not at all.
14710 \begin_layout Description
14711 \begin_inset Flex CharStyle:Code
14714 \begin_layout Plain Layout
14716 \begin_inset space ~
14724 The file format of the converted file.
14725 This must be the name of a format that is known to LyX (see the
14726 \begin_inset Flex CharStyle:MenuItem
14729 \begin_layout Plain Layout
14734 ools\SpecialChar \menuseparator
14739 references:Conversion
14745 This command must occur exactly once.
14748 \begin_layout Description
14749 \begin_inset Flex CharStyle:Code
14752 \begin_layout Plain Layout
14754 \begin_inset space ~
14762 The file name of the converted file.
14763 The file name must be absolute.
14764 This command must occur exactly once.
14767 \begin_layout Subsection
14768 Preamble definitions
14771 \begin_layout Standard
14772 The external template configuration file may contain additional preamble
14773 definitions enclosed by
14774 \begin_inset Flex CharStyle:Code
14777 \begin_layout Plain Layout
14783 \SpecialChar \ldots{}
14785 \begin_inset Flex CharStyle:Code
14788 \begin_layout Plain Layout
14795 They can be used by the templates in the
14796 \begin_inset Flex CharStyle:Code
14799 \begin_layout Plain Layout
14808 \begin_layout Section
14809 The substitution mechanism
14812 \begin_layout Standard
14813 When the external material facility invokes an external program, it is done
14814 on the basis of a command defined in the template configuration file.
14815 These commands can contain various macros that are expanded before execution.
14816 Execution always take place in the directory of the containing document.
14819 \begin_layout Standard
14820 Also, whenever external material is to be displayed, the name will be produced
14821 by the substitution mechanism, and most other commands in the template
14822 definition support substitution as well.
14825 \begin_layout Standard
14826 The available macros are the following:
14829 \begin_layout Description
14830 \begin_inset Flex CharStyle:Code
14833 \begin_layout Plain Layout
14834 $$AbsOrRelPathMaster
14839 The file path, absolute or relative to the master LyX document.
14842 \begin_layout Description
14843 \begin_inset Flex CharStyle:Code
14846 \begin_layout Plain Layout
14847 $$AbsOrRelPathParent
14852 The file path, absolute or relative to the LyX document.
14855 \begin_layout Description
14856 \begin_inset Flex CharStyle:Code
14859 \begin_layout Plain Layout
14865 The absolute file path.
14868 \begin_layout Description
14869 \begin_inset Flex CharStyle:Code
14872 \begin_layout Plain Layout
14878 The filename without path and without the extension.
14881 \begin_layout Description
14882 \begin_inset Flex CharStyle:Code
14885 \begin_layout Plain Layout
14887 \begin_inset Quotes eld
14891 \begin_inset Quotes erd
14899 This macro will expand to the contents of the file with the name
14900 \begin_inset Flex CharStyle:Code
14903 \begin_layout Plain Layout
14912 \begin_layout Description
14913 \begin_inset Flex CharStyle:Code
14916 \begin_layout Plain Layout
14922 The file extension (including the dot).
14925 \begin_layout Description
14926 \begin_inset Flex CharStyle:Code
14929 \begin_layout Plain Layout
14935 The filename of the file specified in the external material dialog.
14936 This is either an absolute name, or it is relative to the LyX document.
14939 \begin_layout Description
14940 \begin_inset Flex CharStyle:Code
14943 \begin_layout Plain Layout
14950 \begin_inset Flex CharStyle:Code
14953 \begin_layout Plain Layout
14959 (absolute name or relative to the LyX document).
14962 \begin_layout Description
14963 \begin_inset Flex CharStyle:Code
14966 \begin_layout Plain Layout
14972 The file path, relative to the master LyX document.
14975 \begin_layout Description
14976 \begin_inset Flex CharStyle:Code
14979 \begin_layout Plain Layout
14985 The file path, relative to the LyX document.
14988 \begin_layout Description
14989 \begin_inset Flex CharStyle:Code
14992 \begin_layout Plain Layout
14998 This macro will expand to the absolute path of the system directory.
14999 This is typically used to point to the various helper scripts that are
15003 \begin_layout Description
15004 \begin_inset Flex CharStyle:Code
15007 \begin_layout Plain Layout
15013 A name and full path to a temporary file which will be automatically deleted
15014 whenever the containing document is closed, or the external material insertion
15018 \begin_layout Standard
15019 All path macros contain a trailing directory separator, so you can construct
15021 \begin_inset space \thinspace{}
15025 \begin_inset space \space{}
15028 the absolute filename with
15029 \begin_inset Flex CharStyle:Code
15032 \begin_layout Plain Layout
15033 $$AbsPath$$Basename$$Extension
15041 \begin_layout Standard
15042 The macros above are substituted in all commands unless otherwise noted.
15044 \begin_inset Flex CharStyle:Code
15047 \begin_layout Plain Layout
15053 supports additionally the following substitutions if they are enabled by
15055 \begin_inset Flex CharStyle:Code
15058 \begin_layout Plain Layout
15065 \begin_inset Flex CharStyle:Code
15068 \begin_layout Plain Layout
15077 \begin_layout Description
15078 \begin_inset Flex CharStyle:Code
15081 \begin_layout Plain Layout
15087 The front part of the resize command.
15090 \begin_layout Description
15091 \begin_inset Flex CharStyle:Code
15094 \begin_layout Plain Layout
15100 The back part of the resize command.
15103 \begin_layout Description
15104 \begin_inset Flex CharStyle:Code
15107 \begin_layout Plain Layout
15113 The front part of the rotation command.
15116 \begin_layout Description
15117 \begin_inset Flex CharStyle:Code
15120 \begin_layout Plain Layout
15126 The back part of the rotation command.
15129 \begin_layout Standard
15130 The value string of the
15131 \begin_inset Flex CharStyle:Code
15134 \begin_layout Plain Layout
15140 command supports additionally the following substitutions if they are enabled
15142 \begin_inset Flex CharStyle:Code
15145 \begin_layout Plain Layout
15152 \begin_inset Flex CharStyle:Code
15155 \begin_layout Plain Layout
15164 \begin_layout Description
15165 \begin_inset Flex CharStyle:Code
15168 \begin_layout Plain Layout
15177 \begin_layout Description
15178 \begin_inset Flex CharStyle:Code
15181 \begin_layout Plain Layout
15190 \begin_layout Description
15191 \begin_inset Flex CharStyle:Code
15194 \begin_layout Plain Layout
15203 \begin_layout Description
15204 \begin_inset Flex CharStyle:Code
15207 \begin_layout Plain Layout
15213 The rotation option.
15216 \begin_layout Standard
15217 You may ask why there are so many path macros.
15218 There are mainly two reasons:
15221 \begin_layout Enumerate
15222 Relative and absolute file names should remain relative or absolute, respectivel
15224 Users may have reasons to prefer either form.
15225 Relative names are useful for portable documents that should work on different
15226 machines, for example.
15227 Absolute names may be required by some programs.
15230 \begin_layout Enumerate
15231 LaTeX treats relative file names differently than LyX and other programs
15232 in nested included files.
15233 For LyX, a relative file name is always relative to the document that contains
15235 For LaTeX, it is always relative to the master document.
15236 These two definitions are identical if you have only one document, but
15237 differ if you have a master document that includes part documents.
15238 That means that relative filenames must be transformed when presented to
15240 Fortunately LyX does this automatically for you if you choose the right
15244 \begin_layout Standard
15245 So which path macro should be used in new template definitions? The rule
15249 \begin_layout Itemize
15251 \begin_inset Flex CharStyle:Code
15254 \begin_layout Plain Layout
15260 if an absolute path is required.
15263 \begin_layout Itemize
15265 \begin_inset Flex CharStyle:Code
15268 \begin_layout Plain Layout
15269 $$AbsOrRelPathMaster
15274 if the substituted string is some kind of LaTeX input.
15277 \begin_layout Itemize
15279 \begin_inset Flex CharStyle:Code
15282 \begin_layout Plain Layout
15283 $$AbsOrRelPathParent
15288 in order to preserve the user's choice.
15291 \begin_layout Standard
15292 There are special cases where this rule does not work and e.
15293 \begin_inset space \thinspace{}
15297 \begin_inset space \space{}
15300 relative names are needed, but normally it will work just fine.
15301 One example for such a case is the command
15302 \begin_inset Flex CharStyle:Code
15305 \begin_layout Plain Layout
15306 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15311 in the XFig template above: We can't use the absolute name because the
15313 \begin_inset Flex CharStyle:Code
15316 \begin_layout Plain Layout
15322 files needs the relative name in order to rewrite the file content.
15325 \begin_layout Section
15326 \begin_inset CommandInset label
15328 name "sec:Security-discussion"
15332 Security discussion
15335 \begin_layout Standard
15336 \begin_inset Box Shadowbox
15345 height_special "totalheight"
15348 \begin_layout Plain Layout
15349 WARNING: This section is definitely outdated.
15357 \begin_layout Standard
15358 The external material feature interfaces with a lot of external programs
15359 and does so automatically, so we have to consider the security implications
15361 In particular, since you have the option of including your own filenames
15362 and/or parameter strings and those are expanded into a command, it seems
15363 that it would be possible to create a malicious document which executes
15364 arbitrary commands when a user views or prints the document.
15365 This is something we definitely want to avoid.
15368 \begin_layout Standard
15369 However, since the external program commands are specified in the template
15370 configuration file only, there are no security issues if LyX is properly
15371 configured with safe templates only.
15372 This is so because the external programs are invoked with the
15373 \begin_inset Flex CharStyle:Code
15376 \begin_layout Plain Layout
15382 -system call rather than the
15383 \begin_inset Flex CharStyle:Code
15386 \begin_layout Plain Layout
15392 system-call, so it's not possible to execute arbitrary commands from the
15393 filename or parameter section via the shell.
15396 \begin_layout Standard
15397 This also implies that you are restricted in what command strings you can
15398 use in the external material templates.
15399 In particular, pipes and redirection are not readily available.
15400 This has to be so if LyX should remain safe.
15401 If you want to use some of the shell features, you should write a safe
15402 script to do this in a controlled manner, and then invoke the script from
15403 the command string.
15405 \begin_inset Flex CharStyle:Code
15408 \begin_layout Plain Layout
15414 directory of the LyX installation, you can find a safe wrapper script
15415 \begin_inset Flex CharStyle:Code
15418 \begin_layout Plain Layout
15419 general_command_wrapper.py
15424 that supports redirection of input and output.
15425 That can serve as an example for how to write safe template scripts.
15426 For a more advanced example that uses
15427 \begin_inset Flex CharStyle:Code
15430 \begin_layout Plain Layout
15436 and friends, take a look at the
15437 \begin_inset Flex CharStyle:Code
15440 \begin_layout Plain Layout
15449 \begin_layout Standard
15450 It is possible to design a template that interacts directly with the shell,
15451 but since this would allow a malicious user to execute arbitrary commands
15452 by writing clever filenames and/or parameters, we generally recommend that
15453 you only use safe scripts that work with the
15454 \begin_inset Flex CharStyle:Code
15457 \begin_layout Plain Layout
15463 system call in a controlled manner.
15464 Of course, for use in a controlled environment, it can be tempting to just
15465 fall back to use ordinary shell scripts.
15466 If you do so, be aware that you
15470 provide an easily exploitable security hole in your system.
15471 Of course it stands to reason that such unsafe templates will never be
15472 included in the standard LyX distribution, although we do encourage people
15473 to submit new templates in the open source tradition.
15474 But LyX as shipped from the official distribution channels will never have
15478 \begin_layout Standard
15479 Including external material provides a lot of power, and you have to be
15480 careful not to introduce security hazards with this power.
15481 A subtle error in a single line in an innocent looking script can open
15482 the door to huge security problems.
15483 So if you do not fully understand the issues, we recommend that you consult
15484 a knowledgeable security professional or the LyX development team if you
15485 have any questions about whether a given template is safe or not.
15486 And do this before you use it in an uncontrolled environment.