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
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.)
10217 \begin_layout Description
10218 \begin_inset Flex Code
10221 \begin_layout Plain Layout
10227 Note that this will completely override any prior
10228 \begin_inset Flex Code
10231 \begin_layout Plain Layout
10237 declaration for this style.
10239 \begin_inset Quotes eld
10243 \begin_inset Flex Code
10246 \begin_layout Plain Layout
10253 \begin_inset Quotes erd
10258 \begin_inset CommandInset ref
10260 reference "sub:I18n"
10264 for details on its use.
10267 \begin_layout Description
10268 \begin_inset Flex Code
10271 \begin_layout Plain Layout
10278 \begin_inset Flex Code
10281 \begin_layout Plain Layout
10291 \begin_layout Plain Layout
10292 Note that a `float' here is a real number, such as: 1.5.
10297 The vertical space with which the last of a chain of paragraphs with this
10298 style is separated from the following paragraph.
10299 If the next paragraph has another style, the separations are not simply
10300 added, but the maximum is taken.
10303 \begin_layout Description
10304 \begin_inset Flex Code
10307 \begin_layout Plain Layout
10314 \begin_inset Flex Code
10317 \begin_layout Plain Layout
10323 The category for this style.
10324 This is used to group related styles in the style combobox on the toolbar.
10325 Any string can be used, but you may want to use existing categories with
10330 \begin_layout Description
10331 \begin_inset Flex Code
10334 \begin_layout Plain Layout
10340 Depth of XML command.
10341 Used only with XML-type formats.
10344 \begin_layout Description
10345 \begin_inset Flex Code
10348 \begin_layout Plain Layout
10355 \begin_inset Flex Code
10358 \begin_layout Plain Layout
10364 Copies all the features of an existing style into the current one.
10368 \begin_layout Description
10369 \begin_inset Flex Code
10372 \begin_layout Plain Layout
10378 The name of a style whose preamble should be output
10383 This allows to ensure some ordering of the preamble snippets when macros
10384 definitions depend on one another.
10388 \begin_layout Plain Layout
10389 Note that, besides that functionality, there is no way to ensure any ordering
10391 The ordering that you see in a given version of LyX may change without
10392 warning in later versions.
10400 \begin_layout Description
10401 \begin_inset Flex Code
10404 \begin_layout Plain Layout
10411 \begin_inset Flex Code
10414 \begin_layout Plain Layout
10419 , Box, Filled_Box, Static
10424 ] The type of label that stands at the end of the paragraph (or sequence
10426 \begin_inset Flex Code
10429 \begin_layout Plain Layout
10436 \begin_inset Flex Code
10439 \begin_layout Plain Layout
10446 \begin_inset Flex Code
10449 \begin_layout Plain Layout
10456 \begin_inset Flex Code
10459 \begin_layout Plain Layout
10467 \begin_inset Flex Code
10470 \begin_layout Plain Layout
10477 \begin_inset Quotes eld
10481 \begin_inset Quotes erd
10485 \begin_inset Flex Code
10488 \begin_layout Plain Layout
10495 \begin_inset Flex Code
10498 \begin_layout Plain Layout
10499 \begin_inset space ~
10507 ) is a white (resp.
10508 \begin_inset space ~
10511 black) square suitable for end of proof markers,
10512 \begin_inset Flex Code
10515 \begin_layout Plain Layout
10521 is an explicit text string.
10524 \begin_layout Description
10525 \begin_inset Flex Code
10528 \begin_layout Plain Layout
10535 \begin_inset Flex Code
10538 \begin_layout Plain Layout
10544 ] The string used for a label with a
10545 \begin_inset Flex Code
10548 \begin_layout Plain Layout
10555 \begin_inset Flex Code
10558 \begin_layout Plain Layout
10568 \begin_layout Description
10569 \begin_inset Flex Code
10572 \begin_layout Plain Layout
10578 The font used for both the text body
10584 \begin_inset space ~
10588 \begin_inset CommandInset ref
10590 reference "sub:Font-description"
10595 Note that defining this font automatically defines the
10596 \begin_inset Flex Code
10599 \begin_layout Plain Layout
10606 So you should define this one first if you also want to define
10607 \begin_inset Flex Code
10610 \begin_layout Plain Layout
10619 \begin_layout Description
10620 \begin_inset Flex Code
10623 \begin_layout Plain Layout
10630 \begin_inset CommandInset label
10632 name "des:FreeSpacing"
10637 \begin_inset Flex Code
10640 \begin_layout Plain Layout
10649 \begin_inset Flex Code
10652 \begin_layout Plain Layout
10658 ] Usually LyX doesn't allow you to insert more than one space between words,
10659 since a space is considered as the separation between two words, not a
10660 character or symbol of its own.
10661 This is a very fine thing but sometimes annoying, for example, when typing
10662 program code or plain LaTeX code.
10664 \begin_inset Flex Code
10667 \begin_layout Plain Layout
10674 Note that LyX will create protected blanks for the additional blanks when
10675 in another mode than LaTeX-mode.
10678 \begin_layout Description
10679 \begin_inset Flex Code
10682 \begin_layout Plain Layout
10688 These tags are used with XHTML output.
10690 \begin_inset CommandInset ref
10692 reference "sub:Paragraph-Style-XHTML"
10699 \begin_layout Description
10700 \begin_inset Flex Code
10703 \begin_layout Plain Layout
10709 [[FIXME]] (Used only with XML-type formats.)
10712 \begin_layout Description
10713 \begin_inset Flex Code
10716 \begin_layout Plain Layout
10723 \begin_inset Flex Code
10726 \begin_layout Plain Layout
10732 If 1, marks the style as to be included in the document preamble rather
10733 than in the document body.
10734 This is useful for document classes that want such information as the title
10735 and author to appear in the preamble.
10736 Note that this works only for styles for which the
10737 \begin_inset Flex Code
10740 \begin_layout Plain Layout
10747 \begin_inset Flex Code
10750 \begin_layout Plain Layout
10757 \begin_inset Flex Code
10760 \begin_layout Plain Layout
10769 \begin_layout Description
10770 \begin_inset Flex Code
10773 \begin_layout Plain Layout
10780 \begin_inset Flex Code
10783 \begin_layout Plain Layout
10789 If 1, marks the style as being part of a title block (see also the
10790 \begin_inset Flex Code
10793 \begin_layout Plain Layout
10800 \begin_inset Flex Code
10803 \begin_layout Plain Layout
10812 \begin_layout Description
10813 \begin_inset Flex Code
10816 \begin_layout Plain Layout
10823 \begin_inset Flex Code
10826 \begin_layout Plain Layout
10832 ] This provides extra space between paragraphs that have the same style.
10833 If you put other styles into an environment, each is separated with the
10835 \begin_inset Flex Code
10838 \begin_layout Plain Layout
10845 But the whole items of the environment are additionally separated with
10847 \begin_inset Flex Code
10850 \begin_layout Plain Layout
10857 Note that this is a
10862 \begin_layout Description
10863 \begin_inset Flex Code
10866 \begin_layout Plain Layout
10872 [[FIXME]] (Used only with XML-type formats.)
10875 \begin_layout Description
10876 \begin_inset Flex Code
10879 \begin_layout Plain Layout
10886 \begin_inset Flex Code
10889 \begin_layout Plain Layout
10898 \begin_inset Flex Code
10901 \begin_layout Plain Layout
10907 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10908 lead to empty LaTeX output.
10909 There are some cases where this could be desirable however: in a letter
10910 template, the required fields can be provided as empty fields, so that
10911 people do not forget them; in some special classes, a style can be used
10912 as some kind of break, which does not contain actual text.
10915 \begin_layout Description
10916 \begin_inset Flex Code
10919 \begin_layout Plain Layout
10925 [float=0] The vertical space between the label and the text body.
10926 Only used for labels that are above the text body (
10927 \begin_inset Flex Code
10930 \begin_layout Plain Layout
10937 \begin_inset Flex Code
10940 \begin_layout Plain Layout
10941 Centered_Top_Environment
10949 \begin_layout Description
10950 \begin_inset Flex Code
10953 \begin_layout Plain Layout
10960 \begin_inset Flex Code
10963 \begin_layout Plain Layout
10970 \begin_inset Newline newline
10973 The name of the counter for automatic numbering.
10975 \begin_inset Newline newline
10983 \begin_inset Flex Code
10986 \begin_layout Plain Layout
10993 \begin_inset Flex Code
10996 \begin_layout Plain Layout
11003 In that case, the counter will be stepped each time the style appears.
11005 \begin_inset Newline newline
11013 \begin_inset Flex Code
11016 \begin_layout Plain Layout
11023 \begin_inset Flex Code
11026 \begin_layout Plain Layout
11032 , though this case is a bit complicated.
11033 Suppose you declare
11034 \begin_inset Quotes eld
11038 \begin_inset Flex Code
11041 \begin_layout Plain Layout
11042 LabelCounter myenum
11048 \begin_inset Quotes erd
11052 Then the actual counters used are
11053 \begin_inset Flex Code
11056 \begin_layout Plain Layout
11063 \begin_inset Flex Code
11066 \begin_layout Plain Layout
11073 \begin_inset Flex Code
11076 \begin_layout Plain Layout
11083 \begin_inset Flex Code
11086 \begin_layout Plain Layout
11092 , much as in LaTeX.
11093 These counters must all be declared separately.
11094 \begin_inset Newline newline
11098 \begin_inset CommandInset ref
11100 reference "sub:Counters"
11104 for details on counters.
11107 \begin_layout Description
11108 \begin_inset Flex Code
11111 \begin_layout Plain Layout
11117 The font used for the label.
11119 \begin_inset space ~
11123 \begin_inset CommandInset ref
11125 reference "sub:Font-description"
11132 \begin_layout Description
11133 \begin_inset Flex Code
11136 \begin_layout Plain Layout
11142 Text that indicates how far a label should be indented.
11145 \begin_layout Description
11146 \begin_inset Flex Code
11149 \begin_layout Plain Layout
11156 \begin_inset Flex Code
11159 \begin_layout Plain Layout
11165 ] The horizontal space between the label and the text body.
11166 Only used for labels that are not above the text body.
11169 \begin_layout Description
11170 \begin_inset Flex Code
11173 \begin_layout Plain Layout
11180 \begin_inset Flex Code
11183 \begin_layout Plain Layout
11189 ] The string used for a label with a
11190 \begin_inset Flex Code
11193 \begin_layout Plain Layout
11201 \begin_inset Flex Code
11204 \begin_layout Plain Layout
11210 is set, this string can be contain the special formatting commands described
11212 \begin_inset CommandInset ref
11214 reference "sub:Counters"
11222 \begin_layout Plain Layout
11223 For the sake of backwards compatibility, the string
11224 \begin_inset Flex Code
11227 \begin_layout Plain Layout
11237 will be replaced by the expanded
11238 \begin_inset Flex Code
11241 \begin_layout Plain Layout
11248 \begin_inset Flex Code
11251 \begin_layout Plain Layout
11260 This feature is now obsolete and should be replaced by the mechanisms of
11262 \begin_inset CommandInset ref
11264 reference "sub:Counters"
11276 \begin_layout Description
11277 \begin_inset Flex Code
11280 \begin_layout Plain Layout
11281 LabelStringAppendix
11287 \begin_inset Flex Code
11290 \begin_layout Plain Layout
11296 ] This is used inside the appendix instead of
11297 \begin_inset Flex Code
11300 \begin_layout Plain Layout
11308 \begin_inset Flex Code
11311 \begin_layout Plain Layout
11318 \begin_inset Flex Code
11321 \begin_layout Plain Layout
11322 LabelStringAppendix
11330 \begin_layout Description
11331 \begin_inset Flex Code
11334 \begin_layout Plain Layout
11340 [FIXME] (Used only with XML-type formats.)
11343 \begin_layout Description
11344 \begin_inset Flex Code
11347 \begin_layout Plain Layout
11354 \begin_inset Flex Code
11357 \begin_layout Plain Layout
11362 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
11363 Enumerate, Itemize, Bibliography
11372 \begin_layout Itemize
11373 \begin_inset Flex Code
11376 \begin_layout Plain Layout
11382 means the label is the very first word (up to the first real blank).
11383 Use protected spaces (like
11384 \begin_inset space ~
11387 that one) if you want more than one word as the label.
11391 \begin_layout Itemize
11392 \begin_inset Flex Code
11395 \begin_layout Plain Layout
11401 means the label is simply whatever
11402 \begin_inset Flex Code
11405 \begin_layout Plain Layout
11412 Note that this really is `static'.
11415 \begin_layout Itemize
11416 \begin_inset Flex Code
11419 \begin_layout Plain Layout
11426 \begin_inset Flex Code
11429 \begin_layout Plain Layout
11430 Centered_Top_Environment
11435 are special cases of
11436 \begin_inset Flex Code
11439 \begin_layout Plain Layout
11446 The label will be printed above the paragraph, but only at the top of an
11447 environment or the top of a chain of paragraphs with this style.
11448 This might be used with the
11449 \begin_inset Flex MenuItem
11452 \begin_layout Plain Layout
11458 style, for example.
11461 \begin_layout Itemize
11462 \begin_inset Flex Code
11465 \begin_layout Plain Layout
11471 is a special case for the caption-labels
11472 \begin_inset Quotes eld
11476 \begin_inset Quotes erd
11480 \begin_inset Quotes eld
11484 \begin_inset Quotes erd
11489 \begin_inset Flex Code
11492 \begin_layout Plain Layout
11498 means the (hardcoded) label string depends on the kind of float: It is
11499 hardcoded to be `FloatType N', where N is the value of the counter associated
11503 \begin_layout Itemize
11505 \begin_inset Flex Code
11508 \begin_layout Plain Layout
11514 label type defines automatically numbered labels.
11516 \begin_inset Flex Code
11519 \begin_layout Plain Layout
11525 will be expanded to resolve any counter references it contains: For example,
11527 \begin_inset Quotes eld
11531 \begin_inset Flex Code
11534 \begin_layout Plain Layout
11545 \begin_inset Quotes erd
11550 \begin_inset CommandInset ref
11552 reference "sub:Counters"
11556 for more information on counters.
11559 \begin_layout Itemize
11560 \begin_inset Flex Code
11563 \begin_layout Plain Layout
11569 produces the usual sort of enumeration labels.
11570 At present, it is hardcoded to use Arabic numerals, lowercase letters,
11571 small Roman numerals, and uppercase letters for the four possible depths.
11574 \begin_layout Itemize
11575 \begin_inset Flex Code
11578 \begin_layout Plain Layout
11584 produces various bullets at the different levels.
11585 It is also hardcoded.
11588 \begin_layout Itemize
11589 \begin_inset Flex Code
11592 \begin_layout Plain Layout
11598 is used internally by LyX and should be used only with
11599 \begin_inset Flex Code
11602 \begin_layout Plain Layout
11603 LatexType BibEnvironment
11612 \begin_layout Description
11613 \begin_inset Flex Code
11616 \begin_layout Plain Layout
11622 Note that this will completely override any prior
11623 \begin_inset Flex Code
11626 \begin_layout Plain Layout
11632 declaration for this style.
11634 \begin_inset Quotes eld
11638 \begin_inset Flex Code
11641 \begin_layout Plain Layout
11648 \begin_inset Quotes erd
11653 \begin_inset CommandInset ref
11655 reference "sub:I18n"
11659 for details on its use.
11662 \begin_layout Description
11663 \begin_inset Flex Code
11666 \begin_layout Plain Layout
11672 The name of the corresponding LaTeX stuff.
11673 Either the environment or command name.
11676 \begin_layout Description
11677 \begin_inset Flex Code
11680 \begin_layout Plain Layout
11686 An optional parameter for the corresponding
11687 \begin_inset Flex Code
11690 \begin_layout Plain Layout
11697 This parameter cannot be changed from within LyX.
11700 \begin_layout Description
11701 \begin_inset Flex Code
11704 \begin_layout Plain Layout
11711 \begin_inset Flex Code
11714 \begin_layout Plain Layout
11719 , Command, Environment, Item_Environment,
11725 \begin_inset Flex Code
11728 \begin_layout Plain Layout
11729 List_Environment, Bib_Environment
11734 ] How the style should be translated into LaTeX.
11738 \begin_layout Plain Layout
11739 \begin_inset Flex Code
11742 \begin_layout Plain Layout
11748 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11749 Visit the SGML class files for specific examples.
11758 \begin_layout Itemize
11759 \begin_inset Flex Code
11762 \begin_layout Plain Layout
11768 means nothing special.
11772 \begin_layout Itemize
11773 \begin_inset Flex Code
11776 \begin_layout Plain Layout
11783 \begin_inset Flex Code
11786 \begin_layout Plain Layout
11793 {\SpecialChar \ldots{}
11802 \begin_layout Itemize
11803 \begin_inset Flex Code
11806 \begin_layout Plain Layout
11813 \begin_inset Flex Code
11816 \begin_layout Plain Layout
11823 }\SpecialChar \ldots{}
11839 \begin_layout Itemize
11840 \begin_inset Flex Code
11843 \begin_layout Plain Layout
11850 \begin_inset Flex Code
11853 \begin_layout Plain Layout
11860 \begin_inset Flex Code
11863 \begin_layout Plain Layout
11871 is generated for each paragraph of this environment.
11875 \begin_layout Itemize
11876 \begin_inset Flex Code
11879 \begin_layout Plain Layout
11886 \begin_inset Flex Code
11889 \begin_layout Plain Layout
11896 \begin_inset Flex Code
11899 \begin_layout Plain Layout
11905 is passed as an argument to the environment.
11907 \begin_inset Flex Code
11910 \begin_layout Plain Layout
11916 can be defined in the
11917 \begin_inset Flex MenuItem
11920 \begin_layout Plain Layout
11921 Edit\SpecialChar \menuseparator
11923 \begin_inset space ~
11935 \begin_layout Standard
11936 Putting the last few things together, the LaTeX output will be either:
11939 \begin_layout LyX-Code
11942 latexname[latexparam]{\SpecialChar \ldots{}
11946 \begin_layout Standard
11950 \begin_layout LyX-Code
11953 begin{latexname}[latexparam] \SpecialChar \ldots{}
11959 \begin_layout Standard
11960 depending upon the LaTeX type.
11964 \begin_layout Description
11965 \begin_inset Flex Code
11968 \begin_layout Plain Layout
11975 \begin_inset Flex Code
11978 \begin_layout Plain Layout
11984 ] If you put styles into environments, the leftmargins are not simply added,
11985 but added with a factor
11986 \begin_inset Formula $\frac{4}{depth+4}$
11990 Note that this parameter is also used when the margin is defined as
11991 \begin_inset Flex Code
11994 \begin_layout Plain Layout
12001 \begin_inset Flex Code
12004 \begin_layout Plain Layout
12011 Then it is added to the manual or dynamic margin.
12013 \begin_inset Newline newline
12016 The argument is passed as a string.
12018 \begin_inset Quotes eld
12022 \begin_inset Flex Code
12025 \begin_layout Plain Layout
12032 \begin_inset Quotes erd
12035 means that the paragraph is indented with the width of
12036 \begin_inset Quotes eld
12040 \begin_inset Flex Code
12043 \begin_layout Plain Layout
12050 \begin_inset Quotes erd
12053 in the normal font.
12054 You can get a negative width by prefixing the string with
12055 \begin_inset Quotes eld
12059 \begin_inset Flex Code
12062 \begin_layout Plain Layout
12069 \begin_inset Quotes erd
12073 This way was chosen so that the look is the same with each used screen
12078 \begin_layout Description
12079 \begin_inset Flex Code
12082 \begin_layout Plain Layout
12089 \begin_inset Flex Code
12092 \begin_layout Plain Layout
12097 , Manual, Dynamic, First_Dynamic, Right_Address_Box
12103 \begin_inset Newline newline
12106 The kind of margin that the style has on the left side.
12108 \begin_inset Flex Code
12111 \begin_layout Plain Layout
12117 just means a fixed margin.
12119 \begin_inset Flex Code
12122 \begin_layout Plain Layout
12128 means that the left margin depends on the string entered in the
12129 \begin_inset Flex MenuItem
12132 \begin_layout Plain Layout
12133 Edit\SpecialChar \menuseparator
12135 \begin_inset space ~
12144 This is used to typeset nice lists without tabulators.
12146 \begin_inset Flex Code
12149 \begin_layout Plain Layout
12155 means that the margin depends on the size of the label.
12156 This is used for automatic enumerated headlines.
12157 It is obvious that the headline
12158 \begin_inset Quotes eld
12161 5.4.3.2.1 Very long headline
12162 \begin_inset Quotes erd
12165 must have a wider left margin (as wide as
12166 \begin_inset Quotes eld
12170 \begin_inset Quotes erd
12173 plus the space) than
12174 \begin_inset Quotes eld
12177 3.2 Very long headline
12178 \begin_inset Quotes erd
12182 \begin_inset Quotes eld
12186 \begin_inset Quotes erd
12189 are not able to do this.
12191 \begin_inset Flex Code
12194 \begin_layout Plain Layout
12200 is similar, but only the very first row of the paragraph is dynamic, while
12201 the others are static; this is used, for example, for descriptions.
12203 \begin_inset Flex Code
12206 \begin_layout Plain Layout
12212 means the margin is chosen in a way that the longest row of this paragraph
12213 fits to the right margin.
12214 This is used to typeset an address on the right edge of the page.
12217 \begin_layout Description
12218 \begin_inset Flex Code
12221 \begin_layout Plain Layout
12228 \begin_inset Flex Code
12231 \begin_layout Plain Layout
12240 \begin_inset Flex Code
12243 \begin_layout Plain Layout
12249 ] Whether fragile commands in this style should be
12250 \begin_inset Flex Code
12253 \begin_layout Plain Layout
12266 whether this command should itself be protected.)
12269 \begin_layout Description
12270 \begin_inset Flex Code
12273 \begin_layout Plain Layout
12280 \begin_inset Flex Code
12283 \begin_layout Plain Layout
12290 \begin_inset Flex Code
12293 \begin_layout Plain Layout
12301 ] Whether newlines are translated into LaTeX newlines (
12302 \begin_inset Flex Code
12305 \begin_layout Plain Layout
12316 The translation can be switched off to allow more comfortable LaTeX editing
12320 \begin_layout Description
12321 \begin_inset Flex Code
12324 \begin_layout Plain Layout
12331 \begin_inset Flex Code
12334 \begin_layout Plain Layout
12341 \begin_inset Flex Code
12344 \begin_layout Plain Layout
12352 ] If set to true, and if
12353 \begin_inset Flex Code
12356 \begin_layout Plain Layout
12363 \begin_inset Flex Code
12366 \begin_layout Plain Layout
12372 ) paragraphs are being indented, then the indentation of such a paragraph
12373 following one of this type will be suppressed.
12374 (So this will not affect the display of non-default paragraphs.)
12377 \begin_layout Description
12378 \begin_inset Flex Code
12381 \begin_layout Plain Layout
12387 Name of a style that has replaced this style.
12388 This is used to rename a style, while keeping backward compatibility.
12391 \begin_layout Description
12392 \begin_inset Flex Code
12395 \begin_layout Plain Layout
12402 \begin_inset Flex Code
12405 \begin_layout Plain Layout
12411 ] The number of optional arguments that can be used with this style.
12412 This is useful for things like section headings, and only makes sense with
12414 Note that, on output, the optional arguments will all precede any required
12415 arguments (see below).
12416 So one can have constructs like:
12420 \begin_layout LyX-Code
12423 mycmd[opt1]{req1}{contents of paragraph}
12426 \begin_layout Standard
12427 but one cannot have things like:
12430 \begin_layout LyX-Code
12433 mycmd[opt1]{req1}[opt2]{contents of paragraph}
12436 \begin_layout Standard
12437 at least, not without ERT (with which you can have anything).
12442 \begin_layout Description
12443 \begin_inset Flex Code
12446 \begin_layout Plain Layout
12453 \begin_inset Flex Code
12456 \begin_layout Plain Layout
12465 \begin_inset Flex Code
12468 \begin_layout Plain Layout
12474 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
12475 output, but only by a line break; together with
12476 \begin_inset Flex Code
12479 \begin_layout Plain Layout
12485 , this allows to emulate a plain text editor (like the ERT inset).
12488 \begin_layout Description
12489 \begin_inset Flex Code
12492 \begin_layout Plain Layout
12499 \begin_inset Flex Code
12502 \begin_layout Plain Layout
12508 ] The indent of the very first line of a paragraph.
12510 \begin_inset Flex Code
12513 \begin_layout Plain Layout
12519 will be fixed for a certain style.
12520 The exception is the default style, since the indentation for these paragraphs
12521 can be prohibited with
12522 \begin_inset Flex Code
12525 \begin_layout Plain Layout
12533 \begin_inset Flex Code
12536 \begin_layout Plain Layout
12542 style paragraphs inside environments use the
12543 \begin_inset Flex Code
12546 \begin_layout Plain Layout
12552 of the environment, not their native one.
12554 \begin_inset Flex Code
12557 \begin_layout Plain Layout
12563 paragraphs inside an enumeration are not indented.
12566 \begin_layout Description
12567 \begin_inset Flex Code
12570 \begin_layout Plain Layout
12577 \begin_inset Flex Code
12580 \begin_layout Plain Layout
12586 ] The vertical space between two paragraphs of this style.
12589 \begin_layout Description
12590 \begin_inset Flex Code
12593 \begin_layout Plain Layout
12600 \begin_inset Flex Code
12603 \begin_layout Plain Layout
12609 ] LyX allows the user to choose either
12610 \begin_inset Quotes eld
12614 \begin_inset Quotes erd
12618 \begin_inset Quotes eld
12622 \begin_inset Quotes erd
12625 to typeset a document.
12627 \begin_inset Quotes eld
12631 \begin_inset Quotes erd
12634 is chosen, this value is completely ignored.
12636 \begin_inset Quotes eld
12640 \begin_inset Quotes erd
12643 is chosen, the parindent of a LaTeXtype
12644 \begin_inset Quotes eld
12648 \begin_inset Quotes erd
12651 style is ignored and all paragraphs are separated by this parskip argument.
12652 The vertical space is calculated with
12653 \begin_inset Flex Code
12656 \begin_layout Plain Layout
12658 \begin_inset space ~
12667 \begin_inset Flex Code
12670 \begin_layout Plain Layout
12676 is the height of a row with the normal font.
12677 This way, the look stays the same with different screen fonts.
12680 \begin_layout Description
12681 \begin_inset Flex Code
12684 \begin_layout Plain Layout
12691 \begin_inset Flex Code
12694 \begin_layout Plain Layout
12703 \begin_inset Flex Code
12706 \begin_layout Plain Layout
12712 ] Whether the contents of this paragraph should be output in raw form, meaning
12713 without special translations that LaTeX would require.
12716 \begin_layout Description
12717 \begin_inset Flex Code
12720 \begin_layout Plain Layout
12726 Information to be included in the LaTeX preamble when this style is used.
12727 Used to define macros, load packages, etc., required by this particular
12730 \begin_inset Quotes eld
12734 \begin_inset Flex Code
12737 \begin_layout Plain Layout
12744 \begin_inset Quotes erd
12750 \begin_layout Description
12751 \begin_inset Flex Code
12754 \begin_layout Plain Layout
12761 \begin_inset Flex Code
12764 \begin_layout Plain Layout
12770 ] The prefix to use when creating labels referring to paragraphs of this
12772 This allows the use of formatted references.
12775 \begin_layout Description
12776 \begin_inset Flex Code
12779 \begin_layout Plain Layout
12786 \begin_inset Flex Code
12789 \begin_layout Plain Layout
12795 ] The number of required arguments that the LaTeX command or environment
12796 corresponding to this style expects.
12797 In the case of a command, these are required arguments
12801 that associated with the content of the paragraph itself.
12802 These do not actually have to be provided: LyX will output empty arguments
12804 Note that optional arguments will be output before required arguments.
12805 See the discussion of the
12806 \begin_inset Flex Code
12809 \begin_layout Plain Layout
12815 tag above for more information.
12818 \begin_layout Description
12819 \begin_inset Flex Code
12822 \begin_layout Plain Layout
12829 \begin_inset Flex Code
12832 \begin_layout Plain Layout
12838 ] Whether the style requires the feature
12839 \begin_inset Flex Code
12842 \begin_layout Plain Layout
12849 See the description of
12850 \begin_inset Flex Code
12853 \begin_layout Plain Layout
12860 \begin_inset CommandInset ref
12861 LatexCommand pageref
12862 reference "des:FreeSpacing"
12866 ) for information on `features'.
12870 \begin_layout Description
12871 \begin_inset Flex Code
12874 \begin_layout Plain Layout
12881 \begin_inset Flex Code
12884 \begin_layout Plain Layout
12891 \begin_inset Flex Code
12894 \begin_layout Plain Layout
12903 \begin_layout Description
12904 \begin_inset Flex Code
12907 \begin_layout Plain Layout
12914 \begin_inset Flex Code
12917 \begin_layout Plain Layout
12922 , onehalf, double, other
12931 ] This defines what the default spacing should be in the style.
12933 \begin_inset Flex Code
12936 \begin_layout Plain Layout
12943 \begin_inset Flex Code
12946 \begin_layout Plain Layout
12953 \begin_inset Flex Code
12956 \begin_layout Plain Layout
12962 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12963 If you specify the argument
12964 \begin_inset Flex Code
12967 \begin_layout Plain Layout
12973 , then you should also provide a numerical argument which will be the actual
12975 Note that, contrary to other parameters,
12976 \begin_inset Flex Code
12979 \begin_layout Plain Layout
12985 implies the generation of specific LaTeX code, using the package
12988 \begin_inset Flex Code
12991 \begin_layout Plain Layout
13000 \begin_layout Description
13001 \begin_inset Flex Code
13004 \begin_layout Plain Layout
13011 \begin_inset Flex Code
13014 \begin_layout Plain Layout
13021 \begin_inset Flex Code
13024 \begin_layout Plain Layout
13032 ] Spellcheck paragraphs of this style.
13036 \begin_layout Description
13037 \begin_inset Flex Code
13040 \begin_layout Plain Layout
13046 The font used for the text body .
13048 \begin_inset CommandInset ref
13050 reference "sub:Font-description"
13057 \begin_layout Description
13058 \begin_inset Flex Code
13061 \begin_layout Plain Layout
13070 \begin_inset Flex Code
13073 \begin_layout Plain Layout
13083 The level of the style in the table of contents.
13084 This is used for automatic numbering of section headings.
13087 \begin_layout Description
13088 \begin_inset Flex Code
13091 \begin_layout Plain Layout
13098 \begin_inset Flex Code
13101 \begin_layout Plain Layout
13107 ] The vertical space with which the very first of a chain of paragraphs
13108 with this style is separated from the previous paragraph.
13109 If the previous paragraph has another style, the separations are not simply
13110 added, but the maximum is taken.
13113 \begin_layout Subsection
13114 \begin_inset CommandInset label
13120 Internationalization of Paragraph Styles
13123 \begin_layout Standard
13124 LyX has long supported internationalization of layout information, but,
13125 until version 2.0, this applied only to the user interface and not to, say,
13127 Thus, French authors were forced to resort to ugly hacks if they wanted
13132 1' instead of `Theorem 1'.
13133 Thanks to Georg Baum, that is no longer the case.
13136 \begin_layout Standard
13138 \begin_inset Flex Code
13141 \begin_layout Plain Layout
13147 defines text that is to appear in the typeset document, it may use
13148 \begin_inset Flex Code
13151 \begin_layout Plain Layout
13158 \begin_inset Flex Code
13161 \begin_layout Plain Layout
13167 to support non-English and even multi-language documents correctly.
13168 The following excerpt (from the
13169 \begin_inset Flex Code
13172 \begin_layout Plain Layout
13178 file) shows how this works:
13181 \begin_layout LyX-Code
13186 \begin_layout LyX-Code
13189 theoremstyle{remark}
13192 \begin_layout LyX-Code
13195 newtheorem{claim}[thm]{
13202 \begin_layout LyX-Code
13206 \begin_layout LyX-Code
13210 \begin_layout LyX-Code
13215 claimname}{_(Claim)}
13218 \begin_layout LyX-Code
13222 \begin_layout LyX-Code
13226 \begin_layout LyX-Code
13235 claimname}{_(Claim)}}
13238 \begin_layout LyX-Code
13243 \begin_layout Standard
13244 In principle, any legal LaTeX may appear in the
13245 \begin_inset Flex Code
13248 \begin_layout Plain Layout
13255 \begin_inset Flex Code
13258 \begin_layout Plain Layout
13264 tags, but in practice they will typically look as they do here.
13265 The key to correct translation of the typeset text is the definition of
13267 \begin_inset Flex Code
13270 \begin_layout Plain Layout
13279 \begin_inset Flex Code
13282 \begin_layout Plain Layout
13294 \begin_layout Standard
13296 \begin_inset Flex Code
13299 \begin_layout Plain Layout
13305 tag provides for internationalization based upon the overall language of
13307 The contents of the tag will be included in the preamble, just as with
13309 \begin_inset Flex Code
13312 \begin_layout Plain Layout
13319 What makes it special is the use of the
13320 \begin_inset Quotes eld
13324 \begin_inset Quotes erd
13328 \begin_inset Flex Code
13331 \begin_layout Plain Layout
13337 , which will be replaced, when LyX produces LaTeX output, with the translation
13338 of its argument into the document language.
13341 \begin_layout Standard
13343 \begin_inset Flex Code
13346 \begin_layout Plain Layout
13352 tag is more complex, since it is meant to provide support for multi-language
13353 documents and so offers an interface to the
13354 \begin_inset Flex Code
13357 \begin_layout Plain Layout
13364 Its contents will be added to the preamble once for each language that
13365 appears in the document.
13366 In this case, the argument to
13367 \begin_inset Flex Code
13370 \begin_layout Plain Layout
13376 will be replaced with its translation into the language in question; the
13378 \begin_inset Flex Code
13381 \begin_layout Plain Layout
13387 is replaced by the language name (as used by the babel package).
13390 \begin_layout Standard
13391 A German document that also included a French section would thus have the
13392 following in the preamble:
13395 \begin_layout LyX-Code
13404 claimname}{Affirmation}}
13412 claimname}{Behauptung}}
13416 claimname}{Behauptung}
13419 \begin_layout Standard
13421 \begin_inset Flex Code
13424 \begin_layout Plain Layout
13430 will then conspire to produce the correct text in the output.
13433 \begin_layout Standard
13434 One important point to note here is that the translations are provided by
13435 LyX itself, through the
13436 \change_inserted -195340706 1334775793
13438 \begin_inset Flex Code
13441 \begin_layout Plain Layout
13443 \change_inserted -195340706 1334775793
13450 \change_deleted -195340706 1334775793
13451 same mechanism it uses for internationalization of the user interface
13454 This means, in effect, that
13455 \begin_inset Flex Code
13458 \begin_layout Plain Layout
13465 \begin_inset Flex Code
13468 \begin_layout Plain Layout
13474 are really only of use in layout files that are provided with LyX, since
13475 text entered in user-created layout files will not be seen by LyX's internation
13477 \change_inserted -195340706 1334775793
13479 \begin_inset Flex Code
13482 \begin_layout Plain Layout
13484 \change_inserted -195340706 1334775793
13490 file is modified accordingly
13493 That said, however, any layout created with the intention that it will
13494 be included with LyX should use these tags where appropriate.
13496 \change_inserted -195340706 1334775793
13497 Please note that the paragraph style translations provided by LyX will
13498 never change with a minor update (e.g.
13499 from version 2.1.x to 2.1.y).
13500 It is however quite likely that a major update (e.g.
13501 from 2.0.x to 2.1.y) will introduce new translations or corrections.
13506 \begin_layout Subsection
13508 \begin_inset CommandInset label
13517 \begin_layout Standard
13518 Since version 1.3.0 of LyX, it is has been both possible and necessary to
13519 define the floats (
13520 \begin_inset Flex MenuItem
13523 \begin_layout Plain Layout
13530 \begin_inset Flex MenuItem
13533 \begin_layout Plain Layout
13539 , \SpecialChar \ldots{}
13540 ) in the text class itself.
13541 Standard floats are included in the file
13542 \begin_inset Flex Code
13545 \begin_layout Plain Layout
13551 , so you may have to do no more than add
13554 \begin_layout LyX-Code
13555 Input stdfloats.inc
13558 \begin_layout Standard
13559 to your layout file.
13560 If you want to implement a text class that proposes some other float types
13561 (like the AGU class bundled with LyX), the information below will hopefully
13565 \begin_layout Description
13566 \begin_inset Flex Code
13569 \begin_layout Plain Layout
13576 \begin_inset Flex Code
13579 \begin_layout Plain Layout
13586 \begin_inset Quotes erd
13590 \begin_inset Quotes erd
13593 ] The file name extension of an auxiliary file for the list of figures (or
13595 LaTeX writes the captions to this file.
13598 \begin_layout Description
13599 \begin_inset Flex Code
13602 \begin_layout Plain Layout
13609 \begin_inset Flex Code
13612 \begin_layout Plain Layout
13619 \begin_inset Quotes erd
13623 \begin_inset Quotes erd
13626 ] The string that will be used in the menus and also for the caption.
13627 This is translated to the current language if babel is used.
13630 \begin_layout Description
13631 \begin_inset Flex Code
13634 \begin_layout Plain Layout
13640 These are used for XHTML output.
13642 \begin_inset CommandInset ref
13644 reference "sec:Tags-for-XHTML"
13651 \begin_layout Description
13652 \begin_inset Flex Code
13655 \begin_layout Plain Layout
13664 \begin_inset Flex Code
13667 \begin_layout Plain Layout
13676 \begin_inset Flex Code
13679 \begin_layout Plain Layout
13685 ] Indicates whether the float is already defined in the document class or
13686 if we instead need to load
13687 \begin_inset Flex Code
13690 \begin_layout Plain Layout
13696 and use what it provides to define it on-the-fly.
13698 \begin_inset Flex Code
13701 \begin_layout Plain Layout
13708 \begin_inset Flex Code
13711 \begin_layout Plain Layout
13718 It should be set to
13719 \begin_inset Flex Code
13722 \begin_layout Plain Layout
13728 if the float is already defined by the LaTeX document class.
13731 \begin_layout Description
13732 \begin_inset Flex Code
13735 \begin_layout Plain Layout
13742 \begin_inset Flex Code
13745 \begin_layout Plain Layout
13752 \begin_inset Quotes erd
13756 \begin_inset Quotes erd
13759 ] The command used to generate a list of floats of this type; the leading
13762 ' should be omitted.
13768 \begin_inset Flex Code
13771 \begin_layout Plain Layout
13777 is false, since there is no standard way to generate this command.
13779 \begin_inset Flex Code
13782 \begin_layout Plain Layout
13788 is true, since in that case there is a standard way to define the command.
13791 \begin_layout Description
13792 \begin_inset Flex Code
13795 \begin_layout Plain Layout
13802 \begin_inset Flex Code
13805 \begin_layout Plain Layout
13812 \begin_inset Quotes erd
13816 \begin_inset Quotes erd
13819 ] A title for a list of floats of this kind (list of figures, tables, or
13821 It is used for the screen label within LyX; it is passed to LaTeX for use
13822 as the title there; and it is used as the title in XHTML output.
13823 It will be translated to the document language.
13826 \begin_layout Description
13827 \begin_inset Flex Code
13830 \begin_layout Plain Layout
13837 \begin_inset Flex Code
13840 \begin_layout Plain Layout
13847 \begin_inset Quotes erd
13851 \begin_inset Quotes erd
13854 ] This (optional) argument determines whether floats of this class will
13855 be numbered within some sectional unit of the document.
13856 For example, if within is equal to
13857 \begin_inset Flex Code
13860 \begin_layout Plain Layout
13866 , the floats will be numbered within chapters.
13870 \begin_layout Description
13871 \begin_inset Flex Code
13874 \begin_layout Plain Layout
13881 \begin_inset Flex Code
13884 \begin_layout Plain Layout
13891 \begin_inset Quotes erd
13895 \begin_inset Quotes erd
13898 ] The default placement for the given class of floats.
13899 The string should be as in standard LaTeX:
13900 \begin_inset Flex Code
13903 \begin_layout Plain Layout
13910 \begin_inset Flex Code
13913 \begin_layout Plain Layout
13920 \begin_inset Flex Code
13923 \begin_layout Plain Layout
13930 \begin_inset Flex Code
13933 \begin_layout Plain Layout
13939 for top, bottom, page, and here, respectively.
13943 \begin_layout Plain Layout
13944 Note that the order of these letters in the string is irrelevant, like in
13950 On top of that there is a new type,
13951 \begin_inset Flex Code
13954 \begin_layout Plain Layout
13960 , which does not really correspond to a float, since it means: put it
13961 \begin_inset Quotes eld
13965 \begin_inset Quotes erd
13969 Note however that the
13970 \begin_inset Flex Code
13973 \begin_layout Plain Layout
13979 specifier is special and, because of implementation details, cannot be
13980 used in non-built in float types.
13981 If you do not understand what this means, just use
13982 \begin_inset Quotes eld
13986 \begin_inset Flex Code
13989 \begin_layout Plain Layout
13996 \begin_inset Quotes erd
14002 \begin_layout Description
14003 \begin_inset Flex Code
14006 \begin_layout Plain Layout
14013 \begin_inset Flex Code
14016 \begin_layout Plain Layout
14022 ] The prefix to use when creating labels referring to floats of this type.
14023 This allows the use of formatted references.
14024 Note that you can remove any
14025 \begin_inset Flex Code
14028 \begin_layout Plain Layout
14034 set by a copied style by using the special value
14035 \begin_inset Quotes eld
14039 \begin_inset Quotes erd
14042 , which must be all caps.
14045 \begin_layout Description
14046 \begin_inset Flex Code
14049 \begin_layout Plain Layout
14056 \begin_inset Flex Code
14059 \begin_layout Plain Layout
14066 \begin_inset Quotes erd
14070 \begin_inset Quotes erd
14073 ] The style used when defining the float using
14074 \begin_inset Flex Code
14077 \begin_layout Plain Layout
14088 \begin_layout Description
14089 \begin_inset Flex Code
14092 \begin_layout Plain Layout
14099 \begin_inset Flex Code
14102 \begin_layout Plain Layout
14109 \begin_inset Quotes erd
14113 \begin_inset Quotes erd
14117 \begin_inset Quotes eld
14121 \begin_inset Quotes erd
14124 of the new class of floats, like program or algorithm.
14125 After the appropriate
14126 \begin_inset Flex Code
14129 \begin_layout Plain Layout
14138 \begin_inset Flex Code
14141 \begin_layout Plain Layout
14150 \begin_inset Flex Code
14153 \begin_layout Plain Layout
14164 \begin_layout Description
14165 \begin_inset Flex Code
14168 \begin_layout Plain Layout
14175 \begin_inset Flex Code
14178 \begin_layout Plain Layout
14185 \begin_inset Flex Code
14188 \begin_layout Plain Layout
14196 ] Tells us whether this float is defined using the facilities provided by
14198 \begin_inset Flex Code
14201 \begin_layout Plain Layout
14207 , either by the class file or a package, or on-the-fly by LyX itself.
14210 \begin_layout Standard
14211 Note that defining a float with type
14212 \begin_inset Flex Code
14215 \begin_layout Plain Layout
14223 automatically defines the corresponding counter with name
14224 \begin_inset Flex Code
14227 \begin_layout Plain Layout
14238 \begin_layout Subsection
14239 Flex insets and InsetLayout
14240 \begin_inset CommandInset label
14242 name "sub:Flex-insets-and"
14249 \begin_layout Standard
14250 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
14251 these are called Flex insets.
14255 \begin_layout Standard
14256 Flex insets come in three different kinds:
14259 \begin_layout Itemize
14261 \begin_inset Flex Code
14264 \begin_layout Plain Layout
14270 ): These define semantic markup corresponding to such LaTeX commands as
14272 \begin_inset Flex Code
14275 \begin_layout Plain Layout
14284 \begin_inset Flex Code
14287 \begin_layout Plain Layout
14298 \begin_layout Itemize
14300 \begin_inset Flex Code
14303 \begin_layout Plain Layout
14309 ): These can be used to define custom collapsible insets, similar to TeX
14310 code, footnote, and the like.
14311 An obvious example is an endnote inset, which is defined in the
14312 \begin_inset Flex Code
14315 \begin_layout Plain Layout
14324 \begin_layout Itemize
14326 \begin_inset Flex Code
14329 \begin_layout Plain Layout
14335 ): For use with DocBook classes.
14338 \begin_layout Standard
14339 Flex insets are defined using the
14340 \begin_inset Flex Code
14343 \begin_layout Plain Layout
14349 tag, which shall be explained in a moment.
14352 \begin_layout Standard
14354 \begin_inset Flex Code
14357 \begin_layout Plain Layout
14363 tag also serves another function: It can be used to customize the general
14364 layout of many different types of insets.
14366 \begin_inset Flex Code
14369 \begin_layout Plain Layout
14375 can be used to customize the layout parameters for footnotes, marginal
14376 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
14377 boxes, tables, algorithms, URLs, and optional arguments, as well as to
14378 define Flex insets.
14381 \begin_layout Standard
14383 \begin_inset Flex Code
14386 \begin_layout Plain Layout
14392 definition must begin with a line of the form:
14395 \begin_layout LyX-Code
14399 \begin_layout Standard
14401 \begin_inset Flex Code
14404 \begin_layout Plain Layout
14410 indicates the inset whose layout is being defined, and here there are
14411 \change_inserted 5863208 1334489266
14413 \change_deleted 5863208 1334489267
14419 \begin_layout Enumerate
14420 The layout for a pre-existing inset is being modified.
14421 In this case, can be
14422 \begin_inset Flex Code
14425 \begin_layout Plain Layout
14431 any one of the following:
14432 \begin_inset Flex Code
14435 \begin_layout Plain Layout
14442 \begin_inset Flex Code
14445 \begin_layout Plain Layout
14452 \begin_inset Flex Code
14455 \begin_layout Plain Layout
14462 \begin_inset Flex Code
14465 \begin_layout Plain Layout
14472 \begin_inset Flex Code
14475 \begin_layout Plain Layout
14482 \begin_inset Flex Code
14485 \begin_layout Plain Layout
14492 \begin_inset Flex Code
14495 \begin_layout Plain Layout
14502 \begin_inset Flex Code
14505 \begin_layout Plain Layout
14512 \begin_inset Flex Code
14515 \begin_layout Plain Layout
14522 \begin_inset Flex Code
14525 \begin_layout Plain Layout
14532 \begin_inset Flex Code
14535 \begin_layout Plain Layout
14542 \begin_inset Flex Code
14545 \begin_layout Plain Layout
14552 \begin_inset Flex Code
14555 \begin_layout Plain Layout
14562 \begin_inset Flex Code
14565 \begin_layout Plain Layout
14572 \begin_inset Flex Code
14575 \begin_layout Plain Layout
14582 \begin_inset Flex Code
14585 \begin_layout Plain Layout
14592 \begin_inset Flex Code
14595 \begin_layout Plain Layout
14602 \begin_inset Flex Code
14605 \begin_layout Plain Layout
14612 \begin_inset Flex Code
14615 \begin_layout Plain Layout
14622 \begin_inset Flex Code
14625 \begin_layout Plain Layout
14634 \begin_layout Enumerate
14635 The layout for a Flex inset is being defined.
14637 \begin_inset Flex Code
14640 \begin_layout Plain Layout
14646 must be of the form
14647 \begin_inset Quotes eld
14651 \begin_inset Flex Code
14654 \begin_layout Plain Layout
14661 \begin_inset Quotes erd
14665 \begin_inset Flex Code
14668 \begin_layout Plain Layout
14674 may be be any valid identifier not used by a pre-existing Flex inset.
14675 The identifier may include spaces, but in that case the whole thing must
14676 be wrapped in quotes.
14677 Note that the definition of a flex inset
14682 \begin_inset Flex Code
14685 \begin_layout Plain Layout
14691 entry, declaring which type of inset it defines.
14692 \change_inserted 5863208 1334489312
14696 \begin_layout Enumerate
14698 \change_inserted 5863208 1334492248
14699 The layout for user specific branch is being defined.
14701 \begin_inset Flex Code
14704 \begin_layout Plain Layout
14706 \change_inserted 5863208 1334489384
14712 must be of the form
14713 \begin_inset Quotes eld
14717 \begin_inset Flex Code
14720 \begin_layout Plain Layout
14722 \change_inserted 5863208 1334489392
14729 \begin_inset Quotes erd
14733 \begin_inset Flex Code
14736 \begin_layout Plain Layout
14738 \change_inserted 5863208 1334489384
14744 may be be any valid identifier of branch defined in user's document.
14745 The identifier may include spaces, but in that case the whole thing must
14746 be wrapped in quotes.
14747 The main purpose of this feature is to allow LaTeX wrapping around specific
14748 branches as user needs.
14753 \begin_layout Standard
14755 \begin_inset Flex Code
14758 \begin_layout Plain Layout
14764 definition can contain the following entries:
14767 \begin_layout Description
14769 \change_inserted -195340706 1333913893
14770 \begin_inset Flex Code
14773 \begin_layout Plain Layout
14779 Preamble for changing languages.
14781 \begin_inset space ~
14785 \begin_inset CommandInset ref
14787 reference "sub:I18n"
14794 \begin_layout Description
14795 \begin_inset Flex Code
14798 \begin_layout Plain Layout
14804 The color for the inset's background.
14805 The valid colors are defined in
14806 \begin_inset Flex Code
14809 \begin_layout Plain Layout
14818 \begin_layout Description
14819 \begin_inset Flex Code
14822 \begin_layout Plain Layout
14829 \begin_inset Flex Code
14832 \begin_layout Plain Layout
14841 \begin_inset Flex Code
14844 \begin_layout Plain Layout
14850 ] Whether to use the content of the inset as the label, when the inset is
14855 \begin_layout Description
14856 \begin_inset Flex Code
14859 \begin_layout Plain Layout
14866 \begin_inset Flex Code
14869 \begin_layout Plain Layout
14875 Copies all the features of an existing style into the current one.
14879 \begin_layout Description
14880 \begin_inset Flex Code
14883 \begin_layout Plain Layout
14890 \begin_inset Flex Code
14893 \begin_layout Plain Layout
14902 \begin_inset Flex Code
14905 \begin_layout Plain Layout
14911 ] Indicates whether the user may employ the Paragraph Settings dialog to
14912 customize the paragraph.
14915 \begin_layout Description
14916 \begin_inset Flex Code
14919 \begin_layout Plain Layout
14926 \begin_inset Flex Code
14929 \begin_layout Plain Layout
14936 \begin_inset Flex Code
14939 \begin_layout Plain Layout
14946 \begin_inset Flex Code
14949 \begin_layout Plain Layout
14955 , describing the rendering style used for the inset's frame and buttons.
14956 Footnotes generally use
14957 \begin_inset Flex Code
14960 \begin_layout Plain Layout
14966 , ERT insets generally
14967 \begin_inset Flex Code
14970 \begin_layout Plain Layout
14976 , and character styles
14977 \begin_inset Flex Code
14980 \begin_layout Plain Layout
14989 \begin_layout Description
14990 \begin_inset Flex Code
14993 \begin_layout Plain Layout
15000 \begin_inset Flex Code
15003 \begin_layout Plain Layout
15010 \begin_inset Flex Code
15013 \begin_layout Plain Layout
15022 \begin_inset Flex Code
15025 \begin_layout Plain Layout
15032 \begin_inset Flex Code
15035 \begin_layout Plain Layout
15042 Indicates whether the environment will stand on its own in LaTeX output
15043 or will appear inline with the surrounding text.
15044 If set to false, it is supposed that the LaTeX environment ignores white
15045 space (including one newline character) after the
15046 \begin_inset Flex Code
15049 \begin_layout Plain Layout
15062 \begin_inset Flex Code
15065 \begin_layout Plain Layout
15081 \begin_layout Description
15082 \begin_inset Flex Code
15085 \begin_layout Plain Layout
15091 Required at the end of the InsetLayout declarations.
15094 \begin_layout Description
15095 \begin_inset Flex Code
15098 \begin_layout Plain Layout
15104 The font used for both the text body
15110 \begin_inset space ~
15114 \begin_inset CommandInset ref
15116 reference "sub:Font-description"
15121 Note that defining this font automatically defines the
15122 \begin_inset Flex Code
15125 \begin_layout Plain Layout
15131 to the same value, so define this first and define
15132 \begin_inset Flex Code
15135 \begin_layout Plain Layout
15141 later if you want them to be different.
15144 \begin_layout Description
15145 \begin_inset Flex Code
15148 \begin_layout Plain Layout
15155 \begin_inset Quotes eld
15159 \begin_inset Quotes erd
15162 language, leading to Left-to-Right (latin) output, e.
15163 \begin_inset space \thinspace{}
15167 \begin_inset space \space{}
15170 in TeX code or URL.
15174 \begin_layout Description
15175 \begin_inset Flex Code
15178 \begin_layout Plain Layout
15185 \begin_inset Flex Code
15188 \begin_layout Plain Layout
15197 \begin_inset Flex Code
15200 \begin_layout Plain Layout
15206 ] Indicates whether the
15207 \begin_inset Flex Code
15210 \begin_layout Plain Layout
15216 should be used or, instead, the user can change the paragraph style used
15221 \begin_layout Description
15222 \begin_inset Flex Code
15225 \begin_layout Plain Layout
15232 \begin_inset Flex Code
15235 \begin_layout Plain Layout
15244 \begin_inset Flex Code
15247 \begin_layout Plain Layout
15253 ] Usually LyX doesn't allow you to insert more than one space between words,
15254 since a space is considered as the separation between two words, not a
15255 character or symbol of its own.
15256 This is a very fine thing but sometimes annoying, for example, when typing
15257 program code or plain LaTeX code.
15259 \begin_inset Flex Code
15262 \begin_layout Plain Layout
15269 Note that LyX will create protected blanks for the additional blanks when
15270 in another mode than LaTeX-mode.
15274 \begin_layout Description
15275 \begin_inset Flex Code
15278 \begin_layout Plain Layout
15284 These tags control XHTML output.
15286 \begin_inset CommandInset ref
15288 reference "sec:Tags-for-XHTML"
15295 \begin_layout Description
15296 \begin_inset Flex Code
15299 \begin_layout Plain Layout
15306 \begin_inset Flex Code
15309 \begin_layout Plain Layout
15318 \begin_inset Flex Code
15321 \begin_layout Plain Layout
15327 ] Whether to include the contents of this inset in the strings generated
15328 for the `Outline' pane.
15329 One would not, for example, want the content of a footnote in a section
15330 header to be included in the TOC displayed in the outline, but one would
15331 normally want the content of a character style displayed.
15332 Default is false: not to include.
15335 \begin_layout Description
15336 \begin_inset Flex Code
15339 \begin_layout Plain Layout
15346 \begin_inset Flex Code
15349 \begin_layout Plain Layout
15358 \begin_inset Flex Code
15361 \begin_layout Plain Layout
15367 ] Usually LyX does not allow you to leave a paragraph empty, since it would
15368 lead to empty LaTeX output.
15369 There are some cases where this could be desirable however: in a letter
15370 template, the required fields can be provided as empty fields, so that
15371 people do not forget them; in some special classes, a style can be used
15372 as some kind of break, which does not contain actual text.
15376 \begin_layout Description
15377 \begin_inset Flex Code
15380 \begin_layout Plain Layout
15386 The font used for the label.
15388 \begin_inset space ~
15392 \begin_inset CommandInset ref
15394 reference "sub:Font-description"
15399 Note that this definition can never appear before
15400 \begin_inset Flex Code
15403 \begin_layout Plain Layout
15409 , lest it be ineffective.
15412 \begin_layout Description
15413 \begin_inset Flex Code
15416 \begin_layout Plain Layout
15422 What will be displayed on the button or elsewhere as the inset label.
15424 \begin_inset Flex Code
15427 \begin_layout Plain Layout
15434 \begin_inset Flex Code
15437 \begin_layout Plain Layout
15443 ) modify this label on the fly.
15446 \begin_layout Description
15448 \change_inserted -195340706 1333913893
15449 \begin_inset Flex Code
15452 \begin_layout Plain Layout
15458 Language dependent preamble.
15460 \begin_inset space ~
15464 \begin_inset CommandInset ref
15466 reference "sub:I18n"
15473 \begin_layout Description
15474 \begin_inset Flex Code
15477 \begin_layout Plain Layout
15483 The name of the corresponding LaTeX stuff.
15484 Either the environment or command name.
15487 \begin_layout Description
15488 \begin_inset Flex Code
15491 \begin_layout Plain Layout
15497 The optional parameter for the corresponding
15498 \begin_inset Flex Code
15501 \begin_layout Plain Layout
15507 stuff, including possible bracket pairs like
15508 \begin_inset Flex Code
15511 \begin_layout Plain Layout
15518 This parameter cannot be changed from within LyX.
15521 \begin_layout Description
15522 \begin_inset Flex Code
15525 \begin_layout Plain Layout
15532 \begin_inset Flex Code
15535 \begin_layout Plain Layout
15540 , Command, Environment, Item_Environment,
15546 \begin_inset Flex Code
15549 \begin_layout Plain Layout
15550 List_Environment, Bib_Environment
15555 ] How the style should be translated into LaTeX.
15559 \begin_layout Plain Layout
15560 \begin_inset Flex Code
15563 \begin_layout Plain Layout
15569 is perhaps a bit misleading, since these rules apply to SGML classes, too.
15570 Visit the SGML class files for specific examples.
15579 \begin_layout Itemize
15580 \begin_inset Flex Code
15583 \begin_layout Plain Layout
15589 means nothing special.
15593 \begin_layout Itemize
15594 \begin_inset Flex Code
15597 \begin_layout Plain Layout
15604 \begin_inset Flex Code
15607 \begin_layout Plain Layout
15614 {\SpecialChar \ldots{}
15623 \begin_layout Itemize
15624 \begin_inset Flex Code
15627 \begin_layout Plain Layout
15634 \begin_inset Flex Code
15637 \begin_layout Plain Layout
15644 }\SpecialChar \ldots{}
15660 \begin_layout Itemize
15661 \begin_inset Flex Code
15664 \begin_layout Plain Layout
15671 \begin_inset Flex Code
15674 \begin_layout Plain Layout
15681 \begin_inset Flex Code
15684 \begin_layout Plain Layout
15692 is generated for each paragraph of this environment.
15696 \begin_layout Itemize
15697 \begin_inset Flex Code
15700 \begin_layout Plain Layout
15707 \begin_inset Flex Code
15710 \begin_layout Plain Layout
15717 \begin_inset Flex Code
15720 \begin_layout Plain Layout
15726 is passed as an argument to the environment.
15728 \begin_inset Flex Code
15731 \begin_layout Plain Layout
15737 can be defined in the
15738 \begin_inset Flex MenuItem
15741 \begin_layout Plain Layout
15746 \SpecialChar \menuseparator
15752 \begin_inset space ~
15764 \begin_layout Standard
15765 Putting the last few things together, the LaTeX output will be either:
15768 \begin_layout LyX-Code
15771 latexname[latexparam]{\SpecialChar \ldots{}
15775 \begin_layout Standard
15779 \begin_layout LyX-Code
15782 begin{latexname}[latexparam] \SpecialChar \ldots{}
15788 \begin_layout Standard
15789 depending upon the LaTeX type.
15793 \begin_layout Description
15794 \begin_inset Flex Code
15797 \begin_layout Plain Layout
15804 \begin_inset Flex Code
15807 \begin_layout Plain Layout
15814 \begin_inset Flex Code
15817 \begin_layout Plain Layout
15824 \begin_inset Flex Code
15827 \begin_layout Plain Layout
15834 \begin_inset Flex Code
15837 \begin_layout Plain Layout
15843 (indicating a dummy definition ending definitions of charstyles, etc).
15844 This entry is required in and is only meaningful for Flex insets.
15845 Among other things, it determines on which menu this inset will appear.
15847 \begin_inset Flex Code
15850 \begin_layout Plain Layout
15857 \begin_inset Flex Code
15860 \begin_layout Plain Layout
15867 \begin_inset Flex Code
15870 \begin_layout Plain Layout
15878 \begin_inset Flex Code
15881 \begin_layout Plain Layout
15887 can be set to true for charstyle insets, if you wish, by setting it
15892 \begin_inset Flex Code
15895 \begin_layout Plain Layout
15904 \begin_layout Description
15905 \begin_inset Flex Code
15908 \begin_layout Plain Layout
15915 \begin_inset Flex Code
15918 \begin_layout Plain Layout
15927 \begin_inset Flex Code
15930 \begin_layout Plain Layout
15936 ] Whether multiple paragraphs are permitted in this inset.
15938 \begin_inset Flex Code
15941 \begin_layout Plain Layout
15947 to the same value and
15948 \begin_inset Flex Code
15951 \begin_layout Plain Layout
15957 to the opposite value.
15958 These can be reset to other values, if they are used
15963 \begin_inset Flex Code
15966 \begin_layout Plain Layout
15976 \begin_layout Description
15977 \begin_inset Flex Code
15980 \begin_layout Plain Layout
15987 \begin_inset Flex Code
15990 \begin_layout Plain Layout
15999 \begin_inset Flex Code
16002 \begin_layout Plain Layout
16008 ] Whether fragile commands in this inset should be
16009 \begin_inset Flex Code
16012 \begin_layout Plain Layout
16025 whether the command should itself be protected.) Default is false.
16028 \begin_layout Description
16029 \begin_inset Flex Code
16032 \begin_layout Plain Layout
16039 \begin_inset Flex Code
16042 \begin_layout Plain Layout
16051 \begin_inset Flex Code
16054 \begin_layout Plain Layout
16060 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
16061 output, but only by a line break; together with
16062 \begin_inset Flex Code
16065 \begin_layout Plain Layout
16071 , this allows to emulate a plain text editor (like the ERT inset).
16075 \begin_layout Description
16076 \begin_inset Flex Code
16079 \begin_layout Plain Layout
16086 \begin_inset Flex Code
16089 \begin_layout Plain Layout
16098 \begin_inset Flex Code
16101 \begin_layout Plain Layout
16107 ] Whether the contents of this paragraph should be output in raw form, meaning
16108 without special translations that LaTeX would require.
16111 \begin_layout Description
16112 \begin_inset Flex Code
16115 \begin_layout Plain Layout
16121 Information to be included in the LaTeX preamble when this style is used.
16122 Used to define macros, load packages, etc., required by this particular
16125 \begin_inset Quotes eld
16129 \begin_inset Flex Code
16132 \begin_layout Plain Layout
16139 \begin_inset Quotes erd
16145 \begin_layout Description
16146 \begin_inset Flex Code
16149 \begin_layout Plain Layout
16156 \begin_inset Flex Code
16159 \begin_layout Plain Layout
16165 ] The prefix to use when creating labels referring to insets of this type.
16166 This allows the use of formatted references.
16169 \begin_layout Description
16170 \begin_inset Flex Code
16173 \begin_layout Plain Layout
16180 \begin_inset Flex Code
16183 \begin_layout Plain Layout
16189 ] Whether the style requires the feature
16190 \begin_inset Flex Code
16193 \begin_layout Plain Layout
16200 See the description of
16201 \begin_inset Flex Code
16204 \begin_layout Plain Layout
16211 \begin_inset CommandInset ref
16212 LatexCommand pageref
16213 reference "des:FreeSpacing"
16217 ) for information on `features'.
16221 \begin_layout Description
16222 \begin_inset Flex Code
16225 \begin_layout Plain Layout
16232 \begin_inset Flex Code
16235 \begin_layout Plain Layout
16242 \begin_inset Flex Code
16245 \begin_layout Plain Layout
16253 ] Whether this inset should use the font of its surrounding environment
16255 Default is true: uses its own.
16258 \begin_layout Description
16259 \begin_inset Flex Code
16262 \begin_layout Plain Layout
16269 \begin_inset Flex Code
16272 \begin_layout Plain Layout
16279 \begin_inset Flex Code
16282 \begin_layout Plain Layout
16290 ] Spellcheck the contents of this inset.
16294 \begin_layout Subsection
16296 \begin_inset CommandInset label
16298 name "sub:Counters"
16305 \begin_layout Standard
16306 Since version 1.3.0 of LyX, it is both possible and necessary to define the
16308 \begin_inset Flex MenuItem
16311 \begin_layout Plain Layout
16318 \begin_inset Flex MenuItem
16321 \begin_layout Plain Layout
16327 , \SpecialChar \ldots{}
16328 ) in the text class itself.
16329 The standard counters are defined in the file
16330 \begin_inset Flex Code
16333 \begin_layout Plain Layout
16339 , so you may have to do no more than add
16342 \begin_layout LyX-Code
16343 Input stdcounters.inc
16346 \begin_layout Standard
16347 to your layout file to get them to work.
16348 But if you want to define custom counters, then you can do so.
16349 The counter declaration must begin with:
16352 \begin_layout LyX-Code
16353 Counter CounterName
16356 \begin_layout Standard
16358 \begin_inset Flex Code
16361 \begin_layout Plain Layout
16367 ' is replaced by the name of the counter.
16368 And it must end with
16369 \begin_inset Quotes eld
16373 \begin_inset Flex Code
16376 \begin_layout Plain Layout
16383 \begin_inset Quotes erd
16387 The following parameters can also be used:
16390 \begin_layout Description
16391 \begin_inset Flex Code
16394 \begin_layout Plain Layout
16401 \begin_inset Flex Code
16404 \begin_layout Plain Layout
16411 \begin_inset Quotes erd
16415 \begin_inset Quotes erd
16418 ] When defined, this string defines how the counter is displayed.
16419 Setting this value sets
16420 \begin_inset Flex Code
16423 \begin_layout Plain Layout
16424 LabelStringAppendix
16430 The following special constructs can be used in the string:
16434 \begin_layout Itemize
16435 \begin_inset Flex Code
16438 \begin_layout Plain Layout
16446 will be replaced by the expansion of the
16447 \begin_inset Flex Code
16450 \begin_layout Plain Layout
16457 \begin_inset Flex Code
16460 \begin_layout Plain Layout
16461 LabelStringAppendix
16467 \begin_inset Flex Code
16470 \begin_layout Plain Layout
16480 \begin_layout Itemize
16481 counter values can be expressed using LaTeX-like macros
16482 \begin_inset Flex Code
16485 \begin_layout Plain Layout
16502 \begin_inset Flex Code
16505 \begin_layout Plain Layout
16517 \begin_layout Plain Layout
16527 Actually, the situation is a bit more complicated: any
16546 other than those described below will produce arabic numerals.
16547 It would not be surprising to see this change in the future.
16553 \begin_inset Flex Code
16556 \begin_layout Plain Layout
16562 : 1, 2, 3,\SpecialChar \ldots{}
16564 \begin_inset Flex Code
16567 \begin_layout Plain Layout
16573 for lower-case letters: a, b, c, \SpecialChar \ldots{}
16575 \begin_inset Flex Code
16578 \begin_layout Plain Layout
16584 for upper-case letters: A, B, C, \SpecialChar \ldots{}
16586 \begin_inset Flex Code
16589 \begin_layout Plain Layout
16595 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
16597 \begin_inset Flex Code
16600 \begin_layout Plain Layout
16606 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
16608 \begin_inset Flex Code
16611 \begin_layout Plain Layout
16617 for hebrew numerals.
16621 \begin_layout Standard
16622 If LabelString is not defined, a default value is constructed as follows:
16623 if the counter has a master counter
16624 \begin_inset Flex Code
16627 \begin_layout Plain Layout
16634 \begin_inset Flex Code
16637 \begin_layout Plain Layout
16644 \begin_inset Flex Code
16647 \begin_layout Plain Layout
16657 is used; otherwise the string
16658 \begin_inset Flex Code
16661 \begin_layout Plain Layout
16672 \begin_layout Description
16673 \begin_inset Flex Code
16676 \begin_layout Plain Layout
16677 LabelStringAppendix
16683 \begin_inset Flex Code
16686 \begin_layout Plain Layout
16693 \begin_inset Quotes erd
16697 \begin_inset Quotes erd
16701 \begin_inset Flex Code
16704 \begin_layout Plain Layout
16710 , but for use in the Appendix.
16713 \begin_layout Description
16714 \begin_inset Flex Code
16717 \begin_layout Plain Layout
16724 \begin_inset Flex Code
16727 \begin_layout Plain Layout
16734 \begin_inset Quotes erd
16738 \begin_inset Quotes erd
16741 ] A format for use with formatted references to this counter.
16742 For example, one might want to have references to section numbers appear
16744 \begin_inset Quotes eld
16748 \begin_inset Quotes erd
16752 The string should contain
16753 \begin_inset Quotes eld
16757 \begin_inset Quotes erd
16761 This will be replaced by the counter number itself.
16762 So, for sections, it would be: Section ##.
16765 \begin_layout Description
16766 \begin_inset Flex Code
16769 \begin_layout Plain Layout
16776 \begin_inset Flex Code
16779 \begin_layout Plain Layout
16786 \begin_inset Quotes erd
16790 \begin_inset Quotes erd
16793 ] If this is set to the name of another counter, the present counter will
16794 be reset every time the other one is increased.
16796 \begin_inset Flex Code
16799 \begin_layout Plain Layout
16806 \begin_inset Flex Code
16809 \begin_layout Plain Layout
16818 \begin_layout Subsection
16820 \begin_inset CommandInset label
16822 name "sub:Font-description"
16829 \begin_layout Standard
16830 A font description looks like this:
16833 \begin_layout LyX-Code
16843 \begin_layout LyX-Code
16847 \begin_layout LyX-Code
16851 \begin_layout Standard
16852 The following commands are available:
16855 \begin_layout Description
16856 \begin_inset Flex Code
16859 \begin_layout Plain Layout
16866 \begin_inset Flex Code
16869 \begin_layout Plain Layout
16878 \begin_inset Flex Code
16881 \begin_layout Plain Layout
16888 \begin_inset Flex Code
16891 \begin_layout Plain Layout
16898 \begin_inset Flex Code
16901 \begin_layout Plain Layout
16908 \begin_inset Flex Code
16911 \begin_layout Plain Layout
16918 \begin_inset Flex Code
16921 \begin_layout Plain Layout
16928 \begin_inset Flex Code
16931 \begin_layout Plain Layout
16938 \begin_inset Flex Code
16941 \begin_layout Plain Layout
16948 \begin_inset Flex Code
16951 \begin_layout Plain Layout
16960 \begin_layout Description
16961 \begin_inset Flex Code
16964 \begin_layout Plain Layout
16971 \begin_inset Flex Code
16974 \begin_layout Plain Layout
16983 \begin_inset Flex Code
16986 \begin_layout Plain Layout
16993 \begin_inset Flex Code
16996 \begin_layout Plain Layout
17005 \begin_layout Description
17006 \begin_inset Flex Code
17009 \begin_layout Plain Layout
17016 \begin_inset Flex Code
17019 \begin_layout Plain Layout
17025 ] Valid arguments are:
17026 \begin_inset Flex Code
17029 \begin_layout Plain Layout
17036 \begin_inset Flex Code
17039 \begin_layout Plain Layout
17046 \begin_inset Flex Code
17049 \begin_layout Plain Layout
17056 \begin_inset Flex Code
17059 \begin_layout Plain Layout
17066 \begin_inset Flex Code
17069 \begin_layout Plain Layout
17076 \begin_inset Flex Code
17079 \begin_layout Plain Layout
17086 \begin_inset Flex Code
17089 \begin_layout Plain Layout
17096 \begin_inset Flex Code
17099 \begin_layout Plain Layout
17106 \begin_inset Flex Code
17109 \begin_layout Plain Layout
17116 \begin_inset Flex Code
17119 \begin_layout Plain Layout
17126 \begin_inset Flex Code
17129 \begin_layout Plain Layout
17136 \begin_inset Flex Code
17139 \begin_layout Plain Layout
17146 Each of these turns on or off the corresponding attribute.
17148 \begin_inset Flex Code
17151 \begin_layout Plain Layout
17157 turns on emphasis, and
17158 \begin_inset Flex Code
17161 \begin_layout Plain Layout
17169 \begin_inset Newline newline
17172 If the latter seems puzzling, remember that the font settings for the present
17173 context are generally inherited from the surrounding context.
17175 \begin_inset Flex Code
17178 \begin_layout Plain Layout
17184 would turn off the emphasis that was anyway in effect, say, in a theorem
17188 \begin_layout Description
17189 \begin_inset Flex Code
17192 \begin_layout Plain Layout
17199 \begin_inset Flex Code
17202 \begin_layout Plain Layout
17211 \begin_inset Flex Code
17214 \begin_layout Plain Layout
17223 \begin_layout Description
17224 \begin_inset Flex Code
17227 \begin_layout Plain Layout
17234 \begin_inset Flex Code
17237 \begin_layout Plain Layout
17246 \begin_inset Flex Code
17249 \begin_layout Plain Layout
17256 \begin_inset Flex Code
17259 \begin_layout Plain Layout
17266 \begin_inset Flex Code
17269 \begin_layout Plain Layout
17278 \begin_layout Description
17279 \begin_inset Flex Code
17282 \begin_layout Plain Layout
17289 \begin_inset Flex Code
17292 \begin_layout Plain Layout
17299 \begin_inset Flex Code
17302 \begin_layout Plain Layout
17309 \begin_inset Flex Code
17312 \begin_layout Plain Layout
17321 \begin_inset Flex Code
17324 \begin_layout Plain Layout
17331 \begin_inset Flex Code
17334 \begin_layout Plain Layout
17341 \begin_inset Flex Code
17344 \begin_layout Plain Layout
17351 \begin_inset Flex Code
17354 \begin_layout Plain Layout
17361 \begin_inset Flex Code
17364 \begin_layout Plain Layout
17373 \begin_layout Subsection
17374 \begin_inset CommandInset label
17376 name "sub:Citation-format-description"
17380 Citation format description
17383 \begin_layout Standard
17385 \begin_inset Flex Code
17388 \begin_layout Plain Layout
17394 blocks are used to describe how bibliographic information should be displayed,
17395 both within LyX itself (in the citation dialog and in tooltips, for example)
17396 and in XHTML output.
17397 Such a block might look like this:
17400 \begin_layout LyX-Code
17404 \begin_layout LyX-Code
17408 \begin_layout LyX-Code
17412 \begin_layout LyX-Code
17416 \begin_layout Standard
17417 The individual lines define how the bibliographic information associated
17418 with an article or book, respectively, is to be displayed, and such a definitio
17419 n can be given for any `entry type' that might be present in a BibTeX file.
17420 LyX defines a default format in the source code that will be used if no
17421 specific definition has been given.
17422 LyX predefines several formats in the file
17423 \begin_inset Flex Code
17426 \begin_layout Plain Layout
17432 , which is included in most of LyX's document classes.
17435 \begin_layout Standard
17436 The definitions use a simple language that allows BibTeX keys to be replaced
17438 Keys should be enclosed in
17439 \begin_inset Flex Code
17442 \begin_layout Plain Layout
17449 \begin_inset Flex Code
17452 \begin_layout Plain Layout
17459 So a simple definition might look like this:
17462 \begin_layout LyX-Code
17464 \begin_inset Quotes eld
17468 \begin_inset Quotes erd
17474 \begin_layout Standard
17475 This would print the author, followed by a comma, followed by the title,
17476 in quotes, followed by a period.
17479 \begin_layout Standard
17480 Of course, sometimes you may want to print a key only if it exists.
17481 This can be done by using a conditional construction, such as:
17482 \begin_inset Flex Code
17485 \begin_layout Plain Layout
17487 \begin_inset space ~
17497 \begin_inset Flex Code
17500 \begin_layout Plain Layout
17506 key exists, then print
17507 \begin_inset Quotes eld
17511 \begin_inset space ~
17515 \begin_inset Quotes erd
17518 followed by the volume key.
17519 It is also possible to have an else clause in the conditional, such as:
17521 \begin_inset Flex Code
17524 \begin_layout Plain Layout
17525 {%author%[[%author%]][[%editor%, ed.]]}
17532 \begin_inset Flex Code
17535 \begin_layout Plain Layout
17541 key is printed if it exists; otherwise, the editor key is printed, followed
17543 \begin_inset Quotes eld
17547 \begin_inset space ~
17551 \begin_inset Quotes erd
17554 Note that the key is again enclosed in
17555 \begin_inset Flex Code
17558 \begin_layout Plain Layout
17564 signs; the entire conditional is enclosed in braces; and the if and else
17565 clauses are enclosed in double brackets,
17566 \begin_inset Quotes eld
17570 \begin_inset Flex Code
17573 \begin_layout Plain Layout
17580 \begin_inset Quotes eld
17584 \begin_inset Quotes eld
17588 \begin_inset Flex Code
17591 \begin_layout Plain Layout
17598 \begin_inset Quotes erd
17602 There must be no space between any of these.
17605 \begin_layout Standard
17606 There is one other piece of syntax available in definitions, which looks
17608 \begin_inset Flex Code
17611 \begin_layout Plain Layout
17618 This defines a piece of formatting information that is to be used when
17620 \begin_inset Quotes eld
17624 \begin_inset Quotes erd
17628 Obviously, we do not want to output HTML tags when writing plain text,
17629 so they should be wrapped in
17630 \begin_inset Quotes eld
17634 \begin_inset Quotes erd
17638 \begin_inset Quotes eld
17642 \begin_inset Quotes erd
17648 \begin_layout Standard
17649 Two special sorts of definitions are also possible in a
17650 \begin_inset Flex Code
17653 \begin_layout Plain Layout
17660 An example of the first would be:
17663 \begin_layout LyX-Code
17665 \begin_inset Quotes eld
17669 \begin_inset Quotes erd
17675 \begin_layout Standard
17676 This is an abbreviation, or macro, and it can be used by treating it as
17678 \begin_inset Flex Code
17681 \begin_layout Plain Layout
17689 \begin_inset Flex Code
17692 \begin_layout Plain Layout
17698 exactly as it would treat its definition.
17699 So, let us issue the obvious
17707 \begin_layout LyX-Code
17711 \begin_layout Standard
17712 or anything like it.
17713 LyX shouldn't go into an infinite loop, but it may go into a long one before
17717 \begin_layout Standard
17718 The second sort of special definition might look like this:
17721 \begin_layout LyX-Code
17725 \begin_layout Standard
17726 This defines a translatable piece of text, which allows relevant parts of
17727 the bibliography to be translated.
17728 It can be included in a definition by treating it as a key:
17729 \begin_inset Flex Code
17732 \begin_layout Plain Layout
17739 Several of these are predefined in
17740 \begin_inset Flex Code
17743 \begin_layout Plain Layout
17750 Note that these are not macros, in the sense just defined.
17751 They will not be expanded.
17754 \begin_layout Standard
17755 So here then is an example that use all these features:
17758 \begin_layout LyX-Code
17759 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
17762 \begin_layout Standard
17763 This defines a macro that prints the author, followed by a comma, if the
17765 \begin_inset Flex Code
17768 \begin_layout Plain Layout
17774 key is defined, or else prints the name of the editor, followed by the
17776 \begin_inset Flex Code
17779 \begin_layout Plain Layout
17785 or its translation (it is by default
17786 \begin_inset Quotes eld
17790 \begin_inset Quotes erd
17794 \begin_inset Flex Code
17797 \begin_layout Plain Layout
17804 Note that this is in fact defined in
17805 \begin_inset Flex Code
17808 \begin_layout Plain Layout
17814 , so you can use it in your own definitions, or re-definitions, if you load
17818 \begin_layout Section
17819 \begin_inset CommandInset label
17821 name "sec:Tags-for-XHTML"
17825 Tags for XHTML output
17828 \begin_layout Standard
17829 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
17830 by layout information.
17831 In general, LyX provides sensible defaults and, as mentioned earlier, it
17832 will even construct default CSS style rules from the other layout tags.
17833 For example, LyX will attempt to use the information provided in the
17834 \begin_inset Flex Code
17837 \begin_layout Plain Layout
17843 declaration for the Chapter style to write CSS that will appropriately
17844 format chapter headings.
17847 \begin_layout Standard
17848 In many cases, then, you may not have to do anything at all to get acceptable
17849 XHTML output for your own environments, custom insets, and so forth.
17850 But in some cases you will, and so LyX provides a number of layout tags
17851 that can be used to customize the XHTML and CSS that are generated.
17854 \begin_layout Standard
17855 Note that there are two tags,
17856 \begin_inset Flex Code
17859 \begin_layout Plain Layout
17866 \begin_inset Flex Code
17869 \begin_layout Plain Layout
17875 that may appear outside style and inset declarations.
17877 \begin_inset CommandInset ref
17879 reference "sub:General-text-class"
17883 for details on these.
17886 \begin_layout Subsection
17887 \begin_inset CommandInset label
17889 name "sub:Paragraph-Style-XHTML"
17896 \begin_layout Standard
17897 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
17898 dealing with a normal paragraph, a command, or an environment, where this
17899 is itself determined by the contents of the corresponding
17900 \begin_inset Flex Code
17903 \begin_layout Plain Layout
17913 \begin_layout Standard
17914 For a command or normal paragraph, the output XHTML has the following form:
17917 \begin_layout LyX-Code
17919 \begin_inset Quotes erd
17923 \begin_inset Quotes erd
17929 \begin_layout LyX-Code
17931 \begin_inset Quotes erd
17935 \begin_inset Quotes erd
17941 \begin_layout LyX-Code
17942 Contents of the paragraph.
17945 \begin_layout LyX-Code
17949 \begin_layout Standard
17950 The label tags are of course omitted if the paragraph does not have a label.
17953 \begin_layout Standard
17954 For an environment that is not some sort of list, the XHTML takes this form:
17957 \begin_layout LyX-Code
17959 \begin_inset Quotes erd
17963 \begin_inset Quotes erd
17969 \begin_layout LyX-Code
17971 \begin_inset Quotes erd
17975 \begin_inset Quotes erd
17979 \begin_inset Quotes erd
17983 \begin_inset Quotes erd
17986 >Environment Label</labeltag>First paragraph.</itemtag>
17989 \begin_layout LyX-Code
17990 <itemtag>Second paragraph.</itemtag>
17993 \begin_layout LyX-Code
17997 \begin_layout Standard
17998 Note that the label is output only for the first paragraph, as it should
17999 be for a theorem, for example.
18003 \begin_layout Standard
18004 For a list, we have one of these forms:
18007 \begin_layout LyX-Code
18009 \begin_inset Quotes erd
18013 \begin_inset Quotes erd
18019 \begin_layout LyX-Code
18021 \begin_inset Quotes erd
18025 \begin_inset Quotes erd
18029 \begin_inset Quotes erd
18033 \begin_inset Quotes erd
18036 >List Label</labeltag>First item.</itemtag>
18039 \begin_layout LyX-Code
18041 \begin_inset Quotes erd
18045 \begin_inset Quotes erd
18049 \begin_inset Quotes erd
18053 \begin_inset Quotes erd
18056 >List Label</labeltag>Second item.</itemtag>
18059 \begin_layout LyX-Code
18063 \begin_layout LyX-Code
18067 \begin_layout LyX-Code
18069 \begin_inset Quotes erd
18073 \begin_inset Quotes erd
18079 \begin_layout LyX-Code
18081 \begin_inset Quotes erd
18085 \begin_inset Quotes erd
18088 >List Label</labeltag><itemtag attr=
18089 \begin_inset Quotes erd
18093 \begin_inset Quotes erd
18096 >First item.</itemtag>
18099 \begin_layout LyX-Code
18101 \begin_inset Quotes erd
18105 \begin_inset Quotes erd
18108 >List Label</labeltag><itemtag attr=
18109 \begin_inset Quotes erd
18113 \begin_inset Quotes erd
18116 >Second item.</itemtag>
18119 \begin_layout LyX-Code
18123 \begin_layout Standard
18124 Note the different orders of
18125 \begin_inset Flex Code
18128 \begin_layout Plain Layout
18135 \begin_inset Flex Code
18138 \begin_layout Plain Layout
18145 Which order we get depends upon the setting of
18146 \begin_inset Flex Code
18149 \begin_layout Plain Layout
18156 \begin_inset Flex Code
18159 \begin_layout Plain Layout
18165 is false (the default), you get the first of these, with the label within
18166 the item; if true, you get the second, with the label outside the item.
18169 \begin_layout Standard
18170 The specific tags and attributes output for each paragraph type can be controlle
18171 d by means of the layout tags we are about to describe.
18172 As mentioned earlier, however, LyX uses sensible defaults for many of these,
18173 so you often may not need to do very much to get good XHTML output.
18174 Think of the available tags as there so you can tweak things to your liking.
18177 \begin_layout Description
18178 \begin_inset Flex Code
18181 \begin_layout Plain Layout
18188 \begin_inset Flex Code
18191 \begin_layout Plain Layout
18197 ] Specifies attribute information to be output with the main tag.
18199 \begin_inset Quotes eld
18203 \begin_inset Flex Code
18206 \begin_layout Plain Layout
18213 \begin_inset Quotes erd
18217 By default, LyX will output
18218 \begin_inset Quotes eld
18222 \begin_inset Flex Code
18225 \begin_layout Plain Layout
18232 \begin_inset Quotes erd
18236 \begin_inset Flex Code
18239 \begin_layout Plain Layout
18245 is the LyX name of the layout, made lowercase, for example: chapter.
18250 contain any style information.
18252 \begin_inset Flex Code
18255 \begin_layout Plain Layout
18264 \begin_layout Description
18265 \begin_inset Flex Code
18268 \begin_layout Plain Layout
18275 \begin_inset Flex Code
18278 \begin_layout Plain Layout
18288 ] Whether to output the default CSS information LyX generates for this layout,
18289 even if additional information is explicitly provided via
18290 \begin_inset Flex Code
18293 \begin_layout Plain Layout
18301 \begin_inset Flex Code
18304 \begin_layout Plain Layout
18310 allows you to alter or augment the generated CSS, rather than to override
18313 \begin_inset Flex Code
18316 \begin_layout Plain Layout
18325 \begin_layout Description
18326 \begin_inset Flex Code
18329 \begin_layout Plain Layout
18336 \begin_inset Flex Code
18339 \begin_layout Plain Layout
18345 ] The tag to be used for individual paragraphs of environments, replacing
18347 \begin_inset Flex Code
18350 \begin_layout Plain Layout
18356 in the examples above.
18358 \begin_inset Flex Code
18361 \begin_layout Plain Layout
18370 \begin_layout Description
18371 \begin_inset Flex Code
18374 \begin_layout Plain Layout
18381 \begin_inset Flex Code
18384 \begin_layout Plain Layout
18390 ] Attributes for the item tag.
18392 \begin_inset Quotes eld
18396 \begin_inset Flex Code
18399 \begin_layout Plain Layout
18400 class=`layoutname_item'
18406 \begin_inset Quotes erd
18414 contain any style information.
18416 \begin_inset Flex Code
18419 \begin_layout Plain Layout
18428 \begin_layout Description
18429 \begin_inset Flex Code
18432 \begin_layout Plain Layout
18439 \begin_inset Flex Code
18442 \begin_layout Plain Layout
18448 ] The tag to be used for paragraph and item labels, replacing
18449 \begin_inset Flex Code
18452 \begin_layout Plain Layout
18458 in the examples above.
18460 \begin_inset Flex Code
18463 \begin_layout Plain Layout
18470 \begin_inset Flex Code
18473 \begin_layout Plain Layout
18480 \begin_inset Flex Code
18483 \begin_layout Plain Layout
18490 \begin_inset Flex Code
18493 \begin_layout Plain Layout
18494 Centered_Top_Environment
18499 , in which case it defaults to
18500 \begin_inset Flex Code
18503 \begin_layout Plain Layout
18512 \begin_layout Description
18513 \begin_inset Flex Code
18516 \begin_layout Plain Layout
18523 \begin_inset Flex Code
18526 \begin_layout Plain Layout
18532 ] Attributes for the label tag.
18534 \begin_inset Quotes eld
18538 \begin_inset Flex Code
18541 \begin_layout Plain Layout
18542 class=`layoutname_label'
18548 \begin_inset Quotes erd
18556 contain any style information.
18558 \begin_inset Flex Code
18561 \begin_layout Plain Layout
18570 \begin_layout Description
18571 \begin_inset Flex Code
18574 \begin_layout Plain Layout
18581 \begin_inset Flex Code
18584 \begin_layout Plain Layout
18594 ] Meaningful only for list-like environments, this tag controls whether
18595 the label tag is output before or inside the item tag.
18596 This is used, for example, in the description environment, where we want
18598 \begin_inset Flex Code
18601 \begin_layout Plain Layout
18602 <dt>\SpecialChar \ldots{}
18603 </dt><dd>\SpecialChar \ldots{}
18611 \begin_inset Flex Code
18614 \begin_layout Plain Layout
18620 : The label tag is output inside the item tag.
18623 \begin_layout Description
18624 \begin_inset Flex Code
18627 \begin_layout Plain Layout
18633 Information to be output in the
18634 \begin_inset Flex Code
18637 \begin_layout Plain Layout
18643 section when this style is used.
18644 This might, for example, be used to include a
18645 \begin_inset Flex Code
18648 \begin_layout Plain Layout
18655 \begin_inset Flex Code
18658 \begin_layout Plain Layout
18667 \begin_layout Description
18668 \begin_inset Flex Code
18671 \begin_layout Plain Layout
18677 CSS style information to be included when this style is used.
18678 Note that this will automatically be wrapped in a layout-generated
18679 \begin_inset Flex Code
18682 \begin_layout Plain Layout
18688 block, so only the CSS itself need be included.
18691 \begin_layout Description
18692 \begin_inset Flex Code
18695 \begin_layout Plain Layout
18702 \begin_inset Flex Code
18705 \begin_layout Plain Layout
18711 ] The tag to be used for the main label, replacing
18712 \begin_inset Flex Code
18715 \begin_layout Plain Layout
18721 in the examples above.
18723 \begin_inset Flex Code
18726 \begin_layout Plain Layout
18735 \begin_layout Description
18736 \begin_inset Flex Code
18739 \begin_layout Plain Layout
18746 \begin_inset Flex Code
18749 \begin_layout Plain Layout
18759 ] Marks this style as the one to be used to generate the
18760 \begin_inset Flex Code
18763 \begin_layout Plain Layout
18769 tag for the XHTML file.
18770 By default, it is false.
18772 \begin_inset Flex Code
18775 \begin_layout Plain Layout
18781 file sets it to true for the
18782 \begin_inset Flex Code
18785 \begin_layout Plain Layout
18795 \begin_layout Subsection
18799 \begin_layout Standard
18800 The XHTML output of insets can also be controlled by information in layout
18805 \begin_layout Plain Layout
18806 At present, this is true only for
18807 \begin_inset Quotes eld
18811 \begin_inset Quotes erd
18814 insets (insets you can type into) and is not true for
18815 \begin_inset Quotes eld
18819 \begin_inset Quotes erd
18822 insets (insets that are associated with dialog boxes).
18827 Here, too, LyX tries to provide sensible defaults, and it constructs default
18829 But everything can be customized.
18832 \begin_layout Standard
18833 The XHTML LyX outputs for an inset has the following form:
18836 \begin_layout LyX-Code
18838 \begin_inset Quotes erd
18842 \begin_inset Quotes erd
18848 \begin_layout LyX-Code
18849 <labeltag>Label</labeltag>
18852 \begin_layout LyX-Code
18854 \begin_inset Quotes erd
18858 \begin_inset Quotes erd
18861 >Contents of the inset.</innertag>
18864 \begin_layout LyX-Code
18868 \begin_layout Standard
18869 If the inset permits multiple paragraphs---that is, if
18870 \begin_inset Flex Code
18873 \begin_layout Plain Layout
18879 is true---then the contents of the inset will itself be output as paragraphs
18880 formatted according to the styles used for those paragraphs (standard,
18881 quote, and the like).
18882 The label tag is of course omitted if the paragraph does not have a label
18883 and, at present, is always
18884 \begin_inset Flex Code
18887 \begin_layout Plain Layout
18894 The inner tag is optional and, by default, does not appear.
18897 \begin_layout Standard
18898 The specific tags and attributes output for each inset can be controlled
18899 by means of the following layout tags.
18902 \begin_layout Description
18903 \begin_inset Flex Code
18906 \begin_layout Plain Layout
18913 \begin_inset Flex Code
18916 \begin_layout Plain Layout
18922 ] Specifies attribute information to be output with the main tag.
18924 \begin_inset Quotes eld
18928 \begin_inset Flex Code
18931 \begin_layout Plain Layout
18932 class=`myinset' onclick=`\SpecialChar \ldots{}
18939 \begin_inset Quotes erd
18943 By default, LyX will output
18944 \begin_inset Quotes eld
18948 \begin_inset Flex Code
18951 \begin_layout Plain Layout
18958 \begin_inset Quotes erd
18962 \begin_inset Flex Code
18965 \begin_layout Plain Layout
18971 is the LyX name of the inset, made lowercase and with non-alphanumeric
18972 characters converted to underscores, for example: footnote.
18975 \begin_layout Description
18976 \begin_inset Flex Code
18979 \begin_layout Plain Layout
18986 \begin_inset Flex Code
18989 \begin_layout Plain Layout
18999 ] Whether to output the default CSS information LyX generates for this layout,
19000 even if additional information is explicitly provided via
19001 \begin_inset Flex Code
19004 \begin_layout Plain Layout
19012 \begin_inset Flex Code
19015 \begin_layout Plain Layout
19021 allows you to alter or augment the generated CSS, rather than to override
19026 \begin_layout Description
19027 \begin_inset Flex Code
19030 \begin_layout Plain Layout
19037 \begin_inset Flex Code
19040 \begin_layout Plain Layout
19046 ] Attributes for the inner tag.
19048 \begin_inset Quotes eld
19052 \begin_inset Flex Code
19055 \begin_layout Plain Layout
19056 class=`insetname_inner'
19062 \begin_inset Quotes erd
19068 \begin_layout Description
19069 \begin_inset Flex Code
19072 \begin_layout Plain Layout
19079 \begin_inset Flex Code
19082 \begin_layout Plain Layout
19088 ] The inner tag, replacing
19089 \begin_inset Flex Code
19092 \begin_layout Plain Layout
19098 in the examples above.
19099 By default, there is none.
19102 \begin_layout Description
19103 \begin_inset Flex Code
19106 \begin_layout Plain Layout
19113 \begin_inset Flex Code
19116 \begin_layout Plain Layout
19124 ] Whether this inset represents a standalone block of text (such as a footnote)
19125 or instead represents material that is included in the surrounding text
19126 (such as a branch).
19130 \begin_layout Description
19131 \begin_inset Flex Code
19134 \begin_layout Plain Layout
19141 \begin_inset Flex Code
19144 \begin_layout Plain Layout
19150 ] A label for this inset, possibly including a reference to a counter.
19151 For example, for footnote, it might be:
19152 \begin_inset Flex Code
19155 \begin_layout Plain Layout
19164 This is optional, and there is no default.
19167 \begin_layout Description
19168 \begin_inset Flex Code
19171 \begin_layout Plain Layout
19177 Information to be output in the
19178 \begin_inset Flex Code
19181 \begin_layout Plain Layout
19187 section when this style is used.
19188 This might, for example, be used to include a
19189 \begin_inset Flex Code
19192 \begin_layout Plain Layout
19199 \begin_inset Flex Code
19202 \begin_layout Plain Layout
19211 \begin_layout Description
19212 \begin_inset Flex Code
19215 \begin_layout Plain Layout
19221 CSS style information to be included when this style is used.
19222 Note that this will automatically be wrapped in a layout-generated
19223 \begin_inset Flex Code
19226 \begin_layout Plain Layout
19232 block, so only the CSS itself need be included.
19235 \begin_layout Description
19236 \begin_inset Flex Code
19239 \begin_layout Plain Layout
19246 \begin_inset Flex Code
19249 \begin_layout Plain Layout
19255 ] The tag to be used for the main label, replacing
19256 \begin_inset Flex Code
19259 \begin_layout Plain Layout
19265 in the examples above.
19266 The default depends upon the setting of
19267 \begin_inset Flex Code
19270 \begin_layout Plain Layout
19277 \begin_inset Flex Code
19280 \begin_layout Plain Layout
19286 is true, the default is
19287 \begin_inset Flex Code
19290 \begin_layout Plain Layout
19296 ; if it is false, the default is
19297 \begin_inset Flex Code
19300 \begin_layout Plain Layout
19309 \begin_layout Subsection
19313 \begin_layout Standard
19314 The XHTML output for floats too can be controlled by layout information.
19315 The output has the following form:
19318 \begin_layout LyX-Code
19320 \begin_inset Quotes erd
19324 \begin_inset Quotes erd
19330 \begin_layout LyX-Code
19331 Contents of the float.
19334 \begin_layout LyX-Code
19338 \begin_layout Standard
19339 The caption, if there is one, is a separate inset and will be output as
19341 Its appearance can be controlled via the InsetLayout for caption insets.
19345 \begin_layout Description
19346 \begin_inset Flex Code
19349 \begin_layout Plain Layout
19356 \begin_inset Flex Code
19359 \begin_layout Plain Layout
19365 ] Specifies attribute information to be output with the main tag.
19367 \begin_inset Quotes eld
19371 \begin_inset Flex Code
19374 \begin_layout Plain Layout
19375 class=`myfloat' onclick=`\SpecialChar \ldots{}
19382 \begin_inset Quotes erd
19386 By default, LyX will output
19387 \begin_inset Quotes eld
19391 \begin_inset Flex Code
19394 \begin_layout Plain Layout
19395 class=`float float-floattype'
19401 \begin_inset Quotes erd
19405 \begin_inset Flex Code
19408 \begin_layout Plain Layout
19414 is LyX's name for this type of float, as determined by the float declaration
19416 \begin_inset CommandInset ref
19418 reference "sub:Floats"
19422 ), though made lowercase and with non-alphanumeric characters converted
19423 to underscores, for example: float-table.
19426 \begin_layout Description
19427 \begin_inset Flex Code
19430 \begin_layout Plain Layout
19436 CSS style information to be included when this float is used.
19437 Note that this will automatically be wrapped in a layout-generated
19438 \begin_inset Flex Code
19441 \begin_layout Plain Layout
19447 block, so only the CSS itself need be included.
19450 \begin_layout Description
19451 \begin_inset Flex Code
19454 \begin_layout Plain Layout
19461 \begin_inset Flex Code
19464 \begin_layout Plain Layout
19470 ] The tag to be used for this float, replacing
19471 \begin_inset Quotes eld
19475 \begin_inset Flex Code
19478 \begin_layout Plain Layout
19485 \begin_inset Quotes erd
19488 in the example above.
19490 \begin_inset Flex Code
19493 \begin_layout Plain Layout
19499 and will rarely need changing.
19502 \begin_layout Subsection
19503 Bibliography formatting
19506 \begin_layout Standard
19507 The bibliography can be formatted using
19508 \begin_inset Flex Code
19511 \begin_layout Plain Layout
19519 \begin_inset CommandInset ref
19521 reference "sub:Citation-format-description"
19528 \begin_layout Subsection
19532 \begin_layout Standard
19533 We have several times mentioned that LyX will generate default CSS style
19534 rules for both insets and paragraph styles, based upon the other layout
19535 information that is provided.
19536 In this section, we shall say a word about which layout information LyX
19540 \begin_layout Standard
19541 At present, LyX auto-generates CSS only for font information, making use
19543 \begin_inset Flex Code
19546 \begin_layout Plain Layout
19553 \begin_inset Flex Code
19556 \begin_layout Plain Layout
19563 \begin_inset Flex Code
19566 \begin_layout Plain Layout
19573 \begin_inset Flex Code
19576 \begin_layout Plain Layout
19583 \begin_inset Flex Code
19586 \begin_layout Plain Layout
19594 \begin_inset CommandInset ref
19596 reference "sub:Font-description"
19600 .) The translation is mostly straightforward and obvious.
19602 \begin_inset Quotes eld
19606 \begin_inset Flex Code
19609 \begin_layout Plain Layout
19616 \begin_inset Quotes erd
19620 \begin_inset Quotes eld
19624 \begin_inset Flex Code
19627 \begin_layout Plain Layout
19628 font-family: sans-serif;
19634 \begin_inset Quotes erd
19638 The correspondence of LyX sizes and CSS sizes is a little less obvious
19639 but nonetheless intuitive.
19641 \begin_inset Flex Code
19644 \begin_layout Plain Layout
19651 \begin_inset Flex URL
19654 \begin_layout Plain Layout
19664 \begin_layout Chapter
19665 Including External Material
19668 \begin_layout Standard
19669 \begin_inset Box Shadowbox
19679 height_special "totalheight"
19682 \begin_layout Plain Layout
19683 WARNING: This portion of the documentation has not been updated for some
19685 We certainly hope that it is still accurate, but there are no guarantees.
19693 \begin_layout Standard
19694 The use of material from sources external to LyX is covered in detail in
19700 This part of the manual covers what needs to happen behind the scenes for
19701 new sorts of material to be included.
19704 \begin_layout Section
19708 \begin_layout Standard
19709 The external material feature is based on the concept of a
19714 A template is a specification of how LyX should interface with a certain
19716 As bundled, LyX comes with predefined templates for Xfig figures, various
19717 raster format images, chess diagrams, and LilyPond music notation.
19718 You can check the actual list by using the menu
19719 \begin_inset Flex MenuItem
19722 \begin_layout Plain Layout
19723 Insert\SpecialChar \menuseparator
19724 File\SpecialChar \menuseparator
19731 Furthermore, it is possible to roll your own template to support a specific
19733 Later we'll describe in more detail what is involved, and hopefully you
19734 will submit all the templates you create so we can include them in a later
19738 \begin_layout Standard
19739 Another basic idea of the external material feature is to distinguish between
19740 the original file that serves as a base for final material and the produced
19741 file that is included in your exported or printed document.
19742 For example, consider the case of a figure produced with
19743 \begin_inset Flex Code
19746 \begin_layout Plain Layout
19753 The Xfig application itself works on an original file with the
19754 \begin_inset Flex Code
19757 \begin_layout Plain Layout
19764 Within Xfig, you create and change your figure, and when you are done,
19766 \begin_inset Flex Code
19769 \begin_layout Plain Layout
19776 When you want to include the figure in your document, you invoke
19777 \begin_inset Flex Code
19780 \begin_layout Plain Layout
19786 in order to create a PostScript file that can readily be included in your
19789 \begin_inset Flex Code
19792 \begin_layout Plain Layout
19798 file is the original file, and the PostScript file is the produced file.
19801 \begin_layout Standard
19802 This distinction is important in order to allow updating of the material
19803 while you are in the process of writing the document.
19804 Furthermore, it provides us with the flexibility that is needed to support
19805 multiple export formats.
19806 For instance, in the case of a plain text file, it is not exactly an award-winn
19807 ing idea to include the figure as raw PostScript.
19808 Instead, you would either prefer to just include a reference to the figure
19809 or try to invoke some graphics to ASCII converter to make the final result
19810 look similar to the real graphics.
19811 The external material management allows you to do this, because it is parametri
19812 zed on the different export formats that LyX supports.
19815 \begin_layout Standard
19816 Besides supporting the production of different products according to the
19817 exported format, it supports tight integration with editing and viewing
19819 In the case of an Xfig figure, you are able to invoke Xfig on the original
19820 file with a single click from within the external material dialog in LyX,
19821 and also preview the produced PostScript file with Ghostview with another
19823 No more fiddling around with the command line and/or file browsers to locate
19824 and manipulate the original or produced files.
19825 In this way, you are finally able to take full advantage of the many different
19826 applications that are relevant to use when you write your documents, and
19827 ultimately be more productive.
19830 \begin_layout Section
19831 The external template configuration file
19834 \begin_layout Standard
19835 It is relatively easy to add custom external template definitions to LyX.
19836 However, be aware that doing this in an careless manner most probably
19840 introduce an easily exploitable security hole.
19841 So before you do this, please read the discussion about security in section
19843 \begin_inset CommandInset ref
19845 reference "sec:Security-discussion"
19852 \begin_layout Standard
19853 Having said that, we encourage you to submit any interesting templates that
19858 \begin_layout Standard
19859 The external templates are defined in the
19860 \begin_inset Flex Code
19863 \begin_layout Plain Layout
19864 LyXDir/lib/external_templates
19870 You can place your own version in
19871 \begin_inset Flex Code
19874 \begin_layout Plain Layout
19875 UserDir/external_templates
19883 \begin_layout Standard
19884 A typical template looks like this:
19887 \begin_layout LyX-Code
19891 \begin_layout LyX-Code
19892 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
19895 \begin_layout LyX-Code
19899 \begin_layout LyX-Code
19903 \begin_layout LyX-Code
19907 \begin_layout LyX-Code
19911 \begin_layout LyX-Code
19915 \begin_layout LyX-Code
19916 AutomaticProduction true
19919 \begin_layout LyX-Code
19923 \begin_layout LyX-Code
19927 \begin_layout LyX-Code
19931 \begin_layout LyX-Code
19932 TransformCommand Rotate RotationLatexCommand
19935 \begin_layout LyX-Code
19936 TransformCommand Resize ResizeLatexCommand
19939 \begin_layout LyX-Code
19940 Product "$$RotateFront$$ResizeFront
19943 \begin_layout LyX-Code
19948 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
19951 \begin_layout LyX-Code
19952 $$ResizeBack$$RotateBack"
19955 \begin_layout LyX-Code
19959 \begin_layout LyX-Code
19960 UpdateResult "$$AbsPath$$Basename.pstex_t"
19963 \begin_layout LyX-Code
19964 Requirement "graphicx"
19967 \begin_layout LyX-Code
19968 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
19971 \begin_layout LyX-Code
19972 ReferencedFile latex "$$AbsPath$$Basename.eps"
19975 \begin_layout LyX-Code
19976 ReferencedFile dvi "$$AbsPath$$Basename.eps"
19979 \begin_layout LyX-Code
19983 \begin_layout LyX-Code
19987 \begin_layout LyX-Code
19988 TransformCommand Rotate RotationLatexCommand
19991 \begin_layout LyX-Code
19992 TransformCommand Resize ResizeLatexCommand
19995 \begin_layout LyX-Code
19996 Product "$$RotateFront$$ResizeFront
19999 \begin_layout LyX-Code
20004 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
20007 \begin_layout LyX-Code
20008 $$ResizeBack$$RotateBack"
20011 \begin_layout LyX-Code
20012 UpdateFormat pdftex
20015 \begin_layout LyX-Code
20016 UpdateResult "$$AbsPath$$Basename.pdftex_t"
20019 \begin_layout LyX-Code
20020 Requirement "graphicx"
20023 \begin_layout LyX-Code
20024 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
20027 \begin_layout LyX-Code
20028 ReferencedFile latex "$$AbsPath$$Basename.pdf"
20031 \begin_layout LyX-Code
20035 \begin_layout LyX-Code
20039 \begin_layout LyX-Code
20040 Product "$$Contents(
20042 "$$AbsPath$$Basename.asc
20047 \begin_layout LyX-Code
20048 UpdateFormat asciixfig
20051 \begin_layout LyX-Code
20052 UpdateResult "$$AbsPath$$Basename.asc"
20055 \begin_layout LyX-Code
20059 \begin_layout LyX-Code
20063 \begin_layout LyX-Code
20064 Product "<graphic fileref=
20066 "$$AbsOrRelPathMaster$$Basename.eps
20071 \begin_layout LyX-Code
20075 \begin_layout LyX-Code
20079 \begin_layout LyX-Code
20080 UpdateResult "$$AbsPath$$Basename.eps"
20083 \begin_layout LyX-Code
20084 ReferencedFile docbook "$$AbsPath$$Basename.eps"
20087 \begin_layout LyX-Code
20088 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
20091 \begin_layout LyX-Code
20095 \begin_layout LyX-Code
20096 Product "[XFig: $$FName]"
20099 \begin_layout LyX-Code
20103 \begin_layout LyX-Code
20107 \begin_layout Standard
20108 As you can see, the template is enclosed in
20109 \begin_inset Flex Code
20112 \begin_layout Plain Layout
20118 \SpecialChar \ldots{}
20120 \begin_inset Flex Code
20123 \begin_layout Plain Layout
20130 It contains a header specifying some general settings and, for each supported
20131 primary document file format, a section
20132 \begin_inset Flex Code
20135 \begin_layout Plain Layout
20141 \SpecialChar \ldots{}
20143 \begin_inset Flex Code
20146 \begin_layout Plain Layout
20155 \begin_layout Subsection
20156 The template header
20159 \begin_layout Description
20160 \begin_inset Flex Code
20163 \begin_layout Plain Layout
20164 AutomaticProduction
20165 \begin_inset space ~
20173 Whether the file represented by the template must be generated by LyX.
20174 This command must occur exactly once.
20177 \begin_layout Description
20178 \begin_inset Flex Code
20181 \begin_layout Plain Layout
20183 \begin_inset space ~
20191 A glob pattern that is used in the file dialog to filter out the desired
20193 If there is more than one possible file extension (e.
20194 \begin_inset space \thinspace{}
20198 \begin_inset space \space{}
20202 \begin_inset Flex Code
20205 \begin_layout Plain Layout
20212 \begin_inset Flex Code
20215 \begin_layout Plain Layout
20221 ), use something like
20222 \begin_inset Flex Code
20225 \begin_layout Plain Layout
20232 This command must occur exactly once.
20235 \begin_layout Description
20236 \begin_inset Flex Code
20239 \begin_layout Plain Layout
20241 \begin_inset space ~
20249 The text that is displayed on the button.
20250 This command must occur exactly once.
20253 \begin_layout Description
20254 \begin_inset Flex Code
20257 \begin_layout Plain Layout
20259 \begin_inset space ~
20263 \begin_inset space ~
20271 The help text that is used in the External dialog.
20272 Provide enough information to explain to the user just what the template
20273 can provide him with.
20274 This command must occur exactly once.
20277 \begin_layout Description
20278 \begin_inset Flex Code
20281 \begin_layout Plain Layout
20283 \begin_inset space ~
20291 The file format of the original file.
20292 This must be the name of a format that is known to LyX (see section
20293 \begin_inset space ~
20297 \begin_inset CommandInset ref
20299 reference "sec:Formats"
20305 \begin_inset Quotes eld
20309 \begin_inset Flex Code
20312 \begin_layout Plain Layout
20319 \begin_inset Quotes erd
20322 if the template can handle original files of more than one format.
20323 LyX will attempt to interrogate the file itself in order to deduce its
20324 format in this case.
20325 This command must occur exactly once.
20328 \begin_layout Description
20329 \begin_inset Flex Code
20332 \begin_layout Plain Layout
20334 \begin_inset space ~
20342 A unique name for the template.
20343 It must not contain substitution macros (see below).
20346 \begin_layout Description
20347 \begin_inset Flex Code
20350 \begin_layout Plain Layout
20352 \begin_inset space ~
20355 Rotate|Resize|Clip|Extra
20360 This command specifies which transformations are supported by this template.
20361 It may occur zero or more times.
20362 This command enables the corresponding tabs in the external dialog.
20364 \begin_inset Flex Code
20367 \begin_layout Plain Layout
20373 command must have either a corresponding
20374 \begin_inset Flex Code
20377 \begin_layout Plain Layout
20384 \begin_inset Flex Code
20387 \begin_layout Plain Layout
20394 \begin_inset Flex Code
20397 \begin_layout Plain Layout
20404 Otherwise the transformation will not be supported by that format.
20407 \begin_layout Subsection
20411 \begin_layout Description
20412 \begin_inset Flex Code
20415 \begin_layout Plain Layout
20417 \begin_inset space ~
20420 LaTeX|PDFLaTeX|PlainText|DocBook
20425 The primary document file format that this format definition is for.
20426 Not every template has a sensible representation in all document file formats.
20427 Please define nevertheless a
20428 \begin_inset Flex Code
20431 \begin_layout Plain Layout
20437 section for all templates.
20438 Use a dummy text when no representation is available.
20439 Then you can at least see a reference to the external material in the exported
20443 \begin_layout Description
20444 \begin_inset Flex Code
20447 \begin_layout Plain Layout
20449 \begin_inset space ~
20453 \begin_inset space ~
20461 This command defines an additional macro
20462 \begin_inset Flex Code
20465 \begin_layout Plain Layout
20471 for substitution in
20472 \begin_inset Flex Code
20475 \begin_layout Plain Layout
20483 \begin_inset Flex Code
20486 \begin_layout Plain Layout
20492 itself may contain substitution macros.
20493 The advantage over using
20494 \begin_inset Flex Code
20497 \begin_layout Plain Layout
20504 \begin_inset Flex Code
20507 \begin_layout Plain Layout
20513 is that the substituted value of
20514 \begin_inset Flex Code
20517 \begin_layout Plain Layout
20523 is sanitized so that it is a valid optional argument in the document format.
20524 This command may occur zero or more times.
20527 \begin_layout Description
20528 \begin_inset Flex Code
20531 \begin_layout Plain Layout
20533 \begin_inset space ~
20541 The text that is inserted in the exported document.
20542 This is actually the most important command and can be quite complex.
20543 This command must occur exactly once.
20546 \begin_layout Description
20547 \begin_inset Flex Code
20550 \begin_layout Plain Layout
20552 \begin_inset space ~
20560 This command specifies a preamble snippet that will be included in the
20562 It has to be defined using
20563 \begin_inset Flex Code
20566 \begin_layout Plain Layout
20572 \SpecialChar \ldots{}
20574 \begin_inset Flex Code
20577 \begin_layout Plain Layout
20584 This command may occur zero or more times.
20587 \begin_layout Description
20588 \begin_inset Flex Code
20591 \begin_layout Plain Layout
20593 \begin_inset space ~
20597 \begin_inset space ~
20605 This command denotes files that are created by the conversion process and
20606 are needed for a particular export format.
20607 If the filename is relative, it is interpreted relative to the master document.
20608 This command may be given zero or more times.
20611 \begin_layout Description
20612 \begin_inset Flex Code
20615 \begin_layout Plain Layout
20617 \begin_inset space ~
20625 The name of a required LaTeX package.
20626 The package is included via
20627 \begin_inset Flex Code
20630 \begin_layout Plain Layout
20638 in the LaTeX preamble.
20639 This command may occur zero or more times.
20642 \begin_layout Description
20643 \begin_inset Flex Code
20646 \begin_layout Plain Layout
20648 \begin_inset space ~
20652 \begin_inset space ~
20655 RotationLatexCommand
20660 This command specifies that the built in LaTeX command should be used for
20662 This command may occur once or not at all.
20665 \begin_layout Description
20666 \begin_inset Flex Code
20669 \begin_layout Plain Layout
20671 \begin_inset space ~
20675 \begin_inset space ~
20683 This command specifies that the built in LaTeX command should be used for
20685 This command may occur once or not at all.
20688 \begin_layout Description
20689 \begin_inset Flex Code
20692 \begin_layout Plain Layout
20694 \begin_inset space ~
20698 \begin_inset space ~
20701 RotationLatexOption
20706 This command specifies that rotation is done via an optional argument.
20707 This command may occur once or not at all.
20710 \begin_layout Description
20711 \begin_inset Flex Code
20714 \begin_layout Plain Layout
20716 \begin_inset space ~
20720 \begin_inset space ~
20728 This command specifies that resizing is done via an optional argument.
20729 This command may occur once or not at all.
20732 \begin_layout Description
20733 \begin_inset Flex Code
20736 \begin_layout Plain Layout
20738 \begin_inset space ~
20742 \begin_inset space ~
20750 This command specifies that clipping is done via an optional argument.
20751 This command may occur once or not at all.
20754 \begin_layout Description
20755 \begin_inset Flex Code
20758 \begin_layout Plain Layout
20760 \begin_inset space ~
20764 \begin_inset space ~
20772 This command specifies that an extra optional argument is used.
20773 This command may occur once or not at all.
20776 \begin_layout Description
20777 \begin_inset Flex Code
20780 \begin_layout Plain Layout
20782 \begin_inset space ~
20790 The file format of the converted file.
20791 This must be the name of a format that is known to LyX (see the
20792 \begin_inset Flex MenuItem
20795 \begin_layout Plain Layout
20800 ools\SpecialChar \menuseparator
20805 references\SpecialChar \menuseparator
20806 File Handling\SpecialChar \menuseparator
20813 This command must occur exactly once.
20816 \begin_layout Description
20817 \begin_inset Flex Code
20820 \begin_layout Plain Layout
20822 \begin_inset space ~
20830 The file name of the converted file.
20831 The file name must be absolute.
20832 This command must occur exactly once.
20835 \begin_layout Subsection
20836 Preamble definitions
20839 \begin_layout Standard
20840 The external template configuration file may contain additional preamble
20841 definitions enclosed by
20842 \begin_inset Flex Code
20845 \begin_layout Plain Layout
20851 \SpecialChar \ldots{}
20853 \begin_inset Flex Code
20856 \begin_layout Plain Layout
20863 They can be used by the templates in the
20864 \begin_inset Flex Code
20867 \begin_layout Plain Layout
20876 \begin_layout Section
20877 The substitution mechanism
20880 \begin_layout Standard
20881 When the external material facility invokes an external program, it is done
20882 on the basis of a command defined in the template configuration file.
20883 These commands can contain various macros that are expanded before execution.
20884 Execution always take place in the directory of the containing document.
20887 \begin_layout Standard
20888 Also, whenever external material is to be displayed, the name will be produced
20889 by the substitution mechanism, and most other commands in the template
20890 definition support substitution as well.
20893 \begin_layout Standard
20894 The available macros are the following:
20897 \begin_layout Description
20898 \begin_inset Flex Code
20901 \begin_layout Plain Layout
20902 $$AbsOrRelPathMaster
20907 The file path, absolute or relative to the master LyX document.
20910 \begin_layout Description
20911 \begin_inset Flex Code
20914 \begin_layout Plain Layout
20915 $$AbsOrRelPathParent
20920 The file path, absolute or relative to the LyX document.
20923 \begin_layout Description
20924 \begin_inset Flex Code
20927 \begin_layout Plain Layout
20933 The absolute file path.
20936 \begin_layout Description
20937 \begin_inset Flex Code
20940 \begin_layout Plain Layout
20946 The filename without path and without the extension.
20949 \begin_layout Description
20950 \begin_inset Flex Code
20953 \begin_layout Plain Layout
20955 \begin_inset Quotes eld
20959 \begin_inset Quotes erd
20967 This macro will expand to the contents of the file with the name
20968 \begin_inset Flex Code
20971 \begin_layout Plain Layout
20980 \begin_layout Description
20981 \begin_inset Flex Code
20984 \begin_layout Plain Layout
20990 The file extension (including the dot).
20993 \begin_layout Description
20994 \begin_inset Flex Code
20997 \begin_layout Plain Layout
21003 The filename of the file specified in the external material dialog.
21004 This is either an absolute name, or it is relative to the LyX document.
21007 \begin_layout Description
21008 \begin_inset Flex Code
21011 \begin_layout Plain Layout
21018 \begin_inset Flex Code
21021 \begin_layout Plain Layout
21027 (absolute name or relative to the LyX document).
21030 \begin_layout Description
21031 \begin_inset Flex Code
21034 \begin_layout Plain Layout
21040 The file path, relative to the master LyX document.
21043 \begin_layout Description
21044 \begin_inset Flex Code
21047 \begin_layout Plain Layout
21053 The file path, relative to the LyX document.
21056 \begin_layout Description
21057 \begin_inset Flex Code
21060 \begin_layout Plain Layout
21066 This macro will expand to the absolute path of the system directory.
21067 This is typically used to point to the various helper scripts that are
21071 \begin_layout Description
21072 \begin_inset Flex Code
21075 \begin_layout Plain Layout
21081 A name and full path to a temporary file which will be automatically deleted
21082 whenever the containing document is closed, or the external material insertion
21086 \begin_layout Standard
21087 All path macros contain a trailing directory separator, so you can construct
21089 \begin_inset space \thinspace{}
21093 \begin_inset space \space{}
21096 the absolute filename with
21097 \begin_inset Flex Code
21100 \begin_layout Plain Layout
21101 $$AbsPath$$Basename$$Extension
21109 \begin_layout Standard
21110 The macros above are substituted in all commands unless otherwise noted.
21112 \begin_inset Flex Code
21115 \begin_layout Plain Layout
21121 supports additionally the following substitutions if they are enabled by
21123 \begin_inset Flex Code
21126 \begin_layout Plain Layout
21133 \begin_inset Flex Code
21136 \begin_layout Plain Layout
21145 \begin_layout Description
21146 \begin_inset Flex Code
21149 \begin_layout Plain Layout
21155 The front part of the resize command.
21158 \begin_layout Description
21159 \begin_inset Flex Code
21162 \begin_layout Plain Layout
21168 The back part of the resize command.
21171 \begin_layout Description
21172 \begin_inset Flex Code
21175 \begin_layout Plain Layout
21181 The front part of the rotation command.
21184 \begin_layout Description
21185 \begin_inset Flex Code
21188 \begin_layout Plain Layout
21194 The back part of the rotation command.
21197 \begin_layout Standard
21198 The value string of the
21199 \begin_inset Flex Code
21202 \begin_layout Plain Layout
21208 command supports additionally the following substitutions if they are enabled
21210 \begin_inset Flex Code
21213 \begin_layout Plain Layout
21220 \begin_inset Flex Code
21223 \begin_layout Plain Layout
21232 \begin_layout Description
21233 \begin_inset Flex Code
21236 \begin_layout Plain Layout
21245 \begin_layout Description
21246 \begin_inset Flex Code
21249 \begin_layout Plain Layout
21258 \begin_layout Description
21259 \begin_inset Flex Code
21262 \begin_layout Plain Layout
21271 \begin_layout Description
21272 \begin_inset Flex Code
21275 \begin_layout Plain Layout
21281 The rotation option.
21284 \begin_layout Standard
21285 You may ask why there are so many path macros.
21286 There are mainly two reasons:
21289 \begin_layout Enumerate
21290 Relative and absolute file names should remain relative or absolute, respectivel
21292 Users may have reasons to prefer either form.
21293 Relative names are useful for portable documents that should work on different
21294 machines, for example.
21295 Absolute names may be required by some programs.
21298 \begin_layout Enumerate
21299 LaTeX treats relative file names differently than LyX and other programs
21300 in nested included files.
21301 For LyX, a relative file name is always relative to the document that contains
21303 For LaTeX, it is always relative to the master document.
21304 These two definitions are identical if you have only one document, but
21305 differ if you have a master document that includes part documents.
21306 That means that relative filenames must be transformed when presented to
21308 Fortunately LyX does this automatically for you if you choose the right
21312 \begin_layout Standard
21313 So which path macro should be used in new template definitions? The rule
21317 \begin_layout Itemize
21319 \begin_inset Flex Code
21322 \begin_layout Plain Layout
21328 if an absolute path is required.
21331 \begin_layout Itemize
21333 \begin_inset Flex Code
21336 \begin_layout Plain Layout
21337 $$AbsOrRelPathMaster
21342 if the substituted string is some kind of LaTeX input.
21345 \begin_layout Itemize
21347 \begin_inset Flex Code
21350 \begin_layout Plain Layout
21351 $$AbsOrRelPathParent
21356 in order to preserve the user's choice.
21359 \begin_layout Standard
21360 There are special cases where this rule does not work and e.
21361 \begin_inset space \thinspace{}
21365 \begin_inset space \space{}
21368 relative names are needed, but normally it will work just fine.
21369 One example for such a case is the command
21370 \begin_inset Flex Code
21373 \begin_layout Plain Layout
21374 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
21379 in the XFig template above: We can't use the absolute name because the
21381 \begin_inset Flex Code
21384 \begin_layout Plain Layout
21390 files needs the relative name in order to rewrite the file content.
21393 \begin_layout Section
21394 Security discussion
21395 \begin_inset CommandInset label
21397 name "sec:Security-discussion"
21404 \begin_layout Standard
21405 The external material feature interfaces with a lot of external programs
21406 and does so automatically, so we have to consider the security implications
21408 In particular, since you have the option of including your own filenames
21409 and/or parameter strings and those are expanded into a command, it seems
21410 that it would be possible to create a malicious document which executes
21411 arbitrary commands when a user views or prints the document.
21412 This is something we definitely want to avoid.
21415 \begin_layout Standard
21416 However, since the external program commands are specified in the template
21417 configuration file only, there are no security issues if LyX is properly
21418 configured with safe templates only.
21419 This is so because the external programs are invoked with the
21420 \begin_inset Flex Code
21423 \begin_layout Plain Layout
21429 -system call rather than the
21430 \begin_inset Flex Code
21433 \begin_layout Plain Layout
21439 system-call, so it's not possible to execute arbitrary commands from the
21440 filename or parameter section via the shell.
21443 \begin_layout Standard
21444 This also implies that you are restricted in what command strings you can
21445 use in the external material templates.
21446 In particular, pipes and redirection are not readily available.
21447 This has to be so if LyX should remain safe.
21448 If you want to use some of the shell features, you should write a safe
21449 script to do this in a controlled manner, and then invoke the script from
21450 the command string.
21454 \begin_layout Standard
21455 It is possible to design a template that interacts directly with the shell,
21456 but since this would allow a malicious user to execute arbitrary commands
21457 by writing clever filenames and/or parameters, we generally recommend that
21458 you only use safe scripts that work with the
21459 \begin_inset Flex Code
21462 \begin_layout Plain Layout
21468 system call in a controlled manner.
21469 Of course, for use in a controlled environment, it can be tempting to just
21470 fall back to use ordinary shell scripts.
21471 If you do so, be aware that you
21475 provide an easily exploitable security hole in your system.
21476 Of course it stands to reason that such unsafe templates will never be
21477 included in the standard LyX distribution, although we do encourage people
21478 to submit new templates in the open source tradition.
21479 But LyX as shipped from the official distribution channels will never have
21483 \begin_layout Standard
21484 Including external material provides a lot of power, and you have to be
21485 careful not to introduce security hazards with this power.
21486 A subtle error in a single line in an innocent looking script can open
21487 the door to huge security problems.
21488 So if you do not fully understand the issues, we recommend that you consult
21489 a knowledgeable security professional or the LyX development team if you
21490 have any questions about whether a given template is safe or not.
21491 And do this before you use it in an uncontrolled environment.