1 #LyX 1.6.1svn 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
221 elp\SpecialChar \menuseparator
234 The library directory is the place where LyX places its system-wide configurati
235 on files; the user directory is where you can place your modified versions.
236 We will call the former
237 \begin_inset Flex CharStyle:Code
240 \begin_layout Plain Layout
247 \begin_inset Flex CharStyle:MenuItem
250 \begin_layout Plain Layout
256 in the remainder of this document.
260 \begin_layout Section
262 \begin_inset Flex CharStyle:Code
265 \begin_layout Plain Layout
274 \begin_layout Standard
275 \begin_inset Flex CharStyle:Code
278 \begin_layout Plain Layout
284 and its sub-directories contain a number of files and that can be used
285 to customise LyX's behaviour.
286 You can change many of these files from within LyX itself through the
287 \begin_inset Flex CharStyle:MenuItem
290 \begin_layout Plain Layout
291 Tools\SpecialChar \menuseparator
298 Most customization that you will want to do in LyX is possible through
300 However, many other inner aspects of LyX can be customized by modifying
302 \begin_inset Flex CharStyle:Code
305 \begin_layout Plain Layout
312 These files fall in different categories, described in the following subsection
316 \begin_layout Subsection
317 Automatically generated files
320 \begin_layout Standard
321 The files, which are to be found in
322 \begin_inset Flex CharStyle:MenuItem
325 \begin_layout Plain Layout
331 , are generated when you configure LyX.
332 They contain various default values that are guessed by inspection.
333 In general, it is not a good idea to modify them, since they might be overwritt
337 \begin_layout Labeling
338 \labelwidthstring 00.00.0000
339 \begin_inset Flex CharStyle:Code
342 \begin_layout Plain Layout
348 contains defaults for various commands.
351 \begin_layout Labeling
352 \labelwidthstring 00.00.0000
353 \begin_inset Flex CharStyle:Code
356 \begin_layout Plain Layout
362 contains the list of packages that have been recognized by LyX.
363 It is currently unused by the LyX program itself, but the information extracted
364 , and more, is made available with
365 \begin_inset Flex CharStyle:MenuItem
368 \begin_layout Plain Layout
373 elp\SpecialChar \menuseparator
390 \begin_layout Labeling
391 \labelwidthstring 00.00.0000
392 \begin_inset Flex CharStyle:Code
395 \begin_layout Plain Layout
401 the list of text classes that have been found in your
402 \begin_inset Flex CharStyle:Code
405 \begin_layout Plain Layout
411 directories, along with the associated LaTeX document class and their descripti
415 \begin_layout Labeling
416 \labelwidthstring 00.00.0000
417 \begin_inset Flex CharStyle:Code
420 \begin_layout Plain Layout
426 the list of layout modules found in your
427 \begin_inset Flex CharStyle:Code
430 \begin_layout Plain Layout
439 \begin_layout Labeling
440 \labelwidthstring 00.00.0000
441 \begin_inset Flex CharStyle:Code
444 \begin_layout Plain Layout
450 lists of various sorts of LaTeX-related files found on your system
453 \begin_layout Labeling
454 \labelwidthstring 00.00.0000
455 \begin_inset Flex CharStyle:Code
458 \begin_layout Plain Layout
464 is automatically generated during configuration from the file
465 \begin_inset Flex CharStyle:Code
468 \begin_layout Plain Layout
475 It contains information on your LaTeX configuration.
478 \begin_layout Subsection
482 \begin_layout Standard
483 These directories are duplicated between
484 \begin_inset Flex CharStyle:Code
487 \begin_layout Plain Layout
494 \begin_inset Flex CharStyle:Code
497 \begin_layout Plain Layout
504 If a particular files exists in both places, the one in
505 \begin_inset Flex CharStyle:Code
508 \begin_layout Plain Layout
517 \begin_layout Labeling
518 \labelwidthstring 00.00.0000
519 \begin_inset Flex CharStyle:Code
522 \begin_layout Plain Layout
528 this directory contains files with the extension
529 \begin_inset Flex CharStyle:Code
532 \begin_layout Plain Layout
538 that define the keybindings used in LyX.
539 If there exists an internationalized version of the bind file named
540 \begin_inset Flex CharStyle:Code
543 \begin_layout Plain Layout
549 , that will be used first.
552 \begin_layout Labeling
553 \labelwidthstring 00.00.0000
554 \begin_inset Flex CharStyle:Code
557 \begin_layout Plain Layout
563 contains graphics files that can be included in documents.
567 \begin_layout Labeling
568 \labelwidthstring 00.00.0000
569 \begin_inset Flex CharStyle:Code
572 \begin_layout Plain Layout
578 contains LyX documentation files (including the one you are currently reading).
580 \begin_inset Flex CharStyle:Code
583 \begin_layout Plain Layout
589 deserves special attention, as noted above.
590 If there exists an internationalized version of the help-document with
592 \begin_inset Flex CharStyle:Code
595 \begin_layout Plain Layout
601 prepended to the name, that will be used first.
607 \begin_inset CommandInset ref
609 reference "chap:i18n"
616 \begin_layout Labeling
617 \labelwidthstring 00.00.0000
618 \begin_inset Flex CharStyle:Code
621 \begin_layout Plain Layout
627 contains example files that explain how to use some features.
628 In the file browser, press the
629 \begin_inset Flex CharStyle:MenuItem
632 \begin_layout Plain Layout
641 \begin_layout Labeling
642 \labelwidthstring 00.00.0000
643 \begin_inset Flex CharStyle:Code
646 \begin_layout Plain Layout
652 contains image files that are used by the
653 \begin_inset Flex CharStyle:MenuItem
656 \begin_layout Plain Layout
663 In addition, it also contains the individual icons used in the toolbar
664 and the banners that can be shown when LyX is launched.
667 \begin_layout Labeling
668 \labelwidthstring 00.00.0000
669 \begin_inset Flex CharStyle:Code
672 \begin_layout Plain Layout
678 contains keyboard keymapping files.
684 \begin_inset CommandInset ref
686 reference "sec:keymap"
693 \begin_layout Labeling
694 \labelwidthstring 00.00.0000
695 \begin_inset Flex CharStyle:Code
698 \begin_layout Plain Layout
704 contains the text class and module files described in Chapter
709 \begin_inset CommandInset ref
711 reference "chap:textclass"
718 \begin_layout Labeling
719 \labelwidthstring 00.00.0000
720 \begin_inset Flex CharStyle:Code
723 \begin_layout Plain Layout
730 \begin_inset Flex CharStyle:Code
733 \begin_layout Plain Layout
739 Python scripts used to convert between LyX versions.
740 These can be run from the command line if, say, you want to batch-convert
744 \begin_layout Labeling
745 \labelwidthstring 00.00.0000
746 \begin_inset Flex CharStyle:Code
749 \begin_layout Plain Layout
755 contains some files that demonstrate the capabilities of the
756 \begin_inset Flex CharStyle:MenuItem
759 \begin_layout Plain Layout
770 Also contains some scripts used by LyX itself.
773 \begin_layout Labeling
774 \labelwidthstring 00.00.0000
775 \begin_inset Flex CharStyle:Code
778 \begin_layout Plain Layout
784 contains the standard LyX template files described in Chapter
789 \begin_inset CommandInset ref
791 reference "sec:templates"
798 \begin_layout Labeling
799 \labelwidthstring 00.00.0000
800 \begin_inset Flex CharStyle:Code
803 \begin_layout Plain Layout
809 contains files with the extension
810 \begin_inset Flex CharStyle:Code
813 \begin_layout Plain Layout
819 that define the user interface to LyX.
820 That is, the files define which items appear in which menus and the items
821 appearing on the toolbar.
824 \begin_layout Subsection
825 Files you don't want to modify
828 \begin_layout Standard
829 These files are used internally by LyX and you generally do not need to
830 modify them unless you are a developer.
833 \begin_layout Labeling
834 \labelwidthstring 00.00.0000
835 \begin_inset Flex CharStyle:Code
838 \begin_layout Plain Layout
844 this file contains the list of LyX developers.
845 The contents are displayed with the menu entry
846 \begin_inset Flex CharStyle:MenuItem
849 \begin_layout Plain Layout
854 elp\SpecialChar \menuseparator
867 \begin_layout Labeling
868 \labelwidthstring 00.00.0000
869 \begin_inset Flex CharStyle:Code
872 \begin_layout Plain Layout
878 this is a LaTeX script used during the configuration process.
882 \begin_layout Labeling
883 \labelwidthstring 00.00.0000
884 \begin_inset Flex CharStyle:Code
887 \begin_layout Plain Layout
893 this is the script that is used to re-configure LyX.
894 It creates configuration files in the directory it was run from.
897 \begin_layout Subsection
898 Other files needing a line or two...
901 \begin_layout Labeling
902 \labelwidthstring 00.00.0000
903 \begin_inset Flex CharStyle:Code
906 \begin_layout Plain Layout
912 this contains tables describing how different character encodings can be
916 \begin_layout Labeling
917 \labelwidthstring 00.00.0000
918 \begin_inset Flex CharStyle:Code
921 \begin_layout Plain Layout
927 this file contains the templates available to the new
928 \begin_inset Flex CharStyle:MenuItem
931 \begin_layout Plain Layout
944 \begin_layout Labeling
945 \labelwidthstring 00.00.0000
946 \begin_inset Flex CharStyle:Code
949 \begin_layout Plain Layout
955 this file contains a list of all the languages currently supported by LyX.
958 \begin_layout Section
959 Your local configuration directory
962 \begin_layout Standard
963 Even if you are using LyX as an unprivileged user, you might want to change
964 LyX configuration for your own use.
966 \begin_inset Flex CharStyle:Code
969 \begin_layout Plain Layout
975 directory contains all your personal configuration files.
976 This is the directory described as
977 \begin_inset Quotes eld
981 \begin_inset Quotes erd
985 \begin_inset Flex CharStyle:MenuItem
988 \begin_layout Plain Layout
993 elp\SpecialChar \menuseparator
1004 This directory is used as a mirror of
1005 \begin_inset Flex CharStyle:Code
1008 \begin_layout Plain Layout
1014 , which means that every file in
1015 \begin_inset Flex CharStyle:Code
1018 \begin_layout Plain Layout
1024 is a replacement for the corresponding file in
1025 \begin_inset Flex CharStyle:Code
1028 \begin_layout Plain Layout
1035 Any configuration file described in the above sections can be placed either
1036 in the system-wide directory, in which case it will affect all users, or
1037 in your local directory for your own use.
1040 \begin_layout Standard
1041 To make things clearer, let's provide a few examples:
1044 \begin_layout Itemize
1045 The preferences set in the
1046 \begin_inset Flex CharStyle:MenuItem
1049 \begin_layout Plain Layout
1054 ools\SpecialChar \menuseparator
1064 dialog are saved to a file
1065 \begin_inset Flex CharStyle:Code
1068 \begin_layout Plain Layout
1075 \begin_inset Flex CharStyle:Code
1078 \begin_layout Plain Layout
1087 \begin_layout Itemize
1088 When you reconfigure using
1089 \begin_inset Flex CharStyle:MenuItem
1092 \begin_layout Plain Layout
1097 ools\SpecialChar \menuseparator
1108 \begin_inset Flex CharStyle:Code
1111 \begin_layout Plain Layout
1117 script, and the resulting files are written in your local configuration
1119 This means that any additional text class file that you might have added
1121 \begin_inset Flex CharStyle:Code
1124 \begin_layout Plain Layout
1130 will be added to the list of classes in the
1131 \begin_inset Flex CharStyle:MenuItem
1134 \begin_layout Plain Layout
1135 Document\SpecialChar \menuseparator
1144 \begin_layout Itemize
1145 If you get some updated documentation from LyX ftp site and cannot install
1146 it because you do not have sysadmin rights on your system, you can just
1148 \begin_inset Flex CharStyle:Code
1151 \begin_layout Plain Layout
1157 and the items in the
1158 \begin_inset Flex CharStyle:MenuItem
1161 \begin_layout Plain Layout
1171 menu will open them!
1174 \begin_layout Section
1175 Running LyX with multiple configurations
1178 \begin_layout Standard
1179 The configuration freedom of the local configuration directory may not suffice
1180 if you want to have more than one configuration at your disposal.
1181 For example, you may want to be use different key bindings or printer settings
1183 You can achieve this by having several such directories.
1184 You then specify which directory to use at run-time.
1187 \begin_layout Standard
1188 Invoking LyX with the command line switch
1189 \begin_inset Flex CharStyle:Code
1192 \begin_layout Plain Layout
1202 instructs the program to read the configuration from that directory, and
1203 not from the default directory.
1204 (You can determine the default directory by running LyX without the
1205 \begin_inset Flex CharStyle:Code
1208 \begin_layout Plain Layout
1214 switch.) If the specified directory does not exist, LyX offers to create
1215 it for you, just like it does for the default directory on the first time
1216 you run the program.
1217 You can modify the configuration options in this additional user directory
1218 exactly as you would for the default directory.
1219 These directories are completely independent (but read on).
1220 Note that setting the environment variable
1221 \begin_inset Flex CharStyle:Code
1224 \begin_layout Plain Layout
1230 to some value has exactly the same effect.
1233 \begin_layout Standard
1234 Having several configurations also requires more maintenance: if you want
1235 to add a new layout to
1236 \begin_inset Flex CharStyle:Code
1239 \begin_layout Plain Layout
1245 which you want available from all your configurations, you must add it
1246 to each directory separately.
1247 You can avoid this with the following trick: after LyX creates the additional
1248 directory, most of the subdirectories (see above) are empty.
1249 If you want the new configuration to mirror an existing one, replace the
1250 empty subdirectory with a symbolic link to the matching subdirectory in
1251 the existing configuration.
1253 \begin_inset Flex CharStyle:Code
1256 \begin_layout Plain Layout
1262 subirectory, however, since it contains a file written by the configuration
1263 script (also accessible through
1264 \begin_inset Flex CharStyle:MenuItem
1267 \begin_layout Plain Layout
1272 ools\SpecialChar \menuseparator
1282 ) which is configuration-specific.
1285 \begin_layout Chapter
1286 The Preferences dialog
1289 \begin_layout Standard
1290 All options of the preferences dialog are described in the Appendix
1292 The Preferences Dialog
1299 For some options you might find here more details.
1302 \begin_layout Section
1303 Using the dialog for the first time
1306 \begin_layout Standard
1308 \begin_inset Flex CharStyle:Code
1311 \begin_layout Plain Layout
1317 file will contain only changes that you have made to the default behavior,
1318 some of which is hard-coded into LyX and some of which is contained in
1320 \begin_inset Flex CharStyle:Code
1323 \begin_layout Plain Layout
1324 LyXDir/lyxrc.defaults
1330 Note that in both files lines beginning with a
1331 \begin_inset Quotes eld
1335 \begin_inset Quotes erd
1338 are just comments and are not interpreted.
1339 However, only system administrators should edit
1340 \begin_inset Flex CharStyle:Code
1343 \begin_layout Plain Layout
1344 LyXDir/lyxrc.defaults
1350 Users should use the
1351 \begin_inset Flex CharStyle:MenuItem
1354 \begin_layout Plain Layout
1355 Tools\SpecialChar \menuseparator
1361 dialog to create and modify their own
1362 \begin_inset Flex CharStyle:Code
1365 \begin_layout Plain Layout
1374 \begin_layout Standard
1376 \begin_inset Flex CharStyle:MenuItem
1379 \begin_layout Plain Layout
1380 Tools\SpecialChar \menuseparator
1386 dialog will be largely self-explanatory.
1387 Most things in the dialog have associated `tool tips': hover your mouse
1388 pointer over something for more information.
1389 Before we highlight a few of the more important commands below, however,
1390 a word of warning: Applying some of your changes (e.
1391 \begin_inset space \thinspace{}
1395 \begin_inset space \space{}
1398 screen fonts) will have an instant effect.
1400 \begin_inset space \thinspace{}
1404 \begin_inset space \space{}
1407 changing the bind file) will not.
1408 If nothing appears to have changed, just
1409 \begin_inset Flex CharStyle:MenuItem
1412 \begin_layout Plain Layout
1418 the changes and restart LyX.
1421 \begin_layout Section
1425 \begin_layout Standard
1426 LyX has a powerful mechanism to convert to and from any file format using
1431 \begin_layout Subsection
1432 \begin_inset CommandInset label
1441 \begin_layout Standard
1442 The first step is to define your file formats if they are not already defined.
1444 \begin_inset Flex CharStyle:MenuItem
1447 \begin_layout Plain Layout
1448 Tools\SpecialChar \menuseparator
1456 \begin_inset Flex CharStyle:MenuItem
1459 \begin_layout Plain Layout
1460 File Handling\SpecialChar \menuseparator
1467 \begin_inset Flex CharStyle:MenuItem
1470 \begin_layout Plain Layout
1471 New\SpecialChar \ldots{}
1477 button to define your new format.
1479 \begin_inset Flex CharStyle:MenuItem
1482 \begin_layout Plain Layout
1488 field contains the named used to identify the format in the GUI.
1490 \begin_inset Flex CharStyle:MenuItem
1493 \begin_layout Plain Layout
1499 is used to identify the format interally.
1500 You will also need to enter a file extension.
1501 These are all required.
1503 \begin_inset Flex CharStyle:MenuItem
1506 \begin_layout Plain Layout
1512 field is used to provide a keyboard shortcut on the menus.
1513 (For example, pressing
1514 \begin_inset Flex CharStyle:MenuItem
1517 \begin_layout Plain Layout
1524 \begin_inset Flex CharStyle:MenuItem
1527 \begin_layout Plain Layout
1528 View\SpecialChar \menuseparator
1537 \begin_layout Standard
1539 \begin_inset Flex CharStyle:MenuItem
1542 \begin_layout Plain Layout
1549 \begin_inset Flex CharStyle:MenuItem
1552 \begin_layout Plain Layout
1559 For example, you might want to use
1560 \begin_inset Flex CharStyle:MenuItem
1563 \begin_layout Plain Layout
1569 to view PostScript files.
1570 You can enter the command needed to start the program in the corresponding
1572 In defining this command, you can use the four variables listed in the
1574 The viewer is launched when you view an image in LyX or use the
1575 \begin_inset Flex CharStyle:MenuItem
1578 \begin_layout Plain Layout
1585 The editor is for example launched when you press the
1586 \begin_inset Flex CharStyle:MenuItem
1589 \begin_layout Plain Layout
1596 \begin_inset Flex CharStyle:MenuItem
1599 \begin_layout Plain Layout
1606 \begin_inset Flex CharStyle:MenuItem
1609 \begin_layout Plain Layout
1618 \begin_layout Standard
1620 \begin_inset Flex CharStyle:MenuItem
1623 \begin_layout Plain Layout
1629 option tells LyX that a format is suitable for document export.
1630 If this is is set and if a suitable conversion route exists (see
1631 \begin_inset CommandInset ref
1633 reference "sub:Converters"
1637 ), the format will appear in the
1638 \begin_inset Flex CharStyle:MenuItem
1641 \begin_layout Plain Layout
1642 File\SpecialChar \menuseparator
1649 The format will also appear in the
1650 \begin_inset Flex CharStyle:MenuItem
1653 \begin_layout Plain Layout
1659 menu if a viewer is specified for the format.
1660 Pure image formats, such as
1661 \begin_inset Flex CharStyle:Code
1664 \begin_layout Plain Layout
1670 , should not use this option.
1671 Formats that can both represent vector graphics and documents like
1672 \begin_inset Flex CharStyle:Code
1675 \begin_layout Plain Layout
1684 \begin_layout Standard
1686 \begin_inset Flex CharStyle:MenuItem
1689 \begin_layout Plain Layout
1690 Vector graphics format
1695 tells LyX that a format can contain vector graphics.
1696 This information is used to determine the target format of included graphics
1698 \begin_inset Flex CharStyle:MenuItem
1701 \begin_layout Plain Layout
1708 Included graphics may need to be converted to either
1709 \begin_inset Flex CharStyle:MenuItem
1712 \begin_layout Plain Layout
1719 \begin_inset Flex CharStyle:MenuItem
1722 \begin_layout Plain Layout
1729 \begin_inset Flex CharStyle:MenuItem
1732 \begin_layout Plain Layout
1739 \begin_inset Flex CharStyle:MenuItem
1742 \begin_layout Plain Layout
1748 cannot handle other image formats.
1749 If an included graphic is not already in
1750 \begin_inset Flex CharStyle:MenuItem
1753 \begin_layout Plain Layout
1760 \begin_inset Flex CharStyle:MenuItem
1763 \begin_layout Plain Layout
1770 \begin_inset Flex CharStyle:MenuItem
1773 \begin_layout Plain Layout
1779 format, it is converted to
1780 \begin_inset Flex CharStyle:MenuItem
1783 \begin_layout Plain Layout
1789 if the vector format option is set, and otherwise to
1790 \begin_inset Flex CharStyle:MenuItem
1793 \begin_layout Plain Layout
1802 \begin_layout Subsection
1806 \begin_layout Standard
1807 Since all conversions from one format to another take place in LyX's temporary
1808 directory, it is sometimes necessary to modify a file before copying it
1809 to the temporary directory in order that the conversion may be performed.
1813 \begin_layout Plain Layout
1814 For example, the file may refer to other files---images, for example---using
1815 relative file names, and these may become invalid when the file is copied
1816 to the temporary directory.
1821 This is done by a Copier: It copies a file to (or from) the temporary directory
1822 and may modify it in the process.
1825 \begin_layout Standard
1826 The definitions of the copiers may use four variables:
1829 \begin_layout Labeling
1830 \labelwidthstring 00.00.0000
1831 \begin_inset Flex CharStyle:Code
1834 \begin_layout Plain Layout
1840 The LyX system directory (e.
1841 \begin_inset space \thinspace{}
1845 \begin_inset space \space{}
1849 \begin_inset Flex CharStyle:MenuItem
1852 \begin_layout Plain Layout
1861 \begin_layout Labeling
1862 \labelwidthstring 00.00.0000
1863 \begin_inset Flex CharStyle:Code
1866 \begin_layout Plain Layout
1875 \begin_layout Labeling
1876 \labelwidthstring 00.00.0000
1877 \begin_inset Flex CharStyle:Code
1880 \begin_layout Plain Layout
1889 \begin_layout Labeling
1890 \labelwidthstring 00.00.0000
1891 \begin_inset Flex CharStyle:Code
1894 \begin_layout Plain Layout
1903 \begin_layout Standard
1904 The latter should be the filename as it would be used in a LaTeX's
1911 It is relevant only when exporting files suitable for such inclusion.
1914 \begin_layout Standard
1915 Copiers can be used to do almost anything with output files.
1916 For example, suppose you want generated pdf files to be copied to a special
1918 \begin_inset Flex CharStyle:Code
1921 \begin_layout Plain Layout
1928 Then you could write a shell script such as this one:
1931 \begin_layout Standard
1932 \begin_inset listings
1936 \begin_layout Plain Layout
1941 \begin_layout Plain Layout
1946 \begin_layout Plain Layout
1948 TOFILE=`basename $2`
1951 \begin_layout Plain Layout
1953 cp $FROMFILE /home/you/pdf/$TOFILE
1958 Save that in your local LyX directory---say,
1959 \begin_inset Flex CharStyle:Code
1962 \begin_layout Plain Layout
1963 /home/you/.lyx/scripts/pdfcopier.sh
1968 ---and make it executable, if you need to do so on your platform.
1970 \begin_inset Flex CharStyle:MenuItem
1973 \begin_layout Plain Layout
1974 Tools\SpecialChar \menuseparator
1980 dialog, select under
1981 \begin_inset Flex CharStyle:MenuItem
1984 \begin_layout Plain Layout
1985 File Handling\SpecialChar \menuseparator
1992 \begin_inset Flex CharStyle:MenuItem
1995 \begin_layout Plain Layout
2001 format---or one of the other pdf formats---and enter
2002 \begin_inset Flex CharStyle:Code
2005 \begin_layout Plain Layout
2006 pdfcopier.sh $$i $$o
2012 \begin_inset Flex CharStyle:MenuItem
2015 \begin_layout Plain Layout
2025 \begin_layout Standard
2026 Copiers are used by LyX in various of its own conversions.
2027 For example, if appropriate programs are found, LyX will automatically
2028 install copiers for the
2029 \begin_inset Flex CharStyle:MenuItem
2032 \begin_layout Plain Layout
2039 \begin_inset Flex CharStyle:MenuItem
2042 \begin_layout Plain Layout
2044 \begin_inset space ~
2053 When these formats are exported, the copier sees that not just the main
2054 HTML file but various associated files (style files, images, etc.) are also
2056 All these files are written to a subdirectory of the directory in which
2057 the original LyX file was found.
2061 \begin_layout Plain Layout
2062 This copier can be customized.
2064 \begin_inset Quotes eld
2068 \begin_inset Quotes erd
2071 argument takes a comma-separated list of extensions to be copied; if it
2072 is omitted, all files will be copied.
2074 \begin_inset Quotes eld
2078 \begin_inset Quotes erd
2081 argument determines the extension added to the generated directory.
2083 \begin_inset Quotes eld
2087 \begin_inset Flex CharStyle:MenuItem
2090 \begin_layout Plain Layout
2097 \begin_inset Quotes erd
2100 , so HTML generated from
2101 \begin_inset Flex CharStyle:MenuItem
2104 \begin_layout Plain Layout
2105 /path/to/filename.lyx
2111 \begin_inset Flex CharStyle:MenuItem
2114 \begin_layout Plain Layout
2115 /path/to/filename.html.LyXconv
2129 \begin_layout Subsection
2130 \begin_inset CommandInset label
2132 name "sub:Converters"
2139 \begin_layout Standard
2140 You can define your own Converters to, uhh, convert files between different
2143 \begin_inset Flex CharStyle:MenuItem
2146 \begin_layout Plain Layout
2147 Tools\SpecialChar \menuseparator
2148 Preferences\SpecialChar \menuseparator
2149 File Handling\SpecialChar \menuseparator
2158 \begin_layout Standard
2159 To define a new converter, select the
2160 \begin_inset Flex CharStyle:MenuItem
2163 \begin_layout Plain Layout
2165 \begin_inset space ~
2174 \begin_inset Flex CharStyle:MenuItem
2177 \begin_layout Plain Layout
2179 \begin_inset space ~
2187 from the drop-down lists, enter the command needed for the conversion,
2189 \begin_inset Flex CharStyle:MenuItem
2192 \begin_layout Plain Layout
2199 Several variables can be used in the definition of converters:
2202 \begin_layout Labeling
2203 \labelwidthstring 00.00.0000
2204 \begin_inset Flex CharStyle:Code
2207 \begin_layout Plain Layout
2213 The LyX system directory
2216 \begin_layout Labeling
2217 \labelwidthstring 00.00.0000
2218 \begin_inset Flex CharStyle:Code
2221 \begin_layout Plain Layout
2230 \begin_layout Labeling
2231 \labelwidthstring 00.00.0000
2232 \begin_inset Flex CharStyle:Code
2235 \begin_layout Plain Layout
2244 \begin_layout Labeling
2245 \labelwidthstring 00.00.0000
2246 \begin_inset Flex CharStyle:Code
2249 \begin_layout Plain Layout
2255 The base filename of the input file (i.
2256 \begin_inset space \thinspace{}
2259 g., without the extension)
2262 \begin_layout Labeling
2263 \labelwidthstring 00.00.0000
2264 \begin_inset Flex CharStyle:Code
2267 \begin_layout Plain Layout
2273 The path to the input file
2276 \begin_layout Standard
2278 \begin_inset Flex CharStyle:MenuItem
2281 \begin_layout Plain Layout
2283 \begin_inset space ~
2291 field you can enter the following flags, separated by commas:
2294 \begin_layout Labeling
2295 \labelwidthstring 00.00.0000
2296 \begin_inset Flex CharStyle:Code
2299 \begin_layout Plain Layout
2305 This converter runs some form of LaTeX.
2306 This will make LyX's LaTeX error logs available.
2309 \begin_layout Labeling
2310 \labelwidthstring 00.00.0000
2311 \begin_inset Flex CharStyle:Code
2314 \begin_layout Plain Layout
2321 \begin_inset Flex CharStyle:MenuItem
2324 \begin_layout Plain Layout
2330 file for the conversion.
2333 \begin_layout Labeling
2334 \labelwidthstring 00.00.0000
2335 \begin_inset Flex CharStyle:Code
2338 \begin_layout Plain Layout
2347 \begin_layout Standard
2348 The following three flags are not really flags at all because they take
2350 \begin_inset Flex CharStyle:MenuItem
2353 \begin_layout Plain Layout
2355 \begin_inset space ~
2359 \begin_inset space ~
2370 \begin_layout Labeling
2371 \labelwidthstring 00.00.0000
2372 \begin_inset Flex CharStyle:Code
2375 \begin_layout Plain Layout
2381 If set, the converter's standard error will be redirected to a file
2382 \begin_inset Flex CharStyle:Code
2385 \begin_layout Plain Layout
2391 , and the script given as argument will be run as:
2392 \begin_inset Flex CharStyle:Code
2395 \begin_layout Plain Layout
2396 script <infile.out >infile.log
2402 The argument may contain
2403 \begin_inset Flex CharStyle:Code
2406 \begin_layout Plain Layout
2415 \begin_layout Labeling
2416 \labelwidthstring 00.00.0000
2417 \begin_inset Flex CharStyle:Code
2420 \begin_layout Plain Layout
2426 The name of the directory in which the converter will dump the generated
2428 LyX will not create this directory, and it does not copy anything into
2429 it, though it will copy this directory to the destination.
2430 The argument may contain
2431 \begin_inset Flex CharStyle:Code
2434 \begin_layout Plain Layout
2440 , which will be replaced by the base name of the input and output files,
2441 respectively, when the directory is copied.
2442 \begin_inset Newline newline
2445 Note that resultdir and usetempdir make no sense together.
2446 The latter will be ignored if the former is given.
2449 \begin_layout Labeling
2450 \labelwidthstring 00.00.0000
2451 \begin_inset Flex CharStyle:Code
2454 \begin_layout Plain Layout
2460 Determines the output file name and may, contain
2461 \begin_inset Flex CharStyle:Code
2464 \begin_layout Plain Layout
2471 Sensible only with resultdir and optional even then; if not given, it defaults
2475 \begin_layout Standard
2476 None of these last three are presently used in any of the converters that
2477 are installed with LyX.
2481 \begin_layout Standard
2482 You do not have to define converters between all the formats between which
2483 you want to convert.
2484 For example, you will note that there is no `LyX to PostScript®' converter,
2485 but LyX will export PostScript®.
2486 It does so by first creating a LaTeX file (no converter needs to be defined
2487 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2488 and finally converting the resulting DVI file to PostScript®.
2489 LyX finds such `chains' of converters automatically, and it will always
2490 choose the shortest possible chain.
2491 You can, though, still define multiple conversion methods between file
2493 For example, the standard LyX configuration provides three ways to convert
2494 LaTeX to PDF: Directly, using
2495 \begin_inset Flex CharStyle:MenuItem
2498 \begin_layout Plain Layout
2504 ; via (DVI and) PostScript®, using
2505 \begin_inset Flex CharStyle:MenuItem
2508 \begin_layout Plain Layout
2515 \begin_inset Flex CharStyle:MenuItem
2518 \begin_layout Plain Layout
2525 To define such alternate chains, you must define multiple target `file
2526 formats', as described in section
2527 \begin_inset CommandInset ref
2529 reference "sub:Formats"
2534 For example, in the standard configuration, the formats named
2535 \begin_inset Flex CharStyle:MenuItem
2538 \begin_layout Plain Layout
2545 \begin_inset Flex CharStyle:MenuItem
2548 \begin_layout Plain Layout
2555 \begin_inset Flex CharStyle:MenuItem
2558 \begin_layout Plain Layout
2564 are defined, all of which share the extension
2565 \begin_inset Flex CharStyle:MenuItem
2568 \begin_layout Plain Layout
2574 , and which correspond to the conversion methods just mentioned.
2577 \begin_layout Chapter
2578 Internationalizing LyX
2579 \begin_inset CommandInset label
2588 \begin_layout Standard
2589 LyX supports using a translated interface.
2590 Last time we checked, LyX provided text in thirty languages.
2591 The language of choice is called your
2596 (For further reading on locale settings, see also the documentation for
2597 locale that comes with your operating system.
2598 For Linux, the manual page for
2599 \begin_inset Flex CharStyle:Code
2602 \begin_layout Plain Layout
2608 could be a good place to start).
2611 \begin_layout Standard
2612 Notice that these translations will work, but do contain a few flaws.
2613 In particular, all dialogs have been designed with the English text in
2614 mind, which means that some of the translated text will be too large to
2615 fit within the space allocated.
2616 This is only a display problem and will not cause any harm.
2617 Also, you will find that some of the translations do not define shortcut
2618 keys for everything.
2619 Sometimes, there are simply not enough free letters to do it.
2620 Other times, the translator just hasn't got around to doing it yet.
2621 Our localization team, which you may wish to join,
2625 \begin_layout Plain Layout
2626 If you are a fluent speaker of a language other than English, joining these
2627 teams is a great way to give back to the LyX community!
2632 will of course try to fix these shortcomings in future versions of LyX.
2635 \begin_layout Section
2639 \begin_layout Subsection
2640 Translating the graphical user interface (text messages).
2643 \begin_layout Standard
2645 \begin_inset Flex CharStyle:Code
2648 \begin_layout Plain Layout
2654 library to handle the internationalization of the interface.
2655 To have LyX speak your favorite language in all menus and dialogs, you
2657 \begin_inset Flex CharStyle:Code
2660 \begin_layout Plain Layout
2666 -file for that language.
2667 When this is available, you'll have to generate a
2668 \begin_inset Flex CharStyle:Code
2671 \begin_layout Plain Layout
2677 -file from it and install the
2678 \begin_inset Flex CharStyle:Code
2681 \begin_layout Plain Layout
2688 The process of doing all of this is explained in the documentation for
2690 \begin_inset Flex CharStyle:Code
2693 \begin_layout Plain Layout
2700 It is possible to do this just for yourself, but if you're going to do
2701 it, you might as well share the results of your labors with the rest of
2703 Send a message to the LyX developers' list for more information about how
2707 \begin_layout Standard
2708 In short, this is what you should do (xx denotes the language code):
2711 \begin_layout Itemize
2712 Check out the LyX source code.
2714 \begin_inset CommandInset href
2716 name "information on the web"
2717 target "http://www.lyx.org/devel/cvs.php"
2724 \begin_layout Itemize
2726 \begin_inset Flex CharStyle:Code
2729 \begin_layout Plain Layout
2735 to the folder of the
2736 \begin_inset Flex CharStyle:Code
2739 \begin_layout Plain Layout
2747 \begin_inset Flex CharStyle:Code
2750 \begin_layout Plain Layout
2758 \begin_inset Flex CharStyle:Code
2761 \begin_layout Plain Layout
2767 doesn't exist anywhere, it can be remade with the console command
2768 \begin_inset Flex CharStyle:Code
2771 \begin_layout Plain Layout
2777 in that directory, or you can use an existing po-file for some other language
2781 \begin_layout Itemize
2783 \begin_inset Flex CharStyle:Code
2786 \begin_layout Plain Layout
2796 \begin_layout Plain Layout
2797 This is just a text file, so it can be edited in any text editor.
2798 But there are also specialized programs that support such editing, such
2803 (for all platforms) or
2812 contains a `mode' for editing
2813 \begin_inset Flex CharStyle:Code
2816 \begin_layout Plain Layout
2827 For some menu- and widget-labels, there are also shortcut keys that should
2829 Those keys are marked after a `|', and should be translated according to
2830 the words and phrases of the language.
2831 You should also fill also out the information at the beginning of the new
2833 \begin_inset Flex CharStyle:Code
2836 \begin_layout Plain Layout
2842 -file with your email-address, etc., so people know where to reach you with
2843 suggestions and entertaining flames.
2846 \begin_layout Standard
2847 If you are just doing this on your own, then:
2850 \begin_layout Itemize
2852 \begin_inset Flex CharStyle:Code
2855 \begin_layout Plain Layout
2862 This can be done with
2863 \begin_inset Flex CharStyle:Code
2866 \begin_layout Plain Layout
2867 msgfmt -o xx.mo < xx.po
2875 \begin_layout Itemize
2877 \begin_inset Flex CharStyle:Code
2880 \begin_layout Plain Layout
2886 -file to your locale-tree, at the correct directory for application messages
2891 xx, and under the name
2892 \begin_inset Flex CharStyle:Code
2895 \begin_layout Plain Layout
2902 \begin_inset space \thinspace{}
2906 \begin_inset space \space{}
2910 \begin_inset Flex CharStyle:Code
2913 \begin_layout Plain Layout
2914 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2924 \begin_layout Standard
2925 As said, however, it would be best if the new
2926 \begin_inset Flex CharStyle:Code
2929 \begin_layout Plain Layout
2935 -file could be added to the LyX distribution, so others can use it.
2936 Adding it involves making additional changes to LyX.
2937 So send an email to the developers' mailing list if you're interested in
2941 \begin_layout Subsubsection
2945 \begin_layout Standard
2946 Sometimes it turns out that one English message needs to be translated into
2947 different messages in the target language.
2948 One example is the message
2949 \begin_inset Flex CharStyle:Code
2952 \begin_layout Plain Layout
2958 which has the German translation
2966 , depending upon exactly what the English
2967 \begin_inset Quotes eld
2971 \begin_inset Quotes erd
2976 \begin_inset Flex CharStyle:Code
2979 \begin_layout Plain Layout
2985 does not handle such ambigous translations.
2986 Therefore you have to add some context information to the message: Instead
2988 \begin_inset Flex CharStyle:Code
2991 \begin_layout Plain Layout
2998 \begin_inset Flex CharStyle:Code
3001 \begin_layout Plain Layout
3002 To[[as in 'From format x to format y']]
3008 \begin_inset Flex CharStyle:Code
3011 \begin_layout Plain Layout
3012 To[[as in 'From page x to page y']].
3017 Now the two occurences of
3018 \begin_inset Flex CharStyle:Code
3021 \begin_layout Plain Layout
3028 \begin_inset Flex CharStyle:Code
3031 \begin_layout Plain Layout
3037 and can be translated correctly to
3048 \begin_layout Standard
3049 Of course the context information needs to be stripped off the original
3050 message when no translation is used.
3051 Therefore you have to put it in double square brackets at the end of the
3052 message (see the example above).
3053 The translation mechanism of LyX ensures that everything in double square
3054 brackets at the end of messages is removed before displaying the message.
3057 \begin_layout Subsection
3058 Translating the documentation.
3061 \begin_layout Standard
3062 The online documentation (in the
3063 \begin_inset Flex CharStyle:MenuItem
3066 \begin_layout Plain Layout
3076 -menu) can (and should!) be translated.
3077 If there are translated versions of the documentation available
3081 \begin_layout Plain Layout
3082 As of March 2008, at least some of the documents have been translated into
3083 fourteen languages, with the Tutorial available in a few more.
3088 and the locale is set accordingly, these will be used automagically by
3090 LyX looks for translated versions as
3091 \begin_inset Flex CharStyle:Code
3094 \begin_layout Plain Layout
3095 LyXDir/doc/xx_DocName.lyx
3101 \begin_inset Flex CharStyle:Code
3104 \begin_layout Plain Layout
3110 is the code for the language currently in use.
3111 If there are no translated documents, the default English versions will
3113 Note that the translated versions must have the same filenames (
3114 \begin_inset Flex CharStyle:Code
3117 \begin_layout Plain Layout
3123 above) as the original.
3124 If you feel up to translating the documentation (an excellent way to proof-read
3125 the original documentation by the way!), there are a few things you should
3129 \begin_layout Itemize
3131 \begin_inset Flex CharStyle:Code
3134 \begin_layout Plain Layout
3140 , the guide to writing LyX documentation.
3141 Pay special attention to the translator's section.
3144 \begin_layout Itemize
3145 Check out the documentation translation web page at
3146 \begin_inset CommandInset href
3148 name "http://www.lyx.org/Translation"
3149 target "http://www.lyx.org/Translation"
3154 That way, you can find out which (if any) documents have already been translate
3155 d into your language.
3156 You can also find out who (if anyone) is organizing the effort to translate
3157 the documentation into your language.
3158 If no one is organizing the effort, please let us know that you're interested.
3161 \begin_layout Standard
3162 Once you get to actually translating, here's a few hints for you that may
3166 \begin_layout Itemize
3167 Join the documentation team! There is information on how to do that in
3168 \begin_inset Flex CharStyle:Code
3171 \begin_layout Plain Layout
3178 \begin_inset Flex CharStyle:MenuItem
3181 \begin_layout Plain Layout
3186 elp\SpecialChar \menuseparator
3196 ), which by the way is the first document you should translate.
3199 \begin_layout Itemize
3200 Learn the typographic conventions for the language you are translating to.
3201 Typography is an ancient art and over the centuries, a great variety of
3202 conventions have developed throughout different parts of the world.
3203 Also study the professional terminology amongst typographers in your country.
3204 Inventing your own terminology will only confuse the users.
3207 (Warning! Typography is addictive!)
3210 \begin_layout Itemize
3211 Make a copy of the document.
3212 This will be your working copy.
3213 You can use this as your personal translated help-file by placing it in
3215 \begin_inset Flex CharStyle:Code
3218 \begin_layout Plain Layout
3227 \begin_layout Itemize
3228 Sometimes the original document (from the LyX-team) will be updated.
3229 Use the source viewer at
3230 \begin_inset CommandInset href
3232 name "http://www.lyx.org/trac/timeline"
3233 target "http://www.lyx.org/trac/timeline"
3237 to see what has been changed.
3238 That way you can easily see which parts of the translated document need
3242 \begin_layout Standard
3243 If you ever find an error in the original document, fix it and notify the
3244 rest of the documentation team of the changes! (You didn't forget to join
3245 the documentation team, did you?)
3248 \begin_layout Standard
3249 \begin_inset Branch OutDated
3252 \begin_layout Section
3253 International Keyboard Support
3256 \begin_layout Standard
3259 [Editor's Note: The following section is by
3267 It needs to be fixed to conform to the new Documentation Style sheet and
3268 to make use of the new v1.0 features.
3269 The whole thing also needs to be merged with the section following it.-jw
3270 It may also be badly out of date.-rh (2008)]
3273 \begin_layout Subsection
3274 Defining Own Keymaps: Keymap File Format
3277 \begin_layout Standard
3278 Let's look at a keyboard definition file a little closer.
3279 It is a plain text file defining
3282 \begin_layout Itemize
3283 key-to-key or key-to-string translations
3286 \begin_layout Itemize
3290 \begin_layout Itemize
3291 dead keys exceptions
3294 \begin_layout Standard
3295 To define key-to-key or key-to-string translation, use this command:
3298 \begin_layout Quotation
3299 \begin_inset Flex CharStyle:Code
3302 \begin_layout Plain Layout
3311 \begin_inset Flex CharStyle:Code
3314 \begin_layout Plain Layout
3323 \begin_layout Standard
3325 \begin_inset Flex CharStyle:Code
3328 \begin_layout Plain Layout
3334 is the key to be translated and
3335 \begin_inset Flex CharStyle:Code
3338 \begin_layout Plain Layout
3344 is the string to be inserted into the document.
3345 To define dead keys, use:
3348 \begin_layout Quotation
3349 \begin_inset Flex CharStyle:Code
3352 \begin_layout Plain Layout
3361 \begin_inset Flex CharStyle:Code
3364 \begin_layout Plain Layout
3373 \begin_layout Standard
3375 \begin_inset Flex CharStyle:Code
3378 \begin_layout Plain Layout
3384 is a keyboard key and
3385 \begin_inset Flex CharStyle:Code
3388 \begin_layout Plain Layout
3395 The following dead keys are supported (shortcut name is in parentheses):
3398 \begin_layout Quotation
3402 \begin_inset space \hfill{}
3408 \begin_layout Quotation
3410 \begin_inset space \hfill{}
3416 \begin_layout Quotation
3418 \begin_inset space \hfill{}
3424 \begin_layout Quotation
3426 \begin_inset space \hfill{}
3432 \begin_layout Quotation
3434 \begin_inset space \hfill{}
3440 \begin_layout Quotation
3442 \begin_inset space \hfill{}
3449 \begin_layout Plain Layout
3461 \begin_layout Quotation
3463 \begin_inset space \hfill{}
3469 \begin_layout Quotation
3471 \begin_inset space \hfill{}
3478 \begin_layout Plain Layout
3490 \begin_layout Quotation
3492 \begin_inset space \hfill{}
3498 \begin_layout Quotation
3500 \begin_inset space \hfill{}
3506 \begin_layout Quotation
3508 \begin_inset space \hfill{}
3515 \begin_layout Plain Layout
3527 \begin_layout Quotation
3529 \begin_inset space \hfill{}
3536 \begin_layout Plain Layout
3548 \begin_layout Quotation
3550 \begin_inset space \hfill{}
3556 \begin_layout Quotation
3557 hungarian umlaut (hug)
3558 \begin_inset space \hfill{}
3564 \begin_layout Quotation
3566 \begin_inset space \hfill{}
3572 \begin_layout Quotation
3574 \begin_inset space \hfill{}
3581 \begin_layout Plain Layout
3593 \begin_layout Standard
3594 Since in many international keyboards there are exceptions to what some
3595 dead keys should do, you can define them using
3598 \begin_layout Quotation
3599 \begin_inset Flex CharStyle:Code
3602 \begin_layout Plain Layout
3610 deadkey key outstring
3613 \begin_layout Standard
3614 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3618 \begin_layout Quotation
3619 \begin_inset Flex CharStyle:Code
3622 \begin_layout Plain Layout
3635 \begin_layout Standard
3636 to make it work correctly.
3637 Also, you have to define as exceptions dead keys over i and j, to remove
3638 the dot from them before inserting an accent mark.
3639 I will change this when the time comes, but so far I haven't had time.
3642 \begin_layout Standard
3643 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3646 \begin_inset Flex CharStyle:Code
3649 \begin_layout Plain Layout
3655 have different meaning.
3657 \begin_inset Flex CharStyle:Code
3660 \begin_layout Plain Layout
3666 marks comments, quotes start and end LaTeX-style commands.
3667 To enter quote, you'll need to use
3668 \begin_inset Flex CharStyle:Code
3671 \begin_layout Plain Layout
3680 \begin_inset Flex CharStyle:Code
3683 \begin_layout Plain Layout
3690 \begin_inset Flex CharStyle:Code
3693 \begin_layout Plain Layout
3704 \begin_layout Standard
3705 If you make a keyboard description file that works for your language, please
3706 mail it to me, so I can include it in the next keymap distribution.
3709 \begin_layout Standard
3710 More keywords will be supported in keymap configuration file in future,
3714 \begin_layout Itemize
3715 \begin_inset Flex CharStyle:Code
3718 \begin_layout Plain Layout
3729 \begin_inset space \hfill{}
3733 \begin_inset Flex CharStyle:Code
3736 \begin_layout Plain Layout
3745 \begin_layout Itemize
3746 \begin_inset Flex CharStyle:Code
3749 \begin_layout Plain Layout
3760 \begin_inset space \hfill{}
3764 \begin_inset Flex CharStyle:Code
3767 \begin_layout Plain Layout
3773 an external keymap translation program
3776 \begin_layout Standard
3777 Also, it should look into
3778 \begin_inset Flex CharStyle:Code
3781 \begin_layout Plain Layout
3787 file for defaults, too (for example, a
3788 \begin_inset Flex CharStyle:Code
3791 \begin_layout Plain Layout
3799 option to include default keyboard).
3807 \begin_layout Section
3808 \begin_inset CommandInset label
3814 International Keymap Stuff
3817 \begin_layout Standard
3818 \begin_inset Note Note
3821 \begin_layout Plain Layout
3822 In doing the revisions on this document in March 2008, I did not look over
3823 this stuff, as I do not understand it.
3824 It would be good if someone else could do so.
3832 \begin_layout Standard
3833 The next two sections describe the
3834 \begin_inset Flex CharStyle:Code
3837 \begin_layout Plain Layout
3846 \begin_inset Flex CharStyle:Code
3849 \begin_layout Plain Layout
3857 file syntax in detail.
3858 These sections should help you design your own key map if the ones provided
3859 do not meet your needs.
3862 \begin_layout Subsection
3866 \begin_layout Standard
3870 \begin_inset Flex CharStyle:Code
3873 \begin_layout Plain Layout
3879 file maps keystrokes to characters or strings.
3880 As the name suggests, it sets a keyboard mapping.
3882 \begin_inset Flex CharStyle:Code
3885 \begin_layout Plain Layout
3896 \begin_inset Flex CharStyle:Code
3899 \begin_layout Plain Layout
3914 \begin_inset Flex CharStyle:Code
3917 \begin_layout Plain Layout
3930 \begin_inset Flex CharStyle:Code
3933 \begin_layout Plain Layout
3942 \begin_inset Flex CharStyle:Code
3945 \begin_layout Plain Layout
3953 are described in this section.
3956 \begin_layout Labeling
3957 \labelwidthstring 00.00.0000
3958 \begin_inset Flex CharStyle:Code
3961 \begin_layout Plain Layout
3969 Map a character to a string
3972 \begin_layout LyX-Code
3987 \begin_layout Standard
4020 the double-quote (")
4037 must be escaped with a preceding backslash (
4048 \begin_layout Standard
4050 \begin_inset Flex CharStyle:MenuItem
4053 \begin_layout Plain Layout
4061 statement to cause the symbol
4062 \begin_inset Flex CharStyle:MenuItem
4065 \begin_layout Plain Layout
4073 to be output for the keystroke
4074 \begin_inset Flex CharStyle:MenuItem
4077 \begin_layout Plain Layout
4088 \begin_layout LyX-Code
4094 \begin_layout Labeling
4095 \labelwidthstring 00.00.0000
4096 \begin_inset Flex CharStyle:Code
4099 \begin_layout Plain Layout
4107 Specify an accent character
4110 \begin_layout LyX-Code
4119 \begin_layout Standard
4120 This will make the cha
4158 This is the dead key
4162 \begin_layout Plain Layout
4169 refers to a key that does not produce a character by itself, but when followed
4170 with another key, produces the desired accent character.
4171 For example, a German characte
4173 r with an umlaut like
4183 can be produced in this manner.
4192 \begin_layout Standard
4205 and then another key not in
4222 followed by the other, unallowed key, as output.
4226 \begin_inset Flex CharStyle:MenuItem
4229 \begin_layout Plain Layout
4237 cancels a dead key, so if
4248 \begin_inset Flex CharStyle:MenuItem
4251 \begin_layout Plain Layout
4260 , the cursor will not go one position backwards but will instead cancel
4276 might have had on the next keystroke.
4280 \begin_layout Standard
4281 The following example specifies that the character ' is to be an acute accent,
4282 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4285 \begin_layout LyX-Code
4288 kmod ' acute aeiouAEIOU
4291 \begin_layout Labeling
4292 \labelwidthstring 00.00.0000
4293 \begin_inset Flex CharStyle:Code
4296 \begin_layout Plain Layout
4302 Specify an exception to the accent character
4305 \begin_layout LyX-Code
4314 \begin_layout Standard
4315 This defines an exce
4356 have been assigned a keystroke with a previous
4359 \begin_inset Flex CharStyle:Code
4362 \begin_layout Plain Layout
4386 must not belong in the
4433 If such a declaration does not exist in
4441 \begin_inset Flex CharStyle:Code
4444 \begin_layout Plain Layout
4478 \begin_inset Flex CharStyle:Code
4481 \begin_layout Plain Layout
4495 \begin_layout Standard
4496 The following command produces causes äi to be produced when you enter acute-i
4500 \begin_layout LyX-Code
4514 \begin_layout Labeling
4515 \labelwidthstring 00.00.0000
4516 \begin_inset Flex CharStyle:Code
4519 \begin_layout Plain Layout
4525 Combine two accent characters
4528 \begin_layout LyX-Code
4534 accent1 accent2 allowed
4537 \begin_layout Standard
4538 This one is getting pretty esoteric.
4539 It allows you to combine the effect
4595 \begin_inset Flex CharStyle:Code
4598 \begin_layout Plain Layout
4626 \begin_layout Standard
4627 Consider this example from the
4628 \begin_inset Flex CharStyle:Code
4631 \begin_layout Plain Layout
4642 \begin_layout LyX-Code
4645 kmod ; acute aeioyvhAEIOYVH
4649 kcomb acute umlaut iyIY
4652 \begin_layout Standard
4653 This allows you to press
4654 \begin_inset Flex CharStyle:MenuItem
4657 \begin_layout Plain Layout
4665 and get the effect of
4666 \begin_inset Flex CharStyle:Code
4669 \begin_layout Plain Layout
4688 in this case cancels the last dead key, so if you press
4689 \begin_inset Flex CharStyle:MenuItem
4692 \begin_layout Plain Layout
4701 \begin_inset Flex CharStyle:Code
4704 \begin_layout Plain Layout
4717 \begin_layout Subsection
4721 \begin_layout Standard
4723 \begin_inset Flex CharStyle:Code
4726 \begin_layout Plain Layout
4734 mapping is performed, a
4735 \begin_inset Flex CharStyle:Code
4738 \begin_layout Plain Layout
4748 file maps the strings that the symbols generate to characters in the current
4750 The LyX distribution currently includes at least the
4751 \begin_inset Flex CharStyle:Code
4754 \begin_layout Plain Layout
4763 \begin_inset Flex CharStyle:Code
4766 \begin_layout Plain Layout
4777 \begin_layout Standard
4779 \begin_inset Flex CharStyle:Code
4782 \begin_layout Plain Layout
4790 file is a sequence of declarations of the form
4793 \begin_layout LyX-Code
4806 \begin_layout Standard
4807 For example, in order to map
4808 \begin_inset Flex CharStyle:MenuItem
4811 \begin_layout Plain Layout
4821 to the corresponding character in the iso-8859-1 set (233), the following
4825 \begin_layout LyX-Code
4833 \begin_layout Standard
4835 \begin_inset Flex CharStyle:Code
4838 \begin_layout Plain Layout
4847 \begin_inset Flex CharStyle:Code
4850 \begin_layout Plain Layout
4868 the same character can apply to more than one string.
4870 \begin_inset Flex CharStyle:Code
4873 \begin_layout Plain Layout
4884 \begin_layout LyX-Code
4896 \begin_inset Newline newline
4912 \begin_layout Standard
4913 If LyX cannot find a mapping for the string produced by the keystroke or
4914 a deadkey sequence, it will check if it looks like an accented char and
4915 try to draw an accent over the character on screen.
4918 \begin_layout Subsection
4922 \begin_layout Standard
4923 There is a second way to add support for international characters through
4924 so-called dead-keys.
4925 A dead-key works in combination with a letter to produce an accented character.
4926 Here, we'll explain how to create a really simple dead-key to illustrate
4930 \begin_layout Standard
4931 Suppose you happen to need the circumflex character,
4932 \begin_inset Quotes eld
4936 \begin_inset Quotes erd
4941 \begin_inset Flex CharStyle:MenuItem
4944 \begin_layout Plain Layout
4951 \begin_inset space ~
4955 \begin_inset Flex CharStyle:MenuItem
4958 \begin_layout Plain Layout
4964 ] to the LyX command
4965 \begin_inset Flex CharStyle:Code
4968 \begin_layout Plain Layout
4975 \begin_inset Flex CharStyle:Code
4978 \begin_layout Plain Layout
4985 Now, whenever you type the
4986 \begin_inset Flex CharStyle:MenuItem
4989 \begin_layout Plain Layout
4995 -key followed by a letter, that letter will have a circumflex accent on
4997 For example, the sequence
4998 \begin_inset Quotes eld
5002 \begin_inset Flex CharStyle:MenuItem
5005 \begin_layout Plain Layout
5012 \begin_inset Quotes erd
5015 produces the letter:
5016 \begin_inset Quotes eld
5020 \begin_inset Quotes erd
5024 If you tried to type
5025 \begin_inset Quotes eld
5029 \begin_inset Flex CharStyle:MenuItem
5032 \begin_layout Plain Layout
5039 \begin_inset Quotes erd
5042 , however, LyX will complain with a beep, since a
5043 \begin_inset Quotes eld
5047 \begin_inset Flex CharStyle:MenuItem
5050 \begin_layout Plain Layout
5057 \begin_inset Quotes erd
5060 never takes a circumflex accent.
5062 \begin_inset Flex CharStyle:MenuItem
5065 \begin_layout Plain Layout
5071 after a dead-key produces the bare-accent.
5072 Please note this last point! If you bind a key to a dead-key, you'll need
5073 to rebind the character on that key to yet another key.
5075 \begin_inset Flex CharStyle:MenuItem
5078 \begin_layout Plain Layout
5084 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5087 \begin_layout Standard
5088 One common way to bind dead-keys is to use
5089 \begin_inset Flex CharStyle:MenuItem
5092 \begin_layout Plain Layout
5099 \begin_inset Flex CharStyle:MenuItem
5102 \begin_layout Plain Layout
5109 \begin_inset Flex CharStyle:MenuItem
5112 \begin_layout Plain Layout
5118 in combination with an accent, like
5119 \begin_inset Quotes eld
5123 \begin_inset Flex CharStyle:MenuItem
5126 \begin_layout Plain Layout
5133 \begin_inset Quotes erd
5137 \begin_inset Quotes eld
5141 \begin_inset Flex CharStyle:MenuItem
5144 \begin_layout Plain Layout
5151 \begin_inset Quotes erd
5155 \begin_inset Quotes eld
5159 \begin_inset Flex CharStyle:MenuItem
5162 \begin_layout Plain Layout
5169 \begin_inset Quotes erd
5173 Another way involves using
5174 \begin_inset Flex CharStyle:Code
5177 \begin_layout Plain Layout
5184 \begin_inset Flex CharStyle:Code
5187 \begin_layout Plain Layout
5193 to set up the special
5194 \begin_inset Flex CharStyle:Code
5197 \begin_layout Plain Layout
5205 \begin_inset Flex CharStyle:Code
5208 \begin_layout Plain Layout
5214 acts in some ways just like
5215 \begin_inset Flex CharStyle:MenuItem
5218 \begin_layout Plain Layout
5224 and permits you to bind keys to accented characters.
5225 You can also turn keys into dead-keys by binding them to something like
5227 \begin_inset Flex CharStyle:Code
5230 \begin_layout Plain Layout
5236 and then binding this symbolic key to the corresponding LyX command.
5240 \begin_layout Plain Layout
5245 : This is exactly what I do in my
5246 \begin_inset Flex CharStyle:Code
5249 \begin_layout Plain Layout
5256 \begin_inset Flex CharStyle:Code
5259 \begin_layout Plain Layout
5267 \begin_inset Flex CharStyle:MenuItem
5270 \begin_layout Plain Layout
5272 \begin_inset space ~
5281 \begin_inset Flex CharStyle:Code
5284 \begin_layout Plain Layout
5290 and a bunch of these
5291 \begin_inset Quotes eld
5295 \begin_inset Flex CharStyle:Code
5298 \begin_layout Plain Layout
5305 \begin_inset Quotes erd
5308 symbolic keys bound such things as
5309 \begin_inset Flex CharStyle:MenuItem
5312 \begin_layout Plain Layout
5314 \begin_inset space ~
5323 \begin_inset Flex CharStyle:MenuItem
5326 \begin_layout Plain Layout
5328 \begin_inset space ~
5337 This is how I produce my accented characters.
5342 You can make just about anything into the
5343 \begin_inset Flex CharStyle:Code
5346 \begin_layout Plain Layout
5353 \begin_inset Flex CharStyle:MenuItem
5356 \begin_layout Plain Layout
5362 keys, a spare function key, etc.
5363 As for the LyX commands that produce accents, check the entry for
5364 \begin_inset Flex CharStyle:Code
5367 \begin_layout Plain Layout
5378 You'll find the complete list there.
5381 \begin_layout Subsection
5382 Saving your Language Configuration
5385 \begin_layout Standard
5386 You can edit your preferences so that your desired language environment
5387 is automatically configured when LyX starts up, via the
5388 \begin_inset Flex CharStyle:MenuItem
5391 \begin_layout Plain Layout
5392 Edit\SpecialChar \menuseparator
5401 \begin_layout Chapter
5402 Installing New Document Classes, Layouts, and Templates
5403 \begin_inset CommandInset label
5405 name "chap:textclass"
5413 \begin_layout Plain Layout
5414 Installing New Document Classes
5422 \begin_layout Standard
5423 In this chapter, we describe the procedures for creating and installing
5424 new LyX layout and template files, as well as offer a refresher on correctly
5425 installing new LaTeX document classes.
5426 Some definitions: a document class is a LaTeX file (usually ending in
5427 \begin_inset Flex CharStyle:Code
5430 \begin_layout Plain Layout
5437 \begin_inset Flex CharStyle:Code
5440 \begin_layout Plain Layout
5446 ) that describes the format of a document such as an article, report, journal
5447 preprint, etc, and all the commands needed to realize that format.
5448 A layout file is a LyX file that corresponds to a LaTeX document class
5449 and that tells LyX how to
5450 \begin_inset Quotes eld
5454 \begin_inset Quotes erd
5457 things on the screen to make the display look something like the final
5459 More precisely, a layout file describes a
5460 \begin_inset Quotes eld
5464 \begin_inset Quotes erd
5467 which is the internal construct LyX uses to render the screen display.
5469 \begin_inset Quotes eld
5473 \begin_inset Quotes erd
5477 \begin_inset Quotes eld
5481 \begin_inset Quotes erd
5484 can be used somewhat interchangeably, but it is better to refer to the
5485 file as the layout, and the thing living in LyX's memory as the text class.
5486 A template file is simply a LyX document that contains a set of predefined
5487 entries for a given document class---entries that are generally required
5489 Templates are especially useful for things like journal manuscripts that
5490 are to be submitted electronically.
5493 \begin_layout Section
5494 Installing a new LaTeX package
5497 \begin_layout Standard
5498 Some installations may not include a LaTeX package that you would like to
5500 For example, you might need FoilTeX, a package for preparing slides or
5501 viewgraphs for overhead projectors.
5502 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5503 a user interface for that.
5504 For example on MiKTeX you start its program
5505 \begin_inset Quotes eld
5509 \begin_inset Quotes erd
5512 to get a list of available packages.
5513 To install one, right click on it or use the installing toolbar button.
5514 When the package you want to install is not in the list, but you have it
5516 \begin_inset Flex CharStyle:Code
5519 \begin_layout Plain Layout
5526 \begin_inset Flex CharStyle:Code
5529 \begin_layout Plain Layout
5535 -file, then copy these files to a subfolder of your LaTeX distribution,
5536 for example to the folder
5545 Then update the file name database of your LaTeX-distribution.
5546 For example on MiKTeX this is done by pressing the button
5549 \begin_inset space ~
5554 that you find in MiKTeX's
5555 \begin_inset Quotes eld
5559 \begin_inset Quotes erd
5563 In both cases you need afterwards to reconfigure LyX using the menu
5564 \begin_inset Flex CharStyle:MenuItem
5567 \begin_layout Plain Layout
5568 Tools\SpecialChar \menuseparator
5574 and then to restart LyX.
5577 \begin_layout Standard
5578 If your LaTeX distribution doesn't provide a user interface, then you can
5579 follow these steps by using a UNIX/Linux console.
5582 \begin_layout Enumerate
5583 Get the package from
5584 \begin_inset CommandInset href
5587 target "http://www.ctan.org/"
5594 \begin_layout Enumerate
5595 You can install this package in several different places.
5596 If you want it to be available for all users on your system, then you should
5597 install it in your `local' TeX tree; if you want (or need) it to be available
5598 just for you, then you can install it in your own `user' TeX tree.
5599 Where these should be created, if they do not already exist, depends upon
5600 the details of your system.
5601 To find out, look in the file
5602 \begin_inset Flex CharStyle:Code
5605 \begin_layout Plain Layout
5615 \begin_layout Plain Layout
5616 This usually lives in the directory
5617 \begin_inset Flex CharStyle:Code
5620 \begin_layout Plain Layout
5626 , though you can run
5627 \begin_inset Flex CharStyle:Code
5630 \begin_layout Plain Layout
5641 The location of the `local' TeX tree is defined by
5642 \begin_inset Flex CharStyle:Code
5645 \begin_layout Plain Layout
5651 ; this is usually somewhere like
5652 \begin_inset Flex CharStyle:Code
5655 \begin_layout Plain Layout
5656 /usr/local/share/texmf/
5662 The `user' TeX tree is defined by
5663 \begin_inset Flex CharStyle:Code
5666 \begin_layout Plain Layout
5673 \begin_inset Flex CharStyle:Code
5676 \begin_layout Plain Layout
5683 (If these variables are not predefined, you can define them.) You'll probably
5684 need root permissions to create or modify the `local' tree; but your `user'
5685 tree shouldn't have such limitations.
5688 \begin_layout Enumerate
5690 \begin_inset Flex CharStyle:Code
5693 \begin_layout Plain Layout
5700 \begin_inset Flex CharStyle:Code
5703 \begin_layout Plain Layout
5710 \begin_inset Flex CharStyle:Code
5713 \begin_layout Plain Layout
5720 \begin_inset space \thinspace{}
5724 \begin_inset Newline newline
5728 \begin_inset Flex CharStyle:Code
5731 \begin_layout Plain Layout
5732 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5738 \begin_inset Newline newline
5741 But, again, most of this will
5742 \begin_inset Quotes eld
5746 \begin_inset Quotes erd
5752 \begin_layout Enumerate
5757 \begin_layout Plain Layout
5758 We'll assume henceforth that you're defining `local' TeX tree.
5759 If you're defining a user tree, just adjust as necessary.
5765 You must follow the directory structure of your existing
5766 \begin_inset Flex CharStyle:Code
5769 \begin_layout Plain Layout
5775 directory, which will be found at
5776 \begin_inset Flex CharStyle:Code
5779 \begin_layout Plain Layout
5786 For example, latex packages should go under
5787 \begin_inset Flex CharStyle:Code
5790 \begin_layout Plain Layout
5791 $TEXMFLOCAL/tex/latex/
5799 \begin_layout Enumerate
5800 Install the package.
5801 For example, you would unpack the FoilTeX tarball and copy it to
5802 \begin_inset Flex CharStyle:Code
5805 \begin_layout Plain Layout
5806 $TEXMFLOCAL/tex/latex/foiltex
5813 \begin_inset Flex CharStyle:Code
5816 \begin_layout Plain Layout
5822 directory contains various files.
5825 \begin_layout Enumerate
5827 \begin_inset Flex CharStyle:Code
5830 \begin_layout Plain Layout
5838 \begin_inset Flex CharStyle:Code
5841 \begin_layout Plain Layout
5850 \begin_layout Standard
5851 Your package is now installed and available to LaTeX.
5852 To make it available to LyX, you need to create a Layout file, if one is
5853 not already available.
5854 (See the next section.) Once you have a layout file, you need only reconfigure
5856 \begin_inset Flex CharStyle:MenuItem
5859 \begin_layout Plain Layout
5860 Tools\SpecialChar \menuseparator
5866 ) and then restart LyX.
5867 You should then see your new package---for example
5868 \begin_inset Flex CharStyle:MenuItem
5871 \begin_layout Plain Layout
5878 \begin_inset Flex CharStyle:MenuItem
5881 \begin_layout Plain Layout
5882 Document\SpecialChar \menuseparator
5889 \begin_inset Flex CharStyle:MenuItem
5892 \begin_layout Plain Layout
5902 \begin_layout Section
5906 \begin_layout Standard
5907 This section describes how to write and install your own LyX layout files
5908 and walks through the
5909 \begin_inset Flex CharStyle:Code
5912 \begin_layout Plain Layout
5918 text class format as an example.
5920 \begin_inset Flex CharStyle:Code
5923 \begin_layout Plain Layout
5929 files describe what paragraph and character styles are available for a
5930 given document class and how LyX should display them.
5931 We try to provide a thorough description of the process here; however,
5932 there are so many different types of documents supported by LaTeX classes
5933 that we can't hope to cover every different possibility or problem you
5935 (The LyX users' list is frequented by people with lots of experience with
5936 layout design who are willing to share what they've learned.)
5939 \begin_layout Standard
5940 As you prepare to write a new layout, it is extremely helpful to look at
5941 the example layouts distributed with LyX.
5942 If you use a nice LaTeX document class that might be of interest for others,
5943 too, and have a nice corresponding LyX layout, feel free to contribute
5944 the stuff to us, so we may put it into the distribution.
5946 \begin_inset CommandInset href
5948 name "section on the LyX wiki"
5949 target "http://wiki.lyx.org/Layouts/Layouts"
5953 for this kind of material.
5956 \begin_layout Standard
5957 All the tags described in this chapter are case-insensitive; this means
5959 \begin_inset Flex CharStyle:Code
5962 \begin_layout Plain Layout
5969 \begin_inset Flex CharStyle:Code
5972 \begin_layout Plain Layout
5979 \begin_inset Flex CharStyle:Code
5982 \begin_layout Plain Layout
5988 are really the same command.
5989 The possible values are printed in brackets after the feature's name.
5990 The default value if a feature isn't specified inside a text class-description
5992 \begin_inset Flex CharStyle:Code
5995 \begin_layout Plain Layout
6004 If the argument has a datatype like
6005 \begin_inset Quotes eld
6009 \begin_inset Quotes erd
6013 \begin_inset Quotes eld
6017 \begin_inset Quotes erd
6020 , the default is shown like this:
6021 \begin_inset Flex CharStyle:Code
6024 \begin_layout Plain Layout
6035 \begin_layout Subsection
6036 \begin_inset CommandInset label
6038 name "sub:Layout-modules"
6045 \begin_layout Standard
6046 Similar to layout files, and new with LyX 1.6, are layout
6051 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6052 some modules---such as the Endnotes module---provide support for just such
6054 In a sense, layout modules are similar to included files---files like
6055 \begin_inset Flex CharStyle:Code
6058 \begin_layout Plain Layout
6064 ---in that modules are not specific to a given document layout but may be
6065 used with many different layouts.
6066 The difference is that using a layout module does not require editing the
6068 Rather, modules are selected in the
6069 \begin_inset Flex CharStyle:MenuItem
6072 \begin_layout Plain Layout
6073 Document\SpecialChar \menuseparator
6082 \begin_layout Standard
6083 Building modules is the easiest way to get started with layout editing,
6084 since it can be as simple as adding a single new paragraph or flex inset.
6085 But modules may, in principle, contain anything a layout file can contain.
6088 \begin_layout Standard
6089 A module must begin with a line like the following:
6092 \begin_layout LyX-Code
6095 DeclareLyXModule[endnotes.sty]{Endnotes}
6098 \begin_layout Standard
6099 The argument in square brackets is optional: It declares any LaTeX packages
6100 on which the module depends.
6101 The mandatory argument, in curly brackets, is the name of the module, as
6103 \begin_inset Flex CharStyle:MenuItem
6106 \begin_layout Plain Layout
6107 Document\SpecialChar \menuseparator
6117 \begin_layout Standard
6118 The module declaration should then be followed by lines like the following:
6121 \begin_layout LyX-Code
6125 \begin_layout LyX-Code
6126 #Adds an endnote command, in addition to footnotes.
6130 \begin_layout LyX-Code
6131 #You will need to add
6133 theendnotes in ERT where you
6136 \begin_layout LyX-Code
6137 #want the endnotes to appear.
6141 \begin_layout LyX-Code
6145 \begin_layout LyX-Code
6146 #Requires: somemodule | othermodule
6149 \begin_layout LyX-Code
6150 #Excludes: badmodule
6153 \begin_layout Standard
6154 The description is used in
6155 \begin_inset Flex CharStyle:MenuItem
6158 \begin_layout Plain Layout
6159 Document\SpecialChar \menuseparator
6165 to provide the user with information about what the module does.
6167 \begin_inset Flex CharStyle:Code
6170 \begin_layout Plain Layout
6176 line is used to identify other modules with which this one must be used;
6178 \begin_inset Flex CharStyle:Code
6181 \begin_layout Plain Layout
6187 line is used to identify modules with which this one may not be used.
6188 Both are optional, and, as shown, multiple modules should be separated
6189 with the pipe symbol: |.
6190 Note that the required modules are treated disjunctively:
6194 of the required modules must be used.
6199 excluded module may be used.
6200 Note that modules are identified here by their
6204 without the .module extension.
6206 \begin_inset Flex CharStyle:Code
6209 \begin_layout Plain Layout
6216 \begin_inset Flex CharStyle:Code
6219 \begin_layout Plain Layout
6228 \begin_layout Standard
6229 After creating a new module, you will need to reconfigure and then restart
6230 LyX for the module to appear in the menu.
6231 However, changes you make to the module will be seen immediately, if you
6233 \begin_inset Flex CharStyle:MenuItem
6236 \begin_layout Plain Layout
6237 Document\SpecialChar \menuseparator
6243 , highlight something, and then hit
6244 \begin_inset Quotes eld
6248 \begin_inset Quotes erd
6254 It is strongly recommended that you save your work before doing so
6259 it is strongly recommended that you not attempt to edit modules while simultaneo
6260 usly working on documents
6263 Though of course the developers strive to keep LyX stable in such situations,
6264 syntax errors and the like in your module file could cause strange behavior.
6267 \begin_layout Subsection
6268 Supporting new document classes
6271 \begin_layout Standard
6272 There are two situations you are likely to encounter when wanting to support
6273 a new LaTeX document class, involving LaTeX2e class (
6274 \begin_inset Flex CharStyle:Code
6277 \begin_layout Plain Layout
6284 \begin_inset Flex CharStyle:Code
6287 \begin_layout Plain Layout
6294 Supporting a style file is usually fairly easy.
6295 Supporting a new document class is a bit harder.
6298 \begin_layout Subsection
6300 \begin_inset Flex CharStyle:MenuItem
6303 \begin_layout Plain Layout
6312 \begin_layout Standard
6313 If your new document class is provided as a style file that is used in conjuncti
6314 on with an existing, supported document class---for the sake of the example,
6315 we'll assume that the style file is called
6316 \begin_inset Flex CharStyle:MenuItem
6319 \begin_layout Plain Layout
6325 and it is meant to be used with
6326 \begin_inset Flex CharStyle:MenuItem
6329 \begin_layout Plain Layout
6335 , which is a standard class---start by copying the existing class's layout
6336 file into your local directory:
6339 \begin_layout LyX-Code
6340 cp report.layout ~/.lyx/layouts/myclass.layout
6343 \begin_layout Standard
6345 \begin_inset Flex CharStyle:Code
6348 \begin_layout Plain Layout
6354 and change the line:
6357 \begin_layout LyX-Code
6360 DeclareLaTeXClass{report}
6363 \begin_layout Standard
6367 \begin_layout LyX-Code
6370 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6373 \begin_layout Standard
6377 \begin_layout LyX-Code
6379 \begin_inset Newline newline
6385 \begin_inset Newline newline
6391 \begin_layout Standard
6392 near the top of the file.
6395 \begin_layout Standard
6396 Start LyX and select
6397 \begin_inset Flex CharStyle:MenuItem
6400 \begin_layout Plain Layout
6401 Tools\SpecialChar \menuseparator
6408 Then restart LyX and try creating a new document.
6410 \begin_inset Flex CharStyle:MenuItem
6413 \begin_layout Plain Layout
6419 " as a document class option in the
6420 \begin_inset Flex CharStyle:MenuItem
6423 \begin_layout Plain Layout
6424 Document\SpecialChar \menuseparator
6431 It is likely that some of the sectioning commands and such in your new
6432 class will work differently from how they worked in the base class---
6433 \begin_inset Flex CharStyle:Code
6436 \begin_layout Plain Layout
6442 in this example---so you can fiddle around with the settings for the different
6443 sections if you wish.
6446 \begin_layout Subsection
6448 \begin_inset Flex CharStyle:MenuItem
6451 \begin_layout Plain Layout
6460 \begin_layout Standard
6461 There are two possibilities here.
6462 One is that the class file is itself based upon an existing document class.
6463 For example, many thesis classes are based upon
6464 \begin_inset Flex CharStyle:MenuItem
6467 \begin_layout Plain Layout
6474 To see whether yours is, look for a line like
6477 \begin_layout LyX-Code
6483 \begin_layout Standard
6485 If so, then you may proceed largely as in the previous section, though
6486 the DeclareLaTeXClass line will be different.
6487 If your new class is thesis, and it is based upon book, then the line should
6492 \begin_layout Plain Layout
6493 And it will be easiest if you save the file to
6494 \begin_inset Flex CharStyle:Code
6497 \begin_layout Plain Layout
6503 : LyX assumes that the document class has the same name as the layout file.
6512 \begin_layout LyX-Code
6515 DeclareLaTeXClass[thesis,book]{thesis}
6518 \begin_layout Standard
6519 If, on the other hand, the new class is not based upon an existing class,
6520 you will probably have to
6521 \begin_inset Quotes eld
6525 \begin_inset Quotes erd
6529 We strongly suggest copying an existing layout file which uses a similar
6530 LaTeX class and then modifying it, if you can do so.
6531 At least use an existing file as a starting point so you can find out what
6532 items you need to worry about.
6533 Again, the specifics are covered below.
6536 \begin_layout Section
6537 Declaring a new text class
6540 \begin_layout Standard
6541 When it's finally time to get your hands dirty and create or edit your own
6542 layout file, the following sections describe what you're up against.
6543 Our advice is to go slowly, save and test often, listen to soothing music,
6544 and enjoy one or two of your favorite adult beverages; more if you are
6545 getting particularly stuck.
6546 It's really not that hard, except that the multitude of options can become
6547 overwhelming if you try to do to much in one sitting.
6548 Go have another adult beverage, just for good measure.
6551 \begin_layout Standard
6555 \begin_layout Standard
6556 Lines in a layout file which begin with a
6557 \begin_inset Flex CharStyle:Code
6560 \begin_layout Plain Layout
6567 There is one exception to this rule: all layouts should begin with lines
6571 \begin_layout LyX-Code
6574 #% Do not delete the line below; configure depends on this
6577 \begin_layout LyX-Code
6582 DeclareLaTeXClass{article}
6585 \begin_layout Standard
6586 The second line is used when you configure LyX.
6587 The layout file is read by the LaTeX script
6588 \begin_inset Flex CharStyle:Code
6591 \begin_layout Plain Layout
6597 , in a special mode where
6598 \begin_inset Flex CharStyle:Code
6601 \begin_layout Plain Layout
6608 The first line is just a LaTeX comment, and the second one contains the
6609 declaration of the text class.
6610 If these lines appear in a file named
6611 \begin_inset Flex CharStyle:Code
6614 \begin_layout Plain Layout
6620 , then they define a text class of name
6621 \begin_inset Flex CharStyle:Code
6624 \begin_layout Plain Layout
6630 (the name of the layout file) which uses the LaTeX document class
6631 \begin_inset Flex CharStyle:Code
6634 \begin_layout Plain Layout
6640 (the default is to use the same name as the layout).
6642 \begin_inset Quotes eld
6646 \begin_inset Quotes erd
6649 that appears above is used as a description of the text class in the
6650 \begin_inset Flex CharStyle:MenuItem
6653 \begin_layout Plain Layout
6654 Document\SpecialChar \menuseparator
6663 \begin_layout Standard
6664 Let's assume that you wrote your own text class that uses the
6665 \begin_inset Flex CharStyle:Code
6668 \begin_layout Plain Layout
6674 document class, but where you changed the appearance of the section headings.
6675 If you put it in a file
6676 \begin_inset Flex CharStyle:Code
6679 \begin_layout Plain Layout
6685 , the header of this file should be:
6688 \begin_layout LyX-Code
6691 #% Do not delete the line below; configure depends on this
6694 \begin_layout LyX-Code
6699 DeclareLaTeXClass[article]{article (with my own headings)}
6702 \begin_layout Standard
6703 This declares a text class
6704 \begin_inset Flex CharStyle:Code
6707 \begin_layout Plain Layout
6713 , associated with the LaTeX document class
6714 \begin_inset Flex CharStyle:Code
6717 \begin_layout Plain Layout
6724 \begin_inset Quotes eld
6727 article (with my own headings)
6728 \begin_inset Quotes erd
6732 If your text class depends on several packages, you can declare it as:
6735 \begin_layout LyX-Code
6738 #% Do not delete the line below; configure depends on this
6741 \begin_layout LyX-Code
6746 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6749 \begin_layout Standard
6750 This indicates that your text class uses the foo.sty package.
6751 Finally, it is also possible to declare classes for DocBook code.
6752 Typical declarations will look like
6755 \begin_layout LyX-Code
6758 #% Do not delete the line below; configure depends on this
6761 \begin_layout LyX-Code
6766 DeclareDocBookClass[article]{SGML (DocBook article)}
6769 \begin_layout Standard
6770 Note that these declarations can also be given an optional parameter declaring
6771 the name of the document class (but not a list).
6774 \begin_layout Standard
6775 So, to be as explicit as possible, the form of the layout declaration is:
6778 \begin_layout LyX-Code
6783 DeclareLaTeXClass[class,package.sty]{layout description}
6786 \begin_layout Standard
6787 The class need only be specified if the name of the LaTeX class file and
6788 the name of the layout file are different; if the name of the classfile
6789 is not specified, then LyX will simply assume that it is the same as the
6790 name of the layout file.
6793 \begin_layout Standard
6794 When the text class has been modified to your taste, all you have to do
6795 is to copy it either to
6796 \begin_inset Flex CharStyle:Code
6799 \begin_layout Plain Layout
6806 \begin_inset Flex CharStyle:Code
6809 \begin_layout Plain Layout
6816 \begin_inset Flex CharStyle:MenuItem
6819 \begin_layout Plain Layout
6824 ools\SpecialChar \menuseparator
6834 , exit LyX and restart it.
6835 Then your new text class should be available along with the others.
6838 \begin_layout Standard
6839 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6840 you made to your layout files.
6841 As a result, editing layout files could be very time consuming.
6842 Beginning with 1.6, however, you can force a reload of the layout currently
6843 in use by using the LyX function
6844 \begin_inset Flex CharStyle:MenuItem
6847 \begin_layout Plain Layout
6854 There is no default binding for this function---though, of course, you
6855 can bind it to a key yourself.
6856 If you want to use this function, then, you should simply enter it in the
6862 : This is very much an `advanced feature'.
6867 recommended that you save your work before using this function.
6872 recommended that you not attempt to edit your layout while simultaneously
6873 working on a document that you care about.
6874 Use a test document.
6875 Syntax errors and the like in your layout file could cause peculiar behavior.
6876 In particular, such errors could cause LyX to regard the current layout
6877 as invalid and to attempt to switch to some other layout.
6878 The LyX team strives to keep LyX stable in such situations, but safe is
6882 \begin_layout Subsection
6886 \begin_layout Standard
6887 The first non-comment line must contain the file format number:
6890 \begin_layout Description
6891 \begin_inset Flex CharStyle:Code
6894 \begin_layout Plain Layout
6901 \begin_inset Flex CharStyle:Code
6904 \begin_layout Plain Layout
6910 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6911 don't have an explicit file format).
6912 The file format that is documented here is format 8.
6915 \begin_layout Subsection
6916 General text class parameters
6919 \begin_layout Standard
6920 These are the general parameters which describe the form of the entire document:
6923 \begin_layout Description
6924 \begin_inset Flex CharStyle:Code
6927 \begin_layout Plain Layout
6933 Adds information to the document preamble.
6935 \begin_inset Quotes eld
6939 \begin_inset Flex CharStyle:Code
6942 \begin_layout Plain Layout
6949 \begin_inset Quotes erd
6955 \begin_layout Description
6956 \begin_inset Flex CharStyle:Code
6959 \begin_layout Plain Layout
6965 Describes various global options supported by the document class.
6967 \begin_inset space ~
6971 \begin_inset CommandInset ref
6973 reference "sec:classoptions"
6979 \begin_inset Quotes eld
6983 \begin_inset Flex CharStyle:Code
6986 \begin_layout Plain Layout
6993 \begin_inset Quotes erd
6999 \begin_layout Description
7000 \begin_inset Flex CharStyle:Code
7003 \begin_layout Plain Layout
7010 \begin_inset Flex CharStyle:Code
7013 \begin_layout Plain Layout
7022 \begin_inset Flex CharStyle:Code
7025 \begin_layout Plain Layout
7031 ] Whether the class should default to having one or two columns.
7032 Can be changed in the
7033 \begin_inset Flex CharStyle:MenuItem
7036 \begin_layout Plain Layout
7037 Document\SpecialChar \menuseparator
7046 \begin_layout Description
7047 \begin_inset Flex CharStyle:Code
7050 \begin_layout Plain Layout
7056 This sequence defines a new counter.
7058 \begin_inset space ~
7062 \begin_inset CommandInset ref
7064 reference "sec:counter"
7070 \begin_inset Quotes eld
7074 \begin_inset Flex CharStyle:Code
7077 \begin_layout Plain Layout
7084 \begin_inset Quotes erd
7090 \begin_layout Description
7091 \begin_inset Flex CharStyle:Code
7094 \begin_layout Plain Layout
7100 Sets the default font used to display the document.
7102 \begin_inset space ~
7106 \begin_inset CommandInset ref
7108 reference "sec:fonts"
7112 for how to declare fonts.
7114 \begin_inset Quotes eld
7118 \begin_inset Flex CharStyle:Code
7121 \begin_layout Plain Layout
7128 \begin_inset Quotes erd
7134 \begin_layout Description
7135 \begin_inset Flex CharStyle:Code
7138 \begin_layout Plain Layout
7145 \begin_inset Flex CharStyle:Code
7148 \begin_layout Plain Layout
7154 Specifies a module to be included by default with this document class,
7155 which should be specified by filename without the
7156 \begin_inset Flex CharStyle:Code
7159 \begin_layout Plain Layout
7166 The user can still remove the module, but it will be active at the outset.
7167 (This applies only when new files are created, or when this class is chosen
7168 for an existing document.)
7171 \begin_layout Description
7172 \begin_inset Flex CharStyle:Code
7175 \begin_layout Plain Layout
7182 \begin_inset Flex CharStyle:Code
7185 \begin_layout Plain Layout
7191 ] This is the style that will be assigned to new paragraphs, usually
7192 \begin_inset Flex CharStyle:MenuItem
7195 \begin_layout Plain Layout
7202 This will default to the first defined style if not given, but you are
7203 highly encouraged to use this directive.
7206 \begin_layout Description
7207 \begin_inset Flex CharStyle:Code
7210 \begin_layout Plain Layout
7217 \begin_inset Flex CharStyle:Code
7220 \begin_layout Plain Layout
7226 ] Indicates that the module in question---which should be specified by filename
7228 \begin_inset Flex CharStyle:Code
7231 \begin_layout Plain Layout
7237 extension---cannot be used with this document class.
7238 This might be used in a journal-specific layout file to prevent, say, the
7240 \begin_inset Flex CharStyle:Code
7243 \begin_layout Plain Layout
7249 module that numbers theorems by section.
7254 be used in a module.
7255 Modules have their own way of excluding other modules (see
7256 \begin_inset CommandInset ref
7258 reference "sub:Layout-modules"
7265 \begin_layout Description
7266 \begin_inset Flex CharStyle:Code
7269 \begin_layout Plain Layout
7275 Defines a new float.
7277 \begin_inset space ~
7281 \begin_inset CommandInset ref
7283 reference "sec:floats"
7289 \begin_inset Quotes eld
7293 \begin_inset Flex CharStyle:Code
7296 \begin_layout Plain Layout
7303 \begin_inset Quotes erd
7309 \begin_layout Description
7310 \begin_inset Flex CharStyle:Code
7313 \begin_layout Plain Layout
7319 As its name implies, this command allows you to include another layout
7320 definition file within yours to avoid duplicating commands.
7321 Common examples are the standard layout files, for example,
7322 \begin_inset Flex CharStyle:Code
7325 \begin_layout Plain Layout
7331 , which contains most of the basic layouts.
7334 \begin_layout Description
7335 \begin_inset Flex CharStyle:Code
7338 \begin_layout Plain Layout
7344 This section (re-)defines the layout of an inset.
7345 It can be applied to an existing inset of to a new, user-defined inset,
7347 \begin_inset space \thinspace{}
7351 \begin_inset space \space{}
7354 a new character style.
7356 \begin_inset space ~
7360 \begin_inset CommandInset ref
7362 reference "sec:charstyle"
7366 for more information.
7368 \begin_inset Quotes eld
7372 \begin_inset Flex CharStyle:Code
7375 \begin_layout Plain Layout
7382 \begin_inset Quotes erd
7388 \begin_layout Description
7389 \begin_inset Flex CharStyle:Code
7392 \begin_layout Plain Layout
7398 A string that indicates the width of the left margin on the screen, for
7400 \begin_inset Quotes eld
7404 \begin_inset Quotes erd
7410 \begin_layout Description
7411 \begin_inset Flex CharStyle:Code
7414 \begin_layout Plain Layout
7420 This command deletes an existing float.
7421 This is particularly useful when you want to suppress a float that has
7422 be defined in an input file.
7425 \begin_layout Description
7426 \begin_inset Flex CharStyle:Code
7429 \begin_layout Plain Layout
7435 This command deletes an existing style.
7436 This is particularly useful when you want to suppress a style that has
7437 be defined in an input file.
7440 \begin_layout Description
7441 \begin_inset Flex CharStyle:Code
7444 \begin_layout Plain Layout
7450 A string indicating what sort of output documents using this class will
7452 At present, the options are: `docbook', `latex', and `literate'.
7455 \begin_layout Description
7456 \begin_inset Flex CharStyle:Code
7459 \begin_layout Plain Layout
7470 \begin_inset Flex CharStyle:Code
7473 \begin_layout Plain Layout
7484 \begin_inset Flex CharStyle:Code
7487 \begin_layout Plain Layout
7494 \begin_inset Flex CharStyle:Code
7497 \begin_layout Plain Layout
7503 ] The class default pagestyle.
7504 Can be changed in the
7505 \begin_inset Flex CharStyle:MenuItem
7508 \begin_layout Plain Layout
7509 Document\SpecialChar \menuseparator
7518 \begin_layout Description
7519 \begin_inset Flex CharStyle:Code
7522 \begin_layout Plain Layout
7528 Sets the preamble for the LaTeX document.
7529 Note that this will completely override any prior
7530 \begin_inset Flex CharStyle:Code
7533 \begin_layout Plain Layout
7540 \begin_inset Flex CharStyle:Code
7543 \begin_layout Plain Layout
7551 \begin_inset Quotes eld
7555 \begin_inset Flex CharStyle:Code
7558 \begin_layout Plain Layout
7565 \begin_inset Quotes erd
7571 \begin_layout Description
7572 \begin_inset Flex CharStyle:Code
7575 \begin_layout Plain Layout
7582 \begin_inset Flex CharStyle:Code
7585 \begin_layout Plain Layout
7592 \begin_inset Flex CharStyle:Code
7595 \begin_layout Plain Layout
7604 \begin_inset Flex CharStyle:Code
7607 \begin_layout Plain Layout
7613 ] Whether the class already provides the feature
7614 \begin_inset Flex CharStyle:Code
7617 \begin_layout Plain Layout
7624 A feature is in general the name of a package (
7625 \begin_inset Flex CharStyle:Code
7628 \begin_layout Plain Layout
7635 \begin_inset Flex CharStyle:Code
7638 \begin_layout Plain Layout
7644 , \SpecialChar \ldots{}
7646 \begin_inset Flex CharStyle:Code
7649 \begin_layout Plain Layout
7656 \begin_inset Flex CharStyle:Code
7659 \begin_layout Plain Layout
7665 ,\SpecialChar \ldots{}
7666 ); the complete list of supported features is unfortunately not documented
7667 outside the LyX source code---but see
7668 \begin_inset Flex CharStyle:Code
7671 \begin_layout Plain Layout
7677 if you're interested.
7679 \begin_inset Flex CharStyle:MenuItem
7682 \begin_layout Plain Layout
7687 elp\SpecialChar \menuseparator
7697 also gives an overview of the supported packages.
7700 \begin_layout Description
7701 \begin_inset Flex CharStyle:Code
7704 \begin_layout Plain Layout
7711 \begin_inset Flex CharStyle:Code
7714 \begin_layout Plain Layout
7720 ] Indicates that this layout provides the functionality of the module mentioned,
7721 which should be specified by filename, which should be specified by filename
7723 \begin_inset Flex CharStyle:Code
7726 \begin_layout Plain Layout
7733 This will typically be used if the layout includes the module directly,
7734 rather than using the
7735 \begin_inset Flex CharStyle:Code
7738 \begin_layout Plain Layout
7744 tag to indicate that it ought to be used.
7745 It could be used in a module that that provided an alternate implementation
7746 of the same functionality.
7749 \begin_layout Description
7750 \begin_inset Flex CharStyle:Code
7753 \begin_layout Plain Layout
7760 \begin_inset Flex CharStyle:Code
7763 \begin_layout Plain Layout
7769 ] Whether the class requires the feature
7770 \begin_inset Flex CharStyle:Code
7773 \begin_layout Plain Layout
7780 Multiple features must be separated by commas.
7781 Note that you can only request supported features.
7784 \begin_layout Description
7785 \begin_inset Flex CharStyle:Code
7788 \begin_layout Plain Layout
7794 A string that indicates the width of the right margin on the screen, for
7796 \begin_inset Quotes eld
7800 \begin_inset Quotes erd
7806 \begin_layout Description
7807 \begin_inset Flex CharStyle:Code
7810 \begin_layout Plain Layout
7816 Sets which divisions get numbered.
7818 \begin_inset Flex CharStyle:Code
7821 \begin_layout Plain Layout
7830 \begin_layout Description
7831 \begin_inset Flex CharStyle:Code
7834 \begin_layout Plain Layout
7843 \begin_inset Flex CharStyle:Code
7846 \begin_layout Plain Layout
7857 \begin_inset Flex CharStyle:Code
7860 \begin_layout Plain Layout
7866 ] Whether the class-default should be printing on one or both sides of the
7868 Can be changed in the
7869 \begin_inset Flex CharStyle:MenuItem
7872 \begin_layout Plain Layout
7873 Document\SpecialChar \menuseparator
7882 \begin_layout Description
7883 \begin_inset Flex CharStyle:Code
7886 \begin_layout Plain Layout
7892 This sequence defines a new paragraph style.
7893 If the style already exists, it will redefine some of its parameters instead.
7895 \begin_inset space ~
7899 \begin_inset CommandInset ref
7901 reference "sec:style"
7907 \begin_inset Quotes eld
7911 \begin_inset Flex CharStyle:Code
7914 \begin_layout Plain Layout
7921 \begin_inset Quotes erd
7927 \begin_layout Description
7928 \begin_inset Flex CharStyle:Code
7931 \begin_layout Plain Layout
7938 \begin_inset Flex CharStyle:Code
7941 \begin_layout Plain Layout
7947 ] The name of the command or environment to be used with
7948 \begin_inset Flex CharStyle:Code
7951 \begin_layout Plain Layout
7960 \begin_layout Description
7961 \begin_inset Flex CharStyle:Code
7964 \begin_layout Plain Layout
7971 \begin_inset Flex CharStyle:Code
7974 \begin_layout Plain Layout
7983 \begin_inset Flex CharStyle:Code
7986 \begin_layout Plain Layout
7992 ] Indicates what kind of markup is used to define the title of a document.
7994 \begin_inset Flex CharStyle:Code
7997 \begin_layout Plain Layout
8003 means that the macro with name
8004 \begin_inset Flex CharStyle:Code
8007 \begin_layout Plain Layout
8013 will be inserted after the last layout which has
8014 \begin_inset Quotes eld
8018 \begin_inset Flex CharStyle:Code
8021 \begin_layout Plain Layout
8028 \begin_inset Quotes erd
8033 \begin_inset Flex CharStyle:Code
8036 \begin_layout Plain Layout
8042 corresponds to the case where the block of paragraphs which have
8043 \begin_inset Quotes eld
8047 \begin_inset Flex CharStyle:Code
8050 \begin_layout Plain Layout
8057 \begin_inset Quotes erd
8060 should be enclosed into the
8061 \begin_inset Flex CharStyle:Code
8064 \begin_layout Plain Layout
8073 \begin_layout Description
8074 \begin_inset Flex CharStyle:Code
8077 \begin_layout Plain Layout
8083 Sets which divisions are included in the table of contents.
8085 \begin_inset Flex CharStyle:Code
8088 \begin_layout Plain Layout
8097 \begin_layout Subsection
8098 \begin_inset Flex CharStyle:Code
8101 \begin_layout Plain Layout
8110 \begin_layout Standard
8111 \begin_inset CommandInset label
8113 name "sec:classoptions"
8118 \begin_inset Flex CharStyle:Code
8121 \begin_layout Plain Layout
8127 section can contain the following entries:
8130 \begin_layout Description
8131 \begin_inset Flex CharStyle:Code
8134 \begin_layout Plain Layout
8141 \begin_inset Flex CharStyle:Code
8144 \begin_layout Plain Layout
8150 ] The list of available font sizes for the document's main font, separated
8152 \begin_inset Quotes eld
8156 \begin_inset Flex CharStyle:Code
8159 \begin_layout Plain Layout
8166 \begin_inset Quotes erd
8172 \begin_layout Description
8173 \begin_inset Flex CharStyle:Code
8176 \begin_layout Plain Layout
8182 Used to set the DTD line with XML-based output classes.
8184 \begin_inset space \thinspace{}
8188 \begin_inset Quotes eld
8191 -//OASIS//DTD DocBook V4.2//EN
8192 \begin_inset Quotes erd
8198 \begin_layout Description
8199 \begin_inset Flex CharStyle:Code
8202 \begin_layout Plain Layout
8209 \begin_inset Flex CharStyle:Code
8212 \begin_layout Plain Layout
8213 string="empty|plain|headings|fancy"
8218 ] The list of available page styles, separated by
8219 \begin_inset Quotes eld
8223 \begin_inset Flex CharStyle:Code
8226 \begin_layout Plain Layout
8233 \begin_inset Quotes erd
8239 \begin_layout Description
8240 \begin_inset Flex CharStyle:Code
8243 \begin_layout Plain Layout
8250 \begin_inset Flex CharStyle:Code
8253 \begin_layout Plain Layout
8259 ] Some document class options, separated by a comma, that will be added
8260 to the optional part of the
8261 \begin_inset Flex CharStyle:Code
8264 \begin_layout Plain Layout
8275 \begin_layout Standard
8277 \begin_inset Flex CharStyle:Code
8280 \begin_layout Plain Layout
8286 section must end with
8287 \begin_inset Quotes eld
8291 \begin_inset Flex CharStyle:Code
8294 \begin_layout Plain Layout
8301 \begin_inset Quotes erd
8307 \begin_layout Subsection
8311 \begin_layout Standard
8312 \begin_inset CommandInset label
8318 A paragraph style description looks like this:
8322 \begin_layout Plain Layout
8323 Note that this will either define a new layout or modify an existing one.
8331 \begin_layout LyX-Code
8338 \begin_layout LyX-Code
8342 \begin_layout LyX-Code
8346 \begin_layout Standard
8347 where the following commands are allowed:
8350 \begin_layout Description
8351 \begin_inset Flex CharStyle:Code
8354 \begin_layout Plain Layout
8361 \begin_inset Flex CharStyle:Code
8364 \begin_layout Plain Layout
8369 , left, right, center
8374 ] Paragraph alignment.
8377 \begin_layout Description
8378 \begin_inset Flex CharStyle:Code
8381 \begin_layout Plain Layout
8388 \begin_inset Flex CharStyle:Code
8391 \begin_layout Plain Layout
8396 , left, right, center
8401 ] A comma separated list of permitted alignments.
8402 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8404 For example a right-aligned or centered enumeration isn't possible.)
8407 \begin_layout Description
8408 \begin_inset Flex CharStyle:Code
8411 \begin_layout Plain Layout
8418 \begin_inset Flex CharStyle:Code
8421 \begin_layout Plain Layout
8431 \begin_layout Plain Layout
8432 Note that a `float' here is a real number, such as: 1.5.
8437 The vertical space with which the last of a chain of paragraphs with this
8438 layout is separated from the following paragraph.
8439 If the next paragraph has another layout, the separations are not simply
8440 added, but the maximum is taken.
8443 \begin_layout Description
8444 \begin_inset Flex CharStyle:Code
8447 \begin_layout Plain Layout
8454 \begin_inset Flex CharStyle:Code
8457 \begin_layout Plain Layout
8463 The category for this style.
8464 This is used to group related styles in the Layout combobox on the toolbar.
8465 Any string can be used, but you may want to use existing categories with
8470 \begin_layout Description
8471 \begin_inset Flex CharStyle:Code
8474 \begin_layout Plain Layout
8480 Depth of XML command.
8481 Used only with XML-type formats.
8484 \begin_layout Description
8485 \begin_inset Flex CharStyle:Code
8488 \begin_layout Plain Layout
8495 \begin_inset CommandInset label
8497 name "des:CopyStyle"
8502 \begin_inset Flex CharStyle:Code
8505 \begin_layout Plain Layout
8511 Copies all the features of an existing style into the current one.
8515 \begin_layout Description
8516 \begin_inset Flex CharStyle:Code
8519 \begin_layout Plain Layout
8525 The name of a style whose preamble should be output
8530 This allows to ensure some ordering of the preamble snippets when macros
8531 definitions depend on one another.
8535 \begin_layout Plain Layout
8536 Note that, besides that functionality, there is no way to ensure any ordering
8538 The ordering that you see in a given version of LyX may change without
8539 warning in later versions.
8547 \begin_layout Description
8548 \begin_inset Flex CharStyle:Code
8551 \begin_layout Plain Layout
8558 \begin_inset Flex CharStyle:Code
8561 \begin_layout Plain Layout
8566 , Box, Filled_Box, Static
8571 ] The type of label that stands at the end of the paragraph (or sequence
8573 \begin_inset Flex CharStyle:Code
8576 \begin_layout Plain Layout
8583 \begin_inset Flex CharStyle:Code
8586 \begin_layout Plain Layout
8593 \begin_inset Flex CharStyle:Code
8596 \begin_layout Plain Layout
8603 \begin_inset Flex CharStyle:Code
8606 \begin_layout Plain Layout
8614 \begin_inset Flex CharStyle:Code
8617 \begin_layout Plain Layout
8624 \begin_inset Quotes eld
8628 \begin_inset Quotes erd
8632 \begin_inset Flex CharStyle:Code
8635 \begin_layout Plain Layout
8642 \begin_inset Flex CharStyle:Code
8645 \begin_layout Plain Layout
8646 \begin_inset space ~
8655 \begin_inset space ~
8658 black) square suitable for end of proof markers,
8659 \begin_inset Flex CharStyle:Code
8662 \begin_layout Plain Layout
8668 is an explicit text string.
8671 \begin_layout Description
8672 \begin_inset Flex CharStyle:Code
8675 \begin_layout Plain Layout
8682 \begin_inset Flex CharStyle:Code
8685 \begin_layout Plain Layout
8691 ] The string used for a label with a
8692 \begin_inset Flex CharStyle:Code
8695 \begin_layout Plain Layout
8702 \begin_inset Flex CharStyle:Code
8705 \begin_layout Plain Layout
8715 \begin_layout Description
8716 \begin_inset Flex CharStyle:Code
8719 \begin_layout Plain Layout
8726 \begin_inset Flex CharStyle:Code
8729 \begin_layout Plain Layout
8740 \begin_inset Flex CharStyle:Code
8743 \begin_layout Plain Layout
8752 \begin_layout Description
8753 \begin_inset Flex CharStyle:Code
8756 \begin_layout Plain Layout
8763 \begin_inset Flex CharStyle:Code
8766 \begin_layout Plain Layout
8776 ] With this parameter the
8777 \begin_inset Flex CharStyle:MenuItem
8780 \begin_layout Plain Layout
8787 \begin_inset Quotes eld
8790 Vertical space above
8791 \begin_inset Quotes erd
8795 \begin_inset Flex CharStyle:MenuItem
8798 \begin_layout Plain Layout
8799 Edit\SpecialChar \menuseparator
8801 \begin_inset space ~
8809 dialog can be set when initializing a paragraph with this style.
8813 \begin_layout Plain Layout
8816 Note from Jean-Marc:
8818 I'm not sure that this setting has much use, and it should probably be
8819 removed in later versions.
8827 \begin_layout Description
8828 \begin_inset Flex CharStyle:Code
8831 \begin_layout Plain Layout
8837 The font used for both the text body
8843 \begin_inset space ~
8847 \begin_inset CommandInset ref
8849 reference "sec:fonts"
8854 Note that defining this font automatically defines the
8855 \begin_inset Flex CharStyle:Code
8858 \begin_layout Plain Layout
8865 So you should define this one first if you also want to define
8866 \begin_inset Flex CharStyle:Code
8869 \begin_layout Plain Layout
8878 \begin_layout Description
8879 \begin_inset Flex CharStyle:Code
8882 \begin_layout Plain Layout
8889 \begin_inset CommandInset label
8891 name "des:FreeSpacing"
8898 \begin_inset Flex CharStyle:Code
8901 \begin_layout Plain Layout
8912 \begin_inset Flex CharStyle:Code
8915 \begin_layout Plain Layout
8921 ] Usually LyX doesn't allow you to insert more than one space between words,
8922 since a space is considered as the separation between two words, not a
8923 character or symbol of its own.
8924 This is a very fine thing but sometimes annoying, for example, when typing
8925 program code or plain LaTeX code.
8927 \begin_inset Flex CharStyle:Code
8930 \begin_layout Plain Layout
8937 Note that LyX will create protected blanks for the additional blanks when
8938 in another mode than LaTeX-mode.
8941 \begin_layout Description
8942 \begin_inset Flex CharStyle:Code
8945 \begin_layout Plain Layout
8951 [[FIXME]] (Used only with XML-type formats.)
8954 \begin_layout Description
8955 \begin_inset Flex CharStyle:Code
8958 \begin_layout Plain Layout
8965 \begin_inset Flex CharStyle:Code
8968 \begin_layout Plain Layout
8974 If 1, marks the layout as being part of a title block (see also the
8975 \begin_inset Flex CharStyle:Code
8978 \begin_layout Plain Layout
8985 \begin_inset Flex CharStyle:Code
8988 \begin_layout Plain Layout
8997 \begin_layout Description
8998 \begin_inset Flex CharStyle:Code
9001 \begin_layout Plain Layout
9008 \begin_inset Flex CharStyle:Code
9011 \begin_layout Plain Layout
9017 ] This provides extra space between paragraphs that have the same layout.
9018 If you put other layouts into an environment, each is separated with the
9020 \begin_inset Flex CharStyle:Code
9023 \begin_layout Plain Layout
9030 But the whole items of the environment are additionally separated with
9032 \begin_inset Flex CharStyle:Code
9035 \begin_layout Plain Layout
9047 \begin_layout Description
9048 \begin_inset Flex CharStyle:Code
9051 \begin_layout Plain Layout
9057 [[FIXME]] (Used only with XML-type formats.)
9060 \begin_layout Description
9061 \begin_inset Flex CharStyle:Code
9064 \begin_layout Plain Layout
9071 \begin_inset CommandInset label
9073 name "des:KeepEmpty"
9080 \begin_inset Flex CharStyle:Code
9083 \begin_layout Plain Layout
9094 \begin_inset Flex CharStyle:Code
9097 \begin_layout Plain Layout
9103 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9104 lead to empty LaTeX output.
9105 There are some cases where this could be desirable however: in a letter
9106 template, the required fields can be provided as empty fields, so that
9107 people do not forget them; in some special classes, a layout can be used
9108 as some kind of break, which does not contain actual text.
9111 \begin_layout Description
9112 \begin_inset Flex CharStyle:Code
9115 \begin_layout Plain Layout
9121 [float=0] The vertical space between the label and the text body.
9122 Only used for labels that are above the text body (
9123 \begin_inset Flex CharStyle:Code
9126 \begin_layout Plain Layout
9133 \begin_inset Flex CharStyle:Code
9136 \begin_layout Plain Layout
9137 Centered_Top_Environment
9145 \begin_layout Description
9146 \begin_inset Flex CharStyle:Code
9149 \begin_layout Plain Layout
9156 \begin_inset Flex CharStyle:Code
9159 \begin_layout Plain Layout
9166 \begin_inset Newline newline
9169 The name of the counter for automatic numbering (see Section
9170 \begin_inset CommandInset ref
9172 reference "sec:counter"
9177 This must be given if
9178 \begin_inset Flex CharStyle:Code
9181 \begin_layout Plain Layout
9188 \begin_inset Flex CharStyle:Code
9191 \begin_layout Plain Layout
9200 \begin_layout Description
9201 \begin_inset Flex CharStyle:Code
9204 \begin_layout Plain Layout
9210 The font used for the label.
9212 \begin_inset space ~
9216 \begin_inset CommandInset ref
9218 reference "sec:fonts"
9225 \begin_layout Description
9226 \begin_inset Flex CharStyle:Code
9229 \begin_layout Plain Layout
9235 Text that indicates how far a label should be indented.
9238 \begin_layout Description
9239 \begin_inset Flex CharStyle:Code
9242 \begin_layout Plain Layout
9249 \begin_inset Flex CharStyle:Code
9252 \begin_layout Plain Layout
9258 ] The horizontal space between the label and the text body.
9259 Only used for labels that are not above the text body.
9262 \begin_layout Description
9263 \begin_inset Flex CharStyle:Code
9266 \begin_layout Plain Layout
9273 \begin_inset Flex CharStyle:Code
9276 \begin_layout Plain Layout
9282 ] The string used for a label with a
9283 \begin_inset Flex CharStyle:Code
9286 \begin_layout Plain Layout
9294 \begin_inset Flex CharStyle:Code
9297 \begin_layout Plain Layout
9303 is set, this string can be contain the special formatting commands described
9305 \begin_inset CommandInset ref
9307 reference "sec:counter"
9315 \begin_layout Plain Layout
9316 For the sake of backwards compatibility, the string
9317 \begin_inset Flex CharStyle:Code
9320 \begin_layout Plain Layout
9330 will be replaced by the expanded
9331 \begin_inset Flex CharStyle:Code
9334 \begin_layout Plain Layout
9341 \begin_inset Flex CharStyle:Code
9344 \begin_layout Plain Layout
9353 This feature is now obsolete and should be replaced by the mechanisms of
9355 \begin_inset CommandInset ref
9357 reference "sec:counter"
9369 \begin_layout Description
9370 \begin_inset Flex CharStyle:Code
9373 \begin_layout Plain Layout
9380 \begin_inset Flex CharStyle:Code
9383 \begin_layout Plain Layout
9389 ] This is used inside the appendix instead of
9390 \begin_inset Flex CharStyle:Code
9393 \begin_layout Plain Layout
9401 \begin_inset Flex CharStyle:Code
9404 \begin_layout Plain Layout
9411 \begin_inset Flex CharStyle:Code
9414 \begin_layout Plain Layout
9423 \begin_layout Description
9424 \begin_inset Flex CharStyle:Code
9427 \begin_layout Plain Layout
9433 [FIXME] (Used only with XML-type formats.)
9436 \begin_layout Description
9437 \begin_inset Flex CharStyle:Code
9440 \begin_layout Plain Layout
9447 \begin_inset Flex CharStyle:Code
9450 \begin_layout Plain Layout
9455 , Manual, Static, Top_Environment,
9456 \begin_inset Newline newline
9459 Centered_Top_Environment, Sensitive, Counter
9465 \begin_inset Newline newline
9469 \begin_inset Flex CharStyle:Code
9472 \begin_layout Plain Layout
9478 means the label is the very first word (up to the first real blank).
9482 \begin_layout Plain Layout
9483 Use protected spaces if you want more than one word as the label.
9489 \begin_inset Flex CharStyle:Code
9492 \begin_layout Plain Layout
9498 means it is defined in the layout (see
9499 \begin_inset Flex CharStyle:Code
9502 \begin_layout Plain Layout
9510 \begin_inset Flex CharStyle:Code
9513 \begin_layout Plain Layout
9520 \begin_inset Flex CharStyle:Code
9523 \begin_layout Plain Layout
9524 Centered_Top_Environment
9529 are special cases of
9530 \begin_inset Flex CharStyle:Code
9533 \begin_layout Plain Layout
9540 The label will be printed above the paragraph, but only at the top of an
9541 environment or the top of a chain of paragraphs with this layout.
9542 Usage is for example the
9543 \begin_inset Flex CharStyle:MenuItem
9546 \begin_layout Plain Layout
9553 \begin_inset Flex CharStyle:MenuItem
9556 \begin_layout Plain Layout
9563 This is also the case for
9564 \begin_inset Flex CharStyle:Code
9567 \begin_layout Plain Layout
9573 labels with latex type
9574 \begin_inset Flex CharStyle:Code
9577 \begin_layout Plain Layout
9583 , in order to make layouts for theorems work correctly.
9585 \begin_inset Flex CharStyle:Code
9588 \begin_layout Plain Layout
9594 is a special case for the caption-labels
9595 \begin_inset Quotes eld
9599 \begin_inset Quotes erd
9603 \begin_inset Quotes eld
9607 \begin_inset Quotes erd
9612 \begin_inset Flex CharStyle:Code
9615 \begin_layout Plain Layout
9621 means the (hardcoded) label string depends on the kind of float.
9623 \begin_inset Flex CharStyle:Code
9626 \begin_layout Plain Layout
9632 label type defines automatically numbered labels.
9634 \begin_inset CommandInset ref
9636 reference "sec:counter"
9643 \begin_layout Description
9644 \begin_inset Flex CharStyle:Code
9647 \begin_layout Plain Layout
9653 The name of the corresponding LaTeX stuff.
9654 Either the environment or command name.
9657 \begin_layout Description
9658 \begin_inset Flex CharStyle:Code
9661 \begin_layout Plain Layout
9667 An optional parameter for the corresponding
9668 \begin_inset Flex CharStyle:Code
9671 \begin_layout Plain Layout
9678 This parameter cannot be changed from within LyX.
9681 \begin_layout Description
9682 \begin_inset Flex CharStyle:Code
9685 \begin_layout Plain Layout
9692 \begin_inset CommandInset label
9694 name "des:LatexType"
9699 \begin_inset Flex CharStyle:Code
9702 \begin_layout Plain Layout
9707 , Command, Environment, Item_Environment,
9713 \begin_inset Flex CharStyle:Code
9716 \begin_layout Plain Layout
9722 ] How the layout should be translated into LaTeX.
9724 \begin_inset Flex CharStyle:Code
9727 \begin_layout Plain Layout
9733 means nothing special.
9735 \begin_inset Flex CharStyle:Code
9738 \begin_layout Plain Layout
9745 \begin_inset Flex CharStyle:Code
9748 \begin_layout Plain Layout
9755 {\SpecialChar \ldots{}
9762 \begin_inset Flex CharStyle:Code
9765 \begin_layout Plain Layout
9772 \begin_inset Flex CharStyle:Code
9775 \begin_layout Plain Layout
9782 }\SpecialChar \ldots{}
9796 \begin_inset Flex CharStyle:Code
9799 \begin_layout Plain Layout
9806 \begin_inset Flex CharStyle:Code
9809 \begin_layout Plain Layout
9816 \begin_inset Flex CharStyle:Code
9819 \begin_layout Plain Layout
9827 is generated for each paragraph of this environment.
9829 \begin_inset Flex CharStyle:Code
9832 \begin_layout Plain Layout
9839 \begin_inset Flex CharStyle:Code
9842 \begin_layout Plain Layout
9849 \begin_inset Flex CharStyle:Code
9852 \begin_layout Plain Layout
9858 is passed as an argument to the environment.
9860 \begin_inset Flex CharStyle:Code
9863 \begin_layout Plain Layout
9869 can be defined in the
9870 \begin_inset Flex CharStyle:MenuItem
9873 \begin_layout Plain Layout
9878 ayout\SpecialChar \menuseparator
9890 \begin_inset Flex CharStyle:Code
9893 \begin_layout Plain Layout
9901 is perhaps a bit misleading, since these rules apply to SGML classes, too.
9902 Visit the SGML class files for specific examples.
9905 \begin_layout Standard
9906 Putting the last few things together, the LaTeX output will be either:
9909 \begin_layout LyX-Code
9912 latexname[latexparam]{\SpecialChar \ldots{}
9916 \begin_layout Standard
9920 \begin_layout LyX-Code
9923 begin{latexname}[latexparam] \SpecialChar \ldots{}
9929 \begin_layout Standard
9930 depending upon the LaTex type.
9933 \begin_layout Description
9934 \begin_inset Flex CharStyle:Code
9937 \begin_layout Plain Layout
9944 \begin_inset Flex CharStyle:Code
9947 \begin_layout Plain Layout
9953 ] If you put layouts into environments, the leftmargins are not simply added,
9954 but added with a factor
9955 \begin_inset Formula $\frac{4}{depth+4}$
9959 Note that this parameter is also used when the margin is defined as
9960 \begin_inset Flex CharStyle:Code
9963 \begin_layout Plain Layout
9970 \begin_inset Flex CharStyle:Code
9973 \begin_layout Plain Layout
9980 Then it is added to the manual or dynamic margin.
9982 \begin_inset Newline newline
9985 The argument is passed as a string.
9987 \begin_inset Quotes eld
9991 \begin_inset Flex CharStyle:Code
9994 \begin_layout Plain Layout
10001 \begin_inset Quotes erd
10004 means that the paragraph is indented with the width of
10005 \begin_inset Quotes eld
10009 \begin_inset Flex CharStyle:Code
10012 \begin_layout Plain Layout
10019 \begin_inset Quotes erd
10022 in the normal font.
10023 You can get a negative width by prefixing the string with
10024 \begin_inset Quotes eld
10028 \begin_inset Flex CharStyle:Code
10031 \begin_layout Plain Layout
10038 \begin_inset Quotes erd
10042 This way was chosen so that the look is the same with each used screen
10047 \begin_layout Description
10048 \begin_inset Flex CharStyle:Code
10051 \begin_layout Plain Layout
10058 \begin_inset Flex CharStyle:Code
10061 \begin_layout Plain Layout
10066 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10072 \begin_inset Newline newline
10075 The kind of margin that the layout has on the left side.
10077 \begin_inset Flex CharStyle:Code
10080 \begin_layout Plain Layout
10086 just means a fixed margin.
10088 \begin_inset Flex CharStyle:Code
10091 \begin_layout Plain Layout
10097 means that the left margin depends on the string entered in the
10098 \begin_inset Flex CharStyle:MenuItem
10101 \begin_layout Plain Layout
10102 Edit\SpecialChar \menuseparator
10104 \begin_inset space ~
10113 This is used to typeset nice lists without tabulators.
10115 \begin_inset Flex CharStyle:Code
10118 \begin_layout Plain Layout
10124 means that the margin depends on the size of the label.
10125 This is used for automatic enumerated headlines.
10126 It is obvious that the headline
10127 \begin_inset Quotes eld
10130 5.4.3.2.1 Very long headline
10131 \begin_inset Quotes erd
10134 must have a wider left margin (as wide as
10135 \begin_inset Quotes eld
10139 \begin_inset Quotes erd
10142 plus the space) than
10143 \begin_inset Quotes eld
10146 3.2 Very long headline
10147 \begin_inset Quotes erd
10151 \begin_inset Quotes eld
10155 \begin_inset Quotes erd
10158 are not able to do this.
10160 \begin_inset Flex CharStyle:Code
10163 \begin_layout Plain Layout
10169 is similar, but only the very first row of the paragraph is dynamic, while
10170 the others are static; this is used, for example, for descriptions.
10172 \begin_inset Flex CharStyle:Code
10175 \begin_layout Plain Layout
10181 means the margin is chosen in a way that the longest row of this paragraph
10182 fits to the right margin.
10183 This is used to typeset an address on the right edge of the page.
10186 \begin_layout Description
10187 \begin_inset Flex CharStyle:Code
10190 \begin_layout Plain Layout
10197 \begin_inset Flex CharStyle:Code
10200 \begin_layout Plain Layout
10209 \begin_inset Flex CharStyle:Code
10212 \begin_layout Plain Layout
10218 ] Whether fragile commands in this layout should be
10219 \begin_inset Flex CharStyle:Code
10222 \begin_layout Plain Layout
10235 whether this command should itself be protected.)
10238 \begin_layout Description
10239 \begin_inset Flex CharStyle:Code
10242 \begin_layout Plain Layout
10249 \begin_inset Flex CharStyle:Code
10252 \begin_layout Plain Layout
10259 \begin_inset Flex CharStyle:Code
10262 \begin_layout Plain Layout
10270 ] Whether newlines are translated into LaTeX newlines (
10271 \begin_inset Flex CharStyle:Code
10274 \begin_layout Plain Layout
10285 The translation can be switched off to allow more comfortable LaTeX editing
10289 \begin_layout Description
10290 \begin_inset Flex CharStyle:Code
10293 \begin_layout Plain Layout
10300 \begin_inset Flex CharStyle:Code
10303 \begin_layout Plain Layout
10310 \begin_inset Flex CharStyle:Code
10313 \begin_layout Plain Layout
10321 ] Whether the following Paragraph is allowed to indent its very first row.
10323 \begin_inset Flex CharStyle:Code
10326 \begin_layout Plain Layout
10332 means that it is not allowed to do so;
10333 \begin_inset Flex CharStyle:Code
10336 \begin_layout Plain Layout
10342 means it could do so if it wants to.
10345 \begin_layout Description
10346 \begin_inset Flex CharStyle:Code
10349 \begin_layout Plain Layout
10355 Name of a layout that has replaced this layout.
10356 This is used to rename a layout, while keeping backward compatibility.
10359 \begin_layout Description
10360 \begin_inset Flex CharStyle:Code
10363 \begin_layout Plain Layout
10370 \begin_inset Flex CharStyle:Code
10373 \begin_layout Plain Layout
10379 ] The number of optional arguments that can be used with this layout.
10380 This is useful for things like section headings, and only makes sense with
10384 \begin_layout Description
10385 \begin_inset Flex CharStyle:Code
10388 \begin_layout Plain Layout
10395 \begin_inset Flex CharStyle:Code
10398 \begin_layout Plain Layout
10404 ] The indent of the very first line of a paragraph.
10406 \begin_inset Flex CharStyle:Code
10409 \begin_layout Plain Layout
10415 will be fixed for a certain layout.
10416 The exception is Standard layout, since the indentation of a Standard layout
10417 paragraph can be prohibited with
10418 \begin_inset Flex CharStyle:Code
10421 \begin_layout Plain Layout
10428 Also, Standard layout paragraphs inside environments use the
10429 \begin_inset Flex CharStyle:Code
10432 \begin_layout Plain Layout
10438 of the environment, not their native one.
10439 For example, Standard paragraphs inside an enumeration are not indented.
10442 \begin_layout Description
10443 \begin_inset Flex CharStyle:Code
10446 \begin_layout Plain Layout
10453 \begin_inset Flex CharStyle:Code
10456 \begin_layout Plain Layout
10462 ] The vertical space between two paragraphs of this layout.
10465 \begin_layout Description
10466 \begin_inset Flex CharStyle:Code
10469 \begin_layout Plain Layout
10476 \begin_inset Flex CharStyle:Code
10479 \begin_layout Plain Layout
10485 ] LyX allows the user to choose either
10486 \begin_inset Quotes eld
10490 \begin_inset Quotes erd
10494 \begin_inset Quotes eld
10498 \begin_inset Quotes erd
10501 to typeset a document.
10503 \begin_inset Quotes eld
10507 \begin_inset Quotes erd
10510 is chosen, this value is completely ignored.
10512 \begin_inset Quotes eld
10516 \begin_inset Quotes erd
10519 is chosen, the parindent of a LaTeXtype
10520 \begin_inset Quotes eld
10524 \begin_inset Quotes erd
10527 layout is ignored and all paragraphs are separated by this parskip argument.
10528 The vertical space is calculated with
10529 \begin_inset Flex CharStyle:Code
10532 \begin_layout Plain Layout
10534 \begin_inset space ~
10543 \begin_inset Flex CharStyle:Code
10546 \begin_layout Plain Layout
10552 is the height of a row with the normal font.
10553 This way, the look stays the same with different screen fonts.
10556 \begin_layout Description
10557 \begin_inset Flex CharStyle:Code
10560 \begin_layout Plain Layout
10567 \begin_inset CommandInset label
10569 name "des:PathThru"
10576 \begin_inset Flex CharStyle:Code
10579 \begin_layout Plain Layout
10590 \begin_inset Flex CharStyle:Code
10593 \begin_layout Plain Layout
10599 ] Whether the contents of this paragraph should be output in raw form, meaning
10600 without special translations that LaTeX would require.
10603 \begin_layout Description
10604 \begin_inset Flex CharStyle:Code
10607 \begin_layout Plain Layout
10614 \begin_inset CommandInset label
10616 name "des:Preamble"
10620 Information to be included in the LaTeX preamable when this style is used.
10621 Used to define macros, load packages, etc., required by this particular
10624 \begin_inset Quotes eld
10628 \begin_inset Flex CharStyle:Code
10631 \begin_layout Plain Layout
10638 \begin_inset Quotes erd
10644 \begin_layout Description
10645 \begin_inset Flex CharStyle:Code
10648 \begin_layout Plain Layout
10655 \begin_inset Flex CharStyle:Code
10658 \begin_layout Plain Layout
10665 \begin_inset CommandInset label
10667 name "des:Requires"
10671 Whether the layout requires the feature
10672 \begin_inset Flex CharStyle:Code
10675 \begin_layout Plain Layout
10682 See the description of
10683 \begin_inset Flex CharStyle:Code
10686 \begin_layout Plain Layout
10693 \begin_inset CommandInset ref
10694 LatexCommand pageref
10695 reference "des:FreeSpacing"
10699 ) for information on `features'.
10703 \begin_layout Description
10704 \begin_inset Flex CharStyle:Code
10707 \begin_layout Plain Layout
10714 \begin_inset Flex CharStyle:Code
10717 \begin_layout Plain Layout
10724 \begin_inset Flex CharStyle:Code
10727 \begin_layout Plain Layout
10736 \begin_layout Description
10737 \begin_inset Flex CharStyle:Code
10740 \begin_layout Plain Layout
10747 \begin_inset Flex CharStyle:Code
10750 \begin_layout Plain Layout
10755 , onehalf, double, other
10764 ] This defines what the default spacing should be in the layout.
10766 \begin_inset Flex CharStyle:Code
10769 \begin_layout Plain Layout
10776 \begin_inset Flex CharStyle:Code
10779 \begin_layout Plain Layout
10786 \begin_inset Flex CharStyle:Code
10789 \begin_layout Plain Layout
10795 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
10796 If you specify the argument
10797 \begin_inset Flex CharStyle:Code
10800 \begin_layout Plain Layout
10806 , then you should also provide a numerical argument which will be the actual
10808 Note that, contrary to other parameters,
10809 \begin_inset Flex CharStyle:Code
10812 \begin_layout Plain Layout
10818 implies the generation of specific LaTeX code, using the package
10821 \begin_inset Flex CharStyle:Code
10824 \begin_layout Plain Layout
10833 \begin_layout Description
10834 \begin_inset Flex CharStyle:Code
10837 \begin_layout Plain Layout
10843 The font used for the text body .
10845 \begin_inset CommandInset ref
10847 reference "sec:fonts"
10854 \begin_layout Description
10855 \begin_inset Flex CharStyle:Code
10858 \begin_layout Plain Layout
10866 The level of the style in the table of contents.
10867 This is used for automatic numbering of section headings.
10870 \begin_layout Description
10871 \begin_inset Flex CharStyle:Code
10874 \begin_layout Plain Layout
10881 \begin_inset Flex CharStyle:Code
10884 \begin_layout Plain Layout
10890 ] The vertical space with which the very first of a chain of paragraphs
10891 with this layout is separated from the previous paragraph.
10892 If the previous paragraph has another layout, the separations are not simply
10893 added, but the maximum is taken.
10896 \begin_layout Subsection
10900 \begin_layout Standard
10901 \begin_inset CommandInset label
10907 Since version 1.3.0 of LyX, it is has been both possible and necessary to
10908 define the floats (
10909 \begin_inset Flex CharStyle:MenuItem
10912 \begin_layout Plain Layout
10919 \begin_inset Flex CharStyle:MenuItem
10922 \begin_layout Plain Layout
10928 , \SpecialChar \ldots{}
10929 ) in the text class itself.
10930 Standard floats are included in the file
10931 \begin_inset Flex CharStyle:Code
10934 \begin_layout Plain Layout
10940 , so you may have to do no more than add
10943 \begin_layout LyX-Code
10944 Input stdfloats.inc
10947 \begin_layout Standard
10948 to your layout file.
10949 If you want to implement a text class that proposes some other float types
10950 (like the AGU class bundled with LyX), the information below will hopefully
10954 \begin_layout Description
10955 \begin_inset Flex CharStyle:Code
10958 \begin_layout Plain Layout
10965 \begin_inset Flex CharStyle:Code
10968 \begin_layout Plain Layout
10975 \begin_inset Quotes erd
10979 \begin_inset Quotes erd
10982 ] The file name extension of an auxiliary file for the list of figures (or
10984 LaTeX writes the captions to this file.
10987 \begin_layout Description
10988 \begin_inset Flex CharStyle:Code
10991 \begin_layout Plain Layout
10998 \begin_inset Flex CharStyle:Code
11001 \begin_layout Plain Layout
11008 \begin_inset Quotes erd
11012 \begin_inset Quotes erd
11015 ] The string that will be used in the menus and also for the caption.
11018 \begin_layout Description
11019 \begin_inset Flex CharStyle:Code
11022 \begin_layout Plain Layout
11029 \begin_inset Flex CharStyle:Code
11032 \begin_layout Plain Layout
11041 \begin_inset Flex CharStyle:Code
11044 \begin_layout Plain Layout
11051 \begin_inset Flex CharStyle:Code
11054 \begin_layout Plain Layout
11060 if the float is already defined by the LaTeX document class.
11062 \begin_inset Flex CharStyle:Code
11065 \begin_layout Plain Layout
11071 , the float will be defined using the LaTeX package
11072 \begin_inset Flex CharStyle:Code
11075 \begin_layout Plain Layout
11084 \begin_layout Description
11085 \begin_inset Flex CharStyle:Code
11088 \begin_layout Plain Layout
11095 \begin_inset Flex CharStyle:Code
11098 \begin_layout Plain Layout
11105 \begin_inset Quotes erd
11109 \begin_inset Quotes erd
11112 ] The heading used for the list of floats.
11115 \begin_layout Description
11116 \begin_inset Flex CharStyle:Code
11119 \begin_layout Plain Layout
11126 \begin_inset Flex CharStyle:Code
11129 \begin_layout Plain Layout
11136 \begin_inset Quotes erd
11140 \begin_inset Quotes erd
11143 ] This (optional) argument determines whether floats of this class will
11144 be numbered within some sectional unit of the document.
11145 For example, if within is equal to
11146 \begin_inset Flex CharStyle:Code
11149 \begin_layout Plain Layout
11155 , the floats will be numbered within chapters.
11159 \begin_layout Description
11160 \begin_inset Flex CharStyle:Code
11163 \begin_layout Plain Layout
11170 \begin_inset Flex CharStyle:Code
11173 \begin_layout Plain Layout
11180 \begin_inset Quotes erd
11184 \begin_inset Quotes erd
11187 ] The default placement for the given class of floats.
11188 The string should be as in standard LaTeX:
11189 \begin_inset Flex CharStyle:Code
11192 \begin_layout Plain Layout
11199 \begin_inset Flex CharStyle:Code
11202 \begin_layout Plain Layout
11209 \begin_inset Flex CharStyle:Code
11212 \begin_layout Plain Layout
11219 \begin_inset Flex CharStyle:Code
11222 \begin_layout Plain Layout
11228 for top, bottom, page, and here, respectively.
11232 \begin_layout Plain Layout
11233 Note that the order of these letters in the string is irrelevant, like in
11239 On top of that there is a new type,
11240 \begin_inset Flex CharStyle:Code
11243 \begin_layout Plain Layout
11249 , which does not really correspond to a float, since it means: put it
11250 \begin_inset Quotes eld
11254 \begin_inset Quotes erd
11258 Note however that the
11259 \begin_inset Flex CharStyle:Code
11262 \begin_layout Plain Layout
11268 specifier is special and, because of implementation details, cannot be
11269 used in non-builtin float types.
11270 If you do not understand what this means, just use
11271 \begin_inset Quotes eld
11275 \begin_inset Flex CharStyle:Code
11278 \begin_layout Plain Layout
11285 \begin_inset Quotes erd
11291 \begin_layout Description
11292 \begin_inset Flex CharStyle:Code
11295 \begin_layout Plain Layout
11302 \begin_inset Flex CharStyle:Code
11305 \begin_layout Plain Layout
11312 \begin_inset Quotes erd
11316 \begin_inset Quotes erd
11319 ] The style used when defining the float using
11320 \begin_inset Flex CharStyle:Code
11323 \begin_layout Plain Layout
11334 \begin_layout Description
11335 \begin_inset Flex CharStyle:Code
11338 \begin_layout Plain Layout
11345 \begin_inset Flex CharStyle:Code
11348 \begin_layout Plain Layout
11355 \begin_inset Quotes erd
11359 \begin_inset Quotes erd
11363 \begin_inset Quotes eld
11367 \begin_inset Quotes erd
11370 of the new class of floats, like program or algorithm.
11371 After the appropriate
11372 \begin_inset Flex CharStyle:Code
11375 \begin_layout Plain Layout
11384 \begin_inset Flex CharStyle:Code
11387 \begin_layout Plain Layout
11396 \begin_inset Flex CharStyle:Code
11399 \begin_layout Plain Layout
11410 \begin_layout Standard
11411 Note that defining a float with type
11412 \begin_inset Flex CharStyle:Code
11415 \begin_layout Plain Layout
11423 automatically defines the corresponding counter with name
11424 \begin_inset Flex CharStyle:Code
11427 \begin_layout Plain Layout
11438 \begin_layout Subsection
11439 Flex insets and InsetLayout
11442 \begin_layout Standard
11443 \begin_inset CommandInset label
11445 name "sec:charstyle"
11449 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11450 these are called Flex insets.
11454 \begin_layout Standard
11455 Flex insets come in three different kinds:
11458 \begin_layout Itemize
11460 \begin_inset Flex CharStyle:Code
11463 \begin_layout Plain Layout
11469 ): These define semantic markup corresponding to such LaTeX commands as
11471 \begin_inset Flex CharStyle:Code
11474 \begin_layout Plain Layout
11483 \begin_inset Flex CharStyle:Code
11486 \begin_layout Plain Layout
11497 \begin_layout Itemize
11499 \begin_inset Flex CharStyle:Code
11502 \begin_layout Plain Layout
11508 ): These can be used to define custom collapsable insets, similar to ERT,
11509 footnote, and the like.
11510 An obvious example is an endnote inset, which is defined in the
11511 \begin_inset Flex CharStyle:Code
11514 \begin_layout Plain Layout
11523 \begin_layout Itemize
11525 \begin_inset Flex CharStyle:Code
11528 \begin_layout Plain Layout
11534 ): For use with DocBook classes.
11537 \begin_layout Standard
11538 Flex insets are defined using the
11539 \begin_inset Flex CharStyle:Code
11542 \begin_layout Plain Layout
11548 tag, which shall be explained in a moment.
11551 \begin_layout Standard
11553 \begin_inset Flex CharStyle:Code
11556 \begin_layout Plain Layout
11562 tag also serves another function: It can be used to customize the general
11563 layout of many different types of insets.
11565 \begin_inset Flex CharStyle:Code
11568 \begin_layout Plain Layout
11574 can be used to customize the layout parameters for footnotes, marginal
11575 notes, note insets, ERT insets, branches, listings, indexes, boxes, tables,
11576 algorithms, URLs, and optional arguments, as well as to define Flex insets.
11579 \begin_layout Standard
11581 \begin_inset Flex CharStyle:Code
11584 \begin_layout Plain Layout
11590 definition must begin with a line of the form:
11593 \begin_layout LyX-Code
11597 \begin_layout Standard
11599 \begin_inset Flex CharStyle:Code
11602 \begin_layout Plain Layout
11608 indicates the inset whose layout is being defined, and here there are two
11612 \begin_layout Enumerate
11613 The layout for a pre-existing inset is being modified.
11614 In this case, can be
11615 \begin_inset Flex CharStyle:Code
11618 \begin_layout Plain Layout
11624 any one of the following:
11625 \begin_inset Flex CharStyle:Code
11628 \begin_layout Plain Layout
11635 \begin_inset Flex CharStyle:Code
11638 \begin_layout Plain Layout
11645 \begin_inset Flex CharStyle:Code
11648 \begin_layout Plain Layout
11655 \begin_inset Flex CharStyle:Code
11658 \begin_layout Plain Layout
11665 \begin_inset Flex CharStyle:Code
11668 \begin_layout Plain Layout
11675 \begin_inset Flex CharStyle:Code
11678 \begin_layout Plain Layout
11685 \begin_inset Flex CharStyle:Code
11688 \begin_layout Plain Layout
11695 \begin_inset Flex CharStyle:Code
11698 \begin_layout Plain Layout
11705 \begin_inset Flex CharStyle:Code
11708 \begin_layout Plain Layout
11715 \begin_inset Flex CharStyle:Code
11718 \begin_layout Plain Layout
11725 \begin_inset Flex CharStyle:Code
11728 \begin_layout Plain Layout
11735 \begin_inset Flex CharStyle:Code
11738 \begin_layout Plain Layout
11745 \begin_inset Flex CharStyle:Code
11748 \begin_layout Plain Layout
11755 \begin_inset Flex CharStyle:Code
11758 \begin_layout Plain Layout
11765 \begin_inset Flex CharStyle:Code
11768 \begin_layout Plain Layout
11775 \begin_inset Flex CharStyle:Code
11778 \begin_layout Plain Layout
11785 \begin_inset Flex CharStyle:Code
11788 \begin_layout Plain Layout
11795 \begin_inset Flex CharStyle:Code
11798 \begin_layout Plain Layout
11805 \begin_inset Flex CharStyle:Code
11808 \begin_layout Plain Layout
11815 \begin_inset Flex CharStyle:Code
11818 \begin_layout Plain Layout
11828 \begin_layout Enumerate
11829 The layout for a Flex inset is being defined.
11831 \begin_inset Flex CharStyle:Code
11834 \begin_layout Plain Layout
11840 can be any valid identifier not used by a pre-existing inset.
11841 Note that the definition of a flex inset must
11846 \begin_inset Flex CharStyle:Code
11849 \begin_layout Plain Layout
11858 \begin_layout Standard
11860 \begin_inset Flex CharStyle:Code
11863 \begin_layout Plain Layout
11869 definition can contain the following entries:
11872 \begin_layout Description
11873 \begin_inset Flex CharStyle:Code
11876 \begin_layout Plain Layout
11882 The color for the inset's background.
11883 The valid colors are defined in
11884 \begin_inset Flex CharStyle:Code
11887 \begin_layout Plain Layout
11896 \begin_layout Description
11897 \begin_inset Flex CharStyle:Code
11900 \begin_layout Plain Layout
11906 As with paragraph styles (see page
11907 \begin_inset CommandInset ref
11909 reference "des:CopyStyle"
11916 \begin_layout Description
11917 \begin_inset Flex CharStyle:Code
11920 \begin_layout Plain Layout
11927 \begin_inset Flex CharStyle:Code
11930 \begin_layout Plain Layout
11939 \begin_inset Flex CharStyle:Code
11942 \begin_layout Plain Layout
11948 ] Indicates whether the user may employ the Paragraph Settings dialog to
11949 customize the paragraph.
11952 \begin_layout Description
11953 \begin_inset Flex CharStyle:Code
11956 \begin_layout Plain Layout
11963 \begin_inset Flex CharStyle:Code
11966 \begin_layout Plain Layout
11973 \begin_inset Flex CharStyle:Code
11976 \begin_layout Plain Layout
11983 \begin_inset Flex CharStyle:Code
11986 \begin_layout Plain Layout
11992 , describing the rendering style used for the inset's frame and buttons.
11993 Footnotes generally use
11994 \begin_inset Flex CharStyle:Code
11997 \begin_layout Plain Layout
12003 , ERT insets generally
12004 \begin_inset Flex CharStyle:Code
12007 \begin_layout Plain Layout
12013 , and character styles
12014 \begin_inset Flex CharStyle:Code
12017 \begin_layout Plain Layout
12026 \begin_layout Description
12027 \begin_inset Flex CharStyle:Code
12030 \begin_layout Plain Layout
12036 Required at the end of the InsetLayout declarations.
12039 \begin_layout Description
12040 \begin_inset Flex CharStyle:Code
12043 \begin_layout Plain Layout
12049 The font used for both the text body
12055 \begin_inset space ~
12059 \begin_inset CommandInset ref
12061 reference "sec:fonts"
12066 Note that defining this font automatically defines the
12067 \begin_inset Flex CharStyle:Code
12070 \begin_layout Plain Layout
12076 to the same value, so define this first and define
12077 \begin_inset Flex CharStyle:Code
12080 \begin_layout Plain Layout
12086 later if you want them to be different.
12089 \begin_layout Description
12090 \begin_inset Flex CharStyle:Code
12093 \begin_layout Plain Layout
12100 \begin_inset Quotes eld
12104 \begin_inset Quotes erd
12107 language, leading to Left-to-Right (latin) output, e.
12108 \begin_inset space \thinspace{}
12112 \begin_inset space \space{}
12119 \begin_layout Description
12120 \begin_inset Flex CharStyle:Code
12123 \begin_layout Plain Layout
12130 \begin_inset Flex CharStyle:Code
12133 \begin_layout Plain Layout
12142 \begin_inset Flex CharStyle:Code
12145 \begin_layout Plain Layout
12151 ] Indicates whether the PlainLayout should be used or, instead, the user
12152 can change the paragraph style used in the inset.
12155 \begin_layout Description
12156 \begin_inset Flex CharStyle:Code
12159 \begin_layout Plain Layout
12165 As with paragraph styles (see page
12166 \begin_inset CommandInset ref
12167 LatexCommand pageref
12168 reference "des:FreeSpacing"
12175 \begin_layout Description
12176 \begin_inset Flex CharStyle:Code
12179 \begin_layout Plain Layout
12185 As with paragraph styles (see page
12186 \begin_inset CommandInset ref
12187 LatexCommand pageref
12188 reference "des:KeepEmpty"
12195 \begin_layout Description
12196 \begin_inset Flex CharStyle:Code
12199 \begin_layout Plain Layout
12205 The font used for the label.
12207 \begin_inset space ~
12211 \begin_inset CommandInset ref
12213 reference "sec:fonts"
12218 Note that this definition can never appear before
12219 \begin_inset Flex CharStyle:Code
12222 \begin_layout Plain Layout
12228 , lest it be ineffective.
12231 \begin_layout Description
12232 \begin_inset Flex CharStyle:Code
12235 \begin_layout Plain Layout
12241 What will be displayed on the button or elsewhere as the inset label.
12242 Some inset types (ERT and Branch) modify this label on the fly.
12245 \begin_layout Description
12246 \begin_inset Flex CharStyle:Code
12249 \begin_layout Plain Layout
12255 The name of the corresponding LaTeX stuff.
12256 Either the environment or command name.
12259 \begin_layout Description
12260 \begin_inset Flex CharStyle:Code
12263 \begin_layout Plain Layout
12269 The optional parameter for the corresponding
12270 \begin_inset Flex CharStyle:Code
12273 \begin_layout Plain Layout
12279 stuff, including possible bracket pairs like
12280 \begin_inset Flex CharStyle:Code
12283 \begin_layout Plain Layout
12290 This parameter cannot be changed from within LyX.
12293 \begin_layout Description
12294 \begin_inset Flex CharStyle:Code
12297 \begin_layout Plain Layout
12303 As with paragraph styles (see page
12304 \begin_inset CommandInset ref
12305 LatexCommand pageref
12306 reference "des:LatexType"
12313 \begin_layout Description
12314 \begin_inset Flex CharStyle:Code
12317 \begin_layout Plain Layout
12324 \begin_inset Flex CharStyle:Code
12327 \begin_layout Plain Layout
12334 \begin_inset Flex CharStyle:Code
12337 \begin_layout Plain Layout
12344 \begin_inset Flex CharStyle:Code
12347 \begin_layout Plain Layout
12354 \begin_inset Flex CharStyle:Code
12357 \begin_layout Plain Layout
12363 (indicating a dummy definition ending definitions of charstyles, etc).
12364 This entry is required in and is only meaningful for Flex insets.
12365 Among other things, it determines on which menu this inset will appear.
12368 \begin_layout Description
12369 \begin_inset Flex CharStyle:Code
12372 \begin_layout Plain Layout
12379 \begin_inset Flex CharStyle:Code
12382 \begin_layout Plain Layout
12391 \begin_inset Flex CharStyle:Code
12394 \begin_layout Plain Layout
12400 ] Whether multiple paragraphs are permitted in this inset.
12401 This will also set CustomPars to the same value and ForcePlain to the opposite
12403 These can be reset to other values, if they are used
12410 \begin_layout Description
12411 \begin_inset Flex CharStyle:Code
12414 \begin_layout Plain Layout
12421 \begin_inset Flex CharStyle:Code
12424 \begin_layout Plain Layout
12433 \begin_inset Flex CharStyle:Code
12436 \begin_layout Plain Layout
12442 ] Whether fragile commands in this layout should be
12443 \begin_inset Flex CharStyle:Code
12446 \begin_layout Plain Layout
12459 whether the command should itself be protected.)
12462 \begin_layout Description
12463 \begin_inset Flex CharStyle:Code
12466 \begin_layout Plain Layout
12473 \begin_inset Flex CharStyle:Code
12476 \begin_layout Plain Layout
12485 \begin_inset Flex CharStyle:Code
12488 \begin_layout Plain Layout
12494 ] As with paragraph styles (see page
12495 \begin_inset CommandInset ref
12497 reference "des:PathThru"
12504 \begin_layout Description
12505 \begin_inset Flex CharStyle:Code
12508 \begin_layout Plain Layout
12514 As with paragraph styles (see page
12515 \begin_inset CommandInset ref
12516 LatexCommand pageref
12517 reference "des:Preamble"
12524 \begin_layout Description
12525 \begin_inset Flex CharStyle:Code
12528 \begin_layout Plain Layout
12535 \begin_inset Flex CharStyle:Code
12538 \begin_layout Plain Layout
12544 ] As with paragraph styles (see page
12545 \begin_inset CommandInset ref
12546 LatexCommand pageref
12547 reference "des:Requires"
12554 \begin_layout Subsection
12558 \begin_layout Standard
12559 \begin_inset CommandInset label
12565 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12567 \begin_inset Flex CharStyle:MenuItem
12570 \begin_layout Plain Layout
12577 \begin_inset Flex CharStyle:MenuItem
12580 \begin_layout Plain Layout
12586 , \SpecialChar \ldots{}
12587 ) in the text class itself.
12588 The standard counters are defined in the file
12589 \begin_inset Flex CharStyle:Code
12592 \begin_layout Plain Layout
12598 , so you may have to do no more than add
12601 \begin_layout LyX-Code
12602 Input stdcounters.inc
12605 \begin_layout Standard
12606 to your layout file to get them to work.
12607 But if you want to define custom counters, then you can do so.
12608 The counter declaration must begin with:
12611 \begin_layout LyX-Code
12615 \begin_layout Standard
12616 where of course `name' is replaced by the name of the counter.
12617 And it must end with
12618 \begin_inset Quotes eld
12622 \begin_inset Flex CharStyle:Code
12625 \begin_layout Plain Layout
12632 \begin_inset Quotes erd
12636 The following parameters can also be used:
12639 \begin_layout Description
12640 \begin_inset Flex CharStyle:Code
12643 \begin_layout Plain Layout
12644 LabelString [string=""]
12649 when this is defined, this string defines how the counter is displayed.
12650 Setting this value sets
12651 \begin_inset Flex CharStyle:Code
12654 \begin_layout Plain Layout
12655 LabelStringAppendix
12661 The following special constructs can be used in the string:
12665 \begin_layout Itemize
12666 \begin_inset Flex CharStyle:Code
12669 \begin_layout Plain Layout
12677 will be replaced by the expansion of the
12678 \begin_inset Flex CharStyle:Code
12681 \begin_layout Plain Layout
12688 \begin_inset Flex CharStyle:Code
12691 \begin_layout Plain Layout
12692 LabelStringAppendix
12698 \begin_inset Flex CharStyle:Code
12701 \begin_layout Plain Layout
12711 \begin_layout Itemize
12712 counter values can be expressed using LaTeX-like macros
12713 \begin_inset Flex CharStyle:Code
12716 \begin_layout Plain Layout
12733 \begin_inset Flex CharStyle:Code
12736 \begin_layout Plain Layout
12748 \begin_layout Plain Layout
12758 Actually, the situation is a bit more complicated: any
12777 other than those descibed below will produce arabic numerals.
12778 It would not be surprising to see this change in the future.
12784 \begin_inset Flex CharStyle:Code
12787 \begin_layout Plain Layout
12793 : 1, 2, 3,\SpecialChar \ldots{}
12795 \begin_inset Flex CharStyle:Code
12798 \begin_layout Plain Layout
12804 for lower-case letters: a, b, c, \SpecialChar \ldots{}
12806 \begin_inset Flex CharStyle:Code
12809 \begin_layout Plain Layout
12815 for upper-case letters: A, B, C, \SpecialChar \ldots{}
12817 \begin_inset Flex CharStyle:Code
12820 \begin_layout Plain Layout
12826 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
12828 \begin_inset Flex CharStyle:Code
12831 \begin_layout Plain Layout
12837 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
12839 \begin_inset Flex CharStyle:Code
12842 \begin_layout Plain Layout
12848 for hebrew numerals.
12852 \begin_layout Standard
12853 If LabelString is not defined, a default value is constructed as follows:
12854 if the counter has a master counter
12855 \begin_inset Flex CharStyle:Code
12858 \begin_layout Plain Layout
12865 \begin_inset Flex CharStyle:Code
12868 \begin_layout Plain Layout
12875 \begin_inset Flex CharStyle:Code
12878 \begin_layout Plain Layout
12888 is used; otherwise the string
12889 \begin_inset Flex CharStyle:Code
12892 \begin_layout Plain Layout
12903 \begin_layout Description
12904 \begin_inset Flex CharStyle:Code
12907 \begin_layout Plain Layout
12908 LabelStringAppendix [string=""]
12914 \begin_inset Flex CharStyle:Code
12917 \begin_layout Plain Layout
12923 , but for use in the Appendix.
12926 \begin_layout Description
12927 \begin_inset Flex CharStyle:Code
12930 \begin_layout Plain Layout
12937 \begin_inset Flex CharStyle:Code
12940 \begin_layout Plain Layout
12947 \begin_inset Quotes erd
12951 \begin_inset Quotes erd
12954 ] If this is set to the name of another counter, the present counter will
12955 be reset everytime the other one is increased.
12957 \begin_inset Flex CharStyle:Code
12960 \begin_layout Plain Layout
12967 \begin_inset Flex CharStyle:Code
12970 \begin_layout Plain Layout
12979 \begin_layout Subsection
12983 \begin_layout Standard
12984 \begin_inset CommandInset label
12990 A font description looks like this:
12993 \begin_layout LyX-Code
13003 \begin_layout LyX-Code
13007 \begin_layout LyX-Code
13011 \begin_layout Standard
13012 The following commands are available:
13015 \begin_layout Description
13016 \begin_inset Flex CharStyle:Code
13019 \begin_layout Plain Layout
13026 \begin_inset Flex CharStyle:Code
13029 \begin_layout Plain Layout
13038 \begin_inset Flex CharStyle:Code
13041 \begin_layout Plain Layout
13048 \begin_inset Flex CharStyle:Code
13051 \begin_layout Plain Layout
13058 \begin_inset Flex CharStyle:Code
13061 \begin_layout Plain Layout
13068 \begin_inset Flex CharStyle:Code
13071 \begin_layout Plain Layout
13078 \begin_inset Flex CharStyle:Code
13081 \begin_layout Plain Layout
13088 \begin_inset Flex CharStyle:Code
13091 \begin_layout Plain Layout
13098 \begin_inset Flex CharStyle:Code
13101 \begin_layout Plain Layout
13108 \begin_inset Flex CharStyle:Code
13111 \begin_layout Plain Layout
13120 \begin_layout Description
13121 \begin_inset Flex CharStyle:Code
13124 \begin_layout Plain Layout
13133 \begin_inset Flex CharStyle:Code
13136 \begin_layout Plain Layout
13147 \begin_inset Flex CharStyle:Code
13150 \begin_layout Plain Layout
13157 \begin_inset Flex CharStyle:Code
13160 \begin_layout Plain Layout
13169 \begin_layout Description
13170 \begin_inset Flex CharStyle:Code
13173 \begin_layout Plain Layout
13180 \begin_inset Flex CharStyle:Code
13183 \begin_layout Plain Layout
13189 ] Valid argument sare:
13190 \begin_inset Flex CharStyle:Code
13193 \begin_layout Plain Layout
13200 \begin_inset Flex CharStyle:Code
13203 \begin_layout Plain Layout
13210 \begin_inset Flex CharStyle:Code
13213 \begin_layout Plain Layout
13220 \begin_inset Flex CharStyle:Code
13223 \begin_layout Plain Layout
13230 \begin_inset Flex CharStyle:Code
13233 \begin_layout Plain Layout
13240 \begin_inset Flex CharStyle:Code
13243 \begin_layout Plain Layout
13250 Each of these turns on or off the corresponding attribute.
13253 \begin_layout Description
13254 \begin_inset Flex CharStyle:Code
13257 \begin_layout Plain Layout
13266 \begin_inset Flex CharStyle:Code
13269 \begin_layout Plain Layout
13280 \begin_inset Flex CharStyle:Code
13283 \begin_layout Plain Layout
13292 \begin_layout Description
13293 \begin_inset Flex CharStyle:Code
13296 \begin_layout Plain Layout
13305 \begin_inset Flex CharStyle:Code
13308 \begin_layout Plain Layout
13319 \begin_inset Flex CharStyle:Code
13322 \begin_layout Plain Layout
13329 \begin_inset Flex CharStyle:Code
13332 \begin_layout Plain Layout
13339 \begin_inset Flex CharStyle:Code
13342 \begin_layout Plain Layout
13351 \begin_layout Description
13352 \begin_inset Flex CharStyle:Code
13355 \begin_layout Plain Layout
13362 \begin_inset Flex CharStyle:Code
13365 \begin_layout Plain Layout
13372 \begin_inset Flex CharStyle:Code
13375 \begin_layout Plain Layout
13382 \begin_inset Flex CharStyle:Code
13385 \begin_layout Plain Layout
13394 \begin_inset Flex CharStyle:Code
13397 \begin_layout Plain Layout
13404 \begin_inset Flex CharStyle:Code
13407 \begin_layout Plain Layout
13414 \begin_inset Flex CharStyle:Code
13417 \begin_layout Plain Layout
13424 \begin_inset Flex CharStyle:Code
13427 \begin_layout Plain Layout
13434 \begin_inset Flex CharStyle:Code
13437 \begin_layout Plain Layout
13446 \begin_layout Subsection
13447 Upgrading old layout files
13450 \begin_layout Standard
13451 The file format of layout files changes from time to time, so old layout
13452 files need to be converted.
13453 This process has been automated since LyX 1.4.0: If LyX reads an old format
13454 layout file it will call the conversion tool
13455 \begin_inset Flex CharStyle:Code
13458 \begin_layout Plain Layout
13459 LyXDir/scripts/layout2layout.py
13464 and convert it to a temporary file in current format.
13465 The original file is left untouched.
13466 If you want to convert the layout file permanently, just call the converter
13470 \begin_layout LyX-Code
13471 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13474 \begin_layout Standard
13475 (You need to replace
13476 \begin_inset Flex CharStyle:Code
13479 \begin_layout Plain Layout
13485 with the name of your LyX system directory, unless you happen to have defined
13486 such an environment variable.) Then copy
13487 \begin_inset Flex CharStyle:Code
13490 \begin_layout Plain Layout
13497 \begin_inset Flex CharStyle:Code
13500 \begin_layout Plain Layout
13509 \begin_layout Standard
13510 The automatic conversion only handles syntax changes.
13511 It cannot handle the case where the contents of included files was changed,
13512 so these will have to be converted separately.
13515 \begin_layout Section
13517 \begin_inset CommandInset label
13519 name "sec:templates"
13526 \begin_layout Standard
13527 Templates are created just like usual documents.
13528 The only difference is that usual documents contain all possible settings,
13529 including the font scheme and the paper size.
13530 Usually a user doesn't want a template to overwrite his defaults in these
13532 For that reason, the designer of a template should remove the corresponding
13534 \begin_inset Flex CharStyle:Code
13537 \begin_layout Plain Layout
13546 \begin_inset Flex CharStyle:Code
13549 \begin_layout Plain Layout
13557 from the template LyX file.
13558 This can be done with any simple text-editor, for example
13559 \begin_inset Flex CharStyle:Code
13562 \begin_layout Plain Layout
13569 \begin_inset Flex CharStyle:Code
13572 \begin_layout Plain Layout
13582 \begin_layout Standard
13583 Put the edited template files you create in
13584 \begin_inset Flex CharStyle:Code
13587 \begin_layout Plain Layout
13593 , copy the ones you use from the global template directory in
13594 \begin_inset Flex CharStyle:Code
13597 \begin_layout Plain Layout
13603 to the same place, and redefine the template path in the
13604 \begin_inset Flex CharStyle:MenuItem
13607 \begin_layout Plain Layout
13608 Tools\SpecialChar \menuseparator
13609 Preferences\SpecialChar \menuseparator
13618 \begin_layout Standard
13619 Note that there is a template which has a particular meaning:
13620 \begin_inset Flex CharStyle:Code
13623 \begin_layout Plain Layout
13630 This template is loaded everytime you create a new document with
13631 \begin_inset Flex CharStyle:MenuItem
13634 \begin_layout Plain Layout
13635 File\SpecialChar \menuseparator
13641 in order to provide useful defaults.
13642 To create this template from inside LyX, all you have to do is to open
13643 a document with the correct settings, and use the
13644 \begin_inset Flex CharStyle:MenuItem
13647 \begin_layout Plain Layout
13648 Save as Document Defaults
13656 \begin_layout Chapter
13657 Including External Material
13660 \begin_layout Standard
13661 \begin_inset Box Shadowbox
13670 height_special "totalheight"
13673 \begin_layout Plain Layout
13674 WARNING: This portion of the documentation has not been updated for some
13676 We certainly hope that it is still accurate, but there are no guarantees.
13684 \begin_layout Standard
13685 The use of material from sources external to LyX is covered in detail in
13691 This part of the manual covers what needs to happen behind the scenes for
13692 new sorts of material to be included.
13695 \begin_layout Section
13699 \begin_layout Standard
13700 The external material feature is based on the concept of a
13705 A template is a specification of how LyX should interface with a certain
13707 As bundled, LyX comes with predefined templates for Xfig figures, various
13708 raster format images, chess diagrams, and LilyPond music notation.
13709 You can check the actual list by using the menu
13710 \begin_inset Flex CharStyle:MenuItem
13713 \begin_layout Plain Layout
13714 Insert\SpecialChar \menuseparator
13715 File\SpecialChar \menuseparator
13722 Furthermore, it is possible to roll your own template to support a specific
13724 Later we'll describe in more detail what is involved, and hopefully you
13725 will submit all the templates you create so we can include them in a later
13729 \begin_layout Standard
13730 Another basic idea of the external material feature is to distinguish between
13731 the original file that serves as a base for final material and the produced
13732 file that is included in your exported or printed document.
13733 For example, consider the case of a figure produced with
13734 \begin_inset Flex CharStyle:Code
13737 \begin_layout Plain Layout
13744 The Xfig application itself works on an original file with the
13745 \begin_inset Flex CharStyle:Code
13748 \begin_layout Plain Layout
13755 Within XFig, you create and change your figure, and when you are done,
13757 \begin_inset Flex CharStyle:Code
13760 \begin_layout Plain Layout
13767 When you want to include the figure in your document, you invoke
13768 \begin_inset Flex CharStyle:Code
13771 \begin_layout Plain Layout
13777 in order to create a PostScript file that can readily be included in your
13780 \begin_inset Flex CharStyle:Code
13783 \begin_layout Plain Layout
13789 file is the original file, and the PostScript file is the produced file.
13792 \begin_layout Standard
13793 This distinction is important in order to allow updating of the material
13794 while you are in the process of writing the document.
13795 Furthermore, it provides us with the flexibility that is needed to support
13796 multiple export formats.
13797 For instance, in the case of a plain text file, it is not exactly an award-winn
13798 ing idea to include the figure as raw PostScript®.
13799 Instead, you'd either prefer to just include a reference to the figure
13800 or try to invoke some graphics to Ascii converter to make the final result
13801 look similar to the real graphics.
13802 The external material management allows you to do this, because it is parameter
13803 ized on the different export formats that LyX supports.
13806 \begin_layout Standard
13807 Besides supporting the production of different products according to the
13808 exported format, it supports tight integration with editing and viewing
13810 In the case of an XFig figure, you are able to invoke Xfig on the original
13811 file with a single click from within the external material dialog in LyX,
13812 and also preview the produced PostScript file with ghostview with another
13814 No more fiddling around with the command line and/or file browsers to locate
13815 and manipulate the original or produced files.
13816 In this way, you are finally able to take full advantage of the many different
13817 applications that are relevant to use when you write your documents, and
13818 ultimately be more productive.
13821 \begin_layout Section
13822 The external template configuration file
13825 \begin_layout Standard
13826 It is relatively easy to add custom external template definitions to LyX.
13827 However, be aware that doing this in an careless manner most probably
13831 introduce an easily exploitable security hole.
13832 So before you do this, please read the discussion about security in section
13834 \begin_inset CommandInset ref
13836 reference "sec:Security-discussion"
13843 \begin_layout Standard
13844 Having said that, we encourage you to submit any interesting templates that
13849 \begin_layout Standard
13850 The external templates are defined in the
13851 \begin_inset Flex CharStyle:Code
13854 \begin_layout Plain Layout
13855 LyXDir/lib/external_templates
13861 You can place your own version in
13862 \begin_inset Flex CharStyle:Code
13865 \begin_layout Plain Layout
13866 UserDir/external_templates
13874 \begin_layout Standard
13875 A typical template looks like this:
13878 \begin_layout LyX-Code
13882 \begin_layout LyX-Code
13883 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
13886 \begin_layout LyX-Code
13890 \begin_layout LyX-Code
13894 \begin_layout LyX-Code
13898 \begin_layout LyX-Code
13902 \begin_layout LyX-Code
13906 \begin_layout LyX-Code
13907 AutomaticProduction true
13910 \begin_layout LyX-Code
13914 \begin_layout LyX-Code
13918 \begin_layout LyX-Code
13922 \begin_layout LyX-Code
13923 TransformCommand Rotate RotationLatexCommand
13926 \begin_layout LyX-Code
13927 TransformCommand Resize ResizeLatexCommand
13930 \begin_layout LyX-Code
13931 Product "$$RotateFront$$ResizeFront
13934 \begin_layout LyX-Code
13939 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
13942 \begin_layout LyX-Code
13943 $$ResizeBack$$RotateBack"
13946 \begin_layout LyX-Code
13950 \begin_layout LyX-Code
13951 UpdateResult "$$AbsPath$$Basename.pstex_t"
13954 \begin_layout LyX-Code
13955 Requirement "graphicx"
13958 \begin_layout LyX-Code
13959 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
13962 \begin_layout LyX-Code
13963 ReferencedFile latex "$$AbsPath$$Basename.eps"
13966 \begin_layout LyX-Code
13967 ReferencedFile dvi "$$AbsPath$$Basename.eps"
13970 \begin_layout LyX-Code
13974 \begin_layout LyX-Code
13978 \begin_layout LyX-Code
13979 TransformCommand Rotate RotationLatexCommand
13982 \begin_layout LyX-Code
13983 TransformCommand Resize ResizeLatexCommand
13986 \begin_layout LyX-Code
13987 Product "$$RotateFront$$ResizeFront
13990 \begin_layout LyX-Code
13995 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
13998 \begin_layout LyX-Code
13999 $$ResizeBack$$RotateBack"
14002 \begin_layout LyX-Code
14003 UpdateFormat pdftex
14006 \begin_layout LyX-Code
14007 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14010 \begin_layout LyX-Code
14011 Requirement "graphicx"
14014 \begin_layout LyX-Code
14015 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14018 \begin_layout LyX-Code
14019 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14022 \begin_layout LyX-Code
14026 \begin_layout LyX-Code
14030 \begin_layout LyX-Code
14031 Product "$$Contents(
14033 "$$AbsPath$$Basename.asc
14038 \begin_layout LyX-Code
14039 UpdateFormat asciixfig
14042 \begin_layout LyX-Code
14043 UpdateResult "$$AbsPath$$Basename.asc"
14046 \begin_layout LyX-Code
14050 \begin_layout LyX-Code
14054 \begin_layout LyX-Code
14055 Product "<graphic fileref=
14057 "$$AbsOrRelPathMaster$$Basename.eps
14062 \begin_layout LyX-Code
14066 \begin_layout LyX-Code
14070 \begin_layout LyX-Code
14071 UpdateResult "$$AbsPath$$Basename.eps"
14074 \begin_layout LyX-Code
14075 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14078 \begin_layout LyX-Code
14079 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14082 \begin_layout LyX-Code
14086 \begin_layout LyX-Code
14087 Product "[XFig: $$FName]"
14090 \begin_layout LyX-Code
14094 \begin_layout LyX-Code
14098 \begin_layout Standard
14099 As you can see, the template is enclosed in
14100 \begin_inset Flex CharStyle:Code
14103 \begin_layout Plain Layout
14109 \SpecialChar \ldots{}
14111 \begin_inset Flex CharStyle:Code
14114 \begin_layout Plain Layout
14121 It contains a header specifying some general settings and, for each supported
14122 primary document file format, a section
14123 \begin_inset Flex CharStyle:Code
14126 \begin_layout Plain Layout
14132 \SpecialChar \ldots{}
14134 \begin_inset Flex CharStyle:Code
14137 \begin_layout Plain Layout
14146 \begin_layout Subsection
14147 The template header
14150 \begin_layout Description
14151 \begin_inset Flex CharStyle:Code
14154 \begin_layout Plain Layout
14155 AutomaticProduction
14156 \begin_inset space ~
14164 Whether the file represented by the template must be generated by LyX.
14165 This command must occur exactly once.
14168 \begin_layout Description
14169 \begin_inset Flex CharStyle:Code
14172 \begin_layout Plain Layout
14174 \begin_inset space ~
14182 A glob pattern that is used in the file dialog to filter out the desired
14184 If there is more than one possible file extension (e.
14185 \begin_inset space \thinspace{}
14189 \begin_inset space \space{}
14193 \begin_inset Flex CharStyle:Code
14196 \begin_layout Plain Layout
14203 \begin_inset Flex CharStyle:Code
14206 \begin_layout Plain Layout
14212 ), use something like
14213 \begin_inset Flex CharStyle:Code
14216 \begin_layout Plain Layout
14223 This command must occur exactly once.
14226 \begin_layout Description
14227 \begin_inset Flex CharStyle:Code
14230 \begin_layout Plain Layout
14232 \begin_inset space ~
14240 The text that is displayed on the button.
14241 This command must occur exactly once.
14244 \begin_layout Description
14245 \begin_inset Flex CharStyle:Code
14248 \begin_layout Plain Layout
14250 \begin_inset space ~
14254 \begin_inset space ~
14262 The help text that is used in the External dialog.
14263 Provide enough information to explain to the user just what the template
14264 can provide him with.
14265 This command must occur exactly once.
14268 \begin_layout Description
14269 \begin_inset Flex CharStyle:Code
14272 \begin_layout Plain Layout
14274 \begin_inset space ~
14282 The file format of the original file.
14283 This must be the name of a format that is known to LyX (see section
14284 \begin_inset CommandInset ref
14286 reference "sub:Formats"
14292 \begin_inset Quotes eld
14296 \begin_inset Flex CharStyle:Code
14299 \begin_layout Plain Layout
14306 \begin_inset Quotes erd
14309 if the template can handle original files of more than one format.
14310 LyX will attempt to interrogate the file itself in order to deduce its
14311 format in this case.
14312 This command must occur exactly once.
14315 \begin_layout Description
14316 \begin_inset Flex CharStyle:Code
14319 \begin_layout Plain Layout
14321 \begin_inset space ~
14329 A unique name for the template.
14330 It must not contain substitution macros (see below).
14333 \begin_layout Description
14334 \begin_inset Flex CharStyle:Code
14337 \begin_layout Plain Layout
14339 \begin_inset space ~
14342 Rotate|Resize|Clip|Extra
14347 This command specifies which transformations are supported by this template.
14348 It may occur zero or more times.
14349 This command enables the corresponding tabs in the external dialog.
14351 \begin_inset Flex CharStyle:Code
14354 \begin_layout Plain Layout
14360 command must have either a corresponding
14361 \begin_inset Flex CharStyle:Code
14364 \begin_layout Plain Layout
14371 \begin_inset Flex CharStyle:Code
14374 \begin_layout Plain Layout
14381 \begin_inset Flex CharStyle:Code
14384 \begin_layout Plain Layout
14391 Otherwise the transformation will not be supported by that format.
14394 \begin_layout Subsection
14398 \begin_layout Description
14399 \begin_inset Flex CharStyle:Code
14402 \begin_layout Plain Layout
14404 \begin_inset space ~
14407 LaTeX|PDFLaTeX|PlainText|DocBook
14412 The primary document file format that this format definition is for.
14413 Not every template has a sensible representation in all document file formats.
14414 Please define nevertheless a
14415 \begin_inset Flex CharStyle:Code
14418 \begin_layout Plain Layout
14424 section for all formats.
14425 Use a dummy text when no representation is available.
14426 Then you can at least see a reference to the external material in the exported
14430 \begin_layout Description
14431 \begin_inset Flex CharStyle:Code
14434 \begin_layout Plain Layout
14436 \begin_inset space ~
14440 \begin_inset space ~
14448 This command defines an additional macro
14449 \begin_inset Flex CharStyle:Code
14452 \begin_layout Plain Layout
14458 for substitution in
14459 \begin_inset Flex CharStyle:Code
14462 \begin_layout Plain Layout
14470 \begin_inset Flex CharStyle:Code
14473 \begin_layout Plain Layout
14479 itself may contain substitution macros.
14480 The advantage over using
14481 \begin_inset Flex CharStyle:Code
14484 \begin_layout Plain Layout
14491 \begin_inset Flex CharStyle:Code
14494 \begin_layout Plain Layout
14500 is that the substituted value of
14501 \begin_inset Flex CharStyle:Code
14504 \begin_layout Plain Layout
14510 is sanitized so that it is a valid optional argument in the document format.
14511 This command may occur zero or more times.
14514 \begin_layout Description
14515 \begin_inset Flex CharStyle:Code
14518 \begin_layout Plain Layout
14520 \begin_inset space ~
14528 The text that is inserted in the exported document.
14529 This is actually the most important command and can be quite complex.
14530 This command must occur exactly once.
14533 \begin_layout Description
14534 \begin_inset Flex CharStyle:Code
14537 \begin_layout Plain Layout
14539 \begin_inset space ~
14547 This command specifies a preamble snippet that will be included in the
14549 It has to be defined using
14550 \begin_inset Flex CharStyle:Code
14553 \begin_layout Plain Layout
14559 \SpecialChar \ldots{}
14561 \begin_inset Flex CharStyle:Code
14564 \begin_layout Plain Layout
14571 This command may occur zero or more times.
14574 \begin_layout Description
14575 \begin_inset Flex CharStyle:Code
14578 \begin_layout Plain Layout
14580 \begin_inset space ~
14584 \begin_inset space ~
14592 This command denotes files that are created by the conversion process and
14593 are needed for a particular export format.
14594 If the filename is relative, it is interpreted relative to the master document.
14595 This command may be given zero or more times.
14598 \begin_layout Description
14599 \begin_inset Flex CharStyle:Code
14602 \begin_layout Plain Layout
14604 \begin_inset space ~
14612 The name of a required LaTeX package.
14613 The package is included via
14614 \begin_inset Flex CharStyle:Code
14617 \begin_layout Plain Layout
14625 in the LaTeX preamble.
14626 This command may occur zero or more times.
14629 \begin_layout Description
14630 \begin_inset Flex CharStyle:Code
14633 \begin_layout Plain Layout
14635 \begin_inset space ~
14639 \begin_inset space ~
14642 RotationLatexCommand
14647 This command specifies that the built in LaTeX command should be used for
14649 This command may occur once or not at all.
14652 \begin_layout Description
14653 \begin_inset Flex CharStyle:Code
14656 \begin_layout Plain Layout
14658 \begin_inset space ~
14662 \begin_inset space ~
14670 This command specifies that the built in LaTeX command should be used for
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 ~
14688 RotationLatexOption
14693 This command specifies that rotation 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 resizing is done via an optional argument.
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 ~
14729 \begin_inset space ~
14737 This command specifies that clipping is done via an optional argument.
14738 This command may occur once or not at all.
14741 \begin_layout Description
14742 \begin_inset Flex CharStyle:Code
14745 \begin_layout Plain Layout
14747 \begin_inset space ~
14751 \begin_inset space ~
14759 This command specifies that an extra optional argument is used.
14760 This command may occur once or not at all.
14763 \begin_layout Description
14764 \begin_inset Flex CharStyle:Code
14767 \begin_layout Plain Layout
14769 \begin_inset space ~
14777 The file format of the converted file.
14778 This must be the name of a format that is known to LyX (see the
14779 \begin_inset Flex CharStyle:MenuItem
14782 \begin_layout Plain Layout
14787 ools\SpecialChar \menuseparator
14792 references:Conversion
14798 This command must occur exactly once.
14801 \begin_layout Description
14802 \begin_inset Flex CharStyle:Code
14805 \begin_layout Plain Layout
14807 \begin_inset space ~
14815 The file name of the converted file.
14816 The file name must be absolute.
14817 This command must occur exactly once.
14820 \begin_layout Subsection
14821 Preamble definitions
14824 \begin_layout Standard
14825 The external template configuration file may contain additional preamble
14826 definitions enclosed by
14827 \begin_inset Flex CharStyle:Code
14830 \begin_layout Plain Layout
14836 \SpecialChar \ldots{}
14838 \begin_inset Flex CharStyle:Code
14841 \begin_layout Plain Layout
14848 They can be used by the templates in the
14849 \begin_inset Flex CharStyle:Code
14852 \begin_layout Plain Layout
14861 \begin_layout Section
14862 The substitution mechanism
14865 \begin_layout Standard
14866 When the external material facility invokes an external program, it is done
14867 on the basis of a command defined in the template configuration file.
14868 These commands can contain various macros that are expanded before execution.
14869 Execution always take place in the directory of the containing document.
14872 \begin_layout Standard
14873 Also, whenever external material is to be displayed, the name will be produced
14874 by the substitution mechanism, and most other commands in the template
14875 definition support substitution as well.
14878 \begin_layout Standard
14879 The available macros are the following:
14882 \begin_layout Description
14883 \begin_inset Flex CharStyle:Code
14886 \begin_layout Plain Layout
14887 $$AbsOrRelPathMaster
14892 The file path, absolute or relative to the master LyX document.
14895 \begin_layout Description
14896 \begin_inset Flex CharStyle:Code
14899 \begin_layout Plain Layout
14900 $$AbsOrRelPathParent
14905 The file path, absolute or relative to the LyX document.
14908 \begin_layout Description
14909 \begin_inset Flex CharStyle:Code
14912 \begin_layout Plain Layout
14918 The absolute file path.
14921 \begin_layout Description
14922 \begin_inset Flex CharStyle:Code
14925 \begin_layout Plain Layout
14931 The filename without path and without the extension.
14934 \begin_layout Description
14935 \begin_inset Flex CharStyle:Code
14938 \begin_layout Plain Layout
14940 \begin_inset Quotes eld
14944 \begin_inset Quotes erd
14952 This macro will expand to the contents of the file with the name
14953 \begin_inset Flex CharStyle:Code
14956 \begin_layout Plain Layout
14965 \begin_layout Description
14966 \begin_inset Flex CharStyle:Code
14969 \begin_layout Plain Layout
14975 The file extension (including the dot).
14978 \begin_layout Description
14979 \begin_inset Flex CharStyle:Code
14982 \begin_layout Plain Layout
14988 The filename of the file specified in the external material dialog.
14989 This is either an absolute name, or it is relative to the LyX document.
14992 \begin_layout Description
14993 \begin_inset Flex CharStyle:Code
14996 \begin_layout Plain Layout
15003 \begin_inset Flex CharStyle:Code
15006 \begin_layout Plain Layout
15012 (absolute name or relative to the LyX document).
15015 \begin_layout Description
15016 \begin_inset Flex CharStyle:Code
15019 \begin_layout Plain Layout
15025 The file path, relative to the master LyX document.
15028 \begin_layout Description
15029 \begin_inset Flex CharStyle:Code
15032 \begin_layout Plain Layout
15038 The file path, relative to the LyX document.
15041 \begin_layout Description
15042 \begin_inset Flex CharStyle:Code
15045 \begin_layout Plain Layout
15051 This macro will expand to the absolute path of the system directory.
15052 This is typically used to point to the various helper scripts that are
15056 \begin_layout Description
15057 \begin_inset Flex CharStyle:Code
15060 \begin_layout Plain Layout
15066 A name and full path to a temporary file which will be automatically deleted
15067 whenever the containing document is closed, or the external material insertion
15071 \begin_layout Standard
15072 All path macros contain a trailing directory separator, so you can construct
15074 \begin_inset space \thinspace{}
15078 \begin_inset space \space{}
15081 the absolute filename with
15082 \begin_inset Flex CharStyle:Code
15085 \begin_layout Plain Layout
15086 $$AbsPath$$Basename$$Extension
15094 \begin_layout Standard
15095 The macros above are substituted in all commands unless otherwise noted.
15097 \begin_inset Flex CharStyle:Code
15100 \begin_layout Plain Layout
15106 supports additionally the following substitutions if they are enabled by
15108 \begin_inset Flex CharStyle:Code
15111 \begin_layout Plain Layout
15118 \begin_inset Flex CharStyle:Code
15121 \begin_layout Plain Layout
15130 \begin_layout Description
15131 \begin_inset Flex CharStyle:Code
15134 \begin_layout Plain Layout
15140 The front part of the resize command.
15143 \begin_layout Description
15144 \begin_inset Flex CharStyle:Code
15147 \begin_layout Plain Layout
15153 The back part of the resize command.
15156 \begin_layout Description
15157 \begin_inset Flex CharStyle:Code
15160 \begin_layout Plain Layout
15166 The front part of the rotation command.
15169 \begin_layout Description
15170 \begin_inset Flex CharStyle:Code
15173 \begin_layout Plain Layout
15179 The back part of the rotation command.
15182 \begin_layout Standard
15183 The value string of the
15184 \begin_inset Flex CharStyle:Code
15187 \begin_layout Plain Layout
15193 command supports additionally the following substitutions if they are enabled
15195 \begin_inset Flex CharStyle:Code
15198 \begin_layout Plain Layout
15205 \begin_inset Flex CharStyle:Code
15208 \begin_layout Plain Layout
15217 \begin_layout Description
15218 \begin_inset Flex CharStyle:Code
15221 \begin_layout Plain Layout
15230 \begin_layout Description
15231 \begin_inset Flex CharStyle:Code
15234 \begin_layout Plain Layout
15243 \begin_layout Description
15244 \begin_inset Flex CharStyle:Code
15247 \begin_layout Plain Layout
15256 \begin_layout Description
15257 \begin_inset Flex CharStyle:Code
15260 \begin_layout Plain Layout
15266 The rotation option.
15269 \begin_layout Standard
15270 You may ask why there are so many path macros.
15271 There are mainly two reasons:
15274 \begin_layout Enumerate
15275 Relative and absolute file names should remain relative or absolute, respectivel
15277 Users may have reasons to prefer either form.
15278 Relative names are useful for portable documents that should work on different
15279 machines, for example.
15280 Absolute names may be required by some programs.
15283 \begin_layout Enumerate
15284 LaTeX treats relative file names differently than LyX and other programs
15285 in nested included files.
15286 For LyX, a relative file name is always relative to the document that contains
15288 For LaTeX, it is always relative to the master document.
15289 These two definitions are identical if you have only one document, but
15290 differ if you have a master document that includes part documents.
15291 That means that relative filenames must be transformed when presented to
15293 Fortunately LyX does this automatically for you if you choose the right
15297 \begin_layout Standard
15298 So which path macro should be used in new template definitions? The rule
15302 \begin_layout Itemize
15304 \begin_inset Flex CharStyle:Code
15307 \begin_layout Plain Layout
15313 if an absolute path is required.
15316 \begin_layout Itemize
15318 \begin_inset Flex CharStyle:Code
15321 \begin_layout Plain Layout
15322 $$AbsOrRelPathMaster
15327 if the substituted string is some kind of LaTeX input.
15330 \begin_layout Itemize
15332 \begin_inset Flex CharStyle:Code
15335 \begin_layout Plain Layout
15336 $$AbsOrRelPathParent
15341 in order to preserve the user's choice.
15344 \begin_layout Standard
15345 There are special cases where this rule does not work and e.
15346 \begin_inset space \thinspace{}
15350 \begin_inset space \space{}
15353 relative names are needed, but normally it will work just fine.
15354 One example for such a case is the command
15355 \begin_inset Flex CharStyle:Code
15358 \begin_layout Plain Layout
15359 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15364 in the XFig template above: We can't use the absolute name because the
15366 \begin_inset Flex CharStyle:Code
15369 \begin_layout Plain Layout
15375 files needs the relative name in order to rewrite the file content.
15378 \begin_layout Section
15379 \begin_inset CommandInset label
15381 name "sec:Security-discussion"
15385 Security discussion
15388 \begin_layout Standard
15389 \begin_inset Box Shadowbox
15398 height_special "totalheight"
15401 \begin_layout Plain Layout
15402 WARNING: This section is definitely outdated.
15410 \begin_layout Standard
15411 The external material feature interfaces with a lot of external programs
15412 and does so automatically, so we have to consider the security implications
15414 In particular, since you have the option of including your own filenames
15415 and/or parameter strings and those are expanded into a command, it seems
15416 that it would be possible to create a malicious document which executes
15417 arbitrary commands when a user views or prints the document.
15418 This is something we definately want to avoid.
15421 \begin_layout Standard
15422 However, since the external program commands are specified in the template
15423 configuration file only, there are no security issues if LyX is properly
15424 configured with safe templates only.
15425 This is so because the external programs are invoked with the
15426 \begin_inset Flex CharStyle:Code
15429 \begin_layout Plain Layout
15435 -system call rather than the
15436 \begin_inset Flex CharStyle:Code
15439 \begin_layout Plain Layout
15445 system-call, so it's not possible to execute arbitrary commands from the
15446 filename or parameter section via the shell.
15449 \begin_layout Standard
15450 This also implies that you are restricted in what command strings you can
15451 use in the external material templates.
15452 In particular, pipes and redirection are not readily available.
15453 This has to be so if LyX should remain safe.
15454 If you want to use some of the shell features, you should write a safe
15455 script to do this in a controlled manner, and then invoke the script from
15456 the command string.
15458 \begin_inset Flex CharStyle:Code
15461 \begin_layout Plain Layout
15467 directory of the LyX installation, you can find a safe wrapper script
15468 \begin_inset Flex CharStyle:Code
15471 \begin_layout Plain Layout
15472 general_command_wrapper.py
15477 that supports redirection of input and output.
15478 That can serve as an example for how to write safe template scripts.
15479 For a more advanced example that uses
15480 \begin_inset Flex CharStyle:Code
15483 \begin_layout Plain Layout
15489 and friends, take a look at the
15490 \begin_inset Flex CharStyle:Code
15493 \begin_layout Plain Layout
15502 \begin_layout Standard
15503 It is possible to design a template that interacts directly with the shell,
15504 but since this would allow a malicious user to execute arbitrary commands
15505 by writing clever filenames and/or parameters, we generally recommend that
15506 you only use safe scripts that work with the
15507 \begin_inset Flex CharStyle:Code
15510 \begin_layout Plain Layout
15516 system call in a controlled manner.
15517 Of course, for use in a controlled environment, it can be tempting to just
15518 fall back to use ordinary shell scripts.
15519 If you do so, be aware that you
15523 provide an easily exploitable security hole in your system.
15524 Of course it stands to reason that such unsafe templates will never be
15525 included in the standard LyX distribution, although we do encourage people
15526 to submit new templates in the open source tradition.
15527 But LyX as shipped from the official distribution channels will never have
15531 \begin_layout Standard
15532 Including external material provides a lot of power, and you have to be
15533 careful not to introduce security hazards with this power.
15534 A subtle error in a single line in an innocent looking script can open
15535 the door to huge security problems.
15536 So if you do not fully understand the issues, we recommend that you consult
15537 a knowledgable security professional or the LyX development team if you
15538 have any questions about whether a given template is safe or not.
15539 And do this before you use it in an uncontrolled environment.