1 #LyX 2.0 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
42 \options fleqn,bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading
43 \use_default_options false
47 \maintain_unincluded_children false
50 InsetLayout Flex:MenuItem
59 \newcommand*{\menuitem}[1]{{\sffamily #1}}
62 # In case we need to do with sans...
63 #InsetLayout CharStyle:Code
68 #\renewcommand{\code}[1]{{\sffamily #1}}
73 \language_package default
78 \font_typewriter default
79 \font_default_family default
80 \use_non_tex_fonts false
87 \default_output_format default
89 \bibtex_command default
90 \index_command default
94 \pdf_title "LyX Configuration Manual"
95 \pdf_author "LyX Team"
96 \pdf_subject "LyX-documentation Customization"
97 \pdf_keywords "LyX, documentation, customization"
99 \pdf_bookmarksnumbered true
100 \pdf_bookmarksopen true
101 \pdf_bookmarksopenlevel 1
102 \pdf_breaklinks false
106 \pdf_pdfusetitle false
107 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
117 \paperorientation portrait
131 \paragraph_separation indent
132 \paragraph_indentation default
133 \quotes_language english
136 \paperpagestyle headings
137 \tracking_changes false
138 \output_changes false
147 Customizing LyX: Features for the Advanced User
155 \begin_layout Plain Layout
157 If you have comments or error corrections, please send them to the LyX Documenta
159 \begin_inset CommandInset href
161 target "lyx-docs@lists.lyx.org"
168 \begin_inset Quotes eld
172 \begin_inset Quotes erd
175 in the subject header, and please cc the current maintainer of this file,
176 Richard Heck <rgheck@comcast.net>.
182 \begin_inset Newline newline
186 \begin_inset Newline newline
192 \begin_layout Standard
193 \begin_inset CommandInset toc
194 LatexCommand tableofcontents
201 \begin_layout Standard
202 \begin_inset Note Note
205 \begin_layout Plain Layout
206 Please use change tracking when modifying this document.
207 This makes it easier for our translators to recognize things that have
208 been changed, and it helps the maintainer keep up-to-date with what's been
217 \begin_layout Chapter
221 \begin_layout Standard
222 This manual covers the customization features present in LyX.
223 In it, we discuss issues like keyboard shortcuts, screen previewing options,
224 printer options, sending commands to LyX via the LyX Server, internationalizati
225 on, installing new LaTeX classes and LyX layouts, etc.
226 We can't possibly hope to touch on everything you can change—our developers
227 add new features faster than we can document them—but we will explain the
228 most common customizations and hopefully point you in the right direction
229 for some of the more obscure ones.
232 \begin_layout Standard
233 \begin_inset Branch OutDated
236 \begin_layout Standard
237 Information from previous versions of this document that now seems to be
238 outdated is contained in the OutDated branch of this document.
239 By default, this information will not appear in the LaTeX output.
247 \begin_layout Chapter
248 LyX configuration files
251 \begin_layout Standard
252 This chapter aims to help you to find your way through the LyX configuration
254 Before continuing to read this chapter, you should find out where your
255 LyX library and user directories are by using
256 \begin_inset Flex MenuItem
259 \begin_layout Plain Layout
260 Help\SpecialChar \menuseparator
271 The library directory is the place where LyX places its system-wide configurati
272 on files; the user directory is where you can place your modified versions.
273 We will call the former
274 \begin_inset Flex Code
277 \begin_layout Plain Layout
284 \begin_inset Flex MenuItem
287 \begin_layout Plain Layout
293 in the remainder of this document.
297 \begin_layout Section
299 \begin_inset Flex Code
302 \begin_layout Plain Layout
311 \begin_layout Standard
312 \begin_inset Flex Code
315 \begin_layout Plain Layout
321 and its sub-directories contain a number of files and that can be used
322 to customize LyX's behavior.
323 You can change many of these files from within LyX itself through the
324 \begin_inset Flex MenuItem
327 \begin_layout Plain Layout
328 Tools\SpecialChar \menuseparator
335 Most customization that you will want to do in LyX is possible through
337 However, many other inner aspects of LyX can be customized by modifying
339 \begin_inset Flex Code
342 \begin_layout Plain Layout
349 These files fall in different categories, described in the following subsection
353 \begin_layout Subsection
354 Automatically generated files
357 \begin_layout Standard
358 The files, which are to be found in
359 \begin_inset Flex MenuItem
362 \begin_layout Plain Layout
368 , are generated when you configure LyX.
369 They contain various default values that are guessed by inspection.
370 In general, it is not a good idea to modify them, since they might be overwritt
374 \begin_layout Labeling
375 \labelwidthstring 00.00.0000
376 \begin_inset Flex Code
379 \begin_layout Plain Layout
385 contains defaults for various commands.
388 \begin_layout Labeling
389 \labelwidthstring 00.00.0000
390 \begin_inset Flex Code
393 \begin_layout Plain Layout
399 contains the list of packages that have been recognized by LyX.
400 It is currently unused by the LyX program itself, but the information extracted
401 , and more, is made available with
402 \begin_inset Flex MenuItem
405 \begin_layout Plain Layout
406 Help\SpecialChar \menuseparator
419 \begin_layout Labeling
420 \labelwidthstring 00.00.0000
421 \begin_inset Flex Code
424 \begin_layout Plain Layout
430 the list of text classes that have been found in your
431 \begin_inset Flex Code
434 \begin_layout Plain Layout
440 directories, along with the associated LaTeX document class and their descripti
444 \begin_layout Labeling
445 \labelwidthstring 00.00.0000
446 \begin_inset Flex Code
449 \begin_layout Plain Layout
455 the list of layout modules found in your
456 \begin_inset Flex Code
459 \begin_layout Plain Layout
468 \begin_layout Labeling
469 \labelwidthstring 00.00.0000
470 \begin_inset Flex Code
473 \begin_layout Plain Layout
479 lists of various sorts of LaTeX-related files found on your system
482 \begin_layout Labeling
483 \labelwidthstring 00.00.0000
484 \begin_inset Flex Code
487 \begin_layout Plain Layout
493 is automatically generated during configuration from the file
494 \begin_inset Flex Code
497 \begin_layout Plain Layout
504 It contains information on your LaTeX configuration.
507 \begin_layout Subsection
511 \begin_layout Standard
512 These directories are duplicated between
513 \begin_inset Flex Code
516 \begin_layout Plain Layout
523 \begin_inset Flex Code
526 \begin_layout Plain Layout
533 If a particular files exists in both places, the one in
534 \begin_inset Flex Code
537 \begin_layout Plain Layout
546 \begin_layout Labeling
547 \labelwidthstring 00.00.0000
548 \begin_inset Flex Code
551 \begin_layout Plain Layout
557 this directory contains files with the extension
558 \begin_inset Flex Code
561 \begin_layout Plain Layout
567 that define the keybindings used in LyX.
568 If there exists an internationalized version of the bind file named
569 \begin_inset Flex Code
572 \begin_layout Plain Layout
578 , that will be used first.
581 \begin_layout Labeling
582 \labelwidthstring 00.00.0000
583 \begin_inset Flex Code
586 \begin_layout Plain Layout
592 contains graphics files that can be included in documents.
596 \begin_layout Labeling
597 \labelwidthstring 00.00.0000
598 \begin_inset Flex Code
601 \begin_layout Plain Layout
607 contains LyX documentation files (including the one you are currently reading).
609 \begin_inset Flex Code
612 \begin_layout Plain Layout
618 deserves special attention, as noted above.
619 The internationalized help docs are in subdirectories
620 \begin_inset Flex Code
623 \begin_layout Plain Layout
630 \begin_inset Quotes eld
634 \begin_inset Quotes erd
637 is the ISO language code.
643 \begin_inset CommandInset ref
645 reference "cha:Internationalizing-LyX"
652 \begin_layout Labeling
653 \labelwidthstring 00.00.0000
654 \begin_inset Flex Code
657 \begin_layout Plain Layout
663 contains example files that explain how to use some features.
664 In the file browser, press the
665 \begin_inset Flex MenuItem
668 \begin_layout Plain Layout
677 \begin_layout Labeling
678 \labelwidthstring 00.00.0000
679 \begin_inset Flex Code
682 \begin_layout Plain Layout
688 contains image files that are used by the
689 \begin_inset Flex MenuItem
692 \begin_layout Plain Layout
699 In addition, it also contains the individual icons used in the toolbar
700 and the banners that can be shown when LyX is launched.
703 \begin_layout Labeling
704 \labelwidthstring 00.00.0000
705 \begin_inset Flex Code
708 \begin_layout Plain Layout
714 contains keyboard keymapping files.
720 \begin_inset CommandInset ref
722 reference "sec:International-Keymap-Stuff"
729 \begin_layout Labeling
730 \labelwidthstring 00.00.0000
731 \begin_inset Flex Code
734 \begin_layout Plain Layout
740 contains the text class and module files described in Chapter
745 \begin_inset CommandInset ref
747 reference "cha:Installing-New-Document"
754 \begin_layout Labeling
755 \labelwidthstring 00.00.0000
756 \begin_inset Flex Code
759 \begin_layout Plain Layout
766 \begin_inset Flex Code
769 \begin_layout Plain Layout
775 Python scripts used to convert between LyX versions.
776 These can be run from the command line if, say, you want to batch-convert
780 \begin_layout Labeling
781 \labelwidthstring 00.00.0000
782 \begin_inset Flex Code
785 \begin_layout Plain Layout
791 contains some files that demonstrate the capabilities of the
792 \begin_inset Flex MenuItem
795 \begin_layout Plain Layout
806 Also contains some scripts used by LyX itself.
809 \begin_layout Labeling
810 \labelwidthstring 00.00.0000
811 \begin_inset Flex Code
814 \begin_layout Plain Layout
820 contains the standard LyX template files described in Chapter
825 \begin_inset CommandInset ref
827 reference "sub:Creating-Templates"
834 \begin_layout Labeling
835 \labelwidthstring 00.00.0000
836 \begin_inset Flex Code
839 \begin_layout Plain Layout
845 contains files with the extension
846 \begin_inset Flex Code
849 \begin_layout Plain Layout
855 that define the user interface to LyX.
856 That is, the files define which items appear in which menus and the items
857 appearing on the toolbar.
860 \begin_layout Subsection
861 Files you don't want to modify
864 \begin_layout Standard
865 These files are used internally by LyX and you generally do not need to
866 modify them unless you are a developer.
869 \begin_layout Labeling
870 \labelwidthstring 00.00.0000
871 \begin_inset Flex Code
874 \begin_layout Plain Layout
880 this file contains the list of LyX developers.
881 The contents are displayed with the menu entry
882 \begin_inset Flex MenuItem
885 \begin_layout Plain Layout
886 Help\SpecialChar \menuseparator
899 \begin_layout Labeling
900 \labelwidthstring 00.00.0000
901 \begin_inset Flex Code
904 \begin_layout Plain Layout
910 this is a LaTeX script used during the configuration process.
914 \begin_layout Labeling
915 \labelwidthstring 00.00.0000
916 \begin_inset Flex Code
919 \begin_layout Plain Layout
925 this is the script that is used to re-configure LyX.
926 It creates configuration files in the directory it was run from.
929 \begin_layout Subsection
930 Other files needing a line or two...
933 \begin_layout Labeling
934 \labelwidthstring 00.00.0000
935 \begin_inset Flex Code
938 \begin_layout Plain Layout
944 this contains tables describing how different character encodings can be
948 \begin_layout Labeling
949 \labelwidthstring 00.00.0000
950 \begin_inset Flex Code
953 \begin_layout Plain Layout
959 this file contains the templates available to the new
960 \begin_inset Flex MenuItem
963 \begin_layout Plain Layout
976 \begin_layout Labeling
977 \labelwidthstring 00.00.0000
978 \begin_inset Flex Code
981 \begin_layout Plain Layout
987 this file contains a list of all the languages currently supported by LyX.
990 \begin_layout Section
991 Your local configuration directory
994 \begin_layout Standard
995 Even if you are using LyX as an unprivileged user, you might want to change
996 LyX configuration for your own use.
998 \begin_inset Flex Code
1001 \begin_layout Plain Layout
1007 directory contains all your personal configuration files.
1008 This is the directory described as
1009 \begin_inset Quotes eld
1013 \begin_inset Quotes erd
1017 \begin_inset Flex MenuItem
1020 \begin_layout Plain Layout
1021 Help\SpecialChar \menuseparator
1023 \begin_inset space ~
1032 This directory is used as a mirror of
1033 \begin_inset Flex Code
1036 \begin_layout Plain Layout
1042 , which means that every file in
1043 \begin_inset Flex Code
1046 \begin_layout Plain Layout
1052 is a replacement for the corresponding file in
1053 \begin_inset Flex Code
1056 \begin_layout Plain Layout
1063 Any configuration file described in the above sections can be placed either
1064 in the system-wide directory, in which case it will affect all users, or
1065 in your local directory for your own use.
1068 \begin_layout Standard
1069 To make things clearer, let's provide a few examples:
1072 \begin_layout Itemize
1073 The preferences set in the
1074 \begin_inset Flex MenuItem
1077 \begin_layout Plain Layout
1078 Tools\SpecialChar \menuseparator
1084 dialog are saved to a file
1085 \begin_inset Flex Code
1088 \begin_layout Plain Layout
1095 \begin_inset Flex Code
1098 \begin_layout Plain Layout
1107 \begin_layout Itemize
1108 When you reconfigure using
1109 \begin_inset Flex MenuItem
1112 \begin_layout Plain Layout
1113 Tools\SpecialChar \menuseparator
1120 \begin_inset Flex Code
1123 \begin_layout Plain Layout
1129 script, and the resulting files are written in your local configuration
1131 This means that any additional text class file that you might have added
1133 \begin_inset Flex Code
1136 \begin_layout Plain Layout
1142 will be added to the list of classes in the
1143 \begin_inset Flex MenuItem
1146 \begin_layout Plain Layout
1147 Document\SpecialChar \menuseparator
1156 \begin_layout Itemize
1157 If you get some updated documentation from LyX ftp site and cannot install
1158 it because you do not have sysadmin rights on your system, you can just
1160 \begin_inset Flex Code
1163 \begin_layout Plain Layout
1169 and the items in the
1170 \begin_inset Flex MenuItem
1173 \begin_layout Plain Layout
1179 menu will open them!
1182 \begin_layout Section
1183 Running LyX with multiple configurations
1186 \begin_layout Standard
1187 The configuration freedom of the local configuration directory may not suffice
1188 if you want to have more than one configuration at your disposal.
1189 For example, you may want to be use different key bindings or printer settings
1191 You can achieve this by having several such directories.
1192 You then specify which directory to use at run-time.
1195 \begin_layout Standard
1196 Invoking LyX with the command line switch
1197 \begin_inset Flex Code
1200 \begin_layout Plain Layout
1210 instructs the program to read the configuration from that directory, and
1211 not from the default directory.
1212 (You can determine the default directory by running LyX without the
1213 \begin_inset Flex Code
1216 \begin_layout Plain Layout
1222 switch.) If the specified directory does not exist, LyX offers to create
1223 it for you, just like it does for the default directory on the first time
1224 you run the program.
1225 You can modify the configuration options in this additional user directory
1226 exactly as you would for the default directory.
1227 These directories are completely independent (but read on).
1228 Note that setting the environment variable
1229 \begin_inset Flex Code
1232 \begin_layout Plain Layout
1238 to some value has exactly the same effect.
1241 \begin_layout Standard
1242 Having several configurations also requires more maintenance: if you want
1243 to add a new layout to
1244 \begin_inset Flex Code
1247 \begin_layout Plain Layout
1253 which you want available from all your configurations, you must add it
1254 to each directory separately.
1255 You can avoid this with the following trick: after LyX creates the additional
1256 directory, most of the subdirectories (see above) are empty.
1257 If you want the new configuration to mirror an existing one, replace the
1258 empty subdirectory with a symbolic link to the matching subdirectory in
1259 the existing configuration.
1261 \begin_inset Flex Code
1264 \begin_layout Plain Layout
1270 subdirectory, however, since it contains a file written by the configuration
1271 script (also accessible through
1272 \begin_inset Flex MenuItem
1275 \begin_layout Plain Layout
1276 Tools\SpecialChar \menuseparator
1282 ) which is configuration-specific.
1285 \begin_layout Chapter
1286 The Preferences dialog
1289 \begin_layout Standard
1290 All options of the preferences dialog are described in the Appendix
1292 The Preferences Dialog
1299 For some options you might find here more details.
1302 \begin_layout Section
1304 \begin_inset CommandInset label
1313 \begin_layout Standard
1314 The first step is to define your file formats if they are not already defined.
1316 \begin_inset Flex MenuItem
1319 \begin_layout Plain Layout
1320 Tools\SpecialChar \menuseparator
1328 \begin_inset Flex MenuItem
1331 \begin_layout Plain Layout
1332 File Handling\SpecialChar \menuseparator
1339 \begin_inset Flex MenuItem
1342 \begin_layout Plain Layout
1343 New\SpecialChar \ldots{}
1349 button to define your new format.
1351 \begin_inset Flex MenuItem
1354 \begin_layout Plain Layout
1360 field contains the name used to identify the format in the GUI.
1362 \begin_inset Flex MenuItem
1365 \begin_layout Plain Layout
1371 is used to identify the format internally.
1372 You will also need to enter a file extension.
1373 These are all required.
1375 \begin_inset Flex MenuItem
1378 \begin_layout Plain Layout
1384 field is used to provide a keyboard shortcut on the menus.
1385 (For example, pressing
1386 \begin_inset Flex MenuItem
1389 \begin_layout Plain Layout
1396 \begin_inset Flex MenuItem
1399 \begin_layout Plain Layout
1400 View\SpecialChar \menuseparator
1401 View (Other Formats)\SpecialChar \menuseparator
1410 \begin_layout Standard
1412 \begin_inset Flex MenuItem
1415 \begin_layout Plain Layout
1422 \begin_inset Flex MenuItem
1425 \begin_layout Plain Layout
1432 For example, you might want to use
1433 \begin_inset Flex MenuItem
1436 \begin_layout Plain Layout
1442 to view PostScript files.
1443 You can enter the command needed to start the program in the corresponding
1445 In defining this command, you can use the four variables listed in the
1447 The viewer is launched when you view an image in LyX or use the
1448 \begin_inset Flex MenuItem
1451 \begin_layout Plain Layout
1458 The editor is for example launched when you right-click on an image and
1460 \begin_inset Flex MenuItem
1463 \begin_layout Plain Layout
1469 in the appearing context menu.
1472 \begin_layout Standard
1474 \begin_inset Flex MenuItem
1477 \begin_layout Plain Layout
1483 option tells LyX that a format is suitable for document export.
1484 If this is set and if a suitable conversion route exists (see sec.
1485 \begin_inset space \thinspace{}
1489 \begin_inset CommandInset ref
1491 reference "sec:Converters"
1495 ), the format will appear in the
1496 \begin_inset Flex MenuItem
1499 \begin_layout Plain Layout
1500 File\SpecialChar \menuseparator
1507 The format will also appear in the
1508 \begin_inset Flex MenuItem
1511 \begin_layout Plain Layout
1517 menu if a viewer is specified for the format.
1518 Pure image formats, such as
1519 \begin_inset Flex Code
1522 \begin_layout Plain Layout
1528 , should not use this option.
1529 Formats that can both represent vector graphics and documents like
1530 \begin_inset Flex Code
1533 \begin_layout Plain Layout
1542 \begin_layout Standard
1544 \begin_inset Flex MenuItem
1547 \begin_layout Plain Layout
1548 Vector graphics format
1553 tells LyX that a format can contain vector graphics.
1554 This information is used to determine the target format of included graphics
1556 \begin_inset Flex MenuItem
1559 \begin_layout Plain Layout
1566 Included graphics may need to be converted to either
1567 \begin_inset Flex MenuItem
1570 \begin_layout Plain Layout
1577 \begin_inset Flex MenuItem
1580 \begin_layout Plain Layout
1587 \begin_inset Flex MenuItem
1590 \begin_layout Plain Layout
1597 \begin_inset Flex MenuItem
1600 \begin_layout Plain Layout
1606 cannot handle other image formats.
1607 If an included graphic is not already in
1608 \begin_inset Flex MenuItem
1611 \begin_layout Plain Layout
1618 \begin_inset Flex MenuItem
1621 \begin_layout Plain Layout
1628 \begin_inset Flex MenuItem
1631 \begin_layout Plain Layout
1637 format, it is converted to
1638 \begin_inset Flex MenuItem
1641 \begin_layout Plain Layout
1647 if the vector format option is set, and otherwise to
1648 \begin_inset Flex MenuItem
1651 \begin_layout Plain Layout
1660 \begin_layout Section
1664 \begin_layout Standard
1665 Since all conversions from one format to another take place in LyX's temporary
1666 directory, it is sometimes necessary to modify a file before copying it
1667 to the temporary directory in order that the conversion may be performed.
1671 \begin_layout Plain Layout
1672 For example, the file may refer to other files—images, for example—using
1673 relative file names, and these may become invalid when the file is copied
1674 to the temporary directory.
1679 This is done by a Copier: It copies a file to (or from) the temporary directory
1680 and may modify it in the process.
1683 \begin_layout Standard
1684 The definitions of the copiers may use four variables:
1687 \begin_layout Labeling
1688 \labelwidthstring 00.00.0000
1689 \begin_inset Flex Code
1692 \begin_layout Plain Layout
1698 The LyX system directory (e.
1699 \begin_inset space \thinspace{}
1703 \begin_inset space \space{}
1707 \begin_inset Flex MenuItem
1710 \begin_layout Plain Layout
1719 \begin_layout Labeling
1720 \labelwidthstring 00.00.0000
1721 \begin_inset Flex Code
1724 \begin_layout Plain Layout
1733 \begin_layout Labeling
1734 \labelwidthstring 00.00.0000
1735 \begin_inset Flex Code
1738 \begin_layout Plain Layout
1747 \begin_layout Labeling
1748 \labelwidthstring 00.00.0000
1749 \begin_inset Flex Code
1752 \begin_layout Plain Layout
1761 \begin_layout Standard
1762 The latter should be the filename as it would be used in a LaTeX's
1769 It is relevant only when exporting files suitable for such inclusion.
1772 \begin_layout Standard
1773 Copiers can be used to do almost anything with output files.
1774 For example, suppose you want generated pdf files to be copied to a special
1776 \begin_inset Flex Code
1779 \begin_layout Plain Layout
1786 Then you could write a shell script such as this one:
1789 \begin_layout Standard
1790 \begin_inset listings
1794 \begin_layout Plain Layout
1799 \begin_layout Plain Layout
1804 \begin_layout Plain Layout
1806 TOFILE=`basename $2`
1809 \begin_layout Plain Layout
1811 cp $FROMFILE /home/you/pdf/$TOFILE
1816 Save it in your local LyX directory—say,
1817 \begin_inset Flex Code
1820 \begin_layout Plain Layout
1821 /home/you/.lyx/scripts/pdfcopier.sh
1826 —and make it executable, if you need to do so on your platform.
1828 \begin_inset Flex MenuItem
1831 \begin_layout Plain Layout
1832 Tools\SpecialChar \menuseparator
1838 dialog, select under
1839 \begin_inset Flex MenuItem
1842 \begin_layout Plain Layout
1843 File Handling\SpecialChar \menuseparator
1850 \begin_inset Flex MenuItem
1853 \begin_layout Plain Layout
1859 format—or one of the other pdf formats—and enter
1860 \begin_inset Flex Code
1863 \begin_layout Plain Layout
1864 pdfcopier.sh $$i $$o
1870 \begin_inset Flex MenuItem
1873 \begin_layout Plain Layout
1883 \begin_layout Standard
1884 Copiers are used by LyX in various of its own conversions.
1885 For example, if appropriate programs are found, LyX will automatically
1886 install copiers for the
1887 \begin_inset Flex MenuItem
1890 \begin_layout Plain Layout
1897 \begin_inset Flex MenuItem
1900 \begin_layout Plain Layout
1902 \begin_inset space ~
1911 When these formats are exported, the copier sees that not just the main
1912 HTML file but various associated files (style files, images, etc.) are also
1914 All these files are written to a subdirectory of the directory in which
1915 the original LyX file was found.
1919 \begin_layout Plain Layout
1920 This copier can be customized.
1922 \begin_inset Quotes eld
1926 \begin_inset Quotes erd
1929 argument takes a comma-separated list of extensions to be copied; if it
1930 is omitted, all files will be copied.
1932 \begin_inset Quotes eld
1936 \begin_inset Quotes erd
1939 argument determines the extension added to the generated directory.
1941 \begin_inset Quotes eld
1945 \begin_inset Flex MenuItem
1948 \begin_layout Plain Layout
1955 \begin_inset Quotes erd
1958 , so HTML generated from
1959 \begin_inset Flex MenuItem
1962 \begin_layout Plain Layout
1963 /path/to/filename.lyx
1969 \begin_inset Flex MenuItem
1972 \begin_layout Plain Layout
1973 /path/to/filename.html.LyXconv
1987 \begin_layout Section
1989 \begin_inset CommandInset label
1991 name "sec:Converters"
1998 \begin_layout Standard
1999 You can define your own Converters to convert files between different formats.
2001 \begin_inset Flex MenuItem
2004 \begin_layout Plain Layout
2005 Tools\SpecialChar \menuseparator
2006 Preferences\SpecialChar \menuseparator
2007 File Handling\SpecialChar \menuseparator
2016 \begin_layout Standard
2017 To define a new converter, select the
2018 \begin_inset Flex MenuItem
2021 \begin_layout Plain Layout
2023 \begin_inset space ~
2032 \begin_inset Flex MenuItem
2035 \begin_layout Plain Layout
2037 \begin_inset space ~
2045 from the drop-down lists, enter the command needed for the conversion,
2047 \begin_inset Flex MenuItem
2050 \begin_layout Plain Layout
2057 Several variables can be used in the definition of converters:
2060 \begin_layout Labeling
2061 \labelwidthstring 00.00.0000
2062 \begin_inset Flex Code
2065 \begin_layout Plain Layout
2071 The LyX system directory
2074 \begin_layout Labeling
2075 \labelwidthstring 00.00.0000
2076 \begin_inset Flex Code
2079 \begin_layout Plain Layout
2088 \begin_layout Labeling
2089 \labelwidthstring 00.00.0000
2090 \begin_inset Flex Code
2093 \begin_layout Plain Layout
2102 \begin_layout Labeling
2103 \labelwidthstring 00.00.0000
2104 \begin_inset Flex Code
2107 \begin_layout Plain Layout
2113 The base filename of the input file (i.
2114 \begin_inset space \thinspace{}
2117 g., without the extension)
2120 \begin_layout Labeling
2121 \labelwidthstring 00.00.0000
2122 \begin_inset Flex Code
2125 \begin_layout Plain Layout
2131 The path to the input file
2134 \begin_layout Labeling
2135 \labelwidthstring 00.00.0000
2136 \begin_inset Flex Code
2139 \begin_layout Plain Layout
2145 The path to the original input file (this is different from $$p when a
2146 chain of converters is called)
2149 \begin_layout Labeling
2150 \labelwidthstring 00.00.0000
2151 \begin_inset Flex Code
2154 \begin_layout Plain Layout
2160 The iconv name for the encoding of the document.
2163 \begin_layout Standard
2165 \begin_inset Flex MenuItem
2168 \begin_layout Plain Layout
2170 \begin_inset space ~
2178 field you can enter the following flags, separated by commas:
2181 \begin_layout Labeling
2182 \labelwidthstring 00.00.0000
2183 \begin_inset Flex Code
2186 \begin_layout Plain Layout
2192 This converter runs some form of LaTeX.
2193 This will make LyX's LaTeX error logs available.
2196 \begin_layout Labeling
2197 \labelwidthstring 00.00.0000
2198 \begin_inset Flex Code
2201 \begin_layout Plain Layout
2208 \begin_inset Flex MenuItem
2211 \begin_layout Plain Layout
2217 file for the conversion.
2220 \begin_layout Labeling
2221 \labelwidthstring 00.00.0000
2222 \begin_inset Flex Code
2225 \begin_layout Plain Layout
2234 \begin_layout Standard
2235 The following three flags are not really flags at all because they take
2237 \begin_inset Flex MenuItem
2240 \begin_layout Plain Layout
2242 \begin_inset space ~
2246 \begin_inset space ~
2257 \begin_layout Labeling
2258 \labelwidthstring 00.00.0000
2259 \begin_inset Flex Code
2262 \begin_layout Plain Layout
2268 If set, the converter's standard error will be redirected to a file
2269 \begin_inset Flex Code
2272 \begin_layout Plain Layout
2278 , and the script given as argument will be run as:
2279 \begin_inset Flex Code
2282 \begin_layout Plain Layout
2283 script < infile.out > infile.log
2289 The argument may contain
2290 \begin_inset Flex Code
2293 \begin_layout Plain Layout
2302 \begin_layout Labeling
2303 \labelwidthstring 00.00.0000
2304 \begin_inset Flex Code
2307 \begin_layout Plain Layout
2313 The name of the directory in which the converter will dump the generated
2315 LyX will not create this directory, and it does not copy anything into
2316 it, though it will copy this directory to the destination.
2317 The argument may contain
2318 \begin_inset Flex Code
2321 \begin_layout Plain Layout
2327 , which will be replaced by the base name of the input and output files,
2328 respectively, when the directory is copied.
2329 \begin_inset Newline newline
2332 Note that resultdir and usetempdir make no sense together.
2333 The latter will be ignored if the former is given.
2336 \begin_layout Labeling
2337 \labelwidthstring 00.00.0000
2338 \begin_inset Flex Code
2341 \begin_layout Plain Layout
2347 Determines the output file name and may, contain
2348 \begin_inset Flex Code
2351 \begin_layout Plain Layout
2358 Sensible only with resultdir and optional even then; if not given, it defaults
2362 \begin_layout Standard
2363 None of these last three are presently used in any of the converters that
2364 are installed with LyX.
2368 \begin_layout Standard
2369 You do not have to define converters for all formats between which you want
2371 For example, you will note that there is no `LyX to PostScript' converter,
2372 but LyX will export PostScript.
2373 It does so by first creating a LaTeX file (no converter needs to be defined
2374 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2375 and finally converting the resulting DVI file to PostScript.
2376 LyX finds such `chains' of converters automatically, and it will always
2377 choose the shortest possible chain.
2378 You can, though, still define multiple conversion methods between file
2380 For example, the standard LyX configuration provides three ways to convert
2381 LaTeX to PDF: Directly, using
2382 \begin_inset Flex MenuItem
2385 \begin_layout Plain Layout
2391 ; via (DVI and) PostScript, using
2392 \begin_inset Flex MenuItem
2395 \begin_layout Plain Layout
2402 \begin_inset Flex MenuItem
2405 \begin_layout Plain Layout
2412 To define such alternate chains, you must define multiple target `file
2413 formats', as described in section
2414 \begin_inset CommandInset ref
2416 reference "sec:Formats"
2421 For example, in the standard configuration, the formats named
2422 \begin_inset Flex MenuItem
2425 \begin_layout Plain Layout
2432 \begin_inset Flex MenuItem
2435 \begin_layout Plain Layout
2442 \begin_inset Flex MenuItem
2445 \begin_layout Plain Layout
2451 are defined, all of which share the extension
2452 \begin_inset Flex MenuItem
2455 \begin_layout Plain Layout
2461 , and which correspond to the conversion methods just mentioned.
2464 \begin_layout Chapter
2465 Internationalizing LyX
2466 \begin_inset CommandInset label
2468 name "cha:Internationalizing-LyX"
2475 \begin_layout Standard
2476 LyX supports using a translated interface.
2477 Last time we checked, LyX provided text in thirty languages.
2478 The language of choice is called your
2483 (For further reading on locale settings, see also the documentation for
2484 locale that comes with your operating system.
2485 For Linux, the manual page for
2486 \begin_inset Flex Code
2489 \begin_layout Plain Layout
2495 could be a good place to start).
2498 \begin_layout Standard
2499 Notice that these translations will work, but do contain a few flaws.
2500 In particular, all dialogs have been designed with the English text in
2501 mind, which means that some of the translated text will be too large to
2502 fit within the space allocated.
2503 This is only a display problem and will not cause any harm.
2504 Also, you will find that some of the translations do not define shortcut
2505 keys for everything.
2506 Sometimes, there are simply not enough free letters to do it.
2507 Other times, the translator just hasn't got around to doing it yet.
2508 Our localization team, which you may wish to join,
2512 \begin_layout Plain Layout
2513 If you are a fluent speaker of a language other than English, joining these
2514 teams is a great way to give back to the LyX community!
2519 will of course try to fix these shortcomings in future versions of LyX.
2522 \begin_layout Section
2526 \begin_layout Subsection
2527 Translating the graphical user interface (text messages).
2530 \begin_layout Standard
2532 \begin_inset Flex Code
2535 \begin_layout Plain Layout
2541 library to handle the internationalization of the interface.
2542 To have LyX speak your favorite language in all menus and dialogs, you
2544 \begin_inset Flex Code
2547 \begin_layout Plain Layout
2553 -file for that language.
2554 When this is available, you'll have to generate a
2555 \begin_inset Flex Code
2558 \begin_layout Plain Layout
2564 -file from it and install the
2565 \begin_inset Flex Code
2568 \begin_layout Plain Layout
2575 The process of doing all of this is explained in the documentation for
2577 \begin_inset Flex Code
2580 \begin_layout Plain Layout
2587 It is possible to do this just for yourself, but if you're going to do
2588 it, you might as well share the results of your labors with the rest of
2590 Send a message to the LyX developers' list for more information about how
2594 \begin_layout Standard
2595 In short, this is what you should do (xx denotes the language code):
2598 \begin_layout Itemize
2599 Check out the LyX source code.
2601 \begin_inset CommandInset href
2603 name "information on the web"
2604 target "http://www.lyx.org/HowToUseSVN"
2611 \begin_layout Itemize
2613 \begin_inset Flex Code
2616 \begin_layout Plain Layout
2622 to the folder of the
2623 \begin_inset Flex Code
2626 \begin_layout Plain Layout
2634 \begin_inset Flex Code
2637 \begin_layout Plain Layout
2645 \begin_inset Flex Code
2648 \begin_layout Plain Layout
2654 doesn't exist anywhere, it can be remade with the console command
2655 \begin_inset Flex Code
2658 \begin_layout Plain Layout
2664 in that directory, or you can use an existing po-file for some other language
2668 \begin_layout Itemize
2670 \begin_inset Flex Code
2673 \begin_layout Plain Layout
2683 \begin_layout Plain Layout
2684 This is just a text file, so it can be edited in any text editor.
2685 But there are also specialized programs that support such editing, such
2690 (for all platforms) or
2699 contains a `mode' for editing
2700 \begin_inset Flex Code
2703 \begin_layout Plain Layout
2714 For some menu- and widget-labels, there are also shortcut keys that should
2716 Those keys are marked after a `|', and should be translated according to
2717 the words and phrases of the language.
2718 You should also fill also out the information at the beginning of the new
2720 \begin_inset Flex Code
2723 \begin_layout Plain Layout
2729 -file with your email-address, etc., so people know where to reach you with
2730 suggestions and entertaining flames.
2733 \begin_layout Standard
2734 If you are just doing this on your own, then:
2737 \begin_layout Itemize
2739 \begin_inset Flex Code
2742 \begin_layout Plain Layout
2749 This can be done with
2750 \begin_inset Flex Code
2753 \begin_layout Plain Layout
2754 msgfmt -o xx.mo < xx.po
2762 \begin_layout Itemize
2764 \begin_inset Flex Code
2767 \begin_layout Plain Layout
2773 -file to your locale-tree, at the correct directory for application messages
2778 xx, and under the name
2779 \begin_inset Flex Code
2782 \begin_layout Plain Layout
2789 \begin_inset space \thinspace{}
2793 \begin_inset space \space{}
2797 \begin_inset Flex Code
2800 \begin_layout Plain Layout
2801 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2811 \begin_layout Standard
2812 As said, however, it would be best if the new
2813 \begin_inset Flex Code
2816 \begin_layout Plain Layout
2822 -file could be added to the LyX distribution, so others can use it.
2823 Adding it involves making additional changes to LyX.
2824 So send an email to the developers' mailing list if you're interested in
2828 \begin_layout Subsubsection
2832 \begin_layout Standard
2833 Sometimes it turns out that one English message needs to be translated into
2834 different messages in the target language.
2835 One example is the message
2836 \begin_inset Flex Code
2839 \begin_layout Plain Layout
2845 which has the German translation
2853 , depending upon exactly what the English
2854 \begin_inset Quotes eld
2858 \begin_inset Quotes erd
2863 \begin_inset Flex Code
2866 \begin_layout Plain Layout
2872 does not handle such ambiguous translations.
2873 Therefore you have to add some context information to the message: Instead
2875 \begin_inset Flex Code
2878 \begin_layout Plain Layout
2885 \begin_inset Flex Code
2888 \begin_layout Plain Layout
2889 To[[as in 'From format x to format y']]
2895 \begin_inset Flex Code
2898 \begin_layout Plain Layout
2899 To[[as in 'From page x to page y']].
2904 Now the two occurrences of
2905 \begin_inset Flex Code
2908 \begin_layout Plain Layout
2915 \begin_inset Flex Code
2918 \begin_layout Plain Layout
2924 and can be translated correctly to
2935 \begin_layout Standard
2936 Of course the context information needs to be stripped off the original
2937 message when no translation is used.
2938 Therefore you have to put it in double square brackets at the end of the
2939 message (see the example above).
2940 The translation mechanism of LyX ensures that everything in double square
2941 brackets at the end of messages is removed before displaying the message.
2944 \begin_layout Subsection
2945 Translating the documentation.
2948 \begin_layout Standard
2949 The online documentation (in the
2950 \begin_inset Flex MenuItem
2953 \begin_layout Plain Layout
2959 -menu) can (and should!) be translated.
2960 If there are translated versions of the documentation available
2964 \begin_layout Plain Layout
2965 As of March 2008, at least some of the documents have been translated into
2966 fourteen languages, with the Tutorial available in a few more.
2971 and the locale is set accordingly, these will be used automagically by
2973 LyX looks for translated versions as
2974 \begin_inset Flex Code
2977 \begin_layout Plain Layout
2978 LyXDir/doc/xx/DocName.lyx
2984 \begin_inset Flex Code
2987 \begin_layout Plain Layout
2993 is the code for the language currently in use.
2994 If there are no translated documents, the default English versions will
2996 Note that the translated versions must have the same filenames (
2997 \begin_inset Flex Code
3000 \begin_layout Plain Layout
3006 above) as the original.
3007 If you feel up to translating the documentation (an excellent way to proof-read
3008 the original documentation by the way!), there are a few things you should
3012 \begin_layout Itemize
3013 Check out the documentation translation web page at
3014 \begin_inset CommandInset href
3016 name "http://www.lyx.org/Translation"
3017 target "http://www.lyx.org/Translation"
3022 That way, you can find out which (if any) documents have already been translate
3023 d into your language.
3024 You can also find out who (if anyone) is organizing the effort to translate
3025 the documentation into your language.
3026 If no one is organizing the effort, please let us know that you're interested.
3029 \begin_layout Standard
3030 Once you get to actually translating, here's a few hints for you that may
3034 \begin_layout Itemize
3035 Join the documentation team! There is information on how to do that in
3036 \begin_inset Flex Code
3039 \begin_layout Plain Layout
3046 \begin_inset Flex MenuItem
3049 \begin_layout Plain Layout
3050 Help\SpecialChar \menuseparator
3056 ), which by the way is the first document you should translate.
3059 \begin_layout Itemize
3060 Learn the typographic conventions for the language you are translating to.
3061 Typography is an ancient art and over the centuries, a great variety of
3062 conventions have developed throughout different parts of the world.
3063 Also study the professional terminology amongst typographers in your country.
3064 Inventing your own terminology will only confuse the users.
3067 (Warning! Typography is addictive!)
3070 \begin_layout Itemize
3071 Make a copy of the document.
3072 This will be your working copy.
3073 You can use this as your personal translated help-file by placing it in
3075 \begin_inset Flex Code
3078 \begin_layout Plain Layout
3087 \begin_layout Itemize
3088 Sometimes the original document (from the LyX-team) will be updated.
3089 Use the source viewer at
3090 \begin_inset CommandInset href
3092 name "http://www.lyx.org/trac/timeline"
3093 target "http://www.lyx.org/trac/timeline"
3097 to see what has been changed.
3098 That way you can easily see which parts of the translated document need
3102 \begin_layout Standard
3103 If you ever find an error in the original document, fix it and notify the
3104 rest of the documentation team of the changes! (You didn't forget to join
3105 the documentation team, did you?)
3108 \begin_layout Standard
3109 \begin_inset Branch OutDated
3112 \begin_layout Section
3113 International Keyboard Support
3116 \begin_layout Standard
3119 [Editor's Note: The following section is by
3127 It needs to be fixed to conform to the new Documentation Style sheet and
3128 to make use of the new v1.0 features.
3129 The whole thing also needs to be merged with the section following it.-jw
3130 It may also be badly out of date.-rh (2008)]
3133 \begin_layout Subsection
3134 Defining Own Keymaps: Keymap File Format
3137 \begin_layout Standard
3138 Let's look at a keyboard definition file a little closer.
3139 It is a plain text file defining
3142 \begin_layout Itemize
3143 key-to-key or key-to-string translations
3146 \begin_layout Itemize
3150 \begin_layout Itemize
3151 dead keys exceptions
3154 \begin_layout Standard
3155 To define key-to-key or key-to-string translation, use this command:
3158 \begin_layout Quotation
3159 \begin_inset Flex Code
3162 \begin_layout Plain Layout
3171 \begin_inset Flex Code
3174 \begin_layout Plain Layout
3183 \begin_layout Standard
3185 \begin_inset Flex Code
3188 \begin_layout Plain Layout
3194 is the key to be translated and
3195 \begin_inset Flex Code
3198 \begin_layout Plain Layout
3204 is the string to be inserted into the document.
3205 To define dead keys, use:
3208 \begin_layout Quotation
3209 \begin_inset Flex Code
3212 \begin_layout Plain Layout
3221 \begin_inset Flex Code
3224 \begin_layout Plain Layout
3233 \begin_layout Standard
3235 \begin_inset Flex Code
3238 \begin_layout Plain Layout
3244 is a keyboard key and
3245 \begin_inset Flex Code
3248 \begin_layout Plain Layout
3255 The following dead keys are supported (shortcut name is in parentheses):
3258 \begin_layout Quotation
3262 \begin_inset space \hfill{}
3268 \begin_layout Quotation
3270 \begin_inset space \hfill{}
3276 \begin_layout Quotation
3278 \begin_inset space \hfill{}
3284 \begin_layout Quotation
3286 \begin_inset space \hfill{}
3292 \begin_layout Quotation
3294 \begin_inset space \hfill{}
3300 \begin_layout Quotation
3302 \begin_inset space \hfill{}
3309 \begin_layout Plain Layout
3321 \begin_layout Quotation
3323 \begin_inset space \hfill{}
3329 \begin_layout Quotation
3331 \begin_inset space \hfill{}
3338 \begin_layout Plain Layout
3350 \begin_layout Quotation
3352 \begin_inset space \hfill{}
3358 \begin_layout Quotation
3360 \begin_inset space \hfill{}
3366 \begin_layout Quotation
3368 \begin_inset space \hfill{}
3375 \begin_layout Plain Layout
3387 \begin_layout Quotation
3389 \begin_inset space \hfill{}
3396 \begin_layout Plain Layout
3408 \begin_layout Quotation
3410 \begin_inset space \hfill{}
3416 \begin_layout Quotation
3417 hungarian umlaut (hug)
3418 \begin_inset space \hfill{}
3424 \begin_layout Quotation
3426 \begin_inset space \hfill{}
3432 \begin_layout Quotation
3434 \begin_inset space \hfill{}
3441 \begin_layout Plain Layout
3453 \begin_layout Standard
3454 Since in many international keyboards there are exceptions to what some
3455 dead keys should do, you can define them using
3458 \begin_layout Quotation
3459 \begin_inset Flex Code
3462 \begin_layout Plain Layout
3470 deadkey key outstring
3473 \begin_layout Standard
3474 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3478 \begin_layout Quotation
3479 \begin_inset Flex Code
3482 \begin_layout Plain Layout
3495 \begin_layout Standard
3496 to make it work correctly.
3497 Also, you have to define as exceptions dead keys over i and j, to remove
3498 the dot from them before inserting an accent mark.
3499 I will change this when the time comes, but so far I haven't had time.
3502 \begin_layout Standard
3503 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3506 \begin_inset Flex Code
3509 \begin_layout Plain Layout
3515 have different meaning.
3517 \begin_inset Flex Code
3520 \begin_layout Plain Layout
3526 marks comments, quotes start and end LaTeX-style commands.
3527 To enter quote, you'll need to use
3528 \begin_inset Flex Code
3531 \begin_layout Plain Layout
3540 \begin_inset Flex Code
3543 \begin_layout Plain Layout
3550 \begin_inset Flex Code
3553 \begin_layout Plain Layout
3564 \begin_layout Standard
3565 If you make a keyboard description file that works for your language, please
3566 mail it to me, so I can include it in the next keymap distribution.
3569 \begin_layout Standard
3570 More keywords will be supported in keymap configuration file in future,
3574 \begin_layout Itemize
3575 \begin_inset Flex Code
3578 \begin_layout Plain Layout
3589 \begin_inset space \hfill{}
3593 \begin_inset Flex Code
3596 \begin_layout Plain Layout
3605 \begin_layout Itemize
3606 \begin_inset Flex Code
3609 \begin_layout Plain Layout
3620 \begin_inset space \hfill{}
3624 \begin_inset Flex Code
3627 \begin_layout Plain Layout
3633 an external keymap translation program
3636 \begin_layout Standard
3637 Also, it should look into
3638 \begin_inset Flex Code
3641 \begin_layout Plain Layout
3647 file for defaults, too (for example, a
3648 \begin_inset Flex Code
3651 \begin_layout Plain Layout
3659 option to include default keyboard).
3667 \begin_layout Section
3668 International Keymap Stuff
3669 \begin_inset CommandInset label
3671 name "sec:International-Keymap-Stuff"
3678 \begin_layout Standard
3679 \begin_inset Note Note
3682 \begin_layout Plain Layout
3683 In doing the revisions on this document in March 2008, I did not look over
3684 this stuff, as I do not understand it.
3685 It would be good if someone else could do so.
3694 \begin_layout Standard
3695 The next two sections describe the
3696 \begin_inset Flex Code
3699 \begin_layout Plain Layout
3708 \begin_inset Flex Code
3711 \begin_layout Plain Layout
3719 file syntax in detail.
3720 These sections should help you design your own key map if the ones provided
3721 do not meet your needs.
3724 \begin_layout Subsection
3728 \begin_layout Standard
3732 \begin_inset Flex Code
3735 \begin_layout Plain Layout
3741 file maps keystrokes to characters or strings.
3742 As the name suggests, it sets a keyboard mapping.
3744 \begin_inset Flex Code
3747 \begin_layout Plain Layout
3758 \begin_inset Flex Code
3761 \begin_layout Plain Layout
3776 \begin_inset Flex Code
3779 \begin_layout Plain Layout
3792 \begin_inset Flex Code
3795 \begin_layout Plain Layout
3804 \begin_inset Flex Code
3807 \begin_layout Plain Layout
3815 are described in this section.
3818 \begin_layout Labeling
3819 \labelwidthstring 00.00.0000
3820 \begin_inset Flex Code
3823 \begin_layout Plain Layout
3831 Map a character to a string
3834 \begin_layout LyX-Code
3849 \begin_layout Standard
3882 the double-quote (")
3899 must be escaped with a preceding backslash (
3910 \begin_layout Standard
3912 \begin_inset Flex MenuItem
3915 \begin_layout Plain Layout
3923 statement to cause the symbol
3924 \begin_inset Flex MenuItem
3927 \begin_layout Plain Layout
3935 to be output for the keystroke
3936 \begin_inset Flex MenuItem
3939 \begin_layout Plain Layout
3950 \begin_layout LyX-Code
3956 \begin_layout Labeling
3957 \labelwidthstring 00.00.0000
3958 \begin_inset Flex Code
3961 \begin_layout Plain Layout
3969 Specify an accent character
3972 \begin_layout LyX-Code
3981 \begin_layout Standard
3982 This will make the cha
4020 This is the dead key
4024 \begin_layout Plain Layout
4031 refers to a key that does not produce a character by itself, but when followed
4032 with another key, produces the desired accent character.
4033 For example, a German characte
4035 r with an umlaut like
4045 can be produced in this manner.
4054 \begin_layout Standard
4067 and then another key not in
4084 followed by the other, not allowed key, as output.
4088 \begin_inset Flex MenuItem
4091 \begin_layout Plain Layout
4099 cancels a dead key, so if
4110 \begin_inset Flex MenuItem
4113 \begin_layout Plain Layout
4122 , the cursor will not go one position backwards but will instead cancel
4138 might have had on the next keystroke.
4142 \begin_layout Standard
4143 The following example specifies that the character ' is to be an acute accent,
4144 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4147 \begin_layout LyX-Code
4150 kmod ' acute aeiouAEIOU
4153 \begin_layout Labeling
4154 \labelwidthstring 00.00.0000
4155 \begin_inset Flex Code
4158 \begin_layout Plain Layout
4164 Specify an exception to the accent character
4167 \begin_layout LyX-Code
4176 \begin_layout Standard
4177 This defines an exce
4218 have been assigned a keystroke with a previous
4221 \begin_inset Flex Code
4224 \begin_layout Plain Layout
4248 must not belong in the
4295 If such a declaration does not exist in
4303 \begin_inset Flex Code
4306 \begin_layout Plain Layout
4340 \begin_inset Flex Code
4343 \begin_layout Plain Layout
4357 \begin_layout Standard
4358 The following command produces causes äi to be produced when you enter acute-i
4362 \begin_layout LyX-Code
4376 \begin_layout Labeling
4377 \labelwidthstring 00.00.0000
4378 \begin_inset Flex Code
4381 \begin_layout Plain Layout
4387 Combine two accent characters
4390 \begin_layout LyX-Code
4396 accent1 accent2 allowed
4399 \begin_layout Standard
4400 This one is getting pretty esoteric.
4401 It allows you to combine the effect
4457 \begin_inset Flex Code
4460 \begin_layout Plain Layout
4488 \begin_layout Standard
4489 Consider this example from the
4490 \begin_inset Flex Code
4493 \begin_layout Plain Layout
4504 \begin_layout LyX-Code
4507 kmod ; acute aeioyvhAEIOYVH
4511 kcomb acute umlaut iyIY
4514 \begin_layout Standard
4515 This allows you to press
4516 \begin_inset Flex MenuItem
4519 \begin_layout Plain Layout
4527 and get the effect of
4528 \begin_inset Flex Code
4531 \begin_layout Plain Layout
4550 in this case cancels the last dead key, so if you press
4551 \begin_inset Flex MenuItem
4554 \begin_layout Plain Layout
4563 \begin_inset Flex Code
4566 \begin_layout Plain Layout
4579 \begin_layout Subsection
4583 \begin_layout Standard
4585 \begin_inset Flex Code
4588 \begin_layout Plain Layout
4596 mapping is performed, a
4597 \begin_inset Flex Code
4600 \begin_layout Plain Layout
4610 file maps the strings that the symbols generate to characters in the current
4612 The LyX distribution currently includes at least the
4613 \begin_inset Flex Code
4616 \begin_layout Plain Layout
4625 \begin_inset Flex Code
4628 \begin_layout Plain Layout
4639 \begin_layout Standard
4641 \begin_inset Flex Code
4644 \begin_layout Plain Layout
4652 file is a sequence of declarations of the form
4655 \begin_layout LyX-Code
4668 \begin_layout Standard
4669 For example, in order to map
4670 \begin_inset Flex MenuItem
4673 \begin_layout Plain Layout
4683 to the corresponding character in the iso-8859-1 set (233), the following
4687 \begin_layout LyX-Code
4695 \begin_layout Standard
4697 \begin_inset Flex Code
4700 \begin_layout Plain Layout
4709 \begin_inset Flex Code
4712 \begin_layout Plain Layout
4730 the same character can apply to more than one string.
4732 \begin_inset Flex Code
4735 \begin_layout Plain Layout
4746 \begin_layout LyX-Code
4758 \begin_inset Newline newline
4774 \begin_layout Standard
4775 If LyX cannot find a mapping for the string produced by the keystroke or
4776 a deadkey sequence, it will check if it looks like an accented char and
4777 try to draw an accent over the character on screen.
4780 \begin_layout Subsection
4784 \begin_layout Standard
4785 There is a second way to add support for international characters through
4786 so-called dead-keys.
4787 A dead-key works in combination with a letter to produce an accented character.
4788 Here, we'll explain how to create a really simple dead-key to illustrate
4792 \begin_layout Standard
4793 Suppose you happen to need the circumflex character,
4794 \begin_inset Quotes eld
4798 \begin_inset Quotes erd
4803 \begin_inset Flex MenuItem
4806 \begin_layout Plain Layout
4813 \begin_inset space ~
4817 \begin_inset Flex MenuItem
4820 \begin_layout Plain Layout
4826 ] to the LyX command
4827 \begin_inset Flex Code
4830 \begin_layout Plain Layout
4837 \begin_inset Flex Code
4840 \begin_layout Plain Layout
4847 Now, whenever you type the
4848 \begin_inset Flex MenuItem
4851 \begin_layout Plain Layout
4857 -key followed by a letter, that letter will have a circumflex accent on
4859 For example, the sequence
4860 \begin_inset Quotes eld
4864 \begin_inset Flex MenuItem
4867 \begin_layout Plain Layout
4874 \begin_inset Quotes erd
4877 produces the letter:
4878 \begin_inset Quotes eld
4882 \begin_inset Quotes erd
4886 If you tried to type
4887 \begin_inset Quotes eld
4891 \begin_inset Flex MenuItem
4894 \begin_layout Plain Layout
4901 \begin_inset Quotes erd
4904 , however, LyX will complain with a beep, since a
4905 \begin_inset Quotes eld
4909 \begin_inset Flex MenuItem
4912 \begin_layout Plain Layout
4919 \begin_inset Quotes erd
4922 never takes a circumflex accent.
4924 \begin_inset Flex MenuItem
4927 \begin_layout Plain Layout
4933 after a dead-key produces the bare-accent.
4934 Please note this last point! If you bind a key to a dead-key, you'll need
4935 to rebind the character on that key to yet another key.
4937 \begin_inset Flex MenuItem
4940 \begin_layout Plain Layout
4946 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4949 \begin_layout Standard
4950 One common way to bind dead-keys is to use
4951 \begin_inset Flex MenuItem
4954 \begin_layout Plain Layout
4961 \begin_inset Flex MenuItem
4964 \begin_layout Plain Layout
4971 \begin_inset Flex MenuItem
4974 \begin_layout Plain Layout
4980 in combination with an accent, like
4981 \begin_inset Quotes eld
4985 \begin_inset Flex MenuItem
4988 \begin_layout Plain Layout
4995 \begin_inset Quotes erd
4999 \begin_inset Quotes eld
5003 \begin_inset Flex MenuItem
5006 \begin_layout Plain Layout
5013 \begin_inset Quotes erd
5017 \begin_inset Quotes eld
5021 \begin_inset Flex MenuItem
5024 \begin_layout Plain Layout
5031 \begin_inset Quotes erd
5035 Another way involves using
5036 \begin_inset Flex Code
5039 \begin_layout Plain Layout
5046 \begin_inset Flex Code
5049 \begin_layout Plain Layout
5055 to set up the special
5056 \begin_inset Flex Code
5059 \begin_layout Plain Layout
5067 \begin_inset Flex Code
5070 \begin_layout Plain Layout
5076 acts in some ways just like
5077 \begin_inset Flex MenuItem
5080 \begin_layout Plain Layout
5086 and permits you to bind keys to accented characters.
5087 You can also turn keys into dead-keys by binding them to something like
5089 \begin_inset Flex Code
5092 \begin_layout Plain Layout
5098 and then binding this symbolic key to the corresponding LyX command.
5102 \begin_layout Plain Layout
5107 : This is exactly what I do in my
5108 \begin_inset Flex Code
5111 \begin_layout Plain Layout
5118 \begin_inset Flex Code
5121 \begin_layout Plain Layout
5129 \begin_inset Flex MenuItem
5132 \begin_layout Plain Layout
5134 \begin_inset space ~
5143 \begin_inset Flex Code
5146 \begin_layout Plain Layout
5152 and a bunch of these
5153 \begin_inset Quotes eld
5157 \begin_inset Flex Code
5160 \begin_layout Plain Layout
5167 \begin_inset Quotes erd
5170 symbolic keys bound such things as
5171 \begin_inset Flex MenuItem
5174 \begin_layout Plain Layout
5176 \begin_inset space ~
5185 \begin_inset Flex MenuItem
5188 \begin_layout Plain Layout
5190 \begin_inset space ~
5199 This is how I produce my accented characters.
5204 You can make just about anything into the
5205 \begin_inset Flex Code
5208 \begin_layout Plain Layout
5215 \begin_inset Flex MenuItem
5218 \begin_layout Plain Layout
5224 keys, a spare function key, etc.
5225 As for the LyX commands that produce accents, check the entry for
5226 \begin_inset Flex Code
5229 \begin_layout Plain Layout
5240 You'll find the complete list there.
5243 \begin_layout Subsection
5244 Saving your Language Configuration
5247 \begin_layout Standard
5248 You can edit your preferences so that your desired language environment
5249 is automatically configured when LyX starts up, via the
5250 \begin_inset Flex MenuItem
5253 \begin_layout Plain Layout
5254 Edit\SpecialChar \menuseparator
5263 \begin_layout Chapter
5264 Installing New Document Classes, Layouts, and Templates
5265 \begin_inset CommandInset label
5267 name "cha:Installing-New-Document"
5272 \begin_inset Argument
5275 \begin_layout Plain Layout
5276 Installing New Document Classes
5284 \begin_layout Standard
5285 In this chapter, we describe the procedures for creating and installing
5286 new LyX layout and template files, as well as offer a refresher on correctly
5287 installing new LaTeX document classes.
5291 \begin_layout Standard
5292 First, let us a say a few words about how one ought to think about the relation
5293 between LyX and LaTeX.
5294 The thing to understand is that, in a certain sense, LyX doesn't know anything
5296 Indeed, from LyX's point of view, LaTeX is just one of several
5297 \begin_inset Quotes eld
5301 \begin_inset Quotes erd
5304 in which it is capable of producing output.
5305 Other such formats are DocBook, plaintext, and XHTML.
5306 LaTeX is, of course, a particularly important format, but very little of
5307 the information LyX has about LaTeX is actually contained in the program
5312 \begin_layout Plain Layout
5313 Some commands are sufficiently complex that they are
5314 \begin_inset Quotes eld
5318 \begin_inset Quotes erd
5322 But the developers generally regard this as a Bad Thing.
5327 Rather, that information, even for the standard classes like
5328 \begin_inset Flex Code
5331 \begin_layout Plain Layout
5337 , is contained in `layout files'.
5338 Similarly, LyX itself does not know much about DocBook or XHTML.
5339 What it knows is contained in layout files.
5342 \begin_layout Standard
5343 You can think of the layout file for a given document class as a translation
5344 manual between LyX constructs---paragraphs with their corresponding styles,
5345 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5347 Almost everything LyX knows about
5348 \begin_inset Flex Code
5351 \begin_layout Plain Layout
5357 , for example, is contained in the file
5358 \begin_inset Flex Code
5361 \begin_layout Plain Layout
5367 and in various other files it includes.
5368 For this reason, anyone intending to write layout files should plan to
5369 study the existing files.
5370 A good place to start is with
5371 \begin_inset Flex Code
5374 \begin_layout Plain Layout
5380 , which is included in
5381 \begin_inset Flex Code
5384 \begin_layout Plain Layout
5391 \begin_inset Flex Code
5394 \begin_layout Plain Layout
5400 , and many of the other layout files for document classes.
5401 This file is where sections and the like are defined:
5402 \begin_inset Flex Code
5405 \begin_layout Plain Layout
5411 tells LyX how paragraphs that are marked with the Section, Subsection,
5412 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5415 \begin_inset Flex Code
5418 \begin_layout Plain Layout
5424 file basically just includes several of these
5425 \begin_inset Flex Code
5428 \begin_layout Plain Layout
5437 \begin_layout Standard
5438 Defining the LyX--LaTeX correspondence is not the only thing layout files
5440 Their other job is to define how the LyX constructs themselves will appear
5442 The fact that layout files have these two jobs is often a source of confusion,
5443 because they are completely separate.
5444 Telling LyX how to translate a certain paragraph style into LaTeX does
5445 not tell LyX how to display it; conversely, telling LyX how to display
5446 a certain paragraph style does not tell LyX how to translate it into LaTeX
5447 (let alone tell LaTeX how to display it).
5448 So, in general, when you define a new LyX construct, you must always do
5449 two quite separate things: (i)
5450 \begin_inset space ~
5453 tell LyX how to translate it into LaTeX and (ii)
5454 \begin_inset space ~
5457 tell LyX how to display it.
5460 \begin_layout Standard
5461 Much the same is true, of course, as regards LyX's other backend formats,
5462 though XHTML is in some ways different, because in that case LyX
5466 able, to some extent, to use information about how it should display a
5467 paragraph on the screen to output information (in the form of CSS) about
5468 how the paragraph should be displayed in a browser.
5469 Even in this case, however, the distinction between what LyX does internally
5470 and how things are rendered externally remains in force, and the two can
5471 be controlled separately.
5473 \begin_inset CommandInset ref
5475 reference "sec:Tags-for-XHTML"
5482 \begin_layout Section
5483 Installing new LaTeX files
5486 \begin_layout Standard
5487 Some installations may not include a LaTeX package or class file that you
5488 would like to use within LyX.
5489 For example, you might need FoilTeX, a package for preparing slides for
5490 overhead projectors.
5491 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5492 a user interface for installing such packages.
5493 For example, with MiKTeX, you start the program
5494 \begin_inset Quotes eld
5498 \begin_inset space ~
5502 \begin_inset Quotes erd
5505 to get a list of available packages.
5506 To install one of them, right click on it or use the corresponding toolbar
5510 \begin_layout Standard
5511 If your LaTeX distribution does not provide such a `package manager', or
5512 if the package is not available from your distribution, then follow these
5513 steps to install it manually:
5516 \begin_layout Enumerate
5517 Get the package from
5518 \begin_inset CommandInset href
5521 target "http://www.ctan.org/"
5528 \begin_layout Enumerate
5529 If the package contains a file with the ending
5530 \begin_inset Quotes eld
5534 \begin_inset Flex Code
5537 \begin_layout Plain Layout
5544 \begin_inset Quotes erd
5547 (is the case for FoilTeX) then open a console, change to the folder of
5548 this file and execute the command
5549 \begin_inset Flex Code
5552 \begin_layout Plain Layout
5559 You have now unpacked the package and have all files to install it.
5560 Most LaTeX-packages are not packed and you can skip this step.
5563 \begin_layout Enumerate
5564 Now you need to decide if the package should be available for all users
5569 \begin_layout Enumerate
5570 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5571 for all users on your system, then install it in your `local' TeX tree,
5572 otherwise install it in your own `user' TeX tree.
5573 Where these trees should be created, if they do not already exist, depends
5575 To find this out, look in the file
5576 \begin_inset Flex Code
5579 \begin_layout Plain Layout
5589 \begin_layout Plain Layout
5590 This is usually in the directory
5591 \begin_inset Flex Code
5594 \begin_layout Plain Layout
5600 , though you can execute the command
5601 \begin_inset Flex Code
5604 \begin_layout Plain Layout
5615 The location of the `local' TeX tree is defined by the
5616 \begin_inset Flex Code
5619 \begin_layout Plain Layout
5625 variable; this is usually somewhere like
5626 \begin_inset Flex Code
5629 \begin_layout Plain Layout
5630 /usr/local/share/texmf
5636 The location of the `user' TeX tree is defined by
5637 \begin_inset Flex Code
5640 \begin_layout Plain Layout
5647 \begin_inset Flex Code
5650 \begin_layout Plain Layout
5657 (If these variables are not predefined, you have to define them.) You'll
5658 probably need root permissions to create or modify the `local' tree, but
5659 not for your `user' tree.
5660 \begin_inset Newline newline
5663 In general, it is recommended to install in the user tree because your user
5664 will not be modified or even overwritten when you upgrade your system.
5665 It will typically also be backed up together with everything else when
5666 you backup your home directory (which, of course, you do on a regular basis).
5669 \begin_layout Enumerate
5670 On Windows, if you want the new package to be available for all users on
5671 your system, change to the folder where LaTeX is installed and then change
5673 \begin_inset Flex Code
5676 \begin_layout Plain Layout
5687 (For MiKTeX, this would be by default the folder
5688 \begin_inset Flex Code
5691 \begin_layout Plain Layout
5709 \begin_layout Plain Layout
5710 Note that this will be the correct path only on English installations.
5711 On a German one, it would be
5712 \begin_inset Flex Code
5715 \begin_layout Plain Layout
5729 , and similarly for other languages.
5734 Create there a new folder
5735 \begin_inset Flex Code
5738 \begin_layout Plain Layout
5744 and copy all files of the package into it.
5746 \begin_inset Newline newline
5749 If the package should only available for you or you don't have admin permissions
5750 , do the same, but in the local LaTeX folder.
5752 \begin_inset space \thinspace{}
5756 \begin_inset space ~
5759 2.8 under Windows XP, this would be the folder:
5760 \begin_inset Newline newline
5766 \begin_inset Flex Code
5769 \begin_layout Plain Layout
5772 Documents and Settings
5784 \begin_inset Newline newline
5790 \begin_inset Phantom HPhantom
5793 \begin_layout Plain Layout
5804 \begin_inset Flex Code
5807 \begin_layout Plain Layout
5820 \begin_inset Newline newline
5823 On Vista, it would be:
5824 \begin_inset Newline newline
5828 \begin_inset Flex Code
5831 \begin_layout Plain Layout
5857 \begin_layout Enumerate
5858 Now one only need to tell LaTeX that there are new files.
5859 This depends on the used LaTeX-Distribution:
5863 \begin_layout Enumerate
5864 For TeXLive execute the command
5865 \begin_inset Flex Code
5868 \begin_layout Plain Layout
5875 If you installed the package for all users, then you will probably need
5876 to have root permissions for that.
5879 \begin_layout Enumerate
5880 For MiKTeX, if you have installed the package for all users, start the program
5882 \begin_inset Quotes eld
5886 \begin_inset space ~
5890 \begin_inset Quotes erd
5893 and press the button marked
5894 \begin_inset Quotes eld
5898 \begin_inset Quotes erd
5902 Otherwise start the program
5903 \begin_inset Quotes eld
5907 \begin_inset Quotes erd
5914 \begin_layout Enumerate
5915 Finally, you need to tell LyX that there are new packages available.
5916 So, in LyX, use the menu
5917 \begin_inset Flex MenuItem
5920 \begin_layout Plain Layout
5923 \SpecialChar \menuseparator
5929 and then restart LyX.
5932 \begin_layout Standard
5933 Now the package is installed.
5934 In our example, the document class
5935 \begin_inset Flex Code
5938 \begin_layout Plain Layout
5940 \begin_inset space ~
5947 \begin_layout Plain Layout
5959 will now be available under
5960 \begin_inset Flex MenuItem
5963 \begin_layout Plain Layout
5964 Document\SpecialChar \menuseparator
5965 Settings\SpecialChar \menuseparator
5975 \begin_layout Standard
5976 If you would like to use a LaTeX document class that is not even listed
5978 \begin_inset Flex MenuItem
5981 \begin_layout Plain Layout
5982 Document\SpecialChar \menuseparator
5983 Settings\SpecialChar \menuseparator
5989 , then you need to create a `layout' file for it.
5990 That is the topic of the next section.
5993 \begin_layout Section
5994 Types of layout files
5997 \begin_layout Standard
5998 This section describes the various sorts of LyX files that contain layout
6000 These files describe various paragraph and character styles, determining
6001 how LyX should display them and how they should be translated into LaTeX,
6002 DocBook, XHTML, or whatever output format is being used.
6006 \begin_layout Standard
6007 We shall try to provide a thorough description of the process of writing
6009 However, there are so many different types of documents supported even
6010 by just LaTeX that we can't hope to cover every different possibility or
6011 problem you might encounter.
6012 The LyX users' list is frequented by people with lots of experience with
6013 layout design who are willing to share what they've learned, so please
6014 feel free to ask questions there.
6017 \begin_layout Standard
6018 As you prepare to write a new layout, it is extremely helpful to look at
6019 the layouts distributed with LyX.
6020 If you write a LyX layout for a LaTeX document class that might also be
6021 used by others, or write a module that might be useful to others, then
6022 you should consider posting your layout to the
6023 \begin_inset CommandInset href
6025 name "layout section on the LyX wiki"
6026 target "http://wiki.lyx.org/Layouts/Layouts"
6030 or even to the LyX developers' list, so that it might be included in LyX
6035 \begin_layout Plain Layout
6036 Note that LyX is licensed under the General Public License, so any material
6037 that is contributed to LyX must be similarly licensed.
6045 \begin_layout Subsection
6047 \begin_inset CommandInset label
6049 name "sub:Layout-modules"
6056 \begin_layout Standard
6057 We have spoken to this point about `layout files'.
6058 But there are different sorts of files that contain layout information.
6059 Layout files, strictly so called, have the
6060 \begin_inset Flex Code
6063 \begin_layout Plain Layout
6069 extension and provide LyX with information about document classes.
6070 As of LyX 1.6, however, layout information can also be contained in layout
6076 \begin_inset Flex Code
6079 \begin_layout Plain Layout
6086 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6087 some modules—such as the
6088 \begin_inset Flex Code
6091 \begin_layout Plain Layout
6097 module—specifically provide support for one package.
6098 In a sense, layout modules are similar to included
6102 \begin_layout Plain Layout
6103 These can have any extension, but by convention have the
6104 \begin_inset Flex Code
6107 \begin_layout Plain Layout
6119 \begin_inset Flex Code
6122 \begin_layout Plain Layout
6128 —in that modules are not specific to a given document class but may be used
6129 with many different classes.
6130 The difference is that using an included file with
6131 \begin_inset Flex Code
6134 \begin_layout Plain Layout
6140 requires editing that file.
6141 Modules, by contrast, are selected in the
6142 \begin_inset Flex MenuItem
6145 \begin_layout Plain Layout
6146 Document\SpecialChar \menuseparator
6155 \begin_layout Standard
6156 Building modules is the easiest way to get started with layout editing,
6157 since it can be as simple as adding a single new paragraph style or flex
6159 But modules may, in principle, contain anything a layout file can contain.
6162 \begin_layout Standard
6163 After creating a new module and copying it to the
6164 \begin_inset Flex Code
6167 \begin_layout Plain Layout
6173 folder, you will need to reconfigure and then restart LyX for the module
6174 to appear in the menu.
6175 However, changes you make to the module will be seen immediately, if you
6177 \begin_inset Flex MenuItem
6180 \begin_layout Plain Layout
6181 Document\SpecialChar \menuseparator
6187 , highlight something, and then hit
6188 \begin_inset Quotes eld
6192 \begin_inset Quotes erd
6198 It is strongly recommended that you save your work before doing this
6203 it is strongly recommended that you not attempt to edit modules while simultaneo
6204 usly working on actual documents
6207 Though of course the developers strive to keep LyX stable in such situations,
6208 syntax errors and the like in your module file could cause strange behavior.
6211 \begin_layout Subsection
6213 \begin_inset Flex MenuItem
6216 \begin_layout Plain Layout
6225 \begin_layout Standard
6226 There are two situations you are likely to encounter when wanting to support
6227 a new LaTeX document class, involving style (
6228 \begin_inset Flex Code
6231 \begin_layout Plain Layout
6237 ) files and LaTeX2e class (
6238 \begin_inset Flex Code
6241 \begin_layout Plain Layout
6248 Supporting a style file is usually fairly easy.
6249 Supporting a new class file is a bit harder.
6250 We'll discuss the former in this section and the latter in the next.
6251 Similar remarks apply, of course, if you want to support a new DocBook
6255 \begin_layout Standard
6256 The easier case is the one in which your new document class is provided
6257 as a style file that is to be used in conjunction with an already supported
6259 For the sake of the example, we'll assume that the style file is called
6261 \begin_inset Flex MenuItem
6264 \begin_layout Plain Layout
6270 and that it is meant to be used with
6271 \begin_inset Flex MenuItem
6274 \begin_layout Plain Layout
6280 , which is a standard class.
6284 \begin_layout Standard
6285 Start by copying the existing class's layout file into your local directory:
6289 \begin_layout Plain Layout
6290 Of course, which directory is your local directory will vary by platform,
6291 and LyX allows you to specify your local directory on startup, too, using
6293 \begin_inset Flex Code
6296 \begin_layout Plain Layout
6310 \begin_layout LyX-Code
6311 cp report.layout ~/.lyx/layouts/myclass.layout
6314 \begin_layout Standard
6316 \begin_inset Flex Code
6319 \begin_layout Plain Layout
6325 and change the line:
6328 \begin_layout LyX-Code
6331 DeclareLaTeXClass{report}
6334 \begin_layout Standard
6338 \begin_layout LyX-Code
6341 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6344 \begin_layout Standard
6348 \begin_layout LyX-Code
6350 \begin_inset Newline newline
6356 \begin_inset Newline newline
6362 \begin_layout Standard
6363 near the top of the file.
6366 \begin_layout Standard
6367 Start LyX and select
6368 \begin_inset Flex MenuItem
6371 \begin_layout Plain Layout
6372 Tools\SpecialChar \menuseparator
6379 Then restart LyX and try creating a new document.
6381 \begin_inset Flex MenuItem
6384 \begin_layout Plain Layout
6390 " as a document class option in the
6391 \begin_inset Flex MenuItem
6394 \begin_layout Plain Layout
6395 Document\SpecialChar \menuseparator
6402 It is likely that some of the sectioning commands and such in your new
6403 class will work differently from how they worked in the base class—
6404 \begin_inset Flex Code
6407 \begin_layout Plain Layout
6413 in this example—so you can fiddle around with the settings for the different
6414 sections if you wish.
6415 The layout information for sections is contained in
6416 \begin_inset Flex Code
6419 \begin_layout Plain Layout
6425 , but you do not need to copy and change this file.
6426 Instead, you can simply add your changes to your layout file, after the
6428 \begin_inset Flex Code
6431 \begin_layout Plain Layout
6437 , which itself includes
6438 \begin_inset Flex Code
6441 \begin_layout Plain Layout
6448 For example, you might add these lines:
6451 \begin_layout LyX-Code
6455 \begin_layout LyX-Code
6459 \begin_layout LyX-Code
6463 \begin_layout LyX-Code
6467 \begin_layout LyX-Code
6471 \begin_layout Standard
6472 to change the font for chapter headings to sans-serif.
6473 This will override (or, in this case, add to) the existing declaration
6474 for the Chapter style.
6478 \begin_layout Standard
6479 Your new package may also provide commands or environments not present in
6481 In this case, you will want to add these to the layout file.
6483 \begin_inset CommandInset ref
6485 reference "sec:TextClass"
6489 for information on how to do so.
6492 \begin_layout Standard
6494 \begin_inset Flex MenuItem
6497 \begin_layout Plain Layout
6503 can be used with several different document classes, and even if it cannot,
6504 you might find it easiest just to write a module that you can load with
6506 The simplest possible such module would be:
6509 \begin_layout LyX-Code
6512 DeclareLyXModule{My Package}
6515 \begin_layout LyX-Code
6519 \begin_layout LyX-Code
6520 #Support for mypkg.sty.
6523 \begin_layout LyX-Code
6525 \begin_inset Newline newline
6531 \begin_layout LyX-Code
6533 \begin_inset Newline newline
6539 \begin_layout LyX-Code
6541 \begin_inset Newline newline
6547 \begin_inset Newline newline
6553 \begin_layout Standard
6554 A more complex module might modify the behavior of some existing constructs
6555 or define some new ones.
6557 \begin_inset CommandInset ref
6559 reference "sec:TextClass"
6566 \begin_layout Subsection
6568 \begin_inset Flex MenuItem
6571 \begin_layout Plain Layout
6580 \begin_layout Standard
6581 There are two possibilities here.
6582 One is that the class file is itself based upon an existing document class.
6583 For example, many thesis classes are based upon
6584 \begin_inset Flex MenuItem
6587 \begin_layout Plain Layout
6594 To see whether yours is, look for a line like
6597 \begin_layout LyX-Code
6603 \begin_layout Standard
6605 If so, then you may proceed largely as in the previous section, though
6607 \begin_inset Flex Code
6610 \begin_layout Plain Layout
6616 line will be different.
6617 If your new class is
6618 \begin_inset Flex Code
6621 \begin_layout Plain Layout
6627 and it is based upon
6628 \begin_inset Flex Code
6631 \begin_layout Plain Layout
6637 , then the line should read:
6641 \begin_layout Plain Layout
6642 And it will be easiest if you save the file to
6643 \begin_inset Flex Code
6646 \begin_layout Plain Layout
6652 : LyX assumes that the document class has the same name as the layout file.
6661 \begin_layout LyX-Code
6664 DeclareLaTeXClass[thesis,book]{thesis}
6667 \begin_layout Standard
6668 If, on the other hand, the new class is not based upon an existing class,
6669 you will probably have to
6670 \begin_inset Quotes eld
6674 \begin_inset Quotes erd
6678 We strongly suggest copying an existing layout file which uses a similar
6679 LaTeX class and then modifying it, if you can do so.
6680 At least use an existing file as a starting point so you can find out what
6681 items you need to worry about.
6682 Again, the specifics are covered below.
6685 \begin_layout Subsection
6687 \begin_inset CommandInset label
6689 name "sub:Creating-Templates"
6696 \begin_layout Standard
6697 Once you have written a layout file for a new document class, you might
6698 want to consider writing a
6703 A template acts as a kind of tutorial for your layout, showing how it might
6704 be used, though containing dummy content.
6705 You can of course look at the various templates included with LyX for ideas.
6708 \begin_layout Standard
6709 Templates are created just like usual documents: using LyX.
6710 The only difference is that usual documents contain all possible settings,
6711 including the font scheme and the paper size.
6712 Usually a user doesn't want a template to overwrite his preferred settings
6713 for such parameters.
6714 For that reason, the designer of a template should remove the corresponding
6716 \begin_inset Flex Code
6719 \begin_layout Plain Layout
6728 \begin_inset Flex Code
6731 \begin_layout Plain Layout
6739 from the template LyX file.
6740 This can be done with any simple text-editor, for example
6741 \begin_inset Flex Code
6744 \begin_layout Plain Layout
6751 \begin_inset Flex Code
6754 \begin_layout Plain Layout
6764 \begin_layout Standard
6765 Put the edited template files you create in
6766 \begin_inset Flex Code
6769 \begin_layout Plain Layout
6775 , copy the ones you use from the global template directory in
6776 \begin_inset Flex Code
6779 \begin_layout Plain Layout
6785 to the same place, and redefine the template path in the
6786 \begin_inset Flex MenuItem
6789 \begin_layout Plain Layout
6790 Tools\SpecialChar \menuseparator
6791 Preferences\SpecialChar \menuseparator
6800 \begin_layout Standard
6801 Note, by the way, that there is a template which has a particular meaning:
6803 \begin_inset Flex Code
6806 \begin_layout Plain Layout
6813 This template is loaded every time you create a new document with
6814 \begin_inset Flex MenuItem
6817 \begin_layout Plain Layout
6818 File\SpecialChar \menuseparator
6824 in order to provide useful defaults.
6825 To create this template from inside LyX, all you have to do is to open
6826 a document with the correct settings, and use the
6827 \begin_inset Flex MenuItem
6830 \begin_layout Plain Layout
6831 Save as Document Defaults
6839 \begin_layout Subsection
6840 Upgrading old layout files
6843 \begin_layout Standard
6844 The format of layout files changes with each LyX release, so old layout
6845 files need to be converted to the new format.
6846 This process has been automated since LyX 1.4: If LyX reads a layout file
6847 in an older format, it automatically calls the script
6848 \begin_inset Flex Code
6851 \begin_layout Plain Layout
6857 to convert it to a temporary file in current format.
6858 The original file is left untouched.
6859 If you use the layout file often, then, you may want to convert it permanently,
6860 so that LyX does not have to do so itself every time.
6861 To do this, you can call the converter manually:
6864 \begin_layout LyX-Code
6865 mv myclass.layout myclass.old
6868 \begin_layout LyX-Code
6869 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6872 \begin_layout Standard
6874 \begin_inset Flex Code
6877 \begin_layout Plain Layout
6883 with the name of your LyX system directory, of course.
6886 \begin_layout Standard
6887 Note that manual conversion does not affect included files, so these will
6888 have to be converted separately.
6891 \begin_layout Section
6892 \begin_inset CommandInset label
6894 name "sec:TextClass"
6898 The layout file format
6901 \begin_layout Standard
6902 When it's finally time to get your hands dirty and create or edit your own
6903 layout file, the following sections describe what you're up against.
6904 Our advice is to go slowly, save and test often, listen to soothing music,
6905 and enjoy one or two of your favorite adult beverages; more if you are
6906 getting particularly stuck.
6907 It's really not that hard, except that the multitude of options can become
6908 overwhelming if you try to do too much in one sitting.
6909 Go have another adult beverage, just for good measure.
6912 \begin_layout Standard
6913 Note that all the tags used in layout files are case-insensitive.
6915 \begin_inset Flex Code
6918 \begin_layout Plain Layout
6925 \begin_inset Flex Code
6928 \begin_layout Plain Layout
6935 \begin_inset Flex Code
6938 \begin_layout Plain Layout
6944 are really the same tag.
6945 The possible values are printed in brackets after the feature's name.
6946 The default value if a feature isn't specified inside a text class-description
6948 \begin_inset Flex Code
6951 \begin_layout Plain Layout
6960 If the argument has a data type like
6961 \begin_inset Quotes eld
6965 \begin_inset Quotes erd
6969 \begin_inset Quotes eld
6973 \begin_inset Quotes erd
6976 , the default is shown like this:
6977 \begin_inset Flex Code
6980 \begin_layout Plain Layout
6991 \begin_layout Subsection
6992 The document class declaration
6995 \begin_layout Standard
6996 Lines in a layout file which begin with
6997 \begin_inset Flex Code
7000 \begin_layout Plain Layout
7007 There is one exception to this rule.
7009 \begin_inset Flex Code
7012 \begin_layout Plain Layout
7018 files should begin with a line like:
7021 \begin_layout LyX-Code
7024 #% Do not delete the line below; configure depends on this
7027 \begin_layout LyX-Code
7032 DeclareLaTeXClass{article}
7035 \begin_layout Standard
7036 The second line is used when you (re)configure LyX.
7037 The layout file is read by the LaTeX script
7038 \begin_inset Flex Code
7041 \begin_layout Plain Layout
7047 , in a special mode where
7048 \begin_inset Flex Code
7051 \begin_layout Plain Layout
7058 The first line is just a LaTeX comment, and the second one contains the
7059 declaration of the text class.
7060 If these lines appear in a file named
7061 \begin_inset Flex Code
7064 \begin_layout Plain Layout
7070 , then they define a text class of name
7071 \begin_inset Flex Code
7074 \begin_layout Plain Layout
7080 (the name of the layout file) which uses the LaTeX document class
7081 \begin_inset Flex Code
7084 \begin_layout Plain Layout
7090 (the default is to use the same name as the layout).
7092 \begin_inset Quotes eld
7096 \begin_inset Quotes erd
7099 that appears above is used as a description of the text class in the
7100 \begin_inset Flex MenuItem
7103 \begin_layout Plain Layout
7104 Document\SpecialChar \menuseparator
7113 \begin_layout Standard
7114 Let's assume that you wrote your own text class that uses the
7115 \begin_inset Flex Code
7118 \begin_layout Plain Layout
7124 document class, but where you changed the appearance of the section headings.
7125 If you put it in a file
7126 \begin_inset Flex Code
7129 \begin_layout Plain Layout
7135 , the header of this file should be:
7138 \begin_layout LyX-Code
7141 #% Do not delete the line below; configure depends on this
7144 \begin_layout LyX-Code
7149 DeclareLaTeXClass[article]{article (with my own headings)}
7152 \begin_layout Standard
7153 This declares a text class
7154 \begin_inset Flex Code
7157 \begin_layout Plain Layout
7163 , associated with the LaTeX document class
7164 \begin_inset Flex Code
7167 \begin_layout Plain Layout
7174 \begin_inset Quotes eld
7177 article (with my own headings)
7178 \begin_inset Quotes erd
7182 If your text class depends on several packages, you can declare it as:
7185 \begin_layout LyX-Code
7188 #% Do not delete the line below; configure depends on this
7191 \begin_layout LyX-Code
7196 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7199 \begin_layout Standard
7200 This indicates that your text class uses the
7201 \begin_inset Flex Code
7204 \begin_layout Plain Layout
7211 Finally, it is also possible to declare classes for DocBook code.
7212 Typical declarations will look like:
7215 \begin_layout LyX-Code
7218 #% Do not delete the line below; configure depends on this
7221 \begin_layout LyX-Code
7226 DeclareDocBookClass[article]{SGML (DocBook article)}
7229 \begin_layout Standard
7230 Note that these declarations can also be given an optional parameter declaring
7231 the name of the document class (but not a list).
7234 \begin_layout Standard
7235 So, to be as explicit as possible, the form of the layout declaration is:
7238 \begin_layout LyX-Code
7243 DeclareLaTeXClass[class,package.sty]{layout description}
7246 \begin_layout Standard
7247 The class need only be specified if the name of the LaTeX class file and
7248 the name of the layout file are different or if there are packages to load.
7249 If the name of the class file is not specified, then LyX will simply assume
7250 that it is the same as the name of the layout file.
7253 \begin_layout Standard
7254 When the text class has been modified to your taste, all you have to do
7255 is to copy it either to
7256 \begin_inset Flex Code
7259 \begin_layout Plain Layout
7266 \begin_inset Flex Code
7269 \begin_layout Plain Layout
7276 \begin_inset Flex MenuItem
7279 \begin_layout Plain Layout
7280 Tools\SpecialChar \menuseparator
7286 , exit LyX and restart.
7287 Then your new text class should be available along with the others.
7290 \begin_layout Standard
7291 Once the layout file is installed, you can edit it and see your changes
7292 without having to reconfigure or to restart LyX.
7297 \begin_layout Plain Layout
7298 In versions of LyX prior to 1.6, this was not true.
7299 As a result, editing layout files was very time consuming, since you had
7300 constantly to restart LyX to see changes.
7305 You can force a reload of the current layout by using the LyX function
7307 \begin_inset Flex MenuItem
7310 \begin_layout Plain Layout
7317 There is no default binding for this function—though, of course, you can
7318 bind it to a key yourself.
7319 But you will normally use this function simply by entering it in the mini-buffe
7324 \begin_layout Standard
7330 \begin_inset Flex MenuItem
7333 \begin_layout Plain Layout
7339 is very much an `advanced feature'.
7344 recommended that you save your work before using this function.
7349 recommended that you not attempt to edit layout information while simultaneousl
7350 y working on a document that you care about.
7351 Use a test document.
7352 Syntax errors and the like in your layout file could cause peculiar behavior.
7353 In particular, such errors could cause LyX to regard the current layout
7354 as invalid and to attempt to switch to some other layout.
7358 \begin_layout Plain Layout
7359 Really bad syntax errors may even caused LyX to exit.
7360 This is because certain sorts of errors may make LyX unable to read
7370 The LyX team strives to keep LyX stable in such situations, but safe is
7375 \begin_layout Plain Layout
7376 While we're giving advice: make regular backups.
7377 And be nice to your mother.
7385 \begin_layout Subsection
7386 The Module declaration
7389 \begin_layout Standard
7390 A module must begin with a line like the following:
7393 \begin_layout LyX-Code
7396 DeclareLyXModule[endnotes.sty]{Endnotes}
7399 \begin_layout Standard
7400 The mandatory argument, in curly brackets, is the name of the module, as
7402 \begin_inset Flex MenuItem
7405 \begin_layout Plain Layout
7406 Document\SpecialChar \menuseparator
7407 Settings\SpecialChar \menuseparator
7414 The argument in square brackets is optional: It declares any LaTeX packages
7415 on which the module depends.
7416 Please note that only packages about which LyX knows should be listed in
7417 the square brackets.
7421 \begin_layout Plain Layout
7422 The list of such packages is documented only in the source code.
7427 LyX will not check for arbitrary packages.
7428 It is also possible to use the form
7429 \begin_inset Flex MenuItem
7432 \begin_layout Plain Layout
7438 as an optional argument, which declares that the module can only be used
7439 when there exists a conversion chain between the formats `
7440 \begin_inset Flex Code
7443 \begin_layout Plain Layout
7450 \begin_inset Flex Code
7453 \begin_layout Plain Layout
7462 \begin_layout Standard
7463 The module declaration should then be followed by lines like the following
7467 \begin_layout Plain Layout
7468 Preferably in English if the module should be published with LyX.
7469 This description will appear in the list of messages to be translated and
7470 will be thus translated with the next interface update.
7478 \begin_layout LyX-Code
7482 \begin_layout LyX-Code
7483 #Adds an endnote command, in addition to footnotes.
7487 \begin_layout LyX-Code
7488 #You will need to add
7490 theendnotes in TeX code where you
7493 \begin_layout LyX-Code
7494 #want the endnotes to appear.
7498 \begin_layout LyX-Code
7502 \begin_layout LyX-Code
7503 #Requires: somemodule | othermodule
7506 \begin_layout LyX-Code
7507 #Excludes: badmodule
7510 \begin_layout Standard
7511 The description is used in
7512 \begin_inset Flex MenuItem
7515 \begin_layout Plain Layout
7516 Document\SpecialChar \menuseparator
7517 Settings\SpecialChar \menuseparator
7523 to provide the user with information about what the module does.
7525 \begin_inset Flex Code
7528 \begin_layout Plain Layout
7534 line is used to identify other modules with which this one must be used;
7536 \begin_inset Flex Code
7539 \begin_layout Plain Layout
7545 line is used to identify modules with which this one may not be used.
7546 Both are optional, and, as shown, multiple modules should be separated
7547 with the pipe symbol: |.
7548 Note that the required modules are treated disjunctively:
7552 of the required modules must be used.
7557 excluded module may be used.
7558 Note that modules are identified here by their
7563 \begin_inset Flex Code
7566 \begin_layout Plain Layout
7574 \begin_inset Flex Code
7577 \begin_layout Plain Layout
7584 \begin_inset Flex Code
7587 \begin_layout Plain Layout
7596 \begin_layout Subsection
7600 \begin_layout Standard
7601 The first non-comment line of any layout file, included file, or module
7606 contain the file format number:
7609 \begin_layout Description
7610 \begin_inset Flex Code
7613 \begin_layout Plain Layout
7620 \begin_inset Flex Code
7623 \begin_layout Plain Layout
7629 ] The format of the layout file.
7632 \begin_layout Standard
7633 This tag was introduced with LyX 1.4.0.
7634 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7635 and are considered to be of format 1.
7636 The format for the present version of LyX is format 21.
7637 But each version of LyX is capable of reading earlier versions' layout
7638 files, just as they are capable of reading files produced by earlier versions
7640 There is, however, no provision for converting to earlier formats.
7641 So LyX 1.6.x will not read layout files in format 21 but only files in format
7645 \begin_layout Subsection
7646 \begin_inset CommandInset label
7648 name "sub:General-text-class"
7652 General text class parameters
7655 \begin_layout Standard
7656 These are general parameters that govern the behavior of an entire document
7662 mean that they must appear in
7663 \begin_inset Flex Code
7666 \begin_layout Plain Layout
7672 files rather than in modules.
7673 A module can contain any layout tag.)
7676 \begin_layout Description
7677 \begin_inset Flex Code
7680 \begin_layout Plain Layout
7686 Adds information that will be output in the
7687 \begin_inset Flex Code
7690 \begin_layout Plain Layout
7696 block when this document class is output to XHTML.
7697 Typically, this would be used to output CSS style information, but it can
7698 be used for anything that can appear in
7699 \begin_inset Flex Code
7702 \begin_layout Plain Layout
7710 \begin_inset Quotes eld
7714 \begin_inset Flex Code
7717 \begin_layout Plain Layout
7724 \begin_inset Quotes erd
7730 \begin_layout Description
7731 \begin_inset Flex Code
7734 \begin_layout Plain Layout
7740 Adds information to the document preamble.
7742 \begin_inset Quotes eld
7746 \begin_inset Flex Code
7749 \begin_layout Plain Layout
7756 \begin_inset Quotes erd
7762 \begin_layout Description
7763 \begin_inset Flex Code
7766 \begin_layout Plain Layout
7772 Defines formats for use in the display of bibliographic information.
7774 \begin_inset CommandInset ref
7776 reference "sub:Citation-format-description"
7782 \begin_inset Quotes eld
7786 \begin_inset Flex Code
7789 \begin_layout Plain Layout
7796 \begin_inset Quotes erd
7802 \begin_layout Description
7803 \begin_inset Flex Code
7806 \begin_layout Plain Layout
7812 Describes various global options supported by the document class.
7814 \begin_inset space ~
7818 \begin_inset CommandInset ref
7820 reference "sub:ClassOptions"
7826 \begin_inset Quotes eld
7830 \begin_inset Flex Code
7833 \begin_layout Plain Layout
7840 \begin_inset Quotes erd
7846 \begin_layout Description
7847 \begin_inset Flex Code
7850 \begin_layout Plain Layout
7857 \begin_inset Flex Code
7860 \begin_layout Plain Layout
7869 \begin_inset Flex Code
7872 \begin_layout Plain Layout
7878 ] Whether the class should
7882 to having one or two columns.
7883 Can be changed in the
7884 \begin_inset Flex MenuItem
7887 \begin_layout Plain Layout
7888 Document\SpecialChar \menuseparator
7897 \begin_layout Description
7898 \begin_inset Flex Code
7901 \begin_layout Plain Layout
7908 \begin_inset Flex Code
7911 \begin_layout Plain Layout
7917 ] This sequence defines the properties for a counter.
7918 If the counter does not yet exist, it is created; if it does exist, it
7921 \begin_inset Quotes eld
7925 \begin_inset Flex Code
7928 \begin_layout Plain Layout
7935 \begin_inset Quotes erd
7939 \begin_inset Newline newline
7943 \begin_inset space ~
7947 \begin_inset CommandInset ref
7949 reference "sub:Counters"
7953 for details on counters.
7956 \begin_layout Description
7957 \begin_inset Flex Code
7960 \begin_layout Plain Layout
7966 Sets the default font used to display the document.
7968 \begin_inset space ~
7972 \begin_inset CommandInset ref
7974 reference "sub:Font-description"
7978 for how to declare fonts.
7980 \begin_inset Quotes eld
7984 \begin_inset Flex Code
7987 \begin_layout Plain Layout
7994 \begin_inset Quotes erd
8000 \begin_layout Description
8001 \begin_inset Flex Code
8004 \begin_layout Plain Layout
8011 \begin_inset Flex Code
8014 \begin_layout Plain Layout
8020 Specifies a module to be included by default with this document class.
8021 The module should be specified by filename without the
8022 \begin_inset Flex Code
8025 \begin_layout Plain Layout
8032 The user can still remove the module, but it will be active at the outset.
8033 (This applies only when new files are created, or when this class is chosen
8034 for an existing document.)
8037 \begin_layout Description
8038 \begin_inset Flex Code
8041 \begin_layout Plain Layout
8048 \begin_inset Flex Code
8051 \begin_layout Plain Layout
8057 ] This is the style that will be assigned to new paragraphs, usually
8058 \begin_inset Flex MenuItem
8061 \begin_layout Plain Layout
8068 This will default to the first defined style if not given, but you are
8069 encouraged to use this directive.
8072 \begin_layout Description
8073 \begin_inset Flex Code
8076 \begin_layout Plain Layout
8083 \begin_inset Flex Code
8086 \begin_layout Plain Layout
8092 ] This tag indicates that the module in question—which should be specified
8093 by filename without the
8094 \begin_inset Flex Code
8097 \begin_layout Plain Layout
8103 extension—cannot be used with this document class.
8104 This might be used in a journal-specific layout file to prevent, say, the
8106 \begin_inset Flex Code
8109 \begin_layout Plain Layout
8115 module that numbers theorems by section.
8120 be used in a module.
8121 Modules have their own way of excluding other modules (see
8122 \begin_inset CommandInset ref
8124 reference "sub:Layout-modules"
8131 \begin_layout Description
8132 \begin_inset Flex Code
8135 \begin_layout Plain Layout
8141 Defines a new float.
8143 \begin_inset space ~
8147 \begin_inset CommandInset ref
8149 reference "sub:Floats"
8155 \begin_inset Quotes eld
8159 \begin_inset Flex Code
8162 \begin_layout Plain Layout
8169 \begin_inset Quotes erd
8175 \begin_layout Description
8176 \begin_inset Flex Code
8179 \begin_layout Plain Layout
8185 Sets the information that will be output in the
8186 \begin_inset Flex Code
8189 \begin_layout Plain Layout
8195 block when this document class is output to XHTML.
8196 Note that this will completely override any prior
8197 \begin_inset Flex Code
8200 \begin_layout Plain Layout
8207 \begin_inset Flex Code
8210 \begin_layout Plain Layout
8218 \begin_inset Flex Code
8221 \begin_layout Plain Layout
8227 if you just want to add material to the preamble.) Must end with
8228 \begin_inset Quotes eld
8232 \begin_inset Flex Code
8235 \begin_layout Plain Layout
8242 \begin_inset Quotes erd
8248 \begin_layout Description
8249 \begin_inset Flex Code
8252 \begin_layout Plain Layout
8259 \begin_inset Flex Code
8262 \begin_layout Plain Layout
8268 ] The layout to use for the table of contents, bibliography, and so forth,
8269 when the document is output to HTML.
8270 For articles, this should normally be Section; for books, Chapter.
8271 If it is not given, then LyX will attempt to figure out which layout to
8275 \begin_layout Description
8276 \begin_inset Flex Code
8279 \begin_layout Plain Layout
8286 \begin_inset Flex Code
8289 \begin_layout Plain Layout
8295 ] Modifies the properties of the given counter.
8296 If the counter does not exist, the section is ignored.
8298 \begin_inset Quotes eld
8302 \begin_inset Flex Code
8305 \begin_layout Plain Layout
8312 \begin_inset Quotes erd
8316 \begin_inset Newline newline
8320 \begin_inset space ~
8324 \begin_inset CommandInset ref
8326 reference "sub:Counters"
8330 for details on counters.
8333 \begin_layout Description
8334 \begin_inset Flex Code
8337 \begin_layout Plain Layout
8344 \begin_inset Flex Code
8347 \begin_layout Plain Layout
8353 ] Modifies the properties of the given paragraph style.
8354 If the style does not exist, the section is ignored.
8356 \begin_inset Quotes eld
8360 \begin_inset Flex Code
8363 \begin_layout Plain Layout
8370 \begin_inset Quotes erd
8376 \begin_layout Description
8377 \begin_inset Flex Code
8380 \begin_layout Plain Layout
8386 As its name implies, this command allows you to include another layout
8387 definition file within yours to avoid duplicating commands.
8388 Common examples are the standard layout files, for example,
8389 \begin_inset Flex Code
8392 \begin_layout Plain Layout
8398 , which contains most of the basic layouts.
8401 \begin_layout Description
8402 \begin_inset Flex Code
8405 \begin_layout Plain Layout
8411 This section (re-)defines the layout of an inset.
8412 It can be applied to an existing inset or to a new, user-defined inset,
8413 e.g., a new character style.
8415 \begin_inset Quotes eld
8419 \begin_inset Flex Code
8422 \begin_layout Plain Layout
8429 \begin_inset Quotes erd
8433 \begin_inset Newline newline
8437 \begin_inset space ~
8441 \begin_inset CommandInset ref
8443 reference "sub:Flex-insets-and"
8447 for more information.
8451 \begin_layout Description
8452 \begin_inset Flex Code
8455 \begin_layout Plain Layout
8462 \begin_inset Flex Code
8465 \begin_layout Plain Layout
8471 ] A string that indicates the width of the left margin on the screen, for
8473 \begin_inset Quotes eld
8477 \begin_inset Quotes erd
8481 (Note that this is not a `length', like
8482 \begin_inset Quotes eld
8486 \begin_inset Quotes erd
8492 \begin_layout Description
8493 \begin_inset Flex Code
8496 \begin_layout Plain Layout
8503 \begin_inset Flex Code
8506 \begin_layout Plain Layout
8512 ] This command deletes an existing counter, usually one defined in an included
8516 \begin_layout Description
8517 \begin_inset Flex Code
8520 \begin_layout Plain Layout
8526 This command deletes an existing float.
8527 This is particularly useful when you want to suppress a float that has
8528 been defined in an input file.
8531 \begin_layout Description
8532 \begin_inset Flex Code
8535 \begin_layout Plain Layout
8541 This command deletes an existing style.
8542 This is particularly useful when you want to suppress a style that has
8543 be defined in an input file.
8546 \begin_layout Description
8547 \begin_inset Flex Code
8550 \begin_layout Plain Layout
8556 A string indicating the file format (as defined in the Preferences dialog)
8557 produced by this class.
8558 It is mainly useful when
8559 \begin_inset Flex Code
8562 \begin_layout Plain Layout
8568 is `literate' and one wants to define a new type of literate document.
8569 This string is reset to `docbook', `latex', or `literate' when the correspondin
8571 \begin_inset Flex Code
8574 \begin_layout Plain Layout
8580 parameter is encountered.
8583 \begin_layout Description
8584 \begin_inset Flex Code
8587 \begin_layout Plain Layout
8593 A string indicating what sort of output documents using this class will
8595 At present, the options are: `docbook', `latex', and `literate'.
8598 \begin_layout Description
8599 \begin_inset Flex Code
8602 \begin_layout Plain Layout
8609 \begin_inset Flex Code
8612 \begin_layout Plain Layout
8621 \begin_inset Flex Code
8624 \begin_layout Plain Layout
8631 \begin_inset Flex Code
8634 \begin_layout Plain Layout
8640 ] The default pagestyle.
8641 Can be changed in the
8642 \begin_inset Flex MenuItem
8645 \begin_layout Plain Layout
8646 Document\SpecialChar \menuseparator
8655 \begin_layout Description
8656 \begin_inset Flex Code
8659 \begin_layout Plain Layout
8665 Sets the preamble for the LaTeX document.
8666 Note that this will completely override any prior
8667 \begin_inset Flex Code
8670 \begin_layout Plain Layout
8677 \begin_inset Flex Code
8680 \begin_layout Plain Layout
8688 \begin_inset Flex Code
8691 \begin_layout Plain Layout
8697 if you just want to add material to the preamble.) Must end with
8698 \begin_inset Quotes eld
8702 \begin_inset Flex Code
8705 \begin_layout Plain Layout
8712 \begin_inset Quotes erd
8718 \begin_layout Description
8719 \begin_inset Flex Code
8722 \begin_layout Plain Layout
8729 \begin_inset Flex Code
8732 \begin_layout Plain Layout
8739 \begin_inset Flex Code
8742 \begin_layout Plain Layout
8751 \begin_inset Flex Code
8754 \begin_layout Plain Layout
8760 ] Whether the class already provides the feature
8761 \begin_inset Flex Code
8764 \begin_layout Plain Layout
8771 A feature is in general the name of a package (
8772 \begin_inset Flex Code
8775 \begin_layout Plain Layout
8782 \begin_inset Flex Code
8785 \begin_layout Plain Layout
8791 , \SpecialChar \ldots{}
8793 \begin_inset Flex Code
8796 \begin_layout Plain Layout
8803 \begin_inset Flex Code
8806 \begin_layout Plain Layout
8812 ,\SpecialChar \ldots{}
8813 ); the complete list of supported features is unfortunately not documented
8814 outside the LyX source code—but see
8815 \begin_inset Flex Code
8818 \begin_layout Plain Layout
8824 if you're interested.
8826 \begin_inset Flex MenuItem
8829 \begin_layout Plain Layout
8830 Help\SpecialChar \menuseparator
8836 also gives an overview of the supported packages.
8839 \begin_layout Description
8840 \begin_inset Flex Code
8843 \begin_layout Plain Layout
8850 \begin_inset Flex Code
8853 \begin_layout Plain Layout
8859 ] Indicates that this layout provides the functionality of the module mentioned,
8860 which should be specified by the filename without the
8861 \begin_inset Flex Code
8864 \begin_layout Plain Layout
8871 This will typically be used if the layout includes the module directly,
8872 rather than using the
8873 \begin_inset Flex Code
8876 \begin_layout Plain Layout
8882 tag to indicate that it ought to be used.
8883 It could also be used in a module that provided an alternate implementation
8884 of the same functionality.
8887 \begin_layout Description
8888 \begin_inset Flex Code
8891 \begin_layout Plain Layout
8898 \begin_inset Flex Code
8901 \begin_layout Plain Layout
8907 ] Whether the class requires the feature
8908 \begin_inset Flex Code
8911 \begin_layout Plain Layout
8918 Multiple features must be separated by commas.
8919 Note that you can only request supported features.
8921 \begin_inset Flex Code
8924 \begin_layout Plain Layout
8930 for a list of these.)
8933 \begin_layout Description
8934 \begin_inset Flex Code
8937 \begin_layout Plain Layout
8943 A string that indicates the width of the right margin on the screen, for
8945 \begin_inset Quotes eld
8949 \begin_inset Quotes erd
8955 \begin_layout Description
8956 \begin_inset Flex Code
8959 \begin_layout Plain Layout
8965 Sets which divisions get numbered.
8967 \begin_inset Flex Code
8970 \begin_layout Plain Layout
8979 \begin_layout Description
8980 \begin_inset Flex Code
8983 \begin_layout Plain Layout
8990 \begin_inset Flex Code
8993 \begin_layout Plain Layout
9002 \begin_inset Flex Code
9005 \begin_layout Plain Layout
9011 ] Whether the class-default should be printing on one or both sides of the
9013 Can be changed in the
9014 \begin_inset Flex MenuItem
9017 \begin_layout Plain Layout
9018 Document\SpecialChar \menuseparator
9027 \begin_layout Description
9028 \begin_inset Flex Code
9031 \begin_layout Plain Layout
9037 This sequence defines a paragraph style.
9038 If the style does not yet exist, it is created; if it does exist, its parameter
9041 \begin_inset Quotes eld
9045 \begin_inset Flex Code
9048 \begin_layout Plain Layout
9055 \begin_inset Quotes erd
9059 \begin_inset Newline newline
9063 \begin_inset space ~
9067 \begin_inset CommandInset ref
9069 reference "sub:Paragraph-Styles"
9073 for details on paragraph styles.
9076 \begin_layout Description
9077 \begin_inset Flex Code
9080 \begin_layout Plain Layout
9087 \begin_inset Flex Code
9090 \begin_layout Plain Layout
9096 ] The name of the command or environment to be used with
9097 \begin_inset Flex Code
9100 \begin_layout Plain Layout
9109 \begin_layout Description
9110 \begin_inset Flex Code
9113 \begin_layout Plain Layout
9120 \begin_inset Flex Code
9123 \begin_layout Plain Layout
9132 \begin_inset Flex Code
9135 \begin_layout Plain Layout
9141 ] Indicates what kind of markup is used to define the title of a document.
9143 \begin_inset Flex Code
9146 \begin_layout Plain Layout
9152 means that the macro with name
9153 \begin_inset Flex Code
9156 \begin_layout Plain Layout
9162 will be inserted after the last layout which has
9163 \begin_inset Quotes eld
9167 \begin_inset Flex Code
9170 \begin_layout Plain Layout
9177 \begin_inset Quotes erd
9182 \begin_inset Flex Code
9185 \begin_layout Plain Layout
9191 corresponds to the case where the block of paragraphs which have
9192 \begin_inset Quotes eld
9196 \begin_inset Flex Code
9199 \begin_layout Plain Layout
9206 \begin_inset Quotes erd
9209 should be enclosed into the
9210 \begin_inset Flex Code
9213 \begin_layout Plain Layout
9222 \begin_layout Description
9223 \begin_inset Flex Code
9226 \begin_layout Plain Layout
9232 Sets which divisions are included in the table of contents.
9234 \begin_inset Flex Code
9237 \begin_layout Plain Layout
9246 \begin_layout Subsection
9247 \begin_inset Flex Code
9250 \begin_layout Plain Layout
9257 \begin_inset CommandInset label
9259 name "sub:ClassOptions"
9266 \begin_layout Standard
9268 \begin_inset Flex Code
9271 \begin_layout Plain Layout
9277 section can contain the following entries:
9280 \begin_layout Description
9281 \begin_inset Flex Code
9284 \begin_layout Plain Layout
9291 \begin_inset Flex Code
9294 \begin_layout Plain Layout
9300 ] The list of available font sizes for the document's main font, separated
9302 \begin_inset Quotes eld
9306 \begin_inset Flex Code
9309 \begin_layout Plain Layout
9316 \begin_inset Quotes erd
9322 \begin_layout Description
9323 \begin_inset Flex Code
9326 \begin_layout Plain Layout
9332 Used to set the DTD line with XML-based output classes.
9334 \begin_inset space \thinspace{}
9338 \begin_inset Quotes eld
9341 -//OASIS//DTD DocBook V4.2//EN
9342 \begin_inset Quotes erd
9348 \begin_layout Description
9349 \begin_inset Flex Code
9352 \begin_layout Plain Layout
9359 \begin_inset Flex Code
9362 \begin_layout Plain Layout
9363 string="empty|plain|headings|fancy"
9368 ] The list of available page styles, separated by
9369 \begin_inset Quotes eld
9373 \begin_inset Flex Code
9376 \begin_layout Plain Layout
9383 \begin_inset Quotes erd
9389 \begin_layout Description
9390 \begin_inset Flex Code
9393 \begin_layout Plain Layout
9400 \begin_inset Flex Code
9403 \begin_layout Plain Layout
9409 ] Some document class options, separated by a comma, that will be added
9410 to the optional part of the
9411 \begin_inset Flex Code
9414 \begin_layout Plain Layout
9425 \begin_layout Standard
9427 \begin_inset Flex Code
9430 \begin_layout Plain Layout
9436 section must end with
9437 \begin_inset Quotes eld
9441 \begin_inset Flex Code
9444 \begin_layout Plain Layout
9451 \begin_inset Quotes erd
9457 \begin_layout Subsection
9459 \begin_inset CommandInset label
9461 name "sub:Paragraph-Styles"
9468 \begin_layout Standard
9469 A paragraph style description looks like this:
9473 \begin_layout Plain Layout
9474 Note that this will either define a new style or modify an existing one.
9482 \begin_layout LyX-Code
9489 \begin_layout LyX-Code
9493 \begin_layout LyX-Code
9497 \begin_layout Standard
9498 where the following commands are allowed:
9501 \begin_layout Description
9502 \begin_inset Flex Code
9505 \begin_layout Plain Layout
9512 \begin_inset Flex Code
9515 \begin_layout Plain Layout
9520 , left, right, center
9525 ] Paragraph alignment.
9528 \begin_layout Description
9529 \begin_inset Flex Code
9532 \begin_layout Plain Layout
9539 \begin_inset Flex Code
9542 \begin_layout Plain Layout
9547 , left, right, center
9552 ] A comma separated list of permitted alignments.
9553 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9555 For example a right-aligned or centered enumeration isn't possible.)
9558 \begin_layout Description
9559 \begin_inset Flex Code
9562 \begin_layout Plain Layout
9568 Note that this will completely override any prior
9569 \begin_inset Flex Code
9572 \begin_layout Plain Layout
9578 declaration for this style.
9580 \begin_inset Quotes eld
9584 \begin_inset Flex Code
9587 \begin_layout Plain Layout
9594 \begin_inset Quotes erd
9599 \begin_inset CommandInset ref
9601 reference "sub:I18n"
9605 for details on its use.
9608 \begin_layout Description
9609 \begin_inset Flex Code
9612 \begin_layout Plain Layout
9619 \begin_inset Flex Code
9622 \begin_layout Plain Layout
9632 \begin_layout Plain Layout
9633 Note that a `float' here is a real number, such as: 1.5.
9638 The vertical space with which the last of a chain of paragraphs with this
9639 style is separated from the following paragraph.
9640 If the next paragraph has another style, the separations are not simply
9641 added, but the maximum is taken.
9644 \begin_layout Description
9645 \begin_inset Flex Code
9648 \begin_layout Plain Layout
9655 \begin_inset Flex Code
9658 \begin_layout Plain Layout
9664 The category for this style.
9665 This is used to group related styles in the style combobox on the toolbar.
9666 Any string can be used, but you may want to use existing categories with
9671 \begin_layout Description
9672 \begin_inset Flex Code
9675 \begin_layout Plain Layout
9681 Depth of XML command.
9682 Used only with XML-type formats.
9685 \begin_layout Description
9686 \begin_inset Flex Code
9689 \begin_layout Plain Layout
9696 \begin_inset CommandInset label
9698 name "des:CopyStyle"
9703 \begin_inset Flex Code
9706 \begin_layout Plain Layout
9712 Copies all the features of an existing style into the current one.
9716 \begin_layout Description
9717 \begin_inset Flex Code
9720 \begin_layout Plain Layout
9726 The name of a style whose preamble should be output
9731 This allows to ensure some ordering of the preamble snippets when macros
9732 definitions depend on one another.
9736 \begin_layout Plain Layout
9737 Note that, besides that functionality, there is no way to ensure any ordering
9739 The ordering that you see in a given version of LyX may change without
9740 warning in later versions.
9748 \begin_layout Description
9749 \begin_inset Flex Code
9752 \begin_layout Plain Layout
9759 \begin_inset Flex Code
9762 \begin_layout Plain Layout
9767 , Box, Filled_Box, Static
9772 ] The type of label that stands at the end of the paragraph (or sequence
9774 \begin_inset Flex Code
9777 \begin_layout Plain Layout
9784 \begin_inset Flex Code
9787 \begin_layout Plain Layout
9794 \begin_inset Flex Code
9797 \begin_layout Plain Layout
9804 \begin_inset Flex Code
9807 \begin_layout Plain Layout
9815 \begin_inset Flex Code
9818 \begin_layout Plain Layout
9825 \begin_inset Quotes eld
9829 \begin_inset Quotes erd
9833 \begin_inset Flex Code
9836 \begin_layout Plain Layout
9843 \begin_inset Flex Code
9846 \begin_layout Plain Layout
9847 \begin_inset space ~
9856 \begin_inset space ~
9859 black) square suitable for end of proof markers,
9860 \begin_inset Flex Code
9863 \begin_layout Plain Layout
9869 is an explicit text string.
9872 \begin_layout Description
9873 \begin_inset Flex Code
9876 \begin_layout Plain Layout
9883 \begin_inset Flex Code
9886 \begin_layout Plain Layout
9892 ] The string used for a label with a
9893 \begin_inset Flex Code
9896 \begin_layout Plain Layout
9903 \begin_inset Flex Code
9906 \begin_layout Plain Layout
9916 \begin_layout Description
9917 \begin_inset Flex Code
9920 \begin_layout Plain Layout
9926 The font used for both the text body
9932 \begin_inset space ~
9936 \begin_inset CommandInset ref
9938 reference "sub:Font-description"
9943 Note that defining this font automatically defines the
9944 \begin_inset Flex Code
9947 \begin_layout Plain Layout
9954 So you should define this one first if you also want to define
9955 \begin_inset Flex Code
9958 \begin_layout Plain Layout
9967 \begin_layout Description
9968 \begin_inset Flex Code
9971 \begin_layout Plain Layout
9978 \begin_inset CommandInset label
9980 name "des:FreeSpacing"
9985 \begin_inset Flex Code
9988 \begin_layout Plain Layout
9997 \begin_inset Flex Code
10000 \begin_layout Plain Layout
10006 ] Usually LyX doesn't allow you to insert more than one space between words,
10007 since a space is considered as the separation between two words, not a
10008 character or symbol of its own.
10009 This is a very fine thing but sometimes annoying, for example, when typing
10010 program code or plain LaTeX code.
10012 \begin_inset Flex Code
10015 \begin_layout Plain Layout
10022 Note that LyX will create protected blanks for the additional blanks when
10023 in another mode than LaTeX-mode.
10026 \begin_layout Description
10027 \begin_inset Flex Code
10030 \begin_layout Plain Layout
10036 These tags are used with XHTML output.
10038 \begin_inset CommandInset ref
10040 reference "sub:Paragraph-Style-XHTML"
10047 \begin_layout Description
10048 \begin_inset Flex Code
10051 \begin_layout Plain Layout
10057 [[FIXME]] (Used only with XML-type formats.)
10060 \begin_layout Description
10061 \begin_inset Flex Code
10064 \begin_layout Plain Layout
10071 \begin_inset Flex Code
10074 \begin_layout Plain Layout
10080 If 1, marks the style as to be included in the document preamble rather
10081 than in the document body.
10082 This is useful for document classes that want such information as the title
10083 and author to appear in the preamble.
10084 Note that this works only for styles for which the
10085 \begin_inset Flex Code
10088 \begin_layout Plain Layout
10095 \begin_inset Flex Code
10098 \begin_layout Plain Layout
10105 \begin_inset Flex Code
10108 \begin_layout Plain Layout
10117 \begin_layout Description
10118 \begin_inset Flex Code
10121 \begin_layout Plain Layout
10128 \begin_inset Flex Code
10131 \begin_layout Plain Layout
10137 If 1, marks the style as being part of a title block (see also the
10138 \begin_inset Flex Code
10141 \begin_layout Plain Layout
10148 \begin_inset Flex Code
10151 \begin_layout Plain Layout
10160 \begin_layout Description
10161 \begin_inset Flex Code
10164 \begin_layout Plain Layout
10171 \begin_inset Flex Code
10174 \begin_layout Plain Layout
10180 ] This provides extra space between paragraphs that have the same style.
10181 If you put other styles into an environment, each is separated with the
10183 \begin_inset Flex Code
10186 \begin_layout Plain Layout
10193 But the whole items of the environment are additionally separated with
10195 \begin_inset Flex Code
10198 \begin_layout Plain Layout
10205 Note that this is a
10210 \begin_layout Description
10211 \begin_inset Flex Code
10214 \begin_layout Plain Layout
10220 [[FIXME]] (Used only with XML-type formats.)
10223 \begin_layout Description
10224 \begin_inset Flex Code
10227 \begin_layout Plain Layout
10234 \begin_inset CommandInset label
10236 name "des:KeepEmpty"
10241 \begin_inset Flex Code
10244 \begin_layout Plain Layout
10253 \begin_inset Flex Code
10256 \begin_layout Plain Layout
10262 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10263 lead to empty LaTeX output.
10264 There are some cases where this could be desirable however: in a letter
10265 template, the required fields can be provided as empty fields, so that
10266 people do not forget them; in some special classes, a style can be used
10267 as some kind of break, which does not contain actual text.
10270 \begin_layout Description
10271 \begin_inset Flex Code
10274 \begin_layout Plain Layout
10280 [float=0] The vertical space between the label and the text body.
10281 Only used for labels that are above the text body (
10282 \begin_inset Flex Code
10285 \begin_layout Plain Layout
10292 \begin_inset Flex Code
10295 \begin_layout Plain Layout
10296 Centered_Top_Environment
10304 \begin_layout Description
10305 \begin_inset Flex Code
10308 \begin_layout Plain Layout
10315 \begin_inset Flex Code
10318 \begin_layout Plain Layout
10325 \begin_inset Newline newline
10328 The name of the counter for automatic numbering.
10330 \begin_inset Newline newline
10338 \begin_inset Flex Code
10341 \begin_layout Plain Layout
10348 \begin_inset Flex Code
10351 \begin_layout Plain Layout
10358 In that case, the counter will be stepped each time the style appears.
10360 \begin_inset Newline newline
10368 \begin_inset Flex Code
10371 \begin_layout Plain Layout
10378 \begin_inset Flex Code
10381 \begin_layout Plain Layout
10387 , though this case is a bit complicated.
10388 Suppose you declare
10389 \begin_inset Quotes eld
10393 \begin_inset Flex Code
10396 \begin_layout Plain Layout
10397 LabelCounter myenum
10403 \begin_inset Quotes erd
10407 Then the actual counters used are
10408 \begin_inset Flex Code
10411 \begin_layout Plain Layout
10418 \begin_inset Flex Code
10421 \begin_layout Plain Layout
10428 \begin_inset Flex Code
10431 \begin_layout Plain Layout
10438 \begin_inset Flex Code
10441 \begin_layout Plain Layout
10447 , much as in LaTeX.
10448 These counters must all be declared separately.
10449 \begin_inset Newline newline
10453 \begin_inset CommandInset ref
10455 reference "sub:Counters"
10459 for details on counters.
10462 \begin_layout Description
10463 \begin_inset Flex Code
10466 \begin_layout Plain Layout
10472 The font used for the label.
10474 \begin_inset space ~
10478 \begin_inset CommandInset ref
10480 reference "sub:Font-description"
10487 \begin_layout Description
10488 \begin_inset Flex Code
10491 \begin_layout Plain Layout
10497 Text that indicates how far a label should be indented.
10500 \begin_layout Description
10501 \begin_inset Flex Code
10504 \begin_layout Plain Layout
10511 \begin_inset Flex Code
10514 \begin_layout Plain Layout
10520 ] The horizontal space between the label and the text body.
10521 Only used for labels that are not above the text body.
10524 \begin_layout Description
10525 \begin_inset Flex Code
10528 \begin_layout Plain Layout
10535 \begin_inset Flex Code
10538 \begin_layout Plain Layout
10544 ] The string used for a label with a
10545 \begin_inset Flex Code
10548 \begin_layout Plain Layout
10556 \begin_inset Flex Code
10559 \begin_layout Plain Layout
10565 is set, this string can be contain the special formatting commands described
10567 \begin_inset CommandInset ref
10569 reference "sub:Counters"
10577 \begin_layout Plain Layout
10578 For the sake of backwards compatibility, the string
10579 \begin_inset Flex Code
10582 \begin_layout Plain Layout
10592 will be replaced by the expanded
10593 \begin_inset Flex Code
10596 \begin_layout Plain Layout
10603 \begin_inset Flex Code
10606 \begin_layout Plain Layout
10615 This feature is now obsolete and should be replaced by the mechanisms of
10617 \begin_inset CommandInset ref
10619 reference "sub:Counters"
10631 \begin_layout Description
10632 \begin_inset Flex Code
10635 \begin_layout Plain Layout
10636 LabelStringAppendix
10642 \begin_inset Flex Code
10645 \begin_layout Plain Layout
10651 ] This is used inside the appendix instead of
10652 \begin_inset Flex Code
10655 \begin_layout Plain Layout
10663 \begin_inset Flex Code
10666 \begin_layout Plain Layout
10673 \begin_inset Flex Code
10676 \begin_layout Plain Layout
10677 LabelStringAppendix
10685 \begin_layout Description
10686 \begin_inset Flex Code
10689 \begin_layout Plain Layout
10695 [FIXME] (Used only with XML-type formats.)
10698 \begin_layout Description
10699 \begin_inset Flex Code
10702 \begin_layout Plain Layout
10709 \begin_inset Flex Code
10712 \begin_layout Plain Layout
10717 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10718 Enumerate, Itemize, Bibliography
10727 \begin_layout Itemize
10728 \begin_inset Flex Code
10731 \begin_layout Plain Layout
10737 means the label is the very first word (up to the first real blank).
10738 Use protected spaces (like
10739 \begin_inset space ~
10742 that one) if you want more than one word as the label.
10746 \begin_layout Itemize
10747 \begin_inset Flex Code
10750 \begin_layout Plain Layout
10756 means the label is simply whatever
10757 \begin_inset Flex Code
10760 \begin_layout Plain Layout
10767 Note that this really is `static'.
10770 \begin_layout Itemize
10771 \begin_inset Flex Code
10774 \begin_layout Plain Layout
10781 \begin_inset Flex Code
10784 \begin_layout Plain Layout
10785 Centered_Top_Environment
10790 are special cases of
10791 \begin_inset Flex Code
10794 \begin_layout Plain Layout
10801 The label will be printed above the paragraph, but only at the top of an
10802 environment or the top of a chain of paragraphs with this style.
10803 This might be used with the
10804 \begin_inset Flex MenuItem
10807 \begin_layout Plain Layout
10813 style, for example.
10816 \begin_layout Itemize
10817 \begin_inset Flex Code
10820 \begin_layout Plain Layout
10826 is a special case for the caption-labels
10827 \begin_inset Quotes eld
10831 \begin_inset Quotes erd
10835 \begin_inset Quotes eld
10839 \begin_inset Quotes erd
10844 \begin_inset Flex Code
10847 \begin_layout Plain Layout
10853 means the (hardcoded) label string depends on the kind of float: It is
10854 hardcoded to be `FloatType N', where N is the value of the counter associated
10858 \begin_layout Itemize
10860 \begin_inset Flex Code
10863 \begin_layout Plain Layout
10869 label type defines automatically numbered labels.
10871 \begin_inset Flex Code
10874 \begin_layout Plain Layout
10880 will be expanded to resolve any counter references it contains: For example,
10882 \begin_inset Quotes eld
10886 \begin_inset Flex Code
10889 \begin_layout Plain Layout
10900 \begin_inset Quotes erd
10905 \begin_inset CommandInset ref
10907 reference "sub:Counters"
10911 for more information on counters.
10914 \begin_layout Itemize
10915 \begin_inset Flex Code
10918 \begin_layout Plain Layout
10924 produces the usual sort of enumeration labels.
10925 At present, it is hardcoded to use Arabic numerals, lowercase letters,
10926 small Roman numerals, and uppercase letters for the four possible depths.
10929 \begin_layout Itemize
10930 \begin_inset Flex Code
10933 \begin_layout Plain Layout
10939 produces various bullets at the different levels.
10940 It is also hardcoded.
10943 \begin_layout Itemize
10944 \begin_inset Flex Code
10947 \begin_layout Plain Layout
10953 is used internally by LyX and should be used only with
10954 \begin_inset Flex Code
10957 \begin_layout Plain Layout
10958 LatexType BibEnvironment
10967 \begin_layout Description
10968 \begin_inset Flex Code
10971 \begin_layout Plain Layout
10977 Note that this will completely override any prior
10978 \begin_inset Flex Code
10981 \begin_layout Plain Layout
10987 declaration for this style.
10989 \begin_inset Quotes eld
10993 \begin_inset Flex Code
10996 \begin_layout Plain Layout
11003 \begin_inset Quotes erd
11008 \begin_inset CommandInset ref
11010 reference "sub:I18n"
11014 for details on its use.
11017 \begin_layout Description
11018 \begin_inset Flex Code
11021 \begin_layout Plain Layout
11027 The name of the corresponding LaTeX stuff.
11028 Either the environment or command name.
11031 \begin_layout Description
11032 \begin_inset Flex Code
11035 \begin_layout Plain Layout
11041 An optional parameter for the corresponding
11042 \begin_inset Flex Code
11045 \begin_layout Plain Layout
11052 This parameter cannot be changed from within LyX.
11055 \begin_layout Description
11056 \begin_inset Flex Code
11059 \begin_layout Plain Layout
11066 \begin_inset CommandInset label
11068 name "des:LatexType"
11073 \begin_inset Flex Code
11076 \begin_layout Plain Layout
11081 , Command, Environment, Item_Environment,
11087 \begin_inset Flex Code
11090 \begin_layout Plain Layout
11091 List_Environment, Bib_Environment
11096 ] How the style should be translated into LaTeX.
11100 \begin_layout Plain Layout
11101 \begin_inset Flex Code
11104 \begin_layout Plain Layout
11110 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11111 Visit the SGML class files for specific examples.
11120 \begin_layout Itemize
11121 \begin_inset Flex Code
11124 \begin_layout Plain Layout
11130 means nothing special.
11134 \begin_layout Itemize
11135 \begin_inset Flex Code
11138 \begin_layout Plain Layout
11145 \begin_inset Flex Code
11148 \begin_layout Plain Layout
11155 {\SpecialChar \ldots{}
11164 \begin_layout Itemize
11165 \begin_inset Flex Code
11168 \begin_layout Plain Layout
11175 \begin_inset Flex Code
11178 \begin_layout Plain Layout
11185 }\SpecialChar \ldots{}
11201 \begin_layout Itemize
11202 \begin_inset Flex Code
11205 \begin_layout Plain Layout
11212 \begin_inset Flex Code
11215 \begin_layout Plain Layout
11222 \begin_inset Flex Code
11225 \begin_layout Plain Layout
11233 is generated for each paragraph of this environment.
11237 \begin_layout Itemize
11238 \begin_inset Flex Code
11241 \begin_layout Plain Layout
11248 \begin_inset Flex Code
11251 \begin_layout Plain Layout
11258 \begin_inset Flex Code
11261 \begin_layout Plain Layout
11267 is passed as an argument to the environment.
11269 \begin_inset Flex Code
11272 \begin_layout Plain Layout
11278 can be defined in the
11279 \begin_inset Flex MenuItem
11282 \begin_layout Plain Layout
11287 \SpecialChar \menuseparator
11293 \begin_inset space ~
11305 \begin_layout Standard
11306 Putting the last few things together, the LaTeX output will be either:
11309 \begin_layout LyX-Code
11312 latexname[latexparam]{\SpecialChar \ldots{}
11316 \begin_layout Standard
11320 \begin_layout LyX-Code
11323 begin{latexname}[latexparam] \SpecialChar \ldots{}
11329 \begin_layout Standard
11330 depending upon the LaTeX type.
11334 \begin_layout Description
11335 \begin_inset Flex Code
11338 \begin_layout Plain Layout
11345 \begin_inset Flex Code
11348 \begin_layout Plain Layout
11354 ] If you put styles into environments, the leftmargins are not simply added,
11355 but added with a factor
11356 \begin_inset Formula $\frac{4}{depth+4}$
11360 Note that this parameter is also used when the margin is defined as
11361 \begin_inset Flex Code
11364 \begin_layout Plain Layout
11371 \begin_inset Flex Code
11374 \begin_layout Plain Layout
11381 Then it is added to the manual or dynamic margin.
11383 \begin_inset Newline newline
11386 The argument is passed as a string.
11388 \begin_inset Quotes eld
11392 \begin_inset Flex Code
11395 \begin_layout Plain Layout
11402 \begin_inset Quotes erd
11405 means that the paragraph is indented with the width of
11406 \begin_inset Quotes eld
11410 \begin_inset Flex Code
11413 \begin_layout Plain Layout
11420 \begin_inset Quotes erd
11423 in the normal font.
11424 You can get a negative width by prefixing the string with
11425 \begin_inset Quotes eld
11429 \begin_inset Flex Code
11432 \begin_layout Plain Layout
11439 \begin_inset Quotes erd
11443 This way was chosen so that the look is the same with each used screen
11448 \begin_layout Description
11449 \begin_inset Flex Code
11452 \begin_layout Plain Layout
11459 \begin_inset Flex Code
11462 \begin_layout Plain Layout
11467 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11473 \begin_inset Newline newline
11476 The kind of margin that the style has on the left side.
11478 \begin_inset Flex Code
11481 \begin_layout Plain Layout
11487 just means a fixed margin.
11489 \begin_inset Flex Code
11492 \begin_layout Plain Layout
11498 means that the left margin depends on the string entered in the
11499 \begin_inset Flex MenuItem
11502 \begin_layout Plain Layout
11503 Edit\SpecialChar \menuseparator
11505 \begin_inset space ~
11514 This is used to typeset nice lists without tabulators.
11516 \begin_inset Flex Code
11519 \begin_layout Plain Layout
11525 means that the margin depends on the size of the label.
11526 This is used for automatic enumerated headlines.
11527 It is obvious that the headline
11528 \begin_inset Quotes eld
11531 5.4.3.2.1 Very long headline
11532 \begin_inset Quotes erd
11535 must have a wider left margin (as wide as
11536 \begin_inset Quotes eld
11540 \begin_inset Quotes erd
11543 plus the space) than
11544 \begin_inset Quotes eld
11547 3.2 Very long headline
11548 \begin_inset Quotes erd
11552 \begin_inset Quotes eld
11556 \begin_inset Quotes erd
11559 are not able to do this.
11561 \begin_inset Flex Code
11564 \begin_layout Plain Layout
11570 is similar, but only the very first row of the paragraph is dynamic, while
11571 the others are static; this is used, for example, for descriptions.
11573 \begin_inset Flex Code
11576 \begin_layout Plain Layout
11582 means the margin is chosen in a way that the longest row of this paragraph
11583 fits to the right margin.
11584 This is used to typeset an address on the right edge of the page.
11587 \begin_layout Description
11588 \begin_inset Flex Code
11591 \begin_layout Plain Layout
11598 \begin_inset Flex Code
11601 \begin_layout Plain Layout
11610 \begin_inset Flex Code
11613 \begin_layout Plain Layout
11619 ] Whether fragile commands in this style should be
11620 \begin_inset Flex Code
11623 \begin_layout Plain Layout
11636 whether this command should itself be protected.)
11639 \begin_layout Description
11640 \begin_inset Flex Code
11643 \begin_layout Plain Layout
11650 \begin_inset Flex Code
11653 \begin_layout Plain Layout
11660 \begin_inset Flex Code
11663 \begin_layout Plain Layout
11671 ] Whether newlines are translated into LaTeX newlines (
11672 \begin_inset Flex Code
11675 \begin_layout Plain Layout
11686 The translation can be switched off to allow more comfortable LaTeX editing
11690 \begin_layout Description
11691 \begin_inset Flex Code
11694 \begin_layout Plain Layout
11701 \begin_inset Flex Code
11704 \begin_layout Plain Layout
11711 \begin_inset Flex Code
11714 \begin_layout Plain Layout
11722 ] Whether the following Paragraph is allowed to indent its very first row.
11724 \begin_inset Flex Code
11727 \begin_layout Plain Layout
11733 means that it is not allowed to do so;
11734 \begin_inset Flex Code
11737 \begin_layout Plain Layout
11743 means it could do so if it wants to.
11746 \begin_layout Description
11747 \begin_inset Flex Code
11750 \begin_layout Plain Layout
11756 Name of a style that has replaced this style.
11757 This is used to rename a style, while keeping backward compatibility.
11760 \begin_layout Description
11761 \begin_inset Flex Code
11764 \begin_layout Plain Layout
11771 \begin_inset Flex Code
11774 \begin_layout Plain Layout
11780 ] The number of optional arguments that can be used with this style.
11781 This is useful for things like section headings, and only makes sense with
11783 Note that, on output, the optional arguments will all precede any required
11784 arguments (see below).
11785 So one can have constructs like:
11789 \begin_layout LyX-Code
11792 mycmd[opt1]{req1}{contents of paragraph}
11795 \begin_layout Standard
11796 but one cannot have things like:
11799 \begin_layout LyX-Code
11802 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11805 \begin_layout Standard
11806 at least, not without ERT (with which you can have anything).
11811 \begin_layout Description
11812 \begin_inset Flex Code
11815 \begin_layout Plain Layout
11822 \begin_inset CommandInset label
11824 name "des:ParbreakIsNewline"
11829 \begin_inset Flex Code
11832 \begin_layout Plain Layout
11841 \begin_inset Flex Code
11844 \begin_layout Plain Layout
11850 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
11851 output, but only by a line break; together with
11852 \begin_inset Flex Code
11855 \begin_layout Plain Layout
11861 , this allows to emulate a plain text editor (like the ERT inset).
11864 \begin_layout Description
11865 \begin_inset Flex Code
11868 \begin_layout Plain Layout
11875 \begin_inset Flex Code
11878 \begin_layout Plain Layout
11884 ] The indent of the very first line of a paragraph.
11886 \begin_inset Flex Code
11889 \begin_layout Plain Layout
11895 will be fixed for a certain style.
11896 The exception is the default style, since the indentation for these paragraphs
11897 can be prohibited with
11898 \begin_inset Flex Code
11901 \begin_layout Plain Layout
11909 \begin_inset Flex Code
11912 \begin_layout Plain Layout
11918 style paragraphs inside environments use the
11919 \begin_inset Flex Code
11922 \begin_layout Plain Layout
11928 of the environment, not their native one.
11930 \begin_inset Flex Code
11933 \begin_layout Plain Layout
11939 paragraphs inside an enumeration are not indented.
11942 \begin_layout Description
11943 \begin_inset Flex Code
11946 \begin_layout Plain Layout
11953 \begin_inset Flex Code
11956 \begin_layout Plain Layout
11962 ] The vertical space between two paragraphs of this style.
11965 \begin_layout Description
11966 \begin_inset Flex Code
11969 \begin_layout Plain Layout
11976 \begin_inset Flex Code
11979 \begin_layout Plain Layout
11985 ] LyX allows the user to choose either
11986 \begin_inset Quotes eld
11990 \begin_inset Quotes erd
11994 \begin_inset Quotes eld
11998 \begin_inset Quotes erd
12001 to typeset a document.
12003 \begin_inset Quotes eld
12007 \begin_inset Quotes erd
12010 is chosen, this value is completely ignored.
12012 \begin_inset Quotes eld
12016 \begin_inset Quotes erd
12019 is chosen, the parindent of a LaTeXtype
12020 \begin_inset Quotes eld
12024 \begin_inset Quotes erd
12027 style is ignored and all paragraphs are separated by this parskip argument.
12028 The vertical space is calculated with
12029 \begin_inset Flex Code
12032 \begin_layout Plain Layout
12034 \begin_inset space ~
12043 \begin_inset Flex Code
12046 \begin_layout Plain Layout
12052 is the height of a row with the normal font.
12053 This way, the look stays the same with different screen fonts.
12056 \begin_layout Description
12057 \begin_inset Flex Code
12060 \begin_layout Plain Layout
12067 \begin_inset CommandInset label
12069 name "des:PassThru"
12074 \begin_inset Flex Code
12077 \begin_layout Plain Layout
12086 \begin_inset Flex Code
12089 \begin_layout Plain Layout
12095 ] Whether the contents of this paragraph should be output in raw form, meaning
12096 without special translations that LaTeX would require.
12099 \begin_layout Description
12100 \begin_inset Flex Code
12103 \begin_layout Plain Layout
12110 \begin_inset CommandInset label
12112 name "des:Preamble"
12116 Information to be included in the LaTeX preamble when this style is used.
12117 Used to define macros, load packages, etc., required by this particular
12120 \begin_inset Quotes eld
12124 \begin_inset Flex Code
12127 \begin_layout Plain Layout
12134 \begin_inset Quotes erd
12140 \begin_layout Description
12141 \begin_inset Flex Code
12144 \begin_layout Plain Layout
12151 \begin_inset Flex Code
12154 \begin_layout Plain Layout
12160 ] The prefix to use when creating labels referring to paragraphs of this
12162 This allows the use of formatted references.
12165 \begin_layout Description
12166 \begin_inset Flex Code
12169 \begin_layout Plain Layout
12176 \begin_inset Flex Code
12179 \begin_layout Plain Layout
12185 ] The number of required arguments that the LaTeX command or environment
12186 corresponding to this style expects.
12187 In the case of a command, these are required arguments
12191 that associated with the content of the paragraph itself.
12192 These do not actually have to be provided: LyX will output empty arguments
12194 Note that optional arguments will be output before required arguments.
12195 See the discussion of the
12196 \begin_inset Flex Code
12199 \begin_layout Plain Layout
12205 tag above for more information.
12208 \begin_layout Description
12209 \begin_inset Flex Code
12212 \begin_layout Plain Layout
12219 \begin_inset Flex Code
12222 \begin_layout Plain Layout
12229 \begin_inset CommandInset label
12231 name "des:Requires"
12235 Whether the style requires the feature
12236 \begin_inset Flex Code
12239 \begin_layout Plain Layout
12246 See the description of
12247 \begin_inset Flex Code
12250 \begin_layout Plain Layout
12257 \begin_inset CommandInset ref
12258 LatexCommand pageref
12259 reference "des:FreeSpacing"
12263 ) for information on `features'.
12267 \begin_layout Description
12268 \begin_inset Flex Code
12271 \begin_layout Plain Layout
12278 \begin_inset Flex Code
12281 \begin_layout Plain Layout
12288 \begin_inset Flex Code
12291 \begin_layout Plain Layout
12300 \begin_layout Description
12301 \begin_inset Flex Code
12304 \begin_layout Plain Layout
12311 \begin_inset Flex Code
12314 \begin_layout Plain Layout
12319 , onehalf, double, other
12328 ] This defines what the default spacing should be in the style.
12330 \begin_inset Flex Code
12333 \begin_layout Plain Layout
12340 \begin_inset Flex Code
12343 \begin_layout Plain Layout
12350 \begin_inset Flex Code
12353 \begin_layout Plain Layout
12359 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12360 If you specify the argument
12361 \begin_inset Flex Code
12364 \begin_layout Plain Layout
12370 , then you should also provide a numerical argument which will be the actual
12372 Note that, contrary to other parameters,
12373 \begin_inset Flex Code
12376 \begin_layout Plain Layout
12382 implies the generation of specific LaTeX code, using the package
12385 \begin_inset Flex Code
12388 \begin_layout Plain Layout
12397 \begin_layout Description
12398 \begin_inset Flex Code
12401 \begin_layout Plain Layout
12408 \begin_inset Flex Code
12411 \begin_layout Plain Layout
12418 \begin_inset Flex Code
12421 \begin_layout Plain Layout
12429 ] Spellcheck paragraphs of this style.
12433 \begin_layout Description
12434 \begin_inset Flex Code
12437 \begin_layout Plain Layout
12443 The font used for the text body .
12445 \begin_inset CommandInset ref
12447 reference "sub:Font-description"
12454 \begin_layout Description
12455 \begin_inset Flex Code
12458 \begin_layout Plain Layout
12467 \begin_inset Flex Code
12470 \begin_layout Plain Layout
12480 The level of the style in the table of contents.
12481 This is used for automatic numbering of section headings.
12484 \begin_layout Description
12485 \begin_inset Flex Code
12488 \begin_layout Plain Layout
12495 \begin_inset Flex Code
12498 \begin_layout Plain Layout
12504 ] The vertical space with which the very first of a chain of paragraphs
12505 with this style is separated from the previous paragraph.
12506 If the previous paragraph has another style, the separations are not simply
12507 added, but the maximum is taken.
12510 \begin_layout Subsection
12511 \begin_inset CommandInset label
12517 Internationalization of Paragraph Styles
12520 \begin_layout Standard
12521 LyX has long supported internationalization of layout information, but,
12522 until version 2.0, this applied only to the user interface and not to, say,
12524 Thus, French authors were forced to resort to ugly hacks if they wanted
12529 1' instead of `Theorem 1'.
12530 Thanks to Georg Baum, that is no longer the case.
12533 \begin_layout Standard
12535 \begin_inset Flex Code
12538 \begin_layout Plain Layout
12544 defines text that is to appear in the typeset document, it may use
12545 \begin_inset Flex Code
12548 \begin_layout Plain Layout
12555 \begin_inset Flex Code
12558 \begin_layout Plain Layout
12564 to support non-English and even multi-language documents correctly.
12565 The following excerpt (from the
12566 \begin_inset Flex Code
12569 \begin_layout Plain Layout
12575 file) shows how this works:
12578 \begin_layout LyX-Code
12583 \begin_layout LyX-Code
12586 theoremstyle{remark}
12589 \begin_layout LyX-Code
12592 newtheorem{claim}[thm]{
12599 \begin_layout LyX-Code
12603 \begin_layout LyX-Code
12607 \begin_layout LyX-Code
12612 claimname}{_(Claim)}
12615 \begin_layout LyX-Code
12619 \begin_layout LyX-Code
12623 \begin_layout LyX-Code
12632 claimname}{_(Claim)}}
12635 \begin_layout LyX-Code
12640 \begin_layout Standard
12641 In principle, any legal LaTeX may appear in the
12642 \begin_inset Flex Code
12645 \begin_layout Plain Layout
12652 \begin_inset Flex Code
12655 \begin_layout Plain Layout
12661 tags, but in practice they will typically look as they do here.
12662 The key to correct translation of the typeset text is the definition of
12664 \begin_inset Flex Code
12667 \begin_layout Plain Layout
12676 \begin_inset Flex Code
12679 \begin_layout Plain Layout
12691 \begin_layout Standard
12693 \begin_inset Flex Code
12696 \begin_layout Plain Layout
12702 tag provides for internationalization based upon the overall language of
12704 The contents of the tag will be included in the preamble, just as with
12706 \begin_inset Flex Code
12709 \begin_layout Plain Layout
12716 What makes it special is the use of the
12717 \begin_inset Quotes eld
12721 \begin_inset Quotes erd
12725 \begin_inset Flex Code
12728 \begin_layout Plain Layout
12734 , which will be replaced, when LyX produces LaTeX output, with the translation
12735 of its argument into the document language.
12738 \begin_layout Standard
12740 \begin_inset Flex Code
12743 \begin_layout Plain Layout
12749 tag is more complex, since it is meant to provide support for multi-language
12750 documents and so offers an interface to the
12751 \begin_inset Flex Code
12754 \begin_layout Plain Layout
12761 Its contents will be added to the preamble once for each language that
12762 appears in the document.
12763 In this case, the argument to
12764 \begin_inset Flex Code
12767 \begin_layout Plain Layout
12773 will be replaced with its translation into the language in question; the
12775 \begin_inset Flex Code
12778 \begin_layout Plain Layout
12784 is replaced by the language name (as used by the babel package).
12787 \begin_layout Standard
12788 A German document that also included a French section would thus have the
12789 following in the preamble:
12792 \begin_layout LyX-Code
12801 claimname}{Affirmation}}
12809 claimname}{Behauptung}}
12813 claimname}{Behauptung}
12816 \begin_layout Standard
12818 \begin_inset Flex Code
12821 \begin_layout Plain Layout
12827 will then conspire to produce the correct text in the output.
12830 \begin_layout Standard
12831 One important point to note here is that the translations are provided by
12832 LyX itself, through the same mechanism it uses for internationalization
12833 of the user interface.
12834 This means, in effect, that
12835 \begin_inset Flex Code
12838 \begin_layout Plain Layout
12845 \begin_inset Flex Code
12848 \begin_layout Plain Layout
12854 are really only of use in layout files that are provided with LyX, since
12855 text entered in user-created layout files will not be seen by LyX's internation
12856 alization routines.
12857 That said, however, any layout created with the intention that it will
12858 be included with LyX should use these tags where appropriate.
12861 \begin_layout Subsection
12863 \begin_inset CommandInset label
12872 \begin_layout Standard
12873 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12874 define the floats (
12875 \begin_inset Flex MenuItem
12878 \begin_layout Plain Layout
12885 \begin_inset Flex MenuItem
12888 \begin_layout Plain Layout
12894 , \SpecialChar \ldots{}
12895 ) in the text class itself.
12896 Standard floats are included in the file
12897 \begin_inset Flex Code
12900 \begin_layout Plain Layout
12906 , so you may have to do no more than add
12909 \begin_layout LyX-Code
12910 Input stdfloats.inc
12913 \begin_layout Standard
12914 to your layout file.
12915 If you want to implement a text class that proposes some other float types
12916 (like the AGU class bundled with LyX), the information below will hopefully
12920 \begin_layout Description
12921 \begin_inset Flex Code
12924 \begin_layout Plain Layout
12931 \begin_inset Flex Code
12934 \begin_layout Plain Layout
12941 \begin_inset Quotes erd
12945 \begin_inset Quotes erd
12948 ] The file name extension of an auxiliary file for the list of figures (or
12950 LaTeX writes the captions to this file.
12953 \begin_layout Description
12954 \begin_inset Flex Code
12957 \begin_layout Plain Layout
12964 \begin_inset Flex Code
12967 \begin_layout Plain Layout
12974 \begin_inset Quotes erd
12978 \begin_inset Quotes erd
12981 ] The string that will be used in the menus and also for the caption.
12982 This is translated to the current language if babel is used.
12985 \begin_layout Description
12986 \begin_inset Flex Code
12989 \begin_layout Plain Layout
12995 These are used for XHTML output.
12997 \begin_inset CommandInset ref
12999 reference "sec:Tags-for-XHTML"
13006 \begin_layout Description
13007 \begin_inset Flex Code
13010 \begin_layout Plain Layout
13019 \begin_inset Flex Code
13022 \begin_layout Plain Layout
13031 \begin_inset Flex Code
13034 \begin_layout Plain Layout
13040 ] Indicates whether the float is already defined in the document class or
13041 if we instead need to load
13042 \begin_inset Flex Code
13045 \begin_layout Plain Layout
13051 and use what it provides to define it on-the-fly.
13053 \begin_inset Flex Code
13056 \begin_layout Plain Layout
13063 \begin_inset Flex Code
13066 \begin_layout Plain Layout
13073 It should be set to
13074 \begin_inset Flex Code
13077 \begin_layout Plain Layout
13083 if the float is already defined by the LaTeX document class.
13086 \begin_layout Description
13087 \begin_inset Flex Code
13090 \begin_layout Plain Layout
13097 \begin_inset Flex Code
13100 \begin_layout Plain Layout
13107 \begin_inset Quotes erd
13111 \begin_inset Quotes erd
13114 ] The command used to generate a list of floats of this type; the leading
13117 ' should be omitted.
13123 \begin_inset Flex Code
13126 \begin_layout Plain Layout
13132 is false, since there is no standard way to generate this command.
13134 \begin_inset Flex Code
13137 \begin_layout Plain Layout
13143 is true, since in that case there is a standard way to define the command.
13146 \begin_layout Description
13147 \begin_inset Flex Code
13150 \begin_layout Plain Layout
13157 \begin_inset Flex Code
13160 \begin_layout Plain Layout
13167 \begin_inset Quotes erd
13171 \begin_inset Quotes erd
13174 ] A title for a list of floats of this kind (list of figures, tables, or
13176 It is used for the screen label within LyX; it is passed to LaTeX for use
13177 as the title there; and it is used as the title in XHTML output.
13178 It will be translated to the document language.
13181 \begin_layout Description
13182 \begin_inset Flex Code
13185 \begin_layout Plain Layout
13192 \begin_inset Flex Code
13195 \begin_layout Plain Layout
13202 \begin_inset Quotes erd
13206 \begin_inset Quotes erd
13209 ] This (optional) argument determines whether floats of this class will
13210 be numbered within some sectional unit of the document.
13211 For example, if within is equal to
13212 \begin_inset Flex Code
13215 \begin_layout Plain Layout
13221 , the floats will be numbered within chapters.
13225 \begin_layout Description
13226 \begin_inset Flex Code
13229 \begin_layout Plain Layout
13236 \begin_inset Flex Code
13239 \begin_layout Plain Layout
13246 \begin_inset Quotes erd
13250 \begin_inset Quotes erd
13253 ] The default placement for the given class of floats.
13254 The string should be as in standard LaTeX:
13255 \begin_inset Flex Code
13258 \begin_layout Plain Layout
13265 \begin_inset Flex Code
13268 \begin_layout Plain Layout
13275 \begin_inset Flex Code
13278 \begin_layout Plain Layout
13285 \begin_inset Flex Code
13288 \begin_layout Plain Layout
13294 for top, bottom, page, and here, respectively.
13298 \begin_layout Plain Layout
13299 Note that the order of these letters in the string is irrelevant, like in
13305 On top of that there is a new type,
13306 \begin_inset Flex Code
13309 \begin_layout Plain Layout
13315 , which does not really correspond to a float, since it means: put it
13316 \begin_inset Quotes eld
13320 \begin_inset Quotes erd
13324 Note however that the
13325 \begin_inset Flex Code
13328 \begin_layout Plain Layout
13334 specifier is special and, because of implementation details, cannot be
13335 used in non-built in float types.
13336 If you do not understand what this means, just use
13337 \begin_inset Quotes eld
13341 \begin_inset Flex Code
13344 \begin_layout Plain Layout
13351 \begin_inset Quotes erd
13357 \begin_layout Description
13358 \begin_inset Flex Code
13361 \begin_layout Plain Layout
13368 \begin_inset Flex Code
13371 \begin_layout Plain Layout
13377 ] The prefix to use when creating labels referring to floats of this type.
13378 This allows the use of formatted references.
13379 Note that you can remove any
13380 \begin_inset Flex Code
13383 \begin_layout Plain Layout
13389 set by a copied style by using the special value
13390 \begin_inset Quotes eld
13394 \begin_inset Quotes erd
13397 , which must be all caps.
13400 \begin_layout Description
13401 \begin_inset Flex Code
13404 \begin_layout Plain Layout
13411 \begin_inset Flex Code
13414 \begin_layout Plain Layout
13421 \begin_inset Quotes erd
13425 \begin_inset Quotes erd
13428 ] The style used when defining the float using
13429 \begin_inset Flex Code
13432 \begin_layout Plain Layout
13443 \begin_layout Description
13444 \begin_inset Flex Code
13447 \begin_layout Plain Layout
13454 \begin_inset Flex Code
13457 \begin_layout Plain Layout
13464 \begin_inset Quotes erd
13468 \begin_inset Quotes erd
13472 \begin_inset Quotes eld
13476 \begin_inset Quotes erd
13479 of the new class of floats, like program or algorithm.
13480 After the appropriate
13481 \begin_inset Flex Code
13484 \begin_layout Plain Layout
13493 \begin_inset Flex Code
13496 \begin_layout Plain Layout
13505 \begin_inset Flex Code
13508 \begin_layout Plain Layout
13519 \begin_layout Description
13520 \begin_inset Flex Code
13523 \begin_layout Plain Layout
13530 \begin_inset Flex Code
13533 \begin_layout Plain Layout
13540 \begin_inset Flex Code
13543 \begin_layout Plain Layout
13551 ] Tells us whether this float is defined using the facilities provided by
13553 \begin_inset Flex Code
13556 \begin_layout Plain Layout
13562 , either by the class file or a package, or on-the-fly by LyX itself.
13565 \begin_layout Standard
13566 Note that defining a float with type
13567 \begin_inset Flex Code
13570 \begin_layout Plain Layout
13578 automatically defines the corresponding counter with name
13579 \begin_inset Flex Code
13582 \begin_layout Plain Layout
13593 \begin_layout Subsection
13594 Flex insets and InsetLayout
13595 \begin_inset CommandInset label
13597 name "sub:Flex-insets-and"
13604 \begin_layout Standard
13605 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13606 these are called Flex insets.
13610 \begin_layout Standard
13611 Flex insets come in three different kinds:
13614 \begin_layout Itemize
13616 \begin_inset Flex Code
13619 \begin_layout Plain Layout
13625 ): These define semantic markup corresponding to such LaTeX commands as
13627 \begin_inset Flex Code
13630 \begin_layout Plain Layout
13639 \begin_inset Flex Code
13642 \begin_layout Plain Layout
13653 \begin_layout Itemize
13655 \begin_inset Flex Code
13658 \begin_layout Plain Layout
13664 ): These can be used to define custom collapsible insets, similar to TeX
13665 code, footnote, and the like.
13666 An obvious example is an endnote inset, which is defined in the
13667 \begin_inset Flex Code
13670 \begin_layout Plain Layout
13679 \begin_layout Itemize
13681 \begin_inset Flex Code
13684 \begin_layout Plain Layout
13690 ): For use with DocBook classes.
13693 \begin_layout Standard
13694 Flex insets are defined using the
13695 \begin_inset Flex Code
13698 \begin_layout Plain Layout
13704 tag, which shall be explained in a moment.
13707 \begin_layout Standard
13709 \begin_inset Flex Code
13712 \begin_layout Plain Layout
13718 tag also serves another function: It can be used to customize the general
13719 layout of many different types of insets.
13721 \begin_inset Flex Code
13724 \begin_layout Plain Layout
13730 can be used to customize the layout parameters for footnotes, marginal
13731 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13732 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13733 define Flex insets.
13736 \begin_layout Standard
13738 \begin_inset Flex Code
13741 \begin_layout Plain Layout
13747 definition must begin with a line of the form:
13750 \begin_layout LyX-Code
13754 \begin_layout Standard
13756 \begin_inset Flex Code
13759 \begin_layout Plain Layout
13765 indicates the inset whose layout is being defined, and here there are two
13769 \begin_layout Enumerate
13770 The layout for a pre-existing inset is being modified.
13771 In this case, can be
13772 \begin_inset Flex Code
13775 \begin_layout Plain Layout
13781 any one of the following:
13782 \begin_inset Flex Code
13785 \begin_layout Plain Layout
13792 \begin_inset Flex Code
13795 \begin_layout Plain Layout
13802 \begin_inset Flex Code
13805 \begin_layout Plain Layout
13812 \begin_inset Flex Code
13815 \begin_layout Plain Layout
13822 \begin_inset Flex Code
13825 \begin_layout Plain Layout
13832 \begin_inset Flex Code
13835 \begin_layout Plain Layout
13842 \begin_inset Flex Code
13845 \begin_layout Plain Layout
13852 \begin_inset Flex Code
13855 \begin_layout Plain Layout
13862 \begin_inset Flex Code
13865 \begin_layout Plain Layout
13872 \begin_inset Flex Code
13875 \begin_layout Plain Layout
13882 \begin_inset Flex Code
13885 \begin_layout Plain Layout
13892 \begin_inset Flex Code
13895 \begin_layout Plain Layout
13902 \begin_inset Flex Code
13905 \begin_layout Plain Layout
13912 \begin_inset Flex Code
13915 \begin_layout Plain Layout
13922 \begin_inset Flex Code
13925 \begin_layout Plain Layout
13932 \begin_inset Flex Code
13935 \begin_layout Plain Layout
13942 \begin_inset Flex Code
13945 \begin_layout Plain Layout
13952 \begin_inset Flex Code
13955 \begin_layout Plain Layout
13962 \begin_inset Flex Code
13965 \begin_layout Plain Layout
13972 \begin_inset Flex Code
13975 \begin_layout Plain Layout
13984 \begin_layout Enumerate
13985 The layout for a Flex inset is being defined.
13987 \begin_inset Flex Code
13990 \begin_layout Plain Layout
13996 must be of the form
13997 \begin_inset Quotes eld
14001 \begin_inset Flex Code
14004 \begin_layout Plain Layout
14011 \begin_inset Quotes erd
14015 \begin_inset Flex Code
14018 \begin_layout Plain Layout
14024 may be be any valid identifier not used by a pre-existing Flex inset.
14025 The identifier may include spaces, but in that case the whole thing must
14026 be wrapped in quotes.
14027 Note that the definition of a flex inset
14032 \begin_inset Flex Code
14035 \begin_layout Plain Layout
14041 entry, declaring which type of inset it defines.
14044 \begin_layout Standard
14046 \begin_inset Flex Code
14049 \begin_layout Plain Layout
14055 definition can contain the following entries:
14058 \begin_layout Description
14059 \begin_inset Flex Code
14062 \begin_layout Plain Layout
14068 The color for the inset's background.
14069 The valid colors are defined in
14070 \begin_inset Flex Code
14073 \begin_layout Plain Layout
14082 \begin_layout Description
14083 \begin_inset Flex Code
14086 \begin_layout Plain Layout
14093 \begin_inset Flex Code
14096 \begin_layout Plain Layout
14105 \begin_inset Flex Code
14108 \begin_layout Plain Layout
14114 ] Whether to use the content of the inset as the label, when the inset is
14119 \begin_layout Description
14120 \begin_inset Flex Code
14123 \begin_layout Plain Layout
14129 As with paragraph styles (see page
14130 \begin_inset CommandInset ref
14132 reference "des:CopyStyle"
14139 \begin_layout Description
14140 \begin_inset Flex Code
14143 \begin_layout Plain Layout
14150 \begin_inset Flex Code
14153 \begin_layout Plain Layout
14162 \begin_inset Flex Code
14165 \begin_layout Plain Layout
14171 ] Indicates whether the user may employ the Paragraph Settings dialog to
14172 customize the paragraph.
14175 \begin_layout Description
14176 \begin_inset Flex Code
14179 \begin_layout Plain Layout
14186 \begin_inset Flex Code
14189 \begin_layout Plain Layout
14196 \begin_inset Flex Code
14199 \begin_layout Plain Layout
14206 \begin_inset Flex Code
14209 \begin_layout Plain Layout
14215 , describing the rendering style used for the inset's frame and buttons.
14216 Footnotes generally use
14217 \begin_inset Flex Code
14220 \begin_layout Plain Layout
14226 , ERT insets generally
14227 \begin_inset Flex Code
14230 \begin_layout Plain Layout
14236 , and character styles
14237 \begin_inset Flex Code
14240 \begin_layout Plain Layout
14249 \begin_layout Description
14250 \begin_inset Flex Code
14253 \begin_layout Plain Layout
14260 \begin_inset Flex Code
14263 \begin_layout Plain Layout
14270 \begin_inset Flex Code
14273 \begin_layout Plain Layout
14282 \begin_inset Flex Code
14285 \begin_layout Plain Layout
14292 \begin_inset Flex Code
14295 \begin_layout Plain Layout
14302 Indicates whether the environment will stand on its own in LaTeX output
14303 or will appear inline with the surrounding text.
14304 If set to false, it is supposed that the LaTeX environment ignores white
14305 space (including one newline character) after the
14306 \begin_inset Flex Code
14309 \begin_layout Plain Layout
14322 \begin_inset Flex Code
14325 \begin_layout Plain Layout
14341 \begin_layout Description
14342 \begin_inset Flex Code
14345 \begin_layout Plain Layout
14351 Required at the end of the InsetLayout declarations.
14354 \begin_layout Description
14355 \begin_inset Flex Code
14358 \begin_layout Plain Layout
14364 The font used for both the text body
14370 \begin_inset space ~
14374 \begin_inset CommandInset ref
14376 reference "sub:Font-description"
14381 Note that defining this font automatically defines the
14382 \begin_inset Flex Code
14385 \begin_layout Plain Layout
14391 to the same value, so define this first and define
14392 \begin_inset Flex Code
14395 \begin_layout Plain Layout
14401 later if you want them to be different.
14404 \begin_layout Description
14405 \begin_inset Flex Code
14408 \begin_layout Plain Layout
14415 \begin_inset Quotes eld
14419 \begin_inset Quotes erd
14422 language, leading to Left-to-Right (latin) output, e.
14423 \begin_inset space \thinspace{}
14427 \begin_inset space \space{}
14430 in TeX code or URL.
14434 \begin_layout Description
14435 \begin_inset Flex Code
14438 \begin_layout Plain Layout
14445 \begin_inset Flex Code
14448 \begin_layout Plain Layout
14457 \begin_inset Flex Code
14460 \begin_layout Plain Layout
14466 ] Indicates whether the
14467 \begin_inset Flex Code
14470 \begin_layout Plain Layout
14476 should be used or, instead, the user can change the paragraph style used
14481 \begin_layout Description
14482 \begin_inset Flex Code
14485 \begin_layout Plain Layout
14491 As with paragraph styles (see page
14492 \begin_inset CommandInset ref
14493 LatexCommand pageref
14494 reference "des:FreeSpacing"
14502 \begin_layout Description
14503 \begin_inset Flex Code
14506 \begin_layout Plain Layout
14512 These tags control XHTML output.
14514 \begin_inset CommandInset ref
14516 reference "sec:Tags-for-XHTML"
14523 \begin_layout Description
14524 \begin_inset Flex Code
14527 \begin_layout Plain Layout
14534 \begin_inset Flex Code
14537 \begin_layout Plain Layout
14546 \begin_inset Flex Code
14549 \begin_layout Plain Layout
14555 ] Whether to include the contents of this inset in the strings generated
14556 for the `Outline' pane.
14557 One would not, for example, want the content of a footnote in a section
14558 header to be included in the TOC displayed in the outline, but one would
14559 normally want the content of a character style displayed.
14560 Default is false: not to include.
14563 \begin_layout Description
14564 \begin_inset Flex Code
14567 \begin_layout Plain Layout
14573 As with paragraph styles (see page
14574 \begin_inset CommandInset ref
14575 LatexCommand pageref
14576 reference "des:KeepEmpty"
14584 \begin_layout Description
14585 \begin_inset Flex Code
14588 \begin_layout Plain Layout
14594 The font used for the label.
14596 \begin_inset space ~
14600 \begin_inset CommandInset ref
14602 reference "sub:Font-description"
14607 Note that this definition can never appear before
14608 \begin_inset Flex Code
14611 \begin_layout Plain Layout
14617 , lest it be ineffective.
14620 \begin_layout Description
14621 \begin_inset Flex Code
14624 \begin_layout Plain Layout
14630 What will be displayed on the button or elsewhere as the inset label.
14632 \begin_inset Flex Code
14635 \begin_layout Plain Layout
14642 \begin_inset Flex Code
14645 \begin_layout Plain Layout
14651 ) modify this label on the fly.
14654 \begin_layout Description
14655 \begin_inset Flex Code
14658 \begin_layout Plain Layout
14664 The name of the corresponding LaTeX stuff.
14665 Either the environment or command name.
14668 \begin_layout Description
14669 \begin_inset Flex Code
14672 \begin_layout Plain Layout
14678 The optional parameter for the corresponding
14679 \begin_inset Flex Code
14682 \begin_layout Plain Layout
14688 stuff, including possible bracket pairs like
14689 \begin_inset Flex Code
14692 \begin_layout Plain Layout
14699 This parameter cannot be changed from within LyX.
14702 \begin_layout Description
14703 \begin_inset Flex Code
14706 \begin_layout Plain Layout
14712 As with paragraph styles (see page
14713 \begin_inset CommandInset ref
14714 LatexCommand pageref
14715 reference "des:LatexType"
14722 \begin_layout Description
14723 \begin_inset Flex Code
14726 \begin_layout Plain Layout
14733 \begin_inset Flex Code
14736 \begin_layout Plain Layout
14743 \begin_inset Flex Code
14746 \begin_layout Plain Layout
14753 \begin_inset Flex Code
14756 \begin_layout Plain Layout
14763 \begin_inset Flex Code
14766 \begin_layout Plain Layout
14772 (indicating a dummy definition ending definitions of charstyles, etc).
14773 This entry is required in and is only meaningful for Flex insets.
14774 Among other things, it determines on which menu this inset will appear.
14776 \begin_inset Flex Code
14779 \begin_layout Plain Layout
14786 \begin_inset Flex Code
14789 \begin_layout Plain Layout
14796 \begin_inset Flex Code
14799 \begin_layout Plain Layout
14807 \begin_inset Flex Code
14810 \begin_layout Plain Layout
14816 can be set to true for charstyle insets, if you wish, by setting it
14821 \begin_inset Flex Code
14824 \begin_layout Plain Layout
14833 \begin_layout Description
14834 \begin_inset Flex Code
14837 \begin_layout Plain Layout
14844 \begin_inset Flex Code
14847 \begin_layout Plain Layout
14856 \begin_inset Flex Code
14859 \begin_layout Plain Layout
14865 ] Whether multiple paragraphs are permitted in this inset.
14867 \begin_inset Flex Code
14870 \begin_layout Plain Layout
14876 to the same value and
14877 \begin_inset Flex Code
14880 \begin_layout Plain Layout
14886 to the opposite value.
14887 These can be reset to other values, if they are used
14892 \begin_inset Flex Code
14895 \begin_layout Plain Layout
14905 \begin_layout Description
14906 \begin_inset Flex Code
14909 \begin_layout Plain Layout
14916 \begin_inset Flex Code
14919 \begin_layout Plain Layout
14928 \begin_inset Flex Code
14931 \begin_layout Plain Layout
14937 ] Whether fragile commands in this inset should be
14938 \begin_inset Flex Code
14941 \begin_layout Plain Layout
14954 whether the command should itself be protected.) Default is false.
14957 \begin_layout Description
14958 \begin_inset Flex Code
14961 \begin_layout Plain Layout
14968 \begin_inset Flex Code
14971 \begin_layout Plain Layout
14980 \begin_inset Flex Code
14983 \begin_layout Plain Layout
14989 ] As with paragraph styles (see page
14990 \begin_inset CommandInset ref
14991 LatexCommand pageref
14992 reference "des:ParbreakIsNewline"
15000 \begin_layout Description
15001 \begin_inset Flex Code
15004 \begin_layout Plain Layout
15011 \begin_inset Flex Code
15014 \begin_layout Plain Layout
15023 \begin_inset Flex Code
15026 \begin_layout Plain Layout
15032 ] As with paragraph styles (see page
15033 \begin_inset CommandInset ref
15034 LatexCommand pageref
15035 reference "des:PassThru"
15043 \begin_layout Description
15044 \begin_inset Flex Code
15047 \begin_layout Plain Layout
15053 As with paragraph styles (see page
15054 \begin_inset CommandInset ref
15055 LatexCommand pageref
15056 reference "des:Preamble"
15063 \begin_layout Description
15064 \begin_inset Flex Code
15067 \begin_layout Plain Layout
15074 \begin_inset Flex Code
15077 \begin_layout Plain Layout
15083 ] The prefix to use when creating labels referring to insets of this type.
15084 This allows the use of formatted references.
15087 \begin_layout Description
15088 \begin_inset Flex Code
15091 \begin_layout Plain Layout
15098 \begin_inset Flex Code
15101 \begin_layout Plain Layout
15107 ] As with paragraph styles (see page
15108 \begin_inset CommandInset ref
15109 LatexCommand pageref
15110 reference "des:Requires"
15117 \begin_layout Description
15118 \begin_inset Flex Code
15121 \begin_layout Plain Layout
15128 \begin_inset Flex Code
15131 \begin_layout Plain Layout
15138 \begin_inset Flex Code
15141 \begin_layout Plain Layout
15149 ] Whether this inset should use the font of its surrounding environment
15151 Default is true: uses its own.
15154 \begin_layout Description
15155 \begin_inset Flex Code
15158 \begin_layout Plain Layout
15165 \begin_inset Flex Code
15168 \begin_layout Plain Layout
15175 \begin_inset Flex Code
15178 \begin_layout Plain Layout
15186 ] Spellcheck the contents of this inset.
15190 \begin_layout Subsection
15192 \begin_inset CommandInset label
15194 name "sub:Counters"
15201 \begin_layout Standard
15202 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15204 \begin_inset Flex MenuItem
15207 \begin_layout Plain Layout
15214 \begin_inset Flex MenuItem
15217 \begin_layout Plain Layout
15223 , \SpecialChar \ldots{}
15224 ) in the text class itself.
15225 The standard counters are defined in the file
15226 \begin_inset Flex Code
15229 \begin_layout Plain Layout
15235 , so you may have to do no more than add
15238 \begin_layout LyX-Code
15239 Input stdcounters.inc
15242 \begin_layout Standard
15243 to your layout file to get them to work.
15244 But if you want to define custom counters, then you can do so.
15245 The counter declaration must begin with:
15248 \begin_layout LyX-Code
15249 Counter CounterName
15252 \begin_layout Standard
15254 \begin_inset Flex Code
15257 \begin_layout Plain Layout
15263 ' is replaced by the name of the counter.
15264 And it must end with
15265 \begin_inset Quotes eld
15269 \begin_inset Flex Code
15272 \begin_layout Plain Layout
15279 \begin_inset Quotes erd
15283 The following parameters can also be used:
15286 \begin_layout Description
15287 \begin_inset Flex Code
15290 \begin_layout Plain Layout
15297 \begin_inset Flex Code
15300 \begin_layout Plain Layout
15307 \begin_inset Quotes erd
15311 \begin_inset Quotes erd
15314 ] When defined, this string defines how the counter is displayed.
15315 Setting this value sets
15316 \begin_inset Flex Code
15319 \begin_layout Plain Layout
15320 LabelStringAppendix
15326 The following special constructs can be used in the string:
15330 \begin_layout Itemize
15331 \begin_inset Flex Code
15334 \begin_layout Plain Layout
15342 will be replaced by the expansion of the
15343 \begin_inset Flex Code
15346 \begin_layout Plain Layout
15353 \begin_inset Flex Code
15356 \begin_layout Plain Layout
15357 LabelStringAppendix
15363 \begin_inset Flex Code
15366 \begin_layout Plain Layout
15376 \begin_layout Itemize
15377 counter values can be expressed using LaTeX-like macros
15378 \begin_inset Flex Code
15381 \begin_layout Plain Layout
15398 \begin_inset Flex Code
15401 \begin_layout Plain Layout
15413 \begin_layout Plain Layout
15423 Actually, the situation is a bit more complicated: any
15442 other than those described below will produce arabic numerals.
15443 It would not be surprising to see this change in the future.
15449 \begin_inset Flex Code
15452 \begin_layout Plain Layout
15458 : 1, 2, 3,\SpecialChar \ldots{}
15460 \begin_inset Flex Code
15463 \begin_layout Plain Layout
15469 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15471 \begin_inset Flex Code
15474 \begin_layout Plain Layout
15480 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15482 \begin_inset Flex Code
15485 \begin_layout Plain Layout
15491 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15493 \begin_inset Flex Code
15496 \begin_layout Plain Layout
15502 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15504 \begin_inset Flex Code
15507 \begin_layout Plain Layout
15513 for hebrew numerals.
15517 \begin_layout Standard
15518 If LabelString is not defined, a default value is constructed as follows:
15519 if the counter has a master counter
15520 \begin_inset Flex Code
15523 \begin_layout Plain Layout
15530 \begin_inset Flex Code
15533 \begin_layout Plain Layout
15540 \begin_inset Flex Code
15543 \begin_layout Plain Layout
15553 is used; otherwise the string
15554 \begin_inset Flex Code
15557 \begin_layout Plain Layout
15568 \begin_layout Description
15569 \begin_inset Flex Code
15572 \begin_layout Plain Layout
15573 LabelStringAppendix
15579 \begin_inset Flex Code
15582 \begin_layout Plain Layout
15589 \begin_inset Quotes erd
15593 \begin_inset Quotes erd
15597 \begin_inset Flex Code
15600 \begin_layout Plain Layout
15606 , but for use in the Appendix.
15609 \begin_layout Description
15610 \begin_inset Flex Code
15613 \begin_layout Plain Layout
15620 \begin_inset Flex Code
15623 \begin_layout Plain Layout
15630 \begin_inset Quotes erd
15634 \begin_inset Quotes erd
15637 ] A format for use with formatted references to this counter.
15638 For example, one might want to have references to section numbers appear
15640 \begin_inset Quotes eld
15644 \begin_inset Quotes erd
15648 The string should contain
15649 \begin_inset Quotes eld
15653 \begin_inset Quotes erd
15657 This will be replaced by the counter number itself.
15658 So, for sections, it would be: Section ##.
15661 \begin_layout Description
15662 \begin_inset Flex Code
15665 \begin_layout Plain Layout
15672 \begin_inset Flex Code
15675 \begin_layout Plain Layout
15682 \begin_inset Quotes erd
15686 \begin_inset Quotes erd
15689 ] If this is set to the name of another counter, the present counter will
15690 be reset every time the other one is increased.
15692 \begin_inset Flex Code
15695 \begin_layout Plain Layout
15702 \begin_inset Flex Code
15705 \begin_layout Plain Layout
15714 \begin_layout Subsection
15716 \begin_inset CommandInset label
15718 name "sub:Font-description"
15725 \begin_layout Standard
15726 A font description looks like this:
15729 \begin_layout LyX-Code
15739 \begin_layout LyX-Code
15743 \begin_layout LyX-Code
15747 \begin_layout Standard
15748 The following commands are available:
15751 \begin_layout Description
15752 \begin_inset Flex Code
15755 \begin_layout Plain Layout
15762 \begin_inset Flex Code
15765 \begin_layout Plain Layout
15774 \begin_inset Flex Code
15777 \begin_layout Plain Layout
15784 \begin_inset Flex Code
15787 \begin_layout Plain Layout
15794 \begin_inset Flex Code
15797 \begin_layout Plain Layout
15804 \begin_inset Flex Code
15807 \begin_layout Plain Layout
15814 \begin_inset Flex Code
15817 \begin_layout Plain Layout
15824 \begin_inset Flex Code
15827 \begin_layout Plain Layout
15834 \begin_inset Flex Code
15837 \begin_layout Plain Layout
15844 \begin_inset Flex Code
15847 \begin_layout Plain Layout
15856 \begin_layout Description
15857 \begin_inset Flex Code
15860 \begin_layout Plain Layout
15867 \begin_inset Flex Code
15870 \begin_layout Plain Layout
15879 \begin_inset Flex Code
15882 \begin_layout Plain Layout
15889 \begin_inset Flex Code
15892 \begin_layout Plain Layout
15901 \begin_layout Description
15902 \begin_inset Flex Code
15905 \begin_layout Plain Layout
15912 \begin_inset Flex Code
15915 \begin_layout Plain Layout
15921 ] Valid arguments are:
15922 \begin_inset Flex Code
15925 \begin_layout Plain Layout
15932 \begin_inset Flex Code
15935 \begin_layout Plain Layout
15942 \begin_inset Flex Code
15945 \begin_layout Plain Layout
15952 \begin_inset Flex Code
15955 \begin_layout Plain Layout
15962 \begin_inset Flex Code
15965 \begin_layout Plain Layout
15972 \begin_inset Flex Code
15975 \begin_layout Plain Layout
15982 Each of these turns on or off the corresponding attribute.
15984 \begin_inset Flex Code
15987 \begin_layout Plain Layout
15993 turns on emphasis, and
15994 \begin_inset Flex Code
15997 \begin_layout Plain Layout
16005 \begin_inset Newline newline
16008 If the latter seems puzzling, remember that the font settings for the present
16009 context are generally inherited from the surrounding context.
16011 \begin_inset Flex Code
16014 \begin_layout Plain Layout
16020 would turn off the emphasis that was anyway in effect, say, in a theorem
16024 \begin_layout Description
16025 \begin_inset Flex Code
16028 \begin_layout Plain Layout
16035 \begin_inset Flex Code
16038 \begin_layout Plain Layout
16047 \begin_inset Flex Code
16050 \begin_layout Plain Layout
16059 \begin_layout Description
16060 \begin_inset Flex Code
16063 \begin_layout Plain Layout
16070 \begin_inset Flex Code
16073 \begin_layout Plain Layout
16082 \begin_inset Flex Code
16085 \begin_layout Plain Layout
16092 \begin_inset Flex Code
16095 \begin_layout Plain Layout
16102 \begin_inset Flex Code
16105 \begin_layout Plain Layout
16114 \begin_layout Description
16115 \begin_inset Flex Code
16118 \begin_layout Plain Layout
16125 \begin_inset Flex Code
16128 \begin_layout Plain Layout
16135 \begin_inset Flex Code
16138 \begin_layout Plain Layout
16145 \begin_inset Flex Code
16148 \begin_layout Plain Layout
16157 \begin_inset Flex Code
16160 \begin_layout Plain Layout
16167 \begin_inset Flex Code
16170 \begin_layout Plain Layout
16177 \begin_inset Flex Code
16180 \begin_layout Plain Layout
16187 \begin_inset Flex Code
16190 \begin_layout Plain Layout
16197 \begin_inset Flex Code
16200 \begin_layout Plain Layout
16209 \begin_layout Subsection
16210 \begin_inset CommandInset label
16212 name "sub:Citation-format-description"
16216 Citation format description
16219 \begin_layout Standard
16221 \begin_inset Flex Code
16224 \begin_layout Plain Layout
16230 blocks are used to describe how bibliographic information should be displayed,
16231 both within LyX itself (in the citation dialog and in tooltips, for example)
16232 and in XHTML output.
16233 Such a block might look like this:
16236 \begin_layout LyX-Code
16240 \begin_layout LyX-Code
16244 \begin_layout LyX-Code
16248 \begin_layout LyX-Code
16252 \begin_layout Standard
16253 The individual lines define how the bibliographic information associated
16254 with an article or book, respectively, is to be displayed, and such a definitio
16255 n can be given for any `entry type' that might be present in a BibTeX file.
16256 LyX defines a default format in the source code that will be used if no
16257 specific definition has been given.
16258 LyX predefines several formats in the file
16259 \begin_inset Flex Code
16262 \begin_layout Plain Layout
16268 , which is included in most of LyX's document classes.
16271 \begin_layout Standard
16272 The definitions use a simple language that allows BibTeX keys to be replaced
16274 Keys should be enclosed in
16275 \begin_inset Flex Code
16278 \begin_layout Plain Layout
16285 \begin_inset Flex Code
16288 \begin_layout Plain Layout
16295 So a simple definition might look like this:
16298 \begin_layout LyX-Code
16300 \begin_inset Quotes eld
16304 \begin_inset Quotes erd
16310 \begin_layout Standard
16311 This would print the author, followed by a comma, followed by the title,
16312 in quotes, followed by a period.
16315 \begin_layout Standard
16316 Of course, sometimes you may want to print a key only if it exists.
16317 This can be done by using a conditional construction, such as:
16318 \begin_inset Flex Code
16321 \begin_layout Plain Layout
16323 \begin_inset space ~
16333 \begin_inset Flex Code
16336 \begin_layout Plain Layout
16342 key exists, then print
16343 \begin_inset Quotes eld
16347 \begin_inset space ~
16351 \begin_inset Quotes erd
16354 followed by the volume key.
16355 It is also possible to have an else clause in the conditional, such as:
16357 \begin_inset Flex Code
16360 \begin_layout Plain Layout
16361 {%author%[[%author%]][[%editor%, ed.]]}
16368 \begin_inset Flex Code
16371 \begin_layout Plain Layout
16377 key is printed if it exists; otherwise, the editor key is printed, followed
16379 \begin_inset Quotes eld
16383 \begin_inset space ~
16387 \begin_inset Quotes erd
16390 Note that the key is again enclosed in
16391 \begin_inset Flex Code
16394 \begin_layout Plain Layout
16400 signs; the entire conditional is enclosed in braces; and the if and else
16401 clauses are enclosed in double brackets,
16402 \begin_inset Quotes eld
16406 \begin_inset Flex Code
16409 \begin_layout Plain Layout
16416 \begin_inset Quotes eld
16420 \begin_inset Quotes eld
16424 \begin_inset Flex Code
16427 \begin_layout Plain Layout
16434 \begin_inset Quotes erd
16438 There must be no space between any of these.
16441 \begin_layout Standard
16442 There is one other piece of syntax available in definitions, which looks
16444 \begin_inset Flex Code
16447 \begin_layout Plain Layout
16454 This defines a piece of formatting information that is to be used when
16456 \begin_inset Quotes eld
16460 \begin_inset Quotes erd
16464 Obviously, we do not want to output HTML tags when writing plain text,
16465 so they should be wrapped in
16466 \begin_inset Quotes eld
16470 \begin_inset Quotes erd
16474 \begin_inset Quotes eld
16478 \begin_inset Quotes erd
16484 \begin_layout Standard
16485 Two special sorts of definitions are also possible in a
16486 \begin_inset Flex Code
16489 \begin_layout Plain Layout
16496 An example of the first would be:
16499 \begin_layout LyX-Code
16501 \begin_inset Quotes eld
16505 \begin_inset Quotes erd
16511 \begin_layout Standard
16512 This is an abbreviation, or macro, and it can be used by treating it as
16514 \begin_inset Flex Code
16517 \begin_layout Plain Layout
16525 \begin_inset Flex Code
16528 \begin_layout Plain Layout
16534 exactly as it would treat its definition.
16535 So, let us issue the obvious
16543 \begin_layout LyX-Code
16547 \begin_layout Standard
16548 or anything like it.
16549 LyX shouldn't go into an infinite loop, but it may go into a long one before
16553 \begin_layout Standard
16554 The second sort of special definition might look like this:
16557 \begin_layout LyX-Code
16561 \begin_layout Standard
16562 This defines a translatable piece of text, which allows relevant parts of
16563 the bibliography to be translated.
16564 It can be included in a definition by treating it as a key:
16565 \begin_inset Flex Code
16568 \begin_layout Plain Layout
16575 Several of these are predefined in
16576 \begin_inset Flex Code
16579 \begin_layout Plain Layout
16586 Note that these are not macros, in the sense just defined.
16587 They will not be expanded.
16590 \begin_layout Standard
16591 So here then is an example that use all these features:
16594 \begin_layout LyX-Code
16595 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16598 \begin_layout Standard
16599 This defines a macro that prints the author, followed by a comma, if the
16601 \begin_inset Flex Code
16604 \begin_layout Plain Layout
16610 key is defined, or else prints the name of the editor, followed by the
16612 \begin_inset Flex Code
16615 \begin_layout Plain Layout
16621 or its translation (it is by default
16622 \begin_inset Quotes eld
16626 \begin_inset Quotes erd
16630 \begin_inset Flex Code
16633 \begin_layout Plain Layout
16640 Note that this is in fact defined in
16641 \begin_inset Flex Code
16644 \begin_layout Plain Layout
16650 , so you can use it in your own definitions, or re-definitions, if you load
16654 \begin_layout Section
16655 \begin_inset CommandInset label
16657 name "sec:Tags-for-XHTML"
16661 Tags for XHTML output
16664 \begin_layout Standard
16665 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16666 by layout information.
16667 In general, LyX provides sensible defaults and, as mentioned earlier, it
16668 will even construct default CSS style rules from the other layout tags.
16669 For example, LyX will attempt to use the information provided in the
16670 \begin_inset Flex Code
16673 \begin_layout Plain Layout
16679 declaration for the Chapter style to write CSS that will appropriately
16680 format chapter headings.
16683 \begin_layout Standard
16684 In many cases, then, you may not have to do anything at all to get acceptable
16685 XHTML output for your own environments, custom insets, and so forth.
16686 But in some cases you will, and so LyX provides a number of layout tags
16687 that can be used to customize the XHTML and CSS that are generated.
16690 \begin_layout Standard
16691 Note that there are two tags,
16692 \begin_inset Flex Code
16695 \begin_layout Plain Layout
16702 \begin_inset Flex Code
16705 \begin_layout Plain Layout
16711 that may appear outside style and inset declarations.
16713 \begin_inset CommandInset ref
16715 reference "sub:General-text-class"
16719 for details on these.
16722 \begin_layout Subsection
16723 \begin_inset CommandInset label
16725 name "sub:Paragraph-Style-XHTML"
16732 \begin_layout Standard
16733 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16734 dealing with a normal paragraph, a command, or an environment, where this
16735 is itself determined by the contents of the corresponding
16736 \begin_inset Flex Code
16739 \begin_layout Plain Layout
16749 \begin_layout Standard
16750 For a command or normal paragraph, the output XHTML has the following form:
16753 \begin_layout LyX-Code
16755 \begin_inset Quotes erd
16759 \begin_inset Quotes erd
16765 \begin_layout LyX-Code
16767 \begin_inset Quotes erd
16771 \begin_inset Quotes erd
16777 \begin_layout LyX-Code
16778 Contents of the paragraph.
16781 \begin_layout LyX-Code
16785 \begin_layout Standard
16786 The label tags are of course omitted if the paragraph does not have a label.
16789 \begin_layout Standard
16790 For an environment that is not some sort of list, the XHTML takes this form:
16793 \begin_layout LyX-Code
16795 \begin_inset Quotes erd
16799 \begin_inset Quotes erd
16805 \begin_layout LyX-Code
16807 \begin_inset Quotes erd
16811 \begin_inset Quotes erd
16815 \begin_inset Quotes erd
16819 \begin_inset Quotes erd
16822 >Environment Label</labeltag>First paragraph.</itemtag>
16825 \begin_layout LyX-Code
16826 <itemtag>Second paragraph.</itemtag>
16829 \begin_layout LyX-Code
16833 \begin_layout Standard
16834 Note that the label is output only for the first paragraph, as it should
16835 be for a theorem, for example.
16839 \begin_layout Standard
16840 For a list, we have one of these forms:
16843 \begin_layout LyX-Code
16845 \begin_inset Quotes erd
16849 \begin_inset Quotes erd
16855 \begin_layout LyX-Code
16857 \begin_inset Quotes erd
16861 \begin_inset Quotes erd
16865 \begin_inset Quotes erd
16869 \begin_inset Quotes erd
16872 >List Label</labeltag>First item.</itemtag>
16875 \begin_layout LyX-Code
16877 \begin_inset Quotes erd
16881 \begin_inset Quotes erd
16885 \begin_inset Quotes erd
16889 \begin_inset Quotes erd
16892 >List Label</labeltag>Second item.</itemtag>
16895 \begin_layout LyX-Code
16899 \begin_layout LyX-Code
16903 \begin_layout LyX-Code
16905 \begin_inset Quotes erd
16909 \begin_inset Quotes erd
16915 \begin_layout LyX-Code
16917 \begin_inset Quotes erd
16921 \begin_inset Quotes erd
16924 >List Label</labeltag><itemtag attr=
16925 \begin_inset Quotes erd
16929 \begin_inset Quotes erd
16932 >First item.</itemtag>
16935 \begin_layout LyX-Code
16937 \begin_inset Quotes erd
16941 \begin_inset Quotes erd
16944 >List Label</labeltag><itemtag attr=
16945 \begin_inset Quotes erd
16949 \begin_inset Quotes erd
16952 >Second item.</itemtag>
16955 \begin_layout LyX-Code
16959 \begin_layout Standard
16960 Note the different orders of
16961 \begin_inset Flex Code
16964 \begin_layout Plain Layout
16971 \begin_inset Flex Code
16974 \begin_layout Plain Layout
16981 Which order we get depends upon the setting of
16982 \begin_inset Flex Code
16985 \begin_layout Plain Layout
16992 \begin_inset Flex Code
16995 \begin_layout Plain Layout
17001 is false (the default), you get the first of these, with the label within
17002 the item; if true, you get the second, with the label outside the item.
17005 \begin_layout Standard
17006 The specific tags and attributes output for each paragraph type can be controlle
17007 d by means of the layout tags we are about to describe.
17008 As mentioned earlier, however, LyX uses sensible defaults for many of these,
17009 so you often may not need to do very much to get good XHTML output.
17010 Think of the available tags as there so you can tweak things to your liking.
17013 \begin_layout Description
17014 \begin_inset Flex Code
17017 \begin_layout Plain Layout
17024 \begin_inset Flex Code
17027 \begin_layout Plain Layout
17033 ] Specifies attribute information to be output with the main tag.
17035 \begin_inset Quotes eld
17039 \begin_inset Flex Code
17042 \begin_layout Plain Layout
17049 \begin_inset Quotes erd
17053 By default, LyX will output
17054 \begin_inset Quotes eld
17058 \begin_inset Flex Code
17061 \begin_layout Plain Layout
17068 \begin_inset Quotes erd
17072 \begin_inset Flex Code
17075 \begin_layout Plain Layout
17081 is the LyX name of the layout, made lowercase, for example: chapter.
17086 contain any style information.
17088 \begin_inset Flex Code
17091 \begin_layout Plain Layout
17100 \begin_layout Description
17101 \begin_inset Flex Code
17104 \begin_layout Plain Layout
17111 \begin_inset Flex Code
17114 \begin_layout Plain Layout
17124 ] Whether to output the default CSS information LyX generates for this layout,
17125 even if additional information is explicitly provided via
17126 \begin_inset Flex Code
17129 \begin_layout Plain Layout
17137 \begin_inset Flex Code
17140 \begin_layout Plain Layout
17146 allows you to alter or augment the generated CSS, rather than to override
17149 \begin_inset Flex Code
17152 \begin_layout Plain Layout
17161 \begin_layout Description
17162 \begin_inset Flex Code
17165 \begin_layout Plain Layout
17172 \begin_inset Flex Code
17175 \begin_layout Plain Layout
17181 ] The tag to be used for individual paragraphs of environments, replacing
17183 \begin_inset Flex Code
17186 \begin_layout Plain Layout
17192 in the examples above.
17194 \begin_inset Flex Code
17197 \begin_layout Plain Layout
17206 \begin_layout Description
17207 \begin_inset Flex Code
17210 \begin_layout Plain Layout
17217 \begin_inset Flex Code
17220 \begin_layout Plain Layout
17226 ] Attributes for the item tag.
17228 \begin_inset Quotes eld
17232 \begin_inset Flex Code
17235 \begin_layout Plain Layout
17236 class=`layoutname_item'
17242 \begin_inset Quotes erd
17250 contain any style information.
17252 \begin_inset Flex Code
17255 \begin_layout Plain Layout
17264 \begin_layout Description
17265 \begin_inset Flex Code
17268 \begin_layout Plain Layout
17275 \begin_inset Flex Code
17278 \begin_layout Plain Layout
17284 ] The tag to be used for paragraph and item labels, replacing
17285 \begin_inset Flex Code
17288 \begin_layout Plain Layout
17294 in the examples above.
17296 \begin_inset Flex Code
17299 \begin_layout Plain Layout
17306 \begin_inset Flex Code
17309 \begin_layout Plain Layout
17316 \begin_inset Flex Code
17319 \begin_layout Plain Layout
17326 \begin_inset Flex Code
17329 \begin_layout Plain Layout
17330 Centered_Top_Environment
17335 , in which case it defaults to
17336 \begin_inset Flex Code
17339 \begin_layout Plain Layout
17348 \begin_layout Description
17349 \begin_inset Flex Code
17352 \begin_layout Plain Layout
17359 \begin_inset Flex Code
17362 \begin_layout Plain Layout
17368 ] Attributes for the label tag.
17370 \begin_inset Quotes eld
17374 \begin_inset Flex Code
17377 \begin_layout Plain Layout
17378 class=`layoutname_label'
17384 \begin_inset Quotes erd
17392 contain any style information.
17394 \begin_inset Flex Code
17397 \begin_layout Plain Layout
17406 \begin_layout Description
17407 \begin_inset Flex Code
17410 \begin_layout Plain Layout
17417 \begin_inset Flex Code
17420 \begin_layout Plain Layout
17430 ] Meaningful only for list-like environments, this tag controls whether
17431 the label tag is output before or inside the item tag.
17432 This is used, for example, in the description environment, where we want
17434 \begin_inset Flex Code
17437 \begin_layout Plain Layout
17438 <dt>\SpecialChar \ldots{}
17439 </dt><dd>\SpecialChar \ldots{}
17447 \begin_inset Flex Code
17450 \begin_layout Plain Layout
17456 : The label tag is output inside the item tag.
17459 \begin_layout Description
17460 \begin_inset Flex Code
17463 \begin_layout Plain Layout
17469 Information to be output in the
17470 \begin_inset Flex Code
17473 \begin_layout Plain Layout
17479 section when this style is used.
17480 This might, for example, be used to include a
17481 \begin_inset Flex Code
17484 \begin_layout Plain Layout
17491 \begin_inset Flex Code
17494 \begin_layout Plain Layout
17503 \begin_layout Description
17504 \begin_inset Flex Code
17507 \begin_layout Plain Layout
17513 CSS style information to be included when this style is used.
17514 Note that this will automatically be wrapped in a layout-generated
17515 \begin_inset Flex Code
17518 \begin_layout Plain Layout
17524 block, so only the CSS itself need be included.
17527 \begin_layout Description
17528 \begin_inset Flex Code
17531 \begin_layout Plain Layout
17538 \begin_inset Flex Code
17541 \begin_layout Plain Layout
17547 ] The tag to be used for the main label, replacing
17548 \begin_inset Flex Code
17551 \begin_layout Plain Layout
17557 in the examples above.
17559 \begin_inset Flex Code
17562 \begin_layout Plain Layout
17571 \begin_layout Description
17572 \begin_inset Flex Code
17575 \begin_layout Plain Layout
17582 \begin_inset Flex Code
17585 \begin_layout Plain Layout
17595 ] Marks this style as the one to be used to generate the
17596 \begin_inset Flex Code
17599 \begin_layout Plain Layout
17605 tag for the XHTML file.
17606 By default, it is false.
17608 \begin_inset Flex Code
17611 \begin_layout Plain Layout
17617 file sets it to true for the
17618 \begin_inset Flex Code
17621 \begin_layout Plain Layout
17631 \begin_layout Subsection
17635 \begin_layout Standard
17636 The XHTML output of insets can also be controlled by information in layout
17641 \begin_layout Plain Layout
17642 At present, this is true only for
17643 \begin_inset Quotes eld
17647 \begin_inset Quotes erd
17650 insets (insets you can type into) and is not true for
17651 \begin_inset Quotes eld
17655 \begin_inset Quotes erd
17658 insets (insets that are associated with dialog boxes).
17663 Here, too, LyX tries to provide sensible defaults, and it constructs default
17665 But everything can be customized.
17668 \begin_layout Standard
17669 The XHTML LyX outputs for an inset has the following form:
17672 \begin_layout LyX-Code
17674 \begin_inset Quotes erd
17678 \begin_inset Quotes erd
17684 \begin_layout LyX-Code
17685 <labeltag>Label</labeltag>
17688 \begin_layout LyX-Code
17690 \begin_inset Quotes erd
17694 \begin_inset Quotes erd
17697 >Contents of the inset.</innertag>
17700 \begin_layout LyX-Code
17704 \begin_layout Standard
17705 If the inset permits multiple paragraphs---that is, if
17706 \begin_inset Flex Code
17709 \begin_layout Plain Layout
17715 is true---then the contents of the inset will itself be output as paragraphs
17716 formatted according to the styles used for those paragraphs (standard,
17717 quote, and the like).
17718 The label tag is of course omitted if the paragraph does not have a label
17719 and, at present, is always
17720 \begin_inset Flex Code
17723 \begin_layout Plain Layout
17730 The inner tag is optional and, by default, does not appear.
17733 \begin_layout Standard
17734 The specific tags and attributes output for each inset can be controlled
17735 by means of the following layout tags.
17738 \begin_layout Description
17739 \begin_inset Flex Code
17742 \begin_layout Plain Layout
17749 \begin_inset Flex Code
17752 \begin_layout Plain Layout
17758 ] Specifies attribute information to be output with the main tag.
17760 \begin_inset Quotes eld
17764 \begin_inset Flex Code
17767 \begin_layout Plain Layout
17768 class=`myinset' onclick=`\SpecialChar \ldots{}
17775 \begin_inset Quotes erd
17779 By default, LyX will output
17780 \begin_inset Quotes eld
17784 \begin_inset Flex Code
17787 \begin_layout Plain Layout
17794 \begin_inset Quotes erd
17798 \begin_inset Flex Code
17801 \begin_layout Plain Layout
17807 is the LyX name of the inset, made lowercase and with non-alphanumeric
17808 characters converted to underscores, for example: footnote.
17811 \begin_layout Description
17812 \begin_inset Flex Code
17815 \begin_layout Plain Layout
17822 \begin_inset Flex Code
17825 \begin_layout Plain Layout
17835 ] Whether to output the default CSS information LyX generates for this layout,
17836 even if additional information is explicitly provided via
17837 \begin_inset Flex Code
17840 \begin_layout Plain Layout
17848 \begin_inset Flex Code
17851 \begin_layout Plain Layout
17857 allows you to alter or augment the generated CSS, rather than to override
17862 \begin_layout Description
17863 \begin_inset Flex Code
17866 \begin_layout Plain Layout
17873 \begin_inset Flex Code
17876 \begin_layout Plain Layout
17882 ] Attributes for the inner tag.
17884 \begin_inset Quotes eld
17888 \begin_inset Flex Code
17891 \begin_layout Plain Layout
17892 class=`insetname_inner'
17898 \begin_inset Quotes erd
17904 \begin_layout Description
17905 \begin_inset Flex Code
17908 \begin_layout Plain Layout
17915 \begin_inset Flex Code
17918 \begin_layout Plain Layout
17924 ] The inner tag, replacing
17925 \begin_inset Flex Code
17928 \begin_layout Plain Layout
17934 in the examples above.
17935 By default, there is none.
17938 \begin_layout Description
17939 \begin_inset Flex Code
17942 \begin_layout Plain Layout
17949 \begin_inset Flex Code
17952 \begin_layout Plain Layout
17960 ] Whether this inset represents a standalone block of text (such as a footnote)
17961 or instead represents material that is included in the surrounding text
17962 (such as a branch).
17966 \begin_layout Description
17967 \begin_inset Flex Code
17970 \begin_layout Plain Layout
17977 \begin_inset Flex Code
17980 \begin_layout Plain Layout
17986 ] A label for this inset, possibly including a reference to a counter.
17987 For example, for footnote, it might be:
17988 \begin_inset Flex Code
17991 \begin_layout Plain Layout
18000 This is optional, and there is no default.
18003 \begin_layout Description
18004 \begin_inset Flex Code
18007 \begin_layout Plain Layout
18013 Information to be output in the
18014 \begin_inset Flex Code
18017 \begin_layout Plain Layout
18023 section when this style is used.
18024 This might, for example, be used to include a
18025 \begin_inset Flex Code
18028 \begin_layout Plain Layout
18035 \begin_inset Flex Code
18038 \begin_layout Plain Layout
18047 \begin_layout Description
18048 \begin_inset Flex Code
18051 \begin_layout Plain Layout
18057 CSS style information to be included when this style is used.
18058 Note that this will automatically be wrapped in a layout-generated
18059 \begin_inset Flex Code
18062 \begin_layout Plain Layout
18068 block, so only the CSS itself need be included.
18071 \begin_layout Description
18072 \begin_inset Flex Code
18075 \begin_layout Plain Layout
18082 \begin_inset Flex Code
18085 \begin_layout Plain Layout
18091 ] The tag to be used for the main label, replacing
18092 \begin_inset Flex Code
18095 \begin_layout Plain Layout
18101 in the examples above.
18102 The default depends upon the setting of
18103 \begin_inset Flex Code
18106 \begin_layout Plain Layout
18113 \begin_inset Flex Code
18116 \begin_layout Plain Layout
18122 is true, the default is
18123 \begin_inset Flex Code
18126 \begin_layout Plain Layout
18132 ; if it is false, the default is
18133 \begin_inset Flex Code
18136 \begin_layout Plain Layout
18145 \begin_layout Subsection
18149 \begin_layout Standard
18150 The XHTML output for floats too can be controlled by layout information.
18151 The output has the following form:
18154 \begin_layout LyX-Code
18156 \begin_inset Quotes erd
18160 \begin_inset Quotes erd
18166 \begin_layout LyX-Code
18167 Contents of the float.
18170 \begin_layout LyX-Code
18174 \begin_layout Standard
18175 The caption, if there is one, is a separate inset and will be output as
18177 Its appearance can be controlled via the InsetLayout for caption insets.
18181 \begin_layout Description
18182 \begin_inset Flex Code
18185 \begin_layout Plain Layout
18192 \begin_inset Flex Code
18195 \begin_layout Plain Layout
18201 ] Specifies attribute information to be output with the main tag.
18203 \begin_inset Quotes eld
18207 \begin_inset Flex Code
18210 \begin_layout Plain Layout
18211 class=`myfloat' onclick=`\SpecialChar \ldots{}
18218 \begin_inset Quotes erd
18222 By default, LyX will output
18223 \begin_inset Quotes eld
18227 \begin_inset Flex Code
18230 \begin_layout Plain Layout
18231 class=`float float-floattype'
18237 \begin_inset Quotes erd
18241 \begin_inset Flex Code
18244 \begin_layout Plain Layout
18250 is LyX's name for this type of float, as determined by the float declaration
18252 \begin_inset CommandInset ref
18254 reference "sub:Floats"
18258 ), though made lowercase and with non-alphanumeric characters converted
18259 to underscores, for example: float-table.
18262 \begin_layout Description
18263 \begin_inset Flex Code
18266 \begin_layout Plain Layout
18272 CSS style information to be included when this float is used.
18273 Note that this will automatically be wrapped in a layout-generated
18274 \begin_inset Flex Code
18277 \begin_layout Plain Layout
18283 block, so only the CSS itself need be included.
18286 \begin_layout Description
18287 \begin_inset Flex Code
18290 \begin_layout Plain Layout
18297 \begin_inset Flex Code
18300 \begin_layout Plain Layout
18306 ] The tag to be used for this float, replacing
18307 \begin_inset Quotes eld
18311 \begin_inset Flex Code
18314 \begin_layout Plain Layout
18321 \begin_inset Quotes erd
18324 in the example above.
18326 \begin_inset Flex Code
18329 \begin_layout Plain Layout
18335 and will rarely need changing.
18338 \begin_layout Subsection
18339 Bibliography formatting
18342 \begin_layout Standard
18343 The bibliography can be formatted using
18344 \begin_inset Flex Code
18347 \begin_layout Plain Layout
18355 \begin_inset CommandInset ref
18357 reference "sub:Citation-format-description"
18364 \begin_layout Subsection
18368 \begin_layout Standard
18369 We have several times mentioned that LyX will generate default CSS style
18370 rules for both insets and paragraph styles, based upon the other layout
18371 information that is provided.
18372 In this section, we shall say a word about which layout information LyX
18376 \begin_layout Standard
18377 At present, LyX auto-generates CSS only for font information, making use
18379 \begin_inset Flex Code
18382 \begin_layout Plain Layout
18389 \begin_inset Flex Code
18392 \begin_layout Plain Layout
18399 \begin_inset Flex Code
18402 \begin_layout Plain Layout
18409 \begin_inset Flex Code
18412 \begin_layout Plain Layout
18419 \begin_inset Flex Code
18422 \begin_layout Plain Layout
18430 \begin_inset CommandInset ref
18432 reference "sub:Font-description"
18436 .) The translation is mostly straightforward and obvious.
18438 \begin_inset Quotes eld
18442 \begin_inset Flex Code
18445 \begin_layout Plain Layout
18452 \begin_inset Quotes erd
18456 \begin_inset Quotes eld
18460 \begin_inset Flex Code
18463 \begin_layout Plain Layout
18464 font-family: sans-serif;
18470 \begin_inset Quotes erd
18474 The correspondence of LyX sizes and CSS sizes is a little less obvious
18475 but nonetheless intuitive.
18477 \begin_inset Flex Code
18480 \begin_layout Plain Layout
18487 \begin_inset Flex URL
18490 \begin_layout Plain Layout
18501 \begin_layout Chapter
18502 Including External Material
18505 \begin_layout Standard
18506 \begin_inset Box Shadowbox
18516 height_special "totalheight"
18519 \begin_layout Plain Layout
18520 WARNING: This portion of the documentation has not been updated for some
18522 We certainly hope that it is still accurate, but there are no guarantees.
18530 \begin_layout Standard
18531 The use of material from sources external to LyX is covered in detail in
18537 This part of the manual covers what needs to happen behind the scenes for
18538 new sorts of material to be included.
18541 \begin_layout Section
18545 \begin_layout Standard
18546 The external material feature is based on the concept of a
18551 A template is a specification of how LyX should interface with a certain
18553 As bundled, LyX comes with predefined templates for Xfig figures, various
18554 raster format images, chess diagrams, and LilyPond music notation.
18555 You can check the actual list by using the menu
18556 \begin_inset Flex MenuItem
18559 \begin_layout Plain Layout
18560 Insert\SpecialChar \menuseparator
18561 File\SpecialChar \menuseparator
18568 Furthermore, it is possible to roll your own template to support a specific
18570 Later we'll describe in more detail what is involved, and hopefully you
18571 will submit all the templates you create so we can include them in a later
18575 \begin_layout Standard
18576 Another basic idea of the external material feature is to distinguish between
18577 the original file that serves as a base for final material and the produced
18578 file that is included in your exported or printed document.
18579 For example, consider the case of a figure produced with
18580 \begin_inset Flex Code
18583 \begin_layout Plain Layout
18590 The Xfig application itself works on an original file with the
18591 \begin_inset Flex Code
18594 \begin_layout Plain Layout
18601 Within Xfig, you create and change your figure, and when you are done,
18603 \begin_inset Flex Code
18606 \begin_layout Plain Layout
18613 When you want to include the figure in your document, you invoke
18614 \begin_inset Flex Code
18617 \begin_layout Plain Layout
18623 in order to create a PostScript file that can readily be included in your
18626 \begin_inset Flex Code
18629 \begin_layout Plain Layout
18635 file is the original file, and the PostScript file is the produced file.
18638 \begin_layout Standard
18639 This distinction is important in order to allow updating of the material
18640 while you are in the process of writing the document.
18641 Furthermore, it provides us with the flexibility that is needed to support
18642 multiple export formats.
18643 For instance, in the case of a plain text file, it is not exactly an award-winn
18644 ing idea to include the figure as raw PostScript.
18645 Instead, you'd either prefer to just include a reference to the figure
18646 or try to invoke some graphics to ASCII converter to make the final result
18647 look similar to the real graphics.
18648 The external material management allows you to do this, because it is parametri
18649 zed on the different export formats that LyX supports.
18652 \begin_layout Standard
18653 Besides supporting the production of different products according to the
18654 exported format, it supports tight integration with editing and viewing
18656 In the case of an Xfig figure, you are able to invoke Xfig on the original
18657 file with a single click from within the external material dialog in LyX,
18658 and also preview the produced PostScript file with Ghostview with another
18660 No more fiddling around with the command line and/or file browsers to locate
18661 and manipulate the original or produced files.
18662 In this way, you are finally able to take full advantage of the many different
18663 applications that are relevant to use when you write your documents, and
18664 ultimately be more productive.
18667 \begin_layout Section
18668 The external template configuration file
18671 \begin_layout Standard
18672 It is relatively easy to add custom external template definitions to LyX.
18673 However, be aware that doing this in an careless manner most probably
18677 introduce an easily exploitable security hole.
18678 So before you do this, please read the discussion about security in section
18680 \begin_inset CommandInset ref
18682 reference "sec:Security-discussion"
18689 \begin_layout Standard
18690 Having said that, we encourage you to submit any interesting templates that
18695 \begin_layout Standard
18696 The external templates are defined in the
18697 \begin_inset Flex Code
18700 \begin_layout Plain Layout
18701 LyXDir/lib/external_templates
18707 You can place your own version in
18708 \begin_inset Flex Code
18711 \begin_layout Plain Layout
18712 UserDir/external_templates
18720 \begin_layout Standard
18721 A typical template looks like this:
18724 \begin_layout LyX-Code
18728 \begin_layout LyX-Code
18729 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18732 \begin_layout LyX-Code
18736 \begin_layout LyX-Code
18740 \begin_layout LyX-Code
18744 \begin_layout LyX-Code
18748 \begin_layout LyX-Code
18752 \begin_layout LyX-Code
18753 AutomaticProduction true
18756 \begin_layout LyX-Code
18760 \begin_layout LyX-Code
18764 \begin_layout LyX-Code
18768 \begin_layout LyX-Code
18769 TransformCommand Rotate RotationLatexCommand
18772 \begin_layout LyX-Code
18773 TransformCommand Resize ResizeLatexCommand
18776 \begin_layout LyX-Code
18777 Product "$$RotateFront$$ResizeFront
18780 \begin_layout LyX-Code
18785 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18788 \begin_layout LyX-Code
18789 $$ResizeBack$$RotateBack"
18792 \begin_layout LyX-Code
18796 \begin_layout LyX-Code
18797 UpdateResult "$$AbsPath$$Basename.pstex_t"
18800 \begin_layout LyX-Code
18801 Requirement "graphicx"
18804 \begin_layout LyX-Code
18805 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18808 \begin_layout LyX-Code
18809 ReferencedFile latex "$$AbsPath$$Basename.eps"
18812 \begin_layout LyX-Code
18813 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18816 \begin_layout LyX-Code
18820 \begin_layout LyX-Code
18824 \begin_layout LyX-Code
18825 TransformCommand Rotate RotationLatexCommand
18828 \begin_layout LyX-Code
18829 TransformCommand Resize ResizeLatexCommand
18832 \begin_layout LyX-Code
18833 Product "$$RotateFront$$ResizeFront
18836 \begin_layout LyX-Code
18841 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18844 \begin_layout LyX-Code
18845 $$ResizeBack$$RotateBack"
18848 \begin_layout LyX-Code
18849 UpdateFormat pdftex
18852 \begin_layout LyX-Code
18853 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18856 \begin_layout LyX-Code
18857 Requirement "graphicx"
18860 \begin_layout LyX-Code
18861 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18864 \begin_layout LyX-Code
18865 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18868 \begin_layout LyX-Code
18872 \begin_layout LyX-Code
18876 \begin_layout LyX-Code
18877 Product "$$Contents(
18879 "$$AbsPath$$Basename.asc
18884 \begin_layout LyX-Code
18885 UpdateFormat asciixfig
18888 \begin_layout LyX-Code
18889 UpdateResult "$$AbsPath$$Basename.asc"
18892 \begin_layout LyX-Code
18896 \begin_layout LyX-Code
18900 \begin_layout LyX-Code
18901 Product "<graphic fileref=
18903 "$$AbsOrRelPathMaster$$Basename.eps
18908 \begin_layout LyX-Code
18912 \begin_layout LyX-Code
18916 \begin_layout LyX-Code
18917 UpdateResult "$$AbsPath$$Basename.eps"
18920 \begin_layout LyX-Code
18921 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18924 \begin_layout LyX-Code
18925 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18928 \begin_layout LyX-Code
18932 \begin_layout LyX-Code
18933 Product "[XFig: $$FName]"
18936 \begin_layout LyX-Code
18940 \begin_layout LyX-Code
18944 \begin_layout Standard
18945 As you can see, the template is enclosed in
18946 \begin_inset Flex Code
18949 \begin_layout Plain Layout
18955 \SpecialChar \ldots{}
18957 \begin_inset Flex Code
18960 \begin_layout Plain Layout
18967 It contains a header specifying some general settings and, for each supported
18968 primary document file format, a section
18969 \begin_inset Flex Code
18972 \begin_layout Plain Layout
18978 \SpecialChar \ldots{}
18980 \begin_inset Flex Code
18983 \begin_layout Plain Layout
18992 \begin_layout Subsection
18993 The template header
18996 \begin_layout Description
18997 \begin_inset Flex Code
19000 \begin_layout Plain Layout
19001 AutomaticProduction
19002 \begin_inset space ~
19010 Whether the file represented by the template must be generated by LyX.
19011 This command must occur exactly once.
19014 \begin_layout Description
19015 \begin_inset Flex Code
19018 \begin_layout Plain Layout
19020 \begin_inset space ~
19028 A glob pattern that is used in the file dialog to filter out the desired
19030 If there is more than one possible file extension (e.
19031 \begin_inset space \thinspace{}
19035 \begin_inset space \space{}
19039 \begin_inset Flex Code
19042 \begin_layout Plain Layout
19049 \begin_inset Flex Code
19052 \begin_layout Plain Layout
19058 ), use something like
19059 \begin_inset Flex Code
19062 \begin_layout Plain Layout
19069 This command must occur exactly once.
19072 \begin_layout Description
19073 \begin_inset Flex Code
19076 \begin_layout Plain Layout
19078 \begin_inset space ~
19086 The text that is displayed on the button.
19087 This command must occur exactly once.
19090 \begin_layout Description
19091 \begin_inset Flex Code
19094 \begin_layout Plain Layout
19096 \begin_inset space ~
19100 \begin_inset space ~
19108 The help text that is used in the External dialog.
19109 Provide enough information to explain to the user just what the template
19110 can provide him with.
19111 This command must occur exactly once.
19114 \begin_layout Description
19115 \begin_inset Flex Code
19118 \begin_layout Plain Layout
19120 \begin_inset space ~
19128 The file format of the original file.
19129 This must be the name of a format that is known to LyX (see section
19130 \begin_inset space ~
19134 \begin_inset CommandInset ref
19136 reference "sec:Formats"
19142 \begin_inset Quotes eld
19146 \begin_inset Flex Code
19149 \begin_layout Plain Layout
19156 \begin_inset Quotes erd
19159 if the template can handle original files of more than one format.
19160 LyX will attempt to interrogate the file itself in order to deduce its
19161 format in this case.
19162 This command must occur exactly once.
19165 \begin_layout Description
19166 \begin_inset Flex Code
19169 \begin_layout Plain Layout
19171 \begin_inset space ~
19179 A unique name for the template.
19180 It must not contain substitution macros (see below).
19183 \begin_layout Description
19184 \begin_inset Flex Code
19187 \begin_layout Plain Layout
19189 \begin_inset space ~
19192 Rotate|Resize|Clip|Extra
19197 This command specifies which transformations are supported by this template.
19198 It may occur zero or more times.
19199 This command enables the corresponding tabs in the external dialog.
19201 \begin_inset Flex Code
19204 \begin_layout Plain Layout
19210 command must have either a corresponding
19211 \begin_inset Flex Code
19214 \begin_layout Plain Layout
19221 \begin_inset Flex Code
19224 \begin_layout Plain Layout
19231 \begin_inset Flex Code
19234 \begin_layout Plain Layout
19241 Otherwise the transformation will not be supported by that format.
19244 \begin_layout Subsection
19248 \begin_layout Description
19249 \begin_inset Flex Code
19252 \begin_layout Plain Layout
19254 \begin_inset space ~
19257 LaTeX|PDFLaTeX|PlainText|DocBook
19262 The primary document file format that this format definition is for.
19263 Not every template has a sensible representation in all document file formats.
19264 Please define nevertheless a
19265 \begin_inset Flex Code
19268 \begin_layout Plain Layout
19274 section for all templates.
19275 Use a dummy text when no representation is available.
19276 Then you can at least see a reference to the external material in the exported
19280 \begin_layout Description
19281 \begin_inset Flex Code
19284 \begin_layout Plain Layout
19286 \begin_inset space ~
19290 \begin_inset space ~
19298 This command defines an additional macro
19299 \begin_inset Flex Code
19302 \begin_layout Plain Layout
19308 for substitution in
19309 \begin_inset Flex Code
19312 \begin_layout Plain Layout
19320 \begin_inset Flex Code
19323 \begin_layout Plain Layout
19329 itself may contain substitution macros.
19330 The advantage over using
19331 \begin_inset Flex Code
19334 \begin_layout Plain Layout
19341 \begin_inset Flex Code
19344 \begin_layout Plain Layout
19350 is that the substituted value of
19351 \begin_inset Flex Code
19354 \begin_layout Plain Layout
19360 is sanitized so that it is a valid optional argument in the document format.
19361 This command may occur zero or more times.
19364 \begin_layout Description
19365 \begin_inset Flex Code
19368 \begin_layout Plain Layout
19370 \begin_inset space ~
19378 The text that is inserted in the exported document.
19379 This is actually the most important command and can be quite complex.
19380 This command must occur exactly once.
19383 \begin_layout Description
19384 \begin_inset Flex Code
19387 \begin_layout Plain Layout
19389 \begin_inset space ~
19397 This command specifies a preamble snippet that will be included in the
19399 It has to be defined using
19400 \begin_inset Flex Code
19403 \begin_layout Plain Layout
19409 \SpecialChar \ldots{}
19411 \begin_inset Flex Code
19414 \begin_layout Plain Layout
19421 This command may occur zero or more times.
19424 \begin_layout Description
19425 \begin_inset Flex Code
19428 \begin_layout Plain Layout
19430 \begin_inset space ~
19434 \begin_inset space ~
19442 This command denotes files that are created by the conversion process and
19443 are needed for a particular export format.
19444 If the filename is relative, it is interpreted relative to the master document.
19445 This command may be given zero or more times.
19448 \begin_layout Description
19449 \begin_inset Flex Code
19452 \begin_layout Plain Layout
19454 \begin_inset space ~
19462 The name of a required LaTeX package.
19463 The package is included via
19464 \begin_inset Flex Code
19467 \begin_layout Plain Layout
19475 in the LaTeX preamble.
19476 This command may occur zero or more times.
19479 \begin_layout Description
19480 \begin_inset Flex Code
19483 \begin_layout Plain Layout
19485 \begin_inset space ~
19489 \begin_inset space ~
19492 RotationLatexCommand
19497 This command specifies that the built in LaTeX command should be used for
19499 This command may occur once or not at all.
19502 \begin_layout Description
19503 \begin_inset Flex Code
19506 \begin_layout Plain Layout
19508 \begin_inset space ~
19512 \begin_inset space ~
19520 This command specifies that the built in LaTeX command should be used for
19522 This command may occur once or not at all.
19525 \begin_layout Description
19526 \begin_inset Flex Code
19529 \begin_layout Plain Layout
19531 \begin_inset space ~
19535 \begin_inset space ~
19538 RotationLatexOption
19543 This command specifies that rotation is done via an optional argument.
19544 This command may occur once or not at all.
19547 \begin_layout Description
19548 \begin_inset Flex Code
19551 \begin_layout Plain Layout
19553 \begin_inset space ~
19557 \begin_inset space ~
19565 This command specifies that resizing is done via an optional argument.
19566 This command may occur once or not at all.
19569 \begin_layout Description
19570 \begin_inset Flex Code
19573 \begin_layout Plain Layout
19575 \begin_inset space ~
19579 \begin_inset space ~
19587 This command specifies that clipping is done via an optional argument.
19588 This command may occur once or not at all.
19591 \begin_layout Description
19592 \begin_inset Flex Code
19595 \begin_layout Plain Layout
19597 \begin_inset space ~
19601 \begin_inset space ~
19609 This command specifies that an extra optional argument is used.
19610 This command may occur once or not at all.
19613 \begin_layout Description
19614 \begin_inset Flex Code
19617 \begin_layout Plain Layout
19619 \begin_inset space ~
19627 The file format of the converted file.
19628 This must be the name of a format that is known to LyX (see the
19629 \begin_inset Flex MenuItem
19632 \begin_layout Plain Layout
19637 ools\SpecialChar \menuseparator
19642 references\SpecialChar \menuseparator
19643 File Handling\SpecialChar \menuseparator
19650 This command must occur exactly once.
19653 \begin_layout Description
19654 \begin_inset Flex Code
19657 \begin_layout Plain Layout
19659 \begin_inset space ~
19667 The file name of the converted file.
19668 The file name must be absolute.
19669 This command must occur exactly once.
19672 \begin_layout Subsection
19673 Preamble definitions
19676 \begin_layout Standard
19677 The external template configuration file may contain additional preamble
19678 definitions enclosed by
19679 \begin_inset Flex Code
19682 \begin_layout Plain Layout
19688 \SpecialChar \ldots{}
19690 \begin_inset Flex Code
19693 \begin_layout Plain Layout
19700 They can be used by the templates in the
19701 \begin_inset Flex Code
19704 \begin_layout Plain Layout
19713 \begin_layout Section
19714 The substitution mechanism
19717 \begin_layout Standard
19718 When the external material facility invokes an external program, it is done
19719 on the basis of a command defined in the template configuration file.
19720 These commands can contain various macros that are expanded before execution.
19721 Execution always take place in the directory of the containing document.
19724 \begin_layout Standard
19725 Also, whenever external material is to be displayed, the name will be produced
19726 by the substitution mechanism, and most other commands in the template
19727 definition support substitution as well.
19730 \begin_layout Standard
19731 The available macros are the following:
19734 \begin_layout Description
19735 \begin_inset Flex Code
19738 \begin_layout Plain Layout
19739 $$AbsOrRelPathMaster
19744 The file path, absolute or relative to the master LyX document.
19747 \begin_layout Description
19748 \begin_inset Flex Code
19751 \begin_layout Plain Layout
19752 $$AbsOrRelPathParent
19757 The file path, absolute or relative to the LyX document.
19760 \begin_layout Description
19761 \begin_inset Flex Code
19764 \begin_layout Plain Layout
19770 The absolute file path.
19773 \begin_layout Description
19774 \begin_inset Flex Code
19777 \begin_layout Plain Layout
19783 The filename without path and without the extension.
19786 \begin_layout Description
19787 \begin_inset Flex Code
19790 \begin_layout Plain Layout
19792 \begin_inset Quotes eld
19796 \begin_inset Quotes erd
19804 This macro will expand to the contents of the file with the name
19805 \begin_inset Flex Code
19808 \begin_layout Plain Layout
19817 \begin_layout Description
19818 \begin_inset Flex Code
19821 \begin_layout Plain Layout
19827 The file extension (including the dot).
19830 \begin_layout Description
19831 \begin_inset Flex Code
19834 \begin_layout Plain Layout
19840 The filename of the file specified in the external material dialog.
19841 This is either an absolute name, or it is relative to the LyX document.
19844 \begin_layout Description
19845 \begin_inset Flex Code
19848 \begin_layout Plain Layout
19855 \begin_inset Flex Code
19858 \begin_layout Plain Layout
19864 (absolute name or relative to the LyX document).
19867 \begin_layout Description
19868 \begin_inset Flex Code
19871 \begin_layout Plain Layout
19877 The file path, relative to the master LyX document.
19880 \begin_layout Description
19881 \begin_inset Flex Code
19884 \begin_layout Plain Layout
19890 The file path, relative to the LyX document.
19893 \begin_layout Description
19894 \begin_inset Flex Code
19897 \begin_layout Plain Layout
19903 This macro will expand to the absolute path of the system directory.
19904 This is typically used to point to the various helper scripts that are
19908 \begin_layout Description
19909 \begin_inset Flex Code
19912 \begin_layout Plain Layout
19918 A name and full path to a temporary file which will be automatically deleted
19919 whenever the containing document is closed, or the external material insertion
19923 \begin_layout Standard
19924 All path macros contain a trailing directory separator, so you can construct
19926 \begin_inset space \thinspace{}
19930 \begin_inset space \space{}
19933 the absolute filename with
19934 \begin_inset Flex Code
19937 \begin_layout Plain Layout
19938 $$AbsPath$$Basename$$Extension
19946 \begin_layout Standard
19947 The macros above are substituted in all commands unless otherwise noted.
19949 \begin_inset Flex Code
19952 \begin_layout Plain Layout
19958 supports additionally the following substitutions if they are enabled by
19960 \begin_inset Flex Code
19963 \begin_layout Plain Layout
19970 \begin_inset Flex Code
19973 \begin_layout Plain Layout
19982 \begin_layout Description
19983 \begin_inset Flex Code
19986 \begin_layout Plain Layout
19992 The front part of the resize command.
19995 \begin_layout Description
19996 \begin_inset Flex Code
19999 \begin_layout Plain Layout
20005 The back part of the resize command.
20008 \begin_layout Description
20009 \begin_inset Flex Code
20012 \begin_layout Plain Layout
20018 The front part of the rotation command.
20021 \begin_layout Description
20022 \begin_inset Flex Code
20025 \begin_layout Plain Layout
20031 The back part of the rotation command.
20034 \begin_layout Standard
20035 The value string of the
20036 \begin_inset Flex Code
20039 \begin_layout Plain Layout
20045 command supports additionally the following substitutions if they are enabled
20047 \begin_inset Flex Code
20050 \begin_layout Plain Layout
20057 \begin_inset Flex Code
20060 \begin_layout Plain Layout
20069 \begin_layout Description
20070 \begin_inset Flex Code
20073 \begin_layout Plain Layout
20082 \begin_layout Description
20083 \begin_inset Flex Code
20086 \begin_layout Plain Layout
20095 \begin_layout Description
20096 \begin_inset Flex Code
20099 \begin_layout Plain Layout
20108 \begin_layout Description
20109 \begin_inset Flex Code
20112 \begin_layout Plain Layout
20118 The rotation option.
20121 \begin_layout Standard
20122 You may ask why there are so many path macros.
20123 There are mainly two reasons:
20126 \begin_layout Enumerate
20127 Relative and absolute file names should remain relative or absolute, respectivel
20129 Users may have reasons to prefer either form.
20130 Relative names are useful for portable documents that should work on different
20131 machines, for example.
20132 Absolute names may be required by some programs.
20135 \begin_layout Enumerate
20136 LaTeX treats relative file names differently than LyX and other programs
20137 in nested included files.
20138 For LyX, a relative file name is always relative to the document that contains
20140 For LaTeX, it is always relative to the master document.
20141 These two definitions are identical if you have only one document, but
20142 differ if you have a master document that includes part documents.
20143 That means that relative filenames must be transformed when presented to
20145 Fortunately LyX does this automatically for you if you choose the right
20149 \begin_layout Standard
20150 So which path macro should be used in new template definitions? The rule
20154 \begin_layout Itemize
20156 \begin_inset Flex Code
20159 \begin_layout Plain Layout
20165 if an absolute path is required.
20168 \begin_layout Itemize
20170 \begin_inset Flex Code
20173 \begin_layout Plain Layout
20174 $$AbsOrRelPathMaster
20179 if the substituted string is some kind of LaTeX input.
20182 \begin_layout Itemize
20184 \begin_inset Flex Code
20187 \begin_layout Plain Layout
20188 $$AbsOrRelPathParent
20193 in order to preserve the user's choice.
20196 \begin_layout Standard
20197 There are special cases where this rule does not work and e.
20198 \begin_inset space \thinspace{}
20202 \begin_inset space \space{}
20205 relative names are needed, but normally it will work just fine.
20206 One example for such a case is the command
20207 \begin_inset Flex Code
20210 \begin_layout Plain Layout
20211 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20216 in the XFig template above: We can't use the absolute name because the
20218 \begin_inset Flex Code
20221 \begin_layout Plain Layout
20227 files needs the relative name in order to rewrite the file content.
20230 \begin_layout Section
20231 Security discussion
20232 \begin_inset CommandInset label
20234 name "sec:Security-discussion"
20241 \begin_layout Standard
20242 The external material feature interfaces with a lot of external programs
20243 and does so automatically, so we have to consider the security implications
20245 In particular, since you have the option of including your own filenames
20246 and/or parameter strings and those are expanded into a command, it seems
20247 that it would be possible to create a malicious document which executes
20248 arbitrary commands when a user views or prints the document.
20249 This is something we definitely want to avoid.
20252 \begin_layout Standard
20253 However, since the external program commands are specified in the template
20254 configuration file only, there are no security issues if LyX is properly
20255 configured with safe templates only.
20256 This is so because the external programs are invoked with the
20257 \begin_inset Flex Code
20260 \begin_layout Plain Layout
20266 -system call rather than the
20267 \begin_inset Flex Code
20270 \begin_layout Plain Layout
20276 system-call, so it's not possible to execute arbitrary commands from the
20277 filename or parameter section via the shell.
20280 \begin_layout Standard
20281 This also implies that you are restricted in what command strings you can
20282 use in the external material templates.
20283 In particular, pipes and redirection are not readily available.
20284 This has to be so if LyX should remain safe.
20285 If you want to use some of the shell features, you should write a safe
20286 script to do this in a controlled manner, and then invoke the script from
20287 the command string.
20291 \begin_layout Standard
20292 It is possible to design a template that interacts directly with the shell,
20293 but since this would allow a malicious user to execute arbitrary commands
20294 by writing clever filenames and/or parameters, we generally recommend that
20295 you only use safe scripts that work with the
20296 \begin_inset Flex Code
20299 \begin_layout Plain Layout
20305 system call in a controlled manner.
20306 Of course, for use in a controlled environment, it can be tempting to just
20307 fall back to use ordinary shell scripts.
20308 If you do so, be aware that you
20312 provide an easily exploitable security hole in your system.
20313 Of course it stands to reason that such unsafe templates will never be
20314 included in the standard LyX distribution, although we do encourage people
20315 to submit new templates in the open source tradition.
20316 But LyX as shipped from the official distribution channels will never have
20320 \begin_layout Standard
20321 Including external material provides a lot of power, and you have to be
20322 careful not to introduce security hazards with this power.
20323 A subtle error in a single line in an innocent looking script can open
20324 the door to huge security problems.
20325 So if you do not fully understand the issues, we recommend that you consult
20326 a knowledgeable security professional or the LyX development team if you
20327 have any questions about whether a given template is safe or not.
20328 And do this before you use it in an uncontrolled environment.