1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that this document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of this document may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
39 % used for multi-column text
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}}
77 \font_typewriter default
78 \font_default_family default
79 \use_non_tex_fonts false
86 \default_output_format default
88 \bibtex_command default
89 \index_command default
93 \pdf_title "LyX Configuration Manual"
94 \pdf_author "LyX Team"
95 \pdf_subject "LyX-documentation Customization"
96 \pdf_keywords "LyX, documentation, customization"
98 \pdf_bookmarksnumbered true
99 \pdf_bookmarksopen true
100 \pdf_bookmarksopenlevel 1
101 \pdf_breaklinks false
105 \pdf_pdfusetitle false
106 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
116 \paperorientation portrait
130 \paragraph_separation indent
131 \paragraph_indentation default
132 \quotes_language english
135 \paperpagestyle headings
136 \tracking_changes false
137 \output_changes false
145 Customizing LyX: Features for the Advanced User
153 \begin_layout Plain Layout
155 If you have comments or error corrections, please send them to the LyX Documenta
157 \begin_inset CommandInset href
159 target "lyx-docs@lists.lyx.org"
166 \begin_inset Quotes eld
170 \begin_inset Quotes erd
173 in the subject header, and please cc the current maintainer of this file,
174 Richard Heck <rgheck@comcast.net>.
180 \begin_inset Newline newline
184 \begin_inset Newline newline
190 \begin_layout Standard
191 \begin_inset CommandInset toc
192 LatexCommand tableofcontents
199 \begin_layout Standard
200 \begin_inset Note Note
203 \begin_layout Plain Layout
204 Please use change tracking when modifying this document.
205 This makes it easier for our translators to recognize things that have
206 been changed, and it helps the maintainer keep up-to-date with what's been
215 \begin_layout Chapter
219 \begin_layout Standard
220 This manual covers the customization features present in LyX.
221 In it, we discuss issues like keyboard shortcuts, screen previewing options,
222 printer options, sending commands to LyX via the LyX Server, internationalizati
223 on, installing new LaTeX classes and LyX layouts, etc.
224 We can't possibly hope to touch on everything you can change—our developers
225 add new features faster than we can document them—but we will explain the
226 most common customizations and hopefully point you in the right direction
227 for some of the more obscure ones.
230 \begin_layout Standard
231 \begin_inset Branch OutDated
234 \begin_layout Standard
235 Information from previous versions of this document that now seems to be
236 outdated is contained in the OutDated branch of this document.
237 By default, this information will not appear in the LaTeX output.
245 \begin_layout Chapter
246 LyX configuration files
249 \begin_layout Standard
250 This chapter aims to help you to find your way through the LyX configuration
252 Before continuing to read this chapter, you should find out where your
253 LyX library and user directories are by using
254 \begin_inset Flex MenuItem
257 \begin_layout Plain Layout
258 Help\SpecialChar \menuseparator
269 The library directory is the place where LyX places its system-wide configurati
270 on files; the user directory is where you can place your modified versions.
271 We will call the former
272 \begin_inset Flex Code
275 \begin_layout Plain Layout
282 \begin_inset Flex MenuItem
285 \begin_layout Plain Layout
291 in the remainder of this document.
295 \begin_layout Section
297 \begin_inset Flex Code
300 \begin_layout Plain Layout
309 \begin_layout Standard
310 \begin_inset Flex Code
313 \begin_layout Plain Layout
319 and its sub-directories contain a number of files and that can be used
320 to customize LyX's behavior.
321 You can change many of these files from within LyX itself through the
322 \begin_inset Flex MenuItem
325 \begin_layout Plain Layout
326 Tools\SpecialChar \menuseparator
333 Most customization that you will want to do in LyX is possible through
335 However, many other inner aspects of LyX can be customized by modifying
337 \begin_inset Flex Code
340 \begin_layout Plain Layout
347 These files fall in different categories, described in the following subsection
351 \begin_layout Subsection
352 Automatically generated files
355 \begin_layout Standard
356 The files, which are to be found in
357 \begin_inset Flex MenuItem
360 \begin_layout Plain Layout
366 , are generated when you configure LyX.
367 They contain various default values that are guessed by inspection.
368 In general, it is not a good idea to modify them, since they might be overwritt
372 \begin_layout Labeling
373 \labelwidthstring 00.00.0000
374 \begin_inset Flex Code
377 \begin_layout Plain Layout
383 contains defaults for various commands.
386 \begin_layout Labeling
387 \labelwidthstring 00.00.0000
388 \begin_inset Flex Code
391 \begin_layout Plain Layout
397 contains the list of packages that have been recognized by LyX.
398 It is currently unused by the LyX program itself, but the information extracted
399 , and more, is made available with
400 \begin_inset Flex MenuItem
403 \begin_layout Plain Layout
404 Help\SpecialChar \menuseparator
417 \begin_layout Labeling
418 \labelwidthstring 00.00.0000
419 \begin_inset Flex Code
422 \begin_layout Plain Layout
428 the list of text classes that have been found in your
429 \begin_inset Flex Code
432 \begin_layout Plain Layout
438 directories, along with the associated LaTeX document class and their descripti
442 \begin_layout Labeling
443 \labelwidthstring 00.00.0000
444 \begin_inset Flex Code
447 \begin_layout Plain Layout
453 the list of layout modules found in your
454 \begin_inset Flex Code
457 \begin_layout Plain Layout
466 \begin_layout Labeling
467 \labelwidthstring 00.00.0000
468 \begin_inset Flex Code
471 \begin_layout Plain Layout
477 lists of various sorts of LaTeX-related files found on your system
480 \begin_layout Labeling
481 \labelwidthstring 00.00.0000
482 \begin_inset Flex Code
485 \begin_layout Plain Layout
491 is automatically generated during configuration from the file
492 \begin_inset Flex Code
495 \begin_layout Plain Layout
502 It contains information on your LaTeX configuration.
505 \begin_layout Subsection
509 \begin_layout Standard
510 These directories are duplicated between
511 \begin_inset Flex Code
514 \begin_layout Plain Layout
521 \begin_inset Flex Code
524 \begin_layout Plain Layout
531 If a particular files exists in both places, the one in
532 \begin_inset Flex Code
535 \begin_layout Plain Layout
544 \begin_layout Labeling
545 \labelwidthstring 00.00.0000
546 \begin_inset Flex Code
549 \begin_layout Plain Layout
555 this directory contains files with the extension
556 \begin_inset Flex Code
559 \begin_layout Plain Layout
565 that define the keybindings used in LyX.
566 If there exists an internationalized version of the bind file named
567 \begin_inset Flex Code
570 \begin_layout Plain Layout
576 , that will be used first.
579 \begin_layout Labeling
580 \labelwidthstring 00.00.0000
581 \begin_inset Flex Code
584 \begin_layout Plain Layout
590 contains graphics files that can be included in documents.
594 \begin_layout Labeling
595 \labelwidthstring 00.00.0000
596 \begin_inset Flex Code
599 \begin_layout Plain Layout
605 contains LyX documentation files (including the one you are currently reading).
607 \begin_inset Flex Code
610 \begin_layout Plain Layout
616 deserves special attention, as noted above.
617 The internationalized help docs are in subdirectories
618 \begin_inset Flex Code
621 \begin_layout Plain Layout
628 \begin_inset Quotes eld
632 \begin_inset Quotes erd
635 is the ISO language code.
641 \begin_inset CommandInset ref
643 reference "cha:Internationalizing-LyX"
650 \begin_layout Labeling
651 \labelwidthstring 00.00.0000
652 \begin_inset Flex Code
655 \begin_layout Plain Layout
661 contains example files that explain how to use some features.
662 In the file browser, press the
663 \begin_inset Flex MenuItem
666 \begin_layout Plain Layout
675 \begin_layout Labeling
676 \labelwidthstring 00.00.0000
677 \begin_inset Flex Code
680 \begin_layout Plain Layout
686 contains image files that are used by the
687 \begin_inset Flex MenuItem
690 \begin_layout Plain Layout
697 In addition, it also contains the individual icons used in the toolbar
698 and the banners that can be shown when LyX is launched.
701 \begin_layout Labeling
702 \labelwidthstring 00.00.0000
703 \begin_inset Flex Code
706 \begin_layout Plain Layout
712 contains keyboard keymapping files.
718 \begin_inset CommandInset ref
720 reference "sec:International-Keymap-Stuff"
727 \begin_layout Labeling
728 \labelwidthstring 00.00.0000
729 \begin_inset Flex Code
732 \begin_layout Plain Layout
738 contains the text class and module files described in Chapter
743 \begin_inset CommandInset ref
745 reference "cha:Installing-New-Document"
752 \begin_layout Labeling
753 \labelwidthstring 00.00.0000
754 \begin_inset Flex Code
757 \begin_layout Plain Layout
764 \begin_inset Flex Code
767 \begin_layout Plain Layout
773 Python scripts used to convert between LyX versions.
774 These can be run from the command line if, say, you want to batch-convert
778 \begin_layout Labeling
779 \labelwidthstring 00.00.0000
780 \begin_inset Flex Code
783 \begin_layout Plain Layout
789 contains some files that demonstrate the capabilities of the
790 \begin_inset Flex MenuItem
793 \begin_layout Plain Layout
804 Also contains some scripts used by LyX itself.
807 \begin_layout Labeling
808 \labelwidthstring 00.00.0000
809 \begin_inset Flex Code
812 \begin_layout Plain Layout
818 contains the standard LyX template files described in Chapter
823 \begin_inset CommandInset ref
825 reference "sub:Creating-Templates"
832 \begin_layout Labeling
833 \labelwidthstring 00.00.0000
834 \begin_inset Flex Code
837 \begin_layout Plain Layout
843 contains files with the extension
844 \begin_inset Flex Code
847 \begin_layout Plain Layout
853 that define the user interface to LyX.
854 That is, the files define which items appear in which menus and the items
855 appearing on the toolbar.
858 \begin_layout Subsection
859 Files you don't want to modify
862 \begin_layout Standard
863 These files are used internally by LyX and you generally do not need to
864 modify them unless you are a developer.
867 \begin_layout Labeling
868 \labelwidthstring 00.00.0000
869 \begin_inset Flex Code
872 \begin_layout Plain Layout
878 this file contains the list of LyX developers.
879 The contents are displayed with the menu entry
880 \begin_inset Flex MenuItem
883 \begin_layout Plain Layout
884 Help\SpecialChar \menuseparator
897 \begin_layout Labeling
898 \labelwidthstring 00.00.0000
899 \begin_inset Flex Code
902 \begin_layout Plain Layout
908 this is a LaTeX script used during the configuration process.
912 \begin_layout Labeling
913 \labelwidthstring 00.00.0000
914 \begin_inset Flex Code
917 \begin_layout Plain Layout
923 this is the script that is used to re-configure LyX.
924 It creates configuration files in the directory it was run from.
927 \begin_layout Subsection
928 Other files needing a line or two...
931 \begin_layout Labeling
932 \labelwidthstring 00.00.0000
933 \begin_inset Flex Code
936 \begin_layout Plain Layout
942 this contains tables describing how different character encodings can be
946 \begin_layout Labeling
947 \labelwidthstring 00.00.0000
948 \begin_inset Flex Code
951 \begin_layout Plain Layout
957 this file contains the templates available to the new
958 \begin_inset Flex MenuItem
961 \begin_layout Plain Layout
974 \begin_layout Labeling
975 \labelwidthstring 00.00.0000
976 \begin_inset Flex Code
979 \begin_layout Plain Layout
985 this file contains a list of all the languages currently supported by LyX.
988 \begin_layout Section
989 Your local configuration directory
992 \begin_layout Standard
993 Even if you are using LyX as an unprivileged user, you might want to change
994 LyX configuration for your own use.
996 \begin_inset Flex Code
999 \begin_layout Plain Layout
1005 directory contains all your personal configuration files.
1006 This is the directory described as
1007 \begin_inset Quotes eld
1011 \begin_inset Quotes erd
1015 \begin_inset Flex MenuItem
1018 \begin_layout Plain Layout
1019 Help\SpecialChar \menuseparator
1021 \begin_inset space ~
1030 This directory is used as a mirror of
1031 \begin_inset Flex Code
1034 \begin_layout Plain Layout
1040 , which means that every file in
1041 \begin_inset Flex Code
1044 \begin_layout Plain Layout
1050 is a replacement for the corresponding file in
1051 \begin_inset Flex Code
1054 \begin_layout Plain Layout
1061 Any configuration file described in the above sections can be placed either
1062 in the system-wide directory, in which case it will affect all users, or
1063 in your local directory for your own use.
1066 \begin_layout Standard
1067 To make things clearer, let's provide a few examples:
1070 \begin_layout Itemize
1071 The preferences set in the
1072 \begin_inset Flex MenuItem
1075 \begin_layout Plain Layout
1076 Tools\SpecialChar \menuseparator
1082 dialog are saved to a file
1083 \begin_inset Flex Code
1086 \begin_layout Plain Layout
1093 \begin_inset Flex Code
1096 \begin_layout Plain Layout
1105 \begin_layout Itemize
1106 When you reconfigure using
1107 \begin_inset Flex MenuItem
1110 \begin_layout Plain Layout
1111 Tools\SpecialChar \menuseparator
1118 \begin_inset Flex Code
1121 \begin_layout Plain Layout
1127 script, and the resulting files are written in your local configuration
1129 This means that any additional text class file that you might have added
1131 \begin_inset Flex Code
1134 \begin_layout Plain Layout
1140 will be added to the list of classes in the
1141 \begin_inset Flex MenuItem
1144 \begin_layout Plain Layout
1145 Document\SpecialChar \menuseparator
1154 \begin_layout Itemize
1155 If you get some updated documentation from LyX ftp site and cannot install
1156 it because you do not have sysadmin rights on your system, you can just
1158 \begin_inset Flex Code
1161 \begin_layout Plain Layout
1167 and the items in the
1168 \begin_inset Flex MenuItem
1171 \begin_layout Plain Layout
1177 menu will open them!
1180 \begin_layout Section
1181 Running LyX with multiple configurations
1184 \begin_layout Standard
1185 The configuration freedom of the local configuration directory may not suffice
1186 if you want to have more than one configuration at your disposal.
1187 For example, you may want to be use different key bindings or printer settings
1189 You can achieve this by having several such directories.
1190 You then specify which directory to use at run-time.
1193 \begin_layout Standard
1194 Invoking LyX with the command line switch
1195 \begin_inset Flex Code
1198 \begin_layout Plain Layout
1208 instructs the program to read the configuration from that directory, and
1209 not from the default directory.
1210 (You can determine the default directory by running LyX without the
1211 \begin_inset Flex Code
1214 \begin_layout Plain Layout
1220 switch.) If the specified directory does not exist, LyX offers to create
1221 it for you, just like it does for the default directory on the first time
1222 you run the program.
1223 You can modify the configuration options in this additional user directory
1224 exactly as you would for the default directory.
1225 These directories are completely independent (but read on).
1226 Note that setting the environment variable
1227 \begin_inset Flex Code
1230 \begin_layout Plain Layout
1236 to some value has exactly the same effect.
1239 \begin_layout Standard
1240 Having several configurations also requires more maintenance: if you want
1241 to add a new layout to
1242 \begin_inset Flex Code
1245 \begin_layout Plain Layout
1251 which you want available from all your configurations, you must add it
1252 to each directory separately.
1253 You can avoid this with the following trick: after LyX creates the additional
1254 directory, most of the subdirectories (see above) are empty.
1255 If you want the new configuration to mirror an existing one, replace the
1256 empty subdirectory with a symbolic link to the matching subdirectory in
1257 the existing configuration.
1259 \begin_inset Flex Code
1262 \begin_layout Plain Layout
1268 subdirectory, however, since it contains a file written by the configuration
1269 script (also accessible through
1270 \begin_inset Flex MenuItem
1273 \begin_layout Plain Layout
1274 Tools\SpecialChar \menuseparator
1280 ) which is configuration-specific.
1283 \begin_layout Chapter
1284 The Preferences dialog
1287 \begin_layout Standard
1288 All options of the preferences dialog are described in the Appendix
1290 The Preferences Dialog
1297 For some options you might find here more details.
1300 \begin_layout Section
1302 \begin_inset CommandInset label
1311 \begin_layout Standard
1312 The first step is to define your file formats if they are not already defined.
1314 \begin_inset Flex MenuItem
1317 \begin_layout Plain Layout
1318 Tools\SpecialChar \menuseparator
1326 \begin_inset Flex MenuItem
1329 \begin_layout Plain Layout
1330 File Handling\SpecialChar \menuseparator
1337 \begin_inset Flex MenuItem
1340 \begin_layout Plain Layout
1341 New\SpecialChar \ldots{}
1347 button to define your new format.
1349 \begin_inset Flex MenuItem
1352 \begin_layout Plain Layout
1358 field contains the name used to identify the format in the GUI.
1360 \begin_inset Flex MenuItem
1363 \begin_layout Plain Layout
1369 is used to identify the format internally.
1370 You will also need to enter a file extension.
1371 These are all required.
1373 \begin_inset Flex MenuItem
1376 \begin_layout Plain Layout
1382 field is used to provide a keyboard shortcut on the menus.
1383 (For example, pressing
1384 \begin_inset Flex MenuItem
1387 \begin_layout Plain Layout
1394 \begin_inset Flex MenuItem
1397 \begin_layout Plain Layout
1398 View\SpecialChar \menuseparator
1407 \begin_layout Standard
1409 \begin_inset Flex MenuItem
1412 \begin_layout Plain Layout
1419 \begin_inset Flex MenuItem
1422 \begin_layout Plain Layout
1429 For example, you might want to use
1430 \begin_inset Flex MenuItem
1433 \begin_layout Plain Layout
1439 to view PostScript files.
1440 You can enter the command needed to start the program in the corresponding
1442 In defining this command, you can use the four variables listed in the
1444 The viewer is launched when you view an image in LyX or use the
1445 \begin_inset Flex MenuItem
1448 \begin_layout Plain Layout
1455 The editor is for example launched when you right-click on an image and
1457 \begin_inset Flex MenuItem
1460 \begin_layout Plain Layout
1466 in the appearing context menu.
1469 \begin_layout Standard
1471 \begin_inset Flex MenuItem
1474 \begin_layout Plain Layout
1480 option tells LyX that a format is suitable for document export.
1481 If this is set and if a suitable conversion route exists (see sec.
1482 \begin_inset space \thinspace{}
1486 \begin_inset CommandInset ref
1488 reference "sec:Converters"
1492 ), the format will appear in the
1493 \begin_inset Flex MenuItem
1496 \begin_layout Plain Layout
1497 File\SpecialChar \menuseparator
1504 The format will also appear in the
1505 \begin_inset Flex MenuItem
1508 \begin_layout Plain Layout
1514 menu if a viewer is specified for the format.
1515 Pure image formats, such as
1516 \begin_inset Flex Code
1519 \begin_layout Plain Layout
1525 , should not use this option.
1526 Formats that can both represent vector graphics and documents like
1527 \begin_inset Flex Code
1530 \begin_layout Plain Layout
1539 \begin_layout Standard
1541 \begin_inset Flex MenuItem
1544 \begin_layout Plain Layout
1545 Vector graphics format
1550 tells LyX that a format can contain vector graphics.
1551 This information is used to determine the target format of included graphics
1553 \begin_inset Flex MenuItem
1556 \begin_layout Plain Layout
1563 Included graphics may need to be converted to either
1564 \begin_inset Flex MenuItem
1567 \begin_layout Plain Layout
1574 \begin_inset Flex MenuItem
1577 \begin_layout Plain Layout
1584 \begin_inset Flex MenuItem
1587 \begin_layout Plain Layout
1594 \begin_inset Flex MenuItem
1597 \begin_layout Plain Layout
1603 cannot handle other image formats.
1604 If an included graphic is not already in
1605 \begin_inset Flex MenuItem
1608 \begin_layout Plain Layout
1615 \begin_inset Flex MenuItem
1618 \begin_layout Plain Layout
1625 \begin_inset Flex MenuItem
1628 \begin_layout Plain Layout
1634 format, it is converted to
1635 \begin_inset Flex MenuItem
1638 \begin_layout Plain Layout
1644 if the vector format option is set, and otherwise to
1645 \begin_inset Flex MenuItem
1648 \begin_layout Plain Layout
1657 \begin_layout Section
1661 \begin_layout Standard
1662 Since all conversions from one format to another take place in LyX's temporary
1663 directory, it is sometimes necessary to modify a file before copying it
1664 to the temporary directory in order that the conversion may be performed.
1668 \begin_layout Plain Layout
1669 For example, the file may refer to other files—images, for example—using
1670 relative file names, and these may become invalid when the file is copied
1671 to the temporary directory.
1676 This is done by a Copier: It copies a file to (or from) the temporary directory
1677 and may modify it in the process.
1680 \begin_layout Standard
1681 The definitions of the copiers may use four variables:
1684 \begin_layout Labeling
1685 \labelwidthstring 00.00.0000
1686 \begin_inset Flex Code
1689 \begin_layout Plain Layout
1695 The LyX system directory (e.
1696 \begin_inset space \thinspace{}
1700 \begin_inset space \space{}
1704 \begin_inset Flex MenuItem
1707 \begin_layout Plain Layout
1716 \begin_layout Labeling
1717 \labelwidthstring 00.00.0000
1718 \begin_inset Flex Code
1721 \begin_layout Plain Layout
1730 \begin_layout Labeling
1731 \labelwidthstring 00.00.0000
1732 \begin_inset Flex Code
1735 \begin_layout Plain Layout
1744 \begin_layout Labeling
1745 \labelwidthstring 00.00.0000
1746 \begin_inset Flex Code
1749 \begin_layout Plain Layout
1758 \begin_layout Standard
1759 The latter should be the filename as it would be used in a LaTeX's
1766 It is relevant only when exporting files suitable for such inclusion.
1769 \begin_layout Standard
1770 Copiers can be used to do almost anything with output files.
1771 For example, suppose you want generated pdf files to be copied to a special
1773 \begin_inset Flex Code
1776 \begin_layout Plain Layout
1783 Then you could write a shell script such as this one:
1786 \begin_layout Standard
1787 \begin_inset listings
1791 \begin_layout Plain Layout
1796 \begin_layout Plain Layout
1801 \begin_layout Plain Layout
1803 TOFILE=`basename $2`
1806 \begin_layout Plain Layout
1808 cp $FROMFILE /home/you/pdf/$TOFILE
1813 Save it in your local LyX directory—say,
1814 \begin_inset Flex Code
1817 \begin_layout Plain Layout
1818 /home/you/.lyx/scripts/pdfcopier.sh
1823 —and make it executable, if you need to do so on your platform.
1825 \begin_inset Flex MenuItem
1828 \begin_layout Plain Layout
1829 Tools\SpecialChar \menuseparator
1835 dialog, select under
1836 \begin_inset Flex MenuItem
1839 \begin_layout Plain Layout
1840 File Handling\SpecialChar \menuseparator
1847 \begin_inset Flex MenuItem
1850 \begin_layout Plain Layout
1856 format—or one of the other pdf formats—and enter
1857 \begin_inset Flex Code
1860 \begin_layout Plain Layout
1861 pdfcopier.sh $$i $$o
1867 \begin_inset Flex MenuItem
1870 \begin_layout Plain Layout
1880 \begin_layout Standard
1881 Copiers are used by LyX in various of its own conversions.
1882 For example, if appropriate programs are found, LyX will automatically
1883 install copiers for the
1884 \begin_inset Flex MenuItem
1887 \begin_layout Plain Layout
1894 \begin_inset Flex MenuItem
1897 \begin_layout Plain Layout
1899 \begin_inset space ~
1908 When these formats are exported, the copier sees that not just the main
1909 HTML file but various associated files (style files, images, etc.) are also
1911 All these files are written to a subdirectory of the directory in which
1912 the original LyX file was found.
1916 \begin_layout Plain Layout
1917 This copier can be customized.
1919 \begin_inset Quotes eld
1923 \begin_inset Quotes erd
1926 argument takes a comma-separated list of extensions to be copied; if it
1927 is omitted, all files will be copied.
1929 \begin_inset Quotes eld
1933 \begin_inset Quotes erd
1936 argument determines the extension added to the generated directory.
1938 \begin_inset Quotes eld
1942 \begin_inset Flex MenuItem
1945 \begin_layout Plain Layout
1952 \begin_inset Quotes erd
1955 , so HTML generated from
1956 \begin_inset Flex MenuItem
1959 \begin_layout Plain Layout
1960 /path/to/filename.lyx
1966 \begin_inset Flex MenuItem
1969 \begin_layout Plain Layout
1970 /path/to/filename.html.LyXconv
1984 \begin_layout Section
1986 \begin_inset CommandInset label
1988 name "sec:Converters"
1995 \begin_layout Standard
1996 You can define your own Converters to convert files between different formats.
1998 \begin_inset Flex MenuItem
2001 \begin_layout Plain Layout
2002 Tools\SpecialChar \menuseparator
2003 Preferences\SpecialChar \menuseparator
2004 File Handling\SpecialChar \menuseparator
2013 \begin_layout Standard
2014 To define a new converter, select the
2015 \begin_inset Flex MenuItem
2018 \begin_layout Plain Layout
2020 \begin_inset space ~
2029 \begin_inset Flex MenuItem
2032 \begin_layout Plain Layout
2034 \begin_inset space ~
2042 from the drop-down lists, enter the command needed for the conversion,
2044 \begin_inset Flex MenuItem
2047 \begin_layout Plain Layout
2054 Several variables can be used in the definition of converters:
2057 \begin_layout Labeling
2058 \labelwidthstring 00.00.0000
2059 \begin_inset Flex Code
2062 \begin_layout Plain Layout
2068 The LyX system directory
2071 \begin_layout Labeling
2072 \labelwidthstring 00.00.0000
2073 \begin_inset Flex Code
2076 \begin_layout Plain Layout
2085 \begin_layout Labeling
2086 \labelwidthstring 00.00.0000
2087 \begin_inset Flex Code
2090 \begin_layout Plain Layout
2099 \begin_layout Labeling
2100 \labelwidthstring 00.00.0000
2101 \begin_inset Flex Code
2104 \begin_layout Plain Layout
2110 The base filename of the input file (i.
2111 \begin_inset space \thinspace{}
2114 g., without the extension)
2117 \begin_layout Labeling
2118 \labelwidthstring 00.00.0000
2119 \begin_inset Flex Code
2122 \begin_layout Plain Layout
2128 The path to the input file
2131 \begin_layout Labeling
2132 \labelwidthstring 00.00.0000
2133 \begin_inset Flex Code
2136 \begin_layout Plain Layout
2142 The path to the original input file (this is different from $$p when a
2143 chain of converters is called)
2146 \begin_layout Labeling
2147 \labelwidthstring 00.00.0000
2148 \begin_inset Flex Code
2151 \begin_layout Plain Layout
2157 The iconv name for the encoding of the document.
2160 \begin_layout Standard
2162 \begin_inset Flex MenuItem
2165 \begin_layout Plain Layout
2167 \begin_inset space ~
2175 field you can enter the following flags, separated by commas:
2178 \begin_layout Labeling
2179 \labelwidthstring 00.00.0000
2180 \begin_inset Flex Code
2183 \begin_layout Plain Layout
2189 This converter runs some form of LaTeX.
2190 This will make LyX's LaTeX error logs available.
2193 \begin_layout Labeling
2194 \labelwidthstring 00.00.0000
2195 \begin_inset Flex Code
2198 \begin_layout Plain Layout
2205 \begin_inset Flex MenuItem
2208 \begin_layout Plain Layout
2214 file for the conversion.
2217 \begin_layout Labeling
2218 \labelwidthstring 00.00.0000
2219 \begin_inset Flex Code
2222 \begin_layout Plain Layout
2231 \begin_layout Standard
2232 The following three flags are not really flags at all because they take
2234 \begin_inset Flex MenuItem
2237 \begin_layout Plain Layout
2239 \begin_inset space ~
2243 \begin_inset space ~
2254 \begin_layout Labeling
2255 \labelwidthstring 00.00.0000
2256 \begin_inset Flex Code
2259 \begin_layout Plain Layout
2265 If set, the converter's standard error will be redirected to a file
2266 \begin_inset Flex Code
2269 \begin_layout Plain Layout
2275 , and the script given as argument will be run as:
2276 \begin_inset Flex Code
2279 \begin_layout Plain Layout
2280 script < infile.out > infile.log
2286 The argument may contain
2287 \begin_inset Flex Code
2290 \begin_layout Plain Layout
2299 \begin_layout Labeling
2300 \labelwidthstring 00.00.0000
2301 \begin_inset Flex Code
2304 \begin_layout Plain Layout
2310 The name of the directory in which the converter will dump the generated
2312 LyX will not create this directory, and it does not copy anything into
2313 it, though it will copy this directory to the destination.
2314 The argument may contain
2315 \begin_inset Flex Code
2318 \begin_layout Plain Layout
2324 , which will be replaced by the base name of the input and output files,
2325 respectively, when the directory is copied.
2326 \begin_inset Newline newline
2329 Note that resultdir and usetempdir make no sense together.
2330 The latter will be ignored if the former is given.
2333 \begin_layout Labeling
2334 \labelwidthstring 00.00.0000
2335 \begin_inset Flex Code
2338 \begin_layout Plain Layout
2344 Determines the output file name and may, contain
2345 \begin_inset Flex Code
2348 \begin_layout Plain Layout
2355 Sensible only with resultdir and optional even then; if not given, it defaults
2359 \begin_layout Standard
2360 None of these last three are presently used in any of the converters that
2361 are installed with LyX.
2365 \begin_layout Standard
2366 You do not have to define converters for all formats between which you want
2368 For example, you will note that there is no `LyX to PostScript' converter,
2369 but LyX will export PostScript.
2370 It does so by first creating a LaTeX file (no converter needs to be defined
2371 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2372 and finally converting the resulting DVI file to PostScript.
2373 LyX finds such `chains' of converters automatically, and it will always
2374 choose the shortest possible chain.
2375 You can, though, still define multiple conversion methods between file
2377 For example, the standard LyX configuration provides three ways to convert
2378 LaTeX to PDF: Directly, using
2379 \begin_inset Flex MenuItem
2382 \begin_layout Plain Layout
2388 ; via (DVI and) PostScript, using
2389 \begin_inset Flex MenuItem
2392 \begin_layout Plain Layout
2399 \begin_inset Flex MenuItem
2402 \begin_layout Plain Layout
2409 To define such alternate chains, you must define multiple target `file
2410 formats', as described in section
2411 \begin_inset CommandInset ref
2413 reference "sec:Formats"
2418 For example, in the standard configuration, the formats named
2419 \begin_inset Flex MenuItem
2422 \begin_layout Plain Layout
2429 \begin_inset Flex MenuItem
2432 \begin_layout Plain Layout
2439 \begin_inset Flex MenuItem
2442 \begin_layout Plain Layout
2448 are defined, all of which share the extension
2449 \begin_inset Flex MenuItem
2452 \begin_layout Plain Layout
2458 , and which correspond to the conversion methods just mentioned.
2461 \begin_layout Chapter
2462 Internationalizing LyX
2463 \begin_inset CommandInset label
2465 name "cha:Internationalizing-LyX"
2472 \begin_layout Standard
2473 LyX supports using a translated interface.
2474 Last time we checked, LyX provided text in thirty languages.
2475 The language of choice is called your
2480 (For further reading on locale settings, see also the documentation for
2481 locale that comes with your operating system.
2482 For Linux, the manual page for
2483 \begin_inset Flex Code
2486 \begin_layout Plain Layout
2492 could be a good place to start).
2495 \begin_layout Standard
2496 Notice that these translations will work, but do contain a few flaws.
2497 In particular, all dialogs have been designed with the English text in
2498 mind, which means that some of the translated text will be too large to
2499 fit within the space allocated.
2500 This is only a display problem and will not cause any harm.
2501 Also, you will find that some of the translations do not define shortcut
2502 keys for everything.
2503 Sometimes, there are simply not enough free letters to do it.
2504 Other times, the translator just hasn't got around to doing it yet.
2505 Our localization team, which you may wish to join,
2509 \begin_layout Plain Layout
2510 If you are a fluent speaker of a language other than English, joining these
2511 teams is a great way to give back to the LyX community!
2516 will of course try to fix these shortcomings in future versions of LyX.
2519 \begin_layout Section
2523 \begin_layout Subsection
2524 Translating the graphical user interface (text messages).
2527 \begin_layout Standard
2529 \begin_inset Flex Code
2532 \begin_layout Plain Layout
2538 library to handle the internationalization of the interface.
2539 To have LyX speak your favorite language in all menus and dialogs, you
2541 \begin_inset Flex Code
2544 \begin_layout Plain Layout
2550 -file for that language.
2551 When this is available, you'll have to generate a
2552 \begin_inset Flex Code
2555 \begin_layout Plain Layout
2561 -file from it and install the
2562 \begin_inset Flex Code
2565 \begin_layout Plain Layout
2572 The process of doing all of this is explained in the documentation for
2574 \begin_inset Flex Code
2577 \begin_layout Plain Layout
2584 It is possible to do this just for yourself, but if you're going to do
2585 it, you might as well share the results of your labors with the rest of
2587 Send a message to the LyX developers' list for more information about how
2591 \begin_layout Standard
2592 In short, this is what you should do (xx denotes the language code):
2595 \begin_layout Itemize
2596 Check out the LyX source code.
2598 \begin_inset CommandInset href
2600 name "information on the web"
2601 target "http://www.lyx.org/devel/cvs.php"
2608 \begin_layout Itemize
2610 \begin_inset Flex Code
2613 \begin_layout Plain Layout
2619 to the folder of the
2620 \begin_inset Flex Code
2623 \begin_layout Plain Layout
2631 \begin_inset Flex Code
2634 \begin_layout Plain Layout
2642 \begin_inset Flex Code
2645 \begin_layout Plain Layout
2651 doesn't exist anywhere, it can be remade with the console command
2652 \begin_inset Flex Code
2655 \begin_layout Plain Layout
2661 in that directory, or you can use an existing po-file for some other language
2665 \begin_layout Itemize
2667 \begin_inset Flex Code
2670 \begin_layout Plain Layout
2680 \begin_layout Plain Layout
2681 This is just a text file, so it can be edited in any text editor.
2682 But there are also specialized programs that support such editing, such
2687 (for all platforms) or
2696 contains a `mode' for editing
2697 \begin_inset Flex Code
2700 \begin_layout Plain Layout
2711 For some menu- and widget-labels, there are also shortcut keys that should
2713 Those keys are marked after a `|', and should be translated according to
2714 the words and phrases of the language.
2715 You should also fill also out the information at the beginning of the new
2717 \begin_inset Flex Code
2720 \begin_layout Plain Layout
2726 -file with your email-address, etc., so people know where to reach you with
2727 suggestions and entertaining flames.
2730 \begin_layout Standard
2731 If you are just doing this on your own, then:
2734 \begin_layout Itemize
2736 \begin_inset Flex Code
2739 \begin_layout Plain Layout
2746 This can be done with
2747 \begin_inset Flex Code
2750 \begin_layout Plain Layout
2751 msgfmt -o xx.mo < xx.po
2759 \begin_layout Itemize
2761 \begin_inset Flex Code
2764 \begin_layout Plain Layout
2770 -file to your locale-tree, at the correct directory for application messages
2775 xx, and under the name
2776 \begin_inset Flex Code
2779 \begin_layout Plain Layout
2786 \begin_inset space \thinspace{}
2790 \begin_inset space \space{}
2794 \begin_inset Flex Code
2797 \begin_layout Plain Layout
2798 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2808 \begin_layout Standard
2809 As said, however, it would be best if the new
2810 \begin_inset Flex Code
2813 \begin_layout Plain Layout
2819 -file could be added to the LyX distribution, so others can use it.
2820 Adding it involves making additional changes to LyX.
2821 So send an email to the developers' mailing list if you're interested in
2825 \begin_layout Subsubsection
2829 \begin_layout Standard
2830 Sometimes it turns out that one English message needs to be translated into
2831 different messages in the target language.
2832 One example is the message
2833 \begin_inset Flex Code
2836 \begin_layout Plain Layout
2842 which has the German translation
2850 , depending upon exactly what the English
2851 \begin_inset Quotes eld
2855 \begin_inset Quotes erd
2860 \begin_inset Flex Code
2863 \begin_layout Plain Layout
2869 does not handle such ambiguous translations.
2870 Therefore you have to add some context information to the message: Instead
2872 \begin_inset Flex Code
2875 \begin_layout Plain Layout
2882 \begin_inset Flex Code
2885 \begin_layout Plain Layout
2886 To[[as in 'From format x to format y']]
2892 \begin_inset Flex Code
2895 \begin_layout Plain Layout
2896 To[[as in 'From page x to page y']].
2901 Now the two occurrences of
2902 \begin_inset Flex Code
2905 \begin_layout Plain Layout
2912 \begin_inset Flex Code
2915 \begin_layout Plain Layout
2921 and can be translated correctly to
2932 \begin_layout Standard
2933 Of course the context information needs to be stripped off the original
2934 message when no translation is used.
2935 Therefore you have to put it in double square brackets at the end of the
2936 message (see the example above).
2937 The translation mechanism of LyX ensures that everything in double square
2938 brackets at the end of messages is removed before displaying the message.
2941 \begin_layout Subsection
2942 Translating the documentation.
2945 \begin_layout Standard
2946 The online documentation (in the
2947 \begin_inset Flex MenuItem
2950 \begin_layout Plain Layout
2956 -menu) can (and should!) be translated.
2957 If there are translated versions of the documentation available
2961 \begin_layout Plain Layout
2962 As of March 2008, at least some of the documents have been translated into
2963 fourteen languages, with the Tutorial available in a few more.
2968 and the locale is set accordingly, these will be used automagically by
2970 LyX looks for translated versions as
2971 \begin_inset Flex Code
2974 \begin_layout Plain Layout
2975 LyXDir/doc/xx/DocName.lyx
2981 \begin_inset Flex Code
2984 \begin_layout Plain Layout
2990 is the code for the language currently in use.
2991 If there are no translated documents, the default English versions will
2993 Note that the translated versions must have the same filenames (
2994 \begin_inset Flex Code
2997 \begin_layout Plain Layout
3003 above) as the original.
3004 If you feel up to translating the documentation (an excellent way to proof-read
3005 the original documentation by the way!), there are a few things you should
3009 \begin_layout Itemize
3010 Check out the documentation translation web page at
3011 \begin_inset CommandInset href
3013 name "http://www.lyx.org/Translation"
3014 target "http://www.lyx.org/Translation"
3019 That way, you can find out which (if any) documents have already been translate
3020 d into your language.
3021 You can also find out who (if anyone) is organizing the effort to translate
3022 the documentation into your language.
3023 If no one is organizing the effort, please let us know that you're interested.
3026 \begin_layout Standard
3027 Once you get to actually translating, here's a few hints for you that may
3031 \begin_layout Itemize
3032 Join the documentation team! There is information on how to do that in
3033 \begin_inset Flex Code
3036 \begin_layout Plain Layout
3043 \begin_inset Flex MenuItem
3046 \begin_layout Plain Layout
3047 Help\SpecialChar \menuseparator
3053 ), which by the way is the first document you should translate.
3056 \begin_layout Itemize
3057 Learn the typographic conventions for the language you are translating to.
3058 Typography is an ancient art and over the centuries, a great variety of
3059 conventions have developed throughout different parts of the world.
3060 Also study the professional terminology amongst typographers in your country.
3061 Inventing your own terminology will only confuse the users.
3064 (Warning! Typography is addictive!)
3067 \begin_layout Itemize
3068 Make a copy of the document.
3069 This will be your working copy.
3070 You can use this as your personal translated help-file by placing it in
3072 \begin_inset Flex Code
3075 \begin_layout Plain Layout
3084 \begin_layout Itemize
3085 Sometimes the original document (from the LyX-team) will be updated.
3086 Use the source viewer at
3087 \begin_inset CommandInset href
3089 name "http://www.lyx.org/trac/timeline"
3090 target "http://www.lyx.org/trac/timeline"
3094 to see what has been changed.
3095 That way you can easily see which parts of the translated document need
3099 \begin_layout Standard
3100 If you ever find an error in the original document, fix it and notify the
3101 rest of the documentation team of the changes! (You didn't forget to join
3102 the documentation team, did you?)
3105 \begin_layout Standard
3106 \begin_inset Branch OutDated
3109 \begin_layout Section
3110 International Keyboard Support
3113 \begin_layout Standard
3116 [Editor's Note: The following section is by
3124 It needs to be fixed to conform to the new Documentation Style sheet and
3125 to make use of the new v1.0 features.
3126 The whole thing also needs to be merged with the section following it.-jw
3127 It may also be badly out of date.-rh (2008)]
3130 \begin_layout Subsection
3131 Defining Own Keymaps: Keymap File Format
3134 \begin_layout Standard
3135 Let's look at a keyboard definition file a little closer.
3136 It is a plain text file defining
3139 \begin_layout Itemize
3140 key-to-key or key-to-string translations
3143 \begin_layout Itemize
3147 \begin_layout Itemize
3148 dead keys exceptions
3151 \begin_layout Standard
3152 To define key-to-key or key-to-string translation, use this command:
3155 \begin_layout Quotation
3156 \begin_inset Flex Code
3159 \begin_layout Plain Layout
3168 \begin_inset Flex Code
3171 \begin_layout Plain Layout
3180 \begin_layout Standard
3182 \begin_inset Flex Code
3185 \begin_layout Plain Layout
3191 is the key to be translated and
3192 \begin_inset Flex Code
3195 \begin_layout Plain Layout
3201 is the string to be inserted into the document.
3202 To define dead keys, use:
3205 \begin_layout Quotation
3206 \begin_inset Flex Code
3209 \begin_layout Plain Layout
3218 \begin_inset Flex Code
3221 \begin_layout Plain Layout
3230 \begin_layout Standard
3232 \begin_inset Flex Code
3235 \begin_layout Plain Layout
3241 is a keyboard key and
3242 \begin_inset Flex Code
3245 \begin_layout Plain Layout
3252 The following dead keys are supported (shortcut name is in parentheses):
3255 \begin_layout Quotation
3259 \begin_inset space \hfill{}
3265 \begin_layout Quotation
3267 \begin_inset space \hfill{}
3273 \begin_layout Quotation
3275 \begin_inset space \hfill{}
3281 \begin_layout Quotation
3283 \begin_inset space \hfill{}
3289 \begin_layout Quotation
3291 \begin_inset space \hfill{}
3297 \begin_layout Quotation
3299 \begin_inset space \hfill{}
3306 \begin_layout Plain Layout
3318 \begin_layout Quotation
3320 \begin_inset space \hfill{}
3326 \begin_layout Quotation
3328 \begin_inset space \hfill{}
3335 \begin_layout Plain Layout
3347 \begin_layout Quotation
3349 \begin_inset space \hfill{}
3355 \begin_layout Quotation
3357 \begin_inset space \hfill{}
3363 \begin_layout Quotation
3365 \begin_inset space \hfill{}
3372 \begin_layout Plain Layout
3384 \begin_layout Quotation
3386 \begin_inset space \hfill{}
3393 \begin_layout Plain Layout
3405 \begin_layout Quotation
3407 \begin_inset space \hfill{}
3413 \begin_layout Quotation
3414 hungarian umlaut (hug)
3415 \begin_inset space \hfill{}
3421 \begin_layout Quotation
3423 \begin_inset space \hfill{}
3429 \begin_layout Quotation
3431 \begin_inset space \hfill{}
3438 \begin_layout Plain Layout
3450 \begin_layout Standard
3451 Since in many international keyboards there are exceptions to what some
3452 dead keys should do, you can define them using
3455 \begin_layout Quotation
3456 \begin_inset Flex Code
3459 \begin_layout Plain Layout
3467 deadkey key outstring
3470 \begin_layout Standard
3471 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3475 \begin_layout Quotation
3476 \begin_inset Flex Code
3479 \begin_layout Plain Layout
3492 \begin_layout Standard
3493 to make it work correctly.
3494 Also, you have to define as exceptions dead keys over i and j, to remove
3495 the dot from them before inserting an accent mark.
3496 I will change this when the time comes, but so far I haven't had time.
3499 \begin_layout Standard
3500 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3503 \begin_inset Flex Code
3506 \begin_layout Plain Layout
3512 have different meaning.
3514 \begin_inset Flex Code
3517 \begin_layout Plain Layout
3523 marks comments, quotes start and end LaTeX-style commands.
3524 To enter quote, you'll need to use
3525 \begin_inset Flex Code
3528 \begin_layout Plain Layout
3537 \begin_inset Flex Code
3540 \begin_layout Plain Layout
3547 \begin_inset Flex Code
3550 \begin_layout Plain Layout
3561 \begin_layout Standard
3562 If you make a keyboard description file that works for your language, please
3563 mail it to me, so I can include it in the next keymap distribution.
3566 \begin_layout Standard
3567 More keywords will be supported in keymap configuration file in future,
3571 \begin_layout Itemize
3572 \begin_inset Flex Code
3575 \begin_layout Plain Layout
3586 \begin_inset space \hfill{}
3590 \begin_inset Flex Code
3593 \begin_layout Plain Layout
3602 \begin_layout Itemize
3603 \begin_inset Flex Code
3606 \begin_layout Plain Layout
3617 \begin_inset space \hfill{}
3621 \begin_inset Flex Code
3624 \begin_layout Plain Layout
3630 an external keymap translation program
3633 \begin_layout Standard
3634 Also, it should look into
3635 \begin_inset Flex Code
3638 \begin_layout Plain Layout
3644 file for defaults, too (for example, a
3645 \begin_inset Flex Code
3648 \begin_layout Plain Layout
3656 option to include default keyboard).
3664 \begin_layout Section
3665 International Keymap Stuff
3666 \begin_inset CommandInset label
3668 name "sec:International-Keymap-Stuff"
3675 \begin_layout Standard
3676 \begin_inset Note Note
3679 \begin_layout Plain Layout
3680 In doing the revisions on this document in March 2008, I did not look over
3681 this stuff, as I do not understand it.
3682 It would be good if someone else could do so.
3691 \begin_layout Standard
3692 The next two sections describe the
3693 \begin_inset Flex Code
3696 \begin_layout Plain Layout
3705 \begin_inset Flex Code
3708 \begin_layout Plain Layout
3716 file syntax in detail.
3717 These sections should help you design your own key map if the ones provided
3718 do not meet your needs.
3721 \begin_layout Subsection
3725 \begin_layout Standard
3729 \begin_inset Flex Code
3732 \begin_layout Plain Layout
3738 file maps keystrokes to characters or strings.
3739 As the name suggests, it sets a keyboard mapping.
3741 \begin_inset Flex Code
3744 \begin_layout Plain Layout
3755 \begin_inset Flex Code
3758 \begin_layout Plain Layout
3773 \begin_inset Flex Code
3776 \begin_layout Plain Layout
3789 \begin_inset Flex Code
3792 \begin_layout Plain Layout
3801 \begin_inset Flex Code
3804 \begin_layout Plain Layout
3812 are described in this section.
3815 \begin_layout Labeling
3816 \labelwidthstring 00.00.0000
3817 \begin_inset Flex Code
3820 \begin_layout Plain Layout
3828 Map a character to a string
3831 \begin_layout LyX-Code
3846 \begin_layout Standard
3879 the double-quote (")
3896 must be escaped with a preceding backslash (
3907 \begin_layout Standard
3909 \begin_inset Flex MenuItem
3912 \begin_layout Plain Layout
3920 statement to cause the symbol
3921 \begin_inset Flex MenuItem
3924 \begin_layout Plain Layout
3932 to be output for the keystroke
3933 \begin_inset Flex MenuItem
3936 \begin_layout Plain Layout
3947 \begin_layout LyX-Code
3953 \begin_layout Labeling
3954 \labelwidthstring 00.00.0000
3955 \begin_inset Flex Code
3958 \begin_layout Plain Layout
3966 Specify an accent character
3969 \begin_layout LyX-Code
3978 \begin_layout Standard
3979 This will make the cha
4017 This is the dead key
4021 \begin_layout Plain Layout
4028 refers to a key that does not produce a character by itself, but when followed
4029 with another key, produces the desired accent character.
4030 For example, a German characte
4032 r with an umlaut like
4042 can be produced in this manner.
4051 \begin_layout Standard
4064 and then another key not in
4081 followed by the other, not allowed key, as output.
4085 \begin_inset Flex MenuItem
4088 \begin_layout Plain Layout
4096 cancels a dead key, so if
4107 \begin_inset Flex MenuItem
4110 \begin_layout Plain Layout
4119 , the cursor will not go one position backwards but will instead cancel
4135 might have had on the next keystroke.
4139 \begin_layout Standard
4140 The following example specifies that the character ' is to be an acute accent,
4141 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4144 \begin_layout LyX-Code
4147 kmod ' acute aeiouAEIOU
4150 \begin_layout Labeling
4151 \labelwidthstring 00.00.0000
4152 \begin_inset Flex Code
4155 \begin_layout Plain Layout
4161 Specify an exception to the accent character
4164 \begin_layout LyX-Code
4173 \begin_layout Standard
4174 This defines an exce
4215 have been assigned a keystroke with a previous
4218 \begin_inset Flex Code
4221 \begin_layout Plain Layout
4245 must not belong in the
4292 If such a declaration does not exist in
4300 \begin_inset Flex Code
4303 \begin_layout Plain Layout
4337 \begin_inset Flex Code
4340 \begin_layout Plain Layout
4354 \begin_layout Standard
4355 The following command produces causes äi to be produced when you enter acute-i
4359 \begin_layout LyX-Code
4373 \begin_layout Labeling
4374 \labelwidthstring 00.00.0000
4375 \begin_inset Flex Code
4378 \begin_layout Plain Layout
4384 Combine two accent characters
4387 \begin_layout LyX-Code
4393 accent1 accent2 allowed
4396 \begin_layout Standard
4397 This one is getting pretty esoteric.
4398 It allows you to combine the effect
4454 \begin_inset Flex Code
4457 \begin_layout Plain Layout
4485 \begin_layout Standard
4486 Consider this example from the
4487 \begin_inset Flex Code
4490 \begin_layout Plain Layout
4501 \begin_layout LyX-Code
4504 kmod ; acute aeioyvhAEIOYVH
4508 kcomb acute umlaut iyIY
4511 \begin_layout Standard
4512 This allows you to press
4513 \begin_inset Flex MenuItem
4516 \begin_layout Plain Layout
4524 and get the effect of
4525 \begin_inset Flex Code
4528 \begin_layout Plain Layout
4547 in this case cancels the last dead key, so if you press
4548 \begin_inset Flex MenuItem
4551 \begin_layout Plain Layout
4560 \begin_inset Flex Code
4563 \begin_layout Plain Layout
4576 \begin_layout Subsection
4580 \begin_layout Standard
4582 \begin_inset Flex Code
4585 \begin_layout Plain Layout
4593 mapping is performed, a
4594 \begin_inset Flex Code
4597 \begin_layout Plain Layout
4607 file maps the strings that the symbols generate to characters in the current
4609 The LyX distribution currently includes at least the
4610 \begin_inset Flex Code
4613 \begin_layout Plain Layout
4622 \begin_inset Flex Code
4625 \begin_layout Plain Layout
4636 \begin_layout Standard
4638 \begin_inset Flex Code
4641 \begin_layout Plain Layout
4649 file is a sequence of declarations of the form
4652 \begin_layout LyX-Code
4665 \begin_layout Standard
4666 For example, in order to map
4667 \begin_inset Flex MenuItem
4670 \begin_layout Plain Layout
4680 to the corresponding character in the iso-8859-1 set (233), the following
4684 \begin_layout LyX-Code
4692 \begin_layout Standard
4694 \begin_inset Flex Code
4697 \begin_layout Plain Layout
4706 \begin_inset Flex Code
4709 \begin_layout Plain Layout
4727 the same character can apply to more than one string.
4729 \begin_inset Flex Code
4732 \begin_layout Plain Layout
4743 \begin_layout LyX-Code
4755 \begin_inset Newline newline
4771 \begin_layout Standard
4772 If LyX cannot find a mapping for the string produced by the keystroke or
4773 a deadkey sequence, it will check if it looks like an accented char and
4774 try to draw an accent over the character on screen.
4777 \begin_layout Subsection
4781 \begin_layout Standard
4782 There is a second way to add support for international characters through
4783 so-called dead-keys.
4784 A dead-key works in combination with a letter to produce an accented character.
4785 Here, we'll explain how to create a really simple dead-key to illustrate
4789 \begin_layout Standard
4790 Suppose you happen to need the circumflex character,
4791 \begin_inset Quotes eld
4795 \begin_inset Quotes erd
4800 \begin_inset Flex MenuItem
4803 \begin_layout Plain Layout
4810 \begin_inset space ~
4814 \begin_inset Flex MenuItem
4817 \begin_layout Plain Layout
4823 ] to the LyX command
4824 \begin_inset Flex Code
4827 \begin_layout Plain Layout
4834 \begin_inset Flex Code
4837 \begin_layout Plain Layout
4844 Now, whenever you type the
4845 \begin_inset Flex MenuItem
4848 \begin_layout Plain Layout
4854 -key followed by a letter, that letter will have a circumflex accent on
4856 For example, the sequence
4857 \begin_inset Quotes eld
4861 \begin_inset Flex MenuItem
4864 \begin_layout Plain Layout
4871 \begin_inset Quotes erd
4874 produces the letter:
4875 \begin_inset Quotes eld
4879 \begin_inset Quotes erd
4883 If you tried to type
4884 \begin_inset Quotes eld
4888 \begin_inset Flex MenuItem
4891 \begin_layout Plain Layout
4898 \begin_inset Quotes erd
4901 , however, LyX will complain with a beep, since a
4902 \begin_inset Quotes eld
4906 \begin_inset Flex MenuItem
4909 \begin_layout Plain Layout
4916 \begin_inset Quotes erd
4919 never takes a circumflex accent.
4921 \begin_inset Flex MenuItem
4924 \begin_layout Plain Layout
4930 after a dead-key produces the bare-accent.
4931 Please note this last point! If you bind a key to a dead-key, you'll need
4932 to rebind the character on that key to yet another key.
4934 \begin_inset Flex MenuItem
4937 \begin_layout Plain Layout
4943 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4946 \begin_layout Standard
4947 One common way to bind dead-keys is to use
4948 \begin_inset Flex MenuItem
4951 \begin_layout Plain Layout
4958 \begin_inset Flex MenuItem
4961 \begin_layout Plain Layout
4968 \begin_inset Flex MenuItem
4971 \begin_layout Plain Layout
4977 in combination with an accent, like
4978 \begin_inset Quotes eld
4982 \begin_inset Flex MenuItem
4985 \begin_layout Plain Layout
4992 \begin_inset Quotes erd
4996 \begin_inset Quotes eld
5000 \begin_inset Flex MenuItem
5003 \begin_layout Plain Layout
5010 \begin_inset Quotes erd
5014 \begin_inset Quotes eld
5018 \begin_inset Flex MenuItem
5021 \begin_layout Plain Layout
5028 \begin_inset Quotes erd
5032 Another way involves using
5033 \begin_inset Flex Code
5036 \begin_layout Plain Layout
5043 \begin_inset Flex Code
5046 \begin_layout Plain Layout
5052 to set up the special
5053 \begin_inset Flex Code
5056 \begin_layout Plain Layout
5064 \begin_inset Flex Code
5067 \begin_layout Plain Layout
5073 acts in some ways just like
5074 \begin_inset Flex MenuItem
5077 \begin_layout Plain Layout
5083 and permits you to bind keys to accented characters.
5084 You can also turn keys into dead-keys by binding them to something like
5086 \begin_inset Flex Code
5089 \begin_layout Plain Layout
5095 and then binding this symbolic key to the corresponding LyX command.
5099 \begin_layout Plain Layout
5104 : This is exactly what I do in my
5105 \begin_inset Flex Code
5108 \begin_layout Plain Layout
5115 \begin_inset Flex Code
5118 \begin_layout Plain Layout
5126 \begin_inset Flex MenuItem
5129 \begin_layout Plain Layout
5131 \begin_inset space ~
5140 \begin_inset Flex Code
5143 \begin_layout Plain Layout
5149 and a bunch of these
5150 \begin_inset Quotes eld
5154 \begin_inset Flex Code
5157 \begin_layout Plain Layout
5164 \begin_inset Quotes erd
5167 symbolic keys bound such things as
5168 \begin_inset Flex MenuItem
5171 \begin_layout Plain Layout
5173 \begin_inset space ~
5182 \begin_inset Flex MenuItem
5185 \begin_layout Plain Layout
5187 \begin_inset space ~
5196 This is how I produce my accented characters.
5201 You can make just about anything into the
5202 \begin_inset Flex Code
5205 \begin_layout Plain Layout
5212 \begin_inset Flex MenuItem
5215 \begin_layout Plain Layout
5221 keys, a spare function key, etc.
5222 As for the LyX commands that produce accents, check the entry for
5223 \begin_inset Flex Code
5226 \begin_layout Plain Layout
5237 You'll find the complete list there.
5240 \begin_layout Subsection
5241 Saving your Language Configuration
5244 \begin_layout Standard
5245 You can edit your preferences so that your desired language environment
5246 is automatically configured when LyX starts up, via the
5247 \begin_inset Flex MenuItem
5250 \begin_layout Plain Layout
5251 Edit\SpecialChar \menuseparator
5260 \begin_layout Chapter
5261 Installing New Document Classes, Layouts, and Templates
5262 \begin_inset CommandInset label
5264 name "cha:Installing-New-Document"
5269 \begin_inset Argument
5272 \begin_layout Plain Layout
5273 Installing New Document Classes
5281 \begin_layout Standard
5282 In this chapter, we describe the procedures for creating and installing
5283 new LyX layout and template files, as well as offer a refresher on correctly
5284 installing new LaTeX document classes.
5288 \begin_layout Standard
5289 First, let us a say a few words about how one ought to think about the relation
5290 between LyX and LaTeX.
5291 The thing to understand is that, in a certain sense, LyX doesn't know anything
5293 Indeed, from LyX's point of view, LaTeX is just one of several
5294 \begin_inset Quotes eld
5298 \begin_inset Quotes erd
5301 in which it is capable of producing output.
5302 Other such formats are DocBook, plaintext, and XHTML.
5303 LaTeX is, of course, a particularly important format, but very little of
5304 the information LyX has about LaTeX is actually contained in the program
5309 \begin_layout Plain Layout
5310 Some commands are sufficiently complex that they are
5311 \begin_inset Quotes eld
5315 \begin_inset Quotes erd
5319 But the developers generally regard this as a Bad Thing.
5324 Rather, that information, even for the standard classes like
5325 \begin_inset Flex Code
5328 \begin_layout Plain Layout
5334 , is contained in `layout files'.
5335 Similarly, LyX itself does not know much about DocBook or XHTML.
5336 What it knows is contained in layout files.
5339 \begin_layout Standard
5340 You can think of the layout file for a given document class as a translation
5341 manual between LyX constructs---paragraphs with their corresponding styles,
5342 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5344 Almost everything LyX knows about
5345 \begin_inset Flex Code
5348 \begin_layout Plain Layout
5354 , for example, is contained in the file
5355 \begin_inset Flex Code
5358 \begin_layout Plain Layout
5364 and in various other files it includes.
5365 For this reason, anyone intending to write layout files should plan to
5366 study the existing files.
5367 A good place to start is with
5368 \begin_inset Flex Code
5371 \begin_layout Plain Layout
5377 , which is included in
5378 \begin_inset Flex Code
5381 \begin_layout Plain Layout
5388 \begin_inset Flex Code
5391 \begin_layout Plain Layout
5397 , and many of the other layout files for document classes.
5398 This file is where sections and the like are defined:
5399 \begin_inset Flex Code
5402 \begin_layout Plain Layout
5408 tells LyX how paragraphs that are marked with the Section, Subsection,
5409 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5412 \begin_inset Flex Code
5415 \begin_layout Plain Layout
5421 file basically just includes several of these
5422 \begin_inset Flex Code
5425 \begin_layout Plain Layout
5434 \begin_layout Standard
5435 Defining the LyX--LaTeX correspondence is not the only thing layout files
5437 Their other job is to define how the LyX constructs themselves will appear
5439 The fact that layout files have these two jobs is often a source of confusion,
5440 because they are completely separate.
5441 Telling LyX how to translate a certain paragraph style into LaTeX does
5442 not tell LyX how to display it; conversely, telling LyX how to display
5443 a certain paragraph style does not tell LyX how to translate it into LaTeX
5444 (let alone tell LaTeX how to display it).
5445 So, in general, when you define a new LyX construct, you must always do
5446 two quite separate things: (i)
5447 \begin_inset space ~
5450 tell LyX how to translate it into LaTeX and (ii)
5451 \begin_inset space ~
5454 tell LyX how to display it.
5457 \begin_layout Standard
5458 Much the same is true, of course, as regards LyX's other backend formats,
5459 though XHTML is in some ways different, because in that case LyX
5463 able, to some extent, to use information about how it should display a
5464 paragraph on the screen to output information (in the form of CSS) about
5465 how the paragraph should be displayed in a browser.
5466 Even in this case, however, the distinction between what LyX does internally
5467 and how things are rendered externally remains in force, and the two can
5468 be controlled separately.
5470 \begin_inset CommandInset ref
5472 reference "sec:Tags-for-XHTML"
5479 \begin_layout Section
5480 Installing new LaTeX files
5483 \begin_layout Standard
5484 Some installations may not include a LaTeX package or class file that you
5485 would like to use within LyX.
5486 For example, you might need FoilTeX, a package for preparing slides for
5487 overhead projectors.
5488 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5489 a user interface for installing such packages.
5490 For example, with MiKTeX, you start the program
5491 \begin_inset Quotes eld
5495 \begin_inset space ~
5499 \begin_inset Quotes erd
5502 to get a list of available packages.
5503 To install one of them, right click on it or use the corresponding toolbar
5507 \begin_layout Standard
5508 If your LaTeX distribution does not provide such a `package manager', or
5509 if the package is not available from your distribution, then follow these
5510 steps to install it manually:
5513 \begin_layout Enumerate
5514 Get the package from
5515 \begin_inset CommandInset href
5518 target "http://www.ctan.org/"
5525 \begin_layout Enumerate
5526 If the package contains a file with the ending
5527 \begin_inset Quotes eld
5531 \begin_inset Flex Code
5534 \begin_layout Plain Layout
5541 \begin_inset Quotes erd
5544 (is the case for FoilTeX) then open a console, change to the folder of
5545 this file and execute the command
5546 \begin_inset Flex Code
5549 \begin_layout Plain Layout
5556 You have now unpacked the package and have all files to install it.
5557 Most LaTeX-packages are not packed and you can skip this step.
5560 \begin_layout Enumerate
5561 Now you need to decide if the package should be available for all users
5566 \begin_layout Enumerate
5567 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5568 for all users on your system, then install it in your `local' TeX tree,
5569 otherwise install it in your own `user' TeX tree.
5570 Where these trees should be created, if they do not already exist, depends
5572 To find this out, look in the file
5573 \begin_inset Flex Code
5576 \begin_layout Plain Layout
5586 \begin_layout Plain Layout
5587 This is usually in the directory
5588 \begin_inset Flex Code
5591 \begin_layout Plain Layout
5597 , though you can execute the command
5598 \begin_inset Flex Code
5601 \begin_layout Plain Layout
5612 The location of the `local' TeX tree is defined by the
5613 \begin_inset Flex Code
5616 \begin_layout Plain Layout
5622 variable; this is usually somewhere like
5623 \begin_inset Flex Code
5626 \begin_layout Plain Layout
5627 /usr/local/share/texmf
5633 The location of the `user' TeX tree is defined by
5634 \begin_inset Flex Code
5637 \begin_layout Plain Layout
5644 \begin_inset Flex Code
5647 \begin_layout Plain Layout
5654 (If these variables are not predefined, you have to define them.) You'll
5655 probably need root permissions to create or modify the `local' tree, but
5656 not for your `user' tree.
5657 \begin_inset Newline newline
5660 In general, it is recommended to install in the user tree because your user
5661 will not be modified or even overwritten when you upgrade your system.
5662 It will typically also be backed up together with everything else when
5663 you backup your home directory (which, of course, you do on a regular basis).
5666 \begin_layout Enumerate
5667 On Windows, if you want the new package to be available for all users on
5668 your system, change to the folder where LaTeX is installed and then change
5670 \begin_inset Flex Code
5673 \begin_layout Plain Layout
5684 (For MiKTeX, this would be by default the folder
5685 \begin_inset Flex Code
5688 \begin_layout Plain Layout
5706 \begin_layout Plain Layout
5707 Note that this will be the correct path only on English installations.
5708 On a German one, it would be
5709 \begin_inset Flex Code
5712 \begin_layout Plain Layout
5726 , and similarly for other languages.
5731 Create there a new folder
5732 \begin_inset Flex Code
5735 \begin_layout Plain Layout
5741 and copy all files of the package into it.
5743 \begin_inset Newline newline
5746 If the package should only available for you or you don't have admin permissions
5747 , do the same, but in the local LaTeX folder.
5749 \begin_inset space \thinspace{}
5753 \begin_inset space ~
5756 2.8 under Windows XP, this would be the folder:
5757 \begin_inset Newline newline
5763 \begin_inset Flex Code
5766 \begin_layout Plain Layout
5769 Documents and Settings
5781 \begin_inset Newline newline
5787 \begin_inset Phantom HPhantom
5790 \begin_layout Plain Layout
5801 \begin_inset Flex Code
5804 \begin_layout Plain Layout
5817 \begin_inset Newline newline
5820 On Vista, it would be:
5821 \begin_inset Newline newline
5825 \begin_inset Flex Code
5828 \begin_layout Plain Layout
5854 \begin_layout Enumerate
5855 Now one only need to tell LaTeX that there are new files.
5856 This depends on the used LaTeX-Distribution:
5860 \begin_layout Enumerate
5861 For TeXLive execute the command
5862 \begin_inset Flex Code
5865 \begin_layout Plain Layout
5872 If you installed the package for all users, then you will probably need
5873 to have root permissions for that.
5876 \begin_layout Enumerate
5877 For MiKTeX, if you have installed the package for all users, start the program
5879 \begin_inset Quotes eld
5883 \begin_inset space ~
5887 \begin_inset Quotes erd
5890 and press the button marked
5891 \begin_inset Quotes eld
5895 \begin_inset Quotes erd
5899 Otherwise start the program
5900 \begin_inset Quotes eld
5904 \begin_inset Quotes erd
5911 \begin_layout Enumerate
5912 Finally, you need to tell LyX that there are new packages available.
5913 So, in LyX, use the menu
5914 \begin_inset Flex MenuItem
5917 \begin_layout Plain Layout
5920 \SpecialChar \menuseparator
5926 and then restart LyX.
5929 \begin_layout Standard
5930 Now the package is installed.
5931 In our example, the document class
5932 \begin_inset Flex Code
5935 \begin_layout Plain Layout
5937 \begin_inset space ~
5944 \begin_layout Plain Layout
5956 will now be available under
5957 \begin_inset Flex MenuItem
5960 \begin_layout Plain Layout
5961 Document\SpecialChar \menuseparator
5962 Settings\SpecialChar \menuseparator
5972 \begin_layout Standard
5973 If you would like to use a LaTeX document class that is not even listed
5975 \begin_inset Flex MenuItem
5978 \begin_layout Plain Layout
5979 Document\SpecialChar \menuseparator
5980 Settings\SpecialChar \menuseparator
5986 , then you need to create a `layout' file for it.
5987 That is the topic of the next section.
5990 \begin_layout Section
5991 Types of layout files
5994 \begin_layout Standard
5995 This section describes the various sorts of LyX files that contain layout
5997 These files describe various paragraph and character styles, determining
5998 how LyX should display them and how they should be translated into LaTeX,
5999 DocBook, XHTML, or whatever output format is being used.
6003 \begin_layout Standard
6004 We shall try to provide a thorough description of the process of writing
6006 However, there are so many different types of documents supported even
6007 by just LaTeX that we can't hope to cover every different possibility or
6008 problem you might encounter.
6009 The LyX users' list is frequented by people with lots of experience with
6010 layout design who are willing to share what they've learned, so please
6011 feel free to ask questions there.
6014 \begin_layout Standard
6015 As you prepare to write a new layout, it is extremely helpful to look at
6016 the layouts distributed with LyX.
6017 If you write a LyX layout for a LaTeX document class that might also be
6018 used by others, or write a module that might be useful to others, then
6019 you should consider posting your layout to the
6020 \begin_inset CommandInset href
6022 name "layout section on the LyX wiki"
6023 target "http://wiki.lyx.org/Layouts/Layouts"
6027 or even to the LyX developers' list, so that it might be included in LyX
6032 \begin_layout Plain Layout
6033 Note that LyX is licensed under the General Public License, so any material
6034 that is contributed to LyX must be similarly licensed.
6042 \begin_layout Subsection
6044 \begin_inset CommandInset label
6046 name "sub:Layout-modules"
6053 \begin_layout Standard
6054 We have spoken to this point about `layout files'.
6055 But there are different sorts of files that contain layout information.
6056 Layout files, strictly so called, have the
6057 \begin_inset Flex Code
6060 \begin_layout Plain Layout
6066 extension and provide LyX with information about document classes.
6067 As of LyX 1.6, however, layout information can also be contained in layout
6073 \begin_inset Flex Code
6076 \begin_layout Plain Layout
6083 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6084 some modules—such as the
6085 \begin_inset Flex Code
6088 \begin_layout Plain Layout
6094 module—specifcally provide support for one package.
6095 In a sense, layout modules are similar to included
6099 \begin_layout Plain Layout
6100 These can have any extension, but by convention have the
6101 \begin_inset Flex Code
6104 \begin_layout Plain Layout
6116 \begin_inset Flex Code
6119 \begin_layout Plain Layout
6125 —in that modules are not specific to a given document class but may be used
6126 with many different classes.
6127 The difference is that using an included file with
6128 \begin_inset Flex Code
6131 \begin_layout Plain Layout
6137 requires editing that file.
6138 Modules, by contrast, are selected in the
6139 \begin_inset Flex MenuItem
6142 \begin_layout Plain Layout
6143 Document\SpecialChar \menuseparator
6152 \begin_layout Standard
6153 Building modules is the easiest way to get started with layout editing,
6154 since it can be as simple as adding a single new paragraph style or flex
6156 But modules may, in principle, contain anything a layout file can contain.
6159 \begin_layout Standard
6160 After creating a new module and copying it to the
6161 \begin_inset Flex Code
6164 \begin_layout Plain Layout
6170 folder, you will need to reconfigure and then restart LyX for the module
6171 to appear in the menu.
6172 However, changes you make to the module will be seen immediately, if you
6174 \begin_inset Flex MenuItem
6177 \begin_layout Plain Layout
6178 Document\SpecialChar \menuseparator
6184 , highlight something, and then hit
6185 \begin_inset Quotes eld
6189 \begin_inset Quotes erd
6195 It is strongly recommended that you save your work before doing this
6200 it is strongly recommended that you not attempt to edit modules while simultaneo
6201 usly working on actual documents
6204 Though of course the developers strive to keep LyX stable in such situations,
6205 syntax errors and the like in your module file could cause strange behavior.
6208 \begin_layout Subsection
6210 \begin_inset Flex MenuItem
6213 \begin_layout Plain Layout
6222 \begin_layout Standard
6223 There are two situations you are likely to encounter when wanting to support
6224 a new LaTeX document class, involving LaTeX2e class (
6225 \begin_inset Flex Code
6228 \begin_layout Plain Layout
6235 \begin_inset Flex Code
6238 \begin_layout Plain Layout
6245 Supporting a style file is usually fairly easy.
6246 Supporting a new class file is a bit harder.
6247 We'll discuss the former in this section and the latter in the next.
6248 Similar remarks apply, of course, if you want to support a new DocBook
6252 \begin_layout Standard
6253 The easier case is the one in which your new document class is provided
6254 as a style file that is to be used in conjunction with an already supported
6256 For the sake of the example, we'll assume that the style file is called
6258 \begin_inset Flex MenuItem
6261 \begin_layout Plain Layout
6267 and that it is meant to be used with
6268 \begin_inset Flex MenuItem
6271 \begin_layout Plain Layout
6277 , which is a standard class.
6281 \begin_layout Standard
6282 Start by copying the existing class's layout file into your local directory:
6286 \begin_layout Plain Layout
6287 Of course, which directory is your local directory will vary by platform,
6288 and LyX allows you to specify your local directory on startup, too, using
6290 \begin_inset Flex Code
6293 \begin_layout Plain Layout
6307 \begin_layout LyX-Code
6308 cp report.layout ~/.lyx/layouts/myclass.layout
6311 \begin_layout Standard
6313 \begin_inset Flex Code
6316 \begin_layout Plain Layout
6322 and change the line:
6325 \begin_layout LyX-Code
6328 DeclareLaTeXClass{report}
6331 \begin_layout Standard
6335 \begin_layout LyX-Code
6338 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6341 \begin_layout Standard
6345 \begin_layout LyX-Code
6347 \begin_inset Newline newline
6353 \begin_inset Newline newline
6359 \begin_layout Standard
6360 near the top of the file.
6363 \begin_layout Standard
6364 Start LyX and select
6365 \begin_inset Flex MenuItem
6368 \begin_layout Plain Layout
6369 Tools\SpecialChar \menuseparator
6376 Then restart LyX and try creating a new document.
6378 \begin_inset Flex MenuItem
6381 \begin_layout Plain Layout
6387 " as a document class option in the
6388 \begin_inset Flex MenuItem
6391 \begin_layout Plain Layout
6392 Document\SpecialChar \menuseparator
6399 It is likely that some of the sectioning commands and such in your new
6400 class will work differently from how they worked in the base class—
6401 \begin_inset Flex Code
6404 \begin_layout Plain Layout
6410 in this example—so you can fiddle around with the settings for the different
6411 sections if you wish.
6412 The layout information for sections is contained in
6413 \begin_inset Flex Code
6416 \begin_layout Plain Layout
6422 , but you do not need to copy and change this file.
6423 Instead, you can simply add your changes to your layout file, after the
6425 \begin_inset Flex Code
6428 \begin_layout Plain Layout
6434 , which itself includes
6435 \begin_inset Flex Code
6438 \begin_layout Plain Layout
6445 For example, you might add these lines:
6448 \begin_layout LyX-Code
6452 \begin_layout LyX-Code
6456 \begin_layout LyX-Code
6460 \begin_layout LyX-Code
6464 \begin_layout LyX-Code
6468 \begin_layout Standard
6469 to change the font for chapter headings to sans-serif.
6470 This will override (or, in this case, add to) the existing declaration
6471 for the Chapter style.
6475 \begin_layout Standard
6476 Your new package may also provide commands or environments not present in
6478 In this case, you will want to add these to the layout file.
6480 \begin_inset CommandInset ref
6482 reference "sec:TextClass"
6486 for information on how to do so.
6489 \begin_layout Standard
6491 \begin_inset Flex MenuItem
6494 \begin_layout Plain Layout
6500 can be used with several different document classes, and even if it cannot,
6501 you might find it easiest just to write a module that you can load with
6503 The simplest possible such module would be:
6506 \begin_layout LyX-Code
6509 DeclareLyXModule{My Package}
6512 \begin_layout LyX-Code
6516 \begin_layout LyX-Code
6517 #Support for mypkg.sty.
6520 \begin_layout LyX-Code
6522 \begin_inset Newline newline
6528 \begin_layout LyX-Code
6530 \begin_inset Newline newline
6536 \begin_layout LyX-Code
6538 \begin_inset Newline newline
6544 \begin_inset Newline newline
6550 \begin_layout Standard
6551 A more complex module might modify the behavior of some existing constructs
6552 or define some new ones.
6554 \begin_inset CommandInset ref
6556 reference "sec:TextClass"
6563 \begin_layout Subsection
6565 \begin_inset Flex MenuItem
6568 \begin_layout Plain Layout
6577 \begin_layout Standard
6578 There are two possibilities here.
6579 One is that the class file is itself based upon an existing document class.
6580 For example, many thesis classes are based upon
6581 \begin_inset Flex MenuItem
6584 \begin_layout Plain Layout
6591 To see whether yours is, look for a line like
6594 \begin_layout LyX-Code
6600 \begin_layout Standard
6602 If so, then you may proceed largely as in the previous section, though
6604 \begin_inset Flex Code
6607 \begin_layout Plain Layout
6613 line will be different.
6614 If your new class is
6615 \begin_inset Flex Code
6618 \begin_layout Plain Layout
6624 and it is based upon
6625 \begin_inset Flex Code
6628 \begin_layout Plain Layout
6634 , then the line should read:
6638 \begin_layout Plain Layout
6639 And it will be easiest if you save the file to
6640 \begin_inset Flex Code
6643 \begin_layout Plain Layout
6649 : LyX assumes that the document class has the same name as the layout file.
6658 \begin_layout LyX-Code
6661 DeclareLaTeXClass[thesis,book]{thesis}
6664 \begin_layout Standard
6665 If, on the other hand, the new class is not based upon an existing class,
6666 you will probably have to
6667 \begin_inset Quotes eld
6671 \begin_inset Quotes erd
6675 We strongly suggest copying an existing layout file which uses a similar
6676 LaTeX class and then modifying it, if you can do so.
6677 At least use an existing file as a starting point so you can find out what
6678 items you need to worry about.
6679 Again, the specifics are covered below.
6682 \begin_layout Subsection
6684 \begin_inset CommandInset label
6686 name "sub:Creating-Templates"
6693 \begin_layout Standard
6694 Once you have written a layout file for a new document class, you might
6695 want to consider writing a
6700 A template acts as a kind of tutorial for your layout, showing how it might
6701 be used, though containing dummy content.
6702 You can of course look at the various templates included with LyX for ideas.
6705 \begin_layout Standard
6706 Templates are created just like usual documents: using LyX.
6707 The only difference is that usual documents contain all possible settings,
6708 including the font scheme and the paper size.
6709 Usually a user doesn't want a template to overwrite his preferred settings
6710 for such parameters.
6711 For that reason, the designer of a template should remove the corresponding
6713 \begin_inset Flex Code
6716 \begin_layout Plain Layout
6725 \begin_inset Flex Code
6728 \begin_layout Plain Layout
6736 from the template LyX file.
6737 This can be done with any simple text-editor, for example
6738 \begin_inset Flex Code
6741 \begin_layout Plain Layout
6748 \begin_inset Flex Code
6751 \begin_layout Plain Layout
6761 \begin_layout Standard
6762 Put the edited template files you create in
6763 \begin_inset Flex Code
6766 \begin_layout Plain Layout
6772 , copy the ones you use from the global template directory in
6773 \begin_inset Flex Code
6776 \begin_layout Plain Layout
6782 to the same place, and redefine the template path in the
6783 \begin_inset Flex MenuItem
6786 \begin_layout Plain Layout
6787 Tools\SpecialChar \menuseparator
6788 Preferences\SpecialChar \menuseparator
6797 \begin_layout Standard
6798 Note, by the way, that there is a template which has a particular meaning:
6800 \begin_inset Flex Code
6803 \begin_layout Plain Layout
6810 This template is loaded every time you create a new document with
6811 \begin_inset Flex MenuItem
6814 \begin_layout Plain Layout
6815 File\SpecialChar \menuseparator
6821 in order to provide useful defaults.
6822 To create this template from inside LyX, all you have to do is to open
6823 a document with the correct settings, and use the
6824 \begin_inset Flex MenuItem
6827 \begin_layout Plain Layout
6828 Save as Document Defaults
6836 \begin_layout Subsection
6837 Upgrading old layout files
6840 \begin_layout Standard
6841 The format of layout files changes with each LyX release, so old layout
6842 files need to be converted to the new format.
6843 This process has been automated since LyX 1.4: If LyX reads a layout file
6844 in an older format, it automatically calls the script
6845 \begin_inset Flex Code
6848 \begin_layout Plain Layout
6854 to convert it to a temporary file in current format.
6855 The original file is left untouched.
6856 If you use the layout file often, then, you may want to convert it permanently,
6857 so that LyX does not have to do so itself every time.
6858 To do this, you can call the converter manually:
6861 \begin_layout LyX-Code
6862 mv myclass.layout myclass.old
6865 \begin_layout LyX-Code
6866 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6869 \begin_layout Standard
6871 \begin_inset Flex Code
6874 \begin_layout Plain Layout
6880 with the name of your LyX system directory, of course.
6883 \begin_layout Standard
6884 Note that manual conversion does not affect included files, so these will
6885 have to be converted separately.
6888 \begin_layout Section
6889 \begin_inset CommandInset label
6891 name "sec:TextClass"
6895 The layout file format
6898 \begin_layout Standard
6899 When it's finally time to get your hands dirty and create or edit your own
6900 layout file, the following sections describe what you're up against.
6901 Our advice is to go slowly, save and test often, listen to soothing music,
6902 and enjoy one or two of your favorite adult beverages; more if you are
6903 getting particularly stuck.
6904 It's really not that hard, except that the multitude of options can become
6905 overwhelming if you try to do too much in one sitting.
6906 Go have another adult beverage, just for good measure.
6909 \begin_layout Standard
6910 Note that all the tags used in layout files are case-insensitive.
6912 \begin_inset Flex Code
6915 \begin_layout Plain Layout
6922 \begin_inset Flex Code
6925 \begin_layout Plain Layout
6932 \begin_inset Flex Code
6935 \begin_layout Plain Layout
6941 are really the same tag.
6942 The possible values are printed in brackets after the feature's name.
6943 The default value if a feature isn't specified inside a text class-description
6945 \begin_inset Flex Code
6948 \begin_layout Plain Layout
6957 If the argument has a data type like
6958 \begin_inset Quotes eld
6962 \begin_inset Quotes erd
6966 \begin_inset Quotes eld
6970 \begin_inset Quotes erd
6973 , the default is shown like this:
6974 \begin_inset Flex Code
6977 \begin_layout Plain Layout
6988 \begin_layout Subsection
6989 The document class declaration
6992 \begin_layout Standard
6993 Lines in a layout file which begin with
6994 \begin_inset Flex Code
6997 \begin_layout Plain Layout
7004 There is one exception to this rule.
7006 \begin_inset Flex Code
7009 \begin_layout Plain Layout
7015 files should begin with a line like:
7018 \begin_layout LyX-Code
7021 #% Do not delete the line below; configure depends on this
7024 \begin_layout LyX-Code
7029 DeclareLaTeXClass{article}
7032 \begin_layout Standard
7033 The second line is used when you (re)configure LyX.
7034 The layout file is read by the LaTeX script
7035 \begin_inset Flex Code
7038 \begin_layout Plain Layout
7044 , in a special mode where
7045 \begin_inset Flex Code
7048 \begin_layout Plain Layout
7055 The first line is just a LaTeX comment, and the second one contains the
7056 declaration of the text class.
7057 If these lines appear in a file named
7058 \begin_inset Flex Code
7061 \begin_layout Plain Layout
7067 , then they define a text class of name
7068 \begin_inset Flex Code
7071 \begin_layout Plain Layout
7077 (the name of the layout file) which uses the LaTeX document class
7078 \begin_inset Flex Code
7081 \begin_layout Plain Layout
7087 (the default is to use the same name as the layout).
7089 \begin_inset Quotes eld
7093 \begin_inset Quotes erd
7096 that appears above is used as a description of the text class in the
7097 \begin_inset Flex MenuItem
7100 \begin_layout Plain Layout
7101 Document\SpecialChar \menuseparator
7110 \begin_layout Standard
7111 Let's assume that you wrote your own text class that uses the
7112 \begin_inset Flex Code
7115 \begin_layout Plain Layout
7121 document class, but where you changed the appearance of the section headings.
7122 If you put it in a file
7123 \begin_inset Flex Code
7126 \begin_layout Plain Layout
7132 , the header of this file should be:
7135 \begin_layout LyX-Code
7138 #% Do not delete the line below; configure depends on this
7141 \begin_layout LyX-Code
7146 DeclareLaTeXClass[article]{article (with my own headings)}
7149 \begin_layout Standard
7150 This declares a text class
7151 \begin_inset Flex Code
7154 \begin_layout Plain Layout
7160 , associated with the LaTeX document class
7161 \begin_inset Flex Code
7164 \begin_layout Plain Layout
7171 \begin_inset Quotes eld
7174 article (with my own headings)
7175 \begin_inset Quotes erd
7179 If your text class depends on several packages, you can declare it as:
7182 \begin_layout LyX-Code
7185 #% Do not delete the line below; configure depends on this
7188 \begin_layout LyX-Code
7193 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7196 \begin_layout Standard
7197 This indicates that your text class uses the
7198 \begin_inset Flex Code
7201 \begin_layout Plain Layout
7208 Finally, it is also possible to declare classes for DocBook code.
7209 Typical declarations will look like:
7212 \begin_layout LyX-Code
7215 #% Do not delete the line below; configure depends on this
7218 \begin_layout LyX-Code
7223 DeclareDocBookClass[article]{SGML (DocBook article)}
7226 \begin_layout Standard
7227 Note that these declarations can also be given an optional parameter declaring
7228 the name of the document class (but not a list).
7231 \begin_layout Standard
7232 So, to be as explicit as possible, the form of the layout declaration is:
7235 \begin_layout LyX-Code
7240 DeclareLaTeXClass[class,package.sty]{layout description}
7243 \begin_layout Standard
7244 The class need only be specified if the name of the LaTeX class file and
7245 the name of the layout file are different or if there are packages to load.
7246 If the name of the class file is not specified, then LyX will simply assume
7247 that it is the same as the name of the layout file.
7250 \begin_layout Standard
7251 When the text class has been modified to your taste, all you have to do
7252 is to copy it either to
7253 \begin_inset Flex Code
7256 \begin_layout Plain Layout
7263 \begin_inset Flex Code
7266 \begin_layout Plain Layout
7273 \begin_inset Flex MenuItem
7276 \begin_layout Plain Layout
7277 Tools\SpecialChar \menuseparator
7283 , exit LyX and restart.
7284 Then your new text class should be available along with the others.
7287 \begin_layout Standard
7288 Once the layout file is installed, you can edit it and see your changes
7289 without having to reconfigure or to restart LyX.
7294 \begin_layout Plain Layout
7295 In versions of LyX prior to 1.6, this was not true.
7296 As a result, editing layout files was very time consuming, since you had
7297 constantly to restart LyX to see changes.
7302 You can force a reload of the current layout by using the LyX function
7304 \begin_inset Flex MenuItem
7307 \begin_layout Plain Layout
7314 There is no default binding for this function—though, of course, you can
7315 bind it to a key yourself.
7316 But you will normally use this function simply by entering it in the mini-buffe
7321 \begin_layout Standard
7327 \begin_inset Flex MenuItem
7330 \begin_layout Plain Layout
7336 is very much an `advanced feature'.
7341 recommended that you save your work before using this function.
7346 recommended that you not attempt to edit layout information while simultaneousl
7347 y working on a document that you care about.
7348 Use a test document.
7349 Syntax errors and the like in your layout file could cause peculiar behavior.
7350 In particular, such errors could cause LyX to regard the current layout
7351 as invalid and to attempt to switch to some other layout.
7355 \begin_layout Plain Layout
7356 Really bad syntax errors may even caused LyX to exit.
7357 This is because certain sorts of errors may make LyX unable to read
7367 The LyX team strives to keep LyX stable in such situations, but safe is
7372 \begin_layout Plain Layout
7373 While we're giving advice: make regular backups.
7374 And be nice to your mother.
7382 \begin_layout Subsection
7383 The Module declaration
7386 \begin_layout Standard
7387 A module must begin with a line like the following:
7390 \begin_layout LyX-Code
7393 DeclareLyXModule[endnotes.sty]{Endnotes}
7396 \begin_layout Standard
7397 The mandatory argument, in curly brackets, is the name of the module, as
7399 \begin_inset Flex MenuItem
7402 \begin_layout Plain Layout
7403 Document\SpecialChar \menuseparator
7410 The argument in square brackets is optional: It declares any LaTeX packages
7411 on which the module depends.
7412 Please note that only packages about which LyX knows should be listed in
7413 the square brackets.
7417 \begin_layout Plain Layout
7418 The list of such packages is documented only in the source code.
7423 LyX will not check for arbitrary packages.
7424 It is also possible to use the form
7425 \begin_inset Flex MenuItem
7428 \begin_layout Plain Layout
7434 as an optional argument, which declares that the module can only be used
7435 when there exists a conversion chain between the formats `
7436 \begin_inset Flex Code
7439 \begin_layout Plain Layout
7446 \begin_inset Flex Code
7449 \begin_layout Plain Layout
7458 \begin_layout Standard
7459 The module declaration should then be followed by lines like the following:
7462 \begin_layout LyX-Code
7466 \begin_layout LyX-Code
7467 #Adds an endnote command, in addition to footnotes.
7471 \begin_layout LyX-Code
7472 #You will need to add
7474 theendnotes in TeX code where you
7477 \begin_layout LyX-Code
7478 #want the endnotes to appear.
7482 \begin_layout LyX-Code
7486 \begin_layout LyX-Code
7487 #Requires: somemodule | othermodule
7490 \begin_layout LyX-Code
7491 #Excludes: badmodule
7494 \begin_layout Standard
7495 The description is used in
7496 \begin_inset Flex MenuItem
7499 \begin_layout Plain Layout
7500 Document\SpecialChar \menuseparator
7506 to provide the user with information about what the module does.
7508 \begin_inset Flex Code
7511 \begin_layout Plain Layout
7517 line is used to identify other modules with which this one must be used;
7519 \begin_inset Flex Code
7522 \begin_layout Plain Layout
7528 line is used to identify modules with which this one may not be used.
7529 Both are optional, and, as shown, multiple modules should be separated
7530 with the pipe symbol: |.
7531 Note that the required modules are treated disjunctively:
7535 of the required modules must be used.
7540 excluded module may be used.
7541 Note that modules are identified here by their
7546 \begin_inset Flex Code
7549 \begin_layout Plain Layout
7557 \begin_inset Flex Code
7560 \begin_layout Plain Layout
7567 \begin_inset Flex Code
7570 \begin_layout Plain Layout
7579 \begin_layout Subsection
7583 \begin_layout Standard
7584 The first non-comment line of any layout file, included file, or module
7589 contain the file format number:
7592 \begin_layout Description
7593 \begin_inset Flex Code
7596 \begin_layout Plain Layout
7603 \begin_inset Flex Code
7606 \begin_layout Plain Layout
7612 ] The format of the layout file.
7615 \begin_layout Standard
7616 This tag was introduced with LyX 1.4.0.
7617 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7618 and are considered to be of format 1.
7619 The format for the present version of LyX is format 21.
7620 But each version of LyX is capable of reading earlier versions' layout
7621 files, just as they are capable of reading files produced by earlier versions
7623 There is, however, no provision for converting to earlier formats.
7624 So LyX 1.6.x will not read layout files in format 21 but only files in format
7628 \begin_layout Subsection
7629 \begin_inset CommandInset label
7631 name "sub:General-text-class"
7635 General text class parameters
7638 \begin_layout Standard
7639 These are general parameters that govern the behavior of an entire document
7645 mean that they must appear in
7646 \begin_inset Flex Code
7649 \begin_layout Plain Layout
7655 files rather than in modules.
7656 A module can contain any layout tag.)
7659 \begin_layout Description
7660 \begin_inset Flex Code
7663 \begin_layout Plain Layout
7669 Adds information that will be output in the
7670 \begin_inset Flex Code
7673 \begin_layout Plain Layout
7679 block when this document class is output to XHTML.
7680 Typically, this would be used to output CSS style information, but it can
7681 be used for anything that can appear in
7682 \begin_inset Flex Code
7685 \begin_layout Plain Layout
7693 \begin_inset Quotes eld
7697 \begin_inset Flex Code
7700 \begin_layout Plain Layout
7707 \begin_inset Quotes erd
7713 \begin_layout Description
7714 \begin_inset Flex Code
7717 \begin_layout Plain Layout
7723 Adds information to the document preamble.
7725 \begin_inset Quotes eld
7729 \begin_inset Flex Code
7732 \begin_layout Plain Layout
7739 \begin_inset Quotes erd
7745 \begin_layout Description
7746 \begin_inset Flex Code
7749 \begin_layout Plain Layout
7755 Defines formats for use in the display of bibliographic information.
7757 \begin_inset CommandInset ref
7759 reference "sub:Citation-format-description"
7765 \begin_inset Quotes eld
7769 \begin_inset Flex Code
7772 \begin_layout Plain Layout
7779 \begin_inset Quotes erd
7785 \begin_layout Description
7786 \begin_inset Flex Code
7789 \begin_layout Plain Layout
7795 Describes various global options supported by the document class.
7797 \begin_inset space ~
7801 \begin_inset CommandInset ref
7803 reference "sub:ClassOptions"
7809 \begin_inset Quotes eld
7813 \begin_inset Flex Code
7816 \begin_layout Plain Layout
7823 \begin_inset Quotes erd
7829 \begin_layout Description
7830 \begin_inset Flex Code
7833 \begin_layout Plain Layout
7840 \begin_inset Flex Code
7843 \begin_layout Plain Layout
7852 \begin_inset Flex Code
7855 \begin_layout Plain Layout
7861 ] Whether the class should
7865 to having one or two columns.
7866 Can be changed in the
7867 \begin_inset Flex MenuItem
7870 \begin_layout Plain Layout
7871 Document\SpecialChar \menuseparator
7880 \begin_layout Description
7881 \begin_inset Flex Code
7884 \begin_layout Plain Layout
7891 \begin_inset Flex Code
7894 \begin_layout Plain Layout
7900 ] This sequence defines the properties for a counter.
7901 If the counter does not yet exist, it is created; if it does exist, it
7904 \begin_inset Quotes eld
7908 \begin_inset Flex Code
7911 \begin_layout Plain Layout
7918 \begin_inset Quotes erd
7922 \begin_inset Newline newline
7926 \begin_inset space ~
7930 \begin_inset CommandInset ref
7932 reference "sub:Counters"
7936 for details on counters.
7939 \begin_layout Description
7940 \begin_inset Flex Code
7943 \begin_layout Plain Layout
7949 Sets the default font used to display the document.
7951 \begin_inset space ~
7955 \begin_inset CommandInset ref
7957 reference "sub:Font-description"
7961 for how to declare fonts.
7963 \begin_inset Quotes eld
7967 \begin_inset Flex Code
7970 \begin_layout Plain Layout
7977 \begin_inset Quotes erd
7983 \begin_layout Description
7984 \begin_inset Flex Code
7987 \begin_layout Plain Layout
7994 \begin_inset Flex Code
7997 \begin_layout Plain Layout
8003 Specifies a module to be included by default with this document class.
8004 The module should be specified by filename without the
8005 \begin_inset Flex Code
8008 \begin_layout Plain Layout
8015 The user can still remove the module, but it will be active at the outset.
8016 (This applies only when new files are created, or when this class is chosen
8017 for an existing document.)
8020 \begin_layout Description
8021 \begin_inset Flex Code
8024 \begin_layout Plain Layout
8031 \begin_inset Flex Code
8034 \begin_layout Plain Layout
8040 ] This is the style that will be assigned to new paragraphs, usually
8041 \begin_inset Flex MenuItem
8044 \begin_layout Plain Layout
8051 This will default to the first defined style if not given, but you are
8052 encouraged to use this directive.
8055 \begin_layout Description
8056 \begin_inset Flex Code
8059 \begin_layout Plain Layout
8066 \begin_inset Flex Code
8069 \begin_layout Plain Layout
8075 ] This tag indicates that the module in question—which should be specified
8076 by filename without the
8077 \begin_inset Flex Code
8080 \begin_layout Plain Layout
8086 extension—cannot be used with this document class.
8087 This might be used in a journal-specific layout file to prevent, say, the
8089 \begin_inset Flex Code
8092 \begin_layout Plain Layout
8098 module that numbers theorems by section.
8103 be used in a module.
8104 Modules have their own way of excluding other modules (see
8105 \begin_inset CommandInset ref
8107 reference "sub:Layout-modules"
8114 \begin_layout Description
8115 \begin_inset Flex Code
8118 \begin_layout Plain Layout
8124 Defines a new float.
8126 \begin_inset space ~
8130 \begin_inset CommandInset ref
8132 reference "sub:Floats"
8138 \begin_inset Quotes eld
8142 \begin_inset Flex Code
8145 \begin_layout Plain Layout
8152 \begin_inset Quotes erd
8158 \begin_layout Description
8159 \begin_inset Flex Code
8162 \begin_layout Plain Layout
8168 Sets the information that will be output in the
8169 \begin_inset Flex Code
8172 \begin_layout Plain Layout
8178 block when this document class is output to XHTML.
8179 Note that this will completely override any prior
8180 \begin_inset Flex Code
8183 \begin_layout Plain Layout
8190 \begin_inset Flex Code
8193 \begin_layout Plain Layout
8201 \begin_inset Flex Code
8204 \begin_layout Plain Layout
8210 if you just want to add material to the preamble.) Must end with
8211 \begin_inset Quotes eld
8215 \begin_inset Flex Code
8218 \begin_layout Plain Layout
8225 \begin_inset Quotes erd
8231 \begin_layout Description
8232 \begin_inset Flex Code
8235 \begin_layout Plain Layout
8242 \begin_inset Flex Code
8245 \begin_layout Plain Layout
8251 ] The layout to use for the table of contents, bibliography, and so forth,
8252 when the document is output to HTML.
8253 For articles, this should normally be Section; for books, Chapter.
8254 If it is not given, then LyX will attempt to figure out which layout to
8258 \begin_layout Description
8259 \begin_inset Flex Code
8262 \begin_layout Plain Layout
8269 \begin_inset Flex Code
8272 \begin_layout Plain Layout
8278 ] Modifies the properties of the given counter.
8279 If the counter does not exist, the section is ignored.
8281 \begin_inset Quotes eld
8285 \begin_inset Flex Code
8288 \begin_layout Plain Layout
8295 \begin_inset Quotes erd
8299 \begin_inset Newline newline
8303 \begin_inset space ~
8307 \begin_inset CommandInset ref
8309 reference "sub:Counters"
8313 for details on counters.
8316 \begin_layout Description
8317 \begin_inset Flex Code
8320 \begin_layout Plain Layout
8327 \begin_inset Flex Code
8330 \begin_layout Plain Layout
8336 ] Modifies the properties of the given paragraph style.
8337 If the style does not exist, the section is ignored.
8339 \begin_inset Quotes eld
8343 \begin_inset Flex Code
8346 \begin_layout Plain Layout
8353 \begin_inset Quotes erd
8359 \begin_layout Description
8360 \begin_inset Flex Code
8363 \begin_layout Plain Layout
8369 As its name implies, this command allows you to include another layout
8370 definition file within yours to avoid duplicating commands.
8371 Common examples are the standard layout files, for example,
8372 \begin_inset Flex Code
8375 \begin_layout Plain Layout
8381 , which contains most of the basic layouts.
8384 \begin_layout Description
8385 \begin_inset Flex Code
8388 \begin_layout Plain Layout
8394 This section (re-)defines the layout of an inset.
8395 It can be applied to an existing inset or to a new, user-defined inset,
8396 e.g., a new character style.
8398 \begin_inset Quotes eld
8402 \begin_inset Flex Code
8405 \begin_layout Plain Layout
8412 \begin_inset Quotes erd
8416 \begin_inset Newline newline
8420 \begin_inset space ~
8424 \begin_inset CommandInset ref
8426 reference "sub:Flex-insets-and"
8430 for more information.
8434 \begin_layout Description
8435 \begin_inset Flex Code
8438 \begin_layout Plain Layout
8445 \begin_inset Flex Code
8448 \begin_layout Plain Layout
8454 ] A string that indicates the width of the left margin on the screen, for
8456 \begin_inset Quotes eld
8460 \begin_inset Quotes erd
8464 (Note that this is not a `length', like
8465 \begin_inset Quotes eld
8469 \begin_inset Quotes erd
8475 \begin_layout Description
8476 \begin_inset Flex Code
8479 \begin_layout Plain Layout
8486 \begin_inset Flex Code
8489 \begin_layout Plain Layout
8495 ] This command deletes an existing counter, usually one defined in an included
8499 \begin_layout Description
8500 \begin_inset Flex Code
8503 \begin_layout Plain Layout
8509 This command deletes an existing float.
8510 This is particularly useful when you want to suppress a float that has
8511 been defined in an input file.
8514 \begin_layout Description
8515 \begin_inset Flex Code
8518 \begin_layout Plain Layout
8524 This command deletes an existing style.
8525 This is particularly useful when you want to suppress a style that has
8526 be defined in an input file.
8529 \begin_layout Description
8530 \begin_inset Flex Code
8533 \begin_layout Plain Layout
8539 A string indicating the file format (as defined in the Preferences dialog)
8540 produced by this class.
8541 It is mainly useful when
8542 \begin_inset Flex Code
8545 \begin_layout Plain Layout
8551 is `literate' and one wants to define a new type of literate document.
8552 This string is reset to `docbook', `latex', or `literate' when the correspondin
8554 \begin_inset Flex Code
8557 \begin_layout Plain Layout
8563 parameter is encountered.
8566 \begin_layout Description
8567 \begin_inset Flex Code
8570 \begin_layout Plain Layout
8576 A string indicating what sort of output documents using this class will
8578 At present, the options are: `docbook', `latex', and `literate'.
8581 \begin_layout Description
8582 \begin_inset Flex Code
8585 \begin_layout Plain Layout
8592 \begin_inset Flex Code
8595 \begin_layout Plain Layout
8604 \begin_inset Flex Code
8607 \begin_layout Plain Layout
8614 \begin_inset Flex Code
8617 \begin_layout Plain Layout
8623 ] The default pagestyle.
8624 Can be changed in the
8625 \begin_inset Flex MenuItem
8628 \begin_layout Plain Layout
8629 Document\SpecialChar \menuseparator
8638 \begin_layout Description
8639 \begin_inset Flex Code
8642 \begin_layout Plain Layout
8648 Sets the preamble for the LaTeX document.
8649 Note that this will completely override any prior
8650 \begin_inset Flex Code
8653 \begin_layout Plain Layout
8660 \begin_inset Flex Code
8663 \begin_layout Plain Layout
8671 \begin_inset Flex Code
8674 \begin_layout Plain Layout
8680 if you just want to add material to the preamble.) Must end with
8681 \begin_inset Quotes eld
8685 \begin_inset Flex Code
8688 \begin_layout Plain Layout
8695 \begin_inset Quotes erd
8701 \begin_layout Description
8702 \begin_inset Flex Code
8705 \begin_layout Plain Layout
8712 \begin_inset Flex Code
8715 \begin_layout Plain Layout
8722 \begin_inset Flex Code
8725 \begin_layout Plain Layout
8734 \begin_inset Flex Code
8737 \begin_layout Plain Layout
8743 ] Whether the class already provides the feature
8744 \begin_inset Flex Code
8747 \begin_layout Plain Layout
8754 A feature is in general the name of a package (
8755 \begin_inset Flex Code
8758 \begin_layout Plain Layout
8765 \begin_inset Flex Code
8768 \begin_layout Plain Layout
8774 , \SpecialChar \ldots{}
8776 \begin_inset Flex Code
8779 \begin_layout Plain Layout
8786 \begin_inset Flex Code
8789 \begin_layout Plain Layout
8795 ,\SpecialChar \ldots{}
8796 ); the complete list of supported features is unfortunately not documented
8797 outside the LyX source code—but see
8798 \begin_inset Flex Code
8801 \begin_layout Plain Layout
8807 if you're interested.
8809 \begin_inset Flex MenuItem
8812 \begin_layout Plain Layout
8813 Help\SpecialChar \menuseparator
8819 also gives an overview of the supported packages.
8822 \begin_layout Description
8823 \begin_inset Flex Code
8826 \begin_layout Plain Layout
8833 \begin_inset Flex Code
8836 \begin_layout Plain Layout
8842 ] Indicates that this layout provides the functionality of the module mentioned,
8843 which should be specified by the filename without the
8844 \begin_inset Flex Code
8847 \begin_layout Plain Layout
8854 This will typically be used if the layout includes the module directly,
8855 rather than using the
8856 \begin_inset Flex Code
8859 \begin_layout Plain Layout
8865 tag to indicate that it ought to be used.
8866 It could also be used in a module that provided an alternate implementation
8867 of the same functionality.
8870 \begin_layout Description
8871 \begin_inset Flex Code
8874 \begin_layout Plain Layout
8881 \begin_inset Flex Code
8884 \begin_layout Plain Layout
8890 ] Whether the class requires the feature
8891 \begin_inset Flex Code
8894 \begin_layout Plain Layout
8901 Multiple features must be separated by commas.
8902 Note that you can only request supported features.
8904 \begin_inset Flex Code
8907 \begin_layout Plain Layout
8913 for a list of these.)
8916 \begin_layout Description
8917 \begin_inset Flex Code
8920 \begin_layout Plain Layout
8926 A string that indicates the width of the right margin on the screen, for
8928 \begin_inset Quotes eld
8932 \begin_inset Quotes erd
8938 \begin_layout Description
8939 \begin_inset Flex Code
8942 \begin_layout Plain Layout
8948 Sets which divisions get numbered.
8950 \begin_inset Flex Code
8953 \begin_layout Plain Layout
8962 \begin_layout Description
8963 \begin_inset Flex Code
8966 \begin_layout Plain Layout
8973 \begin_inset Flex Code
8976 \begin_layout Plain Layout
8985 \begin_inset Flex Code
8988 \begin_layout Plain Layout
8994 ] Whether the class-default should be printing on one or both sides of the
8996 Can be changed in the
8997 \begin_inset Flex MenuItem
9000 \begin_layout Plain Layout
9001 Document\SpecialChar \menuseparator
9010 \begin_layout Description
9011 \begin_inset Flex Code
9014 \begin_layout Plain Layout
9020 This sequence defines a paragraph style.
9021 If the style does not yet exist, it is created; if it does exist, its parameter
9024 \begin_inset Quotes eld
9028 \begin_inset Flex Code
9031 \begin_layout Plain Layout
9038 \begin_inset Quotes erd
9042 \begin_inset Newline newline
9046 \begin_inset space ~
9050 \begin_inset CommandInset ref
9052 reference "sub:Paragraph-Styles"
9056 for details on paragraph styles.
9059 \begin_layout Description
9060 \begin_inset Flex Code
9063 \begin_layout Plain Layout
9070 \begin_inset Flex Code
9073 \begin_layout Plain Layout
9079 ] The name of the command or environment to be used with
9080 \begin_inset Flex Code
9083 \begin_layout Plain Layout
9092 \begin_layout Description
9093 \begin_inset Flex Code
9096 \begin_layout Plain Layout
9103 \begin_inset Flex Code
9106 \begin_layout Plain Layout
9115 \begin_inset Flex Code
9118 \begin_layout Plain Layout
9124 ] Indicates what kind of markup is used to define the title of a document.
9126 \begin_inset Flex Code
9129 \begin_layout Plain Layout
9135 means that the macro with name
9136 \begin_inset Flex Code
9139 \begin_layout Plain Layout
9145 will be inserted after the last layout which has
9146 \begin_inset Quotes eld
9150 \begin_inset Flex Code
9153 \begin_layout Plain Layout
9160 \begin_inset Quotes erd
9165 \begin_inset Flex Code
9168 \begin_layout Plain Layout
9174 corresponds to the case where the block of paragraphs which have
9175 \begin_inset Quotes eld
9179 \begin_inset Flex Code
9182 \begin_layout Plain Layout
9189 \begin_inset Quotes erd
9192 should be enclosed into the
9193 \begin_inset Flex Code
9196 \begin_layout Plain Layout
9205 \begin_layout Description
9206 \begin_inset Flex Code
9209 \begin_layout Plain Layout
9215 Sets which divisions are included in the table of contents.
9217 \begin_inset Flex Code
9220 \begin_layout Plain Layout
9229 \begin_layout Subsection
9230 \begin_inset Flex Code
9233 \begin_layout Plain Layout
9240 \begin_inset CommandInset label
9242 name "sub:ClassOptions"
9249 \begin_layout Standard
9251 \begin_inset Flex Code
9254 \begin_layout Plain Layout
9260 section can contain the following entries:
9263 \begin_layout Description
9264 \begin_inset Flex Code
9267 \begin_layout Plain Layout
9274 \begin_inset Flex Code
9277 \begin_layout Plain Layout
9283 ] The list of available font sizes for the document's main font, separated
9285 \begin_inset Quotes eld
9289 \begin_inset Flex Code
9292 \begin_layout Plain Layout
9299 \begin_inset Quotes erd
9305 \begin_layout Description
9306 \begin_inset Flex Code
9309 \begin_layout Plain Layout
9315 Used to set the DTD line with XML-based output classes.
9317 \begin_inset space \thinspace{}
9321 \begin_inset Quotes eld
9324 -//OASIS//DTD DocBook V4.2//EN
9325 \begin_inset Quotes erd
9331 \begin_layout Description
9332 \begin_inset Flex Code
9335 \begin_layout Plain Layout
9342 \begin_inset Flex Code
9345 \begin_layout Plain Layout
9346 string="empty|plain|headings|fancy"
9351 ] The list of available page styles, separated by
9352 \begin_inset Quotes eld
9356 \begin_inset Flex Code
9359 \begin_layout Plain Layout
9366 \begin_inset Quotes erd
9372 \begin_layout Description
9373 \begin_inset Flex Code
9376 \begin_layout Plain Layout
9383 \begin_inset Flex Code
9386 \begin_layout Plain Layout
9392 ] Some document class options, separated by a comma, that will be added
9393 to the optional part of the
9394 \begin_inset Flex Code
9397 \begin_layout Plain Layout
9408 \begin_layout Standard
9410 \begin_inset Flex Code
9413 \begin_layout Plain Layout
9419 section must end with
9420 \begin_inset Quotes eld
9424 \begin_inset Flex Code
9427 \begin_layout Plain Layout
9434 \begin_inset Quotes erd
9440 \begin_layout Subsection
9442 \begin_inset CommandInset label
9444 name "sub:Paragraph-Styles"
9451 \begin_layout Standard
9452 A paragraph style description looks like this:
9456 \begin_layout Plain Layout
9457 Note that this will either define a new layout or modify an existing one.
9465 \begin_layout LyX-Code
9472 \begin_layout LyX-Code
9476 \begin_layout LyX-Code
9480 \begin_layout Standard
9481 where the following commands are allowed:
9484 \begin_layout Description
9485 \begin_inset Flex Code
9488 \begin_layout Plain Layout
9495 \begin_inset Flex Code
9498 \begin_layout Plain Layout
9503 , left, right, center
9508 ] Paragraph alignment.
9511 \begin_layout Description
9512 \begin_inset Flex Code
9515 \begin_layout Plain Layout
9522 \begin_inset Flex Code
9525 \begin_layout Plain Layout
9530 , left, right, center
9535 ] A comma separated list of permitted alignments.
9536 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9538 For example a right-aligned or centered enumeration isn't possible.)
9541 \begin_layout Description
9542 \begin_inset Flex Code
9545 \begin_layout Plain Layout
9551 Note that this will completely override any prior
9552 \begin_inset Flex Code
9555 \begin_layout Plain Layout
9561 declaration for this style.
9563 \begin_inset Quotes eld
9567 \begin_inset Flex Code
9570 \begin_layout Plain Layout
9577 \begin_inset Quotes erd
9582 \begin_inset CommandInset ref
9584 reference "sub:I18n"
9588 for details on its use.
9591 \begin_layout Description
9592 \begin_inset Flex Code
9595 \begin_layout Plain Layout
9602 \begin_inset Flex Code
9605 \begin_layout Plain Layout
9615 \begin_layout Plain Layout
9616 Note that a `float' here is a real number, such as: 1.5.
9621 The vertical space with which the last of a chain of paragraphs with this
9622 layout is separated from the following paragraph.
9623 If the next paragraph has another layout, the separations are not simply
9624 added, but the maximum is taken.
9627 \begin_layout Description
9628 \begin_inset Flex Code
9631 \begin_layout Plain Layout
9638 \begin_inset Flex Code
9641 \begin_layout Plain Layout
9647 The category for this style.
9648 This is used to group related styles in the Layout combobox on the toolbar.
9649 Any string can be used, but you may want to use existing categories with
9654 \begin_layout Description
9655 \begin_inset Flex Code
9658 \begin_layout Plain Layout
9664 Depth of XML command.
9665 Used only with XML-type formats.
9668 \begin_layout Description
9669 \begin_inset Flex Code
9672 \begin_layout Plain Layout
9679 \begin_inset CommandInset label
9681 name "des:CopyStyle"
9686 \begin_inset Flex Code
9689 \begin_layout Plain Layout
9695 Copies all the features of an existing style into the current one.
9699 \begin_layout Description
9700 \begin_inset Flex Code
9703 \begin_layout Plain Layout
9709 The name of a style whose preamble should be output
9714 This allows to ensure some ordering of the preamble snippets when macros
9715 definitions depend on one another.
9719 \begin_layout Plain Layout
9720 Note that, besides that functionality, there is no way to ensure any ordering
9722 The ordering that you see in a given version of LyX may change without
9723 warning in later versions.
9731 \begin_layout Description
9732 \begin_inset Flex Code
9735 \begin_layout Plain Layout
9742 \begin_inset Flex Code
9745 \begin_layout Plain Layout
9750 , Box, Filled_Box, Static
9755 ] The type of label that stands at the end of the paragraph (or sequence
9757 \begin_inset Flex Code
9760 \begin_layout Plain Layout
9767 \begin_inset Flex Code
9770 \begin_layout Plain Layout
9777 \begin_inset Flex Code
9780 \begin_layout Plain Layout
9787 \begin_inset Flex Code
9790 \begin_layout Plain Layout
9798 \begin_inset Flex Code
9801 \begin_layout Plain Layout
9808 \begin_inset Quotes eld
9812 \begin_inset Quotes erd
9816 \begin_inset Flex Code
9819 \begin_layout Plain Layout
9826 \begin_inset Flex Code
9829 \begin_layout Plain Layout
9830 \begin_inset space ~
9839 \begin_inset space ~
9842 black) square suitable for end of proof markers,
9843 \begin_inset Flex Code
9846 \begin_layout Plain Layout
9852 is an explicit text string.
9855 \begin_layout Description
9856 \begin_inset Flex Code
9859 \begin_layout Plain Layout
9866 \begin_inset Flex Code
9869 \begin_layout Plain Layout
9875 ] The string used for a label with a
9876 \begin_inset Flex Code
9879 \begin_layout Plain Layout
9886 \begin_inset Flex Code
9889 \begin_layout Plain Layout
9899 \begin_layout Description
9900 \begin_inset Flex Code
9903 \begin_layout Plain Layout
9910 \begin_inset Flex Code
9913 \begin_layout Plain Layout
9924 \begin_inset Flex Code
9927 \begin_layout Plain Layout
9936 \begin_layout Description
9937 \begin_inset Flex Code
9940 \begin_layout Plain Layout
9947 \begin_inset Flex Code
9950 \begin_layout Plain Layout
9960 ] With this parameter the
9961 \begin_inset Flex MenuItem
9964 \begin_layout Plain Layout
9971 \begin_inset Quotes eld
9974 Vertical space above
9975 \begin_inset Quotes erd
9979 \begin_inset Flex MenuItem
9982 \begin_layout Plain Layout
9983 Edit\SpecialChar \menuseparator
9985 \begin_inset space ~
9993 dialog can be set when initializing a paragraph with this style.
9997 \begin_layout Plain Layout
10000 Note from Jean-Marc:
10002 I'm not sure that this setting has much use, and it should probably be
10003 removed in later versions.
10011 \begin_layout Description
10012 \begin_inset Flex Code
10015 \begin_layout Plain Layout
10021 The font used for both the text body
10027 \begin_inset space ~
10031 \begin_inset CommandInset ref
10033 reference "sub:Font-description"
10038 Note that defining this font automatically defines the
10039 \begin_inset Flex Code
10042 \begin_layout Plain Layout
10049 So you should define this one first if you also want to define
10050 \begin_inset Flex Code
10053 \begin_layout Plain Layout
10062 \begin_layout Description
10063 \begin_inset Flex Code
10066 \begin_layout Plain Layout
10073 \begin_inset CommandInset label
10075 name "des:FreeSpacing"
10080 \begin_inset Flex Code
10083 \begin_layout Plain Layout
10092 \begin_inset Flex Code
10095 \begin_layout Plain Layout
10101 ] Usually LyX doesn't allow you to insert more than one space between words,
10102 since a space is considered as the separation between two words, not a
10103 character or symbol of its own.
10104 This is a very fine thing but sometimes annoying, for example, when typing
10105 program code or plain LaTeX code.
10107 \begin_inset Flex Code
10110 \begin_layout Plain Layout
10117 Note that LyX will create protected blanks for the additional blanks when
10118 in another mode than LaTeX-mode.
10121 \begin_layout Description
10122 \begin_inset Flex Code
10125 \begin_layout Plain Layout
10131 These tags are used with XHTML output.
10133 \begin_inset CommandInset ref
10135 reference "sub:Paragraph-Style-XHTML"
10142 \begin_layout Description
10143 \begin_inset Flex Code
10146 \begin_layout Plain Layout
10152 [[FIXME]] (Used only with XML-type formats.)
10155 \begin_layout Description
10156 \begin_inset Flex Code
10159 \begin_layout Plain Layout
10166 \begin_inset Flex Code
10169 \begin_layout Plain Layout
10175 If 1, marks the layout as to be included in the document preamble rather
10176 than in the document body.
10177 This is useful for document classes that want such information as the title
10178 and author to appear in the preamble.
10179 Note that this works only for layouts for which the
10180 \begin_inset Flex Code
10183 \begin_layout Plain Layout
10190 \begin_inset Flex Code
10193 \begin_layout Plain Layout
10200 \begin_inset Flex Code
10203 \begin_layout Plain Layout
10212 \begin_layout Description
10213 \begin_inset Flex Code
10216 \begin_layout Plain Layout
10223 \begin_inset Flex Code
10226 \begin_layout Plain Layout
10232 If 1, marks the layout as being part of a title block (see also the
10233 \begin_inset Flex Code
10236 \begin_layout Plain Layout
10243 \begin_inset Flex Code
10246 \begin_layout Plain Layout
10255 \begin_layout Description
10256 \begin_inset Flex Code
10259 \begin_layout Plain Layout
10266 \begin_inset Flex Code
10269 \begin_layout Plain Layout
10275 ] This provides extra space between paragraphs that have the same layout.
10276 If you put other layouts into an environment, each is separated with the
10278 \begin_inset Flex Code
10281 \begin_layout Plain Layout
10288 But the whole items of the environment are additionally separated with
10290 \begin_inset Flex Code
10293 \begin_layout Plain Layout
10300 Note that this is a
10305 \begin_layout Description
10306 \begin_inset Flex Code
10309 \begin_layout Plain Layout
10315 [[FIXME]] (Used only with XML-type formats.)
10318 \begin_layout Description
10319 \begin_inset Flex Code
10322 \begin_layout Plain Layout
10329 \begin_inset CommandInset label
10331 name "des:KeepEmpty"
10336 \begin_inset Flex Code
10339 \begin_layout Plain Layout
10348 \begin_inset Flex Code
10351 \begin_layout Plain Layout
10357 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10358 lead to empty LaTeX output.
10359 There are some cases where this could be desirable however: in a letter
10360 template, the required fields can be provided as empty fields, so that
10361 people do not forget them; in some special classes, a layout can be used
10362 as some kind of break, which does not contain actual text.
10365 \begin_layout Description
10366 \begin_inset Flex Code
10369 \begin_layout Plain Layout
10375 [float=0] The vertical space between the label and the text body.
10376 Only used for labels that are above the text body (
10377 \begin_inset Flex Code
10380 \begin_layout Plain Layout
10387 \begin_inset Flex Code
10390 \begin_layout Plain Layout
10391 Centered_Top_Environment
10399 \begin_layout Description
10400 \begin_inset Flex Code
10403 \begin_layout Plain Layout
10410 \begin_inset Flex Code
10413 \begin_layout Plain Layout
10420 \begin_inset Newline newline
10423 The name of the counter for automatic numbering.
10425 \begin_inset Newline newline
10433 \begin_inset Flex Code
10436 \begin_layout Plain Layout
10443 \begin_inset Flex Code
10446 \begin_layout Plain Layout
10453 In that case, the counter will be stepped each time the layout appears.
10455 \begin_inset Newline newline
10463 \begin_inset Flex Code
10466 \begin_layout Plain Layout
10473 \begin_inset Flex Code
10476 \begin_layout Plain Layout
10482 , though this case is a bit complicated.
10483 Suppose you declare
10484 \begin_inset Quotes eld
10488 \begin_inset Flex Code
10491 \begin_layout Plain Layout
10492 LabelCounter myenum
10498 \begin_inset Quotes erd
10502 Then the actual counters used are
10503 \begin_inset Flex Code
10506 \begin_layout Plain Layout
10513 \begin_inset Flex Code
10516 \begin_layout Plain Layout
10523 \begin_inset Flex Code
10526 \begin_layout Plain Layout
10533 \begin_inset Flex Code
10536 \begin_layout Plain Layout
10542 , much as in LaTeX.
10543 These counters must all be declared separately.
10544 \begin_inset Newline newline
10548 \begin_inset CommandInset ref
10550 reference "sub:Counters"
10554 for details on counters.
10557 \begin_layout Description
10558 \begin_inset Flex Code
10561 \begin_layout Plain Layout
10567 The font used for the label.
10569 \begin_inset space ~
10573 \begin_inset CommandInset ref
10575 reference "sub:Font-description"
10582 \begin_layout Description
10583 \begin_inset Flex Code
10586 \begin_layout Plain Layout
10592 Text that indicates how far a label should be indented.
10595 \begin_layout Description
10596 \begin_inset Flex Code
10599 \begin_layout Plain Layout
10606 \begin_inset Flex Code
10609 \begin_layout Plain Layout
10615 ] The horizontal space between the label and the text body.
10616 Only used for labels that are not above the text body.
10619 \begin_layout Description
10620 \begin_inset Flex Code
10623 \begin_layout Plain Layout
10630 \begin_inset Flex Code
10633 \begin_layout Plain Layout
10639 ] The string used for a label with a
10640 \begin_inset Flex Code
10643 \begin_layout Plain Layout
10651 \begin_inset Flex Code
10654 \begin_layout Plain Layout
10660 is set, this string can be contain the special formatting commands described
10662 \begin_inset CommandInset ref
10664 reference "sub:Counters"
10672 \begin_layout Plain Layout
10673 For the sake of backwards compatibility, the string
10674 \begin_inset Flex Code
10677 \begin_layout Plain Layout
10687 will be replaced by the expanded
10688 \begin_inset Flex Code
10691 \begin_layout Plain Layout
10698 \begin_inset Flex Code
10701 \begin_layout Plain Layout
10710 This feature is now obsolete and should be replaced by the mechanisms of
10712 \begin_inset CommandInset ref
10714 reference "sub:Counters"
10726 \begin_layout Description
10727 \begin_inset Flex Code
10730 \begin_layout Plain Layout
10731 LabelStringAppendix
10737 \begin_inset Flex Code
10740 \begin_layout Plain Layout
10746 ] This is used inside the appendix instead of
10747 \begin_inset Flex Code
10750 \begin_layout Plain Layout
10758 \begin_inset Flex Code
10761 \begin_layout Plain Layout
10768 \begin_inset Flex Code
10771 \begin_layout Plain Layout
10772 LabelStringAppendix
10780 \begin_layout Description
10781 \begin_inset Flex Code
10784 \begin_layout Plain Layout
10790 [FIXME] (Used only with XML-type formats.)
10793 \begin_layout Description
10794 \begin_inset Flex Code
10797 \begin_layout Plain Layout
10804 \begin_inset Flex Code
10807 \begin_layout Plain Layout
10812 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10813 Enumerate, Itemize, Bibliography
10822 \begin_layout Itemize
10823 \begin_inset Flex Code
10826 \begin_layout Plain Layout
10832 means the label is the very first word (up to the first real blank).
10833 Use protected spaces (like
10834 \begin_inset space ~
10837 that one) if you want more than one word as the label.
10841 \begin_layout Itemize
10842 \begin_inset Flex Code
10845 \begin_layout Plain Layout
10851 means the label is simply whatever
10852 \begin_inset Flex Code
10855 \begin_layout Plain Layout
10862 Note that this really is `static'.
10865 \begin_layout Itemize
10866 \begin_inset Flex Code
10869 \begin_layout Plain Layout
10876 \begin_inset Flex Code
10879 \begin_layout Plain Layout
10880 Centered_Top_Environment
10885 are special cases of
10886 \begin_inset Flex Code
10889 \begin_layout Plain Layout
10896 The label will be printed above the paragraph, but only at the top of an
10897 environment or the top of a chain of paragraphs with this layout.
10898 This might be used with the
10899 \begin_inset Flex MenuItem
10902 \begin_layout Plain Layout
10908 layout, for example.
10911 \begin_layout Itemize
10912 \begin_inset Flex Code
10915 \begin_layout Plain Layout
10921 is a special case for the caption-labels
10922 \begin_inset Quotes eld
10926 \begin_inset Quotes erd
10930 \begin_inset Quotes eld
10934 \begin_inset Quotes erd
10939 \begin_inset Flex Code
10942 \begin_layout Plain Layout
10948 means the (hardcoded) label string depends on the kind of float: It is
10949 hardcoded to be `FloatType N', where N is the value of the counter associated
10953 \begin_layout Itemize
10955 \begin_inset Flex Code
10958 \begin_layout Plain Layout
10964 label type defines automatically numbered labels.
10966 \begin_inset Flex Code
10969 \begin_layout Plain Layout
10975 will be expanded to resolve any counter references it contains: For example,
10977 \begin_inset Quotes eld
10981 \begin_inset Flex Code
10984 \begin_layout Plain Layout
10995 \begin_inset Quotes erd
11000 \begin_inset CommandInset ref
11002 reference "sub:Counters"
11006 for more information on counters.
11009 \begin_layout Itemize
11010 \begin_inset Flex Code
11013 \begin_layout Plain Layout
11019 produces the usual sort of enumeration labels.
11020 At present, it is hardcoded to use Arabic numerals, lowercase letters,
11021 small Roman numerals, and uppercase letters for the four possible depths.
11024 \begin_layout Itemize
11025 \begin_inset Flex Code
11028 \begin_layout Plain Layout
11034 produces various bullets at the different levels.
11035 It is also hardcoded.
11038 \begin_layout Itemize
11039 \begin_inset Flex Code
11042 \begin_layout Plain Layout
11048 is used internally by LyX and should be used only with
11049 \begin_inset Flex Code
11052 \begin_layout Plain Layout
11053 LatexType BibEnvironment
11062 \begin_layout Description
11063 \begin_inset Flex Code
11066 \begin_layout Plain Layout
11072 Note that this will completely override any prior
11073 \begin_inset Flex Code
11076 \begin_layout Plain Layout
11082 declaration for this style.
11084 \begin_inset Quotes eld
11088 \begin_inset Flex Code
11091 \begin_layout Plain Layout
11098 \begin_inset Quotes erd
11103 \begin_inset CommandInset ref
11105 reference "sub:I18n"
11109 for details on its use.
11112 \begin_layout Description
11113 \begin_inset Flex Code
11116 \begin_layout Plain Layout
11122 The name of the corresponding LaTeX stuff.
11123 Either the environment or command name.
11126 \begin_layout Description
11127 \begin_inset Flex Code
11130 \begin_layout Plain Layout
11136 An optional parameter for the corresponding
11137 \begin_inset Flex Code
11140 \begin_layout Plain Layout
11147 This parameter cannot be changed from within LyX.
11150 \begin_layout Description
11151 \begin_inset Flex Code
11154 \begin_layout Plain Layout
11161 \begin_inset CommandInset label
11163 name "des:LatexType"
11168 \begin_inset Flex Code
11171 \begin_layout Plain Layout
11176 , Command, Environment, Item_Environment,
11182 \begin_inset Flex Code
11185 \begin_layout Plain Layout
11186 List_Environment, Bib_Environment
11191 ] How the layout should be translated into LaTeX.
11195 \begin_layout Plain Layout
11196 \begin_inset Flex Code
11199 \begin_layout Plain Layout
11205 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11206 Visit the SGML class files for specific examples.
11215 \begin_layout Itemize
11216 \begin_inset Flex Code
11219 \begin_layout Plain Layout
11225 means nothing special.
11229 \begin_layout Itemize
11230 \begin_inset Flex Code
11233 \begin_layout Plain Layout
11240 \begin_inset Flex Code
11243 \begin_layout Plain Layout
11250 {\SpecialChar \ldots{}
11259 \begin_layout Itemize
11260 \begin_inset Flex Code
11263 \begin_layout Plain Layout
11270 \begin_inset Flex Code
11273 \begin_layout Plain Layout
11280 }\SpecialChar \ldots{}
11296 \begin_layout Itemize
11297 \begin_inset Flex Code
11300 \begin_layout Plain Layout
11307 \begin_inset Flex Code
11310 \begin_layout Plain Layout
11317 \begin_inset Flex Code
11320 \begin_layout Plain Layout
11328 is generated for each paragraph of this environment.
11332 \begin_layout Itemize
11333 \begin_inset Flex Code
11336 \begin_layout Plain Layout
11343 \begin_inset Flex Code
11346 \begin_layout Plain Layout
11353 \begin_inset Flex Code
11356 \begin_layout Plain Layout
11362 is passed as an argument to the environment.
11364 \begin_inset Flex Code
11367 \begin_layout Plain Layout
11373 can be defined in the
11374 \begin_inset Flex MenuItem
11377 \begin_layout Plain Layout
11382 ayout\SpecialChar \menuseparator
11396 \begin_layout Standard
11397 Putting the last few things together, the LaTeX output will be either:
11400 \begin_layout LyX-Code
11403 latexname[latexparam]{\SpecialChar \ldots{}
11407 \begin_layout Standard
11411 \begin_layout LyX-Code
11414 begin{latexname}[latexparam] \SpecialChar \ldots{}
11420 \begin_layout Standard
11421 depending upon the LaTeX type.
11425 \begin_layout Description
11426 \begin_inset Flex Code
11429 \begin_layout Plain Layout
11436 \begin_inset Flex Code
11439 \begin_layout Plain Layout
11445 ] If you put layouts into environments, the leftmargins are not simply added,
11446 but added with a factor
11447 \begin_inset Formula $\frac{4}{depth+4}$
11451 Note that this parameter is also used when the margin is defined as
11452 \begin_inset Flex Code
11455 \begin_layout Plain Layout
11462 \begin_inset Flex Code
11465 \begin_layout Plain Layout
11472 Then it is added to the manual or dynamic margin.
11474 \begin_inset Newline newline
11477 The argument is passed as a string.
11479 \begin_inset Quotes eld
11483 \begin_inset Flex Code
11486 \begin_layout Plain Layout
11493 \begin_inset Quotes erd
11496 means that the paragraph is indented with the width of
11497 \begin_inset Quotes eld
11501 \begin_inset Flex Code
11504 \begin_layout Plain Layout
11511 \begin_inset Quotes erd
11514 in the normal font.
11515 You can get a negative width by prefixing the string with
11516 \begin_inset Quotes eld
11520 \begin_inset Flex Code
11523 \begin_layout Plain Layout
11530 \begin_inset Quotes erd
11534 This way was chosen so that the look is the same with each used screen
11539 \begin_layout Description
11540 \begin_inset Flex Code
11543 \begin_layout Plain Layout
11550 \begin_inset Flex Code
11553 \begin_layout Plain Layout
11558 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11564 \begin_inset Newline newline
11567 The kind of margin that the layout has on the left side.
11569 \begin_inset Flex Code
11572 \begin_layout Plain Layout
11578 just means a fixed margin.
11580 \begin_inset Flex Code
11583 \begin_layout Plain Layout
11589 means that the left margin depends on the string entered in the
11590 \begin_inset Flex MenuItem
11593 \begin_layout Plain Layout
11594 Edit\SpecialChar \menuseparator
11596 \begin_inset space ~
11605 This is used to typeset nice lists without tabulators.
11607 \begin_inset Flex Code
11610 \begin_layout Plain Layout
11616 means that the margin depends on the size of the label.
11617 This is used for automatic enumerated headlines.
11618 It is obvious that the headline
11619 \begin_inset Quotes eld
11622 5.4.3.2.1 Very long headline
11623 \begin_inset Quotes erd
11626 must have a wider left margin (as wide as
11627 \begin_inset Quotes eld
11631 \begin_inset Quotes erd
11634 plus the space) than
11635 \begin_inset Quotes eld
11638 3.2 Very long headline
11639 \begin_inset Quotes erd
11643 \begin_inset Quotes eld
11647 \begin_inset Quotes erd
11650 are not able to do this.
11652 \begin_inset Flex Code
11655 \begin_layout Plain Layout
11661 is similar, but only the very first row of the paragraph is dynamic, while
11662 the others are static; this is used, for example, for descriptions.
11664 \begin_inset Flex Code
11667 \begin_layout Plain Layout
11673 means the margin is chosen in a way that the longest row of this paragraph
11674 fits to the right margin.
11675 This is used to typeset an address on the right edge of the page.
11678 \begin_layout Description
11679 \begin_inset Flex Code
11682 \begin_layout Plain Layout
11689 \begin_inset Flex Code
11692 \begin_layout Plain Layout
11701 \begin_inset Flex Code
11704 \begin_layout Plain Layout
11710 ] Whether fragile commands in this layout should be
11711 \begin_inset Flex Code
11714 \begin_layout Plain Layout
11727 whether this command should itself be protected.)
11730 \begin_layout Description
11731 \begin_inset Flex Code
11734 \begin_layout Plain Layout
11741 \begin_inset Flex Code
11744 \begin_layout Plain Layout
11751 \begin_inset Flex Code
11754 \begin_layout Plain Layout
11762 ] Whether newlines are translated into LaTeX newlines (
11763 \begin_inset Flex Code
11766 \begin_layout Plain Layout
11777 The translation can be switched off to allow more comfortable LaTeX editing
11781 \begin_layout Description
11782 \begin_inset Flex Code
11785 \begin_layout Plain Layout
11792 \begin_inset Flex Code
11795 \begin_layout Plain Layout
11802 \begin_inset Flex Code
11805 \begin_layout Plain Layout
11813 ] Whether the following Paragraph is allowed to indent its very first row.
11815 \begin_inset Flex Code
11818 \begin_layout Plain Layout
11824 means that it is not allowed to do so;
11825 \begin_inset Flex Code
11828 \begin_layout Plain Layout
11834 means it could do so if it wants to.
11837 \begin_layout Description
11838 \begin_inset Flex Code
11841 \begin_layout Plain Layout
11847 Name of a layout that has replaced this layout.
11848 This is used to rename a layout, while keeping backward compatibility.
11851 \begin_layout Description
11852 \begin_inset Flex Code
11855 \begin_layout Plain Layout
11862 \begin_inset Flex Code
11865 \begin_layout Plain Layout
11871 ] The number of optional arguments that can be used with this layout.
11872 This is useful for things like section headings, and only makes sense with
11874 Note that, on output, the optional arguments will all precede any required
11875 arguments (see below).
11876 So one can have constructs like:
11880 \begin_layout LyX-Code
11883 mycmd[opt1]{req1}{contents of paragraph}
11886 \begin_layout Standard
11887 but one cannot have things like:
11890 \begin_layout LyX-Code
11893 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11896 \begin_layout Standard
11897 at least, not without ERT (with which you can have anything).
11902 \begin_layout Description
11903 \begin_inset Flex Code
11906 \begin_layout Plain Layout
11913 \begin_inset CommandInset label
11915 name "des:ParbreakIsNewline"
11920 \begin_inset Flex Code
11923 \begin_layout Plain Layout
11932 \begin_inset Flex Code
11935 \begin_layout Plain Layout
11941 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
11942 output, but only by a line break; together with
11943 \begin_inset Flex Code
11946 \begin_layout Plain Layout
11952 , this allows to emulate a plain text editor (like the ERT inset).
11955 \begin_layout Description
11956 \begin_inset Flex Code
11959 \begin_layout Plain Layout
11966 \begin_inset Flex Code
11969 \begin_layout Plain Layout
11975 ] The indent of the very first line of a paragraph.
11977 \begin_inset Flex Code
11980 \begin_layout Plain Layout
11986 will be fixed for a certain layout.
11987 The exception is Standard layout, since the indentation of a Standard layout
11988 paragraph can be prohibited with
11989 \begin_inset Flex Code
11992 \begin_layout Plain Layout
11999 Also, Standard layout paragraphs inside environments use the
12000 \begin_inset Flex Code
12003 \begin_layout Plain Layout
12009 of the environment, not their native one.
12010 For example, Standard paragraphs inside an enumeration are not indented.
12013 \begin_layout Description
12014 \begin_inset Flex Code
12017 \begin_layout Plain Layout
12024 \begin_inset Flex Code
12027 \begin_layout Plain Layout
12033 ] The vertical space between two paragraphs of this layout.
12036 \begin_layout Description
12037 \begin_inset Flex Code
12040 \begin_layout Plain Layout
12047 \begin_inset Flex Code
12050 \begin_layout Plain Layout
12056 ] LyX allows the user to choose either
12057 \begin_inset Quotes eld
12061 \begin_inset Quotes erd
12065 \begin_inset Quotes eld
12069 \begin_inset Quotes erd
12072 to typeset a document.
12074 \begin_inset Quotes eld
12078 \begin_inset Quotes erd
12081 is chosen, this value is completely ignored.
12083 \begin_inset Quotes eld
12087 \begin_inset Quotes erd
12090 is chosen, the parindent of a LaTeXtype
12091 \begin_inset Quotes eld
12095 \begin_inset Quotes erd
12098 layout is ignored and all paragraphs are separated by this parskip argument.
12099 The vertical space is calculated with
12100 \begin_inset Flex Code
12103 \begin_layout Plain Layout
12105 \begin_inset space ~
12114 \begin_inset Flex Code
12117 \begin_layout Plain Layout
12123 is the height of a row with the normal font.
12124 This way, the look stays the same with different screen fonts.
12127 \begin_layout Description
12128 \begin_inset Flex Code
12131 \begin_layout Plain Layout
12138 \begin_inset CommandInset label
12140 name "des:PassThru"
12145 \begin_inset Flex Code
12148 \begin_layout Plain Layout
12157 \begin_inset Flex Code
12160 \begin_layout Plain Layout
12166 ] Whether the contents of this paragraph should be output in raw form, meaning
12167 without special translations that LaTeX would require.
12170 \begin_layout Description
12171 \begin_inset Flex Code
12174 \begin_layout Plain Layout
12181 \begin_inset CommandInset label
12183 name "des:Preamble"
12187 Information to be included in the LaTeX preamble when this style is used.
12188 Used to define macros, load packages, etc., required by this particular
12191 \begin_inset Quotes eld
12195 \begin_inset Flex Code
12198 \begin_layout Plain Layout
12205 \begin_inset Quotes erd
12211 \begin_layout Description
12212 \begin_inset Flex Code
12215 \begin_layout Plain Layout
12222 \begin_inset Flex Code
12225 \begin_layout Plain Layout
12231 ] The prefix to use when creating labels referring to paragraphs of this
12233 This allows the use of formatted references.
12236 \begin_layout Description
12237 \begin_inset Flex Code
12240 \begin_layout Plain Layout
12247 \begin_inset Flex Code
12250 \begin_layout Plain Layout
12256 ] The number of required arguments that the LaTeX command or environment
12257 corresponding to this layout expects.
12258 In the case of a command, these are required arguments
12262 that associated with the content of the paragraph itself.
12263 These do not actually have to be provided: LyX will output empty arguments
12265 Note that optional arguments will be output before required arguments.
12266 See the discussion of the
12267 \begin_inset Flex Code
12270 \begin_layout Plain Layout
12276 tag above for more information.
12279 \begin_layout Description
12280 \begin_inset Flex Code
12283 \begin_layout Plain Layout
12290 \begin_inset Flex Code
12293 \begin_layout Plain Layout
12300 \begin_inset CommandInset label
12302 name "des:Requires"
12306 Whether the layout requires the feature
12307 \begin_inset Flex Code
12310 \begin_layout Plain Layout
12317 See the description of
12318 \begin_inset Flex Code
12321 \begin_layout Plain Layout
12328 \begin_inset CommandInset ref
12329 LatexCommand pageref
12330 reference "des:FreeSpacing"
12334 ) for information on `features'.
12338 \begin_layout Description
12339 \begin_inset Flex Code
12342 \begin_layout Plain Layout
12349 \begin_inset Flex Code
12352 \begin_layout Plain Layout
12359 \begin_inset Flex Code
12362 \begin_layout Plain Layout
12371 \begin_layout Description
12372 \begin_inset Flex Code
12375 \begin_layout Plain Layout
12382 \begin_inset Flex Code
12385 \begin_layout Plain Layout
12390 , onehalf, double, other
12399 ] This defines what the default spacing should be in the layout.
12401 \begin_inset Flex Code
12404 \begin_layout Plain Layout
12411 \begin_inset Flex Code
12414 \begin_layout Plain Layout
12421 \begin_inset Flex Code
12424 \begin_layout Plain Layout
12430 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12431 If you specify the argument
12432 \begin_inset Flex Code
12435 \begin_layout Plain Layout
12441 , then you should also provide a numerical argument which will be the actual
12443 Note that, contrary to other parameters,
12444 \begin_inset Flex Code
12447 \begin_layout Plain Layout
12453 implies the generation of specific LaTeX code, using the package
12456 \begin_inset Flex Code
12459 \begin_layout Plain Layout
12468 \begin_layout Description
12469 \begin_inset Flex Code
12472 \begin_layout Plain Layout
12479 \begin_inset Flex Code
12482 \begin_layout Plain Layout
12489 \begin_inset Flex Code
12492 \begin_layout Plain Layout
12500 ] Spellcheck paragraphs of this style.
12504 \begin_layout Description
12505 \begin_inset Flex Code
12508 \begin_layout Plain Layout
12514 The font used for the text body .
12516 \begin_inset CommandInset ref
12518 reference "sub:Font-description"
12525 \begin_layout Description
12526 \begin_inset Flex Code
12529 \begin_layout Plain Layout
12538 \begin_inset Flex Code
12541 \begin_layout Plain Layout
12551 The level of the style in the table of contents.
12552 This is used for automatic numbering of section headings.
12555 \begin_layout Description
12556 \begin_inset Flex Code
12559 \begin_layout Plain Layout
12566 \begin_inset Flex Code
12569 \begin_layout Plain Layout
12575 ] The vertical space with which the very first of a chain of paragraphs
12576 with this layout is separated from the previous paragraph.
12577 If the previous paragraph has another layout, the separations are not simply
12578 added, but the maximum is taken.
12581 \begin_layout Subsection
12582 \begin_inset CommandInset label
12588 Internationalization of Paragraph Styles
12591 \begin_layout Standard
12592 LyX has long supported internationalization of layout information, but,
12593 until version 2.0, this applied only to the user interface and not to, say,
12595 Thus, French authors were forced to resort to ugly hacks if they wanted
12600 1' instead of `Theorem 1'.
12601 Thanks to Georg Baum, that is no longer the case.
12604 \begin_layout Standard
12606 \begin_inset Flex Code
12609 \begin_layout Plain Layout
12615 defines text that is to appear in the typeset document, it may use
12616 \begin_inset Flex Code
12619 \begin_layout Plain Layout
12626 \begin_inset Flex Code
12629 \begin_layout Plain Layout
12635 to support non-English and even multi-language documents correctly.
12636 The following excerpt (from the
12637 \begin_inset Flex Code
12640 \begin_layout Plain Layout
12646 file) shows how this works:
12649 \begin_layout LyX-Code
12654 \begin_layout LyX-Code
12657 theoremstyle{remark}
12660 \begin_layout LyX-Code
12663 newtheorem{claim}[thm]{
12670 \begin_layout LyX-Code
12674 \begin_layout LyX-Code
12678 \begin_layout LyX-Code
12683 claimname}{_(Claim)}
12686 \begin_layout LyX-Code
12690 \begin_layout LyX-Code
12694 \begin_layout LyX-Code
12703 claimname}{_(Claim)}}
12706 \begin_layout LyX-Code
12711 \begin_layout Standard
12712 In principle, any legal LaTeX may appear in the
12713 \begin_inset Flex Code
12716 \begin_layout Plain Layout
12723 \begin_inset Flex Code
12726 \begin_layout Plain Layout
12732 tags, but in practice they will typically look as they do here.
12733 The key to correct translation of the typeset text is the definition of
12735 \begin_inset Flex Code
12738 \begin_layout Plain Layout
12747 \begin_inset Flex Code
12750 \begin_layout Plain Layout
12762 \begin_layout Standard
12764 \begin_inset Flex Code
12767 \begin_layout Plain Layout
12773 tag provides for internationalization based upon the overall language of
12775 The contents of the tag will be included in the preamble, just as with
12777 \begin_inset Flex Code
12780 \begin_layout Plain Layout
12787 What makes it special is the use of the
12788 \begin_inset Quotes eld
12792 \begin_inset Quotes erd
12796 \begin_inset Flex Code
12799 \begin_layout Plain Layout
12805 , which will be replaced, when LyX produces LaTeX output, with the translation
12806 of its argument into the document language.
12809 \begin_layout Standard
12811 \begin_inset Flex Code
12814 \begin_layout Plain Layout
12820 tag is more complex, since it is meant to provide support for multi-language
12821 documents and so offers an interface to the
12822 \begin_inset Flex Code
12825 \begin_layout Plain Layout
12832 Its contents will be added to the preamble once for each language that
12833 appears in the document.
12834 In this case, the argument to
12835 \begin_inset Flex Code
12838 \begin_layout Plain Layout
12844 will be replaced with its translation into the language in question; the
12846 \begin_inset Flex Code
12849 \begin_layout Plain Layout
12855 is replaced by the language name (as used by the babel package).
12858 \begin_layout Standard
12859 A German document that also included a French section would thus have the
12860 following in the preamble:
12863 \begin_layout LyX-Code
12872 claimname}{Affirmation}}
12880 claimname}{Behauptung}}
12884 claimname}{Behauptung}
12887 \begin_layout Standard
12889 \begin_inset Flex Code
12892 \begin_layout Plain Layout
12898 will then conspire to produce the correct text in the output.
12901 \begin_layout Standard
12902 One important point to note here is that the translations are provided by
12903 LyX itself, through the same mechanism it uses for internationalization
12904 of the user interface.
12905 This means, in effect, that
12906 \begin_inset Flex Code
12909 \begin_layout Plain Layout
12916 \begin_inset Flex Code
12919 \begin_layout Plain Layout
12925 are really only of use in layout files that are provided with LyX, since
12926 text entered in user-created layout files will not be seen by LyX's internation
12927 alization routines.
12928 That said, however, any layout created with the intention that it will
12929 be included with LyX should use these tags where appropriate.
12932 \begin_layout Subsection
12934 \begin_inset CommandInset label
12943 \begin_layout Standard
12944 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12945 define the floats (
12946 \begin_inset Flex MenuItem
12949 \begin_layout Plain Layout
12956 \begin_inset Flex MenuItem
12959 \begin_layout Plain Layout
12965 , \SpecialChar \ldots{}
12966 ) in the text class itself.
12967 Standard floats are included in the file
12968 \begin_inset Flex Code
12971 \begin_layout Plain Layout
12977 , so you may have to do no more than add
12980 \begin_layout LyX-Code
12981 Input stdfloats.inc
12984 \begin_layout Standard
12985 to your layout file.
12986 If you want to implement a text class that proposes some other float types
12987 (like the AGU class bundled with LyX), the information below will hopefully
12991 \begin_layout Description
12992 \begin_inset Flex Code
12995 \begin_layout Plain Layout
13002 \begin_inset Flex Code
13005 \begin_layout Plain Layout
13012 \begin_inset Quotes erd
13016 \begin_inset Quotes erd
13019 ] The file name extension of an auxiliary file for the list of figures (or
13021 LaTeX writes the captions to this file.
13024 \begin_layout Description
13025 \begin_inset Flex Code
13028 \begin_layout Plain Layout
13035 \begin_inset Flex Code
13038 \begin_layout Plain Layout
13045 \begin_inset Quotes erd
13049 \begin_inset Quotes erd
13052 ] The string that will be used in the menus and also for the caption.
13053 This is translated to the current language if babel is used.
13056 \begin_layout Description
13057 \begin_inset Flex Code
13060 \begin_layout Plain Layout
13066 These are used for XHTML output.
13068 \begin_inset CommandInset ref
13070 reference "sec:Tags-for-XHTML"
13077 \begin_layout Description
13078 \begin_inset Flex Code
13081 \begin_layout Plain Layout
13088 \begin_inset Flex Code
13091 \begin_layout Plain Layout
13098 \begin_inset Quotes erd
13102 \begin_inset Quotes erd
13105 ] The command used to generate a list of floats of this type; the leading
13108 ' should be omitted.
13114 \begin_inset Flex Code
13117 \begin_layout Plain Layout
13123 is false, since there is no standard way to generate this command.
13125 \begin_inset Flex Code
13128 \begin_layout Plain Layout
13134 is true, since in that case there is a standard way.
13137 \begin_layout Description
13138 \begin_inset Flex Code
13141 \begin_layout Plain Layout
13148 \begin_inset Flex Code
13151 \begin_layout Plain Layout
13158 \begin_inset Quotes erd
13162 \begin_inset Quotes erd
13165 ] A title for a list of floats of this kind (list of figures, tables, or
13167 It is used for the screen label within LyX; it is passed to LaTeX for use
13168 as the title there; and it is used as the title in XHTML output.
13169 It will be translated to the document language.
13172 \begin_layout Description
13173 \begin_inset Flex Code
13176 \begin_layout Plain Layout
13183 \begin_inset Flex Code
13186 \begin_layout Plain Layout
13193 \begin_inset Flex Code
13196 \begin_layout Plain Layout
13204 ] Indicates whether the float is already defined in the document class or
13205 if we instead need to load
13206 \begin_inset Flex Code
13209 \begin_layout Plain Layout
13215 and use what it provides.
13217 \begin_inset Flex Code
13220 \begin_layout Plain Layout
13227 \begin_inset Flex Code
13230 \begin_layout Plain Layout
13237 It should be set to
13238 \begin_inset Flex Code
13241 \begin_layout Plain Layout
13247 if the float is already defined by the LaTeX document class.
13250 \begin_layout Description
13251 \begin_inset Flex Code
13254 \begin_layout Plain Layout
13261 \begin_inset Flex Code
13264 \begin_layout Plain Layout
13271 \begin_inset Quotes erd
13275 \begin_inset Quotes erd
13278 ] This (optional) argument determines whether floats of this class will
13279 be numbered within some sectional unit of the document.
13280 For example, if within is equal to
13281 \begin_inset Flex Code
13284 \begin_layout Plain Layout
13290 , the floats will be numbered within chapters.
13294 \begin_layout Description
13295 \begin_inset Flex Code
13298 \begin_layout Plain Layout
13305 \begin_inset Flex Code
13308 \begin_layout Plain Layout
13315 \begin_inset Quotes erd
13319 \begin_inset Quotes erd
13322 ] The default placement for the given class of floats.
13323 The string should be as in standard LaTeX:
13324 \begin_inset Flex Code
13327 \begin_layout Plain Layout
13334 \begin_inset Flex Code
13337 \begin_layout Plain Layout
13344 \begin_inset Flex Code
13347 \begin_layout Plain Layout
13354 \begin_inset Flex Code
13357 \begin_layout Plain Layout
13363 for top, bottom, page, and here, respectively.
13367 \begin_layout Plain Layout
13368 Note that the order of these letters in the string is irrelevant, like in
13374 On top of that there is a new type,
13375 \begin_inset Flex Code
13378 \begin_layout Plain Layout
13384 , which does not really correspond to a float, since it means: put it
13385 \begin_inset Quotes eld
13389 \begin_inset Quotes erd
13393 Note however that the
13394 \begin_inset Flex Code
13397 \begin_layout Plain Layout
13403 specifier is special and, because of implementation details, cannot be
13404 used in non-built in float types.
13405 If you do not understand what this means, just use
13406 \begin_inset Quotes eld
13410 \begin_inset Flex Code
13413 \begin_layout Plain Layout
13420 \begin_inset Quotes erd
13426 \begin_layout Description
13427 \begin_inset Flex Code
13430 \begin_layout Plain Layout
13437 \begin_inset Flex Code
13440 \begin_layout Plain Layout
13446 ] The prefix to use when creating labels referring to floats of this type.
13447 This allows the use of formatted references.
13448 Note that you can remove any
13449 \begin_inset Flex Code
13452 \begin_layout Plain Layout
13458 set by a copied style by using the special value
13459 \begin_inset Quotes eld
13463 \begin_inset Quotes erd
13466 , which must be all caps.
13469 \begin_layout Description
13470 \begin_inset Flex Code
13473 \begin_layout Plain Layout
13480 \begin_inset Flex Code
13483 \begin_layout Plain Layout
13490 \begin_inset Quotes erd
13494 \begin_inset Quotes erd
13497 ] The style used when defining the float using
13498 \begin_inset Flex Code
13501 \begin_layout Plain Layout
13512 \begin_layout Description
13513 \begin_inset Flex Code
13516 \begin_layout Plain Layout
13523 \begin_inset Flex Code
13526 \begin_layout Plain Layout
13533 \begin_inset Quotes erd
13537 \begin_inset Quotes erd
13541 \begin_inset Quotes eld
13545 \begin_inset Quotes erd
13548 of the new class of floats, like program or algorithm.
13549 After the appropriate
13550 \begin_inset Flex Code
13553 \begin_layout Plain Layout
13562 \begin_inset Flex Code
13565 \begin_layout Plain Layout
13574 \begin_inset Flex Code
13577 \begin_layout Plain Layout
13588 \begin_layout Standard
13589 Note that defining a float with type
13590 \begin_inset Flex Code
13593 \begin_layout Plain Layout
13601 automatically defines the corresponding counter with name
13602 \begin_inset Flex Code
13605 \begin_layout Plain Layout
13616 \begin_layout Subsection
13617 Flex insets and InsetLayout
13618 \begin_inset CommandInset label
13620 name "sub:Flex-insets-and"
13627 \begin_layout Standard
13628 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13629 these are called Flex insets.
13633 \begin_layout Standard
13634 Flex insets come in three different kinds:
13637 \begin_layout Itemize
13639 \begin_inset Flex Code
13642 \begin_layout Plain Layout
13648 ): These define semantic markup corresponding to such LaTeX commands as
13650 \begin_inset Flex Code
13653 \begin_layout Plain Layout
13662 \begin_inset Flex Code
13665 \begin_layout Plain Layout
13676 \begin_layout Itemize
13678 \begin_inset Flex Code
13681 \begin_layout Plain Layout
13687 ): These can be used to define custom collapsible insets, similar to TeX
13688 code, footnote, and the like.
13689 An obvious example is an endnote inset, which is defined in the
13690 \begin_inset Flex Code
13693 \begin_layout Plain Layout
13702 \begin_layout Itemize
13704 \begin_inset Flex Code
13707 \begin_layout Plain Layout
13713 ): For use with DocBook classes.
13716 \begin_layout Standard
13717 Flex insets are defined using the
13718 \begin_inset Flex Code
13721 \begin_layout Plain Layout
13727 tag, which shall be explained in a moment.
13730 \begin_layout Standard
13732 \begin_inset Flex Code
13735 \begin_layout Plain Layout
13741 tag also serves another function: It can be used to customize the general
13742 layout of many different types of insets.
13744 \begin_inset Flex Code
13747 \begin_layout Plain Layout
13753 can be used to customize the layout parameters for footnotes, marginal
13754 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13755 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13756 define Flex insets.
13759 \begin_layout Standard
13761 \begin_inset Flex Code
13764 \begin_layout Plain Layout
13770 definition must begin with a line of the form:
13773 \begin_layout LyX-Code
13777 \begin_layout Standard
13779 \begin_inset Flex Code
13782 \begin_layout Plain Layout
13788 indicates the inset whose layout is being defined, and here there are two
13792 \begin_layout Enumerate
13793 The layout for a pre-existing inset is being modified.
13794 In this case, can be
13795 \begin_inset Flex Code
13798 \begin_layout Plain Layout
13804 any one of the following:
13805 \begin_inset Flex Code
13808 \begin_layout Plain Layout
13815 \begin_inset Flex Code
13818 \begin_layout Plain Layout
13825 \begin_inset Flex Code
13828 \begin_layout Plain Layout
13835 \begin_inset Flex Code
13838 \begin_layout Plain Layout
13845 \begin_inset Flex Code
13848 \begin_layout Plain Layout
13855 \begin_inset Flex Code
13858 \begin_layout Plain Layout
13865 \begin_inset Flex Code
13868 \begin_layout Plain Layout
13875 \begin_inset Flex Code
13878 \begin_layout Plain Layout
13885 \begin_inset Flex Code
13888 \begin_layout Plain Layout
13895 \begin_inset Flex Code
13898 \begin_layout Plain Layout
13905 \begin_inset Flex Code
13908 \begin_layout Plain Layout
13915 \begin_inset Flex Code
13918 \begin_layout Plain Layout
13925 \begin_inset Flex Code
13928 \begin_layout Plain Layout
13935 \begin_inset Flex Code
13938 \begin_layout Plain Layout
13945 \begin_inset Flex Code
13948 \begin_layout Plain Layout
13955 \begin_inset Flex Code
13958 \begin_layout Plain Layout
13965 \begin_inset Flex Code
13968 \begin_layout Plain Layout
13975 \begin_inset Flex Code
13978 \begin_layout Plain Layout
13985 \begin_inset Flex Code
13988 \begin_layout Plain Layout
13995 \begin_inset Flex Code
13998 \begin_layout Plain Layout
14007 \begin_layout Enumerate
14008 The layout for a Flex inset is being defined.
14010 \begin_inset Flex Code
14013 \begin_layout Plain Layout
14019 may be be any valid identifier not used by a pre-existing inset.
14020 The identifier may include spaces, but in that case the whole thing must
14021 be wrapped in quotes.
14022 It may also include a namespace identifier, preceding a colon, such as
14024 \begin_inset Quotes eld
14028 \begin_inset Flex Code
14031 \begin_layout Plain Layout
14038 \begin_inset Quotes erd
14042 Note that the definition of a flex inset
14047 \begin_inset Flex Code
14050 \begin_layout Plain Layout
14056 entry, declaring which type of inset it defines.
14059 \begin_layout Standard
14061 \begin_inset Flex Code
14064 \begin_layout Plain Layout
14070 definition can contain the following entries:
14073 \begin_layout Description
14074 \begin_inset Flex Code
14077 \begin_layout Plain Layout
14083 The color for the inset's background.
14084 The valid colors are defined in
14085 \begin_inset Flex Code
14088 \begin_layout Plain Layout
14097 \begin_layout Description
14098 \begin_inset Flex Code
14101 \begin_layout Plain Layout
14108 \begin_inset Flex Code
14111 \begin_layout Plain Layout
14120 \begin_inset Flex Code
14123 \begin_layout Plain Layout
14129 ] Whether to use the content of the inset as the label, when the inset is
14134 \begin_layout Description
14135 \begin_inset Flex Code
14138 \begin_layout Plain Layout
14144 As with paragraph styles (see page
14145 \begin_inset CommandInset ref
14147 reference "des:CopyStyle"
14154 \begin_layout Description
14155 \begin_inset Flex Code
14158 \begin_layout Plain Layout
14165 \begin_inset Flex Code
14168 \begin_layout Plain Layout
14177 \begin_inset Flex Code
14180 \begin_layout Plain Layout
14186 ] Indicates whether the user may employ the Paragraph Settings dialog to
14187 customize the paragraph.
14190 \begin_layout Description
14191 \begin_inset Flex Code
14194 \begin_layout Plain Layout
14201 \begin_inset Flex Code
14204 \begin_layout Plain Layout
14211 \begin_inset Flex Code
14214 \begin_layout Plain Layout
14221 \begin_inset Flex Code
14224 \begin_layout Plain Layout
14230 , describing the rendering style used for the inset's frame and buttons.
14231 Footnotes generally use
14232 \begin_inset Flex Code
14235 \begin_layout Plain Layout
14241 , ERT insets generally
14242 \begin_inset Flex Code
14245 \begin_layout Plain Layout
14251 , and character styles
14252 \begin_inset Flex Code
14255 \begin_layout Plain Layout
14264 \begin_layout Description
14265 \begin_inset Flex Code
14268 \begin_layout Plain Layout
14274 Required at the end of the InsetLayout declarations.
14277 \begin_layout Description
14278 \begin_inset Flex Code
14281 \begin_layout Plain Layout
14287 The font used for both the text body
14293 \begin_inset space ~
14297 \begin_inset CommandInset ref
14299 reference "sub:Font-description"
14304 Note that defining this font automatically defines the
14305 \begin_inset Flex Code
14308 \begin_layout Plain Layout
14314 to the same value, so define this first and define
14315 \begin_inset Flex Code
14318 \begin_layout Plain Layout
14324 later if you want them to be different.
14327 \begin_layout Description
14328 \begin_inset Flex Code
14331 \begin_layout Plain Layout
14338 \begin_inset Quotes eld
14342 \begin_inset Quotes erd
14345 language, leading to Left-to-Right (latin) output, e.
14346 \begin_inset space \thinspace{}
14350 \begin_inset space \space{}
14353 in TeX code or URL.
14357 \begin_layout Description
14358 \begin_inset Flex Code
14361 \begin_layout Plain Layout
14368 \begin_inset Flex Code
14371 \begin_layout Plain Layout
14380 \begin_inset Flex Code
14383 \begin_layout Plain Layout
14389 ] Indicates whether the PlainLayout should be used or, instead, the user
14390 can change the paragraph style used in the inset.
14394 \begin_layout Description
14395 \begin_inset Flex Code
14398 \begin_layout Plain Layout
14404 As with paragraph styles (see page
14405 \begin_inset CommandInset ref
14406 LatexCommand pageref
14407 reference "des:FreeSpacing"
14415 \begin_layout Description
14416 \begin_inset Flex Code
14419 \begin_layout Plain Layout
14425 These tags control XHTML output.
14427 \begin_inset CommandInset ref
14429 reference "sec:Tags-for-XHTML"
14436 \begin_layout Description
14437 \begin_inset Flex Code
14440 \begin_layout Plain Layout
14447 \begin_inset Flex Code
14450 \begin_layout Plain Layout
14459 \begin_inset Flex Code
14462 \begin_layout Plain Layout
14468 ] Whether to include the contents of this inset in the strings generated
14469 for the `Outline' pane.
14470 One would not, for example, want the content of a footnote in a section
14471 header to be included in the TOC displayed in the outline, but one would
14472 normally want the content of a character style displayed.
14473 Default is false: not to include.
14476 \begin_layout Description
14477 \begin_inset Flex Code
14480 \begin_layout Plain Layout
14486 As with paragraph styles (see page
14487 \begin_inset CommandInset ref
14488 LatexCommand pageref
14489 reference "des:KeepEmpty"
14497 \begin_layout Description
14498 \begin_inset Flex Code
14501 \begin_layout Plain Layout
14507 The font used for the label.
14509 \begin_inset space ~
14513 \begin_inset CommandInset ref
14515 reference "sub:Font-description"
14520 Note that this definition can never appear before
14521 \begin_inset Flex Code
14524 \begin_layout Plain Layout
14530 , lest it be ineffective.
14533 \begin_layout Description
14534 \begin_inset Flex Code
14537 \begin_layout Plain Layout
14543 What will be displayed on the button or elsewhere as the inset label.
14544 Some inset types (TeX code and Branch) modify this label on the fly.
14547 \begin_layout Description
14548 \begin_inset Flex Code
14551 \begin_layout Plain Layout
14557 The name of the corresponding LaTeX stuff.
14558 Either the environment or command name.
14561 \begin_layout Description
14562 \begin_inset Flex Code
14565 \begin_layout Plain Layout
14571 The optional parameter for the corresponding
14572 \begin_inset Flex Code
14575 \begin_layout Plain Layout
14581 stuff, including possible bracket pairs like
14582 \begin_inset Flex Code
14585 \begin_layout Plain Layout
14592 This parameter cannot be changed from within LyX.
14595 \begin_layout Description
14596 \begin_inset Flex Code
14599 \begin_layout Plain Layout
14605 As with paragraph styles (see page
14606 \begin_inset CommandInset ref
14607 LatexCommand pageref
14608 reference "des:LatexType"
14615 \begin_layout Description
14616 \begin_inset Flex Code
14619 \begin_layout Plain Layout
14626 \begin_inset Flex Code
14629 \begin_layout Plain Layout
14636 \begin_inset Flex Code
14639 \begin_layout Plain Layout
14646 \begin_inset Flex Code
14649 \begin_layout Plain Layout
14656 \begin_inset Flex Code
14659 \begin_layout Plain Layout
14665 (indicating a dummy definition ending definitions of charstyles, etc).
14666 This entry is required in and is only meaningful for Flex insets.
14667 Among other things, it determines on which menu this inset will appear.
14669 \begin_inset Flex Code
14672 \begin_layout Plain Layout
14679 \begin_inset Flex Code
14682 \begin_layout Plain Layout
14689 \begin_inset Flex Code
14692 \begin_layout Plain Layout
14700 \begin_inset Flex Code
14703 \begin_layout Plain Layout
14709 can be set to true for charstyle insets, if you wish, by setting it
14714 \begin_inset Flex Code
14717 \begin_layout Plain Layout
14726 \begin_layout Description
14727 \begin_inset Flex Code
14730 \begin_layout Plain Layout
14737 \begin_inset Flex Code
14740 \begin_layout Plain Layout
14749 \begin_inset Flex Code
14752 \begin_layout Plain Layout
14758 ] Whether multiple paragraphs are permitted in this inset.
14760 \begin_inset Flex Code
14763 \begin_layout Plain Layout
14769 to the same value and
14770 \begin_inset Flex Code
14773 \begin_layout Plain Layout
14779 to the opposite value.
14780 These can be reset to other values, if they are used
14785 \begin_inset Flex Code
14788 \begin_layout Plain Layout
14798 \begin_layout Description
14799 \begin_inset Flex Code
14802 \begin_layout Plain Layout
14809 \begin_inset Flex Code
14812 \begin_layout Plain Layout
14821 \begin_inset Flex Code
14824 \begin_layout Plain Layout
14830 ] Whether fragile commands in this layout should be
14831 \begin_inset Flex Code
14834 \begin_layout Plain Layout
14847 whether the command should itself be protected.) Default is false.
14850 \begin_layout Description
14851 \begin_inset Flex Code
14854 \begin_layout Plain Layout
14861 \begin_inset Flex Code
14864 \begin_layout Plain Layout
14873 \begin_inset Flex Code
14876 \begin_layout Plain Layout
14882 ] As with paragraph styles (see page
14883 \begin_inset CommandInset ref
14884 LatexCommand pageref
14885 reference "des:ParbreakIsNewline"
14893 \begin_layout Description
14894 \begin_inset Flex Code
14897 \begin_layout Plain Layout
14904 \begin_inset Flex Code
14907 \begin_layout Plain Layout
14916 \begin_inset Flex Code
14919 \begin_layout Plain Layout
14925 ] As with paragraph styles (see page
14926 \begin_inset CommandInset ref
14927 LatexCommand pageref
14928 reference "des:PassThru"
14936 \begin_layout Description
14937 \begin_inset Flex Code
14940 \begin_layout Plain Layout
14946 As with paragraph styles (see page
14947 \begin_inset CommandInset ref
14948 LatexCommand pageref
14949 reference "des:Preamble"
14956 \begin_layout Description
14957 \begin_inset Flex Code
14960 \begin_layout Plain Layout
14967 \begin_inset Flex Code
14970 \begin_layout Plain Layout
14976 ] The prefix to use when creating labels referring to insets of this type.
14977 This allows the use of formatted references.
14980 \begin_layout Description
14981 \begin_inset Flex Code
14984 \begin_layout Plain Layout
14991 \begin_inset Flex Code
14994 \begin_layout Plain Layout
15000 ] As with paragraph styles (see page
15001 \begin_inset CommandInset ref
15002 LatexCommand pageref
15003 reference "des:Requires"
15010 \begin_layout Description
15011 \begin_inset Flex Code
15014 \begin_layout Plain Layout
15021 \begin_inset Flex Code
15024 \begin_layout Plain Layout
15031 \begin_inset Flex Code
15034 \begin_layout Plain Layout
15042 ] Whether this inset should use the font of its surrounding environment
15044 Default is true: uses its own.
15047 \begin_layout Description
15048 \begin_inset Flex Code
15051 \begin_layout Plain Layout
15058 \begin_inset Flex Code
15061 \begin_layout Plain Layout
15068 \begin_inset Flex Code
15071 \begin_layout Plain Layout
15079 ] Spellcheck the contents of this inset.
15083 \begin_layout Subsection
15085 \begin_inset CommandInset label
15087 name "sub:Counters"
15094 \begin_layout Standard
15095 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15097 \begin_inset Flex MenuItem
15100 \begin_layout Plain Layout
15107 \begin_inset Flex MenuItem
15110 \begin_layout Plain Layout
15116 , \SpecialChar \ldots{}
15117 ) in the text class itself.
15118 The standard counters are defined in the file
15119 \begin_inset Flex Code
15122 \begin_layout Plain Layout
15128 , so you may have to do no more than add
15131 \begin_layout LyX-Code
15132 Input stdcounters.inc
15135 \begin_layout Standard
15136 to your layout file to get them to work.
15137 But if you want to define custom counters, then you can do so.
15138 The counter declaration must begin with:
15141 \begin_layout LyX-Code
15142 Counter CounterName
15145 \begin_layout Standard
15147 \begin_inset Flex Code
15150 \begin_layout Plain Layout
15156 ' is replaced by the name of the counter.
15157 And it must end with
15158 \begin_inset Quotes eld
15162 \begin_inset Flex Code
15165 \begin_layout Plain Layout
15172 \begin_inset Quotes erd
15176 The following parameters can also be used:
15179 \begin_layout Description
15180 \begin_inset Flex Code
15183 \begin_layout Plain Layout
15190 \begin_inset Flex Code
15193 \begin_layout Plain Layout
15200 \begin_inset Quotes erd
15204 \begin_inset Quotes erd
15207 ] When defined, this string defines how the counter is displayed.
15208 Setting this value sets
15209 \begin_inset Flex Code
15212 \begin_layout Plain Layout
15213 LabelStringAppendix
15219 The following special constructs can be used in the string:
15223 \begin_layout Itemize
15224 \begin_inset Flex Code
15227 \begin_layout Plain Layout
15235 will be replaced by the expansion of the
15236 \begin_inset Flex Code
15239 \begin_layout Plain Layout
15246 \begin_inset Flex Code
15249 \begin_layout Plain Layout
15250 LabelStringAppendix
15256 \begin_inset Flex Code
15259 \begin_layout Plain Layout
15269 \begin_layout Itemize
15270 counter values can be expressed using LaTeX-like macros
15271 \begin_inset Flex Code
15274 \begin_layout Plain Layout
15291 \begin_inset Flex Code
15294 \begin_layout Plain Layout
15306 \begin_layout Plain Layout
15316 Actually, the situation is a bit more complicated: any
15335 other than those described below will produce arabic numerals.
15336 It would not be surprising to see this change in the future.
15342 \begin_inset Flex Code
15345 \begin_layout Plain Layout
15351 : 1, 2, 3,\SpecialChar \ldots{}
15353 \begin_inset Flex Code
15356 \begin_layout Plain Layout
15362 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15364 \begin_inset Flex Code
15367 \begin_layout Plain Layout
15373 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15375 \begin_inset Flex Code
15378 \begin_layout Plain Layout
15384 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15386 \begin_inset Flex Code
15389 \begin_layout Plain Layout
15395 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15397 \begin_inset Flex Code
15400 \begin_layout Plain Layout
15406 for hebrew numerals.
15410 \begin_layout Standard
15411 If LabelString is not defined, a default value is constructed as follows:
15412 if the counter has a master counter
15413 \begin_inset Flex Code
15416 \begin_layout Plain Layout
15423 \begin_inset Flex Code
15426 \begin_layout Plain Layout
15433 \begin_inset Flex Code
15436 \begin_layout Plain Layout
15446 is used; otherwise the string
15447 \begin_inset Flex Code
15450 \begin_layout Plain Layout
15461 \begin_layout Description
15462 \begin_inset Flex Code
15465 \begin_layout Plain Layout
15466 LabelStringAppendix
15472 \begin_inset Flex Code
15475 \begin_layout Plain Layout
15482 \begin_inset Quotes erd
15486 \begin_inset Quotes erd
15490 \begin_inset Flex Code
15493 \begin_layout Plain Layout
15499 , but for use in the Appendix.
15502 \begin_layout Description
15503 \begin_inset Flex Code
15506 \begin_layout Plain Layout
15513 \begin_inset Flex Code
15516 \begin_layout Plain Layout
15523 \begin_inset Quotes erd
15527 \begin_inset Quotes erd
15530 ] A format for use with formatted references to this counter.
15531 For example, one might want to have references to section numbers appear
15533 \begin_inset Quotes eld
15537 \begin_inset Quotes erd
15541 The string should contain
15542 \begin_inset Quotes eld
15546 \begin_inset Quotes erd
15550 This will be replaced by the counter number itself.
15551 So, for sections, it would be: Section ##.
15554 \begin_layout Description
15555 \begin_inset Flex Code
15558 \begin_layout Plain Layout
15565 \begin_inset Flex Code
15568 \begin_layout Plain Layout
15575 \begin_inset Quotes erd
15579 \begin_inset Quotes erd
15582 ] If this is set to the name of another counter, the present counter will
15583 be reset every time the other one is increased.
15585 \begin_inset Flex Code
15588 \begin_layout Plain Layout
15595 \begin_inset Flex Code
15598 \begin_layout Plain Layout
15607 \begin_layout Subsection
15609 \begin_inset CommandInset label
15611 name "sub:Font-description"
15618 \begin_layout Standard
15619 A font description looks like this:
15622 \begin_layout LyX-Code
15632 \begin_layout LyX-Code
15636 \begin_layout LyX-Code
15640 \begin_layout Standard
15641 The following commands are available:
15644 \begin_layout Description
15645 \begin_inset Flex Code
15648 \begin_layout Plain Layout
15655 \begin_inset Flex Code
15658 \begin_layout Plain Layout
15667 \begin_inset Flex Code
15670 \begin_layout Plain Layout
15677 \begin_inset Flex Code
15680 \begin_layout Plain Layout
15687 \begin_inset Flex Code
15690 \begin_layout Plain Layout
15697 \begin_inset Flex Code
15700 \begin_layout Plain Layout
15707 \begin_inset Flex Code
15710 \begin_layout Plain Layout
15717 \begin_inset Flex Code
15720 \begin_layout Plain Layout
15727 \begin_inset Flex Code
15730 \begin_layout Plain Layout
15737 \begin_inset Flex Code
15740 \begin_layout Plain Layout
15749 \begin_layout Description
15750 \begin_inset Flex Code
15753 \begin_layout Plain Layout
15760 \begin_inset Flex Code
15763 \begin_layout Plain Layout
15772 \begin_inset Flex Code
15775 \begin_layout Plain Layout
15782 \begin_inset Flex Code
15785 \begin_layout Plain Layout
15794 \begin_layout Description
15795 \begin_inset Flex Code
15798 \begin_layout Plain Layout
15805 \begin_inset Flex Code
15808 \begin_layout Plain Layout
15814 ] Valid arguments are:
15815 \begin_inset Flex Code
15818 \begin_layout Plain Layout
15825 \begin_inset Flex Code
15828 \begin_layout Plain Layout
15835 \begin_inset Flex Code
15838 \begin_layout Plain Layout
15845 \begin_inset Flex Code
15848 \begin_layout Plain Layout
15855 \begin_inset Flex Code
15858 \begin_layout Plain Layout
15865 \begin_inset Flex Code
15868 \begin_layout Plain Layout
15875 Each of these turns on or off the corresponding attribute.
15877 \begin_inset Flex Code
15880 \begin_layout Plain Layout
15886 turns on emphasis, and
15887 \begin_inset Flex Code
15890 \begin_layout Plain Layout
15898 \begin_inset Newline newline
15901 If the latter seems puzzling, remember that the font settings for the present
15902 context are generally inherited from the surrounding context.
15904 \begin_inset Flex Code
15907 \begin_layout Plain Layout
15913 would turn off the emphasis that was anyway in effect, say, in a theorem
15917 \begin_layout Description
15918 \begin_inset Flex Code
15921 \begin_layout Plain Layout
15928 \begin_inset Flex Code
15931 \begin_layout Plain Layout
15940 \begin_inset Flex Code
15943 \begin_layout Plain Layout
15952 \begin_layout Description
15953 \begin_inset Flex Code
15956 \begin_layout Plain Layout
15963 \begin_inset Flex Code
15966 \begin_layout Plain Layout
15975 \begin_inset Flex Code
15978 \begin_layout Plain Layout
15985 \begin_inset Flex Code
15988 \begin_layout Plain Layout
15995 \begin_inset Flex Code
15998 \begin_layout Plain Layout
16007 \begin_layout Description
16008 \begin_inset Flex Code
16011 \begin_layout Plain Layout
16018 \begin_inset Flex Code
16021 \begin_layout Plain Layout
16028 \begin_inset Flex Code
16031 \begin_layout Plain Layout
16038 \begin_inset Flex Code
16041 \begin_layout Plain Layout
16050 \begin_inset Flex Code
16053 \begin_layout Plain Layout
16060 \begin_inset Flex Code
16063 \begin_layout Plain Layout
16070 \begin_inset Flex Code
16073 \begin_layout Plain Layout
16080 \begin_inset Flex Code
16083 \begin_layout Plain Layout
16090 \begin_inset Flex Code
16093 \begin_layout Plain Layout
16102 \begin_layout Subsection
16103 \begin_inset CommandInset label
16105 name "sub:Citation-format-description"
16109 Citation format description
16112 \begin_layout Standard
16114 \begin_inset Flex Code
16117 \begin_layout Plain Layout
16123 blocks are used to describe how bibliographic information should be displayed,
16124 both within LyX itself (in the citation dialog and in tooltips, for example)
16125 and in XHTML output.
16126 Such a block might look like this:
16129 \begin_layout LyX-Code
16133 \begin_layout LyX-Code
16137 \begin_layout LyX-Code
16141 \begin_layout LyX-Code
16145 \begin_layout Standard
16146 The individual lines define how the bibliographic information associated
16147 with an article or book, respectively, is to be displayed, and such a definitio
16148 n can be given for any `entry type' that might be present in a BibTeX file.
16149 LyX defines a default format in the source code that will be used if no
16150 specific definition has been given.
16151 LyX predefines several formats in the file
16152 \begin_inset Flex Code
16155 \begin_layout Plain Layout
16161 , which is included in most of LyX's document classes.
16164 \begin_layout Standard
16165 The definitions use a simple language that allows BibTeX keys to be replaced
16167 Keys should be enclosed in
16168 \begin_inset Flex Code
16171 \begin_layout Plain Layout
16178 \begin_inset Flex Code
16181 \begin_layout Plain Layout
16188 So a simple definition might look like this:
16191 \begin_layout LyX-Code
16193 \begin_inset Quotes eld
16197 \begin_inset Quotes erd
16203 \begin_layout Standard
16204 This would print the author, followed by a comma, followed by the title,
16205 in quotes, followed by a period.
16208 \begin_layout Standard
16209 Of course, sometimes you may want to print a key only if it exists.
16210 This can be done by using a conditional construction, such as:
16211 \begin_inset Flex Code
16214 \begin_layout Plain Layout
16216 \begin_inset space ~
16226 \begin_inset Flex Code
16229 \begin_layout Plain Layout
16235 key exists, then print
16236 \begin_inset Quotes eld
16240 \begin_inset space ~
16244 \begin_inset Quotes erd
16247 followed by the volume key.
16248 It is also possible to have an else clause in the conditional, such as:
16250 \begin_inset Flex Code
16253 \begin_layout Plain Layout
16254 {%author%[[%author%]][[%editor%, ed.]]}
16261 \begin_inset Flex Code
16264 \begin_layout Plain Layout
16270 key is printed if it exists; otherwise, the editor key is printed, followed
16272 \begin_inset Quotes eld
16276 \begin_inset space ~
16280 \begin_inset Quotes erd
16283 Note that the key is again enclosed in
16284 \begin_inset Flex Code
16287 \begin_layout Plain Layout
16293 signs; the entire conditional is enclosed in braces; and the if and else
16294 clauses are enclosed in double brackets,
16295 \begin_inset Quotes eld
16299 \begin_inset Flex Code
16302 \begin_layout Plain Layout
16309 \begin_inset Quotes eld
16313 \begin_inset Quotes eld
16317 \begin_inset Flex Code
16320 \begin_layout Plain Layout
16327 \begin_inset Quotes erd
16331 There must be no space between any of these.
16334 \begin_layout Standard
16335 There is one other piece of syntax available in definitions, which looks
16337 \begin_inset Flex Code
16340 \begin_layout Plain Layout
16347 This defines a piece of formatting information that is to be used when
16349 \begin_inset Quotes eld
16353 \begin_inset Quotes erd
16357 Obviously, we do not want to output HTML tags when writing plain text,
16358 so they should be wrapped in
16359 \begin_inset Quotes eld
16363 \begin_inset Quotes erd
16367 \begin_inset Quotes eld
16371 \begin_inset Quotes erd
16377 \begin_layout Standard
16378 Two special sorts of definitions are also possible in a
16379 \begin_inset Flex Code
16382 \begin_layout Plain Layout
16389 An example of the first would be:
16392 \begin_layout LyX-Code
16394 \begin_inset Quotes eld
16398 \begin_inset Quotes erd
16404 \begin_layout Standard
16405 This is an abbreviation, or macro, and it can be used by treating it as
16407 \begin_inset Flex Code
16410 \begin_layout Plain Layout
16418 \begin_inset Flex Code
16421 \begin_layout Plain Layout
16427 exactly as it would treat its definition.
16428 So, let us issue the obvious
16436 \begin_layout LyX-Code
16440 \begin_layout Standard
16441 or anything like it.
16442 LyX shouldn't go into an infinite loop, but it may go into a long one before
16446 \begin_layout Standard
16447 The second sort of special definition might look like this:
16450 \begin_layout LyX-Code
16454 \begin_layout Standard
16455 This defines a translatable piece of text, which allows relevant parts of
16456 the bibliography to be translated.
16457 It can be included in a definition by treating it as a key:
16458 \begin_inset Flex Code
16461 \begin_layout Plain Layout
16468 Several of these are predefined in
16469 \begin_inset Flex Code
16472 \begin_layout Plain Layout
16479 Note that these are not macros, in the sense just defined.
16480 They will not be expanded.
16483 \begin_layout Standard
16484 So here then is an example that use all these features:
16487 \begin_layout LyX-Code
16488 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16491 \begin_layout Standard
16492 The defines a macro that prints the author, followed by a comma, if the
16494 \begin_inset Flex Code
16497 \begin_layout Plain Layout
16503 key is defined, or else prints the name of the editor, followed by the
16505 \begin_inset Flex Code
16508 \begin_layout Plain Layout
16514 or its translation (it is by default
16515 \begin_inset Quotes eld
16519 \begin_inset Quotes erd
16523 \begin_inset Flex Code
16526 \begin_layout Plain Layout
16533 Note that this is in fact defined in
16534 \begin_inset Flex Code
16537 \begin_layout Plain Layout
16543 , so you can use it in your own definitions, or re-definitions, if you load
16547 \begin_layout Section
16548 \begin_inset CommandInset label
16550 name "sec:Tags-for-XHTML"
16554 Tags for XHTML output
16557 \begin_layout Standard
16558 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16559 by layout information.
16560 In general, LyX provides sensible defaults and, as mentioned earlier, it
16561 will even construct default CSS style rules from the other layout tags.
16562 For example, LyX will attempt to use the information provided in the
16563 \begin_inset Flex Code
16566 \begin_layout Plain Layout
16572 declaration for the Chapter style to write CSS that will appropriately
16573 format chapter headings.
16576 \begin_layout Standard
16577 In many cases, then, you may not have to do anything at all to get acceptable
16578 XHTML output for your own environments, custom insets, and so forth.
16579 But in some cases you will, and so LyX provides a number of layout tags
16580 that can be used to customize the XHTML and CSS that are generated.
16583 \begin_layout Standard
16584 Note that there are two tags,
16585 \begin_inset Flex Code
16588 \begin_layout Plain Layout
16595 \begin_inset Flex Code
16598 \begin_layout Plain Layout
16604 that may appear outside style and inset declarations.
16606 \begin_inset CommandInset ref
16608 reference "sub:General-text-class"
16612 for details on these.
16615 \begin_layout Subsection
16616 \begin_inset CommandInset label
16618 name "sub:Paragraph-Style-XHTML"
16625 \begin_layout Standard
16626 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16627 dealing with a normal paragraph, a command, or an environment, where this
16628 is itself determined by the contents of the corresponding
16629 \begin_inset Flex Code
16632 \begin_layout Plain Layout
16642 \begin_layout Standard
16643 For a command or normal paragraph, the output XHTML has the following form:
16646 \begin_layout LyX-Code
16648 \begin_inset Quotes erd
16652 \begin_inset Quotes erd
16658 \begin_layout LyX-Code
16660 \begin_inset Quotes erd
16664 \begin_inset Quotes erd
16670 \begin_layout LyX-Code
16671 Contents of the paragraph.
16674 \begin_layout LyX-Code
16678 \begin_layout Standard
16679 The label tags are of course omitted if the paragraph does not have a label.
16682 \begin_layout Standard
16683 For an environment that is not some sort of list, the XHTML takes this form:
16686 \begin_layout LyX-Code
16688 \begin_inset Quotes erd
16692 \begin_inset Quotes erd
16698 \begin_layout LyX-Code
16700 \begin_inset Quotes erd
16704 \begin_inset Quotes erd
16708 \begin_inset Quotes erd
16712 \begin_inset Quotes erd
16715 >Environment Label</labeltag>First paragraph.</itemtag>
16718 \begin_layout LyX-Code
16719 <itemtag>Second paragraph.</itemtag>
16722 \begin_layout LyX-Code
16726 \begin_layout Standard
16727 Note that the label is output only for the first paragraph, as it should
16728 be for a theorem, for example.
16732 \begin_layout Standard
16733 For a list, we have one of these forms:
16736 \begin_layout LyX-Code
16738 \begin_inset Quotes erd
16742 \begin_inset Quotes erd
16748 \begin_layout LyX-Code
16750 \begin_inset Quotes erd
16754 \begin_inset Quotes erd
16758 \begin_inset Quotes erd
16762 \begin_inset Quotes erd
16765 >List Label</labeltag>First item.</itemtag>
16768 \begin_layout LyX-Code
16770 \begin_inset Quotes erd
16774 \begin_inset Quotes erd
16778 \begin_inset Quotes erd
16782 \begin_inset Quotes erd
16785 >List Label</labeltag>Second item.</itemtag>
16788 \begin_layout LyX-Code
16792 \begin_layout LyX-Code
16796 \begin_layout LyX-Code
16798 \begin_inset Quotes erd
16802 \begin_inset Quotes erd
16808 \begin_layout LyX-Code
16810 \begin_inset Quotes erd
16814 \begin_inset Quotes erd
16817 >List Label</labeltag><itemtag attr=
16818 \begin_inset Quotes erd
16822 \begin_inset Quotes erd
16825 >First item.</itemtag>
16828 \begin_layout LyX-Code
16830 \begin_inset Quotes erd
16834 \begin_inset Quotes erd
16837 >List Label</labeltag><itemtag attr=
16838 \begin_inset Quotes erd
16842 \begin_inset Quotes erd
16845 >Second item.</itemtag>
16848 \begin_layout LyX-Code
16852 \begin_layout Standard
16853 Note the different orders of
16854 \begin_inset Flex Code
16857 \begin_layout Plain Layout
16864 \begin_inset Flex Code
16867 \begin_layout Plain Layout
16874 Which order we get depends upon the setting of
16875 \begin_inset Flex Code
16878 \begin_layout Plain Layout
16885 \begin_inset Flex Code
16888 \begin_layout Plain Layout
16894 is false (the default), you get the first of these, with the label within
16895 the item; if true, you get the second, with the label outside the item.
16898 \begin_layout Standard
16899 The specific tags and attributes output for each paragraph type can be controlle
16900 d by means of the layout tags we are about to describe.
16901 As mentioned earlier, however, LyX uses sensible defaults for many of these,
16902 so you often may not need to do very much to get good XHTML output.
16903 Think of the available tags as there so you can tweak things to your liking.
16906 \begin_layout Description
16907 \begin_inset Flex Code
16910 \begin_layout Plain Layout
16917 \begin_inset Flex Code
16920 \begin_layout Plain Layout
16926 ] Specifies attribute information to be output with the main tag.
16928 \begin_inset Quotes eld
16932 \begin_inset Flex Code
16935 \begin_layout Plain Layout
16942 \begin_inset Quotes erd
16946 By default, LyX will output
16947 \begin_inset Quotes eld
16951 \begin_inset Flex Code
16954 \begin_layout Plain Layout
16961 \begin_inset Quotes erd
16965 \begin_inset Flex Code
16968 \begin_layout Plain Layout
16974 is the LyX name of the layout, made lowercase, for example: chapter.
16979 contain any style information.
16981 \begin_inset Flex Code
16984 \begin_layout Plain Layout
16993 \begin_layout Description
16994 \begin_inset Flex Code
16997 \begin_layout Plain Layout
17004 \begin_inset Flex Code
17007 \begin_layout Plain Layout
17017 ] Whether to output the default CSS information LyX generates for this layout,
17018 even if additional information is explicitly provided via
17019 \begin_inset Flex Code
17022 \begin_layout Plain Layout
17030 \begin_inset Flex Code
17033 \begin_layout Plain Layout
17039 allows you to alter or augment the generated CSS, rather than to override
17042 \begin_inset Flex Code
17045 \begin_layout Plain Layout
17054 \begin_layout Description
17055 \begin_inset Flex Code
17058 \begin_layout Plain Layout
17065 \begin_inset Flex Code
17068 \begin_layout Plain Layout
17074 ] The tag to be used for individual paragraphs of environments, replacing
17076 \begin_inset Flex Code
17079 \begin_layout Plain Layout
17085 in the examples above.
17087 \begin_inset Flex Code
17090 \begin_layout Plain Layout
17099 \begin_layout Description
17100 \begin_inset Flex Code
17103 \begin_layout Plain Layout
17110 \begin_inset Flex Code
17113 \begin_layout Plain Layout
17119 ] Attributes for the item tag.
17121 \begin_inset Quotes eld
17125 \begin_inset Flex Code
17128 \begin_layout Plain Layout
17129 class=`layoutname_item'
17135 \begin_inset Quotes erd
17143 contain any style information.
17145 \begin_inset Flex Code
17148 \begin_layout Plain Layout
17157 \begin_layout Description
17158 \begin_inset Flex Code
17161 \begin_layout Plain Layout
17168 \begin_inset Flex Code
17171 \begin_layout Plain Layout
17177 ] The tag to be used for paragraph and item labels, replacing
17178 \begin_inset Flex Code
17181 \begin_layout Plain Layout
17187 in the examples above.
17189 \begin_inset Flex Code
17192 \begin_layout Plain Layout
17199 \begin_inset Flex Code
17202 \begin_layout Plain Layout
17209 \begin_inset Flex Code
17212 \begin_layout Plain Layout
17219 \begin_inset Flex Code
17222 \begin_layout Plain Layout
17223 Centered_Top_Environment
17228 , in which case it defaults to
17229 \begin_inset Flex Code
17232 \begin_layout Plain Layout
17241 \begin_layout Description
17242 \begin_inset Flex Code
17245 \begin_layout Plain Layout
17252 \begin_inset Flex Code
17255 \begin_layout Plain Layout
17261 ] Attributes for the label tag.
17263 \begin_inset Quotes eld
17267 \begin_inset Flex Code
17270 \begin_layout Plain Layout
17271 class=`layoutname_label'
17277 \begin_inset Quotes erd
17285 contain any style information.
17287 \begin_inset Flex Code
17290 \begin_layout Plain Layout
17299 \begin_layout Description
17300 \begin_inset Flex Code
17303 \begin_layout Plain Layout
17310 \begin_inset Flex Code
17313 \begin_layout Plain Layout
17323 ] Meaningful only for list-like environments, this tag controls whether
17324 the label tag is output before or inside the item tag.
17325 This is used, for example, in the description environment, where we want
17327 \begin_inset Flex Code
17330 \begin_layout Plain Layout
17331 <dt>\SpecialChar \ldots{}
17332 </dt><dd>\SpecialChar \ldots{}
17340 \begin_inset Flex Code
17343 \begin_layout Plain Layout
17349 : The label tag is output inside the item tag.
17352 \begin_layout Description
17353 \begin_inset Flex Code
17356 \begin_layout Plain Layout
17362 Information to be output in the
17363 \begin_inset Flex Code
17366 \begin_layout Plain Layout
17372 section when this style is used.
17373 This might, for example, be used to include a
17374 \begin_inset Flex Code
17377 \begin_layout Plain Layout
17384 \begin_inset Flex Code
17387 \begin_layout Plain Layout
17396 \begin_layout Description
17397 \begin_inset Flex Code
17400 \begin_layout Plain Layout
17406 CSS style information to be included when this style is used.
17407 Note that this will automatically be wrapped in a layout-generated
17408 \begin_inset Flex Code
17411 \begin_layout Plain Layout
17417 block, so only the CSS itself need be included.
17420 \begin_layout Description
17421 \begin_inset Flex Code
17424 \begin_layout Plain Layout
17431 \begin_inset Flex Code
17434 \begin_layout Plain Layout
17440 ] The tag to be used for the main label, replacing
17441 \begin_inset Flex Code
17444 \begin_layout Plain Layout
17450 in the examples above.
17452 \begin_inset Flex Code
17455 \begin_layout Plain Layout
17464 \begin_layout Description
17465 \begin_inset Flex Code
17468 \begin_layout Plain Layout
17475 \begin_inset Flex Code
17478 \begin_layout Plain Layout
17488 ] Marks this style as the one to be used to generate the
17489 \begin_inset Flex Code
17492 \begin_layout Plain Layout
17498 tag for the XHTML file.
17499 By default, it is false.
17501 \begin_inset Flex Code
17504 \begin_layout Plain Layout
17510 file sets it to true for the
17511 \begin_inset Flex Code
17514 \begin_layout Plain Layout
17524 \begin_layout Subsection
17528 \begin_layout Standard
17529 The XHTML output of insets can also be controlled by information in layout
17534 \begin_layout Plain Layout
17535 At present, this is true only for
17536 \begin_inset Quotes eld
17540 \begin_inset Quotes erd
17543 insets (insets you can type into) and is not true for
17544 \begin_inset Quotes eld
17548 \begin_inset Quotes erd
17551 insets (insets that are associated with dialog boxes).
17556 Here, too, LyX tries to provide sensible defaults, and it constructs default
17558 But everything can be customized.
17561 \begin_layout Standard
17562 The XHTML LyX outputs for an inset has the following form:
17565 \begin_layout LyX-Code
17567 \begin_inset Quotes erd
17571 \begin_inset Quotes erd
17577 \begin_layout LyX-Code
17578 <labeltag>Label</labeltag>
17581 \begin_layout LyX-Code
17583 \begin_inset Quotes erd
17587 \begin_inset Quotes erd
17590 >Contents of the inset.</innertag>
17593 \begin_layout LyX-Code
17597 \begin_layout Standard
17598 If the inset permits multiple paragraphs---that is, if
17599 \begin_inset Flex Code
17602 \begin_layout Plain Layout
17608 is true---then the contents of the inset will itself be output as paragraphs
17609 formatted according to the styles used for those paragraphs (standard,
17610 quote, and the like).
17611 The label tag is of course omitted if the paragraph does not have a label
17612 and, at present, is always
17613 \begin_inset Flex Code
17616 \begin_layout Plain Layout
17623 The inner tag is optional and, by default, does not appear.
17626 \begin_layout Standard
17627 The specific tags and attributes output for each inset can be controlled
17628 by means of the following layout tags.
17631 \begin_layout Description
17632 \begin_inset Flex Code
17635 \begin_layout Plain Layout
17642 \begin_inset Flex Code
17645 \begin_layout Plain Layout
17651 ] Specifies attribute information to be output with the main tag.
17653 \begin_inset Quotes eld
17657 \begin_inset Flex Code
17660 \begin_layout Plain Layout
17661 class=`myinset' onclick=`\SpecialChar \ldots{}
17668 \begin_inset Quotes erd
17672 By default, LyX will output
17673 \begin_inset Quotes eld
17677 \begin_inset Flex Code
17680 \begin_layout Plain Layout
17687 \begin_inset Quotes erd
17691 \begin_inset Flex Code
17694 \begin_layout Plain Layout
17700 is the LyX name of the inset, made lowercase and with non-alphanumeric
17701 characters converted to underscores, for example: footnote.
17704 \begin_layout Description
17705 \begin_inset Flex Code
17708 \begin_layout Plain Layout
17715 \begin_inset Flex Code
17718 \begin_layout Plain Layout
17728 ] Whether to output the default CSS information LyX generates for this layout,
17729 even if additional information is explicitly provided via
17730 \begin_inset Flex Code
17733 \begin_layout Plain Layout
17741 \begin_inset Flex Code
17744 \begin_layout Plain Layout
17750 allows you to alter or augment the generated CSS, rather than to override
17755 \begin_layout Description
17756 \begin_inset Flex Code
17759 \begin_layout Plain Layout
17766 \begin_inset Flex Code
17769 \begin_layout Plain Layout
17775 ] Attributes for the inner tag.
17777 \begin_inset Quotes eld
17781 \begin_inset Flex Code
17784 \begin_layout Plain Layout
17785 class=`insetname_inner'
17791 \begin_inset Quotes erd
17797 \begin_layout Description
17798 \begin_inset Flex Code
17801 \begin_layout Plain Layout
17808 \begin_inset Flex Code
17811 \begin_layout Plain Layout
17817 ] The inner tag, replacing
17818 \begin_inset Flex Code
17821 \begin_layout Plain Layout
17827 in the examples above.
17828 By default, there is none.
17831 \begin_layout Description
17832 \begin_inset Flex Code
17835 \begin_layout Plain Layout
17842 \begin_inset Flex Code
17845 \begin_layout Plain Layout
17853 ] Whether this inset represents a standalone block of text (such as a footnote)
17854 or instead represents material that is included in the surrounding text
17855 (such as a branch).
17859 \begin_layout Description
17860 \begin_inset Flex Code
17863 \begin_layout Plain Layout
17870 \begin_inset Flex Code
17873 \begin_layout Plain Layout
17879 ] A label for this inset, possibly including a reference to a counter.
17880 For example, for footnote, it might be:
17881 \begin_inset Flex Code
17884 \begin_layout Plain Layout
17893 This is optional, and there is no default.
17896 \begin_layout Description
17897 \begin_inset Flex Code
17900 \begin_layout Plain Layout
17906 Information to be output in the
17907 \begin_inset Flex Code
17910 \begin_layout Plain Layout
17916 section when this style is used.
17917 This might, for example, be used to include a
17918 \begin_inset Flex Code
17921 \begin_layout Plain Layout
17928 \begin_inset Flex Code
17931 \begin_layout Plain Layout
17940 \begin_layout Description
17941 \begin_inset Flex Code
17944 \begin_layout Plain Layout
17950 CSS style information to be included when this style is used.
17951 Note that this will automatically be wrapped in a layout-generated
17952 \begin_inset Flex Code
17955 \begin_layout Plain Layout
17961 block, so only the CSS itself need be included.
17964 \begin_layout Description
17965 \begin_inset Flex Code
17968 \begin_layout Plain Layout
17975 \begin_inset Flex Code
17978 \begin_layout Plain Layout
17984 ] The tag to be used for the main label, replacing
17985 \begin_inset Flex Code
17988 \begin_layout Plain Layout
17994 in the examples above.
17995 The default depends upon the setting of
17996 \begin_inset Flex Code
17999 \begin_layout Plain Layout
18006 \begin_inset Flex Code
18009 \begin_layout Plain Layout
18015 is true, the default is
18016 \begin_inset Flex Code
18019 \begin_layout Plain Layout
18025 ; if it is false, the default is
18026 \begin_inset Flex Code
18029 \begin_layout Plain Layout
18038 \begin_layout Subsection
18042 \begin_layout Standard
18043 The XHTML output for floats too can be controlled by layout information.
18044 The output has the following form:
18047 \begin_layout LyX-Code
18049 \begin_inset Quotes erd
18053 \begin_inset Quotes erd
18059 \begin_layout LyX-Code
18060 Contents of the float.
18063 \begin_layout LyX-Code
18067 \begin_layout Standard
18068 The caption, if there is one, is a separate inset and will be output as
18070 Its appearance can be controlled via the InsetLayout for caption insets.
18074 \begin_layout Description
18075 \begin_inset Flex Code
18078 \begin_layout Plain Layout
18085 \begin_inset Flex Code
18088 \begin_layout Plain Layout
18094 ] Specifies attribute information to be output with the main tag.
18096 \begin_inset Quotes eld
18100 \begin_inset Flex Code
18103 \begin_layout Plain Layout
18104 class=`myfloat' onclick=`\SpecialChar \ldots{}
18111 \begin_inset Quotes erd
18115 By default, LyX will output
18116 \begin_inset Quotes eld
18120 \begin_inset Flex Code
18123 \begin_layout Plain Layout
18124 class=`float float-floattype'
18130 \begin_inset Quotes erd
18134 \begin_inset Flex Code
18137 \begin_layout Plain Layout
18143 is LyX's name for this type of float, as determined by the float delcaration
18145 \begin_inset CommandInset ref
18147 reference "sub:Floats"
18151 ), though made lowercase and with non-alphanumeric characters converted
18152 to underscores, for example: float-table.
18155 \begin_layout Description
18156 \begin_inset Flex Code
18159 \begin_layout Plain Layout
18165 CSS style information to be included when this float is used.
18166 Note that this will automatically be wrapped in a layout-generated
18167 \begin_inset Flex Code
18170 \begin_layout Plain Layout
18176 block, so only the CSS itself need be included.
18179 \begin_layout Description
18180 \begin_inset Flex Code
18183 \begin_layout Plain Layout
18190 \begin_inset Flex Code
18193 \begin_layout Plain Layout
18199 ] The tag to be used for this float, replacing
18200 \begin_inset Quotes eld
18204 \begin_inset Flex Code
18207 \begin_layout Plain Layout
18214 \begin_inset Quotes erd
18217 in the example above.
18219 \begin_inset Flex Code
18222 \begin_layout Plain Layout
18228 and will rarely need changing.
18231 \begin_layout Subsection
18232 Bibliography formatting
18235 \begin_layout Standard
18236 The bibliography can be formatted using
18237 \begin_inset Flex Code
18240 \begin_layout Plain Layout
18248 \begin_inset CommandInset ref
18250 reference "sub:Citation-format-description"
18257 \begin_layout Subsection
18261 \begin_layout Standard
18262 We have several times mentioned that LyX will generate default CSS style
18263 rules for both insets and paragraph styles, based upon the other layout
18264 information that is provided.
18265 In this section, we shall say a word about which layout information LyX
18269 \begin_layout Standard
18270 At present, LyX auto-generates CSS only for font information, making use
18272 \begin_inset Flex Code
18275 \begin_layout Plain Layout
18282 \begin_inset Flex Code
18285 \begin_layout Plain Layout
18292 \begin_inset Flex Code
18295 \begin_layout Plain Layout
18302 \begin_inset Flex Code
18305 \begin_layout Plain Layout
18312 \begin_inset Flex Code
18315 \begin_layout Plain Layout
18323 \begin_inset CommandInset ref
18325 reference "sub:Font-description"
18329 .) The translation is mostly straightforward and obvious.
18331 \begin_inset Quotes eld
18335 \begin_inset Flex Code
18338 \begin_layout Plain Layout
18345 \begin_inset Quotes erd
18349 \begin_inset Quotes eld
18353 \begin_inset Flex Code
18356 \begin_layout Plain Layout
18357 font-family: sans-serif;
18363 \begin_inset Quotes erd
18367 The correspondence of LyX sizes and CSS sizes is a little less obvious
18368 but nonetheless intuitive.
18370 \begin_inset Flex Code
18373 \begin_layout Plain Layout
18380 \begin_inset Flex URL
18383 \begin_layout Plain Layout
18394 \begin_layout Chapter
18395 Including External Material
18398 \begin_layout Standard
18399 \begin_inset Box Shadowbox
18409 height_special "totalheight"
18412 \begin_layout Plain Layout
18413 WARNING: This portion of the documentation has not been updated for some
18415 We certainly hope that it is still accurate, but there are no guarantees.
18423 \begin_layout Standard
18424 The use of material from sources external to LyX is covered in detail in
18430 This part of the manual covers what needs to happen behind the scenes for
18431 new sorts of material to be included.
18434 \begin_layout Section
18438 \begin_layout Standard
18439 The external material feature is based on the concept of a
18444 A template is a specification of how LyX should interface with a certain
18446 As bundled, LyX comes with predefined templates for Xfig figures, various
18447 raster format images, chess diagrams, and LilyPond music notation.
18448 You can check the actual list by using the menu
18449 \begin_inset Flex MenuItem
18452 \begin_layout Plain Layout
18453 Insert\SpecialChar \menuseparator
18454 File\SpecialChar \menuseparator
18461 Furthermore, it is possible to roll your own template to support a specific
18463 Later we'll describe in more detail what is involved, and hopefully you
18464 will submit all the templates you create so we can include them in a later
18468 \begin_layout Standard
18469 Another basic idea of the external material feature is to distinguish between
18470 the original file that serves as a base for final material and the produced
18471 file that is included in your exported or printed document.
18472 For example, consider the case of a figure produced with
18473 \begin_inset Flex Code
18476 \begin_layout Plain Layout
18483 The Xfig application itself works on an original file with the
18484 \begin_inset Flex Code
18487 \begin_layout Plain Layout
18494 Within Xfig, you create and change your figure, and when you are done,
18496 \begin_inset Flex Code
18499 \begin_layout Plain Layout
18506 When you want to include the figure in your document, you invoke
18507 \begin_inset Flex Code
18510 \begin_layout Plain Layout
18516 in order to create a PostScript file that can readily be included in your
18519 \begin_inset Flex Code
18522 \begin_layout Plain Layout
18528 file is the original file, and the PostScript file is the produced file.
18531 \begin_layout Standard
18532 This distinction is important in order to allow updating of the material
18533 while you are in the process of writing the document.
18534 Furthermore, it provides us with the flexibility that is needed to support
18535 multiple export formats.
18536 For instance, in the case of a plain text file, it is not exactly an award-winn
18537 ing idea to include the figure as raw PostScript.
18538 Instead, you'd either prefer to just include a reference to the figure
18539 or try to invoke some graphics to ASCII converter to make the final result
18540 look similar to the real graphics.
18541 The external material management allows you to do this, because it is parametri
18542 zed on the different export formats that LyX supports.
18545 \begin_layout Standard
18546 Besides supporting the production of different products according to the
18547 exported format, it supports tight integration with editing and viewing
18549 In the case of an Xfig figure, you are able to invoke Xfig on the original
18550 file with a single click from within the external material dialog in LyX,
18551 and also preview the produced PostScript file with Ghostview with another
18553 No more fiddling around with the command line and/or file browsers to locate
18554 and manipulate the original or produced files.
18555 In this way, you are finally able to take full advantage of the many different
18556 applications that are relevant to use when you write your documents, and
18557 ultimately be more productive.
18560 \begin_layout Section
18561 The external template configuration file
18564 \begin_layout Standard
18565 It is relatively easy to add custom external template definitions to LyX.
18566 However, be aware that doing this in an careless manner most probably
18570 introduce an easily exploitable security hole.
18571 So before you do this, please read the discussion about security in section
18573 \begin_inset CommandInset ref
18575 reference "sec:Security-discussion"
18582 \begin_layout Standard
18583 Having said that, we encourage you to submit any interesting templates that
18588 \begin_layout Standard
18589 The external templates are defined in the
18590 \begin_inset Flex Code
18593 \begin_layout Plain Layout
18594 LyXDir/lib/external_templates
18600 You can place your own version in
18601 \begin_inset Flex Code
18604 \begin_layout Plain Layout
18605 UserDir/external_templates
18613 \begin_layout Standard
18614 A typical template looks like this:
18617 \begin_layout LyX-Code
18621 \begin_layout LyX-Code
18622 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18625 \begin_layout LyX-Code
18629 \begin_layout LyX-Code
18633 \begin_layout LyX-Code
18637 \begin_layout LyX-Code
18641 \begin_layout LyX-Code
18645 \begin_layout LyX-Code
18646 AutomaticProduction true
18649 \begin_layout LyX-Code
18653 \begin_layout LyX-Code
18657 \begin_layout LyX-Code
18661 \begin_layout LyX-Code
18662 TransformCommand Rotate RotationLatexCommand
18665 \begin_layout LyX-Code
18666 TransformCommand Resize ResizeLatexCommand
18669 \begin_layout LyX-Code
18670 Product "$$RotateFront$$ResizeFront
18673 \begin_layout LyX-Code
18678 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18681 \begin_layout LyX-Code
18682 $$ResizeBack$$RotateBack"
18685 \begin_layout LyX-Code
18689 \begin_layout LyX-Code
18690 UpdateResult "$$AbsPath$$Basename.pstex_t"
18693 \begin_layout LyX-Code
18694 Requirement "graphicx"
18697 \begin_layout LyX-Code
18698 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18701 \begin_layout LyX-Code
18702 ReferencedFile latex "$$AbsPath$$Basename.eps"
18705 \begin_layout LyX-Code
18706 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18709 \begin_layout LyX-Code
18713 \begin_layout LyX-Code
18717 \begin_layout LyX-Code
18718 TransformCommand Rotate RotationLatexCommand
18721 \begin_layout LyX-Code
18722 TransformCommand Resize ResizeLatexCommand
18725 \begin_layout LyX-Code
18726 Product "$$RotateFront$$ResizeFront
18729 \begin_layout LyX-Code
18734 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18737 \begin_layout LyX-Code
18738 $$ResizeBack$$RotateBack"
18741 \begin_layout LyX-Code
18742 UpdateFormat pdftex
18745 \begin_layout LyX-Code
18746 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18749 \begin_layout LyX-Code
18750 Requirement "graphicx"
18753 \begin_layout LyX-Code
18754 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18757 \begin_layout LyX-Code
18758 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18761 \begin_layout LyX-Code
18765 \begin_layout LyX-Code
18769 \begin_layout LyX-Code
18770 Product "$$Contents(
18772 "$$AbsPath$$Basename.asc
18777 \begin_layout LyX-Code
18778 UpdateFormat asciixfig
18781 \begin_layout LyX-Code
18782 UpdateResult "$$AbsPath$$Basename.asc"
18785 \begin_layout LyX-Code
18789 \begin_layout LyX-Code
18793 \begin_layout LyX-Code
18794 Product "<graphic fileref=
18796 "$$AbsOrRelPathMaster$$Basename.eps
18801 \begin_layout LyX-Code
18805 \begin_layout LyX-Code
18809 \begin_layout LyX-Code
18810 UpdateResult "$$AbsPath$$Basename.eps"
18813 \begin_layout LyX-Code
18814 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18817 \begin_layout LyX-Code
18818 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18821 \begin_layout LyX-Code
18825 \begin_layout LyX-Code
18826 Product "[XFig: $$FName]"
18829 \begin_layout LyX-Code
18833 \begin_layout LyX-Code
18837 \begin_layout Standard
18838 As you can see, the template is enclosed in
18839 \begin_inset Flex Code
18842 \begin_layout Plain Layout
18848 \SpecialChar \ldots{}
18850 \begin_inset Flex Code
18853 \begin_layout Plain Layout
18860 It contains a header specifying some general settings and, for each supported
18861 primary document file format, a section
18862 \begin_inset Flex Code
18865 \begin_layout Plain Layout
18871 \SpecialChar \ldots{}
18873 \begin_inset Flex Code
18876 \begin_layout Plain Layout
18885 \begin_layout Subsection
18886 The template header
18889 \begin_layout Description
18890 \begin_inset Flex Code
18893 \begin_layout Plain Layout
18894 AutomaticProduction
18895 \begin_inset space ~
18903 Whether the file represented by the template must be generated by LyX.
18904 This command must occur exactly once.
18907 \begin_layout Description
18908 \begin_inset Flex Code
18911 \begin_layout Plain Layout
18913 \begin_inset space ~
18921 A glob pattern that is used in the file dialog to filter out the desired
18923 If there is more than one possible file extension (e.
18924 \begin_inset space \thinspace{}
18928 \begin_inset space \space{}
18932 \begin_inset Flex Code
18935 \begin_layout Plain Layout
18942 \begin_inset Flex Code
18945 \begin_layout Plain Layout
18951 ), use something like
18952 \begin_inset Flex Code
18955 \begin_layout Plain Layout
18962 This command must occur exactly once.
18965 \begin_layout Description
18966 \begin_inset Flex Code
18969 \begin_layout Plain Layout
18971 \begin_inset space ~
18979 The text that is displayed on the button.
18980 This command must occur exactly once.
18983 \begin_layout Description
18984 \begin_inset Flex Code
18987 \begin_layout Plain Layout
18989 \begin_inset space ~
18993 \begin_inset space ~
19001 The help text that is used in the External dialog.
19002 Provide enough information to explain to the user just what the template
19003 can provide him with.
19004 This command must occur exactly once.
19007 \begin_layout Description
19008 \begin_inset Flex Code
19011 \begin_layout Plain Layout
19013 \begin_inset space ~
19021 The file format of the original file.
19022 This must be the name of a format that is known to LyX (see section
19023 \begin_inset CommandInset ref
19025 reference "sec:Formats"
19031 \begin_inset Quotes eld
19035 \begin_inset Flex Code
19038 \begin_layout Plain Layout
19045 \begin_inset Quotes erd
19048 if the template can handle original files of more than one format.
19049 LyX will attempt to interrogate the file itself in order to deduce its
19050 format in this case.
19051 This command must occur exactly once.
19054 \begin_layout Description
19055 \begin_inset Flex Code
19058 \begin_layout Plain Layout
19060 \begin_inset space ~
19068 A unique name for the template.
19069 It must not contain substitution macros (see below).
19072 \begin_layout Description
19073 \begin_inset Flex Code
19076 \begin_layout Plain Layout
19078 \begin_inset space ~
19081 Rotate|Resize|Clip|Extra
19086 This command specifies which transformations are supported by this template.
19087 It may occur zero or more times.
19088 This command enables the corresponding tabs in the external dialog.
19090 \begin_inset Flex Code
19093 \begin_layout Plain Layout
19099 command must have either a corresponding
19100 \begin_inset Flex Code
19103 \begin_layout Plain Layout
19110 \begin_inset Flex Code
19113 \begin_layout Plain Layout
19120 \begin_inset Flex Code
19123 \begin_layout Plain Layout
19130 Otherwise the transformation will not be supported by that format.
19133 \begin_layout Subsection
19137 \begin_layout Description
19138 \begin_inset Flex Code
19141 \begin_layout Plain Layout
19143 \begin_inset space ~
19146 LaTeX|PDFLaTeX|PlainText|DocBook
19151 The primary document file format that this format definition is for.
19152 Not every template has a sensible representation in all document file formats.
19153 Please define nevertheless a
19154 \begin_inset Flex Code
19157 \begin_layout Plain Layout
19163 section for all formats.
19164 Use a dummy text when no representation is available.
19165 Then you can at least see a reference to the external material in the exported
19169 \begin_layout Description
19170 \begin_inset Flex Code
19173 \begin_layout Plain Layout
19175 \begin_inset space ~
19179 \begin_inset space ~
19187 This command defines an additional macro
19188 \begin_inset Flex Code
19191 \begin_layout Plain Layout
19197 for substitution in
19198 \begin_inset Flex Code
19201 \begin_layout Plain Layout
19209 \begin_inset Flex Code
19212 \begin_layout Plain Layout
19218 itself may contain substitution macros.
19219 The advantage over using
19220 \begin_inset Flex Code
19223 \begin_layout Plain Layout
19230 \begin_inset Flex Code
19233 \begin_layout Plain Layout
19239 is that the substituted value of
19240 \begin_inset Flex Code
19243 \begin_layout Plain Layout
19249 is sanitized so that it is a valid optional argument in the document format.
19250 This command may occur zero or more times.
19253 \begin_layout Description
19254 \begin_inset Flex Code
19257 \begin_layout Plain Layout
19259 \begin_inset space ~
19267 The text that is inserted in the exported document.
19268 This is actually the most important command and can be quite complex.
19269 This command must occur exactly once.
19272 \begin_layout Description
19273 \begin_inset Flex Code
19276 \begin_layout Plain Layout
19278 \begin_inset space ~
19286 This command specifies a preamble snippet that will be included in the
19288 It has to be defined using
19289 \begin_inset Flex Code
19292 \begin_layout Plain Layout
19298 \SpecialChar \ldots{}
19300 \begin_inset Flex Code
19303 \begin_layout Plain Layout
19310 This command may occur zero or more times.
19313 \begin_layout Description
19314 \begin_inset Flex Code
19317 \begin_layout Plain Layout
19319 \begin_inset space ~
19323 \begin_inset space ~
19331 This command denotes files that are created by the conversion process and
19332 are needed for a particular export format.
19333 If the filename is relative, it is interpreted relative to the master document.
19334 This command may be given zero or more times.
19337 \begin_layout Description
19338 \begin_inset Flex Code
19341 \begin_layout Plain Layout
19343 \begin_inset space ~
19351 The name of a required LaTeX package.
19352 The package is included via
19353 \begin_inset Flex Code
19356 \begin_layout Plain Layout
19364 in the LaTeX preamble.
19365 This command may occur zero or more times.
19368 \begin_layout Description
19369 \begin_inset Flex Code
19372 \begin_layout Plain Layout
19374 \begin_inset space ~
19378 \begin_inset space ~
19381 RotationLatexCommand
19386 This command specifies that the built in LaTeX command should be used for
19388 This command may occur once or not at all.
19391 \begin_layout Description
19392 \begin_inset Flex Code
19395 \begin_layout Plain Layout
19397 \begin_inset space ~
19401 \begin_inset space ~
19409 This command specifies that the built in LaTeX command should be used for
19411 This command may occur once or not at all.
19414 \begin_layout Description
19415 \begin_inset Flex Code
19418 \begin_layout Plain Layout
19420 \begin_inset space ~
19424 \begin_inset space ~
19427 RotationLatexOption
19432 This command specifies that rotation is done via an optional argument.
19433 This command may occur once or not at all.
19436 \begin_layout Description
19437 \begin_inset Flex Code
19440 \begin_layout Plain Layout
19442 \begin_inset space ~
19446 \begin_inset space ~
19454 This command specifies that resizing is done via an optional argument.
19455 This command may occur once or not at all.
19458 \begin_layout Description
19459 \begin_inset Flex Code
19462 \begin_layout Plain Layout
19464 \begin_inset space ~
19468 \begin_inset space ~
19476 This command specifies that clipping is done via an optional argument.
19477 This command may occur once or not at all.
19480 \begin_layout Description
19481 \begin_inset Flex Code
19484 \begin_layout Plain Layout
19486 \begin_inset space ~
19490 \begin_inset space ~
19498 This command specifies that an extra optional argument is used.
19499 This command may occur once or not at all.
19502 \begin_layout Description
19503 \begin_inset Flex Code
19506 \begin_layout Plain Layout
19508 \begin_inset space ~
19516 The file format of the converted file.
19517 This must be the name of a format that is known to LyX (see the
19518 \begin_inset Flex MenuItem
19521 \begin_layout Plain Layout
19526 ools\SpecialChar \menuseparator
19531 references:Conversion
19537 This command must occur exactly once.
19540 \begin_layout Description
19541 \begin_inset Flex Code
19544 \begin_layout Plain Layout
19546 \begin_inset space ~
19554 The file name of the converted file.
19555 The file name must be absolute.
19556 This command must occur exactly once.
19559 \begin_layout Subsection
19560 Preamble definitions
19563 \begin_layout Standard
19564 The external template configuration file may contain additional preamble
19565 definitions enclosed by
19566 \begin_inset Flex Code
19569 \begin_layout Plain Layout
19575 \SpecialChar \ldots{}
19577 \begin_inset Flex Code
19580 \begin_layout Plain Layout
19587 They can be used by the templates in the
19588 \begin_inset Flex Code
19591 \begin_layout Plain Layout
19600 \begin_layout Section
19601 The substitution mechanism
19604 \begin_layout Standard
19605 When the external material facility invokes an external program, it is done
19606 on the basis of a command defined in the template configuration file.
19607 These commands can contain various macros that are expanded before execution.
19608 Execution always take place in the directory of the containing document.
19611 \begin_layout Standard
19612 Also, whenever external material is to be displayed, the name will be produced
19613 by the substitution mechanism, and most other commands in the template
19614 definition support substitution as well.
19617 \begin_layout Standard
19618 The available macros are the following:
19621 \begin_layout Description
19622 \begin_inset Flex Code
19625 \begin_layout Plain Layout
19626 $$AbsOrRelPathMaster
19631 The file path, absolute or relative to the master LyX document.
19634 \begin_layout Description
19635 \begin_inset Flex Code
19638 \begin_layout Plain Layout
19639 $$AbsOrRelPathParent
19644 The file path, absolute or relative to the LyX document.
19647 \begin_layout Description
19648 \begin_inset Flex Code
19651 \begin_layout Plain Layout
19657 The absolute file path.
19660 \begin_layout Description
19661 \begin_inset Flex Code
19664 \begin_layout Plain Layout
19670 The filename without path and without the extension.
19673 \begin_layout Description
19674 \begin_inset Flex Code
19677 \begin_layout Plain Layout
19679 \begin_inset Quotes eld
19683 \begin_inset Quotes erd
19691 This macro will expand to the contents of the file with the name
19692 \begin_inset Flex Code
19695 \begin_layout Plain Layout
19704 \begin_layout Description
19705 \begin_inset Flex Code
19708 \begin_layout Plain Layout
19714 The file extension (including the dot).
19717 \begin_layout Description
19718 \begin_inset Flex Code
19721 \begin_layout Plain Layout
19727 The filename of the file specified in the external material dialog.
19728 This is either an absolute name, or it is relative to the LyX document.
19731 \begin_layout Description
19732 \begin_inset Flex Code
19735 \begin_layout Plain Layout
19742 \begin_inset Flex Code
19745 \begin_layout Plain Layout
19751 (absolute name or relative to the LyX document).
19754 \begin_layout Description
19755 \begin_inset Flex Code
19758 \begin_layout Plain Layout
19764 The file path, relative to the master LyX document.
19767 \begin_layout Description
19768 \begin_inset Flex Code
19771 \begin_layout Plain Layout
19777 The file path, relative to the LyX document.
19780 \begin_layout Description
19781 \begin_inset Flex Code
19784 \begin_layout Plain Layout
19790 This macro will expand to the absolute path of the system directory.
19791 This is typically used to point to the various helper scripts that are
19795 \begin_layout Description
19796 \begin_inset Flex Code
19799 \begin_layout Plain Layout
19805 A name and full path to a temporary file which will be automatically deleted
19806 whenever the containing document is closed, or the external material insertion
19810 \begin_layout Standard
19811 All path macros contain a trailing directory separator, so you can construct
19813 \begin_inset space \thinspace{}
19817 \begin_inset space \space{}
19820 the absolute filename with
19821 \begin_inset Flex Code
19824 \begin_layout Plain Layout
19825 $$AbsPath$$Basename$$Extension
19833 \begin_layout Standard
19834 The macros above are substituted in all commands unless otherwise noted.
19836 \begin_inset Flex Code
19839 \begin_layout Plain Layout
19845 supports additionally the following substitutions if they are enabled by
19847 \begin_inset Flex Code
19850 \begin_layout Plain Layout
19857 \begin_inset Flex Code
19860 \begin_layout Plain Layout
19869 \begin_layout Description
19870 \begin_inset Flex Code
19873 \begin_layout Plain Layout
19879 The front part of the resize command.
19882 \begin_layout Description
19883 \begin_inset Flex Code
19886 \begin_layout Plain Layout
19892 The back part of the resize command.
19895 \begin_layout Description
19896 \begin_inset Flex Code
19899 \begin_layout Plain Layout
19905 The front part of the rotation command.
19908 \begin_layout Description
19909 \begin_inset Flex Code
19912 \begin_layout Plain Layout
19918 The back part of the rotation command.
19921 \begin_layout Standard
19922 The value string of the
19923 \begin_inset Flex Code
19926 \begin_layout Plain Layout
19932 command supports additionally the following substitutions if they are enabled
19934 \begin_inset Flex Code
19937 \begin_layout Plain Layout
19944 \begin_inset Flex Code
19947 \begin_layout Plain Layout
19956 \begin_layout Description
19957 \begin_inset Flex Code
19960 \begin_layout Plain Layout
19969 \begin_layout Description
19970 \begin_inset Flex Code
19973 \begin_layout Plain Layout
19982 \begin_layout Description
19983 \begin_inset Flex Code
19986 \begin_layout Plain Layout
19995 \begin_layout Description
19996 \begin_inset Flex Code
19999 \begin_layout Plain Layout
20005 The rotation option.
20008 \begin_layout Standard
20009 You may ask why there are so many path macros.
20010 There are mainly two reasons:
20013 \begin_layout Enumerate
20014 Relative and absolute file names should remain relative or absolute, respectivel
20016 Users may have reasons to prefer either form.
20017 Relative names are useful for portable documents that should work on different
20018 machines, for example.
20019 Absolute names may be required by some programs.
20022 \begin_layout Enumerate
20023 LaTeX treats relative file names differently than LyX and other programs
20024 in nested included files.
20025 For LyX, a relative file name is always relative to the document that contains
20027 For LaTeX, it is always relative to the master document.
20028 These two definitions are identical if you have only one document, but
20029 differ if you have a master document that includes part documents.
20030 That means that relative filenames must be transformed when presented to
20032 Fortunately LyX does this automatically for you if you choose the right
20036 \begin_layout Standard
20037 So which path macro should be used in new template definitions? The rule
20041 \begin_layout Itemize
20043 \begin_inset Flex Code
20046 \begin_layout Plain Layout
20052 if an absolute path is required.
20055 \begin_layout Itemize
20057 \begin_inset Flex Code
20060 \begin_layout Plain Layout
20061 $$AbsOrRelPathMaster
20066 if the substituted string is some kind of LaTeX input.
20069 \begin_layout Itemize
20071 \begin_inset Flex Code
20074 \begin_layout Plain Layout
20075 $$AbsOrRelPathParent
20080 in order to preserve the user's choice.
20083 \begin_layout Standard
20084 There are special cases where this rule does not work and e.
20085 \begin_inset space \thinspace{}
20089 \begin_inset space \space{}
20092 relative names are needed, but normally it will work just fine.
20093 One example for such a case is the command
20094 \begin_inset Flex Code
20097 \begin_layout Plain Layout
20098 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20103 in the XFig template above: We can't use the absolute name because the
20105 \begin_inset Flex Code
20108 \begin_layout Plain Layout
20114 files needs the relative name in order to rewrite the file content.
20117 \begin_layout Section
20118 Security discussion
20119 \begin_inset CommandInset label
20121 name "sec:Security-discussion"
20128 \begin_layout Standard
20129 The external material feature interfaces with a lot of external programs
20130 and does so automatically, so we have to consider the security implications
20132 In particular, since you have the option of including your own filenames
20133 and/or parameter strings and those are expanded into a command, it seems
20134 that it would be possible to create a malicious document which executes
20135 arbitrary commands when a user views or prints the document.
20136 This is something we definitely want to avoid.
20139 \begin_layout Standard
20140 However, since the external program commands are specified in the template
20141 configuration file only, there are no security issues if LyX is properly
20142 configured with safe templates only.
20143 This is so because the external programs are invoked with the
20144 \begin_inset Flex Code
20147 \begin_layout Plain Layout
20153 -system call rather than the
20154 \begin_inset Flex Code
20157 \begin_layout Plain Layout
20163 system-call, so it's not possible to execute arbitrary commands from the
20164 filename or parameter section via the shell.
20167 \begin_layout Standard
20168 This also implies that you are restricted in what command strings you can
20169 use in the external material templates.
20170 In particular, pipes and redirection are not readily available.
20171 This has to be so if LyX should remain safe.
20172 If you want to use some of the shell features, you should write a safe
20173 script to do this in a controlled manner, and then invoke the script from
20174 the command string.
20178 \begin_layout Standard
20179 It is possible to design a template that interacts directly with the shell,
20180 but since this would allow a malicious user to execute arbitrary commands
20181 by writing clever filenames and/or parameters, we generally recommend that
20182 you only use safe scripts that work with the
20183 \begin_inset Flex Code
20186 \begin_layout Plain Layout
20192 system call in a controlled manner.
20193 Of course, for use in a controlled environment, it can be tempting to just
20194 fall back to use ordinary shell scripts.
20195 If you do so, be aware that you
20199 provide an easily exploitable security hole in your system.
20200 Of course it stands to reason that such unsafe templates will never be
20201 included in the standard LyX distribution, although we do encourage people
20202 to submit new templates in the open source tradition.
20203 But LyX as shipped from the official distribution channels will never have
20207 \begin_layout Standard
20208 Including external material provides a lot of power, and you have to be
20209 careful not to introduce security hazards with this power.
20210 A subtle error in a single line in an innocent looking script can open
20211 the door to huge security problems.
20212 So if you do not fully understand the issues, we recommend that you consult
20213 a knowledgeable security professional or the LyX development team if you
20214 have any questions about whether a given template is safe or not.
20215 And do this before you use it in an uncontrolled environment.