1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that 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
4100 This is the dead key
4104 \begin_layout Plain Layout
4111 refers to a key that does not produce a character by itself, but when followed
4112 with another key, produces the desired accent character.
4113 For example, a German characte
4115 r with an umlaut like
4125 can be produced in this manner.
4134 \begin_layout Standard
4147 and then another key not in
4164 followed by the other, not allowed key, as output.
4168 \begin_inset Flex CharStyle:MenuItem
4171 \begin_layout Plain Layout
4179 cancels a dead key, so if
4190 \begin_inset Flex CharStyle:Code
4193 \begin_layout Plain Layout
4199 , the cursor will not go one position backwards but will instead cancel
4215 might have had on the next keystroke.
4219 \begin_layout Standard
4220 The following example specifies that the character ' is to be an acute accent,
4221 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4224 \begin_layout LyX-Code
4227 kmod ' acute aeiouAEIOU
4230 \begin_layout Labeling
4231 \labelwidthstring 00.00.0000
4232 \begin_inset Flex CharStyle:Code
4235 \begin_layout Plain Layout
4241 Specify an exception to the accent character
4244 \begin_layout LyX-Code
4253 \begin_layout Standard
4254 This defines an exce
4295 have been assigned a keystroke with a previous
4298 \begin_inset Flex CharStyle:Code
4301 \begin_layout Plain Layout
4325 must not belong in the
4372 If such a declaration does not exist in
4380 \begin_inset Flex CharStyle:Code
4383 \begin_layout Plain Layout
4417 \begin_inset Flex CharStyle:Code
4420 \begin_layout Plain Layout
4434 \begin_layout Standard
4435 The following command produces causes äi to be produced when you enter acute-i
4439 \begin_layout LyX-Code
4453 \begin_layout Labeling
4454 \labelwidthstring 00.00.0000
4455 \begin_inset Flex CharStyle:Code
4458 \begin_layout Plain Layout
4464 Combine two accent characters
4467 \begin_layout LyX-Code
4473 accent1 accent2 allowed
4476 \begin_layout Standard
4477 This one is getting pretty esoteric.
4478 It allows you to combine the effect
4534 \begin_inset Flex CharStyle:Code
4537 \begin_layout Plain Layout
4565 \begin_layout Standard
4566 Consider this example from the
4567 \begin_inset Flex CharStyle:Code
4570 \begin_layout Plain Layout
4581 \begin_layout LyX-Code
4584 kmod ; acute aeioyvhAEIOYVH
4587 \begin_layout LyX-Code
4593 \begin_layout LyX-Code
4596 kcomb acute umlaut iyIY
4599 \begin_layout Standard
4600 This allows you to press
4601 \begin_inset Flex CharStyle:MenuItem
4604 \begin_layout Plain Layout
4612 and get the effect of
4613 \begin_inset Flex CharStyle:Code
4616 \begin_layout Plain Layout
4635 in this case cancels the last dead key, so if you press
4636 \begin_inset Flex CharStyle:MenuItem
4639 \begin_layout Plain Layout
4648 \begin_inset Flex CharStyle:Code
4651 \begin_layout Plain Layout
4664 \begin_layout Subsection
4668 \begin_layout Standard
4670 \begin_inset Flex CharStyle:Code
4673 \begin_layout Plain Layout
4681 mapping is performed, a
4682 \begin_inset Flex CharStyle:Code
4685 \begin_layout Plain Layout
4695 file maps the strings that the symbols generate to characters in the current
4697 The LyX distribution currently includes at least the
4698 \begin_inset Flex CharStyle:Code
4701 \begin_layout Plain Layout
4710 \begin_inset Flex CharStyle:Code
4713 \begin_layout Plain Layout
4724 \begin_layout Standard
4726 \begin_inset Flex CharStyle:Code
4729 \begin_layout Plain Layout
4737 file is a sequence of declarations of the form
4740 \begin_layout LyX-Code
4753 \begin_layout Standard
4754 For example, in order to map
4755 \begin_inset Flex CharStyle:MenuItem
4758 \begin_layout Plain Layout
4768 to the corresponding character in the iso-8859-1 set (233), the following
4772 \begin_layout LyX-Code
4780 \begin_layout Standard
4782 \begin_inset Flex CharStyle:Code
4785 \begin_layout Plain Layout
4794 \begin_inset Flex CharStyle:Code
4797 \begin_layout Plain Layout
4815 the same character can apply to more than one string.
4817 \begin_inset Flex CharStyle:Code
4820 \begin_layout Plain Layout
4831 \begin_layout LyX-Code
4843 \begin_inset Newline newline
4859 \begin_layout Standard
4860 If LyX cannot find a mapping for the string produced by the keystroke or
4861 a deadkey sequence, it will check if it looks like an accented char and
4862 try to draw an accent over the character on screen.
4865 \begin_layout Subsection
4869 \begin_layout Standard
4870 There is a second way to add support for international characters through
4871 so-called dead-keys.
4872 A dead-key works in combination with a letter to produce an accented character.
4873 Here, we'll explain how to create a really simple dead-key to illustrate
4877 \begin_layout Standard
4878 Suppose you happen to need the circumflex character,
4879 \begin_inset Quotes eld
4883 \begin_inset Quotes erd
4888 \begin_inset Flex CharStyle:MenuItem
4891 \begin_layout Plain Layout
4898 \begin_inset space ~
4902 \begin_inset Flex CharStyle:MenuItem
4905 \begin_layout Plain Layout
4911 ] to the LyX command
4912 \begin_inset Flex CharStyle:Code
4915 \begin_layout Plain Layout
4922 \begin_inset Flex CharStyle:Code
4925 \begin_layout Plain Layout
4932 Now, whenever you type the
4933 \begin_inset Flex CharStyle:MenuItem
4936 \begin_layout Plain Layout
4942 -key followed by a letter, that letter will have a circumflex accent on
4944 For example, the sequence
4945 \begin_inset Quotes eld
4949 \begin_inset Flex CharStyle:MenuItem
4952 \begin_layout Plain Layout
4959 \begin_inset Quotes erd
4962 produces the letter:
4963 \begin_inset Quotes eld
4967 \begin_inset Quotes erd
4971 If you tried to type
4972 \begin_inset Quotes eld
4976 \begin_inset Flex CharStyle:MenuItem
4979 \begin_layout Plain Layout
4986 \begin_inset Quotes erd
4989 , however, LyX will complain with a beep, since a
4990 \begin_inset Quotes eld
4994 \begin_inset Flex CharStyle:MenuItem
4997 \begin_layout Plain Layout
5004 \begin_inset Quotes erd
5007 never takes a circumflex accent.
5009 \begin_inset Flex CharStyle:MenuItem
5012 \begin_layout Plain Layout
5018 after a dead-key produces the bare-accent.
5019 Please note this last point! If you bind a key to a dead-key, you'll need
5020 to rebind the character on that key to yet another key.
5022 \begin_inset Flex CharStyle:MenuItem
5025 \begin_layout Plain Layout
5031 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5034 \begin_layout Standard
5035 One common way to bind dead-keys is to use
5036 \begin_inset Flex CharStyle:MenuItem
5039 \begin_layout Plain Layout
5046 \begin_inset Flex CharStyle:MenuItem
5049 \begin_layout Plain Layout
5056 \begin_inset Flex CharStyle:MenuItem
5059 \begin_layout Plain Layout
5065 in combination with an accent, like
5066 \begin_inset Quotes eld
5070 \begin_inset Flex CharStyle:MenuItem
5073 \begin_layout Plain Layout
5080 \begin_inset Quotes erd
5084 \begin_inset Quotes eld
5088 \begin_inset Flex CharStyle:MenuItem
5091 \begin_layout Plain Layout
5098 \begin_inset Quotes erd
5102 \begin_inset Quotes eld
5106 \begin_inset Flex CharStyle:MenuItem
5109 \begin_layout Plain Layout
5116 \begin_inset Quotes erd
5120 Another way involves using
5121 \begin_inset Flex CharStyle:Code
5124 \begin_layout Plain Layout
5131 \begin_inset Flex CharStyle:Code
5134 \begin_layout Plain Layout
5140 to set up the special
5141 \begin_inset Flex CharStyle:Code
5144 \begin_layout Plain Layout
5152 \begin_inset Flex CharStyle:Code
5155 \begin_layout Plain Layout
5161 acts in some ways just like
5162 \begin_inset Flex CharStyle:MenuItem
5165 \begin_layout Plain Layout
5171 and permits you to bind keys to accented characters.
5172 You can also turn keys into dead-keys by binding them to something like
5174 \begin_inset Flex CharStyle:Code
5177 \begin_layout Plain Layout
5183 and then binding this symbolic key to the corresponding LyX command.
5187 \begin_layout Plain Layout
5192 : This is exactly what I do in my
5193 \begin_inset Flex CharStyle:Code
5196 \begin_layout Plain Layout
5203 \begin_inset Flex CharStyle:Code
5206 \begin_layout Plain Layout
5214 \begin_inset Flex CharStyle:MenuItem
5217 \begin_layout Plain Layout
5219 \begin_inset space ~
5228 \begin_inset Flex CharStyle:Code
5231 \begin_layout Plain Layout
5237 and a bunch of these
5238 \begin_inset Quotes eld
5242 \begin_inset Flex CharStyle:Code
5245 \begin_layout Plain Layout
5252 \begin_inset Quotes erd
5255 symbolic keys bound such things as
5256 \begin_inset Flex CharStyle:MenuItem
5259 \begin_layout Plain Layout
5261 \begin_inset space ~
5270 \begin_inset Flex CharStyle:MenuItem
5273 \begin_layout Plain Layout
5275 \begin_inset space ~
5284 This is how I produce my accented characters.
5289 You can make just about anything into the
5290 \begin_inset Flex CharStyle:Code
5293 \begin_layout Plain Layout
5300 \begin_inset Flex CharStyle:MenuItem
5303 \begin_layout Plain Layout
5309 keys, a spare function key, etc.
5310 As for the LyX commands that produce accents, check the entry for
5311 \begin_inset Flex CharStyle:Code
5314 \begin_layout Plain Layout
5325 You'll find the complete list there.
5328 \begin_layout Subsection
5329 Saving your Language Configuration
5332 \begin_layout Standard
5333 You can edit your preferences so that your desired language environment
5334 is automatically configured when LyX starts up, via the
5335 \begin_inset Flex CharStyle:MenuItem
5338 \begin_layout Plain Layout
5339 Edit\SpecialChar \menuseparator
5348 \begin_layout Chapter
5349 Installing New Document Classes, Layouts, and Templates
5350 \begin_inset CommandInset label
5352 name "chap:textclass"
5360 \begin_layout Plain Layout
5361 Installing New Document Classes
5369 \begin_layout Standard
5370 In this chapter, we describe the procedures for creating and installing
5371 new LyX layout and template files, as well as offer a refresher on correctly
5372 installing new LaTeX document classes.
5373 Some definitions: a document class is a LaTeX file (usually ending in
5374 \begin_inset Flex CharStyle:Code
5377 \begin_layout Plain Layout
5384 \begin_inset Flex CharStyle:Code
5387 \begin_layout Plain Layout
5393 ) that describes the format of a document such as an article, report, journal
5394 preprint, etc, and all the commands needed to realize that format.
5395 A layout file is a LyX file that corresponds to a LaTeX document class
5396 and that tells LyX how to
5397 \begin_inset Quotes eld
5401 \begin_inset Quotes erd
5404 things on the screen to make the display look something like the final
5406 More precisely, a layout file describes a
5407 \begin_inset Quotes eld
5411 \begin_inset Quotes erd
5414 which is the internal construct LyX uses to render the screen display.
5416 \begin_inset Quotes eld
5420 \begin_inset Quotes erd
5424 \begin_inset Quotes eld
5428 \begin_inset Quotes erd
5431 can be used somewhat interchangeably, but it is better to refer to the
5432 file as the layout, and the thing living in LyX's memory as the text class.
5433 A template file is simply a LyX document that contains a set of predefined
5434 entries for a given document class---entries that are generally required
5436 Templates are especially useful for things like journal manuscripts that
5437 are to be submitted electronically.
5440 \begin_layout Section
5441 Installing a new LaTeX package
5444 \begin_layout Standard
5445 Some installations may not include a LaTeX package that you would like to
5447 For example, you might need FoilTeX, a package for preparing slides or
5448 viewgraphs for overhead projectors.
5449 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5450 a user interface for that.
5451 For example on MiKTeX you start its program
5452 \begin_inset Quotes eld
5456 \begin_inset Quotes erd
5459 to get a list of available packages.
5460 To install one, right click on it or use the installing toolbar button.
5461 When the package you want to install is not in the list, but you have it
5463 \begin_inset Flex CharStyle:Code
5466 \begin_layout Plain Layout
5473 \begin_inset Flex CharStyle:Code
5476 \begin_layout Plain Layout
5482 -file, then copy these files to a subfolder of your LaTeX distribution,
5483 for example to the folder
5492 Then update the file name database of your LaTeX-distribution.
5493 For example on MiKTeX this is done by pressing the button
5496 \begin_inset space ~
5501 that you find in MiKTeX's
5502 \begin_inset Quotes eld
5506 \begin_inset Quotes erd
5510 In both cases you need afterwards to reconfigure LyX using the menu
5511 \begin_inset Flex CharStyle:MenuItem
5514 \begin_layout Plain Layout
5515 Tools\SpecialChar \menuseparator
5521 and then to restart LyX.
5524 \begin_layout Standard
5525 If your LaTeX distribution doesn't provide a user interface, then you can
5526 follow these steps by using a UNIX/Linux console.
5529 \begin_layout Enumerate
5530 Get the package from
5531 \begin_inset CommandInset href
5534 target "http://www.ctan.org/"
5541 \begin_layout Enumerate
5542 You can install this package in several different places.
5543 If you want it to be available for all users on your system, then you should
5544 install it in your `local' TeX tree; if you want (or need) it to be available
5545 just for you, then you can install it in your own `user' TeX tree.
5546 Where these should be created, if they do not already exist, depends upon
5547 the details of your system.
5548 To find out, look in the file
5549 \begin_inset Flex CharStyle:Code
5552 \begin_layout Plain Layout
5562 \begin_layout Plain Layout
5563 This usually lives in the directory
5564 \begin_inset Flex CharStyle:Code
5567 \begin_layout Plain Layout
5573 , though you can run
5574 \begin_inset Flex CharStyle:Code
5577 \begin_layout Plain Layout
5588 The location of the `local' TeX tree is defined by
5589 \begin_inset Flex CharStyle:Code
5592 \begin_layout Plain Layout
5598 ; this is usually somewhere like
5599 \begin_inset Flex CharStyle:Code
5602 \begin_layout Plain Layout
5603 /usr/local/share/texmf/
5609 The `user' TeX tree is defined by
5610 \begin_inset Flex CharStyle:Code
5613 \begin_layout Plain Layout
5620 \begin_inset Flex CharStyle:Code
5623 \begin_layout Plain Layout
5630 (If these variables are not predefined, you can define them.) You'll probably
5631 need root permissions to create or modify the `local' tree; but your `user'
5632 tree shouldn't have such limitations.
5635 \begin_layout Enumerate
5637 \begin_inset Flex CharStyle:Code
5640 \begin_layout Plain Layout
5647 \begin_inset Flex CharStyle:Code
5650 \begin_layout Plain Layout
5657 \begin_inset Flex CharStyle:Code
5660 \begin_layout Plain Layout
5667 \begin_inset space \thinspace{}
5671 \begin_inset Newline newline
5675 \begin_inset Flex CharStyle:Code
5678 \begin_layout Plain Layout
5679 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5685 \begin_inset Newline newline
5688 But, again, most of this will
5689 \begin_inset Quotes eld
5693 \begin_inset Quotes erd
5699 \begin_layout Enumerate
5704 \begin_layout Plain Layout
5705 We'll assume henceforth that you're defining `local' TeX tree.
5706 If you're defining a user tree, just adjust as necessary.
5712 You must follow the directory structure of your existing
5713 \begin_inset Flex CharStyle:Code
5716 \begin_layout Plain Layout
5722 directory, which will be found at
5723 \begin_inset Flex CharStyle:Code
5726 \begin_layout Plain Layout
5733 For example, latex packages should go under
5734 \begin_inset Flex CharStyle:Code
5737 \begin_layout Plain Layout
5738 $TEXMFLOCAL/tex/latex/
5746 \begin_layout Enumerate
5747 Install the package.
5748 For example, you would unpack the FoilTeX tarball and copy it to
5749 \begin_inset Flex CharStyle:Code
5752 \begin_layout Plain Layout
5753 $TEXMFLOCAL/tex/latex/foiltex
5760 \begin_inset Flex CharStyle:Code
5763 \begin_layout Plain Layout
5769 directory contains various files.
5772 \begin_layout Enumerate
5774 \begin_inset Flex CharStyle:Code
5777 \begin_layout Plain Layout
5785 \begin_inset Flex CharStyle:Code
5788 \begin_layout Plain Layout
5797 \begin_layout Standard
5798 Your package is now installed and available to LaTeX.
5799 To make it available to LyX, you need to create a Layout file, if one is
5800 not already available.
5801 (See the next section.) Once you have a layout file, you need only reconfigure
5803 \begin_inset Flex CharStyle:MenuItem
5806 \begin_layout Plain Layout
5807 Tools\SpecialChar \menuseparator
5813 ) and then restart LyX.
5814 You should then see your new package---for example
5815 \begin_inset Flex CharStyle:MenuItem
5818 \begin_layout Plain Layout
5825 \begin_inset Flex CharStyle:MenuItem
5828 \begin_layout Plain Layout
5829 Document\SpecialChar \menuseparator
5836 \begin_inset Flex CharStyle:MenuItem
5839 \begin_layout Plain Layout
5849 \begin_layout Section
5853 \begin_layout Standard
5854 This section describes how to write and install your own LyX layout files
5855 and walks through the
5856 \begin_inset Flex CharStyle:Code
5859 \begin_layout Plain Layout
5865 text class format as an example.
5867 \begin_inset Flex CharStyle:Code
5870 \begin_layout Plain Layout
5876 files describe what paragraph and character styles are available for a
5877 given document class and how LyX should display them.
5878 We try to provide a thorough description of the process here; however,
5879 there are so many different types of documents supported by LaTeX classes
5880 that we can't hope to cover every different possibility or problem you
5882 (The LyX users' list is frequented by people with lots of experience with
5883 layout design who are willing to share what they've learned.)
5886 \begin_layout Standard
5887 As you prepare to write a new layout, it is extremely helpful to look at
5888 the example layouts distributed with LyX.
5889 If you use a nice LaTeX document class that might be of interest for others,
5890 too, and have a nice corresponding LyX layout, feel free to contribute
5891 the stuff to us, so we may put it into the distribution.
5893 \begin_inset CommandInset href
5895 name "section on the LyX wiki"
5896 target "http://wiki.lyx.org/Layouts/Layouts"
5900 for this kind of material.
5903 \begin_layout Standard
5904 All the tags described in this chapter are case-insensitive; this means
5906 \begin_inset Flex CharStyle:Code
5909 \begin_layout Plain Layout
5916 \begin_inset Flex CharStyle:Code
5919 \begin_layout Plain Layout
5926 \begin_inset Flex CharStyle:Code
5929 \begin_layout Plain Layout
5935 are really the same command.
5936 The possible values are printed in brackets after the feature's name.
5937 The default value if a feature isn't specified inside a text class-description
5939 \begin_inset Flex CharStyle:Code
5942 \begin_layout Plain Layout
5951 If the argument has a data type like
5952 \begin_inset Quotes eld
5956 \begin_inset Quotes erd
5960 \begin_inset Quotes eld
5964 \begin_inset Quotes erd
5967 , the default is shown like this:
5968 \begin_inset Flex CharStyle:Code
5971 \begin_layout Plain Layout
5982 \begin_layout Subsection
5983 \begin_inset CommandInset label
5985 name "sub:Layout-modules"
5992 \begin_layout Standard
5993 Similar to layout files, and new with LyX 1.6, are layout
5998 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5999 some modules---such as the endnotes module---provide support for just such
6001 In a sense, layout modules are similar to included files---files like
6002 \begin_inset Flex CharStyle:Code
6005 \begin_layout Plain Layout
6011 ---in that modules are not specific to a given document layout but may be
6012 used with many different layouts.
6013 The difference is that using a layout module does not require editing the
6015 Rather, modules are selected in the
6016 \begin_inset Flex CharStyle:MenuItem
6019 \begin_layout Plain Layout
6020 Document\SpecialChar \menuseparator
6029 \begin_layout Standard
6030 Building modules is the easiest way to get started with layout editing,
6031 since it can be as simple as adding a single new paragraph or flex inset.
6032 But modules may, in principle, contain anything a layout file can contain.
6035 \begin_layout Standard
6036 A module must begin with a line like the following:
6039 \begin_layout LyX-Code
6042 DeclareLyXModule[endnotes.sty]{Endnotes}
6045 \begin_layout Standard
6046 The argument in square brackets is optional: It declares any LaTeX packages
6047 on which the module depends.
6048 The mandatory argument, in curly brackets, is the name of the module, as
6050 \begin_inset Flex CharStyle:MenuItem
6053 \begin_layout Plain Layout
6054 Document\SpecialChar \menuseparator
6064 \begin_layout Standard
6065 The module declaration should then be followed by lines like the following:
6068 \begin_layout LyX-Code
6072 \begin_layout LyX-Code
6073 #Adds an endnote command, in addition to footnotes.
6077 \begin_layout LyX-Code
6078 #You will need to add
6080 theendnotes in TeX code where you
6083 \begin_layout LyX-Code
6084 #want the endnotes to appear.
6088 \begin_layout LyX-Code
6092 \begin_layout LyX-Code
6093 #Requires: somemodule | othermodule
6096 \begin_layout LyX-Code
6097 #Excludes: badmodule
6100 \begin_layout Standard
6101 The description is used in
6102 \begin_inset Flex CharStyle:MenuItem
6105 \begin_layout Plain Layout
6106 Document\SpecialChar \menuseparator
6112 to provide the user with information about what the module does.
6114 \begin_inset Flex CharStyle:Code
6117 \begin_layout Plain Layout
6123 line is used to identify other modules with which this one must be used;
6125 \begin_inset Flex CharStyle:Code
6128 \begin_layout Plain Layout
6134 line is used to identify modules with which this one may not be used.
6135 Both are optional, and, as shown, multiple modules should be separated
6136 with the pipe symbol: |.
6137 Note that the required modules are treated disjunctively:
6141 of the required modules must be used.
6146 excluded module may be used.
6147 Note that modules are identified here by their
6151 without the .module extension.
6153 \begin_inset Flex CharStyle:Code
6156 \begin_layout Plain Layout
6163 \begin_inset Flex CharStyle:Code
6166 \begin_layout Plain Layout
6175 \begin_layout Standard
6176 After creating a new module, you will need to reconfigure and then restart
6177 LyX for the module to appear in the menu.
6178 However, changes you make to the module will be seen immediately, if you
6180 \begin_inset Flex CharStyle:MenuItem
6183 \begin_layout Plain Layout
6184 Document\SpecialChar \menuseparator
6190 , highlight something, and then hit
6191 \begin_inset Quotes eld
6195 \begin_inset Quotes erd
6201 It is strongly recommended that you save your work before doing so
6206 it is strongly recommended that you not attempt to edit modules while simultaneo
6207 usly working on documents
6210 Though of course the developers strive to keep LyX stable in such situations,
6211 syntax errors and the like in your module file could cause strange behavior.
6214 \begin_layout Subsection
6215 Supporting new document classes
6218 \begin_layout Standard
6219 There are two situations you are likely to encounter when wanting to support
6220 a new LaTeX document class, involving LaTeX2e class (
6221 \begin_inset Flex CharStyle:Code
6224 \begin_layout Plain Layout
6231 \begin_inset Flex CharStyle:Code
6234 \begin_layout Plain Layout
6241 Supporting a style file is usually fairly easy.
6242 Supporting a new document class is a bit harder.
6245 \begin_layout Subsection
6247 \begin_inset Flex CharStyle:MenuItem
6250 \begin_layout Plain Layout
6259 \begin_layout Standard
6260 If your new document class is provided as a style file that is used in conjuncti
6261 on with an existing, supported document class---for the sake of the example,
6262 we'll assume that the style file is called
6263 \begin_inset Flex CharStyle:MenuItem
6266 \begin_layout Plain Layout
6272 and it is meant to be used with
6273 \begin_inset Flex CharStyle:MenuItem
6276 \begin_layout Plain Layout
6282 , which is a standard class---start by copying the existing class's layout
6283 file into your local directory:
6286 \begin_layout LyX-Code
6287 cp report.layout ~/.lyx/layouts/myclass.layout
6290 \begin_layout Standard
6292 \begin_inset Flex CharStyle:Code
6295 \begin_layout Plain Layout
6301 and change the line:
6304 \begin_layout LyX-Code
6307 DeclareLaTeXClass{report}
6310 \begin_layout Standard
6314 \begin_layout LyX-Code
6317 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6320 \begin_layout Standard
6324 \begin_layout LyX-Code
6326 \begin_inset Newline newline
6332 \begin_inset Newline newline
6338 \begin_layout Standard
6339 near the top of the file.
6342 \begin_layout Standard
6343 Start LyX and select
6344 \begin_inset Flex CharStyle:MenuItem
6347 \begin_layout Plain Layout
6348 Tools\SpecialChar \menuseparator
6355 Then restart LyX and try creating a new document.
6357 \begin_inset Flex CharStyle:MenuItem
6360 \begin_layout Plain Layout
6366 " as a document class option in the
6367 \begin_inset Flex CharStyle:MenuItem
6370 \begin_layout Plain Layout
6371 Document\SpecialChar \menuseparator
6378 It is likely that some of the sectioning commands and such in your new
6379 class will work differently from how they worked in the base class---
6380 \begin_inset Flex CharStyle:Code
6383 \begin_layout Plain Layout
6389 in this example---so you can fiddle around with the settings for the different
6390 sections if you wish.
6393 \begin_layout Subsection
6395 \begin_inset Flex CharStyle:MenuItem
6398 \begin_layout Plain Layout
6407 \begin_layout Standard
6408 There are two possibilities here.
6409 One is that the class file is itself based upon an existing document class.
6410 For example, many thesis classes are based upon
6411 \begin_inset Flex CharStyle:MenuItem
6414 \begin_layout Plain Layout
6421 To see whether yours is, look for a line like
6424 \begin_layout LyX-Code
6430 \begin_layout Standard
6432 If so, then you may proceed largely as in the previous section, though
6433 the DeclareLaTeXClass line will be different.
6434 If your new class is thesis, and it is based upon book, then the line should
6439 \begin_layout Plain Layout
6440 And it will be easiest if you save the file to
6441 \begin_inset Flex CharStyle:Code
6444 \begin_layout Plain Layout
6450 : LyX assumes that the document class has the same name as the layout file.
6459 \begin_layout LyX-Code
6462 DeclareLaTeXClass[thesis,book]{thesis}
6465 \begin_layout Standard
6466 If, on the other hand, the new class is not based upon an existing class,
6467 you will probably have to
6468 \begin_inset Quotes eld
6472 \begin_inset Quotes erd
6476 We strongly suggest copying an existing layout file which uses a similar
6477 LaTeX class and then modifying it, if you can do so.
6478 At least use an existing file as a starting point so you can find out what
6479 items you need to worry about.
6480 Again, the specifics are covered below.
6483 \begin_layout Section
6484 Declaring a new text class
6487 \begin_layout Standard
6488 When it's finally time to get your hands dirty and create or edit your own
6489 layout file, the following sections describe what you're up against.
6490 Our advice is to go slowly, save and test often, listen to soothing music,
6491 and enjoy one or two of your favorite adult beverages; more if you are
6492 getting particularly stuck.
6493 It's really not that hard, except that the multitude of options can become
6494 overwhelming if you try to do to much in one sitting.
6495 Go have another adult beverage, just for good measure.
6498 \begin_layout Standard
6502 \begin_layout Standard
6503 Lines in a layout file which begin with a
6504 \begin_inset Flex CharStyle:Code
6507 \begin_layout Plain Layout
6514 There is one exception to this rule: all layouts should begin with lines
6518 \begin_layout LyX-Code
6521 #% Do not delete the line below; configure depends on this
6524 \begin_layout LyX-Code
6529 DeclareLaTeXClass{article}
6532 \begin_layout Standard
6533 The second line is used when you configure LyX.
6534 The layout file is read by the LaTeX script
6535 \begin_inset Flex CharStyle:Code
6538 \begin_layout Plain Layout
6544 , in a special mode where
6545 \begin_inset Flex CharStyle:Code
6548 \begin_layout Plain Layout
6555 The first line is just a LaTeX comment, and the second one contains the
6556 declaration of the text class.
6557 If these lines appear in a file named
6558 \begin_inset Flex CharStyle:Code
6561 \begin_layout Plain Layout
6567 , then they define a text class of name
6568 \begin_inset Flex CharStyle:Code
6571 \begin_layout Plain Layout
6577 (the name of the layout file) which uses the LaTeX document class
6578 \begin_inset Flex CharStyle:Code
6581 \begin_layout Plain Layout
6587 (the default is to use the same name as the layout).
6589 \begin_inset Quotes eld
6593 \begin_inset Quotes erd
6596 that appears above is used as a description of the text class in the
6597 \begin_inset Flex CharStyle:MenuItem
6600 \begin_layout Plain Layout
6601 Document\SpecialChar \menuseparator
6610 \begin_layout Standard
6611 Let's assume that you wrote your own text class that uses the
6612 \begin_inset Flex CharStyle:Code
6615 \begin_layout Plain Layout
6621 document class, but where you changed the appearance of the section headings.
6622 If you put it in a file
6623 \begin_inset Flex CharStyle:Code
6626 \begin_layout Plain Layout
6632 , the header of this file should be:
6635 \begin_layout LyX-Code
6638 #% Do not delete the line below; configure depends on this
6641 \begin_layout LyX-Code
6646 DeclareLaTeXClass[article]{article (with my own headings)}
6649 \begin_layout Standard
6650 This declares a text class
6651 \begin_inset Flex CharStyle:Code
6654 \begin_layout Plain Layout
6660 , associated with the LaTeX document class
6661 \begin_inset Flex CharStyle:Code
6664 \begin_layout Plain Layout
6671 \begin_inset Quotes eld
6674 article (with my own headings)
6675 \begin_inset Quotes erd
6679 If your text class depends on several packages, you can declare it as:
6682 \begin_layout LyX-Code
6685 #% Do not delete the line below; configure depends on this
6688 \begin_layout LyX-Code
6693 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6696 \begin_layout Standard
6697 This indicates that your text class uses the foo.sty package.
6698 Finally, it is also possible to declare classes for DocBook code.
6699 Typical declarations will look like
6702 \begin_layout LyX-Code
6705 #% Do not delete the line below; configure depends on this
6708 \begin_layout LyX-Code
6713 DeclareDocBookClass[article]{SGML (DocBook article)}
6716 \begin_layout Standard
6717 Note that these declarations can also be given an optional parameter declaring
6718 the name of the document class (but not a list).
6721 \begin_layout Standard
6722 So, to be as explicit as possible, the form of the layout declaration is:
6725 \begin_layout LyX-Code
6730 DeclareLaTeXClass[class,package.sty]{layout description}
6733 \begin_layout Standard
6734 The class need only be specified if the name of the LaTeX class file and
6735 the name of the layout file are different; if the name of the class file
6736 is not specified, then LyX will simply assume that it is the same as the
6737 name of the layout file.
6740 \begin_layout Standard
6741 When the text class has been modified to your taste, all you have to do
6742 is to copy it either to
6743 \begin_inset Flex CharStyle:Code
6746 \begin_layout Plain Layout
6753 \begin_inset Flex CharStyle:Code
6756 \begin_layout Plain Layout
6763 \begin_inset Flex CharStyle:MenuItem
6766 \begin_layout Plain Layout
6767 Tools\SpecialChar \menuseparator
6773 , exit LyX and restart it.
6774 Then your new text class should be available along with the others.
6777 \begin_layout Standard
6778 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6779 you made to your layout files.
6780 As a result, editing layout files could be very time consuming.
6781 Beginning with 1.6, however, you can force a reload of the layout currently
6782 in use by using the LyX function
6783 \begin_inset Flex CharStyle:MenuItem
6786 \begin_layout Plain Layout
6793 There is no default binding for this function---though, of course, you
6794 can bind it to a key yourself.
6795 If you want to use this function, then, you should simply enter it in the
6801 : This is very much an `advanced feature'.
6806 recommended that you save your work before using this function.
6811 recommended that you not attempt to edit your layout while simultaneously
6812 working on a document that you care about.
6813 Use a test document.
6814 Syntax errors and the like in your layout file could cause peculiar behavior.
6815 In particular, such errors could cause LyX to regard the current layout
6816 as invalid and to attempt to switch to some other layout.
6817 The LyX team strives to keep LyX stable in such situations, but safe is
6821 \begin_layout Subsection
6825 \begin_layout Standard
6826 The first non-comment line must contain the file format number:
6829 \begin_layout Description
6830 \begin_inset Flex CharStyle:Code
6833 \begin_layout Plain Layout
6840 \begin_inset Flex CharStyle:Code
6843 \begin_layout Plain Layout
6849 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6850 don't have an explicit file format).
6851 The file format that is documented here is format 8.
6854 \begin_layout Subsection
6855 General text class parameters
6858 \begin_layout Standard
6859 These are the general parameters which describe the form of the entire document:
6862 \begin_layout Description
6863 \begin_inset Flex CharStyle:Code
6866 \begin_layout Plain Layout
6872 Adds information to the document preamble.
6874 \begin_inset Quotes eld
6878 \begin_inset Flex CharStyle:Code
6881 \begin_layout Plain Layout
6888 \begin_inset Quotes erd
6894 \begin_layout Description
6895 \begin_inset Flex CharStyle:Code
6898 \begin_layout Plain Layout
6904 Describes various global options supported by the document class.
6906 \begin_inset space ~
6910 \begin_inset CommandInset ref
6912 reference "sec:classoptions"
6918 \begin_inset Quotes eld
6922 \begin_inset Flex CharStyle:Code
6925 \begin_layout Plain Layout
6932 \begin_inset Quotes erd
6938 \begin_layout Description
6939 \begin_inset Flex CharStyle:Code
6942 \begin_layout Plain Layout
6949 \begin_inset Flex CharStyle:Code
6952 \begin_layout Plain Layout
6961 \begin_inset Flex CharStyle:Code
6964 \begin_layout Plain Layout
6970 ] Whether the class should default to having one or two columns.
6971 Can be changed in the
6972 \begin_inset Flex CharStyle:MenuItem
6975 \begin_layout Plain Layout
6976 Document\SpecialChar \menuseparator
6985 \begin_layout Description
6986 \begin_inset Flex CharStyle:Code
6989 \begin_layout Plain Layout
6995 This sequence defines a new counter.
6997 \begin_inset space ~
7001 \begin_inset CommandInset ref
7003 reference "sec:counter"
7009 \begin_inset Quotes eld
7013 \begin_inset Flex CharStyle:Code
7016 \begin_layout Plain Layout
7023 \begin_inset Quotes erd
7029 \begin_layout Description
7030 \begin_inset Flex CharStyle:Code
7033 \begin_layout Plain Layout
7039 Sets the default font used to display the document.
7041 \begin_inset space ~
7045 \begin_inset CommandInset ref
7047 reference "sec:fonts"
7051 for how to declare fonts.
7053 \begin_inset Quotes eld
7057 \begin_inset Flex CharStyle:Code
7060 \begin_layout Plain Layout
7067 \begin_inset Quotes erd
7073 \begin_layout Description
7074 \begin_inset Flex CharStyle:Code
7077 \begin_layout Plain Layout
7084 \begin_inset Flex CharStyle:Code
7087 \begin_layout Plain Layout
7093 Specifies a module to be included by default with this document class,
7094 which should be specified by filename without the
7095 \begin_inset Flex CharStyle:Code
7098 \begin_layout Plain Layout
7105 The user can still remove the module, but it will be active at the outset.
7106 (This applies only when new files are created, or when this class is chosen
7107 for an existing document.)
7110 \begin_layout Description
7111 \begin_inset Flex CharStyle:Code
7114 \begin_layout Plain Layout
7121 \begin_inset Flex CharStyle:Code
7124 \begin_layout Plain Layout
7130 ] This is the style that will be assigned to new paragraphs, usually
7131 \begin_inset Flex CharStyle:MenuItem
7134 \begin_layout Plain Layout
7141 This will default to the first defined style if not given, but you are
7142 highly encouraged to use this directive.
7145 \begin_layout Description
7146 \begin_inset Flex CharStyle:Code
7149 \begin_layout Plain Layout
7156 \begin_inset Flex CharStyle:Code
7159 \begin_layout Plain Layout
7165 ] Indicates that the module in question---which should be specified by filename
7167 \begin_inset Flex CharStyle:Code
7170 \begin_layout Plain Layout
7176 extension---cannot be used with this document class.
7177 This might be used in a journal-specific layout file to prevent, say, the
7179 \begin_inset Flex CharStyle:Code
7182 \begin_layout Plain Layout
7188 module that numbers theorems by section.
7193 be used in a module.
7194 Modules have their own way of excluding other modules (see
7195 \begin_inset CommandInset ref
7197 reference "sub:Layout-modules"
7204 \begin_layout Description
7205 \begin_inset Flex CharStyle:Code
7208 \begin_layout Plain Layout
7214 Defines a new float.
7216 \begin_inset space ~
7220 \begin_inset CommandInset ref
7222 reference "sec:floats"
7228 \begin_inset Quotes eld
7232 \begin_inset Flex CharStyle:Code
7235 \begin_layout Plain Layout
7242 \begin_inset Quotes erd
7248 \begin_layout Description
7249 \begin_inset Flex CharStyle:Code
7252 \begin_layout Plain Layout
7258 As its name implies, this command allows you to include another layout
7259 definition file within yours to avoid duplicating commands.
7260 Common examples are the standard layout files, for example,
7261 \begin_inset Flex CharStyle:Code
7264 \begin_layout Plain Layout
7270 , which contains most of the basic layouts.
7273 \begin_layout Description
7274 \begin_inset Flex CharStyle:Code
7277 \begin_layout Plain Layout
7283 This section (re-)defines the layout of an inset.
7284 It can be applied to an existing inset of to a new, user-defined inset,
7286 \begin_inset space \thinspace{}
7290 \begin_inset space \space{}
7293 a new character style.
7295 \begin_inset space ~
7299 \begin_inset CommandInset ref
7301 reference "sec:charstyle"
7305 for more information.
7307 \begin_inset Quotes eld
7311 \begin_inset Flex CharStyle:Code
7314 \begin_layout Plain Layout
7321 \begin_inset Quotes erd
7327 \begin_layout Description
7328 \begin_inset Flex CharStyle:Code
7331 \begin_layout Plain Layout
7337 A string that indicates the width of the left margin on the screen, for
7339 \begin_inset Quotes eld
7343 \begin_inset Quotes erd
7349 \begin_layout Description
7350 \begin_inset Flex CharStyle:Code
7353 \begin_layout Plain Layout
7359 This command deletes an existing float.
7360 This is particularly useful when you want to suppress a float that has
7361 be defined in an input file.
7364 \begin_layout Description
7365 \begin_inset Flex CharStyle:Code
7368 \begin_layout Plain Layout
7374 This command deletes an existing style.
7375 This is particularly useful when you want to suppress a style that has
7376 be defined in an input file.
7379 \begin_layout Description
7380 \begin_inset Flex CharStyle:Code
7383 \begin_layout Plain Layout
7389 A string indicating what sort of output documents using this class will
7391 At present, the options are: `docbook', `latex', and `literate'.
7394 \begin_layout Description
7395 \begin_inset Flex CharStyle:Code
7398 \begin_layout Plain Layout
7409 \begin_inset Flex CharStyle:Code
7412 \begin_layout Plain Layout
7423 \begin_inset Flex CharStyle:Code
7426 \begin_layout Plain Layout
7433 \begin_inset Flex CharStyle:Code
7436 \begin_layout Plain Layout
7442 ] The class default pagestyle.
7443 Can be changed in the
7444 \begin_inset Flex CharStyle:MenuItem
7447 \begin_layout Plain Layout
7448 Document\SpecialChar \menuseparator
7457 \begin_layout Description
7458 \begin_inset Flex CharStyle:Code
7461 \begin_layout Plain Layout
7467 Sets the preamble for the LaTeX document.
7468 Note that this will completely override any prior
7469 \begin_inset Flex CharStyle:Code
7472 \begin_layout Plain Layout
7479 \begin_inset Flex CharStyle:Code
7482 \begin_layout Plain Layout
7490 \begin_inset Quotes eld
7494 \begin_inset Flex CharStyle:Code
7497 \begin_layout Plain Layout
7504 \begin_inset Quotes erd
7510 \begin_layout Description
7511 \begin_inset Flex CharStyle:Code
7514 \begin_layout Plain Layout
7521 \begin_inset CommandInset label
7528 \begin_inset Flex CharStyle:Code
7531 \begin_layout Plain Layout
7538 \begin_inset Flex CharStyle:Code
7541 \begin_layout Plain Layout
7550 \begin_inset Flex CharStyle:Code
7553 \begin_layout Plain Layout
7559 ] Whether the class already provides the feature
7560 \begin_inset Flex CharStyle:Code
7563 \begin_layout Plain Layout
7570 A feature is in general the name of a package (
7571 \begin_inset Flex CharStyle:Code
7574 \begin_layout Plain Layout
7581 \begin_inset Flex CharStyle:Code
7584 \begin_layout Plain Layout
7590 , \SpecialChar \ldots{}
7592 \begin_inset Flex CharStyle:Code
7595 \begin_layout Plain Layout
7602 \begin_inset Flex CharStyle:Code
7605 \begin_layout Plain Layout
7611 ,\SpecialChar \ldots{}
7612 ); the complete list of supported features is unfortunately not documented
7613 outside the LyX source code---but see
7614 \begin_inset Flex CharStyle:Code
7617 \begin_layout Plain Layout
7623 if you're interested.
7625 \begin_inset Flex CharStyle:MenuItem
7628 \begin_layout Plain Layout
7629 Help\SpecialChar \menuseparator
7635 also gives an overview of the supported packages.
7638 \begin_layout Description
7639 \begin_inset Flex CharStyle:Code
7642 \begin_layout Plain Layout
7649 \begin_inset Flex CharStyle:Code
7652 \begin_layout Plain Layout
7658 ] Indicates that this layout provides the functionality of the module mentioned,
7659 which should be specified by the filename without the
7660 \begin_inset Flex CharStyle:Code
7663 \begin_layout Plain Layout
7670 This will typically be used if the layout includes the module directly,
7671 rather than using the
7672 \begin_inset Flex CharStyle:Code
7675 \begin_layout Plain Layout
7681 tag to indicate that it ought to be used.
7682 It could be used in a module that provided an alternate implementation
7683 of the same functionality.
7686 \begin_layout Description
7687 \begin_inset Flex CharStyle:Code
7690 \begin_layout Plain Layout
7697 \begin_inset Flex CharStyle:Code
7700 \begin_layout Plain Layout
7706 ] Whether the class requires the feature
7707 \begin_inset Flex CharStyle:Code
7710 \begin_layout Plain Layout
7717 Multiple features must be separated by commas.
7718 Note that you can only request supported features.
7719 (See the description of the
7720 \begin_inset Flex CharStyle:Code
7723 \begin_layout Plain Layout
7730 \begin_inset CommandInset ref
7731 LatexCommand vpageref
7732 reference "des:Provides"
7739 \begin_layout Description
7740 \begin_inset Flex CharStyle:Code
7743 \begin_layout Plain Layout
7749 A string that indicates the width of the right margin on the screen, for
7751 \begin_inset Quotes eld
7755 \begin_inset Quotes erd
7761 \begin_layout Description
7762 \begin_inset Flex CharStyle:Code
7765 \begin_layout Plain Layout
7771 Sets which divisions get numbered.
7773 \begin_inset Flex CharStyle:Code
7776 \begin_layout Plain Layout
7785 \begin_layout Description
7786 \begin_inset Flex CharStyle:Code
7789 \begin_layout Plain Layout
7798 \begin_inset Flex CharStyle:Code
7801 \begin_layout Plain Layout
7812 \begin_inset Flex CharStyle:Code
7815 \begin_layout Plain Layout
7821 ] Whether the class-default should be printing on one or both sides of the
7823 Can be changed in the
7824 \begin_inset Flex CharStyle:MenuItem
7827 \begin_layout Plain Layout
7828 Document\SpecialChar \menuseparator
7837 \begin_layout Description
7838 \begin_inset Flex CharStyle:Code
7841 \begin_layout Plain Layout
7847 This sequence defines a new paragraph style.
7848 If the style already exists, it will redefine some of its parameters instead.
7850 \begin_inset space ~
7854 \begin_inset CommandInset ref
7856 reference "sec:style"
7862 \begin_inset Quotes eld
7866 \begin_inset Flex CharStyle:Code
7869 \begin_layout Plain Layout
7876 \begin_inset Quotes erd
7882 \begin_layout Description
7883 \begin_inset Flex CharStyle:Code
7886 \begin_layout Plain Layout
7893 \begin_inset Flex CharStyle:Code
7896 \begin_layout Plain Layout
7902 ] The name of the command or environment to be used with
7903 \begin_inset Flex CharStyle:Code
7906 \begin_layout Plain Layout
7915 \begin_layout Description
7916 \begin_inset Flex CharStyle:Code
7919 \begin_layout Plain Layout
7926 \begin_inset Flex CharStyle:Code
7929 \begin_layout Plain Layout
7938 \begin_inset Flex CharStyle:Code
7941 \begin_layout Plain Layout
7947 ] Indicates what kind of markup is used to define the title of a document.
7949 \begin_inset Flex CharStyle:Code
7952 \begin_layout Plain Layout
7958 means that the macro with name
7959 \begin_inset Flex CharStyle:Code
7962 \begin_layout Plain Layout
7968 will be inserted after the last layout which has
7969 \begin_inset Quotes eld
7973 \begin_inset Flex CharStyle:Code
7976 \begin_layout Plain Layout
7983 \begin_inset Quotes erd
7988 \begin_inset Flex CharStyle:Code
7991 \begin_layout Plain Layout
7997 corresponds to the case where the block of paragraphs which have
7998 \begin_inset Quotes eld
8002 \begin_inset Flex CharStyle:Code
8005 \begin_layout Plain Layout
8012 \begin_inset Quotes erd
8015 should be enclosed into the
8016 \begin_inset Flex CharStyle:Code
8019 \begin_layout Plain Layout
8028 \begin_layout Description
8029 \begin_inset Flex CharStyle:Code
8032 \begin_layout Plain Layout
8038 Sets which divisions are included in the table of contents.
8040 \begin_inset Flex CharStyle:Code
8043 \begin_layout Plain Layout
8052 \begin_layout Subsection
8053 \begin_inset Flex CharStyle:Code
8056 \begin_layout Plain Layout
8065 \begin_layout Standard
8066 \begin_inset CommandInset label
8068 name "sec:classoptions"
8073 \begin_inset Flex CharStyle:Code
8076 \begin_layout Plain Layout
8082 section can contain the following entries:
8085 \begin_layout Description
8086 \begin_inset Flex CharStyle:Code
8089 \begin_layout Plain Layout
8096 \begin_inset Flex CharStyle:Code
8099 \begin_layout Plain Layout
8105 ] The list of available font sizes for the document's main font, separated
8107 \begin_inset Quotes eld
8111 \begin_inset Flex CharStyle:Code
8114 \begin_layout Plain Layout
8121 \begin_inset Quotes erd
8127 \begin_layout Description
8128 \begin_inset Flex CharStyle:Code
8131 \begin_layout Plain Layout
8137 Used to set the DTD line with XML-based output classes.
8139 \begin_inset space \thinspace{}
8143 \begin_inset Quotes eld
8146 -//OASIS//DTD DocBook V4.2//EN
8147 \begin_inset Quotes erd
8153 \begin_layout Description
8154 \begin_inset Flex CharStyle:Code
8157 \begin_layout Plain Layout
8164 \begin_inset Flex CharStyle:Code
8167 \begin_layout Plain Layout
8168 string="empty|plain|headings|fancy"
8173 ] The list of available page styles, separated by
8174 \begin_inset Quotes eld
8178 \begin_inset Flex CharStyle:Code
8181 \begin_layout Plain Layout
8188 \begin_inset Quotes erd
8194 \begin_layout Description
8195 \begin_inset Flex CharStyle:Code
8198 \begin_layout Plain Layout
8205 \begin_inset Flex CharStyle:Code
8208 \begin_layout Plain Layout
8214 ] Some document class options, separated by a comma, that will be added
8215 to the optional part of the
8216 \begin_inset Flex CharStyle:Code
8219 \begin_layout Plain Layout
8230 \begin_layout Standard
8232 \begin_inset Flex CharStyle:Code
8235 \begin_layout Plain Layout
8241 section must end with
8242 \begin_inset Quotes eld
8246 \begin_inset Flex CharStyle:Code
8249 \begin_layout Plain Layout
8256 \begin_inset Quotes erd
8262 \begin_layout Subsection
8266 \begin_layout Standard
8267 \begin_inset CommandInset label
8273 A paragraph style description looks like this:
8277 \begin_layout Plain Layout
8278 Note that this will either define a new layout or modify an existing one.
8286 \begin_layout LyX-Code
8293 \begin_layout LyX-Code
8297 \begin_layout LyX-Code
8301 \begin_layout Standard
8302 where the following commands are allowed:
8305 \begin_layout Description
8306 \begin_inset Flex CharStyle:Code
8309 \begin_layout Plain Layout
8316 \begin_inset Flex CharStyle:Code
8319 \begin_layout Plain Layout
8324 , left, right, center
8329 ] Paragraph alignment.
8332 \begin_layout Description
8333 \begin_inset Flex CharStyle:Code
8336 \begin_layout Plain Layout
8343 \begin_inset Flex CharStyle:Code
8346 \begin_layout Plain Layout
8351 , left, right, center
8356 ] A comma separated list of permitted alignments.
8357 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8359 For example a right-aligned or centered enumeration isn't possible.)
8362 \begin_layout Description
8363 \begin_inset Flex CharStyle:Code
8366 \begin_layout Plain Layout
8373 \begin_inset Flex CharStyle:Code
8376 \begin_layout Plain Layout
8386 \begin_layout Plain Layout
8387 Note that a `float' here is a real number, such as: 1.5.
8392 The vertical space with which the last of a chain of paragraphs with this
8393 layout is separated from the following paragraph.
8394 If the next paragraph has another layout, the separations are not simply
8395 added, but the maximum is taken.
8398 \begin_layout Description
8399 \begin_inset Flex CharStyle:Code
8402 \begin_layout Plain Layout
8409 \begin_inset Flex CharStyle:Code
8412 \begin_layout Plain Layout
8418 The category for this style.
8419 This is used to group related styles in the Layout combobox on the toolbar.
8420 Any string can be used, but you may want to use existing categories with
8425 \begin_layout Description
8426 \begin_inset Flex CharStyle:Code
8429 \begin_layout Plain Layout
8435 Depth of XML command.
8436 Used only with XML-type formats.
8439 \begin_layout Description
8440 \begin_inset Flex CharStyle:Code
8443 \begin_layout Plain Layout
8450 \begin_inset CommandInset label
8452 name "des:CopyStyle"
8457 \begin_inset Flex CharStyle:Code
8460 \begin_layout Plain Layout
8466 Copies all the features of an existing style into the current one.
8470 \begin_layout Description
8471 \begin_inset Flex CharStyle:Code
8474 \begin_layout Plain Layout
8480 The name of a style whose preamble should be output
8485 This allows to ensure some ordering of the preamble snippets when macros
8486 definitions depend on one another.
8490 \begin_layout Plain Layout
8491 Note that, besides that functionality, there is no way to ensure any ordering
8493 The ordering that you see in a given version of LyX may change without
8494 warning in later versions.
8502 \begin_layout Description
8503 \begin_inset Flex CharStyle:Code
8506 \begin_layout Plain Layout
8513 \begin_inset Flex CharStyle:Code
8516 \begin_layout Plain Layout
8521 , Box, Filled_Box, Static
8526 ] The type of label that stands at the end of the paragraph (or sequence
8528 \begin_inset Flex CharStyle:Code
8531 \begin_layout Plain Layout
8538 \begin_inset Flex CharStyle:Code
8541 \begin_layout Plain Layout
8548 \begin_inset Flex CharStyle:Code
8551 \begin_layout Plain Layout
8558 \begin_inset Flex CharStyle:Code
8561 \begin_layout Plain Layout
8569 \begin_inset Flex CharStyle:Code
8572 \begin_layout Plain Layout
8579 \begin_inset Quotes eld
8583 \begin_inset Quotes erd
8587 \begin_inset Flex CharStyle:Code
8590 \begin_layout Plain Layout
8597 \begin_inset Flex CharStyle:Code
8600 \begin_layout Plain Layout
8601 \begin_inset space ~
8610 \begin_inset space ~
8613 black) square suitable for end of proof markers,
8614 \begin_inset Flex CharStyle:Code
8617 \begin_layout Plain Layout
8623 is an explicit text string.
8626 \begin_layout Description
8627 \begin_inset Flex CharStyle:Code
8630 \begin_layout Plain Layout
8637 \begin_inset Flex CharStyle:Code
8640 \begin_layout Plain Layout
8646 ] The string used for a label with a
8647 \begin_inset Flex CharStyle:Code
8650 \begin_layout Plain Layout
8657 \begin_inset Flex CharStyle:Code
8660 \begin_layout Plain Layout
8670 \begin_layout Description
8671 \begin_inset Flex CharStyle:Code
8674 \begin_layout Plain Layout
8681 \begin_inset Flex CharStyle:Code
8684 \begin_layout Plain Layout
8695 \begin_inset Flex CharStyle:Code
8698 \begin_layout Plain Layout
8707 \begin_layout Description
8708 \begin_inset Flex CharStyle:Code
8711 \begin_layout Plain Layout
8718 \begin_inset Flex CharStyle:Code
8721 \begin_layout Plain Layout
8731 ] With this parameter the
8732 \begin_inset Flex CharStyle:MenuItem
8735 \begin_layout Plain Layout
8742 \begin_inset Quotes eld
8745 Vertical space above
8746 \begin_inset Quotes erd
8750 \begin_inset Flex CharStyle:MenuItem
8753 \begin_layout Plain Layout
8754 Edit\SpecialChar \menuseparator
8756 \begin_inset space ~
8764 dialog can be set when initializing a paragraph with this style.
8768 \begin_layout Plain Layout
8771 Note from Jean-Marc:
8773 I'm not sure that this setting has much use, and it should probably be
8774 removed in later versions.
8782 \begin_layout Description
8783 \begin_inset Flex CharStyle:Code
8786 \begin_layout Plain Layout
8792 The font used for both the text body
8798 \begin_inset space ~
8802 \begin_inset CommandInset ref
8804 reference "sec:fonts"
8809 Note that defining this font automatically defines the
8810 \begin_inset Flex CharStyle:Code
8813 \begin_layout Plain Layout
8820 So you should define this one first if you also want to define
8821 \begin_inset Flex CharStyle:Code
8824 \begin_layout Plain Layout
8833 \begin_layout Description
8834 \begin_inset Flex CharStyle:Code
8837 \begin_layout Plain Layout
8844 \begin_inset CommandInset label
8846 name "des:FreeSpacing"
8853 \begin_inset Flex CharStyle:Code
8856 \begin_layout Plain Layout
8867 \begin_inset Flex CharStyle:Code
8870 \begin_layout Plain Layout
8876 ] Usually LyX doesn't allow you to insert more than one space between words,
8877 since a space is considered as the separation between two words, not a
8878 character or symbol of its own.
8879 This is a very fine thing but sometimes annoying, for example, when typing
8880 program code or plain LaTeX code.
8882 \begin_inset Flex CharStyle:Code
8885 \begin_layout Plain Layout
8892 Note that LyX will create protected blanks for the additional blanks when
8893 in another mode than LaTeX-mode.
8896 \begin_layout Description
8897 \begin_inset Flex CharStyle:Code
8900 \begin_layout Plain Layout
8906 [[FIXME]] (Used only with XML-type formats.)
8909 \begin_layout Description
8910 \begin_inset Flex CharStyle:Code
8913 \begin_layout Plain Layout
8920 \begin_inset Flex CharStyle:Code
8923 \begin_layout Plain Layout
8929 If 1, marks the layout as being part of a title block (see also the
8930 \begin_inset Flex CharStyle:Code
8933 \begin_layout Plain Layout
8940 \begin_inset Flex CharStyle:Code
8943 \begin_layout Plain Layout
8952 \begin_layout Description
8953 \begin_inset Flex CharStyle:Code
8956 \begin_layout Plain Layout
8963 \begin_inset Flex CharStyle:Code
8966 \begin_layout Plain Layout
8972 ] This provides extra space between paragraphs that have the same layout.
8973 If you put other layouts into an environment, each is separated with the
8975 \begin_inset Flex CharStyle:Code
8978 \begin_layout Plain Layout
8985 But the whole items of the environment are additionally separated with
8987 \begin_inset Flex CharStyle:Code
8990 \begin_layout Plain Layout
9002 \begin_layout Description
9003 \begin_inset Flex CharStyle:Code
9006 \begin_layout Plain Layout
9012 [[FIXME]] (Used only with XML-type formats.)
9015 \begin_layout Description
9016 \begin_inset Flex CharStyle:Code
9019 \begin_layout Plain Layout
9026 \begin_inset CommandInset label
9028 name "des:KeepEmpty"
9035 \begin_inset Flex CharStyle:Code
9038 \begin_layout Plain Layout
9049 \begin_inset Flex CharStyle:Code
9052 \begin_layout Plain Layout
9058 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9059 lead to empty LaTeX output.
9060 There are some cases where this could be desirable however: in a letter
9061 template, the required fields can be provided as empty fields, so that
9062 people do not forget them; in some special classes, a layout can be used
9063 as some kind of break, which does not contain actual text.
9066 \begin_layout Description
9067 \begin_inset Flex CharStyle:Code
9070 \begin_layout Plain Layout
9076 [float=0] The vertical space between the label and the text body.
9077 Only used for labels that are above the text body (
9078 \begin_inset Flex CharStyle:Code
9081 \begin_layout Plain Layout
9088 \begin_inset Flex CharStyle:Code
9091 \begin_layout Plain Layout
9092 Centered_Top_Environment
9100 \begin_layout Description
9101 \begin_inset Flex CharStyle:Code
9104 \begin_layout Plain Layout
9111 \begin_inset Flex CharStyle:Code
9114 \begin_layout Plain Layout
9121 \begin_inset Newline newline
9124 The name of the counter for automatic numbering (see Section
9125 \begin_inset CommandInset ref
9127 reference "sec:counter"
9132 This must be given if
9133 \begin_inset Flex CharStyle:Code
9136 \begin_layout Plain Layout
9143 \begin_inset Flex CharStyle:Code
9146 \begin_layout Plain Layout
9155 \begin_layout Description
9156 \begin_inset Flex CharStyle:Code
9159 \begin_layout Plain Layout
9165 The font used for the label.
9167 \begin_inset space ~
9171 \begin_inset CommandInset ref
9173 reference "sec:fonts"
9180 \begin_layout Description
9181 \begin_inset Flex CharStyle:Code
9184 \begin_layout Plain Layout
9190 Text that indicates how far a label should be indented.
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 horizontal space between the label and the text body.
9214 Only used for labels that are not above the text body.
9217 \begin_layout Description
9218 \begin_inset Flex CharStyle:Code
9221 \begin_layout Plain Layout
9228 \begin_inset Flex CharStyle:Code
9231 \begin_layout Plain Layout
9237 ] The string used for a label with a
9238 \begin_inset Flex CharStyle:Code
9241 \begin_layout Plain Layout
9249 \begin_inset Flex CharStyle:Code
9252 \begin_layout Plain Layout
9258 is set, this string can be contain the special formatting commands described
9260 \begin_inset CommandInset ref
9262 reference "sec:counter"
9270 \begin_layout Plain Layout
9271 For the sake of backwards compatibility, the string
9272 \begin_inset Flex CharStyle:Code
9275 \begin_layout Plain Layout
9285 will be replaced by the expanded
9286 \begin_inset Flex CharStyle:Code
9289 \begin_layout Plain Layout
9296 \begin_inset Flex CharStyle:Code
9299 \begin_layout Plain Layout
9308 This feature is now obsolete and should be replaced by the mechanisms of
9310 \begin_inset CommandInset ref
9312 reference "sec:counter"
9324 \begin_layout Description
9325 \begin_inset Flex CharStyle:Code
9328 \begin_layout Plain Layout
9335 \begin_inset Flex CharStyle:Code
9338 \begin_layout Plain Layout
9344 ] This is used inside the appendix instead of
9345 \begin_inset Flex CharStyle:Code
9348 \begin_layout Plain Layout
9356 \begin_inset Flex CharStyle:Code
9359 \begin_layout Plain Layout
9366 \begin_inset Flex CharStyle:Code
9369 \begin_layout Plain Layout
9378 \begin_layout Description
9379 \begin_inset Flex CharStyle:Code
9382 \begin_layout Plain Layout
9388 [FIXME] (Used only with XML-type formats.)
9391 \begin_layout Description
9392 \begin_inset Flex CharStyle:Code
9395 \begin_layout Plain Layout
9402 \begin_inset Flex CharStyle:Code
9405 \begin_layout Plain Layout
9410 , Manual, Static, Top_Environment,
9411 \begin_inset Newline newline
9414 Centered_Top_Environment, Sensitive, Counter
9420 \begin_inset Newline newline
9424 \begin_inset Flex CharStyle:Code
9427 \begin_layout Plain Layout
9433 means the label is the very first word (up to the first real blank).
9437 \begin_layout Plain Layout
9438 Use protected spaces if you want more than one word as the label.
9444 \begin_inset Flex CharStyle:Code
9447 \begin_layout Plain Layout
9453 means it is defined in the layout (see
9454 \begin_inset Flex CharStyle:Code
9457 \begin_layout Plain Layout
9465 \begin_inset Flex CharStyle:Code
9468 \begin_layout Plain Layout
9475 \begin_inset Flex CharStyle:Code
9478 \begin_layout Plain Layout
9479 Centered_Top_Environment
9484 are special cases of
9485 \begin_inset Flex CharStyle:Code
9488 \begin_layout Plain Layout
9495 The label will be printed above the paragraph, but only at the top of an
9496 environment or the top of a chain of paragraphs with this layout.
9497 Usage is for example the
9498 \begin_inset Flex CharStyle:MenuItem
9501 \begin_layout Plain Layout
9508 \begin_inset Flex CharStyle:MenuItem
9511 \begin_layout Plain Layout
9518 This is also the case for
9519 \begin_inset Flex CharStyle:Code
9522 \begin_layout Plain Layout
9528 labels with latex type
9529 \begin_inset Flex CharStyle:Code
9532 \begin_layout Plain Layout
9538 , in order to make layouts for theorems work correctly.
9540 \begin_inset Flex CharStyle:Code
9543 \begin_layout Plain Layout
9549 is a special case for the caption-labels
9550 \begin_inset Quotes eld
9554 \begin_inset Quotes erd
9558 \begin_inset Quotes eld
9562 \begin_inset Quotes erd
9567 \begin_inset Flex CharStyle:Code
9570 \begin_layout Plain Layout
9576 means the (hardcoded) label string depends on the kind of float.
9578 \begin_inset Flex CharStyle:Code
9581 \begin_layout Plain Layout
9587 label type defines automatically numbered labels.
9589 \begin_inset CommandInset ref
9591 reference "sec:counter"
9598 \begin_layout Description
9599 \begin_inset Flex CharStyle:Code
9602 \begin_layout Plain Layout
9608 The name of the corresponding LaTeX stuff.
9609 Either the environment or command name.
9612 \begin_layout Description
9613 \begin_inset Flex CharStyle:Code
9616 \begin_layout Plain Layout
9622 An optional parameter for the corresponding
9623 \begin_inset Flex CharStyle:Code
9626 \begin_layout Plain Layout
9633 This parameter cannot be changed from within LyX.
9636 \begin_layout Description
9637 \begin_inset Flex CharStyle:Code
9640 \begin_layout Plain Layout
9647 \begin_inset CommandInset label
9649 name "des:LatexType"
9654 \begin_inset Flex CharStyle:Code
9657 \begin_layout Plain Layout
9662 , Command, Environment, Item_Environment,
9668 \begin_inset Flex CharStyle:Code
9671 \begin_layout Plain Layout
9677 ] How the layout should be translated into LaTeX.
9679 \begin_inset Flex CharStyle:Code
9682 \begin_layout Plain Layout
9688 means nothing special.
9690 \begin_inset Flex CharStyle:Code
9693 \begin_layout Plain Layout
9700 \begin_inset Flex CharStyle:Code
9703 \begin_layout Plain Layout
9710 {\SpecialChar \ldots{}
9717 \begin_inset Flex CharStyle:Code
9720 \begin_layout Plain Layout
9727 \begin_inset Flex CharStyle:Code
9730 \begin_layout Plain Layout
9737 }\SpecialChar \ldots{}
9751 \begin_inset Flex CharStyle:Code
9754 \begin_layout Plain Layout
9761 \begin_inset Flex CharStyle:Code
9764 \begin_layout Plain Layout
9771 \begin_inset Flex CharStyle:Code
9774 \begin_layout Plain Layout
9782 is generated for each paragraph of this environment.
9784 \begin_inset Flex CharStyle:Code
9787 \begin_layout Plain Layout
9794 \begin_inset Flex CharStyle:Code
9797 \begin_layout Plain Layout
9804 \begin_inset Flex CharStyle:Code
9807 \begin_layout Plain Layout
9813 is passed as an argument to the environment.
9815 \begin_inset Flex CharStyle:Code
9818 \begin_layout Plain Layout
9824 can be defined in the
9825 \begin_inset Flex CharStyle:MenuItem
9828 \begin_layout Plain Layout
9833 ayout\SpecialChar \menuseparator
9845 \begin_inset Flex CharStyle:Code
9848 \begin_layout Plain Layout
9856 is perhaps a bit misleading, since these rules apply to SGML classes, too.
9857 Visit the SGML class files for specific examples.
9860 \begin_layout Standard
9861 Putting the last few things together, the LaTeX output will be either:
9864 \begin_layout LyX-Code
9867 latexname[latexparam]{\SpecialChar \ldots{}
9871 \begin_layout Standard
9875 \begin_layout LyX-Code
9878 begin{latexname}[latexparam] \SpecialChar \ldots{}
9884 \begin_layout Standard
9885 depending upon the LaTeX type.
9888 \begin_layout Description
9889 \begin_inset Flex CharStyle:Code
9892 \begin_layout Plain Layout
9899 \begin_inset Flex CharStyle:Code
9902 \begin_layout Plain Layout
9908 ] If you put layouts into environments, the leftmargins are not simply added,
9909 but added with a factor
9910 \begin_inset Formula $\frac{4}{depth+4}$
9914 Note that this parameter is also used when the margin is defined as
9915 \begin_inset Flex CharStyle:Code
9918 \begin_layout Plain Layout
9925 \begin_inset Flex CharStyle:Code
9928 \begin_layout Plain Layout
9935 Then it is added to the manual or dynamic margin.
9937 \begin_inset Newline newline
9940 The argument is passed as a string.
9942 \begin_inset Quotes eld
9946 \begin_inset Flex CharStyle:Code
9949 \begin_layout Plain Layout
9956 \begin_inset Quotes erd
9959 means that the paragraph is indented with the width of
9960 \begin_inset Quotes eld
9964 \begin_inset Flex CharStyle:Code
9967 \begin_layout Plain Layout
9974 \begin_inset Quotes erd
9978 You can get a negative width by prefixing the string with
9979 \begin_inset Quotes eld
9983 \begin_inset Flex CharStyle:Code
9986 \begin_layout Plain Layout
9993 \begin_inset Quotes erd
9997 This way was chosen so that the look is the same with each used screen
10002 \begin_layout Description
10003 \begin_inset Flex CharStyle:Code
10006 \begin_layout Plain Layout
10013 \begin_inset Flex CharStyle:Code
10016 \begin_layout Plain Layout
10021 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10027 \begin_inset Newline newline
10030 The kind of margin that the layout has on the left side.
10032 \begin_inset Flex CharStyle:Code
10035 \begin_layout Plain Layout
10041 just means a fixed margin.
10043 \begin_inset Flex CharStyle:Code
10046 \begin_layout Plain Layout
10052 means that the left margin depends on the string entered in the
10053 \begin_inset Flex CharStyle:MenuItem
10056 \begin_layout Plain Layout
10057 Edit\SpecialChar \menuseparator
10059 \begin_inset space ~
10068 This is used to typeset nice lists without tabulators.
10070 \begin_inset Flex CharStyle:Code
10073 \begin_layout Plain Layout
10079 means that the margin depends on the size of the label.
10080 This is used for automatic enumerated headlines.
10081 It is obvious that the headline
10082 \begin_inset Quotes eld
10085 5.4.3.2.1 Very long headline
10086 \begin_inset Quotes erd
10089 must have a wider left margin (as wide as
10090 \begin_inset Quotes eld
10094 \begin_inset Quotes erd
10097 plus the space) than
10098 \begin_inset Quotes eld
10101 3.2 Very long headline
10102 \begin_inset Quotes erd
10106 \begin_inset Quotes eld
10110 \begin_inset Quotes erd
10113 are not able to do this.
10115 \begin_inset Flex CharStyle:Code
10118 \begin_layout Plain Layout
10124 is similar, but only the very first row of the paragraph is dynamic, while
10125 the others are static; this is used, for example, for descriptions.
10127 \begin_inset Flex CharStyle:Code
10130 \begin_layout Plain Layout
10136 means the margin is chosen in a way that the longest row of this paragraph
10137 fits to the right margin.
10138 This is used to typeset an address on the right edge of the page.
10141 \begin_layout Description
10142 \begin_inset Flex CharStyle:Code
10145 \begin_layout Plain Layout
10152 \begin_inset Flex CharStyle:Code
10155 \begin_layout Plain Layout
10164 \begin_inset Flex CharStyle:Code
10167 \begin_layout Plain Layout
10173 ] Whether fragile commands in this layout should be
10174 \begin_inset Flex CharStyle:Code
10177 \begin_layout Plain Layout
10190 whether this command should itself be protected.)
10193 \begin_layout Description
10194 \begin_inset Flex CharStyle:Code
10197 \begin_layout Plain Layout
10204 \begin_inset Flex CharStyle:Code
10207 \begin_layout Plain Layout
10214 \begin_inset Flex CharStyle:Code
10217 \begin_layout Plain Layout
10225 ] Whether newlines are translated into LaTeX newlines (
10226 \begin_inset Flex CharStyle:Code
10229 \begin_layout Plain Layout
10240 The translation can be switched off to allow more comfortable LaTeX editing
10244 \begin_layout Description
10245 \begin_inset Flex CharStyle:Code
10248 \begin_layout Plain Layout
10255 \begin_inset Flex CharStyle:Code
10258 \begin_layout Plain Layout
10265 \begin_inset Flex CharStyle:Code
10268 \begin_layout Plain Layout
10276 ] Whether the following Paragraph is allowed to indent its very first row.
10278 \begin_inset Flex CharStyle:Code
10281 \begin_layout Plain Layout
10287 means that it is not allowed to do so;
10288 \begin_inset Flex CharStyle:Code
10291 \begin_layout Plain Layout
10297 means it could do so if it wants to.
10300 \begin_layout Description
10301 \begin_inset Flex CharStyle:Code
10304 \begin_layout Plain Layout
10310 Name of a layout that has replaced this layout.
10311 This is used to rename a layout, while keeping backward compatibility.
10314 \begin_layout Description
10315 \begin_inset Flex CharStyle:Code
10318 \begin_layout Plain Layout
10325 \begin_inset Flex CharStyle:Code
10328 \begin_layout Plain Layout
10334 ] The number of optional arguments that can be used with this layout.
10335 This is useful for things like section headings, and only makes sense with
10339 \begin_layout Description
10340 \begin_inset Flex CharStyle:Code
10343 \begin_layout Plain Layout
10350 \begin_inset Flex CharStyle:Code
10353 \begin_layout Plain Layout
10359 ] The indent of the very first line of a paragraph.
10361 \begin_inset Flex CharStyle:Code
10364 \begin_layout Plain Layout
10370 will be fixed for a certain layout.
10371 The exception is Standard layout, since the indentation of a Standard layout
10372 paragraph can be prohibited with
10373 \begin_inset Flex CharStyle:Code
10376 \begin_layout Plain Layout
10383 Also, Standard layout paragraphs inside environments use the
10384 \begin_inset Flex CharStyle:Code
10387 \begin_layout Plain Layout
10393 of the environment, not their native one.
10394 For example, Standard paragraphs inside an enumeration are not indented.
10397 \begin_layout Description
10398 \begin_inset Flex CharStyle:Code
10401 \begin_layout Plain Layout
10408 \begin_inset Flex CharStyle:Code
10411 \begin_layout Plain Layout
10417 ] The vertical space between two paragraphs of this layout.
10420 \begin_layout Description
10421 \begin_inset Flex CharStyle:Code
10424 \begin_layout Plain Layout
10431 \begin_inset Flex CharStyle:Code
10434 \begin_layout Plain Layout
10440 ] LyX allows the user to choose either
10441 \begin_inset Quotes eld
10445 \begin_inset Quotes erd
10449 \begin_inset Quotes eld
10453 \begin_inset Quotes erd
10456 to typeset a document.
10458 \begin_inset Quotes eld
10462 \begin_inset Quotes erd
10465 is chosen, this value is completely ignored.
10467 \begin_inset Quotes eld
10471 \begin_inset Quotes erd
10474 is chosen, the parindent of a LaTeXtype
10475 \begin_inset Quotes eld
10479 \begin_inset Quotes erd
10482 layout is ignored and all paragraphs are separated by this parskip argument.
10483 The vertical space is calculated with
10484 \begin_inset Flex CharStyle:Code
10487 \begin_layout Plain Layout
10489 \begin_inset space ~
10498 \begin_inset Flex CharStyle:Code
10501 \begin_layout Plain Layout
10507 is the height of a row with the normal font.
10508 This way, the look stays the same with different screen fonts.
10511 \begin_layout Description
10512 \begin_inset Flex CharStyle:Code
10515 \begin_layout Plain Layout
10522 \begin_inset CommandInset label
10524 name "des:PathThru"
10531 \begin_inset Flex CharStyle:Code
10534 \begin_layout Plain Layout
10545 \begin_inset Flex CharStyle:Code
10548 \begin_layout Plain Layout
10554 ] Whether the contents of this paragraph should be output in raw form, meaning
10555 without special translations that LaTeX would require.
10558 \begin_layout Description
10559 \begin_inset Flex CharStyle:Code
10562 \begin_layout Plain Layout
10569 \begin_inset CommandInset label
10571 name "des:Preamble"
10575 Information to be included in the LaTeX preamble when this style is used.
10576 Used to define macros, load packages, etc., required by this particular
10579 \begin_inset Quotes eld
10583 \begin_inset Flex CharStyle:Code
10586 \begin_layout Plain Layout
10593 \begin_inset Quotes erd
10599 \begin_layout Description
10600 \begin_inset Flex CharStyle:Code
10603 \begin_layout Plain Layout
10610 \begin_inset Flex CharStyle:Code
10613 \begin_layout Plain Layout
10620 \begin_inset CommandInset label
10622 name "des:Requires"
10626 Whether the layout requires the feature
10627 \begin_inset Flex CharStyle:Code
10630 \begin_layout Plain Layout
10637 See the description of
10638 \begin_inset Flex CharStyle:Code
10641 \begin_layout Plain Layout
10648 \begin_inset CommandInset ref
10649 LatexCommand vpageref
10650 reference "des:Provides"
10654 for information on `features'.
10658 \begin_layout Description
10659 \begin_inset Flex CharStyle:Code
10662 \begin_layout Plain Layout
10669 \begin_inset Flex CharStyle:Code
10672 \begin_layout Plain Layout
10679 \begin_inset Flex CharStyle:Code
10682 \begin_layout Plain Layout
10691 \begin_layout Description
10692 \begin_inset Flex CharStyle:Code
10695 \begin_layout Plain Layout
10702 \begin_inset Flex CharStyle:Code
10705 \begin_layout Plain Layout
10710 , onehalf, double, other
10719 ] This defines what the default spacing should be in the layout.
10721 \begin_inset Flex CharStyle:Code
10724 \begin_layout Plain Layout
10731 \begin_inset Flex CharStyle:Code
10734 \begin_layout Plain Layout
10741 \begin_inset Flex CharStyle:Code
10744 \begin_layout Plain Layout
10750 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
10751 If you specify the argument
10752 \begin_inset Flex CharStyle:Code
10755 \begin_layout Plain Layout
10761 , then you should also provide a numerical argument which will be the actual
10763 Note that, contrary to other parameters,
10764 \begin_inset Flex CharStyle:Code
10767 \begin_layout Plain Layout
10773 implies the generation of specific LaTeX code, using the package
10776 \begin_inset Flex CharStyle:Code
10779 \begin_layout Plain Layout
10788 \begin_layout Description
10789 \begin_inset Flex CharStyle:Code
10792 \begin_layout Plain Layout
10798 The font used for the text body .
10800 \begin_inset CommandInset ref
10802 reference "sec:fonts"
10809 \begin_layout Description
10810 \begin_inset Flex CharStyle:Code
10813 \begin_layout Plain Layout
10821 The level of the style in the table of contents.
10822 This is used for automatic numbering of section headings.
10825 \begin_layout Description
10826 \begin_inset Flex CharStyle:Code
10829 \begin_layout Plain Layout
10836 \begin_inset Flex CharStyle:Code
10839 \begin_layout Plain Layout
10845 ] The vertical space with which the very first of a chain of paragraphs
10846 with this layout is separated from the previous paragraph.
10847 If the previous paragraph has another layout, the separations are not simply
10848 added, but the maximum is taken.
10851 \begin_layout Subsection
10855 \begin_layout Standard
10856 \begin_inset CommandInset label
10862 Since version 1.3.0 of LyX, it is has been both possible and necessary to
10863 define the floats (
10864 \begin_inset Flex CharStyle:MenuItem
10867 \begin_layout Plain Layout
10874 \begin_inset Flex CharStyle:MenuItem
10877 \begin_layout Plain Layout
10883 , \SpecialChar \ldots{}
10884 ) in the text class itself.
10885 Standard floats are included in the file
10886 \begin_inset Flex CharStyle:Code
10889 \begin_layout Plain Layout
10895 , so you may have to do no more than add
10898 \begin_layout LyX-Code
10899 Input stdfloats.inc
10902 \begin_layout Standard
10903 to your layout file.
10904 If you want to implement a text class that proposes some other float types
10905 (like the AGU class bundled with LyX), the information below will hopefully
10909 \begin_layout Description
10910 \begin_inset Flex CharStyle:Code
10913 \begin_layout Plain Layout
10920 \begin_inset Flex CharStyle:Code
10923 \begin_layout Plain Layout
10930 \begin_inset Quotes erd
10934 \begin_inset Quotes erd
10937 ] The file name extension of an auxiliary file for the list of figures (or
10939 LaTeX writes the captions to this file.
10942 \begin_layout Description
10943 \begin_inset Flex CharStyle:Code
10946 \begin_layout Plain Layout
10953 \begin_inset Flex CharStyle:Code
10956 \begin_layout Plain Layout
10963 \begin_inset Quotes erd
10967 \begin_inset Quotes erd
10970 ] The string that will be used in the menus and also for the caption.
10973 \begin_layout Description
10974 \begin_inset Flex CharStyle:Code
10977 \begin_layout Plain Layout
10984 \begin_inset Flex CharStyle:Code
10987 \begin_layout Plain Layout
10996 \begin_inset Flex CharStyle:Code
10999 \begin_layout Plain Layout
11006 \begin_inset Flex CharStyle:Code
11009 \begin_layout Plain Layout
11015 if the float is already defined by the LaTeX document class.
11017 \begin_inset Flex CharStyle:Code
11020 \begin_layout Plain Layout
11026 , the float will be defined using the LaTeX package
11027 \begin_inset Flex CharStyle:Code
11030 \begin_layout Plain Layout
11039 \begin_layout Description
11040 \begin_inset Flex CharStyle:Code
11043 \begin_layout Plain Layout
11050 \begin_inset Flex CharStyle:Code
11053 \begin_layout Plain Layout
11060 \begin_inset Quotes erd
11064 \begin_inset Quotes erd
11067 ] The heading used for the list of floats.
11070 \begin_layout Description
11071 \begin_inset Flex CharStyle:Code
11074 \begin_layout Plain Layout
11081 \begin_inset Flex CharStyle:Code
11084 \begin_layout Plain Layout
11091 \begin_inset Quotes erd
11095 \begin_inset Quotes erd
11098 ] This (optional) argument determines whether floats of this class will
11099 be numbered within some sectional unit of the document.
11100 For example, if within is equal to
11101 \begin_inset Flex CharStyle:Code
11104 \begin_layout Plain Layout
11110 , the floats will be numbered within chapters.
11114 \begin_layout Description
11115 \begin_inset Flex CharStyle:Code
11118 \begin_layout Plain Layout
11125 \begin_inset Flex CharStyle:Code
11128 \begin_layout Plain Layout
11135 \begin_inset Quotes erd
11139 \begin_inset Quotes erd
11142 ] The default placement for the given class of floats.
11143 The string should be as in standard LaTeX:
11144 \begin_inset Flex CharStyle:Code
11147 \begin_layout Plain Layout
11154 \begin_inset Flex CharStyle:Code
11157 \begin_layout Plain Layout
11164 \begin_inset Flex CharStyle:Code
11167 \begin_layout Plain Layout
11174 \begin_inset Flex CharStyle:Code
11177 \begin_layout Plain Layout
11183 for top, bottom, page, and here, respectively.
11187 \begin_layout Plain Layout
11188 Note that the order of these letters in the string is irrelevant, like in
11194 On top of that there is a new type,
11195 \begin_inset Flex CharStyle:Code
11198 \begin_layout Plain Layout
11204 , which does not really correspond to a float, since it means: put it
11205 \begin_inset Quotes eld
11209 \begin_inset Quotes erd
11213 Note however that the
11214 \begin_inset Flex CharStyle:Code
11217 \begin_layout Plain Layout
11223 specifier is special and, because of implementation details, cannot be
11224 used in non-built in float types.
11225 If you do not understand what this means, just use
11226 \begin_inset Quotes eld
11230 \begin_inset Flex CharStyle:Code
11233 \begin_layout Plain Layout
11240 \begin_inset Quotes erd
11246 \begin_layout Description
11247 \begin_inset Flex CharStyle:Code
11250 \begin_layout Plain Layout
11257 \begin_inset Flex CharStyle:Code
11260 \begin_layout Plain Layout
11267 \begin_inset Quotes erd
11271 \begin_inset Quotes erd
11274 ] The style used when defining the float using
11275 \begin_inset Flex CharStyle:Code
11278 \begin_layout Plain Layout
11289 \begin_layout Description
11290 \begin_inset Flex CharStyle:Code
11293 \begin_layout Plain Layout
11300 \begin_inset Flex CharStyle:Code
11303 \begin_layout Plain Layout
11310 \begin_inset Quotes erd
11314 \begin_inset Quotes erd
11318 \begin_inset Quotes eld
11322 \begin_inset Quotes erd
11325 of the new class of floats, like program or algorithm.
11326 After the appropriate
11327 \begin_inset Flex CharStyle:Code
11330 \begin_layout Plain Layout
11339 \begin_inset Flex CharStyle:Code
11342 \begin_layout Plain Layout
11351 \begin_inset Flex CharStyle:Code
11354 \begin_layout Plain Layout
11365 \begin_layout Standard
11366 Note that defining a float with type
11367 \begin_inset Flex CharStyle:Code
11370 \begin_layout Plain Layout
11378 automatically defines the corresponding counter with name
11379 \begin_inset Flex CharStyle:Code
11382 \begin_layout Plain Layout
11393 \begin_layout Subsection
11394 Flex insets and InsetLayout
11397 \begin_layout Standard
11398 \begin_inset CommandInset label
11400 name "sec:charstyle"
11404 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11405 these are called Flex insets.
11409 \begin_layout Standard
11410 Flex insets come in three different kinds:
11413 \begin_layout Itemize
11415 \begin_inset Flex CharStyle:Code
11418 \begin_layout Plain Layout
11424 ): These define semantic markup corresponding to such LaTeX commands as
11426 \begin_inset Flex CharStyle:Code
11429 \begin_layout Plain Layout
11438 \begin_inset Flex CharStyle:Code
11441 \begin_layout Plain Layout
11452 \begin_layout Itemize
11454 \begin_inset Flex CharStyle:Code
11457 \begin_layout Plain Layout
11463 ): These can be used to define custom collapsible insets, similar to TeX
11464 code, footnote, and the like.
11465 An obvious example is an endnote inset, which is defined in the
11466 \begin_inset Flex CharStyle:Code
11469 \begin_layout Plain Layout
11478 \begin_layout Itemize
11480 \begin_inset Flex CharStyle:Code
11483 \begin_layout Plain Layout
11489 ): For use with DocBook classes.
11492 \begin_layout Standard
11493 Flex insets are defined using the
11494 \begin_inset Flex CharStyle:Code
11497 \begin_layout Plain Layout
11503 tag, which shall be explained in a moment.
11506 \begin_layout Standard
11508 \begin_inset Flex CharStyle:Code
11511 \begin_layout Plain Layout
11517 tag also serves another function: It can be used to customize the general
11518 layout of many different types of insets.
11520 \begin_inset Flex CharStyle:Code
11523 \begin_layout Plain Layout
11529 can be used to customize the layout parameters for footnotes, marginal
11530 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
11531 boxes, tables, algorithms, URLs, and optional arguments, as well as to
11532 define Flex insets.
11535 \begin_layout Standard
11537 \begin_inset Flex CharStyle:Code
11540 \begin_layout Plain Layout
11546 definition must begin with a line of the form:
11549 \begin_layout LyX-Code
11553 \begin_layout Standard
11555 \begin_inset Flex CharStyle:Code
11558 \begin_layout Plain Layout
11564 indicates the inset whose layout is being defined, and here there are two
11568 \begin_layout Enumerate
11569 The layout for a pre-existing inset is being modified.
11570 In this case, can be
11571 \begin_inset Flex CharStyle:Code
11574 \begin_layout Plain Layout
11580 any one of the following:
11581 \begin_inset Flex CharStyle:Code
11584 \begin_layout Plain Layout
11591 \begin_inset Flex CharStyle:Code
11594 \begin_layout Plain Layout
11601 \begin_inset Flex CharStyle:Code
11604 \begin_layout Plain Layout
11611 \begin_inset Flex CharStyle:Code
11614 \begin_layout Plain Layout
11621 \begin_inset Flex CharStyle:Code
11624 \begin_layout Plain Layout
11631 \begin_inset Flex CharStyle:Code
11634 \begin_layout Plain Layout
11641 \begin_inset Flex CharStyle:Code
11644 \begin_layout Plain Layout
11651 \begin_inset Flex CharStyle:Code
11654 \begin_layout Plain Layout
11661 \begin_inset Flex CharStyle:Code
11664 \begin_layout Plain Layout
11671 \begin_inset Flex CharStyle:Code
11674 \begin_layout Plain Layout
11681 \begin_inset Flex CharStyle:Code
11684 \begin_layout Plain Layout
11691 \begin_inset Flex CharStyle:Code
11694 \begin_layout Plain Layout
11701 \begin_inset Flex CharStyle:Code
11704 \begin_layout Plain Layout
11711 \begin_inset Flex CharStyle:Code
11714 \begin_layout Plain Layout
11721 \begin_inset Flex CharStyle:Code
11724 \begin_layout Plain Layout
11731 \begin_inset Flex CharStyle:Code
11734 \begin_layout Plain Layout
11741 \begin_inset Flex CharStyle:Code
11744 \begin_layout Plain Layout
11751 \begin_inset Flex CharStyle:Code
11754 \begin_layout Plain Layout
11761 \begin_inset Flex CharStyle:Code
11764 \begin_layout Plain Layout
11771 \begin_inset Flex CharStyle:Code
11774 \begin_layout Plain Layout
11784 \begin_layout Enumerate
11785 The layout for a Flex inset is being defined.
11787 \begin_inset Flex CharStyle:Code
11790 \begin_layout Plain Layout
11796 can be any valid identifier not used by a pre-existing inset.
11797 Note that the definition of a flex inset must
11802 \begin_inset Flex CharStyle:Code
11805 \begin_layout Plain Layout
11814 \begin_layout Standard
11816 \begin_inset Flex CharStyle:Code
11819 \begin_layout Plain Layout
11825 definition can contain the following entries:
11828 \begin_layout Description
11829 \begin_inset Flex CharStyle:Code
11832 \begin_layout Plain Layout
11838 The color for the inset's background.
11839 The valid colors are defined in
11840 \begin_inset Flex CharStyle:Code
11843 \begin_layout Plain Layout
11852 \begin_layout Description
11853 \begin_inset Flex CharStyle:Code
11856 \begin_layout Plain Layout
11862 As with paragraph styles (see page
11863 \begin_inset CommandInset ref
11865 reference "des:CopyStyle"
11872 \begin_layout Description
11873 \begin_inset Flex CharStyle:Code
11876 \begin_layout Plain Layout
11883 \begin_inset Flex CharStyle:Code
11886 \begin_layout Plain Layout
11895 \begin_inset Flex CharStyle:Code
11898 \begin_layout Plain Layout
11904 ] Indicates whether the user may employ the Paragraph Settings dialog to
11905 customize the paragraph.
11908 \begin_layout Description
11909 \begin_inset Flex CharStyle:Code
11912 \begin_layout Plain Layout
11919 \begin_inset Flex CharStyle:Code
11922 \begin_layout Plain Layout
11929 \begin_inset Flex CharStyle:Code
11932 \begin_layout Plain Layout
11939 \begin_inset Flex CharStyle:Code
11942 \begin_layout Plain Layout
11948 , describing the rendering style used for the inset's frame and buttons.
11949 Footnotes generally use
11950 \begin_inset Flex CharStyle:Code
11953 \begin_layout Plain Layout
11959 , ERT insets generally
11960 \begin_inset Flex CharStyle:Code
11963 \begin_layout Plain Layout
11969 , and character styles
11970 \begin_inset Flex CharStyle:Code
11973 \begin_layout Plain Layout
11982 \begin_layout Description
11983 \begin_inset Flex CharStyle:Code
11986 \begin_layout Plain Layout
11992 Required at the end of the InsetLayout declarations.
11995 \begin_layout Description
11996 \begin_inset Flex CharStyle:Code
11999 \begin_layout Plain Layout
12005 The font used for both the text body
12011 \begin_inset space ~
12015 \begin_inset CommandInset ref
12017 reference "sec:fonts"
12022 Note that defining this font automatically defines the
12023 \begin_inset Flex CharStyle:Code
12026 \begin_layout Plain Layout
12032 to the same value, so define this first and define
12033 \begin_inset Flex CharStyle:Code
12036 \begin_layout Plain Layout
12042 later if you want them to be different.
12045 \begin_layout Description
12046 \begin_inset Flex CharStyle:Code
12049 \begin_layout Plain Layout
12056 \begin_inset Quotes eld
12060 \begin_inset Quotes erd
12063 language, leading to Left-to-Right (latin) output, e.
12064 \begin_inset space \thinspace{}
12068 \begin_inset space \space{}
12071 in TeX code or URL.
12075 \begin_layout Description
12076 \begin_inset Flex CharStyle:Code
12079 \begin_layout Plain Layout
12086 \begin_inset Flex CharStyle:Code
12089 \begin_layout Plain Layout
12098 \begin_inset Flex CharStyle:Code
12101 \begin_layout Plain Layout
12107 ] Indicates whether the PlainLayout should be used or, instead, the user
12108 can change the paragraph style used in the inset.
12111 \begin_layout Description
12112 \begin_inset Flex CharStyle:Code
12115 \begin_layout Plain Layout
12121 As with paragraph styles (see page
12122 \begin_inset CommandInset ref
12123 LatexCommand pageref
12124 reference "des:FreeSpacing"
12131 \begin_layout Description
12132 \begin_inset Flex CharStyle:Code
12135 \begin_layout Plain Layout
12141 As with paragraph styles (see page
12142 \begin_inset CommandInset ref
12143 LatexCommand pageref
12144 reference "des:KeepEmpty"
12151 \begin_layout Description
12152 \begin_inset Flex CharStyle:Code
12155 \begin_layout Plain Layout
12161 The font used for the label.
12163 \begin_inset space ~
12167 \begin_inset CommandInset ref
12169 reference "sec:fonts"
12174 Note that this definition can never appear before
12175 \begin_inset Flex CharStyle:Code
12178 \begin_layout Plain Layout
12184 , lest it be ineffective.
12187 \begin_layout Description
12188 \begin_inset Flex CharStyle:Code
12191 \begin_layout Plain Layout
12197 What will be displayed on the button or elsewhere as the inset label.
12198 Some inset types (TeX code and Branch) modify this label on the fly.
12201 \begin_layout Description
12202 \begin_inset Flex CharStyle:Code
12205 \begin_layout Plain Layout
12211 The name of the corresponding LaTeX stuff.
12212 Either the environment or command name.
12215 \begin_layout Description
12216 \begin_inset Flex CharStyle:Code
12219 \begin_layout Plain Layout
12225 The optional parameter for the corresponding
12226 \begin_inset Flex CharStyle:Code
12229 \begin_layout Plain Layout
12235 stuff, including possible bracket pairs like
12236 \begin_inset Flex CharStyle:Code
12239 \begin_layout Plain Layout
12246 This parameter cannot be changed from within LyX.
12249 \begin_layout Description
12250 \begin_inset Flex CharStyle:Code
12253 \begin_layout Plain Layout
12259 As with paragraph styles (see page
12260 \begin_inset CommandInset ref
12261 LatexCommand pageref
12262 reference "des:LatexType"
12269 \begin_layout Description
12270 \begin_inset Flex CharStyle:Code
12273 \begin_layout Plain Layout
12280 \begin_inset Flex CharStyle:Code
12283 \begin_layout Plain Layout
12290 \begin_inset Flex CharStyle:Code
12293 \begin_layout Plain Layout
12300 \begin_inset Flex CharStyle:Code
12303 \begin_layout Plain Layout
12310 \begin_inset Flex CharStyle:Code
12313 \begin_layout Plain Layout
12319 (indicating a dummy definition ending definitions of charstyles, etc).
12320 This entry is required in and is only meaningful for Flex insets.
12321 Among other things, it determines on which menu this inset will appear.
12324 \begin_layout Description
12325 \begin_inset Flex CharStyle:Code
12328 \begin_layout Plain Layout
12335 \begin_inset Flex CharStyle:Code
12338 \begin_layout Plain Layout
12347 \begin_inset Flex CharStyle:Code
12350 \begin_layout Plain Layout
12356 ] Whether multiple paragraphs are permitted in this inset.
12357 This will also set CustomPars to the same value and ForcePlain to the opposite
12359 These can be reset to other values, if they are used
12366 \begin_layout Description
12367 \begin_inset Flex CharStyle:Code
12370 \begin_layout Plain Layout
12377 \begin_inset Flex CharStyle:Code
12380 \begin_layout Plain Layout
12389 \begin_inset Flex CharStyle:Code
12392 \begin_layout Plain Layout
12398 ] Whether fragile commands in this layout should be
12399 \begin_inset Flex CharStyle:Code
12402 \begin_layout Plain Layout
12415 whether the command should itself be protected.)
12418 \begin_layout Description
12419 \begin_inset Flex CharStyle:Code
12422 \begin_layout Plain Layout
12429 \begin_inset Flex CharStyle:Code
12432 \begin_layout Plain Layout
12441 \begin_inset Flex CharStyle:Code
12444 \begin_layout Plain Layout
12450 ] As with paragraph styles (see page
12451 \begin_inset CommandInset ref
12453 reference "des:PathThru"
12460 \begin_layout Description
12461 \begin_inset Flex CharStyle:Code
12464 \begin_layout Plain Layout
12470 As with paragraph styles (see page
12471 \begin_inset CommandInset ref
12472 LatexCommand pageref
12473 reference "des:Preamble"
12480 \begin_layout Description
12481 \begin_inset Flex CharStyle:Code
12484 \begin_layout Plain Layout
12491 \begin_inset Flex CharStyle:Code
12494 \begin_layout Plain Layout
12500 ] As with paragraph styles (see page
12501 \begin_inset CommandInset ref
12502 LatexCommand pageref
12503 reference "des:Requires"
12510 \begin_layout Subsection
12514 \begin_layout Standard
12515 \begin_inset CommandInset label
12521 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12523 \begin_inset Flex CharStyle:MenuItem
12526 \begin_layout Plain Layout
12533 \begin_inset Flex CharStyle:MenuItem
12536 \begin_layout Plain Layout
12542 , \SpecialChar \ldots{}
12543 ) in the text class itself.
12544 The standard counters are defined in the file
12545 \begin_inset Flex CharStyle:Code
12548 \begin_layout Plain Layout
12554 , so you may have to do no more than add
12557 \begin_layout LyX-Code
12558 Input stdcounters.inc
12561 \begin_layout Standard
12562 to your layout file to get them to work.
12563 But if you want to define custom counters, then you can do so.
12564 The counter declaration must begin with:
12567 \begin_layout LyX-Code
12571 \begin_layout Standard
12572 where of course `name' is replaced by the name of the counter.
12573 And it must end with
12574 \begin_inset Quotes eld
12578 \begin_inset Flex CharStyle:Code
12581 \begin_layout Plain Layout
12588 \begin_inset Quotes erd
12592 The following parameters can also be used:
12595 \begin_layout Description
12596 \begin_inset Flex CharStyle:Code
12599 \begin_layout Plain Layout
12600 LabelString [string=""]
12605 when this is defined, this string defines how the counter is displayed.
12606 Setting this value sets
12607 \begin_inset Flex CharStyle:Code
12610 \begin_layout Plain Layout
12611 LabelStringAppendix
12617 The following special constructs can be used in the string:
12621 \begin_layout Itemize
12622 \begin_inset Flex CharStyle:Code
12625 \begin_layout Plain Layout
12633 will be replaced by the expansion of the
12634 \begin_inset Flex CharStyle:Code
12637 \begin_layout Plain Layout
12644 \begin_inset Flex CharStyle:Code
12647 \begin_layout Plain Layout
12648 LabelStringAppendix
12654 \begin_inset Flex CharStyle:Code
12657 \begin_layout Plain Layout
12667 \begin_layout Itemize
12668 counter values can be expressed using LaTeX-like macros
12669 \begin_inset Flex CharStyle:Code
12672 \begin_layout Plain Layout
12689 \begin_inset Flex CharStyle:Code
12692 \begin_layout Plain Layout
12704 \begin_layout Plain Layout
12714 Actually, the situation is a bit more complicated: any
12733 other than those described below will produce arabic numerals.
12734 It would not be surprising to see this change in the future.
12740 \begin_inset Flex CharStyle:Code
12743 \begin_layout Plain Layout
12749 : 1, 2, 3,\SpecialChar \ldots{}
12751 \begin_inset Flex CharStyle:Code
12754 \begin_layout Plain Layout
12760 for lower-case letters: a, b, c, \SpecialChar \ldots{}
12762 \begin_inset Flex CharStyle:Code
12765 \begin_layout Plain Layout
12771 for upper-case letters: A, B, C, \SpecialChar \ldots{}
12773 \begin_inset Flex CharStyle:Code
12776 \begin_layout Plain Layout
12782 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
12784 \begin_inset Flex CharStyle:Code
12787 \begin_layout Plain Layout
12793 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
12795 \begin_inset Flex CharStyle:Code
12798 \begin_layout Plain Layout
12804 for hebrew numerals.
12808 \begin_layout Standard
12809 If LabelString is not defined, a default value is constructed as follows:
12810 if the counter has a master counter
12811 \begin_inset Flex CharStyle:Code
12814 \begin_layout Plain Layout
12821 \begin_inset Flex CharStyle:Code
12824 \begin_layout Plain Layout
12831 \begin_inset Flex CharStyle:Code
12834 \begin_layout Plain Layout
12844 is used; otherwise the string
12845 \begin_inset Flex CharStyle:Code
12848 \begin_layout Plain Layout
12859 \begin_layout Description
12860 \begin_inset Flex CharStyle:Code
12863 \begin_layout Plain Layout
12864 LabelStringAppendix [string=""]
12870 \begin_inset Flex CharStyle:Code
12873 \begin_layout Plain Layout
12879 , but for use in the Appendix.
12882 \begin_layout Description
12883 \begin_inset Flex CharStyle:Code
12886 \begin_layout Plain Layout
12893 \begin_inset Flex CharStyle:Code
12896 \begin_layout Plain Layout
12903 \begin_inset Quotes erd
12907 \begin_inset Quotes erd
12910 ] If this is set to the name of another counter, the present counter will
12911 be reset every time the other one is increased.
12913 \begin_inset Flex CharStyle:Code
12916 \begin_layout Plain Layout
12923 \begin_inset Flex CharStyle:Code
12926 \begin_layout Plain Layout
12935 \begin_layout Subsection
12939 \begin_layout Standard
12940 \begin_inset CommandInset label
12946 A font description looks like this:
12949 \begin_layout LyX-Code
12959 \begin_layout LyX-Code
12963 \begin_layout LyX-Code
12967 \begin_layout Standard
12968 The following commands are available:
12971 \begin_layout Description
12972 \begin_inset Flex CharStyle:Code
12975 \begin_layout Plain Layout
12982 \begin_inset Flex CharStyle:Code
12985 \begin_layout Plain Layout
12994 \begin_inset Flex CharStyle:Code
12997 \begin_layout Plain Layout
13004 \begin_inset Flex CharStyle:Code
13007 \begin_layout Plain Layout
13014 \begin_inset Flex CharStyle:Code
13017 \begin_layout Plain Layout
13024 \begin_inset Flex CharStyle:Code
13027 \begin_layout Plain Layout
13034 \begin_inset Flex CharStyle:Code
13037 \begin_layout Plain Layout
13044 \begin_inset Flex CharStyle:Code
13047 \begin_layout Plain Layout
13054 \begin_inset Flex CharStyle:Code
13057 \begin_layout Plain Layout
13064 \begin_inset Flex CharStyle:Code
13067 \begin_layout Plain Layout
13076 \begin_layout Description
13077 \begin_inset Flex CharStyle:Code
13080 \begin_layout Plain Layout
13089 \begin_inset Flex CharStyle:Code
13092 \begin_layout Plain Layout
13103 \begin_inset Flex CharStyle:Code
13106 \begin_layout Plain Layout
13113 \begin_inset Flex CharStyle:Code
13116 \begin_layout Plain Layout
13125 \begin_layout Description
13126 \begin_inset Flex CharStyle:Code
13129 \begin_layout Plain Layout
13136 \begin_inset Flex CharStyle:Code
13139 \begin_layout Plain Layout
13145 ] Valid argument are:
13146 \begin_inset Flex CharStyle:Code
13149 \begin_layout Plain Layout
13156 \begin_inset Flex CharStyle:Code
13159 \begin_layout Plain Layout
13166 \begin_inset Flex CharStyle:Code
13169 \begin_layout Plain Layout
13176 \begin_inset Flex CharStyle:Code
13179 \begin_layout Plain Layout
13186 \begin_inset Flex CharStyle:Code
13189 \begin_layout Plain Layout
13196 \begin_inset Flex CharStyle:Code
13199 \begin_layout Plain Layout
13206 Each of these turns on or off the corresponding attribute.
13209 \begin_layout Description
13210 \begin_inset Flex CharStyle:Code
13213 \begin_layout Plain Layout
13222 \begin_inset Flex CharStyle:Code
13225 \begin_layout Plain Layout
13236 \begin_inset Flex CharStyle:Code
13239 \begin_layout Plain Layout
13248 \begin_layout Description
13249 \begin_inset Flex CharStyle:Code
13252 \begin_layout Plain Layout
13261 \begin_inset Flex CharStyle:Code
13264 \begin_layout Plain Layout
13275 \begin_inset Flex CharStyle:Code
13278 \begin_layout Plain Layout
13285 \begin_inset Flex CharStyle:Code
13288 \begin_layout Plain Layout
13295 \begin_inset Flex CharStyle:Code
13298 \begin_layout Plain Layout
13307 \begin_layout Description
13308 \begin_inset Flex CharStyle:Code
13311 \begin_layout Plain Layout
13318 \begin_inset Flex CharStyle:Code
13321 \begin_layout Plain Layout
13328 \begin_inset Flex CharStyle:Code
13331 \begin_layout Plain Layout
13338 \begin_inset Flex CharStyle:Code
13341 \begin_layout Plain Layout
13350 \begin_inset Flex CharStyle:Code
13353 \begin_layout Plain Layout
13360 \begin_inset Flex CharStyle:Code
13363 \begin_layout Plain Layout
13370 \begin_inset Flex CharStyle:Code
13373 \begin_layout Plain Layout
13380 \begin_inset Flex CharStyle:Code
13383 \begin_layout Plain Layout
13390 \begin_inset Flex CharStyle:Code
13393 \begin_layout Plain Layout
13402 \begin_layout Subsection
13403 Upgrading old layout files
13406 \begin_layout Standard
13407 The file format of layout files changes from time to time, so old layout
13408 files need to be converted.
13409 This process has been automated since LyX 1.4.0: If LyX reads an old format
13410 layout file it will call the conversion tool
13411 \begin_inset Flex CharStyle:Code
13414 \begin_layout Plain Layout
13415 LyXDir/scripts/layout2layout.py
13420 and convert it to a temporary file in current format.
13421 The original file is left untouched.
13422 If you want to convert the layout file permanently, just call the converter
13426 \begin_layout LyX-Code
13427 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13430 \begin_layout Standard
13431 (You need to replace
13432 \begin_inset Flex CharStyle:Code
13435 \begin_layout Plain Layout
13441 with the name of your LyX system directory, unless you happen to have defined
13442 such an environment variable.) Then copy
13443 \begin_inset Flex CharStyle:Code
13446 \begin_layout Plain Layout
13453 \begin_inset Flex CharStyle:Code
13456 \begin_layout Plain Layout
13465 \begin_layout Standard
13466 The automatic conversion only handles syntax changes.
13467 It cannot handle the case where the contents of included files was changed,
13468 so these will have to be converted separately.
13471 \begin_layout Section
13473 \begin_inset CommandInset label
13475 name "sec:templates"
13482 \begin_layout Standard
13483 Templates are created just like usual documents.
13484 The only difference is that usual documents contain all possible settings,
13485 including the font scheme and the paper size.
13486 Usually a user doesn't want a template to overwrite his defaults in these
13488 For that reason, the designer of a template should remove the corresponding
13490 \begin_inset Flex CharStyle:Code
13493 \begin_layout Plain Layout
13502 \begin_inset Flex CharStyle:Code
13505 \begin_layout Plain Layout
13513 from the template LyX file.
13514 This can be done with any simple text-editor, for example
13515 \begin_inset Flex CharStyle:Code
13518 \begin_layout Plain Layout
13525 \begin_inset Flex CharStyle:Code
13528 \begin_layout Plain Layout
13538 \begin_layout Standard
13539 Put the edited template files you create in
13540 \begin_inset Flex CharStyle:Code
13543 \begin_layout Plain Layout
13549 , copy the ones you use from the global template directory in
13550 \begin_inset Flex CharStyle:Code
13553 \begin_layout Plain Layout
13559 to the same place, and redefine the template path in the
13560 \begin_inset Flex CharStyle:MenuItem
13563 \begin_layout Plain Layout
13564 Tools\SpecialChar \menuseparator
13565 Preferences\SpecialChar \menuseparator
13574 \begin_layout Standard
13575 Note that there is a template which has a particular meaning:
13576 \begin_inset Flex CharStyle:Code
13579 \begin_layout Plain Layout
13586 This template is loaded every time you create a new document with
13587 \begin_inset Flex CharStyle:MenuItem
13590 \begin_layout Plain Layout
13591 File\SpecialChar \menuseparator
13597 in order to provide useful defaults.
13598 To create this template from inside LyX, all you have to do is to open
13599 a document with the correct settings, and use the
13600 \begin_inset Flex CharStyle:MenuItem
13603 \begin_layout Plain Layout
13604 Save as Document Defaults
13612 \begin_layout Chapter
13613 Including External Material
13616 \begin_layout Standard
13617 \begin_inset Box Shadowbox
13626 height_special "totalheight"
13629 \begin_layout Plain Layout
13630 WARNING: This portion of the documentation has not been updated for some
13632 We certainly hope that it is still accurate, but there are no guarantees.
13640 \begin_layout Standard
13641 The use of material from sources external to LyX is covered in detail in
13647 This part of the manual covers what needs to happen behind the scenes for
13648 new sorts of material to be included.
13651 \begin_layout Section
13655 \begin_layout Standard
13656 The external material feature is based on the concept of a
13661 A template is a specification of how LyX should interface with a certain
13663 As bundled, LyX comes with predefined templates for Xfig figures, various
13664 raster format images, chess diagrams, and LilyPond music notation.
13665 You can check the actual list by using the menu
13666 \begin_inset Flex CharStyle:MenuItem
13669 \begin_layout Plain Layout
13670 Insert\SpecialChar \menuseparator
13671 File\SpecialChar \menuseparator
13678 Furthermore, it is possible to roll your own template to support a specific
13680 Later we'll describe in more detail what is involved, and hopefully you
13681 will submit all the templates you create so we can include them in a later
13685 \begin_layout Standard
13686 Another basic idea of the external material feature is to distinguish between
13687 the original file that serves as a base for final material and the produced
13688 file that is included in your exported or printed document.
13689 For example, consider the case of a figure produced with
13690 \begin_inset Flex CharStyle:Code
13693 \begin_layout Plain Layout
13700 The Xfig application itself works on an original file with the
13701 \begin_inset Flex CharStyle:Code
13704 \begin_layout Plain Layout
13711 Within Xfig, you create and change your figure, and when you are done,
13713 \begin_inset Flex CharStyle:Code
13716 \begin_layout Plain Layout
13723 When you want to include the figure in your document, you invoke
13724 \begin_inset Flex CharStyle:Code
13727 \begin_layout Plain Layout
13733 in order to create a PostScript file that can readily be included in your
13736 \begin_inset Flex CharStyle:Code
13739 \begin_layout Plain Layout
13745 file is the original file, and the PostScript file is the produced file.
13748 \begin_layout Standard
13749 This distinction is important in order to allow updating of the material
13750 while you are in the process of writing the document.
13751 Furthermore, it provides us with the flexibility that is needed to support
13752 multiple export formats.
13753 For instance, in the case of a plain text file, it is not exactly an award-winn
13754 ing idea to include the figure as raw PostScript.
13755 Instead, you'd either prefer to just include a reference to the figure
13756 or try to invoke some graphics to ASCII converter to make the final result
13757 look similar to the real graphics.
13758 The external material management allows you to do this, because it is parametri
13759 zed on the different export formats that LyX supports.
13762 \begin_layout Standard
13763 Besides supporting the production of different products according to the
13764 exported format, it supports tight integration with editing and viewing
13766 In the case of an Xfig figure, you are able to invoke Xfig on the original
13767 file with a single click from within the external material dialog in LyX,
13768 and also preview the produced PostScript file with Ghostview with another
13770 No more fiddling around with the command line and/or file browsers to locate
13771 and manipulate the original or produced files.
13772 In this way, you are finally able to take full advantage of the many different
13773 applications that are relevant to use when you write your documents, and
13774 ultimately be more productive.
13777 \begin_layout Section
13778 The external template configuration file
13781 \begin_layout Standard
13782 It is relatively easy to add custom external template definitions to LyX.
13783 However, be aware that doing this in an careless manner most probably
13787 introduce an easily exploitable security hole.
13788 So before you do this, please read the discussion about security in section
13790 \begin_inset CommandInset ref
13792 reference "sec:Security-discussion"
13799 \begin_layout Standard
13800 Having said that, we encourage you to submit any interesting templates that
13805 \begin_layout Standard
13806 The external templates are defined in the
13807 \begin_inset Flex CharStyle:Code
13810 \begin_layout Plain Layout
13811 LyXDir/lib/external_templates
13817 You can place your own version in
13818 \begin_inset Flex CharStyle:Code
13821 \begin_layout Plain Layout
13822 UserDir/external_templates
13830 \begin_layout Standard
13831 A typical template looks like this:
13834 \begin_layout LyX-Code
13838 \begin_layout LyX-Code
13839 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
13842 \begin_layout LyX-Code
13846 \begin_layout LyX-Code
13850 \begin_layout LyX-Code
13854 \begin_layout LyX-Code
13858 \begin_layout LyX-Code
13862 \begin_layout LyX-Code
13863 AutomaticProduction true
13866 \begin_layout LyX-Code
13870 \begin_layout LyX-Code
13874 \begin_layout LyX-Code
13878 \begin_layout LyX-Code
13879 TransformCommand Rotate RotationLatexCommand
13882 \begin_layout LyX-Code
13883 TransformCommand Resize ResizeLatexCommand
13886 \begin_layout LyX-Code
13887 Product "$$RotateFront$$ResizeFront
13890 \begin_layout LyX-Code
13895 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
13898 \begin_layout LyX-Code
13899 $$ResizeBack$$RotateBack"
13902 \begin_layout LyX-Code
13906 \begin_layout LyX-Code
13907 UpdateResult "$$AbsPath$$Basename.pstex_t"
13910 \begin_layout LyX-Code
13911 Requirement "graphicx"
13914 \begin_layout LyX-Code
13915 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
13918 \begin_layout LyX-Code
13919 ReferencedFile latex "$$AbsPath$$Basename.eps"
13922 \begin_layout LyX-Code
13923 ReferencedFile dvi "$$AbsPath$$Basename.eps"
13926 \begin_layout LyX-Code
13930 \begin_layout LyX-Code
13934 \begin_layout LyX-Code
13935 TransformCommand Rotate RotationLatexCommand
13938 \begin_layout LyX-Code
13939 TransformCommand Resize ResizeLatexCommand
13942 \begin_layout LyX-Code
13943 Product "$$RotateFront$$ResizeFront
13946 \begin_layout LyX-Code
13951 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
13954 \begin_layout LyX-Code
13955 $$ResizeBack$$RotateBack"
13958 \begin_layout LyX-Code
13959 UpdateFormat pdftex
13962 \begin_layout LyX-Code
13963 UpdateResult "$$AbsPath$$Basename.pdftex_t"
13966 \begin_layout LyX-Code
13967 Requirement "graphicx"
13970 \begin_layout LyX-Code
13971 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
13974 \begin_layout LyX-Code
13975 ReferencedFile latex "$$AbsPath$$Basename.pdf"
13978 \begin_layout LyX-Code
13982 \begin_layout LyX-Code
13986 \begin_layout LyX-Code
13987 Product "$$Contents(
13989 "$$AbsPath$$Basename.asc
13994 \begin_layout LyX-Code
13995 UpdateFormat asciixfig
13998 \begin_layout LyX-Code
13999 UpdateResult "$$AbsPath$$Basename.asc"
14002 \begin_layout LyX-Code
14006 \begin_layout LyX-Code
14010 \begin_layout LyX-Code
14011 Product "<graphic fileref=
14013 "$$AbsOrRelPathMaster$$Basename.eps
14018 \begin_layout LyX-Code
14022 \begin_layout LyX-Code
14026 \begin_layout LyX-Code
14027 UpdateResult "$$AbsPath$$Basename.eps"
14030 \begin_layout LyX-Code
14031 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14034 \begin_layout LyX-Code
14035 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14038 \begin_layout LyX-Code
14042 \begin_layout LyX-Code
14043 Product "[XFig: $$FName]"
14046 \begin_layout LyX-Code
14050 \begin_layout LyX-Code
14054 \begin_layout Standard
14055 As you can see, the template is enclosed in
14056 \begin_inset Flex CharStyle:Code
14059 \begin_layout Plain Layout
14065 \SpecialChar \ldots{}
14067 \begin_inset Flex CharStyle:Code
14070 \begin_layout Plain Layout
14077 It contains a header specifying some general settings and, for each supported
14078 primary document file format, a section
14079 \begin_inset Flex CharStyle:Code
14082 \begin_layout Plain Layout
14088 \SpecialChar \ldots{}
14090 \begin_inset Flex CharStyle:Code
14093 \begin_layout Plain Layout
14102 \begin_layout Subsection
14103 The template header
14106 \begin_layout Description
14107 \begin_inset Flex CharStyle:Code
14110 \begin_layout Plain Layout
14111 AutomaticProduction
14112 \begin_inset space ~
14120 Whether the file represented by the template must be generated by LyX.
14121 This command must occur exactly once.
14124 \begin_layout Description
14125 \begin_inset Flex CharStyle:Code
14128 \begin_layout Plain Layout
14130 \begin_inset space ~
14138 A glob pattern that is used in the file dialog to filter out the desired
14140 If there is more than one possible file extension (e.
14141 \begin_inset space \thinspace{}
14145 \begin_inset space \space{}
14149 \begin_inset Flex CharStyle:Code
14152 \begin_layout Plain Layout
14159 \begin_inset Flex CharStyle:Code
14162 \begin_layout Plain Layout
14168 ), use something like
14169 \begin_inset Flex CharStyle:Code
14172 \begin_layout Plain Layout
14179 This command must occur exactly once.
14182 \begin_layout Description
14183 \begin_inset Flex CharStyle:Code
14186 \begin_layout Plain Layout
14188 \begin_inset space ~
14196 The text that is displayed on the button.
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 ~
14210 \begin_inset space ~
14218 The help text that is used in the External dialog.
14219 Provide enough information to explain to the user just what the template
14220 can provide him with.
14221 This command must occur exactly once.
14224 \begin_layout Description
14225 \begin_inset Flex CharStyle:Code
14228 \begin_layout Plain Layout
14230 \begin_inset space ~
14238 The file format of the original file.
14239 This must be the name of a format that is known to LyX (see section
14240 \begin_inset CommandInset ref
14242 reference "sub:Formats"
14248 \begin_inset Quotes eld
14252 \begin_inset Flex CharStyle:Code
14255 \begin_layout Plain Layout
14262 \begin_inset Quotes erd
14265 if the template can handle original files of more than one format.
14266 LyX will attempt to interrogate the file itself in order to deduce its
14267 format in this case.
14268 This command must occur exactly once.
14271 \begin_layout Description
14272 \begin_inset Flex CharStyle:Code
14275 \begin_layout Plain Layout
14277 \begin_inset space ~
14285 A unique name for the template.
14286 It must not contain substitution macros (see below).
14289 \begin_layout Description
14290 \begin_inset Flex CharStyle:Code
14293 \begin_layout Plain Layout
14295 \begin_inset space ~
14298 Rotate|Resize|Clip|Extra
14303 This command specifies which transformations are supported by this template.
14304 It may occur zero or more times.
14305 This command enables the corresponding tabs in the external dialog.
14307 \begin_inset Flex CharStyle:Code
14310 \begin_layout Plain Layout
14316 command must have either a corresponding
14317 \begin_inset Flex CharStyle:Code
14320 \begin_layout Plain Layout
14327 \begin_inset Flex CharStyle:Code
14330 \begin_layout Plain Layout
14337 \begin_inset Flex CharStyle:Code
14340 \begin_layout Plain Layout
14347 Otherwise the transformation will not be supported by that format.
14350 \begin_layout Subsection
14354 \begin_layout Description
14355 \begin_inset Flex CharStyle:Code
14358 \begin_layout Plain Layout
14360 \begin_inset space ~
14363 LaTeX|PDFLaTeX|PlainText|DocBook
14368 The primary document file format that this format definition is for.
14369 Not every template has a sensible representation in all document file formats.
14370 Please define nevertheless a
14371 \begin_inset Flex CharStyle:Code
14374 \begin_layout Plain Layout
14380 section for all formats.
14381 Use a dummy text when no representation is available.
14382 Then you can at least see a reference to the external material in the exported
14386 \begin_layout Description
14387 \begin_inset Flex CharStyle:Code
14390 \begin_layout Plain Layout
14392 \begin_inset space ~
14396 \begin_inset space ~
14404 This command defines an additional macro
14405 \begin_inset Flex CharStyle:Code
14408 \begin_layout Plain Layout
14414 for substitution in
14415 \begin_inset Flex CharStyle:Code
14418 \begin_layout Plain Layout
14426 \begin_inset Flex CharStyle:Code
14429 \begin_layout Plain Layout
14435 itself may contain substitution macros.
14436 The advantage over using
14437 \begin_inset Flex CharStyle:Code
14440 \begin_layout Plain Layout
14447 \begin_inset Flex CharStyle:Code
14450 \begin_layout Plain Layout
14456 is that the substituted value of
14457 \begin_inset Flex CharStyle:Code
14460 \begin_layout Plain Layout
14466 is sanitized so that it is a valid optional argument in the document format.
14467 This command may occur zero or more times.
14470 \begin_layout Description
14471 \begin_inset Flex CharStyle:Code
14474 \begin_layout Plain Layout
14476 \begin_inset space ~
14484 The text that is inserted in the exported document.
14485 This is actually the most important command and can be quite complex.
14486 This command must occur exactly once.
14489 \begin_layout Description
14490 \begin_inset Flex CharStyle:Code
14493 \begin_layout Plain Layout
14495 \begin_inset space ~
14503 This command specifies a preamble snippet that will be included in the
14505 It has to be defined using
14506 \begin_inset Flex CharStyle:Code
14509 \begin_layout Plain Layout
14515 \SpecialChar \ldots{}
14517 \begin_inset Flex CharStyle:Code
14520 \begin_layout Plain Layout
14527 This command may occur zero or more times.
14530 \begin_layout Description
14531 \begin_inset Flex CharStyle:Code
14534 \begin_layout Plain Layout
14536 \begin_inset space ~
14540 \begin_inset space ~
14548 This command denotes files that are created by the conversion process and
14549 are needed for a particular export format.
14550 If the filename is relative, it is interpreted relative to the master document.
14551 This command may be given zero or more times.
14554 \begin_layout Description
14555 \begin_inset Flex CharStyle:Code
14558 \begin_layout Plain Layout
14560 \begin_inset space ~
14568 The name of a required LaTeX package.
14569 The package is included via
14570 \begin_inset Flex CharStyle:Code
14573 \begin_layout Plain Layout
14581 in the LaTeX preamble.
14582 This command may occur zero or more times.
14585 \begin_layout Description
14586 \begin_inset Flex CharStyle:Code
14589 \begin_layout Plain Layout
14591 \begin_inset space ~
14595 \begin_inset space ~
14598 RotationLatexCommand
14603 This command specifies that the built in LaTeX command should be used for
14605 This command may occur once or not at all.
14608 \begin_layout Description
14609 \begin_inset Flex CharStyle:Code
14612 \begin_layout Plain Layout
14614 \begin_inset space ~
14618 \begin_inset space ~
14626 This command specifies that the built in LaTeX command should be used for
14628 This command may occur once or not at all.
14631 \begin_layout Description
14632 \begin_inset Flex CharStyle:Code
14635 \begin_layout Plain Layout
14637 \begin_inset space ~
14641 \begin_inset space ~
14644 RotationLatexOption
14649 This command specifies that rotation is done via an optional argument.
14650 This command may occur once or not at all.
14653 \begin_layout Description
14654 \begin_inset Flex CharStyle:Code
14657 \begin_layout Plain Layout
14659 \begin_inset space ~
14663 \begin_inset space ~
14671 This command specifies that resizing is done via an optional argument.
14672 This command may occur once or not at all.
14675 \begin_layout Description
14676 \begin_inset Flex CharStyle:Code
14679 \begin_layout Plain Layout
14681 \begin_inset space ~
14685 \begin_inset space ~
14693 This command specifies that clipping is done via an optional argument.
14694 This command may occur once or not at all.
14697 \begin_layout Description
14698 \begin_inset Flex CharStyle:Code
14701 \begin_layout Plain Layout
14703 \begin_inset space ~
14707 \begin_inset space ~
14715 This command specifies that an extra optional argument is used.
14716 This command may occur once or not at all.
14719 \begin_layout Description
14720 \begin_inset Flex CharStyle:Code
14723 \begin_layout Plain Layout
14725 \begin_inset space ~
14733 The file format of the converted file.
14734 This must be the name of a format that is known to LyX (see the
14735 \begin_inset Flex CharStyle:MenuItem
14738 \begin_layout Plain Layout
14743 ools\SpecialChar \menuseparator
14748 references:Conversion
14754 This command must occur exactly once.
14757 \begin_layout Description
14758 \begin_inset Flex CharStyle:Code
14761 \begin_layout Plain Layout
14763 \begin_inset space ~
14771 The file name of the converted file.
14772 The file name must be absolute.
14773 This command must occur exactly once.
14776 \begin_layout Subsection
14777 Preamble definitions
14780 \begin_layout Standard
14781 The external template configuration file may contain additional preamble
14782 definitions enclosed by
14783 \begin_inset Flex CharStyle:Code
14786 \begin_layout Plain Layout
14792 \SpecialChar \ldots{}
14794 \begin_inset Flex CharStyle:Code
14797 \begin_layout Plain Layout
14804 They can be used by the templates in the
14805 \begin_inset Flex CharStyle:Code
14808 \begin_layout Plain Layout
14817 \begin_layout Section
14818 The substitution mechanism
14821 \begin_layout Standard
14822 When the external material facility invokes an external program, it is done
14823 on the basis of a command defined in the template configuration file.
14824 These commands can contain various macros that are expanded before execution.
14825 Execution always take place in the directory of the containing document.
14828 \begin_layout Standard
14829 Also, whenever external material is to be displayed, the name will be produced
14830 by the substitution mechanism, and most other commands in the template
14831 definition support substitution as well.
14834 \begin_layout Standard
14835 The available macros are the following:
14838 \begin_layout Description
14839 \begin_inset Flex CharStyle:Code
14842 \begin_layout Plain Layout
14843 $$AbsOrRelPathMaster
14848 The file path, absolute or relative to the master LyX document.
14851 \begin_layout Description
14852 \begin_inset Flex CharStyle:Code
14855 \begin_layout Plain Layout
14856 $$AbsOrRelPathParent
14861 The file path, absolute or relative to the LyX document.
14864 \begin_layout Description
14865 \begin_inset Flex CharStyle:Code
14868 \begin_layout Plain Layout
14874 The absolute file path.
14877 \begin_layout Description
14878 \begin_inset Flex CharStyle:Code
14881 \begin_layout Plain Layout
14887 The filename without path and without the extension.
14890 \begin_layout Description
14891 \begin_inset Flex CharStyle:Code
14894 \begin_layout Plain Layout
14896 \begin_inset Quotes eld
14900 \begin_inset Quotes erd
14908 This macro will expand to the contents of the file with the name
14909 \begin_inset Flex CharStyle:Code
14912 \begin_layout Plain Layout
14921 \begin_layout Description
14922 \begin_inset Flex CharStyle:Code
14925 \begin_layout Plain Layout
14931 The file extension (including the dot).
14934 \begin_layout Description
14935 \begin_inset Flex CharStyle:Code
14938 \begin_layout Plain Layout
14944 The filename of the file specified in the external material dialog.
14945 This is either an absolute name, or it is relative to the LyX document.
14948 \begin_layout Description
14949 \begin_inset Flex CharStyle:Code
14952 \begin_layout Plain Layout
14959 \begin_inset Flex CharStyle:Code
14962 \begin_layout Plain Layout
14968 (absolute name or relative to the LyX document).
14971 \begin_layout Description
14972 \begin_inset Flex CharStyle:Code
14975 \begin_layout Plain Layout
14981 The file path, relative to the master LyX document.
14984 \begin_layout Description
14985 \begin_inset Flex CharStyle:Code
14988 \begin_layout Plain Layout
14994 The file path, relative to the LyX document.
14997 \begin_layout Description
14998 \begin_inset Flex CharStyle:Code
15001 \begin_layout Plain Layout
15007 This macro will expand to the absolute path of the system directory.
15008 This is typically used to point to the various helper scripts that are
15012 \begin_layout Description
15013 \begin_inset Flex CharStyle:Code
15016 \begin_layout Plain Layout
15022 A name and full path to a temporary file which will be automatically deleted
15023 whenever the containing document is closed, or the external material insertion
15027 \begin_layout Standard
15028 All path macros contain a trailing directory separator, so you can construct
15030 \begin_inset space \thinspace{}
15034 \begin_inset space \space{}
15037 the absolute filename with
15038 \begin_inset Flex CharStyle:Code
15041 \begin_layout Plain Layout
15042 $$AbsPath$$Basename$$Extension
15050 \begin_layout Standard
15051 The macros above are substituted in all commands unless otherwise noted.
15053 \begin_inset Flex CharStyle:Code
15056 \begin_layout Plain Layout
15062 supports additionally the following substitutions if they are enabled by
15064 \begin_inset Flex CharStyle:Code
15067 \begin_layout Plain Layout
15074 \begin_inset Flex CharStyle:Code
15077 \begin_layout Plain Layout
15086 \begin_layout Description
15087 \begin_inset Flex CharStyle:Code
15090 \begin_layout Plain Layout
15096 The front part of the resize command.
15099 \begin_layout Description
15100 \begin_inset Flex CharStyle:Code
15103 \begin_layout Plain Layout
15109 The back part of the resize command.
15112 \begin_layout Description
15113 \begin_inset Flex CharStyle:Code
15116 \begin_layout Plain Layout
15122 The front part of the rotation command.
15125 \begin_layout Description
15126 \begin_inset Flex CharStyle:Code
15129 \begin_layout Plain Layout
15135 The back part of the rotation command.
15138 \begin_layout Standard
15139 The value string of the
15140 \begin_inset Flex CharStyle:Code
15143 \begin_layout Plain Layout
15149 command supports additionally the following substitutions if they are enabled
15151 \begin_inset Flex CharStyle:Code
15154 \begin_layout Plain Layout
15161 \begin_inset Flex CharStyle:Code
15164 \begin_layout Plain Layout
15173 \begin_layout Description
15174 \begin_inset Flex CharStyle:Code
15177 \begin_layout Plain Layout
15186 \begin_layout Description
15187 \begin_inset Flex CharStyle:Code
15190 \begin_layout Plain Layout
15199 \begin_layout Description
15200 \begin_inset Flex CharStyle:Code
15203 \begin_layout Plain Layout
15212 \begin_layout Description
15213 \begin_inset Flex CharStyle:Code
15216 \begin_layout Plain Layout
15222 The rotation option.
15225 \begin_layout Standard
15226 You may ask why there are so many path macros.
15227 There are mainly two reasons:
15230 \begin_layout Enumerate
15231 Relative and absolute file names should remain relative or absolute, respectivel
15233 Users may have reasons to prefer either form.
15234 Relative names are useful for portable documents that should work on different
15235 machines, for example.
15236 Absolute names may be required by some programs.
15239 \begin_layout Enumerate
15240 LaTeX treats relative file names differently than LyX and other programs
15241 in nested included files.
15242 For LyX, a relative file name is always relative to the document that contains
15244 For LaTeX, it is always relative to the master document.
15245 These two definitions are identical if you have only one document, but
15246 differ if you have a master document that includes part documents.
15247 That means that relative filenames must be transformed when presented to
15249 Fortunately LyX does this automatically for you if you choose the right
15253 \begin_layout Standard
15254 So which path macro should be used in new template definitions? The rule
15258 \begin_layout Itemize
15260 \begin_inset Flex CharStyle:Code
15263 \begin_layout Plain Layout
15269 if an absolute path is required.
15272 \begin_layout Itemize
15274 \begin_inset Flex CharStyle:Code
15277 \begin_layout Plain Layout
15278 $$AbsOrRelPathMaster
15283 if the substituted string is some kind of LaTeX input.
15286 \begin_layout Itemize
15288 \begin_inset Flex CharStyle:Code
15291 \begin_layout Plain Layout
15292 $$AbsOrRelPathParent
15297 in order to preserve the user's choice.
15300 \begin_layout Standard
15301 There are special cases where this rule does not work and e.
15302 \begin_inset space \thinspace{}
15306 \begin_inset space \space{}
15309 relative names are needed, but normally it will work just fine.
15310 One example for such a case is the command
15311 \begin_inset Flex CharStyle:Code
15314 \begin_layout Plain Layout
15315 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15320 in the XFig template above: We can't use the absolute name because the
15322 \begin_inset Flex CharStyle:Code
15325 \begin_layout Plain Layout
15331 files needs the relative name in order to rewrite the file content.
15334 \begin_layout Section
15335 \begin_inset CommandInset label
15337 name "sec:Security-discussion"
15341 Security discussion
15344 \begin_layout Standard
15345 \begin_inset Box Shadowbox
15354 height_special "totalheight"
15357 \begin_layout Plain Layout
15358 WARNING: This section is definitely outdated.
15366 \begin_layout Standard
15367 The external material feature interfaces with a lot of external programs
15368 and does so automatically, so we have to consider the security implications
15370 In particular, since you have the option of including your own filenames
15371 and/or parameter strings and those are expanded into a command, it seems
15372 that it would be possible to create a malicious document which executes
15373 arbitrary commands when a user views or prints the document.
15374 This is something we definitely want to avoid.
15377 \begin_layout Standard
15378 However, since the external program commands are specified in the template
15379 configuration file only, there are no security issues if LyX is properly
15380 configured with safe templates only.
15381 This is so because the external programs are invoked with the
15382 \begin_inset Flex CharStyle:Code
15385 \begin_layout Plain Layout
15391 -system call rather than the
15392 \begin_inset Flex CharStyle:Code
15395 \begin_layout Plain Layout
15401 system-call, so it's not possible to execute arbitrary commands from the
15402 filename or parameter section via the shell.
15405 \begin_layout Standard
15406 This also implies that you are restricted in what command strings you can
15407 use in the external material templates.
15408 In particular, pipes and redirection are not readily available.
15409 This has to be so if LyX should remain safe.
15410 If you want to use some of the shell features, you should write a safe
15411 script to do this in a controlled manner, and then invoke the script from
15412 the command string.
15414 \begin_inset Flex CharStyle:Code
15417 \begin_layout Plain Layout
15423 directory of the LyX installation, you can find a safe wrapper script
15424 \begin_inset Flex CharStyle:Code
15427 \begin_layout Plain Layout
15428 general_command_wrapper.py
15433 that supports redirection of input and output.
15434 That can serve as an example for how to write safe template scripts.
15435 For a more advanced example that uses
15436 \begin_inset Flex CharStyle:Code
15439 \begin_layout Plain Layout
15445 and friends, take a look at the
15446 \begin_inset Flex CharStyle:Code
15449 \begin_layout Plain Layout
15458 \begin_layout Standard
15459 It is possible to design a template that interacts directly with the shell,
15460 but since this would allow a malicious user to execute arbitrary commands
15461 by writing clever filenames and/or parameters, we generally recommend that
15462 you only use safe scripts that work with the
15463 \begin_inset Flex CharStyle:Code
15466 \begin_layout Plain Layout
15472 system call in a controlled manner.
15473 Of course, for use in a controlled environment, it can be tempting to just
15474 fall back to use ordinary shell scripts.
15475 If you do so, be aware that you
15479 provide an easily exploitable security hole in your system.
15480 Of course it stands to reason that such unsafe templates will never be
15481 included in the standard LyX distribution, although we do encourage people
15482 to submit new templates in the open source tradition.
15483 But LyX as shipped from the official distribution channels will never have
15487 \begin_layout Standard
15488 Including external material provides a lot of power, and you have to be
15489 careful not to introduce security hazards with this power.
15490 A subtle error in a single line in an innocent looking script can open
15491 the door to huge security problems.
15492 So if you do not fully understand the issues, we recommend that you consult
15493 a knowledgeable security professional or the LyX development team if you
15494 have any questions about whether a given template is safe or not.
15495 And do this before you use it in an uncontrolled environment.