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
48 \maintain_unincluded_children false
51 InsetLayout CharStyle:MenuItem
60 \newcommand*{\menuitem}[1]{{\sffamily #1}}
69 \font_typewriter default
70 \font_default_family default
78 \default_output_format default
79 \bibtex_command default
80 \index_command default
84 \pdf_title "LyX Configuration Manual"
85 \pdf_author "LyX Team"
86 \pdf_subject "LyX-documentation Customization"
87 \pdf_keywords "LyX, documentation, customization"
89 \pdf_bookmarksnumbered true
90 \pdf_bookmarksopen true
91 \pdf_bookmarksopenlevel 1
96 \pdf_pdfusetitle false
97 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
106 \paperorientation portrait
119 \paragraph_separation indent
120 \paragraph_indentation default
121 \quotes_language english
124 \paperpagestyle headings
125 \tracking_changes false
126 \output_changes false
127 \html_use_mathml true
134 Customizing LyX: Features for the Advanced User
142 \begin_layout Plain Layout
144 If you have comments or error corrections, please send them to the LyX Documenta
146 \begin_inset CommandInset href
148 target "lyx-docs@lists.lyx.org"
155 \begin_inset Quotes eld
159 \begin_inset Quotes erd
162 in the subject header, and please cc the current maintainer of this file,
163 Richard Heck <rgheck@comcast.net>.
169 \begin_inset Newline newline
173 \begin_inset Newline newline
179 \begin_layout Standard
180 \begin_inset CommandInset toc
181 LatexCommand tableofcontents
188 \begin_layout Standard
189 \begin_inset Note Note
192 \begin_layout Plain Layout
193 Please use change tracking when modifying this document.
194 This makes it easier for our translators to recognize things that have
195 been changed, and it helps the maintainer keep up-to-date with what's been
204 \begin_layout Chapter
208 \begin_layout Standard
209 This manual covers the customization features present in LyX.
210 In it, we discuss issues like keyboard shortcuts, screen previewing options,
211 printer options, sending commands to LyX via the LyX Server, internationalizati
212 on, installing new LaTeX classes and LyX layouts, etc.
213 We can't possibly hope to touch on everything you can change—our developers
214 add new features faster than we can document them—but we will explain the
215 most common customizations and hopefully point you in the right direction
216 for some of the more obscure ones.
219 \begin_layout Standard
220 \begin_inset Branch OutDated
223 \begin_layout Standard
224 Information from previous versions of this document that now seems to be
225 outdated is contained in the OutDated branch of this document.
226 By default, this information will not appear in the LaTeX output.
234 \begin_layout Chapter
235 LyX configuration files
238 \begin_layout Standard
239 This chapter aims to help you to find your way through the LyX configuration
241 Before continuing to read this chapter, you should find out where your
242 LyX library and user directories are by using
243 \begin_inset Flex CharStyle:MenuItem
246 \begin_layout Plain Layout
247 Help\SpecialChar \menuseparator
258 The library directory is the place where LyX places its system-wide configurati
259 on files; the user directory is where you can place your modified versions.
260 We will call the former
261 \begin_inset Flex CharStyle:Code
264 \begin_layout Plain Layout
271 \begin_inset Flex CharStyle:MenuItem
274 \begin_layout Plain Layout
280 in the remainder of this document.
284 \begin_layout Section
286 \begin_inset Flex CharStyle:Code
289 \begin_layout Plain Layout
298 \begin_layout Standard
299 \begin_inset Flex CharStyle:Code
302 \begin_layout Plain Layout
308 and its sub-directories contain a number of files and that can be used
309 to customize LyX's behavior.
310 You can change many of these files from within LyX itself through the
311 \begin_inset Flex CharStyle:MenuItem
314 \begin_layout Plain Layout
315 Tools\SpecialChar \menuseparator
322 Most customization that you will want to do in LyX is possible through
324 However, many other inner aspects of LyX can be customized by modifying
326 \begin_inset Flex CharStyle:Code
329 \begin_layout Plain Layout
336 These files fall in different categories, described in the following subsection
340 \begin_layout Subsection
341 Automatically generated files
344 \begin_layout Standard
345 The files, which are to be found in
346 \begin_inset Flex CharStyle:MenuItem
349 \begin_layout Plain Layout
355 , are generated when you configure LyX.
356 They contain various default values that are guessed by inspection.
357 In general, it is not a good idea to modify them, since they might be overwritt
361 \begin_layout Labeling
362 \labelwidthstring 00.00.0000
363 \begin_inset Flex CharStyle:Code
366 \begin_layout Plain Layout
372 contains defaults for various commands.
375 \begin_layout Labeling
376 \labelwidthstring 00.00.0000
377 \begin_inset Flex CharStyle:Code
380 \begin_layout Plain Layout
386 contains the list of packages that have been recognized by LyX.
387 It is currently unused by the LyX program itself, but the information extracted
388 , and more, is made available with
389 \begin_inset Flex CharStyle:MenuItem
392 \begin_layout Plain Layout
393 Help\SpecialChar \menuseparator
406 \begin_layout Labeling
407 \labelwidthstring 00.00.0000
408 \begin_inset Flex CharStyle:Code
411 \begin_layout Plain Layout
417 the list of text classes that have been found in your
418 \begin_inset Flex CharStyle:Code
421 \begin_layout Plain Layout
427 directories, along with the associated LaTeX document class and their descripti
431 \begin_layout Labeling
432 \labelwidthstring 00.00.0000
433 \begin_inset Flex CharStyle:Code
436 \begin_layout Plain Layout
442 the list of layout modules found in your
443 \begin_inset Flex CharStyle:Code
446 \begin_layout Plain Layout
455 \begin_layout Labeling
456 \labelwidthstring 00.00.0000
457 \begin_inset Flex CharStyle:Code
460 \begin_layout Plain Layout
466 lists of various sorts of LaTeX-related files found on your system
469 \begin_layout Labeling
470 \labelwidthstring 00.00.0000
471 \begin_inset Flex CharStyle:Code
474 \begin_layout Plain Layout
480 is automatically generated during configuration from the file
481 \begin_inset Flex CharStyle:Code
484 \begin_layout Plain Layout
491 It contains information on your LaTeX configuration.
494 \begin_layout Subsection
498 \begin_layout Standard
499 These directories are duplicated between
500 \begin_inset Flex CharStyle:Code
503 \begin_layout Plain Layout
510 \begin_inset Flex CharStyle:Code
513 \begin_layout Plain Layout
520 If a particular files exists in both places, the one in
521 \begin_inset Flex CharStyle:Code
524 \begin_layout Plain Layout
533 \begin_layout Labeling
534 \labelwidthstring 00.00.0000
535 \begin_inset Flex CharStyle:Code
538 \begin_layout Plain Layout
544 this directory contains files with the extension
545 \begin_inset Flex CharStyle:Code
548 \begin_layout Plain Layout
554 that define the keybindings used in LyX.
555 If there exists an internationalized version of the bind file named
556 \begin_inset Flex CharStyle:Code
559 \begin_layout Plain Layout
565 , that will be used first.
568 \begin_layout Labeling
569 \labelwidthstring 00.00.0000
570 \begin_inset Flex CharStyle:Code
573 \begin_layout Plain Layout
579 contains graphics files that can be included in documents.
583 \begin_layout Labeling
584 \labelwidthstring 00.00.0000
585 \begin_inset Flex CharStyle:Code
588 \begin_layout Plain Layout
594 contains LyX documentation files (including the one you are currently reading).
596 \begin_inset Flex CharStyle:Code
599 \begin_layout Plain Layout
605 deserves special attention, as noted above.
606 The internationalized help docs are in subdirectories
607 \begin_inset Flex CharStyle:Code
610 \begin_layout Plain Layout
617 \begin_inset Quotes eld
621 \begin_inset Quotes erd
624 is the ISO language code.
630 \begin_inset CommandInset ref
632 reference "cha:Internationalizing-LyX"
639 \begin_layout Labeling
640 \labelwidthstring 00.00.0000
641 \begin_inset Flex CharStyle:Code
644 \begin_layout Plain Layout
650 contains example files that explain how to use some features.
651 In the file browser, press the
652 \begin_inset Flex CharStyle:MenuItem
655 \begin_layout Plain Layout
664 \begin_layout Labeling
665 \labelwidthstring 00.00.0000
666 \begin_inset Flex CharStyle:Code
669 \begin_layout Plain Layout
675 contains image files that are used by the
676 \begin_inset Flex CharStyle:MenuItem
679 \begin_layout Plain Layout
686 In addition, it also contains the individual icons used in the toolbar
687 and the banners that can be shown when LyX is launched.
690 \begin_layout Labeling
691 \labelwidthstring 00.00.0000
692 \begin_inset Flex CharStyle:Code
695 \begin_layout Plain Layout
701 contains keyboard keymapping files.
707 \begin_inset CommandInset ref
709 reference "sec:International-Keymap-Stuff"
716 \begin_layout Labeling
717 \labelwidthstring 00.00.0000
718 \begin_inset Flex CharStyle:Code
721 \begin_layout Plain Layout
727 contains the text class and module files described in Chapter
732 \begin_inset CommandInset ref
734 reference "cha:Installing-New-Document"
741 \begin_layout Labeling
742 \labelwidthstring 00.00.0000
743 \begin_inset Flex CharStyle:Code
746 \begin_layout Plain Layout
753 \begin_inset Flex CharStyle:Code
756 \begin_layout Plain Layout
762 Python scripts used to convert between LyX versions.
763 These can be run from the command line if, say, you want to batch-convert
767 \begin_layout Labeling
768 \labelwidthstring 00.00.0000
769 \begin_inset Flex CharStyle:Code
772 \begin_layout Plain Layout
778 contains some files that demonstrate the capabilities of the
779 \begin_inset Flex CharStyle:MenuItem
782 \begin_layout Plain Layout
793 Also contains some scripts used by LyX itself.
796 \begin_layout Labeling
797 \labelwidthstring 00.00.0000
798 \begin_inset Flex CharStyle:Code
801 \begin_layout Plain Layout
807 contains the standard LyX template files described in Chapter
812 \begin_inset CommandInset ref
814 reference "sub:Creating-Templates"
821 \begin_layout Labeling
822 \labelwidthstring 00.00.0000
823 \begin_inset Flex CharStyle:Code
826 \begin_layout Plain Layout
832 contains files with the extension
833 \begin_inset Flex CharStyle:Code
836 \begin_layout Plain Layout
842 that define the user interface to LyX.
843 That is, the files define which items appear in which menus and the items
844 appearing on the toolbar.
847 \begin_layout Subsection
848 Files you don't want to modify
851 \begin_layout Standard
852 These files are used internally by LyX and you generally do not need to
853 modify them unless you are a developer.
856 \begin_layout Labeling
857 \labelwidthstring 00.00.0000
858 \begin_inset Flex CharStyle:Code
861 \begin_layout Plain Layout
867 this file contains the list of LyX developers.
868 The contents are displayed with the menu entry
869 \begin_inset Flex CharStyle:MenuItem
872 \begin_layout Plain Layout
873 Help\SpecialChar \menuseparator
886 \begin_layout Labeling
887 \labelwidthstring 00.00.0000
888 \begin_inset Flex CharStyle:Code
891 \begin_layout Plain Layout
897 this is a LaTeX script used during the configuration process.
901 \begin_layout Labeling
902 \labelwidthstring 00.00.0000
903 \begin_inset Flex CharStyle:Code
906 \begin_layout Plain Layout
912 this is the script that is used to re-configure LyX.
913 It creates configuration files in the directory it was run from.
916 \begin_layout Subsection
917 Other files needing a line or two...
920 \begin_layout Labeling
921 \labelwidthstring 00.00.0000
922 \begin_inset Flex CharStyle:Code
925 \begin_layout Plain Layout
931 this contains tables describing how different character encodings can be
935 \begin_layout Labeling
936 \labelwidthstring 00.00.0000
937 \begin_inset Flex CharStyle:Code
940 \begin_layout Plain Layout
946 this file contains the templates available to the new
947 \begin_inset Flex CharStyle:MenuItem
950 \begin_layout Plain Layout
963 \begin_layout Labeling
964 \labelwidthstring 00.00.0000
965 \begin_inset Flex CharStyle:Code
968 \begin_layout Plain Layout
974 this file contains a list of all the languages currently supported by LyX.
977 \begin_layout Section
978 Your local configuration directory
981 \begin_layout Standard
982 Even if you are using LyX as an unprivileged user, you might want to change
983 LyX configuration for your own use.
985 \begin_inset Flex CharStyle:Code
988 \begin_layout Plain Layout
994 directory contains all your personal configuration files.
995 This is the directory described as
996 \begin_inset Quotes eld
1000 \begin_inset Quotes erd
1004 \begin_inset Flex CharStyle:MenuItem
1007 \begin_layout Plain Layout
1008 Help\SpecialChar \menuseparator
1010 \begin_inset space ~
1019 This directory is used as a mirror of
1020 \begin_inset Flex CharStyle:Code
1023 \begin_layout Plain Layout
1029 , which means that every file in
1030 \begin_inset Flex CharStyle:Code
1033 \begin_layout Plain Layout
1039 is a replacement for the corresponding file in
1040 \begin_inset Flex CharStyle:Code
1043 \begin_layout Plain Layout
1050 Any configuration file described in the above sections can be placed either
1051 in the system-wide directory, in which case it will affect all users, or
1052 in your local directory for your own use.
1055 \begin_layout Standard
1056 To make things clearer, let's provide a few examples:
1059 \begin_layout Itemize
1060 The preferences set in the
1061 \begin_inset Flex CharStyle:MenuItem
1064 \begin_layout Plain Layout
1065 Tools\SpecialChar \menuseparator
1071 dialog are saved to a file
1072 \begin_inset Flex CharStyle:Code
1075 \begin_layout Plain Layout
1082 \begin_inset Flex CharStyle:Code
1085 \begin_layout Plain Layout
1094 \begin_layout Itemize
1095 When you reconfigure using
1096 \begin_inset Flex CharStyle:MenuItem
1099 \begin_layout Plain Layout
1100 Tools\SpecialChar \menuseparator
1107 \begin_inset Flex CharStyle:Code
1110 \begin_layout Plain Layout
1116 script, and the resulting files are written in your local configuration
1118 This means that any additional text class file that you might have added
1120 \begin_inset Flex CharStyle:Code
1123 \begin_layout Plain Layout
1129 will be added to the list of classes in the
1130 \begin_inset Flex CharStyle:MenuItem
1133 \begin_layout Plain Layout
1134 Document\SpecialChar \menuseparator
1143 \begin_layout Itemize
1144 If you get some updated documentation from LyX ftp site and cannot install
1145 it because you do not have sysadmin rights on your system, you can just
1147 \begin_inset Flex CharStyle:Code
1150 \begin_layout Plain Layout
1156 and the items in the
1157 \begin_inset Flex CharStyle:MenuItem
1160 \begin_layout Plain Layout
1166 menu will open them!
1169 \begin_layout Section
1170 Running LyX with multiple configurations
1173 \begin_layout Standard
1174 The configuration freedom of the local configuration directory may not suffice
1175 if you want to have more than one configuration at your disposal.
1176 For example, you may want to be use different key bindings or printer settings
1178 You can achieve this by having several such directories.
1179 You then specify which directory to use at run-time.
1182 \begin_layout Standard
1183 Invoking LyX with the command line switch
1184 \begin_inset Flex CharStyle:Code
1187 \begin_layout Plain Layout
1197 instructs the program to read the configuration from that directory, and
1198 not from the default directory.
1199 (You can determine the default directory by running LyX without the
1200 \begin_inset Flex CharStyle:Code
1203 \begin_layout Plain Layout
1209 switch.) If the specified directory does not exist, LyX offers to create
1210 it for you, just like it does for the default directory on the first time
1211 you run the program.
1212 You can modify the configuration options in this additional user directory
1213 exactly as you would for the default directory.
1214 These directories are completely independent (but read on).
1215 Note that setting the environment variable
1216 \begin_inset Flex CharStyle:Code
1219 \begin_layout Plain Layout
1225 to some value has exactly the same effect.
1228 \begin_layout Standard
1229 Having several configurations also requires more maintenance: if you want
1230 to add a new layout to
1231 \begin_inset Flex CharStyle:Code
1234 \begin_layout Plain Layout
1240 which you want available from all your configurations, you must add it
1241 to each directory separately.
1242 You can avoid this with the following trick: after LyX creates the additional
1243 directory, most of the subdirectories (see above) are empty.
1244 If you want the new configuration to mirror an existing one, replace the
1245 empty subdirectory with a symbolic link to the matching subdirectory in
1246 the existing configuration.
1248 \begin_inset Flex CharStyle:Code
1251 \begin_layout Plain Layout
1257 subdirectory, however, since it contains a file written by the configuration
1258 script (also accessible through
1259 \begin_inset Flex CharStyle:MenuItem
1262 \begin_layout Plain Layout
1263 Tools\SpecialChar \menuseparator
1269 ) which is configuration-specific.
1272 \begin_layout Chapter
1273 The Preferences dialog
1276 \begin_layout Standard
1277 All options of the preferences dialog are described in the Appendix
1279 The Preferences Dialog
1286 For some options you might find here more details.
1289 \begin_layout Section
1291 \begin_inset CommandInset label
1300 \begin_layout Standard
1301 The first step is to define your file formats if they are not already defined.
1303 \begin_inset Flex CharStyle:MenuItem
1306 \begin_layout Plain Layout
1307 Tools\SpecialChar \menuseparator
1315 \begin_inset Flex CharStyle:MenuItem
1318 \begin_layout Plain Layout
1319 File Handling\SpecialChar \menuseparator
1326 \begin_inset Flex CharStyle:MenuItem
1329 \begin_layout Plain Layout
1330 New\SpecialChar \ldots{}
1336 button to define your new format.
1338 \begin_inset Flex CharStyle:MenuItem
1341 \begin_layout Plain Layout
1347 field contains the name used to identify the format in the GUI.
1349 \begin_inset Flex CharStyle:MenuItem
1352 \begin_layout Plain Layout
1358 is used to identify the format internally.
1359 You will also need to enter a file extension.
1360 These are all required.
1362 \begin_inset Flex CharStyle:MenuItem
1365 \begin_layout Plain Layout
1371 field is used to provide a keyboard shortcut on the menus.
1372 (For example, pressing
1373 \begin_inset Flex CharStyle:MenuItem
1376 \begin_layout Plain Layout
1383 \begin_inset Flex CharStyle:MenuItem
1386 \begin_layout Plain Layout
1387 View\SpecialChar \menuseparator
1396 \begin_layout Standard
1398 \begin_inset Flex CharStyle:MenuItem
1401 \begin_layout Plain Layout
1408 \begin_inset Flex CharStyle:MenuItem
1411 \begin_layout Plain Layout
1418 For example, you might want to use
1419 \begin_inset Flex CharStyle:MenuItem
1422 \begin_layout Plain Layout
1428 to view PostScript files.
1429 You can enter the command needed to start the program in the corresponding
1431 In defining this command, you can use the four variables listed in the
1433 The viewer is launched when you view an image in LyX or use the
1434 \begin_inset Flex CharStyle:MenuItem
1437 \begin_layout Plain Layout
1444 The editor is for example launched when you right-click on an image and
1446 \begin_inset Flex CharStyle:MenuItem
1449 \begin_layout Plain Layout
1455 in the appearing context menu.
1458 \begin_layout Standard
1460 \begin_inset Flex CharStyle:MenuItem
1463 \begin_layout Plain Layout
1469 option tells LyX that a format is suitable for document export.
1470 If this is set and if a suitable conversion route exists (see sec.
1471 \begin_inset space \thinspace{}
1475 \begin_inset CommandInset ref
1477 reference "sec:Converters"
1481 ), the format will appear in the
1482 \begin_inset Flex CharStyle:MenuItem
1485 \begin_layout Plain Layout
1486 File\SpecialChar \menuseparator
1493 The format will also appear in the
1494 \begin_inset Flex CharStyle:MenuItem
1497 \begin_layout Plain Layout
1503 menu if a viewer is specified for the format.
1504 Pure image formats, such as
1505 \begin_inset Flex CharStyle:Code
1508 \begin_layout Plain Layout
1514 , should not use this option.
1515 Formats that can both represent vector graphics and documents like
1516 \begin_inset Flex CharStyle:Code
1519 \begin_layout Plain Layout
1528 \begin_layout Standard
1530 \begin_inset Flex CharStyle:MenuItem
1533 \begin_layout Plain Layout
1534 Vector graphics format
1539 tells LyX that a format can contain vector graphics.
1540 This information is used to determine the target format of included graphics
1542 \begin_inset Flex CharStyle:MenuItem
1545 \begin_layout Plain Layout
1552 Included graphics may need to be converted to either
1553 \begin_inset Flex CharStyle:MenuItem
1556 \begin_layout Plain Layout
1563 \begin_inset Flex CharStyle:MenuItem
1566 \begin_layout Plain Layout
1573 \begin_inset Flex CharStyle:MenuItem
1576 \begin_layout Plain Layout
1583 \begin_inset Flex CharStyle:MenuItem
1586 \begin_layout Plain Layout
1592 cannot handle other image formats.
1593 If an included graphic is not already in
1594 \begin_inset Flex CharStyle:MenuItem
1597 \begin_layout Plain Layout
1604 \begin_inset Flex CharStyle:MenuItem
1607 \begin_layout Plain Layout
1614 \begin_inset Flex CharStyle:MenuItem
1617 \begin_layout Plain Layout
1623 format, it is converted to
1624 \begin_inset Flex CharStyle:MenuItem
1627 \begin_layout Plain Layout
1633 if the vector format option is set, and otherwise to
1634 \begin_inset Flex CharStyle:MenuItem
1637 \begin_layout Plain Layout
1646 \begin_layout Section
1650 \begin_layout Standard
1651 Since all conversions from one format to another take place in LyX's temporary
1652 directory, it is sometimes necessary to modify a file before copying it
1653 to the temporary directory in order that the conversion may be performed.
1657 \begin_layout Plain Layout
1658 For example, the file may refer to other files—images, for example—using
1659 relative file names, and these may become invalid when the file is copied
1660 to the temporary directory.
1665 This is done by a Copier: It copies a file to (or from) the temporary directory
1666 and may modify it in the process.
1669 \begin_layout Standard
1670 The definitions of the copiers may use four variables:
1673 \begin_layout Labeling
1674 \labelwidthstring 00.00.0000
1675 \begin_inset Flex CharStyle:Code
1678 \begin_layout Plain Layout
1684 The LyX system directory (e.
1685 \begin_inset space \thinspace{}
1689 \begin_inset space \space{}
1693 \begin_inset Flex CharStyle:MenuItem
1696 \begin_layout Plain Layout
1705 \begin_layout Labeling
1706 \labelwidthstring 00.00.0000
1707 \begin_inset Flex CharStyle:Code
1710 \begin_layout Plain Layout
1719 \begin_layout Labeling
1720 \labelwidthstring 00.00.0000
1721 \begin_inset Flex CharStyle:Code
1724 \begin_layout Plain Layout
1733 \begin_layout Labeling
1734 \labelwidthstring 00.00.0000
1735 \begin_inset Flex CharStyle:Code
1738 \begin_layout Plain Layout
1747 \begin_layout Standard
1748 The latter should be the filename as it would be used in a LaTeX's
1755 It is relevant only when exporting files suitable for such inclusion.
1758 \begin_layout Standard
1759 Copiers can be used to do almost anything with output files.
1760 For example, suppose you want generated pdf files to be copied to a special
1762 \begin_inset Flex CharStyle:Code
1765 \begin_layout Plain Layout
1772 Then you could write a shell script such as this one:
1775 \begin_layout Standard
1776 \begin_inset listings
1780 \begin_layout Plain Layout
1785 \begin_layout Plain Layout
1790 \begin_layout Plain Layout
1792 TOFILE=`basename $2`
1795 \begin_layout Plain Layout
1797 cp $FROMFILE /home/you/pdf/$TOFILE
1802 Save it in your local LyX directory—say,
1803 \begin_inset Flex CharStyle:Code
1806 \begin_layout Plain Layout
1807 /home/you/.lyx/scripts/pdfcopier.sh
1812 —and make it executable, if you need to do so on your platform.
1814 \begin_inset Flex CharStyle:MenuItem
1817 \begin_layout Plain Layout
1818 Tools\SpecialChar \menuseparator
1824 dialog, select under
1825 \begin_inset Flex CharStyle:MenuItem
1828 \begin_layout Plain Layout
1829 File Handling\SpecialChar \menuseparator
1836 \begin_inset Flex CharStyle:MenuItem
1839 \begin_layout Plain Layout
1845 format—or one of the other pdf formats—and enter
1846 \begin_inset Flex CharStyle:Code
1849 \begin_layout Plain Layout
1850 pdfcopier.sh $$i $$o
1856 \begin_inset Flex CharStyle:MenuItem
1859 \begin_layout Plain Layout
1869 \begin_layout Standard
1870 Copiers are used by LyX in various of its own conversions.
1871 For example, if appropriate programs are found, LyX will automatically
1872 install copiers for the
1873 \begin_inset Flex CharStyle:MenuItem
1876 \begin_layout Plain Layout
1883 \begin_inset Flex CharStyle:MenuItem
1886 \begin_layout Plain Layout
1888 \begin_inset space ~
1897 When these formats are exported, the copier sees that not just the main
1898 HTML file but various associated files (style files, images, etc.) are also
1900 All these files are written to a subdirectory of the directory in which
1901 the original LyX file was found.
1905 \begin_layout Plain Layout
1906 This copier can be customized.
1908 \begin_inset Quotes eld
1912 \begin_inset Quotes erd
1915 argument takes a comma-separated list of extensions to be copied; if it
1916 is omitted, all files will be copied.
1918 \begin_inset Quotes eld
1922 \begin_inset Quotes erd
1925 argument determines the extension added to the generated directory.
1927 \begin_inset Quotes eld
1931 \begin_inset Flex CharStyle:MenuItem
1934 \begin_layout Plain Layout
1941 \begin_inset Quotes erd
1944 , so HTML generated from
1945 \begin_inset Flex CharStyle:MenuItem
1948 \begin_layout Plain Layout
1949 /path/to/filename.lyx
1955 \begin_inset Flex CharStyle:MenuItem
1958 \begin_layout Plain Layout
1959 /path/to/filename.html.LyXconv
1973 \begin_layout Section
1975 \begin_inset CommandInset label
1977 name "sec:Converters"
1984 \begin_layout Standard
1985 You can define your own Converters to convert files between different formats.
1987 \begin_inset Flex CharStyle:MenuItem
1990 \begin_layout Plain Layout
1991 Tools\SpecialChar \menuseparator
1992 Preferences\SpecialChar \menuseparator
1993 File Handling\SpecialChar \menuseparator
2002 \begin_layout Standard
2003 To define a new converter, select the
2004 \begin_inset Flex CharStyle:MenuItem
2007 \begin_layout Plain Layout
2009 \begin_inset space ~
2018 \begin_inset Flex CharStyle:MenuItem
2021 \begin_layout Plain Layout
2023 \begin_inset space ~
2031 from the drop-down lists, enter the command needed for the conversion,
2033 \begin_inset Flex CharStyle:MenuItem
2036 \begin_layout Plain Layout
2043 Several variables can be used in the definition of converters:
2046 \begin_layout Labeling
2047 \labelwidthstring 00.00.0000
2048 \begin_inset Flex CharStyle:Code
2051 \begin_layout Plain Layout
2057 The LyX system directory
2060 \begin_layout Labeling
2061 \labelwidthstring 00.00.0000
2062 \begin_inset Flex CharStyle:Code
2065 \begin_layout Plain Layout
2074 \begin_layout Labeling
2075 \labelwidthstring 00.00.0000
2076 \begin_inset Flex CharStyle:Code
2079 \begin_layout Plain Layout
2088 \begin_layout Labeling
2089 \labelwidthstring 00.00.0000
2090 \begin_inset Flex CharStyle:Code
2093 \begin_layout Plain Layout
2099 The base filename of the input file (i.
2100 \begin_inset space \thinspace{}
2103 g., without the extension)
2106 \begin_layout Labeling
2107 \labelwidthstring 00.00.0000
2108 \begin_inset Flex CharStyle:Code
2111 \begin_layout Plain Layout
2117 The path to the input file
2120 \begin_layout Labeling
2121 \labelwidthstring 00.00.0000
2122 \begin_inset Flex CharStyle:Code
2125 \begin_layout Plain Layout
2131 The path to the original input file (this is different from $$p when a
2132 chain of converters is called).
2135 \begin_layout Standard
2137 \begin_inset Flex CharStyle:MenuItem
2140 \begin_layout Plain Layout
2142 \begin_inset space ~
2150 field you can enter the following flags, separated by commas:
2153 \begin_layout Labeling
2154 \labelwidthstring 00.00.0000
2155 \begin_inset Flex CharStyle:Code
2158 \begin_layout Plain Layout
2164 This converter runs some form of LaTeX.
2165 This will make LyX's LaTeX error logs available.
2168 \begin_layout Labeling
2169 \labelwidthstring 00.00.0000
2170 \begin_inset Flex CharStyle:Code
2173 \begin_layout Plain Layout
2180 \begin_inset Flex CharStyle:MenuItem
2183 \begin_layout Plain Layout
2189 file for the conversion.
2192 \begin_layout Labeling
2193 \labelwidthstring 00.00.0000
2194 \begin_inset Flex CharStyle:Code
2197 \begin_layout Plain Layout
2206 \begin_layout Standard
2207 The following three flags are not really flags at all because they take
2209 \begin_inset Flex CharStyle:MenuItem
2212 \begin_layout Plain Layout
2214 \begin_inset space ~
2218 \begin_inset space ~
2229 \begin_layout Labeling
2230 \labelwidthstring 00.00.0000
2231 \begin_inset Flex CharStyle:Code
2234 \begin_layout Plain Layout
2240 If set, the converter's standard error will be redirected to a file
2241 \begin_inset Flex CharStyle:Code
2244 \begin_layout Plain Layout
2250 , and the script given as argument will be run as:
2251 \begin_inset Flex CharStyle:Code
2254 \begin_layout Plain Layout
2255 script < infile.out > infile.log
2261 The argument may contain
2262 \begin_inset Flex CharStyle:Code
2265 \begin_layout Plain Layout
2274 \begin_layout Labeling
2275 \labelwidthstring 00.00.0000
2276 \begin_inset Flex CharStyle:Code
2279 \begin_layout Plain Layout
2285 The name of the directory in which the converter will dump the generated
2287 LyX will not create this directory, and it does not copy anything into
2288 it, though it will copy this directory to the destination.
2289 The argument may contain
2290 \begin_inset Flex CharStyle:Code
2293 \begin_layout Plain Layout
2299 , which will be replaced by the base name of the input and output files,
2300 respectively, when the directory is copied.
2301 \begin_inset Newline newline
2304 Note that resultdir and usetempdir make no sense together.
2305 The latter will be ignored if the former is given.
2308 \begin_layout Labeling
2309 \labelwidthstring 00.00.0000
2310 \begin_inset Flex CharStyle:Code
2313 \begin_layout Plain Layout
2319 Determines the output file name and may, contain
2320 \begin_inset Flex CharStyle:Code
2323 \begin_layout Plain Layout
2330 Sensible only with resultdir and optional even then; if not given, it defaults
2334 \begin_layout Standard
2335 None of these last three are presently used in any of the converters that
2336 are installed with LyX.
2340 \begin_layout Standard
2341 You do not have to define converters for all formats between which you want
2343 For example, you will note that there is no `LyX to PostScript' converter,
2344 but LyX will export PostScript.
2345 It does so by first creating a LaTeX file (no converter needs to be defined
2346 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2347 and finally converting the resulting DVI file to PostScript.
2348 LyX finds such `chains' of converters automatically, and it will always
2349 choose the shortest possible chain.
2350 You can, though, still define multiple conversion methods between file
2352 For example, the standard LyX configuration provides three ways to convert
2353 LaTeX to PDF: Directly, using
2354 \begin_inset Flex CharStyle:MenuItem
2357 \begin_layout Plain Layout
2363 ; via (DVI and) PostScript, using
2364 \begin_inset Flex CharStyle:MenuItem
2367 \begin_layout Plain Layout
2374 \begin_inset Flex CharStyle:MenuItem
2377 \begin_layout Plain Layout
2384 To define such alternate chains, you must define multiple target `file
2385 formats', as described in section
2386 \begin_inset CommandInset ref
2388 reference "sec:Formats"
2393 For example, in the standard configuration, the formats named
2394 \begin_inset Flex CharStyle:MenuItem
2397 \begin_layout Plain Layout
2404 \begin_inset Flex CharStyle:MenuItem
2407 \begin_layout Plain Layout
2414 \begin_inset Flex CharStyle:MenuItem
2417 \begin_layout Plain Layout
2423 are defined, all of which share the extension
2424 \begin_inset Flex CharStyle:MenuItem
2427 \begin_layout Plain Layout
2433 , and which correspond to the conversion methods just mentioned.
2436 \begin_layout Chapter
2437 Internationalizing LyX
2438 \begin_inset CommandInset label
2440 name "cha:Internationalizing-LyX"
2447 \begin_layout Standard
2448 LyX supports using a translated interface.
2449 Last time we checked, LyX provided text in thirty languages.
2450 The language of choice is called your
2455 (For further reading on locale settings, see also the documentation for
2456 locale that comes with your operating system.
2457 For Linux, the manual page for
2458 \begin_inset Flex CharStyle:Code
2461 \begin_layout Plain Layout
2467 could be a good place to start).
2470 \begin_layout Standard
2471 Notice that these translations will work, but do contain a few flaws.
2472 In particular, all dialogs have been designed with the English text in
2473 mind, which means that some of the translated text will be too large to
2474 fit within the space allocated.
2475 This is only a display problem and will not cause any harm.
2476 Also, you will find that some of the translations do not define shortcut
2477 keys for everything.
2478 Sometimes, there are simply not enough free letters to do it.
2479 Other times, the translator just hasn't got around to doing it yet.
2480 Our localization team, which you may wish to join,
2484 \begin_layout Plain Layout
2485 If you are a fluent speaker of a language other than English, joining these
2486 teams is a great way to give back to the LyX community!
2491 will of course try to fix these shortcomings in future versions of LyX.
2494 \begin_layout Section
2498 \begin_layout Subsection
2499 Translating the graphical user interface (text messages).
2502 \begin_layout Standard
2504 \begin_inset Flex CharStyle:Code
2507 \begin_layout Plain Layout
2513 library to handle the internationalization of the interface.
2514 To have LyX speak your favorite language in all menus and dialogs, you
2516 \begin_inset Flex CharStyle:Code
2519 \begin_layout Plain Layout
2525 -file for that language.
2526 When this is available, you'll have to generate a
2527 \begin_inset Flex CharStyle:Code
2530 \begin_layout Plain Layout
2536 -file from it and install the
2537 \begin_inset Flex CharStyle:Code
2540 \begin_layout Plain Layout
2547 The process of doing all of this is explained in the documentation for
2549 \begin_inset Flex CharStyle:Code
2552 \begin_layout Plain Layout
2559 It is possible to do this just for yourself, but if you're going to do
2560 it, you might as well share the results of your labors with the rest of
2562 Send a message to the LyX developers' list for more information about how
2566 \begin_layout Standard
2567 In short, this is what you should do (xx denotes the language code):
2570 \begin_layout Itemize
2571 Check out the LyX source code.
2573 \begin_inset CommandInset href
2575 name "information on the web"
2576 target "http://www.lyx.org/devel/cvs.php"
2583 \begin_layout Itemize
2585 \begin_inset Flex CharStyle:Code
2588 \begin_layout Plain Layout
2594 to the folder of the
2595 \begin_inset Flex CharStyle:Code
2598 \begin_layout Plain Layout
2606 \begin_inset Flex CharStyle:Code
2609 \begin_layout Plain Layout
2617 \begin_inset Flex CharStyle:Code
2620 \begin_layout Plain Layout
2626 doesn't exist anywhere, it can be remade with the console command
2627 \begin_inset Flex CharStyle:Code
2630 \begin_layout Plain Layout
2636 in that directory, or you can use an existing po-file for some other language
2640 \begin_layout Itemize
2642 \begin_inset Flex CharStyle:Code
2645 \begin_layout Plain Layout
2655 \begin_layout Plain Layout
2656 This is just a text file, so it can be edited in any text editor.
2657 But there are also specialized programs that support such editing, such
2662 (for all platforms) or
2671 contains a `mode' for editing
2672 \begin_inset Flex CharStyle:Code
2675 \begin_layout Plain Layout
2686 For some menu- and widget-labels, there are also shortcut keys that should
2688 Those keys are marked after a `|', and should be translated according to
2689 the words and phrases of the language.
2690 You should also fill also out the information at the beginning of the new
2692 \begin_inset Flex CharStyle:Code
2695 \begin_layout Plain Layout
2701 -file with your email-address, etc., so people know where to reach you with
2702 suggestions and entertaining flames.
2705 \begin_layout Standard
2706 If you are just doing this on your own, then:
2709 \begin_layout Itemize
2711 \begin_inset Flex CharStyle:Code
2714 \begin_layout Plain Layout
2721 This can be done with
2722 \begin_inset Flex CharStyle:Code
2725 \begin_layout Plain Layout
2726 msgfmt -o xx.mo < xx.po
2734 \begin_layout Itemize
2736 \begin_inset Flex CharStyle:Code
2739 \begin_layout Plain Layout
2745 -file to your locale-tree, at the correct directory for application messages
2750 xx, and under the name
2751 \begin_inset Flex CharStyle:Code
2754 \begin_layout Plain Layout
2761 \begin_inset space \thinspace{}
2765 \begin_inset space \space{}
2769 \begin_inset Flex CharStyle:Code
2772 \begin_layout Plain Layout
2773 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2783 \begin_layout Standard
2784 As said, however, it would be best if the new
2785 \begin_inset Flex CharStyle:Code
2788 \begin_layout Plain Layout
2794 -file could be added to the LyX distribution, so others can use it.
2795 Adding it involves making additional changes to LyX.
2796 So send an email to the developers' mailing list if you're interested in
2800 \begin_layout Subsubsection
2804 \begin_layout Standard
2805 Sometimes it turns out that one English message needs to be translated into
2806 different messages in the target language.
2807 One example is the message
2808 \begin_inset Flex CharStyle:Code
2811 \begin_layout Plain Layout
2817 which has the German translation
2825 , depending upon exactly what the English
2826 \begin_inset Quotes eld
2830 \begin_inset Quotes erd
2835 \begin_inset Flex CharStyle:Code
2838 \begin_layout Plain Layout
2844 does not handle such ambiguous translations.
2845 Therefore you have to add some context information to the message: Instead
2847 \begin_inset Flex CharStyle:Code
2850 \begin_layout Plain Layout
2857 \begin_inset Flex CharStyle:Code
2860 \begin_layout Plain Layout
2861 To[[as in 'From format x to format y']]
2867 \begin_inset Flex CharStyle:Code
2870 \begin_layout Plain Layout
2871 To[[as in 'From page x to page y']].
2876 Now the two occurrences of
2877 \begin_inset Flex CharStyle:Code
2880 \begin_layout Plain Layout
2887 \begin_inset Flex CharStyle:Code
2890 \begin_layout Plain Layout
2896 and can be translated correctly to
2907 \begin_layout Standard
2908 Of course the context information needs to be stripped off the original
2909 message when no translation is used.
2910 Therefore you have to put it in double square brackets at the end of the
2911 message (see the example above).
2912 The translation mechanism of LyX ensures that everything in double square
2913 brackets at the end of messages is removed before displaying the message.
2916 \begin_layout Subsection
2917 Translating the documentation.
2920 \begin_layout Standard
2921 The online documentation (in the
2922 \begin_inset Flex CharStyle:MenuItem
2925 \begin_layout Plain Layout
2931 -menu) can (and should!) be translated.
2932 If there are translated versions of the documentation available
2936 \begin_layout Plain Layout
2937 As of March 2008, at least some of the documents have been translated into
2938 fourteen languages, with the Tutorial available in a few more.
2943 and the locale is set accordingly, these will be used automagically by
2945 LyX looks for translated versions as
2946 \begin_inset Flex CharStyle:Code
2949 \begin_layout Plain Layout
2950 LyXDir/doc/xx/DocName.lyx
2956 \begin_inset Flex CharStyle:Code
2959 \begin_layout Plain Layout
2965 is the code for the language currently in use.
2966 If there are no translated documents, the default English versions will
2968 Note that the translated versions must have the same filenames (
2969 \begin_inset Flex CharStyle:Code
2972 \begin_layout Plain Layout
2978 above) as the original.
2979 If you feel up to translating the documentation (an excellent way to proof-read
2980 the original documentation by the way!), there are a few things you should
2984 \begin_layout Itemize
2985 Check out the documentation translation web page at
2986 \begin_inset CommandInset href
2988 name "http://www.lyx.org/Translation"
2989 target "http://www.lyx.org/Translation"
2994 That way, you can find out which (if any) documents have already been translate
2995 d into your language.
2996 You can also find out who (if anyone) is organizing the effort to translate
2997 the documentation into your language.
2998 If no one is organizing the effort, please let us know that you're interested.
3001 \begin_layout Standard
3002 Once you get to actually translating, here's a few hints for you that may
3006 \begin_layout Itemize
3007 Join the documentation team! There is information on how to do that in
3008 \begin_inset Flex CharStyle:Code
3011 \begin_layout Plain Layout
3018 \begin_inset Flex CharStyle:MenuItem
3021 \begin_layout Plain Layout
3022 Help\SpecialChar \menuseparator
3028 ), which by the way is the first document you should translate.
3031 \begin_layout Itemize
3032 Learn the typographic conventions for the language you are translating to.
3033 Typography is an ancient art and over the centuries, a great variety of
3034 conventions have developed throughout different parts of the world.
3035 Also study the professional terminology amongst typographers in your country.
3036 Inventing your own terminology will only confuse the users.
3039 (Warning! Typography is addictive!)
3042 \begin_layout Itemize
3043 Make a copy of the document.
3044 This will be your working copy.
3045 You can use this as your personal translated help-file by placing it in
3047 \begin_inset Flex CharStyle:Code
3050 \begin_layout Plain Layout
3059 \begin_layout Itemize
3060 Sometimes the original document (from the LyX-team) will be updated.
3061 Use the source viewer at
3062 \begin_inset CommandInset href
3064 name "http://www.lyx.org/trac/timeline"
3065 target "http://www.lyx.org/trac/timeline"
3069 to see what has been changed.
3070 That way you can easily see which parts of the translated document need
3074 \begin_layout Standard
3075 If you ever find an error in the original document, fix it and notify the
3076 rest of the documentation team of the changes! (You didn't forget to join
3077 the documentation team, did you?)
3080 \begin_layout Standard
3081 \begin_inset Branch OutDated
3084 \begin_layout Section
3085 International Keyboard Support
3088 \begin_layout Standard
3091 [Editor's Note: The following section is by
3099 It needs to be fixed to conform to the new Documentation Style sheet and
3100 to make use of the new v1.0 features.
3101 The whole thing also needs to be merged with the section following it.-jw
3102 It may also be badly out of date.-rh (2008)]
3105 \begin_layout Subsection
3106 Defining Own Keymaps: Keymap File Format
3109 \begin_layout Standard
3110 Let's look at a keyboard definition file a little closer.
3111 It is a plain text file defining
3114 \begin_layout Itemize
3115 key-to-key or key-to-string translations
3118 \begin_layout Itemize
3122 \begin_layout Itemize
3123 dead keys exceptions
3126 \begin_layout Standard
3127 To define key-to-key or key-to-string translation, use this command:
3130 \begin_layout Quotation
3131 \begin_inset Flex CharStyle:Code
3134 \begin_layout Plain Layout
3143 \begin_inset Flex CharStyle:Code
3146 \begin_layout Plain Layout
3155 \begin_layout Standard
3157 \begin_inset Flex CharStyle:Code
3160 \begin_layout Plain Layout
3166 is the key to be translated and
3167 \begin_inset Flex CharStyle:Code
3170 \begin_layout Plain Layout
3176 is the string to be inserted into the document.
3177 To define dead keys, use:
3180 \begin_layout Quotation
3181 \begin_inset Flex CharStyle:Code
3184 \begin_layout Plain Layout
3193 \begin_inset Flex CharStyle:Code
3196 \begin_layout Plain Layout
3205 \begin_layout Standard
3207 \begin_inset Flex CharStyle:Code
3210 \begin_layout Plain Layout
3216 is a keyboard key and
3217 \begin_inset Flex CharStyle:Code
3220 \begin_layout Plain Layout
3227 The following dead keys are supported (shortcut name is in parentheses):
3230 \begin_layout Quotation
3234 \begin_inset space \hfill{}
3240 \begin_layout Quotation
3242 \begin_inset space \hfill{}
3248 \begin_layout Quotation
3250 \begin_inset space \hfill{}
3256 \begin_layout Quotation
3258 \begin_inset space \hfill{}
3264 \begin_layout Quotation
3266 \begin_inset space \hfill{}
3272 \begin_layout Quotation
3274 \begin_inset space \hfill{}
3281 \begin_layout Plain Layout
3293 \begin_layout Quotation
3295 \begin_inset space \hfill{}
3301 \begin_layout Quotation
3303 \begin_inset space \hfill{}
3310 \begin_layout Plain Layout
3322 \begin_layout Quotation
3324 \begin_inset space \hfill{}
3330 \begin_layout Quotation
3332 \begin_inset space \hfill{}
3338 \begin_layout Quotation
3340 \begin_inset space \hfill{}
3347 \begin_layout Plain Layout
3359 \begin_layout Quotation
3361 \begin_inset space \hfill{}
3368 \begin_layout Plain Layout
3380 \begin_layout Quotation
3382 \begin_inset space \hfill{}
3388 \begin_layout Quotation
3389 hungarian umlaut (hug)
3390 \begin_inset space \hfill{}
3396 \begin_layout Quotation
3398 \begin_inset space \hfill{}
3404 \begin_layout Quotation
3406 \begin_inset space \hfill{}
3413 \begin_layout Plain Layout
3425 \begin_layout Standard
3426 Since in many international keyboards there are exceptions to what some
3427 dead keys should do, you can define them using
3430 \begin_layout Quotation
3431 \begin_inset Flex CharStyle:Code
3434 \begin_layout Plain Layout
3442 deadkey key outstring
3445 \begin_layout Standard
3446 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3450 \begin_layout Quotation
3451 \begin_inset Flex CharStyle:Code
3454 \begin_layout Plain Layout
3467 \begin_layout Standard
3468 to make it work correctly.
3469 Also, you have to define as exceptions dead keys over i and j, to remove
3470 the dot from them before inserting an accent mark.
3471 I will change this when the time comes, but so far I haven't had time.
3474 \begin_layout Standard
3475 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3478 \begin_inset Flex CharStyle:Code
3481 \begin_layout Plain Layout
3487 have different meaning.
3489 \begin_inset Flex CharStyle:Code
3492 \begin_layout Plain Layout
3498 marks comments, quotes start and end LaTeX-style commands.
3499 To enter quote, you'll need to use
3500 \begin_inset Flex CharStyle:Code
3503 \begin_layout Plain Layout
3512 \begin_inset Flex CharStyle:Code
3515 \begin_layout Plain Layout
3522 \begin_inset Flex CharStyle:Code
3525 \begin_layout Plain Layout
3536 \begin_layout Standard
3537 If you make a keyboard description file that works for your language, please
3538 mail it to me, so I can include it in the next keymap distribution.
3541 \begin_layout Standard
3542 More keywords will be supported in keymap configuration file in future,
3546 \begin_layout Itemize
3547 \begin_inset Flex CharStyle:Code
3550 \begin_layout Plain Layout
3561 \begin_inset space \hfill{}
3565 \begin_inset Flex CharStyle:Code
3568 \begin_layout Plain Layout
3577 \begin_layout Itemize
3578 \begin_inset Flex CharStyle:Code
3581 \begin_layout Plain Layout
3592 \begin_inset space \hfill{}
3596 \begin_inset Flex CharStyle:Code
3599 \begin_layout Plain Layout
3605 an external keymap translation program
3608 \begin_layout Standard
3609 Also, it should look into
3610 \begin_inset Flex CharStyle:Code
3613 \begin_layout Plain Layout
3619 file for defaults, too (for example, a
3620 \begin_inset Flex CharStyle:Code
3623 \begin_layout Plain Layout
3631 option to include default keyboard).
3639 \begin_layout Section
3640 International Keymap Stuff
3641 \begin_inset CommandInset label
3643 name "sec:International-Keymap-Stuff"
3650 \begin_layout Standard
3651 \begin_inset Note Note
3654 \begin_layout Plain Layout
3655 In doing the revisions on this document in March 2008, I did not look over
3656 this stuff, as I do not understand it.
3657 It would be good if someone else could do so.
3666 \begin_layout Standard
3667 The next two sections describe the
3668 \begin_inset Flex CharStyle:Code
3671 \begin_layout Plain Layout
3680 \begin_inset Flex CharStyle:Code
3683 \begin_layout Plain Layout
3691 file syntax in detail.
3692 These sections should help you design your own key map if the ones provided
3693 do not meet your needs.
3696 \begin_layout Subsection
3700 \begin_layout Standard
3704 \begin_inset Flex CharStyle:Code
3707 \begin_layout Plain Layout
3713 file maps keystrokes to characters or strings.
3714 As the name suggests, it sets a keyboard mapping.
3716 \begin_inset Flex CharStyle:Code
3719 \begin_layout Plain Layout
3730 \begin_inset Flex CharStyle:Code
3733 \begin_layout Plain Layout
3748 \begin_inset Flex CharStyle:Code
3751 \begin_layout Plain Layout
3764 \begin_inset Flex CharStyle:Code
3767 \begin_layout Plain Layout
3776 \begin_inset Flex CharStyle:Code
3779 \begin_layout Plain Layout
3787 are described in this section.
3790 \begin_layout Labeling
3791 \labelwidthstring 00.00.0000
3792 \begin_inset Flex CharStyle:Code
3795 \begin_layout Plain Layout
3803 Map a character to a string
3806 \begin_layout LyX-Code
3821 \begin_layout Standard
3854 the double-quote (")
3871 must be escaped with a preceding backslash (
3882 \begin_layout Standard
3884 \begin_inset Flex CharStyle:MenuItem
3887 \begin_layout Plain Layout
3895 statement to cause the symbol
3896 \begin_inset Flex CharStyle:MenuItem
3899 \begin_layout Plain Layout
3907 to be output for the keystroke
3908 \begin_inset Flex CharStyle:MenuItem
3911 \begin_layout Plain Layout
3922 \begin_layout LyX-Code
3928 \begin_layout Labeling
3929 \labelwidthstring 00.00.0000
3930 \begin_inset Flex CharStyle:Code
3933 \begin_layout Plain Layout
3941 Specify an accent character
3944 \begin_layout LyX-Code
3953 \begin_layout Standard
3954 This will make the cha
3992 This is the dead key
3996 \begin_layout Plain Layout
4003 refers to a key that does not produce a character by itself, but when followed
4004 with another key, produces the desired accent character.
4005 For example, a German characte
4007 r with an umlaut like
4017 can be produced in this manner.
4026 \begin_layout Standard
4039 and then another key not in
4056 followed by the other, not allowed key, as output.
4060 \begin_inset Flex CharStyle:MenuItem
4063 \begin_layout Plain Layout
4071 cancels a dead key, so if
4082 \begin_inset Flex CharStyle:MenuItem
4085 \begin_layout Plain Layout
4094 , the cursor will not go one position backwards but will instead cancel
4110 might have had on the next keystroke.
4114 \begin_layout Standard
4115 The following example specifies that the character ' is to be an acute accent,
4116 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4119 \begin_layout LyX-Code
4122 kmod ' acute aeiouAEIOU
4125 \begin_layout Labeling
4126 \labelwidthstring 00.00.0000
4127 \begin_inset Flex CharStyle:Code
4130 \begin_layout Plain Layout
4136 Specify an exception to the accent character
4139 \begin_layout LyX-Code
4148 \begin_layout Standard
4149 This defines an exce
4190 have been assigned a keystroke with a previous
4193 \begin_inset Flex CharStyle:Code
4196 \begin_layout Plain Layout
4220 must not belong in the
4267 If such a declaration does not exist in
4275 \begin_inset Flex CharStyle:Code
4278 \begin_layout Plain Layout
4312 \begin_inset Flex CharStyle:Code
4315 \begin_layout Plain Layout
4329 \begin_layout Standard
4330 The following command produces causes äi to be produced when you enter acute-i
4334 \begin_layout LyX-Code
4348 \begin_layout Labeling
4349 \labelwidthstring 00.00.0000
4350 \begin_inset Flex CharStyle:Code
4353 \begin_layout Plain Layout
4359 Combine two accent characters
4362 \begin_layout LyX-Code
4368 accent1 accent2 allowed
4371 \begin_layout Standard
4372 This one is getting pretty esoteric.
4373 It allows you to combine the effect
4429 \begin_inset Flex CharStyle:Code
4432 \begin_layout Plain Layout
4460 \begin_layout Standard
4461 Consider this example from the
4462 \begin_inset Flex CharStyle:Code
4465 \begin_layout Plain Layout
4476 \begin_layout LyX-Code
4479 kmod ; acute aeioyvhAEIOYVH
4483 kcomb acute umlaut iyIY
4486 \begin_layout Standard
4487 This allows you to press
4488 \begin_inset Flex CharStyle:MenuItem
4491 \begin_layout Plain Layout
4499 and get the effect of
4500 \begin_inset Flex CharStyle:Code
4503 \begin_layout Plain Layout
4522 in this case cancels the last dead key, so if you press
4523 \begin_inset Flex CharStyle:MenuItem
4526 \begin_layout Plain Layout
4535 \begin_inset Flex CharStyle:Code
4538 \begin_layout Plain Layout
4551 \begin_layout Subsection
4555 \begin_layout Standard
4557 \begin_inset Flex CharStyle:Code
4560 \begin_layout Plain Layout
4568 mapping is performed, a
4569 \begin_inset Flex CharStyle:Code
4572 \begin_layout Plain Layout
4582 file maps the strings that the symbols generate to characters in the current
4584 The LyX distribution currently includes at least the
4585 \begin_inset Flex CharStyle:Code
4588 \begin_layout Plain Layout
4597 \begin_inset Flex CharStyle:Code
4600 \begin_layout Plain Layout
4611 \begin_layout Standard
4613 \begin_inset Flex CharStyle:Code
4616 \begin_layout Plain Layout
4624 file is a sequence of declarations of the form
4627 \begin_layout LyX-Code
4640 \begin_layout Standard
4641 For example, in order to map
4642 \begin_inset Flex CharStyle:MenuItem
4645 \begin_layout Plain Layout
4655 to the corresponding character in the iso-8859-1 set (233), the following
4659 \begin_layout LyX-Code
4667 \begin_layout Standard
4669 \begin_inset Flex CharStyle:Code
4672 \begin_layout Plain Layout
4681 \begin_inset Flex CharStyle:Code
4684 \begin_layout Plain Layout
4702 the same character can apply to more than one string.
4704 \begin_inset Flex CharStyle:Code
4707 \begin_layout Plain Layout
4718 \begin_layout LyX-Code
4730 \begin_inset Newline newline
4746 \begin_layout Standard
4747 If LyX cannot find a mapping for the string produced by the keystroke or
4748 a deadkey sequence, it will check if it looks like an accented char and
4749 try to draw an accent over the character on screen.
4752 \begin_layout Subsection
4756 \begin_layout Standard
4757 There is a second way to add support for international characters through
4758 so-called dead-keys.
4759 A dead-key works in combination with a letter to produce an accented character.
4760 Here, we'll explain how to create a really simple dead-key to illustrate
4764 \begin_layout Standard
4765 Suppose you happen to need the circumflex character,
4766 \begin_inset Quotes eld
4770 \begin_inset Quotes erd
4775 \begin_inset Flex CharStyle:MenuItem
4778 \begin_layout Plain Layout
4785 \begin_inset space ~
4789 \begin_inset Flex CharStyle:MenuItem
4792 \begin_layout Plain Layout
4798 ] to the LyX command
4799 \begin_inset Flex CharStyle:Code
4802 \begin_layout Plain Layout
4809 \begin_inset Flex CharStyle:Code
4812 \begin_layout Plain Layout
4819 Now, whenever you type the
4820 \begin_inset Flex CharStyle:MenuItem
4823 \begin_layout Plain Layout
4829 -key followed by a letter, that letter will have a circumflex accent on
4831 For example, the sequence
4832 \begin_inset Quotes eld
4836 \begin_inset Flex CharStyle:MenuItem
4839 \begin_layout Plain Layout
4846 \begin_inset Quotes erd
4849 produces the letter:
4850 \begin_inset Quotes eld
4854 \begin_inset Quotes erd
4858 If you tried to type
4859 \begin_inset Quotes eld
4863 \begin_inset Flex CharStyle:MenuItem
4866 \begin_layout Plain Layout
4873 \begin_inset Quotes erd
4876 , however, LyX will complain with a beep, since a
4877 \begin_inset Quotes eld
4881 \begin_inset Flex CharStyle:MenuItem
4884 \begin_layout Plain Layout
4891 \begin_inset Quotes erd
4894 never takes a circumflex accent.
4896 \begin_inset Flex CharStyle:MenuItem
4899 \begin_layout Plain Layout
4905 after a dead-key produces the bare-accent.
4906 Please note this last point! If you bind a key to a dead-key, you'll need
4907 to rebind the character on that key to yet another key.
4909 \begin_inset Flex CharStyle:MenuItem
4912 \begin_layout Plain Layout
4918 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4921 \begin_layout Standard
4922 One common way to bind dead-keys is to use
4923 \begin_inset Flex CharStyle:MenuItem
4926 \begin_layout Plain Layout
4933 \begin_inset Flex CharStyle:MenuItem
4936 \begin_layout Plain Layout
4943 \begin_inset Flex CharStyle:MenuItem
4946 \begin_layout Plain Layout
4952 in combination with an accent, like
4953 \begin_inset Quotes eld
4957 \begin_inset Flex CharStyle:MenuItem
4960 \begin_layout Plain Layout
4967 \begin_inset Quotes erd
4971 \begin_inset Quotes eld
4975 \begin_inset Flex CharStyle:MenuItem
4978 \begin_layout Plain Layout
4985 \begin_inset Quotes erd
4989 \begin_inset Quotes eld
4993 \begin_inset Flex CharStyle:MenuItem
4996 \begin_layout Plain Layout
5003 \begin_inset Quotes erd
5007 Another way involves using
5008 \begin_inset Flex CharStyle:Code
5011 \begin_layout Plain Layout
5018 \begin_inset Flex CharStyle:Code
5021 \begin_layout Plain Layout
5027 to set up the special
5028 \begin_inset Flex CharStyle:Code
5031 \begin_layout Plain Layout
5039 \begin_inset Flex CharStyle:Code
5042 \begin_layout Plain Layout
5048 acts in some ways just like
5049 \begin_inset Flex CharStyle:MenuItem
5052 \begin_layout Plain Layout
5058 and permits you to bind keys to accented characters.
5059 You can also turn keys into dead-keys by binding them to something like
5061 \begin_inset Flex CharStyle:Code
5064 \begin_layout Plain Layout
5070 and then binding this symbolic key to the corresponding LyX command.
5074 \begin_layout Plain Layout
5079 : This is exactly what I do in my
5080 \begin_inset Flex CharStyle:Code
5083 \begin_layout Plain Layout
5090 \begin_inset Flex CharStyle:Code
5093 \begin_layout Plain Layout
5101 \begin_inset Flex CharStyle:MenuItem
5104 \begin_layout Plain Layout
5106 \begin_inset space ~
5115 \begin_inset Flex CharStyle:Code
5118 \begin_layout Plain Layout
5124 and a bunch of these
5125 \begin_inset Quotes eld
5129 \begin_inset Flex CharStyle:Code
5132 \begin_layout Plain Layout
5139 \begin_inset Quotes erd
5142 symbolic keys bound such things as
5143 \begin_inset Flex CharStyle:MenuItem
5146 \begin_layout Plain Layout
5148 \begin_inset space ~
5157 \begin_inset Flex CharStyle:MenuItem
5160 \begin_layout Plain Layout
5162 \begin_inset space ~
5171 This is how I produce my accented characters.
5176 You can make just about anything into the
5177 \begin_inset Flex CharStyle:Code
5180 \begin_layout Plain Layout
5187 \begin_inset Flex CharStyle:MenuItem
5190 \begin_layout Plain Layout
5196 keys, a spare function key, etc.
5197 As for the LyX commands that produce accents, check the entry for
5198 \begin_inset Flex CharStyle:Code
5201 \begin_layout Plain Layout
5212 You'll find the complete list there.
5215 \begin_layout Subsection
5216 Saving your Language Configuration
5219 \begin_layout Standard
5220 You can edit your preferences so that your desired language environment
5221 is automatically configured when LyX starts up, via the
5222 \begin_inset Flex CharStyle:MenuItem
5225 \begin_layout Plain Layout
5226 Edit\SpecialChar \menuseparator
5235 \begin_layout Chapter
5236 Installing New Document Classes, Layouts, and Templates
5237 \begin_inset CommandInset label
5239 name "cha:Installing-New-Document"
5247 \begin_layout Plain Layout
5248 Installing New Document Classes
5256 \begin_layout Standard
5257 In this chapter, we describe the procedures for creating and installing
5258 new LyX layout and template files, as well as offer a refresher on correctly
5259 installing new LaTeX document classes.
5263 \begin_layout Standard
5264 First, let us a say a few words about how one ought to think about the relation
5265 between LyX and LaTeX.
5266 The thing to understand is that, in a certain sense, LyX doesn't know anything
5268 Indeed, from LyX's point of view, LaTeX is just one of several
5269 \begin_inset Quotes eld
5273 \begin_inset Quotes erd
5276 in which it is capable of producing output.
5277 Other such formats are DocBook, plaintext, and XHTML.
5278 LaTeX is, of course, a particularly important format, but very little of
5279 the information LyX has about LaTeX is actually contained in the program
5284 \begin_layout Plain Layout
5285 Some commands are sufficiently complex that they are
5286 \begin_inset Quotes eld
5290 \begin_inset Quotes erd
5294 But the developers generally regard this as a Bad Thing.
5299 Rather, that information, even for the standard classes like
5300 \begin_inset Flex CharStyle:Code
5303 \begin_layout Plain Layout
5309 , is contained in layout files.
5310 Similarly, LyX itself does not know much about DocBook or XHTML.
5313 \begin_layout Standard
5314 You can think of the layout file for a given document class as a translation
5315 manual between LyX constructs---paragraphs with their corresponding styles,
5316 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5318 Almost everything LyX knows about
5319 \begin_inset Flex CharStyle:Code
5322 \begin_layout Plain Layout
5328 , for example, is contained in the file
5329 \begin_inset Flex CharStyle:Code
5332 \begin_layout Plain Layout
5338 and in various other files it includes.
5339 For this reason, anyone intending to write layout files should plan to
5340 study the existing files.
5341 A good place to start is with
5342 \begin_inset Flex CharStyle:Code
5345 \begin_layout Plain Layout
5351 , which is included in
5352 \begin_inset Flex CharStyle:Code
5355 \begin_layout Plain Layout
5362 \begin_inset Flex CharStyle:Code
5365 \begin_layout Plain Layout
5371 , and many of the other layout files for document classes.
5372 This file is where sections and the like are defined:
5373 \begin_inset Flex CharStyle:Code
5376 \begin_layout Plain Layout
5382 tells LyX how paragraphs that are marked with the Section, Subsection,
5383 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5386 \begin_inset Flex CharStyle:Code
5389 \begin_layout Plain Layout
5395 file basically just includes several of these
5396 \begin_inset Flex CharStyle:Code
5399 \begin_layout Plain Layout
5408 \begin_layout Standard
5409 Defining the LyX--LaTeX correspondence is not the only thing layout files
5411 Their other job is to define how the LyX constructs themselves will appear
5413 The fact that layout files have these two jobs is often a source of confusion,
5414 because they are completely separate.
5415 Telling LyX how to translate a certain paragraph style into LaTeX does
5416 not tell LyX how to display it; conversely, telling LyX how to display
5417 a certain paragraph style does not tell LyX how to translate it into LaTeX
5418 (let alone tell LaTeX how to display it).
5419 So, in general, when you define a new LyX construct, you must always do
5420 two quite separate things: (i)
5421 \begin_inset space ~
5424 tell LyX how to translate it into LaTeX and (ii)
5425 \begin_inset space ~
5428 tell LyX how to display it.
5431 \begin_layout Standard
5432 Much the same is true, of course, as regards LyX's other backend formats,
5433 though XHTML is in some ways different, because in that case LyX
5437 able, to some extent, to use information about how it should display a
5438 paragraph on the screen to output information (in the form of CSS) about
5439 how the paragraph should be displayed in a browser.
5440 Even in this case, however, the distinction between what LyX does internally
5441 and how things are rendered externally remains in force, and the two can
5442 be controlled separately.
5444 \begin_inset CommandInset ref
5445 LatexCommand prettyref
5446 reference "sec:Tags-for-XHTML"
5453 \begin_layout Section
5454 Installing new LaTeX files
5457 \begin_layout Standard
5458 Some installations may not include a LaTeX package or class file that you
5459 would like to use within LyX.
5460 For example, you might need FoilTeX, a package for preparing slides for
5461 overhead projectors.
5462 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5463 a user interface for installing such packages.
5464 For example, with MiKTeX, you start the program
5465 \begin_inset Quotes eld
5469 \begin_inset Quotes erd
5472 to get a list of available packages.
5473 To install one, right click on it or use the toolbar button to install
5478 \begin_layout Standard
5479 If your LaTeX distribution doesn't provide such a `package manager', or
5480 if the file is not available from your distribution, then you can follow
5481 these steps to install it manually.
5484 \begin_layout Enumerate
5485 Get the package from
5486 \begin_inset CommandInset href
5489 target "http://www.ctan.org/"
5496 \begin_layout Enumerate
5497 You can install the package in several different places.
5498 If you want it to be available for all users on your system, then you should
5499 install it in your `local' TeX tree; if you want (or need) it to be available
5500 just for you, then you can install it in your own `user' TeX tree.
5501 Where these trees should be created, if they do not already exist, depends
5502 upon the details of your system.
5503 To find out where they are, look in the file
5504 \begin_inset Flex CharStyle:Code
5507 \begin_layout Plain Layout
5517 \begin_layout Plain Layout
5518 This usually lives in the directory
5519 \begin_inset Flex CharStyle:Code
5522 \begin_layout Plain Layout
5528 , though you can run
5529 \begin_inset Flex CharStyle:Code
5532 \begin_layout Plain Layout
5543 The location of the `local' TeX tree is defined by the
5544 \begin_inset Flex CharStyle:Code
5547 \begin_layout Plain Layout
5553 variable; this is usually somewhere like
5554 \begin_inset Flex URL
5557 \begin_layout Plain Layout
5559 /usr/local/share/texmf/
5565 The location of the `user' TeX tree is defined by
5566 \begin_inset Flex CharStyle:Code
5569 \begin_layout Plain Layout
5576 \begin_inset Flex CharStyle:Code
5579 \begin_layout Plain Layout
5586 (If these variables are not predefined, you can define them.) You'll probably
5587 need root permissions to create or modify the `local' tree, but your `user'
5588 tree shouldn't have such limitations.
5591 \begin_layout Enumerate
5593 \begin_inset Flex CharStyle:Code
5596 \begin_layout Plain Layout
5603 \begin_inset Flex CharStyle:Code
5606 \begin_layout Plain Layout
5613 \begin_inset Flex CharStyle:Code
5616 \begin_layout Plain Layout
5623 \begin_inset space \thinspace{}
5627 \begin_inset Newline newline
5631 \begin_inset Flex CharStyle:Code
5634 \begin_layout Plain Layout
5635 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5641 \begin_inset Newline newline
5647 \begin_layout Enumerate
5648 Your local and user trees
5652 have the same sort of directory structure as your main existing
5653 \begin_inset Flex CharStyle:Code
5656 \begin_layout Plain Layout
5662 directory, which will be found at
5663 \begin_inset Flex CharStyle:Code
5666 \begin_layout Plain Layout
5673 \begin_inset Flex CharStyle:Code
5676 \begin_layout Plain Layout
5682 .) For example, latex packages should go under
5683 \begin_inset Flex CharStyle:Code
5686 \begin_layout Plain Layout
5687 $TEXMFLOCAL/tex/latex/
5693 \begin_inset Flex CharStyle:Code
5696 \begin_layout Plain Layout
5697 $TEXMFHOME/tex/latex/
5703 If you do not put them here, they probably will not work.
5706 \begin_layout Enumerate
5707 Once your tree is properly set up, you can install the package into an appropria
5709 If you are lucky, your package will have been provided as a so-called `TDS'
5710 (TeX Directory Structure) zip file.
5711 To install it, you want to unzip it from the top of your tree.
5712 So, for example, you can copy the file
5713 \begin_inset Flex CharStyle:Code
5716 \begin_layout Plain Layout
5723 \begin_inset Flex CharStyle:Code
5726 \begin_layout Plain Layout
5727 /home/yourname/texmf/
5732 and then, from inside that directory, just run:
5733 \begin_inset Flex CharStyle:Code
5736 \begin_layout Plain Layout
5743 This will extract the needed files and copy them where they need to be.
5744 \begin_inset Newline newline
5747 If you do not have a TDS file, then you have to do this manually.
5748 For example, you might install the FoilTeX files into
5749 \begin_inset Flex URL
5752 \begin_layout Plain Layout
5754 $TEXMFLOCAL/tex/latex/contrib/foiltex
5760 Why there? The CTAN download directories are themselves organized much
5761 like a TeX tree, and it isn't a bad idea to follow its structure when you
5762 install your own files.
5763 FoilTeX, as it happens, is found at
5764 \begin_inset Flex URL
5767 \begin_layout Plain Layout
5769 http://ctan.org/texarchive/macros/latex/contrib/foiltex/
5778 \begin_layout Enumerate
5779 Finally, you must update the database TeX uses to find files.
5780 On MiKTeX, this is done by pressing the button
5783 \begin_inset space ~
5788 that you find in MiKTeX's
5789 \begin_inset Quotes eld
5793 \begin_inset Quotes erd
5798 \begin_inset Flex CharStyle:Code
5801 \begin_layout Plain Layout
5802 $TEXMFLOCAL/tex/latex/
5808 Under TeXLive and the like, you should run
5809 \begin_inset Flex CharStyle:Code
5812 \begin_layout Plain Layout
5818 from a terminal, with root permissions if necessary.
5822 \begin_layout Standard
5823 Your package is now installed and available to LaTeX.
5824 You can verify this from a terminal by typing `
5825 \begin_inset Flex CharStyle:Code
5828 \begin_layout Plain Layout
5829 kpsewhich yourfile.ext
5835 To make LyX aware of it, however, you will need to reconfigure (
5836 \begin_inset Flex CharStyle:MenuItem
5839 \begin_layout Plain Layout
5840 Tools\SpecialChar \menuseparator
5846 ) and then restart LyX.
5847 If the new package was a document class, such as FoilTeX again, you will
5848 now see it available under
5849 \begin_inset Flex CharStyle:MenuItem
5852 \begin_layout Plain Layout
5853 Document\SpecialChar \menuseparator
5854 Settings\SpecialChar \menuseparator
5861 \begin_inset Flex CharStyle:MenuItem
5864 \begin_layout Plain Layout
5873 \begin_layout Standard
5874 What if there isn't a layout file is available for your new document class?
5875 Then, unfortunately, LyX will know nothing about it until you create a
5876 layout file yourself (or get someone else to do it).
5877 That is the topic of the next section.
5880 \begin_layout Section
5881 Types of layout files
5884 \begin_layout Standard
5885 This section describes the various sorts of LyX files that contain layout
5887 These files describe various paragraph and character styles, determining
5888 how LyX should display them and how they should be translated into LaTeX,
5889 DocBook, XHTML, or whatever output format is being used.
5893 \begin_layout Standard
5894 We shall try to provide a thorough description of the process of writing
5896 However, there are so many different types of documents supported even
5897 by just LaTeX that we can't hope to cover every different possibility or
5898 problem you might encounter.
5899 The LyX users' list is frequented by people with lots of experience with
5900 layout design who are willing to share what they've learned, so please
5901 feel free to ask questions there.
5904 \begin_layout Standard
5905 As you prepare to write a new layout, it is extremely helpful to look at
5906 the layouts distributed with LyX.
5907 If you write a LyX layout for a LaTeX document class that might also be
5908 used by others, or write a module that might be useful to others, then
5909 you should consider posting your layout to the
5910 \begin_inset CommandInset href
5912 name "layout section on the LyX wiki"
5913 target "http://wiki.lyx.org/Layouts/Layouts"
5917 or even to the LyX developers' list, so that it might be included in LyX
5922 \begin_layout Plain Layout
5923 Note that LyX is licensed under the General Public License, so any material
5924 that is contribued to LyX must be similarly licensed.
5932 \begin_layout Subsection
5934 \begin_inset CommandInset label
5936 name "sub:Layout-modules"
5943 \begin_layout Standard
5944 We have spoken to this point about `layout files'.
5945 But there are different sorts of files that contain layout information.
5946 Layout files, strictly so called, have the
5947 \begin_inset Flex CharStyle:Code
5950 \begin_layout Plain Layout
5956 extension and provide LyX with information about document classes.
5957 As of LyX 1.6, however, layout information can also be contained in layout
5963 \begin_inset Flex CharStyle:Code
5966 \begin_layout Plain Layout
5973 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5974 some modules—such as the
5975 \begin_inset Flex CharStyle:Code
5978 \begin_layout Plain Layout
5984 module—specifcally provide support for one package.
5985 In a sense, layout modules are similar to included
5989 \begin_layout Plain Layout
5990 These can have any extension, but by convention have the
5991 \begin_inset Flex CharStyle:Code
5994 \begin_layout Plain Layout
6006 \begin_inset Flex CharStyle:Code
6009 \begin_layout Plain Layout
6015 —in that modules are not specific to a given document class but may be used
6016 with many different classes.
6017 The difference is that using an included file with
6018 \begin_inset Flex CharStyle:Code
6021 \begin_layout Plain Layout
6027 requires editing that file.
6028 Modules, by contrast, are selected in the
6029 \begin_inset Flex CharStyle:MenuItem
6032 \begin_layout Plain Layout
6033 Document\SpecialChar \menuseparator
6042 \begin_layout Standard
6043 Building modules is the easiest way to get started with layout editing,
6044 since it can be as simple as adding a single new paragraph style or flex
6046 But modules may, in principle, contain anything a layout file can contain.
6049 \begin_layout Standard
6050 After creating a new module and copying it to the
6051 \begin_inset Flex CharStyle:Code
6054 \begin_layout Plain Layout
6060 folder, you will need to reconfigure and then restart LyX for the module
6061 to appear in the menu.
6062 However, changes you make to the module will be seen immediately, if you
6064 \begin_inset Flex CharStyle:MenuItem
6067 \begin_layout Plain Layout
6068 Document\SpecialChar \menuseparator
6074 , highlight something, and then hit
6075 \begin_inset Quotes eld
6079 \begin_inset Quotes erd
6085 It is strongly recommended that you save your work before doing this
6090 it is strongly recommended that you not attempt to edit modules while simultaneo
6091 usly working on actual documents
6094 Though of course the developers strive to keep LyX stable in such situations,
6095 syntax errors and the like in your module file could cause strange behavior.
6098 \begin_layout Subsection
6100 \begin_inset Flex CharStyle:MenuItem
6103 \begin_layout Plain Layout
6112 \begin_layout Standard
6113 There are two situations you are likely to encounter when wanting to support
6114 a new LaTeX document class, involving LaTeX2e class (
6115 \begin_inset Flex CharStyle:Code
6118 \begin_layout Plain Layout
6125 \begin_inset Flex CharStyle:Code
6128 \begin_layout Plain Layout
6135 Supporting a style file is usually fairly easy.
6136 Supporting a new class file is a bit harder.
6137 We'll discuss the former in this section and the latter in the next.
6138 Similar remarks apply, of course, if you want to support a new DocBook
6142 \begin_layout Standard
6143 The easier case is the one in which your new document class is provided
6144 as a style file that is to be used in conjunction with an already supported
6146 For the sake of the example, we'll assume that the style file is called
6148 \begin_inset Flex CharStyle:MenuItem
6151 \begin_layout Plain Layout
6157 and that it is meant to be used with
6158 \begin_inset Flex CharStyle:MenuItem
6161 \begin_layout Plain Layout
6167 , which is a standard class.
6171 \begin_layout Standard
6172 Start by copying the existing class's layout file into your local directory:
6176 \begin_layout Plain Layout
6177 Of course, which directory is your local directory will vary by platform,
6178 and LyX allows you to specify your local directory on startup, too, using
6180 \begin_inset Flex CharStyle:Code
6183 \begin_layout Plain Layout
6197 \begin_layout LyX-Code
6198 cp report.layout ~/.lyx/layouts/myclass.layout
6201 \begin_layout Standard
6203 \begin_inset Flex CharStyle:Code
6206 \begin_layout Plain Layout
6212 and change the line:
6215 \begin_layout LyX-Code
6218 DeclareLaTeXClass{report}
6221 \begin_layout Standard
6225 \begin_layout LyX-Code
6228 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6231 \begin_layout Standard
6235 \begin_layout LyX-Code
6237 \begin_inset Newline newline
6243 \begin_inset Newline newline
6249 \begin_layout Standard
6250 near the top of the file.
6253 \begin_layout Standard
6254 Start LyX and select
6255 \begin_inset Flex CharStyle:MenuItem
6258 \begin_layout Plain Layout
6259 Tools\SpecialChar \menuseparator
6266 Then restart LyX and try creating a new document.
6268 \begin_inset Flex CharStyle:MenuItem
6271 \begin_layout Plain Layout
6277 " as a document class option in the
6278 \begin_inset Flex CharStyle:MenuItem
6281 \begin_layout Plain Layout
6282 Document\SpecialChar \menuseparator
6289 It is likely that some of the sectioning commands and such in your new
6290 class will work differently from how they worked in the base class—
6291 \begin_inset Flex CharStyle:Code
6294 \begin_layout Plain Layout
6300 in this example—so you can fiddle around with the settings for the different
6301 sections if you wish.
6302 The layout information for sections is contained in
6303 \begin_inset Flex CharStyle:Code
6306 \begin_layout Plain Layout
6312 , but you do not need to copy and change this file.
6313 Instead, you can simply add your changes to your layout file, after the
6315 \begin_inset Flex CharStyle:Code
6318 \begin_layout Plain Layout
6324 , which itself includes
6325 \begin_inset Flex CharStyle:Code
6328 \begin_layout Plain Layout
6335 For example, you might add these lines:
6338 \begin_layout LyX-Code
6342 \begin_layout LyX-Code
6346 \begin_layout LyX-Code
6350 \begin_layout LyX-Code
6354 \begin_layout LyX-Code
6358 \begin_layout Standard
6359 to change the font for chapter headings to sans-serif.
6360 This will override (or, in this case, add to) the existing declaration
6361 for the Chapter style.
6365 \begin_layout Standard
6366 Your new package may also provide commands or environments not present in
6368 In this case, you will want to add these to the layout file.
6370 \begin_inset CommandInset ref
6372 reference "sec:TextClass"
6376 for information on how to do so.
6379 \begin_layout Standard
6381 \begin_inset Flex CharStyle:MenuItem
6384 \begin_layout Plain Layout
6390 can be used with several different document classes, and even if it cannot,
6391 you might find it easiest just to write a module that you can load with
6393 The simplest possible such module would be:
6396 \begin_layout LyX-Code
6399 DeclareLyXModule{My Package}
6402 \begin_layout LyX-Code
6406 \begin_layout LyX-Code
6407 #Support for mypkg.sty.
6410 \begin_layout LyX-Code
6412 \begin_inset Newline newline
6418 \begin_layout LyX-Code
6420 \begin_inset Newline newline
6426 \begin_layout LyX-Code
6428 \begin_inset Newline newline
6434 \begin_inset Newline newline
6440 \begin_layout Standard
6441 A more complex module might modify the behavior of some existing constructs
6442 or define some new ones.
6444 \begin_inset CommandInset ref
6446 reference "sec:TextClass"
6453 \begin_layout Subsection
6455 \begin_inset Flex CharStyle:MenuItem
6458 \begin_layout Plain Layout
6467 \begin_layout Standard
6468 There are two possibilities here.
6469 One is that the class file is itself based upon an existing document class.
6470 For example, many thesis classes are based upon
6471 \begin_inset Flex CharStyle:MenuItem
6474 \begin_layout Plain Layout
6481 To see whether yours is, look for a line like
6484 \begin_layout LyX-Code
6490 \begin_layout Standard
6492 If so, then you may proceed largely as in the previous section, though
6494 \begin_inset Flex CharStyle:Code
6497 \begin_layout Plain Layout
6503 line will be different.
6504 If your new class is
6505 \begin_inset Flex CharStyle:Code
6508 \begin_layout Plain Layout
6514 and it is based upon
6515 \begin_inset Flex CharStyle:Code
6518 \begin_layout Plain Layout
6524 , then the line should read:
6528 \begin_layout Plain Layout
6529 And it will be easiest if you save the file to
6530 \begin_inset Flex CharStyle:Code
6533 \begin_layout Plain Layout
6539 : LyX assumes that the document class has the same name as the layout file.
6548 \begin_layout LyX-Code
6551 DeclareLaTeXClass[thesis,book]{thesis}
6554 \begin_layout Standard
6555 If, on the other hand, the new class is not based upon an existing class,
6556 you will probably have to
6557 \begin_inset Quotes eld
6561 \begin_inset Quotes erd
6565 We strongly suggest copying an existing layout file which uses a similar
6566 LaTeX class and then modifying it, if you can do so.
6567 At least use an existing file as a starting point so you can find out what
6568 items you need to worry about.
6569 Again, the specifics are covered below.
6572 \begin_layout Subsection
6574 \begin_inset CommandInset label
6576 name "sub:Creating-Templates"
6583 \begin_layout Standard
6584 Once you have written a layout file for a new document class, you might
6585 want to consider writing a
6590 A template acts as a kind of tutorial for your layout, showing how it might
6591 be used, though containing dummy content.
6592 You can of course look at the various templates included with LyX for ideas.
6595 \begin_layout Standard
6596 Templates are created just like usual documents: using LyX.
6597 The only difference is that usual documents contain all possible settings,
6598 including the font scheme and the paper size.
6599 Usually a user doesn't want a template to overwrite his preferred settings
6600 for such parameters.
6601 For that reason, the designer of a template should remove the corresponding
6603 \begin_inset Flex CharStyle:Code
6606 \begin_layout Plain Layout
6615 \begin_inset Flex CharStyle:Code
6618 \begin_layout Plain Layout
6626 from the template LyX file.
6627 This can be done with any simple text-editor, for example
6628 \begin_inset Flex CharStyle:Code
6631 \begin_layout Plain Layout
6638 \begin_inset Flex CharStyle:Code
6641 \begin_layout Plain Layout
6651 \begin_layout Standard
6652 Put the edited template files you create in
6653 \begin_inset Flex CharStyle:Code
6656 \begin_layout Plain Layout
6662 , copy the ones you use from the global template directory in
6663 \begin_inset Flex CharStyle:Code
6666 \begin_layout Plain Layout
6672 to the same place, and redefine the template path in the
6673 \begin_inset Flex CharStyle:MenuItem
6676 \begin_layout Plain Layout
6677 Tools\SpecialChar \menuseparator
6678 Preferences\SpecialChar \menuseparator
6687 \begin_layout Standard
6688 Note, by the way, that there is a template which has a particular meaning:
6690 \begin_inset Flex CharStyle:Code
6693 \begin_layout Plain Layout
6700 This template is loaded every time you create a new document with
6701 \begin_inset Flex CharStyle:MenuItem
6704 \begin_layout Plain Layout
6705 File\SpecialChar \menuseparator
6711 in order to provide useful defaults.
6712 To create this template from inside LyX, all you have to do is to open
6713 a document with the correct settings, and use the
6714 \begin_inset Flex CharStyle:MenuItem
6717 \begin_layout Plain Layout
6718 Save as Document Defaults
6726 \begin_layout Subsection
6727 Upgrading old layout files
6730 \begin_layout Standard
6731 The format of layout files changes with each LyX release, so old layout
6732 files need to be converted to the new format.
6733 This process has been automated since LyX 1.4: If LyX reads a layout file
6734 in an older format, it automatically calls the script
6735 \begin_inset Flex CharStyle:Code
6738 \begin_layout Plain Layout
6744 to convert it to a temporary file in current format.
6745 The original file is left untouched.
6746 If you use the layout file often, then, you may want to convert it permanently,
6747 so that LyX does not have to do so itself every time.
6748 To do this, you can call the converter manually:
6751 \begin_layout LyX-Code
6752 mv myclass.layout myclass.old
6755 \begin_layout LyX-Code
6756 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6759 \begin_layout Standard
6761 \begin_inset Flex CharStyle:Code
6764 \begin_layout Plain Layout
6770 with the name of your LyX system directory, of course.
6773 \begin_layout Standard
6774 Note that manual conversion does not affect included files, so these will
6775 have to be converted separately.
6778 \begin_layout Section
6779 \begin_inset CommandInset label
6781 name "sec:TextClass"
6785 The layout file format
6788 \begin_layout Standard
6789 When it's finally time to get your hands dirty and create or edit your own
6790 layout file, the following sections describe what you're up against.
6791 Our advice is to go slowly, save and test often, listen to soothing music,
6792 and enjoy one or two of your favorite adult beverages; more if you are
6793 getting particularly stuck.
6794 It's really not that hard, except that the multitude of options can become
6795 overwhelming if you try to do too much in one sitting.
6796 Go have another adult beverage, just for good measure.
6799 \begin_layout Standard
6800 Note that all the tags used in layout files are case-insensitive.
6802 \begin_inset Flex CharStyle:Code
6805 \begin_layout Plain Layout
6812 \begin_inset Flex CharStyle:Code
6815 \begin_layout Plain Layout
6822 \begin_inset Flex CharStyle:Code
6825 \begin_layout Plain Layout
6831 are really the same tag.
6832 The possible values are printed in brackets after the feature's name.
6833 The default value if a feature isn't specified inside a text class-description
6835 \begin_inset Flex CharStyle:Code
6838 \begin_layout Plain Layout
6847 If the argument has a data type like
6848 \begin_inset Quotes eld
6852 \begin_inset Quotes erd
6856 \begin_inset Quotes eld
6860 \begin_inset Quotes erd
6863 , the default is shown like this:
6864 \begin_inset Flex CharStyle:Code
6867 \begin_layout Plain Layout
6878 \begin_layout Subsection
6879 The Document Class Declaration
6882 \begin_layout Standard
6883 Lines in a layout file which begin with
6884 \begin_inset Flex CharStyle:Code
6887 \begin_layout Plain Layout
6894 There is one exception to this rule.
6896 \begin_inset Flex CharStyle:Code
6899 \begin_layout Plain Layout
6905 files should begin with a line like:
6908 \begin_layout LyX-Code
6911 #% Do not delete the line below; configure depends on this
6914 \begin_layout LyX-Code
6919 DeclareLaTeXClass{article}
6922 \begin_layout Standard
6923 The second line is used when you (re)configure LyX.
6924 The layout file is read by the LaTeX script
6925 \begin_inset Flex CharStyle:Code
6928 \begin_layout Plain Layout
6934 , in a special mode where
6935 \begin_inset Flex CharStyle:Code
6938 \begin_layout Plain Layout
6945 The first line is just a LaTeX comment, and the second one contains the
6946 declaration of the text class.
6947 If these lines appear in a file named
6948 \begin_inset Flex CharStyle:Code
6951 \begin_layout Plain Layout
6957 , then they define a text class of name
6958 \begin_inset Flex CharStyle:Code
6961 \begin_layout Plain Layout
6967 (the name of the layout file) which uses the LaTeX document class
6968 \begin_inset Flex CharStyle:Code
6971 \begin_layout Plain Layout
6977 (the default is to use the same name as the layout).
6979 \begin_inset Quotes eld
6983 \begin_inset Quotes erd
6986 that appears above is used as a description of the text class in the
6987 \begin_inset Flex CharStyle:MenuItem
6990 \begin_layout Plain Layout
6991 Document\SpecialChar \menuseparator
7000 \begin_layout Standard
7001 Let's assume that you wrote your own text class that uses the
7002 \begin_inset Flex CharStyle:Code
7005 \begin_layout Plain Layout
7011 document class, but where you changed the appearance of the section headings.
7012 If you put it in a file
7013 \begin_inset Flex CharStyle:Code
7016 \begin_layout Plain Layout
7022 , the header of this file should be:
7025 \begin_layout LyX-Code
7028 #% Do not delete the line below; configure depends on this
7031 \begin_layout LyX-Code
7036 DeclareLaTeXClass[article]{article (with my own headings)}
7039 \begin_layout Standard
7040 This declares a text class
7041 \begin_inset Flex CharStyle:Code
7044 \begin_layout Plain Layout
7050 , associated with the LaTeX document class
7051 \begin_inset Flex CharStyle:Code
7054 \begin_layout Plain Layout
7061 \begin_inset Quotes eld
7064 article (with my own headings)
7065 \begin_inset Quotes erd
7069 If your text class depends on several packages, you can declare it as:
7072 \begin_layout LyX-Code
7075 #% Do not delete the line below; configure depends on this
7078 \begin_layout LyX-Code
7083 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7086 \begin_layout Standard
7087 This indicates that your text class uses the
7088 \begin_inset Flex CharStyle:Code
7091 \begin_layout Plain Layout
7098 Finally, it is also possible to declare classes for DocBook code.
7099 Typical declarations will look like:
7102 \begin_layout LyX-Code
7105 #% Do not delete the line below; configure depends on this
7108 \begin_layout LyX-Code
7113 DeclareDocBookClass[article]{SGML (DocBook article)}
7116 \begin_layout Standard
7117 Note that these declarations can also be given an optional parameter declaring
7118 the name of the document class (but not a list).
7121 \begin_layout Standard
7122 So, to be as explicit as possible, the form of the layout declaration is:
7125 \begin_layout LyX-Code
7130 DeclareLaTeXClass[class,package.sty]{layout description}
7133 \begin_layout Standard
7134 The class need only be specified if the name of the LaTeX class file and
7135 the name of the layout file are different; if the name of the class file
7136 is not specified, then LyX will simply assume that it is the same as the
7137 name of the layout file.
7140 \begin_layout Standard
7141 When the text class has been modified to your taste, all you have to do
7142 is to copy it either to
7143 \begin_inset Flex CharStyle:Code
7146 \begin_layout Plain Layout
7153 \begin_inset Flex CharStyle:Code
7156 \begin_layout Plain Layout
7163 \begin_inset Flex CharStyle:MenuItem
7166 \begin_layout Plain Layout
7167 Tools\SpecialChar \menuseparator
7173 , exit LyX and restart.
7174 Then your new text class should be available along with the others.
7177 \begin_layout Standard
7178 Once the layout file is installed, you can edit it and see your changes
7179 without having to reconfigure or to restart LyX.
7184 \begin_layout Plain Layout
7185 In versions of LyX prior to 1.6, this was not true.
7186 As a result, editing layout files was very time consuming, since you had
7187 constantly to restart LyX to see changes.
7192 You can force a reload of the current layout by using the LyX function
7194 \begin_inset Flex CharStyle:MenuItem
7197 \begin_layout Plain Layout
7204 There is no default binding for this function—though, of course, you can
7205 bind it to a key yourself.
7206 But you will normally use this function simply by entering it in the mini-buffe
7211 \begin_layout Standard
7217 \begin_inset Flex CharStyle:MenuItem
7220 \begin_layout Plain Layout
7226 is very much an `advanced feature'.
7231 recommended that you save your work before using this function.
7236 recommended that you not attempt to edit layout information while simultaneousl
7237 y working on a document that you care about.
7238 Use a test document.
7239 Syntax errors and the like in your layout file could cause peculiar behavior.
7240 In particular, such errors could cause LyX to regard the current layout
7241 as invalid and to attempt to switch to some other layout.
7245 \begin_layout Plain Layout
7246 Really bad syntax errors may even caused LyX to exit.
7247 This is because certain sorts of errors may make LyX unable to read
7257 The LyX team strives to keep LyX stable in such situations, but safe is
7262 \begin_layout Plain Layout
7263 While we're giving advice: make regular backups.
7264 And be nice to your mother.
7272 \begin_layout Subsection
7273 The Module Declaration
7276 \begin_layout Standard
7277 A module must begin with a line like the following:
7280 \begin_layout LyX-Code
7283 DeclareLyXModule[endnotes.sty]{Endnotes}
7286 \begin_layout Standard
7287 The mandatory argument, in curly brackets, is the name of the module, as
7289 \begin_inset Flex CharStyle:MenuItem
7292 \begin_layout Plain Layout
7293 Document\SpecialChar \menuseparator
7300 The argument in square brackets is optional: It declares any LaTeX packages
7301 on which the module depends.
7302 Please note that only packages about which LyX knows should be listed in
7303 the square brackets.
7307 \begin_layout Plain Layout
7308 The list of such packages is documented only in the source code.
7313 LyX will not check for arbitrary packages.
7314 It is also possible to use the form
7315 \begin_inset Flex CharStyle:MenuItem
7318 \begin_layout Plain Layout
7324 as an optional argument, which declares that the module can only be used
7325 when there exists a conversion chain between the formats `
7326 \begin_inset Flex CharStyle:Code
7329 \begin_layout Plain Layout
7336 \begin_inset Flex CharStyle:Code
7339 \begin_layout Plain Layout
7348 \begin_layout Standard
7349 The module declaration should then be followed by lines like the following:
7352 \begin_layout LyX-Code
7356 \begin_layout LyX-Code
7357 #Adds an endnote command, in addition to footnotes.
7361 \begin_layout LyX-Code
7362 #You will need to add
7364 theendnotes in TeX code where you
7367 \begin_layout LyX-Code
7368 #want the endnotes to appear.
7372 \begin_layout LyX-Code
7376 \begin_layout LyX-Code
7377 #Requires: somemodule | othermodule
7380 \begin_layout LyX-Code
7381 #Excludes: badmodule
7384 \begin_layout Standard
7385 The description is used in
7386 \begin_inset Flex CharStyle:MenuItem
7389 \begin_layout Plain Layout
7390 Document\SpecialChar \menuseparator
7396 to provide the user with information about what the module does.
7398 \begin_inset Flex CharStyle:Code
7401 \begin_layout Plain Layout
7407 line is used to identify other modules with which this one must be used;
7409 \begin_inset Flex CharStyle:Code
7412 \begin_layout Plain Layout
7418 line is used to identify modules with which this one may not be used.
7419 Both are optional, and, as shown, multiple modules should be separated
7420 with the pipe symbol: |.
7421 Note that the required modules are treated disjunctively:
7425 of the required modules must be used.
7430 excluded module may be used.
7431 Note that modules are identified here by their
7436 \begin_inset Flex CharStyle:Code
7439 \begin_layout Plain Layout
7447 \begin_inset Flex CharStyle:Code
7450 \begin_layout Plain Layout
7457 \begin_inset Flex CharStyle:Code
7460 \begin_layout Plain Layout
7469 \begin_layout Subsection
7473 \begin_layout Standard
7474 The first non-comment line of any layout file, included file, or module
7479 contain the file format number:
7482 \begin_layout Description
7483 \begin_inset Flex CharStyle:Code
7486 \begin_layout Plain Layout
7493 \begin_inset Flex CharStyle:Code
7496 \begin_layout Plain Layout
7502 ] The format of the layout file.
7505 \begin_layout Standard
7506 This tag was introduced with LyX 1.4.0.
7507 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7508 and are considered to be of format 1.
7509 The format for the present version of LyX is format 21.
7510 But each version of LyX is capable of reading earlier versions' layout
7511 files, just as they are capable of reading files produced by earlier versions
7513 There is, however, no provision for converting to earlier formats.
7514 So LyX 1.6.x will not read layout files in format 21 but only files in format
7518 \begin_layout Subsection
7519 \begin_inset CommandInset label
7521 name "sub:General-text-class"
7525 General text class parameters
7528 \begin_layout Standard
7529 These are general parameters that govern the behavior of an entire document
7535 mean that they must appear in
7536 \begin_inset Flex CharStyle:Code
7539 \begin_layout Plain Layout
7545 files rather than in modules.
7546 A module can contain any layout tag.)
7549 \begin_layout Description
7550 \begin_inset Flex CharStyle:Code
7553 \begin_layout Plain Layout
7559 Adds information that will be output in the
7560 \begin_inset Flex CharStyle:Code
7563 \begin_layout Plain Layout
7569 block when this document class is output to XHTML.
7570 Typically, this would be used to output CSS style information, but it can
7571 be used for anything that can appear in
7572 \begin_inset Flex CharStyle:Code
7575 \begin_layout Plain Layout
7583 \begin_inset Quotes eld
7587 \begin_inset Flex CharStyle:Code
7590 \begin_layout Plain Layout
7597 \begin_inset Quotes erd
7603 \begin_layout Description
7604 \begin_inset Flex CharStyle:Code
7607 \begin_layout Plain Layout
7613 Adds information to the document preamble.
7615 \begin_inset Quotes eld
7619 \begin_inset Flex CharStyle:Code
7622 \begin_layout Plain Layout
7629 \begin_inset Quotes erd
7635 \begin_layout Description
7636 \begin_inset Flex CharStyle:Code
7639 \begin_layout Plain Layout
7645 Describes various global options supported by the document class.
7647 \begin_inset space ~
7651 \begin_inset CommandInset ref
7653 reference "sub:ClassOptions"
7659 \begin_inset Quotes eld
7663 \begin_inset Flex CharStyle:Code
7666 \begin_layout Plain Layout
7673 \begin_inset Quotes erd
7679 \begin_layout Description
7680 \begin_inset Flex CharStyle:Code
7683 \begin_layout Plain Layout
7690 \begin_inset Flex CharStyle:Code
7693 \begin_layout Plain Layout
7702 \begin_inset Flex CharStyle:Code
7705 \begin_layout Plain Layout
7711 ] Whether the class should
7715 to having one or two columns.
7716 Can be changed in the
7717 \begin_inset Flex CharStyle:MenuItem
7720 \begin_layout Plain Layout
7721 Document\SpecialChar \menuseparator
7730 \begin_layout Description
7731 \begin_inset Flex CharStyle:Code
7734 \begin_layout Plain Layout
7741 \begin_inset Flex CharStyle:Code
7744 \begin_layout Plain Layout
7750 ] This sequence defines the properties for a counter.
7751 If the counter does not yet exist, it is created; if it does exist, it
7754 \begin_inset Quotes eld
7758 \begin_inset Flex CharStyle:Code
7761 \begin_layout Plain Layout
7768 \begin_inset Quotes erd
7772 \begin_inset Newline newline
7776 \begin_inset space ~
7780 \begin_inset CommandInset ref
7782 reference "sub:Counters"
7786 for details on counters.
7789 \begin_layout Description
7790 \begin_inset Flex CharStyle:Code
7793 \begin_layout Plain Layout
7799 Sets the default font used to display the document.
7801 \begin_inset space ~
7805 \begin_inset CommandInset ref
7807 reference "sub:Font-description"
7811 for how to declare fonts.
7813 \begin_inset Quotes eld
7817 \begin_inset Flex CharStyle:Code
7820 \begin_layout Plain Layout
7827 \begin_inset Quotes erd
7833 \begin_layout Description
7834 \begin_inset Flex CharStyle:Code
7837 \begin_layout Plain Layout
7844 \begin_inset Flex CharStyle:Code
7847 \begin_layout Plain Layout
7853 Specifies a module to be included by default with this document class.
7854 The module should be specified by filename without the
7855 \begin_inset Flex CharStyle:Code
7858 \begin_layout Plain Layout
7865 The user can still remove the module, but it will be active at the outset.
7866 (This applies only when new files are created, or when this class is chosen
7867 for an existing document.)
7870 \begin_layout Description
7871 \begin_inset Flex CharStyle:Code
7874 \begin_layout Plain Layout
7881 \begin_inset Flex CharStyle:Code
7884 \begin_layout Plain Layout
7890 ] This is the style that will be assigned to new paragraphs, usually
7891 \begin_inset Flex CharStyle:MenuItem
7894 \begin_layout Plain Layout
7901 This will default to the first defined style if not given, but you are
7902 encouraged to use this directive.
7905 \begin_layout Description
7906 \begin_inset Flex CharStyle:Code
7909 \begin_layout Plain Layout
7916 \begin_inset Flex CharStyle:Code
7919 \begin_layout Plain Layout
7925 ] This tag indicates that the module in question—which should be specified
7926 by filename without the
7927 \begin_inset Flex CharStyle:Code
7930 \begin_layout Plain Layout
7936 extension—cannot be used with this document class.
7937 This might be used in a journal-specific layout file to prevent, say, the
7939 \begin_inset Flex CharStyle:Code
7942 \begin_layout Plain Layout
7948 module that numbers theorems by section.
7953 be used in a module.
7954 Modules have their own way of excluding other modules (see
7955 \begin_inset CommandInset ref
7957 reference "sub:Layout-modules"
7964 \begin_layout Description
7965 \begin_inset Flex CharStyle:Code
7968 \begin_layout Plain Layout
7974 Defines a new float.
7976 \begin_inset space ~
7980 \begin_inset CommandInset ref
7982 reference "sub:Floats"
7988 \begin_inset Quotes eld
7992 \begin_inset Flex CharStyle:Code
7995 \begin_layout Plain Layout
8002 \begin_inset Quotes erd
8008 \begin_layout Description
8009 \begin_inset Flex CharStyle:Code
8012 \begin_layout Plain Layout
8018 Sets the information that will be output in the
8019 \begin_inset Flex CharStyle:Code
8022 \begin_layout Plain Layout
8028 block when this document class is output to XHTML.
8029 Note that this will completely override any prior
8030 \begin_inset Flex CharStyle:Code
8033 \begin_layout Plain Layout
8040 \begin_inset Flex CharStyle:Code
8043 \begin_layout Plain Layout
8051 \begin_inset Flex CharStyle:Code
8054 \begin_layout Plain Layout
8060 if you just want to add material to the preamble.) Must end with
8061 \begin_inset Quotes eld
8065 \begin_inset Flex CharStyle:Code
8068 \begin_layout Plain Layout
8075 \begin_inset Quotes erd
8081 \begin_layout Description
8082 \begin_inset Flex CharStyle:Code
8085 \begin_layout Plain Layout
8092 \begin_inset Flex CharStyle:Code
8095 \begin_layout Plain Layout
8101 ] The layout to use for the table of contents, bibliography, and so forth,
8102 when the document is output to HTML.
8103 For articles, this should normally be Section; for books, Chapter.
8104 If it is not given, then LyX will attempt to figure out which layout to
8108 \begin_layout Description
8109 \begin_inset Flex CharStyle:Code
8112 \begin_layout Plain Layout
8119 \begin_inset Flex CharStyle:Code
8122 \begin_layout Plain Layout
8128 ] Modifies the properties of the given counter.
8129 If the counter does not exist, the section is ignored.
8131 \begin_inset Quotes eld
8135 \begin_inset Flex CharStyle:Code
8138 \begin_layout Plain Layout
8145 \begin_inset Quotes erd
8149 \begin_inset Newline newline
8153 \begin_inset space ~
8157 \begin_inset CommandInset ref
8159 reference "sub:Counters"
8163 for details on counters.
8166 \begin_layout Description
8167 \begin_inset Flex CharStyle:Code
8170 \begin_layout Plain Layout
8177 \begin_inset Flex CharStyle:Code
8180 \begin_layout Plain Layout
8186 ] Modifies the properties of the given paragraph style.
8187 If the style does not exist, the section is ignored.
8189 \begin_inset Quotes eld
8193 \begin_inset Flex CharStyle:Code
8196 \begin_layout Plain Layout
8203 \begin_inset Quotes erd
8209 \begin_layout Description
8210 \begin_inset Flex CharStyle:Code
8213 \begin_layout Plain Layout
8219 As its name implies, this command allows you to include another layout
8220 definition file within yours to avoid duplicating commands.
8221 Common examples are the standard layout files, for example,
8222 \begin_inset Flex CharStyle:Code
8225 \begin_layout Plain Layout
8231 , which contains most of the basic layouts.
8234 \begin_layout Description
8235 \begin_inset Flex CharStyle:Code
8238 \begin_layout Plain Layout
8244 This section (re-)defines the layout of an inset.
8245 It can be applied to an existing inset or to a new, user-defined inset,
8246 e.g., a new character style.
8248 \begin_inset Quotes eld
8252 \begin_inset Flex CharStyle:Code
8255 \begin_layout Plain Layout
8262 \begin_inset Quotes erd
8266 \begin_inset Newline newline
8270 \begin_inset space ~
8274 \begin_inset CommandInset ref
8276 reference "sub:Flex-insets-and"
8280 for more information.
8284 \begin_layout Description
8285 \begin_inset Flex CharStyle:Code
8288 \begin_layout Plain Layout
8295 \begin_inset Flex CharStyle:Code
8298 \begin_layout Plain Layout
8304 ] A string that indicates the width of the left margin on the screen, for
8306 \begin_inset Quotes eld
8310 \begin_inset Quotes erd
8314 (Note that this is not a `length', like
8315 \begin_inset Quotes eld
8319 \begin_inset Quotes erd
8325 \begin_layout Description
8326 \begin_inset Flex CharStyle:Code
8329 \begin_layout Plain Layout
8335 This command deletes an existing float.
8336 This is particularly useful when you want to suppress a float that has
8337 been defined in an input file.
8340 \begin_layout Description
8341 \begin_inset Flex CharStyle:Code
8344 \begin_layout Plain Layout
8350 This command deletes an existing style.
8351 This is particularly useful when you want to suppress a style that has
8352 be defined in an input file.
8355 \begin_layout Description
8356 \begin_inset Flex CharStyle:Code
8359 \begin_layout Plain Layout
8365 A string indicating the file format (as defined in the Preferences dialog)
8366 produced by this class.
8367 It is mainly useful when
8368 \begin_inset Flex CharStyle:Code
8371 \begin_layout Plain Layout
8377 is `literate' and one wants to define a new type of literate document.
8378 This string is reset to `docbook', `latex', or `literate' when the correspondin
8380 \begin_inset Flex CharStyle:Code
8383 \begin_layout Plain Layout
8389 parameter is encountered.
8392 \begin_layout Description
8393 \begin_inset Flex CharStyle:Code
8396 \begin_layout Plain Layout
8402 A string indicating what sort of output documents using this class will
8404 At present, the options are: `docbook', `latex', and `literate'.
8407 \begin_layout Description
8408 \begin_inset Flex CharStyle:Code
8411 \begin_layout Plain Layout
8420 \begin_inset Flex CharStyle:Code
8423 \begin_layout Plain Layout
8434 \begin_inset Flex CharStyle:Code
8437 \begin_layout Plain Layout
8444 \begin_inset Flex CharStyle:Code
8447 \begin_layout Plain Layout
8453 ] The default pagestyle.
8454 Can be changed in the
8455 \begin_inset Flex CharStyle:MenuItem
8458 \begin_layout Plain Layout
8459 Document\SpecialChar \menuseparator
8468 \begin_layout Description
8469 \begin_inset Flex CharStyle:Code
8472 \begin_layout Plain Layout
8478 Sets the preamble for the LaTeX document.
8479 Note that this will completely override any prior
8480 \begin_inset Flex CharStyle:Code
8483 \begin_layout Plain Layout
8490 \begin_inset Flex CharStyle:Code
8493 \begin_layout Plain Layout
8501 \begin_inset Flex CharStyle:Code
8504 \begin_layout Plain Layout
8510 if you just want to add material to the preamble.) Must end with
8511 \begin_inset Quotes eld
8515 \begin_inset Flex CharStyle:Code
8518 \begin_layout Plain Layout
8525 \begin_inset Quotes erd
8531 \begin_layout Description
8532 \begin_inset Flex CharStyle:Code
8535 \begin_layout Plain Layout
8542 \begin_inset Flex CharStyle:Code
8545 \begin_layout Plain Layout
8552 \begin_inset Flex CharStyle:Code
8555 \begin_layout Plain Layout
8564 \begin_inset Flex CharStyle:Code
8567 \begin_layout Plain Layout
8573 ] Whether the class already provides the feature
8574 \begin_inset Flex CharStyle:Code
8577 \begin_layout Plain Layout
8584 A feature is in general the name of a package (
8585 \begin_inset Flex CharStyle:Code
8588 \begin_layout Plain Layout
8595 \begin_inset Flex CharStyle:Code
8598 \begin_layout Plain Layout
8604 , \SpecialChar \ldots{}
8606 \begin_inset Flex CharStyle:Code
8609 \begin_layout Plain Layout
8616 \begin_inset Flex CharStyle:Code
8619 \begin_layout Plain Layout
8625 ,\SpecialChar \ldots{}
8626 ); the complete list of supported features is unfortunately not documented
8627 outside the LyX source code—but see
8628 \begin_inset Flex CharStyle:Code
8631 \begin_layout Plain Layout
8637 if you're interested.
8639 \begin_inset Flex CharStyle:MenuItem
8642 \begin_layout Plain Layout
8643 Help\SpecialChar \menuseparator
8649 also gives an overview of the supported packages.
8652 \begin_layout Description
8653 \begin_inset Flex CharStyle:Code
8656 \begin_layout Plain Layout
8663 \begin_inset Flex CharStyle:Code
8666 \begin_layout Plain Layout
8672 ] Indicates that this layout provides the functionality of the module mentioned,
8673 which should be specified by the filename without the
8674 \begin_inset Flex CharStyle:Code
8677 \begin_layout Plain Layout
8684 This will typically be used if the layout includes the module directly,
8685 rather than using the
8686 \begin_inset Flex CharStyle:Code
8689 \begin_layout Plain Layout
8695 tag to indicate that it ought to be used.
8696 It could also be used in a module that provided an alternate implementation
8697 of the same functionality.
8700 \begin_layout Description
8701 \begin_inset Flex CharStyle:Code
8704 \begin_layout Plain Layout
8711 \begin_inset Flex CharStyle:Code
8714 \begin_layout Plain Layout
8720 ] Whether the class requires the feature
8721 \begin_inset Flex CharStyle:Code
8724 \begin_layout Plain Layout
8731 Multiple features must be separated by commas.
8732 Note that you can only request supported features.
8734 \begin_inset Flex CharStyle:Code
8737 \begin_layout Plain Layout
8743 for a list of these.)
8746 \begin_layout Description
8747 \begin_inset Flex CharStyle:Code
8750 \begin_layout Plain Layout
8756 A string that indicates the width of the right margin on the screen, for
8758 \begin_inset Quotes eld
8762 \begin_inset Quotes erd
8768 \begin_layout Description
8769 \begin_inset Flex CharStyle:Code
8772 \begin_layout Plain Layout
8778 Sets which divisions get numbered.
8780 \begin_inset Flex CharStyle:Code
8783 \begin_layout Plain Layout
8792 \begin_layout Description
8793 \begin_inset Flex CharStyle:Code
8796 \begin_layout Plain Layout
8805 \begin_inset Flex CharStyle:Code
8808 \begin_layout Plain Layout
8819 \begin_inset Flex CharStyle:Code
8822 \begin_layout Plain Layout
8828 ] Whether the class-default should be printing on one or both sides of the
8830 Can be changed in the
8831 \begin_inset Flex CharStyle:MenuItem
8834 \begin_layout Plain Layout
8835 Document\SpecialChar \menuseparator
8844 \begin_layout Description
8845 \begin_inset Flex CharStyle:Code
8848 \begin_layout Plain Layout
8854 This sequence defines a paragraph style.
8855 If the style does not yet exist, it is created; if it does exist, its parameter
8858 \begin_inset Quotes eld
8862 \begin_inset Flex CharStyle:Code
8865 \begin_layout Plain Layout
8872 \begin_inset Quotes erd
8876 \begin_inset Newline newline
8880 \begin_inset space ~
8884 \begin_inset CommandInset ref
8886 reference "sub:Paragraph-Styles"
8890 for details on paragraph styles.
8893 \begin_layout Description
8894 \begin_inset Flex CharStyle:Code
8897 \begin_layout Plain Layout
8904 \begin_inset Flex CharStyle:Code
8907 \begin_layout Plain Layout
8913 ] The name of the command or environment to be used with
8914 \begin_inset Flex CharStyle:Code
8917 \begin_layout Plain Layout
8926 \begin_layout Description
8927 \begin_inset Flex CharStyle:Code
8930 \begin_layout Plain Layout
8937 \begin_inset Flex CharStyle:Code
8940 \begin_layout Plain Layout
8949 \begin_inset Flex CharStyle:Code
8952 \begin_layout Plain Layout
8958 ] Indicates what kind of markup is used to define the title of a document.
8960 \begin_inset Flex CharStyle:Code
8963 \begin_layout Plain Layout
8969 means that the macro with name
8970 \begin_inset Flex CharStyle:Code
8973 \begin_layout Plain Layout
8979 will be inserted after the last layout which has
8980 \begin_inset Quotes eld
8984 \begin_inset Flex CharStyle:Code
8987 \begin_layout Plain Layout
8994 \begin_inset Quotes erd
8999 \begin_inset Flex CharStyle:Code
9002 \begin_layout Plain Layout
9008 corresponds to the case where the block of paragraphs which have
9009 \begin_inset Quotes eld
9013 \begin_inset Flex CharStyle:Code
9016 \begin_layout Plain Layout
9023 \begin_inset Quotes erd
9026 should be enclosed into the
9027 \begin_inset Flex CharStyle:Code
9030 \begin_layout Plain Layout
9039 \begin_layout Description
9040 \begin_inset Flex CharStyle:Code
9043 \begin_layout Plain Layout
9049 Sets which divisions are included in the table of contents.
9051 \begin_inset Flex CharStyle:Code
9054 \begin_layout Plain Layout
9063 \begin_layout Subsection
9064 \begin_inset Flex CharStyle:Code
9067 \begin_layout Plain Layout
9074 \begin_inset CommandInset label
9076 name "sub:ClassOptions"
9083 \begin_layout Standard
9085 \begin_inset Flex CharStyle:Code
9088 \begin_layout Plain Layout
9094 section can contain the following entries:
9097 \begin_layout Description
9098 \begin_inset Flex CharStyle:Code
9101 \begin_layout Plain Layout
9108 \begin_inset Flex CharStyle:Code
9111 \begin_layout Plain Layout
9117 ] The list of available font sizes for the document's main font, separated
9119 \begin_inset Quotes eld
9123 \begin_inset Flex CharStyle:Code
9126 \begin_layout Plain Layout
9133 \begin_inset Quotes erd
9139 \begin_layout Description
9140 \begin_inset Flex CharStyle:Code
9143 \begin_layout Plain Layout
9149 Used to set the DTD line with XML-based output classes.
9151 \begin_inset space \thinspace{}
9155 \begin_inset Quotes eld
9158 -//OASIS//DTD DocBook V4.2//EN
9159 \begin_inset Quotes erd
9165 \begin_layout Description
9166 \begin_inset Flex CharStyle:Code
9169 \begin_layout Plain Layout
9176 \begin_inset Flex CharStyle:Code
9179 \begin_layout Plain Layout
9180 string="empty|plain|headings|fancy"
9185 ] The list of available page styles, separated by
9186 \begin_inset Quotes eld
9190 \begin_inset Flex CharStyle:Code
9193 \begin_layout Plain Layout
9200 \begin_inset Quotes erd
9206 \begin_layout Description
9207 \begin_inset Flex CharStyle:Code
9210 \begin_layout Plain Layout
9217 \begin_inset Flex CharStyle:Code
9220 \begin_layout Plain Layout
9226 ] Some document class options, separated by a comma, that will be added
9227 to the optional part of the
9228 \begin_inset Flex CharStyle:Code
9231 \begin_layout Plain Layout
9242 \begin_layout Standard
9244 \begin_inset Flex CharStyle:Code
9247 \begin_layout Plain Layout
9253 section must end with
9254 \begin_inset Quotes eld
9258 \begin_inset Flex CharStyle:Code
9261 \begin_layout Plain Layout
9268 \begin_inset Quotes erd
9274 \begin_layout Subsection
9276 \begin_inset CommandInset label
9278 name "sub:Paragraph-Styles"
9285 \begin_layout Standard
9286 A paragraph style description looks like this:
9290 \begin_layout Plain Layout
9291 Note that this will either define a new layout or modify an existing one.
9299 \begin_layout LyX-Code
9306 \begin_layout LyX-Code
9310 \begin_layout LyX-Code
9314 \begin_layout Standard
9315 where the following commands are allowed:
9318 \begin_layout Description
9319 \begin_inset Flex CharStyle:Code
9322 \begin_layout Plain Layout
9329 \begin_inset Flex CharStyle:Code
9332 \begin_layout Plain Layout
9337 , left, right, center
9342 ] Paragraph alignment.
9345 \begin_layout Description
9346 \begin_inset Flex CharStyle:Code
9349 \begin_layout Plain Layout
9356 \begin_inset Flex CharStyle:Code
9359 \begin_layout Plain Layout
9364 , left, right, center
9369 ] A comma separated list of permitted alignments.
9370 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9372 For example a right-aligned or centered enumeration isn't possible.)
9375 \begin_layout Description
9376 \begin_inset Flex CharStyle:Code
9379 \begin_layout Plain Layout
9385 Language dependent information to be included in the LaTeX preamble when
9387 Note that this will completely override any prior
9388 \begin_inset Flex CharStyle:Code
9391 \begin_layout Plain Layout
9399 \begin_inset Quotes eld
9403 \begin_inset Flex CharStyle:Code
9406 \begin_layout Plain Layout
9413 \begin_inset Quotes erd
9417 The contents of this tag will occur once in the LaTeX preamble for each
9418 language used by the document.
9419 Each time, the following substitutions are made:
9423 \begin_layout Itemize
9424 \begin_inset Flex CharStyle:Code
9427 \begin_layout Plain Layout
9433 is replaced by the language name (as used by the babel package).
9436 \begin_layout Itemize
9438 \begin_inset Quotes eld
9442 \begin_inset Quotes erd
9446 \begin_inset Flex CharStyle:Code
9449 \begin_layout Plain Layout
9455 replaces its argument by the translation of the argument to the current
9459 \begin_layout Standard
9460 This preamble snippet will only be used if the document contains more than
9461 one language and the babel package is used.
9465 \begin_layout Description
9466 \begin_inset Flex CharStyle:Code
9469 \begin_layout Plain Layout
9476 \begin_inset Flex CharStyle:Code
9479 \begin_layout Plain Layout
9489 \begin_layout Plain Layout
9490 Note that a `float' here is a real number, such as: 1.5.
9495 The vertical space with which the last of a chain of paragraphs with this
9496 layout is separated from the following paragraph.
9497 If the next paragraph has another layout, the separations are not simply
9498 added, but the maximum is taken.
9501 \begin_layout Description
9502 \begin_inset Flex CharStyle:Code
9505 \begin_layout Plain Layout
9512 \begin_inset Flex CharStyle:Code
9515 \begin_layout Plain Layout
9521 The category for this style.
9522 This is used to group related styles in the Layout combobox on the toolbar.
9523 Any string can be used, but you may want to use existing categories with
9528 \begin_layout Description
9529 \begin_inset Flex CharStyle:Code
9532 \begin_layout Plain Layout
9538 Depth of XML command.
9539 Used only with XML-type formats.
9542 \begin_layout Description
9543 \begin_inset Flex CharStyle:Code
9546 \begin_layout Plain Layout
9553 \begin_inset CommandInset label
9555 name "des:CopyStyle"
9560 \begin_inset Flex CharStyle:Code
9563 \begin_layout Plain Layout
9569 Copies all the features of an existing style into the current one.
9573 \begin_layout Description
9574 \begin_inset Flex CharStyle:Code
9577 \begin_layout Plain Layout
9583 The name of a style whose preamble should be output
9588 This allows to ensure some ordering of the preamble snippets when macros
9589 definitions depend on one another.
9593 \begin_layout Plain Layout
9594 Note that, besides that functionality, there is no way to ensure any ordering
9596 The ordering that you see in a given version of LyX may change without
9597 warning in later versions.
9605 \begin_layout Description
9606 \begin_inset Flex CharStyle:Code
9609 \begin_layout Plain Layout
9616 \begin_inset Flex CharStyle:Code
9619 \begin_layout Plain Layout
9624 , Box, Filled_Box, Static
9629 ] The type of label that stands at the end of the paragraph (or sequence
9631 \begin_inset Flex CharStyle:Code
9634 \begin_layout Plain Layout
9641 \begin_inset Flex CharStyle:Code
9644 \begin_layout Plain Layout
9651 \begin_inset Flex CharStyle:Code
9654 \begin_layout Plain Layout
9661 \begin_inset Flex CharStyle:Code
9664 \begin_layout Plain Layout
9672 \begin_inset Flex CharStyle:Code
9675 \begin_layout Plain Layout
9682 \begin_inset Quotes eld
9686 \begin_inset Quotes erd
9690 \begin_inset Flex CharStyle:Code
9693 \begin_layout Plain Layout
9700 \begin_inset Flex CharStyle:Code
9703 \begin_layout Plain Layout
9704 \begin_inset space ~
9713 \begin_inset space ~
9716 black) square suitable for end of proof markers,
9717 \begin_inset Flex CharStyle:Code
9720 \begin_layout Plain Layout
9726 is an explicit text string.
9729 \begin_layout Description
9730 \begin_inset Flex CharStyle:Code
9733 \begin_layout Plain Layout
9740 \begin_inset Flex CharStyle:Code
9743 \begin_layout Plain Layout
9749 ] The string used for a label with a
9750 \begin_inset Flex CharStyle:Code
9753 \begin_layout Plain Layout
9760 \begin_inset Flex CharStyle:Code
9763 \begin_layout Plain Layout
9773 \begin_layout Description
9774 \begin_inset Flex CharStyle:Code
9777 \begin_layout Plain Layout
9784 \begin_inset Flex CharStyle:Code
9787 \begin_layout Plain Layout
9798 \begin_inset Flex CharStyle:Code
9801 \begin_layout Plain Layout
9810 \begin_layout Description
9811 \begin_inset Flex CharStyle:Code
9814 \begin_layout Plain Layout
9821 \begin_inset Flex CharStyle:Code
9824 \begin_layout Plain Layout
9834 ] With this parameter the
9835 \begin_inset Flex CharStyle:MenuItem
9838 \begin_layout Plain Layout
9845 \begin_inset Quotes eld
9848 Vertical space above
9849 \begin_inset Quotes erd
9853 \begin_inset Flex CharStyle:MenuItem
9856 \begin_layout Plain Layout
9857 Edit\SpecialChar \menuseparator
9859 \begin_inset space ~
9867 dialog can be set when initializing a paragraph with this style.
9871 \begin_layout Plain Layout
9874 Note from Jean-Marc:
9876 I'm not sure that this setting has much use, and it should probably be
9877 removed in later versions.
9885 \begin_layout Description
9886 \begin_inset Flex CharStyle:Code
9889 \begin_layout Plain Layout
9895 The font used for both the text body
9901 \begin_inset space ~
9905 \begin_inset CommandInset ref
9907 reference "sub:Font-description"
9912 Note that defining this font automatically defines the
9913 \begin_inset Flex CharStyle:Code
9916 \begin_layout Plain Layout
9923 So you should define this one first if you also want to define
9924 \begin_inset Flex CharStyle:Code
9927 \begin_layout Plain Layout
9936 \begin_layout Description
9937 \begin_inset Flex CharStyle:Code
9940 \begin_layout Plain Layout
9947 \begin_inset CommandInset label
9949 name "des:FreeSpacing"
9956 \begin_inset Flex CharStyle:Code
9959 \begin_layout Plain Layout
9970 \begin_inset Flex CharStyle:Code
9973 \begin_layout Plain Layout
9979 ] Usually LyX doesn't allow you to insert more than one space between words,
9980 since a space is considered as the separation between two words, not a
9981 character or symbol of its own.
9982 This is a very fine thing but sometimes annoying, for example, when typing
9983 program code or plain LaTeX code.
9985 \begin_inset Flex CharStyle:Code
9988 \begin_layout Plain Layout
9995 Note that LyX will create protected blanks for the additional blanks when
9996 in another mode than LaTeX-mode.
9999 \begin_layout Description
10000 \begin_inset Flex CharStyle:Code
10003 \begin_layout Plain Layout
10009 These tags are used with XHTML output.
10011 \begin_inset CommandInset ref
10012 LatexCommand prettyref
10013 reference "sub:Paragraph-Style-XHTML"
10020 \begin_layout Description
10021 \begin_inset Flex CharStyle:Code
10024 \begin_layout Plain Layout
10030 [[FIXME]] (Used only with XML-type formats.)
10033 \begin_layout Description
10034 \begin_inset Flex CharStyle:Code
10037 \begin_layout Plain Layout
10044 \begin_inset Flex CharStyle:Code
10047 \begin_layout Plain Layout
10053 If 1, marks the layout as to be included in the document preamble rather
10054 than in the document body.
10055 This is useful for document classes that want such information as the title
10056 and author to appear in the preamble.
10059 \begin_layout Description
10060 \begin_inset Flex CharStyle:Code
10063 \begin_layout Plain Layout
10070 \begin_inset Flex CharStyle:Code
10073 \begin_layout Plain Layout
10079 If 1, marks the layout as being part of a title block (see also the
10080 \begin_inset Flex CharStyle:Code
10083 \begin_layout Plain Layout
10090 \begin_inset Flex CharStyle:Code
10093 \begin_layout Plain Layout
10102 \begin_layout Description
10103 \begin_inset Flex CharStyle:Code
10106 \begin_layout Plain Layout
10113 \begin_inset Flex CharStyle:Code
10116 \begin_layout Plain Layout
10122 ] This provides extra space between paragraphs that have the same layout.
10123 If you put other layouts into an environment, each is separated with the
10125 \begin_inset Flex CharStyle:Code
10128 \begin_layout Plain Layout
10135 But the whole items of the environment are additionally separated with
10137 \begin_inset Flex CharStyle:Code
10140 \begin_layout Plain Layout
10147 Note that this is a
10152 \begin_layout Description
10153 \begin_inset Flex CharStyle:Code
10156 \begin_layout Plain Layout
10162 [[FIXME]] (Used only with XML-type formats.)
10165 \begin_layout Description
10166 \begin_inset Flex CharStyle:Code
10169 \begin_layout Plain Layout
10176 \begin_inset CommandInset label
10178 name "des:KeepEmpty"
10185 \begin_inset Flex CharStyle:Code
10188 \begin_layout Plain Layout
10199 \begin_inset Flex CharStyle:Code
10202 \begin_layout Plain Layout
10208 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10209 lead to empty LaTeX output.
10210 There are some cases where this could be desirable however: in a letter
10211 template, the required fields can be provided as empty fields, so that
10212 people do not forget them; in some special classes, a layout can be used
10213 as some kind of break, which does not contain actual text.
10216 \begin_layout Description
10217 \begin_inset Flex CharStyle:Code
10220 \begin_layout Plain Layout
10226 [float=0] The vertical space between the label and the text body.
10227 Only used for labels that are above the text body (
10228 \begin_inset Flex CharStyle:Code
10231 \begin_layout Plain Layout
10238 \begin_inset Flex CharStyle:Code
10241 \begin_layout Plain Layout
10242 Centered_Top_Environment
10250 \begin_layout Description
10251 \begin_inset Flex CharStyle:Code
10254 \begin_layout Plain Layout
10261 \begin_inset Flex CharStyle:Code
10264 \begin_layout Plain Layout
10271 \begin_inset Newline newline
10274 The name of the counter for automatic numbering.
10276 \begin_inset Newline newline
10284 \begin_inset Flex CharStyle:Code
10287 \begin_layout Plain Layout
10294 \begin_inset Flex CharStyle:Code
10297 \begin_layout Plain Layout
10304 In that case, the counter will be stepped each time the layout appears.
10306 \begin_inset Newline newline
10314 \begin_inset Flex CharStyle:Code
10317 \begin_layout Plain Layout
10324 \begin_inset Flex CharStyle:Code
10327 \begin_layout Plain Layout
10333 , though this case is a bit complicated.
10334 Suppose you declare
10335 \begin_inset Quotes eld
10339 \begin_inset Flex CharStyle:Code
10342 \begin_layout Plain Layout
10343 LabelCounter myenum
10349 \begin_inset Quotes erd
10353 Then the actual counters used are
10354 \begin_inset Flex CharStyle:Code
10357 \begin_layout Plain Layout
10364 \begin_inset Flex CharStyle:Code
10367 \begin_layout Plain Layout
10374 \begin_inset Flex CharStyle:Code
10377 \begin_layout Plain Layout
10384 \begin_inset Flex CharStyle:Code
10387 \begin_layout Plain Layout
10393 , much as in LaTeX.
10394 These counters must all be declared separately.
10395 \begin_inset Newline newline
10399 \begin_inset CommandInset ref
10401 reference "sub:Counters"
10405 for details on counters.
10408 \begin_layout Description
10409 \begin_inset Flex CharStyle:Code
10412 \begin_layout Plain Layout
10418 The font used for the label.
10420 \begin_inset space ~
10424 \begin_inset CommandInset ref
10426 reference "sub:Font-description"
10433 \begin_layout Description
10434 \begin_inset Flex CharStyle:Code
10437 \begin_layout Plain Layout
10443 Text that indicates how far a label should be indented.
10446 \begin_layout Description
10447 \begin_inset Flex CharStyle:Code
10450 \begin_layout Plain Layout
10457 \begin_inset Flex CharStyle:Code
10460 \begin_layout Plain Layout
10466 ] The horizontal space between the label and the text body.
10467 Only used for labels that are not above the text body.
10470 \begin_layout Description
10471 \begin_inset Flex CharStyle:Code
10474 \begin_layout Plain Layout
10481 \begin_inset Flex CharStyle:Code
10484 \begin_layout Plain Layout
10490 ] The string used for a label with a
10491 \begin_inset Flex CharStyle:Code
10494 \begin_layout Plain Layout
10502 \begin_inset Flex CharStyle:Code
10505 \begin_layout Plain Layout
10511 is set, this string can be contain the special formatting commands described
10513 \begin_inset CommandInset ref
10515 reference "sub:Counters"
10523 \begin_layout Plain Layout
10524 For the sake of backwards compatibility, the string
10525 \begin_inset Flex CharStyle:Code
10528 \begin_layout Plain Layout
10538 will be replaced by the expanded
10539 \begin_inset Flex CharStyle:Code
10542 \begin_layout Plain Layout
10549 \begin_inset Flex CharStyle:Code
10552 \begin_layout Plain Layout
10561 This feature is now obsolete and should be replaced by the mechanisms of
10563 \begin_inset CommandInset ref
10565 reference "sub:Counters"
10577 \begin_layout Description
10578 \begin_inset Flex CharStyle:Code
10581 \begin_layout Plain Layout
10582 LabelStringAppendix
10588 \begin_inset Flex CharStyle:Code
10591 \begin_layout Plain Layout
10597 ] This is used inside the appendix instead of
10598 \begin_inset Flex CharStyle:Code
10601 \begin_layout Plain Layout
10609 \begin_inset Flex CharStyle:Code
10612 \begin_layout Plain Layout
10619 \begin_inset Flex CharStyle:Code
10622 \begin_layout Plain Layout
10623 LabelStringAppendix
10631 \begin_layout Description
10632 \begin_inset Flex CharStyle:Code
10635 \begin_layout Plain Layout
10641 [FIXME] (Used only with XML-type formats.)
10644 \begin_layout Description
10645 \begin_inset Flex CharStyle:Code
10648 \begin_layout Plain Layout
10655 \begin_inset Flex CharStyle:Code
10658 \begin_layout Plain Layout
10663 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10664 Enumerate, Itemize, Bibliography
10673 \begin_layout Itemize
10674 \begin_inset Flex CharStyle:Code
10677 \begin_layout Plain Layout
10683 means the label is the very first word (up to the first real blank).
10684 Use protected spaces (like
10685 \begin_inset space ~
10688 that one) if you want more than one word as the label.
10692 \begin_layout Itemize
10693 \begin_inset Flex CharStyle:Code
10696 \begin_layout Plain Layout
10702 means the label is simply whatever
10703 \begin_inset Flex CharStyle:Code
10706 \begin_layout Plain Layout
10713 Note that this really is `static'.
10716 \begin_layout Itemize
10717 \begin_inset Flex CharStyle:Code
10720 \begin_layout Plain Layout
10727 \begin_inset Flex CharStyle:Code
10730 \begin_layout Plain Layout
10731 Centered_Top_Environment
10736 are special cases of
10737 \begin_inset Flex CharStyle:Code
10740 \begin_layout Plain Layout
10747 The label will be printed above the paragraph, but only at the top of an
10748 environment or the top of a chain of paragraphs with this layout.
10749 This might be used with the
10750 \begin_inset Flex CharStyle:MenuItem
10753 \begin_layout Plain Layout
10759 layout, for example.
10762 \begin_layout Itemize
10763 \begin_inset Flex CharStyle:Code
10766 \begin_layout Plain Layout
10772 is a special case for the caption-labels
10773 \begin_inset Quotes eld
10777 \begin_inset Quotes erd
10781 \begin_inset Quotes eld
10785 \begin_inset Quotes erd
10790 \begin_inset Flex CharStyle:Code
10793 \begin_layout Plain Layout
10799 means the (hardcoded) label string depends on the kind of float: It is
10800 hardcoded to be `FloatType N', where N is the value of the counter associated
10804 \begin_layout Itemize
10806 \begin_inset Flex CharStyle:Code
10809 \begin_layout Plain Layout
10815 label type defines automatically numbered labels.
10817 \begin_inset Flex CharStyle:Code
10820 \begin_layout Plain Layout
10826 will be expanded to resolve any counter references it contains: For example,
10828 \begin_inset Quotes eld
10832 \begin_inset Flex CharStyle:Code
10835 \begin_layout Plain Layout
10846 \begin_inset Quotes erd
10851 \begin_inset CommandInset ref
10853 reference "sub:Counters"
10857 for more information on counters.
10860 \begin_layout Itemize
10861 \begin_inset Flex CharStyle:Code
10864 \begin_layout Plain Layout
10870 produces the usual sort of enumeration labels.
10871 At present, it is hardcoded to use Arabic numerals, lowercase letters,
10872 small Roman numerals, and uppercase letters for the four possible depths.
10875 \begin_layout Itemize
10876 \begin_inset Flex CharStyle:Code
10879 \begin_layout Plain Layout
10885 produces various bullets at the different levels.
10886 It is also hardcoded.
10889 \begin_layout Itemize
10890 \begin_inset Flex CharStyle:Code
10893 \begin_layout Plain Layout
10899 is used internally by LyX and should be used only with
10900 \begin_inset Flex CharStyle:Code
10903 \begin_layout Plain Layout
10904 LatexType BibEnvironment
10913 \begin_layout Description
10914 \begin_inset Flex CharStyle:Code
10917 \begin_layout Plain Layout
10924 \begin_inset Flex CharStyle:Code
10927 \begin_layout Plain Layout
10933 , but this preamble snippet occurs independently from the babel package,
10934 and only for the document language.
10936 \begin_inset Quotes eld
10940 \begin_inset Flex CharStyle:Code
10943 \begin_layout Plain Layout
10950 \begin_inset Quotes erd
10957 \begin_layout Standard
10958 If the style defines text that appears in the typeset document, it may use
10960 \begin_inset Flex CharStyle:Code
10963 \begin_layout Plain Layout
10970 \begin_inset Flex CharStyle:Code
10973 \begin_layout Plain Layout
10979 to support non-english and even multilanguage documents correctly.
10980 The following excerpt (from the
10981 \begin_inset Flex CharStyle:Code
10984 \begin_layout Plain Layout
10990 file) shows how this works:
10993 \begin_layout LyX-Code
10997 \begin_layout LyX-Code
11000 theoremstyle{remark}
11003 \begin_layout LyX-Code
11006 newtheorem{claim}[thm]{
11013 \begin_layout LyX-Code
11017 \begin_layout LyX-Code
11021 \begin_layout LyX-Code
11026 claimname}{_(Claim)}
11029 \begin_layout LyX-Code
11033 \begin_layout LyX-Code
11037 \begin_layout LyX-Code
11041 \begin_layout LyX-Code
11050 claimname}{_(Claim)}}
11053 \begin_layout LyX-Code
11057 \begin_layout Standard
11058 The key to correct translation of the user visible text is the definition
11060 \begin_inset Flex CharStyle:Code
11063 \begin_layout Plain Layout
11071 in the language preamble.
11072 This command holds the name of the theorem that will appear in the output.
11074 \begin_inset Flex CharStyle:Code
11077 \begin_layout Plain Layout
11083 then uses the commands offered by the babel package to redefine
11084 \begin_inset Flex CharStyle:Code
11087 \begin_layout Plain Layout
11095 for each used language in multilanguage documents.
11099 \begin_layout Description
11100 \begin_inset Flex CharStyle:Code
11103 \begin_layout Plain Layout
11109 The name of the corresponding LaTeX stuff.
11110 Either the environment or command name.
11113 \begin_layout Description
11114 \begin_inset Flex CharStyle:Code
11117 \begin_layout Plain Layout
11123 An optional parameter for the corresponding
11124 \begin_inset Flex CharStyle:Code
11127 \begin_layout Plain Layout
11134 This parameter cannot be changed from within LyX.
11137 \begin_layout Description
11138 \begin_inset Flex CharStyle:Code
11141 \begin_layout Plain Layout
11148 \begin_inset CommandInset label
11150 name "des:LatexType"
11155 \begin_inset Flex CharStyle:Code
11158 \begin_layout Plain Layout
11163 , Command, Environment, Item_Environment,
11169 \begin_inset Flex CharStyle:Code
11172 \begin_layout Plain Layout
11173 List_Environment, Bib_Environment
11178 ] How the layout should be translated into LaTeX.
11182 \begin_layout Plain Layout
11183 \begin_inset Flex CharStyle:Code
11186 \begin_layout Plain Layout
11192 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11193 Visit the SGML class files for specific examples.
11202 \begin_layout Itemize
11203 \begin_inset Flex CharStyle:Code
11206 \begin_layout Plain Layout
11212 means nothing special.
11216 \begin_layout Itemize
11217 \begin_inset Flex CharStyle:Code
11220 \begin_layout Plain Layout
11227 \begin_inset Flex CharStyle:Code
11230 \begin_layout Plain Layout
11237 {\SpecialChar \ldots{}
11246 \begin_layout Itemize
11247 \begin_inset Flex CharStyle:Code
11250 \begin_layout Plain Layout
11257 \begin_inset Flex CharStyle:Code
11260 \begin_layout Plain Layout
11267 }\SpecialChar \ldots{}
11283 \begin_layout Itemize
11284 \begin_inset Flex CharStyle:Code
11287 \begin_layout Plain Layout
11294 \begin_inset Flex CharStyle:Code
11297 \begin_layout Plain Layout
11304 \begin_inset Flex CharStyle:Code
11307 \begin_layout Plain Layout
11315 is generated for each paragraph of this environment.
11319 \begin_layout Itemize
11320 \begin_inset Flex CharStyle:Code
11323 \begin_layout Plain Layout
11330 \begin_inset Flex CharStyle:Code
11333 \begin_layout Plain Layout
11340 \begin_inset Flex CharStyle:Code
11343 \begin_layout Plain Layout
11349 is passed as an argument to the environment.
11351 \begin_inset Flex CharStyle:Code
11354 \begin_layout Plain Layout
11360 can be defined in the
11361 \begin_inset Flex CharStyle:MenuItem
11364 \begin_layout Plain Layout
11369 ayout\SpecialChar \menuseparator
11383 \begin_layout Standard
11384 Putting the last few things together, the LaTeX output will be either:
11387 \begin_layout LyX-Code
11390 latexname[latexparam]{\SpecialChar \ldots{}
11394 \begin_layout Standard
11398 \begin_layout LyX-Code
11401 begin{latexname}[latexparam] \SpecialChar \ldots{}
11407 \begin_layout Standard
11408 depending upon the LaTeX type.
11412 \begin_layout Description
11413 \begin_inset Flex CharStyle:Code
11416 \begin_layout Plain Layout
11423 \begin_inset Flex CharStyle:Code
11426 \begin_layout Plain Layout
11432 ] If you put layouts into environments, the leftmargins are not simply added,
11433 but added with a factor
11434 \begin_inset Formula $\frac{4}{depth+4}$
11438 Note that this parameter is also used when the margin is defined as
11439 \begin_inset Flex CharStyle:Code
11442 \begin_layout Plain Layout
11449 \begin_inset Flex CharStyle:Code
11452 \begin_layout Plain Layout
11459 Then it is added to the manual or dynamic margin.
11461 \begin_inset Newline newline
11464 The argument is passed as a string.
11466 \begin_inset Quotes eld
11470 \begin_inset Flex CharStyle:Code
11473 \begin_layout Plain Layout
11480 \begin_inset Quotes erd
11483 means that the paragraph is indented with the width of
11484 \begin_inset Quotes eld
11488 \begin_inset Flex CharStyle:Code
11491 \begin_layout Plain Layout
11498 \begin_inset Quotes erd
11501 in the normal font.
11502 You can get a negative width by prefixing the string with
11503 \begin_inset Quotes eld
11507 \begin_inset Flex CharStyle:Code
11510 \begin_layout Plain Layout
11517 \begin_inset Quotes erd
11521 This way was chosen so that the look is the same with each used screen
11526 \begin_layout Description
11527 \begin_inset Flex CharStyle:Code
11530 \begin_layout Plain Layout
11537 \begin_inset Flex CharStyle:Code
11540 \begin_layout Plain Layout
11545 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11551 \begin_inset Newline newline
11554 The kind of margin that the layout has on the left side.
11556 \begin_inset Flex CharStyle:Code
11559 \begin_layout Plain Layout
11565 just means a fixed margin.
11567 \begin_inset Flex CharStyle:Code
11570 \begin_layout Plain Layout
11576 means that the left margin depends on the string entered in the
11577 \begin_inset Flex CharStyle:MenuItem
11580 \begin_layout Plain Layout
11581 Edit\SpecialChar \menuseparator
11583 \begin_inset space ~
11592 This is used to typeset nice lists without tabulators.
11594 \begin_inset Flex CharStyle:Code
11597 \begin_layout Plain Layout
11603 means that the margin depends on the size of the label.
11604 This is used for automatic enumerated headlines.
11605 It is obvious that the headline
11606 \begin_inset Quotes eld
11609 5.4.3.2.1 Very long headline
11610 \begin_inset Quotes erd
11613 must have a wider left margin (as wide as
11614 \begin_inset Quotes eld
11618 \begin_inset Quotes erd
11621 plus the space) than
11622 \begin_inset Quotes eld
11625 3.2 Very long headline
11626 \begin_inset Quotes erd
11630 \begin_inset Quotes eld
11634 \begin_inset Quotes erd
11637 are not able to do this.
11639 \begin_inset Flex CharStyle:Code
11642 \begin_layout Plain Layout
11648 is similar, but only the very first row of the paragraph is dynamic, while
11649 the others are static; this is used, for example, for descriptions.
11651 \begin_inset Flex CharStyle:Code
11654 \begin_layout Plain Layout
11660 means the margin is chosen in a way that the longest row of this paragraph
11661 fits to the right margin.
11662 This is used to typeset an address on the right edge of the page.
11665 \begin_layout Description
11666 \begin_inset Flex CharStyle:Code
11669 \begin_layout Plain Layout
11676 \begin_inset Flex CharStyle:Code
11679 \begin_layout Plain Layout
11688 \begin_inset Flex CharStyle:Code
11691 \begin_layout Plain Layout
11697 ] Whether fragile commands in this layout should be
11698 \begin_inset Flex CharStyle:Code
11701 \begin_layout Plain Layout
11714 whether this command should itself be protected.)
11717 \begin_layout Description
11718 \begin_inset Flex CharStyle:Code
11721 \begin_layout Plain Layout
11728 \begin_inset Flex CharStyle:Code
11731 \begin_layout Plain Layout
11738 \begin_inset Flex CharStyle:Code
11741 \begin_layout Plain Layout
11749 ] Whether newlines are translated into LaTeX newlines (
11750 \begin_inset Flex CharStyle:Code
11753 \begin_layout Plain Layout
11764 The translation can be switched off to allow more comfortable LaTeX editing
11768 \begin_layout Description
11769 \begin_inset Flex CharStyle:Code
11772 \begin_layout Plain Layout
11779 \begin_inset Flex CharStyle:Code
11782 \begin_layout Plain Layout
11789 \begin_inset Flex CharStyle:Code
11792 \begin_layout Plain Layout
11800 ] Whether the following Paragraph is allowed to indent its very first row.
11802 \begin_inset Flex CharStyle:Code
11805 \begin_layout Plain Layout
11811 means that it is not allowed to do so;
11812 \begin_inset Flex CharStyle:Code
11815 \begin_layout Plain Layout
11821 means it could do so if it wants to.
11824 \begin_layout Description
11825 \begin_inset Flex CharStyle:Code
11828 \begin_layout Plain Layout
11834 Name of a layout that has replaced this layout.
11835 This is used to rename a layout, while keeping backward compatibility.
11838 \begin_layout Description
11839 \begin_inset Flex CharStyle:Code
11842 \begin_layout Plain Layout
11849 \begin_inset Flex CharStyle:Code
11852 \begin_layout Plain Layout
11858 ] The number of optional arguments that can be used with this layout.
11859 This is useful for things like section headings, and only makes sense with
11863 \begin_layout Description
11864 \begin_inset Flex CharStyle:Code
11867 \begin_layout Plain Layout
11874 \begin_inset Flex CharStyle:Code
11877 \begin_layout Plain Layout
11883 ] The indent of the very first line of a paragraph.
11885 \begin_inset Flex CharStyle:Code
11888 \begin_layout Plain Layout
11894 will be fixed for a certain layout.
11895 The exception is Standard layout, since the indentation of a Standard layout
11896 paragraph can be prohibited with
11897 \begin_inset Flex CharStyle:Code
11900 \begin_layout Plain Layout
11907 Also, Standard layout paragraphs inside environments use the
11908 \begin_inset Flex CharStyle:Code
11911 \begin_layout Plain Layout
11917 of the environment, not their native one.
11918 For example, Standard paragraphs inside an enumeration are not indented.
11921 \begin_layout Description
11922 \begin_inset Flex CharStyle:Code
11925 \begin_layout Plain Layout
11932 \begin_inset Flex CharStyle:Code
11935 \begin_layout Plain Layout
11941 ] The vertical space between two paragraphs of this layout.
11944 \begin_layout Description
11945 \begin_inset Flex CharStyle:Code
11948 \begin_layout Plain Layout
11955 \begin_inset Flex CharStyle:Code
11958 \begin_layout Plain Layout
11964 ] LyX allows the user to choose either
11965 \begin_inset Quotes eld
11969 \begin_inset Quotes erd
11973 \begin_inset Quotes eld
11977 \begin_inset Quotes erd
11980 to typeset a document.
11982 \begin_inset Quotes eld
11986 \begin_inset Quotes erd
11989 is chosen, this value is completely ignored.
11991 \begin_inset Quotes eld
11995 \begin_inset Quotes erd
11998 is chosen, the parindent of a LaTeXtype
11999 \begin_inset Quotes eld
12003 \begin_inset Quotes erd
12006 layout is ignored and all paragraphs are separated by this parskip argument.
12007 The vertical space is calculated with
12008 \begin_inset Flex CharStyle:Code
12011 \begin_layout Plain Layout
12013 \begin_inset space ~
12022 \begin_inset Flex CharStyle:Code
12025 \begin_layout Plain Layout
12031 is the height of a row with the normal font.
12032 This way, the look stays the same with different screen fonts.
12035 \begin_layout Description
12036 \begin_inset Flex CharStyle:Code
12039 \begin_layout Plain Layout
12046 \begin_inset CommandInset label
12048 name "des:PathThru"
12055 \begin_inset Flex CharStyle:Code
12058 \begin_layout Plain Layout
12069 \begin_inset Flex CharStyle:Code
12072 \begin_layout Plain Layout
12078 ] Whether the contents of this paragraph should be output in raw form, meaning
12079 without special translations that LaTeX would require.
12082 \begin_layout Description
12083 \begin_inset Flex CharStyle:Code
12086 \begin_layout Plain Layout
12093 \begin_inset CommandInset label
12095 name "des:Preamble"
12099 Information to be included in the LaTeX preamble when this style is used.
12100 Used to define macros, load packages, etc., required by this particular
12103 \begin_inset Quotes eld
12107 \begin_inset Flex CharStyle:Code
12110 \begin_layout Plain Layout
12117 \begin_inset Quotes erd
12123 \begin_layout Description
12124 \begin_inset Flex CharStyle:Code
12127 \begin_layout Plain Layout
12134 \begin_inset Flex CharStyle:Code
12137 \begin_layout Plain Layout
12144 \begin_inset CommandInset label
12146 name "des:Requires"
12150 Whether the layout requires the feature
12151 \begin_inset Flex CharStyle:Code
12154 \begin_layout Plain Layout
12161 See the description of
12162 \begin_inset Flex CharStyle:Code
12165 \begin_layout Plain Layout
12172 \begin_inset CommandInset ref
12173 LatexCommand pageref
12174 reference "des:FreeSpacing"
12178 ) for information on `features'.
12182 \begin_layout Description
12183 \begin_inset Flex CharStyle:Code
12186 \begin_layout Plain Layout
12193 \begin_inset Flex CharStyle:Code
12196 \begin_layout Plain Layout
12203 \begin_inset Flex CharStyle:Code
12206 \begin_layout Plain Layout
12215 \begin_layout Description
12216 \begin_inset Flex CharStyle:Code
12219 \begin_layout Plain Layout
12226 \begin_inset Flex CharStyle:Code
12229 \begin_layout Plain Layout
12234 , onehalf, double, other
12243 ] This defines what the default spacing should be in the layout.
12245 \begin_inset Flex CharStyle:Code
12248 \begin_layout Plain Layout
12255 \begin_inset Flex CharStyle:Code
12258 \begin_layout Plain Layout
12265 \begin_inset Flex CharStyle:Code
12268 \begin_layout Plain Layout
12274 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12275 If you specify the argument
12276 \begin_inset Flex CharStyle:Code
12279 \begin_layout Plain Layout
12285 , then you should also provide a numerical argument which will be the actual
12287 Note that, contrary to other parameters,
12288 \begin_inset Flex CharStyle:Code
12291 \begin_layout Plain Layout
12297 implies the generation of specific LaTeX code, using the package
12300 \begin_inset Flex CharStyle:Code
12303 \begin_layout Plain Layout
12312 \begin_layout Description
12313 \begin_inset Flex CharStyle:Code
12316 \begin_layout Plain Layout
12322 The font used for the text body .
12324 \begin_inset CommandInset ref
12326 reference "sub:Font-description"
12333 \begin_layout Description
12334 \begin_inset Flex CharStyle:Code
12337 \begin_layout Plain Layout
12346 \begin_inset Flex CharStyle:Code
12349 \begin_layout Plain Layout
12359 The level of the style in the table of contents.
12360 This is used for automatic numbering of section headings.
12363 \begin_layout Description
12364 \begin_inset Flex CharStyle:Code
12367 \begin_layout Plain Layout
12374 \begin_inset Flex CharStyle:Code
12377 \begin_layout Plain Layout
12383 ] The vertical space with which the very first of a chain of paragraphs
12384 with this layout is separated from the previous paragraph.
12385 If the previous paragraph has another layout, the separations are not simply
12386 added, but the maximum is taken.
12389 \begin_layout Subsection
12391 \begin_inset CommandInset label
12400 \begin_layout Standard
12401 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12402 define the floats (
12403 \begin_inset Flex CharStyle:MenuItem
12406 \begin_layout Plain Layout
12413 \begin_inset Flex CharStyle:MenuItem
12416 \begin_layout Plain Layout
12422 , \SpecialChar \ldots{}
12423 ) in the text class itself.
12424 Standard floats are included in the file
12425 \begin_inset Flex CharStyle:Code
12428 \begin_layout Plain Layout
12434 , so you may have to do no more than add
12437 \begin_layout LyX-Code
12438 Input stdfloats.inc
12441 \begin_layout Standard
12442 to your layout file.
12443 If you want to implement a text class that proposes some other float types
12444 (like the AGU class bundled with LyX), the information below will hopefully
12448 \begin_layout Description
12449 \begin_inset Flex CharStyle:Code
12452 \begin_layout Plain Layout
12459 \begin_inset Flex CharStyle:Code
12462 \begin_layout Plain Layout
12469 \begin_inset Quotes erd
12473 \begin_inset Quotes erd
12476 ] The file name extension of an auxiliary file for the list of figures (or
12478 LaTeX writes the captions to this file.
12481 \begin_layout Description
12482 \begin_inset Flex CharStyle:Code
12485 \begin_layout Plain Layout
12492 \begin_inset Flex CharStyle:Code
12495 \begin_layout Plain Layout
12502 \begin_inset Quotes erd
12506 \begin_inset Quotes erd
12509 ] The string that will be used in the menus and also for the caption.
12510 This is translated to the current language if babel is used.
12513 \begin_layout Description
12514 \begin_inset Flex CharStyle:Code
12517 \begin_layout Plain Layout
12523 These are used for XHTML output.
12527 \begin_layout Description
12528 \begin_inset Flex CharStyle:Code
12531 \begin_layout Plain Layout
12538 \begin_inset Flex CharStyle:Code
12541 \begin_layout Plain Layout
12550 \begin_inset Flex CharStyle:Code
12553 \begin_layout Plain Layout
12560 \begin_inset Flex CharStyle:Code
12563 \begin_layout Plain Layout
12569 if the float is already defined by the LaTeX document class.
12571 \begin_inset Flex CharStyle:Code
12574 \begin_layout Plain Layout
12580 , the float will be defined using the LaTeX package
12581 \begin_inset Flex CharStyle:Code
12584 \begin_layout Plain Layout
12593 \begin_layout Description
12594 \begin_inset Flex CharStyle:Code
12597 \begin_layout Plain Layout
12604 \begin_inset Flex CharStyle:Code
12607 \begin_layout Plain Layout
12614 \begin_inset Quotes erd
12618 \begin_inset Quotes erd
12621 ] The heading used for the list of floats.
12622 This is translated to the document language.
12625 \begin_layout Description
12626 \begin_inset Flex CharStyle:Code
12629 \begin_layout Plain Layout
12636 \begin_inset Flex CharStyle:Code
12639 \begin_layout Plain Layout
12646 \begin_inset Quotes erd
12650 \begin_inset Quotes erd
12653 ] This (optional) argument determines whether floats of this class will
12654 be numbered within some sectional unit of the document.
12655 For example, if within is equal to
12656 \begin_inset Flex CharStyle:Code
12659 \begin_layout Plain Layout
12665 , the floats will be numbered within chapters.
12669 \begin_layout Description
12670 \begin_inset Flex CharStyle:Code
12673 \begin_layout Plain Layout
12680 \begin_inset Flex CharStyle:Code
12683 \begin_layout Plain Layout
12690 \begin_inset Quotes erd
12694 \begin_inset Quotes erd
12697 ] The default placement for the given class of floats.
12698 The string should be as in standard LaTeX:
12699 \begin_inset Flex CharStyle:Code
12702 \begin_layout Plain Layout
12709 \begin_inset Flex CharStyle:Code
12712 \begin_layout Plain Layout
12719 \begin_inset Flex CharStyle:Code
12722 \begin_layout Plain Layout
12729 \begin_inset Flex CharStyle:Code
12732 \begin_layout Plain Layout
12738 for top, bottom, page, and here, respectively.
12742 \begin_layout Plain Layout
12743 Note that the order of these letters in the string is irrelevant, like in
12749 On top of that there is a new type,
12750 \begin_inset Flex CharStyle:Code
12753 \begin_layout Plain Layout
12759 , which does not really correspond to a float, since it means: put it
12760 \begin_inset Quotes eld
12764 \begin_inset Quotes erd
12768 Note however that the
12769 \begin_inset Flex CharStyle:Code
12772 \begin_layout Plain Layout
12778 specifier is special and, because of implementation details, cannot be
12779 used in non-built in float types.
12780 If you do not understand what this means, just use
12781 \begin_inset Quotes eld
12785 \begin_inset Flex CharStyle:Code
12788 \begin_layout Plain Layout
12795 \begin_inset Quotes erd
12801 \begin_layout Description
12802 \begin_inset Flex CharStyle:Code
12805 \begin_layout Plain Layout
12812 \begin_inset Flex CharStyle:Code
12815 \begin_layout Plain Layout
12822 \begin_inset Quotes erd
12826 \begin_inset Quotes erd
12829 ] The style used when defining the float using
12830 \begin_inset Flex CharStyle:Code
12833 \begin_layout Plain Layout
12844 \begin_layout Description
12845 \begin_inset Flex CharStyle:Code
12848 \begin_layout Plain Layout
12855 \begin_inset Flex CharStyle:Code
12858 \begin_layout Plain Layout
12865 \begin_inset Quotes erd
12869 \begin_inset Quotes erd
12873 \begin_inset Quotes eld
12877 \begin_inset Quotes erd
12880 of the new class of floats, like program or algorithm.
12881 After the appropriate
12882 \begin_inset Flex CharStyle:Code
12885 \begin_layout Plain Layout
12894 \begin_inset Flex CharStyle:Code
12897 \begin_layout Plain Layout
12906 \begin_inset Flex CharStyle:Code
12909 \begin_layout Plain Layout
12920 \begin_layout Standard
12921 Note that defining a float with type
12922 \begin_inset Flex CharStyle:Code
12925 \begin_layout Plain Layout
12933 automatically defines the corresponding counter with name
12934 \begin_inset Flex CharStyle:Code
12937 \begin_layout Plain Layout
12948 \begin_layout Subsection
12949 Flex insets and InsetLayout
12950 \begin_inset CommandInset label
12952 name "sub:Flex-insets-and"
12959 \begin_layout Standard
12960 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
12961 these are called Flex insets.
12965 \begin_layout Standard
12966 Flex insets come in three different kinds:
12969 \begin_layout Itemize
12971 \begin_inset Flex CharStyle:Code
12974 \begin_layout Plain Layout
12980 ): These define semantic markup corresponding to such LaTeX commands as
12982 \begin_inset Flex CharStyle:Code
12985 \begin_layout Plain Layout
12994 \begin_inset Flex CharStyle:Code
12997 \begin_layout Plain Layout
13008 \begin_layout Itemize
13010 \begin_inset Flex CharStyle:Code
13013 \begin_layout Plain Layout
13019 ): These can be used to define custom collapsible insets, similar to TeX
13020 code, footnote, and the like.
13021 An obvious example is an endnote inset, which is defined in the
13022 \begin_inset Flex CharStyle:Code
13025 \begin_layout Plain Layout
13034 \begin_layout Itemize
13036 \begin_inset Flex CharStyle:Code
13039 \begin_layout Plain Layout
13045 ): For use with DocBook classes.
13048 \begin_layout Standard
13049 Flex insets are defined using the
13050 \begin_inset Flex CharStyle:Code
13053 \begin_layout Plain Layout
13059 tag, which shall be explained in a moment.
13062 \begin_layout Standard
13064 \begin_inset Flex CharStyle:Code
13067 \begin_layout Plain Layout
13073 tag also serves another function: It can be used to customize the general
13074 layout of many different types of insets.
13076 \begin_inset Flex CharStyle:Code
13079 \begin_layout Plain Layout
13085 can be used to customize the layout parameters for footnotes, marginal
13086 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13087 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13088 define Flex insets.
13091 \begin_layout Standard
13093 \begin_inset Flex CharStyle:Code
13096 \begin_layout Plain Layout
13102 definition must begin with a line of the form:
13105 \begin_layout LyX-Code
13109 \begin_layout Standard
13111 \begin_inset Flex CharStyle:Code
13114 \begin_layout Plain Layout
13120 indicates the inset whose layout is being defined, and here there are two
13124 \begin_layout Enumerate
13125 The layout for a pre-existing inset is being modified.
13126 In this case, can be
13127 \begin_inset Flex CharStyle:Code
13130 \begin_layout Plain Layout
13136 any one of the following:
13137 \begin_inset Flex CharStyle:Code
13140 \begin_layout Plain Layout
13147 \begin_inset Flex CharStyle:Code
13150 \begin_layout Plain Layout
13157 \begin_inset Flex CharStyle:Code
13160 \begin_layout Plain Layout
13167 \begin_inset Flex CharStyle:Code
13170 \begin_layout Plain Layout
13177 \begin_inset Flex CharStyle:Code
13180 \begin_layout Plain Layout
13187 \begin_inset Flex CharStyle:Code
13190 \begin_layout Plain Layout
13197 \begin_inset Flex CharStyle:Code
13200 \begin_layout Plain Layout
13207 \begin_inset Flex CharStyle:Code
13210 \begin_layout Plain Layout
13217 \begin_inset Flex CharStyle:Code
13220 \begin_layout Plain Layout
13227 \begin_inset Flex CharStyle:Code
13230 \begin_layout Plain Layout
13237 \begin_inset Flex CharStyle:Code
13240 \begin_layout Plain Layout
13247 \begin_inset Flex CharStyle:Code
13250 \begin_layout Plain Layout
13257 \begin_inset Flex CharStyle:Code
13260 \begin_layout Plain Layout
13267 \begin_inset Flex CharStyle:Code
13270 \begin_layout Plain Layout
13277 \begin_inset Flex CharStyle:Code
13280 \begin_layout Plain Layout
13287 \begin_inset Flex CharStyle:Code
13290 \begin_layout Plain Layout
13297 \begin_inset Flex CharStyle:Code
13300 \begin_layout Plain Layout
13307 \begin_inset Flex CharStyle:Code
13310 \begin_layout Plain Layout
13317 \begin_inset Flex CharStyle:Code
13320 \begin_layout Plain Layout
13327 \begin_inset Flex CharStyle:Code
13330 \begin_layout Plain Layout
13339 \begin_layout Enumerate
13340 The layout for a Flex inset is being defined.
13342 \begin_inset Flex CharStyle:Code
13345 \begin_layout Plain Layout
13351 can be any valid identifier not used by a pre-existing inset.
13352 Note that the definition of a flex inset
13357 \begin_inset Flex CharStyle:Code
13360 \begin_layout Plain Layout
13366 entry, declaring which type of inset this is.
13369 \begin_layout Standard
13371 \begin_inset Flex CharStyle:Code
13374 \begin_layout Plain Layout
13380 definition can contain the following entries:
13383 \begin_layout Description
13384 \begin_inset Flex CharStyle:Code
13387 \begin_layout Plain Layout
13393 The color for the inset's background.
13394 The valid colors are defined in
13395 \begin_inset Flex CharStyle:Code
13398 \begin_layout Plain Layout
13407 \begin_layout Description
13408 \begin_inset Flex CharStyle:Code
13411 \begin_layout Plain Layout
13418 \begin_inset Flex CharStyle:Code
13421 \begin_layout Plain Layout
13430 \begin_inset Flex CharStyle:Code
13433 \begin_layout Plain Layout
13439 ] Whether to use the content of the inset as the label, when the inset is
13444 \begin_layout Description
13445 \begin_inset Flex CharStyle:Code
13448 \begin_layout Plain Layout
13454 As with paragraph styles (see page
13455 \begin_inset CommandInset ref
13457 reference "des:CopyStyle"
13464 \begin_layout Description
13465 \begin_inset Flex CharStyle:Code
13468 \begin_layout Plain Layout
13475 \begin_inset Flex CharStyle:Code
13478 \begin_layout Plain Layout
13487 \begin_inset Flex CharStyle:Code
13490 \begin_layout Plain Layout
13496 ] Indicates whether the user may employ the Paragraph Settings dialog to
13497 customize the paragraph.
13500 \begin_layout Description
13501 \begin_inset Flex CharStyle:Code
13504 \begin_layout Plain Layout
13511 \begin_inset Flex CharStyle:Code
13514 \begin_layout Plain Layout
13521 \begin_inset Flex CharStyle:Code
13524 \begin_layout Plain Layout
13531 \begin_inset Flex CharStyle:Code
13534 \begin_layout Plain Layout
13540 , describing the rendering style used for the inset's frame and buttons.
13541 Footnotes generally use
13542 \begin_inset Flex CharStyle:Code
13545 \begin_layout Plain Layout
13551 , ERT insets generally
13552 \begin_inset Flex CharStyle:Code
13555 \begin_layout Plain Layout
13561 , and character styles
13562 \begin_inset Flex CharStyle:Code
13565 \begin_layout Plain Layout
13574 \begin_layout Description
13575 \begin_inset Flex CharStyle:Code
13578 \begin_layout Plain Layout
13584 Required at the end of the InsetLayout declarations.
13587 \begin_layout Description
13588 \begin_inset Flex CharStyle:Code
13591 \begin_layout Plain Layout
13597 The font used for both the text body
13603 \begin_inset space ~
13607 \begin_inset CommandInset ref
13609 reference "sub:Font-description"
13614 Note that defining this font automatically defines the
13615 \begin_inset Flex CharStyle:Code
13618 \begin_layout Plain Layout
13624 to the same value, so define this first and define
13625 \begin_inset Flex CharStyle:Code
13628 \begin_layout Plain Layout
13634 later if you want them to be different.
13637 \begin_layout Description
13638 \begin_inset Flex CharStyle:Code
13641 \begin_layout Plain Layout
13648 \begin_inset Quotes eld
13652 \begin_inset Quotes erd
13655 language, leading to Left-to-Right (latin) output, e.
13656 \begin_inset space \thinspace{}
13660 \begin_inset space \space{}
13663 in TeX code or URL.
13667 \begin_layout Description
13668 \begin_inset Flex CharStyle:Code
13671 \begin_layout Plain Layout
13678 \begin_inset Flex CharStyle:Code
13681 \begin_layout Plain Layout
13690 \begin_inset Flex CharStyle:Code
13693 \begin_layout Plain Layout
13699 ] Indicates whether the PlainLayout should be used or, instead, the user
13700 can change the paragraph style used in the inset.
13704 \begin_layout Description
13705 \begin_inset Flex CharStyle:Code
13708 \begin_layout Plain Layout
13714 As with paragraph styles (see page
13715 \begin_inset CommandInset ref
13716 LatexCommand pageref
13717 reference "des:FreeSpacing"
13725 \begin_layout Description
13726 \begin_inset Flex CharStyle:Code
13729 \begin_layout Plain Layout
13735 These tags control XHTML output.
13739 \begin_layout Description
13740 \begin_inset Flex CharStyle:Code
13743 \begin_layout Plain Layout
13750 \begin_inset Flex CharStyle:Code
13753 \begin_layout Plain Layout
13762 \begin_inset Flex CharStyle:Code
13765 \begin_layout Plain Layout
13771 ] Whether to include the contents of this inset in the strings generated
13772 for the `Outline' pane.
13773 One would not, for example, want the content of a footnote in a section
13774 header to be included in the TOC displayed in the outline, but one would
13775 normally want the content of a character style displayed.
13776 Default is false: not to include.
13779 \begin_layout Description
13780 \begin_inset Flex CharStyle:Code
13783 \begin_layout Plain Layout
13789 As with paragraph styles (see page
13790 \begin_inset CommandInset ref
13791 LatexCommand pageref
13792 reference "des:KeepEmpty"
13800 \begin_layout Description
13801 \begin_inset Flex CharStyle:Code
13804 \begin_layout Plain Layout
13810 The font used for the label.
13812 \begin_inset space ~
13816 \begin_inset CommandInset ref
13818 reference "sub:Font-description"
13823 Note that this definition can never appear before
13824 \begin_inset Flex CharStyle:Code
13827 \begin_layout Plain Layout
13833 , lest it be ineffective.
13836 \begin_layout Description
13837 \begin_inset Flex CharStyle:Code
13840 \begin_layout Plain Layout
13846 What will be displayed on the button or elsewhere as the inset label.
13847 Some inset types (TeX code and Branch) modify this label on the fly.
13850 \begin_layout Description
13851 \begin_inset Flex CharStyle:Code
13854 \begin_layout Plain Layout
13860 The name of the corresponding LaTeX stuff.
13861 Either the environment or command name.
13864 \begin_layout Description
13865 \begin_inset Flex CharStyle:Code
13868 \begin_layout Plain Layout
13874 The optional parameter for the corresponding
13875 \begin_inset Flex CharStyle:Code
13878 \begin_layout Plain Layout
13884 stuff, including possible bracket pairs like
13885 \begin_inset Flex CharStyle:Code
13888 \begin_layout Plain Layout
13895 This parameter cannot be changed from within LyX.
13898 \begin_layout Description
13899 \begin_inset Flex CharStyle:Code
13902 \begin_layout Plain Layout
13908 As with paragraph styles (see page
13909 \begin_inset CommandInset ref
13910 LatexCommand pageref
13911 reference "des:LatexType"
13918 \begin_layout Description
13919 \begin_inset Flex CharStyle:Code
13922 \begin_layout Plain Layout
13929 \begin_inset Flex CharStyle:Code
13932 \begin_layout Plain Layout
13939 \begin_inset Flex CharStyle:Code
13942 \begin_layout Plain Layout
13949 \begin_inset Flex CharStyle:Code
13952 \begin_layout Plain Layout
13959 \begin_inset Flex CharStyle:Code
13962 \begin_layout Plain Layout
13968 (indicating a dummy definition ending definitions of charstyles, etc).
13969 This entry is required in and is only meaningful for Flex insets.
13970 Among other things, it determines on which menu this inset will appear.
13973 \begin_layout Description
13974 \begin_inset Flex CharStyle:Code
13977 \begin_layout Plain Layout
13984 \begin_inset Flex CharStyle:Code
13987 \begin_layout Plain Layout
13996 \begin_inset Flex CharStyle:Code
13999 \begin_layout Plain Layout
14005 ] Whether multiple paragraphs are permitted in this inset.
14007 \begin_inset Flex CharStyle:Code
14010 \begin_layout Plain Layout
14016 to the same value and
14017 \begin_inset Flex CharStyle:Code
14020 \begin_layout Plain Layout
14026 to the opposite value.
14027 These can be reset to other values, if they are used
14032 \begin_inset Flex CharStyle:Code
14035 \begin_layout Plain Layout
14045 \begin_layout Description
14046 \begin_inset Flex CharStyle:Code
14049 \begin_layout Plain Layout
14056 \begin_inset Flex CharStyle:Code
14059 \begin_layout Plain Layout
14068 \begin_inset Flex CharStyle:Code
14071 \begin_layout Plain Layout
14077 ] Whether fragile commands in this layout should be
14078 \begin_inset Flex CharStyle:Code
14081 \begin_layout Plain Layout
14094 whether the command should itself be protected.) Default is false.
14097 \begin_layout Description
14098 \begin_inset Flex CharStyle:Code
14101 \begin_layout Plain Layout
14108 \begin_inset Flex CharStyle:Code
14111 \begin_layout Plain Layout
14120 \begin_inset Flex CharStyle:Code
14123 \begin_layout Plain Layout
14129 ] As with paragraph styles (see page
14130 \begin_inset CommandInset ref
14131 LatexCommand pageref
14132 reference "des:PathThru"
14140 \begin_layout Description
14141 \begin_inset Flex CharStyle:Code
14144 \begin_layout Plain Layout
14150 As with paragraph styles (see page
14151 \begin_inset CommandInset ref
14152 LatexCommand pageref
14153 reference "des:Preamble"
14160 \begin_layout Description
14161 \begin_inset Flex CharStyle:Code
14164 \begin_layout Plain Layout
14171 \begin_inset Flex CharStyle:Code
14174 \begin_layout Plain Layout
14180 ] As with paragraph styles (see page
14181 \begin_inset CommandInset ref
14182 LatexCommand pageref
14183 reference "des:Requires"
14190 \begin_layout Subsection
14192 \begin_inset CommandInset label
14194 name "sub:Counters"
14201 \begin_layout Standard
14202 Since version 1.3.0 of LyX, it is both possible and necessary to define the
14204 \begin_inset Flex CharStyle:MenuItem
14207 \begin_layout Plain Layout
14214 \begin_inset Flex CharStyle:MenuItem
14217 \begin_layout Plain Layout
14223 , \SpecialChar \ldots{}
14224 ) in the text class itself.
14225 The standard counters are defined in the file
14226 \begin_inset Flex CharStyle:Code
14229 \begin_layout Plain Layout
14235 , so you may have to do no more than add
14238 \begin_layout LyX-Code
14239 Input stdcounters.inc
14242 \begin_layout Standard
14243 to your layout file to get them to work.
14244 But if you want to define custom counters, then you can do so.
14245 The counter declaration must begin with:
14248 \begin_layout LyX-Code
14249 Counter CounterName
14252 \begin_layout Standard
14254 \begin_inset Flex CharStyle:Code
14257 \begin_layout Plain Layout
14263 ' is replaced by the name of the counter.
14264 And it must end with
14265 \begin_inset Quotes eld
14269 \begin_inset Flex CharStyle:Code
14272 \begin_layout Plain Layout
14279 \begin_inset Quotes erd
14283 The following parameters can also be used:
14286 \begin_layout Description
14287 \begin_inset Flex CharStyle:Code
14290 \begin_layout Plain Layout
14291 LabelString [string=""]
14296 when this is defined, this string defines how the counter is displayed.
14297 Setting this value sets
14298 \begin_inset Flex CharStyle:Code
14301 \begin_layout Plain Layout
14302 LabelStringAppendix
14308 The following special constructs can be used in the string:
14312 \begin_layout Itemize
14313 \begin_inset Flex CharStyle:Code
14316 \begin_layout Plain Layout
14324 will be replaced by the expansion of the
14325 \begin_inset Flex CharStyle:Code
14328 \begin_layout Plain Layout
14335 \begin_inset Flex CharStyle:Code
14338 \begin_layout Plain Layout
14339 LabelStringAppendix
14345 \begin_inset Flex CharStyle:Code
14348 \begin_layout Plain Layout
14358 \begin_layout Itemize
14359 counter values can be expressed using LaTeX-like macros
14360 \begin_inset Flex CharStyle:Code
14363 \begin_layout Plain Layout
14380 \begin_inset Flex CharStyle:Code
14383 \begin_layout Plain Layout
14395 \begin_layout Plain Layout
14405 Actually, the situation is a bit more complicated: any
14424 other than those described below will produce arabic numerals.
14425 It would not be surprising to see this change in the future.
14431 \begin_inset Flex CharStyle:Code
14434 \begin_layout Plain Layout
14440 : 1, 2, 3,\SpecialChar \ldots{}
14442 \begin_inset Flex CharStyle:Code
14445 \begin_layout Plain Layout
14451 for lower-case letters: a, b, c, \SpecialChar \ldots{}
14453 \begin_inset Flex CharStyle:Code
14456 \begin_layout Plain Layout
14462 for upper-case letters: A, B, C, \SpecialChar \ldots{}
14464 \begin_inset Flex CharStyle:Code
14467 \begin_layout Plain Layout
14473 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
14475 \begin_inset Flex CharStyle:Code
14478 \begin_layout Plain Layout
14484 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
14486 \begin_inset Flex CharStyle:Code
14489 \begin_layout Plain Layout
14495 for hebrew numerals.
14499 \begin_layout Standard
14500 If LabelString is not defined, a default value is constructed as follows:
14501 if the counter has a master counter
14502 \begin_inset Flex CharStyle:Code
14505 \begin_layout Plain Layout
14512 \begin_inset Flex CharStyle:Code
14515 \begin_layout Plain Layout
14522 \begin_inset Flex CharStyle:Code
14525 \begin_layout Plain Layout
14535 is used; otherwise the string
14536 \begin_inset Flex CharStyle:Code
14539 \begin_layout Plain Layout
14550 \begin_layout Description
14551 \begin_inset Flex CharStyle:Code
14554 \begin_layout Plain Layout
14555 LabelStringAppendix [string=""]
14561 \begin_inset Flex CharStyle:Code
14564 \begin_layout Plain Layout
14570 , but for use in the Appendix.
14573 \begin_layout Description
14574 \begin_inset Flex CharStyle:Code
14577 \begin_layout Plain Layout
14584 \begin_inset Flex CharStyle:Code
14587 \begin_layout Plain Layout
14594 \begin_inset Quotes erd
14598 \begin_inset Quotes erd
14601 ] If this is set to the name of another counter, the present counter will
14602 be reset every time the other one is increased.
14604 \begin_inset Flex CharStyle:Code
14607 \begin_layout Plain Layout
14614 \begin_inset Flex CharStyle:Code
14617 \begin_layout Plain Layout
14626 \begin_layout Subsection
14628 \begin_inset CommandInset label
14630 name "sub:Font-description"
14637 \begin_layout Standard
14638 A font description looks like this:
14641 \begin_layout LyX-Code
14651 \begin_layout LyX-Code
14655 \begin_layout LyX-Code
14659 \begin_layout Standard
14660 The following commands are available:
14663 \begin_layout Description
14664 \begin_inset Flex CharStyle:Code
14667 \begin_layout Plain Layout
14674 \begin_inset Flex CharStyle:Code
14677 \begin_layout Plain Layout
14686 \begin_inset Flex CharStyle:Code
14689 \begin_layout Plain Layout
14696 \begin_inset Flex CharStyle:Code
14699 \begin_layout Plain Layout
14706 \begin_inset Flex CharStyle:Code
14709 \begin_layout Plain Layout
14716 \begin_inset Flex CharStyle:Code
14719 \begin_layout Plain Layout
14726 \begin_inset Flex CharStyle:Code
14729 \begin_layout Plain Layout
14736 \begin_inset Flex CharStyle:Code
14739 \begin_layout Plain Layout
14746 \begin_inset Flex CharStyle:Code
14749 \begin_layout Plain Layout
14756 \begin_inset Flex CharStyle:Code
14759 \begin_layout Plain Layout
14768 \begin_layout Description
14769 \begin_inset Flex CharStyle:Code
14772 \begin_layout Plain Layout
14781 \begin_inset Flex CharStyle:Code
14784 \begin_layout Plain Layout
14795 \begin_inset Flex CharStyle:Code
14798 \begin_layout Plain Layout
14805 \begin_inset Flex CharStyle:Code
14808 \begin_layout Plain Layout
14817 \begin_layout Description
14818 \begin_inset Flex CharStyle:Code
14821 \begin_layout Plain Layout
14828 \begin_inset Flex CharStyle:Code
14831 \begin_layout Plain Layout
14837 ] Valid arguments are:
14838 \begin_inset Flex CharStyle:Code
14841 \begin_layout Plain Layout
14848 \begin_inset Flex CharStyle:Code
14851 \begin_layout Plain Layout
14858 \begin_inset Flex CharStyle:Code
14861 \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
14898 Each of these turns on or off the corresponding attribute.
14900 \begin_inset Flex CharStyle:Code
14903 \begin_layout Plain Layout
14909 turns on emphasis, and
14910 \begin_inset Flex CharStyle:Code
14913 \begin_layout Plain Layout
14921 \begin_inset Newline newline
14924 If the latter seems puzzling, remember that the font settings for the present
14925 context are generally inherited from the surrounding context.
14927 \begin_inset Flex CharStyle:Code
14930 \begin_layout Plain Layout
14936 would turn off the emphasis that was anyway in effect, say, in a theorem
14940 \begin_layout Description
14941 \begin_inset Flex CharStyle:Code
14944 \begin_layout Plain Layout
14953 \begin_inset Flex CharStyle:Code
14956 \begin_layout Plain Layout
14967 \begin_inset Flex CharStyle:Code
14970 \begin_layout Plain Layout
14979 \begin_layout Description
14980 \begin_inset Flex CharStyle:Code
14983 \begin_layout Plain Layout
14992 \begin_inset Flex CharStyle:Code
14995 \begin_layout Plain Layout
15006 \begin_inset Flex CharStyle:Code
15009 \begin_layout Plain Layout
15016 \begin_inset Flex CharStyle:Code
15019 \begin_layout Plain Layout
15026 \begin_inset Flex CharStyle:Code
15029 \begin_layout Plain Layout
15038 \begin_layout Description
15039 \begin_inset Flex CharStyle:Code
15042 \begin_layout Plain Layout
15049 \begin_inset Flex CharStyle:Code
15052 \begin_layout Plain Layout
15059 \begin_inset Flex CharStyle:Code
15062 \begin_layout Plain Layout
15069 \begin_inset Flex CharStyle:Code
15072 \begin_layout Plain Layout
15081 \begin_inset Flex CharStyle:Code
15084 \begin_layout Plain Layout
15091 \begin_inset Flex CharStyle:Code
15094 \begin_layout Plain Layout
15101 \begin_inset Flex CharStyle:Code
15104 \begin_layout Plain Layout
15111 \begin_inset Flex CharStyle:Code
15114 \begin_layout Plain Layout
15121 \begin_inset Flex CharStyle:Code
15124 \begin_layout Plain Layout
15133 \begin_layout Section
15134 \begin_inset CommandInset label
15136 name "sec:Tags-for-XHTML"
15140 Tags for XHTML output
15143 \begin_layout Standard
15144 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
15145 by layout information.
15146 In general, LyX provides sensible defaults and, as mentioned earlier, it
15147 will even construct default CSS style rules from the other layout tags.
15148 For example, LyX will attempt to use the information provided in the
15149 \begin_inset Flex CharStyle:Code
15152 \begin_layout Plain Layout
15158 declaration for the Chapter style to write CSS that will appropriately
15159 format chapter headings.
15162 \begin_layout Standard
15163 In many cases, then, you may not have to do anything at all to get acceptable
15164 XHTML output for your own environments, custom insets, and so forth.
15165 But in some cases you will, and so LyX provides a number of layout tags
15166 that can be used to customize the XHTML and CSS that are generated.
15169 \begin_layout Standard
15170 Note that there are two tags,
15171 \begin_inset Flex CharStyle:Code
15174 \begin_layout Plain Layout
15181 \begin_inset Flex CharStyle:Code
15184 \begin_layout Plain Layout
15190 that may appear outside style and inset declarations.
15192 \begin_inset CommandInset ref
15193 LatexCommand prettyref
15194 reference "sub:General-text-class"
15198 for details on these.
15201 \begin_layout Subsection
15202 \begin_inset CommandInset label
15204 name "sub:Paragraph-Style-XHTML"
15211 \begin_layout Standard
15212 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
15213 dealing with a normal paragraph, a command, or an environment, where this
15214 is itself determined by the contents of the corresponding
15215 \begin_inset Flex CharStyle:Code
15218 \begin_layout Plain Layout
15228 \begin_layout Standard
15229 For a command or normal paragraph, the output XHTML has the following form:
15232 \begin_layout LyX-Code
15234 \begin_inset Quotes erd
15238 \begin_inset Quotes erd
15244 \begin_layout LyX-Code
15246 \begin_inset Quotes erd
15250 \begin_inset Quotes erd
15256 \begin_layout LyX-Code
15257 Contents of the paragraph.
15260 \begin_layout LyX-Code
15264 \begin_layout Standard
15265 The label tags are of course omitted if the paragraph does not have a label.
15268 \begin_layout Standard
15269 For an environment that is not some sort of list, the XHTML takes this form:
15272 \begin_layout LyX-Code
15274 \begin_inset Quotes erd
15278 \begin_inset Quotes erd
15284 \begin_layout LyX-Code
15286 \begin_inset Quotes erd
15290 \begin_inset Quotes erd
15294 \begin_inset Quotes erd
15298 \begin_inset Quotes erd
15301 >Environment Label</labeltag>First paragraph.</itemtag>
15304 \begin_layout LyX-Code
15305 <itemtag>Second paragraph.</itemtag>
15308 \begin_layout LyX-Code
15312 \begin_layout Standard
15313 Note that the label is output only for the first paragraph, as it should
15314 be for a theorem, for example.
15318 \begin_layout Standard
15319 For a list, we have one of these forms:
15322 \begin_layout LyX-Code
15324 \begin_inset Quotes erd
15328 \begin_inset Quotes erd
15334 \begin_layout LyX-Code
15336 \begin_inset Quotes erd
15340 \begin_inset Quotes erd
15344 \begin_inset Quotes erd
15348 \begin_inset Quotes erd
15351 >List Label</labeltag>First item.</itemtag>
15354 \begin_layout LyX-Code
15356 \begin_inset Quotes erd
15360 \begin_inset Quotes erd
15364 \begin_inset Quotes erd
15368 \begin_inset Quotes erd
15371 >List Label</labeltag>Second item.</itemtag>
15374 \begin_layout LyX-Code
15378 \begin_layout LyX-Code
15382 \begin_layout LyX-Code
15384 \begin_inset Quotes erd
15388 \begin_inset Quotes erd
15394 \begin_layout LyX-Code
15396 \begin_inset Quotes erd
15400 \begin_inset Quotes erd
15403 >List Label</labeltag><itemtag attr=
15404 \begin_inset Quotes erd
15408 \begin_inset Quotes erd
15411 >First item.</itemtag>
15414 \begin_layout LyX-Code
15416 \begin_inset Quotes erd
15420 \begin_inset Quotes erd
15423 >List Label</labeltag><itemtag attr=
15424 \begin_inset Quotes erd
15428 \begin_inset Quotes erd
15431 >Second item.</itemtag>
15434 \begin_layout LyX-Code
15438 \begin_layout Standard
15439 Note the different orders of
15440 \begin_inset Flex CharStyle:Code
15443 \begin_layout Plain Layout
15450 \begin_inset Flex CharStyle:Code
15453 \begin_layout Plain Layout
15460 Which order we get depends upon the setting of
15461 \begin_inset Flex CharStyle:Code
15464 \begin_layout Plain Layout
15471 \begin_inset Flex CharStyle:Code
15474 \begin_layout Plain Layout
15480 is false (the default), you get the first of these, with the label within
15481 the item; if true, you get the second, with the label outside the item.
15484 \begin_layout Standard
15485 The specific tags and attributes output for each paragraph type can be controlle
15486 d by means of the layout tags we are about to describe.
15487 As mentioned earlier, however, LyX uses sensible defaults for many of these,
15488 so you often may not need to do very much to get good XHTML output.
15489 Think of the available tags as there so you can tweak things to your liking.
15492 \begin_layout Description
15493 \begin_inset Flex CharStyle:Code
15496 \begin_layout Plain Layout
15503 \begin_inset Flex CharStyle:Code
15506 \begin_layout Plain Layout
15512 ] Specifies attribute information to be output with the main tag.
15514 \begin_inset Quotes eld
15518 \begin_inset Flex CharStyle:Code
15521 \begin_layout Plain Layout
15528 \begin_inset Quotes erd
15532 By default, LyX will output
15533 \begin_inset Quotes eld
15537 \begin_inset Flex CharStyle:Code
15540 \begin_layout Plain Layout
15547 \begin_inset Quotes erd
15551 \begin_inset Flex CharStyle:Code
15554 \begin_layout Plain Layout
15560 is the LyX name of the layout, made lowercase, for example: chapter.
15563 \begin_layout Description
15564 \begin_inset Flex CharStyle:Code
15567 \begin_layout Plain Layout
15574 \begin_inset Flex CharStyle:Code
15577 \begin_layout Plain Layout
15583 ] Whether to output the default CSS information LyX generates for this layout,
15584 even if additional information is explicitly provided via
15585 \begin_inset Flex CharStyle:Code
15588 \begin_layout Plain Layout
15596 \begin_inset Flex CharStyle:Code
15599 \begin_layout Plain Layout
15605 allows you to alter or augment the generated CSS, rather than to override
15608 \begin_inset Flex CharStyle:Code
15611 \begin_layout Plain Layout
15620 \begin_layout Description
15621 \begin_inset Flex CharStyle:Code
15624 \begin_layout Plain Layout
15631 \begin_inset Flex CharStyle:Code
15634 \begin_layout Plain Layout
15640 ] The tag to be used for individual paragraphs of environments, replacing
15642 \begin_inset Flex CharStyle:Code
15645 \begin_layout Plain Layout
15651 in the examples above.
15653 \begin_inset Flex CharStyle:Code
15656 \begin_layout Plain Layout
15665 \begin_layout Description
15666 \begin_inset Flex CharStyle:Code
15669 \begin_layout Plain Layout
15676 \begin_inset Flex CharStyle:Code
15679 \begin_layout Plain Layout
15685 ] Attributes for the item tag.
15687 \begin_inset Quotes eld
15691 \begin_inset Flex CharStyle:Code
15694 \begin_layout Plain Layout
15695 class=`layoutname_item'
15701 \begin_inset Quotes erd
15707 \begin_layout Description
15708 \begin_inset Flex CharStyle:Code
15711 \begin_layout Plain Layout
15718 \begin_inset Flex CharStyle:Code
15721 \begin_layout Plain Layout
15727 ] The tag to be used for paragraph and item labels, replacing
15728 \begin_inset Flex CharStyle:Code
15731 \begin_layout Plain Layout
15737 in the examples above.
15739 \begin_inset Flex CharStyle:Code
15742 \begin_layout Plain Layout
15751 \begin_layout Description
15752 \begin_inset Flex CharStyle:Code
15755 \begin_layout Plain Layout
15762 \begin_inset Flex CharStyle:Code
15765 \begin_layout Plain Layout
15771 ] Attributes for the label tag.
15773 \begin_inset Quotes eld
15777 \begin_inset Flex CharStyle:Code
15780 \begin_layout Plain Layout
15781 class=`layoutname_label'
15787 \begin_inset Quotes erd
15793 \begin_layout Description
15794 \begin_inset Flex CharStyle:Code
15797 \begin_layout Plain Layout
15804 \begin_inset Flex CharStyle:Code
15807 \begin_layout Plain Layout
15813 ] Meaningful only for list-like environments, this tag controls whether
15814 the label tag is output before or inside the item tag.
15815 This is used, for example, in the description environment, where we want
15817 \begin_inset Flex CharStyle:Code
15820 \begin_layout Plain Layout
15821 <dt>\SpecialChar \ldots{}
15822 </dt><dd>\SpecialChar \ldots{}
15830 \begin_inset Flex CharStyle:Code
15833 \begin_layout Plain Layout
15839 : The label tag is output inside the item tag.
15842 \begin_layout Description
15843 \begin_inset Flex CharStyle:Code
15846 \begin_layout Plain Layout
15852 Information to be output in the
15853 \begin_inset Flex CharStyle:Code
15856 \begin_layout Plain Layout
15862 section when this style is used.
15863 This might, for example, be used to include a
15864 \begin_inset Flex CharStyle:Code
15867 \begin_layout Plain Layout
15874 \begin_inset Flex CharStyle:Code
15877 \begin_layout Plain Layout
15886 \begin_layout Description
15887 \begin_inset Flex CharStyle:Code
15890 \begin_layout Plain Layout
15896 CSS style information to be included when this style is used.
15897 Note that this will automatically be wrapped in a layout-generated
15898 \begin_inset Flex CharStyle:Code
15901 \begin_layout Plain Layout
15907 block, so only the CSS itself need be included.
15910 \begin_layout Description
15911 \begin_inset Flex CharStyle:Code
15914 \begin_layout Plain Layout
15921 \begin_inset Flex CharStyle:Code
15924 \begin_layout Plain Layout
15930 ] The tag to be used for the main label, replacing
15931 \begin_inset Flex CharStyle:Code
15934 \begin_layout Plain Layout
15940 in the examples above.
15942 \begin_inset Flex CharStyle:Code
15945 \begin_layout Plain Layout
15954 \begin_layout Subsection
15958 \begin_layout Standard
15959 The XHTML output of insets can also be controlled by information in layout
15964 \begin_layout Plain Layout
15965 At present, this is true only for
15966 \begin_inset Quotes eld
15970 \begin_inset Quotes erd
15973 insets (insets you can type into) and is not true for
15974 \begin_inset Quotes eld
15978 \begin_inset Quotes erd
15981 insets (insets that are associated with dialog boxes).
15986 Here, too, LyX tries to provide sensible defaults, and it constructs default
15988 But everything can be customized.
15991 \begin_layout Standard
15992 The XHTML LyX outputs for an inset has the following form:
15995 \begin_layout LyX-Code
15997 \begin_inset Quotes erd
16001 \begin_inset Quotes erd
16007 \begin_layout LyX-Code
16008 <labeltag>Label</labeltag>
16011 \begin_layout LyX-Code
16013 \begin_inset Quotes erd
16017 \begin_inset Quotes erd
16020 >Contents of the inset.</innertag>
16023 \begin_layout LyX-Code
16027 \begin_layout Standard
16028 If the inset permits multiple paragraphs---that is, if
16029 \begin_inset Flex CharStyle:Code
16032 \begin_layout Plain Layout
16038 is true---then the contents of the inset will itself be output as paragraphs
16039 formatted according to the styles used for those paragraphs (standard,
16040 quote, and the like).
16041 The label tag is of course omitted if the paragraph does not have a label
16042 and, at present, is always
16043 \begin_inset Flex CharStyle:Code
16046 \begin_layout Plain Layout
16053 The inner tag is optional and, by default, does not appear.
16056 \begin_layout Standard
16057 The specific tags and attributes output for each inset can be controlled
16058 by means of the following layout tags.
16061 \begin_layout Description
16062 \begin_inset Flex CharStyle:Code
16065 \begin_layout Plain Layout
16072 \begin_inset Flex CharStyle:Code
16075 \begin_layout Plain Layout
16081 ] Specifies attribute information to be output with the main tag.
16083 \begin_inset Quotes eld
16087 \begin_inset Flex CharStyle:Code
16090 \begin_layout Plain Layout
16091 class=`myinset' onclick=`\SpecialChar \ldots{}
16098 \begin_inset Quotes erd
16102 By default, LyX will output
16103 \begin_inset Quotes eld
16107 \begin_inset Flex CharStyle:Code
16110 \begin_layout Plain Layout
16117 \begin_inset Quotes erd
16121 \begin_inset Flex CharStyle:Code
16124 \begin_layout Plain Layout
16130 is the LyX name of the inset, made lowercase and with non-alphanumeric
16131 characters converted to underscores, for example: footnote.
16134 \begin_layout Description
16135 \begin_inset Flex CharStyle:Code
16138 \begin_layout Plain Layout
16145 \begin_inset Flex CharStyle:Code
16148 \begin_layout Plain Layout
16158 ] Whether to output the default CSS information LyX generates for this layout,
16159 even if additional information is explicitly provided via
16160 \begin_inset Flex CharStyle:Code
16163 \begin_layout Plain Layout
16171 \begin_inset Flex CharStyle:Code
16174 \begin_layout Plain Layout
16180 allows you to alter or augment the generated CSS, rather than to override
16185 \begin_layout Description
16186 \begin_inset Flex CharStyle:Code
16189 \begin_layout Plain Layout
16196 \begin_inset Flex CharStyle:Code
16199 \begin_layout Plain Layout
16205 ] Attributes for the inner tag.
16207 \begin_inset Quotes eld
16211 \begin_inset Flex CharStyle:Code
16214 \begin_layout Plain Layout
16215 class=`insetname_inner'
16221 \begin_inset Quotes erd
16227 \begin_layout Description
16228 \begin_inset Flex CharStyle:Code
16231 \begin_layout Plain Layout
16238 \begin_inset Flex CharStyle:Code
16241 \begin_layout Plain Layout
16247 ] The inner tag, replacing
16248 \begin_inset Flex CharStyle:Code
16251 \begin_layout Plain Layout
16257 in the examples above.
16258 By default, there is none.
16261 \begin_layout Description
16262 \begin_inset Flex CharStyle:Code
16265 \begin_layout Plain Layout
16272 \begin_inset Flex CharStyle:Code
16275 \begin_layout Plain Layout
16283 ] Whether this inset represents a standalone block of text (such as a footnote)
16284 or instead represents material that is included in the surrounding text
16285 (such as a branch).
16289 \begin_layout Description
16290 \begin_inset Flex CharStyle:Code
16293 \begin_layout Plain Layout
16300 \begin_inset Flex CharStyle:Code
16303 \begin_layout Plain Layout
16309 ] A label for this inset, possibly including a reference to a counter.
16310 For example, for footnote, it might be:
16311 \begin_inset Flex CharStyle:Code
16314 \begin_layout Plain Layout
16323 This is optional, and there is no default.
16326 \begin_layout Description
16327 \begin_inset Flex CharStyle:Code
16330 \begin_layout Plain Layout
16336 Information to be output in the
16337 \begin_inset Flex CharStyle:Code
16340 \begin_layout Plain Layout
16346 section when this style is used.
16347 This might, for example, be used to include a
16348 \begin_inset Flex CharStyle:Code
16351 \begin_layout Plain Layout
16358 \begin_inset Flex CharStyle:Code
16361 \begin_layout Plain Layout
16370 \begin_layout Description
16371 \begin_inset Flex CharStyle:Code
16374 \begin_layout Plain Layout
16380 CSS style information to be included when this style is used.
16381 Note that this will automatically be wrapped in a layout-generated
16382 \begin_inset Flex CharStyle:Code
16385 \begin_layout Plain Layout
16391 block, so only the CSS itself need be included.
16394 \begin_layout Description
16395 \begin_inset Flex CharStyle:Code
16398 \begin_layout Plain Layout
16405 \begin_inset Flex CharStyle:Code
16408 \begin_layout Plain Layout
16414 ] The tag to be used for the main label, replacing
16415 \begin_inset Flex CharStyle:Code
16418 \begin_layout Plain Layout
16424 in the examples above.
16425 The default depends upon the setting of
16426 \begin_inset Flex CharStyle:Code
16429 \begin_layout Plain Layout
16436 \begin_inset Flex CharStyle:Code
16439 \begin_layout Plain Layout
16445 is true, the default is
16446 \begin_inset Flex CharStyle:Code
16449 \begin_layout Plain Layout
16455 ; if it is false, the default is
16456 \begin_inset Flex CharStyle:Code
16459 \begin_layout Plain Layout
16468 \begin_layout Subsection
16472 \begin_layout Standard
16473 The XHTML output for floats too can be controlled by layout information.
16474 The output has the following form:
16477 \begin_layout LyX-Code
16479 \begin_inset Quotes erd
16483 \begin_inset Quotes erd
16489 \begin_layout LyX-Code
16490 Contents of the float.
16493 \begin_layout LyX-Code
16497 \begin_layout Standard
16498 The caption, if there is one, is a separate inset and will be output as
16500 Its appearance can be controlled via the InsetLayout for caption insets.
16504 \begin_layout Description
16505 \begin_inset Flex CharStyle:Code
16508 \begin_layout Plain Layout
16515 \begin_inset Flex CharStyle:Code
16518 \begin_layout Plain Layout
16524 ] Specifies attribute information to be output with the main tag.
16526 \begin_inset Quotes eld
16530 \begin_inset Flex CharStyle:Code
16533 \begin_layout Plain Layout
16534 class=`myfloat' onclick=`\SpecialChar \ldots{}
16541 \begin_inset Quotes erd
16545 By default, LyX will output
16546 \begin_inset Quotes eld
16550 \begin_inset Flex CharStyle:Code
16553 \begin_layout Plain Layout
16554 class=`float float-floattype'
16560 \begin_inset Quotes erd
16564 \begin_inset Flex CharStyle:Code
16567 \begin_layout Plain Layout
16573 is LyX's name for this type of float, as determined by the float delcaration
16575 \begin_inset CommandInset ref
16577 reference "sub:Floats"
16581 ), though made lowercase and with non-alphanumeric characters converted
16582 to underscores, for example: float-table.
16585 \begin_layout Description
16586 \begin_inset Flex CharStyle:Code
16589 \begin_layout Plain Layout
16595 CSS style information to be included when this float is used.
16596 Note that this will automatically be wrapped in a layout-generated
16597 \begin_inset Flex CharStyle:Code
16600 \begin_layout Plain Layout
16606 block, so only the CSS itself need be included.
16609 \begin_layout Description
16610 \begin_inset Flex CharStyle:Code
16613 \begin_layout Plain Layout
16620 \begin_inset Flex CharStyle:Code
16623 \begin_layout Plain Layout
16629 ] The tag to be used for this float, replacing
16630 \begin_inset Quotes eld
16634 \begin_inset Flex CharStyle:Code
16637 \begin_layout Plain Layout
16644 \begin_inset Quotes erd
16647 in the example above.
16649 \begin_inset Flex CharStyle:Code
16652 \begin_layout Plain Layout
16658 and will rarely need changing.
16661 \begin_layout Subsection
16665 \begin_layout Standard
16666 We have several times mentioned that LyX will generate default CSS style
16667 rules for both insets and paragraph styles, based upon the other layout
16668 information that is provided.
16669 In this section, we shall say a word about which layout information LyX
16673 \begin_layout Standard
16674 At present, LyX auto-generates CSS only for font information, making use
16676 \begin_inset Flex CharStyle:Code
16679 \begin_layout Plain Layout
16686 \begin_inset Flex CharStyle:Code
16689 \begin_layout Plain Layout
16696 \begin_inset Flex CharStyle:Code
16699 \begin_layout Plain Layout
16706 \begin_inset Flex CharStyle:Code
16709 \begin_layout Plain Layout
16716 \begin_inset Flex CharStyle:Code
16719 \begin_layout Plain Layout
16727 \begin_inset CommandInset ref
16729 reference "sub:Font-description"
16733 .) The translation is mostly straightforward and obvious.
16735 \begin_inset Quotes eld
16739 \begin_inset Flex CharStyle:Code
16742 \begin_layout Plain Layout
16749 \begin_inset Quotes erd
16753 \begin_inset Quotes eld
16757 \begin_inset Flex CharStyle:Code
16760 \begin_layout Plain Layout
16761 font-family: sans-serif;
16767 \begin_inset Quotes erd
16771 The correspondence of LyX sizes and CSS sizes is a little less obvious
16772 but nonetheless intuitive.
16774 \begin_inset Flex CharStyle:Code
16777 \begin_layout Plain Layout
16784 \begin_inset Flex URL
16787 \begin_layout Plain Layout
16798 \begin_layout Chapter
16799 Including External Material
16802 \begin_layout Standard
16803 \begin_inset Box Shadowbox
16812 height_special "totalheight"
16815 \begin_layout Plain Layout
16816 WARNING: This portion of the documentation has not been updated for some
16818 We certainly hope that it is still accurate, but there are no guarantees.
16826 \begin_layout Standard
16827 The use of material from sources external to LyX is covered in detail in
16833 This part of the manual covers what needs to happen behind the scenes for
16834 new sorts of material to be included.
16837 \begin_layout Section
16841 \begin_layout Standard
16842 The external material feature is based on the concept of a
16847 A template is a specification of how LyX should interface with a certain
16849 As bundled, LyX comes with predefined templates for Xfig figures, various
16850 raster format images, chess diagrams, and LilyPond music notation.
16851 You can check the actual list by using the menu
16852 \begin_inset Flex CharStyle:MenuItem
16855 \begin_layout Plain Layout
16856 Insert\SpecialChar \menuseparator
16857 File\SpecialChar \menuseparator
16864 Furthermore, it is possible to roll your own template to support a specific
16866 Later we'll describe in more detail what is involved, and hopefully you
16867 will submit all the templates you create so we can include them in a later
16871 \begin_layout Standard
16872 Another basic idea of the external material feature is to distinguish between
16873 the original file that serves as a base for final material and the produced
16874 file that is included in your exported or printed document.
16875 For example, consider the case of a figure produced with
16876 \begin_inset Flex CharStyle:Code
16879 \begin_layout Plain Layout
16886 The Xfig application itself works on an original file with the
16887 \begin_inset Flex CharStyle:Code
16890 \begin_layout Plain Layout
16897 Within Xfig, you create and change your figure, and when you are done,
16899 \begin_inset Flex CharStyle:Code
16902 \begin_layout Plain Layout
16909 When you want to include the figure in your document, you invoke
16910 \begin_inset Flex CharStyle:Code
16913 \begin_layout Plain Layout
16919 in order to create a PostScript file that can readily be included in your
16922 \begin_inset Flex CharStyle:Code
16925 \begin_layout Plain Layout
16931 file is the original file, and the PostScript file is the produced file.
16934 \begin_layout Standard
16935 This distinction is important in order to allow updating of the material
16936 while you are in the process of writing the document.
16937 Furthermore, it provides us with the flexibility that is needed to support
16938 multiple export formats.
16939 For instance, in the case of a plain text file, it is not exactly an award-winn
16940 ing idea to include the figure as raw PostScript.
16941 Instead, you'd either prefer to just include a reference to the figure
16942 or try to invoke some graphics to ASCII converter to make the final result
16943 look similar to the real graphics.
16944 The external material management allows you to do this, because it is parametri
16945 zed on the different export formats that LyX supports.
16948 \begin_layout Standard
16949 Besides supporting the production of different products according to the
16950 exported format, it supports tight integration with editing and viewing
16952 In the case of an Xfig figure, you are able to invoke Xfig on the original
16953 file with a single click from within the external material dialog in LyX,
16954 and also preview the produced PostScript file with Ghostview with another
16956 No more fiddling around with the command line and/or file browsers to locate
16957 and manipulate the original or produced files.
16958 In this way, you are finally able to take full advantage of the many different
16959 applications that are relevant to use when you write your documents, and
16960 ultimately be more productive.
16963 \begin_layout Section
16964 The external template configuration file
16967 \begin_layout Standard
16968 It is relatively easy to add custom external template definitions to LyX.
16969 However, be aware that doing this in an careless manner most probably
16973 introduce an easily exploitable security hole.
16974 So before you do this, please read the discussion about security in section
16976 \begin_inset CommandInset ref
16978 reference "sec:Security-discussion"
16985 \begin_layout Standard
16986 Having said that, we encourage you to submit any interesting templates that
16991 \begin_layout Standard
16992 The external templates are defined in the
16993 \begin_inset Flex CharStyle:Code
16996 \begin_layout Plain Layout
16997 LyXDir/lib/external_templates
17003 You can place your own version in
17004 \begin_inset Flex CharStyle:Code
17007 \begin_layout Plain Layout
17008 UserDir/external_templates
17016 \begin_layout Standard
17017 A typical template looks like this:
17020 \begin_layout LyX-Code
17024 \begin_layout LyX-Code
17025 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
17028 \begin_layout LyX-Code
17032 \begin_layout LyX-Code
17036 \begin_layout LyX-Code
17040 \begin_layout LyX-Code
17044 \begin_layout LyX-Code
17048 \begin_layout LyX-Code
17049 AutomaticProduction true
17052 \begin_layout LyX-Code
17056 \begin_layout LyX-Code
17060 \begin_layout LyX-Code
17064 \begin_layout LyX-Code
17065 TransformCommand Rotate RotationLatexCommand
17068 \begin_layout LyX-Code
17069 TransformCommand Resize ResizeLatexCommand
17072 \begin_layout LyX-Code
17073 Product "$$RotateFront$$ResizeFront
17076 \begin_layout LyX-Code
17081 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
17084 \begin_layout LyX-Code
17085 $$ResizeBack$$RotateBack"
17088 \begin_layout LyX-Code
17092 \begin_layout LyX-Code
17093 UpdateResult "$$AbsPath$$Basename.pstex_t"
17096 \begin_layout LyX-Code
17097 Requirement "graphicx"
17100 \begin_layout LyX-Code
17101 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
17104 \begin_layout LyX-Code
17105 ReferencedFile latex "$$AbsPath$$Basename.eps"
17108 \begin_layout LyX-Code
17109 ReferencedFile dvi "$$AbsPath$$Basename.eps"
17112 \begin_layout LyX-Code
17116 \begin_layout LyX-Code
17120 \begin_layout LyX-Code
17121 TransformCommand Rotate RotationLatexCommand
17124 \begin_layout LyX-Code
17125 TransformCommand Resize ResizeLatexCommand
17128 \begin_layout LyX-Code
17129 Product "$$RotateFront$$ResizeFront
17132 \begin_layout LyX-Code
17137 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
17140 \begin_layout LyX-Code
17141 $$ResizeBack$$RotateBack"
17144 \begin_layout LyX-Code
17145 UpdateFormat pdftex
17148 \begin_layout LyX-Code
17149 UpdateResult "$$AbsPath$$Basename.pdftex_t"
17152 \begin_layout LyX-Code
17153 Requirement "graphicx"
17156 \begin_layout LyX-Code
17157 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
17160 \begin_layout LyX-Code
17161 ReferencedFile latex "$$AbsPath$$Basename.pdf"
17164 \begin_layout LyX-Code
17168 \begin_layout LyX-Code
17172 \begin_layout LyX-Code
17173 Product "$$Contents(
17175 "$$AbsPath$$Basename.asc
17180 \begin_layout LyX-Code
17181 UpdateFormat asciixfig
17184 \begin_layout LyX-Code
17185 UpdateResult "$$AbsPath$$Basename.asc"
17188 \begin_layout LyX-Code
17192 \begin_layout LyX-Code
17196 \begin_layout LyX-Code
17197 Product "<graphic fileref=
17199 "$$AbsOrRelPathMaster$$Basename.eps
17204 \begin_layout LyX-Code
17208 \begin_layout LyX-Code
17212 \begin_layout LyX-Code
17213 UpdateResult "$$AbsPath$$Basename.eps"
17216 \begin_layout LyX-Code
17217 ReferencedFile docbook "$$AbsPath$$Basename.eps"
17220 \begin_layout LyX-Code
17221 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
17224 \begin_layout LyX-Code
17228 \begin_layout LyX-Code
17229 Product "[XFig: $$FName]"
17232 \begin_layout LyX-Code
17236 \begin_layout LyX-Code
17240 \begin_layout Standard
17241 As you can see, the template is enclosed in
17242 \begin_inset Flex CharStyle:Code
17245 \begin_layout Plain Layout
17251 \SpecialChar \ldots{}
17253 \begin_inset Flex CharStyle:Code
17256 \begin_layout Plain Layout
17263 It contains a header specifying some general settings and, for each supported
17264 primary document file format, a section
17265 \begin_inset Flex CharStyle:Code
17268 \begin_layout Plain Layout
17274 \SpecialChar \ldots{}
17276 \begin_inset Flex CharStyle:Code
17279 \begin_layout Plain Layout
17288 \begin_layout Subsection
17289 The template header
17292 \begin_layout Description
17293 \begin_inset Flex CharStyle:Code
17296 \begin_layout Plain Layout
17297 AutomaticProduction
17298 \begin_inset space ~
17306 Whether the file represented by the template must be generated by LyX.
17307 This command must occur exactly once.
17310 \begin_layout Description
17311 \begin_inset Flex CharStyle:Code
17314 \begin_layout Plain Layout
17316 \begin_inset space ~
17324 A glob pattern that is used in the file dialog to filter out the desired
17326 If there is more than one possible file extension (e.
17327 \begin_inset space \thinspace{}
17331 \begin_inset space \space{}
17335 \begin_inset Flex CharStyle:Code
17338 \begin_layout Plain Layout
17345 \begin_inset Flex CharStyle:Code
17348 \begin_layout Plain Layout
17354 ), use something like
17355 \begin_inset Flex CharStyle:Code
17358 \begin_layout Plain Layout
17365 This command must occur exactly once.
17368 \begin_layout Description
17369 \begin_inset Flex CharStyle:Code
17372 \begin_layout Plain Layout
17374 \begin_inset space ~
17382 The text that is displayed on the button.
17383 This command must occur exactly once.
17386 \begin_layout Description
17387 \begin_inset Flex CharStyle:Code
17390 \begin_layout Plain Layout
17392 \begin_inset space ~
17396 \begin_inset space ~
17404 The help text that is used in the External dialog.
17405 Provide enough information to explain to the user just what the template
17406 can provide him with.
17407 This command must occur exactly once.
17410 \begin_layout Description
17411 \begin_inset Flex CharStyle:Code
17414 \begin_layout Plain Layout
17416 \begin_inset space ~
17424 The file format of the original file.
17425 This must be the name of a format that is known to LyX (see section
17426 \begin_inset CommandInset ref
17428 reference "sec:Formats"
17434 \begin_inset Quotes eld
17438 \begin_inset Flex CharStyle:Code
17441 \begin_layout Plain Layout
17448 \begin_inset Quotes erd
17451 if the template can handle original files of more than one format.
17452 LyX will attempt to interrogate the file itself in order to deduce its
17453 format in this case.
17454 This command must occur exactly once.
17457 \begin_layout Description
17458 \begin_inset Flex CharStyle:Code
17461 \begin_layout Plain Layout
17463 \begin_inset space ~
17471 A unique name for the template.
17472 It must not contain substitution macros (see below).
17475 \begin_layout Description
17476 \begin_inset Flex CharStyle:Code
17479 \begin_layout Plain Layout
17481 \begin_inset space ~
17484 Rotate|Resize|Clip|Extra
17489 This command specifies which transformations are supported by this template.
17490 It may occur zero or more times.
17491 This command enables the corresponding tabs in the external dialog.
17493 \begin_inset Flex CharStyle:Code
17496 \begin_layout Plain Layout
17502 command must have either a corresponding
17503 \begin_inset Flex CharStyle:Code
17506 \begin_layout Plain Layout
17513 \begin_inset Flex CharStyle:Code
17516 \begin_layout Plain Layout
17523 \begin_inset Flex CharStyle:Code
17526 \begin_layout Plain Layout
17533 Otherwise the transformation will not be supported by that format.
17536 \begin_layout Subsection
17540 \begin_layout Description
17541 \begin_inset Flex CharStyle:Code
17544 \begin_layout Plain Layout
17546 \begin_inset space ~
17549 LaTeX|PDFLaTeX|PlainText|DocBook
17554 The primary document file format that this format definition is for.
17555 Not every template has a sensible representation in all document file formats.
17556 Please define nevertheless a
17557 \begin_inset Flex CharStyle:Code
17560 \begin_layout Plain Layout
17566 section for all formats.
17567 Use a dummy text when no representation is available.
17568 Then you can at least see a reference to the external material in the exported
17572 \begin_layout Description
17573 \begin_inset Flex CharStyle:Code
17576 \begin_layout Plain Layout
17578 \begin_inset space ~
17582 \begin_inset space ~
17590 This command defines an additional macro
17591 \begin_inset Flex CharStyle:Code
17594 \begin_layout Plain Layout
17600 for substitution in
17601 \begin_inset Flex CharStyle:Code
17604 \begin_layout Plain Layout
17612 \begin_inset Flex CharStyle:Code
17615 \begin_layout Plain Layout
17621 itself may contain substitution macros.
17622 The advantage over using
17623 \begin_inset Flex CharStyle:Code
17626 \begin_layout Plain Layout
17633 \begin_inset Flex CharStyle:Code
17636 \begin_layout Plain Layout
17642 is that the substituted value of
17643 \begin_inset Flex CharStyle:Code
17646 \begin_layout Plain Layout
17652 is sanitized so that it is a valid optional argument in the document format.
17653 This command may occur zero or more times.
17656 \begin_layout Description
17657 \begin_inset Flex CharStyle:Code
17660 \begin_layout Plain Layout
17662 \begin_inset space ~
17670 The text that is inserted in the exported document.
17671 This is actually the most important command and can be quite complex.
17672 This command must occur exactly once.
17675 \begin_layout Description
17676 \begin_inset Flex CharStyle:Code
17679 \begin_layout Plain Layout
17681 \begin_inset space ~
17689 This command specifies a preamble snippet that will be included in the
17691 It has to be defined using
17692 \begin_inset Flex CharStyle:Code
17695 \begin_layout Plain Layout
17701 \SpecialChar \ldots{}
17703 \begin_inset Flex CharStyle:Code
17706 \begin_layout Plain Layout
17713 This command may occur zero or more times.
17716 \begin_layout Description
17717 \begin_inset Flex CharStyle:Code
17720 \begin_layout Plain Layout
17722 \begin_inset space ~
17726 \begin_inset space ~
17734 This command denotes files that are created by the conversion process and
17735 are needed for a particular export format.
17736 If the filename is relative, it is interpreted relative to the master document.
17737 This command may be given zero or more times.
17740 \begin_layout Description
17741 \begin_inset Flex CharStyle:Code
17744 \begin_layout Plain Layout
17746 \begin_inset space ~
17754 The name of a required LaTeX package.
17755 The package is included via
17756 \begin_inset Flex CharStyle:Code
17759 \begin_layout Plain Layout
17767 in the LaTeX preamble.
17768 This command may occur zero or more times.
17771 \begin_layout Description
17772 \begin_inset Flex CharStyle:Code
17775 \begin_layout Plain Layout
17777 \begin_inset space ~
17781 \begin_inset space ~
17784 RotationLatexCommand
17789 This command specifies that the built in LaTeX command should be used for
17791 This command may occur once or not at all.
17794 \begin_layout Description
17795 \begin_inset Flex CharStyle:Code
17798 \begin_layout Plain Layout
17800 \begin_inset space ~
17804 \begin_inset space ~
17812 This command specifies that the built in LaTeX command should be used for
17814 This command may occur once or not at all.
17817 \begin_layout Description
17818 \begin_inset Flex CharStyle:Code
17821 \begin_layout Plain Layout
17823 \begin_inset space ~
17827 \begin_inset space ~
17830 RotationLatexOption
17835 This command specifies that rotation is done via an optional argument.
17836 This command may occur once or not at all.
17839 \begin_layout Description
17840 \begin_inset Flex CharStyle:Code
17843 \begin_layout Plain Layout
17845 \begin_inset space ~
17849 \begin_inset space ~
17857 This command specifies that resizing is done via an optional argument.
17858 This command may occur once or not at all.
17861 \begin_layout Description
17862 \begin_inset Flex CharStyle:Code
17865 \begin_layout Plain Layout
17867 \begin_inset space ~
17871 \begin_inset space ~
17879 This command specifies that clipping is done via an optional argument.
17880 This command may occur once or not at all.
17883 \begin_layout Description
17884 \begin_inset Flex CharStyle:Code
17887 \begin_layout Plain Layout
17889 \begin_inset space ~
17893 \begin_inset space ~
17901 This command specifies that an extra optional argument is used.
17902 This command may occur once or not at all.
17905 \begin_layout Description
17906 \begin_inset Flex CharStyle:Code
17909 \begin_layout Plain Layout
17911 \begin_inset space ~
17919 The file format of the converted file.
17920 This must be the name of a format that is known to LyX (see the
17921 \begin_inset Flex CharStyle:MenuItem
17924 \begin_layout Plain Layout
17929 ools\SpecialChar \menuseparator
17934 references:Conversion
17940 This command must occur exactly once.
17943 \begin_layout Description
17944 \begin_inset Flex CharStyle:Code
17947 \begin_layout Plain Layout
17949 \begin_inset space ~
17957 The file name of the converted file.
17958 The file name must be absolute.
17959 This command must occur exactly once.
17962 \begin_layout Subsection
17963 Preamble definitions
17966 \begin_layout Standard
17967 The external template configuration file may contain additional preamble
17968 definitions enclosed by
17969 \begin_inset Flex CharStyle:Code
17972 \begin_layout Plain Layout
17978 \SpecialChar \ldots{}
17980 \begin_inset Flex CharStyle:Code
17983 \begin_layout Plain Layout
17990 They can be used by the templates in the
17991 \begin_inset Flex CharStyle:Code
17994 \begin_layout Plain Layout
18003 \begin_layout Section
18004 The substitution mechanism
18007 \begin_layout Standard
18008 When the external material facility invokes an external program, it is done
18009 on the basis of a command defined in the template configuration file.
18010 These commands can contain various macros that are expanded before execution.
18011 Execution always take place in the directory of the containing document.
18014 \begin_layout Standard
18015 Also, whenever external material is to be displayed, the name will be produced
18016 by the substitution mechanism, and most other commands in the template
18017 definition support substitution as well.
18020 \begin_layout Standard
18021 The available macros are the following:
18024 \begin_layout Description
18025 \begin_inset Flex CharStyle:Code
18028 \begin_layout Plain Layout
18029 $$AbsOrRelPathMaster
18034 The file path, absolute or relative to the master LyX document.
18037 \begin_layout Description
18038 \begin_inset Flex CharStyle:Code
18041 \begin_layout Plain Layout
18042 $$AbsOrRelPathParent
18047 The file path, absolute or relative to the LyX document.
18050 \begin_layout Description
18051 \begin_inset Flex CharStyle:Code
18054 \begin_layout Plain Layout
18060 The absolute file path.
18063 \begin_layout Description
18064 \begin_inset Flex CharStyle:Code
18067 \begin_layout Plain Layout
18073 The filename without path and without the extension.
18076 \begin_layout Description
18077 \begin_inset Flex CharStyle:Code
18080 \begin_layout Plain Layout
18082 \begin_inset Quotes eld
18086 \begin_inset Quotes erd
18094 This macro will expand to the contents of the file with the name
18095 \begin_inset Flex CharStyle:Code
18098 \begin_layout Plain Layout
18107 \begin_layout Description
18108 \begin_inset Flex CharStyle:Code
18111 \begin_layout Plain Layout
18117 The file extension (including the dot).
18120 \begin_layout Description
18121 \begin_inset Flex CharStyle:Code
18124 \begin_layout Plain Layout
18130 The filename of the file specified in the external material dialog.
18131 This is either an absolute name, or it is relative to the LyX document.
18134 \begin_layout Description
18135 \begin_inset Flex CharStyle:Code
18138 \begin_layout Plain Layout
18145 \begin_inset Flex CharStyle:Code
18148 \begin_layout Plain Layout
18154 (absolute name or relative to the LyX document).
18157 \begin_layout Description
18158 \begin_inset Flex CharStyle:Code
18161 \begin_layout Plain Layout
18167 The file path, relative to the master LyX document.
18170 \begin_layout Description
18171 \begin_inset Flex CharStyle:Code
18174 \begin_layout Plain Layout
18180 The file path, relative to the LyX document.
18183 \begin_layout Description
18184 \begin_inset Flex CharStyle:Code
18187 \begin_layout Plain Layout
18193 This macro will expand to the absolute path of the system directory.
18194 This is typically used to point to the various helper scripts that are
18198 \begin_layout Description
18199 \begin_inset Flex CharStyle:Code
18202 \begin_layout Plain Layout
18208 A name and full path to a temporary file which will be automatically deleted
18209 whenever the containing document is closed, or the external material insertion
18213 \begin_layout Standard
18214 All path macros contain a trailing directory separator, so you can construct
18216 \begin_inset space \thinspace{}
18220 \begin_inset space \space{}
18223 the absolute filename with
18224 \begin_inset Flex CharStyle:Code
18227 \begin_layout Plain Layout
18228 $$AbsPath$$Basename$$Extension
18236 \begin_layout Standard
18237 The macros above are substituted in all commands unless otherwise noted.
18239 \begin_inset Flex CharStyle:Code
18242 \begin_layout Plain Layout
18248 supports additionally the following substitutions if they are enabled by
18250 \begin_inset Flex CharStyle:Code
18253 \begin_layout Plain Layout
18260 \begin_inset Flex CharStyle:Code
18263 \begin_layout Plain Layout
18272 \begin_layout Description
18273 \begin_inset Flex CharStyle:Code
18276 \begin_layout Plain Layout
18282 The front part of the resize command.
18285 \begin_layout Description
18286 \begin_inset Flex CharStyle:Code
18289 \begin_layout Plain Layout
18295 The back part of the resize command.
18298 \begin_layout Description
18299 \begin_inset Flex CharStyle:Code
18302 \begin_layout Plain Layout
18308 The front part of the rotation command.
18311 \begin_layout Description
18312 \begin_inset Flex CharStyle:Code
18315 \begin_layout Plain Layout
18321 The back part of the rotation command.
18324 \begin_layout Standard
18325 The value string of the
18326 \begin_inset Flex CharStyle:Code
18329 \begin_layout Plain Layout
18335 command supports additionally the following substitutions if they are enabled
18337 \begin_inset Flex CharStyle:Code
18340 \begin_layout Plain Layout
18347 \begin_inset Flex CharStyle:Code
18350 \begin_layout Plain Layout
18359 \begin_layout Description
18360 \begin_inset Flex CharStyle:Code
18363 \begin_layout Plain Layout
18372 \begin_layout Description
18373 \begin_inset Flex CharStyle:Code
18376 \begin_layout Plain Layout
18385 \begin_layout Description
18386 \begin_inset Flex CharStyle:Code
18389 \begin_layout Plain Layout
18398 \begin_layout Description
18399 \begin_inset Flex CharStyle:Code
18402 \begin_layout Plain Layout
18408 The rotation option.
18411 \begin_layout Standard
18412 You may ask why there are so many path macros.
18413 There are mainly two reasons:
18416 \begin_layout Enumerate
18417 Relative and absolute file names should remain relative or absolute, respectivel
18419 Users may have reasons to prefer either form.
18420 Relative names are useful for portable documents that should work on different
18421 machines, for example.
18422 Absolute names may be required by some programs.
18425 \begin_layout Enumerate
18426 LaTeX treats relative file names differently than LyX and other programs
18427 in nested included files.
18428 For LyX, a relative file name is always relative to the document that contains
18430 For LaTeX, it is always relative to the master document.
18431 These two definitions are identical if you have only one document, but
18432 differ if you have a master document that includes part documents.
18433 That means that relative filenames must be transformed when presented to
18435 Fortunately LyX does this automatically for you if you choose the right
18439 \begin_layout Standard
18440 So which path macro should be used in new template definitions? The rule
18444 \begin_layout Itemize
18446 \begin_inset Flex CharStyle:Code
18449 \begin_layout Plain Layout
18455 if an absolute path is required.
18458 \begin_layout Itemize
18460 \begin_inset Flex CharStyle:Code
18463 \begin_layout Plain Layout
18464 $$AbsOrRelPathMaster
18469 if the substituted string is some kind of LaTeX input.
18472 \begin_layout Itemize
18474 \begin_inset Flex CharStyle:Code
18477 \begin_layout Plain Layout
18478 $$AbsOrRelPathParent
18483 in order to preserve the user's choice.
18486 \begin_layout Standard
18487 There are special cases where this rule does not work and e.
18488 \begin_inset space \thinspace{}
18492 \begin_inset space \space{}
18495 relative names are needed, but normally it will work just fine.
18496 One example for such a case is the command
18497 \begin_inset Flex CharStyle:Code
18500 \begin_layout Plain Layout
18501 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18506 in the XFig template above: We can't use the absolute name because the
18508 \begin_inset Flex CharStyle:Code
18511 \begin_layout Plain Layout
18517 files needs the relative name in order to rewrite the file content.
18520 \begin_layout Section
18521 Security discussion
18522 \begin_inset CommandInset label
18524 name "sec:Security-discussion"
18531 \begin_layout Standard
18532 The external material feature interfaces with a lot of external programs
18533 and does so automatically, so we have to consider the security implications
18535 In particular, since you have the option of including your own filenames
18536 and/or parameter strings and those are expanded into a command, it seems
18537 that it would be possible to create a malicious document which executes
18538 arbitrary commands when a user views or prints the document.
18539 This is something we definitely want to avoid.
18542 \begin_layout Standard
18543 However, since the external program commands are specified in the template
18544 configuration file only, there are no security issues if LyX is properly
18545 configured with safe templates only.
18546 This is so because the external programs are invoked with the
18547 \begin_inset Flex CharStyle:Code
18550 \begin_layout Plain Layout
18556 -system call rather than the
18557 \begin_inset Flex CharStyle:Code
18560 \begin_layout Plain Layout
18566 system-call, so it's not possible to execute arbitrary commands from the
18567 filename or parameter section via the shell.
18570 \begin_layout Standard
18571 This also implies that you are restricted in what command strings you can
18572 use in the external material templates.
18573 In particular, pipes and redirection are not readily available.
18574 This has to be so if LyX should remain safe.
18575 If you want to use some of the shell features, you should write a safe
18576 script to do this in a controlled manner, and then invoke the script from
18577 the command string.
18581 \begin_layout Standard
18582 It is possible to design a template that interacts directly with the shell,
18583 but since this would allow a malicious user to execute arbitrary commands
18584 by writing clever filenames and/or parameters, we generally recommend that
18585 you only use safe scripts that work with the
18586 \begin_inset Flex CharStyle:Code
18589 \begin_layout Plain Layout
18595 system call in a controlled manner.
18596 Of course, for use in a controlled environment, it can be tempting to just
18597 fall back to use ordinary shell scripts.
18598 If you do so, be aware that you
18602 provide an easily exploitable security hole in your system.
18603 Of course it stands to reason that such unsafe templates will never be
18604 included in the standard LyX distribution, although we do encourage people
18605 to submit new templates in the open source tradition.
18606 But LyX as shipped from the official distribution channels will never have
18610 \begin_layout Standard
18611 Including external material provides a lot of power, and you have to be
18612 careful not to introduce security hazards with this power.
18613 A subtle error in a single line in an innocent looking script can open
18614 the door to huge security problems.
18615 So if you do not fully understand the issues, we recommend that you consult
18616 a knowledgeable security professional or the LyX development team if you
18617 have any questions about whether a given template is safe or not.
18618 And do this before you use it in an uncontrolled environment.