1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that this document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of this document may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
39 % used for multi-column text
42 \options fleqn,bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading
43 \use_default_options false
47 \maintain_unincluded_children false
50 InsetLayout CharStyle:MenuItem
59 \newcommand*{\menuitem}[1]{{\sffamily #1}}
62 # In case we need to do with sans...
63 #InsetLayout CharStyle:Code
68 #\renewcommand{\code}[1]{{\sffamily #1}}
77 \font_typewriter default
78 \font_default_family default
79 \use_non_tex_fonts false
86 \default_output_format default
88 \bibtex_command default
89 \index_command default
93 \pdf_title "LyX Configuration Manual"
94 \pdf_author "LyX Team"
95 \pdf_subject "LyX-documentation Customization"
96 \pdf_keywords "LyX, documentation, customization"
98 \pdf_bookmarksnumbered true
99 \pdf_bookmarksopen true
100 \pdf_bookmarksopenlevel 1
101 \pdf_breaklinks false
105 \pdf_pdfusetitle false
106 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
116 \paperorientation portrait
130 \paragraph_separation indent
131 \paragraph_indentation default
132 \quotes_language english
135 \paperpagestyle headings
136 \tracking_changes false
137 \output_changes false
145 Customizing LyX: Features for the Advanced User
153 \begin_layout Plain Layout
155 If you have comments or error corrections, please send them to the LyX Documenta
157 \begin_inset CommandInset href
159 target "lyx-docs@lists.lyx.org"
166 \begin_inset Quotes eld
170 \begin_inset Quotes erd
173 in the subject header, and please cc the current maintainer of this file,
174 Richard Heck <rgheck@comcast.net>.
180 \begin_inset Newline newline
184 \begin_inset Newline newline
190 \begin_layout Standard
191 \begin_inset CommandInset toc
192 LatexCommand tableofcontents
199 \begin_layout Standard
200 \begin_inset Note Note
203 \begin_layout Plain Layout
204 Please use change tracking when modifying this document.
205 This makes it easier for our translators to recognize things that have
206 been changed, and it helps the maintainer keep up-to-date with what's been
215 \begin_layout Chapter
219 \begin_layout Standard
220 This manual covers the customization features present in LyX.
221 In it, we discuss issues like keyboard shortcuts, screen previewing options,
222 printer options, sending commands to LyX via the LyX Server, internationalizati
223 on, installing new LaTeX classes and LyX layouts, etc.
224 We can't possibly hope to touch on everything you can change—our developers
225 add new features faster than we can document them—but we will explain the
226 most common customizations and hopefully point you in the right direction
227 for some of the more obscure ones.
230 \begin_layout Standard
231 \begin_inset Branch OutDated
234 \begin_layout Standard
235 Information from previous versions of this document that now seems to be
236 outdated is contained in the OutDated branch of this document.
237 By default, this information will not appear in the LaTeX output.
245 \begin_layout Chapter
246 LyX configuration files
249 \begin_layout Standard
250 This chapter aims to help you to find your way through the LyX configuration
252 Before continuing to read this chapter, you should find out where your
253 LyX library and user directories are by using
254 \begin_inset Flex MenuItem
257 \begin_layout Plain Layout
258 Help\SpecialChar \menuseparator
269 The library directory is the place where LyX places its system-wide configurati
270 on files; the user directory is where you can place your modified versions.
271 We will call the former
272 \begin_inset Flex Code
275 \begin_layout Plain Layout
282 \begin_inset Flex MenuItem
285 \begin_layout Plain Layout
291 in the remainder of this document.
295 \begin_layout Section
297 \begin_inset Flex Code
300 \begin_layout Plain Layout
309 \begin_layout Standard
310 \begin_inset Flex Code
313 \begin_layout Plain Layout
319 and its sub-directories contain a number of files and that can be used
320 to customize LyX's behavior.
321 You can change many of these files from within LyX itself through the
322 \begin_inset Flex MenuItem
325 \begin_layout Plain Layout
326 Tools\SpecialChar \menuseparator
333 Most customization that you will want to do in LyX is possible through
335 However, many other inner aspects of LyX can be customized by modifying
337 \begin_inset Flex Code
340 \begin_layout Plain Layout
347 These files fall in different categories, described in the following subsection
351 \begin_layout Subsection
352 Automatically generated files
355 \begin_layout Standard
356 The files, which are to be found in
357 \begin_inset Flex MenuItem
360 \begin_layout Plain Layout
366 , are generated when you configure LyX.
367 They contain various default values that are guessed by inspection.
368 In general, it is not a good idea to modify them, since they might be overwritt
372 \begin_layout Labeling
373 \labelwidthstring 00.00.0000
374 \begin_inset Flex Code
377 \begin_layout Plain Layout
383 contains defaults for various commands.
386 \begin_layout Labeling
387 \labelwidthstring 00.00.0000
388 \begin_inset Flex Code
391 \begin_layout Plain Layout
397 contains the list of packages that have been recognized by LyX.
398 It is currently unused by the LyX program itself, but the information extracted
399 , and more, is made available with
400 \begin_inset Flex MenuItem
403 \begin_layout Plain Layout
404 Help\SpecialChar \menuseparator
417 \begin_layout Labeling
418 \labelwidthstring 00.00.0000
419 \begin_inset Flex Code
422 \begin_layout Plain Layout
428 the list of text classes that have been found in your
429 \begin_inset Flex Code
432 \begin_layout Plain Layout
438 directories, along with the associated LaTeX document class and their descripti
442 \begin_layout Labeling
443 \labelwidthstring 00.00.0000
444 \begin_inset Flex Code
447 \begin_layout Plain Layout
453 the list of layout modules found in your
454 \begin_inset Flex Code
457 \begin_layout Plain Layout
466 \begin_layout Labeling
467 \labelwidthstring 00.00.0000
468 \begin_inset Flex Code
471 \begin_layout Plain Layout
477 lists of various sorts of LaTeX-related files found on your system
480 \begin_layout Labeling
481 \labelwidthstring 00.00.0000
482 \begin_inset Flex Code
485 \begin_layout Plain Layout
491 is automatically generated during configuration from the file
492 \begin_inset Flex Code
495 \begin_layout Plain Layout
502 It contains information on your LaTeX configuration.
505 \begin_layout Subsection
509 \begin_layout Standard
510 These directories are duplicated between
511 \begin_inset Flex Code
514 \begin_layout Plain Layout
521 \begin_inset Flex Code
524 \begin_layout Plain Layout
531 If a particular files exists in both places, the one in
532 \begin_inset Flex Code
535 \begin_layout Plain Layout
544 \begin_layout Labeling
545 \labelwidthstring 00.00.0000
546 \begin_inset Flex Code
549 \begin_layout Plain Layout
555 this directory contains files with the extension
556 \begin_inset Flex Code
559 \begin_layout Plain Layout
565 that define the keybindings used in LyX.
566 If there exists an internationalized version of the bind file named
567 \begin_inset Flex Code
570 \begin_layout Plain Layout
576 , that will be used first.
579 \begin_layout Labeling
580 \labelwidthstring 00.00.0000
581 \begin_inset Flex Code
584 \begin_layout Plain Layout
590 contains graphics files that can be included in documents.
594 \begin_layout Labeling
595 \labelwidthstring 00.00.0000
596 \begin_inset Flex Code
599 \begin_layout Plain Layout
605 contains LyX documentation files (including the one you are currently reading).
607 \begin_inset Flex Code
610 \begin_layout Plain Layout
616 deserves special attention, as noted above.
617 The internationalized help docs are in subdirectories
618 \begin_inset Flex Code
621 \begin_layout Plain Layout
628 \begin_inset Quotes eld
632 \begin_inset Quotes erd
635 is the ISO language code.
641 \begin_inset CommandInset ref
643 reference "cha:Internationalizing-LyX"
650 \begin_layout Labeling
651 \labelwidthstring 00.00.0000
652 \begin_inset Flex Code
655 \begin_layout Plain Layout
661 contains example files that explain how to use some features.
662 In the file browser, press the
663 \begin_inset Flex MenuItem
666 \begin_layout Plain Layout
675 \begin_layout Labeling
676 \labelwidthstring 00.00.0000
677 \begin_inset Flex Code
680 \begin_layout Plain Layout
686 contains image files that are used by the
687 \begin_inset Flex MenuItem
690 \begin_layout Plain Layout
697 In addition, it also contains the individual icons used in the toolbar
698 and the banners that can be shown when LyX is launched.
701 \begin_layout Labeling
702 \labelwidthstring 00.00.0000
703 \begin_inset Flex Code
706 \begin_layout Plain Layout
712 contains keyboard keymapping files.
718 \begin_inset CommandInset ref
720 reference "sec:International-Keymap-Stuff"
727 \begin_layout Labeling
728 \labelwidthstring 00.00.0000
729 \begin_inset Flex Code
732 \begin_layout Plain Layout
738 contains the text class and module files described in Chapter
743 \begin_inset CommandInset ref
745 reference "cha:Installing-New-Document"
752 \begin_layout Labeling
753 \labelwidthstring 00.00.0000
754 \begin_inset Flex Code
757 \begin_layout Plain Layout
764 \begin_inset Flex Code
767 \begin_layout Plain Layout
773 Python scripts used to convert between LyX versions.
774 These can be run from the command line if, say, you want to batch-convert
778 \begin_layout Labeling
779 \labelwidthstring 00.00.0000
780 \begin_inset Flex Code
783 \begin_layout Plain Layout
789 contains some files that demonstrate the capabilities of the
790 \begin_inset Flex MenuItem
793 \begin_layout Plain Layout
804 Also contains some scripts used by LyX itself.
807 \begin_layout Labeling
808 \labelwidthstring 00.00.0000
809 \begin_inset Flex Code
812 \begin_layout Plain Layout
818 contains the standard LyX template files described in Chapter
823 \begin_inset CommandInset ref
825 reference "sub:Creating-Templates"
832 \begin_layout Labeling
833 \labelwidthstring 00.00.0000
834 \begin_inset Flex Code
837 \begin_layout Plain Layout
843 contains files with the extension
844 \begin_inset Flex Code
847 \begin_layout Plain Layout
853 that define the user interface to LyX.
854 That is, the files define which items appear in which menus and the items
855 appearing on the toolbar.
858 \begin_layout Subsection
859 Files you don't want to modify
862 \begin_layout Standard
863 These files are used internally by LyX and you generally do not need to
864 modify them unless you are a developer.
867 \begin_layout Labeling
868 \labelwidthstring 00.00.0000
869 \begin_inset Flex Code
872 \begin_layout Plain Layout
878 this file contains the list of LyX developers.
879 The contents are displayed with the menu entry
880 \begin_inset Flex MenuItem
883 \begin_layout Plain Layout
884 Help\SpecialChar \menuseparator
897 \begin_layout Labeling
898 \labelwidthstring 00.00.0000
899 \begin_inset Flex Code
902 \begin_layout Plain Layout
908 this is a LaTeX script used during the configuration process.
912 \begin_layout Labeling
913 \labelwidthstring 00.00.0000
914 \begin_inset Flex Code
917 \begin_layout Plain Layout
923 this is the script that is used to re-configure LyX.
924 It creates configuration files in the directory it was run from.
927 \begin_layout Subsection
928 Other files needing a line or two...
931 \begin_layout Labeling
932 \labelwidthstring 00.00.0000
933 \begin_inset Flex Code
936 \begin_layout Plain Layout
942 this contains tables describing how different character encodings can be
946 \begin_layout Labeling
947 \labelwidthstring 00.00.0000
948 \begin_inset Flex Code
951 \begin_layout Plain Layout
957 this file contains the templates available to the new
958 \begin_inset Flex MenuItem
961 \begin_layout Plain Layout
974 \begin_layout Labeling
975 \labelwidthstring 00.00.0000
976 \begin_inset Flex Code
979 \begin_layout Plain Layout
985 this file contains a list of all the languages currently supported by LyX.
988 \begin_layout Section
989 Your local configuration directory
992 \begin_layout Standard
993 Even if you are using LyX as an unprivileged user, you might want to change
994 LyX configuration for your own use.
996 \begin_inset Flex Code
999 \begin_layout Plain Layout
1005 directory contains all your personal configuration files.
1006 This is the directory described as
1007 \begin_inset Quotes eld
1011 \begin_inset Quotes erd
1015 \begin_inset Flex MenuItem
1018 \begin_layout Plain Layout
1019 Help\SpecialChar \menuseparator
1021 \begin_inset space ~
1030 This directory is used as a mirror of
1031 \begin_inset Flex Code
1034 \begin_layout Plain Layout
1040 , which means that every file in
1041 \begin_inset Flex Code
1044 \begin_layout Plain Layout
1050 is a replacement for the corresponding file in
1051 \begin_inset Flex Code
1054 \begin_layout Plain Layout
1061 Any configuration file described in the above sections can be placed either
1062 in the system-wide directory, in which case it will affect all users, or
1063 in your local directory for your own use.
1066 \begin_layout Standard
1067 To make things clearer, let's provide a few examples:
1070 \begin_layout Itemize
1071 The preferences set in the
1072 \begin_inset Flex MenuItem
1075 \begin_layout Plain Layout
1076 Tools\SpecialChar \menuseparator
1082 dialog are saved to a file
1083 \begin_inset Flex Code
1086 \begin_layout Plain Layout
1093 \begin_inset Flex Code
1096 \begin_layout Plain Layout
1105 \begin_layout Itemize
1106 When you reconfigure using
1107 \begin_inset Flex MenuItem
1110 \begin_layout Plain Layout
1111 Tools\SpecialChar \menuseparator
1118 \begin_inset Flex Code
1121 \begin_layout Plain Layout
1127 script, and the resulting files are written in your local configuration
1129 This means that any additional text class file that you might have added
1131 \begin_inset Flex Code
1134 \begin_layout Plain Layout
1140 will be added to the list of classes in the
1141 \begin_inset Flex MenuItem
1144 \begin_layout Plain Layout
1145 Document\SpecialChar \menuseparator
1154 \begin_layout Itemize
1155 If you get some updated documentation from LyX ftp site and cannot install
1156 it because you do not have sysadmin rights on your system, you can just
1158 \begin_inset Flex Code
1161 \begin_layout Plain Layout
1167 and the items in the
1168 \begin_inset Flex MenuItem
1171 \begin_layout Plain Layout
1177 menu will open them!
1180 \begin_layout Section
1181 Running LyX with multiple configurations
1184 \begin_layout Standard
1185 The configuration freedom of the local configuration directory may not suffice
1186 if you want to have more than one configuration at your disposal.
1187 For example, you may want to be use different key bindings or printer settings
1189 You can achieve this by having several such directories.
1190 You then specify which directory to use at run-time.
1193 \begin_layout Standard
1194 Invoking LyX with the command line switch
1195 \begin_inset Flex Code
1198 \begin_layout Plain Layout
1208 instructs the program to read the configuration from that directory, and
1209 not from the default directory.
1210 (You can determine the default directory by running LyX without the
1211 \begin_inset Flex Code
1214 \begin_layout Plain Layout
1220 switch.) If the specified directory does not exist, LyX offers to create
1221 it for you, just like it does for the default directory on the first time
1222 you run the program.
1223 You can modify the configuration options in this additional user directory
1224 exactly as you would for the default directory.
1225 These directories are completely independent (but read on).
1226 Note that setting the environment variable
1227 \begin_inset Flex Code
1230 \begin_layout Plain Layout
1236 to some value has exactly the same effect.
1239 \begin_layout Standard
1240 Having several configurations also requires more maintenance: if you want
1241 to add a new layout to
1242 \begin_inset Flex Code
1245 \begin_layout Plain Layout
1251 which you want available from all your configurations, you must add it
1252 to each directory separately.
1253 You can avoid this with the following trick: after LyX creates the additional
1254 directory, most of the subdirectories (see above) are empty.
1255 If you want the new configuration to mirror an existing one, replace the
1256 empty subdirectory with a symbolic link to the matching subdirectory in
1257 the existing configuration.
1259 \begin_inset Flex Code
1262 \begin_layout Plain Layout
1268 subdirectory, however, since it contains a file written by the configuration
1269 script (also accessible through
1270 \begin_inset Flex MenuItem
1273 \begin_layout Plain Layout
1274 Tools\SpecialChar \menuseparator
1280 ) which is configuration-specific.
1283 \begin_layout Chapter
1284 The Preferences dialog
1287 \begin_layout Standard
1288 All options of the preferences dialog are described in the Appendix
1290 The Preferences Dialog
1297 For some options you might find here more details.
1300 \begin_layout Section
1302 \begin_inset CommandInset label
1311 \begin_layout Standard
1312 The first step is to define your file formats if they are not already defined.
1314 \begin_inset Flex MenuItem
1317 \begin_layout Plain Layout
1318 Tools\SpecialChar \menuseparator
1326 \begin_inset Flex MenuItem
1329 \begin_layout Plain Layout
1330 File Handling\SpecialChar \menuseparator
1337 \begin_inset Flex MenuItem
1340 \begin_layout Plain Layout
1341 New\SpecialChar \ldots{}
1347 button to define your new format.
1349 \begin_inset Flex MenuItem
1352 \begin_layout Plain Layout
1358 field contains the name used to identify the format in the GUI.
1360 \begin_inset Flex MenuItem
1363 \begin_layout Plain Layout
1369 is used to identify the format internally.
1370 You will also need to enter a file extension.
1371 These are all required.
1373 \begin_inset Flex MenuItem
1376 \begin_layout Plain Layout
1382 field is used to provide a keyboard shortcut on the menus.
1383 (For example, pressing
1384 \begin_inset Flex MenuItem
1387 \begin_layout Plain Layout
1394 \begin_inset Flex MenuItem
1397 \begin_layout Plain Layout
1398 View\SpecialChar \menuseparator
1399 View (Other Formats)\SpecialChar \menuseparator
1408 \begin_layout Standard
1410 \begin_inset Flex MenuItem
1413 \begin_layout Plain Layout
1420 \begin_inset Flex MenuItem
1423 \begin_layout Plain Layout
1430 For example, you might want to use
1431 \begin_inset Flex MenuItem
1434 \begin_layout Plain Layout
1440 to view PostScript files.
1441 You can enter the command needed to start the program in the corresponding
1443 In defining this command, you can use the four variables listed in the
1445 The viewer is launched when you view an image in LyX or use the
1446 \begin_inset Flex MenuItem
1449 \begin_layout Plain Layout
1456 The editor is for example launched when you right-click on an image and
1458 \begin_inset Flex MenuItem
1461 \begin_layout Plain Layout
1467 in the appearing context menu.
1470 \begin_layout Standard
1472 \begin_inset Flex MenuItem
1475 \begin_layout Plain Layout
1481 option tells LyX that a format is suitable for document export.
1482 If this is set and if a suitable conversion route exists (see sec.
1483 \begin_inset space \thinspace{}
1487 \begin_inset CommandInset ref
1489 reference "sec:Converters"
1493 ), the format will appear in the
1494 \begin_inset Flex MenuItem
1497 \begin_layout Plain Layout
1498 File\SpecialChar \menuseparator
1505 The format will also appear in the
1506 \begin_inset Flex MenuItem
1509 \begin_layout Plain Layout
1515 menu if a viewer is specified for the format.
1516 Pure image formats, such as
1517 \begin_inset Flex Code
1520 \begin_layout Plain Layout
1526 , should not use this option.
1527 Formats that can both represent vector graphics and documents like
1528 \begin_inset Flex Code
1531 \begin_layout Plain Layout
1540 \begin_layout Standard
1542 \begin_inset Flex MenuItem
1545 \begin_layout Plain Layout
1546 Vector graphics format
1551 tells LyX that a format can contain vector graphics.
1552 This information is used to determine the target format of included graphics
1554 \begin_inset Flex MenuItem
1557 \begin_layout Plain Layout
1564 Included graphics may need to be converted to either
1565 \begin_inset Flex MenuItem
1568 \begin_layout Plain Layout
1575 \begin_inset Flex MenuItem
1578 \begin_layout Plain Layout
1585 \begin_inset Flex MenuItem
1588 \begin_layout Plain Layout
1595 \begin_inset Flex MenuItem
1598 \begin_layout Plain Layout
1604 cannot handle other image formats.
1605 If an included graphic is not already in
1606 \begin_inset Flex MenuItem
1609 \begin_layout Plain Layout
1616 \begin_inset Flex MenuItem
1619 \begin_layout Plain Layout
1626 \begin_inset Flex MenuItem
1629 \begin_layout Plain Layout
1635 format, it is converted to
1636 \begin_inset Flex MenuItem
1639 \begin_layout Plain Layout
1645 if the vector format option is set, and otherwise to
1646 \begin_inset Flex MenuItem
1649 \begin_layout Plain Layout
1658 \begin_layout Section
1662 \begin_layout Standard
1663 Since all conversions from one format to another take place in LyX's temporary
1664 directory, it is sometimes necessary to modify a file before copying it
1665 to the temporary directory in order that the conversion may be performed.
1669 \begin_layout Plain Layout
1670 For example, the file may refer to other files—images, for example—using
1671 relative file names, and these may become invalid when the file is copied
1672 to the temporary directory.
1677 This is done by a Copier: It copies a file to (or from) the temporary directory
1678 and may modify it in the process.
1681 \begin_layout Standard
1682 The definitions of the copiers may use four variables:
1685 \begin_layout Labeling
1686 \labelwidthstring 00.00.0000
1687 \begin_inset Flex Code
1690 \begin_layout Plain Layout
1696 The LyX system directory (e.
1697 \begin_inset space \thinspace{}
1701 \begin_inset space \space{}
1705 \begin_inset Flex MenuItem
1708 \begin_layout Plain Layout
1717 \begin_layout Labeling
1718 \labelwidthstring 00.00.0000
1719 \begin_inset Flex Code
1722 \begin_layout Plain Layout
1731 \begin_layout Labeling
1732 \labelwidthstring 00.00.0000
1733 \begin_inset Flex Code
1736 \begin_layout Plain Layout
1745 \begin_layout Labeling
1746 \labelwidthstring 00.00.0000
1747 \begin_inset Flex Code
1750 \begin_layout Plain Layout
1759 \begin_layout Standard
1760 The latter should be the filename as it would be used in a LaTeX's
1767 It is relevant only when exporting files suitable for such inclusion.
1770 \begin_layout Standard
1771 Copiers can be used to do almost anything with output files.
1772 For example, suppose you want generated pdf files to be copied to a special
1774 \begin_inset Flex Code
1777 \begin_layout Plain Layout
1784 Then you could write a shell script such as this one:
1787 \begin_layout Standard
1788 \begin_inset listings
1792 \begin_layout Plain Layout
1797 \begin_layout Plain Layout
1802 \begin_layout Plain Layout
1804 TOFILE=`basename $2`
1807 \begin_layout Plain Layout
1809 cp $FROMFILE /home/you/pdf/$TOFILE
1814 Save it in your local LyX directory—say,
1815 \begin_inset Flex Code
1818 \begin_layout Plain Layout
1819 /home/you/.lyx/scripts/pdfcopier.sh
1824 —and make it executable, if you need to do so on your platform.
1826 \begin_inset Flex MenuItem
1829 \begin_layout Plain Layout
1830 Tools\SpecialChar \menuseparator
1836 dialog, select under
1837 \begin_inset Flex MenuItem
1840 \begin_layout Plain Layout
1841 File Handling\SpecialChar \menuseparator
1848 \begin_inset Flex MenuItem
1851 \begin_layout Plain Layout
1857 format—or one of the other pdf formats—and enter
1858 \begin_inset Flex Code
1861 \begin_layout Plain Layout
1862 pdfcopier.sh $$i $$o
1868 \begin_inset Flex MenuItem
1871 \begin_layout Plain Layout
1881 \begin_layout Standard
1882 Copiers are used by LyX in various of its own conversions.
1883 For example, if appropriate programs are found, LyX will automatically
1884 install copiers for the
1885 \begin_inset Flex MenuItem
1888 \begin_layout Plain Layout
1895 \begin_inset Flex MenuItem
1898 \begin_layout Plain Layout
1900 \begin_inset space ~
1909 When these formats are exported, the copier sees that not just the main
1910 HTML file but various associated files (style files, images, etc.) are also
1912 All these files are written to a subdirectory of the directory in which
1913 the original LyX file was found.
1917 \begin_layout Plain Layout
1918 This copier can be customized.
1920 \begin_inset Quotes eld
1924 \begin_inset Quotes erd
1927 argument takes a comma-separated list of extensions to be copied; if it
1928 is omitted, all files will be copied.
1930 \begin_inset Quotes eld
1934 \begin_inset Quotes erd
1937 argument determines the extension added to the generated directory.
1939 \begin_inset Quotes eld
1943 \begin_inset Flex MenuItem
1946 \begin_layout Plain Layout
1953 \begin_inset Quotes erd
1956 , so HTML generated from
1957 \begin_inset Flex MenuItem
1960 \begin_layout Plain Layout
1961 /path/to/filename.lyx
1967 \begin_inset Flex MenuItem
1970 \begin_layout Plain Layout
1971 /path/to/filename.html.LyXconv
1985 \begin_layout Section
1987 \begin_inset CommandInset label
1989 name "sec:Converters"
1996 \begin_layout Standard
1997 You can define your own Converters to convert files between different formats.
1999 \begin_inset Flex MenuItem
2002 \begin_layout Plain Layout
2003 Tools\SpecialChar \menuseparator
2004 Preferences\SpecialChar \menuseparator
2005 File Handling\SpecialChar \menuseparator
2014 \begin_layout Standard
2015 To define a new converter, select the
2016 \begin_inset Flex MenuItem
2019 \begin_layout Plain Layout
2021 \begin_inset space ~
2030 \begin_inset Flex MenuItem
2033 \begin_layout Plain Layout
2035 \begin_inset space ~
2043 from the drop-down lists, enter the command needed for the conversion,
2045 \begin_inset Flex MenuItem
2048 \begin_layout Plain Layout
2055 Several variables can be used in the definition of converters:
2058 \begin_layout Labeling
2059 \labelwidthstring 00.00.0000
2060 \begin_inset Flex Code
2063 \begin_layout Plain Layout
2069 The LyX system directory
2072 \begin_layout Labeling
2073 \labelwidthstring 00.00.0000
2074 \begin_inset Flex Code
2077 \begin_layout Plain Layout
2086 \begin_layout Labeling
2087 \labelwidthstring 00.00.0000
2088 \begin_inset Flex Code
2091 \begin_layout Plain Layout
2100 \begin_layout Labeling
2101 \labelwidthstring 00.00.0000
2102 \begin_inset Flex Code
2105 \begin_layout Plain Layout
2111 The base filename of the input file (i.
2112 \begin_inset space \thinspace{}
2115 g., without the extension)
2118 \begin_layout Labeling
2119 \labelwidthstring 00.00.0000
2120 \begin_inset Flex Code
2123 \begin_layout Plain Layout
2129 The path to the input file
2132 \begin_layout Labeling
2133 \labelwidthstring 00.00.0000
2134 \begin_inset Flex Code
2137 \begin_layout Plain Layout
2143 The path to the original input file (this is different from $$p when a
2144 chain of converters is called)
2147 \begin_layout Labeling
2148 \labelwidthstring 00.00.0000
2149 \begin_inset Flex Code
2152 \begin_layout Plain Layout
2158 The iconv name for the encoding of the document.
2161 \begin_layout Standard
2163 \begin_inset Flex MenuItem
2166 \begin_layout Plain Layout
2168 \begin_inset space ~
2176 field you can enter the following flags, separated by commas:
2179 \begin_layout Labeling
2180 \labelwidthstring 00.00.0000
2181 \begin_inset Flex Code
2184 \begin_layout Plain Layout
2190 This converter runs some form of LaTeX.
2191 This will make LyX's LaTeX error logs available.
2194 \begin_layout Labeling
2195 \labelwidthstring 00.00.0000
2196 \begin_inset Flex Code
2199 \begin_layout Plain Layout
2206 \begin_inset Flex MenuItem
2209 \begin_layout Plain Layout
2215 file for the conversion.
2218 \begin_layout Labeling
2219 \labelwidthstring 00.00.0000
2220 \begin_inset Flex Code
2223 \begin_layout Plain Layout
2232 \begin_layout Standard
2233 The following three flags are not really flags at all because they take
2235 \begin_inset Flex MenuItem
2238 \begin_layout Plain Layout
2240 \begin_inset space ~
2244 \begin_inset space ~
2255 \begin_layout Labeling
2256 \labelwidthstring 00.00.0000
2257 \begin_inset Flex Code
2260 \begin_layout Plain Layout
2266 If set, the converter's standard error will be redirected to a file
2267 \begin_inset Flex Code
2270 \begin_layout Plain Layout
2276 , and the script given as argument will be run as:
2277 \begin_inset Flex Code
2280 \begin_layout Plain Layout
2281 script < infile.out > infile.log
2287 The argument may contain
2288 \begin_inset Flex Code
2291 \begin_layout Plain Layout
2300 \begin_layout Labeling
2301 \labelwidthstring 00.00.0000
2302 \begin_inset Flex Code
2305 \begin_layout Plain Layout
2311 The name of the directory in which the converter will dump the generated
2313 LyX will not create this directory, and it does not copy anything into
2314 it, though it will copy this directory to the destination.
2315 The argument may contain
2316 \begin_inset Flex Code
2319 \begin_layout Plain Layout
2325 , which will be replaced by the base name of the input and output files,
2326 respectively, when the directory is copied.
2327 \begin_inset Newline newline
2330 Note that resultdir and usetempdir make no sense together.
2331 The latter will be ignored if the former is given.
2334 \begin_layout Labeling
2335 \labelwidthstring 00.00.0000
2336 \begin_inset Flex Code
2339 \begin_layout Plain Layout
2345 Determines the output file name and may, contain
2346 \begin_inset Flex Code
2349 \begin_layout Plain Layout
2356 Sensible only with resultdir and optional even then; if not given, it defaults
2360 \begin_layout Standard
2361 None of these last three are presently used in any of the converters that
2362 are installed with LyX.
2366 \begin_layout Standard
2367 You do not have to define converters for all formats between which you want
2369 For example, you will note that there is no `LyX to PostScript' converter,
2370 but LyX will export PostScript.
2371 It does so by first creating a LaTeX file (no converter needs to be defined
2372 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2373 and finally converting the resulting DVI file to PostScript.
2374 LyX finds such `chains' of converters automatically, and it will always
2375 choose the shortest possible chain.
2376 You can, though, still define multiple conversion methods between file
2378 For example, the standard LyX configuration provides three ways to convert
2379 LaTeX to PDF: Directly, using
2380 \begin_inset Flex MenuItem
2383 \begin_layout Plain Layout
2389 ; via (DVI and) PostScript, using
2390 \begin_inset Flex MenuItem
2393 \begin_layout Plain Layout
2400 \begin_inset Flex MenuItem
2403 \begin_layout Plain Layout
2410 To define such alternate chains, you must define multiple target `file
2411 formats', as described in section
2412 \begin_inset CommandInset ref
2414 reference "sec:Formats"
2419 For example, in the standard configuration, the formats named
2420 \begin_inset Flex MenuItem
2423 \begin_layout Plain Layout
2430 \begin_inset Flex MenuItem
2433 \begin_layout Plain Layout
2440 \begin_inset Flex MenuItem
2443 \begin_layout Plain Layout
2449 are defined, all of which share the extension
2450 \begin_inset Flex MenuItem
2453 \begin_layout Plain Layout
2459 , and which correspond to the conversion methods just mentioned.
2462 \begin_layout Chapter
2463 Internationalizing LyX
2464 \begin_inset CommandInset label
2466 name "cha:Internationalizing-LyX"
2473 \begin_layout Standard
2474 LyX supports using a translated interface.
2475 Last time we checked, LyX provided text in thirty languages.
2476 The language of choice is called your
2481 (For further reading on locale settings, see also the documentation for
2482 locale that comes with your operating system.
2483 For Linux, the manual page for
2484 \begin_inset Flex Code
2487 \begin_layout Plain Layout
2493 could be a good place to start).
2496 \begin_layout Standard
2497 Notice that these translations will work, but do contain a few flaws.
2498 In particular, all dialogs have been designed with the English text in
2499 mind, which means that some of the translated text will be too large to
2500 fit within the space allocated.
2501 This is only a display problem and will not cause any harm.
2502 Also, you will find that some of the translations do not define shortcut
2503 keys for everything.
2504 Sometimes, there are simply not enough free letters to do it.
2505 Other times, the translator just hasn't got around to doing it yet.
2506 Our localization team, which you may wish to join,
2510 \begin_layout Plain Layout
2511 If you are a fluent speaker of a language other than English, joining these
2512 teams is a great way to give back to the LyX community!
2517 will of course try to fix these shortcomings in future versions of LyX.
2520 \begin_layout Section
2524 \begin_layout Subsection
2525 Translating the graphical user interface (text messages).
2528 \begin_layout Standard
2530 \begin_inset Flex Code
2533 \begin_layout Plain Layout
2539 library to handle the internationalization of the interface.
2540 To have LyX speak your favorite language in all menus and dialogs, you
2542 \begin_inset Flex Code
2545 \begin_layout Plain Layout
2551 -file for that language.
2552 When this is available, you'll have to generate a
2553 \begin_inset Flex Code
2556 \begin_layout Plain Layout
2562 -file from it and install the
2563 \begin_inset Flex Code
2566 \begin_layout Plain Layout
2573 The process of doing all of this is explained in the documentation for
2575 \begin_inset Flex Code
2578 \begin_layout Plain Layout
2585 It is possible to do this just for yourself, but if you're going to do
2586 it, you might as well share the results of your labors with the rest of
2588 Send a message to the LyX developers' list for more information about how
2592 \begin_layout Standard
2593 In short, this is what you should do (xx denotes the language code):
2596 \begin_layout Itemize
2597 Check out the LyX source code.
2599 \begin_inset CommandInset href
2601 name "information on the web"
2602 target "http://www.lyx.org/HowToUseSVN"
2609 \begin_layout Itemize
2611 \begin_inset Flex Code
2614 \begin_layout Plain Layout
2620 to the folder of the
2621 \begin_inset Flex Code
2624 \begin_layout Plain Layout
2632 \begin_inset Flex Code
2635 \begin_layout Plain Layout
2643 \begin_inset Flex Code
2646 \begin_layout Plain Layout
2652 doesn't exist anywhere, it can be remade with the console command
2653 \begin_inset Flex Code
2656 \begin_layout Plain Layout
2662 in that directory, or you can use an existing po-file for some other language
2666 \begin_layout Itemize
2668 \begin_inset Flex Code
2671 \begin_layout Plain Layout
2681 \begin_layout Plain Layout
2682 This is just a text file, so it can be edited in any text editor.
2683 But there are also specialized programs that support such editing, such
2688 (for all platforms) or
2697 contains a `mode' for editing
2698 \begin_inset Flex Code
2701 \begin_layout Plain Layout
2712 For some menu- and widget-labels, there are also shortcut keys that should
2714 Those keys are marked after a `|', and should be translated according to
2715 the words and phrases of the language.
2716 You should also fill also out the information at the beginning of the new
2718 \begin_inset Flex Code
2721 \begin_layout Plain Layout
2727 -file with your email-address, etc., so people know where to reach you with
2728 suggestions and entertaining flames.
2731 \begin_layout Standard
2732 If you are just doing this on your own, then:
2735 \begin_layout Itemize
2737 \begin_inset Flex Code
2740 \begin_layout Plain Layout
2747 This can be done with
2748 \begin_inset Flex Code
2751 \begin_layout Plain Layout
2752 msgfmt -o xx.mo < xx.po
2760 \begin_layout Itemize
2762 \begin_inset Flex Code
2765 \begin_layout Plain Layout
2771 -file to your locale-tree, at the correct directory for application messages
2776 xx, and under the name
2777 \begin_inset Flex Code
2780 \begin_layout Plain Layout
2787 \begin_inset space \thinspace{}
2791 \begin_inset space \space{}
2795 \begin_inset Flex Code
2798 \begin_layout Plain Layout
2799 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2809 \begin_layout Standard
2810 As said, however, it would be best if the new
2811 \begin_inset Flex Code
2814 \begin_layout Plain Layout
2820 -file could be added to the LyX distribution, so others can use it.
2821 Adding it involves making additional changes to LyX.
2822 So send an email to the developers' mailing list if you're interested in
2826 \begin_layout Subsubsection
2830 \begin_layout Standard
2831 Sometimes it turns out that one English message needs to be translated into
2832 different messages in the target language.
2833 One example is the message
2834 \begin_inset Flex Code
2837 \begin_layout Plain Layout
2843 which has the German translation
2851 , depending upon exactly what the English
2852 \begin_inset Quotes eld
2856 \begin_inset Quotes erd
2861 \begin_inset Flex Code
2864 \begin_layout Plain Layout
2870 does not handle such ambiguous translations.
2871 Therefore you have to add some context information to the message: Instead
2873 \begin_inset Flex Code
2876 \begin_layout Plain Layout
2883 \begin_inset Flex Code
2886 \begin_layout Plain Layout
2887 To[[as in 'From format x to format y']]
2893 \begin_inset Flex Code
2896 \begin_layout Plain Layout
2897 To[[as in 'From page x to page y']].
2902 Now the two occurrences of
2903 \begin_inset Flex Code
2906 \begin_layout Plain Layout
2913 \begin_inset Flex Code
2916 \begin_layout Plain Layout
2922 and can be translated correctly to
2933 \begin_layout Standard
2934 Of course the context information needs to be stripped off the original
2935 message when no translation is used.
2936 Therefore you have to put it in double square brackets at the end of the
2937 message (see the example above).
2938 The translation mechanism of LyX ensures that everything in double square
2939 brackets at the end of messages is removed before displaying the message.
2942 \begin_layout Subsection
2943 Translating the documentation.
2946 \begin_layout Standard
2947 The online documentation (in the
2948 \begin_inset Flex MenuItem
2951 \begin_layout Plain Layout
2957 -menu) can (and should!) be translated.
2958 If there are translated versions of the documentation available
2962 \begin_layout Plain Layout
2963 As of March 2008, at least some of the documents have been translated into
2964 fourteen languages, with the Tutorial available in a few more.
2969 and the locale is set accordingly, these will be used automagically by
2971 LyX looks for translated versions as
2972 \begin_inset Flex Code
2975 \begin_layout Plain Layout
2976 LyXDir/doc/xx/DocName.lyx
2982 \begin_inset Flex Code
2985 \begin_layout Plain Layout
2991 is the code for the language currently in use.
2992 If there are no translated documents, the default English versions will
2994 Note that the translated versions must have the same filenames (
2995 \begin_inset Flex Code
2998 \begin_layout Plain Layout
3004 above) as the original.
3005 If you feel up to translating the documentation (an excellent way to proof-read
3006 the original documentation by the way!), there are a few things you should
3010 \begin_layout Itemize
3011 Check out the documentation translation web page at
3012 \begin_inset CommandInset href
3014 name "http://www.lyx.org/Translation"
3015 target "http://www.lyx.org/Translation"
3020 That way, you can find out which (if any) documents have already been translate
3021 d into your language.
3022 You can also find out who (if anyone) is organizing the effort to translate
3023 the documentation into your language.
3024 If no one is organizing the effort, please let us know that you're interested.
3027 \begin_layout Standard
3028 Once you get to actually translating, here's a few hints for you that may
3032 \begin_layout Itemize
3033 Join the documentation team! There is information on how to do that in
3034 \begin_inset Flex Code
3037 \begin_layout Plain Layout
3044 \begin_inset Flex MenuItem
3047 \begin_layout Plain Layout
3048 Help\SpecialChar \menuseparator
3054 ), which by the way is the first document you should translate.
3057 \begin_layout Itemize
3058 Learn the typographic conventions for the language you are translating to.
3059 Typography is an ancient art and over the centuries, a great variety of
3060 conventions have developed throughout different parts of the world.
3061 Also study the professional terminology amongst typographers in your country.
3062 Inventing your own terminology will only confuse the users.
3065 (Warning! Typography is addictive!)
3068 \begin_layout Itemize
3069 Make a copy of the document.
3070 This will be your working copy.
3071 You can use this as your personal translated help-file by placing it in
3073 \begin_inset Flex Code
3076 \begin_layout Plain Layout
3085 \begin_layout Itemize
3086 Sometimes the original document (from the LyX-team) will be updated.
3087 Use the source viewer at
3088 \begin_inset CommandInset href
3090 name "http://www.lyx.org/trac/timeline"
3091 target "http://www.lyx.org/trac/timeline"
3095 to see what has been changed.
3096 That way you can easily see which parts of the translated document need
3100 \begin_layout Standard
3101 If you ever find an error in the original document, fix it and notify the
3102 rest of the documentation team of the changes! (You didn't forget to join
3103 the documentation team, did you?)
3106 \begin_layout Standard
3107 \begin_inset Branch OutDated
3110 \begin_layout Section
3111 International Keyboard Support
3114 \begin_layout Standard
3117 [Editor's Note: The following section is by
3125 It needs to be fixed to conform to the new Documentation Style sheet and
3126 to make use of the new v1.0 features.
3127 The whole thing also needs to be merged with the section following it.-jw
3128 It may also be badly out of date.-rh (2008)]
3131 \begin_layout Subsection
3132 Defining Own Keymaps: Keymap File Format
3135 \begin_layout Standard
3136 Let's look at a keyboard definition file a little closer.
3137 It is a plain text file defining
3140 \begin_layout Itemize
3141 key-to-key or key-to-string translations
3144 \begin_layout Itemize
3148 \begin_layout Itemize
3149 dead keys exceptions
3152 \begin_layout Standard
3153 To define key-to-key or key-to-string translation, use this command:
3156 \begin_layout Quotation
3157 \begin_inset Flex Code
3160 \begin_layout Plain Layout
3169 \begin_inset Flex Code
3172 \begin_layout Plain Layout
3181 \begin_layout Standard
3183 \begin_inset Flex Code
3186 \begin_layout Plain Layout
3192 is the key to be translated and
3193 \begin_inset Flex Code
3196 \begin_layout Plain Layout
3202 is the string to be inserted into the document.
3203 To define dead keys, use:
3206 \begin_layout Quotation
3207 \begin_inset Flex Code
3210 \begin_layout Plain Layout
3219 \begin_inset Flex Code
3222 \begin_layout Plain Layout
3231 \begin_layout Standard
3233 \begin_inset Flex Code
3236 \begin_layout Plain Layout
3242 is a keyboard key and
3243 \begin_inset Flex Code
3246 \begin_layout Plain Layout
3253 The following dead keys are supported (shortcut name is in parentheses):
3256 \begin_layout Quotation
3260 \begin_inset space \hfill{}
3266 \begin_layout Quotation
3268 \begin_inset space \hfill{}
3274 \begin_layout Quotation
3276 \begin_inset space \hfill{}
3282 \begin_layout Quotation
3284 \begin_inset space \hfill{}
3290 \begin_layout Quotation
3292 \begin_inset space \hfill{}
3298 \begin_layout Quotation
3300 \begin_inset space \hfill{}
3307 \begin_layout Plain Layout
3319 \begin_layout Quotation
3321 \begin_inset space \hfill{}
3327 \begin_layout Quotation
3329 \begin_inset space \hfill{}
3336 \begin_layout Plain Layout
3348 \begin_layout Quotation
3350 \begin_inset space \hfill{}
3356 \begin_layout Quotation
3358 \begin_inset space \hfill{}
3364 \begin_layout Quotation
3366 \begin_inset space \hfill{}
3373 \begin_layout Plain Layout
3385 \begin_layout Quotation
3387 \begin_inset space \hfill{}
3394 \begin_layout Plain Layout
3406 \begin_layout Quotation
3408 \begin_inset space \hfill{}
3414 \begin_layout Quotation
3415 hungarian umlaut (hug)
3416 \begin_inset space \hfill{}
3422 \begin_layout Quotation
3424 \begin_inset space \hfill{}
3430 \begin_layout Quotation
3432 \begin_inset space \hfill{}
3439 \begin_layout Plain Layout
3451 \begin_layout Standard
3452 Since in many international keyboards there are exceptions to what some
3453 dead keys should do, you can define them using
3456 \begin_layout Quotation
3457 \begin_inset Flex Code
3460 \begin_layout Plain Layout
3468 deadkey key outstring
3471 \begin_layout Standard
3472 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3476 \begin_layout Quotation
3477 \begin_inset Flex Code
3480 \begin_layout Plain Layout
3493 \begin_layout Standard
3494 to make it work correctly.
3495 Also, you have to define as exceptions dead keys over i and j, to remove
3496 the dot from them before inserting an accent mark.
3497 I will change this when the time comes, but so far I haven't had time.
3500 \begin_layout Standard
3501 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3504 \begin_inset Flex Code
3507 \begin_layout Plain Layout
3513 have different meaning.
3515 \begin_inset Flex Code
3518 \begin_layout Plain Layout
3524 marks comments, quotes start and end LaTeX-style commands.
3525 To enter quote, you'll need to use
3526 \begin_inset Flex Code
3529 \begin_layout Plain Layout
3538 \begin_inset Flex Code
3541 \begin_layout Plain Layout
3548 \begin_inset Flex Code
3551 \begin_layout Plain Layout
3562 \begin_layout Standard
3563 If you make a keyboard description file that works for your language, please
3564 mail it to me, so I can include it in the next keymap distribution.
3567 \begin_layout Standard
3568 More keywords will be supported in keymap configuration file in future,
3572 \begin_layout Itemize
3573 \begin_inset Flex Code
3576 \begin_layout Plain Layout
3587 \begin_inset space \hfill{}
3591 \begin_inset Flex Code
3594 \begin_layout Plain Layout
3603 \begin_layout Itemize
3604 \begin_inset Flex Code
3607 \begin_layout Plain Layout
3618 \begin_inset space \hfill{}
3622 \begin_inset Flex Code
3625 \begin_layout Plain Layout
3631 an external keymap translation program
3634 \begin_layout Standard
3635 Also, it should look into
3636 \begin_inset Flex Code
3639 \begin_layout Plain Layout
3645 file for defaults, too (for example, a
3646 \begin_inset Flex Code
3649 \begin_layout Plain Layout
3657 option to include default keyboard).
3665 \begin_layout Section
3666 International Keymap Stuff
3667 \begin_inset CommandInset label
3669 name "sec:International-Keymap-Stuff"
3676 \begin_layout Standard
3677 \begin_inset Note Note
3680 \begin_layout Plain Layout
3681 In doing the revisions on this document in March 2008, I did not look over
3682 this stuff, as I do not understand it.
3683 It would be good if someone else could do so.
3692 \begin_layout Standard
3693 The next two sections describe the
3694 \begin_inset Flex Code
3697 \begin_layout Plain Layout
3706 \begin_inset Flex Code
3709 \begin_layout Plain Layout
3717 file syntax in detail.
3718 These sections should help you design your own key map if the ones provided
3719 do not meet your needs.
3722 \begin_layout Subsection
3726 \begin_layout Standard
3730 \begin_inset Flex Code
3733 \begin_layout Plain Layout
3739 file maps keystrokes to characters or strings.
3740 As the name suggests, it sets a keyboard mapping.
3742 \begin_inset Flex Code
3745 \begin_layout Plain Layout
3756 \begin_inset Flex Code
3759 \begin_layout Plain Layout
3774 \begin_inset Flex Code
3777 \begin_layout Plain Layout
3790 \begin_inset Flex Code
3793 \begin_layout Plain Layout
3802 \begin_inset Flex Code
3805 \begin_layout Plain Layout
3813 are described in this section.
3816 \begin_layout Labeling
3817 \labelwidthstring 00.00.0000
3818 \begin_inset Flex Code
3821 \begin_layout Plain Layout
3829 Map a character to a string
3832 \begin_layout LyX-Code
3847 \begin_layout Standard
3880 the double-quote (")
3897 must be escaped with a preceding backslash (
3908 \begin_layout Standard
3910 \begin_inset Flex MenuItem
3913 \begin_layout Plain Layout
3921 statement to cause the symbol
3922 \begin_inset Flex MenuItem
3925 \begin_layout Plain Layout
3933 to be output for the keystroke
3934 \begin_inset Flex MenuItem
3937 \begin_layout Plain Layout
3948 \begin_layout LyX-Code
3954 \begin_layout Labeling
3955 \labelwidthstring 00.00.0000
3956 \begin_inset Flex Code
3959 \begin_layout Plain Layout
3967 Specify an accent character
3970 \begin_layout LyX-Code
3979 \begin_layout Standard
3980 This will make the cha
4018 This is the dead key
4022 \begin_layout Plain Layout
4029 refers to a key that does not produce a character by itself, but when followed
4030 with another key, produces the desired accent character.
4031 For example, a German characte
4033 r with an umlaut like
4043 can be produced in this manner.
4052 \begin_layout Standard
4065 and then another key not in
4082 followed by the other, not allowed key, as output.
4086 \begin_inset Flex MenuItem
4089 \begin_layout Plain Layout
4097 cancels a dead key, so if
4108 \begin_inset Flex MenuItem
4111 \begin_layout Plain Layout
4120 , the cursor will not go one position backwards but will instead cancel
4136 might have had on the next keystroke.
4140 \begin_layout Standard
4141 The following example specifies that the character ' is to be an acute accent,
4142 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4145 \begin_layout LyX-Code
4148 kmod ' acute aeiouAEIOU
4151 \begin_layout Labeling
4152 \labelwidthstring 00.00.0000
4153 \begin_inset Flex Code
4156 \begin_layout Plain Layout
4162 Specify an exception to the accent character
4165 \begin_layout LyX-Code
4174 \begin_layout Standard
4175 This defines an exce
4216 have been assigned a keystroke with a previous
4219 \begin_inset Flex Code
4222 \begin_layout Plain Layout
4246 must not belong in the
4293 If such a declaration does not exist in
4301 \begin_inset Flex Code
4304 \begin_layout Plain Layout
4338 \begin_inset Flex Code
4341 \begin_layout Plain Layout
4355 \begin_layout Standard
4356 The following command produces causes äi to be produced when you enter acute-i
4360 \begin_layout LyX-Code
4374 \begin_layout Labeling
4375 \labelwidthstring 00.00.0000
4376 \begin_inset Flex Code
4379 \begin_layout Plain Layout
4385 Combine two accent characters
4388 \begin_layout LyX-Code
4394 accent1 accent2 allowed
4397 \begin_layout Standard
4398 This one is getting pretty esoteric.
4399 It allows you to combine the effect
4455 \begin_inset Flex Code
4458 \begin_layout Plain Layout
4486 \begin_layout Standard
4487 Consider this example from the
4488 \begin_inset Flex Code
4491 \begin_layout Plain Layout
4502 \begin_layout LyX-Code
4505 kmod ; acute aeioyvhAEIOYVH
4509 kcomb acute umlaut iyIY
4512 \begin_layout Standard
4513 This allows you to press
4514 \begin_inset Flex MenuItem
4517 \begin_layout Plain Layout
4525 and get the effect of
4526 \begin_inset Flex Code
4529 \begin_layout Plain Layout
4548 in this case cancels the last dead key, so if you press
4549 \begin_inset Flex MenuItem
4552 \begin_layout Plain Layout
4561 \begin_inset Flex Code
4564 \begin_layout Plain Layout
4577 \begin_layout Subsection
4581 \begin_layout Standard
4583 \begin_inset Flex Code
4586 \begin_layout Plain Layout
4594 mapping is performed, a
4595 \begin_inset Flex Code
4598 \begin_layout Plain Layout
4608 file maps the strings that the symbols generate to characters in the current
4610 The LyX distribution currently includes at least the
4611 \begin_inset Flex Code
4614 \begin_layout Plain Layout
4623 \begin_inset Flex Code
4626 \begin_layout Plain Layout
4637 \begin_layout Standard
4639 \begin_inset Flex Code
4642 \begin_layout Plain Layout
4650 file is a sequence of declarations of the form
4653 \begin_layout LyX-Code
4666 \begin_layout Standard
4667 For example, in order to map
4668 \begin_inset Flex MenuItem
4671 \begin_layout Plain Layout
4681 to the corresponding character in the iso-8859-1 set (233), the following
4685 \begin_layout LyX-Code
4693 \begin_layout Standard
4695 \begin_inset Flex Code
4698 \begin_layout Plain Layout
4707 \begin_inset Flex Code
4710 \begin_layout Plain Layout
4728 the same character can apply to more than one string.
4730 \begin_inset Flex Code
4733 \begin_layout Plain Layout
4744 \begin_layout LyX-Code
4756 \begin_inset Newline newline
4772 \begin_layout Standard
4773 If LyX cannot find a mapping for the string produced by the keystroke or
4774 a deadkey sequence, it will check if it looks like an accented char and
4775 try to draw an accent over the character on screen.
4778 \begin_layout Subsection
4782 \begin_layout Standard
4783 There is a second way to add support for international characters through
4784 so-called dead-keys.
4785 A dead-key works in combination with a letter to produce an accented character.
4786 Here, we'll explain how to create a really simple dead-key to illustrate
4790 \begin_layout Standard
4791 Suppose you happen to need the circumflex character,
4792 \begin_inset Quotes eld
4796 \begin_inset Quotes erd
4801 \begin_inset Flex MenuItem
4804 \begin_layout Plain Layout
4811 \begin_inset space ~
4815 \begin_inset Flex MenuItem
4818 \begin_layout Plain Layout
4824 ] to the LyX command
4825 \begin_inset Flex Code
4828 \begin_layout Plain Layout
4835 \begin_inset Flex Code
4838 \begin_layout Plain Layout
4845 Now, whenever you type the
4846 \begin_inset Flex MenuItem
4849 \begin_layout Plain Layout
4855 -key followed by a letter, that letter will have a circumflex accent on
4857 For example, the sequence
4858 \begin_inset Quotes eld
4862 \begin_inset Flex MenuItem
4865 \begin_layout Plain Layout
4872 \begin_inset Quotes erd
4875 produces the letter:
4876 \begin_inset Quotes eld
4880 \begin_inset Quotes erd
4884 If you tried to type
4885 \begin_inset Quotes eld
4889 \begin_inset Flex MenuItem
4892 \begin_layout Plain Layout
4899 \begin_inset Quotes erd
4902 , however, LyX will complain with a beep, since a
4903 \begin_inset Quotes eld
4907 \begin_inset Flex MenuItem
4910 \begin_layout Plain Layout
4917 \begin_inset Quotes erd
4920 never takes a circumflex accent.
4922 \begin_inset Flex MenuItem
4925 \begin_layout Plain Layout
4931 after a dead-key produces the bare-accent.
4932 Please note this last point! If you bind a key to a dead-key, you'll need
4933 to rebind the character on that key to yet another key.
4935 \begin_inset Flex MenuItem
4938 \begin_layout Plain Layout
4944 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4947 \begin_layout Standard
4948 One common way to bind dead-keys is to use
4949 \begin_inset Flex MenuItem
4952 \begin_layout Plain Layout
4959 \begin_inset Flex MenuItem
4962 \begin_layout Plain Layout
4969 \begin_inset Flex MenuItem
4972 \begin_layout Plain Layout
4978 in combination with an accent, like
4979 \begin_inset Quotes eld
4983 \begin_inset Flex MenuItem
4986 \begin_layout Plain Layout
4993 \begin_inset Quotes erd
4997 \begin_inset Quotes eld
5001 \begin_inset Flex MenuItem
5004 \begin_layout Plain Layout
5011 \begin_inset Quotes erd
5015 \begin_inset Quotes eld
5019 \begin_inset Flex MenuItem
5022 \begin_layout Plain Layout
5029 \begin_inset Quotes erd
5033 Another way involves using
5034 \begin_inset Flex Code
5037 \begin_layout Plain Layout
5044 \begin_inset Flex Code
5047 \begin_layout Plain Layout
5053 to set up the special
5054 \begin_inset Flex Code
5057 \begin_layout Plain Layout
5065 \begin_inset Flex Code
5068 \begin_layout Plain Layout
5074 acts in some ways just like
5075 \begin_inset Flex MenuItem
5078 \begin_layout Plain Layout
5084 and permits you to bind keys to accented characters.
5085 You can also turn keys into dead-keys by binding them to something like
5087 \begin_inset Flex Code
5090 \begin_layout Plain Layout
5096 and then binding this symbolic key to the corresponding LyX command.
5100 \begin_layout Plain Layout
5105 : This is exactly what I do in my
5106 \begin_inset Flex Code
5109 \begin_layout Plain Layout
5116 \begin_inset Flex Code
5119 \begin_layout Plain Layout
5127 \begin_inset Flex MenuItem
5130 \begin_layout Plain Layout
5132 \begin_inset space ~
5141 \begin_inset Flex Code
5144 \begin_layout Plain Layout
5150 and a bunch of these
5151 \begin_inset Quotes eld
5155 \begin_inset Flex Code
5158 \begin_layout Plain Layout
5165 \begin_inset Quotes erd
5168 symbolic keys bound such things as
5169 \begin_inset Flex MenuItem
5172 \begin_layout Plain Layout
5174 \begin_inset space ~
5183 \begin_inset Flex MenuItem
5186 \begin_layout Plain Layout
5188 \begin_inset space ~
5197 This is how I produce my accented characters.
5202 You can make just about anything into the
5203 \begin_inset Flex Code
5206 \begin_layout Plain Layout
5213 \begin_inset Flex MenuItem
5216 \begin_layout Plain Layout
5222 keys, a spare function key, etc.
5223 As for the LyX commands that produce accents, check the entry for
5224 \begin_inset Flex Code
5227 \begin_layout Plain Layout
5238 You'll find the complete list there.
5241 \begin_layout Subsection
5242 Saving your Language Configuration
5245 \begin_layout Standard
5246 You can edit your preferences so that your desired language environment
5247 is automatically configured when LyX starts up, via the
5248 \begin_inset Flex MenuItem
5251 \begin_layout Plain Layout
5252 Edit\SpecialChar \menuseparator
5261 \begin_layout Chapter
5262 Installing New Document Classes, Layouts, and Templates
5263 \begin_inset CommandInset label
5265 name "cha:Installing-New-Document"
5270 \begin_inset Argument
5273 \begin_layout Plain Layout
5274 Installing New Document Classes
5282 \begin_layout Standard
5283 In this chapter, we describe the procedures for creating and installing
5284 new LyX layout and template files, as well as offer a refresher on correctly
5285 installing new LaTeX document classes.
5289 \begin_layout Standard
5290 First, let us a say a few words about how one ought to think about the relation
5291 between LyX and LaTeX.
5292 The thing to understand is that, in a certain sense, LyX doesn't know anything
5294 Indeed, from LyX's point of view, LaTeX is just one of several
5295 \begin_inset Quotes eld
5299 \begin_inset Quotes erd
5302 in which it is capable of producing output.
5303 Other such formats are DocBook, plaintext, and XHTML.
5304 LaTeX is, of course, a particularly important format, but very little of
5305 the information LyX has about LaTeX is actually contained in the program
5310 \begin_layout Plain Layout
5311 Some commands are sufficiently complex that they are
5312 \begin_inset Quotes eld
5316 \begin_inset Quotes erd
5320 But the developers generally regard this as a Bad Thing.
5325 Rather, that information, even for the standard classes like
5326 \begin_inset Flex Code
5329 \begin_layout Plain Layout
5335 , is contained in `layout files'.
5336 Similarly, LyX itself does not know much about DocBook or XHTML.
5337 What it knows is contained in layout files.
5340 \begin_layout Standard
5341 You can think of the layout file for a given document class as a translation
5342 manual between LyX constructs---paragraphs with their corresponding styles,
5343 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5345 Almost everything LyX knows about
5346 \begin_inset Flex Code
5349 \begin_layout Plain Layout
5355 , for example, is contained in the file
5356 \begin_inset Flex Code
5359 \begin_layout Plain Layout
5365 and in various other files it includes.
5366 For this reason, anyone intending to write layout files should plan to
5367 study the existing files.
5368 A good place to start is with
5369 \begin_inset Flex Code
5372 \begin_layout Plain Layout
5378 , which is included in
5379 \begin_inset Flex Code
5382 \begin_layout Plain Layout
5389 \begin_inset Flex Code
5392 \begin_layout Plain Layout
5398 , and many of the other layout files for document classes.
5399 This file is where sections and the like are defined:
5400 \begin_inset Flex Code
5403 \begin_layout Plain Layout
5409 tells LyX how paragraphs that are marked with the Section, Subsection,
5410 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5413 \begin_inset Flex Code
5416 \begin_layout Plain Layout
5422 file basically just includes several of these
5423 \begin_inset Flex Code
5426 \begin_layout Plain Layout
5435 \begin_layout Standard
5436 Defining the LyX--LaTeX correspondence is not the only thing layout files
5438 Their other job is to define how the LyX constructs themselves will appear
5440 The fact that layout files have these two jobs is often a source of confusion,
5441 because they are completely separate.
5442 Telling LyX how to translate a certain paragraph style into LaTeX does
5443 not tell LyX how to display it; conversely, telling LyX how to display
5444 a certain paragraph style does not tell LyX how to translate it into LaTeX
5445 (let alone tell LaTeX how to display it).
5446 So, in general, when you define a new LyX construct, you must always do
5447 two quite separate things: (i)
5448 \begin_inset space ~
5451 tell LyX how to translate it into LaTeX and (ii)
5452 \begin_inset space ~
5455 tell LyX how to display it.
5458 \begin_layout Standard
5459 Much the same is true, of course, as regards LyX's other backend formats,
5460 though XHTML is in some ways different, because in that case LyX
5464 able, to some extent, to use information about how it should display a
5465 paragraph on the screen to output information (in the form of CSS) about
5466 how the paragraph should be displayed in a browser.
5467 Even in this case, however, the distinction between what LyX does internally
5468 and how things are rendered externally remains in force, and the two can
5469 be controlled separately.
5471 \begin_inset CommandInset ref
5473 reference "sec:Tags-for-XHTML"
5480 \begin_layout Section
5481 Installing new LaTeX files
5484 \begin_layout Standard
5485 Some installations may not include a LaTeX package or class file that you
5486 would like to use within LyX.
5487 For example, you might need FoilTeX, a package for preparing slides for
5488 overhead projectors.
5489 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5490 a user interface for installing such packages.
5491 For example, with MiKTeX, you start the program
5492 \begin_inset Quotes eld
5496 \begin_inset space ~
5500 \begin_inset Quotes erd
5503 to get a list of available packages.
5504 To install one of them, right click on it or use the corresponding toolbar
5508 \begin_layout Standard
5509 If your LaTeX distribution does not provide such a `package manager', or
5510 if the package is not available from your distribution, then follow these
5511 steps to install it manually:
5514 \begin_layout Enumerate
5515 Get the package from
5516 \begin_inset CommandInset href
5519 target "http://www.ctan.org/"
5526 \begin_layout Enumerate
5527 If the package contains a file with the ending
5528 \begin_inset Quotes eld
5532 \begin_inset Flex Code
5535 \begin_layout Plain Layout
5542 \begin_inset Quotes erd
5545 (is the case for FoilTeX) then open a console, change to the folder of
5546 this file and execute the command
5547 \begin_inset Flex Code
5550 \begin_layout Plain Layout
5557 You have now unpacked the package and have all files to install it.
5558 Most LaTeX-packages are not packed and you can skip this step.
5561 \begin_layout Enumerate
5562 Now you need to decide if the package should be available for all users
5567 \begin_layout Enumerate
5568 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5569 for all users on your system, then install it in your `local' TeX tree,
5570 otherwise install it in your own `user' TeX tree.
5571 Where these trees should be created, if they do not already exist, depends
5573 To find this out, look in the file
5574 \begin_inset Flex Code
5577 \begin_layout Plain Layout
5587 \begin_layout Plain Layout
5588 This is usually in the directory
5589 \begin_inset Flex Code
5592 \begin_layout Plain Layout
5598 , though you can execute the command
5599 \begin_inset Flex Code
5602 \begin_layout Plain Layout
5613 The location of the `local' TeX tree is defined by the
5614 \begin_inset Flex Code
5617 \begin_layout Plain Layout
5623 variable; this is usually somewhere like
5624 \begin_inset Flex Code
5627 \begin_layout Plain Layout
5628 /usr/local/share/texmf
5634 The location of the `user' TeX tree is defined by
5635 \begin_inset Flex Code
5638 \begin_layout Plain Layout
5645 \begin_inset Flex Code
5648 \begin_layout Plain Layout
5655 (If these variables are not predefined, you have to define them.) You'll
5656 probably need root permissions to create or modify the `local' tree, but
5657 not for your `user' tree.
5658 \begin_inset Newline newline
5661 In general, it is recommended to install in the user tree because your user
5662 will not be modified or even overwritten when you upgrade your system.
5663 It will typically also be backed up together with everything else when
5664 you backup your home directory (which, of course, you do on a regular basis).
5667 \begin_layout Enumerate
5668 On Windows, if you want the new package to be available for all users on
5669 your system, change to the folder where LaTeX is installed and then change
5671 \begin_inset Flex Code
5674 \begin_layout Plain Layout
5685 (For MiKTeX, this would be by default the folder
5686 \begin_inset Flex Code
5689 \begin_layout Plain Layout
5707 \begin_layout Plain Layout
5708 Note that this will be the correct path only on English installations.
5709 On a German one, it would be
5710 \begin_inset Flex Code
5713 \begin_layout Plain Layout
5727 , and similarly for other languages.
5732 Create there a new folder
5733 \begin_inset Flex Code
5736 \begin_layout Plain Layout
5742 and copy all files of the package into it.
5744 \begin_inset Newline newline
5747 If the package should only available for you or you don't have admin permissions
5748 , do the same, but in the local LaTeX folder.
5750 \begin_inset space \thinspace{}
5754 \begin_inset space ~
5757 2.8 under Windows XP, this would be the folder:
5758 \begin_inset Newline newline
5764 \begin_inset Flex Code
5767 \begin_layout Plain Layout
5770 Documents and Settings
5782 \begin_inset Newline newline
5788 \begin_inset Phantom HPhantom
5791 \begin_layout Plain Layout
5802 \begin_inset Flex Code
5805 \begin_layout Plain Layout
5818 \begin_inset Newline newline
5821 On Vista, it would be:
5822 \begin_inset Newline newline
5826 \begin_inset Flex Code
5829 \begin_layout Plain Layout
5855 \begin_layout Enumerate
5856 Now one only need to tell LaTeX that there are new files.
5857 This depends on the used LaTeX-Distribution:
5861 \begin_layout Enumerate
5862 For TeXLive execute the command
5863 \begin_inset Flex Code
5866 \begin_layout Plain Layout
5873 If you installed the package for all users, then you will probably need
5874 to have root permissions for that.
5877 \begin_layout Enumerate
5878 For MiKTeX, if you have installed the package for all users, start the program
5880 \begin_inset Quotes eld
5884 \begin_inset space ~
5888 \begin_inset Quotes erd
5891 and press the button marked
5892 \begin_inset Quotes eld
5896 \begin_inset Quotes erd
5900 Otherwise start the program
5901 \begin_inset Quotes eld
5905 \begin_inset Quotes erd
5912 \begin_layout Enumerate
5913 Finally, you need to tell LyX that there are new packages available.
5914 So, in LyX, use the menu
5915 \begin_inset Flex MenuItem
5918 \begin_layout Plain Layout
5921 \SpecialChar \menuseparator
5927 and then restart LyX.
5930 \begin_layout Standard
5931 Now the package is installed.
5932 In our example, the document class
5933 \begin_inset Flex Code
5936 \begin_layout Plain Layout
5938 \begin_inset space ~
5945 \begin_layout Plain Layout
5957 will now be available under
5958 \begin_inset Flex MenuItem
5961 \begin_layout Plain Layout
5962 Document\SpecialChar \menuseparator
5963 Settings\SpecialChar \menuseparator
5973 \begin_layout Standard
5974 If you would like to use a LaTeX document class that is not even listed
5976 \begin_inset Flex MenuItem
5979 \begin_layout Plain Layout
5980 Document\SpecialChar \menuseparator
5981 Settings\SpecialChar \menuseparator
5987 , then you need to create a `layout' file for it.
5988 That is the topic of the next section.
5991 \begin_layout Section
5992 Types of layout files
5995 \begin_layout Standard
5996 This section describes the various sorts of LyX files that contain layout
5998 These files describe various paragraph and character styles, determining
5999 how LyX should display them and how they should be translated into LaTeX,
6000 DocBook, XHTML, or whatever output format is being used.
6004 \begin_layout Standard
6005 We shall try to provide a thorough description of the process of writing
6007 However, there are so many different types of documents supported even
6008 by just LaTeX that we can't hope to cover every different possibility or
6009 problem you might encounter.
6010 The LyX users' list is frequented by people with lots of experience with
6011 layout design who are willing to share what they've learned, so please
6012 feel free to ask questions there.
6015 \begin_layout Standard
6016 As you prepare to write a new layout, it is extremely helpful to look at
6017 the layouts distributed with LyX.
6018 If you write a LyX layout for a LaTeX document class that might also be
6019 used by others, or write a module that might be useful to others, then
6020 you should consider posting your layout to the
6021 \begin_inset CommandInset href
6023 name "layout section on the LyX wiki"
6024 target "http://wiki.lyx.org/Layouts/Layouts"
6028 or even to the LyX developers' list, so that it might be included in LyX
6033 \begin_layout Plain Layout
6034 Note that LyX is licensed under the General Public License, so any material
6035 that is contributed to LyX must be similarly licensed.
6043 \begin_layout Subsection
6045 \begin_inset CommandInset label
6047 name "sub:Layout-modules"
6054 \begin_layout Standard
6055 We have spoken to this point about `layout files'.
6056 But there are different sorts of files that contain layout information.
6057 Layout files, strictly so called, have the
6058 \begin_inset Flex Code
6061 \begin_layout Plain Layout
6067 extension and provide LyX with information about document classes.
6068 As of LyX 1.6, however, layout information can also be contained in layout
6074 \begin_inset Flex Code
6077 \begin_layout Plain Layout
6084 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6085 some modules—such as the
6086 \begin_inset Flex Code
6089 \begin_layout Plain Layout
6095 module—specifically provide support for one package.
6096 In a sense, layout modules are similar to included
6100 \begin_layout Plain Layout
6101 These can have any extension, but by convention have the
6102 \begin_inset Flex Code
6105 \begin_layout Plain Layout
6117 \begin_inset Flex Code
6120 \begin_layout Plain Layout
6126 —in that modules are not specific to a given document class but may be used
6127 with many different classes.
6128 The difference is that using an included file with
6129 \begin_inset Flex Code
6132 \begin_layout Plain Layout
6138 requires editing that file.
6139 Modules, by contrast, are selected in the
6140 \begin_inset Flex MenuItem
6143 \begin_layout Plain Layout
6144 Document\SpecialChar \menuseparator
6153 \begin_layout Standard
6154 Building modules is the easiest way to get started with layout editing,
6155 since it can be as simple as adding a single new paragraph style or flex
6157 But modules may, in principle, contain anything a layout file can contain.
6160 \begin_layout Standard
6161 After creating a new module and copying it to the
6162 \begin_inset Flex Code
6165 \begin_layout Plain Layout
6171 folder, you will need to reconfigure and then restart LyX for the module
6172 to appear in the menu.
6173 However, changes you make to the module will be seen immediately, if you
6175 \begin_inset Flex MenuItem
6178 \begin_layout Plain Layout
6179 Document\SpecialChar \menuseparator
6185 , highlight something, and then hit
6186 \begin_inset Quotes eld
6190 \begin_inset Quotes erd
6196 It is strongly recommended that you save your work before doing this
6201 it is strongly recommended that you not attempt to edit modules while simultaneo
6202 usly working on actual documents
6205 Though of course the developers strive to keep LyX stable in such situations,
6206 syntax errors and the like in your module file could cause strange behavior.
6209 \begin_layout Subsection
6211 \begin_inset Flex MenuItem
6214 \begin_layout Plain Layout
6223 \begin_layout Standard
6224 There are two situations you are likely to encounter when wanting to support
6225 a new LaTeX document class, involving style (
6226 \begin_inset Flex Code
6229 \begin_layout Plain Layout
6235 ) files and LaTeX2e class (
6236 \begin_inset Flex Code
6239 \begin_layout Plain Layout
6246 Supporting a style file is usually fairly easy.
6247 Supporting a new class file is a bit harder.
6248 We'll discuss the former in this section and the latter in the next.
6249 Similar remarks apply, of course, if you want to support a new DocBook
6253 \begin_layout Standard
6254 The easier case is the one in which your new document class is provided
6255 as a style file that is to be used in conjunction with an already supported
6257 For the sake of the example, we'll assume that the style file is called
6259 \begin_inset Flex MenuItem
6262 \begin_layout Plain Layout
6268 and that it is meant to be used with
6269 \begin_inset Flex MenuItem
6272 \begin_layout Plain Layout
6278 , which is a standard class.
6282 \begin_layout Standard
6283 Start by copying the existing class's layout file into your local directory:
6287 \begin_layout Plain Layout
6288 Of course, which directory is your local directory will vary by platform,
6289 and LyX allows you to specify your local directory on startup, too, using
6291 \begin_inset Flex Code
6294 \begin_layout Plain Layout
6308 \begin_layout LyX-Code
6309 cp report.layout ~/.lyx/layouts/myclass.layout
6312 \begin_layout Standard
6314 \begin_inset Flex Code
6317 \begin_layout Plain Layout
6323 and change the line:
6326 \begin_layout LyX-Code
6329 DeclareLaTeXClass{report}
6332 \begin_layout Standard
6336 \begin_layout LyX-Code
6339 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6342 \begin_layout Standard
6346 \begin_layout LyX-Code
6348 \begin_inset Newline newline
6354 \begin_inset Newline newline
6360 \begin_layout Standard
6361 near the top of the file.
6364 \begin_layout Standard
6365 Start LyX and select
6366 \begin_inset Flex MenuItem
6369 \begin_layout Plain Layout
6370 Tools\SpecialChar \menuseparator
6377 Then restart LyX and try creating a new document.
6379 \begin_inset Flex MenuItem
6382 \begin_layout Plain Layout
6388 " as a document class option in the
6389 \begin_inset Flex MenuItem
6392 \begin_layout Plain Layout
6393 Document\SpecialChar \menuseparator
6400 It is likely that some of the sectioning commands and such in your new
6401 class will work differently from how they worked in the base class—
6402 \begin_inset Flex Code
6405 \begin_layout Plain Layout
6411 in this example—so you can fiddle around with the settings for the different
6412 sections if you wish.
6413 The layout information for sections is contained in
6414 \begin_inset Flex Code
6417 \begin_layout Plain Layout
6423 , but you do not need to copy and change this file.
6424 Instead, you can simply add your changes to your layout file, after the
6426 \begin_inset Flex Code
6429 \begin_layout Plain Layout
6435 , which itself includes
6436 \begin_inset Flex Code
6439 \begin_layout Plain Layout
6446 For example, you might add these lines:
6449 \begin_layout LyX-Code
6453 \begin_layout LyX-Code
6457 \begin_layout LyX-Code
6461 \begin_layout LyX-Code
6465 \begin_layout LyX-Code
6469 \begin_layout Standard
6470 to change the font for chapter headings to sans-serif.
6471 This will override (or, in this case, add to) the existing declaration
6472 for the Chapter style.
6476 \begin_layout Standard
6477 Your new package may also provide commands or environments not present in
6479 In this case, you will want to add these to the layout file.
6481 \begin_inset CommandInset ref
6483 reference "sec:TextClass"
6487 for information on how to do so.
6490 \begin_layout Standard
6492 \begin_inset Flex MenuItem
6495 \begin_layout Plain Layout
6501 can be used with several different document classes, and even if it cannot,
6502 you might find it easiest just to write a module that you can load with
6504 The simplest possible such module would be:
6507 \begin_layout LyX-Code
6510 DeclareLyXModule{My Package}
6513 \begin_layout LyX-Code
6517 \begin_layout LyX-Code
6518 #Support for mypkg.sty.
6521 \begin_layout LyX-Code
6523 \begin_inset Newline newline
6529 \begin_layout LyX-Code
6531 \begin_inset Newline newline
6537 \begin_layout LyX-Code
6539 \begin_inset Newline newline
6545 \begin_inset Newline newline
6551 \begin_layout Standard
6552 A more complex module might modify the behavior of some existing constructs
6553 or define some new ones.
6555 \begin_inset CommandInset ref
6557 reference "sec:TextClass"
6564 \begin_layout Subsection
6566 \begin_inset Flex MenuItem
6569 \begin_layout Plain Layout
6578 \begin_layout Standard
6579 There are two possibilities here.
6580 One is that the class file is itself based upon an existing document class.
6581 For example, many thesis classes are based upon
6582 \begin_inset Flex MenuItem
6585 \begin_layout Plain Layout
6592 To see whether yours is, look for a line like
6595 \begin_layout LyX-Code
6601 \begin_layout Standard
6603 If so, then you may proceed largely as in the previous section, though
6605 \begin_inset Flex Code
6608 \begin_layout Plain Layout
6614 line will be different.
6615 If your new class is
6616 \begin_inset Flex Code
6619 \begin_layout Plain Layout
6625 and it is based upon
6626 \begin_inset Flex Code
6629 \begin_layout Plain Layout
6635 , then the line should read:
6639 \begin_layout Plain Layout
6640 And it will be easiest if you save the file to
6641 \begin_inset Flex Code
6644 \begin_layout Plain Layout
6650 : LyX assumes that the document class has the same name as the layout file.
6659 \begin_layout LyX-Code
6662 DeclareLaTeXClass[thesis,book]{thesis}
6665 \begin_layout Standard
6666 If, on the other hand, the new class is not based upon an existing class,
6667 you will probably have to
6668 \begin_inset Quotes eld
6672 \begin_inset Quotes erd
6676 We strongly suggest copying an existing layout file which uses a similar
6677 LaTeX class and then modifying it, if you can do so.
6678 At least use an existing file as a starting point so you can find out what
6679 items you need to worry about.
6680 Again, the specifics are covered below.
6683 \begin_layout Subsection
6685 \begin_inset CommandInset label
6687 name "sub:Creating-Templates"
6694 \begin_layout Standard
6695 Once you have written a layout file for a new document class, you might
6696 want to consider writing a
6701 A template acts as a kind of tutorial for your layout, showing how it might
6702 be used, though containing dummy content.
6703 You can of course look at the various templates included with LyX for ideas.
6706 \begin_layout Standard
6707 Templates are created just like usual documents: using LyX.
6708 The only difference is that usual documents contain all possible settings,
6709 including the font scheme and the paper size.
6710 Usually a user doesn't want a template to overwrite his preferred settings
6711 for such parameters.
6712 For that reason, the designer of a template should remove the corresponding
6714 \begin_inset Flex Code
6717 \begin_layout Plain Layout
6726 \begin_inset Flex Code
6729 \begin_layout Plain Layout
6737 from the template LyX file.
6738 This can be done with any simple text-editor, for example
6739 \begin_inset Flex Code
6742 \begin_layout Plain Layout
6749 \begin_inset Flex Code
6752 \begin_layout Plain Layout
6762 \begin_layout Standard
6763 Put the edited template files you create in
6764 \begin_inset Flex Code
6767 \begin_layout Plain Layout
6773 , copy the ones you use from the global template directory in
6774 \begin_inset Flex Code
6777 \begin_layout Plain Layout
6783 to the same place, and redefine the template path in the
6784 \begin_inset Flex MenuItem
6787 \begin_layout Plain Layout
6788 Tools\SpecialChar \menuseparator
6789 Preferences\SpecialChar \menuseparator
6798 \begin_layout Standard
6799 Note, by the way, that there is a template which has a particular meaning:
6801 \begin_inset Flex Code
6804 \begin_layout Plain Layout
6811 This template is loaded every time you create a new document with
6812 \begin_inset Flex MenuItem
6815 \begin_layout Plain Layout
6816 File\SpecialChar \menuseparator
6822 in order to provide useful defaults.
6823 To create this template from inside LyX, all you have to do is to open
6824 a document with the correct settings, and use the
6825 \begin_inset Flex MenuItem
6828 \begin_layout Plain Layout
6829 Save as Document Defaults
6837 \begin_layout Subsection
6838 Upgrading old layout files
6841 \begin_layout Standard
6842 The format of layout files changes with each LyX release, so old layout
6843 files need to be converted to the new format.
6844 This process has been automated since LyX 1.4: If LyX reads a layout file
6845 in an older format, it automatically calls the script
6846 \begin_inset Flex Code
6849 \begin_layout Plain Layout
6855 to convert it to a temporary file in current format.
6856 The original file is left untouched.
6857 If you use the layout file often, then, you may want to convert it permanently,
6858 so that LyX does not have to do so itself every time.
6859 To do this, you can call the converter manually:
6862 \begin_layout LyX-Code
6863 mv myclass.layout myclass.old
6866 \begin_layout LyX-Code
6867 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6870 \begin_layout Standard
6872 \begin_inset Flex Code
6875 \begin_layout Plain Layout
6881 with the name of your LyX system directory, of course.
6884 \begin_layout Standard
6885 Note that manual conversion does not affect included files, so these will
6886 have to be converted separately.
6889 \begin_layout Section
6890 \begin_inset CommandInset label
6892 name "sec:TextClass"
6896 The layout file format
6899 \begin_layout Standard
6900 When it's finally time to get your hands dirty and create or edit your own
6901 layout file, the following sections describe what you're up against.
6902 Our advice is to go slowly, save and test often, listen to soothing music,
6903 and enjoy one or two of your favorite adult beverages; more if you are
6904 getting particularly stuck.
6905 It's really not that hard, except that the multitude of options can become
6906 overwhelming if you try to do too much in one sitting.
6907 Go have another adult beverage, just for good measure.
6910 \begin_layout Standard
6911 Note that all the tags used in layout files are case-insensitive.
6913 \begin_inset Flex Code
6916 \begin_layout Plain Layout
6923 \begin_inset Flex Code
6926 \begin_layout Plain Layout
6933 \begin_inset Flex Code
6936 \begin_layout Plain Layout
6942 are really the same tag.
6943 The possible values are printed in brackets after the feature's name.
6944 The default value if a feature isn't specified inside a text class-description
6946 \begin_inset Flex Code
6949 \begin_layout Plain Layout
6958 If the argument has a data type like
6959 \begin_inset Quotes eld
6963 \begin_inset Quotes erd
6967 \begin_inset Quotes eld
6971 \begin_inset Quotes erd
6974 , the default is shown like this:
6975 \begin_inset Flex Code
6978 \begin_layout Plain Layout
6989 \begin_layout Subsection
6990 The document class declaration
6993 \begin_layout Standard
6994 Lines in a layout file which begin with
6995 \begin_inset Flex Code
6998 \begin_layout Plain Layout
7005 There is one exception to this rule.
7007 \begin_inset Flex Code
7010 \begin_layout Plain Layout
7016 files should begin with a line like:
7019 \begin_layout LyX-Code
7022 #% Do not delete the line below; configure depends on this
7025 \begin_layout LyX-Code
7030 DeclareLaTeXClass{article}
7033 \begin_layout Standard
7034 The second line is used when you (re)configure LyX.
7035 The layout file is read by the LaTeX script
7036 \begin_inset Flex Code
7039 \begin_layout Plain Layout
7045 , in a special mode where
7046 \begin_inset Flex Code
7049 \begin_layout Plain Layout
7056 The first line is just a LaTeX comment, and the second one contains the
7057 declaration of the text class.
7058 If these lines appear in a file named
7059 \begin_inset Flex Code
7062 \begin_layout Plain Layout
7068 , then they define a text class of name
7069 \begin_inset Flex Code
7072 \begin_layout Plain Layout
7078 (the name of the layout file) which uses the LaTeX document class
7079 \begin_inset Flex Code
7082 \begin_layout Plain Layout
7088 (the default is to use the same name as the layout).
7090 \begin_inset Quotes eld
7094 \begin_inset Quotes erd
7097 that appears above is used as a description of the text class in the
7098 \begin_inset Flex MenuItem
7101 \begin_layout Plain Layout
7102 Document\SpecialChar \menuseparator
7111 \begin_layout Standard
7112 Let's assume that you wrote your own text class that uses the
7113 \begin_inset Flex Code
7116 \begin_layout Plain Layout
7122 document class, but where you changed the appearance of the section headings.
7123 If you put it in a file
7124 \begin_inset Flex Code
7127 \begin_layout Plain Layout
7133 , the header of this file should be:
7136 \begin_layout LyX-Code
7139 #% Do not delete the line below; configure depends on this
7142 \begin_layout LyX-Code
7147 DeclareLaTeXClass[article]{article (with my own headings)}
7150 \begin_layout Standard
7151 This declares a text class
7152 \begin_inset Flex Code
7155 \begin_layout Plain Layout
7161 , associated with the LaTeX document class
7162 \begin_inset Flex Code
7165 \begin_layout Plain Layout
7172 \begin_inset Quotes eld
7175 article (with my own headings)
7176 \begin_inset Quotes erd
7180 If your text class depends on several packages, you can declare it as:
7183 \begin_layout LyX-Code
7186 #% Do not delete the line below; configure depends on this
7189 \begin_layout LyX-Code
7194 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7197 \begin_layout Standard
7198 This indicates that your text class uses the
7199 \begin_inset Flex Code
7202 \begin_layout Plain Layout
7209 Finally, it is also possible to declare classes for DocBook code.
7210 Typical declarations will look like:
7213 \begin_layout LyX-Code
7216 #% Do not delete the line below; configure depends on this
7219 \begin_layout LyX-Code
7224 DeclareDocBookClass[article]{SGML (DocBook article)}
7227 \begin_layout Standard
7228 Note that these declarations can also be given an optional parameter declaring
7229 the name of the document class (but not a list).
7232 \begin_layout Standard
7233 So, to be as explicit as possible, the form of the layout declaration is:
7236 \begin_layout LyX-Code
7241 DeclareLaTeXClass[class,package.sty]{layout description}
7244 \begin_layout Standard
7245 The class need only be specified if the name of the LaTeX class file and
7246 the name of the layout file are different or if there are packages to load.
7247 If the name of the class file is not specified, then LyX will simply assume
7248 that it is the same as the name of the layout file.
7251 \begin_layout Standard
7252 When the text class has been modified to your taste, all you have to do
7253 is to copy it either to
7254 \begin_inset Flex Code
7257 \begin_layout Plain Layout
7264 \begin_inset Flex Code
7267 \begin_layout Plain Layout
7274 \begin_inset Flex MenuItem
7277 \begin_layout Plain Layout
7278 Tools\SpecialChar \menuseparator
7284 , exit LyX and restart.
7285 Then your new text class should be available along with the others.
7288 \begin_layout Standard
7289 Once the layout file is installed, you can edit it and see your changes
7290 without having to reconfigure or to restart LyX.
7295 \begin_layout Plain Layout
7296 In versions of LyX prior to 1.6, this was not true.
7297 As a result, editing layout files was very time consuming, since you had
7298 constantly to restart LyX to see changes.
7303 You can force a reload of the current layout by using the LyX function
7305 \begin_inset Flex MenuItem
7308 \begin_layout Plain Layout
7315 There is no default binding for this function—though, of course, you can
7316 bind it to a key yourself.
7317 But you will normally use this function simply by entering it in the mini-buffe
7322 \begin_layout Standard
7328 \begin_inset Flex MenuItem
7331 \begin_layout Plain Layout
7337 is very much an `advanced feature'.
7342 recommended that you save your work before using this function.
7347 recommended that you not attempt to edit layout information while simultaneousl
7348 y working on a document that you care about.
7349 Use a test document.
7350 Syntax errors and the like in your layout file could cause peculiar behavior.
7351 In particular, such errors could cause LyX to regard the current layout
7352 as invalid and to attempt to switch to some other layout.
7356 \begin_layout Plain Layout
7357 Really bad syntax errors may even caused LyX to exit.
7358 This is because certain sorts of errors may make LyX unable to read
7368 The LyX team strives to keep LyX stable in such situations, but safe is
7373 \begin_layout Plain Layout
7374 While we're giving advice: make regular backups.
7375 And be nice to your mother.
7383 \begin_layout Subsection
7384 The Module declaration
7387 \begin_layout Standard
7388 A module must begin with a line like the following:
7391 \begin_layout LyX-Code
7394 DeclareLyXModule[endnotes.sty]{Endnotes}
7397 \begin_layout Standard
7398 The mandatory argument, in curly brackets, is the name of the module, as
7400 \begin_inset Flex MenuItem
7403 \begin_layout Plain Layout
7404 Document\SpecialChar \menuseparator
7411 The argument in square brackets is optional: It declares any LaTeX packages
7412 on which the module depends.
7413 Please note that only packages about which LyX knows should be listed in
7414 the square brackets.
7418 \begin_layout Plain Layout
7419 The list of such packages is documented only in the source code.
7424 LyX will not check for arbitrary packages.
7425 It is also possible to use the form
7426 \begin_inset Flex MenuItem
7429 \begin_layout Plain Layout
7435 as an optional argument, which declares that the module can only be used
7436 when there exists a conversion chain between the formats `
7437 \begin_inset Flex Code
7440 \begin_layout Plain Layout
7447 \begin_inset Flex Code
7450 \begin_layout Plain Layout
7459 \begin_layout Standard
7460 The module declaration should then be followed by lines like the following:
7463 \begin_layout LyX-Code
7467 \begin_layout LyX-Code
7468 #Adds an endnote command, in addition to footnotes.
7472 \begin_layout LyX-Code
7473 #You will need to add
7475 theendnotes in TeX code where you
7478 \begin_layout LyX-Code
7479 #want the endnotes to appear.
7483 \begin_layout LyX-Code
7487 \begin_layout LyX-Code
7488 #Requires: somemodule | othermodule
7491 \begin_layout LyX-Code
7492 #Excludes: badmodule
7495 \begin_layout Standard
7496 The description is used in
7497 \begin_inset Flex MenuItem
7500 \begin_layout Plain Layout
7501 Document\SpecialChar \menuseparator
7507 to provide the user with information about what the module does.
7509 \begin_inset Flex Code
7512 \begin_layout Plain Layout
7518 line is used to identify other modules with which this one must be used;
7520 \begin_inset Flex Code
7523 \begin_layout Plain Layout
7529 line is used to identify modules with which this one may not be used.
7530 Both are optional, and, as shown, multiple modules should be separated
7531 with the pipe symbol: |.
7532 Note that the required modules are treated disjunctively:
7536 of the required modules must be used.
7541 excluded module may be used.
7542 Note that modules are identified here by their
7547 \begin_inset Flex Code
7550 \begin_layout Plain Layout
7558 \begin_inset Flex Code
7561 \begin_layout Plain Layout
7568 \begin_inset Flex Code
7571 \begin_layout Plain Layout
7580 \begin_layout Subsection
7584 \begin_layout Standard
7585 The first non-comment line of any layout file, included file, or module
7590 contain the file format number:
7593 \begin_layout Description
7594 \begin_inset Flex Code
7597 \begin_layout Plain Layout
7604 \begin_inset Flex Code
7607 \begin_layout Plain Layout
7613 ] The format of the layout file.
7616 \begin_layout Standard
7617 This tag was introduced with LyX 1.4.0.
7618 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7619 and are considered to be of format 1.
7620 The format for the present version of LyX is format 21.
7621 But each version of LyX is capable of reading earlier versions' layout
7622 files, just as they are capable of reading files produced by earlier versions
7624 There is, however, no provision for converting to earlier formats.
7625 So LyX 1.6.x will not read layout files in format 21 but only files in format
7629 \begin_layout Subsection
7630 \begin_inset CommandInset label
7632 name "sub:General-text-class"
7636 General text class parameters
7639 \begin_layout Standard
7640 These are general parameters that govern the behavior of an entire document
7646 mean that they must appear in
7647 \begin_inset Flex Code
7650 \begin_layout Plain Layout
7656 files rather than in modules.
7657 A module can contain any layout tag.)
7660 \begin_layout Description
7661 \begin_inset Flex Code
7664 \begin_layout Plain Layout
7670 Adds information that will be output in the
7671 \begin_inset Flex Code
7674 \begin_layout Plain Layout
7680 block when this document class is output to XHTML.
7681 Typically, this would be used to output CSS style information, but it can
7682 be used for anything that can appear in
7683 \begin_inset Flex Code
7686 \begin_layout Plain Layout
7694 \begin_inset Quotes eld
7698 \begin_inset Flex Code
7701 \begin_layout Plain Layout
7708 \begin_inset Quotes erd
7714 \begin_layout Description
7715 \begin_inset Flex Code
7718 \begin_layout Plain Layout
7724 Adds information to the document preamble.
7726 \begin_inset Quotes eld
7730 \begin_inset Flex Code
7733 \begin_layout Plain Layout
7740 \begin_inset Quotes erd
7746 \begin_layout Description
7747 \begin_inset Flex Code
7750 \begin_layout Plain Layout
7756 Defines formats for use in the display of bibliographic information.
7758 \begin_inset CommandInset ref
7760 reference "sub:Citation-format-description"
7766 \begin_inset Quotes eld
7770 \begin_inset Flex Code
7773 \begin_layout Plain Layout
7780 \begin_inset Quotes erd
7786 \begin_layout Description
7787 \begin_inset Flex Code
7790 \begin_layout Plain Layout
7796 Describes various global options supported by the document class.
7798 \begin_inset space ~
7802 \begin_inset CommandInset ref
7804 reference "sub:ClassOptions"
7810 \begin_inset Quotes eld
7814 \begin_inset Flex Code
7817 \begin_layout Plain Layout
7824 \begin_inset Quotes erd
7830 \begin_layout Description
7831 \begin_inset Flex Code
7834 \begin_layout Plain Layout
7841 \begin_inset Flex Code
7844 \begin_layout Plain Layout
7853 \begin_inset Flex Code
7856 \begin_layout Plain Layout
7862 ] Whether the class should
7866 to having one or two columns.
7867 Can be changed in the
7868 \begin_inset Flex MenuItem
7871 \begin_layout Plain Layout
7872 Document\SpecialChar \menuseparator
7881 \begin_layout Description
7882 \begin_inset Flex Code
7885 \begin_layout Plain Layout
7892 \begin_inset Flex Code
7895 \begin_layout Plain Layout
7901 ] This sequence defines the properties for a counter.
7902 If the counter does not yet exist, it is created; if it does exist, it
7905 \begin_inset Quotes eld
7909 \begin_inset Flex Code
7912 \begin_layout Plain Layout
7919 \begin_inset Quotes erd
7923 \begin_inset Newline newline
7927 \begin_inset space ~
7931 \begin_inset CommandInset ref
7933 reference "sub:Counters"
7937 for details on counters.
7940 \begin_layout Description
7941 \begin_inset Flex Code
7944 \begin_layout Plain Layout
7950 Sets the default font used to display the document.
7952 \begin_inset space ~
7956 \begin_inset CommandInset ref
7958 reference "sub:Font-description"
7962 for how to declare fonts.
7964 \begin_inset Quotes eld
7968 \begin_inset Flex Code
7971 \begin_layout Plain Layout
7978 \begin_inset Quotes erd
7984 \begin_layout Description
7985 \begin_inset Flex Code
7988 \begin_layout Plain Layout
7995 \begin_inset Flex Code
7998 \begin_layout Plain Layout
8004 Specifies a module to be included by default with this document class.
8005 The module should be specified by filename without the
8006 \begin_inset Flex Code
8009 \begin_layout Plain Layout
8016 The user can still remove the module, but it will be active at the outset.
8017 (This applies only when new files are created, or when this class is chosen
8018 for an existing document.)
8021 \begin_layout Description
8022 \begin_inset Flex Code
8025 \begin_layout Plain Layout
8032 \begin_inset Flex Code
8035 \begin_layout Plain Layout
8041 ] This is the style that will be assigned to new paragraphs, usually
8042 \begin_inset Flex MenuItem
8045 \begin_layout Plain Layout
8052 This will default to the first defined style if not given, but you are
8053 encouraged to use this directive.
8056 \begin_layout Description
8057 \begin_inset Flex Code
8060 \begin_layout Plain Layout
8067 \begin_inset Flex Code
8070 \begin_layout Plain Layout
8076 ] This tag indicates that the module in question—which should be specified
8077 by filename without the
8078 \begin_inset Flex Code
8081 \begin_layout Plain Layout
8087 extension—cannot be used with this document class.
8088 This might be used in a journal-specific layout file to prevent, say, the
8090 \begin_inset Flex Code
8093 \begin_layout Plain Layout
8099 module that numbers theorems by section.
8104 be used in a module.
8105 Modules have their own way of excluding other modules (see
8106 \begin_inset CommandInset ref
8108 reference "sub:Layout-modules"
8115 \begin_layout Description
8116 \begin_inset Flex Code
8119 \begin_layout Plain Layout
8125 Defines a new float.
8127 \begin_inset space ~
8131 \begin_inset CommandInset ref
8133 reference "sub:Floats"
8139 \begin_inset Quotes eld
8143 \begin_inset Flex Code
8146 \begin_layout Plain Layout
8153 \begin_inset Quotes erd
8159 \begin_layout Description
8160 \begin_inset Flex Code
8163 \begin_layout Plain Layout
8169 Sets the information that will be output in the
8170 \begin_inset Flex Code
8173 \begin_layout Plain Layout
8179 block when this document class is output to XHTML.
8180 Note that this will completely override any prior
8181 \begin_inset Flex Code
8184 \begin_layout Plain Layout
8191 \begin_inset Flex Code
8194 \begin_layout Plain Layout
8202 \begin_inset Flex Code
8205 \begin_layout Plain Layout
8211 if you just want to add material to the preamble.) Must end with
8212 \begin_inset Quotes eld
8216 \begin_inset Flex Code
8219 \begin_layout Plain Layout
8226 \begin_inset Quotes erd
8232 \begin_layout Description
8233 \begin_inset Flex Code
8236 \begin_layout Plain Layout
8243 \begin_inset Flex Code
8246 \begin_layout Plain Layout
8252 ] The layout to use for the table of contents, bibliography, and so forth,
8253 when the document is output to HTML.
8254 For articles, this should normally be Section; for books, Chapter.
8255 If it is not given, then LyX will attempt to figure out which layout to
8259 \begin_layout Description
8260 \begin_inset Flex Code
8263 \begin_layout Plain Layout
8270 \begin_inset Flex Code
8273 \begin_layout Plain Layout
8279 ] Modifies the properties of the given counter.
8280 If the counter does not exist, the section is ignored.
8282 \begin_inset Quotes eld
8286 \begin_inset Flex Code
8289 \begin_layout Plain Layout
8296 \begin_inset Quotes erd
8300 \begin_inset Newline newline
8304 \begin_inset space ~
8308 \begin_inset CommandInset ref
8310 reference "sub:Counters"
8314 for details on counters.
8317 \begin_layout Description
8318 \begin_inset Flex Code
8321 \begin_layout Plain Layout
8328 \begin_inset Flex Code
8331 \begin_layout Plain Layout
8337 ] Modifies the properties of the given paragraph style.
8338 If the style does not exist, the section is ignored.
8340 \begin_inset Quotes eld
8344 \begin_inset Flex Code
8347 \begin_layout Plain Layout
8354 \begin_inset Quotes erd
8360 \begin_layout Description
8361 \begin_inset Flex Code
8364 \begin_layout Plain Layout
8370 As its name implies, this command allows you to include another layout
8371 definition file within yours to avoid duplicating commands.
8372 Common examples are the standard layout files, for example,
8373 \begin_inset Flex Code
8376 \begin_layout Plain Layout
8382 , which contains most of the basic layouts.
8385 \begin_layout Description
8386 \begin_inset Flex Code
8389 \begin_layout Plain Layout
8395 This section (re-)defines the layout of an inset.
8396 It can be applied to an existing inset or to a new, user-defined inset,
8397 e.g., a new character style.
8399 \begin_inset Quotes eld
8403 \begin_inset Flex Code
8406 \begin_layout Plain Layout
8413 \begin_inset Quotes erd
8417 \begin_inset Newline newline
8421 \begin_inset space ~
8425 \begin_inset CommandInset ref
8427 reference "sub:Flex-insets-and"
8431 for more information.
8435 \begin_layout Description
8436 \begin_inset Flex Code
8439 \begin_layout Plain Layout
8446 \begin_inset Flex Code
8449 \begin_layout Plain Layout
8455 ] A string that indicates the width of the left margin on the screen, for
8457 \begin_inset Quotes eld
8461 \begin_inset Quotes erd
8465 (Note that this is not a `length', like
8466 \begin_inset Quotes eld
8470 \begin_inset Quotes erd
8476 \begin_layout Description
8477 \begin_inset Flex Code
8480 \begin_layout Plain Layout
8487 \begin_inset Flex Code
8490 \begin_layout Plain Layout
8496 ] This command deletes an existing counter, usually one defined in an included
8500 \begin_layout Description
8501 \begin_inset Flex Code
8504 \begin_layout Plain Layout
8510 This command deletes an existing float.
8511 This is particularly useful when you want to suppress a float that has
8512 been defined in an input file.
8515 \begin_layout Description
8516 \begin_inset Flex Code
8519 \begin_layout Plain Layout
8525 This command deletes an existing style.
8526 This is particularly useful when you want to suppress a style that has
8527 be defined in an input file.
8530 \begin_layout Description
8531 \begin_inset Flex Code
8534 \begin_layout Plain Layout
8540 A string indicating the file format (as defined in the Preferences dialog)
8541 produced by this class.
8542 It is mainly useful when
8543 \begin_inset Flex Code
8546 \begin_layout Plain Layout
8552 is `literate' and one wants to define a new type of literate document.
8553 This string is reset to `docbook', `latex', or `literate' when the correspondin
8555 \begin_inset Flex Code
8558 \begin_layout Plain Layout
8564 parameter is encountered.
8567 \begin_layout Description
8568 \begin_inset Flex Code
8571 \begin_layout Plain Layout
8577 A string indicating what sort of output documents using this class will
8579 At present, the options are: `docbook', `latex', and `literate'.
8582 \begin_layout Description
8583 \begin_inset Flex Code
8586 \begin_layout Plain Layout
8593 \begin_inset Flex Code
8596 \begin_layout Plain Layout
8605 \begin_inset Flex Code
8608 \begin_layout Plain Layout
8615 \begin_inset Flex Code
8618 \begin_layout Plain Layout
8624 ] The default pagestyle.
8625 Can be changed in the
8626 \begin_inset Flex MenuItem
8629 \begin_layout Plain Layout
8630 Document\SpecialChar \menuseparator
8639 \begin_layout Description
8640 \begin_inset Flex Code
8643 \begin_layout Plain Layout
8649 Sets the preamble for the LaTeX document.
8650 Note that this will completely override any prior
8651 \begin_inset Flex Code
8654 \begin_layout Plain Layout
8661 \begin_inset Flex Code
8664 \begin_layout Plain Layout
8672 \begin_inset Flex Code
8675 \begin_layout Plain Layout
8681 if you just want to add material to the preamble.) Must end with
8682 \begin_inset Quotes eld
8686 \begin_inset Flex Code
8689 \begin_layout Plain Layout
8696 \begin_inset Quotes erd
8702 \begin_layout Description
8703 \begin_inset Flex Code
8706 \begin_layout Plain Layout
8713 \begin_inset Flex Code
8716 \begin_layout Plain Layout
8723 \begin_inset Flex Code
8726 \begin_layout Plain Layout
8735 \begin_inset Flex Code
8738 \begin_layout Plain Layout
8744 ] Whether the class already provides the feature
8745 \begin_inset Flex Code
8748 \begin_layout Plain Layout
8755 A feature is in general the name of a package (
8756 \begin_inset Flex Code
8759 \begin_layout Plain Layout
8766 \begin_inset Flex Code
8769 \begin_layout Plain Layout
8775 , \SpecialChar \ldots{}
8777 \begin_inset Flex Code
8780 \begin_layout Plain Layout
8787 \begin_inset Flex Code
8790 \begin_layout Plain Layout
8796 ,\SpecialChar \ldots{}
8797 ); the complete list of supported features is unfortunately not documented
8798 outside the LyX source code—but see
8799 \begin_inset Flex Code
8802 \begin_layout Plain Layout
8808 if you're interested.
8810 \begin_inset Flex MenuItem
8813 \begin_layout Plain Layout
8814 Help\SpecialChar \menuseparator
8820 also gives an overview of the supported packages.
8823 \begin_layout Description
8824 \begin_inset Flex Code
8827 \begin_layout Plain Layout
8834 \begin_inset Flex Code
8837 \begin_layout Plain Layout
8843 ] Indicates that this layout provides the functionality of the module mentioned,
8844 which should be specified by the filename without the
8845 \begin_inset Flex Code
8848 \begin_layout Plain Layout
8855 This will typically be used if the layout includes the module directly,
8856 rather than using the
8857 \begin_inset Flex Code
8860 \begin_layout Plain Layout
8866 tag to indicate that it ought to be used.
8867 It could also be used in a module that provided an alternate implementation
8868 of the same functionality.
8871 \begin_layout Description
8872 \begin_inset Flex Code
8875 \begin_layout Plain Layout
8882 \begin_inset Flex Code
8885 \begin_layout Plain Layout
8891 ] Whether the class requires the feature
8892 \begin_inset Flex Code
8895 \begin_layout Plain Layout
8902 Multiple features must be separated by commas.
8903 Note that you can only request supported features.
8905 \begin_inset Flex Code
8908 \begin_layout Plain Layout
8914 for a list of these.)
8917 \begin_layout Description
8918 \begin_inset Flex Code
8921 \begin_layout Plain Layout
8927 A string that indicates the width of the right margin on the screen, for
8929 \begin_inset Quotes eld
8933 \begin_inset Quotes erd
8939 \begin_layout Description
8940 \begin_inset Flex Code
8943 \begin_layout Plain Layout
8949 Sets which divisions get numbered.
8951 \begin_inset Flex Code
8954 \begin_layout Plain Layout
8963 \begin_layout Description
8964 \begin_inset Flex Code
8967 \begin_layout Plain Layout
8974 \begin_inset Flex Code
8977 \begin_layout Plain Layout
8986 \begin_inset Flex Code
8989 \begin_layout Plain Layout
8995 ] Whether the class-default should be printing on one or both sides of the
8997 Can be changed in the
8998 \begin_inset Flex MenuItem
9001 \begin_layout Plain Layout
9002 Document\SpecialChar \menuseparator
9011 \begin_layout Description
9012 \begin_inset Flex Code
9015 \begin_layout Plain Layout
9021 This sequence defines a paragraph style.
9022 If the style does not yet exist, it is created; if it does exist, its parameter
9025 \begin_inset Quotes eld
9029 \begin_inset Flex Code
9032 \begin_layout Plain Layout
9039 \begin_inset Quotes erd
9043 \begin_inset Newline newline
9047 \begin_inset space ~
9051 \begin_inset CommandInset ref
9053 reference "sub:Paragraph-Styles"
9057 for details on paragraph styles.
9060 \begin_layout Description
9061 \begin_inset Flex Code
9064 \begin_layout Plain Layout
9071 \begin_inset Flex Code
9074 \begin_layout Plain Layout
9080 ] The name of the command or environment to be used with
9081 \begin_inset Flex Code
9084 \begin_layout Plain Layout
9093 \begin_layout Description
9094 \begin_inset Flex Code
9097 \begin_layout Plain Layout
9104 \begin_inset Flex Code
9107 \begin_layout Plain Layout
9116 \begin_inset Flex Code
9119 \begin_layout Plain Layout
9125 ] Indicates what kind of markup is used to define the title of a document.
9127 \begin_inset Flex Code
9130 \begin_layout Plain Layout
9136 means that the macro with name
9137 \begin_inset Flex Code
9140 \begin_layout Plain Layout
9146 will be inserted after the last layout which has
9147 \begin_inset Quotes eld
9151 \begin_inset Flex Code
9154 \begin_layout Plain Layout
9161 \begin_inset Quotes erd
9166 \begin_inset Flex Code
9169 \begin_layout Plain Layout
9175 corresponds to the case where the block of paragraphs which have
9176 \begin_inset Quotes eld
9180 \begin_inset Flex Code
9183 \begin_layout Plain Layout
9190 \begin_inset Quotes erd
9193 should be enclosed into the
9194 \begin_inset Flex Code
9197 \begin_layout Plain Layout
9206 \begin_layout Description
9207 \begin_inset Flex Code
9210 \begin_layout Plain Layout
9216 Sets which divisions are included in the table of contents.
9218 \begin_inset Flex Code
9221 \begin_layout Plain Layout
9230 \begin_layout Subsection
9231 \begin_inset Flex Code
9234 \begin_layout Plain Layout
9241 \begin_inset CommandInset label
9243 name "sub:ClassOptions"
9250 \begin_layout Standard
9252 \begin_inset Flex Code
9255 \begin_layout Plain Layout
9261 section can contain the following entries:
9264 \begin_layout Description
9265 \begin_inset Flex Code
9268 \begin_layout Plain Layout
9275 \begin_inset Flex Code
9278 \begin_layout Plain Layout
9284 ] The list of available font sizes for the document's main font, separated
9286 \begin_inset Quotes eld
9290 \begin_inset Flex Code
9293 \begin_layout Plain Layout
9300 \begin_inset Quotes erd
9306 \begin_layout Description
9307 \begin_inset Flex Code
9310 \begin_layout Plain Layout
9316 Used to set the DTD line with XML-based output classes.
9318 \begin_inset space \thinspace{}
9322 \begin_inset Quotes eld
9325 -//OASIS//DTD DocBook V4.2//EN
9326 \begin_inset Quotes erd
9332 \begin_layout Description
9333 \begin_inset Flex Code
9336 \begin_layout Plain Layout
9343 \begin_inset Flex Code
9346 \begin_layout Plain Layout
9347 string="empty|plain|headings|fancy"
9352 ] The list of available page styles, separated by
9353 \begin_inset Quotes eld
9357 \begin_inset Flex Code
9360 \begin_layout Plain Layout
9367 \begin_inset Quotes erd
9373 \begin_layout Description
9374 \begin_inset Flex Code
9377 \begin_layout Plain Layout
9384 \begin_inset Flex Code
9387 \begin_layout Plain Layout
9393 ] Some document class options, separated by a comma, that will be added
9394 to the optional part of the
9395 \begin_inset Flex Code
9398 \begin_layout Plain Layout
9409 \begin_layout Standard
9411 \begin_inset Flex Code
9414 \begin_layout Plain Layout
9420 section must end with
9421 \begin_inset Quotes eld
9425 \begin_inset Flex Code
9428 \begin_layout Plain Layout
9435 \begin_inset Quotes erd
9441 \begin_layout Subsection
9443 \begin_inset CommandInset label
9445 name "sub:Paragraph-Styles"
9452 \begin_layout Standard
9453 A paragraph style description looks like this:
9457 \begin_layout Plain Layout
9458 Note that this will either define a new layout or modify an existing one.
9466 \begin_layout LyX-Code
9473 \begin_layout LyX-Code
9477 \begin_layout LyX-Code
9481 \begin_layout Standard
9482 where the following commands are allowed:
9485 \begin_layout Description
9486 \begin_inset Flex Code
9489 \begin_layout Plain Layout
9496 \begin_inset Flex Code
9499 \begin_layout Plain Layout
9504 , left, right, center
9509 ] Paragraph alignment.
9512 \begin_layout Description
9513 \begin_inset Flex Code
9516 \begin_layout Plain Layout
9523 \begin_inset Flex Code
9526 \begin_layout Plain Layout
9531 , left, right, center
9536 ] A comma separated list of permitted alignments.
9537 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9539 For example a right-aligned or centered enumeration isn't possible.)
9542 \begin_layout Description
9543 \begin_inset Flex Code
9546 \begin_layout Plain Layout
9552 Note that this will completely override any prior
9553 \begin_inset Flex Code
9556 \begin_layout Plain Layout
9562 declaration for this style.
9564 \begin_inset Quotes eld
9568 \begin_inset Flex Code
9571 \begin_layout Plain Layout
9578 \begin_inset Quotes erd
9583 \begin_inset CommandInset ref
9585 reference "sub:I18n"
9589 for details on its use.
9592 \begin_layout Description
9593 \begin_inset Flex Code
9596 \begin_layout Plain Layout
9603 \begin_inset Flex Code
9606 \begin_layout Plain Layout
9616 \begin_layout Plain Layout
9617 Note that a `float' here is a real number, such as: 1.5.
9622 The vertical space with which the last of a chain of paragraphs with this
9623 layout is separated from the following paragraph.
9624 If the next paragraph has another layout, the separations are not simply
9625 added, but the maximum is taken.
9628 \begin_layout Description
9629 \begin_inset Flex Code
9632 \begin_layout Plain Layout
9639 \begin_inset Flex Code
9642 \begin_layout Plain Layout
9648 The category for this style.
9649 This is used to group related styles in the Layout combobox on the toolbar.
9650 Any string can be used, but you may want to use existing categories with
9655 \begin_layout Description
9656 \begin_inset Flex Code
9659 \begin_layout Plain Layout
9665 Depth of XML command.
9666 Used only with XML-type formats.
9669 \begin_layout Description
9670 \begin_inset Flex Code
9673 \begin_layout Plain Layout
9680 \begin_inset CommandInset label
9682 name "des:CopyStyle"
9687 \begin_inset Flex Code
9690 \begin_layout Plain Layout
9696 Copies all the features of an existing style into the current one.
9700 \begin_layout Description
9701 \begin_inset Flex Code
9704 \begin_layout Plain Layout
9710 The name of a style whose preamble should be output
9715 This allows to ensure some ordering of the preamble snippets when macros
9716 definitions depend on one another.
9720 \begin_layout Plain Layout
9721 Note that, besides that functionality, there is no way to ensure any ordering
9723 The ordering that you see in a given version of LyX may change without
9724 warning in later versions.
9732 \begin_layout Description
9733 \begin_inset Flex Code
9736 \begin_layout Plain Layout
9743 \begin_inset Flex Code
9746 \begin_layout Plain Layout
9751 , Box, Filled_Box, Static
9756 ] The type of label that stands at the end of the paragraph (or sequence
9758 \begin_inset Flex Code
9761 \begin_layout Plain Layout
9768 \begin_inset Flex Code
9771 \begin_layout Plain Layout
9778 \begin_inset Flex Code
9781 \begin_layout Plain Layout
9788 \begin_inset Flex Code
9791 \begin_layout Plain Layout
9799 \begin_inset Flex Code
9802 \begin_layout Plain Layout
9809 \begin_inset Quotes eld
9813 \begin_inset Quotes erd
9817 \begin_inset Flex Code
9820 \begin_layout Plain Layout
9827 \begin_inset Flex Code
9830 \begin_layout Plain Layout
9831 \begin_inset space ~
9840 \begin_inset space ~
9843 black) square suitable for end of proof markers,
9844 \begin_inset Flex Code
9847 \begin_layout Plain Layout
9853 is an explicit text string.
9856 \begin_layout Description
9857 \begin_inset Flex Code
9860 \begin_layout Plain Layout
9867 \begin_inset Flex Code
9870 \begin_layout Plain Layout
9876 ] The string used for a label with a
9877 \begin_inset Flex Code
9880 \begin_layout Plain Layout
9887 \begin_inset Flex Code
9890 \begin_layout Plain Layout
9900 \begin_layout Description
9901 \begin_inset Flex Code
9904 \begin_layout Plain Layout
9911 \begin_inset Flex Code
9914 \begin_layout Plain Layout
9925 \begin_inset Flex Code
9928 \begin_layout Plain Layout
9937 \begin_layout Description
9938 \begin_inset Flex Code
9941 \begin_layout Plain Layout
9948 \begin_inset Flex Code
9951 \begin_layout Plain Layout
9961 ] With this parameter the
9962 \begin_inset Flex MenuItem
9965 \begin_layout Plain Layout
9972 \begin_inset Quotes eld
9975 Vertical space above
9976 \begin_inset Quotes erd
9980 \begin_inset Flex MenuItem
9983 \begin_layout Plain Layout
9984 Edit\SpecialChar \menuseparator
9986 \begin_inset space ~
9994 dialog can be set when initializing a paragraph with this style.
9998 \begin_layout Plain Layout
10001 Note from Jean-Marc:
10003 I'm not sure that this setting has much use, and it should probably be
10004 removed in later versions.
10012 \begin_layout Description
10013 \begin_inset Flex Code
10016 \begin_layout Plain Layout
10022 The font used for both the text body
10028 \begin_inset space ~
10032 \begin_inset CommandInset ref
10034 reference "sub:Font-description"
10039 Note that defining this font automatically defines the
10040 \begin_inset Flex Code
10043 \begin_layout Plain Layout
10050 So you should define this one first if you also want to define
10051 \begin_inset Flex Code
10054 \begin_layout Plain Layout
10063 \begin_layout Description
10064 \begin_inset Flex Code
10067 \begin_layout Plain Layout
10074 \begin_inset CommandInset label
10076 name "des:FreeSpacing"
10081 \begin_inset Flex Code
10084 \begin_layout Plain Layout
10093 \begin_inset Flex Code
10096 \begin_layout Plain Layout
10102 ] Usually LyX doesn't allow you to insert more than one space between words,
10103 since a space is considered as the separation between two words, not a
10104 character or symbol of its own.
10105 This is a very fine thing but sometimes annoying, for example, when typing
10106 program code or plain LaTeX code.
10108 \begin_inset Flex Code
10111 \begin_layout Plain Layout
10118 Note that LyX will create protected blanks for the additional blanks when
10119 in another mode than LaTeX-mode.
10122 \begin_layout Description
10123 \begin_inset Flex Code
10126 \begin_layout Plain Layout
10132 These tags are used with XHTML output.
10134 \begin_inset CommandInset ref
10136 reference "sub:Paragraph-Style-XHTML"
10143 \begin_layout Description
10144 \begin_inset Flex Code
10147 \begin_layout Plain Layout
10153 [[FIXME]] (Used only with XML-type formats.)
10156 \begin_layout Description
10157 \begin_inset Flex Code
10160 \begin_layout Plain Layout
10167 \begin_inset Flex Code
10170 \begin_layout Plain Layout
10176 If 1, marks the layout as to be included in the document preamble rather
10177 than in the document body.
10178 This is useful for document classes that want such information as the title
10179 and author to appear in the preamble.
10180 Note that this works only for layouts for which the
10181 \begin_inset Flex Code
10184 \begin_layout Plain Layout
10191 \begin_inset Flex Code
10194 \begin_layout Plain Layout
10201 \begin_inset Flex Code
10204 \begin_layout Plain Layout
10213 \begin_layout Description
10214 \begin_inset Flex Code
10217 \begin_layout Plain Layout
10224 \begin_inset Flex Code
10227 \begin_layout Plain Layout
10233 If 1, marks the layout as being part of a title block (see also the
10234 \begin_inset Flex Code
10237 \begin_layout Plain Layout
10244 \begin_inset Flex Code
10247 \begin_layout Plain Layout
10256 \begin_layout Description
10257 \begin_inset Flex Code
10260 \begin_layout Plain Layout
10267 \begin_inset Flex Code
10270 \begin_layout Plain Layout
10276 ] This provides extra space between paragraphs that have the same layout.
10277 If you put other layouts into an environment, each is separated with the
10279 \begin_inset Flex Code
10282 \begin_layout Plain Layout
10289 But the whole items of the environment are additionally separated with
10291 \begin_inset Flex Code
10294 \begin_layout Plain Layout
10301 Note that this is a
10306 \begin_layout Description
10307 \begin_inset Flex Code
10310 \begin_layout Plain Layout
10316 [[FIXME]] (Used only with XML-type formats.)
10319 \begin_layout Description
10320 \begin_inset Flex Code
10323 \begin_layout Plain Layout
10330 \begin_inset CommandInset label
10332 name "des:KeepEmpty"
10337 \begin_inset Flex Code
10340 \begin_layout Plain Layout
10349 \begin_inset Flex Code
10352 \begin_layout Plain Layout
10358 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10359 lead to empty LaTeX output.
10360 There are some cases where this could be desirable however: in a letter
10361 template, the required fields can be provided as empty fields, so that
10362 people do not forget them; in some special classes, a layout can be used
10363 as some kind of break, which does not contain actual text.
10366 \begin_layout Description
10367 \begin_inset Flex Code
10370 \begin_layout Plain Layout
10376 [float=0] The vertical space between the label and the text body.
10377 Only used for labels that are above the text body (
10378 \begin_inset Flex Code
10381 \begin_layout Plain Layout
10388 \begin_inset Flex Code
10391 \begin_layout Plain Layout
10392 Centered_Top_Environment
10400 \begin_layout Description
10401 \begin_inset Flex Code
10404 \begin_layout Plain Layout
10411 \begin_inset Flex Code
10414 \begin_layout Plain Layout
10421 \begin_inset Newline newline
10424 The name of the counter for automatic numbering.
10426 \begin_inset Newline newline
10434 \begin_inset Flex Code
10437 \begin_layout Plain Layout
10444 \begin_inset Flex Code
10447 \begin_layout Plain Layout
10454 In that case, the counter will be stepped each time the layout appears.
10456 \begin_inset Newline newline
10464 \begin_inset Flex Code
10467 \begin_layout Plain Layout
10474 \begin_inset Flex Code
10477 \begin_layout Plain Layout
10483 , though this case is a bit complicated.
10484 Suppose you declare
10485 \begin_inset Quotes eld
10489 \begin_inset Flex Code
10492 \begin_layout Plain Layout
10493 LabelCounter myenum
10499 \begin_inset Quotes erd
10503 Then the actual counters used are
10504 \begin_inset Flex Code
10507 \begin_layout Plain Layout
10514 \begin_inset Flex Code
10517 \begin_layout Plain Layout
10524 \begin_inset Flex Code
10527 \begin_layout Plain Layout
10534 \begin_inset Flex Code
10537 \begin_layout Plain Layout
10543 , much as in LaTeX.
10544 These counters must all be declared separately.
10545 \begin_inset Newline newline
10549 \begin_inset CommandInset ref
10551 reference "sub:Counters"
10555 for details on counters.
10558 \begin_layout Description
10559 \begin_inset Flex Code
10562 \begin_layout Plain Layout
10568 The font used for the label.
10570 \begin_inset space ~
10574 \begin_inset CommandInset ref
10576 reference "sub:Font-description"
10583 \begin_layout Description
10584 \begin_inset Flex Code
10587 \begin_layout Plain Layout
10593 Text that indicates how far a label should be indented.
10596 \begin_layout Description
10597 \begin_inset Flex Code
10600 \begin_layout Plain Layout
10607 \begin_inset Flex Code
10610 \begin_layout Plain Layout
10616 ] The horizontal space between the label and the text body.
10617 Only used for labels that are not above the text body.
10620 \begin_layout Description
10621 \begin_inset Flex Code
10624 \begin_layout Plain Layout
10631 \begin_inset Flex Code
10634 \begin_layout Plain Layout
10640 ] The string used for a label with a
10641 \begin_inset Flex Code
10644 \begin_layout Plain Layout
10652 \begin_inset Flex Code
10655 \begin_layout Plain Layout
10661 is set, this string can be contain the special formatting commands described
10663 \begin_inset CommandInset ref
10665 reference "sub:Counters"
10673 \begin_layout Plain Layout
10674 For the sake of backwards compatibility, the string
10675 \begin_inset Flex Code
10678 \begin_layout Plain Layout
10688 will be replaced by the expanded
10689 \begin_inset Flex Code
10692 \begin_layout Plain Layout
10699 \begin_inset Flex Code
10702 \begin_layout Plain Layout
10711 This feature is now obsolete and should be replaced by the mechanisms of
10713 \begin_inset CommandInset ref
10715 reference "sub:Counters"
10727 \begin_layout Description
10728 \begin_inset Flex Code
10731 \begin_layout Plain Layout
10732 LabelStringAppendix
10738 \begin_inset Flex Code
10741 \begin_layout Plain Layout
10747 ] This is used inside the appendix instead of
10748 \begin_inset Flex Code
10751 \begin_layout Plain Layout
10759 \begin_inset Flex Code
10762 \begin_layout Plain Layout
10769 \begin_inset Flex Code
10772 \begin_layout Plain Layout
10773 LabelStringAppendix
10781 \begin_layout Description
10782 \begin_inset Flex Code
10785 \begin_layout Plain Layout
10791 [FIXME] (Used only with XML-type formats.)
10794 \begin_layout Description
10795 \begin_inset Flex Code
10798 \begin_layout Plain Layout
10805 \begin_inset Flex Code
10808 \begin_layout Plain Layout
10813 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10814 Enumerate, Itemize, Bibliography
10823 \begin_layout Itemize
10824 \begin_inset Flex Code
10827 \begin_layout Plain Layout
10833 means the label is the very first word (up to the first real blank).
10834 Use protected spaces (like
10835 \begin_inset space ~
10838 that one) if you want more than one word as the label.
10842 \begin_layout Itemize
10843 \begin_inset Flex Code
10846 \begin_layout Plain Layout
10852 means the label is simply whatever
10853 \begin_inset Flex Code
10856 \begin_layout Plain Layout
10863 Note that this really is `static'.
10866 \begin_layout Itemize
10867 \begin_inset Flex Code
10870 \begin_layout Plain Layout
10877 \begin_inset Flex Code
10880 \begin_layout Plain Layout
10881 Centered_Top_Environment
10886 are special cases of
10887 \begin_inset Flex Code
10890 \begin_layout Plain Layout
10897 The label will be printed above the paragraph, but only at the top of an
10898 environment or the top of a chain of paragraphs with this layout.
10899 This might be used with the
10900 \begin_inset Flex MenuItem
10903 \begin_layout Plain Layout
10909 layout, for example.
10912 \begin_layout Itemize
10913 \begin_inset Flex Code
10916 \begin_layout Plain Layout
10922 is a special case for the caption-labels
10923 \begin_inset Quotes eld
10927 \begin_inset Quotes erd
10931 \begin_inset Quotes eld
10935 \begin_inset Quotes erd
10940 \begin_inset Flex Code
10943 \begin_layout Plain Layout
10949 means the (hardcoded) label string depends on the kind of float: It is
10950 hardcoded to be `FloatType N', where N is the value of the counter associated
10954 \begin_layout Itemize
10956 \begin_inset Flex Code
10959 \begin_layout Plain Layout
10965 label type defines automatically numbered labels.
10967 \begin_inset Flex Code
10970 \begin_layout Plain Layout
10976 will be expanded to resolve any counter references it contains: For example,
10978 \begin_inset Quotes eld
10982 \begin_inset Flex Code
10985 \begin_layout Plain Layout
10996 \begin_inset Quotes erd
11001 \begin_inset CommandInset ref
11003 reference "sub:Counters"
11007 for more information on counters.
11010 \begin_layout Itemize
11011 \begin_inset Flex Code
11014 \begin_layout Plain Layout
11020 produces the usual sort of enumeration labels.
11021 At present, it is hardcoded to use Arabic numerals, lowercase letters,
11022 small Roman numerals, and uppercase letters for the four possible depths.
11025 \begin_layout Itemize
11026 \begin_inset Flex Code
11029 \begin_layout Plain Layout
11035 produces various bullets at the different levels.
11036 It is also hardcoded.
11039 \begin_layout Itemize
11040 \begin_inset Flex Code
11043 \begin_layout Plain Layout
11049 is used internally by LyX and should be used only with
11050 \begin_inset Flex Code
11053 \begin_layout Plain Layout
11054 LatexType BibEnvironment
11063 \begin_layout Description
11064 \begin_inset Flex Code
11067 \begin_layout Plain Layout
11073 Note that this will completely override any prior
11074 \begin_inset Flex Code
11077 \begin_layout Plain Layout
11083 declaration for this style.
11085 \begin_inset Quotes eld
11089 \begin_inset Flex Code
11092 \begin_layout Plain Layout
11099 \begin_inset Quotes erd
11104 \begin_inset CommandInset ref
11106 reference "sub:I18n"
11110 for details on its use.
11113 \begin_layout Description
11114 \begin_inset Flex Code
11117 \begin_layout Plain Layout
11123 The name of the corresponding LaTeX stuff.
11124 Either the environment or command name.
11127 \begin_layout Description
11128 \begin_inset Flex Code
11131 \begin_layout Plain Layout
11137 An optional parameter for the corresponding
11138 \begin_inset Flex Code
11141 \begin_layout Plain Layout
11148 This parameter cannot be changed from within LyX.
11151 \begin_layout Description
11152 \begin_inset Flex Code
11155 \begin_layout Plain Layout
11162 \begin_inset CommandInset label
11164 name "des:LatexType"
11169 \begin_inset Flex Code
11172 \begin_layout Plain Layout
11177 , Command, Environment, Item_Environment,
11183 \begin_inset Flex Code
11186 \begin_layout Plain Layout
11187 List_Environment, Bib_Environment
11192 ] How the layout should be translated into LaTeX.
11196 \begin_layout Plain Layout
11197 \begin_inset Flex Code
11200 \begin_layout Plain Layout
11206 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11207 Visit the SGML class files for specific examples.
11216 \begin_layout Itemize
11217 \begin_inset Flex Code
11220 \begin_layout Plain Layout
11226 means nothing special.
11230 \begin_layout Itemize
11231 \begin_inset Flex Code
11234 \begin_layout Plain Layout
11241 \begin_inset Flex Code
11244 \begin_layout Plain Layout
11251 {\SpecialChar \ldots{}
11260 \begin_layout Itemize
11261 \begin_inset Flex Code
11264 \begin_layout Plain Layout
11271 \begin_inset Flex Code
11274 \begin_layout Plain Layout
11281 }\SpecialChar \ldots{}
11297 \begin_layout Itemize
11298 \begin_inset Flex Code
11301 \begin_layout Plain Layout
11308 \begin_inset Flex Code
11311 \begin_layout Plain Layout
11318 \begin_inset Flex Code
11321 \begin_layout Plain Layout
11329 is generated for each paragraph of this environment.
11333 \begin_layout Itemize
11334 \begin_inset Flex Code
11337 \begin_layout Plain Layout
11344 \begin_inset Flex Code
11347 \begin_layout Plain Layout
11354 \begin_inset Flex Code
11357 \begin_layout Plain Layout
11363 is passed as an argument to the environment.
11365 \begin_inset Flex Code
11368 \begin_layout Plain Layout
11374 can be defined in the
11375 \begin_inset Flex MenuItem
11378 \begin_layout Plain Layout
11383 ayout\SpecialChar \menuseparator
11397 \begin_layout Standard
11398 Putting the last few things together, the LaTeX output will be either:
11401 \begin_layout LyX-Code
11404 latexname[latexparam]{\SpecialChar \ldots{}
11408 \begin_layout Standard
11412 \begin_layout LyX-Code
11415 begin{latexname}[latexparam] \SpecialChar \ldots{}
11421 \begin_layout Standard
11422 depending upon the LaTeX type.
11426 \begin_layout Description
11427 \begin_inset Flex Code
11430 \begin_layout Plain Layout
11437 \begin_inset Flex Code
11440 \begin_layout Plain Layout
11446 ] If you put layouts into environments, the leftmargins are not simply added,
11447 but added with a factor
11448 \begin_inset Formula $\frac{4}{depth+4}$
11452 Note that this parameter is also used when the margin is defined as
11453 \begin_inset Flex Code
11456 \begin_layout Plain Layout
11463 \begin_inset Flex Code
11466 \begin_layout Plain Layout
11473 Then it is added to the manual or dynamic margin.
11475 \begin_inset Newline newline
11478 The argument is passed as a string.
11480 \begin_inset Quotes eld
11484 \begin_inset Flex Code
11487 \begin_layout Plain Layout
11494 \begin_inset Quotes erd
11497 means that the paragraph is indented with the width of
11498 \begin_inset Quotes eld
11502 \begin_inset Flex Code
11505 \begin_layout Plain Layout
11512 \begin_inset Quotes erd
11515 in the normal font.
11516 You can get a negative width by prefixing the string with
11517 \begin_inset Quotes eld
11521 \begin_inset Flex Code
11524 \begin_layout Plain Layout
11531 \begin_inset Quotes erd
11535 This way was chosen so that the look is the same with each used screen
11540 \begin_layout Description
11541 \begin_inset Flex Code
11544 \begin_layout Plain Layout
11551 \begin_inset Flex Code
11554 \begin_layout Plain Layout
11559 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11565 \begin_inset Newline newline
11568 The kind of margin that the layout has on the left side.
11570 \begin_inset Flex Code
11573 \begin_layout Plain Layout
11579 just means a fixed margin.
11581 \begin_inset Flex Code
11584 \begin_layout Plain Layout
11590 means that the left margin depends on the string entered in the
11591 \begin_inset Flex MenuItem
11594 \begin_layout Plain Layout
11595 Edit\SpecialChar \menuseparator
11597 \begin_inset space ~
11606 This is used to typeset nice lists without tabulators.
11608 \begin_inset Flex Code
11611 \begin_layout Plain Layout
11617 means that the margin depends on the size of the label.
11618 This is used for automatic enumerated headlines.
11619 It is obvious that the headline
11620 \begin_inset Quotes eld
11623 5.4.3.2.1 Very long headline
11624 \begin_inset Quotes erd
11627 must have a wider left margin (as wide as
11628 \begin_inset Quotes eld
11632 \begin_inset Quotes erd
11635 plus the space) than
11636 \begin_inset Quotes eld
11639 3.2 Very long headline
11640 \begin_inset Quotes erd
11644 \begin_inset Quotes eld
11648 \begin_inset Quotes erd
11651 are not able to do this.
11653 \begin_inset Flex Code
11656 \begin_layout Plain Layout
11662 is similar, but only the very first row of the paragraph is dynamic, while
11663 the others are static; this is used, for example, for descriptions.
11665 \begin_inset Flex Code
11668 \begin_layout Plain Layout
11674 means the margin is chosen in a way that the longest row of this paragraph
11675 fits to the right margin.
11676 This is used to typeset an address on the right edge of the page.
11679 \begin_layout Description
11680 \begin_inset Flex Code
11683 \begin_layout Plain Layout
11690 \begin_inset Flex Code
11693 \begin_layout Plain Layout
11702 \begin_inset Flex Code
11705 \begin_layout Plain Layout
11711 ] Whether fragile commands in this layout should be
11712 \begin_inset Flex Code
11715 \begin_layout Plain Layout
11728 whether this command should itself be protected.)
11731 \begin_layout Description
11732 \begin_inset Flex Code
11735 \begin_layout Plain Layout
11742 \begin_inset Flex Code
11745 \begin_layout Plain Layout
11752 \begin_inset Flex Code
11755 \begin_layout Plain Layout
11763 ] Whether newlines are translated into LaTeX newlines (
11764 \begin_inset Flex Code
11767 \begin_layout Plain Layout
11778 The translation can be switched off to allow more comfortable LaTeX editing
11782 \begin_layout Description
11783 \begin_inset Flex Code
11786 \begin_layout Plain Layout
11793 \begin_inset Flex Code
11796 \begin_layout Plain Layout
11803 \begin_inset Flex Code
11806 \begin_layout Plain Layout
11814 ] Whether the following Paragraph is allowed to indent its very first row.
11816 \begin_inset Flex Code
11819 \begin_layout Plain Layout
11825 means that it is not allowed to do so;
11826 \begin_inset Flex Code
11829 \begin_layout Plain Layout
11835 means it could do so if it wants to.
11838 \begin_layout Description
11839 \begin_inset Flex Code
11842 \begin_layout Plain Layout
11848 Name of a layout that has replaced this layout.
11849 This is used to rename a layout, while keeping backward compatibility.
11852 \begin_layout Description
11853 \begin_inset Flex Code
11856 \begin_layout Plain Layout
11863 \begin_inset Flex Code
11866 \begin_layout Plain Layout
11872 ] The number of optional arguments that can be used with this layout.
11873 This is useful for things like section headings, and only makes sense with
11875 Note that, on output, the optional arguments will all precede any required
11876 arguments (see below).
11877 So one can have constructs like:
11881 \begin_layout LyX-Code
11884 mycmd[opt1]{req1}{contents of paragraph}
11887 \begin_layout Standard
11888 but one cannot have things like:
11891 \begin_layout LyX-Code
11894 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11897 \begin_layout Standard
11898 at least, not without ERT (with which you can have anything).
11903 \begin_layout Description
11904 \begin_inset Flex Code
11907 \begin_layout Plain Layout
11914 \begin_inset CommandInset label
11916 name "des:ParbreakIsNewline"
11921 \begin_inset Flex Code
11924 \begin_layout Plain Layout
11933 \begin_inset Flex Code
11936 \begin_layout Plain Layout
11942 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
11943 output, but only by a line break; together with
11944 \begin_inset Flex Code
11947 \begin_layout Plain Layout
11953 , this allows to emulate a plain text editor (like the ERT inset).
11956 \begin_layout Description
11957 \begin_inset Flex Code
11960 \begin_layout Plain Layout
11967 \begin_inset Flex Code
11970 \begin_layout Plain Layout
11976 ] The indent of the very first line of a paragraph.
11978 \begin_inset Flex Code
11981 \begin_layout Plain Layout
11987 will be fixed for a certain layout.
11988 The exception is Standard layout, since the indentation of a Standard layout
11989 paragraph can be prohibited with
11990 \begin_inset Flex Code
11993 \begin_layout Plain Layout
12000 Also, Standard layout paragraphs inside environments use the
12001 \begin_inset Flex Code
12004 \begin_layout Plain Layout
12010 of the environment, not their native one.
12011 For example, Standard paragraphs inside an enumeration are not indented.
12014 \begin_layout Description
12015 \begin_inset Flex Code
12018 \begin_layout Plain Layout
12025 \begin_inset Flex Code
12028 \begin_layout Plain Layout
12034 ] The vertical space between two paragraphs of this layout.
12037 \begin_layout Description
12038 \begin_inset Flex Code
12041 \begin_layout Plain Layout
12048 \begin_inset Flex Code
12051 \begin_layout Plain Layout
12057 ] LyX allows the user to choose either
12058 \begin_inset Quotes eld
12062 \begin_inset Quotes erd
12066 \begin_inset Quotes eld
12070 \begin_inset Quotes erd
12073 to typeset a document.
12075 \begin_inset Quotes eld
12079 \begin_inset Quotes erd
12082 is chosen, this value is completely ignored.
12084 \begin_inset Quotes eld
12088 \begin_inset Quotes erd
12091 is chosen, the parindent of a LaTeXtype
12092 \begin_inset Quotes eld
12096 \begin_inset Quotes erd
12099 layout is ignored and all paragraphs are separated by this parskip argument.
12100 The vertical space is calculated with
12101 \begin_inset Flex Code
12104 \begin_layout Plain Layout
12106 \begin_inset space ~
12115 \begin_inset Flex Code
12118 \begin_layout Plain Layout
12124 is the height of a row with the normal font.
12125 This way, the look stays the same with different screen fonts.
12128 \begin_layout Description
12129 \begin_inset Flex Code
12132 \begin_layout Plain Layout
12139 \begin_inset CommandInset label
12141 name "des:PassThru"
12146 \begin_inset Flex Code
12149 \begin_layout Plain Layout
12158 \begin_inset Flex Code
12161 \begin_layout Plain Layout
12167 ] Whether the contents of this paragraph should be output in raw form, meaning
12168 without special translations that LaTeX would require.
12171 \begin_layout Description
12172 \begin_inset Flex Code
12175 \begin_layout Plain Layout
12182 \begin_inset CommandInset label
12184 name "des:Preamble"
12188 Information to be included in the LaTeX preamble when this style is used.
12189 Used to define macros, load packages, etc., required by this particular
12192 \begin_inset Quotes eld
12196 \begin_inset Flex Code
12199 \begin_layout Plain Layout
12206 \begin_inset Quotes erd
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 prefix to use when creating labels referring to paragraphs of this
12234 This allows the use of formatted references.
12237 \begin_layout Description
12238 \begin_inset Flex Code
12241 \begin_layout Plain Layout
12248 \begin_inset Flex Code
12251 \begin_layout Plain Layout
12257 ] The number of required arguments that the LaTeX command or environment
12258 corresponding to this layout expects.
12259 In the case of a command, these are required arguments
12263 that associated with the content of the paragraph itself.
12264 These do not actually have to be provided: LyX will output empty arguments
12266 Note that optional arguments will be output before required arguments.
12267 See the discussion of the
12268 \begin_inset Flex Code
12271 \begin_layout Plain Layout
12277 tag above for more information.
12280 \begin_layout Description
12281 \begin_inset Flex Code
12284 \begin_layout Plain Layout
12291 \begin_inset Flex Code
12294 \begin_layout Plain Layout
12301 \begin_inset CommandInset label
12303 name "des:Requires"
12307 Whether the layout requires the feature
12308 \begin_inset Flex Code
12311 \begin_layout Plain Layout
12318 See the description of
12319 \begin_inset Flex Code
12322 \begin_layout Plain Layout
12329 \begin_inset CommandInset ref
12330 LatexCommand pageref
12331 reference "des:FreeSpacing"
12335 ) for information on `features'.
12339 \begin_layout Description
12340 \begin_inset Flex Code
12343 \begin_layout Plain Layout
12350 \begin_inset Flex Code
12353 \begin_layout Plain Layout
12360 \begin_inset Flex Code
12363 \begin_layout Plain Layout
12372 \begin_layout Description
12373 \begin_inset Flex Code
12376 \begin_layout Plain Layout
12383 \begin_inset Flex Code
12386 \begin_layout Plain Layout
12391 , onehalf, double, other
12400 ] This defines what the default spacing should be in the layout.
12402 \begin_inset Flex Code
12405 \begin_layout Plain Layout
12412 \begin_inset Flex Code
12415 \begin_layout Plain Layout
12422 \begin_inset Flex Code
12425 \begin_layout Plain Layout
12431 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12432 If you specify the argument
12433 \begin_inset Flex Code
12436 \begin_layout Plain Layout
12442 , then you should also provide a numerical argument which will be the actual
12444 Note that, contrary to other parameters,
12445 \begin_inset Flex Code
12448 \begin_layout Plain Layout
12454 implies the generation of specific LaTeX code, using the package
12457 \begin_inset Flex Code
12460 \begin_layout Plain Layout
12469 \begin_layout Description
12470 \begin_inset Flex Code
12473 \begin_layout Plain Layout
12480 \begin_inset Flex Code
12483 \begin_layout Plain Layout
12490 \begin_inset Flex Code
12493 \begin_layout Plain Layout
12501 ] Spellcheck paragraphs of this style.
12505 \begin_layout Description
12506 \begin_inset Flex Code
12509 \begin_layout Plain Layout
12515 The font used for the text body .
12517 \begin_inset CommandInset ref
12519 reference "sub:Font-description"
12526 \begin_layout Description
12527 \begin_inset Flex Code
12530 \begin_layout Plain Layout
12539 \begin_inset Flex Code
12542 \begin_layout Plain Layout
12552 The level of the style in the table of contents.
12553 This is used for automatic numbering of section headings.
12556 \begin_layout Description
12557 \begin_inset Flex Code
12560 \begin_layout Plain Layout
12567 \begin_inset Flex Code
12570 \begin_layout Plain Layout
12576 ] The vertical space with which the very first of a chain of paragraphs
12577 with this layout is separated from the previous paragraph.
12578 If the previous paragraph has another layout, the separations are not simply
12579 added, but the maximum is taken.
12582 \begin_layout Subsection
12583 \begin_inset CommandInset label
12589 Internationalization of Paragraph Styles
12592 \begin_layout Standard
12593 LyX has long supported internationalization of layout information, but,
12594 until version 2.0, this applied only to the user interface and not to, say,
12596 Thus, French authors were forced to resort to ugly hacks if they wanted
12601 1' instead of `Theorem 1'.
12602 Thanks to Georg Baum, that is no longer the case.
12605 \begin_layout Standard
12607 \begin_inset Flex Code
12610 \begin_layout Plain Layout
12616 defines text that is to appear in the typeset document, it may use
12617 \begin_inset Flex Code
12620 \begin_layout Plain Layout
12627 \begin_inset Flex Code
12630 \begin_layout Plain Layout
12636 to support non-English and even multi-language documents correctly.
12637 The following excerpt (from the
12638 \begin_inset Flex Code
12641 \begin_layout Plain Layout
12647 file) shows how this works:
12650 \begin_layout LyX-Code
12655 \begin_layout LyX-Code
12658 theoremstyle{remark}
12661 \begin_layout LyX-Code
12664 newtheorem{claim}[thm]{
12671 \begin_layout LyX-Code
12675 \begin_layout LyX-Code
12679 \begin_layout LyX-Code
12684 claimname}{_(Claim)}
12687 \begin_layout LyX-Code
12691 \begin_layout LyX-Code
12695 \begin_layout LyX-Code
12704 claimname}{_(Claim)}}
12707 \begin_layout LyX-Code
12712 \begin_layout Standard
12713 In principle, any legal LaTeX may appear in the
12714 \begin_inset Flex Code
12717 \begin_layout Plain Layout
12724 \begin_inset Flex Code
12727 \begin_layout Plain Layout
12733 tags, but in practice they will typically look as they do here.
12734 The key to correct translation of the typeset text is the definition of
12736 \begin_inset Flex Code
12739 \begin_layout Plain Layout
12748 \begin_inset Flex Code
12751 \begin_layout Plain Layout
12763 \begin_layout Standard
12765 \begin_inset Flex Code
12768 \begin_layout Plain Layout
12774 tag provides for internationalization based upon the overall language of
12776 The contents of the tag will be included in the preamble, just as with
12778 \begin_inset Flex Code
12781 \begin_layout Plain Layout
12788 What makes it special is the use of the
12789 \begin_inset Quotes eld
12793 \begin_inset Quotes erd
12797 \begin_inset Flex Code
12800 \begin_layout Plain Layout
12806 , which will be replaced, when LyX produces LaTeX output, with the translation
12807 of its argument into the document language.
12810 \begin_layout Standard
12812 \begin_inset Flex Code
12815 \begin_layout Plain Layout
12821 tag is more complex, since it is meant to provide support for multi-language
12822 documents and so offers an interface to the
12823 \begin_inset Flex Code
12826 \begin_layout Plain Layout
12833 Its contents will be added to the preamble once for each language that
12834 appears in the document.
12835 In this case, the argument to
12836 \begin_inset Flex Code
12839 \begin_layout Plain Layout
12845 will be replaced with its translation into the language in question; the
12847 \begin_inset Flex Code
12850 \begin_layout Plain Layout
12856 is replaced by the language name (as used by the babel package).
12859 \begin_layout Standard
12860 A German document that also included a French section would thus have the
12861 following in the preamble:
12864 \begin_layout LyX-Code
12873 claimname}{Affirmation}}
12881 claimname}{Behauptung}}
12885 claimname}{Behauptung}
12888 \begin_layout Standard
12890 \begin_inset Flex Code
12893 \begin_layout Plain Layout
12899 will then conspire to produce the correct text in the output.
12902 \begin_layout Standard
12903 One important point to note here is that the translations are provided by
12904 LyX itself, through the same mechanism it uses for internationalization
12905 of the user interface.
12906 This means, in effect, that
12907 \begin_inset Flex Code
12910 \begin_layout Plain Layout
12917 \begin_inset Flex Code
12920 \begin_layout Plain Layout
12926 are really only of use in layout files that are provided with LyX, since
12927 text entered in user-created layout files will not be seen by LyX's internation
12928 alization routines.
12929 That said, however, any layout created with the intention that it will
12930 be included with LyX should use these tags where appropriate.
12933 \begin_layout Subsection
12935 \begin_inset CommandInset label
12944 \begin_layout Standard
12945 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12946 define the floats (
12947 \begin_inset Flex MenuItem
12950 \begin_layout Plain Layout
12957 \begin_inset Flex MenuItem
12960 \begin_layout Plain Layout
12966 , \SpecialChar \ldots{}
12967 ) in the text class itself.
12968 Standard floats are included in the file
12969 \begin_inset Flex Code
12972 \begin_layout Plain Layout
12978 , so you may have to do no more than add
12981 \begin_layout LyX-Code
12982 Input stdfloats.inc
12985 \begin_layout Standard
12986 to your layout file.
12987 If you want to implement a text class that proposes some other float types
12988 (like the AGU class bundled with LyX), the information below will hopefully
12992 \begin_layout Description
12993 \begin_inset Flex Code
12996 \begin_layout Plain Layout
13003 \begin_inset Flex Code
13006 \begin_layout Plain Layout
13013 \begin_inset Quotes erd
13017 \begin_inset Quotes erd
13020 ] The file name extension of an auxiliary file for the list of figures (or
13022 LaTeX writes the captions to this file.
13025 \begin_layout Description
13026 \begin_inset Flex Code
13029 \begin_layout Plain Layout
13036 \begin_inset Flex Code
13039 \begin_layout Plain Layout
13046 \begin_inset Quotes erd
13050 \begin_inset Quotes erd
13053 ] The string that will be used in the menus and also for the caption.
13054 This is translated to the current language if babel is used.
13057 \begin_layout Description
13058 \begin_inset Flex Code
13061 \begin_layout Plain Layout
13067 These are used for XHTML output.
13069 \begin_inset CommandInset ref
13071 reference "sec:Tags-for-XHTML"
13078 \begin_layout Description
13079 \begin_inset Flex Code
13082 \begin_layout Plain Layout
13091 \begin_inset Flex Code
13094 \begin_layout Plain Layout
13103 \begin_inset Flex Code
13106 \begin_layout Plain Layout
13112 ] Indicates whether the float is already defined in the document class or
13113 if we instead need to load
13114 \begin_inset Flex Code
13117 \begin_layout Plain Layout
13123 and use what it provides to define it on-the-fly.
13125 \begin_inset Flex Code
13128 \begin_layout Plain Layout
13135 \begin_inset Flex Code
13138 \begin_layout Plain Layout
13145 It should be set to
13146 \begin_inset Flex Code
13149 \begin_layout Plain Layout
13155 if the float is already defined by the LaTeX document class.
13158 \begin_layout Description
13159 \begin_inset Flex Code
13162 \begin_layout Plain Layout
13169 \begin_inset Flex Code
13172 \begin_layout Plain Layout
13179 \begin_inset Quotes erd
13183 \begin_inset Quotes erd
13186 ] The command used to generate a list of floats of this type; the leading
13189 ' should be omitted.
13195 \begin_inset Flex Code
13198 \begin_layout Plain Layout
13204 is false, since there is no standard way to generate this command.
13206 \begin_inset Flex Code
13209 \begin_layout Plain Layout
13215 is true, since in that case there is a standard way to define the command.
13218 \begin_layout Description
13219 \begin_inset Flex Code
13222 \begin_layout Plain Layout
13229 \begin_inset Flex Code
13232 \begin_layout Plain Layout
13239 \begin_inset Quotes erd
13243 \begin_inset Quotes erd
13246 ] A title for a list of floats of this kind (list of figures, tables, or
13248 It is used for the screen label within LyX; it is passed to LaTeX for use
13249 as the title there; and it is used as the title in XHTML output.
13250 It will be translated to the document language.
13253 \begin_layout Description
13254 \begin_inset Flex Code
13257 \begin_layout Plain Layout
13264 \begin_inset Flex Code
13267 \begin_layout Plain Layout
13274 \begin_inset Quotes erd
13278 \begin_inset Quotes erd
13281 ] This (optional) argument determines whether floats of this class will
13282 be numbered within some sectional unit of the document.
13283 For example, if within is equal to
13284 \begin_inset Flex Code
13287 \begin_layout Plain Layout
13293 , the floats will be numbered within chapters.
13297 \begin_layout Description
13298 \begin_inset Flex Code
13301 \begin_layout Plain Layout
13308 \begin_inset Flex Code
13311 \begin_layout Plain Layout
13318 \begin_inset Quotes erd
13322 \begin_inset Quotes erd
13325 ] The default placement for the given class of floats.
13326 The string should be as in standard LaTeX:
13327 \begin_inset Flex Code
13330 \begin_layout Plain Layout
13337 \begin_inset Flex Code
13340 \begin_layout Plain Layout
13347 \begin_inset Flex Code
13350 \begin_layout Plain Layout
13357 \begin_inset Flex Code
13360 \begin_layout Plain Layout
13366 for top, bottom, page, and here, respectively.
13370 \begin_layout Plain Layout
13371 Note that the order of these letters in the string is irrelevant, like in
13377 On top of that there is a new type,
13378 \begin_inset Flex Code
13381 \begin_layout Plain Layout
13387 , which does not really correspond to a float, since it means: put it
13388 \begin_inset Quotes eld
13392 \begin_inset Quotes erd
13396 Note however that the
13397 \begin_inset Flex Code
13400 \begin_layout Plain Layout
13406 specifier is special and, because of implementation details, cannot be
13407 used in non-built in float types.
13408 If you do not understand what this means, just use
13409 \begin_inset Quotes eld
13413 \begin_inset Flex Code
13416 \begin_layout Plain Layout
13423 \begin_inset Quotes erd
13429 \begin_layout Description
13430 \begin_inset Flex Code
13433 \begin_layout Plain Layout
13440 \begin_inset Flex Code
13443 \begin_layout Plain Layout
13449 ] The prefix to use when creating labels referring to floats of this type.
13450 This allows the use of formatted references.
13451 Note that you can remove any
13452 \begin_inset Flex Code
13455 \begin_layout Plain Layout
13461 set by a copied style by using the special value
13462 \begin_inset Quotes eld
13466 \begin_inset Quotes erd
13469 , which must be all caps.
13472 \begin_layout Description
13473 \begin_inset Flex Code
13476 \begin_layout Plain Layout
13483 \begin_inset Flex Code
13486 \begin_layout Plain Layout
13493 \begin_inset Quotes erd
13497 \begin_inset Quotes erd
13500 ] The style used when defining the float using
13501 \begin_inset Flex Code
13504 \begin_layout Plain Layout
13515 \begin_layout Description
13516 \begin_inset Flex Code
13519 \begin_layout Plain Layout
13526 \begin_inset Flex Code
13529 \begin_layout Plain Layout
13536 \begin_inset Quotes erd
13540 \begin_inset Quotes erd
13544 \begin_inset Quotes eld
13548 \begin_inset Quotes erd
13551 of the new class of floats, like program or algorithm.
13552 After the appropriate
13553 \begin_inset Flex Code
13556 \begin_layout Plain Layout
13565 \begin_inset Flex Code
13568 \begin_layout Plain Layout
13577 \begin_inset Flex Code
13580 \begin_layout Plain Layout
13591 \begin_layout Description
13592 \begin_inset Flex Code
13595 \begin_layout Plain Layout
13602 \begin_inset Flex Code
13605 \begin_layout Plain Layout
13612 \begin_inset Flex Code
13615 \begin_layout Plain Layout
13623 ] Tells us whether this float is defined using the facilities provided by
13625 \begin_inset Flex Code
13628 \begin_layout Plain Layout
13634 , either by the class file or a package, or on-the-fly by LyX itself.
13637 \begin_layout Standard
13638 Note that defining a float with type
13639 \begin_inset Flex Code
13642 \begin_layout Plain Layout
13650 automatically defines the corresponding counter with name
13651 \begin_inset Flex Code
13654 \begin_layout Plain Layout
13665 \begin_layout Subsection
13666 Flex insets and InsetLayout
13667 \begin_inset CommandInset label
13669 name "sub:Flex-insets-and"
13676 \begin_layout Standard
13677 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13678 these are called Flex insets.
13682 \begin_layout Standard
13683 Flex insets come in three different kinds:
13686 \begin_layout Itemize
13688 \begin_inset Flex Code
13691 \begin_layout Plain Layout
13697 ): These define semantic markup corresponding to such LaTeX commands as
13699 \begin_inset Flex Code
13702 \begin_layout Plain Layout
13711 \begin_inset Flex Code
13714 \begin_layout Plain Layout
13725 \begin_layout Itemize
13727 \begin_inset Flex Code
13730 \begin_layout Plain Layout
13736 ): These can be used to define custom collapsible insets, similar to TeX
13737 code, footnote, and the like.
13738 An obvious example is an endnote inset, which is defined in the
13739 \begin_inset Flex Code
13742 \begin_layout Plain Layout
13751 \begin_layout Itemize
13753 \begin_inset Flex Code
13756 \begin_layout Plain Layout
13762 ): For use with DocBook classes.
13765 \begin_layout Standard
13766 Flex insets are defined using the
13767 \begin_inset Flex Code
13770 \begin_layout Plain Layout
13776 tag, which shall be explained in a moment.
13779 \begin_layout Standard
13781 \begin_inset Flex Code
13784 \begin_layout Plain Layout
13790 tag also serves another function: It can be used to customize the general
13791 layout of many different types of insets.
13793 \begin_inset Flex Code
13796 \begin_layout Plain Layout
13802 can be used to customize the layout parameters for footnotes, marginal
13803 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13804 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13805 define Flex insets.
13808 \begin_layout Standard
13810 \begin_inset Flex Code
13813 \begin_layout Plain Layout
13819 definition must begin with a line of the form:
13822 \begin_layout LyX-Code
13826 \begin_layout Standard
13828 \begin_inset Flex Code
13831 \begin_layout Plain Layout
13837 indicates the inset whose layout is being defined, and here there are two
13841 \begin_layout Enumerate
13842 The layout for a pre-existing inset is being modified.
13843 In this case, can be
13844 \begin_inset Flex Code
13847 \begin_layout Plain Layout
13853 any one of the following:
13854 \begin_inset Flex Code
13857 \begin_layout Plain Layout
13864 \begin_inset Flex Code
13867 \begin_layout Plain Layout
13874 \begin_inset Flex Code
13877 \begin_layout Plain Layout
13884 \begin_inset Flex Code
13887 \begin_layout Plain Layout
13894 \begin_inset Flex Code
13897 \begin_layout Plain Layout
13904 \begin_inset Flex Code
13907 \begin_layout Plain Layout
13914 \begin_inset Flex Code
13917 \begin_layout Plain Layout
13924 \begin_inset Flex Code
13927 \begin_layout Plain Layout
13934 \begin_inset Flex Code
13937 \begin_layout Plain Layout
13944 \begin_inset Flex Code
13947 \begin_layout Plain Layout
13954 \begin_inset Flex Code
13957 \begin_layout Plain Layout
13964 \begin_inset Flex Code
13967 \begin_layout Plain Layout
13974 \begin_inset Flex Code
13977 \begin_layout Plain Layout
13984 \begin_inset Flex Code
13987 \begin_layout Plain Layout
13994 \begin_inset Flex Code
13997 \begin_layout Plain Layout
14004 \begin_inset Flex Code
14007 \begin_layout Plain Layout
14014 \begin_inset Flex Code
14017 \begin_layout Plain Layout
14024 \begin_inset Flex Code
14027 \begin_layout Plain Layout
14034 \begin_inset Flex Code
14037 \begin_layout Plain Layout
14044 \begin_inset Flex Code
14047 \begin_layout Plain Layout
14056 \begin_layout Enumerate
14057 The layout for a Flex inset is being defined.
14059 \begin_inset Flex Code
14062 \begin_layout Plain Layout
14068 may be be any valid identifier not used by a pre-existing inset.
14069 The identifier may include spaces, but in that case the whole thing must
14070 be wrapped in quotes.
14071 It may also include a namespace identifier, preceding a colon, such as
14073 \begin_inset Quotes eld
14077 \begin_inset Flex Code
14080 \begin_layout Plain Layout
14087 \begin_inset Quotes erd
14091 Note that the definition of a flex inset
14096 \begin_inset Flex Code
14099 \begin_layout Plain Layout
14105 entry, declaring which type of inset it defines.
14108 \begin_layout Standard
14110 \begin_inset Flex Code
14113 \begin_layout Plain Layout
14119 definition can contain the following entries:
14122 \begin_layout Description
14123 \begin_inset Flex Code
14126 \begin_layout Plain Layout
14132 The color for the inset's background.
14133 The valid colors are defined in
14134 \begin_inset Flex Code
14137 \begin_layout Plain Layout
14146 \begin_layout Description
14147 \begin_inset Flex Code
14150 \begin_layout Plain Layout
14157 \begin_inset Flex Code
14160 \begin_layout Plain Layout
14169 \begin_inset Flex Code
14172 \begin_layout Plain Layout
14178 ] Whether to use the content of the inset as the label, when the inset is
14183 \begin_layout Description
14184 \begin_inset Flex Code
14187 \begin_layout Plain Layout
14193 As with paragraph styles (see page
14194 \begin_inset CommandInset ref
14196 reference "des:CopyStyle"
14203 \begin_layout Description
14204 \begin_inset Flex Code
14207 \begin_layout Plain Layout
14214 \begin_inset Flex Code
14217 \begin_layout Plain Layout
14226 \begin_inset Flex Code
14229 \begin_layout Plain Layout
14235 ] Indicates whether the user may employ the Paragraph Settings dialog to
14236 customize the paragraph.
14239 \begin_layout Description
14240 \begin_inset Flex Code
14243 \begin_layout Plain Layout
14250 \begin_inset Flex Code
14253 \begin_layout Plain Layout
14260 \begin_inset Flex Code
14263 \begin_layout Plain Layout
14270 \begin_inset Flex Code
14273 \begin_layout Plain Layout
14279 , describing the rendering style used for the inset's frame and buttons.
14280 Footnotes generally use
14281 \begin_inset Flex Code
14284 \begin_layout Plain Layout
14290 , ERT insets generally
14291 \begin_inset Flex Code
14294 \begin_layout Plain Layout
14300 , and character styles
14301 \begin_inset Flex Code
14304 \begin_layout Plain Layout
14313 \begin_layout Description
14314 \begin_inset Flex Code
14317 \begin_layout Plain Layout
14324 \begin_inset Flex Code
14327 \begin_layout Plain Layout
14334 \begin_inset Flex Code
14337 \begin_layout Plain Layout
14346 \begin_inset Flex Code
14349 \begin_layout Plain Layout
14356 \begin_inset Flex Code
14359 \begin_layout Plain Layout
14366 Indicates whether the environment will stand on its own in LaTeX output
14367 or will appear inline with the surrounding text.
14368 If set to false, it is supposed that the LaTeX environment ignores white
14369 space (including one newline character) after the
14370 \begin_inset Flex Code
14373 \begin_layout Plain Layout
14386 \begin_inset Flex Code
14389 \begin_layout Plain Layout
14405 \begin_layout Description
14406 \begin_inset Flex Code
14409 \begin_layout Plain Layout
14415 Required at the end of the InsetLayout declarations.
14418 \begin_layout Description
14419 \begin_inset Flex Code
14422 \begin_layout Plain Layout
14428 The font used for both the text body
14434 \begin_inset space ~
14438 \begin_inset CommandInset ref
14440 reference "sub:Font-description"
14445 Note that defining this font automatically defines the
14446 \begin_inset Flex Code
14449 \begin_layout Plain Layout
14455 to the same value, so define this first and define
14456 \begin_inset Flex Code
14459 \begin_layout Plain Layout
14465 later if you want them to be different.
14468 \begin_layout Description
14469 \begin_inset Flex Code
14472 \begin_layout Plain Layout
14479 \begin_inset Quotes eld
14483 \begin_inset Quotes erd
14486 language, leading to Left-to-Right (latin) output, e.
14487 \begin_inset space \thinspace{}
14491 \begin_inset space \space{}
14494 in TeX code or URL.
14498 \begin_layout Description
14499 \begin_inset Flex Code
14502 \begin_layout Plain Layout
14509 \begin_inset Flex Code
14512 \begin_layout Plain Layout
14521 \begin_inset Flex Code
14524 \begin_layout Plain Layout
14530 ] Indicates whether the PlainLayout should be used or, instead, the user
14531 can change the paragraph style used in the inset.
14535 \begin_layout Description
14536 \begin_inset Flex Code
14539 \begin_layout Plain Layout
14545 As with paragraph styles (see page
14546 \begin_inset CommandInset ref
14547 LatexCommand pageref
14548 reference "des:FreeSpacing"
14556 \begin_layout Description
14557 \begin_inset Flex Code
14560 \begin_layout Plain Layout
14566 These tags control XHTML output.
14568 \begin_inset CommandInset ref
14570 reference "sec:Tags-for-XHTML"
14577 \begin_layout Description
14578 \begin_inset Flex Code
14581 \begin_layout Plain Layout
14588 \begin_inset Flex Code
14591 \begin_layout Plain Layout
14600 \begin_inset Flex Code
14603 \begin_layout Plain Layout
14609 ] Whether to include the contents of this inset in the strings generated
14610 for the `Outline' pane.
14611 One would not, for example, want the content of a footnote in a section
14612 header to be included in the TOC displayed in the outline, but one would
14613 normally want the content of a character style displayed.
14614 Default is false: not to include.
14617 \begin_layout Description
14618 \begin_inset Flex Code
14621 \begin_layout Plain Layout
14627 As with paragraph styles (see page
14628 \begin_inset CommandInset ref
14629 LatexCommand pageref
14630 reference "des:KeepEmpty"
14638 \begin_layout Description
14639 \begin_inset Flex Code
14642 \begin_layout Plain Layout
14648 The font used for the label.
14650 \begin_inset space ~
14654 \begin_inset CommandInset ref
14656 reference "sub:Font-description"
14661 Note that this definition can never appear before
14662 \begin_inset Flex Code
14665 \begin_layout Plain Layout
14671 , lest it be ineffective.
14674 \begin_layout Description
14675 \begin_inset Flex Code
14678 \begin_layout Plain Layout
14684 What will be displayed on the button or elsewhere as the inset label.
14685 Some inset types (TeX code and Branch) modify this label on the fly.
14688 \begin_layout Description
14689 \begin_inset Flex Code
14692 \begin_layout Plain Layout
14698 The name of the corresponding LaTeX stuff.
14699 Either the environment or command name.
14702 \begin_layout Description
14703 \begin_inset Flex Code
14706 \begin_layout Plain Layout
14712 The optional parameter for the corresponding
14713 \begin_inset Flex Code
14716 \begin_layout Plain Layout
14722 stuff, including possible bracket pairs like
14723 \begin_inset Flex Code
14726 \begin_layout Plain Layout
14733 This parameter cannot be changed from within LyX.
14736 \begin_layout Description
14737 \begin_inset Flex Code
14740 \begin_layout Plain Layout
14746 As with paragraph styles (see page
14747 \begin_inset CommandInset ref
14748 LatexCommand pageref
14749 reference "des:LatexType"
14756 \begin_layout Description
14757 \begin_inset Flex Code
14760 \begin_layout Plain Layout
14767 \begin_inset Flex Code
14770 \begin_layout Plain Layout
14777 \begin_inset Flex Code
14780 \begin_layout Plain Layout
14787 \begin_inset Flex Code
14790 \begin_layout Plain Layout
14797 \begin_inset Flex Code
14800 \begin_layout Plain Layout
14806 (indicating a dummy definition ending definitions of charstyles, etc).
14807 This entry is required in and is only meaningful for Flex insets.
14808 Among other things, it determines on which menu this inset will appear.
14810 \begin_inset Flex Code
14813 \begin_layout Plain Layout
14820 \begin_inset Flex Code
14823 \begin_layout Plain Layout
14830 \begin_inset Flex Code
14833 \begin_layout Plain Layout
14841 \begin_inset Flex Code
14844 \begin_layout Plain Layout
14850 can be set to true for charstyle insets, if you wish, by setting it
14855 \begin_inset Flex Code
14858 \begin_layout Plain Layout
14867 \begin_layout Description
14868 \begin_inset Flex Code
14871 \begin_layout Plain Layout
14878 \begin_inset Flex Code
14881 \begin_layout Plain Layout
14890 \begin_inset Flex Code
14893 \begin_layout Plain Layout
14899 ] Whether multiple paragraphs are permitted in this inset.
14901 \begin_inset Flex Code
14904 \begin_layout Plain Layout
14910 to the same value and
14911 \begin_inset Flex Code
14914 \begin_layout Plain Layout
14920 to the opposite value.
14921 These can be reset to other values, if they are used
14926 \begin_inset Flex Code
14929 \begin_layout Plain Layout
14939 \begin_layout Description
14940 \begin_inset Flex Code
14943 \begin_layout Plain Layout
14950 \begin_inset Flex Code
14953 \begin_layout Plain Layout
14962 \begin_inset Flex Code
14965 \begin_layout Plain Layout
14971 ] Whether fragile commands in this layout should be
14972 \begin_inset Flex Code
14975 \begin_layout Plain Layout
14988 whether the command should itself be protected.) Default is false.
14991 \begin_layout Description
14992 \begin_inset Flex Code
14995 \begin_layout Plain Layout
15002 \begin_inset Flex Code
15005 \begin_layout Plain Layout
15014 \begin_inset Flex Code
15017 \begin_layout Plain Layout
15023 ] As with paragraph styles (see page
15024 \begin_inset CommandInset ref
15025 LatexCommand pageref
15026 reference "des:ParbreakIsNewline"
15034 \begin_layout Description
15035 \begin_inset Flex Code
15038 \begin_layout Plain Layout
15045 \begin_inset Flex Code
15048 \begin_layout Plain Layout
15057 \begin_inset Flex Code
15060 \begin_layout Plain Layout
15066 ] As with paragraph styles (see page
15067 \begin_inset CommandInset ref
15068 LatexCommand pageref
15069 reference "des:PassThru"
15077 \begin_layout Description
15078 \begin_inset Flex Code
15081 \begin_layout Plain Layout
15087 As with paragraph styles (see page
15088 \begin_inset CommandInset ref
15089 LatexCommand pageref
15090 reference "des:Preamble"
15097 \begin_layout Description
15098 \begin_inset Flex Code
15101 \begin_layout Plain Layout
15108 \begin_inset Flex Code
15111 \begin_layout Plain Layout
15117 ] The prefix to use when creating labels referring to insets of this type.
15118 This allows the use of formatted references.
15121 \begin_layout Description
15122 \begin_inset Flex Code
15125 \begin_layout Plain Layout
15132 \begin_inset Flex Code
15135 \begin_layout Plain Layout
15141 ] As with paragraph styles (see page
15142 \begin_inset CommandInset ref
15143 LatexCommand pageref
15144 reference "des:Requires"
15151 \begin_layout Description
15152 \begin_inset Flex Code
15155 \begin_layout Plain Layout
15162 \begin_inset Flex Code
15165 \begin_layout Plain Layout
15172 \begin_inset Flex Code
15175 \begin_layout Plain Layout
15183 ] Whether this inset should use the font of its surrounding environment
15185 Default is true: uses its own.
15188 \begin_layout Description
15189 \begin_inset Flex Code
15192 \begin_layout Plain Layout
15199 \begin_inset Flex Code
15202 \begin_layout Plain Layout
15209 \begin_inset Flex Code
15212 \begin_layout Plain Layout
15220 ] Spellcheck the contents of this inset.
15224 \begin_layout Subsection
15226 \begin_inset CommandInset label
15228 name "sub:Counters"
15235 \begin_layout Standard
15236 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15238 \begin_inset Flex MenuItem
15241 \begin_layout Plain Layout
15248 \begin_inset Flex MenuItem
15251 \begin_layout Plain Layout
15257 , \SpecialChar \ldots{}
15258 ) in the text class itself.
15259 The standard counters are defined in the file
15260 \begin_inset Flex Code
15263 \begin_layout Plain Layout
15269 , so you may have to do no more than add
15272 \begin_layout LyX-Code
15273 Input stdcounters.inc
15276 \begin_layout Standard
15277 to your layout file to get them to work.
15278 But if you want to define custom counters, then you can do so.
15279 The counter declaration must begin with:
15282 \begin_layout LyX-Code
15283 Counter CounterName
15286 \begin_layout Standard
15288 \begin_inset Flex Code
15291 \begin_layout Plain Layout
15297 ' is replaced by the name of the counter.
15298 And it must end with
15299 \begin_inset Quotes eld
15303 \begin_inset Flex Code
15306 \begin_layout Plain Layout
15313 \begin_inset Quotes erd
15317 The following parameters can also be used:
15320 \begin_layout Description
15321 \begin_inset Flex Code
15324 \begin_layout Plain Layout
15331 \begin_inset Flex Code
15334 \begin_layout Plain Layout
15341 \begin_inset Quotes erd
15345 \begin_inset Quotes erd
15348 ] When defined, this string defines how the counter is displayed.
15349 Setting this value sets
15350 \begin_inset Flex Code
15353 \begin_layout Plain Layout
15354 LabelStringAppendix
15360 The following special constructs can be used in the string:
15364 \begin_layout Itemize
15365 \begin_inset Flex Code
15368 \begin_layout Plain Layout
15376 will be replaced by the expansion of the
15377 \begin_inset Flex Code
15380 \begin_layout Plain Layout
15387 \begin_inset Flex Code
15390 \begin_layout Plain Layout
15391 LabelStringAppendix
15397 \begin_inset Flex Code
15400 \begin_layout Plain Layout
15410 \begin_layout Itemize
15411 counter values can be expressed using LaTeX-like macros
15412 \begin_inset Flex Code
15415 \begin_layout Plain Layout
15432 \begin_inset Flex Code
15435 \begin_layout Plain Layout
15447 \begin_layout Plain Layout
15457 Actually, the situation is a bit more complicated: any
15476 other than those described below will produce arabic numerals.
15477 It would not be surprising to see this change in the future.
15483 \begin_inset Flex Code
15486 \begin_layout Plain Layout
15492 : 1, 2, 3,\SpecialChar \ldots{}
15494 \begin_inset Flex Code
15497 \begin_layout Plain Layout
15503 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15505 \begin_inset Flex Code
15508 \begin_layout Plain Layout
15514 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15516 \begin_inset Flex Code
15519 \begin_layout Plain Layout
15525 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15527 \begin_inset Flex Code
15530 \begin_layout Plain Layout
15536 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15538 \begin_inset Flex Code
15541 \begin_layout Plain Layout
15547 for hebrew numerals.
15551 \begin_layout Standard
15552 If LabelString is not defined, a default value is constructed as follows:
15553 if the counter has a master counter
15554 \begin_inset Flex Code
15557 \begin_layout Plain Layout
15564 \begin_inset Flex Code
15567 \begin_layout Plain Layout
15574 \begin_inset Flex Code
15577 \begin_layout Plain Layout
15587 is used; otherwise the string
15588 \begin_inset Flex Code
15591 \begin_layout Plain Layout
15602 \begin_layout Description
15603 \begin_inset Flex Code
15606 \begin_layout Plain Layout
15607 LabelStringAppendix
15613 \begin_inset Flex Code
15616 \begin_layout Plain Layout
15623 \begin_inset Quotes erd
15627 \begin_inset Quotes erd
15631 \begin_inset Flex Code
15634 \begin_layout Plain Layout
15640 , but for use in the Appendix.
15643 \begin_layout Description
15644 \begin_inset Flex Code
15647 \begin_layout Plain Layout
15654 \begin_inset Flex Code
15657 \begin_layout Plain Layout
15664 \begin_inset Quotes erd
15668 \begin_inset Quotes erd
15671 ] A format for use with formatted references to this counter.
15672 For example, one might want to have references to section numbers appear
15674 \begin_inset Quotes eld
15678 \begin_inset Quotes erd
15682 The string should contain
15683 \begin_inset Quotes eld
15687 \begin_inset Quotes erd
15691 This will be replaced by the counter number itself.
15692 So, for sections, it would be: Section ##.
15695 \begin_layout Description
15696 \begin_inset Flex Code
15699 \begin_layout Plain Layout
15706 \begin_inset Flex Code
15709 \begin_layout Plain Layout
15716 \begin_inset Quotes erd
15720 \begin_inset Quotes erd
15723 ] If this is set to the name of another counter, the present counter will
15724 be reset every time the other one is increased.
15726 \begin_inset Flex Code
15729 \begin_layout Plain Layout
15736 \begin_inset Flex Code
15739 \begin_layout Plain Layout
15748 \begin_layout Subsection
15750 \begin_inset CommandInset label
15752 name "sub:Font-description"
15759 \begin_layout Standard
15760 A font description looks like this:
15763 \begin_layout LyX-Code
15773 \begin_layout LyX-Code
15777 \begin_layout LyX-Code
15781 \begin_layout Standard
15782 The following commands are available:
15785 \begin_layout Description
15786 \begin_inset Flex Code
15789 \begin_layout Plain Layout
15796 \begin_inset Flex Code
15799 \begin_layout Plain Layout
15808 \begin_inset Flex Code
15811 \begin_layout Plain Layout
15818 \begin_inset Flex Code
15821 \begin_layout Plain Layout
15828 \begin_inset Flex Code
15831 \begin_layout Plain Layout
15838 \begin_inset Flex Code
15841 \begin_layout Plain Layout
15848 \begin_inset Flex Code
15851 \begin_layout Plain Layout
15858 \begin_inset Flex Code
15861 \begin_layout Plain Layout
15868 \begin_inset Flex Code
15871 \begin_layout Plain Layout
15878 \begin_inset Flex Code
15881 \begin_layout Plain Layout
15890 \begin_layout Description
15891 \begin_inset Flex Code
15894 \begin_layout Plain Layout
15901 \begin_inset Flex Code
15904 \begin_layout Plain Layout
15913 \begin_inset Flex Code
15916 \begin_layout Plain Layout
15923 \begin_inset Flex Code
15926 \begin_layout Plain Layout
15935 \begin_layout Description
15936 \begin_inset Flex Code
15939 \begin_layout Plain Layout
15946 \begin_inset Flex Code
15949 \begin_layout Plain Layout
15955 ] Valid arguments are:
15956 \begin_inset Flex Code
15959 \begin_layout Plain Layout
15966 \begin_inset Flex Code
15969 \begin_layout Plain Layout
15976 \begin_inset Flex Code
15979 \begin_layout Plain Layout
15986 \begin_inset Flex Code
15989 \begin_layout Plain Layout
15996 \begin_inset Flex Code
15999 \begin_layout Plain Layout
16006 \begin_inset Flex Code
16009 \begin_layout Plain Layout
16016 Each of these turns on or off the corresponding attribute.
16018 \begin_inset Flex Code
16021 \begin_layout Plain Layout
16027 turns on emphasis, and
16028 \begin_inset Flex Code
16031 \begin_layout Plain Layout
16039 \begin_inset Newline newline
16042 If the latter seems puzzling, remember that the font settings for the present
16043 context are generally inherited from the surrounding context.
16045 \begin_inset Flex Code
16048 \begin_layout Plain Layout
16054 would turn off the emphasis that was anyway in effect, say, in a theorem
16058 \begin_layout Description
16059 \begin_inset Flex Code
16062 \begin_layout Plain Layout
16069 \begin_inset Flex Code
16072 \begin_layout Plain Layout
16081 \begin_inset Flex Code
16084 \begin_layout Plain Layout
16093 \begin_layout Description
16094 \begin_inset Flex Code
16097 \begin_layout Plain Layout
16104 \begin_inset Flex Code
16107 \begin_layout Plain Layout
16116 \begin_inset Flex Code
16119 \begin_layout Plain Layout
16126 \begin_inset Flex Code
16129 \begin_layout Plain Layout
16136 \begin_inset Flex Code
16139 \begin_layout Plain Layout
16148 \begin_layout Description
16149 \begin_inset Flex Code
16152 \begin_layout Plain Layout
16159 \begin_inset Flex Code
16162 \begin_layout Plain Layout
16169 \begin_inset Flex Code
16172 \begin_layout Plain Layout
16179 \begin_inset Flex Code
16182 \begin_layout Plain Layout
16191 \begin_inset Flex Code
16194 \begin_layout Plain Layout
16201 \begin_inset Flex Code
16204 \begin_layout Plain Layout
16211 \begin_inset Flex Code
16214 \begin_layout Plain Layout
16221 \begin_inset Flex Code
16224 \begin_layout Plain Layout
16231 \begin_inset Flex Code
16234 \begin_layout Plain Layout
16243 \begin_layout Subsection
16244 \begin_inset CommandInset label
16246 name "sub:Citation-format-description"
16250 Citation format description
16253 \begin_layout Standard
16255 \begin_inset Flex Code
16258 \begin_layout Plain Layout
16264 blocks are used to describe how bibliographic information should be displayed,
16265 both within LyX itself (in the citation dialog and in tooltips, for example)
16266 and in XHTML output.
16267 Such a block might look like this:
16270 \begin_layout LyX-Code
16274 \begin_layout LyX-Code
16278 \begin_layout LyX-Code
16282 \begin_layout LyX-Code
16286 \begin_layout Standard
16287 The individual lines define how the bibliographic information associated
16288 with an article or book, respectively, is to be displayed, and such a definitio
16289 n can be given for any `entry type' that might be present in a BibTeX file.
16290 LyX defines a default format in the source code that will be used if no
16291 specific definition has been given.
16292 LyX predefines several formats in the file
16293 \begin_inset Flex Code
16296 \begin_layout Plain Layout
16302 , which is included in most of LyX's document classes.
16305 \begin_layout Standard
16306 The definitions use a simple language that allows BibTeX keys to be replaced
16308 Keys should be enclosed in
16309 \begin_inset Flex Code
16312 \begin_layout Plain Layout
16319 \begin_inset Flex Code
16322 \begin_layout Plain Layout
16329 So a simple definition might look like this:
16332 \begin_layout LyX-Code
16334 \begin_inset Quotes eld
16338 \begin_inset Quotes erd
16344 \begin_layout Standard
16345 This would print the author, followed by a comma, followed by the title,
16346 in quotes, followed by a period.
16349 \begin_layout Standard
16350 Of course, sometimes you may want to print a key only if it exists.
16351 This can be done by using a conditional construction, such as:
16352 \begin_inset Flex Code
16355 \begin_layout Plain Layout
16357 \begin_inset space ~
16367 \begin_inset Flex Code
16370 \begin_layout Plain Layout
16376 key exists, then print
16377 \begin_inset Quotes eld
16381 \begin_inset space ~
16385 \begin_inset Quotes erd
16388 followed by the volume key.
16389 It is also possible to have an else clause in the conditional, such as:
16391 \begin_inset Flex Code
16394 \begin_layout Plain Layout
16395 {%author%[[%author%]][[%editor%, ed.]]}
16402 \begin_inset Flex Code
16405 \begin_layout Plain Layout
16411 key is printed if it exists; otherwise, the editor key is printed, followed
16413 \begin_inset Quotes eld
16417 \begin_inset space ~
16421 \begin_inset Quotes erd
16424 Note that the key is again enclosed in
16425 \begin_inset Flex Code
16428 \begin_layout Plain Layout
16434 signs; the entire conditional is enclosed in braces; and the if and else
16435 clauses are enclosed in double brackets,
16436 \begin_inset Quotes eld
16440 \begin_inset Flex Code
16443 \begin_layout Plain Layout
16450 \begin_inset Quotes eld
16454 \begin_inset Quotes eld
16458 \begin_inset Flex Code
16461 \begin_layout Plain Layout
16468 \begin_inset Quotes erd
16472 There must be no space between any of these.
16475 \begin_layout Standard
16476 There is one other piece of syntax available in definitions, which looks
16478 \begin_inset Flex Code
16481 \begin_layout Plain Layout
16488 This defines a piece of formatting information that is to be used when
16490 \begin_inset Quotes eld
16494 \begin_inset Quotes erd
16498 Obviously, we do not want to output HTML tags when writing plain text,
16499 so they should be wrapped in
16500 \begin_inset Quotes eld
16504 \begin_inset Quotes erd
16508 \begin_inset Quotes eld
16512 \begin_inset Quotes erd
16518 \begin_layout Standard
16519 Two special sorts of definitions are also possible in a
16520 \begin_inset Flex Code
16523 \begin_layout Plain Layout
16530 An example of the first would be:
16533 \begin_layout LyX-Code
16535 \begin_inset Quotes eld
16539 \begin_inset Quotes erd
16545 \begin_layout Standard
16546 This is an abbreviation, or macro, and it can be used by treating it as
16548 \begin_inset Flex Code
16551 \begin_layout Plain Layout
16559 \begin_inset Flex Code
16562 \begin_layout Plain Layout
16568 exactly as it would treat its definition.
16569 So, let us issue the obvious
16577 \begin_layout LyX-Code
16581 \begin_layout Standard
16582 or anything like it.
16583 LyX shouldn't go into an infinite loop, but it may go into a long one before
16587 \begin_layout Standard
16588 The second sort of special definition might look like this:
16591 \begin_layout LyX-Code
16595 \begin_layout Standard
16596 This defines a translatable piece of text, which allows relevant parts of
16597 the bibliography to be translated.
16598 It can be included in a definition by treating it as a key:
16599 \begin_inset Flex Code
16602 \begin_layout Plain Layout
16609 Several of these are predefined in
16610 \begin_inset Flex Code
16613 \begin_layout Plain Layout
16620 Note that these are not macros, in the sense just defined.
16621 They will not be expanded.
16624 \begin_layout Standard
16625 So here then is an example that use all these features:
16628 \begin_layout LyX-Code
16629 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16632 \begin_layout Standard
16633 This defines a macro that prints the author, followed by a comma, if the
16635 \begin_inset Flex Code
16638 \begin_layout Plain Layout
16644 key is defined, or else prints the name of the editor, followed by the
16646 \begin_inset Flex Code
16649 \begin_layout Plain Layout
16655 or its translation (it is by default
16656 \begin_inset Quotes eld
16660 \begin_inset Quotes erd
16664 \begin_inset Flex Code
16667 \begin_layout Plain Layout
16674 Note that this is in fact defined in
16675 \begin_inset Flex Code
16678 \begin_layout Plain Layout
16684 , so you can use it in your own definitions, or re-definitions, if you load
16688 \begin_layout Section
16689 \begin_inset CommandInset label
16691 name "sec:Tags-for-XHTML"
16695 Tags for XHTML output
16698 \begin_layout Standard
16699 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16700 by layout information.
16701 In general, LyX provides sensible defaults and, as mentioned earlier, it
16702 will even construct default CSS style rules from the other layout tags.
16703 For example, LyX will attempt to use the information provided in the
16704 \begin_inset Flex Code
16707 \begin_layout Plain Layout
16713 declaration for the Chapter style to write CSS that will appropriately
16714 format chapter headings.
16717 \begin_layout Standard
16718 In many cases, then, you may not have to do anything at all to get acceptable
16719 XHTML output for your own environments, custom insets, and so forth.
16720 But in some cases you will, and so LyX provides a number of layout tags
16721 that can be used to customize the XHTML and CSS that are generated.
16724 \begin_layout Standard
16725 Note that there are two tags,
16726 \begin_inset Flex Code
16729 \begin_layout Plain Layout
16736 \begin_inset Flex Code
16739 \begin_layout Plain Layout
16745 that may appear outside style and inset declarations.
16747 \begin_inset CommandInset ref
16749 reference "sub:General-text-class"
16753 for details on these.
16756 \begin_layout Subsection
16757 \begin_inset CommandInset label
16759 name "sub:Paragraph-Style-XHTML"
16766 \begin_layout Standard
16767 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16768 dealing with a normal paragraph, a command, or an environment, where this
16769 is itself determined by the contents of the corresponding
16770 \begin_inset Flex Code
16773 \begin_layout Plain Layout
16783 \begin_layout Standard
16784 For a command or normal paragraph, the output XHTML has the following form:
16787 \begin_layout LyX-Code
16789 \begin_inset Quotes erd
16793 \begin_inset Quotes erd
16799 \begin_layout LyX-Code
16801 \begin_inset Quotes erd
16805 \begin_inset Quotes erd
16811 \begin_layout LyX-Code
16812 Contents of the paragraph.
16815 \begin_layout LyX-Code
16819 \begin_layout Standard
16820 The label tags are of course omitted if the paragraph does not have a label.
16823 \begin_layout Standard
16824 For an environment that is not some sort of list, the XHTML takes this form:
16827 \begin_layout LyX-Code
16829 \begin_inset Quotes erd
16833 \begin_inset Quotes erd
16839 \begin_layout LyX-Code
16841 \begin_inset Quotes erd
16845 \begin_inset Quotes erd
16849 \begin_inset Quotes erd
16853 \begin_inset Quotes erd
16856 >Environment Label</labeltag>First paragraph.</itemtag>
16859 \begin_layout LyX-Code
16860 <itemtag>Second paragraph.</itemtag>
16863 \begin_layout LyX-Code
16867 \begin_layout Standard
16868 Note that the label is output only for the first paragraph, as it should
16869 be for a theorem, for example.
16873 \begin_layout Standard
16874 For a list, we have one of these forms:
16877 \begin_layout LyX-Code
16879 \begin_inset Quotes erd
16883 \begin_inset Quotes erd
16889 \begin_layout LyX-Code
16891 \begin_inset Quotes erd
16895 \begin_inset Quotes erd
16899 \begin_inset Quotes erd
16903 \begin_inset Quotes erd
16906 >List Label</labeltag>First item.</itemtag>
16909 \begin_layout LyX-Code
16911 \begin_inset Quotes erd
16915 \begin_inset Quotes erd
16919 \begin_inset Quotes erd
16923 \begin_inset Quotes erd
16926 >List Label</labeltag>Second item.</itemtag>
16929 \begin_layout LyX-Code
16933 \begin_layout LyX-Code
16937 \begin_layout LyX-Code
16939 \begin_inset Quotes erd
16943 \begin_inset Quotes erd
16949 \begin_layout LyX-Code
16951 \begin_inset Quotes erd
16955 \begin_inset Quotes erd
16958 >List Label</labeltag><itemtag attr=
16959 \begin_inset Quotes erd
16963 \begin_inset Quotes erd
16966 >First item.</itemtag>
16969 \begin_layout LyX-Code
16971 \begin_inset Quotes erd
16975 \begin_inset Quotes erd
16978 >List Label</labeltag><itemtag attr=
16979 \begin_inset Quotes erd
16983 \begin_inset Quotes erd
16986 >Second item.</itemtag>
16989 \begin_layout LyX-Code
16993 \begin_layout Standard
16994 Note the different orders of
16995 \begin_inset Flex Code
16998 \begin_layout Plain Layout
17005 \begin_inset Flex Code
17008 \begin_layout Plain Layout
17015 Which order we get depends upon the setting of
17016 \begin_inset Flex Code
17019 \begin_layout Plain Layout
17026 \begin_inset Flex Code
17029 \begin_layout Plain Layout
17035 is false (the default), you get the first of these, with the label within
17036 the item; if true, you get the second, with the label outside the item.
17039 \begin_layout Standard
17040 The specific tags and attributes output for each paragraph type can be controlle
17041 d by means of the layout tags we are about to describe.
17042 As mentioned earlier, however, LyX uses sensible defaults for many of these,
17043 so you often may not need to do very much to get good XHTML output.
17044 Think of the available tags as there so you can tweak things to your liking.
17047 \begin_layout Description
17048 \begin_inset Flex Code
17051 \begin_layout Plain Layout
17058 \begin_inset Flex Code
17061 \begin_layout Plain Layout
17067 ] Specifies attribute information to be output with the main tag.
17069 \begin_inset Quotes eld
17073 \begin_inset Flex Code
17076 \begin_layout Plain Layout
17083 \begin_inset Quotes erd
17087 By default, LyX will output
17088 \begin_inset Quotes eld
17092 \begin_inset Flex Code
17095 \begin_layout Plain Layout
17102 \begin_inset Quotes erd
17106 \begin_inset Flex Code
17109 \begin_layout Plain Layout
17115 is the LyX name of the layout, made lowercase, for example: chapter.
17120 contain any style information.
17122 \begin_inset Flex Code
17125 \begin_layout Plain Layout
17134 \begin_layout Description
17135 \begin_inset Flex Code
17138 \begin_layout Plain Layout
17145 \begin_inset Flex Code
17148 \begin_layout Plain Layout
17158 ] Whether to output the default CSS information LyX generates for this layout,
17159 even if additional information is explicitly provided via
17160 \begin_inset Flex Code
17163 \begin_layout Plain Layout
17171 \begin_inset Flex Code
17174 \begin_layout Plain Layout
17180 allows you to alter or augment the generated CSS, rather than to override
17183 \begin_inset Flex Code
17186 \begin_layout Plain Layout
17195 \begin_layout Description
17196 \begin_inset Flex Code
17199 \begin_layout Plain Layout
17206 \begin_inset Flex Code
17209 \begin_layout Plain Layout
17215 ] The tag to be used for individual paragraphs of environments, replacing
17217 \begin_inset Flex Code
17220 \begin_layout Plain Layout
17226 in the examples above.
17228 \begin_inset Flex Code
17231 \begin_layout Plain Layout
17240 \begin_layout Description
17241 \begin_inset Flex Code
17244 \begin_layout Plain Layout
17251 \begin_inset Flex Code
17254 \begin_layout Plain Layout
17260 ] Attributes for the item tag.
17262 \begin_inset Quotes eld
17266 \begin_inset Flex Code
17269 \begin_layout Plain Layout
17270 class=`layoutname_item'
17276 \begin_inset Quotes erd
17284 contain any style information.
17286 \begin_inset Flex Code
17289 \begin_layout Plain Layout
17298 \begin_layout Description
17299 \begin_inset Flex Code
17302 \begin_layout Plain Layout
17309 \begin_inset Flex Code
17312 \begin_layout Plain Layout
17318 ] The tag to be used for paragraph and item labels, replacing
17319 \begin_inset Flex Code
17322 \begin_layout Plain Layout
17328 in the examples above.
17330 \begin_inset Flex Code
17333 \begin_layout Plain Layout
17340 \begin_inset Flex Code
17343 \begin_layout Plain Layout
17350 \begin_inset Flex Code
17353 \begin_layout Plain Layout
17360 \begin_inset Flex Code
17363 \begin_layout Plain Layout
17364 Centered_Top_Environment
17369 , in which case it defaults to
17370 \begin_inset Flex Code
17373 \begin_layout Plain Layout
17382 \begin_layout Description
17383 \begin_inset Flex Code
17386 \begin_layout Plain Layout
17393 \begin_inset Flex Code
17396 \begin_layout Plain Layout
17402 ] Attributes for the label tag.
17404 \begin_inset Quotes eld
17408 \begin_inset Flex Code
17411 \begin_layout Plain Layout
17412 class=`layoutname_label'
17418 \begin_inset Quotes erd
17426 contain any style information.
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 ] Meaningful only for list-like environments, this tag controls whether
17465 the label tag is output before or inside the item tag.
17466 This is used, for example, in the description environment, where we want
17468 \begin_inset Flex Code
17471 \begin_layout Plain Layout
17472 <dt>\SpecialChar \ldots{}
17473 </dt><dd>\SpecialChar \ldots{}
17481 \begin_inset Flex Code
17484 \begin_layout Plain Layout
17490 : The label tag is output inside the item tag.
17493 \begin_layout Description
17494 \begin_inset Flex Code
17497 \begin_layout Plain Layout
17503 Information to be output in the
17504 \begin_inset Flex Code
17507 \begin_layout Plain Layout
17513 section when this style is used.
17514 This might, for example, be used to include a
17515 \begin_inset Flex Code
17518 \begin_layout Plain Layout
17525 \begin_inset Flex Code
17528 \begin_layout Plain Layout
17537 \begin_layout Description
17538 \begin_inset Flex Code
17541 \begin_layout Plain Layout
17547 CSS style information to be included when this style is used.
17548 Note that this will automatically be wrapped in a layout-generated
17549 \begin_inset Flex Code
17552 \begin_layout Plain Layout
17558 block, so only the CSS itself need be included.
17561 \begin_layout Description
17562 \begin_inset Flex Code
17565 \begin_layout Plain Layout
17572 \begin_inset Flex Code
17575 \begin_layout Plain Layout
17581 ] The tag to be used for the main label, replacing
17582 \begin_inset Flex Code
17585 \begin_layout Plain Layout
17591 in the examples above.
17593 \begin_inset Flex Code
17596 \begin_layout Plain Layout
17605 \begin_layout Description
17606 \begin_inset Flex Code
17609 \begin_layout Plain Layout
17616 \begin_inset Flex Code
17619 \begin_layout Plain Layout
17629 ] Marks this style as the one to be used to generate the
17630 \begin_inset Flex Code
17633 \begin_layout Plain Layout
17639 tag for the XHTML file.
17640 By default, it is false.
17642 \begin_inset Flex Code
17645 \begin_layout Plain Layout
17651 file sets it to true for the
17652 \begin_inset Flex Code
17655 \begin_layout Plain Layout
17665 \begin_layout Subsection
17669 \begin_layout Standard
17670 The XHTML output of insets can also be controlled by information in layout
17675 \begin_layout Plain Layout
17676 At present, this is true only for
17677 \begin_inset Quotes eld
17681 \begin_inset Quotes erd
17684 insets (insets you can type into) and is not true for
17685 \begin_inset Quotes eld
17689 \begin_inset Quotes erd
17692 insets (insets that are associated with dialog boxes).
17697 Here, too, LyX tries to provide sensible defaults, and it constructs default
17699 But everything can be customized.
17702 \begin_layout Standard
17703 The XHTML LyX outputs for an inset has the following form:
17706 \begin_layout LyX-Code
17708 \begin_inset Quotes erd
17712 \begin_inset Quotes erd
17718 \begin_layout LyX-Code
17719 <labeltag>Label</labeltag>
17722 \begin_layout LyX-Code
17724 \begin_inset Quotes erd
17728 \begin_inset Quotes erd
17731 >Contents of the inset.</innertag>
17734 \begin_layout LyX-Code
17738 \begin_layout Standard
17739 If the inset permits multiple paragraphs---that is, if
17740 \begin_inset Flex Code
17743 \begin_layout Plain Layout
17749 is true---then the contents of the inset will itself be output as paragraphs
17750 formatted according to the styles used for those paragraphs (standard,
17751 quote, and the like).
17752 The label tag is of course omitted if the paragraph does not have a label
17753 and, at present, is always
17754 \begin_inset Flex Code
17757 \begin_layout Plain Layout
17764 The inner tag is optional and, by default, does not appear.
17767 \begin_layout Standard
17768 The specific tags and attributes output for each inset can be controlled
17769 by means of the following layout tags.
17772 \begin_layout Description
17773 \begin_inset Flex Code
17776 \begin_layout Plain Layout
17783 \begin_inset Flex Code
17786 \begin_layout Plain Layout
17792 ] Specifies attribute information to be output with the main tag.
17794 \begin_inset Quotes eld
17798 \begin_inset Flex Code
17801 \begin_layout Plain Layout
17802 class=`myinset' onclick=`\SpecialChar \ldots{}
17809 \begin_inset Quotes erd
17813 By default, LyX will output
17814 \begin_inset Quotes eld
17818 \begin_inset Flex Code
17821 \begin_layout Plain Layout
17828 \begin_inset Quotes erd
17832 \begin_inset Flex Code
17835 \begin_layout Plain Layout
17841 is the LyX name of the inset, made lowercase and with non-alphanumeric
17842 characters converted to underscores, for example: footnote.
17845 \begin_layout Description
17846 \begin_inset Flex Code
17849 \begin_layout Plain Layout
17856 \begin_inset Flex Code
17859 \begin_layout Plain Layout
17869 ] Whether to output the default CSS information LyX generates for this layout,
17870 even if additional information is explicitly provided via
17871 \begin_inset Flex Code
17874 \begin_layout Plain Layout
17882 \begin_inset Flex Code
17885 \begin_layout Plain Layout
17891 allows you to alter or augment the generated CSS, rather than to override
17896 \begin_layout Description
17897 \begin_inset Flex Code
17900 \begin_layout Plain Layout
17907 \begin_inset Flex Code
17910 \begin_layout Plain Layout
17916 ] Attributes for the inner tag.
17918 \begin_inset Quotes eld
17922 \begin_inset Flex Code
17925 \begin_layout Plain Layout
17926 class=`insetname_inner'
17932 \begin_inset Quotes erd
17938 \begin_layout Description
17939 \begin_inset Flex Code
17942 \begin_layout Plain Layout
17949 \begin_inset Flex Code
17952 \begin_layout Plain Layout
17958 ] The inner tag, replacing
17959 \begin_inset Flex Code
17962 \begin_layout Plain Layout
17968 in the examples above.
17969 By default, there is none.
17972 \begin_layout Description
17973 \begin_inset Flex Code
17976 \begin_layout Plain Layout
17983 \begin_inset Flex Code
17986 \begin_layout Plain Layout
17994 ] Whether this inset represents a standalone block of text (such as a footnote)
17995 or instead represents material that is included in the surrounding text
17996 (such as a branch).
18000 \begin_layout Description
18001 \begin_inset Flex Code
18004 \begin_layout Plain Layout
18011 \begin_inset Flex Code
18014 \begin_layout Plain Layout
18020 ] A label for this inset, possibly including a reference to a counter.
18021 For example, for footnote, it might be:
18022 \begin_inset Flex Code
18025 \begin_layout Plain Layout
18034 This is optional, and there is no default.
18037 \begin_layout Description
18038 \begin_inset Flex Code
18041 \begin_layout Plain Layout
18047 Information to be output in the
18048 \begin_inset Flex Code
18051 \begin_layout Plain Layout
18057 section when this style is used.
18058 This might, for example, be used to include a
18059 \begin_inset Flex Code
18062 \begin_layout Plain Layout
18069 \begin_inset Flex Code
18072 \begin_layout Plain Layout
18081 \begin_layout Description
18082 \begin_inset Flex Code
18085 \begin_layout Plain Layout
18091 CSS style information to be included when this style is used.
18092 Note that this will automatically be wrapped in a layout-generated
18093 \begin_inset Flex Code
18096 \begin_layout Plain Layout
18102 block, so only the CSS itself need be included.
18105 \begin_layout Description
18106 \begin_inset Flex Code
18109 \begin_layout Plain Layout
18116 \begin_inset Flex Code
18119 \begin_layout Plain Layout
18125 ] The tag to be used for the main label, replacing
18126 \begin_inset Flex Code
18129 \begin_layout Plain Layout
18135 in the examples above.
18136 The default depends upon the setting of
18137 \begin_inset Flex Code
18140 \begin_layout Plain Layout
18147 \begin_inset Flex Code
18150 \begin_layout Plain Layout
18156 is true, the default is
18157 \begin_inset Flex Code
18160 \begin_layout Plain Layout
18166 ; if it is false, the default is
18167 \begin_inset Flex Code
18170 \begin_layout Plain Layout
18179 \begin_layout Subsection
18183 \begin_layout Standard
18184 The XHTML output for floats too can be controlled by layout information.
18185 The output has the following form:
18188 \begin_layout LyX-Code
18190 \begin_inset Quotes erd
18194 \begin_inset Quotes erd
18200 \begin_layout LyX-Code
18201 Contents of the float.
18204 \begin_layout LyX-Code
18208 \begin_layout Standard
18209 The caption, if there is one, is a separate inset and will be output as
18211 Its appearance can be controlled via the InsetLayout for caption insets.
18215 \begin_layout Description
18216 \begin_inset Flex Code
18219 \begin_layout Plain Layout
18226 \begin_inset Flex Code
18229 \begin_layout Plain Layout
18235 ] Specifies attribute information to be output with the main tag.
18237 \begin_inset Quotes eld
18241 \begin_inset Flex Code
18244 \begin_layout Plain Layout
18245 class=`myfloat' onclick=`\SpecialChar \ldots{}
18252 \begin_inset Quotes erd
18256 By default, LyX will output
18257 \begin_inset Quotes eld
18261 \begin_inset Flex Code
18264 \begin_layout Plain Layout
18265 class=`float float-floattype'
18271 \begin_inset Quotes erd
18275 \begin_inset Flex Code
18278 \begin_layout Plain Layout
18284 is LyX's name for this type of float, as determined by the float declaration
18286 \begin_inset CommandInset ref
18288 reference "sub:Floats"
18292 ), though made lowercase and with non-alphanumeric characters converted
18293 to underscores, for example: float-table.
18296 \begin_layout Description
18297 \begin_inset Flex Code
18300 \begin_layout Plain Layout
18306 CSS style information to be included when this float is used.
18307 Note that this will automatically be wrapped in a layout-generated
18308 \begin_inset Flex Code
18311 \begin_layout Plain Layout
18317 block, so only the CSS itself need be included.
18320 \begin_layout Description
18321 \begin_inset Flex Code
18324 \begin_layout Plain Layout
18331 \begin_inset Flex Code
18334 \begin_layout Plain Layout
18340 ] The tag to be used for this float, replacing
18341 \begin_inset Quotes eld
18345 \begin_inset Flex Code
18348 \begin_layout Plain Layout
18355 \begin_inset Quotes erd
18358 in the example above.
18360 \begin_inset Flex Code
18363 \begin_layout Plain Layout
18369 and will rarely need changing.
18372 \begin_layout Subsection
18373 Bibliography formatting
18376 \begin_layout Standard
18377 The bibliography can be formatted using
18378 \begin_inset Flex Code
18381 \begin_layout Plain Layout
18389 \begin_inset CommandInset ref
18391 reference "sub:Citation-format-description"
18398 \begin_layout Subsection
18402 \begin_layout Standard
18403 We have several times mentioned that LyX will generate default CSS style
18404 rules for both insets and paragraph styles, based upon the other layout
18405 information that is provided.
18406 In this section, we shall say a word about which layout information LyX
18410 \begin_layout Standard
18411 At present, LyX auto-generates CSS only for font information, making use
18413 \begin_inset Flex Code
18416 \begin_layout Plain Layout
18423 \begin_inset Flex Code
18426 \begin_layout Plain Layout
18433 \begin_inset Flex Code
18436 \begin_layout Plain Layout
18443 \begin_inset Flex Code
18446 \begin_layout Plain Layout
18453 \begin_inset Flex Code
18456 \begin_layout Plain Layout
18464 \begin_inset CommandInset ref
18466 reference "sub:Font-description"
18470 .) The translation is mostly straightforward and obvious.
18472 \begin_inset Quotes eld
18476 \begin_inset Flex Code
18479 \begin_layout Plain Layout
18486 \begin_inset Quotes erd
18490 \begin_inset Quotes eld
18494 \begin_inset Flex Code
18497 \begin_layout Plain Layout
18498 font-family: sans-serif;
18504 \begin_inset Quotes erd
18508 The correspondence of LyX sizes and CSS sizes is a little less obvious
18509 but nonetheless intuitive.
18511 \begin_inset Flex Code
18514 \begin_layout Plain Layout
18521 \begin_inset Flex URL
18524 \begin_layout Plain Layout
18535 \begin_layout Chapter
18536 Including External Material
18539 \begin_layout Standard
18540 \begin_inset Box Shadowbox
18550 height_special "totalheight"
18553 \begin_layout Plain Layout
18554 WARNING: This portion of the documentation has not been updated for some
18556 We certainly hope that it is still accurate, but there are no guarantees.
18564 \begin_layout Standard
18565 The use of material from sources external to LyX is covered in detail in
18571 This part of the manual covers what needs to happen behind the scenes for
18572 new sorts of material to be included.
18575 \begin_layout Section
18579 \begin_layout Standard
18580 The external material feature is based on the concept of a
18585 A template is a specification of how LyX should interface with a certain
18587 As bundled, LyX comes with predefined templates for Xfig figures, various
18588 raster format images, chess diagrams, and LilyPond music notation.
18589 You can check the actual list by using the menu
18590 \begin_inset Flex MenuItem
18593 \begin_layout Plain Layout
18594 Insert\SpecialChar \menuseparator
18595 File\SpecialChar \menuseparator
18602 Furthermore, it is possible to roll your own template to support a specific
18604 Later we'll describe in more detail what is involved, and hopefully you
18605 will submit all the templates you create so we can include them in a later
18609 \begin_layout Standard
18610 Another basic idea of the external material feature is to distinguish between
18611 the original file that serves as a base for final material and the produced
18612 file that is included in your exported or printed document.
18613 For example, consider the case of a figure produced with
18614 \begin_inset Flex Code
18617 \begin_layout Plain Layout
18624 The Xfig application itself works on an original file with the
18625 \begin_inset Flex Code
18628 \begin_layout Plain Layout
18635 Within Xfig, you create and change your figure, and when you are done,
18637 \begin_inset Flex Code
18640 \begin_layout Plain Layout
18647 When you want to include the figure in your document, you invoke
18648 \begin_inset Flex Code
18651 \begin_layout Plain Layout
18657 in order to create a PostScript file that can readily be included in your
18660 \begin_inset Flex Code
18663 \begin_layout Plain Layout
18669 file is the original file, and the PostScript file is the produced file.
18672 \begin_layout Standard
18673 This distinction is important in order to allow updating of the material
18674 while you are in the process of writing the document.
18675 Furthermore, it provides us with the flexibility that is needed to support
18676 multiple export formats.
18677 For instance, in the case of a plain text file, it is not exactly an award-winn
18678 ing idea to include the figure as raw PostScript.
18679 Instead, you'd either prefer to just include a reference to the figure
18680 or try to invoke some graphics to ASCII converter to make the final result
18681 look similar to the real graphics.
18682 The external material management allows you to do this, because it is parametri
18683 zed on the different export formats that LyX supports.
18686 \begin_layout Standard
18687 Besides supporting the production of different products according to the
18688 exported format, it supports tight integration with editing and viewing
18690 In the case of an Xfig figure, you are able to invoke Xfig on the original
18691 file with a single click from within the external material dialog in LyX,
18692 and also preview the produced PostScript file with Ghostview with another
18694 No more fiddling around with the command line and/or file browsers to locate
18695 and manipulate the original or produced files.
18696 In this way, you are finally able to take full advantage of the many different
18697 applications that are relevant to use when you write your documents, and
18698 ultimately be more productive.
18701 \begin_layout Section
18702 The external template configuration file
18705 \begin_layout Standard
18706 It is relatively easy to add custom external template definitions to LyX.
18707 However, be aware that doing this in an careless manner most probably
18711 introduce an easily exploitable security hole.
18712 So before you do this, please read the discussion about security in section
18714 \begin_inset CommandInset ref
18716 reference "sec:Security-discussion"
18723 \begin_layout Standard
18724 Having said that, we encourage you to submit any interesting templates that
18729 \begin_layout Standard
18730 The external templates are defined in the
18731 \begin_inset Flex Code
18734 \begin_layout Plain Layout
18735 LyXDir/lib/external_templates
18741 You can place your own version in
18742 \begin_inset Flex Code
18745 \begin_layout Plain Layout
18746 UserDir/external_templates
18754 \begin_layout Standard
18755 A typical template looks like this:
18758 \begin_layout LyX-Code
18762 \begin_layout LyX-Code
18763 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18766 \begin_layout LyX-Code
18770 \begin_layout LyX-Code
18774 \begin_layout LyX-Code
18778 \begin_layout LyX-Code
18782 \begin_layout LyX-Code
18786 \begin_layout LyX-Code
18787 AutomaticProduction true
18790 \begin_layout LyX-Code
18794 \begin_layout LyX-Code
18798 \begin_layout LyX-Code
18802 \begin_layout LyX-Code
18803 TransformCommand Rotate RotationLatexCommand
18806 \begin_layout LyX-Code
18807 TransformCommand Resize ResizeLatexCommand
18810 \begin_layout LyX-Code
18811 Product "$$RotateFront$$ResizeFront
18814 \begin_layout LyX-Code
18819 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18822 \begin_layout LyX-Code
18823 $$ResizeBack$$RotateBack"
18826 \begin_layout LyX-Code
18830 \begin_layout LyX-Code
18831 UpdateResult "$$AbsPath$$Basename.pstex_t"
18834 \begin_layout LyX-Code
18835 Requirement "graphicx"
18838 \begin_layout LyX-Code
18839 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18842 \begin_layout LyX-Code
18843 ReferencedFile latex "$$AbsPath$$Basename.eps"
18846 \begin_layout LyX-Code
18847 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18850 \begin_layout LyX-Code
18854 \begin_layout LyX-Code
18858 \begin_layout LyX-Code
18859 TransformCommand Rotate RotationLatexCommand
18862 \begin_layout LyX-Code
18863 TransformCommand Resize ResizeLatexCommand
18866 \begin_layout LyX-Code
18867 Product "$$RotateFront$$ResizeFront
18870 \begin_layout LyX-Code
18875 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18878 \begin_layout LyX-Code
18879 $$ResizeBack$$RotateBack"
18882 \begin_layout LyX-Code
18883 UpdateFormat pdftex
18886 \begin_layout LyX-Code
18887 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18890 \begin_layout LyX-Code
18891 Requirement "graphicx"
18894 \begin_layout LyX-Code
18895 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18898 \begin_layout LyX-Code
18899 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18902 \begin_layout LyX-Code
18906 \begin_layout LyX-Code
18910 \begin_layout LyX-Code
18911 Product "$$Contents(
18913 "$$AbsPath$$Basename.asc
18918 \begin_layout LyX-Code
18919 UpdateFormat asciixfig
18922 \begin_layout LyX-Code
18923 UpdateResult "$$AbsPath$$Basename.asc"
18926 \begin_layout LyX-Code
18930 \begin_layout LyX-Code
18934 \begin_layout LyX-Code
18935 Product "<graphic fileref=
18937 "$$AbsOrRelPathMaster$$Basename.eps
18942 \begin_layout LyX-Code
18946 \begin_layout LyX-Code
18950 \begin_layout LyX-Code
18951 UpdateResult "$$AbsPath$$Basename.eps"
18954 \begin_layout LyX-Code
18955 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18958 \begin_layout LyX-Code
18959 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18962 \begin_layout LyX-Code
18966 \begin_layout LyX-Code
18967 Product "[XFig: $$FName]"
18970 \begin_layout LyX-Code
18974 \begin_layout LyX-Code
18978 \begin_layout Standard
18979 As you can see, the template is enclosed in
18980 \begin_inset Flex Code
18983 \begin_layout Plain Layout
18989 \SpecialChar \ldots{}
18991 \begin_inset Flex Code
18994 \begin_layout Plain Layout
19001 It contains a header specifying some general settings and, for each supported
19002 primary document file format, a section
19003 \begin_inset Flex Code
19006 \begin_layout Plain Layout
19012 \SpecialChar \ldots{}
19014 \begin_inset Flex Code
19017 \begin_layout Plain Layout
19026 \begin_layout Subsection
19027 The template header
19030 \begin_layout Description
19031 \begin_inset Flex Code
19034 \begin_layout Plain Layout
19035 AutomaticProduction
19036 \begin_inset space ~
19044 Whether the file represented by the template must be generated by LyX.
19045 This command must occur exactly once.
19048 \begin_layout Description
19049 \begin_inset Flex Code
19052 \begin_layout Plain Layout
19054 \begin_inset space ~
19062 A glob pattern that is used in the file dialog to filter out the desired
19064 If there is more than one possible file extension (e.
19065 \begin_inset space \thinspace{}
19069 \begin_inset space \space{}
19073 \begin_inset Flex Code
19076 \begin_layout Plain Layout
19083 \begin_inset Flex Code
19086 \begin_layout Plain Layout
19092 ), use something like
19093 \begin_inset Flex Code
19096 \begin_layout Plain Layout
19103 This command must occur exactly once.
19106 \begin_layout Description
19107 \begin_inset Flex Code
19110 \begin_layout Plain Layout
19112 \begin_inset space ~
19120 The text that is displayed on the button.
19121 This command must occur exactly once.
19124 \begin_layout Description
19125 \begin_inset Flex Code
19128 \begin_layout Plain Layout
19130 \begin_inset space ~
19134 \begin_inset space ~
19142 The help text that is used in the External dialog.
19143 Provide enough information to explain to the user just what the template
19144 can provide him with.
19145 This command must occur exactly once.
19148 \begin_layout Description
19149 \begin_inset Flex Code
19152 \begin_layout Plain Layout
19154 \begin_inset space ~
19162 The file format of the original file.
19163 This must be the name of a format that is known to LyX (see section
19164 \begin_inset CommandInset ref
19166 reference "sec:Formats"
19172 \begin_inset Quotes eld
19176 \begin_inset Flex Code
19179 \begin_layout Plain Layout
19186 \begin_inset Quotes erd
19189 if the template can handle original files of more than one format.
19190 LyX will attempt to interrogate the file itself in order to deduce its
19191 format in this case.
19192 This command must occur exactly once.
19195 \begin_layout Description
19196 \begin_inset Flex Code
19199 \begin_layout Plain Layout
19201 \begin_inset space ~
19209 A unique name for the template.
19210 It must not contain substitution macros (see below).
19213 \begin_layout Description
19214 \begin_inset Flex Code
19217 \begin_layout Plain Layout
19219 \begin_inset space ~
19222 Rotate|Resize|Clip|Extra
19227 This command specifies which transformations are supported by this template.
19228 It may occur zero or more times.
19229 This command enables the corresponding tabs in the external dialog.
19231 \begin_inset Flex Code
19234 \begin_layout Plain Layout
19240 command must have either a corresponding
19241 \begin_inset Flex Code
19244 \begin_layout Plain Layout
19251 \begin_inset Flex Code
19254 \begin_layout Plain Layout
19261 \begin_inset Flex Code
19264 \begin_layout Plain Layout
19271 Otherwise the transformation will not be supported by that format.
19274 \begin_layout Subsection
19278 \begin_layout Description
19279 \begin_inset Flex Code
19282 \begin_layout Plain Layout
19284 \begin_inset space ~
19287 LaTeX|PDFLaTeX|PlainText|DocBook
19292 The primary document file format that this format definition is for.
19293 Not every template has a sensible representation in all document file formats.
19294 Please define nevertheless a
19295 \begin_inset Flex Code
19298 \begin_layout Plain Layout
19304 section for all formats.
19305 Use a dummy text when no representation is available.
19306 Then you can at least see a reference to the external material in the exported
19310 \begin_layout Description
19311 \begin_inset Flex Code
19314 \begin_layout Plain Layout
19316 \begin_inset space ~
19320 \begin_inset space ~
19328 This command defines an additional macro
19329 \begin_inset Flex Code
19332 \begin_layout Plain Layout
19338 for substitution in
19339 \begin_inset Flex Code
19342 \begin_layout Plain Layout
19350 \begin_inset Flex Code
19353 \begin_layout Plain Layout
19359 itself may contain substitution macros.
19360 The advantage over using
19361 \begin_inset Flex Code
19364 \begin_layout Plain Layout
19371 \begin_inset Flex Code
19374 \begin_layout Plain Layout
19380 is that the substituted value of
19381 \begin_inset Flex Code
19384 \begin_layout Plain Layout
19390 is sanitized so that it is a valid optional argument in the document format.
19391 This command may occur zero or more times.
19394 \begin_layout Description
19395 \begin_inset Flex Code
19398 \begin_layout Plain Layout
19400 \begin_inset space ~
19408 The text that is inserted in the exported document.
19409 This is actually the most important command and can be quite complex.
19410 This command must occur exactly once.
19413 \begin_layout Description
19414 \begin_inset Flex Code
19417 \begin_layout Plain Layout
19419 \begin_inset space ~
19427 This command specifies a preamble snippet that will be included in the
19429 It has to be defined using
19430 \begin_inset Flex Code
19433 \begin_layout Plain Layout
19439 \SpecialChar \ldots{}
19441 \begin_inset Flex Code
19444 \begin_layout Plain Layout
19451 This command may occur zero or more times.
19454 \begin_layout Description
19455 \begin_inset Flex Code
19458 \begin_layout Plain Layout
19460 \begin_inset space ~
19464 \begin_inset space ~
19472 This command denotes files that are created by the conversion process and
19473 are needed for a particular export format.
19474 If the filename is relative, it is interpreted relative to the master document.
19475 This command may be given zero or more times.
19478 \begin_layout Description
19479 \begin_inset Flex Code
19482 \begin_layout Plain Layout
19484 \begin_inset space ~
19492 The name of a required LaTeX package.
19493 The package is included via
19494 \begin_inset Flex Code
19497 \begin_layout Plain Layout
19505 in the LaTeX preamble.
19506 This command may occur zero or more times.
19509 \begin_layout Description
19510 \begin_inset Flex Code
19513 \begin_layout Plain Layout
19515 \begin_inset space ~
19519 \begin_inset space ~
19522 RotationLatexCommand
19527 This command specifies that the built in LaTeX command should be used for
19529 This command may occur once or not at all.
19532 \begin_layout Description
19533 \begin_inset Flex Code
19536 \begin_layout Plain Layout
19538 \begin_inset space ~
19542 \begin_inset space ~
19550 This command specifies that the built in LaTeX command should be used for
19552 This command may occur once or not at all.
19555 \begin_layout Description
19556 \begin_inset Flex Code
19559 \begin_layout Plain Layout
19561 \begin_inset space ~
19565 \begin_inset space ~
19568 RotationLatexOption
19573 This command specifies that rotation is done via an optional argument.
19574 This command may occur once or not at all.
19577 \begin_layout Description
19578 \begin_inset Flex Code
19581 \begin_layout Plain Layout
19583 \begin_inset space ~
19587 \begin_inset space ~
19595 This command specifies that resizing is done via an optional argument.
19596 This command may occur once or not at all.
19599 \begin_layout Description
19600 \begin_inset Flex Code
19603 \begin_layout Plain Layout
19605 \begin_inset space ~
19609 \begin_inset space ~
19617 This command specifies that clipping is done via an optional argument.
19618 This command may occur once or not at all.
19621 \begin_layout Description
19622 \begin_inset Flex Code
19625 \begin_layout Plain Layout
19627 \begin_inset space ~
19631 \begin_inset space ~
19639 This command specifies that an extra optional argument is used.
19640 This command may occur once or not at all.
19643 \begin_layout Description
19644 \begin_inset Flex Code
19647 \begin_layout Plain Layout
19649 \begin_inset space ~
19657 The file format of the converted file.
19658 This must be the name of a format that is known to LyX (see the
19659 \begin_inset Flex MenuItem
19662 \begin_layout Plain Layout
19667 ools\SpecialChar \menuseparator
19672 references:Conversion
19678 This command must occur exactly once.
19681 \begin_layout Description
19682 \begin_inset Flex Code
19685 \begin_layout Plain Layout
19687 \begin_inset space ~
19695 The file name of the converted file.
19696 The file name must be absolute.
19697 This command must occur exactly once.
19700 \begin_layout Subsection
19701 Preamble definitions
19704 \begin_layout Standard
19705 The external template configuration file may contain additional preamble
19706 definitions enclosed by
19707 \begin_inset Flex Code
19710 \begin_layout Plain Layout
19716 \SpecialChar \ldots{}
19718 \begin_inset Flex Code
19721 \begin_layout Plain Layout
19728 They can be used by the templates in the
19729 \begin_inset Flex Code
19732 \begin_layout Plain Layout
19741 \begin_layout Section
19742 The substitution mechanism
19745 \begin_layout Standard
19746 When the external material facility invokes an external program, it is done
19747 on the basis of a command defined in the template configuration file.
19748 These commands can contain various macros that are expanded before execution.
19749 Execution always take place in the directory of the containing document.
19752 \begin_layout Standard
19753 Also, whenever external material is to be displayed, the name will be produced
19754 by the substitution mechanism, and most other commands in the template
19755 definition support substitution as well.
19758 \begin_layout Standard
19759 The available macros are the following:
19762 \begin_layout Description
19763 \begin_inset Flex Code
19766 \begin_layout Plain Layout
19767 $$AbsOrRelPathMaster
19772 The file path, absolute or relative to the master LyX document.
19775 \begin_layout Description
19776 \begin_inset Flex Code
19779 \begin_layout Plain Layout
19780 $$AbsOrRelPathParent
19785 The file path, absolute or relative to the LyX document.
19788 \begin_layout Description
19789 \begin_inset Flex Code
19792 \begin_layout Plain Layout
19798 The absolute file path.
19801 \begin_layout Description
19802 \begin_inset Flex Code
19805 \begin_layout Plain Layout
19811 The filename without path and without the extension.
19814 \begin_layout Description
19815 \begin_inset Flex Code
19818 \begin_layout Plain Layout
19820 \begin_inset Quotes eld
19824 \begin_inset Quotes erd
19832 This macro will expand to the contents of the file with the name
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 file extension (including the dot).
19858 \begin_layout Description
19859 \begin_inset Flex Code
19862 \begin_layout Plain Layout
19868 The filename of the file specified in the external material dialog.
19869 This is either an absolute name, or it is relative to the LyX document.
19872 \begin_layout Description
19873 \begin_inset Flex Code
19876 \begin_layout Plain Layout
19883 \begin_inset Flex Code
19886 \begin_layout Plain Layout
19892 (absolute name or relative to the LyX document).
19895 \begin_layout Description
19896 \begin_inset Flex Code
19899 \begin_layout Plain Layout
19905 The file path, relative to the master LyX document.
19908 \begin_layout Description
19909 \begin_inset Flex Code
19912 \begin_layout Plain Layout
19918 The file path, relative to the LyX document.
19921 \begin_layout Description
19922 \begin_inset Flex Code
19925 \begin_layout Plain Layout
19931 This macro will expand to the absolute path of the system directory.
19932 This is typically used to point to the various helper scripts that are
19936 \begin_layout Description
19937 \begin_inset Flex Code
19940 \begin_layout Plain Layout
19946 A name and full path to a temporary file which will be automatically deleted
19947 whenever the containing document is closed, or the external material insertion
19951 \begin_layout Standard
19952 All path macros contain a trailing directory separator, so you can construct
19954 \begin_inset space \thinspace{}
19958 \begin_inset space \space{}
19961 the absolute filename with
19962 \begin_inset Flex Code
19965 \begin_layout Plain Layout
19966 $$AbsPath$$Basename$$Extension
19974 \begin_layout Standard
19975 The macros above are substituted in all commands unless otherwise noted.
19977 \begin_inset Flex Code
19980 \begin_layout Plain Layout
19986 supports additionally the following substitutions if they are enabled by
19988 \begin_inset Flex Code
19991 \begin_layout Plain Layout
19998 \begin_inset Flex Code
20001 \begin_layout Plain Layout
20010 \begin_layout Description
20011 \begin_inset Flex Code
20014 \begin_layout Plain Layout
20020 The front part of the resize command.
20023 \begin_layout Description
20024 \begin_inset Flex Code
20027 \begin_layout Plain Layout
20033 The back part of the resize command.
20036 \begin_layout Description
20037 \begin_inset Flex Code
20040 \begin_layout Plain Layout
20046 The front part of the rotation command.
20049 \begin_layout Description
20050 \begin_inset Flex Code
20053 \begin_layout Plain Layout
20059 The back part of the rotation command.
20062 \begin_layout Standard
20063 The value string of the
20064 \begin_inset Flex Code
20067 \begin_layout Plain Layout
20073 command supports additionally the following substitutions if they are enabled
20075 \begin_inset Flex Code
20078 \begin_layout Plain Layout
20085 \begin_inset Flex Code
20088 \begin_layout Plain Layout
20097 \begin_layout Description
20098 \begin_inset Flex Code
20101 \begin_layout Plain Layout
20110 \begin_layout Description
20111 \begin_inset Flex Code
20114 \begin_layout Plain Layout
20123 \begin_layout Description
20124 \begin_inset Flex Code
20127 \begin_layout Plain Layout
20136 \begin_layout Description
20137 \begin_inset Flex Code
20140 \begin_layout Plain Layout
20146 The rotation option.
20149 \begin_layout Standard
20150 You may ask why there are so many path macros.
20151 There are mainly two reasons:
20154 \begin_layout Enumerate
20155 Relative and absolute file names should remain relative or absolute, respectivel
20157 Users may have reasons to prefer either form.
20158 Relative names are useful for portable documents that should work on different
20159 machines, for example.
20160 Absolute names may be required by some programs.
20163 \begin_layout Enumerate
20164 LaTeX treats relative file names differently than LyX and other programs
20165 in nested included files.
20166 For LyX, a relative file name is always relative to the document that contains
20168 For LaTeX, it is always relative to the master document.
20169 These two definitions are identical if you have only one document, but
20170 differ if you have a master document that includes part documents.
20171 That means that relative filenames must be transformed when presented to
20173 Fortunately LyX does this automatically for you if you choose the right
20177 \begin_layout Standard
20178 So which path macro should be used in new template definitions? The rule
20182 \begin_layout Itemize
20184 \begin_inset Flex Code
20187 \begin_layout Plain Layout
20193 if an absolute path is required.
20196 \begin_layout Itemize
20198 \begin_inset Flex Code
20201 \begin_layout Plain Layout
20202 $$AbsOrRelPathMaster
20207 if the substituted string is some kind of LaTeX input.
20210 \begin_layout Itemize
20212 \begin_inset Flex Code
20215 \begin_layout Plain Layout
20216 $$AbsOrRelPathParent
20221 in order to preserve the user's choice.
20224 \begin_layout Standard
20225 There are special cases where this rule does not work and e.
20226 \begin_inset space \thinspace{}
20230 \begin_inset space \space{}
20233 relative names are needed, but normally it will work just fine.
20234 One example for such a case is the command
20235 \begin_inset Flex Code
20238 \begin_layout Plain Layout
20239 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20244 in the XFig template above: We can't use the absolute name because the
20246 \begin_inset Flex Code
20249 \begin_layout Plain Layout
20255 files needs the relative name in order to rewrite the file content.
20258 \begin_layout Section
20259 Security discussion
20260 \begin_inset CommandInset label
20262 name "sec:Security-discussion"
20269 \begin_layout Standard
20270 The external material feature interfaces with a lot of external programs
20271 and does so automatically, so we have to consider the security implications
20273 In particular, since you have the option of including your own filenames
20274 and/or parameter strings and those are expanded into a command, it seems
20275 that it would be possible to create a malicious document which executes
20276 arbitrary commands when a user views or prints the document.
20277 This is something we definitely want to avoid.
20280 \begin_layout Standard
20281 However, since the external program commands are specified in the template
20282 configuration file only, there are no security issues if LyX is properly
20283 configured with safe templates only.
20284 This is so because the external programs are invoked with the
20285 \begin_inset Flex Code
20288 \begin_layout Plain Layout
20294 -system call rather than the
20295 \begin_inset Flex Code
20298 \begin_layout Plain Layout
20304 system-call, so it's not possible to execute arbitrary commands from the
20305 filename or parameter section via the shell.
20308 \begin_layout Standard
20309 This also implies that you are restricted in what command strings you can
20310 use in the external material templates.
20311 In particular, pipes and redirection are not readily available.
20312 This has to be so if LyX should remain safe.
20313 If you want to use some of the shell features, you should write a safe
20314 script to do this in a controlled manner, and then invoke the script from
20315 the command string.
20319 \begin_layout Standard
20320 It is possible to design a template that interacts directly with the shell,
20321 but since this would allow a malicious user to execute arbitrary commands
20322 by writing clever filenames and/or parameters, we generally recommend that
20323 you only use safe scripts that work with the
20324 \begin_inset Flex Code
20327 \begin_layout Plain Layout
20333 system call in a controlled manner.
20334 Of course, for use in a controlled environment, it can be tempting to just
20335 fall back to use ordinary shell scripts.
20336 If you do so, be aware that you
20340 provide an easily exploitable security hole in your system.
20341 Of course it stands to reason that such unsafe templates will never be
20342 included in the standard LyX distribution, although we do encourage people
20343 to submit new templates in the open source tradition.
20344 But LyX as shipped from the official distribution channels will never have
20348 \begin_layout Standard
20349 Including external material provides a lot of power, and you have to be
20350 careful not to introduce security hazards with this power.
20351 A subtle error in a single line in an innocent looking script can open
20352 the door to huge security problems.
20353 So if you do not fully understand the issues, we recommend that you consult
20354 a knowledgeable security professional or the LyX development team if you
20355 have any questions about whether a given template is safe or not.
20356 And do this before you use it in an uncontrolled environment.