1 #LyX 1.6.2svn 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
185 the 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 Standard
2234 \begin_inset Flex CharStyle:MenuItem
2237 \begin_layout Plain Layout
2239 \begin_inset space ~
2247 field you can enter the following flags, separated by commas:
2250 \begin_layout Labeling
2251 \labelwidthstring 00.00.0000
2252 \begin_inset Flex CharStyle:Code
2255 \begin_layout Plain Layout
2261 This converter runs some form of LaTeX.
2262 This will make LyX's LaTeX error logs available.
2265 \begin_layout Labeling
2266 \labelwidthstring 00.00.0000
2267 \begin_inset Flex CharStyle:Code
2270 \begin_layout Plain Layout
2277 \begin_inset Flex CharStyle:MenuItem
2280 \begin_layout Plain Layout
2286 file for the conversion.
2289 \begin_layout Labeling
2290 \labelwidthstring 00.00.0000
2291 \begin_inset Flex CharStyle:Code
2294 \begin_layout Plain Layout
2303 \begin_layout Standard
2304 The following three flags are not really flags at all because they take
2306 \begin_inset Flex CharStyle:MenuItem
2309 \begin_layout Plain Layout
2311 \begin_inset space ~
2315 \begin_inset space ~
2326 \begin_layout Labeling
2327 \labelwidthstring 00.00.0000
2328 \begin_inset Flex CharStyle:Code
2331 \begin_layout Plain Layout
2337 If set, the converter's standard error will be redirected to a file
2338 \begin_inset Flex CharStyle:Code
2341 \begin_layout Plain Layout
2347 , and the script given as argument will be run as:
2348 \begin_inset Flex CharStyle:Code
2351 \begin_layout Plain Layout
2352 script <infile.out >infile.log
2358 The argument may contain
2359 \begin_inset Flex CharStyle:Code
2362 \begin_layout Plain Layout
2371 \begin_layout Labeling
2372 \labelwidthstring 00.00.0000
2373 \begin_inset Flex CharStyle:Code
2376 \begin_layout Plain Layout
2382 The name of the directory in which the converter will dump the generated
2384 LyX will not create this directory, and it does not copy anything into
2385 it, though it will copy this directory to the destination.
2386 The argument may contain
2387 \begin_inset Flex CharStyle:Code
2390 \begin_layout Plain Layout
2396 , which will be replaced by the base name of the input and output files,
2397 respectively, when the directory is copied.
2398 \begin_inset Newline newline
2401 Note that resultdir and usetempdir make no sense together.
2402 The latter will be ignored if the former is given.
2405 \begin_layout Labeling
2406 \labelwidthstring 00.00.0000
2407 \begin_inset Flex CharStyle:Code
2410 \begin_layout Plain Layout
2416 Determines the output file name and may, contain
2417 \begin_inset Flex CharStyle:Code
2420 \begin_layout Plain Layout
2427 Sensible only with resultdir and optional even then; if not given, it defaults
2431 \begin_layout Standard
2432 None of these last three are presently used in any of the converters that
2433 are installed with LyX.
2437 \begin_layout Standard
2438 You do not have to define converters between all the formats between which
2439 you want to convert.
2440 For example, you will note that there is no `LyX to PostScript' converter,
2441 but LyX will export PostScript.
2442 It does so by first creating a LaTeX file (no converter needs to be defined
2443 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2444 and finally converting the resulting DVI file to PostScript.
2445 LyX finds such `chains' of converters automatically, and it will always
2446 choose the shortest possible chain.
2447 You can, though, still define multiple conversion methods between file
2449 For example, the standard LyX configuration provides three ways to convert
2450 LaTeX to PDF: Directly, using
2451 \begin_inset Flex CharStyle:MenuItem
2454 \begin_layout Plain Layout
2460 ; via (DVI and) PostScript, using
2461 \begin_inset Flex CharStyle:MenuItem
2464 \begin_layout Plain Layout
2471 \begin_inset Flex CharStyle:MenuItem
2474 \begin_layout Plain Layout
2481 To define such alternate chains, you must define multiple target `file
2482 formats', as described in section
2483 \begin_inset CommandInset ref
2485 reference "sub:Formats"
2490 For example, in the standard configuration, the formats named
2491 \begin_inset Flex CharStyle:MenuItem
2494 \begin_layout Plain Layout
2501 \begin_inset Flex CharStyle:MenuItem
2504 \begin_layout Plain Layout
2511 \begin_inset Flex CharStyle:MenuItem
2514 \begin_layout Plain Layout
2520 are defined, all of which share the extension
2521 \begin_inset Flex CharStyle:MenuItem
2524 \begin_layout Plain Layout
2530 , and which correspond to the conversion methods just mentioned.
2533 \begin_layout Chapter
2534 Internationalizing LyX
2535 \begin_inset CommandInset label
2544 \begin_layout Standard
2545 LyX supports using a translated interface.
2546 Last time we checked, LyX provided text in thirty languages.
2547 The language of choice is called your
2552 (For further reading on locale settings, see also the documentation for
2553 locale that comes with your operating system.
2554 For Linux, the manual page for
2555 \begin_inset Flex CharStyle:Code
2558 \begin_layout Plain Layout
2564 could be a good place to start).
2567 \begin_layout Standard
2568 Notice that these translations will work, but do contain a few flaws.
2569 In particular, all dialogs have been designed with the English text in
2570 mind, which means that some of the translated text will be too large to
2571 fit within the space allocated.
2572 This is only a display problem and will not cause any harm.
2573 Also, you will find that some of the translations do not define shortcut
2574 keys for everything.
2575 Sometimes, there are simply not enough free letters to do it.
2576 Other times, the translator just hasn't got around to doing it yet.
2577 Our localization team, which you may wish to join,
2581 \begin_layout Plain Layout
2582 If you are a fluent speaker of a language other than English, joining these
2583 teams is a great way to give back to the LyX community!
2588 will of course try to fix these shortcomings in future versions of LyX.
2591 \begin_layout Section
2595 \begin_layout Subsection
2596 Translating the graphical user interface (text messages).
2599 \begin_layout Standard
2601 \begin_inset Flex CharStyle:Code
2604 \begin_layout Plain Layout
2610 library to handle the internationalization of the interface.
2611 To have LyX speak your favorite language in all menus and dialogs, you
2613 \begin_inset Flex CharStyle:Code
2616 \begin_layout Plain Layout
2622 -file for that language.
2623 When this is available, you'll have to generate a
2624 \begin_inset Flex CharStyle:Code
2627 \begin_layout Plain Layout
2633 -file from it and install the
2634 \begin_inset Flex CharStyle:Code
2637 \begin_layout Plain Layout
2644 The process of doing all of this is explained in the documentation for
2646 \begin_inset Flex CharStyle:Code
2649 \begin_layout Plain Layout
2656 It is possible to do this just for yourself, but if you're going to do
2657 it, you might as well share the results of your labors with the rest of
2659 Send a message to the LyX developers' list for more information about how
2663 \begin_layout Standard
2664 In short, this is what you should do (xx denotes the language code):
2667 \begin_layout Itemize
2668 Check out the LyX source code.
2670 \begin_inset CommandInset href
2672 name "information on the web"
2673 target "http://www.lyx.org/devel/cvs.php"
2680 \begin_layout Itemize
2682 \begin_inset Flex CharStyle:Code
2685 \begin_layout Plain Layout
2691 to the folder of the
2692 \begin_inset Flex CharStyle:Code
2695 \begin_layout Plain Layout
2703 \begin_inset Flex CharStyle:Code
2706 \begin_layout Plain Layout
2714 \begin_inset Flex CharStyle:Code
2717 \begin_layout Plain Layout
2723 doesn't exist anywhere, it can be remade with the console command
2724 \begin_inset Flex CharStyle:Code
2727 \begin_layout Plain Layout
2733 in that directory, or you can use an existing po-file for some other language
2737 \begin_layout Itemize
2739 \begin_inset Flex CharStyle:Code
2742 \begin_layout Plain Layout
2752 \begin_layout Plain Layout
2753 This is just a text file, so it can be edited in any text editor.
2754 But there are also specialized programs that support such editing, such
2759 (for all platforms) or
2768 contains a `mode' for editing
2769 \begin_inset Flex CharStyle:Code
2772 \begin_layout Plain Layout
2783 For some menu- and widget-labels, there are also shortcut keys that should
2785 Those keys are marked after a `|', and should be translated according to
2786 the words and phrases of the language.
2787 You should also fill also out the information at the beginning of the new
2789 \begin_inset Flex CharStyle:Code
2792 \begin_layout Plain Layout
2798 -file with your email-address, etc., so people know where to reach you with
2799 suggestions and entertaining flames.
2802 \begin_layout Standard
2803 If you are just doing this on your own, then:
2806 \begin_layout Itemize
2808 \begin_inset Flex CharStyle:Code
2811 \begin_layout Plain Layout
2818 This can be done with
2819 \begin_inset Flex CharStyle:Code
2822 \begin_layout Plain Layout
2823 msgfmt -o xx.mo < xx.po
2831 \begin_layout Itemize
2833 \begin_inset Flex CharStyle:Code
2836 \begin_layout Plain Layout
2842 -file to your locale-tree, at the correct directory for application messages
2847 xx, and under the name
2848 \begin_inset Flex CharStyle:Code
2851 \begin_layout Plain Layout
2858 \begin_inset space \thinspace{}
2862 \begin_inset space \space{}
2866 \begin_inset Flex CharStyle:Code
2869 \begin_layout Plain Layout
2870 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2880 \begin_layout Standard
2881 As said, however, it would be best if the new
2882 \begin_inset Flex CharStyle:Code
2885 \begin_layout Plain Layout
2891 -file could be added to the LyX distribution, so others can use it.
2892 Adding it involves making additional changes to LyX.
2893 So send an email to the developers' mailing list if you're interested in
2897 \begin_layout Subsubsection
2901 \begin_layout Standard
2902 Sometimes it turns out that one English message needs to be translated into
2903 different messages in the target language.
2904 One example is the message
2905 \begin_inset Flex CharStyle:Code
2908 \begin_layout Plain Layout
2914 which has the German translation
2922 , depending upon exactly what the English
2923 \begin_inset Quotes eld
2927 \begin_inset Quotes erd
2932 \begin_inset Flex CharStyle:Code
2935 \begin_layout Plain Layout
2941 does not handle such ambiguous translations.
2942 Therefore you have to add some context information to the message: Instead
2944 \begin_inset Flex CharStyle:Code
2947 \begin_layout Plain Layout
2954 \begin_inset Flex CharStyle:Code
2957 \begin_layout Plain Layout
2958 To[[as in 'From format x to format y']]
2964 \begin_inset Flex CharStyle:Code
2967 \begin_layout Plain Layout
2968 To[[as in 'From page x to page y']].
2973 Now the two occurrences of
2974 \begin_inset Flex CharStyle:Code
2977 \begin_layout Plain Layout
2984 \begin_inset Flex CharStyle:Code
2987 \begin_layout Plain Layout
2993 and can be translated correctly to
3004 \begin_layout Standard
3005 Of course the context information needs to be stripped off the original
3006 message when no translation is used.
3007 Therefore you have to put it in double square brackets at the end of the
3008 message (see the example above).
3009 The translation mechanism of LyX ensures that everything in double square
3010 brackets at the end of messages is removed before displaying the message.
3013 \begin_layout Subsection
3014 Translating the documentation.
3017 \begin_layout Standard
3018 The online documentation (in the
3019 \begin_inset Flex CharStyle:MenuItem
3022 \begin_layout Plain Layout
3028 -menu) can (and should!) be translated.
3029 If there are translated versions of the documentation available
3033 \begin_layout Plain Layout
3034 As of March 2008, at least some of the documents have been translated into
3035 fourteen languages, with the Tutorial available in a few more.
3040 and the locale is set accordingly, these will be used automagically by
3042 LyX looks for translated versions as
3043 \begin_inset Flex CharStyle:Code
3046 \begin_layout Plain Layout
3047 LyXDir/doc/xx/DocName.lyx
3053 \begin_inset Flex CharStyle:Code
3056 \begin_layout Plain Layout
3062 is the code for the language currently in use.
3063 If there are no translated documents, the default English versions will
3065 Note that the translated versions must have the same filenames (
3066 \begin_inset Flex CharStyle:Code
3069 \begin_layout Plain Layout
3075 above) as the original.
3076 If you feel up to translating the documentation (an excellent way to proof-read
3077 the original documentation by the way!), there are a few things you should
3081 \begin_layout Itemize
3083 \begin_inset Flex CharStyle:Code
3086 \begin_layout Plain Layout
3092 , the guide to writing LyX documentation.
3093 Pay special attention to the translator's section.
3096 \begin_layout Itemize
3097 Check out the documentation translation web page at
3098 \begin_inset CommandInset href
3100 name "http://www.lyx.org/Translation"
3101 target "http://www.lyx.org/Translation"
3106 That way, you can find out which (if any) documents have already been translate
3107 d into your language.
3108 You can also find out who (if anyone) is organizing the effort to translate
3109 the documentation into your language.
3110 If no one is organizing the effort, please let us know that you're interested.
3113 \begin_layout Standard
3114 Once you get to actually translating, here's a few hints for you that may
3118 \begin_layout Itemize
3119 Join the documentation team! There is information on how to do that in
3120 \begin_inset Flex CharStyle:Code
3123 \begin_layout Plain Layout
3130 \begin_inset Flex CharStyle:MenuItem
3133 \begin_layout Plain Layout
3134 Help\SpecialChar \menuseparator
3144 ), which by the way is the first document you should translate.
3147 \begin_layout Itemize
3148 Learn the typographic conventions for the language you are translating to.
3149 Typography is an ancient art and over the centuries, a great variety of
3150 conventions have developed throughout different parts of the world.
3151 Also study the professional terminology amongst typographers in your country.
3152 Inventing your own terminology will only confuse the users.
3155 (Warning! Typography is addictive!)
3158 \begin_layout Itemize
3159 Make a copy of the document.
3160 This will be your working copy.
3161 You can use this as your personal translated help-file by placing it in
3163 \begin_inset Flex CharStyle:Code
3166 \begin_layout Plain Layout
3175 \begin_layout Itemize
3176 Sometimes the original document (from the LyX-team) will be updated.
3177 Use the source viewer at
3178 \begin_inset CommandInset href
3180 name "http://www.lyx.org/trac/timeline"
3181 target "http://www.lyx.org/trac/timeline"
3185 to see what has been changed.
3186 That way you can easily see which parts of the translated document need
3190 \begin_layout Standard
3191 If you ever find an error in the original document, fix it and notify the
3192 rest of the documentation team of the changes! (You didn't forget to join
3193 the documentation team, did you?)
3196 \begin_layout Standard
3197 \begin_inset Branch OutDated
3200 \begin_layout Section
3201 International Keyboard Support
3204 \begin_layout Standard
3207 [Editor's Note: The following section is by
3215 It needs to be fixed to conform to the new Documentation Style sheet and
3216 to make use of the new v1.0 features.
3217 The whole thing also needs to be merged with the section following it.-jw
3218 It may also be badly out of date.-rh (2008)]
3221 \begin_layout Subsection
3222 Defining Own Keymaps: Keymap File Format
3225 \begin_layout Standard
3226 Let's look at a keyboard definition file a little closer.
3227 It is a plain text file defining
3230 \begin_layout Itemize
3231 key-to-key or key-to-string translations
3234 \begin_layout Itemize
3238 \begin_layout Itemize
3239 dead keys exceptions
3242 \begin_layout Standard
3243 To define key-to-key or key-to-string translation, use this command:
3246 \begin_layout Quotation
3247 \begin_inset Flex CharStyle:Code
3250 \begin_layout Plain Layout
3259 \begin_inset Flex CharStyle:Code
3262 \begin_layout Plain Layout
3271 \begin_layout Standard
3273 \begin_inset Flex CharStyle:Code
3276 \begin_layout Plain Layout
3282 is the key to be translated and
3283 \begin_inset Flex CharStyle:Code
3286 \begin_layout Plain Layout
3292 is the string to be inserted into the document.
3293 To define dead keys, use:
3296 \begin_layout Quotation
3297 \begin_inset Flex CharStyle:Code
3300 \begin_layout Plain Layout
3309 \begin_inset Flex CharStyle:Code
3312 \begin_layout Plain Layout
3321 \begin_layout Standard
3323 \begin_inset Flex CharStyle:Code
3326 \begin_layout Plain Layout
3332 is a keyboard key and
3333 \begin_inset Flex CharStyle:Code
3336 \begin_layout Plain Layout
3343 The following dead keys are supported (shortcut name is in parentheses):
3346 \begin_layout Quotation
3350 \begin_inset space \hfill{}
3356 \begin_layout Quotation
3358 \begin_inset space \hfill{}
3364 \begin_layout Quotation
3366 \begin_inset space \hfill{}
3372 \begin_layout Quotation
3374 \begin_inset space \hfill{}
3380 \begin_layout Quotation
3382 \begin_inset space \hfill{}
3388 \begin_layout Quotation
3390 \begin_inset space \hfill{}
3397 \begin_layout Plain Layout
3409 \begin_layout Quotation
3411 \begin_inset space \hfill{}
3417 \begin_layout Quotation
3419 \begin_inset space \hfill{}
3426 \begin_layout Plain Layout
3438 \begin_layout Quotation
3440 \begin_inset space \hfill{}
3446 \begin_layout Quotation
3448 \begin_inset space \hfill{}
3454 \begin_layout Quotation
3456 \begin_inset space \hfill{}
3463 \begin_layout Plain Layout
3475 \begin_layout Quotation
3477 \begin_inset space \hfill{}
3484 \begin_layout Plain Layout
3496 \begin_layout Quotation
3498 \begin_inset space \hfill{}
3504 \begin_layout Quotation
3505 hungarian umlaut (hug)
3506 \begin_inset space \hfill{}
3512 \begin_layout Quotation
3514 \begin_inset space \hfill{}
3520 \begin_layout Quotation
3522 \begin_inset space \hfill{}
3529 \begin_layout Plain Layout
3541 \begin_layout Standard
3542 Since in many international keyboards there are exceptions to what some
3543 dead keys should do, you can define them using
3546 \begin_layout Quotation
3547 \begin_inset Flex CharStyle:Code
3550 \begin_layout Plain Layout
3558 deadkey key outstring
3561 \begin_layout Standard
3562 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3566 \begin_layout Quotation
3567 \begin_inset Flex CharStyle:Code
3570 \begin_layout Plain Layout
3583 \begin_layout Standard
3584 to make it work correctly.
3585 Also, you have to define as exceptions dead keys over i and j, to remove
3586 the dot from them before inserting an accent mark.
3587 I will change this when the time comes, but so far I haven't had time.
3590 \begin_layout Standard
3591 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3594 \begin_inset Flex CharStyle:Code
3597 \begin_layout Plain Layout
3603 have different meaning.
3605 \begin_inset Flex CharStyle:Code
3608 \begin_layout Plain Layout
3614 marks comments, quotes start and end LaTeX-style commands.
3615 To enter quote, you'll need to use
3616 \begin_inset Flex CharStyle:Code
3619 \begin_layout Plain Layout
3628 \begin_inset Flex CharStyle:Code
3631 \begin_layout Plain Layout
3638 \begin_inset Flex CharStyle:Code
3641 \begin_layout Plain Layout
3652 \begin_layout Standard
3653 If you make a keyboard description file that works for your language, please
3654 mail it to me, so I can include it in the next keymap distribution.
3657 \begin_layout Standard
3658 More keywords will be supported in keymap configuration file in future,
3662 \begin_layout Itemize
3663 \begin_inset Flex CharStyle:Code
3666 \begin_layout Plain Layout
3677 \begin_inset space \hfill{}
3681 \begin_inset Flex CharStyle:Code
3684 \begin_layout Plain Layout
3693 \begin_layout Itemize
3694 \begin_inset Flex CharStyle:Code
3697 \begin_layout Plain Layout
3708 \begin_inset space \hfill{}
3712 \begin_inset Flex CharStyle:Code
3715 \begin_layout Plain Layout
3721 an external keymap translation program
3724 \begin_layout Standard
3725 Also, it should look into
3726 \begin_inset Flex CharStyle:Code
3729 \begin_layout Plain Layout
3735 file for defaults, too (for example, a
3736 \begin_inset Flex CharStyle:Code
3739 \begin_layout Plain Layout
3747 option to include default keyboard).
3755 \begin_layout Section
3756 \begin_inset CommandInset label
3762 International Keymap Stuff
3765 \begin_layout Standard
3766 \begin_inset Note Note
3769 \begin_layout Plain Layout
3770 In doing the revisions on this document in March 2008, I did not look over
3771 this stuff, as I do not understand it.
3772 It would be good if someone else could do so.
3780 \begin_layout Standard
3781 The next two sections describe the
3782 \begin_inset Flex CharStyle:Code
3785 \begin_layout Plain Layout
3794 \begin_inset Flex CharStyle:Code
3797 \begin_layout Plain Layout
3805 file syntax in detail.
3806 These sections should help you design your own key map if the ones provided
3807 do not meet your needs.
3810 \begin_layout Subsection
3814 \begin_layout Standard
3818 \begin_inset Flex CharStyle:Code
3821 \begin_layout Plain Layout
3827 file maps keystrokes to characters or strings.
3828 As the name suggests, it sets a keyboard mapping.
3830 \begin_inset Flex CharStyle:Code
3833 \begin_layout Plain Layout
3844 \begin_inset Flex CharStyle:Code
3847 \begin_layout Plain Layout
3862 \begin_inset Flex CharStyle:Code
3865 \begin_layout Plain Layout
3878 \begin_inset Flex CharStyle:Code
3881 \begin_layout Plain Layout
3890 \begin_inset Flex CharStyle:Code
3893 \begin_layout Plain Layout
3901 are described in this section.
3904 \begin_layout Labeling
3905 \labelwidthstring 00.00.0000
3906 \begin_inset Flex CharStyle:Code
3909 \begin_layout Plain Layout
3917 Map a character to a string
3920 \begin_layout LyX-Code
3935 \begin_layout Standard
3968 the double-quote (")
3985 must be escaped with a preceding backslash (
3996 \begin_layout Standard
3998 \begin_inset Flex CharStyle:MenuItem
4001 \begin_layout Plain Layout
4009 statement to cause the symbol
4010 \begin_inset Flex CharStyle:MenuItem
4013 \begin_layout Plain Layout
4021 to be output for the keystroke
4022 \begin_inset Flex CharStyle:MenuItem
4025 \begin_layout Plain Layout
4036 \begin_layout LyX-Code
4042 \begin_layout Labeling
4043 \labelwidthstring 00.00.0000
4044 \begin_inset Flex CharStyle:Code
4047 \begin_layout Plain Layout
4055 Specify an accent character
4058 \begin_layout LyX-Code
4067 \begin_layout Standard
4068 This will make the cha
4106 This is the dead key
4110 \begin_layout Plain Layout
4117 refers to a key that does not produce a character by itself, but when followed
4118 with another key, produces the desired accent character.
4119 For example, a German characte
4121 r with an umlaut like
4131 can be produced in this manner.
4140 \begin_layout Standard
4153 and then another key not in
4170 followed by the other, not allowed key, as output.
4174 \begin_inset Flex CharStyle:MenuItem
4177 \begin_layout Plain Layout
4185 cancels a dead key, so if
4196 \begin_inset Flex CharStyle:MenuItem
4199 \begin_layout Plain Layout
4208 , the cursor will not go one position backwards but will instead cancel
4224 might have had on the next keystroke.
4228 \begin_layout Standard
4229 The following example specifies that the character ' is to be an acute accent,
4230 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4233 \begin_layout LyX-Code
4236 kmod ' acute aeiouAEIOU
4239 \begin_layout Labeling
4240 \labelwidthstring 00.00.0000
4241 \begin_inset Flex CharStyle:Code
4244 \begin_layout Plain Layout
4250 Specify an exception to the accent character
4253 \begin_layout LyX-Code
4262 \begin_layout Standard
4263 This defines an exce
4304 have been assigned a keystroke with a previous
4307 \begin_inset Flex CharStyle:Code
4310 \begin_layout Plain Layout
4334 must not belong in the
4381 If such a declaration does not exist in
4389 \begin_inset Flex CharStyle:Code
4392 \begin_layout Plain Layout
4426 \begin_inset Flex CharStyle:Code
4429 \begin_layout Plain Layout
4443 \begin_layout Standard
4444 The following command produces causes äi to be produced when you enter acute-i
4448 \begin_layout LyX-Code
4462 \begin_layout Labeling
4463 \labelwidthstring 00.00.0000
4464 \begin_inset Flex CharStyle:Code
4467 \begin_layout Plain Layout
4473 Combine two accent characters
4476 \begin_layout LyX-Code
4482 accent1 accent2 allowed
4485 \begin_layout Standard
4486 This one is getting pretty esoteric.
4487 It allows you to combine the effect
4543 \begin_inset Flex CharStyle:Code
4546 \begin_layout Plain Layout
4574 \begin_layout Standard
4575 Consider this example from the
4576 \begin_inset Flex CharStyle:Code
4579 \begin_layout Plain Layout
4590 \begin_layout LyX-Code
4593 kmod ; acute aeioyvhAEIOYVH
4597 kcomb acute umlaut iyIY
4600 \begin_layout Standard
4601 This allows you to press
4602 \begin_inset Flex CharStyle:MenuItem
4605 \begin_layout Plain Layout
4613 and get the effect of
4614 \begin_inset Flex CharStyle:Code
4617 \begin_layout Plain Layout
4636 in this case cancels the last dead key, so if you press
4637 \begin_inset Flex CharStyle:MenuItem
4640 \begin_layout Plain Layout
4649 \begin_inset Flex CharStyle:Code
4652 \begin_layout Plain Layout
4665 \begin_layout Subsection
4669 \begin_layout Standard
4671 \begin_inset Flex CharStyle:Code
4674 \begin_layout Plain Layout
4682 mapping is performed, a
4683 \begin_inset Flex CharStyle:Code
4686 \begin_layout Plain Layout
4696 file maps the strings that the symbols generate to characters in the current
4698 The LyX distribution currently includes at least the
4699 \begin_inset Flex CharStyle:Code
4702 \begin_layout Plain Layout
4711 \begin_inset Flex CharStyle:Code
4714 \begin_layout Plain Layout
4725 \begin_layout Standard
4727 \begin_inset Flex CharStyle:Code
4730 \begin_layout Plain Layout
4738 file is a sequence of declarations of the form
4741 \begin_layout LyX-Code
4754 \begin_layout Standard
4755 For example, in order to map
4756 \begin_inset Flex CharStyle:MenuItem
4759 \begin_layout Plain Layout
4769 to the corresponding character in the iso-8859-1 set (233), the following
4773 \begin_layout LyX-Code
4781 \begin_layout Standard
4783 \begin_inset Flex CharStyle:Code
4786 \begin_layout Plain Layout
4795 \begin_inset Flex CharStyle:Code
4798 \begin_layout Plain Layout
4816 the same character can apply to more than one string.
4818 \begin_inset Flex CharStyle:Code
4821 \begin_layout Plain Layout
4832 \begin_layout LyX-Code
4844 \begin_inset Newline newline
4860 \begin_layout Standard
4861 If LyX cannot find a mapping for the string produced by the keystroke or
4862 a deadkey sequence, it will check if it looks like an accented char and
4863 try to draw an accent over the character on screen.
4866 \begin_layout Subsection
4870 \begin_layout Standard
4871 There is a second way to add support for international characters through
4872 so-called dead-keys.
4873 A dead-key works in combination with a letter to produce an accented character.
4874 Here, we'll explain how to create a really simple dead-key to illustrate
4878 \begin_layout Standard
4879 Suppose you happen to need the circumflex character,
4880 \begin_inset Quotes eld
4884 \begin_inset Quotes erd
4889 \begin_inset Flex CharStyle:MenuItem
4892 \begin_layout Plain Layout
4899 \begin_inset space ~
4903 \begin_inset Flex CharStyle:MenuItem
4906 \begin_layout Plain Layout
4912 ] to the LyX command
4913 \begin_inset Flex CharStyle:Code
4916 \begin_layout Plain Layout
4923 \begin_inset Flex CharStyle:Code
4926 \begin_layout Plain Layout
4933 Now, whenever you type the
4934 \begin_inset Flex CharStyle:MenuItem
4937 \begin_layout Plain Layout
4943 -key followed by a letter, that letter will have a circumflex accent on
4945 For example, the sequence
4946 \begin_inset Quotes eld
4950 \begin_inset Flex CharStyle:MenuItem
4953 \begin_layout Plain Layout
4960 \begin_inset Quotes erd
4963 produces the letter:
4964 \begin_inset Quotes eld
4968 \begin_inset Quotes erd
4972 If you tried to type
4973 \begin_inset Quotes eld
4977 \begin_inset Flex CharStyle:MenuItem
4980 \begin_layout Plain Layout
4987 \begin_inset Quotes erd
4990 , however, LyX will complain with a beep, since a
4991 \begin_inset Quotes eld
4995 \begin_inset Flex CharStyle:MenuItem
4998 \begin_layout Plain Layout
5005 \begin_inset Quotes erd
5008 never takes a circumflex accent.
5010 \begin_inset Flex CharStyle:MenuItem
5013 \begin_layout Plain Layout
5019 after a dead-key produces the bare-accent.
5020 Please note this last point! If you bind a key to a dead-key, you'll need
5021 to rebind the character on that key to yet another key.
5023 \begin_inset Flex CharStyle:MenuItem
5026 \begin_layout Plain Layout
5032 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5035 \begin_layout Standard
5036 One common way to bind dead-keys is to use
5037 \begin_inset Flex CharStyle:MenuItem
5040 \begin_layout Plain Layout
5047 \begin_inset Flex CharStyle:MenuItem
5050 \begin_layout Plain Layout
5057 \begin_inset Flex CharStyle:MenuItem
5060 \begin_layout Plain Layout
5066 in combination with an accent, like
5067 \begin_inset Quotes eld
5071 \begin_inset Flex CharStyle:MenuItem
5074 \begin_layout Plain Layout
5081 \begin_inset Quotes erd
5085 \begin_inset Quotes eld
5089 \begin_inset Flex CharStyle:MenuItem
5092 \begin_layout Plain Layout
5099 \begin_inset Quotes erd
5103 \begin_inset Quotes eld
5107 \begin_inset Flex CharStyle:MenuItem
5110 \begin_layout Plain Layout
5117 \begin_inset Quotes erd
5121 Another way involves using
5122 \begin_inset Flex CharStyle:Code
5125 \begin_layout Plain Layout
5132 \begin_inset Flex CharStyle:Code
5135 \begin_layout Plain Layout
5141 to set up the special
5142 \begin_inset Flex CharStyle:Code
5145 \begin_layout Plain Layout
5153 \begin_inset Flex CharStyle:Code
5156 \begin_layout Plain Layout
5162 acts in some ways just like
5163 \begin_inset Flex CharStyle:MenuItem
5166 \begin_layout Plain Layout
5172 and permits you to bind keys to accented characters.
5173 You can also turn keys into dead-keys by binding them to something like
5175 \begin_inset Flex CharStyle:Code
5178 \begin_layout Plain Layout
5184 and then binding this symbolic key to the corresponding LyX command.
5188 \begin_layout Plain Layout
5193 : This is exactly what I do in my
5194 \begin_inset Flex CharStyle:Code
5197 \begin_layout Plain Layout
5204 \begin_inset Flex CharStyle:Code
5207 \begin_layout Plain Layout
5215 \begin_inset Flex CharStyle:MenuItem
5218 \begin_layout Plain Layout
5220 \begin_inset space ~
5229 \begin_inset Flex CharStyle:Code
5232 \begin_layout Plain Layout
5238 and a bunch of these
5239 \begin_inset Quotes eld
5243 \begin_inset Flex CharStyle:Code
5246 \begin_layout Plain Layout
5253 \begin_inset Quotes erd
5256 symbolic keys bound such things as
5257 \begin_inset Flex CharStyle:MenuItem
5260 \begin_layout Plain Layout
5262 \begin_inset space ~
5271 \begin_inset Flex CharStyle:MenuItem
5274 \begin_layout Plain Layout
5276 \begin_inset space ~
5285 This is how I produce my accented characters.
5290 You can make just about anything into the
5291 \begin_inset Flex CharStyle:Code
5294 \begin_layout Plain Layout
5301 \begin_inset Flex CharStyle:MenuItem
5304 \begin_layout Plain Layout
5310 keys, a spare function key, etc.
5311 As for the LyX commands that produce accents, check the entry for
5312 \begin_inset Flex CharStyle:Code
5315 \begin_layout Plain Layout
5326 You'll find the complete list there.
5329 \begin_layout Subsection
5330 Saving your Language Configuration
5333 \begin_layout Standard
5334 You can edit your preferences so that your desired language environment
5335 is automatically configured when LyX starts up, via the
5336 \begin_inset Flex CharStyle:MenuItem
5339 \begin_layout Plain Layout
5340 Edit\SpecialChar \menuseparator
5349 \begin_layout Chapter
5350 Installing New Document Classes, Layouts, and Templates
5351 \begin_inset CommandInset label
5353 name "chap:textclass"
5361 \begin_layout Plain Layout
5362 Installing New Document Classes
5370 \begin_layout Standard
5371 In this chapter, we describe the procedures for creating and installing
5372 new LyX layout and template files, as well as offer a refresher on correctly
5373 installing new LaTeX document classes.
5374 Some definitions: a document class is a LaTeX file (usually ending in
5375 \begin_inset Flex CharStyle:Code
5378 \begin_layout Plain Layout
5385 \begin_inset Flex CharStyle:Code
5388 \begin_layout Plain Layout
5394 ) that describes the format of a document such as an article, report, journal
5395 preprint, etc, and all the commands needed to realize that format.
5396 A layout file is a LyX file that corresponds to a LaTeX document class
5397 and that tells LyX how to
5398 \begin_inset Quotes eld
5402 \begin_inset Quotes erd
5405 things on the screen to make the display look something like the final
5407 More precisely, a layout file describes a
5408 \begin_inset Quotes eld
5412 \begin_inset Quotes erd
5415 which is the internal construct LyX uses to render the screen display.
5417 \begin_inset Quotes eld
5421 \begin_inset Quotes erd
5425 \begin_inset Quotes eld
5429 \begin_inset Quotes erd
5432 can be used somewhat interchangeably, but it is better to refer to the
5433 file as the layout, and the thing living in LyX's memory as the text class.
5434 A template file is simply a LyX document that contains a set of predefined
5435 entries for a given document class---entries that are generally required
5437 Templates are especially useful for things like journal manuscripts that
5438 are to be submitted electronically.
5441 \begin_layout Section
5442 Installing a new LaTeX package
5445 \begin_layout Standard
5446 Some installations may not include a LaTeX package that you would like to
5448 For example, you might need FoilTeX, a package for preparing slides or
5449 viewgraphs for overhead projectors.
5450 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5451 a user interface for that.
5452 For example on MiKTeX you start its program
5453 \begin_inset Quotes eld
5457 \begin_inset Quotes erd
5460 to get a list of available packages.
5461 To install one, right click on it or use the installing toolbar button.
5462 When the package you want to install is not in the list, but you have it
5464 \begin_inset Flex CharStyle:Code
5467 \begin_layout Plain Layout
5474 \begin_inset Flex CharStyle:Code
5477 \begin_layout Plain Layout
5483 -file, then copy these files to a subfolder of your LaTeX distribution,
5484 for example to the folder
5493 Then update the file name database of your LaTeX-distribution.
5494 For example on MiKTeX this is done by pressing the button
5497 \begin_inset space ~
5502 that you find in MiKTeX's
5503 \begin_inset Quotes eld
5507 \begin_inset Quotes erd
5511 In both cases you need afterwards to reconfigure LyX using the menu
5512 \begin_inset Flex CharStyle:MenuItem
5515 \begin_layout Plain Layout
5516 Tools\SpecialChar \menuseparator
5522 and then to restart LyX.
5525 \begin_layout Standard
5526 If your LaTeX distribution doesn't provide a user interface, then you can
5527 follow these steps by using a UNIX/Linux console.
5530 \begin_layout Enumerate
5531 Get the package from
5532 \begin_inset CommandInset href
5535 target "http://www.ctan.org/"
5542 \begin_layout Enumerate
5543 You can install this package in several different places.
5544 If you want it to be available for all users on your system, then you should
5545 install it in your `local' TeX tree; if you want (or need) it to be available
5546 just for you, then you can install it in your own `user' TeX tree.
5547 Where these should be created, if they do not already exist, depends upon
5548 the details of your system.
5549 To find out, look in the file
5550 \begin_inset Flex CharStyle:Code
5553 \begin_layout Plain Layout
5563 \begin_layout Plain Layout
5564 This usually lives in the directory
5565 \begin_inset Flex CharStyle:Code
5568 \begin_layout Plain Layout
5574 , though you can run
5575 \begin_inset Flex CharStyle:Code
5578 \begin_layout Plain Layout
5589 The location of the `local' TeX tree is defined by
5590 \begin_inset Flex CharStyle:Code
5593 \begin_layout Plain Layout
5599 ; this is usually somewhere like
5600 \begin_inset Flex CharStyle:Code
5603 \begin_layout Plain Layout
5604 /usr/local/share/texmf/
5610 The `user' TeX tree is defined by
5611 \begin_inset Flex CharStyle:Code
5614 \begin_layout Plain Layout
5621 \begin_inset Flex CharStyle:Code
5624 \begin_layout Plain Layout
5631 (If these variables are not predefined, you can define them.) You'll probably
5632 need root permissions to create or modify the `local' tree; but your `user'
5633 tree shouldn't have such limitations.
5636 \begin_layout Enumerate
5638 \begin_inset Flex CharStyle:Code
5641 \begin_layout Plain Layout
5648 \begin_inset Flex CharStyle:Code
5651 \begin_layout Plain Layout
5658 \begin_inset Flex CharStyle:Code
5661 \begin_layout Plain Layout
5668 \begin_inset space \thinspace{}
5672 \begin_inset Newline newline
5676 \begin_inset Flex CharStyle:Code
5679 \begin_layout Plain Layout
5680 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5686 \begin_inset Newline newline
5689 But, again, most of this will
5690 \begin_inset Quotes eld
5694 \begin_inset Quotes erd
5700 \begin_layout Enumerate
5705 \begin_layout Plain Layout
5706 We'll assume henceforth that you're defining `local' TeX tree.
5707 If you're defining a user tree, just adjust as necessary.
5713 You must follow the directory structure of your existing
5714 \begin_inset Flex CharStyle:Code
5717 \begin_layout Plain Layout
5723 directory, which will be found at
5724 \begin_inset Flex CharStyle:Code
5727 \begin_layout Plain Layout
5734 For example, latex packages should go under
5735 \begin_inset Flex CharStyle:Code
5738 \begin_layout Plain Layout
5739 $TEXMFLOCAL/tex/latex/
5747 \begin_layout Enumerate
5748 Install the package.
5749 For example, you would unpack the FoilTeX tarball and copy it to
5750 \begin_inset Flex CharStyle:Code
5753 \begin_layout Plain Layout
5754 $TEXMFLOCAL/tex/latex/foiltex
5761 \begin_inset Flex CharStyle:Code
5764 \begin_layout Plain Layout
5770 directory contains various files.
5773 \begin_layout Enumerate
5775 \begin_inset Flex CharStyle:Code
5778 \begin_layout Plain Layout
5786 \begin_inset Flex CharStyle:Code
5789 \begin_layout Plain Layout
5798 \begin_layout Standard
5799 Your package is now installed and available to LaTeX.
5800 To make it available to LyX, you need to create a Layout file, if one is
5801 not already available.
5802 (See the next section.) Once you have a layout file, you need only reconfigure
5804 \begin_inset Flex CharStyle:MenuItem
5807 \begin_layout Plain Layout
5808 Tools\SpecialChar \menuseparator
5814 ) and then restart LyX.
5815 You should then see your new package---for example
5816 \begin_inset Flex CharStyle:MenuItem
5819 \begin_layout Plain Layout
5826 \begin_inset Flex CharStyle:MenuItem
5829 \begin_layout Plain Layout
5830 Document\SpecialChar \menuseparator
5837 \begin_inset Flex CharStyle:MenuItem
5840 \begin_layout Plain Layout
5850 \begin_layout Section
5854 \begin_layout Standard
5855 This section describes how to write and install your own LyX layout files
5856 and walks through the
5857 \begin_inset Flex CharStyle:Code
5860 \begin_layout Plain Layout
5866 text class format as an example.
5868 \begin_inset Flex CharStyle:Code
5871 \begin_layout Plain Layout
5877 files describe what paragraph and character styles are available for a
5878 given document class and how LyX should display them.
5879 We try to provide a thorough description of the process here; however,
5880 there are so many different types of documents supported by LaTeX classes
5881 that we can't hope to cover every different possibility or problem you
5883 (The LyX users' list is frequented by people with lots of experience with
5884 layout design who are willing to share what they've learned.)
5887 \begin_layout Standard
5888 As you prepare to write a new layout, it is extremely helpful to look at
5889 the example layouts distributed with LyX.
5890 If you use a nice LaTeX document class that might be of interest for others,
5891 too, and have a nice corresponding LyX layout, feel free to contribute
5892 the stuff to us, so we may put it into the distribution.
5894 \begin_inset CommandInset href
5896 name "section on the LyX wiki"
5897 target "http://wiki.lyx.org/Layouts/Layouts"
5901 for this kind of material.
5904 \begin_layout Standard
5905 All the tags described in this chapter are case-insensitive; this means
5907 \begin_inset Flex CharStyle:Code
5910 \begin_layout Plain Layout
5917 \begin_inset Flex CharStyle:Code
5920 \begin_layout Plain Layout
5927 \begin_inset Flex CharStyle:Code
5930 \begin_layout Plain Layout
5936 are really the same command.
5937 The possible values are printed in brackets after the feature's name.
5938 The default value if a feature isn't specified inside a text class-description
5940 \begin_inset Flex CharStyle:Code
5943 \begin_layout Plain Layout
5952 If the argument has a data type like
5953 \begin_inset Quotes eld
5957 \begin_inset Quotes erd
5961 \begin_inset Quotes eld
5965 \begin_inset Quotes erd
5968 , the default is shown like this:
5969 \begin_inset Flex CharStyle:Code
5972 \begin_layout Plain Layout
5983 \begin_layout Subsection
5984 \begin_inset CommandInset label
5986 name "sub:Layout-modules"
5993 \begin_layout Standard
5994 Similar to layout files, and new with LyX 1.6, are layout
5999 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6000 some modules---such as the endnotes module---provide support for just such
6002 In a sense, layout modules are similar to included files---files like
6003 \begin_inset Flex CharStyle:Code
6006 \begin_layout Plain Layout
6012 ---in that modules are not specific to a given document layout but may be
6013 used with many different layouts.
6014 The difference is that using a layout module does not require editing the
6016 Rather, modules are selected in the
6017 \begin_inset Flex CharStyle:MenuItem
6020 \begin_layout Plain Layout
6021 Document\SpecialChar \menuseparator
6030 \begin_layout Standard
6031 Building modules is the easiest way to get started with layout editing,
6032 since it can be as simple as adding a single new paragraph or flex inset.
6033 But modules may, in principle, contain anything a layout file can contain.
6036 \begin_layout Standard
6037 A module must begin with a line like the following:
6040 \begin_layout LyX-Code
6043 DeclareLyXModule[endnotes.sty]{Endnotes}
6046 \begin_layout Standard
6047 The argument in square brackets is optional: It declares any LaTeX packages
6048 on which the module depends.
6049 The mandatory argument, in curly brackets, is the name of the module, as
6051 \begin_inset Flex CharStyle:MenuItem
6054 \begin_layout Plain Layout
6055 Document\SpecialChar \menuseparator
6065 \begin_layout Standard
6066 The module declaration should then be followed by lines like the following:
6069 \begin_layout LyX-Code
6073 \begin_layout LyX-Code
6074 #Adds an endnote command, in addition to footnotes.
6078 \begin_layout LyX-Code
6079 #You will need to add
6081 theendnotes in TeX code where you
6084 \begin_layout LyX-Code
6085 #want the endnotes to appear.
6089 \begin_layout LyX-Code
6093 \begin_layout LyX-Code
6094 #Requires: somemodule | othermodule
6097 \begin_layout LyX-Code
6098 #Excludes: badmodule
6101 \begin_layout Standard
6102 The description is used in
6103 \begin_inset Flex CharStyle:MenuItem
6106 \begin_layout Plain Layout
6107 Document\SpecialChar \menuseparator
6113 to provide the user with information about what the module does.
6115 \begin_inset Flex CharStyle:Code
6118 \begin_layout Plain Layout
6124 line is used to identify other modules with which this one must be used;
6126 \begin_inset Flex CharStyle:Code
6129 \begin_layout Plain Layout
6135 line is used to identify modules with which this one may not be used.
6136 Both are optional, and, as shown, multiple modules should be separated
6137 with the pipe symbol: |.
6138 Note that the required modules are treated disjunctively:
6142 of the required modules must be used.
6147 excluded module may be used.
6148 Note that modules are identified here by their
6152 without the .module extension.
6154 \begin_inset Flex CharStyle:Code
6157 \begin_layout Plain Layout
6164 \begin_inset Flex CharStyle:Code
6167 \begin_layout Plain Layout
6176 \begin_layout Standard
6177 After creating a new module, you will need to reconfigure and then restart
6178 LyX for the module to appear in the menu.
6179 However, changes you make to the module will be seen immediately, if you
6181 \begin_inset Flex CharStyle:MenuItem
6184 \begin_layout Plain Layout
6185 Document\SpecialChar \menuseparator
6191 , highlight something, and then hit
6192 \begin_inset Quotes eld
6196 \begin_inset Quotes erd
6202 It is strongly recommended that you save your work before doing so
6207 it is strongly recommended that you not attempt to edit modules while simultaneo
6208 usly working on documents
6211 Though of course the developers strive to keep LyX stable in such situations,
6212 syntax errors and the like in your module file could cause strange behavior.
6215 \begin_layout Subsection
6216 Supporting new document classes
6219 \begin_layout Standard
6220 There are two situations you are likely to encounter when wanting to support
6221 a new LaTeX document class, involving LaTeX2e class (
6222 \begin_inset Flex CharStyle:Code
6225 \begin_layout Plain Layout
6232 \begin_inset Flex CharStyle:Code
6235 \begin_layout Plain Layout
6242 Supporting a style file is usually fairly easy.
6243 Supporting a new document class is a bit harder.
6246 \begin_layout Subsection
6248 \begin_inset Flex CharStyle:MenuItem
6251 \begin_layout Plain Layout
6260 \begin_layout Standard
6261 If your new document class is provided as a style file that is used in conjuncti
6262 on with an existing, supported document class---for the sake of the example,
6263 we'll assume that the style file is called
6264 \begin_inset Flex CharStyle:MenuItem
6267 \begin_layout Plain Layout
6273 and it is meant to be used with
6274 \begin_inset Flex CharStyle:MenuItem
6277 \begin_layout Plain Layout
6283 , which is a standard class---start by copying the existing class's layout
6284 file into your local directory:
6287 \begin_layout LyX-Code
6288 cp report.layout ~/.lyx/layouts/myclass.layout
6291 \begin_layout Standard
6293 \begin_inset Flex CharStyle:Code
6296 \begin_layout Plain Layout
6302 and change the line:
6305 \begin_layout LyX-Code
6308 DeclareLaTeXClass{report}
6311 \begin_layout Standard
6315 \begin_layout LyX-Code
6318 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6321 \begin_layout Standard
6325 \begin_layout LyX-Code
6327 \begin_inset Newline newline
6333 \begin_inset Newline newline
6339 \begin_layout Standard
6340 near the top of the file.
6343 \begin_layout Standard
6344 Start LyX and select
6345 \begin_inset Flex CharStyle:MenuItem
6348 \begin_layout Plain Layout
6349 Tools\SpecialChar \menuseparator
6356 Then restart LyX and try creating a new document.
6358 \begin_inset Flex CharStyle:MenuItem
6361 \begin_layout Plain Layout
6367 " as a document class option in the
6368 \begin_inset Flex CharStyle:MenuItem
6371 \begin_layout Plain Layout
6372 Document\SpecialChar \menuseparator
6379 It is likely that some of the sectioning commands and such in your new
6380 class will work differently from how they worked in the base class---
6381 \begin_inset Flex CharStyle:Code
6384 \begin_layout Plain Layout
6390 in this example---so you can fiddle around with the settings for the different
6391 sections if you wish.
6394 \begin_layout Subsection
6396 \begin_inset Flex CharStyle:MenuItem
6399 \begin_layout Plain Layout
6408 \begin_layout Standard
6409 There are two possibilities here.
6410 One is that the class file is itself based upon an existing document class.
6411 For example, many thesis classes are based upon
6412 \begin_inset Flex CharStyle:MenuItem
6415 \begin_layout Plain Layout
6422 To see whether yours is, look for a line like
6425 \begin_layout LyX-Code
6431 \begin_layout Standard
6433 If so, then you may proceed largely as in the previous section, though
6434 the DeclareLaTeXClass line will be different.
6435 If your new class is thesis, and it is based upon book, then the line should
6440 \begin_layout Plain Layout
6441 And it will be easiest if you save the file to
6442 \begin_inset Flex CharStyle:Code
6445 \begin_layout Plain Layout
6451 : LyX assumes that the document class has the same name as the layout file.
6460 \begin_layout LyX-Code
6463 DeclareLaTeXClass[thesis,book]{thesis}
6466 \begin_layout Standard
6467 If, on the other hand, the new class is not based upon an existing class,
6468 you will probably have to
6469 \begin_inset Quotes eld
6473 \begin_inset Quotes erd
6477 We strongly suggest copying an existing layout file which uses a similar
6478 LaTeX class and then modifying it, if you can do so.
6479 At least use an existing file as a starting point so you can find out what
6480 items you need to worry about.
6481 Again, the specifics are covered below.
6484 \begin_layout Section
6485 Declaring a new text class
6488 \begin_layout Standard
6489 When it's finally time to get your hands dirty and create or edit your own
6490 layout file, the following sections describe what you're up against.
6491 Our advice is to go slowly, save and test often, listen to soothing music,
6492 and enjoy one or two of your favorite adult beverages; more if you are
6493 getting particularly stuck.
6494 It's really not that hard, except that the multitude of options can become
6495 overwhelming if you try to do to much in one sitting.
6496 Go have another adult beverage, just for good measure.
6499 \begin_layout Standard
6503 \begin_layout Standard
6504 Lines in a layout file which begin with a
6505 \begin_inset Flex CharStyle:Code
6508 \begin_layout Plain Layout
6515 There is one exception to this rule: all layouts should begin with lines
6519 \begin_layout LyX-Code
6522 #% Do not delete the line below; configure depends on this
6525 \begin_layout LyX-Code
6530 DeclareLaTeXClass{article}
6533 \begin_layout Standard
6534 The second line is used when you configure LyX.
6535 The layout file is read by the LaTeX script
6536 \begin_inset Flex CharStyle:Code
6539 \begin_layout Plain Layout
6545 , in a special mode where
6546 \begin_inset Flex CharStyle:Code
6549 \begin_layout Plain Layout
6556 The first line is just a LaTeX comment, and the second one contains the
6557 declaration of the text class.
6558 If these lines appear in a file named
6559 \begin_inset Flex CharStyle:Code
6562 \begin_layout Plain Layout
6568 , then they define a text class of name
6569 \begin_inset Flex CharStyle:Code
6572 \begin_layout Plain Layout
6578 (the name of the layout file) which uses the LaTeX document class
6579 \begin_inset Flex CharStyle:Code
6582 \begin_layout Plain Layout
6588 (the default is to use the same name as the layout).
6590 \begin_inset Quotes eld
6594 \begin_inset Quotes erd
6597 that appears above is used as a description of the text class in the
6598 \begin_inset Flex CharStyle:MenuItem
6601 \begin_layout Plain Layout
6602 Document\SpecialChar \menuseparator
6611 \begin_layout Standard
6612 Let's assume that you wrote your own text class that uses the
6613 \begin_inset Flex CharStyle:Code
6616 \begin_layout Plain Layout
6622 document class, but where you changed the appearance of the section headings.
6623 If you put it in a file
6624 \begin_inset Flex CharStyle:Code
6627 \begin_layout Plain Layout
6633 , the header of this file should be:
6636 \begin_layout LyX-Code
6639 #% Do not delete the line below; configure depends on this
6642 \begin_layout LyX-Code
6647 DeclareLaTeXClass[article]{article (with my own headings)}
6650 \begin_layout Standard
6651 This declares a text class
6652 \begin_inset Flex CharStyle:Code
6655 \begin_layout Plain Layout
6661 , associated with the LaTeX document class
6662 \begin_inset Flex CharStyle:Code
6665 \begin_layout Plain Layout
6672 \begin_inset Quotes eld
6675 article (with my own headings)
6676 \begin_inset Quotes erd
6680 If your text class depends on several packages, you can declare it as:
6683 \begin_layout LyX-Code
6686 #% Do not delete the line below; configure depends on this
6689 \begin_layout LyX-Code
6694 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6697 \begin_layout Standard
6698 This indicates that your text class uses the foo.sty package.
6699 Finally, it is also possible to declare classes for DocBook code.
6700 Typical declarations will look like
6703 \begin_layout LyX-Code
6706 #% Do not delete the line below; configure depends on this
6709 \begin_layout LyX-Code
6714 DeclareDocBookClass[article]{SGML (DocBook article)}
6717 \begin_layout Standard
6718 Note that these declarations can also be given an optional parameter declaring
6719 the name of the document class (but not a list).
6722 \begin_layout Standard
6723 So, to be as explicit as possible, the form of the layout declaration is:
6726 \begin_layout LyX-Code
6731 DeclareLaTeXClass[class,package.sty]{layout description}
6734 \begin_layout Standard
6735 The class need only be specified if the name of the LaTeX class file and
6736 the name of the layout file are different; if the name of the class file
6737 is not specified, then LyX will simply assume that it is the same as the
6738 name of the layout file.
6741 \begin_layout Standard
6742 When the text class has been modified to your taste, all you have to do
6743 is to copy it either to
6744 \begin_inset Flex CharStyle:Code
6747 \begin_layout Plain Layout
6754 \begin_inset Flex CharStyle:Code
6757 \begin_layout Plain Layout
6764 \begin_inset Flex CharStyle:MenuItem
6767 \begin_layout Plain Layout
6768 Tools\SpecialChar \menuseparator
6774 , exit LyX and restart it.
6775 Then your new text class should be available along with the others.
6778 \begin_layout Standard
6779 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6780 you made to your layout files.
6781 As a result, editing layout files could be very time consuming.
6782 Beginning with 1.6, however, you can force a reload of the layout currently
6783 in use by using the LyX function
6784 \begin_inset Flex CharStyle:MenuItem
6787 \begin_layout Plain Layout
6794 There is no default binding for this function---though, of course, you
6795 can bind it to a key yourself.
6796 If you want to use this function, then, you should simply enter it in the
6802 : This is very much an `advanced feature'.
6807 recommended that you save your work before using this function.
6812 recommended that you not attempt to edit your layout while simultaneously
6813 working on a document that you care about.
6814 Use a test document.
6815 Syntax errors and the like in your layout file could cause peculiar behavior.
6816 In particular, such errors could cause LyX to regard the current layout
6817 as invalid and to attempt to switch to some other layout.
6818 The LyX team strives to keep LyX stable in such situations, but safe is
6822 \begin_layout Subsection
6826 \begin_layout Standard
6827 The first non-comment line must contain the file format number:
6830 \begin_layout Description
6831 \begin_inset Flex CharStyle:Code
6834 \begin_layout Plain Layout
6841 \begin_inset Flex CharStyle:Code
6844 \begin_layout Plain Layout
6850 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6851 don't have an explicit file format).
6852 The file format that is documented here is format 8.
6855 \begin_layout Subsection
6856 General text class parameters
6859 \begin_layout Standard
6860 These are the general parameters which describe the form of the entire document:
6863 \begin_layout Description
6864 \begin_inset Flex CharStyle:Code
6867 \begin_layout Plain Layout
6873 Adds information to the document preamble.
6875 \begin_inset Quotes eld
6879 \begin_inset Flex CharStyle:Code
6882 \begin_layout Plain Layout
6889 \begin_inset Quotes erd
6895 \begin_layout Description
6896 \begin_inset Flex CharStyle:Code
6899 \begin_layout Plain Layout
6905 Describes various global options supported by the document class.
6907 \begin_inset space ~
6911 \begin_inset CommandInset ref
6913 reference "sec:classoptions"
6919 \begin_inset Quotes eld
6923 \begin_inset Flex CharStyle:Code
6926 \begin_layout Plain Layout
6933 \begin_inset Quotes erd
6939 \begin_layout Description
6940 \begin_inset Flex CharStyle:Code
6943 \begin_layout Plain Layout
6950 \begin_inset Flex CharStyle:Code
6953 \begin_layout Plain Layout
6962 \begin_inset Flex CharStyle:Code
6965 \begin_layout Plain Layout
6971 ] Whether the class should default to having one or two columns.
6972 Can be changed in the
6973 \begin_inset Flex CharStyle:MenuItem
6976 \begin_layout Plain Layout
6977 Document\SpecialChar \menuseparator
6986 \begin_layout Description
6987 \begin_inset Flex CharStyle:Code
6990 \begin_layout Plain Layout
6996 This sequence defines a new counter.
6998 \begin_inset space ~
7002 \begin_inset CommandInset ref
7004 reference "sec:counter"
7010 \begin_inset Quotes eld
7014 \begin_inset Flex CharStyle:Code
7017 \begin_layout Plain Layout
7024 \begin_inset Quotes erd
7030 \begin_layout Description
7031 \begin_inset Flex CharStyle:Code
7034 \begin_layout Plain Layout
7040 Sets the default font used to display the document.
7042 \begin_inset space ~
7046 \begin_inset CommandInset ref
7048 reference "sec:fonts"
7052 for how to declare fonts.
7054 \begin_inset Quotes eld
7058 \begin_inset Flex CharStyle:Code
7061 \begin_layout Plain Layout
7068 \begin_inset Quotes erd
7074 \begin_layout Description
7075 \begin_inset Flex CharStyle:Code
7078 \begin_layout Plain Layout
7085 \begin_inset Flex CharStyle:Code
7088 \begin_layout Plain Layout
7094 Specifies a module to be included by default with this document class,
7095 which should be specified by filename without the
7096 \begin_inset Flex CharStyle:Code
7099 \begin_layout Plain Layout
7106 The user can still remove the module, but it will be active at the outset.
7107 (This applies only when new files are created, or when this class is chosen
7108 for an existing document.)
7111 \begin_layout Description
7112 \begin_inset Flex CharStyle:Code
7115 \begin_layout Plain Layout
7122 \begin_inset Flex CharStyle:Code
7125 \begin_layout Plain Layout
7131 ] This is the style that will be assigned to new paragraphs, usually
7132 \begin_inset Flex CharStyle:MenuItem
7135 \begin_layout Plain Layout
7142 This will default to the first defined style if not given, but you are
7143 highly encouraged to use this directive.
7146 \begin_layout Description
7147 \begin_inset Flex CharStyle:Code
7150 \begin_layout Plain Layout
7157 \begin_inset Flex CharStyle:Code
7160 \begin_layout Plain Layout
7166 ] Indicates that the module in question---which should be specified by filename
7168 \begin_inset Flex CharStyle:Code
7171 \begin_layout Plain Layout
7177 extension---cannot be used with this document class.
7178 This might be used in a journal-specific layout file to prevent, say, the
7180 \begin_inset Flex CharStyle:Code
7183 \begin_layout Plain Layout
7189 module that numbers theorems by section.
7194 be used in a module.
7195 Modules have their own way of excluding other modules (see
7196 \begin_inset CommandInset ref
7198 reference "sub:Layout-modules"
7205 \begin_layout Description
7206 \begin_inset Flex CharStyle:Code
7209 \begin_layout Plain Layout
7215 Defines a new float.
7217 \begin_inset space ~
7221 \begin_inset CommandInset ref
7223 reference "sec:floats"
7229 \begin_inset Quotes eld
7233 \begin_inset Flex CharStyle:Code
7236 \begin_layout Plain Layout
7243 \begin_inset Quotes erd
7249 \begin_layout Description
7250 \begin_inset Flex CharStyle:Code
7253 \begin_layout Plain Layout
7259 As its name implies, this command allows you to include another layout
7260 definition file within yours to avoid duplicating commands.
7261 Common examples are the standard layout files, for example,
7262 \begin_inset Flex CharStyle:Code
7265 \begin_layout Plain Layout
7271 , which contains most of the basic layouts.
7274 \begin_layout Description
7275 \begin_inset Flex CharStyle:Code
7278 \begin_layout Plain Layout
7284 This section (re-)defines the layout of an inset.
7285 It can be applied to an existing inset of to a new, user-defined inset,
7287 \begin_inset space \thinspace{}
7291 \begin_inset space \space{}
7294 a new character style.
7296 \begin_inset space ~
7300 \begin_inset CommandInset ref
7302 reference "sec:charstyle"
7306 for more information.
7308 \begin_inset Quotes eld
7312 \begin_inset Flex CharStyle:Code
7315 \begin_layout Plain Layout
7322 \begin_inset Quotes erd
7328 \begin_layout Description
7329 \begin_inset Flex CharStyle:Code
7332 \begin_layout Plain Layout
7338 A string that indicates the width of the left margin on the screen, for
7340 \begin_inset Quotes eld
7344 \begin_inset Quotes erd
7350 \begin_layout Description
7351 \begin_inset Flex CharStyle:Code
7354 \begin_layout Plain Layout
7360 This command deletes an existing float.
7361 This is particularly useful when you want to suppress a float that has
7362 be defined in an input file.
7365 \begin_layout Description
7366 \begin_inset Flex CharStyle:Code
7369 \begin_layout Plain Layout
7375 This command deletes an existing style.
7376 This is particularly useful when you want to suppress a style 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 A string indicating what sort of output documents using this class will
7392 At present, the options are: `docbook', `latex', and `literate'.
7395 \begin_layout Description
7396 \begin_inset Flex CharStyle:Code
7399 \begin_layout Plain Layout
7410 \begin_inset Flex CharStyle:Code
7413 \begin_layout Plain Layout
7424 \begin_inset Flex CharStyle:Code
7427 \begin_layout Plain Layout
7434 \begin_inset Flex CharStyle:Code
7437 \begin_layout Plain Layout
7443 ] The class default pagestyle.
7444 Can be changed in the
7445 \begin_inset Flex CharStyle:MenuItem
7448 \begin_layout Plain Layout
7449 Document\SpecialChar \menuseparator
7458 \begin_layout Description
7459 \begin_inset Flex CharStyle:Code
7462 \begin_layout Plain Layout
7468 Sets the preamble for the LaTeX document.
7469 Note that this will completely override any prior
7470 \begin_inset Flex CharStyle:Code
7473 \begin_layout Plain Layout
7480 \begin_inset Flex CharStyle:Code
7483 \begin_layout Plain Layout
7491 \begin_inset Quotes eld
7495 \begin_inset Flex CharStyle:Code
7498 \begin_layout Plain Layout
7505 \begin_inset Quotes erd
7511 \begin_layout Description
7512 \begin_inset Flex CharStyle:Code
7515 \begin_layout Plain Layout
7522 \begin_inset Flex CharStyle:Code
7525 \begin_layout Plain Layout
7532 \begin_inset Flex CharStyle:Code
7535 \begin_layout Plain Layout
7544 \begin_inset Flex CharStyle:Code
7547 \begin_layout Plain Layout
7553 ] Whether the class already provides the feature
7554 \begin_inset Flex CharStyle:Code
7557 \begin_layout Plain Layout
7564 A feature is in general the name of a package (
7565 \begin_inset Flex CharStyle:Code
7568 \begin_layout Plain Layout
7575 \begin_inset Flex CharStyle:Code
7578 \begin_layout Plain Layout
7584 , \SpecialChar \ldots{}
7586 \begin_inset Flex CharStyle:Code
7589 \begin_layout Plain Layout
7596 \begin_inset Flex CharStyle:Code
7599 \begin_layout Plain Layout
7605 ,\SpecialChar \ldots{}
7606 ); the complete list of supported features is unfortunately not documented
7607 outside the LyX source code---but see
7608 \begin_inset Flex CharStyle:Code
7611 \begin_layout Plain Layout
7617 if you're interested.
7619 \begin_inset Flex CharStyle:MenuItem
7622 \begin_layout Plain Layout
7623 Help\SpecialChar \menuseparator
7629 also gives an overview of the supported packages.
7632 \begin_layout Description
7633 \begin_inset Flex CharStyle:Code
7636 \begin_layout Plain Layout
7643 \begin_inset Flex CharStyle:Code
7646 \begin_layout Plain Layout
7652 ] Indicates that this layout provides the functionality of the module mentioned,
7653 which should be specified by the filename without the
7654 \begin_inset Flex CharStyle:Code
7657 \begin_layout Plain Layout
7664 This will typically be used if the layout includes the module directly,
7665 rather than using the
7666 \begin_inset Flex CharStyle:Code
7669 \begin_layout Plain Layout
7675 tag to indicate that it ought to be used.
7676 It could be used in a module that provided an alternate implementation
7677 of the same functionality.
7680 \begin_layout Description
7681 \begin_inset Flex CharStyle:Code
7684 \begin_layout Plain Layout
7691 \begin_inset Flex CharStyle:Code
7694 \begin_layout Plain Layout
7700 ] Whether the class requires the feature
7701 \begin_inset Flex CharStyle:Code
7704 \begin_layout Plain Layout
7711 Multiple features must be separated by commas.
7712 Note that you can only request supported features.
7715 \begin_layout Description
7716 \begin_inset Flex CharStyle:Code
7719 \begin_layout Plain Layout
7725 A string that indicates the width of the right margin on the screen, for
7727 \begin_inset Quotes eld
7731 \begin_inset Quotes erd
7737 \begin_layout Description
7738 \begin_inset Flex CharStyle:Code
7741 \begin_layout Plain Layout
7747 Sets which divisions get numbered.
7749 \begin_inset Flex CharStyle:Code
7752 \begin_layout Plain Layout
7761 \begin_layout Description
7762 \begin_inset Flex CharStyle:Code
7765 \begin_layout Plain Layout
7774 \begin_inset Flex CharStyle:Code
7777 \begin_layout Plain Layout
7788 \begin_inset Flex CharStyle:Code
7791 \begin_layout Plain Layout
7797 ] Whether the class-default should be printing on one or both sides of the
7799 Can be changed in the
7800 \begin_inset Flex CharStyle:MenuItem
7803 \begin_layout Plain Layout
7804 Document\SpecialChar \menuseparator
7813 \begin_layout Description
7814 \begin_inset Flex CharStyle:Code
7817 \begin_layout Plain Layout
7823 This sequence defines a new paragraph style.
7824 If the style already exists, it will redefine some of its parameters instead.
7826 \begin_inset space ~
7830 \begin_inset CommandInset ref
7832 reference "sec:style"
7838 \begin_inset Quotes eld
7842 \begin_inset Flex CharStyle:Code
7845 \begin_layout Plain Layout
7852 \begin_inset Quotes erd
7858 \begin_layout Description
7859 \begin_inset Flex CharStyle:Code
7862 \begin_layout Plain Layout
7869 \begin_inset Flex CharStyle:Code
7872 \begin_layout Plain Layout
7878 ] The name of the command or environment to be used with
7879 \begin_inset Flex CharStyle:Code
7882 \begin_layout Plain Layout
7891 \begin_layout Description
7892 \begin_inset Flex CharStyle:Code
7895 \begin_layout Plain Layout
7902 \begin_inset Flex CharStyle:Code
7905 \begin_layout Plain Layout
7914 \begin_inset Flex CharStyle:Code
7917 \begin_layout Plain Layout
7923 ] Indicates what kind of markup is used to define the title of a document.
7925 \begin_inset Flex CharStyle:Code
7928 \begin_layout Plain Layout
7934 means that the macro with name
7935 \begin_inset Flex CharStyle:Code
7938 \begin_layout Plain Layout
7944 will be inserted after the last layout which has
7945 \begin_inset Quotes eld
7949 \begin_inset Flex CharStyle:Code
7952 \begin_layout Plain Layout
7959 \begin_inset Quotes erd
7964 \begin_inset Flex CharStyle:Code
7967 \begin_layout Plain Layout
7973 corresponds to the case where the block of paragraphs which have
7974 \begin_inset Quotes eld
7978 \begin_inset Flex CharStyle:Code
7981 \begin_layout Plain Layout
7988 \begin_inset Quotes erd
7991 should be enclosed into the
7992 \begin_inset Flex CharStyle:Code
7995 \begin_layout Plain Layout
8004 \begin_layout Description
8005 \begin_inset Flex CharStyle:Code
8008 \begin_layout Plain Layout
8014 Sets which divisions are included in the table of contents.
8016 \begin_inset Flex CharStyle:Code
8019 \begin_layout Plain Layout
8028 \begin_layout Subsection
8029 \begin_inset Flex CharStyle:Code
8032 \begin_layout Plain Layout
8041 \begin_layout Standard
8042 \begin_inset CommandInset label
8044 name "sec:classoptions"
8049 \begin_inset Flex CharStyle:Code
8052 \begin_layout Plain Layout
8058 section can contain the following entries:
8061 \begin_layout Description
8062 \begin_inset Flex CharStyle:Code
8065 \begin_layout Plain Layout
8072 \begin_inset Flex CharStyle:Code
8075 \begin_layout Plain Layout
8081 ] The list of available font sizes for the document's main font, separated
8083 \begin_inset Quotes eld
8087 \begin_inset Flex CharStyle:Code
8090 \begin_layout Plain Layout
8097 \begin_inset Quotes erd
8103 \begin_layout Description
8104 \begin_inset Flex CharStyle:Code
8107 \begin_layout Plain Layout
8113 Used to set the DTD line with XML-based output classes.
8115 \begin_inset space \thinspace{}
8119 \begin_inset Quotes eld
8122 -//OASIS//DTD DocBook V4.2//EN
8123 \begin_inset Quotes erd
8129 \begin_layout Description
8130 \begin_inset Flex CharStyle:Code
8133 \begin_layout Plain Layout
8140 \begin_inset Flex CharStyle:Code
8143 \begin_layout Plain Layout
8144 string="empty|plain|headings|fancy"
8149 ] The list of available page styles, separated by
8150 \begin_inset Quotes eld
8154 \begin_inset Flex CharStyle:Code
8157 \begin_layout Plain Layout
8164 \begin_inset Quotes erd
8170 \begin_layout Description
8171 \begin_inset Flex CharStyle:Code
8174 \begin_layout Plain Layout
8181 \begin_inset Flex CharStyle:Code
8184 \begin_layout Plain Layout
8190 ] Some document class options, separated by a comma, that will be added
8191 to the optional part of the
8192 \begin_inset Flex CharStyle:Code
8195 \begin_layout Plain Layout
8206 \begin_layout Standard
8208 \begin_inset Flex CharStyle:Code
8211 \begin_layout Plain Layout
8217 section must end with
8218 \begin_inset Quotes eld
8222 \begin_inset Flex CharStyle:Code
8225 \begin_layout Plain Layout
8232 \begin_inset Quotes erd
8238 \begin_layout Subsection
8242 \begin_layout Standard
8243 \begin_inset CommandInset label
8249 A paragraph style description looks like this:
8253 \begin_layout Plain Layout
8254 Note that this will either define a new layout or modify an existing one.
8262 \begin_layout LyX-Code
8269 \begin_layout LyX-Code
8273 \begin_layout LyX-Code
8277 \begin_layout Standard
8278 where the following commands are allowed:
8281 \begin_layout Description
8282 \begin_inset Flex CharStyle:Code
8285 \begin_layout Plain Layout
8292 \begin_inset Flex CharStyle:Code
8295 \begin_layout Plain Layout
8300 , left, right, center
8305 ] Paragraph alignment.
8308 \begin_layout Description
8309 \begin_inset Flex CharStyle:Code
8312 \begin_layout Plain Layout
8319 \begin_inset Flex CharStyle:Code
8322 \begin_layout Plain Layout
8327 , left, right, center
8332 ] A comma separated list of permitted alignments.
8333 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8335 For example a right-aligned or centered enumeration isn't possible.)
8338 \begin_layout Description
8339 \begin_inset Flex CharStyle:Code
8342 \begin_layout Plain Layout
8349 \begin_inset Flex CharStyle:Code
8352 \begin_layout Plain Layout
8362 \begin_layout Plain Layout
8363 Note that a `float' here is a real number, such as: 1.5.
8368 The vertical space with which the last of a chain of paragraphs with this
8369 layout is separated from the following paragraph.
8370 If the next paragraph has another layout, the separations are not simply
8371 added, but the maximum is taken.
8374 \begin_layout Description
8375 \begin_inset Flex CharStyle:Code
8378 \begin_layout Plain Layout
8385 \begin_inset Flex CharStyle:Code
8388 \begin_layout Plain Layout
8394 The category for this style.
8395 This is used to group related styles in the Layout combobox on the toolbar.
8396 Any string can be used, but you may want to use existing categories with
8401 \begin_layout Description
8402 \begin_inset Flex CharStyle:Code
8405 \begin_layout Plain Layout
8411 Depth of XML command.
8412 Used only with XML-type formats.
8415 \begin_layout Description
8416 \begin_inset Flex CharStyle:Code
8419 \begin_layout Plain Layout
8426 \begin_inset CommandInset label
8428 name "des:CopyStyle"
8433 \begin_inset Flex CharStyle:Code
8436 \begin_layout Plain Layout
8442 Copies all the features of an existing style into the current one.
8446 \begin_layout Description
8447 \begin_inset Flex CharStyle:Code
8450 \begin_layout Plain Layout
8456 The name of a style whose preamble should be output
8461 This allows to ensure some ordering of the preamble snippets when macros
8462 definitions depend on one another.
8466 \begin_layout Plain Layout
8467 Note that, besides that functionality, there is no way to ensure any ordering
8469 The ordering that you see in a given version of LyX may change without
8470 warning in later versions.
8478 \begin_layout Description
8479 \begin_inset Flex CharStyle:Code
8482 \begin_layout Plain Layout
8489 \begin_inset Flex CharStyle:Code
8492 \begin_layout Plain Layout
8497 , Box, Filled_Box, Static
8502 ] The type of label that stands at the end of the paragraph (or sequence
8504 \begin_inset Flex CharStyle:Code
8507 \begin_layout Plain Layout
8514 \begin_inset Flex CharStyle:Code
8517 \begin_layout Plain Layout
8524 \begin_inset Flex CharStyle:Code
8527 \begin_layout Plain Layout
8534 \begin_inset Flex CharStyle:Code
8537 \begin_layout Plain Layout
8545 \begin_inset Flex CharStyle:Code
8548 \begin_layout Plain Layout
8555 \begin_inset Quotes eld
8559 \begin_inset Quotes erd
8563 \begin_inset Flex CharStyle:Code
8566 \begin_layout Plain Layout
8573 \begin_inset Flex CharStyle:Code
8576 \begin_layout Plain Layout
8577 \begin_inset space ~
8586 \begin_inset space ~
8589 black) square suitable for end of proof markers,
8590 \begin_inset Flex CharStyle:Code
8593 \begin_layout Plain Layout
8599 is an explicit text string.
8602 \begin_layout Description
8603 \begin_inset Flex CharStyle:Code
8606 \begin_layout Plain Layout
8613 \begin_inset Flex CharStyle:Code
8616 \begin_layout Plain Layout
8622 ] The string used for a label with a
8623 \begin_inset Flex CharStyle:Code
8626 \begin_layout Plain Layout
8633 \begin_inset Flex CharStyle:Code
8636 \begin_layout Plain Layout
8646 \begin_layout Description
8647 \begin_inset Flex CharStyle:Code
8650 \begin_layout Plain Layout
8657 \begin_inset Flex CharStyle:Code
8660 \begin_layout Plain Layout
8671 \begin_inset Flex CharStyle:Code
8674 \begin_layout Plain Layout
8683 \begin_layout Description
8684 \begin_inset Flex CharStyle:Code
8687 \begin_layout Plain Layout
8694 \begin_inset Flex CharStyle:Code
8697 \begin_layout Plain Layout
8707 ] With this parameter the
8708 \begin_inset Flex CharStyle:MenuItem
8711 \begin_layout Plain Layout
8718 \begin_inset Quotes eld
8721 Vertical space above
8722 \begin_inset Quotes erd
8726 \begin_inset Flex CharStyle:MenuItem
8729 \begin_layout Plain Layout
8730 Edit\SpecialChar \menuseparator
8732 \begin_inset space ~
8740 dialog can be set when initializing a paragraph with this style.
8744 \begin_layout Plain Layout
8747 Note from Jean-Marc:
8749 I'm not sure that this setting has much use, and it should probably be
8750 removed in later versions.
8758 \begin_layout Description
8759 \begin_inset Flex CharStyle:Code
8762 \begin_layout Plain Layout
8768 The font used for both the text body
8774 \begin_inset space ~
8778 \begin_inset CommandInset ref
8780 reference "sec:fonts"
8785 Note that defining this font automatically defines the
8786 \begin_inset Flex CharStyle:Code
8789 \begin_layout Plain Layout
8796 So you should define this one first if you also want to define
8797 \begin_inset Flex CharStyle:Code
8800 \begin_layout Plain Layout
8809 \begin_layout Description
8810 \begin_inset Flex CharStyle:Code
8813 \begin_layout Plain Layout
8820 \begin_inset CommandInset label
8822 name "des:FreeSpacing"
8829 \begin_inset Flex CharStyle:Code
8832 \begin_layout Plain Layout
8843 \begin_inset Flex CharStyle:Code
8846 \begin_layout Plain Layout
8852 ] Usually LyX doesn't allow you to insert more than one space between words,
8853 since a space is considered as the separation between two words, not a
8854 character or symbol of its own.
8855 This is a very fine thing but sometimes annoying, for example, when typing
8856 program code or plain LaTeX code.
8858 \begin_inset Flex CharStyle:Code
8861 \begin_layout Plain Layout
8868 Note that LyX will create protected blanks for the additional blanks when
8869 in another mode than LaTeX-mode.
8872 \begin_layout Description
8873 \begin_inset Flex CharStyle:Code
8876 \begin_layout Plain Layout
8882 [[FIXME]] (Used only with XML-type formats.)
8885 \begin_layout Description
8886 \begin_inset Flex CharStyle:Code
8889 \begin_layout Plain Layout
8896 \begin_inset Flex CharStyle:Code
8899 \begin_layout Plain Layout
8905 If 1, marks the layout as being part of a title block (see also the
8906 \begin_inset Flex CharStyle:Code
8909 \begin_layout Plain Layout
8916 \begin_inset Flex CharStyle:Code
8919 \begin_layout Plain Layout
8928 \begin_layout Description
8929 \begin_inset Flex CharStyle:Code
8932 \begin_layout Plain Layout
8939 \begin_inset Flex CharStyle:Code
8942 \begin_layout Plain Layout
8948 ] This provides extra space between paragraphs that have the same layout.
8949 If you put other layouts into an environment, each is separated with the
8951 \begin_inset Flex CharStyle:Code
8954 \begin_layout Plain Layout
8961 But the whole items of the environment are additionally separated with
8963 \begin_inset Flex CharStyle:Code
8966 \begin_layout Plain Layout
8978 \begin_layout Description
8979 \begin_inset Flex CharStyle:Code
8982 \begin_layout Plain Layout
8988 [[FIXME]] (Used only with XML-type formats.)
8991 \begin_layout Description
8992 \begin_inset Flex CharStyle:Code
8995 \begin_layout Plain Layout
9002 \begin_inset CommandInset label
9004 name "des:KeepEmpty"
9011 \begin_inset Flex CharStyle:Code
9014 \begin_layout Plain Layout
9025 \begin_inset Flex CharStyle:Code
9028 \begin_layout Plain Layout
9034 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9035 lead to empty LaTeX output.
9036 There are some cases where this could be desirable however: in a letter
9037 template, the required fields can be provided as empty fields, so that
9038 people do not forget them; in some special classes, a layout can be used
9039 as some kind of break, which does not contain actual text.
9042 \begin_layout Description
9043 \begin_inset Flex CharStyle:Code
9046 \begin_layout Plain Layout
9052 [float=0] The vertical space between the label and the text body.
9053 Only used for labels that are above the text body (
9054 \begin_inset Flex CharStyle:Code
9057 \begin_layout Plain Layout
9064 \begin_inset Flex CharStyle:Code
9067 \begin_layout Plain Layout
9068 Centered_Top_Environment
9076 \begin_layout Description
9077 \begin_inset Flex CharStyle:Code
9080 \begin_layout Plain Layout
9087 \begin_inset Flex CharStyle:Code
9090 \begin_layout Plain Layout
9097 \begin_inset Newline newline
9100 The name of the counter for automatic numbering (see Section
9101 \begin_inset CommandInset ref
9103 reference "sec:counter"
9108 This must be given if
9109 \begin_inset Flex CharStyle:Code
9112 \begin_layout Plain Layout
9119 \begin_inset Flex CharStyle:Code
9122 \begin_layout Plain Layout
9131 \begin_layout Description
9132 \begin_inset Flex CharStyle:Code
9135 \begin_layout Plain Layout
9141 The font used for the label.
9143 \begin_inset space ~
9147 \begin_inset CommandInset ref
9149 reference "sec:fonts"
9156 \begin_layout Description
9157 \begin_inset Flex CharStyle:Code
9160 \begin_layout Plain Layout
9166 Text that indicates how far a label should be indented.
9169 \begin_layout Description
9170 \begin_inset Flex CharStyle:Code
9173 \begin_layout Plain Layout
9180 \begin_inset Flex CharStyle:Code
9183 \begin_layout Plain Layout
9189 ] The horizontal space between the label and the text body.
9190 Only used for labels that are not above the text body.
9193 \begin_layout Description
9194 \begin_inset Flex CharStyle:Code
9197 \begin_layout Plain Layout
9204 \begin_inset Flex CharStyle:Code
9207 \begin_layout Plain Layout
9213 ] The string used for a label with a
9214 \begin_inset Flex CharStyle:Code
9217 \begin_layout Plain Layout
9225 \begin_inset Flex CharStyle:Code
9228 \begin_layout Plain Layout
9234 is set, this string can be contain the special formatting commands described
9236 \begin_inset CommandInset ref
9238 reference "sec:counter"
9246 \begin_layout Plain Layout
9247 For the sake of backwards compatibility, the string
9248 \begin_inset Flex CharStyle:Code
9251 \begin_layout Plain Layout
9261 will be replaced by the expanded
9262 \begin_inset Flex CharStyle:Code
9265 \begin_layout Plain Layout
9272 \begin_inset Flex CharStyle:Code
9275 \begin_layout Plain Layout
9284 This feature is now obsolete and should be replaced by the mechanisms of
9286 \begin_inset CommandInset ref
9288 reference "sec:counter"
9300 \begin_layout Description
9301 \begin_inset Flex CharStyle:Code
9304 \begin_layout Plain Layout
9311 \begin_inset Flex CharStyle:Code
9314 \begin_layout Plain Layout
9320 ] This is used inside the appendix instead of
9321 \begin_inset Flex CharStyle:Code
9324 \begin_layout Plain Layout
9332 \begin_inset Flex CharStyle:Code
9335 \begin_layout Plain Layout
9342 \begin_inset Flex CharStyle:Code
9345 \begin_layout Plain Layout
9354 \begin_layout Description
9355 \begin_inset Flex CharStyle:Code
9358 \begin_layout Plain Layout
9364 [FIXME] (Used only with XML-type formats.)
9367 \begin_layout Description
9368 \begin_inset Flex CharStyle:Code
9371 \begin_layout Plain Layout
9378 \begin_inset Flex CharStyle:Code
9381 \begin_layout Plain Layout
9386 , Manual, Static, Top_Environment,
9387 \begin_inset Newline newline
9390 Centered_Top_Environment, Sensitive, Counter
9396 \begin_inset Newline newline
9400 \begin_inset Flex CharStyle:Code
9403 \begin_layout Plain Layout
9409 means the label is the very first word (up to the first real blank).
9413 \begin_layout Plain Layout
9414 Use protected spaces if you want more than one word as the label.
9420 \begin_inset Flex CharStyle:Code
9423 \begin_layout Plain Layout
9429 means it is defined in the layout (see
9430 \begin_inset Flex CharStyle:Code
9433 \begin_layout Plain Layout
9441 \begin_inset Flex CharStyle:Code
9444 \begin_layout Plain Layout
9451 \begin_inset Flex CharStyle:Code
9454 \begin_layout Plain Layout
9455 Centered_Top_Environment
9460 are special cases of
9461 \begin_inset Flex CharStyle:Code
9464 \begin_layout Plain Layout
9471 The label will be printed above the paragraph, but only at the top of an
9472 environment or the top of a chain of paragraphs with this layout.
9473 Usage is for example the
9474 \begin_inset Flex CharStyle:MenuItem
9477 \begin_layout Plain Layout
9484 \begin_inset Flex CharStyle:MenuItem
9487 \begin_layout Plain Layout
9494 This is also the case for
9495 \begin_inset Flex CharStyle:Code
9498 \begin_layout Plain Layout
9504 labels with latex type
9505 \begin_inset Flex CharStyle:Code
9508 \begin_layout Plain Layout
9514 , in order to make layouts for theorems work correctly.
9516 \begin_inset Flex CharStyle:Code
9519 \begin_layout Plain Layout
9525 is a special case for the caption-labels
9526 \begin_inset Quotes eld
9530 \begin_inset Quotes erd
9534 \begin_inset Quotes eld
9538 \begin_inset Quotes erd
9543 \begin_inset Flex CharStyle:Code
9546 \begin_layout Plain Layout
9552 means the (hardcoded) label string depends on the kind of float.
9554 \begin_inset Flex CharStyle:Code
9557 \begin_layout Plain Layout
9563 label type defines automatically numbered labels.
9565 \begin_inset CommandInset ref
9567 reference "sec:counter"
9574 \begin_layout Description
9575 \begin_inset Flex CharStyle:Code
9578 \begin_layout Plain Layout
9584 The name of the corresponding LaTeX stuff.
9585 Either the environment or command name.
9588 \begin_layout Description
9589 \begin_inset Flex CharStyle:Code
9592 \begin_layout Plain Layout
9598 An optional parameter for the corresponding
9599 \begin_inset Flex CharStyle:Code
9602 \begin_layout Plain Layout
9609 This parameter cannot be changed from within LyX.
9612 \begin_layout Description
9613 \begin_inset Flex CharStyle:Code
9616 \begin_layout Plain Layout
9623 \begin_inset CommandInset label
9625 name "des:LatexType"
9630 \begin_inset Flex CharStyle:Code
9633 \begin_layout Plain Layout
9638 , Command, Environment, Item_Environment,
9644 \begin_inset Flex CharStyle:Code
9647 \begin_layout Plain Layout
9653 ] How the layout should be translated into LaTeX.
9655 \begin_inset Flex CharStyle:Code
9658 \begin_layout Plain Layout
9664 means nothing special.
9666 \begin_inset Flex CharStyle:Code
9669 \begin_layout Plain Layout
9676 \begin_inset Flex CharStyle:Code
9679 \begin_layout Plain Layout
9686 {\SpecialChar \ldots{}
9693 \begin_inset Flex CharStyle:Code
9696 \begin_layout Plain Layout
9703 \begin_inset Flex CharStyle:Code
9706 \begin_layout Plain Layout
9713 }\SpecialChar \ldots{}
9727 \begin_inset Flex CharStyle:Code
9730 \begin_layout Plain Layout
9737 \begin_inset Flex CharStyle:Code
9740 \begin_layout Plain Layout
9747 \begin_inset Flex CharStyle:Code
9750 \begin_layout Plain Layout
9758 is generated for each paragraph of this environment.
9760 \begin_inset Flex CharStyle:Code
9763 \begin_layout Plain Layout
9770 \begin_inset Flex CharStyle:Code
9773 \begin_layout Plain Layout
9780 \begin_inset Flex CharStyle:Code
9783 \begin_layout Plain Layout
9789 is passed as an argument to the environment.
9791 \begin_inset Flex CharStyle:Code
9794 \begin_layout Plain Layout
9800 can be defined in the
9801 \begin_inset Flex CharStyle:MenuItem
9804 \begin_layout Plain Layout
9809 ayout\SpecialChar \menuseparator
9821 \begin_inset Flex CharStyle:Code
9824 \begin_layout Plain Layout
9832 is perhaps a bit misleading, since these rules apply to SGML classes, too.
9833 Visit the SGML class files for specific examples.
9836 \begin_layout Standard
9837 Putting the last few things together, the LaTeX output will be either:
9840 \begin_layout LyX-Code
9843 latexname[latexparam]{\SpecialChar \ldots{}
9847 \begin_layout Standard
9851 \begin_layout LyX-Code
9854 begin{latexname}[latexparam] \SpecialChar \ldots{}
9860 \begin_layout Standard
9861 depending upon the LaTeX type.
9864 \begin_layout Description
9865 \begin_inset Flex CharStyle:Code
9868 \begin_layout Plain Layout
9875 \begin_inset Flex CharStyle:Code
9878 \begin_layout Plain Layout
9884 ] If you put layouts into environments, the leftmargins are not simply added,
9885 but added with a factor
9886 \begin_inset Formula $\frac{4}{depth+4}$
9890 Note that this parameter is also used when the margin is defined as
9891 \begin_inset Flex CharStyle:Code
9894 \begin_layout Plain Layout
9901 \begin_inset Flex CharStyle:Code
9904 \begin_layout Plain Layout
9911 Then it is added to the manual or dynamic margin.
9913 \begin_inset Newline newline
9916 The argument is passed as a string.
9918 \begin_inset Quotes eld
9922 \begin_inset Flex CharStyle:Code
9925 \begin_layout Plain Layout
9932 \begin_inset Quotes erd
9935 means that the paragraph is indented with the width of
9936 \begin_inset Quotes eld
9940 \begin_inset Flex CharStyle:Code
9943 \begin_layout Plain Layout
9950 \begin_inset Quotes erd
9954 You can get a negative width by prefixing the string with
9955 \begin_inset Quotes eld
9959 \begin_inset Flex CharStyle:Code
9962 \begin_layout Plain Layout
9969 \begin_inset Quotes erd
9973 This way was chosen so that the look is the same with each used screen
9978 \begin_layout Description
9979 \begin_inset Flex CharStyle:Code
9982 \begin_layout Plain Layout
9989 \begin_inset Flex CharStyle:Code
9992 \begin_layout Plain Layout
9997 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10003 \begin_inset Newline newline
10006 The kind of margin that the layout has on the left side.
10008 \begin_inset Flex CharStyle:Code
10011 \begin_layout Plain Layout
10017 just means a fixed margin.
10019 \begin_inset Flex CharStyle:Code
10022 \begin_layout Plain Layout
10028 means that the left margin depends on the string entered in the
10029 \begin_inset Flex CharStyle:MenuItem
10032 \begin_layout Plain Layout
10033 Edit\SpecialChar \menuseparator
10035 \begin_inset space ~
10044 This is used to typeset nice lists without tabulators.
10046 \begin_inset Flex CharStyle:Code
10049 \begin_layout Plain Layout
10055 means that the margin depends on the size of the label.
10056 This is used for automatic enumerated headlines.
10057 It is obvious that the headline
10058 \begin_inset Quotes eld
10061 5.4.3.2.1 Very long headline
10062 \begin_inset Quotes erd
10065 must have a wider left margin (as wide as
10066 \begin_inset Quotes eld
10070 \begin_inset Quotes erd
10073 plus the space) than
10074 \begin_inset Quotes eld
10077 3.2 Very long headline
10078 \begin_inset Quotes erd
10082 \begin_inset Quotes eld
10086 \begin_inset Quotes erd
10089 are not able to do this.
10091 \begin_inset Flex CharStyle:Code
10094 \begin_layout Plain Layout
10100 is similar, but only the very first row of the paragraph is dynamic, while
10101 the others are static; this is used, for example, for descriptions.
10103 \begin_inset Flex CharStyle:Code
10106 \begin_layout Plain Layout
10112 means the margin is chosen in a way that the longest row of this paragraph
10113 fits to the right margin.
10114 This is used to typeset an address on the right edge of the page.
10117 \begin_layout Description
10118 \begin_inset Flex CharStyle:Code
10121 \begin_layout Plain Layout
10128 \begin_inset Flex CharStyle:Code
10131 \begin_layout Plain Layout
10140 \begin_inset Flex CharStyle:Code
10143 \begin_layout Plain Layout
10149 ] Whether fragile commands in this layout should be
10150 \begin_inset Flex CharStyle:Code
10153 \begin_layout Plain Layout
10166 whether this command should itself be protected.)
10169 \begin_layout Description
10170 \begin_inset Flex CharStyle:Code
10173 \begin_layout Plain Layout
10180 \begin_inset Flex CharStyle:Code
10183 \begin_layout Plain Layout
10190 \begin_inset Flex CharStyle:Code
10193 \begin_layout Plain Layout
10201 ] Whether newlines are translated into LaTeX newlines (
10202 \begin_inset Flex CharStyle:Code
10205 \begin_layout Plain Layout
10216 The translation can be switched off to allow more comfortable LaTeX editing
10220 \begin_layout Description
10221 \begin_inset Flex CharStyle:Code
10224 \begin_layout Plain Layout
10231 \begin_inset Flex CharStyle:Code
10234 \begin_layout Plain Layout
10241 \begin_inset Flex CharStyle:Code
10244 \begin_layout Plain Layout
10252 ] Whether the following Paragraph is allowed to indent its very first row.
10254 \begin_inset Flex CharStyle:Code
10257 \begin_layout Plain Layout
10263 means that it is not allowed to do so;
10264 \begin_inset Flex CharStyle:Code
10267 \begin_layout Plain Layout
10273 means it could do so if it wants to.
10276 \begin_layout Description
10277 \begin_inset Flex CharStyle:Code
10280 \begin_layout Plain Layout
10286 Name of a layout that has replaced this layout.
10287 This is used to rename a layout, while keeping backward compatibility.
10290 \begin_layout Description
10291 \begin_inset Flex CharStyle:Code
10294 \begin_layout Plain Layout
10301 \begin_inset Flex CharStyle:Code
10304 \begin_layout Plain Layout
10310 ] The number of optional arguments that can be used with this layout.
10311 This is useful for things like section headings, and only makes sense with
10315 \begin_layout Description
10316 \begin_inset Flex CharStyle:Code
10319 \begin_layout Plain Layout
10326 \begin_inset Flex CharStyle:Code
10329 \begin_layout Plain Layout
10335 ] The indent of the very first line of a paragraph.
10337 \begin_inset Flex CharStyle:Code
10340 \begin_layout Plain Layout
10346 will be fixed for a certain layout.
10347 The exception is Standard layout, since the indentation of a Standard layout
10348 paragraph can be prohibited with
10349 \begin_inset Flex CharStyle:Code
10352 \begin_layout Plain Layout
10359 Also, Standard layout paragraphs inside environments use the
10360 \begin_inset Flex CharStyle:Code
10363 \begin_layout Plain Layout
10369 of the environment, not their native one.
10370 For example, Standard paragraphs inside an enumeration are not indented.
10373 \begin_layout Description
10374 \begin_inset Flex CharStyle:Code
10377 \begin_layout Plain Layout
10384 \begin_inset Flex CharStyle:Code
10387 \begin_layout Plain Layout
10393 ] The vertical space between two paragraphs of this layout.
10396 \begin_layout Description
10397 \begin_inset Flex CharStyle:Code
10400 \begin_layout Plain Layout
10407 \begin_inset Flex CharStyle:Code
10410 \begin_layout Plain Layout
10416 ] LyX allows the user to choose either
10417 \begin_inset Quotes eld
10421 \begin_inset Quotes erd
10425 \begin_inset Quotes eld
10429 \begin_inset Quotes erd
10432 to typeset a document.
10434 \begin_inset Quotes eld
10438 \begin_inset Quotes erd
10441 is chosen, this value is completely ignored.
10443 \begin_inset Quotes eld
10447 \begin_inset Quotes erd
10450 is chosen, the parindent of a LaTeXtype
10451 \begin_inset Quotes eld
10455 \begin_inset Quotes erd
10458 layout is ignored and all paragraphs are separated by this parskip argument.
10459 The vertical space is calculated with
10460 \begin_inset Flex CharStyle:Code
10463 \begin_layout Plain Layout
10465 \begin_inset space ~
10474 \begin_inset Flex CharStyle:Code
10477 \begin_layout Plain Layout
10483 is the height of a row with the normal font.
10484 This way, the look stays the same with different screen fonts.
10487 \begin_layout Description
10488 \begin_inset Flex CharStyle:Code
10491 \begin_layout Plain Layout
10498 \begin_inset CommandInset label
10500 name "des:PathThru"
10507 \begin_inset Flex CharStyle:Code
10510 \begin_layout Plain Layout
10521 \begin_inset Flex CharStyle:Code
10524 \begin_layout Plain Layout
10530 ] Whether the contents of this paragraph should be output in raw form, meaning
10531 without special translations that LaTeX would require.
10534 \begin_layout Description
10535 \begin_inset Flex CharStyle:Code
10538 \begin_layout Plain Layout
10545 \begin_inset CommandInset label
10547 name "des:Preamble"
10551 Information to be included in the LaTeX preamble when this style is used.
10552 Used to define macros, load packages, etc., required by this particular
10555 \begin_inset Quotes eld
10559 \begin_inset Flex CharStyle:Code
10562 \begin_layout Plain Layout
10569 \begin_inset Quotes erd
10575 \begin_layout Description
10576 \begin_inset Flex CharStyle:Code
10579 \begin_layout Plain Layout
10586 \begin_inset Flex CharStyle:Code
10589 \begin_layout Plain Layout
10596 \begin_inset CommandInset label
10598 name "des:Requires"
10602 Whether the layout requires the feature
10603 \begin_inset Flex CharStyle:Code
10606 \begin_layout Plain Layout
10613 See the description of
10614 \begin_inset Flex CharStyle:Code
10617 \begin_layout Plain Layout
10624 \begin_inset CommandInset ref
10625 LatexCommand pageref
10626 reference "des:FreeSpacing"
10630 ) for information on `features'.
10634 \begin_layout Description
10635 \begin_inset Flex CharStyle:Code
10638 \begin_layout Plain Layout
10645 \begin_inset Flex CharStyle:Code
10648 \begin_layout Plain Layout
10655 \begin_inset Flex CharStyle:Code
10658 \begin_layout Plain Layout
10667 \begin_layout Description
10668 \begin_inset Flex CharStyle:Code
10671 \begin_layout Plain Layout
10678 \begin_inset Flex CharStyle:Code
10681 \begin_layout Plain Layout
10686 , onehalf, double, other
10695 ] This defines what the default spacing should be in the layout.
10697 \begin_inset Flex CharStyle:Code
10700 \begin_layout Plain Layout
10707 \begin_inset Flex CharStyle:Code
10710 \begin_layout Plain Layout
10717 \begin_inset Flex CharStyle:Code
10720 \begin_layout Plain Layout
10726 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
10727 If you specify the argument
10728 \begin_inset Flex CharStyle:Code
10731 \begin_layout Plain Layout
10737 , then you should also provide a numerical argument which will be the actual
10739 Note that, contrary to other parameters,
10740 \begin_inset Flex CharStyle:Code
10743 \begin_layout Plain Layout
10749 implies the generation of specific LaTeX code, using the package
10752 \begin_inset Flex CharStyle:Code
10755 \begin_layout Plain Layout
10764 \begin_layout Description
10765 \begin_inset Flex CharStyle:Code
10768 \begin_layout Plain Layout
10774 The font used for the text body .
10776 \begin_inset CommandInset ref
10778 reference "sec:fonts"
10785 \begin_layout Description
10786 \begin_inset Flex CharStyle:Code
10789 \begin_layout Plain Layout
10797 The level of the style in the table of contents.
10798 This is used for automatic numbering of section headings.
10801 \begin_layout Description
10802 \begin_inset Flex CharStyle:Code
10805 \begin_layout Plain Layout
10812 \begin_inset Flex CharStyle:Code
10815 \begin_layout Plain Layout
10821 ] The vertical space with which the very first of a chain of paragraphs
10822 with this layout is separated from the previous paragraph.
10823 If the previous paragraph has another layout, the separations are not simply
10824 added, but the maximum is taken.
10827 \begin_layout Subsection
10831 \begin_layout Standard
10832 \begin_inset CommandInset label
10838 Since version 1.3.0 of LyX, it is has been both possible and necessary to
10839 define the floats (
10840 \begin_inset Flex CharStyle:MenuItem
10843 \begin_layout Plain Layout
10850 \begin_inset Flex CharStyle:MenuItem
10853 \begin_layout Plain Layout
10859 , \SpecialChar \ldots{}
10860 ) in the text class itself.
10861 Standard floats are included in the file
10862 \begin_inset Flex CharStyle:Code
10865 \begin_layout Plain Layout
10871 , so you may have to do no more than add
10874 \begin_layout LyX-Code
10875 Input stdfloats.inc
10878 \begin_layout Standard
10879 to your layout file.
10880 If you want to implement a text class that proposes some other float types
10881 (like the AGU class bundled with LyX), the information below will hopefully
10885 \begin_layout Description
10886 \begin_inset Flex CharStyle:Code
10889 \begin_layout Plain Layout
10896 \begin_inset Flex CharStyle:Code
10899 \begin_layout Plain Layout
10906 \begin_inset Quotes erd
10910 \begin_inset Quotes erd
10913 ] The file name extension of an auxiliary file for the list of figures (or
10915 LaTeX writes the captions to this file.
10918 \begin_layout Description
10919 \begin_inset Flex CharStyle:Code
10922 \begin_layout Plain Layout
10929 \begin_inset Flex CharStyle:Code
10932 \begin_layout Plain Layout
10939 \begin_inset Quotes erd
10943 \begin_inset Quotes erd
10946 ] The string that will be used in the menus and also for the caption.
10949 \begin_layout Description
10950 \begin_inset Flex CharStyle:Code
10953 \begin_layout Plain Layout
10960 \begin_inset Flex CharStyle:Code
10963 \begin_layout Plain Layout
10972 \begin_inset Flex CharStyle:Code
10975 \begin_layout Plain Layout
10982 \begin_inset Flex CharStyle:Code
10985 \begin_layout Plain Layout
10991 if the float is already defined by the LaTeX document class.
10993 \begin_inset Flex CharStyle:Code
10996 \begin_layout Plain Layout
11002 , the float will be defined using the LaTeX package
11003 \begin_inset Flex CharStyle:Code
11006 \begin_layout Plain Layout
11015 \begin_layout Description
11016 \begin_inset Flex CharStyle:Code
11019 \begin_layout Plain Layout
11026 \begin_inset Flex CharStyle:Code
11029 \begin_layout Plain Layout
11036 \begin_inset Quotes erd
11040 \begin_inset Quotes erd
11043 ] The heading used for the list of floats.
11046 \begin_layout Description
11047 \begin_inset Flex CharStyle:Code
11050 \begin_layout Plain Layout
11057 \begin_inset Flex CharStyle:Code
11060 \begin_layout Plain Layout
11067 \begin_inset Quotes erd
11071 \begin_inset Quotes erd
11074 ] This (optional) argument determines whether floats of this class will
11075 be numbered within some sectional unit of the document.
11076 For example, if within is equal to
11077 \begin_inset Flex CharStyle:Code
11080 \begin_layout Plain Layout
11086 , the floats will be numbered within chapters.
11090 \begin_layout Description
11091 \begin_inset Flex CharStyle:Code
11094 \begin_layout Plain Layout
11101 \begin_inset Flex CharStyle:Code
11104 \begin_layout Plain Layout
11111 \begin_inset Quotes erd
11115 \begin_inset Quotes erd
11118 ] The default placement for the given class of floats.
11119 The string should be as in standard LaTeX:
11120 \begin_inset Flex CharStyle:Code
11123 \begin_layout Plain Layout
11130 \begin_inset Flex CharStyle:Code
11133 \begin_layout Plain Layout
11140 \begin_inset Flex CharStyle:Code
11143 \begin_layout Plain Layout
11150 \begin_inset Flex CharStyle:Code
11153 \begin_layout Plain Layout
11159 for top, bottom, page, and here, respectively.
11163 \begin_layout Plain Layout
11164 Note that the order of these letters in the string is irrelevant, like in
11170 On top of that there is a new type,
11171 \begin_inset Flex CharStyle:Code
11174 \begin_layout Plain Layout
11180 , which does not really correspond to a float, since it means: put it
11181 \begin_inset Quotes eld
11185 \begin_inset Quotes erd
11189 Note however that the
11190 \begin_inset Flex CharStyle:Code
11193 \begin_layout Plain Layout
11199 specifier is special and, because of implementation details, cannot be
11200 used in non-built in float types.
11201 If you do not understand what this means, just use
11202 \begin_inset Quotes eld
11206 \begin_inset Flex CharStyle:Code
11209 \begin_layout Plain Layout
11216 \begin_inset Quotes erd
11222 \begin_layout Description
11223 \begin_inset Flex CharStyle:Code
11226 \begin_layout Plain Layout
11233 \begin_inset Flex CharStyle:Code
11236 \begin_layout Plain Layout
11243 \begin_inset Quotes erd
11247 \begin_inset Quotes erd
11250 ] The style used when defining the float using
11251 \begin_inset Flex CharStyle:Code
11254 \begin_layout Plain Layout
11265 \begin_layout Description
11266 \begin_inset Flex CharStyle:Code
11269 \begin_layout Plain Layout
11276 \begin_inset Flex CharStyle:Code
11279 \begin_layout Plain Layout
11286 \begin_inset Quotes erd
11290 \begin_inset Quotes erd
11294 \begin_inset Quotes eld
11298 \begin_inset Quotes erd
11301 of the new class of floats, like program or algorithm.
11302 After the appropriate
11303 \begin_inset Flex CharStyle:Code
11306 \begin_layout Plain Layout
11315 \begin_inset Flex CharStyle:Code
11318 \begin_layout Plain Layout
11327 \begin_inset Flex CharStyle:Code
11330 \begin_layout Plain Layout
11341 \begin_layout Standard
11342 Note that defining a float with type
11343 \begin_inset Flex CharStyle:Code
11346 \begin_layout Plain Layout
11354 automatically defines the corresponding counter with name
11355 \begin_inset Flex CharStyle:Code
11358 \begin_layout Plain Layout
11369 \begin_layout Subsection
11370 Flex insets and InsetLayout
11373 \begin_layout Standard
11374 \begin_inset CommandInset label
11376 name "sec:charstyle"
11380 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11381 these are called Flex insets.
11385 \begin_layout Standard
11386 Flex insets come in three different kinds:
11389 \begin_layout Itemize
11391 \begin_inset Flex CharStyle:Code
11394 \begin_layout Plain Layout
11400 ): These define semantic markup corresponding to such LaTeX commands as
11402 \begin_inset Flex CharStyle:Code
11405 \begin_layout Plain Layout
11414 \begin_inset Flex CharStyle:Code
11417 \begin_layout Plain Layout
11428 \begin_layout Itemize
11430 \begin_inset Flex CharStyle:Code
11433 \begin_layout Plain Layout
11439 ): These can be used to define custom collapsible insets, similar to TeX
11440 code, footnote, and the like.
11441 An obvious example is an endnote inset, which is defined in the
11442 \begin_inset Flex CharStyle:Code
11445 \begin_layout Plain Layout
11454 \begin_layout Itemize
11456 \begin_inset Flex CharStyle:Code
11459 \begin_layout Plain Layout
11465 ): For use with DocBook classes.
11468 \begin_layout Standard
11469 Flex insets are defined using the
11470 \begin_inset Flex CharStyle:Code
11473 \begin_layout Plain Layout
11479 tag, which shall be explained in a moment.
11482 \begin_layout Standard
11484 \begin_inset Flex CharStyle:Code
11487 \begin_layout Plain Layout
11493 tag also serves another function: It can be used to customize the general
11494 layout of many different types of insets.
11496 \begin_inset Flex CharStyle:Code
11499 \begin_layout Plain Layout
11505 can be used to customize the layout parameters for footnotes, marginal
11506 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
11507 boxes, tables, algorithms, URLs, and optional arguments, as well as to
11508 define Flex insets.
11511 \begin_layout Standard
11513 \begin_inset Flex CharStyle:Code
11516 \begin_layout Plain Layout
11522 definition must begin with a line of the form:
11525 \begin_layout LyX-Code
11529 \begin_layout Standard
11531 \begin_inset Flex CharStyle:Code
11534 \begin_layout Plain Layout
11540 indicates the inset whose layout is being defined, and here there are two
11544 \begin_layout Enumerate
11545 The layout for a pre-existing inset is being modified.
11546 In this case, can be
11547 \begin_inset Flex CharStyle:Code
11550 \begin_layout Plain Layout
11556 any one of the following:
11557 \begin_inset Flex CharStyle:Code
11560 \begin_layout Plain Layout
11567 \begin_inset Flex CharStyle:Code
11570 \begin_layout Plain Layout
11577 \begin_inset Flex CharStyle:Code
11580 \begin_layout Plain Layout
11587 \begin_inset Flex CharStyle:Code
11590 \begin_layout Plain Layout
11597 \begin_inset Flex CharStyle:Code
11600 \begin_layout Plain Layout
11607 \begin_inset Flex CharStyle:Code
11610 \begin_layout Plain Layout
11617 \begin_inset Flex CharStyle:Code
11620 \begin_layout Plain Layout
11627 \begin_inset Flex CharStyle:Code
11630 \begin_layout Plain Layout
11637 \begin_inset Flex CharStyle:Code
11640 \begin_layout Plain Layout
11647 \begin_inset Flex CharStyle:Code
11650 \begin_layout Plain Layout
11657 \begin_inset Flex CharStyle:Code
11660 \begin_layout Plain Layout
11667 \begin_inset Flex CharStyle:Code
11670 \begin_layout Plain Layout
11677 \begin_inset Flex CharStyle:Code
11680 \begin_layout Plain Layout
11687 \begin_inset Flex CharStyle:Code
11690 \begin_layout Plain Layout
11697 \begin_inset Flex CharStyle:Code
11700 \begin_layout Plain Layout
11707 \begin_inset Flex CharStyle:Code
11710 \begin_layout Plain Layout
11717 \begin_inset Flex CharStyle:Code
11720 \begin_layout Plain Layout
11727 \begin_inset Flex CharStyle:Code
11730 \begin_layout Plain Layout
11737 \begin_inset Flex CharStyle:Code
11740 \begin_layout Plain Layout
11747 \begin_inset Flex CharStyle:Code
11750 \begin_layout Plain Layout
11760 \begin_layout Enumerate
11761 The layout for a Flex inset is being defined.
11763 \begin_inset Flex CharStyle:Code
11766 \begin_layout Plain Layout
11772 can be any valid identifier not used by a pre-existing inset.
11773 Note that the definition of a flex inset must
11778 \begin_inset Flex CharStyle:Code
11781 \begin_layout Plain Layout
11790 \begin_layout Standard
11792 \begin_inset Flex CharStyle:Code
11795 \begin_layout Plain Layout
11801 definition can contain the following entries:
11804 \begin_layout Description
11805 \begin_inset Flex CharStyle:Code
11808 \begin_layout Plain Layout
11814 The color for the inset's background.
11815 The valid colors are defined in
11816 \begin_inset Flex CharStyle:Code
11819 \begin_layout Plain Layout
11828 \begin_layout Description
11829 \begin_inset Flex CharStyle:Code
11832 \begin_layout Plain Layout
11838 As with paragraph styles (see page
11839 \begin_inset CommandInset ref
11841 reference "des:CopyStyle"
11848 \begin_layout Description
11849 \begin_inset Flex CharStyle:Code
11852 \begin_layout Plain Layout
11859 \begin_inset Flex CharStyle:Code
11862 \begin_layout Plain Layout
11871 \begin_inset Flex CharStyle:Code
11874 \begin_layout Plain Layout
11880 ] Indicates whether the user may employ the Paragraph Settings dialog to
11881 customize the paragraph.
11884 \begin_layout Description
11885 \begin_inset Flex CharStyle:Code
11888 \begin_layout Plain Layout
11895 \begin_inset Flex CharStyle:Code
11898 \begin_layout Plain Layout
11905 \begin_inset Flex CharStyle:Code
11908 \begin_layout Plain Layout
11915 \begin_inset Flex CharStyle:Code
11918 \begin_layout Plain Layout
11924 , describing the rendering style used for the inset's frame and buttons.
11925 Footnotes generally use
11926 \begin_inset Flex CharStyle:Code
11929 \begin_layout Plain Layout
11935 , ERT insets generally
11936 \begin_inset Flex CharStyle:Code
11939 \begin_layout Plain Layout
11945 , and character styles
11946 \begin_inset Flex CharStyle:Code
11949 \begin_layout Plain Layout
11958 \begin_layout Description
11959 \begin_inset Flex CharStyle:Code
11962 \begin_layout Plain Layout
11968 Required at the end of the InsetLayout declarations.
11971 \begin_layout Description
11972 \begin_inset Flex CharStyle:Code
11975 \begin_layout Plain Layout
11981 The font used for both the text body
11987 \begin_inset space ~
11991 \begin_inset CommandInset ref
11993 reference "sec:fonts"
11998 Note that defining this font automatically defines the
11999 \begin_inset Flex CharStyle:Code
12002 \begin_layout Plain Layout
12008 to the same value, so define this first and define
12009 \begin_inset Flex CharStyle:Code
12012 \begin_layout Plain Layout
12018 later if you want them to be different.
12021 \begin_layout Description
12022 \begin_inset Flex CharStyle:Code
12025 \begin_layout Plain Layout
12032 \begin_inset Quotes eld
12036 \begin_inset Quotes erd
12039 language, leading to Left-to-Right (latin) output, e.
12040 \begin_inset space \thinspace{}
12044 \begin_inset space \space{}
12047 in TeX code or URL.
12051 \begin_layout Description
12052 \begin_inset Flex CharStyle:Code
12055 \begin_layout Plain Layout
12062 \begin_inset Flex CharStyle:Code
12065 \begin_layout Plain Layout
12074 \begin_inset Flex CharStyle:Code
12077 \begin_layout Plain Layout
12083 ] Indicates whether the PlainLayout should be used or, instead, the user
12084 can change the paragraph style used in the inset.
12087 \begin_layout Description
12088 \begin_inset Flex CharStyle:Code
12091 \begin_layout Plain Layout
12097 As with paragraph styles (see page
12098 \begin_inset CommandInset ref
12099 LatexCommand pageref
12100 reference "des:FreeSpacing"
12107 \begin_layout Description
12108 \begin_inset Flex CharStyle:Code
12111 \begin_layout Plain Layout
12117 As with paragraph styles (see page
12118 \begin_inset CommandInset ref
12119 LatexCommand pageref
12120 reference "des:KeepEmpty"
12127 \begin_layout Description
12128 \begin_inset Flex CharStyle:Code
12131 \begin_layout Plain Layout
12137 The font used for the label.
12139 \begin_inset space ~
12143 \begin_inset CommandInset ref
12145 reference "sec:fonts"
12150 Note that this definition can never appear before
12151 \begin_inset Flex CharStyle:Code
12154 \begin_layout Plain Layout
12160 , lest it be ineffective.
12163 \begin_layout Description
12164 \begin_inset Flex CharStyle:Code
12167 \begin_layout Plain Layout
12173 What will be displayed on the button or elsewhere as the inset label.
12174 Some inset types (TeX code and Branch) modify this label on the fly.
12177 \begin_layout Description
12178 \begin_inset Flex CharStyle:Code
12181 \begin_layout Plain Layout
12187 The name of the corresponding LaTeX stuff.
12188 Either the environment or command name.
12191 \begin_layout Description
12192 \begin_inset Flex CharStyle:Code
12195 \begin_layout Plain Layout
12201 The optional parameter for the corresponding
12202 \begin_inset Flex CharStyle:Code
12205 \begin_layout Plain Layout
12211 stuff, including possible bracket pairs like
12212 \begin_inset Flex CharStyle:Code
12215 \begin_layout Plain Layout
12222 This parameter cannot be changed from within LyX.
12225 \begin_layout Description
12226 \begin_inset Flex CharStyle:Code
12229 \begin_layout Plain Layout
12235 As with paragraph styles (see page
12236 \begin_inset CommandInset ref
12237 LatexCommand pageref
12238 reference "des:LatexType"
12245 \begin_layout Description
12246 \begin_inset Flex CharStyle:Code
12249 \begin_layout Plain Layout
12256 \begin_inset Flex CharStyle:Code
12259 \begin_layout Plain Layout
12266 \begin_inset Flex CharStyle:Code
12269 \begin_layout Plain Layout
12276 \begin_inset Flex CharStyle:Code
12279 \begin_layout Plain Layout
12286 \begin_inset Flex CharStyle:Code
12289 \begin_layout Plain Layout
12295 (indicating a dummy definition ending definitions of charstyles, etc).
12296 This entry is required in and is only meaningful for Flex insets.
12297 Among other things, it determines on which menu this inset will appear.
12300 \begin_layout Description
12301 \begin_inset Flex CharStyle:Code
12304 \begin_layout Plain Layout
12311 \begin_inset Flex CharStyle:Code
12314 \begin_layout Plain Layout
12323 \begin_inset Flex CharStyle:Code
12326 \begin_layout Plain Layout
12332 ] Whether multiple paragraphs are permitted in this inset.
12333 This will also set CustomPars to the same value and ForcePlain to the opposite
12335 These can be reset to other values, if they are used
12342 \begin_layout Description
12343 \begin_inset Flex CharStyle:Code
12346 \begin_layout Plain Layout
12353 \begin_inset Flex CharStyle:Code
12356 \begin_layout Plain Layout
12365 \begin_inset Flex CharStyle:Code
12368 \begin_layout Plain Layout
12374 ] Whether fragile commands in this layout should be
12375 \begin_inset Flex CharStyle:Code
12378 \begin_layout Plain Layout
12391 whether the command should itself be protected.)
12394 \begin_layout Description
12395 \begin_inset Flex CharStyle:Code
12398 \begin_layout Plain Layout
12405 \begin_inset Flex CharStyle:Code
12408 \begin_layout Plain Layout
12417 \begin_inset Flex CharStyle:Code
12420 \begin_layout Plain Layout
12426 ] As with paragraph styles (see page
12427 \begin_inset CommandInset ref
12429 reference "des:PathThru"
12436 \begin_layout Description
12437 \begin_inset Flex CharStyle:Code
12440 \begin_layout Plain Layout
12446 As with paragraph styles (see page
12447 \begin_inset CommandInset ref
12448 LatexCommand pageref
12449 reference "des:Preamble"
12456 \begin_layout Description
12457 \begin_inset Flex CharStyle:Code
12460 \begin_layout Plain Layout
12467 \begin_inset Flex CharStyle:Code
12470 \begin_layout Plain Layout
12476 ] As with paragraph styles (see page
12477 \begin_inset CommandInset ref
12478 LatexCommand pageref
12479 reference "des:Requires"
12486 \begin_layout Subsection
12490 \begin_layout Standard
12491 \begin_inset CommandInset label
12497 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12499 \begin_inset Flex CharStyle:MenuItem
12502 \begin_layout Plain Layout
12509 \begin_inset Flex CharStyle:MenuItem
12512 \begin_layout Plain Layout
12518 , \SpecialChar \ldots{}
12519 ) in the text class itself.
12520 The standard counters are defined in the file
12521 \begin_inset Flex CharStyle:Code
12524 \begin_layout Plain Layout
12530 , so you may have to do no more than add
12533 \begin_layout LyX-Code
12534 Input stdcounters.inc
12537 \begin_layout Standard
12538 to your layout file to get them to work.
12539 But if you want to define custom counters, then you can do so.
12540 The counter declaration must begin with:
12543 \begin_layout LyX-Code
12547 \begin_layout Standard
12548 where of course `name' is replaced by the name of the counter.
12549 And it must end with
12550 \begin_inset Quotes eld
12554 \begin_inset Flex CharStyle:Code
12557 \begin_layout Plain Layout
12564 \begin_inset Quotes erd
12568 The following parameters can also be used:
12571 \begin_layout Description
12572 \begin_inset Flex CharStyle:Code
12575 \begin_layout Plain Layout
12576 LabelString [string=""]
12581 when this is defined, this string defines how the counter is displayed.
12582 Setting this value sets
12583 \begin_inset Flex CharStyle:Code
12586 \begin_layout Plain Layout
12587 LabelStringAppendix
12593 The following special constructs can be used in the string:
12597 \begin_layout Itemize
12598 \begin_inset Flex CharStyle:Code
12601 \begin_layout Plain Layout
12609 will be replaced by the expansion of the
12610 \begin_inset Flex CharStyle:Code
12613 \begin_layout Plain Layout
12620 \begin_inset Flex CharStyle:Code
12623 \begin_layout Plain Layout
12624 LabelStringAppendix
12630 \begin_inset Flex CharStyle:Code
12633 \begin_layout Plain Layout
12643 \begin_layout Itemize
12644 counter values can be expressed using LaTeX-like macros
12645 \begin_inset Flex CharStyle:Code
12648 \begin_layout Plain Layout
12665 \begin_inset Flex CharStyle:Code
12668 \begin_layout Plain Layout
12680 \begin_layout Plain Layout
12690 Actually, the situation is a bit more complicated: any
12709 other than those described below will produce arabic numerals.
12710 It would not be surprising to see this change in the future.
12716 \begin_inset Flex CharStyle:Code
12719 \begin_layout Plain Layout
12725 : 1, 2, 3,\SpecialChar \ldots{}
12727 \begin_inset Flex CharStyle:Code
12730 \begin_layout Plain Layout
12736 for lower-case letters: a, b, c, \SpecialChar \ldots{}
12738 \begin_inset Flex CharStyle:Code
12741 \begin_layout Plain Layout
12747 for upper-case letters: A, B, C, \SpecialChar \ldots{}
12749 \begin_inset Flex CharStyle:Code
12752 \begin_layout Plain Layout
12758 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
12760 \begin_inset Flex CharStyle:Code
12763 \begin_layout Plain Layout
12769 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
12771 \begin_inset Flex CharStyle:Code
12774 \begin_layout Plain Layout
12780 for hebrew numerals.
12784 \begin_layout Standard
12785 If LabelString is not defined, a default value is constructed as follows:
12786 if the counter has a master counter
12787 \begin_inset Flex CharStyle:Code
12790 \begin_layout Plain Layout
12797 \begin_inset Flex CharStyle:Code
12800 \begin_layout Plain Layout
12807 \begin_inset Flex CharStyle:Code
12810 \begin_layout Plain Layout
12820 is used; otherwise the string
12821 \begin_inset Flex CharStyle:Code
12824 \begin_layout Plain Layout
12835 \begin_layout Description
12836 \begin_inset Flex CharStyle:Code
12839 \begin_layout Plain Layout
12840 LabelStringAppendix [string=""]
12846 \begin_inset Flex CharStyle:Code
12849 \begin_layout Plain Layout
12855 , but for use in the Appendix.
12858 \begin_layout Description
12859 \begin_inset Flex CharStyle:Code
12862 \begin_layout Plain Layout
12869 \begin_inset Flex CharStyle:Code
12872 \begin_layout Plain Layout
12879 \begin_inset Quotes erd
12883 \begin_inset Quotes erd
12886 ] If this is set to the name of another counter, the present counter will
12887 be reset every time the other one is increased.
12889 \begin_inset Flex CharStyle:Code
12892 \begin_layout Plain Layout
12899 \begin_inset Flex CharStyle:Code
12902 \begin_layout Plain Layout
12911 \begin_layout Subsection
12915 \begin_layout Standard
12916 \begin_inset CommandInset label
12922 A font description looks like this:
12925 \begin_layout LyX-Code
12935 \begin_layout LyX-Code
12939 \begin_layout LyX-Code
12943 \begin_layout Standard
12944 The following commands are available:
12947 \begin_layout Description
12948 \begin_inset Flex CharStyle:Code
12951 \begin_layout Plain Layout
12958 \begin_inset Flex CharStyle:Code
12961 \begin_layout Plain Layout
12970 \begin_inset Flex CharStyle:Code
12973 \begin_layout Plain Layout
12980 \begin_inset Flex CharStyle:Code
12983 \begin_layout Plain Layout
12990 \begin_inset Flex CharStyle:Code
12993 \begin_layout Plain Layout
13000 \begin_inset Flex CharStyle:Code
13003 \begin_layout Plain Layout
13010 \begin_inset Flex CharStyle:Code
13013 \begin_layout Plain Layout
13020 \begin_inset Flex CharStyle:Code
13023 \begin_layout Plain Layout
13030 \begin_inset Flex CharStyle:Code
13033 \begin_layout Plain Layout
13040 \begin_inset Flex CharStyle:Code
13043 \begin_layout Plain Layout
13052 \begin_layout Description
13053 \begin_inset Flex CharStyle:Code
13056 \begin_layout Plain Layout
13065 \begin_inset Flex CharStyle:Code
13068 \begin_layout Plain Layout
13079 \begin_inset Flex CharStyle:Code
13082 \begin_layout Plain Layout
13089 \begin_inset Flex CharStyle:Code
13092 \begin_layout Plain Layout
13101 \begin_layout Description
13102 \begin_inset Flex CharStyle:Code
13105 \begin_layout Plain Layout
13112 \begin_inset Flex CharStyle:Code
13115 \begin_layout Plain Layout
13121 ] Valid argument are:
13122 \begin_inset Flex CharStyle:Code
13125 \begin_layout Plain Layout
13132 \begin_inset Flex CharStyle:Code
13135 \begin_layout Plain Layout
13142 \begin_inset Flex CharStyle:Code
13145 \begin_layout Plain Layout
13152 \begin_inset Flex CharStyle:Code
13155 \begin_layout Plain Layout
13162 \begin_inset Flex CharStyle:Code
13165 \begin_layout Plain Layout
13172 \begin_inset Flex CharStyle:Code
13175 \begin_layout Plain Layout
13182 Each of these turns on or off the corresponding attribute.
13185 \begin_layout Description
13186 \begin_inset Flex CharStyle:Code
13189 \begin_layout Plain Layout
13198 \begin_inset Flex CharStyle:Code
13201 \begin_layout Plain Layout
13212 \begin_inset Flex CharStyle:Code
13215 \begin_layout Plain Layout
13224 \begin_layout Description
13225 \begin_inset Flex CharStyle:Code
13228 \begin_layout Plain Layout
13237 \begin_inset Flex CharStyle:Code
13240 \begin_layout Plain Layout
13251 \begin_inset Flex CharStyle:Code
13254 \begin_layout Plain Layout
13261 \begin_inset Flex CharStyle:Code
13264 \begin_layout Plain Layout
13271 \begin_inset Flex CharStyle:Code
13274 \begin_layout Plain Layout
13283 \begin_layout Description
13284 \begin_inset Flex CharStyle:Code
13287 \begin_layout Plain Layout
13294 \begin_inset Flex CharStyle:Code
13297 \begin_layout Plain Layout
13304 \begin_inset Flex CharStyle:Code
13307 \begin_layout Plain Layout
13314 \begin_inset Flex CharStyle:Code
13317 \begin_layout Plain Layout
13326 \begin_inset Flex CharStyle:Code
13329 \begin_layout Plain Layout
13336 \begin_inset Flex CharStyle:Code
13339 \begin_layout Plain Layout
13346 \begin_inset Flex CharStyle:Code
13349 \begin_layout Plain Layout
13356 \begin_inset Flex CharStyle:Code
13359 \begin_layout Plain Layout
13366 \begin_inset Flex CharStyle:Code
13369 \begin_layout Plain Layout
13378 \begin_layout Subsection
13379 Upgrading old layout files
13382 \begin_layout Standard
13383 The file format of layout files changes from time to time, so old layout
13384 files need to be converted.
13385 This process has been automated since LyX 1.4.0: If LyX reads an old format
13386 layout file it will call the conversion tool
13387 \begin_inset Flex CharStyle:Code
13390 \begin_layout Plain Layout
13391 LyXDir/scripts/layout2layout.py
13396 and convert it to a temporary file in current format.
13397 The original file is left untouched.
13398 If you want to convert the layout file permanently, just call the converter
13402 \begin_layout LyX-Code
13403 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13406 \begin_layout Standard
13407 (You need to replace
13408 \begin_inset Flex CharStyle:Code
13411 \begin_layout Plain Layout
13417 with the name of your LyX system directory, unless you happen to have defined
13418 such an environment variable.) Then copy
13419 \begin_inset Flex CharStyle:Code
13422 \begin_layout Plain Layout
13429 \begin_inset Flex CharStyle:Code
13432 \begin_layout Plain Layout
13441 \begin_layout Standard
13442 The automatic conversion only handles syntax changes.
13443 It cannot handle the case where the contents of included files was changed,
13444 so these will have to be converted separately.
13447 \begin_layout Section
13449 \begin_inset CommandInset label
13451 name "sec:templates"
13458 \begin_layout Standard
13459 Templates are created just like usual documents.
13460 The only difference is that usual documents contain all possible settings,
13461 including the font scheme and the paper size.
13462 Usually a user doesn't want a template to overwrite his defaults in these
13464 For that reason, the designer of a template should remove the corresponding
13466 \begin_inset Flex CharStyle:Code
13469 \begin_layout Plain Layout
13478 \begin_inset Flex CharStyle:Code
13481 \begin_layout Plain Layout
13489 from the template LyX file.
13490 This can be done with any simple text-editor, for example
13491 \begin_inset Flex CharStyle:Code
13494 \begin_layout Plain Layout
13501 \begin_inset Flex CharStyle:Code
13504 \begin_layout Plain Layout
13514 \begin_layout Standard
13515 Put the edited template files you create in
13516 \begin_inset Flex CharStyle:Code
13519 \begin_layout Plain Layout
13525 , copy the ones you use from the global template directory in
13526 \begin_inset Flex CharStyle:Code
13529 \begin_layout Plain Layout
13535 to the same place, and redefine the template path in the
13536 \begin_inset Flex CharStyle:MenuItem
13539 \begin_layout Plain Layout
13540 Tools\SpecialChar \menuseparator
13541 Preferences\SpecialChar \menuseparator
13550 \begin_layout Standard
13551 Note that there is a template which has a particular meaning:
13552 \begin_inset Flex CharStyle:Code
13555 \begin_layout Plain Layout
13562 This template is loaded every time you create a new document with
13563 \begin_inset Flex CharStyle:MenuItem
13566 \begin_layout Plain Layout
13567 File\SpecialChar \menuseparator
13573 in order to provide useful defaults.
13574 To create this template from inside LyX, all you have to do is to open
13575 a document with the correct settings, and use the
13576 \begin_inset Flex CharStyle:MenuItem
13579 \begin_layout Plain Layout
13580 Save as Document Defaults
13588 \begin_layout Chapter
13589 Including External Material
13592 \begin_layout Standard
13593 \begin_inset Box Shadowbox
13602 height_special "totalheight"
13605 \begin_layout Plain Layout
13606 WARNING: This portion of the documentation has not been updated for some
13608 We certainly hope that it is still accurate, but there are no guarantees.
13616 \begin_layout Standard
13617 The use of material from sources external to LyX is covered in detail in
13623 This part of the manual covers what needs to happen behind the scenes for
13624 new sorts of material to be included.
13627 \begin_layout Section
13631 \begin_layout Standard
13632 The external material feature is based on the concept of a
13637 A template is a specification of how LyX should interface with a certain
13639 As bundled, LyX comes with predefined templates for Xfig figures, various
13640 raster format images, chess diagrams, and LilyPond music notation.
13641 You can check the actual list by using the menu
13642 \begin_inset Flex CharStyle:MenuItem
13645 \begin_layout Plain Layout
13646 Insert\SpecialChar \menuseparator
13647 File\SpecialChar \menuseparator
13654 Furthermore, it is possible to roll your own template to support a specific
13656 Later we'll describe in more detail what is involved, and hopefully you
13657 will submit all the templates you create so we can include them in a later
13661 \begin_layout Standard
13662 Another basic idea of the external material feature is to distinguish between
13663 the original file that serves as a base for final material and the produced
13664 file that is included in your exported or printed document.
13665 For example, consider the case of a figure produced with
13666 \begin_inset Flex CharStyle:Code
13669 \begin_layout Plain Layout
13676 The Xfig application itself works on an original file with the
13677 \begin_inset Flex CharStyle:Code
13680 \begin_layout Plain Layout
13687 Within Xfig, you create and change your figure, and when you are done,
13689 \begin_inset Flex CharStyle:Code
13692 \begin_layout Plain Layout
13699 When you want to include the figure in your document, you invoke
13700 \begin_inset Flex CharStyle:Code
13703 \begin_layout Plain Layout
13709 in order to create a PostScript file that can readily be included in your
13712 \begin_inset Flex CharStyle:Code
13715 \begin_layout Plain Layout
13721 file is the original file, and the PostScript file is the produced file.
13724 \begin_layout Standard
13725 This distinction is important in order to allow updating of the material
13726 while you are in the process of writing the document.
13727 Furthermore, it provides us with the flexibility that is needed to support
13728 multiple export formats.
13729 For instance, in the case of a plain text file, it is not exactly an award-winn
13730 ing idea to include the figure as raw PostScript.
13731 Instead, you'd either prefer to just include a reference to the figure
13732 or try to invoke some graphics to ASCII converter to make the final result
13733 look similar to the real graphics.
13734 The external material management allows you to do this, because it is parametri
13735 zed on the different export formats that LyX supports.
13738 \begin_layout Standard
13739 Besides supporting the production of different products according to the
13740 exported format, it supports tight integration with editing and viewing
13742 In the case of an Xfig figure, you are able to invoke Xfig on the original
13743 file with a single click from within the external material dialog in LyX,
13744 and also preview the produced PostScript file with Ghostview with another
13746 No more fiddling around with the command line and/or file browsers to locate
13747 and manipulate the original or produced files.
13748 In this way, you are finally able to take full advantage of the many different
13749 applications that are relevant to use when you write your documents, and
13750 ultimately be more productive.
13753 \begin_layout Section
13754 The external template configuration file
13757 \begin_layout Standard
13758 It is relatively easy to add custom external template definitions to LyX.
13759 However, be aware that doing this in an careless manner most probably
13763 introduce an easily exploitable security hole.
13764 So before you do this, please read the discussion about security in section
13766 \begin_inset CommandInset ref
13768 reference "sec:Security-discussion"
13775 \begin_layout Standard
13776 Having said that, we encourage you to submit any interesting templates that
13781 \begin_layout Standard
13782 The external templates are defined in the
13783 \begin_inset Flex CharStyle:Code
13786 \begin_layout Plain Layout
13787 LyXDir/lib/external_templates
13793 You can place your own version in
13794 \begin_inset Flex CharStyle:Code
13797 \begin_layout Plain Layout
13798 UserDir/external_templates
13806 \begin_layout Standard
13807 A typical template looks like this:
13810 \begin_layout LyX-Code
13814 \begin_layout LyX-Code
13815 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
13818 \begin_layout LyX-Code
13822 \begin_layout LyX-Code
13826 \begin_layout LyX-Code
13830 \begin_layout LyX-Code
13834 \begin_layout LyX-Code
13838 \begin_layout LyX-Code
13839 AutomaticProduction true
13842 \begin_layout LyX-Code
13846 \begin_layout LyX-Code
13850 \begin_layout LyX-Code
13854 \begin_layout LyX-Code
13855 TransformCommand Rotate RotationLatexCommand
13858 \begin_layout LyX-Code
13859 TransformCommand Resize ResizeLatexCommand
13862 \begin_layout LyX-Code
13863 Product "$$RotateFront$$ResizeFront
13866 \begin_layout LyX-Code
13871 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
13874 \begin_layout LyX-Code
13875 $$ResizeBack$$RotateBack"
13878 \begin_layout LyX-Code
13882 \begin_layout LyX-Code
13883 UpdateResult "$$AbsPath$$Basename.pstex_t"
13886 \begin_layout LyX-Code
13887 Requirement "graphicx"
13890 \begin_layout LyX-Code
13891 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
13894 \begin_layout LyX-Code
13895 ReferencedFile latex "$$AbsPath$$Basename.eps"
13898 \begin_layout LyX-Code
13899 ReferencedFile dvi "$$AbsPath$$Basename.eps"
13902 \begin_layout LyX-Code
13906 \begin_layout LyX-Code
13910 \begin_layout LyX-Code
13911 TransformCommand Rotate RotationLatexCommand
13914 \begin_layout LyX-Code
13915 TransformCommand Resize ResizeLatexCommand
13918 \begin_layout LyX-Code
13919 Product "$$RotateFront$$ResizeFront
13922 \begin_layout LyX-Code
13927 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
13930 \begin_layout LyX-Code
13931 $$ResizeBack$$RotateBack"
13934 \begin_layout LyX-Code
13935 UpdateFormat pdftex
13938 \begin_layout LyX-Code
13939 UpdateResult "$$AbsPath$$Basename.pdftex_t"
13942 \begin_layout LyX-Code
13943 Requirement "graphicx"
13946 \begin_layout LyX-Code
13947 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
13950 \begin_layout LyX-Code
13951 ReferencedFile latex "$$AbsPath$$Basename.pdf"
13954 \begin_layout LyX-Code
13958 \begin_layout LyX-Code
13962 \begin_layout LyX-Code
13963 Product "$$Contents(
13965 "$$AbsPath$$Basename.asc
13970 \begin_layout LyX-Code
13971 UpdateFormat asciixfig
13974 \begin_layout LyX-Code
13975 UpdateResult "$$AbsPath$$Basename.asc"
13978 \begin_layout LyX-Code
13982 \begin_layout LyX-Code
13986 \begin_layout LyX-Code
13987 Product "<graphic fileref=
13989 "$$AbsOrRelPathMaster$$Basename.eps
13994 \begin_layout LyX-Code
13998 \begin_layout LyX-Code
14002 \begin_layout LyX-Code
14003 UpdateResult "$$AbsPath$$Basename.eps"
14006 \begin_layout LyX-Code
14007 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14010 \begin_layout LyX-Code
14011 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14014 \begin_layout LyX-Code
14018 \begin_layout LyX-Code
14019 Product "[XFig: $$FName]"
14022 \begin_layout LyX-Code
14026 \begin_layout LyX-Code
14030 \begin_layout Standard
14031 As you can see, the template is enclosed in
14032 \begin_inset Flex CharStyle:Code
14035 \begin_layout Plain Layout
14041 \SpecialChar \ldots{}
14043 \begin_inset Flex CharStyle:Code
14046 \begin_layout Plain Layout
14053 It contains a header specifying some general settings and, for each supported
14054 primary document file format, a section
14055 \begin_inset Flex CharStyle:Code
14058 \begin_layout Plain Layout
14064 \SpecialChar \ldots{}
14066 \begin_inset Flex CharStyle:Code
14069 \begin_layout Plain Layout
14078 \begin_layout Subsection
14079 The template header
14082 \begin_layout Description
14083 \begin_inset Flex CharStyle:Code
14086 \begin_layout Plain Layout
14087 AutomaticProduction
14088 \begin_inset space ~
14096 Whether the file represented by the template must be generated by LyX.
14097 This command must occur exactly once.
14100 \begin_layout Description
14101 \begin_inset Flex CharStyle:Code
14104 \begin_layout Plain Layout
14106 \begin_inset space ~
14114 A glob pattern that is used in the file dialog to filter out the desired
14116 If there is more than one possible file extension (e.
14117 \begin_inset space \thinspace{}
14121 \begin_inset space \space{}
14125 \begin_inset Flex CharStyle:Code
14128 \begin_layout Plain Layout
14135 \begin_inset Flex CharStyle:Code
14138 \begin_layout Plain Layout
14144 ), use something like
14145 \begin_inset Flex CharStyle:Code
14148 \begin_layout Plain Layout
14155 This command must occur exactly once.
14158 \begin_layout Description
14159 \begin_inset Flex CharStyle:Code
14162 \begin_layout Plain Layout
14164 \begin_inset space ~
14172 The text that is displayed on the button.
14173 This command must occur exactly once.
14176 \begin_layout Description
14177 \begin_inset Flex CharStyle:Code
14180 \begin_layout Plain Layout
14182 \begin_inset space ~
14186 \begin_inset space ~
14194 The help text that is used in the External dialog.
14195 Provide enough information to explain to the user just what the template
14196 can provide him with.
14197 This command must occur exactly once.
14200 \begin_layout Description
14201 \begin_inset Flex CharStyle:Code
14204 \begin_layout Plain Layout
14206 \begin_inset space ~
14214 The file format of the original file.
14215 This must be the name of a format that is known to LyX (see section
14216 \begin_inset CommandInset ref
14218 reference "sub:Formats"
14224 \begin_inset Quotes eld
14228 \begin_inset Flex CharStyle:Code
14231 \begin_layout Plain Layout
14238 \begin_inset Quotes erd
14241 if the template can handle original files of more than one format.
14242 LyX will attempt to interrogate the file itself in order to deduce its
14243 format in this case.
14244 This command must occur exactly once.
14247 \begin_layout Description
14248 \begin_inset Flex CharStyle:Code
14251 \begin_layout Plain Layout
14253 \begin_inset space ~
14261 A unique name for the template.
14262 It must not contain substitution macros (see below).
14265 \begin_layout Description
14266 \begin_inset Flex CharStyle:Code
14269 \begin_layout Plain Layout
14271 \begin_inset space ~
14274 Rotate|Resize|Clip|Extra
14279 This command specifies which transformations are supported by this template.
14280 It may occur zero or more times.
14281 This command enables the corresponding tabs in the external dialog.
14283 \begin_inset Flex CharStyle:Code
14286 \begin_layout Plain Layout
14292 command must have either a corresponding
14293 \begin_inset Flex CharStyle:Code
14296 \begin_layout Plain Layout
14303 \begin_inset Flex CharStyle:Code
14306 \begin_layout Plain Layout
14313 \begin_inset Flex CharStyle:Code
14316 \begin_layout Plain Layout
14323 Otherwise the transformation will not be supported by that format.
14326 \begin_layout Subsection
14330 \begin_layout Description
14331 \begin_inset Flex CharStyle:Code
14334 \begin_layout Plain Layout
14336 \begin_inset space ~
14339 LaTeX|PDFLaTeX|PlainText|DocBook
14344 The primary document file format that this format definition is for.
14345 Not every template has a sensible representation in all document file formats.
14346 Please define nevertheless a
14347 \begin_inset Flex CharStyle:Code
14350 \begin_layout Plain Layout
14356 section for all formats.
14357 Use a dummy text when no representation is available.
14358 Then you can at least see a reference to the external material in the exported
14362 \begin_layout Description
14363 \begin_inset Flex CharStyle:Code
14366 \begin_layout Plain Layout
14368 \begin_inset space ~
14372 \begin_inset space ~
14380 This command defines an additional macro
14381 \begin_inset Flex CharStyle:Code
14384 \begin_layout Plain Layout
14390 for substitution in
14391 \begin_inset Flex CharStyle:Code
14394 \begin_layout Plain Layout
14402 \begin_inset Flex CharStyle:Code
14405 \begin_layout Plain Layout
14411 itself may contain substitution macros.
14412 The advantage over using
14413 \begin_inset Flex CharStyle:Code
14416 \begin_layout Plain Layout
14423 \begin_inset Flex CharStyle:Code
14426 \begin_layout Plain Layout
14432 is that the substituted value of
14433 \begin_inset Flex CharStyle:Code
14436 \begin_layout Plain Layout
14442 is sanitized so that it is a valid optional argument in the document format.
14443 This command may occur zero or more times.
14446 \begin_layout Description
14447 \begin_inset Flex CharStyle:Code
14450 \begin_layout Plain Layout
14452 \begin_inset space ~
14460 The text that is inserted in the exported document.
14461 This is actually the most important command and can be quite complex.
14462 This command must occur exactly once.
14465 \begin_layout Description
14466 \begin_inset Flex CharStyle:Code
14469 \begin_layout Plain Layout
14471 \begin_inset space ~
14479 This command specifies a preamble snippet that will be included in the
14481 It has to be defined using
14482 \begin_inset Flex CharStyle:Code
14485 \begin_layout Plain Layout
14491 \SpecialChar \ldots{}
14493 \begin_inset Flex CharStyle:Code
14496 \begin_layout Plain Layout
14503 This command may occur zero or more times.
14506 \begin_layout Description
14507 \begin_inset Flex CharStyle:Code
14510 \begin_layout Plain Layout
14512 \begin_inset space ~
14516 \begin_inset space ~
14524 This command denotes files that are created by the conversion process and
14525 are needed for a particular export format.
14526 If the filename is relative, it is interpreted relative to the master document.
14527 This command may be given zero or more times.
14530 \begin_layout Description
14531 \begin_inset Flex CharStyle:Code
14534 \begin_layout Plain Layout
14536 \begin_inset space ~
14544 The name of a required LaTeX package.
14545 The package is included via
14546 \begin_inset Flex CharStyle:Code
14549 \begin_layout Plain Layout
14557 in the LaTeX preamble.
14558 This command may occur zero or more times.
14561 \begin_layout Description
14562 \begin_inset Flex CharStyle:Code
14565 \begin_layout Plain Layout
14567 \begin_inset space ~
14571 \begin_inset space ~
14574 RotationLatexCommand
14579 This command specifies that the built in LaTeX command should be used for
14581 This command may occur once or not at all.
14584 \begin_layout Description
14585 \begin_inset Flex CharStyle:Code
14588 \begin_layout Plain Layout
14590 \begin_inset space ~
14594 \begin_inset space ~
14602 This command specifies that the built in LaTeX command should be used for
14604 This command may occur once or not at all.
14607 \begin_layout Description
14608 \begin_inset Flex CharStyle:Code
14611 \begin_layout Plain Layout
14613 \begin_inset space ~
14617 \begin_inset space ~
14620 RotationLatexOption
14625 This command specifies that rotation is done via an optional argument.
14626 This command may occur once or not at all.
14629 \begin_layout Description
14630 \begin_inset Flex CharStyle:Code
14633 \begin_layout Plain Layout
14635 \begin_inset space ~
14639 \begin_inset space ~
14647 This command specifies that resizing is done via an optional argument.
14648 This command may occur once or not at all.
14651 \begin_layout Description
14652 \begin_inset Flex CharStyle:Code
14655 \begin_layout Plain Layout
14657 \begin_inset space ~
14661 \begin_inset space ~
14669 This command specifies that clipping is done via an optional argument.
14670 This command may occur once or not at all.
14673 \begin_layout Description
14674 \begin_inset Flex CharStyle:Code
14677 \begin_layout Plain Layout
14679 \begin_inset space ~
14683 \begin_inset space ~
14691 This command specifies that an extra optional argument is used.
14692 This command may occur once or not at all.
14695 \begin_layout Description
14696 \begin_inset Flex CharStyle:Code
14699 \begin_layout Plain Layout
14701 \begin_inset space ~
14709 The file format of the converted file.
14710 This must be the name of a format that is known to LyX (see the
14711 \begin_inset Flex CharStyle:MenuItem
14714 \begin_layout Plain Layout
14719 ools\SpecialChar \menuseparator
14724 references:Conversion
14730 This command must occur exactly once.
14733 \begin_layout Description
14734 \begin_inset Flex CharStyle:Code
14737 \begin_layout Plain Layout
14739 \begin_inset space ~
14747 The file name of the converted file.
14748 The file name must be absolute.
14749 This command must occur exactly once.
14752 \begin_layout Subsection
14753 Preamble definitions
14756 \begin_layout Standard
14757 The external template configuration file may contain additional preamble
14758 definitions enclosed by
14759 \begin_inset Flex CharStyle:Code
14762 \begin_layout Plain Layout
14768 \SpecialChar \ldots{}
14770 \begin_inset Flex CharStyle:Code
14773 \begin_layout Plain Layout
14780 They can be used by the templates in the
14781 \begin_inset Flex CharStyle:Code
14784 \begin_layout Plain Layout
14793 \begin_layout Section
14794 The substitution mechanism
14797 \begin_layout Standard
14798 When the external material facility invokes an external program, it is done
14799 on the basis of a command defined in the template configuration file.
14800 These commands can contain various macros that are expanded before execution.
14801 Execution always take place in the directory of the containing document.
14804 \begin_layout Standard
14805 Also, whenever external material is to be displayed, the name will be produced
14806 by the substitution mechanism, and most other commands in the template
14807 definition support substitution as well.
14810 \begin_layout Standard
14811 The available macros are the following:
14814 \begin_layout Description
14815 \begin_inset Flex CharStyle:Code
14818 \begin_layout Plain Layout
14819 $$AbsOrRelPathMaster
14824 The file path, absolute or relative to the master LyX document.
14827 \begin_layout Description
14828 \begin_inset Flex CharStyle:Code
14831 \begin_layout Plain Layout
14832 $$AbsOrRelPathParent
14837 The file path, absolute or relative to the LyX document.
14840 \begin_layout Description
14841 \begin_inset Flex CharStyle:Code
14844 \begin_layout Plain Layout
14850 The absolute file path.
14853 \begin_layout Description
14854 \begin_inset Flex CharStyle:Code
14857 \begin_layout Plain Layout
14863 The filename without path and without the extension.
14866 \begin_layout Description
14867 \begin_inset Flex CharStyle:Code
14870 \begin_layout Plain Layout
14872 \begin_inset Quotes eld
14876 \begin_inset Quotes erd
14884 This macro will expand to the contents of the file with the name
14885 \begin_inset Flex CharStyle:Code
14888 \begin_layout Plain Layout
14897 \begin_layout Description
14898 \begin_inset Flex CharStyle:Code
14901 \begin_layout Plain Layout
14907 The file extension (including the dot).
14910 \begin_layout Description
14911 \begin_inset Flex CharStyle:Code
14914 \begin_layout Plain Layout
14920 The filename of the file specified in the external material dialog.
14921 This is either an absolute name, or it is relative to the LyX document.
14924 \begin_layout Description
14925 \begin_inset Flex CharStyle:Code
14928 \begin_layout Plain Layout
14935 \begin_inset Flex CharStyle:Code
14938 \begin_layout Plain Layout
14944 (absolute name or relative to the LyX document).
14947 \begin_layout Description
14948 \begin_inset Flex CharStyle:Code
14951 \begin_layout Plain Layout
14957 The file path, relative to the master LyX document.
14960 \begin_layout Description
14961 \begin_inset Flex CharStyle:Code
14964 \begin_layout Plain Layout
14970 The file path, relative to the LyX document.
14973 \begin_layout Description
14974 \begin_inset Flex CharStyle:Code
14977 \begin_layout Plain Layout
14983 This macro will expand to the absolute path of the system directory.
14984 This is typically used to point to the various helper scripts that are
14988 \begin_layout Description
14989 \begin_inset Flex CharStyle:Code
14992 \begin_layout Plain Layout
14998 A name and full path to a temporary file which will be automatically deleted
14999 whenever the containing document is closed, or the external material insertion
15003 \begin_layout Standard
15004 All path macros contain a trailing directory separator, so you can construct
15006 \begin_inset space \thinspace{}
15010 \begin_inset space \space{}
15013 the absolute filename with
15014 \begin_inset Flex CharStyle:Code
15017 \begin_layout Plain Layout
15018 $$AbsPath$$Basename$$Extension
15026 \begin_layout Standard
15027 The macros above are substituted in all commands unless otherwise noted.
15029 \begin_inset Flex CharStyle:Code
15032 \begin_layout Plain Layout
15038 supports additionally the following substitutions if they are enabled by
15040 \begin_inset Flex CharStyle:Code
15043 \begin_layout Plain Layout
15050 \begin_inset Flex CharStyle:Code
15053 \begin_layout Plain Layout
15062 \begin_layout Description
15063 \begin_inset Flex CharStyle:Code
15066 \begin_layout Plain Layout
15072 The front part of the resize command.
15075 \begin_layout Description
15076 \begin_inset Flex CharStyle:Code
15079 \begin_layout Plain Layout
15085 The back part of the resize command.
15088 \begin_layout Description
15089 \begin_inset Flex CharStyle:Code
15092 \begin_layout Plain Layout
15098 The front part of the rotation command.
15101 \begin_layout Description
15102 \begin_inset Flex CharStyle:Code
15105 \begin_layout Plain Layout
15111 The back part of the rotation command.
15114 \begin_layout Standard
15115 The value string of the
15116 \begin_inset Flex CharStyle:Code
15119 \begin_layout Plain Layout
15125 command supports additionally the following substitutions if they are enabled
15127 \begin_inset Flex CharStyle:Code
15130 \begin_layout Plain Layout
15137 \begin_inset Flex CharStyle:Code
15140 \begin_layout Plain Layout
15149 \begin_layout Description
15150 \begin_inset Flex CharStyle:Code
15153 \begin_layout Plain Layout
15162 \begin_layout Description
15163 \begin_inset Flex CharStyle:Code
15166 \begin_layout Plain Layout
15175 \begin_layout Description
15176 \begin_inset Flex CharStyle:Code
15179 \begin_layout Plain Layout
15188 \begin_layout Description
15189 \begin_inset Flex CharStyle:Code
15192 \begin_layout Plain Layout
15198 The rotation option.
15201 \begin_layout Standard
15202 You may ask why there are so many path macros.
15203 There are mainly two reasons:
15206 \begin_layout Enumerate
15207 Relative and absolute file names should remain relative or absolute, respectivel
15209 Users may have reasons to prefer either form.
15210 Relative names are useful for portable documents that should work on different
15211 machines, for example.
15212 Absolute names may be required by some programs.
15215 \begin_layout Enumerate
15216 LaTeX treats relative file names differently than LyX and other programs
15217 in nested included files.
15218 For LyX, a relative file name is always relative to the document that contains
15220 For LaTeX, it is always relative to the master document.
15221 These two definitions are identical if you have only one document, but
15222 differ if you have a master document that includes part documents.
15223 That means that relative filenames must be transformed when presented to
15225 Fortunately LyX does this automatically for you if you choose the right
15229 \begin_layout Standard
15230 So which path macro should be used in new template definitions? The rule
15234 \begin_layout Itemize
15236 \begin_inset Flex CharStyle:Code
15239 \begin_layout Plain Layout
15245 if an absolute path is required.
15248 \begin_layout Itemize
15250 \begin_inset Flex CharStyle:Code
15253 \begin_layout Plain Layout
15254 $$AbsOrRelPathMaster
15259 if the substituted string is some kind of LaTeX input.
15262 \begin_layout Itemize
15264 \begin_inset Flex CharStyle:Code
15267 \begin_layout Plain Layout
15268 $$AbsOrRelPathParent
15273 in order to preserve the user's choice.
15276 \begin_layout Standard
15277 There are special cases where this rule does not work and e.
15278 \begin_inset space \thinspace{}
15282 \begin_inset space \space{}
15285 relative names are needed, but normally it will work just fine.
15286 One example for such a case is the command
15287 \begin_inset Flex CharStyle:Code
15290 \begin_layout Plain Layout
15291 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15296 in the XFig template above: We can't use the absolute name because the
15298 \begin_inset Flex CharStyle:Code
15301 \begin_layout Plain Layout
15307 files needs the relative name in order to rewrite the file content.
15310 \begin_layout Section
15311 \begin_inset CommandInset label
15313 name "sec:Security-discussion"
15317 Security discussion
15320 \begin_layout Standard
15321 \begin_inset Box Shadowbox
15330 height_special "totalheight"
15333 \begin_layout Plain Layout
15334 WARNING: This section is definitely outdated.
15342 \begin_layout Standard
15343 The external material feature interfaces with a lot of external programs
15344 and does so automatically, so we have to consider the security implications
15346 In particular, since you have the option of including your own filenames
15347 and/or parameter strings and those are expanded into a command, it seems
15348 that it would be possible to create a malicious document which executes
15349 arbitrary commands when a user views or prints the document.
15350 This is something we definitely want to avoid.
15353 \begin_layout Standard
15354 However, since the external program commands are specified in the template
15355 configuration file only, there are no security issues if LyX is properly
15356 configured with safe templates only.
15357 This is so because the external programs are invoked with the
15358 \begin_inset Flex CharStyle:Code
15361 \begin_layout Plain Layout
15367 -system call rather than the
15368 \begin_inset Flex CharStyle:Code
15371 \begin_layout Plain Layout
15377 system-call, so it's not possible to execute arbitrary commands from the
15378 filename or parameter section via the shell.
15381 \begin_layout Standard
15382 This also implies that you are restricted in what command strings you can
15383 use in the external material templates.
15384 In particular, pipes and redirection are not readily available.
15385 This has to be so if LyX should remain safe.
15386 If you want to use some of the shell features, you should write a safe
15387 script to do this in a controlled manner, and then invoke the script from
15388 the command string.
15390 \begin_inset Flex CharStyle:Code
15393 \begin_layout Plain Layout
15399 directory of the LyX installation, you can find a safe wrapper script
15400 \begin_inset Flex CharStyle:Code
15403 \begin_layout Plain Layout
15404 general_command_wrapper.py
15409 that supports redirection of input and output.
15410 That can serve as an example for how to write safe template scripts.
15411 For a more advanced example that uses
15412 \begin_inset Flex CharStyle:Code
15415 \begin_layout Plain Layout
15421 and friends, take a look at the
15422 \begin_inset Flex CharStyle:Code
15425 \begin_layout Plain Layout
15434 \begin_layout Standard
15435 It is possible to design a template that interacts directly with the shell,
15436 but since this would allow a malicious user to execute arbitrary commands
15437 by writing clever filenames and/or parameters, we generally recommend that
15438 you only use safe scripts that work with the
15439 \begin_inset Flex CharStyle:Code
15442 \begin_layout Plain Layout
15448 system call in a controlled manner.
15449 Of course, for use in a controlled environment, it can be tempting to just
15450 fall back to use ordinary shell scripts.
15451 If you do so, be aware that you
15455 provide an easily exploitable security hole in your system.
15456 Of course it stands to reason that such unsafe templates will never be
15457 included in the standard LyX distribution, although we do encourage people
15458 to submit new templates in the open source tradition.
15459 But LyX as shipped from the official distribution channels will never have
15463 \begin_layout Standard
15464 Including external material provides a lot of power, and you have to be
15465 careful not to introduce security hazards with this power.
15466 A subtle error in a single line in an innocent looking script can open
15467 the door to huge security problems.
15468 So if you do not fully understand the issues, we recommend that you consult
15469 a knowledgeable security professional or the LyX development team if you
15470 have any questions about whether a given template is safe or not.
15471 And do this before you use it in an uncontrolled environment.