1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that this document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of this document 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}}
68 \font_typewriter default
69 \font_default_family default
77 \default_output_format default
78 \bibtex_command default
79 \index_command default
83 \pdf_title "LyX Configuration Manual"
84 \pdf_author "LyX Team"
85 \pdf_subject "LyX-documentation Customization"
86 \pdf_keywords "LyX, documentation, customization"
88 \pdf_bookmarksnumbered true
89 \pdf_bookmarksopen true
90 \pdf_bookmarksopenlevel 1
95 \pdf_pdfusetitle false
96 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
105 \paperorientation portrait
118 \paragraph_separation indent
119 \paragraph_indentation default
120 \quotes_language english
123 \paperpagestyle headings
124 \tracking_changes false
125 \output_changes false
126 \html_use_mathml true
133 Customizing LyX: Features for the Advanced User
141 \begin_layout Plain Layout
143 If you have comments or error corrections, please send them to the LyX Documenta
145 \begin_inset CommandInset href
147 target "lyx-docs@lists.lyx.org"
154 \begin_inset Quotes eld
158 \begin_inset Quotes erd
161 in the subject header, and please cc the current maintainer of this file,
162 Richard Heck <rgheck@comcast.net>.
168 \begin_inset Newline newline
172 \begin_inset Newline newline
178 \begin_layout Standard
179 \begin_inset CommandInset toc
180 LatexCommand tableofcontents
187 \begin_layout Standard
188 \begin_inset Note Note
191 \begin_layout Plain Layout
192 Please use change tracking when modifying this document.
193 This makes it easier for our translators to recognize things that have
194 been changed, and it helps the maintainer keep up-to-date with what's been
203 \begin_layout Chapter
207 \begin_layout Standard
208 This manual covers the customization features present in LyX.
209 In it, we discuss issues like keyboard shortcuts, screen previewing options,
210 printer options, sending commands to LyX via the LyX Server, internationalizati
211 on, installing new LaTeX classes and LyX layouts, etc.
212 We can't possibly hope to touch on everything you can change—our developers
213 add new features faster than we can document them—but we will explain the
214 most common customizations and hopefully point you in the right direction
215 for some of the more obscure ones.
218 \begin_layout Standard
219 \begin_inset Branch OutDated
222 \begin_layout Standard
223 Information from previous versions of this document that now seems to be
224 outdated is contained in the OutDated branch of this document.
225 By default, this information will not appear in the LaTeX output.
233 \begin_layout Chapter
234 LyX configuration files
237 \begin_layout Standard
238 This chapter aims to help you to find your way through the LyX configuration
240 Before continuing to read this chapter, you should find out where your
241 LyX library and user directories are by using
242 \begin_inset Flex CharStyle:MenuItem
245 \begin_layout Plain Layout
246 Help\SpecialChar \menuseparator
257 The library directory is the place where LyX places its system-wide configurati
258 on files; the user directory is where you can place your modified versions.
259 We will call the former
260 \begin_inset Flex CharStyle:Code
263 \begin_layout Plain Layout
270 \begin_inset Flex CharStyle:MenuItem
273 \begin_layout Plain Layout
279 in the remainder of this document.
283 \begin_layout Section
285 \begin_inset Flex CharStyle:Code
288 \begin_layout Plain Layout
297 \begin_layout Standard
298 \begin_inset Flex CharStyle:Code
301 \begin_layout Plain Layout
307 and its sub-directories contain a number of files and that can be used
308 to customize LyX's behavior.
309 You can change many of these files from within LyX itself through the
310 \begin_inset Flex CharStyle:MenuItem
313 \begin_layout Plain Layout
314 Tools\SpecialChar \menuseparator
321 Most customization that you will want to do in LyX is possible through
323 However, many other inner aspects of LyX can be customized by modifying
325 \begin_inset Flex CharStyle:Code
328 \begin_layout Plain Layout
335 These files fall in different categories, described in the following subsection
339 \begin_layout Subsection
340 Automatically generated files
343 \begin_layout Standard
344 The files, which are to be found in
345 \begin_inset Flex CharStyle:MenuItem
348 \begin_layout Plain Layout
354 , are generated when you configure LyX.
355 They contain various default values that are guessed by inspection.
356 In general, it is not a good idea to modify them, since they might be overwritt
360 \begin_layout Labeling
361 \labelwidthstring 00.00.0000
362 \begin_inset Flex CharStyle:Code
365 \begin_layout Plain Layout
371 contains defaults for various commands.
374 \begin_layout Labeling
375 \labelwidthstring 00.00.0000
376 \begin_inset Flex CharStyle:Code
379 \begin_layout Plain Layout
385 contains the list of packages that have been recognized by LyX.
386 It is currently unused by the LyX program itself, but the information extracted
387 , and more, is made available with
388 \begin_inset Flex CharStyle:MenuItem
391 \begin_layout Plain Layout
392 Help\SpecialChar \menuseparator
405 \begin_layout Labeling
406 \labelwidthstring 00.00.0000
407 \begin_inset Flex CharStyle:Code
410 \begin_layout Plain Layout
416 the list of text classes that have been found in your
417 \begin_inset Flex CharStyle:Code
420 \begin_layout Plain Layout
426 directories, along with the associated LaTeX document class and their descripti
430 \begin_layout Labeling
431 \labelwidthstring 00.00.0000
432 \begin_inset Flex CharStyle:Code
435 \begin_layout Plain Layout
441 the list of layout modules found in your
442 \begin_inset Flex CharStyle:Code
445 \begin_layout Plain Layout
454 \begin_layout Labeling
455 \labelwidthstring 00.00.0000
456 \begin_inset Flex CharStyle:Code
459 \begin_layout Plain Layout
465 lists of various sorts of LaTeX-related files found on your system
468 \begin_layout Labeling
469 \labelwidthstring 00.00.0000
470 \begin_inset Flex CharStyle:Code
473 \begin_layout Plain Layout
479 is automatically generated during configuration from the file
480 \begin_inset Flex CharStyle:Code
483 \begin_layout Plain Layout
490 It contains information on your LaTeX configuration.
493 \begin_layout Subsection
497 \begin_layout Standard
498 These directories are duplicated between
499 \begin_inset Flex CharStyle:Code
502 \begin_layout Plain Layout
509 \begin_inset Flex CharStyle:Code
512 \begin_layout Plain Layout
519 If a particular files exists in both places, the one in
520 \begin_inset Flex CharStyle:Code
523 \begin_layout Plain Layout
532 \begin_layout Labeling
533 \labelwidthstring 00.00.0000
534 \begin_inset Flex CharStyle:Code
537 \begin_layout Plain Layout
543 this directory contains files with the extension
544 \begin_inset Flex CharStyle:Code
547 \begin_layout Plain Layout
553 that define the keybindings used in LyX.
554 If there exists an internationalized version of the bind file named
555 \begin_inset Flex CharStyle:Code
558 \begin_layout Plain Layout
564 , that will be used first.
567 \begin_layout Labeling
568 \labelwidthstring 00.00.0000
569 \begin_inset Flex CharStyle:Code
572 \begin_layout Plain Layout
578 contains graphics files that can be included in documents.
582 \begin_layout Labeling
583 \labelwidthstring 00.00.0000
584 \begin_inset Flex CharStyle:Code
587 \begin_layout Plain Layout
593 contains LyX documentation files (including the one you are currently reading).
595 \begin_inset Flex CharStyle:Code
598 \begin_layout Plain Layout
604 deserves special attention, as noted above.
605 The internationalized help docs are in subdirectories
606 \begin_inset Flex CharStyle:Code
609 \begin_layout Plain Layout
616 \begin_inset Quotes eld
620 \begin_inset Quotes erd
623 is the ISO language code.
629 \begin_inset CommandInset ref
631 reference "cha:Internationalizing-LyX"
638 \begin_layout Labeling
639 \labelwidthstring 00.00.0000
640 \begin_inset Flex CharStyle:Code
643 \begin_layout Plain Layout
649 contains example files that explain how to use some features.
650 In the file browser, press the
651 \begin_inset Flex CharStyle:MenuItem
654 \begin_layout Plain Layout
663 \begin_layout Labeling
664 \labelwidthstring 00.00.0000
665 \begin_inset Flex CharStyle:Code
668 \begin_layout Plain Layout
674 contains image files that are used by the
675 \begin_inset Flex CharStyle:MenuItem
678 \begin_layout Plain Layout
685 In addition, it also contains the individual icons used in the toolbar
686 and the banners that can be shown when LyX is launched.
689 \begin_layout Labeling
690 \labelwidthstring 00.00.0000
691 \begin_inset Flex CharStyle:Code
694 \begin_layout Plain Layout
700 contains keyboard keymapping files.
706 \begin_inset CommandInset ref
708 reference "sec:International-Keymap-Stuff"
715 \begin_layout Labeling
716 \labelwidthstring 00.00.0000
717 \begin_inset Flex CharStyle:Code
720 \begin_layout Plain Layout
726 contains the text class and module files described in Chapter
731 \begin_inset CommandInset ref
733 reference "cha:Installing-New-Document"
740 \begin_layout Labeling
741 \labelwidthstring 00.00.0000
742 \begin_inset Flex CharStyle:Code
745 \begin_layout Plain Layout
752 \begin_inset Flex CharStyle:Code
755 \begin_layout Plain Layout
761 Python scripts used to convert between LyX versions.
762 These can be run from the command line if, say, you want to batch-convert
766 \begin_layout Labeling
767 \labelwidthstring 00.00.0000
768 \begin_inset Flex CharStyle:Code
771 \begin_layout Plain Layout
777 contains some files that demonstrate the capabilities of the
778 \begin_inset Flex CharStyle:MenuItem
781 \begin_layout Plain Layout
792 Also contains some scripts used by LyX itself.
795 \begin_layout Labeling
796 \labelwidthstring 00.00.0000
797 \begin_inset Flex CharStyle:Code
800 \begin_layout Plain Layout
806 contains the standard LyX template files described in Chapter
811 \begin_inset CommandInset ref
813 reference "sec:Creating-Templates"
820 \begin_layout Labeling
821 \labelwidthstring 00.00.0000
822 \begin_inset Flex CharStyle:Code
825 \begin_layout Plain Layout
831 contains files with the extension
832 \begin_inset Flex CharStyle:Code
835 \begin_layout Plain Layout
841 that define the user interface to LyX.
842 That is, the files define which items appear in which menus and the items
843 appearing on the toolbar.
846 \begin_layout Subsection
847 Files you don't want to modify
850 \begin_layout Standard
851 These files are used internally by LyX and you generally do not need to
852 modify them unless you are a developer.
855 \begin_layout Labeling
856 \labelwidthstring 00.00.0000
857 \begin_inset Flex CharStyle:Code
860 \begin_layout Plain Layout
866 this file contains the list of LyX developers.
867 The contents are displayed with the menu entry
868 \begin_inset Flex CharStyle:MenuItem
871 \begin_layout Plain Layout
872 Help\SpecialChar \menuseparator
885 \begin_layout Labeling
886 \labelwidthstring 00.00.0000
887 \begin_inset Flex CharStyle:Code
890 \begin_layout Plain Layout
896 this is a LaTeX script used during the configuration process.
900 \begin_layout Labeling
901 \labelwidthstring 00.00.0000
902 \begin_inset Flex CharStyle:Code
905 \begin_layout Plain Layout
911 this is the script that is used to re-configure LyX.
912 It creates configuration files in the directory it was run from.
915 \begin_layout Subsection
916 Other files needing a line or two...
919 \begin_layout Labeling
920 \labelwidthstring 00.00.0000
921 \begin_inset Flex CharStyle:Code
924 \begin_layout Plain Layout
930 this contains tables describing how different character encodings can be
934 \begin_layout Labeling
935 \labelwidthstring 00.00.0000
936 \begin_inset Flex CharStyle:Code
939 \begin_layout Plain Layout
945 this file contains the templates available to the new
946 \begin_inset Flex CharStyle:MenuItem
949 \begin_layout Plain Layout
962 \begin_layout Labeling
963 \labelwidthstring 00.00.0000
964 \begin_inset Flex CharStyle:Code
967 \begin_layout Plain Layout
973 this file contains a list of all the languages currently supported by LyX.
976 \begin_layout Section
977 Your local configuration directory
980 \begin_layout Standard
981 Even if you are using LyX as an unprivileged user, you might want to change
982 LyX configuration for your own use.
984 \begin_inset Flex CharStyle:Code
987 \begin_layout Plain Layout
993 directory contains all your personal configuration files.
994 This is the directory described as
995 \begin_inset Quotes eld
999 \begin_inset Quotes erd
1003 \begin_inset Flex CharStyle:MenuItem
1006 \begin_layout Plain Layout
1007 Help\SpecialChar \menuseparator
1009 \begin_inset space ~
1018 This directory is used as a mirror of
1019 \begin_inset Flex CharStyle:Code
1022 \begin_layout Plain Layout
1028 , which means that every file in
1029 \begin_inset Flex CharStyle:Code
1032 \begin_layout Plain Layout
1038 is a replacement for the corresponding file in
1039 \begin_inset Flex CharStyle:Code
1042 \begin_layout Plain Layout
1049 Any configuration file described in the above sections can be placed either
1050 in the system-wide directory, in which case it will affect all users, or
1051 in your local directory for your own use.
1054 \begin_layout Standard
1055 To make things clearer, let's provide a few examples:
1058 \begin_layout Itemize
1059 The preferences set in the
1060 \begin_inset Flex CharStyle:MenuItem
1063 \begin_layout Plain Layout
1064 Tools\SpecialChar \menuseparator
1070 dialog are saved to a file
1071 \begin_inset Flex CharStyle:Code
1074 \begin_layout Plain Layout
1081 \begin_inset Flex CharStyle:Code
1084 \begin_layout Plain Layout
1093 \begin_layout Itemize
1094 When you reconfigure using
1095 \begin_inset Flex CharStyle:MenuItem
1098 \begin_layout Plain Layout
1099 Tools\SpecialChar \menuseparator
1106 \begin_inset Flex CharStyle:Code
1109 \begin_layout Plain Layout
1115 script, and the resulting files are written in your local configuration
1117 This means that any additional text class file that you might have added
1119 \begin_inset Flex CharStyle:Code
1122 \begin_layout Plain Layout
1128 will be added to the list of classes in the
1129 \begin_inset Flex CharStyle:MenuItem
1132 \begin_layout Plain Layout
1133 Document\SpecialChar \menuseparator
1142 \begin_layout Itemize
1143 If you get some updated documentation from LyX ftp site and cannot install
1144 it because you do not have sysadmin rights on your system, you can just
1146 \begin_inset Flex CharStyle:Code
1149 \begin_layout Plain Layout
1155 and the items in the
1156 \begin_inset Flex CharStyle:MenuItem
1159 \begin_layout Plain Layout
1165 menu will open them!
1168 \begin_layout Section
1169 Running LyX with multiple configurations
1172 \begin_layout Standard
1173 The configuration freedom of the local configuration directory may not suffice
1174 if you want to have more than one configuration at your disposal.
1175 For example, you may want to be use different key bindings or printer settings
1177 You can achieve this by having several such directories.
1178 You then specify which directory to use at run-time.
1181 \begin_layout Standard
1182 Invoking LyX with the command line switch
1183 \begin_inset Flex CharStyle:Code
1186 \begin_layout Plain Layout
1196 instructs the program to read the configuration from that directory, and
1197 not from the default directory.
1198 (You can determine the default directory by running LyX without the
1199 \begin_inset Flex CharStyle:Code
1202 \begin_layout Plain Layout
1208 switch.) If the specified directory does not exist, LyX offers to create
1209 it for you, just like it does for the default directory on the first time
1210 you run the program.
1211 You can modify the configuration options in this additional user directory
1212 exactly as you would for the default directory.
1213 These directories are completely independent (but read on).
1214 Note that setting the environment variable
1215 \begin_inset Flex CharStyle:Code
1218 \begin_layout Plain Layout
1224 to some value has exactly the same effect.
1227 \begin_layout Standard
1228 Having several configurations also requires more maintenance: if you want
1229 to add a new layout to
1230 \begin_inset Flex CharStyle:Code
1233 \begin_layout Plain Layout
1239 which you want available from all your configurations, you must add it
1240 to each directory separately.
1241 You can avoid this with the following trick: after LyX creates the additional
1242 directory, most of the subdirectories (see above) are empty.
1243 If you want the new configuration to mirror an existing one, replace the
1244 empty subdirectory with a symbolic link to the matching subdirectory in
1245 the existing configuration.
1247 \begin_inset Flex CharStyle:Code
1250 \begin_layout Plain Layout
1256 subdirectory, however, since it contains a file written by the configuration
1257 script (also accessible through
1258 \begin_inset Flex CharStyle:MenuItem
1261 \begin_layout Plain Layout
1262 Tools\SpecialChar \menuseparator
1268 ) which is configuration-specific.
1271 \begin_layout Chapter
1272 The Preferences dialog
1275 \begin_layout Standard
1276 All options of the preferences dialog are described in the Appendix
1278 The Preferences Dialog
1285 For some options you might find here more details.
1288 \begin_layout Section
1290 \begin_inset CommandInset label
1299 \begin_layout Standard
1300 The first step is to define your file formats if they are not already defined.
1302 \begin_inset Flex CharStyle:MenuItem
1305 \begin_layout Plain Layout
1306 Tools\SpecialChar \menuseparator
1314 \begin_inset Flex CharStyle:MenuItem
1317 \begin_layout Plain Layout
1318 File Handling\SpecialChar \menuseparator
1325 \begin_inset Flex CharStyle:MenuItem
1328 \begin_layout Plain Layout
1329 New\SpecialChar \ldots{}
1335 button to define your new format.
1337 \begin_inset Flex CharStyle:MenuItem
1340 \begin_layout Plain Layout
1346 field contains the name used to identify the format in the GUI.
1348 \begin_inset Flex CharStyle:MenuItem
1351 \begin_layout Plain Layout
1357 is used to identify the format internally.
1358 You will also need to enter a file extension.
1359 These are all required.
1361 \begin_inset Flex CharStyle:MenuItem
1364 \begin_layout Plain Layout
1370 field is used to provide a keyboard shortcut on the menus.
1371 (For example, pressing
1372 \begin_inset Flex CharStyle:MenuItem
1375 \begin_layout Plain Layout
1382 \begin_inset Flex CharStyle:MenuItem
1385 \begin_layout Plain Layout
1386 View\SpecialChar \menuseparator
1395 \begin_layout Standard
1397 \begin_inset Flex CharStyle:MenuItem
1400 \begin_layout Plain Layout
1407 \begin_inset Flex CharStyle:MenuItem
1410 \begin_layout Plain Layout
1417 For example, you might want to use
1418 \begin_inset Flex CharStyle:MenuItem
1421 \begin_layout Plain Layout
1427 to view PostScript files.
1428 You can enter the command needed to start the program in the corresponding
1430 In defining this command, you can use the four variables listed in the
1432 The viewer is launched when you view an image in LyX or use the
1433 \begin_inset Flex CharStyle:MenuItem
1436 \begin_layout Plain Layout
1443 The editor is for example launched when you right-click on an image and
1445 \begin_inset Flex CharStyle:MenuItem
1448 \begin_layout Plain Layout
1454 in the appearing context menu.
1457 \begin_layout Standard
1459 \begin_inset Flex CharStyle:MenuItem
1462 \begin_layout Plain Layout
1468 option tells LyX that a format is suitable for document export.
1469 If this is set and if a suitable conversion route exists (see sec.
1470 \begin_inset space \thinspace{}
1474 \begin_inset CommandInset ref
1476 reference "sec:Converters"
1480 ), the format will appear in the
1481 \begin_inset Flex CharStyle:MenuItem
1484 \begin_layout Plain Layout
1485 File\SpecialChar \menuseparator
1492 The format will also appear in the
1493 \begin_inset Flex CharStyle:MenuItem
1496 \begin_layout Plain Layout
1502 menu if a viewer is specified for the format.
1503 Pure image formats, such as
1504 \begin_inset Flex CharStyle:Code
1507 \begin_layout Plain Layout
1513 , should not use this option.
1514 Formats that can both represent vector graphics and documents like
1515 \begin_inset Flex CharStyle:Code
1518 \begin_layout Plain Layout
1527 \begin_layout Standard
1529 \begin_inset Flex CharStyle:MenuItem
1532 \begin_layout Plain Layout
1533 Vector graphics format
1538 tells LyX that a format can contain vector graphics.
1539 This information is used to determine the target format of included graphics
1541 \begin_inset Flex CharStyle:MenuItem
1544 \begin_layout Plain Layout
1551 Included graphics may need to be converted to either
1552 \begin_inset Flex CharStyle:MenuItem
1555 \begin_layout Plain Layout
1562 \begin_inset Flex CharStyle:MenuItem
1565 \begin_layout Plain Layout
1572 \begin_inset Flex CharStyle:MenuItem
1575 \begin_layout Plain Layout
1582 \begin_inset Flex CharStyle:MenuItem
1585 \begin_layout Plain Layout
1591 cannot handle other image formats.
1592 If an included graphic is not already in
1593 \begin_inset Flex CharStyle:MenuItem
1596 \begin_layout Plain Layout
1603 \begin_inset Flex CharStyle:MenuItem
1606 \begin_layout Plain Layout
1613 \begin_inset Flex CharStyle:MenuItem
1616 \begin_layout Plain Layout
1622 format, it is converted to
1623 \begin_inset Flex CharStyle:MenuItem
1626 \begin_layout Plain Layout
1632 if the vector format option is set, and otherwise to
1633 \begin_inset Flex CharStyle:MenuItem
1636 \begin_layout Plain Layout
1645 \begin_layout Section
1649 \begin_layout Standard
1650 Since all conversions from one format to another take place in LyX's temporary
1651 directory, it is sometimes necessary to modify a file before copying it
1652 to the temporary directory in order that the conversion may be performed.
1656 \begin_layout Plain Layout
1657 For example, the file may refer to other files—images, for example—using
1658 relative file names, and these may become invalid when the file is copied
1659 to the temporary directory.
1664 This is done by a Copier: It copies a file to (or from) the temporary directory
1665 and may modify it in the process.
1668 \begin_layout Standard
1669 The definitions of the copiers may use four variables:
1672 \begin_layout Labeling
1673 \labelwidthstring 00.00.0000
1674 \begin_inset Flex CharStyle:Code
1677 \begin_layout Plain Layout
1683 The LyX system directory (e.
1684 \begin_inset space \thinspace{}
1688 \begin_inset space \space{}
1692 \begin_inset Flex CharStyle:MenuItem
1695 \begin_layout Plain Layout
1704 \begin_layout Labeling
1705 \labelwidthstring 00.00.0000
1706 \begin_inset Flex CharStyle:Code
1709 \begin_layout Plain Layout
1718 \begin_layout Labeling
1719 \labelwidthstring 00.00.0000
1720 \begin_inset Flex CharStyle:Code
1723 \begin_layout Plain Layout
1732 \begin_layout Labeling
1733 \labelwidthstring 00.00.0000
1734 \begin_inset Flex CharStyle:Code
1737 \begin_layout Plain Layout
1746 \begin_layout Standard
1747 The latter should be the filename as it would be used in a LaTeX's
1754 It is relevant only when exporting files suitable for such inclusion.
1757 \begin_layout Standard
1758 Copiers can be used to do almost anything with output files.
1759 For example, suppose you want generated pdf files to be copied to a special
1761 \begin_inset Flex CharStyle:Code
1764 \begin_layout Plain Layout
1771 Then you could write a shell script such as this one:
1774 \begin_layout Standard
1775 \begin_inset listings
1779 \begin_layout Plain Layout
1784 \begin_layout Plain Layout
1789 \begin_layout Plain Layout
1791 TOFILE=`basename $2`
1794 \begin_layout Plain Layout
1796 cp $FROMFILE /home/you/pdf/$TOFILE
1801 Save it in your local LyX directory—say,
1802 \begin_inset Flex CharStyle:Code
1805 \begin_layout Plain Layout
1806 /home/you/.lyx/scripts/pdfcopier.sh
1811 —and make it executable, if you need to do so on your platform.
1813 \begin_inset Flex CharStyle:MenuItem
1816 \begin_layout Plain Layout
1817 Tools\SpecialChar \menuseparator
1823 dialog, select under
1824 \begin_inset Flex CharStyle:MenuItem
1827 \begin_layout Plain Layout
1828 File Handling\SpecialChar \menuseparator
1835 \begin_inset Flex CharStyle:MenuItem
1838 \begin_layout Plain Layout
1844 format—or one of the other pdf formats—and enter
1845 \begin_inset Flex CharStyle:Code
1848 \begin_layout Plain Layout
1849 pdfcopier.sh $$i $$o
1855 \begin_inset Flex CharStyle:MenuItem
1858 \begin_layout Plain Layout
1868 \begin_layout Standard
1869 Copiers are used by LyX in various of its own conversions.
1870 For example, if appropriate programs are found, LyX will automatically
1871 install copiers for the
1872 \begin_inset Flex CharStyle:MenuItem
1875 \begin_layout Plain Layout
1882 \begin_inset Flex CharStyle:MenuItem
1885 \begin_layout Plain Layout
1887 \begin_inset space ~
1896 When these formats are exported, the copier sees that not just the main
1897 HTML file but various associated files (style files, images, etc.) are also
1899 All these files are written to a subdirectory of the directory in which
1900 the original LyX file was found.
1904 \begin_layout Plain Layout
1905 This copier can be customized.
1907 \begin_inset Quotes eld
1911 \begin_inset Quotes erd
1914 argument takes a comma-separated list of extensions to be copied; if it
1915 is omitted, all files will be copied.
1917 \begin_inset Quotes eld
1921 \begin_inset Quotes erd
1924 argument determines the extension added to the generated directory.
1926 \begin_inset Quotes eld
1930 \begin_inset Flex CharStyle:MenuItem
1933 \begin_layout Plain Layout
1940 \begin_inset Quotes erd
1943 , so HTML generated from
1944 \begin_inset Flex CharStyle:MenuItem
1947 \begin_layout Plain Layout
1948 /path/to/filename.lyx
1954 \begin_inset Flex CharStyle:MenuItem
1957 \begin_layout Plain Layout
1958 /path/to/filename.html.LyXconv
1972 \begin_layout Section
1974 \begin_inset CommandInset label
1976 name "sec:Converters"
1983 \begin_layout Standard
1984 You can define your own Converters to convert files between different formats.
1986 \begin_inset Flex CharStyle:MenuItem
1989 \begin_layout Plain Layout
1990 Tools\SpecialChar \menuseparator
1991 Preferences\SpecialChar \menuseparator
1992 File Handling\SpecialChar \menuseparator
2001 \begin_layout Standard
2002 To define a new converter, select the
2003 \begin_inset Flex CharStyle:MenuItem
2006 \begin_layout Plain Layout
2008 \begin_inset space ~
2017 \begin_inset Flex CharStyle:MenuItem
2020 \begin_layout Plain Layout
2022 \begin_inset space ~
2030 from the drop-down lists, enter the command needed for the conversion,
2032 \begin_inset Flex CharStyle:MenuItem
2035 \begin_layout Plain Layout
2042 Several variables can be used in the definition of converters:
2045 \begin_layout Labeling
2046 \labelwidthstring 00.00.0000
2047 \begin_inset Flex CharStyle:Code
2050 \begin_layout Plain Layout
2056 The LyX system directory
2059 \begin_layout Labeling
2060 \labelwidthstring 00.00.0000
2061 \begin_inset Flex CharStyle:Code
2064 \begin_layout Plain Layout
2073 \begin_layout Labeling
2074 \labelwidthstring 00.00.0000
2075 \begin_inset Flex CharStyle:Code
2078 \begin_layout Plain Layout
2087 \begin_layout Labeling
2088 \labelwidthstring 00.00.0000
2089 \begin_inset Flex CharStyle:Code
2092 \begin_layout Plain Layout
2098 The base filename of the input file (i.
2099 \begin_inset space \thinspace{}
2102 g., without the extension)
2105 \begin_layout Labeling
2106 \labelwidthstring 00.00.0000
2107 \begin_inset Flex CharStyle:Code
2110 \begin_layout Plain Layout
2116 The path to the input file
2119 \begin_layout Labeling
2120 \labelwidthstring 00.00.0000
2121 \begin_inset Flex CharStyle:Code
2124 \begin_layout Plain Layout
2130 The path to the original input file (this is different from $$p when a
2131 chain of converters is called).
2134 \begin_layout Standard
2136 \begin_inset Flex CharStyle:MenuItem
2139 \begin_layout Plain Layout
2141 \begin_inset space ~
2149 field you can enter the following flags, separated by commas:
2152 \begin_layout Labeling
2153 \labelwidthstring 00.00.0000
2154 \begin_inset Flex CharStyle:Code
2157 \begin_layout Plain Layout
2163 This converter runs some form of LaTeX.
2164 This will make LyX's LaTeX error logs available.
2167 \begin_layout Labeling
2168 \labelwidthstring 00.00.0000
2169 \begin_inset Flex CharStyle:Code
2172 \begin_layout Plain Layout
2179 \begin_inset Flex CharStyle:MenuItem
2182 \begin_layout Plain Layout
2188 file for the conversion.
2191 \begin_layout Labeling
2192 \labelwidthstring 00.00.0000
2193 \begin_inset Flex CharStyle:Code
2196 \begin_layout Plain Layout
2205 \begin_layout Standard
2206 The following three flags are not really flags at all because they take
2208 \begin_inset Flex CharStyle:MenuItem
2211 \begin_layout Plain Layout
2213 \begin_inset space ~
2217 \begin_inset space ~
2228 \begin_layout Labeling
2229 \labelwidthstring 00.00.0000
2230 \begin_inset Flex CharStyle:Code
2233 \begin_layout Plain Layout
2239 If set, the converter's standard error will be redirected to a file
2240 \begin_inset Flex CharStyle:Code
2243 \begin_layout Plain Layout
2249 , and the script given as argument will be run as:
2250 \begin_inset Flex CharStyle:Code
2253 \begin_layout Plain Layout
2254 script < infile.out > infile.log
2260 The argument may contain
2261 \begin_inset Flex CharStyle:Code
2264 \begin_layout Plain Layout
2273 \begin_layout Labeling
2274 \labelwidthstring 00.00.0000
2275 \begin_inset Flex CharStyle:Code
2278 \begin_layout Plain Layout
2284 The name of the directory in which the converter will dump the generated
2286 LyX will not create this directory, and it does not copy anything into
2287 it, though it will copy this directory to the destination.
2288 The argument may contain
2289 \begin_inset Flex CharStyle:Code
2292 \begin_layout Plain Layout
2298 , which will be replaced by the base name of the input and output files,
2299 respectively, when the directory is copied.
2300 \begin_inset Newline newline
2303 Note that resultdir and usetempdir make no sense together.
2304 The latter will be ignored if the former is given.
2307 \begin_layout Labeling
2308 \labelwidthstring 00.00.0000
2309 \begin_inset Flex CharStyle:Code
2312 \begin_layout Plain Layout
2318 Determines the output file name and may, contain
2319 \begin_inset Flex CharStyle:Code
2322 \begin_layout Plain Layout
2329 Sensible only with resultdir and optional even then; if not given, it defaults
2333 \begin_layout Standard
2334 None of these last three are presently used in any of the converters that
2335 are installed with LyX.
2339 \begin_layout Standard
2340 You do not have to define converters for all formats between which you want
2342 For example, you will note that there is no `LyX to PostScript' converter,
2343 but LyX will export PostScript.
2344 It does so by first creating a LaTeX file (no converter needs to be defined
2345 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2346 and finally converting the resulting DVI file to PostScript.
2347 LyX finds such `chains' of converters automatically, and it will always
2348 choose the shortest possible chain.
2349 You can, though, still define multiple conversion methods between file
2351 For example, the standard LyX configuration provides three ways to convert
2352 LaTeX to PDF: Directly, using
2353 \begin_inset Flex CharStyle:MenuItem
2356 \begin_layout Plain Layout
2362 ; via (DVI and) PostScript, using
2363 \begin_inset Flex CharStyle:MenuItem
2366 \begin_layout Plain Layout
2373 \begin_inset Flex CharStyle:MenuItem
2376 \begin_layout Plain Layout
2383 To define such alternate chains, you must define multiple target `file
2384 formats', as described in section
2385 \begin_inset CommandInset ref
2387 reference "sec:Formats"
2392 For example, in the standard configuration, the formats named
2393 \begin_inset Flex CharStyle:MenuItem
2396 \begin_layout Plain Layout
2403 \begin_inset Flex CharStyle:MenuItem
2406 \begin_layout Plain Layout
2413 \begin_inset Flex CharStyle:MenuItem
2416 \begin_layout Plain Layout
2422 are defined, all of which share the extension
2423 \begin_inset Flex CharStyle:MenuItem
2426 \begin_layout Plain Layout
2432 , and which correspond to the conversion methods just mentioned.
2435 \begin_layout Chapter
2436 Internationalizing LyX
2437 \begin_inset CommandInset label
2439 name "cha:Internationalizing-LyX"
2446 \begin_layout Standard
2447 LyX supports using a translated interface.
2448 Last time we checked, LyX provided text in thirty languages.
2449 The language of choice is called your
2454 (For further reading on locale settings, see also the documentation for
2455 locale that comes with your operating system.
2456 For Linux, the manual page for
2457 \begin_inset Flex CharStyle:Code
2460 \begin_layout Plain Layout
2466 could be a good place to start).
2469 \begin_layout Standard
2470 Notice that these translations will work, but do contain a few flaws.
2471 In particular, all dialogs have been designed with the English text in
2472 mind, which means that some of the translated text will be too large to
2473 fit within the space allocated.
2474 This is only a display problem and will not cause any harm.
2475 Also, you will find that some of the translations do not define shortcut
2476 keys for everything.
2477 Sometimes, there are simply not enough free letters to do it.
2478 Other times, the translator just hasn't got around to doing it yet.
2479 Our localization team, which you may wish to join,
2483 \begin_layout Plain Layout
2484 If you are a fluent speaker of a language other than English, joining these
2485 teams is a great way to give back to the LyX community!
2490 will of course try to fix these shortcomings in future versions of LyX.
2493 \begin_layout Section
2497 \begin_layout Subsection
2498 Translating the graphical user interface (text messages).
2501 \begin_layout Standard
2503 \begin_inset Flex CharStyle:Code
2506 \begin_layout Plain Layout
2512 library to handle the internationalization of the interface.
2513 To have LyX speak your favorite language in all menus and dialogs, you
2515 \begin_inset Flex CharStyle:Code
2518 \begin_layout Plain Layout
2524 -file for that language.
2525 When this is available, you'll have to generate a
2526 \begin_inset Flex CharStyle:Code
2529 \begin_layout Plain Layout
2535 -file from it and install the
2536 \begin_inset Flex CharStyle:Code
2539 \begin_layout Plain Layout
2546 The process of doing all of this is explained in the documentation for
2548 \begin_inset Flex CharStyle:Code
2551 \begin_layout Plain Layout
2558 It is possible to do this just for yourself, but if you're going to do
2559 it, you might as well share the results of your labors with the rest of
2561 Send a message to the LyX developers' list for more information about how
2565 \begin_layout Standard
2566 In short, this is what you should do (xx denotes the language code):
2569 \begin_layout Itemize
2570 Check out the LyX source code.
2572 \begin_inset CommandInset href
2574 name "information on the web"
2575 target "http://www.lyx.org/devel/cvs.php"
2582 \begin_layout Itemize
2584 \begin_inset Flex CharStyle:Code
2587 \begin_layout Plain Layout
2593 to the folder of the
2594 \begin_inset Flex CharStyle:Code
2597 \begin_layout Plain Layout
2605 \begin_inset Flex CharStyle:Code
2608 \begin_layout Plain Layout
2616 \begin_inset Flex CharStyle:Code
2619 \begin_layout Plain Layout
2625 doesn't exist anywhere, it can be remade with the console command
2626 \begin_inset Flex CharStyle:Code
2629 \begin_layout Plain Layout
2635 in that directory, or you can use an existing po-file for some other language
2639 \begin_layout Itemize
2641 \begin_inset Flex CharStyle:Code
2644 \begin_layout Plain Layout
2654 \begin_layout Plain Layout
2655 This is just a text file, so it can be edited in any text editor.
2656 But there are also specialized programs that support such editing, such
2661 (for all platforms) or
2670 contains a `mode' for editing
2671 \begin_inset Flex CharStyle:Code
2674 \begin_layout Plain Layout
2685 For some menu- and widget-labels, there are also shortcut keys that should
2687 Those keys are marked after a `|', and should be translated according to
2688 the words and phrases of the language.
2689 You should also fill also out the information at the beginning of the new
2691 \begin_inset Flex CharStyle:Code
2694 \begin_layout Plain Layout
2700 -file with your email-address, etc., so people know where to reach you with
2701 suggestions and entertaining flames.
2704 \begin_layout Standard
2705 If you are just doing this on your own, then:
2708 \begin_layout Itemize
2710 \begin_inset Flex CharStyle:Code
2713 \begin_layout Plain Layout
2720 This can be done with
2721 \begin_inset Flex CharStyle:Code
2724 \begin_layout Plain Layout
2725 msgfmt -o xx.mo < xx.po
2733 \begin_layout Itemize
2735 \begin_inset Flex CharStyle:Code
2738 \begin_layout Plain Layout
2744 -file to your locale-tree, at the correct directory for application messages
2749 xx, and under the name
2750 \begin_inset Flex CharStyle:Code
2753 \begin_layout Plain Layout
2760 \begin_inset space \thinspace{}
2764 \begin_inset space \space{}
2768 \begin_inset Flex CharStyle:Code
2771 \begin_layout Plain Layout
2772 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2782 \begin_layout Standard
2783 As said, however, it would be best if the new
2784 \begin_inset Flex CharStyle:Code
2787 \begin_layout Plain Layout
2793 -file could be added to the LyX distribution, so others can use it.
2794 Adding it involves making additional changes to LyX.
2795 So send an email to the developers' mailing list if you're interested in
2799 \begin_layout Subsubsection
2803 \begin_layout Standard
2804 Sometimes it turns out that one English message needs to be translated into
2805 different messages in the target language.
2806 One example is the message
2807 \begin_inset Flex CharStyle:Code
2810 \begin_layout Plain Layout
2816 which has the German translation
2824 , depending upon exactly what the English
2825 \begin_inset Quotes eld
2829 \begin_inset Quotes erd
2834 \begin_inset Flex CharStyle:Code
2837 \begin_layout Plain Layout
2843 does not handle such ambiguous translations.
2844 Therefore you have to add some context information to the message: Instead
2846 \begin_inset Flex CharStyle:Code
2849 \begin_layout Plain Layout
2856 \begin_inset Flex CharStyle:Code
2859 \begin_layout Plain Layout
2860 To[[as in 'From format x to format y']]
2866 \begin_inset Flex CharStyle:Code
2869 \begin_layout Plain Layout
2870 To[[as in 'From page x to page y']].
2875 Now the two occurrences of
2876 \begin_inset Flex CharStyle:Code
2879 \begin_layout Plain Layout
2886 \begin_inset Flex CharStyle:Code
2889 \begin_layout Plain Layout
2895 and can be translated correctly to
2906 \begin_layout Standard
2907 Of course the context information needs to be stripped off the original
2908 message when no translation is used.
2909 Therefore you have to put it in double square brackets at the end of the
2910 message (see the example above).
2911 The translation mechanism of LyX ensures that everything in double square
2912 brackets at the end of messages is removed before displaying the message.
2915 \begin_layout Subsection
2916 Translating the documentation.
2919 \begin_layout Standard
2920 The online documentation (in the
2921 \begin_inset Flex CharStyle:MenuItem
2924 \begin_layout Plain Layout
2930 -menu) can (and should!) be translated.
2931 If there are translated versions of the documentation available
2935 \begin_layout Plain Layout
2936 As of March 2008, at least some of the documents have been translated into
2937 fourteen languages, with the Tutorial available in a few more.
2942 and the locale is set accordingly, these will be used automagically by
2944 LyX looks for translated versions as
2945 \begin_inset Flex CharStyle:Code
2948 \begin_layout Plain Layout
2949 LyXDir/doc/xx/DocName.lyx
2955 \begin_inset Flex CharStyle:Code
2958 \begin_layout Plain Layout
2964 is the code for the language currently in use.
2965 If there are no translated documents, the default English versions will
2967 Note that the translated versions must have the same filenames (
2968 \begin_inset Flex CharStyle:Code
2971 \begin_layout Plain Layout
2977 above) as the original.
2978 If you feel up to translating the documentation (an excellent way to proof-read
2979 the original documentation by the way!), there are a few things you should
2983 \begin_layout Itemize
2984 Check out the documentation translation web page at
2985 \begin_inset CommandInset href
2987 name "http://www.lyx.org/Translation"
2988 target "http://www.lyx.org/Translation"
2993 That way, you can find out which (if any) documents have already been translate
2994 d into your language.
2995 You can also find out who (if anyone) is organizing the effort to translate
2996 the documentation into your language.
2997 If no one is organizing the effort, please let us know that you're interested.
3000 \begin_layout Standard
3001 Once you get to actually translating, here's a few hints for you that may
3005 \begin_layout Itemize
3006 Join the documentation team! There is information on how to do that in
3007 \begin_inset Flex CharStyle:Code
3010 \begin_layout Plain Layout
3017 \begin_inset Flex CharStyle:MenuItem
3020 \begin_layout Plain Layout
3021 Help\SpecialChar \menuseparator
3027 ), which by the way is the first document you should translate.
3030 \begin_layout Itemize
3031 Learn the typographic conventions for the language you are translating to.
3032 Typography is an ancient art and over the centuries, a great variety of
3033 conventions have developed throughout different parts of the world.
3034 Also study the professional terminology amongst typographers in your country.
3035 Inventing your own terminology will only confuse the users.
3038 (Warning! Typography is addictive!)
3041 \begin_layout Itemize
3042 Make a copy of the document.
3043 This will be your working copy.
3044 You can use this as your personal translated help-file by placing it in
3046 \begin_inset Flex CharStyle:Code
3049 \begin_layout Plain Layout
3058 \begin_layout Itemize
3059 Sometimes the original document (from the LyX-team) will be updated.
3060 Use the source viewer at
3061 \begin_inset CommandInset href
3063 name "http://www.lyx.org/trac/timeline"
3064 target "http://www.lyx.org/trac/timeline"
3068 to see what has been changed.
3069 That way you can easily see which parts of the translated document need
3073 \begin_layout Standard
3074 If you ever find an error in the original document, fix it and notify the
3075 rest of the documentation team of the changes! (You didn't forget to join
3076 the documentation team, did you?)
3079 \begin_layout Standard
3080 \begin_inset Branch OutDated
3083 \begin_layout Section
3084 International Keyboard Support
3087 \begin_layout Standard
3090 [Editor's Note: The following section is by
3098 It needs to be fixed to conform to the new Documentation Style sheet and
3099 to make use of the new v1.0 features.
3100 The whole thing also needs to be merged with the section following it.-jw
3101 It may also be badly out of date.-rh (2008)]
3104 \begin_layout Subsection
3105 Defining Own Keymaps: Keymap File Format
3108 \begin_layout Standard
3109 Let's look at a keyboard definition file a little closer.
3110 It is a plain text file defining
3113 \begin_layout Itemize
3114 key-to-key or key-to-string translations
3117 \begin_layout Itemize
3121 \begin_layout Itemize
3122 dead keys exceptions
3125 \begin_layout Standard
3126 To define key-to-key or key-to-string translation, use this command:
3129 \begin_layout Quotation
3130 \begin_inset Flex CharStyle:Code
3133 \begin_layout Plain Layout
3142 \begin_inset Flex CharStyle:Code
3145 \begin_layout Plain Layout
3154 \begin_layout Standard
3156 \begin_inset Flex CharStyle:Code
3159 \begin_layout Plain Layout
3165 is the key to be translated and
3166 \begin_inset Flex CharStyle:Code
3169 \begin_layout Plain Layout
3175 is the string to be inserted into the document.
3176 To define dead keys, use:
3179 \begin_layout Quotation
3180 \begin_inset Flex CharStyle:Code
3183 \begin_layout Plain Layout
3192 \begin_inset Flex CharStyle:Code
3195 \begin_layout Plain Layout
3204 \begin_layout Standard
3206 \begin_inset Flex CharStyle:Code
3209 \begin_layout Plain Layout
3215 is a keyboard key and
3216 \begin_inset Flex CharStyle:Code
3219 \begin_layout Plain Layout
3226 The following dead keys are supported (shortcut name is in parentheses):
3229 \begin_layout Quotation
3233 \begin_inset space \hfill{}
3239 \begin_layout Quotation
3241 \begin_inset space \hfill{}
3247 \begin_layout Quotation
3249 \begin_inset space \hfill{}
3255 \begin_layout Quotation
3257 \begin_inset space \hfill{}
3263 \begin_layout Quotation
3265 \begin_inset space \hfill{}
3271 \begin_layout Quotation
3273 \begin_inset space \hfill{}
3280 \begin_layout Plain Layout
3292 \begin_layout Quotation
3294 \begin_inset space \hfill{}
3300 \begin_layout Quotation
3302 \begin_inset space \hfill{}
3309 \begin_layout Plain Layout
3321 \begin_layout Quotation
3323 \begin_inset space \hfill{}
3329 \begin_layout Quotation
3331 \begin_inset space \hfill{}
3337 \begin_layout Quotation
3339 \begin_inset space \hfill{}
3346 \begin_layout Plain Layout
3358 \begin_layout Quotation
3360 \begin_inset space \hfill{}
3367 \begin_layout Plain Layout
3379 \begin_layout Quotation
3381 \begin_inset space \hfill{}
3387 \begin_layout Quotation
3388 hungarian umlaut (hug)
3389 \begin_inset space \hfill{}
3395 \begin_layout Quotation
3397 \begin_inset space \hfill{}
3403 \begin_layout Quotation
3405 \begin_inset space \hfill{}
3412 \begin_layout Plain Layout
3424 \begin_layout Standard
3425 Since in many international keyboards there are exceptions to what some
3426 dead keys should do, you can define them using
3429 \begin_layout Quotation
3430 \begin_inset Flex CharStyle:Code
3433 \begin_layout Plain Layout
3441 deadkey key outstring
3444 \begin_layout Standard
3445 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3449 \begin_layout Quotation
3450 \begin_inset Flex CharStyle:Code
3453 \begin_layout Plain Layout
3466 \begin_layout Standard
3467 to make it work correctly.
3468 Also, you have to define as exceptions dead keys over i and j, to remove
3469 the dot from them before inserting an accent mark.
3470 I will change this when the time comes, but so far I haven't had time.
3473 \begin_layout Standard
3474 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3477 \begin_inset Flex CharStyle:Code
3480 \begin_layout Plain Layout
3486 have different meaning.
3488 \begin_inset Flex CharStyle:Code
3491 \begin_layout Plain Layout
3497 marks comments, quotes start and end LaTeX-style commands.
3498 To enter quote, you'll need to use
3499 \begin_inset Flex CharStyle:Code
3502 \begin_layout Plain Layout
3511 \begin_inset Flex CharStyle:Code
3514 \begin_layout Plain Layout
3521 \begin_inset Flex CharStyle:Code
3524 \begin_layout Plain Layout
3535 \begin_layout Standard
3536 If you make a keyboard description file that works for your language, please
3537 mail it to me, so I can include it in the next keymap distribution.
3540 \begin_layout Standard
3541 More keywords will be supported in keymap configuration file in future,
3545 \begin_layout Itemize
3546 \begin_inset Flex CharStyle:Code
3549 \begin_layout Plain Layout
3560 \begin_inset space \hfill{}
3564 \begin_inset Flex CharStyle:Code
3567 \begin_layout Plain Layout
3576 \begin_layout Itemize
3577 \begin_inset Flex CharStyle:Code
3580 \begin_layout Plain Layout
3591 \begin_inset space \hfill{}
3595 \begin_inset Flex CharStyle:Code
3598 \begin_layout Plain Layout
3604 an external keymap translation program
3607 \begin_layout Standard
3608 Also, it should look into
3609 \begin_inset Flex CharStyle:Code
3612 \begin_layout Plain Layout
3618 file for defaults, too (for example, a
3619 \begin_inset Flex CharStyle:Code
3622 \begin_layout Plain Layout
3630 option to include default keyboard).
3638 \begin_layout Section
3639 International Keymap Stuff
3640 \begin_inset CommandInset label
3642 name "sec:International-Keymap-Stuff"
3649 \begin_layout Standard
3650 \begin_inset Note Note
3653 \begin_layout Plain Layout
3654 In doing the revisions on this document in March 2008, I did not look over
3655 this stuff, as I do not understand it.
3656 It would be good if someone else could do so.
3665 \begin_layout Standard
3666 The next two sections describe the
3667 \begin_inset Flex CharStyle:Code
3670 \begin_layout Plain Layout
3679 \begin_inset Flex CharStyle:Code
3682 \begin_layout Plain Layout
3690 file syntax in detail.
3691 These sections should help you design your own key map if the ones provided
3692 do not meet your needs.
3695 \begin_layout Subsection
3699 \begin_layout Standard
3703 \begin_inset Flex CharStyle:Code
3706 \begin_layout Plain Layout
3712 file maps keystrokes to characters or strings.
3713 As the name suggests, it sets a keyboard mapping.
3715 \begin_inset Flex CharStyle:Code
3718 \begin_layout Plain Layout
3729 \begin_inset Flex CharStyle:Code
3732 \begin_layout Plain Layout
3747 \begin_inset Flex CharStyle:Code
3750 \begin_layout Plain Layout
3763 \begin_inset Flex CharStyle:Code
3766 \begin_layout Plain Layout
3775 \begin_inset Flex CharStyle:Code
3778 \begin_layout Plain Layout
3786 are described in this section.
3789 \begin_layout Labeling
3790 \labelwidthstring 00.00.0000
3791 \begin_inset Flex CharStyle:Code
3794 \begin_layout Plain Layout
3802 Map a character to a string
3805 \begin_layout LyX-Code
3820 \begin_layout Standard
3853 the double-quote (")
3870 must be escaped with a preceding backslash (
3881 \begin_layout Standard
3883 \begin_inset Flex CharStyle:MenuItem
3886 \begin_layout Plain Layout
3894 statement to cause the symbol
3895 \begin_inset Flex CharStyle:MenuItem
3898 \begin_layout Plain Layout
3906 to be output for the keystroke
3907 \begin_inset Flex CharStyle:MenuItem
3910 \begin_layout Plain Layout
3921 \begin_layout LyX-Code
3927 \begin_layout Labeling
3928 \labelwidthstring 00.00.0000
3929 \begin_inset Flex CharStyle:Code
3932 \begin_layout Plain Layout
3940 Specify an accent character
3943 \begin_layout LyX-Code
3952 \begin_layout Standard
3953 This will make the cha
3991 This is the dead key
3995 \begin_layout Plain Layout
4002 refers to a key that does not produce a character by itself, but when followed
4003 with another key, produces the desired accent character.
4004 For example, a German characte
4006 r with an umlaut like
4016 can be produced in this manner.
4025 \begin_layout Standard
4038 and then another key not in
4055 followed by the other, not allowed key, as output.
4059 \begin_inset Flex CharStyle:MenuItem
4062 \begin_layout Plain Layout
4070 cancels a dead key, so if
4081 \begin_inset Flex CharStyle:MenuItem
4084 \begin_layout Plain Layout
4093 , the cursor will not go one position backwards but will instead cancel
4109 might have had on the next keystroke.
4113 \begin_layout Standard
4114 The following example specifies that the character ' is to be an acute accent,
4115 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4118 \begin_layout LyX-Code
4121 kmod ' acute aeiouAEIOU
4124 \begin_layout Labeling
4125 \labelwidthstring 00.00.0000
4126 \begin_inset Flex CharStyle:Code
4129 \begin_layout Plain Layout
4135 Specify an exception to the accent character
4138 \begin_layout LyX-Code
4147 \begin_layout Standard
4148 This defines an exce
4189 have been assigned a keystroke with a previous
4192 \begin_inset Flex CharStyle:Code
4195 \begin_layout Plain Layout
4219 must not belong in the
4266 If such a declaration does not exist in
4274 \begin_inset Flex CharStyle:Code
4277 \begin_layout Plain Layout
4311 \begin_inset Flex CharStyle:Code
4314 \begin_layout Plain Layout
4328 \begin_layout Standard
4329 The following command produces causes äi to be produced when you enter acute-i
4333 \begin_layout LyX-Code
4347 \begin_layout Labeling
4348 \labelwidthstring 00.00.0000
4349 \begin_inset Flex CharStyle:Code
4352 \begin_layout Plain Layout
4358 Combine two accent characters
4361 \begin_layout LyX-Code
4367 accent1 accent2 allowed
4370 \begin_layout Standard
4371 This one is getting pretty esoteric.
4372 It allows you to combine the effect
4428 \begin_inset Flex CharStyle:Code
4431 \begin_layout Plain Layout
4459 \begin_layout Standard
4460 Consider this example from the
4461 \begin_inset Flex CharStyle:Code
4464 \begin_layout Plain Layout
4475 \begin_layout LyX-Code
4478 kmod ; acute aeioyvhAEIOYVH
4482 kcomb acute umlaut iyIY
4485 \begin_layout Standard
4486 This allows you to press
4487 \begin_inset Flex CharStyle:MenuItem
4490 \begin_layout Plain Layout
4498 and get the effect of
4499 \begin_inset Flex CharStyle:Code
4502 \begin_layout Plain Layout
4521 in this case cancels the last dead key, so if you press
4522 \begin_inset Flex CharStyle:MenuItem
4525 \begin_layout Plain Layout
4534 \begin_inset Flex CharStyle:Code
4537 \begin_layout Plain Layout
4550 \begin_layout Subsection
4554 \begin_layout Standard
4556 \begin_inset Flex CharStyle:Code
4559 \begin_layout Plain Layout
4567 mapping is performed, a
4568 \begin_inset Flex CharStyle:Code
4571 \begin_layout Plain Layout
4581 file maps the strings that the symbols generate to characters in the current
4583 The LyX distribution currently includes at least the
4584 \begin_inset Flex CharStyle:Code
4587 \begin_layout Plain Layout
4596 \begin_inset Flex CharStyle:Code
4599 \begin_layout Plain Layout
4610 \begin_layout Standard
4612 \begin_inset Flex CharStyle:Code
4615 \begin_layout Plain Layout
4623 file is a sequence of declarations of the form
4626 \begin_layout LyX-Code
4639 \begin_layout Standard
4640 For example, in order to map
4641 \begin_inset Flex CharStyle:MenuItem
4644 \begin_layout Plain Layout
4654 to the corresponding character in the iso-8859-1 set (233), the following
4658 \begin_layout LyX-Code
4666 \begin_layout Standard
4668 \begin_inset Flex CharStyle:Code
4671 \begin_layout Plain Layout
4680 \begin_inset Flex CharStyle:Code
4683 \begin_layout Plain Layout
4701 the same character can apply to more than one string.
4703 \begin_inset Flex CharStyle:Code
4706 \begin_layout Plain Layout
4717 \begin_layout LyX-Code
4729 \begin_inset Newline newline
4745 \begin_layout Standard
4746 If LyX cannot find a mapping for the string produced by the keystroke or
4747 a deadkey sequence, it will check if it looks like an accented char and
4748 try to draw an accent over the character on screen.
4751 \begin_layout Subsection
4755 \begin_layout Standard
4756 There is a second way to add support for international characters through
4757 so-called dead-keys.
4758 A dead-key works in combination with a letter to produce an accented character.
4759 Here, we'll explain how to create a really simple dead-key to illustrate
4763 \begin_layout Standard
4764 Suppose you happen to need the circumflex character,
4765 \begin_inset Quotes eld
4769 \begin_inset Quotes erd
4774 \begin_inset Flex CharStyle:MenuItem
4777 \begin_layout Plain Layout
4784 \begin_inset space ~
4788 \begin_inset Flex CharStyle:MenuItem
4791 \begin_layout Plain Layout
4797 ] to the LyX command
4798 \begin_inset Flex CharStyle:Code
4801 \begin_layout Plain Layout
4808 \begin_inset Flex CharStyle:Code
4811 \begin_layout Plain Layout
4818 Now, whenever you type the
4819 \begin_inset Flex CharStyle:MenuItem
4822 \begin_layout Plain Layout
4828 -key followed by a letter, that letter will have a circumflex accent on
4830 For example, the sequence
4831 \begin_inset Quotes eld
4835 \begin_inset Flex CharStyle:MenuItem
4838 \begin_layout Plain Layout
4845 \begin_inset Quotes erd
4848 produces the letter:
4849 \begin_inset Quotes eld
4853 \begin_inset Quotes erd
4857 If you tried to type
4858 \begin_inset Quotes eld
4862 \begin_inset Flex CharStyle:MenuItem
4865 \begin_layout Plain Layout
4872 \begin_inset Quotes erd
4875 , however, LyX will complain with a beep, since a
4876 \begin_inset Quotes eld
4880 \begin_inset Flex CharStyle:MenuItem
4883 \begin_layout Plain Layout
4890 \begin_inset Quotes erd
4893 never takes a circumflex accent.
4895 \begin_inset Flex CharStyle:MenuItem
4898 \begin_layout Plain Layout
4904 after a dead-key produces the bare-accent.
4905 Please note this last point! If you bind a key to a dead-key, you'll need
4906 to rebind the character on that key to yet another key.
4908 \begin_inset Flex CharStyle:MenuItem
4911 \begin_layout Plain Layout
4917 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4920 \begin_layout Standard
4921 One common way to bind dead-keys is to use
4922 \begin_inset Flex CharStyle:MenuItem
4925 \begin_layout Plain Layout
4932 \begin_inset Flex CharStyle:MenuItem
4935 \begin_layout Plain Layout
4942 \begin_inset Flex CharStyle:MenuItem
4945 \begin_layout Plain Layout
4951 in combination with an accent, like
4952 \begin_inset Quotes eld
4956 \begin_inset Flex CharStyle:MenuItem
4959 \begin_layout Plain Layout
4966 \begin_inset Quotes erd
4970 \begin_inset Quotes eld
4974 \begin_inset Flex CharStyle:MenuItem
4977 \begin_layout Plain Layout
4984 \begin_inset Quotes erd
4988 \begin_inset Quotes eld
4992 \begin_inset Flex CharStyle:MenuItem
4995 \begin_layout Plain Layout
5002 \begin_inset Quotes erd
5006 Another way involves using
5007 \begin_inset Flex CharStyle:Code
5010 \begin_layout Plain Layout
5017 \begin_inset Flex CharStyle:Code
5020 \begin_layout Plain Layout
5026 to set up the special
5027 \begin_inset Flex CharStyle:Code
5030 \begin_layout Plain Layout
5038 \begin_inset Flex CharStyle:Code
5041 \begin_layout Plain Layout
5047 acts in some ways just like
5048 \begin_inset Flex CharStyle:MenuItem
5051 \begin_layout Plain Layout
5057 and permits you to bind keys to accented characters.
5058 You can also turn keys into dead-keys by binding them to something like
5060 \begin_inset Flex CharStyle:Code
5063 \begin_layout Plain Layout
5069 and then binding this symbolic key to the corresponding LyX command.
5073 \begin_layout Plain Layout
5078 : This is exactly what I do in my
5079 \begin_inset Flex CharStyle:Code
5082 \begin_layout Plain Layout
5089 \begin_inset Flex CharStyle:Code
5092 \begin_layout Plain Layout
5100 \begin_inset Flex CharStyle:MenuItem
5103 \begin_layout Plain Layout
5105 \begin_inset space ~
5114 \begin_inset Flex CharStyle:Code
5117 \begin_layout Plain Layout
5123 and a bunch of these
5124 \begin_inset Quotes eld
5128 \begin_inset Flex CharStyle:Code
5131 \begin_layout Plain Layout
5138 \begin_inset Quotes erd
5141 symbolic keys bound such things as
5142 \begin_inset Flex CharStyle:MenuItem
5145 \begin_layout Plain Layout
5147 \begin_inset space ~
5156 \begin_inset Flex CharStyle:MenuItem
5159 \begin_layout Plain Layout
5161 \begin_inset space ~
5170 This is how I produce my accented characters.
5175 You can make just about anything into the
5176 \begin_inset Flex CharStyle:Code
5179 \begin_layout Plain Layout
5186 \begin_inset Flex CharStyle:MenuItem
5189 \begin_layout Plain Layout
5195 keys, a spare function key, etc.
5196 As for the LyX commands that produce accents, check the entry for
5197 \begin_inset Flex CharStyle:Code
5200 \begin_layout Plain Layout
5211 You'll find the complete list there.
5214 \begin_layout Subsection
5215 Saving your Language Configuration
5218 \begin_layout Standard
5219 You can edit your preferences so that your desired language environment
5220 is automatically configured when LyX starts up, via the
5221 \begin_inset Flex CharStyle:MenuItem
5224 \begin_layout Plain Layout
5225 Edit\SpecialChar \menuseparator
5234 \begin_layout Chapter
5235 Installing New Document Classes, Layouts, and Templates
5236 \begin_inset CommandInset label
5238 name "cha:Installing-New-Document"
5246 \begin_layout Plain Layout
5247 Installing New Document Classes
5255 \begin_layout Standard
5256 In this chapter, we describe the procedures for creating and installing
5257 new LyX layout and template files, as well as offer a refresher on correctly
5258 installing new LaTeX document classes.
5262 \begin_layout Standard
5263 First, let us a say a few words about how one ought to think about the relation
5264 between LyX and LaTeX.
5265 The thing to understand is that, in a certain sense, LyX doesn't know anything
5267 Indeed, from LyX's point of view, LaTeX is just one of several
5268 \begin_inset Quotes eld
5272 \begin_inset Quotes erd
5275 in which it is capable of producing output.
5276 Other such formats are DocBook, plaintext, and XHTML.
5277 LaTeX is, of course, a particularly important format, but very little of
5278 the information LyX has about LaTeX is actually contained in the program
5283 \begin_layout Plain Layout
5284 Some commands are sufficiently complex that they are
5285 \begin_inset Quotes eld
5289 \begin_inset Quotes erd
5293 But the developers generally regard this as a Bad Thing.
5298 Rather, that information, even for the standard classes like
5299 \begin_inset Flex CharStyle:Code
5302 \begin_layout Plain Layout
5308 , is contained in layout files.
5309 Similarly, LyX itself does not know much about DocBook or XHTML.
5312 \begin_layout Standard
5313 You can think of the layout file for a given document class as a translation
5314 manual between LyX constructs---paragraphs with their corresponding styles,
5315 certain sorts of insets, etc---and the corresponding LaTeX, or DocBook,
5316 or XHTML constructs.
5317 Almost everything LyX knows about
5318 \begin_inset Flex CharStyle:Code
5321 \begin_layout Plain Layout
5327 , for example, is contained in the file
5328 \begin_inset Flex CharStyle:Code
5331 \begin_layout Plain Layout
5338 For this reason, anyone intending to write layout files should plan to
5339 study the existing files.
5340 A good place to start is with
5341 \begin_inset Flex CharStyle:Code
5344 \begin_layout Plain Layout
5350 , which just gets `included' in
5351 \begin_inset Flex CharStyle:Code
5354 \begin_layout Plain Layout
5361 \begin_inset Flex CharStyle:Code
5364 \begin_layout Plain Layout
5370 , and many of the other layout files for document classes.
5371 This file is where sections and the like are defined:
5372 \begin_inset Flex CharStyle:Code
5375 \begin_layout Plain Layout
5381 tells LyX how paragraphs that are marked with the Section, Subsection,
5382 etc, styles can be translated into corresponding LaTeX commands.
5384 \begin_inset Flex CharStyle:Code
5387 \begin_layout Plain Layout
5393 file basically just includes several of these
5394 \begin_inset Flex CharStyle:Code
5397 \begin_layout Plain Layout
5406 \begin_layout Standard
5407 Defining the LyX--LaTeX correspondence is not, however, the only thing layout
5409 Their other job is to define how the LyX constructs themselves will appear
5411 The fact that layout files have these two jobs is often a source of confusion,
5412 because they are completely separate.
5413 Telling LyX how to translate a certain paragraph style into LaTeX does
5414 not tell LyX how to display it; conversely, telling LyX how to display
5415 a certain paragraph style does not tell LyX how to translate it into LaTeX,
5416 let alone tell LaTeX how to display it.
5417 So, in general, when you define a new LyX construct, you must always do
5418 two quite separate things: (i)
5419 \begin_inset space ~
5422 tell LyX how to translate it into LaTeX, and (ii)
5423 \begin_inset space ~
5426 tell LyX how to display it.
5429 \begin_layout Standard
5430 Much the same is true, of course, as regards LyX's other backend formats,
5431 though XHTML is in some ways different, because in that case LyX
5435 able, to some extent, to use information about how it should display a
5436 paragraph on the screen to output information (in the form of CSS) about
5437 how the paragrpah should be displayed in a browser.
5438 Even in this case, however, the distinction between what LyX does internally
5439 and how things are rendered externally remains in force, and the two can
5440 be controlled separately.
5442 \begin_inset CommandInset ref
5443 LatexCommand prettyref
5444 reference "sub:Paragraph-Style-XHTML"
5451 \begin_layout Standard
5452 Some definitions: a document class is a LaTeX file (usually ending in
5453 \begin_inset Flex CharStyle:Code
5456 \begin_layout Plain Layout
5463 \begin_inset Flex CharStyle:Code
5466 \begin_layout Plain Layout
5472 ) that describes the format of a document such as an article, report, journal
5473 preprint, etc, and all the commands needed to realize that format.
5474 A layout file is a LyX file that corresponds to a LaTeX document class
5475 and that tells LyX how to
5476 \begin_inset Quotes eld
5480 \begin_inset Quotes erd
5483 things on the screen to make the display look something like the final
5485 More precisely, a layout file describes a
5486 \begin_inset Quotes eld
5490 \begin_inset Quotes erd
5493 which is the internal construct LyX uses to render the screen display.
5495 \begin_inset Quotes eld
5499 \begin_inset Quotes erd
5503 \begin_inset Quotes eld
5507 \begin_inset Quotes erd
5510 can be used somewhat interchangeably, but it is better to refer to the
5511 file as the layout, and the thing living in LyX's memory as the text class.
5512 A template file is simply a LyX document that contains a set of predefined
5513 entries for a given document class—entries that are generally required
5515 Templates are especially useful for things like journal manuscripts that
5516 are to be submitted electronically.
5519 \begin_layout Section
5520 Installing a new LaTeX package
5523 \begin_layout Standard
5524 Some installations may not include a LaTeX package that you would like to
5526 For example, you might need FoilTeX, a package for preparing slides for
5527 overhead projectors.
5528 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5529 a user interface for installing such packages.
5530 For example, with MiKTeX, you start the program
5531 \begin_inset Quotes eld
5535 \begin_inset Quotes erd
5538 to get a list of available packages.
5539 To install one, right click on it or use the toolbar button to install
5544 \begin_layout Standard
5545 If your LaTeX distribution doesn't provide such a user interface, or if
5546 the file is not available through the package browser, then you can follow
5550 \begin_layout Enumerate
5551 Get the package from
5552 \begin_inset CommandInset href
5555 target "http://www.ctan.org/"
5562 \begin_layout Enumerate
5563 You can install the package in several different places.
5564 If you want it to be available for all users on your system, then you should
5565 install it in your `local' TeX tree; if you want (or need) it to be available
5566 just for you, then you can install it in your own `user' TeX tree.
5567 Where these should be created, if they do not already exist, depends upon
5568 the details of your system.
5569 To find out where they are, look in the file
5570 \begin_inset Flex CharStyle:Code
5573 \begin_layout Plain Layout
5583 \begin_layout Plain Layout
5584 This usually lives in the directory
5585 \begin_inset Flex CharStyle:Code
5588 \begin_layout Plain Layout
5594 , though you can run
5595 \begin_inset Flex CharStyle:Code
5598 \begin_layout Plain Layout
5609 The location of the `local' TeX tree is defined by the
5610 \begin_inset Flex CharStyle:Code
5613 \begin_layout Plain Layout
5619 variable; this is usually somewhere like
5620 \begin_inset Flex CharStyle:Code
5623 \begin_layout Plain Layout
5624 /usr/local/share/texmf/
5630 The `user' TeX tree is defined by
5631 \begin_inset Flex CharStyle:Code
5634 \begin_layout Plain Layout
5641 \begin_inset Flex CharStyle:Code
5644 \begin_layout Plain Layout
5651 (If these variables are not predefined, you can define them.) You'll probably
5652 need root permissions to create or modify the `local' tree; but your `user'
5653 tree shouldn't have such limitations.
5656 \begin_layout Enumerate
5658 \begin_inset Flex CharStyle:Code
5661 \begin_layout Plain Layout
5668 \begin_inset Flex CharStyle:Code
5671 \begin_layout Plain Layout
5678 \begin_inset Flex CharStyle:Code
5681 \begin_layout Plain Layout
5688 \begin_inset space \thinspace{}
5692 \begin_inset Newline newline
5696 \begin_inset Flex CharStyle:Code
5699 \begin_layout Plain Layout
5700 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5706 \begin_inset Newline newline
5709 But, again, most of this will
5710 \begin_inset Quotes eld
5714 \begin_inset Quotes erd
5720 \begin_layout Enumerate
5721 Your local and user trees must have the same sort of directory structure
5722 as your main existing
5723 \begin_inset Flex CharStyle:Code
5726 \begin_layout Plain Layout
5732 directory, which will be found at
5733 \begin_inset Flex CharStyle:Code
5736 \begin_layout Plain Layout
5743 \begin_inset Flex CharStyle:Code
5746 \begin_layout Plain Layout
5752 .) For example, latex packages should go under
5753 \begin_inset Flex CharStyle:Code
5756 \begin_layout Plain Layout
5757 $TEXMFLOCAL/tex/latex/
5763 \begin_inset Flex CharStyle:Code
5766 \begin_layout Plain Layout
5767 $TEXMFHOME/tex/latex/
5775 \begin_layout Enumerate
5776 Once your tree is properly set up, you can install the package into an appropria
5778 For example, you might install the FoilTeX files into
5779 \begin_inset Flex CharStyle:Code
5782 \begin_layout Plain Layout
5783 $TEXMFLOCAL/tex/latex/foiltex
5790 \begin_inset Flex CharStyle:Code
5793 \begin_layout Plain Layout
5799 directory contains various files.
5802 \begin_layout Enumerate
5803 Finally, you must update the database TeX uses to find files.
5804 On MiKTeX, this is done by pressing the button
5807 \begin_inset space ~
5812 that you find in MiKTeX's
5813 \begin_inset Quotes eld
5817 \begin_inset Quotes erd
5822 \begin_inset Flex CharStyle:Code
5825 \begin_layout Plain Layout
5826 $TEXMFLOCAL/tex/latex/
5832 Under TeXLive and the like, you should run
5833 \begin_inset Flex CharStyle:Code
5836 \begin_layout Plain Layout
5842 from a terminal, with root permissions if necessary.
5846 \begin_layout Standard
5847 Your package is now installed and available to LaTeX.
5848 You can verify this from a terminal by typing `
5849 \begin_inset Flex CharStyle:Code
5852 \begin_layout Plain Layout
5853 kpsewhich yourfile.ext
5859 To make LyX aware of it, however, you will need to reconfigure (
5860 \begin_inset Flex CharStyle:MenuItem
5863 \begin_layout Plain Layout
5864 Tools\SpecialChar \menuseparator
5870 ) and then restart LyX.
5871 If the new package was a document class, such as FoilTeX again, you will
5873 \begin_inset Flex CharStyle:MenuItem
5876 \begin_layout Plain Layout
5883 \begin_inset Flex CharStyle:MenuItem
5886 \begin_layout Plain Layout
5887 Document\SpecialChar \menuseparator
5888 Settings\SpecialChar \menuseparator
5898 \begin_layout Standard
5899 Unless, of course, no layout file is available for your new document class.
5900 That is the topic of the next section.
5903 \begin_layout Section
5907 \begin_layout Standard
5908 This section describes how to write and install your own LyX layout files
5909 and walks through the
5910 \begin_inset Flex CharStyle:Code
5913 \begin_layout Plain Layout
5919 text class as an example.
5921 \begin_inset Flex CharStyle:Code
5924 \begin_layout Plain Layout
5930 files describe what paragraph and character styles are available for a
5931 given document class, how LyX should display them, and how they should
5932 be translated into LaTeX, DocBook, XHTML, or whatever output format is
5937 \begin_layout Standard
5938 We shall try to provide a thorough description of the process of writing
5940 However, there are so many different types of documents supported by even
5941 just LaTeX that we can't hope to cover every different possibility or problem
5942 you might encounter.
5943 The LyX users' list is frequented by people with lots of experience with
5944 layout design who are willing to share what they've learned, so please
5945 feel free to ask questions there.
5948 \begin_layout Standard
5949 As you prepare to write a new layout, it is extremely helpful to look at
5950 the layouts distributed with LyX.
5951 If you use a nice LaTeX document class that might also be of interest for
5952 others and so write a corresponding LyX layout, you should consider posting
5954 \begin_inset CommandInset href
5956 name "layout section on the LyX wiki"
5957 target "http://wiki.lyx.org/Layouts/Layouts"
5961 or even to the LyX developers' list, so that it might be included in LyX
5966 \begin_layout Plain Layout
5967 Note that LyX is licensed under the General Public License, so any material
5968 that is contribued to LyX must be similarly licensed.
5976 \begin_layout Standard
5977 All the tags described here are case-insensitive; this means that
5978 \begin_inset Flex CharStyle:Code
5981 \begin_layout Plain Layout
5988 \begin_inset Flex CharStyle:Code
5991 \begin_layout Plain Layout
5998 \begin_inset Flex CharStyle:Code
6001 \begin_layout Plain Layout
6007 are really the same tag.
6008 The possible values are printed in brackets after the feature's name.
6009 The default value if a feature isn't specified inside a text class-description
6011 \begin_inset Flex CharStyle:Code
6014 \begin_layout Plain Layout
6023 If the argument has a data type like
6024 \begin_inset Quotes eld
6028 \begin_inset Quotes erd
6032 \begin_inset Quotes eld
6036 \begin_inset Quotes erd
6039 , the default is shown like this:
6040 \begin_inset Flex CharStyle:Code
6043 \begin_layout Plain Layout
6054 \begin_layout Subsection
6056 \begin_inset CommandInset label
6058 name "sub:Layout-modules"
6065 \begin_layout Standard
6066 We have spoken to this point about `layout files'.
6067 But there are different sorts of files that contain layout information.
6068 Layout files, strictly so called, have the
6069 \begin_inset Flex CharStyle:Code
6072 \begin_layout Plain Layout
6078 extension and provide LyX with information about document classes.
6079 As of LyX 1.6, however, layout information can also be contained in layout
6085 \begin_inset Flex CharStyle:Code
6088 \begin_layout Plain Layout
6095 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6096 some modules—such as the
6097 \begin_inset Flex CharStyle:Code
6100 \begin_layout Plain Layout
6106 module—specifcally provide support for one such package.
6107 In a sense, layout modules are similar to included
6111 \begin_layout Plain Layout
6112 These can have any extension, but by convention have the
6113 \begin_inset Flex CharStyle:Code
6116 \begin_layout Plain Layout
6128 \begin_inset Flex CharStyle:Code
6131 \begin_layout Plain Layout
6137 —in that modules are not specific to a given document class but may be used
6138 with many different classes.
6139 The difference is that using an included file with
6140 \begin_inset Flex CharStyle:Code
6143 \begin_layout Plain Layout
6149 requires editing that file.
6150 Modules, by contrast, are selected in the
6151 \begin_inset Flex CharStyle:MenuItem
6154 \begin_layout Plain Layout
6155 Document\SpecialChar \menuseparator
6164 \begin_layout Standard
6165 Building modules is the easiest way to get started with layout editing,
6166 since it can be as simple as adding a single new paragraph style or flex
6168 But modules may, in principle, contain anything a layout file can contain.
6171 \begin_layout Standard
6172 A module must begin with a line like the following:
6175 \begin_layout LyX-Code
6178 DeclareLyXModule[endnotes.sty]{Endnotes}
6181 \begin_layout Standard
6182 The mandatory argument, in curly brackets, is the name of the module, as
6184 \begin_inset Flex CharStyle:MenuItem
6187 \begin_layout Plain Layout
6188 Document\SpecialChar \menuseparator
6195 The argument in square brackets is optional: It declares any LaTeX packages
6196 on which the module depends.
6197 Please note that only packages about which LyX knows should be listed in
6198 the square brackets.
6202 \begin_layout Plain Layout
6203 The list of such packages is documented only in the source code.
6208 LyX will not check for arbitrary packages.
6209 It is also possible to use the form
6210 \begin_inset Flex CharStyle:MenuItem
6213 \begin_layout Plain Layout
6219 , which declares that the module can only be used when there exists a conversion
6220 chain between the formats `
6221 \begin_inset Flex CharStyle:Code
6224 \begin_layout Plain Layout
6231 \begin_inset Flex CharStyle:Code
6234 \begin_layout Plain Layout
6243 \begin_layout Standard
6244 The module declaration should then be followed by lines like the following:
6247 \begin_layout LyX-Code
6251 \begin_layout LyX-Code
6252 #Adds an endnote command, in addition to footnotes.
6256 \begin_layout LyX-Code
6257 #You will need to add
6259 theendnotes in TeX code where you
6262 \begin_layout LyX-Code
6263 #want the endnotes to appear.
6267 \begin_layout LyX-Code
6271 \begin_layout LyX-Code
6272 #Requires: somemodule | othermodule
6275 \begin_layout LyX-Code
6276 #Excludes: badmodule
6279 \begin_layout Standard
6280 The description is used in
6281 \begin_inset Flex CharStyle:MenuItem
6284 \begin_layout Plain Layout
6285 Document\SpecialChar \menuseparator
6291 to provide the user with information about what the module does.
6293 \begin_inset Flex CharStyle:Code
6296 \begin_layout Plain Layout
6302 line is used to identify other modules with which this one must be used;
6304 \begin_inset Flex CharStyle:Code
6307 \begin_layout Plain Layout
6313 line is used to identify modules with which this one may not be used.
6314 Both are optional, and, as shown, multiple modules should be separated
6315 with the pipe symbol: |.
6316 Note that the required modules are treated disjunctively:
6320 of the required modules must be used.
6325 excluded module may be used.
6326 Note that modules are identified here by their
6331 \begin_inset Flex CharStyle:Code
6334 \begin_layout Plain Layout
6342 \begin_inset Flex CharStyle:Code
6345 \begin_layout Plain Layout
6352 \begin_inset Flex CharStyle:Code
6355 \begin_layout Plain Layout
6364 \begin_layout Standard
6365 After creating a new module, you will need to reconfigure and then restart
6366 LyX for the module to appear in the menu.
6367 However, changes you make to the module will be seen immediately, if you
6369 \begin_inset Flex CharStyle:MenuItem
6372 \begin_layout Plain Layout
6373 Document\SpecialChar \menuseparator
6379 , highlight something, and then hit
6380 \begin_inset Quotes eld
6384 \begin_inset Quotes erd
6390 It is strongly recommended that you save your work before doing so
6395 it is strongly recommended that you not attempt to edit modules while simultaneo
6396 usly working on actual documents
6399 Though of course the developers strive to keep LyX stable in such situations,
6400 syntax errors and the like in your module file could cause strange behavior.
6403 \begin_layout Subsection
6405 \begin_inset Flex CharStyle:MenuItem
6408 \begin_layout Plain Layout
6417 \begin_layout Standard
6418 There are two situations you are likely to encounter when wanting to support
6419 a new LaTeX document class, involving LaTeX2e class (
6420 \begin_inset Flex CharStyle:Code
6423 \begin_layout Plain Layout
6430 \begin_inset Flex CharStyle:Code
6433 \begin_layout Plain Layout
6440 Supporting a style file is usually fairly easy.
6441 Supporting a new document class is a bit harder.
6442 We'll discuss the former in this section and the latter in the next.
6443 Similar remarks apply, of course, if you want to support a new DocBook
6447 \begin_layout Standard
6448 The easier case is the one in which your new document class is provided
6449 as a style file that is to be used in conjunction with an already supported
6451 For the sake of the example, we'll assume that the style file is called
6453 \begin_inset Flex CharStyle:MenuItem
6456 \begin_layout Plain Layout
6462 and that it is meant to be used with
6463 \begin_inset Flex CharStyle:MenuItem
6466 \begin_layout Plain Layout
6472 , which is a standard class.
6476 \begin_layout Standard
6477 Start by copying the existing class's layout file into your local directory:
6481 \begin_layout Plain Layout
6482 Of course, which directory is your local directory will vary by platform,
6483 and LyX allows you to specify your local directory on startup, too, using
6485 \begin_inset Flex CharStyle:Code
6488 \begin_layout Plain Layout
6502 \begin_layout LyX-Code
6503 cp report.layout ~/.lyx/layouts/myclass.layout
6506 \begin_layout Standard
6508 \begin_inset Flex CharStyle:Code
6511 \begin_layout Plain Layout
6517 and change the line:
6520 \begin_layout LyX-Code
6523 DeclareLaTeXClass{report}
6526 \begin_layout Standard
6530 \begin_layout LyX-Code
6533 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6536 \begin_layout Standard
6540 \begin_layout LyX-Code
6542 \begin_inset Newline newline
6548 \begin_inset Newline newline
6554 \begin_layout Standard
6555 near the top of the file.
6558 \begin_layout Standard
6559 Start LyX and select
6560 \begin_inset Flex CharStyle:MenuItem
6563 \begin_layout Plain Layout
6564 Tools\SpecialChar \menuseparator
6571 Then restart LyX and try creating a new document.
6573 \begin_inset Flex CharStyle:MenuItem
6576 \begin_layout Plain Layout
6582 " as a document class option in the
6583 \begin_inset Flex CharStyle:MenuItem
6586 \begin_layout Plain Layout
6587 Document\SpecialChar \menuseparator
6594 It is likely that some of the sectioning commands and such in your new
6595 class will work differently from how they worked in the base class—
6596 \begin_inset Flex CharStyle:Code
6599 \begin_layout Plain Layout
6605 in this example—so you can fiddle around with the settings for the different
6606 sections if you wish.
6607 The layout information for sections is contained in
6608 \begin_inset Flex CharStyle:Code
6611 \begin_layout Plain Layout
6617 , but you do not need to copy and change this file.
6618 Instead, you can simply add your changes to your layout file, after the
6620 \begin_inset Flex CharStyle:Code
6623 \begin_layout Plain Layout
6629 , which itself includes
6630 \begin_inset Flex CharStyle:Code
6633 \begin_layout Plain Layout
6640 For example, you might add these lines:
6643 \begin_layout LyX-Code
6647 \begin_layout LyX-Code
6651 \begin_layout LyX-Code
6655 \begin_layout LyX-Code
6659 \begin_layout LyX-Code
6663 \begin_layout Standard
6664 to change the font for chapter headings to sans-serif.
6665 This will override (or, in this case, add to) the existing declaration
6666 for the Chapter style.
6670 \begin_layout Standard
6671 Your new package may also provide commands or environments not present in
6673 In this case, you will want to add these to the layout file.
6675 \begin_inset CommandInset ref
6677 reference "sec:TextClass"
6681 for information on how to do so.
6684 \begin_layout Standard
6686 \begin_inset Flex CharStyle:MenuItem
6689 \begin_layout Plain Layout
6695 can be used with several different document classes, and even if it cannot,
6696 you might find it easiest just to write a module that you can load with
6698 The simplest possible such module would be:
6701 \begin_layout LyX-Code
6704 DeclareLyXModule{My Class}
6707 \begin_layout LyX-Code
6711 \begin_layout LyX-Code
6712 #Support for myclass.sty.
6715 \begin_layout LyX-Code
6717 \begin_inset Newline newline
6723 \begin_layout LyX-Code
6725 \begin_inset Newline newline
6731 \begin_layout LyX-Code
6733 \begin_inset Newline newline
6739 \begin_inset Newline newline
6745 \begin_layout Standard
6746 A more complex module might modify the behavior of some existing constructs
6747 or define some new ones.
6749 \begin_inset CommandInset ref
6751 reference "sec:TextClass"
6758 \begin_layout Subsection
6760 \begin_inset Flex CharStyle:MenuItem
6763 \begin_layout Plain Layout
6772 \begin_layout Standard
6773 There are two possibilities here.
6774 One is that the class file is itself based upon an existing document class.
6775 For example, many thesis classes are based upon
6776 \begin_inset Flex CharStyle:MenuItem
6779 \begin_layout Plain Layout
6786 To see whether yours is, look for a line like
6789 \begin_layout LyX-Code
6795 \begin_layout Standard
6797 If so, then you may proceed largely as in the previous section, though
6799 \begin_inset Flex CharStyle:Code
6802 \begin_layout Plain Layout
6808 line will be different.
6809 If your new class is
6810 \begin_inset Flex CharStyle:Code
6813 \begin_layout Plain Layout
6819 and it is based upon
6820 \begin_inset Flex CharStyle:Code
6823 \begin_layout Plain Layout
6829 , then the line should read:
6833 \begin_layout Plain Layout
6834 And it will be easiest if you save the file to
6835 \begin_inset Flex CharStyle:Code
6838 \begin_layout Plain Layout
6844 : LyX assumes that the document class has the same name as the layout file.
6853 \begin_layout LyX-Code
6856 DeclareLaTeXClass[thesis,book]{thesis}
6859 \begin_layout Standard
6860 If, on the other hand, the new class is not based upon an existing class,
6861 you will probably have to
6862 \begin_inset Quotes eld
6866 \begin_inset Quotes erd
6870 We strongly suggest copying an existing layout file which uses a similar
6871 LaTeX class and then modifying it, if you can do so.
6872 At least use an existing file as a starting point so you can find out what
6873 items you need to worry about.
6874 Again, the specifics are covered below.
6877 \begin_layout Section
6878 \begin_inset CommandInset label
6880 name "sec:TextClass"
6884 Declaring a new text class
6887 \begin_layout Standard
6888 When it's finally time to get your hands dirty and create or edit your own
6889 layout file, the following sections describe what you're up against.
6890 Our advice is to go slowly, save and test often, listen to soothing music,
6891 and enjoy one or two of your favorite adult beverages; more if you are
6892 getting particularly stuck.
6893 It's really not that hard, except that the multitude of options can become
6894 overwhelming if you try to do too much in one sitting.
6895 Go have another adult beverage, just for good measure.
6898 \begin_layout Standard
6902 \begin_layout Standard
6903 Lines in a layout file which begin with
6904 \begin_inset Flex CharStyle:Code
6907 \begin_layout Plain Layout
6914 There is one exception to this rule.
6916 \begin_inset Flex CharStyle:Code
6919 \begin_layout Plain Layout
6925 files should begin with a line like:
6928 \begin_layout LyX-Code
6931 #% Do not delete the line below; configure depends on this
6934 \begin_layout LyX-Code
6939 DeclareLaTeXClass{article}
6942 \begin_layout Standard
6943 The second line is used when you configure LyX.
6944 The layout file is read by the LaTeX script
6945 \begin_inset Flex CharStyle:Code
6948 \begin_layout Plain Layout
6954 , in a special mode where
6955 \begin_inset Flex CharStyle:Code
6958 \begin_layout Plain Layout
6965 The first line is just a LaTeX comment, and the second one contains the
6966 declaration of the text class.
6967 If these lines appear in a file named
6968 \begin_inset Flex CharStyle:Code
6971 \begin_layout Plain Layout
6977 , then they define a text class of name
6978 \begin_inset Flex CharStyle:Code
6981 \begin_layout Plain Layout
6987 (the name of the layout file) which uses the LaTeX document class
6988 \begin_inset Flex CharStyle:Code
6991 \begin_layout Plain Layout
6997 (the default is to use the same name as the layout).
6999 \begin_inset Quotes eld
7003 \begin_inset Quotes erd
7006 that appears above is used as a description of the text class in the
7007 \begin_inset Flex CharStyle:MenuItem
7010 \begin_layout Plain Layout
7011 Document\SpecialChar \menuseparator
7020 \begin_layout Standard
7021 Let's assume that you wrote your own text class that uses the
7022 \begin_inset Flex CharStyle:Code
7025 \begin_layout Plain Layout
7031 document class, but where you changed the appearance of the section headings.
7032 If you put it in a file
7033 \begin_inset Flex CharStyle:Code
7036 \begin_layout Plain Layout
7042 , the header of this file should be:
7045 \begin_layout LyX-Code
7048 #% Do not delete the line below; configure depends on this
7051 \begin_layout LyX-Code
7056 DeclareLaTeXClass[article]{article (with my own headings)}
7059 \begin_layout Standard
7060 This declares a text class
7061 \begin_inset Flex CharStyle:Code
7064 \begin_layout Plain Layout
7070 , associated with the LaTeX document class
7071 \begin_inset Flex CharStyle:Code
7074 \begin_layout Plain Layout
7081 \begin_inset Quotes eld
7084 article (with my own headings)
7085 \begin_inset Quotes erd
7089 If your text class depends on several packages, you can declare it as:
7092 \begin_layout LyX-Code
7095 #% Do not delete the line below; configure depends on this
7098 \begin_layout LyX-Code
7103 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7106 \begin_layout Standard
7107 This indicates that your text class uses the
7108 \begin_inset Flex CharStyle:Code
7111 \begin_layout Plain Layout
7118 Finally, it is also possible to declare classes for DocBook code.
7119 Typical declarations will look like:
7122 \begin_layout LyX-Code
7125 #% Do not delete the line below; configure depends on this
7128 \begin_layout LyX-Code
7133 DeclareDocBookClass[article]{SGML (DocBook article)}
7136 \begin_layout Standard
7137 Note that these declarations can also be given an optional parameter declaring
7138 the name of the document class (but not a list).
7141 \begin_layout Standard
7142 So, to be as explicit as possible, the form of the layout declaration is:
7145 \begin_layout LyX-Code
7150 DeclareLaTeXClass[class,package.sty]{layout description}
7153 \begin_layout Standard
7154 The class need only be specified if the name of the LaTeX class file and
7155 the name of the layout file are different; if the name of the class file
7156 is not specified, then LyX will simply assume that it is the same as the
7157 name of the layout file.
7160 \begin_layout Standard
7161 When the text class has been modified to your taste, all you have to do
7162 is to copy it either to
7163 \begin_inset Flex CharStyle:Code
7166 \begin_layout Plain Layout
7173 \begin_inset Flex CharStyle:Code
7176 \begin_layout Plain Layout
7183 \begin_inset Flex CharStyle:MenuItem
7186 \begin_layout Plain Layout
7187 Tools\SpecialChar \menuseparator
7193 , exit LyX and restart.
7194 Then your new text class should be available along with the others.
7197 \begin_layout Standard
7198 Once the layout file is installed, you can edit it and see your changes
7199 without having to reconfigure or to restart LyX.
7200 In versions of LyX prior to 1.6, this was not true.
7201 As a result, editing layout files was very time consuming.
7202 Beginning with 1.6, however, you can force a reload of the current layout
7203 by using the LyX function
7204 \begin_inset Flex CharStyle:MenuItem
7207 \begin_layout Plain Layout
7214 There is no default binding for this function—though, of course, you can
7215 bind it to a key yourself.
7216 But you will normally use this function simply by entering it in the mini-buffe
7221 \begin_layout Standard
7227 \begin_inset Flex CharStyle:MenuItem
7230 \begin_layout Plain Layout
7236 is very much an `advanced feature'.
7241 recommended that you save your work before using this function.
7246 recommended that you not attempt to edit layout information while simultaneousl
7247 y working on a document that you care about.
7248 Use a test document.
7249 Syntax errors and the like in your layout file could cause peculiar behavior.
7250 In particular, such errors could cause LyX to regard the current layout
7251 as invalid and to attempt to switch to some other layout.
7252 The LyX team strives to keep LyX stable in such situations, but safe is
7257 \begin_layout Plain Layout
7258 While we're giving advice: make regular backups.
7259 And be nice to your mother.
7267 \begin_layout Subsection
7271 \begin_layout Standard
7272 The first non-comment line of any layout file, included file, or module
7277 contain the file format number:
7280 \begin_layout Description
7281 \begin_inset Flex CharStyle:Code
7284 \begin_layout Plain Layout
7291 \begin_inset Flex CharStyle:Code
7294 \begin_layout Plain Layout
7300 ] The format of the layout file.
7303 \begin_layout Standard
7304 This tag was introduced with LyX 1.4.0.
7305 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7306 and are considered to be of format 1.
7307 The format for the present version of LyX is format
7308 \begin_inset Flex CharStyle:Code
7311 \begin_layout Plain Layout
7318 But LyX is capable of reading earlier formats, too, just as it is capable
7319 of reading files produced by earlier versions of LyX.
7320 There is, however, no provision for converting to earlier formats.
7321 So LyX 1.6.x will not read layout files in format 20 but only files in format
7325 \begin_layout Subsection
7326 General text class parameters
7329 \begin_layout Standard
7330 These are the general parameters which describe the form of the entire document:
7333 \begin_layout Description
7334 \begin_inset Flex CharStyle:Code
7337 \begin_layout Plain Layout
7343 Adds information that will be output in the
7344 \begin_inset Flex CharStyle:Code
7347 \begin_layout Plain Layout
7353 block when this document class is output to XHTML.
7354 Typically, this would be used to output CSS style information, but it can
7355 be used for anything that can appear in
7356 \begin_inset Flex CharStyle:Code
7359 \begin_layout Plain Layout
7367 \begin_inset Quotes eld
7371 \begin_inset Flex CharStyle:Code
7374 \begin_layout Plain Layout
7381 \begin_inset Quotes erd
7387 \begin_layout Description
7388 \begin_inset Flex CharStyle:Code
7391 \begin_layout Plain Layout
7397 Adds information to the document preamble.
7399 \begin_inset Quotes eld
7403 \begin_inset Flex CharStyle:Code
7406 \begin_layout Plain Layout
7413 \begin_inset Quotes erd
7419 \begin_layout Description
7420 \begin_inset Flex CharStyle:Code
7423 \begin_layout Plain Layout
7429 Describes various global options supported by the document class.
7431 \begin_inset space ~
7435 \begin_inset CommandInset ref
7437 reference "sub:ClassOptions"
7443 \begin_inset Quotes eld
7447 \begin_inset Flex CharStyle:Code
7450 \begin_layout Plain Layout
7457 \begin_inset Quotes erd
7463 \begin_layout Description
7464 \begin_inset Flex CharStyle:Code
7467 \begin_layout Plain Layout
7474 \begin_inset Flex CharStyle:Code
7477 \begin_layout Plain Layout
7486 \begin_inset Flex CharStyle:Code
7489 \begin_layout Plain Layout
7495 ] Whether the class should
7499 to having one or two columns.
7500 Can be changed in the
7501 \begin_inset Flex CharStyle:MenuItem
7504 \begin_layout Plain Layout
7505 Document\SpecialChar \menuseparator
7514 \begin_layout Description
7515 \begin_inset Flex CharStyle:Code
7518 \begin_layout Plain Layout
7525 \begin_inset Flex CharStyle:Code
7528 \begin_layout Plain Layout
7534 ] This sequence defines the properties for a counter.
7535 If the counter does not yet exist, it is created; if it does exist, it
7538 \begin_inset Quotes eld
7542 \begin_inset Flex CharStyle:Code
7545 \begin_layout Plain Layout
7552 \begin_inset Quotes erd
7556 \begin_inset Newline newline
7560 \begin_inset space ~
7564 \begin_inset CommandInset ref
7566 reference "sub:Counters"
7570 for details on counters.
7573 \begin_layout Description
7574 \begin_inset Flex CharStyle:Code
7577 \begin_layout Plain Layout
7583 Sets the default font used to display the document.
7585 \begin_inset space ~
7589 \begin_inset CommandInset ref
7591 reference "sub:Font-description"
7595 for how to declare fonts.
7597 \begin_inset Quotes eld
7601 \begin_inset Flex CharStyle:Code
7604 \begin_layout Plain Layout
7611 \begin_inset Quotes erd
7617 \begin_layout Description
7618 \begin_inset Flex CharStyle:Code
7621 \begin_layout Plain Layout
7628 \begin_inset Flex CharStyle:Code
7631 \begin_layout Plain Layout
7637 Specifies a module to be included by default with this document class.
7638 The module should be specified by filename without the
7639 \begin_inset Flex CharStyle:Code
7642 \begin_layout Plain Layout
7649 The user can still remove the module, but it will be active at the outset.
7650 (This applies only when new files are created, or when this class is chosen
7651 for an existing document.)
7654 \begin_layout Description
7655 \begin_inset Flex CharStyle:Code
7658 \begin_layout Plain Layout
7665 \begin_inset Flex CharStyle:Code
7668 \begin_layout Plain Layout
7674 ] This is the style that will be assigned to new paragraphs, usually
7675 \begin_inset Flex CharStyle:MenuItem
7678 \begin_layout Plain Layout
7685 This will default to the first defined style if not given, but you are
7686 encouraged to use this directive.
7689 \begin_layout Description
7690 \begin_inset Flex CharStyle:Code
7693 \begin_layout Plain Layout
7700 \begin_inset Flex CharStyle:Code
7703 \begin_layout Plain Layout
7709 ] This tag indicates that the module in question—which should be specified
7710 by filename without the
7711 \begin_inset Flex CharStyle:Code
7714 \begin_layout Plain Layout
7720 extension—cannot be used with this document class.
7721 This might be used in a journal-specific layout file to prevent, say, the
7723 \begin_inset Flex CharStyle:Code
7726 \begin_layout Plain Layout
7732 module that numbers theorems by section.
7737 be used in a module.
7738 Modules have their own way of excluding other modules (see
7739 \begin_inset CommandInset ref
7741 reference "sub:Layout-modules"
7748 \begin_layout Description
7749 \begin_inset Flex CharStyle:Code
7752 \begin_layout Plain Layout
7758 Defines a new float.
7760 \begin_inset space ~
7764 \begin_inset CommandInset ref
7766 reference "sub:Floats"
7772 \begin_inset Quotes eld
7776 \begin_inset Flex CharStyle:Code
7779 \begin_layout Plain Layout
7786 \begin_inset Quotes erd
7792 \begin_layout Description
7793 \begin_inset Flex CharStyle:Code
7796 \begin_layout Plain Layout
7802 Sets the information that will be output in the
7803 \begin_inset Flex CharStyle:Code
7806 \begin_layout Plain Layout
7812 block when this document class is output to XHTML.
7813 Note that this will completely override any prior
7814 \begin_inset Flex CharStyle:Code
7817 \begin_layout Plain Layout
7824 \begin_inset Flex CharStyle:Code
7827 \begin_layout Plain Layout
7835 \begin_inset Flex CharStyle:Code
7838 \begin_layout Plain Layout
7844 if you just want to add material to the preamble.) Must end with
7845 \begin_inset Quotes eld
7849 \begin_inset Flex CharStyle:Code
7852 \begin_layout Plain Layout
7859 \begin_inset Quotes erd
7865 \begin_layout Description
7866 \begin_inset Flex CharStyle:Code
7869 \begin_layout Plain Layout
7876 \begin_inset Flex CharStyle:Code
7879 \begin_layout Plain Layout
7885 ] Modifies the properties of the given counter.
7886 If the counter does not exist, the section is ignored.
7888 \begin_inset Quotes eld
7892 \begin_inset Flex CharStyle:Code
7895 \begin_layout Plain Layout
7902 \begin_inset Quotes erd
7906 \begin_inset Newline newline
7910 \begin_inset space ~
7914 \begin_inset CommandInset ref
7916 reference "sub:Counters"
7920 for details on counters.
7923 \begin_layout Description
7924 \begin_inset Flex CharStyle:Code
7927 \begin_layout Plain Layout
7934 \begin_inset Flex CharStyle:Code
7937 \begin_layout Plain Layout
7943 ] Modifies the properties of the given paragraph style.
7944 If the style does not exist, the section is ignored.
7946 \begin_inset Quotes eld
7950 \begin_inset Flex CharStyle:Code
7953 \begin_layout Plain Layout
7960 \begin_inset Quotes erd
7966 \begin_layout Description
7967 \begin_inset Flex CharStyle:Code
7970 \begin_layout Plain Layout
7976 As its name implies, this command allows you to include another layout
7977 definition file within yours to avoid duplicating commands.
7978 Common examples are the standard layout files, for example,
7979 \begin_inset Flex CharStyle:Code
7982 \begin_layout Plain Layout
7988 , which contains most of the basic layouts.
7991 \begin_layout Description
7992 \begin_inset Flex CharStyle:Code
7995 \begin_layout Plain Layout
8001 This section (re-)defines the layout of an inset.
8002 It can be applied to an existing inset or to a new, user-defined inset,
8003 e.g., a new character style.
8005 \begin_inset Quotes eld
8009 \begin_inset Flex CharStyle:Code
8012 \begin_layout Plain Layout
8019 \begin_inset Quotes erd
8023 \begin_inset Newline newline
8027 \begin_inset space ~
8031 \begin_inset CommandInset ref
8033 reference "sub:Flex-insets-and"
8037 for more information.
8041 \begin_layout Description
8042 \begin_inset Flex CharStyle:Code
8045 \begin_layout Plain Layout
8052 \begin_inset Flex CharStyle:Code
8055 \begin_layout Plain Layout
8061 ] A string that indicates the width of the left margin on the screen, for
8063 \begin_inset Quotes eld
8067 \begin_inset Quotes erd
8071 (Note that this is not a `length', like
8072 \begin_inset Quotes eld
8076 \begin_inset Quotes erd
8082 \begin_layout Description
8083 \begin_inset Flex CharStyle:Code
8086 \begin_layout Plain Layout
8092 This command deletes an existing float.
8093 This is particularly useful when you want to suppress a float that has
8094 been defined in an input file.
8097 \begin_layout Description
8098 \begin_inset Flex CharStyle:Code
8101 \begin_layout Plain Layout
8107 This command deletes an existing style.
8108 This is particularly useful when you want to suppress a style that has
8109 be defined in an input file.
8112 \begin_layout Description
8113 \begin_inset Flex CharStyle:Code
8116 \begin_layout Plain Layout
8122 A string indicating the file format (as defined in the Preferences dialog)
8123 produced by this class.
8124 It is mainly useful when
8125 \begin_inset Flex CharStyle:Code
8128 \begin_layout Plain Layout
8134 is `literate' and one wants to define a new type of literate document.
8135 This string is reset to `docbook', `latex', or `literate' when the correspondin
8137 \begin_inset Flex CharStyle:Code
8140 \begin_layout Plain Layout
8146 parameter is encountered.
8149 \begin_layout Description
8150 \begin_inset Flex CharStyle:Code
8153 \begin_layout Plain Layout
8159 A string indicating what sort of output documents using this class will
8161 At present, the options are: `docbook', `latex', and `literate'.
8164 \begin_layout Description
8165 \begin_inset Flex CharStyle:Code
8168 \begin_layout Plain Layout
8177 \begin_inset Flex CharStyle:Code
8180 \begin_layout Plain Layout
8191 \begin_inset Flex CharStyle:Code
8194 \begin_layout Plain Layout
8201 \begin_inset Flex CharStyle:Code
8204 \begin_layout Plain Layout
8210 ] The default pagestyle.
8211 Can be changed in the
8212 \begin_inset Flex CharStyle:MenuItem
8215 \begin_layout Plain Layout
8216 Document\SpecialChar \menuseparator
8225 \begin_layout Description
8226 \begin_inset Flex CharStyle:Code
8229 \begin_layout Plain Layout
8235 Sets the preamble for the LaTeX document.
8236 Note that this will completely override any prior
8237 \begin_inset Flex CharStyle:Code
8240 \begin_layout Plain Layout
8247 \begin_inset Flex CharStyle:Code
8250 \begin_layout Plain Layout
8258 \begin_inset Flex CharStyle:Code
8261 \begin_layout Plain Layout
8267 if you just want to add material to the preamble.) Must end with
8268 \begin_inset Quotes eld
8272 \begin_inset Flex CharStyle:Code
8275 \begin_layout Plain Layout
8282 \begin_inset Quotes erd
8288 \begin_layout Description
8289 \begin_inset Flex CharStyle:Code
8292 \begin_layout Plain Layout
8299 \begin_inset Flex CharStyle:Code
8302 \begin_layout Plain Layout
8309 \begin_inset Flex CharStyle:Code
8312 \begin_layout Plain Layout
8321 \begin_inset Flex CharStyle:Code
8324 \begin_layout Plain Layout
8330 ] Whether the class already provides the feature
8331 \begin_inset Flex CharStyle:Code
8334 \begin_layout Plain Layout
8341 A feature is in general the name of a package (
8342 \begin_inset Flex CharStyle:Code
8345 \begin_layout Plain Layout
8352 \begin_inset Flex CharStyle:Code
8355 \begin_layout Plain Layout
8361 , \SpecialChar \ldots{}
8363 \begin_inset Flex CharStyle:Code
8366 \begin_layout Plain Layout
8373 \begin_inset Flex CharStyle:Code
8376 \begin_layout Plain Layout
8382 ,\SpecialChar \ldots{}
8383 ); the complete list of supported features is unfortunately not documented
8384 outside the LyX source code—but see
8385 \begin_inset Flex CharStyle:Code
8388 \begin_layout Plain Layout
8394 if you're interested.
8396 \begin_inset Flex CharStyle:MenuItem
8399 \begin_layout Plain Layout
8400 Help\SpecialChar \menuseparator
8406 also gives an overview of the supported packages.
8409 \begin_layout Description
8410 \begin_inset Flex CharStyle:Code
8413 \begin_layout Plain Layout
8420 \begin_inset Flex CharStyle:Code
8423 \begin_layout Plain Layout
8429 ] Indicates that this layout provides the functionality of the module mentioned,
8430 which should be specified by the filename without the
8431 \begin_inset Flex CharStyle:Code
8434 \begin_layout Plain Layout
8441 This will typically be used if the layout includes the module directly,
8442 rather than using the
8443 \begin_inset Flex CharStyle:Code
8446 \begin_layout Plain Layout
8452 tag to indicate that it ought to be used.
8453 It could also be used in a module that provided an alternate implementation
8454 of the same functionality.
8457 \begin_layout Description
8458 \begin_inset Flex CharStyle:Code
8461 \begin_layout Plain Layout
8468 \begin_inset Flex CharStyle:Code
8471 \begin_layout Plain Layout
8477 ] Whether the class requires the feature
8478 \begin_inset Flex CharStyle:Code
8481 \begin_layout Plain Layout
8488 Multiple features must be separated by commas.
8489 Note that you can only request supported features.
8491 \begin_inset Flex CharStyle:Code
8494 \begin_layout Plain Layout
8500 for a list of these.)
8503 \begin_layout Description
8504 \begin_inset Flex CharStyle:Code
8507 \begin_layout Plain Layout
8513 A string that indicates the width of the right margin on the screen, for
8515 \begin_inset Quotes eld
8519 \begin_inset Quotes erd
8525 \begin_layout Description
8526 \begin_inset Flex CharStyle:Code
8529 \begin_layout Plain Layout
8535 Sets which divisions get numbered.
8537 \begin_inset Flex CharStyle:Code
8540 \begin_layout Plain Layout
8549 \begin_layout Description
8550 \begin_inset Flex CharStyle:Code
8553 \begin_layout Plain Layout
8562 \begin_inset Flex CharStyle:Code
8565 \begin_layout Plain Layout
8576 \begin_inset Flex CharStyle:Code
8579 \begin_layout Plain Layout
8585 ] Whether the class-default should be printing on one or both sides of the
8587 Can be changed in the
8588 \begin_inset Flex CharStyle:MenuItem
8591 \begin_layout Plain Layout
8592 Document\SpecialChar \menuseparator
8601 \begin_layout Description
8602 \begin_inset Flex CharStyle:Code
8605 \begin_layout Plain Layout
8611 This sequence defines a paragraph style.
8612 If the style does not yet exist, it is created; if it does exist, its parameter
8615 \begin_inset Quotes eld
8619 \begin_inset Flex CharStyle:Code
8622 \begin_layout Plain Layout
8629 \begin_inset Quotes erd
8633 \begin_inset Newline newline
8637 \begin_inset space ~
8641 \begin_inset CommandInset ref
8643 reference "sub:Paragraph-Styles"
8647 for details on paragraph styles.
8650 \begin_layout Description
8651 \begin_inset Flex CharStyle:Code
8654 \begin_layout Plain Layout
8661 \begin_inset Flex CharStyle:Code
8664 \begin_layout Plain Layout
8670 ] The name of the command or environment to be used with
8671 \begin_inset Flex CharStyle:Code
8674 \begin_layout Plain Layout
8683 \begin_layout Description
8684 \begin_inset Flex CharStyle:Code
8687 \begin_layout Plain Layout
8694 \begin_inset Flex CharStyle:Code
8697 \begin_layout Plain Layout
8706 \begin_inset Flex CharStyle:Code
8709 \begin_layout Plain Layout
8715 ] Indicates what kind of markup is used to define the title of a document.
8717 \begin_inset Flex CharStyle:Code
8720 \begin_layout Plain Layout
8726 means that the macro with name
8727 \begin_inset Flex CharStyle:Code
8730 \begin_layout Plain Layout
8736 will be inserted after the last layout which has
8737 \begin_inset Quotes eld
8741 \begin_inset Flex CharStyle:Code
8744 \begin_layout Plain Layout
8751 \begin_inset Quotes erd
8756 \begin_inset Flex CharStyle:Code
8759 \begin_layout Plain Layout
8765 corresponds to the case where the block of paragraphs which have
8766 \begin_inset Quotes eld
8770 \begin_inset Flex CharStyle:Code
8773 \begin_layout Plain Layout
8780 \begin_inset Quotes erd
8783 should be enclosed into the
8784 \begin_inset Flex CharStyle:Code
8787 \begin_layout Plain Layout
8796 \begin_layout Description
8797 \begin_inset Flex CharStyle:Code
8800 \begin_layout Plain Layout
8806 Sets which divisions are included in the table of contents.
8808 \begin_inset Flex CharStyle:Code
8811 \begin_layout Plain Layout
8820 \begin_layout Subsection
8821 \begin_inset Flex CharStyle:Code
8824 \begin_layout Plain Layout
8831 \begin_inset CommandInset label
8833 name "sub:ClassOptions"
8840 \begin_layout Standard
8842 \begin_inset Flex CharStyle:Code
8845 \begin_layout Plain Layout
8851 section can contain the following entries:
8854 \begin_layout Description
8855 \begin_inset Flex CharStyle:Code
8858 \begin_layout Plain Layout
8865 \begin_inset Flex CharStyle:Code
8868 \begin_layout Plain Layout
8874 ] The list of available font sizes for the document's main font, separated
8876 \begin_inset Quotes eld
8880 \begin_inset Flex CharStyle:Code
8883 \begin_layout Plain Layout
8890 \begin_inset Quotes erd
8896 \begin_layout Description
8897 \begin_inset Flex CharStyle:Code
8900 \begin_layout Plain Layout
8906 Used to set the DTD line with XML-based output classes.
8908 \begin_inset space \thinspace{}
8912 \begin_inset Quotes eld
8915 -//OASIS//DTD DocBook V4.2//EN
8916 \begin_inset Quotes erd
8922 \begin_layout Description
8923 \begin_inset Flex CharStyle:Code
8926 \begin_layout Plain Layout
8933 \begin_inset Flex CharStyle:Code
8936 \begin_layout Plain Layout
8937 string="empty|plain|headings|fancy"
8942 ] The list of available page styles, separated by
8943 \begin_inset Quotes eld
8947 \begin_inset Flex CharStyle:Code
8950 \begin_layout Plain Layout
8957 \begin_inset Quotes erd
8963 \begin_layout Description
8964 \begin_inset Flex CharStyle:Code
8967 \begin_layout Plain Layout
8974 \begin_inset Flex CharStyle:Code
8977 \begin_layout Plain Layout
8983 ] Some document class options, separated by a comma, that will be added
8984 to the optional part of the
8985 \begin_inset Flex CharStyle:Code
8988 \begin_layout Plain Layout
8999 \begin_layout Standard
9001 \begin_inset Flex CharStyle:Code
9004 \begin_layout Plain Layout
9010 section must end with
9011 \begin_inset Quotes eld
9015 \begin_inset Flex CharStyle:Code
9018 \begin_layout Plain Layout
9025 \begin_inset Quotes erd
9031 \begin_layout Subsection
9033 \begin_inset CommandInset label
9035 name "sub:Paragraph-Styles"
9042 \begin_layout Standard
9043 A paragraph style description looks like this:
9047 \begin_layout Plain Layout
9048 Note that this will either define a new layout or modify an existing one.
9056 \begin_layout LyX-Code
9063 \begin_layout LyX-Code
9067 \begin_layout LyX-Code
9071 \begin_layout Standard
9072 where the following commands are allowed:
9075 \begin_layout Description
9076 \begin_inset Flex CharStyle:Code
9079 \begin_layout Plain Layout
9086 \begin_inset Flex CharStyle:Code
9089 \begin_layout Plain Layout
9094 , left, right, center
9099 ] Paragraph alignment.
9102 \begin_layout Description
9103 \begin_inset Flex CharStyle:Code
9106 \begin_layout Plain Layout
9113 \begin_inset Flex CharStyle:Code
9116 \begin_layout Plain Layout
9121 , left, right, center
9126 ] A comma separated list of permitted alignments.
9127 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9129 For example a right-aligned or centered enumeration isn't possible.)
9132 \begin_layout Description
9133 \begin_inset Flex CharStyle:Code
9136 \begin_layout Plain Layout
9142 Language dependent information to be included in the LaTeX preamble when
9144 Note that this will completely override any prior
9145 \begin_inset Flex CharStyle:Code
9148 \begin_layout Plain Layout
9156 \begin_inset Quotes eld
9160 \begin_inset Flex CharStyle:Code
9163 \begin_layout Plain Layout
9170 \begin_inset Quotes erd
9174 The contents of this tag will occur once in the LaTeX preamble for each
9175 language used by the document.
9176 Each time, the following substitutions are made:
9180 \begin_layout Itemize
9181 \begin_inset Flex CharStyle:Code
9184 \begin_layout Plain Layout
9190 is replaced by the language name (as used by the babel package).
9193 \begin_layout Itemize
9195 \begin_inset Quotes eld
9199 \begin_inset Quotes erd
9203 \begin_inset Flex CharStyle:Code
9206 \begin_layout Plain Layout
9212 replaces its argument by the translation of the argument to the current
9216 \begin_layout Standard
9217 This preamble snippet will only be used if the document contains more than
9218 one language and the babel package is used.
9222 \begin_layout Description
9223 \begin_inset Flex CharStyle:Code
9226 \begin_layout Plain Layout
9233 \begin_inset Flex CharStyle:Code
9236 \begin_layout Plain Layout
9246 \begin_layout Plain Layout
9247 Note that a `float' here is a real number, such as: 1.5.
9252 The vertical space with which the last of a chain of paragraphs with this
9253 layout is separated from the following paragraph.
9254 If the next paragraph has another layout, the separations are not simply
9255 added, but the maximum is taken.
9258 \begin_layout Description
9259 \begin_inset Flex CharStyle:Code
9262 \begin_layout Plain Layout
9269 \begin_inset Flex CharStyle:Code
9272 \begin_layout Plain Layout
9278 The category for this style.
9279 This is used to group related styles in the Layout combobox on the toolbar.
9280 Any string can be used, but you may want to use existing categories with
9285 \begin_layout Description
9286 \begin_inset Flex CharStyle:Code
9289 \begin_layout Plain Layout
9295 Depth of XML command.
9296 Used only with XML-type formats.
9299 \begin_layout Description
9300 \begin_inset Flex CharStyle:Code
9303 \begin_layout Plain Layout
9310 \begin_inset CommandInset label
9312 name "des:CopyStyle"
9317 \begin_inset Flex CharStyle:Code
9320 \begin_layout Plain Layout
9326 Copies all the features of an existing style into the current one.
9330 \begin_layout Description
9331 \begin_inset Flex CharStyle:Code
9334 \begin_layout Plain Layout
9340 The name of a style whose preamble should be output
9345 This allows to ensure some ordering of the preamble snippets when macros
9346 definitions depend on one another.
9350 \begin_layout Plain Layout
9351 Note that, besides that functionality, there is no way to ensure any ordering
9353 The ordering that you see in a given version of LyX may change without
9354 warning in later versions.
9362 \begin_layout Description
9363 \begin_inset Flex CharStyle:Code
9366 \begin_layout Plain Layout
9373 \begin_inset Flex CharStyle:Code
9376 \begin_layout Plain Layout
9381 , Box, Filled_Box, Static
9386 ] The type of label that stands at the end of the paragraph (or sequence
9388 \begin_inset Flex CharStyle:Code
9391 \begin_layout Plain Layout
9398 \begin_inset Flex CharStyle:Code
9401 \begin_layout Plain Layout
9408 \begin_inset Flex CharStyle:Code
9411 \begin_layout Plain Layout
9418 \begin_inset Flex CharStyle:Code
9421 \begin_layout Plain Layout
9429 \begin_inset Flex CharStyle:Code
9432 \begin_layout Plain Layout
9439 \begin_inset Quotes eld
9443 \begin_inset Quotes erd
9447 \begin_inset Flex CharStyle:Code
9450 \begin_layout Plain Layout
9457 \begin_inset Flex CharStyle:Code
9460 \begin_layout Plain Layout
9461 \begin_inset space ~
9470 \begin_inset space ~
9473 black) square suitable for end of proof markers,
9474 \begin_inset Flex CharStyle:Code
9477 \begin_layout Plain Layout
9483 is an explicit text string.
9486 \begin_layout Description
9487 \begin_inset Flex CharStyle:Code
9490 \begin_layout Plain Layout
9497 \begin_inset Flex CharStyle:Code
9500 \begin_layout Plain Layout
9506 ] The string used for a label with a
9507 \begin_inset Flex CharStyle:Code
9510 \begin_layout Plain Layout
9517 \begin_inset Flex CharStyle:Code
9520 \begin_layout Plain Layout
9530 \begin_layout Description
9531 \begin_inset Flex CharStyle:Code
9534 \begin_layout Plain Layout
9541 \begin_inset Flex CharStyle:Code
9544 \begin_layout Plain Layout
9555 \begin_inset Flex CharStyle:Code
9558 \begin_layout Plain Layout
9567 \begin_layout Description
9568 \begin_inset Flex CharStyle:Code
9571 \begin_layout Plain Layout
9578 \begin_inset Flex CharStyle:Code
9581 \begin_layout Plain Layout
9591 ] With this parameter the
9592 \begin_inset Flex CharStyle:MenuItem
9595 \begin_layout Plain Layout
9602 \begin_inset Quotes eld
9605 Vertical space above
9606 \begin_inset Quotes erd
9610 \begin_inset Flex CharStyle:MenuItem
9613 \begin_layout Plain Layout
9614 Edit\SpecialChar \menuseparator
9616 \begin_inset space ~
9624 dialog can be set when initializing a paragraph with this style.
9628 \begin_layout Plain Layout
9631 Note from Jean-Marc:
9633 I'm not sure that this setting has much use, and it should probably be
9634 removed in later versions.
9642 \begin_layout Description
9643 \begin_inset Flex CharStyle:Code
9646 \begin_layout Plain Layout
9652 The font used for both the text body
9658 \begin_inset space ~
9662 \begin_inset CommandInset ref
9664 reference "sub:Font-description"
9669 Note that defining this font automatically defines the
9670 \begin_inset Flex CharStyle:Code
9673 \begin_layout Plain Layout
9680 So you should define this one first if you also want to define
9681 \begin_inset Flex CharStyle:Code
9684 \begin_layout Plain Layout
9693 \begin_layout Description
9694 \begin_inset Flex CharStyle:Code
9697 \begin_layout Plain Layout
9704 \begin_inset CommandInset label
9706 name "des:FreeSpacing"
9713 \begin_inset Flex CharStyle:Code
9716 \begin_layout Plain Layout
9727 \begin_inset Flex CharStyle:Code
9730 \begin_layout Plain Layout
9736 ] Usually LyX doesn't allow you to insert more than one space between words,
9737 since a space is considered as the separation between two words, not a
9738 character or symbol of its own.
9739 This is a very fine thing but sometimes annoying, for example, when typing
9740 program code or plain LaTeX code.
9742 \begin_inset Flex CharStyle:Code
9745 \begin_layout Plain Layout
9752 Note that LyX will create protected blanks for the additional blanks when
9753 in another mode than LaTeX-mode.
9756 \begin_layout Description
9757 \begin_inset Flex CharStyle:Code
9760 \begin_layout Plain Layout
9766 These tags are used with XHTML output.
9769 \begin_layout Description
9770 \begin_inset Flex CharStyle:Code
9773 \begin_layout Plain Layout
9779 [[FIXME]] (Used only with XML-type formats.)
9782 \begin_layout Description
9783 \begin_inset Flex CharStyle:Code
9786 \begin_layout Plain Layout
9793 \begin_inset Flex CharStyle:Code
9796 \begin_layout Plain Layout
9802 If 1, marks the layout as to be included in the document preamble rather
9803 than in the document body.
9804 This is useful for document classes that want such information as the title
9805 and author to appear in the preamble.
9808 \begin_layout Description
9809 \begin_inset Flex CharStyle:Code
9812 \begin_layout Plain Layout
9819 \begin_inset Flex CharStyle:Code
9822 \begin_layout Plain Layout
9828 If 1, marks the layout as being part of a title block (see also the
9829 \begin_inset Flex CharStyle:Code
9832 \begin_layout Plain Layout
9839 \begin_inset Flex CharStyle:Code
9842 \begin_layout Plain Layout
9851 \begin_layout Description
9852 \begin_inset Flex CharStyle:Code
9855 \begin_layout Plain Layout
9862 \begin_inset Flex CharStyle:Code
9865 \begin_layout Plain Layout
9871 ] This provides extra space between paragraphs that have the same layout.
9872 If you put other layouts into an environment, each is separated with the
9874 \begin_inset Flex CharStyle:Code
9877 \begin_layout Plain Layout
9884 But the whole items of the environment are additionally separated with
9886 \begin_inset Flex CharStyle:Code
9889 \begin_layout Plain Layout
9901 \begin_layout Description
9902 \begin_inset Flex CharStyle:Code
9905 \begin_layout Plain Layout
9911 [[FIXME]] (Used only with XML-type formats.)
9914 \begin_layout Description
9915 \begin_inset Flex CharStyle:Code
9918 \begin_layout Plain Layout
9925 \begin_inset CommandInset label
9927 name "des:KeepEmpty"
9934 \begin_inset Flex CharStyle:Code
9937 \begin_layout Plain Layout
9948 \begin_inset Flex CharStyle:Code
9951 \begin_layout Plain Layout
9957 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9958 lead to empty LaTeX output.
9959 There are some cases where this could be desirable however: in a letter
9960 template, the required fields can be provided as empty fields, so that
9961 people do not forget them; in some special classes, a layout can be used
9962 as some kind of break, which does not contain actual text.
9965 \begin_layout Description
9966 \begin_inset Flex CharStyle:Code
9969 \begin_layout Plain Layout
9975 [float=0] The vertical space between the label and the text body.
9976 Only used for labels that are above the text body (
9977 \begin_inset Flex CharStyle:Code
9980 \begin_layout Plain Layout
9987 \begin_inset Flex CharStyle:Code
9990 \begin_layout Plain Layout
9991 Centered_Top_Environment
9999 \begin_layout Description
10000 \begin_inset Flex CharStyle:Code
10003 \begin_layout Plain Layout
10010 \begin_inset Flex CharStyle:Code
10013 \begin_layout Plain Layout
10020 \begin_inset Newline newline
10023 The name of the counter for automatic numbering.
10025 \begin_inset Newline newline
10033 \begin_inset Flex CharStyle:Code
10036 \begin_layout Plain Layout
10043 \begin_inset Flex CharStyle:Code
10046 \begin_layout Plain Layout
10053 In that case, the counter will be stepped each time the layout appears.
10055 \begin_inset Newline newline
10063 \begin_inset Flex CharStyle:Code
10066 \begin_layout Plain Layout
10073 \begin_inset Flex CharStyle:Code
10076 \begin_layout Plain Layout
10082 , though this case is a bit complicated.
10083 Suppose you declare
10084 \begin_inset Quotes eld
10088 \begin_inset Flex CharStyle:Code
10091 \begin_layout Plain Layout
10092 LabelCounter myenum
10098 \begin_inset Quotes erd
10102 Then the actual counters used are
10103 \begin_inset Flex CharStyle:Code
10106 \begin_layout Plain Layout
10113 \begin_inset Flex CharStyle:Code
10116 \begin_layout Plain Layout
10123 \begin_inset Flex CharStyle:Code
10126 \begin_layout Plain Layout
10133 \begin_inset Flex CharStyle:Code
10136 \begin_layout Plain Layout
10142 , much as in LaTeX.
10143 These counters must all be declared separately.
10144 \begin_inset Newline newline
10148 \begin_inset CommandInset ref
10150 reference "sub:Counters"
10154 for details on counters.
10157 \begin_layout Description
10158 \begin_inset Flex CharStyle:Code
10161 \begin_layout Plain Layout
10167 The font used for the label.
10169 \begin_inset space ~
10173 \begin_inset CommandInset ref
10175 reference "sub:Font-description"
10182 \begin_layout Description
10183 \begin_inset Flex CharStyle:Code
10186 \begin_layout Plain Layout
10192 Text that indicates how far a label should be indented.
10195 \begin_layout Description
10196 \begin_inset Flex CharStyle:Code
10199 \begin_layout Plain Layout
10206 \begin_inset Flex CharStyle:Code
10209 \begin_layout Plain Layout
10215 ] The horizontal space between the label and the text body.
10216 Only used for labels that are not above the text body.
10219 \begin_layout Description
10220 \begin_inset Flex CharStyle:Code
10223 \begin_layout Plain Layout
10230 \begin_inset Flex CharStyle:Code
10233 \begin_layout Plain Layout
10239 ] The string used for a label with a
10240 \begin_inset Flex CharStyle:Code
10243 \begin_layout Plain Layout
10251 \begin_inset Flex CharStyle:Code
10254 \begin_layout Plain Layout
10260 is set, this string can be contain the special formatting commands described
10262 \begin_inset CommandInset ref
10264 reference "sub:Counters"
10272 \begin_layout Plain Layout
10273 For the sake of backwards compatibility, the string
10274 \begin_inset Flex CharStyle:Code
10277 \begin_layout Plain Layout
10287 will be replaced by the expanded
10288 \begin_inset Flex CharStyle:Code
10291 \begin_layout Plain Layout
10298 \begin_inset Flex CharStyle:Code
10301 \begin_layout Plain Layout
10310 This feature is now obsolete and should be replaced by the mechanisms of
10312 \begin_inset CommandInset ref
10314 reference "sub:Counters"
10326 \begin_layout Description
10327 \begin_inset Flex CharStyle:Code
10330 \begin_layout Plain Layout
10331 LabelStringAppendix
10337 \begin_inset Flex CharStyle:Code
10340 \begin_layout Plain Layout
10346 ] This is used inside the appendix instead of
10347 \begin_inset Flex CharStyle:Code
10350 \begin_layout Plain Layout
10358 \begin_inset Flex CharStyle:Code
10361 \begin_layout Plain Layout
10368 \begin_inset Flex CharStyle:Code
10371 \begin_layout Plain Layout
10372 LabelStringAppendix
10380 \begin_layout Description
10381 \begin_inset Flex CharStyle:Code
10384 \begin_layout Plain Layout
10390 [FIXME] (Used only with XML-type formats.)
10393 \begin_layout Description
10394 \begin_inset Flex CharStyle:Code
10397 \begin_layout Plain Layout
10404 \begin_inset Flex CharStyle:Code
10407 \begin_layout Plain Layout
10412 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10413 Enumerate, Itemize, Bibliography
10422 \begin_layout Itemize
10423 \begin_inset Flex CharStyle:Code
10426 \begin_layout Plain Layout
10432 means the label is the very first word (up to the first real blank).
10433 Use protected spaces (like
10434 \begin_inset space ~
10437 that one) if you want more than one word as the label.
10441 \begin_layout Itemize
10442 \begin_inset Flex CharStyle:Code
10445 \begin_layout Plain Layout
10451 means the label is simply whatever
10452 \begin_inset Flex CharStyle:Code
10455 \begin_layout Plain Layout
10462 Note that this really is `static'.
10465 \begin_layout Itemize
10466 \begin_inset Flex CharStyle:Code
10469 \begin_layout Plain Layout
10476 \begin_inset Flex CharStyle:Code
10479 \begin_layout Plain Layout
10480 Centered_Top_Environment
10485 are special cases of
10486 \begin_inset Flex CharStyle:Code
10489 \begin_layout Plain Layout
10496 The label will be printed above the paragraph, but only at the top of an
10497 environment or the top of a chain of paragraphs with this layout.
10498 This might be used with the
10499 \begin_inset Flex CharStyle:MenuItem
10502 \begin_layout Plain Layout
10508 layout, for example.
10511 \begin_layout Itemize
10512 \begin_inset Flex CharStyle:Code
10515 \begin_layout Plain Layout
10521 is a special case for the caption-labels
10522 \begin_inset Quotes eld
10526 \begin_inset Quotes erd
10530 \begin_inset Quotes eld
10534 \begin_inset Quotes erd
10539 \begin_inset Flex CharStyle:Code
10542 \begin_layout Plain Layout
10548 means the (hardcoded) label string depends on the kind of float: It is
10549 hardcoded to be `FloatType N', where N is the value of the counter associated
10553 \begin_layout Itemize
10555 \begin_inset Flex CharStyle:Code
10558 \begin_layout Plain Layout
10564 label type defines automatically numbered labels.
10566 \begin_inset Flex CharStyle:Code
10569 \begin_layout Plain Layout
10575 will be expanded to resolve any counter references it contains: For example,
10577 \begin_inset Quotes eld
10581 \begin_inset Flex CharStyle:Code
10584 \begin_layout Plain Layout
10595 \begin_inset Quotes erd
10600 \begin_inset CommandInset ref
10602 reference "sub:Counters"
10606 for more information on counters.
10609 \begin_layout Itemize
10610 \begin_inset Flex CharStyle:Code
10613 \begin_layout Plain Layout
10619 produces the usual sort of enumeration labels.
10620 At present, it is hardcoded to use Arabic numerals, lowercase letters,
10621 small Roman numerals, and uppercase letters for the four possible depths.
10624 \begin_layout Itemize
10625 \begin_inset Flex CharStyle:Code
10628 \begin_layout Plain Layout
10634 produces various bullets at the different levels.
10635 It is also hardcoded.
10638 \begin_layout Itemize
10639 \begin_inset Flex CharStyle:Code
10642 \begin_layout Plain Layout
10648 is used internally by LyX and should be used only with
10649 \begin_inset Flex CharStyle:Code
10652 \begin_layout Plain Layout
10653 LatexType BibEnvironment
10662 \begin_layout Description
10663 \begin_inset Flex CharStyle:Code
10666 \begin_layout Plain Layout
10673 \begin_inset Flex CharStyle:Code
10676 \begin_layout Plain Layout
10682 , but this preamble snippet occurs independently from the babel package,
10683 and only for the document language.
10685 \begin_inset Quotes eld
10689 \begin_inset Flex CharStyle:Code
10692 \begin_layout Plain Layout
10699 \begin_inset Quotes erd
10706 \begin_layout Standard
10707 If the style defines text that appears in the typeset document, it may use
10709 \begin_inset Flex CharStyle:Code
10712 \begin_layout Plain Layout
10719 \begin_inset Flex CharStyle:Code
10722 \begin_layout Plain Layout
10728 to support non-english and even multilanguage documents correctly.
10729 The following excerpt (from the
10730 \begin_inset Flex CharStyle:Code
10733 \begin_layout Plain Layout
10739 file) shows how this works:
10742 \begin_layout LyX-Code
10746 \begin_layout LyX-Code
10749 theoremstyle{remark}
10752 \begin_layout LyX-Code
10755 newtheorem{claim}[thm]{
10762 \begin_layout LyX-Code
10766 \begin_layout LyX-Code
10770 \begin_layout LyX-Code
10775 claimname}{_(Claim)}
10778 \begin_layout LyX-Code
10782 \begin_layout LyX-Code
10786 \begin_layout LyX-Code
10790 \begin_layout LyX-Code
10799 claimname}{_(Claim)}}
10802 \begin_layout LyX-Code
10806 \begin_layout Standard
10807 The key to correct translation of the user visible text is the definition
10809 \begin_inset Flex CharStyle:Code
10812 \begin_layout Plain Layout
10820 in the language preamble.
10821 This command holds the name of the theorem that will appear in the output.
10823 \begin_inset Flex CharStyle:Code
10826 \begin_layout Plain Layout
10832 then uses the commands offered by the babel package to redefine
10833 \begin_inset Flex CharStyle:Code
10836 \begin_layout Plain Layout
10844 for each used language in multilanguage documents.
10848 \begin_layout Description
10849 \begin_inset Flex CharStyle:Code
10852 \begin_layout Plain Layout
10858 The name of the corresponding LaTeX stuff.
10859 Either the environment or command name.
10862 \begin_layout Description
10863 \begin_inset Flex CharStyle:Code
10866 \begin_layout Plain Layout
10872 An optional parameter for the corresponding
10873 \begin_inset Flex CharStyle:Code
10876 \begin_layout Plain Layout
10883 This parameter cannot be changed from within LyX.
10886 \begin_layout Description
10887 \begin_inset Flex CharStyle:Code
10890 \begin_layout Plain Layout
10897 \begin_inset CommandInset label
10899 name "des:LatexType"
10904 \begin_inset Flex CharStyle:Code
10907 \begin_layout Plain Layout
10912 , Command, Environment, Item_Environment,
10918 \begin_inset Flex CharStyle:Code
10921 \begin_layout Plain Layout
10922 List_Environment, Bib_Environment
10927 ] How the layout should be translated into LaTeX.
10931 \begin_layout Plain Layout
10932 \begin_inset Flex CharStyle:Code
10935 \begin_layout Plain Layout
10941 is perhaps a bit misleading, since these rules apply to SGML classes, too.
10942 Visit the SGML class files for specific examples.
10951 \begin_layout Itemize
10952 \begin_inset Flex CharStyle:Code
10955 \begin_layout Plain Layout
10961 means nothing special.
10965 \begin_layout Itemize
10966 \begin_inset Flex CharStyle:Code
10969 \begin_layout Plain Layout
10976 \begin_inset Flex CharStyle:Code
10979 \begin_layout Plain Layout
10986 {\SpecialChar \ldots{}
10995 \begin_layout Itemize
10996 \begin_inset Flex CharStyle:Code
10999 \begin_layout Plain Layout
11006 \begin_inset Flex CharStyle:Code
11009 \begin_layout Plain Layout
11016 }\SpecialChar \ldots{}
11032 \begin_layout Itemize
11033 \begin_inset Flex CharStyle:Code
11036 \begin_layout Plain Layout
11043 \begin_inset Flex CharStyle:Code
11046 \begin_layout Plain Layout
11053 \begin_inset Flex CharStyle:Code
11056 \begin_layout Plain Layout
11064 is generated for each paragraph of this environment.
11068 \begin_layout Itemize
11069 \begin_inset Flex CharStyle:Code
11072 \begin_layout Plain Layout
11079 \begin_inset Flex CharStyle:Code
11082 \begin_layout Plain Layout
11089 \begin_inset Flex CharStyle:Code
11092 \begin_layout Plain Layout
11098 is passed as an argument to the environment.
11100 \begin_inset Flex CharStyle:Code
11103 \begin_layout Plain Layout
11109 can be defined in the
11110 \begin_inset Flex CharStyle:MenuItem
11113 \begin_layout Plain Layout
11118 ayout\SpecialChar \menuseparator
11132 \begin_layout Standard
11133 Putting the last few things together, the LaTeX output will be either:
11136 \begin_layout LyX-Code
11139 latexname[latexparam]{\SpecialChar \ldots{}
11143 \begin_layout Standard
11147 \begin_layout LyX-Code
11150 begin{latexname}[latexparam] \SpecialChar \ldots{}
11156 \begin_layout Standard
11157 depending upon the LaTeX type.
11161 \begin_layout Description
11162 \begin_inset Flex CharStyle:Code
11165 \begin_layout Plain Layout
11172 \begin_inset Flex CharStyle:Code
11175 \begin_layout Plain Layout
11181 ] If you put layouts into environments, the leftmargins are not simply added,
11182 but added with a factor
11183 \begin_inset Formula $\frac{4}{depth+4}$
11187 Note that this parameter is also used when the margin is defined as
11188 \begin_inset Flex CharStyle:Code
11191 \begin_layout Plain Layout
11198 \begin_inset Flex CharStyle:Code
11201 \begin_layout Plain Layout
11208 Then it is added to the manual or dynamic margin.
11210 \begin_inset Newline newline
11213 The argument is passed as a string.
11215 \begin_inset Quotes eld
11219 \begin_inset Flex CharStyle:Code
11222 \begin_layout Plain Layout
11229 \begin_inset Quotes erd
11232 means that the paragraph is indented with the width of
11233 \begin_inset Quotes eld
11237 \begin_inset Flex CharStyle:Code
11240 \begin_layout Plain Layout
11247 \begin_inset Quotes erd
11250 in the normal font.
11251 You can get a negative width by prefixing the string with
11252 \begin_inset Quotes eld
11256 \begin_inset Flex CharStyle:Code
11259 \begin_layout Plain Layout
11266 \begin_inset Quotes erd
11270 This way was chosen so that the look is the same with each used screen
11275 \begin_layout Description
11276 \begin_inset Flex CharStyle:Code
11279 \begin_layout Plain Layout
11286 \begin_inset Flex CharStyle:Code
11289 \begin_layout Plain Layout
11294 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11300 \begin_inset Newline newline
11303 The kind of margin that the layout has on the left side.
11305 \begin_inset Flex CharStyle:Code
11308 \begin_layout Plain Layout
11314 just means a fixed margin.
11316 \begin_inset Flex CharStyle:Code
11319 \begin_layout Plain Layout
11325 means that the left margin depends on the string entered in the
11326 \begin_inset Flex CharStyle:MenuItem
11329 \begin_layout Plain Layout
11330 Edit\SpecialChar \menuseparator
11332 \begin_inset space ~
11341 This is used to typeset nice lists without tabulators.
11343 \begin_inset Flex CharStyle:Code
11346 \begin_layout Plain Layout
11352 means that the margin depends on the size of the label.
11353 This is used for automatic enumerated headlines.
11354 It is obvious that the headline
11355 \begin_inset Quotes eld
11358 5.4.3.2.1 Very long headline
11359 \begin_inset Quotes erd
11362 must have a wider left margin (as wide as
11363 \begin_inset Quotes eld
11367 \begin_inset Quotes erd
11370 plus the space) than
11371 \begin_inset Quotes eld
11374 3.2 Very long headline
11375 \begin_inset Quotes erd
11379 \begin_inset Quotes eld
11383 \begin_inset Quotes erd
11386 are not able to do this.
11388 \begin_inset Flex CharStyle:Code
11391 \begin_layout Plain Layout
11397 is similar, but only the very first row of the paragraph is dynamic, while
11398 the others are static; this is used, for example, for descriptions.
11400 \begin_inset Flex CharStyle:Code
11403 \begin_layout Plain Layout
11409 means the margin is chosen in a way that the longest row of this paragraph
11410 fits to the right margin.
11411 This is used to typeset an address on the right edge of the page.
11414 \begin_layout Description
11415 \begin_inset Flex CharStyle:Code
11418 \begin_layout Plain Layout
11425 \begin_inset Flex CharStyle:Code
11428 \begin_layout Plain Layout
11437 \begin_inset Flex CharStyle:Code
11440 \begin_layout Plain Layout
11446 ] Whether fragile commands in this layout should be
11447 \begin_inset Flex CharStyle:Code
11450 \begin_layout Plain Layout
11463 whether this command should itself be protected.)
11466 \begin_layout Description
11467 \begin_inset Flex CharStyle:Code
11470 \begin_layout Plain Layout
11477 \begin_inset Flex CharStyle:Code
11480 \begin_layout Plain Layout
11487 \begin_inset Flex CharStyle:Code
11490 \begin_layout Plain Layout
11498 ] Whether newlines are translated into LaTeX newlines (
11499 \begin_inset Flex CharStyle:Code
11502 \begin_layout Plain Layout
11513 The translation can be switched off to allow more comfortable LaTeX editing
11517 \begin_layout Description
11518 \begin_inset Flex CharStyle:Code
11521 \begin_layout Plain Layout
11528 \begin_inset Flex CharStyle:Code
11531 \begin_layout Plain Layout
11538 \begin_inset Flex CharStyle:Code
11541 \begin_layout Plain Layout
11549 ] Whether the following Paragraph is allowed to indent its very first row.
11551 \begin_inset Flex CharStyle:Code
11554 \begin_layout Plain Layout
11560 means that it is not allowed to do so;
11561 \begin_inset Flex CharStyle:Code
11564 \begin_layout Plain Layout
11570 means it could do so if it wants to.
11573 \begin_layout Description
11574 \begin_inset Flex CharStyle:Code
11577 \begin_layout Plain Layout
11583 Name of a layout that has replaced this layout.
11584 This is used to rename a layout, while keeping backward compatibility.
11587 \begin_layout Description
11588 \begin_inset Flex CharStyle:Code
11591 \begin_layout Plain Layout
11598 \begin_inset Flex CharStyle:Code
11601 \begin_layout Plain Layout
11607 ] The number of optional arguments that can be used with this layout.
11608 This is useful for things like section headings, and only makes sense with
11612 \begin_layout Description
11613 \begin_inset Flex CharStyle:Code
11616 \begin_layout Plain Layout
11623 \begin_inset Flex CharStyle:Code
11626 \begin_layout Plain Layout
11632 ] The indent of the very first line of a paragraph.
11634 \begin_inset Flex CharStyle:Code
11637 \begin_layout Plain Layout
11643 will be fixed for a certain layout.
11644 The exception is Standard layout, since the indentation of a Standard layout
11645 paragraph can be prohibited with
11646 \begin_inset Flex CharStyle:Code
11649 \begin_layout Plain Layout
11656 Also, Standard layout paragraphs inside environments use the
11657 \begin_inset Flex CharStyle:Code
11660 \begin_layout Plain Layout
11666 of the environment, not their native one.
11667 For example, Standard paragraphs inside an enumeration are not indented.
11670 \begin_layout Description
11671 \begin_inset Flex CharStyle:Code
11674 \begin_layout Plain Layout
11681 \begin_inset Flex CharStyle:Code
11684 \begin_layout Plain Layout
11690 ] The vertical space between two paragraphs of this layout.
11693 \begin_layout Description
11694 \begin_inset Flex CharStyle:Code
11697 \begin_layout Plain Layout
11704 \begin_inset Flex CharStyle:Code
11707 \begin_layout Plain Layout
11713 ] LyX allows the user to choose either
11714 \begin_inset Quotes eld
11718 \begin_inset Quotes erd
11722 \begin_inset Quotes eld
11726 \begin_inset Quotes erd
11729 to typeset a document.
11731 \begin_inset Quotes eld
11735 \begin_inset Quotes erd
11738 is chosen, this value is completely ignored.
11740 \begin_inset Quotes eld
11744 \begin_inset Quotes erd
11747 is chosen, the parindent of a LaTeXtype
11748 \begin_inset Quotes eld
11752 \begin_inset Quotes erd
11755 layout is ignored and all paragraphs are separated by this parskip argument.
11756 The vertical space is calculated with
11757 \begin_inset Flex CharStyle:Code
11760 \begin_layout Plain Layout
11762 \begin_inset space ~
11771 \begin_inset Flex CharStyle:Code
11774 \begin_layout Plain Layout
11780 is the height of a row with the normal font.
11781 This way, the look stays the same with different screen fonts.
11784 \begin_layout Description
11785 \begin_inset Flex CharStyle:Code
11788 \begin_layout Plain Layout
11795 \begin_inset CommandInset label
11797 name "des:PathThru"
11804 \begin_inset Flex CharStyle:Code
11807 \begin_layout Plain Layout
11818 \begin_inset Flex CharStyle:Code
11821 \begin_layout Plain Layout
11827 ] Whether the contents of this paragraph should be output in raw form, meaning
11828 without special translations that LaTeX would require.
11831 \begin_layout Description
11832 \begin_inset Flex CharStyle:Code
11835 \begin_layout Plain Layout
11842 \begin_inset CommandInset label
11844 name "des:Preamble"
11848 Information to be included in the LaTeX preamble when this style is used.
11849 Used to define macros, load packages, etc., required by this particular
11852 \begin_inset Quotes eld
11856 \begin_inset Flex CharStyle:Code
11859 \begin_layout Plain Layout
11866 \begin_inset Quotes erd
11872 \begin_layout Description
11873 \begin_inset Flex CharStyle:Code
11876 \begin_layout Plain Layout
11883 \begin_inset Flex CharStyle:Code
11886 \begin_layout Plain Layout
11893 \begin_inset CommandInset label
11895 name "des:Requires"
11899 Whether the layout requires the feature
11900 \begin_inset Flex CharStyle:Code
11903 \begin_layout Plain Layout
11910 See the description of
11911 \begin_inset Flex CharStyle:Code
11914 \begin_layout Plain Layout
11921 \begin_inset CommandInset ref
11922 LatexCommand pageref
11923 reference "des:FreeSpacing"
11927 ) for information on `features'.
11931 \begin_layout Description
11932 \begin_inset Flex CharStyle:Code
11935 \begin_layout Plain Layout
11942 \begin_inset Flex CharStyle:Code
11945 \begin_layout Plain Layout
11952 \begin_inset Flex CharStyle:Code
11955 \begin_layout Plain Layout
11964 \begin_layout Description
11965 \begin_inset Flex CharStyle:Code
11968 \begin_layout Plain Layout
11975 \begin_inset Flex CharStyle:Code
11978 \begin_layout Plain Layout
11983 , onehalf, double, other
11992 ] This defines what the default spacing should be in the layout.
11994 \begin_inset Flex CharStyle:Code
11997 \begin_layout Plain Layout
12004 \begin_inset Flex CharStyle:Code
12007 \begin_layout Plain Layout
12014 \begin_inset Flex CharStyle:Code
12017 \begin_layout Plain Layout
12023 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12024 If you specify the argument
12025 \begin_inset Flex CharStyle:Code
12028 \begin_layout Plain Layout
12034 , then you should also provide a numerical argument which will be the actual
12036 Note that, contrary to other parameters,
12037 \begin_inset Flex CharStyle:Code
12040 \begin_layout Plain Layout
12046 implies the generation of specific LaTeX code, using the package
12049 \begin_inset Flex CharStyle:Code
12052 \begin_layout Plain Layout
12061 \begin_layout Description
12062 \begin_inset Flex CharStyle:Code
12065 \begin_layout Plain Layout
12071 The font used for the text body .
12073 \begin_inset CommandInset ref
12075 reference "sub:Font-description"
12082 \begin_layout Description
12083 \begin_inset Flex CharStyle:Code
12086 \begin_layout Plain Layout
12095 \begin_inset Flex CharStyle:Code
12098 \begin_layout Plain Layout
12108 The level of the style in the table of contents.
12109 This is used for automatic numbering of section headings.
12112 \begin_layout Description
12113 \begin_inset Flex CharStyle:Code
12116 \begin_layout Plain Layout
12123 \begin_inset Flex CharStyle:Code
12126 \begin_layout Plain Layout
12132 ] The vertical space with which the very first of a chain of paragraphs
12133 with this layout is separated from the previous paragraph.
12134 If the previous paragraph has another layout, the separations are not simply
12135 added, but the maximum is taken.
12138 \begin_layout Subsection
12139 \begin_inset CommandInset label
12141 name "sub:Paragraph-Style-XHTML"
12145 Paragraph Style XHTML
12148 \begin_layout Standard
12149 XHTML output is also controlled by layout information.
12150 In general, LyX provides sensible defaults for all of these tags and, as
12151 mentioned earlier, it can even construct default CSS information from the
12153 For example, LyX will attempt to use the information provided in the
12154 \begin_inset Flex CharStyle:Code
12157 \begin_layout Plain Layout
12163 declaration for the Chapter style to construct CSS describing how Chapters
12164 should be displayed in the browser.
12167 \begin_layout Standard
12168 The XHTML LyX outputs depends upon whether we are dealing with a normal
12169 paragraph, a command, or an environment.
12170 For a command or normal paragraph, it has the following form:
12173 \begin_layout LyX-Code
12175 \begin_inset Quotes erd
12179 \begin_inset Quotes erd
12185 \begin_layout LyX-Code
12187 \begin_inset Quotes erd
12191 \begin_inset Quotes erd
12194 >Paragraph Label</labeltag>
12197 \begin_layout LyX-Code
12198 Here lies the contents of the paragraph.
12201 \begin_layout LyX-Code
12205 \begin_layout Standard
12206 The label tags are of course omitted if the paragraph does not have one.
12207 For an environment that is not a list, it takes this form:
12210 \begin_layout LyX-Code
12212 \begin_inset Quotes erd
12216 \begin_inset Quotes erd
12222 \begin_layout LyX-Code
12224 \begin_inset Quotes erd
12228 \begin_inset Quotes erd
12232 \begin_inset Quotes erd
12236 \begin_inset Quotes erd
12239 >Environment Label</labeltag>Here lies the contents of the first paragraph.</item
12243 \begin_layout LyX-Code
12244 <itemtag>Second paragraph.</itemtag>
12247 \begin_layout LyX-Code
12251 \begin_layout Standard
12252 For a list, we have this form:
12255 \begin_layout Description
12256 \begin_inset Flex CharStyle:Code
12259 \begin_layout Plain Layout
12266 \begin_inset Flex CharStyle:Code
12269 \begin_layout Plain Layout
12275 ] Specifies one or more attribute--value pairs to be output with the main
12279 \begin_layout Subsection
12281 \begin_inset CommandInset label
12290 \begin_layout Standard
12291 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12292 define the floats (
12293 \begin_inset Flex CharStyle:MenuItem
12296 \begin_layout Plain Layout
12303 \begin_inset Flex CharStyle:MenuItem
12306 \begin_layout Plain Layout
12312 , \SpecialChar \ldots{}
12313 ) in the text class itself.
12314 Standard floats are included in the file
12315 \begin_inset Flex CharStyle:Code
12318 \begin_layout Plain Layout
12324 , so you may have to do no more than add
12327 \begin_layout LyX-Code
12328 Input stdfloats.inc
12331 \begin_layout Standard
12332 to your layout file.
12333 If you want to implement a text class that proposes some other float types
12334 (like the AGU class bundled with LyX), the information below will hopefully
12338 \begin_layout Description
12339 \begin_inset Flex CharStyle:Code
12342 \begin_layout Plain Layout
12349 \begin_inset Flex CharStyle:Code
12352 \begin_layout Plain Layout
12359 \begin_inset Quotes erd
12363 \begin_inset Quotes erd
12366 ] The file name extension of an auxiliary file for the list of figures (or
12368 LaTeX writes the captions to this file.
12371 \begin_layout Description
12372 \begin_inset Flex CharStyle:Code
12375 \begin_layout Plain Layout
12382 \begin_inset Flex CharStyle:Code
12385 \begin_layout Plain Layout
12392 \begin_inset Quotes erd
12396 \begin_inset Quotes erd
12399 ] The string that will be used in the menus and also for the caption.
12400 This is translated to the current language if babel is used.
12403 \begin_layout Description
12404 \begin_inset Flex CharStyle:Code
12407 \begin_layout Plain Layout
12414 \begin_inset Flex CharStyle:Code
12417 \begin_layout Plain Layout
12426 \begin_inset Flex CharStyle:Code
12429 \begin_layout Plain Layout
12436 \begin_inset Flex CharStyle:Code
12439 \begin_layout Plain Layout
12445 if the float is already defined by the LaTeX document class.
12447 \begin_inset Flex CharStyle:Code
12450 \begin_layout Plain Layout
12456 , the float will be defined using the LaTeX package
12457 \begin_inset Flex CharStyle:Code
12460 \begin_layout Plain Layout
12469 \begin_layout Description
12470 \begin_inset Flex CharStyle:Code
12473 \begin_layout Plain Layout
12480 \begin_inset Flex CharStyle:Code
12483 \begin_layout Plain Layout
12490 \begin_inset Quotes erd
12494 \begin_inset Quotes erd
12497 ] The heading used for the list of floats.
12498 This is translated to the document language.
12501 \begin_layout Description
12502 \begin_inset Flex CharStyle:Code
12505 \begin_layout Plain Layout
12512 \begin_inset Flex CharStyle:Code
12515 \begin_layout Plain Layout
12522 \begin_inset Quotes erd
12526 \begin_inset Quotes erd
12529 ] This (optional) argument determines whether floats of this class will
12530 be numbered within some sectional unit of the document.
12531 For example, if within is equal to
12532 \begin_inset Flex CharStyle:Code
12535 \begin_layout Plain Layout
12541 , the floats will be numbered within chapters.
12545 \begin_layout Description
12546 \begin_inset Flex CharStyle:Code
12549 \begin_layout Plain Layout
12556 \begin_inset Flex CharStyle:Code
12559 \begin_layout Plain Layout
12566 \begin_inset Quotes erd
12570 \begin_inset Quotes erd
12573 ] The default placement for the given class of floats.
12574 The string should be as in standard LaTeX:
12575 \begin_inset Flex CharStyle:Code
12578 \begin_layout Plain Layout
12585 \begin_inset Flex CharStyle:Code
12588 \begin_layout Plain Layout
12595 \begin_inset Flex CharStyle:Code
12598 \begin_layout Plain Layout
12605 \begin_inset Flex CharStyle:Code
12608 \begin_layout Plain Layout
12614 for top, bottom, page, and here, respectively.
12618 \begin_layout Plain Layout
12619 Note that the order of these letters in the string is irrelevant, like in
12625 On top of that there is a new type,
12626 \begin_inset Flex CharStyle:Code
12629 \begin_layout Plain Layout
12635 , which does not really correspond to a float, since it means: put it
12636 \begin_inset Quotes eld
12640 \begin_inset Quotes erd
12644 Note however that the
12645 \begin_inset Flex CharStyle:Code
12648 \begin_layout Plain Layout
12654 specifier is special and, because of implementation details, cannot be
12655 used in non-built in float types.
12656 If you do not understand what this means, just use
12657 \begin_inset Quotes eld
12661 \begin_inset Flex CharStyle:Code
12664 \begin_layout Plain Layout
12671 \begin_inset Quotes erd
12677 \begin_layout Description
12678 \begin_inset Flex CharStyle:Code
12681 \begin_layout Plain Layout
12688 \begin_inset Flex CharStyle:Code
12691 \begin_layout Plain Layout
12698 \begin_inset Quotes erd
12702 \begin_inset Quotes erd
12705 ] The style used when defining the float using
12706 \begin_inset Flex CharStyle:Code
12709 \begin_layout Plain Layout
12720 \begin_layout Description
12721 \begin_inset Flex CharStyle:Code
12724 \begin_layout Plain Layout
12731 \begin_inset Flex CharStyle:Code
12734 \begin_layout Plain Layout
12741 \begin_inset Quotes erd
12745 \begin_inset Quotes erd
12749 \begin_inset Quotes eld
12753 \begin_inset Quotes erd
12756 of the new class of floats, like program or algorithm.
12757 After the appropriate
12758 \begin_inset Flex CharStyle:Code
12761 \begin_layout Plain Layout
12770 \begin_inset Flex CharStyle:Code
12773 \begin_layout Plain Layout
12782 \begin_inset Flex CharStyle:Code
12785 \begin_layout Plain Layout
12796 \begin_layout Standard
12797 Note that defining a float with type
12798 \begin_inset Flex CharStyle:Code
12801 \begin_layout Plain Layout
12809 automatically defines the corresponding counter with name
12810 \begin_inset Flex CharStyle:Code
12813 \begin_layout Plain Layout
12824 \begin_layout Subsection
12825 Flex insets and InsetLayout
12826 \begin_inset CommandInset label
12828 name "sub:Flex-insets-and"
12835 \begin_layout Standard
12836 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
12837 these are called Flex insets.
12841 \begin_layout Standard
12842 Flex insets come in three different kinds:
12845 \begin_layout Itemize
12847 \begin_inset Flex CharStyle:Code
12850 \begin_layout Plain Layout
12856 ): These define semantic markup corresponding to such LaTeX commands as
12858 \begin_inset Flex CharStyle:Code
12861 \begin_layout Plain Layout
12870 \begin_inset Flex CharStyle:Code
12873 \begin_layout Plain Layout
12884 \begin_layout Itemize
12886 \begin_inset Flex CharStyle:Code
12889 \begin_layout Plain Layout
12895 ): These can be used to define custom collapsible insets, similar to TeX
12896 code, footnote, and the like.
12897 An obvious example is an endnote inset, which is defined in the
12898 \begin_inset Flex CharStyle:Code
12901 \begin_layout Plain Layout
12910 \begin_layout Itemize
12912 \begin_inset Flex CharStyle:Code
12915 \begin_layout Plain Layout
12921 ): For use with DocBook classes.
12924 \begin_layout Standard
12925 Flex insets are defined using the
12926 \begin_inset Flex CharStyle:Code
12929 \begin_layout Plain Layout
12935 tag, which shall be explained in a moment.
12938 \begin_layout Standard
12940 \begin_inset Flex CharStyle:Code
12943 \begin_layout Plain Layout
12949 tag also serves another function: It can be used to customize the general
12950 layout of many different types of insets.
12952 \begin_inset Flex CharStyle:Code
12955 \begin_layout Plain Layout
12961 can be used to customize the layout parameters for footnotes, marginal
12962 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
12963 boxes, tables, algorithms, URLs, and optional arguments, as well as to
12964 define Flex insets.
12967 \begin_layout Standard
12969 \begin_inset Flex CharStyle:Code
12972 \begin_layout Plain Layout
12978 definition must begin with a line of the form:
12981 \begin_layout LyX-Code
12985 \begin_layout Standard
12987 \begin_inset Flex CharStyle:Code
12990 \begin_layout Plain Layout
12996 indicates the inset whose layout is being defined, and here there are two
13000 \begin_layout Enumerate
13001 The layout for a pre-existing inset is being modified.
13002 In this case, can be
13003 \begin_inset Flex CharStyle:Code
13006 \begin_layout Plain Layout
13012 any one of the following:
13013 \begin_inset Flex CharStyle:Code
13016 \begin_layout Plain Layout
13023 \begin_inset Flex CharStyle:Code
13026 \begin_layout Plain Layout
13033 \begin_inset Flex CharStyle:Code
13036 \begin_layout Plain Layout
13043 \begin_inset Flex CharStyle:Code
13046 \begin_layout Plain Layout
13053 \begin_inset Flex CharStyle:Code
13056 \begin_layout Plain Layout
13063 \begin_inset Flex CharStyle:Code
13066 \begin_layout Plain Layout
13073 \begin_inset Flex CharStyle:Code
13076 \begin_layout Plain Layout
13083 \begin_inset Flex CharStyle:Code
13086 \begin_layout Plain Layout
13093 \begin_inset Flex CharStyle:Code
13096 \begin_layout Plain Layout
13103 \begin_inset Flex CharStyle:Code
13106 \begin_layout Plain Layout
13113 \begin_inset Flex CharStyle:Code
13116 \begin_layout Plain Layout
13123 \begin_inset Flex CharStyle:Code
13126 \begin_layout Plain Layout
13133 \begin_inset Flex CharStyle:Code
13136 \begin_layout Plain Layout
13143 \begin_inset Flex CharStyle:Code
13146 \begin_layout Plain Layout
13153 \begin_inset Flex CharStyle:Code
13156 \begin_layout Plain Layout
13163 \begin_inset Flex CharStyle:Code
13166 \begin_layout Plain Layout
13173 \begin_inset Flex CharStyle:Code
13176 \begin_layout Plain Layout
13183 \begin_inset Flex CharStyle:Code
13186 \begin_layout Plain Layout
13193 \begin_inset Flex CharStyle:Code
13196 \begin_layout Plain Layout
13203 \begin_inset Flex CharStyle:Code
13206 \begin_layout Plain Layout
13215 \begin_layout Enumerate
13216 The layout for a Flex inset is being defined.
13218 \begin_inset Flex CharStyle:Code
13221 \begin_layout Plain Layout
13227 can be any valid identifier not used by a pre-existing inset.
13228 Note that the definition of a flex inset must
13233 \begin_inset Flex CharStyle:Code
13236 \begin_layout Plain Layout
13245 \begin_layout Standard
13247 \begin_inset Flex CharStyle:Code
13250 \begin_layout Plain Layout
13256 definition can contain the following entries:
13259 \begin_layout Description
13260 \begin_inset Flex CharStyle:Code
13263 \begin_layout Plain Layout
13269 The color for the inset's background.
13270 The valid colors are defined in
13271 \begin_inset Flex CharStyle:Code
13274 \begin_layout Plain Layout
13283 \begin_layout Description
13284 \begin_inset Flex CharStyle:Code
13287 \begin_layout Plain Layout
13294 \begin_inset Flex CharStyle:Code
13297 \begin_layout Plain Layout
13306 \begin_inset Flex CharStyle:Code
13309 \begin_layout Plain Layout
13315 ] Whether to use the content of the inset as the label, when the inset is
13320 \begin_layout Description
13321 \begin_inset Flex CharStyle:Code
13324 \begin_layout Plain Layout
13330 As with paragraph styles (see page
13331 \begin_inset CommandInset ref
13333 reference "des:CopyStyle"
13340 \begin_layout Description
13341 \begin_inset Flex CharStyle:Code
13344 \begin_layout Plain Layout
13351 \begin_inset Flex CharStyle:Code
13354 \begin_layout Plain Layout
13363 \begin_inset Flex CharStyle:Code
13366 \begin_layout Plain Layout
13372 ] Indicates whether the user may employ the Paragraph Settings dialog to
13373 customize the paragraph.
13376 \begin_layout Description
13377 \begin_inset Flex CharStyle:Code
13380 \begin_layout Plain Layout
13387 \begin_inset Flex CharStyle:Code
13390 \begin_layout Plain Layout
13397 \begin_inset Flex CharStyle:Code
13400 \begin_layout Plain Layout
13407 \begin_inset Flex CharStyle:Code
13410 \begin_layout Plain Layout
13416 , describing the rendering style used for the inset's frame and buttons.
13417 Footnotes generally use
13418 \begin_inset Flex CharStyle:Code
13421 \begin_layout Plain Layout
13427 , ERT insets generally
13428 \begin_inset Flex CharStyle:Code
13431 \begin_layout Plain Layout
13437 , and character styles
13438 \begin_inset Flex CharStyle:Code
13441 \begin_layout Plain Layout
13450 \begin_layout Description
13451 \begin_inset Flex CharStyle:Code
13454 \begin_layout Plain Layout
13460 Required at the end of the InsetLayout declarations.
13463 \begin_layout Description
13464 \begin_inset Flex CharStyle:Code
13467 \begin_layout Plain Layout
13473 The font used for both the text body
13479 \begin_inset space ~
13483 \begin_inset CommandInset ref
13485 reference "sub:Font-description"
13490 Note that defining this font automatically defines the
13491 \begin_inset Flex CharStyle:Code
13494 \begin_layout Plain Layout
13500 to the same value, so define this first and define
13501 \begin_inset Flex CharStyle:Code
13504 \begin_layout Plain Layout
13510 later if you want them to be different.
13513 \begin_layout Description
13514 \begin_inset Flex CharStyle:Code
13517 \begin_layout Plain Layout
13524 \begin_inset Quotes eld
13528 \begin_inset Quotes erd
13531 language, leading to Left-to-Right (latin) output, e.
13532 \begin_inset space \thinspace{}
13536 \begin_inset space \space{}
13539 in TeX code or URL.
13543 \begin_layout Description
13544 \begin_inset Flex CharStyle:Code
13547 \begin_layout Plain Layout
13554 \begin_inset Flex CharStyle:Code
13557 \begin_layout Plain Layout
13566 \begin_inset Flex CharStyle:Code
13569 \begin_layout Plain Layout
13575 ] Indicates whether the PlainLayout should be used or, instead, the user
13576 can change the paragraph style used in the inset.
13580 \begin_layout Description
13581 \begin_inset Flex CharStyle:Code
13584 \begin_layout Plain Layout
13590 As with paragraph styles (see page
13591 \begin_inset CommandInset ref
13592 LatexCommand pageref
13593 reference "des:FreeSpacing"
13601 \begin_layout Description
13602 \begin_inset Flex CharStyle:Code
13605 \begin_layout Plain Layout
13612 \begin_inset Flex CharStyle:Code
13615 \begin_layout Plain Layout
13624 \begin_inset Flex CharStyle:Code
13627 \begin_layout Plain Layout
13633 ] Whether to include the contents of this inset in the strings generated
13634 for the `Outline' pane.
13635 One would not, for example, want the content of a footnote in a section
13636 header to be included in the TOC displayed in the outline, but one would
13637 normally want the content of a character style displayed.
13638 Default is false: not to include.
13641 \begin_layout Description
13642 \begin_inset Flex CharStyle:Code
13645 \begin_layout Plain Layout
13651 As with paragraph styles (see page
13652 \begin_inset CommandInset ref
13653 LatexCommand pageref
13654 reference "des:KeepEmpty"
13662 \begin_layout Description
13663 \begin_inset Flex CharStyle:Code
13666 \begin_layout Plain Layout
13672 The font used for the label.
13674 \begin_inset space ~
13678 \begin_inset CommandInset ref
13680 reference "sub:Font-description"
13685 Note that this definition can never appear before
13686 \begin_inset Flex CharStyle:Code
13689 \begin_layout Plain Layout
13695 , lest it be ineffective.
13698 \begin_layout Description
13699 \begin_inset Flex CharStyle:Code
13702 \begin_layout Plain Layout
13708 What will be displayed on the button or elsewhere as the inset label.
13709 Some inset types (TeX code and Branch) modify this label on the fly.
13712 \begin_layout Description
13713 \begin_inset Flex CharStyle:Code
13716 \begin_layout Plain Layout
13722 The name of the corresponding LaTeX stuff.
13723 Either the environment or command name.
13726 \begin_layout Description
13727 \begin_inset Flex CharStyle:Code
13730 \begin_layout Plain Layout
13736 The optional parameter for the corresponding
13737 \begin_inset Flex CharStyle:Code
13740 \begin_layout Plain Layout
13746 stuff, including possible bracket pairs like
13747 \begin_inset Flex CharStyle:Code
13750 \begin_layout Plain Layout
13757 This parameter cannot be changed from within LyX.
13760 \begin_layout Description
13761 \begin_inset Flex CharStyle:Code
13764 \begin_layout Plain Layout
13770 As with paragraph styles (see page
13771 \begin_inset CommandInset ref
13772 LatexCommand pageref
13773 reference "des:LatexType"
13780 \begin_layout Description
13781 \begin_inset Flex CharStyle:Code
13784 \begin_layout Plain Layout
13791 \begin_inset Flex CharStyle:Code
13794 \begin_layout Plain Layout
13801 \begin_inset Flex CharStyle:Code
13804 \begin_layout Plain Layout
13811 \begin_inset Flex CharStyle:Code
13814 \begin_layout Plain Layout
13821 \begin_inset Flex CharStyle:Code
13824 \begin_layout Plain Layout
13830 (indicating a dummy definition ending definitions of charstyles, etc).
13831 This entry is required in and is only meaningful for Flex insets.
13832 Among other things, it determines on which menu this inset will appear.
13835 \begin_layout Description
13836 \begin_inset Flex CharStyle:Code
13839 \begin_layout Plain Layout
13846 \begin_inset Flex CharStyle:Code
13849 \begin_layout Plain Layout
13858 \begin_inset Flex CharStyle:Code
13861 \begin_layout Plain Layout
13867 ] Whether multiple paragraphs are permitted in this inset.
13869 \begin_inset Flex CharStyle:Code
13872 \begin_layout Plain Layout
13878 to the same value and
13879 \begin_inset Flex CharStyle:Code
13882 \begin_layout Plain Layout
13888 to the opposite value.
13889 These can be reset to other values, if they are used
13894 \begin_inset Flex CharStyle:Code
13897 \begin_layout Plain Layout
13907 \begin_layout Description
13908 \begin_inset Flex CharStyle:Code
13911 \begin_layout Plain Layout
13918 \begin_inset Flex CharStyle:Code
13921 \begin_layout Plain Layout
13930 \begin_inset Flex CharStyle:Code
13933 \begin_layout Plain Layout
13939 ] Whether fragile commands in this layout should be
13940 \begin_inset Flex CharStyle:Code
13943 \begin_layout Plain Layout
13956 whether the command should itself be protected.) Default is false.
13959 \begin_layout Description
13960 \begin_inset Flex CharStyle:Code
13963 \begin_layout Plain Layout
13970 \begin_inset Flex CharStyle:Code
13973 \begin_layout Plain Layout
13982 \begin_inset Flex CharStyle:Code
13985 \begin_layout Plain Layout
13991 ] As with paragraph styles (see page
13992 \begin_inset CommandInset ref
13993 LatexCommand pageref
13994 reference "des:PathThru"
14002 \begin_layout Description
14003 \begin_inset Flex CharStyle:Code
14006 \begin_layout Plain Layout
14012 As with paragraph styles (see page
14013 \begin_inset CommandInset ref
14014 LatexCommand pageref
14015 reference "des:Preamble"
14022 \begin_layout Description
14023 \begin_inset Flex CharStyle:Code
14026 \begin_layout Plain Layout
14033 \begin_inset Flex CharStyle:Code
14036 \begin_layout Plain Layout
14042 ] As with paragraph styles (see page
14043 \begin_inset CommandInset ref
14044 LatexCommand pageref
14045 reference "des:Requires"
14052 \begin_layout Subsection
14054 \begin_inset CommandInset label
14056 name "sub:Counters"
14063 \begin_layout Standard
14064 Since version 1.3.0 of LyX, it is both possible and necessary to define the
14066 \begin_inset Flex CharStyle:MenuItem
14069 \begin_layout Plain Layout
14076 \begin_inset Flex CharStyle:MenuItem
14079 \begin_layout Plain Layout
14085 , \SpecialChar \ldots{}
14086 ) in the text class itself.
14087 The standard counters are defined in the file
14088 \begin_inset Flex CharStyle:Code
14091 \begin_layout Plain Layout
14097 , so you may have to do no more than add
14100 \begin_layout LyX-Code
14101 Input stdcounters.inc
14104 \begin_layout Standard
14105 to your layout file to get them to work.
14106 But if you want to define custom counters, then you can do so.
14107 The counter declaration must begin with:
14110 \begin_layout LyX-Code
14111 Counter CounterName
14114 \begin_layout Standard
14116 \begin_inset Flex CharStyle:Code
14119 \begin_layout Plain Layout
14125 ' is replaced by the name of the counter.
14126 And it must end with
14127 \begin_inset Quotes eld
14131 \begin_inset Flex CharStyle:Code
14134 \begin_layout Plain Layout
14141 \begin_inset Quotes erd
14145 The following parameters can also be used:
14148 \begin_layout Description
14149 \begin_inset Flex CharStyle:Code
14152 \begin_layout Plain Layout
14153 LabelString [string=""]
14158 when this is defined, this string defines how the counter is displayed.
14159 Setting this value sets
14160 \begin_inset Flex CharStyle:Code
14163 \begin_layout Plain Layout
14164 LabelStringAppendix
14170 The following special constructs can be used in the string:
14174 \begin_layout Itemize
14175 \begin_inset Flex CharStyle:Code
14178 \begin_layout Plain Layout
14186 will be replaced by the expansion of the
14187 \begin_inset Flex CharStyle:Code
14190 \begin_layout Plain Layout
14197 \begin_inset Flex CharStyle:Code
14200 \begin_layout Plain Layout
14201 LabelStringAppendix
14207 \begin_inset Flex CharStyle:Code
14210 \begin_layout Plain Layout
14220 \begin_layout Itemize
14221 counter values can be expressed using LaTeX-like macros
14222 \begin_inset Flex CharStyle:Code
14225 \begin_layout Plain Layout
14242 \begin_inset Flex CharStyle:Code
14245 \begin_layout Plain Layout
14257 \begin_layout Plain Layout
14267 Actually, the situation is a bit more complicated: any
14286 other than those described below will produce arabic numerals.
14287 It would not be surprising to see this change in the future.
14293 \begin_inset Flex CharStyle:Code
14296 \begin_layout Plain Layout
14302 : 1, 2, 3,\SpecialChar \ldots{}
14304 \begin_inset Flex CharStyle:Code
14307 \begin_layout Plain Layout
14313 for lower-case letters: a, b, c, \SpecialChar \ldots{}
14315 \begin_inset Flex CharStyle:Code
14318 \begin_layout Plain Layout
14324 for upper-case letters: A, B, C, \SpecialChar \ldots{}
14326 \begin_inset Flex CharStyle:Code
14329 \begin_layout Plain Layout
14335 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
14337 \begin_inset Flex CharStyle:Code
14340 \begin_layout Plain Layout
14346 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
14348 \begin_inset Flex CharStyle:Code
14351 \begin_layout Plain Layout
14357 for hebrew numerals.
14361 \begin_layout Standard
14362 If LabelString is not defined, a default value is constructed as follows:
14363 if the counter has a master counter
14364 \begin_inset Flex CharStyle:Code
14367 \begin_layout Plain Layout
14374 \begin_inset Flex CharStyle:Code
14377 \begin_layout Plain Layout
14384 \begin_inset Flex CharStyle:Code
14387 \begin_layout Plain Layout
14397 is used; otherwise the string
14398 \begin_inset Flex CharStyle:Code
14401 \begin_layout Plain Layout
14412 \begin_layout Description
14413 \begin_inset Flex CharStyle:Code
14416 \begin_layout Plain Layout
14417 LabelStringAppendix [string=""]
14423 \begin_inset Flex CharStyle:Code
14426 \begin_layout Plain Layout
14432 , but for use in the Appendix.
14435 \begin_layout Description
14436 \begin_inset Flex CharStyle:Code
14439 \begin_layout Plain Layout
14446 \begin_inset Flex CharStyle:Code
14449 \begin_layout Plain Layout
14456 \begin_inset Quotes erd
14460 \begin_inset Quotes erd
14463 ] If this is set to the name of another counter, the present counter will
14464 be reset every time the other one is increased.
14466 \begin_inset Flex CharStyle:Code
14469 \begin_layout Plain Layout
14476 \begin_inset Flex CharStyle:Code
14479 \begin_layout Plain Layout
14488 \begin_layout Subsection
14490 \begin_inset CommandInset label
14492 name "sub:Font-description"
14499 \begin_layout Standard
14500 A font description looks like this:
14503 \begin_layout LyX-Code
14513 \begin_layout LyX-Code
14517 \begin_layout LyX-Code
14521 \begin_layout Standard
14522 The following commands are available:
14525 \begin_layout Description
14526 \begin_inset Flex CharStyle:Code
14529 \begin_layout Plain Layout
14536 \begin_inset Flex CharStyle:Code
14539 \begin_layout Plain Layout
14548 \begin_inset Flex CharStyle:Code
14551 \begin_layout Plain Layout
14558 \begin_inset Flex CharStyle:Code
14561 \begin_layout Plain Layout
14568 \begin_inset Flex CharStyle:Code
14571 \begin_layout Plain Layout
14578 \begin_inset Flex CharStyle:Code
14581 \begin_layout Plain Layout
14588 \begin_inset Flex CharStyle:Code
14591 \begin_layout Plain Layout
14598 \begin_inset Flex CharStyle:Code
14601 \begin_layout Plain Layout
14608 \begin_inset Flex CharStyle:Code
14611 \begin_layout Plain Layout
14618 \begin_inset Flex CharStyle:Code
14621 \begin_layout Plain Layout
14630 \begin_layout Description
14631 \begin_inset Flex CharStyle:Code
14634 \begin_layout Plain Layout
14643 \begin_inset Flex CharStyle:Code
14646 \begin_layout Plain Layout
14657 \begin_inset Flex CharStyle:Code
14660 \begin_layout Plain Layout
14667 \begin_inset Flex CharStyle:Code
14670 \begin_layout Plain Layout
14679 \begin_layout Description
14680 \begin_inset Flex CharStyle:Code
14683 \begin_layout Plain Layout
14690 \begin_inset Flex CharStyle:Code
14693 \begin_layout Plain Layout
14699 ] Valid arguments are:
14700 \begin_inset Flex CharStyle:Code
14703 \begin_layout Plain Layout
14710 \begin_inset Flex CharStyle:Code
14713 \begin_layout Plain Layout
14720 \begin_inset Flex CharStyle:Code
14723 \begin_layout Plain Layout
14730 \begin_inset Flex CharStyle:Code
14733 \begin_layout Plain Layout
14740 \begin_inset Flex CharStyle:Code
14743 \begin_layout Plain Layout
14750 \begin_inset Flex CharStyle:Code
14753 \begin_layout Plain Layout
14760 Each of these turns on or off the corresponding attribute.
14762 \begin_inset Flex CharStyle:Code
14765 \begin_layout Plain Layout
14771 turns on emphasis, and
14772 \begin_inset Flex CharStyle:Code
14775 \begin_layout Plain Layout
14783 \begin_inset Newline newline
14786 If the latter seems puzzling, remember that the font settings for the present
14787 context are generally inherited from the surrounding context.
14789 \begin_inset Flex CharStyle:Code
14792 \begin_layout Plain Layout
14798 would turn off the emphasis that was anyway in effect, say, in a theorem
14802 \begin_layout Description
14803 \begin_inset Flex CharStyle:Code
14806 \begin_layout Plain Layout
14815 \begin_inset Flex CharStyle:Code
14818 \begin_layout Plain Layout
14829 \begin_inset Flex CharStyle:Code
14832 \begin_layout Plain Layout
14841 \begin_layout Description
14842 \begin_inset Flex CharStyle:Code
14845 \begin_layout Plain Layout
14854 \begin_inset Flex CharStyle:Code
14857 \begin_layout Plain Layout
14868 \begin_inset Flex CharStyle:Code
14871 \begin_layout Plain Layout
14878 \begin_inset Flex CharStyle:Code
14881 \begin_layout Plain Layout
14888 \begin_inset Flex CharStyle:Code
14891 \begin_layout Plain Layout
14900 \begin_layout Description
14901 \begin_inset Flex CharStyle:Code
14904 \begin_layout Plain Layout
14911 \begin_inset Flex CharStyle:Code
14914 \begin_layout Plain Layout
14921 \begin_inset Flex CharStyle:Code
14924 \begin_layout Plain Layout
14931 \begin_inset Flex CharStyle:Code
14934 \begin_layout Plain Layout
14943 \begin_inset Flex CharStyle:Code
14946 \begin_layout Plain Layout
14953 \begin_inset Flex CharStyle:Code
14956 \begin_layout Plain Layout
14963 \begin_inset Flex CharStyle:Code
14966 \begin_layout Plain Layout
14973 \begin_inset Flex CharStyle:Code
14976 \begin_layout Plain Layout
14983 \begin_inset Flex CharStyle:Code
14986 \begin_layout Plain Layout
14995 \begin_layout Subsection
14996 Upgrading old layout files
14999 \begin_layout Standard
15000 The file format of layout files changes from time to time, so old layout
15001 files need to be converted.
15002 This process has been automated since LyX 1.4.0: If LyX reads an old format
15003 layout file it will call the conversion tool
15004 \begin_inset Flex CharStyle:Code
15007 \begin_layout Plain Layout
15008 LyXDir/scripts/layout2layout.py
15013 and convert it to a temporary file in current format.
15014 The original file is left untouched.
15015 If you want to convert the layout file permanently, just call the converter
15019 \begin_layout LyX-Code
15020 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
15023 \begin_layout Standard
15024 (You need to replace
15025 \begin_inset Flex CharStyle:Code
15028 \begin_layout Plain Layout
15034 with the name of your LyX system directory, unless you happen to have defined
15035 such an environment variable.) Then copy
15036 \begin_inset Flex CharStyle:Code
15039 \begin_layout Plain Layout
15046 \begin_inset Flex CharStyle:Code
15049 \begin_layout Plain Layout
15058 \begin_layout Standard
15059 The automatic conversion only handles syntax changes.
15060 It cannot handle the case where the contents of included files was changed,
15061 so these will have to be converted separately.
15064 \begin_layout Section
15066 \begin_inset CommandInset label
15068 name "sec:Creating-Templates"
15075 \begin_layout Standard
15076 Templates are created just like usual documents.
15077 The only difference is that usual documents contain all possible settings,
15078 including the font scheme and the paper size.
15079 Usually a user doesn't want a template to overwrite his defaults in these
15081 For that reason, the designer of a template should remove the corresponding
15083 \begin_inset Flex CharStyle:Code
15086 \begin_layout Plain Layout
15095 \begin_inset Flex CharStyle:Code
15098 \begin_layout Plain Layout
15106 from the template LyX file.
15107 This can be done with any simple text-editor, for example
15108 \begin_inset Flex CharStyle:Code
15111 \begin_layout Plain Layout
15118 \begin_inset Flex CharStyle:Code
15121 \begin_layout Plain Layout
15131 \begin_layout Standard
15132 Put the edited template files you create in
15133 \begin_inset Flex CharStyle:Code
15136 \begin_layout Plain Layout
15142 , copy the ones you use from the global template directory in
15143 \begin_inset Flex CharStyle:Code
15146 \begin_layout Plain Layout
15152 to the same place, and redefine the template path in the
15153 \begin_inset Flex CharStyle:MenuItem
15156 \begin_layout Plain Layout
15157 Tools\SpecialChar \menuseparator
15158 Preferences\SpecialChar \menuseparator
15167 \begin_layout Standard
15168 Note that there is a template which has a particular meaning:
15169 \begin_inset Flex CharStyle:Code
15172 \begin_layout Plain Layout
15179 This template is loaded every time you create a new document with
15180 \begin_inset Flex CharStyle:MenuItem
15183 \begin_layout Plain Layout
15184 File\SpecialChar \menuseparator
15190 in order to provide useful defaults.
15191 To create this template from inside LyX, all you have to do is to open
15192 a document with the correct settings, and use the
15193 \begin_inset Flex CharStyle:MenuItem
15196 \begin_layout Plain Layout
15197 Save as Document Defaults
15205 \begin_layout Chapter
15206 Including External Material
15209 \begin_layout Standard
15210 \begin_inset Box Shadowbox
15219 height_special "totalheight"
15222 \begin_layout Plain Layout
15223 WARNING: This portion of the documentation has not been updated for some
15225 We certainly hope that it is still accurate, but there are no guarantees.
15233 \begin_layout Standard
15234 The use of material from sources external to LyX is covered in detail in
15240 This part of the manual covers what needs to happen behind the scenes for
15241 new sorts of material to be included.
15244 \begin_layout Section
15248 \begin_layout Standard
15249 The external material feature is based on the concept of a
15254 A template is a specification of how LyX should interface with a certain
15256 As bundled, LyX comes with predefined templates for Xfig figures, various
15257 raster format images, chess diagrams, and LilyPond music notation.
15258 You can check the actual list by using the menu
15259 \begin_inset Flex CharStyle:MenuItem
15262 \begin_layout Plain Layout
15263 Insert\SpecialChar \menuseparator
15264 File\SpecialChar \menuseparator
15271 Furthermore, it is possible to roll your own template to support a specific
15273 Later we'll describe in more detail what is involved, and hopefully you
15274 will submit all the templates you create so we can include them in a later
15278 \begin_layout Standard
15279 Another basic idea of the external material feature is to distinguish between
15280 the original file that serves as a base for final material and the produced
15281 file that is included in your exported or printed document.
15282 For example, consider the case of a figure produced with
15283 \begin_inset Flex CharStyle:Code
15286 \begin_layout Plain Layout
15293 The Xfig application itself works on an original file with the
15294 \begin_inset Flex CharStyle:Code
15297 \begin_layout Plain Layout
15304 Within Xfig, you create and change your figure, and when you are done,
15306 \begin_inset Flex CharStyle:Code
15309 \begin_layout Plain Layout
15316 When you want to include the figure in your document, you invoke
15317 \begin_inset Flex CharStyle:Code
15320 \begin_layout Plain Layout
15326 in order to create a PostScript file that can readily be included in your
15329 \begin_inset Flex CharStyle:Code
15332 \begin_layout Plain Layout
15338 file is the original file, and the PostScript file is the produced file.
15341 \begin_layout Standard
15342 This distinction is important in order to allow updating of the material
15343 while you are in the process of writing the document.
15344 Furthermore, it provides us with the flexibility that is needed to support
15345 multiple export formats.
15346 For instance, in the case of a plain text file, it is not exactly an award-winn
15347 ing idea to include the figure as raw PostScript.
15348 Instead, you'd either prefer to just include a reference to the figure
15349 or try to invoke some graphics to ASCII converter to make the final result
15350 look similar to the real graphics.
15351 The external material management allows you to do this, because it is parametri
15352 zed on the different export formats that LyX supports.
15355 \begin_layout Standard
15356 Besides supporting the production of different products according to the
15357 exported format, it supports tight integration with editing and viewing
15359 In the case of an Xfig figure, you are able to invoke Xfig on the original
15360 file with a single click from within the external material dialog in LyX,
15361 and also preview the produced PostScript file with Ghostview with another
15363 No more fiddling around with the command line and/or file browsers to locate
15364 and manipulate the original or produced files.
15365 In this way, you are finally able to take full advantage of the many different
15366 applications that are relevant to use when you write your documents, and
15367 ultimately be more productive.
15370 \begin_layout Section
15371 The external template configuration file
15374 \begin_layout Standard
15375 It is relatively easy to add custom external template definitions to LyX.
15376 However, be aware that doing this in an careless manner most probably
15380 introduce an easily exploitable security hole.
15381 So before you do this, please read the discussion about security in section
15383 \begin_inset CommandInset ref
15385 reference "sec:Security-discussion"
15392 \begin_layout Standard
15393 Having said that, we encourage you to submit any interesting templates that
15398 \begin_layout Standard
15399 The external templates are defined in the
15400 \begin_inset Flex CharStyle:Code
15403 \begin_layout Plain Layout
15404 LyXDir/lib/external_templates
15410 You can place your own version in
15411 \begin_inset Flex CharStyle:Code
15414 \begin_layout Plain Layout
15415 UserDir/external_templates
15423 \begin_layout Standard
15424 A typical template looks like this:
15427 \begin_layout LyX-Code
15431 \begin_layout LyX-Code
15432 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
15435 \begin_layout LyX-Code
15439 \begin_layout LyX-Code
15443 \begin_layout LyX-Code
15447 \begin_layout LyX-Code
15451 \begin_layout LyX-Code
15455 \begin_layout LyX-Code
15456 AutomaticProduction true
15459 \begin_layout LyX-Code
15463 \begin_layout LyX-Code
15467 \begin_layout LyX-Code
15471 \begin_layout LyX-Code
15472 TransformCommand Rotate RotationLatexCommand
15475 \begin_layout LyX-Code
15476 TransformCommand Resize ResizeLatexCommand
15479 \begin_layout LyX-Code
15480 Product "$$RotateFront$$ResizeFront
15483 \begin_layout LyX-Code
15488 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
15491 \begin_layout LyX-Code
15492 $$ResizeBack$$RotateBack"
15495 \begin_layout LyX-Code
15499 \begin_layout LyX-Code
15500 UpdateResult "$$AbsPath$$Basename.pstex_t"
15503 \begin_layout LyX-Code
15504 Requirement "graphicx"
15507 \begin_layout LyX-Code
15508 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15511 \begin_layout LyX-Code
15512 ReferencedFile latex "$$AbsPath$$Basename.eps"
15515 \begin_layout LyX-Code
15516 ReferencedFile dvi "$$AbsPath$$Basename.eps"
15519 \begin_layout LyX-Code
15523 \begin_layout LyX-Code
15527 \begin_layout LyX-Code
15528 TransformCommand Rotate RotationLatexCommand
15531 \begin_layout LyX-Code
15532 TransformCommand Resize ResizeLatexCommand
15535 \begin_layout LyX-Code
15536 Product "$$RotateFront$$ResizeFront
15539 \begin_layout LyX-Code
15544 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
15547 \begin_layout LyX-Code
15548 $$ResizeBack$$RotateBack"
15551 \begin_layout LyX-Code
15552 UpdateFormat pdftex
15555 \begin_layout LyX-Code
15556 UpdateResult "$$AbsPath$$Basename.pdftex_t"
15559 \begin_layout LyX-Code
15560 Requirement "graphicx"
15563 \begin_layout LyX-Code
15564 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
15567 \begin_layout LyX-Code
15568 ReferencedFile latex "$$AbsPath$$Basename.pdf"
15571 \begin_layout LyX-Code
15575 \begin_layout LyX-Code
15579 \begin_layout LyX-Code
15580 Product "$$Contents(
15582 "$$AbsPath$$Basename.asc
15587 \begin_layout LyX-Code
15588 UpdateFormat asciixfig
15591 \begin_layout LyX-Code
15592 UpdateResult "$$AbsPath$$Basename.asc"
15595 \begin_layout LyX-Code
15599 \begin_layout LyX-Code
15603 \begin_layout LyX-Code
15604 Product "<graphic fileref=
15606 "$$AbsOrRelPathMaster$$Basename.eps
15611 \begin_layout LyX-Code
15615 \begin_layout LyX-Code
15619 \begin_layout LyX-Code
15620 UpdateResult "$$AbsPath$$Basename.eps"
15623 \begin_layout LyX-Code
15624 ReferencedFile docbook "$$AbsPath$$Basename.eps"
15627 \begin_layout LyX-Code
15628 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
15631 \begin_layout LyX-Code
15635 \begin_layout LyX-Code
15636 Product "[XFig: $$FName]"
15639 \begin_layout LyX-Code
15643 \begin_layout LyX-Code
15647 \begin_layout Standard
15648 As you can see, the template is enclosed in
15649 \begin_inset Flex CharStyle:Code
15652 \begin_layout Plain Layout
15658 \SpecialChar \ldots{}
15660 \begin_inset Flex CharStyle:Code
15663 \begin_layout Plain Layout
15670 It contains a header specifying some general settings and, for each supported
15671 primary document file format, a section
15672 \begin_inset Flex CharStyle:Code
15675 \begin_layout Plain Layout
15681 \SpecialChar \ldots{}
15683 \begin_inset Flex CharStyle:Code
15686 \begin_layout Plain Layout
15695 \begin_layout Subsection
15696 The template header
15699 \begin_layout Description
15700 \begin_inset Flex CharStyle:Code
15703 \begin_layout Plain Layout
15704 AutomaticProduction
15705 \begin_inset space ~
15713 Whether the file represented by the template must be generated by LyX.
15714 This command must occur exactly once.
15717 \begin_layout Description
15718 \begin_inset Flex CharStyle:Code
15721 \begin_layout Plain Layout
15723 \begin_inset space ~
15731 A glob pattern that is used in the file dialog to filter out the desired
15733 If there is more than one possible file extension (e.
15734 \begin_inset space \thinspace{}
15738 \begin_inset space \space{}
15742 \begin_inset Flex CharStyle:Code
15745 \begin_layout Plain Layout
15752 \begin_inset Flex CharStyle:Code
15755 \begin_layout Plain Layout
15761 ), use something like
15762 \begin_inset Flex CharStyle:Code
15765 \begin_layout Plain Layout
15772 This command must occur exactly once.
15775 \begin_layout Description
15776 \begin_inset Flex CharStyle:Code
15779 \begin_layout Plain Layout
15781 \begin_inset space ~
15789 The text that is displayed on the button.
15790 This command must occur exactly once.
15793 \begin_layout Description
15794 \begin_inset Flex CharStyle:Code
15797 \begin_layout Plain Layout
15799 \begin_inset space ~
15803 \begin_inset space ~
15811 The help text that is used in the External dialog.
15812 Provide enough information to explain to the user just what the template
15813 can provide him with.
15814 This command must occur exactly once.
15817 \begin_layout Description
15818 \begin_inset Flex CharStyle:Code
15821 \begin_layout Plain Layout
15823 \begin_inset space ~
15831 The file format of the original file.
15832 This must be the name of a format that is known to LyX (see section
15833 \begin_inset CommandInset ref
15835 reference "sec:Formats"
15841 \begin_inset Quotes eld
15845 \begin_inset Flex CharStyle:Code
15848 \begin_layout Plain Layout
15855 \begin_inset Quotes erd
15858 if the template can handle original files of more than one format.
15859 LyX will attempt to interrogate the file itself in order to deduce its
15860 format in this case.
15861 This command must occur exactly once.
15864 \begin_layout Description
15865 \begin_inset Flex CharStyle:Code
15868 \begin_layout Plain Layout
15870 \begin_inset space ~
15878 A unique name for the template.
15879 It must not contain substitution macros (see below).
15882 \begin_layout Description
15883 \begin_inset Flex CharStyle:Code
15886 \begin_layout Plain Layout
15888 \begin_inset space ~
15891 Rotate|Resize|Clip|Extra
15896 This command specifies which transformations are supported by this template.
15897 It may occur zero or more times.
15898 This command enables the corresponding tabs in the external dialog.
15900 \begin_inset Flex CharStyle:Code
15903 \begin_layout Plain Layout
15909 command must have either a corresponding
15910 \begin_inset Flex CharStyle:Code
15913 \begin_layout Plain Layout
15920 \begin_inset Flex CharStyle:Code
15923 \begin_layout Plain Layout
15930 \begin_inset Flex CharStyle:Code
15933 \begin_layout Plain Layout
15940 Otherwise the transformation will not be supported by that format.
15943 \begin_layout Subsection
15947 \begin_layout Description
15948 \begin_inset Flex CharStyle:Code
15951 \begin_layout Plain Layout
15953 \begin_inset space ~
15956 LaTeX|PDFLaTeX|PlainText|DocBook
15961 The primary document file format that this format definition is for.
15962 Not every template has a sensible representation in all document file formats.
15963 Please define nevertheless a
15964 \begin_inset Flex CharStyle:Code
15967 \begin_layout Plain Layout
15973 section for all formats.
15974 Use a dummy text when no representation is available.
15975 Then you can at least see a reference to the external material in the exported
15979 \begin_layout Description
15980 \begin_inset Flex CharStyle:Code
15983 \begin_layout Plain Layout
15985 \begin_inset space ~
15989 \begin_inset space ~
15997 This command defines an additional macro
15998 \begin_inset Flex CharStyle:Code
16001 \begin_layout Plain Layout
16007 for substitution in
16008 \begin_inset Flex CharStyle:Code
16011 \begin_layout Plain Layout
16019 \begin_inset Flex CharStyle:Code
16022 \begin_layout Plain Layout
16028 itself may contain substitution macros.
16029 The advantage over using
16030 \begin_inset Flex CharStyle:Code
16033 \begin_layout Plain Layout
16040 \begin_inset Flex CharStyle:Code
16043 \begin_layout Plain Layout
16049 is that the substituted value of
16050 \begin_inset Flex CharStyle:Code
16053 \begin_layout Plain Layout
16059 is sanitized so that it is a valid optional argument in the document format.
16060 This command may occur zero or more times.
16063 \begin_layout Description
16064 \begin_inset Flex CharStyle:Code
16067 \begin_layout Plain Layout
16069 \begin_inset space ~
16077 The text that is inserted in the exported document.
16078 This is actually the most important command and can be quite complex.
16079 This command must occur exactly once.
16082 \begin_layout Description
16083 \begin_inset Flex CharStyle:Code
16086 \begin_layout Plain Layout
16088 \begin_inset space ~
16096 This command specifies a preamble snippet that will be included in the
16098 It has to be defined using
16099 \begin_inset Flex CharStyle:Code
16102 \begin_layout Plain Layout
16108 \SpecialChar \ldots{}
16110 \begin_inset Flex CharStyle:Code
16113 \begin_layout Plain Layout
16120 This command may occur zero or more times.
16123 \begin_layout Description
16124 \begin_inset Flex CharStyle:Code
16127 \begin_layout Plain Layout
16129 \begin_inset space ~
16133 \begin_inset space ~
16141 This command denotes files that are created by the conversion process and
16142 are needed for a particular export format.
16143 If the filename is relative, it is interpreted relative to the master document.
16144 This command may be given zero or more times.
16147 \begin_layout Description
16148 \begin_inset Flex CharStyle:Code
16151 \begin_layout Plain Layout
16153 \begin_inset space ~
16161 The name of a required LaTeX package.
16162 The package is included via
16163 \begin_inset Flex CharStyle:Code
16166 \begin_layout Plain Layout
16174 in the LaTeX preamble.
16175 This command may occur zero or more times.
16178 \begin_layout Description
16179 \begin_inset Flex CharStyle:Code
16182 \begin_layout Plain Layout
16184 \begin_inset space ~
16188 \begin_inset space ~
16191 RotationLatexCommand
16196 This command specifies that the built in LaTeX command should be used for
16198 This command may occur once or not at all.
16201 \begin_layout Description
16202 \begin_inset Flex CharStyle:Code
16205 \begin_layout Plain Layout
16207 \begin_inset space ~
16211 \begin_inset space ~
16219 This command specifies that the built in LaTeX command should be used for
16221 This command may occur once or not at all.
16224 \begin_layout Description
16225 \begin_inset Flex CharStyle:Code
16228 \begin_layout Plain Layout
16230 \begin_inset space ~
16234 \begin_inset space ~
16237 RotationLatexOption
16242 This command specifies that rotation is done via an optional argument.
16243 This command may occur once or not at all.
16246 \begin_layout Description
16247 \begin_inset Flex CharStyle:Code
16250 \begin_layout Plain Layout
16252 \begin_inset space ~
16256 \begin_inset space ~
16264 This command specifies that resizing is done via an optional argument.
16265 This command may occur once or not at all.
16268 \begin_layout Description
16269 \begin_inset Flex CharStyle:Code
16272 \begin_layout Plain Layout
16274 \begin_inset space ~
16278 \begin_inset space ~
16286 This command specifies that clipping is done via an optional argument.
16287 This command may occur once or not at all.
16290 \begin_layout Description
16291 \begin_inset Flex CharStyle:Code
16294 \begin_layout Plain Layout
16296 \begin_inset space ~
16300 \begin_inset space ~
16308 This command specifies that an extra optional argument is used.
16309 This command may occur once or not at all.
16312 \begin_layout Description
16313 \begin_inset Flex CharStyle:Code
16316 \begin_layout Plain Layout
16318 \begin_inset space ~
16326 The file format of the converted file.
16327 This must be the name of a format that is known to LyX (see the
16328 \begin_inset Flex CharStyle:MenuItem
16331 \begin_layout Plain Layout
16336 ools\SpecialChar \menuseparator
16341 references:Conversion
16347 This command must occur exactly once.
16350 \begin_layout Description
16351 \begin_inset Flex CharStyle:Code
16354 \begin_layout Plain Layout
16356 \begin_inset space ~
16364 The file name of the converted file.
16365 The file name must be absolute.
16366 This command must occur exactly once.
16369 \begin_layout Subsection
16370 Preamble definitions
16373 \begin_layout Standard
16374 The external template configuration file may contain additional preamble
16375 definitions enclosed by
16376 \begin_inset Flex CharStyle:Code
16379 \begin_layout Plain Layout
16385 \SpecialChar \ldots{}
16387 \begin_inset Flex CharStyle:Code
16390 \begin_layout Plain Layout
16397 They can be used by the templates in the
16398 \begin_inset Flex CharStyle:Code
16401 \begin_layout Plain Layout
16410 \begin_layout Section
16411 The substitution mechanism
16414 \begin_layout Standard
16415 When the external material facility invokes an external program, it is done
16416 on the basis of a command defined in the template configuration file.
16417 These commands can contain various macros that are expanded before execution.
16418 Execution always take place in the directory of the containing document.
16421 \begin_layout Standard
16422 Also, whenever external material is to be displayed, the name will be produced
16423 by the substitution mechanism, and most other commands in the template
16424 definition support substitution as well.
16427 \begin_layout Standard
16428 The available macros are the following:
16431 \begin_layout Description
16432 \begin_inset Flex CharStyle:Code
16435 \begin_layout Plain Layout
16436 $$AbsOrRelPathMaster
16441 The file path, absolute or relative to the master LyX document.
16444 \begin_layout Description
16445 \begin_inset Flex CharStyle:Code
16448 \begin_layout Plain Layout
16449 $$AbsOrRelPathParent
16454 The file path, absolute or relative to the LyX document.
16457 \begin_layout Description
16458 \begin_inset Flex CharStyle:Code
16461 \begin_layout Plain Layout
16467 The absolute file path.
16470 \begin_layout Description
16471 \begin_inset Flex CharStyle:Code
16474 \begin_layout Plain Layout
16480 The filename without path and without the extension.
16483 \begin_layout Description
16484 \begin_inset Flex CharStyle:Code
16487 \begin_layout Plain Layout
16489 \begin_inset Quotes eld
16493 \begin_inset Quotes erd
16501 This macro will expand to the contents of the file with the name
16502 \begin_inset Flex CharStyle:Code
16505 \begin_layout Plain Layout
16514 \begin_layout Description
16515 \begin_inset Flex CharStyle:Code
16518 \begin_layout Plain Layout
16524 The file extension (including the dot).
16527 \begin_layout Description
16528 \begin_inset Flex CharStyle:Code
16531 \begin_layout Plain Layout
16537 The filename of the file specified in the external material dialog.
16538 This is either an absolute name, or it is relative to the LyX document.
16541 \begin_layout Description
16542 \begin_inset Flex CharStyle:Code
16545 \begin_layout Plain Layout
16552 \begin_inset Flex CharStyle:Code
16555 \begin_layout Plain Layout
16561 (absolute name or relative to the LyX document).
16564 \begin_layout Description
16565 \begin_inset Flex CharStyle:Code
16568 \begin_layout Plain Layout
16574 The file path, relative to the master LyX document.
16577 \begin_layout Description
16578 \begin_inset Flex CharStyle:Code
16581 \begin_layout Plain Layout
16587 The file path, relative to the LyX document.
16590 \begin_layout Description
16591 \begin_inset Flex CharStyle:Code
16594 \begin_layout Plain Layout
16600 This macro will expand to the absolute path of the system directory.
16601 This is typically used to point to the various helper scripts that are
16605 \begin_layout Description
16606 \begin_inset Flex CharStyle:Code
16609 \begin_layout Plain Layout
16615 A name and full path to a temporary file which will be automatically deleted
16616 whenever the containing document is closed, or the external material insertion
16620 \begin_layout Standard
16621 All path macros contain a trailing directory separator, so you can construct
16623 \begin_inset space \thinspace{}
16627 \begin_inset space \space{}
16630 the absolute filename with
16631 \begin_inset Flex CharStyle:Code
16634 \begin_layout Plain Layout
16635 $$AbsPath$$Basename$$Extension
16643 \begin_layout Standard
16644 The macros above are substituted in all commands unless otherwise noted.
16646 \begin_inset Flex CharStyle:Code
16649 \begin_layout Plain Layout
16655 supports additionally the following substitutions if they are enabled by
16657 \begin_inset Flex CharStyle:Code
16660 \begin_layout Plain Layout
16667 \begin_inset Flex CharStyle:Code
16670 \begin_layout Plain Layout
16679 \begin_layout Description
16680 \begin_inset Flex CharStyle:Code
16683 \begin_layout Plain Layout
16689 The front part of the resize command.
16692 \begin_layout Description
16693 \begin_inset Flex CharStyle:Code
16696 \begin_layout Plain Layout
16702 The back part of the resize command.
16705 \begin_layout Description
16706 \begin_inset Flex CharStyle:Code
16709 \begin_layout Plain Layout
16715 The front part of the rotation command.
16718 \begin_layout Description
16719 \begin_inset Flex CharStyle:Code
16722 \begin_layout Plain Layout
16728 The back part of the rotation command.
16731 \begin_layout Standard
16732 The value string of the
16733 \begin_inset Flex CharStyle:Code
16736 \begin_layout Plain Layout
16742 command supports additionally the following substitutions if they are enabled
16744 \begin_inset Flex CharStyle:Code
16747 \begin_layout Plain Layout
16754 \begin_inset Flex CharStyle:Code
16757 \begin_layout Plain Layout
16766 \begin_layout Description
16767 \begin_inset Flex CharStyle:Code
16770 \begin_layout Plain Layout
16779 \begin_layout Description
16780 \begin_inset Flex CharStyle:Code
16783 \begin_layout Plain Layout
16792 \begin_layout Description
16793 \begin_inset Flex CharStyle:Code
16796 \begin_layout Plain Layout
16805 \begin_layout Description
16806 \begin_inset Flex CharStyle:Code
16809 \begin_layout Plain Layout
16815 The rotation option.
16818 \begin_layout Standard
16819 You may ask why there are so many path macros.
16820 There are mainly two reasons:
16823 \begin_layout Enumerate
16824 Relative and absolute file names should remain relative or absolute, respectivel
16826 Users may have reasons to prefer either form.
16827 Relative names are useful for portable documents that should work on different
16828 machines, for example.
16829 Absolute names may be required by some programs.
16832 \begin_layout Enumerate
16833 LaTeX treats relative file names differently than LyX and other programs
16834 in nested included files.
16835 For LyX, a relative file name is always relative to the document that contains
16837 For LaTeX, it is always relative to the master document.
16838 These two definitions are identical if you have only one document, but
16839 differ if you have a master document that includes part documents.
16840 That means that relative filenames must be transformed when presented to
16842 Fortunately LyX does this automatically for you if you choose the right
16846 \begin_layout Standard
16847 So which path macro should be used in new template definitions? The rule
16851 \begin_layout Itemize
16853 \begin_inset Flex CharStyle:Code
16856 \begin_layout Plain Layout
16862 if an absolute path is required.
16865 \begin_layout Itemize
16867 \begin_inset Flex CharStyle:Code
16870 \begin_layout Plain Layout
16871 $$AbsOrRelPathMaster
16876 if the substituted string is some kind of LaTeX input.
16879 \begin_layout Itemize
16881 \begin_inset Flex CharStyle:Code
16884 \begin_layout Plain Layout
16885 $$AbsOrRelPathParent
16890 in order to preserve the user's choice.
16893 \begin_layout Standard
16894 There are special cases where this rule does not work and e.
16895 \begin_inset space \thinspace{}
16899 \begin_inset space \space{}
16902 relative names are needed, but normally it will work just fine.
16903 One example for such a case is the command
16904 \begin_inset Flex CharStyle:Code
16907 \begin_layout Plain Layout
16908 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
16913 in the XFig template above: We can't use the absolute name because the
16915 \begin_inset Flex CharStyle:Code
16918 \begin_layout Plain Layout
16924 files needs the relative name in order to rewrite the file content.
16927 \begin_layout Section
16928 Security discussion
16929 \begin_inset CommandInset label
16931 name "sec:Security-discussion"
16938 \begin_layout Standard
16939 The external material feature interfaces with a lot of external programs
16940 and does so automatically, so we have to consider the security implications
16942 In particular, since you have the option of including your own filenames
16943 and/or parameter strings and those are expanded into a command, it seems
16944 that it would be possible to create a malicious document which executes
16945 arbitrary commands when a user views or prints the document.
16946 This is something we definitely want to avoid.
16949 \begin_layout Standard
16950 However, since the external program commands are specified in the template
16951 configuration file only, there are no security issues if LyX is properly
16952 configured with safe templates only.
16953 This is so because the external programs are invoked with the
16954 \begin_inset Flex CharStyle:Code
16957 \begin_layout Plain Layout
16963 -system call rather than the
16964 \begin_inset Flex CharStyle:Code
16967 \begin_layout Plain Layout
16973 system-call, so it's not possible to execute arbitrary commands from the
16974 filename or parameter section via the shell.
16977 \begin_layout Standard
16978 This also implies that you are restricted in what command strings you can
16979 use in the external material templates.
16980 In particular, pipes and redirection are not readily available.
16981 This has to be so if LyX should remain safe.
16982 If you want to use some of the shell features, you should write a safe
16983 script to do this in a controlled manner, and then invoke the script from
16984 the command string.
16988 \begin_layout Standard
16989 It is possible to design a template that interacts directly with the shell,
16990 but since this would allow a malicious user to execute arbitrary commands
16991 by writing clever filenames and/or parameters, we generally recommend that
16992 you only use safe scripts that work with the
16993 \begin_inset Flex CharStyle:Code
16996 \begin_layout Plain Layout
17002 system call in a controlled manner.
17003 Of course, for use in a controlled environment, it can be tempting to just
17004 fall back to use ordinary shell scripts.
17005 If you do so, be aware that you
17009 provide an easily exploitable security hole in your system.
17010 Of course it stands to reason that such unsafe templates will never be
17011 included in the standard LyX distribution, although we do encourage people
17012 to submit new templates in the open source tradition.
17013 But LyX as shipped from the official distribution channels will never have
17017 \begin_layout Standard
17018 Including external material provides a lot of power, and you have to be
17019 careful not to introduce security hazards with this power.
17020 A subtle error in a single line in an innocent looking script can open
17021 the door to huge security problems.
17022 So if you do not fully understand the issues, we recommend that you consult
17023 a knowledgeable security professional or the LyX development team if you
17024 have any questions about whether a given template is safe or not.
17025 And do this before you use it in an uncontrolled environment.