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
72 \font_default_family default
73 \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"
102 \use_package amsmath 0
103 \use_package amssymb 0
105 \use_package mathdots 1
106 \use_package mathtools 0
107 \use_package mhchem 0
108 \use_package undertilde 0
110 \cite_engine_type numerical
114 \paperorientation portrait
129 \paragraph_separation indent
130 \paragraph_indentation default
131 \quotes_language english
134 \paperpagestyle headings
135 \tracking_changes true
136 \output_changes false
140 \author -712698321 "Jürgen Spitzmüller"
141 \author -195340706 "Georg Baum"
143 \author 1082167584 "Kayvan Sylvan" kayvan@sylvan.com
144 \author 1414654397 "Richard Heck"
150 Customizing LyX: Features for the Advanced User
158 \begin_layout Plain Layout
160 If you have comments or error corrections, please send them to the LyX Documenta
162 \begin_inset CommandInset href
164 target "lyx-docs@lists.lyx.org"
171 \begin_inset Quotes eld
175 \begin_inset Quotes erd
178 in the subject header, and please cc the current maintainer of this file,
179 Richard Heck <rgheck@comcast.net>.
185 \begin_inset Newline newline
189 \begin_inset Newline newline
195 \begin_layout Standard
196 \begin_inset CommandInset toc
197 LatexCommand tableofcontents
204 \begin_layout Standard
205 \begin_inset Note Note
208 \begin_layout Plain Layout
209 Please use change tracking when modifying this document.
210 This makes it easier for our translators to recognize things that have
211 been changed, and it helps the maintainer keep up-to-date with what's been
220 \begin_layout Chapter
224 \begin_layout Standard
225 This manual covers the customization features present in LyX.
226 In it, we discuss issues like keyboard shortcuts, screen previewing options,
227 printer options, sending commands to LyX via the LyX Server, internationalizati
228 on, installing new LaTeX classes and LyX layouts, etc.
229 We can't possibly hope to touch on everything you can change—our developers
230 add new features faster than we can document them—but we will explain the
231 most common customizations and hopefully point you in the right direction
232 for some of the more obscure ones.
235 \begin_layout Standard
236 \begin_inset Branch OutDated
239 \begin_layout Standard
240 Information from previous versions of this document that now seems to be
241 outdated is contained in the OutDated branch of this document.
242 By default, this information will not appear in the LaTeX output.
250 \begin_layout Chapter
251 LyX configuration files
254 \begin_layout Standard
255 This chapter aims to help you to find your way through the LyX configuration
257 Before continuing to read this chapter, you should find out where your
258 LyX library and user directories are by using
259 \begin_inset Flex MenuItem
262 \begin_layout Plain Layout
263 Help\SpecialChar \menuseparator
274 The library directory is the place where LyX places its system-wide configurati
275 on files; the user directory is where you can place your modified versions.
276 We will call the former
277 \begin_inset Flex Code
280 \begin_layout Plain Layout
287 \begin_inset Flex MenuItem
290 \begin_layout Plain Layout
296 in the remainder of this document.
300 \begin_layout Section
302 \begin_inset Flex Code
305 \begin_layout Plain Layout
314 \begin_layout Standard
315 \begin_inset Flex Code
318 \begin_layout Plain Layout
324 and its sub-directories contain a number of files and that can be used
325 to customize LyX's behavior.
326 You can change many of these files from within LyX itself through the
327 \begin_inset Flex MenuItem
330 \begin_layout Plain Layout
331 Tools\SpecialChar \menuseparator
338 Most customization that you will want to do in LyX is possible through
340 However, many other inner aspects of LyX can be customized by modifying
342 \begin_inset Flex Code
345 \begin_layout Plain Layout
352 These files fall in different categories, described in the following subsection
356 \begin_layout Subsection
357 Automatically generated files
360 \begin_layout Standard
361 The files, which are to be found in
362 \begin_inset Flex MenuItem
365 \begin_layout Plain Layout
371 , are generated when you configure LyX.
372 They contain various default values that are guessed by inspection.
373 In general, it is not a good idea to modify them, since they might be overwritt
377 \begin_layout Labeling
378 \labelwidthstring 00.00.0000
379 \begin_inset Flex Code
382 \begin_layout Plain Layout
388 contains defaults for various commands.
391 \begin_layout Labeling
392 \labelwidthstring 00.00.0000
393 \begin_inset Flex Code
396 \begin_layout Plain Layout
402 contains the list of packages that have been recognized by LyX.
403 It is currently unused by the LyX program itself, but the information extracted
404 , and more, is made available with
405 \begin_inset Flex MenuItem
408 \begin_layout Plain Layout
409 Help\SpecialChar \menuseparator
422 \begin_layout Labeling
423 \labelwidthstring 00.00.0000
424 \begin_inset Flex Code
427 \begin_layout Plain Layout
433 the list of text classes that have been found in your
434 \begin_inset Flex Code
437 \begin_layout Plain Layout
443 directories, along with the associated LaTeX document class and their descripti
447 \begin_layout Labeling
448 \labelwidthstring 00.00.0000
449 \begin_inset Flex Code
452 \begin_layout Plain Layout
458 the list of layout modules found in your
459 \begin_inset Flex Code
462 \begin_layout Plain Layout
471 \begin_layout Labeling
472 \labelwidthstring 00.00.0000
473 \begin_inset Flex Code
476 \begin_layout Plain Layout
482 lists of various sorts of LaTeX-related files found on your system
485 \begin_layout Labeling
486 \labelwidthstring 00.00.0000
487 \begin_inset Flex Code
490 \begin_layout Plain Layout
496 is automatically generated during configuration from the file
497 \begin_inset Flex Code
500 \begin_layout Plain Layout
507 It contains information on your LaTeX configuration.
510 \begin_layout Subsection
514 \begin_layout Standard
515 These directories are duplicated between
516 \begin_inset Flex Code
519 \begin_layout Plain Layout
526 \begin_inset Flex Code
529 \begin_layout Plain Layout
536 If a particular files exists in both places, the one in
537 \begin_inset Flex Code
540 \begin_layout Plain Layout
549 \begin_layout Labeling
550 \labelwidthstring 00.00.0000
551 \begin_inset Flex Code
554 \begin_layout Plain Layout
560 this directory contains files with the extension
561 \begin_inset Flex Code
564 \begin_layout Plain Layout
570 that define the keybindings used in LyX.
571 If there exists an internationalized version of the bind file named
572 \begin_inset Flex Code
575 \begin_layout Plain Layout
581 , that will be used first.
584 \begin_layout Labeling
585 \labelwidthstring 00.00.0000
586 \begin_inset Flex Code
589 \begin_layout Plain Layout
595 contains graphics files that can be included in documents.
599 \begin_layout Labeling
600 \labelwidthstring 00.00.0000
601 \begin_inset Flex Code
604 \begin_layout Plain Layout
610 contains LyX documentation files (including the one you are currently reading).
612 \begin_inset Flex Code
615 \begin_layout Plain Layout
621 deserves special attention, as noted above.
622 The internationalized help docs are in subdirectories
623 \begin_inset Flex Code
626 \begin_layout Plain Layout
633 \begin_inset Quotes eld
637 \begin_inset Quotes erd
640 is the ISO language code.
646 \begin_inset CommandInset ref
648 reference "cha:Internationalizing-LyX"
655 \begin_layout Labeling
656 \labelwidthstring 00.00.0000
657 \begin_inset Flex Code
660 \begin_layout Plain Layout
666 contains example files that explain how to use some features.
667 In the file browser, press the
668 \begin_inset Flex MenuItem
671 \begin_layout Plain Layout
680 \begin_layout Labeling
681 \labelwidthstring 00.00.0000
682 \begin_inset Flex Code
685 \begin_layout Plain Layout
691 contains image files that are used by the
692 \begin_inset Flex MenuItem
695 \begin_layout Plain Layout
702 In addition, it also contains the individual icons used in the toolbar
703 and the banners that can be shown when LyX is launched.
706 \begin_layout Labeling
707 \labelwidthstring 00.00.0000
708 \begin_inset Flex Code
711 \begin_layout Plain Layout
717 contains keyboard keymapping files.
723 \begin_inset CommandInset ref
725 reference "sec:International-Keymap-Stuff"
732 \begin_layout Labeling
733 \labelwidthstring 00.00.0000
734 \begin_inset Flex Code
737 \begin_layout Plain Layout
743 contains the text class and module files described in Chapter
748 \begin_inset CommandInset ref
750 reference "cha:Installing-New-Document"
757 \begin_layout Labeling
758 \labelwidthstring 00.00.0000
759 \begin_inset Flex Code
762 \begin_layout Plain Layout
769 \begin_inset Flex Code
772 \begin_layout Plain Layout
778 Python scripts used to convert between LyX versions.
779 These can be run from the command line if, say, you want to batch-convert
783 \begin_layout Labeling
784 \labelwidthstring 00.00.0000
785 \begin_inset Flex Code
788 \begin_layout Plain Layout
794 contains some files that demonstrate the capabilities of the
795 \begin_inset Flex MenuItem
798 \begin_layout Plain Layout
809 Also contains some scripts used by LyX itself.
812 \begin_layout Labeling
813 \labelwidthstring 00.00.0000
814 \begin_inset Flex Code
817 \begin_layout Plain Layout
823 contains the standard LyX template files described in Chapter
828 \begin_inset CommandInset ref
830 reference "sub:Creating-Templates"
837 \begin_layout Labeling
838 \labelwidthstring 00.00.0000
839 \begin_inset Flex Code
842 \begin_layout Plain Layout
848 contains files with the extension
849 \begin_inset Flex Code
852 \begin_layout Plain Layout
858 that define the user interface to LyX.
859 That is, the files define which items appear in which menus and the items
860 appearing on the toolbar.
863 \begin_layout Subsection
864 Files you don't want to modify
867 \begin_layout Standard
868 These files are used internally by LyX and you generally do not need to
869 modify them unless you are a developer.
872 \begin_layout Labeling
873 \labelwidthstring 00.00.0000
874 \begin_inset Flex Code
877 \begin_layout Plain Layout
883 this file contains the list of LyX developers.
884 The contents are displayed with the menu entry
885 \begin_inset Flex MenuItem
888 \begin_layout Plain Layout
889 Help\SpecialChar \menuseparator
902 \begin_layout Labeling
903 \labelwidthstring 00.00.0000
904 \begin_inset Flex Code
907 \begin_layout Plain Layout
913 this is a LaTeX script used during the configuration process.
917 \begin_layout Labeling
918 \labelwidthstring 00.00.0000
919 \begin_inset Flex Code
922 \begin_layout Plain Layout
928 this is the script that is used to re-configure LyX.
929 It creates configuration files in the directory it was run from.
932 \begin_layout Subsection
933 Other files needing a line or two...
936 \begin_layout Labeling
937 \labelwidthstring 00.00.0000
938 \begin_inset Flex Code
941 \begin_layout Plain Layout
947 this contains tables describing how different character encodings can be
951 \begin_layout Labeling
952 \labelwidthstring 00.00.0000
953 \begin_inset Flex Code
956 \begin_layout Plain Layout
962 this file contains the templates available to the new
963 \begin_inset Flex MenuItem
966 \begin_layout Plain Layout
979 \begin_layout Labeling
980 \labelwidthstring 00.00.0000
981 \begin_inset Flex Code
984 \begin_layout Plain Layout
990 this file contains a list of all the languages currently supported by LyX.
991 \change_inserted -195340706 1334775793
995 \begin_layout Labeling
996 \labelwidthstring 00.00.0000
998 \change_inserted -195340706 1334775793
999 \begin_inset Flex Code
1002 \begin_layout Plain Layout
1004 \change_inserted -195340706 1334775793
1010 this file contains translations for internationalized paragraph styles
1012 \begin_inset space \thinspace{}
1016 \begin_inset CommandInset ref
1018 reference "sub:I18n"
1027 \begin_layout Section
1028 Your local configuration directory
1031 \begin_layout Standard
1032 Even if you are using LyX as an unprivileged user, you might want to change
1033 LyX configuration for your own use.
1035 \begin_inset Flex Code
1038 \begin_layout Plain Layout
1044 directory contains all your personal configuration files.
1045 This is the directory described as
1046 \begin_inset Quotes eld
1050 \begin_inset Quotes erd
1054 \begin_inset Flex MenuItem
1057 \begin_layout Plain Layout
1058 Help\SpecialChar \menuseparator
1060 \begin_inset space ~
1069 This directory is used as a mirror of
1070 \begin_inset Flex Code
1073 \begin_layout Plain Layout
1079 , which means that every file in
1080 \begin_inset Flex Code
1083 \begin_layout Plain Layout
1089 is a replacement for the corresponding file in
1090 \begin_inset Flex Code
1093 \begin_layout Plain Layout
1100 Any configuration file described in the above sections can be placed either
1101 in the system-wide directory, in which case it will affect all users, or
1102 in your local directory for your own use.
1105 \begin_layout Standard
1106 To make things clearer, let's provide a few examples:
1109 \begin_layout Itemize
1110 The preferences set in the
1111 \begin_inset Flex MenuItem
1114 \begin_layout Plain Layout
1115 Tools\SpecialChar \menuseparator
1121 dialog are saved to a file
1122 \begin_inset Flex Code
1125 \begin_layout Plain Layout
1132 \begin_inset Flex Code
1135 \begin_layout Plain Layout
1144 \begin_layout Itemize
1145 When you reconfigure using
1146 \begin_inset Flex MenuItem
1149 \begin_layout Plain Layout
1150 Tools\SpecialChar \menuseparator
1157 \begin_inset Flex Code
1160 \begin_layout Plain Layout
1166 script, and the resulting files are written in your local configuration
1168 This means that any additional text class file that you might have added
1170 \begin_inset Flex Code
1173 \begin_layout Plain Layout
1179 will be added to the list of classes in the
1180 \begin_inset Flex MenuItem
1183 \begin_layout Plain Layout
1184 Document\SpecialChar \menuseparator
1193 \begin_layout Itemize
1194 If you get some updated documentation from LyX ftp site and cannot install
1195 it because you do not have sysadmin rights on your system, you can just
1197 \begin_inset Flex Code
1200 \begin_layout Plain Layout
1206 and the items in the
1207 \begin_inset Flex MenuItem
1210 \begin_layout Plain Layout
1216 menu will open them!
1219 \begin_layout Section
1220 Running LyX with multiple configurations
1223 \begin_layout Standard
1224 The configuration freedom of the local configuration directory may not suffice
1225 if you want to have more than one configuration at your disposal.
1226 For example, you may want to be use different key bindings or printer settings
1228 You can achieve this by having several such directories.
1229 You then specify which directory to use at run-time.
1232 \begin_layout Standard
1233 Invoking LyX with the command line switch
1234 \begin_inset Flex Code
1237 \begin_layout Plain Layout
1247 instructs the program to read the configuration from that directory, and
1248 not from the default directory.
1249 (You can determine the default directory by running LyX without the
1250 \begin_inset Flex Code
1253 \begin_layout Plain Layout
1259 switch.) If the specified directory does not exist, LyX offers to create
1260 it for you, just like it does for the default directory on the first time
1261 you run the program.
1262 You can modify the configuration options in this additional user directory
1263 exactly as you would for the default directory.
1264 These directories are completely independent (but read on).
1265 Note that setting the environment variable
1266 \begin_inset Flex Code
1269 \begin_layout Plain Layout
1275 to some value has exactly the same effect.
1278 \begin_layout Standard
1279 Having several configurations also requires more maintenance: if you want
1280 to add a new layout to
1281 \begin_inset Flex Code
1284 \begin_layout Plain Layout
1290 which you want available from all your configurations, you must add it
1291 to each directory separately.
1292 You can avoid this with the following trick: after LyX creates the additional
1293 directory, most of the subdirectories (see above) are empty.
1294 If you want the new configuration to mirror an existing one, replace the
1295 empty subdirectory with a symbolic link to the matching subdirectory in
1296 the existing configuration.
1298 \begin_inset Flex Code
1301 \begin_layout Plain Layout
1307 subdirectory, however, since it contains a file written by the configuration
1308 script (also accessible through
1309 \begin_inset Flex MenuItem
1312 \begin_layout Plain Layout
1313 Tools\SpecialChar \menuseparator
1319 ) which is configuration-specific.
1322 \begin_layout Chapter
1323 The Preferences dialog
1326 \begin_layout Standard
1327 All options of the preferences dialog are described in the Appendix
1329 The Preferences Dialog
1336 For some options you might find here more details.
1339 \begin_layout Section
1341 \begin_inset CommandInset label
1350 \begin_layout Standard
1351 The first step is to define your file formats if they are not already defined.
1353 \begin_inset Flex MenuItem
1356 \begin_layout Plain Layout
1357 Tools\SpecialChar \menuseparator
1365 \begin_inset Flex MenuItem
1368 \begin_layout Plain Layout
1369 File Handling\SpecialChar \menuseparator
1376 \begin_inset Flex MenuItem
1379 \begin_layout Plain Layout
1380 New\SpecialChar \ldots{}
1386 button to define your new format.
1388 \begin_inset Flex MenuItem
1391 \begin_layout Plain Layout
1397 field contains the name used to identify the format in the GUI.
1399 \begin_inset Flex MenuItem
1402 \begin_layout Plain Layout
1408 is used to identify the format internally.
1409 You will also need to enter a file extension.
1410 These are all required.
1412 \begin_inset Flex MenuItem
1415 \begin_layout Plain Layout
1421 field is used to provide a keyboard shortcut on the menus.
1422 (For example, pressing
1423 \begin_inset Flex MenuItem
1426 \begin_layout Plain Layout
1433 \begin_inset Flex MenuItem
1436 \begin_layout Plain Layout
1437 View\SpecialChar \menuseparator
1438 View (Other Formats)\SpecialChar \menuseparator
1447 \begin_layout Standard
1449 \begin_inset Flex MenuItem
1452 \begin_layout Plain Layout
1459 \begin_inset Flex MenuItem
1462 \begin_layout Plain Layout
1469 For example, you might want to use
1470 \begin_inset Flex MenuItem
1473 \begin_layout Plain Layout
1479 to view PostScript files.
1480 You can enter the command needed to start the program in the corresponding
1482 In defining this command, you can use the four variables listed in the
1484 The viewer is launched when you view an image in LyX or use the
1485 \begin_inset Flex MenuItem
1488 \begin_layout Plain Layout
1495 The editor is for example launched when you right-click on an image and
1497 \begin_inset Flex MenuItem
1500 \begin_layout Plain Layout
1506 in the appearing context menu.
1509 \begin_layout Standard
1511 \change_inserted -195340706 1329851811
1513 \begin_inset Flex MenuItem
1516 \begin_layout Plain Layout
1522 type of a format is optional, but if it is specified, it must be unique
1524 It is used to detect files of this format from the file contents.
1525 For some important file formats there is no MIME type officially registered
1527 \begin_inset CommandInset href
1530 target "http://www.iana.org/assignments/media-types/"
1535 Therefore LyX uses the extended list of MIME types as specified by
1536 \begin_inset CommandInset href
1538 name "freedesktop.org"
1539 target "http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec"
1546 \begin_layout Standard
1548 \begin_inset Flex MenuItem
1551 \begin_layout Plain Layout
1557 option tells LyX that a format is suitable for document export.
1558 If this is set and if a suitable conversion route exists (see sec.
1559 \begin_inset space \thinspace{}
1563 \begin_inset CommandInset ref
1565 reference "sec:Converters"
1569 ), the format will appear in the
1570 \begin_inset Flex MenuItem
1573 \begin_layout Plain Layout
1574 File\SpecialChar \menuseparator
1581 The format will also appear in the
1582 \begin_inset Flex MenuItem
1585 \begin_layout Plain Layout
1591 menu if a viewer is specified for the format.
1592 Pure image formats, such as
1593 \begin_inset Flex Code
1596 \begin_layout Plain Layout
1602 , should not use this option.
1603 Formats that can both represent vector graphics and documents like
1604 \begin_inset Flex Code
1607 \begin_layout Plain Layout
1616 \begin_layout Standard
1618 \begin_inset Flex MenuItem
1621 \begin_layout Plain Layout
1622 Vector graphics format
1627 tells LyX that a format can contain vector graphics.
1628 This information is used to determine the target format of included graphics
1630 \begin_inset Flex MenuItem
1633 \begin_layout Plain Layout
1640 Included graphics may need to be converted to either
1641 \begin_inset Flex MenuItem
1644 \begin_layout Plain Layout
1651 \begin_inset Flex MenuItem
1654 \begin_layout Plain Layout
1661 \begin_inset Flex MenuItem
1664 \begin_layout Plain Layout
1671 \begin_inset Flex MenuItem
1674 \begin_layout Plain Layout
1680 cannot handle other image formats.
1681 If an included graphic is not already in
1682 \begin_inset Flex MenuItem
1685 \begin_layout Plain Layout
1692 \begin_inset Flex MenuItem
1695 \begin_layout Plain Layout
1702 \begin_inset Flex MenuItem
1705 \begin_layout Plain Layout
1711 format, it is converted to
1712 \begin_inset Flex MenuItem
1715 \begin_layout Plain Layout
1721 if the vector format option is set, and otherwise to
1722 \begin_inset Flex MenuItem
1725 \begin_layout Plain Layout
1734 \begin_layout Section
1738 \begin_layout Standard
1739 Since all conversions from one format to another take place in LyX's temporary
1740 directory, it is sometimes necessary to modify a file before copying it
1741 to the temporary directory in order that the conversion may be performed.
1745 \begin_layout Plain Layout
1746 For example, the file may refer to other files—images, for example—using
1747 relative file names, and these may become invalid when the file is copied
1748 to the temporary directory.
1753 This is done by a Copier: It copies a file to (or from) the temporary directory
1754 and may modify it in the process.
1757 \begin_layout Standard
1758 The definitions of the copiers may use four variables:
1761 \begin_layout Labeling
1762 \labelwidthstring 00.00.0000
1763 \begin_inset Flex Code
1766 \begin_layout Plain Layout
1772 The LyX system directory (e.
1773 \begin_inset space \thinspace{}
1777 \begin_inset space \space{}
1781 \begin_inset Flex MenuItem
1784 \begin_layout Plain Layout
1793 \begin_layout Labeling
1794 \labelwidthstring 00.00.0000
1795 \begin_inset Flex Code
1798 \begin_layout Plain Layout
1807 \begin_layout Labeling
1808 \labelwidthstring 00.00.0000
1809 \begin_inset Flex Code
1812 \begin_layout Plain Layout
1819 \change_inserted 1082167584 1348453985
1823 \begin_layout Labeling
1824 \labelwidthstring 00.00.0000
1826 \change_inserted 1082167584 1348453986
1827 $$b The base name (without filename extension) in the LyX temporary directory
1830 \begin_layout Labeling
1831 \labelwidthstring 00.00.0000
1833 \change_inserted 1082167584 1348453986
1834 $$p The full directory path of the LyX temporary directory
1837 \begin_layout Labeling
1838 \labelwidthstring 00.00.0000
1840 \change_inserted 1082167584 1348453986
1841 $$r The full pathname to the original LyX file being processed
1844 \begin_layout Labeling
1845 \labelwidthstring 00.00.0000
1847 \change_inserted 1082167584 1348453986
1848 $$f The filename (without any directory path) of the LyX file.
1851 \begin_layout Labeling
1852 \labelwidthstring 00.00.0000
1853 \begin_inset Flex Code
1856 \begin_layout Plain Layout
1863 \change_inserted 1082167584 1348453720
1867 \begin_layout Standard
1868 The latter should be the filename as it would be used in a LaTeX's
1875 It is relevant only when exporting files suitable for such inclusion.
1878 \begin_layout Standard
1879 Copiers can be used to do almost anything with output files.
1880 For example, suppose you want generated pdf files to be copied to a special
1882 \begin_inset Flex Code
1885 \begin_layout Plain Layout
1892 Then you could write a shell script such as this one:
1895 \begin_layout Standard
1896 \begin_inset listings
1900 \begin_layout Plain Layout
1905 \begin_layout Plain Layout
1910 \begin_layout Plain Layout
1912 TOFILE=`basename $2`
1915 \begin_layout Plain Layout
1917 cp $FROMFILE /home/you/pdf/$TOFILE
1922 Save it in your local LyX directory—say,
1923 \begin_inset Flex Code
1926 \begin_layout Plain Layout
1927 /home/you/.lyx/scripts/pdfcopier.sh
1932 —and make it executable, if you need to do so on your platform.
1934 \begin_inset Flex MenuItem
1937 \begin_layout Plain Layout
1938 Tools\SpecialChar \menuseparator
1944 dialog, select under
1945 \begin_inset Flex MenuItem
1948 \begin_layout Plain Layout
1949 File Handling\SpecialChar \menuseparator
1956 \begin_inset Flex MenuItem
1959 \begin_layout Plain Layout
1965 format—or one of the other pdf formats—and enter
1966 \begin_inset Flex Code
1969 \begin_layout Plain Layout
1970 pdfcopier.sh $$i $$o
1976 \begin_inset Flex MenuItem
1979 \begin_layout Plain Layout
1989 \begin_layout Standard
1990 Copiers are used by LyX in various of its own conversions.
1991 For example, if appropriate programs are found, LyX will automatically
1992 install copiers for the
1993 \begin_inset Flex MenuItem
1996 \begin_layout Plain Layout
2003 \begin_inset Flex MenuItem
2006 \begin_layout Plain Layout
2008 \begin_inset space ~
2017 When these formats are exported, the copier sees that not just the main
2018 HTML file but various associated files (style files, images, etc.) are also
2020 All these files are written to a subdirectory of the directory in which
2021 the original LyX file was found.
2025 \begin_layout Plain Layout
2026 This copier can be customized.
2028 \begin_inset Quotes eld
2032 \begin_inset Quotes erd
2035 argument takes a comma-separated list of extensions to be copied; if it
2036 is omitted, all files will be copied.
2038 \begin_inset Quotes eld
2042 \begin_inset Quotes erd
2045 argument determines the extension added to the generated directory.
2047 \begin_inset Quotes eld
2051 \begin_inset Flex MenuItem
2054 \begin_layout Plain Layout
2061 \begin_inset Quotes erd
2064 , so HTML generated from
2065 \begin_inset Flex MenuItem
2068 \begin_layout Plain Layout
2069 /path/to/filename.lyx
2075 \begin_inset Flex MenuItem
2078 \begin_layout Plain Layout
2079 /path/to/filename.html.LyXconv
2093 \begin_layout Section
2095 \begin_inset CommandInset label
2097 name "sec:Converters"
2104 \begin_layout Standard
2105 You can define your own Converters to convert files between different formats.
2107 \begin_inset Flex MenuItem
2110 \begin_layout Plain Layout
2111 Tools\SpecialChar \menuseparator
2112 Preferences\SpecialChar \menuseparator
2113 File Handling\SpecialChar \menuseparator
2122 \begin_layout Standard
2123 To define a new converter, select the
2124 \begin_inset Flex MenuItem
2127 \begin_layout Plain Layout
2129 \begin_inset space ~
2138 \begin_inset Flex MenuItem
2141 \begin_layout Plain Layout
2143 \begin_inset space ~
2151 from the drop-down lists, enter the command needed for the conversion,
2153 \begin_inset Flex MenuItem
2156 \begin_layout Plain Layout
2163 Several variables can be used in the definition of converters:
2166 \begin_layout Labeling
2167 \labelwidthstring 00.00.0000
2168 \begin_inset Flex Code
2171 \begin_layout Plain Layout
2177 The LyX system directory
2180 \begin_layout Labeling
2181 \labelwidthstring 00.00.0000
2182 \begin_inset Flex Code
2185 \begin_layout Plain Layout
2194 \begin_layout Labeling
2195 \labelwidthstring 00.00.0000
2196 \begin_inset Flex Code
2199 \begin_layout Plain Layout
2208 \begin_layout Labeling
2209 \labelwidthstring 00.00.0000
2210 \begin_inset Flex Code
2213 \begin_layout Plain Layout
2219 The base filename of the input file (i.
2220 \begin_inset space \thinspace{}
2223 g., without the extension)
2226 \begin_layout Labeling
2227 \labelwidthstring 00.00.0000
2228 \begin_inset Flex Code
2231 \begin_layout Plain Layout
2237 The path to the input file
2240 \begin_layout Labeling
2241 \labelwidthstring 00.00.0000
2242 \begin_inset Flex Code
2245 \begin_layout Plain Layout
2251 The path to the original input file (this is different from $$p when a
2252 chain of converters is called)
2255 \begin_layout Labeling
2256 \labelwidthstring 00.00.0000
2257 \begin_inset Flex Code
2260 \begin_layout Plain Layout
2266 The iconv name for the encoding of the document.
2269 \begin_layout Standard
2271 \begin_inset Flex MenuItem
2274 \begin_layout Plain Layout
2276 \begin_inset space ~
2284 field you can enter the following flags, separated by commas:
2287 \begin_layout Labeling
2288 \labelwidthstring 00.00.0000
2289 \begin_inset Flex Code
2292 \begin_layout Plain Layout
2298 This converter runs some form of LaTeX.
2299 This will make LyX's LaTeX error logs available.
2302 \begin_layout Labeling
2303 \labelwidthstring 00.00.0000
2304 \begin_inset Flex Code
2307 \begin_layout Plain Layout
2314 \begin_inset Flex MenuItem
2317 \begin_layout Plain Layout
2323 file for the conversion.
2324 \change_inserted 1414654397 1337693117
2328 \begin_layout Labeling
2329 \labelwidthstring 00.00.0000
2331 \change_inserted 1414654397 1337693188
2332 \begin_inset Flex Code
2335 \begin_layout Plain Layout
2337 \change_inserted 1414654397 1337693129
2346 \begin_inset Quotes eld
2350 \begin_inset Quotes erd
2353 file from the backend, which in practice means a LaTeX file like the one
2354 we would export, without
2355 \begin_inset Flex Code
2358 \begin_layout Plain Layout
2360 \change_inserted 1414654397 1337693184
2373 \begin_layout Labeling
2374 \labelwidthstring 00.00.0000
2375 \begin_inset Flex Code
2378 \begin_layout Plain Layout
2387 \begin_layout Standard
2388 The following three flags are not really flags at all because they take
2390 \begin_inset Flex MenuItem
2393 \begin_layout Plain Layout
2395 \begin_inset space ~
2399 \begin_inset space ~
2410 \begin_layout Labeling
2411 \labelwidthstring 00.00.0000
2412 \begin_inset Flex Code
2415 \begin_layout Plain Layout
2421 If set, the converter's standard error will be redirected to a file
2422 \begin_inset Flex Code
2425 \begin_layout Plain Layout
2431 , and the script given as argument will be run as:
2432 \begin_inset Flex Code
2435 \begin_layout Plain Layout
2436 script < infile.out > infile.log
2442 The argument may contain
2443 \begin_inset Flex Code
2446 \begin_layout Plain Layout
2455 \begin_layout Labeling
2456 \labelwidthstring 00.00.0000
2457 \begin_inset Flex Code
2460 \begin_layout Plain Layout
2466 The name of the directory in which the converter will dump the generated
2468 LyX will not create this directory, and it does not copy anything into
2469 it, though it will copy this directory to the destination.
2470 The argument may contain
2471 \begin_inset Flex Code
2474 \begin_layout Plain Layout
2480 , which will be replaced by the base name of the input and output files,
2481 respectively, when the directory is copied.
2482 \begin_inset Newline newline
2485 Note that resultdir and usetempdir make no sense together.
2486 The latter will be ignored if the former is given.
2489 \begin_layout Labeling
2490 \labelwidthstring 00.00.0000
2491 \begin_inset Flex Code
2494 \begin_layout Plain Layout
2500 Determines the output file name and may, contain
2501 \begin_inset Flex Code
2504 \begin_layout Plain Layout
2511 Sensible only with resultdir and optional even then; if not given, it defaults
2515 \begin_layout Standard
2516 None of these last three are presently used in any of the converters that
2517 are installed with LyX.
2521 \begin_layout Standard
2522 You do not have to define converters for all formats between which you want
2524 For example, you will note that there is no `LyX to PostScript' converter,
2525 but LyX will export PostScript.
2526 It does so by first creating a LaTeX file (no converter needs to be defined
2527 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2528 and finally converting the resulting DVI file to PostScript.
2529 LyX finds such `chains' of converters automatically, and it will always
2530 choose the shortest possible chain.
2531 You can, though, still define multiple conversion methods between file
2533 For example, the standard LyX configuration provides three ways to convert
2534 LaTeX to PDF: Directly, using
2535 \begin_inset Flex MenuItem
2538 \begin_layout Plain Layout
2544 ; via (DVI and) PostScript, using
2545 \begin_inset Flex MenuItem
2548 \begin_layout Plain Layout
2555 \begin_inset Flex MenuItem
2558 \begin_layout Plain Layout
2565 To define such alternate chains, you must define multiple target `file
2566 formats', as described in section
2567 \begin_inset CommandInset ref
2569 reference "sec:Formats"
2574 For example, in the standard configuration, the formats named
2575 \begin_inset Flex MenuItem
2578 \begin_layout Plain Layout
2585 \begin_inset Flex MenuItem
2588 \begin_layout Plain Layout
2595 \begin_inset Flex MenuItem
2598 \begin_layout Plain Layout
2604 are defined, all of which share the extension
2605 \begin_inset Flex MenuItem
2608 \begin_layout Plain Layout
2614 , and which correspond to the conversion methods just mentioned.
2617 \begin_layout Chapter
2618 Internationalizing LyX
2619 \begin_inset CommandInset label
2621 name "cha:Internationalizing-LyX"
2628 \begin_layout Standard
2629 LyX supports using a translated interface.
2630 Last time we checked, LyX provided text in thirty languages.
2631 The language of choice is called your
2636 (For further reading on locale settings, see also the documentation for
2637 locale that comes with your operating system.
2638 For Linux, the manual page for
2639 \begin_inset Flex Code
2642 \begin_layout Plain Layout
2648 could be a good place to start).
2651 \begin_layout Standard
2652 Notice that these translations will work, but do contain a few flaws.
2653 In particular, all dialogs have been designed with the English text in
2654 mind, which means that some of the translated text will be too large to
2655 fit within the space allocated.
2656 This is only a display problem and will not cause any harm.
2657 Also, you will find that some of the translations do not define shortcut
2658 keys for everything.
2659 Sometimes, there are simply not enough free letters to do it.
2660 Other times, the translator just hasn't got around to doing it yet.
2661 Our localization team, which you may wish to join,
2665 \begin_layout Plain Layout
2666 If you are a fluent speaker of a language other than English, joining these
2667 teams is a great way to give back to the LyX community!
2672 will of course try to fix these shortcomings in future versions of LyX.
2675 \begin_layout Section
2679 \begin_layout Subsection
2680 Translating the graphical user interface (text messages).
2683 \begin_layout Standard
2685 \begin_inset Flex Code
2688 \begin_layout Plain Layout
2694 library to handle the internationalization of the interface.
2695 To have LyX speak your favorite language in all menus and dialogs, you
2697 \begin_inset Flex Code
2700 \begin_layout Plain Layout
2706 -file for that language.
2707 When this is available, you'll have to generate a
2708 \begin_inset Flex Code
2711 \begin_layout Plain Layout
2717 -file from it and install the
2718 \begin_inset Flex Code
2721 \begin_layout Plain Layout
2728 The process of doing all of this is explained in the documentation for
2730 \begin_inset Flex Code
2733 \begin_layout Plain Layout
2740 It is possible to do this just for yourself, but if you're going to do
2741 it, you might as well share the results of your labors with the rest of
2743 Send a message to the LyX developers' list for more information about how
2747 \begin_layout Standard
2748 In short, this is what you should do (xx denotes the language code):
2751 \begin_layout Itemize
2752 Check out the LyX source code.
2754 \begin_inset CommandInset href
2756 name "information on the web"
2757 target "http://www.lyx.org/HowToUseSVN"
2764 \begin_layout Itemize
2766 \begin_inset Flex Code
2769 \begin_layout Plain Layout
2775 to the folder of the
2776 \begin_inset Flex Code
2779 \begin_layout Plain Layout
2787 \begin_inset Flex Code
2790 \begin_layout Plain Layout
2798 \begin_inset Flex Code
2801 \begin_layout Plain Layout
2807 doesn't exist anywhere, it can be remade with the console command
2808 \begin_inset Flex Code
2811 \begin_layout Plain Layout
2817 in that directory, or you can use an existing po-file for some other language
2821 \begin_layout Itemize
2823 \begin_inset Flex Code
2826 \begin_layout Plain Layout
2836 \begin_layout Plain Layout
2837 This is just a text file, so it can be edited in any text editor.
2838 But there are also specialized programs that support such editing, such
2843 (for all platforms) or
2852 contains a `mode' for editing
2853 \begin_inset Flex Code
2856 \begin_layout Plain Layout
2867 For some menu- and widget-labels, there are also shortcut keys that should
2869 Those keys are marked after a `|', and should be translated according to
2870 the words and phrases of the language.
2871 You should also fill also out the information at the beginning of the new
2873 \begin_inset Flex Code
2876 \begin_layout Plain Layout
2882 -file with your email-address, etc., so people know where to reach you with
2883 suggestions and entertaining flames.
2886 \begin_layout Standard
2887 If you are just doing this on your own, then:
2890 \begin_layout Itemize
2892 \begin_inset Flex Code
2895 \begin_layout Plain Layout
2902 This can be done with
2903 \begin_inset Flex Code
2906 \begin_layout Plain Layout
2907 msgfmt -o xx.mo < xx.po
2915 \begin_layout Itemize
2917 \begin_inset Flex Code
2920 \begin_layout Plain Layout
2926 -file to your locale-tree, at the correct directory for application messages
2931 xx, and under the name
2932 \begin_inset Flex Code
2935 \begin_layout Plain Layout
2942 \begin_inset space \thinspace{}
2946 \begin_inset space \space{}
2950 \begin_inset Flex Code
2953 \begin_layout Plain Layout
2954 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2964 \begin_layout Standard
2965 As said, however, it would be best if the new
2966 \begin_inset Flex Code
2969 \begin_layout Plain Layout
2975 -file could be added to the LyX distribution, so others can use it.
2976 Adding it involves making additional changes to LyX.
2977 So send an email to the developers' mailing list if you're interested in
2981 \begin_layout Subsubsection
2985 \begin_layout Standard
2986 Sometimes it turns out that one English message needs to be translated into
2987 different messages in the target language.
2988 One example is the message
2989 \begin_inset Flex Code
2992 \begin_layout Plain Layout
2998 which has the German translation
3006 , depending upon exactly what the English
3007 \begin_inset Quotes eld
3011 \begin_inset Quotes erd
3016 \begin_inset Flex Code
3019 \begin_layout Plain Layout
3025 does not handle such ambiguous translations.
3026 Therefore you have to add some context information to the message: Instead
3028 \begin_inset Flex Code
3031 \begin_layout Plain Layout
3038 \begin_inset Flex Code
3041 \begin_layout Plain Layout
3042 To[[as in 'From format x to format y']]
3048 \begin_inset Flex Code
3051 \begin_layout Plain Layout
3052 To[[as in 'From page x to page y']].
3057 Now the two occurrences of
3058 \begin_inset Flex Code
3061 \begin_layout Plain Layout
3068 \begin_inset Flex Code
3071 \begin_layout Plain Layout
3077 and can be translated correctly to
3088 \begin_layout Standard
3089 Of course the context information needs to be stripped off the original
3090 message when no translation is used.
3091 Therefore you have to put it in double square brackets at the end of the
3092 message (see the example above).
3093 The translation mechanism of LyX ensures that everything in double square
3094 brackets at the end of messages is removed before displaying the message.
3097 \begin_layout Subsection
3098 Translating the documentation.
3101 \begin_layout Standard
3102 The online documentation (in the
3103 \begin_inset Flex MenuItem
3106 \begin_layout Plain Layout
3112 -menu) can (and should!) be translated.
3113 If there are translated versions of the documentation available
3117 \begin_layout Plain Layout
3118 As of March 2008, at least some of the documents have been translated into
3119 fourteen languages, with the Tutorial available in a few more.
3124 and the locale is set accordingly, these will be used automagically by
3126 LyX looks for translated versions as
3127 \begin_inset Flex Code
3130 \begin_layout Plain Layout
3131 LyXDir/doc/xx/DocName.lyx
3137 \begin_inset Flex Code
3140 \begin_layout Plain Layout
3146 is the code for the language currently in use.
3147 If there are no translated documents, the default English versions will
3149 Note that the translated versions must have the same filenames (
3150 \begin_inset Flex Code
3153 \begin_layout Plain Layout
3159 above) as the original.
3160 If you feel up to translating the documentation (an excellent way to proof-read
3161 the original documentation by the way!), there are a few things you should
3165 \begin_layout Itemize
3166 Check out the documentation translation web page at
3167 \begin_inset CommandInset href
3169 name "http://www.lyx.org/Translation"
3170 target "http://www.lyx.org/Translation"
3175 That way, you can find out which (if any) documents have already been translate
3176 d into your language.
3177 You can also find out who (if anyone) is organizing the effort to translate
3178 the documentation into your language.
3179 If no one is organizing the effort, please let us know that you're interested.
3182 \begin_layout Standard
3183 Once you get to actually translating, here's a few hints for you that may
3187 \begin_layout Itemize
3188 Join the documentation team! There is information on how to do that in
3189 \begin_inset Flex Code
3192 \begin_layout Plain Layout
3199 \begin_inset Flex MenuItem
3202 \begin_layout Plain Layout
3203 Help\SpecialChar \menuseparator
3209 ), which by the way is the first document you should translate.
3212 \begin_layout Itemize
3213 Learn the typographic conventions for the language you are translating to.
3214 Typography is an ancient art and over the centuries, a great variety of
3215 conventions have developed throughout different parts of the world.
3216 Also study the professional terminology amongst typographers in your country.
3217 Inventing your own terminology will only confuse the users.
3220 (Warning! Typography is addictive!)
3223 \begin_layout Itemize
3224 Make a copy of the document.
3225 This will be your working copy.
3226 You can use this as your personal translated help-file by placing it in
3228 \begin_inset Flex Code
3231 \begin_layout Plain Layout
3240 \begin_layout Itemize
3241 Sometimes the original document (from the LyX-team) will be updated.
3242 Use the source viewer at
3243 \begin_inset CommandInset href
3245 name "http://www.lyx.org/trac/timeline"
3246 target "http://www.lyx.org/trac/timeline"
3250 to see what has been changed.
3251 That way you can easily see which parts of the translated document need
3255 \begin_layout Standard
3256 If you ever find an error in the original document, fix it and notify the
3257 rest of the documentation team of the changes! (You didn't forget to join
3258 the documentation team, did you?)
3261 \begin_layout Standard
3262 \begin_inset Branch OutDated
3265 \begin_layout Section
3266 International Keyboard Support
3269 \begin_layout Standard
3272 [Editor's Note: The following section is by
3280 It needs to be fixed to conform to the new Documentation Style sheet and
3281 to make use of the new v1.0 features.
3282 The whole thing also needs to be merged with the section following it.-jw
3283 It may also be badly out of date.-rh (2008)]
3286 \begin_layout Subsection
3287 Defining Own Keymaps: Keymap File Format
3290 \begin_layout Standard
3291 Let's look at a keyboard definition file a little closer.
3292 It is a plain text file defining
3295 \begin_layout Itemize
3296 key-to-key or key-to-string translations
3299 \begin_layout Itemize
3303 \begin_layout Itemize
3304 dead keys exceptions
3307 \begin_layout Standard
3308 To define key-to-key or key-to-string translation, use this command:
3311 \begin_layout Quotation
3312 \begin_inset Flex Code
3315 \begin_layout Plain Layout
3324 \begin_inset Flex Code
3327 \begin_layout Plain Layout
3336 \begin_layout Standard
3338 \begin_inset Flex Code
3341 \begin_layout Plain Layout
3347 is the key to be translated and
3348 \begin_inset Flex Code
3351 \begin_layout Plain Layout
3357 is the string to be inserted into the document.
3358 To define dead keys, use:
3361 \begin_layout Quotation
3362 \begin_inset Flex Code
3365 \begin_layout Plain Layout
3374 \begin_inset Flex Code
3377 \begin_layout Plain Layout
3386 \begin_layout Standard
3388 \begin_inset Flex Code
3391 \begin_layout Plain Layout
3397 is a keyboard key and
3398 \begin_inset Flex Code
3401 \begin_layout Plain Layout
3408 The following dead keys are supported (shortcut name is in parentheses):
3411 \begin_layout Quotation
3415 \begin_inset space \hfill{}
3421 \begin_layout Quotation
3423 \begin_inset space \hfill{}
3429 \begin_layout Quotation
3431 \begin_inset space \hfill{}
3437 \begin_layout Quotation
3439 \begin_inset space \hfill{}
3445 \begin_layout Quotation
3447 \begin_inset space \hfill{}
3453 \begin_layout Quotation
3455 \begin_inset space \hfill{}
3462 \begin_layout Plain Layout
3474 \begin_layout Quotation
3476 \begin_inset space \hfill{}
3482 \begin_layout Quotation
3484 \begin_inset space \hfill{}
3491 \begin_layout Plain Layout
3503 \begin_layout Quotation
3505 \begin_inset space \hfill{}
3511 \begin_layout Quotation
3513 \begin_inset space \hfill{}
3519 \begin_layout Quotation
3521 \begin_inset space \hfill{}
3528 \begin_layout Plain Layout
3540 \begin_layout Quotation
3542 \begin_inset space \hfill{}
3549 \begin_layout Plain Layout
3561 \begin_layout Quotation
3563 \begin_inset space \hfill{}
3569 \begin_layout Quotation
3570 hungarian umlaut (hug)
3571 \begin_inset space \hfill{}
3577 \begin_layout Quotation
3579 \begin_inset space \hfill{}
3585 \begin_layout Quotation
3587 \begin_inset space \hfill{}
3594 \begin_layout Plain Layout
3606 \begin_layout Standard
3607 Since in many international keyboards there are exceptions to what some
3608 dead keys should do, you can define them using
3611 \begin_layout Quotation
3612 \begin_inset Flex Code
3615 \begin_layout Plain Layout
3623 deadkey key outstring
3626 \begin_layout Standard
3627 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3631 \begin_layout Quotation
3632 \begin_inset Flex Code
3635 \begin_layout Plain Layout
3648 \begin_layout Standard
3649 to make it work correctly.
3650 Also, you have to define as exceptions dead keys over i and j, to remove
3651 the dot from them before inserting an accent mark.
3652 I will change this when the time comes, but so far I haven't had time.
3655 \begin_layout Standard
3656 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3659 \begin_inset Flex Code
3662 \begin_layout Plain Layout
3668 have different meaning.
3670 \begin_inset Flex Code
3673 \begin_layout Plain Layout
3679 marks comments, quotes start and end LaTeX-style commands.
3680 To enter quote, you'll need to use
3681 \begin_inset Flex Code
3684 \begin_layout Plain Layout
3693 \begin_inset Flex Code
3696 \begin_layout Plain Layout
3703 \begin_inset Flex Code
3706 \begin_layout Plain Layout
3717 \begin_layout Standard
3718 If you make a keyboard description file that works for your language, please
3719 mail it to me, so I can include it in the next keymap distribution.
3722 \begin_layout Standard
3723 More keywords will be supported in keymap configuration file in future,
3727 \begin_layout Itemize
3728 \begin_inset Flex Code
3731 \begin_layout Plain Layout
3742 \begin_inset space \hfill{}
3746 \begin_inset Flex Code
3749 \begin_layout Plain Layout
3758 \begin_layout Itemize
3759 \begin_inset Flex Code
3762 \begin_layout Plain Layout
3773 \begin_inset space \hfill{}
3777 \begin_inset Flex Code
3780 \begin_layout Plain Layout
3786 an external keymap translation program
3789 \begin_layout Standard
3790 Also, it should look into
3791 \begin_inset Flex Code
3794 \begin_layout Plain Layout
3800 file for defaults, too (for example, a
3801 \begin_inset Flex Code
3804 \begin_layout Plain Layout
3812 option to include default keyboard).
3820 \begin_layout Section
3821 International Keymap Stuff
3822 \begin_inset CommandInset label
3824 name "sec:International-Keymap-Stuff"
3831 \begin_layout Standard
3832 \begin_inset Note Note
3835 \begin_layout Plain Layout
3836 In doing the revisions on this document in March 2008, I did not look over
3837 this stuff, as I do not understand it.
3838 It would be good if someone else could do so.
3847 \begin_layout Standard
3848 The next two sections describe the
3849 \begin_inset Flex Code
3852 \begin_layout Plain Layout
3861 \begin_inset Flex Code
3864 \begin_layout Plain Layout
3872 file syntax in detail.
3873 These sections should help you design your own key map if the ones provided
3874 do not meet your needs.
3877 \begin_layout Subsection
3881 \begin_layout Standard
3885 \begin_inset Flex Code
3888 \begin_layout Plain Layout
3894 file maps keystrokes to characters or strings.
3895 As the name suggests, it sets a keyboard mapping.
3897 \begin_inset Flex Code
3900 \begin_layout Plain Layout
3911 \begin_inset Flex Code
3914 \begin_layout Plain Layout
3929 \begin_inset Flex Code
3932 \begin_layout Plain Layout
3945 \begin_inset Flex Code
3948 \begin_layout Plain Layout
3957 \begin_inset Flex Code
3960 \begin_layout Plain Layout
3968 are described in this section.
3971 \begin_layout Labeling
3972 \labelwidthstring 00.00.0000
3973 \begin_inset Flex Code
3976 \begin_layout Plain Layout
3984 Map a character to a string
3987 \begin_layout LyX-Code
4002 \begin_layout Standard
4035 the double-quote (")
4052 must be escaped with a preceding backslash (
4063 \begin_layout Standard
4065 \begin_inset Flex MenuItem
4068 \begin_layout Plain Layout
4076 statement to cause the symbol
4077 \begin_inset Flex MenuItem
4080 \begin_layout Plain Layout
4088 to be output for the keystroke
4089 \begin_inset Flex MenuItem
4092 \begin_layout Plain Layout
4103 \begin_layout LyX-Code
4109 \begin_layout Labeling
4110 \labelwidthstring 00.00.0000
4111 \begin_inset Flex Code
4114 \begin_layout Plain Layout
4122 Specify an accent character
4125 \begin_layout LyX-Code
4134 \begin_layout Standard
4135 This will make the cha
4173 This is the dead key
4177 \begin_layout Plain Layout
4184 refers to a key that does not produce a character by itself, but when followed
4185 with another key, produces the desired accent character.
4186 For example, a German characte
4188 r with an umlaut like
4198 can be produced in this manner.
4207 \begin_layout Standard
4220 and then another key not in
4237 followed by the other, not allowed key, as output.
4241 \begin_inset Flex MenuItem
4244 \begin_layout Plain Layout
4252 cancels a dead key, so if
4263 \begin_inset Flex MenuItem
4266 \begin_layout Plain Layout
4275 , the cursor will not go one position backwards but will instead cancel
4291 might have had on the next keystroke.
4295 \begin_layout Standard
4296 The following example specifies that the character ' is to be an acute accent,
4297 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4300 \begin_layout LyX-Code
4303 kmod ' acute aeiouAEIOU
4306 \begin_layout Labeling
4307 \labelwidthstring 00.00.0000
4308 \begin_inset Flex Code
4311 \begin_layout Plain Layout
4317 Specify an exception to the accent character
4320 \begin_layout LyX-Code
4329 \begin_layout Standard
4330 This defines an exce
4371 have been assigned a keystroke with a previous
4374 \begin_inset Flex Code
4377 \begin_layout Plain Layout
4401 must not belong in the
4448 If such a declaration does not exist in
4456 \begin_inset Flex Code
4459 \begin_layout Plain Layout
4493 \begin_inset Flex Code
4496 \begin_layout Plain Layout
4510 \begin_layout Standard
4511 The following command produces causes äi to be produced when you enter acute-i
4515 \begin_layout LyX-Code
4529 \begin_layout Labeling
4530 \labelwidthstring 00.00.0000
4531 \begin_inset Flex Code
4534 \begin_layout Plain Layout
4540 Combine two accent characters
4543 \begin_layout LyX-Code
4549 accent1 accent2 allowed
4552 \begin_layout Standard
4553 This one is getting pretty esoteric.
4554 It allows you to combine the effect
4610 \begin_inset Flex Code
4613 \begin_layout Plain Layout
4641 \begin_layout Standard
4642 Consider this example from the
4643 \begin_inset Flex Code
4646 \begin_layout Plain Layout
4657 \begin_layout LyX-Code
4660 kmod ; acute aeioyvhAEIOYVH
4664 kcomb acute umlaut iyIY
4667 \begin_layout Standard
4668 This allows you to press
4669 \begin_inset Flex MenuItem
4672 \begin_layout Plain Layout
4680 and get the effect of
4681 \begin_inset Flex Code
4684 \begin_layout Plain Layout
4703 in this case cancels the last dead key, so if you press
4704 \begin_inset Flex MenuItem
4707 \begin_layout Plain Layout
4716 \begin_inset Flex Code
4719 \begin_layout Plain Layout
4732 \begin_layout Subsection
4736 \begin_layout Standard
4738 \begin_inset Flex Code
4741 \begin_layout Plain Layout
4749 mapping is performed, a
4750 \begin_inset Flex Code
4753 \begin_layout Plain Layout
4763 file maps the strings that the symbols generate to characters in the current
4765 The LyX distribution currently includes at least the
4766 \begin_inset Flex Code
4769 \begin_layout Plain Layout
4778 \begin_inset Flex Code
4781 \begin_layout Plain Layout
4792 \begin_layout Standard
4794 \begin_inset Flex Code
4797 \begin_layout Plain Layout
4805 file is a sequence of declarations of the form
4808 \begin_layout LyX-Code
4821 \begin_layout Standard
4822 For example, in order to map
4823 \begin_inset Flex MenuItem
4826 \begin_layout Plain Layout
4836 to the corresponding character in the iso-8859-1 set (233), the following
4840 \begin_layout LyX-Code
4848 \begin_layout Standard
4850 \begin_inset Flex Code
4853 \begin_layout Plain Layout
4862 \begin_inset Flex Code
4865 \begin_layout Plain Layout
4883 the same character can apply to more than one string.
4885 \begin_inset Flex Code
4888 \begin_layout Plain Layout
4899 \begin_layout LyX-Code
4911 \begin_inset Newline newline
4927 \begin_layout Standard
4928 If LyX cannot find a mapping for the string produced by the keystroke or
4929 a deadkey sequence, it will check if it looks like an accented char and
4930 try to draw an accent over the character on screen.
4933 \begin_layout Subsection
4937 \begin_layout Standard
4938 There is a second way to add support for international characters through
4939 so-called dead-keys.
4940 A dead-key works in combination with a letter to produce an accented character.
4941 Here, we'll explain how to create a really simple dead-key to illustrate
4945 \begin_layout Standard
4946 Suppose you happen to need the circumflex character,
4947 \begin_inset Quotes eld
4951 \begin_inset Quotes erd
4956 \begin_inset Flex MenuItem
4959 \begin_layout Plain Layout
4966 \begin_inset space ~
4970 \begin_inset Flex MenuItem
4973 \begin_layout Plain Layout
4979 ] to the LyX command
4980 \begin_inset Flex Code
4983 \begin_layout Plain Layout
4990 \begin_inset Flex Code
4993 \begin_layout Plain Layout
5000 Now, whenever you type the
5001 \begin_inset Flex MenuItem
5004 \begin_layout Plain Layout
5010 -key followed by a letter, that letter will have a circumflex accent on
5012 For example, the sequence
5013 \begin_inset Quotes eld
5017 \begin_inset Flex MenuItem
5020 \begin_layout Plain Layout
5027 \begin_inset Quotes erd
5030 produces the letter:
5031 \begin_inset Quotes eld
5035 \begin_inset Quotes erd
5039 If you tried to type
5040 \begin_inset Quotes eld
5044 \begin_inset Flex MenuItem
5047 \begin_layout Plain Layout
5054 \begin_inset Quotes erd
5057 , however, LyX will complain with a beep, since a
5058 \begin_inset Quotes eld
5062 \begin_inset Flex MenuItem
5065 \begin_layout Plain Layout
5072 \begin_inset Quotes erd
5075 never takes a circumflex accent.
5077 \begin_inset Flex MenuItem
5080 \begin_layout Plain Layout
5086 after a dead-key produces the bare-accent.
5087 Please note this last point! If you bind a key to a dead-key, you'll need
5088 to rebind the character on that key to yet another key.
5090 \begin_inset Flex MenuItem
5093 \begin_layout Plain Layout
5099 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5102 \begin_layout Standard
5103 One common way to bind dead-keys is to use
5104 \begin_inset Flex MenuItem
5107 \begin_layout Plain Layout
5114 \begin_inset Flex MenuItem
5117 \begin_layout Plain Layout
5124 \begin_inset Flex MenuItem
5127 \begin_layout Plain Layout
5133 in combination with an accent, like
5134 \begin_inset Quotes eld
5138 \begin_inset Flex MenuItem
5141 \begin_layout Plain Layout
5148 \begin_inset Quotes erd
5152 \begin_inset Quotes eld
5156 \begin_inset Flex MenuItem
5159 \begin_layout Plain Layout
5166 \begin_inset Quotes erd
5170 \begin_inset Quotes eld
5174 \begin_inset Flex MenuItem
5177 \begin_layout Plain Layout
5184 \begin_inset Quotes erd
5188 Another way involves using
5189 \begin_inset Flex Code
5192 \begin_layout Plain Layout
5199 \begin_inset Flex Code
5202 \begin_layout Plain Layout
5208 to set up the special
5209 \begin_inset Flex Code
5212 \begin_layout Plain Layout
5220 \begin_inset Flex Code
5223 \begin_layout Plain Layout
5229 acts in some ways just like
5230 \begin_inset Flex MenuItem
5233 \begin_layout Plain Layout
5239 and permits you to bind keys to accented characters.
5240 You can also turn keys into dead-keys by binding them to something like
5242 \begin_inset Flex Code
5245 \begin_layout Plain Layout
5251 and then binding this symbolic key to the corresponding LyX command.
5255 \begin_layout Plain Layout
5260 : This is exactly what I do in my
5261 \begin_inset Flex Code
5264 \begin_layout Plain Layout
5271 \begin_inset Flex Code
5274 \begin_layout Plain Layout
5282 \begin_inset Flex MenuItem
5285 \begin_layout Plain Layout
5287 \begin_inset space ~
5296 \begin_inset Flex Code
5299 \begin_layout Plain Layout
5305 and a bunch of these
5306 \begin_inset Quotes eld
5310 \begin_inset Flex Code
5313 \begin_layout Plain Layout
5320 \begin_inset Quotes erd
5323 symbolic keys bound such things as
5324 \begin_inset Flex MenuItem
5327 \begin_layout Plain Layout
5329 \begin_inset space ~
5338 \begin_inset Flex MenuItem
5341 \begin_layout Plain Layout
5343 \begin_inset space ~
5352 This is how I produce my accented characters.
5357 You can make just about anything into the
5358 \begin_inset Flex Code
5361 \begin_layout Plain Layout
5368 \begin_inset Flex MenuItem
5371 \begin_layout Plain Layout
5377 keys, a spare function key, etc.
5378 As for the LyX commands that produce accents, check the entry for
5379 \begin_inset Flex Code
5382 \begin_layout Plain Layout
5393 You'll find the complete list there.
5396 \begin_layout Subsection
5397 Saving your Language Configuration
5400 \begin_layout Standard
5401 You can edit your preferences so that your desired language environment
5402 is automatically configured when LyX starts up, via the
5403 \begin_inset Flex MenuItem
5406 \begin_layout Plain Layout
5407 Edit\SpecialChar \menuseparator
5416 \begin_layout Chapter
5417 Installing New Document Classes, Layouts, and Templates
5418 \begin_inset CommandInset label
5420 name "cha:Installing-New-Document"
5425 \begin_inset Argument 1
5428 \begin_layout Plain Layout
5429 Installing New Document Classes
5437 \begin_layout Standard
5438 In this chapter, we describe the procedures for creating and installing
5439 new LyX layout and template files, as well as offer a refresher on correctly
5440 installing new LaTeX document classes.
5444 \begin_layout Standard
5445 First, let us a say a few words about how one ought to think about the relation
5446 between LyX and LaTeX.
5447 The thing to understand is that, in a certain sense, LyX doesn't know anything
5449 Indeed, from LyX's point of view, LaTeX is just one of several
5450 \begin_inset Quotes eld
5454 \begin_inset Quotes erd
5457 in which it is capable of producing output.
5458 Other such formats are DocBook, plaintext, and XHTML.
5459 LaTeX is, of course, a particularly important format, but very little of
5460 the information LyX has about LaTeX is actually contained in the program
5465 \begin_layout Plain Layout
5466 Some commands are sufficiently complex that they are
5467 \begin_inset Quotes eld
5471 \begin_inset Quotes erd
5475 But the developers generally regard this as a Bad Thing.
5480 Rather, that information, even for the standard classes like
5481 \begin_inset Flex Code
5484 \begin_layout Plain Layout
5490 , is contained in `layout files'.
5491 Similarly, LyX itself does not know much about DocBook or XHTML.
5492 What it knows is contained in layout files.
5495 \begin_layout Standard
5496 You can think of the layout file for a given document class as a translation
5497 manual between LyX constructs---paragraphs with their corresponding styles,
5498 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5500 Almost everything LyX knows about
5501 \begin_inset Flex Code
5504 \begin_layout Plain Layout
5510 , for example, is contained in the file
5511 \begin_inset Flex Code
5514 \begin_layout Plain Layout
5520 and in various other files it includes.
5521 For this reason, anyone intending to write layout files should plan to
5522 study the existing files.
5523 A good place to start is with
5524 \begin_inset Flex Code
5527 \begin_layout Plain Layout
5533 , which is included in
5534 \begin_inset Flex Code
5537 \begin_layout Plain Layout
5544 \begin_inset Flex Code
5547 \begin_layout Plain Layout
5553 , and many of the other layout files for document classes.
5554 This file is where sections and the like are defined:
5555 \begin_inset Flex Code
5558 \begin_layout Plain Layout
5564 tells LyX how paragraphs that are marked with the Section, Subsection,
5565 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5568 \begin_inset Flex Code
5571 \begin_layout Plain Layout
5577 file basically just includes several of these
5578 \begin_inset Flex Code
5581 \begin_layout Plain Layout
5590 \begin_layout Standard
5591 Defining the LyX--LaTeX correspondence is not the only thing layout files
5593 Their other job is to define how the LyX constructs themselves will appear
5595 The fact that layout files have these two jobs is often a source of confusion,
5596 because they are completely separate.
5597 Telling LyX how to translate a certain paragraph style into LaTeX does
5598 not tell LyX how to display it; conversely, telling LyX how to display
5599 a certain paragraph style does not tell LyX how to translate it into LaTeX
5600 (let alone tell LaTeX how to display it).
5601 So, in general, when you define a new LyX construct, you must always do
5602 two quite separate things: (i)
5603 \begin_inset space ~
5606 tell LyX how to translate it into LaTeX and (ii)
5607 \begin_inset space ~
5610 tell LyX how to display it.
5613 \begin_layout Standard
5614 Much the same is true, of course, as regards LyX's other backend formats,
5615 though XHTML is in some ways different, because in that case LyX
5619 able, to some extent, to use information about how it should display a
5620 paragraph on the screen to output information (in the form of CSS) about
5621 how the paragraph should be displayed in a browser.
5622 Even in this case, however, the distinction between what LyX does internally
5623 and how things are rendered externally remains in force, and the two can
5624 be controlled separately.
5626 \begin_inset CommandInset ref
5628 reference "sec:Tags-for-XHTML"
5635 \begin_layout Section
5636 Installing new LaTeX files
5639 \begin_layout Standard
5640 Some installations may not include a LaTeX package or class file that you
5641 would like to use within LyX.
5642 For example, you might need FoilTeX, a package for preparing slides for
5643 overhead projectors.
5644 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5645 a user interface for installing such packages.
5646 For example, with MiKTeX, you start the program
5647 \begin_inset Quotes eld
5651 \begin_inset space ~
5655 \begin_inset Quotes erd
5658 to get a list of available packages.
5659 To install one of them, right click on it or use the corresponding toolbar
5663 \begin_layout Standard
5664 If your LaTeX distribution does not provide such a `package manager', or
5665 if the package is not available from your distribution, then follow these
5666 steps to install it manually:
5669 \begin_layout Enumerate
5670 Get the package from
5671 \begin_inset CommandInset href
5674 target "http://www.ctan.org/"
5681 \begin_layout Enumerate
5682 If the package contains a file with the ending
5683 \begin_inset Quotes eld
5687 \begin_inset Flex Code
5690 \begin_layout Plain Layout
5697 \begin_inset Quotes erd
5700 (is the case for FoilTeX) then open a console, change to the folder of
5701 this file and execute the command
5702 \begin_inset Flex Code
5705 \begin_layout Plain Layout
5712 You have now unpacked the package and have all files to install it.
5713 Most LaTeX-packages are not packed and you can skip this step.
5716 \begin_layout Enumerate
5717 Now you need to decide if the package should be available for all users
5722 \begin_layout Enumerate
5723 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5724 for all users on your system, then install it in your `local' TeX tree,
5725 otherwise install it in your own `user' TeX tree.
5726 Where these trees should be created, if they do not already exist, depends
5728 To find this out, look in the file
5729 \begin_inset Flex Code
5732 \begin_layout Plain Layout
5742 \begin_layout Plain Layout
5743 This is usually in the directory
5744 \begin_inset Flex Code
5747 \begin_layout Plain Layout
5753 , though you can execute the command
5754 \begin_inset Flex Code
5757 \begin_layout Plain Layout
5768 The location of the `local' TeX tree is defined by the
5769 \begin_inset Flex Code
5772 \begin_layout Plain Layout
5778 variable; this is usually somewhere like
5779 \begin_inset Flex Code
5782 \begin_layout Plain Layout
5783 /usr/local/share/texmf
5789 The location of the `user' TeX tree is defined by
5790 \begin_inset Flex Code
5793 \begin_layout Plain Layout
5800 \begin_inset Flex Code
5803 \begin_layout Plain Layout
5810 (If these variables are not predefined, you have to define them.) You'll
5811 probably need root permissions to create or modify the `local' tree, but
5812 not for your `user' tree.
5813 \begin_inset Newline newline
5816 In general, it is recommended to install in the user tree because your user
5817 will not be modified or even overwritten when you upgrade your system.
5818 It will typically also be backed up together with everything else when
5819 you backup your home directory (which, of course, you do on a regular basis).
5822 \begin_layout Enumerate
5823 On Windows, if you want the new package to be available for all users on
5824 your system, change to the folder where LaTeX is installed and then change
5826 \begin_inset Flex Code
5829 \begin_layout Plain Layout
5840 (For MiKTeX, this would be by default the folder
5841 \begin_inset Flex Code
5844 \begin_layout Plain Layout
5862 \begin_layout Plain Layout
5863 Note that this will be the correct path only on English installations.
5864 On a German one, it would be
5865 \begin_inset Flex Code
5868 \begin_layout Plain Layout
5882 , and similarly for other languages.
5887 Create there a new folder
5888 \begin_inset Flex Code
5891 \begin_layout Plain Layout
5897 and copy all files of the package into it.
5899 \begin_inset Newline newline
5902 If the package should only available for you or you don't have admin permissions
5903 , do the same, but in the local LaTeX folder.
5905 \begin_inset space \thinspace{}
5909 \begin_inset space ~
5912 2.8 under Windows XP, this would be the folder:
5913 \begin_inset Newline newline
5919 \begin_inset Flex Code
5922 \begin_layout Plain Layout
5925 Documents and Settings
5937 \begin_inset Newline newline
5943 \begin_inset Phantom HPhantom
5946 \begin_layout Plain Layout
5957 \begin_inset Flex Code
5960 \begin_layout Plain Layout
5973 \begin_inset Newline newline
5976 On Vista, it would be:
5977 \begin_inset Newline newline
5981 \begin_inset Flex Code
5984 \begin_layout Plain Layout
6010 \begin_layout Enumerate
6011 Now one only need to tell LaTeX that there are new files.
6012 This depends on the used LaTeX-Distribution:
6016 \begin_layout Enumerate
6017 For TeXLive execute the command
6018 \begin_inset Flex Code
6021 \begin_layout Plain Layout
6028 If you installed the package for all users, then you will probably need
6029 to have root permissions for that.
6032 \begin_layout Enumerate
6033 For MiKTeX, if you have installed the package for all users, start the program
6035 \begin_inset Quotes eld
6039 \begin_inset space ~
6043 \begin_inset Quotes erd
6046 and press the button marked
6047 \begin_inset Quotes eld
6051 \begin_inset Quotes erd
6055 Otherwise start the program
6056 \begin_inset Quotes eld
6060 \begin_inset Quotes erd
6067 \begin_layout Enumerate
6068 Finally, you need to tell LyX that there are new packages available.
6069 So, in LyX, use the menu
6070 \begin_inset Flex MenuItem
6073 \begin_layout Plain Layout
6076 \SpecialChar \menuseparator
6082 and then restart LyX.
6085 \begin_layout Standard
6086 Now the package is installed.
6087 In our example, the document class
6088 \begin_inset Flex Code
6091 \begin_layout Plain Layout
6093 \begin_inset space ~
6100 \begin_layout Plain Layout
6112 will now be available under
6113 \begin_inset Flex MenuItem
6116 \begin_layout Plain Layout
6117 Document\SpecialChar \menuseparator
6118 Settings\SpecialChar \menuseparator
6128 \begin_layout Standard
6129 If you would like to use a LaTeX document class that is not even listed
6131 \begin_inset Flex MenuItem
6134 \begin_layout Plain Layout
6135 Document\SpecialChar \menuseparator
6136 Settings\SpecialChar \menuseparator
6142 , then you need to create a `layout' file for it.
6143 That is the topic of the next section.
6146 \begin_layout Section
6147 Types of layout files
6150 \begin_layout Standard
6151 This section describes the various sorts of LyX files that contain layout
6153 These files describe various paragraph and character styles, determining
6154 how LyX should display them and how they should be translated into LaTeX,
6155 DocBook, XHTML, or whatever output format is being used.
6159 \begin_layout Standard
6160 We shall try to provide a thorough description of the process of writing
6162 However, there are so many different types of documents supported even
6163 by just LaTeX that we can't hope to cover every different possibility or
6164 problem you might encounter.
6165 The LyX users' list is frequented by people with lots of experience with
6166 layout design who are willing to share what they've learned, so please
6167 feel free to ask questions there.
6170 \begin_layout Standard
6171 As you prepare to write a new layout, it is extremely helpful to look at
6172 the layouts distributed with LyX.
6173 If you write a LyX layout for a LaTeX document class that might also be
6174 used by others, or write a module that might be useful to others, then
6175 you should consider posting your layout to the
6176 \begin_inset CommandInset href
6178 name "layout section on the LyX wiki"
6179 target "http://wiki.lyx.org/Layouts/Layouts"
6183 or even to the LyX developers' list, so that it might be included in LyX
6188 \begin_layout Plain Layout
6189 Note that LyX is licensed under the General Public License, so any material
6190 that is contributed to LyX must be similarly licensed.
6198 \begin_layout Subsection
6200 \begin_inset CommandInset label
6202 name "sub:Layout-modules"
6209 \begin_layout Standard
6210 We have spoken to this point about `layout files'.
6211 But there are different sorts of files that contain layout information.
6212 Layout files, strictly so called, have the
6213 \begin_inset Flex Code
6216 \begin_layout Plain Layout
6222 extension and provide LyX with information about document classes.
6223 As of LyX 1.6, however, layout information can also be contained in layout
6229 \begin_inset Flex Code
6232 \begin_layout Plain Layout
6239 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6240 some modules—such as the
6241 \begin_inset Flex Code
6244 \begin_layout Plain Layout
6250 module—specifically provide support for one package.
6251 In a sense, layout modules are similar to included
6255 \begin_layout Plain Layout
6256 These can have any extension, but by convention have the
6257 \begin_inset Flex Code
6260 \begin_layout Plain Layout
6272 \begin_inset Flex Code
6275 \begin_layout Plain Layout
6281 —in that modules are not specific to a given document class but may be used
6282 with many different classes.
6283 The difference is that using an included file with
6284 \begin_inset Flex Code
6287 \begin_layout Plain Layout
6293 requires editing that file.
6294 Modules, by contrast, are selected in the
6295 \begin_inset Flex MenuItem
6298 \begin_layout Plain Layout
6299 Document\SpecialChar \menuseparator
6308 \begin_layout Standard
6309 Building modules is the easiest way to get started with layout editing,
6310 since it can be as simple as adding a single new paragraph style or flex
6312 But modules may, in principle, contain anything a layout file can contain.
6315 \begin_layout Standard
6316 After creating a new module and copying it to the
6317 \begin_inset Flex Code
6320 \begin_layout Plain Layout
6326 folder, you will need to reconfigure and then restart LyX for the module
6327 to appear in the menu.
6328 However, changes you make to the module will be seen immediately, if you
6330 \begin_inset Flex MenuItem
6333 \begin_layout Plain Layout
6334 Document\SpecialChar \menuseparator
6340 , highlight something, and then hit
6341 \begin_inset Quotes eld
6345 \begin_inset Quotes erd
6351 It is strongly recommended that you save your work before doing this
6356 it is strongly recommended that you not attempt to edit modules while simultaneo
6357 usly working on actual documents
6360 Though of course the developers strive to keep LyX stable in such situations,
6361 syntax errors and the like in your module file could cause strange behavior.
6364 \begin_layout Subsubsection
6368 \begin_layout Standard
6369 Modules are to LyX as packages are to LaTeX.
6370 Sometimes, however, you find yourself wanting a specific inset or character
6371 style just for one document and writing a module that will also be available
6372 to other documents makes little sense.
6373 What you need is LyX's
6374 \begin_inset Quotes eld
6378 \begin_inset Quotes erd
6384 \begin_layout Standard
6385 You will find it under
6387 Document\SpecialChar \menuseparator
6388 Settings\SpecialChar \menuseparator
6392 The large text box allows you to enter anything that you might enter in
6393 a layout file or module.
6394 You can think of a document's local layout, in fact, as a module that belongs
6396 So, in particular, you must enter a
6397 \begin_inset Flex Code
6400 \begin_layout Plain Layout
6407 Any format is acceptable, but one would normally use the format current
6409 (In LyX 2.0, the current layout format is 35.) You should be aware that local
6410 layout is not supported by versions of LyX prior to 1.6, so you should not
6411 use it if you want to be able to export your document to LyX 1.5 or earlier
6412 (without, that is, losing the local layout information).
6413 If you wish to be able to export to 1.6---local layout is supported in 1.6,
6414 though there is no UI for it---then you should use format 11 and, of course,
6415 use only layout constructs that were available in LyX 1.6.
6418 \begin_layout Standard
6419 When you have entered something in the
6420 \begin_inset Flex Code
6423 \begin_layout Plain Layout
6429 pane, LyX will enable the
6430 \begin_inset Quotes eld
6434 \begin_inset Quotes erd
6437 button at the bottom.
6438 Clicking this button will cause LyX to determine whether what you have
6439 entered is valid layout information for the chosen format.
6440 LyX will report the result but, unfortunately, will not tell you what errors
6441 there might have been.
6442 These will be written to the terminal, however, if LyX is started from
6444 You will not be permitted to save your local layout until you have entered
6448 \begin_layout Standard
6449 The warnings at the end of the previous section apply here, too.
6450 Do not play with local layout while you are actually working, especially
6451 if you have not saved your document.
6452 That said, using local layout with a test document can be a very convenient
6453 way to try out layout ideas, or even to start developing a module.
6456 \begin_layout Subsection
6458 \begin_inset Flex MenuItem
6461 \begin_layout Plain Layout
6470 \begin_layout Standard
6471 There are two situations you are likely to encounter when wanting to support
6472 a new LaTeX document class, involving style (
6473 \begin_inset Flex Code
6476 \begin_layout Plain Layout
6482 ) files and LaTeX2e class (
6483 \begin_inset Flex Code
6486 \begin_layout Plain Layout
6493 Supporting a style file is usually fairly easy.
6494 Supporting a new class file is a bit harder.
6495 We'll discuss the former in this section and the latter in the next.
6496 Similar remarks apply, of course, if you want to support a new DocBook
6500 \begin_layout Standard
6501 The easier case is the one in which your new document class is provided
6502 as a style file that is to be used in conjunction with an already supported
6504 For the sake of the example, we'll assume that the style file is called
6506 \begin_inset Flex MenuItem
6509 \begin_layout Plain Layout
6515 and that it is meant to be used with
6516 \begin_inset Flex MenuItem
6519 \begin_layout Plain Layout
6525 , which is a standard class.
6529 \begin_layout Standard
6530 Start by copying the existing class's layout file into your local directory:
6534 \begin_layout Plain Layout
6535 Of course, which directory is your local directory will vary by platform,
6536 and LyX allows you to specify your local directory on startup, too, using
6538 \begin_inset Flex Code
6541 \begin_layout Plain Layout
6555 \begin_layout LyX-Code
6556 cp report.layout ~/.lyx/layouts/myclass.layout
6559 \begin_layout Standard
6561 \begin_inset Flex Code
6564 \begin_layout Plain Layout
6570 and change the line:
6573 \begin_layout LyX-Code
6576 DeclareLaTeXClass{report}
6579 \begin_layout Standard
6583 \begin_layout LyX-Code
6586 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6589 \begin_layout Standard
6593 \begin_layout LyX-Code
6595 \begin_inset Newline newline
6601 \begin_inset Newline newline
6607 \begin_layout Standard
6608 near the top of the file.
6611 \begin_layout Standard
6612 Start LyX and select
6613 \begin_inset Flex MenuItem
6616 \begin_layout Plain Layout
6617 Tools\SpecialChar \menuseparator
6624 Then restart LyX and try creating a new document.
6626 \begin_inset Flex MenuItem
6629 \begin_layout Plain Layout
6635 " as a document class option in the
6636 \begin_inset Flex MenuItem
6639 \begin_layout Plain Layout
6640 Document\SpecialChar \menuseparator
6647 It is likely that some of the sectioning commands and such in your new
6648 class will work differently from how they worked in the base class—
6649 \begin_inset Flex Code
6652 \begin_layout Plain Layout
6658 in this example—so you can fiddle around with the settings for the different
6659 sections if you wish.
6660 The layout information for sections is contained in
6661 \begin_inset Flex Code
6664 \begin_layout Plain Layout
6670 , but you do not need to copy and change this file.
6671 Instead, you can simply add your changes to your layout file, after the
6673 \begin_inset Flex Code
6676 \begin_layout Plain Layout
6682 , which itself includes
6683 \begin_inset Flex Code
6686 \begin_layout Plain Layout
6693 For example, you might add these lines:
6696 \begin_layout LyX-Code
6700 \begin_layout LyX-Code
6704 \begin_layout LyX-Code
6708 \begin_layout LyX-Code
6712 \begin_layout LyX-Code
6716 \begin_layout Standard
6717 to change the font for chapter headings to sans-serif.
6718 This will override (or, in this case, add to) the existing declaration
6719 for the Chapter style.
6723 \begin_layout Standard
6724 Your new package may also provide commands or environments not present in
6726 In this case, you will want to add these to the layout file.
6728 \begin_inset CommandInset ref
6730 reference "sec:TextClass"
6734 for information on how to do so.
6737 \begin_layout Standard
6739 \begin_inset Flex MenuItem
6742 \begin_layout Plain Layout
6748 can be used with several different document classes, and even if it cannot,
6749 you might find it easiest just to write a module that you can load with
6751 The simplest possible such module would be:
6754 \begin_layout LyX-Code
6757 DeclareLyXModule{My Package}
6760 \begin_layout LyX-Code
6764 \begin_layout LyX-Code
6765 #Support for mypkg.sty.
6768 \begin_layout LyX-Code
6770 \begin_inset Newline newline
6776 \begin_layout LyX-Code
6778 \begin_inset Newline newline
6784 \begin_layout LyX-Code
6786 \begin_inset Newline newline
6792 \begin_inset Newline newline
6798 \begin_layout Standard
6799 A more complex module might modify the behavior of some existing constructs
6800 or define some new ones.
6802 \begin_inset CommandInset ref
6804 reference "sec:TextClass"
6811 \begin_layout Subsection
6813 \begin_inset Flex MenuItem
6816 \begin_layout Plain Layout
6825 \begin_layout Standard
6826 There are two possibilities here.
6827 One is that the class file is itself based upon an existing document class.
6828 For example, many thesis classes are based upon
6829 \begin_inset Flex MenuItem
6832 \begin_layout Plain Layout
6839 To see whether yours is, look for a line like
6842 \begin_layout LyX-Code
6848 \begin_layout Standard
6850 If so, then you may proceed largely as in the previous section, though
6852 \begin_inset Flex Code
6855 \begin_layout Plain Layout
6861 line will be different.
6862 If your new class is
6863 \begin_inset Flex Code
6866 \begin_layout Plain Layout
6872 and it is based upon
6873 \begin_inset Flex Code
6876 \begin_layout Plain Layout
6882 , then the line should read:
6886 \begin_layout Plain Layout
6887 And it will be easiest if you save the file to
6888 \begin_inset Flex Code
6891 \begin_layout Plain Layout
6897 : LyX assumes that the document class has the same name as the layout file.
6906 \begin_layout LyX-Code
6909 DeclareLaTeXClass[thesis,book]{thesis}
6912 \begin_layout Standard
6913 If, on the other hand, the new class is not based upon an existing class,
6914 you will probably have to
6915 \begin_inset Quotes eld
6919 \begin_inset Quotes erd
6923 We strongly suggest copying an existing layout file which uses a similar
6924 LaTeX class and then modifying it, if you can do so.
6925 At least use an existing file as a starting point so you can find out what
6926 items you need to worry about.
6927 Again, the specifics are covered below.
6930 \begin_layout Subsection
6932 \begin_inset CommandInset label
6934 name "sub:Creating-Templates"
6941 \begin_layout Standard
6942 Once you have written a layout file for a new document class, you might
6943 want to consider writing a
6948 A template acts as a kind of tutorial for your layout, showing how it might
6949 be used, though containing dummy content.
6950 You can of course look at the various templates included with LyX for ideas.
6953 \begin_layout Standard
6954 Templates are created just like usual documents: using LyX.
6955 The only difference is that usual documents contain all possible settings,
6956 including the font scheme and the paper size.
6957 Usually a user doesn't want a template to overwrite his preferred settings
6958 for such parameters.
6959 For that reason, the designer of a template should remove the corresponding
6961 \begin_inset Flex Code
6964 \begin_layout Plain Layout
6973 \begin_inset Flex Code
6976 \begin_layout Plain Layout
6984 from the template LyX file.
6985 This can be done with any simple text-editor, for example
6986 \begin_inset Flex Code
6989 \begin_layout Plain Layout
6996 \begin_inset Flex Code
6999 \begin_layout Plain Layout
7009 \begin_layout Standard
7010 Put the edited template files you create in
7011 \begin_inset Flex Code
7014 \begin_layout Plain Layout
7020 , copy the ones you use from the global template directory in
7021 \begin_inset Flex Code
7024 \begin_layout Plain Layout
7030 to the same place, and redefine the template path in the
7031 \begin_inset Flex MenuItem
7034 \begin_layout Plain Layout
7035 Tools\SpecialChar \menuseparator
7036 Preferences\SpecialChar \menuseparator
7045 \begin_layout Standard
7046 Note, by the way, that there is a template which has a particular meaning:
7048 \begin_inset Flex Code
7051 \begin_layout Plain Layout
7058 This template is loaded every time you create a new document with
7059 \begin_inset Flex MenuItem
7062 \begin_layout Plain Layout
7063 File\SpecialChar \menuseparator
7069 in order to provide useful defaults.
7070 To create this template from inside LyX, all you have to do is to open
7071 a document with the correct settings, and use the
7072 \begin_inset Flex MenuItem
7075 \begin_layout Plain Layout
7076 Save as Document Defaults
7084 \begin_layout Subsection
7085 Upgrading old layout files
7088 \begin_layout Standard
7089 The format of layout files changes with each LyX release, so old layout
7090 files need to be converted to the new format.
7091 This process has been automated since LyX 1.4: If LyX reads a layout file
7092 in an older format, it automatically calls the script
7093 \begin_inset Flex Code
7096 \begin_layout Plain Layout
7102 to convert it to a temporary file in current format.
7103 The original file is left untouched.
7104 If you use the layout file often, then, you may want to convert it permanently,
7105 so that LyX does not have to do so itself every time.
7106 To do this, you can call the converter manually:
7109 \begin_layout LyX-Code
7110 mv myclass.layout myclass.old
7113 \begin_layout LyX-Code
7114 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
7117 \begin_layout Standard
7119 \begin_inset Flex Code
7122 \begin_layout Plain Layout
7128 with the name of your LyX system directory, of course.
7131 \begin_layout Standard
7132 Note that manual conversion does not affect included files, so these will
7133 have to be converted separately.
7136 \begin_layout Section
7137 \begin_inset CommandInset label
7139 name "sec:TextClass"
7143 The layout file format
7146 \begin_layout Standard
7147 When it's finally time to get your hands dirty and create or edit your own
7148 layout file, the following sections describe what you're up against.
7149 Our advice is to go slowly, save and test often, listen to soothing music,
7150 and enjoy one or two of your favorite adult beverages; more if you are
7151 getting particularly stuck.
7152 It's really not that hard, except that the multitude of options can become
7153 overwhelming if you try to do too much in one sitting.
7154 Go have another adult beverage, just for good measure.
7157 \begin_layout Standard
7158 Note that all the tags used in layout files are case-insensitive.
7160 \begin_inset Flex Code
7163 \begin_layout Plain Layout
7170 \begin_inset Flex Code
7173 \begin_layout Plain Layout
7180 \begin_inset Flex Code
7183 \begin_layout Plain Layout
7189 are really the same tag.
7190 The possible values are printed in brackets after the feature's name.
7191 The default value if a feature isn't specified inside a text class-description
7193 \begin_inset Flex Code
7196 \begin_layout Plain Layout
7205 If the argument has a data type like
7206 \begin_inset Quotes eld
7210 \begin_inset Quotes erd
7214 \begin_inset Quotes eld
7218 \begin_inset Quotes erd
7221 , the default is shown like this:
7222 \begin_inset Flex Code
7225 \begin_layout Plain Layout
7236 \begin_layout Subsection
7237 The document class declaration
7238 \change_inserted -712698321 1349766602
7244 \begin_layout Standard
7245 Lines in a layout file which begin with
7246 \begin_inset Flex Code
7249 \begin_layout Plain Layout
7256 There is one exception to this rule.
7258 \begin_inset Flex Code
7261 \begin_layout Plain Layout
7267 files should begin with
7268 \change_deleted -712698321 1349766533
7272 \change_inserted -712698321 1349766536
7278 \begin_layout LyX-Code
7281 #% Do not delete the line below; configure depends on this
7284 \begin_layout LyX-Code
7290 \change_deleted -712698321 1349766193
7292 \change_inserted -712698321 1349766201
7293 Article (Standard Class)
7296 \change_inserted -712698321 1349766538
7300 \begin_layout LyX-Code
7302 \change_inserted -712698321 1349766581
7307 DeclareCategory{Articles}
7312 \begin_layout Standard
7314 \change_inserted -712698321 1349766695
7318 \change_inserted -712698321 1349766626
7322 \change_deleted -712698321 1349766628
7324 \change_inserted -712698321 1349766628
7327 used when you (re)configure LyX.
7328 The layout file is read by the LaTeX script
7329 \begin_inset Flex Code
7332 \begin_layout Plain Layout
7338 , in a special mode where
7339 \begin_inset Flex Code
7342 \begin_layout Plain Layout
7349 The first line is just a LaTeX comment,
7350 \change_deleted -712698321 1349766656
7353 the second one contains the
7354 \change_inserted -712698321 1349766650
7357 declaration of the text class
7358 \change_inserted -712698321 1349766689
7359 , and the third line contains the optional classification of the class
7362 If these lines appear in a file named
7363 \begin_inset Flex Code
7366 \begin_layout Plain Layout
7372 , then they define a text class of name
7373 \begin_inset Flex Code
7376 \begin_layout Plain Layout
7382 (the name of the layout file) which uses the LaTeX document class
7383 \begin_inset Flex Code
7386 \begin_layout Plain Layout
7392 (the default is to use the same name as the layout).
7394 \begin_inset Quotes eld
7398 \change_deleted -712698321 1349766253
7400 \change_inserted -712698321 1349766260
7401 Article (Standard Class)
7404 \begin_inset Quotes erd
7407 that appears above is used as a description of the text class in the
7408 \begin_inset Flex MenuItem
7411 \begin_layout Plain Layout
7412 Document\SpecialChar \menuseparator
7420 \change_inserted -712698321 1349767097
7422 \begin_inset Quotes eld
7426 \begin_inset Quotes erd
7429 in the example) is also used in the
7430 \begin_inset Flex MenuItem
7433 \begin_layout Plain Layout
7435 \change_inserted -712698321 1349766801
7436 Document\SpecialChar \menuseparator
7442 dialog: the text classes are grouped by these categories (which are usually
7443 genres, so typical categories are
7444 \begin_inset Quotes eld
7448 \begin_inset Quotes erd
7452 \begin_inset Quotes eld
7456 \begin_inset Quotes erd
7460 \begin_inset Quotes eld
7464 \begin_inset Quotes erd
7468 \begin_inset Quotes eld
7472 \begin_inset Quotes erd
7476 \begin_inset Quotes eld
7480 \begin_inset Quotes erd
7484 \begin_inset Quotes eld
7488 \begin_inset Quotes erd
7492 If no category has been declared, the class will be put in the
7493 \begin_inset Quotes eld
7497 \begin_inset Quotes erd
7505 \begin_layout Standard
7506 Let's assume that you wrote your own text class that uses the
7507 \begin_inset Flex Code
7510 \begin_layout Plain Layout
7516 document class, but where you changed the appearance of the section headings.
7517 If you put it in a file
7518 \begin_inset Flex Code
7521 \begin_layout Plain Layout
7527 , the header of this file should be:
7530 \begin_layout LyX-Code
7533 #% Do not delete the line below; configure depends on this
7536 \begin_layout LyX-Code
7541 DeclareLaTeXClass[article]{
7542 \change_deleted -712698321 1349766303
7544 \change_inserted -712698321 1349766303
7548 \change_deleted -712698321 1349766338
7550 \change_inserted -712698321 1349766338
7554 \change_deleted -712698321 1349766340
7556 \change_inserted -712698321 1349766340
7560 \change_deleted -712698321 1349766343
7562 \change_inserted -712698321 1349766343
7566 \change_inserted -712698321 1349767223
7570 \begin_layout LyX-Code
7572 \change_inserted -712698321 1349767223
7577 DeclareCategory{Articles}
7582 \begin_layout Standard
7583 This declares a text class
7584 \begin_inset Flex Code
7587 \begin_layout Plain Layout
7593 , associated with the LaTeX document class
7594 \begin_inset Flex Code
7597 \begin_layout Plain Layout
7604 \begin_inset Quotes eld
7608 \change_deleted -712698321 1349766329
7610 \change_inserted -712698321 1349766329
7614 \change_deleted -712698321 1349766347
7616 \change_inserted -712698321 1349766347
7620 \change_deleted -712698321 1349766350
7622 \change_inserted -712698321 1349766350
7626 \change_deleted -712698321 1349766352
7628 \change_inserted -712698321 1349766352
7632 \begin_inset Quotes erd
7636 If your text class depends on several packages, you can declare it as:
7639 \begin_layout LyX-Code
7642 #% Do not delete the line below; configure depends on this
7645 \begin_layout LyX-Code
7650 DeclareLaTeXClass[article,foo.sty]{
7651 \change_deleted -712698321 1349766366
7653 \change_inserted -712698321 1349766366
7657 \change_deleted -712698321 1349766369
7659 \change_inserted -712698321 1349766369
7663 \change_deleted -712698321 1349766371
7665 \change_inserted -712698321 1349766371
7669 \change_deleted -712698321 1349766374
7671 \change_inserted -712698321 1349766374
7675 \change_inserted -712698321 1349767240
7679 \begin_layout LyX-Code
7681 \change_inserted -712698321 1349767240
7686 DeclareCategory{Articles}
7691 \begin_layout Standard
7692 This indicates that your text class uses the
7693 \begin_inset Flex Code
7696 \begin_layout Plain Layout
7703 Finally, it is also possible to declare classes for DocBook code.
7704 Typical declarations will look like:
7707 \begin_layout LyX-Code
7710 #% Do not delete the line below; configure depends on this
7713 \begin_layout LyX-Code
7718 DeclareDocBookClass[article]{SGML (DocBook
7719 \change_deleted -712698321 1349766387
7721 \change_inserted -712698321 1349766387
7725 \change_inserted -712698321 1349767247
7729 \begin_layout LyX-Code
7731 \change_inserted -712698321 1349767302
7736 DeclareCategory{Articles (DocBook)}
7741 \begin_layout Standard
7742 Note that these declarations can also be given an optional parameter declaring
7743 the name of the document class (but not a list).
7746 \begin_layout Standard
7747 So, to be as explicit as possible, the form of the layout declaration is:
7750 \begin_layout LyX-Code
7755 DeclareLaTeXClass[class,package.sty]{layout description}
7756 \change_inserted -712698321 1349767329
7760 \begin_layout LyX-Code
7762 \change_inserted -712698321 1349767339
7767 DeclareCategory{category}
7772 \begin_layout Standard
7773 The class need only be specified if the name of the LaTeX class file and
7774 the name of the layout file are different or if there are packages to load.
7775 If the name of the class file is not specified, then LyX will simply assume
7776 that it is the same as the name of the layout file.
7779 \begin_layout Standard
7780 When the text class has been modified to your taste, all you have to do
7781 is to copy it either to
7782 \begin_inset Flex Code
7785 \begin_layout Plain Layout
7792 \begin_inset Flex Code
7795 \begin_layout Plain Layout
7802 \begin_inset Flex MenuItem
7805 \begin_layout Plain Layout
7806 Tools\SpecialChar \menuseparator
7812 , exit LyX and restart.
7813 Then your new text class should be available along with the others.
7816 \begin_layout Standard
7817 Once the layout file is installed, you can edit it and see your changes
7818 without having to reconfigure or to restart LyX.
7823 \begin_layout Plain Layout
7824 In versions of LyX prior to 1.6, this was not true.
7825 As a result, editing layout files was very time consuming, since you had
7826 constantly to restart LyX to see changes.
7831 You can force a reload of the current layout by using the LyX function
7833 \begin_inset Flex MenuItem
7836 \begin_layout Plain Layout
7843 There is no default binding for this function—though, of course, you can
7844 bind it to a key yourself.
7845 But you will normally use this function simply by entering it in the mini-buffe
7850 \begin_layout Standard
7856 \begin_inset Flex MenuItem
7859 \begin_layout Plain Layout
7865 is very much an `advanced feature'.
7870 recommended that you save your work before using this function.
7875 recommended that you not attempt to edit layout information while simultaneousl
7876 y working on a document that you care about.
7877 Use a test document.
7878 Syntax errors and the like in your layout file could cause peculiar behavior.
7879 In particular, such errors could cause LyX to regard the current layout
7880 as invalid and to attempt to switch to some other layout.
7884 \begin_layout Plain Layout
7885 Really bad syntax errors may even caused LyX to exit.
7886 This is because certain sorts of errors may make LyX unable to read
7896 The LyX team strives to keep LyX stable in such situations, but safe is
7901 \begin_layout Plain Layout
7902 While we're giving advice: make regular backups.
7903 And be nice to your mother.
7911 \begin_layout Subsection
7912 The Module declaration
7915 \begin_layout Standard
7916 A module must begin with a line like the following:
7919 \begin_layout LyX-Code
7922 DeclareLyXModule[endnotes.sty]{Endnotes}
7925 \begin_layout Standard
7926 The mandatory argument, in curly brackets, is the name of the module, as
7928 \begin_inset Flex MenuItem
7931 \begin_layout Plain Layout
7932 Document\SpecialChar \menuseparator
7933 Settings\SpecialChar \menuseparator
7940 The argument in square brackets is optional: It declares any LaTeX packages
7941 on which the module depends.
7942 Please note that only packages about which LyX knows should be listed in
7943 the square brackets.
7947 \begin_layout Plain Layout
7948 The list of such packages is documented only in the source code.
7953 LyX will not check for arbitrary packages.
7954 It is also possible to use the form
7955 \begin_inset Flex MenuItem
7958 \begin_layout Plain Layout
7964 as an optional argument, which declares that the module can only be used
7965 when there exists a conversion chain between the formats `
7966 \begin_inset Flex Code
7969 \begin_layout Plain Layout
7976 \begin_inset Flex Code
7979 \begin_layout Plain Layout
7988 \begin_layout Standard
7989 The module declaration should then be followed by lines like the following
7993 \begin_layout Plain Layout
7994 Preferably in English if the module should be published with LyX.
7995 This description will appear in the list of messages to be translated and
7996 will be thus translated with the next interface update.
8004 \begin_layout LyX-Code
8008 \begin_layout LyX-Code
8009 #Adds an endnote command, in addition to footnotes.
8013 \begin_layout LyX-Code
8014 #You will need to add
8016 theendnotes in TeX code where you
8019 \begin_layout LyX-Code
8020 #want the endnotes to appear.
8024 \begin_layout LyX-Code
8028 \begin_layout LyX-Code
8029 #Requires: somemodule | othermodule
8032 \begin_layout LyX-Code
8033 #Excludes: badmodule
8036 \begin_layout Standard
8037 The description is used in
8038 \begin_inset Flex MenuItem
8041 \begin_layout Plain Layout
8042 Document\SpecialChar \menuseparator
8043 Settings\SpecialChar \menuseparator
8049 to provide the user with information about what the module does.
8051 \begin_inset Flex Code
8054 \begin_layout Plain Layout
8060 line is used to identify other modules with which this one must be used;
8062 \begin_inset Flex Code
8065 \begin_layout Plain Layout
8071 line is used to identify modules with which this one may not be used.
8072 Both are optional, and, as shown, multiple modules should be separated
8073 with the pipe symbol: |.
8074 Note that the required modules are treated disjunctively:
8078 of the required modules must be used.
8083 excluded module may be used.
8084 Note that modules are identified here by their
8089 \begin_inset Flex Code
8092 \begin_layout Plain Layout
8100 \begin_inset Flex Code
8103 \begin_layout Plain Layout
8110 \begin_inset Flex Code
8113 \begin_layout Plain Layout
8122 \begin_layout Subsection
8126 \begin_layout Standard
8127 The first non-comment line of any layout file, included file, or module
8132 contain the file format number:
8135 \begin_layout Description
8136 \begin_inset Flex Code
8139 \begin_layout Plain Layout
8146 \begin_inset Flex Code
8149 \begin_layout Plain Layout
8155 ] The format of the layout file.
8158 \begin_layout Standard
8159 This tag was introduced with LyX 1.4.0.
8160 Layout files from LyX 1.3.x and earlier don't have an explicit file format
8161 and are considered to be of format 1.
8162 The format for the present version of LyX is format 21.
8163 But each version of LyX is capable of reading earlier versions' layout
8164 files, just as they are capable of reading files produced by earlier versions
8166 There is, however, no provision for converting to earlier formats.
8167 So LyX 1.6.x will not read layout files in format 21 but only files in format
8171 \begin_layout Subsection
8172 \begin_inset CommandInset label
8174 name "sub:General-text-class"
8178 General text class parameters
8181 \begin_layout Standard
8182 These are general parameters that govern the behavior of an entire document
8188 mean that they must appear in
8189 \begin_inset Flex Code
8192 \begin_layout Plain Layout
8198 files rather than in modules.
8199 A module can contain any layout tag.)
8202 \begin_layout Description
8203 \begin_inset Flex Code
8206 \begin_layout Plain Layout
8212 Adds information that will be output in the
8213 \begin_inset Flex Code
8216 \begin_layout Plain Layout
8222 block when this document class is output to XHTML.
8223 Typically, this would be used to output CSS style information, but it can
8224 be used for anything that can appear in
8225 \begin_inset Flex Code
8228 \begin_layout Plain Layout
8236 \begin_inset Quotes eld
8240 \begin_inset Flex Code
8243 \begin_layout Plain Layout
8250 \begin_inset Quotes erd
8256 \begin_layout Description
8257 \begin_inset Flex Code
8260 \begin_layout Plain Layout
8266 Adds CSS styling information.
8267 This will either be output in a
8268 \begin_inset Quotes eld
8272 \begin_inset Flex Code
8275 \begin_layout Plain Layout
8282 \begin_inset Quotes erd
8285 block or, if the user has so chosen, to a separate CSS file.Must end with
8287 \begin_inset Quotes eld
8291 \begin_inset Flex Code
8294 \begin_layout Plain Layout
8301 \begin_inset Quotes erd
8307 \begin_layout Description
8308 \begin_inset Flex Code
8311 \begin_layout Plain Layout
8317 Adds information to the document preamble.
8319 \begin_inset Quotes eld
8323 \begin_inset Flex Code
8326 \begin_layout Plain Layout
8333 \begin_inset Quotes erd
8339 \begin_layout Description
8340 \begin_inset Flex Code
8343 \begin_layout Plain Layout
8349 Defines formats for use in the display of bibliographic information.
8351 \begin_inset CommandInset ref
8353 reference "sub:Citation-format-description"
8359 \begin_inset Quotes eld
8363 \begin_inset Flex Code
8366 \begin_layout Plain Layout
8373 \begin_inset Quotes erd
8379 \begin_layout Description
8380 \begin_inset Flex Code
8383 \begin_layout Plain Layout
8389 Describes various global options supported by the document class.
8391 \begin_inset space ~
8395 \begin_inset CommandInset ref
8397 reference "sub:ClassOptions"
8403 \begin_inset Quotes eld
8407 \begin_inset Flex Code
8410 \begin_layout Plain Layout
8417 \begin_inset Quotes erd
8423 \begin_layout Description
8424 \begin_inset Flex Code
8427 \begin_layout Plain Layout
8434 \begin_inset Flex Code
8437 \begin_layout Plain Layout
8446 \begin_inset Flex Code
8449 \begin_layout Plain Layout
8455 ] Whether the class should
8459 to having one or two columns.
8460 Can be changed in the
8461 \begin_inset Flex MenuItem
8464 \begin_layout Plain Layout
8465 Document\SpecialChar \menuseparator
8474 \begin_layout Description
8475 \begin_inset Flex Code
8478 \begin_layout Plain Layout
8485 \begin_inset Flex Code
8488 \begin_layout Plain Layout
8494 ] This sequence defines the properties for a counter.
8495 If the counter does not yet exist, it is created; if it does exist, it
8498 \begin_inset Quotes eld
8502 \begin_inset Flex Code
8505 \begin_layout Plain Layout
8512 \begin_inset Quotes erd
8516 \begin_inset Newline newline
8520 \begin_inset space ~
8524 \begin_inset CommandInset ref
8526 reference "sub:Counters"
8530 for details on counters.
8533 \begin_layout Description
8534 \begin_inset Flex Code
8537 \begin_layout Plain Layout
8543 Sets the default font used to display the document.
8545 \begin_inset space ~
8549 \begin_inset CommandInset ref
8551 reference "sub:Font-description"
8555 for how to declare fonts.
8557 \begin_inset Quotes eld
8561 \begin_inset Flex Code
8564 \begin_layout Plain Layout
8571 \begin_inset Quotes erd
8577 \begin_layout Description
8578 \begin_inset Flex Code
8581 \begin_layout Plain Layout
8588 \begin_inset Flex Code
8591 \begin_layout Plain Layout
8597 Specifies a module to be included by default with this document class.
8598 The module should be specified by filename without the
8599 \begin_inset Flex Code
8602 \begin_layout Plain Layout
8609 The user can still remove the module, but it will be active at the outset.
8610 (This applies only when new files are created, or when this class is chosen
8611 for an existing document.)
8614 \begin_layout Description
8615 \begin_inset Flex Code
8618 \begin_layout Plain Layout
8625 \begin_inset Flex Code
8628 \begin_layout Plain Layout
8634 ] This is the style that will be assigned to new paragraphs, usually
8635 \begin_inset Flex MenuItem
8638 \begin_layout Plain Layout
8645 This will default to the first defined style if not given, but you are
8646 encouraged to use this directive.
8649 \begin_layout Description
8650 \begin_inset Flex Code
8653 \begin_layout Plain Layout
8660 \begin_inset Flex Code
8663 \begin_layout Plain Layout
8669 ] This tag indicates that the module in question—which should be specified
8670 by filename without the
8671 \begin_inset Flex Code
8674 \begin_layout Plain Layout
8680 extension—cannot be used with this document class.
8681 This might be used in a journal-specific layout file to prevent, say, the
8683 \begin_inset Flex Code
8686 \begin_layout Plain Layout
8692 module that numbers theorems by section.
8697 be used in a module.
8698 Modules have their own way of excluding other modules (see
8699 \begin_inset CommandInset ref
8701 reference "sub:Layout-modules"
8708 \begin_layout Description
8709 \begin_inset Flex Code
8712 \begin_layout Plain Layout
8718 Defines a new float.
8720 \begin_inset space ~
8724 \begin_inset CommandInset ref
8726 reference "sub:Floats"
8732 \begin_inset Quotes eld
8736 \begin_inset Flex Code
8739 \begin_layout Plain Layout
8746 \begin_inset Quotes erd
8752 \begin_layout Description
8753 \begin_inset Flex Code
8756 \begin_layout Plain Layout
8762 Sets the information that will be output in the
8763 \begin_inset Flex Code
8766 \begin_layout Plain Layout
8772 block when this document class is output to XHTML.
8773 Note that this will completely override any prior
8774 \begin_inset Flex Code
8777 \begin_layout Plain Layout
8784 \begin_inset Flex Code
8787 \begin_layout Plain Layout
8795 \begin_inset Flex Code
8798 \begin_layout Plain Layout
8804 if you just want to add material to the preamble.) Must end with
8805 \begin_inset Quotes eld
8809 \begin_inset Flex Code
8812 \begin_layout Plain Layout
8819 \begin_inset Quotes erd
8825 \begin_layout Description
8826 \begin_inset Flex Code
8829 \begin_layout Plain Layout
8835 Sets CSS styling information.
8836 This will either be output in a
8837 \begin_inset Quotes eld
8841 \begin_inset Flex Code
8844 \begin_layout Plain Layout
8851 \begin_inset Quotes erd
8854 block or, if the user has so chosen, to a separate CSS file.
8855 Note that this will completely override any prior
8856 \begin_inset Flex Code
8859 \begin_layout Plain Layout
8866 \begin_inset Flex Code
8869 \begin_layout Plain Layout
8877 \begin_inset Flex Code
8880 \begin_layout Plain Layout
8886 if you just want to add material.) Must end with
8887 \begin_inset Quotes eld
8891 \begin_inset Flex Code
8894 \begin_layout Plain Layout
8901 \begin_inset Quotes erd
8907 \begin_layout Description
8908 \begin_inset Flex Code
8911 \begin_layout Plain Layout
8918 \begin_inset Flex Code
8921 \begin_layout Plain Layout
8927 ] The layout to use for the table of contents, bibliography, and so forth,
8928 when the document is output to HTML.
8929 For articles, this should normally be Section; for books, Chapter.
8930 If it is not given, then LyX will attempt to figure out which layout to
8934 \begin_layout Description
8935 \begin_inset Flex Code
8938 \begin_layout Plain Layout
8945 \begin_inset Flex Code
8948 \begin_layout Plain Layout
8954 ] Modifies the properties of the given counter.
8955 If the counter does not exist, the section is ignored.
8957 \begin_inset Quotes eld
8961 \begin_inset Flex Code
8964 \begin_layout Plain Layout
8971 \begin_inset Quotes erd
8975 \begin_inset Newline newline
8979 \begin_inset space ~
8983 \begin_inset CommandInset ref
8985 reference "sub:Counters"
8989 for details on counters.
8992 \begin_layout Description
8993 \begin_inset Flex Code
8996 \begin_layout Plain Layout
9003 \begin_inset Flex Code
9006 \begin_layout Plain Layout
9012 ] Modifies the properties of the given paragraph style.
9013 If the style does not exist, the section is ignored.
9015 \begin_inset Quotes eld
9019 \begin_inset Flex Code
9022 \begin_layout Plain Layout
9029 \begin_inset Quotes erd
9035 \begin_layout Description
9036 \begin_inset Flex Code
9039 \begin_layout Plain Layout
9045 As its name implies, this command allows you to include another layout
9046 definition file within yours to avoid duplicating commands.
9047 Common examples are the standard layout files, for example,
9048 \begin_inset Flex Code
9051 \begin_layout Plain Layout
9057 , which contains most of the basic layouts.
9060 \begin_layout Description
9061 \begin_inset Flex Code
9064 \begin_layout Plain Layout
9070 This section (re-)defines the layout of an inset.
9071 It can be applied to an existing inset or to a new, user-defined inset,
9072 e.g., a new character style.
9074 \begin_inset Quotes eld
9078 \begin_inset Flex Code
9081 \begin_layout Plain Layout
9088 \begin_inset Quotes erd
9092 \begin_inset Newline newline
9096 \begin_inset space ~
9100 \begin_inset CommandInset ref
9102 reference "sub:Flex-insets-and"
9106 for more information.
9110 \begin_layout Description
9111 \begin_inset Flex Code
9114 \begin_layout Plain Layout
9121 \begin_inset Flex Code
9124 \begin_layout Plain Layout
9130 ] A string that indicates the width of the left margin on the screen, for
9132 \begin_inset Quotes eld
9136 \begin_inset Quotes erd
9140 (Note that this is not a `length', like
9141 \begin_inset Quotes eld
9145 \begin_inset Quotes erd
9151 \begin_layout Description
9152 \begin_inset Flex Code
9155 \begin_layout Plain Layout
9162 \begin_inset Flex Code
9165 \begin_layout Plain Layout
9171 ] This command deletes an existing counter, usually one defined in an included
9175 \begin_layout Description
9176 \begin_inset Flex Code
9179 \begin_layout Plain Layout
9185 This command deletes an existing float.
9186 This is particularly useful when you want to suppress a float that has
9187 been defined in an input file.
9190 \begin_layout Description
9191 \begin_inset Flex Code
9194 \begin_layout Plain Layout
9200 This command deletes an existing style.
9201 This is particularly useful when you want to suppress a style that has
9202 be defined in an input file.
9205 \begin_layout Description
9206 \begin_inset Flex Code
9209 \begin_layout Plain Layout
9215 A string indicating the file format (as defined in the Preferences dialog)
9216 produced by this class.
9217 It is mainly useful when
9218 \begin_inset Flex Code
9221 \begin_layout Plain Layout
9227 is `literate' and one wants to define a new type of literate document.
9228 This string is reset to `docbook', `latex', or `literate' when the correspondin
9230 \begin_inset Flex Code
9233 \begin_layout Plain Layout
9239 parameter is encountered.
9242 \begin_layout Description
9243 \begin_inset Flex Code
9246 \begin_layout Plain Layout
9252 A string indicating what sort of output documents using this class will
9254 At present, the options are: `docbook', `latex', and `literate'.
9257 \begin_layout Description
9258 \begin_inset Flex Code
9261 \begin_layout Plain Layout
9268 \begin_inset Flex Code
9271 \begin_layout Plain Layout
9280 \begin_inset Flex Code
9283 \begin_layout Plain Layout
9290 \begin_inset Flex Code
9293 \begin_layout Plain Layout
9299 ] The default pagestyle.
9300 Can be changed in the
9301 \begin_inset Flex MenuItem
9304 \begin_layout Plain Layout
9305 Document\SpecialChar \menuseparator
9314 \begin_layout Description
9315 \begin_inset Flex Code
9318 \begin_layout Plain Layout
9324 Sets the preamble for the LaTeX document.
9325 Note that this will completely override any prior
9326 \begin_inset Flex Code
9329 \begin_layout Plain Layout
9336 \begin_inset Flex Code
9339 \begin_layout Plain Layout
9347 \begin_inset Flex Code
9350 \begin_layout Plain Layout
9356 if you just want to add material to the preamble.) Must end with
9357 \begin_inset Quotes eld
9361 \begin_inset Flex Code
9364 \begin_layout Plain Layout
9371 \begin_inset Quotes erd
9377 \begin_layout Description
9378 \begin_inset Flex Code
9381 \begin_layout Plain Layout
9388 \begin_inset Flex Code
9391 \begin_layout Plain Layout
9398 \begin_inset Flex Code
9401 \begin_layout Plain Layout
9410 \begin_inset Flex Code
9413 \begin_layout Plain Layout
9419 ] Whether the class already provides the feature
9420 \begin_inset Flex Code
9423 \begin_layout Plain Layout
9430 A feature is in general the name of a package (
9431 \begin_inset Flex Code
9434 \begin_layout Plain Layout
9441 \begin_inset Flex Code
9444 \begin_layout Plain Layout
9450 , \SpecialChar \ldots{}
9452 \begin_inset Flex Code
9455 \begin_layout Plain Layout
9462 \begin_inset Flex Code
9465 \begin_layout Plain Layout
9471 ,\SpecialChar \ldots{}
9472 ); the complete list of supported features is unfortunately not documented
9473 outside the LyX source code—but see
9474 \begin_inset Flex Code
9477 \begin_layout Plain Layout
9483 if you're interested.
9485 \begin_inset Flex MenuItem
9488 \begin_layout Plain Layout
9489 Help\SpecialChar \menuseparator
9495 also gives an overview of the supported packages.
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 ] Indicates that this layout provides the functionality of the module mentioned,
9519 which should be specified by the filename without the
9520 \begin_inset Flex Code
9523 \begin_layout Plain Layout
9530 This will typically be used if the layout includes the module directly,
9531 rather than using the
9532 \begin_inset Flex Code
9535 \begin_layout Plain Layout
9541 tag to indicate that it ought to be used.
9542 It could also be used in a module that provided an alternate implementation
9543 of the same functionality.
9546 \begin_layout Description
9547 \begin_inset Flex Code
9550 \begin_layout Plain Layout
9557 \begin_inset Flex Code
9560 \begin_layout Plain Layout
9566 ] Whether the class requires the feature
9567 \begin_inset Flex Code
9570 \begin_layout Plain Layout
9577 Multiple features must be separated by commas.
9578 Note that you can only request supported features.
9580 \begin_inset Flex Code
9583 \begin_layout Plain Layout
9589 for a list of these.)
9592 \begin_layout Description
9593 \begin_inset Flex Code
9596 \begin_layout Plain Layout
9602 A string that indicates the width of the right margin on the screen, for
9604 \begin_inset Quotes eld
9608 \begin_inset Quotes erd
9614 \begin_layout Description
9615 \begin_inset Flex Code
9618 \begin_layout Plain Layout
9624 Sets which divisions get numbered.
9626 \begin_inset Flex Code
9629 \begin_layout Plain Layout
9638 \begin_layout Description
9639 \begin_inset Flex Code
9642 \begin_layout Plain Layout
9649 \begin_inset Flex Code
9652 \begin_layout Plain Layout
9661 \begin_inset Flex Code
9664 \begin_layout Plain Layout
9670 ] Whether the class-default should be printing on one or both sides of the
9672 Can be changed in the
9673 \begin_inset Flex MenuItem
9676 \begin_layout Plain Layout
9677 Document\SpecialChar \menuseparator
9686 \begin_layout Description
9687 \begin_inset Flex Code
9690 \begin_layout Plain Layout
9696 This sequence defines a paragraph style.
9697 If the style does not yet exist, it is created; if it does exist, its parameter
9700 \begin_inset Quotes eld
9704 \begin_inset Flex Code
9707 \begin_layout Plain Layout
9714 \begin_inset Quotes erd
9718 \begin_inset Newline newline
9722 \begin_inset space ~
9726 \begin_inset CommandInset ref
9728 reference "sub:Paragraph-Styles"
9732 for details on paragraph styles.
9735 \begin_layout Description
9736 \begin_inset Flex Code
9739 \begin_layout Plain Layout
9746 \begin_inset Flex Code
9749 \begin_layout Plain Layout
9755 ] The name of the command or environment to be used with
9756 \begin_inset Flex Code
9759 \begin_layout Plain Layout
9768 \begin_layout Description
9769 \begin_inset Flex Code
9772 \begin_layout Plain Layout
9779 \begin_inset Flex Code
9782 \begin_layout Plain Layout
9791 \begin_inset Flex Code
9794 \begin_layout Plain Layout
9800 ] Indicates what kind of markup is used to define the title of a document.
9802 \begin_inset Flex Code
9805 \begin_layout Plain Layout
9811 means that the macro with name
9812 \begin_inset Flex Code
9815 \begin_layout Plain Layout
9821 will be inserted after the last layout which has
9822 \begin_inset Quotes eld
9826 \begin_inset Flex Code
9829 \begin_layout Plain Layout
9836 \begin_inset Quotes erd
9841 \begin_inset Flex Code
9844 \begin_layout Plain Layout
9850 corresponds to the case where the block of paragraphs which have
9851 \begin_inset Quotes eld
9855 \begin_inset Flex Code
9858 \begin_layout Plain Layout
9865 \begin_inset Quotes erd
9868 should be enclosed into the
9869 \begin_inset Flex Code
9872 \begin_layout Plain Layout
9881 \begin_layout Description
9882 \begin_inset Flex Code
9885 \begin_layout Plain Layout
9891 Sets which divisions are included in the table of contents.
9893 \begin_inset Flex Code
9896 \begin_layout Plain Layout
9905 \begin_layout Subsection
9906 \begin_inset Flex Code
9909 \begin_layout Plain Layout
9916 \begin_inset CommandInset label
9918 name "sub:ClassOptions"
9925 \begin_layout Standard
9927 \begin_inset Flex Code
9930 \begin_layout Plain Layout
9936 section can contain the following entries:
9939 \begin_layout Description
9940 \begin_inset Flex Code
9943 \begin_layout Plain Layout
9950 \begin_inset Flex Code
9953 \begin_layout Plain Layout
9959 ] The list of available font sizes for the document's main font, separated
9961 \begin_inset Quotes eld
9965 \begin_inset Flex Code
9968 \begin_layout Plain Layout
9975 \begin_inset Quotes erd
9981 \begin_layout Description
9982 \begin_inset Flex Code
9985 \begin_layout Plain Layout
9991 Used to set the DTD line with XML-based output classes.
9993 \begin_inset space \thinspace{}
9997 \begin_inset Quotes eld
10000 -//OASIS//DTD DocBook V4.2//EN
10001 \begin_inset Quotes erd
10007 \begin_layout Description
10008 \begin_inset Flex Code
10011 \begin_layout Plain Layout
10018 \begin_inset Flex Code
10021 \begin_layout Plain Layout
10022 string="empty|plain|headings|fancy"
10027 ] The list of available page styles, separated by
10028 \begin_inset Quotes eld
10032 \begin_inset Flex Code
10035 \begin_layout Plain Layout
10042 \begin_inset Quotes erd
10048 \begin_layout Description
10049 \begin_inset Flex Code
10052 \begin_layout Plain Layout
10059 \begin_inset Flex Code
10062 \begin_layout Plain Layout
10068 ] Some document class options, separated by a comma, that will be added
10069 to the optional part of the
10070 \begin_inset Flex Code
10073 \begin_layout Plain Layout
10084 \begin_layout Standard
10086 \begin_inset Flex Code
10089 \begin_layout Plain Layout
10095 section must end with
10096 \begin_inset Quotes eld
10100 \begin_inset Flex Code
10103 \begin_layout Plain Layout
10110 \begin_inset Quotes erd
10116 \begin_layout Subsection
10118 \begin_inset CommandInset label
10120 name "sub:Paragraph-Styles"
10127 \begin_layout Standard
10128 A paragraph style description looks like this:
10132 \begin_layout Plain Layout
10133 Note that this will either define a new style or modify an existing one.
10141 \begin_layout LyX-Code
10148 \begin_layout LyX-Code
10152 \begin_layout LyX-Code
10156 \begin_layout Standard
10157 where the following commands are allowed:
10160 \begin_layout Description
10161 \begin_inset Flex Code
10164 \begin_layout Plain Layout
10171 \begin_inset Flex Code
10174 \begin_layout Plain Layout
10179 , left, right, center
10184 ] Paragraph alignment.
10187 \begin_layout Description
10188 \begin_inset Flex Code
10191 \begin_layout Plain Layout
10198 \begin_inset Flex Code
10201 \begin_layout Plain Layout
10206 , left, right, center
10211 ] A comma separated list of permitted alignments.
10212 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
10214 For example a right-aligned or centered enumeration isn't possible.)
10215 \change_inserted -712698321 1353679769
10219 \begin_layout Description
10221 \change_inserted -712698321 1353680268
10222 \begin_inset Flex Code
10225 \begin_layout Plain Layout
10227 \change_inserted -712698321 1353679781
10234 \begin_inset Flex Code
10237 \begin_layout Plain Layout
10239 \change_inserted -712698321 1353679772
10245 ] Defines argument number <int> of a command\SpecialChar \slash{}
10246 environment associated with
10248 This is useful for things like section headings, and only makes sense with
10250 Every (optional or required) argument of a command or environment -- except
10251 for the required argument that is associated with the content of the paragraph
10252 itself -- has a separate definition, where the number specifies the order
10254 The definition must end with
10255 \begin_inset Flex Code
10258 \begin_layout Plain Layout
10260 \change_inserted -712698321 1353680069
10267 So a command with two optional arguments has:
10271 \begin_layout Quote
10273 \change_inserted -712698321 1353680127
10279 \begin_layout Quote
10281 \change_inserted -712698321 1353680195
10287 \begin_layout Quote
10289 \change_inserted -712698321 1353680135
10295 \begin_layout Quote
10297 \change_inserted -712698321 1353680140
10303 \begin_layout Quote
10305 \change_inserted -712698321 1353680197
10311 \begin_layout Quote
10313 \change_inserted -712698321 1353680147
10319 \begin_layout Standard
10321 \change_inserted -712698321 1353680528
10323 \begin_inset Flex Code
10326 \begin_layout Plain Layout
10328 \change_inserted -712698321 1353680412
10334 definition, the following specifications are possible:
10337 \begin_layout Itemize
10339 \change_inserted -712698321 1353680612
10340 \begin_inset Flex Code
10343 \begin_layout Plain Layout
10345 \change_inserted -712698321 1353680543
10354 \begin_inset Flex Code
10357 \begin_layout Plain Layout
10359 \change_inserted -712698321 1353680567
10365 The string that will appear both in the menu (to insert this argument)
10366 and on the argument inset button
10369 \begin_layout Itemize
10371 \change_inserted -712698321 1353680665
10372 \begin_inset Flex Code
10375 \begin_layout Plain Layout
10377 \change_inserted -712698321 1353680616
10384 \begin_inset Flex Code
10387 \begin_layout Plain Layout
10389 \change_inserted -712698321 1353680623
10395 A longer explanatory text that appears in the tooltip when hovering over
10396 the argument inset.
10399 \begin_layout Itemize
10401 \change_inserted -712698321 1353680719
10402 \begin_inset Flex Code
10405 \begin_layout Plain Layout
10407 \change_inserted -712698321 1353680677
10414 \begin_inset Flex Code
10417 \begin_layout Plain Layout
10419 \change_inserted -712698321 1353680681
10425 An accelerator for quick access in the menu.
10428 \begin_layout Itemize
10430 \change_inserted -712698321 1353680874
10431 \begin_inset Flex Code
10434 \begin_layout Plain Layout
10436 \change_inserted -712698321 1353680732
10443 \begin_inset Flex Code
10446 \begin_layout Plain Layout
10448 \change_inserted -712698321 1353680738
10454 Declare if this is a mandatory or an optional argument.
10455 Mandatory arguments will be output empty if not given, while optional arguments
10456 will not be output at all.
10457 By default, mandatory arguments are delimited by
10458 \begin_inset Flex Code
10461 \begin_layout Plain Layout
10463 \change_inserted -712698321 1353680808
10471 , while optional arguments are delimited by
10472 \begin_inset Flex Code
10475 \begin_layout Plain Layout
10477 \change_inserted -712698321 1353680833
10486 \begin_layout Itemize
10488 \change_inserted -712698321 1353681232
10489 \begin_inset Flex Code
10492 \begin_layout Plain Layout
10494 \change_inserted -712698321 1353680879
10501 \begin_inset Flex Code
10504 \begin_layout Plain Layout
10506 \change_inserted -712698321 1353680874
10512 defines another argument (by its number) which this argument requires to
10513 be output if it is itself output.
10515 \begin_inset space \thinspace{}
10518 g., in LaTeX commands, optional arguments often require previous optional
10519 arguments to be output (at least empty), as in
10520 \begin_inset Flex Code
10523 \begin_layout Plain Layout
10525 \change_inserted -712698321 1353680979
10528 command[][arg}{text}
10536 This can be achieved by the statement
10537 \begin_inset Flex Code
10540 \begin_layout Plain Layout
10542 \change_inserted -712698321 1353681031
10551 \begin_inset Flex Code
10554 \begin_layout Plain Layout
10556 \change_inserted -712698321 1353681045
10567 \begin_layout Itemize
10569 \change_inserted -712698321 1353681145
10570 \begin_inset Flex Code
10573 \begin_layout Plain Layout
10575 \change_inserted -712698321 1353681072
10584 \begin_inset Flex Code
10587 \begin_layout Plain Layout
10589 \change_inserted -712698321 1353681067
10595 defines a custom left delimiter (instead of
10596 \begin_inset Flex Code
10599 \begin_layout Plain Layout
10601 \change_inserted -712698321 1353681127
10610 \begin_inset Flex Code
10613 \begin_layout Plain Layout
10615 \change_inserted -712698321 1353681133
10626 \begin_layout Itemize
10628 \change_inserted -712698321 1353681155
10629 \begin_inset Flex Code
10632 \begin_layout Plain Layout
10634 \change_inserted -712698321 1353681149
10641 \begin_inset Flex Code
10644 \begin_layout Plain Layout
10646 \change_inserted -712698321 1353681146
10652 defines a custom right delimiter (instead of
10653 \begin_inset Flex Code
10656 \begin_layout Plain Layout
10658 \change_inserted -712698321 1353681158
10665 \begin_inset Flex Code
10668 \begin_layout Plain Layout
10670 \change_inserted -712698321 1353681161
10682 \begin_layout Description
10683 \begin_inset Flex Code
10686 \begin_layout Plain Layout
10692 Note that this will completely override any prior
10693 \begin_inset Flex Code
10696 \begin_layout Plain Layout
10702 declaration for this style.
10704 \begin_inset Quotes eld
10708 \begin_inset Flex Code
10711 \begin_layout Plain Layout
10718 \begin_inset Quotes erd
10723 \begin_inset CommandInset ref
10725 reference "sub:I18n"
10729 for details on its use.
10732 \begin_layout Description
10733 \begin_inset Flex Code
10736 \begin_layout Plain Layout
10743 \begin_inset Flex Code
10746 \begin_layout Plain Layout
10756 \begin_layout Plain Layout
10757 Note that a `float' here is a real number, such as: 1.5.
10762 The vertical space with which the last of a chain of paragraphs with this
10763 style is separated from the following paragraph.
10764 If the next paragraph has another style, the separations are not simply
10765 added, but the maximum is taken.
10768 \begin_layout Description
10769 \begin_inset Flex Code
10772 \begin_layout Plain Layout
10779 \begin_inset Flex Code
10782 \begin_layout Plain Layout
10788 The category for this style.
10789 This is used to group related styles in the style combobox on the toolbar.
10790 Any string can be used, but you may want to use existing categories with
10795 \begin_layout Description
10796 \begin_inset Flex Code
10799 \begin_layout Plain Layout
10805 Depth of XML command.
10806 Used only with XML-type formats.
10809 \begin_layout Description
10810 \begin_inset Flex Code
10813 \begin_layout Plain Layout
10820 \begin_inset Flex Code
10823 \begin_layout Plain Layout
10829 Copies all the features of an existing style into the current one.
10833 \begin_layout Description
10834 \begin_inset Flex Code
10837 \begin_layout Plain Layout
10843 The name of a style whose preamble should be output
10848 This allows to ensure some ordering of the preamble snippets when macros
10849 definitions depend on one another.
10853 \begin_layout Plain Layout
10854 Note that, besides that functionality, there is no way to ensure any ordering
10856 The ordering that you see in a given version of LyX may change without
10857 warning in later versions.
10865 \begin_layout Description
10866 \begin_inset Flex Code
10869 \begin_layout Plain Layout
10876 \begin_inset Flex Code
10879 \begin_layout Plain Layout
10884 , Box, Filled_Box, Static
10889 ] The type of label that stands at the end of the paragraph (or sequence
10891 \begin_inset Flex Code
10894 \begin_layout Plain Layout
10901 \begin_inset Flex Code
10904 \begin_layout Plain Layout
10911 \begin_inset Flex Code
10914 \begin_layout Plain Layout
10921 \begin_inset Flex Code
10924 \begin_layout Plain Layout
10932 \begin_inset Flex Code
10935 \begin_layout Plain Layout
10942 \begin_inset Quotes eld
10946 \begin_inset Quotes erd
10950 \begin_inset Flex Code
10953 \begin_layout Plain Layout
10960 \begin_inset Flex Code
10963 \begin_layout Plain Layout
10964 \begin_inset space ~
10972 ) is a white (resp.
10973 \begin_inset space ~
10976 black) square suitable for end of proof markers,
10977 \begin_inset Flex Code
10980 \begin_layout Plain Layout
10986 is an explicit text string.
10989 \begin_layout Description
10990 \begin_inset Flex Code
10993 \begin_layout Plain Layout
11000 \begin_inset Flex Code
11003 \begin_layout Plain Layout
11009 ] The string used for a label with a
11010 \begin_inset Flex Code
11013 \begin_layout Plain Layout
11020 \begin_inset Flex Code
11023 \begin_layout Plain Layout
11033 \begin_layout Description
11034 \begin_inset Flex Code
11037 \begin_layout Plain Layout
11043 The font used for both the text body
11049 \begin_inset space ~
11053 \begin_inset CommandInset ref
11055 reference "sub:Font-description"
11060 Note that defining this font automatically defines the
11061 \begin_inset Flex Code
11064 \begin_layout Plain Layout
11071 So you should define this one first if you also want to define
11072 \begin_inset Flex Code
11075 \begin_layout Plain Layout
11084 \begin_layout Description
11085 \begin_inset Flex Code
11088 \begin_layout Plain Layout
11095 \begin_inset CommandInset label
11097 name "des:FreeSpacing"
11102 \begin_inset Flex Code
11105 \begin_layout Plain Layout
11114 \begin_inset Flex Code
11117 \begin_layout Plain Layout
11123 ] Usually LyX doesn't allow you to insert more than one space between words,
11124 since a space is considered as the separation between two words, not a
11125 character or symbol of its own.
11126 This is a very fine thing but sometimes annoying, for example, when typing
11127 program code or plain LaTeX code.
11129 \begin_inset Flex Code
11132 \begin_layout Plain Layout
11139 Note that LyX will create protected blanks for the additional blanks when
11140 in another mode than LaTeX-mode.
11143 \begin_layout Description
11144 \begin_inset Flex Code
11147 \begin_layout Plain Layout
11153 These tags are used with XHTML output.
11155 \begin_inset CommandInset ref
11157 reference "sub:Paragraph-Style-XHTML"
11164 \begin_layout Description
11165 \begin_inset Flex Code
11168 \begin_layout Plain Layout
11174 [[FIXME]] (Used only with XML-type formats.)
11177 \begin_layout Description
11178 \begin_inset Flex Code
11181 \begin_layout Plain Layout
11188 \begin_inset Flex Code
11191 \begin_layout Plain Layout
11197 If 1, marks the style as to be included in the document preamble rather
11198 than in the document body.
11199 This is useful for document classes that want such information as the title
11200 and author to appear in the preamble.
11201 Note that this works only for styles for which the
11202 \begin_inset Flex Code
11205 \begin_layout Plain Layout
11212 \begin_inset Flex Code
11215 \begin_layout Plain Layout
11222 \begin_inset Flex Code
11225 \begin_layout Plain Layout
11234 \begin_layout Description
11235 \begin_inset Flex Code
11238 \begin_layout Plain Layout
11245 \begin_inset Flex Code
11248 \begin_layout Plain Layout
11254 If 1, marks the style as being part of a title block (see also the
11255 \begin_inset Flex Code
11258 \begin_layout Plain Layout
11265 \begin_inset Flex Code
11268 \begin_layout Plain Layout
11277 \begin_layout Description
11278 \begin_inset Flex Code
11281 \begin_layout Plain Layout
11288 \begin_inset Flex Code
11291 \begin_layout Plain Layout
11297 ] This provides extra space between paragraphs that have the same style.
11298 If you put other styles into an environment, each is separated with the
11300 \begin_inset Flex Code
11303 \begin_layout Plain Layout
11310 But the whole items of the environment are additionally separated with
11312 \begin_inset Flex Code
11315 \begin_layout Plain Layout
11322 Note that this is a
11327 \begin_layout Description
11328 \begin_inset Flex Code
11331 \begin_layout Plain Layout
11337 [[FIXME]] (Used only with XML-type formats.)
11340 \begin_layout Description
11341 \begin_inset Flex Code
11344 \begin_layout Plain Layout
11351 \begin_inset Flex Code
11354 \begin_layout Plain Layout
11363 \begin_inset Flex Code
11366 \begin_layout Plain Layout
11372 ] Usually LyX does not allow you to leave a paragraph empty, since it would
11373 lead to empty LaTeX output.
11374 There are some cases where this could be desirable however: in a letter
11375 template, the required fields can be provided as empty fields, so that
11376 people do not forget them; in some special classes, a style can be used
11377 as some kind of break, which does not contain actual text.
11380 \begin_layout Description
11381 \begin_inset Flex Code
11384 \begin_layout Plain Layout
11390 [float=0] The vertical space between the label and the text body.
11391 Only used for labels that are above the text body (
11392 \begin_inset Flex Code
11395 \begin_layout Plain Layout
11402 \begin_inset Flex Code
11405 \begin_layout Plain Layout
11406 Centered_Top_Environment
11414 \begin_layout Description
11415 \begin_inset Flex Code
11418 \begin_layout Plain Layout
11425 \begin_inset Flex Code
11428 \begin_layout Plain Layout
11435 \begin_inset Newline newline
11438 The name of the counter for automatic numbering.
11440 \begin_inset Newline newline
11448 \begin_inset Flex Code
11451 \begin_layout Plain Layout
11458 \begin_inset Flex Code
11461 \begin_layout Plain Layout
11468 In that case, the counter will be stepped each time the style appears.
11470 \begin_inset Newline newline
11478 \begin_inset Flex Code
11481 \begin_layout Plain Layout
11488 \begin_inset Flex Code
11491 \begin_layout Plain Layout
11497 , though this case is a bit complicated.
11498 Suppose you declare
11499 \begin_inset Quotes eld
11503 \begin_inset Flex Code
11506 \begin_layout Plain Layout
11507 LabelCounter myenum
11513 \begin_inset Quotes erd
11517 Then the actual counters used are
11518 \begin_inset Flex Code
11521 \begin_layout Plain Layout
11528 \begin_inset Flex Code
11531 \begin_layout Plain Layout
11538 \begin_inset Flex Code
11541 \begin_layout Plain Layout
11548 \begin_inset Flex Code
11551 \begin_layout Plain Layout
11557 , much as in LaTeX.
11558 These counters must all be declared separately.
11559 \begin_inset Newline newline
11563 \begin_inset CommandInset ref
11565 reference "sub:Counters"
11569 for details on counters.
11572 \begin_layout Description
11573 \begin_inset Flex Code
11576 \begin_layout Plain Layout
11582 The font used for the label.
11584 \begin_inset space ~
11588 \begin_inset CommandInset ref
11590 reference "sub:Font-description"
11597 \begin_layout Description
11598 \begin_inset Flex Code
11601 \begin_layout Plain Layout
11607 Text that indicates how far a label should be indented.
11610 \begin_layout Description
11611 \begin_inset Flex Code
11614 \begin_layout Plain Layout
11621 \begin_inset Flex Code
11624 \begin_layout Plain Layout
11630 ] The horizontal space between the label and the text body.
11631 Only used for labels that are not above the text body.
11634 \begin_layout Description
11635 \begin_inset Flex Code
11638 \begin_layout Plain Layout
11645 \begin_inset Flex Code
11648 \begin_layout Plain Layout
11654 ] The string used for a label with a
11655 \begin_inset Flex Code
11658 \begin_layout Plain Layout
11666 \begin_inset Flex Code
11669 \begin_layout Plain Layout
11675 is set, this string can be contain the special formatting commands described
11677 \begin_inset CommandInset ref
11679 reference "sub:Counters"
11687 \begin_layout Plain Layout
11688 For the sake of backwards compatibility, the string
11689 \begin_inset Flex Code
11692 \begin_layout Plain Layout
11702 will be replaced by the expanded
11703 \begin_inset Flex Code
11706 \begin_layout Plain Layout
11713 \begin_inset Flex Code
11716 \begin_layout Plain Layout
11725 This feature is now obsolete and should be replaced by the mechanisms of
11727 \begin_inset CommandInset ref
11729 reference "sub:Counters"
11741 \begin_layout Description
11742 \begin_inset Flex Code
11745 \begin_layout Plain Layout
11746 LabelStringAppendix
11752 \begin_inset Flex Code
11755 \begin_layout Plain Layout
11761 ] This is used inside the appendix instead of
11762 \begin_inset Flex Code
11765 \begin_layout Plain Layout
11773 \begin_inset Flex Code
11776 \begin_layout Plain Layout
11783 \begin_inset Flex Code
11786 \begin_layout Plain Layout
11787 LabelStringAppendix
11795 \begin_layout Description
11796 \begin_inset Flex Code
11799 \begin_layout Plain Layout
11805 [FIXME] (Used only with XML-type formats.)
11808 \begin_layout Description
11809 \begin_inset Flex Code
11812 \begin_layout Plain Layout
11819 \begin_inset Flex Code
11822 \begin_layout Plain Layout
11827 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
11828 Enumerate, Itemize, Bibliography
11837 \begin_layout Itemize
11838 \begin_inset Flex Code
11841 \begin_layout Plain Layout
11847 means the label is the very first word (up to the first real blank).
11848 Use protected spaces (like
11849 \begin_inset space ~
11852 that one) if you want more than one word as the label.
11856 \begin_layout Itemize
11857 \begin_inset Flex Code
11860 \begin_layout Plain Layout
11866 means the label is simply whatever
11867 \begin_inset Flex Code
11870 \begin_layout Plain Layout
11877 Note that this really is `static'.
11880 \begin_layout Itemize
11881 \begin_inset Flex Code
11884 \begin_layout Plain Layout
11891 \begin_inset Flex Code
11894 \begin_layout Plain Layout
11895 Centered_Top_Environment
11900 are special cases of
11901 \begin_inset Flex Code
11904 \begin_layout Plain Layout
11911 The label will be printed above the paragraph, but only at the top of an
11912 environment or the top of a chain of paragraphs with this style.
11913 This might be used with the
11914 \begin_inset Flex MenuItem
11917 \begin_layout Plain Layout
11923 style, for example.
11926 \begin_layout Itemize
11927 \begin_inset Flex Code
11930 \begin_layout Plain Layout
11936 is a special case for the caption-labels
11937 \begin_inset Quotes eld
11941 \begin_inset Quotes erd
11945 \begin_inset Quotes eld
11949 \begin_inset Quotes erd
11954 \begin_inset Flex Code
11957 \begin_layout Plain Layout
11963 means the (hardcoded) label string depends on the kind of float: It is
11964 hardcoded to be `FloatType N', where N is the value of the counter associated
11968 \begin_layout Itemize
11970 \begin_inset Flex Code
11973 \begin_layout Plain Layout
11979 label type defines automatically numbered labels.
11981 \begin_inset Flex Code
11984 \begin_layout Plain Layout
11990 will be expanded to resolve any counter references it contains: For example,
11992 \begin_inset Quotes eld
11996 \begin_inset Flex Code
11999 \begin_layout Plain Layout
12010 \begin_inset Quotes erd
12015 \begin_inset CommandInset ref
12017 reference "sub:Counters"
12021 for more information on counters.
12024 \begin_layout Itemize
12025 \begin_inset Flex Code
12028 \begin_layout Plain Layout
12034 produces the usual sort of enumeration labels.
12035 At present, it is hardcoded to use Arabic numerals, lowercase letters,
12036 small Roman numerals, and uppercase letters for the four possible depths.
12039 \begin_layout Itemize
12040 \begin_inset Flex Code
12043 \begin_layout Plain Layout
12049 produces various bullets at the different levels.
12050 It is also hardcoded.
12053 \begin_layout Itemize
12054 \begin_inset Flex Code
12057 \begin_layout Plain Layout
12063 is used internally by LyX and should be used only with
12064 \begin_inset Flex Code
12067 \begin_layout Plain Layout
12068 LatexType BibEnvironment
12077 \begin_layout Description
12078 \begin_inset Flex Code
12081 \begin_layout Plain Layout
12087 Note that this will completely override any prior
12088 \begin_inset Flex Code
12091 \begin_layout Plain Layout
12097 declaration for this style.
12099 \begin_inset Quotes eld
12103 \begin_inset Flex Code
12106 \begin_layout Plain Layout
12113 \begin_inset Quotes erd
12118 \begin_inset CommandInset ref
12120 reference "sub:I18n"
12124 for details on its use.
12127 \begin_layout Description
12128 \begin_inset Flex Code
12131 \begin_layout Plain Layout
12137 The name of the corresponding LaTeX stuff.
12138 Either the environment or command name.
12141 \begin_layout Description
12142 \begin_inset Flex Code
12145 \begin_layout Plain Layout
12151 An optional parameter for the corresponding
12152 \begin_inset Flex Code
12155 \begin_layout Plain Layout
12162 This parameter cannot be changed from within LyX.
12165 \begin_layout Description
12166 \begin_inset Flex Code
12169 \begin_layout Plain Layout
12176 \begin_inset Flex Code
12179 \begin_layout Plain Layout
12184 , Command, Environment, Item_Environment,
12190 \begin_inset Flex Code
12193 \begin_layout Plain Layout
12194 List_Environment, Bib_Environment
12199 ] How the style should be translated into LaTeX.
12203 \begin_layout Plain Layout
12204 \begin_inset Flex Code
12207 \begin_layout Plain Layout
12213 is perhaps a bit misleading, since these rules apply to SGML classes, too.
12214 Visit the SGML class files for specific examples.
12223 \begin_layout Itemize
12224 \begin_inset Flex Code
12227 \begin_layout Plain Layout
12233 means nothing special.
12237 \begin_layout Itemize
12238 \begin_inset Flex Code
12241 \begin_layout Plain Layout
12248 \begin_inset Flex Code
12251 \begin_layout Plain Layout
12258 {\SpecialChar \ldots{}
12267 \begin_layout Itemize
12268 \begin_inset Flex Code
12271 \begin_layout Plain Layout
12278 \begin_inset Flex Code
12281 \begin_layout Plain Layout
12288 }\SpecialChar \ldots{}
12304 \begin_layout Itemize
12305 \begin_inset Flex Code
12308 \begin_layout Plain Layout
12315 \begin_inset Flex Code
12318 \begin_layout Plain Layout
12325 \begin_inset Flex Code
12328 \begin_layout Plain Layout
12336 is generated for each paragraph of this environment.
12340 \begin_layout Itemize
12341 \begin_inset Flex Code
12344 \begin_layout Plain Layout
12351 \begin_inset Flex Code
12354 \begin_layout Plain Layout
12361 \begin_inset Flex Code
12364 \begin_layout Plain Layout
12370 is passed as an argument to the environment.
12372 \begin_inset Flex Code
12375 \begin_layout Plain Layout
12381 can be defined in the
12382 \begin_inset Flex MenuItem
12385 \begin_layout Plain Layout
12386 Edit\SpecialChar \menuseparator
12388 \begin_inset space ~
12400 \begin_layout Standard
12401 Putting the last few things together, the LaTeX output will be either:
12404 \begin_layout LyX-Code
12407 latexname[latexparam]{\SpecialChar \ldots{}
12411 \begin_layout Standard
12415 \begin_layout LyX-Code
12418 begin{latexname}[latexparam] \SpecialChar \ldots{}
12424 \begin_layout Standard
12425 depending upon the LaTeX type.
12429 \begin_layout Description
12430 \begin_inset Flex Code
12433 \begin_layout Plain Layout
12440 \begin_inset Flex Code
12443 \begin_layout Plain Layout
12449 ] If you put styles into environments, the leftmargins are not simply added,
12450 but added with a factor
12451 \begin_inset Formula $\frac{4}{depth+4}$
12455 Note that this parameter is also used when the margin is defined as
12456 \begin_inset Flex Code
12459 \begin_layout Plain Layout
12466 \begin_inset Flex Code
12469 \begin_layout Plain Layout
12476 Then it is added to the manual or dynamic margin.
12478 \begin_inset Newline newline
12481 The argument is passed as a string.
12483 \begin_inset Quotes eld
12487 \begin_inset Flex Code
12490 \begin_layout Plain Layout
12497 \begin_inset Quotes erd
12500 means that the paragraph is indented with the width of
12501 \begin_inset Quotes eld
12505 \begin_inset Flex Code
12508 \begin_layout Plain Layout
12515 \begin_inset Quotes erd
12518 in the normal font.
12519 You can get a negative width by prefixing the string with
12520 \begin_inset Quotes eld
12524 \begin_inset Flex Code
12527 \begin_layout Plain Layout
12534 \begin_inset Quotes erd
12538 This way was chosen so that the look is the same with each used screen
12543 \begin_layout Description
12544 \begin_inset Flex Code
12547 \begin_layout Plain Layout
12554 \begin_inset Flex Code
12557 \begin_layout Plain Layout
12562 , Manual, Dynamic, First_Dynamic, Right_Address_Box
12568 \begin_inset Newline newline
12571 The kind of margin that the style has on the left side.
12573 \begin_inset Flex Code
12576 \begin_layout Plain Layout
12582 just means a fixed margin.
12584 \begin_inset Flex Code
12587 \begin_layout Plain Layout
12593 means that the left margin depends on the string entered in the
12594 \begin_inset Flex MenuItem
12597 \begin_layout Plain Layout
12598 Edit\SpecialChar \menuseparator
12600 \begin_inset space ~
12609 This is used to typeset nice lists without tabulators.
12611 \begin_inset Flex Code
12614 \begin_layout Plain Layout
12620 means that the margin depends on the size of the label.
12621 This is used for automatic enumerated headlines.
12622 It is obvious that the headline
12623 \begin_inset Quotes eld
12626 5.4.3.2.1 Very long headline
12627 \begin_inset Quotes erd
12630 must have a wider left margin (as wide as
12631 \begin_inset Quotes eld
12635 \begin_inset Quotes erd
12638 plus the space) than
12639 \begin_inset Quotes eld
12642 3.2 Very long headline
12643 \begin_inset Quotes erd
12647 \begin_inset Quotes eld
12651 \begin_inset Quotes erd
12654 are not able to do this.
12656 \begin_inset Flex Code
12659 \begin_layout Plain Layout
12665 is similar, but only the very first row of the paragraph is dynamic, while
12666 the others are static; this is used, for example, for descriptions.
12668 \begin_inset Flex Code
12671 \begin_layout Plain Layout
12677 means the margin is chosen in a way that the longest row of this paragraph
12678 fits to the right margin.
12679 This is used to typeset an address on the right edge of the page.
12682 \begin_layout Description
12683 \begin_inset Flex Code
12686 \begin_layout Plain Layout
12693 \begin_inset Flex Code
12696 \begin_layout Plain Layout
12705 \begin_inset Flex Code
12708 \begin_layout Plain Layout
12714 ] Whether fragile commands in this style should be
12715 \begin_inset Flex Code
12718 \begin_layout Plain Layout
12731 whether this command should itself be protected.)
12734 \begin_layout Description
12735 \begin_inset Flex Code
12738 \begin_layout Plain Layout
12745 \begin_inset Flex Code
12748 \begin_layout Plain Layout
12755 \begin_inset Flex Code
12758 \begin_layout Plain Layout
12766 ] Whether newlines are translated into LaTeX newlines (
12767 \begin_inset Flex Code
12770 \begin_layout Plain Layout
12781 The translation can be switched off to allow more comfortable LaTeX editing
12785 \begin_layout Description
12786 \begin_inset Flex Code
12789 \begin_layout Plain Layout
12796 \begin_inset Flex Code
12799 \begin_layout Plain Layout
12806 \begin_inset Flex Code
12809 \begin_layout Plain Layout
12817 ] If set to true, and if
12818 \begin_inset Flex Code
12821 \begin_layout Plain Layout
12828 \begin_inset Flex Code
12831 \begin_layout Plain Layout
12837 ) paragraphs are being indented, then the indentation of such a paragraph
12838 following one of this type will be suppressed.
12839 (So this will not affect the display of non-default paragraphs.)
12842 \begin_layout Description
12843 \begin_inset Flex Code
12846 \begin_layout Plain Layout
12852 Name of a style that has replaced this style.
12853 This is used to rename a style, while keeping backward compatibility.
12856 \begin_layout Description
12858 \change_deleted -712698321 1353679722
12859 \begin_inset Flex Code
12862 \begin_layout Plain Layout
12869 \begin_inset Flex Code
12872 \begin_layout Plain Layout
12878 ] The number of optional arguments that can be used with this style.
12879 This is useful for things like section headings, and only makes sense with
12881 Note that, on output, the optional arguments will all precede any required
12882 arguments (see below).
12883 So one can have constructs like:
12887 \begin_layout LyX-Code
12889 \change_deleted -712698321 1353679722
12892 mycmd[opt1]{req1}{contents of paragraph}
12895 \begin_layout Standard
12897 \change_deleted -712698321 1353679722
12898 but one cannot have things like:
12901 \begin_layout LyX-Code
12903 \change_deleted -712698321 1353679722
12906 mycmd[opt1]{req1}[opt2]{contents of paragraph}
12909 \begin_layout Standard
12911 \change_deleted -712698321 1353679722
12912 at least, not without ERT (with which you can have anything).
12919 \begin_layout Description
12920 \begin_inset Flex Code
12923 \begin_layout Plain Layout
12930 \begin_inset Flex Code
12933 \begin_layout Plain Layout
12942 \begin_inset Flex Code
12945 \begin_layout Plain Layout
12951 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
12952 output, but only by a line break; together with
12953 \begin_inset Flex Code
12956 \begin_layout Plain Layout
12962 , this allows to emulate a plain text editor (like the ERT inset).
12965 \begin_layout Description
12966 \begin_inset Flex Code
12969 \begin_layout Plain Layout
12976 \begin_inset Flex Code
12979 \begin_layout Plain Layout
12985 ] The indent of the very first line of a paragraph.
12987 \begin_inset Flex Code
12990 \begin_layout Plain Layout
12996 will be fixed for a certain style.
12997 The exception is the default style, since the indentation for these paragraphs
12998 can be prohibited with
12999 \begin_inset Flex Code
13002 \begin_layout Plain Layout
13010 \begin_inset Flex Code
13013 \begin_layout Plain Layout
13019 style paragraphs inside environments use the
13020 \begin_inset Flex Code
13023 \begin_layout Plain Layout
13029 of the environment, not their native one.
13031 \begin_inset Flex Code
13034 \begin_layout Plain Layout
13040 paragraphs inside an enumeration are not indented.
13043 \begin_layout Description
13044 \begin_inset Flex Code
13047 \begin_layout Plain Layout
13054 \begin_inset Flex Code
13057 \begin_layout Plain Layout
13063 ] The vertical space between two paragraphs of this style.
13066 \begin_layout Description
13067 \begin_inset Flex Code
13070 \begin_layout Plain Layout
13077 \begin_inset Flex Code
13080 \begin_layout Plain Layout
13086 ] LyX allows the user to choose either
13087 \begin_inset Quotes eld
13091 \begin_inset Quotes erd
13095 \begin_inset Quotes eld
13099 \begin_inset Quotes erd
13102 to typeset a document.
13104 \begin_inset Quotes eld
13108 \begin_inset Quotes erd
13111 is chosen, this value is completely ignored.
13113 \begin_inset Quotes eld
13117 \begin_inset Quotes erd
13120 is chosen, the parindent of a LaTeXtype
13121 \begin_inset Quotes eld
13125 \begin_inset Quotes erd
13128 style is ignored and all paragraphs are separated by this parskip argument.
13129 The vertical space is calculated with
13130 \begin_inset Flex Code
13133 \begin_layout Plain Layout
13135 \begin_inset space ~
13144 \begin_inset Flex Code
13147 \begin_layout Plain Layout
13153 is the height of a row with the normal font.
13154 This way, the look stays the same with different screen fonts.
13157 \begin_layout Description
13158 \begin_inset Flex Code
13161 \begin_layout Plain Layout
13168 \begin_inset Flex Code
13171 \begin_layout Plain Layout
13180 \begin_inset Flex Code
13183 \begin_layout Plain Layout
13189 ] Whether the contents of this paragraph should be output in raw form, meaning
13190 without special translations that LaTeX would require.
13193 \begin_layout Description
13194 \begin_inset Flex Code
13197 \begin_layout Plain Layout
13203 Information to be included in the LaTeX preamble when this style is used.
13204 Used to define macros, load packages, etc., required by this particular
13207 \begin_inset Quotes eld
13211 \begin_inset Flex Code
13214 \begin_layout Plain Layout
13221 \begin_inset Quotes erd
13227 \begin_layout Description
13228 \begin_inset Flex Code
13231 \begin_layout Plain Layout
13238 \begin_inset Flex Code
13241 \begin_layout Plain Layout
13247 ] The prefix to use when creating labels referring to paragraphs of this
13249 This allows the use of formatted references.
13252 \begin_layout Description
13254 \change_deleted -712698321 1353681258
13255 \begin_inset Flex Code
13258 \begin_layout Plain Layout
13265 \begin_inset Flex Code
13268 \begin_layout Plain Layout
13274 ] The number of required arguments that the LaTeX command or environment
13275 corresponding to this style expects.
13276 In the case of a command, these are required arguments
13280 that associated with the content of the paragraph itself.
13281 These do not actually have to be provided: LyX will output empty arguments
13283 Note that optional arguments will be output before required arguments.
13284 See the discussion of the
13285 \begin_inset Flex Code
13288 \begin_layout Plain Layout
13294 tag above for more information.
13299 \begin_layout Description
13300 \begin_inset Flex Code
13303 \begin_layout Plain Layout
13310 \begin_inset Flex Code
13313 \begin_layout Plain Layout
13319 ] Whether the style requires the feature
13320 \begin_inset Flex Code
13323 \begin_layout Plain Layout
13330 See the description of
13331 \begin_inset Flex Code
13334 \begin_layout Plain Layout
13341 \begin_inset CommandInset ref
13342 LatexCommand pageref
13343 reference "des:FreeSpacing"
13347 ) for information on `features'.
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 Flex Code
13375 \begin_layout Plain Layout
13384 \begin_layout Description
13385 \begin_inset Flex Code
13388 \begin_layout Plain Layout
13395 \begin_inset Flex Code
13398 \begin_layout Plain Layout
13403 , onehalf, double, other
13412 ] This defines what the default spacing should be in the style.
13414 \begin_inset Flex Code
13417 \begin_layout Plain Layout
13424 \begin_inset Flex Code
13427 \begin_layout Plain Layout
13434 \begin_inset Flex Code
13437 \begin_layout Plain Layout
13443 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
13444 If you specify the argument
13445 \begin_inset Flex Code
13448 \begin_layout Plain Layout
13454 , then you should also provide a numerical argument which will be the actual
13456 Note that, contrary to other parameters,
13457 \begin_inset Flex Code
13460 \begin_layout Plain Layout
13466 implies the generation of specific LaTeX code, using the package
13469 \begin_inset Flex Code
13472 \begin_layout Plain Layout
13481 \begin_layout Description
13482 \begin_inset Flex Code
13485 \begin_layout Plain Layout
13492 \begin_inset Flex Code
13495 \begin_layout Plain Layout
13502 \begin_inset Flex Code
13505 \begin_layout Plain Layout
13513 ] Spellcheck paragraphs of this style.
13517 \begin_layout Description
13518 \begin_inset Flex Code
13521 \begin_layout Plain Layout
13527 The font used for the text body .
13529 \begin_inset CommandInset ref
13531 reference "sub:Font-description"
13538 \begin_layout Description
13539 \begin_inset Flex Code
13542 \begin_layout Plain Layout
13551 \begin_inset Flex Code
13554 \begin_layout Plain Layout
13564 The level of the style in the table of contents.
13565 This is used for automatic numbering of section headings.
13568 \begin_layout Description
13569 \begin_inset Flex Code
13572 \begin_layout Plain Layout
13579 \begin_inset Flex Code
13582 \begin_layout Plain Layout
13588 ] The vertical space with which the very first of a chain of paragraphs
13589 with this style is separated from the previous paragraph.
13590 If the previous paragraph has another style, the separations are not simply
13591 added, but the maximum is taken.
13594 \begin_layout Subsection
13595 \begin_inset CommandInset label
13601 Internationalization of Paragraph Styles
13604 \begin_layout Standard
13605 LyX has long supported internationalization of layout information, but,
13606 until version 2.0, this applied only to the user interface and not to, say,
13608 Thus, French authors were forced to resort to ugly hacks if they wanted
13613 1' instead of `Theorem 1'.
13614 Thanks to Georg Baum, that is no longer the case.
13617 \begin_layout Standard
13619 \begin_inset Flex Code
13622 \begin_layout Plain Layout
13628 defines text that is to appear in the typeset document, it may use
13629 \begin_inset Flex Code
13632 \begin_layout Plain Layout
13639 \begin_inset Flex Code
13642 \begin_layout Plain Layout
13648 to support non-English and even multi-language documents correctly.
13649 The following excerpt (from the
13650 \begin_inset Flex Code
13653 \begin_layout Plain Layout
13659 file) shows how this works:
13662 \begin_layout LyX-Code
13667 \begin_layout LyX-Code
13670 theoremstyle{remark}
13673 \begin_layout LyX-Code
13676 newtheorem{claim}[thm]{
13683 \begin_layout LyX-Code
13687 \begin_layout LyX-Code
13691 \begin_layout LyX-Code
13696 claimname}{_(Claim)}
13699 \begin_layout LyX-Code
13703 \begin_layout LyX-Code
13707 \begin_layout LyX-Code
13716 claimname}{_(Claim)}}
13719 \begin_layout LyX-Code
13724 \begin_layout Standard
13725 In principle, any legal LaTeX may appear in the
13726 \begin_inset Flex Code
13729 \begin_layout Plain Layout
13736 \begin_inset Flex Code
13739 \begin_layout Plain Layout
13745 tags, but in practice they will typically look as they do here.
13746 The key to correct translation of the typeset text is the definition of
13748 \begin_inset Flex Code
13751 \begin_layout Plain Layout
13760 \begin_inset Flex Code
13763 \begin_layout Plain Layout
13775 \begin_layout Standard
13777 \begin_inset Flex Code
13780 \begin_layout Plain Layout
13786 tag provides for internationalization based upon the overall language of
13788 The contents of the tag will be included in the preamble, just as with
13790 \begin_inset Flex Code
13793 \begin_layout Plain Layout
13800 What makes it special is the use of the
13801 \begin_inset Quotes eld
13805 \begin_inset Quotes erd
13809 \begin_inset Flex Code
13812 \begin_layout Plain Layout
13818 , which will be replaced, when LyX produces LaTeX output, with the translation
13819 of its argument into the document language.
13822 \begin_layout Standard
13824 \begin_inset Flex Code
13827 \begin_layout Plain Layout
13833 tag is more complex, since it is meant to provide support for multi-language
13834 documents and so offers an interface to the
13835 \begin_inset Flex Code
13838 \begin_layout Plain Layout
13845 Its contents will be added to the preamble once for each language that
13846 appears in the document.
13847 In this case, the argument to
13848 \begin_inset Flex Code
13851 \begin_layout Plain Layout
13857 will be replaced with its translation into the language in question; the
13859 \begin_inset Flex Code
13862 \begin_layout Plain Layout
13868 is replaced by the language name (as used by the babel package).
13871 \begin_layout Standard
13872 A German document that also included a French section would thus have the
13873 following in the preamble:
13876 \begin_layout LyX-Code
13885 claimname}{Affirmation}}
13893 claimname}{Behauptung}}
13897 claimname}{Behauptung}
13900 \begin_layout Standard
13902 \begin_inset Flex Code
13905 \begin_layout Plain Layout
13911 will then conspire to produce the correct text in the output.
13914 \begin_layout Standard
13915 One important point to note here is that the translations are provided by
13916 LyX itself, through the
13917 \change_inserted -195340706 1334775793
13919 \begin_inset Flex Code
13922 \begin_layout Plain Layout
13924 \change_inserted -195340706 1334775793
13931 \change_deleted -195340706 1334775793
13932 same mechanism it uses for internationalization of the user interface
13935 This means, in effect, that
13936 \begin_inset Flex Code
13939 \begin_layout Plain Layout
13946 \begin_inset Flex Code
13949 \begin_layout Plain Layout
13955 are really only of use in layout files that are provided with LyX, since
13956 text entered in user-created layout files will not be seen by LyX's internation
13958 \change_inserted -195340706 1334775793
13960 \begin_inset Flex Code
13963 \begin_layout Plain Layout
13965 \change_inserted -195340706 1334775793
13971 file is modified accordingly
13974 That said, however, any layout created with the intention that it will
13975 be included with LyX should use these tags where appropriate.
13977 \change_inserted -195340706 1334775793
13978 Please note that the paragraph style translations provided by LyX will
13979 never change with a minor update (e.g.
13980 from version 2.1.x to 2.1.y).
13981 It is however quite likely that a major update (e.g.
13982 from 2.0.x to 2.1.y) will introduce new translations or corrections.
13987 \begin_layout Subsection
13989 \begin_inset CommandInset label
13998 \begin_layout Standard
13999 Since version 1.3.0 of LyX, it is has been both possible and necessary to
14000 define the floats (
14001 \begin_inset Flex MenuItem
14004 \begin_layout Plain Layout
14011 \begin_inset Flex MenuItem
14014 \begin_layout Plain Layout
14020 , \SpecialChar \ldots{}
14021 ) in the text class itself.
14022 Standard floats are included in the file
14023 \begin_inset Flex Code
14026 \begin_layout Plain Layout
14032 , so you may have to do no more than add
14035 \begin_layout LyX-Code
14036 Input stdfloats.inc
14039 \begin_layout Standard
14040 to your layout file.
14041 If you want to implement a text class that proposes some other float types
14042 (like the AGU class bundled with LyX), the information below will hopefully
14046 \begin_layout Description
14047 \begin_inset Flex Code
14050 \begin_layout Plain Layout
14057 \begin_inset Flex Code
14060 \begin_layout Plain Layout
14067 \begin_inset Quotes erd
14071 \begin_inset Quotes erd
14074 ] The file name extension of an auxiliary file for the list of figures (or
14076 LaTeX writes the captions to this file.
14079 \begin_layout Description
14080 \begin_inset Flex Code
14083 \begin_layout Plain Layout
14090 \begin_inset Flex Code
14093 \begin_layout Plain Layout
14100 \begin_inset Quotes erd
14104 \begin_inset Quotes erd
14107 ] The string that will be used in the menus and also for the caption.
14108 This is translated to the current language if babel is used.
14111 \begin_layout Description
14112 \begin_inset Flex Code
14115 \begin_layout Plain Layout
14121 These are used for XHTML output.
14123 \begin_inset CommandInset ref
14125 reference "sec:Tags-for-XHTML"
14132 \begin_layout Description
14133 \begin_inset Flex Code
14136 \begin_layout Plain Layout
14145 \begin_inset Flex Code
14148 \begin_layout Plain Layout
14157 \begin_inset Flex Code
14160 \begin_layout Plain Layout
14166 ] Indicates whether the float is already defined in the document class or
14167 if we instead need to load
14168 \begin_inset Flex Code
14171 \begin_layout Plain Layout
14177 and use what it provides to define it on-the-fly.
14179 \begin_inset Flex Code
14182 \begin_layout Plain Layout
14189 \begin_inset Flex Code
14192 \begin_layout Plain Layout
14199 It should be set to
14200 \begin_inset Flex Code
14203 \begin_layout Plain Layout
14209 if the float is already defined by the LaTeX document class.
14212 \begin_layout Description
14213 \begin_inset Flex Code
14216 \begin_layout Plain Layout
14223 \begin_inset Flex Code
14226 \begin_layout Plain Layout
14233 \begin_inset Quotes erd
14237 \begin_inset Quotes erd
14240 ] The command used to generate a list of floats of this type; the leading
14243 ' should be omitted.
14249 \begin_inset Flex Code
14252 \begin_layout Plain Layout
14258 is false, since there is no standard way to generate this command.
14260 \begin_inset Flex Code
14263 \begin_layout Plain Layout
14269 is true, since in that case there is a standard way to define the command.
14272 \begin_layout Description
14273 \begin_inset Flex Code
14276 \begin_layout Plain Layout
14283 \begin_inset Flex Code
14286 \begin_layout Plain Layout
14293 \begin_inset Quotes erd
14297 \begin_inset Quotes erd
14300 ] A title for a list of floats of this kind (list of figures, tables, or
14302 It is used for the screen label within LyX; it is passed to LaTeX for use
14303 as the title there; and it is used as the title in XHTML output.
14304 It will be translated to the document language.
14307 \begin_layout Description
14308 \begin_inset Flex Code
14311 \begin_layout Plain Layout
14318 \begin_inset Flex Code
14321 \begin_layout Plain Layout
14328 \begin_inset Quotes erd
14332 \begin_inset Quotes erd
14335 ] This (optional) argument determines whether floats of this class will
14336 be numbered within some sectional unit of the document.
14337 For example, if within is equal to
14338 \begin_inset Flex Code
14341 \begin_layout Plain Layout
14347 , the floats will be numbered within chapters.
14351 \begin_layout Description
14352 \begin_inset Flex Code
14355 \begin_layout Plain Layout
14362 \begin_inset Flex Code
14365 \begin_layout Plain Layout
14372 \begin_inset Quotes erd
14376 \begin_inset Quotes erd
14379 ] The default placement for the given class of floats.
14380 The string should be as in standard LaTeX:
14381 \begin_inset Flex Code
14384 \begin_layout Plain Layout
14391 \begin_inset Flex Code
14394 \begin_layout Plain Layout
14401 \begin_inset Flex Code
14404 \begin_layout Plain Layout
14411 \begin_inset Flex Code
14414 \begin_layout Plain Layout
14420 for top, bottom, page, and here, respectively.
14424 \begin_layout Plain Layout
14425 Note that the order of these letters in the string is irrelevant, like in
14431 On top of that there is a new type,
14432 \begin_inset Flex Code
14435 \begin_layout Plain Layout
14441 , which does not really correspond to a float, since it means: put it
14442 \begin_inset Quotes eld
14446 \begin_inset Quotes erd
14450 Note however that the
14451 \begin_inset Flex Code
14454 \begin_layout Plain Layout
14460 specifier is special and, because of implementation details, cannot be
14461 used in non-built in float types.
14462 If you do not understand what this means, just use
14463 \begin_inset Quotes eld
14467 \begin_inset Flex Code
14470 \begin_layout Plain Layout
14477 \begin_inset Quotes erd
14483 \begin_layout Description
14484 \begin_inset Flex Code
14487 \begin_layout Plain Layout
14494 \begin_inset Flex Code
14497 \begin_layout Plain Layout
14503 ] The prefix to use when creating labels referring to floats of this type.
14504 This allows the use of formatted references.
14505 Note that you can remove any
14506 \begin_inset Flex Code
14509 \begin_layout Plain Layout
14515 set by a copied style by using the special value
14516 \begin_inset Quotes eld
14520 \begin_inset Quotes erd
14523 , which must be all caps.
14526 \begin_layout Description
14527 \begin_inset Flex Code
14530 \begin_layout Plain Layout
14537 \begin_inset Flex Code
14540 \begin_layout Plain Layout
14547 \begin_inset Quotes erd
14551 \begin_inset Quotes erd
14554 ] The style used when defining the float using
14555 \begin_inset Flex Code
14558 \begin_layout Plain Layout
14569 \begin_layout Description
14570 \begin_inset Flex Code
14573 \begin_layout Plain Layout
14580 \begin_inset Flex Code
14583 \begin_layout Plain Layout
14590 \begin_inset Quotes erd
14594 \begin_inset Quotes erd
14598 \begin_inset Quotes eld
14602 \begin_inset Quotes erd
14605 of the new class of floats, like program or algorithm.
14606 After the appropriate
14607 \begin_inset Flex Code
14610 \begin_layout Plain Layout
14619 \begin_inset Flex Code
14622 \begin_layout Plain Layout
14631 \begin_inset Flex Code
14634 \begin_layout Plain Layout
14645 \begin_layout Description
14646 \begin_inset Flex Code
14649 \begin_layout Plain Layout
14656 \begin_inset Flex Code
14659 \begin_layout Plain Layout
14666 \begin_inset Flex Code
14669 \begin_layout Plain Layout
14677 ] Tells us whether this float is defined using the facilities provided by
14679 \begin_inset Flex Code
14682 \begin_layout Plain Layout
14688 , either by the class file or a package, or on-the-fly by LyX itself.
14691 \begin_layout Standard
14692 Note that defining a float with type
14693 \begin_inset Flex Code
14696 \begin_layout Plain Layout
14704 automatically defines the corresponding counter with name
14705 \begin_inset Flex Code
14708 \begin_layout Plain Layout
14719 \begin_layout Subsection
14720 Flex insets and InsetLayout
14721 \begin_inset CommandInset label
14723 name "sub:Flex-insets-and"
14730 \begin_layout Standard
14731 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
14732 these are called Flex insets.
14736 \begin_layout Standard
14737 Flex insets come in three different kinds:
14740 \begin_layout Itemize
14742 \begin_inset Flex Code
14745 \begin_layout Plain Layout
14751 ): These define semantic markup corresponding to such LaTeX commands as
14753 \begin_inset Flex Code
14756 \begin_layout Plain Layout
14765 \begin_inset Flex Code
14768 \begin_layout Plain Layout
14779 \begin_layout Itemize
14781 \begin_inset Flex Code
14784 \begin_layout Plain Layout
14790 ): These can be used to define custom collapsible insets, similar to TeX
14791 code, footnote, and the like.
14792 An obvious example is an endnote inset, which is defined in the
14793 \begin_inset Flex Code
14796 \begin_layout Plain Layout
14805 \begin_layout Itemize
14807 \begin_inset Flex Code
14810 \begin_layout Plain Layout
14816 ): For use with DocBook classes.
14819 \begin_layout Standard
14820 Flex insets are defined using the
14821 \begin_inset Flex Code
14824 \begin_layout Plain Layout
14830 tag, which shall be explained in a moment.
14833 \begin_layout Standard
14835 \begin_inset Flex Code
14838 \begin_layout Plain Layout
14844 tag also serves another function: It can be used to customize the general
14845 layout of many different types of insets.
14847 \begin_inset Flex Code
14850 \begin_layout Plain Layout
14856 can be used to customize the layout parameters for footnotes, marginal
14857 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
14858 boxes, tables, algorithms, URLs, and optional arguments, as well as to
14859 define Flex insets.
14862 \begin_layout Standard
14864 \begin_inset Flex Code
14867 \begin_layout Plain Layout
14873 definition must begin with a line of the form:
14876 \begin_layout LyX-Code
14880 \begin_layout Standard
14882 \begin_inset Flex Code
14885 \begin_layout Plain Layout
14891 indicates the inset whose layout is being defined, and here there are
14892 \change_inserted 5863208 1334489266
14894 \change_deleted 5863208 1334489267
14900 \begin_layout Enumerate
14901 The layout for a pre-existing inset is being modified.
14902 In this case, can be
14903 \begin_inset Flex Code
14906 \begin_layout Plain Layout
14912 any one of the following:
14913 \begin_inset Flex Code
14916 \begin_layout Plain Layout
14923 \begin_inset Flex Code
14926 \begin_layout Plain Layout
14933 \begin_inset Flex Code
14936 \begin_layout Plain Layout
14943 \begin_inset Flex Code
14946 \begin_layout Plain Layout
14953 \begin_inset Flex Code
14956 \begin_layout Plain Layout
14963 \begin_inset Flex Code
14966 \begin_layout Plain Layout
14973 \begin_inset Flex Code
14976 \begin_layout Plain Layout
14983 \begin_inset Flex Code
14986 \begin_layout Plain Layout
14993 \begin_inset Flex Code
14996 \begin_layout Plain Layout
15003 \begin_inset Flex Code
15006 \begin_layout Plain Layout
15013 \begin_inset Flex Code
15016 \begin_layout Plain Layout
15023 \begin_inset Flex Code
15026 \begin_layout Plain Layout
15033 \begin_inset Flex Code
15036 \begin_layout Plain Layout
15043 \begin_inset Flex Code
15046 \begin_layout Plain Layout
15053 \begin_inset Flex Code
15056 \begin_layout Plain Layout
15063 \begin_inset Flex Code
15066 \begin_layout Plain Layout
15073 \begin_inset Flex Code
15076 \begin_layout Plain Layout
15083 \begin_inset Flex Code
15086 \begin_layout Plain Layout
15093 \begin_inset Flex Code
15096 \begin_layout Plain Layout
15103 \begin_inset Flex Code
15106 \begin_layout Plain Layout
15115 \begin_layout Enumerate
15116 The layout for a Flex inset is being defined.
15118 \begin_inset Flex Code
15121 \begin_layout Plain Layout
15127 must be of the form
15128 \begin_inset Quotes eld
15132 \begin_inset Flex Code
15135 \begin_layout Plain Layout
15142 \begin_inset Quotes erd
15146 \begin_inset Flex Code
15149 \begin_layout Plain Layout
15155 may be be any valid identifier not used by a pre-existing Flex inset.
15156 The identifier may include spaces, but in that case the whole thing must
15157 be wrapped in quotes.
15158 Note that the definition of a flex inset
15163 \begin_inset Flex Code
15166 \begin_layout Plain Layout
15172 entry, declaring which type of inset it defines.
15173 \change_inserted 5863208 1334489312
15177 \begin_layout Enumerate
15179 \change_inserted 5863208 1334492248
15180 The layout for user specific branch is being defined.
15182 \begin_inset Flex Code
15185 \begin_layout Plain Layout
15187 \change_inserted 5863208 1334489384
15193 must be of the form
15194 \begin_inset Quotes eld
15198 \begin_inset Flex Code
15201 \begin_layout Plain Layout
15203 \change_inserted 5863208 1334489392
15210 \begin_inset Quotes erd
15214 \begin_inset Flex Code
15217 \begin_layout Plain Layout
15219 \change_inserted 5863208 1334489384
15225 may be be any valid identifier of branch defined in user's document.
15226 The identifier may include spaces, but in that case the whole thing must
15227 be wrapped in quotes.
15228 The main purpose of this feature is to allow LaTeX wrapping around specific
15229 branches as user needs.
15234 \begin_layout Standard
15236 \begin_inset Flex Code
15239 \begin_layout Plain Layout
15245 definition can contain the following entries:
15248 \begin_layout Description
15250 \change_inserted -712698321 1353681390
15251 \begin_inset Flex Code
15254 \begin_layout Plain Layout
15256 \change_inserted -712698321 1353681344
15263 \begin_inset Flex Code
15266 \begin_layout Plain Layout
15268 \change_inserted -712698321 1353681344
15274 ] Defines argument number <int> of a command\SpecialChar \slash{}
15275 environment associated with
15276 the current layout.
15277 The definition must end with
15278 \begin_inset Flex Code
15281 \begin_layout Plain Layout
15283 \change_inserted -712698321 1353681344
15291 \begin_inset space ~
15295 \begin_inset CommandInset ref
15297 reference "sub:Paragraph-Styles"
15304 \begin_layout Description
15306 \change_inserted -195340706 1333913893
15307 \begin_inset Flex Code
15310 \begin_layout Plain Layout
15316 Preamble for changing languages.
15318 \begin_inset space ~
15322 \begin_inset CommandInset ref
15324 reference "sub:I18n"
15331 \begin_layout Description
15332 \begin_inset Flex Code
15335 \begin_layout Plain Layout
15341 The color for the inset's background.
15342 The valid colors are defined in
15343 \begin_inset Flex Code
15346 \begin_layout Plain Layout
15355 \begin_layout Description
15356 \begin_inset Flex Code
15359 \begin_layout Plain Layout
15366 \begin_inset Flex Code
15369 \begin_layout Plain Layout
15378 \begin_inset Flex Code
15381 \begin_layout Plain Layout
15387 ] Whether to use the content of the inset as the label, when the inset is
15392 \begin_layout Description
15393 \begin_inset Flex Code
15396 \begin_layout Plain Layout
15403 \begin_inset Flex Code
15406 \begin_layout Plain Layout
15412 Copies all the features of an existing style into the current one.
15416 \begin_layout Description
15417 \begin_inset Flex Code
15420 \begin_layout Plain Layout
15427 \begin_inset Flex Code
15430 \begin_layout Plain Layout
15439 \begin_inset Flex Code
15442 \begin_layout Plain Layout
15448 ] Indicates whether the user may employ the Paragraph Settings dialog to
15449 customize the paragraph.
15452 \begin_layout Description
15453 \begin_inset Flex Code
15456 \begin_layout Plain Layout
15463 \begin_inset Flex Code
15466 \begin_layout Plain Layout
15473 \begin_inset Flex Code
15476 \begin_layout Plain Layout
15483 \begin_inset Flex Code
15486 \begin_layout Plain Layout
15492 , describing the rendering style used for the inset's frame and buttons.
15493 Footnotes generally use
15494 \begin_inset Flex Code
15497 \begin_layout Plain Layout
15503 , ERT insets generally
15504 \begin_inset Flex Code
15507 \begin_layout Plain Layout
15513 , and character styles
15514 \begin_inset Flex Code
15517 \begin_layout Plain Layout
15526 \begin_layout Description
15527 \begin_inset Flex Code
15530 \begin_layout Plain Layout
15537 \begin_inset Flex Code
15540 \begin_layout Plain Layout
15547 \begin_inset Flex Code
15550 \begin_layout Plain Layout
15559 \begin_inset Flex Code
15562 \begin_layout Plain Layout
15569 \begin_inset Flex Code
15572 \begin_layout Plain Layout
15579 Indicates whether the environment will stand on its own in LaTeX output
15580 or will appear inline with the surrounding text.
15581 If set to false, it is supposed that the LaTeX environment ignores white
15582 space (including one newline character) after the
15583 \begin_inset Flex Code
15586 \begin_layout Plain Layout
15599 \begin_inset Flex Code
15602 \begin_layout Plain Layout
15618 \begin_layout Description
15619 \begin_inset Flex Code
15622 \begin_layout Plain Layout
15628 Required at the end of the InsetLayout declarations.
15631 \begin_layout Description
15632 \begin_inset Flex Code
15635 \begin_layout Plain Layout
15641 The font used for both the text body
15647 \begin_inset space ~
15651 \begin_inset CommandInset ref
15653 reference "sub:Font-description"
15658 Note that defining this font automatically defines the
15659 \begin_inset Flex Code
15662 \begin_layout Plain Layout
15668 to the same value, so define this first and define
15669 \begin_inset Flex Code
15672 \begin_layout Plain Layout
15678 later if you want them to be different.
15681 \begin_layout Description
15682 \begin_inset Flex Code
15685 \begin_layout Plain Layout
15692 \begin_inset Quotes eld
15696 \begin_inset Quotes erd
15699 language, leading to Left-to-Right (latin) output, e.
15700 \begin_inset space \thinspace{}
15704 \begin_inset space \space{}
15707 in TeX code or URL.
15711 \begin_layout Description
15712 \begin_inset Flex Code
15715 \begin_layout Plain Layout
15722 \begin_inset Flex Code
15725 \begin_layout Plain Layout
15734 \begin_inset Flex Code
15737 \begin_layout Plain Layout
15743 ] Indicates whether the
15744 \begin_inset Flex Code
15747 \begin_layout Plain Layout
15753 should be used or, instead, the user can change the paragraph style used
15758 \begin_layout Description
15759 \begin_inset Flex Code
15762 \begin_layout Plain Layout
15769 \begin_inset Flex Code
15772 \begin_layout Plain Layout
15781 \begin_inset Flex Code
15784 \begin_layout Plain Layout
15790 ] Usually LyX doesn't allow you to insert more than one space between words,
15791 since a space is considered as the separation between two words, not a
15792 character or symbol of its own.
15793 This is a very fine thing but sometimes annoying, for example, when typing
15794 program code or plain LaTeX code.
15796 \begin_inset Flex Code
15799 \begin_layout Plain Layout
15806 Note that LyX will create protected blanks for the additional blanks when
15807 in another mode than LaTeX-mode.
15811 \begin_layout Description
15812 \begin_inset Flex Code
15815 \begin_layout Plain Layout
15821 These tags control XHTML output.
15823 \begin_inset CommandInset ref
15825 reference "sec:Tags-for-XHTML"
15832 \begin_layout Description
15833 \begin_inset Flex Code
15836 \begin_layout Plain Layout
15843 \begin_inset Flex Code
15846 \begin_layout Plain Layout
15855 \begin_inset Flex Code
15858 \begin_layout Plain Layout
15864 ] Whether to include the contents of this inset in the strings generated
15865 for the `Outline' pane.
15866 One would not, for example, want the content of a footnote in a section
15867 header to be included in the TOC displayed in the outline, but one would
15868 normally want the content of a character style displayed.
15869 Default is false: not to include.
15872 \begin_layout Description
15873 \begin_inset Flex Code
15876 \begin_layout Plain Layout
15883 \begin_inset Flex Code
15886 \begin_layout Plain Layout
15895 \begin_inset Flex Code
15898 \begin_layout Plain Layout
15904 ] Usually LyX does not allow you to leave a paragraph empty, since it would
15905 lead to empty LaTeX output.
15906 There are some cases where this could be desirable however: in a letter
15907 template, the required fields can be provided as empty fields, so that
15908 people do not forget them; in some special classes, a style can be used
15909 as some kind of break, which does not contain actual text.
15913 \begin_layout Description
15914 \begin_inset Flex Code
15917 \begin_layout Plain Layout
15923 The font used for the label.
15925 \begin_inset space ~
15929 \begin_inset CommandInset ref
15931 reference "sub:Font-description"
15936 Note that this definition can never appear before
15937 \begin_inset Flex Code
15940 \begin_layout Plain Layout
15946 , lest it be ineffective.
15949 \begin_layout Description
15950 \begin_inset Flex Code
15953 \begin_layout Plain Layout
15959 What will be displayed on the button or elsewhere as the inset label.
15961 \begin_inset Flex Code
15964 \begin_layout Plain Layout
15971 \begin_inset Flex Code
15974 \begin_layout Plain Layout
15980 ) modify this label on the fly.
15983 \begin_layout Description
15985 \change_inserted -195340706 1333913893
15986 \begin_inset Flex Code
15989 \begin_layout Plain Layout
15995 Language dependent preamble.
15997 \begin_inset space ~
16001 \begin_inset CommandInset ref
16003 reference "sub:I18n"
16010 \begin_layout Description
16011 \begin_inset Flex Code
16014 \begin_layout Plain Layout
16020 The name of the corresponding LaTeX stuff.
16021 Either the environment or command name.
16024 \begin_layout Description
16025 \begin_inset Flex Code
16028 \begin_layout Plain Layout
16034 The optional parameter for the corresponding
16035 \begin_inset Flex Code
16038 \begin_layout Plain Layout
16044 stuff, including possible bracket pairs like
16045 \begin_inset Flex Code
16048 \begin_layout Plain Layout
16055 This parameter cannot be changed from within LyX.
16058 \begin_layout Description
16059 \begin_inset Flex Code
16062 \begin_layout Plain Layout
16069 \begin_inset Flex Code
16072 \begin_layout Plain Layout
16077 , Command, Environment, Item_Environment,
16083 \begin_inset Flex Code
16086 \begin_layout Plain Layout
16087 List_Environment, Bib_Environment
16092 ] How the style should be translated into LaTeX.
16096 \begin_layout Plain Layout
16097 \begin_inset Flex Code
16100 \begin_layout Plain Layout
16106 is perhaps a bit misleading, since these rules apply to SGML classes, too.
16107 Visit the SGML class files for specific examples.
16116 \begin_layout Itemize
16117 \begin_inset Flex Code
16120 \begin_layout Plain Layout
16126 means nothing special.
16130 \begin_layout Itemize
16131 \begin_inset Flex Code
16134 \begin_layout Plain Layout
16141 \begin_inset Flex Code
16144 \begin_layout Plain Layout
16151 {\SpecialChar \ldots{}
16160 \begin_layout Itemize
16161 \begin_inset Flex Code
16164 \begin_layout Plain Layout
16171 \begin_inset Flex Code
16174 \begin_layout Plain Layout
16181 }\SpecialChar \ldots{}
16197 \begin_layout Itemize
16198 \begin_inset Flex Code
16201 \begin_layout Plain Layout
16208 \begin_inset Flex Code
16211 \begin_layout Plain Layout
16218 \begin_inset Flex Code
16221 \begin_layout Plain Layout
16229 is generated for each paragraph of this environment.
16233 \begin_layout Itemize
16234 \begin_inset Flex Code
16237 \begin_layout Plain Layout
16244 \begin_inset Flex Code
16247 \begin_layout Plain Layout
16254 \begin_inset Flex Code
16257 \begin_layout Plain Layout
16263 is passed as an argument to the environment.
16265 \begin_inset Flex Code
16268 \begin_layout Plain Layout
16274 can be defined in the
16275 \begin_inset Flex MenuItem
16278 \begin_layout Plain Layout
16283 \SpecialChar \menuseparator
16289 \begin_inset space ~
16301 \begin_layout Standard
16302 Putting the last few things together, the LaTeX output will be either:
16305 \begin_layout LyX-Code
16308 latexname[latexparam]{\SpecialChar \ldots{}
16312 \begin_layout Standard
16316 \begin_layout LyX-Code
16319 begin{latexname}[latexparam] \SpecialChar \ldots{}
16325 \begin_layout Standard
16326 depending upon the LaTeX type.
16330 \begin_layout Description
16331 \begin_inset Flex Code
16334 \begin_layout Plain Layout
16341 \begin_inset Flex Code
16344 \begin_layout Plain Layout
16351 \begin_inset Flex Code
16354 \begin_layout Plain Layout
16361 \begin_inset Flex Code
16364 \begin_layout Plain Layout
16371 \begin_inset Flex Code
16374 \begin_layout Plain Layout
16380 (indicating a dummy definition ending definitions of charstyles, etc).
16381 This entry is required in and is only meaningful for Flex insets.
16382 Among other things, it determines on which menu this inset will appear.
16384 \begin_inset Flex Code
16387 \begin_layout Plain Layout
16394 \begin_inset Flex Code
16397 \begin_layout Plain Layout
16404 \begin_inset Flex Code
16407 \begin_layout Plain Layout
16415 \begin_inset Flex Code
16418 \begin_layout Plain Layout
16424 can be set to true for charstyle insets, if you wish, by setting it
16429 \begin_inset Flex Code
16432 \begin_layout Plain Layout
16441 \begin_layout Description
16442 \begin_inset Flex Code
16445 \begin_layout Plain Layout
16452 \begin_inset Flex Code
16455 \begin_layout Plain Layout
16464 \begin_inset Flex Code
16467 \begin_layout Plain Layout
16473 ] Whether multiple paragraphs are permitted in this inset.
16475 \begin_inset Flex Code
16478 \begin_layout Plain Layout
16484 to the same value and
16485 \begin_inset Flex Code
16488 \begin_layout Plain Layout
16494 to the opposite value.
16495 These can be reset to other values, if they are used
16500 \begin_inset Flex Code
16503 \begin_layout Plain Layout
16513 \begin_layout Description
16514 \begin_inset Flex Code
16517 \begin_layout Plain Layout
16524 \begin_inset Flex Code
16527 \begin_layout Plain Layout
16536 \begin_inset Flex Code
16539 \begin_layout Plain Layout
16545 ] Whether fragile commands in this inset should be
16546 \begin_inset Flex Code
16549 \begin_layout Plain Layout
16562 whether the command should itself be protected.) Default is false.
16565 \begin_layout Description
16566 \begin_inset Flex Code
16569 \begin_layout Plain Layout
16576 \begin_inset Flex Code
16579 \begin_layout Plain Layout
16588 \begin_inset Flex Code
16591 \begin_layout Plain Layout
16597 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
16598 output, but only by a line break; together with
16599 \begin_inset Flex Code
16602 \begin_layout Plain Layout
16608 , this allows to emulate a plain text editor (like the ERT inset).
16612 \begin_layout Description
16613 \begin_inset Flex Code
16616 \begin_layout Plain Layout
16623 \begin_inset Flex Code
16626 \begin_layout Plain Layout
16635 \begin_inset Flex Code
16638 \begin_layout Plain Layout
16644 ] Whether the contents of this paragraph should be output in raw form, meaning
16645 without special translations that LaTeX would require.
16648 \begin_layout Description
16649 \begin_inset Flex Code
16652 \begin_layout Plain Layout
16658 Information to be included in the LaTeX preamble when this style is used.
16659 Used to define macros, load packages, etc., required by this particular
16662 \begin_inset Quotes eld
16666 \begin_inset Flex Code
16669 \begin_layout Plain Layout
16676 \begin_inset Quotes erd
16682 \begin_layout Description
16683 \begin_inset Flex Code
16686 \begin_layout Plain Layout
16693 \begin_inset Flex Code
16696 \begin_layout Plain Layout
16702 ] The prefix to use when creating labels referring to insets of this type.
16703 This allows the use of formatted references.
16706 \begin_layout Description
16707 \begin_inset Flex Code
16710 \begin_layout Plain Layout
16717 \begin_inset Flex Code
16720 \begin_layout Plain Layout
16726 ] Whether the style requires the feature
16727 \begin_inset Flex Code
16730 \begin_layout Plain Layout
16737 See the description of
16738 \begin_inset Flex Code
16741 \begin_layout Plain Layout
16748 \begin_inset CommandInset ref
16749 LatexCommand pageref
16750 reference "des:FreeSpacing"
16754 ) for information on `features'.
16758 \begin_layout Description
16759 \begin_inset Flex Code
16762 \begin_layout Plain Layout
16769 \begin_inset Flex Code
16772 \begin_layout Plain Layout
16779 \begin_inset Flex Code
16782 \begin_layout Plain Layout
16790 ] Whether this inset should use the font of its surrounding environment
16792 Default is true: uses its own.
16795 \begin_layout Description
16796 \begin_inset Flex Code
16799 \begin_layout Plain Layout
16806 \begin_inset Flex Code
16809 \begin_layout Plain Layout
16816 \begin_inset Flex Code
16819 \begin_layout Plain Layout
16827 ] Spellcheck the contents of this inset.
16831 \begin_layout Subsection
16833 \begin_inset CommandInset label
16835 name "sub:Counters"
16842 \begin_layout Standard
16843 Since version 1.3.0 of LyX, it is both possible and necessary to define the
16845 \begin_inset Flex MenuItem
16848 \begin_layout Plain Layout
16855 \begin_inset Flex MenuItem
16858 \begin_layout Plain Layout
16864 , \SpecialChar \ldots{}
16865 ) in the text class itself.
16866 The standard counters are defined in the file
16867 \begin_inset Flex Code
16870 \begin_layout Plain Layout
16876 , so you may have to do no more than add
16879 \begin_layout LyX-Code
16880 Input stdcounters.inc
16883 \begin_layout Standard
16884 to your layout file to get them to work.
16885 But if you want to define custom counters, then you can do so.
16886 The counter declaration must begin with:
16889 \begin_layout LyX-Code
16890 Counter CounterName
16893 \begin_layout Standard
16895 \begin_inset Flex Code
16898 \begin_layout Plain Layout
16904 ' is replaced by the name of the counter.
16905 And it must end with
16906 \begin_inset Quotes eld
16910 \begin_inset Flex Code
16913 \begin_layout Plain Layout
16920 \begin_inset Quotes erd
16924 The following parameters can also be used:
16927 \begin_layout Description
16928 \begin_inset Flex Code
16931 \begin_layout Plain Layout
16938 \begin_inset Flex Code
16941 \begin_layout Plain Layout
16948 \begin_inset Quotes erd
16952 \begin_inset Quotes erd
16955 ] When defined, this string defines how the counter is displayed.
16956 Setting this value sets
16957 \begin_inset Flex Code
16960 \begin_layout Plain Layout
16961 LabelStringAppendix
16967 The following special constructs can be used in the string:
16971 \begin_layout Itemize
16972 \begin_inset Flex Code
16975 \begin_layout Plain Layout
16983 will be replaced by the expansion of the
16984 \begin_inset Flex Code
16987 \begin_layout Plain Layout
16994 \begin_inset Flex Code
16997 \begin_layout Plain Layout
16998 LabelStringAppendix
17004 \begin_inset Flex Code
17007 \begin_layout Plain Layout
17017 \begin_layout Itemize
17018 counter values can be expressed using LaTeX-like macros
17019 \begin_inset Flex Code
17022 \begin_layout Plain Layout
17039 \begin_inset Flex Code
17042 \begin_layout Plain Layout
17054 \begin_layout Plain Layout
17064 Actually, the situation is a bit more complicated: any
17083 other than those described below will produce arabic numerals.
17084 It would not be surprising to see this change in the future.
17090 \begin_inset Flex Code
17093 \begin_layout Plain Layout
17099 : 1, 2, 3,\SpecialChar \ldots{}
17101 \begin_inset Flex Code
17104 \begin_layout Plain Layout
17110 for lower-case letters: a, b, c, \SpecialChar \ldots{}
17112 \begin_inset Flex Code
17115 \begin_layout Plain Layout
17121 for upper-case letters: A, B, C, \SpecialChar \ldots{}
17123 \begin_inset Flex Code
17126 \begin_layout Plain Layout
17132 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
17134 \begin_inset Flex Code
17137 \begin_layout Plain Layout
17143 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
17145 \begin_inset Flex Code
17148 \begin_layout Plain Layout
17154 for hebrew numerals.
17158 \begin_layout Standard
17159 If LabelString is not defined, a default value is constructed as follows:
17160 if the counter has a master counter
17161 \begin_inset Flex Code
17164 \begin_layout Plain Layout
17171 \begin_inset Flex Code
17174 \begin_layout Plain Layout
17181 \begin_inset Flex Code
17184 \begin_layout Plain Layout
17194 is used; otherwise the string
17195 \begin_inset Flex Code
17198 \begin_layout Plain Layout
17209 \begin_layout Description
17210 \begin_inset Flex Code
17213 \begin_layout Plain Layout
17214 LabelStringAppendix
17220 \begin_inset Flex Code
17223 \begin_layout Plain Layout
17230 \begin_inset Quotes erd
17234 \begin_inset Quotes erd
17238 \begin_inset Flex Code
17241 \begin_layout Plain Layout
17247 , but for use in the Appendix.
17250 \begin_layout Description
17251 \begin_inset Flex Code
17254 \begin_layout Plain Layout
17261 \begin_inset Flex Code
17264 \begin_layout Plain Layout
17271 \begin_inset Quotes erd
17275 \begin_inset Quotes erd
17278 ] A format for use with formatted references to this counter.
17279 For example, one might want to have references to section numbers appear
17281 \begin_inset Quotes eld
17285 \begin_inset Quotes erd
17289 The string should contain
17290 \begin_inset Quotes eld
17294 \begin_inset Quotes erd
17298 This will be replaced by the counter number itself.
17299 So, for sections, it would be: Section ##.
17302 \begin_layout Description
17303 \begin_inset Flex Code
17306 \begin_layout Plain Layout
17313 \begin_inset Flex Code
17316 \begin_layout Plain Layout
17323 \begin_inset Quotes erd
17327 \begin_inset Quotes erd
17330 ] If this is set to the name of another counter, the present counter will
17331 be reset every time the other one is increased.
17333 \begin_inset Flex Code
17336 \begin_layout Plain Layout
17343 \begin_inset Flex Code
17346 \begin_layout Plain Layout
17355 \begin_layout Subsection
17357 \begin_inset CommandInset label
17359 name "sub:Font-description"
17366 \begin_layout Standard
17367 A font description looks like this:
17370 \begin_layout LyX-Code
17380 \begin_layout LyX-Code
17384 \begin_layout LyX-Code
17388 \begin_layout Standard
17389 The following commands are available:
17392 \begin_layout Description
17393 \begin_inset Flex Code
17396 \begin_layout Plain Layout
17403 \begin_inset Flex Code
17406 \begin_layout Plain Layout
17415 \begin_inset Flex Code
17418 \begin_layout Plain Layout
17425 \begin_inset Flex Code
17428 \begin_layout Plain Layout
17435 \begin_inset Flex Code
17438 \begin_layout Plain Layout
17445 \begin_inset Flex Code
17448 \begin_layout Plain Layout
17455 \begin_inset Flex Code
17458 \begin_layout Plain Layout
17465 \begin_inset Flex Code
17468 \begin_layout Plain Layout
17475 \begin_inset Flex Code
17478 \begin_layout Plain Layout
17485 \begin_inset Flex Code
17488 \begin_layout Plain Layout
17497 \begin_layout Description
17498 \begin_inset Flex Code
17501 \begin_layout Plain Layout
17508 \begin_inset Flex Code
17511 \begin_layout Plain Layout
17520 \begin_inset Flex Code
17523 \begin_layout Plain Layout
17530 \begin_inset Flex Code
17533 \begin_layout Plain Layout
17542 \begin_layout Description
17543 \begin_inset Flex Code
17546 \begin_layout Plain Layout
17553 \begin_inset Flex Code
17556 \begin_layout Plain Layout
17562 ] Valid arguments are:
17563 \begin_inset Flex Code
17566 \begin_layout Plain Layout
17573 \begin_inset Flex Code
17576 \begin_layout Plain Layout
17583 \begin_inset Flex Code
17586 \begin_layout Plain Layout
17593 \begin_inset Flex Code
17596 \begin_layout Plain Layout
17603 \begin_inset Flex Code
17606 \begin_layout Plain Layout
17613 \begin_inset Flex Code
17616 \begin_layout Plain Layout
17623 \begin_inset Flex Code
17626 \begin_layout Plain Layout
17633 \begin_inset Flex Code
17636 \begin_layout Plain Layout
17643 \begin_inset Flex Code
17646 \begin_layout Plain Layout
17653 \begin_inset Flex Code
17656 \begin_layout Plain Layout
17663 \begin_inset Flex Code
17666 \begin_layout Plain Layout
17673 \begin_inset Flex Code
17676 \begin_layout Plain Layout
17683 Each of these turns on or off the corresponding attribute.
17685 \begin_inset Flex Code
17688 \begin_layout Plain Layout
17694 turns on emphasis, and
17695 \begin_inset Flex Code
17698 \begin_layout Plain Layout
17706 \begin_inset Newline newline
17709 If the latter seems puzzling, remember that the font settings for the present
17710 context are generally inherited from the surrounding context.
17712 \begin_inset Flex Code
17715 \begin_layout Plain Layout
17721 would turn off the emphasis that was anyway in effect, say, in a theorem
17725 \begin_layout Description
17726 \begin_inset Flex Code
17729 \begin_layout Plain Layout
17736 \begin_inset Flex Code
17739 \begin_layout Plain Layout
17748 \begin_inset Flex Code
17751 \begin_layout Plain Layout
17760 \begin_layout Description
17761 \begin_inset Flex Code
17764 \begin_layout Plain Layout
17771 \begin_inset Flex Code
17774 \begin_layout Plain Layout
17783 \begin_inset Flex Code
17786 \begin_layout Plain Layout
17793 \begin_inset Flex Code
17796 \begin_layout Plain Layout
17803 \begin_inset Flex Code
17806 \begin_layout Plain Layout
17815 \begin_layout Description
17816 \begin_inset Flex Code
17819 \begin_layout Plain Layout
17826 \begin_inset Flex Code
17829 \begin_layout Plain Layout
17836 \begin_inset Flex Code
17839 \begin_layout Plain Layout
17846 \begin_inset Flex Code
17849 \begin_layout Plain Layout
17858 \begin_inset Flex Code
17861 \begin_layout Plain Layout
17868 \begin_inset Flex Code
17871 \begin_layout Plain Layout
17878 \begin_inset Flex Code
17881 \begin_layout Plain Layout
17888 \begin_inset Flex Code
17891 \begin_layout Plain Layout
17898 \begin_inset Flex Code
17901 \begin_layout Plain Layout
17910 \begin_layout Subsection
17911 \begin_inset CommandInset label
17913 name "sub:Citation-format-description"
17917 Citation format description
17920 \begin_layout Standard
17922 \begin_inset Flex Code
17925 \begin_layout Plain Layout
17931 blocks are used to describe how bibliographic information should be displayed,
17932 both within LyX itself (in the citation dialog and in tooltips, for example)
17933 and in XHTML output.
17934 Such a block might look like this:
17937 \begin_layout LyX-Code
17941 \begin_layout LyX-Code
17945 \begin_layout LyX-Code
17949 \begin_layout LyX-Code
17953 \begin_layout Standard
17954 The individual lines define how the bibliographic information associated
17955 with an article or book, respectively, is to be displayed, and such a definitio
17956 n can be given for any `entry type' that might be present in a BibTeX file.
17957 LyX defines a default format in the source code that will be used if no
17958 specific definition has been given.
17959 LyX predefines several formats in the file
17960 \begin_inset Flex Code
17963 \begin_layout Plain Layout
17969 , which is included in most of LyX's document classes.
17972 \begin_layout Standard
17973 The definitions use a simple language that allows BibTeX keys to be replaced
17975 Keys should be enclosed in
17976 \begin_inset Flex Code
17979 \begin_layout Plain Layout
17986 \begin_inset Flex Code
17989 \begin_layout Plain Layout
17996 So a simple definition might look like this:
17999 \begin_layout LyX-Code
18001 \begin_inset Quotes eld
18005 \begin_inset Quotes erd
18011 \begin_layout Standard
18012 This would print the author, followed by a comma, followed by the title,
18013 in quotes, followed by a period.
18016 \begin_layout Standard
18017 Of course, sometimes you may want to print a key only if it exists.
18018 This can be done by using a conditional construction, such as:
18019 \begin_inset Flex Code
18022 \begin_layout Plain Layout
18024 \begin_inset space ~
18034 \begin_inset Flex Code
18037 \begin_layout Plain Layout
18043 key exists, then print
18044 \begin_inset Quotes eld
18048 \begin_inset space ~
18052 \begin_inset Quotes erd
18055 followed by the volume key.
18056 It is also possible to have an else clause in the conditional, such as:
18058 \begin_inset Flex Code
18061 \begin_layout Plain Layout
18062 {%author%[[%author%]][[%editor%, ed.]]}
18069 \begin_inset Flex Code
18072 \begin_layout Plain Layout
18078 key is printed if it exists; otherwise, the editor key is printed, followed
18080 \begin_inset Quotes eld
18084 \begin_inset space ~
18088 \begin_inset Quotes erd
18091 Note that the key is again enclosed in
18092 \begin_inset Flex Code
18095 \begin_layout Plain Layout
18101 signs; the entire conditional is enclosed in braces; and the if and else
18102 clauses are enclosed in double brackets,
18103 \begin_inset Quotes eld
18107 \begin_inset Flex Code
18110 \begin_layout Plain Layout
18117 \begin_inset Quotes eld
18121 \begin_inset Quotes eld
18125 \begin_inset Flex Code
18128 \begin_layout Plain Layout
18135 \begin_inset Quotes erd
18139 There must be no space between any of these.
18142 \begin_layout Standard
18143 There is one other piece of syntax available in definitions, which looks
18145 \begin_inset Flex Code
18148 \begin_layout Plain Layout
18155 This defines a piece of formatting information that is to be used when
18157 \begin_inset Quotes eld
18161 \begin_inset Quotes erd
18165 Obviously, we do not want to output HTML tags when writing plain text,
18166 so they should be wrapped in
18167 \begin_inset Quotes eld
18171 \begin_inset Quotes erd
18175 \begin_inset Quotes eld
18179 \begin_inset Quotes erd
18185 \begin_layout Standard
18186 Two special sorts of definitions are also possible in a
18187 \begin_inset Flex Code
18190 \begin_layout Plain Layout
18197 An example of the first would be:
18200 \begin_layout LyX-Code
18202 \begin_inset Quotes eld
18206 \begin_inset Quotes erd
18212 \begin_layout Standard
18213 This is an abbreviation, or macro, and it can be used by treating it as
18215 \begin_inset Flex Code
18218 \begin_layout Plain Layout
18226 \begin_inset Flex Code
18229 \begin_layout Plain Layout
18235 exactly as it would treat its definition.
18236 So, let us issue the obvious
18244 \begin_layout LyX-Code
18248 \begin_layout Standard
18249 or anything like it.
18250 LyX shouldn't go into an infinite loop, but it may go into a long one before
18254 \begin_layout Standard
18255 The second sort of special definition might look like this:
18258 \begin_layout LyX-Code
18262 \begin_layout Standard
18263 This defines a translatable piece of text, which allows relevant parts of
18264 the bibliography to be translated.
18265 It can be included in a definition by treating it as a key:
18266 \begin_inset Flex Code
18269 \begin_layout Plain Layout
18276 Several of these are predefined in
18277 \begin_inset Flex Code
18280 \begin_layout Plain Layout
18287 Note that these are not macros, in the sense just defined.
18288 They will not be expanded.
18291 \begin_layout Standard
18292 So here then is an example that use all these features:
18295 \begin_layout LyX-Code
18296 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
18299 \begin_layout Standard
18300 This defines a macro that prints the author, followed by a comma, if the
18302 \begin_inset Flex Code
18305 \begin_layout Plain Layout
18311 key is defined, or else prints the name of the editor, followed by the
18313 \begin_inset Flex Code
18316 \begin_layout Plain Layout
18322 or its translation (it is by default
18323 \begin_inset Quotes eld
18327 \begin_inset Quotes erd
18331 \begin_inset Flex Code
18334 \begin_layout Plain Layout
18341 Note that this is in fact defined in
18342 \begin_inset Flex Code
18345 \begin_layout Plain Layout
18351 , so you can use it in your own definitions, or re-definitions, if you load
18355 \begin_layout Section
18356 \begin_inset CommandInset label
18358 name "sec:Tags-for-XHTML"
18362 Tags for XHTML output
18365 \begin_layout Standard
18366 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
18367 by layout information.
18368 In general, LyX provides sensible defaults and, as mentioned earlier, it
18369 will even construct default CSS style rules from the other layout tags.
18370 For example, LyX will attempt to use the information provided in the
18371 \begin_inset Flex Code
18374 \begin_layout Plain Layout
18380 declaration for the Chapter style to write CSS that will appropriately
18381 format chapter headings.
18384 \begin_layout Standard
18385 In many cases, then, you may not have to do anything at all to get acceptable
18386 XHTML output for your own environments, custom insets, and so forth.
18387 But in some cases you will, and so LyX provides a number of layout tags
18388 that can be used to customize the XHTML and CSS that are generated.
18391 \begin_layout Standard
18392 Note that there are two tags,
18393 \begin_inset Flex Code
18396 \begin_layout Plain Layout
18403 \begin_inset Flex Code
18406 \begin_layout Plain Layout
18412 that may appear outside style and inset declarations.
18414 \begin_inset CommandInset ref
18416 reference "sub:General-text-class"
18420 for details on these.
18423 \begin_layout Subsection
18424 \begin_inset CommandInset label
18426 name "sub:Paragraph-Style-XHTML"
18433 \begin_layout Standard
18434 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
18435 dealing with a normal paragraph, a command, or an environment, where this
18436 is itself determined by the contents of the corresponding
18437 \begin_inset Flex Code
18440 \begin_layout Plain Layout
18450 \begin_layout Standard
18451 For a command or normal paragraph, the output XHTML has the following form:
18454 \begin_layout LyX-Code
18456 \begin_inset Quotes erd
18460 \begin_inset Quotes erd
18466 \begin_layout LyX-Code
18468 \begin_inset Quotes erd
18472 \begin_inset Quotes erd
18478 \begin_layout LyX-Code
18479 Contents of the paragraph.
18482 \begin_layout LyX-Code
18486 \begin_layout Standard
18487 The label tags are of course omitted if the paragraph does not have a label.
18490 \begin_layout Standard
18491 For an environment that is not some sort of list, the XHTML takes this form:
18494 \begin_layout LyX-Code
18496 \begin_inset Quotes erd
18500 \begin_inset Quotes erd
18506 \begin_layout LyX-Code
18508 \begin_inset Quotes erd
18512 \begin_inset Quotes erd
18516 \begin_inset Quotes erd
18520 \begin_inset Quotes erd
18523 >Environment Label</labeltag>First paragraph.</itemtag>
18526 \begin_layout LyX-Code
18527 <itemtag>Second paragraph.</itemtag>
18530 \begin_layout LyX-Code
18534 \begin_layout Standard
18535 Note that the label is output only for the first paragraph, as it should
18536 be for a theorem, for example.
18540 \begin_layout Standard
18541 For a list, we have one of these forms:
18544 \begin_layout LyX-Code
18546 \begin_inset Quotes erd
18550 \begin_inset Quotes erd
18556 \begin_layout LyX-Code
18558 \begin_inset Quotes erd
18562 \begin_inset Quotes erd
18566 \begin_inset Quotes erd
18570 \begin_inset Quotes erd
18573 >List Label</labeltag>First item.</itemtag>
18576 \begin_layout LyX-Code
18578 \begin_inset Quotes erd
18582 \begin_inset Quotes erd
18586 \begin_inset Quotes erd
18590 \begin_inset Quotes erd
18593 >List Label</labeltag>Second item.</itemtag>
18596 \begin_layout LyX-Code
18600 \begin_layout LyX-Code
18604 \begin_layout LyX-Code
18606 \begin_inset Quotes erd
18610 \begin_inset Quotes erd
18616 \begin_layout LyX-Code
18618 \begin_inset Quotes erd
18622 \begin_inset Quotes erd
18625 >List Label</labeltag><itemtag attr=
18626 \begin_inset Quotes erd
18630 \begin_inset Quotes erd
18633 >First item.</itemtag>
18636 \begin_layout LyX-Code
18638 \begin_inset Quotes erd
18642 \begin_inset Quotes erd
18645 >List Label</labeltag><itemtag attr=
18646 \begin_inset Quotes erd
18650 \begin_inset Quotes erd
18653 >Second item.</itemtag>
18656 \begin_layout LyX-Code
18660 \begin_layout Standard
18661 Note the different orders of
18662 \begin_inset Flex Code
18665 \begin_layout Plain Layout
18672 \begin_inset Flex Code
18675 \begin_layout Plain Layout
18682 Which order we get depends upon the setting of
18683 \begin_inset Flex Code
18686 \begin_layout Plain Layout
18693 \begin_inset Flex Code
18696 \begin_layout Plain Layout
18702 is false (the default), you get the first of these, with the label within
18703 the item; if true, you get the second, with the label outside the item.
18706 \begin_layout Standard
18707 The specific tags and attributes output for each paragraph type can be controlle
18708 d by means of the layout tags we are about to describe.
18709 As mentioned earlier, however, LyX uses sensible defaults for many of these,
18710 so you often may not need to do very much to get good XHTML output.
18711 Think of the available tags as there so you can tweak things to your liking.
18714 \begin_layout Description
18715 \begin_inset Flex Code
18718 \begin_layout Plain Layout
18725 \begin_inset Flex Code
18728 \begin_layout Plain Layout
18734 ] Specifies attribute information to be output with the main tag.
18736 \begin_inset Quotes eld
18740 \begin_inset Flex Code
18743 \begin_layout Plain Layout
18750 \begin_inset Quotes erd
18754 By default, LyX will output
18755 \begin_inset Quotes eld
18759 \begin_inset Flex Code
18762 \begin_layout Plain Layout
18769 \begin_inset Quotes erd
18773 \begin_inset Flex Code
18776 \begin_layout Plain Layout
18782 is the LyX name of the layout, made lowercase, for example: chapter.
18787 contain any style information.
18789 \begin_inset Flex Code
18792 \begin_layout Plain Layout
18801 \begin_layout Description
18802 \begin_inset Flex Code
18805 \begin_layout Plain Layout
18812 \begin_inset Flex Code
18815 \begin_layout Plain Layout
18825 ] Whether to output the default CSS information LyX generates for this layout,
18826 even if additional information is explicitly provided via
18827 \begin_inset Flex Code
18830 \begin_layout Plain Layout
18838 \begin_inset Flex Code
18841 \begin_layout Plain Layout
18847 allows you to alter or augment the generated CSS, rather than to override
18850 \begin_inset Flex Code
18853 \begin_layout Plain Layout
18862 \begin_layout Description
18863 \begin_inset Flex Code
18866 \begin_layout Plain Layout
18873 \begin_inset Flex Code
18876 \begin_layout Plain Layout
18882 ] The tag to be used for individual paragraphs of environments, replacing
18884 \begin_inset Flex Code
18887 \begin_layout Plain Layout
18893 in the examples above.
18895 \begin_inset Flex Code
18898 \begin_layout Plain Layout
18907 \begin_layout Description
18908 \begin_inset Flex Code
18911 \begin_layout Plain Layout
18918 \begin_inset Flex Code
18921 \begin_layout Plain Layout
18927 ] Attributes for the item tag.
18929 \begin_inset Quotes eld
18933 \begin_inset Flex Code
18936 \begin_layout Plain Layout
18937 class=`layoutname_item'
18943 \begin_inset Quotes erd
18951 contain any style information.
18953 \begin_inset Flex Code
18956 \begin_layout Plain Layout
18965 \begin_layout Description
18966 \begin_inset Flex Code
18969 \begin_layout Plain Layout
18976 \begin_inset Flex Code
18979 \begin_layout Plain Layout
18985 ] The tag to be used for paragraph and item labels, replacing
18986 \begin_inset Flex Code
18989 \begin_layout Plain Layout
18995 in the examples above.
18997 \begin_inset Flex Code
19000 \begin_layout Plain Layout
19007 \begin_inset Flex Code
19010 \begin_layout Plain Layout
19017 \begin_inset Flex Code
19020 \begin_layout Plain Layout
19027 \begin_inset Flex Code
19030 \begin_layout Plain Layout
19031 Centered_Top_Environment
19036 , in which case it defaults to
19037 \begin_inset Flex Code
19040 \begin_layout Plain Layout
19049 \begin_layout Description
19050 \begin_inset Flex Code
19053 \begin_layout Plain Layout
19060 \begin_inset Flex Code
19063 \begin_layout Plain Layout
19069 ] Attributes for the label tag.
19071 \begin_inset Quotes eld
19075 \begin_inset Flex Code
19078 \begin_layout Plain Layout
19079 class=`layoutname_label'
19085 \begin_inset Quotes erd
19093 contain any style information.
19095 \begin_inset Flex Code
19098 \begin_layout Plain Layout
19107 \begin_layout Description
19108 \begin_inset Flex Code
19111 \begin_layout Plain Layout
19118 \begin_inset Flex Code
19121 \begin_layout Plain Layout
19131 ] Meaningful only for list-like environments, this tag controls whether
19132 the label tag is output before or inside the item tag.
19133 This is used, for example, in the description environment, where we want
19135 \begin_inset Flex Code
19138 \begin_layout Plain Layout
19139 <dt>\SpecialChar \ldots{}
19140 </dt><dd>\SpecialChar \ldots{}
19148 \begin_inset Flex Code
19151 \begin_layout Plain Layout
19157 : The label tag is output inside the item tag.
19160 \begin_layout Description
19161 \begin_inset Flex Code
19164 \begin_layout Plain Layout
19170 Information to be output in the
19171 \begin_inset Flex Code
19174 \begin_layout Plain Layout
19180 section when this style is used.
19181 This might, for example, be used to include a
19182 \begin_inset Flex Code
19185 \begin_layout Plain Layout
19192 \begin_inset Flex Code
19195 \begin_layout Plain Layout
19204 \begin_layout Description
19205 \begin_inset Flex Code
19208 \begin_layout Plain Layout
19214 CSS style information to be included when this style is used.
19215 Note that this will automatically be wrapped in a layout-generated
19216 \begin_inset Flex Code
19219 \begin_layout Plain Layout
19225 block, so only the CSS itself need be included.
19228 \begin_layout Description
19229 \begin_inset Flex Code
19232 \begin_layout Plain Layout
19239 \begin_inset Flex Code
19242 \begin_layout Plain Layout
19248 ] The tag to be used for the main label, replacing
19249 \begin_inset Flex Code
19252 \begin_layout Plain Layout
19258 in the examples above.
19260 \begin_inset Flex Code
19263 \begin_layout Plain Layout
19272 \begin_layout Description
19273 \begin_inset Flex Code
19276 \begin_layout Plain Layout
19283 \begin_inset Flex Code
19286 \begin_layout Plain Layout
19296 ] Marks this style as the one to be used to generate the
19297 \begin_inset Flex Code
19300 \begin_layout Plain Layout
19306 tag for the XHTML file.
19307 By default, it is false.
19309 \begin_inset Flex Code
19312 \begin_layout Plain Layout
19318 file sets it to true for the
19319 \begin_inset Flex Code
19322 \begin_layout Plain Layout
19332 \begin_layout Subsection
19336 \begin_layout Standard
19337 The XHTML output of insets can also be controlled by information in layout
19342 \begin_layout Plain Layout
19343 At present, this is true only for
19344 \begin_inset Quotes eld
19348 \begin_inset Quotes erd
19351 insets (insets you can type into) and is not true for
19352 \begin_inset Quotes eld
19356 \begin_inset Quotes erd
19359 insets (insets that are associated with dialog boxes).
19364 Here, too, LyX tries to provide sensible defaults, and it constructs default
19366 But everything can be customized.
19369 \begin_layout Standard
19370 The XHTML LyX outputs for an inset has the following form:
19373 \begin_layout LyX-Code
19375 \begin_inset Quotes erd
19379 \begin_inset Quotes erd
19385 \begin_layout LyX-Code
19386 <labeltag>Label</labeltag>
19389 \begin_layout LyX-Code
19391 \begin_inset Quotes erd
19395 \begin_inset Quotes erd
19398 >Contents of the inset.</innertag>
19401 \begin_layout LyX-Code
19405 \begin_layout Standard
19406 If the inset permits multiple paragraphs---that is, if
19407 \begin_inset Flex Code
19410 \begin_layout Plain Layout
19416 is true---then the contents of the inset will itself be output as paragraphs
19417 formatted according to the styles used for those paragraphs (standard,
19418 quote, and the like).
19419 The label tag is of course omitted if the paragraph does not have a label
19420 and, at present, is always
19421 \begin_inset Flex Code
19424 \begin_layout Plain Layout
19431 The inner tag is optional and, by default, does not appear.
19434 \begin_layout Standard
19435 The specific tags and attributes output for each inset can be controlled
19436 by means of the following layout tags.
19439 \begin_layout Description
19440 \begin_inset Flex Code
19443 \begin_layout Plain Layout
19450 \begin_inset Flex Code
19453 \begin_layout Plain Layout
19459 ] Specifies attribute information to be output with the main tag.
19461 \begin_inset Quotes eld
19465 \begin_inset Flex Code
19468 \begin_layout Plain Layout
19469 class=`myinset' onclick=`\SpecialChar \ldots{}
19476 \begin_inset Quotes erd
19480 By default, LyX will output
19481 \begin_inset Quotes eld
19485 \begin_inset Flex Code
19488 \begin_layout Plain Layout
19495 \begin_inset Quotes erd
19499 \begin_inset Flex Code
19502 \begin_layout Plain Layout
19508 is the LyX name of the inset, made lowercase and with non-alphanumeric
19509 characters converted to underscores, for example: footnote.
19512 \begin_layout Description
19513 \begin_inset Flex Code
19516 \begin_layout Plain Layout
19523 \begin_inset Flex Code
19526 \begin_layout Plain Layout
19536 ] Whether to output the default CSS information LyX generates for this layout,
19537 even if additional information is explicitly provided via
19538 \begin_inset Flex Code
19541 \begin_layout Plain Layout
19549 \begin_inset Flex Code
19552 \begin_layout Plain Layout
19558 allows you to alter or augment the generated CSS, rather than to override
19563 \begin_layout Description
19564 \begin_inset Flex Code
19567 \begin_layout Plain Layout
19574 \begin_inset Flex Code
19577 \begin_layout Plain Layout
19583 ] Attributes for the inner tag.
19585 \begin_inset Quotes eld
19589 \begin_inset Flex Code
19592 \begin_layout Plain Layout
19593 class=`insetname_inner'
19599 \begin_inset Quotes erd
19605 \begin_layout Description
19606 \begin_inset Flex Code
19609 \begin_layout Plain Layout
19616 \begin_inset Flex Code
19619 \begin_layout Plain Layout
19625 ] The inner tag, replacing
19626 \begin_inset Flex Code
19629 \begin_layout Plain Layout
19635 in the examples above.
19636 By default, there is none.
19639 \begin_layout Description
19640 \begin_inset Flex Code
19643 \begin_layout Plain Layout
19650 \begin_inset Flex Code
19653 \begin_layout Plain Layout
19661 ] Whether this inset represents a standalone block of text (such as a footnote)
19662 or instead represents material that is included in the surrounding text
19663 (such as a branch).
19667 \begin_layout Description
19668 \begin_inset Flex Code
19671 \begin_layout Plain Layout
19678 \begin_inset Flex Code
19681 \begin_layout Plain Layout
19687 ] A label for this inset, possibly including a reference to a counter.
19688 For example, for footnote, it might be:
19689 \begin_inset Flex Code
19692 \begin_layout Plain Layout
19701 This is optional, and there is no default.
19704 \begin_layout Description
19705 \begin_inset Flex Code
19708 \begin_layout Plain Layout
19714 Information to be output in the
19715 \begin_inset Flex Code
19718 \begin_layout Plain Layout
19724 section when this style is used.
19725 This might, for example, be used to include a
19726 \begin_inset Flex Code
19729 \begin_layout Plain Layout
19736 \begin_inset Flex Code
19739 \begin_layout Plain Layout
19748 \begin_layout Description
19749 \begin_inset Flex Code
19752 \begin_layout Plain Layout
19758 CSS style information to be included when this style is used.
19759 Note that this will automatically be wrapped in a layout-generated
19760 \begin_inset Flex Code
19763 \begin_layout Plain Layout
19769 block, so only the CSS itself need be included.
19772 \begin_layout Description
19773 \begin_inset Flex Code
19776 \begin_layout Plain Layout
19783 \begin_inset Flex Code
19786 \begin_layout Plain Layout
19792 ] The tag to be used for the main label, replacing
19793 \begin_inset Flex Code
19796 \begin_layout Plain Layout
19802 in the examples above.
19803 The default depends upon the setting of
19804 \begin_inset Flex Code
19807 \begin_layout Plain Layout
19814 \begin_inset Flex Code
19817 \begin_layout Plain Layout
19823 is true, the default is
19824 \begin_inset Flex Code
19827 \begin_layout Plain Layout
19833 ; if it is false, the default is
19834 \begin_inset Flex Code
19837 \begin_layout Plain Layout
19846 \begin_layout Subsection
19850 \begin_layout Standard
19851 The XHTML output for floats too can be controlled by layout information.
19852 The output has the following form:
19855 \begin_layout LyX-Code
19857 \begin_inset Quotes erd
19861 \begin_inset Quotes erd
19867 \begin_layout LyX-Code
19868 Contents of the float.
19871 \begin_layout LyX-Code
19875 \begin_layout Standard
19876 The caption, if there is one, is a separate inset and will be output as
19878 Its appearance can be controlled via the InsetLayout for caption insets.
19882 \begin_layout Description
19883 \begin_inset Flex Code
19886 \begin_layout Plain Layout
19893 \begin_inset Flex Code
19896 \begin_layout Plain Layout
19902 ] Specifies attribute information to be output with the main tag.
19904 \begin_inset Quotes eld
19908 \begin_inset Flex Code
19911 \begin_layout Plain Layout
19912 class=`myfloat' onclick=`\SpecialChar \ldots{}
19919 \begin_inset Quotes erd
19923 By default, LyX will output
19924 \begin_inset Quotes eld
19928 \begin_inset Flex Code
19931 \begin_layout Plain Layout
19932 class=`float float-floattype'
19938 \begin_inset Quotes erd
19942 \begin_inset Flex Code
19945 \begin_layout Plain Layout
19951 is LyX's name for this type of float, as determined by the float declaration
19953 \begin_inset CommandInset ref
19955 reference "sub:Floats"
19959 ), though made lowercase and with non-alphanumeric characters converted
19960 to underscores, for example: float-table.
19963 \begin_layout Description
19964 \begin_inset Flex Code
19967 \begin_layout Plain Layout
19973 CSS style information to be included when this float is used.
19974 Note that this will automatically be wrapped in a layout-generated
19975 \begin_inset Flex Code
19978 \begin_layout Plain Layout
19984 block, so only the CSS itself need be included.
19987 \begin_layout Description
19988 \begin_inset Flex Code
19991 \begin_layout Plain Layout
19998 \begin_inset Flex Code
20001 \begin_layout Plain Layout
20007 ] The tag to be used for this float, replacing
20008 \begin_inset Quotes eld
20012 \begin_inset Flex Code
20015 \begin_layout Plain Layout
20022 \begin_inset Quotes erd
20025 in the example above.
20027 \begin_inset Flex Code
20030 \begin_layout Plain Layout
20036 and will rarely need changing.
20039 \begin_layout Subsection
20040 Bibliography formatting
20043 \begin_layout Standard
20044 The bibliography can be formatted using
20045 \begin_inset Flex Code
20048 \begin_layout Plain Layout
20056 \begin_inset CommandInset ref
20058 reference "sub:Citation-format-description"
20065 \begin_layout Subsection
20069 \begin_layout Standard
20070 We have several times mentioned that LyX will generate default CSS style
20071 rules for both insets and paragraph styles, based upon the other layout
20072 information that is provided.
20073 In this section, we shall say a word about which layout information LyX
20077 \begin_layout Standard
20078 At present, LyX auto-generates CSS only for font information, making use
20080 \begin_inset Flex Code
20083 \begin_layout Plain Layout
20090 \begin_inset Flex Code
20093 \begin_layout Plain Layout
20100 \begin_inset Flex Code
20103 \begin_layout Plain Layout
20110 \begin_inset Flex Code
20113 \begin_layout Plain Layout
20120 \begin_inset Flex Code
20123 \begin_layout Plain Layout
20131 \begin_inset CommandInset ref
20133 reference "sub:Font-description"
20137 .) The translation is mostly straightforward and obvious.
20139 \begin_inset Quotes eld
20143 \begin_inset Flex Code
20146 \begin_layout Plain Layout
20153 \begin_inset Quotes erd
20157 \begin_inset Quotes eld
20161 \begin_inset Flex Code
20164 \begin_layout Plain Layout
20165 font-family: sans-serif;
20171 \begin_inset Quotes erd
20175 The correspondence of LyX sizes and CSS sizes is a little less obvious
20176 but nonetheless intuitive.
20178 \begin_inset Flex Code
20181 \begin_layout Plain Layout
20188 \begin_inset Flex URL
20191 \begin_layout Plain Layout
20201 \begin_layout Chapter
20202 Including External Material
20205 \begin_layout Standard
20206 \begin_inset Box Shadowbox
20216 height_special "totalheight"
20219 \begin_layout Plain Layout
20220 WARNING: This portion of the documentation has not been updated for some
20222 We certainly hope that it is still accurate, but there are no guarantees.
20230 \begin_layout Standard
20231 The use of material from sources external to LyX is covered in detail in
20237 This part of the manual covers what needs to happen behind the scenes for
20238 new sorts of material to be included.
20241 \begin_layout Section
20245 \begin_layout Standard
20246 The external material feature is based on the concept of a
20251 A template is a specification of how LyX should interface with a certain
20253 As bundled, LyX comes with predefined templates for Xfig figures, various
20254 raster format images, chess diagrams, and LilyPond music notation.
20255 You can check the actual list by using the menu
20256 \begin_inset Flex MenuItem
20259 \begin_layout Plain Layout
20260 Insert\SpecialChar \menuseparator
20261 File\SpecialChar \menuseparator
20268 Furthermore, it is possible to roll your own template to support a specific
20270 Later we'll describe in more detail what is involved, and hopefully you
20271 will submit all the templates you create so we can include them in a later
20275 \begin_layout Standard
20276 Another basic idea of the external material feature is to distinguish between
20277 the original file that serves as a base for final material and the produced
20278 file that is included in your exported or printed document.
20279 For example, consider the case of a figure produced with
20280 \begin_inset Flex Code
20283 \begin_layout Plain Layout
20290 The Xfig application itself works on an original file with the
20291 \begin_inset Flex Code
20294 \begin_layout Plain Layout
20301 Within Xfig, you create and change your figure, and when you are done,
20303 \begin_inset Flex Code
20306 \begin_layout Plain Layout
20313 When you want to include the figure in your document, you invoke
20314 \begin_inset Flex Code
20317 \begin_layout Plain Layout
20323 in order to create a PostScript file that can readily be included in your
20326 \begin_inset Flex Code
20329 \begin_layout Plain Layout
20335 file is the original file, and the PostScript file is the produced file.
20338 \begin_layout Standard
20339 This distinction is important in order to allow updating of the material
20340 while you are in the process of writing the document.
20341 Furthermore, it provides us with the flexibility that is needed to support
20342 multiple export formats.
20343 For instance, in the case of a plain text file, it is not exactly an award-winn
20344 ing idea to include the figure as raw PostScript.
20345 Instead, you would either prefer to just include a reference to the figure
20346 or try to invoke some graphics to ASCII converter to make the final result
20347 look similar to the real graphics.
20348 The external material management allows you to do this, because it is parametri
20349 zed on the different export formats that LyX supports.
20352 \begin_layout Standard
20353 Besides supporting the production of different products according to the
20354 exported format, it supports tight integration with editing and viewing
20356 In the case of an Xfig figure, you are able to invoke Xfig on the original
20357 file with a single click from within the external material dialog in LyX,
20358 and also preview the produced PostScript file with Ghostview with another
20360 No more fiddling around with the command line and/or file browsers to locate
20361 and manipulate the original or produced files.
20362 In this way, you are finally able to take full advantage of the many different
20363 applications that are relevant to use when you write your documents, and
20364 ultimately be more productive.
20367 \begin_layout Section
20368 The external template configuration file
20371 \begin_layout Standard
20372 It is relatively easy to add custom external template definitions to LyX.
20373 However, be aware that doing this in an careless manner most probably
20377 introduce an easily exploitable security hole.
20378 So before you do this, please read the discussion about security in section
20380 \begin_inset CommandInset ref
20382 reference "sec:Security-discussion"
20389 \begin_layout Standard
20390 Having said that, we encourage you to submit any interesting templates that
20395 \begin_layout Standard
20396 The external templates are defined in the
20397 \begin_inset Flex Code
20400 \begin_layout Plain Layout
20401 LyXDir/lib/external_templates
20407 You can place your own version in
20408 \begin_inset Flex Code
20411 \begin_layout Plain Layout
20412 UserDir/external_templates
20420 \begin_layout Standard
20421 A typical template looks like this:
20424 \begin_layout LyX-Code
20428 \begin_layout LyX-Code
20429 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
20432 \begin_layout LyX-Code
20436 \begin_layout LyX-Code
20440 \begin_layout LyX-Code
20444 \begin_layout LyX-Code
20448 \begin_layout LyX-Code
20452 \begin_layout LyX-Code
20453 AutomaticProduction true
20456 \begin_layout LyX-Code
20460 \begin_layout LyX-Code
20464 \begin_layout LyX-Code
20468 \begin_layout LyX-Code
20469 TransformCommand Rotate RotationLatexCommand
20472 \begin_layout LyX-Code
20473 TransformCommand Resize ResizeLatexCommand
20476 \begin_layout LyX-Code
20477 Product "$$RotateFront$$ResizeFront
20480 \begin_layout LyX-Code
20485 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
20488 \begin_layout LyX-Code
20489 $$ResizeBack$$RotateBack"
20492 \begin_layout LyX-Code
20496 \begin_layout LyX-Code
20497 UpdateResult "$$AbsPath$$Basename.pstex_t"
20500 \begin_layout LyX-Code
20501 Requirement "graphicx"
20504 \begin_layout LyX-Code
20505 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20508 \begin_layout LyX-Code
20509 ReferencedFile latex "$$AbsPath$$Basename.eps"
20512 \begin_layout LyX-Code
20513 ReferencedFile dvi "$$AbsPath$$Basename.eps"
20516 \begin_layout LyX-Code
20520 \begin_layout LyX-Code
20524 \begin_layout LyX-Code
20525 TransformCommand Rotate RotationLatexCommand
20528 \begin_layout LyX-Code
20529 TransformCommand Resize ResizeLatexCommand
20532 \begin_layout LyX-Code
20533 Product "$$RotateFront$$ResizeFront
20536 \begin_layout LyX-Code
20541 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
20544 \begin_layout LyX-Code
20545 $$ResizeBack$$RotateBack"
20548 \begin_layout LyX-Code
20549 UpdateFormat pdftex
20552 \begin_layout LyX-Code
20553 UpdateResult "$$AbsPath$$Basename.pdftex_t"
20556 \begin_layout LyX-Code
20557 Requirement "graphicx"
20560 \begin_layout LyX-Code
20561 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
20564 \begin_layout LyX-Code
20565 ReferencedFile latex "$$AbsPath$$Basename.pdf"
20568 \begin_layout LyX-Code
20572 \begin_layout LyX-Code
20576 \begin_layout LyX-Code
20577 Product "$$Contents(
20579 "$$AbsPath$$Basename.asc
20584 \begin_layout LyX-Code
20585 UpdateFormat asciixfig
20588 \begin_layout LyX-Code
20589 UpdateResult "$$AbsPath$$Basename.asc"
20592 \begin_layout LyX-Code
20596 \begin_layout LyX-Code
20600 \begin_layout LyX-Code
20601 Product "<graphic fileref=
20603 "$$AbsOrRelPathMaster$$Basename.eps
20608 \begin_layout LyX-Code
20612 \begin_layout LyX-Code
20616 \begin_layout LyX-Code
20617 UpdateResult "$$AbsPath$$Basename.eps"
20620 \begin_layout LyX-Code
20621 ReferencedFile docbook "$$AbsPath$$Basename.eps"
20624 \begin_layout LyX-Code
20625 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
20628 \begin_layout LyX-Code
20632 \begin_layout LyX-Code
20633 Product "[XFig: $$FName]"
20636 \begin_layout LyX-Code
20640 \begin_layout LyX-Code
20644 \begin_layout Standard
20645 As you can see, the template is enclosed in
20646 \begin_inset Flex Code
20649 \begin_layout Plain Layout
20655 \SpecialChar \ldots{}
20657 \begin_inset Flex Code
20660 \begin_layout Plain Layout
20667 It contains a header specifying some general settings and, for each supported
20668 primary document file format, a section
20669 \begin_inset Flex Code
20672 \begin_layout Plain Layout
20678 \SpecialChar \ldots{}
20680 \begin_inset Flex Code
20683 \begin_layout Plain Layout
20692 \begin_layout Subsection
20693 The template header
20696 \begin_layout Description
20697 \begin_inset Flex Code
20700 \begin_layout Plain Layout
20701 AutomaticProduction
20702 \begin_inset space ~
20710 Whether the file represented by the template must be generated by LyX.
20711 This command must occur exactly once.
20714 \begin_layout Description
20715 \begin_inset Flex Code
20718 \begin_layout Plain Layout
20720 \begin_inset space ~
20728 A glob pattern that is used in the file dialog to filter out the desired
20730 If there is more than one possible file extension (e.
20731 \begin_inset space \thinspace{}
20735 \begin_inset space \space{}
20739 \begin_inset Flex Code
20742 \begin_layout Plain Layout
20749 \begin_inset Flex Code
20752 \begin_layout Plain Layout
20758 ), use something like
20759 \begin_inset Flex Code
20762 \begin_layout Plain Layout
20769 This command must occur exactly once.
20772 \begin_layout Description
20773 \begin_inset Flex Code
20776 \begin_layout Plain Layout
20778 \begin_inset space ~
20786 The text that is displayed on the button.
20787 This command must occur exactly once.
20790 \begin_layout Description
20791 \begin_inset Flex Code
20794 \begin_layout Plain Layout
20796 \begin_inset space ~
20800 \begin_inset space ~
20808 The help text that is used in the External dialog.
20809 Provide enough information to explain to the user just what the template
20810 can provide him with.
20811 This command must occur exactly once.
20814 \begin_layout Description
20815 \begin_inset Flex Code
20818 \begin_layout Plain Layout
20820 \begin_inset space ~
20828 The file format of the original file.
20829 This must be the name of a format that is known to LyX (see section
20830 \begin_inset space ~
20834 \begin_inset CommandInset ref
20836 reference "sec:Formats"
20842 \begin_inset Quotes eld
20846 \begin_inset Flex Code
20849 \begin_layout Plain Layout
20856 \begin_inset Quotes erd
20859 if the template can handle original files of more than one format.
20860 LyX will attempt to interrogate the file itself in order to deduce its
20861 format in this case.
20862 This command must occur exactly once.
20865 \begin_layout Description
20866 \begin_inset Flex Code
20869 \begin_layout Plain Layout
20871 \begin_inset space ~
20879 A unique name for the template.
20880 It must not contain substitution macros (see below).
20883 \begin_layout Description
20884 \begin_inset Flex Code
20887 \begin_layout Plain Layout
20889 \begin_inset space ~
20892 Rotate|Resize|Clip|Extra
20897 This command specifies which transformations are supported by this template.
20898 It may occur zero or more times.
20899 This command enables the corresponding tabs in the external dialog.
20901 \begin_inset Flex Code
20904 \begin_layout Plain Layout
20910 command must have either a corresponding
20911 \begin_inset Flex Code
20914 \begin_layout Plain Layout
20921 \begin_inset Flex Code
20924 \begin_layout Plain Layout
20931 \begin_inset Flex Code
20934 \begin_layout Plain Layout
20941 Otherwise the transformation will not be supported by that format.
20944 \begin_layout Subsection
20948 \begin_layout Description
20949 \begin_inset Flex Code
20952 \begin_layout Plain Layout
20954 \begin_inset space ~
20957 LaTeX|PDFLaTeX|PlainText|DocBook
20962 The primary document file format that this format definition is for.
20963 Not every template has a sensible representation in all document file formats.
20964 Please define nevertheless a
20965 \begin_inset Flex Code
20968 \begin_layout Plain Layout
20974 section for all templates.
20975 Use a dummy text when no representation is available.
20976 Then you can at least see a reference to the external material in the exported
20980 \begin_layout Description
20981 \begin_inset Flex Code
20984 \begin_layout Plain Layout
20986 \begin_inset space ~
20990 \begin_inset space ~
20998 This command defines an additional macro
20999 \begin_inset Flex Code
21002 \begin_layout Plain Layout
21008 for substitution in
21009 \begin_inset Flex Code
21012 \begin_layout Plain Layout
21020 \begin_inset Flex Code
21023 \begin_layout Plain Layout
21029 itself may contain substitution macros.
21030 The advantage over using
21031 \begin_inset Flex Code
21034 \begin_layout Plain Layout
21041 \begin_inset Flex Code
21044 \begin_layout Plain Layout
21050 is that the substituted value of
21051 \begin_inset Flex Code
21054 \begin_layout Plain Layout
21060 is sanitized so that it is a valid optional argument in the document format.
21061 This command may occur zero or more times.
21064 \begin_layout Description
21065 \begin_inset Flex Code
21068 \begin_layout Plain Layout
21070 \begin_inset space ~
21078 The text that is inserted in the exported document.
21079 This is actually the most important command and can be quite complex.
21080 This command must occur exactly once.
21083 \begin_layout Description
21084 \begin_inset Flex Code
21087 \begin_layout Plain Layout
21089 \begin_inset space ~
21097 This command specifies a preamble snippet that will be included in the
21099 It has to be defined using
21100 \begin_inset Flex Code
21103 \begin_layout Plain Layout
21109 \SpecialChar \ldots{}
21111 \begin_inset Flex Code
21114 \begin_layout Plain Layout
21121 This command may occur zero or more times.
21124 \begin_layout Description
21125 \begin_inset Flex Code
21128 \begin_layout Plain Layout
21130 \begin_inset space ~
21134 \begin_inset space ~
21142 This command denotes files that are created by the conversion process and
21143 are needed for a particular export format.
21144 If the filename is relative, it is interpreted relative to the master document.
21145 This command may be given zero or more times.
21148 \begin_layout Description
21149 \begin_inset Flex Code
21152 \begin_layout Plain Layout
21154 \begin_inset space ~
21162 The name of a required LaTeX package.
21163 The package is included via
21164 \begin_inset Flex Code
21167 \begin_layout Plain Layout
21175 in the LaTeX preamble.
21176 This command may occur zero or more times.
21179 \begin_layout Description
21180 \begin_inset Flex Code
21183 \begin_layout Plain Layout
21185 \begin_inset space ~
21189 \begin_inset space ~
21192 RotationLatexCommand
21197 This command specifies that the built in LaTeX command should be used for
21199 This command may occur once or not at all.
21202 \begin_layout Description
21203 \begin_inset Flex Code
21206 \begin_layout Plain Layout
21208 \begin_inset space ~
21212 \begin_inset space ~
21220 This command specifies that the built in LaTeX command should be used for
21222 This command may occur once or not at all.
21225 \begin_layout Description
21226 \begin_inset Flex Code
21229 \begin_layout Plain Layout
21231 \begin_inset space ~
21235 \begin_inset space ~
21238 RotationLatexOption
21243 This command specifies that rotation is done via an optional argument.
21244 This command may occur once or not at all.
21247 \begin_layout Description
21248 \begin_inset Flex Code
21251 \begin_layout Plain Layout
21253 \begin_inset space ~
21257 \begin_inset space ~
21265 This command specifies that resizing is done via an optional argument.
21266 This command may occur once or not at all.
21269 \begin_layout Description
21270 \begin_inset Flex Code
21273 \begin_layout Plain Layout
21275 \begin_inset space ~
21279 \begin_inset space ~
21287 This command specifies that clipping is done via an optional argument.
21288 This command may occur once or not at all.
21291 \begin_layout Description
21292 \begin_inset Flex Code
21295 \begin_layout Plain Layout
21297 \begin_inset space ~
21301 \begin_inset space ~
21309 This command specifies that an extra optional argument is used.
21310 This command may occur once or not at all.
21313 \begin_layout Description
21314 \begin_inset Flex Code
21317 \begin_layout Plain Layout
21319 \begin_inset space ~
21327 The file format of the converted file.
21328 This must be the name of a format that is known to LyX (see the
21329 \begin_inset Flex MenuItem
21332 \begin_layout Plain Layout
21337 ools\SpecialChar \menuseparator
21342 references\SpecialChar \menuseparator
21343 File Handling\SpecialChar \menuseparator
21350 This command must occur exactly once.
21353 \begin_layout Description
21354 \begin_inset Flex Code
21357 \begin_layout Plain Layout
21359 \begin_inset space ~
21367 The file name of the converted file.
21368 The file name must be absolute.
21369 This command must occur exactly once.
21372 \begin_layout Subsection
21373 Preamble definitions
21376 \begin_layout Standard
21377 The external template configuration file may contain additional preamble
21378 definitions enclosed by
21379 \begin_inset Flex Code
21382 \begin_layout Plain Layout
21388 \SpecialChar \ldots{}
21390 \begin_inset Flex Code
21393 \begin_layout Plain Layout
21400 They can be used by the templates in the
21401 \begin_inset Flex Code
21404 \begin_layout Plain Layout
21413 \begin_layout Section
21414 The substitution mechanism
21417 \begin_layout Standard
21418 When the external material facility invokes an external program, it is done
21419 on the basis of a command defined in the template configuration file.
21420 These commands can contain various macros that are expanded before execution.
21421 Execution always take place in the directory of the containing document.
21424 \begin_layout Standard
21425 Also, whenever external material is to be displayed, the name will be produced
21426 by the substitution mechanism, and most other commands in the template
21427 definition support substitution as well.
21430 \begin_layout Standard
21431 The available macros are the following:
21434 \begin_layout Description
21435 \begin_inset Flex Code
21438 \begin_layout Plain Layout
21439 $$AbsOrRelPathMaster
21444 The file path, absolute or relative to the master LyX document.
21447 \begin_layout Description
21448 \begin_inset Flex Code
21451 \begin_layout Plain Layout
21452 $$AbsOrRelPathParent
21457 The file path, absolute or relative to the LyX document.
21460 \begin_layout Description
21461 \begin_inset Flex Code
21464 \begin_layout Plain Layout
21470 The absolute file path.
21473 \begin_layout Description
21474 \begin_inset Flex Code
21477 \begin_layout Plain Layout
21483 The filename without path and without the extension.
21486 \begin_layout Description
21487 \begin_inset Flex Code
21490 \begin_layout Plain Layout
21492 \begin_inset Quotes eld
21496 \begin_inset Quotes erd
21504 This macro will expand to the contents of the file with the name
21505 \begin_inset Flex Code
21508 \begin_layout Plain Layout
21517 \begin_layout Description
21518 \begin_inset Flex Code
21521 \begin_layout Plain Layout
21527 The file extension (including the dot).
21530 \begin_layout Description
21531 \begin_inset Flex Code
21534 \begin_layout Plain Layout
21540 The filename of the file specified in the external material dialog.
21541 This is either an absolute name, or it is relative to the LyX document.
21544 \begin_layout Description
21545 \begin_inset Flex Code
21548 \begin_layout Plain Layout
21555 \begin_inset Flex Code
21558 \begin_layout Plain Layout
21564 (absolute name or relative to the LyX document).
21567 \begin_layout Description
21568 \begin_inset Flex Code
21571 \begin_layout Plain Layout
21577 The file path, relative to the master LyX document.
21580 \begin_layout Description
21581 \begin_inset Flex Code
21584 \begin_layout Plain Layout
21590 The file path, relative to the LyX document.
21593 \begin_layout Description
21594 \begin_inset Flex Code
21597 \begin_layout Plain Layout
21603 This macro will expand to the absolute path of the system directory.
21604 This is typically used to point to the various helper scripts that are
21608 \begin_layout Description
21609 \begin_inset Flex Code
21612 \begin_layout Plain Layout
21618 A name and full path to a temporary file which will be automatically deleted
21619 whenever the containing document is closed, or the external material insertion
21623 \begin_layout Standard
21624 All path macros contain a trailing directory separator, so you can construct
21626 \begin_inset space \thinspace{}
21630 \begin_inset space \space{}
21633 the absolute filename with
21634 \begin_inset Flex Code
21637 \begin_layout Plain Layout
21638 $$AbsPath$$Basename$$Extension
21646 \begin_layout Standard
21647 The macros above are substituted in all commands unless otherwise noted.
21649 \begin_inset Flex Code
21652 \begin_layout Plain Layout
21658 supports additionally the following substitutions if they are enabled by
21660 \begin_inset Flex Code
21663 \begin_layout Plain Layout
21670 \begin_inset Flex Code
21673 \begin_layout Plain Layout
21682 \begin_layout Description
21683 \begin_inset Flex Code
21686 \begin_layout Plain Layout
21692 The front part of the resize command.
21695 \begin_layout Description
21696 \begin_inset Flex Code
21699 \begin_layout Plain Layout
21705 The back part of the resize command.
21708 \begin_layout Description
21709 \begin_inset Flex Code
21712 \begin_layout Plain Layout
21718 The front part of the rotation command.
21721 \begin_layout Description
21722 \begin_inset Flex Code
21725 \begin_layout Plain Layout
21731 The back part of the rotation command.
21734 \begin_layout Standard
21735 The value string of the
21736 \begin_inset Flex Code
21739 \begin_layout Plain Layout
21745 command supports additionally the following substitutions if they are enabled
21747 \begin_inset Flex Code
21750 \begin_layout Plain Layout
21757 \begin_inset Flex Code
21760 \begin_layout Plain Layout
21769 \begin_layout Description
21770 \begin_inset Flex Code
21773 \begin_layout Plain Layout
21782 \begin_layout Description
21783 \begin_inset Flex Code
21786 \begin_layout Plain Layout
21795 \begin_layout Description
21796 \begin_inset Flex Code
21799 \begin_layout Plain Layout
21808 \begin_layout Description
21809 \begin_inset Flex Code
21812 \begin_layout Plain Layout
21818 The rotation option.
21821 \begin_layout Standard
21822 You may ask why there are so many path macros.
21823 There are mainly two reasons:
21826 \begin_layout Enumerate
21827 Relative and absolute file names should remain relative or absolute, respectivel
21829 Users may have reasons to prefer either form.
21830 Relative names are useful for portable documents that should work on different
21831 machines, for example.
21832 Absolute names may be required by some programs.
21835 \begin_layout Enumerate
21836 LaTeX treats relative file names differently than LyX and other programs
21837 in nested included files.
21838 For LyX, a relative file name is always relative to the document that contains
21840 For LaTeX, it is always relative to the master document.
21841 These two definitions are identical if you have only one document, but
21842 differ if you have a master document that includes part documents.
21843 That means that relative filenames must be transformed when presented to
21845 Fortunately LyX does this automatically for you if you choose the right
21849 \begin_layout Standard
21850 So which path macro should be used in new template definitions? The rule
21854 \begin_layout Itemize
21856 \begin_inset Flex Code
21859 \begin_layout Plain Layout
21865 if an absolute path is required.
21868 \begin_layout Itemize
21870 \begin_inset Flex Code
21873 \begin_layout Plain Layout
21874 $$AbsOrRelPathMaster
21879 if the substituted string is some kind of LaTeX input.
21882 \begin_layout Itemize
21884 \begin_inset Flex Code
21887 \begin_layout Plain Layout
21888 $$AbsOrRelPathParent
21893 in order to preserve the user's choice.
21896 \begin_layout Standard
21897 There are special cases where this rule does not work and e.
21898 \begin_inset space \thinspace{}
21902 \begin_inset space \space{}
21905 relative names are needed, but normally it will work just fine.
21906 One example for such a case is the command
21907 \begin_inset Flex Code
21910 \begin_layout Plain Layout
21911 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
21916 in the XFig template above: We can't use the absolute name because the
21918 \begin_inset Flex Code
21921 \begin_layout Plain Layout
21927 files needs the relative name in order to rewrite the file content.
21930 \begin_layout Section
21931 Security discussion
21932 \begin_inset CommandInset label
21934 name "sec:Security-discussion"
21941 \begin_layout Standard
21942 The external material feature interfaces with a lot of external programs
21943 and does so automatically, so we have to consider the security implications
21945 In particular, since you have the option of including your own filenames
21946 and/or parameter strings and those are expanded into a command, it seems
21947 that it would be possible to create a malicious document which executes
21948 arbitrary commands when a user views or prints the document.
21949 This is something we definitely want to avoid.
21952 \begin_layout Standard
21953 However, since the external program commands are specified in the template
21954 configuration file only, there are no security issues if LyX is properly
21955 configured with safe templates only.
21956 This is so because the external programs are invoked with the
21957 \begin_inset Flex Code
21960 \begin_layout Plain Layout
21966 -system call rather than the
21967 \begin_inset Flex Code
21970 \begin_layout Plain Layout
21976 system-call, so it's not possible to execute arbitrary commands from the
21977 filename or parameter section via the shell.
21980 \begin_layout Standard
21981 This also implies that you are restricted in what command strings you can
21982 use in the external material templates.
21983 In particular, pipes and redirection are not readily available.
21984 This has to be so if LyX should remain safe.
21985 If you want to use some of the shell features, you should write a safe
21986 script to do this in a controlled manner, and then invoke the script from
21987 the command string.
21991 \begin_layout Standard
21992 It is possible to design a template that interacts directly with the shell,
21993 but since this would allow a malicious user to execute arbitrary commands
21994 by writing clever filenames and/or parameters, we generally recommend that
21995 you only use safe scripts that work with the
21996 \begin_inset Flex Code
21999 \begin_layout Plain Layout
22005 system call in a controlled manner.
22006 Of course, for use in a controlled environment, it can be tempting to just
22007 fall back to use ordinary shell scripts.
22008 If you do so, be aware that you
22012 provide an easily exploitable security hole in your system.
22013 Of course it stands to reason that such unsafe templates will never be
22014 included in the standard LyX distribution, although we do encourage people
22015 to submit new templates in the open source tradition.
22016 But LyX as shipped from the official distribution channels will never have
22020 \begin_layout Standard
22021 Including external material provides a lot of power, and you have to be
22022 careful not to introduce security hazards with this power.
22023 A subtle error in a single line in an innocent looking script can open
22024 the door to huge security problems.
22025 So if you do not fully understand the issues, we recommend that you consult
22026 a knowledgeable security professional or the LyX development team if you
22027 have any questions about whether a given template is safe or not.
22028 And do this before you use it in an uncontrolled environment.