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 CharStyle: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 may be be any valid identifier not used by a pre-existing inset.
13997 The identifier may include spaces, but in that case the whole thing must
13998 be wrapped in quotes.
13999 It may also include a namespace identifier, preceding a colon, such as
14001 \begin_inset Quotes eld
14005 \begin_inset Flex Code
14008 \begin_layout Plain Layout
14015 \begin_inset Quotes erd
14019 Note that the definition of a flex inset
14024 \begin_inset Flex Code
14027 \begin_layout Plain Layout
14033 entry, declaring which type of inset it defines.
14036 \begin_layout Standard
14038 \begin_inset Flex Code
14041 \begin_layout Plain Layout
14047 definition can contain the following entries:
14050 \begin_layout Description
14051 \begin_inset Flex Code
14054 \begin_layout Plain Layout
14060 The color for the inset's background.
14061 The valid colors are defined in
14062 \begin_inset Flex Code
14065 \begin_layout Plain Layout
14074 \begin_layout Description
14075 \begin_inset Flex Code
14078 \begin_layout Plain Layout
14085 \begin_inset Flex Code
14088 \begin_layout Plain Layout
14097 \begin_inset Flex Code
14100 \begin_layout Plain Layout
14106 ] Whether to use the content of the inset as the label, when the inset is
14111 \begin_layout Description
14112 \begin_inset Flex Code
14115 \begin_layout Plain Layout
14121 As with paragraph styles (see page
14122 \begin_inset CommandInset ref
14124 reference "des:CopyStyle"
14131 \begin_layout Description
14132 \begin_inset Flex Code
14135 \begin_layout Plain Layout
14142 \begin_inset Flex Code
14145 \begin_layout Plain Layout
14154 \begin_inset Flex Code
14157 \begin_layout Plain Layout
14163 ] Indicates whether the user may employ the Paragraph Settings dialog to
14164 customize the paragraph.
14167 \begin_layout Description
14168 \begin_inset Flex Code
14171 \begin_layout Plain Layout
14178 \begin_inset Flex Code
14181 \begin_layout Plain Layout
14188 \begin_inset Flex Code
14191 \begin_layout Plain Layout
14198 \begin_inset Flex Code
14201 \begin_layout Plain Layout
14207 , describing the rendering style used for the inset's frame and buttons.
14208 Footnotes generally use
14209 \begin_inset Flex Code
14212 \begin_layout Plain Layout
14218 , ERT insets generally
14219 \begin_inset Flex Code
14222 \begin_layout Plain Layout
14228 , and character styles
14229 \begin_inset Flex Code
14232 \begin_layout Plain Layout
14241 \begin_layout Description
14242 \begin_inset Flex Code
14245 \begin_layout Plain Layout
14252 \begin_inset Flex Code
14255 \begin_layout Plain Layout
14262 \begin_inset Flex Code
14265 \begin_layout Plain Layout
14274 \begin_inset Flex Code
14277 \begin_layout Plain Layout
14284 \begin_inset Flex Code
14287 \begin_layout Plain Layout
14294 Indicates whether the environment will stand on its own in LaTeX output
14295 or will appear inline with the surrounding text.
14296 If set to false, it is supposed that the LaTeX environment ignores white
14297 space (including one newline character) after the
14298 \begin_inset Flex Code
14301 \begin_layout Plain Layout
14314 \begin_inset Flex Code
14317 \begin_layout Plain Layout
14333 \begin_layout Description
14334 \begin_inset Flex Code
14337 \begin_layout Plain Layout
14343 Required at the end of the InsetLayout declarations.
14346 \begin_layout Description
14347 \begin_inset Flex Code
14350 \begin_layout Plain Layout
14356 The font used for both the text body
14362 \begin_inset space ~
14366 \begin_inset CommandInset ref
14368 reference "sub:Font-description"
14373 Note that defining this font automatically defines the
14374 \begin_inset Flex Code
14377 \begin_layout Plain Layout
14383 to the same value, so define this first and define
14384 \begin_inset Flex Code
14387 \begin_layout Plain Layout
14393 later if you want them to be different.
14396 \begin_layout Description
14397 \begin_inset Flex Code
14400 \begin_layout Plain Layout
14407 \begin_inset Quotes eld
14411 \begin_inset Quotes erd
14414 language, leading to Left-to-Right (latin) output, e.
14415 \begin_inset space \thinspace{}
14419 \begin_inset space \space{}
14422 in TeX code or URL.
14426 \begin_layout Description
14427 \begin_inset Flex Code
14430 \begin_layout Plain Layout
14437 \begin_inset Flex Code
14440 \begin_layout Plain Layout
14449 \begin_inset Flex Code
14452 \begin_layout Plain Layout
14458 ] Indicates whether the
14459 \begin_inset Flex Code
14462 \begin_layout Plain Layout
14468 should be used or, instead, the user can change the paragraph style used
14473 \begin_layout Description
14474 \begin_inset Flex Code
14477 \begin_layout Plain Layout
14483 As with paragraph styles (see page
14484 \begin_inset CommandInset ref
14485 LatexCommand pageref
14486 reference "des:FreeSpacing"
14494 \begin_layout Description
14495 \begin_inset Flex Code
14498 \begin_layout Plain Layout
14504 These tags control XHTML output.
14506 \begin_inset CommandInset ref
14508 reference "sec:Tags-for-XHTML"
14515 \begin_layout Description
14516 \begin_inset Flex Code
14519 \begin_layout Plain Layout
14526 \begin_inset Flex Code
14529 \begin_layout Plain Layout
14538 \begin_inset Flex Code
14541 \begin_layout Plain Layout
14547 ] Whether to include the contents of this inset in the strings generated
14548 for the `Outline' pane.
14549 One would not, for example, want the content of a footnote in a section
14550 header to be included in the TOC displayed in the outline, but one would
14551 normally want the content of a character style displayed.
14552 Default is false: not to include.
14555 \begin_layout Description
14556 \begin_inset Flex Code
14559 \begin_layout Plain Layout
14565 As with paragraph styles (see page
14566 \begin_inset CommandInset ref
14567 LatexCommand pageref
14568 reference "des:KeepEmpty"
14576 \begin_layout Description
14577 \begin_inset Flex Code
14580 \begin_layout Plain Layout
14586 The font used for the label.
14588 \begin_inset space ~
14592 \begin_inset CommandInset ref
14594 reference "sub:Font-description"
14599 Note that this definition can never appear before
14600 \begin_inset Flex Code
14603 \begin_layout Plain Layout
14609 , lest it be ineffective.
14612 \begin_layout Description
14613 \begin_inset Flex Code
14616 \begin_layout Plain Layout
14622 What will be displayed on the button or elsewhere as the inset label.
14624 \begin_inset Flex Code
14627 \begin_layout Plain Layout
14634 \begin_inset Flex Code
14637 \begin_layout Plain Layout
14643 ) modify this label on the fly.
14646 \begin_layout Description
14647 \begin_inset Flex Code
14650 \begin_layout Plain Layout
14656 The name of the corresponding LaTeX stuff.
14657 Either the environment or command name.
14660 \begin_layout Description
14661 \begin_inset Flex Code
14664 \begin_layout Plain Layout
14670 The optional parameter for the corresponding
14671 \begin_inset Flex Code
14674 \begin_layout Plain Layout
14680 stuff, including possible bracket pairs like
14681 \begin_inset Flex Code
14684 \begin_layout Plain Layout
14691 This parameter cannot be changed from within LyX.
14694 \begin_layout Description
14695 \begin_inset Flex Code
14698 \begin_layout Plain Layout
14704 As with paragraph styles (see page
14705 \begin_inset CommandInset ref
14706 LatexCommand pageref
14707 reference "des:LatexType"
14714 \begin_layout Description
14715 \begin_inset Flex Code
14718 \begin_layout Plain Layout
14725 \begin_inset Flex Code
14728 \begin_layout Plain Layout
14735 \begin_inset Flex Code
14738 \begin_layout Plain Layout
14745 \begin_inset Flex Code
14748 \begin_layout Plain Layout
14755 \begin_inset Flex Code
14758 \begin_layout Plain Layout
14764 (indicating a dummy definition ending definitions of charstyles, etc).
14765 This entry is required in and is only meaningful for Flex insets.
14766 Among other things, it determines on which menu this inset will appear.
14768 \begin_inset Flex Code
14771 \begin_layout Plain Layout
14778 \begin_inset Flex Code
14781 \begin_layout Plain Layout
14788 \begin_inset Flex Code
14791 \begin_layout Plain Layout
14799 \begin_inset Flex Code
14802 \begin_layout Plain Layout
14808 can be set to true for charstyle insets, if you wish, by setting it
14813 \begin_inset Flex Code
14816 \begin_layout Plain Layout
14825 \begin_layout Description
14826 \begin_inset Flex Code
14829 \begin_layout Plain Layout
14836 \begin_inset Flex Code
14839 \begin_layout Plain Layout
14848 \begin_inset Flex Code
14851 \begin_layout Plain Layout
14857 ] Whether multiple paragraphs are permitted in this inset.
14859 \begin_inset Flex Code
14862 \begin_layout Plain Layout
14868 to the same value and
14869 \begin_inset Flex Code
14872 \begin_layout Plain Layout
14878 to the opposite value.
14879 These can be reset to other values, if they are used
14884 \begin_inset Flex Code
14887 \begin_layout Plain Layout
14897 \begin_layout Description
14898 \begin_inset Flex Code
14901 \begin_layout Plain Layout
14908 \begin_inset Flex Code
14911 \begin_layout Plain Layout
14920 \begin_inset Flex Code
14923 \begin_layout Plain Layout
14929 ] Whether fragile commands in this inset should be
14930 \begin_inset Flex Code
14933 \begin_layout Plain Layout
14946 whether the command should itself be protected.) Default is false.
14949 \begin_layout Description
14950 \begin_inset Flex Code
14953 \begin_layout Plain Layout
14960 \begin_inset Flex Code
14963 \begin_layout Plain Layout
14972 \begin_inset Flex Code
14975 \begin_layout Plain Layout
14981 ] As with paragraph styles (see page
14982 \begin_inset CommandInset ref
14983 LatexCommand pageref
14984 reference "des:ParbreakIsNewline"
14992 \begin_layout Description
14993 \begin_inset Flex Code
14996 \begin_layout Plain Layout
15003 \begin_inset Flex Code
15006 \begin_layout Plain Layout
15015 \begin_inset Flex Code
15018 \begin_layout Plain Layout
15024 ] As with paragraph styles (see page
15025 \begin_inset CommandInset ref
15026 LatexCommand pageref
15027 reference "des:PassThru"
15035 \begin_layout Description
15036 \begin_inset Flex Code
15039 \begin_layout Plain Layout
15045 As with paragraph styles (see page
15046 \begin_inset CommandInset ref
15047 LatexCommand pageref
15048 reference "des:Preamble"
15055 \begin_layout Description
15056 \begin_inset Flex Code
15059 \begin_layout Plain Layout
15066 \begin_inset Flex Code
15069 \begin_layout Plain Layout
15075 ] The prefix to use when creating labels referring to insets of this type.
15076 This allows the use of formatted references.
15079 \begin_layout Description
15080 \begin_inset Flex Code
15083 \begin_layout Plain Layout
15090 \begin_inset Flex Code
15093 \begin_layout Plain Layout
15099 ] As with paragraph styles (see page
15100 \begin_inset CommandInset ref
15101 LatexCommand pageref
15102 reference "des:Requires"
15109 \begin_layout Description
15110 \begin_inset Flex Code
15113 \begin_layout Plain Layout
15120 \begin_inset Flex Code
15123 \begin_layout Plain Layout
15130 \begin_inset Flex Code
15133 \begin_layout Plain Layout
15141 ] Whether this inset should use the font of its surrounding environment
15143 Default is true: uses its own.
15146 \begin_layout Description
15147 \begin_inset Flex Code
15150 \begin_layout Plain Layout
15157 \begin_inset Flex Code
15160 \begin_layout Plain Layout
15167 \begin_inset Flex Code
15170 \begin_layout Plain Layout
15178 ] Spellcheck the contents of this inset.
15182 \begin_layout Subsection
15184 \begin_inset CommandInset label
15186 name "sub:Counters"
15193 \begin_layout Standard
15194 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15196 \begin_inset Flex MenuItem
15199 \begin_layout Plain Layout
15206 \begin_inset Flex MenuItem
15209 \begin_layout Plain Layout
15215 , \SpecialChar \ldots{}
15216 ) in the text class itself.
15217 The standard counters are defined in the file
15218 \begin_inset Flex Code
15221 \begin_layout Plain Layout
15227 , so you may have to do no more than add
15230 \begin_layout LyX-Code
15231 Input stdcounters.inc
15234 \begin_layout Standard
15235 to your layout file to get them to work.
15236 But if you want to define custom counters, then you can do so.
15237 The counter declaration must begin with:
15240 \begin_layout LyX-Code
15241 Counter CounterName
15244 \begin_layout Standard
15246 \begin_inset Flex Code
15249 \begin_layout Plain Layout
15255 ' is replaced by the name of the counter.
15256 And it must end with
15257 \begin_inset Quotes eld
15261 \begin_inset Flex Code
15264 \begin_layout Plain Layout
15271 \begin_inset Quotes erd
15275 The following parameters can also be used:
15278 \begin_layout Description
15279 \begin_inset Flex Code
15282 \begin_layout Plain Layout
15289 \begin_inset Flex Code
15292 \begin_layout Plain Layout
15299 \begin_inset Quotes erd
15303 \begin_inset Quotes erd
15306 ] When defined, this string defines how the counter is displayed.
15307 Setting this value sets
15308 \begin_inset Flex Code
15311 \begin_layout Plain Layout
15312 LabelStringAppendix
15318 The following special constructs can be used in the string:
15322 \begin_layout Itemize
15323 \begin_inset Flex Code
15326 \begin_layout Plain Layout
15334 will be replaced by the expansion of the
15335 \begin_inset Flex Code
15338 \begin_layout Plain Layout
15345 \begin_inset Flex Code
15348 \begin_layout Plain Layout
15349 LabelStringAppendix
15355 \begin_inset Flex Code
15358 \begin_layout Plain Layout
15368 \begin_layout Itemize
15369 counter values can be expressed using LaTeX-like macros
15370 \begin_inset Flex Code
15373 \begin_layout Plain Layout
15390 \begin_inset Flex Code
15393 \begin_layout Plain Layout
15405 \begin_layout Plain Layout
15415 Actually, the situation is a bit more complicated: any
15434 other than those described below will produce arabic numerals.
15435 It would not be surprising to see this change in the future.
15441 \begin_inset Flex Code
15444 \begin_layout Plain Layout
15450 : 1, 2, 3,\SpecialChar \ldots{}
15452 \begin_inset Flex Code
15455 \begin_layout Plain Layout
15461 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15463 \begin_inset Flex Code
15466 \begin_layout Plain Layout
15472 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15474 \begin_inset Flex Code
15477 \begin_layout Plain Layout
15483 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15485 \begin_inset Flex Code
15488 \begin_layout Plain Layout
15494 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15496 \begin_inset Flex Code
15499 \begin_layout Plain Layout
15505 for hebrew numerals.
15509 \begin_layout Standard
15510 If LabelString is not defined, a default value is constructed as follows:
15511 if the counter has a master counter
15512 \begin_inset Flex Code
15515 \begin_layout Plain Layout
15522 \begin_inset Flex Code
15525 \begin_layout Plain Layout
15532 \begin_inset Flex Code
15535 \begin_layout Plain Layout
15545 is used; otherwise the string
15546 \begin_inset Flex Code
15549 \begin_layout Plain Layout
15560 \begin_layout Description
15561 \begin_inset Flex Code
15564 \begin_layout Plain Layout
15565 LabelStringAppendix
15571 \begin_inset Flex Code
15574 \begin_layout Plain Layout
15581 \begin_inset Quotes erd
15585 \begin_inset Quotes erd
15589 \begin_inset Flex Code
15592 \begin_layout Plain Layout
15598 , but for use in the Appendix.
15601 \begin_layout Description
15602 \begin_inset Flex Code
15605 \begin_layout Plain Layout
15612 \begin_inset Flex Code
15615 \begin_layout Plain Layout
15622 \begin_inset Quotes erd
15626 \begin_inset Quotes erd
15629 ] A format for use with formatted references to this counter.
15630 For example, one might want to have references to section numbers appear
15632 \begin_inset Quotes eld
15636 \begin_inset Quotes erd
15640 The string should contain
15641 \begin_inset Quotes eld
15645 \begin_inset Quotes erd
15649 This will be replaced by the counter number itself.
15650 So, for sections, it would be: Section ##.
15653 \begin_layout Description
15654 \begin_inset Flex Code
15657 \begin_layout Plain Layout
15664 \begin_inset Flex Code
15667 \begin_layout Plain Layout
15674 \begin_inset Quotes erd
15678 \begin_inset Quotes erd
15681 ] If this is set to the name of another counter, the present counter will
15682 be reset every time the other one is increased.
15684 \begin_inset Flex Code
15687 \begin_layout Plain Layout
15694 \begin_inset Flex Code
15697 \begin_layout Plain Layout
15706 \begin_layout Subsection
15708 \begin_inset CommandInset label
15710 name "sub:Font-description"
15717 \begin_layout Standard
15718 A font description looks like this:
15721 \begin_layout LyX-Code
15731 \begin_layout LyX-Code
15735 \begin_layout LyX-Code
15739 \begin_layout Standard
15740 The following commands are available:
15743 \begin_layout Description
15744 \begin_inset Flex Code
15747 \begin_layout Plain Layout
15754 \begin_inset Flex Code
15757 \begin_layout Plain Layout
15766 \begin_inset Flex Code
15769 \begin_layout Plain Layout
15776 \begin_inset Flex Code
15779 \begin_layout Plain Layout
15786 \begin_inset Flex Code
15789 \begin_layout Plain Layout
15796 \begin_inset Flex Code
15799 \begin_layout Plain Layout
15806 \begin_inset Flex Code
15809 \begin_layout Plain Layout
15816 \begin_inset Flex Code
15819 \begin_layout Plain Layout
15826 \begin_inset Flex Code
15829 \begin_layout Plain Layout
15836 \begin_inset Flex Code
15839 \begin_layout Plain Layout
15848 \begin_layout Description
15849 \begin_inset Flex Code
15852 \begin_layout Plain Layout
15859 \begin_inset Flex Code
15862 \begin_layout Plain Layout
15871 \begin_inset Flex Code
15874 \begin_layout Plain Layout
15881 \begin_inset Flex Code
15884 \begin_layout Plain Layout
15893 \begin_layout Description
15894 \begin_inset Flex Code
15897 \begin_layout Plain Layout
15904 \begin_inset Flex Code
15907 \begin_layout Plain Layout
15913 ] Valid arguments are:
15914 \begin_inset Flex Code
15917 \begin_layout Plain Layout
15924 \begin_inset Flex Code
15927 \begin_layout Plain Layout
15934 \begin_inset Flex Code
15937 \begin_layout Plain Layout
15944 \begin_inset Flex Code
15947 \begin_layout Plain Layout
15954 \begin_inset Flex Code
15957 \begin_layout Plain Layout
15964 \begin_inset Flex Code
15967 \begin_layout Plain Layout
15974 Each of these turns on or off the corresponding attribute.
15976 \begin_inset Flex Code
15979 \begin_layout Plain Layout
15985 turns on emphasis, and
15986 \begin_inset Flex Code
15989 \begin_layout Plain Layout
15997 \begin_inset Newline newline
16000 If the latter seems puzzling, remember that the font settings for the present
16001 context are generally inherited from the surrounding context.
16003 \begin_inset Flex Code
16006 \begin_layout Plain Layout
16012 would turn off the emphasis that was anyway in effect, say, in a theorem
16016 \begin_layout Description
16017 \begin_inset Flex Code
16020 \begin_layout Plain Layout
16027 \begin_inset Flex Code
16030 \begin_layout Plain Layout
16039 \begin_inset Flex Code
16042 \begin_layout Plain Layout
16051 \begin_layout Description
16052 \begin_inset Flex Code
16055 \begin_layout Plain Layout
16062 \begin_inset Flex Code
16065 \begin_layout Plain Layout
16074 \begin_inset Flex Code
16077 \begin_layout Plain Layout
16084 \begin_inset Flex Code
16087 \begin_layout Plain Layout
16094 \begin_inset Flex Code
16097 \begin_layout Plain Layout
16106 \begin_layout Description
16107 \begin_inset Flex Code
16110 \begin_layout Plain Layout
16117 \begin_inset Flex Code
16120 \begin_layout Plain Layout
16127 \begin_inset Flex Code
16130 \begin_layout Plain Layout
16137 \begin_inset Flex Code
16140 \begin_layout Plain Layout
16149 \begin_inset Flex Code
16152 \begin_layout Plain Layout
16159 \begin_inset Flex Code
16162 \begin_layout Plain Layout
16169 \begin_inset Flex Code
16172 \begin_layout Plain Layout
16179 \begin_inset Flex Code
16182 \begin_layout Plain Layout
16189 \begin_inset Flex Code
16192 \begin_layout Plain Layout
16201 \begin_layout Subsection
16202 \begin_inset CommandInset label
16204 name "sub:Citation-format-description"
16208 Citation format description
16211 \begin_layout Standard
16213 \begin_inset Flex Code
16216 \begin_layout Plain Layout
16222 blocks are used to describe how bibliographic information should be displayed,
16223 both within LyX itself (in the citation dialog and in tooltips, for example)
16224 and in XHTML output.
16225 Such a block might look like this:
16228 \begin_layout LyX-Code
16232 \begin_layout LyX-Code
16236 \begin_layout LyX-Code
16240 \begin_layout LyX-Code
16244 \begin_layout Standard
16245 The individual lines define how the bibliographic information associated
16246 with an article or book, respectively, is to be displayed, and such a definitio
16247 n can be given for any `entry type' that might be present in a BibTeX file.
16248 LyX defines a default format in the source code that will be used if no
16249 specific definition has been given.
16250 LyX predefines several formats in the file
16251 \begin_inset Flex Code
16254 \begin_layout Plain Layout
16260 , which is included in most of LyX's document classes.
16263 \begin_layout Standard
16264 The definitions use a simple language that allows BibTeX keys to be replaced
16266 Keys should be enclosed in
16267 \begin_inset Flex Code
16270 \begin_layout Plain Layout
16277 \begin_inset Flex Code
16280 \begin_layout Plain Layout
16287 So a simple definition might look like this:
16290 \begin_layout LyX-Code
16292 \begin_inset Quotes eld
16296 \begin_inset Quotes erd
16302 \begin_layout Standard
16303 This would print the author, followed by a comma, followed by the title,
16304 in quotes, followed by a period.
16307 \begin_layout Standard
16308 Of course, sometimes you may want to print a key only if it exists.
16309 This can be done by using a conditional construction, such as:
16310 \begin_inset Flex Code
16313 \begin_layout Plain Layout
16315 \begin_inset space ~
16325 \begin_inset Flex Code
16328 \begin_layout Plain Layout
16334 key exists, then print
16335 \begin_inset Quotes eld
16339 \begin_inset space ~
16343 \begin_inset Quotes erd
16346 followed by the volume key.
16347 It is also possible to have an else clause in the conditional, such as:
16349 \begin_inset Flex Code
16352 \begin_layout Plain Layout
16353 {%author%[[%author%]][[%editor%, ed.]]}
16360 \begin_inset Flex Code
16363 \begin_layout Plain Layout
16369 key is printed if it exists; otherwise, the editor key is printed, followed
16371 \begin_inset Quotes eld
16375 \begin_inset space ~
16379 \begin_inset Quotes erd
16382 Note that the key is again enclosed in
16383 \begin_inset Flex Code
16386 \begin_layout Plain Layout
16392 signs; the entire conditional is enclosed in braces; and the if and else
16393 clauses are enclosed in double brackets,
16394 \begin_inset Quotes eld
16398 \begin_inset Flex Code
16401 \begin_layout Plain Layout
16408 \begin_inset Quotes eld
16412 \begin_inset Quotes eld
16416 \begin_inset Flex Code
16419 \begin_layout Plain Layout
16426 \begin_inset Quotes erd
16430 There must be no space between any of these.
16433 \begin_layout Standard
16434 There is one other piece of syntax available in definitions, which looks
16436 \begin_inset Flex Code
16439 \begin_layout Plain Layout
16446 This defines a piece of formatting information that is to be used when
16448 \begin_inset Quotes eld
16452 \begin_inset Quotes erd
16456 Obviously, we do not want to output HTML tags when writing plain text,
16457 so they should be wrapped in
16458 \begin_inset Quotes eld
16462 \begin_inset Quotes erd
16466 \begin_inset Quotes eld
16470 \begin_inset Quotes erd
16476 \begin_layout Standard
16477 Two special sorts of definitions are also possible in a
16478 \begin_inset Flex Code
16481 \begin_layout Plain Layout
16488 An example of the first would be:
16491 \begin_layout LyX-Code
16493 \begin_inset Quotes eld
16497 \begin_inset Quotes erd
16503 \begin_layout Standard
16504 This is an abbreviation, or macro, and it can be used by treating it as
16506 \begin_inset Flex Code
16509 \begin_layout Plain Layout
16517 \begin_inset Flex Code
16520 \begin_layout Plain Layout
16526 exactly as it would treat its definition.
16527 So, let us issue the obvious
16535 \begin_layout LyX-Code
16539 \begin_layout Standard
16540 or anything like it.
16541 LyX shouldn't go into an infinite loop, but it may go into a long one before
16545 \begin_layout Standard
16546 The second sort of special definition might look like this:
16549 \begin_layout LyX-Code
16553 \begin_layout Standard
16554 This defines a translatable piece of text, which allows relevant parts of
16555 the bibliography to be translated.
16556 It can be included in a definition by treating it as a key:
16557 \begin_inset Flex Code
16560 \begin_layout Plain Layout
16567 Several of these are predefined in
16568 \begin_inset Flex Code
16571 \begin_layout Plain Layout
16578 Note that these are not macros, in the sense just defined.
16579 They will not be expanded.
16582 \begin_layout Standard
16583 So here then is an example that use all these features:
16586 \begin_layout LyX-Code
16587 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16590 \begin_layout Standard
16591 This defines a macro that prints the author, followed by a comma, if the
16593 \begin_inset Flex Code
16596 \begin_layout Plain Layout
16602 key is defined, or else prints the name of the editor, followed by the
16604 \begin_inset Flex Code
16607 \begin_layout Plain Layout
16613 or its translation (it is by default
16614 \begin_inset Quotes eld
16618 \begin_inset Quotes erd
16622 \begin_inset Flex Code
16625 \begin_layout Plain Layout
16632 Note that this is in fact defined in
16633 \begin_inset Flex Code
16636 \begin_layout Plain Layout
16642 , so you can use it in your own definitions, or re-definitions, if you load
16646 \begin_layout Section
16647 \begin_inset CommandInset label
16649 name "sec:Tags-for-XHTML"
16653 Tags for XHTML output
16656 \begin_layout Standard
16657 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16658 by layout information.
16659 In general, LyX provides sensible defaults and, as mentioned earlier, it
16660 will even construct default CSS style rules from the other layout tags.
16661 For example, LyX will attempt to use the information provided in the
16662 \begin_inset Flex Code
16665 \begin_layout Plain Layout
16671 declaration for the Chapter style to write CSS that will appropriately
16672 format chapter headings.
16675 \begin_layout Standard
16676 In many cases, then, you may not have to do anything at all to get acceptable
16677 XHTML output for your own environments, custom insets, and so forth.
16678 But in some cases you will, and so LyX provides a number of layout tags
16679 that can be used to customize the XHTML and CSS that are generated.
16682 \begin_layout Standard
16683 Note that there are two tags,
16684 \begin_inset Flex Code
16687 \begin_layout Plain Layout
16694 \begin_inset Flex Code
16697 \begin_layout Plain Layout
16703 that may appear outside style and inset declarations.
16705 \begin_inset CommandInset ref
16707 reference "sub:General-text-class"
16711 for details on these.
16714 \begin_layout Subsection
16715 \begin_inset CommandInset label
16717 name "sub:Paragraph-Style-XHTML"
16724 \begin_layout Standard
16725 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16726 dealing with a normal paragraph, a command, or an environment, where this
16727 is itself determined by the contents of the corresponding
16728 \begin_inset Flex Code
16731 \begin_layout Plain Layout
16741 \begin_layout Standard
16742 For a command or normal paragraph, the output XHTML has the following form:
16745 \begin_layout LyX-Code
16747 \begin_inset Quotes erd
16751 \begin_inset Quotes erd
16757 \begin_layout LyX-Code
16759 \begin_inset Quotes erd
16763 \begin_inset Quotes erd
16769 \begin_layout LyX-Code
16770 Contents of the paragraph.
16773 \begin_layout LyX-Code
16777 \begin_layout Standard
16778 The label tags are of course omitted if the paragraph does not have a label.
16781 \begin_layout Standard
16782 For an environment that is not some sort of list, the XHTML takes this form:
16785 \begin_layout LyX-Code
16787 \begin_inset Quotes erd
16791 \begin_inset Quotes erd
16797 \begin_layout LyX-Code
16799 \begin_inset Quotes erd
16803 \begin_inset Quotes erd
16807 \begin_inset Quotes erd
16811 \begin_inset Quotes erd
16814 >Environment Label</labeltag>First paragraph.</itemtag>
16817 \begin_layout LyX-Code
16818 <itemtag>Second paragraph.</itemtag>
16821 \begin_layout LyX-Code
16825 \begin_layout Standard
16826 Note that the label is output only for the first paragraph, as it should
16827 be for a theorem, for example.
16831 \begin_layout Standard
16832 For a list, we have one of these forms:
16835 \begin_layout LyX-Code
16837 \begin_inset Quotes erd
16841 \begin_inset Quotes erd
16847 \begin_layout LyX-Code
16849 \begin_inset Quotes erd
16853 \begin_inset Quotes erd
16857 \begin_inset Quotes erd
16861 \begin_inset Quotes erd
16864 >List Label</labeltag>First item.</itemtag>
16867 \begin_layout LyX-Code
16869 \begin_inset Quotes erd
16873 \begin_inset Quotes erd
16877 \begin_inset Quotes erd
16881 \begin_inset Quotes erd
16884 >List Label</labeltag>Second item.</itemtag>
16887 \begin_layout LyX-Code
16891 \begin_layout LyX-Code
16895 \begin_layout LyX-Code
16897 \begin_inset Quotes erd
16901 \begin_inset Quotes erd
16907 \begin_layout LyX-Code
16909 \begin_inset Quotes erd
16913 \begin_inset Quotes erd
16916 >List Label</labeltag><itemtag attr=
16917 \begin_inset Quotes erd
16921 \begin_inset Quotes erd
16924 >First item.</itemtag>
16927 \begin_layout LyX-Code
16929 \begin_inset Quotes erd
16933 \begin_inset Quotes erd
16936 >List Label</labeltag><itemtag attr=
16937 \begin_inset Quotes erd
16941 \begin_inset Quotes erd
16944 >Second item.</itemtag>
16947 \begin_layout LyX-Code
16951 \begin_layout Standard
16952 Note the different orders of
16953 \begin_inset Flex Code
16956 \begin_layout Plain Layout
16963 \begin_inset Flex Code
16966 \begin_layout Plain Layout
16973 Which order we get depends upon the setting of
16974 \begin_inset Flex Code
16977 \begin_layout Plain Layout
16984 \begin_inset Flex Code
16987 \begin_layout Plain Layout
16993 is false (the default), you get the first of these, with the label within
16994 the item; if true, you get the second, with the label outside the item.
16997 \begin_layout Standard
16998 The specific tags and attributes output for each paragraph type can be controlle
16999 d by means of the layout tags we are about to describe.
17000 As mentioned earlier, however, LyX uses sensible defaults for many of these,
17001 so you often may not need to do very much to get good XHTML output.
17002 Think of the available tags as there so you can tweak things to your liking.
17005 \begin_layout Description
17006 \begin_inset Flex Code
17009 \begin_layout Plain Layout
17016 \begin_inset Flex Code
17019 \begin_layout Plain Layout
17025 ] Specifies attribute information to be output with the main tag.
17027 \begin_inset Quotes eld
17031 \begin_inset Flex Code
17034 \begin_layout Plain Layout
17041 \begin_inset Quotes erd
17045 By default, LyX will output
17046 \begin_inset Quotes eld
17050 \begin_inset Flex Code
17053 \begin_layout Plain Layout
17060 \begin_inset Quotes erd
17064 \begin_inset Flex Code
17067 \begin_layout Plain Layout
17073 is the LyX name of the layout, made lowercase, for example: chapter.
17078 contain any style information.
17080 \begin_inset Flex Code
17083 \begin_layout Plain Layout
17092 \begin_layout Description
17093 \begin_inset Flex Code
17096 \begin_layout Plain Layout
17103 \begin_inset Flex Code
17106 \begin_layout Plain Layout
17116 ] Whether to output the default CSS information LyX generates for this layout,
17117 even if additional information is explicitly provided via
17118 \begin_inset Flex Code
17121 \begin_layout Plain Layout
17129 \begin_inset Flex Code
17132 \begin_layout Plain Layout
17138 allows you to alter or augment the generated CSS, rather than to override
17141 \begin_inset Flex Code
17144 \begin_layout Plain Layout
17153 \begin_layout Description
17154 \begin_inset Flex Code
17157 \begin_layout Plain Layout
17164 \begin_inset Flex Code
17167 \begin_layout Plain Layout
17173 ] The tag to be used for individual paragraphs of environments, replacing
17175 \begin_inset Flex Code
17178 \begin_layout Plain Layout
17184 in the examples above.
17186 \begin_inset Flex Code
17189 \begin_layout Plain Layout
17198 \begin_layout Description
17199 \begin_inset Flex Code
17202 \begin_layout Plain Layout
17209 \begin_inset Flex Code
17212 \begin_layout Plain Layout
17218 ] Attributes for the item tag.
17220 \begin_inset Quotes eld
17224 \begin_inset Flex Code
17227 \begin_layout Plain Layout
17228 class=`layoutname_item'
17234 \begin_inset Quotes erd
17242 contain any style information.
17244 \begin_inset Flex Code
17247 \begin_layout Plain Layout
17256 \begin_layout Description
17257 \begin_inset Flex Code
17260 \begin_layout Plain Layout
17267 \begin_inset Flex Code
17270 \begin_layout Plain Layout
17276 ] The tag to be used for paragraph and item labels, replacing
17277 \begin_inset Flex Code
17280 \begin_layout Plain Layout
17286 in the examples above.
17288 \begin_inset Flex Code
17291 \begin_layout Plain Layout
17298 \begin_inset Flex Code
17301 \begin_layout Plain Layout
17308 \begin_inset Flex Code
17311 \begin_layout Plain Layout
17318 \begin_inset Flex Code
17321 \begin_layout Plain Layout
17322 Centered_Top_Environment
17327 , in which case it defaults to
17328 \begin_inset Flex Code
17331 \begin_layout Plain Layout
17340 \begin_layout Description
17341 \begin_inset Flex Code
17344 \begin_layout Plain Layout
17351 \begin_inset Flex Code
17354 \begin_layout Plain Layout
17360 ] Attributes for the label tag.
17362 \begin_inset Quotes eld
17366 \begin_inset Flex Code
17369 \begin_layout Plain Layout
17370 class=`layoutname_label'
17376 \begin_inset Quotes erd
17384 contain any style information.
17386 \begin_inset Flex Code
17389 \begin_layout Plain Layout
17398 \begin_layout Description
17399 \begin_inset Flex Code
17402 \begin_layout Plain Layout
17409 \begin_inset Flex Code
17412 \begin_layout Plain Layout
17422 ] Meaningful only for list-like environments, this tag controls whether
17423 the label tag is output before or inside the item tag.
17424 This is used, for example, in the description environment, where we want
17426 \begin_inset Flex Code
17429 \begin_layout Plain Layout
17430 <dt>\SpecialChar \ldots{}
17431 </dt><dd>\SpecialChar \ldots{}
17439 \begin_inset Flex Code
17442 \begin_layout Plain Layout
17448 : The label tag is output inside the item tag.
17451 \begin_layout Description
17452 \begin_inset Flex Code
17455 \begin_layout Plain Layout
17461 Information to be output in the
17462 \begin_inset Flex Code
17465 \begin_layout Plain Layout
17471 section when this style is used.
17472 This might, for example, be used to include a
17473 \begin_inset Flex Code
17476 \begin_layout Plain Layout
17483 \begin_inset Flex Code
17486 \begin_layout Plain Layout
17495 \begin_layout Description
17496 \begin_inset Flex Code
17499 \begin_layout Plain Layout
17505 CSS style information to be included when this style is used.
17506 Note that this will automatically be wrapped in a layout-generated
17507 \begin_inset Flex Code
17510 \begin_layout Plain Layout
17516 block, so only the CSS itself need be included.
17519 \begin_layout Description
17520 \begin_inset Flex Code
17523 \begin_layout Plain Layout
17530 \begin_inset Flex Code
17533 \begin_layout Plain Layout
17539 ] The tag to be used for the main label, replacing
17540 \begin_inset Flex Code
17543 \begin_layout Plain Layout
17549 in the examples above.
17551 \begin_inset Flex Code
17554 \begin_layout Plain Layout
17563 \begin_layout Description
17564 \begin_inset Flex Code
17567 \begin_layout Plain Layout
17574 \begin_inset Flex Code
17577 \begin_layout Plain Layout
17587 ] Marks this style as the one to be used to generate the
17588 \begin_inset Flex Code
17591 \begin_layout Plain Layout
17597 tag for the XHTML file.
17598 By default, it is false.
17600 \begin_inset Flex Code
17603 \begin_layout Plain Layout
17609 file sets it to true for the
17610 \begin_inset Flex Code
17613 \begin_layout Plain Layout
17623 \begin_layout Subsection
17627 \begin_layout Standard
17628 The XHTML output of insets can also be controlled by information in layout
17633 \begin_layout Plain Layout
17634 At present, this is true only for
17635 \begin_inset Quotes eld
17639 \begin_inset Quotes erd
17642 insets (insets you can type into) and is not true for
17643 \begin_inset Quotes eld
17647 \begin_inset Quotes erd
17650 insets (insets that are associated with dialog boxes).
17655 Here, too, LyX tries to provide sensible defaults, and it constructs default
17657 But everything can be customized.
17660 \begin_layout Standard
17661 The XHTML LyX outputs for an inset has the following form:
17664 \begin_layout LyX-Code
17666 \begin_inset Quotes erd
17670 \begin_inset Quotes erd
17676 \begin_layout LyX-Code
17677 <labeltag>Label</labeltag>
17680 \begin_layout LyX-Code
17682 \begin_inset Quotes erd
17686 \begin_inset Quotes erd
17689 >Contents of the inset.</innertag>
17692 \begin_layout LyX-Code
17696 \begin_layout Standard
17697 If the inset permits multiple paragraphs---that is, if
17698 \begin_inset Flex Code
17701 \begin_layout Plain Layout
17707 is true---then the contents of the inset will itself be output as paragraphs
17708 formatted according to the styles used for those paragraphs (standard,
17709 quote, and the like).
17710 The label tag is of course omitted if the paragraph does not have a label
17711 and, at present, is always
17712 \begin_inset Flex Code
17715 \begin_layout Plain Layout
17722 The inner tag is optional and, by default, does not appear.
17725 \begin_layout Standard
17726 The specific tags and attributes output for each inset can be controlled
17727 by means of the following layout tags.
17730 \begin_layout Description
17731 \begin_inset Flex Code
17734 \begin_layout Plain Layout
17741 \begin_inset Flex Code
17744 \begin_layout Plain Layout
17750 ] Specifies attribute information to be output with the main tag.
17752 \begin_inset Quotes eld
17756 \begin_inset Flex Code
17759 \begin_layout Plain Layout
17760 class=`myinset' onclick=`\SpecialChar \ldots{}
17767 \begin_inset Quotes erd
17771 By default, LyX will output
17772 \begin_inset Quotes eld
17776 \begin_inset Flex Code
17779 \begin_layout Plain Layout
17786 \begin_inset Quotes erd
17790 \begin_inset Flex Code
17793 \begin_layout Plain Layout
17799 is the LyX name of the inset, made lowercase and with non-alphanumeric
17800 characters converted to underscores, for example: footnote.
17803 \begin_layout Description
17804 \begin_inset Flex Code
17807 \begin_layout Plain Layout
17814 \begin_inset Flex Code
17817 \begin_layout Plain Layout
17827 ] Whether to output the default CSS information LyX generates for this layout,
17828 even if additional information is explicitly provided via
17829 \begin_inset Flex Code
17832 \begin_layout Plain Layout
17840 \begin_inset Flex Code
17843 \begin_layout Plain Layout
17849 allows you to alter or augment the generated CSS, rather than to override
17854 \begin_layout Description
17855 \begin_inset Flex Code
17858 \begin_layout Plain Layout
17865 \begin_inset Flex Code
17868 \begin_layout Plain Layout
17874 ] Attributes for the inner tag.
17876 \begin_inset Quotes eld
17880 \begin_inset Flex Code
17883 \begin_layout Plain Layout
17884 class=`insetname_inner'
17890 \begin_inset Quotes erd
17896 \begin_layout Description
17897 \begin_inset Flex Code
17900 \begin_layout Plain Layout
17907 \begin_inset Flex Code
17910 \begin_layout Plain Layout
17916 ] The inner tag, replacing
17917 \begin_inset Flex Code
17920 \begin_layout Plain Layout
17926 in the examples above.
17927 By default, there is none.
17930 \begin_layout Description
17931 \begin_inset Flex Code
17934 \begin_layout Plain Layout
17941 \begin_inset Flex Code
17944 \begin_layout Plain Layout
17952 ] Whether this inset represents a standalone block of text (such as a footnote)
17953 or instead represents material that is included in the surrounding text
17954 (such as a branch).
17958 \begin_layout Description
17959 \begin_inset Flex Code
17962 \begin_layout Plain Layout
17969 \begin_inset Flex Code
17972 \begin_layout Plain Layout
17978 ] A label for this inset, possibly including a reference to a counter.
17979 For example, for footnote, it might be:
17980 \begin_inset Flex Code
17983 \begin_layout Plain Layout
17992 This is optional, and there is no default.
17995 \begin_layout Description
17996 \begin_inset Flex Code
17999 \begin_layout Plain Layout
18005 Information to be output in the
18006 \begin_inset Flex Code
18009 \begin_layout Plain Layout
18015 section when this style is used.
18016 This might, for example, be used to include a
18017 \begin_inset Flex Code
18020 \begin_layout Plain Layout
18027 \begin_inset Flex Code
18030 \begin_layout Plain Layout
18039 \begin_layout Description
18040 \begin_inset Flex Code
18043 \begin_layout Plain Layout
18049 CSS style information to be included when this style is used.
18050 Note that this will automatically be wrapped in a layout-generated
18051 \begin_inset Flex Code
18054 \begin_layout Plain Layout
18060 block, so only the CSS itself need be included.
18063 \begin_layout Description
18064 \begin_inset Flex Code
18067 \begin_layout Plain Layout
18074 \begin_inset Flex Code
18077 \begin_layout Plain Layout
18083 ] The tag to be used for the main label, replacing
18084 \begin_inset Flex Code
18087 \begin_layout Plain Layout
18093 in the examples above.
18094 The default depends upon the setting of
18095 \begin_inset Flex Code
18098 \begin_layout Plain Layout
18105 \begin_inset Flex Code
18108 \begin_layout Plain Layout
18114 is true, the default is
18115 \begin_inset Flex Code
18118 \begin_layout Plain Layout
18124 ; if it is false, the default is
18125 \begin_inset Flex Code
18128 \begin_layout Plain Layout
18137 \begin_layout Subsection
18141 \begin_layout Standard
18142 The XHTML output for floats too can be controlled by layout information.
18143 The output has the following form:
18146 \begin_layout LyX-Code
18148 \begin_inset Quotes erd
18152 \begin_inset Quotes erd
18158 \begin_layout LyX-Code
18159 Contents of the float.
18162 \begin_layout LyX-Code
18166 \begin_layout Standard
18167 The caption, if there is one, is a separate inset and will be output as
18169 Its appearance can be controlled via the InsetLayout for caption insets.
18173 \begin_layout Description
18174 \begin_inset Flex Code
18177 \begin_layout Plain Layout
18184 \begin_inset Flex Code
18187 \begin_layout Plain Layout
18193 ] Specifies attribute information to be output with the main tag.
18195 \begin_inset Quotes eld
18199 \begin_inset Flex Code
18202 \begin_layout Plain Layout
18203 class=`myfloat' onclick=`\SpecialChar \ldots{}
18210 \begin_inset Quotes erd
18214 By default, LyX will output
18215 \begin_inset Quotes eld
18219 \begin_inset Flex Code
18222 \begin_layout Plain Layout
18223 class=`float float-floattype'
18229 \begin_inset Quotes erd
18233 \begin_inset Flex Code
18236 \begin_layout Plain Layout
18242 is LyX's name for this type of float, as determined by the float declaration
18244 \begin_inset CommandInset ref
18246 reference "sub:Floats"
18250 ), though made lowercase and with non-alphanumeric characters converted
18251 to underscores, for example: float-table.
18254 \begin_layout Description
18255 \begin_inset Flex Code
18258 \begin_layout Plain Layout
18264 CSS style information to be included when this float is used.
18265 Note that this will automatically be wrapped in a layout-generated
18266 \begin_inset Flex Code
18269 \begin_layout Plain Layout
18275 block, so only the CSS itself need be included.
18278 \begin_layout Description
18279 \begin_inset Flex Code
18282 \begin_layout Plain Layout
18289 \begin_inset Flex Code
18292 \begin_layout Plain Layout
18298 ] The tag to be used for this float, replacing
18299 \begin_inset Quotes eld
18303 \begin_inset Flex Code
18306 \begin_layout Plain Layout
18313 \begin_inset Quotes erd
18316 in the example above.
18318 \begin_inset Flex Code
18321 \begin_layout Plain Layout
18327 and will rarely need changing.
18330 \begin_layout Subsection
18331 Bibliography formatting
18334 \begin_layout Standard
18335 The bibliography can be formatted using
18336 \begin_inset Flex Code
18339 \begin_layout Plain Layout
18347 \begin_inset CommandInset ref
18349 reference "sub:Citation-format-description"
18356 \begin_layout Subsection
18360 \begin_layout Standard
18361 We have several times mentioned that LyX will generate default CSS style
18362 rules for both insets and paragraph styles, based upon the other layout
18363 information that is provided.
18364 In this section, we shall say a word about which layout information LyX
18368 \begin_layout Standard
18369 At present, LyX auto-generates CSS only for font information, making use
18371 \begin_inset Flex Code
18374 \begin_layout Plain Layout
18381 \begin_inset Flex Code
18384 \begin_layout Plain Layout
18391 \begin_inset Flex Code
18394 \begin_layout Plain Layout
18401 \begin_inset Flex Code
18404 \begin_layout Plain Layout
18411 \begin_inset Flex Code
18414 \begin_layout Plain Layout
18422 \begin_inset CommandInset ref
18424 reference "sub:Font-description"
18428 .) The translation is mostly straightforward and obvious.
18430 \begin_inset Quotes eld
18434 \begin_inset Flex Code
18437 \begin_layout Plain Layout
18444 \begin_inset Quotes erd
18448 \begin_inset Quotes eld
18452 \begin_inset Flex Code
18455 \begin_layout Plain Layout
18456 font-family: sans-serif;
18462 \begin_inset Quotes erd
18466 The correspondence of LyX sizes and CSS sizes is a little less obvious
18467 but nonetheless intuitive.
18469 \begin_inset Flex Code
18472 \begin_layout Plain Layout
18479 \begin_inset Flex URL
18482 \begin_layout Plain Layout
18493 \begin_layout Chapter
18494 Including External Material
18497 \begin_layout Standard
18498 \begin_inset Box Shadowbox
18508 height_special "totalheight"
18511 \begin_layout Plain Layout
18512 WARNING: This portion of the documentation has not been updated for some
18514 We certainly hope that it is still accurate, but there are no guarantees.
18522 \begin_layout Standard
18523 The use of material from sources external to LyX is covered in detail in
18529 This part of the manual covers what needs to happen behind the scenes for
18530 new sorts of material to be included.
18533 \begin_layout Section
18537 \begin_layout Standard
18538 The external material feature is based on the concept of a
18543 A template is a specification of how LyX should interface with a certain
18545 As bundled, LyX comes with predefined templates for Xfig figures, various
18546 raster format images, chess diagrams, and LilyPond music notation.
18547 You can check the actual list by using the menu
18548 \begin_inset Flex MenuItem
18551 \begin_layout Plain Layout
18552 Insert\SpecialChar \menuseparator
18553 File\SpecialChar \menuseparator
18560 Furthermore, it is possible to roll your own template to support a specific
18562 Later we'll describe in more detail what is involved, and hopefully you
18563 will submit all the templates you create so we can include them in a later
18567 \begin_layout Standard
18568 Another basic idea of the external material feature is to distinguish between
18569 the original file that serves as a base for final material and the produced
18570 file that is included in your exported or printed document.
18571 For example, consider the case of a figure produced with
18572 \begin_inset Flex Code
18575 \begin_layout Plain Layout
18582 The Xfig application itself works on an original file with the
18583 \begin_inset Flex Code
18586 \begin_layout Plain Layout
18593 Within Xfig, you create and change your figure, and when you are done,
18595 \begin_inset Flex Code
18598 \begin_layout Plain Layout
18605 When you want to include the figure in your document, you invoke
18606 \begin_inset Flex Code
18609 \begin_layout Plain Layout
18615 in order to create a PostScript file that can readily be included in your
18618 \begin_inset Flex Code
18621 \begin_layout Plain Layout
18627 file is the original file, and the PostScript file is the produced file.
18630 \begin_layout Standard
18631 This distinction is important in order to allow updating of the material
18632 while you are in the process of writing the document.
18633 Furthermore, it provides us with the flexibility that is needed to support
18634 multiple export formats.
18635 For instance, in the case of a plain text file, it is not exactly an award-winn
18636 ing idea to include the figure as raw PostScript.
18637 Instead, you'd either prefer to just include a reference to the figure
18638 or try to invoke some graphics to ASCII converter to make the final result
18639 look similar to the real graphics.
18640 The external material management allows you to do this, because it is parametri
18641 zed on the different export formats that LyX supports.
18644 \begin_layout Standard
18645 Besides supporting the production of different products according to the
18646 exported format, it supports tight integration with editing and viewing
18648 In the case of an Xfig figure, you are able to invoke Xfig on the original
18649 file with a single click from within the external material dialog in LyX,
18650 and also preview the produced PostScript file with Ghostview with another
18652 No more fiddling around with the command line and/or file browsers to locate
18653 and manipulate the original or produced files.
18654 In this way, you are finally able to take full advantage of the many different
18655 applications that are relevant to use when you write your documents, and
18656 ultimately be more productive.
18659 \begin_layout Section
18660 The external template configuration file
18663 \begin_layout Standard
18664 It is relatively easy to add custom external template definitions to LyX.
18665 However, be aware that doing this in an careless manner most probably
18669 introduce an easily exploitable security hole.
18670 So before you do this, please read the discussion about security in section
18672 \begin_inset CommandInset ref
18674 reference "sec:Security-discussion"
18681 \begin_layout Standard
18682 Having said that, we encourage you to submit any interesting templates that
18687 \begin_layout Standard
18688 The external templates are defined in the
18689 \begin_inset Flex Code
18692 \begin_layout Plain Layout
18693 LyXDir/lib/external_templates
18699 You can place your own version in
18700 \begin_inset Flex Code
18703 \begin_layout Plain Layout
18704 UserDir/external_templates
18712 \begin_layout Standard
18713 A typical template looks like this:
18716 \begin_layout LyX-Code
18720 \begin_layout LyX-Code
18721 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18724 \begin_layout LyX-Code
18728 \begin_layout LyX-Code
18732 \begin_layout LyX-Code
18736 \begin_layout LyX-Code
18740 \begin_layout LyX-Code
18744 \begin_layout LyX-Code
18745 AutomaticProduction true
18748 \begin_layout LyX-Code
18752 \begin_layout LyX-Code
18756 \begin_layout LyX-Code
18760 \begin_layout LyX-Code
18761 TransformCommand Rotate RotationLatexCommand
18764 \begin_layout LyX-Code
18765 TransformCommand Resize ResizeLatexCommand
18768 \begin_layout LyX-Code
18769 Product "$$RotateFront$$ResizeFront
18772 \begin_layout LyX-Code
18777 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18780 \begin_layout LyX-Code
18781 $$ResizeBack$$RotateBack"
18784 \begin_layout LyX-Code
18788 \begin_layout LyX-Code
18789 UpdateResult "$$AbsPath$$Basename.pstex_t"
18792 \begin_layout LyX-Code
18793 Requirement "graphicx"
18796 \begin_layout LyX-Code
18797 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18800 \begin_layout LyX-Code
18801 ReferencedFile latex "$$AbsPath$$Basename.eps"
18804 \begin_layout LyX-Code
18805 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18808 \begin_layout LyX-Code
18812 \begin_layout LyX-Code
18816 \begin_layout LyX-Code
18817 TransformCommand Rotate RotationLatexCommand
18820 \begin_layout LyX-Code
18821 TransformCommand Resize ResizeLatexCommand
18824 \begin_layout LyX-Code
18825 Product "$$RotateFront$$ResizeFront
18828 \begin_layout LyX-Code
18833 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18836 \begin_layout LyX-Code
18837 $$ResizeBack$$RotateBack"
18840 \begin_layout LyX-Code
18841 UpdateFormat pdftex
18844 \begin_layout LyX-Code
18845 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18848 \begin_layout LyX-Code
18849 Requirement "graphicx"
18852 \begin_layout LyX-Code
18853 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18856 \begin_layout LyX-Code
18857 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18860 \begin_layout LyX-Code
18864 \begin_layout LyX-Code
18868 \begin_layout LyX-Code
18869 Product "$$Contents(
18871 "$$AbsPath$$Basename.asc
18876 \begin_layout LyX-Code
18877 UpdateFormat asciixfig
18880 \begin_layout LyX-Code
18881 UpdateResult "$$AbsPath$$Basename.asc"
18884 \begin_layout LyX-Code
18888 \begin_layout LyX-Code
18892 \begin_layout LyX-Code
18893 Product "<graphic fileref=
18895 "$$AbsOrRelPathMaster$$Basename.eps
18900 \begin_layout LyX-Code
18904 \begin_layout LyX-Code
18908 \begin_layout LyX-Code
18909 UpdateResult "$$AbsPath$$Basename.eps"
18912 \begin_layout LyX-Code
18913 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18916 \begin_layout LyX-Code
18917 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18920 \begin_layout LyX-Code
18924 \begin_layout LyX-Code
18925 Product "[XFig: $$FName]"
18928 \begin_layout LyX-Code
18932 \begin_layout LyX-Code
18936 \begin_layout Standard
18937 As you can see, the template is enclosed in
18938 \begin_inset Flex Code
18941 \begin_layout Plain Layout
18947 \SpecialChar \ldots{}
18949 \begin_inset Flex Code
18952 \begin_layout Plain Layout
18959 It contains a header specifying some general settings and, for each supported
18960 primary document file format, a section
18961 \begin_inset Flex Code
18964 \begin_layout Plain Layout
18970 \SpecialChar \ldots{}
18972 \begin_inset Flex Code
18975 \begin_layout Plain Layout
18984 \begin_layout Subsection
18985 The template header
18988 \begin_layout Description
18989 \begin_inset Flex Code
18992 \begin_layout Plain Layout
18993 AutomaticProduction
18994 \begin_inset space ~
19002 Whether the file represented by the template must be generated by LyX.
19003 This command must occur exactly once.
19006 \begin_layout Description
19007 \begin_inset Flex Code
19010 \begin_layout Plain Layout
19012 \begin_inset space ~
19020 A glob pattern that is used in the file dialog to filter out the desired
19022 If there is more than one possible file extension (e.
19023 \begin_inset space \thinspace{}
19027 \begin_inset space \space{}
19031 \begin_inset Flex Code
19034 \begin_layout Plain Layout
19041 \begin_inset Flex Code
19044 \begin_layout Plain Layout
19050 ), use something like
19051 \begin_inset Flex Code
19054 \begin_layout Plain Layout
19061 This command must occur exactly once.
19064 \begin_layout Description
19065 \begin_inset Flex Code
19068 \begin_layout Plain Layout
19070 \begin_inset space ~
19078 The text that is displayed on the button.
19079 This command must occur exactly once.
19082 \begin_layout Description
19083 \begin_inset Flex Code
19086 \begin_layout Plain Layout
19088 \begin_inset space ~
19092 \begin_inset space ~
19100 The help text that is used in the External dialog.
19101 Provide enough information to explain to the user just what the template
19102 can provide him with.
19103 This command must occur exactly once.
19106 \begin_layout Description
19107 \begin_inset Flex Code
19110 \begin_layout Plain Layout
19112 \begin_inset space ~
19120 The file format of the original file.
19121 This must be the name of a format that is known to LyX (see section
19122 \begin_inset space ~
19126 \begin_inset CommandInset ref
19128 reference "sec:Formats"
19134 \begin_inset Quotes eld
19138 \begin_inset Flex Code
19141 \begin_layout Plain Layout
19148 \begin_inset Quotes erd
19151 if the template can handle original files of more than one format.
19152 LyX will attempt to interrogate the file itself in order to deduce its
19153 format in this case.
19154 This command must occur exactly once.
19157 \begin_layout Description
19158 \begin_inset Flex Code
19161 \begin_layout Plain Layout
19163 \begin_inset space ~
19171 A unique name for the template.
19172 It must not contain substitution macros (see below).
19175 \begin_layout Description
19176 \begin_inset Flex Code
19179 \begin_layout Plain Layout
19181 \begin_inset space ~
19184 Rotate|Resize|Clip|Extra
19189 This command specifies which transformations are supported by this template.
19190 It may occur zero or more times.
19191 This command enables the corresponding tabs in the external dialog.
19193 \begin_inset Flex Code
19196 \begin_layout Plain Layout
19202 command must have either a corresponding
19203 \begin_inset Flex Code
19206 \begin_layout Plain Layout
19213 \begin_inset Flex Code
19216 \begin_layout Plain Layout
19223 \begin_inset Flex Code
19226 \begin_layout Plain Layout
19233 Otherwise the transformation will not be supported by that format.
19236 \begin_layout Subsection
19240 \begin_layout Description
19241 \begin_inset Flex Code
19244 \begin_layout Plain Layout
19246 \begin_inset space ~
19249 LaTeX|PDFLaTeX|PlainText|DocBook
19254 The primary document file format that this format definition is for.
19255 Not every template has a sensible representation in all document file formats.
19256 Please define nevertheless a
19257 \begin_inset Flex Code
19260 \begin_layout Plain Layout
19266 section for all templates.
19267 Use a dummy text when no representation is available.
19268 Then you can at least see a reference to the external material in the exported
19272 \begin_layout Description
19273 \begin_inset Flex Code
19276 \begin_layout Plain Layout
19278 \begin_inset space ~
19282 \begin_inset space ~
19290 This command defines an additional macro
19291 \begin_inset Flex Code
19294 \begin_layout Plain Layout
19300 for substitution in
19301 \begin_inset Flex Code
19304 \begin_layout Plain Layout
19312 \begin_inset Flex Code
19315 \begin_layout Plain Layout
19321 itself may contain substitution macros.
19322 The advantage over using
19323 \begin_inset Flex Code
19326 \begin_layout Plain Layout
19333 \begin_inset Flex Code
19336 \begin_layout Plain Layout
19342 is that the substituted value of
19343 \begin_inset Flex Code
19346 \begin_layout Plain Layout
19352 is sanitized so that it is a valid optional argument in the document format.
19353 This command may occur zero or more times.
19356 \begin_layout Description
19357 \begin_inset Flex Code
19360 \begin_layout Plain Layout
19362 \begin_inset space ~
19370 The text that is inserted in the exported document.
19371 This is actually the most important command and can be quite complex.
19372 This command must occur exactly once.
19375 \begin_layout Description
19376 \begin_inset Flex Code
19379 \begin_layout Plain Layout
19381 \begin_inset space ~
19389 This command specifies a preamble snippet that will be included in the
19391 It has to be defined using
19392 \begin_inset Flex Code
19395 \begin_layout Plain Layout
19401 \SpecialChar \ldots{}
19403 \begin_inset Flex Code
19406 \begin_layout Plain Layout
19413 This command may occur zero or more times.
19416 \begin_layout Description
19417 \begin_inset Flex Code
19420 \begin_layout Plain Layout
19422 \begin_inset space ~
19426 \begin_inset space ~
19434 This command denotes files that are created by the conversion process and
19435 are needed for a particular export format.
19436 If the filename is relative, it is interpreted relative to the master document.
19437 This command may be given zero or more times.
19440 \begin_layout Description
19441 \begin_inset Flex Code
19444 \begin_layout Plain Layout
19446 \begin_inset space ~
19454 The name of a required LaTeX package.
19455 The package is included via
19456 \begin_inset Flex Code
19459 \begin_layout Plain Layout
19467 in the LaTeX preamble.
19468 This command may occur zero or more times.
19471 \begin_layout Description
19472 \begin_inset Flex Code
19475 \begin_layout Plain Layout
19477 \begin_inset space ~
19481 \begin_inset space ~
19484 RotationLatexCommand
19489 This command specifies that the built in LaTeX command should be used for
19491 This command may occur once or not at all.
19494 \begin_layout Description
19495 \begin_inset Flex Code
19498 \begin_layout Plain Layout
19500 \begin_inset space ~
19504 \begin_inset space ~
19512 This command specifies that the built in LaTeX command should be used for
19514 This command may occur once or not at all.
19517 \begin_layout Description
19518 \begin_inset Flex Code
19521 \begin_layout Plain Layout
19523 \begin_inset space ~
19527 \begin_inset space ~
19530 RotationLatexOption
19535 This command specifies that rotation is done via an optional argument.
19536 This command may occur once or not at all.
19539 \begin_layout Description
19540 \begin_inset Flex Code
19543 \begin_layout Plain Layout
19545 \begin_inset space ~
19549 \begin_inset space ~
19557 This command specifies that resizing is done via an optional argument.
19558 This command may occur once or not at all.
19561 \begin_layout Description
19562 \begin_inset Flex Code
19565 \begin_layout Plain Layout
19567 \begin_inset space ~
19571 \begin_inset space ~
19579 This command specifies that clipping is done via an optional argument.
19580 This command may occur once or not at all.
19583 \begin_layout Description
19584 \begin_inset Flex Code
19587 \begin_layout Plain Layout
19589 \begin_inset space ~
19593 \begin_inset space ~
19601 This command specifies that an extra optional argument is used.
19602 This command may occur once or not at all.
19605 \begin_layout Description
19606 \begin_inset Flex Code
19609 \begin_layout Plain Layout
19611 \begin_inset space ~
19619 The file format of the converted file.
19620 This must be the name of a format that is known to LyX (see the
19621 \begin_inset Flex MenuItem
19624 \begin_layout Plain Layout
19629 ools\SpecialChar \menuseparator
19634 references\SpecialChar \menuseparator
19635 File Handling\SpecialChar \menuseparator
19642 This command must occur exactly once.
19645 \begin_layout Description
19646 \begin_inset Flex Code
19649 \begin_layout Plain Layout
19651 \begin_inset space ~
19659 The file name of the converted file.
19660 The file name must be absolute.
19661 This command must occur exactly once.
19664 \begin_layout Subsection
19665 Preamble definitions
19668 \begin_layout Standard
19669 The external template configuration file may contain additional preamble
19670 definitions enclosed by
19671 \begin_inset Flex Code
19674 \begin_layout Plain Layout
19680 \SpecialChar \ldots{}
19682 \begin_inset Flex Code
19685 \begin_layout Plain Layout
19692 They can be used by the templates in the
19693 \begin_inset Flex Code
19696 \begin_layout Plain Layout
19705 \begin_layout Section
19706 The substitution mechanism
19709 \begin_layout Standard
19710 When the external material facility invokes an external program, it is done
19711 on the basis of a command defined in the template configuration file.
19712 These commands can contain various macros that are expanded before execution.
19713 Execution always take place in the directory of the containing document.
19716 \begin_layout Standard
19717 Also, whenever external material is to be displayed, the name will be produced
19718 by the substitution mechanism, and most other commands in the template
19719 definition support substitution as well.
19722 \begin_layout Standard
19723 The available macros are the following:
19726 \begin_layout Description
19727 \begin_inset Flex Code
19730 \begin_layout Plain Layout
19731 $$AbsOrRelPathMaster
19736 The file path, absolute or relative to the master LyX document.
19739 \begin_layout Description
19740 \begin_inset Flex Code
19743 \begin_layout Plain Layout
19744 $$AbsOrRelPathParent
19749 The file path, absolute or relative to the LyX document.
19752 \begin_layout Description
19753 \begin_inset Flex Code
19756 \begin_layout Plain Layout
19762 The absolute file path.
19765 \begin_layout Description
19766 \begin_inset Flex Code
19769 \begin_layout Plain Layout
19775 The filename without path and without the extension.
19778 \begin_layout Description
19779 \begin_inset Flex Code
19782 \begin_layout Plain Layout
19784 \begin_inset Quotes eld
19788 \begin_inset Quotes erd
19796 This macro will expand to the contents of the file with the name
19797 \begin_inset Flex Code
19800 \begin_layout Plain Layout
19809 \begin_layout Description
19810 \begin_inset Flex Code
19813 \begin_layout Plain Layout
19819 The file extension (including the dot).
19822 \begin_layout Description
19823 \begin_inset Flex Code
19826 \begin_layout Plain Layout
19832 The filename of the file specified in the external material dialog.
19833 This is either an absolute name, or it is relative to the LyX document.
19836 \begin_layout Description
19837 \begin_inset Flex Code
19840 \begin_layout Plain Layout
19847 \begin_inset Flex Code
19850 \begin_layout Plain Layout
19856 (absolute name or relative to the LyX document).
19859 \begin_layout Description
19860 \begin_inset Flex Code
19863 \begin_layout Plain Layout
19869 The file path, relative to the master LyX document.
19872 \begin_layout Description
19873 \begin_inset Flex Code
19876 \begin_layout Plain Layout
19882 The file path, relative to the LyX document.
19885 \begin_layout Description
19886 \begin_inset Flex Code
19889 \begin_layout Plain Layout
19895 This macro will expand to the absolute path of the system directory.
19896 This is typically used to point to the various helper scripts that are
19900 \begin_layout Description
19901 \begin_inset Flex Code
19904 \begin_layout Plain Layout
19910 A name and full path to a temporary file which will be automatically deleted
19911 whenever the containing document is closed, or the external material insertion
19915 \begin_layout Standard
19916 All path macros contain a trailing directory separator, so you can construct
19918 \begin_inset space \thinspace{}
19922 \begin_inset space \space{}
19925 the absolute filename with
19926 \begin_inset Flex Code
19929 \begin_layout Plain Layout
19930 $$AbsPath$$Basename$$Extension
19938 \begin_layout Standard
19939 The macros above are substituted in all commands unless otherwise noted.
19941 \begin_inset Flex Code
19944 \begin_layout Plain Layout
19950 supports additionally the following substitutions if they are enabled by
19952 \begin_inset Flex Code
19955 \begin_layout Plain Layout
19962 \begin_inset Flex Code
19965 \begin_layout Plain Layout
19974 \begin_layout Description
19975 \begin_inset Flex Code
19978 \begin_layout Plain Layout
19984 The front part of the resize command.
19987 \begin_layout Description
19988 \begin_inset Flex Code
19991 \begin_layout Plain Layout
19997 The back part of the resize command.
20000 \begin_layout Description
20001 \begin_inset Flex Code
20004 \begin_layout Plain Layout
20010 The front part of the rotation command.
20013 \begin_layout Description
20014 \begin_inset Flex Code
20017 \begin_layout Plain Layout
20023 The back part of the rotation command.
20026 \begin_layout Standard
20027 The value string of the
20028 \begin_inset Flex Code
20031 \begin_layout Plain Layout
20037 command supports additionally the following substitutions if they are enabled
20039 \begin_inset Flex Code
20042 \begin_layout Plain Layout
20049 \begin_inset Flex Code
20052 \begin_layout Plain Layout
20061 \begin_layout Description
20062 \begin_inset Flex Code
20065 \begin_layout Plain Layout
20074 \begin_layout Description
20075 \begin_inset Flex Code
20078 \begin_layout Plain Layout
20087 \begin_layout Description
20088 \begin_inset Flex Code
20091 \begin_layout Plain Layout
20100 \begin_layout Description
20101 \begin_inset Flex Code
20104 \begin_layout Plain Layout
20110 The rotation option.
20113 \begin_layout Standard
20114 You may ask why there are so many path macros.
20115 There are mainly two reasons:
20118 \begin_layout Enumerate
20119 Relative and absolute file names should remain relative or absolute, respectivel
20121 Users may have reasons to prefer either form.
20122 Relative names are useful for portable documents that should work on different
20123 machines, for example.
20124 Absolute names may be required by some programs.
20127 \begin_layout Enumerate
20128 LaTeX treats relative file names differently than LyX and other programs
20129 in nested included files.
20130 For LyX, a relative file name is always relative to the document that contains
20132 For LaTeX, it is always relative to the master document.
20133 These two definitions are identical if you have only one document, but
20134 differ if you have a master document that includes part documents.
20135 That means that relative filenames must be transformed when presented to
20137 Fortunately LyX does this automatically for you if you choose the right
20141 \begin_layout Standard
20142 So which path macro should be used in new template definitions? The rule
20146 \begin_layout Itemize
20148 \begin_inset Flex Code
20151 \begin_layout Plain Layout
20157 if an absolute path is required.
20160 \begin_layout Itemize
20162 \begin_inset Flex Code
20165 \begin_layout Plain Layout
20166 $$AbsOrRelPathMaster
20171 if the substituted string is some kind of LaTeX input.
20174 \begin_layout Itemize
20176 \begin_inset Flex Code
20179 \begin_layout Plain Layout
20180 $$AbsOrRelPathParent
20185 in order to preserve the user's choice.
20188 \begin_layout Standard
20189 There are special cases where this rule does not work and e.
20190 \begin_inset space \thinspace{}
20194 \begin_inset space \space{}
20197 relative names are needed, but normally it will work just fine.
20198 One example for such a case is the command
20199 \begin_inset Flex Code
20202 \begin_layout Plain Layout
20203 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20208 in the XFig template above: We can't use the absolute name because the
20210 \begin_inset Flex Code
20213 \begin_layout Plain Layout
20219 files needs the relative name in order to rewrite the file content.
20222 \begin_layout Section
20223 Security discussion
20224 \begin_inset CommandInset label
20226 name "sec:Security-discussion"
20233 \begin_layout Standard
20234 The external material feature interfaces with a lot of external programs
20235 and does so automatically, so we have to consider the security implications
20237 In particular, since you have the option of including your own filenames
20238 and/or parameter strings and those are expanded into a command, it seems
20239 that it would be possible to create a malicious document which executes
20240 arbitrary commands when a user views or prints the document.
20241 This is something we definitely want to avoid.
20244 \begin_layout Standard
20245 However, since the external program commands are specified in the template
20246 configuration file only, there are no security issues if LyX is properly
20247 configured with safe templates only.
20248 This is so because the external programs are invoked with the
20249 \begin_inset Flex Code
20252 \begin_layout Plain Layout
20258 -system call rather than the
20259 \begin_inset Flex Code
20262 \begin_layout Plain Layout
20268 system-call, so it's not possible to execute arbitrary commands from the
20269 filename or parameter section via the shell.
20272 \begin_layout Standard
20273 This also implies that you are restricted in what command strings you can
20274 use in the external material templates.
20275 In particular, pipes and redirection are not readily available.
20276 This has to be so if LyX should remain safe.
20277 If you want to use some of the shell features, you should write a safe
20278 script to do this in a controlled manner, and then invoke the script from
20279 the command string.
20283 \begin_layout Standard
20284 It is possible to design a template that interacts directly with the shell,
20285 but since this would allow a malicious user to execute arbitrary commands
20286 by writing clever filenames and/or parameters, we generally recommend that
20287 you only use safe scripts that work with the
20288 \begin_inset Flex Code
20291 \begin_layout Plain Layout
20297 system call in a controlled manner.
20298 Of course, for use in a controlled environment, it can be tempting to just
20299 fall back to use ordinary shell scripts.
20300 If you do so, be aware that you
20304 provide an easily exploitable security hole in your system.
20305 Of course it stands to reason that such unsafe templates will never be
20306 included in the standard LyX distribution, although we do encourage people
20307 to submit new templates in the open source tradition.
20308 But LyX as shipped from the official distribution channels will never have
20312 \begin_layout Standard
20313 Including external material provides a lot of power, and you have to be
20314 careful not to introduce security hazards with this power.
20315 A subtle error in a single line in an innocent looking script can open
20316 the door to huge security problems.
20317 So if you do not fully understand the issues, we recommend that you consult
20318 a knowledgeable security professional or the LyX development team if you
20319 have any questions about whether a given template is safe or not.
20320 And do this before you use it in an uncontrolled environment.