1 #LyX 2.1 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 \options fleqn,bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading
35 \use_default_options false
39 \maintain_unincluded_children false
42 InsetLayout Flex:MenuItem
51 \newcommand*{\menuitem}[1]{{\sffamily #1}}
54 # In case we need to do with sans...
55 #InsetLayout CharStyle:Code
60 #\renewcommand{\code}[1]{{\sffamily #1}}
65 \language_package default
70 \font_typewriter default
71 \font_default_family default
72 \use_non_tex_fonts false
79 \default_output_format default
81 \bibtex_command default
82 \index_command default
86 \pdf_title "LyX Configuration Manual"
87 \pdf_author "LyX Team"
88 \pdf_subject "LyX-documentation Customization"
89 \pdf_keywords "LyX, documentation, customization"
91 \pdf_bookmarksnumbered true
92 \pdf_bookmarksopen true
93 \pdf_bookmarksopenlevel 1
98 \pdf_pdfusetitle false
99 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
110 \paperorientation portrait
124 \paragraph_separation indent
125 \paragraph_indentation default
126 \quotes_language english
129 \paperpagestyle headings
130 \tracking_changes false
131 \output_changes false
140 Customizing LyX: Features for the Advanced User
148 \begin_layout Plain Layout
150 If you have comments or error corrections, please send them to the LyX Documenta
152 \begin_inset CommandInset href
154 target "lyx-docs@lists.lyx.org"
161 \begin_inset Quotes eld
165 \begin_inset Quotes erd
168 in the subject header, and please cc the current maintainer of this file,
169 Richard Heck <rgheck@comcast.net>.
175 \begin_inset Newline newline
179 \begin_inset Newline newline
185 \begin_layout Standard
186 \begin_inset CommandInset toc
187 LatexCommand tableofcontents
194 \begin_layout Standard
195 \begin_inset Note Note
198 \begin_layout Plain Layout
199 Please use change tracking when modifying this document.
200 This makes it easier for our translators to recognize things that have
201 been changed, and it helps the maintainer keep up-to-date with what's been
210 \begin_layout Chapter
214 \begin_layout Standard
215 This manual covers the customization features present in LyX.
216 In it, we discuss issues like keyboard shortcuts, screen previewing options,
217 printer options, sending commands to LyX via the LyX Server, internationalizati
218 on, installing new LaTeX classes and LyX layouts, etc.
219 We can't possibly hope to touch on everything you can change—our developers
220 add new features faster than we can document them—but we will explain the
221 most common customizations and hopefully point you in the right direction
222 for some of the more obscure ones.
225 \begin_layout Standard
226 \begin_inset Branch OutDated
229 \begin_layout Standard
230 Information from previous versions of this document that now seems to be
231 outdated is contained in the OutDated branch of this document.
232 By default, this information will not appear in the LaTeX output.
240 \begin_layout Chapter
241 LyX configuration files
244 \begin_layout Standard
245 This chapter aims to help you to find your way through the LyX configuration
247 Before continuing to read this chapter, you should find out where your
248 LyX library and user directories are by using
249 \begin_inset Flex MenuItem
252 \begin_layout Plain Layout
253 Help\SpecialChar \menuseparator
264 The library directory is the place where LyX places its system-wide configurati
265 on files; the user directory is where you can place your modified versions.
266 We will call the former
267 \begin_inset Flex Code
270 \begin_layout Plain Layout
277 \begin_inset Flex MenuItem
280 \begin_layout Plain Layout
286 in the remainder of this document.
290 \begin_layout Section
292 \begin_inset Flex Code
295 \begin_layout Plain Layout
304 \begin_layout Standard
305 \begin_inset Flex Code
308 \begin_layout Plain Layout
314 and its sub-directories contain a number of files and that can be used
315 to customize LyX's behavior.
316 You can change many of these files from within LyX itself through the
317 \begin_inset Flex MenuItem
320 \begin_layout Plain Layout
321 Tools\SpecialChar \menuseparator
328 Most customization that you will want to do in LyX is possible through
330 However, many other inner aspects of LyX can be customized by modifying
332 \begin_inset Flex Code
335 \begin_layout Plain Layout
342 These files fall in different categories, described in the following subsection
346 \begin_layout Subsection
347 Automatically generated files
350 \begin_layout Standard
351 The files, which are to be found in
352 \begin_inset Flex MenuItem
355 \begin_layout Plain Layout
361 , are generated when you configure LyX.
362 They contain various default values that are guessed by inspection.
363 In general, it is not a good idea to modify them, since they might be overwritt
367 \begin_layout Labeling
368 \labelwidthstring 00.00.0000
369 \begin_inset Flex Code
372 \begin_layout Plain Layout
378 contains defaults for various commands.
381 \begin_layout Labeling
382 \labelwidthstring 00.00.0000
383 \begin_inset Flex Code
386 \begin_layout Plain Layout
392 contains the list of packages that have been recognized by LyX.
393 It is currently unused by the LyX program itself, but the information extracted
394 , and more, is made available with
395 \begin_inset Flex MenuItem
398 \begin_layout Plain Layout
399 Help\SpecialChar \menuseparator
412 \begin_layout Labeling
413 \labelwidthstring 00.00.0000
414 \begin_inset Flex Code
417 \begin_layout Plain Layout
423 the list of text classes that have been found in your
424 \begin_inset Flex Code
427 \begin_layout Plain Layout
433 directories, along with the associated LaTeX document class and their descripti
437 \begin_layout Labeling
438 \labelwidthstring 00.00.0000
439 \begin_inset Flex Code
442 \begin_layout Plain Layout
448 the list of layout modules found in your
449 \begin_inset Flex Code
452 \begin_layout Plain Layout
461 \begin_layout Labeling
462 \labelwidthstring 00.00.0000
463 \begin_inset Flex Code
466 \begin_layout Plain Layout
472 lists of various sorts of LaTeX-related files found on your system
475 \begin_layout Labeling
476 \labelwidthstring 00.00.0000
477 \begin_inset Flex Code
480 \begin_layout Plain Layout
486 is automatically generated during configuration from the file
487 \begin_inset Flex Code
490 \begin_layout Plain Layout
497 It contains information on your LaTeX configuration.
500 \begin_layout Subsection
504 \begin_layout Standard
505 These directories are duplicated between
506 \begin_inset Flex Code
509 \begin_layout Plain Layout
516 \begin_inset Flex Code
519 \begin_layout Plain Layout
526 If a particular files exists in both places, the one in
527 \begin_inset Flex Code
530 \begin_layout Plain Layout
539 \begin_layout Labeling
540 \labelwidthstring 00.00.0000
541 \begin_inset Flex Code
544 \begin_layout Plain Layout
550 this directory contains files with the extension
551 \begin_inset Flex Code
554 \begin_layout Plain Layout
560 that define the keybindings used in LyX.
561 If there exists an internationalized version of the bind file named
562 \begin_inset Flex Code
565 \begin_layout Plain Layout
571 , that will be used first.
574 \begin_layout Labeling
575 \labelwidthstring 00.00.0000
576 \begin_inset Flex Code
579 \begin_layout Plain Layout
585 contains graphics files that can be included in documents.
589 \begin_layout Labeling
590 \labelwidthstring 00.00.0000
591 \begin_inset Flex Code
594 \begin_layout Plain Layout
600 contains LyX documentation files (including the one you are currently reading).
602 \begin_inset Flex Code
605 \begin_layout Plain Layout
611 deserves special attention, as noted above.
612 The internationalized help docs are in subdirectories
613 \begin_inset Flex Code
616 \begin_layout Plain Layout
623 \begin_inset Quotes eld
627 \begin_inset Quotes erd
630 is the ISO language code.
636 \begin_inset CommandInset ref
638 reference "cha:Internationalizing-LyX"
645 \begin_layout Labeling
646 \labelwidthstring 00.00.0000
647 \begin_inset Flex Code
650 \begin_layout Plain Layout
656 contains example files that explain how to use some features.
657 In the file browser, press the
658 \begin_inset Flex MenuItem
661 \begin_layout Plain Layout
670 \begin_layout Labeling
671 \labelwidthstring 00.00.0000
672 \begin_inset Flex Code
675 \begin_layout Plain Layout
681 contains image files that are used by the
682 \begin_inset Flex MenuItem
685 \begin_layout Plain Layout
692 In addition, it also contains the individual icons used in the toolbar
693 and the banners that can be shown when LyX is launched.
696 \begin_layout Labeling
697 \labelwidthstring 00.00.0000
698 \begin_inset Flex Code
701 \begin_layout Plain Layout
707 contains keyboard keymapping files.
713 \begin_inset CommandInset ref
715 reference "sec:International-Keymap-Stuff"
722 \begin_layout Labeling
723 \labelwidthstring 00.00.0000
724 \begin_inset Flex Code
727 \begin_layout Plain Layout
733 contains the text class and module files described in Chapter
738 \begin_inset CommandInset ref
740 reference "cha:Installing-New-Document"
747 \begin_layout Labeling
748 \labelwidthstring 00.00.0000
749 \begin_inset Flex Code
752 \begin_layout Plain Layout
759 \begin_inset Flex Code
762 \begin_layout Plain Layout
768 Python scripts used to convert between LyX versions.
769 These can be run from the command line if, say, you want to batch-convert
773 \begin_layout Labeling
774 \labelwidthstring 00.00.0000
775 \begin_inset Flex Code
778 \begin_layout Plain Layout
784 contains some files that demonstrate the capabilities of the
785 \begin_inset Flex MenuItem
788 \begin_layout Plain Layout
799 Also contains some scripts used by LyX itself.
802 \begin_layout Labeling
803 \labelwidthstring 00.00.0000
804 \begin_inset Flex Code
807 \begin_layout Plain Layout
813 contains the standard LyX template files described in Chapter
818 \begin_inset CommandInset ref
820 reference "sub:Creating-Templates"
827 \begin_layout Labeling
828 \labelwidthstring 00.00.0000
829 \begin_inset Flex Code
832 \begin_layout Plain Layout
838 contains files with the extension
839 \begin_inset Flex Code
842 \begin_layout Plain Layout
848 that define the user interface to LyX.
849 That is, the files define which items appear in which menus and the items
850 appearing on the toolbar.
853 \begin_layout Subsection
854 Files you don't want to modify
857 \begin_layout Standard
858 These files are used internally by LyX and you generally do not need to
859 modify them unless you are a developer.
862 \begin_layout Labeling
863 \labelwidthstring 00.00.0000
864 \begin_inset Flex Code
867 \begin_layout Plain Layout
873 this file contains the list of LyX developers.
874 The contents are displayed with the menu entry
875 \begin_inset Flex MenuItem
878 \begin_layout Plain Layout
879 Help\SpecialChar \menuseparator
892 \begin_layout Labeling
893 \labelwidthstring 00.00.0000
894 \begin_inset Flex Code
897 \begin_layout Plain Layout
903 this is a LaTeX script used during the configuration process.
907 \begin_layout Labeling
908 \labelwidthstring 00.00.0000
909 \begin_inset Flex Code
912 \begin_layout Plain Layout
918 this is the script that is used to re-configure LyX.
919 It creates configuration files in the directory it was run from.
922 \begin_layout Subsection
923 Other files needing a line or two...
926 \begin_layout Labeling
927 \labelwidthstring 00.00.0000
928 \begin_inset Flex Code
931 \begin_layout Plain Layout
937 this contains tables describing how different character encodings can be
941 \begin_layout Labeling
942 \labelwidthstring 00.00.0000
943 \begin_inset Flex Code
946 \begin_layout Plain Layout
952 this file contains the templates available to the new
953 \begin_inset Flex MenuItem
956 \begin_layout Plain Layout
969 \begin_layout Labeling
970 \labelwidthstring 00.00.0000
971 \begin_inset Flex Code
974 \begin_layout Plain Layout
980 this file contains a list of all the languages currently supported by LyX.
983 \begin_layout Section
984 Your local configuration directory
987 \begin_layout Standard
988 Even if you are using LyX as an unprivileged user, you might want to change
989 LyX configuration for your own use.
991 \begin_inset Flex Code
994 \begin_layout Plain Layout
1000 directory contains all your personal configuration files.
1001 This is the directory described as
1002 \begin_inset Quotes eld
1006 \begin_inset Quotes erd
1010 \begin_inset Flex MenuItem
1013 \begin_layout Plain Layout
1014 Help\SpecialChar \menuseparator
1016 \begin_inset space ~
1025 This directory is used as a mirror of
1026 \begin_inset Flex Code
1029 \begin_layout Plain Layout
1035 , which means that every file in
1036 \begin_inset Flex Code
1039 \begin_layout Plain Layout
1045 is a replacement for the corresponding file in
1046 \begin_inset Flex Code
1049 \begin_layout Plain Layout
1056 Any configuration file described in the above sections can be placed either
1057 in the system-wide directory, in which case it will affect all users, or
1058 in your local directory for your own use.
1061 \begin_layout Standard
1062 To make things clearer, let's provide a few examples:
1065 \begin_layout Itemize
1066 The preferences set in the
1067 \begin_inset Flex MenuItem
1070 \begin_layout Plain Layout
1071 Tools\SpecialChar \menuseparator
1077 dialog are saved to a file
1078 \begin_inset Flex Code
1081 \begin_layout Plain Layout
1088 \begin_inset Flex Code
1091 \begin_layout Plain Layout
1100 \begin_layout Itemize
1101 When you reconfigure using
1102 \begin_inset Flex MenuItem
1105 \begin_layout Plain Layout
1106 Tools\SpecialChar \menuseparator
1113 \begin_inset Flex Code
1116 \begin_layout Plain Layout
1122 script, and the resulting files are written in your local configuration
1124 This means that any additional text class file that you might have added
1126 \begin_inset Flex Code
1129 \begin_layout Plain Layout
1135 will be added to the list of classes in the
1136 \begin_inset Flex MenuItem
1139 \begin_layout Plain Layout
1140 Document\SpecialChar \menuseparator
1149 \begin_layout Itemize
1150 If you get some updated documentation from LyX ftp site and cannot install
1151 it because you do not have sysadmin rights on your system, you can just
1153 \begin_inset Flex Code
1156 \begin_layout Plain Layout
1162 and the items in the
1163 \begin_inset Flex MenuItem
1166 \begin_layout Plain Layout
1172 menu will open them!
1175 \begin_layout Section
1176 Running LyX with multiple configurations
1179 \begin_layout Standard
1180 The configuration freedom of the local configuration directory may not suffice
1181 if you want to have more than one configuration at your disposal.
1182 For example, you may want to be use different key bindings or printer settings
1184 You can achieve this by having several such directories.
1185 You then specify which directory to use at run-time.
1188 \begin_layout Standard
1189 Invoking LyX with the command line switch
1190 \begin_inset Flex Code
1193 \begin_layout Plain Layout
1203 instructs the program to read the configuration from that directory, and
1204 not from the default directory.
1205 (You can determine the default directory by running LyX without the
1206 \begin_inset Flex Code
1209 \begin_layout Plain Layout
1215 switch.) If the specified directory does not exist, LyX offers to create
1216 it for you, just like it does for the default directory on the first time
1217 you run the program.
1218 You can modify the configuration options in this additional user directory
1219 exactly as you would for the default directory.
1220 These directories are completely independent (but read on).
1221 Note that setting the environment variable
1222 \begin_inset Flex Code
1225 \begin_layout Plain Layout
1231 to some value has exactly the same effect.
1234 \begin_layout Standard
1235 Having several configurations also requires more maintenance: if you want
1236 to add a new layout to
1237 \begin_inset Flex Code
1240 \begin_layout Plain Layout
1246 which you want available from all your configurations, you must add it
1247 to each directory separately.
1248 You can avoid this with the following trick: after LyX creates the additional
1249 directory, most of the subdirectories (see above) are empty.
1250 If you want the new configuration to mirror an existing one, replace the
1251 empty subdirectory with a symbolic link to the matching subdirectory in
1252 the existing configuration.
1254 \begin_inset Flex Code
1257 \begin_layout Plain Layout
1263 subdirectory, however, since it contains a file written by the configuration
1264 script (also accessible through
1265 \begin_inset Flex MenuItem
1268 \begin_layout Plain Layout
1269 Tools\SpecialChar \menuseparator
1275 ) which is configuration-specific.
1278 \begin_layout Chapter
1279 The Preferences dialog
1282 \begin_layout Standard
1283 All options of the preferences dialog are described in the Appendix
1285 The Preferences Dialog
1292 For some options you might find here more details.
1295 \begin_layout Section
1297 \begin_inset CommandInset label
1306 \begin_layout Standard
1307 The first step is to define your file formats if they are not already defined.
1309 \begin_inset Flex MenuItem
1312 \begin_layout Plain Layout
1313 Tools\SpecialChar \menuseparator
1321 \begin_inset Flex MenuItem
1324 \begin_layout Plain Layout
1325 File Handling\SpecialChar \menuseparator
1332 \begin_inset Flex MenuItem
1335 \begin_layout Plain Layout
1336 New\SpecialChar \ldots{}
1342 button to define your new format.
1344 \begin_inset Flex MenuItem
1347 \begin_layout Plain Layout
1353 field contains the name used to identify the format in the GUI.
1355 \begin_inset Flex MenuItem
1358 \begin_layout Plain Layout
1364 is used to identify the format internally.
1365 You will also need to enter a file extension.
1366 These are all required.
1368 \begin_inset Flex MenuItem
1371 \begin_layout Plain Layout
1377 field is used to provide a keyboard shortcut on the menus.
1378 (For example, pressing
1379 \begin_inset Flex MenuItem
1382 \begin_layout Plain Layout
1389 \begin_inset Flex MenuItem
1392 \begin_layout Plain Layout
1393 View\SpecialChar \menuseparator
1394 View (Other Formats)\SpecialChar \menuseparator
1403 \begin_layout Standard
1405 \begin_inset Flex MenuItem
1408 \begin_layout Plain Layout
1415 \begin_inset Flex MenuItem
1418 \begin_layout Plain Layout
1425 For example, you might want to use
1426 \begin_inset Flex MenuItem
1429 \begin_layout Plain Layout
1435 to view PostScript files.
1436 You can enter the command needed to start the program in the corresponding
1438 In defining this command, you can use the four variables listed in the
1440 The viewer is launched when you view an image in LyX or use the
1441 \begin_inset Flex MenuItem
1444 \begin_layout Plain Layout
1451 The editor is for example launched when you right-click on an image and
1453 \begin_inset Flex MenuItem
1456 \begin_layout Plain Layout
1462 in the appearing context menu.
1465 \begin_layout Standard
1467 \begin_inset Flex MenuItem
1470 \begin_layout Plain Layout
1476 option tells LyX that a format is suitable for document export.
1477 If this is set and if a suitable conversion route exists (see sec.
1478 \begin_inset space \thinspace{}
1482 \begin_inset CommandInset ref
1484 reference "sec:Converters"
1488 ), the format will appear in the
1489 \begin_inset Flex MenuItem
1492 \begin_layout Plain Layout
1493 File\SpecialChar \menuseparator
1500 The format will also appear in the
1501 \begin_inset Flex MenuItem
1504 \begin_layout Plain Layout
1510 menu if a viewer is specified for the format.
1511 Pure image formats, such as
1512 \begin_inset Flex Code
1515 \begin_layout Plain Layout
1521 , should not use this option.
1522 Formats that can both represent vector graphics and documents like
1523 \begin_inset Flex Code
1526 \begin_layout Plain Layout
1535 \begin_layout Standard
1537 \begin_inset Flex MenuItem
1540 \begin_layout Plain Layout
1541 Vector graphics format
1546 tells LyX that a format can contain vector graphics.
1547 This information is used to determine the target format of included graphics
1549 \begin_inset Flex MenuItem
1552 \begin_layout Plain Layout
1559 Included graphics may need to be converted to either
1560 \begin_inset Flex MenuItem
1563 \begin_layout Plain Layout
1570 \begin_inset Flex MenuItem
1573 \begin_layout Plain Layout
1580 \begin_inset Flex MenuItem
1583 \begin_layout Plain Layout
1590 \begin_inset Flex MenuItem
1593 \begin_layout Plain Layout
1599 cannot handle other image formats.
1600 If an included graphic is not already in
1601 \begin_inset Flex MenuItem
1604 \begin_layout Plain Layout
1611 \begin_inset Flex MenuItem
1614 \begin_layout Plain Layout
1621 \begin_inset Flex MenuItem
1624 \begin_layout Plain Layout
1630 format, it is converted to
1631 \begin_inset Flex MenuItem
1634 \begin_layout Plain Layout
1640 if the vector format option is set, and otherwise to
1641 \begin_inset Flex MenuItem
1644 \begin_layout Plain Layout
1653 \begin_layout Section
1657 \begin_layout Standard
1658 Since all conversions from one format to another take place in LyX's temporary
1659 directory, it is sometimes necessary to modify a file before copying it
1660 to the temporary directory in order that the conversion may be performed.
1664 \begin_layout Plain Layout
1665 For example, the file may refer to other files—images, for example—using
1666 relative file names, and these may become invalid when the file is copied
1667 to the temporary directory.
1672 This is done by a Copier: It copies a file to (or from) the temporary directory
1673 and may modify it in the process.
1676 \begin_layout Standard
1677 The definitions of the copiers may use four variables:
1680 \begin_layout Labeling
1681 \labelwidthstring 00.00.0000
1682 \begin_inset Flex Code
1685 \begin_layout Plain Layout
1691 The LyX system directory (e.
1692 \begin_inset space \thinspace{}
1696 \begin_inset space \space{}
1700 \begin_inset Flex MenuItem
1703 \begin_layout Plain Layout
1712 \begin_layout Labeling
1713 \labelwidthstring 00.00.0000
1714 \begin_inset Flex Code
1717 \begin_layout Plain Layout
1726 \begin_layout Labeling
1727 \labelwidthstring 00.00.0000
1728 \begin_inset Flex Code
1731 \begin_layout Plain Layout
1740 \begin_layout Labeling
1741 \labelwidthstring 00.00.0000
1742 \begin_inset Flex Code
1745 \begin_layout Plain Layout
1754 \begin_layout Standard
1755 The latter should be the filename as it would be used in a LaTeX's
1762 It is relevant only when exporting files suitable for such inclusion.
1765 \begin_layout Standard
1766 Copiers can be used to do almost anything with output files.
1767 For example, suppose you want generated pdf files to be copied to a special
1769 \begin_inset Flex Code
1772 \begin_layout Plain Layout
1779 Then you could write a shell script such as this one:
1782 \begin_layout Standard
1783 \begin_inset listings
1787 \begin_layout Plain Layout
1792 \begin_layout Plain Layout
1797 \begin_layout Plain Layout
1799 TOFILE=`basename $2`
1802 \begin_layout Plain Layout
1804 cp $FROMFILE /home/you/pdf/$TOFILE
1809 Save it in your local LyX directory—say,
1810 \begin_inset Flex Code
1813 \begin_layout Plain Layout
1814 /home/you/.lyx/scripts/pdfcopier.sh
1819 —and make it executable, if you need to do so on your platform.
1821 \begin_inset Flex MenuItem
1824 \begin_layout Plain Layout
1825 Tools\SpecialChar \menuseparator
1831 dialog, select under
1832 \begin_inset Flex MenuItem
1835 \begin_layout Plain Layout
1836 File Handling\SpecialChar \menuseparator
1843 \begin_inset Flex MenuItem
1846 \begin_layout Plain Layout
1852 format—or one of the other pdf formats—and enter
1853 \begin_inset Flex Code
1856 \begin_layout Plain Layout
1857 pdfcopier.sh $$i $$o
1863 \begin_inset Flex MenuItem
1866 \begin_layout Plain Layout
1876 \begin_layout Standard
1877 Copiers are used by LyX in various of its own conversions.
1878 For example, if appropriate programs are found, LyX will automatically
1879 install copiers for the
1880 \begin_inset Flex MenuItem
1883 \begin_layout Plain Layout
1890 \begin_inset Flex MenuItem
1893 \begin_layout Plain Layout
1895 \begin_inset space ~
1904 When these formats are exported, the copier sees that not just the main
1905 HTML file but various associated files (style files, images, etc.) are also
1907 All these files are written to a subdirectory of the directory in which
1908 the original LyX file was found.
1912 \begin_layout Plain Layout
1913 This copier can be customized.
1915 \begin_inset Quotes eld
1919 \begin_inset Quotes erd
1922 argument takes a comma-separated list of extensions to be copied; if it
1923 is omitted, all files will be copied.
1925 \begin_inset Quotes eld
1929 \begin_inset Quotes erd
1932 argument determines the extension added to the generated directory.
1934 \begin_inset Quotes eld
1938 \begin_inset Flex MenuItem
1941 \begin_layout Plain Layout
1948 \begin_inset Quotes erd
1951 , so HTML generated from
1952 \begin_inset Flex MenuItem
1955 \begin_layout Plain Layout
1956 /path/to/filename.lyx
1962 \begin_inset Flex MenuItem
1965 \begin_layout Plain Layout
1966 /path/to/filename.html.LyXconv
1980 \begin_layout Section
1982 \begin_inset CommandInset label
1984 name "sec:Converters"
1991 \begin_layout Standard
1992 You can define your own Converters to convert files between different formats.
1994 \begin_inset Flex MenuItem
1997 \begin_layout Plain Layout
1998 Tools\SpecialChar \menuseparator
1999 Preferences\SpecialChar \menuseparator
2000 File Handling\SpecialChar \menuseparator
2009 \begin_layout Standard
2010 To define a new converter, select the
2011 \begin_inset Flex MenuItem
2014 \begin_layout Plain Layout
2016 \begin_inset space ~
2025 \begin_inset Flex MenuItem
2028 \begin_layout Plain Layout
2030 \begin_inset space ~
2038 from the drop-down lists, enter the command needed for the conversion,
2040 \begin_inset Flex MenuItem
2043 \begin_layout Plain Layout
2050 Several variables can be used in the definition of converters:
2053 \begin_layout Labeling
2054 \labelwidthstring 00.00.0000
2055 \begin_inset Flex Code
2058 \begin_layout Plain Layout
2064 The LyX system directory
2067 \begin_layout Labeling
2068 \labelwidthstring 00.00.0000
2069 \begin_inset Flex Code
2072 \begin_layout Plain Layout
2081 \begin_layout Labeling
2082 \labelwidthstring 00.00.0000
2083 \begin_inset Flex Code
2086 \begin_layout Plain Layout
2095 \begin_layout Labeling
2096 \labelwidthstring 00.00.0000
2097 \begin_inset Flex Code
2100 \begin_layout Plain Layout
2106 The base filename of the input file (i.
2107 \begin_inset space \thinspace{}
2110 g., without the extension)
2113 \begin_layout Labeling
2114 \labelwidthstring 00.00.0000
2115 \begin_inset Flex Code
2118 \begin_layout Plain Layout
2124 The path to the input file
2127 \begin_layout Labeling
2128 \labelwidthstring 00.00.0000
2129 \begin_inset Flex Code
2132 \begin_layout Plain Layout
2138 The path to the original input file (this is different from $$p when a
2139 chain of converters is called)
2142 \begin_layout Labeling
2143 \labelwidthstring 00.00.0000
2144 \begin_inset Flex Code
2147 \begin_layout Plain Layout
2153 The iconv name for the encoding of the document.
2156 \begin_layout Standard
2158 \begin_inset Flex MenuItem
2161 \begin_layout Plain Layout
2163 \begin_inset space ~
2171 field you can enter the following flags, separated by commas:
2174 \begin_layout Labeling
2175 \labelwidthstring 00.00.0000
2176 \begin_inset Flex Code
2179 \begin_layout Plain Layout
2185 This converter runs some form of LaTeX.
2186 This will make LyX's LaTeX error logs available.
2189 \begin_layout Labeling
2190 \labelwidthstring 00.00.0000
2191 \begin_inset Flex Code
2194 \begin_layout Plain Layout
2201 \begin_inset Flex MenuItem
2204 \begin_layout Plain Layout
2210 file for the conversion.
2213 \begin_layout Labeling
2214 \labelwidthstring 00.00.0000
2215 \begin_inset Flex Code
2218 \begin_layout Plain Layout
2227 \begin_layout Standard
2228 The following three flags are not really flags at all because they take
2230 \begin_inset Flex MenuItem
2233 \begin_layout Plain Layout
2235 \begin_inset space ~
2239 \begin_inset space ~
2250 \begin_layout Labeling
2251 \labelwidthstring 00.00.0000
2252 \begin_inset Flex Code
2255 \begin_layout Plain Layout
2261 If set, the converter's standard error will be redirected to a file
2262 \begin_inset Flex Code
2265 \begin_layout Plain Layout
2271 , and the script given as argument will be run as:
2272 \begin_inset Flex Code
2275 \begin_layout Plain Layout
2276 script < infile.out > infile.log
2282 The argument may contain
2283 \begin_inset Flex Code
2286 \begin_layout Plain Layout
2295 \begin_layout Labeling
2296 \labelwidthstring 00.00.0000
2297 \begin_inset Flex Code
2300 \begin_layout Plain Layout
2306 The name of the directory in which the converter will dump the generated
2308 LyX will not create this directory, and it does not copy anything into
2309 it, though it will copy this directory to the destination.
2310 The argument may contain
2311 \begin_inset Flex Code
2314 \begin_layout Plain Layout
2320 , which will be replaced by the base name of the input and output files,
2321 respectively, when the directory is copied.
2322 \begin_inset Newline newline
2325 Note that resultdir and usetempdir make no sense together.
2326 The latter will be ignored if the former is given.
2329 \begin_layout Labeling
2330 \labelwidthstring 00.00.0000
2331 \begin_inset Flex Code
2334 \begin_layout Plain Layout
2340 Determines the output file name and may, contain
2341 \begin_inset Flex Code
2344 \begin_layout Plain Layout
2351 Sensible only with resultdir and optional even then; if not given, it defaults
2355 \begin_layout Standard
2356 None of these last three are presently used in any of the converters that
2357 are installed with LyX.
2361 \begin_layout Standard
2362 You do not have to define converters for all formats between which you want
2364 For example, you will note that there is no `LyX to PostScript' converter,
2365 but LyX will export PostScript.
2366 It does so by first creating a LaTeX file (no converter needs to be defined
2367 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2368 and finally converting the resulting DVI file to PostScript.
2369 LyX finds such `chains' of converters automatically, and it will always
2370 choose the shortest possible chain.
2371 You can, though, still define multiple conversion methods between file
2373 For example, the standard LyX configuration provides three ways to convert
2374 LaTeX to PDF: Directly, using
2375 \begin_inset Flex MenuItem
2378 \begin_layout Plain Layout
2384 ; via (DVI and) PostScript, using
2385 \begin_inset Flex MenuItem
2388 \begin_layout Plain Layout
2395 \begin_inset Flex MenuItem
2398 \begin_layout Plain Layout
2405 To define such alternate chains, you must define multiple target `file
2406 formats', as described in section
2407 \begin_inset CommandInset ref
2409 reference "sec:Formats"
2414 For example, in the standard configuration, the formats named
2415 \begin_inset Flex MenuItem
2418 \begin_layout Plain Layout
2425 \begin_inset Flex MenuItem
2428 \begin_layout Plain Layout
2435 \begin_inset Flex MenuItem
2438 \begin_layout Plain Layout
2444 are defined, all of which share the extension
2445 \begin_inset Flex MenuItem
2448 \begin_layout Plain Layout
2454 , and which correspond to the conversion methods just mentioned.
2457 \begin_layout Chapter
2458 Internationalizing LyX
2459 \begin_inset CommandInset label
2461 name "cha:Internationalizing-LyX"
2468 \begin_layout Standard
2469 LyX supports using a translated interface.
2470 Last time we checked, LyX provided text in thirty languages.
2471 The language of choice is called your
2476 (For further reading on locale settings, see also the documentation for
2477 locale that comes with your operating system.
2478 For Linux, the manual page for
2479 \begin_inset Flex Code
2482 \begin_layout Plain Layout
2488 could be a good place to start).
2491 \begin_layout Standard
2492 Notice that these translations will work, but do contain a few flaws.
2493 In particular, all dialogs have been designed with the English text in
2494 mind, which means that some of the translated text will be too large to
2495 fit within the space allocated.
2496 This is only a display problem and will not cause any harm.
2497 Also, you will find that some of the translations do not define shortcut
2498 keys for everything.
2499 Sometimes, there are simply not enough free letters to do it.
2500 Other times, the translator just hasn't got around to doing it yet.
2501 Our localization team, which you may wish to join,
2505 \begin_layout Plain Layout
2506 If you are a fluent speaker of a language other than English, joining these
2507 teams is a great way to give back to the LyX community!
2512 will of course try to fix these shortcomings in future versions of LyX.
2515 \begin_layout Section
2519 \begin_layout Subsection
2520 Translating the graphical user interface (text messages).
2523 \begin_layout Standard
2525 \begin_inset Flex Code
2528 \begin_layout Plain Layout
2534 library to handle the internationalization of the interface.
2535 To have LyX speak your favorite language in all menus and dialogs, you
2537 \begin_inset Flex Code
2540 \begin_layout Plain Layout
2546 -file for that language.
2547 When this is available, you'll have to generate a
2548 \begin_inset Flex Code
2551 \begin_layout Plain Layout
2557 -file from it and install the
2558 \begin_inset Flex Code
2561 \begin_layout Plain Layout
2568 The process of doing all of this is explained in the documentation for
2570 \begin_inset Flex Code
2573 \begin_layout Plain Layout
2580 It is possible to do this just for yourself, but if you're going to do
2581 it, you might as well share the results of your labors with the rest of
2583 Send a message to the LyX developers' list for more information about how
2587 \begin_layout Standard
2588 In short, this is what you should do (xx denotes the language code):
2591 \begin_layout Itemize
2592 Check out the LyX source code.
2594 \begin_inset CommandInset href
2596 name "information on the web"
2597 target "http://www.lyx.org/HowToUseSVN"
2604 \begin_layout Itemize
2606 \begin_inset Flex Code
2609 \begin_layout Plain Layout
2615 to the folder of the
2616 \begin_inset Flex Code
2619 \begin_layout Plain Layout
2627 \begin_inset Flex Code
2630 \begin_layout Plain Layout
2638 \begin_inset Flex Code
2641 \begin_layout Plain Layout
2647 doesn't exist anywhere, it can be remade with the console command
2648 \begin_inset Flex Code
2651 \begin_layout Plain Layout
2657 in that directory, or you can use an existing po-file for some other language
2661 \begin_layout Itemize
2663 \begin_inset Flex Code
2666 \begin_layout Plain Layout
2676 \begin_layout Plain Layout
2677 This is just a text file, so it can be edited in any text editor.
2678 But there are also specialized programs that support such editing, such
2683 (for all platforms) or
2692 contains a `mode' for editing
2693 \begin_inset Flex Code
2696 \begin_layout Plain Layout
2707 For some menu- and widget-labels, there are also shortcut keys that should
2709 Those keys are marked after a `|', and should be translated according to
2710 the words and phrases of the language.
2711 You should also fill also out the information at the beginning of the new
2713 \begin_inset Flex Code
2716 \begin_layout Plain Layout
2722 -file with your email-address, etc., so people know where to reach you with
2723 suggestions and entertaining flames.
2726 \begin_layout Standard
2727 If you are just doing this on your own, then:
2730 \begin_layout Itemize
2732 \begin_inset Flex Code
2735 \begin_layout Plain Layout
2742 This can be done with
2743 \begin_inset Flex Code
2746 \begin_layout Plain Layout
2747 msgfmt -o xx.mo < xx.po
2755 \begin_layout Itemize
2757 \begin_inset Flex Code
2760 \begin_layout Plain Layout
2766 -file to your locale-tree, at the correct directory for application messages
2771 xx, and under the name
2772 \begin_inset Flex Code
2775 \begin_layout Plain Layout
2782 \begin_inset space \thinspace{}
2786 \begin_inset space \space{}
2790 \begin_inset Flex Code
2793 \begin_layout Plain Layout
2794 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2804 \begin_layout Standard
2805 As said, however, it would be best if the new
2806 \begin_inset Flex Code
2809 \begin_layout Plain Layout
2815 -file could be added to the LyX distribution, so others can use it.
2816 Adding it involves making additional changes to LyX.
2817 So send an email to the developers' mailing list if you're interested in
2821 \begin_layout Subsubsection
2825 \begin_layout Standard
2826 Sometimes it turns out that one English message needs to be translated into
2827 different messages in the target language.
2828 One example is the message
2829 \begin_inset Flex Code
2832 \begin_layout Plain Layout
2838 which has the German translation
2846 , depending upon exactly what the English
2847 \begin_inset Quotes eld
2851 \begin_inset Quotes erd
2856 \begin_inset Flex Code
2859 \begin_layout Plain Layout
2865 does not handle such ambiguous translations.
2866 Therefore you have to add some context information to the message: Instead
2868 \begin_inset Flex Code
2871 \begin_layout Plain Layout
2878 \begin_inset Flex Code
2881 \begin_layout Plain Layout
2882 To[[as in 'From format x to format y']]
2888 \begin_inset Flex Code
2891 \begin_layout Plain Layout
2892 To[[as in 'From page x to page y']].
2897 Now the two occurrences of
2898 \begin_inset Flex Code
2901 \begin_layout Plain Layout
2908 \begin_inset Flex Code
2911 \begin_layout Plain Layout
2917 and can be translated correctly to
2928 \begin_layout Standard
2929 Of course the context information needs to be stripped off the original
2930 message when no translation is used.
2931 Therefore you have to put it in double square brackets at the end of the
2932 message (see the example above).
2933 The translation mechanism of LyX ensures that everything in double square
2934 brackets at the end of messages is removed before displaying the message.
2937 \begin_layout Subsection
2938 Translating the documentation.
2941 \begin_layout Standard
2942 The online documentation (in the
2943 \begin_inset Flex MenuItem
2946 \begin_layout Plain Layout
2952 -menu) can (and should!) be translated.
2953 If there are translated versions of the documentation available
2957 \begin_layout Plain Layout
2958 As of March 2008, at least some of the documents have been translated into
2959 fourteen languages, with the Tutorial available in a few more.
2964 and the locale is set accordingly, these will be used automagically by
2966 LyX looks for translated versions as
2967 \begin_inset Flex Code
2970 \begin_layout Plain Layout
2971 LyXDir/doc/xx/DocName.lyx
2977 \begin_inset Flex Code
2980 \begin_layout Plain Layout
2986 is the code for the language currently in use.
2987 If there are no translated documents, the default English versions will
2989 Note that the translated versions must have the same filenames (
2990 \begin_inset Flex Code
2993 \begin_layout Plain Layout
2999 above) as the original.
3000 If you feel up to translating the documentation (an excellent way to proof-read
3001 the original documentation by the way!), there are a few things you should
3005 \begin_layout Itemize
3006 Check out the documentation translation web page at
3007 \begin_inset CommandInset href
3009 name "http://www.lyx.org/Translation"
3010 target "http://www.lyx.org/Translation"
3015 That way, you can find out which (if any) documents have already been translate
3016 d into your language.
3017 You can also find out who (if anyone) is organizing the effort to translate
3018 the documentation into your language.
3019 If no one is organizing the effort, please let us know that you're interested.
3022 \begin_layout Standard
3023 Once you get to actually translating, here's a few hints for you that may
3027 \begin_layout Itemize
3028 Join the documentation team! There is information on how to do that in
3029 \begin_inset Flex Code
3032 \begin_layout Plain Layout
3039 \begin_inset Flex MenuItem
3042 \begin_layout Plain Layout
3043 Help\SpecialChar \menuseparator
3049 ), which by the way is the first document you should translate.
3052 \begin_layout Itemize
3053 Learn the typographic conventions for the language you are translating to.
3054 Typography is an ancient art and over the centuries, a great variety of
3055 conventions have developed throughout different parts of the world.
3056 Also study the professional terminology amongst typographers in your country.
3057 Inventing your own terminology will only confuse the users.
3060 (Warning! Typography is addictive!)
3063 \begin_layout Itemize
3064 Make a copy of the document.
3065 This will be your working copy.
3066 You can use this as your personal translated help-file by placing it in
3068 \begin_inset Flex Code
3071 \begin_layout Plain Layout
3080 \begin_layout Itemize
3081 Sometimes the original document (from the LyX-team) will be updated.
3082 Use the source viewer at
3083 \begin_inset CommandInset href
3085 name "http://www.lyx.org/trac/timeline"
3086 target "http://www.lyx.org/trac/timeline"
3090 to see what has been changed.
3091 That way you can easily see which parts of the translated document need
3095 \begin_layout Standard
3096 If you ever find an error in the original document, fix it and notify the
3097 rest of the documentation team of the changes! (You didn't forget to join
3098 the documentation team, did you?)
3101 \begin_layout Standard
3102 \begin_inset Branch OutDated
3105 \begin_layout Section
3106 International Keyboard Support
3109 \begin_layout Standard
3112 [Editor's Note: The following section is by
3120 It needs to be fixed to conform to the new Documentation Style sheet and
3121 to make use of the new v1.0 features.
3122 The whole thing also needs to be merged with the section following it.-jw
3123 It may also be badly out of date.-rh (2008)]
3126 \begin_layout Subsection
3127 Defining Own Keymaps: Keymap File Format
3130 \begin_layout Standard
3131 Let's look at a keyboard definition file a little closer.
3132 It is a plain text file defining
3135 \begin_layout Itemize
3136 key-to-key or key-to-string translations
3139 \begin_layout Itemize
3143 \begin_layout Itemize
3144 dead keys exceptions
3147 \begin_layout Standard
3148 To define key-to-key or key-to-string translation, use this command:
3151 \begin_layout Quotation
3152 \begin_inset Flex Code
3155 \begin_layout Plain Layout
3164 \begin_inset Flex Code
3167 \begin_layout Plain Layout
3176 \begin_layout Standard
3178 \begin_inset Flex Code
3181 \begin_layout Plain Layout
3187 is the key to be translated and
3188 \begin_inset Flex Code
3191 \begin_layout Plain Layout
3197 is the string to be inserted into the document.
3198 To define dead keys, use:
3201 \begin_layout Quotation
3202 \begin_inset Flex Code
3205 \begin_layout Plain Layout
3214 \begin_inset Flex Code
3217 \begin_layout Plain Layout
3226 \begin_layout Standard
3228 \begin_inset Flex Code
3231 \begin_layout Plain Layout
3237 is a keyboard key and
3238 \begin_inset Flex Code
3241 \begin_layout Plain Layout
3248 The following dead keys are supported (shortcut name is in parentheses):
3251 \begin_layout Quotation
3255 \begin_inset space \hfill{}
3261 \begin_layout Quotation
3263 \begin_inset space \hfill{}
3269 \begin_layout Quotation
3271 \begin_inset space \hfill{}
3277 \begin_layout Quotation
3279 \begin_inset space \hfill{}
3285 \begin_layout Quotation
3287 \begin_inset space \hfill{}
3293 \begin_layout Quotation
3295 \begin_inset space \hfill{}
3302 \begin_layout Plain Layout
3314 \begin_layout Quotation
3316 \begin_inset space \hfill{}
3322 \begin_layout Quotation
3324 \begin_inset space \hfill{}
3331 \begin_layout Plain Layout
3343 \begin_layout Quotation
3345 \begin_inset space \hfill{}
3351 \begin_layout Quotation
3353 \begin_inset space \hfill{}
3359 \begin_layout Quotation
3361 \begin_inset space \hfill{}
3368 \begin_layout Plain Layout
3380 \begin_layout Quotation
3382 \begin_inset space \hfill{}
3389 \begin_layout Plain Layout
3401 \begin_layout Quotation
3403 \begin_inset space \hfill{}
3409 \begin_layout Quotation
3410 hungarian umlaut (hug)
3411 \begin_inset space \hfill{}
3417 \begin_layout Quotation
3419 \begin_inset space \hfill{}
3425 \begin_layout Quotation
3427 \begin_inset space \hfill{}
3434 \begin_layout Plain Layout
3446 \begin_layout Standard
3447 Since in many international keyboards there are exceptions to what some
3448 dead keys should do, you can define them using
3451 \begin_layout Quotation
3452 \begin_inset Flex Code
3455 \begin_layout Plain Layout
3463 deadkey key outstring
3466 \begin_layout Standard
3467 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3471 \begin_layout Quotation
3472 \begin_inset Flex Code
3475 \begin_layout Plain Layout
3488 \begin_layout Standard
3489 to make it work correctly.
3490 Also, you have to define as exceptions dead keys over i and j, to remove
3491 the dot from them before inserting an accent mark.
3492 I will change this when the time comes, but so far I haven't had time.
3495 \begin_layout Standard
3496 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3499 \begin_inset Flex Code
3502 \begin_layout Plain Layout
3508 have different meaning.
3510 \begin_inset Flex Code
3513 \begin_layout Plain Layout
3519 marks comments, quotes start and end LaTeX-style commands.
3520 To enter quote, you'll need to use
3521 \begin_inset Flex Code
3524 \begin_layout Plain Layout
3533 \begin_inset Flex Code
3536 \begin_layout Plain Layout
3543 \begin_inset Flex Code
3546 \begin_layout Plain Layout
3557 \begin_layout Standard
3558 If you make a keyboard description file that works for your language, please
3559 mail it to me, so I can include it in the next keymap distribution.
3562 \begin_layout Standard
3563 More keywords will be supported in keymap configuration file in future,
3567 \begin_layout Itemize
3568 \begin_inset Flex Code
3571 \begin_layout Plain Layout
3582 \begin_inset space \hfill{}
3586 \begin_inset Flex Code
3589 \begin_layout Plain Layout
3598 \begin_layout Itemize
3599 \begin_inset Flex Code
3602 \begin_layout Plain Layout
3613 \begin_inset space \hfill{}
3617 \begin_inset Flex Code
3620 \begin_layout Plain Layout
3626 an external keymap translation program
3629 \begin_layout Standard
3630 Also, it should look into
3631 \begin_inset Flex Code
3634 \begin_layout Plain Layout
3640 file for defaults, too (for example, a
3641 \begin_inset Flex Code
3644 \begin_layout Plain Layout
3652 option to include default keyboard).
3660 \begin_layout Section
3661 International Keymap Stuff
3662 \begin_inset CommandInset label
3664 name "sec:International-Keymap-Stuff"
3671 \begin_layout Standard
3672 \begin_inset Note Note
3675 \begin_layout Plain Layout
3676 In doing the revisions on this document in March 2008, I did not look over
3677 this stuff, as I do not understand it.
3678 It would be good if someone else could do so.
3687 \begin_layout Standard
3688 The next two sections describe the
3689 \begin_inset Flex Code
3692 \begin_layout Plain Layout
3701 \begin_inset Flex Code
3704 \begin_layout Plain Layout
3712 file syntax in detail.
3713 These sections should help you design your own key map if the ones provided
3714 do not meet your needs.
3717 \begin_layout Subsection
3721 \begin_layout Standard
3725 \begin_inset Flex Code
3728 \begin_layout Plain Layout
3734 file maps keystrokes to characters or strings.
3735 As the name suggests, it sets a keyboard mapping.
3737 \begin_inset Flex Code
3740 \begin_layout Plain Layout
3751 \begin_inset Flex Code
3754 \begin_layout Plain Layout
3769 \begin_inset Flex Code
3772 \begin_layout Plain Layout
3785 \begin_inset Flex Code
3788 \begin_layout Plain Layout
3797 \begin_inset Flex Code
3800 \begin_layout Plain Layout
3808 are described in this section.
3811 \begin_layout Labeling
3812 \labelwidthstring 00.00.0000
3813 \begin_inset Flex Code
3816 \begin_layout Plain Layout
3824 Map a character to a string
3827 \begin_layout LyX-Code
3842 \begin_layout Standard
3875 the double-quote (")
3892 must be escaped with a preceding backslash (
3903 \begin_layout Standard
3905 \begin_inset Flex MenuItem
3908 \begin_layout Plain Layout
3916 statement to cause the symbol
3917 \begin_inset Flex MenuItem
3920 \begin_layout Plain Layout
3928 to be output for the keystroke
3929 \begin_inset Flex MenuItem
3932 \begin_layout Plain Layout
3943 \begin_layout LyX-Code
3949 \begin_layout Labeling
3950 \labelwidthstring 00.00.0000
3951 \begin_inset Flex Code
3954 \begin_layout Plain Layout
3962 Specify an accent character
3965 \begin_layout LyX-Code
3974 \begin_layout Standard
3975 This will make the cha
4013 This is the dead key
4017 \begin_layout Plain Layout
4024 refers to a key that does not produce a character by itself, but when followed
4025 with another key, produces the desired accent character.
4026 For example, a German characte
4028 r with an umlaut like
4038 can be produced in this manner.
4047 \begin_layout Standard
4060 and then another key not in
4077 followed by the other, not allowed key, as output.
4081 \begin_inset Flex MenuItem
4084 \begin_layout Plain Layout
4092 cancels a dead key, so if
4103 \begin_inset Flex MenuItem
4106 \begin_layout Plain Layout
4115 , the cursor will not go one position backwards but will instead cancel
4131 might have had on the next keystroke.
4135 \begin_layout Standard
4136 The following example specifies that the character ' is to be an acute accent,
4137 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4140 \begin_layout LyX-Code
4143 kmod ' acute aeiouAEIOU
4146 \begin_layout Labeling
4147 \labelwidthstring 00.00.0000
4148 \begin_inset Flex Code
4151 \begin_layout Plain Layout
4157 Specify an exception to the accent character
4160 \begin_layout LyX-Code
4169 \begin_layout Standard
4170 This defines an exce
4211 have been assigned a keystroke with a previous
4214 \begin_inset Flex Code
4217 \begin_layout Plain Layout
4241 must not belong in the
4288 If such a declaration does not exist in
4296 \begin_inset Flex Code
4299 \begin_layout Plain Layout
4333 \begin_inset Flex Code
4336 \begin_layout Plain Layout
4350 \begin_layout Standard
4351 The following command produces causes äi to be produced when you enter acute-i
4355 \begin_layout LyX-Code
4369 \begin_layout Labeling
4370 \labelwidthstring 00.00.0000
4371 \begin_inset Flex Code
4374 \begin_layout Plain Layout
4380 Combine two accent characters
4383 \begin_layout LyX-Code
4389 accent1 accent2 allowed
4392 \begin_layout Standard
4393 This one is getting pretty esoteric.
4394 It allows you to combine the effect
4450 \begin_inset Flex Code
4453 \begin_layout Plain Layout
4481 \begin_layout Standard
4482 Consider this example from the
4483 \begin_inset Flex Code
4486 \begin_layout Plain Layout
4497 \begin_layout LyX-Code
4500 kmod ; acute aeioyvhAEIOYVH
4504 kcomb acute umlaut iyIY
4507 \begin_layout Standard
4508 This allows you to press
4509 \begin_inset Flex MenuItem
4512 \begin_layout Plain Layout
4520 and get the effect of
4521 \begin_inset Flex Code
4524 \begin_layout Plain Layout
4543 in this case cancels the last dead key, so if you press
4544 \begin_inset Flex MenuItem
4547 \begin_layout Plain Layout
4556 \begin_inset Flex Code
4559 \begin_layout Plain Layout
4572 \begin_layout Subsection
4576 \begin_layout Standard
4578 \begin_inset Flex Code
4581 \begin_layout Plain Layout
4589 mapping is performed, a
4590 \begin_inset Flex Code
4593 \begin_layout Plain Layout
4603 file maps the strings that the symbols generate to characters in the current
4605 The LyX distribution currently includes at least the
4606 \begin_inset Flex Code
4609 \begin_layout Plain Layout
4618 \begin_inset Flex Code
4621 \begin_layout Plain Layout
4632 \begin_layout Standard
4634 \begin_inset Flex Code
4637 \begin_layout Plain Layout
4645 file is a sequence of declarations of the form
4648 \begin_layout LyX-Code
4661 \begin_layout Standard
4662 For example, in order to map
4663 \begin_inset Flex MenuItem
4666 \begin_layout Plain Layout
4676 to the corresponding character in the iso-8859-1 set (233), the following
4680 \begin_layout LyX-Code
4688 \begin_layout Standard
4690 \begin_inset Flex Code
4693 \begin_layout Plain Layout
4702 \begin_inset Flex Code
4705 \begin_layout Plain Layout
4723 the same character can apply to more than one string.
4725 \begin_inset Flex Code
4728 \begin_layout Plain Layout
4739 \begin_layout LyX-Code
4751 \begin_inset Newline newline
4767 \begin_layout Standard
4768 If LyX cannot find a mapping for the string produced by the keystroke or
4769 a deadkey sequence, it will check if it looks like an accented char and
4770 try to draw an accent over the character on screen.
4773 \begin_layout Subsection
4777 \begin_layout Standard
4778 There is a second way to add support for international characters through
4779 so-called dead-keys.
4780 A dead-key works in combination with a letter to produce an accented character.
4781 Here, we'll explain how to create a really simple dead-key to illustrate
4785 \begin_layout Standard
4786 Suppose you happen to need the circumflex character,
4787 \begin_inset Quotes eld
4791 \begin_inset Quotes erd
4796 \begin_inset Flex MenuItem
4799 \begin_layout Plain Layout
4806 \begin_inset space ~
4810 \begin_inset Flex MenuItem
4813 \begin_layout Plain Layout
4819 ] to the LyX command
4820 \begin_inset Flex Code
4823 \begin_layout Plain Layout
4830 \begin_inset Flex Code
4833 \begin_layout Plain Layout
4840 Now, whenever you type the
4841 \begin_inset Flex MenuItem
4844 \begin_layout Plain Layout
4850 -key followed by a letter, that letter will have a circumflex accent on
4852 For example, the sequence
4853 \begin_inset Quotes eld
4857 \begin_inset Flex MenuItem
4860 \begin_layout Plain Layout
4867 \begin_inset Quotes erd
4870 produces the letter:
4871 \begin_inset Quotes eld
4875 \begin_inset Quotes erd
4879 If you tried to type
4880 \begin_inset Quotes eld
4884 \begin_inset Flex MenuItem
4887 \begin_layout Plain Layout
4894 \begin_inset Quotes erd
4897 , however, LyX will complain with a beep, since a
4898 \begin_inset Quotes eld
4902 \begin_inset Flex MenuItem
4905 \begin_layout Plain Layout
4912 \begin_inset Quotes erd
4915 never takes a circumflex accent.
4917 \begin_inset Flex MenuItem
4920 \begin_layout Plain Layout
4926 after a dead-key produces the bare-accent.
4927 Please note this last point! If you bind a key to a dead-key, you'll need
4928 to rebind the character on that key to yet another key.
4930 \begin_inset Flex MenuItem
4933 \begin_layout Plain Layout
4939 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4942 \begin_layout Standard
4943 One common way to bind dead-keys is to use
4944 \begin_inset Flex MenuItem
4947 \begin_layout Plain Layout
4954 \begin_inset Flex MenuItem
4957 \begin_layout Plain Layout
4964 \begin_inset Flex MenuItem
4967 \begin_layout Plain Layout
4973 in combination with an accent, like
4974 \begin_inset Quotes eld
4978 \begin_inset Flex MenuItem
4981 \begin_layout Plain Layout
4988 \begin_inset Quotes erd
4992 \begin_inset Quotes eld
4996 \begin_inset Flex MenuItem
4999 \begin_layout Plain Layout
5006 \begin_inset Quotes erd
5010 \begin_inset Quotes eld
5014 \begin_inset Flex MenuItem
5017 \begin_layout Plain Layout
5024 \begin_inset Quotes erd
5028 Another way involves using
5029 \begin_inset Flex Code
5032 \begin_layout Plain Layout
5039 \begin_inset Flex Code
5042 \begin_layout Plain Layout
5048 to set up the special
5049 \begin_inset Flex Code
5052 \begin_layout Plain Layout
5060 \begin_inset Flex Code
5063 \begin_layout Plain Layout
5069 acts in some ways just like
5070 \begin_inset Flex MenuItem
5073 \begin_layout Plain Layout
5079 and permits you to bind keys to accented characters.
5080 You can also turn keys into dead-keys by binding them to something like
5082 \begin_inset Flex Code
5085 \begin_layout Plain Layout
5091 and then binding this symbolic key to the corresponding LyX command.
5095 \begin_layout Plain Layout
5100 : This is exactly what I do in my
5101 \begin_inset Flex Code
5104 \begin_layout Plain Layout
5111 \begin_inset Flex Code
5114 \begin_layout Plain Layout
5122 \begin_inset Flex MenuItem
5125 \begin_layout Plain Layout
5127 \begin_inset space ~
5136 \begin_inset Flex Code
5139 \begin_layout Plain Layout
5145 and a bunch of these
5146 \begin_inset Quotes eld
5150 \begin_inset Flex Code
5153 \begin_layout Plain Layout
5160 \begin_inset Quotes erd
5163 symbolic keys bound such things as
5164 \begin_inset Flex MenuItem
5167 \begin_layout Plain Layout
5169 \begin_inset space ~
5178 \begin_inset Flex MenuItem
5181 \begin_layout Plain Layout
5183 \begin_inset space ~
5192 This is how I produce my accented characters.
5197 You can make just about anything into the
5198 \begin_inset Flex Code
5201 \begin_layout Plain Layout
5208 \begin_inset Flex MenuItem
5211 \begin_layout Plain Layout
5217 keys, a spare function key, etc.
5218 As for the LyX commands that produce accents, check the entry for
5219 \begin_inset Flex Code
5222 \begin_layout Plain Layout
5233 You'll find the complete list there.
5236 \begin_layout Subsection
5237 Saving your Language Configuration
5240 \begin_layout Standard
5241 You can edit your preferences so that your desired language environment
5242 is automatically configured when LyX starts up, via the
5243 \begin_inset Flex MenuItem
5246 \begin_layout Plain Layout
5247 Edit\SpecialChar \menuseparator
5256 \begin_layout Chapter
5257 Installing New Document Classes, Layouts, and Templates
5258 \begin_inset CommandInset label
5260 name "cha:Installing-New-Document"
5265 \begin_inset Argument
5268 \begin_layout Plain Layout
5269 Installing New Document Classes
5277 \begin_layout Standard
5278 In this chapter, we describe the procedures for creating and installing
5279 new LyX layout and template files, as well as offer a refresher on correctly
5280 installing new LaTeX document classes.
5284 \begin_layout Standard
5285 First, let us a say a few words about how one ought to think about the relation
5286 between LyX and LaTeX.
5287 The thing to understand is that, in a certain sense, LyX doesn't know anything
5289 Indeed, from LyX's point of view, LaTeX is just one of several
5290 \begin_inset Quotes eld
5294 \begin_inset Quotes erd
5297 in which it is capable of producing output.
5298 Other such formats are DocBook, plaintext, and XHTML.
5299 LaTeX is, of course, a particularly important format, but very little of
5300 the information LyX has about LaTeX is actually contained in the program
5305 \begin_layout Plain Layout
5306 Some commands are sufficiently complex that they are
5307 \begin_inset Quotes eld
5311 \begin_inset Quotes erd
5315 But the developers generally regard this as a Bad Thing.
5320 Rather, that information, even for the standard classes like
5321 \begin_inset Flex Code
5324 \begin_layout Plain Layout
5330 , is contained in `layout files'.
5331 Similarly, LyX itself does not know much about DocBook or XHTML.
5332 What it knows is contained in layout files.
5335 \begin_layout Standard
5336 You can think of the layout file for a given document class as a translation
5337 manual between LyX constructs---paragraphs with their corresponding styles,
5338 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5340 Almost everything LyX knows about
5341 \begin_inset Flex Code
5344 \begin_layout Plain Layout
5350 , for example, is contained in the file
5351 \begin_inset Flex Code
5354 \begin_layout Plain Layout
5360 and in various other files it includes.
5361 For this reason, anyone intending to write layout files should plan to
5362 study the existing files.
5363 A good place to start is with
5364 \begin_inset Flex Code
5367 \begin_layout Plain Layout
5373 , which is included in
5374 \begin_inset Flex Code
5377 \begin_layout Plain Layout
5384 \begin_inset Flex Code
5387 \begin_layout Plain Layout
5393 , and many of the other layout files for document classes.
5394 This file is where sections and the like are defined:
5395 \begin_inset Flex Code
5398 \begin_layout Plain Layout
5404 tells LyX how paragraphs that are marked with the Section, Subsection,
5405 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5408 \begin_inset Flex Code
5411 \begin_layout Plain Layout
5417 file basically just includes several of these
5418 \begin_inset Flex Code
5421 \begin_layout Plain Layout
5430 \begin_layout Standard
5431 Defining the LyX--LaTeX correspondence is not the only thing layout files
5433 Their other job is to define how the LyX constructs themselves will appear
5435 The fact that layout files have these two jobs is often a source of confusion,
5436 because they are completely separate.
5437 Telling LyX how to translate a certain paragraph style into LaTeX does
5438 not tell LyX how to display it; conversely, telling LyX how to display
5439 a certain paragraph style does not tell LyX how to translate it into LaTeX
5440 (let alone tell LaTeX how to display it).
5441 So, in general, when you define a new LyX construct, you must always do
5442 two quite separate things: (i)
5443 \begin_inset space ~
5446 tell LyX how to translate it into LaTeX and (ii)
5447 \begin_inset space ~
5450 tell LyX how to display it.
5453 \begin_layout Standard
5454 Much the same is true, of course, as regards LyX's other backend formats,
5455 though XHTML is in some ways different, because in that case LyX
5459 able, to some extent, to use information about how it should display a
5460 paragraph on the screen to output information (in the form of CSS) about
5461 how the paragraph should be displayed in a browser.
5462 Even in this case, however, the distinction between what LyX does internally
5463 and how things are rendered externally remains in force, and the two can
5464 be controlled separately.
5466 \begin_inset CommandInset ref
5468 reference "sec:Tags-for-XHTML"
5475 \begin_layout Section
5476 Installing new LaTeX files
5479 \begin_layout Standard
5480 Some installations may not include a LaTeX package or class file that you
5481 would like to use within LyX.
5482 For example, you might need FoilTeX, a package for preparing slides for
5483 overhead projectors.
5484 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5485 a user interface for installing such packages.
5486 For example, with MiKTeX, you start the program
5487 \begin_inset Quotes eld
5491 \begin_inset space ~
5495 \begin_inset Quotes erd
5498 to get a list of available packages.
5499 To install one of them, right click on it or use the corresponding toolbar
5503 \begin_layout Standard
5504 If your LaTeX distribution does not provide such a `package manager', or
5505 if the package is not available from your distribution, then follow these
5506 steps to install it manually:
5509 \begin_layout Enumerate
5510 Get the package from
5511 \begin_inset CommandInset href
5514 target "http://www.ctan.org/"
5521 \begin_layout Enumerate
5522 If the package contains a file with the ending
5523 \begin_inset Quotes eld
5527 \begin_inset Flex Code
5530 \begin_layout Plain Layout
5537 \begin_inset Quotes erd
5540 (is the case for FoilTeX) then open a console, change to the folder of
5541 this file and execute the command
5542 \begin_inset Flex Code
5545 \begin_layout Plain Layout
5552 You have now unpacked the package and have all files to install it.
5553 Most LaTeX-packages are not packed and you can skip this step.
5556 \begin_layout Enumerate
5557 Now you need to decide if the package should be available for all users
5562 \begin_layout Enumerate
5563 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5564 for all users on your system, then install it in your `local' TeX tree,
5565 otherwise install it in your own `user' TeX tree.
5566 Where these trees should be created, if they do not already exist, depends
5568 To find this out, look in the file
5569 \begin_inset Flex Code
5572 \begin_layout Plain Layout
5582 \begin_layout Plain Layout
5583 This is usually in the directory
5584 \begin_inset Flex Code
5587 \begin_layout Plain Layout
5593 , though you can execute the command
5594 \begin_inset Flex Code
5597 \begin_layout Plain Layout
5608 The location of the `local' TeX tree is defined by the
5609 \begin_inset Flex Code
5612 \begin_layout Plain Layout
5618 variable; this is usually somewhere like
5619 \begin_inset Flex Code
5622 \begin_layout Plain Layout
5623 /usr/local/share/texmf
5629 The location of the `user' TeX tree is defined by
5630 \begin_inset Flex Code
5633 \begin_layout Plain Layout
5640 \begin_inset Flex Code
5643 \begin_layout Plain Layout
5650 (If these variables are not predefined, you have to define them.) You'll
5651 probably need root permissions to create or modify the `local' tree, but
5652 not for your `user' tree.
5653 \begin_inset Newline newline
5656 In general, it is recommended to install in the user tree because your user
5657 will not be modified or even overwritten when you upgrade your system.
5658 It will typically also be backed up together with everything else when
5659 you backup your home directory (which, of course, you do on a regular basis).
5662 \begin_layout Enumerate
5663 On Windows, if you want the new package to be available for all users on
5664 your system, change to the folder where LaTeX is installed and then change
5666 \begin_inset Flex Code
5669 \begin_layout Plain Layout
5680 (For MiKTeX, this would be by default the folder
5681 \begin_inset Flex Code
5684 \begin_layout Plain Layout
5702 \begin_layout Plain Layout
5703 Note that this will be the correct path only on English installations.
5704 On a German one, it would be
5705 \begin_inset Flex Code
5708 \begin_layout Plain Layout
5722 , and similarly for other languages.
5727 Create there a new folder
5728 \begin_inset Flex Code
5731 \begin_layout Plain Layout
5737 and copy all files of the package into it.
5739 \begin_inset Newline newline
5742 If the package should only available for you or you don't have admin permissions
5743 , do the same, but in the local LaTeX folder.
5745 \begin_inset space \thinspace{}
5749 \begin_inset space ~
5752 2.8 under Windows XP, this would be the folder:
5753 \begin_inset Newline newline
5759 \begin_inset Flex Code
5762 \begin_layout Plain Layout
5765 Documents and Settings
5777 \begin_inset Newline newline
5783 \begin_inset Phantom HPhantom
5786 \begin_layout Plain Layout
5797 \begin_inset Flex Code
5800 \begin_layout Plain Layout
5813 \begin_inset Newline newline
5816 On Vista, it would be:
5817 \begin_inset Newline newline
5821 \begin_inset Flex Code
5824 \begin_layout Plain Layout
5850 \begin_layout Enumerate
5851 Now one only need to tell LaTeX that there are new files.
5852 This depends on the used LaTeX-Distribution:
5856 \begin_layout Enumerate
5857 For TeXLive execute the command
5858 \begin_inset Flex Code
5861 \begin_layout Plain Layout
5868 If you installed the package for all users, then you will probably need
5869 to have root permissions for that.
5872 \begin_layout Enumerate
5873 For MiKTeX, if you have installed the package for all users, start the program
5875 \begin_inset Quotes eld
5879 \begin_inset space ~
5883 \begin_inset Quotes erd
5886 and press the button marked
5887 \begin_inset Quotes eld
5891 \begin_inset Quotes erd
5895 Otherwise start the program
5896 \begin_inset Quotes eld
5900 \begin_inset Quotes erd
5907 \begin_layout Enumerate
5908 Finally, you need to tell LyX that there are new packages available.
5909 So, in LyX, use the menu
5910 \begin_inset Flex MenuItem
5913 \begin_layout Plain Layout
5916 \SpecialChar \menuseparator
5922 and then restart LyX.
5925 \begin_layout Standard
5926 Now the package is installed.
5927 In our example, the document class
5928 \begin_inset Flex Code
5931 \begin_layout Plain Layout
5933 \begin_inset space ~
5940 \begin_layout Plain Layout
5952 will now be available under
5953 \begin_inset Flex MenuItem
5956 \begin_layout Plain Layout
5957 Document\SpecialChar \menuseparator
5958 Settings\SpecialChar \menuseparator
5968 \begin_layout Standard
5969 If you would like to use a LaTeX document class that is not even listed
5971 \begin_inset Flex MenuItem
5974 \begin_layout Plain Layout
5975 Document\SpecialChar \menuseparator
5976 Settings\SpecialChar \menuseparator
5982 , then you need to create a `layout' file for it.
5983 That is the topic of the next section.
5986 \begin_layout Section
5987 Types of layout files
5990 \begin_layout Standard
5991 This section describes the various sorts of LyX files that contain layout
5993 These files describe various paragraph and character styles, determining
5994 how LyX should display them and how they should be translated into LaTeX,
5995 DocBook, XHTML, or whatever output format is being used.
5999 \begin_layout Standard
6000 We shall try to provide a thorough description of the process of writing
6002 However, there are so many different types of documents supported even
6003 by just LaTeX that we can't hope to cover every different possibility or
6004 problem you might encounter.
6005 The LyX users' list is frequented by people with lots of experience with
6006 layout design who are willing to share what they've learned, so please
6007 feel free to ask questions there.
6010 \begin_layout Standard
6011 As you prepare to write a new layout, it is extremely helpful to look at
6012 the layouts distributed with LyX.
6013 If you write a LyX layout for a LaTeX document class that might also be
6014 used by others, or write a module that might be useful to others, then
6015 you should consider posting your layout to the
6016 \begin_inset CommandInset href
6018 name "layout section on the LyX wiki"
6019 target "http://wiki.lyx.org/Layouts/Layouts"
6023 or even to the LyX developers' list, so that it might be included in LyX
6028 \begin_layout Plain Layout
6029 Note that LyX is licensed under the General Public License, so any material
6030 that is contributed to LyX must be similarly licensed.
6038 \begin_layout Subsection
6040 \begin_inset CommandInset label
6042 name "sub:Layout-modules"
6049 \begin_layout Standard
6050 We have spoken to this point about `layout files'.
6051 But there are different sorts of files that contain layout information.
6052 Layout files, strictly so called, have the
6053 \begin_inset Flex Code
6056 \begin_layout Plain Layout
6062 extension and provide LyX with information about document classes.
6063 As of LyX 1.6, however, layout information can also be contained in layout
6069 \begin_inset Flex Code
6072 \begin_layout Plain Layout
6079 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6080 some modules—such as the
6081 \begin_inset Flex Code
6084 \begin_layout Plain Layout
6090 module—specifically provide support for one package.
6091 In a sense, layout modules are similar to included
6095 \begin_layout Plain Layout
6096 These can have any extension, but by convention have the
6097 \begin_inset Flex Code
6100 \begin_layout Plain Layout
6112 \begin_inset Flex Code
6115 \begin_layout Plain Layout
6121 —in that modules are not specific to a given document class but may be used
6122 with many different classes.
6123 The difference is that using an included file with
6124 \begin_inset Flex Code
6127 \begin_layout Plain Layout
6133 requires editing that file.
6134 Modules, by contrast, are selected in the
6135 \begin_inset Flex MenuItem
6138 \begin_layout Plain Layout
6139 Document\SpecialChar \menuseparator
6148 \begin_layout Standard
6149 Building modules is the easiest way to get started with layout editing,
6150 since it can be as simple as adding a single new paragraph style or flex
6152 But modules may, in principle, contain anything a layout file can contain.
6155 \begin_layout Standard
6156 After creating a new module and copying it to the
6157 \begin_inset Flex Code
6160 \begin_layout Plain Layout
6166 folder, you will need to reconfigure and then restart LyX for the module
6167 to appear in the menu.
6168 However, changes you make to the module will be seen immediately, if you
6170 \begin_inset Flex MenuItem
6173 \begin_layout Plain Layout
6174 Document\SpecialChar \menuseparator
6180 , highlight something, and then hit
6181 \begin_inset Quotes eld
6185 \begin_inset Quotes erd
6191 It is strongly recommended that you save your work before doing this
6196 it is strongly recommended that you not attempt to edit modules while simultaneo
6197 usly working on actual documents
6200 Though of course the developers strive to keep LyX stable in such situations,
6201 syntax errors and the like in your module file could cause strange behavior.
6204 \begin_layout Subsubsection
6208 \begin_layout Standard
6209 Modules are to LyX as packages are to LaTeX.
6210 Sometimes, however, you find yourself wanting a specific inset or character
6211 style just for one document and writing a module that will also be available
6212 to other documents makes little sense.
6213 What you need is LyX's
6214 \begin_inset Quotes eld
6218 \begin_inset Quotes erd
6224 \begin_layout Standard
6225 You will find it under
6227 Document\SpecialChar \menuseparator
6228 Settings\SpecialChar \menuseparator
6232 The large text box allows you to enter anything that you might enter in
6233 a layout file or module.
6234 You can think of a document's local layout, in fact, as a module that belongs
6236 So, in particular, you must enter a
6237 \begin_inset Flex Code
6240 \begin_layout Plain Layout
6247 Any format is acceptable, but one would normally use the format current
6249 (In LyX 2.0, the current layout format is 35.) You should be aware that local
6250 layout is not supported by versions of LyX prior to 1.6, so you should not
6251 use it if you want to be able to export your document to LyX 1.5 or earlier
6252 (without, that is, losing the local layout information).
6253 If you wish to be able to export to 1.6---local layout is supported in 1.6,
6254 though there is no UI for it---then you should use format 11 and, of course,
6255 use only layout constructs that were available in LyX 1.6.
6258 \begin_layout Standard
6259 When you have entered something in the
6260 \begin_inset Flex Code
6263 \begin_layout Plain Layout
6269 pane, LyX will enable the
6270 \begin_inset Quotes eld
6274 \begin_inset Quotes erd
6277 button at the bottom.
6278 Clicking this button will cause LyX to determine whether what you have
6279 entered is valid layout information for the chosen format.
6280 LyX will report the result but, unfortunately, will not tell you what errors
6281 there might have been.
6282 These will be written to the terminal, however, if LyX is started from
6284 You will not be permitted to save your local layout until you have entered
6288 \begin_layout Standard
6289 The warnings at the end of the previous section apply here, too.
6290 Do not play with local layout while you are actually working, especially
6291 if you have not saved your document.
6292 That said, using local layout with a test document can be a very convenient
6293 way to try out layout ideas, or even to start developing a module.
6296 \begin_layout Subsection
6298 \begin_inset Flex MenuItem
6301 \begin_layout Plain Layout
6310 \begin_layout Standard
6311 There are two situations you are likely to encounter when wanting to support
6312 a new LaTeX document class, involving style (
6313 \begin_inset Flex Code
6316 \begin_layout Plain Layout
6322 ) files and LaTeX2e class (
6323 \begin_inset Flex Code
6326 \begin_layout Plain Layout
6333 Supporting a style file is usually fairly easy.
6334 Supporting a new class file is a bit harder.
6335 We'll discuss the former in this section and the latter in the next.
6336 Similar remarks apply, of course, if you want to support a new DocBook
6340 \begin_layout Standard
6341 The easier case is the one in which your new document class is provided
6342 as a style file that is to be used in conjunction with an already supported
6344 For the sake of the example, we'll assume that the style file is called
6346 \begin_inset Flex MenuItem
6349 \begin_layout Plain Layout
6355 and that it is meant to be used with
6356 \begin_inset Flex MenuItem
6359 \begin_layout Plain Layout
6365 , which is a standard class.
6369 \begin_layout Standard
6370 Start by copying the existing class's layout file into your local directory:
6374 \begin_layout Plain Layout
6375 Of course, which directory is your local directory will vary by platform,
6376 and LyX allows you to specify your local directory on startup, too, using
6378 \begin_inset Flex Code
6381 \begin_layout Plain Layout
6395 \begin_layout LyX-Code
6396 cp report.layout ~/.lyx/layouts/myclass.layout
6399 \begin_layout Standard
6401 \begin_inset Flex Code
6404 \begin_layout Plain Layout
6410 and change the line:
6413 \begin_layout LyX-Code
6416 DeclareLaTeXClass{report}
6419 \begin_layout Standard
6423 \begin_layout LyX-Code
6426 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6429 \begin_layout Standard
6433 \begin_layout LyX-Code
6435 \begin_inset Newline newline
6441 \begin_inset Newline newline
6447 \begin_layout Standard
6448 near the top of the file.
6451 \begin_layout Standard
6452 Start LyX and select
6453 \begin_inset Flex MenuItem
6456 \begin_layout Plain Layout
6457 Tools\SpecialChar \menuseparator
6464 Then restart LyX and try creating a new document.
6466 \begin_inset Flex MenuItem
6469 \begin_layout Plain Layout
6475 " as a document class option in the
6476 \begin_inset Flex MenuItem
6479 \begin_layout Plain Layout
6480 Document\SpecialChar \menuseparator
6487 It is likely that some of the sectioning commands and such in your new
6488 class will work differently from how they worked in the base class—
6489 \begin_inset Flex Code
6492 \begin_layout Plain Layout
6498 in this example—so you can fiddle around with the settings for the different
6499 sections if you wish.
6500 The layout information for sections is contained in
6501 \begin_inset Flex Code
6504 \begin_layout Plain Layout
6510 , but you do not need to copy and change this file.
6511 Instead, you can simply add your changes to your layout file, after the
6513 \begin_inset Flex Code
6516 \begin_layout Plain Layout
6522 , which itself includes
6523 \begin_inset Flex Code
6526 \begin_layout Plain Layout
6533 For example, you might add these lines:
6536 \begin_layout LyX-Code
6540 \begin_layout LyX-Code
6544 \begin_layout LyX-Code
6548 \begin_layout LyX-Code
6552 \begin_layout LyX-Code
6556 \begin_layout Standard
6557 to change the font for chapter headings to sans-serif.
6558 This will override (or, in this case, add to) the existing declaration
6559 for the Chapter style.
6563 \begin_layout Standard
6564 Your new package may also provide commands or environments not present in
6566 In this case, you will want to add these to the layout file.
6568 \begin_inset CommandInset ref
6570 reference "sec:TextClass"
6574 for information on how to do so.
6577 \begin_layout Standard
6579 \begin_inset Flex MenuItem
6582 \begin_layout Plain Layout
6588 can be used with several different document classes, and even if it cannot,
6589 you might find it easiest just to write a module that you can load with
6591 The simplest possible such module would be:
6594 \begin_layout LyX-Code
6597 DeclareLyXModule{My Package}
6600 \begin_layout LyX-Code
6604 \begin_layout LyX-Code
6605 #Support for mypkg.sty.
6608 \begin_layout LyX-Code
6610 \begin_inset Newline newline
6616 \begin_layout LyX-Code
6618 \begin_inset Newline newline
6624 \begin_layout LyX-Code
6626 \begin_inset Newline newline
6632 \begin_inset Newline newline
6638 \begin_layout Standard
6639 A more complex module might modify the behavior of some existing constructs
6640 or define some new ones.
6642 \begin_inset CommandInset ref
6644 reference "sec:TextClass"
6651 \begin_layout Subsection
6653 \begin_inset Flex MenuItem
6656 \begin_layout Plain Layout
6665 \begin_layout Standard
6666 There are two possibilities here.
6667 One is that the class file is itself based upon an existing document class.
6668 For example, many thesis classes are based upon
6669 \begin_inset Flex MenuItem
6672 \begin_layout Plain Layout
6679 To see whether yours is, look for a line like
6682 \begin_layout LyX-Code
6688 \begin_layout Standard
6690 If so, then you may proceed largely as in the previous section, though
6692 \begin_inset Flex Code
6695 \begin_layout Plain Layout
6701 line will be different.
6702 If your new class is
6703 \begin_inset Flex Code
6706 \begin_layout Plain Layout
6712 and it is based upon
6713 \begin_inset Flex Code
6716 \begin_layout Plain Layout
6722 , then the line should read:
6726 \begin_layout Plain Layout
6727 And it will be easiest if you save the file to
6728 \begin_inset Flex Code
6731 \begin_layout Plain Layout
6737 : LyX assumes that the document class has the same name as the layout file.
6746 \begin_layout LyX-Code
6749 DeclareLaTeXClass[thesis,book]{thesis}
6752 \begin_layout Standard
6753 If, on the other hand, the new class is not based upon an existing class,
6754 you will probably have to
6755 \begin_inset Quotes eld
6759 \begin_inset Quotes erd
6763 We strongly suggest copying an existing layout file which uses a similar
6764 LaTeX class and then modifying it, if you can do so.
6765 At least use an existing file as a starting point so you can find out what
6766 items you need to worry about.
6767 Again, the specifics are covered below.
6770 \begin_layout Subsection
6772 \begin_inset CommandInset label
6774 name "sub:Creating-Templates"
6781 \begin_layout Standard
6782 Once you have written a layout file for a new document class, you might
6783 want to consider writing a
6788 A template acts as a kind of tutorial for your layout, showing how it might
6789 be used, though containing dummy content.
6790 You can of course look at the various templates included with LyX for ideas.
6793 \begin_layout Standard
6794 Templates are created just like usual documents: using LyX.
6795 The only difference is that usual documents contain all possible settings,
6796 including the font scheme and the paper size.
6797 Usually a user doesn't want a template to overwrite his preferred settings
6798 for such parameters.
6799 For that reason, the designer of a template should remove the corresponding
6801 \begin_inset Flex Code
6804 \begin_layout Plain Layout
6813 \begin_inset Flex Code
6816 \begin_layout Plain Layout
6824 from the template LyX file.
6825 This can be done with any simple text-editor, for example
6826 \begin_inset Flex Code
6829 \begin_layout Plain Layout
6836 \begin_inset Flex Code
6839 \begin_layout Plain Layout
6849 \begin_layout Standard
6850 Put the edited template files you create in
6851 \begin_inset Flex Code
6854 \begin_layout Plain Layout
6860 , copy the ones you use from the global template directory in
6861 \begin_inset Flex Code
6864 \begin_layout Plain Layout
6870 to the same place, and redefine the template path in the
6871 \begin_inset Flex MenuItem
6874 \begin_layout Plain Layout
6875 Tools\SpecialChar \menuseparator
6876 Preferences\SpecialChar \menuseparator
6885 \begin_layout Standard
6886 Note, by the way, that there is a template which has a particular meaning:
6888 \begin_inset Flex Code
6891 \begin_layout Plain Layout
6898 This template is loaded every time you create a new document with
6899 \begin_inset Flex MenuItem
6902 \begin_layout Plain Layout
6903 File\SpecialChar \menuseparator
6909 in order to provide useful defaults.
6910 To create this template from inside LyX, all you have to do is to open
6911 a document with the correct settings, and use the
6912 \begin_inset Flex MenuItem
6915 \begin_layout Plain Layout
6916 Save as Document Defaults
6924 \begin_layout Subsection
6925 Upgrading old layout files
6928 \begin_layout Standard
6929 The format of layout files changes with each LyX release, so old layout
6930 files need to be converted to the new format.
6931 This process has been automated since LyX 1.4: If LyX reads a layout file
6932 in an older format, it automatically calls the script
6933 \begin_inset Flex Code
6936 \begin_layout Plain Layout
6942 to convert it to a temporary file in current format.
6943 The original file is left untouched.
6944 If you use the layout file often, then, you may want to convert it permanently,
6945 so that LyX does not have to do so itself every time.
6946 To do this, you can call the converter manually:
6949 \begin_layout LyX-Code
6950 mv myclass.layout myclass.old
6953 \begin_layout LyX-Code
6954 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6957 \begin_layout Standard
6959 \begin_inset Flex Code
6962 \begin_layout Plain Layout
6968 with the name of your LyX system directory, of course.
6971 \begin_layout Standard
6972 Note that manual conversion does not affect included files, so these will
6973 have to be converted separately.
6976 \begin_layout Section
6977 \begin_inset CommandInset label
6979 name "sec:TextClass"
6983 The layout file format
6986 \begin_layout Standard
6987 When it's finally time to get your hands dirty and create or edit your own
6988 layout file, the following sections describe what you're up against.
6989 Our advice is to go slowly, save and test often, listen to soothing music,
6990 and enjoy one or two of your favorite adult beverages; more if you are
6991 getting particularly stuck.
6992 It's really not that hard, except that the multitude of options can become
6993 overwhelming if you try to do too much in one sitting.
6994 Go have another adult beverage, just for good measure.
6997 \begin_layout Standard
6998 Note that all the tags used in layout files are case-insensitive.
7000 \begin_inset Flex Code
7003 \begin_layout Plain Layout
7010 \begin_inset Flex Code
7013 \begin_layout Plain Layout
7020 \begin_inset Flex Code
7023 \begin_layout Plain Layout
7029 are really the same tag.
7030 The possible values are printed in brackets after the feature's name.
7031 The default value if a feature isn't specified inside a text class-description
7033 \begin_inset Flex Code
7036 \begin_layout Plain Layout
7045 If the argument has a data type like
7046 \begin_inset Quotes eld
7050 \begin_inset Quotes erd
7054 \begin_inset Quotes eld
7058 \begin_inset Quotes erd
7061 , the default is shown like this:
7062 \begin_inset Flex Code
7065 \begin_layout Plain Layout
7076 \begin_layout Subsection
7077 The document class declaration
7080 \begin_layout Standard
7081 Lines in a layout file which begin with
7082 \begin_inset Flex Code
7085 \begin_layout Plain Layout
7092 There is one exception to this rule.
7094 \begin_inset Flex Code
7097 \begin_layout Plain Layout
7103 files should begin with a line like:
7106 \begin_layout LyX-Code
7109 #% Do not delete the line below; configure depends on this
7112 \begin_layout LyX-Code
7117 DeclareLaTeXClass{article}
7120 \begin_layout Standard
7121 The second line is used when you (re)configure LyX.
7122 The layout file is read by the LaTeX script
7123 \begin_inset Flex Code
7126 \begin_layout Plain Layout
7132 , in a special mode where
7133 \begin_inset Flex Code
7136 \begin_layout Plain Layout
7143 The first line is just a LaTeX comment, and the second one contains the
7144 declaration of the text class.
7145 If these lines appear in a file named
7146 \begin_inset Flex Code
7149 \begin_layout Plain Layout
7155 , then they define a text class of name
7156 \begin_inset Flex Code
7159 \begin_layout Plain Layout
7165 (the name of the layout file) which uses the LaTeX document class
7166 \begin_inset Flex Code
7169 \begin_layout Plain Layout
7175 (the default is to use the same name as the layout).
7177 \begin_inset Quotes eld
7181 \begin_inset Quotes erd
7184 that appears above is used as a description of the text class in the
7185 \begin_inset Flex MenuItem
7188 \begin_layout Plain Layout
7189 Document\SpecialChar \menuseparator
7198 \begin_layout Standard
7199 Let's assume that you wrote your own text class that uses the
7200 \begin_inset Flex Code
7203 \begin_layout Plain Layout
7209 document class, but where you changed the appearance of the section headings.
7210 If you put it in a file
7211 \begin_inset Flex Code
7214 \begin_layout Plain Layout
7220 , the header of this file should be:
7223 \begin_layout LyX-Code
7226 #% Do not delete the line below; configure depends on this
7229 \begin_layout LyX-Code
7234 DeclareLaTeXClass[article]{article (with my own headings)}
7237 \begin_layout Standard
7238 This declares a text class
7239 \begin_inset Flex Code
7242 \begin_layout Plain Layout
7248 , associated with the LaTeX document class
7249 \begin_inset Flex Code
7252 \begin_layout Plain Layout
7259 \begin_inset Quotes eld
7262 article (with my own headings)
7263 \begin_inset Quotes erd
7267 If your text class depends on several packages, you can declare it as:
7270 \begin_layout LyX-Code
7273 #% Do not delete the line below; configure depends on this
7276 \begin_layout LyX-Code
7281 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7284 \begin_layout Standard
7285 This indicates that your text class uses the
7286 \begin_inset Flex Code
7289 \begin_layout Plain Layout
7296 Finally, it is also possible to declare classes for DocBook code.
7297 Typical declarations will look like:
7300 \begin_layout LyX-Code
7303 #% Do not delete the line below; configure depends on this
7306 \begin_layout LyX-Code
7311 DeclareDocBookClass[article]{SGML (DocBook article)}
7314 \begin_layout Standard
7315 Note that these declarations can also be given an optional parameter declaring
7316 the name of the document class (but not a list).
7319 \begin_layout Standard
7320 So, to be as explicit as possible, the form of the layout declaration is:
7323 \begin_layout LyX-Code
7328 DeclareLaTeXClass[class,package.sty]{layout description}
7331 \begin_layout Standard
7332 The class need only be specified if the name of the LaTeX class file and
7333 the name of the layout file are different or if there are packages to load.
7334 If the name of the class file is not specified, then LyX will simply assume
7335 that it is the same as the name of the layout file.
7338 \begin_layout Standard
7339 When the text class has been modified to your taste, all you have to do
7340 is to copy it either to
7341 \begin_inset Flex Code
7344 \begin_layout Plain Layout
7351 \begin_inset Flex Code
7354 \begin_layout Plain Layout
7361 \begin_inset Flex MenuItem
7364 \begin_layout Plain Layout
7365 Tools\SpecialChar \menuseparator
7371 , exit LyX and restart.
7372 Then your new text class should be available along with the others.
7375 \begin_layout Standard
7376 Once the layout file is installed, you can edit it and see your changes
7377 without having to reconfigure or to restart LyX.
7382 \begin_layout Plain Layout
7383 In versions of LyX prior to 1.6, this was not true.
7384 As a result, editing layout files was very time consuming, since you had
7385 constantly to restart LyX to see changes.
7390 You can force a reload of the current layout by using the LyX function
7392 \begin_inset Flex MenuItem
7395 \begin_layout Plain Layout
7402 There is no default binding for this function—though, of course, you can
7403 bind it to a key yourself.
7404 But you will normally use this function simply by entering it in the mini-buffe
7409 \begin_layout Standard
7415 \begin_inset Flex MenuItem
7418 \begin_layout Plain Layout
7424 is very much an `advanced feature'.
7429 recommended that you save your work before using this function.
7434 recommended that you not attempt to edit layout information while simultaneousl
7435 y working on a document that you care about.
7436 Use a test document.
7437 Syntax errors and the like in your layout file could cause peculiar behavior.
7438 In particular, such errors could cause LyX to regard the current layout
7439 as invalid and to attempt to switch to some other layout.
7443 \begin_layout Plain Layout
7444 Really bad syntax errors may even caused LyX to exit.
7445 This is because certain sorts of errors may make LyX unable to read
7455 The LyX team strives to keep LyX stable in such situations, but safe is
7460 \begin_layout Plain Layout
7461 While we're giving advice: make regular backups.
7462 And be nice to your mother.
7470 \begin_layout Subsection
7471 The Module declaration
7474 \begin_layout Standard
7475 A module must begin with a line like the following:
7478 \begin_layout LyX-Code
7481 DeclareLyXModule[endnotes.sty]{Endnotes}
7484 \begin_layout Standard
7485 The mandatory argument, in curly brackets, is the name of the module, as
7487 \begin_inset Flex MenuItem
7490 \begin_layout Plain Layout
7491 Document\SpecialChar \menuseparator
7492 Settings\SpecialChar \menuseparator
7499 The argument in square brackets is optional: It declares any LaTeX packages
7500 on which the module depends.
7501 Please note that only packages about which LyX knows should be listed in
7502 the square brackets.
7506 \begin_layout Plain Layout
7507 The list of such packages is documented only in the source code.
7512 LyX will not check for arbitrary packages.
7513 It is also possible to use the form
7514 \begin_inset Flex MenuItem
7517 \begin_layout Plain Layout
7523 as an optional argument, which declares that the module can only be used
7524 when there exists a conversion chain between the formats `
7525 \begin_inset Flex Code
7528 \begin_layout Plain Layout
7535 \begin_inset Flex Code
7538 \begin_layout Plain Layout
7547 \begin_layout Standard
7548 The module declaration should then be followed by lines like the following
7552 \begin_layout Plain Layout
7553 Preferably in English if the module should be published with LyX.
7554 This description will appear in the list of messages to be translated and
7555 will be thus translated with the next interface update.
7563 \begin_layout LyX-Code
7567 \begin_layout LyX-Code
7568 #Adds an endnote command, in addition to footnotes.
7572 \begin_layout LyX-Code
7573 #You will need to add
7575 theendnotes in TeX code where you
7578 \begin_layout LyX-Code
7579 #want the endnotes to appear.
7583 \begin_layout LyX-Code
7587 \begin_layout LyX-Code
7588 #Requires: somemodule | othermodule
7591 \begin_layout LyX-Code
7592 #Excludes: badmodule
7595 \begin_layout Standard
7596 The description is used in
7597 \begin_inset Flex MenuItem
7600 \begin_layout Plain Layout
7601 Document\SpecialChar \menuseparator
7602 Settings\SpecialChar \menuseparator
7608 to provide the user with information about what the module does.
7610 \begin_inset Flex Code
7613 \begin_layout Plain Layout
7619 line is used to identify other modules with which this one must be used;
7621 \begin_inset Flex Code
7624 \begin_layout Plain Layout
7630 line is used to identify modules with which this one may not be used.
7631 Both are optional, and, as shown, multiple modules should be separated
7632 with the pipe symbol: |.
7633 Note that the required modules are treated disjunctively:
7637 of the required modules must be used.
7642 excluded module may be used.
7643 Note that modules are identified here by their
7648 \begin_inset Flex Code
7651 \begin_layout Plain Layout
7659 \begin_inset Flex Code
7662 \begin_layout Plain Layout
7669 \begin_inset Flex Code
7672 \begin_layout Plain Layout
7681 \begin_layout Subsection
7685 \begin_layout Standard
7686 The first non-comment line of any layout file, included file, or module
7691 contain the file format number:
7694 \begin_layout Description
7695 \begin_inset Flex Code
7698 \begin_layout Plain Layout
7705 \begin_inset Flex Code
7708 \begin_layout Plain Layout
7714 ] The format of the layout file.
7717 \begin_layout Standard
7718 This tag was introduced with LyX 1.4.0.
7719 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7720 and are considered to be of format 1.
7721 The format for the present version of LyX is format 21.
7722 But each version of LyX is capable of reading earlier versions' layout
7723 files, just as they are capable of reading files produced by earlier versions
7725 There is, however, no provision for converting to earlier formats.
7726 So LyX 1.6.x will not read layout files in format 21 but only files in format
7730 \begin_layout Subsection
7731 \begin_inset CommandInset label
7733 name "sub:General-text-class"
7737 General text class parameters
7740 \begin_layout Standard
7741 These are general parameters that govern the behavior of an entire document
7747 mean that they must appear in
7748 \begin_inset Flex Code
7751 \begin_layout Plain Layout
7757 files rather than in modules.
7758 A module can contain any layout tag.)
7761 \begin_layout Description
7762 \begin_inset Flex Code
7765 \begin_layout Plain Layout
7771 Adds information that will be output in the
7772 \begin_inset Flex Code
7775 \begin_layout Plain Layout
7781 block when this document class is output to XHTML.
7782 Typically, this would be used to output CSS style information, but it can
7783 be used for anything that can appear in
7784 \begin_inset Flex Code
7787 \begin_layout Plain Layout
7795 \begin_inset Quotes eld
7799 \begin_inset Flex Code
7802 \begin_layout Plain Layout
7809 \begin_inset Quotes erd
7815 \begin_layout Description
7816 \begin_inset Flex Code
7819 \begin_layout Plain Layout
7825 Adds CSS styling information.
7826 This will either be output in a
7827 \begin_inset Quotes eld
7831 \begin_inset Flex Code
7834 \begin_layout Plain Layout
7841 \begin_inset Quotes erd
7844 block or, if the user has so chosen, to a separate CSS file.Must end with
7846 \begin_inset Quotes eld
7850 \begin_inset Flex Code
7853 \begin_layout Plain Layout
7860 \begin_inset Quotes erd
7866 \begin_layout Description
7867 \begin_inset Flex Code
7870 \begin_layout Plain Layout
7876 Adds information to the document preamble.
7878 \begin_inset Quotes eld
7882 \begin_inset Flex Code
7885 \begin_layout Plain Layout
7892 \begin_inset Quotes erd
7898 \begin_layout Description
7899 \begin_inset Flex Code
7902 \begin_layout Plain Layout
7908 Defines formats for use in the display of bibliographic information.
7910 \begin_inset CommandInset ref
7912 reference "sub:Citation-format-description"
7918 \begin_inset Quotes eld
7922 \begin_inset Flex Code
7925 \begin_layout Plain Layout
7932 \begin_inset Quotes erd
7938 \begin_layout Description
7939 \begin_inset Flex Code
7942 \begin_layout Plain Layout
7948 Describes various global options supported by the document class.
7950 \begin_inset space ~
7954 \begin_inset CommandInset ref
7956 reference "sub:ClassOptions"
7962 \begin_inset Quotes eld
7966 \begin_inset Flex Code
7969 \begin_layout Plain Layout
7976 \begin_inset Quotes erd
7982 \begin_layout Description
7983 \begin_inset Flex Code
7986 \begin_layout Plain Layout
7993 \begin_inset Flex Code
7996 \begin_layout Plain Layout
8005 \begin_inset Flex Code
8008 \begin_layout Plain Layout
8014 ] Whether the class should
8018 to having one or two columns.
8019 Can be changed in the
8020 \begin_inset Flex MenuItem
8023 \begin_layout Plain Layout
8024 Document\SpecialChar \menuseparator
8033 \begin_layout Description
8034 \begin_inset Flex Code
8037 \begin_layout Plain Layout
8044 \begin_inset Flex Code
8047 \begin_layout Plain Layout
8053 ] This sequence defines the properties for a counter.
8054 If the counter does not yet exist, it is created; if it does exist, it
8057 \begin_inset Quotes eld
8061 \begin_inset Flex Code
8064 \begin_layout Plain Layout
8071 \begin_inset Quotes erd
8075 \begin_inset Newline newline
8079 \begin_inset space ~
8083 \begin_inset CommandInset ref
8085 reference "sub:Counters"
8089 for details on counters.
8092 \begin_layout Description
8093 \begin_inset Flex Code
8096 \begin_layout Plain Layout
8102 Sets the default font used to display the document.
8104 \begin_inset space ~
8108 \begin_inset CommandInset ref
8110 reference "sub:Font-description"
8114 for how to declare fonts.
8116 \begin_inset Quotes eld
8120 \begin_inset Flex Code
8123 \begin_layout Plain Layout
8130 \begin_inset Quotes erd
8136 \begin_layout Description
8137 \begin_inset Flex Code
8140 \begin_layout Plain Layout
8147 \begin_inset Flex Code
8150 \begin_layout Plain Layout
8156 Specifies a module to be included by default with this document class.
8157 The module should be specified by filename without the
8158 \begin_inset Flex Code
8161 \begin_layout Plain Layout
8168 The user can still remove the module, but it will be active at the outset.
8169 (This applies only when new files are created, or when this class is chosen
8170 for an existing document.)
8173 \begin_layout Description
8174 \begin_inset Flex Code
8177 \begin_layout Plain Layout
8184 \begin_inset Flex Code
8187 \begin_layout Plain Layout
8193 ] This is the style that will be assigned to new paragraphs, usually
8194 \begin_inset Flex MenuItem
8197 \begin_layout Plain Layout
8204 This will default to the first defined style if not given, but you are
8205 encouraged to use this directive.
8208 \begin_layout Description
8209 \begin_inset Flex Code
8212 \begin_layout Plain Layout
8219 \begin_inset Flex Code
8222 \begin_layout Plain Layout
8228 ] This tag indicates that the module in question—which should be specified
8229 by filename without the
8230 \begin_inset Flex Code
8233 \begin_layout Plain Layout
8239 extension—cannot be used with this document class.
8240 This might be used in a journal-specific layout file to prevent, say, the
8242 \begin_inset Flex Code
8245 \begin_layout Plain Layout
8251 module that numbers theorems by section.
8256 be used in a module.
8257 Modules have their own way of excluding other modules (see
8258 \begin_inset CommandInset ref
8260 reference "sub:Layout-modules"
8267 \begin_layout Description
8268 \begin_inset Flex Code
8271 \begin_layout Plain Layout
8277 Defines a new float.
8279 \begin_inset space ~
8283 \begin_inset CommandInset ref
8285 reference "sub:Floats"
8291 \begin_inset Quotes eld
8295 \begin_inset Flex Code
8298 \begin_layout Plain Layout
8305 \begin_inset Quotes erd
8311 \begin_layout Description
8312 \begin_inset Flex Code
8315 \begin_layout Plain Layout
8321 Sets the information that will be output in the
8322 \begin_inset Flex Code
8325 \begin_layout Plain Layout
8331 block when this document class is output to XHTML.
8332 Note that this will completely override any prior
8333 \begin_inset Flex Code
8336 \begin_layout Plain Layout
8343 \begin_inset Flex Code
8346 \begin_layout Plain Layout
8354 \begin_inset Flex Code
8357 \begin_layout Plain Layout
8363 if you just want to add material to the preamble.) Must end with
8364 \begin_inset Quotes eld
8368 \begin_inset Flex Code
8371 \begin_layout Plain Layout
8378 \begin_inset Quotes erd
8384 \begin_layout Description
8385 \begin_inset Flex Code
8388 \begin_layout Plain Layout
8394 Sets CSS styling information.
8395 This will either be output in a
8396 \begin_inset Quotes eld
8400 \begin_inset Flex Code
8403 \begin_layout Plain Layout
8410 \begin_inset Quotes erd
8413 block or, if the user has so chosen, to a separate CSS file.
8414 Note that this will completely override any prior
8415 \begin_inset Flex Code
8418 \begin_layout Plain Layout
8425 \begin_inset Flex Code
8428 \begin_layout Plain Layout
8436 \begin_inset Flex Code
8439 \begin_layout Plain Layout
8445 if you just want to add material.) Must end with
8446 \begin_inset Quotes eld
8450 \begin_inset Flex Code
8453 \begin_layout Plain Layout
8460 \begin_inset Quotes erd
8466 \begin_layout Description
8467 \begin_inset Flex Code
8470 \begin_layout Plain Layout
8477 \begin_inset Flex Code
8480 \begin_layout Plain Layout
8486 ] The layout to use for the table of contents, bibliography, and so forth,
8487 when the document is output to HTML.
8488 For articles, this should normally be Section; for books, Chapter.
8489 If it is not given, then LyX will attempt to figure out which layout to
8493 \begin_layout Description
8494 \begin_inset Flex Code
8497 \begin_layout Plain Layout
8504 \begin_inset Flex Code
8507 \begin_layout Plain Layout
8513 ] Modifies the properties of the given counter.
8514 If the counter does not exist, the section is ignored.
8516 \begin_inset Quotes eld
8520 \begin_inset Flex Code
8523 \begin_layout Plain Layout
8530 \begin_inset Quotes erd
8534 \begin_inset Newline newline
8538 \begin_inset space ~
8542 \begin_inset CommandInset ref
8544 reference "sub:Counters"
8548 for details on counters.
8551 \begin_layout Description
8552 \begin_inset Flex Code
8555 \begin_layout Plain Layout
8562 \begin_inset Flex Code
8565 \begin_layout Plain Layout
8571 ] Modifies the properties of the given paragraph style.
8572 If the style does not exist, the section is ignored.
8574 \begin_inset Quotes eld
8578 \begin_inset Flex Code
8581 \begin_layout Plain Layout
8588 \begin_inset Quotes erd
8594 \begin_layout Description
8595 \begin_inset Flex Code
8598 \begin_layout Plain Layout
8604 As its name implies, this command allows you to include another layout
8605 definition file within yours to avoid duplicating commands.
8606 Common examples are the standard layout files, for example,
8607 \begin_inset Flex Code
8610 \begin_layout Plain Layout
8616 , which contains most of the basic layouts.
8619 \begin_layout Description
8620 \begin_inset Flex Code
8623 \begin_layout Plain Layout
8629 This section (re-)defines the layout of an inset.
8630 It can be applied to an existing inset or to a new, user-defined inset,
8631 e.g., a new character style.
8633 \begin_inset Quotes eld
8637 \begin_inset Flex Code
8640 \begin_layout Plain Layout
8647 \begin_inset Quotes erd
8651 \begin_inset Newline newline
8655 \begin_inset space ~
8659 \begin_inset CommandInset ref
8661 reference "sub:Flex-insets-and"
8665 for more information.
8669 \begin_layout Description
8670 \begin_inset Flex Code
8673 \begin_layout Plain Layout
8680 \begin_inset Flex Code
8683 \begin_layout Plain Layout
8689 ] A string that indicates the width of the left margin on the screen, for
8691 \begin_inset Quotes eld
8695 \begin_inset Quotes erd
8699 (Note that this is not a `length', like
8700 \begin_inset Quotes eld
8704 \begin_inset Quotes erd
8710 \begin_layout Description
8711 \begin_inset Flex Code
8714 \begin_layout Plain Layout
8721 \begin_inset Flex Code
8724 \begin_layout Plain Layout
8730 ] This command deletes an existing counter, usually one defined in an included
8734 \begin_layout Description
8735 \begin_inset Flex Code
8738 \begin_layout Plain Layout
8744 This command deletes an existing float.
8745 This is particularly useful when you want to suppress a float that has
8746 been defined in an input file.
8749 \begin_layout Description
8750 \begin_inset Flex Code
8753 \begin_layout Plain Layout
8759 This command deletes an existing style.
8760 This is particularly useful when you want to suppress a style that has
8761 be defined in an input file.
8764 \begin_layout Description
8765 \begin_inset Flex Code
8768 \begin_layout Plain Layout
8774 A string indicating the file format (as defined in the Preferences dialog)
8775 produced by this class.
8776 It is mainly useful when
8777 \begin_inset Flex Code
8780 \begin_layout Plain Layout
8786 is `literate' and one wants to define a new type of literate document.
8787 This string is reset to `docbook', `latex', or `literate' when the correspondin
8789 \begin_inset Flex Code
8792 \begin_layout Plain Layout
8798 parameter is encountered.
8801 \begin_layout Description
8802 \begin_inset Flex Code
8805 \begin_layout Plain Layout
8811 A string indicating what sort of output documents using this class will
8813 At present, the options are: `docbook', `latex', and `literate'.
8816 \begin_layout Description
8817 \begin_inset Flex Code
8820 \begin_layout Plain Layout
8827 \begin_inset Flex Code
8830 \begin_layout Plain Layout
8839 \begin_inset Flex Code
8842 \begin_layout Plain Layout
8849 \begin_inset Flex Code
8852 \begin_layout Plain Layout
8858 ] The default pagestyle.
8859 Can be changed in the
8860 \begin_inset Flex MenuItem
8863 \begin_layout Plain Layout
8864 Document\SpecialChar \menuseparator
8873 \begin_layout Description
8874 \begin_inset Flex Code
8877 \begin_layout Plain Layout
8883 Sets the preamble for the LaTeX document.
8884 Note that this will completely override any prior
8885 \begin_inset Flex Code
8888 \begin_layout Plain Layout
8895 \begin_inset Flex Code
8898 \begin_layout Plain Layout
8906 \begin_inset Flex Code
8909 \begin_layout Plain Layout
8915 if you just want to add material to the preamble.) Must end with
8916 \begin_inset Quotes eld
8920 \begin_inset Flex Code
8923 \begin_layout Plain Layout
8930 \begin_inset Quotes erd
8936 \begin_layout Description
8937 \begin_inset Flex Code
8940 \begin_layout Plain Layout
8947 \begin_inset Flex Code
8950 \begin_layout Plain Layout
8957 \begin_inset Flex Code
8960 \begin_layout Plain Layout
8969 \begin_inset Flex Code
8972 \begin_layout Plain Layout
8978 ] Whether the class already provides the feature
8979 \begin_inset Flex Code
8982 \begin_layout Plain Layout
8989 A feature is in general the name of a package (
8990 \begin_inset Flex Code
8993 \begin_layout Plain Layout
9000 \begin_inset Flex Code
9003 \begin_layout Plain Layout
9009 , \SpecialChar \ldots{}
9011 \begin_inset Flex Code
9014 \begin_layout Plain Layout
9021 \begin_inset Flex Code
9024 \begin_layout Plain Layout
9030 ,\SpecialChar \ldots{}
9031 ); the complete list of supported features is unfortunately not documented
9032 outside the LyX source code—but see
9033 \begin_inset Flex Code
9036 \begin_layout Plain Layout
9042 if you're interested.
9044 \begin_inset Flex MenuItem
9047 \begin_layout Plain Layout
9048 Help\SpecialChar \menuseparator
9054 also gives an overview of the supported packages.
9057 \begin_layout Description
9058 \begin_inset Flex Code
9061 \begin_layout Plain Layout
9068 \begin_inset Flex Code
9071 \begin_layout Plain Layout
9077 ] Indicates that this layout provides the functionality of the module mentioned,
9078 which should be specified by the filename without the
9079 \begin_inset Flex Code
9082 \begin_layout Plain Layout
9089 This will typically be used if the layout includes the module directly,
9090 rather than using the
9091 \begin_inset Flex Code
9094 \begin_layout Plain Layout
9100 tag to indicate that it ought to be used.
9101 It could also be used in a module that provided an alternate implementation
9102 of the same functionality.
9105 \begin_layout Description
9106 \begin_inset Flex Code
9109 \begin_layout Plain Layout
9116 \begin_inset Flex Code
9119 \begin_layout Plain Layout
9125 ] Whether the class requires the feature
9126 \begin_inset Flex Code
9129 \begin_layout Plain Layout
9136 Multiple features must be separated by commas.
9137 Note that you can only request supported features.
9139 \begin_inset Flex Code
9142 \begin_layout Plain Layout
9148 for a list of these.)
9151 \begin_layout Description
9152 \begin_inset Flex Code
9155 \begin_layout Plain Layout
9161 A string that indicates the width of the right margin on the screen, for
9163 \begin_inset Quotes eld
9167 \begin_inset Quotes erd
9173 \begin_layout Description
9174 \begin_inset Flex Code
9177 \begin_layout Plain Layout
9183 Sets which divisions get numbered.
9185 \begin_inset Flex Code
9188 \begin_layout Plain Layout
9197 \begin_layout Description
9198 \begin_inset Flex Code
9201 \begin_layout Plain Layout
9208 \begin_inset Flex Code
9211 \begin_layout Plain Layout
9220 \begin_inset Flex Code
9223 \begin_layout Plain Layout
9229 ] Whether the class-default should be printing on one or both sides of the
9231 Can be changed in the
9232 \begin_inset Flex MenuItem
9235 \begin_layout Plain Layout
9236 Document\SpecialChar \menuseparator
9245 \begin_layout Description
9246 \begin_inset Flex Code
9249 \begin_layout Plain Layout
9255 This sequence defines a paragraph style.
9256 If the style does not yet exist, it is created; if it does exist, its parameter
9259 \begin_inset Quotes eld
9263 \begin_inset Flex Code
9266 \begin_layout Plain Layout
9273 \begin_inset Quotes erd
9277 \begin_inset Newline newline
9281 \begin_inset space ~
9285 \begin_inset CommandInset ref
9287 reference "sub:Paragraph-Styles"
9291 for details on paragraph styles.
9294 \begin_layout Description
9295 \begin_inset Flex Code
9298 \begin_layout Plain Layout
9305 \begin_inset Flex Code
9308 \begin_layout Plain Layout
9314 ] The name of the command or environment to be used with
9315 \begin_inset Flex Code
9318 \begin_layout Plain Layout
9327 \begin_layout Description
9328 \begin_inset Flex Code
9331 \begin_layout Plain Layout
9338 \begin_inset Flex Code
9341 \begin_layout Plain Layout
9350 \begin_inset Flex Code
9353 \begin_layout Plain Layout
9359 ] Indicates what kind of markup is used to define the title of a document.
9361 \begin_inset Flex Code
9364 \begin_layout Plain Layout
9370 means that the macro with name
9371 \begin_inset Flex Code
9374 \begin_layout Plain Layout
9380 will be inserted after the last layout which has
9381 \begin_inset Quotes eld
9385 \begin_inset Flex Code
9388 \begin_layout Plain Layout
9395 \begin_inset Quotes erd
9400 \begin_inset Flex Code
9403 \begin_layout Plain Layout
9409 corresponds to the case where the block of paragraphs which have
9410 \begin_inset Quotes eld
9414 \begin_inset Flex Code
9417 \begin_layout Plain Layout
9424 \begin_inset Quotes erd
9427 should be enclosed into the
9428 \begin_inset Flex Code
9431 \begin_layout Plain Layout
9440 \begin_layout Description
9441 \begin_inset Flex Code
9444 \begin_layout Plain Layout
9450 Sets which divisions are included in the table of contents.
9452 \begin_inset Flex Code
9455 \begin_layout Plain Layout
9464 \begin_layout Subsection
9465 \begin_inset Flex Code
9468 \begin_layout Plain Layout
9475 \begin_inset CommandInset label
9477 name "sub:ClassOptions"
9484 \begin_layout Standard
9486 \begin_inset Flex Code
9489 \begin_layout Plain Layout
9495 section can contain the following entries:
9498 \begin_layout Description
9499 \begin_inset Flex Code
9502 \begin_layout Plain Layout
9509 \begin_inset Flex Code
9512 \begin_layout Plain Layout
9518 ] The list of available font sizes for the document's main font, separated
9520 \begin_inset Quotes eld
9524 \begin_inset Flex Code
9527 \begin_layout Plain Layout
9534 \begin_inset Quotes erd
9540 \begin_layout Description
9541 \begin_inset Flex Code
9544 \begin_layout Plain Layout
9550 Used to set the DTD line with XML-based output classes.
9552 \begin_inset space \thinspace{}
9556 \begin_inset Quotes eld
9559 -//OASIS//DTD DocBook V4.2//EN
9560 \begin_inset Quotes erd
9566 \begin_layout Description
9567 \begin_inset Flex Code
9570 \begin_layout Plain Layout
9577 \begin_inset Flex Code
9580 \begin_layout Plain Layout
9581 string="empty|plain|headings|fancy"
9586 ] The list of available page styles, separated by
9587 \begin_inset Quotes eld
9591 \begin_inset Flex Code
9594 \begin_layout Plain Layout
9601 \begin_inset Quotes erd
9607 \begin_layout Description
9608 \begin_inset Flex Code
9611 \begin_layout Plain Layout
9618 \begin_inset Flex Code
9621 \begin_layout Plain Layout
9627 ] Some document class options, separated by a comma, that will be added
9628 to the optional part of the
9629 \begin_inset Flex Code
9632 \begin_layout Plain Layout
9643 \begin_layout Standard
9645 \begin_inset Flex Code
9648 \begin_layout Plain Layout
9654 section must end with
9655 \begin_inset Quotes eld
9659 \begin_inset Flex Code
9662 \begin_layout Plain Layout
9669 \begin_inset Quotes erd
9675 \begin_layout Subsection
9677 \begin_inset CommandInset label
9679 name "sub:Paragraph-Styles"
9686 \begin_layout Standard
9687 A paragraph style description looks like this:
9691 \begin_layout Plain Layout
9692 Note that this will either define a new style or modify an existing one.
9700 \begin_layout LyX-Code
9707 \begin_layout LyX-Code
9711 \begin_layout LyX-Code
9715 \begin_layout Standard
9716 where the following commands are allowed:
9719 \begin_layout Description
9720 \begin_inset Flex Code
9723 \begin_layout Plain Layout
9730 \begin_inset Flex Code
9733 \begin_layout Plain Layout
9738 , left, right, center
9743 ] Paragraph alignment.
9746 \begin_layout Description
9747 \begin_inset Flex Code
9750 \begin_layout Plain Layout
9757 \begin_inset Flex Code
9760 \begin_layout Plain Layout
9765 , left, right, center
9770 ] A comma separated list of permitted alignments.
9771 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9773 For example a right-aligned or centered enumeration isn't possible.)
9776 \begin_layout Description
9777 \begin_inset Flex Code
9780 \begin_layout Plain Layout
9786 Note that this will completely override any prior
9787 \begin_inset Flex Code
9790 \begin_layout Plain Layout
9796 declaration for this style.
9798 \begin_inset Quotes eld
9802 \begin_inset Flex Code
9805 \begin_layout Plain Layout
9812 \begin_inset Quotes erd
9817 \begin_inset CommandInset ref
9819 reference "sub:I18n"
9823 for details on its use.
9826 \begin_layout Description
9827 \begin_inset Flex Code
9830 \begin_layout Plain Layout
9837 \begin_inset Flex Code
9840 \begin_layout Plain Layout
9850 \begin_layout Plain Layout
9851 Note that a `float' here is a real number, such as: 1.5.
9856 The vertical space with which the last of a chain of paragraphs with this
9857 style is separated from the following paragraph.
9858 If the next paragraph has another style, the separations are not simply
9859 added, but the maximum is taken.
9862 \begin_layout Description
9863 \begin_inset Flex Code
9866 \begin_layout Plain Layout
9873 \begin_inset Flex Code
9876 \begin_layout Plain Layout
9882 The category for this style.
9883 This is used to group related styles in the style combobox on the toolbar.
9884 Any string can be used, but you may want to use existing categories with
9889 \begin_layout Description
9890 \begin_inset Flex Code
9893 \begin_layout Plain Layout
9899 Depth of XML command.
9900 Used only with XML-type formats.
9903 \begin_layout Description
9904 \begin_inset Flex Code
9907 \begin_layout Plain Layout
9914 \begin_inset Flex Code
9917 \begin_layout Plain Layout
9923 Copies all the features of an existing style into the current one.
9927 \begin_layout Description
9928 \begin_inset Flex Code
9931 \begin_layout Plain Layout
9937 The name of a style whose preamble should be output
9942 This allows to ensure some ordering of the preamble snippets when macros
9943 definitions depend on one another.
9947 \begin_layout Plain Layout
9948 Note that, besides that functionality, there is no way to ensure any ordering
9950 The ordering that you see in a given version of LyX may change without
9951 warning in later versions.
9959 \begin_layout Description
9960 \begin_inset Flex Code
9963 \begin_layout Plain Layout
9970 \begin_inset Flex Code
9973 \begin_layout Plain Layout
9978 , Box, Filled_Box, Static
9983 ] The type of label that stands at the end of the paragraph (or sequence
9985 \begin_inset Flex Code
9988 \begin_layout Plain Layout
9995 \begin_inset Flex Code
9998 \begin_layout Plain Layout
10005 \begin_inset Flex Code
10008 \begin_layout Plain Layout
10015 \begin_inset Flex Code
10018 \begin_layout Plain Layout
10026 \begin_inset Flex Code
10029 \begin_layout Plain Layout
10036 \begin_inset Quotes eld
10040 \begin_inset Quotes erd
10044 \begin_inset Flex Code
10047 \begin_layout Plain Layout
10054 \begin_inset Flex Code
10057 \begin_layout Plain Layout
10058 \begin_inset space ~
10066 ) is a white (resp.
10067 \begin_inset space ~
10070 black) square suitable for end of proof markers,
10071 \begin_inset Flex Code
10074 \begin_layout Plain Layout
10080 is an explicit text string.
10083 \begin_layout Description
10084 \begin_inset Flex Code
10087 \begin_layout Plain Layout
10094 \begin_inset Flex Code
10097 \begin_layout Plain Layout
10103 ] The string used for a label with a
10104 \begin_inset Flex Code
10107 \begin_layout Plain Layout
10114 \begin_inset Flex Code
10117 \begin_layout Plain Layout
10127 \begin_layout Description
10128 \begin_inset Flex Code
10131 \begin_layout Plain Layout
10137 The font used for both the text body
10143 \begin_inset space ~
10147 \begin_inset CommandInset ref
10149 reference "sub:Font-description"
10154 Note that defining this font automatically defines the
10155 \begin_inset Flex Code
10158 \begin_layout Plain Layout
10165 So you should define this one first if you also want to define
10166 \begin_inset Flex Code
10169 \begin_layout Plain Layout
10178 \begin_layout Description
10179 \begin_inset Flex Code
10182 \begin_layout Plain Layout
10189 \begin_inset CommandInset label
10191 name "des:FreeSpacing"
10196 \begin_inset Flex Code
10199 \begin_layout Plain Layout
10208 \begin_inset Flex Code
10211 \begin_layout Plain Layout
10217 ] Usually LyX doesn't allow you to insert more than one space between words,
10218 since a space is considered as the separation between two words, not a
10219 character or symbol of its own.
10220 This is a very fine thing but sometimes annoying, for example, when typing
10221 program code or plain LaTeX code.
10223 \begin_inset Flex Code
10226 \begin_layout Plain Layout
10233 Note that LyX will create protected blanks for the additional blanks when
10234 in another mode than LaTeX-mode.
10237 \begin_layout Description
10238 \begin_inset Flex Code
10241 \begin_layout Plain Layout
10247 These tags are used with XHTML output.
10249 \begin_inset CommandInset ref
10251 reference "sub:Paragraph-Style-XHTML"
10258 \begin_layout Description
10259 \begin_inset Flex Code
10262 \begin_layout Plain Layout
10268 [[FIXME]] (Used only with XML-type formats.)
10271 \begin_layout Description
10272 \begin_inset Flex Code
10275 \begin_layout Plain Layout
10282 \begin_inset Flex Code
10285 \begin_layout Plain Layout
10291 If 1, marks the style as to be included in the document preamble rather
10292 than in the document body.
10293 This is useful for document classes that want such information as the title
10294 and author to appear in the preamble.
10295 Note that this works only for styles for which the
10296 \begin_inset Flex Code
10299 \begin_layout Plain Layout
10306 \begin_inset Flex Code
10309 \begin_layout Plain Layout
10316 \begin_inset Flex Code
10319 \begin_layout Plain Layout
10328 \begin_layout Description
10329 \begin_inset Flex Code
10332 \begin_layout Plain Layout
10339 \begin_inset Flex Code
10342 \begin_layout Plain Layout
10348 If 1, marks the style as being part of a title block (see also the
10349 \begin_inset Flex Code
10352 \begin_layout Plain Layout
10359 \begin_inset Flex Code
10362 \begin_layout Plain Layout
10371 \begin_layout Description
10372 \begin_inset Flex Code
10375 \begin_layout Plain Layout
10382 \begin_inset Flex Code
10385 \begin_layout Plain Layout
10391 ] This provides extra space between paragraphs that have the same style.
10392 If you put other styles into an environment, each is separated with the
10394 \begin_inset Flex Code
10397 \begin_layout Plain Layout
10404 But the whole items of the environment are additionally separated with
10406 \begin_inset Flex Code
10409 \begin_layout Plain Layout
10416 Note that this is a
10421 \begin_layout Description
10422 \begin_inset Flex Code
10425 \begin_layout Plain Layout
10431 [[FIXME]] (Used only with XML-type formats.)
10434 \begin_layout Description
10435 \begin_inset Flex Code
10438 \begin_layout Plain Layout
10445 \begin_inset Flex Code
10448 \begin_layout Plain Layout
10457 \begin_inset Flex Code
10460 \begin_layout Plain Layout
10466 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10467 lead to empty LaTeX output.
10468 There are some cases where this could be desirable however: in a letter
10469 template, the required fields can be provided as empty fields, so that
10470 people do not forget them; in some special classes, a style can be used
10471 as some kind of break, which does not contain actual text.
10474 \begin_layout Description
10475 \begin_inset Flex Code
10478 \begin_layout Plain Layout
10484 [float=0] The vertical space between the label and the text body.
10485 Only used for labels that are above the text body (
10486 \begin_inset Flex Code
10489 \begin_layout Plain Layout
10496 \begin_inset Flex Code
10499 \begin_layout Plain Layout
10500 Centered_Top_Environment
10508 \begin_layout Description
10509 \begin_inset Flex Code
10512 \begin_layout Plain Layout
10519 \begin_inset Flex Code
10522 \begin_layout Plain Layout
10529 \begin_inset Newline newline
10532 The name of the counter for automatic numbering.
10534 \begin_inset Newline newline
10542 \begin_inset Flex Code
10545 \begin_layout Plain Layout
10552 \begin_inset Flex Code
10555 \begin_layout Plain Layout
10562 In that case, the counter will be stepped each time the style appears.
10564 \begin_inset Newline newline
10572 \begin_inset Flex Code
10575 \begin_layout Plain Layout
10582 \begin_inset Flex Code
10585 \begin_layout Plain Layout
10591 , though this case is a bit complicated.
10592 Suppose you declare
10593 \begin_inset Quotes eld
10597 \begin_inset Flex Code
10600 \begin_layout Plain Layout
10601 LabelCounter myenum
10607 \begin_inset Quotes erd
10611 Then the actual counters used are
10612 \begin_inset Flex Code
10615 \begin_layout Plain Layout
10622 \begin_inset Flex Code
10625 \begin_layout Plain Layout
10632 \begin_inset Flex Code
10635 \begin_layout Plain Layout
10642 \begin_inset Flex Code
10645 \begin_layout Plain Layout
10651 , much as in LaTeX.
10652 These counters must all be declared separately.
10653 \begin_inset Newline newline
10657 \begin_inset CommandInset ref
10659 reference "sub:Counters"
10663 for details on counters.
10666 \begin_layout Description
10667 \begin_inset Flex Code
10670 \begin_layout Plain Layout
10676 The font used for the label.
10678 \begin_inset space ~
10682 \begin_inset CommandInset ref
10684 reference "sub:Font-description"
10691 \begin_layout Description
10692 \begin_inset Flex Code
10695 \begin_layout Plain Layout
10701 Text that indicates how far a label should be indented.
10704 \begin_layout Description
10705 \begin_inset Flex Code
10708 \begin_layout Plain Layout
10715 \begin_inset Flex Code
10718 \begin_layout Plain Layout
10724 ] The horizontal space between the label and the text body.
10725 Only used for labels that are not above the text body.
10728 \begin_layout Description
10729 \begin_inset Flex Code
10732 \begin_layout Plain Layout
10739 \begin_inset Flex Code
10742 \begin_layout Plain Layout
10748 ] The string used for a label with a
10749 \begin_inset Flex Code
10752 \begin_layout Plain Layout
10760 \begin_inset Flex Code
10763 \begin_layout Plain Layout
10769 is set, this string can be contain the special formatting commands described
10771 \begin_inset CommandInset ref
10773 reference "sub:Counters"
10781 \begin_layout Plain Layout
10782 For the sake of backwards compatibility, the string
10783 \begin_inset Flex Code
10786 \begin_layout Plain Layout
10796 will be replaced by the expanded
10797 \begin_inset Flex Code
10800 \begin_layout Plain Layout
10807 \begin_inset Flex Code
10810 \begin_layout Plain Layout
10819 This feature is now obsolete and should be replaced by the mechanisms of
10821 \begin_inset CommandInset ref
10823 reference "sub:Counters"
10835 \begin_layout Description
10836 \begin_inset Flex Code
10839 \begin_layout Plain Layout
10840 LabelStringAppendix
10846 \begin_inset Flex Code
10849 \begin_layout Plain Layout
10855 ] This is used inside the appendix instead of
10856 \begin_inset Flex Code
10859 \begin_layout Plain Layout
10867 \begin_inset Flex Code
10870 \begin_layout Plain Layout
10877 \begin_inset Flex Code
10880 \begin_layout Plain Layout
10881 LabelStringAppendix
10889 \begin_layout Description
10890 \begin_inset Flex Code
10893 \begin_layout Plain Layout
10899 [FIXME] (Used only with XML-type formats.)
10902 \begin_layout Description
10903 \begin_inset Flex Code
10906 \begin_layout Plain Layout
10913 \begin_inset Flex Code
10916 \begin_layout Plain Layout
10921 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10922 Enumerate, Itemize, Bibliography
10931 \begin_layout Itemize
10932 \begin_inset Flex Code
10935 \begin_layout Plain Layout
10941 means the label is the very first word (up to the first real blank).
10942 Use protected spaces (like
10943 \begin_inset space ~
10946 that one) if you want more than one word as the label.
10950 \begin_layout Itemize
10951 \begin_inset Flex Code
10954 \begin_layout Plain Layout
10960 means the label is simply whatever
10961 \begin_inset Flex Code
10964 \begin_layout Plain Layout
10971 Note that this really is `static'.
10974 \begin_layout Itemize
10975 \begin_inset Flex Code
10978 \begin_layout Plain Layout
10985 \begin_inset Flex Code
10988 \begin_layout Plain Layout
10989 Centered_Top_Environment
10994 are special cases of
10995 \begin_inset Flex Code
10998 \begin_layout Plain Layout
11005 The label will be printed above the paragraph, but only at the top of an
11006 environment or the top of a chain of paragraphs with this style.
11007 This might be used with the
11008 \begin_inset Flex MenuItem
11011 \begin_layout Plain Layout
11017 style, for example.
11020 \begin_layout Itemize
11021 \begin_inset Flex Code
11024 \begin_layout Plain Layout
11030 is a special case for the caption-labels
11031 \begin_inset Quotes eld
11035 \begin_inset Quotes erd
11039 \begin_inset Quotes eld
11043 \begin_inset Quotes erd
11048 \begin_inset Flex Code
11051 \begin_layout Plain Layout
11057 means the (hardcoded) label string depends on the kind of float: It is
11058 hardcoded to be `FloatType N', where N is the value of the counter associated
11062 \begin_layout Itemize
11064 \begin_inset Flex Code
11067 \begin_layout Plain Layout
11073 label type defines automatically numbered labels.
11075 \begin_inset Flex Code
11078 \begin_layout Plain Layout
11084 will be expanded to resolve any counter references it contains: For example,
11086 \begin_inset Quotes eld
11090 \begin_inset Flex Code
11093 \begin_layout Plain Layout
11104 \begin_inset Quotes erd
11109 \begin_inset CommandInset ref
11111 reference "sub:Counters"
11115 for more information on counters.
11118 \begin_layout Itemize
11119 \begin_inset Flex Code
11122 \begin_layout Plain Layout
11128 produces the usual sort of enumeration labels.
11129 At present, it is hardcoded to use Arabic numerals, lowercase letters,
11130 small Roman numerals, and uppercase letters for the four possible depths.
11133 \begin_layout Itemize
11134 \begin_inset Flex Code
11137 \begin_layout Plain Layout
11143 produces various bullets at the different levels.
11144 It is also hardcoded.
11147 \begin_layout Itemize
11148 \begin_inset Flex Code
11151 \begin_layout Plain Layout
11157 is used internally by LyX and should be used only with
11158 \begin_inset Flex Code
11161 \begin_layout Plain Layout
11162 LatexType BibEnvironment
11171 \begin_layout Description
11172 \begin_inset Flex Code
11175 \begin_layout Plain Layout
11181 Note that this will completely override any prior
11182 \begin_inset Flex Code
11185 \begin_layout Plain Layout
11191 declaration for this style.
11193 \begin_inset Quotes eld
11197 \begin_inset Flex Code
11200 \begin_layout Plain Layout
11207 \begin_inset Quotes erd
11212 \begin_inset CommandInset ref
11214 reference "sub:I18n"
11218 for details on its use.
11221 \begin_layout Description
11222 \begin_inset Flex Code
11225 \begin_layout Plain Layout
11231 The name of the corresponding LaTeX stuff.
11232 Either the environment or command name.
11235 \begin_layout Description
11236 \begin_inset Flex Code
11239 \begin_layout Plain Layout
11245 An optional parameter for the corresponding
11246 \begin_inset Flex Code
11249 \begin_layout Plain Layout
11256 This parameter cannot be changed from within LyX.
11259 \begin_layout Description
11260 \begin_inset Flex Code
11263 \begin_layout Plain Layout
11270 \begin_inset Flex Code
11273 \begin_layout Plain Layout
11278 , Command, Environment, Item_Environment,
11284 \begin_inset Flex Code
11287 \begin_layout Plain Layout
11288 List_Environment, Bib_Environment
11293 ] How the style should be translated into LaTeX.
11297 \begin_layout Plain Layout
11298 \begin_inset Flex Code
11301 \begin_layout Plain Layout
11307 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11308 Visit the SGML class files for specific examples.
11317 \begin_layout Itemize
11318 \begin_inset Flex Code
11321 \begin_layout Plain Layout
11327 means nothing special.
11331 \begin_layout Itemize
11332 \begin_inset Flex Code
11335 \begin_layout Plain Layout
11342 \begin_inset Flex Code
11345 \begin_layout Plain Layout
11352 {\SpecialChar \ldots{}
11361 \begin_layout Itemize
11362 \begin_inset Flex Code
11365 \begin_layout Plain Layout
11372 \begin_inset Flex Code
11375 \begin_layout Plain Layout
11382 }\SpecialChar \ldots{}
11398 \begin_layout Itemize
11399 \begin_inset Flex Code
11402 \begin_layout Plain Layout
11409 \begin_inset Flex Code
11412 \begin_layout Plain Layout
11419 \begin_inset Flex Code
11422 \begin_layout Plain Layout
11430 is generated for each paragraph of this environment.
11434 \begin_layout Itemize
11435 \begin_inset Flex Code
11438 \begin_layout Plain Layout
11445 \begin_inset Flex Code
11448 \begin_layout Plain Layout
11455 \begin_inset Flex Code
11458 \begin_layout Plain Layout
11464 is passed as an argument to the environment.
11466 \begin_inset Flex Code
11469 \begin_layout Plain Layout
11475 can be defined in the
11476 \begin_inset Flex MenuItem
11479 \begin_layout Plain Layout
11484 \SpecialChar \menuseparator
11490 \begin_inset space ~
11502 \begin_layout Standard
11503 Putting the last few things together, the LaTeX output will be either:
11506 \begin_layout LyX-Code
11509 latexname[latexparam]{\SpecialChar \ldots{}
11513 \begin_layout Standard
11517 \begin_layout LyX-Code
11520 begin{latexname}[latexparam] \SpecialChar \ldots{}
11526 \begin_layout Standard
11527 depending upon the LaTeX type.
11531 \begin_layout Description
11532 \begin_inset Flex Code
11535 \begin_layout Plain Layout
11542 \begin_inset Flex Code
11545 \begin_layout Plain Layout
11551 ] If you put styles into environments, the leftmargins are not simply added,
11552 but added with a factor
11553 \begin_inset Formula $\frac{4}{depth+4}$
11557 Note that this parameter is also used when the margin is defined as
11558 \begin_inset Flex Code
11561 \begin_layout Plain Layout
11568 \begin_inset Flex Code
11571 \begin_layout Plain Layout
11578 Then it is added to the manual or dynamic margin.
11580 \begin_inset Newline newline
11583 The argument is passed as a string.
11585 \begin_inset Quotes eld
11589 \begin_inset Flex Code
11592 \begin_layout Plain Layout
11599 \begin_inset Quotes erd
11602 means that the paragraph is indented with the width of
11603 \begin_inset Quotes eld
11607 \begin_inset Flex Code
11610 \begin_layout Plain Layout
11617 \begin_inset Quotes erd
11620 in the normal font.
11621 You can get a negative width by prefixing the string with
11622 \begin_inset Quotes eld
11626 \begin_inset Flex Code
11629 \begin_layout Plain Layout
11636 \begin_inset Quotes erd
11640 This way was chosen so that the look is the same with each used screen
11645 \begin_layout Description
11646 \begin_inset Flex Code
11649 \begin_layout Plain Layout
11656 \begin_inset Flex Code
11659 \begin_layout Plain Layout
11664 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11670 \begin_inset Newline newline
11673 The kind of margin that the style has on the left side.
11675 \begin_inset Flex Code
11678 \begin_layout Plain Layout
11684 just means a fixed margin.
11686 \begin_inset Flex Code
11689 \begin_layout Plain Layout
11695 means that the left margin depends on the string entered in the
11696 \begin_inset Flex MenuItem
11699 \begin_layout Plain Layout
11700 Edit\SpecialChar \menuseparator
11702 \begin_inset space ~
11711 This is used to typeset nice lists without tabulators.
11713 \begin_inset Flex Code
11716 \begin_layout Plain Layout
11722 means that the margin depends on the size of the label.
11723 This is used for automatic enumerated headlines.
11724 It is obvious that the headline
11725 \begin_inset Quotes eld
11728 5.4.3.2.1 Very long headline
11729 \begin_inset Quotes erd
11732 must have a wider left margin (as wide as
11733 \begin_inset Quotes eld
11737 \begin_inset Quotes erd
11740 plus the space) than
11741 \begin_inset Quotes eld
11744 3.2 Very long headline
11745 \begin_inset Quotes erd
11749 \begin_inset Quotes eld
11753 \begin_inset Quotes erd
11756 are not able to do this.
11758 \begin_inset Flex Code
11761 \begin_layout Plain Layout
11767 is similar, but only the very first row of the paragraph is dynamic, while
11768 the others are static; this is used, for example, for descriptions.
11770 \begin_inset Flex Code
11773 \begin_layout Plain Layout
11779 means the margin is chosen in a way that the longest row of this paragraph
11780 fits to the right margin.
11781 This is used to typeset an address on the right edge of the page.
11784 \begin_layout Description
11785 \begin_inset Flex Code
11788 \begin_layout Plain Layout
11795 \begin_inset Flex Code
11798 \begin_layout Plain Layout
11807 \begin_inset Flex Code
11810 \begin_layout Plain Layout
11816 ] Whether fragile commands in this style should be
11817 \begin_inset Flex Code
11820 \begin_layout Plain Layout
11833 whether this command should itself be protected.)
11836 \begin_layout Description
11837 \begin_inset Flex Code
11840 \begin_layout Plain Layout
11847 \begin_inset Flex Code
11850 \begin_layout Plain Layout
11857 \begin_inset Flex Code
11860 \begin_layout Plain Layout
11868 ] Whether newlines are translated into LaTeX newlines (
11869 \begin_inset Flex Code
11872 \begin_layout Plain Layout
11883 The translation can be switched off to allow more comfortable LaTeX editing
11887 \begin_layout Description
11888 \begin_inset Flex Code
11891 \begin_layout Plain Layout
11898 \begin_inset Flex Code
11901 \begin_layout Plain Layout
11908 \begin_inset Flex Code
11911 \begin_layout Plain Layout
11919 ] If set to true, and if
11920 \begin_inset Flex Code
11923 \begin_layout Plain Layout
11930 \begin_inset Flex Code
11933 \begin_layout Plain Layout
11939 ) paragraphs are being indented, then the indentation of such a paragraph
11940 following one of this type will be suppressed.
11941 (So this will not affect the display of non-default paragraphs.)
11944 \begin_layout Description
11945 \begin_inset Flex Code
11948 \begin_layout Plain Layout
11954 Name of a style that has replaced this style.
11955 This is used to rename a style, while keeping backward compatibility.
11958 \begin_layout Description
11959 \begin_inset Flex Code
11962 \begin_layout Plain Layout
11969 \begin_inset Flex Code
11972 \begin_layout Plain Layout
11978 ] The number of optional arguments that can be used with this style.
11979 This is useful for things like section headings, and only makes sense with
11981 Note that, on output, the optional arguments will all precede any required
11982 arguments (see below).
11983 So one can have constructs like:
11987 \begin_layout LyX-Code
11990 mycmd[opt1]{req1}{contents of paragraph}
11993 \begin_layout Standard
11994 but one cannot have things like:
11997 \begin_layout LyX-Code
12000 mycmd[opt1]{req1}[opt2]{contents of paragraph}
12003 \begin_layout Standard
12004 at least, not without ERT (with which you can have anything).
12009 \begin_layout Description
12010 \begin_inset Flex Code
12013 \begin_layout Plain Layout
12020 \begin_inset Flex Code
12023 \begin_layout Plain Layout
12032 \begin_inset Flex Code
12035 \begin_layout Plain Layout
12041 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
12042 output, but only by a line break; together with
12043 \begin_inset Flex Code
12046 \begin_layout Plain Layout
12052 , this allows to emulate a plain text editor (like the ERT inset).
12055 \begin_layout Description
12056 \begin_inset Flex Code
12059 \begin_layout Plain Layout
12066 \begin_inset Flex Code
12069 \begin_layout Plain Layout
12075 ] The indent of the very first line of a paragraph.
12077 \begin_inset Flex Code
12080 \begin_layout Plain Layout
12086 will be fixed for a certain style.
12087 The exception is the default style, since the indentation for these paragraphs
12088 can be prohibited with
12089 \begin_inset Flex Code
12092 \begin_layout Plain Layout
12100 \begin_inset Flex Code
12103 \begin_layout Plain Layout
12109 style paragraphs inside environments use the
12110 \begin_inset Flex Code
12113 \begin_layout Plain Layout
12119 of the environment, not their native one.
12121 \begin_inset Flex Code
12124 \begin_layout Plain Layout
12130 paragraphs inside an enumeration are not indented.
12133 \begin_layout Description
12134 \begin_inset Flex Code
12137 \begin_layout Plain Layout
12144 \begin_inset Flex Code
12147 \begin_layout Plain Layout
12153 ] The vertical space between two paragraphs of this style.
12156 \begin_layout Description
12157 \begin_inset Flex Code
12160 \begin_layout Plain Layout
12167 \begin_inset Flex Code
12170 \begin_layout Plain Layout
12176 ] LyX allows the user to choose either
12177 \begin_inset Quotes eld
12181 \begin_inset Quotes erd
12185 \begin_inset Quotes eld
12189 \begin_inset Quotes erd
12192 to typeset a document.
12194 \begin_inset Quotes eld
12198 \begin_inset Quotes erd
12201 is chosen, this value is completely ignored.
12203 \begin_inset Quotes eld
12207 \begin_inset Quotes erd
12210 is chosen, the parindent of a LaTeXtype
12211 \begin_inset Quotes eld
12215 \begin_inset Quotes erd
12218 style is ignored and all paragraphs are separated by this parskip argument.
12219 The vertical space is calculated with
12220 \begin_inset Flex Code
12223 \begin_layout Plain Layout
12225 \begin_inset space ~
12234 \begin_inset Flex Code
12237 \begin_layout Plain Layout
12243 is the height of a row with the normal font.
12244 This way, the look stays the same with different screen fonts.
12247 \begin_layout Description
12248 \begin_inset Flex Code
12251 \begin_layout Plain Layout
12258 \begin_inset Flex Code
12261 \begin_layout Plain Layout
12270 \begin_inset Flex Code
12273 \begin_layout Plain Layout
12279 ] Whether the contents of this paragraph should be output in raw form, meaning
12280 without special translations that LaTeX would require.
12283 \begin_layout Description
12284 \begin_inset Flex Code
12287 \begin_layout Plain Layout
12293 Information to be included in the LaTeX preamble when this style is used.
12294 Used to define macros, load packages, etc., required by this particular
12297 \begin_inset Quotes eld
12301 \begin_inset Flex Code
12304 \begin_layout Plain Layout
12311 \begin_inset Quotes erd
12317 \begin_layout Description
12318 \begin_inset Flex Code
12321 \begin_layout Plain Layout
12328 \begin_inset Flex Code
12331 \begin_layout Plain Layout
12337 ] The prefix to use when creating labels referring to paragraphs of this
12339 This allows the use of formatted references.
12342 \begin_layout Description
12343 \begin_inset Flex Code
12346 \begin_layout Plain Layout
12353 \begin_inset Flex Code
12356 \begin_layout Plain Layout
12362 ] The number of required arguments that the LaTeX command or environment
12363 corresponding to this style expects.
12364 In the case of a command, these are required arguments
12368 that associated with the content of the paragraph itself.
12369 These do not actually have to be provided: LyX will output empty arguments
12371 Note that optional arguments will be output before required arguments.
12372 See the discussion of the
12373 \begin_inset Flex Code
12376 \begin_layout Plain Layout
12382 tag above for more information.
12385 \begin_layout Description
12386 \begin_inset Flex Code
12389 \begin_layout Plain Layout
12396 \begin_inset Flex Code
12399 \begin_layout Plain Layout
12405 ] Whether the style requires the feature
12406 \begin_inset Flex Code
12409 \begin_layout Plain Layout
12416 See the description of
12417 \begin_inset Flex Code
12420 \begin_layout Plain Layout
12427 \begin_inset CommandInset ref
12428 LatexCommand pageref
12429 reference "des:FreeSpacing"
12433 ) for information on `features'.
12437 \begin_layout Description
12438 \begin_inset Flex Code
12441 \begin_layout Plain Layout
12448 \begin_inset Flex Code
12451 \begin_layout Plain Layout
12458 \begin_inset Flex Code
12461 \begin_layout Plain Layout
12470 \begin_layout Description
12471 \begin_inset Flex Code
12474 \begin_layout Plain Layout
12481 \begin_inset Flex Code
12484 \begin_layout Plain Layout
12489 , onehalf, double, other
12498 ] This defines what the default spacing should be in the style.
12500 \begin_inset Flex Code
12503 \begin_layout Plain Layout
12510 \begin_inset Flex Code
12513 \begin_layout Plain Layout
12520 \begin_inset Flex Code
12523 \begin_layout Plain Layout
12529 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12530 If you specify the argument
12531 \begin_inset Flex Code
12534 \begin_layout Plain Layout
12540 , then you should also provide a numerical argument which will be the actual
12542 Note that, contrary to other parameters,
12543 \begin_inset Flex Code
12546 \begin_layout Plain Layout
12552 implies the generation of specific LaTeX code, using the package
12555 \begin_inset Flex Code
12558 \begin_layout Plain Layout
12567 \begin_layout Description
12568 \begin_inset Flex Code
12571 \begin_layout Plain Layout
12578 \begin_inset Flex Code
12581 \begin_layout Plain Layout
12588 \begin_inset Flex Code
12591 \begin_layout Plain Layout
12599 ] Spellcheck paragraphs of this style.
12603 \begin_layout Description
12604 \begin_inset Flex Code
12607 \begin_layout Plain Layout
12613 The font used for the text body .
12615 \begin_inset CommandInset ref
12617 reference "sub:Font-description"
12624 \begin_layout Description
12625 \begin_inset Flex Code
12628 \begin_layout Plain Layout
12637 \begin_inset Flex Code
12640 \begin_layout Plain Layout
12650 The level of the style in the table of contents.
12651 This is used for automatic numbering of section headings.
12654 \begin_layout Description
12655 \begin_inset Flex Code
12658 \begin_layout Plain Layout
12665 \begin_inset Flex Code
12668 \begin_layout Plain Layout
12674 ] The vertical space with which the very first of a chain of paragraphs
12675 with this style is separated from the previous paragraph.
12676 If the previous paragraph has another style, the separations are not simply
12677 added, but the maximum is taken.
12680 \begin_layout Subsection
12681 \begin_inset CommandInset label
12687 Internationalization of Paragraph Styles
12690 \begin_layout Standard
12691 LyX has long supported internationalization of layout information, but,
12692 until version 2.0, this applied only to the user interface and not to, say,
12694 Thus, French authors were forced to resort to ugly hacks if they wanted
12699 1' instead of `Theorem 1'.
12700 Thanks to Georg Baum, that is no longer the case.
12703 \begin_layout Standard
12705 \begin_inset Flex Code
12708 \begin_layout Plain Layout
12714 defines text that is to appear in the typeset document, it may use
12715 \begin_inset Flex Code
12718 \begin_layout Plain Layout
12725 \begin_inset Flex Code
12728 \begin_layout Plain Layout
12734 to support non-English and even multi-language documents correctly.
12735 The following excerpt (from the
12736 \begin_inset Flex Code
12739 \begin_layout Plain Layout
12745 file) shows how this works:
12748 \begin_layout LyX-Code
12753 \begin_layout LyX-Code
12756 theoremstyle{remark}
12759 \begin_layout LyX-Code
12762 newtheorem{claim}[thm]{
12769 \begin_layout LyX-Code
12773 \begin_layout LyX-Code
12777 \begin_layout LyX-Code
12782 claimname}{_(Claim)}
12785 \begin_layout LyX-Code
12789 \begin_layout LyX-Code
12793 \begin_layout LyX-Code
12802 claimname}{_(Claim)}}
12805 \begin_layout LyX-Code
12810 \begin_layout Standard
12811 In principle, any legal LaTeX may appear in the
12812 \begin_inset Flex Code
12815 \begin_layout Plain Layout
12822 \begin_inset Flex Code
12825 \begin_layout Plain Layout
12831 tags, but in practice they will typically look as they do here.
12832 The key to correct translation of the typeset text is the definition of
12834 \begin_inset Flex Code
12837 \begin_layout Plain Layout
12846 \begin_inset Flex Code
12849 \begin_layout Plain Layout
12861 \begin_layout Standard
12863 \begin_inset Flex Code
12866 \begin_layout Plain Layout
12872 tag provides for internationalization based upon the overall language of
12874 The contents of the tag will be included in the preamble, just as with
12876 \begin_inset Flex Code
12879 \begin_layout Plain Layout
12886 What makes it special is the use of the
12887 \begin_inset Quotes eld
12891 \begin_inset Quotes erd
12895 \begin_inset Flex Code
12898 \begin_layout Plain Layout
12904 , which will be replaced, when LyX produces LaTeX output, with the translation
12905 of its argument into the document language.
12908 \begin_layout Standard
12910 \begin_inset Flex Code
12913 \begin_layout Plain Layout
12919 tag is more complex, since it is meant to provide support for multi-language
12920 documents and so offers an interface to the
12921 \begin_inset Flex Code
12924 \begin_layout Plain Layout
12931 Its contents will be added to the preamble once for each language that
12932 appears in the document.
12933 In this case, the argument to
12934 \begin_inset Flex Code
12937 \begin_layout Plain Layout
12943 will be replaced with its translation into the language in question; the
12945 \begin_inset Flex Code
12948 \begin_layout Plain Layout
12954 is replaced by the language name (as used by the babel package).
12957 \begin_layout Standard
12958 A German document that also included a French section would thus have the
12959 following in the preamble:
12962 \begin_layout LyX-Code
12971 claimname}{Affirmation}}
12979 claimname}{Behauptung}}
12983 claimname}{Behauptung}
12986 \begin_layout Standard
12988 \begin_inset Flex Code
12991 \begin_layout Plain Layout
12997 will then conspire to produce the correct text in the output.
13000 \begin_layout Standard
13001 One important point to note here is that the translations are provided by
13002 LyX itself, through the same mechanism it uses for internationalization
13003 of the user interface.
13004 This means, in effect, that
13005 \begin_inset Flex Code
13008 \begin_layout Plain Layout
13015 \begin_inset Flex Code
13018 \begin_layout Plain Layout
13024 are really only of use in layout files that are provided with LyX, since
13025 text entered in user-created layout files will not be seen by LyX's internation
13026 alization routines.
13027 That said, however, any layout created with the intention that it will
13028 be included with LyX should use these tags where appropriate.
13031 \begin_layout Subsection
13033 \begin_inset CommandInset label
13042 \begin_layout Standard
13043 Since version 1.3.0 of LyX, it is has been both possible and necessary to
13044 define the floats (
13045 \begin_inset Flex MenuItem
13048 \begin_layout Plain Layout
13055 \begin_inset Flex MenuItem
13058 \begin_layout Plain Layout
13064 , \SpecialChar \ldots{}
13065 ) in the text class itself.
13066 Standard floats are included in the file
13067 \begin_inset Flex Code
13070 \begin_layout Plain Layout
13076 , so you may have to do no more than add
13079 \begin_layout LyX-Code
13080 Input stdfloats.inc
13083 \begin_layout Standard
13084 to your layout file.
13085 If you want to implement a text class that proposes some other float types
13086 (like the AGU class bundled with LyX), the information below will hopefully
13090 \begin_layout Description
13091 \begin_inset Flex Code
13094 \begin_layout Plain Layout
13101 \begin_inset Flex Code
13104 \begin_layout Plain Layout
13111 \begin_inset Quotes erd
13115 \begin_inset Quotes erd
13118 ] The file name extension of an auxiliary file for the list of figures (or
13120 LaTeX writes the captions to this file.
13123 \begin_layout Description
13124 \begin_inset Flex Code
13127 \begin_layout Plain Layout
13134 \begin_inset Flex Code
13137 \begin_layout Plain Layout
13144 \begin_inset Quotes erd
13148 \begin_inset Quotes erd
13151 ] The string that will be used in the menus and also for the caption.
13152 This is translated to the current language if babel is used.
13155 \begin_layout Description
13156 \begin_inset Flex Code
13159 \begin_layout Plain Layout
13165 These are used for XHTML output.
13167 \begin_inset CommandInset ref
13169 reference "sec:Tags-for-XHTML"
13176 \begin_layout Description
13177 \begin_inset Flex Code
13180 \begin_layout Plain Layout
13189 \begin_inset Flex Code
13192 \begin_layout Plain Layout
13201 \begin_inset Flex Code
13204 \begin_layout Plain Layout
13210 ] Indicates whether the float is already defined in the document class or
13211 if we instead need to load
13212 \begin_inset Flex Code
13215 \begin_layout Plain Layout
13221 and use what it provides to define it on-the-fly.
13223 \begin_inset Flex Code
13226 \begin_layout Plain Layout
13233 \begin_inset Flex Code
13236 \begin_layout Plain Layout
13243 It should be set to
13244 \begin_inset Flex Code
13247 \begin_layout Plain Layout
13253 if the float is already defined by the LaTeX document class.
13256 \begin_layout Description
13257 \begin_inset Flex Code
13260 \begin_layout Plain Layout
13267 \begin_inset Flex Code
13270 \begin_layout Plain Layout
13277 \begin_inset Quotes erd
13281 \begin_inset Quotes erd
13284 ] The command used to generate a list of floats of this type; the leading
13287 ' should be omitted.
13293 \begin_inset Flex Code
13296 \begin_layout Plain Layout
13302 is false, since there is no standard way to generate this command.
13304 \begin_inset Flex Code
13307 \begin_layout Plain Layout
13313 is true, since in that case there is a standard way to define the command.
13316 \begin_layout Description
13317 \begin_inset Flex Code
13320 \begin_layout Plain Layout
13327 \begin_inset Flex Code
13330 \begin_layout Plain Layout
13337 \begin_inset Quotes erd
13341 \begin_inset Quotes erd
13344 ] A title for a list of floats of this kind (list of figures, tables, or
13346 It is used for the screen label within LyX; it is passed to LaTeX for use
13347 as the title there; and it is used as the title in XHTML output.
13348 It will be translated to the document language.
13351 \begin_layout Description
13352 \begin_inset Flex Code
13355 \begin_layout Plain Layout
13362 \begin_inset Flex Code
13365 \begin_layout Plain Layout
13372 \begin_inset Quotes erd
13376 \begin_inset Quotes erd
13379 ] This (optional) argument determines whether floats of this class will
13380 be numbered within some sectional unit of the document.
13381 For example, if within is equal to
13382 \begin_inset Flex Code
13385 \begin_layout Plain Layout
13391 , the floats will be numbered within chapters.
13395 \begin_layout Description
13396 \begin_inset Flex Code
13399 \begin_layout Plain Layout
13406 \begin_inset Flex Code
13409 \begin_layout Plain Layout
13416 \begin_inset Quotes erd
13420 \begin_inset Quotes erd
13423 ] The default placement for the given class of floats.
13424 The string should be as in standard LaTeX:
13425 \begin_inset Flex Code
13428 \begin_layout Plain Layout
13435 \begin_inset Flex Code
13438 \begin_layout Plain Layout
13445 \begin_inset Flex Code
13448 \begin_layout Plain Layout
13455 \begin_inset Flex Code
13458 \begin_layout Plain Layout
13464 for top, bottom, page, and here, respectively.
13468 \begin_layout Plain Layout
13469 Note that the order of these letters in the string is irrelevant, like in
13475 On top of that there is a new type,
13476 \begin_inset Flex Code
13479 \begin_layout Plain Layout
13485 , which does not really correspond to a float, since it means: put it
13486 \begin_inset Quotes eld
13490 \begin_inset Quotes erd
13494 Note however that the
13495 \begin_inset Flex Code
13498 \begin_layout Plain Layout
13504 specifier is special and, because of implementation details, cannot be
13505 used in non-built in float types.
13506 If you do not understand what this means, just use
13507 \begin_inset Quotes eld
13511 \begin_inset Flex Code
13514 \begin_layout Plain Layout
13521 \begin_inset Quotes erd
13527 \begin_layout Description
13528 \begin_inset Flex Code
13531 \begin_layout Plain Layout
13538 \begin_inset Flex Code
13541 \begin_layout Plain Layout
13547 ] The prefix to use when creating labels referring to floats of this type.
13548 This allows the use of formatted references.
13549 Note that you can remove any
13550 \begin_inset Flex Code
13553 \begin_layout Plain Layout
13559 set by a copied style by using the special value
13560 \begin_inset Quotes eld
13564 \begin_inset Quotes erd
13567 , which must be all caps.
13570 \begin_layout Description
13571 \begin_inset Flex Code
13574 \begin_layout Plain Layout
13581 \begin_inset Flex Code
13584 \begin_layout Plain Layout
13591 \begin_inset Quotes erd
13595 \begin_inset Quotes erd
13598 ] The style used when defining the float using
13599 \begin_inset Flex Code
13602 \begin_layout Plain Layout
13613 \begin_layout Description
13614 \begin_inset Flex Code
13617 \begin_layout Plain Layout
13624 \begin_inset Flex Code
13627 \begin_layout Plain Layout
13634 \begin_inset Quotes erd
13638 \begin_inset Quotes erd
13642 \begin_inset Quotes eld
13646 \begin_inset Quotes erd
13649 of the new class of floats, like program or algorithm.
13650 After the appropriate
13651 \begin_inset Flex Code
13654 \begin_layout Plain Layout
13663 \begin_inset Flex Code
13666 \begin_layout Plain Layout
13675 \begin_inset Flex Code
13678 \begin_layout Plain Layout
13689 \begin_layout Description
13690 \begin_inset Flex Code
13693 \begin_layout Plain Layout
13700 \begin_inset Flex Code
13703 \begin_layout Plain Layout
13710 \begin_inset Flex Code
13713 \begin_layout Plain Layout
13721 ] Tells us whether this float is defined using the facilities provided by
13723 \begin_inset Flex Code
13726 \begin_layout Plain Layout
13732 , either by the class file or a package, or on-the-fly by LyX itself.
13735 \begin_layout Standard
13736 Note that defining a float with type
13737 \begin_inset Flex Code
13740 \begin_layout Plain Layout
13748 automatically defines the corresponding counter with name
13749 \begin_inset Flex Code
13752 \begin_layout Plain Layout
13763 \begin_layout Subsection
13764 Flex insets and InsetLayout
13765 \begin_inset CommandInset label
13767 name "sub:Flex-insets-and"
13774 \begin_layout Standard
13775 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13776 these are called Flex insets.
13780 \begin_layout Standard
13781 Flex insets come in three different kinds:
13784 \begin_layout Itemize
13786 \begin_inset Flex Code
13789 \begin_layout Plain Layout
13795 ): These define semantic markup corresponding to such LaTeX commands as
13797 \begin_inset Flex Code
13800 \begin_layout Plain Layout
13809 \begin_inset Flex Code
13812 \begin_layout Plain Layout
13823 \begin_layout Itemize
13825 \begin_inset Flex Code
13828 \begin_layout Plain Layout
13834 ): These can be used to define custom collapsible insets, similar to TeX
13835 code, footnote, and the like.
13836 An obvious example is an endnote inset, which is defined in the
13837 \begin_inset Flex Code
13840 \begin_layout Plain Layout
13849 \begin_layout Itemize
13851 \begin_inset Flex Code
13854 \begin_layout Plain Layout
13860 ): For use with DocBook classes.
13863 \begin_layout Standard
13864 Flex insets are defined using the
13865 \begin_inset Flex Code
13868 \begin_layout Plain Layout
13874 tag, which shall be explained in a moment.
13877 \begin_layout Standard
13879 \begin_inset Flex Code
13882 \begin_layout Plain Layout
13888 tag also serves another function: It can be used to customize the general
13889 layout of many different types of insets.
13891 \begin_inset Flex Code
13894 \begin_layout Plain Layout
13900 can be used to customize the layout parameters for footnotes, marginal
13901 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13902 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13903 define Flex insets.
13906 \begin_layout Standard
13908 \begin_inset Flex Code
13911 \begin_layout Plain Layout
13917 definition must begin with a line of the form:
13920 \begin_layout LyX-Code
13924 \begin_layout Standard
13926 \begin_inset Flex Code
13929 \begin_layout Plain Layout
13935 indicates the inset whose layout is being defined, and here there are two
13939 \begin_layout Enumerate
13940 The layout for a pre-existing inset is being modified.
13941 In this case, can be
13942 \begin_inset Flex Code
13945 \begin_layout Plain Layout
13951 any one of the following:
13952 \begin_inset Flex Code
13955 \begin_layout Plain Layout
13962 \begin_inset Flex Code
13965 \begin_layout Plain Layout
13972 \begin_inset Flex Code
13975 \begin_layout Plain Layout
13982 \begin_inset Flex Code
13985 \begin_layout Plain Layout
13992 \begin_inset Flex Code
13995 \begin_layout Plain Layout
14002 \begin_inset Flex Code
14005 \begin_layout Plain Layout
14012 \begin_inset Flex Code
14015 \begin_layout Plain Layout
14022 \begin_inset Flex Code
14025 \begin_layout Plain Layout
14032 \begin_inset Flex Code
14035 \begin_layout Plain Layout
14042 \begin_inset Flex Code
14045 \begin_layout Plain Layout
14052 \begin_inset Flex Code
14055 \begin_layout Plain Layout
14062 \begin_inset Flex Code
14065 \begin_layout Plain Layout
14072 \begin_inset Flex Code
14075 \begin_layout Plain Layout
14082 \begin_inset Flex Code
14085 \begin_layout Plain Layout
14092 \begin_inset Flex Code
14095 \begin_layout Plain Layout
14102 \begin_inset Flex Code
14105 \begin_layout Plain Layout
14112 \begin_inset Flex Code
14115 \begin_layout Plain Layout
14122 \begin_inset Flex Code
14125 \begin_layout Plain Layout
14132 \begin_inset Flex Code
14135 \begin_layout Plain Layout
14142 \begin_inset Flex Code
14145 \begin_layout Plain Layout
14154 \begin_layout Enumerate
14155 The layout for a Flex inset is being defined.
14157 \begin_inset Flex Code
14160 \begin_layout Plain Layout
14166 must be of the form
14167 \begin_inset Quotes eld
14171 \begin_inset Flex Code
14174 \begin_layout Plain Layout
14181 \begin_inset Quotes erd
14185 \begin_inset Flex Code
14188 \begin_layout Plain Layout
14194 may be be any valid identifier not used by a pre-existing Flex inset.
14195 The identifier may include spaces, but in that case the whole thing must
14196 be wrapped in quotes.
14197 Note that the definition of a flex inset
14202 \begin_inset Flex Code
14205 \begin_layout Plain Layout
14211 entry, declaring which type of inset it defines.
14214 \begin_layout Standard
14216 \begin_inset Flex Code
14219 \begin_layout Plain Layout
14225 definition can contain the following entries:
14228 \begin_layout Description
14229 \begin_inset Flex Code
14232 \begin_layout Plain Layout
14238 The color for the inset's background.
14239 The valid colors are defined in
14240 \begin_inset Flex Code
14243 \begin_layout Plain Layout
14252 \begin_layout Description
14253 \begin_inset Flex Code
14256 \begin_layout Plain Layout
14263 \begin_inset Flex Code
14266 \begin_layout Plain Layout
14275 \begin_inset Flex Code
14278 \begin_layout Plain Layout
14284 ] Whether to use the content of the inset as the label, when the inset is
14289 \begin_layout Description
14290 \begin_inset Flex Code
14293 \begin_layout Plain Layout
14300 \begin_inset Flex Code
14303 \begin_layout Plain Layout
14309 Copies all the features of an existing style into the current one.
14313 \begin_layout Description
14314 \begin_inset Flex Code
14317 \begin_layout Plain Layout
14324 \begin_inset Flex Code
14327 \begin_layout Plain Layout
14336 \begin_inset Flex Code
14339 \begin_layout Plain Layout
14345 ] Indicates whether the user may employ the Paragraph Settings dialog to
14346 customize the paragraph.
14349 \begin_layout Description
14350 \begin_inset Flex Code
14353 \begin_layout Plain Layout
14360 \begin_inset Flex Code
14363 \begin_layout Plain Layout
14370 \begin_inset Flex Code
14373 \begin_layout Plain Layout
14380 \begin_inset Flex Code
14383 \begin_layout Plain Layout
14389 , describing the rendering style used for the inset's frame and buttons.
14390 Footnotes generally use
14391 \begin_inset Flex Code
14394 \begin_layout Plain Layout
14400 , ERT insets generally
14401 \begin_inset Flex Code
14404 \begin_layout Plain Layout
14410 , and character styles
14411 \begin_inset Flex Code
14414 \begin_layout Plain Layout
14423 \begin_layout Description
14424 \begin_inset Flex Code
14427 \begin_layout Plain Layout
14434 \begin_inset Flex Code
14437 \begin_layout Plain Layout
14444 \begin_inset Flex Code
14447 \begin_layout Plain Layout
14456 \begin_inset Flex Code
14459 \begin_layout Plain Layout
14466 \begin_inset Flex Code
14469 \begin_layout Plain Layout
14476 Indicates whether the environment will stand on its own in LaTeX output
14477 or will appear inline with the surrounding text.
14478 If set to false, it is supposed that the LaTeX environment ignores white
14479 space (including one newline character) after the
14480 \begin_inset Flex Code
14483 \begin_layout Plain Layout
14496 \begin_inset Flex Code
14499 \begin_layout Plain Layout
14515 \begin_layout Description
14516 \begin_inset Flex Code
14519 \begin_layout Plain Layout
14525 Required at the end of the InsetLayout declarations.
14528 \begin_layout Description
14529 \begin_inset Flex Code
14532 \begin_layout Plain Layout
14538 The font used for both the text body
14544 \begin_inset space ~
14548 \begin_inset CommandInset ref
14550 reference "sub:Font-description"
14555 Note that defining this font automatically defines the
14556 \begin_inset Flex Code
14559 \begin_layout Plain Layout
14565 to the same value, so define this first and define
14566 \begin_inset Flex Code
14569 \begin_layout Plain Layout
14575 later if you want them to be different.
14578 \begin_layout Description
14579 \begin_inset Flex Code
14582 \begin_layout Plain Layout
14589 \begin_inset Quotes eld
14593 \begin_inset Quotes erd
14596 language, leading to Left-to-Right (latin) output, e.
14597 \begin_inset space \thinspace{}
14601 \begin_inset space \space{}
14604 in TeX code or URL.
14608 \begin_layout Description
14609 \begin_inset Flex Code
14612 \begin_layout Plain Layout
14619 \begin_inset Flex Code
14622 \begin_layout Plain Layout
14631 \begin_inset Flex Code
14634 \begin_layout Plain Layout
14640 ] Indicates whether the
14641 \begin_inset Flex Code
14644 \begin_layout Plain Layout
14650 should be used or, instead, the user can change the paragraph style used
14655 \begin_layout Description
14656 \begin_inset Flex Code
14659 \begin_layout Plain Layout
14666 \begin_inset Flex Code
14669 \begin_layout Plain Layout
14678 \begin_inset Flex Code
14681 \begin_layout Plain Layout
14687 ] Usually LyX doesn't allow you to insert more than one space between words,
14688 since a space is considered as the separation between two words, not a
14689 character or symbol of its own.
14690 This is a very fine thing but sometimes annoying, for example, when typing
14691 program code or plain LaTeX code.
14693 \begin_inset Flex Code
14696 \begin_layout Plain Layout
14703 Note that LyX will create protected blanks for the additional blanks when
14704 in another mode than LaTeX-mode.
14708 \begin_layout Description
14709 \begin_inset Flex Code
14712 \begin_layout Plain Layout
14718 These tags control XHTML output.
14720 \begin_inset CommandInset ref
14722 reference "sec:Tags-for-XHTML"
14729 \begin_layout Description
14730 \begin_inset Flex Code
14733 \begin_layout Plain Layout
14740 \begin_inset Flex Code
14743 \begin_layout Plain Layout
14752 \begin_inset Flex Code
14755 \begin_layout Plain Layout
14761 ] Whether to include the contents of this inset in the strings generated
14762 for the `Outline' pane.
14763 One would not, for example, want the content of a footnote in a section
14764 header to be included in the TOC displayed in the outline, but one would
14765 normally want the content of a character style displayed.
14766 Default is false: not to include.
14769 \begin_layout Description
14770 \begin_inset Flex Code
14773 \begin_layout Plain Layout
14780 \begin_inset Flex Code
14783 \begin_layout Plain Layout
14792 \begin_inset Flex Code
14795 \begin_layout Plain Layout
14801 ] Usually LyX does not allow you to leave a paragraph empty, since it would
14802 lead to empty LaTeX output.
14803 There are some cases where this could be desirable however: in a letter
14804 template, the required fields can be provided as empty fields, so that
14805 people do not forget them; in some special classes, a style can be used
14806 as some kind of break, which does not contain actual text.
14810 \begin_layout Description
14811 \begin_inset Flex Code
14814 \begin_layout Plain Layout
14820 The font used for the label.
14822 \begin_inset space ~
14826 \begin_inset CommandInset ref
14828 reference "sub:Font-description"
14833 Note that this definition can never appear before
14834 \begin_inset Flex Code
14837 \begin_layout Plain Layout
14843 , lest it be ineffective.
14846 \begin_layout Description
14847 \begin_inset Flex Code
14850 \begin_layout Plain Layout
14856 What will be displayed on the button or elsewhere as the inset label.
14858 \begin_inset Flex Code
14861 \begin_layout Plain Layout
14868 \begin_inset Flex Code
14871 \begin_layout Plain Layout
14877 ) modify this label on the fly.
14880 \begin_layout Description
14881 \begin_inset Flex Code
14884 \begin_layout Plain Layout
14890 The name of the corresponding LaTeX stuff.
14891 Either the environment or command name.
14894 \begin_layout Description
14895 \begin_inset Flex Code
14898 \begin_layout Plain Layout
14904 The optional parameter for the corresponding
14905 \begin_inset Flex Code
14908 \begin_layout Plain Layout
14914 stuff, including possible bracket pairs like
14915 \begin_inset Flex Code
14918 \begin_layout Plain Layout
14925 This parameter cannot be changed from within LyX.
14928 \begin_layout Description
14929 \begin_inset Flex Code
14932 \begin_layout Plain Layout
14939 \begin_inset Flex Code
14942 \begin_layout Plain Layout
14947 , Command, Environment, Item_Environment,
14953 \begin_inset Flex Code
14956 \begin_layout Plain Layout
14957 List_Environment, Bib_Environment
14962 ] How the style should be translated into LaTeX.
14966 \begin_layout Plain Layout
14967 \begin_inset Flex Code
14970 \begin_layout Plain Layout
14976 is perhaps a bit misleading, since these rules apply to SGML classes, too.
14977 Visit the SGML class files for specific examples.
14986 \begin_layout Itemize
14987 \begin_inset Flex Code
14990 \begin_layout Plain Layout
14996 means nothing special.
15000 \begin_layout Itemize
15001 \begin_inset Flex Code
15004 \begin_layout Plain Layout
15011 \begin_inset Flex Code
15014 \begin_layout Plain Layout
15021 {\SpecialChar \ldots{}
15030 \begin_layout Itemize
15031 \begin_inset Flex Code
15034 \begin_layout Plain Layout
15041 \begin_inset Flex Code
15044 \begin_layout Plain Layout
15051 }\SpecialChar \ldots{}
15067 \begin_layout Itemize
15068 \begin_inset Flex Code
15071 \begin_layout Plain Layout
15078 \begin_inset Flex Code
15081 \begin_layout Plain Layout
15088 \begin_inset Flex Code
15091 \begin_layout Plain Layout
15099 is generated for each paragraph of this environment.
15103 \begin_layout Itemize
15104 \begin_inset Flex Code
15107 \begin_layout Plain Layout
15114 \begin_inset Flex Code
15117 \begin_layout Plain Layout
15124 \begin_inset Flex Code
15127 \begin_layout Plain Layout
15133 is passed as an argument to the environment.
15135 \begin_inset Flex Code
15138 \begin_layout Plain Layout
15144 can be defined in the
15145 \begin_inset Flex MenuItem
15148 \begin_layout Plain Layout
15153 \SpecialChar \menuseparator
15159 \begin_inset space ~
15171 \begin_layout Standard
15172 Putting the last few things together, the LaTeX output will be either:
15175 \begin_layout LyX-Code
15178 latexname[latexparam]{\SpecialChar \ldots{}
15182 \begin_layout Standard
15186 \begin_layout LyX-Code
15189 begin{latexname}[latexparam] \SpecialChar \ldots{}
15195 \begin_layout Standard
15196 depending upon the LaTeX type.
15200 \begin_layout Description
15201 \begin_inset Flex Code
15204 \begin_layout Plain Layout
15211 \begin_inset Flex Code
15214 \begin_layout Plain Layout
15221 \begin_inset Flex Code
15224 \begin_layout Plain Layout
15231 \begin_inset Flex Code
15234 \begin_layout Plain Layout
15241 \begin_inset Flex Code
15244 \begin_layout Plain Layout
15250 (indicating a dummy definition ending definitions of charstyles, etc).
15251 This entry is required in and is only meaningful for Flex insets.
15252 Among other things, it determines on which menu this inset will appear.
15254 \begin_inset Flex Code
15257 \begin_layout Plain Layout
15264 \begin_inset Flex Code
15267 \begin_layout Plain Layout
15274 \begin_inset Flex Code
15277 \begin_layout Plain Layout
15285 \begin_inset Flex Code
15288 \begin_layout Plain Layout
15294 can be set to true for charstyle insets, if you wish, by setting it
15299 \begin_inset Flex Code
15302 \begin_layout Plain Layout
15311 \begin_layout Description
15312 \begin_inset Flex Code
15315 \begin_layout Plain Layout
15322 \begin_inset Flex Code
15325 \begin_layout Plain Layout
15334 \begin_inset Flex Code
15337 \begin_layout Plain Layout
15343 ] Whether multiple paragraphs are permitted in this inset.
15345 \begin_inset Flex Code
15348 \begin_layout Plain Layout
15354 to the same value and
15355 \begin_inset Flex Code
15358 \begin_layout Plain Layout
15364 to the opposite value.
15365 These can be reset to other values, if they are used
15370 \begin_inset Flex Code
15373 \begin_layout Plain Layout
15383 \begin_layout Description
15384 \begin_inset Flex Code
15387 \begin_layout Plain Layout
15394 \begin_inset Flex Code
15397 \begin_layout Plain Layout
15406 \begin_inset Flex Code
15409 \begin_layout Plain Layout
15415 ] Whether fragile commands in this inset should be
15416 \begin_inset Flex Code
15419 \begin_layout Plain Layout
15432 whether the command should itself be protected.) Default is false.
15435 \begin_layout Description
15436 \begin_inset Flex Code
15439 \begin_layout Plain Layout
15446 \begin_inset Flex Code
15449 \begin_layout Plain Layout
15458 \begin_inset Flex Code
15461 \begin_layout Plain Layout
15467 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
15468 output, but only by a line break; together with
15469 \begin_inset Flex Code
15472 \begin_layout Plain Layout
15478 , this allows to emulate a plain text editor (like the ERT inset).
15482 \begin_layout Description
15483 \begin_inset Flex Code
15486 \begin_layout Plain Layout
15493 \begin_inset Flex Code
15496 \begin_layout Plain Layout
15505 \begin_inset Flex Code
15508 \begin_layout Plain Layout
15514 ] Whether the contents of this paragraph should be output in raw form, meaning
15515 without special translations that LaTeX would require.
15518 \begin_layout Description
15519 \begin_inset Flex Code
15522 \begin_layout Plain Layout
15528 Information to be included in the LaTeX preamble when this style is used.
15529 Used to define macros, load packages, etc., required by this particular
15532 \begin_inset Quotes eld
15536 \begin_inset Flex Code
15539 \begin_layout Plain Layout
15546 \begin_inset Quotes erd
15552 \begin_layout Description
15553 \begin_inset Flex Code
15556 \begin_layout Plain Layout
15563 \begin_inset Flex Code
15566 \begin_layout Plain Layout
15572 ] The prefix to use when creating labels referring to insets of this type.
15573 This allows the use of formatted references.
15576 \begin_layout Description
15577 \begin_inset Flex Code
15580 \begin_layout Plain Layout
15587 \begin_inset Flex Code
15590 \begin_layout Plain Layout
15596 ] Whether the style requires the feature
15597 \begin_inset Flex Code
15600 \begin_layout Plain Layout
15607 See the description of
15608 \begin_inset Flex Code
15611 \begin_layout Plain Layout
15618 \begin_inset CommandInset ref
15619 LatexCommand pageref
15620 reference "des:FreeSpacing"
15624 ) for information on `features'.
15628 \begin_layout Description
15629 \begin_inset Flex Code
15632 \begin_layout Plain Layout
15639 \begin_inset Flex Code
15642 \begin_layout Plain Layout
15649 \begin_inset Flex Code
15652 \begin_layout Plain Layout
15660 ] Whether this inset should use the font of its surrounding environment
15662 Default is true: uses its own.
15665 \begin_layout Description
15666 \begin_inset Flex Code
15669 \begin_layout Plain Layout
15676 \begin_inset Flex Code
15679 \begin_layout Plain Layout
15686 \begin_inset Flex Code
15689 \begin_layout Plain Layout
15697 ] Spellcheck the contents of this inset.
15701 \begin_layout Subsection
15703 \begin_inset CommandInset label
15705 name "sub:Counters"
15712 \begin_layout Standard
15713 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15715 \begin_inset Flex MenuItem
15718 \begin_layout Plain Layout
15725 \begin_inset Flex MenuItem
15728 \begin_layout Plain Layout
15734 , \SpecialChar \ldots{}
15735 ) in the text class itself.
15736 The standard counters are defined in the file
15737 \begin_inset Flex Code
15740 \begin_layout Plain Layout
15746 , so you may have to do no more than add
15749 \begin_layout LyX-Code
15750 Input stdcounters.inc
15753 \begin_layout Standard
15754 to your layout file to get them to work.
15755 But if you want to define custom counters, then you can do so.
15756 The counter declaration must begin with:
15759 \begin_layout LyX-Code
15760 Counter CounterName
15763 \begin_layout Standard
15765 \begin_inset Flex Code
15768 \begin_layout Plain Layout
15774 ' is replaced by the name of the counter.
15775 And it must end with
15776 \begin_inset Quotes eld
15780 \begin_inset Flex Code
15783 \begin_layout Plain Layout
15790 \begin_inset Quotes erd
15794 The following parameters can also be used:
15797 \begin_layout Description
15798 \begin_inset Flex Code
15801 \begin_layout Plain Layout
15808 \begin_inset Flex Code
15811 \begin_layout Plain Layout
15818 \begin_inset Quotes erd
15822 \begin_inset Quotes erd
15825 ] When defined, this string defines how the counter is displayed.
15826 Setting this value sets
15827 \begin_inset Flex Code
15830 \begin_layout Plain Layout
15831 LabelStringAppendix
15837 The following special constructs can be used in the string:
15841 \begin_layout Itemize
15842 \begin_inset Flex Code
15845 \begin_layout Plain Layout
15853 will be replaced by the expansion of the
15854 \begin_inset Flex Code
15857 \begin_layout Plain Layout
15864 \begin_inset Flex Code
15867 \begin_layout Plain Layout
15868 LabelStringAppendix
15874 \begin_inset Flex Code
15877 \begin_layout Plain Layout
15887 \begin_layout Itemize
15888 counter values can be expressed using LaTeX-like macros
15889 \begin_inset Flex Code
15892 \begin_layout Plain Layout
15909 \begin_inset Flex Code
15912 \begin_layout Plain Layout
15924 \begin_layout Plain Layout
15934 Actually, the situation is a bit more complicated: any
15953 other than those described below will produce arabic numerals.
15954 It would not be surprising to see this change in the future.
15960 \begin_inset Flex Code
15963 \begin_layout Plain Layout
15969 : 1, 2, 3,\SpecialChar \ldots{}
15971 \begin_inset Flex Code
15974 \begin_layout Plain Layout
15980 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15982 \begin_inset Flex Code
15985 \begin_layout Plain Layout
15991 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15993 \begin_inset Flex Code
15996 \begin_layout Plain Layout
16002 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
16004 \begin_inset Flex Code
16007 \begin_layout Plain Layout
16013 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
16015 \begin_inset Flex Code
16018 \begin_layout Plain Layout
16024 for hebrew numerals.
16028 \begin_layout Standard
16029 If LabelString is not defined, a default value is constructed as follows:
16030 if the counter has a master counter
16031 \begin_inset Flex Code
16034 \begin_layout Plain Layout
16041 \begin_inset Flex Code
16044 \begin_layout Plain Layout
16051 \begin_inset Flex Code
16054 \begin_layout Plain Layout
16064 is used; otherwise the string
16065 \begin_inset Flex Code
16068 \begin_layout Plain Layout
16079 \begin_layout Description
16080 \begin_inset Flex Code
16083 \begin_layout Plain Layout
16084 LabelStringAppendix
16090 \begin_inset Flex Code
16093 \begin_layout Plain Layout
16100 \begin_inset Quotes erd
16104 \begin_inset Quotes erd
16108 \begin_inset Flex Code
16111 \begin_layout Plain Layout
16117 , but for use in the Appendix.
16120 \begin_layout Description
16121 \begin_inset Flex Code
16124 \begin_layout Plain Layout
16131 \begin_inset Flex Code
16134 \begin_layout Plain Layout
16141 \begin_inset Quotes erd
16145 \begin_inset Quotes erd
16148 ] A format for use with formatted references to this counter.
16149 For example, one might want to have references to section numbers appear
16151 \begin_inset Quotes eld
16155 \begin_inset Quotes erd
16159 The string should contain
16160 \begin_inset Quotes eld
16164 \begin_inset Quotes erd
16168 This will be replaced by the counter number itself.
16169 So, for sections, it would be: Section ##.
16172 \begin_layout Description
16173 \begin_inset Flex Code
16176 \begin_layout Plain Layout
16183 \begin_inset Flex Code
16186 \begin_layout Plain Layout
16193 \begin_inset Quotes erd
16197 \begin_inset Quotes erd
16200 ] If this is set to the name of another counter, the present counter will
16201 be reset every time the other one is increased.
16203 \begin_inset Flex Code
16206 \begin_layout Plain Layout
16213 \begin_inset Flex Code
16216 \begin_layout Plain Layout
16225 \begin_layout Subsection
16227 \begin_inset CommandInset label
16229 name "sub:Font-description"
16236 \begin_layout Standard
16237 A font description looks like this:
16240 \begin_layout LyX-Code
16250 \begin_layout LyX-Code
16254 \begin_layout LyX-Code
16258 \begin_layout Standard
16259 The following commands are available:
16262 \begin_layout Description
16263 \begin_inset Flex Code
16266 \begin_layout Plain Layout
16273 \begin_inset Flex Code
16276 \begin_layout Plain Layout
16285 \begin_inset Flex Code
16288 \begin_layout Plain Layout
16295 \begin_inset Flex Code
16298 \begin_layout Plain Layout
16305 \begin_inset Flex Code
16308 \begin_layout Plain Layout
16315 \begin_inset Flex Code
16318 \begin_layout Plain Layout
16325 \begin_inset Flex Code
16328 \begin_layout Plain Layout
16335 \begin_inset Flex Code
16338 \begin_layout Plain Layout
16345 \begin_inset Flex Code
16348 \begin_layout Plain Layout
16355 \begin_inset Flex Code
16358 \begin_layout Plain Layout
16367 \begin_layout Description
16368 \begin_inset Flex Code
16371 \begin_layout Plain Layout
16378 \begin_inset Flex Code
16381 \begin_layout Plain Layout
16390 \begin_inset Flex Code
16393 \begin_layout Plain Layout
16400 \begin_inset Flex Code
16403 \begin_layout Plain Layout
16412 \begin_layout Description
16413 \begin_inset Flex Code
16416 \begin_layout Plain Layout
16423 \begin_inset Flex Code
16426 \begin_layout Plain Layout
16432 ] Valid arguments are:
16433 \begin_inset Flex Code
16436 \begin_layout Plain Layout
16443 \begin_inset Flex Code
16446 \begin_layout Plain Layout
16453 \begin_inset Flex Code
16456 \begin_layout Plain Layout
16463 \begin_inset Flex Code
16466 \begin_layout Plain Layout
16473 \begin_inset Flex Code
16476 \begin_layout Plain Layout
16483 \begin_inset Flex Code
16486 \begin_layout Plain Layout
16493 \begin_inset Flex Code
16496 \begin_layout Plain Layout
16503 \begin_inset Flex Code
16506 \begin_layout Plain Layout
16513 \begin_inset Flex Code
16516 \begin_layout Plain Layout
16523 \begin_inset Flex Code
16526 \begin_layout Plain Layout
16533 \begin_inset Flex Code
16536 \begin_layout Plain Layout
16543 \begin_inset Flex Code
16546 \begin_layout Plain Layout
16553 Each of these turns on or off the corresponding attribute.
16555 \begin_inset Flex Code
16558 \begin_layout Plain Layout
16564 turns on emphasis, and
16565 \begin_inset Flex Code
16568 \begin_layout Plain Layout
16576 \begin_inset Newline newline
16579 If the latter seems puzzling, remember that the font settings for the present
16580 context are generally inherited from the surrounding context.
16582 \begin_inset Flex Code
16585 \begin_layout Plain Layout
16591 would turn off the emphasis that was anyway in effect, say, in a theorem
16595 \begin_layout Description
16596 \begin_inset Flex Code
16599 \begin_layout Plain Layout
16606 \begin_inset Flex Code
16609 \begin_layout Plain Layout
16618 \begin_inset Flex Code
16621 \begin_layout Plain Layout
16630 \begin_layout Description
16631 \begin_inset Flex Code
16634 \begin_layout Plain Layout
16641 \begin_inset Flex Code
16644 \begin_layout Plain Layout
16653 \begin_inset Flex Code
16656 \begin_layout Plain Layout
16663 \begin_inset Flex Code
16666 \begin_layout Plain Layout
16673 \begin_inset Flex Code
16676 \begin_layout Plain Layout
16685 \begin_layout Description
16686 \begin_inset Flex Code
16689 \begin_layout Plain Layout
16696 \begin_inset Flex Code
16699 \begin_layout Plain Layout
16706 \begin_inset Flex Code
16709 \begin_layout Plain Layout
16716 \begin_inset Flex Code
16719 \begin_layout Plain Layout
16728 \begin_inset Flex Code
16731 \begin_layout Plain Layout
16738 \begin_inset Flex Code
16741 \begin_layout Plain Layout
16748 \begin_inset Flex Code
16751 \begin_layout Plain Layout
16758 \begin_inset Flex Code
16761 \begin_layout Plain Layout
16768 \begin_inset Flex Code
16771 \begin_layout Plain Layout
16780 \begin_layout Subsection
16781 \begin_inset CommandInset label
16783 name "sub:Citation-format-description"
16787 Citation format description
16790 \begin_layout Standard
16792 \begin_inset Flex Code
16795 \begin_layout Plain Layout
16801 blocks are used to describe how bibliographic information should be displayed,
16802 both within LyX itself (in the citation dialog and in tooltips, for example)
16803 and in XHTML output.
16804 Such a block might look like this:
16807 \begin_layout LyX-Code
16811 \begin_layout LyX-Code
16815 \begin_layout LyX-Code
16819 \begin_layout LyX-Code
16823 \begin_layout Standard
16824 The individual lines define how the bibliographic information associated
16825 with an article or book, respectively, is to be displayed, and such a definitio
16826 n can be given for any `entry type' that might be present in a BibTeX file.
16827 LyX defines a default format in the source code that will be used if no
16828 specific definition has been given.
16829 LyX predefines several formats in the file
16830 \begin_inset Flex Code
16833 \begin_layout Plain Layout
16839 , which is included in most of LyX's document classes.
16842 \begin_layout Standard
16843 The definitions use a simple language that allows BibTeX keys to be replaced
16845 Keys should be enclosed in
16846 \begin_inset Flex Code
16849 \begin_layout Plain Layout
16856 \begin_inset Flex Code
16859 \begin_layout Plain Layout
16866 So a simple definition might look like this:
16869 \begin_layout LyX-Code
16871 \begin_inset Quotes eld
16875 \begin_inset Quotes erd
16881 \begin_layout Standard
16882 This would print the author, followed by a comma, followed by the title,
16883 in quotes, followed by a period.
16886 \begin_layout Standard
16887 Of course, sometimes you may want to print a key only if it exists.
16888 This can be done by using a conditional construction, such as:
16889 \begin_inset Flex Code
16892 \begin_layout Plain Layout
16894 \begin_inset space ~
16904 \begin_inset Flex Code
16907 \begin_layout Plain Layout
16913 key exists, then print
16914 \begin_inset Quotes eld
16918 \begin_inset space ~
16922 \begin_inset Quotes erd
16925 followed by the volume key.
16926 It is also possible to have an else clause in the conditional, such as:
16928 \begin_inset Flex Code
16931 \begin_layout Plain Layout
16932 {%author%[[%author%]][[%editor%, ed.]]}
16939 \begin_inset Flex Code
16942 \begin_layout Plain Layout
16948 key is printed if it exists; otherwise, the editor key is printed, followed
16950 \begin_inset Quotes eld
16954 \begin_inset space ~
16958 \begin_inset Quotes erd
16961 Note that the key is again enclosed in
16962 \begin_inset Flex Code
16965 \begin_layout Plain Layout
16971 signs; the entire conditional is enclosed in braces; and the if and else
16972 clauses are enclosed in double brackets,
16973 \begin_inset Quotes eld
16977 \begin_inset Flex Code
16980 \begin_layout Plain Layout
16987 \begin_inset Quotes eld
16991 \begin_inset Quotes eld
16995 \begin_inset Flex Code
16998 \begin_layout Plain Layout
17005 \begin_inset Quotes erd
17009 There must be no space between any of these.
17012 \begin_layout Standard
17013 There is one other piece of syntax available in definitions, which looks
17015 \begin_inset Flex Code
17018 \begin_layout Plain Layout
17025 This defines a piece of formatting information that is to be used when
17027 \begin_inset Quotes eld
17031 \begin_inset Quotes erd
17035 Obviously, we do not want to output HTML tags when writing plain text,
17036 so they should be wrapped in
17037 \begin_inset Quotes eld
17041 \begin_inset Quotes erd
17045 \begin_inset Quotes eld
17049 \begin_inset Quotes erd
17055 \begin_layout Standard
17056 Two special sorts of definitions are also possible in a
17057 \begin_inset Flex Code
17060 \begin_layout Plain Layout
17067 An example of the first would be:
17070 \begin_layout LyX-Code
17072 \begin_inset Quotes eld
17076 \begin_inset Quotes erd
17082 \begin_layout Standard
17083 This is an abbreviation, or macro, and it can be used by treating it as
17085 \begin_inset Flex Code
17088 \begin_layout Plain Layout
17096 \begin_inset Flex Code
17099 \begin_layout Plain Layout
17105 exactly as it would treat its definition.
17106 So, let us issue the obvious
17114 \begin_layout LyX-Code
17118 \begin_layout Standard
17119 or anything like it.
17120 LyX shouldn't go into an infinite loop, but it may go into a long one before
17124 \begin_layout Standard
17125 The second sort of special definition might look like this:
17128 \begin_layout LyX-Code
17132 \begin_layout Standard
17133 This defines a translatable piece of text, which allows relevant parts of
17134 the bibliography to be translated.
17135 It can be included in a definition by treating it as a key:
17136 \begin_inset Flex Code
17139 \begin_layout Plain Layout
17146 Several of these are predefined in
17147 \begin_inset Flex Code
17150 \begin_layout Plain Layout
17157 Note that these are not macros, in the sense just defined.
17158 They will not be expanded.
17161 \begin_layout Standard
17162 So here then is an example that use all these features:
17165 \begin_layout LyX-Code
17166 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
17169 \begin_layout Standard
17170 This defines a macro that prints the author, followed by a comma, if the
17172 \begin_inset Flex Code
17175 \begin_layout Plain Layout
17181 key is defined, or else prints the name of the editor, followed by the
17183 \begin_inset Flex Code
17186 \begin_layout Plain Layout
17192 or its translation (it is by default
17193 \begin_inset Quotes eld
17197 \begin_inset Quotes erd
17201 \begin_inset Flex Code
17204 \begin_layout Plain Layout
17211 Note that this is in fact defined in
17212 \begin_inset Flex Code
17215 \begin_layout Plain Layout
17221 , so you can use it in your own definitions, or re-definitions, if you load
17225 \begin_layout Section
17226 \begin_inset CommandInset label
17228 name "sec:Tags-for-XHTML"
17232 Tags for XHTML output
17235 \begin_layout Standard
17236 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
17237 by layout information.
17238 In general, LyX provides sensible defaults and, as mentioned earlier, it
17239 will even construct default CSS style rules from the other layout tags.
17240 For example, LyX will attempt to use the information provided in the
17241 \begin_inset Flex Code
17244 \begin_layout Plain Layout
17250 declaration for the Chapter style to write CSS that will appropriately
17251 format chapter headings.
17254 \begin_layout Standard
17255 In many cases, then, you may not have to do anything at all to get acceptable
17256 XHTML output for your own environments, custom insets, and so forth.
17257 But in some cases you will, and so LyX provides a number of layout tags
17258 that can be used to customize the XHTML and CSS that are generated.
17261 \begin_layout Standard
17262 Note that there are two tags,
17263 \begin_inset Flex Code
17266 \begin_layout Plain Layout
17273 \begin_inset Flex Code
17276 \begin_layout Plain Layout
17282 that may appear outside style and inset declarations.
17284 \begin_inset CommandInset ref
17286 reference "sub:General-text-class"
17290 for details on these.
17293 \begin_layout Subsection
17294 \begin_inset CommandInset label
17296 name "sub:Paragraph-Style-XHTML"
17303 \begin_layout Standard
17304 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
17305 dealing with a normal paragraph, a command, or an environment, where this
17306 is itself determined by the contents of the corresponding
17307 \begin_inset Flex Code
17310 \begin_layout Plain Layout
17320 \begin_layout Standard
17321 For a command or normal paragraph, the output XHTML has the following form:
17324 \begin_layout LyX-Code
17326 \begin_inset Quotes erd
17330 \begin_inset Quotes erd
17336 \begin_layout LyX-Code
17338 \begin_inset Quotes erd
17342 \begin_inset Quotes erd
17348 \begin_layout LyX-Code
17349 Contents of the paragraph.
17352 \begin_layout LyX-Code
17356 \begin_layout Standard
17357 The label tags are of course omitted if the paragraph does not have a label.
17360 \begin_layout Standard
17361 For an environment that is not some sort of list, the XHTML takes this form:
17364 \begin_layout LyX-Code
17366 \begin_inset Quotes erd
17370 \begin_inset Quotes erd
17376 \begin_layout LyX-Code
17378 \begin_inset Quotes erd
17382 \begin_inset Quotes erd
17386 \begin_inset Quotes erd
17390 \begin_inset Quotes erd
17393 >Environment Label</labeltag>First paragraph.</itemtag>
17396 \begin_layout LyX-Code
17397 <itemtag>Second paragraph.</itemtag>
17400 \begin_layout LyX-Code
17404 \begin_layout Standard
17405 Note that the label is output only for the first paragraph, as it should
17406 be for a theorem, for example.
17410 \begin_layout Standard
17411 For a list, we have one of these forms:
17414 \begin_layout LyX-Code
17416 \begin_inset Quotes erd
17420 \begin_inset Quotes erd
17426 \begin_layout LyX-Code
17428 \begin_inset Quotes erd
17432 \begin_inset Quotes erd
17436 \begin_inset Quotes erd
17440 \begin_inset Quotes erd
17443 >List Label</labeltag>First item.</itemtag>
17446 \begin_layout LyX-Code
17448 \begin_inset Quotes erd
17452 \begin_inset Quotes erd
17456 \begin_inset Quotes erd
17460 \begin_inset Quotes erd
17463 >List Label</labeltag>Second item.</itemtag>
17466 \begin_layout LyX-Code
17470 \begin_layout LyX-Code
17474 \begin_layout LyX-Code
17476 \begin_inset Quotes erd
17480 \begin_inset Quotes erd
17486 \begin_layout LyX-Code
17488 \begin_inset Quotes erd
17492 \begin_inset Quotes erd
17495 >List Label</labeltag><itemtag attr=
17496 \begin_inset Quotes erd
17500 \begin_inset Quotes erd
17503 >First item.</itemtag>
17506 \begin_layout LyX-Code
17508 \begin_inset Quotes erd
17512 \begin_inset Quotes erd
17515 >List Label</labeltag><itemtag attr=
17516 \begin_inset Quotes erd
17520 \begin_inset Quotes erd
17523 >Second item.</itemtag>
17526 \begin_layout LyX-Code
17530 \begin_layout Standard
17531 Note the different orders of
17532 \begin_inset Flex Code
17535 \begin_layout Plain Layout
17542 \begin_inset Flex Code
17545 \begin_layout Plain Layout
17552 Which order we get depends upon the setting of
17553 \begin_inset Flex Code
17556 \begin_layout Plain Layout
17563 \begin_inset Flex Code
17566 \begin_layout Plain Layout
17572 is false (the default), you get the first of these, with the label within
17573 the item; if true, you get the second, with the label outside the item.
17576 \begin_layout Standard
17577 The specific tags and attributes output for each paragraph type can be controlle
17578 d by means of the layout tags we are about to describe.
17579 As mentioned earlier, however, LyX uses sensible defaults for many of these,
17580 so you often may not need to do very much to get good XHTML output.
17581 Think of the available tags as there so you can tweak things to your liking.
17584 \begin_layout Description
17585 \begin_inset Flex Code
17588 \begin_layout Plain Layout
17595 \begin_inset Flex Code
17598 \begin_layout Plain Layout
17604 ] Specifies attribute information to be output with the main tag.
17606 \begin_inset Quotes eld
17610 \begin_inset Flex Code
17613 \begin_layout Plain Layout
17620 \begin_inset Quotes erd
17624 By default, LyX will output
17625 \begin_inset Quotes eld
17629 \begin_inset Flex Code
17632 \begin_layout Plain Layout
17639 \begin_inset Quotes erd
17643 \begin_inset Flex Code
17646 \begin_layout Plain Layout
17652 is the LyX name of the layout, made lowercase, for example: chapter.
17657 contain any style information.
17659 \begin_inset Flex Code
17662 \begin_layout Plain Layout
17671 \begin_layout Description
17672 \begin_inset Flex Code
17675 \begin_layout Plain Layout
17682 \begin_inset Flex Code
17685 \begin_layout Plain Layout
17695 ] Whether to output the default CSS information LyX generates for this layout,
17696 even if additional information is explicitly provided via
17697 \begin_inset Flex Code
17700 \begin_layout Plain Layout
17708 \begin_inset Flex Code
17711 \begin_layout Plain Layout
17717 allows you to alter or augment the generated CSS, rather than to override
17720 \begin_inset Flex Code
17723 \begin_layout Plain Layout
17732 \begin_layout Description
17733 \begin_inset Flex Code
17736 \begin_layout Plain Layout
17743 \begin_inset Flex Code
17746 \begin_layout Plain Layout
17752 ] The tag to be used for individual paragraphs of environments, replacing
17754 \begin_inset Flex Code
17757 \begin_layout Plain Layout
17763 in the examples above.
17765 \begin_inset Flex Code
17768 \begin_layout Plain Layout
17777 \begin_layout Description
17778 \begin_inset Flex Code
17781 \begin_layout Plain Layout
17788 \begin_inset Flex Code
17791 \begin_layout Plain Layout
17797 ] Attributes for the item tag.
17799 \begin_inset Quotes eld
17803 \begin_inset Flex Code
17806 \begin_layout Plain Layout
17807 class=`layoutname_item'
17813 \begin_inset Quotes erd
17821 contain any style information.
17823 \begin_inset Flex Code
17826 \begin_layout Plain Layout
17835 \begin_layout Description
17836 \begin_inset Flex Code
17839 \begin_layout Plain Layout
17846 \begin_inset Flex Code
17849 \begin_layout Plain Layout
17855 ] The tag to be used for paragraph and item labels, replacing
17856 \begin_inset Flex Code
17859 \begin_layout Plain Layout
17865 in the examples above.
17867 \begin_inset Flex Code
17870 \begin_layout Plain Layout
17877 \begin_inset Flex Code
17880 \begin_layout Plain Layout
17887 \begin_inset Flex Code
17890 \begin_layout Plain Layout
17897 \begin_inset Flex Code
17900 \begin_layout Plain Layout
17901 Centered_Top_Environment
17906 , in which case it defaults to
17907 \begin_inset Flex Code
17910 \begin_layout Plain Layout
17919 \begin_layout Description
17920 \begin_inset Flex Code
17923 \begin_layout Plain Layout
17930 \begin_inset Flex Code
17933 \begin_layout Plain Layout
17939 ] Attributes for the label tag.
17941 \begin_inset Quotes eld
17945 \begin_inset Flex Code
17948 \begin_layout Plain Layout
17949 class=`layoutname_label'
17955 \begin_inset Quotes erd
17963 contain any style information.
17965 \begin_inset Flex Code
17968 \begin_layout Plain Layout
17977 \begin_layout Description
17978 \begin_inset Flex Code
17981 \begin_layout Plain Layout
17988 \begin_inset Flex Code
17991 \begin_layout Plain Layout
18001 ] Meaningful only for list-like environments, this tag controls whether
18002 the label tag is output before or inside the item tag.
18003 This is used, for example, in the description environment, where we want
18005 \begin_inset Flex Code
18008 \begin_layout Plain Layout
18009 <dt>\SpecialChar \ldots{}
18010 </dt><dd>\SpecialChar \ldots{}
18018 \begin_inset Flex Code
18021 \begin_layout Plain Layout
18027 : The label tag is output inside the item tag.
18030 \begin_layout Description
18031 \begin_inset Flex Code
18034 \begin_layout Plain Layout
18040 Information to be output in the
18041 \begin_inset Flex Code
18044 \begin_layout Plain Layout
18050 section when this style is used.
18051 This might, for example, be used to include a
18052 \begin_inset Flex Code
18055 \begin_layout Plain Layout
18062 \begin_inset Flex Code
18065 \begin_layout Plain Layout
18074 \begin_layout Description
18075 \begin_inset Flex Code
18078 \begin_layout Plain Layout
18084 CSS style information to be included when this style is used.
18085 Note that this will automatically be wrapped in a layout-generated
18086 \begin_inset Flex Code
18089 \begin_layout Plain Layout
18095 block, so only the CSS itself need be included.
18098 \begin_layout Description
18099 \begin_inset Flex Code
18102 \begin_layout Plain Layout
18109 \begin_inset Flex Code
18112 \begin_layout Plain Layout
18118 ] The tag to be used for the main label, replacing
18119 \begin_inset Flex Code
18122 \begin_layout Plain Layout
18128 in the examples above.
18130 \begin_inset Flex Code
18133 \begin_layout Plain Layout
18142 \begin_layout Description
18143 \begin_inset Flex Code
18146 \begin_layout Plain Layout
18153 \begin_inset Flex Code
18156 \begin_layout Plain Layout
18166 ] Marks this style as the one to be used to generate the
18167 \begin_inset Flex Code
18170 \begin_layout Plain Layout
18176 tag for the XHTML file.
18177 By default, it is false.
18179 \begin_inset Flex Code
18182 \begin_layout Plain Layout
18188 file sets it to true for the
18189 \begin_inset Flex Code
18192 \begin_layout Plain Layout
18202 \begin_layout Subsection
18206 \begin_layout Standard
18207 The XHTML output of insets can also be controlled by information in layout
18212 \begin_layout Plain Layout
18213 At present, this is true only for
18214 \begin_inset Quotes eld
18218 \begin_inset Quotes erd
18221 insets (insets you can type into) and is not true for
18222 \begin_inset Quotes eld
18226 \begin_inset Quotes erd
18229 insets (insets that are associated with dialog boxes).
18234 Here, too, LyX tries to provide sensible defaults, and it constructs default
18236 But everything can be customized.
18239 \begin_layout Standard
18240 The XHTML LyX outputs for an inset has the following form:
18243 \begin_layout LyX-Code
18245 \begin_inset Quotes erd
18249 \begin_inset Quotes erd
18255 \begin_layout LyX-Code
18256 <labeltag>Label</labeltag>
18259 \begin_layout LyX-Code
18261 \begin_inset Quotes erd
18265 \begin_inset Quotes erd
18268 >Contents of the inset.</innertag>
18271 \begin_layout LyX-Code
18275 \begin_layout Standard
18276 If the inset permits multiple paragraphs---that is, if
18277 \begin_inset Flex Code
18280 \begin_layout Plain Layout
18286 is true---then the contents of the inset will itself be output as paragraphs
18287 formatted according to the styles used for those paragraphs (standard,
18288 quote, and the like).
18289 The label tag is of course omitted if the paragraph does not have a label
18290 and, at present, is always
18291 \begin_inset Flex Code
18294 \begin_layout Plain Layout
18301 The inner tag is optional and, by default, does not appear.
18304 \begin_layout Standard
18305 The specific tags and attributes output for each inset can be controlled
18306 by means of the following layout tags.
18309 \begin_layout Description
18310 \begin_inset Flex Code
18313 \begin_layout Plain Layout
18320 \begin_inset Flex Code
18323 \begin_layout Plain Layout
18329 ] Specifies attribute information to be output with the main tag.
18331 \begin_inset Quotes eld
18335 \begin_inset Flex Code
18338 \begin_layout Plain Layout
18339 class=`myinset' onclick=`\SpecialChar \ldots{}
18346 \begin_inset Quotes erd
18350 By default, LyX will output
18351 \begin_inset Quotes eld
18355 \begin_inset Flex Code
18358 \begin_layout Plain Layout
18365 \begin_inset Quotes erd
18369 \begin_inset Flex Code
18372 \begin_layout Plain Layout
18378 is the LyX name of the inset, made lowercase and with non-alphanumeric
18379 characters converted to underscores, for example: footnote.
18382 \begin_layout Description
18383 \begin_inset Flex Code
18386 \begin_layout Plain Layout
18393 \begin_inset Flex Code
18396 \begin_layout Plain Layout
18406 ] Whether to output the default CSS information LyX generates for this layout,
18407 even if additional information is explicitly provided via
18408 \begin_inset Flex Code
18411 \begin_layout Plain Layout
18419 \begin_inset Flex Code
18422 \begin_layout Plain Layout
18428 allows you to alter or augment the generated CSS, rather than to override
18433 \begin_layout Description
18434 \begin_inset Flex Code
18437 \begin_layout Plain Layout
18444 \begin_inset Flex Code
18447 \begin_layout Plain Layout
18453 ] Attributes for the inner tag.
18455 \begin_inset Quotes eld
18459 \begin_inset Flex Code
18462 \begin_layout Plain Layout
18463 class=`insetname_inner'
18469 \begin_inset Quotes erd
18475 \begin_layout Description
18476 \begin_inset Flex Code
18479 \begin_layout Plain Layout
18486 \begin_inset Flex Code
18489 \begin_layout Plain Layout
18495 ] The inner tag, replacing
18496 \begin_inset Flex Code
18499 \begin_layout Plain Layout
18505 in the examples above.
18506 By default, there is none.
18509 \begin_layout Description
18510 \begin_inset Flex Code
18513 \begin_layout Plain Layout
18520 \begin_inset Flex Code
18523 \begin_layout Plain Layout
18531 ] Whether this inset represents a standalone block of text (such as a footnote)
18532 or instead represents material that is included in the surrounding text
18533 (such as a branch).
18537 \begin_layout Description
18538 \begin_inset Flex Code
18541 \begin_layout Plain Layout
18548 \begin_inset Flex Code
18551 \begin_layout Plain Layout
18557 ] A label for this inset, possibly including a reference to a counter.
18558 For example, for footnote, it might be:
18559 \begin_inset Flex Code
18562 \begin_layout Plain Layout
18571 This is optional, and there is no default.
18574 \begin_layout Description
18575 \begin_inset Flex Code
18578 \begin_layout Plain Layout
18584 Information to be output in the
18585 \begin_inset Flex Code
18588 \begin_layout Plain Layout
18594 section when this style is used.
18595 This might, for example, be used to include a
18596 \begin_inset Flex Code
18599 \begin_layout Plain Layout
18606 \begin_inset Flex Code
18609 \begin_layout Plain Layout
18618 \begin_layout Description
18619 \begin_inset Flex Code
18622 \begin_layout Plain Layout
18628 CSS style information to be included when this style is used.
18629 Note that this will automatically be wrapped in a layout-generated
18630 \begin_inset Flex Code
18633 \begin_layout Plain Layout
18639 block, so only the CSS itself need be included.
18642 \begin_layout Description
18643 \begin_inset Flex Code
18646 \begin_layout Plain Layout
18653 \begin_inset Flex Code
18656 \begin_layout Plain Layout
18662 ] The tag to be used for the main label, replacing
18663 \begin_inset Flex Code
18666 \begin_layout Plain Layout
18672 in the examples above.
18673 The default depends upon the setting of
18674 \begin_inset Flex Code
18677 \begin_layout Plain Layout
18684 \begin_inset Flex Code
18687 \begin_layout Plain Layout
18693 is true, the default is
18694 \begin_inset Flex Code
18697 \begin_layout Plain Layout
18703 ; if it is false, the default is
18704 \begin_inset Flex Code
18707 \begin_layout Plain Layout
18716 \begin_layout Subsection
18720 \begin_layout Standard
18721 The XHTML output for floats too can be controlled by layout information.
18722 The output has the following form:
18725 \begin_layout LyX-Code
18727 \begin_inset Quotes erd
18731 \begin_inset Quotes erd
18737 \begin_layout LyX-Code
18738 Contents of the float.
18741 \begin_layout LyX-Code
18745 \begin_layout Standard
18746 The caption, if there is one, is a separate inset and will be output as
18748 Its appearance can be controlled via the InsetLayout for caption insets.
18752 \begin_layout Description
18753 \begin_inset Flex Code
18756 \begin_layout Plain Layout
18763 \begin_inset Flex Code
18766 \begin_layout Plain Layout
18772 ] Specifies attribute information to be output with the main tag.
18774 \begin_inset Quotes eld
18778 \begin_inset Flex Code
18781 \begin_layout Plain Layout
18782 class=`myfloat' onclick=`\SpecialChar \ldots{}
18789 \begin_inset Quotes erd
18793 By default, LyX will output
18794 \begin_inset Quotes eld
18798 \begin_inset Flex Code
18801 \begin_layout Plain Layout
18802 class=`float float-floattype'
18808 \begin_inset Quotes erd
18812 \begin_inset Flex Code
18815 \begin_layout Plain Layout
18821 is LyX's name for this type of float, as determined by the float declaration
18823 \begin_inset CommandInset ref
18825 reference "sub:Floats"
18829 ), though made lowercase and with non-alphanumeric characters converted
18830 to underscores, for example: float-table.
18833 \begin_layout Description
18834 \begin_inset Flex Code
18837 \begin_layout Plain Layout
18843 CSS style information to be included when this float is used.
18844 Note that this will automatically be wrapped in a layout-generated
18845 \begin_inset Flex Code
18848 \begin_layout Plain Layout
18854 block, so only the CSS itself need be included.
18857 \begin_layout Description
18858 \begin_inset Flex Code
18861 \begin_layout Plain Layout
18868 \begin_inset Flex Code
18871 \begin_layout Plain Layout
18877 ] The tag to be used for this float, replacing
18878 \begin_inset Quotes eld
18882 \begin_inset Flex Code
18885 \begin_layout Plain Layout
18892 \begin_inset Quotes erd
18895 in the example above.
18897 \begin_inset Flex Code
18900 \begin_layout Plain Layout
18906 and will rarely need changing.
18909 \begin_layout Subsection
18910 Bibliography formatting
18913 \begin_layout Standard
18914 The bibliography can be formatted using
18915 \begin_inset Flex Code
18918 \begin_layout Plain Layout
18926 \begin_inset CommandInset ref
18928 reference "sub:Citation-format-description"
18935 \begin_layout Subsection
18939 \begin_layout Standard
18940 We have several times mentioned that LyX will generate default CSS style
18941 rules for both insets and paragraph styles, based upon the other layout
18942 information that is provided.
18943 In this section, we shall say a word about which layout information LyX
18947 \begin_layout Standard
18948 At present, LyX auto-generates CSS only for font information, making use
18950 \begin_inset Flex Code
18953 \begin_layout Plain Layout
18960 \begin_inset Flex Code
18963 \begin_layout Plain Layout
18970 \begin_inset Flex Code
18973 \begin_layout Plain Layout
18980 \begin_inset Flex Code
18983 \begin_layout Plain Layout
18990 \begin_inset Flex Code
18993 \begin_layout Plain Layout
19001 \begin_inset CommandInset ref
19003 reference "sub:Font-description"
19007 .) The translation is mostly straightforward and obvious.
19009 \begin_inset Quotes eld
19013 \begin_inset Flex Code
19016 \begin_layout Plain Layout
19023 \begin_inset Quotes erd
19027 \begin_inset Quotes eld
19031 \begin_inset Flex Code
19034 \begin_layout Plain Layout
19035 font-family: sans-serif;
19041 \begin_inset Quotes erd
19045 The correspondence of LyX sizes and CSS sizes is a little less obvious
19046 but nonetheless intuitive.
19048 \begin_inset Flex Code
19051 \begin_layout Plain Layout
19058 \begin_inset Flex URL
19061 \begin_layout Plain Layout
19071 \begin_layout Chapter
19072 Including External Material
19075 \begin_layout Standard
19076 \begin_inset Box Shadowbox
19086 height_special "totalheight"
19089 \begin_layout Plain Layout
19090 WARNING: This portion of the documentation has not been updated for some
19092 We certainly hope that it is still accurate, but there are no guarantees.
19100 \begin_layout Standard
19101 The use of material from sources external to LyX is covered in detail in
19107 This part of the manual covers what needs to happen behind the scenes for
19108 new sorts of material to be included.
19111 \begin_layout Section
19115 \begin_layout Standard
19116 The external material feature is based on the concept of a
19121 A template is a specification of how LyX should interface with a certain
19123 As bundled, LyX comes with predefined templates for Xfig figures, various
19124 raster format images, chess diagrams, and LilyPond music notation.
19125 You can check the actual list by using the menu
19126 \begin_inset Flex MenuItem
19129 \begin_layout Plain Layout
19130 Insert\SpecialChar \menuseparator
19131 File\SpecialChar \menuseparator
19138 Furthermore, it is possible to roll your own template to support a specific
19140 Later we'll describe in more detail what is involved, and hopefully you
19141 will submit all the templates you create so we can include them in a later
19145 \begin_layout Standard
19146 Another basic idea of the external material feature is to distinguish between
19147 the original file that serves as a base for final material and the produced
19148 file that is included in your exported or printed document.
19149 For example, consider the case of a figure produced with
19150 \begin_inset Flex Code
19153 \begin_layout Plain Layout
19160 The Xfig application itself works on an original file with the
19161 \begin_inset Flex Code
19164 \begin_layout Plain Layout
19171 Within Xfig, you create and change your figure, and when you are done,
19173 \begin_inset Flex Code
19176 \begin_layout Plain Layout
19183 When you want to include the figure in your document, you invoke
19184 \begin_inset Flex Code
19187 \begin_layout Plain Layout
19193 in order to create a PostScript file that can readily be included in your
19196 \begin_inset Flex Code
19199 \begin_layout Plain Layout
19205 file is the original file, and the PostScript file is the produced file.
19208 \begin_layout Standard
19209 This distinction is important in order to allow updating of the material
19210 while you are in the process of writing the document.
19211 Furthermore, it provides us with the flexibility that is needed to support
19212 multiple export formats.
19213 For instance, in the case of a plain text file, it is not exactly an award-winn
19214 ing idea to include the figure as raw PostScript.
19215 Instead, you would either prefer to just include a reference to the figure
19216 or try to invoke some graphics to ASCII converter to make the final result
19217 look similar to the real graphics.
19218 The external material management allows you to do this, because it is parametri
19219 zed on the different export formats that LyX supports.
19222 \begin_layout Standard
19223 Besides supporting the production of different products according to the
19224 exported format, it supports tight integration with editing and viewing
19226 In the case of an Xfig figure, you are able to invoke Xfig on the original
19227 file with a single click from within the external material dialog in LyX,
19228 and also preview the produced PostScript file with Ghostview with another
19230 No more fiddling around with the command line and/or file browsers to locate
19231 and manipulate the original or produced files.
19232 In this way, you are finally able to take full advantage of the many different
19233 applications that are relevant to use when you write your documents, and
19234 ultimately be more productive.
19237 \begin_layout Section
19238 The external template configuration file
19241 \begin_layout Standard
19242 It is relatively easy to add custom external template definitions to LyX.
19243 However, be aware that doing this in an careless manner most probably
19247 introduce an easily exploitable security hole.
19248 So before you do this, please read the discussion about security in section
19250 \begin_inset CommandInset ref
19252 reference "sec:Security-discussion"
19259 \begin_layout Standard
19260 Having said that, we encourage you to submit any interesting templates that
19265 \begin_layout Standard
19266 The external templates are defined in the
19267 \begin_inset Flex Code
19270 \begin_layout Plain Layout
19271 LyXDir/lib/external_templates
19277 You can place your own version in
19278 \begin_inset Flex Code
19281 \begin_layout Plain Layout
19282 UserDir/external_templates
19290 \begin_layout Standard
19291 A typical template looks like this:
19294 \begin_layout LyX-Code
19298 \begin_layout LyX-Code
19299 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
19302 \begin_layout LyX-Code
19306 \begin_layout LyX-Code
19310 \begin_layout LyX-Code
19314 \begin_layout LyX-Code
19318 \begin_layout LyX-Code
19322 \begin_layout LyX-Code
19323 AutomaticProduction true
19326 \begin_layout LyX-Code
19330 \begin_layout LyX-Code
19334 \begin_layout LyX-Code
19338 \begin_layout LyX-Code
19339 TransformCommand Rotate RotationLatexCommand
19342 \begin_layout LyX-Code
19343 TransformCommand Resize ResizeLatexCommand
19346 \begin_layout LyX-Code
19347 Product "$$RotateFront$$ResizeFront
19350 \begin_layout LyX-Code
19355 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
19358 \begin_layout LyX-Code
19359 $$ResizeBack$$RotateBack"
19362 \begin_layout LyX-Code
19366 \begin_layout LyX-Code
19367 UpdateResult "$$AbsPath$$Basename.pstex_t"
19370 \begin_layout LyX-Code
19371 Requirement "graphicx"
19374 \begin_layout LyX-Code
19375 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
19378 \begin_layout LyX-Code
19379 ReferencedFile latex "$$AbsPath$$Basename.eps"
19382 \begin_layout LyX-Code
19383 ReferencedFile dvi "$$AbsPath$$Basename.eps"
19386 \begin_layout LyX-Code
19390 \begin_layout LyX-Code
19394 \begin_layout LyX-Code
19395 TransformCommand Rotate RotationLatexCommand
19398 \begin_layout LyX-Code
19399 TransformCommand Resize ResizeLatexCommand
19402 \begin_layout LyX-Code
19403 Product "$$RotateFront$$ResizeFront
19406 \begin_layout LyX-Code
19411 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
19414 \begin_layout LyX-Code
19415 $$ResizeBack$$RotateBack"
19418 \begin_layout LyX-Code
19419 UpdateFormat pdftex
19422 \begin_layout LyX-Code
19423 UpdateResult "$$AbsPath$$Basename.pdftex_t"
19426 \begin_layout LyX-Code
19427 Requirement "graphicx"
19430 \begin_layout LyX-Code
19431 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
19434 \begin_layout LyX-Code
19435 ReferencedFile latex "$$AbsPath$$Basename.pdf"
19438 \begin_layout LyX-Code
19442 \begin_layout LyX-Code
19446 \begin_layout LyX-Code
19447 Product "$$Contents(
19449 "$$AbsPath$$Basename.asc
19454 \begin_layout LyX-Code
19455 UpdateFormat asciixfig
19458 \begin_layout LyX-Code
19459 UpdateResult "$$AbsPath$$Basename.asc"
19462 \begin_layout LyX-Code
19466 \begin_layout LyX-Code
19470 \begin_layout LyX-Code
19471 Product "<graphic fileref=
19473 "$$AbsOrRelPathMaster$$Basename.eps
19478 \begin_layout LyX-Code
19482 \begin_layout LyX-Code
19486 \begin_layout LyX-Code
19487 UpdateResult "$$AbsPath$$Basename.eps"
19490 \begin_layout LyX-Code
19491 ReferencedFile docbook "$$AbsPath$$Basename.eps"
19494 \begin_layout LyX-Code
19495 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
19498 \begin_layout LyX-Code
19502 \begin_layout LyX-Code
19503 Product "[XFig: $$FName]"
19506 \begin_layout LyX-Code
19510 \begin_layout LyX-Code
19514 \begin_layout Standard
19515 As you can see, the template is enclosed in
19516 \begin_inset Flex Code
19519 \begin_layout Plain Layout
19525 \SpecialChar \ldots{}
19527 \begin_inset Flex Code
19530 \begin_layout Plain Layout
19537 It contains a header specifying some general settings and, for each supported
19538 primary document file format, a section
19539 \begin_inset Flex Code
19542 \begin_layout Plain Layout
19548 \SpecialChar \ldots{}
19550 \begin_inset Flex Code
19553 \begin_layout Plain Layout
19562 \begin_layout Subsection
19563 The template header
19566 \begin_layout Description
19567 \begin_inset Flex Code
19570 \begin_layout Plain Layout
19571 AutomaticProduction
19572 \begin_inset space ~
19580 Whether the file represented by the template must be generated by LyX.
19581 This command must occur exactly once.
19584 \begin_layout Description
19585 \begin_inset Flex Code
19588 \begin_layout Plain Layout
19590 \begin_inset space ~
19598 A glob pattern that is used in the file dialog to filter out the desired
19600 If there is more than one possible file extension (e.
19601 \begin_inset space \thinspace{}
19605 \begin_inset space \space{}
19609 \begin_inset Flex Code
19612 \begin_layout Plain Layout
19619 \begin_inset Flex Code
19622 \begin_layout Plain Layout
19628 ), use something like
19629 \begin_inset Flex Code
19632 \begin_layout Plain Layout
19639 This command must occur exactly once.
19642 \begin_layout Description
19643 \begin_inset Flex Code
19646 \begin_layout Plain Layout
19648 \begin_inset space ~
19656 The text that is displayed on the button.
19657 This command must occur exactly once.
19660 \begin_layout Description
19661 \begin_inset Flex Code
19664 \begin_layout Plain Layout
19666 \begin_inset space ~
19670 \begin_inset space ~
19678 The help text that is used in the External dialog.
19679 Provide enough information to explain to the user just what the template
19680 can provide him with.
19681 This command must occur exactly once.
19684 \begin_layout Description
19685 \begin_inset Flex Code
19688 \begin_layout Plain Layout
19690 \begin_inset space ~
19698 The file format of the original file.
19699 This must be the name of a format that is known to LyX (see section
19700 \begin_inset space ~
19704 \begin_inset CommandInset ref
19706 reference "sec:Formats"
19712 \begin_inset Quotes eld
19716 \begin_inset Flex Code
19719 \begin_layout Plain Layout
19726 \begin_inset Quotes erd
19729 if the template can handle original files of more than one format.
19730 LyX will attempt to interrogate the file itself in order to deduce its
19731 format in this case.
19732 This command must occur exactly once.
19735 \begin_layout Description
19736 \begin_inset Flex Code
19739 \begin_layout Plain Layout
19741 \begin_inset space ~
19749 A unique name for the template.
19750 It must not contain substitution macros (see below).
19753 \begin_layout Description
19754 \begin_inset Flex Code
19757 \begin_layout Plain Layout
19759 \begin_inset space ~
19762 Rotate|Resize|Clip|Extra
19767 This command specifies which transformations are supported by this template.
19768 It may occur zero or more times.
19769 This command enables the corresponding tabs in the external dialog.
19771 \begin_inset Flex Code
19774 \begin_layout Plain Layout
19780 command must have either a corresponding
19781 \begin_inset Flex Code
19784 \begin_layout Plain Layout
19791 \begin_inset Flex Code
19794 \begin_layout Plain Layout
19801 \begin_inset Flex Code
19804 \begin_layout Plain Layout
19811 Otherwise the transformation will not be supported by that format.
19814 \begin_layout Subsection
19818 \begin_layout Description
19819 \begin_inset Flex Code
19822 \begin_layout Plain Layout
19824 \begin_inset space ~
19827 LaTeX|PDFLaTeX|PlainText|DocBook
19832 The primary document file format that this format definition is for.
19833 Not every template has a sensible representation in all document file formats.
19834 Please define nevertheless a
19835 \begin_inset Flex Code
19838 \begin_layout Plain Layout
19844 section for all templates.
19845 Use a dummy text when no representation is available.
19846 Then you can at least see a reference to the external material in the exported
19850 \begin_layout Description
19851 \begin_inset Flex Code
19854 \begin_layout Plain Layout
19856 \begin_inset space ~
19860 \begin_inset space ~
19868 This command defines an additional macro
19869 \begin_inset Flex Code
19872 \begin_layout Plain Layout
19878 for substitution in
19879 \begin_inset Flex Code
19882 \begin_layout Plain Layout
19890 \begin_inset Flex Code
19893 \begin_layout Plain Layout
19899 itself may contain substitution macros.
19900 The advantage over using
19901 \begin_inset Flex Code
19904 \begin_layout Plain Layout
19911 \begin_inset Flex Code
19914 \begin_layout Plain Layout
19920 is that the substituted value of
19921 \begin_inset Flex Code
19924 \begin_layout Plain Layout
19930 is sanitized so that it is a valid optional argument in the document format.
19931 This command may occur zero or more times.
19934 \begin_layout Description
19935 \begin_inset Flex Code
19938 \begin_layout Plain Layout
19940 \begin_inset space ~
19948 The text that is inserted in the exported document.
19949 This is actually the most important command and can be quite complex.
19950 This command must occur exactly once.
19953 \begin_layout Description
19954 \begin_inset Flex Code
19957 \begin_layout Plain Layout
19959 \begin_inset space ~
19967 This command specifies a preamble snippet that will be included in the
19969 It has to be defined using
19970 \begin_inset Flex Code
19973 \begin_layout Plain Layout
19979 \SpecialChar \ldots{}
19981 \begin_inset Flex Code
19984 \begin_layout Plain Layout
19991 This command may occur zero or more times.
19994 \begin_layout Description
19995 \begin_inset Flex Code
19998 \begin_layout Plain Layout
20000 \begin_inset space ~
20004 \begin_inset space ~
20012 This command denotes files that are created by the conversion process and
20013 are needed for a particular export format.
20014 If the filename is relative, it is interpreted relative to the master document.
20015 This command may be given zero or more times.
20018 \begin_layout Description
20019 \begin_inset Flex Code
20022 \begin_layout Plain Layout
20024 \begin_inset space ~
20032 The name of a required LaTeX package.
20033 The package is included via
20034 \begin_inset Flex Code
20037 \begin_layout Plain Layout
20045 in the LaTeX preamble.
20046 This command may occur zero or more times.
20049 \begin_layout Description
20050 \begin_inset Flex Code
20053 \begin_layout Plain Layout
20055 \begin_inset space ~
20059 \begin_inset space ~
20062 RotationLatexCommand
20067 This command specifies that the built in LaTeX command should be used for
20069 This command may occur once or not at all.
20072 \begin_layout Description
20073 \begin_inset Flex Code
20076 \begin_layout Plain Layout
20078 \begin_inset space ~
20082 \begin_inset space ~
20090 This command specifies that the built in LaTeX command should be used for
20092 This command may occur once or not at all.
20095 \begin_layout Description
20096 \begin_inset Flex Code
20099 \begin_layout Plain Layout
20101 \begin_inset space ~
20105 \begin_inset space ~
20108 RotationLatexOption
20113 This command specifies that rotation is done via an optional argument.
20114 This command may occur once or not at all.
20117 \begin_layout Description
20118 \begin_inset Flex Code
20121 \begin_layout Plain Layout
20123 \begin_inset space ~
20127 \begin_inset space ~
20135 This command specifies that resizing is done via an optional argument.
20136 This command may occur once or not at all.
20139 \begin_layout Description
20140 \begin_inset Flex Code
20143 \begin_layout Plain Layout
20145 \begin_inset space ~
20149 \begin_inset space ~
20157 This command specifies that clipping is done via an optional argument.
20158 This command may occur once or not at all.
20161 \begin_layout Description
20162 \begin_inset Flex Code
20165 \begin_layout Plain Layout
20167 \begin_inset space ~
20171 \begin_inset space ~
20179 This command specifies that an extra optional argument is used.
20180 This command may occur once or not at all.
20183 \begin_layout Description
20184 \begin_inset Flex Code
20187 \begin_layout Plain Layout
20189 \begin_inset space ~
20197 The file format of the converted file.
20198 This must be the name of a format that is known to LyX (see the
20199 \begin_inset Flex MenuItem
20202 \begin_layout Plain Layout
20207 ools\SpecialChar \menuseparator
20212 references\SpecialChar \menuseparator
20213 File Handling\SpecialChar \menuseparator
20220 This command must occur exactly once.
20223 \begin_layout Description
20224 \begin_inset Flex Code
20227 \begin_layout Plain Layout
20229 \begin_inset space ~
20237 The file name of the converted file.
20238 The file name must be absolute.
20239 This command must occur exactly once.
20242 \begin_layout Subsection
20243 Preamble definitions
20246 \begin_layout Standard
20247 The external template configuration file may contain additional preamble
20248 definitions enclosed by
20249 \begin_inset Flex Code
20252 \begin_layout Plain Layout
20258 \SpecialChar \ldots{}
20260 \begin_inset Flex Code
20263 \begin_layout Plain Layout
20270 They can be used by the templates in the
20271 \begin_inset Flex Code
20274 \begin_layout Plain Layout
20283 \begin_layout Section
20284 The substitution mechanism
20287 \begin_layout Standard
20288 When the external material facility invokes an external program, it is done
20289 on the basis of a command defined in the template configuration file.
20290 These commands can contain various macros that are expanded before execution.
20291 Execution always take place in the directory of the containing document.
20294 \begin_layout Standard
20295 Also, whenever external material is to be displayed, the name will be produced
20296 by the substitution mechanism, and most other commands in the template
20297 definition support substitution as well.
20300 \begin_layout Standard
20301 The available macros are the following:
20304 \begin_layout Description
20305 \begin_inset Flex Code
20308 \begin_layout Plain Layout
20309 $$AbsOrRelPathMaster
20314 The file path, absolute or relative to the master LyX document.
20317 \begin_layout Description
20318 \begin_inset Flex Code
20321 \begin_layout Plain Layout
20322 $$AbsOrRelPathParent
20327 The file path, absolute or relative to the LyX document.
20330 \begin_layout Description
20331 \begin_inset Flex Code
20334 \begin_layout Plain Layout
20340 The absolute file path.
20343 \begin_layout Description
20344 \begin_inset Flex Code
20347 \begin_layout Plain Layout
20353 The filename without path and without the extension.
20356 \begin_layout Description
20357 \begin_inset Flex Code
20360 \begin_layout Plain Layout
20362 \begin_inset Quotes eld
20366 \begin_inset Quotes erd
20374 This macro will expand to the contents of the file with the name
20375 \begin_inset Flex Code
20378 \begin_layout Plain Layout
20387 \begin_layout Description
20388 \begin_inset Flex Code
20391 \begin_layout Plain Layout
20397 The file extension (including the dot).
20400 \begin_layout Description
20401 \begin_inset Flex Code
20404 \begin_layout Plain Layout
20410 The filename of the file specified in the external material dialog.
20411 This is either an absolute name, or it is relative to the LyX document.
20414 \begin_layout Description
20415 \begin_inset Flex Code
20418 \begin_layout Plain Layout
20425 \begin_inset Flex Code
20428 \begin_layout Plain Layout
20434 (absolute name or relative to the LyX document).
20437 \begin_layout Description
20438 \begin_inset Flex Code
20441 \begin_layout Plain Layout
20447 The file path, relative to the master LyX document.
20450 \begin_layout Description
20451 \begin_inset Flex Code
20454 \begin_layout Plain Layout
20460 The file path, relative to the LyX document.
20463 \begin_layout Description
20464 \begin_inset Flex Code
20467 \begin_layout Plain Layout
20473 This macro will expand to the absolute path of the system directory.
20474 This is typically used to point to the various helper scripts that are
20478 \begin_layout Description
20479 \begin_inset Flex Code
20482 \begin_layout Plain Layout
20488 A name and full path to a temporary file which will be automatically deleted
20489 whenever the containing document is closed, or the external material insertion
20493 \begin_layout Standard
20494 All path macros contain a trailing directory separator, so you can construct
20496 \begin_inset space \thinspace{}
20500 \begin_inset space \space{}
20503 the absolute filename with
20504 \begin_inset Flex Code
20507 \begin_layout Plain Layout
20508 $$AbsPath$$Basename$$Extension
20516 \begin_layout Standard
20517 The macros above are substituted in all commands unless otherwise noted.
20519 \begin_inset Flex Code
20522 \begin_layout Plain Layout
20528 supports additionally the following substitutions if they are enabled by
20530 \begin_inset Flex Code
20533 \begin_layout Plain Layout
20540 \begin_inset Flex Code
20543 \begin_layout Plain Layout
20552 \begin_layout Description
20553 \begin_inset Flex Code
20556 \begin_layout Plain Layout
20562 The front part of the resize command.
20565 \begin_layout Description
20566 \begin_inset Flex Code
20569 \begin_layout Plain Layout
20575 The back part of the resize command.
20578 \begin_layout Description
20579 \begin_inset Flex Code
20582 \begin_layout Plain Layout
20588 The front part of the rotation command.
20591 \begin_layout Description
20592 \begin_inset Flex Code
20595 \begin_layout Plain Layout
20601 The back part of the rotation command.
20604 \begin_layout Standard
20605 The value string of the
20606 \begin_inset Flex Code
20609 \begin_layout Plain Layout
20615 command supports additionally the following substitutions if they are enabled
20617 \begin_inset Flex Code
20620 \begin_layout Plain Layout
20627 \begin_inset Flex Code
20630 \begin_layout Plain Layout
20639 \begin_layout Description
20640 \begin_inset Flex Code
20643 \begin_layout Plain Layout
20652 \begin_layout Description
20653 \begin_inset Flex Code
20656 \begin_layout Plain Layout
20665 \begin_layout Description
20666 \begin_inset Flex Code
20669 \begin_layout Plain Layout
20678 \begin_layout Description
20679 \begin_inset Flex Code
20682 \begin_layout Plain Layout
20688 The rotation option.
20691 \begin_layout Standard
20692 You may ask why there are so many path macros.
20693 There are mainly two reasons:
20696 \begin_layout Enumerate
20697 Relative and absolute file names should remain relative or absolute, respectivel
20699 Users may have reasons to prefer either form.
20700 Relative names are useful for portable documents that should work on different
20701 machines, for example.
20702 Absolute names may be required by some programs.
20705 \begin_layout Enumerate
20706 LaTeX treats relative file names differently than LyX and other programs
20707 in nested included files.
20708 For LyX, a relative file name is always relative to the document that contains
20710 For LaTeX, it is always relative to the master document.
20711 These two definitions are identical if you have only one document, but
20712 differ if you have a master document that includes part documents.
20713 That means that relative filenames must be transformed when presented to
20715 Fortunately LyX does this automatically for you if you choose the right
20719 \begin_layout Standard
20720 So which path macro should be used in new template definitions? The rule
20724 \begin_layout Itemize
20726 \begin_inset Flex Code
20729 \begin_layout Plain Layout
20735 if an absolute path is required.
20738 \begin_layout Itemize
20740 \begin_inset Flex Code
20743 \begin_layout Plain Layout
20744 $$AbsOrRelPathMaster
20749 if the substituted string is some kind of LaTeX input.
20752 \begin_layout Itemize
20754 \begin_inset Flex Code
20757 \begin_layout Plain Layout
20758 $$AbsOrRelPathParent
20763 in order to preserve the user's choice.
20766 \begin_layout Standard
20767 There are special cases where this rule does not work and e.
20768 \begin_inset space \thinspace{}
20772 \begin_inset space \space{}
20775 relative names are needed, but normally it will work just fine.
20776 One example for such a case is the command
20777 \begin_inset Flex Code
20780 \begin_layout Plain Layout
20781 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20786 in the XFig template above: We can't use the absolute name because the
20788 \begin_inset Flex Code
20791 \begin_layout Plain Layout
20797 files needs the relative name in order to rewrite the file content.
20800 \begin_layout Section
20801 Security discussion
20802 \begin_inset CommandInset label
20804 name "sec:Security-discussion"
20811 \begin_layout Standard
20812 The external material feature interfaces with a lot of external programs
20813 and does so automatically, so we have to consider the security implications
20815 In particular, since you have the option of including your own filenames
20816 and/or parameter strings and those are expanded into a command, it seems
20817 that it would be possible to create a malicious document which executes
20818 arbitrary commands when a user views or prints the document.
20819 This is something we definitely want to avoid.
20822 \begin_layout Standard
20823 However, since the external program commands are specified in the template
20824 configuration file only, there are no security issues if LyX is properly
20825 configured with safe templates only.
20826 This is so because the external programs are invoked with the
20827 \begin_inset Flex Code
20830 \begin_layout Plain Layout
20836 -system call rather than the
20837 \begin_inset Flex Code
20840 \begin_layout Plain Layout
20846 system-call, so it's not possible to execute arbitrary commands from the
20847 filename or parameter section via the shell.
20850 \begin_layout Standard
20851 This also implies that you are restricted in what command strings you can
20852 use in the external material templates.
20853 In particular, pipes and redirection are not readily available.
20854 This has to be so if LyX should remain safe.
20855 If you want to use some of the shell features, you should write a safe
20856 script to do this in a controlled manner, and then invoke the script from
20857 the command string.
20861 \begin_layout Standard
20862 It is possible to design a template that interacts directly with the shell,
20863 but since this would allow a malicious user to execute arbitrary commands
20864 by writing clever filenames and/or parameters, we generally recommend that
20865 you only use safe scripts that work with the
20866 \begin_inset Flex Code
20869 \begin_layout Plain Layout
20875 system call in a controlled manner.
20876 Of course, for use in a controlled environment, it can be tempting to just
20877 fall back to use ordinary shell scripts.
20878 If you do so, be aware that you
20882 provide an easily exploitable security hole in your system.
20883 Of course it stands to reason that such unsafe templates will never be
20884 included in the standard LyX distribution, although we do encourage people
20885 to submit new templates in the open source tradition.
20886 But LyX as shipped from the official distribution channels will never have
20890 \begin_layout Standard
20891 Including external material provides a lot of power, and you have to be
20892 careful not to introduce security hazards with this power.
20893 A subtle error in a single line in an innocent looking script can open
20894 the door to huge security problems.
20895 So if you do not fully understand the issues, we recommend that you consult
20896 a knowledgeable security professional or the LyX development team if you
20897 have any questions about whether a given template is safe or not.
20898 And do this before you use it in an uncontrolled environment.