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 true
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
8485 This command deletes an existing float.
8486 This is particularly useful when you want to suppress a float that has
8487 been defined in an input file.
8490 \begin_layout Description
8491 \begin_inset Flex Code
8494 \begin_layout Plain Layout
8500 This command deletes an existing style.
8501 This is particularly useful when you want to suppress a style that has
8502 be defined in an input file.
8505 \begin_layout Description
8506 \begin_inset Flex Code
8509 \begin_layout Plain Layout
8515 A string indicating the file format (as defined in the Preferences dialog)
8516 produced by this class.
8517 It is mainly useful when
8518 \begin_inset Flex Code
8521 \begin_layout Plain Layout
8527 is `literate' and one wants to define a new type of literate document.
8528 This string is reset to `docbook', `latex', or `literate' when the correspondin
8530 \begin_inset Flex Code
8533 \begin_layout Plain Layout
8539 parameter is encountered.
8542 \begin_layout Description
8543 \begin_inset Flex Code
8546 \begin_layout Plain Layout
8552 A string indicating what sort of output documents using this class will
8554 At present, the options are: `docbook', `latex', and `literate'.
8557 \begin_layout Description
8558 \begin_inset Flex Code
8561 \begin_layout Plain Layout
8568 \begin_inset Flex Code
8571 \begin_layout Plain Layout
8580 \begin_inset Flex Code
8583 \begin_layout Plain Layout
8590 \begin_inset Flex Code
8593 \begin_layout Plain Layout
8599 ] The default pagestyle.
8600 Can be changed in the
8601 \begin_inset Flex MenuItem
8604 \begin_layout Plain Layout
8605 Document\SpecialChar \menuseparator
8614 \begin_layout Description
8615 \begin_inset Flex Code
8618 \begin_layout Plain Layout
8624 Sets the preamble for the LaTeX document.
8625 Note that this will completely override any prior
8626 \begin_inset Flex Code
8629 \begin_layout Plain Layout
8636 \begin_inset Flex Code
8639 \begin_layout Plain Layout
8647 \begin_inset Flex Code
8650 \begin_layout Plain Layout
8656 if you just want to add material to the preamble.) Must end with
8657 \begin_inset Quotes eld
8661 \begin_inset Flex Code
8664 \begin_layout Plain Layout
8671 \begin_inset Quotes erd
8677 \begin_layout Description
8678 \begin_inset Flex Code
8681 \begin_layout Plain Layout
8688 \begin_inset Flex Code
8691 \begin_layout Plain Layout
8698 \begin_inset Flex Code
8701 \begin_layout Plain Layout
8710 \begin_inset Flex Code
8713 \begin_layout Plain Layout
8719 ] Whether the class already provides the feature
8720 \begin_inset Flex Code
8723 \begin_layout Plain Layout
8730 A feature is in general the name of a package (
8731 \begin_inset Flex Code
8734 \begin_layout Plain Layout
8741 \begin_inset Flex Code
8744 \begin_layout Plain Layout
8750 , \SpecialChar \ldots{}
8752 \begin_inset Flex Code
8755 \begin_layout Plain Layout
8762 \begin_inset Flex Code
8765 \begin_layout Plain Layout
8771 ,\SpecialChar \ldots{}
8772 ); the complete list of supported features is unfortunately not documented
8773 outside the LyX source code—but see
8774 \begin_inset Flex Code
8777 \begin_layout Plain Layout
8783 if you're interested.
8785 \begin_inset Flex MenuItem
8788 \begin_layout Plain Layout
8789 Help\SpecialChar \menuseparator
8795 also gives an overview of the supported packages.
8798 \begin_layout Description
8799 \begin_inset Flex Code
8802 \begin_layout Plain Layout
8809 \begin_inset Flex Code
8812 \begin_layout Plain Layout
8818 ] Indicates that this layout provides the functionality of the module mentioned,
8819 which should be specified by the filename without the
8820 \begin_inset Flex Code
8823 \begin_layout Plain Layout
8830 This will typically be used if the layout includes the module directly,
8831 rather than using the
8832 \begin_inset Flex Code
8835 \begin_layout Plain Layout
8841 tag to indicate that it ought to be used.
8842 It could also be used in a module that provided an alternate implementation
8843 of the same functionality.
8846 \begin_layout Description
8847 \begin_inset Flex Code
8850 \begin_layout Plain Layout
8857 \begin_inset Flex Code
8860 \begin_layout Plain Layout
8866 ] Whether the class requires the feature
8867 \begin_inset Flex Code
8870 \begin_layout Plain Layout
8877 Multiple features must be separated by commas.
8878 Note that you can only request supported features.
8880 \begin_inset Flex Code
8883 \begin_layout Plain Layout
8889 for a list of these.)
8892 \begin_layout Description
8893 \begin_inset Flex Code
8896 \begin_layout Plain Layout
8902 A string that indicates the width of the right margin on the screen, for
8904 \begin_inset Quotes eld
8908 \begin_inset Quotes erd
8914 \begin_layout Description
8915 \begin_inset Flex Code
8918 \begin_layout Plain Layout
8924 Sets which divisions get numbered.
8926 \begin_inset Flex Code
8929 \begin_layout Plain Layout
8938 \begin_layout Description
8939 \begin_inset Flex Code
8942 \begin_layout Plain Layout
8949 \begin_inset Flex Code
8952 \begin_layout Plain Layout
8961 \begin_inset Flex Code
8964 \begin_layout Plain Layout
8970 ] Whether the class-default should be printing on one or both sides of the
8972 Can be changed in the
8973 \begin_inset Flex MenuItem
8976 \begin_layout Plain Layout
8977 Document\SpecialChar \menuseparator
8986 \begin_layout Description
8987 \begin_inset Flex Code
8990 \begin_layout Plain Layout
8996 This sequence defines a paragraph style.
8997 If the style does not yet exist, it is created; if it does exist, its parameter
9000 \begin_inset Quotes eld
9004 \begin_inset Flex Code
9007 \begin_layout Plain Layout
9014 \begin_inset Quotes erd
9018 \begin_inset Newline newline
9022 \begin_inset space ~
9026 \begin_inset CommandInset ref
9028 reference "sub:Paragraph-Styles"
9032 for details on paragraph styles.
9035 \begin_layout Description
9036 \begin_inset Flex Code
9039 \begin_layout Plain Layout
9046 \begin_inset Flex Code
9049 \begin_layout Plain Layout
9055 ] The name of the command or environment to be used with
9056 \begin_inset Flex Code
9059 \begin_layout Plain Layout
9068 \begin_layout Description
9069 \begin_inset Flex Code
9072 \begin_layout Plain Layout
9079 \begin_inset Flex Code
9082 \begin_layout Plain Layout
9091 \begin_inset Flex Code
9094 \begin_layout Plain Layout
9100 ] Indicates what kind of markup is used to define the title of a document.
9102 \begin_inset Flex Code
9105 \begin_layout Plain Layout
9111 means that the macro with name
9112 \begin_inset Flex Code
9115 \begin_layout Plain Layout
9121 will be inserted after the last layout which has
9122 \begin_inset Quotes eld
9126 \begin_inset Flex Code
9129 \begin_layout Plain Layout
9136 \begin_inset Quotes erd
9141 \begin_inset Flex Code
9144 \begin_layout Plain Layout
9150 corresponds to the case where the block of paragraphs which have
9151 \begin_inset Quotes eld
9155 \begin_inset Flex Code
9158 \begin_layout Plain Layout
9165 \begin_inset Quotes erd
9168 should be enclosed into the
9169 \begin_inset Flex Code
9172 \begin_layout Plain Layout
9181 \begin_layout Description
9182 \begin_inset Flex Code
9185 \begin_layout Plain Layout
9191 Sets which divisions are included in the table of contents.
9193 \begin_inset Flex Code
9196 \begin_layout Plain Layout
9205 \begin_layout Subsection
9206 \begin_inset Flex Code
9209 \begin_layout Plain Layout
9216 \begin_inset CommandInset label
9218 name "sub:ClassOptions"
9225 \begin_layout Standard
9227 \begin_inset Flex Code
9230 \begin_layout Plain Layout
9236 section can contain the following entries:
9239 \begin_layout Description
9240 \begin_inset Flex Code
9243 \begin_layout Plain Layout
9250 \begin_inset Flex Code
9253 \begin_layout Plain Layout
9259 ] The list of available font sizes for the document's main font, separated
9261 \begin_inset Quotes eld
9265 \begin_inset Flex Code
9268 \begin_layout Plain Layout
9275 \begin_inset Quotes erd
9281 \begin_layout Description
9282 \begin_inset Flex Code
9285 \begin_layout Plain Layout
9291 Used to set the DTD line with XML-based output classes.
9293 \begin_inset space \thinspace{}
9297 \begin_inset Quotes eld
9300 -//OASIS//DTD DocBook V4.2//EN
9301 \begin_inset Quotes erd
9307 \begin_layout Description
9308 \begin_inset Flex Code
9311 \begin_layout Plain Layout
9318 \begin_inset Flex Code
9321 \begin_layout Plain Layout
9322 string="empty|plain|headings|fancy"
9327 ] The list of available page styles, separated by
9328 \begin_inset Quotes eld
9332 \begin_inset Flex Code
9335 \begin_layout Plain Layout
9342 \begin_inset Quotes erd
9348 \begin_layout Description
9349 \begin_inset Flex Code
9352 \begin_layout Plain Layout
9359 \begin_inset Flex Code
9362 \begin_layout Plain Layout
9368 ] Some document class options, separated by a comma, that will be added
9369 to the optional part of the
9370 \begin_inset Flex Code
9373 \begin_layout Plain Layout
9384 \begin_layout Standard
9386 \begin_inset Flex Code
9389 \begin_layout Plain Layout
9395 section must end with
9396 \begin_inset Quotes eld
9400 \begin_inset Flex Code
9403 \begin_layout Plain Layout
9410 \begin_inset Quotes erd
9416 \begin_layout Subsection
9418 \begin_inset CommandInset label
9420 name "sub:Paragraph-Styles"
9427 \begin_layout Standard
9428 A paragraph style description looks like this:
9432 \begin_layout Plain Layout
9433 Note that this will either define a new layout or modify an existing one.
9441 \begin_layout LyX-Code
9448 \begin_layout LyX-Code
9452 \begin_layout LyX-Code
9456 \begin_layout Standard
9457 where the following commands are allowed:
9460 \begin_layout Description
9461 \begin_inset Flex Code
9464 \begin_layout Plain Layout
9471 \begin_inset Flex Code
9474 \begin_layout Plain Layout
9479 , left, right, center
9484 ] Paragraph alignment.
9487 \begin_layout Description
9488 \begin_inset Flex Code
9491 \begin_layout Plain Layout
9498 \begin_inset Flex Code
9501 \begin_layout Plain Layout
9506 , left, right, center
9511 ] A comma separated list of permitted alignments.
9512 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9514 For example a right-aligned or centered enumeration isn't possible.)
9517 \begin_layout Description
9518 \begin_inset Flex Code
9521 \begin_layout Plain Layout
9527 Note that this will completely override any prior
9528 \begin_inset Flex Code
9531 \begin_layout Plain Layout
9537 declaration for this style.
9539 \begin_inset Quotes eld
9543 \begin_inset Flex Code
9546 \begin_layout Plain Layout
9553 \begin_inset Quotes erd
9558 \begin_inset CommandInset ref
9560 reference "sub:I18n"
9564 for details on its use.
9567 \begin_layout Description
9568 \begin_inset Flex Code
9571 \begin_layout Plain Layout
9578 \begin_inset Flex Code
9581 \begin_layout Plain Layout
9591 \begin_layout Plain Layout
9592 Note that a `float' here is a real number, such as: 1.5.
9597 The vertical space with which the last of a chain of paragraphs with this
9598 layout is separated from the following paragraph.
9599 If the next paragraph has another layout, the separations are not simply
9600 added, but the maximum is taken.
9603 \begin_layout Description
9604 \begin_inset Flex Code
9607 \begin_layout Plain Layout
9614 \begin_inset Flex Code
9617 \begin_layout Plain Layout
9623 The category for this style.
9624 This is used to group related styles in the Layout combobox on the toolbar.
9625 Any string can be used, but you may want to use existing categories with
9630 \begin_layout Description
9631 \begin_inset Flex Code
9634 \begin_layout Plain Layout
9640 Depth of XML command.
9641 Used only with XML-type formats.
9644 \begin_layout Description
9645 \begin_inset Flex Code
9648 \begin_layout Plain Layout
9655 \begin_inset CommandInset label
9657 name "des:CopyStyle"
9662 \begin_inset Flex Code
9665 \begin_layout Plain Layout
9671 Copies all the features of an existing style into the current one.
9675 \begin_layout Description
9676 \begin_inset Flex Code
9679 \begin_layout Plain Layout
9685 The name of a style whose preamble should be output
9690 This allows to ensure some ordering of the preamble snippets when macros
9691 definitions depend on one another.
9695 \begin_layout Plain Layout
9696 Note that, besides that functionality, there is no way to ensure any ordering
9698 The ordering that you see in a given version of LyX may change without
9699 warning in later versions.
9707 \begin_layout Description
9708 \begin_inset Flex Code
9711 \begin_layout Plain Layout
9718 \begin_inset Flex Code
9721 \begin_layout Plain Layout
9726 , Box, Filled_Box, Static
9731 ] The type of label that stands at the end of the paragraph (or sequence
9733 \begin_inset Flex Code
9736 \begin_layout Plain Layout
9743 \begin_inset Flex Code
9746 \begin_layout Plain Layout
9753 \begin_inset Flex Code
9756 \begin_layout Plain Layout
9763 \begin_inset Flex Code
9766 \begin_layout Plain Layout
9774 \begin_inset Flex Code
9777 \begin_layout Plain Layout
9784 \begin_inset Quotes eld
9788 \begin_inset Quotes erd
9792 \begin_inset Flex Code
9795 \begin_layout Plain Layout
9802 \begin_inset Flex Code
9805 \begin_layout Plain Layout
9806 \begin_inset space ~
9815 \begin_inset space ~
9818 black) square suitable for end of proof markers,
9819 \begin_inset Flex Code
9822 \begin_layout Plain Layout
9828 is an explicit text string.
9831 \begin_layout Description
9832 \begin_inset Flex Code
9835 \begin_layout Plain Layout
9842 \begin_inset Flex Code
9845 \begin_layout Plain Layout
9851 ] The string used for a label with a
9852 \begin_inset Flex Code
9855 \begin_layout Plain Layout
9862 \begin_inset Flex Code
9865 \begin_layout Plain Layout
9875 \begin_layout Description
9876 \begin_inset Flex Code
9879 \begin_layout Plain Layout
9886 \begin_inset Flex Code
9889 \begin_layout Plain Layout
9900 \begin_inset Flex Code
9903 \begin_layout Plain Layout
9912 \begin_layout Description
9913 \begin_inset Flex Code
9916 \begin_layout Plain Layout
9923 \begin_inset Flex Code
9926 \begin_layout Plain Layout
9936 ] With this parameter the
9937 \begin_inset Flex MenuItem
9940 \begin_layout Plain Layout
9947 \begin_inset Quotes eld
9950 Vertical space above
9951 \begin_inset Quotes erd
9955 \begin_inset Flex MenuItem
9958 \begin_layout Plain Layout
9959 Edit\SpecialChar \menuseparator
9961 \begin_inset space ~
9969 dialog can be set when initializing a paragraph with this style.
9973 \begin_layout Plain Layout
9976 Note from Jean-Marc:
9978 I'm not sure that this setting has much use, and it should probably be
9979 removed in later versions.
9987 \begin_layout Description
9988 \begin_inset Flex Code
9991 \begin_layout Plain Layout
9997 The font used for both the text body
10003 \begin_inset space ~
10007 \begin_inset CommandInset ref
10009 reference "sub:Font-description"
10014 Note that defining this font automatically defines the
10015 \begin_inset Flex Code
10018 \begin_layout Plain Layout
10025 So you should define this one first if you also want to define
10026 \begin_inset Flex Code
10029 \begin_layout Plain Layout
10038 \begin_layout Description
10039 \begin_inset Flex Code
10042 \begin_layout Plain Layout
10049 \begin_inset CommandInset label
10051 name "des:FreeSpacing"
10056 \begin_inset Flex Code
10059 \begin_layout Plain Layout
10068 \begin_inset Flex Code
10071 \begin_layout Plain Layout
10077 ] Usually LyX doesn't allow you to insert more than one space between words,
10078 since a space is considered as the separation between two words, not a
10079 character or symbol of its own.
10080 This is a very fine thing but sometimes annoying, for example, when typing
10081 program code or plain LaTeX code.
10083 \begin_inset Flex Code
10086 \begin_layout Plain Layout
10093 Note that LyX will create protected blanks for the additional blanks when
10094 in another mode than LaTeX-mode.
10097 \begin_layout Description
10098 \begin_inset Flex Code
10101 \begin_layout Plain Layout
10107 These tags are used with XHTML output.
10109 \begin_inset CommandInset ref
10111 reference "sub:Paragraph-Style-XHTML"
10118 \begin_layout Description
10119 \begin_inset Flex Code
10122 \begin_layout Plain Layout
10128 [[FIXME]] (Used only with XML-type formats.)
10131 \begin_layout Description
10132 \begin_inset Flex Code
10135 \begin_layout Plain Layout
10142 \begin_inset Flex Code
10145 \begin_layout Plain Layout
10151 If 1, marks the layout as to be included in the document preamble rather
10152 than in the document body.
10153 This is useful for document classes that want such information as the title
10154 and author to appear in the preamble.
10155 Note that this works only for layouts for which the
10156 \begin_inset Flex Code
10159 \begin_layout Plain Layout
10166 \begin_inset Flex Code
10169 \begin_layout Plain Layout
10176 \begin_inset Flex Code
10179 \begin_layout Plain Layout
10188 \begin_layout Description
10189 \begin_inset Flex Code
10192 \begin_layout Plain Layout
10199 \begin_inset Flex Code
10202 \begin_layout Plain Layout
10208 If 1, marks the layout as being part of a title block (see also the
10209 \begin_inset Flex Code
10212 \begin_layout Plain Layout
10219 \begin_inset Flex Code
10222 \begin_layout Plain Layout
10231 \begin_layout Description
10232 \begin_inset Flex Code
10235 \begin_layout Plain Layout
10242 \begin_inset Flex Code
10245 \begin_layout Plain Layout
10251 ] This provides extra space between paragraphs that have the same layout.
10252 If you put other layouts into an environment, each is separated with the
10254 \begin_inset Flex Code
10257 \begin_layout Plain Layout
10264 But the whole items of the environment are additionally separated with
10266 \begin_inset Flex Code
10269 \begin_layout Plain Layout
10276 Note that this is a
10281 \begin_layout Description
10282 \begin_inset Flex Code
10285 \begin_layout Plain Layout
10291 [[FIXME]] (Used only with XML-type formats.)
10294 \begin_layout Description
10295 \begin_inset Flex Code
10298 \begin_layout Plain Layout
10305 \begin_inset CommandInset label
10307 name "des:KeepEmpty"
10312 \begin_inset Flex Code
10315 \begin_layout Plain Layout
10324 \begin_inset Flex Code
10327 \begin_layout Plain Layout
10333 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10334 lead to empty LaTeX output.
10335 There are some cases where this could be desirable however: in a letter
10336 template, the required fields can be provided as empty fields, so that
10337 people do not forget them; in some special classes, a layout can be used
10338 as some kind of break, which does not contain actual text.
10341 \begin_layout Description
10342 \begin_inset Flex Code
10345 \begin_layout Plain Layout
10351 [float=0] The vertical space between the label and the text body.
10352 Only used for labels that are above the text body (
10353 \begin_inset Flex Code
10356 \begin_layout Plain Layout
10363 \begin_inset Flex Code
10366 \begin_layout Plain Layout
10367 Centered_Top_Environment
10375 \begin_layout Description
10376 \begin_inset Flex Code
10379 \begin_layout Plain Layout
10386 \begin_inset Flex Code
10389 \begin_layout Plain Layout
10396 \begin_inset Newline newline
10399 The name of the counter for automatic numbering.
10401 \begin_inset Newline newline
10409 \begin_inset Flex Code
10412 \begin_layout Plain Layout
10419 \begin_inset Flex Code
10422 \begin_layout Plain Layout
10429 In that case, the counter will be stepped each time the layout appears.
10431 \begin_inset Newline newline
10439 \begin_inset Flex Code
10442 \begin_layout Plain Layout
10449 \begin_inset Flex Code
10452 \begin_layout Plain Layout
10458 , though this case is a bit complicated.
10459 Suppose you declare
10460 \begin_inset Quotes eld
10464 \begin_inset Flex Code
10467 \begin_layout Plain Layout
10468 LabelCounter myenum
10474 \begin_inset Quotes erd
10478 Then the actual counters used are
10479 \begin_inset Flex Code
10482 \begin_layout Plain Layout
10489 \begin_inset Flex Code
10492 \begin_layout Plain Layout
10499 \begin_inset Flex Code
10502 \begin_layout Plain Layout
10509 \begin_inset Flex Code
10512 \begin_layout Plain Layout
10518 , much as in LaTeX.
10519 These counters must all be declared separately.
10520 \begin_inset Newline newline
10524 \begin_inset CommandInset ref
10526 reference "sub:Counters"
10530 for details on counters.
10533 \begin_layout Description
10534 \begin_inset Flex Code
10537 \begin_layout Plain Layout
10543 The font used for the label.
10545 \begin_inset space ~
10549 \begin_inset CommandInset ref
10551 reference "sub:Font-description"
10558 \begin_layout Description
10559 \begin_inset Flex Code
10562 \begin_layout Plain Layout
10568 Text that indicates how far a label should be indented.
10571 \begin_layout Description
10572 \begin_inset Flex Code
10575 \begin_layout Plain Layout
10582 \begin_inset Flex Code
10585 \begin_layout Plain Layout
10591 ] The horizontal space between the label and the text body.
10592 Only used for labels that are not above the text body.
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 string used for a label with a
10616 \begin_inset Flex Code
10619 \begin_layout Plain Layout
10627 \begin_inset Flex Code
10630 \begin_layout Plain Layout
10636 is set, this string can be contain the special formatting commands described
10638 \begin_inset CommandInset ref
10640 reference "sub:Counters"
10648 \begin_layout Plain Layout
10649 For the sake of backwards compatibility, the string
10650 \begin_inset Flex Code
10653 \begin_layout Plain Layout
10663 will be replaced by the expanded
10664 \begin_inset Flex Code
10667 \begin_layout Plain Layout
10674 \begin_inset Flex Code
10677 \begin_layout Plain Layout
10686 This feature is now obsolete and should be replaced by the mechanisms of
10688 \begin_inset CommandInset ref
10690 reference "sub:Counters"
10702 \begin_layout Description
10703 \begin_inset Flex Code
10706 \begin_layout Plain Layout
10707 LabelStringAppendix
10713 \begin_inset Flex Code
10716 \begin_layout Plain Layout
10722 ] This is used inside the appendix instead of
10723 \begin_inset Flex Code
10726 \begin_layout Plain Layout
10734 \begin_inset Flex Code
10737 \begin_layout Plain Layout
10744 \begin_inset Flex Code
10747 \begin_layout Plain Layout
10748 LabelStringAppendix
10756 \begin_layout Description
10757 \begin_inset Flex Code
10760 \begin_layout Plain Layout
10766 [FIXME] (Used only with XML-type formats.)
10769 \begin_layout Description
10770 \begin_inset Flex Code
10773 \begin_layout Plain Layout
10780 \begin_inset Flex Code
10783 \begin_layout Plain Layout
10788 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10789 Enumerate, Itemize, Bibliography
10798 \begin_layout Itemize
10799 \begin_inset Flex Code
10802 \begin_layout Plain Layout
10808 means the label is the very first word (up to the first real blank).
10809 Use protected spaces (like
10810 \begin_inset space ~
10813 that one) if you want more than one word as the label.
10817 \begin_layout Itemize
10818 \begin_inset Flex Code
10821 \begin_layout Plain Layout
10827 means the label is simply whatever
10828 \begin_inset Flex Code
10831 \begin_layout Plain Layout
10838 Note that this really is `static'.
10841 \begin_layout Itemize
10842 \begin_inset Flex Code
10845 \begin_layout Plain Layout
10852 \begin_inset Flex Code
10855 \begin_layout Plain Layout
10856 Centered_Top_Environment
10861 are special cases of
10862 \begin_inset Flex Code
10865 \begin_layout Plain Layout
10872 The label will be printed above the paragraph, but only at the top of an
10873 environment or the top of a chain of paragraphs with this layout.
10874 This might be used with the
10875 \begin_inset Flex MenuItem
10878 \begin_layout Plain Layout
10884 layout, for example.
10887 \begin_layout Itemize
10888 \begin_inset Flex Code
10891 \begin_layout Plain Layout
10897 is a special case for the caption-labels
10898 \begin_inset Quotes eld
10902 \begin_inset Quotes erd
10906 \begin_inset Quotes eld
10910 \begin_inset Quotes erd
10915 \begin_inset Flex Code
10918 \begin_layout Plain Layout
10924 means the (hardcoded) label string depends on the kind of float: It is
10925 hardcoded to be `FloatType N', where N is the value of the counter associated
10929 \begin_layout Itemize
10931 \begin_inset Flex Code
10934 \begin_layout Plain Layout
10940 label type defines automatically numbered labels.
10942 \begin_inset Flex Code
10945 \begin_layout Plain Layout
10951 will be expanded to resolve any counter references it contains: For example,
10953 \begin_inset Quotes eld
10957 \begin_inset Flex Code
10960 \begin_layout Plain Layout
10971 \begin_inset Quotes erd
10976 \begin_inset CommandInset ref
10978 reference "sub:Counters"
10982 for more information on counters.
10985 \begin_layout Itemize
10986 \begin_inset Flex Code
10989 \begin_layout Plain Layout
10995 produces the usual sort of enumeration labels.
10996 At present, it is hardcoded to use Arabic numerals, lowercase letters,
10997 small Roman numerals, and uppercase letters for the four possible depths.
11000 \begin_layout Itemize
11001 \begin_inset Flex Code
11004 \begin_layout Plain Layout
11010 produces various bullets at the different levels.
11011 It is also hardcoded.
11014 \begin_layout Itemize
11015 \begin_inset Flex Code
11018 \begin_layout Plain Layout
11024 is used internally by LyX and should be used only with
11025 \begin_inset Flex Code
11028 \begin_layout Plain Layout
11029 LatexType BibEnvironment
11038 \begin_layout Description
11039 \begin_inset Flex Code
11042 \begin_layout Plain Layout
11048 Note that this will completely override any prior
11049 \begin_inset Flex Code
11052 \begin_layout Plain Layout
11058 declaration for this style.
11060 \begin_inset Quotes eld
11064 \begin_inset Flex Code
11067 \begin_layout Plain Layout
11074 \begin_inset Quotes erd
11079 \begin_inset CommandInset ref
11081 reference "sub:I18n"
11085 for details on its use.
11088 \begin_layout Description
11089 \begin_inset Flex Code
11092 \begin_layout Plain Layout
11098 The name of the corresponding LaTeX stuff.
11099 Either the environment or command name.
11102 \begin_layout Description
11103 \begin_inset Flex Code
11106 \begin_layout Plain Layout
11112 An optional parameter for the corresponding
11113 \begin_inset Flex Code
11116 \begin_layout Plain Layout
11123 This parameter cannot be changed from within LyX.
11126 \begin_layout Description
11127 \begin_inset Flex Code
11130 \begin_layout Plain Layout
11137 \begin_inset CommandInset label
11139 name "des:LatexType"
11144 \begin_inset Flex Code
11147 \begin_layout Plain Layout
11152 , Command, Environment, Item_Environment,
11158 \begin_inset Flex Code
11161 \begin_layout Plain Layout
11162 List_Environment, Bib_Environment
11167 ] How the layout should be translated into LaTeX.
11171 \begin_layout Plain Layout
11172 \begin_inset Flex Code
11175 \begin_layout Plain Layout
11181 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11182 Visit the SGML class files for specific examples.
11191 \begin_layout Itemize
11192 \begin_inset Flex Code
11195 \begin_layout Plain Layout
11201 means nothing special.
11205 \begin_layout Itemize
11206 \begin_inset Flex Code
11209 \begin_layout Plain Layout
11216 \begin_inset Flex Code
11219 \begin_layout Plain Layout
11226 {\SpecialChar \ldots{}
11235 \begin_layout Itemize
11236 \begin_inset Flex Code
11239 \begin_layout Plain Layout
11246 \begin_inset Flex Code
11249 \begin_layout Plain Layout
11256 }\SpecialChar \ldots{}
11272 \begin_layout Itemize
11273 \begin_inset Flex Code
11276 \begin_layout Plain Layout
11283 \begin_inset Flex Code
11286 \begin_layout Plain Layout
11293 \begin_inset Flex Code
11296 \begin_layout Plain Layout
11304 is generated for each paragraph of this environment.
11308 \begin_layout Itemize
11309 \begin_inset Flex Code
11312 \begin_layout Plain Layout
11319 \begin_inset Flex Code
11322 \begin_layout Plain Layout
11329 \begin_inset Flex Code
11332 \begin_layout Plain Layout
11338 is passed as an argument to the environment.
11340 \begin_inset Flex Code
11343 \begin_layout Plain Layout
11349 can be defined in the
11350 \begin_inset Flex MenuItem
11353 \begin_layout Plain Layout
11358 ayout\SpecialChar \menuseparator
11372 \begin_layout Standard
11373 Putting the last few things together, the LaTeX output will be either:
11376 \begin_layout LyX-Code
11379 latexname[latexparam]{\SpecialChar \ldots{}
11383 \begin_layout Standard
11387 \begin_layout LyX-Code
11390 begin{latexname}[latexparam] \SpecialChar \ldots{}
11396 \begin_layout Standard
11397 depending upon the LaTeX type.
11401 \begin_layout Description
11402 \begin_inset Flex Code
11405 \begin_layout Plain Layout
11412 \begin_inset Flex Code
11415 \begin_layout Plain Layout
11421 ] If you put layouts into environments, the leftmargins are not simply added,
11422 but added with a factor
11423 \begin_inset Formula $\frac{4}{depth+4}$
11427 Note that this parameter is also used when the margin is defined as
11428 \begin_inset Flex Code
11431 \begin_layout Plain Layout
11438 \begin_inset Flex Code
11441 \begin_layout Plain Layout
11448 Then it is added to the manual or dynamic margin.
11450 \begin_inset Newline newline
11453 The argument is passed as a string.
11455 \begin_inset Quotes eld
11459 \begin_inset Flex Code
11462 \begin_layout Plain Layout
11469 \begin_inset Quotes erd
11472 means that the paragraph is indented with the width of
11473 \begin_inset Quotes eld
11477 \begin_inset Flex Code
11480 \begin_layout Plain Layout
11487 \begin_inset Quotes erd
11490 in the normal font.
11491 You can get a negative width by prefixing the string with
11492 \begin_inset Quotes eld
11496 \begin_inset Flex Code
11499 \begin_layout Plain Layout
11506 \begin_inset Quotes erd
11510 This way was chosen so that the look is the same with each used screen
11515 \begin_layout Description
11516 \begin_inset Flex Code
11519 \begin_layout Plain Layout
11526 \begin_inset Flex Code
11529 \begin_layout Plain Layout
11534 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11540 \begin_inset Newline newline
11543 The kind of margin that the layout has on the left side.
11545 \begin_inset Flex Code
11548 \begin_layout Plain Layout
11554 just means a fixed margin.
11556 \begin_inset Flex Code
11559 \begin_layout Plain Layout
11565 means that the left margin depends on the string entered in the
11566 \begin_inset Flex MenuItem
11569 \begin_layout Plain Layout
11570 Edit\SpecialChar \menuseparator
11572 \begin_inset space ~
11581 This is used to typeset nice lists without tabulators.
11583 \begin_inset Flex Code
11586 \begin_layout Plain Layout
11592 means that the margin depends on the size of the label.
11593 This is used for automatic enumerated headlines.
11594 It is obvious that the headline
11595 \begin_inset Quotes eld
11598 5.4.3.2.1 Very long headline
11599 \begin_inset Quotes erd
11602 must have a wider left margin (as wide as
11603 \begin_inset Quotes eld
11607 \begin_inset Quotes erd
11610 plus the space) than
11611 \begin_inset Quotes eld
11614 3.2 Very long headline
11615 \begin_inset Quotes erd
11619 \begin_inset Quotes eld
11623 \begin_inset Quotes erd
11626 are not able to do this.
11628 \begin_inset Flex Code
11631 \begin_layout Plain Layout
11637 is similar, but only the very first row of the paragraph is dynamic, while
11638 the others are static; this is used, for example, for descriptions.
11640 \begin_inset Flex Code
11643 \begin_layout Plain Layout
11649 means the margin is chosen in a way that the longest row of this paragraph
11650 fits to the right margin.
11651 This is used to typeset an address on the right edge of the page.
11654 \begin_layout Description
11655 \begin_inset Flex Code
11658 \begin_layout Plain Layout
11665 \begin_inset Flex Code
11668 \begin_layout Plain Layout
11677 \begin_inset Flex Code
11680 \begin_layout Plain Layout
11686 ] Whether fragile commands in this layout should be
11687 \begin_inset Flex Code
11690 \begin_layout Plain Layout
11703 whether this command should itself be protected.)
11706 \begin_layout Description
11707 \begin_inset Flex Code
11710 \begin_layout Plain Layout
11717 \begin_inset Flex Code
11720 \begin_layout Plain Layout
11727 \begin_inset Flex Code
11730 \begin_layout Plain Layout
11738 ] Whether newlines are translated into LaTeX newlines (
11739 \begin_inset Flex Code
11742 \begin_layout Plain Layout
11753 The translation can be switched off to allow more comfortable LaTeX editing
11757 \begin_layout Description
11758 \begin_inset Flex Code
11761 \begin_layout Plain Layout
11768 \begin_inset Flex Code
11771 \begin_layout Plain Layout
11778 \begin_inset Flex Code
11781 \begin_layout Plain Layout
11789 ] Whether the following Paragraph is allowed to indent its very first row.
11791 \begin_inset Flex Code
11794 \begin_layout Plain Layout
11800 means that it is not allowed to do so;
11801 \begin_inset Flex Code
11804 \begin_layout Plain Layout
11810 means it could do so if it wants to.
11813 \begin_layout Description
11814 \begin_inset Flex Code
11817 \begin_layout Plain Layout
11823 Name of a layout that has replaced this layout.
11824 This is used to rename a layout, while keeping backward compatibility.
11827 \begin_layout Description
11828 \begin_inset Flex Code
11831 \begin_layout Plain Layout
11838 \begin_inset Flex Code
11841 \begin_layout Plain Layout
11847 ] The number of optional arguments that can be used with this layout.
11848 This is useful for things like section headings, and only makes sense with
11850 Note that, on output, the optional arguments will all precede any required
11851 arguments (see below).
11852 So one can have constructs like:
11856 \begin_layout LyX-Code
11859 mycmd[opt1]{req1}{contents of paragraph}
11862 \begin_layout Standard
11863 but one cannot have things like:
11866 \begin_layout LyX-Code
11869 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11872 \begin_layout Standard
11873 at least, not without ERT (with which you can have anything).
11878 \begin_layout Description
11879 \begin_inset Flex Code
11882 \begin_layout Plain Layout
11889 \begin_inset CommandInset label
11891 name "des:ParbreakIsNewline"
11896 \begin_inset Flex Code
11899 \begin_layout Plain Layout
11908 \begin_inset Flex Code
11911 \begin_layout Plain Layout
11917 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
11918 output, but only by a line break; together with
11919 \begin_inset Flex Code
11922 \begin_layout Plain Layout
11928 , this allows to emulate a plain text editor (like the ERT inset).
11931 \begin_layout Description
11932 \begin_inset Flex Code
11935 \begin_layout Plain Layout
11942 \begin_inset Flex Code
11945 \begin_layout Plain Layout
11951 ] The indent of the very first line of a paragraph.
11953 \begin_inset Flex Code
11956 \begin_layout Plain Layout
11962 will be fixed for a certain layout.
11963 The exception is Standard layout, since the indentation of a Standard layout
11964 paragraph can be prohibited with
11965 \begin_inset Flex Code
11968 \begin_layout Plain Layout
11975 Also, Standard layout paragraphs inside environments use the
11976 \begin_inset Flex Code
11979 \begin_layout Plain Layout
11985 of the environment, not their native one.
11986 For example, Standard paragraphs inside an enumeration are not indented.
11989 \begin_layout Description
11990 \begin_inset Flex Code
11993 \begin_layout Plain Layout
12000 \begin_inset Flex Code
12003 \begin_layout Plain Layout
12009 ] The vertical space between two paragraphs of this layout.
12012 \begin_layout Description
12013 \begin_inset Flex Code
12016 \begin_layout Plain Layout
12023 \begin_inset Flex Code
12026 \begin_layout Plain Layout
12032 ] LyX allows the user to choose either
12033 \begin_inset Quotes eld
12037 \begin_inset Quotes erd
12041 \begin_inset Quotes eld
12045 \begin_inset Quotes erd
12048 to typeset a document.
12050 \begin_inset Quotes eld
12054 \begin_inset Quotes erd
12057 is chosen, this value is completely ignored.
12059 \begin_inset Quotes eld
12063 \begin_inset Quotes erd
12066 is chosen, the parindent of a LaTeXtype
12067 \begin_inset Quotes eld
12071 \begin_inset Quotes erd
12074 layout is ignored and all paragraphs are separated by this parskip argument.
12075 The vertical space is calculated with
12076 \begin_inset Flex Code
12079 \begin_layout Plain Layout
12081 \begin_inset space ~
12090 \begin_inset Flex Code
12093 \begin_layout Plain Layout
12099 is the height of a row with the normal font.
12100 This way, the look stays the same with different screen fonts.
12103 \begin_layout Description
12104 \begin_inset Flex Code
12107 \begin_layout Plain Layout
12114 \begin_inset CommandInset label
12116 name "des:PassThru"
12121 \begin_inset Flex Code
12124 \begin_layout Plain Layout
12133 \begin_inset Flex Code
12136 \begin_layout Plain Layout
12142 ] Whether the contents of this paragraph should be output in raw form, meaning
12143 without special translations that LaTeX would require.
12146 \begin_layout Description
12147 \begin_inset Flex Code
12150 \begin_layout Plain Layout
12157 \begin_inset CommandInset label
12159 name "des:Preamble"
12163 Information to be included in the LaTeX preamble when this style is used.
12164 Used to define macros, load packages, etc., required by this particular
12167 \begin_inset Quotes eld
12171 \begin_inset Flex Code
12174 \begin_layout Plain Layout
12181 \begin_inset Quotes erd
12187 \begin_layout Description
12188 \begin_inset Flex Code
12191 \begin_layout Plain Layout
12198 \begin_inset Flex Code
12201 \begin_layout Plain Layout
12207 ] The prefix to use when creating labels referring to paragraphs of this
12209 This allows the use of formatted references.
12212 \begin_layout Description
12213 \begin_inset Flex Code
12216 \begin_layout Plain Layout
12223 \begin_inset Flex Code
12226 \begin_layout Plain Layout
12232 ] The number of required arguments that the LaTeX command or environment
12233 corresponding to this layout expects.
12234 In the case of a command, these are required arguments
12238 that associated with the content of the paragraph itself.
12239 These do not actually have to be provided: LyX will output empty arguments
12241 Note that optional arguments will be output before required arguments.
12242 See the discussion of the
12243 \begin_inset Flex Code
12246 \begin_layout Plain Layout
12252 tag above for more information.
12255 \begin_layout Description
12256 \begin_inset Flex Code
12259 \begin_layout Plain Layout
12266 \begin_inset Flex Code
12269 \begin_layout Plain Layout
12276 \begin_inset CommandInset label
12278 name "des:Requires"
12282 Whether the layout requires the feature
12283 \begin_inset Flex Code
12286 \begin_layout Plain Layout
12293 See the description of
12294 \begin_inset Flex Code
12297 \begin_layout Plain Layout
12304 \begin_inset CommandInset ref
12305 LatexCommand pageref
12306 reference "des:FreeSpacing"
12310 ) for information on `features'.
12314 \begin_layout Description
12315 \begin_inset Flex Code
12318 \begin_layout Plain Layout
12325 \begin_inset Flex Code
12328 \begin_layout Plain Layout
12335 \begin_inset Flex Code
12338 \begin_layout Plain Layout
12347 \begin_layout Description
12348 \begin_inset Flex Code
12351 \begin_layout Plain Layout
12358 \begin_inset Flex Code
12361 \begin_layout Plain Layout
12366 , onehalf, double, other
12375 ] This defines what the default spacing should be in the layout.
12377 \begin_inset Flex Code
12380 \begin_layout Plain Layout
12387 \begin_inset Flex Code
12390 \begin_layout Plain Layout
12397 \begin_inset Flex Code
12400 \begin_layout Plain Layout
12406 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12407 If you specify the argument
12408 \begin_inset Flex Code
12411 \begin_layout Plain Layout
12417 , then you should also provide a numerical argument which will be the actual
12419 Note that, contrary to other parameters,
12420 \begin_inset Flex Code
12423 \begin_layout Plain Layout
12429 implies the generation of specific LaTeX code, using the package
12432 \begin_inset Flex Code
12435 \begin_layout Plain Layout
12444 \begin_layout Description
12445 \begin_inset Flex Code
12448 \begin_layout Plain Layout
12455 \begin_inset Flex Code
12458 \begin_layout Plain Layout
12465 \begin_inset Flex Code
12468 \begin_layout Plain Layout
12476 ] Spellcheck paragraphs of this style.
12480 \begin_layout Description
12481 \begin_inset Flex Code
12484 \begin_layout Plain Layout
12490 The font used for the text body .
12492 \begin_inset CommandInset ref
12494 reference "sub:Font-description"
12501 \begin_layout Description
12502 \begin_inset Flex Code
12505 \begin_layout Plain Layout
12514 \begin_inset Flex Code
12517 \begin_layout Plain Layout
12527 The level of the style in the table of contents.
12528 This is used for automatic numbering of section headings.
12531 \begin_layout Description
12532 \begin_inset Flex Code
12535 \begin_layout Plain Layout
12542 \begin_inset Flex Code
12545 \begin_layout Plain Layout
12551 ] The vertical space with which the very first of a chain of paragraphs
12552 with this layout is separated from the previous paragraph.
12553 If the previous paragraph has another layout, the separations are not simply
12554 added, but the maximum is taken.
12557 \begin_layout Subsection
12558 \begin_inset CommandInset label
12564 Internationalization of Paragraph Styles
12567 \begin_layout Standard
12568 LyX has long supported internationalization of layout information, but,
12569 until version 2.0, this applied only to the user interface and not to, say,
12571 Thus, French authors were forced to resort to ugly hacks if they wanted
12576 1' instead of `Theorem 1'.
12577 Thanks to Georg Baum, that is no longer the case.
12580 \begin_layout Standard
12582 \begin_inset Flex Code
12585 \begin_layout Plain Layout
12591 defines text that is to appear in the typeset document, it may use
12592 \begin_inset Flex Code
12595 \begin_layout Plain Layout
12602 \begin_inset Flex Code
12605 \begin_layout Plain Layout
12611 to support non-English and even multi-language documents correctly.
12612 The following excerpt (from the
12613 \begin_inset Flex Code
12616 \begin_layout Plain Layout
12622 file) shows how this works:
12625 \begin_layout LyX-Code
12630 \begin_layout LyX-Code
12633 theoremstyle{remark}
12636 \begin_layout LyX-Code
12639 newtheorem{claim}[thm]{
12646 \begin_layout LyX-Code
12650 \begin_layout LyX-Code
12654 \begin_layout LyX-Code
12659 claimname}{_(Claim)}
12662 \begin_layout LyX-Code
12666 \begin_layout LyX-Code
12670 \begin_layout LyX-Code
12679 claimname}{_(Claim)}}
12682 \begin_layout LyX-Code
12687 \begin_layout Standard
12688 In principle, any legal LaTeX may appear in the
12689 \begin_inset Flex Code
12692 \begin_layout Plain Layout
12699 \begin_inset Flex Code
12702 \begin_layout Plain Layout
12708 tags, but in practice they will typically look as they do here.
12709 The key to correct translation of the typeset text is the definition of
12711 \begin_inset Flex Code
12714 \begin_layout Plain Layout
12723 \begin_inset Flex Code
12726 \begin_layout Plain Layout
12738 \begin_layout Standard
12740 \begin_inset Flex Code
12743 \begin_layout Plain Layout
12749 tag provides for internationalization based upon the overall language of
12751 The contents of the tag will be included in the preamble, just as with
12753 \begin_inset Flex Code
12756 \begin_layout Plain Layout
12763 What makes it special is the use of the
12764 \begin_inset Quotes eld
12768 \begin_inset Quotes erd
12772 \begin_inset Flex Code
12775 \begin_layout Plain Layout
12781 , which will be replaced, when LyX produces LaTeX output, with the translation
12782 of its argument into the document language.
12785 \begin_layout Standard
12787 \begin_inset Flex Code
12790 \begin_layout Plain Layout
12796 tag is more complex, since it is meant to provide support for multi-language
12797 documents and so offers an interface to the
12798 \begin_inset Flex Code
12801 \begin_layout Plain Layout
12808 Its contents will be added to the preamble once for each language that
12809 appears in the document.
12810 In this case, the argument to
12811 \begin_inset Flex Code
12814 \begin_layout Plain Layout
12820 will be replaced with its translation into the language in question; the
12822 \begin_inset Flex Code
12825 \begin_layout Plain Layout
12831 is replaced by the language name (as used by the babel package).
12834 \begin_layout Standard
12835 A German document that also included a French section would thus have the
12836 following in the preamble:
12839 \begin_layout LyX-Code
12848 claimname}{Affirmation}}
12856 claimname}{Behauptung}}
12860 claimname}{Behauptung}
12863 \begin_layout Standard
12865 \begin_inset Flex Code
12868 \begin_layout Plain Layout
12874 will then conspire to produce the correct text in the output.
12877 \begin_layout Standard
12878 One important point to note here is that the translations are provided by
12879 LyX itself, through the same mechanism it uses for internationalization
12880 of the user interface.
12881 This means, in effect, that
12882 \begin_inset Flex Code
12885 \begin_layout Plain Layout
12892 \begin_inset Flex Code
12895 \begin_layout Plain Layout
12901 are really only of use in layout files that are provided with LyX, since
12902 text entered in user-created layout files will not be seen by LyX's internation
12903 alization routines.
12904 That said, however, any layout created with the intention that it will
12905 be included with LyX should use these tags where appropriate.
12908 \begin_layout Subsection
12910 \begin_inset CommandInset label
12919 \begin_layout Standard
12920 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12921 define the floats (
12922 \begin_inset Flex MenuItem
12925 \begin_layout Plain Layout
12932 \begin_inset Flex MenuItem
12935 \begin_layout Plain Layout
12941 , \SpecialChar \ldots{}
12942 ) in the text class itself.
12943 Standard floats are included in the file
12944 \begin_inset Flex Code
12947 \begin_layout Plain Layout
12953 , so you may have to do no more than add
12956 \begin_layout LyX-Code
12957 Input stdfloats.inc
12960 \begin_layout Standard
12961 to your layout file.
12962 If you want to implement a text class that proposes some other float types
12963 (like the AGU class bundled with LyX), the information below will hopefully
12967 \begin_layout Description
12968 \begin_inset Flex Code
12971 \begin_layout Plain Layout
12978 \begin_inset Flex Code
12981 \begin_layout Plain Layout
12988 \begin_inset Quotes erd
12992 \begin_inset Quotes erd
12995 ] The file name extension of an auxiliary file for the list of figures (or
12997 LaTeX writes the captions to this file.
13000 \begin_layout Description
13001 \begin_inset Flex Code
13004 \begin_layout Plain Layout
13011 \begin_inset Flex Code
13014 \begin_layout Plain Layout
13021 \begin_inset Quotes erd
13025 \begin_inset Quotes erd
13028 ] The string that will be used in the menus and also for the caption.
13029 This is translated to the current language if babel is used.
13032 \begin_layout Description
13033 \begin_inset Flex Code
13036 \begin_layout Plain Layout
13042 These are used for XHTML output.
13044 \begin_inset CommandInset ref
13046 reference "sec:Tags-for-XHTML"
13053 \begin_layout Description
13054 \begin_inset Flex Code
13057 \begin_layout Plain Layout
13064 \begin_inset Flex Code
13067 \begin_layout Plain Layout
13074 \begin_inset Quotes erd
13078 \begin_inset Quotes erd
13081 ] The command used to generate a list of floats of this type; the leading
13084 ' should be omitted.
13090 \begin_inset Flex Code
13093 \begin_layout Plain Layout
13099 is false, since there is no standard way to generate this command.
13101 \begin_inset Flex Code
13104 \begin_layout Plain Layout
13110 is true, since in that case there is a standard way.
13113 \begin_layout Description
13114 \begin_inset Flex Code
13117 \begin_layout Plain Layout
13124 \begin_inset Flex Code
13127 \begin_layout Plain Layout
13134 \begin_inset Quotes erd
13138 \begin_inset Quotes erd
13141 ] A title for a list of floats of this kind (list of figures, tables, or
13143 It is used for the screen label within LyX; it is passed to LaTeX for use
13144 as the title there; and it is used as the title in XHTML output.
13145 It will be translated to the document language.
13148 \begin_layout Description
13149 \begin_inset Flex Code
13152 \begin_layout Plain Layout
13159 \begin_inset Flex Code
13162 \begin_layout Plain Layout
13169 \begin_inset Flex Code
13172 \begin_layout Plain Layout
13180 ] Indicates whether the float is already defined in the document class or
13181 if we instead need to load
13182 \begin_inset Flex Code
13185 \begin_layout Plain Layout
13191 and use what it provides.
13193 \begin_inset Flex Code
13196 \begin_layout Plain Layout
13203 \begin_inset Flex Code
13206 \begin_layout Plain Layout
13213 It should be set to
13214 \begin_inset Flex Code
13217 \begin_layout Plain Layout
13223 if the float is already defined by the LaTeX document class.
13226 \begin_layout Description
13227 \begin_inset Flex Code
13230 \begin_layout Plain Layout
13237 \begin_inset Flex Code
13240 \begin_layout Plain Layout
13247 \begin_inset Quotes erd
13251 \begin_inset Quotes erd
13254 ] This (optional) argument determines whether floats of this class will
13255 be numbered within some sectional unit of the document.
13256 For example, if within is equal to
13257 \begin_inset Flex Code
13260 \begin_layout Plain Layout
13266 , the floats will be numbered within chapters.
13270 \begin_layout Description
13271 \begin_inset Flex Code
13274 \begin_layout Plain Layout
13281 \begin_inset Flex Code
13284 \begin_layout Plain Layout
13291 \begin_inset Quotes erd
13295 \begin_inset Quotes erd
13298 ] The default placement for the given class of floats.
13299 The string should be as in standard LaTeX:
13300 \begin_inset Flex Code
13303 \begin_layout Plain Layout
13310 \begin_inset Flex Code
13313 \begin_layout Plain Layout
13320 \begin_inset Flex Code
13323 \begin_layout Plain Layout
13330 \begin_inset Flex Code
13333 \begin_layout Plain Layout
13339 for top, bottom, page, and here, respectively.
13343 \begin_layout Plain Layout
13344 Note that the order of these letters in the string is irrelevant, like in
13350 On top of that there is a new type,
13351 \begin_inset Flex Code
13354 \begin_layout Plain Layout
13360 , which does not really correspond to a float, since it means: put it
13361 \begin_inset Quotes eld
13365 \begin_inset Quotes erd
13369 Note however that the
13370 \begin_inset Flex Code
13373 \begin_layout Plain Layout
13379 specifier is special and, because of implementation details, cannot be
13380 used in non-built in float types.
13381 If you do not understand what this means, just use
13382 \begin_inset Quotes eld
13386 \begin_inset Flex Code
13389 \begin_layout Plain Layout
13396 \begin_inset Quotes erd
13402 \begin_layout Description
13403 \begin_inset Flex Code
13406 \begin_layout Plain Layout
13413 \begin_inset Flex Code
13416 \begin_layout Plain Layout
13422 ] The prefix to use when creating labels referring to floats of this type.
13423 This allows the use of formatted references.
13424 Note that you can remove any
13425 \begin_inset Flex Code
13428 \begin_layout Plain Layout
13434 set by a copied style by using the special value
13435 \begin_inset Quotes eld
13439 \begin_inset Quotes erd
13442 , which must be all caps.
13445 \begin_layout Description
13446 \begin_inset Flex Code
13449 \begin_layout Plain Layout
13456 \begin_inset Flex Code
13459 \begin_layout Plain Layout
13466 \begin_inset Quotes erd
13470 \begin_inset Quotes erd
13473 ] The style used when defining the float using
13474 \begin_inset Flex Code
13477 \begin_layout Plain Layout
13488 \begin_layout Description
13489 \begin_inset Flex Code
13492 \begin_layout Plain Layout
13499 \begin_inset Flex Code
13502 \begin_layout Plain Layout
13509 \begin_inset Quotes erd
13513 \begin_inset Quotes erd
13517 \begin_inset Quotes eld
13521 \begin_inset Quotes erd
13524 of the new class of floats, like program or algorithm.
13525 After the appropriate
13526 \begin_inset Flex Code
13529 \begin_layout Plain Layout
13538 \begin_inset Flex Code
13541 \begin_layout Plain Layout
13550 \begin_inset Flex Code
13553 \begin_layout Plain Layout
13564 \begin_layout Standard
13565 Note that defining a float with type
13566 \begin_inset Flex Code
13569 \begin_layout Plain Layout
13577 automatically defines the corresponding counter with name
13578 \begin_inset Flex Code
13581 \begin_layout Plain Layout
13592 \begin_layout Subsection
13593 Flex insets and InsetLayout
13594 \begin_inset CommandInset label
13596 name "sub:Flex-insets-and"
13603 \begin_layout Standard
13604 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13605 these are called Flex insets.
13609 \begin_layout Standard
13610 Flex insets come in three different kinds:
13613 \begin_layout Itemize
13615 \begin_inset Flex Code
13618 \begin_layout Plain Layout
13624 ): These define semantic markup corresponding to such LaTeX commands as
13626 \begin_inset Flex Code
13629 \begin_layout Plain Layout
13638 \begin_inset Flex Code
13641 \begin_layout Plain Layout
13652 \begin_layout Itemize
13654 \begin_inset Flex Code
13657 \begin_layout Plain Layout
13663 ): These can be used to define custom collapsible insets, similar to TeX
13664 code, footnote, and the like.
13665 An obvious example is an endnote inset, which is defined in the
13666 \begin_inset Flex Code
13669 \begin_layout Plain Layout
13678 \begin_layout Itemize
13680 \begin_inset Flex Code
13683 \begin_layout Plain Layout
13689 ): For use with DocBook classes.
13692 \begin_layout Standard
13693 Flex insets are defined using the
13694 \begin_inset Flex Code
13697 \begin_layout Plain Layout
13703 tag, which shall be explained in a moment.
13706 \begin_layout Standard
13708 \begin_inset Flex Code
13711 \begin_layout Plain Layout
13717 tag also serves another function: It can be used to customize the general
13718 layout of many different types of insets.
13720 \begin_inset Flex Code
13723 \begin_layout Plain Layout
13729 can be used to customize the layout parameters for footnotes, marginal
13730 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13731 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13732 define Flex insets.
13735 \begin_layout Standard
13737 \begin_inset Flex Code
13740 \begin_layout Plain Layout
13746 definition must begin with a line of the form:
13749 \begin_layout LyX-Code
13753 \begin_layout Standard
13755 \begin_inset Flex Code
13758 \begin_layout Plain Layout
13764 indicates the inset whose layout is being defined, and here there are two
13768 \begin_layout Enumerate
13769 The layout for a pre-existing inset is being modified.
13770 In this case, can be
13771 \begin_inset Flex Code
13774 \begin_layout Plain Layout
13780 any one of the following:
13781 \begin_inset Flex Code
13784 \begin_layout Plain Layout
13791 \begin_inset Flex Code
13794 \begin_layout Plain Layout
13801 \begin_inset Flex Code
13804 \begin_layout Plain Layout
13811 \begin_inset Flex Code
13814 \begin_layout Plain Layout
13821 \begin_inset Flex Code
13824 \begin_layout Plain Layout
13831 \begin_inset Flex Code
13834 \begin_layout Plain Layout
13841 \begin_inset Flex Code
13844 \begin_layout Plain Layout
13851 \begin_inset Flex Code
13854 \begin_layout Plain Layout
13861 \begin_inset Flex Code
13864 \begin_layout Plain Layout
13871 \begin_inset Flex Code
13874 \begin_layout Plain Layout
13881 \begin_inset Flex Code
13884 \begin_layout Plain Layout
13891 \begin_inset Flex Code
13894 \begin_layout Plain Layout
13901 \begin_inset Flex Code
13904 \begin_layout Plain Layout
13911 \begin_inset Flex Code
13914 \begin_layout Plain Layout
13921 \begin_inset Flex Code
13924 \begin_layout Plain Layout
13931 \begin_inset Flex Code
13934 \begin_layout Plain Layout
13941 \begin_inset Flex Code
13944 \begin_layout Plain Layout
13951 \begin_inset Flex Code
13954 \begin_layout Plain Layout
13961 \begin_inset Flex Code
13964 \begin_layout Plain Layout
13971 \begin_inset Flex Code
13974 \begin_layout Plain Layout
13983 \begin_layout Enumerate
13984 The layout for a Flex inset is being defined.
13986 \begin_inset Flex Code
13989 \begin_layout Plain Layout
13995 may be be any valid identifier not used by a pre-existing inset.
13996 The identifier may include spaces, but in that case the whole thing must
13997 be wrapped in quotes.
13998 It may also include a namespace identifier, preceding a colon, such as
14000 \begin_inset Quotes eld
14004 \begin_inset Flex Code
14007 \begin_layout Plain Layout
14014 \begin_inset Quotes erd
14018 Note that the definition of a flex inset
14023 \begin_inset Flex Code
14026 \begin_layout Plain Layout
14032 entry, declaring which type of inset it defines.
14035 \begin_layout Standard
14037 \begin_inset Flex Code
14040 \begin_layout Plain Layout
14046 definition can contain the following entries:
14049 \begin_layout Description
14050 \begin_inset Flex Code
14053 \begin_layout Plain Layout
14059 The color for the inset's background.
14060 The valid colors are defined in
14061 \begin_inset Flex Code
14064 \begin_layout Plain Layout
14073 \begin_layout Description
14074 \begin_inset Flex Code
14077 \begin_layout Plain Layout
14084 \begin_inset Flex Code
14087 \begin_layout Plain Layout
14096 \begin_inset Flex Code
14099 \begin_layout Plain Layout
14105 ] Whether to use the content of the inset as the label, when the inset is
14110 \begin_layout Description
14111 \begin_inset Flex Code
14114 \begin_layout Plain Layout
14120 As with paragraph styles (see page
14121 \begin_inset CommandInset ref
14123 reference "des:CopyStyle"
14130 \begin_layout Description
14131 \begin_inset Flex Code
14134 \begin_layout Plain Layout
14141 \begin_inset Flex Code
14144 \begin_layout Plain Layout
14153 \begin_inset Flex Code
14156 \begin_layout Plain Layout
14162 ] Indicates whether the user may employ the Paragraph Settings dialog to
14163 customize the paragraph.
14166 \begin_layout Description
14167 \begin_inset Flex Code
14170 \begin_layout Plain Layout
14177 \begin_inset Flex Code
14180 \begin_layout Plain Layout
14187 \begin_inset Flex Code
14190 \begin_layout Plain Layout
14197 \begin_inset Flex Code
14200 \begin_layout Plain Layout
14206 , describing the rendering style used for the inset's frame and buttons.
14207 Footnotes generally use
14208 \begin_inset Flex Code
14211 \begin_layout Plain Layout
14217 , ERT insets generally
14218 \begin_inset Flex Code
14221 \begin_layout Plain Layout
14227 , and character styles
14228 \begin_inset Flex Code
14231 \begin_layout Plain Layout
14240 \begin_layout Description
14241 \begin_inset Flex Code
14244 \begin_layout Plain Layout
14250 Required at the end of the InsetLayout declarations.
14253 \begin_layout Description
14254 \begin_inset Flex Code
14257 \begin_layout Plain Layout
14263 The font used for both the text body
14269 \begin_inset space ~
14273 \begin_inset CommandInset ref
14275 reference "sub:Font-description"
14280 Note that defining this font automatically defines the
14281 \begin_inset Flex Code
14284 \begin_layout Plain Layout
14290 to the same value, so define this first and define
14291 \begin_inset Flex Code
14294 \begin_layout Plain Layout
14300 later if you want them to be different.
14303 \begin_layout Description
14304 \begin_inset Flex Code
14307 \begin_layout Plain Layout
14314 \begin_inset Quotes eld
14318 \begin_inset Quotes erd
14321 language, leading to Left-to-Right (latin) output, e.
14322 \begin_inset space \thinspace{}
14326 \begin_inset space \space{}
14329 in TeX code or URL.
14333 \begin_layout Description
14334 \begin_inset Flex Code
14337 \begin_layout Plain Layout
14344 \begin_inset Flex Code
14347 \begin_layout Plain Layout
14356 \begin_inset Flex Code
14359 \begin_layout Plain Layout
14365 ] Indicates whether the PlainLayout should be used or, instead, the user
14366 can change the paragraph style used in the inset.
14370 \begin_layout Description
14371 \begin_inset Flex Code
14374 \begin_layout Plain Layout
14380 As with paragraph styles (see page
14381 \begin_inset CommandInset ref
14382 LatexCommand pageref
14383 reference "des:FreeSpacing"
14391 \begin_layout Description
14392 \begin_inset Flex Code
14395 \begin_layout Plain Layout
14401 These tags control XHTML output.
14403 \begin_inset CommandInset ref
14404 LatexCommand formatted
14405 reference "sec:Tags-for-XHTML"
14412 \begin_layout Description
14413 \begin_inset Flex Code
14416 \begin_layout Plain Layout
14423 \begin_inset Flex Code
14426 \begin_layout Plain Layout
14435 \begin_inset Flex Code
14438 \begin_layout Plain Layout
14444 ] Whether to include the contents of this inset in the strings generated
14445 for the `Outline' pane.
14446 One would not, for example, want the content of a footnote in a section
14447 header to be included in the TOC displayed in the outline, but one would
14448 normally want the content of a character style displayed.
14449 Default is false: not to include.
14452 \begin_layout Description
14453 \begin_inset Flex Code
14456 \begin_layout Plain Layout
14462 As with paragraph styles (see page
14463 \begin_inset CommandInset ref
14464 LatexCommand pageref
14465 reference "des:KeepEmpty"
14473 \begin_layout Description
14474 \begin_inset Flex Code
14477 \begin_layout Plain Layout
14483 The font used for the label.
14485 \begin_inset space ~
14489 \begin_inset CommandInset ref
14491 reference "sub:Font-description"
14496 Note that this definition can never appear before
14497 \begin_inset Flex Code
14500 \begin_layout Plain Layout
14506 , lest it be ineffective.
14509 \begin_layout Description
14510 \begin_inset Flex Code
14513 \begin_layout Plain Layout
14519 What will be displayed on the button or elsewhere as the inset label.
14520 Some inset types (TeX code and Branch) modify this label on the fly.
14523 \begin_layout Description
14524 \begin_inset Flex Code
14527 \begin_layout Plain Layout
14533 The name of the corresponding LaTeX stuff.
14534 Either the environment or command name.
14537 \begin_layout Description
14538 \begin_inset Flex Code
14541 \begin_layout Plain Layout
14547 The optional parameter for the corresponding
14548 \begin_inset Flex Code
14551 \begin_layout Plain Layout
14557 stuff, including possible bracket pairs like
14558 \begin_inset Flex Code
14561 \begin_layout Plain Layout
14568 This parameter cannot be changed from within LyX.
14571 \begin_layout Description
14572 \begin_inset Flex Code
14575 \begin_layout Plain Layout
14581 As with paragraph styles (see page
14582 \begin_inset CommandInset ref
14583 LatexCommand pageref
14584 reference "des:LatexType"
14591 \begin_layout Description
14592 \begin_inset Flex Code
14595 \begin_layout Plain Layout
14602 \begin_inset Flex Code
14605 \begin_layout Plain Layout
14612 \begin_inset Flex Code
14615 \begin_layout Plain Layout
14622 \begin_inset Flex Code
14625 \begin_layout Plain Layout
14632 \begin_inset Flex Code
14635 \begin_layout Plain Layout
14641 (indicating a dummy definition ending definitions of charstyles, etc).
14642 This entry is required in and is only meaningful for Flex insets.
14643 Among other things, it determines on which menu this inset will appear.
14645 \begin_inset Flex Code
14648 \begin_layout Plain Layout
14655 \begin_inset Flex Code
14658 \begin_layout Plain Layout
14665 \begin_inset Flex Code
14668 \begin_layout Plain Layout
14676 \begin_inset Flex Code
14679 \begin_layout Plain Layout
14685 can be set to true for charstyle insets, if you wish, by setting it
14690 \begin_inset Flex Code
14693 \begin_layout Plain Layout
14702 \begin_layout Description
14703 \begin_inset Flex Code
14706 \begin_layout Plain Layout
14713 \begin_inset Flex Code
14716 \begin_layout Plain Layout
14725 \begin_inset Flex Code
14728 \begin_layout Plain Layout
14734 ] Whether multiple paragraphs are permitted in this inset.
14736 \begin_inset Flex Code
14739 \begin_layout Plain Layout
14745 to the same value and
14746 \begin_inset Flex Code
14749 \begin_layout Plain Layout
14755 to the opposite value.
14756 These can be reset to other values, if they are used
14761 \begin_inset Flex Code
14764 \begin_layout Plain Layout
14774 \begin_layout Description
14775 \begin_inset Flex Code
14778 \begin_layout Plain Layout
14785 \begin_inset Flex Code
14788 \begin_layout Plain Layout
14797 \begin_inset Flex Code
14800 \begin_layout Plain Layout
14806 ] Whether fragile commands in this layout should be
14807 \begin_inset Flex Code
14810 \begin_layout Plain Layout
14823 whether the command should itself be protected.) Default is false.
14826 \begin_layout Description
14827 \begin_inset Flex Code
14830 \begin_layout Plain Layout
14837 \begin_inset Flex Code
14840 \begin_layout Plain Layout
14849 \begin_inset Flex Code
14852 \begin_layout Plain Layout
14858 ] As with paragraph styles (see page
14859 \begin_inset CommandInset ref
14860 LatexCommand pageref
14861 reference "des:ParbreakIsNewline"
14869 \begin_layout Description
14870 \begin_inset Flex Code
14873 \begin_layout Plain Layout
14880 \begin_inset Flex Code
14883 \begin_layout Plain Layout
14892 \begin_inset Flex Code
14895 \begin_layout Plain Layout
14901 ] As with paragraph styles (see page
14902 \begin_inset CommandInset ref
14903 LatexCommand pageref
14904 reference "des:PassThru"
14912 \begin_layout Description
14913 \begin_inset Flex Code
14916 \begin_layout Plain Layout
14922 As with paragraph styles (see page
14923 \begin_inset CommandInset ref
14924 LatexCommand pageref
14925 reference "des:Preamble"
14932 \begin_layout Description
14933 \begin_inset Flex Code
14936 \begin_layout Plain Layout
14943 \begin_inset Flex Code
14946 \begin_layout Plain Layout
14952 ] The prefix to use when creating labels referring to insets of this type.
14953 This allows the use of formatted references.
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 ] As with paragraph styles (see page
14977 \begin_inset CommandInset ref
14978 LatexCommand pageref
14979 reference "des:Requires"
14986 \begin_layout Description
14987 \begin_inset Flex Code
14990 \begin_layout Plain Layout
14997 \begin_inset Flex Code
15000 \begin_layout Plain Layout
15007 \begin_inset Flex Code
15010 \begin_layout Plain Layout
15018 ] Whether this inset should use the font of its surrounding environment
15020 Default is true: uses its own.
15023 \begin_layout Description
15024 \begin_inset Flex Code
15027 \begin_layout Plain Layout
15034 \begin_inset Flex Code
15037 \begin_layout Plain Layout
15044 \begin_inset Flex Code
15047 \begin_layout Plain Layout
15055 ] Spellcheck the contents of this inset.
15059 \begin_layout Subsection
15061 \begin_inset CommandInset label
15063 name "sub:Counters"
15070 \begin_layout Standard
15071 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15073 \begin_inset Flex MenuItem
15076 \begin_layout Plain Layout
15083 \begin_inset Flex MenuItem
15086 \begin_layout Plain Layout
15092 , \SpecialChar \ldots{}
15093 ) in the text class itself.
15094 The standard counters are defined in the file
15095 \begin_inset Flex Code
15098 \begin_layout Plain Layout
15104 , so you may have to do no more than add
15107 \begin_layout LyX-Code
15108 Input stdcounters.inc
15111 \begin_layout Standard
15112 to your layout file to get them to work.
15113 But if you want to define custom counters, then you can do so.
15114 The counter declaration must begin with:
15117 \begin_layout LyX-Code
15118 Counter CounterName
15121 \begin_layout Standard
15123 \begin_inset Flex Code
15126 \begin_layout Plain Layout
15132 ' is replaced by the name of the counter.
15133 And it must end with
15134 \begin_inset Quotes eld
15138 \begin_inset Flex Code
15141 \begin_layout Plain Layout
15148 \begin_inset Quotes erd
15152 The following parameters can also be used:
15155 \begin_layout Description
15156 \begin_inset Flex Code
15159 \begin_layout Plain Layout
15166 \begin_inset Flex Code
15169 \begin_layout Plain Layout
15176 \begin_inset Quotes erd
15180 \begin_inset Quotes erd
15183 ] When defined, this string defines how the counter is displayed.
15184 Setting this value sets
15185 \begin_inset Flex Code
15188 \begin_layout Plain Layout
15189 LabelStringAppendix
15195 The following special constructs can be used in the string:
15199 \begin_layout Itemize
15200 \begin_inset Flex Code
15203 \begin_layout Plain Layout
15211 will be replaced by the expansion of the
15212 \begin_inset Flex Code
15215 \begin_layout Plain Layout
15222 \begin_inset Flex Code
15225 \begin_layout Plain Layout
15226 LabelStringAppendix
15232 \begin_inset Flex Code
15235 \begin_layout Plain Layout
15245 \begin_layout Itemize
15246 counter values can be expressed using LaTeX-like macros
15247 \begin_inset Flex Code
15250 \begin_layout Plain Layout
15267 \begin_inset Flex Code
15270 \begin_layout Plain Layout
15282 \begin_layout Plain Layout
15292 Actually, the situation is a bit more complicated: any
15311 other than those described below will produce arabic numerals.
15312 It would not be surprising to see this change in the future.
15318 \begin_inset Flex Code
15321 \begin_layout Plain Layout
15327 : 1, 2, 3,\SpecialChar \ldots{}
15329 \begin_inset Flex Code
15332 \begin_layout Plain Layout
15338 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15340 \begin_inset Flex Code
15343 \begin_layout Plain Layout
15349 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15351 \begin_inset Flex Code
15354 \begin_layout Plain Layout
15360 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15362 \begin_inset Flex Code
15365 \begin_layout Plain Layout
15371 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15373 \begin_inset Flex Code
15376 \begin_layout Plain Layout
15382 for hebrew numerals.
15386 \begin_layout Standard
15387 If LabelString is not defined, a default value is constructed as follows:
15388 if the counter has a master counter
15389 \begin_inset Flex Code
15392 \begin_layout Plain Layout
15399 \begin_inset Flex Code
15402 \begin_layout Plain Layout
15409 \begin_inset Flex Code
15412 \begin_layout Plain Layout
15422 is used; otherwise the string
15423 \begin_inset Flex Code
15426 \begin_layout Plain Layout
15437 \begin_layout Description
15438 \begin_inset Flex Code
15441 \begin_layout Plain Layout
15442 LabelStringAppendix
15448 \begin_inset Flex Code
15451 \begin_layout Plain Layout
15458 \begin_inset Quotes erd
15462 \begin_inset Quotes erd
15466 \begin_inset Flex Code
15469 \begin_layout Plain Layout
15475 , but for use in the Appendix.
15478 \begin_layout Description
15479 \begin_inset Flex Code
15482 \begin_layout Plain Layout
15489 \begin_inset Flex Code
15492 \begin_layout Plain Layout
15499 \begin_inset Quotes erd
15503 \begin_inset Quotes erd
15506 ] A format for use with formatted references to this counter.
15507 For example, one might want to have references to section numbers appear
15509 \begin_inset Quotes eld
15513 \begin_inset Quotes erd
15517 The string should contain
15518 \begin_inset Quotes eld
15522 \begin_inset Quotes erd
15526 This will be replaced by the counter number itself.
15527 So, for sections, it would be: Section ##.
15530 \begin_layout Description
15531 \begin_inset Flex Code
15534 \begin_layout Plain Layout
15541 \begin_inset Flex Code
15544 \begin_layout Plain Layout
15551 \begin_inset Quotes erd
15555 \begin_inset Quotes erd
15558 ] If this is set to the name of another counter, the present counter will
15559 be reset every time the other one is increased.
15561 \begin_inset Flex Code
15564 \begin_layout Plain Layout
15571 \begin_inset Flex Code
15574 \begin_layout Plain Layout
15583 \begin_layout Subsection
15585 \begin_inset CommandInset label
15587 name "sub:Font-description"
15594 \begin_layout Standard
15595 A font description looks like this:
15598 \begin_layout LyX-Code
15608 \begin_layout LyX-Code
15612 \begin_layout LyX-Code
15616 \begin_layout Standard
15617 The following commands are available:
15620 \begin_layout Description
15621 \begin_inset Flex Code
15624 \begin_layout Plain Layout
15631 \begin_inset Flex Code
15634 \begin_layout Plain Layout
15643 \begin_inset Flex Code
15646 \begin_layout Plain Layout
15653 \begin_inset Flex Code
15656 \begin_layout Plain Layout
15663 \begin_inset Flex Code
15666 \begin_layout Plain Layout
15673 \begin_inset Flex Code
15676 \begin_layout Plain Layout
15683 \begin_inset Flex Code
15686 \begin_layout Plain Layout
15693 \begin_inset Flex Code
15696 \begin_layout Plain Layout
15703 \begin_inset Flex Code
15706 \begin_layout Plain Layout
15713 \begin_inset Flex Code
15716 \begin_layout Plain Layout
15725 \begin_layout Description
15726 \begin_inset Flex Code
15729 \begin_layout Plain Layout
15736 \begin_inset Flex Code
15739 \begin_layout Plain Layout
15748 \begin_inset Flex Code
15751 \begin_layout Plain Layout
15758 \begin_inset Flex Code
15761 \begin_layout Plain Layout
15770 \begin_layout Description
15771 \begin_inset Flex Code
15774 \begin_layout Plain Layout
15781 \begin_inset Flex Code
15784 \begin_layout Plain Layout
15790 ] Valid arguments are:
15791 \begin_inset Flex Code
15794 \begin_layout Plain Layout
15801 \begin_inset Flex Code
15804 \begin_layout Plain Layout
15811 \begin_inset Flex Code
15814 \begin_layout Plain Layout
15821 \begin_inset Flex Code
15824 \begin_layout Plain Layout
15831 \begin_inset Flex Code
15834 \begin_layout Plain Layout
15841 \begin_inset Flex Code
15844 \begin_layout Plain Layout
15851 Each of these turns on or off the corresponding attribute.
15853 \begin_inset Flex Code
15856 \begin_layout Plain Layout
15862 turns on emphasis, and
15863 \begin_inset Flex Code
15866 \begin_layout Plain Layout
15874 \begin_inset Newline newline
15877 If the latter seems puzzling, remember that the font settings for the present
15878 context are generally inherited from the surrounding context.
15880 \begin_inset Flex Code
15883 \begin_layout Plain Layout
15889 would turn off the emphasis that was anyway in effect, say, in a theorem
15893 \begin_layout Description
15894 \begin_inset Flex Code
15897 \begin_layout Plain Layout
15904 \begin_inset Flex Code
15907 \begin_layout Plain Layout
15916 \begin_inset Flex Code
15919 \begin_layout Plain Layout
15928 \begin_layout Description
15929 \begin_inset Flex Code
15932 \begin_layout Plain Layout
15939 \begin_inset Flex Code
15942 \begin_layout Plain Layout
15951 \begin_inset Flex Code
15954 \begin_layout Plain Layout
15961 \begin_inset Flex Code
15964 \begin_layout Plain Layout
15971 \begin_inset Flex Code
15974 \begin_layout Plain Layout
15983 \begin_layout Description
15984 \begin_inset Flex Code
15987 \begin_layout Plain Layout
15994 \begin_inset Flex Code
15997 \begin_layout Plain Layout
16004 \begin_inset Flex Code
16007 \begin_layout Plain Layout
16014 \begin_inset Flex Code
16017 \begin_layout Plain Layout
16026 \begin_inset Flex Code
16029 \begin_layout Plain Layout
16036 \begin_inset Flex Code
16039 \begin_layout Plain Layout
16046 \begin_inset Flex Code
16049 \begin_layout Plain Layout
16056 \begin_inset Flex Code
16059 \begin_layout Plain Layout
16066 \begin_inset Flex Code
16069 \begin_layout Plain Layout
16078 \begin_layout Subsection
16079 \begin_inset CommandInset label
16081 name "sub:Citation-format-description"
16085 Citation format description
16088 \begin_layout Standard
16090 \begin_inset Flex Code
16093 \begin_layout Plain Layout
16099 blocks are used to describe how bibliographic information should be displayed,
16100 both within LyX itself (in the citation dialog and in tooltips, for example)
16101 and in XHTML output.
16102 Such a block might look like this:
16105 \begin_layout LyX-Code
16109 \begin_layout LyX-Code
16113 \begin_layout LyX-Code
16117 \begin_layout LyX-Code
16121 \begin_layout Standard
16122 The individual lines define how the bibliographic information associated
16123 with an article or book, respectively, is to be displayed, and such a definitio
16124 n can be given for any `entry type' that might be present in a BibTeX file.
16125 LyX defines a default format in the source code that will be used if no
16126 specific definition has been given.
16127 LyX predefines several formats in the file
16128 \begin_inset Flex Code
16131 \begin_layout Plain Layout
16137 , which is included in most of LyX's document classes.
16140 \begin_layout Standard
16141 The definitions use a simple language that allows BibTeX keys to be replaced
16143 Keys should be enclosed in
16144 \begin_inset Flex Code
16147 \begin_layout Plain Layout
16154 \begin_inset Flex Code
16157 \begin_layout Plain Layout
16164 So a simple definition might look like this:
16167 \begin_layout LyX-Code
16169 \begin_inset Quotes eld
16173 \begin_inset Quotes erd
16179 \begin_layout Standard
16180 This would print the author, followed by a comma, followed by the title,
16181 in quotes, followed by a period.
16184 \begin_layout Standard
16185 Of course, sometimes you may want to print a key only if it exists.
16186 This can be done by using a conditional construction, such as:
16187 \begin_inset Flex Code
16190 \begin_layout Plain Layout
16192 \begin_inset space ~
16202 \begin_inset Flex Code
16205 \begin_layout Plain Layout
16211 key exists, then print
16212 \begin_inset Quotes eld
16216 \begin_inset space ~
16220 \begin_inset Quotes erd
16223 followed by the volume key.
16224 It is also possible to have an else clause in the conditional, such as:
16226 \begin_inset Flex Code
16229 \begin_layout Plain Layout
16230 {%author%[[%author%]][[%editor%, ed.]]}
16237 \begin_inset Flex Code
16240 \begin_layout Plain Layout
16246 key is printed if it exists; otherwise, the editor key is printed, followed
16248 \begin_inset Quotes eld
16252 \begin_inset space ~
16256 \begin_inset Quotes erd
16259 Note that the key is again enclosed in
16260 \begin_inset Flex Code
16263 \begin_layout Plain Layout
16269 signs; the entire conditional is enclosed in braces; and the if and else
16270 clauses are enclosed in double brackets,
16271 \begin_inset Quotes eld
16275 \begin_inset Flex Code
16278 \begin_layout Plain Layout
16285 \begin_inset Quotes eld
16289 \begin_inset Quotes eld
16293 \begin_inset Flex Code
16296 \begin_layout Plain Layout
16303 \begin_inset Quotes erd
16307 There must be no space between any of these.
16310 \begin_layout Standard
16311 There is one other piece of syntax available in definitions, which looks
16313 \begin_inset Flex Code
16316 \begin_layout Plain Layout
16323 This defines a piece of formatting information that is to be used when
16325 \begin_inset Quotes eld
16329 \begin_inset Quotes erd
16333 Obviously, we do not want to output HTML tags when writing plain text,
16334 so they should be wrapped in
16335 \begin_inset Quotes eld
16339 \begin_inset Quotes erd
16343 \begin_inset Quotes eld
16347 \begin_inset Quotes erd
16353 \begin_layout Standard
16354 Two special sorts of definitions are also possible in a
16355 \begin_inset Flex Code
16358 \begin_layout Plain Layout
16365 An example of the first would be:
16368 \begin_layout LyX-Code
16370 \begin_inset Quotes eld
16374 \begin_inset Quotes erd
16380 \begin_layout Standard
16381 This is an abbreviation, or macro, and it can be used by treating it as
16383 \begin_inset Flex Code
16386 \begin_layout Plain Layout
16394 \begin_inset Flex Code
16397 \begin_layout Plain Layout
16403 exactly as it would treat its definition.
16404 So, let us issue the obvious
16412 \begin_layout LyX-Code
16416 \begin_layout Standard
16417 or anything like it.
16418 LyX shouldn't go into an infinite loop, but it may go into a long one before
16422 \begin_layout Standard
16423 The second sort of special definition might look like this:
16426 \begin_layout LyX-Code
16430 \begin_layout Standard
16431 This defines a translatable piece of text, which allows relevant parts of
16432 the bibliography to be translated.
16433 It can be included in a definition by treating it as a key:
16434 \begin_inset Flex Code
16437 \begin_layout Plain Layout
16444 Several of these are predefined in
16445 \begin_inset Flex Code
16448 \begin_layout Plain Layout
16455 Note that these are not macros, in the sense just defined.
16456 They will not be expanded.
16459 \begin_layout Standard
16460 So here then is an example that use all these features:
16463 \begin_layout LyX-Code
16464 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16467 \begin_layout Standard
16468 The defines a macro that prints the author, followed by a comma, if the
16470 \begin_inset Flex Code
16473 \begin_layout Plain Layout
16479 key is defined, or else prints the name of the editor, followed by the
16481 \begin_inset Flex Code
16484 \begin_layout Plain Layout
16490 or its translation (it is by default
16491 \begin_inset Quotes eld
16495 \begin_inset Quotes erd
16499 \begin_inset Flex Code
16502 \begin_layout Plain Layout
16509 Note that this is in fact defined in
16510 \begin_inset Flex Code
16513 \begin_layout Plain Layout
16519 , so you can use it in your own definitions, or re-definitions, if you load
16523 \begin_layout Section
16524 \begin_inset CommandInset label
16526 name "sec:Tags-for-XHTML"
16530 Tags for XHTML output
16533 \begin_layout Standard
16534 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16535 by layout information.
16536 In general, LyX provides sensible defaults and, as mentioned earlier, it
16537 will even construct default CSS style rules from the other layout tags.
16538 For example, LyX will attempt to use the information provided in the
16539 \begin_inset Flex Code
16542 \begin_layout Plain Layout
16548 declaration for the Chapter style to write CSS that will appropriately
16549 format chapter headings.
16552 \begin_layout Standard
16553 In many cases, then, you may not have to do anything at all to get acceptable
16554 XHTML output for your own environments, custom insets, and so forth.
16555 But in some cases you will, and so LyX provides a number of layout tags
16556 that can be used to customize the XHTML and CSS that are generated.
16559 \begin_layout Standard
16560 Note that there are two tags,
16561 \begin_inset Flex Code
16564 \begin_layout Plain Layout
16571 \begin_inset Flex Code
16574 \begin_layout Plain Layout
16580 that may appear outside style and inset declarations.
16582 \begin_inset CommandInset ref
16584 reference "sub:General-text-class"
16588 for details on these.
16591 \begin_layout Subsection
16592 \begin_inset CommandInset label
16594 name "sub:Paragraph-Style-XHTML"
16601 \begin_layout Standard
16602 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16603 dealing with a normal paragraph, a command, or an environment, where this
16604 is itself determined by the contents of the corresponding
16605 \begin_inset Flex Code
16608 \begin_layout Plain Layout
16618 \begin_layout Standard
16619 For a command or normal paragraph, the output XHTML has the following form:
16622 \begin_layout LyX-Code
16624 \begin_inset Quotes erd
16628 \begin_inset Quotes erd
16634 \begin_layout LyX-Code
16636 \begin_inset Quotes erd
16640 \begin_inset Quotes erd
16646 \begin_layout LyX-Code
16647 Contents of the paragraph.
16650 \begin_layout LyX-Code
16654 \begin_layout Standard
16655 The label tags are of course omitted if the paragraph does not have a label.
16658 \begin_layout Standard
16659 For an environment that is not some sort of list, the XHTML takes this form:
16662 \begin_layout LyX-Code
16664 \begin_inset Quotes erd
16668 \begin_inset Quotes erd
16674 \begin_layout LyX-Code
16676 \begin_inset Quotes erd
16680 \begin_inset Quotes erd
16684 \begin_inset Quotes erd
16688 \begin_inset Quotes erd
16691 >Environment Label</labeltag>First paragraph.</itemtag>
16694 \begin_layout LyX-Code
16695 <itemtag>Second paragraph.</itemtag>
16698 \begin_layout LyX-Code
16702 \begin_layout Standard
16703 Note that the label is output only for the first paragraph, as it should
16704 be for a theorem, for example.
16708 \begin_layout Standard
16709 For a list, we have one of these forms:
16712 \begin_layout LyX-Code
16714 \begin_inset Quotes erd
16718 \begin_inset Quotes erd
16724 \begin_layout LyX-Code
16726 \begin_inset Quotes erd
16730 \begin_inset Quotes erd
16734 \begin_inset Quotes erd
16738 \begin_inset Quotes erd
16741 >List Label</labeltag>First item.</itemtag>
16744 \begin_layout LyX-Code
16746 \begin_inset Quotes erd
16750 \begin_inset Quotes erd
16754 \begin_inset Quotes erd
16758 \begin_inset Quotes erd
16761 >List Label</labeltag>Second item.</itemtag>
16764 \begin_layout LyX-Code
16768 \begin_layout LyX-Code
16772 \begin_layout LyX-Code
16774 \begin_inset Quotes erd
16778 \begin_inset Quotes erd
16784 \begin_layout LyX-Code
16786 \begin_inset Quotes erd
16790 \begin_inset Quotes erd
16793 >List Label</labeltag><itemtag attr=
16794 \begin_inset Quotes erd
16798 \begin_inset Quotes erd
16801 >First item.</itemtag>
16804 \begin_layout LyX-Code
16806 \begin_inset Quotes erd
16810 \begin_inset Quotes erd
16813 >List Label</labeltag><itemtag attr=
16814 \begin_inset Quotes erd
16818 \begin_inset Quotes erd
16821 >Second item.</itemtag>
16824 \begin_layout LyX-Code
16828 \begin_layout Standard
16829 Note the different orders of
16830 \begin_inset Flex Code
16833 \begin_layout Plain Layout
16840 \begin_inset Flex Code
16843 \begin_layout Plain Layout
16850 Which order we get depends upon the setting of
16851 \begin_inset Flex Code
16854 \begin_layout Plain Layout
16861 \begin_inset Flex Code
16864 \begin_layout Plain Layout
16870 is false (the default), you get the first of these, with the label within
16871 the item; if true, you get the second, with the label outside the item.
16874 \begin_layout Standard
16875 The specific tags and attributes output for each paragraph type can be controlle
16876 d by means of the layout tags we are about to describe.
16877 As mentioned earlier, however, LyX uses sensible defaults for many of these,
16878 so you often may not need to do very much to get good XHTML output.
16879 Think of the available tags as there so you can tweak things to your liking.
16882 \begin_layout Description
16883 \begin_inset Flex Code
16886 \begin_layout Plain Layout
16893 \begin_inset Flex Code
16896 \begin_layout Plain Layout
16902 ] Specifies attribute information to be output with the main tag.
16904 \begin_inset Quotes eld
16908 \begin_inset Flex Code
16911 \begin_layout Plain Layout
16918 \begin_inset Quotes erd
16922 By default, LyX will output
16923 \begin_inset Quotes eld
16927 \begin_inset Flex Code
16930 \begin_layout Plain Layout
16937 \begin_inset Quotes erd
16941 \begin_inset Flex Code
16944 \begin_layout Plain Layout
16950 is the LyX name of the layout, made lowercase, for example: chapter.
16955 contain any style information.
16957 \begin_inset Flex Code
16960 \begin_layout Plain Layout
16969 \begin_layout Description
16970 \begin_inset Flex Code
16973 \begin_layout Plain Layout
16980 \begin_inset Flex Code
16983 \begin_layout Plain Layout
16993 ] Whether to output the default CSS information LyX generates for this layout,
16994 even if additional information is explicitly provided via
16995 \begin_inset Flex Code
16998 \begin_layout Plain Layout
17006 \begin_inset Flex Code
17009 \begin_layout Plain Layout
17015 allows you to alter or augment the generated CSS, rather than to override
17018 \begin_inset Flex Code
17021 \begin_layout Plain Layout
17030 \begin_layout Description
17031 \begin_inset Flex Code
17034 \begin_layout Plain Layout
17041 \begin_inset Flex Code
17044 \begin_layout Plain Layout
17050 ] The tag to be used for individual paragraphs of environments, replacing
17052 \begin_inset Flex Code
17055 \begin_layout Plain Layout
17061 in the examples above.
17063 \begin_inset Flex Code
17066 \begin_layout Plain Layout
17075 \begin_layout Description
17076 \begin_inset Flex Code
17079 \begin_layout Plain Layout
17086 \begin_inset Flex Code
17089 \begin_layout Plain Layout
17095 ] Attributes for the item tag.
17097 \begin_inset Quotes eld
17101 \begin_inset Flex Code
17104 \begin_layout Plain Layout
17105 class=`layoutname_item'
17111 \begin_inset Quotes erd
17119 contain any style information.
17121 \begin_inset Flex Code
17124 \begin_layout Plain Layout
17133 \begin_layout Description
17134 \begin_inset Flex Code
17137 \begin_layout Plain Layout
17144 \begin_inset Flex Code
17147 \begin_layout Plain Layout
17153 ] The tag to be used for paragraph and item labels, replacing
17154 \begin_inset Flex Code
17157 \begin_layout Plain Layout
17163 in the examples above.
17165 \begin_inset Flex Code
17168 \begin_layout Plain Layout
17175 \begin_inset Flex Code
17178 \begin_layout Plain Layout
17185 \begin_inset Flex Code
17188 \begin_layout Plain Layout
17195 \begin_inset Flex Code
17198 \begin_layout Plain Layout
17199 Centered_Top_Environment
17204 , in which case it defaults to
17205 \begin_inset Flex Code
17208 \begin_layout Plain Layout
17217 \begin_layout Description
17218 \begin_inset Flex Code
17221 \begin_layout Plain Layout
17228 \begin_inset Flex Code
17231 \begin_layout Plain Layout
17237 ] Attributes for the label tag.
17239 \begin_inset Quotes eld
17243 \begin_inset Flex Code
17246 \begin_layout Plain Layout
17247 class=`layoutname_label'
17253 \begin_inset Quotes erd
17261 contain any style information.
17263 \begin_inset Flex Code
17266 \begin_layout Plain Layout
17275 \begin_layout Description
17276 \begin_inset Flex Code
17279 \begin_layout Plain Layout
17286 \begin_inset Flex Code
17289 \begin_layout Plain Layout
17299 ] Meaningful only for list-like environments, this tag controls whether
17300 the label tag is output before or inside the item tag.
17301 This is used, for example, in the description environment, where we want
17303 \begin_inset Flex Code
17306 \begin_layout Plain Layout
17307 <dt>\SpecialChar \ldots{}
17308 </dt><dd>\SpecialChar \ldots{}
17316 \begin_inset Flex Code
17319 \begin_layout Plain Layout
17325 : The label tag is output inside the item tag.
17328 \begin_layout Description
17329 \begin_inset Flex Code
17332 \begin_layout Plain Layout
17338 Information to be output in the
17339 \begin_inset Flex Code
17342 \begin_layout Plain Layout
17348 section when this style is used.
17349 This might, for example, be used to include a
17350 \begin_inset Flex Code
17353 \begin_layout Plain Layout
17360 \begin_inset Flex Code
17363 \begin_layout Plain Layout
17372 \begin_layout Description
17373 \begin_inset Flex Code
17376 \begin_layout Plain Layout
17382 CSS style information to be included when this style is used.
17383 Note that this will automatically be wrapped in a layout-generated
17384 \begin_inset Flex Code
17387 \begin_layout Plain Layout
17393 block, so only the CSS itself need be included.
17396 \begin_layout Description
17397 \begin_inset Flex Code
17400 \begin_layout Plain Layout
17407 \begin_inset Flex Code
17410 \begin_layout Plain Layout
17416 ] The tag to be used for the main label, replacing
17417 \begin_inset Flex Code
17420 \begin_layout Plain Layout
17426 in the examples above.
17428 \begin_inset Flex Code
17431 \begin_layout Plain Layout
17440 \begin_layout Description
17441 \begin_inset Flex Code
17444 \begin_layout Plain Layout
17451 \begin_inset Flex Code
17454 \begin_layout Plain Layout
17464 ] Marks this style as the one to be used to generate the
17465 \begin_inset Flex Code
17468 \begin_layout Plain Layout
17474 tag for the XHTML file.
17475 By default, it is false.
17477 \begin_inset Flex Code
17480 \begin_layout Plain Layout
17486 file sets it to true for the
17487 \begin_inset Flex Code
17490 \begin_layout Plain Layout
17500 \begin_layout Subsection
17504 \begin_layout Standard
17505 The XHTML output of insets can also be controlled by information in layout
17510 \begin_layout Plain Layout
17511 At present, this is true only for
17512 \begin_inset Quotes eld
17516 \begin_inset Quotes erd
17519 insets (insets you can type into) and is not true for
17520 \begin_inset Quotes eld
17524 \begin_inset Quotes erd
17527 insets (insets that are associated with dialog boxes).
17532 Here, too, LyX tries to provide sensible defaults, and it constructs default
17534 But everything can be customized.
17537 \begin_layout Standard
17538 The XHTML LyX outputs for an inset has the following form:
17541 \begin_layout LyX-Code
17543 \begin_inset Quotes erd
17547 \begin_inset Quotes erd
17553 \begin_layout LyX-Code
17554 <labeltag>Label</labeltag>
17557 \begin_layout LyX-Code
17559 \begin_inset Quotes erd
17563 \begin_inset Quotes erd
17566 >Contents of the inset.</innertag>
17569 \begin_layout LyX-Code
17573 \begin_layout Standard
17574 If the inset permits multiple paragraphs---that is, if
17575 \begin_inset Flex Code
17578 \begin_layout Plain Layout
17584 is true---then the contents of the inset will itself be output as paragraphs
17585 formatted according to the styles used for those paragraphs (standard,
17586 quote, and the like).
17587 The label tag is of course omitted if the paragraph does not have a label
17588 and, at present, is always
17589 \begin_inset Flex Code
17592 \begin_layout Plain Layout
17599 The inner tag is optional and, by default, does not appear.
17602 \begin_layout Standard
17603 The specific tags and attributes output for each inset can be controlled
17604 by means of the following layout tags.
17607 \begin_layout Description
17608 \begin_inset Flex Code
17611 \begin_layout Plain Layout
17618 \begin_inset Flex Code
17621 \begin_layout Plain Layout
17627 ] Specifies attribute information to be output with the main tag.
17629 \begin_inset Quotes eld
17633 \begin_inset Flex Code
17636 \begin_layout Plain Layout
17637 class=`myinset' onclick=`\SpecialChar \ldots{}
17644 \begin_inset Quotes erd
17648 By default, LyX will output
17649 \begin_inset Quotes eld
17653 \begin_inset Flex Code
17656 \begin_layout Plain Layout
17663 \begin_inset Quotes erd
17667 \begin_inset Flex Code
17670 \begin_layout Plain Layout
17676 is the LyX name of the inset, made lowercase and with non-alphanumeric
17677 characters converted to underscores, for example: footnote.
17680 \begin_layout Description
17681 \begin_inset Flex Code
17684 \begin_layout Plain Layout
17691 \begin_inset Flex Code
17694 \begin_layout Plain Layout
17704 ] Whether to output the default CSS information LyX generates for this layout,
17705 even if additional information is explicitly provided via
17706 \begin_inset Flex Code
17709 \begin_layout Plain Layout
17717 \begin_inset Flex Code
17720 \begin_layout Plain Layout
17726 allows you to alter or augment the generated CSS, rather than to override
17731 \begin_layout Description
17732 \begin_inset Flex Code
17735 \begin_layout Plain Layout
17742 \begin_inset Flex Code
17745 \begin_layout Plain Layout
17751 ] Attributes for the inner tag.
17753 \begin_inset Quotes eld
17757 \begin_inset Flex Code
17760 \begin_layout Plain Layout
17761 class=`insetname_inner'
17767 \begin_inset Quotes erd
17773 \begin_layout Description
17774 \begin_inset Flex Code
17777 \begin_layout Plain Layout
17784 \begin_inset Flex Code
17787 \begin_layout Plain Layout
17793 ] The inner tag, replacing
17794 \begin_inset Flex Code
17797 \begin_layout Plain Layout
17803 in the examples above.
17804 By default, there is none.
17807 \begin_layout Description
17808 \begin_inset Flex Code
17811 \begin_layout Plain Layout
17818 \begin_inset Flex Code
17821 \begin_layout Plain Layout
17829 ] Whether this inset represents a standalone block of text (such as a footnote)
17830 or instead represents material that is included in the surrounding text
17831 (such as a branch).
17835 \begin_layout Description
17836 \begin_inset Flex Code
17839 \begin_layout Plain Layout
17846 \begin_inset Flex Code
17849 \begin_layout Plain Layout
17855 ] A label for this inset, possibly including a reference to a counter.
17856 For example, for footnote, it might be:
17857 \begin_inset Flex Code
17860 \begin_layout Plain Layout
17869 This is optional, and there is no default.
17872 \begin_layout Description
17873 \begin_inset Flex Code
17876 \begin_layout Plain Layout
17882 Information to be output in the
17883 \begin_inset Flex Code
17886 \begin_layout Plain Layout
17892 section when this style is used.
17893 This might, for example, be used to include a
17894 \begin_inset Flex Code
17897 \begin_layout Plain Layout
17904 \begin_inset Flex Code
17907 \begin_layout Plain Layout
17916 \begin_layout Description
17917 \begin_inset Flex Code
17920 \begin_layout Plain Layout
17926 CSS style information to be included when this style is used.
17927 Note that this will automatically be wrapped in a layout-generated
17928 \begin_inset Flex Code
17931 \begin_layout Plain Layout
17937 block, so only the CSS itself need be included.
17940 \begin_layout Description
17941 \begin_inset Flex Code
17944 \begin_layout Plain Layout
17951 \begin_inset Flex Code
17954 \begin_layout Plain Layout
17960 ] The tag to be used for the main label, replacing
17961 \begin_inset Flex Code
17964 \begin_layout Plain Layout
17970 in the examples above.
17971 The default depends upon the setting of
17972 \begin_inset Flex Code
17975 \begin_layout Plain Layout
17982 \begin_inset Flex Code
17985 \begin_layout Plain Layout
17991 is true, the default is
17992 \begin_inset Flex Code
17995 \begin_layout Plain Layout
18001 ; if it is false, the default is
18002 \begin_inset Flex Code
18005 \begin_layout Plain Layout
18014 \begin_layout Subsection
18018 \begin_layout Standard
18019 The XHTML output for floats too can be controlled by layout information.
18020 The output has the following form:
18023 \begin_layout LyX-Code
18025 \begin_inset Quotes erd
18029 \begin_inset Quotes erd
18035 \begin_layout LyX-Code
18036 Contents of the float.
18039 \begin_layout LyX-Code
18043 \begin_layout Standard
18044 The caption, if there is one, is a separate inset and will be output as
18046 Its appearance can be controlled via the InsetLayout for caption insets.
18050 \begin_layout Description
18051 \begin_inset Flex Code
18054 \begin_layout Plain Layout
18061 \begin_inset Flex Code
18064 \begin_layout Plain Layout
18070 ] Specifies attribute information to be output with the main tag.
18072 \begin_inset Quotes eld
18076 \begin_inset Flex Code
18079 \begin_layout Plain Layout
18080 class=`myfloat' onclick=`\SpecialChar \ldots{}
18087 \begin_inset Quotes erd
18091 By default, LyX will output
18092 \begin_inset Quotes eld
18096 \begin_inset Flex Code
18099 \begin_layout Plain Layout
18100 class=`float float-floattype'
18106 \begin_inset Quotes erd
18110 \begin_inset Flex Code
18113 \begin_layout Plain Layout
18119 is LyX's name for this type of float, as determined by the float delcaration
18121 \begin_inset CommandInset ref
18123 reference "sub:Floats"
18127 ), though made lowercase and with non-alphanumeric characters converted
18128 to underscores, for example: float-table.
18131 \begin_layout Description
18132 \begin_inset Flex Code
18135 \begin_layout Plain Layout
18141 CSS style information to be included when this float is used.
18142 Note that this will automatically be wrapped in a layout-generated
18143 \begin_inset Flex Code
18146 \begin_layout Plain Layout
18152 block, so only the CSS itself need be included.
18155 \begin_layout Description
18156 \begin_inset Flex Code
18159 \begin_layout Plain Layout
18166 \begin_inset Flex Code
18169 \begin_layout Plain Layout
18175 ] The tag to be used for this float, replacing
18176 \begin_inset Quotes eld
18180 \begin_inset Flex Code
18183 \begin_layout Plain Layout
18190 \begin_inset Quotes erd
18193 in the example above.
18195 \begin_inset Flex Code
18198 \begin_layout Plain Layout
18204 and will rarely need changing.
18207 \begin_layout Subsection
18208 Bibliography formatting
18211 \begin_layout Standard
18212 The bibliography can be formatted using
18213 \begin_inset Flex Code
18216 \begin_layout Plain Layout
18224 \begin_inset CommandInset ref
18226 reference "sub:Citation-format-description"
18233 \begin_layout Subsection
18237 \begin_layout Standard
18238 We have several times mentioned that LyX will generate default CSS style
18239 rules for both insets and paragraph styles, based upon the other layout
18240 information that is provided.
18241 In this section, we shall say a word about which layout information LyX
18245 \begin_layout Standard
18246 At present, LyX auto-generates CSS only for font information, making use
18248 \begin_inset Flex Code
18251 \begin_layout Plain Layout
18258 \begin_inset Flex Code
18261 \begin_layout Plain Layout
18268 \begin_inset Flex Code
18271 \begin_layout Plain Layout
18278 \begin_inset Flex Code
18281 \begin_layout Plain Layout
18288 \begin_inset Flex Code
18291 \begin_layout Plain Layout
18299 \begin_inset CommandInset ref
18301 reference "sub:Font-description"
18305 .) The translation is mostly straightforward and obvious.
18307 \begin_inset Quotes eld
18311 \begin_inset Flex Code
18314 \begin_layout Plain Layout
18321 \begin_inset Quotes erd
18325 \begin_inset Quotes eld
18329 \begin_inset Flex Code
18332 \begin_layout Plain Layout
18333 font-family: sans-serif;
18339 \begin_inset Quotes erd
18343 The correspondence of LyX sizes and CSS sizes is a little less obvious
18344 but nonetheless intuitive.
18346 \begin_inset Flex Code
18349 \begin_layout Plain Layout
18356 \begin_inset Flex URL
18359 \begin_layout Plain Layout
18370 \begin_layout Chapter
18371 Including External Material
18374 \begin_layout Standard
18375 \begin_inset Box Shadowbox
18385 height_special "totalheight"
18388 \begin_layout Plain Layout
18389 WARNING: This portion of the documentation has not been updated for some
18391 We certainly hope that it is still accurate, but there are no guarantees.
18399 \begin_layout Standard
18400 The use of material from sources external to LyX is covered in detail in
18406 This part of the manual covers what needs to happen behind the scenes for
18407 new sorts of material to be included.
18410 \begin_layout Section
18414 \begin_layout Standard
18415 The external material feature is based on the concept of a
18420 A template is a specification of how LyX should interface with a certain
18422 As bundled, LyX comes with predefined templates for Xfig figures, various
18423 raster format images, chess diagrams, and LilyPond music notation.
18424 You can check the actual list by using the menu
18425 \begin_inset Flex MenuItem
18428 \begin_layout Plain Layout
18429 Insert\SpecialChar \menuseparator
18430 File\SpecialChar \menuseparator
18437 Furthermore, it is possible to roll your own template to support a specific
18439 Later we'll describe in more detail what is involved, and hopefully you
18440 will submit all the templates you create so we can include them in a later
18444 \begin_layout Standard
18445 Another basic idea of the external material feature is to distinguish between
18446 the original file that serves as a base for final material and the produced
18447 file that is included in your exported or printed document.
18448 For example, consider the case of a figure produced with
18449 \begin_inset Flex Code
18452 \begin_layout Plain Layout
18459 The Xfig application itself works on an original file with the
18460 \begin_inset Flex Code
18463 \begin_layout Plain Layout
18470 Within Xfig, you create and change your figure, and when you are done,
18472 \begin_inset Flex Code
18475 \begin_layout Plain Layout
18482 When you want to include the figure in your document, you invoke
18483 \begin_inset Flex Code
18486 \begin_layout Plain Layout
18492 in order to create a PostScript file that can readily be included in your
18495 \begin_inset Flex Code
18498 \begin_layout Plain Layout
18504 file is the original file, and the PostScript file is the produced file.
18507 \begin_layout Standard
18508 This distinction is important in order to allow updating of the material
18509 while you are in the process of writing the document.
18510 Furthermore, it provides us with the flexibility that is needed to support
18511 multiple export formats.
18512 For instance, in the case of a plain text file, it is not exactly an award-winn
18513 ing idea to include the figure as raw PostScript.
18514 Instead, you'd either prefer to just include a reference to the figure
18515 or try to invoke some graphics to ASCII converter to make the final result
18516 look similar to the real graphics.
18517 The external material management allows you to do this, because it is parametri
18518 zed on the different export formats that LyX supports.
18521 \begin_layout Standard
18522 Besides supporting the production of different products according to the
18523 exported format, it supports tight integration with editing and viewing
18525 In the case of an Xfig figure, you are able to invoke Xfig on the original
18526 file with a single click from within the external material dialog in LyX,
18527 and also preview the produced PostScript file with Ghostview with another
18529 No more fiddling around with the command line and/or file browsers to locate
18530 and manipulate the original or produced files.
18531 In this way, you are finally able to take full advantage of the many different
18532 applications that are relevant to use when you write your documents, and
18533 ultimately be more productive.
18536 \begin_layout Section
18537 The external template configuration file
18540 \begin_layout Standard
18541 It is relatively easy to add custom external template definitions to LyX.
18542 However, be aware that doing this in an careless manner most probably
18546 introduce an easily exploitable security hole.
18547 So before you do this, please read the discussion about security in section
18549 \begin_inset CommandInset ref
18551 reference "sec:Security-discussion"
18558 \begin_layout Standard
18559 Having said that, we encourage you to submit any interesting templates that
18564 \begin_layout Standard
18565 The external templates are defined in the
18566 \begin_inset Flex Code
18569 \begin_layout Plain Layout
18570 LyXDir/lib/external_templates
18576 You can place your own version in
18577 \begin_inset Flex Code
18580 \begin_layout Plain Layout
18581 UserDir/external_templates
18589 \begin_layout Standard
18590 A typical template looks like this:
18593 \begin_layout LyX-Code
18597 \begin_layout LyX-Code
18598 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18601 \begin_layout LyX-Code
18605 \begin_layout LyX-Code
18609 \begin_layout LyX-Code
18613 \begin_layout LyX-Code
18617 \begin_layout LyX-Code
18621 \begin_layout LyX-Code
18622 AutomaticProduction true
18625 \begin_layout LyX-Code
18629 \begin_layout LyX-Code
18633 \begin_layout LyX-Code
18637 \begin_layout LyX-Code
18638 TransformCommand Rotate RotationLatexCommand
18641 \begin_layout LyX-Code
18642 TransformCommand Resize ResizeLatexCommand
18645 \begin_layout LyX-Code
18646 Product "$$RotateFront$$ResizeFront
18649 \begin_layout LyX-Code
18654 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18657 \begin_layout LyX-Code
18658 $$ResizeBack$$RotateBack"
18661 \begin_layout LyX-Code
18665 \begin_layout LyX-Code
18666 UpdateResult "$$AbsPath$$Basename.pstex_t"
18669 \begin_layout LyX-Code
18670 Requirement "graphicx"
18673 \begin_layout LyX-Code
18674 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18677 \begin_layout LyX-Code
18678 ReferencedFile latex "$$AbsPath$$Basename.eps"
18681 \begin_layout LyX-Code
18682 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18685 \begin_layout LyX-Code
18689 \begin_layout LyX-Code
18693 \begin_layout LyX-Code
18694 TransformCommand Rotate RotationLatexCommand
18697 \begin_layout LyX-Code
18698 TransformCommand Resize ResizeLatexCommand
18701 \begin_layout LyX-Code
18702 Product "$$RotateFront$$ResizeFront
18705 \begin_layout LyX-Code
18710 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18713 \begin_layout LyX-Code
18714 $$ResizeBack$$RotateBack"
18717 \begin_layout LyX-Code
18718 UpdateFormat pdftex
18721 \begin_layout LyX-Code
18722 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18725 \begin_layout LyX-Code
18726 Requirement "graphicx"
18729 \begin_layout LyX-Code
18730 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18733 \begin_layout LyX-Code
18734 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18737 \begin_layout LyX-Code
18741 \begin_layout LyX-Code
18745 \begin_layout LyX-Code
18746 Product "$$Contents(
18748 "$$AbsPath$$Basename.asc
18753 \begin_layout LyX-Code
18754 UpdateFormat asciixfig
18757 \begin_layout LyX-Code
18758 UpdateResult "$$AbsPath$$Basename.asc"
18761 \begin_layout LyX-Code
18765 \begin_layout LyX-Code
18769 \begin_layout LyX-Code
18770 Product "<graphic fileref=
18772 "$$AbsOrRelPathMaster$$Basename.eps
18777 \begin_layout LyX-Code
18781 \begin_layout LyX-Code
18785 \begin_layout LyX-Code
18786 UpdateResult "$$AbsPath$$Basename.eps"
18789 \begin_layout LyX-Code
18790 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18793 \begin_layout LyX-Code
18794 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18797 \begin_layout LyX-Code
18801 \begin_layout LyX-Code
18802 Product "[XFig: $$FName]"
18805 \begin_layout LyX-Code
18809 \begin_layout LyX-Code
18813 \begin_layout Standard
18814 As you can see, the template is enclosed in
18815 \begin_inset Flex Code
18818 \begin_layout Plain Layout
18824 \SpecialChar \ldots{}
18826 \begin_inset Flex Code
18829 \begin_layout Plain Layout
18836 It contains a header specifying some general settings and, for each supported
18837 primary document file format, a section
18838 \begin_inset Flex Code
18841 \begin_layout Plain Layout
18847 \SpecialChar \ldots{}
18849 \begin_inset Flex Code
18852 \begin_layout Plain Layout
18861 \begin_layout Subsection
18862 The template header
18865 \begin_layout Description
18866 \begin_inset Flex Code
18869 \begin_layout Plain Layout
18870 AutomaticProduction
18871 \begin_inset space ~
18879 Whether the file represented by the template must be generated by LyX.
18880 This command must occur exactly once.
18883 \begin_layout Description
18884 \begin_inset Flex Code
18887 \begin_layout Plain Layout
18889 \begin_inset space ~
18897 A glob pattern that is used in the file dialog to filter out the desired
18899 If there is more than one possible file extension (e.
18900 \begin_inset space \thinspace{}
18904 \begin_inset space \space{}
18908 \begin_inset Flex Code
18911 \begin_layout Plain Layout
18918 \begin_inset Flex Code
18921 \begin_layout Plain Layout
18927 ), use something like
18928 \begin_inset Flex Code
18931 \begin_layout Plain Layout
18938 This command must occur exactly once.
18941 \begin_layout Description
18942 \begin_inset Flex Code
18945 \begin_layout Plain Layout
18947 \begin_inset space ~
18955 The text that is displayed on the button.
18956 This command must occur exactly once.
18959 \begin_layout Description
18960 \begin_inset Flex Code
18963 \begin_layout Plain Layout
18965 \begin_inset space ~
18969 \begin_inset space ~
18977 The help text that is used in the External dialog.
18978 Provide enough information to explain to the user just what the template
18979 can provide him with.
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 ~
18997 The file format of the original file.
18998 This must be the name of a format that is known to LyX (see section
18999 \begin_inset CommandInset ref
19001 reference "sec:Formats"
19007 \begin_inset Quotes eld
19011 \begin_inset Flex Code
19014 \begin_layout Plain Layout
19021 \begin_inset Quotes erd
19024 if the template can handle original files of more than one format.
19025 LyX will attempt to interrogate the file itself in order to deduce its
19026 format in this case.
19027 This command must occur exactly once.
19030 \begin_layout Description
19031 \begin_inset Flex Code
19034 \begin_layout Plain Layout
19036 \begin_inset space ~
19044 A unique name for the template.
19045 It must not contain substitution macros (see below).
19048 \begin_layout Description
19049 \begin_inset Flex Code
19052 \begin_layout Plain Layout
19054 \begin_inset space ~
19057 Rotate|Resize|Clip|Extra
19062 This command specifies which transformations are supported by this template.
19063 It may occur zero or more times.
19064 This command enables the corresponding tabs in the external dialog.
19066 \begin_inset Flex Code
19069 \begin_layout Plain Layout
19075 command must have either a corresponding
19076 \begin_inset Flex Code
19079 \begin_layout Plain Layout
19086 \begin_inset Flex Code
19089 \begin_layout Plain Layout
19096 \begin_inset Flex Code
19099 \begin_layout Plain Layout
19106 Otherwise the transformation will not be supported by that format.
19109 \begin_layout Subsection
19113 \begin_layout Description
19114 \begin_inset Flex Code
19117 \begin_layout Plain Layout
19119 \begin_inset space ~
19122 LaTeX|PDFLaTeX|PlainText|DocBook
19127 The primary document file format that this format definition is for.
19128 Not every template has a sensible representation in all document file formats.
19129 Please define nevertheless a
19130 \begin_inset Flex Code
19133 \begin_layout Plain Layout
19139 section for all formats.
19140 Use a dummy text when no representation is available.
19141 Then you can at least see a reference to the external material in the exported
19145 \begin_layout Description
19146 \begin_inset Flex Code
19149 \begin_layout Plain Layout
19151 \begin_inset space ~
19155 \begin_inset space ~
19163 This command defines an additional macro
19164 \begin_inset Flex Code
19167 \begin_layout Plain Layout
19173 for substitution in
19174 \begin_inset Flex Code
19177 \begin_layout Plain Layout
19185 \begin_inset Flex Code
19188 \begin_layout Plain Layout
19194 itself may contain substitution macros.
19195 The advantage over using
19196 \begin_inset Flex Code
19199 \begin_layout Plain Layout
19206 \begin_inset Flex Code
19209 \begin_layout Plain Layout
19215 is that the substituted value of
19216 \begin_inset Flex Code
19219 \begin_layout Plain Layout
19225 is sanitized so that it is a valid optional argument in the document format.
19226 This command may occur zero or more times.
19229 \begin_layout Description
19230 \begin_inset Flex Code
19233 \begin_layout Plain Layout
19235 \begin_inset space ~
19243 The text that is inserted in the exported document.
19244 This is actually the most important command and can be quite complex.
19245 This command must occur exactly once.
19248 \begin_layout Description
19249 \begin_inset Flex Code
19252 \begin_layout Plain Layout
19254 \begin_inset space ~
19262 This command specifies a preamble snippet that will be included in the
19264 It has to be defined using
19265 \begin_inset Flex Code
19268 \begin_layout Plain Layout
19274 \SpecialChar \ldots{}
19276 \begin_inset Flex Code
19279 \begin_layout Plain Layout
19286 This command may occur zero or more times.
19289 \begin_layout Description
19290 \begin_inset Flex Code
19293 \begin_layout Plain Layout
19295 \begin_inset space ~
19299 \begin_inset space ~
19307 This command denotes files that are created by the conversion process and
19308 are needed for a particular export format.
19309 If the filename is relative, it is interpreted relative to the master document.
19310 This command may be given zero or more times.
19313 \begin_layout Description
19314 \begin_inset Flex Code
19317 \begin_layout Plain Layout
19319 \begin_inset space ~
19327 The name of a required LaTeX package.
19328 The package is included via
19329 \begin_inset Flex Code
19332 \begin_layout Plain Layout
19340 in the LaTeX preamble.
19341 This command may occur zero or more times.
19344 \begin_layout Description
19345 \begin_inset Flex Code
19348 \begin_layout Plain Layout
19350 \begin_inset space ~
19354 \begin_inset space ~
19357 RotationLatexCommand
19362 This command specifies that the built in LaTeX command should be used for
19364 This command may occur once or not at all.
19367 \begin_layout Description
19368 \begin_inset Flex Code
19371 \begin_layout Plain Layout
19373 \begin_inset space ~
19377 \begin_inset space ~
19385 This command specifies that the built in LaTeX command should be used for
19387 This command may occur once or not at all.
19390 \begin_layout Description
19391 \begin_inset Flex Code
19394 \begin_layout Plain Layout
19396 \begin_inset space ~
19400 \begin_inset space ~
19403 RotationLatexOption
19408 This command specifies that rotation is done via an optional argument.
19409 This command may occur once or not at all.
19412 \begin_layout Description
19413 \begin_inset Flex Code
19416 \begin_layout Plain Layout
19418 \begin_inset space ~
19422 \begin_inset space ~
19430 This command specifies that resizing is done via an optional argument.
19431 This command may occur once or not at all.
19434 \begin_layout Description
19435 \begin_inset Flex Code
19438 \begin_layout Plain Layout
19440 \begin_inset space ~
19444 \begin_inset space ~
19452 This command specifies that clipping is done via an optional argument.
19453 This command may occur once or not at all.
19456 \begin_layout Description
19457 \begin_inset Flex Code
19460 \begin_layout Plain Layout
19462 \begin_inset space ~
19466 \begin_inset space ~
19474 This command specifies that an extra optional argument is used.
19475 This command may occur once or not at all.
19478 \begin_layout Description
19479 \begin_inset Flex Code
19482 \begin_layout Plain Layout
19484 \begin_inset space ~
19492 The file format of the converted file.
19493 This must be the name of a format that is known to LyX (see the
19494 \begin_inset Flex MenuItem
19497 \begin_layout Plain Layout
19502 ools\SpecialChar \menuseparator
19507 references:Conversion
19513 This command must occur exactly once.
19516 \begin_layout Description
19517 \begin_inset Flex Code
19520 \begin_layout Plain Layout
19522 \begin_inset space ~
19530 The file name of the converted file.
19531 The file name must be absolute.
19532 This command must occur exactly once.
19535 \begin_layout Subsection
19536 Preamble definitions
19539 \begin_layout Standard
19540 The external template configuration file may contain additional preamble
19541 definitions enclosed by
19542 \begin_inset Flex Code
19545 \begin_layout Plain Layout
19551 \SpecialChar \ldots{}
19553 \begin_inset Flex Code
19556 \begin_layout Plain Layout
19563 They can be used by the templates in the
19564 \begin_inset Flex Code
19567 \begin_layout Plain Layout
19576 \begin_layout Section
19577 The substitution mechanism
19580 \begin_layout Standard
19581 When the external material facility invokes an external program, it is done
19582 on the basis of a command defined in the template configuration file.
19583 These commands can contain various macros that are expanded before execution.
19584 Execution always take place in the directory of the containing document.
19587 \begin_layout Standard
19588 Also, whenever external material is to be displayed, the name will be produced
19589 by the substitution mechanism, and most other commands in the template
19590 definition support substitution as well.
19593 \begin_layout Standard
19594 The available macros are the following:
19597 \begin_layout Description
19598 \begin_inset Flex Code
19601 \begin_layout Plain Layout
19602 $$AbsOrRelPathMaster
19607 The file path, absolute or relative to the master LyX document.
19610 \begin_layout Description
19611 \begin_inset Flex Code
19614 \begin_layout Plain Layout
19615 $$AbsOrRelPathParent
19620 The file path, absolute or relative to the LyX document.
19623 \begin_layout Description
19624 \begin_inset Flex Code
19627 \begin_layout Plain Layout
19633 The absolute file path.
19636 \begin_layout Description
19637 \begin_inset Flex Code
19640 \begin_layout Plain Layout
19646 The filename without path and without the extension.
19649 \begin_layout Description
19650 \begin_inset Flex Code
19653 \begin_layout Plain Layout
19655 \begin_inset Quotes eld
19659 \begin_inset Quotes erd
19667 This macro will expand to the contents of the file with the name
19668 \begin_inset Flex Code
19671 \begin_layout Plain Layout
19680 \begin_layout Description
19681 \begin_inset Flex Code
19684 \begin_layout Plain Layout
19690 The file extension (including the dot).
19693 \begin_layout Description
19694 \begin_inset Flex Code
19697 \begin_layout Plain Layout
19703 The filename of the file specified in the external material dialog.
19704 This is either an absolute name, or it is relative to the LyX document.
19707 \begin_layout Description
19708 \begin_inset Flex Code
19711 \begin_layout Plain Layout
19718 \begin_inset Flex Code
19721 \begin_layout Plain Layout
19727 (absolute name or relative to the LyX document).
19730 \begin_layout Description
19731 \begin_inset Flex Code
19734 \begin_layout Plain Layout
19740 The file path, relative to the master LyX document.
19743 \begin_layout Description
19744 \begin_inset Flex Code
19747 \begin_layout Plain Layout
19753 The file path, relative to the LyX document.
19756 \begin_layout Description
19757 \begin_inset Flex Code
19760 \begin_layout Plain Layout
19766 This macro will expand to the absolute path of the system directory.
19767 This is typically used to point to the various helper scripts that are
19771 \begin_layout Description
19772 \begin_inset Flex Code
19775 \begin_layout Plain Layout
19781 A name and full path to a temporary file which will be automatically deleted
19782 whenever the containing document is closed, or the external material insertion
19786 \begin_layout Standard
19787 All path macros contain a trailing directory separator, so you can construct
19789 \begin_inset space \thinspace{}
19793 \begin_inset space \space{}
19796 the absolute filename with
19797 \begin_inset Flex Code
19800 \begin_layout Plain Layout
19801 $$AbsPath$$Basename$$Extension
19809 \begin_layout Standard
19810 The macros above are substituted in all commands unless otherwise noted.
19812 \begin_inset Flex Code
19815 \begin_layout Plain Layout
19821 supports additionally the following substitutions if they are enabled by
19823 \begin_inset Flex Code
19826 \begin_layout Plain Layout
19833 \begin_inset Flex Code
19836 \begin_layout Plain Layout
19845 \begin_layout Description
19846 \begin_inset Flex Code
19849 \begin_layout Plain Layout
19855 The front part of the resize command.
19858 \begin_layout Description
19859 \begin_inset Flex Code
19862 \begin_layout Plain Layout
19868 The back part of the resize command.
19871 \begin_layout Description
19872 \begin_inset Flex Code
19875 \begin_layout Plain Layout
19881 The front part of the rotation command.
19884 \begin_layout Description
19885 \begin_inset Flex Code
19888 \begin_layout Plain Layout
19894 The back part of the rotation command.
19897 \begin_layout Standard
19898 The value string of the
19899 \begin_inset Flex Code
19902 \begin_layout Plain Layout
19908 command supports additionally the following substitutions if they are enabled
19910 \begin_inset Flex Code
19913 \begin_layout Plain Layout
19920 \begin_inset Flex Code
19923 \begin_layout Plain Layout
19932 \begin_layout Description
19933 \begin_inset Flex Code
19936 \begin_layout Plain Layout
19945 \begin_layout Description
19946 \begin_inset Flex Code
19949 \begin_layout Plain Layout
19958 \begin_layout Description
19959 \begin_inset Flex Code
19962 \begin_layout Plain Layout
19971 \begin_layout Description
19972 \begin_inset Flex Code
19975 \begin_layout Plain Layout
19981 The rotation option.
19984 \begin_layout Standard
19985 You may ask why there are so many path macros.
19986 There are mainly two reasons:
19989 \begin_layout Enumerate
19990 Relative and absolute file names should remain relative or absolute, respectivel
19992 Users may have reasons to prefer either form.
19993 Relative names are useful for portable documents that should work on different
19994 machines, for example.
19995 Absolute names may be required by some programs.
19998 \begin_layout Enumerate
19999 LaTeX treats relative file names differently than LyX and other programs
20000 in nested included files.
20001 For LyX, a relative file name is always relative to the document that contains
20003 For LaTeX, it is always relative to the master document.
20004 These two definitions are identical if you have only one document, but
20005 differ if you have a master document that includes part documents.
20006 That means that relative filenames must be transformed when presented to
20008 Fortunately LyX does this automatically for you if you choose the right
20012 \begin_layout Standard
20013 So which path macro should be used in new template definitions? The rule
20017 \begin_layout Itemize
20019 \begin_inset Flex Code
20022 \begin_layout Plain Layout
20028 if an absolute path is required.
20031 \begin_layout Itemize
20033 \begin_inset Flex Code
20036 \begin_layout Plain Layout
20037 $$AbsOrRelPathMaster
20042 if the substituted string is some kind of LaTeX input.
20045 \begin_layout Itemize
20047 \begin_inset Flex Code
20050 \begin_layout Plain Layout
20051 $$AbsOrRelPathParent
20056 in order to preserve the user's choice.
20059 \begin_layout Standard
20060 There are special cases where this rule does not work and e.
20061 \begin_inset space \thinspace{}
20065 \begin_inset space \space{}
20068 relative names are needed, but normally it will work just fine.
20069 One example for such a case is the command
20070 \begin_inset Flex Code
20073 \begin_layout Plain Layout
20074 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20079 in the XFig template above: We can't use the absolute name because the
20081 \begin_inset Flex Code
20084 \begin_layout Plain Layout
20090 files needs the relative name in order to rewrite the file content.
20093 \begin_layout Section
20094 Security discussion
20095 \begin_inset CommandInset label
20097 name "sec:Security-discussion"
20104 \begin_layout Standard
20105 The external material feature interfaces with a lot of external programs
20106 and does so automatically, so we have to consider the security implications
20108 In particular, since you have the option of including your own filenames
20109 and/or parameter strings and those are expanded into a command, it seems
20110 that it would be possible to create a malicious document which executes
20111 arbitrary commands when a user views or prints the document.
20112 This is something we definitely want to avoid.
20115 \begin_layout Standard
20116 However, since the external program commands are specified in the template
20117 configuration file only, there are no security issues if LyX is properly
20118 configured with safe templates only.
20119 This is so because the external programs are invoked with the
20120 \begin_inset Flex Code
20123 \begin_layout Plain Layout
20129 -system call rather than the
20130 \begin_inset Flex Code
20133 \begin_layout Plain Layout
20139 system-call, so it's not possible to execute arbitrary commands from the
20140 filename or parameter section via the shell.
20143 \begin_layout Standard
20144 This also implies that you are restricted in what command strings you can
20145 use in the external material templates.
20146 In particular, pipes and redirection are not readily available.
20147 This has to be so if LyX should remain safe.
20148 If you want to use some of the shell features, you should write a safe
20149 script to do this in a controlled manner, and then invoke the script from
20150 the command string.
20154 \begin_layout Standard
20155 It is possible to design a template that interacts directly with the shell,
20156 but since this would allow a malicious user to execute arbitrary commands
20157 by writing clever filenames and/or parameters, we generally recommend that
20158 you only use safe scripts that work with the
20159 \begin_inset Flex Code
20162 \begin_layout Plain Layout
20168 system call in a controlled manner.
20169 Of course, for use in a controlled environment, it can be tempting to just
20170 fall back to use ordinary shell scripts.
20171 If you do so, be aware that you
20175 provide an easily exploitable security hole in your system.
20176 Of course it stands to reason that such unsafe templates will never be
20177 included in the standard LyX distribution, although we do encourage people
20178 to submit new templates in the open source tradition.
20179 But LyX as shipped from the official distribution channels will never have
20183 \begin_layout Standard
20184 Including external material provides a lot of power, and you have to be
20185 careful not to introduce security hazards with this power.
20186 A subtle error in a single line in an innocent looking script can open
20187 the door to huge security problems.
20188 So if you do not fully understand the issues, we recommend that you consult
20189 a knowledgeable security professional or the LyX development team if you
20190 have any questions about whether a given template is safe or not.
20191 And do this before you use it in an uncontrolled environment.