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
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.
5311 What it knows is contained in layout files.
5314 \begin_layout Standard
5315 You can think of the layout file for a given document class as a translation
5316 manual between LyX constructs---paragraphs with their corresponding styles,
5317 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5319 Almost everything LyX knows about
5320 \begin_inset Flex CharStyle:Code
5323 \begin_layout Plain Layout
5329 , for example, is contained in the file
5330 \begin_inset Flex CharStyle:Code
5333 \begin_layout Plain Layout
5339 and in various other files it includes.
5340 For this reason, anyone intending to write layout files should plan to
5341 study the existing files.
5342 A good place to start is with
5343 \begin_inset Flex CharStyle:Code
5346 \begin_layout Plain Layout
5352 , which is included in
5353 \begin_inset Flex CharStyle:Code
5356 \begin_layout Plain Layout
5363 \begin_inset Flex CharStyle:Code
5366 \begin_layout Plain Layout
5372 , and many of the other layout files for document classes.
5373 This file is where sections and the like are defined:
5374 \begin_inset Flex CharStyle:Code
5377 \begin_layout Plain Layout
5383 tells LyX how paragraphs that are marked with the Section, Subsection,
5384 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5387 \begin_inset Flex CharStyle:Code
5390 \begin_layout Plain Layout
5396 file basically just includes several of these
5397 \begin_inset Flex CharStyle:Code
5400 \begin_layout Plain Layout
5409 \begin_layout Standard
5410 Defining the LyX--LaTeX correspondence is not the only thing layout files
5412 Their other job is to define how the LyX constructs themselves will appear
5414 The fact that layout files have these two jobs is often a source of confusion,
5415 because they are completely separate.
5416 Telling LyX how to translate a certain paragraph style into LaTeX does
5417 not tell LyX how to display it; conversely, telling LyX how to display
5418 a certain paragraph style does not tell LyX how to translate it into LaTeX
5419 (let alone tell LaTeX how to display it).
5420 So, in general, when you define a new LyX construct, you must always do
5421 two quite separate things: (i)
5422 \begin_inset space ~
5425 tell LyX how to translate it into LaTeX and (ii)
5426 \begin_inset space ~
5429 tell LyX how to display it.
5432 \begin_layout Standard
5433 Much the same is true, of course, as regards LyX's other backend formats,
5434 though XHTML is in some ways different, because in that case LyX
5438 able, to some extent, to use information about how it should display a
5439 paragraph on the screen to output information (in the form of CSS) about
5440 how the paragraph should be displayed in a browser.
5441 Even in this case, however, the distinction between what LyX does internally
5442 and how things are rendered externally remains in force, and the two can
5443 be controlled separately.
5445 \begin_inset CommandInset ref
5446 LatexCommand prettyref
5447 reference "sec:Tags-for-XHTML"
5454 \begin_layout Section
5455 Installing new LaTeX files
5458 \begin_layout Standard
5459 Some installations may not include a LaTeX package or class file that you
5460 would like to use within LyX.
5461 For example, you might need FoilTeX, a package for preparing slides for
5462 overhead projectors.
5463 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5464 a user interface for installing such packages.
5465 For example, with MiKTeX, you start the program
5466 \begin_inset Quotes eld
5470 \begin_inset Quotes erd
5473 to get a list of available packages.
5474 To install one, right click on it or use the toolbar button to install
5479 \begin_layout Standard
5480 If your LaTeX distribution doesn't provide such a `package manager', or
5481 if the file is not available from your distribution, then you can follow
5482 these steps to install it manually.
5485 \begin_layout Enumerate
5486 Get the package from
5487 \begin_inset CommandInset href
5490 target "http://www.ctan.org/"
5497 \begin_layout Enumerate
5498 You can install the package in several different places.
5499 If you want it to be available for all users on your system, then you should
5500 install it in your `local' TeX tree; if you want (or need) it to be available
5501 just for you, then you can install it in your own `user' TeX tree.
5502 Where these trees should be created, if they do not already exist, depends
5503 upon the details of your system.
5504 To find out where they are, look in the file
5505 \begin_inset Flex CharStyle:Code
5508 \begin_layout Plain Layout
5518 \begin_layout Plain Layout
5519 This usually lives in the directory
5520 \begin_inset Flex CharStyle:Code
5523 \begin_layout Plain Layout
5529 , though you can run
5530 \begin_inset Flex CharStyle:Code
5533 \begin_layout Plain Layout
5544 The location of the `local' TeX tree is defined by the
5545 \begin_inset Flex CharStyle:Code
5548 \begin_layout Plain Layout
5554 variable; this is usually somewhere like
5555 \begin_inset Flex URL
5558 \begin_layout Plain Layout
5560 /usr/local/share/texmf/
5566 The location of the `user' TeX tree is defined by
5567 \begin_inset Flex CharStyle:Code
5570 \begin_layout Plain Layout
5577 \begin_inset Flex CharStyle:Code
5580 \begin_layout Plain Layout
5587 (If these variables are not predefined, you can define them.) You'll probably
5588 need root permissions to create or modify the `local' tree, but your `user'
5589 tree shouldn't have such limitations.
5592 \begin_layout Enumerate
5594 \begin_inset Flex CharStyle:Code
5597 \begin_layout Plain Layout
5604 \begin_inset Flex CharStyle:Code
5607 \begin_layout Plain Layout
5614 \begin_inset Flex CharStyle:Code
5617 \begin_layout Plain Layout
5624 \begin_inset space \thinspace{}
5628 \begin_inset Newline newline
5632 \begin_inset Flex CharStyle:Code
5635 \begin_layout Plain Layout
5636 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5642 \begin_inset Newline newline
5648 \begin_layout Enumerate
5649 Your local and user trees
5653 have the same sort of directory structure as your main existing
5654 \begin_inset Flex CharStyle:Code
5657 \begin_layout Plain Layout
5663 directory, which will be found at
5664 \begin_inset Flex CharStyle:Code
5667 \begin_layout Plain Layout
5674 \begin_inset Flex CharStyle:Code
5677 \begin_layout Plain Layout
5683 .) For example, latex packages should go under
5684 \begin_inset Flex CharStyle:Code
5687 \begin_layout Plain Layout
5688 $TEXMFLOCAL/tex/latex/
5694 \begin_inset Flex CharStyle:Code
5697 \begin_layout Plain Layout
5698 $TEXMFHOME/tex/latex/
5704 If you do not put them here, they probably will not work.
5707 \begin_layout Enumerate
5708 Once your tree is properly set up, you can install the package into an appropria
5710 If you are lucky, your package will have been provided as a so-called `TDS'
5711 (TeX Directory Structure) zip file.
5712 To install it, you want to unzip it from the top of your tree.
5713 So, for example, you can copy the file
5714 \begin_inset Flex CharStyle:Code
5717 \begin_layout Plain Layout
5724 \begin_inset Flex CharStyle:Code
5727 \begin_layout Plain Layout
5728 /home/yourname/texmf/
5733 and then, from inside that directory, just run:
5734 \begin_inset Flex CharStyle:Code
5737 \begin_layout Plain Layout
5744 This will extract the needed files and copy them where they need to be.
5745 \begin_inset Newline newline
5748 If you do not have a TDS file, then you have to do this manually.
5749 For example, you might install the FoilTeX files into
5750 \begin_inset Flex URL
5753 \begin_layout Plain Layout
5755 $TEXMFLOCAL/tex/latex/contrib/foiltex
5761 Why there? The CTAN download directories are themselves organized much
5762 like a TeX tree, and it isn't a bad idea to follow its structure when you
5763 install your own files.
5764 FoilTeX, as it happens, is found at
5765 \begin_inset Flex URL
5768 \begin_layout Plain Layout
5770 http://ctan.org/texarchive/macros/latex/contrib/foiltex/
5779 \begin_layout Enumerate
5780 Finally, you must update the database TeX uses to find files.
5781 On MiKTeX, this is done by pressing the button
5784 \begin_inset space ~
5789 that you find in MiKTeX's
5790 \begin_inset Quotes eld
5794 \begin_inset Quotes erd
5799 \begin_inset Flex CharStyle:Code
5802 \begin_layout Plain Layout
5803 $TEXMFLOCAL/tex/latex/
5809 Under TeXLive and the like, you should run
5810 \begin_inset Flex CharStyle:Code
5813 \begin_layout Plain Layout
5819 from a terminal, with root permissions if necessary.
5823 \begin_layout Standard
5824 Your package is now installed and available to LaTeX.
5825 You can verify this from a terminal by typing `
5826 \begin_inset Flex CharStyle:Code
5829 \begin_layout Plain Layout
5830 kpsewhich yourfile.ext
5836 To make LyX aware of it, however, you will need to reconfigure (
5837 \begin_inset Flex CharStyle:MenuItem
5840 \begin_layout Plain Layout
5841 Tools\SpecialChar \menuseparator
5847 ) and then restart LyX.
5848 If the new package was a document class, such as FoilTeX again, you will
5849 now see it available under
5850 \begin_inset Flex CharStyle:MenuItem
5853 \begin_layout Plain Layout
5854 Document\SpecialChar \menuseparator
5855 Settings\SpecialChar \menuseparator
5862 \begin_inset Flex CharStyle:MenuItem
5865 \begin_layout Plain Layout
5874 \begin_layout Standard
5875 What if there isn't a layout file is available for your new document class?
5876 Then, unfortunately, LyX will know nothing about it until you create a
5877 layout file yourself (or get someone else to do it).
5878 That is the topic of the next section.
5881 \begin_layout Section
5882 Types of layout files
5885 \begin_layout Standard
5886 This section describes the various sorts of LyX files that contain layout
5888 These files describe various paragraph and character styles, determining
5889 how LyX should display them and how they should be translated into LaTeX,
5890 DocBook, XHTML, or whatever output format is being used.
5894 \begin_layout Standard
5895 We shall try to provide a thorough description of the process of writing
5897 However, there are so many different types of documents supported even
5898 by just LaTeX that we can't hope to cover every different possibility or
5899 problem you might encounter.
5900 The LyX users' list is frequented by people with lots of experience with
5901 layout design who are willing to share what they've learned, so please
5902 feel free to ask questions there.
5905 \begin_layout Standard
5906 As you prepare to write a new layout, it is extremely helpful to look at
5907 the layouts distributed with LyX.
5908 If you write a LyX layout for a LaTeX document class that might also be
5909 used by others, or write a module that might be useful to others, then
5910 you should consider posting your layout to the
5911 \begin_inset CommandInset href
5913 name "layout section on the LyX wiki"
5914 target "http://wiki.lyx.org/Layouts/Layouts"
5918 or even to the LyX developers' list, so that it might be included in LyX
5923 \begin_layout Plain Layout
5924 Note that LyX is licensed under the General Public License, so any material
5925 that is contribued to LyX must be similarly licensed.
5933 \begin_layout Subsection
5935 \begin_inset CommandInset label
5937 name "sub:Layout-modules"
5944 \begin_layout Standard
5945 We have spoken to this point about `layout files'.
5946 But there are different sorts of files that contain layout information.
5947 Layout files, strictly so called, have the
5948 \begin_inset Flex CharStyle:Code
5951 \begin_layout Plain Layout
5957 extension and provide LyX with information about document classes.
5958 As of LyX 1.6, however, layout information can also be contained in layout
5964 \begin_inset Flex CharStyle:Code
5967 \begin_layout Plain Layout
5974 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5975 some modules—such as the
5976 \begin_inset Flex CharStyle:Code
5979 \begin_layout Plain Layout
5985 module—specifcally provide support for one package.
5986 In a sense, layout modules are similar to included
5990 \begin_layout Plain Layout
5991 These can have any extension, but by convention have the
5992 \begin_inset Flex CharStyle:Code
5995 \begin_layout Plain Layout
6007 \begin_inset Flex CharStyle:Code
6010 \begin_layout Plain Layout
6016 —in that modules are not specific to a given document class but may be used
6017 with many different classes.
6018 The difference is that using an included file with
6019 \begin_inset Flex CharStyle:Code
6022 \begin_layout Plain Layout
6028 requires editing that file.
6029 Modules, by contrast, are selected in the
6030 \begin_inset Flex CharStyle:MenuItem
6033 \begin_layout Plain Layout
6034 Document\SpecialChar \menuseparator
6043 \begin_layout Standard
6044 Building modules is the easiest way to get started with layout editing,
6045 since it can be as simple as adding a single new paragraph style or flex
6047 But modules may, in principle, contain anything a layout file can contain.
6050 \begin_layout Standard
6051 After creating a new module and copying it to the
6052 \begin_inset Flex CharStyle:Code
6055 \begin_layout Plain Layout
6061 folder, you will need to reconfigure and then restart LyX for the module
6062 to appear in the menu.
6063 However, changes you make to the module will be seen immediately, if you
6065 \begin_inset Flex CharStyle:MenuItem
6068 \begin_layout Plain Layout
6069 Document\SpecialChar \menuseparator
6075 , highlight something, and then hit
6076 \begin_inset Quotes eld
6080 \begin_inset Quotes erd
6086 It is strongly recommended that you save your work before doing this
6091 it is strongly recommended that you not attempt to edit modules while simultaneo
6092 usly working on actual documents
6095 Though of course the developers strive to keep LyX stable in such situations,
6096 syntax errors and the like in your module file could cause strange behavior.
6099 \begin_layout Subsection
6101 \begin_inset Flex CharStyle:MenuItem
6104 \begin_layout Plain Layout
6113 \begin_layout Standard
6114 There are two situations you are likely to encounter when wanting to support
6115 a new LaTeX document class, involving LaTeX2e class (
6116 \begin_inset Flex CharStyle:Code
6119 \begin_layout Plain Layout
6126 \begin_inset Flex CharStyle:Code
6129 \begin_layout Plain Layout
6136 Supporting a style file is usually fairly easy.
6137 Supporting a new class file is a bit harder.
6138 We'll discuss the former in this section and the latter in the next.
6139 Similar remarks apply, of course, if you want to support a new DocBook
6143 \begin_layout Standard
6144 The easier case is the one in which your new document class is provided
6145 as a style file that is to be used in conjunction with an already supported
6147 For the sake of the example, we'll assume that the style file is called
6149 \begin_inset Flex CharStyle:MenuItem
6152 \begin_layout Plain Layout
6158 and that it is meant to be used with
6159 \begin_inset Flex CharStyle:MenuItem
6162 \begin_layout Plain Layout
6168 , which is a standard class.
6172 \begin_layout Standard
6173 Start by copying the existing class's layout file into your local directory:
6177 \begin_layout Plain Layout
6178 Of course, which directory is your local directory will vary by platform,
6179 and LyX allows you to specify your local directory on startup, too, using
6181 \begin_inset Flex CharStyle:Code
6184 \begin_layout Plain Layout
6198 \begin_layout LyX-Code
6199 cp report.layout ~/.lyx/layouts/myclass.layout
6202 \begin_layout Standard
6204 \begin_inset Flex CharStyle:Code
6207 \begin_layout Plain Layout
6213 and change the line:
6216 \begin_layout LyX-Code
6219 DeclareLaTeXClass{report}
6222 \begin_layout Standard
6226 \begin_layout LyX-Code
6229 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6232 \begin_layout Standard
6236 \begin_layout LyX-Code
6238 \begin_inset Newline newline
6244 \begin_inset Newline newline
6250 \begin_layout Standard
6251 near the top of the file.
6254 \begin_layout Standard
6255 Start LyX and select
6256 \begin_inset Flex CharStyle:MenuItem
6259 \begin_layout Plain Layout
6260 Tools\SpecialChar \menuseparator
6267 Then restart LyX and try creating a new document.
6269 \begin_inset Flex CharStyle:MenuItem
6272 \begin_layout Plain Layout
6278 " as a document class option in the
6279 \begin_inset Flex CharStyle:MenuItem
6282 \begin_layout Plain Layout
6283 Document\SpecialChar \menuseparator
6290 It is likely that some of the sectioning commands and such in your new
6291 class will work differently from how they worked in the base class—
6292 \begin_inset Flex CharStyle:Code
6295 \begin_layout Plain Layout
6301 in this example—so you can fiddle around with the settings for the different
6302 sections if you wish.
6303 The layout information for sections is contained in
6304 \begin_inset Flex CharStyle:Code
6307 \begin_layout Plain Layout
6313 , but you do not need to copy and change this file.
6314 Instead, you can simply add your changes to your layout file, after the
6316 \begin_inset Flex CharStyle:Code
6319 \begin_layout Plain Layout
6325 , which itself includes
6326 \begin_inset Flex CharStyle:Code
6329 \begin_layout Plain Layout
6336 For example, you might add these lines:
6339 \begin_layout LyX-Code
6343 \begin_layout LyX-Code
6347 \begin_layout LyX-Code
6351 \begin_layout LyX-Code
6355 \begin_layout LyX-Code
6359 \begin_layout Standard
6360 to change the font for chapter headings to sans-serif.
6361 This will override (or, in this case, add to) the existing declaration
6362 for the Chapter style.
6366 \begin_layout Standard
6367 Your new package may also provide commands or environments not present in
6369 In this case, you will want to add these to the layout file.
6371 \begin_inset CommandInset ref
6373 reference "sec:TextClass"
6377 for information on how to do so.
6380 \begin_layout Standard
6382 \begin_inset Flex CharStyle:MenuItem
6385 \begin_layout Plain Layout
6391 can be used with several different document classes, and even if it cannot,
6392 you might find it easiest just to write a module that you can load with
6394 The simplest possible such module would be:
6397 \begin_layout LyX-Code
6400 DeclareLyXModule{My Package}
6403 \begin_layout LyX-Code
6407 \begin_layout LyX-Code
6408 #Support for mypkg.sty.
6411 \begin_layout LyX-Code
6413 \begin_inset Newline newline
6419 \begin_layout LyX-Code
6421 \begin_inset Newline newline
6427 \begin_layout LyX-Code
6429 \begin_inset Newline newline
6435 \begin_inset Newline newline
6441 \begin_layout Standard
6442 A more complex module might modify the behavior of some existing constructs
6443 or define some new ones.
6445 \begin_inset CommandInset ref
6447 reference "sec:TextClass"
6454 \begin_layout Subsection
6456 \begin_inset Flex CharStyle:MenuItem
6459 \begin_layout Plain Layout
6468 \begin_layout Standard
6469 There are two possibilities here.
6470 One is that the class file is itself based upon an existing document class.
6471 For example, many thesis classes are based upon
6472 \begin_inset Flex CharStyle:MenuItem
6475 \begin_layout Plain Layout
6482 To see whether yours is, look for a line like
6485 \begin_layout LyX-Code
6491 \begin_layout Standard
6493 If so, then you may proceed largely as in the previous section, though
6495 \begin_inset Flex CharStyle:Code
6498 \begin_layout Plain Layout
6504 line will be different.
6505 If your new class is
6506 \begin_inset Flex CharStyle:Code
6509 \begin_layout Plain Layout
6515 and it is based upon
6516 \begin_inset Flex CharStyle:Code
6519 \begin_layout Plain Layout
6525 , then the line should read:
6529 \begin_layout Plain Layout
6530 And it will be easiest if you save the file to
6531 \begin_inset Flex CharStyle:Code
6534 \begin_layout Plain Layout
6540 : LyX assumes that the document class has the same name as the layout file.
6549 \begin_layout LyX-Code
6552 DeclareLaTeXClass[thesis,book]{thesis}
6555 \begin_layout Standard
6556 If, on the other hand, the new class is not based upon an existing class,
6557 you will probably have to
6558 \begin_inset Quotes eld
6562 \begin_inset Quotes erd
6566 We strongly suggest copying an existing layout file which uses a similar
6567 LaTeX class and then modifying it, if you can do so.
6568 At least use an existing file as a starting point so you can find out what
6569 items you need to worry about.
6570 Again, the specifics are covered below.
6573 \begin_layout Subsection
6575 \begin_inset CommandInset label
6577 name "sub:Creating-Templates"
6584 \begin_layout Standard
6585 Once you have written a layout file for a new document class, you might
6586 want to consider writing a
6591 A template acts as a kind of tutorial for your layout, showing how it might
6592 be used, though containing dummy content.
6593 You can of course look at the various templates included with LyX for ideas.
6596 \begin_layout Standard
6597 Templates are created just like usual documents: using LyX.
6598 The only difference is that usual documents contain all possible settings,
6599 including the font scheme and the paper size.
6600 Usually a user doesn't want a template to overwrite his preferred settings
6601 for such parameters.
6602 For that reason, the designer of a template should remove the corresponding
6604 \begin_inset Flex CharStyle:Code
6607 \begin_layout Plain Layout
6616 \begin_inset Flex CharStyle:Code
6619 \begin_layout Plain Layout
6627 from the template LyX file.
6628 This can be done with any simple text-editor, for example
6629 \begin_inset Flex CharStyle:Code
6632 \begin_layout Plain Layout
6639 \begin_inset Flex CharStyle:Code
6642 \begin_layout Plain Layout
6652 \begin_layout Standard
6653 Put the edited template files you create in
6654 \begin_inset Flex CharStyle:Code
6657 \begin_layout Plain Layout
6663 , copy the ones you use from the global template directory in
6664 \begin_inset Flex CharStyle:Code
6667 \begin_layout Plain Layout
6673 to the same place, and redefine the template path in the
6674 \begin_inset Flex CharStyle:MenuItem
6677 \begin_layout Plain Layout
6678 Tools\SpecialChar \menuseparator
6679 Preferences\SpecialChar \menuseparator
6688 \begin_layout Standard
6689 Note, by the way, that there is a template which has a particular meaning:
6691 \begin_inset Flex CharStyle:Code
6694 \begin_layout Plain Layout
6701 This template is loaded every time you create a new document with
6702 \begin_inset Flex CharStyle:MenuItem
6705 \begin_layout Plain Layout
6706 File\SpecialChar \menuseparator
6712 in order to provide useful defaults.
6713 To create this template from inside LyX, all you have to do is to open
6714 a document with the correct settings, and use the
6715 \begin_inset Flex CharStyle:MenuItem
6718 \begin_layout Plain Layout
6719 Save as Document Defaults
6727 \begin_layout Subsection
6728 Upgrading old layout files
6731 \begin_layout Standard
6732 The format of layout files changes with each LyX release, so old layout
6733 files need to be converted to the new format.
6734 This process has been automated since LyX 1.4: If LyX reads a layout file
6735 in an older format, it automatically calls the script
6736 \begin_inset Flex CharStyle:Code
6739 \begin_layout Plain Layout
6745 to convert it to a temporary file in current format.
6746 The original file is left untouched.
6747 If you use the layout file often, then, you may want to convert it permanently,
6748 so that LyX does not have to do so itself every time.
6749 To do this, you can call the converter manually:
6752 \begin_layout LyX-Code
6753 mv myclass.layout myclass.old
6756 \begin_layout LyX-Code
6757 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6760 \begin_layout Standard
6762 \begin_inset Flex CharStyle:Code
6765 \begin_layout Plain Layout
6771 with the name of your LyX system directory, of course.
6774 \begin_layout Standard
6775 Note that manual conversion does not affect included files, so these will
6776 have to be converted separately.
6779 \begin_layout Section
6780 \begin_inset CommandInset label
6782 name "sec:TextClass"
6786 The layout file format
6789 \begin_layout Standard
6790 When it's finally time to get your hands dirty and create or edit your own
6791 layout file, the following sections describe what you're up against.
6792 Our advice is to go slowly, save and test often, listen to soothing music,
6793 and enjoy one or two of your favorite adult beverages; more if you are
6794 getting particularly stuck.
6795 It's really not that hard, except that the multitude of options can become
6796 overwhelming if you try to do too much in one sitting.
6797 Go have another adult beverage, just for good measure.
6800 \begin_layout Standard
6801 Note that all the tags used in layout files are case-insensitive.
6803 \begin_inset Flex CharStyle:Code
6806 \begin_layout Plain Layout
6813 \begin_inset Flex CharStyle:Code
6816 \begin_layout Plain Layout
6823 \begin_inset Flex CharStyle:Code
6826 \begin_layout Plain Layout
6832 are really the same tag.
6833 The possible values are printed in brackets after the feature's name.
6834 The default value if a feature isn't specified inside a text class-description
6836 \begin_inset Flex CharStyle:Code
6839 \begin_layout Plain Layout
6848 If the argument has a data type like
6849 \begin_inset Quotes eld
6853 \begin_inset Quotes erd
6857 \begin_inset Quotes eld
6861 \begin_inset Quotes erd
6864 , the default is shown like this:
6865 \begin_inset Flex CharStyle:Code
6868 \begin_layout Plain Layout
6879 \begin_layout Subsection
6880 The document class declaration
6883 \begin_layout Standard
6884 Lines in a layout file which begin with
6885 \begin_inset Flex CharStyle:Code
6888 \begin_layout Plain Layout
6895 There is one exception to this rule.
6897 \begin_inset Flex CharStyle:Code
6900 \begin_layout Plain Layout
6906 files should begin with a line like:
6909 \begin_layout LyX-Code
6912 #% Do not delete the line below; configure depends on this
6915 \begin_layout LyX-Code
6920 DeclareLaTeXClass{article}
6923 \begin_layout Standard
6924 The second line is used when you (re)configure LyX.
6925 The layout file is read by the LaTeX script
6926 \begin_inset Flex CharStyle:Code
6929 \begin_layout Plain Layout
6935 , in a special mode where
6936 \begin_inset Flex CharStyle:Code
6939 \begin_layout Plain Layout
6946 The first line is just a LaTeX comment, and the second one contains the
6947 declaration of the text class.
6948 If these lines appear in a file named
6949 \begin_inset Flex CharStyle:Code
6952 \begin_layout Plain Layout
6958 , then they define a text class of name
6959 \begin_inset Flex CharStyle:Code
6962 \begin_layout Plain Layout
6968 (the name of the layout file) which uses the LaTeX document class
6969 \begin_inset Flex CharStyle:Code
6972 \begin_layout Plain Layout
6978 (the default is to use the same name as the layout).
6980 \begin_inset Quotes eld
6984 \begin_inset Quotes erd
6987 that appears above is used as a description of the text class in the
6988 \begin_inset Flex CharStyle:MenuItem
6991 \begin_layout Plain Layout
6992 Document\SpecialChar \menuseparator
7001 \begin_layout Standard
7002 Let's assume that you wrote your own text class that uses the
7003 \begin_inset Flex CharStyle:Code
7006 \begin_layout Plain Layout
7012 document class, but where you changed the appearance of the section headings.
7013 If you put it in a file
7014 \begin_inset Flex CharStyle:Code
7017 \begin_layout Plain Layout
7023 , the header of this file should be:
7026 \begin_layout LyX-Code
7029 #% Do not delete the line below; configure depends on this
7032 \begin_layout LyX-Code
7037 DeclareLaTeXClass[article]{article (with my own headings)}
7040 \begin_layout Standard
7041 This declares a text class
7042 \begin_inset Flex CharStyle:Code
7045 \begin_layout Plain Layout
7051 , associated with the LaTeX document class
7052 \begin_inset Flex CharStyle:Code
7055 \begin_layout Plain Layout
7062 \begin_inset Quotes eld
7065 article (with my own headings)
7066 \begin_inset Quotes erd
7070 If your text class depends on several packages, you can declare it as:
7073 \begin_layout LyX-Code
7076 #% Do not delete the line below; configure depends on this
7079 \begin_layout LyX-Code
7084 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7087 \begin_layout Standard
7088 This indicates that your text class uses the
7089 \begin_inset Flex CharStyle:Code
7092 \begin_layout Plain Layout
7099 Finally, it is also possible to declare classes for DocBook code.
7100 Typical declarations will look like:
7103 \begin_layout LyX-Code
7106 #% Do not delete the line below; configure depends on this
7109 \begin_layout LyX-Code
7114 DeclareDocBookClass[article]{SGML (DocBook article)}
7117 \begin_layout Standard
7118 Note that these declarations can also be given an optional parameter declaring
7119 the name of the document class (but not a list).
7122 \begin_layout Standard
7123 So, to be as explicit as possible, the form of the layout declaration is:
7126 \begin_layout LyX-Code
7131 DeclareLaTeXClass[class,package.sty]{layout description}
7134 \begin_layout Standard
7135 The class need only be specified if the name of the LaTeX class file and
7136 the name of the layout file are different; if the name of the class file
7137 is not specified, then LyX will simply assume that it is the same as the
7138 name of the layout file.
7141 \begin_layout Standard
7142 When the text class has been modified to your taste, all you have to do
7143 is to copy it either to
7144 \begin_inset Flex CharStyle:Code
7147 \begin_layout Plain Layout
7154 \begin_inset Flex CharStyle:Code
7157 \begin_layout Plain Layout
7164 \begin_inset Flex CharStyle:MenuItem
7167 \begin_layout Plain Layout
7168 Tools\SpecialChar \menuseparator
7174 , exit LyX and restart.
7175 Then your new text class should be available along with the others.
7178 \begin_layout Standard
7179 Once the layout file is installed, you can edit it and see your changes
7180 without having to reconfigure or to restart LyX.
7185 \begin_layout Plain Layout
7186 In versions of LyX prior to 1.6, this was not true.
7187 As a result, editing layout files was very time consuming, since you had
7188 constantly to restart LyX to see changes.
7193 You can force a reload of the current layout by using the LyX function
7195 \begin_inset Flex CharStyle:MenuItem
7198 \begin_layout Plain Layout
7205 There is no default binding for this function—though, of course, you can
7206 bind it to a key yourself.
7207 But you will normally use this function simply by entering it in the mini-buffe
7212 \begin_layout Standard
7218 \begin_inset Flex CharStyle:MenuItem
7221 \begin_layout Plain Layout
7227 is very much an `advanced feature'.
7232 recommended that you save your work before using this function.
7237 recommended that you not attempt to edit layout information while simultaneousl
7238 y working on a document that you care about.
7239 Use a test document.
7240 Syntax errors and the like in your layout file could cause peculiar behavior.
7241 In particular, such errors could cause LyX to regard the current layout
7242 as invalid and to attempt to switch to some other layout.
7246 \begin_layout Plain Layout
7247 Really bad syntax errors may even caused LyX to exit.
7248 This is because certain sorts of errors may make LyX unable to read
7258 The LyX team strives to keep LyX stable in such situations, but safe is
7263 \begin_layout Plain Layout
7264 While we're giving advice: make regular backups.
7265 And be nice to your mother.
7273 \begin_layout Subsection
7274 The Module declaration
7277 \begin_layout Standard
7278 A module must begin with a line like the following:
7281 \begin_layout LyX-Code
7284 DeclareLyXModule[endnotes.sty]{Endnotes}
7287 \begin_layout Standard
7288 The mandatory argument, in curly brackets, is the name of the module, as
7290 \begin_inset Flex CharStyle:MenuItem
7293 \begin_layout Plain Layout
7294 Document\SpecialChar \menuseparator
7301 The argument in square brackets is optional: It declares any LaTeX packages
7302 on which the module depends.
7303 Please note that only packages about which LyX knows should be listed in
7304 the square brackets.
7308 \begin_layout Plain Layout
7309 The list of such packages is documented only in the source code.
7314 LyX will not check for arbitrary packages.
7315 It is also possible to use the form
7316 \begin_inset Flex CharStyle:MenuItem
7319 \begin_layout Plain Layout
7325 as an optional argument, which declares that the module can only be used
7326 when there exists a conversion chain between the formats `
7327 \begin_inset Flex CharStyle:Code
7330 \begin_layout Plain Layout
7337 \begin_inset Flex CharStyle:Code
7340 \begin_layout Plain Layout
7349 \begin_layout Standard
7350 The module declaration should then be followed by lines like the following:
7353 \begin_layout LyX-Code
7357 \begin_layout LyX-Code
7358 #Adds an endnote command, in addition to footnotes.
7362 \begin_layout LyX-Code
7363 #You will need to add
7365 theendnotes in TeX code where you
7368 \begin_layout LyX-Code
7369 #want the endnotes to appear.
7373 \begin_layout LyX-Code
7377 \begin_layout LyX-Code
7378 #Requires: somemodule | othermodule
7381 \begin_layout LyX-Code
7382 #Excludes: badmodule
7385 \begin_layout Standard
7386 The description is used in
7387 \begin_inset Flex CharStyle:MenuItem
7390 \begin_layout Plain Layout
7391 Document\SpecialChar \menuseparator
7397 to provide the user with information about what the module does.
7399 \begin_inset Flex CharStyle:Code
7402 \begin_layout Plain Layout
7408 line is used to identify other modules with which this one must be used;
7410 \begin_inset Flex CharStyle:Code
7413 \begin_layout Plain Layout
7419 line is used to identify modules with which this one may not be used.
7420 Both are optional, and, as shown, multiple modules should be separated
7421 with the pipe symbol: |.
7422 Note that the required modules are treated disjunctively:
7426 of the required modules must be used.
7431 excluded module may be used.
7432 Note that modules are identified here by their
7437 \begin_inset Flex CharStyle:Code
7440 \begin_layout Plain Layout
7448 \begin_inset Flex CharStyle:Code
7451 \begin_layout Plain Layout
7458 \begin_inset Flex CharStyle:Code
7461 \begin_layout Plain Layout
7470 \begin_layout Subsection
7474 \begin_layout Standard
7475 The first non-comment line of any layout file, included file, or module
7480 contain the file format number:
7483 \begin_layout Description
7484 \begin_inset Flex CharStyle:Code
7487 \begin_layout Plain Layout
7494 \begin_inset Flex CharStyle:Code
7497 \begin_layout Plain Layout
7503 ] The format of the layout file.
7506 \begin_layout Standard
7507 This tag was introduced with LyX 1.4.0.
7508 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7509 and are considered to be of format 1.
7510 The format for the present version of LyX is format 21.
7511 But each version of LyX is capable of reading earlier versions' layout
7512 files, just as they are capable of reading files produced by earlier versions
7514 There is, however, no provision for converting to earlier formats.
7515 So LyX 1.6.x will not read layout files in format 21 but only files in format
7519 \begin_layout Subsection
7520 \begin_inset CommandInset label
7522 name "sub:General-text-class"
7526 General text class parameters
7529 \begin_layout Standard
7530 These are general parameters that govern the behavior of an entire document
7536 mean that they must appear in
7537 \begin_inset Flex CharStyle:Code
7540 \begin_layout Plain Layout
7546 files rather than in modules.
7547 A module can contain any layout tag.)
7550 \begin_layout Description
7551 \begin_inset Flex CharStyle:Code
7554 \begin_layout Plain Layout
7560 Adds information that will be output in the
7561 \begin_inset Flex CharStyle:Code
7564 \begin_layout Plain Layout
7570 block when this document class is output to XHTML.
7571 Typically, this would be used to output CSS style information, but it can
7572 be used for anything that can appear in
7573 \begin_inset Flex CharStyle:Code
7576 \begin_layout Plain Layout
7584 \begin_inset Quotes eld
7588 \begin_inset Flex CharStyle:Code
7591 \begin_layout Plain Layout
7598 \begin_inset Quotes erd
7604 \begin_layout Description
7605 \begin_inset Flex CharStyle:Code
7608 \begin_layout Plain Layout
7614 Adds information to the document preamble.
7616 \begin_inset Quotes eld
7620 \begin_inset Flex CharStyle:Code
7623 \begin_layout Plain Layout
7630 \begin_inset Quotes erd
7636 \begin_layout Description
7637 \begin_inset Flex CharStyle:Code
7640 \begin_layout Plain Layout
7646 Defines formats for use in the display of bibliographic information.
7647 See Section for details.
7649 \begin_inset Quotes eld
7653 \begin_inset Flex CharStyle:Code
7656 \begin_layout Plain Layout
7663 \begin_inset Quotes erd
7669 \begin_layout Description
7670 \begin_inset Flex CharStyle:Code
7673 \begin_layout Plain Layout
7679 Describes various global options supported by the document class.
7681 \begin_inset space ~
7685 \begin_inset CommandInset ref
7687 reference "sub:ClassOptions"
7693 \begin_inset Quotes eld
7697 \begin_inset Flex CharStyle:Code
7700 \begin_layout Plain Layout
7707 \begin_inset Quotes erd
7713 \begin_layout Description
7714 \begin_inset Flex CharStyle:Code
7717 \begin_layout Plain Layout
7724 \begin_inset Flex CharStyle:Code
7727 \begin_layout Plain Layout
7736 \begin_inset Flex CharStyle:Code
7739 \begin_layout Plain Layout
7745 ] Whether the class should
7749 to having one or two columns.
7750 Can be changed in the
7751 \begin_inset Flex CharStyle:MenuItem
7754 \begin_layout Plain Layout
7755 Document\SpecialChar \menuseparator
7764 \begin_layout Description
7765 \begin_inset Flex CharStyle:Code
7768 \begin_layout Plain Layout
7775 \begin_inset Flex CharStyle:Code
7778 \begin_layout Plain Layout
7784 ] This sequence defines the properties for a counter.
7785 If the counter does not yet exist, it is created; if it does exist, it
7788 \begin_inset Quotes eld
7792 \begin_inset Flex CharStyle:Code
7795 \begin_layout Plain Layout
7802 \begin_inset Quotes erd
7806 \begin_inset Newline newline
7810 \begin_inset space ~
7814 \begin_inset CommandInset ref
7816 reference "sub:Counters"
7820 for details on counters.
7823 \begin_layout Description
7824 \begin_inset Flex CharStyle:Code
7827 \begin_layout Plain Layout
7833 Sets the default font used to display the document.
7835 \begin_inset space ~
7839 \begin_inset CommandInset ref
7841 reference "sub:Font-description"
7845 for how to declare fonts.
7847 \begin_inset Quotes eld
7851 \begin_inset Flex CharStyle:Code
7854 \begin_layout Plain Layout
7861 \begin_inset Quotes erd
7867 \begin_layout Description
7868 \begin_inset Flex CharStyle:Code
7871 \begin_layout Plain Layout
7878 \begin_inset Flex CharStyle:Code
7881 \begin_layout Plain Layout
7887 Specifies a module to be included by default with this document class.
7888 The module should be specified by filename without the
7889 \begin_inset Flex CharStyle:Code
7892 \begin_layout Plain Layout
7899 The user can still remove the module, but it will be active at the outset.
7900 (This applies only when new files are created, or when this class is chosen
7901 for an existing document.)
7904 \begin_layout Description
7905 \begin_inset Flex CharStyle:Code
7908 \begin_layout Plain Layout
7915 \begin_inset Flex CharStyle:Code
7918 \begin_layout Plain Layout
7924 ] This is the style that will be assigned to new paragraphs, usually
7925 \begin_inset Flex CharStyle:MenuItem
7928 \begin_layout Plain Layout
7935 This will default to the first defined style if not given, but you are
7936 encouraged to use this directive.
7939 \begin_layout Description
7940 \begin_inset Flex CharStyle:Code
7943 \begin_layout Plain Layout
7950 \begin_inset Flex CharStyle:Code
7953 \begin_layout Plain Layout
7959 ] This tag indicates that the module in question—which should be specified
7960 by filename without the
7961 \begin_inset Flex CharStyle:Code
7964 \begin_layout Plain Layout
7970 extension—cannot be used with this document class.
7971 This might be used in a journal-specific layout file to prevent, say, the
7973 \begin_inset Flex CharStyle:Code
7976 \begin_layout Plain Layout
7982 module that numbers theorems by section.
7987 be used in a module.
7988 Modules have their own way of excluding other modules (see
7989 \begin_inset CommandInset ref
7991 reference "sub:Layout-modules"
7998 \begin_layout Description
7999 \begin_inset Flex CharStyle:Code
8002 \begin_layout Plain Layout
8008 Defines a new float.
8010 \begin_inset space ~
8014 \begin_inset CommandInset ref
8016 reference "sub:Floats"
8022 \begin_inset Quotes eld
8026 \begin_inset Flex CharStyle:Code
8029 \begin_layout Plain Layout
8036 \begin_inset Quotes erd
8042 \begin_layout Description
8043 \begin_inset Flex CharStyle:Code
8046 \begin_layout Plain Layout
8052 Sets the information that will be output in the
8053 \begin_inset Flex CharStyle:Code
8056 \begin_layout Plain Layout
8062 block when this document class is output to XHTML.
8063 Note that this will completely override any prior
8064 \begin_inset Flex CharStyle:Code
8067 \begin_layout Plain Layout
8074 \begin_inset Flex CharStyle:Code
8077 \begin_layout Plain Layout
8085 \begin_inset Flex CharStyle:Code
8088 \begin_layout Plain Layout
8094 if you just want to add material to the preamble.) Must end with
8095 \begin_inset Quotes eld
8099 \begin_inset Flex CharStyle:Code
8102 \begin_layout Plain Layout
8109 \begin_inset Quotes erd
8115 \begin_layout Description
8116 \begin_inset Flex CharStyle:Code
8119 \begin_layout Plain Layout
8126 \begin_inset Flex CharStyle:Code
8129 \begin_layout Plain Layout
8135 ] The layout to use for the table of contents, bibliography, and so forth,
8136 when the document is output to HTML.
8137 For articles, this should normally be Section; for books, Chapter.
8138 If it is not given, then LyX will attempt to figure out which layout to
8142 \begin_layout Description
8143 \begin_inset Flex CharStyle:Code
8146 \begin_layout Plain Layout
8153 \begin_inset Flex CharStyle:Code
8156 \begin_layout Plain Layout
8162 ] Modifies the properties of the given counter.
8163 If the counter does not exist, the section is ignored.
8165 \begin_inset Quotes eld
8169 \begin_inset Flex CharStyle:Code
8172 \begin_layout Plain Layout
8179 \begin_inset Quotes erd
8183 \begin_inset Newline newline
8187 \begin_inset space ~
8191 \begin_inset CommandInset ref
8193 reference "sub:Counters"
8197 for details on counters.
8200 \begin_layout Description
8201 \begin_inset Flex CharStyle:Code
8204 \begin_layout Plain Layout
8211 \begin_inset Flex CharStyle:Code
8214 \begin_layout Plain Layout
8220 ] Modifies the properties of the given paragraph style.
8221 If the style does not exist, the section is ignored.
8223 \begin_inset Quotes eld
8227 \begin_inset Flex CharStyle:Code
8230 \begin_layout Plain Layout
8237 \begin_inset Quotes erd
8243 \begin_layout Description
8244 \begin_inset Flex CharStyle:Code
8247 \begin_layout Plain Layout
8253 As its name implies, this command allows you to include another layout
8254 definition file within yours to avoid duplicating commands.
8255 Common examples are the standard layout files, for example,
8256 \begin_inset Flex CharStyle:Code
8259 \begin_layout Plain Layout
8265 , which contains most of the basic layouts.
8268 \begin_layout Description
8269 \begin_inset Flex CharStyle:Code
8272 \begin_layout Plain Layout
8278 This section (re-)defines the layout of an inset.
8279 It can be applied to an existing inset or to a new, user-defined inset,
8280 e.g., a new character style.
8282 \begin_inset Quotes eld
8286 \begin_inset Flex CharStyle:Code
8289 \begin_layout Plain Layout
8296 \begin_inset Quotes erd
8300 \begin_inset Newline newline
8304 \begin_inset space ~
8308 \begin_inset CommandInset ref
8310 reference "sub:Flex-insets-and"
8314 for more information.
8318 \begin_layout Description
8319 \begin_inset Flex CharStyle:Code
8322 \begin_layout Plain Layout
8329 \begin_inset Flex CharStyle:Code
8332 \begin_layout Plain Layout
8338 ] A string that indicates the width of the left margin on the screen, for
8340 \begin_inset Quotes eld
8344 \begin_inset Quotes erd
8348 (Note that this is not a `length', like
8349 \begin_inset Quotes eld
8353 \begin_inset Quotes erd
8359 \begin_layout Description
8360 \begin_inset Flex CharStyle:Code
8363 \begin_layout Plain Layout
8369 This command deletes an existing float.
8370 This is particularly useful when you want to suppress a float that has
8371 been defined in an input file.
8374 \begin_layout Description
8375 \begin_inset Flex CharStyle:Code
8378 \begin_layout Plain Layout
8384 This command deletes an existing style.
8385 This is particularly useful when you want to suppress a style that has
8386 be defined in an input file.
8389 \begin_layout Description
8390 \begin_inset Flex CharStyle:Code
8393 \begin_layout Plain Layout
8399 A string indicating the file format (as defined in the Preferences dialog)
8400 produced by this class.
8401 It is mainly useful when
8402 \begin_inset Flex CharStyle:Code
8405 \begin_layout Plain Layout
8411 is `literate' and one wants to define a new type of literate document.
8412 This string is reset to `docbook', `latex', or `literate' when the correspondin
8414 \begin_inset Flex CharStyle:Code
8417 \begin_layout Plain Layout
8423 parameter is encountered.
8426 \begin_layout Description
8427 \begin_inset Flex CharStyle:Code
8430 \begin_layout Plain Layout
8436 A string indicating what sort of output documents using this class will
8438 At present, the options are: `docbook', `latex', and `literate'.
8441 \begin_layout Description
8442 \begin_inset Flex CharStyle:Code
8445 \begin_layout Plain Layout
8452 \begin_inset Flex CharStyle:Code
8455 \begin_layout Plain Layout
8464 \begin_inset Flex CharStyle:Code
8467 \begin_layout Plain Layout
8474 \begin_inset Flex CharStyle:Code
8477 \begin_layout Plain Layout
8483 ] The default pagestyle.
8484 Can be changed in the
8485 \begin_inset Flex CharStyle:MenuItem
8488 \begin_layout Plain Layout
8489 Document\SpecialChar \menuseparator
8498 \begin_layout Description
8499 \begin_inset Flex CharStyle:Code
8502 \begin_layout Plain Layout
8508 Sets the preamble for the LaTeX document.
8509 Note that this will completely override any prior
8510 \begin_inset Flex CharStyle:Code
8513 \begin_layout Plain Layout
8520 \begin_inset Flex CharStyle:Code
8523 \begin_layout Plain Layout
8531 \begin_inset Flex CharStyle:Code
8534 \begin_layout Plain Layout
8540 if you just want to add material to the preamble.) Must end with
8541 \begin_inset Quotes eld
8545 \begin_inset Flex CharStyle:Code
8548 \begin_layout Plain Layout
8555 \begin_inset Quotes erd
8561 \begin_layout Description
8562 \begin_inset Flex CharStyle:Code
8565 \begin_layout Plain Layout
8572 \begin_inset Flex CharStyle:Code
8575 \begin_layout Plain Layout
8582 \begin_inset Flex CharStyle:Code
8585 \begin_layout Plain Layout
8594 \begin_inset Flex CharStyle:Code
8597 \begin_layout Plain Layout
8603 ] Whether the class already provides the feature
8604 \begin_inset Flex CharStyle:Code
8607 \begin_layout Plain Layout
8614 A feature is in general the name of a package (
8615 \begin_inset Flex CharStyle:Code
8618 \begin_layout Plain Layout
8625 \begin_inset Flex CharStyle:Code
8628 \begin_layout Plain Layout
8634 , \SpecialChar \ldots{}
8636 \begin_inset Flex CharStyle:Code
8639 \begin_layout Plain Layout
8646 \begin_inset Flex CharStyle:Code
8649 \begin_layout Plain Layout
8655 ,\SpecialChar \ldots{}
8656 ); the complete list of supported features is unfortunately not documented
8657 outside the LyX source code—but see
8658 \begin_inset Flex CharStyle:Code
8661 \begin_layout Plain Layout
8667 if you're interested.
8669 \begin_inset Flex CharStyle:MenuItem
8672 \begin_layout Plain Layout
8673 Help\SpecialChar \menuseparator
8679 also gives an overview of the supported packages.
8682 \begin_layout Description
8683 \begin_inset Flex CharStyle:Code
8686 \begin_layout Plain Layout
8693 \begin_inset Flex CharStyle:Code
8696 \begin_layout Plain Layout
8702 ] Indicates that this layout provides the functionality of the module mentioned,
8703 which should be specified by the filename without the
8704 \begin_inset Flex CharStyle:Code
8707 \begin_layout Plain Layout
8714 This will typically be used if the layout includes the module directly,
8715 rather than using the
8716 \begin_inset Flex CharStyle:Code
8719 \begin_layout Plain Layout
8725 tag to indicate that it ought to be used.
8726 It could also be used in a module that provided an alternate implementation
8727 of the same functionality.
8730 \begin_layout Description
8731 \begin_inset Flex CharStyle:Code
8734 \begin_layout Plain Layout
8741 \begin_inset Flex CharStyle:Code
8744 \begin_layout Plain Layout
8750 ] Whether the class requires the feature
8751 \begin_inset Flex CharStyle:Code
8754 \begin_layout Plain Layout
8761 Multiple features must be separated by commas.
8762 Note that you can only request supported features.
8764 \begin_inset Flex CharStyle:Code
8767 \begin_layout Plain Layout
8773 for a list of these.)
8776 \begin_layout Description
8777 \begin_inset Flex CharStyle:Code
8780 \begin_layout Plain Layout
8786 A string that indicates the width of the right margin on the screen, for
8788 \begin_inset Quotes eld
8792 \begin_inset Quotes erd
8798 \begin_layout Description
8799 \begin_inset Flex CharStyle:Code
8802 \begin_layout Plain Layout
8808 Sets which divisions get numbered.
8810 \begin_inset Flex CharStyle:Code
8813 \begin_layout Plain Layout
8822 \begin_layout Description
8823 \begin_inset Flex CharStyle:Code
8826 \begin_layout Plain Layout
8833 \begin_inset Flex CharStyle:Code
8836 \begin_layout Plain Layout
8845 \begin_inset Flex CharStyle:Code
8848 \begin_layout Plain Layout
8854 ] Whether the class-default should be printing on one or both sides of the
8856 Can be changed in the
8857 \begin_inset Flex CharStyle:MenuItem
8860 \begin_layout Plain Layout
8861 Document\SpecialChar \menuseparator
8870 \begin_layout Description
8871 \begin_inset Flex CharStyle:Code
8874 \begin_layout Plain Layout
8880 This sequence defines a paragraph style.
8881 If the style does not yet exist, it is created; if it does exist, its parameter
8884 \begin_inset Quotes eld
8888 \begin_inset Flex CharStyle:Code
8891 \begin_layout Plain Layout
8898 \begin_inset Quotes erd
8902 \begin_inset Newline newline
8906 \begin_inset space ~
8910 \begin_inset CommandInset ref
8912 reference "sub:Paragraph-Styles"
8916 for details on paragraph styles.
8919 \begin_layout Description
8920 \begin_inset Flex CharStyle:Code
8923 \begin_layout Plain Layout
8930 \begin_inset Flex CharStyle:Code
8933 \begin_layout Plain Layout
8939 ] The name of the command or environment to be used with
8940 \begin_inset Flex CharStyle:Code
8943 \begin_layout Plain Layout
8952 \begin_layout Description
8953 \begin_inset Flex CharStyle:Code
8956 \begin_layout Plain Layout
8963 \begin_inset Flex CharStyle:Code
8966 \begin_layout Plain Layout
8975 \begin_inset Flex CharStyle:Code
8978 \begin_layout Plain Layout
8984 ] Indicates what kind of markup is used to define the title of a document.
8986 \begin_inset Flex CharStyle:Code
8989 \begin_layout Plain Layout
8995 means that the macro with name
8996 \begin_inset Flex CharStyle:Code
8999 \begin_layout Plain Layout
9005 will be inserted after the last layout which has
9006 \begin_inset Quotes eld
9010 \begin_inset Flex CharStyle:Code
9013 \begin_layout Plain Layout
9020 \begin_inset Quotes erd
9025 \begin_inset Flex CharStyle:Code
9028 \begin_layout Plain Layout
9034 corresponds to the case where the block of paragraphs which have
9035 \begin_inset Quotes eld
9039 \begin_inset Flex CharStyle:Code
9042 \begin_layout Plain Layout
9049 \begin_inset Quotes erd
9052 should be enclosed into the
9053 \begin_inset Flex CharStyle:Code
9056 \begin_layout Plain Layout
9065 \begin_layout Description
9066 \begin_inset Flex CharStyle:Code
9069 \begin_layout Plain Layout
9075 Sets which divisions are included in the table of contents.
9077 \begin_inset Flex CharStyle:Code
9080 \begin_layout Plain Layout
9089 \begin_layout Subsection
9090 \begin_inset Flex CharStyle:Code
9093 \begin_layout Plain Layout
9100 \begin_inset CommandInset label
9102 name "sub:ClassOptions"
9109 \begin_layout Standard
9111 \begin_inset Flex CharStyle:Code
9114 \begin_layout Plain Layout
9120 section can contain the following entries:
9123 \begin_layout Description
9124 \begin_inset Flex CharStyle:Code
9127 \begin_layout Plain Layout
9134 \begin_inset Flex CharStyle:Code
9137 \begin_layout Plain Layout
9143 ] The list of available font sizes for the document's main font, separated
9145 \begin_inset Quotes eld
9149 \begin_inset Flex CharStyle:Code
9152 \begin_layout Plain Layout
9159 \begin_inset Quotes erd
9165 \begin_layout Description
9166 \begin_inset Flex CharStyle:Code
9169 \begin_layout Plain Layout
9175 Used to set the DTD line with XML-based output classes.
9177 \begin_inset space \thinspace{}
9181 \begin_inset Quotes eld
9184 -//OASIS//DTD DocBook V4.2//EN
9185 \begin_inset Quotes erd
9191 \begin_layout Description
9192 \begin_inset Flex CharStyle:Code
9195 \begin_layout Plain Layout
9202 \begin_inset Flex CharStyle:Code
9205 \begin_layout Plain Layout
9206 string="empty|plain|headings|fancy"
9211 ] The list of available page styles, separated by
9212 \begin_inset Quotes eld
9216 \begin_inset Flex CharStyle:Code
9219 \begin_layout Plain Layout
9226 \begin_inset Quotes erd
9232 \begin_layout Description
9233 \begin_inset Flex CharStyle:Code
9236 \begin_layout Plain Layout
9243 \begin_inset Flex CharStyle:Code
9246 \begin_layout Plain Layout
9252 ] Some document class options, separated by a comma, that will be added
9253 to the optional part of the
9254 \begin_inset Flex CharStyle:Code
9257 \begin_layout Plain Layout
9268 \begin_layout Standard
9270 \begin_inset Flex CharStyle:Code
9273 \begin_layout Plain Layout
9279 section must end with
9280 \begin_inset Quotes eld
9284 \begin_inset Flex CharStyle:Code
9287 \begin_layout Plain Layout
9294 \begin_inset Quotes erd
9300 \begin_layout Subsection
9302 \begin_inset CommandInset label
9304 name "sub:Paragraph-Styles"
9311 \begin_layout Standard
9312 A paragraph style description looks like this:
9316 \begin_layout Plain Layout
9317 Note that this will either define a new layout or modify an existing one.
9325 \begin_layout LyX-Code
9332 \begin_layout LyX-Code
9336 \begin_layout LyX-Code
9340 \begin_layout Standard
9341 where the following commands are allowed:
9344 \begin_layout Description
9345 \begin_inset Flex CharStyle:Code
9348 \begin_layout Plain Layout
9355 \begin_inset Flex CharStyle:Code
9358 \begin_layout Plain Layout
9363 , left, right, center
9368 ] Paragraph alignment.
9371 \begin_layout Description
9372 \begin_inset Flex CharStyle:Code
9375 \begin_layout Plain Layout
9382 \begin_inset Flex CharStyle:Code
9385 \begin_layout Plain Layout
9390 , left, right, center
9395 ] A comma separated list of permitted alignments.
9396 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9398 For example a right-aligned or centered enumeration isn't possible.)
9401 \begin_layout Description
9402 \begin_inset Flex CharStyle:Code
9405 \begin_layout Plain Layout
9411 Language dependent information to be included in the LaTeX preamble when
9413 Note that this will completely override any prior
9414 \begin_inset Flex CharStyle:Code
9417 \begin_layout Plain Layout
9425 \begin_inset Quotes eld
9429 \begin_inset Flex CharStyle:Code
9432 \begin_layout Plain Layout
9439 \begin_inset Quotes erd
9443 The contents of this tag will occur once in the LaTeX preamble for each
9444 language used by the document.
9445 Each time, the following substitutions are made:
9449 \begin_layout Itemize
9450 \begin_inset Flex CharStyle:Code
9453 \begin_layout Plain Layout
9459 is replaced by the language name (as used by the babel package).
9462 \begin_layout Itemize
9464 \begin_inset Quotes eld
9468 \begin_inset Quotes erd
9472 \begin_inset Flex CharStyle:Code
9475 \begin_layout Plain Layout
9481 replaces its argument by the translation of the argument to the current
9485 \begin_layout Standard
9486 This preamble snippet will only be used if the document contains more than
9487 one language and the babel package is used.
9491 \begin_layout Description
9492 \begin_inset Flex CharStyle:Code
9495 \begin_layout Plain Layout
9502 \begin_inset Flex CharStyle:Code
9505 \begin_layout Plain Layout
9515 \begin_layout Plain Layout
9516 Note that a `float' here is a real number, such as: 1.5.
9521 The vertical space with which the last of a chain of paragraphs with this
9522 layout is separated from the following paragraph.
9523 If the next paragraph has another layout, the separations are not simply
9524 added, but the maximum is taken.
9527 \begin_layout Description
9528 \begin_inset Flex CharStyle:Code
9531 \begin_layout Plain Layout
9538 \begin_inset Flex CharStyle:Code
9541 \begin_layout Plain Layout
9547 The category for this style.
9548 This is used to group related styles in the Layout combobox on the toolbar.
9549 Any string can be used, but you may want to use existing categories with
9554 \begin_layout Description
9555 \begin_inset Flex CharStyle:Code
9558 \begin_layout Plain Layout
9564 Depth of XML command.
9565 Used only with XML-type formats.
9568 \begin_layout Description
9569 \begin_inset Flex CharStyle:Code
9572 \begin_layout Plain Layout
9579 \begin_inset CommandInset label
9581 name "des:CopyStyle"
9586 \begin_inset Flex CharStyle:Code
9589 \begin_layout Plain Layout
9595 Copies all the features of an existing style into the current one.
9599 \begin_layout Description
9600 \begin_inset Flex CharStyle:Code
9603 \begin_layout Plain Layout
9609 The name of a style whose preamble should be output
9614 This allows to ensure some ordering of the preamble snippets when macros
9615 definitions depend on one another.
9619 \begin_layout Plain Layout
9620 Note that, besides that functionality, there is no way to ensure any ordering
9622 The ordering that you see in a given version of LyX may change without
9623 warning in later versions.
9631 \begin_layout Description
9632 \begin_inset Flex CharStyle:Code
9635 \begin_layout Plain Layout
9642 \begin_inset Flex CharStyle:Code
9645 \begin_layout Plain Layout
9650 , Box, Filled_Box, Static
9655 ] The type of label that stands at the end of the paragraph (or sequence
9657 \begin_inset Flex CharStyle:Code
9660 \begin_layout Plain Layout
9667 \begin_inset Flex CharStyle:Code
9670 \begin_layout Plain Layout
9677 \begin_inset Flex CharStyle:Code
9680 \begin_layout Plain Layout
9687 \begin_inset Flex CharStyle:Code
9690 \begin_layout Plain Layout
9698 \begin_inset Flex CharStyle:Code
9701 \begin_layout Plain Layout
9708 \begin_inset Quotes eld
9712 \begin_inset Quotes erd
9716 \begin_inset Flex CharStyle:Code
9719 \begin_layout Plain Layout
9726 \begin_inset Flex CharStyle:Code
9729 \begin_layout Plain Layout
9730 \begin_inset space ~
9739 \begin_inset space ~
9742 black) square suitable for end of proof markers,
9743 \begin_inset Flex CharStyle:Code
9746 \begin_layout Plain Layout
9752 is an explicit text string.
9755 \begin_layout Description
9756 \begin_inset Flex CharStyle:Code
9759 \begin_layout Plain Layout
9766 \begin_inset Flex CharStyle:Code
9769 \begin_layout Plain Layout
9775 ] The string used for a label with a
9776 \begin_inset Flex CharStyle:Code
9779 \begin_layout Plain Layout
9786 \begin_inset Flex CharStyle:Code
9789 \begin_layout Plain Layout
9799 \begin_layout Description
9800 \begin_inset Flex CharStyle:Code
9803 \begin_layout Plain Layout
9810 \begin_inset Flex CharStyle:Code
9813 \begin_layout Plain Layout
9824 \begin_inset Flex CharStyle:Code
9827 \begin_layout Plain Layout
9836 \begin_layout Description
9837 \begin_inset Flex CharStyle:Code
9840 \begin_layout Plain Layout
9847 \begin_inset Flex CharStyle:Code
9850 \begin_layout Plain Layout
9860 ] With this parameter the
9861 \begin_inset Flex CharStyle:MenuItem
9864 \begin_layout Plain Layout
9871 \begin_inset Quotes eld
9874 Vertical space above
9875 \begin_inset Quotes erd
9879 \begin_inset Flex CharStyle:MenuItem
9882 \begin_layout Plain Layout
9883 Edit\SpecialChar \menuseparator
9885 \begin_inset space ~
9893 dialog can be set when initializing a paragraph with this style.
9897 \begin_layout Plain Layout
9900 Note from Jean-Marc:
9902 I'm not sure that this setting has much use, and it should probably be
9903 removed in later versions.
9911 \begin_layout Description
9912 \begin_inset Flex CharStyle:Code
9915 \begin_layout Plain Layout
9921 The font used for both the text body
9927 \begin_inset space ~
9931 \begin_inset CommandInset ref
9933 reference "sub:Font-description"
9938 Note that defining this font automatically defines the
9939 \begin_inset Flex CharStyle:Code
9942 \begin_layout Plain Layout
9949 So you should define this one first if you also want to define
9950 \begin_inset Flex CharStyle:Code
9953 \begin_layout Plain Layout
9962 \begin_layout Description
9963 \begin_inset Flex CharStyle:Code
9966 \begin_layout Plain Layout
9973 \begin_inset CommandInset label
9975 name "des:FreeSpacing"
9980 \begin_inset Flex CharStyle:Code
9983 \begin_layout Plain Layout
9992 \begin_inset Flex CharStyle:Code
9995 \begin_layout Plain Layout
10001 ] Usually LyX doesn't allow you to insert more than one space between words,
10002 since a space is considered as the separation between two words, not a
10003 character or symbol of its own.
10004 This is a very fine thing but sometimes annoying, for example, when typing
10005 program code or plain LaTeX code.
10007 \begin_inset Flex CharStyle:Code
10010 \begin_layout Plain Layout
10017 Note that LyX will create protected blanks for the additional blanks when
10018 in another mode than LaTeX-mode.
10021 \begin_layout Description
10022 \begin_inset Flex CharStyle:Code
10025 \begin_layout Plain Layout
10031 These tags are used with XHTML output.
10033 \begin_inset CommandInset ref
10034 LatexCommand prettyref
10035 reference "sub:Paragraph-Style-XHTML"
10042 \begin_layout Description
10043 \begin_inset Flex CharStyle:Code
10046 \begin_layout Plain Layout
10052 [[FIXME]] (Used only with XML-type formats.)
10055 \begin_layout Description
10056 \begin_inset Flex CharStyle:Code
10059 \begin_layout Plain Layout
10066 \begin_inset Flex CharStyle:Code
10069 \begin_layout Plain Layout
10075 If 1, marks the layout as to be included in the document preamble rather
10076 than in the document body.
10077 This is useful for document classes that want such information as the title
10078 and author to appear in the preamble.
10081 \begin_layout Description
10082 \begin_inset Flex CharStyle:Code
10085 \begin_layout Plain Layout
10092 \begin_inset Flex CharStyle:Code
10095 \begin_layout Plain Layout
10101 If 1, marks the layout as being part of a title block (see also the
10102 \begin_inset Flex CharStyle:Code
10105 \begin_layout Plain Layout
10112 \begin_inset Flex CharStyle:Code
10115 \begin_layout Plain Layout
10124 \begin_layout Description
10125 \begin_inset Flex CharStyle:Code
10128 \begin_layout Plain Layout
10135 \begin_inset Flex CharStyle:Code
10138 \begin_layout Plain Layout
10144 ] This provides extra space between paragraphs that have the same layout.
10145 If you put other layouts into an environment, each is separated with the
10147 \begin_inset Flex CharStyle:Code
10150 \begin_layout Plain Layout
10157 But the whole items of the environment are additionally separated with
10159 \begin_inset Flex CharStyle:Code
10162 \begin_layout Plain Layout
10169 Note that this is a
10174 \begin_layout Description
10175 \begin_inset Flex CharStyle:Code
10178 \begin_layout Plain Layout
10184 [[FIXME]] (Used only with XML-type formats.)
10187 \begin_layout Description
10188 \begin_inset Flex CharStyle:Code
10191 \begin_layout Plain Layout
10198 \begin_inset CommandInset label
10200 name "des:KeepEmpty"
10205 \begin_inset Flex CharStyle:Code
10208 \begin_layout Plain Layout
10217 \begin_inset Flex CharStyle:Code
10220 \begin_layout Plain Layout
10226 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10227 lead to empty LaTeX output.
10228 There are some cases where this could be desirable however: in a letter
10229 template, the required fields can be provided as empty fields, so that
10230 people do not forget them; in some special classes, a layout can be used
10231 as some kind of break, which does not contain actual text.
10234 \begin_layout Description
10235 \begin_inset Flex CharStyle:Code
10238 \begin_layout Plain Layout
10244 [float=0] The vertical space between the label and the text body.
10245 Only used for labels that are above the text body (
10246 \begin_inset Flex CharStyle:Code
10249 \begin_layout Plain Layout
10256 \begin_inset Flex CharStyle:Code
10259 \begin_layout Plain Layout
10260 Centered_Top_Environment
10268 \begin_layout Description
10269 \begin_inset Flex CharStyle:Code
10272 \begin_layout Plain Layout
10279 \begin_inset Flex CharStyle:Code
10282 \begin_layout Plain Layout
10289 \begin_inset Newline newline
10292 The name of the counter for automatic numbering.
10294 \begin_inset Newline newline
10302 \begin_inset Flex CharStyle:Code
10305 \begin_layout Plain Layout
10312 \begin_inset Flex CharStyle:Code
10315 \begin_layout Plain Layout
10322 In that case, the counter will be stepped each time the layout appears.
10324 \begin_inset Newline newline
10332 \begin_inset Flex CharStyle:Code
10335 \begin_layout Plain Layout
10342 \begin_inset Flex CharStyle:Code
10345 \begin_layout Plain Layout
10351 , though this case is a bit complicated.
10352 Suppose you declare
10353 \begin_inset Quotes eld
10357 \begin_inset Flex CharStyle:Code
10360 \begin_layout Plain Layout
10361 LabelCounter myenum
10367 \begin_inset Quotes erd
10371 Then the actual counters used are
10372 \begin_inset Flex CharStyle:Code
10375 \begin_layout Plain Layout
10382 \begin_inset Flex CharStyle:Code
10385 \begin_layout Plain Layout
10392 \begin_inset Flex CharStyle:Code
10395 \begin_layout Plain Layout
10402 \begin_inset Flex CharStyle:Code
10405 \begin_layout Plain Layout
10411 , much as in LaTeX.
10412 These counters must all be declared separately.
10413 \begin_inset Newline newline
10417 \begin_inset CommandInset ref
10419 reference "sub:Counters"
10423 for details on counters.
10426 \begin_layout Description
10427 \begin_inset Flex CharStyle:Code
10430 \begin_layout Plain Layout
10436 The font used for the label.
10438 \begin_inset space ~
10442 \begin_inset CommandInset ref
10444 reference "sub:Font-description"
10451 \begin_layout Description
10452 \begin_inset Flex CharStyle:Code
10455 \begin_layout Plain Layout
10461 Text that indicates how far a label should be indented.
10464 \begin_layout Description
10465 \begin_inset Flex CharStyle:Code
10468 \begin_layout Plain Layout
10475 \begin_inset Flex CharStyle:Code
10478 \begin_layout Plain Layout
10484 ] The horizontal space between the label and the text body.
10485 Only used for labels that are not above the text body.
10488 \begin_layout Description
10489 \begin_inset Flex CharStyle:Code
10492 \begin_layout Plain Layout
10499 \begin_inset Flex CharStyle:Code
10502 \begin_layout Plain Layout
10508 ] The string used for a label with a
10509 \begin_inset Flex CharStyle:Code
10512 \begin_layout Plain Layout
10520 \begin_inset Flex CharStyle:Code
10523 \begin_layout Plain Layout
10529 is set, this string can be contain the special formatting commands described
10531 \begin_inset CommandInset ref
10533 reference "sub:Counters"
10541 \begin_layout Plain Layout
10542 For the sake of backwards compatibility, the string
10543 \begin_inset Flex CharStyle:Code
10546 \begin_layout Plain Layout
10556 will be replaced by the expanded
10557 \begin_inset Flex CharStyle:Code
10560 \begin_layout Plain Layout
10567 \begin_inset Flex CharStyle:Code
10570 \begin_layout Plain Layout
10579 This feature is now obsolete and should be replaced by the mechanisms of
10581 \begin_inset CommandInset ref
10583 reference "sub:Counters"
10595 \begin_layout Description
10596 \begin_inset Flex CharStyle:Code
10599 \begin_layout Plain Layout
10600 LabelStringAppendix
10606 \begin_inset Flex CharStyle:Code
10609 \begin_layout Plain Layout
10615 ] This is used inside the appendix instead of
10616 \begin_inset Flex CharStyle:Code
10619 \begin_layout Plain Layout
10627 \begin_inset Flex CharStyle:Code
10630 \begin_layout Plain Layout
10637 \begin_inset Flex CharStyle:Code
10640 \begin_layout Plain Layout
10641 LabelStringAppendix
10649 \begin_layout Description
10650 \begin_inset Flex CharStyle:Code
10653 \begin_layout Plain Layout
10659 [FIXME] (Used only with XML-type formats.)
10662 \begin_layout Description
10663 \begin_inset Flex CharStyle:Code
10666 \begin_layout Plain Layout
10673 \begin_inset Flex CharStyle:Code
10676 \begin_layout Plain Layout
10681 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10682 Enumerate, Itemize, Bibliography
10691 \begin_layout Itemize
10692 \begin_inset Flex CharStyle:Code
10695 \begin_layout Plain Layout
10701 means the label is the very first word (up to the first real blank).
10702 Use protected spaces (like
10703 \begin_inset space ~
10706 that one) if you want more than one word as the label.
10710 \begin_layout Itemize
10711 \begin_inset Flex CharStyle:Code
10714 \begin_layout Plain Layout
10720 means the label is simply whatever
10721 \begin_inset Flex CharStyle:Code
10724 \begin_layout Plain Layout
10731 Note that this really is `static'.
10734 \begin_layout Itemize
10735 \begin_inset Flex CharStyle:Code
10738 \begin_layout Plain Layout
10745 \begin_inset Flex CharStyle:Code
10748 \begin_layout Plain Layout
10749 Centered_Top_Environment
10754 are special cases of
10755 \begin_inset Flex CharStyle:Code
10758 \begin_layout Plain Layout
10765 The label will be printed above the paragraph, but only at the top of an
10766 environment or the top of a chain of paragraphs with this layout.
10767 This might be used with the
10768 \begin_inset Flex CharStyle:MenuItem
10771 \begin_layout Plain Layout
10777 layout, for example.
10780 \begin_layout Itemize
10781 \begin_inset Flex CharStyle:Code
10784 \begin_layout Plain Layout
10790 is a special case for the caption-labels
10791 \begin_inset Quotes eld
10795 \begin_inset Quotes erd
10799 \begin_inset Quotes eld
10803 \begin_inset Quotes erd
10808 \begin_inset Flex CharStyle:Code
10811 \begin_layout Plain Layout
10817 means the (hardcoded) label string depends on the kind of float: It is
10818 hardcoded to be `FloatType N', where N is the value of the counter associated
10822 \begin_layout Itemize
10824 \begin_inset Flex CharStyle:Code
10827 \begin_layout Plain Layout
10833 label type defines automatically numbered labels.
10835 \begin_inset Flex CharStyle:Code
10838 \begin_layout Plain Layout
10844 will be expanded to resolve any counter references it contains: For example,
10846 \begin_inset Quotes eld
10850 \begin_inset Flex CharStyle:Code
10853 \begin_layout Plain Layout
10864 \begin_inset Quotes erd
10869 \begin_inset CommandInset ref
10871 reference "sub:Counters"
10875 for more information on counters.
10878 \begin_layout Itemize
10879 \begin_inset Flex CharStyle:Code
10882 \begin_layout Plain Layout
10888 produces the usual sort of enumeration labels.
10889 At present, it is hardcoded to use Arabic numerals, lowercase letters,
10890 small Roman numerals, and uppercase letters for the four possible depths.
10893 \begin_layout Itemize
10894 \begin_inset Flex CharStyle:Code
10897 \begin_layout Plain Layout
10903 produces various bullets at the different levels.
10904 It is also hardcoded.
10907 \begin_layout Itemize
10908 \begin_inset Flex CharStyle:Code
10911 \begin_layout Plain Layout
10917 is used internally by LyX and should be used only with
10918 \begin_inset Flex CharStyle:Code
10921 \begin_layout Plain Layout
10922 LatexType BibEnvironment
10931 \begin_layout Description
10932 \begin_inset Flex CharStyle:Code
10935 \begin_layout Plain Layout
10942 \begin_inset Flex CharStyle:Code
10945 \begin_layout Plain Layout
10951 , but this preamble snippet occurs independently from the babel package,
10952 and only for the document language.
10954 \begin_inset Quotes eld
10958 \begin_inset Flex CharStyle:Code
10961 \begin_layout Plain Layout
10968 \begin_inset Quotes erd
10975 \begin_layout Standard
10976 If the style defines text that appears in the typeset document, it may use
10978 \begin_inset Flex CharStyle:Code
10981 \begin_layout Plain Layout
10988 \begin_inset Flex CharStyle:Code
10991 \begin_layout Plain Layout
10997 to support non-english and even multilanguage documents correctly.
10998 The following excerpt (from the
10999 \begin_inset Flex CharStyle:Code
11002 \begin_layout Plain Layout
11008 file) shows how this works:
11011 \begin_layout LyX-Code
11015 \begin_layout LyX-Code
11018 theoremstyle{remark}
11021 \begin_layout LyX-Code
11024 newtheorem{claim}[thm]{
11031 \begin_layout LyX-Code
11035 \begin_layout LyX-Code
11039 \begin_layout LyX-Code
11044 claimname}{_(Claim)}
11047 \begin_layout LyX-Code
11051 \begin_layout LyX-Code
11055 \begin_layout LyX-Code
11059 \begin_layout LyX-Code
11068 claimname}{_(Claim)}}
11071 \begin_layout LyX-Code
11075 \begin_layout Standard
11076 The key to correct translation of the user visible text is the definition
11078 \begin_inset Flex CharStyle:Code
11081 \begin_layout Plain Layout
11089 in the language preamble.
11090 This command holds the name of the theorem that will appear in the output.
11092 \begin_inset Flex CharStyle:Code
11095 \begin_layout Plain Layout
11101 then uses the commands offered by the babel package to redefine
11102 \begin_inset Flex CharStyle:Code
11105 \begin_layout Plain Layout
11113 for each used language in multilanguage documents.
11117 \begin_layout Description
11118 \begin_inset Flex CharStyle:Code
11121 \begin_layout Plain Layout
11127 The name of the corresponding LaTeX stuff.
11128 Either the environment or command name.
11131 \begin_layout Description
11132 \begin_inset Flex CharStyle:Code
11135 \begin_layout Plain Layout
11141 An optional parameter for the corresponding
11142 \begin_inset Flex CharStyle:Code
11145 \begin_layout Plain Layout
11152 This parameter cannot be changed from within LyX.
11155 \begin_layout Description
11156 \begin_inset Flex CharStyle:Code
11159 \begin_layout Plain Layout
11166 \begin_inset CommandInset label
11168 name "des:LatexType"
11173 \begin_inset Flex CharStyle:Code
11176 \begin_layout Plain Layout
11181 , Command, Environment, Item_Environment,
11187 \begin_inset Flex CharStyle:Code
11190 \begin_layout Plain Layout
11191 List_Environment, Bib_Environment
11196 ] How the layout should be translated into LaTeX.
11200 \begin_layout Plain Layout
11201 \begin_inset Flex CharStyle:Code
11204 \begin_layout Plain Layout
11210 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11211 Visit the SGML class files for specific examples.
11220 \begin_layout Itemize
11221 \begin_inset Flex CharStyle:Code
11224 \begin_layout Plain Layout
11230 means nothing special.
11234 \begin_layout Itemize
11235 \begin_inset Flex CharStyle:Code
11238 \begin_layout Plain Layout
11245 \begin_inset Flex CharStyle:Code
11248 \begin_layout Plain Layout
11255 {\SpecialChar \ldots{}
11264 \begin_layout Itemize
11265 \begin_inset Flex CharStyle:Code
11268 \begin_layout Plain Layout
11275 \begin_inset Flex CharStyle:Code
11278 \begin_layout Plain Layout
11285 }\SpecialChar \ldots{}
11301 \begin_layout Itemize
11302 \begin_inset Flex CharStyle:Code
11305 \begin_layout Plain Layout
11312 \begin_inset Flex CharStyle:Code
11315 \begin_layout Plain Layout
11322 \begin_inset Flex CharStyle:Code
11325 \begin_layout Plain Layout
11333 is generated for each paragraph of this environment.
11337 \begin_layout Itemize
11338 \begin_inset Flex CharStyle:Code
11341 \begin_layout Plain Layout
11348 \begin_inset Flex CharStyle:Code
11351 \begin_layout Plain Layout
11358 \begin_inset Flex CharStyle:Code
11361 \begin_layout Plain Layout
11367 is passed as an argument to the environment.
11369 \begin_inset Flex CharStyle:Code
11372 \begin_layout Plain Layout
11378 can be defined in the
11379 \begin_inset Flex CharStyle:MenuItem
11382 \begin_layout Plain Layout
11387 ayout\SpecialChar \menuseparator
11401 \begin_layout Standard
11402 Putting the last few things together, the LaTeX output will be either:
11405 \begin_layout LyX-Code
11408 latexname[latexparam]{\SpecialChar \ldots{}
11412 \begin_layout Standard
11416 \begin_layout LyX-Code
11419 begin{latexname}[latexparam] \SpecialChar \ldots{}
11425 \begin_layout Standard
11426 depending upon the LaTeX type.
11430 \begin_layout Description
11431 \begin_inset Flex CharStyle:Code
11434 \begin_layout Plain Layout
11441 \begin_inset Flex CharStyle:Code
11444 \begin_layout Plain Layout
11450 ] If you put layouts into environments, the leftmargins are not simply added,
11451 but added with a factor
11452 \begin_inset Formula $\frac{4}{depth+4}$
11456 Note that this parameter is also used when the margin is defined as
11457 \begin_inset Flex CharStyle:Code
11460 \begin_layout Plain Layout
11467 \begin_inset Flex CharStyle:Code
11470 \begin_layout Plain Layout
11477 Then it is added to the manual or dynamic margin.
11479 \begin_inset Newline newline
11482 The argument is passed as a string.
11484 \begin_inset Quotes eld
11488 \begin_inset Flex CharStyle:Code
11491 \begin_layout Plain Layout
11498 \begin_inset Quotes erd
11501 means that the paragraph is indented with the width of
11502 \begin_inset Quotes eld
11506 \begin_inset Flex CharStyle:Code
11509 \begin_layout Plain Layout
11516 \begin_inset Quotes erd
11519 in the normal font.
11520 You can get a negative width by prefixing the string with
11521 \begin_inset Quotes eld
11525 \begin_inset Flex CharStyle:Code
11528 \begin_layout Plain Layout
11535 \begin_inset Quotes erd
11539 This way was chosen so that the look is the same with each used screen
11544 \begin_layout Description
11545 \begin_inset Flex CharStyle:Code
11548 \begin_layout Plain Layout
11555 \begin_inset Flex CharStyle:Code
11558 \begin_layout Plain Layout
11563 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11569 \begin_inset Newline newline
11572 The kind of margin that the layout has on the left side.
11574 \begin_inset Flex CharStyle:Code
11577 \begin_layout Plain Layout
11583 just means a fixed margin.
11585 \begin_inset Flex CharStyle:Code
11588 \begin_layout Plain Layout
11594 means that the left margin depends on the string entered in the
11595 \begin_inset Flex CharStyle:MenuItem
11598 \begin_layout Plain Layout
11599 Edit\SpecialChar \menuseparator
11601 \begin_inset space ~
11610 This is used to typeset nice lists without tabulators.
11612 \begin_inset Flex CharStyle:Code
11615 \begin_layout Plain Layout
11621 means that the margin depends on the size of the label.
11622 This is used for automatic enumerated headlines.
11623 It is obvious that the headline
11624 \begin_inset Quotes eld
11627 5.4.3.2.1 Very long headline
11628 \begin_inset Quotes erd
11631 must have a wider left margin (as wide as
11632 \begin_inset Quotes eld
11636 \begin_inset Quotes erd
11639 plus the space) than
11640 \begin_inset Quotes eld
11643 3.2 Very long headline
11644 \begin_inset Quotes erd
11648 \begin_inset Quotes eld
11652 \begin_inset Quotes erd
11655 are not able to do this.
11657 \begin_inset Flex CharStyle:Code
11660 \begin_layout Plain Layout
11666 is similar, but only the very first row of the paragraph is dynamic, while
11667 the others are static; this is used, for example, for descriptions.
11669 \begin_inset Flex CharStyle:Code
11672 \begin_layout Plain Layout
11678 means the margin is chosen in a way that the longest row of this paragraph
11679 fits to the right margin.
11680 This is used to typeset an address on the right edge of the page.
11683 \begin_layout Description
11684 \begin_inset Flex CharStyle:Code
11687 \begin_layout Plain Layout
11694 \begin_inset Flex CharStyle:Code
11697 \begin_layout Plain Layout
11706 \begin_inset Flex CharStyle:Code
11709 \begin_layout Plain Layout
11715 ] Whether fragile commands in this layout should be
11716 \begin_inset Flex CharStyle:Code
11719 \begin_layout Plain Layout
11732 whether this command should itself be protected.)
11735 \begin_layout Description
11736 \begin_inset Flex CharStyle:Code
11739 \begin_layout Plain Layout
11746 \begin_inset Flex CharStyle:Code
11749 \begin_layout Plain Layout
11756 \begin_inset Flex CharStyle:Code
11759 \begin_layout Plain Layout
11767 ] Whether newlines are translated into LaTeX newlines (
11768 \begin_inset Flex CharStyle:Code
11771 \begin_layout Plain Layout
11782 The translation can be switched off to allow more comfortable LaTeX editing
11786 \begin_layout Description
11787 \begin_inset Flex CharStyle:Code
11790 \begin_layout Plain Layout
11797 \begin_inset Flex CharStyle:Code
11800 \begin_layout Plain Layout
11807 \begin_inset Flex CharStyle:Code
11810 \begin_layout Plain Layout
11818 ] Whether the following Paragraph is allowed to indent its very first row.
11820 \begin_inset Flex CharStyle:Code
11823 \begin_layout Plain Layout
11829 means that it is not allowed to do so;
11830 \begin_inset Flex CharStyle:Code
11833 \begin_layout Plain Layout
11839 means it could do so if it wants to.
11842 \begin_layout Description
11843 \begin_inset Flex CharStyle:Code
11846 \begin_layout Plain Layout
11852 Name of a layout that has replaced this layout.
11853 This is used to rename a layout, while keeping backward compatibility.
11856 \begin_layout Description
11857 \begin_inset Flex CharStyle:Code
11860 \begin_layout Plain Layout
11867 \begin_inset Flex CharStyle:Code
11870 \begin_layout Plain Layout
11876 ] The number of optional arguments that can be used with this layout.
11877 This is useful for things like section headings, and only makes sense with
11881 \begin_layout Description
11882 \begin_inset Flex CharStyle:Code
11885 \begin_layout Plain Layout
11892 \begin_inset Flex CharStyle:Code
11895 \begin_layout Plain Layout
11901 ] The indent of the very first line of a paragraph.
11903 \begin_inset Flex CharStyle:Code
11906 \begin_layout Plain Layout
11912 will be fixed for a certain layout.
11913 The exception is Standard layout, since the indentation of a Standard layout
11914 paragraph can be prohibited with
11915 \begin_inset Flex CharStyle:Code
11918 \begin_layout Plain Layout
11925 Also, Standard layout paragraphs inside environments use the
11926 \begin_inset Flex CharStyle:Code
11929 \begin_layout Plain Layout
11935 of the environment, not their native one.
11936 For example, Standard paragraphs inside an enumeration are not indented.
11939 \begin_layout Description
11940 \begin_inset Flex CharStyle:Code
11943 \begin_layout Plain Layout
11950 \begin_inset Flex CharStyle:Code
11953 \begin_layout Plain Layout
11959 ] The vertical space between two paragraphs of this layout.
11962 \begin_layout Description
11963 \begin_inset Flex CharStyle:Code
11966 \begin_layout Plain Layout
11973 \begin_inset Flex CharStyle:Code
11976 \begin_layout Plain Layout
11982 ] LyX allows the user to choose either
11983 \begin_inset Quotes eld
11987 \begin_inset Quotes erd
11991 \begin_inset Quotes eld
11995 \begin_inset Quotes erd
11998 to typeset a document.
12000 \begin_inset Quotes eld
12004 \begin_inset Quotes erd
12007 is chosen, this value is completely ignored.
12009 \begin_inset Quotes eld
12013 \begin_inset Quotes erd
12016 is chosen, the parindent of a LaTeXtype
12017 \begin_inset Quotes eld
12021 \begin_inset Quotes erd
12024 layout is ignored and all paragraphs are separated by this parskip argument.
12025 The vertical space is calculated with
12026 \begin_inset Flex CharStyle:Code
12029 \begin_layout Plain Layout
12031 \begin_inset space ~
12040 \begin_inset Flex CharStyle:Code
12043 \begin_layout Plain Layout
12049 is the height of a row with the normal font.
12050 This way, the look stays the same with different screen fonts.
12053 \begin_layout Description
12054 \begin_inset Flex CharStyle:Code
12057 \begin_layout Plain Layout
12064 \begin_inset CommandInset label
12066 name "des:PathThru"
12071 \begin_inset Flex CharStyle:Code
12074 \begin_layout Plain Layout
12083 \begin_inset Flex CharStyle:Code
12086 \begin_layout Plain Layout
12092 ] Whether the contents of this paragraph should be output in raw form, meaning
12093 without special translations that LaTeX would require.
12096 \begin_layout Description
12097 \begin_inset Flex CharStyle:Code
12100 \begin_layout Plain Layout
12107 \begin_inset CommandInset label
12109 name "des:Preamble"
12113 Information to be included in the LaTeX preamble when this style is used.
12114 Used to define macros, load packages, etc., required by this particular
12117 \begin_inset Quotes eld
12121 \begin_inset Flex CharStyle:Code
12124 \begin_layout Plain Layout
12131 \begin_inset Quotes erd
12137 \begin_layout Description
12138 \begin_inset Flex CharStyle:Code
12141 \begin_layout Plain Layout
12148 \begin_inset Flex CharStyle:Code
12151 \begin_layout Plain Layout
12157 ] The prefix to use when creating labels referring to paragraphs of this
12159 This allows the use of formatted references.
12162 \begin_layout Description
12163 \begin_inset Flex CharStyle:Code
12166 \begin_layout Plain Layout
12173 \begin_inset Flex CharStyle:Code
12176 \begin_layout Plain Layout
12183 \begin_inset CommandInset label
12185 name "des:Requires"
12189 Whether the layout requires the feature
12190 \begin_inset Flex CharStyle:Code
12193 \begin_layout Plain Layout
12200 See the description of
12201 \begin_inset Flex CharStyle:Code
12204 \begin_layout Plain Layout
12211 \begin_inset CommandInset ref
12212 LatexCommand pageref
12213 reference "des:FreeSpacing"
12217 ) for information on `features'.
12221 \begin_layout Description
12222 \begin_inset Flex CharStyle:Code
12225 \begin_layout Plain Layout
12232 \begin_inset Flex CharStyle:Code
12235 \begin_layout Plain Layout
12242 \begin_inset Flex CharStyle:Code
12245 \begin_layout Plain Layout
12254 \begin_layout Description
12255 \begin_inset Flex CharStyle:Code
12258 \begin_layout Plain Layout
12265 \begin_inset Flex CharStyle:Code
12268 \begin_layout Plain Layout
12273 , onehalf, double, other
12282 ] This defines what the default spacing should be in the layout.
12284 \begin_inset Flex CharStyle:Code
12287 \begin_layout Plain Layout
12294 \begin_inset Flex CharStyle:Code
12297 \begin_layout Plain Layout
12304 \begin_inset Flex CharStyle:Code
12307 \begin_layout Plain Layout
12313 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12314 If you specify the argument
12315 \begin_inset Flex CharStyle:Code
12318 \begin_layout Plain Layout
12324 , then you should also provide a numerical argument which will be the actual
12326 Note that, contrary to other parameters,
12327 \begin_inset Flex CharStyle:Code
12330 \begin_layout Plain Layout
12336 implies the generation of specific LaTeX code, using the package
12339 \begin_inset Flex CharStyle:Code
12342 \begin_layout Plain Layout
12351 \begin_layout Description
12352 \begin_inset Flex CharStyle:Code
12355 \begin_layout Plain Layout
12362 \begin_inset Flex CharStyle:Code
12365 \begin_layout Plain Layout
12372 \begin_inset Flex CharStyle:Code
12375 \begin_layout Plain Layout
12383 ] Spellcheck paragraphs of this style.
12387 \begin_layout Description
12388 \begin_inset Flex CharStyle:Code
12391 \begin_layout Plain Layout
12397 The font used for the text body .
12399 \begin_inset CommandInset ref
12401 reference "sub:Font-description"
12408 \begin_layout Description
12409 \begin_inset Flex CharStyle:Code
12412 \begin_layout Plain Layout
12421 \begin_inset Flex CharStyle:Code
12424 \begin_layout Plain Layout
12434 The level of the style in the table of contents.
12435 This is used for automatic numbering of section headings.
12438 \begin_layout Description
12439 \begin_inset Flex CharStyle:Code
12442 \begin_layout Plain Layout
12449 \begin_inset Flex CharStyle:Code
12452 \begin_layout Plain Layout
12458 ] The vertical space with which the very first of a chain of paragraphs
12459 with this layout is separated from the previous paragraph.
12460 If the previous paragraph has another layout, the separations are not simply
12461 added, but the maximum is taken.
12464 \begin_layout Subsection
12466 \begin_inset CommandInset label
12475 \begin_layout Standard
12476 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12477 define the floats (
12478 \begin_inset Flex CharStyle:MenuItem
12481 \begin_layout Plain Layout
12488 \begin_inset Flex CharStyle:MenuItem
12491 \begin_layout Plain Layout
12497 , \SpecialChar \ldots{}
12498 ) in the text class itself.
12499 Standard floats are included in the file
12500 \begin_inset Flex CharStyle:Code
12503 \begin_layout Plain Layout
12509 , so you may have to do no more than add
12512 \begin_layout LyX-Code
12513 Input stdfloats.inc
12516 \begin_layout Standard
12517 to your layout file.
12518 If you want to implement a text class that proposes some other float types
12519 (like the AGU class bundled with LyX), the information below will hopefully
12523 \begin_layout Description
12524 \begin_inset Flex CharStyle:Code
12527 \begin_layout Plain Layout
12534 \begin_inset Flex CharStyle:Code
12537 \begin_layout Plain Layout
12544 \begin_inset Quotes erd
12548 \begin_inset Quotes erd
12551 ] The file name extension of an auxiliary file for the list of figures (or
12553 LaTeX writes the captions to this file.
12556 \begin_layout Description
12557 \begin_inset Flex CharStyle:Code
12560 \begin_layout Plain Layout
12567 \begin_inset Flex CharStyle:Code
12570 \begin_layout Plain Layout
12577 \begin_inset Quotes erd
12581 \begin_inset Quotes erd
12584 ] The string that will be used in the menus and also for the caption.
12585 This is translated to the current language if babel is used.
12588 \begin_layout Description
12589 \begin_inset Flex CharStyle:Code
12592 \begin_layout Plain Layout
12598 These are used for XHTML output.
12600 \begin_inset CommandInset ref
12602 reference "sec:Tags-for-XHTML"
12609 \begin_layout Description
12610 \begin_inset Flex CharStyle:Code
12613 \begin_layout Plain Layout
12620 \begin_inset Flex CharStyle:Code
12623 \begin_layout Plain Layout
12630 \begin_inset Quotes erd
12634 \begin_inset Quotes erd
12637 ] The command used to generate a list of floats of this type; the leading
12640 ' should be omitted.
12646 \begin_inset Flex CharStyle:Code
12649 \begin_layout Plain Layout
12655 is false, since there is no standard way to generate this command.
12657 \begin_inset Flex CharStyle:Code
12660 \begin_layout Plain Layout
12666 is true, since in that case there is a standard way.
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 ] A title for a list of floats of this kind (list of figures, tables, or
12699 It is used for the screen label within LyX; it is passed to LaTeX for use
12700 as the title there; and it is used as the title in XHTML output.
12701 It will be translated to the document language.
12704 \begin_layout Description
12705 \begin_inset Flex CharStyle:Code
12708 \begin_layout Plain Layout
12715 \begin_inset Flex CharStyle:Code
12718 \begin_layout Plain Layout
12725 \begin_inset Flex CharStyle:Code
12728 \begin_layout Plain Layout
12736 ] Indicates whether the float is already defined in the document class or
12737 if we instead need to load
12738 \begin_inset Flex CharStyle:Code
12741 \begin_layout Plain Layout
12747 and use what it provides.
12749 \begin_inset Flex CharStyle:Code
12752 \begin_layout Plain Layout
12759 \begin_inset Flex CharStyle:Code
12762 \begin_layout Plain Layout
12769 It should be set to
12770 \begin_inset Flex CharStyle:Code
12773 \begin_layout Plain Layout
12779 if the float is already defined by the LaTeX document class.
12782 \begin_layout Description
12783 \begin_inset Flex CharStyle:Code
12786 \begin_layout Plain Layout
12793 \begin_inset Flex CharStyle:Code
12796 \begin_layout Plain Layout
12803 \begin_inset Quotes erd
12807 \begin_inset Quotes erd
12810 ] This (optional) argument determines whether floats of this class will
12811 be numbered within some sectional unit of the document.
12812 For example, if within is equal to
12813 \begin_inset Flex CharStyle:Code
12816 \begin_layout Plain Layout
12822 , the floats will be numbered within chapters.
12826 \begin_layout Description
12827 \begin_inset Flex CharStyle:Code
12830 \begin_layout Plain Layout
12837 \begin_inset Flex CharStyle:Code
12840 \begin_layout Plain Layout
12847 \begin_inset Quotes erd
12851 \begin_inset Quotes erd
12854 ] The default placement for the given class of floats.
12855 The string should be as in standard LaTeX:
12856 \begin_inset Flex CharStyle:Code
12859 \begin_layout Plain Layout
12866 \begin_inset Flex CharStyle:Code
12869 \begin_layout Plain Layout
12876 \begin_inset Flex CharStyle:Code
12879 \begin_layout Plain Layout
12886 \begin_inset Flex CharStyle:Code
12889 \begin_layout Plain Layout
12895 for top, bottom, page, and here, respectively.
12899 \begin_layout Plain Layout
12900 Note that the order of these letters in the string is irrelevant, like in
12906 On top of that there is a new type,
12907 \begin_inset Flex CharStyle:Code
12910 \begin_layout Plain Layout
12916 , which does not really correspond to a float, since it means: put it
12917 \begin_inset Quotes eld
12921 \begin_inset Quotes erd
12925 Note however that the
12926 \begin_inset Flex CharStyle:Code
12929 \begin_layout Plain Layout
12935 specifier is special and, because of implementation details, cannot be
12936 used in non-built in float types.
12937 If you do not understand what this means, just use
12938 \begin_inset Quotes eld
12942 \begin_inset Flex CharStyle:Code
12945 \begin_layout Plain Layout
12952 \begin_inset Quotes erd
12958 \begin_layout Description
12959 \begin_inset Flex CharStyle:Code
12962 \begin_layout Plain Layout
12969 \begin_inset Flex CharStyle:Code
12972 \begin_layout Plain Layout
12978 ] The prefix to use when creating labels referring to floats of this type.
12979 This allows the use of formatted references.
12982 \begin_layout Description
12983 \begin_inset Flex CharStyle:Code
12986 \begin_layout Plain Layout
12993 \begin_inset Flex CharStyle:Code
12996 \begin_layout Plain Layout
13003 \begin_inset Quotes erd
13007 \begin_inset Quotes erd
13010 ] The style used when defining the float using
13011 \begin_inset Flex CharStyle:Code
13014 \begin_layout Plain Layout
13025 \begin_layout Description
13026 \begin_inset Flex CharStyle:Code
13029 \begin_layout Plain Layout
13036 \begin_inset Flex CharStyle:Code
13039 \begin_layout Plain Layout
13046 \begin_inset Quotes erd
13050 \begin_inset Quotes erd
13054 \begin_inset Quotes eld
13058 \begin_inset Quotes erd
13061 of the new class of floats, like program or algorithm.
13062 After the appropriate
13063 \begin_inset Flex CharStyle:Code
13066 \begin_layout Plain Layout
13075 \begin_inset Flex CharStyle:Code
13078 \begin_layout Plain Layout
13087 \begin_inset Flex CharStyle:Code
13090 \begin_layout Plain Layout
13101 \begin_layout Standard
13102 Note that defining a float with type
13103 \begin_inset Flex CharStyle:Code
13106 \begin_layout Plain Layout
13114 automatically defines the corresponding counter with name
13115 \begin_inset Flex CharStyle:Code
13118 \begin_layout Plain Layout
13129 \begin_layout Subsection
13130 Flex insets and InsetLayout
13131 \begin_inset CommandInset label
13133 name "sub:Flex-insets-and"
13140 \begin_layout Standard
13141 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13142 these are called Flex insets.
13146 \begin_layout Standard
13147 Flex insets come in three different kinds:
13150 \begin_layout Itemize
13152 \begin_inset Flex CharStyle:Code
13155 \begin_layout Plain Layout
13161 ): These define semantic markup corresponding to such LaTeX commands as
13163 \begin_inset Flex CharStyle:Code
13166 \begin_layout Plain Layout
13175 \begin_inset Flex CharStyle:Code
13178 \begin_layout Plain Layout
13189 \begin_layout Itemize
13191 \begin_inset Flex CharStyle:Code
13194 \begin_layout Plain Layout
13200 ): These can be used to define custom collapsible insets, similar to TeX
13201 code, footnote, and the like.
13202 An obvious example is an endnote inset, which is defined in the
13203 \begin_inset Flex CharStyle:Code
13206 \begin_layout Plain Layout
13215 \begin_layout Itemize
13217 \begin_inset Flex CharStyle:Code
13220 \begin_layout Plain Layout
13226 ): For use with DocBook classes.
13229 \begin_layout Standard
13230 Flex insets are defined using the
13231 \begin_inset Flex CharStyle:Code
13234 \begin_layout Plain Layout
13240 tag, which shall be explained in a moment.
13243 \begin_layout Standard
13245 \begin_inset Flex CharStyle:Code
13248 \begin_layout Plain Layout
13254 tag also serves another function: It can be used to customize the general
13255 layout of many different types of insets.
13257 \begin_inset Flex CharStyle:Code
13260 \begin_layout Plain Layout
13266 can be used to customize the layout parameters for footnotes, marginal
13267 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13268 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13269 define Flex insets.
13272 \begin_layout Standard
13274 \begin_inset Flex CharStyle:Code
13277 \begin_layout Plain Layout
13283 definition must begin with a line of the form:
13286 \begin_layout LyX-Code
13290 \begin_layout Standard
13292 \begin_inset Flex CharStyle:Code
13295 \begin_layout Plain Layout
13301 indicates the inset whose layout is being defined, and here there are two
13305 \begin_layout Enumerate
13306 The layout for a pre-existing inset is being modified.
13307 In this case, can be
13308 \begin_inset Flex CharStyle:Code
13311 \begin_layout Plain Layout
13317 any one of the following:
13318 \begin_inset Flex CharStyle:Code
13321 \begin_layout Plain Layout
13328 \begin_inset Flex CharStyle:Code
13331 \begin_layout Plain Layout
13338 \begin_inset Flex CharStyle:Code
13341 \begin_layout Plain Layout
13348 \begin_inset Flex CharStyle:Code
13351 \begin_layout Plain Layout
13358 \begin_inset Flex CharStyle:Code
13361 \begin_layout Plain Layout
13368 \begin_inset Flex CharStyle:Code
13371 \begin_layout Plain Layout
13378 \begin_inset Flex CharStyle:Code
13381 \begin_layout Plain Layout
13388 \begin_inset Flex CharStyle:Code
13391 \begin_layout Plain Layout
13398 \begin_inset Flex CharStyle:Code
13401 \begin_layout Plain Layout
13408 \begin_inset Flex CharStyle:Code
13411 \begin_layout Plain Layout
13418 \begin_inset Flex CharStyle:Code
13421 \begin_layout Plain Layout
13428 \begin_inset Flex CharStyle:Code
13431 \begin_layout Plain Layout
13438 \begin_inset Flex CharStyle:Code
13441 \begin_layout Plain Layout
13448 \begin_inset Flex CharStyle:Code
13451 \begin_layout Plain Layout
13458 \begin_inset Flex CharStyle:Code
13461 \begin_layout Plain Layout
13468 \begin_inset Flex CharStyle:Code
13471 \begin_layout Plain Layout
13478 \begin_inset Flex CharStyle:Code
13481 \begin_layout Plain Layout
13488 \begin_inset Flex CharStyle:Code
13491 \begin_layout Plain Layout
13498 \begin_inset Flex CharStyle:Code
13501 \begin_layout Plain Layout
13508 \begin_inset Flex CharStyle:Code
13511 \begin_layout Plain Layout
13520 \begin_layout Enumerate
13521 The layout for a Flex inset is being defined.
13523 \begin_inset Flex CharStyle:Code
13526 \begin_layout Plain Layout
13532 can be any valid identifier not used by a pre-existing inset.
13533 Note that the definition of a flex inset
13538 \begin_inset Flex CharStyle:Code
13541 \begin_layout Plain Layout
13547 entry, declaring which type of inset this is.
13550 \begin_layout Standard
13552 \begin_inset Flex CharStyle:Code
13555 \begin_layout Plain Layout
13561 definition can contain the following entries:
13564 \begin_layout Description
13565 \begin_inset Flex CharStyle:Code
13568 \begin_layout Plain Layout
13574 The color for the inset's background.
13575 The valid colors are defined in
13576 \begin_inset Flex CharStyle:Code
13579 \begin_layout Plain Layout
13588 \begin_layout Description
13589 \begin_inset Flex CharStyle:Code
13592 \begin_layout Plain Layout
13599 \begin_inset Flex CharStyle:Code
13602 \begin_layout Plain Layout
13611 \begin_inset Flex CharStyle:Code
13614 \begin_layout Plain Layout
13620 ] Whether to use the content of the inset as the label, when the inset is
13625 \begin_layout Description
13626 \begin_inset Flex CharStyle:Code
13629 \begin_layout Plain Layout
13635 As with paragraph styles (see page
13636 \begin_inset CommandInset ref
13638 reference "des:CopyStyle"
13645 \begin_layout Description
13646 \begin_inset Flex CharStyle:Code
13649 \begin_layout Plain Layout
13656 \begin_inset Flex CharStyle:Code
13659 \begin_layout Plain Layout
13668 \begin_inset Flex CharStyle:Code
13671 \begin_layout Plain Layout
13677 ] Indicates whether the user may employ the Paragraph Settings dialog to
13678 customize the paragraph.
13681 \begin_layout Description
13682 \begin_inset Flex CharStyle:Code
13685 \begin_layout Plain Layout
13692 \begin_inset Flex CharStyle:Code
13695 \begin_layout Plain Layout
13702 \begin_inset Flex CharStyle:Code
13705 \begin_layout Plain Layout
13712 \begin_inset Flex CharStyle:Code
13715 \begin_layout Plain Layout
13721 , describing the rendering style used for the inset's frame and buttons.
13722 Footnotes generally use
13723 \begin_inset Flex CharStyle:Code
13726 \begin_layout Plain Layout
13732 , ERT insets generally
13733 \begin_inset Flex CharStyle:Code
13736 \begin_layout Plain Layout
13742 , and character styles
13743 \begin_inset Flex CharStyle:Code
13746 \begin_layout Plain Layout
13755 \begin_layout Description
13756 \begin_inset Flex CharStyle:Code
13759 \begin_layout Plain Layout
13765 Required at the end of the InsetLayout declarations.
13768 \begin_layout Description
13769 \begin_inset Flex CharStyle:Code
13772 \begin_layout Plain Layout
13778 The font used for both the text body
13784 \begin_inset space ~
13788 \begin_inset CommandInset ref
13790 reference "sub:Font-description"
13795 Note that defining this font automatically defines the
13796 \begin_inset Flex CharStyle:Code
13799 \begin_layout Plain Layout
13805 to the same value, so define this first and define
13806 \begin_inset Flex CharStyle:Code
13809 \begin_layout Plain Layout
13815 later if you want them to be different.
13818 \begin_layout Description
13819 \begin_inset Flex CharStyle:Code
13822 \begin_layout Plain Layout
13829 \begin_inset Quotes eld
13833 \begin_inset Quotes erd
13836 language, leading to Left-to-Right (latin) output, e.
13837 \begin_inset space \thinspace{}
13841 \begin_inset space \space{}
13844 in TeX code or URL.
13848 \begin_layout Description
13849 \begin_inset Flex CharStyle:Code
13852 \begin_layout Plain Layout
13859 \begin_inset Flex CharStyle:Code
13862 \begin_layout Plain Layout
13871 \begin_inset Flex CharStyle:Code
13874 \begin_layout Plain Layout
13880 ] Indicates whether the PlainLayout should be used or, instead, the user
13881 can change the paragraph style used in the inset.
13885 \begin_layout Description
13886 \begin_inset Flex CharStyle:Code
13889 \begin_layout Plain Layout
13895 As with paragraph styles (see page
13896 \begin_inset CommandInset ref
13897 LatexCommand pageref
13898 reference "des:FreeSpacing"
13906 \begin_layout Description
13907 \begin_inset Flex CharStyle:Code
13910 \begin_layout Plain Layout
13916 These tags control XHTML output.
13920 \begin_layout Description
13921 \begin_inset Flex CharStyle:Code
13924 \begin_layout Plain Layout
13931 \begin_inset Flex CharStyle:Code
13934 \begin_layout Plain Layout
13943 \begin_inset Flex CharStyle:Code
13946 \begin_layout Plain Layout
13952 ] Whether to include the contents of this inset in the strings generated
13953 for the `Outline' pane.
13954 One would not, for example, want the content of a footnote in a section
13955 header to be included in the TOC displayed in the outline, but one would
13956 normally want the content of a character style displayed.
13957 Default is false: not to include.
13960 \begin_layout Description
13961 \begin_inset Flex CharStyle:Code
13964 \begin_layout Plain Layout
13970 As with paragraph styles (see page
13971 \begin_inset CommandInset ref
13972 LatexCommand pageref
13973 reference "des:KeepEmpty"
13981 \begin_layout Description
13982 \begin_inset Flex CharStyle:Code
13985 \begin_layout Plain Layout
13991 The font used for the label.
13993 \begin_inset space ~
13997 \begin_inset CommandInset ref
13999 reference "sub:Font-description"
14004 Note that this definition can never appear before
14005 \begin_inset Flex CharStyle:Code
14008 \begin_layout Plain Layout
14014 , lest it be ineffective.
14017 \begin_layout Description
14018 \begin_inset Flex CharStyle:Code
14021 \begin_layout Plain Layout
14027 What will be displayed on the button or elsewhere as the inset label.
14028 Some inset types (TeX code and Branch) modify this label on the fly.
14031 \begin_layout Description
14032 \begin_inset Flex CharStyle:Code
14035 \begin_layout Plain Layout
14041 The name of the corresponding LaTeX stuff.
14042 Either the environment or command name.
14045 \begin_layout Description
14046 \begin_inset Flex CharStyle:Code
14049 \begin_layout Plain Layout
14055 The optional parameter for the corresponding
14056 \begin_inset Flex CharStyle:Code
14059 \begin_layout Plain Layout
14065 stuff, including possible bracket pairs like
14066 \begin_inset Flex CharStyle:Code
14069 \begin_layout Plain Layout
14076 This parameter cannot be changed from within LyX.
14079 \begin_layout Description
14080 \begin_inset Flex CharStyle:Code
14083 \begin_layout Plain Layout
14089 As with paragraph styles (see page
14090 \begin_inset CommandInset ref
14091 LatexCommand pageref
14092 reference "des:LatexType"
14099 \begin_layout Description
14100 \begin_inset Flex CharStyle:Code
14103 \begin_layout Plain Layout
14110 \begin_inset Flex CharStyle:Code
14113 \begin_layout Plain Layout
14120 \begin_inset Flex CharStyle:Code
14123 \begin_layout Plain Layout
14130 \begin_inset Flex CharStyle:Code
14133 \begin_layout Plain Layout
14140 \begin_inset Flex CharStyle:Code
14143 \begin_layout Plain Layout
14149 (indicating a dummy definition ending definitions of charstyles, etc).
14150 This entry is required in and is only meaningful for Flex insets.
14151 Among other things, it determines on which menu this inset will appear.
14153 \begin_inset Flex CharStyle:Code
14156 \begin_layout Plain Layout
14163 \begin_inset Flex CharStyle:Code
14166 \begin_layout Plain Layout
14173 \begin_inset Flex CharStyle:Code
14176 \begin_layout Plain Layout
14184 \begin_inset Flex CharStyle:Code
14187 \begin_layout Plain Layout
14193 can be set to true for charstyle insets, if you wish, by setting it
14198 \begin_inset Flex CharStyle:Code
14201 \begin_layout Plain Layout
14210 \begin_layout Description
14211 \begin_inset Flex CharStyle:Code
14214 \begin_layout Plain Layout
14221 \begin_inset Flex CharStyle:Code
14224 \begin_layout Plain Layout
14233 \begin_inset Flex CharStyle:Code
14236 \begin_layout Plain Layout
14242 ] Whether multiple paragraphs are permitted in this inset.
14244 \begin_inset Flex CharStyle:Code
14247 \begin_layout Plain Layout
14253 to the same value and
14254 \begin_inset Flex CharStyle:Code
14257 \begin_layout Plain Layout
14263 to the opposite value.
14264 These can be reset to other values, if they are used
14269 \begin_inset Flex CharStyle:Code
14272 \begin_layout Plain Layout
14282 \begin_layout Description
14283 \begin_inset Flex CharStyle:Code
14286 \begin_layout Plain Layout
14293 \begin_inset Flex CharStyle:Code
14296 \begin_layout Plain Layout
14305 \begin_inset Flex CharStyle:Code
14308 \begin_layout Plain Layout
14314 ] Whether fragile commands in this layout should be
14315 \begin_inset Flex CharStyle:Code
14318 \begin_layout Plain Layout
14331 whether the command should itself be protected.) Default is false.
14334 \begin_layout Description
14335 \begin_inset Flex CharStyle:Code
14338 \begin_layout Plain Layout
14345 \begin_inset Flex CharStyle:Code
14348 \begin_layout Plain Layout
14357 \begin_inset Flex CharStyle:Code
14360 \begin_layout Plain Layout
14366 ] As with paragraph styles (see page
14367 \begin_inset CommandInset ref
14368 LatexCommand pageref
14369 reference "des:PathThru"
14377 \begin_layout Description
14378 \begin_inset Flex CharStyle:Code
14381 \begin_layout Plain Layout
14387 As with paragraph styles (see page
14388 \begin_inset CommandInset ref
14389 LatexCommand pageref
14390 reference "des:Preamble"
14397 \begin_layout Description
14398 \begin_inset Flex CharStyle:Code
14401 \begin_layout Plain Layout
14408 \begin_inset Flex CharStyle:Code
14411 \begin_layout Plain Layout
14417 ] The prefix to use when creating labels referring to insets of this type.
14418 This allows the use of formatted references.
14421 \begin_layout Description
14422 \begin_inset Flex CharStyle:Code
14425 \begin_layout Plain Layout
14432 \begin_inset Flex CharStyle:Code
14435 \begin_layout Plain Layout
14441 ] As with paragraph styles (see page
14442 \begin_inset CommandInset ref
14443 LatexCommand pageref
14444 reference "des:Requires"
14451 \begin_layout Description
14452 \begin_inset Flex CharStyle:Code
14455 \begin_layout Plain Layout
14462 \begin_inset Flex CharStyle:Code
14465 \begin_layout Plain Layout
14472 \begin_inset Flex CharStyle:Code
14475 \begin_layout Plain Layout
14483 ] Spellcheck the contents of this inset.
14487 \begin_layout Subsection
14489 \begin_inset CommandInset label
14491 name "sub:Counters"
14498 \begin_layout Standard
14499 Since version 1.3.0 of LyX, it is both possible and necessary to define the
14501 \begin_inset Flex CharStyle:MenuItem
14504 \begin_layout Plain Layout
14511 \begin_inset Flex CharStyle:MenuItem
14514 \begin_layout Plain Layout
14520 , \SpecialChar \ldots{}
14521 ) in the text class itself.
14522 The standard counters are defined in the file
14523 \begin_inset Flex CharStyle:Code
14526 \begin_layout Plain Layout
14532 , so you may have to do no more than add
14535 \begin_layout LyX-Code
14536 Input stdcounters.inc
14539 \begin_layout Standard
14540 to your layout file to get them to work.
14541 But if you want to define custom counters, then you can do so.
14542 The counter declaration must begin with:
14545 \begin_layout LyX-Code
14546 Counter CounterName
14549 \begin_layout Standard
14551 \begin_inset Flex CharStyle:Code
14554 \begin_layout Plain Layout
14560 ' is replaced by the name of the counter.
14561 And it must end with
14562 \begin_inset Quotes eld
14566 \begin_inset Flex CharStyle:Code
14569 \begin_layout Plain Layout
14576 \begin_inset Quotes erd
14580 The following parameters can also be used:
14583 \begin_layout Description
14584 \begin_inset Flex CharStyle:Code
14587 \begin_layout Plain Layout
14594 \begin_inset Flex CharStyle:Code
14597 \begin_layout Plain Layout
14604 \begin_inset Quotes erd
14608 \begin_inset Quotes erd
14611 ] When defined, this string defines how the counter is displayed.
14612 Setting this value sets
14613 \begin_inset Flex CharStyle:Code
14616 \begin_layout Plain Layout
14617 LabelStringAppendix
14623 The following special constructs can be used in the string:
14627 \begin_layout Itemize
14628 \begin_inset Flex CharStyle:Code
14631 \begin_layout Plain Layout
14639 will be replaced by the expansion of the
14640 \begin_inset Flex CharStyle:Code
14643 \begin_layout Plain Layout
14650 \begin_inset Flex CharStyle:Code
14653 \begin_layout Plain Layout
14654 LabelStringAppendix
14660 \begin_inset Flex CharStyle:Code
14663 \begin_layout Plain Layout
14673 \begin_layout Itemize
14674 counter values can be expressed using LaTeX-like macros
14675 \begin_inset Flex CharStyle:Code
14678 \begin_layout Plain Layout
14695 \begin_inset Flex CharStyle:Code
14698 \begin_layout Plain Layout
14710 \begin_layout Plain Layout
14720 Actually, the situation is a bit more complicated: any
14739 other than those described below will produce arabic numerals.
14740 It would not be surprising to see this change in the future.
14746 \begin_inset Flex CharStyle:Code
14749 \begin_layout Plain Layout
14755 : 1, 2, 3,\SpecialChar \ldots{}
14757 \begin_inset Flex CharStyle:Code
14760 \begin_layout Plain Layout
14766 for lower-case letters: a, b, c, \SpecialChar \ldots{}
14768 \begin_inset Flex CharStyle:Code
14771 \begin_layout Plain Layout
14777 for upper-case letters: A, B, C, \SpecialChar \ldots{}
14779 \begin_inset Flex CharStyle:Code
14782 \begin_layout Plain Layout
14788 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
14790 \begin_inset Flex CharStyle:Code
14793 \begin_layout Plain Layout
14799 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
14801 \begin_inset Flex CharStyle:Code
14804 \begin_layout Plain Layout
14810 for hebrew numerals.
14814 \begin_layout Standard
14815 If LabelString is not defined, a default value is constructed as follows:
14816 if the counter has a master counter
14817 \begin_inset Flex CharStyle:Code
14820 \begin_layout Plain Layout
14827 \begin_inset Flex CharStyle:Code
14830 \begin_layout Plain Layout
14837 \begin_inset Flex CharStyle:Code
14840 \begin_layout Plain Layout
14850 is used; otherwise the string
14851 \begin_inset Flex CharStyle:Code
14854 \begin_layout Plain Layout
14865 \begin_layout Description
14866 \begin_inset Flex CharStyle:Code
14869 \begin_layout Plain Layout
14870 LabelStringAppendix
14876 \begin_inset Flex CharStyle:Code
14879 \begin_layout Plain Layout
14886 \begin_inset Quotes erd
14890 \begin_inset Quotes erd
14894 \begin_inset Flex CharStyle:Code
14897 \begin_layout Plain Layout
14903 , but for use in the Appendix.
14906 \begin_layout Description
14907 \begin_inset Flex CharStyle:Code
14910 \begin_layout Plain Layout
14917 \begin_inset Flex CharStyle:Code
14920 \begin_layout Plain Layout
14927 \begin_inset Quotes erd
14931 \begin_inset Quotes erd
14934 ] A format for use with formatted references to this counter.
14935 For example, one might want to have references to section numbers appear
14937 \begin_inset Quotes eld
14941 \begin_inset Quotes erd
14945 The string should contain
14946 \begin_inset Quotes eld
14950 \begin_inset Quotes erd
14954 This will be replaced by the counter number itself.
14955 So, for sections, it would be: Section ##.
14958 \begin_layout Description
14959 \begin_inset Flex CharStyle:Code
14962 \begin_layout Plain Layout
14969 \begin_inset Flex CharStyle:Code
14972 \begin_layout Plain Layout
14979 \begin_inset Quotes erd
14983 \begin_inset Quotes erd
14986 ] If this is set to the name of another counter, the present counter will
14987 be reset every time the other one is increased.
14989 \begin_inset Flex CharStyle:Code
14992 \begin_layout Plain Layout
14999 \begin_inset Flex CharStyle:Code
15002 \begin_layout Plain Layout
15011 \begin_layout Subsection
15013 \begin_inset CommandInset label
15015 name "sub:Font-description"
15022 \begin_layout Standard
15023 A font description looks like this:
15026 \begin_layout LyX-Code
15036 \begin_layout LyX-Code
15040 \begin_layout LyX-Code
15044 \begin_layout Standard
15045 The following commands are available:
15048 \begin_layout Description
15049 \begin_inset Flex CharStyle:Code
15052 \begin_layout Plain Layout
15059 \begin_inset Flex CharStyle:Code
15062 \begin_layout Plain Layout
15071 \begin_inset Flex CharStyle:Code
15074 \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
15131 \begin_inset Flex CharStyle:Code
15134 \begin_layout Plain Layout
15141 \begin_inset Flex CharStyle:Code
15144 \begin_layout Plain Layout
15153 \begin_layout Description
15154 \begin_inset Flex CharStyle:Code
15157 \begin_layout Plain Layout
15164 \begin_inset Flex CharStyle:Code
15167 \begin_layout Plain Layout
15176 \begin_inset Flex CharStyle:Code
15179 \begin_layout Plain Layout
15186 \begin_inset Flex CharStyle:Code
15189 \begin_layout Plain Layout
15198 \begin_layout Description
15199 \begin_inset Flex CharStyle:Code
15202 \begin_layout Plain Layout
15209 \begin_inset Flex CharStyle:Code
15212 \begin_layout Plain Layout
15218 ] Valid arguments are:
15219 \begin_inset Flex CharStyle:Code
15222 \begin_layout Plain Layout
15229 \begin_inset Flex CharStyle:Code
15232 \begin_layout Plain Layout
15239 \begin_inset Flex CharStyle:Code
15242 \begin_layout Plain Layout
15249 \begin_inset Flex CharStyle:Code
15252 \begin_layout Plain Layout
15259 \begin_inset Flex CharStyle:Code
15262 \begin_layout Plain Layout
15269 \begin_inset Flex CharStyle:Code
15272 \begin_layout Plain Layout
15279 Each of these turns on or off the corresponding attribute.
15281 \begin_inset Flex CharStyle:Code
15284 \begin_layout Plain Layout
15290 turns on emphasis, and
15291 \begin_inset Flex CharStyle:Code
15294 \begin_layout Plain Layout
15302 \begin_inset Newline newline
15305 If the latter seems puzzling, remember that the font settings for the present
15306 context are generally inherited from the surrounding context.
15308 \begin_inset Flex CharStyle:Code
15311 \begin_layout Plain Layout
15317 would turn off the emphasis that was anyway in effect, say, in a theorem
15321 \begin_layout Description
15322 \begin_inset Flex CharStyle:Code
15325 \begin_layout Plain Layout
15332 \begin_inset Flex CharStyle:Code
15335 \begin_layout Plain Layout
15344 \begin_inset Flex CharStyle:Code
15347 \begin_layout Plain Layout
15356 \begin_layout Description
15357 \begin_inset Flex CharStyle:Code
15360 \begin_layout Plain Layout
15367 \begin_inset Flex CharStyle:Code
15370 \begin_layout Plain Layout
15379 \begin_inset Flex CharStyle:Code
15382 \begin_layout Plain Layout
15389 \begin_inset Flex CharStyle:Code
15392 \begin_layout Plain Layout
15399 \begin_inset Flex CharStyle:Code
15402 \begin_layout Plain Layout
15411 \begin_layout Description
15412 \begin_inset Flex CharStyle:Code
15415 \begin_layout Plain Layout
15422 \begin_inset Flex CharStyle:Code
15425 \begin_layout Plain Layout
15432 \begin_inset Flex CharStyle:Code
15435 \begin_layout Plain Layout
15442 \begin_inset Flex CharStyle:Code
15445 \begin_layout Plain Layout
15454 \begin_inset Flex CharStyle:Code
15457 \begin_layout Plain Layout
15464 \begin_inset Flex CharStyle:Code
15467 \begin_layout Plain Layout
15474 \begin_inset Flex CharStyle:Code
15477 \begin_layout Plain Layout
15484 \begin_inset Flex CharStyle:Code
15487 \begin_layout Plain Layout
15494 \begin_inset Flex CharStyle:Code
15497 \begin_layout Plain Layout
15506 \begin_layout Subsection
15507 Citation format description
15510 \begin_layout Standard
15512 \begin_inset Flex CharStyle:Code
15515 \begin_layout Plain Layout
15521 blocks are used to describe how bibliographic information should be displayed,
15522 both within LyX itself (in the citation dialog and in tooltips, for example)
15523 and in XHTML output.
15524 Such a block might look like this:
15527 \begin_layout LyX-Code
15531 \begin_layout LyX-Code
15535 \begin_layout LyX-Code
15539 \begin_layout LyX-Code
15543 \begin_layout Standard
15544 The individual lines define how the bibliographic information associated
15545 with an article or book, respectively, is to be displayed, and such a definitio
15546 n can be given for any `entry type' that might be present in a BibTeX file.
15547 LyX defines a default format in the source code that will be used if no
15548 specific definition has been given.
15549 LyX predefines several formats in the file
15550 \begin_inset Flex CharStyle:Code
15553 \begin_layout Plain Layout
15559 , which is included in most of LyX's document classes.
15562 \begin_layout Standard
15563 The definitions use a simple language that allows BibTeX keys to be replaced
15565 Keys should be enclosed in % signs, e.g.:
15566 \begin_inset Flex CharStyle:Code
15569 \begin_layout Plain Layout
15576 So a simple definition might look like this:
15579 \begin_layout LyX-Code
15581 \begin_inset Quotes eld
15585 \begin_inset Quotes erd
15591 \begin_layout Standard
15592 This would print the author, followed by a comma, followed by the title,
15593 in quotes, followed by a period.
15596 \begin_layout Standard
15597 Of course, sometimes you may want to print a key only if it exists.
15598 This can be done by using a conditional construction, such as:
15599 \begin_inset Flex CharStyle:Code
15602 \begin_layout Plain Layout
15604 \begin_inset space ~
15614 \begin_inset Flex CharStyle:Code
15617 \begin_layout Plain Layout
15623 key exists, then print
15624 \begin_inset Quotes eld
15628 \begin_inset space ~
15632 \begin_inset Quotes erd
15635 followed by the volume key.
15636 It is also possible to have an else clause in the conditional, such as:
15638 \begin_inset Flex CharStyle:Code
15641 \begin_layout Plain Layout
15642 {%author%[[%author%]][[%editor%, ed.]]}
15649 \begin_inset Flex CharStyle:Code
15652 \begin_layout Plain Layout
15658 key is printed if it exists; otherwise, the editor key is printed, followed
15660 \begin_inset Quotes eld
15664 \begin_inset space ~
15668 \begin_inset Quotes erd
15671 Note that the key is again enclosed in % signs; the entire conditional
15672 is enclosed in braces; and the if and else clauses are enclosed in double
15674 \begin_inset Quotes eld
15678 \begin_inset Quotes eld
15682 \begin_inset Quotes eld
15686 \begin_inset Quotes erd
15690 There must be no space between any of these.
15693 \begin_layout Standard
15694 There is one other piece of syntax available in definitions, which looks
15696 \begin_inset Flex CharStyle:Code
15699 \begin_layout Plain Layout
15706 This defines a piece of formatting information that is to be used when
15708 \begin_inset Quotes eld
15712 \begin_inset Quotes erd
15716 Obviously, we do not want to output HTML tags when writing plain text,
15717 so they should be wrapped in
15718 \begin_inset Quotes eld
15722 \begin_inset Quotes erd
15726 \begin_inset Quotes eld
15730 \begin_inset Quotes erd
15736 \begin_layout Standard
15737 Two special sorts of definitions are also possible in a
15738 \begin_inset Flex CharStyle:Code
15741 \begin_layout Plain Layout
15748 An example of the first would be:
15751 \begin_layout LyX-Code
15753 \begin_inset Quotes eld
15757 \begin_inset Quotes erd
15763 \begin_layout Standard
15764 This is an abbreviation, or macro, and it can be used by treating it as
15766 \begin_inset Flex CharStyle:Code
15769 \begin_layout Plain Layout
15777 \begin_inset Flex CharStyle:Code
15780 \begin_layout Plain Layout
15786 exactly as it would treat its definition.
15787 So, let us issue the obvious
15795 \begin_layout LyX-Code
15799 \begin_layout Standard
15800 or anything like it.
15801 LyX shouldn't go into an infinite loop, but it may go into a long one before
15805 \begin_layout Standard
15806 The second sort of special definition might look like this:
15809 \begin_layout LyX-Code
15813 \begin_layout Standard
15814 This defines a translatable piece of text, which allows relevant parts of
15815 the bibliography to be translated.
15816 It can be included in a definition by treating it as a key:
15817 \begin_inset Flex CharStyle:Code
15820 \begin_layout Plain Layout
15827 Several of these are predefined in
15828 \begin_inset Flex CharStyle:Code
15831 \begin_layout Plain Layout
15838 Note that these are not macros, in the sense just defined.
15839 They will not be expanded.
15842 \begin_layout Standard
15843 So here then is an example that use all these features:
15846 \begin_layout LyX-Code
15847 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
15850 \begin_layout Standard
15851 The defines a macro that prints the author, followed by a comma, if the
15853 \begin_inset Flex CharStyle:Code
15856 \begin_layout Plain Layout
15862 key is defined, or else prints the name of the editor, followed by the
15864 \begin_inset Flex CharStyle:Code
15867 \begin_layout Plain Layout
15873 or its translation (it is by default
15874 \begin_inset Quotes eld
15878 \begin_inset Quotes erd
15882 \begin_inset Flex CharStyle:Code
15885 \begin_layout Plain Layout
15892 Note that this is in fact defined in
15893 \begin_inset Flex CharStyle:Code
15896 \begin_layout Plain Layout
15902 , so you can use it in your own definitions, or re-definitions, if you load
15906 \begin_layout Section
15907 \begin_inset CommandInset label
15909 name "sec:Tags-for-XHTML"
15913 Tags for XHTML output
15916 \begin_layout Standard
15917 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
15918 by layout information.
15919 In general, LyX provides sensible defaults and, as mentioned earlier, it
15920 will even construct default CSS style rules from the other layout tags.
15921 For example, LyX will attempt to use the information provided in the
15922 \begin_inset Flex CharStyle:Code
15925 \begin_layout Plain Layout
15931 declaration for the Chapter style to write CSS that will appropriately
15932 format chapter headings.
15935 \begin_layout Standard
15936 In many cases, then, you may not have to do anything at all to get acceptable
15937 XHTML output for your own environments, custom insets, and so forth.
15938 But in some cases you will, and so LyX provides a number of layout tags
15939 that can be used to customize the XHTML and CSS that are generated.
15942 \begin_layout Standard
15943 Note that there are two tags,
15944 \begin_inset Flex CharStyle:Code
15947 \begin_layout Plain Layout
15954 \begin_inset Flex CharStyle:Code
15957 \begin_layout Plain Layout
15963 that may appear outside style and inset declarations.
15965 \begin_inset CommandInset ref
15966 LatexCommand prettyref
15967 reference "sub:General-text-class"
15971 for details on these.
15974 \begin_layout Subsection
15975 \begin_inset CommandInset label
15977 name "sub:Paragraph-Style-XHTML"
15984 \begin_layout Standard
15985 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
15986 dealing with a normal paragraph, a command, or an environment, where this
15987 is itself determined by the contents of the corresponding
15988 \begin_inset Flex CharStyle:Code
15991 \begin_layout Plain Layout
16001 \begin_layout Standard
16002 For a command or normal paragraph, the output XHTML has the following form:
16005 \begin_layout LyX-Code
16007 \begin_inset Quotes erd
16011 \begin_inset Quotes erd
16017 \begin_layout LyX-Code
16019 \begin_inset Quotes erd
16023 \begin_inset Quotes erd
16029 \begin_layout LyX-Code
16030 Contents of the paragraph.
16033 \begin_layout LyX-Code
16037 \begin_layout Standard
16038 The label tags are of course omitted if the paragraph does not have a label.
16041 \begin_layout Standard
16042 For an environment that is not some sort of list, the XHTML takes this form:
16045 \begin_layout LyX-Code
16047 \begin_inset Quotes erd
16051 \begin_inset Quotes erd
16057 \begin_layout LyX-Code
16059 \begin_inset Quotes erd
16063 \begin_inset Quotes erd
16067 \begin_inset Quotes erd
16071 \begin_inset Quotes erd
16074 >Environment Label</labeltag>First paragraph.</itemtag>
16077 \begin_layout LyX-Code
16078 <itemtag>Second paragraph.</itemtag>
16081 \begin_layout LyX-Code
16085 \begin_layout Standard
16086 Note that the label is output only for the first paragraph, as it should
16087 be for a theorem, for example.
16091 \begin_layout Standard
16092 For a list, we have one of these forms:
16095 \begin_layout LyX-Code
16097 \begin_inset Quotes erd
16101 \begin_inset Quotes erd
16107 \begin_layout LyX-Code
16109 \begin_inset Quotes erd
16113 \begin_inset Quotes erd
16117 \begin_inset Quotes erd
16121 \begin_inset Quotes erd
16124 >List Label</labeltag>First item.</itemtag>
16127 \begin_layout LyX-Code
16129 \begin_inset Quotes erd
16133 \begin_inset Quotes erd
16137 \begin_inset Quotes erd
16141 \begin_inset Quotes erd
16144 >List Label</labeltag>Second item.</itemtag>
16147 \begin_layout LyX-Code
16151 \begin_layout LyX-Code
16155 \begin_layout LyX-Code
16157 \begin_inset Quotes erd
16161 \begin_inset Quotes erd
16167 \begin_layout LyX-Code
16169 \begin_inset Quotes erd
16173 \begin_inset Quotes erd
16176 >List Label</labeltag><itemtag attr=
16177 \begin_inset Quotes erd
16181 \begin_inset Quotes erd
16184 >First item.</itemtag>
16187 \begin_layout LyX-Code
16189 \begin_inset Quotes erd
16193 \begin_inset Quotes erd
16196 >List Label</labeltag><itemtag attr=
16197 \begin_inset Quotes erd
16201 \begin_inset Quotes erd
16204 >Second item.</itemtag>
16207 \begin_layout LyX-Code
16211 \begin_layout Standard
16212 Note the different orders of
16213 \begin_inset Flex CharStyle:Code
16216 \begin_layout Plain Layout
16223 \begin_inset Flex CharStyle:Code
16226 \begin_layout Plain Layout
16233 Which order we get depends upon the setting of
16234 \begin_inset Flex CharStyle:Code
16237 \begin_layout Plain Layout
16244 \begin_inset Flex CharStyle:Code
16247 \begin_layout Plain Layout
16253 is false (the default), you get the first of these, with the label within
16254 the item; if true, you get the second, with the label outside the item.
16257 \begin_layout Standard
16258 The specific tags and attributes output for each paragraph type can be controlle
16259 d by means of the layout tags we are about to describe.
16260 As mentioned earlier, however, LyX uses sensible defaults for many of these,
16261 so you often may not need to do very much to get good XHTML output.
16262 Think of the available tags as there so you can tweak things to your liking.
16265 \begin_layout Description
16266 \begin_inset Flex CharStyle:Code
16269 \begin_layout Plain Layout
16276 \begin_inset Flex CharStyle:Code
16279 \begin_layout Plain Layout
16285 ] Specifies attribute information to be output with the main tag.
16287 \begin_inset Quotes eld
16291 \begin_inset Flex CharStyle:Code
16294 \begin_layout Plain Layout
16301 \begin_inset Quotes erd
16305 By default, LyX will output
16306 \begin_inset Quotes eld
16310 \begin_inset Flex CharStyle:Code
16313 \begin_layout Plain Layout
16320 \begin_inset Quotes erd
16324 \begin_inset Flex CharStyle:Code
16327 \begin_layout Plain Layout
16333 is the LyX name of the layout, made lowercase, for example: chapter.
16336 \begin_layout Description
16337 \begin_inset Flex CharStyle:Code
16340 \begin_layout Plain Layout
16347 \begin_inset Flex CharStyle:Code
16350 \begin_layout Plain Layout
16360 ] Whether to output the default CSS information LyX generates for this layout,
16361 even if additional information is explicitly provided via
16362 \begin_inset Flex CharStyle:Code
16365 \begin_layout Plain Layout
16373 \begin_inset Flex CharStyle:Code
16376 \begin_layout Plain Layout
16382 allows you to alter or augment the generated CSS, rather than to override
16385 \begin_inset Flex CharStyle:Code
16388 \begin_layout Plain Layout
16397 \begin_layout Description
16398 \begin_inset Flex CharStyle:Code
16401 \begin_layout Plain Layout
16408 \begin_inset Flex CharStyle:Code
16411 \begin_layout Plain Layout
16417 ] The tag to be used for individual paragraphs of environments, replacing
16419 \begin_inset Flex CharStyle:Code
16422 \begin_layout Plain Layout
16428 in the examples above.
16430 \begin_inset Flex CharStyle:Code
16433 \begin_layout Plain Layout
16442 \begin_layout Description
16443 \begin_inset Flex CharStyle:Code
16446 \begin_layout Plain Layout
16453 \begin_inset Flex CharStyle:Code
16456 \begin_layout Plain Layout
16462 ] Attributes for the item tag.
16464 \begin_inset Quotes eld
16468 \begin_inset Flex CharStyle:Code
16471 \begin_layout Plain Layout
16472 class=`layoutname_item'
16478 \begin_inset Quotes erd
16484 \begin_layout Description
16485 \begin_inset Flex CharStyle:Code
16488 \begin_layout Plain Layout
16495 \begin_inset Flex CharStyle:Code
16498 \begin_layout Plain Layout
16504 ] The tag to be used for paragraph and item labels, replacing
16505 \begin_inset Flex CharStyle:Code
16508 \begin_layout Plain Layout
16514 in the examples above.
16516 \begin_inset Flex CharStyle:Code
16519 \begin_layout Plain Layout
16528 \begin_layout Description
16529 \begin_inset Flex CharStyle:Code
16532 \begin_layout Plain Layout
16539 \begin_inset Flex CharStyle:Code
16542 \begin_layout Plain Layout
16548 ] Attributes for the label tag.
16550 \begin_inset Quotes eld
16554 \begin_inset Flex CharStyle:Code
16557 \begin_layout Plain Layout
16558 class=`layoutname_label'
16564 \begin_inset Quotes erd
16570 \begin_layout Description
16571 \begin_inset Flex CharStyle:Code
16574 \begin_layout Plain Layout
16581 \begin_inset Flex CharStyle:Code
16584 \begin_layout Plain Layout
16594 ] Meaningful only for list-like environments, this tag controls whether
16595 the label tag is output before or inside the item tag.
16596 This is used, for example, in the description environment, where we want
16598 \begin_inset Flex CharStyle:Code
16601 \begin_layout Plain Layout
16602 <dt>\SpecialChar \ldots{}
16603 </dt><dd>\SpecialChar \ldots{}
16611 \begin_inset Flex CharStyle:Code
16614 \begin_layout Plain Layout
16620 : The label tag is output inside the item tag.
16623 \begin_layout Description
16624 \begin_inset Flex CharStyle:Code
16627 \begin_layout Plain Layout
16633 Information to be output in the
16634 \begin_inset Flex CharStyle:Code
16637 \begin_layout Plain Layout
16643 section when this style is used.
16644 This might, for example, be used to include a
16645 \begin_inset Flex CharStyle:Code
16648 \begin_layout Plain Layout
16655 \begin_inset Flex CharStyle:Code
16658 \begin_layout Plain Layout
16667 \begin_layout Description
16668 \begin_inset Flex CharStyle:Code
16671 \begin_layout Plain Layout
16677 CSS style information to be included when this style is used.
16678 Note that this will automatically be wrapped in a layout-generated
16679 \begin_inset Flex CharStyle:Code
16682 \begin_layout Plain Layout
16688 block, so only the CSS itself need be included.
16691 \begin_layout Description
16692 \begin_inset Flex CharStyle:Code
16695 \begin_layout Plain Layout
16702 \begin_inset Flex CharStyle:Code
16705 \begin_layout Plain Layout
16711 ] The tag to be used for the main label, replacing
16712 \begin_inset Flex CharStyle:Code
16715 \begin_layout Plain Layout
16721 in the examples above.
16723 \begin_inset Flex CharStyle:Code
16726 \begin_layout Plain Layout
16735 \begin_layout Description
16736 \begin_inset Flex CharStyle:Code
16739 \begin_layout Plain Layout
16746 \begin_inset Flex CharStyle:Code
16749 \begin_layout Plain Layout
16759 ] Marks this style as the one to be used to generate the
16760 \begin_inset Flex CharStyle:Code
16763 \begin_layout Plain Layout
16769 tag for the XHTML file.
16770 By default, it is false.
16772 \begin_inset Flex CharStyle:Code
16775 \begin_layout Plain Layout
16781 file sets it to true for the
16782 \begin_inset Flex CharStyle:Code
16785 \begin_layout Plain Layout
16795 \begin_layout Subsection
16799 \begin_layout Standard
16800 The XHTML output of insets can also be controlled by information in layout
16805 \begin_layout Plain Layout
16806 At present, this is true only for
16807 \begin_inset Quotes eld
16811 \begin_inset Quotes erd
16814 insets (insets you can type into) and is not true for
16815 \begin_inset Quotes eld
16819 \begin_inset Quotes erd
16822 insets (insets that are associated with dialog boxes).
16827 Here, too, LyX tries to provide sensible defaults, and it constructs default
16829 But everything can be customized.
16832 \begin_layout Standard
16833 The XHTML LyX outputs for an inset has the following form:
16836 \begin_layout LyX-Code
16838 \begin_inset Quotes erd
16842 \begin_inset Quotes erd
16848 \begin_layout LyX-Code
16849 <labeltag>Label</labeltag>
16852 \begin_layout LyX-Code
16854 \begin_inset Quotes erd
16858 \begin_inset Quotes erd
16861 >Contents of the inset.</innertag>
16864 \begin_layout LyX-Code
16868 \begin_layout Standard
16869 If the inset permits multiple paragraphs---that is, if
16870 \begin_inset Flex CharStyle:Code
16873 \begin_layout Plain Layout
16879 is true---then the contents of the inset will itself be output as paragraphs
16880 formatted according to the styles used for those paragraphs (standard,
16881 quote, and the like).
16882 The label tag is of course omitted if the paragraph does not have a label
16883 and, at present, is always
16884 \begin_inset Flex CharStyle:Code
16887 \begin_layout Plain Layout
16894 The inner tag is optional and, by default, does not appear.
16897 \begin_layout Standard
16898 The specific tags and attributes output for each inset can be controlled
16899 by means of the following layout tags.
16902 \begin_layout Description
16903 \begin_inset Flex CharStyle:Code
16906 \begin_layout Plain Layout
16913 \begin_inset Flex CharStyle:Code
16916 \begin_layout Plain Layout
16922 ] Specifies attribute information to be output with the main tag.
16924 \begin_inset Quotes eld
16928 \begin_inset Flex CharStyle:Code
16931 \begin_layout Plain Layout
16932 class=`myinset' onclick=`\SpecialChar \ldots{}
16939 \begin_inset Quotes erd
16943 By default, LyX will output
16944 \begin_inset Quotes eld
16948 \begin_inset Flex CharStyle:Code
16951 \begin_layout Plain Layout
16958 \begin_inset Quotes erd
16962 \begin_inset Flex CharStyle:Code
16965 \begin_layout Plain Layout
16971 is the LyX name of the inset, made lowercase and with non-alphanumeric
16972 characters converted to underscores, for example: footnote.
16975 \begin_layout Description
16976 \begin_inset Flex CharStyle:Code
16979 \begin_layout Plain Layout
16986 \begin_inset Flex CharStyle:Code
16989 \begin_layout Plain Layout
16999 ] Whether to output the default CSS information LyX generates for this layout,
17000 even if additional information is explicitly provided via
17001 \begin_inset Flex CharStyle:Code
17004 \begin_layout Plain Layout
17012 \begin_inset Flex CharStyle:Code
17015 \begin_layout Plain Layout
17021 allows you to alter or augment the generated CSS, rather than to override
17026 \begin_layout Description
17027 \begin_inset Flex CharStyle:Code
17030 \begin_layout Plain Layout
17037 \begin_inset Flex CharStyle:Code
17040 \begin_layout Plain Layout
17046 ] Attributes for the inner tag.
17048 \begin_inset Quotes eld
17052 \begin_inset Flex CharStyle:Code
17055 \begin_layout Plain Layout
17056 class=`insetname_inner'
17062 \begin_inset Quotes erd
17068 \begin_layout Description
17069 \begin_inset Flex CharStyle:Code
17072 \begin_layout Plain Layout
17079 \begin_inset Flex CharStyle:Code
17082 \begin_layout Plain Layout
17088 ] The inner tag, replacing
17089 \begin_inset Flex CharStyle:Code
17092 \begin_layout Plain Layout
17098 in the examples above.
17099 By default, there is none.
17102 \begin_layout Description
17103 \begin_inset Flex CharStyle:Code
17106 \begin_layout Plain Layout
17113 \begin_inset Flex CharStyle:Code
17116 \begin_layout Plain Layout
17124 ] Whether this inset represents a standalone block of text (such as a footnote)
17125 or instead represents material that is included in the surrounding text
17126 (such as a branch).
17130 \begin_layout Description
17131 \begin_inset Flex CharStyle:Code
17134 \begin_layout Plain Layout
17141 \begin_inset Flex CharStyle:Code
17144 \begin_layout Plain Layout
17150 ] A label for this inset, possibly including a reference to a counter.
17151 For example, for footnote, it might be:
17152 \begin_inset Flex CharStyle:Code
17155 \begin_layout Plain Layout
17164 This is optional, and there is no default.
17167 \begin_layout Description
17168 \begin_inset Flex CharStyle:Code
17171 \begin_layout Plain Layout
17177 Information to be output in the
17178 \begin_inset Flex CharStyle:Code
17181 \begin_layout Plain Layout
17187 section when this style is used.
17188 This might, for example, be used to include a
17189 \begin_inset Flex CharStyle:Code
17192 \begin_layout Plain Layout
17199 \begin_inset Flex CharStyle:Code
17202 \begin_layout Plain Layout
17211 \begin_layout Description
17212 \begin_inset Flex CharStyle:Code
17215 \begin_layout Plain Layout
17221 CSS style information to be included when this style is used.
17222 Note that this will automatically be wrapped in a layout-generated
17223 \begin_inset Flex CharStyle:Code
17226 \begin_layout Plain Layout
17232 block, so only the CSS itself need be included.
17235 \begin_layout Description
17236 \begin_inset Flex CharStyle:Code
17239 \begin_layout Plain Layout
17246 \begin_inset Flex CharStyle:Code
17249 \begin_layout Plain Layout
17255 ] The tag to be used for the main label, replacing
17256 \begin_inset Flex CharStyle:Code
17259 \begin_layout Plain Layout
17265 in the examples above.
17266 The default depends upon the setting of
17267 \begin_inset Flex CharStyle:Code
17270 \begin_layout Plain Layout
17277 \begin_inset Flex CharStyle:Code
17280 \begin_layout Plain Layout
17286 is true, the default is
17287 \begin_inset Flex CharStyle:Code
17290 \begin_layout Plain Layout
17296 ; if it is false, the default is
17297 \begin_inset Flex CharStyle:Code
17300 \begin_layout Plain Layout
17309 \begin_layout Subsection
17313 \begin_layout Standard
17314 The XHTML output for floats too can be controlled by layout information.
17315 The output has the following form:
17318 \begin_layout LyX-Code
17320 \begin_inset Quotes erd
17324 \begin_inset Quotes erd
17330 \begin_layout LyX-Code
17331 Contents of the float.
17334 \begin_layout LyX-Code
17338 \begin_layout Standard
17339 The caption, if there is one, is a separate inset and will be output as
17341 Its appearance can be controlled via the InsetLayout for caption insets.
17345 \begin_layout Description
17346 \begin_inset Flex CharStyle:Code
17349 \begin_layout Plain Layout
17356 \begin_inset Flex CharStyle:Code
17359 \begin_layout Plain Layout
17365 ] Specifies attribute information to be output with the main tag.
17367 \begin_inset Quotes eld
17371 \begin_inset Flex CharStyle:Code
17374 \begin_layout Plain Layout
17375 class=`myfloat' onclick=`\SpecialChar \ldots{}
17382 \begin_inset Quotes erd
17386 By default, LyX will output
17387 \begin_inset Quotes eld
17391 \begin_inset Flex CharStyle:Code
17394 \begin_layout Plain Layout
17395 class=`float float-floattype'
17401 \begin_inset Quotes erd
17405 \begin_inset Flex CharStyle:Code
17408 \begin_layout Plain Layout
17414 is LyX's name for this type of float, as determined by the float delcaration
17416 \begin_inset CommandInset ref
17418 reference "sub:Floats"
17422 ), though made lowercase and with non-alphanumeric characters converted
17423 to underscores, for example: float-table.
17426 \begin_layout Description
17427 \begin_inset Flex CharStyle:Code
17430 \begin_layout Plain Layout
17436 CSS style information to be included when this float is used.
17437 Note that this will automatically be wrapped in a layout-generated
17438 \begin_inset Flex CharStyle:Code
17441 \begin_layout Plain Layout
17447 block, so only the CSS itself need be included.
17450 \begin_layout Description
17451 \begin_inset Flex CharStyle:Code
17454 \begin_layout Plain Layout
17461 \begin_inset Flex CharStyle:Code
17464 \begin_layout Plain Layout
17470 ] The tag to be used for this float, replacing
17471 \begin_inset Quotes eld
17475 \begin_inset Flex CharStyle:Code
17478 \begin_layout Plain Layout
17485 \begin_inset Quotes erd
17488 in the example above.
17490 \begin_inset Flex CharStyle:Code
17493 \begin_layout Plain Layout
17499 and will rarely need changing.
17502 \begin_layout Subsection
17506 \begin_layout Standard
17507 We have several times mentioned that LyX will generate default CSS style
17508 rules for both insets and paragraph styles, based upon the other layout
17509 information that is provided.
17510 In this section, we shall say a word about which layout information LyX
17514 \begin_layout Standard
17515 At present, LyX auto-generates CSS only for font information, making use
17517 \begin_inset Flex CharStyle:Code
17520 \begin_layout Plain Layout
17527 \begin_inset Flex CharStyle:Code
17530 \begin_layout Plain Layout
17537 \begin_inset Flex CharStyle:Code
17540 \begin_layout Plain Layout
17547 \begin_inset Flex CharStyle:Code
17550 \begin_layout Plain Layout
17557 \begin_inset Flex CharStyle:Code
17560 \begin_layout Plain Layout
17568 \begin_inset CommandInset ref
17570 reference "sub:Font-description"
17574 .) The translation is mostly straightforward and obvious.
17576 \begin_inset Quotes eld
17580 \begin_inset Flex CharStyle:Code
17583 \begin_layout Plain Layout
17590 \begin_inset Quotes erd
17594 \begin_inset Quotes eld
17598 \begin_inset Flex CharStyle:Code
17601 \begin_layout Plain Layout
17602 font-family: sans-serif;
17608 \begin_inset Quotes erd
17612 The correspondence of LyX sizes and CSS sizes is a little less obvious
17613 but nonetheless intuitive.
17615 \begin_inset Flex CharStyle:Code
17618 \begin_layout Plain Layout
17625 \begin_inset Flex URL
17628 \begin_layout Plain Layout
17639 \begin_layout Chapter
17640 Including External Material
17643 \begin_layout Standard
17644 \begin_inset Box Shadowbox
17653 height_special "totalheight"
17656 \begin_layout Plain Layout
17657 WARNING: This portion of the documentation has not been updated for some
17659 We certainly hope that it is still accurate, but there are no guarantees.
17667 \begin_layout Standard
17668 The use of material from sources external to LyX is covered in detail in
17674 This part of the manual covers what needs to happen behind the scenes for
17675 new sorts of material to be included.
17678 \begin_layout Section
17682 \begin_layout Standard
17683 The external material feature is based on the concept of a
17688 A template is a specification of how LyX should interface with a certain
17690 As bundled, LyX comes with predefined templates for Xfig figures, various
17691 raster format images, chess diagrams, and LilyPond music notation.
17692 You can check the actual list by using the menu
17693 \begin_inset Flex CharStyle:MenuItem
17696 \begin_layout Plain Layout
17697 Insert\SpecialChar \menuseparator
17698 File\SpecialChar \menuseparator
17705 Furthermore, it is possible to roll your own template to support a specific
17707 Later we'll describe in more detail what is involved, and hopefully you
17708 will submit all the templates you create so we can include them in a later
17712 \begin_layout Standard
17713 Another basic idea of the external material feature is to distinguish between
17714 the original file that serves as a base for final material and the produced
17715 file that is included in your exported or printed document.
17716 For example, consider the case of a figure produced with
17717 \begin_inset Flex CharStyle:Code
17720 \begin_layout Plain Layout
17727 The Xfig application itself works on an original file with the
17728 \begin_inset Flex CharStyle:Code
17731 \begin_layout Plain Layout
17738 Within Xfig, you create and change your figure, and when you are done,
17740 \begin_inset Flex CharStyle:Code
17743 \begin_layout Plain Layout
17750 When you want to include the figure in your document, you invoke
17751 \begin_inset Flex CharStyle:Code
17754 \begin_layout Plain Layout
17760 in order to create a PostScript file that can readily be included in your
17763 \begin_inset Flex CharStyle:Code
17766 \begin_layout Plain Layout
17772 file is the original file, and the PostScript file is the produced file.
17775 \begin_layout Standard
17776 This distinction is important in order to allow updating of the material
17777 while you are in the process of writing the document.
17778 Furthermore, it provides us with the flexibility that is needed to support
17779 multiple export formats.
17780 For instance, in the case of a plain text file, it is not exactly an award-winn
17781 ing idea to include the figure as raw PostScript.
17782 Instead, you'd either prefer to just include a reference to the figure
17783 or try to invoke some graphics to ASCII converter to make the final result
17784 look similar to the real graphics.
17785 The external material management allows you to do this, because it is parametri
17786 zed on the different export formats that LyX supports.
17789 \begin_layout Standard
17790 Besides supporting the production of different products according to the
17791 exported format, it supports tight integration with editing and viewing
17793 In the case of an Xfig figure, you are able to invoke Xfig on the original
17794 file with a single click from within the external material dialog in LyX,
17795 and also preview the produced PostScript file with Ghostview with another
17797 No more fiddling around with the command line and/or file browsers to locate
17798 and manipulate the original or produced files.
17799 In this way, you are finally able to take full advantage of the many different
17800 applications that are relevant to use when you write your documents, and
17801 ultimately be more productive.
17804 \begin_layout Section
17805 The external template configuration file
17808 \begin_layout Standard
17809 It is relatively easy to add custom external template definitions to LyX.
17810 However, be aware that doing this in an careless manner most probably
17814 introduce an easily exploitable security hole.
17815 So before you do this, please read the discussion about security in section
17817 \begin_inset CommandInset ref
17819 reference "sec:Security-discussion"
17826 \begin_layout Standard
17827 Having said that, we encourage you to submit any interesting templates that
17832 \begin_layout Standard
17833 The external templates are defined in the
17834 \begin_inset Flex CharStyle:Code
17837 \begin_layout Plain Layout
17838 LyXDir/lib/external_templates
17844 You can place your own version in
17845 \begin_inset Flex CharStyle:Code
17848 \begin_layout Plain Layout
17849 UserDir/external_templates
17857 \begin_layout Standard
17858 A typical template looks like this:
17861 \begin_layout LyX-Code
17865 \begin_layout LyX-Code
17866 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
17869 \begin_layout LyX-Code
17873 \begin_layout LyX-Code
17877 \begin_layout LyX-Code
17881 \begin_layout LyX-Code
17885 \begin_layout LyX-Code
17889 \begin_layout LyX-Code
17890 AutomaticProduction true
17893 \begin_layout LyX-Code
17897 \begin_layout LyX-Code
17901 \begin_layout LyX-Code
17905 \begin_layout LyX-Code
17906 TransformCommand Rotate RotationLatexCommand
17909 \begin_layout LyX-Code
17910 TransformCommand Resize ResizeLatexCommand
17913 \begin_layout LyX-Code
17914 Product "$$RotateFront$$ResizeFront
17917 \begin_layout LyX-Code
17922 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
17925 \begin_layout LyX-Code
17926 $$ResizeBack$$RotateBack"
17929 \begin_layout LyX-Code
17933 \begin_layout LyX-Code
17934 UpdateResult "$$AbsPath$$Basename.pstex_t"
17937 \begin_layout LyX-Code
17938 Requirement "graphicx"
17941 \begin_layout LyX-Code
17942 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
17945 \begin_layout LyX-Code
17946 ReferencedFile latex "$$AbsPath$$Basename.eps"
17949 \begin_layout LyX-Code
17950 ReferencedFile dvi "$$AbsPath$$Basename.eps"
17953 \begin_layout LyX-Code
17957 \begin_layout LyX-Code
17961 \begin_layout LyX-Code
17962 TransformCommand Rotate RotationLatexCommand
17965 \begin_layout LyX-Code
17966 TransformCommand Resize ResizeLatexCommand
17969 \begin_layout LyX-Code
17970 Product "$$RotateFront$$ResizeFront
17973 \begin_layout LyX-Code
17978 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
17981 \begin_layout LyX-Code
17982 $$ResizeBack$$RotateBack"
17985 \begin_layout LyX-Code
17986 UpdateFormat pdftex
17989 \begin_layout LyX-Code
17990 UpdateResult "$$AbsPath$$Basename.pdftex_t"
17993 \begin_layout LyX-Code
17994 Requirement "graphicx"
17997 \begin_layout LyX-Code
17998 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18001 \begin_layout LyX-Code
18002 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18005 \begin_layout LyX-Code
18009 \begin_layout LyX-Code
18013 \begin_layout LyX-Code
18014 Product "$$Contents(
18016 "$$AbsPath$$Basename.asc
18021 \begin_layout LyX-Code
18022 UpdateFormat asciixfig
18025 \begin_layout LyX-Code
18026 UpdateResult "$$AbsPath$$Basename.asc"
18029 \begin_layout LyX-Code
18033 \begin_layout LyX-Code
18037 \begin_layout LyX-Code
18038 Product "<graphic fileref=
18040 "$$AbsOrRelPathMaster$$Basename.eps
18045 \begin_layout LyX-Code
18049 \begin_layout LyX-Code
18053 \begin_layout LyX-Code
18054 UpdateResult "$$AbsPath$$Basename.eps"
18057 \begin_layout LyX-Code
18058 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18061 \begin_layout LyX-Code
18062 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18065 \begin_layout LyX-Code
18069 \begin_layout LyX-Code
18070 Product "[XFig: $$FName]"
18073 \begin_layout LyX-Code
18077 \begin_layout LyX-Code
18081 \begin_layout Standard
18082 As you can see, the template is enclosed in
18083 \begin_inset Flex CharStyle:Code
18086 \begin_layout Plain Layout
18092 \SpecialChar \ldots{}
18094 \begin_inset Flex CharStyle:Code
18097 \begin_layout Plain Layout
18104 It contains a header specifying some general settings and, for each supported
18105 primary document file format, a section
18106 \begin_inset Flex CharStyle:Code
18109 \begin_layout Plain Layout
18115 \SpecialChar \ldots{}
18117 \begin_inset Flex CharStyle:Code
18120 \begin_layout Plain Layout
18129 \begin_layout Subsection
18130 The template header
18133 \begin_layout Description
18134 \begin_inset Flex CharStyle:Code
18137 \begin_layout Plain Layout
18138 AutomaticProduction
18139 \begin_inset space ~
18147 Whether the file represented by the template must be generated by LyX.
18148 This command must occur exactly once.
18151 \begin_layout Description
18152 \begin_inset Flex CharStyle:Code
18155 \begin_layout Plain Layout
18157 \begin_inset space ~
18165 A glob pattern that is used in the file dialog to filter out the desired
18167 If there is more than one possible file extension (e.
18168 \begin_inset space \thinspace{}
18172 \begin_inset space \space{}
18176 \begin_inset Flex CharStyle:Code
18179 \begin_layout Plain Layout
18186 \begin_inset Flex CharStyle:Code
18189 \begin_layout Plain Layout
18195 ), use something like
18196 \begin_inset Flex CharStyle:Code
18199 \begin_layout Plain Layout
18206 This command must occur exactly once.
18209 \begin_layout Description
18210 \begin_inset Flex CharStyle:Code
18213 \begin_layout Plain Layout
18215 \begin_inset space ~
18223 The text that is displayed on the button.
18224 This command must occur exactly once.
18227 \begin_layout Description
18228 \begin_inset Flex CharStyle:Code
18231 \begin_layout Plain Layout
18233 \begin_inset space ~
18237 \begin_inset space ~
18245 The help text that is used in the External dialog.
18246 Provide enough information to explain to the user just what the template
18247 can provide him with.
18248 This command must occur exactly once.
18251 \begin_layout Description
18252 \begin_inset Flex CharStyle:Code
18255 \begin_layout Plain Layout
18257 \begin_inset space ~
18265 The file format of the original file.
18266 This must be the name of a format that is known to LyX (see section
18267 \begin_inset CommandInset ref
18269 reference "sec:Formats"
18275 \begin_inset Quotes eld
18279 \begin_inset Flex CharStyle:Code
18282 \begin_layout Plain Layout
18289 \begin_inset Quotes erd
18292 if the template can handle original files of more than one format.
18293 LyX will attempt to interrogate the file itself in order to deduce its
18294 format in this case.
18295 This command must occur exactly once.
18298 \begin_layout Description
18299 \begin_inset Flex CharStyle:Code
18302 \begin_layout Plain Layout
18304 \begin_inset space ~
18312 A unique name for the template.
18313 It must not contain substitution macros (see below).
18316 \begin_layout Description
18317 \begin_inset Flex CharStyle:Code
18320 \begin_layout Plain Layout
18322 \begin_inset space ~
18325 Rotate|Resize|Clip|Extra
18330 This command specifies which transformations are supported by this template.
18331 It may occur zero or more times.
18332 This command enables the corresponding tabs in the external dialog.
18334 \begin_inset Flex CharStyle:Code
18337 \begin_layout Plain Layout
18343 command must have either a corresponding
18344 \begin_inset Flex CharStyle:Code
18347 \begin_layout Plain Layout
18354 \begin_inset Flex CharStyle:Code
18357 \begin_layout Plain Layout
18364 \begin_inset Flex CharStyle:Code
18367 \begin_layout Plain Layout
18374 Otherwise the transformation will not be supported by that format.
18377 \begin_layout Subsection
18381 \begin_layout Description
18382 \begin_inset Flex CharStyle:Code
18385 \begin_layout Plain Layout
18387 \begin_inset space ~
18390 LaTeX|PDFLaTeX|PlainText|DocBook
18395 The primary document file format that this format definition is for.
18396 Not every template has a sensible representation in all document file formats.
18397 Please define nevertheless a
18398 \begin_inset Flex CharStyle:Code
18401 \begin_layout Plain Layout
18407 section for all formats.
18408 Use a dummy text when no representation is available.
18409 Then you can at least see a reference to the external material in the exported
18413 \begin_layout Description
18414 \begin_inset Flex CharStyle:Code
18417 \begin_layout Plain Layout
18419 \begin_inset space ~
18423 \begin_inset space ~
18431 This command defines an additional macro
18432 \begin_inset Flex CharStyle:Code
18435 \begin_layout Plain Layout
18441 for substitution in
18442 \begin_inset Flex CharStyle:Code
18445 \begin_layout Plain Layout
18453 \begin_inset Flex CharStyle:Code
18456 \begin_layout Plain Layout
18462 itself may contain substitution macros.
18463 The advantage over using
18464 \begin_inset Flex CharStyle:Code
18467 \begin_layout Plain Layout
18474 \begin_inset Flex CharStyle:Code
18477 \begin_layout Plain Layout
18483 is that the substituted value of
18484 \begin_inset Flex CharStyle:Code
18487 \begin_layout Plain Layout
18493 is sanitized so that it is a valid optional argument in the document format.
18494 This command may occur zero or more times.
18497 \begin_layout Description
18498 \begin_inset Flex CharStyle:Code
18501 \begin_layout Plain Layout
18503 \begin_inset space ~
18511 The text that is inserted in the exported document.
18512 This is actually the most important command and can be quite complex.
18513 This command must occur exactly once.
18516 \begin_layout Description
18517 \begin_inset Flex CharStyle:Code
18520 \begin_layout Plain Layout
18522 \begin_inset space ~
18530 This command specifies a preamble snippet that will be included in the
18532 It has to be defined using
18533 \begin_inset Flex CharStyle:Code
18536 \begin_layout Plain Layout
18542 \SpecialChar \ldots{}
18544 \begin_inset Flex CharStyle:Code
18547 \begin_layout Plain Layout
18554 This command may occur zero or more times.
18557 \begin_layout Description
18558 \begin_inset Flex CharStyle:Code
18561 \begin_layout Plain Layout
18563 \begin_inset space ~
18567 \begin_inset space ~
18575 This command denotes files that are created by the conversion process and
18576 are needed for a particular export format.
18577 If the filename is relative, it is interpreted relative to the master document.
18578 This command may be given zero or more times.
18581 \begin_layout Description
18582 \begin_inset Flex CharStyle:Code
18585 \begin_layout Plain Layout
18587 \begin_inset space ~
18595 The name of a required LaTeX package.
18596 The package is included via
18597 \begin_inset Flex CharStyle:Code
18600 \begin_layout Plain Layout
18608 in the LaTeX preamble.
18609 This command may occur zero or more times.
18612 \begin_layout Description
18613 \begin_inset Flex CharStyle:Code
18616 \begin_layout Plain Layout
18618 \begin_inset space ~
18622 \begin_inset space ~
18625 RotationLatexCommand
18630 This command specifies that the built in LaTeX command should be used for
18632 This command may occur once or not at all.
18635 \begin_layout Description
18636 \begin_inset Flex CharStyle:Code
18639 \begin_layout Plain Layout
18641 \begin_inset space ~
18645 \begin_inset space ~
18653 This command specifies that the built in LaTeX command should be used for
18655 This command may occur once or not at all.
18658 \begin_layout Description
18659 \begin_inset Flex CharStyle:Code
18662 \begin_layout Plain Layout
18664 \begin_inset space ~
18668 \begin_inset space ~
18671 RotationLatexOption
18676 This command specifies that rotation is done via an optional argument.
18677 This command may occur once or not at all.
18680 \begin_layout Description
18681 \begin_inset Flex CharStyle:Code
18684 \begin_layout Plain Layout
18686 \begin_inset space ~
18690 \begin_inset space ~
18698 This command specifies that resizing is done via an optional argument.
18699 This command may occur once or not at all.
18702 \begin_layout Description
18703 \begin_inset Flex CharStyle:Code
18706 \begin_layout Plain Layout
18708 \begin_inset space ~
18712 \begin_inset space ~
18720 This command specifies that clipping is done via an optional argument.
18721 This command may occur once or not at all.
18724 \begin_layout Description
18725 \begin_inset Flex CharStyle:Code
18728 \begin_layout Plain Layout
18730 \begin_inset space ~
18734 \begin_inset space ~
18742 This command specifies that an extra optional argument is used.
18743 This command may occur once or not at all.
18746 \begin_layout Description
18747 \begin_inset Flex CharStyle:Code
18750 \begin_layout Plain Layout
18752 \begin_inset space ~
18760 The file format of the converted file.
18761 This must be the name of a format that is known to LyX (see the
18762 \begin_inset Flex CharStyle:MenuItem
18765 \begin_layout Plain Layout
18770 ools\SpecialChar \menuseparator
18775 references:Conversion
18781 This command must occur exactly once.
18784 \begin_layout Description
18785 \begin_inset Flex CharStyle:Code
18788 \begin_layout Plain Layout
18790 \begin_inset space ~
18798 The file name of the converted file.
18799 The file name must be absolute.
18800 This command must occur exactly once.
18803 \begin_layout Subsection
18804 Preamble definitions
18807 \begin_layout Standard
18808 The external template configuration file may contain additional preamble
18809 definitions enclosed by
18810 \begin_inset Flex CharStyle:Code
18813 \begin_layout Plain Layout
18819 \SpecialChar \ldots{}
18821 \begin_inset Flex CharStyle:Code
18824 \begin_layout Plain Layout
18831 They can be used by the templates in the
18832 \begin_inset Flex CharStyle:Code
18835 \begin_layout Plain Layout
18844 \begin_layout Section
18845 The substitution mechanism
18848 \begin_layout Standard
18849 When the external material facility invokes an external program, it is done
18850 on the basis of a command defined in the template configuration file.
18851 These commands can contain various macros that are expanded before execution.
18852 Execution always take place in the directory of the containing document.
18855 \begin_layout Standard
18856 Also, whenever external material is to be displayed, the name will be produced
18857 by the substitution mechanism, and most other commands in the template
18858 definition support substitution as well.
18861 \begin_layout Standard
18862 The available macros are the following:
18865 \begin_layout Description
18866 \begin_inset Flex CharStyle:Code
18869 \begin_layout Plain Layout
18870 $$AbsOrRelPathMaster
18875 The file path, absolute or relative to the master LyX document.
18878 \begin_layout Description
18879 \begin_inset Flex CharStyle:Code
18882 \begin_layout Plain Layout
18883 $$AbsOrRelPathParent
18888 The file path, absolute or relative to the LyX document.
18891 \begin_layout Description
18892 \begin_inset Flex CharStyle:Code
18895 \begin_layout Plain Layout
18901 The absolute file path.
18904 \begin_layout Description
18905 \begin_inset Flex CharStyle:Code
18908 \begin_layout Plain Layout
18914 The filename without path and without the extension.
18917 \begin_layout Description
18918 \begin_inset Flex CharStyle:Code
18921 \begin_layout Plain Layout
18923 \begin_inset Quotes eld
18927 \begin_inset Quotes erd
18935 This macro will expand to the contents of the file with the name
18936 \begin_inset Flex CharStyle:Code
18939 \begin_layout Plain Layout
18948 \begin_layout Description
18949 \begin_inset Flex CharStyle:Code
18952 \begin_layout Plain Layout
18958 The file extension (including the dot).
18961 \begin_layout Description
18962 \begin_inset Flex CharStyle:Code
18965 \begin_layout Plain Layout
18971 The filename of the file specified in the external material dialog.
18972 This is either an absolute name, or it is relative to the LyX document.
18975 \begin_layout Description
18976 \begin_inset Flex CharStyle:Code
18979 \begin_layout Plain Layout
18986 \begin_inset Flex CharStyle:Code
18989 \begin_layout Plain Layout
18995 (absolute name or relative to the LyX document).
18998 \begin_layout Description
18999 \begin_inset Flex CharStyle:Code
19002 \begin_layout Plain Layout
19008 The file path, relative to the master LyX document.
19011 \begin_layout Description
19012 \begin_inset Flex CharStyle:Code
19015 \begin_layout Plain Layout
19021 The file path, relative to the LyX document.
19024 \begin_layout Description
19025 \begin_inset Flex CharStyle:Code
19028 \begin_layout Plain Layout
19034 This macro will expand to the absolute path of the system directory.
19035 This is typically used to point to the various helper scripts that are
19039 \begin_layout Description
19040 \begin_inset Flex CharStyle:Code
19043 \begin_layout Plain Layout
19049 A name and full path to a temporary file which will be automatically deleted
19050 whenever the containing document is closed, or the external material insertion
19054 \begin_layout Standard
19055 All path macros contain a trailing directory separator, so you can construct
19057 \begin_inset space \thinspace{}
19061 \begin_inset space \space{}
19064 the absolute filename with
19065 \begin_inset Flex CharStyle:Code
19068 \begin_layout Plain Layout
19069 $$AbsPath$$Basename$$Extension
19077 \begin_layout Standard
19078 The macros above are substituted in all commands unless otherwise noted.
19080 \begin_inset Flex CharStyle:Code
19083 \begin_layout Plain Layout
19089 supports additionally the following substitutions if they are enabled by
19091 \begin_inset Flex CharStyle:Code
19094 \begin_layout Plain Layout
19101 \begin_inset Flex CharStyle:Code
19104 \begin_layout Plain Layout
19113 \begin_layout Description
19114 \begin_inset Flex CharStyle:Code
19117 \begin_layout Plain Layout
19123 The front part of the resize command.
19126 \begin_layout Description
19127 \begin_inset Flex CharStyle:Code
19130 \begin_layout Plain Layout
19136 The back part of the resize command.
19139 \begin_layout Description
19140 \begin_inset Flex CharStyle:Code
19143 \begin_layout Plain Layout
19149 The front part of the rotation command.
19152 \begin_layout Description
19153 \begin_inset Flex CharStyle:Code
19156 \begin_layout Plain Layout
19162 The back part of the rotation command.
19165 \begin_layout Standard
19166 The value string of the
19167 \begin_inset Flex CharStyle:Code
19170 \begin_layout Plain Layout
19176 command supports additionally the following substitutions if they are enabled
19178 \begin_inset Flex CharStyle:Code
19181 \begin_layout Plain Layout
19188 \begin_inset Flex CharStyle:Code
19191 \begin_layout Plain Layout
19200 \begin_layout Description
19201 \begin_inset Flex CharStyle:Code
19204 \begin_layout Plain Layout
19213 \begin_layout Description
19214 \begin_inset Flex CharStyle:Code
19217 \begin_layout Plain Layout
19226 \begin_layout Description
19227 \begin_inset Flex CharStyle:Code
19230 \begin_layout Plain Layout
19239 \begin_layout Description
19240 \begin_inset Flex CharStyle:Code
19243 \begin_layout Plain Layout
19249 The rotation option.
19252 \begin_layout Standard
19253 You may ask why there are so many path macros.
19254 There are mainly two reasons:
19257 \begin_layout Enumerate
19258 Relative and absolute file names should remain relative or absolute, respectivel
19260 Users may have reasons to prefer either form.
19261 Relative names are useful for portable documents that should work on different
19262 machines, for example.
19263 Absolute names may be required by some programs.
19266 \begin_layout Enumerate
19267 LaTeX treats relative file names differently than LyX and other programs
19268 in nested included files.
19269 For LyX, a relative file name is always relative to the document that contains
19271 For LaTeX, it is always relative to the master document.
19272 These two definitions are identical if you have only one document, but
19273 differ if you have a master document that includes part documents.
19274 That means that relative filenames must be transformed when presented to
19276 Fortunately LyX does this automatically for you if you choose the right
19280 \begin_layout Standard
19281 So which path macro should be used in new template definitions? The rule
19285 \begin_layout Itemize
19287 \begin_inset Flex CharStyle:Code
19290 \begin_layout Plain Layout
19296 if an absolute path is required.
19299 \begin_layout Itemize
19301 \begin_inset Flex CharStyle:Code
19304 \begin_layout Plain Layout
19305 $$AbsOrRelPathMaster
19310 if the substituted string is some kind of LaTeX input.
19313 \begin_layout Itemize
19315 \begin_inset Flex CharStyle:Code
19318 \begin_layout Plain Layout
19319 $$AbsOrRelPathParent
19324 in order to preserve the user's choice.
19327 \begin_layout Standard
19328 There are special cases where this rule does not work and e.
19329 \begin_inset space \thinspace{}
19333 \begin_inset space \space{}
19336 relative names are needed, but normally it will work just fine.
19337 One example for such a case is the command
19338 \begin_inset Flex CharStyle:Code
19341 \begin_layout Plain Layout
19342 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
19347 in the XFig template above: We can't use the absolute name because the
19349 \begin_inset Flex CharStyle:Code
19352 \begin_layout Plain Layout
19358 files needs the relative name in order to rewrite the file content.
19361 \begin_layout Section
19362 Security discussion
19363 \begin_inset CommandInset label
19365 name "sec:Security-discussion"
19372 \begin_layout Standard
19373 The external material feature interfaces with a lot of external programs
19374 and does so automatically, so we have to consider the security implications
19376 In particular, since you have the option of including your own filenames
19377 and/or parameter strings and those are expanded into a command, it seems
19378 that it would be possible to create a malicious document which executes
19379 arbitrary commands when a user views or prints the document.
19380 This is something we definitely want to avoid.
19383 \begin_layout Standard
19384 However, since the external program commands are specified in the template
19385 configuration file only, there are no security issues if LyX is properly
19386 configured with safe templates only.
19387 This is so because the external programs are invoked with the
19388 \begin_inset Flex CharStyle:Code
19391 \begin_layout Plain Layout
19397 -system call rather than the
19398 \begin_inset Flex CharStyle:Code
19401 \begin_layout Plain Layout
19407 system-call, so it's not possible to execute arbitrary commands from the
19408 filename or parameter section via the shell.
19411 \begin_layout Standard
19412 This also implies that you are restricted in what command strings you can
19413 use in the external material templates.
19414 In particular, pipes and redirection are not readily available.
19415 This has to be so if LyX should remain safe.
19416 If you want to use some of the shell features, you should write a safe
19417 script to do this in a controlled manner, and then invoke the script from
19418 the command string.
19422 \begin_layout Standard
19423 It is possible to design a template that interacts directly with the shell,
19424 but since this would allow a malicious user to execute arbitrary commands
19425 by writing clever filenames and/or parameters, we generally recommend that
19426 you only use safe scripts that work with the
19427 \begin_inset Flex CharStyle:Code
19430 \begin_layout Plain Layout
19436 system call in a controlled manner.
19437 Of course, for use in a controlled environment, it can be tempting to just
19438 fall back to use ordinary shell scripts.
19439 If you do so, be aware that you
19443 provide an easily exploitable security hole in your system.
19444 Of course it stands to reason that such unsafe templates will never be
19445 included in the standard LyX distribution, although we do encourage people
19446 to submit new templates in the open source tradition.
19447 But LyX as shipped from the official distribution channels will never have
19451 \begin_layout Standard
19452 Including external material provides a lot of power, and you have to be
19453 careful not to introduce security hazards with this power.
19454 A subtle error in a single line in an innocent looking script can open
19455 the door to huge security problems.
19456 So if you do not fully understand the issues, we recommend that you consult
19457 a knowledgeable security professional or the LyX development team if you
19458 have any questions about whether a given template is safe or not.
19459 And do this before you use it in an uncontrolled environment.