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
13089 \begin_inset Flex Code
13092 \begin_layout Plain Layout
13099 \begin_inset Quotes erd
13103 \begin_inset Quotes erd
13106 ] The command used to generate a list of floats of this type; the leading
13109 ' should be omitted.
13115 \begin_inset Flex Code
13118 \begin_layout Plain Layout
13124 is false, since there is no standard way to generate this command.
13126 \begin_inset Flex Code
13129 \begin_layout Plain Layout
13135 is true, since in that case there is a standard way.
13138 \begin_layout Description
13139 \begin_inset Flex Code
13142 \begin_layout Plain Layout
13149 \begin_inset Flex Code
13152 \begin_layout Plain Layout
13159 \begin_inset Quotes erd
13163 \begin_inset Quotes erd
13166 ] A title for a list of floats of this kind (list of figures, tables, or
13168 It is used for the screen label within LyX; it is passed to LaTeX for use
13169 as the title there; and it is used as the title in XHTML output.
13170 It will be translated to the document language.
13173 \begin_layout Description
13174 \begin_inset Flex Code
13177 \begin_layout Plain Layout
13184 \begin_inset Flex Code
13187 \begin_layout Plain Layout
13194 \begin_inset Flex Code
13197 \begin_layout Plain Layout
13205 ] Indicates whether the float is already defined in the document class or
13206 if we instead need to load
13207 \begin_inset Flex Code
13210 \begin_layout Plain Layout
13216 and use what it provides.
13218 \begin_inset Flex Code
13221 \begin_layout Plain Layout
13228 \begin_inset Flex Code
13231 \begin_layout Plain Layout
13238 It should be set to
13239 \begin_inset Flex Code
13242 \begin_layout Plain Layout
13248 if the float is already defined by the LaTeX document class.
13251 \begin_layout Description
13252 \begin_inset Flex Code
13255 \begin_layout Plain Layout
13262 \begin_inset Flex Code
13265 \begin_layout Plain Layout
13272 \begin_inset Quotes erd
13276 \begin_inset Quotes erd
13279 ] This (optional) argument determines whether floats of this class will
13280 be numbered within some sectional unit of the document.
13281 For example, if within is equal to
13282 \begin_inset Flex Code
13285 \begin_layout Plain Layout
13291 , the floats will be numbered within chapters.
13295 \begin_layout Description
13296 \begin_inset Flex Code
13299 \begin_layout Plain Layout
13306 \begin_inset Flex Code
13309 \begin_layout Plain Layout
13316 \begin_inset Quotes erd
13320 \begin_inset Quotes erd
13323 ] The default placement for the given class of floats.
13324 The string should be as in standard LaTeX:
13325 \begin_inset Flex Code
13328 \begin_layout Plain Layout
13335 \begin_inset Flex Code
13338 \begin_layout Plain Layout
13345 \begin_inset Flex Code
13348 \begin_layout Plain Layout
13355 \begin_inset Flex Code
13358 \begin_layout Plain Layout
13364 for top, bottom, page, and here, respectively.
13368 \begin_layout Plain Layout
13369 Note that the order of these letters in the string is irrelevant, like in
13375 On top of that there is a new type,
13376 \begin_inset Flex Code
13379 \begin_layout Plain Layout
13385 , which does not really correspond to a float, since it means: put it
13386 \begin_inset Quotes eld
13390 \begin_inset Quotes erd
13394 Note however that the
13395 \begin_inset Flex Code
13398 \begin_layout Plain Layout
13404 specifier is special and, because of implementation details, cannot be
13405 used in non-built in float types.
13406 If you do not understand what this means, just use
13407 \begin_inset Quotes eld
13411 \begin_inset Flex Code
13414 \begin_layout Plain Layout
13421 \begin_inset Quotes erd
13427 \begin_layout Description
13428 \begin_inset Flex Code
13431 \begin_layout Plain Layout
13438 \begin_inset Flex Code
13441 \begin_layout Plain Layout
13447 ] The prefix to use when creating labels referring to floats of this type.
13448 This allows the use of formatted references.
13449 Note that you can remove any
13450 \begin_inset Flex Code
13453 \begin_layout Plain Layout
13459 set by a copied style by using the special value
13460 \begin_inset Quotes eld
13464 \begin_inset Quotes erd
13467 , which must be all caps.
13470 \begin_layout Description
13471 \begin_inset Flex Code
13474 \begin_layout Plain Layout
13481 \begin_inset Flex Code
13484 \begin_layout Plain Layout
13491 \begin_inset Quotes erd
13495 \begin_inset Quotes erd
13498 ] The style used when defining the float using
13499 \begin_inset Flex Code
13502 \begin_layout Plain Layout
13513 \begin_layout Description
13514 \begin_inset Flex Code
13517 \begin_layout Plain Layout
13524 \begin_inset Flex Code
13527 \begin_layout Plain Layout
13534 \begin_inset Quotes erd
13538 \begin_inset Quotes erd
13542 \begin_inset Quotes eld
13546 \begin_inset Quotes erd
13549 of the new class of floats, like program or algorithm.
13550 After the appropriate
13551 \begin_inset Flex Code
13554 \begin_layout Plain Layout
13563 \begin_inset Flex Code
13566 \begin_layout Plain Layout
13575 \begin_inset Flex Code
13578 \begin_layout Plain Layout
13589 \begin_layout Standard
13590 Note that defining a float with type
13591 \begin_inset Flex Code
13594 \begin_layout Plain Layout
13602 automatically defines the corresponding counter with name
13603 \begin_inset Flex Code
13606 \begin_layout Plain Layout
13617 \begin_layout Subsection
13618 Flex insets and InsetLayout
13619 \begin_inset CommandInset label
13621 name "sub:Flex-insets-and"
13628 \begin_layout Standard
13629 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13630 these are called Flex insets.
13634 \begin_layout Standard
13635 Flex insets come in three different kinds:
13638 \begin_layout Itemize
13640 \begin_inset Flex Code
13643 \begin_layout Plain Layout
13649 ): These define semantic markup corresponding to such LaTeX commands as
13651 \begin_inset Flex Code
13654 \begin_layout Plain Layout
13663 \begin_inset Flex Code
13666 \begin_layout Plain Layout
13677 \begin_layout Itemize
13679 \begin_inset Flex Code
13682 \begin_layout Plain Layout
13688 ): These can be used to define custom collapsible insets, similar to TeX
13689 code, footnote, and the like.
13690 An obvious example is an endnote inset, which is defined in the
13691 \begin_inset Flex Code
13694 \begin_layout Plain Layout
13703 \begin_layout Itemize
13705 \begin_inset Flex Code
13708 \begin_layout Plain Layout
13714 ): For use with DocBook classes.
13717 \begin_layout Standard
13718 Flex insets are defined using the
13719 \begin_inset Flex Code
13722 \begin_layout Plain Layout
13728 tag, which shall be explained in a moment.
13731 \begin_layout Standard
13733 \begin_inset Flex Code
13736 \begin_layout Plain Layout
13742 tag also serves another function: It can be used to customize the general
13743 layout of many different types of insets.
13745 \begin_inset Flex Code
13748 \begin_layout Plain Layout
13754 can be used to customize the layout parameters for footnotes, marginal
13755 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13756 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13757 define Flex insets.
13760 \begin_layout Standard
13762 \begin_inset Flex Code
13765 \begin_layout Plain Layout
13771 definition must begin with a line of the form:
13774 \begin_layout LyX-Code
13778 \begin_layout Standard
13780 \begin_inset Flex Code
13783 \begin_layout Plain Layout
13789 indicates the inset whose layout is being defined, and here there are two
13793 \begin_layout Enumerate
13794 The layout for a pre-existing inset is being modified.
13795 In this case, can be
13796 \begin_inset Flex Code
13799 \begin_layout Plain Layout
13805 any one of the following:
13806 \begin_inset Flex Code
13809 \begin_layout Plain Layout
13816 \begin_inset Flex Code
13819 \begin_layout Plain Layout
13826 \begin_inset Flex Code
13829 \begin_layout Plain Layout
13836 \begin_inset Flex Code
13839 \begin_layout Plain Layout
13846 \begin_inset Flex Code
13849 \begin_layout Plain Layout
13856 \begin_inset Flex Code
13859 \begin_layout Plain Layout
13866 \begin_inset Flex Code
13869 \begin_layout Plain Layout
13876 \begin_inset Flex Code
13879 \begin_layout Plain Layout
13886 \begin_inset Flex Code
13889 \begin_layout Plain Layout
13896 \begin_inset Flex Code
13899 \begin_layout Plain Layout
13906 \begin_inset Flex Code
13909 \begin_layout Plain Layout
13916 \begin_inset Flex Code
13919 \begin_layout Plain Layout
13926 \begin_inset Flex Code
13929 \begin_layout Plain Layout
13936 \begin_inset Flex Code
13939 \begin_layout Plain Layout
13946 \begin_inset Flex Code
13949 \begin_layout Plain Layout
13956 \begin_inset Flex Code
13959 \begin_layout Plain Layout
13966 \begin_inset Flex Code
13969 \begin_layout Plain Layout
13976 \begin_inset Flex Code
13979 \begin_layout Plain Layout
13986 \begin_inset Flex Code
13989 \begin_layout Plain Layout
13996 \begin_inset Flex Code
13999 \begin_layout Plain Layout
14008 \begin_layout Enumerate
14009 The layout for a Flex inset is being defined.
14011 \begin_inset Flex Code
14014 \begin_layout Plain Layout
14020 may be be any valid identifier not used by a pre-existing inset.
14021 The identifier may include spaces, but in that case the whole thing must
14022 be wrapped in quotes.
14023 It may also include a namespace identifier, preceding a colon, such as
14025 \begin_inset Quotes eld
14029 \begin_inset Flex Code
14032 \begin_layout Plain Layout
14039 \begin_inset Quotes erd
14043 Note that the definition of a flex inset
14048 \begin_inset Flex Code
14051 \begin_layout Plain Layout
14057 entry, declaring which type of inset it defines.
14060 \begin_layout Standard
14062 \begin_inset Flex Code
14065 \begin_layout Plain Layout
14071 definition can contain the following entries:
14074 \begin_layout Description
14075 \begin_inset Flex Code
14078 \begin_layout Plain Layout
14084 The color for the inset's background.
14085 The valid colors are defined in
14086 \begin_inset Flex Code
14089 \begin_layout Plain Layout
14098 \begin_layout Description
14099 \begin_inset Flex Code
14102 \begin_layout Plain Layout
14109 \begin_inset Flex Code
14112 \begin_layout Plain Layout
14121 \begin_inset Flex Code
14124 \begin_layout Plain Layout
14130 ] Whether to use the content of the inset as the label, when the inset is
14135 \begin_layout Description
14136 \begin_inset Flex Code
14139 \begin_layout Plain Layout
14145 As with paragraph styles (see page
14146 \begin_inset CommandInset ref
14148 reference "des:CopyStyle"
14155 \begin_layout Description
14156 \begin_inset Flex Code
14159 \begin_layout Plain Layout
14166 \begin_inset Flex Code
14169 \begin_layout Plain Layout
14178 \begin_inset Flex Code
14181 \begin_layout Plain Layout
14187 ] Indicates whether the user may employ the Paragraph Settings dialog to
14188 customize the paragraph.
14191 \begin_layout Description
14192 \begin_inset Flex Code
14195 \begin_layout Plain Layout
14202 \begin_inset Flex Code
14205 \begin_layout Plain Layout
14212 \begin_inset Flex Code
14215 \begin_layout Plain Layout
14222 \begin_inset Flex Code
14225 \begin_layout Plain Layout
14231 , describing the rendering style used for the inset's frame and buttons.
14232 Footnotes generally use
14233 \begin_inset Flex Code
14236 \begin_layout Plain Layout
14242 , ERT insets generally
14243 \begin_inset Flex Code
14246 \begin_layout Plain Layout
14252 , and character styles
14253 \begin_inset Flex Code
14256 \begin_layout Plain Layout
14265 \begin_layout Description
14266 \begin_inset Flex Code
14269 \begin_layout Plain Layout
14275 Required at the end of the InsetLayout declarations.
14278 \begin_layout Description
14279 \begin_inset Flex Code
14282 \begin_layout Plain Layout
14288 The font used for both the text body
14294 \begin_inset space ~
14298 \begin_inset CommandInset ref
14300 reference "sub:Font-description"
14305 Note that defining this font automatically defines the
14306 \begin_inset Flex Code
14309 \begin_layout Plain Layout
14315 to the same value, so define this first and define
14316 \begin_inset Flex Code
14319 \begin_layout Plain Layout
14325 later if you want them to be different.
14328 \begin_layout Description
14329 \begin_inset Flex Code
14332 \begin_layout Plain Layout
14339 \begin_inset Quotes eld
14343 \begin_inset Quotes erd
14346 language, leading to Left-to-Right (latin) output, e.
14347 \begin_inset space \thinspace{}
14351 \begin_inset space \space{}
14354 in TeX code or URL.
14358 \begin_layout Description
14359 \begin_inset Flex Code
14362 \begin_layout Plain Layout
14369 \begin_inset Flex Code
14372 \begin_layout Plain Layout
14381 \begin_inset Flex Code
14384 \begin_layout Plain Layout
14390 ] Indicates whether the PlainLayout should be used or, instead, the user
14391 can change the paragraph style used in the inset.
14395 \begin_layout Description
14396 \begin_inset Flex Code
14399 \begin_layout Plain Layout
14405 As with paragraph styles (see page
14406 \begin_inset CommandInset ref
14407 LatexCommand pageref
14408 reference "des:FreeSpacing"
14416 \begin_layout Description
14417 \begin_inset Flex Code
14420 \begin_layout Plain Layout
14426 These tags control XHTML output.
14428 \begin_inset CommandInset ref
14430 reference "sec:Tags-for-XHTML"
14437 \begin_layout Description
14438 \begin_inset Flex Code
14441 \begin_layout Plain Layout
14448 \begin_inset Flex Code
14451 \begin_layout Plain Layout
14460 \begin_inset Flex Code
14463 \begin_layout Plain Layout
14469 ] Whether to include the contents of this inset in the strings generated
14470 for the `Outline' pane.
14471 One would not, for example, want the content of a footnote in a section
14472 header to be included in the TOC displayed in the outline, but one would
14473 normally want the content of a character style displayed.
14474 Default is false: not to include.
14477 \begin_layout Description
14478 \begin_inset Flex Code
14481 \begin_layout Plain Layout
14487 As with paragraph styles (see page
14488 \begin_inset CommandInset ref
14489 LatexCommand pageref
14490 reference "des:KeepEmpty"
14498 \begin_layout Description
14499 \begin_inset Flex Code
14502 \begin_layout Plain Layout
14508 The font used for the label.
14510 \begin_inset space ~
14514 \begin_inset CommandInset ref
14516 reference "sub:Font-description"
14521 Note that this definition can never appear before
14522 \begin_inset Flex Code
14525 \begin_layout Plain Layout
14531 , lest it be ineffective.
14534 \begin_layout Description
14535 \begin_inset Flex Code
14538 \begin_layout Plain Layout
14544 What will be displayed on the button or elsewhere as the inset label.
14545 Some inset types (TeX code and Branch) modify this label on the fly.
14548 \begin_layout Description
14549 \begin_inset Flex Code
14552 \begin_layout Plain Layout
14558 The name of the corresponding LaTeX stuff.
14559 Either the environment or command name.
14562 \begin_layout Description
14563 \begin_inset Flex Code
14566 \begin_layout Plain Layout
14572 The optional parameter for the corresponding
14573 \begin_inset Flex Code
14576 \begin_layout Plain Layout
14582 stuff, including possible bracket pairs like
14583 \begin_inset Flex Code
14586 \begin_layout Plain Layout
14593 This parameter cannot be changed from within LyX.
14596 \begin_layout Description
14597 \begin_inset Flex Code
14600 \begin_layout Plain Layout
14606 As with paragraph styles (see page
14607 \begin_inset CommandInset ref
14608 LatexCommand pageref
14609 reference "des:LatexType"
14616 \begin_layout Description
14617 \begin_inset Flex Code
14620 \begin_layout Plain Layout
14627 \begin_inset Flex Code
14630 \begin_layout Plain Layout
14637 \begin_inset Flex Code
14640 \begin_layout Plain Layout
14647 \begin_inset Flex Code
14650 \begin_layout Plain Layout
14657 \begin_inset Flex Code
14660 \begin_layout Plain Layout
14666 (indicating a dummy definition ending definitions of charstyles, etc).
14667 This entry is required in and is only meaningful for Flex insets.
14668 Among other things, it determines on which menu this inset will appear.
14670 \begin_inset Flex Code
14673 \begin_layout Plain Layout
14680 \begin_inset Flex Code
14683 \begin_layout Plain Layout
14690 \begin_inset Flex Code
14693 \begin_layout Plain Layout
14701 \begin_inset Flex Code
14704 \begin_layout Plain Layout
14710 can be set to true for charstyle insets, if you wish, by setting it
14715 \begin_inset Flex Code
14718 \begin_layout Plain Layout
14727 \begin_layout Description
14728 \begin_inset Flex Code
14731 \begin_layout Plain Layout
14738 \begin_inset Flex Code
14741 \begin_layout Plain Layout
14750 \begin_inset Flex Code
14753 \begin_layout Plain Layout
14759 ] Whether multiple paragraphs are permitted in this inset.
14761 \begin_inset Flex Code
14764 \begin_layout Plain Layout
14770 to the same value and
14771 \begin_inset Flex Code
14774 \begin_layout Plain Layout
14780 to the opposite value.
14781 These can be reset to other values, if they are used
14786 \begin_inset Flex Code
14789 \begin_layout Plain Layout
14799 \begin_layout Description
14800 \begin_inset Flex Code
14803 \begin_layout Plain Layout
14810 \begin_inset Flex Code
14813 \begin_layout Plain Layout
14822 \begin_inset Flex Code
14825 \begin_layout Plain Layout
14831 ] Whether fragile commands in this layout should be
14832 \begin_inset Flex Code
14835 \begin_layout Plain Layout
14848 whether the command should itself be protected.) Default is false.
14851 \begin_layout Description
14852 \begin_inset Flex Code
14855 \begin_layout Plain Layout
14862 \begin_inset Flex Code
14865 \begin_layout Plain Layout
14874 \begin_inset Flex Code
14877 \begin_layout Plain Layout
14883 ] As with paragraph styles (see page
14884 \begin_inset CommandInset ref
14885 LatexCommand pageref
14886 reference "des:ParbreakIsNewline"
14894 \begin_layout Description
14895 \begin_inset Flex Code
14898 \begin_layout Plain Layout
14905 \begin_inset Flex Code
14908 \begin_layout Plain Layout
14917 \begin_inset Flex Code
14920 \begin_layout Plain Layout
14926 ] As with paragraph styles (see page
14927 \begin_inset CommandInset ref
14928 LatexCommand pageref
14929 reference "des:PassThru"
14937 \begin_layout Description
14938 \begin_inset Flex Code
14941 \begin_layout Plain Layout
14947 As with paragraph styles (see page
14948 \begin_inset CommandInset ref
14949 LatexCommand pageref
14950 reference "des:Preamble"
14957 \begin_layout Description
14958 \begin_inset Flex Code
14961 \begin_layout Plain Layout
14968 \begin_inset Flex Code
14971 \begin_layout Plain Layout
14977 ] The prefix to use when creating labels referring to insets of this type.
14978 This allows the use of formatted references.
14981 \begin_layout Description
14982 \begin_inset Flex Code
14985 \begin_layout Plain Layout
14992 \begin_inset Flex Code
14995 \begin_layout Plain Layout
15001 ] As with paragraph styles (see page
15002 \begin_inset CommandInset ref
15003 LatexCommand pageref
15004 reference "des:Requires"
15011 \begin_layout Description
15012 \begin_inset Flex Code
15015 \begin_layout Plain Layout
15022 \begin_inset Flex Code
15025 \begin_layout Plain Layout
15032 \begin_inset Flex Code
15035 \begin_layout Plain Layout
15043 ] Whether this inset should use the font of its surrounding environment
15045 Default is true: uses its own.
15048 \begin_layout Description
15049 \begin_inset Flex Code
15052 \begin_layout Plain Layout
15059 \begin_inset Flex Code
15062 \begin_layout Plain Layout
15069 \begin_inset Flex Code
15072 \begin_layout Plain Layout
15080 ] Spellcheck the contents of this inset.
15084 \begin_layout Subsection
15086 \begin_inset CommandInset label
15088 name "sub:Counters"
15095 \begin_layout Standard
15096 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15098 \begin_inset Flex MenuItem
15101 \begin_layout Plain Layout
15108 \begin_inset Flex MenuItem
15111 \begin_layout Plain Layout
15117 , \SpecialChar \ldots{}
15118 ) in the text class itself.
15119 The standard counters are defined in the file
15120 \begin_inset Flex Code
15123 \begin_layout Plain Layout
15129 , so you may have to do no more than add
15132 \begin_layout LyX-Code
15133 Input stdcounters.inc
15136 \begin_layout Standard
15137 to your layout file to get them to work.
15138 But if you want to define custom counters, then you can do so.
15139 The counter declaration must begin with:
15142 \begin_layout LyX-Code
15143 Counter CounterName
15146 \begin_layout Standard
15148 \begin_inset Flex Code
15151 \begin_layout Plain Layout
15157 ' is replaced by the name of the counter.
15158 And it must end with
15159 \begin_inset Quotes eld
15163 \begin_inset Flex Code
15166 \begin_layout Plain Layout
15173 \begin_inset Quotes erd
15177 The following parameters can also be used:
15180 \begin_layout Description
15181 \begin_inset Flex Code
15184 \begin_layout Plain Layout
15191 \begin_inset Flex Code
15194 \begin_layout Plain Layout
15201 \begin_inset Quotes erd
15205 \begin_inset Quotes erd
15208 ] When defined, this string defines how the counter is displayed.
15209 Setting this value sets
15210 \begin_inset Flex Code
15213 \begin_layout Plain Layout
15214 LabelStringAppendix
15220 The following special constructs can be used in the string:
15224 \begin_layout Itemize
15225 \begin_inset Flex Code
15228 \begin_layout Plain Layout
15236 will be replaced by the expansion of the
15237 \begin_inset Flex Code
15240 \begin_layout Plain Layout
15247 \begin_inset Flex Code
15250 \begin_layout Plain Layout
15251 LabelStringAppendix
15257 \begin_inset Flex Code
15260 \begin_layout Plain Layout
15270 \begin_layout Itemize
15271 counter values can be expressed using LaTeX-like macros
15272 \begin_inset Flex Code
15275 \begin_layout Plain Layout
15292 \begin_inset Flex Code
15295 \begin_layout Plain Layout
15307 \begin_layout Plain Layout
15317 Actually, the situation is a bit more complicated: any
15336 other than those described below will produce arabic numerals.
15337 It would not be surprising to see this change in the future.
15343 \begin_inset Flex Code
15346 \begin_layout Plain Layout
15352 : 1, 2, 3,\SpecialChar \ldots{}
15354 \begin_inset Flex Code
15357 \begin_layout Plain Layout
15363 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15365 \begin_inset Flex Code
15368 \begin_layout Plain Layout
15374 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15376 \begin_inset Flex Code
15379 \begin_layout Plain Layout
15385 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15387 \begin_inset Flex Code
15390 \begin_layout Plain Layout
15396 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15398 \begin_inset Flex Code
15401 \begin_layout Plain Layout
15407 for hebrew numerals.
15411 \begin_layout Standard
15412 If LabelString is not defined, a default value is constructed as follows:
15413 if the counter has a master counter
15414 \begin_inset Flex Code
15417 \begin_layout Plain Layout
15424 \begin_inset Flex Code
15427 \begin_layout Plain Layout
15434 \begin_inset Flex Code
15437 \begin_layout Plain Layout
15447 is used; otherwise the string
15448 \begin_inset Flex Code
15451 \begin_layout Plain Layout
15462 \begin_layout Description
15463 \begin_inset Flex Code
15466 \begin_layout Plain Layout
15467 LabelStringAppendix
15473 \begin_inset Flex Code
15476 \begin_layout Plain Layout
15483 \begin_inset Quotes erd
15487 \begin_inset Quotes erd
15491 \begin_inset Flex Code
15494 \begin_layout Plain Layout
15500 , but for use in the Appendix.
15503 \begin_layout Description
15504 \begin_inset Flex Code
15507 \begin_layout Plain Layout
15514 \begin_inset Flex Code
15517 \begin_layout Plain Layout
15524 \begin_inset Quotes erd
15528 \begin_inset Quotes erd
15531 ] A format for use with formatted references to this counter.
15532 For example, one might want to have references to section numbers appear
15534 \begin_inset Quotes eld
15538 \begin_inset Quotes erd
15542 The string should contain
15543 \begin_inset Quotes eld
15547 \begin_inset Quotes erd
15551 This will be replaced by the counter number itself.
15552 So, for sections, it would be: Section ##.
15555 \begin_layout Description
15556 \begin_inset Flex Code
15559 \begin_layout Plain Layout
15566 \begin_inset Flex Code
15569 \begin_layout Plain Layout
15576 \begin_inset Quotes erd
15580 \begin_inset Quotes erd
15583 ] If this is set to the name of another counter, the present counter will
15584 be reset every time the other one is increased.
15586 \begin_inset Flex Code
15589 \begin_layout Plain Layout
15596 \begin_inset Flex Code
15599 \begin_layout Plain Layout
15608 \begin_layout Subsection
15610 \begin_inset CommandInset label
15612 name "sub:Font-description"
15619 \begin_layout Standard
15620 A font description looks like this:
15623 \begin_layout LyX-Code
15633 \begin_layout LyX-Code
15637 \begin_layout LyX-Code
15641 \begin_layout Standard
15642 The following commands are available:
15645 \begin_layout Description
15646 \begin_inset Flex Code
15649 \begin_layout Plain Layout
15656 \begin_inset Flex Code
15659 \begin_layout Plain Layout
15668 \begin_inset Flex Code
15671 \begin_layout Plain Layout
15678 \begin_inset Flex Code
15681 \begin_layout Plain Layout
15688 \begin_inset Flex Code
15691 \begin_layout Plain Layout
15698 \begin_inset Flex Code
15701 \begin_layout Plain Layout
15708 \begin_inset Flex Code
15711 \begin_layout Plain Layout
15718 \begin_inset Flex Code
15721 \begin_layout Plain Layout
15728 \begin_inset Flex Code
15731 \begin_layout Plain Layout
15738 \begin_inset Flex Code
15741 \begin_layout Plain Layout
15750 \begin_layout Description
15751 \begin_inset Flex Code
15754 \begin_layout Plain Layout
15761 \begin_inset Flex Code
15764 \begin_layout Plain Layout
15773 \begin_inset Flex Code
15776 \begin_layout Plain Layout
15783 \begin_inset Flex Code
15786 \begin_layout Plain Layout
15795 \begin_layout Description
15796 \begin_inset Flex Code
15799 \begin_layout Plain Layout
15806 \begin_inset Flex Code
15809 \begin_layout Plain Layout
15815 ] Valid arguments are:
15816 \begin_inset Flex Code
15819 \begin_layout Plain Layout
15826 \begin_inset Flex Code
15829 \begin_layout Plain Layout
15836 \begin_inset Flex Code
15839 \begin_layout Plain Layout
15846 \begin_inset Flex Code
15849 \begin_layout Plain Layout
15856 \begin_inset Flex Code
15859 \begin_layout Plain Layout
15866 \begin_inset Flex Code
15869 \begin_layout Plain Layout
15876 Each of these turns on or off the corresponding attribute.
15878 \begin_inset Flex Code
15881 \begin_layout Plain Layout
15887 turns on emphasis, and
15888 \begin_inset Flex Code
15891 \begin_layout Plain Layout
15899 \begin_inset Newline newline
15902 If the latter seems puzzling, remember that the font settings for the present
15903 context are generally inherited from the surrounding context.
15905 \begin_inset Flex Code
15908 \begin_layout Plain Layout
15914 would turn off the emphasis that was anyway in effect, say, in a theorem
15918 \begin_layout Description
15919 \begin_inset Flex Code
15922 \begin_layout Plain Layout
15929 \begin_inset Flex Code
15932 \begin_layout Plain Layout
15941 \begin_inset Flex Code
15944 \begin_layout Plain Layout
15953 \begin_layout Description
15954 \begin_inset Flex Code
15957 \begin_layout Plain Layout
15964 \begin_inset Flex Code
15967 \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
16008 \begin_layout Description
16009 \begin_inset Flex Code
16012 \begin_layout Plain Layout
16019 \begin_inset Flex Code
16022 \begin_layout Plain Layout
16029 \begin_inset Flex Code
16032 \begin_layout Plain Layout
16039 \begin_inset Flex Code
16042 \begin_layout Plain Layout
16051 \begin_inset Flex Code
16054 \begin_layout Plain Layout
16061 \begin_inset Flex Code
16064 \begin_layout Plain Layout
16071 \begin_inset Flex Code
16074 \begin_layout Plain Layout
16081 \begin_inset Flex Code
16084 \begin_layout Plain Layout
16091 \begin_inset Flex Code
16094 \begin_layout Plain Layout
16103 \begin_layout Subsection
16104 \begin_inset CommandInset label
16106 name "sub:Citation-format-description"
16110 Citation format description
16113 \begin_layout Standard
16115 \begin_inset Flex Code
16118 \begin_layout Plain Layout
16124 blocks are used to describe how bibliographic information should be displayed,
16125 both within LyX itself (in the citation dialog and in tooltips, for example)
16126 and in XHTML output.
16127 Such a block might look like this:
16130 \begin_layout LyX-Code
16134 \begin_layout LyX-Code
16138 \begin_layout LyX-Code
16142 \begin_layout LyX-Code
16146 \begin_layout Standard
16147 The individual lines define how the bibliographic information associated
16148 with an article or book, respectively, is to be displayed, and such a definitio
16149 n can be given for any `entry type' that might be present in a BibTeX file.
16150 LyX defines a default format in the source code that will be used if no
16151 specific definition has been given.
16152 LyX predefines several formats in the file
16153 \begin_inset Flex Code
16156 \begin_layout Plain Layout
16162 , which is included in most of LyX's document classes.
16165 \begin_layout Standard
16166 The definitions use a simple language that allows BibTeX keys to be replaced
16168 Keys should be enclosed in
16169 \begin_inset Flex Code
16172 \begin_layout Plain Layout
16179 \begin_inset Flex Code
16182 \begin_layout Plain Layout
16189 So a simple definition might look like this:
16192 \begin_layout LyX-Code
16194 \begin_inset Quotes eld
16198 \begin_inset Quotes erd
16204 \begin_layout Standard
16205 This would print the author, followed by a comma, followed by the title,
16206 in quotes, followed by a period.
16209 \begin_layout Standard
16210 Of course, sometimes you may want to print a key only if it exists.
16211 This can be done by using a conditional construction, such as:
16212 \begin_inset Flex Code
16215 \begin_layout Plain Layout
16217 \begin_inset space ~
16227 \begin_inset Flex Code
16230 \begin_layout Plain Layout
16236 key exists, then print
16237 \begin_inset Quotes eld
16241 \begin_inset space ~
16245 \begin_inset Quotes erd
16248 followed by the volume key.
16249 It is also possible to have an else clause in the conditional, such as:
16251 \begin_inset Flex Code
16254 \begin_layout Plain Layout
16255 {%author%[[%author%]][[%editor%, ed.]]}
16262 \begin_inset Flex Code
16265 \begin_layout Plain Layout
16271 key is printed if it exists; otherwise, the editor key is printed, followed
16273 \begin_inset Quotes eld
16277 \begin_inset space ~
16281 \begin_inset Quotes erd
16284 Note that the key is again enclosed in
16285 \begin_inset Flex Code
16288 \begin_layout Plain Layout
16294 signs; the entire conditional is enclosed in braces; and the if and else
16295 clauses are enclosed in double brackets,
16296 \begin_inset Quotes eld
16300 \begin_inset Flex Code
16303 \begin_layout Plain Layout
16310 \begin_inset Quotes eld
16314 \begin_inset Quotes eld
16318 \begin_inset Flex Code
16321 \begin_layout Plain Layout
16328 \begin_inset Quotes erd
16332 There must be no space between any of these.
16335 \begin_layout Standard
16336 There is one other piece of syntax available in definitions, which looks
16338 \begin_inset Flex Code
16341 \begin_layout Plain Layout
16348 This defines a piece of formatting information that is to be used when
16350 \begin_inset Quotes eld
16354 \begin_inset Quotes erd
16358 Obviously, we do not want to output HTML tags when writing plain text,
16359 so they should be wrapped in
16360 \begin_inset Quotes eld
16364 \begin_inset Quotes erd
16368 \begin_inset Quotes eld
16372 \begin_inset Quotes erd
16378 \begin_layout Standard
16379 Two special sorts of definitions are also possible in a
16380 \begin_inset Flex Code
16383 \begin_layout Plain Layout
16390 An example of the first would be:
16393 \begin_layout LyX-Code
16395 \begin_inset Quotes eld
16399 \begin_inset Quotes erd
16405 \begin_layout Standard
16406 This is an abbreviation, or macro, and it can be used by treating it as
16408 \begin_inset Flex Code
16411 \begin_layout Plain Layout
16419 \begin_inset Flex Code
16422 \begin_layout Plain Layout
16428 exactly as it would treat its definition.
16429 So, let us issue the obvious
16437 \begin_layout LyX-Code
16441 \begin_layout Standard
16442 or anything like it.
16443 LyX shouldn't go into an infinite loop, but it may go into a long one before
16447 \begin_layout Standard
16448 The second sort of special definition might look like this:
16451 \begin_layout LyX-Code
16455 \begin_layout Standard
16456 This defines a translatable piece of text, which allows relevant parts of
16457 the bibliography to be translated.
16458 It can be included in a definition by treating it as a key:
16459 \begin_inset Flex Code
16462 \begin_layout Plain Layout
16469 Several of these are predefined in
16470 \begin_inset Flex Code
16473 \begin_layout Plain Layout
16480 Note that these are not macros, in the sense just defined.
16481 They will not be expanded.
16484 \begin_layout Standard
16485 So here then is an example that use all these features:
16488 \begin_layout LyX-Code
16489 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16492 \begin_layout Standard
16493 This defines a macro that prints the author, followed by a comma, if the
16495 \begin_inset Flex Code
16498 \begin_layout Plain Layout
16504 key is defined, or else prints the name of the editor, followed by the
16506 \begin_inset Flex Code
16509 \begin_layout Plain Layout
16515 or its translation (it is by default
16516 \begin_inset Quotes eld
16520 \begin_inset Quotes erd
16524 \begin_inset Flex Code
16527 \begin_layout Plain Layout
16534 Note that this is in fact defined in
16535 \begin_inset Flex Code
16538 \begin_layout Plain Layout
16544 , so you can use it in your own definitions, or re-definitions, if you load
16548 \begin_layout Section
16549 \begin_inset CommandInset label
16551 name "sec:Tags-for-XHTML"
16555 Tags for XHTML output
16558 \begin_layout Standard
16559 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16560 by layout information.
16561 In general, LyX provides sensible defaults and, as mentioned earlier, it
16562 will even construct default CSS style rules from the other layout tags.
16563 For example, LyX will attempt to use the information provided in the
16564 \begin_inset Flex Code
16567 \begin_layout Plain Layout
16573 declaration for the Chapter style to write CSS that will appropriately
16574 format chapter headings.
16577 \begin_layout Standard
16578 In many cases, then, you may not have to do anything at all to get acceptable
16579 XHTML output for your own environments, custom insets, and so forth.
16580 But in some cases you will, and so LyX provides a number of layout tags
16581 that can be used to customize the XHTML and CSS that are generated.
16584 \begin_layout Standard
16585 Note that there are two tags,
16586 \begin_inset Flex Code
16589 \begin_layout Plain Layout
16596 \begin_inset Flex Code
16599 \begin_layout Plain Layout
16605 that may appear outside style and inset declarations.
16607 \begin_inset CommandInset ref
16609 reference "sub:General-text-class"
16613 for details on these.
16616 \begin_layout Subsection
16617 \begin_inset CommandInset label
16619 name "sub:Paragraph-Style-XHTML"
16626 \begin_layout Standard
16627 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16628 dealing with a normal paragraph, a command, or an environment, where this
16629 is itself determined by the contents of the corresponding
16630 \begin_inset Flex Code
16633 \begin_layout Plain Layout
16643 \begin_layout Standard
16644 For a command or normal paragraph, the output XHTML has the following form:
16647 \begin_layout LyX-Code
16649 \begin_inset Quotes erd
16653 \begin_inset Quotes erd
16659 \begin_layout LyX-Code
16661 \begin_inset Quotes erd
16665 \begin_inset Quotes erd
16671 \begin_layout LyX-Code
16672 Contents of the paragraph.
16675 \begin_layout LyX-Code
16679 \begin_layout Standard
16680 The label tags are of course omitted if the paragraph does not have a label.
16683 \begin_layout Standard
16684 For an environment that is not some sort of list, the XHTML takes this form:
16687 \begin_layout LyX-Code
16689 \begin_inset Quotes erd
16693 \begin_inset Quotes erd
16699 \begin_layout LyX-Code
16701 \begin_inset Quotes erd
16705 \begin_inset Quotes erd
16709 \begin_inset Quotes erd
16713 \begin_inset Quotes erd
16716 >Environment Label</labeltag>First paragraph.</itemtag>
16719 \begin_layout LyX-Code
16720 <itemtag>Second paragraph.</itemtag>
16723 \begin_layout LyX-Code
16727 \begin_layout Standard
16728 Note that the label is output only for the first paragraph, as it should
16729 be for a theorem, for example.
16733 \begin_layout Standard
16734 For a list, we have one of these forms:
16737 \begin_layout LyX-Code
16739 \begin_inset Quotes erd
16743 \begin_inset Quotes erd
16749 \begin_layout LyX-Code
16751 \begin_inset Quotes erd
16755 \begin_inset Quotes erd
16759 \begin_inset Quotes erd
16763 \begin_inset Quotes erd
16766 >List Label</labeltag>First item.</itemtag>
16769 \begin_layout LyX-Code
16771 \begin_inset Quotes erd
16775 \begin_inset Quotes erd
16779 \begin_inset Quotes erd
16783 \begin_inset Quotes erd
16786 >List Label</labeltag>Second item.</itemtag>
16789 \begin_layout LyX-Code
16793 \begin_layout LyX-Code
16797 \begin_layout LyX-Code
16799 \begin_inset Quotes erd
16803 \begin_inset Quotes erd
16809 \begin_layout LyX-Code
16811 \begin_inset Quotes erd
16815 \begin_inset Quotes erd
16818 >List Label</labeltag><itemtag attr=
16819 \begin_inset Quotes erd
16823 \begin_inset Quotes erd
16826 >First item.</itemtag>
16829 \begin_layout LyX-Code
16831 \begin_inset Quotes erd
16835 \begin_inset Quotes erd
16838 >List Label</labeltag><itemtag attr=
16839 \begin_inset Quotes erd
16843 \begin_inset Quotes erd
16846 >Second item.</itemtag>
16849 \begin_layout LyX-Code
16853 \begin_layout Standard
16854 Note the different orders of
16855 \begin_inset Flex Code
16858 \begin_layout Plain Layout
16865 \begin_inset Flex Code
16868 \begin_layout Plain Layout
16875 Which order we get depends upon the setting of
16876 \begin_inset Flex Code
16879 \begin_layout Plain Layout
16886 \begin_inset Flex Code
16889 \begin_layout Plain Layout
16895 is false (the default), you get the first of these, with the label within
16896 the item; if true, you get the second, with the label outside the item.
16899 \begin_layout Standard
16900 The specific tags and attributes output for each paragraph type can be controlle
16901 d by means of the layout tags we are about to describe.
16902 As mentioned earlier, however, LyX uses sensible defaults for many of these,
16903 so you often may not need to do very much to get good XHTML output.
16904 Think of the available tags as there so you can tweak things to your liking.
16907 \begin_layout Description
16908 \begin_inset Flex Code
16911 \begin_layout Plain Layout
16918 \begin_inset Flex Code
16921 \begin_layout Plain Layout
16927 ] Specifies attribute information to be output with the main tag.
16929 \begin_inset Quotes eld
16933 \begin_inset Flex Code
16936 \begin_layout Plain Layout
16943 \begin_inset Quotes erd
16947 By default, LyX will output
16948 \begin_inset Quotes eld
16952 \begin_inset Flex Code
16955 \begin_layout Plain Layout
16962 \begin_inset Quotes erd
16966 \begin_inset Flex Code
16969 \begin_layout Plain Layout
16975 is the LyX name of the layout, made lowercase, for example: chapter.
16980 contain any style information.
16982 \begin_inset Flex Code
16985 \begin_layout Plain Layout
16994 \begin_layout Description
16995 \begin_inset Flex Code
16998 \begin_layout Plain Layout
17005 \begin_inset Flex Code
17008 \begin_layout Plain Layout
17018 ] Whether to output the default CSS information LyX generates for this layout,
17019 even if additional information is explicitly provided via
17020 \begin_inset Flex Code
17023 \begin_layout Plain Layout
17031 \begin_inset Flex Code
17034 \begin_layout Plain Layout
17040 allows you to alter or augment the generated CSS, rather than to override
17043 \begin_inset Flex Code
17046 \begin_layout Plain Layout
17055 \begin_layout Description
17056 \begin_inset Flex Code
17059 \begin_layout Plain Layout
17066 \begin_inset Flex Code
17069 \begin_layout Plain Layout
17075 ] The tag to be used for individual paragraphs of environments, replacing
17077 \begin_inset Flex Code
17080 \begin_layout Plain Layout
17086 in the examples above.
17088 \begin_inset Flex Code
17091 \begin_layout Plain Layout
17100 \begin_layout Description
17101 \begin_inset Flex Code
17104 \begin_layout Plain Layout
17111 \begin_inset Flex Code
17114 \begin_layout Plain Layout
17120 ] Attributes for the item tag.
17122 \begin_inset Quotes eld
17126 \begin_inset Flex Code
17129 \begin_layout Plain Layout
17130 class=`layoutname_item'
17136 \begin_inset Quotes erd
17144 contain any style information.
17146 \begin_inset Flex Code
17149 \begin_layout Plain Layout
17158 \begin_layout Description
17159 \begin_inset Flex Code
17162 \begin_layout Plain Layout
17169 \begin_inset Flex Code
17172 \begin_layout Plain Layout
17178 ] The tag to be used for paragraph and item labels, replacing
17179 \begin_inset Flex Code
17182 \begin_layout Plain Layout
17188 in the examples above.
17190 \begin_inset Flex Code
17193 \begin_layout Plain Layout
17200 \begin_inset Flex Code
17203 \begin_layout Plain Layout
17210 \begin_inset Flex Code
17213 \begin_layout Plain Layout
17220 \begin_inset Flex Code
17223 \begin_layout Plain Layout
17224 Centered_Top_Environment
17229 , in which case it defaults to
17230 \begin_inset Flex Code
17233 \begin_layout Plain Layout
17242 \begin_layout Description
17243 \begin_inset Flex Code
17246 \begin_layout Plain Layout
17253 \begin_inset Flex Code
17256 \begin_layout Plain Layout
17262 ] Attributes for the label tag.
17264 \begin_inset Quotes eld
17268 \begin_inset Flex Code
17271 \begin_layout Plain Layout
17272 class=`layoutname_label'
17278 \begin_inset Quotes erd
17286 contain any style information.
17288 \begin_inset Flex Code
17291 \begin_layout Plain Layout
17300 \begin_layout Description
17301 \begin_inset Flex Code
17304 \begin_layout Plain Layout
17311 \begin_inset Flex Code
17314 \begin_layout Plain Layout
17324 ] Meaningful only for list-like environments, this tag controls whether
17325 the label tag is output before or inside the item tag.
17326 This is used, for example, in the description environment, where we want
17328 \begin_inset Flex Code
17331 \begin_layout Plain Layout
17332 <dt>\SpecialChar \ldots{}
17333 </dt><dd>\SpecialChar \ldots{}
17341 \begin_inset Flex Code
17344 \begin_layout Plain Layout
17350 : The label tag is output inside the item tag.
17353 \begin_layout Description
17354 \begin_inset Flex Code
17357 \begin_layout Plain Layout
17363 Information to be output in the
17364 \begin_inset Flex Code
17367 \begin_layout Plain Layout
17373 section when this style is used.
17374 This might, for example, be used to include a
17375 \begin_inset Flex Code
17378 \begin_layout Plain Layout
17385 \begin_inset Flex Code
17388 \begin_layout Plain Layout
17397 \begin_layout Description
17398 \begin_inset Flex Code
17401 \begin_layout Plain Layout
17407 CSS style information to be included when this style is used.
17408 Note that this will automatically be wrapped in a layout-generated
17409 \begin_inset Flex Code
17412 \begin_layout Plain Layout
17418 block, so only the CSS itself need be included.
17421 \begin_layout Description
17422 \begin_inset Flex Code
17425 \begin_layout Plain Layout
17432 \begin_inset Flex Code
17435 \begin_layout Plain Layout
17441 ] The tag to be used for the main label, replacing
17442 \begin_inset Flex Code
17445 \begin_layout Plain Layout
17451 in the examples above.
17453 \begin_inset Flex Code
17456 \begin_layout Plain Layout
17465 \begin_layout Description
17466 \begin_inset Flex Code
17469 \begin_layout Plain Layout
17476 \begin_inset Flex Code
17479 \begin_layout Plain Layout
17489 ] Marks this style as the one to be used to generate the
17490 \begin_inset Flex Code
17493 \begin_layout Plain Layout
17499 tag for the XHTML file.
17500 By default, it is false.
17502 \begin_inset Flex Code
17505 \begin_layout Plain Layout
17511 file sets it to true for the
17512 \begin_inset Flex Code
17515 \begin_layout Plain Layout
17525 \begin_layout Subsection
17529 \begin_layout Standard
17530 The XHTML output of insets can also be controlled by information in layout
17535 \begin_layout Plain Layout
17536 At present, this is true only for
17537 \begin_inset Quotes eld
17541 \begin_inset Quotes erd
17544 insets (insets you can type into) and is not true for
17545 \begin_inset Quotes eld
17549 \begin_inset Quotes erd
17552 insets (insets that are associated with dialog boxes).
17557 Here, too, LyX tries to provide sensible defaults, and it constructs default
17559 But everything can be customized.
17562 \begin_layout Standard
17563 The XHTML LyX outputs for an inset has the following form:
17566 \begin_layout LyX-Code
17568 \begin_inset Quotes erd
17572 \begin_inset Quotes erd
17578 \begin_layout LyX-Code
17579 <labeltag>Label</labeltag>
17582 \begin_layout LyX-Code
17584 \begin_inset Quotes erd
17588 \begin_inset Quotes erd
17591 >Contents of the inset.</innertag>
17594 \begin_layout LyX-Code
17598 \begin_layout Standard
17599 If the inset permits multiple paragraphs---that is, if
17600 \begin_inset Flex Code
17603 \begin_layout Plain Layout
17609 is true---then the contents of the inset will itself be output as paragraphs
17610 formatted according to the styles used for those paragraphs (standard,
17611 quote, and the like).
17612 The label tag is of course omitted if the paragraph does not have a label
17613 and, at present, is always
17614 \begin_inset Flex Code
17617 \begin_layout Plain Layout
17624 The inner tag is optional and, by default, does not appear.
17627 \begin_layout Standard
17628 The specific tags and attributes output for each inset can be controlled
17629 by means of the following layout tags.
17632 \begin_layout Description
17633 \begin_inset Flex Code
17636 \begin_layout Plain Layout
17643 \begin_inset Flex Code
17646 \begin_layout Plain Layout
17652 ] Specifies attribute information to be output with the main tag.
17654 \begin_inset Quotes eld
17658 \begin_inset Flex Code
17661 \begin_layout Plain Layout
17662 class=`myinset' onclick=`\SpecialChar \ldots{}
17669 \begin_inset Quotes erd
17673 By default, LyX will output
17674 \begin_inset Quotes eld
17678 \begin_inset Flex Code
17681 \begin_layout Plain Layout
17688 \begin_inset Quotes erd
17692 \begin_inset Flex Code
17695 \begin_layout Plain Layout
17701 is the LyX name of the inset, made lowercase and with non-alphanumeric
17702 characters converted to underscores, for example: footnote.
17705 \begin_layout Description
17706 \begin_inset Flex Code
17709 \begin_layout Plain Layout
17716 \begin_inset Flex Code
17719 \begin_layout Plain Layout
17729 ] Whether to output the default CSS information LyX generates for this layout,
17730 even if additional information is explicitly provided via
17731 \begin_inset Flex Code
17734 \begin_layout Plain Layout
17742 \begin_inset Flex Code
17745 \begin_layout Plain Layout
17751 allows you to alter or augment the generated CSS, rather than to override
17756 \begin_layout Description
17757 \begin_inset Flex Code
17760 \begin_layout Plain Layout
17767 \begin_inset Flex Code
17770 \begin_layout Plain Layout
17776 ] Attributes for the inner tag.
17778 \begin_inset Quotes eld
17782 \begin_inset Flex Code
17785 \begin_layout Plain Layout
17786 class=`insetname_inner'
17792 \begin_inset Quotes erd
17798 \begin_layout Description
17799 \begin_inset Flex Code
17802 \begin_layout Plain Layout
17809 \begin_inset Flex Code
17812 \begin_layout Plain Layout
17818 ] The inner tag, replacing
17819 \begin_inset Flex Code
17822 \begin_layout Plain Layout
17828 in the examples above.
17829 By default, there is none.
17832 \begin_layout Description
17833 \begin_inset Flex Code
17836 \begin_layout Plain Layout
17843 \begin_inset Flex Code
17846 \begin_layout Plain Layout
17854 ] Whether this inset represents a standalone block of text (such as a footnote)
17855 or instead represents material that is included in the surrounding text
17856 (such as a branch).
17860 \begin_layout Description
17861 \begin_inset Flex Code
17864 \begin_layout Plain Layout
17871 \begin_inset Flex Code
17874 \begin_layout Plain Layout
17880 ] A label for this inset, possibly including a reference to a counter.
17881 For example, for footnote, it might be:
17882 \begin_inset Flex Code
17885 \begin_layout Plain Layout
17894 This is optional, and there is no default.
17897 \begin_layout Description
17898 \begin_inset Flex Code
17901 \begin_layout Plain Layout
17907 Information to be output in the
17908 \begin_inset Flex Code
17911 \begin_layout Plain Layout
17917 section when this style is used.
17918 This might, for example, be used to include a
17919 \begin_inset Flex Code
17922 \begin_layout Plain Layout
17929 \begin_inset Flex Code
17932 \begin_layout Plain Layout
17941 \begin_layout Description
17942 \begin_inset Flex Code
17945 \begin_layout Plain Layout
17951 CSS style information to be included when this style is used.
17952 Note that this will automatically be wrapped in a layout-generated
17953 \begin_inset Flex Code
17956 \begin_layout Plain Layout
17962 block, so only the CSS itself need be included.
17965 \begin_layout Description
17966 \begin_inset Flex Code
17969 \begin_layout Plain Layout
17976 \begin_inset Flex Code
17979 \begin_layout Plain Layout
17985 ] The tag to be used for the main label, replacing
17986 \begin_inset Flex Code
17989 \begin_layout Plain Layout
17995 in the examples above.
17996 The default depends upon the setting of
17997 \begin_inset Flex Code
18000 \begin_layout Plain Layout
18007 \begin_inset Flex Code
18010 \begin_layout Plain Layout
18016 is true, the default is
18017 \begin_inset Flex Code
18020 \begin_layout Plain Layout
18026 ; if it is false, the default is
18027 \begin_inset Flex Code
18030 \begin_layout Plain Layout
18039 \begin_layout Subsection
18043 \begin_layout Standard
18044 The XHTML output for floats too can be controlled by layout information.
18045 The output has the following form:
18048 \begin_layout LyX-Code
18050 \begin_inset Quotes erd
18054 \begin_inset Quotes erd
18060 \begin_layout LyX-Code
18061 Contents of the float.
18064 \begin_layout LyX-Code
18068 \begin_layout Standard
18069 The caption, if there is one, is a separate inset and will be output as
18071 Its appearance can be controlled via the InsetLayout for caption insets.
18075 \begin_layout Description
18076 \begin_inset Flex Code
18079 \begin_layout Plain Layout
18086 \begin_inset Flex Code
18089 \begin_layout Plain Layout
18095 ] Specifies attribute information to be output with the main tag.
18097 \begin_inset Quotes eld
18101 \begin_inset Flex Code
18104 \begin_layout Plain Layout
18105 class=`myfloat' onclick=`\SpecialChar \ldots{}
18112 \begin_inset Quotes erd
18116 By default, LyX will output
18117 \begin_inset Quotes eld
18121 \begin_inset Flex Code
18124 \begin_layout Plain Layout
18125 class=`float float-floattype'
18131 \begin_inset Quotes erd
18135 \begin_inset Flex Code
18138 \begin_layout Plain Layout
18144 is LyX's name for this type of float, as determined by the float declaration
18146 \begin_inset CommandInset ref
18148 reference "sub:Floats"
18152 ), though made lowercase and with non-alphanumeric characters converted
18153 to underscores, for example: float-table.
18156 \begin_layout Description
18157 \begin_inset Flex Code
18160 \begin_layout Plain Layout
18166 CSS style information to be included when this float is used.
18167 Note that this will automatically be wrapped in a layout-generated
18168 \begin_inset Flex Code
18171 \begin_layout Plain Layout
18177 block, so only the CSS itself need be included.
18180 \begin_layout Description
18181 \begin_inset Flex Code
18184 \begin_layout Plain Layout
18191 \begin_inset Flex Code
18194 \begin_layout Plain Layout
18200 ] The tag to be used for this float, replacing
18201 \begin_inset Quotes eld
18205 \begin_inset Flex Code
18208 \begin_layout Plain Layout
18215 \begin_inset Quotes erd
18218 in the example above.
18220 \begin_inset Flex Code
18223 \begin_layout Plain Layout
18229 and will rarely need changing.
18232 \begin_layout Subsection
18233 Bibliography formatting
18236 \begin_layout Standard
18237 The bibliography can be formatted using
18238 \begin_inset Flex Code
18241 \begin_layout Plain Layout
18249 \begin_inset CommandInset ref
18251 reference "sub:Citation-format-description"
18258 \begin_layout Subsection
18262 \begin_layout Standard
18263 We have several times mentioned that LyX will generate default CSS style
18264 rules for both insets and paragraph styles, based upon the other layout
18265 information that is provided.
18266 In this section, we shall say a word about which layout information LyX
18270 \begin_layout Standard
18271 At present, LyX auto-generates CSS only for font information, making use
18273 \begin_inset Flex Code
18276 \begin_layout Plain Layout
18283 \begin_inset Flex Code
18286 \begin_layout Plain Layout
18293 \begin_inset Flex Code
18296 \begin_layout Plain Layout
18303 \begin_inset Flex Code
18306 \begin_layout Plain Layout
18313 \begin_inset Flex Code
18316 \begin_layout Plain Layout
18324 \begin_inset CommandInset ref
18326 reference "sub:Font-description"
18330 .) The translation is mostly straightforward and obvious.
18332 \begin_inset Quotes eld
18336 \begin_inset Flex Code
18339 \begin_layout Plain Layout
18346 \begin_inset Quotes erd
18350 \begin_inset Quotes eld
18354 \begin_inset Flex Code
18357 \begin_layout Plain Layout
18358 font-family: sans-serif;
18364 \begin_inset Quotes erd
18368 The correspondence of LyX sizes and CSS sizes is a little less obvious
18369 but nonetheless intuitive.
18371 \begin_inset Flex Code
18374 \begin_layout Plain Layout
18381 \begin_inset Flex URL
18384 \begin_layout Plain Layout
18395 \begin_layout Chapter
18396 Including External Material
18399 \begin_layout Standard
18400 \begin_inset Box Shadowbox
18410 height_special "totalheight"
18413 \begin_layout Plain Layout
18414 WARNING: This portion of the documentation has not been updated for some
18416 We certainly hope that it is still accurate, but there are no guarantees.
18424 \begin_layout Standard
18425 The use of material from sources external to LyX is covered in detail in
18431 This part of the manual covers what needs to happen behind the scenes for
18432 new sorts of material to be included.
18435 \begin_layout Section
18439 \begin_layout Standard
18440 The external material feature is based on the concept of a
18445 A template is a specification of how LyX should interface with a certain
18447 As bundled, LyX comes with predefined templates for Xfig figures, various
18448 raster format images, chess diagrams, and LilyPond music notation.
18449 You can check the actual list by using the menu
18450 \begin_inset Flex MenuItem
18453 \begin_layout Plain Layout
18454 Insert\SpecialChar \menuseparator
18455 File\SpecialChar \menuseparator
18462 Furthermore, it is possible to roll your own template to support a specific
18464 Later we'll describe in more detail what is involved, and hopefully you
18465 will submit all the templates you create so we can include them in a later
18469 \begin_layout Standard
18470 Another basic idea of the external material feature is to distinguish between
18471 the original file that serves as a base for final material and the produced
18472 file that is included in your exported or printed document.
18473 For example, consider the case of a figure produced with
18474 \begin_inset Flex Code
18477 \begin_layout Plain Layout
18484 The Xfig application itself works on an original file with the
18485 \begin_inset Flex Code
18488 \begin_layout Plain Layout
18495 Within Xfig, you create and change your figure, and when you are done,
18497 \begin_inset Flex Code
18500 \begin_layout Plain Layout
18507 When you want to include the figure in your document, you invoke
18508 \begin_inset Flex Code
18511 \begin_layout Plain Layout
18517 in order to create a PostScript file that can readily be included in your
18520 \begin_inset Flex Code
18523 \begin_layout Plain Layout
18529 file is the original file, and the PostScript file is the produced file.
18532 \begin_layout Standard
18533 This distinction is important in order to allow updating of the material
18534 while you are in the process of writing the document.
18535 Furthermore, it provides us with the flexibility that is needed to support
18536 multiple export formats.
18537 For instance, in the case of a plain text file, it is not exactly an award-winn
18538 ing idea to include the figure as raw PostScript.
18539 Instead, you'd either prefer to just include a reference to the figure
18540 or try to invoke some graphics to ASCII converter to make the final result
18541 look similar to the real graphics.
18542 The external material management allows you to do this, because it is parametri
18543 zed on the different export formats that LyX supports.
18546 \begin_layout Standard
18547 Besides supporting the production of different products according to the
18548 exported format, it supports tight integration with editing and viewing
18550 In the case of an Xfig figure, you are able to invoke Xfig on the original
18551 file with a single click from within the external material dialog in LyX,
18552 and also preview the produced PostScript file with Ghostview with another
18554 No more fiddling around with the command line and/or file browsers to locate
18555 and manipulate the original or produced files.
18556 In this way, you are finally able to take full advantage of the many different
18557 applications that are relevant to use when you write your documents, and
18558 ultimately be more productive.
18561 \begin_layout Section
18562 The external template configuration file
18565 \begin_layout Standard
18566 It is relatively easy to add custom external template definitions to LyX.
18567 However, be aware that doing this in an careless manner most probably
18571 introduce an easily exploitable security hole.
18572 So before you do this, please read the discussion about security in section
18574 \begin_inset CommandInset ref
18576 reference "sec:Security-discussion"
18583 \begin_layout Standard
18584 Having said that, we encourage you to submit any interesting templates that
18589 \begin_layout Standard
18590 The external templates are defined in the
18591 \begin_inset Flex Code
18594 \begin_layout Plain Layout
18595 LyXDir/lib/external_templates
18601 You can place your own version in
18602 \begin_inset Flex Code
18605 \begin_layout Plain Layout
18606 UserDir/external_templates
18614 \begin_layout Standard
18615 A typical template looks like this:
18618 \begin_layout LyX-Code
18622 \begin_layout LyX-Code
18623 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18626 \begin_layout LyX-Code
18630 \begin_layout LyX-Code
18634 \begin_layout LyX-Code
18638 \begin_layout LyX-Code
18642 \begin_layout LyX-Code
18646 \begin_layout LyX-Code
18647 AutomaticProduction true
18650 \begin_layout LyX-Code
18654 \begin_layout LyX-Code
18658 \begin_layout LyX-Code
18662 \begin_layout LyX-Code
18663 TransformCommand Rotate RotationLatexCommand
18666 \begin_layout LyX-Code
18667 TransformCommand Resize ResizeLatexCommand
18670 \begin_layout LyX-Code
18671 Product "$$RotateFront$$ResizeFront
18674 \begin_layout LyX-Code
18679 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18682 \begin_layout LyX-Code
18683 $$ResizeBack$$RotateBack"
18686 \begin_layout LyX-Code
18690 \begin_layout LyX-Code
18691 UpdateResult "$$AbsPath$$Basename.pstex_t"
18694 \begin_layout LyX-Code
18695 Requirement "graphicx"
18698 \begin_layout LyX-Code
18699 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18702 \begin_layout LyX-Code
18703 ReferencedFile latex "$$AbsPath$$Basename.eps"
18706 \begin_layout LyX-Code
18707 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18710 \begin_layout LyX-Code
18714 \begin_layout LyX-Code
18718 \begin_layout LyX-Code
18719 TransformCommand Rotate RotationLatexCommand
18722 \begin_layout LyX-Code
18723 TransformCommand Resize ResizeLatexCommand
18726 \begin_layout LyX-Code
18727 Product "$$RotateFront$$ResizeFront
18730 \begin_layout LyX-Code
18735 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18738 \begin_layout LyX-Code
18739 $$ResizeBack$$RotateBack"
18742 \begin_layout LyX-Code
18743 UpdateFormat pdftex
18746 \begin_layout LyX-Code
18747 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18750 \begin_layout LyX-Code
18751 Requirement "graphicx"
18754 \begin_layout LyX-Code
18755 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18758 \begin_layout LyX-Code
18759 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18762 \begin_layout LyX-Code
18766 \begin_layout LyX-Code
18770 \begin_layout LyX-Code
18771 Product "$$Contents(
18773 "$$AbsPath$$Basename.asc
18778 \begin_layout LyX-Code
18779 UpdateFormat asciixfig
18782 \begin_layout LyX-Code
18783 UpdateResult "$$AbsPath$$Basename.asc"
18786 \begin_layout LyX-Code
18790 \begin_layout LyX-Code
18794 \begin_layout LyX-Code
18795 Product "<graphic fileref=
18797 "$$AbsOrRelPathMaster$$Basename.eps
18802 \begin_layout LyX-Code
18806 \begin_layout LyX-Code
18810 \begin_layout LyX-Code
18811 UpdateResult "$$AbsPath$$Basename.eps"
18814 \begin_layout LyX-Code
18815 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18818 \begin_layout LyX-Code
18819 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18822 \begin_layout LyX-Code
18826 \begin_layout LyX-Code
18827 Product "[XFig: $$FName]"
18830 \begin_layout LyX-Code
18834 \begin_layout LyX-Code
18838 \begin_layout Standard
18839 As you can see, the template is enclosed in
18840 \begin_inset Flex Code
18843 \begin_layout Plain Layout
18849 \SpecialChar \ldots{}
18851 \begin_inset Flex Code
18854 \begin_layout Plain Layout
18861 It contains a header specifying some general settings and, for each supported
18862 primary document file format, a section
18863 \begin_inset Flex Code
18866 \begin_layout Plain Layout
18872 \SpecialChar \ldots{}
18874 \begin_inset Flex Code
18877 \begin_layout Plain Layout
18886 \begin_layout Subsection
18887 The template header
18890 \begin_layout Description
18891 \begin_inset Flex Code
18894 \begin_layout Plain Layout
18895 AutomaticProduction
18896 \begin_inset space ~
18904 Whether the file represented by the template must be generated by LyX.
18905 This command must occur exactly once.
18908 \begin_layout Description
18909 \begin_inset Flex Code
18912 \begin_layout Plain Layout
18914 \begin_inset space ~
18922 A glob pattern that is used in the file dialog to filter out the desired
18924 If there is more than one possible file extension (e.
18925 \begin_inset space \thinspace{}
18929 \begin_inset space \space{}
18933 \begin_inset Flex Code
18936 \begin_layout Plain Layout
18943 \begin_inset Flex Code
18946 \begin_layout Plain Layout
18952 ), use something like
18953 \begin_inset Flex Code
18956 \begin_layout Plain Layout
18963 This command must occur exactly once.
18966 \begin_layout Description
18967 \begin_inset Flex Code
18970 \begin_layout Plain Layout
18972 \begin_inset space ~
18980 The text that is displayed on the button.
18981 This command must occur exactly once.
18984 \begin_layout Description
18985 \begin_inset Flex Code
18988 \begin_layout Plain Layout
18990 \begin_inset space ~
18994 \begin_inset space ~
19002 The help text that is used in the External dialog.
19003 Provide enough information to explain to the user just what the template
19004 can provide him with.
19005 This command must occur exactly once.
19008 \begin_layout Description
19009 \begin_inset Flex Code
19012 \begin_layout Plain Layout
19014 \begin_inset space ~
19022 The file format of the original file.
19023 This must be the name of a format that is known to LyX (see section
19024 \begin_inset CommandInset ref
19026 reference "sec:Formats"
19032 \begin_inset Quotes eld
19036 \begin_inset Flex Code
19039 \begin_layout Plain Layout
19046 \begin_inset Quotes erd
19049 if the template can handle original files of more than one format.
19050 LyX will attempt to interrogate the file itself in order to deduce its
19051 format in this case.
19052 This command must occur exactly once.
19055 \begin_layout Description
19056 \begin_inset Flex Code
19059 \begin_layout Plain Layout
19061 \begin_inset space ~
19069 A unique name for the template.
19070 It must not contain substitution macros (see below).
19073 \begin_layout Description
19074 \begin_inset Flex Code
19077 \begin_layout Plain Layout
19079 \begin_inset space ~
19082 Rotate|Resize|Clip|Extra
19087 This command specifies which transformations are supported by this template.
19088 It may occur zero or more times.
19089 This command enables the corresponding tabs in the external dialog.
19091 \begin_inset Flex Code
19094 \begin_layout Plain Layout
19100 command must have either a corresponding
19101 \begin_inset Flex Code
19104 \begin_layout Plain Layout
19111 \begin_inset Flex Code
19114 \begin_layout Plain Layout
19121 \begin_inset Flex Code
19124 \begin_layout Plain Layout
19131 Otherwise the transformation will not be supported by that format.
19134 \begin_layout Subsection
19138 \begin_layout Description
19139 \begin_inset Flex Code
19142 \begin_layout Plain Layout
19144 \begin_inset space ~
19147 LaTeX|PDFLaTeX|PlainText|DocBook
19152 The primary document file format that this format definition is for.
19153 Not every template has a sensible representation in all document file formats.
19154 Please define nevertheless a
19155 \begin_inset Flex Code
19158 \begin_layout Plain Layout
19164 section for all formats.
19165 Use a dummy text when no representation is available.
19166 Then you can at least see a reference to the external material in the exported
19170 \begin_layout Description
19171 \begin_inset Flex Code
19174 \begin_layout Plain Layout
19176 \begin_inset space ~
19180 \begin_inset space ~
19188 This command defines an additional macro
19189 \begin_inset Flex Code
19192 \begin_layout Plain Layout
19198 for substitution in
19199 \begin_inset Flex Code
19202 \begin_layout Plain Layout
19210 \begin_inset Flex Code
19213 \begin_layout Plain Layout
19219 itself may contain substitution macros.
19220 The advantage over using
19221 \begin_inset Flex Code
19224 \begin_layout Plain Layout
19231 \begin_inset Flex Code
19234 \begin_layout Plain Layout
19240 is that the substituted value of
19241 \begin_inset Flex Code
19244 \begin_layout Plain Layout
19250 is sanitized so that it is a valid optional argument in the document format.
19251 This command may occur zero or more times.
19254 \begin_layout Description
19255 \begin_inset Flex Code
19258 \begin_layout Plain Layout
19260 \begin_inset space ~
19268 The text that is inserted in the exported document.
19269 This is actually the most important command and can be quite complex.
19270 This command must occur exactly once.
19273 \begin_layout Description
19274 \begin_inset Flex Code
19277 \begin_layout Plain Layout
19279 \begin_inset space ~
19287 This command specifies a preamble snippet that will be included in the
19289 It has to be defined using
19290 \begin_inset Flex Code
19293 \begin_layout Plain Layout
19299 \SpecialChar \ldots{}
19301 \begin_inset Flex Code
19304 \begin_layout Plain Layout
19311 This command may occur zero or more times.
19314 \begin_layout Description
19315 \begin_inset Flex Code
19318 \begin_layout Plain Layout
19320 \begin_inset space ~
19324 \begin_inset space ~
19332 This command denotes files that are created by the conversion process and
19333 are needed for a particular export format.
19334 If the filename is relative, it is interpreted relative to the master document.
19335 This command may be given zero or more times.
19338 \begin_layout Description
19339 \begin_inset Flex Code
19342 \begin_layout Plain Layout
19344 \begin_inset space ~
19352 The name of a required LaTeX package.
19353 The package is included via
19354 \begin_inset Flex Code
19357 \begin_layout Plain Layout
19365 in the LaTeX preamble.
19366 This command may occur zero or more times.
19369 \begin_layout Description
19370 \begin_inset Flex Code
19373 \begin_layout Plain Layout
19375 \begin_inset space ~
19379 \begin_inset space ~
19382 RotationLatexCommand
19387 This command specifies that the built in LaTeX command should be used for
19389 This command may occur once or not at all.
19392 \begin_layout Description
19393 \begin_inset Flex Code
19396 \begin_layout Plain Layout
19398 \begin_inset space ~
19402 \begin_inset space ~
19410 This command specifies that the built in LaTeX command should be used for
19412 This command may occur once or not at all.
19415 \begin_layout Description
19416 \begin_inset Flex Code
19419 \begin_layout Plain Layout
19421 \begin_inset space ~
19425 \begin_inset space ~
19428 RotationLatexOption
19433 This command specifies that rotation is done via an optional argument.
19434 This command may occur once or not at all.
19437 \begin_layout Description
19438 \begin_inset Flex Code
19441 \begin_layout Plain Layout
19443 \begin_inset space ~
19447 \begin_inset space ~
19455 This command specifies that resizing is done via an optional argument.
19456 This command may occur once or not at all.
19459 \begin_layout Description
19460 \begin_inset Flex Code
19463 \begin_layout Plain Layout
19465 \begin_inset space ~
19469 \begin_inset space ~
19477 This command specifies that clipping is done via an optional argument.
19478 This command may occur once or not at all.
19481 \begin_layout Description
19482 \begin_inset Flex Code
19485 \begin_layout Plain Layout
19487 \begin_inset space ~
19491 \begin_inset space ~
19499 This command specifies that an extra optional argument is used.
19500 This command may occur once or not at all.
19503 \begin_layout Description
19504 \begin_inset Flex Code
19507 \begin_layout Plain Layout
19509 \begin_inset space ~
19517 The file format of the converted file.
19518 This must be the name of a format that is known to LyX (see the
19519 \begin_inset Flex MenuItem
19522 \begin_layout Plain Layout
19527 ools\SpecialChar \menuseparator
19532 references:Conversion
19538 This command must occur exactly once.
19541 \begin_layout Description
19542 \begin_inset Flex Code
19545 \begin_layout Plain Layout
19547 \begin_inset space ~
19555 The file name of the converted file.
19556 The file name must be absolute.
19557 This command must occur exactly once.
19560 \begin_layout Subsection
19561 Preamble definitions
19564 \begin_layout Standard
19565 The external template configuration file may contain additional preamble
19566 definitions enclosed by
19567 \begin_inset Flex Code
19570 \begin_layout Plain Layout
19576 \SpecialChar \ldots{}
19578 \begin_inset Flex Code
19581 \begin_layout Plain Layout
19588 They can be used by the templates in the
19589 \begin_inset Flex Code
19592 \begin_layout Plain Layout
19601 \begin_layout Section
19602 The substitution mechanism
19605 \begin_layout Standard
19606 When the external material facility invokes an external program, it is done
19607 on the basis of a command defined in the template configuration file.
19608 These commands can contain various macros that are expanded before execution.
19609 Execution always take place in the directory of the containing document.
19612 \begin_layout Standard
19613 Also, whenever external material is to be displayed, the name will be produced
19614 by the substitution mechanism, and most other commands in the template
19615 definition support substitution as well.
19618 \begin_layout Standard
19619 The available macros are the following:
19622 \begin_layout Description
19623 \begin_inset Flex Code
19626 \begin_layout Plain Layout
19627 $$AbsOrRelPathMaster
19632 The file path, absolute or relative to the master LyX document.
19635 \begin_layout Description
19636 \begin_inset Flex Code
19639 \begin_layout Plain Layout
19640 $$AbsOrRelPathParent
19645 The file path, absolute or relative to the LyX document.
19648 \begin_layout Description
19649 \begin_inset Flex Code
19652 \begin_layout Plain Layout
19658 The absolute file path.
19661 \begin_layout Description
19662 \begin_inset Flex Code
19665 \begin_layout Plain Layout
19671 The filename without path and without the extension.
19674 \begin_layout Description
19675 \begin_inset Flex Code
19678 \begin_layout Plain Layout
19680 \begin_inset Quotes eld
19684 \begin_inset Quotes erd
19692 This macro will expand to the contents of the file with the name
19693 \begin_inset Flex Code
19696 \begin_layout Plain Layout
19705 \begin_layout Description
19706 \begin_inset Flex Code
19709 \begin_layout Plain Layout
19715 The file extension (including the dot).
19718 \begin_layout Description
19719 \begin_inset Flex Code
19722 \begin_layout Plain Layout
19728 The filename of the file specified in the external material dialog.
19729 This is either an absolute name, or it is relative to the LyX document.
19732 \begin_layout Description
19733 \begin_inset Flex Code
19736 \begin_layout Plain Layout
19743 \begin_inset Flex Code
19746 \begin_layout Plain Layout
19752 (absolute name or relative to the LyX document).
19755 \begin_layout Description
19756 \begin_inset Flex Code
19759 \begin_layout Plain Layout
19765 The file path, relative to the master LyX document.
19768 \begin_layout Description
19769 \begin_inset Flex Code
19772 \begin_layout Plain Layout
19778 The file path, relative to the LyX document.
19781 \begin_layout Description
19782 \begin_inset Flex Code
19785 \begin_layout Plain Layout
19791 This macro will expand to the absolute path of the system directory.
19792 This is typically used to point to the various helper scripts that are
19796 \begin_layout Description
19797 \begin_inset Flex Code
19800 \begin_layout Plain Layout
19806 A name and full path to a temporary file which will be automatically deleted
19807 whenever the containing document is closed, or the external material insertion
19811 \begin_layout Standard
19812 All path macros contain a trailing directory separator, so you can construct
19814 \begin_inset space \thinspace{}
19818 \begin_inset space \space{}
19821 the absolute filename with
19822 \begin_inset Flex Code
19825 \begin_layout Plain Layout
19826 $$AbsPath$$Basename$$Extension
19834 \begin_layout Standard
19835 The macros above are substituted in all commands unless otherwise noted.
19837 \begin_inset Flex Code
19840 \begin_layout Plain Layout
19846 supports additionally the following substitutions if they are enabled by
19848 \begin_inset Flex Code
19851 \begin_layout Plain Layout
19858 \begin_inset Flex Code
19861 \begin_layout Plain Layout
19870 \begin_layout Description
19871 \begin_inset Flex Code
19874 \begin_layout Plain Layout
19880 The front part of the resize command.
19883 \begin_layout Description
19884 \begin_inset Flex Code
19887 \begin_layout Plain Layout
19893 The back part of the resize command.
19896 \begin_layout Description
19897 \begin_inset Flex Code
19900 \begin_layout Plain Layout
19906 The front part of the rotation command.
19909 \begin_layout Description
19910 \begin_inset Flex Code
19913 \begin_layout Plain Layout
19919 The back part of the rotation command.
19922 \begin_layout Standard
19923 The value string of the
19924 \begin_inset Flex Code
19927 \begin_layout Plain Layout
19933 command supports additionally the following substitutions if they are enabled
19935 \begin_inset Flex Code
19938 \begin_layout Plain Layout
19945 \begin_inset Flex Code
19948 \begin_layout Plain Layout
19957 \begin_layout Description
19958 \begin_inset Flex Code
19961 \begin_layout Plain Layout
19970 \begin_layout Description
19971 \begin_inset Flex Code
19974 \begin_layout Plain Layout
19983 \begin_layout Description
19984 \begin_inset Flex Code
19987 \begin_layout Plain Layout
19996 \begin_layout Description
19997 \begin_inset Flex Code
20000 \begin_layout Plain Layout
20006 The rotation option.
20009 \begin_layout Standard
20010 You may ask why there are so many path macros.
20011 There are mainly two reasons:
20014 \begin_layout Enumerate
20015 Relative and absolute file names should remain relative or absolute, respectivel
20017 Users may have reasons to prefer either form.
20018 Relative names are useful for portable documents that should work on different
20019 machines, for example.
20020 Absolute names may be required by some programs.
20023 \begin_layout Enumerate
20024 LaTeX treats relative file names differently than LyX and other programs
20025 in nested included files.
20026 For LyX, a relative file name is always relative to the document that contains
20028 For LaTeX, it is always relative to the master document.
20029 These two definitions are identical if you have only one document, but
20030 differ if you have a master document that includes part documents.
20031 That means that relative filenames must be transformed when presented to
20033 Fortunately LyX does this automatically for you if you choose the right
20037 \begin_layout Standard
20038 So which path macro should be used in new template definitions? The rule
20042 \begin_layout Itemize
20044 \begin_inset Flex Code
20047 \begin_layout Plain Layout
20053 if an absolute path is required.
20056 \begin_layout Itemize
20058 \begin_inset Flex Code
20061 \begin_layout Plain Layout
20062 $$AbsOrRelPathMaster
20067 if the substituted string is some kind of LaTeX input.
20070 \begin_layout Itemize
20072 \begin_inset Flex Code
20075 \begin_layout Plain Layout
20076 $$AbsOrRelPathParent
20081 in order to preserve the user's choice.
20084 \begin_layout Standard
20085 There are special cases where this rule does not work and e.
20086 \begin_inset space \thinspace{}
20090 \begin_inset space \space{}
20093 relative names are needed, but normally it will work just fine.
20094 One example for such a case is the command
20095 \begin_inset Flex Code
20098 \begin_layout Plain Layout
20099 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20104 in the XFig template above: We can't use the absolute name because the
20106 \begin_inset Flex Code
20109 \begin_layout Plain Layout
20115 files needs the relative name in order to rewrite the file content.
20118 \begin_layout Section
20119 Security discussion
20120 \begin_inset CommandInset label
20122 name "sec:Security-discussion"
20129 \begin_layout Standard
20130 The external material feature interfaces with a lot of external programs
20131 and does so automatically, so we have to consider the security implications
20133 In particular, since you have the option of including your own filenames
20134 and/or parameter strings and those are expanded into a command, it seems
20135 that it would be possible to create a malicious document which executes
20136 arbitrary commands when a user views or prints the document.
20137 This is something we definitely want to avoid.
20140 \begin_layout Standard
20141 However, since the external program commands are specified in the template
20142 configuration file only, there are no security issues if LyX is properly
20143 configured with safe templates only.
20144 This is so because the external programs are invoked with the
20145 \begin_inset Flex Code
20148 \begin_layout Plain Layout
20154 -system call rather than the
20155 \begin_inset Flex Code
20158 \begin_layout Plain Layout
20164 system-call, so it's not possible to execute arbitrary commands from the
20165 filename or parameter section via the shell.
20168 \begin_layout Standard
20169 This also implies that you are restricted in what command strings you can
20170 use in the external material templates.
20171 In particular, pipes and redirection are not readily available.
20172 This has to be so if LyX should remain safe.
20173 If you want to use some of the shell features, you should write a safe
20174 script to do this in a controlled manner, and then invoke the script from
20175 the command string.
20179 \begin_layout Standard
20180 It is possible to design a template that interacts directly with the shell,
20181 but since this would allow a malicious user to execute arbitrary commands
20182 by writing clever filenames and/or parameters, we generally recommend that
20183 you only use safe scripts that work with the
20184 \begin_inset Flex Code
20187 \begin_layout Plain Layout
20193 system call in a controlled manner.
20194 Of course, for use in a controlled environment, it can be tempting to just
20195 fall back to use ordinary shell scripts.
20196 If you do so, be aware that you
20200 provide an easily exploitable security hole in your system.
20201 Of course it stands to reason that such unsafe templates will never be
20202 included in the standard LyX distribution, although we do encourage people
20203 to submit new templates in the open source tradition.
20204 But LyX as shipped from the official distribution channels will never have
20208 \begin_layout Standard
20209 Including external material provides a lot of power, and you have to be
20210 careful not to introduce security hazards with this power.
20211 A subtle error in a single line in an innocent looking script can open
20212 the door to huge security problems.
20213 So if you do not fully understand the issues, we recommend that you consult
20214 a knowledgeable security professional or the LyX development team if you
20215 have any questions about whether a given template is safe or not.
20216 And do this before you use it in an uncontrolled environment.