1 #LyX 2.1 created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that this document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of this document may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 \options fleqn,bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading
35 \use_default_options false
39 \maintain_unincluded_children false
42 InsetLayout Flex:MenuItem
51 \newcommand*{\menuitem}[1]{{\sffamily #1}}
54 # In case we need to do with sans...
55 #InsetLayout CharStyle:Code
60 #\renewcommand{\code}[1]{{\sffamily #1}}
65 \language_package default
70 \font_typewriter default
72 \font_default_family default
73 \use_non_tex_fonts false
79 \default_output_format default
81 \bibtex_command default
82 \index_command default
86 \pdf_title "LyX Configuration Manual"
87 \pdf_author "LyX Team"
88 \pdf_subject "LyX-documentation Customization"
89 \pdf_keywords "LyX, documentation, customization"
91 \pdf_bookmarksnumbered true
92 \pdf_bookmarksopen true
93 \pdf_bookmarksopenlevel 1
98 \pdf_pdfusetitle false
99 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
102 \use_package amsmath 0
103 \use_package amssymb 0
105 \use_package mathdots 1
106 \use_package mathtools 0
107 \use_package mhchem 0
108 \use_package undertilde 0
110 \cite_engine_type numerical
114 \paperorientation portrait
129 \paragraph_separation indent
130 \paragraph_indentation default
131 \quotes_language english
134 \paperpagestyle headings
135 \tracking_changes true
136 \output_changes false
140 \author -712698321 "Jürgen Spitzmüller"
141 \author -195340706 "Georg Baum"
143 \author 1082167584 "Kayvan Sylvan" kayvan@sylvan.com
144 \author 1414654397 "Richard Heck"
150 Customizing LyX: Features for the Advanced User
158 \begin_layout Plain Layout
160 If you have comments or error corrections, please send them to the LyX Documenta
162 \begin_inset CommandInset href
164 target "lyx-docs@lists.lyx.org"
171 \begin_inset Quotes eld
175 \begin_inset Quotes erd
178 in the subject header, and please cc the current maintainer of this file,
179 Richard Heck <rgheck@comcast.net>.
185 \begin_inset Newline newline
189 \begin_inset Newline newline
195 \begin_layout Standard
196 \begin_inset CommandInset toc
197 LatexCommand tableofcontents
204 \begin_layout Standard
205 \begin_inset Note Note
208 \begin_layout Plain Layout
209 Please use change tracking when modifying this document.
210 This makes it easier for our translators to recognize things that have
211 been changed, and it helps the maintainer keep up-to-date with what's been
220 \begin_layout Chapter
224 \begin_layout Standard
225 This manual covers the customization features present in LyX.
226 In it, we discuss issues like keyboard shortcuts, screen previewing options,
227 printer options, sending commands to LyX via the LyX Server, internationalizati
228 on, installing new LaTeX classes and LyX layouts, etc.
229 We can't possibly hope to touch on everything you can change—our developers
230 add new features faster than we can document them—but we will explain the
231 most common customizations and hopefully point you in the right direction
232 for some of the more obscure ones.
235 \begin_layout Standard
236 \begin_inset Branch OutDated
239 \begin_layout Standard
240 Information from previous versions of this document that now seems to be
241 outdated is contained in the OutDated branch of this document.
242 By default, this information will not appear in the LaTeX output.
250 \begin_layout Chapter
251 LyX configuration files
254 \begin_layout Standard
255 This chapter aims to help you to find your way through the LyX configuration
257 Before continuing to read this chapter, you should find out where your
258 LyX library and user directories are by using
259 \begin_inset Flex MenuItem
262 \begin_layout Plain Layout
263 Help\SpecialChar \menuseparator
274 The library directory is the place where LyX places its system-wide configurati
275 on files; the user directory is where you can place your modified versions.
276 We will call the former
277 \begin_inset Flex Code
280 \begin_layout Plain Layout
287 \begin_inset Flex MenuItem
290 \begin_layout Plain Layout
296 in the remainder of this document.
300 \begin_layout Section
302 \begin_inset Flex Code
305 \begin_layout Plain Layout
314 \begin_layout Standard
315 \begin_inset Flex Code
318 \begin_layout Plain Layout
324 and its sub-directories contain a number of files and that can be used
325 to customize LyX's behavior.
326 You can change many of these files from within LyX itself through the
327 \begin_inset Flex MenuItem
330 \begin_layout Plain Layout
331 Tools\SpecialChar \menuseparator
338 Most customization that you will want to do in LyX is possible through
340 However, many other inner aspects of LyX can be customized by modifying
342 \begin_inset Flex Code
345 \begin_layout Plain Layout
352 These files fall in different categories, described in the following subsection
356 \begin_layout Subsection
357 Automatically generated files
360 \begin_layout Standard
361 The files, which are to be found in
362 \begin_inset Flex MenuItem
365 \begin_layout Plain Layout
371 , are generated when you configure LyX.
372 They contain various default values that are guessed by inspection.
373 In general, it is not a good idea to modify them, since they might be overwritt
377 \begin_layout Labeling
378 \labelwidthstring 00.00.0000
379 \begin_inset Flex Code
382 \begin_layout Plain Layout
388 contains defaults for various commands.
391 \begin_layout Labeling
392 \labelwidthstring 00.00.0000
393 \begin_inset Flex Code
396 \begin_layout Plain Layout
402 contains the list of packages that have been recognized by LyX.
403 It is currently unused by the LyX program itself, but the information extracted
404 , and more, is made available with
405 \begin_inset Flex MenuItem
408 \begin_layout Plain Layout
409 Help\SpecialChar \menuseparator
422 \begin_layout Labeling
423 \labelwidthstring 00.00.0000
424 \begin_inset Flex Code
427 \begin_layout Plain Layout
433 the list of text classes that have been found in your
434 \begin_inset Flex Code
437 \begin_layout Plain Layout
443 directories, along with the associated LaTeX document class and their descripti
447 \begin_layout Labeling
448 \labelwidthstring 00.00.0000
449 \begin_inset Flex Code
452 \begin_layout Plain Layout
458 the list of layout modules found in your
459 \begin_inset Flex Code
462 \begin_layout Plain Layout
471 \begin_layout Labeling
472 \labelwidthstring 00.00.0000
473 \begin_inset Flex Code
476 \begin_layout Plain Layout
482 lists of various sorts of LaTeX-related files found on your system
485 \begin_layout Labeling
486 \labelwidthstring 00.00.0000
487 \begin_inset Flex Code
490 \begin_layout Plain Layout
496 is automatically generated during configuration from the file
497 \begin_inset Flex Code
500 \begin_layout Plain Layout
507 It contains information on your LaTeX configuration.
510 \begin_layout Subsection
514 \begin_layout Standard
515 These directories are duplicated between
516 \begin_inset Flex Code
519 \begin_layout Plain Layout
526 \begin_inset Flex Code
529 \begin_layout Plain Layout
536 If a particular files exists in both places, the one in
537 \begin_inset Flex Code
540 \begin_layout Plain Layout
549 \begin_layout Labeling
550 \labelwidthstring 00.00.0000
551 \begin_inset Flex Code
554 \begin_layout Plain Layout
560 this directory contains files with the extension
561 \begin_inset Flex Code
564 \begin_layout Plain Layout
570 that define the keybindings used in LyX.
571 If there exists an internationalized version of the bind file named
572 \begin_inset Flex Code
575 \begin_layout Plain Layout
581 , that will be used first.
584 \begin_layout Labeling
585 \labelwidthstring 00.00.0000
586 \begin_inset Flex Code
589 \begin_layout Plain Layout
595 contains graphics files that can be included in documents.
599 \begin_layout Labeling
600 \labelwidthstring 00.00.0000
601 \begin_inset Flex Code
604 \begin_layout Plain Layout
610 contains LyX documentation files (including the one you are currently reading).
612 \begin_inset Flex Code
615 \begin_layout Plain Layout
621 deserves special attention, as noted above.
622 The internationalized help docs are in subdirectories
623 \begin_inset Flex Code
626 \begin_layout Plain Layout
633 \begin_inset Quotes eld
637 \begin_inset Quotes erd
640 is the ISO language code.
646 \begin_inset CommandInset ref
648 reference "cha:Internationalizing-LyX"
655 \begin_layout Labeling
656 \labelwidthstring 00.00.0000
657 \begin_inset Flex Code
660 \begin_layout Plain Layout
666 contains example files that explain how to use some features.
667 In the file browser, press the
668 \begin_inset Flex MenuItem
671 \begin_layout Plain Layout
680 \begin_layout Labeling
681 \labelwidthstring 00.00.0000
682 \begin_inset Flex Code
685 \begin_layout Plain Layout
691 contains image files that are used by the
692 \begin_inset Flex MenuItem
695 \begin_layout Plain Layout
702 In addition, it also contains the individual icons used in the toolbar
703 and the banners that can be shown when LyX is launched.
706 \begin_layout Labeling
707 \labelwidthstring 00.00.0000
708 \begin_inset Flex Code
711 \begin_layout Plain Layout
717 contains keyboard keymapping files.
723 \begin_inset CommandInset ref
725 reference "sec:International-Keymap-Stuff"
732 \begin_layout Labeling
733 \labelwidthstring 00.00.0000
734 \begin_inset Flex Code
737 \begin_layout Plain Layout
743 contains the text class and module files described in Chapter
748 \begin_inset CommandInset ref
750 reference "cha:Installing-New-Document"
757 \begin_layout Labeling
758 \labelwidthstring 00.00.0000
759 \begin_inset Flex Code
762 \begin_layout Plain Layout
769 \begin_inset Flex Code
772 \begin_layout Plain Layout
778 Python scripts used to convert between LyX versions.
779 These can be run from the command line if, say, you want to batch-convert
783 \begin_layout Labeling
784 \labelwidthstring 00.00.0000
785 \begin_inset Flex Code
788 \begin_layout Plain Layout
794 contains some files that demonstrate the capabilities of the
795 \begin_inset Flex MenuItem
798 \begin_layout Plain Layout
809 Also contains some scripts used by LyX itself.
812 \begin_layout Labeling
813 \labelwidthstring 00.00.0000
814 \begin_inset Flex Code
817 \begin_layout Plain Layout
823 contains the standard LyX template files described in Chapter
828 \begin_inset CommandInset ref
830 reference "sub:Creating-Templates"
837 \begin_layout Labeling
838 \labelwidthstring 00.00.0000
839 \begin_inset Flex Code
842 \begin_layout Plain Layout
848 contains files with the extension
849 \begin_inset Flex Code
852 \begin_layout Plain Layout
858 that define the user interface to LyX.
859 That is, the files define which items appear in which menus and the items
860 appearing on the toolbar.
863 \begin_layout Subsection
864 Files you don't want to modify
867 \begin_layout Standard
868 These files are used internally by LyX and you generally do not need to
869 modify them unless you are a developer.
872 \begin_layout Labeling
873 \labelwidthstring 00.00.0000
874 \begin_inset Flex Code
877 \begin_layout Plain Layout
883 this file contains the list of LyX developers.
884 The contents are displayed with the menu entry
885 \begin_inset Flex MenuItem
888 \begin_layout Plain Layout
889 Help\SpecialChar \menuseparator
902 \begin_layout Labeling
903 \labelwidthstring 00.00.0000
904 \begin_inset Flex Code
907 \begin_layout Plain Layout
913 this is a LaTeX script used during the configuration process.
917 \begin_layout Labeling
918 \labelwidthstring 00.00.0000
919 \begin_inset Flex Code
922 \begin_layout Plain Layout
928 this is the script that is used to re-configure LyX.
929 It creates configuration files in the directory it was run from.
932 \begin_layout Subsection
933 Other files needing a line or two...
936 \begin_layout Labeling
937 \labelwidthstring 00.00.0000
938 \begin_inset Flex Code
941 \begin_layout Plain Layout
947 this contains tables describing how different character encodings can be
951 \begin_layout Labeling
952 \labelwidthstring 00.00.0000
953 \begin_inset Flex Code
956 \begin_layout Plain Layout
962 this file contains the templates available to the new
963 \begin_inset Flex MenuItem
966 \begin_layout Plain Layout
979 \begin_layout Labeling
980 \labelwidthstring 00.00.0000
981 \begin_inset Flex Code
984 \begin_layout Plain Layout
990 this file contains a list of all the languages currently supported by LyX.
991 \change_inserted -195340706 1334775793
995 \begin_layout Labeling
996 \labelwidthstring 00.00.0000
998 \change_inserted -195340706 1334775793
999 \begin_inset Flex Code
1002 \begin_layout Plain Layout
1004 \change_inserted -195340706 1334775793
1010 this file contains translations for internationalized paragraph styles
1012 \begin_inset space \thinspace{}
1016 \begin_inset CommandInset ref
1018 reference "sub:I18n"
1027 \begin_layout Section
1028 Your local configuration directory
1031 \begin_layout Standard
1032 Even if you are using LyX as an unprivileged user, you might want to change
1033 LyX configuration for your own use.
1035 \begin_inset Flex Code
1038 \begin_layout Plain Layout
1044 directory contains all your personal configuration files.
1045 This is the directory described as
1046 \begin_inset Quotes eld
1050 \begin_inset Quotes erd
1054 \begin_inset Flex MenuItem
1057 \begin_layout Plain Layout
1058 Help\SpecialChar \menuseparator
1060 \begin_inset space ~
1069 This directory is used as a mirror of
1070 \begin_inset Flex Code
1073 \begin_layout Plain Layout
1079 , which means that every file in
1080 \begin_inset Flex Code
1083 \begin_layout Plain Layout
1089 is a replacement for the corresponding file in
1090 \begin_inset Flex Code
1093 \begin_layout Plain Layout
1100 Any configuration file described in the above sections can be placed either
1101 in the system-wide directory, in which case it will affect all users, or
1102 in your local directory for your own use.
1105 \begin_layout Standard
1106 To make things clearer, let's provide a few examples:
1109 \begin_layout Itemize
1110 The preferences set in the
1111 \begin_inset Flex MenuItem
1114 \begin_layout Plain Layout
1115 Tools\SpecialChar \menuseparator
1121 dialog are saved to a file
1122 \begin_inset Flex Code
1125 \begin_layout Plain Layout
1132 \begin_inset Flex Code
1135 \begin_layout Plain Layout
1144 \begin_layout Itemize
1145 When you reconfigure using
1146 \begin_inset Flex MenuItem
1149 \begin_layout Plain Layout
1150 Tools\SpecialChar \menuseparator
1157 \begin_inset Flex Code
1160 \begin_layout Plain Layout
1166 script, and the resulting files are written in your local configuration
1168 This means that any additional text class file that you might have added
1170 \begin_inset Flex Code
1173 \begin_layout Plain Layout
1179 will be added to the list of classes in the
1180 \begin_inset Flex MenuItem
1183 \begin_layout Plain Layout
1184 Document\SpecialChar \menuseparator
1193 \begin_layout Itemize
1194 If you get some updated documentation from LyX ftp site and cannot install
1195 it because you do not have sysadmin rights on your system, you can just
1197 \begin_inset Flex Code
1200 \begin_layout Plain Layout
1206 and the items in the
1207 \begin_inset Flex MenuItem
1210 \begin_layout Plain Layout
1216 menu will open them!
1219 \begin_layout Section
1220 Running LyX with multiple configurations
1223 \begin_layout Standard
1224 The configuration freedom of the local configuration directory may not suffice
1225 if you want to have more than one configuration at your disposal.
1226 For example, you may want to be use different key bindings or printer settings
1228 You can achieve this by having several such directories.
1229 You then specify which directory to use at run-time.
1232 \begin_layout Standard
1233 Invoking LyX with the command line switch
1234 \begin_inset Flex Code
1237 \begin_layout Plain Layout
1247 instructs the program to read the configuration from that directory, and
1248 not from the default directory.
1249 (You can determine the default directory by running LyX without the
1250 \begin_inset Flex Code
1253 \begin_layout Plain Layout
1259 switch.) If the specified directory does not exist, LyX offers to create
1260 it for you, just like it does for the default directory on the first time
1261 you run the program.
1262 You can modify the configuration options in this additional user directory
1263 exactly as you would for the default directory.
1264 These directories are completely independent (but read on).
1265 Note that setting the environment variable
1266 \begin_inset Flex Code
1269 \begin_layout Plain Layout
1275 to some value has exactly the same effect.
1278 \begin_layout Standard
1279 Having several configurations also requires more maintenance: if you want
1280 to add a new layout to
1281 \begin_inset Flex Code
1284 \begin_layout Plain Layout
1290 which you want available from all your configurations, you must add it
1291 to each directory separately.
1292 You can avoid this with the following trick: after LyX creates the additional
1293 directory, most of the subdirectories (see above) are empty.
1294 If you want the new configuration to mirror an existing one, replace the
1295 empty subdirectory with a symbolic link to the matching subdirectory in
1296 the existing configuration.
1298 \begin_inset Flex Code
1301 \begin_layout Plain Layout
1307 subdirectory, however, since it contains a file written by the configuration
1308 script (also accessible through
1309 \begin_inset Flex MenuItem
1312 \begin_layout Plain Layout
1313 Tools\SpecialChar \menuseparator
1319 ) which is configuration-specific.
1322 \begin_layout Chapter
1323 The Preferences dialog
1326 \begin_layout Standard
1327 All options of the preferences dialog are described in the Appendix
1329 The Preferences Dialog
1336 For some options you might find here more details.
1339 \begin_layout Section
1341 \begin_inset CommandInset label
1350 \begin_layout Standard
1351 The first step is to define your file formats if they are not already defined.
1353 \begin_inset Flex MenuItem
1356 \begin_layout Plain Layout
1357 Tools\SpecialChar \menuseparator
1365 \begin_inset Flex MenuItem
1368 \begin_layout Plain Layout
1369 File Handling\SpecialChar \menuseparator
1376 \begin_inset Flex MenuItem
1379 \begin_layout Plain Layout
1380 New\SpecialChar \ldots{}
1386 button to define your new format.
1388 \begin_inset Flex MenuItem
1391 \begin_layout Plain Layout
1397 field contains the name used to identify the format in the GUI.
1399 \begin_inset Flex MenuItem
1402 \begin_layout Plain Layout
1408 is used to identify the format internally.
1409 You will also need to enter a file extension.
1410 These are all required.
1412 \begin_inset Flex MenuItem
1415 \begin_layout Plain Layout
1421 field is used to provide a keyboard shortcut on the menus.
1422 (For example, pressing
1423 \begin_inset Flex MenuItem
1426 \begin_layout Plain Layout
1433 \begin_inset Flex MenuItem
1436 \begin_layout Plain Layout
1437 View\SpecialChar \menuseparator
1438 View (Other Formats)\SpecialChar \menuseparator
1447 \begin_layout Standard
1449 \begin_inset Flex MenuItem
1452 \begin_layout Plain Layout
1459 \begin_inset Flex MenuItem
1462 \begin_layout Plain Layout
1469 For example, you might want to use
1470 \begin_inset Flex MenuItem
1473 \begin_layout Plain Layout
1479 to view PostScript files.
1480 You can enter the command needed to start the program in the corresponding
1482 In defining this command, you can use the four variables listed in the
1484 The viewer is launched when you view an image in LyX or use the
1485 \begin_inset Flex MenuItem
1488 \begin_layout Plain Layout
1495 The editor is for example launched when you right-click on an image and
1497 \begin_inset Flex MenuItem
1500 \begin_layout Plain Layout
1506 in the appearing context menu.
1509 \begin_layout Standard
1511 \change_inserted -195340706 1329851811
1513 \begin_inset Flex MenuItem
1516 \begin_layout Plain Layout
1522 type of a format is optional, but if it is specified, it must be unique
1524 It is used to detect files of this format from the file contents.
1525 For some important file formats there is no MIME type officially registered
1527 \begin_inset CommandInset href
1530 target "http://www.iana.org/assignments/media-types/"
1535 Therefore LyX uses the extended list of MIME types as specified by
1536 \begin_inset CommandInset href
1538 name "freedesktop.org"
1539 target "http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec"
1546 \begin_layout Standard
1548 \begin_inset Flex MenuItem
1551 \begin_layout Plain Layout
1557 option tells LyX that a format is suitable for document export.
1558 If this is set and if a suitable conversion route exists (see sec.
1559 \begin_inset space \thinspace{}
1563 \begin_inset CommandInset ref
1565 reference "sec:Converters"
1569 ), the format will appear in the
1570 \begin_inset Flex MenuItem
1573 \begin_layout Plain Layout
1574 File\SpecialChar \menuseparator
1581 The format will also appear in the
1582 \begin_inset Flex MenuItem
1585 \begin_layout Plain Layout
1591 menu if a viewer is specified for the format.
1592 Pure image formats, such as
1593 \begin_inset Flex Code
1596 \begin_layout Plain Layout
1602 , should not use this option.
1603 Formats that can both represent vector graphics and documents like
1604 \begin_inset Flex Code
1607 \begin_layout Plain Layout
1616 \begin_layout Standard
1618 \begin_inset Flex MenuItem
1621 \begin_layout Plain Layout
1622 Vector graphics format
1627 tells LyX that a format can contain vector graphics.
1628 This information is used to determine the target format of included graphics
1630 \begin_inset Flex MenuItem
1633 \begin_layout Plain Layout
1640 Included graphics may need to be converted to either
1641 \begin_inset Flex MenuItem
1644 \begin_layout Plain Layout
1651 \begin_inset Flex MenuItem
1654 \begin_layout Plain Layout
1661 \begin_inset Flex MenuItem
1664 \begin_layout Plain Layout
1671 \begin_inset Flex MenuItem
1674 \begin_layout Plain Layout
1680 cannot handle other image formats.
1681 If an included graphic is not already in
1682 \begin_inset Flex MenuItem
1685 \begin_layout Plain Layout
1692 \begin_inset Flex MenuItem
1695 \begin_layout Plain Layout
1702 \begin_inset Flex MenuItem
1705 \begin_layout Plain Layout
1711 format, it is converted to
1712 \begin_inset Flex MenuItem
1715 \begin_layout Plain Layout
1721 if the vector format option is set, and otherwise to
1722 \begin_inset Flex MenuItem
1725 \begin_layout Plain Layout
1734 \begin_layout Section
1738 \begin_layout Standard
1739 Since all conversions from one format to another take place in LyX's temporary
1740 directory, it is sometimes necessary to modify a file before copying it
1741 to the temporary directory in order that the conversion may be performed.
1745 \begin_layout Plain Layout
1746 For example, the file may refer to other files—images, for example—using
1747 relative file names, and these may become invalid when the file is copied
1748 to the temporary directory.
1753 This is done by a Copier: It copies a file to (or from) the temporary directory
1754 and may modify it in the process.
1757 \begin_layout Standard
1758 The definitions of the copiers may use four variables:
1761 \begin_layout Labeling
1762 \labelwidthstring 00.00.0000
1763 \begin_inset Flex Code
1766 \begin_layout Plain Layout
1772 The LyX system directory (e.
1773 \begin_inset space \thinspace{}
1777 \begin_inset space \space{}
1781 \begin_inset Flex MenuItem
1784 \begin_layout Plain Layout
1793 \begin_layout Labeling
1794 \labelwidthstring 00.00.0000
1795 \begin_inset Flex Code
1798 \begin_layout Plain Layout
1807 \begin_layout Labeling
1808 \labelwidthstring 00.00.0000
1809 \begin_inset Flex Code
1812 \begin_layout Plain Layout
1819 \change_inserted 1082167584 1348453985
1823 \begin_layout Labeling
1824 \labelwidthstring 00.00.0000
1826 \change_inserted 1082167584 1348453986
1827 $$b The base name (without filename extension) in the LyX temporary directory
1830 \begin_layout Labeling
1831 \labelwidthstring 00.00.0000
1833 \change_inserted 1082167584 1348453986
1834 $$p The full directory path of the LyX temporary directory
1837 \begin_layout Labeling
1838 \labelwidthstring 00.00.0000
1840 \change_inserted 1082167584 1348453986
1841 $$r The full pathname to the original LyX file being processed
1844 \begin_layout Labeling
1845 \labelwidthstring 00.00.0000
1847 \change_inserted 1082167584 1348453986
1848 $$f The filename (without any directory path) of the LyX file.
1851 \begin_layout Labeling
1852 \labelwidthstring 00.00.0000
1853 \begin_inset Flex Code
1856 \begin_layout Plain Layout
1863 \change_inserted 1082167584 1348453720
1867 \begin_layout Standard
1868 The latter should be the filename as it would be used in a LaTeX's
1875 It is relevant only when exporting files suitable for such inclusion.
1878 \begin_layout Standard
1879 Copiers can be used to do almost anything with output files.
1880 For example, suppose you want generated pdf files to be copied to a special
1882 \begin_inset Flex Code
1885 \begin_layout Plain Layout
1892 Then you could write a shell script such as this one:
1895 \begin_layout Standard
1896 \begin_inset listings
1900 \begin_layout Plain Layout
1905 \begin_layout Plain Layout
1910 \begin_layout Plain Layout
1912 TOFILE=`basename $2`
1915 \begin_layout Plain Layout
1917 cp $FROMFILE /home/you/pdf/$TOFILE
1922 Save it in your local LyX directory—say,
1923 \begin_inset Flex Code
1926 \begin_layout Plain Layout
1927 /home/you/.lyx/scripts/pdfcopier.sh
1932 —and make it executable, if you need to do so on your platform.
1934 \begin_inset Flex MenuItem
1937 \begin_layout Plain Layout
1938 Tools\SpecialChar \menuseparator
1944 dialog, select under
1945 \begin_inset Flex MenuItem
1948 \begin_layout Plain Layout
1949 File Handling\SpecialChar \menuseparator
1956 \begin_inset Flex MenuItem
1959 \begin_layout Plain Layout
1965 format—or one of the other pdf formats—and enter
1966 \begin_inset Flex Code
1969 \begin_layout Plain Layout
1970 pdfcopier.sh $$i $$o
1976 \begin_inset Flex MenuItem
1979 \begin_layout Plain Layout
1989 \begin_layout Standard
1990 Copiers are used by LyX in various of its own conversions.
1991 For example, if appropriate programs are found, LyX will automatically
1992 install copiers for the
1993 \begin_inset Flex MenuItem
1996 \begin_layout Plain Layout
2003 \begin_inset Flex MenuItem
2006 \begin_layout Plain Layout
2008 \begin_inset space ~
2017 When these formats are exported, the copier sees that not just the main
2018 HTML file but various associated files (style files, images, etc.) are also
2020 All these files are written to a subdirectory of the directory in which
2021 the original LyX file was found.
2025 \begin_layout Plain Layout
2026 This copier can be customized.
2028 \begin_inset Quotes eld
2032 \begin_inset Quotes erd
2035 argument takes a comma-separated list of extensions to be copied; if it
2036 is omitted, all files will be copied.
2038 \begin_inset Quotes eld
2042 \begin_inset Quotes erd
2045 argument determines the extension added to the generated directory.
2047 \begin_inset Quotes eld
2051 \begin_inset Flex MenuItem
2054 \begin_layout Plain Layout
2061 \begin_inset Quotes erd
2064 , so HTML generated from
2065 \begin_inset Flex MenuItem
2068 \begin_layout Plain Layout
2069 /path/to/filename.lyx
2075 \begin_inset Flex MenuItem
2078 \begin_layout Plain Layout
2079 /path/to/filename.html.LyXconv
2093 \begin_layout Section
2095 \begin_inset CommandInset label
2097 name "sec:Converters"
2104 \begin_layout Standard
2105 You can define your own Converters to convert files between different formats.
2107 \begin_inset Flex MenuItem
2110 \begin_layout Plain Layout
2111 Tools\SpecialChar \menuseparator
2112 Preferences\SpecialChar \menuseparator
2113 File Handling\SpecialChar \menuseparator
2122 \begin_layout Standard
2123 To define a new converter, select the
2124 \begin_inset Flex MenuItem
2127 \begin_layout Plain Layout
2129 \begin_inset space ~
2138 \begin_inset Flex MenuItem
2141 \begin_layout Plain Layout
2143 \begin_inset space ~
2151 from the drop-down lists, enter the command needed for the conversion,
2153 \begin_inset Flex MenuItem
2156 \begin_layout Plain Layout
2163 Several variables can be used in the definition of converters:
2166 \begin_layout Labeling
2167 \labelwidthstring 00.00.0000
2168 \begin_inset Flex Code
2171 \begin_layout Plain Layout
2177 The LyX system directory
2180 \begin_layout Labeling
2181 \labelwidthstring 00.00.0000
2182 \begin_inset Flex Code
2185 \begin_layout Plain Layout
2194 \begin_layout Labeling
2195 \labelwidthstring 00.00.0000
2196 \begin_inset Flex Code
2199 \begin_layout Plain Layout
2208 \begin_layout Labeling
2209 \labelwidthstring 00.00.0000
2210 \begin_inset Flex Code
2213 \begin_layout Plain Layout
2219 The base filename of the input file (i.
2220 \begin_inset space \thinspace{}
2223 g., without the extension)
2226 \begin_layout Labeling
2227 \labelwidthstring 00.00.0000
2228 \begin_inset Flex Code
2231 \begin_layout Plain Layout
2237 The path to the input file
2240 \begin_layout Labeling
2241 \labelwidthstring 00.00.0000
2242 \begin_inset Flex Code
2245 \begin_layout Plain Layout
2251 The path to the original input file (this is different from $$p when a
2252 chain of converters is called)
2255 \begin_layout Labeling
2256 \labelwidthstring 00.00.0000
2257 \begin_inset Flex Code
2260 \begin_layout Plain Layout
2266 The iconv name for the encoding of the document.
2269 \begin_layout Standard
2271 \begin_inset Flex MenuItem
2274 \begin_layout Plain Layout
2276 \begin_inset space ~
2284 field you can enter the following flags, separated by commas:
2287 \begin_layout Labeling
2288 \labelwidthstring 00.00.0000
2289 \begin_inset Flex Code
2292 \begin_layout Plain Layout
2298 This converter runs some form of LaTeX.
2299 This will make LyX's LaTeX error logs available.
2302 \begin_layout Labeling
2303 \labelwidthstring 00.00.0000
2304 \begin_inset Flex Code
2307 \begin_layout Plain Layout
2314 \begin_inset Flex MenuItem
2317 \begin_layout Plain Layout
2323 file for the conversion.
2324 \change_inserted 1414654397 1337693117
2328 \begin_layout Labeling
2329 \labelwidthstring 00.00.0000
2331 \change_inserted 1414654397 1337693188
2332 \begin_inset Flex Code
2335 \begin_layout Plain Layout
2337 \change_inserted 1414654397 1337693129
2346 \begin_inset Quotes eld
2350 \begin_inset Quotes erd
2353 file from the backend, which in practice means a LaTeX file like the one
2354 we would export, without
2355 \begin_inset Flex Code
2358 \begin_layout Plain Layout
2360 \change_inserted 1414654397 1337693184
2373 \begin_layout Labeling
2374 \labelwidthstring 00.00.0000
2375 \begin_inset Flex Code
2378 \begin_layout Plain Layout
2387 \begin_layout Standard
2388 The following three flags are not really flags at all because they take
2390 \begin_inset Flex MenuItem
2393 \begin_layout Plain Layout
2395 \begin_inset space ~
2399 \begin_inset space ~
2410 \begin_layout Labeling
2411 \labelwidthstring 00.00.0000
2412 \begin_inset Flex Code
2415 \begin_layout Plain Layout
2421 If set, the converter's standard error will be redirected to a file
2422 \begin_inset Flex Code
2425 \begin_layout Plain Layout
2431 , and the script given as argument will be run as:
2432 \begin_inset Flex Code
2435 \begin_layout Plain Layout
2436 script < infile.out > infile.log
2442 The argument may contain
2443 \begin_inset Flex Code
2446 \begin_layout Plain Layout
2455 \begin_layout Labeling
2456 \labelwidthstring 00.00.0000
2457 \begin_inset Flex Code
2460 \begin_layout Plain Layout
2466 The name of the directory in which the converter will dump the generated
2468 LyX will not create this directory, and it does not copy anything into
2469 it, though it will copy this directory to the destination.
2470 The argument may contain
2471 \begin_inset Flex Code
2474 \begin_layout Plain Layout
2480 , which will be replaced by the base name of the input and output files,
2481 respectively, when the directory is copied.
2482 \begin_inset Newline newline
2485 Note that resultdir and usetempdir make no sense together.
2486 The latter will be ignored if the former is given.
2489 \begin_layout Labeling
2490 \labelwidthstring 00.00.0000
2491 \begin_inset Flex Code
2494 \begin_layout Plain Layout
2500 Determines the output file name and may, contain
2501 \begin_inset Flex Code
2504 \begin_layout Plain Layout
2511 Sensible only with resultdir and optional even then; if not given, it defaults
2515 \begin_layout Standard
2516 None of these last three are presently used in any of the converters that
2517 are installed with LyX.
2521 \begin_layout Standard
2522 You do not have to define converters for all formats between which you want
2524 For example, you will note that there is no `LyX to PostScript' converter,
2525 but LyX will export PostScript.
2526 It does so by first creating a LaTeX file (no converter needs to be defined
2527 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2528 and finally converting the resulting DVI file to PostScript.
2529 LyX finds such `chains' of converters automatically, and it will always
2530 choose the shortest possible chain.
2531 You can, though, still define multiple conversion methods between file
2533 For example, the standard LyX configuration provides three ways to convert
2534 LaTeX to PDF: Directly, using
2535 \begin_inset Flex MenuItem
2538 \begin_layout Plain Layout
2544 ; via (DVI and) PostScript, using
2545 \begin_inset Flex MenuItem
2548 \begin_layout Plain Layout
2555 \begin_inset Flex MenuItem
2558 \begin_layout Plain Layout
2565 To define such alternate chains, you must define multiple target `file
2566 formats', as described in section
2567 \begin_inset CommandInset ref
2569 reference "sec:Formats"
2574 For example, in the standard configuration, the formats named
2575 \begin_inset Flex MenuItem
2578 \begin_layout Plain Layout
2585 \begin_inset Flex MenuItem
2588 \begin_layout Plain Layout
2595 \begin_inset Flex MenuItem
2598 \begin_layout Plain Layout
2604 are defined, all of which share the extension
2605 \begin_inset Flex MenuItem
2608 \begin_layout Plain Layout
2614 , and which correspond to the conversion methods just mentioned.
2617 \begin_layout Chapter
2618 Internationalizing LyX
2619 \begin_inset CommandInset label
2621 name "cha:Internationalizing-LyX"
2628 \begin_layout Standard
2629 LyX supports using a translated interface.
2630 Last time we checked, LyX provided text in thirty languages.
2631 The language of choice is called your
2636 (For further reading on locale settings, see also the documentation for
2637 locale that comes with your operating system.
2638 For Linux, the manual page for
2639 \begin_inset Flex Code
2642 \begin_layout Plain Layout
2648 could be a good place to start).
2651 \begin_layout Standard
2652 Notice that these translations will work, but do contain a few flaws.
2653 In particular, all dialogs have been designed with the English text in
2654 mind, which means that some of the translated text will be too large to
2655 fit within the space allocated.
2656 This is only a display problem and will not cause any harm.
2657 Also, you will find that some of the translations do not define shortcut
2658 keys for everything.
2659 Sometimes, there are simply not enough free letters to do it.
2660 Other times, the translator just hasn't got around to doing it yet.
2661 Our localization team, which you may wish to join,
2665 \begin_layout Plain Layout
2666 If you are a fluent speaker of a language other than English, joining these
2667 teams is a great way to give back to the LyX community!
2672 will of course try to fix these shortcomings in future versions of LyX.
2675 \begin_layout Section
2679 \begin_layout Subsection
2680 Translating the graphical user interface (text messages).
2683 \begin_layout Standard
2685 \begin_inset Flex Code
2688 \begin_layout Plain Layout
2694 library to handle the internationalization of the interface.
2695 To have LyX speak your favorite language in all menus and dialogs, you
2697 \begin_inset Flex Code
2700 \begin_layout Plain Layout
2706 -file for that language.
2707 When this is available, you'll have to generate a
2708 \begin_inset Flex Code
2711 \begin_layout Plain Layout
2717 -file from it and install the
2718 \begin_inset Flex Code
2721 \begin_layout Plain Layout
2728 The process of doing all of this is explained in the documentation for
2730 \begin_inset Flex Code
2733 \begin_layout Plain Layout
2740 It is possible to do this just for yourself, but if you're going to do
2741 it, you might as well share the results of your labors with the rest of
2743 Send a message to the LyX developers' list for more information about how
2747 \begin_layout Standard
2748 In short, this is what you should do (xx denotes the language code):
2751 \begin_layout Itemize
2752 Check out the LyX source code.
2754 \begin_inset CommandInset href
2756 name "information on the web"
2757 target "http://www.lyx.org/HowToUseSVN"
2764 \begin_layout Itemize
2766 \begin_inset Flex Code
2769 \begin_layout Plain Layout
2775 to the folder of the
2776 \begin_inset Flex Code
2779 \begin_layout Plain Layout
2787 \begin_inset Flex Code
2790 \begin_layout Plain Layout
2798 \begin_inset Flex Code
2801 \begin_layout Plain Layout
2807 doesn't exist anywhere, it can be remade with the console command
2808 \begin_inset Flex Code
2811 \begin_layout Plain Layout
2817 in that directory, or you can use an existing po-file for some other language
2821 \begin_layout Itemize
2823 \begin_inset Flex Code
2826 \begin_layout Plain Layout
2836 \begin_layout Plain Layout
2837 This is just a text file, so it can be edited in any text editor.
2838 But there are also specialized programs that support such editing, such
2843 (for all platforms) or
2852 contains a `mode' for editing
2853 \begin_inset Flex Code
2856 \begin_layout Plain Layout
2867 For some menu- and widget-labels, there are also shortcut keys that should
2869 Those keys are marked after a `|', and should be translated according to
2870 the words and phrases of the language.
2871 You should also fill also out the information at the beginning of the new
2873 \begin_inset Flex Code
2876 \begin_layout Plain Layout
2882 -file with your email-address, etc., so people know where to reach you with
2883 suggestions and entertaining flames.
2886 \begin_layout Standard
2887 If you are just doing this on your own, then:
2890 \begin_layout Itemize
2892 \begin_inset Flex Code
2895 \begin_layout Plain Layout
2902 This can be done with
2903 \begin_inset Flex Code
2906 \begin_layout Plain Layout
2907 msgfmt -o xx.mo < xx.po
2915 \begin_layout Itemize
2917 \begin_inset Flex Code
2920 \begin_layout Plain Layout
2926 -file to your locale-tree, at the correct directory for application messages
2931 xx, and under the name
2932 \begin_inset Flex Code
2935 \begin_layout Plain Layout
2942 \begin_inset space \thinspace{}
2946 \begin_inset space \space{}
2950 \begin_inset Flex Code
2953 \begin_layout Plain Layout
2954 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2964 \begin_layout Standard
2965 As said, however, it would be best if the new
2966 \begin_inset Flex Code
2969 \begin_layout Plain Layout
2975 -file could be added to the LyX distribution, so others can use it.
2976 Adding it involves making additional changes to LyX.
2977 So send an email to the developers' mailing list if you're interested in
2981 \begin_layout Subsubsection
2985 \begin_layout Standard
2986 Sometimes it turns out that one English message needs to be translated into
2987 different messages in the target language.
2988 One example is the message
2989 \begin_inset Flex Code
2992 \begin_layout Plain Layout
2998 which has the German translation
3006 , depending upon exactly what the English
3007 \begin_inset Quotes eld
3011 \begin_inset Quotes erd
3016 \begin_inset Flex Code
3019 \begin_layout Plain Layout
3025 does not handle such ambiguous translations.
3026 Therefore you have to add some context information to the message: Instead
3028 \begin_inset Flex Code
3031 \begin_layout Plain Layout
3038 \begin_inset Flex Code
3041 \begin_layout Plain Layout
3042 To[[as in 'From format x to format y']]
3048 \begin_inset Flex Code
3051 \begin_layout Plain Layout
3052 To[[as in 'From page x to page y']].
3057 Now the two occurrences of
3058 \begin_inset Flex Code
3061 \begin_layout Plain Layout
3068 \begin_inset Flex Code
3071 \begin_layout Plain Layout
3077 and can be translated correctly to
3088 \begin_layout Standard
3089 Of course the context information needs to be stripped off the original
3090 message when no translation is used.
3091 Therefore you have to put it in double square brackets at the end of the
3092 message (see the example above).
3093 The translation mechanism of LyX ensures that everything in double square
3094 brackets at the end of messages is removed before displaying the message.
3097 \begin_layout Subsection
3098 Translating the documentation.
3101 \begin_layout Standard
3102 The online documentation (in the
3103 \begin_inset Flex MenuItem
3106 \begin_layout Plain Layout
3112 -menu) can (and should!) be translated.
3113 If there are translated versions of the documentation available
3117 \begin_layout Plain Layout
3118 As of March 2008, at least some of the documents have been translated into
3119 fourteen languages, with the Tutorial available in a few more.
3124 and the locale is set accordingly, these will be used automagically by
3126 LyX looks for translated versions as
3127 \begin_inset Flex Code
3130 \begin_layout Plain Layout
3131 LyXDir/doc/xx/DocName.lyx
3137 \begin_inset Flex Code
3140 \begin_layout Plain Layout
3146 is the code for the language currently in use.
3147 If there are no translated documents, the default English versions will
3149 Note that the translated versions must have the same filenames (
3150 \begin_inset Flex Code
3153 \begin_layout Plain Layout
3159 above) as the original.
3160 If you feel up to translating the documentation (an excellent way to proof-read
3161 the original documentation by the way!), there are a few things you should
3165 \begin_layout Itemize
3166 Check out the documentation translation web page at
3167 \begin_inset CommandInset href
3169 name "http://www.lyx.org/Translation"
3170 target "http://www.lyx.org/Translation"
3175 That way, you can find out which (if any) documents have already been translate
3176 d into your language.
3177 You can also find out who (if anyone) is organizing the effort to translate
3178 the documentation into your language.
3179 If no one is organizing the effort, please let us know that you're interested.
3182 \begin_layout Standard
3183 Once you get to actually translating, here's a few hints for you that may
3187 \begin_layout Itemize
3188 Join the documentation team! There is information on how to do that in
3189 \begin_inset Flex Code
3192 \begin_layout Plain Layout
3199 \begin_inset Flex MenuItem
3202 \begin_layout Plain Layout
3203 Help\SpecialChar \menuseparator
3209 ), which by the way is the first document you should translate.
3212 \begin_layout Itemize
3213 Learn the typographic conventions for the language you are translating to.
3214 Typography is an ancient art and over the centuries, a great variety of
3215 conventions have developed throughout different parts of the world.
3216 Also study the professional terminology amongst typographers in your country.
3217 Inventing your own terminology will only confuse the users.
3220 (Warning! Typography is addictive!)
3223 \begin_layout Itemize
3224 Make a copy of the document.
3225 This will be your working copy.
3226 You can use this as your personal translated help-file by placing it in
3228 \begin_inset Flex Code
3231 \begin_layout Plain Layout
3240 \begin_layout Itemize
3241 Sometimes the original document (from the LyX-team) will be updated.
3242 Use the source viewer at
3243 \begin_inset CommandInset href
3245 name "http://www.lyx.org/trac/timeline"
3246 target "http://www.lyx.org/trac/timeline"
3250 to see what has been changed.
3251 That way you can easily see which parts of the translated document need
3255 \begin_layout Standard
3256 If you ever find an error in the original document, fix it and notify the
3257 rest of the documentation team of the changes! (You didn't forget to join
3258 the documentation team, did you?)
3261 \begin_layout Standard
3262 \begin_inset Branch OutDated
3265 \begin_layout Section
3266 International Keyboard Support
3269 \begin_layout Standard
3272 [Editor's Note: The following section is by
3280 It needs to be fixed to conform to the new Documentation Style sheet and
3281 to make use of the new v1.0 features.
3282 The whole thing also needs to be merged with the section following it.-jw
3283 It may also be badly out of date.-rh (2008)]
3286 \begin_layout Subsection
3287 Defining Own Keymaps: Keymap File Format
3290 \begin_layout Standard
3291 Let's look at a keyboard definition file a little closer.
3292 It is a plain text file defining
3295 \begin_layout Itemize
3296 key-to-key or key-to-string translations
3299 \begin_layout Itemize
3303 \begin_layout Itemize
3304 dead keys exceptions
3307 \begin_layout Standard
3308 To define key-to-key or key-to-string translation, use this command:
3311 \begin_layout Quotation
3312 \begin_inset Flex Code
3315 \begin_layout Plain Layout
3324 \begin_inset Flex Code
3327 \begin_layout Plain Layout
3336 \begin_layout Standard
3338 \begin_inset Flex Code
3341 \begin_layout Plain Layout
3347 is the key to be translated and
3348 \begin_inset Flex Code
3351 \begin_layout Plain Layout
3357 is the string to be inserted into the document.
3358 To define dead keys, use:
3361 \begin_layout Quotation
3362 \begin_inset Flex Code
3365 \begin_layout Plain Layout
3374 \begin_inset Flex Code
3377 \begin_layout Plain Layout
3386 \begin_layout Standard
3388 \begin_inset Flex Code
3391 \begin_layout Plain Layout
3397 is a keyboard key and
3398 \begin_inset Flex Code
3401 \begin_layout Plain Layout
3408 The following dead keys are supported (shortcut name is in parentheses):
3411 \begin_layout Quotation
3415 \begin_inset space \hfill{}
3421 \begin_layout Quotation
3423 \begin_inset space \hfill{}
3429 \begin_layout Quotation
3431 \begin_inset space \hfill{}
3437 \begin_layout Quotation
3439 \begin_inset space \hfill{}
3445 \begin_layout Quotation
3447 \begin_inset space \hfill{}
3453 \begin_layout Quotation
3455 \begin_inset space \hfill{}
3462 \begin_layout Plain Layout
3474 \begin_layout Quotation
3476 \begin_inset space \hfill{}
3482 \begin_layout Quotation
3484 \begin_inset space \hfill{}
3491 \begin_layout Plain Layout
3503 \begin_layout Quotation
3505 \begin_inset space \hfill{}
3511 \begin_layout Quotation
3513 \begin_inset space \hfill{}
3519 \begin_layout Quotation
3521 \begin_inset space \hfill{}
3528 \begin_layout Plain Layout
3540 \begin_layout Quotation
3542 \begin_inset space \hfill{}
3549 \begin_layout Plain Layout
3561 \begin_layout Quotation
3563 \begin_inset space \hfill{}
3569 \begin_layout Quotation
3570 hungarian umlaut (hug)
3571 \begin_inset space \hfill{}
3577 \begin_layout Quotation
3579 \begin_inset space \hfill{}
3585 \begin_layout Quotation
3587 \begin_inset space \hfill{}
3594 \begin_layout Plain Layout
3606 \begin_layout Standard
3607 Since in many international keyboards there are exceptions to what some
3608 dead keys should do, you can define them using
3611 \begin_layout Quotation
3612 \begin_inset Flex Code
3615 \begin_layout Plain Layout
3623 deadkey key outstring
3626 \begin_layout Standard
3627 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3631 \begin_layout Quotation
3632 \begin_inset Flex Code
3635 \begin_layout Plain Layout
3648 \begin_layout Standard
3649 to make it work correctly.
3650 Also, you have to define as exceptions dead keys over i and j, to remove
3651 the dot from them before inserting an accent mark.
3652 I will change this when the time comes, but so far I haven't had time.
3655 \begin_layout Standard
3656 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3659 \begin_inset Flex Code
3662 \begin_layout Plain Layout
3668 have different meaning.
3670 \begin_inset Flex Code
3673 \begin_layout Plain Layout
3679 marks comments, quotes start and end LaTeX-style commands.
3680 To enter quote, you'll need to use
3681 \begin_inset Flex Code
3684 \begin_layout Plain Layout
3693 \begin_inset Flex Code
3696 \begin_layout Plain Layout
3703 \begin_inset Flex Code
3706 \begin_layout Plain Layout
3717 \begin_layout Standard
3718 If you make a keyboard description file that works for your language, please
3719 mail it to me, so I can include it in the next keymap distribution.
3722 \begin_layout Standard
3723 More keywords will be supported in keymap configuration file in future,
3727 \begin_layout Itemize
3728 \begin_inset Flex Code
3731 \begin_layout Plain Layout
3742 \begin_inset space \hfill{}
3746 \begin_inset Flex Code
3749 \begin_layout Plain Layout
3758 \begin_layout Itemize
3759 \begin_inset Flex Code
3762 \begin_layout Plain Layout
3773 \begin_inset space \hfill{}
3777 \begin_inset Flex Code
3780 \begin_layout Plain Layout
3786 an external keymap translation program
3789 \begin_layout Standard
3790 Also, it should look into
3791 \begin_inset Flex Code
3794 \begin_layout Plain Layout
3800 file for defaults, too (for example, a
3801 \begin_inset Flex Code
3804 \begin_layout Plain Layout
3812 option to include default keyboard).
3820 \begin_layout Section
3821 International Keymap Stuff
3822 \begin_inset CommandInset label
3824 name "sec:International-Keymap-Stuff"
3831 \begin_layout Standard
3832 \begin_inset Note Note
3835 \begin_layout Plain Layout
3836 In doing the revisions on this document in March 2008, I did not look over
3837 this stuff, as I do not understand it.
3838 It would be good if someone else could do so.
3847 \begin_layout Standard
3848 The next two sections describe the
3849 \begin_inset Flex Code
3852 \begin_layout Plain Layout
3861 \begin_inset Flex Code
3864 \begin_layout Plain Layout
3872 file syntax in detail.
3873 These sections should help you design your own key map if the ones provided
3874 do not meet your needs.
3877 \begin_layout Subsection
3881 \begin_layout Standard
3885 \begin_inset Flex Code
3888 \begin_layout Plain Layout
3894 file maps keystrokes to characters or strings.
3895 As the name suggests, it sets a keyboard mapping.
3897 \begin_inset Flex Code
3900 \begin_layout Plain Layout
3911 \begin_inset Flex Code
3914 \begin_layout Plain Layout
3929 \begin_inset Flex Code
3932 \begin_layout Plain Layout
3945 \begin_inset Flex Code
3948 \begin_layout Plain Layout
3957 \begin_inset Flex Code
3960 \begin_layout Plain Layout
3968 are described in this section.
3971 \begin_layout Labeling
3972 \labelwidthstring 00.00.0000
3973 \begin_inset Flex Code
3976 \begin_layout Plain Layout
3984 Map a character to a string
3987 \begin_layout LyX-Code
4002 \begin_layout Standard
4035 the double-quote (")
4052 must be escaped with a preceding backslash (
4063 \begin_layout Standard
4065 \begin_inset Flex MenuItem
4068 \begin_layout Plain Layout
4076 statement to cause the symbol
4077 \begin_inset Flex MenuItem
4080 \begin_layout Plain Layout
4088 to be output for the keystroke
4089 \begin_inset Flex MenuItem
4092 \begin_layout Plain Layout
4103 \begin_layout LyX-Code
4109 \begin_layout Labeling
4110 \labelwidthstring 00.00.0000
4111 \begin_inset Flex Code
4114 \begin_layout Plain Layout
4122 Specify an accent character
4125 \begin_layout LyX-Code
4134 \begin_layout Standard
4135 This will make the cha
4173 This is the dead key
4177 \begin_layout Plain Layout
4184 refers to a key that does not produce a character by itself, but when followed
4185 with another key, produces the desired accent character.
4186 For example, a German characte
4188 r with an umlaut like
4198 can be produced in this manner.
4207 \begin_layout Standard
4220 and then another key not in
4237 followed by the other, not allowed key, as output.
4241 \begin_inset Flex MenuItem
4244 \begin_layout Plain Layout
4252 cancels a dead key, so if
4263 \begin_inset Flex MenuItem
4266 \begin_layout Plain Layout
4275 , the cursor will not go one position backwards but will instead cancel
4291 might have had on the next keystroke.
4295 \begin_layout Standard
4296 The following example specifies that the character ' is to be an acute accent,
4297 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4300 \begin_layout LyX-Code
4303 kmod ' acute aeiouAEIOU
4306 \begin_layout Labeling
4307 \labelwidthstring 00.00.0000
4308 \begin_inset Flex Code
4311 \begin_layout Plain Layout
4317 Specify an exception to the accent character
4320 \begin_layout LyX-Code
4329 \begin_layout Standard
4330 This defines an exce
4371 have been assigned a keystroke with a previous
4374 \begin_inset Flex Code
4377 \begin_layout Plain Layout
4401 must not belong in the
4448 If such a declaration does not exist in
4456 \begin_inset Flex Code
4459 \begin_layout Plain Layout
4493 \begin_inset Flex Code
4496 \begin_layout Plain Layout
4510 \begin_layout Standard
4511 The following command produces causes äi to be produced when you enter acute-i
4515 \begin_layout LyX-Code
4529 \begin_layout Labeling
4530 \labelwidthstring 00.00.0000
4531 \begin_inset Flex Code
4534 \begin_layout Plain Layout
4540 Combine two accent characters
4543 \begin_layout LyX-Code
4549 accent1 accent2 allowed
4552 \begin_layout Standard
4553 This one is getting pretty esoteric.
4554 It allows you to combine the effect
4610 \begin_inset Flex Code
4613 \begin_layout Plain Layout
4641 \begin_layout Standard
4642 Consider this example from the
4643 \begin_inset Flex Code
4646 \begin_layout Plain Layout
4657 \begin_layout LyX-Code
4660 kmod ; acute aeioyvhAEIOYVH
4664 kcomb acute umlaut iyIY
4667 \begin_layout Standard
4668 This allows you to press
4669 \begin_inset Flex MenuItem
4672 \begin_layout Plain Layout
4680 and get the effect of
4681 \begin_inset Flex Code
4684 \begin_layout Plain Layout
4703 in this case cancels the last dead key, so if you press
4704 \begin_inset Flex MenuItem
4707 \begin_layout Plain Layout
4716 \begin_inset Flex Code
4719 \begin_layout Plain Layout
4732 \begin_layout Subsection
4736 \begin_layout Standard
4738 \begin_inset Flex Code
4741 \begin_layout Plain Layout
4749 mapping is performed, a
4750 \begin_inset Flex Code
4753 \begin_layout Plain Layout
4763 file maps the strings that the symbols generate to characters in the current
4765 The LyX distribution currently includes at least the
4766 \begin_inset Flex Code
4769 \begin_layout Plain Layout
4778 \begin_inset Flex Code
4781 \begin_layout Plain Layout
4792 \begin_layout Standard
4794 \begin_inset Flex Code
4797 \begin_layout Plain Layout
4805 file is a sequence of declarations of the form
4808 \begin_layout LyX-Code
4821 \begin_layout Standard
4822 For example, in order to map
4823 \begin_inset Flex MenuItem
4826 \begin_layout Plain Layout
4836 to the corresponding character in the iso-8859-1 set (233), the following
4840 \begin_layout LyX-Code
4848 \begin_layout Standard
4850 \begin_inset Flex Code
4853 \begin_layout Plain Layout
4862 \begin_inset Flex Code
4865 \begin_layout Plain Layout
4883 the same character can apply to more than one string.
4885 \begin_inset Flex Code
4888 \begin_layout Plain Layout
4899 \begin_layout LyX-Code
4911 \begin_inset Newline newline
4927 \begin_layout Standard
4928 If LyX cannot find a mapping for the string produced by the keystroke or
4929 a deadkey sequence, it will check if it looks like an accented char and
4930 try to draw an accent over the character on screen.
4933 \begin_layout Subsection
4937 \begin_layout Standard
4938 There is a second way to add support for international characters through
4939 so-called dead-keys.
4940 A dead-key works in combination with a letter to produce an accented character.
4941 Here, we'll explain how to create a really simple dead-key to illustrate
4945 \begin_layout Standard
4946 Suppose you happen to need the circumflex character,
4947 \begin_inset Quotes eld
4951 \begin_inset Quotes erd
4956 \begin_inset Flex MenuItem
4959 \begin_layout Plain Layout
4966 \begin_inset space ~
4970 \begin_inset Flex MenuItem
4973 \begin_layout Plain Layout
4979 ] to the LyX command
4980 \begin_inset Flex Code
4983 \begin_layout Plain Layout
4990 \begin_inset Flex Code
4993 \begin_layout Plain Layout
5000 Now, whenever you type the
5001 \begin_inset Flex MenuItem
5004 \begin_layout Plain Layout
5010 -key followed by a letter, that letter will have a circumflex accent on
5012 For example, the sequence
5013 \begin_inset Quotes eld
5017 \begin_inset Flex MenuItem
5020 \begin_layout Plain Layout
5027 \begin_inset Quotes erd
5030 produces the letter:
5031 \begin_inset Quotes eld
5035 \begin_inset Quotes erd
5039 If you tried to type
5040 \begin_inset Quotes eld
5044 \begin_inset Flex MenuItem
5047 \begin_layout Plain Layout
5054 \begin_inset Quotes erd
5057 , however, LyX will complain with a beep, since a
5058 \begin_inset Quotes eld
5062 \begin_inset Flex MenuItem
5065 \begin_layout Plain Layout
5072 \begin_inset Quotes erd
5075 never takes a circumflex accent.
5077 \begin_inset Flex MenuItem
5080 \begin_layout Plain Layout
5086 after a dead-key produces the bare-accent.
5087 Please note this last point! If you bind a key to a dead-key, you'll need
5088 to rebind the character on that key to yet another key.
5090 \begin_inset Flex MenuItem
5093 \begin_layout Plain Layout
5099 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5102 \begin_layout Standard
5103 One common way to bind dead-keys is to use
5104 \begin_inset Flex MenuItem
5107 \begin_layout Plain Layout
5114 \begin_inset Flex MenuItem
5117 \begin_layout Plain Layout
5124 \begin_inset Flex MenuItem
5127 \begin_layout Plain Layout
5133 in combination with an accent, like
5134 \begin_inset Quotes eld
5138 \begin_inset Flex MenuItem
5141 \begin_layout Plain Layout
5148 \begin_inset Quotes erd
5152 \begin_inset Quotes eld
5156 \begin_inset Flex MenuItem
5159 \begin_layout Plain Layout
5166 \begin_inset Quotes erd
5170 \begin_inset Quotes eld
5174 \begin_inset Flex MenuItem
5177 \begin_layout Plain Layout
5184 \begin_inset Quotes erd
5188 Another way involves using
5189 \begin_inset Flex Code
5192 \begin_layout Plain Layout
5199 \begin_inset Flex Code
5202 \begin_layout Plain Layout
5208 to set up the special
5209 \begin_inset Flex Code
5212 \begin_layout Plain Layout
5220 \begin_inset Flex Code
5223 \begin_layout Plain Layout
5229 acts in some ways just like
5230 \begin_inset Flex MenuItem
5233 \begin_layout Plain Layout
5239 and permits you to bind keys to accented characters.
5240 You can also turn keys into dead-keys by binding them to something like
5242 \begin_inset Flex Code
5245 \begin_layout Plain Layout
5251 and then binding this symbolic key to the corresponding LyX command.
5255 \begin_layout Plain Layout
5260 : This is exactly what I do in my
5261 \begin_inset Flex Code
5264 \begin_layout Plain Layout
5271 \begin_inset Flex Code
5274 \begin_layout Plain Layout
5282 \begin_inset Flex MenuItem
5285 \begin_layout Plain Layout
5287 \begin_inset space ~
5296 \begin_inset Flex Code
5299 \begin_layout Plain Layout
5305 and a bunch of these
5306 \begin_inset Quotes eld
5310 \begin_inset Flex Code
5313 \begin_layout Plain Layout
5320 \begin_inset Quotes erd
5323 symbolic keys bound such things as
5324 \begin_inset Flex MenuItem
5327 \begin_layout Plain Layout
5329 \begin_inset space ~
5338 \begin_inset Flex MenuItem
5341 \begin_layout Plain Layout
5343 \begin_inset space ~
5352 This is how I produce my accented characters.
5357 You can make just about anything into the
5358 \begin_inset Flex Code
5361 \begin_layout Plain Layout
5368 \begin_inset Flex MenuItem
5371 \begin_layout Plain Layout
5377 keys, a spare function key, etc.
5378 As for the LyX commands that produce accents, check the entry for
5379 \begin_inset Flex Code
5382 \begin_layout Plain Layout
5393 You'll find the complete list there.
5396 \begin_layout Subsection
5397 Saving your Language Configuration
5400 \begin_layout Standard
5401 You can edit your preferences so that your desired language environment
5402 is automatically configured when LyX starts up, via the
5403 \begin_inset Flex MenuItem
5406 \begin_layout Plain Layout
5407 Edit\SpecialChar \menuseparator
5416 \begin_layout Chapter
5417 Installing New Document Classes, Layouts, and Templates
5418 \begin_inset CommandInset label
5420 name "cha:Installing-New-Document"
5425 \begin_inset Argument 1
5428 \begin_layout Plain Layout
5429 Installing New Document Classes
5437 \begin_layout Standard
5438 In this chapter, we describe the procedures for creating and installing
5439 new LyX layout and template files, as well as offer a refresher on correctly
5440 installing new LaTeX document classes.
5444 \begin_layout Standard
5445 First, let us a say a few words about how one ought to think about the relation
5446 between LyX and LaTeX.
5447 The thing to understand is that, in a certain sense, LyX doesn't know anything
5449 Indeed, from LyX's point of view, LaTeX is just one of several
5450 \begin_inset Quotes eld
5454 \begin_inset Quotes erd
5457 in which it is capable of producing output.
5458 Other such formats are DocBook, plaintext, and XHTML.
5459 LaTeX is, of course, a particularly important format, but very little of
5460 the information LyX has about LaTeX is actually contained in the program
5465 \begin_layout Plain Layout
5466 Some commands are sufficiently complex that they are
5467 \begin_inset Quotes eld
5471 \begin_inset Quotes erd
5475 But the developers generally regard this as a Bad Thing.
5480 Rather, that information, even for the standard classes like
5481 \begin_inset Flex Code
5484 \begin_layout Plain Layout
5490 , is contained in `layout files'.
5491 Similarly, LyX itself does not know much about DocBook or XHTML.
5492 What it knows is contained in layout files.
5495 \begin_layout Standard
5496 You can think of the layout file for a given document class as a translation
5497 manual between LyX constructs---paragraphs with their corresponding styles,
5498 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5500 Almost everything LyX knows about
5501 \begin_inset Flex Code
5504 \begin_layout Plain Layout
5510 , for example, is contained in the file
5511 \begin_inset Flex Code
5514 \begin_layout Plain Layout
5520 and in various other files it includes.
5521 For this reason, anyone intending to write layout files should plan to
5522 study the existing files.
5523 A good place to start is with
5524 \begin_inset Flex Code
5527 \begin_layout Plain Layout
5533 , which is included in
5534 \begin_inset Flex Code
5537 \begin_layout Plain Layout
5544 \begin_inset Flex Code
5547 \begin_layout Plain Layout
5553 , and many of the other layout files for document classes.
5554 This file is where sections and the like are defined:
5555 \begin_inset Flex Code
5558 \begin_layout Plain Layout
5564 tells LyX how paragraphs that are marked with the Section, Subsection,
5565 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5568 \begin_inset Flex Code
5571 \begin_layout Plain Layout
5577 file basically just includes several of these
5578 \begin_inset Flex Code
5581 \begin_layout Plain Layout
5590 \begin_layout Standard
5591 Defining the LyX--LaTeX correspondence is not the only thing layout files
5593 Their other job is to define how the LyX constructs themselves will appear
5595 The fact that layout files have these two jobs is often a source of confusion,
5596 because they are completely separate.
5597 Telling LyX how to translate a certain paragraph style into LaTeX does
5598 not tell LyX how to display it; conversely, telling LyX how to display
5599 a certain paragraph style does not tell LyX how to translate it into LaTeX
5600 (let alone tell LaTeX how to display it).
5601 So, in general, when you define a new LyX construct, you must always do
5602 two quite separate things: (i)
5603 \begin_inset space ~
5606 tell LyX how to translate it into LaTeX and (ii)
5607 \begin_inset space ~
5610 tell LyX how to display it.
5613 \begin_layout Standard
5614 Much the same is true, of course, as regards LyX's other backend formats,
5615 though XHTML is in some ways different, because in that case LyX
5619 able, to some extent, to use information about how it should display a
5620 paragraph on the screen to output information (in the form of CSS) about
5621 how the paragraph should be displayed in a browser.
5622 Even in this case, however, the distinction between what LyX does internally
5623 and how things are rendered externally remains in force, and the two can
5624 be controlled separately.
5626 \begin_inset CommandInset ref
5628 reference "sec:Tags-for-XHTML"
5635 \begin_layout Section
5636 Installing new LaTeX files
5639 \begin_layout Standard
5640 Some installations may not include a LaTeX package or class file that you
5641 would like to use within LyX.
5642 For example, you might need FoilTeX, a package for preparing slides for
5643 overhead projectors.
5644 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5645 a user interface for installing such packages.
5646 For example, with MiKTeX, you start the program
5647 \begin_inset Quotes eld
5651 \begin_inset space ~
5655 \begin_inset Quotes erd
5658 to get a list of available packages.
5659 To install one of them, right click on it or use the corresponding toolbar
5663 \begin_layout Standard
5664 If your LaTeX distribution does not provide such a `package manager', or
5665 if the package is not available from your distribution, then follow these
5666 steps to install it manually:
5669 \begin_layout Enumerate
5670 Get the package from
5671 \begin_inset CommandInset href
5674 target "http://www.ctan.org/"
5681 \begin_layout Enumerate
5682 If the package contains a file with the ending
5683 \begin_inset Quotes eld
5687 \begin_inset Flex Code
5690 \begin_layout Plain Layout
5697 \begin_inset Quotes erd
5700 (is the case for FoilTeX) then open a console, change to the folder of
5701 this file and execute the command
5702 \begin_inset Flex Code
5705 \begin_layout Plain Layout
5712 You have now unpacked the package and have all files to install it.
5713 Most LaTeX-packages are not packed and you can skip this step.
5716 \begin_layout Enumerate
5717 Now you need to decide if the package should be available for all users
5722 \begin_layout Enumerate
5723 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5724 for all users on your system, then install it in your `local' TeX tree,
5725 otherwise install it in your own `user' TeX tree.
5726 Where these trees should be created, if they do not already exist, depends
5728 To find this out, look in the file
5729 \begin_inset Flex Code
5732 \begin_layout Plain Layout
5742 \begin_layout Plain Layout
5743 This is usually in the directory
5744 \begin_inset Flex Code
5747 \begin_layout Plain Layout
5753 , though you can execute the command
5754 \begin_inset Flex Code
5757 \begin_layout Plain Layout
5768 The location of the `local' TeX tree is defined by the
5769 \begin_inset Flex Code
5772 \begin_layout Plain Layout
5778 variable; this is usually somewhere like
5779 \begin_inset Flex Code
5782 \begin_layout Plain Layout
5783 /usr/local/share/texmf
5789 The location of the `user' TeX tree is defined by
5790 \begin_inset Flex Code
5793 \begin_layout Plain Layout
5800 \begin_inset Flex Code
5803 \begin_layout Plain Layout
5810 (If these variables are not predefined, you have to define them.) You'll
5811 probably need root permissions to create or modify the `local' tree, but
5812 not for your `user' tree.
5813 \begin_inset Newline newline
5816 In general, it is recommended to install in the user tree because your user
5817 will not be modified or even overwritten when you upgrade your system.
5818 It will typically also be backed up together with everything else when
5819 you backup your home directory (which, of course, you do on a regular basis).
5822 \begin_layout Enumerate
5823 On Windows, if you want the new package to be available for all users on
5824 your system, change to the folder where LaTeX is installed and then change
5826 \begin_inset Flex Code
5829 \begin_layout Plain Layout
5840 (For MiKTeX, this would be by default the folder
5841 \begin_inset Flex Code
5844 \begin_layout Plain Layout
5862 \begin_layout Plain Layout
5863 Note that this will be the correct path only on English installations.
5864 On a German one, it would be
5865 \begin_inset Flex Code
5868 \begin_layout Plain Layout
5882 , and similarly for other languages.
5887 Create there a new folder
5888 \begin_inset Flex Code
5891 \begin_layout Plain Layout
5897 and copy all files of the package into it.
5899 \begin_inset Newline newline
5902 If the package should only available for you or you don't have admin permissions
5903 , do the same, but in the local LaTeX folder.
5905 \begin_inset space \thinspace{}
5909 \begin_inset space ~
5912 2.8 under Windows XP, this would be the folder:
5913 \begin_inset Newline newline
5919 \begin_inset Flex Code
5922 \begin_layout Plain Layout
5925 Documents and Settings
5937 \begin_inset Newline newline
5943 \begin_inset Phantom HPhantom
5946 \begin_layout Plain Layout
5957 \begin_inset Flex Code
5960 \begin_layout Plain Layout
5973 \begin_inset Newline newline
5976 On Vista, it would be:
5977 \begin_inset Newline newline
5981 \begin_inset Flex Code
5984 \begin_layout Plain Layout
6010 \begin_layout Enumerate
6011 Now one only need to tell LaTeX that there are new files.
6012 This depends on the used LaTeX-Distribution:
6016 \begin_layout Enumerate
6017 For TeXLive execute the command
6018 \begin_inset Flex Code
6021 \begin_layout Plain Layout
6028 If you installed the package for all users, then you will probably need
6029 to have root permissions for that.
6032 \begin_layout Enumerate
6033 For MiKTeX, if you have installed the package for all users, start the program
6035 \begin_inset Quotes eld
6039 \begin_inset space ~
6043 \begin_inset Quotes erd
6046 and press the button marked
6047 \begin_inset Quotes eld
6051 \begin_inset Quotes erd
6055 Otherwise start the program
6056 \begin_inset Quotes eld
6060 \begin_inset Quotes erd
6067 \begin_layout Enumerate
6068 Finally, you need to tell LyX that there are new packages available.
6069 So, in LyX, use the menu
6070 \begin_inset Flex MenuItem
6073 \begin_layout Plain Layout
6076 \SpecialChar \menuseparator
6082 and then restart LyX.
6085 \begin_layout Standard
6086 Now the package is installed.
6087 In our example, the document class
6088 \begin_inset Flex Code
6091 \begin_layout Plain Layout
6093 \begin_inset space ~
6100 \begin_layout Plain Layout
6112 will now be available under
6113 \begin_inset Flex MenuItem
6116 \begin_layout Plain Layout
6117 Document\SpecialChar \menuseparator
6118 Settings\SpecialChar \menuseparator
6128 \begin_layout Standard
6129 If you would like to use a LaTeX document class that is not even listed
6131 \begin_inset Flex MenuItem
6134 \begin_layout Plain Layout
6135 Document\SpecialChar \menuseparator
6136 Settings\SpecialChar \menuseparator
6142 , then you need to create a `layout' file for it.
6143 That is the topic of the next section.
6146 \begin_layout Section
6147 Types of layout files
6150 \begin_layout Standard
6151 This section describes the various sorts of LyX files that contain layout
6153 These files describe various paragraph and character styles, determining
6154 how LyX should display them and how they should be translated into LaTeX,
6155 DocBook, XHTML, or whatever output format is being used.
6159 \begin_layout Standard
6160 We shall try to provide a thorough description of the process of writing
6162 However, there are so many different types of documents supported even
6163 by just LaTeX that we can't hope to cover every different possibility or
6164 problem you might encounter.
6165 The LyX users' list is frequented by people with lots of experience with
6166 layout design who are willing to share what they've learned, so please
6167 feel free to ask questions there.
6170 \begin_layout Standard
6171 As you prepare to write a new layout, it is extremely helpful to look at
6172 the layouts distributed with LyX.
6173 If you write a LyX layout for a LaTeX document class that might also be
6174 used by others, or write a module that might be useful to others, then
6175 you should consider posting your layout to the
6176 \begin_inset CommandInset href
6178 name "layout section on the LyX wiki"
6179 target "http://wiki.lyx.org/Layouts/Layouts"
6183 or even to the LyX developers' list, so that it might be included in LyX
6188 \begin_layout Plain Layout
6189 Note that LyX is licensed under the General Public License, so any material
6190 that is contributed to LyX must be similarly licensed.
6198 \begin_layout Subsection
6200 \begin_inset CommandInset label
6202 name "sub:Layout-modules"
6209 \begin_layout Standard
6210 We have spoken to this point about `layout files'.
6211 But there are different sorts of files that contain layout information.
6212 Layout files, strictly so called, have the
6213 \begin_inset Flex Code
6216 \begin_layout Plain Layout
6222 extension and provide LyX with information about document classes.
6223 As of LyX 1.6, however, layout information can also be contained in layout
6229 \begin_inset Flex Code
6232 \begin_layout Plain Layout
6239 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6240 some modules—such as the
6241 \begin_inset Flex Code
6244 \begin_layout Plain Layout
6250 module—specifically provide support for one package.
6251 In a sense, layout modules are similar to included
6255 \begin_layout Plain Layout
6256 These can have any extension, but by convention have the
6257 \begin_inset Flex Code
6260 \begin_layout Plain Layout
6272 \begin_inset Flex Code
6275 \begin_layout Plain Layout
6281 —in that modules are not specific to a given document class but may be used
6282 with many different classes.
6283 The difference is that using an included file with
6284 \begin_inset Flex Code
6287 \begin_layout Plain Layout
6293 requires editing that file.
6294 Modules, by contrast, are selected in the
6295 \begin_inset Flex MenuItem
6298 \begin_layout Plain Layout
6299 Document\SpecialChar \menuseparator
6308 \begin_layout Standard
6309 Building modules is the easiest way to get started with layout editing,
6310 since it can be as simple as adding a single new paragraph style or flex
6312 But modules may, in principle, contain anything a layout file can contain.
6315 \begin_layout Standard
6316 After creating a new module and copying it to the
6317 \begin_inset Flex Code
6320 \begin_layout Plain Layout
6326 folder, you will need to reconfigure and then restart LyX for the module
6327 to appear in the menu.
6328 However, changes you make to the module will be seen immediately, if you
6330 \begin_inset Flex MenuItem
6333 \begin_layout Plain Layout
6334 Document\SpecialChar \menuseparator
6340 , highlight something, and then hit
6341 \begin_inset Quotes eld
6345 \begin_inset Quotes erd
6351 It is strongly recommended that you save your work before doing this
6356 it is strongly recommended that you not attempt to edit modules while simultaneo
6357 usly working on actual documents
6360 Though of course the developers strive to keep LyX stable in such situations,
6361 syntax errors and the like in your module file could cause strange behavior.
6364 \begin_layout Subsubsection
6368 \begin_layout Standard
6369 Modules are to LyX as packages are to LaTeX.
6370 Sometimes, however, you find yourself wanting a specific inset or character
6371 style just for one document and writing a module that will also be available
6372 to other documents makes little sense.
6373 What you need is LyX's
6374 \begin_inset Quotes eld
6378 \begin_inset Quotes erd
6384 \begin_layout Standard
6385 You will find it under
6387 Document\SpecialChar \menuseparator
6388 Settings\SpecialChar \menuseparator
6392 The large text box allows you to enter anything that you might enter in
6393 a layout file or module.
6394 You can think of a document's local layout, in fact, as a module that belongs
6396 So, in particular, you must enter a
6397 \begin_inset Flex Code
6400 \begin_layout Plain Layout
6407 Any format is acceptable, but one would normally use the format current
6409 (In LyX 2.0, the current layout format is 35.) You should be aware that local
6410 layout is not supported by versions of LyX prior to 1.6, so you should not
6411 use it if you want to be able to export your document to LyX 1.5 or earlier
6412 (without, that is, losing the local layout information).
6413 If you wish to be able to export to 1.6---local layout is supported in 1.6,
6414 though there is no UI for it---then you should use format 11 and, of course,
6415 use only layout constructs that were available in LyX 1.6.
6418 \begin_layout Standard
6419 When you have entered something in the
6420 \begin_inset Flex Code
6423 \begin_layout Plain Layout
6429 pane, LyX will enable the
6430 \begin_inset Quotes eld
6434 \begin_inset Quotes erd
6437 button at the bottom.
6438 Clicking this button will cause LyX to determine whether what you have
6439 entered is valid layout information for the chosen format.
6440 LyX will report the result but, unfortunately, will not tell you what errors
6441 there might have been.
6442 These will be written to the terminal, however, if LyX is started from
6444 You will not be permitted to save your local layout until you have entered
6448 \begin_layout Standard
6449 The warnings at the end of the previous section apply here, too.
6450 Do not play with local layout while you are actually working, especially
6451 if you have not saved your document.
6452 That said, using local layout with a test document can be a very convenient
6453 way to try out layout ideas, or even to start developing a module.
6456 \begin_layout Subsection
6458 \begin_inset Flex MenuItem
6461 \begin_layout Plain Layout
6470 \begin_layout Standard
6471 There are two situations you are likely to encounter when wanting to support
6472 a new LaTeX document class, involving style (
6473 \begin_inset Flex Code
6476 \begin_layout Plain Layout
6482 ) files and LaTeX2e class (
6483 \begin_inset Flex Code
6486 \begin_layout Plain Layout
6493 Supporting a style file is usually fairly easy.
6494 Supporting a new class file is a bit harder.
6495 We'll discuss the former in this section and the latter in the next.
6496 Similar remarks apply, of course, if you want to support a new DocBook
6500 \begin_layout Standard
6501 The easier case is the one in which your new document class is provided
6502 as a style file that is to be used in conjunction with an already supported
6504 For the sake of the example, we'll assume that the style file is called
6506 \begin_inset Flex MenuItem
6509 \begin_layout Plain Layout
6515 and that it is meant to be used with
6516 \begin_inset Flex MenuItem
6519 \begin_layout Plain Layout
6525 , which is a standard class.
6529 \begin_layout Standard
6530 Start by copying the existing class's layout file into your local directory:
6534 \begin_layout Plain Layout
6535 Of course, which directory is your local directory will vary by platform,
6536 and LyX allows you to specify your local directory on startup, too, using
6538 \begin_inset Flex Code
6541 \begin_layout Plain Layout
6555 \begin_layout LyX-Code
6556 cp report.layout ~/.lyx/layouts/myclass.layout
6559 \begin_layout Standard
6561 \begin_inset Flex Code
6564 \begin_layout Plain Layout
6570 and change the line:
6573 \begin_layout LyX-Code
6576 DeclareLaTeXClass{report}
6579 \begin_layout Standard
6583 \begin_layout LyX-Code
6586 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6589 \begin_layout Standard
6593 \begin_layout LyX-Code
6595 \begin_inset Newline newline
6601 \begin_inset Newline newline
6607 \begin_layout Standard
6608 near the top of the file.
6611 \begin_layout Standard
6612 Start LyX and select
6613 \begin_inset Flex MenuItem
6616 \begin_layout Plain Layout
6617 Tools\SpecialChar \menuseparator
6624 Then restart LyX and try creating a new document.
6626 \begin_inset Flex MenuItem
6629 \begin_layout Plain Layout
6635 " as a document class option in the
6636 \begin_inset Flex MenuItem
6639 \begin_layout Plain Layout
6640 Document\SpecialChar \menuseparator
6647 It is likely that some of the sectioning commands and such in your new
6648 class will work differently from how they worked in the base class—
6649 \begin_inset Flex Code
6652 \begin_layout Plain Layout
6658 in this example—so you can fiddle around with the settings for the different
6659 sections if you wish.
6660 The layout information for sections is contained in
6661 \begin_inset Flex Code
6664 \begin_layout Plain Layout
6670 , but you do not need to copy and change this file.
6671 Instead, you can simply add your changes to your layout file, after the
6673 \begin_inset Flex Code
6676 \begin_layout Plain Layout
6682 , which itself includes
6683 \begin_inset Flex Code
6686 \begin_layout Plain Layout
6693 For example, you might add these lines:
6696 \begin_layout LyX-Code
6700 \begin_layout LyX-Code
6704 \begin_layout LyX-Code
6708 \begin_layout LyX-Code
6712 \begin_layout LyX-Code
6716 \begin_layout Standard
6717 to change the font for chapter headings to sans-serif.
6718 This will override (or, in this case, add to) the existing declaration
6719 for the Chapter style.
6723 \begin_layout Standard
6724 Your new package may also provide commands or environments not present in
6726 In this case, you will want to add these to the layout file.
6728 \begin_inset CommandInset ref
6730 reference "sec:TextClass"
6734 for information on how to do so.
6737 \begin_layout Standard
6739 \begin_inset Flex MenuItem
6742 \begin_layout Plain Layout
6748 can be used with several different document classes, and even if it cannot,
6749 you might find it easiest just to write a module that you can load with
6751 The simplest possible such module would be:
6754 \begin_layout LyX-Code
6757 DeclareLyXModule{My Package}
6760 \begin_layout LyX-Code
6764 \begin_layout LyX-Code
6765 #Support for mypkg.sty.
6768 \begin_layout LyX-Code
6770 \begin_inset Newline newline
6776 \begin_layout LyX-Code
6778 \begin_inset Newline newline
6784 \begin_layout LyX-Code
6786 \begin_inset Newline newline
6792 \begin_inset Newline newline
6798 \begin_layout Standard
6799 A more complex module might modify the behavior of some existing constructs
6800 or define some new ones.
6802 \begin_inset CommandInset ref
6804 reference "sec:TextClass"
6811 \begin_layout Subsection
6813 \begin_inset Flex MenuItem
6816 \begin_layout Plain Layout
6825 \begin_layout Standard
6826 There are two possibilities here.
6827 One is that the class file is itself based upon an existing document class.
6828 For example, many thesis classes are based upon
6829 \begin_inset Flex MenuItem
6832 \begin_layout Plain Layout
6839 To see whether yours is, look for a line like
6842 \begin_layout LyX-Code
6848 \begin_layout Standard
6850 If so, then you may proceed largely as in the previous section, though
6852 \begin_inset Flex Code
6855 \begin_layout Plain Layout
6861 line will be different.
6862 If your new class is
6863 \begin_inset Flex Code
6866 \begin_layout Plain Layout
6872 and it is based upon
6873 \begin_inset Flex Code
6876 \begin_layout Plain Layout
6882 , then the line should read:
6886 \begin_layout Plain Layout
6887 And it will be easiest if you save the file to
6888 \begin_inset Flex Code
6891 \begin_layout Plain Layout
6897 : LyX assumes that the document class has the same name as the layout file.
6906 \begin_layout LyX-Code
6909 DeclareLaTeXClass[thesis,book]{thesis}
6912 \begin_layout Standard
6913 If, on the other hand, the new class is not based upon an existing class,
6914 you will probably have to
6915 \begin_inset Quotes eld
6919 \begin_inset Quotes erd
6923 We strongly suggest copying an existing layout file which uses a similar
6924 LaTeX class and then modifying it, if you can do so.
6925 At least use an existing file as a starting point so you can find out what
6926 items you need to worry about.
6927 Again, the specifics are covered below.
6930 \begin_layout Subsection
6932 \begin_inset CommandInset label
6934 name "sub:Creating-Templates"
6941 \begin_layout Standard
6942 Once you have written a layout file for a new document class, you might
6943 want to consider writing a
6948 A template acts as a kind of tutorial for your layout, showing how it might
6949 be used, though containing dummy content.
6950 You can of course look at the various templates included with LyX for ideas.
6953 \begin_layout Standard
6954 Templates are created just like usual documents: using LyX.
6955 The only difference is that usual documents contain all possible settings,
6956 including the font scheme and the paper size.
6957 Usually a user doesn't want a template to overwrite his preferred settings
6958 for such parameters.
6959 For that reason, the designer of a template should remove the corresponding
6961 \begin_inset Flex Code
6964 \begin_layout Plain Layout
6973 \begin_inset Flex Code
6976 \begin_layout Plain Layout
6984 from the template LyX file.
6985 This can be done with any simple text-editor, for example
6986 \begin_inset Flex Code
6989 \begin_layout Plain Layout
6996 \begin_inset Flex Code
6999 \begin_layout Plain Layout
7009 \begin_layout Standard
7010 Put the edited template files you create in
7011 \begin_inset Flex Code
7014 \begin_layout Plain Layout
7020 , copy the ones you use from the global template directory in
7021 \begin_inset Flex Code
7024 \begin_layout Plain Layout
7030 to the same place, and redefine the template path in the
7031 \begin_inset Flex MenuItem
7034 \begin_layout Plain Layout
7035 Tools\SpecialChar \menuseparator
7036 Preferences\SpecialChar \menuseparator
7045 \begin_layout Standard
7046 Note, by the way, that there is a template which has a particular meaning:
7048 \begin_inset Flex Code
7051 \begin_layout Plain Layout
7058 This template is loaded every time you create a new document with
7059 \begin_inset Flex MenuItem
7062 \begin_layout Plain Layout
7063 File\SpecialChar \menuseparator
7069 in order to provide useful defaults.
7070 To create this template from inside LyX, all you have to do is to open
7071 a document with the correct settings, and use the
7072 \begin_inset Flex MenuItem
7075 \begin_layout Plain Layout
7076 Save as Document Defaults
7084 \begin_layout Subsection
7085 Upgrading old layout files
7088 \begin_layout Standard
7089 The format of layout files changes with each LyX release, so old layout
7090 files need to be converted to the new format.
7091 This process has been automated since LyX 1.4: If LyX reads a layout file
7092 in an older format, it automatically calls the script
7093 \begin_inset Flex Code
7096 \begin_layout Plain Layout
7102 to convert it to a temporary file in current format.
7103 The original file is left untouched.
7104 If you use the layout file often, then, you may want to convert it permanently,
7105 so that LyX does not have to do so itself every time.
7106 To do this, you can call the converter manually:
7109 \begin_layout LyX-Code
7110 mv myclass.layout myclass.old
7113 \begin_layout LyX-Code
7114 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
7117 \begin_layout Standard
7119 \begin_inset Flex Code
7122 \begin_layout Plain Layout
7128 with the name of your LyX system directory, of course.
7131 \begin_layout Standard
7132 Note that manual conversion does not affect included files, so these will
7133 have to be converted separately.
7136 \begin_layout Section
7137 \begin_inset CommandInset label
7139 name "sec:TextClass"
7143 The layout file format
7146 \begin_layout Standard
7147 When it's finally time to get your hands dirty and create or edit your own
7148 layout file, the following sections describe what you're up against.
7149 Our advice is to go slowly, save and test often, listen to soothing music,
7150 and enjoy one or two of your favorite adult beverages; more if you are
7151 getting particularly stuck.
7152 It's really not that hard, except that the multitude of options can become
7153 overwhelming if you try to do too much in one sitting.
7154 Go have another adult beverage, just for good measure.
7157 \begin_layout Standard
7158 Note that all the tags used in layout files are case-insensitive.
7160 \begin_inset Flex Code
7163 \begin_layout Plain Layout
7170 \begin_inset Flex Code
7173 \begin_layout Plain Layout
7180 \begin_inset Flex Code
7183 \begin_layout Plain Layout
7189 are really the same tag.
7190 The possible values are printed in brackets after the feature's name.
7191 The default value if a feature isn't specified inside a text class-description
7193 \begin_inset Flex Code
7196 \begin_layout Plain Layout
7205 If the argument has a data type like
7206 \begin_inset Quotes eld
7210 \begin_inset Quotes erd
7214 \begin_inset Quotes eld
7218 \begin_inset Quotes erd
7221 , the default is shown like this:
7222 \begin_inset Flex Code
7225 \begin_layout Plain Layout
7236 \begin_layout Subsection
7237 The document class declaration
7238 \change_inserted -712698321 1349766602
7244 \begin_layout Standard
7245 Lines in a layout file which begin with
7246 \begin_inset Flex Code
7249 \begin_layout Plain Layout
7256 There is one exception to this rule.
7258 \begin_inset Flex Code
7261 \begin_layout Plain Layout
7267 files should begin with
7268 \change_deleted -712698321 1349766533
7272 \change_inserted -712698321 1349766536
7278 \begin_layout LyX-Code
7281 #% Do not delete the line below; configure depends on this
7284 \begin_layout LyX-Code
7290 \change_deleted -712698321 1349766193
7292 \change_inserted -712698321 1349766201
7293 Article (Standard Class)
7296 \change_inserted -712698321 1349766538
7300 \begin_layout LyX-Code
7302 \change_inserted -712698321 1349766581
7307 DeclareCategory{Articles}
7312 \begin_layout Standard
7314 \change_inserted -712698321 1349766695
7318 \change_inserted -712698321 1349766626
7322 \change_deleted -712698321 1349766628
7324 \change_inserted -712698321 1349766628
7327 used when you (re)configure LyX.
7328 The layout file is read by the LaTeX script
7329 \begin_inset Flex Code
7332 \begin_layout Plain Layout
7338 , in a special mode where
7339 \begin_inset Flex Code
7342 \begin_layout Plain Layout
7349 The first line is just a LaTeX comment,
7350 \change_deleted -712698321 1349766656
7353 the second one contains the
7354 \change_inserted -712698321 1349766650
7357 declaration of the text class
7358 \change_inserted -712698321 1349766689
7359 , and the third line contains the optional classification of the class
7362 If these lines appear in a file named
7363 \begin_inset Flex Code
7366 \begin_layout Plain Layout
7372 , then they define a text class of name
7373 \begin_inset Flex Code
7376 \begin_layout Plain Layout
7382 (the name of the layout file) which uses the LaTeX document class
7383 \begin_inset Flex Code
7386 \begin_layout Plain Layout
7392 (the default is to use the same name as the layout).
7394 \begin_inset Quotes eld
7398 \change_deleted -712698321 1349766253
7400 \change_inserted -712698321 1349766260
7401 Article (Standard Class)
7404 \begin_inset Quotes erd
7407 that appears above is used as a description of the text class in the
7408 \begin_inset Flex MenuItem
7411 \begin_layout Plain Layout
7412 Document\SpecialChar \menuseparator
7420 \change_inserted -712698321 1349767097
7422 \begin_inset Quotes eld
7426 \begin_inset Quotes erd
7429 in the example) is also used in the
7430 \begin_inset Flex MenuItem
7433 \begin_layout Plain Layout
7435 \change_inserted -712698321 1349766801
7436 Document\SpecialChar \menuseparator
7442 dialog: the text classes are grouped by these categories (which are usually
7443 genres, so typical categories are
7444 \begin_inset Quotes eld
7448 \begin_inset Quotes erd
7452 \begin_inset Quotes eld
7456 \begin_inset Quotes erd
7460 \begin_inset Quotes eld
7464 \begin_inset Quotes erd
7468 \begin_inset Quotes eld
7472 \begin_inset Quotes erd
7476 \begin_inset Quotes eld
7480 \begin_inset Quotes erd
7484 \begin_inset Quotes eld
7488 \begin_inset Quotes erd
7492 If no category has been declared, the class will be put in the
7493 \begin_inset Quotes eld
7497 \begin_inset Quotes erd
7505 \begin_layout Standard
7506 Let's assume that you wrote your own text class that uses the
7507 \begin_inset Flex Code
7510 \begin_layout Plain Layout
7516 document class, but where you changed the appearance of the section headings.
7517 If you put it in a file
7518 \begin_inset Flex Code
7521 \begin_layout Plain Layout
7527 , the header of this file should be:
7530 \begin_layout LyX-Code
7533 #% Do not delete the line below; configure depends on this
7536 \begin_layout LyX-Code
7541 DeclareLaTeXClass[article]{
7542 \change_deleted -712698321 1349766303
7544 \change_inserted -712698321 1349766303
7548 \change_deleted -712698321 1349766338
7550 \change_inserted -712698321 1349766338
7554 \change_deleted -712698321 1349766340
7556 \change_inserted -712698321 1349766340
7560 \change_deleted -712698321 1349766343
7562 \change_inserted -712698321 1349766343
7566 \change_inserted -712698321 1349767223
7570 \begin_layout LyX-Code
7572 \change_inserted -712698321 1349767223
7577 DeclareCategory{Articles}
7582 \begin_layout Standard
7583 This declares a text class
7584 \begin_inset Flex Code
7587 \begin_layout Plain Layout
7593 , associated with the LaTeX document class
7594 \begin_inset Flex Code
7597 \begin_layout Plain Layout
7604 \begin_inset Quotes eld
7608 \change_deleted -712698321 1349766329
7610 \change_inserted -712698321 1349766329
7614 \change_deleted -712698321 1349766347
7616 \change_inserted -712698321 1349766347
7620 \change_deleted -712698321 1349766350
7622 \change_inserted -712698321 1349766350
7626 \change_deleted -712698321 1349766352
7628 \change_inserted -712698321 1349766352
7632 \begin_inset Quotes erd
7636 If your text class depends on several packages, you can declare it as:
7639 \begin_layout LyX-Code
7642 #% Do not delete the line below; configure depends on this
7645 \begin_layout LyX-Code
7650 DeclareLaTeXClass[article,foo.sty]{
7651 \change_deleted -712698321 1349766366
7653 \change_inserted -712698321 1349766366
7657 \change_deleted -712698321 1349766369
7659 \change_inserted -712698321 1349766369
7663 \change_deleted -712698321 1349766371
7665 \change_inserted -712698321 1349766371
7669 \change_deleted -712698321 1349766374
7671 \change_inserted -712698321 1349766374
7675 \change_inserted -712698321 1349767240
7679 \begin_layout LyX-Code
7681 \change_inserted -712698321 1349767240
7686 DeclareCategory{Articles}
7691 \begin_layout Standard
7692 This indicates that your text class uses the
7693 \begin_inset Flex Code
7696 \begin_layout Plain Layout
7703 Finally, it is also possible to declare classes for DocBook code.
7704 Typical declarations will look like:
7707 \begin_layout LyX-Code
7710 #% Do not delete the line below; configure depends on this
7713 \begin_layout LyX-Code
7718 DeclareDocBookClass[article]{SGML (DocBook
7719 \change_deleted -712698321 1349766387
7721 \change_inserted -712698321 1349766387
7725 \change_inserted -712698321 1349767247
7729 \begin_layout LyX-Code
7731 \change_inserted -712698321 1349767302
7736 DeclareCategory{Articles (DocBook)}
7741 \begin_layout Standard
7742 Note that these declarations can also be given an optional parameter declaring
7743 the name of the document class (but not a list).
7746 \begin_layout Standard
7747 So, to be as explicit as possible, the form of the layout declaration is:
7750 \begin_layout LyX-Code
7755 DeclareLaTeXClass[class,package.sty]{layout description}
7756 \change_inserted -712698321 1349767329
7760 \begin_layout LyX-Code
7762 \change_inserted -712698321 1349767339
7767 DeclareCategory{category}
7772 \begin_layout Standard
7773 The class need only be specified if the name of the LaTeX class file and
7774 the name of the layout file are different or if there are packages to load.
7775 If the name of the class file is not specified, then LyX will simply assume
7776 that it is the same as the name of the layout file.
7779 \begin_layout Standard
7780 When the text class has been modified to your taste, all you have to do
7781 is to copy it either to
7782 \begin_inset Flex Code
7785 \begin_layout Plain Layout
7792 \begin_inset Flex Code
7795 \begin_layout Plain Layout
7802 \begin_inset Flex MenuItem
7805 \begin_layout Plain Layout
7806 Tools\SpecialChar \menuseparator
7812 , exit LyX and restart.
7813 Then your new text class should be available along with the others.
7816 \begin_layout Standard
7817 Once the layout file is installed, you can edit it and see your changes
7818 without having to reconfigure or to restart LyX.
7823 \begin_layout Plain Layout
7824 In versions of LyX prior to 1.6, this was not true.
7825 As a result, editing layout files was very time consuming, since you had
7826 constantly to restart LyX to see changes.
7831 You can force a reload of the current layout by using the LyX function
7833 \begin_inset Flex MenuItem
7836 \begin_layout Plain Layout
7843 There is no default binding for this function—though, of course, you can
7844 bind it to a key yourself.
7845 But you will normally use this function simply by entering it in the mini-buffe
7850 \begin_layout Standard
7856 \begin_inset Flex MenuItem
7859 \begin_layout Plain Layout
7865 is very much an `advanced feature'.
7870 recommended that you save your work before using this function.
7875 recommended that you not attempt to edit layout information while simultaneousl
7876 y working on a document that you care about.
7877 Use a test document.
7878 Syntax errors and the like in your layout file could cause peculiar behavior.
7879 In particular, such errors could cause LyX to regard the current layout
7880 as invalid and to attempt to switch to some other layout.
7884 \begin_layout Plain Layout
7885 Really bad syntax errors may even caused LyX to exit.
7886 This is because certain sorts of errors may make LyX unable to read
7896 The LyX team strives to keep LyX stable in such situations, but safe is
7901 \begin_layout Plain Layout
7902 While we're giving advice: make regular backups.
7903 And be nice to your mother.
7911 \begin_layout Subsection
7912 The Module declaration
7915 \begin_layout Standard
7916 A module must begin with a line like the following:
7919 \begin_layout LyX-Code
7922 DeclareLyXModule[endnotes.sty]{Endnotes}
7925 \begin_layout Standard
7926 The mandatory argument, in curly brackets, is the name of the module, as
7928 \begin_inset Flex MenuItem
7931 \begin_layout Plain Layout
7932 Document\SpecialChar \menuseparator
7933 Settings\SpecialChar \menuseparator
7940 The argument in square brackets is optional: It declares any LaTeX packages
7941 on which the module depends.
7942 Please note that only packages about which LyX knows should be listed in
7943 the square brackets.
7947 \begin_layout Plain Layout
7948 The list of such packages is documented only in the source code.
7953 LyX will not check for arbitrary packages.
7954 It is also possible to use the form
7955 \begin_inset Flex MenuItem
7958 \begin_layout Plain Layout
7964 as an optional argument, which declares that the module can only be used
7965 when there exists a conversion chain between the formats `
7966 \begin_inset Flex Code
7969 \begin_layout Plain Layout
7976 \begin_inset Flex Code
7979 \begin_layout Plain Layout
7988 \begin_layout Standard
7989 The module declaration should then be followed by lines like the following
7993 \begin_layout Plain Layout
7994 Preferably in English if the module should be published with LyX.
7995 This description will appear in the list of messages to be translated and
7996 will be thus translated with the next interface update.
8004 \begin_layout LyX-Code
8008 \begin_layout LyX-Code
8009 #Adds an endnote command, in addition to footnotes.
8013 \begin_layout LyX-Code
8014 #You will need to add
8016 theendnotes in TeX code where you
8019 \begin_layout LyX-Code
8020 #want the endnotes to appear.
8024 \begin_layout LyX-Code
8028 \begin_layout LyX-Code
8029 #Requires: somemodule | othermodule
8032 \begin_layout LyX-Code
8033 #Excludes: badmodule
8036 \begin_layout Standard
8037 The description is used in
8038 \begin_inset Flex MenuItem
8041 \begin_layout Plain Layout
8042 Document\SpecialChar \menuseparator
8043 Settings\SpecialChar \menuseparator
8049 to provide the user with information about what the module does.
8051 \begin_inset Flex Code
8054 \begin_layout Plain Layout
8060 line is used to identify other modules with which this one must be used;
8062 \begin_inset Flex Code
8065 \begin_layout Plain Layout
8071 line is used to identify modules with which this one may not be used.
8072 Both are optional, and, as shown, multiple modules should be separated
8073 with the pipe symbol: |.
8074 Note that the required modules are treated disjunctively:
8078 of the required modules must be used.
8083 excluded module may be used.
8084 Note that modules are identified here by their
8089 \begin_inset Flex Code
8092 \begin_layout Plain Layout
8100 \begin_inset Flex Code
8103 \begin_layout Plain Layout
8110 \begin_inset Flex Code
8113 \begin_layout Plain Layout
8122 \begin_layout Subsection
8126 \begin_layout Standard
8127 The first non-comment line of any layout file, included file, or module
8132 contain the file format number:
8135 \begin_layout Description
8136 \begin_inset Flex Code
8139 \begin_layout Plain Layout
8146 \begin_inset Flex Code
8149 \begin_layout Plain Layout
8155 ] The format of the layout file.
8158 \begin_layout Standard
8159 This tag was introduced with LyX 1.4.0.
8160 Layout files from LyX 1.3.x and earlier don't have an explicit file format
8161 and are considered to be of format 1.
8162 The format for the present version of LyX is format 21.
8163 But each version of LyX is capable of reading earlier versions' layout
8164 files, just as they are capable of reading files produced by earlier versions
8166 There is, however, no provision for converting to earlier formats.
8167 So LyX 1.6.x will not read layout files in format 21 but only files in format
8171 \begin_layout Subsection
8172 \begin_inset CommandInset label
8174 name "sub:General-text-class"
8178 General text class parameters
8181 \begin_layout Standard
8182 These are general parameters that govern the behavior of an entire document
8188 mean that they must appear in
8189 \begin_inset Flex Code
8192 \begin_layout Plain Layout
8198 files rather than in modules.
8199 A module can contain any layout tag.)
8202 \begin_layout Description
8203 \begin_inset Flex Code
8206 \begin_layout Plain Layout
8212 Adds information that will be output in the
8213 \begin_inset Flex Code
8216 \begin_layout Plain Layout
8222 block when this document class is output to XHTML.
8223 Typically, this would be used to output CSS style information, but it can
8224 be used for anything that can appear in
8225 \begin_inset Flex Code
8228 \begin_layout Plain Layout
8236 \begin_inset Quotes eld
8240 \begin_inset Flex Code
8243 \begin_layout Plain Layout
8250 \begin_inset Quotes erd
8256 \begin_layout Description
8257 \begin_inset Flex Code
8260 \begin_layout Plain Layout
8266 Adds CSS styling information.
8267 This will either be output in a
8268 \begin_inset Quotes eld
8272 \begin_inset Flex Code
8275 \begin_layout Plain Layout
8282 \begin_inset Quotes erd
8285 block or, if the user has so chosen, to a separate CSS file.Must end with
8287 \begin_inset Quotes eld
8291 \begin_inset Flex Code
8294 \begin_layout Plain Layout
8301 \begin_inset Quotes erd
8307 \begin_layout Description
8308 \begin_inset Flex Code
8311 \begin_layout Plain Layout
8317 Adds information to the document preamble.
8319 \begin_inset Quotes eld
8323 \begin_inset Flex Code
8326 \begin_layout Plain Layout
8333 \begin_inset Quotes erd
8339 \begin_layout Description
8340 \begin_inset Flex Code
8343 \begin_layout Plain Layout
8349 Defines formats for use in the display of bibliographic information.
8351 \begin_inset CommandInset ref
8353 reference "sub:Citation-format-description"
8359 \begin_inset Quotes eld
8363 \begin_inset Flex Code
8366 \begin_layout Plain Layout
8373 \begin_inset Quotes erd
8379 \begin_layout Description
8380 \begin_inset Flex Code
8383 \begin_layout Plain Layout
8389 Describes various global options supported by the document class.
8391 \begin_inset space ~
8395 \begin_inset CommandInset ref
8397 reference "sub:ClassOptions"
8403 \begin_inset Quotes eld
8407 \begin_inset Flex Code
8410 \begin_layout Plain Layout
8417 \begin_inset Quotes erd
8423 \begin_layout Description
8424 \begin_inset Flex Code
8427 \begin_layout Plain Layout
8434 \begin_inset Flex Code
8437 \begin_layout Plain Layout
8446 \begin_inset Flex Code
8449 \begin_layout Plain Layout
8455 ] Whether the class should
8459 to having one or two columns.
8460 Can be changed in the
8461 \begin_inset Flex MenuItem
8464 \begin_layout Plain Layout
8465 Document\SpecialChar \menuseparator
8474 \begin_layout Description
8475 \begin_inset Flex Code
8478 \begin_layout Plain Layout
8485 \begin_inset Flex Code
8488 \begin_layout Plain Layout
8494 ] This sequence defines the properties for a counter.
8495 If the counter does not yet exist, it is created; if it does exist, it
8498 \begin_inset Quotes eld
8502 \begin_inset Flex Code
8505 \begin_layout Plain Layout
8512 \begin_inset Quotes erd
8516 \begin_inset Newline newline
8520 \begin_inset space ~
8524 \begin_inset CommandInset ref
8526 reference "sub:Counters"
8530 for details on counters.
8533 \begin_layout Description
8534 \begin_inset Flex Code
8537 \begin_layout Plain Layout
8543 Sets the default font used to display the document.
8545 \begin_inset space ~
8549 \begin_inset CommandInset ref
8551 reference "sub:Font-description"
8555 for how to declare fonts.
8557 \begin_inset Quotes eld
8561 \begin_inset Flex Code
8564 \begin_layout Plain Layout
8571 \begin_inset Quotes erd
8577 \begin_layout Description
8578 \begin_inset Flex Code
8581 \begin_layout Plain Layout
8588 \begin_inset Flex Code
8591 \begin_layout Plain Layout
8597 Specifies a module to be included by default with this document class.
8598 The module should be specified by filename without the
8599 \begin_inset Flex Code
8602 \begin_layout Plain Layout
8609 The user can still remove the module, but it will be active at the outset.
8610 (This applies only when new files are created, or when this class is chosen
8611 for an existing document.)
8614 \begin_layout Description
8615 \begin_inset Flex Code
8618 \begin_layout Plain Layout
8625 \begin_inset Flex Code
8628 \begin_layout Plain Layout
8634 ] This is the style that will be assigned to new paragraphs, usually
8635 \begin_inset Flex MenuItem
8638 \begin_layout Plain Layout
8645 This will default to the first defined style if not given, but you are
8646 encouraged to use this directive.
8649 \begin_layout Description
8650 \begin_inset Flex Code
8653 \begin_layout Plain Layout
8660 \begin_inset Flex Code
8663 \begin_layout Plain Layout
8669 ] This tag indicates that the module in question—which should be specified
8670 by filename without the
8671 \begin_inset Flex Code
8674 \begin_layout Plain Layout
8680 extension—cannot be used with this document class.
8681 This might be used in a journal-specific layout file to prevent, say, the
8683 \begin_inset Flex Code
8686 \begin_layout Plain Layout
8692 module that numbers theorems by section.
8697 be used in a module.
8698 Modules have their own way of excluding other modules (see
8699 \begin_inset CommandInset ref
8701 reference "sub:Layout-modules"
8708 \begin_layout Description
8709 \begin_inset Flex Code
8712 \begin_layout Plain Layout
8718 Defines a new float.
8720 \begin_inset space ~
8724 \begin_inset CommandInset ref
8726 reference "sub:Floats"
8732 \begin_inset Quotes eld
8736 \begin_inset Flex Code
8739 \begin_layout Plain Layout
8746 \begin_inset Quotes erd
8752 \begin_layout Description
8753 \begin_inset Flex Code
8756 \begin_layout Plain Layout
8762 Sets the information that will be output in the
8763 \begin_inset Flex Code
8766 \begin_layout Plain Layout
8772 block when this document class is output to XHTML.
8773 Note that this will completely override any prior
8774 \begin_inset Flex Code
8777 \begin_layout Plain Layout
8784 \begin_inset Flex Code
8787 \begin_layout Plain Layout
8795 \begin_inset Flex Code
8798 \begin_layout Plain Layout
8804 if you just want to add material to the preamble.) Must end with
8805 \begin_inset Quotes eld
8809 \begin_inset Flex Code
8812 \begin_layout Plain Layout
8819 \begin_inset Quotes erd
8825 \begin_layout Description
8826 \begin_inset Flex Code
8829 \begin_layout Plain Layout
8835 Sets CSS styling information.
8836 This will either be output in a
8837 \begin_inset Quotes eld
8841 \begin_inset Flex Code
8844 \begin_layout Plain Layout
8851 \begin_inset Quotes erd
8854 block or, if the user has so chosen, to a separate CSS file.
8855 Note that this will completely override any prior
8856 \begin_inset Flex Code
8859 \begin_layout Plain Layout
8866 \begin_inset Flex Code
8869 \begin_layout Plain Layout
8877 \begin_inset Flex Code
8880 \begin_layout Plain Layout
8886 if you just want to add material.) Must end with
8887 \begin_inset Quotes eld
8891 \begin_inset Flex Code
8894 \begin_layout Plain Layout
8901 \begin_inset Quotes erd
8907 \begin_layout Description
8908 \begin_inset Flex Code
8911 \begin_layout Plain Layout
8918 \begin_inset Flex Code
8921 \begin_layout Plain Layout
8927 ] The layout to use for the table of contents, bibliography, and so forth,
8928 when the document is output to HTML.
8929 For articles, this should normally be Section; for books, Chapter.
8930 If it is not given, then LyX will attempt to figure out which layout to
8934 \begin_layout Description
8935 \begin_inset Flex Code
8938 \begin_layout Plain Layout
8945 \begin_inset Flex Code
8948 \begin_layout Plain Layout
8954 ] Modifies the properties of the given counter.
8955 If the counter does not exist, the section is ignored.
8957 \begin_inset Quotes eld
8961 \begin_inset Flex Code
8964 \begin_layout Plain Layout
8971 \begin_inset Quotes erd
8975 \begin_inset Newline newline
8979 \begin_inset space ~
8983 \begin_inset CommandInset ref
8985 reference "sub:Counters"
8989 for details on counters.
8992 \begin_layout Description
8993 \begin_inset Flex Code
8996 \begin_layout Plain Layout
9003 \begin_inset Flex Code
9006 \begin_layout Plain Layout
9012 ] Modifies the properties of the given paragraph style.
9013 If the style does not exist, the section is ignored.
9015 \begin_inset Quotes eld
9019 \begin_inset Flex Code
9022 \begin_layout Plain Layout
9029 \begin_inset Quotes erd
9035 \begin_layout Description
9036 \begin_inset Flex Code
9039 \begin_layout Plain Layout
9045 As its name implies, this command allows you to include another layout
9046 definition file within yours to avoid duplicating commands.
9047 Common examples are the standard layout files, for example,
9048 \begin_inset Flex Code
9051 \begin_layout Plain Layout
9057 , which contains most of the basic layouts.
9060 \begin_layout Description
9061 \begin_inset Flex Code
9064 \begin_layout Plain Layout
9070 This section (re-)defines the layout of an inset.
9071 It can be applied to an existing inset or to a new, user-defined inset,
9072 e.g., a new character style.
9074 \begin_inset Quotes eld
9078 \begin_inset Flex Code
9081 \begin_layout Plain Layout
9088 \begin_inset Quotes erd
9092 \begin_inset Newline newline
9096 \begin_inset space ~
9100 \begin_inset CommandInset ref
9102 reference "sub:Flex-insets-and"
9106 for more information.
9110 \begin_layout Description
9111 \begin_inset Flex Code
9114 \begin_layout Plain Layout
9121 \begin_inset Flex Code
9124 \begin_layout Plain Layout
9130 ] A string that indicates the width of the left margin on the screen, for
9132 \begin_inset Quotes eld
9136 \begin_inset Quotes erd
9140 (Note that this is not a `length', like
9141 \begin_inset Quotes eld
9145 \begin_inset Quotes erd
9151 \begin_layout Description
9152 \begin_inset Flex Code
9155 \begin_layout Plain Layout
9162 \begin_inset Flex Code
9165 \begin_layout Plain Layout
9171 ] This command deletes an existing counter, usually one defined in an included
9175 \begin_layout Description
9176 \begin_inset Flex Code
9179 \begin_layout Plain Layout
9185 This command deletes an existing float.
9186 This is particularly useful when you want to suppress a float that has
9187 been defined in an input file.
9190 \begin_layout Description
9191 \begin_inset Flex Code
9194 \begin_layout Plain Layout
9200 This command deletes an existing style.
9201 This is particularly useful when you want to suppress a style that has
9202 be defined in an input file.
9205 \begin_layout Description
9206 \begin_inset Flex Code
9209 \begin_layout Plain Layout
9215 A string indicating the file format (as defined in the Preferences dialog)
9216 produced by this class.
9217 It is mainly useful when
9218 \begin_inset Flex Code
9221 \begin_layout Plain Layout
9227 is `literate' and one wants to define a new type of literate document.
9228 This string is reset to `docbook', `latex', or `literate' when the correspondin
9230 \begin_inset Flex Code
9233 \begin_layout Plain Layout
9239 parameter is encountered.
9242 \begin_layout Description
9243 \begin_inset Flex Code
9246 \begin_layout Plain Layout
9252 A string indicating what sort of output documents using this class will
9254 At present, the options are: `docbook', `latex', and `literate'.
9257 \begin_layout Description
9258 \begin_inset Flex Code
9261 \begin_layout Plain Layout
9268 \begin_inset Flex Code
9271 \begin_layout Plain Layout
9280 \begin_inset Flex Code
9283 \begin_layout Plain Layout
9290 \begin_inset Flex Code
9293 \begin_layout Plain Layout
9299 ] The default pagestyle.
9300 Can be changed in the
9301 \begin_inset Flex MenuItem
9304 \begin_layout Plain Layout
9305 Document\SpecialChar \menuseparator
9314 \begin_layout Description
9315 \begin_inset Flex Code
9318 \begin_layout Plain Layout
9324 Sets the preamble for the LaTeX document.
9325 Note that this will completely override any prior
9326 \begin_inset Flex Code
9329 \begin_layout Plain Layout
9336 \begin_inset Flex Code
9339 \begin_layout Plain Layout
9347 \begin_inset Flex Code
9350 \begin_layout Plain Layout
9356 if you just want to add material to the preamble.) Must end with
9357 \begin_inset Quotes eld
9361 \begin_inset Flex Code
9364 \begin_layout Plain Layout
9371 \begin_inset Quotes erd
9377 \begin_layout Description
9378 \begin_inset Flex Code
9381 \begin_layout Plain Layout
9388 \begin_inset Flex Code
9391 \begin_layout Plain Layout
9398 \begin_inset Flex Code
9401 \begin_layout Plain Layout
9410 \begin_inset Flex Code
9413 \begin_layout Plain Layout
9419 ] Whether the class already provides the feature
9420 \begin_inset Flex Code
9423 \begin_layout Plain Layout
9430 A feature is in general the name of a package (
9431 \begin_inset Flex Code
9434 \begin_layout Plain Layout
9441 \begin_inset Flex Code
9444 \begin_layout Plain Layout
9450 , \SpecialChar \ldots{}
9452 \begin_inset Flex Code
9455 \begin_layout Plain Layout
9462 \begin_inset Flex Code
9465 \begin_layout Plain Layout
9471 ,\SpecialChar \ldots{}
9472 ); the complete list of supported features is unfortunately not documented
9473 outside the LyX source code—but see
9474 \begin_inset Flex Code
9477 \begin_layout Plain Layout
9483 if you're interested.
9485 \begin_inset Flex MenuItem
9488 \begin_layout Plain Layout
9489 Help\SpecialChar \menuseparator
9495 also gives an overview of the supported packages.
9498 \begin_layout Description
9499 \begin_inset Flex Code
9502 \begin_layout Plain Layout
9509 \begin_inset Flex Code
9512 \begin_layout Plain Layout
9518 ] Indicates that this layout provides the functionality of the module mentioned,
9519 which should be specified by the filename without the
9520 \begin_inset Flex Code
9523 \begin_layout Plain Layout
9530 This will typically be used if the layout includes the module directly,
9531 rather than using the
9532 \begin_inset Flex Code
9535 \begin_layout Plain Layout
9541 tag to indicate that it ought to be used.
9542 It could also be used in a module that provided an alternate implementation
9543 of the same functionality.
9546 \begin_layout Description
9547 \begin_inset Flex Code
9550 \begin_layout Plain Layout
9557 \begin_inset Flex Code
9560 \begin_layout Plain Layout
9566 ] Whether the class requires the feature
9567 \begin_inset Flex Code
9570 \begin_layout Plain Layout
9577 Multiple features must be separated by commas.
9578 Note that you can only request supported features.
9580 \begin_inset Flex Code
9583 \begin_layout Plain Layout
9589 for a list of these.)
9592 \begin_layout Description
9593 \begin_inset Flex Code
9596 \begin_layout Plain Layout
9602 A string that indicates the width of the right margin on the screen, for
9604 \begin_inset Quotes eld
9608 \begin_inset Quotes erd
9614 \begin_layout Description
9615 \begin_inset Flex Code
9618 \begin_layout Plain Layout
9624 Sets which divisions get numbered.
9626 \begin_inset Flex Code
9629 \begin_layout Plain Layout
9638 \begin_layout Description
9639 \begin_inset Flex Code
9642 \begin_layout Plain Layout
9649 \begin_inset Flex Code
9652 \begin_layout Plain Layout
9661 \begin_inset Flex Code
9664 \begin_layout Plain Layout
9670 ] Whether the class-default should be printing on one or both sides of the
9672 Can be changed in the
9673 \begin_inset Flex MenuItem
9676 \begin_layout Plain Layout
9677 Document\SpecialChar \menuseparator
9686 \begin_layout Description
9687 \begin_inset Flex Code
9690 \begin_layout Plain Layout
9696 This sequence defines a paragraph style.
9697 If the style does not yet exist, it is created; if it does exist, its parameter
9700 \begin_inset Quotes eld
9704 \begin_inset Flex Code
9707 \begin_layout Plain Layout
9714 \begin_inset Quotes erd
9718 \begin_inset Newline newline
9722 \begin_inset space ~
9726 \begin_inset CommandInset ref
9728 reference "sub:Paragraph-Styles"
9732 for details on paragraph styles.
9735 \begin_layout Description
9736 \begin_inset Flex Code
9739 \begin_layout Plain Layout
9746 \begin_inset Flex Code
9749 \begin_layout Plain Layout
9755 ] The name of the command or environment to be used with
9756 \begin_inset Flex Code
9759 \begin_layout Plain Layout
9768 \begin_layout Description
9769 \begin_inset Flex Code
9772 \begin_layout Plain Layout
9779 \begin_inset Flex Code
9782 \begin_layout Plain Layout
9791 \begin_inset Flex Code
9794 \begin_layout Plain Layout
9800 ] Indicates what kind of markup is used to define the title of a document.
9802 \begin_inset Flex Code
9805 \begin_layout Plain Layout
9811 means that the macro with name
9812 \begin_inset Flex Code
9815 \begin_layout Plain Layout
9821 will be inserted after the last layout which has
9822 \begin_inset Quotes eld
9826 \begin_inset Flex Code
9829 \begin_layout Plain Layout
9836 \begin_inset Quotes erd
9841 \begin_inset Flex Code
9844 \begin_layout Plain Layout
9850 corresponds to the case where the block of paragraphs which have
9851 \begin_inset Quotes eld
9855 \begin_inset Flex Code
9858 \begin_layout Plain Layout
9865 \begin_inset Quotes erd
9868 should be enclosed into the
9869 \begin_inset Flex Code
9872 \begin_layout Plain Layout
9881 \begin_layout Description
9882 \begin_inset Flex Code
9885 \begin_layout Plain Layout
9891 Sets which divisions are included in the table of contents.
9893 \begin_inset Flex Code
9896 \begin_layout Plain Layout
9905 \begin_layout Subsection
9906 \begin_inset Flex Code
9909 \begin_layout Plain Layout
9916 \begin_inset CommandInset label
9918 name "sub:ClassOptions"
9925 \begin_layout Standard
9927 \begin_inset Flex Code
9930 \begin_layout Plain Layout
9936 section can contain the following entries:
9939 \begin_layout Description
9940 \begin_inset Flex Code
9943 \begin_layout Plain Layout
9950 \begin_inset Flex Code
9953 \begin_layout Plain Layout
9959 ] The list of available font sizes for the document's main font, separated
9961 \begin_inset Quotes eld
9965 \begin_inset Flex Code
9968 \begin_layout Plain Layout
9975 \begin_inset Quotes erd
9981 \begin_layout Description
9982 \begin_inset Flex Code
9985 \begin_layout Plain Layout
9991 Used to set the DTD line with XML-based output classes.
9993 \begin_inset space \thinspace{}
9997 \begin_inset Quotes eld
10000 -//OASIS//DTD DocBook V4.2//EN
10001 \begin_inset Quotes erd
10007 \begin_layout Description
10008 \begin_inset Flex Code
10011 \begin_layout Plain Layout
10018 \begin_inset Flex Code
10021 \begin_layout Plain Layout
10022 string="empty|plain|headings|fancy"
10027 ] The list of available page styles, separated by
10028 \begin_inset Quotes eld
10032 \begin_inset Flex Code
10035 \begin_layout Plain Layout
10042 \begin_inset Quotes erd
10048 \begin_layout Description
10049 \begin_inset Flex Code
10052 \begin_layout Plain Layout
10059 \begin_inset Flex Code
10062 \begin_layout Plain Layout
10068 ] Some document class options, separated by a comma, that will be added
10069 to the optional part of the
10070 \begin_inset Flex Code
10073 \begin_layout Plain Layout
10084 \begin_layout Standard
10086 \begin_inset Flex Code
10089 \begin_layout Plain Layout
10095 section must end with
10096 \begin_inset Quotes eld
10100 \begin_inset Flex Code
10103 \begin_layout Plain Layout
10110 \begin_inset Quotes erd
10116 \begin_layout Subsection
10118 \begin_inset CommandInset label
10120 name "sub:Paragraph-Styles"
10127 \begin_layout Standard
10128 A paragraph style description looks like this:
10132 \begin_layout Plain Layout
10133 Note that this will either define a new style or modify an existing one.
10141 \begin_layout LyX-Code
10148 \begin_layout LyX-Code
10152 \begin_layout LyX-Code
10156 \begin_layout Standard
10157 where the following commands are allowed:
10160 \begin_layout Description
10161 \begin_inset Flex Code
10164 \begin_layout Plain Layout
10171 \begin_inset Flex Code
10174 \begin_layout Plain Layout
10179 , left, right, center
10184 ] Paragraph alignment.
10187 \begin_layout Description
10188 \begin_inset Flex Code
10191 \begin_layout Plain Layout
10198 \begin_inset Flex Code
10201 \begin_layout Plain Layout
10206 , left, right, center
10211 ] A comma separated list of permitted alignments.
10212 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
10214 For example a right-aligned or centered enumeration isn't possible.)
10215 \change_inserted -712698321 1353679769
10219 \begin_layout Description
10221 \change_inserted -712698321 1353680268
10222 \begin_inset Flex Code
10225 \begin_layout Plain Layout
10227 \change_inserted -712698321 1353679781
10234 \begin_inset Flex Code
10237 \begin_layout Plain Layout
10239 \change_inserted -712698321 1353679772
10245 ] Defines argument number <int> of a command\SpecialChar \slash{}
10246 environment associated with
10248 This is useful for things like section headings, and only makes sense with
10250 Every (optional or required) argument of a command or environment -- except
10251 for the required argument that is associated with the content of the paragraph
10252 itself -- has a separate definition, where the number specifies the order
10254 The definition must end with
10255 \begin_inset Flex Code
10258 \begin_layout Plain Layout
10260 \change_inserted -712698321 1353680069
10267 So a command with two optional arguments has:
10271 \begin_layout Quote
10273 \change_inserted -712698321 1353680127
10279 \begin_layout Quote
10281 \change_inserted -712698321 1353680195
10287 \begin_layout Quote
10289 \change_inserted -712698321 1353680135
10295 \begin_layout Quote
10297 \change_inserted -712698321 1353680140
10303 \begin_layout Quote
10305 \change_inserted -712698321 1353680197
10311 \begin_layout Quote
10313 \change_inserted -712698321 1353680147
10319 \begin_layout Standard
10321 \change_inserted -712698321 1353680528
10323 \begin_inset Flex Code
10326 \begin_layout Plain Layout
10328 \change_inserted -712698321 1353680412
10334 definition, the following specifications are possible:
10337 \begin_layout Itemize
10339 \change_inserted -712698321 1353691469
10340 \begin_inset Flex Code
10343 \begin_layout Plain Layout
10345 \change_inserted -712698321 1353680543
10354 \begin_inset Flex Code
10357 \begin_layout Plain Layout
10359 \change_inserted -712698321 1353680567
10365 The string that will appear both in the menu (to insert this argument)
10366 and on the argument inset button.
10367 For the menu, you can define an accelerator by appending the respective
10368 character to the string, divided by
10369 \begin_inset Quotes eld
10373 \begin_inset Quotes erd
10377 \begin_inset space \thinspace{}
10382 \begin_inset Flex Code
10385 \begin_layout Plain Layout
10387 \change_inserted -712698321 1353691482
10388 \begin_inset Quotes eld
10392 \begin_inset Quotes erd
10405 \begin_layout Itemize
10407 \change_inserted -712698321 1353680665
10408 \begin_inset Flex Code
10411 \begin_layout Plain Layout
10413 \change_inserted -712698321 1353680616
10420 \begin_inset Flex Code
10423 \begin_layout Plain Layout
10425 \change_inserted -712698321 1353680623
10431 A longer explanatory text that appears in the tooltip when hovering over
10432 the argument inset.
10435 \begin_layout Itemize
10437 \change_inserted -712698321 1353680874
10438 \begin_inset Flex Code
10441 \begin_layout Plain Layout
10443 \change_inserted -712698321 1353680732
10450 \begin_inset Flex Code
10453 \begin_layout Plain Layout
10455 \change_inserted -712698321 1353680738
10461 Declare if this is a mandatory or an optional argument.
10462 Mandatory arguments will be output empty if not given, while optional arguments
10463 will not be output at all.
10464 By default, mandatory arguments are delimited by
10465 \begin_inset Flex Code
10468 \begin_layout Plain Layout
10470 \change_inserted -712698321 1353680808
10478 , while optional arguments are delimited by
10479 \begin_inset Flex Code
10482 \begin_layout Plain Layout
10484 \change_inserted -712698321 1353680833
10493 \begin_layout Itemize
10495 \change_inserted -712698321 1353681232
10496 \begin_inset Flex Code
10499 \begin_layout Plain Layout
10501 \change_inserted -712698321 1353680879
10508 \begin_inset Flex Code
10511 \begin_layout Plain Layout
10513 \change_inserted -712698321 1353680874
10519 defines another argument (by its number) which this argument requires to
10520 be output if it is itself output.
10522 \begin_inset space \thinspace{}
10525 g., in LaTeX commands, optional arguments often require previous optional
10526 arguments to be output (at least empty), as in
10527 \begin_inset Flex Code
10530 \begin_layout Plain Layout
10532 \change_inserted -712698321 1353688183
10535 command[][arg]{text}
10543 This can be achieved by the statement
10544 \begin_inset Flex Code
10547 \begin_layout Plain Layout
10549 \change_inserted -712698321 1353681031
10558 \begin_inset Flex Code
10561 \begin_layout Plain Layout
10563 \change_inserted -712698321 1353681045
10574 \begin_layout Itemize
10576 \change_inserted -712698321 1353681145
10577 \begin_inset Flex Code
10580 \begin_layout Plain Layout
10582 \change_inserted -712698321 1353681072
10591 \begin_inset Flex Code
10594 \begin_layout Plain Layout
10596 \change_inserted -712698321 1353681067
10602 defines a custom left delimiter (instead of
10603 \begin_inset Flex Code
10606 \begin_layout Plain Layout
10608 \change_inserted -712698321 1353681127
10617 \begin_inset Flex Code
10620 \begin_layout Plain Layout
10622 \change_inserted -712698321 1353681133
10633 \begin_layout Itemize
10635 \change_inserted -712698321 1353681155
10636 \begin_inset Flex Code
10639 \begin_layout Plain Layout
10641 \change_inserted -712698321 1353681149
10648 \begin_inset Flex Code
10651 \begin_layout Plain Layout
10653 \change_inserted -712698321 1353681146
10659 defines a custom right delimiter (instead of
10660 \begin_inset Flex Code
10663 \begin_layout Plain Layout
10665 \change_inserted -712698321 1353681158
10672 \begin_inset Flex Code
10675 \begin_layout Plain Layout
10677 \change_inserted -712698321 1353681161
10689 \begin_layout Description
10690 \begin_inset Flex Code
10693 \begin_layout Plain Layout
10699 Note that this will completely override any prior
10700 \begin_inset Flex Code
10703 \begin_layout Plain Layout
10709 declaration for this style.
10711 \begin_inset Quotes eld
10715 \begin_inset Flex Code
10718 \begin_layout Plain Layout
10725 \begin_inset Quotes erd
10730 \begin_inset CommandInset ref
10732 reference "sub:I18n"
10736 for details on its use.
10739 \begin_layout Description
10740 \begin_inset Flex Code
10743 \begin_layout Plain Layout
10750 \begin_inset Flex Code
10753 \begin_layout Plain Layout
10763 \begin_layout Plain Layout
10764 Note that a `float' here is a real number, such as: 1.5.
10769 The vertical space with which the last of a chain of paragraphs with this
10770 style is separated from the following paragraph.
10771 If the next paragraph has another style, the separations are not simply
10772 added, but the maximum is taken.
10775 \begin_layout Description
10776 \begin_inset Flex Code
10779 \begin_layout Plain Layout
10786 \begin_inset Flex Code
10789 \begin_layout Plain Layout
10795 The category for this style.
10796 This is used to group related styles in the style combobox on the toolbar.
10797 Any string can be used, but you may want to use existing categories with
10802 \begin_layout Description
10803 \begin_inset Flex Code
10806 \begin_layout Plain Layout
10812 Depth of XML command.
10813 Used only with XML-type formats.
10816 \begin_layout Description
10817 \begin_inset Flex Code
10820 \begin_layout Plain Layout
10827 \begin_inset Flex Code
10830 \begin_layout Plain Layout
10836 Copies all the features of an existing style into the current one.
10840 \begin_layout Description
10841 \begin_inset Flex Code
10844 \begin_layout Plain Layout
10850 The name of a style whose preamble should be output
10855 This allows to ensure some ordering of the preamble snippets when macros
10856 definitions depend on one another.
10860 \begin_layout Plain Layout
10861 Note that, besides that functionality, there is no way to ensure any ordering
10863 The ordering that you see in a given version of LyX may change without
10864 warning in later versions.
10872 \begin_layout Description
10873 \begin_inset Flex Code
10876 \begin_layout Plain Layout
10883 \begin_inset Flex Code
10886 \begin_layout Plain Layout
10891 , Box, Filled_Box, Static
10896 ] The type of label that stands at the end of the paragraph (or sequence
10898 \begin_inset Flex Code
10901 \begin_layout Plain Layout
10908 \begin_inset Flex Code
10911 \begin_layout Plain Layout
10918 \begin_inset Flex Code
10921 \begin_layout Plain Layout
10928 \begin_inset Flex Code
10931 \begin_layout Plain Layout
10939 \begin_inset Flex Code
10942 \begin_layout Plain Layout
10949 \begin_inset Quotes eld
10953 \begin_inset Quotes erd
10957 \begin_inset Flex Code
10960 \begin_layout Plain Layout
10967 \begin_inset Flex Code
10970 \begin_layout Plain Layout
10971 \begin_inset space ~
10979 ) is a white (resp.
10980 \begin_inset space ~
10983 black) square suitable for end of proof markers,
10984 \begin_inset Flex Code
10987 \begin_layout Plain Layout
10993 is an explicit text string.
10996 \begin_layout Description
10997 \begin_inset Flex Code
11000 \begin_layout Plain Layout
11007 \begin_inset Flex Code
11010 \begin_layout Plain Layout
11016 ] The string used for a label with a
11017 \begin_inset Flex Code
11020 \begin_layout Plain Layout
11027 \begin_inset Flex Code
11030 \begin_layout Plain Layout
11040 \begin_layout Description
11041 \begin_inset Flex Code
11044 \begin_layout Plain Layout
11050 The font used for both the text body
11056 \begin_inset space ~
11060 \begin_inset CommandInset ref
11062 reference "sub:Font-description"
11067 Note that defining this font automatically defines the
11068 \begin_inset Flex Code
11071 \begin_layout Plain Layout
11078 So you should define this one first if you also want to define
11079 \begin_inset Flex Code
11082 \begin_layout Plain Layout
11091 \begin_layout Description
11092 \begin_inset Flex Code
11095 \begin_layout Plain Layout
11102 \begin_inset CommandInset label
11104 name "des:FreeSpacing"
11109 \begin_inset Flex Code
11112 \begin_layout Plain Layout
11121 \begin_inset Flex Code
11124 \begin_layout Plain Layout
11130 ] Usually LyX doesn't allow you to insert more than one space between words,
11131 since a space is considered as the separation between two words, not a
11132 character or symbol of its own.
11133 This is a very fine thing but sometimes annoying, for example, when typing
11134 program code or plain LaTeX code.
11136 \begin_inset Flex Code
11139 \begin_layout Plain Layout
11146 Note that LyX will create protected blanks for the additional blanks when
11147 in another mode than LaTeX-mode.
11150 \begin_layout Description
11151 \begin_inset Flex Code
11154 \begin_layout Plain Layout
11160 These tags are used with XHTML output.
11162 \begin_inset CommandInset ref
11164 reference "sub:Paragraph-Style-XHTML"
11171 \begin_layout Description
11172 \begin_inset Flex Code
11175 \begin_layout Plain Layout
11181 [[FIXME]] (Used only with XML-type formats.)
11184 \begin_layout Description
11185 \begin_inset Flex Code
11188 \begin_layout Plain Layout
11195 \begin_inset Flex Code
11198 \begin_layout Plain Layout
11204 If 1, marks the style as to be included in the document preamble rather
11205 than in the document body.
11206 This is useful for document classes that want such information as the title
11207 and author to appear in the preamble.
11208 Note that this works only for styles for which the
11209 \begin_inset Flex Code
11212 \begin_layout Plain Layout
11219 \begin_inset Flex Code
11222 \begin_layout Plain Layout
11229 \begin_inset Flex Code
11232 \begin_layout Plain Layout
11241 \begin_layout Description
11242 \begin_inset Flex Code
11245 \begin_layout Plain Layout
11252 \begin_inset Flex Code
11255 \begin_layout Plain Layout
11261 If 1, marks the style as being part of a title block (see also the
11262 \begin_inset Flex Code
11265 \begin_layout Plain Layout
11272 \begin_inset Flex Code
11275 \begin_layout Plain Layout
11284 \begin_layout Description
11285 \begin_inset Flex Code
11288 \begin_layout Plain Layout
11295 \begin_inset Flex Code
11298 \begin_layout Plain Layout
11304 ] This provides extra space between paragraphs that have the same style.
11305 If you put other styles into an environment, each is separated with the
11307 \begin_inset Flex Code
11310 \begin_layout Plain Layout
11317 But the whole items of the environment are additionally separated with
11319 \begin_inset Flex Code
11322 \begin_layout Plain Layout
11329 Note that this is a
11334 \begin_layout Description
11335 \begin_inset Flex Code
11338 \begin_layout Plain Layout
11344 [[FIXME]] (Used only with XML-type formats.)
11347 \begin_layout Description
11348 \begin_inset Flex Code
11351 \begin_layout Plain Layout
11358 \begin_inset Flex Code
11361 \begin_layout Plain Layout
11370 \begin_inset Flex Code
11373 \begin_layout Plain Layout
11379 ] Usually LyX does not allow you to leave a paragraph empty, since it would
11380 lead to empty LaTeX output.
11381 There are some cases where this could be desirable however: in a letter
11382 template, the required fields can be provided as empty fields, so that
11383 people do not forget them; in some special classes, a style can be used
11384 as some kind of break, which does not contain actual text.
11387 \begin_layout Description
11388 \begin_inset Flex Code
11391 \begin_layout Plain Layout
11397 [float=0] The vertical space between the label and the text body.
11398 Only used for labels that are above the text body (
11399 \begin_inset Flex Code
11402 \begin_layout Plain Layout
11409 \begin_inset Flex Code
11412 \begin_layout Plain Layout
11413 Centered_Top_Environment
11421 \begin_layout Description
11422 \begin_inset Flex Code
11425 \begin_layout Plain Layout
11432 \begin_inset Flex Code
11435 \begin_layout Plain Layout
11442 \begin_inset Newline newline
11445 The name of the counter for automatic numbering.
11447 \begin_inset Newline newline
11455 \begin_inset Flex Code
11458 \begin_layout Plain Layout
11465 \begin_inset Flex Code
11468 \begin_layout Plain Layout
11475 In that case, the counter will be stepped each time the style appears.
11477 \begin_inset Newline newline
11485 \begin_inset Flex Code
11488 \begin_layout Plain Layout
11495 \begin_inset Flex Code
11498 \begin_layout Plain Layout
11504 , though this case is a bit complicated.
11505 Suppose you declare
11506 \begin_inset Quotes eld
11510 \begin_inset Flex Code
11513 \begin_layout Plain Layout
11514 LabelCounter myenum
11520 \begin_inset Quotes erd
11524 Then the actual counters used are
11525 \begin_inset Flex Code
11528 \begin_layout Plain Layout
11535 \begin_inset Flex Code
11538 \begin_layout Plain Layout
11545 \begin_inset Flex Code
11548 \begin_layout Plain Layout
11555 \begin_inset Flex Code
11558 \begin_layout Plain Layout
11564 , much as in LaTeX.
11565 These counters must all be declared separately.
11566 \begin_inset Newline newline
11570 \begin_inset CommandInset ref
11572 reference "sub:Counters"
11576 for details on counters.
11579 \begin_layout Description
11580 \begin_inset Flex Code
11583 \begin_layout Plain Layout
11589 The font used for the label.
11591 \begin_inset space ~
11595 \begin_inset CommandInset ref
11597 reference "sub:Font-description"
11604 \begin_layout Description
11605 \begin_inset Flex Code
11608 \begin_layout Plain Layout
11614 Text that indicates how far a label should be indented.
11617 \begin_layout Description
11618 \begin_inset Flex Code
11621 \begin_layout Plain Layout
11628 \begin_inset Flex Code
11631 \begin_layout Plain Layout
11637 ] The horizontal space between the label and the text body.
11638 Only used for labels that are not above the text body.
11641 \begin_layout Description
11642 \begin_inset Flex Code
11645 \begin_layout Plain Layout
11652 \begin_inset Flex Code
11655 \begin_layout Plain Layout
11661 ] The string used for a label with a
11662 \begin_inset Flex Code
11665 \begin_layout Plain Layout
11673 \begin_inset Flex Code
11676 \begin_layout Plain Layout
11682 is set, this string can be contain the special formatting commands described
11684 \begin_inset CommandInset ref
11686 reference "sub:Counters"
11694 \begin_layout Plain Layout
11695 For the sake of backwards compatibility, the string
11696 \begin_inset Flex Code
11699 \begin_layout Plain Layout
11709 will be replaced by the expanded
11710 \begin_inset Flex Code
11713 \begin_layout Plain Layout
11720 \begin_inset Flex Code
11723 \begin_layout Plain Layout
11732 This feature is now obsolete and should be replaced by the mechanisms of
11734 \begin_inset CommandInset ref
11736 reference "sub:Counters"
11748 \begin_layout Description
11749 \begin_inset Flex Code
11752 \begin_layout Plain Layout
11753 LabelStringAppendix
11759 \begin_inset Flex Code
11762 \begin_layout Plain Layout
11768 ] This is used inside the appendix instead of
11769 \begin_inset Flex Code
11772 \begin_layout Plain Layout
11780 \begin_inset Flex Code
11783 \begin_layout Plain Layout
11790 \begin_inset Flex Code
11793 \begin_layout Plain Layout
11794 LabelStringAppendix
11802 \begin_layout Description
11803 \begin_inset Flex Code
11806 \begin_layout Plain Layout
11812 [FIXME] (Used only with XML-type formats.)
11815 \begin_layout Description
11816 \begin_inset Flex Code
11819 \begin_layout Plain Layout
11826 \begin_inset Flex Code
11829 \begin_layout Plain Layout
11834 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
11835 Enumerate, Itemize, Bibliography
11844 \begin_layout Itemize
11845 \begin_inset Flex Code
11848 \begin_layout Plain Layout
11854 means the label is the very first word (up to the first real blank).
11855 Use protected spaces (like
11856 \begin_inset space ~
11859 that one) if you want more than one word as the label.
11863 \begin_layout Itemize
11864 \begin_inset Flex Code
11867 \begin_layout Plain Layout
11873 means the label is simply whatever
11874 \begin_inset Flex Code
11877 \begin_layout Plain Layout
11884 Note that this really is `static'.
11887 \begin_layout Itemize
11888 \begin_inset Flex Code
11891 \begin_layout Plain Layout
11898 \begin_inset Flex Code
11901 \begin_layout Plain Layout
11902 Centered_Top_Environment
11907 are special cases of
11908 \begin_inset Flex Code
11911 \begin_layout Plain Layout
11918 The label will be printed above the paragraph, but only at the top of an
11919 environment or the top of a chain of paragraphs with this style.
11920 This might be used with the
11921 \begin_inset Flex MenuItem
11924 \begin_layout Plain Layout
11930 style, for example.
11933 \begin_layout Itemize
11934 \begin_inset Flex Code
11937 \begin_layout Plain Layout
11943 is a special case for the caption-labels
11944 \begin_inset Quotes eld
11948 \begin_inset Quotes erd
11952 \begin_inset Quotes eld
11956 \begin_inset Quotes erd
11961 \begin_inset Flex Code
11964 \begin_layout Plain Layout
11970 means the (hardcoded) label string depends on the kind of float: It is
11971 hardcoded to be `FloatType N', where N is the value of the counter associated
11975 \begin_layout Itemize
11977 \begin_inset Flex Code
11980 \begin_layout Plain Layout
11986 label type defines automatically numbered labels.
11988 \begin_inset Flex Code
11991 \begin_layout Plain Layout
11997 will be expanded to resolve any counter references it contains: For example,
11999 \begin_inset Quotes eld
12003 \begin_inset Flex Code
12006 \begin_layout Plain Layout
12017 \begin_inset Quotes erd
12022 \begin_inset CommandInset ref
12024 reference "sub:Counters"
12028 for more information on counters.
12031 \begin_layout Itemize
12032 \begin_inset Flex Code
12035 \begin_layout Plain Layout
12041 produces the usual sort of enumeration labels.
12042 At present, it is hardcoded to use Arabic numerals, lowercase letters,
12043 small Roman numerals, and uppercase letters for the four possible depths.
12046 \begin_layout Itemize
12047 \begin_inset Flex Code
12050 \begin_layout Plain Layout
12056 produces various bullets at the different levels.
12057 It is also hardcoded.
12060 \begin_layout Itemize
12061 \begin_inset Flex Code
12064 \begin_layout Plain Layout
12070 is used internally by LyX and should be used only with
12071 \begin_inset Flex Code
12074 \begin_layout Plain Layout
12075 LatexType BibEnvironment
12084 \begin_layout Description
12085 \begin_inset Flex Code
12088 \begin_layout Plain Layout
12094 Note that this will completely override any prior
12095 \begin_inset Flex Code
12098 \begin_layout Plain Layout
12104 declaration for this style.
12106 \begin_inset Quotes eld
12110 \begin_inset Flex Code
12113 \begin_layout Plain Layout
12120 \begin_inset Quotes erd
12125 \begin_inset CommandInset ref
12127 reference "sub:I18n"
12131 for details on its use.
12134 \begin_layout Description
12135 \begin_inset Flex Code
12138 \begin_layout Plain Layout
12144 The name of the corresponding LaTeX stuff.
12145 Either the environment or command name.
12148 \begin_layout Description
12149 \begin_inset Flex Code
12152 \begin_layout Plain Layout
12158 An optional parameter for the corresponding
12159 \begin_inset Flex Code
12162 \begin_layout Plain Layout
12169 This parameter cannot be changed from within LyX.
12172 \begin_layout Description
12173 \begin_inset Flex Code
12176 \begin_layout Plain Layout
12183 \begin_inset Flex Code
12186 \begin_layout Plain Layout
12191 , Command, Environment, Item_Environment,
12197 \begin_inset Flex Code
12200 \begin_layout Plain Layout
12201 List_Environment, Bib_Environment
12206 ] How the style should be translated into LaTeX.
12210 \begin_layout Plain Layout
12211 \begin_inset Flex Code
12214 \begin_layout Plain Layout
12220 is perhaps a bit misleading, since these rules apply to SGML classes, too.
12221 Visit the SGML class files for specific examples.
12230 \begin_layout Itemize
12231 \begin_inset Flex Code
12234 \begin_layout Plain Layout
12240 means nothing special.
12244 \begin_layout Itemize
12245 \begin_inset Flex Code
12248 \begin_layout Plain Layout
12255 \begin_inset Flex Code
12258 \begin_layout Plain Layout
12265 {\SpecialChar \ldots{}
12274 \begin_layout Itemize
12275 \begin_inset Flex Code
12278 \begin_layout Plain Layout
12285 \begin_inset Flex Code
12288 \begin_layout Plain Layout
12295 }\SpecialChar \ldots{}
12311 \begin_layout Itemize
12312 \begin_inset Flex Code
12315 \begin_layout Plain Layout
12322 \begin_inset Flex Code
12325 \begin_layout Plain Layout
12332 \begin_inset Flex Code
12335 \begin_layout Plain Layout
12343 is generated for each paragraph of this environment.
12347 \begin_layout Itemize
12348 \begin_inset Flex Code
12351 \begin_layout Plain Layout
12358 \begin_inset Flex Code
12361 \begin_layout Plain Layout
12368 \begin_inset Flex Code
12371 \begin_layout Plain Layout
12377 is passed as an argument to the environment.
12379 \begin_inset Flex Code
12382 \begin_layout Plain Layout
12388 can be defined in the
12389 \begin_inset Flex MenuItem
12392 \begin_layout Plain Layout
12393 Edit\SpecialChar \menuseparator
12395 \begin_inset space ~
12407 \begin_layout Standard
12408 Putting the last few things together, the LaTeX output will be either:
12411 \begin_layout LyX-Code
12414 latexname[latexparam]{\SpecialChar \ldots{}
12418 \begin_layout Standard
12422 \begin_layout LyX-Code
12425 begin{latexname}[latexparam] \SpecialChar \ldots{}
12431 \begin_layout Standard
12432 depending upon the LaTeX type.
12436 \begin_layout Description
12437 \begin_inset Flex Code
12440 \begin_layout Plain Layout
12447 \begin_inset Flex Code
12450 \begin_layout Plain Layout
12456 ] If you put styles into environments, the leftmargins are not simply added,
12457 but added with a factor
12458 \begin_inset Formula $\frac{4}{depth+4}$
12462 Note that this parameter is also used when the margin is defined as
12463 \begin_inset Flex Code
12466 \begin_layout Plain Layout
12473 \begin_inset Flex Code
12476 \begin_layout Plain Layout
12483 Then it is added to the manual or dynamic margin.
12485 \begin_inset Newline newline
12488 The argument is passed as a string.
12490 \begin_inset Quotes eld
12494 \begin_inset Flex Code
12497 \begin_layout Plain Layout
12504 \begin_inset Quotes erd
12507 means that the paragraph is indented with the width of
12508 \begin_inset Quotes eld
12512 \begin_inset Flex Code
12515 \begin_layout Plain Layout
12522 \begin_inset Quotes erd
12525 in the normal font.
12526 You can get a negative width by prefixing the string with
12527 \begin_inset Quotes eld
12531 \begin_inset Flex Code
12534 \begin_layout Plain Layout
12541 \begin_inset Quotes erd
12545 This way was chosen so that the look is the same with each used screen
12550 \begin_layout Description
12551 \begin_inset Flex Code
12554 \begin_layout Plain Layout
12561 \begin_inset Flex Code
12564 \begin_layout Plain Layout
12569 , Manual, Dynamic, First_Dynamic, Right_Address_Box
12575 \begin_inset Newline newline
12578 The kind of margin that the style has on the left side.
12580 \begin_inset Flex Code
12583 \begin_layout Plain Layout
12589 just means a fixed margin.
12591 \begin_inset Flex Code
12594 \begin_layout Plain Layout
12600 means that the left margin depends on the string entered in the
12601 \begin_inset Flex MenuItem
12604 \begin_layout Plain Layout
12605 Edit\SpecialChar \menuseparator
12607 \begin_inset space ~
12616 This is used to typeset nice lists without tabulators.
12618 \begin_inset Flex Code
12621 \begin_layout Plain Layout
12627 means that the margin depends on the size of the label.
12628 This is used for automatic enumerated headlines.
12629 It is obvious that the headline
12630 \begin_inset Quotes eld
12633 5.4.3.2.1 Very long headline
12634 \begin_inset Quotes erd
12637 must have a wider left margin (as wide as
12638 \begin_inset Quotes eld
12642 \begin_inset Quotes erd
12645 plus the space) than
12646 \begin_inset Quotes eld
12649 3.2 Very long headline
12650 \begin_inset Quotes erd
12654 \begin_inset Quotes eld
12658 \begin_inset Quotes erd
12661 are not able to do this.
12663 \begin_inset Flex Code
12666 \begin_layout Plain Layout
12672 is similar, but only the very first row of the paragraph is dynamic, while
12673 the others are static; this is used, for example, for descriptions.
12675 \begin_inset Flex Code
12678 \begin_layout Plain Layout
12684 means the margin is chosen in a way that the longest row of this paragraph
12685 fits to the right margin.
12686 This is used to typeset an address on the right edge of the page.
12689 \begin_layout Description
12690 \begin_inset Flex Code
12693 \begin_layout Plain Layout
12700 \begin_inset Flex Code
12703 \begin_layout Plain Layout
12712 \begin_inset Flex Code
12715 \begin_layout Plain Layout
12721 ] Whether fragile commands in this style should be
12722 \begin_inset Flex Code
12725 \begin_layout Plain Layout
12738 whether this command should itself be protected.)
12741 \begin_layout Description
12742 \begin_inset Flex Code
12745 \begin_layout Plain Layout
12752 \begin_inset Flex Code
12755 \begin_layout Plain Layout
12762 \begin_inset Flex Code
12765 \begin_layout Plain Layout
12773 ] Whether newlines are translated into LaTeX newlines (
12774 \begin_inset Flex Code
12777 \begin_layout Plain Layout
12788 The translation can be switched off to allow more comfortable LaTeX editing
12792 \begin_layout Description
12793 \begin_inset Flex Code
12796 \begin_layout Plain Layout
12803 \begin_inset Flex Code
12806 \begin_layout Plain Layout
12813 \begin_inset Flex Code
12816 \begin_layout Plain Layout
12824 ] If set to true, and if
12825 \begin_inset Flex Code
12828 \begin_layout Plain Layout
12835 \begin_inset Flex Code
12838 \begin_layout Plain Layout
12844 ) paragraphs are being indented, then the indentation of such a paragraph
12845 following one of this type will be suppressed.
12846 (So this will not affect the display of non-default paragraphs.)
12849 \begin_layout Description
12850 \begin_inset Flex Code
12853 \begin_layout Plain Layout
12859 Name of a style that has replaced this style.
12860 This is used to rename a style, while keeping backward compatibility.
12863 \begin_layout Description
12865 \change_deleted -712698321 1353679722
12866 \begin_inset Flex Code
12869 \begin_layout Plain Layout
12876 \begin_inset Flex Code
12879 \begin_layout Plain Layout
12885 ] The number of optional arguments that can be used with this style.
12886 This is useful for things like section headings, and only makes sense with
12888 Note that, on output, the optional arguments will all precede any required
12889 arguments (see below).
12890 So one can have constructs like:
12894 \begin_layout LyX-Code
12896 \change_deleted -712698321 1353679722
12899 mycmd[opt1]{req1}{contents of paragraph}
12902 \begin_layout Standard
12904 \change_deleted -712698321 1353679722
12905 but one cannot have things like:
12908 \begin_layout LyX-Code
12910 \change_deleted -712698321 1353679722
12913 mycmd[opt1]{req1}[opt2]{contents of paragraph}
12916 \begin_layout Standard
12918 \change_deleted -712698321 1353679722
12919 at least, not without ERT (with which you can have anything).
12926 \begin_layout Description
12927 \begin_inset Flex Code
12930 \begin_layout Plain Layout
12937 \begin_inset Flex Code
12940 \begin_layout Plain Layout
12949 \begin_inset Flex Code
12952 \begin_layout Plain Layout
12958 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
12959 output, but only by a line break; together with
12960 \begin_inset Flex Code
12963 \begin_layout Plain Layout
12969 , this allows to emulate a plain text editor (like the ERT inset).
12972 \begin_layout Description
12973 \begin_inset Flex Code
12976 \begin_layout Plain Layout
12983 \begin_inset Flex Code
12986 \begin_layout Plain Layout
12992 ] The indent of the very first line of a paragraph.
12994 \begin_inset Flex Code
12997 \begin_layout Plain Layout
13003 will be fixed for a certain style.
13004 The exception is the default style, since the indentation for these paragraphs
13005 can be prohibited with
13006 \begin_inset Flex Code
13009 \begin_layout Plain Layout
13017 \begin_inset Flex Code
13020 \begin_layout Plain Layout
13026 style paragraphs inside environments use the
13027 \begin_inset Flex Code
13030 \begin_layout Plain Layout
13036 of the environment, not their native one.
13038 \begin_inset Flex Code
13041 \begin_layout Plain Layout
13047 paragraphs inside an enumeration are not indented.
13050 \begin_layout Description
13051 \begin_inset Flex Code
13054 \begin_layout Plain Layout
13061 \begin_inset Flex Code
13064 \begin_layout Plain Layout
13070 ] The vertical space between two paragraphs of this style.
13073 \begin_layout Description
13074 \begin_inset Flex Code
13077 \begin_layout Plain Layout
13084 \begin_inset Flex Code
13087 \begin_layout Plain Layout
13093 ] LyX allows the user to choose either
13094 \begin_inset Quotes eld
13098 \begin_inset Quotes erd
13102 \begin_inset Quotes eld
13106 \begin_inset Quotes erd
13109 to typeset a document.
13111 \begin_inset Quotes eld
13115 \begin_inset Quotes erd
13118 is chosen, this value is completely ignored.
13120 \begin_inset Quotes eld
13124 \begin_inset Quotes erd
13127 is chosen, the parindent of a LaTeXtype
13128 \begin_inset Quotes eld
13132 \begin_inset Quotes erd
13135 style is ignored and all paragraphs are separated by this parskip argument.
13136 The vertical space is calculated with
13137 \begin_inset Flex Code
13140 \begin_layout Plain Layout
13142 \begin_inset space ~
13151 \begin_inset Flex Code
13154 \begin_layout Plain Layout
13160 is the height of a row with the normal font.
13161 This way, the look stays the same with different screen fonts.
13164 \begin_layout Description
13165 \begin_inset Flex Code
13168 \begin_layout Plain Layout
13175 \begin_inset Flex Code
13178 \begin_layout Plain Layout
13187 \begin_inset Flex Code
13190 \begin_layout Plain Layout
13196 ] Whether the contents of this paragraph should be output in raw form, meaning
13197 without special translations that LaTeX would require.
13200 \begin_layout Description
13201 \begin_inset Flex Code
13204 \begin_layout Plain Layout
13210 Information to be included in the LaTeX preamble when this style is used.
13211 Used to define macros, load packages, etc., required by this particular
13214 \begin_inset Quotes eld
13218 \begin_inset Flex Code
13221 \begin_layout Plain Layout
13228 \begin_inset Quotes erd
13234 \begin_layout Description
13235 \begin_inset Flex Code
13238 \begin_layout Plain Layout
13245 \begin_inset Flex Code
13248 \begin_layout Plain Layout
13254 ] The prefix to use when creating labels referring to paragraphs of this
13256 This allows the use of formatted references.
13259 \begin_layout Description
13261 \change_deleted -712698321 1353681258
13262 \begin_inset Flex Code
13265 \begin_layout Plain Layout
13272 \begin_inset Flex Code
13275 \begin_layout Plain Layout
13281 ] The number of required arguments that the LaTeX command or environment
13282 corresponding to this style expects.
13283 In the case of a command, these are required arguments
13287 that associated with the content of the paragraph itself.
13288 These do not actually have to be provided: LyX will output empty arguments
13290 Note that optional arguments will be output before required arguments.
13291 See the discussion of the
13292 \begin_inset Flex Code
13295 \begin_layout Plain Layout
13301 tag above for more information.
13306 \begin_layout Description
13307 \begin_inset Flex Code
13310 \begin_layout Plain Layout
13317 \begin_inset Flex Code
13320 \begin_layout Plain Layout
13326 ] Whether the style requires the feature
13327 \begin_inset Flex Code
13330 \begin_layout Plain Layout
13337 See the description of
13338 \begin_inset Flex Code
13341 \begin_layout Plain Layout
13348 \begin_inset CommandInset ref
13349 LatexCommand pageref
13350 reference "des:FreeSpacing"
13354 ) for information on `features'.
13356 \change_inserted -712698321 1353693134
13360 \begin_layout Description
13362 \change_inserted -712698321 1353693371
13363 \begin_inset Flex Code
13366 \begin_layout Plain Layout
13368 \change_inserted -712698321 1353693146
13377 \begin_inset Flex Code
13380 \begin_layout Plain Layout
13382 \change_inserted -712698321 1353693235
13391 \begin_inset Flex Code
13394 \begin_layout Plain Layout
13396 \change_inserted -712698321 1353693235
13402 ] Resets the LaTeX arguments of this style (as defined via the
13403 \begin_inset Flex Code
13406 \begin_layout Plain Layout
13408 \change_inserted -712698321 1353693371
13417 This is useful if you have copied a style via
13418 \begin_inset Flex Code
13421 \begin_layout Plain Layout
13423 \change_inserted -712698321 1353693302
13431 , but you do not want to inherit its (required and optional) arguments.
13436 \begin_layout Description
13437 \begin_inset Flex Code
13440 \begin_layout Plain Layout
13447 \begin_inset Flex Code
13450 \begin_layout Plain Layout
13457 \begin_inset Flex Code
13460 \begin_layout Plain Layout
13469 \begin_layout Description
13470 \begin_inset Flex Code
13473 \begin_layout Plain Layout
13480 \begin_inset Flex Code
13483 \begin_layout Plain Layout
13488 , onehalf, double, other
13497 ] This defines what the default spacing should be in the style.
13499 \begin_inset Flex Code
13502 \begin_layout Plain Layout
13509 \begin_inset Flex Code
13512 \begin_layout Plain Layout
13519 \begin_inset Flex Code
13522 \begin_layout Plain Layout
13528 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
13529 If you specify the argument
13530 \begin_inset Flex Code
13533 \begin_layout Plain Layout
13539 , then you should also provide a numerical argument which will be the actual
13541 Note that, contrary to other parameters,
13542 \begin_inset Flex Code
13545 \begin_layout Plain Layout
13551 implies the generation of specific LaTeX code, using the package
13554 \begin_inset Flex Code
13557 \begin_layout Plain Layout
13566 \begin_layout Description
13567 \begin_inset Flex Code
13570 \begin_layout Plain Layout
13577 \begin_inset Flex Code
13580 \begin_layout Plain Layout
13587 \begin_inset Flex Code
13590 \begin_layout Plain Layout
13598 ] Spellcheck paragraphs of this style.
13602 \begin_layout Description
13603 \begin_inset Flex Code
13606 \begin_layout Plain Layout
13612 The font used for the text body .
13614 \begin_inset CommandInset ref
13616 reference "sub:Font-description"
13623 \begin_layout Description
13624 \begin_inset Flex Code
13627 \begin_layout Plain Layout
13636 \begin_inset Flex Code
13639 \begin_layout Plain Layout
13649 The level of the style in the table of contents.
13650 This is used for automatic numbering of section headings.
13653 \begin_layout Description
13654 \begin_inset Flex Code
13657 \begin_layout Plain Layout
13664 \begin_inset Flex Code
13667 \begin_layout Plain Layout
13673 ] The vertical space with which the very first of a chain of paragraphs
13674 with this style is separated from the previous paragraph.
13675 If the previous paragraph has another style, the separations are not simply
13676 added, but the maximum is taken.
13679 \begin_layout Subsection
13680 \begin_inset CommandInset label
13686 Internationalization of Paragraph Styles
13689 \begin_layout Standard
13690 LyX has long supported internationalization of layout information, but,
13691 until version 2.0, this applied only to the user interface and not to, say,
13693 Thus, French authors were forced to resort to ugly hacks if they wanted
13698 1' instead of `Theorem 1'.
13699 Thanks to Georg Baum, that is no longer the case.
13702 \begin_layout Standard
13704 \begin_inset Flex Code
13707 \begin_layout Plain Layout
13713 defines text that is to appear in the typeset document, it may use
13714 \begin_inset Flex Code
13717 \begin_layout Plain Layout
13724 \begin_inset Flex Code
13727 \begin_layout Plain Layout
13733 to support non-English and even multi-language documents correctly.
13734 The following excerpt (from the
13735 \begin_inset Flex Code
13738 \begin_layout Plain Layout
13744 file) shows how this works:
13747 \begin_layout LyX-Code
13752 \begin_layout LyX-Code
13755 theoremstyle{remark}
13758 \begin_layout LyX-Code
13761 newtheorem{claim}[thm]{
13768 \begin_layout LyX-Code
13772 \begin_layout LyX-Code
13776 \begin_layout LyX-Code
13781 claimname}{_(Claim)}
13784 \begin_layout LyX-Code
13788 \begin_layout LyX-Code
13792 \begin_layout LyX-Code
13801 claimname}{_(Claim)}}
13804 \begin_layout LyX-Code
13809 \begin_layout Standard
13810 In principle, any legal LaTeX may appear in the
13811 \begin_inset Flex Code
13814 \begin_layout Plain Layout
13821 \begin_inset Flex Code
13824 \begin_layout Plain Layout
13830 tags, but in practice they will typically look as they do here.
13831 The key to correct translation of the typeset text is the definition of
13833 \begin_inset Flex Code
13836 \begin_layout Plain Layout
13845 \begin_inset Flex Code
13848 \begin_layout Plain Layout
13860 \begin_layout Standard
13862 \begin_inset Flex Code
13865 \begin_layout Plain Layout
13871 tag provides for internationalization based upon the overall language of
13873 The contents of the tag will be included in the preamble, just as with
13875 \begin_inset Flex Code
13878 \begin_layout Plain Layout
13885 What makes it special is the use of the
13886 \begin_inset Quotes eld
13890 \begin_inset Quotes erd
13894 \begin_inset Flex Code
13897 \begin_layout Plain Layout
13903 , which will be replaced, when LyX produces LaTeX output, with the translation
13904 of its argument into the document language.
13907 \begin_layout Standard
13909 \begin_inset Flex Code
13912 \begin_layout Plain Layout
13918 tag is more complex, since it is meant to provide support for multi-language
13919 documents and so offers an interface to the
13920 \begin_inset Flex Code
13923 \begin_layout Plain Layout
13930 Its contents will be added to the preamble once for each language that
13931 appears in the document.
13932 In this case, the argument to
13933 \begin_inset Flex Code
13936 \begin_layout Plain Layout
13942 will be replaced with its translation into the language in question; the
13944 \begin_inset Flex Code
13947 \begin_layout Plain Layout
13953 is replaced by the language name (as used by the babel package).
13956 \begin_layout Standard
13957 A German document that also included a French section would thus have the
13958 following in the preamble:
13961 \begin_layout LyX-Code
13970 claimname}{Affirmation}}
13978 claimname}{Behauptung}}
13982 claimname}{Behauptung}
13985 \begin_layout Standard
13987 \begin_inset Flex Code
13990 \begin_layout Plain Layout
13996 will then conspire to produce the correct text in the output.
13999 \begin_layout Standard
14000 One important point to note here is that the translations are provided by
14001 LyX itself, through the
14002 \change_inserted -195340706 1334775793
14004 \begin_inset Flex Code
14007 \begin_layout Plain Layout
14009 \change_inserted -195340706 1334775793
14016 \change_deleted -195340706 1334775793
14017 same mechanism it uses for internationalization of the user interface
14020 This means, in effect, that
14021 \begin_inset Flex Code
14024 \begin_layout Plain Layout
14031 \begin_inset Flex Code
14034 \begin_layout Plain Layout
14040 are really only of use in layout files that are provided with LyX, since
14041 text entered in user-created layout files will not be seen by LyX's internation
14043 \change_inserted -195340706 1334775793
14045 \begin_inset Flex Code
14048 \begin_layout Plain Layout
14050 \change_inserted -195340706 1334775793
14056 file is modified accordingly
14059 That said, however, any layout created with the intention that it will
14060 be included with LyX should use these tags where appropriate.
14062 \change_inserted -195340706 1334775793
14063 Please note that the paragraph style translations provided by LyX will
14064 never change with a minor update (e.g.
14065 from version 2.1.x to 2.1.y).
14066 It is however quite likely that a major update (e.g.
14067 from 2.0.x to 2.1.y) will introduce new translations or corrections.
14072 \begin_layout Subsection
14074 \begin_inset CommandInset label
14083 \begin_layout Standard
14084 Since version 1.3.0 of LyX, it is has been both possible and necessary to
14085 define the floats (
14086 \begin_inset Flex MenuItem
14089 \begin_layout Plain Layout
14096 \begin_inset Flex MenuItem
14099 \begin_layout Plain Layout
14105 , \SpecialChar \ldots{}
14106 ) in the text class itself.
14107 Standard floats are included in the file
14108 \begin_inset Flex Code
14111 \begin_layout Plain Layout
14117 , so you may have to do no more than add
14120 \begin_layout LyX-Code
14121 Input stdfloats.inc
14124 \begin_layout Standard
14125 to your layout file.
14126 If you want to implement a text class that proposes some other float types
14127 (like the AGU class bundled with LyX), the information below will hopefully
14131 \begin_layout Description
14132 \begin_inset Flex Code
14135 \begin_layout Plain Layout
14142 \begin_inset Flex Code
14145 \begin_layout Plain Layout
14152 \begin_inset Quotes erd
14156 \begin_inset Quotes erd
14159 ] The file name extension of an auxiliary file for the list of figures (or
14161 LaTeX writes the captions to this file.
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 Quotes erd
14189 \begin_inset Quotes erd
14192 ] The string that will be used in the menus and also for the caption.
14193 This is translated to the current language if babel is used.
14196 \begin_layout Description
14197 \begin_inset Flex Code
14200 \begin_layout Plain Layout
14206 These are used for XHTML output.
14208 \begin_inset CommandInset ref
14210 reference "sec:Tags-for-XHTML"
14217 \begin_layout Description
14218 \begin_inset Flex Code
14221 \begin_layout Plain Layout
14230 \begin_inset Flex Code
14233 \begin_layout Plain Layout
14242 \begin_inset Flex Code
14245 \begin_layout Plain Layout
14251 ] Indicates whether the float is already defined in the document class or
14252 if we instead need to load
14253 \begin_inset Flex Code
14256 \begin_layout Plain Layout
14262 and use what it provides to define it on-the-fly.
14264 \begin_inset Flex Code
14267 \begin_layout Plain Layout
14274 \begin_inset Flex Code
14277 \begin_layout Plain Layout
14284 It should be set to
14285 \begin_inset Flex Code
14288 \begin_layout Plain Layout
14294 if the float is already defined by the LaTeX document class.
14297 \begin_layout Description
14298 \begin_inset Flex Code
14301 \begin_layout Plain Layout
14308 \begin_inset Flex Code
14311 \begin_layout Plain Layout
14318 \begin_inset Quotes erd
14322 \begin_inset Quotes erd
14325 ] The command used to generate a list of floats of this type; the leading
14328 ' should be omitted.
14334 \begin_inset Flex Code
14337 \begin_layout Plain Layout
14343 is false, since there is no standard way to generate this command.
14345 \begin_inset Flex Code
14348 \begin_layout Plain Layout
14354 is true, since in that case there is a standard way to define the command.
14357 \begin_layout Description
14358 \begin_inset Flex Code
14361 \begin_layout Plain Layout
14368 \begin_inset Flex Code
14371 \begin_layout Plain Layout
14378 \begin_inset Quotes erd
14382 \begin_inset Quotes erd
14385 ] A title for a list of floats of this kind (list of figures, tables, or
14387 It is used for the screen label within LyX; it is passed to LaTeX for use
14388 as the title there; and it is used as the title in XHTML output.
14389 It will be translated to the document language.
14392 \begin_layout Description
14393 \begin_inset Flex Code
14396 \begin_layout Plain Layout
14403 \begin_inset Flex Code
14406 \begin_layout Plain Layout
14413 \begin_inset Quotes erd
14417 \begin_inset Quotes erd
14420 ] This (optional) argument determines whether floats of this class will
14421 be numbered within some sectional unit of the document.
14422 For example, if within is equal to
14423 \begin_inset Flex Code
14426 \begin_layout Plain Layout
14432 , the floats will be numbered within chapters.
14436 \begin_layout Description
14437 \begin_inset Flex Code
14440 \begin_layout Plain Layout
14447 \begin_inset Flex Code
14450 \begin_layout Plain Layout
14457 \begin_inset Quotes erd
14461 \begin_inset Quotes erd
14464 ] The default placement for the given class of floats.
14465 The string should be as in standard LaTeX:
14466 \begin_inset Flex Code
14469 \begin_layout Plain Layout
14476 \begin_inset Flex Code
14479 \begin_layout Plain Layout
14486 \begin_inset Flex Code
14489 \begin_layout Plain Layout
14496 \begin_inset Flex Code
14499 \begin_layout Plain Layout
14505 for top, bottom, page, and here, respectively.
14509 \begin_layout Plain Layout
14510 Note that the order of these letters in the string is irrelevant, like in
14516 On top of that there is a new type,
14517 \begin_inset Flex Code
14520 \begin_layout Plain Layout
14526 , which does not really correspond to a float, since it means: put it
14527 \begin_inset Quotes eld
14531 \begin_inset Quotes erd
14535 Note however that the
14536 \begin_inset Flex Code
14539 \begin_layout Plain Layout
14545 specifier is special and, because of implementation details, cannot be
14546 used in non-built in float types.
14547 If you do not understand what this means, just use
14548 \begin_inset Quotes eld
14552 \begin_inset Flex Code
14555 \begin_layout Plain Layout
14562 \begin_inset Quotes erd
14568 \begin_layout Description
14569 \begin_inset Flex Code
14572 \begin_layout Plain Layout
14579 \begin_inset Flex Code
14582 \begin_layout Plain Layout
14588 ] The prefix to use when creating labels referring to floats of this type.
14589 This allows the use of formatted references.
14590 Note that you can remove any
14591 \begin_inset Flex Code
14594 \begin_layout Plain Layout
14600 set by a copied style by using the special value
14601 \begin_inset Quotes eld
14605 \begin_inset Quotes erd
14608 , which must be all caps.
14611 \begin_layout Description
14612 \begin_inset Flex Code
14615 \begin_layout Plain Layout
14622 \begin_inset Flex Code
14625 \begin_layout Plain Layout
14632 \begin_inset Quotes erd
14636 \begin_inset Quotes erd
14639 ] The style used when defining the float using
14640 \begin_inset Flex Code
14643 \begin_layout Plain Layout
14654 \begin_layout Description
14655 \begin_inset Flex Code
14658 \begin_layout Plain Layout
14665 \begin_inset Flex Code
14668 \begin_layout Plain Layout
14675 \begin_inset Quotes erd
14679 \begin_inset Quotes erd
14683 \begin_inset Quotes eld
14687 \begin_inset Quotes erd
14690 of the new class of floats, like program or algorithm.
14691 After the appropriate
14692 \begin_inset Flex Code
14695 \begin_layout Plain Layout
14704 \begin_inset Flex Code
14707 \begin_layout Plain Layout
14716 \begin_inset Flex Code
14719 \begin_layout Plain Layout
14730 \begin_layout Description
14731 \begin_inset Flex Code
14734 \begin_layout Plain Layout
14741 \begin_inset Flex Code
14744 \begin_layout Plain Layout
14751 \begin_inset Flex Code
14754 \begin_layout Plain Layout
14762 ] Tells us whether this float is defined using the facilities provided by
14764 \begin_inset Flex Code
14767 \begin_layout Plain Layout
14773 , either by the class file or a package, or on-the-fly by LyX itself.
14776 \begin_layout Standard
14777 Note that defining a float with type
14778 \begin_inset Flex Code
14781 \begin_layout Plain Layout
14789 automatically defines the corresponding counter with name
14790 \begin_inset Flex Code
14793 \begin_layout Plain Layout
14804 \begin_layout Subsection
14805 Flex insets and InsetLayout
14806 \begin_inset CommandInset label
14808 name "sub:Flex-insets-and"
14815 \begin_layout Standard
14816 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
14817 these are called Flex insets.
14821 \begin_layout Standard
14822 Flex insets come in three different kinds:
14825 \begin_layout Itemize
14827 \begin_inset Flex Code
14830 \begin_layout Plain Layout
14836 ): These define semantic markup corresponding to such LaTeX commands as
14838 \begin_inset Flex Code
14841 \begin_layout Plain Layout
14850 \begin_inset Flex Code
14853 \begin_layout Plain Layout
14864 \begin_layout Itemize
14866 \begin_inset Flex Code
14869 \begin_layout Plain Layout
14875 ): These can be used to define custom collapsible insets, similar to TeX
14876 code, footnote, and the like.
14877 An obvious example is an endnote inset, which is defined in the
14878 \begin_inset Flex Code
14881 \begin_layout Plain Layout
14890 \begin_layout Itemize
14892 \begin_inset Flex Code
14895 \begin_layout Plain Layout
14901 ): For use with DocBook classes.
14904 \begin_layout Standard
14905 Flex insets are defined using the
14906 \begin_inset Flex Code
14909 \begin_layout Plain Layout
14915 tag, which shall be explained in a moment.
14918 \begin_layout Standard
14920 \begin_inset Flex Code
14923 \begin_layout Plain Layout
14929 tag also serves another function: It can be used to customize the general
14930 layout of many different types of insets.
14932 \begin_inset Flex Code
14935 \begin_layout Plain Layout
14941 can be used to customize the layout parameters for footnotes, marginal
14942 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
14943 boxes, tables, algorithms, URLs, and optional arguments, as well as to
14944 define Flex insets.
14947 \begin_layout Standard
14949 \begin_inset Flex Code
14952 \begin_layout Plain Layout
14958 definition must begin with a line of the form:
14961 \begin_layout LyX-Code
14965 \begin_layout Standard
14967 \begin_inset Flex Code
14970 \begin_layout Plain Layout
14976 indicates the inset whose layout is being defined, and here there are
14977 \change_inserted 5863208 1334489266
14979 \change_deleted 5863208 1334489267
14985 \begin_layout Enumerate
14986 The layout for a pre-existing inset is being modified.
14987 In this case, can be
14988 \begin_inset Flex Code
14991 \begin_layout Plain Layout
14997 any one of the following:
14998 \begin_inset Flex Code
15001 \begin_layout Plain Layout
15008 \begin_inset Flex Code
15011 \begin_layout Plain Layout
15018 \begin_inset Flex Code
15021 \begin_layout Plain Layout
15028 \begin_inset Flex Code
15031 \begin_layout Plain Layout
15038 \begin_inset Flex Code
15041 \begin_layout Plain Layout
15048 \begin_inset Flex Code
15051 \begin_layout Plain Layout
15058 \begin_inset Flex Code
15061 \begin_layout Plain Layout
15068 \begin_inset Flex Code
15071 \begin_layout Plain Layout
15078 \begin_inset Flex Code
15081 \begin_layout Plain Layout
15088 \begin_inset Flex Code
15091 \begin_layout Plain Layout
15098 \begin_inset Flex Code
15101 \begin_layout Plain Layout
15108 \begin_inset Flex Code
15111 \begin_layout Plain Layout
15118 \begin_inset Flex Code
15121 \begin_layout Plain Layout
15128 \begin_inset Flex Code
15131 \begin_layout Plain Layout
15138 \begin_inset Flex Code
15141 \begin_layout Plain Layout
15148 \begin_inset Flex Code
15151 \begin_layout Plain Layout
15158 \begin_inset Flex Code
15161 \begin_layout Plain Layout
15168 \begin_inset Flex Code
15171 \begin_layout Plain Layout
15178 \begin_inset Flex Code
15181 \begin_layout Plain Layout
15188 \begin_inset Flex Code
15191 \begin_layout Plain Layout
15200 \begin_layout Enumerate
15201 The layout for a Flex inset is being defined.
15203 \begin_inset Flex Code
15206 \begin_layout Plain Layout
15212 must be of the form
15213 \begin_inset Quotes eld
15217 \begin_inset Flex Code
15220 \begin_layout Plain Layout
15227 \begin_inset Quotes erd
15231 \begin_inset Flex Code
15234 \begin_layout Plain Layout
15240 may be be any valid identifier not used by a pre-existing Flex inset.
15241 The identifier may include spaces, but in that case the whole thing must
15242 be wrapped in quotes.
15243 Note that the definition of a flex inset
15248 \begin_inset Flex Code
15251 \begin_layout Plain Layout
15257 entry, declaring which type of inset it defines.
15258 \change_inserted 5863208 1334489312
15262 \begin_layout Enumerate
15264 \change_inserted 5863208 1334492248
15265 The layout for user specific branch is being defined.
15267 \begin_inset Flex Code
15270 \begin_layout Plain Layout
15272 \change_inserted 5863208 1334489384
15278 must be of the form
15279 \begin_inset Quotes eld
15283 \begin_inset Flex Code
15286 \begin_layout Plain Layout
15288 \change_inserted 5863208 1334489392
15295 \begin_inset Quotes erd
15299 \begin_inset Flex Code
15302 \begin_layout Plain Layout
15304 \change_inserted 5863208 1334489384
15310 may be be any valid identifier of branch defined in user's document.
15311 The identifier may include spaces, but in that case the whole thing must
15312 be wrapped in quotes.
15313 The main purpose of this feature is to allow LaTeX wrapping around specific
15314 branches as user needs.
15319 \begin_layout Standard
15321 \begin_inset Flex Code
15324 \begin_layout Plain Layout
15330 definition can contain the following entries:
15333 \begin_layout Description
15335 \change_inserted -712698321 1353681390
15336 \begin_inset Flex Code
15339 \begin_layout Plain Layout
15341 \change_inserted -712698321 1353681344
15348 \begin_inset Flex Code
15351 \begin_layout Plain Layout
15353 \change_inserted -712698321 1353681344
15359 ] Defines argument number <int> of a command\SpecialChar \slash{}
15360 environment associated with
15361 the current layout.
15362 The definition must end with
15363 \begin_inset Flex Code
15366 \begin_layout Plain Layout
15368 \change_inserted -712698321 1353681344
15376 \begin_inset space ~
15380 \begin_inset CommandInset ref
15382 reference "sub:Paragraph-Styles"
15389 \begin_layout Description
15391 \change_inserted -195340706 1333913893
15392 \begin_inset Flex Code
15395 \begin_layout Plain Layout
15401 Preamble for changing languages.
15403 \begin_inset space ~
15407 \begin_inset CommandInset ref
15409 reference "sub:I18n"
15416 \begin_layout Description
15417 \begin_inset Flex Code
15420 \begin_layout Plain Layout
15426 The color for the inset's background.
15427 The valid colors are defined in
15428 \begin_inset Flex Code
15431 \begin_layout Plain Layout
15440 \begin_layout Description
15441 \begin_inset Flex Code
15444 \begin_layout Plain Layout
15451 \begin_inset Flex Code
15454 \begin_layout Plain Layout
15463 \begin_inset Flex Code
15466 \begin_layout Plain Layout
15472 ] Whether to use the content of the inset as the label, when the inset is
15477 \begin_layout Description
15478 \begin_inset Flex Code
15481 \begin_layout Plain Layout
15488 \begin_inset Flex Code
15491 \begin_layout Plain Layout
15497 Copies all the features of an existing style into the current one.
15501 \begin_layout Description
15502 \begin_inset Flex Code
15505 \begin_layout Plain Layout
15512 \begin_inset Flex Code
15515 \begin_layout Plain Layout
15524 \begin_inset Flex Code
15527 \begin_layout Plain Layout
15533 ] Indicates whether the user may employ the Paragraph Settings dialog to
15534 customize the paragraph.
15537 \begin_layout Description
15538 \begin_inset Flex Code
15541 \begin_layout Plain Layout
15548 \begin_inset Flex Code
15551 \begin_layout Plain Layout
15558 \begin_inset Flex Code
15561 \begin_layout Plain Layout
15568 \begin_inset Flex Code
15571 \begin_layout Plain Layout
15577 , describing the rendering style used for the inset's frame and buttons.
15578 Footnotes generally use
15579 \begin_inset Flex Code
15582 \begin_layout Plain Layout
15588 , ERT insets generally
15589 \begin_inset Flex Code
15592 \begin_layout Plain Layout
15598 , and character styles
15599 \begin_inset Flex Code
15602 \begin_layout Plain Layout
15611 \begin_layout Description
15612 \begin_inset Flex Code
15615 \begin_layout Plain Layout
15622 \begin_inset Flex Code
15625 \begin_layout Plain Layout
15632 \begin_inset Flex Code
15635 \begin_layout Plain Layout
15644 \begin_inset Flex Code
15647 \begin_layout Plain Layout
15654 \begin_inset Flex Code
15657 \begin_layout Plain Layout
15664 Indicates whether the environment will stand on its own in LaTeX output
15665 or will appear inline with the surrounding text.
15666 If set to false, it is supposed that the LaTeX environment ignores white
15667 space (including one newline character) after the
15668 \begin_inset Flex Code
15671 \begin_layout Plain Layout
15684 \begin_inset Flex Code
15687 \begin_layout Plain Layout
15703 \begin_layout Description
15704 \begin_inset Flex Code
15707 \begin_layout Plain Layout
15713 Required at the end of the InsetLayout declarations.
15716 \begin_layout Description
15717 \begin_inset Flex Code
15720 \begin_layout Plain Layout
15726 The font used for both the text body
15732 \begin_inset space ~
15736 \begin_inset CommandInset ref
15738 reference "sub:Font-description"
15743 Note that defining this font automatically defines the
15744 \begin_inset Flex Code
15747 \begin_layout Plain Layout
15753 to the same value, so define this first and define
15754 \begin_inset Flex Code
15757 \begin_layout Plain Layout
15763 later if you want them to be different.
15766 \begin_layout Description
15767 \begin_inset Flex Code
15770 \begin_layout Plain Layout
15777 \begin_inset Quotes eld
15781 \begin_inset Quotes erd
15784 language, leading to Left-to-Right (latin) output, e.
15785 \begin_inset space \thinspace{}
15789 \begin_inset space \space{}
15792 in TeX code or URL.
15796 \begin_layout Description
15797 \begin_inset Flex Code
15800 \begin_layout Plain Layout
15807 \begin_inset Flex Code
15810 \begin_layout Plain Layout
15819 \begin_inset Flex Code
15822 \begin_layout Plain Layout
15828 ] Indicates whether the
15829 \begin_inset Flex Code
15832 \begin_layout Plain Layout
15838 should be used or, instead, the user can change the paragraph style used
15843 \begin_layout Description
15844 \begin_inset Flex Code
15847 \begin_layout Plain Layout
15854 \begin_inset Flex Code
15857 \begin_layout Plain Layout
15866 \begin_inset Flex Code
15869 \begin_layout Plain Layout
15875 ] Usually LyX doesn't allow you to insert more than one space between words,
15876 since a space is considered as the separation between two words, not a
15877 character or symbol of its own.
15878 This is a very fine thing but sometimes annoying, for example, when typing
15879 program code or plain LaTeX code.
15881 \begin_inset Flex Code
15884 \begin_layout Plain Layout
15891 Note that LyX will create protected blanks for the additional blanks when
15892 in another mode than LaTeX-mode.
15896 \begin_layout Description
15897 \begin_inset Flex Code
15900 \begin_layout Plain Layout
15906 These tags control XHTML output.
15908 \begin_inset CommandInset ref
15910 reference "sec:Tags-for-XHTML"
15917 \begin_layout Description
15918 \begin_inset Flex Code
15921 \begin_layout Plain Layout
15928 \begin_inset Flex Code
15931 \begin_layout Plain Layout
15940 \begin_inset Flex Code
15943 \begin_layout Plain Layout
15949 ] Whether to include the contents of this inset in the strings generated
15950 for the `Outline' pane.
15951 One would not, for example, want the content of a footnote in a section
15952 header to be included in the TOC displayed in the outline, but one would
15953 normally want the content of a character style displayed.
15954 Default is false: not to include.
15957 \begin_layout Description
15958 \begin_inset Flex Code
15961 \begin_layout Plain Layout
15968 \begin_inset Flex Code
15971 \begin_layout Plain Layout
15980 \begin_inset Flex Code
15983 \begin_layout Plain Layout
15989 ] Usually LyX does not allow you to leave a paragraph empty, since it would
15990 lead to empty LaTeX output.
15991 There are some cases where this could be desirable however: in a letter
15992 template, the required fields can be provided as empty fields, so that
15993 people do not forget them; in some special classes, a style can be used
15994 as some kind of break, which does not contain actual text.
15998 \begin_layout Description
15999 \begin_inset Flex Code
16002 \begin_layout Plain Layout
16008 The font used for the label.
16010 \begin_inset space ~
16014 \begin_inset CommandInset ref
16016 reference "sub:Font-description"
16021 Note that this definition can never appear before
16022 \begin_inset Flex Code
16025 \begin_layout Plain Layout
16031 , lest it be ineffective.
16034 \begin_layout Description
16035 \begin_inset Flex Code
16038 \begin_layout Plain Layout
16044 What will be displayed on the button or elsewhere as the inset label.
16046 \begin_inset Flex Code
16049 \begin_layout Plain Layout
16056 \begin_inset Flex Code
16059 \begin_layout Plain Layout
16065 ) modify this label on the fly.
16068 \begin_layout Description
16070 \change_inserted -195340706 1333913893
16071 \begin_inset Flex Code
16074 \begin_layout Plain Layout
16080 Language dependent preamble.
16082 \begin_inset space ~
16086 \begin_inset CommandInset ref
16088 reference "sub:I18n"
16095 \begin_layout Description
16096 \begin_inset Flex Code
16099 \begin_layout Plain Layout
16105 The name of the corresponding LaTeX stuff.
16106 Either the environment or command name.
16109 \begin_layout Description
16110 \begin_inset Flex Code
16113 \begin_layout Plain Layout
16119 The optional parameter for the corresponding
16120 \begin_inset Flex Code
16123 \begin_layout Plain Layout
16129 stuff, including possible bracket pairs like
16130 \begin_inset Flex Code
16133 \begin_layout Plain Layout
16140 This parameter cannot be changed from within LyX.
16143 \begin_layout Description
16144 \begin_inset Flex Code
16147 \begin_layout Plain Layout
16154 \begin_inset Flex Code
16157 \begin_layout Plain Layout
16162 , Command, Environment, Item_Environment,
16168 \begin_inset Flex Code
16171 \begin_layout Plain Layout
16172 List_Environment, Bib_Environment
16177 ] How the style should be translated into LaTeX.
16181 \begin_layout Plain Layout
16182 \begin_inset Flex Code
16185 \begin_layout Plain Layout
16191 is perhaps a bit misleading, since these rules apply to SGML classes, too.
16192 Visit the SGML class files for specific examples.
16201 \begin_layout Itemize
16202 \begin_inset Flex Code
16205 \begin_layout Plain Layout
16211 means nothing special.
16215 \begin_layout Itemize
16216 \begin_inset Flex Code
16219 \begin_layout Plain Layout
16226 \begin_inset Flex Code
16229 \begin_layout Plain Layout
16236 {\SpecialChar \ldots{}
16245 \begin_layout Itemize
16246 \begin_inset Flex Code
16249 \begin_layout Plain Layout
16256 \begin_inset Flex Code
16259 \begin_layout Plain Layout
16266 }\SpecialChar \ldots{}
16282 \begin_layout Itemize
16283 \begin_inset Flex Code
16286 \begin_layout Plain Layout
16293 \begin_inset Flex Code
16296 \begin_layout Plain Layout
16303 \begin_inset Flex Code
16306 \begin_layout Plain Layout
16314 is generated for each paragraph of this environment.
16318 \begin_layout Itemize
16319 \begin_inset Flex Code
16322 \begin_layout Plain Layout
16329 \begin_inset Flex Code
16332 \begin_layout Plain Layout
16339 \begin_inset Flex Code
16342 \begin_layout Plain Layout
16348 is passed as an argument to the environment.
16350 \begin_inset Flex Code
16353 \begin_layout Plain Layout
16359 can be defined in the
16360 \begin_inset Flex MenuItem
16363 \begin_layout Plain Layout
16368 \SpecialChar \menuseparator
16374 \begin_inset space ~
16386 \begin_layout Standard
16387 Putting the last few things together, the LaTeX output will be either:
16390 \begin_layout LyX-Code
16393 latexname[latexparam]{\SpecialChar \ldots{}
16397 \begin_layout Standard
16401 \begin_layout LyX-Code
16404 begin{latexname}[latexparam] \SpecialChar \ldots{}
16410 \begin_layout Standard
16411 depending upon the LaTeX type.
16415 \begin_layout Description
16416 \begin_inset Flex Code
16419 \begin_layout Plain Layout
16426 \begin_inset Flex Code
16429 \begin_layout Plain Layout
16436 \begin_inset Flex Code
16439 \begin_layout Plain Layout
16446 \begin_inset Flex Code
16449 \begin_layout Plain Layout
16456 \begin_inset Flex Code
16459 \begin_layout Plain Layout
16465 (indicating a dummy definition ending definitions of charstyles, etc).
16466 This entry is required in and is only meaningful for Flex insets.
16467 Among other things, it determines on which menu this inset will appear.
16469 \begin_inset Flex Code
16472 \begin_layout Plain Layout
16479 \begin_inset Flex Code
16482 \begin_layout Plain Layout
16489 \begin_inset Flex Code
16492 \begin_layout Plain Layout
16500 \begin_inset Flex Code
16503 \begin_layout Plain Layout
16509 can be set to true for charstyle insets, if you wish, by setting it
16514 \begin_inset Flex Code
16517 \begin_layout Plain Layout
16526 \begin_layout Description
16527 \begin_inset Flex Code
16530 \begin_layout Plain Layout
16537 \begin_inset Flex Code
16540 \begin_layout Plain Layout
16549 \begin_inset Flex Code
16552 \begin_layout Plain Layout
16558 ] Whether multiple paragraphs are permitted in this inset.
16560 \begin_inset Flex Code
16563 \begin_layout Plain Layout
16569 to the same value and
16570 \begin_inset Flex Code
16573 \begin_layout Plain Layout
16579 to the opposite value.
16580 These can be reset to other values, if they are used
16585 \begin_inset Flex Code
16588 \begin_layout Plain Layout
16598 \begin_layout Description
16599 \begin_inset Flex Code
16602 \begin_layout Plain Layout
16609 \begin_inset Flex Code
16612 \begin_layout Plain Layout
16621 \begin_inset Flex Code
16624 \begin_layout Plain Layout
16630 ] Whether fragile commands in this inset should be
16631 \begin_inset Flex Code
16634 \begin_layout Plain Layout
16647 whether the command should itself be protected.) Default is false.
16650 \begin_layout Description
16651 \begin_inset Flex Code
16654 \begin_layout Plain Layout
16661 \begin_inset Flex Code
16664 \begin_layout Plain Layout
16673 \begin_inset Flex Code
16676 \begin_layout Plain Layout
16682 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
16683 output, but only by a line break; together with
16684 \begin_inset Flex Code
16687 \begin_layout Plain Layout
16693 , this allows to emulate a plain text editor (like the ERT inset).
16697 \begin_layout Description
16698 \begin_inset Flex Code
16701 \begin_layout Plain Layout
16708 \begin_inset Flex Code
16711 \begin_layout Plain Layout
16720 \begin_inset Flex Code
16723 \begin_layout Plain Layout
16729 ] Whether the contents of this paragraph should be output in raw form, meaning
16730 without special translations that LaTeX would require.
16733 \begin_layout Description
16734 \begin_inset Flex Code
16737 \begin_layout Plain Layout
16743 Information to be included in the LaTeX preamble when this style is used.
16744 Used to define macros, load packages, etc., required by this particular
16747 \begin_inset Quotes eld
16751 \begin_inset Flex Code
16754 \begin_layout Plain Layout
16761 \begin_inset Quotes erd
16767 \begin_layout Description
16768 \begin_inset Flex Code
16771 \begin_layout Plain Layout
16778 \begin_inset Flex Code
16781 \begin_layout Plain Layout
16787 ] The prefix to use when creating labels referring to insets of this type.
16788 This allows the use of formatted references.
16791 \begin_layout Description
16792 \begin_inset Flex Code
16795 \begin_layout Plain Layout
16802 \begin_inset Flex Code
16805 \begin_layout Plain Layout
16811 ] Whether the style requires the feature
16812 \begin_inset Flex Code
16815 \begin_layout Plain Layout
16822 See the description of
16823 \begin_inset Flex Code
16826 \begin_layout Plain Layout
16833 \begin_inset CommandInset ref
16834 LatexCommand pageref
16835 reference "des:FreeSpacing"
16839 ) for information on `features'.
16843 \begin_layout Description
16844 \begin_inset Flex Code
16847 \begin_layout Plain Layout
16854 \begin_inset Flex Code
16857 \begin_layout Plain Layout
16864 \begin_inset Flex Code
16867 \begin_layout Plain Layout
16875 ] Whether this inset should use the font of its surrounding environment
16877 Default is true: uses its own.
16880 \begin_layout Description
16881 \begin_inset Flex Code
16884 \begin_layout Plain Layout
16891 \begin_inset Flex Code
16894 \begin_layout Plain Layout
16901 \begin_inset Flex Code
16904 \begin_layout Plain Layout
16912 ] Spellcheck the contents of this inset.
16916 \begin_layout Subsection
16918 \begin_inset CommandInset label
16920 name "sub:Counters"
16927 \begin_layout Standard
16928 Since version 1.3.0 of LyX, it is both possible and necessary to define the
16930 \begin_inset Flex MenuItem
16933 \begin_layout Plain Layout
16940 \begin_inset Flex MenuItem
16943 \begin_layout Plain Layout
16949 , \SpecialChar \ldots{}
16950 ) in the text class itself.
16951 The standard counters are defined in the file
16952 \begin_inset Flex Code
16955 \begin_layout Plain Layout
16961 , so you may have to do no more than add
16964 \begin_layout LyX-Code
16965 Input stdcounters.inc
16968 \begin_layout Standard
16969 to your layout file to get them to work.
16970 But if you want to define custom counters, then you can do so.
16971 The counter declaration must begin with:
16974 \begin_layout LyX-Code
16975 Counter CounterName
16978 \begin_layout Standard
16980 \begin_inset Flex Code
16983 \begin_layout Plain Layout
16989 ' is replaced by the name of the counter.
16990 And it must end with
16991 \begin_inset Quotes eld
16995 \begin_inset Flex Code
16998 \begin_layout Plain Layout
17005 \begin_inset Quotes erd
17009 The following parameters can also be used:
17012 \begin_layout Description
17013 \begin_inset Flex Code
17016 \begin_layout Plain Layout
17023 \begin_inset Flex Code
17026 \begin_layout Plain Layout
17033 \begin_inset Quotes erd
17037 \begin_inset Quotes erd
17040 ] When defined, this string defines how the counter is displayed.
17041 Setting this value sets
17042 \begin_inset Flex Code
17045 \begin_layout Plain Layout
17046 LabelStringAppendix
17052 The following special constructs can be used in the string:
17056 \begin_layout Itemize
17057 \begin_inset Flex Code
17060 \begin_layout Plain Layout
17068 will be replaced by the expansion of the
17069 \begin_inset Flex Code
17072 \begin_layout Plain Layout
17079 \begin_inset Flex Code
17082 \begin_layout Plain Layout
17083 LabelStringAppendix
17089 \begin_inset Flex Code
17092 \begin_layout Plain Layout
17102 \begin_layout Itemize
17103 counter values can be expressed using LaTeX-like macros
17104 \begin_inset Flex Code
17107 \begin_layout Plain Layout
17124 \begin_inset Flex Code
17127 \begin_layout Plain Layout
17139 \begin_layout Plain Layout
17149 Actually, the situation is a bit more complicated: any
17168 other than those described below will produce arabic numerals.
17169 It would not be surprising to see this change in the future.
17175 \begin_inset Flex Code
17178 \begin_layout Plain Layout
17184 : 1, 2, 3,\SpecialChar \ldots{}
17186 \begin_inset Flex Code
17189 \begin_layout Plain Layout
17195 for lower-case letters: a, b, c, \SpecialChar \ldots{}
17197 \begin_inset Flex Code
17200 \begin_layout Plain Layout
17206 for upper-case letters: A, B, C, \SpecialChar \ldots{}
17208 \begin_inset Flex Code
17211 \begin_layout Plain Layout
17217 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
17219 \begin_inset Flex Code
17222 \begin_layout Plain Layout
17228 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
17230 \begin_inset Flex Code
17233 \begin_layout Plain Layout
17239 for hebrew numerals.
17243 \begin_layout Standard
17244 If LabelString is not defined, a default value is constructed as follows:
17245 if the counter has a master counter
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
17279 is used; otherwise the string
17280 \begin_inset Flex Code
17283 \begin_layout Plain Layout
17294 \begin_layout Description
17295 \begin_inset Flex Code
17298 \begin_layout Plain Layout
17299 LabelStringAppendix
17305 \begin_inset Flex Code
17308 \begin_layout Plain Layout
17315 \begin_inset Quotes erd
17319 \begin_inset Quotes erd
17323 \begin_inset Flex Code
17326 \begin_layout Plain Layout
17332 , but for use in the Appendix.
17335 \begin_layout Description
17336 \begin_inset Flex Code
17339 \begin_layout Plain Layout
17346 \begin_inset Flex Code
17349 \begin_layout Plain Layout
17356 \begin_inset Quotes erd
17360 \begin_inset Quotes erd
17363 ] A format for use with formatted references to this counter.
17364 For example, one might want to have references to section numbers appear
17366 \begin_inset Quotes eld
17370 \begin_inset Quotes erd
17374 The string should contain
17375 \begin_inset Quotes eld
17379 \begin_inset Quotes erd
17383 This will be replaced by the counter number itself.
17384 So, for sections, it would be: Section ##.
17387 \begin_layout Description
17388 \begin_inset Flex Code
17391 \begin_layout Plain Layout
17398 \begin_inset Flex Code
17401 \begin_layout Plain Layout
17408 \begin_inset Quotes erd
17412 \begin_inset Quotes erd
17415 ] If this is set to the name of another counter, the present counter will
17416 be reset every time the other one is increased.
17418 \begin_inset Flex Code
17421 \begin_layout Plain Layout
17428 \begin_inset Flex Code
17431 \begin_layout Plain Layout
17440 \begin_layout Subsection
17442 \begin_inset CommandInset label
17444 name "sub:Font-description"
17451 \begin_layout Standard
17452 A font description looks like this:
17455 \begin_layout LyX-Code
17465 \begin_layout LyX-Code
17469 \begin_layout LyX-Code
17473 \begin_layout Standard
17474 The following commands are available:
17477 \begin_layout Description
17478 \begin_inset Flex Code
17481 \begin_layout Plain Layout
17488 \begin_inset Flex Code
17491 \begin_layout Plain Layout
17500 \begin_inset Flex Code
17503 \begin_layout Plain Layout
17510 \begin_inset Flex Code
17513 \begin_layout Plain Layout
17520 \begin_inset Flex Code
17523 \begin_layout Plain Layout
17530 \begin_inset Flex Code
17533 \begin_layout Plain Layout
17540 \begin_inset Flex Code
17543 \begin_layout Plain Layout
17550 \begin_inset Flex Code
17553 \begin_layout Plain Layout
17560 \begin_inset Flex Code
17563 \begin_layout Plain Layout
17570 \begin_inset Flex Code
17573 \begin_layout Plain Layout
17582 \begin_layout Description
17583 \begin_inset Flex Code
17586 \begin_layout Plain Layout
17593 \begin_inset Flex Code
17596 \begin_layout Plain Layout
17605 \begin_inset Flex Code
17608 \begin_layout Plain Layout
17615 \begin_inset Flex Code
17618 \begin_layout Plain Layout
17627 \begin_layout Description
17628 \begin_inset Flex Code
17631 \begin_layout Plain Layout
17638 \begin_inset Flex Code
17641 \begin_layout Plain Layout
17647 ] Valid arguments are:
17648 \begin_inset Flex Code
17651 \begin_layout Plain Layout
17658 \begin_inset Flex Code
17661 \begin_layout Plain Layout
17668 \begin_inset Flex Code
17671 \begin_layout Plain Layout
17678 \begin_inset Flex Code
17681 \begin_layout Plain Layout
17688 \begin_inset Flex Code
17691 \begin_layout Plain Layout
17698 \begin_inset Flex Code
17701 \begin_layout Plain Layout
17708 \begin_inset Flex Code
17711 \begin_layout Plain Layout
17718 \begin_inset Flex Code
17721 \begin_layout Plain Layout
17728 \begin_inset Flex Code
17731 \begin_layout Plain Layout
17738 \begin_inset Flex Code
17741 \begin_layout Plain Layout
17748 \begin_inset Flex Code
17751 \begin_layout Plain Layout
17758 \begin_inset Flex Code
17761 \begin_layout Plain Layout
17768 Each of these turns on or off the corresponding attribute.
17770 \begin_inset Flex Code
17773 \begin_layout Plain Layout
17779 turns on emphasis, and
17780 \begin_inset Flex Code
17783 \begin_layout Plain Layout
17791 \begin_inset Newline newline
17794 If the latter seems puzzling, remember that the font settings for the present
17795 context are generally inherited from the surrounding context.
17797 \begin_inset Flex Code
17800 \begin_layout Plain Layout
17806 would turn off the emphasis that was anyway in effect, say, in a theorem
17810 \begin_layout Description
17811 \begin_inset Flex Code
17814 \begin_layout Plain Layout
17821 \begin_inset Flex Code
17824 \begin_layout Plain Layout
17833 \begin_inset Flex Code
17836 \begin_layout Plain Layout
17845 \begin_layout Description
17846 \begin_inset Flex Code
17849 \begin_layout Plain Layout
17856 \begin_inset Flex Code
17859 \begin_layout Plain Layout
17868 \begin_inset Flex Code
17871 \begin_layout Plain Layout
17878 \begin_inset Flex Code
17881 \begin_layout Plain Layout
17888 \begin_inset Flex Code
17891 \begin_layout Plain Layout
17900 \begin_layout Description
17901 \begin_inset Flex Code
17904 \begin_layout Plain Layout
17911 \begin_inset Flex Code
17914 \begin_layout Plain Layout
17921 \begin_inset Flex Code
17924 \begin_layout Plain Layout
17931 \begin_inset Flex Code
17934 \begin_layout Plain Layout
17943 \begin_inset Flex Code
17946 \begin_layout Plain Layout
17953 \begin_inset Flex Code
17956 \begin_layout Plain Layout
17963 \begin_inset Flex Code
17966 \begin_layout Plain Layout
17973 \begin_inset Flex Code
17976 \begin_layout Plain Layout
17983 \begin_inset Flex Code
17986 \begin_layout Plain Layout
17995 \begin_layout Subsection
17996 \begin_inset CommandInset label
17998 name "sub:Citation-format-description"
18002 Citation format description
18005 \begin_layout Standard
18007 \begin_inset Flex Code
18010 \begin_layout Plain Layout
18016 blocks are used to describe how bibliographic information should be displayed,
18017 both within LyX itself (in the citation dialog and in tooltips, for example)
18018 and in XHTML output.
18019 Such a block might look like this:
18022 \begin_layout LyX-Code
18026 \begin_layout LyX-Code
18030 \begin_layout LyX-Code
18034 \begin_layout LyX-Code
18038 \begin_layout Standard
18039 The individual lines define how the bibliographic information associated
18040 with an article or book, respectively, is to be displayed, and such a definitio
18041 n can be given for any `entry type' that might be present in a BibTeX file.
18042 LyX defines a default format in the source code that will be used if no
18043 specific definition has been given.
18044 LyX predefines several formats in the file
18045 \begin_inset Flex Code
18048 \begin_layout Plain Layout
18054 , which is included in most of LyX's document classes.
18057 \begin_layout Standard
18058 The definitions use a simple language that allows BibTeX keys to be replaced
18060 Keys should be enclosed in
18061 \begin_inset Flex Code
18064 \begin_layout Plain Layout
18071 \begin_inset Flex Code
18074 \begin_layout Plain Layout
18081 So a simple definition might look like this:
18084 \begin_layout LyX-Code
18086 \begin_inset Quotes eld
18090 \begin_inset Quotes erd
18096 \begin_layout Standard
18097 This would print the author, followed by a comma, followed by the title,
18098 in quotes, followed by a period.
18101 \begin_layout Standard
18102 Of course, sometimes you may want to print a key only if it exists.
18103 This can be done by using a conditional construction, such as:
18104 \begin_inset Flex Code
18107 \begin_layout Plain Layout
18109 \begin_inset space ~
18119 \begin_inset Flex Code
18122 \begin_layout Plain Layout
18128 key exists, then print
18129 \begin_inset Quotes eld
18133 \begin_inset space ~
18137 \begin_inset Quotes erd
18140 followed by the volume key.
18141 It is also possible to have an else clause in the conditional, such as:
18143 \begin_inset Flex Code
18146 \begin_layout Plain Layout
18147 {%author%[[%author%]][[%editor%, ed.]]}
18154 \begin_inset Flex Code
18157 \begin_layout Plain Layout
18163 key is printed if it exists; otherwise, the editor key is printed, followed
18165 \begin_inset Quotes eld
18169 \begin_inset space ~
18173 \begin_inset Quotes erd
18176 Note that the key is again enclosed in
18177 \begin_inset Flex Code
18180 \begin_layout Plain Layout
18186 signs; the entire conditional is enclosed in braces; and the if and else
18187 clauses are enclosed in double brackets,
18188 \begin_inset Quotes eld
18192 \begin_inset Flex Code
18195 \begin_layout Plain Layout
18202 \begin_inset Quotes eld
18206 \begin_inset Quotes eld
18210 \begin_inset Flex Code
18213 \begin_layout Plain Layout
18220 \begin_inset Quotes erd
18224 There must be no space between any of these.
18227 \begin_layout Standard
18228 There is one other piece of syntax available in definitions, which looks
18230 \begin_inset Flex Code
18233 \begin_layout Plain Layout
18240 This defines a piece of formatting information that is to be used when
18242 \begin_inset Quotes eld
18246 \begin_inset Quotes erd
18250 Obviously, we do not want to output HTML tags when writing plain text,
18251 so they should be wrapped in
18252 \begin_inset Quotes eld
18256 \begin_inset Quotes erd
18260 \begin_inset Quotes eld
18264 \begin_inset Quotes erd
18270 \begin_layout Standard
18271 Two special sorts of definitions are also possible in a
18272 \begin_inset Flex Code
18275 \begin_layout Plain Layout
18282 An example of the first would be:
18285 \begin_layout LyX-Code
18287 \begin_inset Quotes eld
18291 \begin_inset Quotes erd
18297 \begin_layout Standard
18298 This is an abbreviation, or macro, and it can be used by treating it as
18300 \begin_inset Flex Code
18303 \begin_layout Plain Layout
18311 \begin_inset Flex Code
18314 \begin_layout Plain Layout
18320 exactly as it would treat its definition.
18321 So, let us issue the obvious
18329 \begin_layout LyX-Code
18333 \begin_layout Standard
18334 or anything like it.
18335 LyX shouldn't go into an infinite loop, but it may go into a long one before
18339 \begin_layout Standard
18340 The second sort of special definition might look like this:
18343 \begin_layout LyX-Code
18347 \begin_layout Standard
18348 This defines a translatable piece of text, which allows relevant parts of
18349 the bibliography to be translated.
18350 It can be included in a definition by treating it as a key:
18351 \begin_inset Flex Code
18354 \begin_layout Plain Layout
18361 Several of these are predefined in
18362 \begin_inset Flex Code
18365 \begin_layout Plain Layout
18372 Note that these are not macros, in the sense just defined.
18373 They will not be expanded.
18376 \begin_layout Standard
18377 So here then is an example that use all these features:
18380 \begin_layout LyX-Code
18381 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
18384 \begin_layout Standard
18385 This defines a macro that prints the author, followed by a comma, if the
18387 \begin_inset Flex Code
18390 \begin_layout Plain Layout
18396 key is defined, or else prints the name of the editor, followed by the
18398 \begin_inset Flex Code
18401 \begin_layout Plain Layout
18407 or its translation (it is by default
18408 \begin_inset Quotes eld
18412 \begin_inset Quotes erd
18416 \begin_inset Flex Code
18419 \begin_layout Plain Layout
18426 Note that this is in fact defined in
18427 \begin_inset Flex Code
18430 \begin_layout Plain Layout
18436 , so you can use it in your own definitions, or re-definitions, if you load
18440 \begin_layout Section
18441 \begin_inset CommandInset label
18443 name "sec:Tags-for-XHTML"
18447 Tags for XHTML output
18450 \begin_layout Standard
18451 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
18452 by layout information.
18453 In general, LyX provides sensible defaults and, as mentioned earlier, it
18454 will even construct default CSS style rules from the other layout tags.
18455 For example, LyX will attempt to use the information provided in the
18456 \begin_inset Flex Code
18459 \begin_layout Plain Layout
18465 declaration for the Chapter style to write CSS that will appropriately
18466 format chapter headings.
18469 \begin_layout Standard
18470 In many cases, then, you may not have to do anything at all to get acceptable
18471 XHTML output for your own environments, custom insets, and so forth.
18472 But in some cases you will, and so LyX provides a number of layout tags
18473 that can be used to customize the XHTML and CSS that are generated.
18476 \begin_layout Standard
18477 Note that there are two tags,
18478 \begin_inset Flex Code
18481 \begin_layout Plain Layout
18488 \begin_inset Flex Code
18491 \begin_layout Plain Layout
18497 that may appear outside style and inset declarations.
18499 \begin_inset CommandInset ref
18501 reference "sub:General-text-class"
18505 for details on these.
18508 \begin_layout Subsection
18509 \begin_inset CommandInset label
18511 name "sub:Paragraph-Style-XHTML"
18518 \begin_layout Standard
18519 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
18520 dealing with a normal paragraph, a command, or an environment, where this
18521 is itself determined by the contents of the corresponding
18522 \begin_inset Flex Code
18525 \begin_layout Plain Layout
18535 \begin_layout Standard
18536 For a command or normal paragraph, the output XHTML has the following form:
18539 \begin_layout LyX-Code
18541 \begin_inset Quotes erd
18545 \begin_inset Quotes erd
18551 \begin_layout LyX-Code
18553 \begin_inset Quotes erd
18557 \begin_inset Quotes erd
18563 \begin_layout LyX-Code
18564 Contents of the paragraph.
18567 \begin_layout LyX-Code
18571 \begin_layout Standard
18572 The label tags are of course omitted if the paragraph does not have a label.
18575 \begin_layout Standard
18576 For an environment that is not some sort of list, the XHTML takes this form:
18579 \begin_layout LyX-Code
18581 \begin_inset Quotes erd
18585 \begin_inset Quotes erd
18591 \begin_layout LyX-Code
18593 \begin_inset Quotes erd
18597 \begin_inset Quotes erd
18601 \begin_inset Quotes erd
18605 \begin_inset Quotes erd
18608 >Environment Label</labeltag>First paragraph.</itemtag>
18611 \begin_layout LyX-Code
18612 <itemtag>Second paragraph.</itemtag>
18615 \begin_layout LyX-Code
18619 \begin_layout Standard
18620 Note that the label is output only for the first paragraph, as it should
18621 be for a theorem, for example.
18625 \begin_layout Standard
18626 For a list, we have one of these forms:
18629 \begin_layout LyX-Code
18631 \begin_inset Quotes erd
18635 \begin_inset Quotes erd
18641 \begin_layout LyX-Code
18643 \begin_inset Quotes erd
18647 \begin_inset Quotes erd
18651 \begin_inset Quotes erd
18655 \begin_inset Quotes erd
18658 >List Label</labeltag>First item.</itemtag>
18661 \begin_layout LyX-Code
18663 \begin_inset Quotes erd
18667 \begin_inset Quotes erd
18671 \begin_inset Quotes erd
18675 \begin_inset Quotes erd
18678 >List Label</labeltag>Second item.</itemtag>
18681 \begin_layout LyX-Code
18685 \begin_layout LyX-Code
18689 \begin_layout LyX-Code
18691 \begin_inset Quotes erd
18695 \begin_inset Quotes erd
18701 \begin_layout LyX-Code
18703 \begin_inset Quotes erd
18707 \begin_inset Quotes erd
18710 >List Label</labeltag><itemtag attr=
18711 \begin_inset Quotes erd
18715 \begin_inset Quotes erd
18718 >First item.</itemtag>
18721 \begin_layout LyX-Code
18723 \begin_inset Quotes erd
18727 \begin_inset Quotes erd
18730 >List Label</labeltag><itemtag attr=
18731 \begin_inset Quotes erd
18735 \begin_inset Quotes erd
18738 >Second item.</itemtag>
18741 \begin_layout LyX-Code
18745 \begin_layout Standard
18746 Note the different orders of
18747 \begin_inset Flex Code
18750 \begin_layout Plain Layout
18757 \begin_inset Flex Code
18760 \begin_layout Plain Layout
18767 Which order we get depends upon the setting of
18768 \begin_inset Flex Code
18771 \begin_layout Plain Layout
18778 \begin_inset Flex Code
18781 \begin_layout Plain Layout
18787 is false (the default), you get the first of these, with the label within
18788 the item; if true, you get the second, with the label outside the item.
18791 \begin_layout Standard
18792 The specific tags and attributes output for each paragraph type can be controlle
18793 d by means of the layout tags we are about to describe.
18794 As mentioned earlier, however, LyX uses sensible defaults for many of these,
18795 so you often may not need to do very much to get good XHTML output.
18796 Think of the available tags as there so you can tweak things to your liking.
18799 \begin_layout Description
18800 \begin_inset Flex Code
18803 \begin_layout Plain Layout
18810 \begin_inset Flex Code
18813 \begin_layout Plain Layout
18819 ] Specifies attribute information to be output with the main tag.
18821 \begin_inset Quotes eld
18825 \begin_inset Flex Code
18828 \begin_layout Plain Layout
18835 \begin_inset Quotes erd
18839 By default, LyX will output
18840 \begin_inset Quotes eld
18844 \begin_inset Flex Code
18847 \begin_layout Plain Layout
18854 \begin_inset Quotes erd
18858 \begin_inset Flex Code
18861 \begin_layout Plain Layout
18867 is the LyX name of the layout, made lowercase, for example: chapter.
18872 contain any style information.
18874 \begin_inset Flex Code
18877 \begin_layout Plain Layout
18886 \begin_layout Description
18887 \begin_inset Flex Code
18890 \begin_layout Plain Layout
18897 \begin_inset Flex Code
18900 \begin_layout Plain Layout
18910 ] Whether to output the default CSS information LyX generates for this layout,
18911 even if additional information is explicitly provided via
18912 \begin_inset Flex Code
18915 \begin_layout Plain Layout
18923 \begin_inset Flex Code
18926 \begin_layout Plain Layout
18932 allows you to alter or augment the generated CSS, rather than to override
18935 \begin_inset Flex Code
18938 \begin_layout Plain Layout
18947 \begin_layout Description
18948 \begin_inset Flex Code
18951 \begin_layout Plain Layout
18958 \begin_inset Flex Code
18961 \begin_layout Plain Layout
18967 ] The tag to be used for individual paragraphs of environments, replacing
18969 \begin_inset Flex Code
18972 \begin_layout Plain Layout
18978 in the examples above.
18980 \begin_inset Flex Code
18983 \begin_layout Plain Layout
18992 \begin_layout Description
18993 \begin_inset Flex Code
18996 \begin_layout Plain Layout
19003 \begin_inset Flex Code
19006 \begin_layout Plain Layout
19012 ] Attributes for the item tag.
19014 \begin_inset Quotes eld
19018 \begin_inset Flex Code
19021 \begin_layout Plain Layout
19022 class=`layoutname_item'
19028 \begin_inset Quotes erd
19036 contain any style information.
19038 \begin_inset Flex Code
19041 \begin_layout Plain Layout
19050 \begin_layout Description
19051 \begin_inset Flex Code
19054 \begin_layout Plain Layout
19061 \begin_inset Flex Code
19064 \begin_layout Plain Layout
19070 ] The tag to be used for paragraph and item labels, replacing
19071 \begin_inset Flex Code
19074 \begin_layout Plain Layout
19080 in the examples above.
19082 \begin_inset Flex Code
19085 \begin_layout Plain Layout
19092 \begin_inset Flex Code
19095 \begin_layout Plain Layout
19102 \begin_inset Flex Code
19105 \begin_layout Plain Layout
19112 \begin_inset Flex Code
19115 \begin_layout Plain Layout
19116 Centered_Top_Environment
19121 , in which case it defaults to
19122 \begin_inset Flex Code
19125 \begin_layout Plain Layout
19134 \begin_layout Description
19135 \begin_inset Flex Code
19138 \begin_layout Plain Layout
19145 \begin_inset Flex Code
19148 \begin_layout Plain Layout
19154 ] Attributes for the label tag.
19156 \begin_inset Quotes eld
19160 \begin_inset Flex Code
19163 \begin_layout Plain Layout
19164 class=`layoutname_label'
19170 \begin_inset Quotes erd
19178 contain any style information.
19180 \begin_inset Flex Code
19183 \begin_layout Plain Layout
19192 \begin_layout Description
19193 \begin_inset Flex Code
19196 \begin_layout Plain Layout
19203 \begin_inset Flex Code
19206 \begin_layout Plain Layout
19216 ] Meaningful only for list-like environments, this tag controls whether
19217 the label tag is output before or inside the item tag.
19218 This is used, for example, in the description environment, where we want
19220 \begin_inset Flex Code
19223 \begin_layout Plain Layout
19224 <dt>\SpecialChar \ldots{}
19225 </dt><dd>\SpecialChar \ldots{}
19233 \begin_inset Flex Code
19236 \begin_layout Plain Layout
19242 : The label tag is output inside the item tag.
19245 \begin_layout Description
19246 \begin_inset Flex Code
19249 \begin_layout Plain Layout
19255 Information to be output in the
19256 \begin_inset Flex Code
19259 \begin_layout Plain Layout
19265 section when this style is used.
19266 This might, for example, be used to include a
19267 \begin_inset Flex Code
19270 \begin_layout Plain Layout
19277 \begin_inset Flex Code
19280 \begin_layout Plain Layout
19289 \begin_layout Description
19290 \begin_inset Flex Code
19293 \begin_layout Plain Layout
19299 CSS style information to be included when this style is used.
19300 Note that this will automatically be wrapped in a layout-generated
19301 \begin_inset Flex Code
19304 \begin_layout Plain Layout
19310 block, so only the CSS itself need be included.
19313 \begin_layout Description
19314 \begin_inset Flex Code
19317 \begin_layout Plain Layout
19324 \begin_inset Flex Code
19327 \begin_layout Plain Layout
19333 ] The tag to be used for the main label, replacing
19334 \begin_inset Flex Code
19337 \begin_layout Plain Layout
19343 in the examples above.
19345 \begin_inset Flex Code
19348 \begin_layout Plain Layout
19357 \begin_layout Description
19358 \begin_inset Flex Code
19361 \begin_layout Plain Layout
19368 \begin_inset Flex Code
19371 \begin_layout Plain Layout
19381 ] Marks this style as the one to be used to generate the
19382 \begin_inset Flex Code
19385 \begin_layout Plain Layout
19391 tag for the XHTML file.
19392 By default, it is false.
19394 \begin_inset Flex Code
19397 \begin_layout Plain Layout
19403 file sets it to true for the
19404 \begin_inset Flex Code
19407 \begin_layout Plain Layout
19417 \begin_layout Subsection
19421 \begin_layout Standard
19422 The XHTML output of insets can also be controlled by information in layout
19427 \begin_layout Plain Layout
19428 At present, this is true only for
19429 \begin_inset Quotes eld
19433 \begin_inset Quotes erd
19436 insets (insets you can type into) and is not true for
19437 \begin_inset Quotes eld
19441 \begin_inset Quotes erd
19444 insets (insets that are associated with dialog boxes).
19449 Here, too, LyX tries to provide sensible defaults, and it constructs default
19451 But everything can be customized.
19454 \begin_layout Standard
19455 The XHTML LyX outputs for an inset has the following form:
19458 \begin_layout LyX-Code
19460 \begin_inset Quotes erd
19464 \begin_inset Quotes erd
19470 \begin_layout LyX-Code
19471 <labeltag>Label</labeltag>
19474 \begin_layout LyX-Code
19476 \begin_inset Quotes erd
19480 \begin_inset Quotes erd
19483 >Contents of the inset.</innertag>
19486 \begin_layout LyX-Code
19490 \begin_layout Standard
19491 If the inset permits multiple paragraphs---that is, if
19492 \begin_inset Flex Code
19495 \begin_layout Plain Layout
19501 is true---then the contents of the inset will itself be output as paragraphs
19502 formatted according to the styles used for those paragraphs (standard,
19503 quote, and the like).
19504 The label tag is of course omitted if the paragraph does not have a label
19505 and, at present, is always
19506 \begin_inset Flex Code
19509 \begin_layout Plain Layout
19516 The inner tag is optional and, by default, does not appear.
19519 \begin_layout Standard
19520 The specific tags and attributes output for each inset can be controlled
19521 by means of the following layout tags.
19524 \begin_layout Description
19525 \begin_inset Flex Code
19528 \begin_layout Plain Layout
19535 \begin_inset Flex Code
19538 \begin_layout Plain Layout
19544 ] Specifies attribute information to be output with the main tag.
19546 \begin_inset Quotes eld
19550 \begin_inset Flex Code
19553 \begin_layout Plain Layout
19554 class=`myinset' onclick=`\SpecialChar \ldots{}
19561 \begin_inset Quotes erd
19565 By default, LyX will output
19566 \begin_inset Quotes eld
19570 \begin_inset Flex Code
19573 \begin_layout Plain Layout
19580 \begin_inset Quotes erd
19584 \begin_inset Flex Code
19587 \begin_layout Plain Layout
19593 is the LyX name of the inset, made lowercase and with non-alphanumeric
19594 characters converted to underscores, for example: footnote.
19597 \begin_layout Description
19598 \begin_inset Flex Code
19601 \begin_layout Plain Layout
19608 \begin_inset Flex Code
19611 \begin_layout Plain Layout
19621 ] Whether to output the default CSS information LyX generates for this layout,
19622 even if additional information is explicitly provided via
19623 \begin_inset Flex Code
19626 \begin_layout Plain Layout
19634 \begin_inset Flex Code
19637 \begin_layout Plain Layout
19643 allows you to alter or augment the generated CSS, rather than to override
19648 \begin_layout Description
19649 \begin_inset Flex Code
19652 \begin_layout Plain Layout
19659 \begin_inset Flex Code
19662 \begin_layout Plain Layout
19668 ] Attributes for the inner tag.
19670 \begin_inset Quotes eld
19674 \begin_inset Flex Code
19677 \begin_layout Plain Layout
19678 class=`insetname_inner'
19684 \begin_inset Quotes erd
19690 \begin_layout Description
19691 \begin_inset Flex Code
19694 \begin_layout Plain Layout
19701 \begin_inset Flex Code
19704 \begin_layout Plain Layout
19710 ] The inner tag, replacing
19711 \begin_inset Flex Code
19714 \begin_layout Plain Layout
19720 in the examples above.
19721 By default, there is none.
19724 \begin_layout Description
19725 \begin_inset Flex Code
19728 \begin_layout Plain Layout
19735 \begin_inset Flex Code
19738 \begin_layout Plain Layout
19746 ] Whether this inset represents a standalone block of text (such as a footnote)
19747 or instead represents material that is included in the surrounding text
19748 (such as a branch).
19752 \begin_layout Description
19753 \begin_inset Flex Code
19756 \begin_layout Plain Layout
19763 \begin_inset Flex Code
19766 \begin_layout Plain Layout
19772 ] A label for this inset, possibly including a reference to a counter.
19773 For example, for footnote, it might be:
19774 \begin_inset Flex Code
19777 \begin_layout Plain Layout
19786 This is optional, and there is no default.
19789 \begin_layout Description
19790 \begin_inset Flex Code
19793 \begin_layout Plain Layout
19799 Information to be output in the
19800 \begin_inset Flex Code
19803 \begin_layout Plain Layout
19809 section when this style is used.
19810 This might, for example, be used to include a
19811 \begin_inset Flex Code
19814 \begin_layout Plain Layout
19821 \begin_inset Flex Code
19824 \begin_layout Plain Layout
19833 \begin_layout Description
19834 \begin_inset Flex Code
19837 \begin_layout Plain Layout
19843 CSS style information to be included when this style is used.
19844 Note that this will automatically be wrapped in a layout-generated
19845 \begin_inset Flex Code
19848 \begin_layout Plain Layout
19854 block, so only the CSS itself need be included.
19857 \begin_layout Description
19858 \begin_inset Flex Code
19861 \begin_layout Plain Layout
19868 \begin_inset Flex Code
19871 \begin_layout Plain Layout
19877 ] The tag to be used for the main label, replacing
19878 \begin_inset Flex Code
19881 \begin_layout Plain Layout
19887 in the examples above.
19888 The default depends upon the setting of
19889 \begin_inset Flex Code
19892 \begin_layout Plain Layout
19899 \begin_inset Flex Code
19902 \begin_layout Plain Layout
19908 is true, the default is
19909 \begin_inset Flex Code
19912 \begin_layout Plain Layout
19918 ; if it is false, the default is
19919 \begin_inset Flex Code
19922 \begin_layout Plain Layout
19931 \begin_layout Subsection
19935 \begin_layout Standard
19936 The XHTML output for floats too can be controlled by layout information.
19937 The output has the following form:
19940 \begin_layout LyX-Code
19942 \begin_inset Quotes erd
19946 \begin_inset Quotes erd
19952 \begin_layout LyX-Code
19953 Contents of the float.
19956 \begin_layout LyX-Code
19960 \begin_layout Standard
19961 The caption, if there is one, is a separate inset and will be output as
19963 Its appearance can be controlled via the InsetLayout for caption insets.
19967 \begin_layout Description
19968 \begin_inset Flex Code
19971 \begin_layout Plain Layout
19978 \begin_inset Flex Code
19981 \begin_layout Plain Layout
19987 ] Specifies attribute information to be output with the main tag.
19989 \begin_inset Quotes eld
19993 \begin_inset Flex Code
19996 \begin_layout Plain Layout
19997 class=`myfloat' onclick=`\SpecialChar \ldots{}
20004 \begin_inset Quotes erd
20008 By default, LyX will output
20009 \begin_inset Quotes eld
20013 \begin_inset Flex Code
20016 \begin_layout Plain Layout
20017 class=`float float-floattype'
20023 \begin_inset Quotes erd
20027 \begin_inset Flex Code
20030 \begin_layout Plain Layout
20036 is LyX's name for this type of float, as determined by the float declaration
20038 \begin_inset CommandInset ref
20040 reference "sub:Floats"
20044 ), though made lowercase and with non-alphanumeric characters converted
20045 to underscores, for example: float-table.
20048 \begin_layout Description
20049 \begin_inset Flex Code
20052 \begin_layout Plain Layout
20058 CSS style information to be included when this float is used.
20059 Note that this will automatically be wrapped in a layout-generated
20060 \begin_inset Flex Code
20063 \begin_layout Plain Layout
20069 block, so only the CSS itself need be included.
20072 \begin_layout Description
20073 \begin_inset Flex Code
20076 \begin_layout Plain Layout
20083 \begin_inset Flex Code
20086 \begin_layout Plain Layout
20092 ] The tag to be used for this float, replacing
20093 \begin_inset Quotes eld
20097 \begin_inset Flex Code
20100 \begin_layout Plain Layout
20107 \begin_inset Quotes erd
20110 in the example above.
20112 \begin_inset Flex Code
20115 \begin_layout Plain Layout
20121 and will rarely need changing.
20124 \begin_layout Subsection
20125 Bibliography formatting
20128 \begin_layout Standard
20129 The bibliography can be formatted using
20130 \begin_inset Flex Code
20133 \begin_layout Plain Layout
20141 \begin_inset CommandInset ref
20143 reference "sub:Citation-format-description"
20150 \begin_layout Subsection
20154 \begin_layout Standard
20155 We have several times mentioned that LyX will generate default CSS style
20156 rules for both insets and paragraph styles, based upon the other layout
20157 information that is provided.
20158 In this section, we shall say a word about which layout information LyX
20162 \begin_layout Standard
20163 At present, LyX auto-generates CSS only for font information, making use
20165 \begin_inset Flex Code
20168 \begin_layout Plain Layout
20175 \begin_inset Flex Code
20178 \begin_layout Plain Layout
20185 \begin_inset Flex Code
20188 \begin_layout Plain Layout
20195 \begin_inset Flex Code
20198 \begin_layout Plain Layout
20205 \begin_inset Flex Code
20208 \begin_layout Plain Layout
20216 \begin_inset CommandInset ref
20218 reference "sub:Font-description"
20222 .) The translation is mostly straightforward and obvious.
20224 \begin_inset Quotes eld
20228 \begin_inset Flex Code
20231 \begin_layout Plain Layout
20238 \begin_inset Quotes erd
20242 \begin_inset Quotes eld
20246 \begin_inset Flex Code
20249 \begin_layout Plain Layout
20250 font-family: sans-serif;
20256 \begin_inset Quotes erd
20260 The correspondence of LyX sizes and CSS sizes is a little less obvious
20261 but nonetheless intuitive.
20263 \begin_inset Flex Code
20266 \begin_layout Plain Layout
20273 \begin_inset Flex URL
20276 \begin_layout Plain Layout
20286 \begin_layout Chapter
20287 Including External Material
20290 \begin_layout Standard
20291 \begin_inset Box Shadowbox
20301 height_special "totalheight"
20304 \begin_layout Plain Layout
20305 WARNING: This portion of the documentation has not been updated for some
20307 We certainly hope that it is still accurate, but there are no guarantees.
20315 \begin_layout Standard
20316 The use of material from sources external to LyX is covered in detail in
20322 This part of the manual covers what needs to happen behind the scenes for
20323 new sorts of material to be included.
20326 \begin_layout Section
20330 \begin_layout Standard
20331 The external material feature is based on the concept of a
20336 A template is a specification of how LyX should interface with a certain
20338 As bundled, LyX comes with predefined templates for Xfig figures, various
20339 raster format images, chess diagrams, and LilyPond music notation.
20340 You can check the actual list by using the menu
20341 \begin_inset Flex MenuItem
20344 \begin_layout Plain Layout
20345 Insert\SpecialChar \menuseparator
20346 File\SpecialChar \menuseparator
20353 Furthermore, it is possible to roll your own template to support a specific
20355 Later we'll describe in more detail what is involved, and hopefully you
20356 will submit all the templates you create so we can include them in a later
20360 \begin_layout Standard
20361 Another basic idea of the external material feature is to distinguish between
20362 the original file that serves as a base for final material and the produced
20363 file that is included in your exported or printed document.
20364 For example, consider the case of a figure produced with
20365 \begin_inset Flex Code
20368 \begin_layout Plain Layout
20375 The Xfig application itself works on an original file with the
20376 \begin_inset Flex Code
20379 \begin_layout Plain Layout
20386 Within Xfig, you create and change your figure, and when you are done,
20388 \begin_inset Flex Code
20391 \begin_layout Plain Layout
20398 When you want to include the figure in your document, you invoke
20399 \begin_inset Flex Code
20402 \begin_layout Plain Layout
20408 in order to create a PostScript file that can readily be included in your
20411 \begin_inset Flex Code
20414 \begin_layout Plain Layout
20420 file is the original file, and the PostScript file is the produced file.
20423 \begin_layout Standard
20424 This distinction is important in order to allow updating of the material
20425 while you are in the process of writing the document.
20426 Furthermore, it provides us with the flexibility that is needed to support
20427 multiple export formats.
20428 For instance, in the case of a plain text file, it is not exactly an award-winn
20429 ing idea to include the figure as raw PostScript.
20430 Instead, you would either prefer to just include a reference to the figure
20431 or try to invoke some graphics to ASCII converter to make the final result
20432 look similar to the real graphics.
20433 The external material management allows you to do this, because it is parametri
20434 zed on the different export formats that LyX supports.
20437 \begin_layout Standard
20438 Besides supporting the production of different products according to the
20439 exported format, it supports tight integration with editing and viewing
20441 In the case of an Xfig figure, you are able to invoke Xfig on the original
20442 file with a single click from within the external material dialog in LyX,
20443 and also preview the produced PostScript file with Ghostview with another
20445 No more fiddling around with the command line and/or file browsers to locate
20446 and manipulate the original or produced files.
20447 In this way, you are finally able to take full advantage of the many different
20448 applications that are relevant to use when you write your documents, and
20449 ultimately be more productive.
20452 \begin_layout Section
20453 The external template configuration file
20456 \begin_layout Standard
20457 It is relatively easy to add custom external template definitions to LyX.
20458 However, be aware that doing this in an careless manner most probably
20462 introduce an easily exploitable security hole.
20463 So before you do this, please read the discussion about security in section
20465 \begin_inset CommandInset ref
20467 reference "sec:Security-discussion"
20474 \begin_layout Standard
20475 Having said that, we encourage you to submit any interesting templates that
20480 \begin_layout Standard
20481 The external templates are defined in the
20482 \begin_inset Flex Code
20485 \begin_layout Plain Layout
20486 LyXDir/lib/external_templates
20492 You can place your own version in
20493 \begin_inset Flex Code
20496 \begin_layout Plain Layout
20497 UserDir/external_templates
20505 \begin_layout Standard
20506 A typical template looks like this:
20509 \begin_layout LyX-Code
20513 \begin_layout LyX-Code
20514 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
20517 \begin_layout LyX-Code
20521 \begin_layout LyX-Code
20525 \begin_layout LyX-Code
20529 \begin_layout LyX-Code
20533 \begin_layout LyX-Code
20537 \begin_layout LyX-Code
20538 AutomaticProduction true
20541 \begin_layout LyX-Code
20545 \begin_layout LyX-Code
20549 \begin_layout LyX-Code
20553 \begin_layout LyX-Code
20554 TransformCommand Rotate RotationLatexCommand
20557 \begin_layout LyX-Code
20558 TransformCommand Resize ResizeLatexCommand
20561 \begin_layout LyX-Code
20562 Product "$$RotateFront$$ResizeFront
20565 \begin_layout LyX-Code
20570 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
20573 \begin_layout LyX-Code
20574 $$ResizeBack$$RotateBack"
20577 \begin_layout LyX-Code
20581 \begin_layout LyX-Code
20582 UpdateResult "$$AbsPath$$Basename.pstex_t"
20585 \begin_layout LyX-Code
20586 Requirement "graphicx"
20589 \begin_layout LyX-Code
20590 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20593 \begin_layout LyX-Code
20594 ReferencedFile latex "$$AbsPath$$Basename.eps"
20597 \begin_layout LyX-Code
20598 ReferencedFile dvi "$$AbsPath$$Basename.eps"
20601 \begin_layout LyX-Code
20605 \begin_layout LyX-Code
20609 \begin_layout LyX-Code
20610 TransformCommand Rotate RotationLatexCommand
20613 \begin_layout LyX-Code
20614 TransformCommand Resize ResizeLatexCommand
20617 \begin_layout LyX-Code
20618 Product "$$RotateFront$$ResizeFront
20621 \begin_layout LyX-Code
20626 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
20629 \begin_layout LyX-Code
20630 $$ResizeBack$$RotateBack"
20633 \begin_layout LyX-Code
20634 UpdateFormat pdftex
20637 \begin_layout LyX-Code
20638 UpdateResult "$$AbsPath$$Basename.pdftex_t"
20641 \begin_layout LyX-Code
20642 Requirement "graphicx"
20645 \begin_layout LyX-Code
20646 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
20649 \begin_layout LyX-Code
20650 ReferencedFile latex "$$AbsPath$$Basename.pdf"
20653 \begin_layout LyX-Code
20657 \begin_layout LyX-Code
20661 \begin_layout LyX-Code
20662 Product "$$Contents(
20664 "$$AbsPath$$Basename.asc
20669 \begin_layout LyX-Code
20670 UpdateFormat asciixfig
20673 \begin_layout LyX-Code
20674 UpdateResult "$$AbsPath$$Basename.asc"
20677 \begin_layout LyX-Code
20681 \begin_layout LyX-Code
20685 \begin_layout LyX-Code
20686 Product "<graphic fileref=
20688 "$$AbsOrRelPathMaster$$Basename.eps
20693 \begin_layout LyX-Code
20697 \begin_layout LyX-Code
20701 \begin_layout LyX-Code
20702 UpdateResult "$$AbsPath$$Basename.eps"
20705 \begin_layout LyX-Code
20706 ReferencedFile docbook "$$AbsPath$$Basename.eps"
20709 \begin_layout LyX-Code
20710 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
20713 \begin_layout LyX-Code
20717 \begin_layout LyX-Code
20718 Product "[XFig: $$FName]"
20721 \begin_layout LyX-Code
20725 \begin_layout LyX-Code
20729 \begin_layout Standard
20730 As you can see, the template is enclosed in
20731 \begin_inset Flex Code
20734 \begin_layout Plain Layout
20740 \SpecialChar \ldots{}
20742 \begin_inset Flex Code
20745 \begin_layout Plain Layout
20752 It contains a header specifying some general settings and, for each supported
20753 primary document file format, a section
20754 \begin_inset Flex Code
20757 \begin_layout Plain Layout
20763 \SpecialChar \ldots{}
20765 \begin_inset Flex Code
20768 \begin_layout Plain Layout
20777 \begin_layout Subsection
20778 The template header
20781 \begin_layout Description
20782 \begin_inset Flex Code
20785 \begin_layout Plain Layout
20786 AutomaticProduction
20787 \begin_inset space ~
20795 Whether the file represented by the template must be generated by LyX.
20796 This command must occur exactly once.
20799 \begin_layout Description
20800 \begin_inset Flex Code
20803 \begin_layout Plain Layout
20805 \begin_inset space ~
20813 A glob pattern that is used in the file dialog to filter out the desired
20815 If there is more than one possible file extension (e.
20816 \begin_inset space \thinspace{}
20820 \begin_inset space \space{}
20824 \begin_inset Flex Code
20827 \begin_layout Plain Layout
20834 \begin_inset Flex Code
20837 \begin_layout Plain Layout
20843 ), use something like
20844 \begin_inset Flex Code
20847 \begin_layout Plain Layout
20854 This command must occur exactly once.
20857 \begin_layout Description
20858 \begin_inset Flex Code
20861 \begin_layout Plain Layout
20863 \begin_inset space ~
20871 The text that is displayed on the button.
20872 This command must occur exactly once.
20875 \begin_layout Description
20876 \begin_inset Flex Code
20879 \begin_layout Plain Layout
20881 \begin_inset space ~
20885 \begin_inset space ~
20893 The help text that is used in the External dialog.
20894 Provide enough information to explain to the user just what the template
20895 can provide him with.
20896 This command must occur exactly once.
20899 \begin_layout Description
20900 \begin_inset Flex Code
20903 \begin_layout Plain Layout
20905 \begin_inset space ~
20913 The file format of the original file.
20914 This must be the name of a format that is known to LyX (see section
20915 \begin_inset space ~
20919 \begin_inset CommandInset ref
20921 reference "sec:Formats"
20927 \begin_inset Quotes eld
20931 \begin_inset Flex Code
20934 \begin_layout Plain Layout
20941 \begin_inset Quotes erd
20944 if the template can handle original files of more than one format.
20945 LyX will attempt to interrogate the file itself in order to deduce its
20946 format in this case.
20947 This command must occur exactly once.
20950 \begin_layout Description
20951 \begin_inset Flex Code
20954 \begin_layout Plain Layout
20956 \begin_inset space ~
20964 A unique name for the template.
20965 It must not contain substitution macros (see below).
20968 \begin_layout Description
20969 \begin_inset Flex Code
20972 \begin_layout Plain Layout
20974 \begin_inset space ~
20977 Rotate|Resize|Clip|Extra
20982 This command specifies which transformations are supported by this template.
20983 It may occur zero or more times.
20984 This command enables the corresponding tabs in the external dialog.
20986 \begin_inset Flex Code
20989 \begin_layout Plain Layout
20995 command must have either a corresponding
20996 \begin_inset Flex Code
20999 \begin_layout Plain Layout
21006 \begin_inset Flex Code
21009 \begin_layout Plain Layout
21016 \begin_inset Flex Code
21019 \begin_layout Plain Layout
21026 Otherwise the transformation will not be supported by that format.
21029 \begin_layout Subsection
21033 \begin_layout Description
21034 \begin_inset Flex Code
21037 \begin_layout Plain Layout
21039 \begin_inset space ~
21042 LaTeX|PDFLaTeX|PlainText|DocBook
21047 The primary document file format that this format definition is for.
21048 Not every template has a sensible representation in all document file formats.
21049 Please define nevertheless a
21050 \begin_inset Flex Code
21053 \begin_layout Plain Layout
21059 section for all templates.
21060 Use a dummy text when no representation is available.
21061 Then you can at least see a reference to the external material in the exported
21065 \begin_layout Description
21066 \begin_inset Flex Code
21069 \begin_layout Plain Layout
21071 \begin_inset space ~
21075 \begin_inset space ~
21083 This command defines an additional macro
21084 \begin_inset Flex Code
21087 \begin_layout Plain Layout
21093 for substitution in
21094 \begin_inset Flex Code
21097 \begin_layout Plain Layout
21105 \begin_inset Flex Code
21108 \begin_layout Plain Layout
21114 itself may contain substitution macros.
21115 The advantage over using
21116 \begin_inset Flex Code
21119 \begin_layout Plain Layout
21126 \begin_inset Flex Code
21129 \begin_layout Plain Layout
21135 is that the substituted value of
21136 \begin_inset Flex Code
21139 \begin_layout Plain Layout
21145 is sanitized so that it is a valid optional argument in the document format.
21146 This command may occur zero or more times.
21149 \begin_layout Description
21150 \begin_inset Flex Code
21153 \begin_layout Plain Layout
21155 \begin_inset space ~
21163 The text that is inserted in the exported document.
21164 This is actually the most important command and can be quite complex.
21165 This command must occur exactly once.
21168 \begin_layout Description
21169 \begin_inset Flex Code
21172 \begin_layout Plain Layout
21174 \begin_inset space ~
21182 This command specifies a preamble snippet that will be included in the
21184 It has to be defined using
21185 \begin_inset Flex Code
21188 \begin_layout Plain Layout
21194 \SpecialChar \ldots{}
21196 \begin_inset Flex Code
21199 \begin_layout Plain Layout
21206 This command may occur zero or more times.
21209 \begin_layout Description
21210 \begin_inset Flex Code
21213 \begin_layout Plain Layout
21215 \begin_inset space ~
21219 \begin_inset space ~
21227 This command denotes files that are created by the conversion process and
21228 are needed for a particular export format.
21229 If the filename is relative, it is interpreted relative to the master document.
21230 This command may be given zero or more times.
21233 \begin_layout Description
21234 \begin_inset Flex Code
21237 \begin_layout Plain Layout
21239 \begin_inset space ~
21247 The name of a required LaTeX package.
21248 The package is included via
21249 \begin_inset Flex Code
21252 \begin_layout Plain Layout
21260 in the LaTeX preamble.
21261 This command may occur zero or more times.
21264 \begin_layout Description
21265 \begin_inset Flex Code
21268 \begin_layout Plain Layout
21270 \begin_inset space ~
21274 \begin_inset space ~
21277 RotationLatexCommand
21282 This command specifies that the built in LaTeX command should be used for
21284 This command may occur once or not at all.
21287 \begin_layout Description
21288 \begin_inset Flex Code
21291 \begin_layout Plain Layout
21293 \begin_inset space ~
21297 \begin_inset space ~
21305 This command specifies that the built in LaTeX command should be used for
21307 This command may occur once or not at all.
21310 \begin_layout Description
21311 \begin_inset Flex Code
21314 \begin_layout Plain Layout
21316 \begin_inset space ~
21320 \begin_inset space ~
21323 RotationLatexOption
21328 This command specifies that rotation is done via an optional argument.
21329 This command may occur once or not at all.
21332 \begin_layout Description
21333 \begin_inset Flex Code
21336 \begin_layout Plain Layout
21338 \begin_inset space ~
21342 \begin_inset space ~
21350 This command specifies that resizing is done via an optional argument.
21351 This command may occur once or not at all.
21354 \begin_layout Description
21355 \begin_inset Flex Code
21358 \begin_layout Plain Layout
21360 \begin_inset space ~
21364 \begin_inset space ~
21372 This command specifies that clipping is done via an optional argument.
21373 This command may occur once or not at all.
21376 \begin_layout Description
21377 \begin_inset Flex Code
21380 \begin_layout Plain Layout
21382 \begin_inset space ~
21386 \begin_inset space ~
21394 This command specifies that an extra optional argument is used.
21395 This command may occur once or not at all.
21398 \begin_layout Description
21399 \begin_inset Flex Code
21402 \begin_layout Plain Layout
21404 \begin_inset space ~
21412 The file format of the converted file.
21413 This must be the name of a format that is known to LyX (see the
21414 \begin_inset Flex MenuItem
21417 \begin_layout Plain Layout
21422 ools\SpecialChar \menuseparator
21427 references\SpecialChar \menuseparator
21428 File Handling\SpecialChar \menuseparator
21435 This command must occur exactly once.
21438 \begin_layout Description
21439 \begin_inset Flex Code
21442 \begin_layout Plain Layout
21444 \begin_inset space ~
21452 The file name of the converted file.
21453 The file name must be absolute.
21454 This command must occur exactly once.
21457 \begin_layout Subsection
21458 Preamble definitions
21461 \begin_layout Standard
21462 The external template configuration file may contain additional preamble
21463 definitions enclosed by
21464 \begin_inset Flex Code
21467 \begin_layout Plain Layout
21473 \SpecialChar \ldots{}
21475 \begin_inset Flex Code
21478 \begin_layout Plain Layout
21485 They can be used by the templates in the
21486 \begin_inset Flex Code
21489 \begin_layout Plain Layout
21498 \begin_layout Section
21499 The substitution mechanism
21502 \begin_layout Standard
21503 When the external material facility invokes an external program, it is done
21504 on the basis of a command defined in the template configuration file.
21505 These commands can contain various macros that are expanded before execution.
21506 Execution always take place in the directory of the containing document.
21509 \begin_layout Standard
21510 Also, whenever external material is to be displayed, the name will be produced
21511 by the substitution mechanism, and most other commands in the template
21512 definition support substitution as well.
21515 \begin_layout Standard
21516 The available macros are the following:
21519 \begin_layout Description
21520 \begin_inset Flex Code
21523 \begin_layout Plain Layout
21524 $$AbsOrRelPathMaster
21529 The file path, absolute or relative to the master LyX document.
21532 \begin_layout Description
21533 \begin_inset Flex Code
21536 \begin_layout Plain Layout
21537 $$AbsOrRelPathParent
21542 The file path, absolute or relative to the LyX document.
21545 \begin_layout Description
21546 \begin_inset Flex Code
21549 \begin_layout Plain Layout
21555 The absolute file path.
21558 \begin_layout Description
21559 \begin_inset Flex Code
21562 \begin_layout Plain Layout
21568 The filename without path and without the extension.
21571 \begin_layout Description
21572 \begin_inset Flex Code
21575 \begin_layout Plain Layout
21577 \begin_inset Quotes eld
21581 \begin_inset Quotes erd
21589 This macro will expand to the contents of the file with the name
21590 \begin_inset Flex Code
21593 \begin_layout Plain Layout
21602 \begin_layout Description
21603 \begin_inset Flex Code
21606 \begin_layout Plain Layout
21612 The file extension (including the dot).
21615 \begin_layout Description
21616 \begin_inset Flex Code
21619 \begin_layout Plain Layout
21625 The filename of the file specified in the external material dialog.
21626 This is either an absolute name, or it is relative to the LyX document.
21629 \begin_layout Description
21630 \begin_inset Flex Code
21633 \begin_layout Plain Layout
21640 \begin_inset Flex Code
21643 \begin_layout Plain Layout
21649 (absolute name or relative to the LyX document).
21652 \begin_layout Description
21653 \begin_inset Flex Code
21656 \begin_layout Plain Layout
21662 The file path, relative to the master LyX document.
21665 \begin_layout Description
21666 \begin_inset Flex Code
21669 \begin_layout Plain Layout
21675 The file path, relative to the LyX document.
21678 \begin_layout Description
21679 \begin_inset Flex Code
21682 \begin_layout Plain Layout
21688 This macro will expand to the absolute path of the system directory.
21689 This is typically used to point to the various helper scripts that are
21693 \begin_layout Description
21694 \begin_inset Flex Code
21697 \begin_layout Plain Layout
21703 A name and full path to a temporary file which will be automatically deleted
21704 whenever the containing document is closed, or the external material insertion
21708 \begin_layout Standard
21709 All path macros contain a trailing directory separator, so you can construct
21711 \begin_inset space \thinspace{}
21715 \begin_inset space \space{}
21718 the absolute filename with
21719 \begin_inset Flex Code
21722 \begin_layout Plain Layout
21723 $$AbsPath$$Basename$$Extension
21731 \begin_layout Standard
21732 The macros above are substituted in all commands unless otherwise noted.
21734 \begin_inset Flex Code
21737 \begin_layout Plain Layout
21743 supports additionally the following substitutions if they are enabled by
21745 \begin_inset Flex Code
21748 \begin_layout Plain Layout
21755 \begin_inset Flex Code
21758 \begin_layout Plain Layout
21767 \begin_layout Description
21768 \begin_inset Flex Code
21771 \begin_layout Plain Layout
21777 The front part of the resize command.
21780 \begin_layout Description
21781 \begin_inset Flex Code
21784 \begin_layout Plain Layout
21790 The back part of the resize command.
21793 \begin_layout Description
21794 \begin_inset Flex Code
21797 \begin_layout Plain Layout
21803 The front part of the rotation command.
21806 \begin_layout Description
21807 \begin_inset Flex Code
21810 \begin_layout Plain Layout
21816 The back part of the rotation command.
21819 \begin_layout Standard
21820 The value string of the
21821 \begin_inset Flex Code
21824 \begin_layout Plain Layout
21830 command supports additionally the following substitutions if they are enabled
21832 \begin_inset Flex Code
21835 \begin_layout Plain Layout
21842 \begin_inset Flex Code
21845 \begin_layout Plain Layout
21854 \begin_layout Description
21855 \begin_inset Flex Code
21858 \begin_layout Plain Layout
21867 \begin_layout Description
21868 \begin_inset Flex Code
21871 \begin_layout Plain Layout
21880 \begin_layout Description
21881 \begin_inset Flex Code
21884 \begin_layout Plain Layout
21893 \begin_layout Description
21894 \begin_inset Flex Code
21897 \begin_layout Plain Layout
21903 The rotation option.
21906 \begin_layout Standard
21907 You may ask why there are so many path macros.
21908 There are mainly two reasons:
21911 \begin_layout Enumerate
21912 Relative and absolute file names should remain relative or absolute, respectivel
21914 Users may have reasons to prefer either form.
21915 Relative names are useful for portable documents that should work on different
21916 machines, for example.
21917 Absolute names may be required by some programs.
21920 \begin_layout Enumerate
21921 LaTeX treats relative file names differently than LyX and other programs
21922 in nested included files.
21923 For LyX, a relative file name is always relative to the document that contains
21925 For LaTeX, it is always relative to the master document.
21926 These two definitions are identical if you have only one document, but
21927 differ if you have a master document that includes part documents.
21928 That means that relative filenames must be transformed when presented to
21930 Fortunately LyX does this automatically for you if you choose the right
21934 \begin_layout Standard
21935 So which path macro should be used in new template definitions? The rule
21939 \begin_layout Itemize
21941 \begin_inset Flex Code
21944 \begin_layout Plain Layout
21950 if an absolute path is required.
21953 \begin_layout Itemize
21955 \begin_inset Flex Code
21958 \begin_layout Plain Layout
21959 $$AbsOrRelPathMaster
21964 if the substituted string is some kind of LaTeX input.
21967 \begin_layout Itemize
21969 \begin_inset Flex Code
21972 \begin_layout Plain Layout
21973 $$AbsOrRelPathParent
21978 in order to preserve the user's choice.
21981 \begin_layout Standard
21982 There are special cases where this rule does not work and e.
21983 \begin_inset space \thinspace{}
21987 \begin_inset space \space{}
21990 relative names are needed, but normally it will work just fine.
21991 One example for such a case is the command
21992 \begin_inset Flex Code
21995 \begin_layout Plain Layout
21996 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
22001 in the XFig template above: We can't use the absolute name because the
22003 \begin_inset Flex Code
22006 \begin_layout Plain Layout
22012 files needs the relative name in order to rewrite the file content.
22015 \begin_layout Section
22016 Security discussion
22017 \begin_inset CommandInset label
22019 name "sec:Security-discussion"
22026 \begin_layout Standard
22027 The external material feature interfaces with a lot of external programs
22028 and does so automatically, so we have to consider the security implications
22030 In particular, since you have the option of including your own filenames
22031 and/or parameter strings and those are expanded into a command, it seems
22032 that it would be possible to create a malicious document which executes
22033 arbitrary commands when a user views or prints the document.
22034 This is something we definitely want to avoid.
22037 \begin_layout Standard
22038 However, since the external program commands are specified in the template
22039 configuration file only, there are no security issues if LyX is properly
22040 configured with safe templates only.
22041 This is so because the external programs are invoked with the
22042 \begin_inset Flex Code
22045 \begin_layout Plain Layout
22051 -system call rather than the
22052 \begin_inset Flex Code
22055 \begin_layout Plain Layout
22061 system-call, so it's not possible to execute arbitrary commands from the
22062 filename or parameter section via the shell.
22065 \begin_layout Standard
22066 This also implies that you are restricted in what command strings you can
22067 use in the external material templates.
22068 In particular, pipes and redirection are not readily available.
22069 This has to be so if LyX should remain safe.
22070 If you want to use some of the shell features, you should write a safe
22071 script to do this in a controlled manner, and then invoke the script from
22072 the command string.
22076 \begin_layout Standard
22077 It is possible to design a template that interacts directly with the shell,
22078 but since this would allow a malicious user to execute arbitrary commands
22079 by writing clever filenames and/or parameters, we generally recommend that
22080 you only use safe scripts that work with the
22081 \begin_inset Flex Code
22084 \begin_layout Plain Layout
22090 system call in a controlled manner.
22091 Of course, for use in a controlled environment, it can be tempting to just
22092 fall back to use ordinary shell scripts.
22093 If you do so, be aware that you
22097 provide an easily exploitable security hole in your system.
22098 Of course it stands to reason that such unsafe templates will never be
22099 included in the standard LyX distribution, although we do encourage people
22100 to submit new templates in the open source tradition.
22101 But LyX as shipped from the official distribution channels will never have
22105 \begin_layout Standard
22106 Including external material provides a lot of power, and you have to be
22107 careful not to introduce security hazards with this power.
22108 A subtle error in a single line in an innocent looking script can open
22109 the door to huge security problems.
22110 So if you do not fully understand the issues, we recommend that you consult
22111 a knowledgeable security professional or the LyX development team if you
22112 have any questions about whether a given template is safe or not.
22113 And do this before you use it in an uncontrolled environment.