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"
145 \author 2090807402 "usti"
151 Customizing LyX: Features for the Advanced User
159 \begin_layout Plain Layout
161 If you have comments or error corrections, please send them to the LyX Documenta
163 \begin_inset CommandInset href
165 target "lyx-docs@lists.lyx.org"
172 \begin_inset Quotes eld
176 \begin_inset Quotes erd
179 in the subject header, and please cc the current maintainer of this file,
180 Richard Heck <rgheck@comcast.net>.
186 \begin_inset Newline newline
190 \begin_inset Newline newline
196 \begin_layout Standard
197 \begin_inset CommandInset toc
198 LatexCommand tableofcontents
205 \begin_layout Standard
206 \begin_inset Note Note
209 \begin_layout Plain Layout
210 Please use change tracking when modifying this document.
211 This makes it easier for our translators to recognize things that have
212 been changed, and it helps the maintainer keep up-to-date with what's been
221 \begin_layout Chapter
225 \begin_layout Standard
226 This manual covers the customization features present in LyX.
227 In it, we discuss issues like keyboard shortcuts, screen previewing options,
228 printer options, sending commands to LyX via the LyX Server, internationalizati
229 on, installing new LaTeX classes and LyX layouts, etc.
230 We can't possibly hope to touch on everything you can change—our developers
231 add new features faster than we can document them—but we will explain the
232 most common customizations and hopefully point you in the right direction
233 for some of the more obscure ones.
236 \begin_layout Standard
237 \begin_inset Branch OutDated
240 \begin_layout Standard
241 Information from previous versions of this document that now seems to be
242 outdated is contained in the OutDated branch of this document.
243 By default, this information will not appear in the LaTeX output.
251 \begin_layout Chapter
252 LyX configuration files
255 \begin_layout Standard
256 This chapter aims to help you to find your way through the LyX configuration
258 Before continuing to read this chapter, you should find out where your
259 LyX library and user directories are by using
260 \begin_inset Flex MenuItem
263 \begin_layout Plain Layout
264 Help\SpecialChar \menuseparator
275 The library directory is the place where LyX places its system-wide configurati
276 on files; the user directory is where you can place your modified versions.
277 We will call the former
278 \begin_inset Flex Code
281 \begin_layout Plain Layout
288 \begin_inset Flex MenuItem
291 \begin_layout Plain Layout
297 in the remainder of this document.
301 \begin_layout Section
303 \begin_inset Flex Code
306 \begin_layout Plain Layout
315 \begin_layout Standard
316 \begin_inset Flex Code
319 \begin_layout Plain Layout
325 and its sub-directories contain a number of files and that can be used
326 to customize LyX's behavior.
327 You can change many of these files from within LyX itself through the
328 \begin_inset Flex MenuItem
331 \begin_layout Plain Layout
332 Tools\SpecialChar \menuseparator
339 Most customization that you will want to do in LyX is possible through
341 However, many other inner aspects of LyX can be customized by modifying
343 \begin_inset Flex Code
346 \begin_layout Plain Layout
353 These files fall in different categories, described in the following subsection
357 \begin_layout Subsection
358 Automatically generated files
361 \begin_layout Standard
362 The files, which are to be found in
363 \begin_inset Flex MenuItem
366 \begin_layout Plain Layout
372 , are generated when you configure LyX.
373 They contain various default values that are guessed by inspection.
374 In general, it is not a good idea to modify them, since they might be overwritt
378 \begin_layout Labeling
379 \labelwidthstring 00.00.0000
380 \begin_inset Flex Code
383 \begin_layout Plain Layout
389 contains defaults for various commands.
392 \begin_layout Labeling
393 \labelwidthstring 00.00.0000
394 \begin_inset Flex Code
397 \begin_layout Plain Layout
403 contains the list of packages that have been recognized by LyX.
404 It is currently unused by the LyX program itself, but the information extracted
405 , and more, is made available with
406 \begin_inset Flex MenuItem
409 \begin_layout Plain Layout
410 Help\SpecialChar \menuseparator
423 \begin_layout Labeling
424 \labelwidthstring 00.00.0000
425 \begin_inset Flex Code
428 \begin_layout Plain Layout
434 the list of text classes that have been found in your
435 \begin_inset Flex Code
438 \begin_layout Plain Layout
444 directories, along with the associated LaTeX document class and their descripti
448 \begin_layout Labeling
449 \labelwidthstring 00.00.0000
450 \begin_inset Flex Code
453 \begin_layout Plain Layout
459 the list of layout modules found in your
460 \begin_inset Flex Code
463 \begin_layout Plain Layout
472 \begin_layout Labeling
473 \labelwidthstring 00.00.0000
474 \begin_inset Flex Code
477 \begin_layout Plain Layout
483 lists of various sorts of LaTeX-related files found on your system
486 \begin_layout Labeling
487 \labelwidthstring 00.00.0000
488 \begin_inset Flex Code
491 \begin_layout Plain Layout
497 is automatically generated during configuration from the file
498 \begin_inset Flex Code
501 \begin_layout Plain Layout
508 It contains information on your LaTeX configuration.
511 \begin_layout Subsection
515 \begin_layout Standard
516 These directories are duplicated between
517 \begin_inset Flex Code
520 \begin_layout Plain Layout
527 \begin_inset Flex Code
530 \begin_layout Plain Layout
537 If a particular files exists in both places, the one in
538 \begin_inset Flex Code
541 \begin_layout Plain Layout
550 \begin_layout Labeling
551 \labelwidthstring 00.00.0000
552 \begin_inset Flex Code
555 \begin_layout Plain Layout
561 this directory contains files with the extension
562 \begin_inset Flex Code
565 \begin_layout Plain Layout
571 that define the keybindings used in LyX.
572 If there exists an internationalized version of the bind file named
573 \begin_inset Flex Code
576 \begin_layout Plain Layout
582 , that will be used first.
585 \begin_layout Labeling
586 \labelwidthstring 00.00.0000
587 \begin_inset Flex Code
590 \begin_layout Plain Layout
596 contains graphics files that can be included in documents.
600 \begin_layout Labeling
601 \labelwidthstring 00.00.0000
602 \begin_inset Flex Code
605 \begin_layout Plain Layout
611 contains LyX documentation files (including the one you are currently reading).
613 \begin_inset Flex Code
616 \begin_layout Plain Layout
622 deserves special attention, as noted above.
623 The internationalized help docs are in subdirectories
624 \begin_inset Flex Code
627 \begin_layout Plain Layout
634 \begin_inset Quotes eld
638 \begin_inset Quotes erd
641 is the ISO language code.
647 \begin_inset CommandInset ref
649 reference "cha:Internationalizing-LyX"
656 \begin_layout Labeling
657 \labelwidthstring 00.00.0000
658 \begin_inset Flex Code
661 \begin_layout Plain Layout
667 contains example files that explain how to use some features.
668 In the file browser, press the
669 \begin_inset Flex MenuItem
672 \begin_layout Plain Layout
681 \begin_layout Labeling
682 \labelwidthstring 00.00.0000
683 \begin_inset Flex Code
686 \begin_layout Plain Layout
692 contains image files that are used by the
693 \begin_inset Flex MenuItem
696 \begin_layout Plain Layout
703 In addition, it also contains the individual icons used in the toolbar
704 and the banners that can be shown when LyX is launched.
707 \begin_layout Labeling
708 \labelwidthstring 00.00.0000
709 \begin_inset Flex Code
712 \begin_layout Plain Layout
718 contains keyboard keymapping files.
724 \begin_inset CommandInset ref
726 reference "sec:International-Keymap-Stuff"
733 \begin_layout Labeling
734 \labelwidthstring 00.00.0000
735 \begin_inset Flex Code
738 \begin_layout Plain Layout
744 contains the text class and module files described in Chapter
749 \begin_inset CommandInset ref
751 reference "cha:Installing-New-Document"
758 \begin_layout Labeling
759 \labelwidthstring 00.00.0000
760 \begin_inset Flex Code
763 \begin_layout Plain Layout
770 \begin_inset Flex Code
773 \begin_layout Plain Layout
779 Python scripts used to convert between LyX versions.
780 These can be run from the command line if, say, you want to batch-convert
784 \begin_layout Labeling
785 \labelwidthstring 00.00.0000
786 \begin_inset Flex Code
789 \begin_layout Plain Layout
795 contains some files that demonstrate the capabilities of the
796 \begin_inset Flex MenuItem
799 \begin_layout Plain Layout
810 Also contains some scripts used by LyX itself.
813 \begin_layout Labeling
814 \labelwidthstring 00.00.0000
815 \begin_inset Flex Code
818 \begin_layout Plain Layout
824 contains the standard LyX template files described in Chapter
829 \begin_inset CommandInset ref
831 reference "sub:Creating-Templates"
838 \begin_layout Labeling
839 \labelwidthstring 00.00.0000
840 \begin_inset Flex Code
843 \begin_layout Plain Layout
849 contains files with the extension
850 \begin_inset Flex Code
853 \begin_layout Plain Layout
859 that define the user interface to LyX.
860 That is, the files define which items appear in which menus and the items
861 appearing on the toolbar.
864 \begin_layout Subsection
865 Files you don't want to modify
868 \begin_layout Standard
869 These files are used internally by LyX and you generally do not need to
870 modify them unless you are a developer.
873 \begin_layout Labeling
874 \labelwidthstring 00.00.0000
875 \begin_inset Flex Code
878 \begin_layout Plain Layout
884 this file contains the list of LyX developers.
885 The contents are displayed with the menu entry
886 \begin_inset Flex MenuItem
889 \begin_layout Plain Layout
890 Help\SpecialChar \menuseparator
903 \begin_layout Labeling
904 \labelwidthstring 00.00.0000
905 \begin_inset Flex Code
908 \begin_layout Plain Layout
914 this is a LaTeX script used during the configuration process.
918 \begin_layout Labeling
919 \labelwidthstring 00.00.0000
920 \begin_inset Flex Code
923 \begin_layout Plain Layout
929 this is the script that is used to re-configure LyX.
930 It creates configuration files in the directory it was run from.
933 \begin_layout Subsection
934 Other files needing a line or two...
937 \begin_layout Labeling
938 \labelwidthstring 00.00.0000
939 \begin_inset Flex Code
942 \begin_layout Plain Layout
948 this contains tables describing how different character encodings can be
952 \begin_layout Labeling
953 \labelwidthstring 00.00.0000
954 \begin_inset Flex Code
957 \begin_layout Plain Layout
963 this file contains the templates available to the new
964 \begin_inset Flex MenuItem
967 \begin_layout Plain Layout
980 \begin_layout Labeling
981 \labelwidthstring 00.00.0000
982 \begin_inset Flex Code
985 \begin_layout Plain Layout
991 this file contains a list of all the languages currently supported by LyX.
992 \change_inserted -195340706 1334775793
996 \begin_layout Labeling
997 \labelwidthstring 00.00.0000
999 \change_inserted -195340706 1334775793
1000 \begin_inset Flex Code
1003 \begin_layout Plain Layout
1005 \change_inserted -195340706 1334775793
1011 this file contains translations for internationalized paragraph styles
1013 \begin_inset space \thinspace{}
1017 \begin_inset CommandInset ref
1019 reference "sub:I18n"
1028 \begin_layout Section
1029 Your local configuration directory
1032 \begin_layout Standard
1033 Even if you are using LyX as an unprivileged user, you might want to change
1034 LyX configuration for your own use.
1036 \begin_inset Flex Code
1039 \begin_layout Plain Layout
1045 directory contains all your personal configuration files.
1046 This is the directory described as
1047 \begin_inset Quotes eld
1051 \begin_inset Quotes erd
1055 \begin_inset Flex MenuItem
1058 \begin_layout Plain Layout
1059 Help\SpecialChar \menuseparator
1061 \begin_inset space ~
1070 This directory is used as a mirror of
1071 \begin_inset Flex Code
1074 \begin_layout Plain Layout
1080 , which means that every file in
1081 \begin_inset Flex Code
1084 \begin_layout Plain Layout
1090 is a replacement for the corresponding file in
1091 \begin_inset Flex Code
1094 \begin_layout Plain Layout
1101 Any configuration file described in the above sections can be placed either
1102 in the system-wide directory, in which case it will affect all users, or
1103 in your local directory for your own use.
1106 \begin_layout Standard
1107 To make things clearer, let's provide a few examples:
1110 \begin_layout Itemize
1111 The preferences set in the
1112 \begin_inset Flex MenuItem
1115 \begin_layout Plain Layout
1116 Tools\SpecialChar \menuseparator
1122 dialog are saved to a file
1123 \begin_inset Flex Code
1126 \begin_layout Plain Layout
1133 \begin_inset Flex Code
1136 \begin_layout Plain Layout
1145 \begin_layout Itemize
1146 When you reconfigure using
1147 \begin_inset Flex MenuItem
1150 \begin_layout Plain Layout
1151 Tools\SpecialChar \menuseparator
1158 \begin_inset Flex Code
1161 \begin_layout Plain Layout
1167 script, and the resulting files are written in your local configuration
1169 This means that any additional text class file that you might have added
1171 \begin_inset Flex Code
1174 \begin_layout Plain Layout
1180 will be added to the list of classes in the
1181 \begin_inset Flex MenuItem
1184 \begin_layout Plain Layout
1185 Document\SpecialChar \menuseparator
1194 \begin_layout Itemize
1195 If you get some updated documentation from LyX ftp site and cannot install
1196 it because you do not have sysadmin rights on your system, you can just
1198 \begin_inset Flex Code
1201 \begin_layout Plain Layout
1207 and the items in the
1208 \begin_inset Flex MenuItem
1211 \begin_layout Plain Layout
1217 menu will open them!
1220 \begin_layout Section
1221 Running LyX with multiple configurations
1224 \begin_layout Standard
1225 The configuration freedom of the local configuration directory may not suffice
1226 if you want to have more than one configuration at your disposal.
1227 For example, you may want to be use different key bindings or printer settings
1229 You can achieve this by having several such directories.
1230 You then specify which directory to use at run-time.
1233 \begin_layout Standard
1234 Invoking LyX with the command line switch
1235 \begin_inset Flex Code
1238 \begin_layout Plain Layout
1248 instructs the program to read the configuration from that directory, and
1249 not from the default directory.
1250 (You can determine the default directory by running LyX without the
1251 \begin_inset Flex Code
1254 \begin_layout Plain Layout
1260 switch.) If the specified directory does not exist, LyX offers to create
1261 it for you, just like it does for the default directory on the first time
1262 you run the program.
1263 You can modify the configuration options in this additional user directory
1264 exactly as you would for the default directory.
1265 These directories are completely independent (but read on).
1266 Note that setting the environment variable
1267 \begin_inset Flex Code
1270 \begin_layout Plain Layout
1276 to some value has exactly the same effect.
1279 \begin_layout Standard
1280 Having several configurations also requires more maintenance: if you want
1281 to add a new layout to
1282 \begin_inset Flex Code
1285 \begin_layout Plain Layout
1291 which you want available from all your configurations, you must add it
1292 to each directory separately.
1293 You can avoid this with the following trick: after LyX creates the additional
1294 directory, most of the subdirectories (see above) are empty.
1295 If you want the new configuration to mirror an existing one, replace the
1296 empty subdirectory with a symbolic link to the matching subdirectory in
1297 the existing configuration.
1299 \begin_inset Flex Code
1302 \begin_layout Plain Layout
1308 subdirectory, however, since it contains a file written by the configuration
1309 script (also accessible through
1310 \begin_inset Flex MenuItem
1313 \begin_layout Plain Layout
1314 Tools\SpecialChar \menuseparator
1320 ) which is configuration-specific.
1323 \begin_layout Chapter
1324 The Preferences dialog
1327 \begin_layout Standard
1328 All options of the preferences dialog are described in the Appendix
1330 The Preferences Dialog
1337 For some options you might find here more details.
1340 \begin_layout Section
1342 \begin_inset CommandInset label
1351 \begin_layout Standard
1352 The first step is to define your file formats if they are not already defined.
1354 \begin_inset Flex MenuItem
1357 \begin_layout Plain Layout
1358 Tools\SpecialChar \menuseparator
1366 \begin_inset Flex MenuItem
1369 \begin_layout Plain Layout
1370 File Handling\SpecialChar \menuseparator
1377 \begin_inset Flex MenuItem
1380 \begin_layout Plain Layout
1381 New\SpecialChar \ldots{}
1387 button to define your new format.
1389 \begin_inset Flex MenuItem
1392 \begin_layout Plain Layout
1398 field contains the name used to identify the format in the GUI.
1400 \begin_inset Flex MenuItem
1403 \begin_layout Plain Layout
1409 is used to identify the format internally.
1410 You will also need to enter a file extension.
1411 These are all required.
1413 \begin_inset Flex MenuItem
1416 \begin_layout Plain Layout
1422 field is used to provide a keyboard shortcut on the menus.
1423 (For example, pressing
1424 \begin_inset Flex MenuItem
1427 \begin_layout Plain Layout
1434 \begin_inset Flex MenuItem
1437 \begin_layout Plain Layout
1438 View\SpecialChar \menuseparator
1439 View (Other Formats)\SpecialChar \menuseparator
1448 \begin_layout Standard
1450 \begin_inset Flex MenuItem
1453 \begin_layout Plain Layout
1460 \begin_inset Flex MenuItem
1463 \begin_layout Plain Layout
1470 For example, you might want to use
1471 \begin_inset Flex MenuItem
1474 \begin_layout Plain Layout
1480 to view PostScript files.
1481 You can enter the command needed to start the program in the corresponding
1483 In defining this command, you can use the four variables listed in the
1485 The viewer is launched when you view an image in LyX or use the
1486 \begin_inset Flex MenuItem
1489 \begin_layout Plain Layout
1496 The editor is for example launched when you right-click on an image and
1498 \begin_inset Flex MenuItem
1501 \begin_layout Plain Layout
1507 in the appearing context menu.
1510 \begin_layout Standard
1512 \change_inserted -195340706 1329851811
1514 \begin_inset Flex MenuItem
1517 \begin_layout Plain Layout
1523 type of a format is optional, but if it is specified, it must be unique
1525 It is used to detect files of this format from the file contents.
1526 For some important file formats there is no MIME type officially registered
1528 \begin_inset CommandInset href
1531 target "http://www.iana.org/assignments/media-types/"
1536 Therefore LyX uses the extended list of MIME types as specified by
1537 \begin_inset CommandInset href
1539 name "freedesktop.org"
1540 target "http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec"
1547 \begin_layout Standard
1549 \begin_inset Flex MenuItem
1552 \begin_layout Plain Layout
1558 option tells LyX that a format is suitable for document export.
1559 If this is set and if a suitable conversion route exists (see sec.
1560 \begin_inset space \thinspace{}
1564 \begin_inset CommandInset ref
1566 reference "sec:Converters"
1570 ), the format will appear in the
1571 \begin_inset Flex MenuItem
1574 \begin_layout Plain Layout
1575 File\SpecialChar \menuseparator
1582 The format will also appear in the
1583 \begin_inset Flex MenuItem
1586 \begin_layout Plain Layout
1592 menu if a viewer is specified for the format.
1593 Pure image formats, such as
1594 \begin_inset Flex Code
1597 \begin_layout Plain Layout
1603 , should not use this option.
1604 Formats that can both represent vector graphics and documents like
1605 \begin_inset Flex Code
1608 \begin_layout Plain Layout
1617 \begin_layout Standard
1619 \begin_inset Flex MenuItem
1622 \begin_layout Plain Layout
1623 Vector graphics format
1628 tells LyX that a format can contain vector graphics.
1629 This information is used to determine the target format of included graphics
1631 \begin_inset Flex MenuItem
1634 \begin_layout Plain Layout
1641 Included graphics may need to be converted to either
1642 \begin_inset Flex MenuItem
1645 \begin_layout Plain Layout
1652 \begin_inset Flex MenuItem
1655 \begin_layout Plain Layout
1662 \begin_inset Flex MenuItem
1665 \begin_layout Plain Layout
1672 \begin_inset Flex MenuItem
1675 \begin_layout Plain Layout
1681 cannot handle other image formats.
1682 If an included graphic is not already in
1683 \begin_inset Flex MenuItem
1686 \begin_layout Plain Layout
1693 \begin_inset Flex MenuItem
1696 \begin_layout Plain Layout
1703 \begin_inset Flex MenuItem
1706 \begin_layout Plain Layout
1712 format, it is converted to
1713 \begin_inset Flex MenuItem
1716 \begin_layout Plain Layout
1722 if the vector format option is set, and otherwise to
1723 \begin_inset Flex MenuItem
1726 \begin_layout Plain Layout
1735 \begin_layout Section
1739 \begin_layout Standard
1740 Since all conversions from one format to another take place in LyX's temporary
1741 directory, it is sometimes necessary to modify a file before copying it
1742 to the temporary directory in order that the conversion may be performed.
1746 \begin_layout Plain Layout
1747 For example, the file may refer to other files—images, for example—using
1748 relative file names, and these may become invalid when the file is copied
1749 to the temporary directory.
1754 This is done by a Copier: It copies a file to (or from) the temporary directory
1755 and may modify it in the process.
1758 \begin_layout Standard
1759 The definitions of the copiers may use four variables:
1762 \begin_layout Labeling
1763 \labelwidthstring 00.00.0000
1764 \begin_inset Flex Code
1767 \begin_layout Plain Layout
1773 The LyX system directory (e.
1774 \begin_inset space \thinspace{}
1778 \begin_inset space \space{}
1782 \begin_inset Flex MenuItem
1785 \begin_layout Plain Layout
1794 \begin_layout Labeling
1795 \labelwidthstring 00.00.0000
1796 \begin_inset Flex Code
1799 \begin_layout Plain Layout
1808 \begin_layout Labeling
1809 \labelwidthstring 00.00.0000
1810 \begin_inset Flex Code
1813 \begin_layout Plain Layout
1820 \change_inserted 1082167584 1348453985
1824 \begin_layout Labeling
1825 \labelwidthstring 00.00.0000
1827 \change_inserted 1082167584 1348453986
1828 $$b The base name (without filename extension) in the LyX temporary directory
1831 \begin_layout Labeling
1832 \labelwidthstring 00.00.0000
1834 \change_inserted 1082167584 1348453986
1835 $$p The full directory path of the LyX temporary directory
1838 \begin_layout Labeling
1839 \labelwidthstring 00.00.0000
1841 \change_inserted 1082167584 1348453986
1842 $$r The full pathname to the original LyX file being processed
1845 \begin_layout Labeling
1846 \labelwidthstring 00.00.0000
1848 \change_inserted 1082167584 1348453986
1849 $$f The filename (without any directory path) of the LyX file.
1852 \begin_layout Labeling
1853 \labelwidthstring 00.00.0000
1854 \begin_inset Flex Code
1857 \begin_layout Plain Layout
1864 \change_inserted 1082167584 1348453720
1868 \begin_layout Standard
1869 The latter should be the filename as it would be used in a LaTeX's
1876 It is relevant only when exporting files suitable for such inclusion.
1879 \begin_layout Standard
1880 Copiers can be used to do almost anything with output files.
1881 For example, suppose you want generated pdf files to be copied to a special
1883 \begin_inset Flex Code
1886 \begin_layout Plain Layout
1893 Then you could write a shell script such as this one:
1896 \begin_layout Standard
1897 \begin_inset listings
1901 \begin_layout Plain Layout
1906 \begin_layout Plain Layout
1911 \begin_layout Plain Layout
1913 TOFILE=`basename $2`
1916 \begin_layout Plain Layout
1918 cp $FROMFILE /home/you/pdf/$TOFILE
1923 Save it in your local LyX directory—say,
1924 \begin_inset Flex Code
1927 \begin_layout Plain Layout
1928 /home/you/.lyx/scripts/pdfcopier.sh
1933 —and make it executable, if you need to do so on your platform.
1935 \begin_inset Flex MenuItem
1938 \begin_layout Plain Layout
1939 Tools\SpecialChar \menuseparator
1945 dialog, select under
1946 \begin_inset Flex MenuItem
1949 \begin_layout Plain Layout
1950 File Handling\SpecialChar \menuseparator
1957 \begin_inset Flex MenuItem
1960 \begin_layout Plain Layout
1966 format—or one of the other pdf formats—and enter
1967 \begin_inset Flex Code
1970 \begin_layout Plain Layout
1971 pdfcopier.sh $$i $$o
1977 \begin_inset Flex MenuItem
1980 \begin_layout Plain Layout
1990 \begin_layout Standard
1991 Copiers are used by LyX in various of its own conversions.
1992 For example, if appropriate programs are found, LyX will automatically
1993 install copiers for the
1994 \begin_inset Flex MenuItem
1997 \begin_layout Plain Layout
2004 \begin_inset Flex MenuItem
2007 \begin_layout Plain Layout
2009 \begin_inset space ~
2018 When these formats are exported, the copier sees that not just the main
2019 HTML file but various associated files (style files, images, etc.) are also
2021 All these files are written to a subdirectory of the directory in which
2022 the original LyX file was found.
2026 \begin_layout Plain Layout
2027 This copier can be customized.
2029 \begin_inset Quotes eld
2033 \begin_inset Quotes erd
2036 argument takes a comma-separated list of extensions to be copied; if it
2037 is omitted, all files will be copied.
2039 \begin_inset Quotes eld
2043 \begin_inset Quotes erd
2046 argument determines the extension added to the generated directory.
2048 \begin_inset Quotes eld
2052 \begin_inset Flex MenuItem
2055 \begin_layout Plain Layout
2062 \begin_inset Quotes erd
2065 , so HTML generated from
2066 \begin_inset Flex MenuItem
2069 \begin_layout Plain Layout
2070 /path/to/filename.lyx
2076 \begin_inset Flex MenuItem
2079 \begin_layout Plain Layout
2080 /path/to/filename.html.LyXconv
2094 \begin_layout Section
2096 \begin_inset CommandInset label
2098 name "sec:Converters"
2105 \begin_layout Standard
2106 You can define your own Converters to convert files between different formats.
2108 \begin_inset Flex MenuItem
2111 \begin_layout Plain Layout
2112 Tools\SpecialChar \menuseparator
2113 Preferences\SpecialChar \menuseparator
2114 File Handling\SpecialChar \menuseparator
2123 \begin_layout Standard
2124 To define a new converter, select the
2125 \begin_inset Flex MenuItem
2128 \begin_layout Plain Layout
2130 \begin_inset space ~
2139 \begin_inset Flex MenuItem
2142 \begin_layout Plain Layout
2144 \begin_inset space ~
2152 from the drop-down lists, enter the command needed for the conversion,
2154 \begin_inset Flex MenuItem
2157 \begin_layout Plain Layout
2164 Several variables can be used in the definition of converters:
2167 \begin_layout Labeling
2168 \labelwidthstring 00.00.0000
2169 \begin_inset Flex Code
2172 \begin_layout Plain Layout
2178 The LyX system directory
2181 \begin_layout Labeling
2182 \labelwidthstring 00.00.0000
2183 \begin_inset Flex Code
2186 \begin_layout Plain Layout
2195 \begin_layout Labeling
2196 \labelwidthstring 00.00.0000
2197 \begin_inset Flex Code
2200 \begin_layout Plain Layout
2209 \begin_layout Labeling
2210 \labelwidthstring 00.00.0000
2211 \begin_inset Flex Code
2214 \begin_layout Plain Layout
2220 The base filename of the input file (i.
2221 \begin_inset space \thinspace{}
2224 g., without the extension)
2227 \begin_layout Labeling
2228 \labelwidthstring 00.00.0000
2229 \begin_inset Flex Code
2232 \begin_layout Plain Layout
2238 The path to the input file
2241 \begin_layout Labeling
2242 \labelwidthstring 00.00.0000
2243 \begin_inset Flex Code
2246 \begin_layout Plain Layout
2252 The path to the original input file (this is different from $$p when a
2253 chain of converters is called)
2256 \begin_layout Labeling
2257 \labelwidthstring 00.00.0000
2258 \begin_inset Flex Code
2261 \begin_layout Plain Layout
2267 The iconv name for the encoding of the document.
2270 \begin_layout Standard
2272 \begin_inset Flex MenuItem
2275 \begin_layout Plain Layout
2277 \begin_inset space ~
2285 field you can enter the following flags, separated by commas:
2288 \begin_layout Labeling
2289 \labelwidthstring 00.00.0000
2290 \begin_inset Flex Code
2293 \begin_layout Plain Layout
2299 This converter runs some form of LaTeX.
2300 This will make LyX's LaTeX error logs available.
2303 \begin_layout Labeling
2304 \labelwidthstring 00.00.0000
2305 \begin_inset Flex Code
2308 \begin_layout Plain Layout
2315 \begin_inset Flex MenuItem
2318 \begin_layout Plain Layout
2324 file for the conversion.
2325 \change_inserted 1414654397 1337693117
2329 \begin_layout Labeling
2330 \labelwidthstring 00.00.0000
2332 \change_inserted 1414654397 1337693188
2333 \begin_inset Flex Code
2336 \begin_layout Plain Layout
2338 \change_inserted 1414654397 1337693129
2347 \begin_inset Quotes eld
2351 \begin_inset Quotes erd
2354 file from the backend, which in practice means a LaTeX file like the one
2355 we would export, without
2356 \begin_inset Flex Code
2359 \begin_layout Plain Layout
2361 \change_inserted 1414654397 1337693184
2374 \begin_layout Labeling
2375 \labelwidthstring 00.00.0000
2376 \begin_inset Flex Code
2379 \begin_layout Plain Layout
2388 \begin_layout Standard
2389 The following three flags are not really flags at all because they take
2391 \begin_inset Flex MenuItem
2394 \begin_layout Plain Layout
2396 \begin_inset space ~
2400 \begin_inset space ~
2411 \begin_layout Labeling
2412 \labelwidthstring 00.00.0000
2413 \begin_inset Flex Code
2416 \begin_layout Plain Layout
2422 If set, the converter's standard error will be redirected to a file
2423 \begin_inset Flex Code
2426 \begin_layout Plain Layout
2432 , and the script given as argument will be run as:
2433 \begin_inset Flex Code
2436 \begin_layout Plain Layout
2437 script < infile.out > infile.log
2443 The argument may contain
2444 \begin_inset Flex Code
2447 \begin_layout Plain Layout
2456 \begin_layout Labeling
2457 \labelwidthstring 00.00.0000
2458 \begin_inset Flex Code
2461 \begin_layout Plain Layout
2467 The name of the directory in which the converter will dump the generated
2469 LyX will not create this directory, and it does not copy anything into
2470 it, though it will copy this directory to the destination.
2471 The argument may contain
2472 \begin_inset Flex Code
2475 \begin_layout Plain Layout
2481 , which will be replaced by the base name of the input and output files,
2482 respectively, when the directory is copied.
2483 \begin_inset Newline newline
2486 Note that resultdir and usetempdir make no sense together.
2487 The latter will be ignored if the former is given.
2490 \begin_layout Labeling
2491 \labelwidthstring 00.00.0000
2492 \begin_inset Flex Code
2495 \begin_layout Plain Layout
2501 Determines the output file name and may, contain
2502 \begin_inset Flex Code
2505 \begin_layout Plain Layout
2512 Sensible only with resultdir and optional even then; if not given, it defaults
2516 \begin_layout Standard
2517 None of these last three are presently used in any of the converters that
2518 are installed with LyX.
2522 \begin_layout Standard
2523 You do not have to define converters for all formats between which you want
2525 For example, you will note that there is no `LyX to PostScript' converter,
2526 but LyX will export PostScript.
2527 It does so by first creating a LaTeX file (no converter needs to be defined
2528 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2529 and finally converting the resulting DVI file to PostScript.
2530 LyX finds such `chains' of converters automatically, and it will always
2531 choose the shortest possible chain.
2532 You can, though, still define multiple conversion methods between file
2534 For example, the standard LyX configuration provides three ways to convert
2535 LaTeX to PDF: Directly, using
2536 \begin_inset Flex MenuItem
2539 \begin_layout Plain Layout
2545 ; via (DVI and) PostScript, using
2546 \begin_inset Flex MenuItem
2549 \begin_layout Plain Layout
2556 \begin_inset Flex MenuItem
2559 \begin_layout Plain Layout
2566 To define such alternate chains, you must define multiple target `file
2567 formats', as described in section
2568 \begin_inset CommandInset ref
2570 reference "sec:Formats"
2575 For example, in the standard configuration, the formats named
2576 \begin_inset Flex MenuItem
2579 \begin_layout Plain Layout
2586 \begin_inset Flex MenuItem
2589 \begin_layout Plain Layout
2596 \begin_inset Flex MenuItem
2599 \begin_layout Plain Layout
2605 are defined, all of which share the extension
2606 \begin_inset Flex MenuItem
2609 \begin_layout Plain Layout
2615 , and which correspond to the conversion methods just mentioned.
2618 \begin_layout Chapter
2619 Internationalizing LyX
2620 \begin_inset CommandInset label
2622 name "cha:Internationalizing-LyX"
2629 \begin_layout Standard
2630 LyX supports using a translated interface.
2631 Last time we checked, LyX provided text in thirty languages.
2632 The language of choice is called your
2637 (For further reading on locale settings, see also the documentation for
2638 locale that comes with your operating system.
2639 For Linux, the manual page for
2640 \begin_inset Flex Code
2643 \begin_layout Plain Layout
2649 could be a good place to start).
2652 \begin_layout Standard
2653 Notice that these translations will work, but do contain a few flaws.
2654 In particular, all dialogs have been designed with the English text in
2655 mind, which means that some of the translated text will be too large to
2656 fit within the space allocated.
2657 This is only a display problem and will not cause any harm.
2658 Also, you will find that some of the translations do not define shortcut
2659 keys for everything.
2660 Sometimes, there are simply not enough free letters to do it.
2661 Other times, the translator just hasn't got around to doing it yet.
2662 Our localization team, which you may wish to join,
2666 \begin_layout Plain Layout
2667 If you are a fluent speaker of a language other than English, joining these
2668 teams is a great way to give back to the LyX community!
2673 will of course try to fix these shortcomings in future versions of LyX.
2676 \begin_layout Section
2680 \begin_layout Subsection
2681 Translating the graphical user interface (text messages).
2684 \begin_layout Standard
2686 \begin_inset Flex Code
2689 \begin_layout Plain Layout
2695 library to handle the internationalization of the interface.
2696 To have LyX speak your favorite language in all menus and dialogs, you
2698 \begin_inset Flex Code
2701 \begin_layout Plain Layout
2707 -file for that language.
2708 When this is available, you'll have to generate a
2709 \begin_inset Flex Code
2712 \begin_layout Plain Layout
2718 -file from it and install the
2719 \begin_inset Flex Code
2722 \begin_layout Plain Layout
2729 The process of doing all of this is explained in the documentation for
2731 \begin_inset Flex Code
2734 \begin_layout Plain Layout
2741 It is possible to do this just for yourself, but if you're going to do
2742 it, you might as well share the results of your labors with the rest of
2744 Send a message to the LyX developers' list for more information about how
2748 \begin_layout Standard
2749 In short, this is what you should do (xx denotes the language code):
2752 \begin_layout Itemize
2753 Check out the LyX source code.
2755 \begin_inset CommandInset href
2757 name "information on the web"
2758 target "http://www.lyx.org/HowToUseSVN"
2765 \begin_layout Itemize
2767 \begin_inset Flex Code
2770 \begin_layout Plain Layout
2776 to the folder of the
2777 \begin_inset Flex Code
2780 \begin_layout Plain Layout
2788 \begin_inset Flex Code
2791 \begin_layout Plain Layout
2799 \begin_inset Flex Code
2802 \begin_layout Plain Layout
2808 doesn't exist anywhere, it can be remade with the console command
2809 \begin_inset Flex Code
2812 \begin_layout Plain Layout
2818 in that directory, or you can use an existing po-file for some other language
2822 \begin_layout Itemize
2824 \begin_inset Flex Code
2827 \begin_layout Plain Layout
2837 \begin_layout Plain Layout
2838 This is just a text file, so it can be edited in any text editor.
2839 But there are also specialized programs that support such editing, such
2844 (for all platforms) or
2853 contains a `mode' for editing
2854 \begin_inset Flex Code
2857 \begin_layout Plain Layout
2868 For some menu- and widget-labels, there are also shortcut keys that should
2870 Those keys are marked after a `|', and should be translated according to
2871 the words and phrases of the language.
2872 You should also fill also out the information at the beginning of the new
2874 \begin_inset Flex Code
2877 \begin_layout Plain Layout
2883 -file with your email-address, etc., so people know where to reach you with
2884 suggestions and entertaining flames.
2887 \begin_layout Standard
2888 If you are just doing this on your own, then:
2891 \begin_layout Itemize
2893 \begin_inset Flex Code
2896 \begin_layout Plain Layout
2903 This can be done with
2904 \begin_inset Flex Code
2907 \begin_layout Plain Layout
2908 msgfmt -o xx.mo < xx.po
2916 \begin_layout Itemize
2918 \begin_inset Flex Code
2921 \begin_layout Plain Layout
2927 -file to your locale-tree, at the correct directory for application messages
2932 xx, and under the name
2933 \begin_inset Flex Code
2936 \begin_layout Plain Layout
2943 \begin_inset space \thinspace{}
2947 \begin_inset space \space{}
2951 \begin_inset Flex Code
2954 \begin_layout Plain Layout
2955 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2965 \begin_layout Standard
2966 As said, however, it would be best if the new
2967 \begin_inset Flex Code
2970 \begin_layout Plain Layout
2976 -file could be added to the LyX distribution, so others can use it.
2977 Adding it involves making additional changes to LyX.
2978 So send an email to the developers' mailing list if you're interested in
2982 \begin_layout Subsubsection
2986 \begin_layout Standard
2987 Sometimes it turns out that one English message needs to be translated into
2988 different messages in the target language.
2989 One example is the message
2990 \begin_inset Flex Code
2993 \begin_layout Plain Layout
2999 which has the German translation
3007 , depending upon exactly what the English
3008 \begin_inset Quotes eld
3012 \begin_inset Quotes erd
3017 \begin_inset Flex Code
3020 \begin_layout Plain Layout
3026 does not handle such ambiguous translations.
3027 Therefore you have to add some context information to the message: Instead
3029 \begin_inset Flex Code
3032 \begin_layout Plain Layout
3039 \begin_inset Flex Code
3042 \begin_layout Plain Layout
3043 To[[as in 'From format x to format y']]
3049 \begin_inset Flex Code
3052 \begin_layout Plain Layout
3053 To[[as in 'From page x to page y']].
3058 Now the two occurrences of
3059 \begin_inset Flex Code
3062 \begin_layout Plain Layout
3069 \begin_inset Flex Code
3072 \begin_layout Plain Layout
3078 and can be translated correctly to
3089 \begin_layout Standard
3090 Of course the context information needs to be stripped off the original
3091 message when no translation is used.
3092 Therefore you have to put it in double square brackets at the end of the
3093 message (see the example above).
3094 The translation mechanism of LyX ensures that everything in double square
3095 brackets at the end of messages is removed before displaying the message.
3098 \begin_layout Subsection
3099 Translating the documentation.
3102 \begin_layout Standard
3103 The online documentation (in the
3104 \begin_inset Flex MenuItem
3107 \begin_layout Plain Layout
3113 -menu) can (and should!) be translated.
3114 If there are translated versions of the documentation available
3118 \begin_layout Plain Layout
3119 As of March 2008, at least some of the documents have been translated into
3120 fourteen languages, with the Tutorial available in a few more.
3125 and the locale is set accordingly, these will be used automagically by
3127 LyX looks for translated versions as
3128 \begin_inset Flex Code
3131 \begin_layout Plain Layout
3132 LyXDir/doc/xx/DocName.lyx
3138 \begin_inset Flex Code
3141 \begin_layout Plain Layout
3147 is the code for the language currently in use.
3148 If there are no translated documents, the default English versions will
3150 Note that the translated versions must have the same filenames (
3151 \begin_inset Flex Code
3154 \begin_layout Plain Layout
3160 above) as the original.
3161 If you feel up to translating the documentation (an excellent way to proof-read
3162 the original documentation by the way!), there are a few things you should
3166 \begin_layout Itemize
3167 Check out the documentation translation web page at
3168 \begin_inset CommandInset href
3170 name "http://www.lyx.org/Translation"
3171 target "http://www.lyx.org/Translation"
3176 That way, you can find out which (if any) documents have already been translate
3177 d into your language.
3178 You can also find out who (if anyone) is organizing the effort to translate
3179 the documentation into your language.
3180 If no one is organizing the effort, please let us know that you're interested.
3183 \begin_layout Standard
3184 Once you get to actually translating, here's a few hints for you that may
3188 \begin_layout Itemize
3189 Join the documentation team! There is information on how to do that in
3190 \begin_inset Flex Code
3193 \begin_layout Plain Layout
3200 \begin_inset Flex MenuItem
3203 \begin_layout Plain Layout
3204 Help\SpecialChar \menuseparator
3210 ), which by the way is the first document you should translate.
3213 \begin_layout Itemize
3214 Learn the typographic conventions for the language you are translating to.
3215 Typography is an ancient art and over the centuries, a great variety of
3216 conventions have developed throughout different parts of the world.
3217 Also study the professional terminology amongst typographers in your country.
3218 Inventing your own terminology will only confuse the users.
3221 (Warning! Typography is addictive!)
3224 \begin_layout Itemize
3225 Make a copy of the document.
3226 This will be your working copy.
3227 You can use this as your personal translated help-file by placing it in
3229 \begin_inset Flex Code
3232 \begin_layout Plain Layout
3241 \begin_layout Itemize
3242 Sometimes the original document (from the LyX-team) will be updated.
3243 Use the source viewer at
3244 \begin_inset CommandInset href
3246 name "http://www.lyx.org/trac/timeline"
3247 target "http://www.lyx.org/trac/timeline"
3251 to see what has been changed.
3252 That way you can easily see which parts of the translated document need
3256 \begin_layout Standard
3257 If you ever find an error in the original document, fix it and notify the
3258 rest of the documentation team of the changes! (You didn't forget to join
3259 the documentation team, did you?)
3262 \begin_layout Standard
3263 \begin_inset Branch OutDated
3266 \begin_layout Section
3267 International Keyboard Support
3270 \begin_layout Standard
3273 [Editor's Note: The following section is by
3281 It needs to be fixed to conform to the new Documentation Style sheet and
3282 to make use of the new v1.0 features.
3283 The whole thing also needs to be merged with the section following it.-jw
3284 It may also be badly out of date.-rh (2008)]
3287 \begin_layout Subsection
3288 Defining Own Keymaps: Keymap File Format
3291 \begin_layout Standard
3292 Let's look at a keyboard definition file a little closer.
3293 It is a plain text file defining
3296 \begin_layout Itemize
3297 key-to-key or key-to-string translations
3300 \begin_layout Itemize
3304 \begin_layout Itemize
3305 dead keys exceptions
3308 \begin_layout Standard
3309 To define key-to-key or key-to-string translation, use this command:
3312 \begin_layout Quotation
3313 \begin_inset Flex Code
3316 \begin_layout Plain Layout
3325 \begin_inset Flex Code
3328 \begin_layout Plain Layout
3337 \begin_layout Standard
3339 \begin_inset Flex Code
3342 \begin_layout Plain Layout
3348 is the key to be translated and
3349 \begin_inset Flex Code
3352 \begin_layout Plain Layout
3358 is the string to be inserted into the document.
3359 To define dead keys, use:
3362 \begin_layout Quotation
3363 \begin_inset Flex Code
3366 \begin_layout Plain Layout
3375 \begin_inset Flex Code
3378 \begin_layout Plain Layout
3387 \begin_layout Standard
3389 \begin_inset Flex Code
3392 \begin_layout Plain Layout
3398 is a keyboard key and
3399 \begin_inset Flex Code
3402 \begin_layout Plain Layout
3409 The following dead keys are supported (shortcut name is in parentheses):
3412 \begin_layout Quotation
3416 \begin_inset space \hfill{}
3422 \begin_layout Quotation
3424 \begin_inset space \hfill{}
3430 \begin_layout Quotation
3432 \begin_inset space \hfill{}
3438 \begin_layout Quotation
3440 \begin_inset space \hfill{}
3446 \begin_layout Quotation
3448 \begin_inset space \hfill{}
3454 \begin_layout Quotation
3456 \begin_inset space \hfill{}
3463 \begin_layout Plain Layout
3475 \begin_layout Quotation
3477 \begin_inset space \hfill{}
3483 \begin_layout Quotation
3485 \begin_inset space \hfill{}
3492 \begin_layout Plain Layout
3504 \begin_layout Quotation
3506 \begin_inset space \hfill{}
3512 \begin_layout Quotation
3514 \begin_inset space \hfill{}
3520 \begin_layout Quotation
3522 \begin_inset space \hfill{}
3529 \begin_layout Plain Layout
3541 \begin_layout Quotation
3543 \begin_inset space \hfill{}
3550 \begin_layout Plain Layout
3562 \begin_layout Quotation
3564 \begin_inset space \hfill{}
3570 \begin_layout Quotation
3571 hungarian umlaut (hug)
3572 \begin_inset space \hfill{}
3578 \begin_layout Quotation
3580 \begin_inset space \hfill{}
3586 \begin_layout Quotation
3588 \begin_inset space \hfill{}
3595 \begin_layout Plain Layout
3607 \begin_layout Standard
3608 Since in many international keyboards there are exceptions to what some
3609 dead keys should do, you can define them using
3612 \begin_layout Quotation
3613 \begin_inset Flex Code
3616 \begin_layout Plain Layout
3624 deadkey key outstring
3627 \begin_layout Standard
3628 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3632 \begin_layout Quotation
3633 \begin_inset Flex Code
3636 \begin_layout Plain Layout
3649 \begin_layout Standard
3650 to make it work correctly.
3651 Also, you have to define as exceptions dead keys over i and j, to remove
3652 the dot from them before inserting an accent mark.
3653 I will change this when the time comes, but so far I haven't had time.
3656 \begin_layout Standard
3657 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3660 \begin_inset Flex Code
3663 \begin_layout Plain Layout
3669 have different meaning.
3671 \begin_inset Flex Code
3674 \begin_layout Plain Layout
3680 marks comments, quotes start and end LaTeX-style commands.
3681 To enter quote, you'll need to use
3682 \begin_inset Flex Code
3685 \begin_layout Plain Layout
3694 \begin_inset Flex Code
3697 \begin_layout Plain Layout
3704 \begin_inset Flex Code
3707 \begin_layout Plain Layout
3718 \begin_layout Standard
3719 If you make a keyboard description file that works for your language, please
3720 mail it to me, so I can include it in the next keymap distribution.
3723 \begin_layout Standard
3724 More keywords will be supported in keymap configuration file in future,
3728 \begin_layout Itemize
3729 \begin_inset Flex Code
3732 \begin_layout Plain Layout
3743 \begin_inset space \hfill{}
3747 \begin_inset Flex Code
3750 \begin_layout Plain Layout
3759 \begin_layout Itemize
3760 \begin_inset Flex Code
3763 \begin_layout Plain Layout
3774 \begin_inset space \hfill{}
3778 \begin_inset Flex Code
3781 \begin_layout Plain Layout
3787 an external keymap translation program
3790 \begin_layout Standard
3791 Also, it should look into
3792 \begin_inset Flex Code
3795 \begin_layout Plain Layout
3801 file for defaults, too (for example, a
3802 \begin_inset Flex Code
3805 \begin_layout Plain Layout
3813 option to include default keyboard).
3821 \begin_layout Section
3822 International Keymap Stuff
3823 \begin_inset CommandInset label
3825 name "sec:International-Keymap-Stuff"
3832 \begin_layout Standard
3833 \begin_inset Note Note
3836 \begin_layout Plain Layout
3837 In doing the revisions on this document in March 2008, I did not look over
3838 this stuff, as I do not understand it.
3839 It would be good if someone else could do so.
3848 \begin_layout Standard
3849 The next two sections describe the
3850 \begin_inset Flex Code
3853 \begin_layout Plain Layout
3862 \begin_inset Flex Code
3865 \begin_layout Plain Layout
3873 file syntax in detail.
3874 These sections should help you design your own key map if the ones provided
3875 do not meet your needs.
3878 \begin_layout Subsection
3882 \begin_layout Standard
3886 \begin_inset Flex Code
3889 \begin_layout Plain Layout
3895 file maps keystrokes to characters or strings.
3896 As the name suggests, it sets a keyboard mapping.
3898 \begin_inset Flex Code
3901 \begin_layout Plain Layout
3912 \begin_inset Flex Code
3915 \begin_layout Plain Layout
3930 \begin_inset Flex Code
3933 \begin_layout Plain Layout
3946 \begin_inset Flex Code
3949 \begin_layout Plain Layout
3958 \begin_inset Flex Code
3961 \begin_layout Plain Layout
3969 are described in this section.
3972 \begin_layout Labeling
3973 \labelwidthstring 00.00.0000
3974 \begin_inset Flex Code
3977 \begin_layout Plain Layout
3985 Map a character to a string
3988 \begin_layout LyX-Code
4003 \begin_layout Standard
4036 the double-quote (")
4053 must be escaped with a preceding backslash (
4064 \begin_layout Standard
4066 \begin_inset Flex MenuItem
4069 \begin_layout Plain Layout
4077 statement to cause the symbol
4078 \begin_inset Flex MenuItem
4081 \begin_layout Plain Layout
4089 to be output for the keystroke
4090 \begin_inset Flex MenuItem
4093 \begin_layout Plain Layout
4104 \begin_layout LyX-Code
4110 \begin_layout Labeling
4111 \labelwidthstring 00.00.0000
4112 \begin_inset Flex Code
4115 \begin_layout Plain Layout
4123 Specify an accent character
4126 \begin_layout LyX-Code
4135 \begin_layout Standard
4136 This will make the cha
4174 This is the dead key
4178 \begin_layout Plain Layout
4185 refers to a key that does not produce a character by itself, but when followed
4186 with another key, produces the desired accent character.
4187 For example, a German characte
4189 r with an umlaut like
4199 can be produced in this manner.
4208 \begin_layout Standard
4221 and then another key not in
4238 followed by the other, not allowed key, as output.
4242 \begin_inset Flex MenuItem
4245 \begin_layout Plain Layout
4253 cancels a dead key, so if
4264 \begin_inset Flex MenuItem
4267 \begin_layout Plain Layout
4276 , the cursor will not go one position backwards but will instead cancel
4292 might have had on the next keystroke.
4296 \begin_layout Standard
4297 The following example specifies that the character ' is to be an acute accent,
4298 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4301 \begin_layout LyX-Code
4304 kmod ' acute aeiouAEIOU
4307 \begin_layout Labeling
4308 \labelwidthstring 00.00.0000
4309 \begin_inset Flex Code
4312 \begin_layout Plain Layout
4318 Specify an exception to the accent character
4321 \begin_layout LyX-Code
4330 \begin_layout Standard
4331 This defines an exce
4372 have been assigned a keystroke with a previous
4375 \begin_inset Flex Code
4378 \begin_layout Plain Layout
4402 must not belong in the
4449 If such a declaration does not exist in
4457 \begin_inset Flex Code
4460 \begin_layout Plain Layout
4494 \begin_inset Flex Code
4497 \begin_layout Plain Layout
4511 \begin_layout Standard
4512 The following command produces causes äi to be produced when you enter acute-i
4516 \begin_layout LyX-Code
4530 \begin_layout Labeling
4531 \labelwidthstring 00.00.0000
4532 \begin_inset Flex Code
4535 \begin_layout Plain Layout
4541 Combine two accent characters
4544 \begin_layout LyX-Code
4550 accent1 accent2 allowed
4553 \begin_layout Standard
4554 This one is getting pretty esoteric.
4555 It allows you to combine the effect
4611 \begin_inset Flex Code
4614 \begin_layout Plain Layout
4642 \begin_layout Standard
4643 Consider this example from the
4644 \begin_inset Flex Code
4647 \begin_layout Plain Layout
4658 \begin_layout LyX-Code
4661 kmod ; acute aeioyvhAEIOYVH
4665 kcomb acute umlaut iyIY
4668 \begin_layout Standard
4669 This allows you to press
4670 \begin_inset Flex MenuItem
4673 \begin_layout Plain Layout
4681 and get the effect of
4682 \begin_inset Flex Code
4685 \begin_layout Plain Layout
4704 in this case cancels the last dead key, so if you press
4705 \begin_inset Flex MenuItem
4708 \begin_layout Plain Layout
4717 \begin_inset Flex Code
4720 \begin_layout Plain Layout
4733 \begin_layout Subsection
4737 \begin_layout Standard
4739 \begin_inset Flex Code
4742 \begin_layout Plain Layout
4750 mapping is performed, a
4751 \begin_inset Flex Code
4754 \begin_layout Plain Layout
4764 file maps the strings that the symbols generate to characters in the current
4766 The LyX distribution currently includes at least the
4767 \begin_inset Flex Code
4770 \begin_layout Plain Layout
4779 \begin_inset Flex Code
4782 \begin_layout Plain Layout
4793 \begin_layout Standard
4795 \begin_inset Flex Code
4798 \begin_layout Plain Layout
4806 file is a sequence of declarations of the form
4809 \begin_layout LyX-Code
4822 \begin_layout Standard
4823 For example, in order to map
4824 \begin_inset Flex MenuItem
4827 \begin_layout Plain Layout
4837 to the corresponding character in the iso-8859-1 set (233), the following
4841 \begin_layout LyX-Code
4849 \begin_layout Standard
4851 \begin_inset Flex Code
4854 \begin_layout Plain Layout
4863 \begin_inset Flex Code
4866 \begin_layout Plain Layout
4884 the same character can apply to more than one string.
4886 \begin_inset Flex Code
4889 \begin_layout Plain Layout
4900 \begin_layout LyX-Code
4912 \begin_inset Newline newline
4928 \begin_layout Standard
4929 If LyX cannot find a mapping for the string produced by the keystroke or
4930 a deadkey sequence, it will check if it looks like an accented char and
4931 try to draw an accent over the character on screen.
4934 \begin_layout Subsection
4938 \begin_layout Standard
4939 There is a second way to add support for international characters through
4940 so-called dead-keys.
4941 A dead-key works in combination with a letter to produce an accented character.
4942 Here, we'll explain how to create a really simple dead-key to illustrate
4946 \begin_layout Standard
4947 Suppose you happen to need the circumflex character,
4948 \begin_inset Quotes eld
4952 \begin_inset Quotes erd
4957 \begin_inset Flex MenuItem
4960 \begin_layout Plain Layout
4967 \begin_inset space ~
4971 \begin_inset Flex MenuItem
4974 \begin_layout Plain Layout
4980 ] to the LyX command
4981 \begin_inset Flex Code
4984 \begin_layout Plain Layout
4991 \begin_inset Flex Code
4994 \begin_layout Plain Layout
5001 Now, whenever you type the
5002 \begin_inset Flex MenuItem
5005 \begin_layout Plain Layout
5011 -key followed by a letter, that letter will have a circumflex accent on
5013 For example, the sequence
5014 \begin_inset Quotes eld
5018 \begin_inset Flex MenuItem
5021 \begin_layout Plain Layout
5028 \begin_inset Quotes erd
5031 produces the letter:
5032 \begin_inset Quotes eld
5036 \begin_inset Quotes erd
5040 If you tried to type
5041 \begin_inset Quotes eld
5045 \begin_inset Flex MenuItem
5048 \begin_layout Plain Layout
5055 \begin_inset Quotes erd
5058 , however, LyX will complain with a beep, since a
5059 \begin_inset Quotes eld
5063 \begin_inset Flex MenuItem
5066 \begin_layout Plain Layout
5073 \begin_inset Quotes erd
5076 never takes a circumflex accent.
5078 \begin_inset Flex MenuItem
5081 \begin_layout Plain Layout
5087 after a dead-key produces the bare-accent.
5088 Please note this last point! If you bind a key to a dead-key, you'll need
5089 to rebind the character on that key to yet another key.
5091 \begin_inset Flex MenuItem
5094 \begin_layout Plain Layout
5100 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5103 \begin_layout Standard
5104 One common way to bind dead-keys is to use
5105 \begin_inset Flex MenuItem
5108 \begin_layout Plain Layout
5115 \begin_inset Flex MenuItem
5118 \begin_layout Plain Layout
5125 \begin_inset Flex MenuItem
5128 \begin_layout Plain Layout
5134 in combination with an accent, like
5135 \begin_inset Quotes eld
5139 \begin_inset Flex MenuItem
5142 \begin_layout Plain Layout
5149 \begin_inset Quotes erd
5153 \begin_inset Quotes eld
5157 \begin_inset Flex MenuItem
5160 \begin_layout Plain Layout
5167 \begin_inset Quotes erd
5171 \begin_inset Quotes eld
5175 \begin_inset Flex MenuItem
5178 \begin_layout Plain Layout
5185 \begin_inset Quotes erd
5189 Another way involves using
5190 \begin_inset Flex Code
5193 \begin_layout Plain Layout
5200 \begin_inset Flex Code
5203 \begin_layout Plain Layout
5209 to set up the special
5210 \begin_inset Flex Code
5213 \begin_layout Plain Layout
5221 \begin_inset Flex Code
5224 \begin_layout Plain Layout
5230 acts in some ways just like
5231 \begin_inset Flex MenuItem
5234 \begin_layout Plain Layout
5240 and permits you to bind keys to accented characters.
5241 You can also turn keys into dead-keys by binding them to something like
5243 \begin_inset Flex Code
5246 \begin_layout Plain Layout
5252 and then binding this symbolic key to the corresponding LyX command.
5256 \begin_layout Plain Layout
5261 : This is exactly what I do in my
5262 \begin_inset Flex Code
5265 \begin_layout Plain Layout
5272 \begin_inset Flex Code
5275 \begin_layout Plain Layout
5283 \begin_inset Flex MenuItem
5286 \begin_layout Plain Layout
5288 \begin_inset space ~
5297 \begin_inset Flex Code
5300 \begin_layout Plain Layout
5306 and a bunch of these
5307 \begin_inset Quotes eld
5311 \begin_inset Flex Code
5314 \begin_layout Plain Layout
5321 \begin_inset Quotes erd
5324 symbolic keys bound such things as
5325 \begin_inset Flex MenuItem
5328 \begin_layout Plain Layout
5330 \begin_inset space ~
5339 \begin_inset Flex MenuItem
5342 \begin_layout Plain Layout
5344 \begin_inset space ~
5353 This is how I produce my accented characters.
5358 You can make just about anything into the
5359 \begin_inset Flex Code
5362 \begin_layout Plain Layout
5369 \begin_inset Flex MenuItem
5372 \begin_layout Plain Layout
5378 keys, a spare function key, etc.
5379 As for the LyX commands that produce accents, check the entry for
5380 \begin_inset Flex Code
5383 \begin_layout Plain Layout
5394 You'll find the complete list there.
5397 \begin_layout Subsection
5398 Saving your Language Configuration
5401 \begin_layout Standard
5402 You can edit your preferences so that your desired language environment
5403 is automatically configured when LyX starts up, via the
5404 \begin_inset Flex MenuItem
5407 \begin_layout Plain Layout
5408 Edit\SpecialChar \menuseparator
5417 \begin_layout Chapter
5418 Installing New Document Classes, Layouts, and Templates
5419 \begin_inset CommandInset label
5421 name "cha:Installing-New-Document"
5426 \begin_inset Argument 1
5429 \begin_layout Plain Layout
5430 Installing New Document Classes
5438 \begin_layout Standard
5439 In this chapter, we describe the procedures for creating and installing
5440 new LyX layout and template files, as well as offer a refresher on correctly
5441 installing new LaTeX document classes.
5445 \begin_layout Standard
5446 First, let us a say a few words about how one ought to think about the relation
5447 between LyX and LaTeX.
5448 The thing to understand is that, in a certain sense, LyX doesn't know anything
5450 Indeed, from LyX's point of view, LaTeX is just one of several
5451 \begin_inset Quotes eld
5455 \begin_inset Quotes erd
5458 in which it is capable of producing output.
5459 Other such formats are DocBook, plaintext, and XHTML.
5460 LaTeX is, of course, a particularly important format, but very little of
5461 the information LyX has about LaTeX is actually contained in the program
5466 \begin_layout Plain Layout
5467 Some commands are sufficiently complex that they are
5468 \begin_inset Quotes eld
5472 \begin_inset Quotes erd
5476 But the developers generally regard this as a Bad Thing.
5481 Rather, that information, even for the standard classes like
5482 \begin_inset Flex Code
5485 \begin_layout Plain Layout
5491 , is contained in `layout files'.
5492 Similarly, LyX itself does not know much about DocBook or XHTML.
5493 What it knows is contained in layout files.
5496 \begin_layout Standard
5497 You can think of the layout file for a given document class as a translation
5498 manual between LyX constructs---paragraphs with their corresponding styles,
5499 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5501 Almost everything LyX knows about
5502 \begin_inset Flex Code
5505 \begin_layout Plain Layout
5511 , for example, is contained in the file
5512 \begin_inset Flex Code
5515 \begin_layout Plain Layout
5521 and in various other files it includes.
5522 For this reason, anyone intending to write layout files should plan to
5523 study the existing files.
5524 A good place to start is with
5525 \begin_inset Flex Code
5528 \begin_layout Plain Layout
5534 , which is included in
5535 \begin_inset Flex Code
5538 \begin_layout Plain Layout
5545 \begin_inset Flex Code
5548 \begin_layout Plain Layout
5554 , and many of the other layout files for document classes.
5555 This file is where sections and the like are defined:
5556 \begin_inset Flex Code
5559 \begin_layout Plain Layout
5565 tells LyX how paragraphs that are marked with the Section, Subsection,
5566 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5569 \begin_inset Flex Code
5572 \begin_layout Plain Layout
5578 file basically just includes several of these
5579 \begin_inset Flex Code
5582 \begin_layout Plain Layout
5591 \begin_layout Standard
5592 Defining the LyX--LaTeX correspondence is not the only thing layout files
5594 Their other job is to define how the LyX constructs themselves will appear
5596 The fact that layout files have these two jobs is often a source of confusion,
5597 because they are completely separate.
5598 Telling LyX how to translate a certain paragraph style into LaTeX does
5599 not tell LyX how to display it; conversely, telling LyX how to display
5600 a certain paragraph style does not tell LyX how to translate it into LaTeX
5601 (let alone tell LaTeX how to display it).
5602 So, in general, when you define a new LyX construct, you must always do
5603 two quite separate things: (i)
5604 \begin_inset space ~
5607 tell LyX how to translate it into LaTeX and (ii)
5608 \begin_inset space ~
5611 tell LyX how to display it.
5614 \begin_layout Standard
5615 Much the same is true, of course, as regards LyX's other backend formats,
5616 though XHTML is in some ways different, because in that case LyX
5620 able, to some extent, to use information about how it should display a
5621 paragraph on the screen to output information (in the form of CSS) about
5622 how the paragraph should be displayed in a browser.
5623 Even in this case, however, the distinction between what LyX does internally
5624 and how things are rendered externally remains in force, and the two can
5625 be controlled separately.
5627 \begin_inset CommandInset ref
5629 reference "sec:Tags-for-XHTML"
5636 \begin_layout Section
5637 Installing new LaTeX files
5640 \begin_layout Standard
5641 Some installations may not include a LaTeX package or class file that you
5642 would like to use within LyX.
5643 For example, you might need FoilTeX, a package for preparing slides for
5644 overhead projectors.
5645 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5646 a user interface for installing such packages.
5647 For example, with MiKTeX, you start the program
5648 \begin_inset Quotes eld
5652 \begin_inset space ~
5656 \begin_inset Quotes erd
5659 to get a list of available packages.
5660 To install one of them, right click on it or use the corresponding toolbar
5664 \begin_layout Standard
5665 If your LaTeX distribution does not provide such a `package manager', or
5666 if the package is not available from your distribution, then follow these
5667 steps to install it manually:
5670 \begin_layout Enumerate
5671 Get the package from
5672 \begin_inset CommandInset href
5675 target "http://www.ctan.org/"
5682 \begin_layout Enumerate
5683 If the package contains a file with the ending
5684 \begin_inset Quotes eld
5688 \begin_inset Flex Code
5691 \begin_layout Plain Layout
5698 \begin_inset Quotes erd
5701 (is the case for FoilTeX) then open a console, change to the folder of
5702 this file and execute the command
5703 \begin_inset Flex Code
5706 \begin_layout Plain Layout
5713 You have now unpacked the package and have all files to install it.
5714 Most LaTeX-packages are not packed and you can skip this step.
5717 \begin_layout Enumerate
5718 Now you need to decide if the package should be available for all users
5723 \begin_layout Enumerate
5724 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5725 for all users on your system, then install it in your `local' TeX tree,
5726 otherwise install it in your own `user' TeX tree.
5727 Where these trees should be created, if they do not already exist, depends
5729 To find this out, look in the file
5730 \begin_inset Flex Code
5733 \begin_layout Plain Layout
5743 \begin_layout Plain Layout
5744 This is usually in the directory
5745 \begin_inset Flex Code
5748 \begin_layout Plain Layout
5754 , though you can execute the command
5755 \begin_inset Flex Code
5758 \begin_layout Plain Layout
5769 The location of the `local' TeX tree is defined by the
5770 \begin_inset Flex Code
5773 \begin_layout Plain Layout
5779 variable; this is usually somewhere like
5780 \begin_inset Flex Code
5783 \begin_layout Plain Layout
5784 /usr/local/share/texmf
5790 The location of the `user' TeX tree is defined by
5791 \begin_inset Flex Code
5794 \begin_layout Plain Layout
5801 \begin_inset Flex Code
5804 \begin_layout Plain Layout
5811 (If these variables are not predefined, you have to define them.) You'll
5812 probably need root permissions to create or modify the `local' tree, but
5813 not for your `user' tree.
5814 \begin_inset Newline newline
5817 In general, it is recommended to install in the user tree because your user
5818 will not be modified or even overwritten when you upgrade your system.
5819 It will typically also be backed up together with everything else when
5820 you backup your home directory (which, of course, you do on a regular basis).
5823 \begin_layout Enumerate
5824 On Windows, if you want the new package to be available for all users on
5825 your system, change to the folder where LaTeX is installed and then change
5827 \begin_inset Flex Code
5830 \begin_layout Plain Layout
5841 (For MiKTeX, this would be by default the folder
5842 \begin_inset Flex Code
5845 \begin_layout Plain Layout
5863 \begin_layout Plain Layout
5864 Note that this will be the correct path only on English installations.
5865 On a German one, it would be
5866 \begin_inset Flex Code
5869 \begin_layout Plain Layout
5883 , and similarly for other languages.
5888 Create there a new folder
5889 \begin_inset Flex Code
5892 \begin_layout Plain Layout
5898 and copy all files of the package into it.
5900 \begin_inset Newline newline
5903 If the package should only available for you or you don't have admin permissions
5904 , do the same, but in the local LaTeX folder.
5906 \begin_inset space \thinspace{}
5910 \begin_inset space ~
5913 2.8 under Windows XP, this would be the folder:
5914 \begin_inset Newline newline
5920 \begin_inset Flex Code
5923 \begin_layout Plain Layout
5926 Documents and Settings
5938 \begin_inset Newline newline
5944 \begin_inset Phantom HPhantom
5947 \begin_layout Plain Layout
5958 \begin_inset Flex Code
5961 \begin_layout Plain Layout
5974 \begin_inset Newline newline
5977 On Vista, it would be:
5978 \begin_inset Newline newline
5982 \begin_inset Flex Code
5985 \begin_layout Plain Layout
6011 \begin_layout Enumerate
6012 Now one only need to tell LaTeX that there are new files.
6013 This depends on the used LaTeX-Distribution:
6017 \begin_layout Enumerate
6018 For TeXLive execute the command
6019 \begin_inset Flex Code
6022 \begin_layout Plain Layout
6029 If you installed the package for all users, then you will probably need
6030 to have root permissions for that.
6033 \begin_layout Enumerate
6034 For MiKTeX, if you have installed the package for all users, start the program
6036 \begin_inset Quotes eld
6040 \begin_inset space ~
6044 \begin_inset Quotes erd
6047 and press the button marked
6048 \begin_inset Quotes eld
6052 \begin_inset Quotes erd
6056 Otherwise start the program
6057 \begin_inset Quotes eld
6061 \begin_inset Quotes erd
6068 \begin_layout Enumerate
6069 Finally, you need to tell LyX that there are new packages available.
6070 So, in LyX, use the menu
6071 \begin_inset Flex MenuItem
6074 \begin_layout Plain Layout
6077 \SpecialChar \menuseparator
6083 and then restart LyX.
6086 \begin_layout Standard
6087 Now the package is installed.
6088 In our example, the document class
6089 \begin_inset Flex Code
6092 \begin_layout Plain Layout
6094 \begin_inset space ~
6101 \begin_layout Plain Layout
6113 will now be available under
6114 \begin_inset Flex MenuItem
6117 \begin_layout Plain Layout
6118 Document\SpecialChar \menuseparator
6119 Settings\SpecialChar \menuseparator
6129 \begin_layout Standard
6130 If you would like to use a LaTeX document class that is not even listed
6132 \begin_inset Flex MenuItem
6135 \begin_layout Plain Layout
6136 Document\SpecialChar \menuseparator
6137 Settings\SpecialChar \menuseparator
6143 , then you need to create a `layout' file for it.
6144 That is the topic of the next section.
6147 \begin_layout Section
6148 Types of layout files
6151 \begin_layout Standard
6152 This section describes the various sorts of LyX files that contain layout
6154 These files describe various paragraph and character styles, determining
6155 how LyX should display them and how they should be translated into LaTeX,
6156 DocBook, XHTML, or whatever output format is being used.
6160 \begin_layout Standard
6161 We shall try to provide a thorough description of the process of writing
6163 However, there are so many different types of documents supported even
6164 by just LaTeX that we can't hope to cover every different possibility or
6165 problem you might encounter.
6166 The LyX users' list is frequented by people with lots of experience with
6167 layout design who are willing to share what they've learned, so please
6168 feel free to ask questions there.
6171 \begin_layout Standard
6172 As you prepare to write a new layout, it is extremely helpful to look at
6173 the layouts distributed with LyX.
6174 If you write a LyX layout for a LaTeX document class that might also be
6175 used by others, or write a module that might be useful to others, then
6176 you should consider posting your layout to the
6177 \begin_inset CommandInset href
6179 name "layout section on the LyX wiki"
6180 target "http://wiki.lyx.org/Layouts/Layouts"
6184 or even to the LyX developers' list, so that it might be included in LyX
6189 \begin_layout Plain Layout
6190 Note that LyX is licensed under the General Public License, so any material
6191 that is contributed to LyX must be similarly licensed.
6199 \begin_layout Subsection
6201 \begin_inset CommandInset label
6203 name "sub:Layout-modules"
6210 \begin_layout Standard
6211 We have spoken to this point about `layout files'.
6212 But there are different sorts of files that contain layout information.
6213 Layout files, strictly so called, have the
6214 \begin_inset Flex Code
6217 \begin_layout Plain Layout
6223 extension and provide LyX with information about document classes.
6224 As of LyX 1.6, however, layout information can also be contained in layout
6230 \begin_inset Flex Code
6233 \begin_layout Plain Layout
6240 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6241 some modules—such as the
6242 \begin_inset Flex Code
6245 \begin_layout Plain Layout
6251 module—specifically provide support for one package.
6252 In a sense, layout modules are similar to included
6256 \begin_layout Plain Layout
6257 These can have any extension, but by convention have the
6258 \begin_inset Flex Code
6261 \begin_layout Plain Layout
6273 \begin_inset Flex Code
6276 \begin_layout Plain Layout
6282 —in that modules are not specific to a given document class but may be used
6283 with many different classes.
6284 The difference is that using an included file with
6285 \begin_inset Flex Code
6288 \begin_layout Plain Layout
6294 requires editing that file.
6295 Modules, by contrast, are selected in the
6296 \begin_inset Flex MenuItem
6299 \begin_layout Plain Layout
6300 Document\SpecialChar \menuseparator
6309 \begin_layout Standard
6310 Building modules is the easiest way to get started with layout editing,
6311 since it can be as simple as adding a single new paragraph style or flex
6313 But modules may, in principle, contain anything a layout file can contain.
6316 \begin_layout Standard
6317 After creating a new module and copying it to the
6318 \begin_inset Flex Code
6321 \begin_layout Plain Layout
6327 folder, you will need to reconfigure and then restart LyX for the module
6328 to appear in the menu.
6329 However, changes you make to the module will be seen immediately, if you
6331 \begin_inset Flex MenuItem
6334 \begin_layout Plain Layout
6335 Document\SpecialChar \menuseparator
6341 , highlight something, and then hit
6342 \begin_inset Quotes eld
6346 \begin_inset Quotes erd
6352 It is strongly recommended that you save your work before doing this
6357 it is strongly recommended that you not attempt to edit modules while simultaneo
6358 usly working on actual documents
6361 Though of course the developers strive to keep LyX stable in such situations,
6362 syntax errors and the like in your module file could cause strange behavior.
6365 \begin_layout Subsubsection
6369 \begin_layout Standard
6370 Modules are to LyX as packages are to LaTeX.
6371 Sometimes, however, you find yourself wanting a specific inset or character
6372 style just for one document and writing a module that will also be available
6373 to other documents makes little sense.
6374 What you need is LyX's
6375 \begin_inset Quotes eld
6379 \begin_inset Quotes erd
6385 \begin_layout Standard
6386 You will find it under
6388 Document\SpecialChar \menuseparator
6389 Settings\SpecialChar \menuseparator
6393 The large text box allows you to enter anything that you might enter in
6394 a layout file or module.
6395 You can think of a document's local layout, in fact, as a module that belongs
6397 So, in particular, you must enter a
6398 \begin_inset Flex Code
6401 \begin_layout Plain Layout
6408 Any format is acceptable, but one would normally use the format current
6410 (In LyX 2.0, the current layout format is 35.) You should be aware that local
6411 layout is not supported by versions of LyX prior to 1.6, so you should not
6412 use it if you want to be able to export your document to LyX 1.5 or earlier
6413 (without, that is, losing the local layout information).
6414 If you wish to be able to export to 1.6---local layout is supported in 1.6,
6415 though there is no UI for it---then you should use format 11 and, of course,
6416 use only layout constructs that were available in LyX 1.6.
6419 \begin_layout Standard
6420 When you have entered something in the
6421 \begin_inset Flex Code
6424 \begin_layout Plain Layout
6430 pane, LyX will enable the
6431 \begin_inset Quotes eld
6435 \begin_inset Quotes erd
6438 button at the bottom.
6439 Clicking this button will cause LyX to determine whether what you have
6440 entered is valid layout information for the chosen format.
6441 LyX will report the result but, unfortunately, will not tell you what errors
6442 there might have been.
6443 These will be written to the terminal, however, if LyX is started from
6445 You will not be permitted to save your local layout until you have entered
6449 \begin_layout Standard
6450 The warnings at the end of the previous section apply here, too.
6451 Do not play with local layout while you are actually working, especially
6452 if you have not saved your document.
6453 That said, using local layout with a test document can be a very convenient
6454 way to try out layout ideas, or even to start developing a module.
6457 \begin_layout Subsection
6459 \begin_inset Flex MenuItem
6462 \begin_layout Plain Layout
6471 \begin_layout Standard
6472 There are two situations you are likely to encounter when wanting to support
6473 a new LaTeX document class, involving style (
6474 \begin_inset Flex Code
6477 \begin_layout Plain Layout
6483 ) files and LaTeX2e class (
6484 \begin_inset Flex Code
6487 \begin_layout Plain Layout
6494 Supporting a style file is usually fairly easy.
6495 Supporting a new class file is a bit harder.
6496 We'll discuss the former in this section and the latter in the next.
6497 Similar remarks apply, of course, if you want to support a new DocBook
6501 \begin_layout Standard
6502 The easier case is the one in which your new document class is provided
6503 as a style file that is to be used in conjunction with an already supported
6505 For the sake of the example, we'll assume that the style file is called
6507 \begin_inset Flex MenuItem
6510 \begin_layout Plain Layout
6516 and that it is meant to be used with
6517 \begin_inset Flex MenuItem
6520 \begin_layout Plain Layout
6526 , which is a standard class.
6530 \begin_layout Standard
6531 Start by copying the existing class's layout file into your local directory:
6535 \begin_layout Plain Layout
6536 Of course, which directory is your local directory will vary by platform,
6537 and LyX allows you to specify your local directory on startup, too, using
6539 \begin_inset Flex Code
6542 \begin_layout Plain Layout
6556 \begin_layout LyX-Code
6557 cp report.layout ~/.lyx/layouts/myclass.layout
6560 \begin_layout Standard
6562 \begin_inset Flex Code
6565 \begin_layout Plain Layout
6571 and change the line:
6574 \begin_layout LyX-Code
6577 DeclareLaTeXClass{report}
6580 \begin_layout Standard
6584 \begin_layout LyX-Code
6587 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6590 \begin_layout Standard
6594 \begin_layout LyX-Code
6596 \begin_inset Newline newline
6602 \begin_inset Newline newline
6608 \begin_layout Standard
6609 near the top of the file.
6612 \begin_layout Standard
6613 Start LyX and select
6614 \begin_inset Flex MenuItem
6617 \begin_layout Plain Layout
6618 Tools\SpecialChar \menuseparator
6625 Then restart LyX and try creating a new document.
6627 \begin_inset Flex MenuItem
6630 \begin_layout Plain Layout
6636 " as a document class option in the
6637 \begin_inset Flex MenuItem
6640 \begin_layout Plain Layout
6641 Document\SpecialChar \menuseparator
6648 It is likely that some of the sectioning commands and such in your new
6649 class will work differently from how they worked in the base class—
6650 \begin_inset Flex Code
6653 \begin_layout Plain Layout
6659 in this example—so you can fiddle around with the settings for the different
6660 sections if you wish.
6661 The layout information for sections is contained in
6662 \begin_inset Flex Code
6665 \begin_layout Plain Layout
6671 , but you do not need to copy and change this file.
6672 Instead, you can simply add your changes to your layout file, after the
6674 \begin_inset Flex Code
6677 \begin_layout Plain Layout
6683 , which itself includes
6684 \begin_inset Flex Code
6687 \begin_layout Plain Layout
6694 For example, you might add these lines:
6697 \begin_layout LyX-Code
6701 \begin_layout LyX-Code
6705 \begin_layout LyX-Code
6709 \begin_layout LyX-Code
6713 \begin_layout LyX-Code
6717 \begin_layout Standard
6718 to change the font for chapter headings to sans-serif.
6719 This will override (or, in this case, add to) the existing declaration
6720 for the Chapter style.
6724 \begin_layout Standard
6725 Your new package may also provide commands or environments not present in
6727 In this case, you will want to add these to the layout file.
6729 \begin_inset CommandInset ref
6731 reference "sec:TextClass"
6735 for information on how to do so.
6738 \begin_layout Standard
6740 \begin_inset Flex MenuItem
6743 \begin_layout Plain Layout
6749 can be used with several different document classes, and even if it cannot,
6750 you might find it easiest just to write a module that you can load with
6752 The simplest possible such module would be:
6755 \begin_layout LyX-Code
6758 DeclareLyXModule{My Package}
6761 \begin_layout LyX-Code
6765 \begin_layout LyX-Code
6766 #Support for mypkg.sty.
6769 \begin_layout LyX-Code
6771 \begin_inset Newline newline
6777 \begin_layout LyX-Code
6779 \begin_inset Newline newline
6785 \begin_layout LyX-Code
6787 \begin_inset Newline newline
6793 \begin_inset Newline newline
6799 \begin_layout Standard
6800 A more complex module might modify the behavior of some existing constructs
6801 or define some new ones.
6803 \begin_inset CommandInset ref
6805 reference "sec:TextClass"
6812 \begin_layout Subsection
6814 \begin_inset Flex MenuItem
6817 \begin_layout Plain Layout
6826 \begin_layout Standard
6827 There are two possibilities here.
6828 One is that the class file is itself based upon an existing document class.
6829 For example, many thesis classes are based upon
6830 \begin_inset Flex MenuItem
6833 \begin_layout Plain Layout
6840 To see whether yours is, look for a line like
6843 \begin_layout LyX-Code
6849 \begin_layout Standard
6851 If so, then you may proceed largely as in the previous section, though
6853 \begin_inset Flex Code
6856 \begin_layout Plain Layout
6862 line will be different.
6863 If your new class is
6864 \begin_inset Flex Code
6867 \begin_layout Plain Layout
6873 and it is based upon
6874 \begin_inset Flex Code
6877 \begin_layout Plain Layout
6883 , then the line should read:
6887 \begin_layout Plain Layout
6888 And it will be easiest if you save the file to
6889 \begin_inset Flex Code
6892 \begin_layout Plain Layout
6898 : LyX assumes that the document class has the same name as the layout file.
6907 \begin_layout LyX-Code
6910 DeclareLaTeXClass[thesis,book]{thesis}
6913 \begin_layout Standard
6914 If, on the other hand, the new class is not based upon an existing class,
6915 you will probably have to
6916 \begin_inset Quotes eld
6920 \begin_inset Quotes erd
6924 We strongly suggest copying an existing layout file which uses a similar
6925 LaTeX class and then modifying it, if you can do so.
6926 At least use an existing file as a starting point so you can find out what
6927 items you need to worry about.
6928 Again, the specifics are covered below.
6931 \begin_layout Subsection
6933 \begin_inset CommandInset label
6935 name "sub:Creating-Templates"
6942 \begin_layout Standard
6943 Once you have written a layout file for a new document class, you might
6944 want to consider writing a
6949 A template acts as a kind of tutorial for your layout, showing how it might
6950 be used, though containing dummy content.
6951 You can of course look at the various templates included with LyX for ideas.
6954 \begin_layout Standard
6955 Templates are created just like usual documents: using LyX.
6956 The only difference is that usual documents contain all possible settings,
6957 including the font scheme and the paper size.
6958 Usually a user doesn't want a template to overwrite his preferred settings
6959 for such parameters.
6960 For that reason, the designer of a template should remove the corresponding
6962 \begin_inset Flex Code
6965 \begin_layout Plain Layout
6974 \begin_inset Flex Code
6977 \begin_layout Plain Layout
6985 from the template LyX file.
6986 This can be done with any simple text-editor, for example
6987 \begin_inset Flex Code
6990 \begin_layout Plain Layout
6997 \begin_inset Flex Code
7000 \begin_layout Plain Layout
7010 \begin_layout Standard
7011 Put the edited template files you create in
7012 \begin_inset Flex Code
7015 \begin_layout Plain Layout
7021 , copy the ones you use from the global template directory in
7022 \begin_inset Flex Code
7025 \begin_layout Plain Layout
7031 to the same place, and redefine the template path in the
7032 \begin_inset Flex MenuItem
7035 \begin_layout Plain Layout
7036 Tools\SpecialChar \menuseparator
7037 Preferences\SpecialChar \menuseparator
7046 \begin_layout Standard
7047 Note, by the way, that there is a template which has a particular meaning:
7049 \begin_inset Flex Code
7052 \begin_layout Plain Layout
7059 This template is loaded every time you create a new document with
7060 \begin_inset Flex MenuItem
7063 \begin_layout Plain Layout
7064 File\SpecialChar \menuseparator
7070 in order to provide useful defaults.
7071 To create this template from inside LyX, all you have to do is to open
7072 a document with the correct settings, and use the
7073 \begin_inset Flex MenuItem
7076 \begin_layout Plain Layout
7077 Save as Document Defaults
7085 \begin_layout Subsection
7086 Upgrading old layout files
7089 \begin_layout Standard
7090 The format of layout files changes with each LyX release, so old layout
7091 files need to be converted to the new format.
7092 This process has been automated since LyX 1.4: If LyX reads a layout file
7093 in an older format, it automatically calls the script
7094 \begin_inset Flex Code
7097 \begin_layout Plain Layout
7103 to convert it to a temporary file in current format.
7104 The original file is left untouched.
7105 If you use the layout file often, then, you may want to convert it permanently,
7106 so that LyX does not have to do so itself every time.
7107 To do this, you can call the converter manually:
7110 \begin_layout LyX-Code
7111 mv myclass.layout myclass.old
7114 \begin_layout LyX-Code
7115 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
7118 \begin_layout Standard
7120 \begin_inset Flex Code
7123 \begin_layout Plain Layout
7129 with the name of your LyX system directory, of course.
7132 \begin_layout Standard
7133 Note that manual conversion does not affect included files, so these will
7134 have to be converted separately.
7137 \begin_layout Section
7138 \begin_inset CommandInset label
7140 name "sec:TextClass"
7144 The layout file format
7147 \begin_layout Standard
7148 When it's finally time to get your hands dirty and create or edit your own
7149 layout file, the following sections describe what you're up against.
7150 Our advice is to go slowly, save and test often, listen to soothing music,
7151 and enjoy one or two of your favorite adult beverages; more if you are
7152 getting particularly stuck.
7153 It's really not that hard, except that the multitude of options can become
7154 overwhelming if you try to do too much in one sitting.
7155 Go have another adult beverage, just for good measure.
7158 \begin_layout Standard
7159 Note that all the tags used in layout files are case-insensitive.
7161 \begin_inset Flex Code
7164 \begin_layout Plain Layout
7171 \begin_inset Flex Code
7174 \begin_layout Plain Layout
7181 \begin_inset Flex Code
7184 \begin_layout Plain Layout
7190 are really the same tag.
7191 The possible values are printed in brackets after the feature's name.
7192 The default value if a feature isn't specified inside a text class-description
7194 \begin_inset Flex Code
7197 \begin_layout Plain Layout
7206 If the argument has a data type like
7207 \begin_inset Quotes eld
7211 \begin_inset Quotes erd
7215 \begin_inset Quotes eld
7219 \begin_inset Quotes erd
7222 , the default is shown like this:
7223 \begin_inset Flex Code
7226 \begin_layout Plain Layout
7237 \begin_layout Subsection
7238 The document class declaration
7239 \change_inserted -712698321 1349766602
7245 \begin_layout Standard
7246 Lines in a layout file which begin with
7247 \begin_inset Flex Code
7250 \begin_layout Plain Layout
7257 There is one exception to this rule.
7259 \begin_inset Flex Code
7262 \begin_layout Plain Layout
7268 files should begin with
7269 \change_deleted -712698321 1349766533
7273 \change_inserted -712698321 1349766536
7279 \begin_layout LyX-Code
7282 #% Do not delete the line below; configure depends on this
7285 \begin_layout LyX-Code
7291 \change_deleted -712698321 1349766193
7293 \change_inserted -712698321 1349766201
7294 Article (Standard Class)
7297 \change_inserted -712698321 1349766538
7301 \begin_layout LyX-Code
7303 \change_inserted -712698321 1349766581
7308 DeclareCategory{Articles}
7313 \begin_layout Standard
7315 \change_inserted -712698321 1349766695
7319 \change_inserted -712698321 1349766626
7323 \change_deleted -712698321 1349766628
7325 \change_inserted -712698321 1349766628
7328 used when you (re)configure LyX.
7329 The layout file is read by the LaTeX script
7330 \begin_inset Flex Code
7333 \begin_layout Plain Layout
7339 , in a special mode where
7340 \begin_inset Flex Code
7343 \begin_layout Plain Layout
7350 The first line is just a LaTeX comment,
7351 \change_deleted -712698321 1349766656
7354 the second one contains the
7355 \change_inserted -712698321 1349766650
7358 declaration of the text class
7359 \change_inserted -712698321 1349766689
7360 , and the third line contains the optional classification of the class
7363 If these lines appear in a file named
7364 \begin_inset Flex Code
7367 \begin_layout Plain Layout
7373 , then they define a text class of name
7374 \begin_inset Flex Code
7377 \begin_layout Plain Layout
7383 (the name of the layout file) which uses the LaTeX document class
7384 \begin_inset Flex Code
7387 \begin_layout Plain Layout
7393 (the default is to use the same name as the layout).
7395 \begin_inset Quotes eld
7399 \change_deleted -712698321 1349766253
7401 \change_inserted -712698321 1349766260
7402 Article (Standard Class)
7405 \begin_inset Quotes erd
7408 that appears above is used as a description of the text class in the
7409 \begin_inset Flex MenuItem
7412 \begin_layout Plain Layout
7413 Document\SpecialChar \menuseparator
7421 \change_inserted -712698321 1349767097
7423 \begin_inset Quotes eld
7427 \begin_inset Quotes erd
7430 in the example) is also used in the
7431 \begin_inset Flex MenuItem
7434 \begin_layout Plain Layout
7436 \change_inserted -712698321 1349766801
7437 Document\SpecialChar \menuseparator
7443 dialog: the text classes are grouped by these categories (which are usually
7444 genres, so typical categories are
7445 \begin_inset Quotes eld
7449 \begin_inset Quotes erd
7453 \begin_inset Quotes eld
7457 \begin_inset Quotes erd
7461 \begin_inset Quotes eld
7465 \begin_inset Quotes erd
7469 \begin_inset Quotes eld
7473 \begin_inset Quotes erd
7477 \begin_inset Quotes eld
7481 \begin_inset Quotes erd
7485 \begin_inset Quotes eld
7489 \begin_inset Quotes erd
7493 If no category has been declared, the class will be put in the
7494 \begin_inset Quotes eld
7498 \begin_inset Quotes erd
7506 \begin_layout Standard
7507 Let's assume that you wrote your own text class that uses the
7508 \begin_inset Flex Code
7511 \begin_layout Plain Layout
7517 document class, but where you changed the appearance of the section headings.
7518 If you put it in a file
7519 \begin_inset Flex Code
7522 \begin_layout Plain Layout
7528 , the header of this file should be:
7531 \begin_layout LyX-Code
7534 #% Do not delete the line below; configure depends on this
7537 \begin_layout LyX-Code
7542 DeclareLaTeXClass[article]{
7543 \change_deleted -712698321 1349766303
7545 \change_inserted -712698321 1349766303
7549 \change_deleted -712698321 1349766338
7551 \change_inserted -712698321 1349766338
7555 \change_deleted -712698321 1349766340
7557 \change_inserted -712698321 1349766340
7561 \change_deleted -712698321 1349766343
7563 \change_inserted -712698321 1349766343
7567 \change_inserted -712698321 1349767223
7571 \begin_layout LyX-Code
7573 \change_inserted -712698321 1349767223
7578 DeclareCategory{Articles}
7583 \begin_layout Standard
7584 This declares a text class
7585 \begin_inset Flex Code
7588 \begin_layout Plain Layout
7594 , associated with the LaTeX document class
7595 \begin_inset Flex Code
7598 \begin_layout Plain Layout
7605 \begin_inset Quotes eld
7609 \change_deleted -712698321 1349766329
7611 \change_inserted -712698321 1349766329
7615 \change_deleted -712698321 1349766347
7617 \change_inserted -712698321 1349766347
7621 \change_deleted -712698321 1349766350
7623 \change_inserted -712698321 1349766350
7627 \change_deleted -712698321 1349766352
7629 \change_inserted -712698321 1349766352
7633 \begin_inset Quotes erd
7637 If your text class depends on several packages, you can declare it as:
7640 \begin_layout LyX-Code
7643 #% Do not delete the line below; configure depends on this
7646 \begin_layout LyX-Code
7651 DeclareLaTeXClass[article,foo.sty]{
7652 \change_deleted -712698321 1349766366
7654 \change_inserted -712698321 1349766366
7658 \change_deleted -712698321 1349766369
7660 \change_inserted -712698321 1349766369
7664 \change_deleted -712698321 1349766371
7666 \change_inserted -712698321 1349766371
7670 \change_deleted -712698321 1349766374
7672 \change_inserted -712698321 1349766374
7676 \change_inserted -712698321 1349767240
7680 \begin_layout LyX-Code
7682 \change_inserted -712698321 1349767240
7687 DeclareCategory{Articles}
7692 \begin_layout Standard
7693 This indicates that your text class uses the
7694 \begin_inset Flex Code
7697 \begin_layout Plain Layout
7704 Finally, it is also possible to declare classes for DocBook code.
7705 Typical declarations will look like:
7708 \begin_layout LyX-Code
7711 #% Do not delete the line below; configure depends on this
7714 \begin_layout LyX-Code
7719 DeclareDocBookClass[article]{SGML (DocBook
7720 \change_deleted -712698321 1349766387
7722 \change_inserted -712698321 1349766387
7726 \change_inserted -712698321 1349767247
7730 \begin_layout LyX-Code
7732 \change_inserted -712698321 1349767302
7737 DeclareCategory{Articles (DocBook)}
7742 \begin_layout Standard
7743 Note that these declarations can also be given an optional parameter declaring
7744 the name of the document class (but not a list).
7747 \begin_layout Standard
7748 So, to be as explicit as possible, the form of the layout declaration is:
7751 \begin_layout LyX-Code
7756 DeclareLaTeXClass[class,package.sty]{layout description}
7757 \change_inserted -712698321 1349767329
7761 \begin_layout LyX-Code
7763 \change_inserted -712698321 1349767339
7768 DeclareCategory{category}
7773 \begin_layout Standard
7774 The class need only be specified if the name of the LaTeX class file and
7775 the name of the layout file are different or if there are packages to load.
7776 If the name of the class file is not specified, then LyX will simply assume
7777 that it is the same as the name of the layout file.
7780 \begin_layout Standard
7781 When the text class has been modified to your taste, all you have to do
7782 is to copy it either to
7783 \begin_inset Flex Code
7786 \begin_layout Plain Layout
7793 \begin_inset Flex Code
7796 \begin_layout Plain Layout
7803 \begin_inset Flex MenuItem
7806 \begin_layout Plain Layout
7807 Tools\SpecialChar \menuseparator
7813 , exit LyX and restart.
7814 Then your new text class should be available along with the others.
7817 \begin_layout Standard
7818 Once the layout file is installed, you can edit it and see your changes
7819 without having to reconfigure or to restart LyX.
7824 \begin_layout Plain Layout
7825 In versions of LyX prior to 1.6, this was not true.
7826 As a result, editing layout files was very time consuming, since you had
7827 constantly to restart LyX to see changes.
7832 You can force a reload of the current layout by using the LyX function
7834 \begin_inset Flex MenuItem
7837 \begin_layout Plain Layout
7844 There is no default binding for this function—though, of course, you can
7845 bind it to a key yourself.
7846 But you will normally use this function simply by entering it in the mini-buffe
7851 \begin_layout Standard
7857 \begin_inset Flex MenuItem
7860 \begin_layout Plain Layout
7866 is very much an `advanced feature'.
7871 recommended that you save your work before using this function.
7876 recommended that you not attempt to edit layout information while simultaneousl
7877 y working on a document that you care about.
7878 Use a test document.
7879 Syntax errors and the like in your layout file could cause peculiar behavior.
7880 In particular, such errors could cause LyX to regard the current layout
7881 as invalid and to attempt to switch to some other layout.
7885 \begin_layout Plain Layout
7886 Really bad syntax errors may even caused LyX to exit.
7887 This is because certain sorts of errors may make LyX unable to read
7897 The LyX team strives to keep LyX stable in such situations, but safe is
7902 \begin_layout Plain Layout
7903 While we're giving advice: make regular backups.
7904 And be nice to your mother.
7912 \begin_layout Subsection
7913 The Module declaration
7916 \begin_layout Standard
7917 A module must begin with a line like the following:
7920 \begin_layout LyX-Code
7923 DeclareLyXModule[endnotes.sty]{Endnotes}
7926 \begin_layout Standard
7927 The mandatory argument, in curly brackets, is the name of the module, as
7929 \begin_inset Flex MenuItem
7932 \begin_layout Plain Layout
7933 Document\SpecialChar \menuseparator
7934 Settings\SpecialChar \menuseparator
7941 The argument in square brackets is optional: It declares any LaTeX packages
7942 on which the module depends.
7943 Please note that only packages about which LyX knows should be listed in
7944 the square brackets.
7948 \begin_layout Plain Layout
7949 The list of such packages is documented only in the source code.
7954 LyX will not check for arbitrary packages.
7955 It is also possible to use the form
7956 \begin_inset Flex MenuItem
7959 \begin_layout Plain Layout
7965 as an optional argument, which declares that the module can only be used
7966 when there exists a conversion chain between the formats `
7967 \begin_inset Flex Code
7970 \begin_layout Plain Layout
7977 \begin_inset Flex Code
7980 \begin_layout Plain Layout
7989 \begin_layout Standard
7990 The module declaration should then be followed by lines like the following
7994 \begin_layout Plain Layout
7995 Preferably in English if the module should be published with LyX.
7996 This description will appear in the list of messages to be translated and
7997 will be thus translated with the next interface update.
8005 \begin_layout LyX-Code
8009 \begin_layout LyX-Code
8010 #Adds an endnote command, in addition to footnotes.
8014 \begin_layout LyX-Code
8015 #You will need to add
8017 theendnotes in TeX code where you
8020 \begin_layout LyX-Code
8021 #want the endnotes to appear.
8025 \begin_layout LyX-Code
8029 \begin_layout LyX-Code
8030 #Requires: somemodule | othermodule
8033 \begin_layout LyX-Code
8034 #Excludes: badmodule
8037 \begin_layout Standard
8038 The description is used in
8039 \begin_inset Flex MenuItem
8042 \begin_layout Plain Layout
8043 Document\SpecialChar \menuseparator
8044 Settings\SpecialChar \menuseparator
8050 to provide the user with information about what the module does.
8052 \begin_inset Flex Code
8055 \begin_layout Plain Layout
8061 line is used to identify other modules with which this one must be used;
8063 \begin_inset Flex Code
8066 \begin_layout Plain Layout
8072 line is used to identify modules with which this one may not be used.
8073 Both are optional, and, as shown, multiple modules should be separated
8074 with the pipe symbol: |.
8075 Note that the required modules are treated disjunctively:
8079 of the required modules must be used.
8084 excluded module may be used.
8085 Note that modules are identified here by their
8090 \begin_inset Flex Code
8093 \begin_layout Plain Layout
8101 \begin_inset Flex Code
8104 \begin_layout Plain Layout
8111 \begin_inset Flex Code
8114 \begin_layout Plain Layout
8123 \begin_layout Subsection
8127 \begin_layout Standard
8128 The first non-comment line of any layout file, included file, or module
8133 contain the file format number:
8136 \begin_layout Description
8137 \begin_inset Flex Code
8140 \begin_layout Plain Layout
8147 \begin_inset Flex Code
8150 \begin_layout Plain Layout
8156 ] The format of the layout file.
8159 \begin_layout Standard
8160 This tag was introduced with LyX 1.4.0.
8161 Layout files from LyX 1.3.x and earlier don't have an explicit file format
8162 and are considered to be of format 1.
8163 The format for the present version of LyX is format 21.
8164 But each version of LyX is capable of reading earlier versions' layout
8165 files, just as they are capable of reading files produced by earlier versions
8167 There is, however, no provision for converting to earlier formats.
8168 So LyX 1.6.x will not read layout files in format 21 but only files in format
8172 \begin_layout Subsection
8173 \begin_inset CommandInset label
8175 name "sub:General-text-class"
8179 General text class parameters
8182 \begin_layout Standard
8183 These are general parameters that govern the behavior of an entire document
8189 mean that they must appear in
8190 \begin_inset Flex Code
8193 \begin_layout Plain Layout
8199 files rather than in modules.
8200 A module can contain any layout tag.)
8203 \begin_layout Description
8204 \begin_inset Flex Code
8207 \begin_layout Plain Layout
8213 Adds information that will be output in the
8214 \begin_inset Flex Code
8217 \begin_layout Plain Layout
8223 block when this document class is output to XHTML.
8224 Typically, this would be used to output CSS style information, but it can
8225 be used for anything that can appear in
8226 \begin_inset Flex Code
8229 \begin_layout Plain Layout
8237 \begin_inset Quotes eld
8241 \begin_inset Flex Code
8244 \begin_layout Plain Layout
8251 \begin_inset Quotes erd
8257 \begin_layout Description
8258 \begin_inset Flex Code
8261 \begin_layout Plain Layout
8267 Adds CSS styling information.
8268 This will either be output in a
8269 \begin_inset Quotes eld
8273 \begin_inset Flex Code
8276 \begin_layout Plain Layout
8283 \begin_inset Quotes erd
8286 block or, if the user has so chosen, to a separate CSS file.Must end with
8288 \begin_inset Quotes eld
8292 \begin_inset Flex Code
8295 \begin_layout Plain Layout
8302 \begin_inset Quotes erd
8308 \begin_layout Description
8309 \begin_inset Flex Code
8312 \begin_layout Plain Layout
8318 Adds information to the document preamble.
8320 \begin_inset Quotes eld
8324 \begin_inset Flex Code
8327 \begin_layout Plain Layout
8334 \begin_inset Quotes erd
8340 \begin_layout Description
8341 \begin_inset Flex Code
8344 \begin_layout Plain Layout
8350 Defines formats for use in the display of bibliographic information.
8352 \begin_inset CommandInset ref
8354 reference "sub:Citation-format-description"
8360 \begin_inset Quotes eld
8364 \begin_inset Flex Code
8367 \begin_layout Plain Layout
8374 \begin_inset Quotes erd
8380 \begin_layout Description
8381 \begin_inset Flex Code
8384 \begin_layout Plain Layout
8390 Describes various global options supported by the document class.
8392 \begin_inset space ~
8396 \begin_inset CommandInset ref
8398 reference "sub:ClassOptions"
8404 \begin_inset Quotes eld
8408 \begin_inset Flex Code
8411 \begin_layout Plain Layout
8418 \begin_inset Quotes erd
8424 \begin_layout Description
8425 \begin_inset Flex Code
8428 \begin_layout Plain Layout
8435 \begin_inset Flex Code
8438 \begin_layout Plain Layout
8447 \begin_inset Flex Code
8450 \begin_layout Plain Layout
8456 ] Whether the class should
8460 to having one or two columns.
8461 Can be changed in the
8462 \begin_inset Flex MenuItem
8465 \begin_layout Plain Layout
8466 Document\SpecialChar \menuseparator
8475 \begin_layout Description
8476 \begin_inset Flex Code
8479 \begin_layout Plain Layout
8486 \begin_inset Flex Code
8489 \begin_layout Plain Layout
8495 ] This sequence defines the properties for a counter.
8496 If the counter does not yet exist, it is created; if it does exist, it
8499 \begin_inset Quotes eld
8503 \begin_inset Flex Code
8506 \begin_layout Plain Layout
8513 \begin_inset Quotes erd
8517 \begin_inset Newline newline
8521 \begin_inset space ~
8525 \begin_inset CommandInset ref
8527 reference "sub:Counters"
8531 for details on counters.
8534 \begin_layout Description
8535 \begin_inset Flex Code
8538 \begin_layout Plain Layout
8544 Sets the default font used to display the document.
8546 \begin_inset space ~
8550 \begin_inset CommandInset ref
8552 reference "sub:Font-description"
8556 for how to declare fonts.
8558 \begin_inset Quotes eld
8562 \begin_inset Flex Code
8565 \begin_layout Plain Layout
8572 \begin_inset Quotes erd
8578 \begin_layout Description
8579 \begin_inset Flex Code
8582 \begin_layout Plain Layout
8589 \begin_inset Flex Code
8592 \begin_layout Plain Layout
8598 Specifies a module to be included by default with this document class.
8599 The module should be specified by filename without the
8600 \begin_inset Flex Code
8603 \begin_layout Plain Layout
8610 The user can still remove the module, but it will be active at the outset.
8611 (This applies only when new files are created, or when this class is chosen
8612 for an existing document.)
8615 \begin_layout Description
8616 \begin_inset Flex Code
8619 \begin_layout Plain Layout
8626 \begin_inset Flex Code
8629 \begin_layout Plain Layout
8635 ] This is the style that will be assigned to new paragraphs, usually
8636 \begin_inset Flex MenuItem
8639 \begin_layout Plain Layout
8646 This will default to the first defined style if not given, but you are
8647 encouraged to use this directive.
8650 \begin_layout Description
8651 \begin_inset Flex Code
8654 \begin_layout Plain Layout
8661 \begin_inset Flex Code
8664 \begin_layout Plain Layout
8670 ] This tag indicates that the module in question—which should be specified
8671 by filename without the
8672 \begin_inset Flex Code
8675 \begin_layout Plain Layout
8681 extension—cannot be used with this document class.
8682 This might be used in a journal-specific layout file to prevent, say, the
8684 \begin_inset Flex Code
8687 \begin_layout Plain Layout
8693 module that numbers theorems by section.
8698 be used in a module.
8699 Modules have their own way of excluding other modules (see
8700 \begin_inset CommandInset ref
8702 reference "sub:Layout-modules"
8709 \begin_layout Description
8710 \begin_inset Flex Code
8713 \begin_layout Plain Layout
8719 Defines a new float.
8721 \begin_inset space ~
8725 \begin_inset CommandInset ref
8727 reference "sub:Floats"
8733 \begin_inset Quotes eld
8737 \begin_inset Flex Code
8740 \begin_layout Plain Layout
8747 \begin_inset Quotes erd
8753 \begin_layout Description
8754 \begin_inset Flex Code
8757 \begin_layout Plain Layout
8763 Sets the information that will be output in the
8764 \begin_inset Flex Code
8767 \begin_layout Plain Layout
8773 block when this document class is output to XHTML.
8774 Note that this will completely override any prior
8775 \begin_inset Flex Code
8778 \begin_layout Plain Layout
8785 \begin_inset Flex Code
8788 \begin_layout Plain Layout
8796 \begin_inset Flex Code
8799 \begin_layout Plain Layout
8805 if you just want to add material to the preamble.) Must end with
8806 \begin_inset Quotes eld
8810 \begin_inset Flex Code
8813 \begin_layout Plain Layout
8820 \begin_inset Quotes erd
8826 \begin_layout Description
8827 \begin_inset Flex Code
8830 \begin_layout Plain Layout
8836 Sets CSS styling information.
8837 This will either be output in a
8838 \begin_inset Quotes eld
8842 \begin_inset Flex Code
8845 \begin_layout Plain Layout
8852 \begin_inset Quotes erd
8855 block or, if the user has so chosen, to a separate CSS file.
8856 Note that this will completely override any prior
8857 \begin_inset Flex Code
8860 \begin_layout Plain Layout
8867 \begin_inset Flex Code
8870 \begin_layout Plain Layout
8878 \begin_inset Flex Code
8881 \begin_layout Plain Layout
8887 if you just want to add material.) Must end with
8888 \begin_inset Quotes eld
8892 \begin_inset Flex Code
8895 \begin_layout Plain Layout
8902 \begin_inset Quotes erd
8908 \begin_layout Description
8909 \begin_inset Flex Code
8912 \begin_layout Plain Layout
8919 \begin_inset Flex Code
8922 \begin_layout Plain Layout
8928 ] The layout to use for the table of contents, bibliography, and so forth,
8929 when the document is output to HTML.
8930 For articles, this should normally be Section; for books, Chapter.
8931 If it is not given, then LyX will attempt to figure out which layout to
8935 \begin_layout Description
8936 \begin_inset Flex Code
8939 \begin_layout Plain Layout
8946 \begin_inset Flex Code
8949 \begin_layout Plain Layout
8955 ] Modifies the properties of the given counter.
8956 If the counter does not exist, the section is ignored.
8958 \begin_inset Quotes eld
8962 \begin_inset Flex Code
8965 \begin_layout Plain Layout
8972 \begin_inset Quotes erd
8976 \begin_inset Newline newline
8980 \begin_inset space ~
8984 \begin_inset CommandInset ref
8986 reference "sub:Counters"
8990 for details on counters.
8993 \begin_layout Description
8994 \begin_inset Flex Code
8997 \begin_layout Plain Layout
9004 \begin_inset Flex Code
9007 \begin_layout Plain Layout
9013 ] Modifies the properties of the given paragraph style.
9014 If the style does not exist, the section is ignored.
9016 \begin_inset Quotes eld
9020 \begin_inset Flex Code
9023 \begin_layout Plain Layout
9030 \begin_inset Quotes erd
9036 \begin_layout Description
9037 \begin_inset Flex Code
9040 \begin_layout Plain Layout
9046 As its name implies, this command allows you to include another layout
9047 definition file within yours to avoid duplicating commands.
9048 Common examples are the standard layout files, for example,
9049 \begin_inset Flex Code
9052 \begin_layout Plain Layout
9058 , which contains most of the basic layouts.
9061 \begin_layout Description
9062 \begin_inset Flex Code
9065 \begin_layout Plain Layout
9071 This section (re-)defines the layout of an inset.
9072 It can be applied to an existing inset or to a new, user-defined inset,
9073 e.g., a new character style.
9075 \begin_inset Quotes eld
9079 \begin_inset Flex Code
9082 \begin_layout Plain Layout
9089 \begin_inset Quotes erd
9093 \begin_inset Newline newline
9097 \begin_inset space ~
9101 \begin_inset CommandInset ref
9103 reference "sub:Flex-insets-and"
9107 for more information.
9111 \begin_layout Description
9112 \begin_inset Flex Code
9115 \begin_layout Plain Layout
9122 \begin_inset Flex Code
9125 \begin_layout Plain Layout
9131 ] A string that indicates the width of the left margin on the screen, for
9133 \begin_inset Quotes eld
9137 \begin_inset Quotes erd
9141 (Note that this is not a `length', like
9142 \begin_inset Quotes eld
9146 \begin_inset Quotes erd
9152 \begin_layout Description
9153 \begin_inset Flex Code
9156 \begin_layout Plain Layout
9163 \begin_inset Flex Code
9166 \begin_layout Plain Layout
9172 ] This command deletes an existing counter, usually one defined in an included
9176 \begin_layout Description
9177 \begin_inset Flex Code
9180 \begin_layout Plain Layout
9186 This command deletes an existing float.
9187 This is particularly useful when you want to suppress a float that has
9188 been defined in an input file.
9191 \begin_layout Description
9192 \begin_inset Flex Code
9195 \begin_layout Plain Layout
9201 This command deletes an existing style.
9202 This is particularly useful when you want to suppress a style that has
9203 be defined in an input file.
9206 \begin_layout Description
9207 \begin_inset Flex Code
9210 \begin_layout Plain Layout
9216 A string indicating the file format (as defined in the Preferences dialog)
9217 produced by this class.
9218 It is mainly useful when
9219 \begin_inset Flex Code
9222 \begin_layout Plain Layout
9228 is `literate' and one wants to define a new type of literate document.
9229 This string is reset to `docbook', `latex', or `literate' when the correspondin
9231 \begin_inset Flex Code
9234 \begin_layout Plain Layout
9240 parameter is encountered.
9243 \begin_layout Description
9244 \begin_inset Flex Code
9247 \begin_layout Plain Layout
9253 A string indicating what sort of output documents using this class will
9255 At present, the options are: `docbook', `latex', and `literate'.
9258 \begin_layout Description
9259 \begin_inset Flex Code
9262 \begin_layout Plain Layout
9269 \begin_inset Flex Code
9272 \begin_layout Plain Layout
9281 \begin_inset Flex Code
9284 \begin_layout Plain Layout
9291 \begin_inset Flex Code
9294 \begin_layout Plain Layout
9300 ] The default pagestyle.
9301 Can be changed in the
9302 \begin_inset Flex MenuItem
9305 \begin_layout Plain Layout
9306 Document\SpecialChar \menuseparator
9315 \begin_layout Description
9316 \begin_inset Flex Code
9319 \begin_layout Plain Layout
9325 Sets the preamble for the LaTeX document.
9326 Note that this will completely override any prior
9327 \begin_inset Flex Code
9330 \begin_layout Plain Layout
9337 \begin_inset Flex Code
9340 \begin_layout Plain Layout
9348 \begin_inset Flex Code
9351 \begin_layout Plain Layout
9357 if you just want to add material to the preamble.) Must end with
9358 \begin_inset Quotes eld
9362 \begin_inset Flex Code
9365 \begin_layout Plain Layout
9372 \begin_inset Quotes erd
9378 \begin_layout Description
9379 \begin_inset Flex Code
9382 \begin_layout Plain Layout
9389 \begin_inset Flex Code
9392 \begin_layout Plain Layout
9399 \begin_inset Flex Code
9402 \begin_layout Plain Layout
9411 \begin_inset Flex Code
9414 \begin_layout Plain Layout
9420 ] Whether the class already provides the feature
9421 \begin_inset Flex Code
9424 \begin_layout Plain Layout
9431 A feature is in general the name of a package (
9432 \begin_inset Flex Code
9435 \begin_layout Plain Layout
9442 \begin_inset Flex Code
9445 \begin_layout Plain Layout
9451 , \SpecialChar \ldots{}
9453 \begin_inset Flex Code
9456 \begin_layout Plain Layout
9463 \begin_inset Flex Code
9466 \begin_layout Plain Layout
9472 ,\SpecialChar \ldots{}
9473 ); the complete list of supported features is unfortunately not documented
9474 outside the LyX source code—but see
9475 \begin_inset Flex Code
9478 \begin_layout Plain Layout
9484 if you're interested.
9486 \begin_inset Flex MenuItem
9489 \begin_layout Plain Layout
9490 Help\SpecialChar \menuseparator
9496 also gives an overview of the supported packages.
9499 \begin_layout Description
9500 \begin_inset Flex Code
9503 \begin_layout Plain Layout
9510 \begin_inset Flex Code
9513 \begin_layout Plain Layout
9519 ] Indicates that this layout provides the functionality of the module mentioned,
9520 which should be specified by the filename without the
9521 \begin_inset Flex Code
9524 \begin_layout Plain Layout
9531 This will typically be used if the layout includes the module directly,
9532 rather than using the
9533 \begin_inset Flex Code
9536 \begin_layout Plain Layout
9542 tag to indicate that it ought to be used.
9543 It could also be used in a module that provided an alternate implementation
9544 of the same functionality.
9547 \begin_layout Description
9548 \begin_inset Flex Code
9551 \begin_layout Plain Layout
9558 \begin_inset Flex Code
9561 \begin_layout Plain Layout
9567 ] Whether the class requires the feature
9568 \begin_inset Flex Code
9571 \begin_layout Plain Layout
9578 Multiple features must be separated by commas.
9579 Note that you can only request supported features.
9581 \begin_inset Flex Code
9584 \begin_layout Plain Layout
9590 for a list of these.)
9593 \begin_layout Description
9594 \begin_inset Flex Code
9597 \begin_layout Plain Layout
9603 A string that indicates the width of the right margin on the screen, for
9605 \begin_inset Quotes eld
9609 \begin_inset Quotes erd
9615 \begin_layout Description
9616 \begin_inset Flex Code
9619 \begin_layout Plain Layout
9625 Sets which divisions get numbered.
9627 \begin_inset Flex Code
9630 \begin_layout Plain Layout
9639 \begin_layout Description
9640 \begin_inset Flex Code
9643 \begin_layout Plain Layout
9650 \begin_inset Flex Code
9653 \begin_layout Plain Layout
9662 \begin_inset Flex Code
9665 \begin_layout Plain Layout
9671 ] Whether the class-default should be printing on one or both sides of the
9673 Can be changed in the
9674 \begin_inset Flex MenuItem
9677 \begin_layout Plain Layout
9678 Document\SpecialChar \menuseparator
9687 \begin_layout Description
9688 \begin_inset Flex Code
9691 \begin_layout Plain Layout
9697 This sequence defines a paragraph style.
9698 If the style does not yet exist, it is created; if it does exist, its parameter
9701 \begin_inset Quotes eld
9705 \begin_inset Flex Code
9708 \begin_layout Plain Layout
9715 \begin_inset Quotes erd
9719 \begin_inset Newline newline
9723 \begin_inset space ~
9727 \begin_inset CommandInset ref
9729 reference "sub:Paragraph-Styles"
9733 for details on paragraph styles.
9736 \begin_layout Description
9737 \begin_inset Flex Code
9740 \begin_layout Plain Layout
9747 \begin_inset Flex Code
9750 \begin_layout Plain Layout
9756 ] The name of the command or environment to be used with
9757 \begin_inset Flex Code
9760 \begin_layout Plain Layout
9769 \begin_layout Description
9770 \begin_inset Flex Code
9773 \begin_layout Plain Layout
9780 \begin_inset Flex Code
9783 \begin_layout Plain Layout
9792 \begin_inset Flex Code
9795 \begin_layout Plain Layout
9801 ] Indicates what kind of markup is used to define the title of a document.
9803 \begin_inset Flex Code
9806 \begin_layout Plain Layout
9812 means that the macro with name
9813 \begin_inset Flex Code
9816 \begin_layout Plain Layout
9822 will be inserted after the last layout which has
9823 \begin_inset Quotes eld
9827 \begin_inset Flex Code
9830 \begin_layout Plain Layout
9837 \begin_inset Quotes erd
9842 \begin_inset Flex Code
9845 \begin_layout Plain Layout
9851 corresponds to the case where the block of paragraphs which have
9852 \begin_inset Quotes eld
9856 \begin_inset Flex Code
9859 \begin_layout Plain Layout
9866 \begin_inset Quotes erd
9869 should be enclosed into the
9870 \begin_inset Flex Code
9873 \begin_layout Plain Layout
9882 \begin_layout Description
9883 \begin_inset Flex Code
9886 \begin_layout Plain Layout
9892 Sets which divisions are included in the table of contents.
9894 \begin_inset Flex Code
9897 \begin_layout Plain Layout
9906 \begin_layout Subsection
9907 \begin_inset Flex Code
9910 \begin_layout Plain Layout
9917 \begin_inset CommandInset label
9919 name "sub:ClassOptions"
9926 \begin_layout Standard
9928 \begin_inset Flex Code
9931 \begin_layout Plain Layout
9937 section can contain the following entries:
9940 \begin_layout Description
9941 \begin_inset Flex Code
9944 \begin_layout Plain Layout
9951 \begin_inset Flex Code
9954 \begin_layout Plain Layout
9960 ] The list of available font sizes for the document's main font, separated
9962 \begin_inset Quotes eld
9966 \begin_inset Flex Code
9969 \begin_layout Plain Layout
9976 \begin_inset Quotes erd
9982 \begin_layout Description
9983 \begin_inset Flex Code
9986 \begin_layout Plain Layout
9992 Used to set the DTD line with XML-based output classes.
9994 \begin_inset space \thinspace{}
9998 \begin_inset Quotes eld
10001 -//OASIS//DTD DocBook V4.2//EN
10002 \begin_inset Quotes erd
10008 \begin_layout Description
10009 \begin_inset Flex Code
10012 \begin_layout Plain Layout
10019 \begin_inset Flex Code
10022 \begin_layout Plain Layout
10023 string="empty|plain|headings|fancy"
10028 ] The list of available page styles, separated by
10029 \begin_inset Quotes eld
10033 \begin_inset Flex Code
10036 \begin_layout Plain Layout
10043 \begin_inset Quotes erd
10049 \begin_layout Description
10050 \begin_inset Flex Code
10053 \begin_layout Plain Layout
10060 \begin_inset Flex Code
10063 \begin_layout Plain Layout
10069 ] Some document class options, separated by a comma, that will be added
10070 to the optional part of the
10071 \begin_inset Flex Code
10074 \begin_layout Plain Layout
10085 \begin_layout Standard
10087 \begin_inset Flex Code
10090 \begin_layout Plain Layout
10096 section must end with
10097 \begin_inset Quotes eld
10101 \begin_inset Flex Code
10104 \begin_layout Plain Layout
10111 \begin_inset Quotes erd
10117 \begin_layout Subsection
10119 \begin_inset CommandInset label
10121 name "sub:Paragraph-Styles"
10128 \begin_layout Standard
10129 A paragraph style description looks like this:
10133 \begin_layout Plain Layout
10134 Note that this will either define a new style or modify an existing one.
10142 \begin_layout LyX-Code
10149 \begin_layout LyX-Code
10153 \begin_layout LyX-Code
10157 \begin_layout Standard
10158 where the following commands are allowed:
10161 \begin_layout Description
10162 \begin_inset Flex Code
10165 \begin_layout Plain Layout
10172 \begin_inset Flex Code
10175 \begin_layout Plain Layout
10180 , left, right, center
10185 ] Paragraph alignment.
10188 \begin_layout Description
10189 \begin_inset Flex Code
10192 \begin_layout Plain Layout
10199 \begin_inset Flex Code
10202 \begin_layout Plain Layout
10207 , left, right, center
10212 ] A comma separated list of permitted alignments.
10213 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
10215 For example a right-aligned or centered enumeration isn't possible.)
10216 \change_inserted -712698321 1353679769
10220 \begin_layout Description
10222 \change_inserted -712698321 1353680268
10223 \begin_inset Flex Code
10226 \begin_layout Plain Layout
10228 \change_inserted -712698321 1353679781
10235 \begin_inset Flex Code
10238 \begin_layout Plain Layout
10240 \change_inserted -712698321 1353679772
10246 ] Defines argument number <int> of a command\SpecialChar \slash{}
10247 environment associated with
10249 This is useful for things like section headings, and only makes sense with
10251 Every (optional or required) argument of a command or environment -- except
10252 for the required argument that is associated with the content of the paragraph
10253 itself -- has a separate definition, where the number specifies the order
10255 The definition must end with
10256 \begin_inset Flex Code
10259 \begin_layout Plain Layout
10261 \change_inserted -712698321 1353680069
10268 So a command with two optional arguments has:
10272 \begin_layout Quote
10274 \change_inserted -712698321 1353680127
10280 \begin_layout Quote
10282 \change_inserted -712698321 1353680195
10288 \begin_layout Quote
10290 \change_inserted -712698321 1353680135
10296 \begin_layout Quote
10298 \change_inserted -712698321 1353680140
10304 \begin_layout Quote
10306 \change_inserted -712698321 1353680197
10312 \begin_layout Quote
10314 \change_inserted -712698321 1353680147
10320 \begin_layout Standard
10322 \change_inserted -712698321 1353680528
10324 \begin_inset Flex Code
10327 \begin_layout Plain Layout
10329 \change_inserted -712698321 1353680412
10335 definition, the following specifications are possible:
10338 \begin_layout Itemize
10340 \change_inserted -712698321 1353691469
10341 \begin_inset Flex Code
10344 \begin_layout Plain Layout
10346 \change_inserted -712698321 1353680543
10355 \begin_inset Flex Code
10358 \begin_layout Plain Layout
10360 \change_inserted -712698321 1353680567
10366 The string that will appear both in the menu (to insert this argument)
10367 and on the argument inset button.
10368 For the menu, you can define an accelerator by appending the respective
10369 character to the string, divided by
10370 \begin_inset Quotes eld
10374 \begin_inset Quotes erd
10378 \begin_inset space \thinspace{}
10383 \begin_inset Flex Code
10386 \begin_layout Plain Layout
10388 \change_inserted -712698321 1353691482
10389 \begin_inset Quotes eld
10393 \begin_inset Quotes erd
10406 \begin_layout Itemize
10408 \change_inserted -712698321 1353680665
10409 \begin_inset Flex Code
10412 \begin_layout Plain Layout
10414 \change_inserted -712698321 1353680616
10421 \begin_inset Flex Code
10424 \begin_layout Plain Layout
10426 \change_inserted -712698321 1353680623
10432 A longer explanatory text that appears in the tooltip when hovering over
10433 the argument inset.
10436 \begin_layout Itemize
10438 \change_inserted -712698321 1353680874
10439 \begin_inset Flex Code
10442 \begin_layout Plain Layout
10444 \change_inserted -712698321 1353680732
10451 \begin_inset Flex Code
10454 \begin_layout Plain Layout
10456 \change_inserted -712698321 1353680738
10462 Declare if this is a mandatory
10463 \change_inserted 2090807402 1353765594
10465 \change_inserted -712698321 1353680874
10467 \change_inserted 2090807402 1353765599
10469 \change_inserted -712698321 1353680874
10471 Mandatory arguments will be output empty if not given, while optional arguments
10472 will not be output at all.
10473 By default, mandatory arguments are delimited by
10474 \begin_inset Flex Code
10477 \begin_layout Plain Layout
10479 \change_inserted -712698321 1353680808
10487 , while optional arguments are delimited by
10488 \begin_inset Flex Code
10491 \begin_layout Plain Layout
10493 \change_inserted -712698321 1353680833
10502 \begin_layout Itemize
10504 \change_inserted -712698321 1353917199
10505 \begin_inset Flex Code
10508 \begin_layout Plain Layout
10510 \change_inserted -712698321 1353680879
10517 \begin_inset Flex Code
10520 \begin_layout Plain Layout
10522 \change_inserted -712698321 1353680874
10528 defines another argument (by its number) which this argument requires to
10529 be output if it is itself output.
10531 \begin_inset space \thinspace{}
10534 g., in LaTeX commands, optional arguments often require previous optional
10535 arguments to be output (at least empty), as in
10536 \begin_inset Flex Code
10539 \begin_layout Plain Layout
10541 \change_inserted -712698321 1353688183
10544 command[][arg]{text}
10552 This can be achieved by the statement
10553 \begin_inset Flex Code
10556 \begin_layout Plain Layout
10558 \change_inserted -712698321 1353681031
10567 \begin_inset Flex Code
10570 \begin_layout Plain Layout
10572 \change_inserted -712698321 1353681045
10583 \begin_layout Itemize
10585 \change_inserted -712698321 1353681145
10586 \begin_inset Flex Code
10589 \begin_layout Plain Layout
10591 \change_inserted -712698321 1353681072
10600 \begin_inset Flex Code
10603 \begin_layout Plain Layout
10605 \change_inserted -712698321 1353681067
10611 defines a custom left delimiter (instead of
10612 \begin_inset Flex Code
10615 \begin_layout Plain Layout
10617 \change_inserted -712698321 1353681127
10626 \begin_inset Flex Code
10629 \begin_layout Plain Layout
10631 \change_inserted -712698321 1353681133
10642 \begin_layout Itemize
10644 \change_inserted -712698321 1353917319
10645 \begin_inset Flex Code
10648 \begin_layout Plain Layout
10650 \change_inserted -712698321 1353681149
10657 \begin_inset Flex Code
10660 \begin_layout Plain Layout
10662 \change_inserted -712698321 1353681146
10668 defines a custom right delimiter (instead of
10669 \begin_inset Flex Code
10672 \begin_layout Plain Layout
10674 \change_inserted -712698321 1353681158
10681 \begin_inset Flex Code
10684 \begin_layout Plain Layout
10686 \change_inserted -712698321 1353681161
10695 \begin_layout Itemize
10697 \change_inserted -712698321 1353917320
10698 \begin_inset Flex Code
10701 \begin_layout Plain Layout
10703 \change_inserted -712698321 1353917320
10709 The font used for the argument content.
10711 \begin_inset space ~
10715 \begin_inset CommandInset ref
10717 reference "sub:Font-description"
10724 \begin_layout Itemize
10726 \change_inserted -712698321 1353917320
10727 \begin_inset Flex Code
10730 \begin_layout Plain Layout
10732 \change_inserted -712698321 1353917320
10738 The font used for the label.
10740 \begin_inset space ~
10744 \begin_inset CommandInset ref
10746 reference "sub:Font-description"
10753 \begin_layout Itemize
10755 \change_inserted -712698321 1353917320
10756 \begin_inset Flex Code
10759 \begin_layout Plain Layout
10761 \change_inserted -712698321 1353917320
10768 \begin_inset Flex Code
10771 \begin_layout Plain Layout
10773 \change_inserted -712698321 1353917320
10780 \begin_inset Flex Code
10783 \begin_layout Plain Layout
10785 \change_inserted -712698321 1353917320
10792 \begin_inset Flex Code
10795 \begin_layout Plain Layout
10797 \change_inserted -712698321 1353917320
10803 , describing the rendering style used for the inset's frame and buttons.
10805 \begin_inset Flex Code
10808 \begin_layout Plain Layout
10810 \change_inserted -712698321 1353917320
10822 \begin_layout Description
10823 \begin_inset Flex Code
10826 \begin_layout Plain Layout
10832 Note that this will completely override any prior
10833 \begin_inset Flex Code
10836 \begin_layout Plain Layout
10842 declaration for this style.
10844 \begin_inset Quotes eld
10848 \begin_inset Flex Code
10851 \begin_layout Plain Layout
10858 \begin_inset Quotes erd
10863 \begin_inset CommandInset ref
10865 reference "sub:I18n"
10869 for details on its use.
10872 \begin_layout Description
10873 \begin_inset Flex Code
10876 \begin_layout Plain Layout
10883 \begin_inset Flex Code
10886 \begin_layout Plain Layout
10896 \begin_layout Plain Layout
10897 Note that a `float' here is a real number, such as: 1.5.
10902 The vertical space with which the last of a chain of paragraphs with this
10903 style is separated from the following paragraph.
10904 If the next paragraph has another style, the separations are not simply
10905 added, but the maximum is taken.
10908 \begin_layout Description
10909 \begin_inset Flex Code
10912 \begin_layout Plain Layout
10919 \begin_inset Flex Code
10922 \begin_layout Plain Layout
10928 The category for this style.
10929 This is used to group related styles in the style combobox on the toolbar.
10930 Any string can be used, but you may want to use existing categories with
10935 \begin_layout Description
10936 \begin_inset Flex Code
10939 \begin_layout Plain Layout
10945 Depth of XML command.
10946 Used only with XML-type formats.
10949 \begin_layout Description
10950 \begin_inset Flex Code
10953 \begin_layout Plain Layout
10960 \begin_inset Flex Code
10963 \begin_layout Plain Layout
10969 Copies all the features of an existing style into the current one.
10973 \begin_layout Description
10974 \begin_inset Flex Code
10977 \begin_layout Plain Layout
10983 The name of a style whose preamble should be output
10988 This allows to ensure some ordering of the preamble snippets when macros
10989 definitions depend on one another.
10993 \begin_layout Plain Layout
10994 Note that, besides that functionality, there is no way to ensure any ordering
10996 The ordering that you see in a given version of LyX may change without
10997 warning in later versions.
11005 \begin_layout Description
11006 \begin_inset Flex Code
11009 \begin_layout Plain Layout
11016 \begin_inset Flex Code
11019 \begin_layout Plain Layout
11024 , Box, Filled_Box, Static
11029 ] The type of label that stands at the end of the paragraph (or sequence
11031 \begin_inset Flex Code
11034 \begin_layout Plain Layout
11041 \begin_inset Flex Code
11044 \begin_layout Plain Layout
11051 \begin_inset Flex Code
11054 \begin_layout Plain Layout
11061 \begin_inset Flex Code
11064 \begin_layout Plain Layout
11072 \begin_inset Flex Code
11075 \begin_layout Plain Layout
11082 \begin_inset Quotes eld
11086 \begin_inset Quotes erd
11090 \begin_inset Flex Code
11093 \begin_layout Plain Layout
11100 \begin_inset Flex Code
11103 \begin_layout Plain Layout
11104 \begin_inset space ~
11112 ) is a white (resp.
11113 \begin_inset space ~
11116 black) square suitable for end of proof markers,
11117 \begin_inset Flex Code
11120 \begin_layout Plain Layout
11126 is an explicit text string.
11129 \begin_layout Description
11130 \begin_inset Flex Code
11133 \begin_layout Plain Layout
11140 \begin_inset Flex Code
11143 \begin_layout Plain Layout
11149 ] The string used for a label with a
11150 \begin_inset Flex Code
11153 \begin_layout Plain Layout
11160 \begin_inset Flex Code
11163 \begin_layout Plain Layout
11173 \begin_layout Description
11174 \begin_inset Flex Code
11177 \begin_layout Plain Layout
11183 The font used for both the text body
11189 \begin_inset space ~
11193 \begin_inset CommandInset ref
11195 reference "sub:Font-description"
11200 Note that defining this font automatically defines the
11201 \begin_inset Flex Code
11204 \begin_layout Plain Layout
11211 So you should define this one first if you also want to define
11212 \begin_inset Flex Code
11215 \begin_layout Plain Layout
11224 \begin_layout Description
11225 \begin_inset Flex Code
11228 \begin_layout Plain Layout
11235 \begin_inset CommandInset label
11237 name "des:FreeSpacing"
11242 \begin_inset Flex Code
11245 \begin_layout Plain Layout
11254 \begin_inset Flex Code
11257 \begin_layout Plain Layout
11263 ] Usually LyX doesn't allow you to insert more than one space between words,
11264 since a space is considered as the separation between two words, not a
11265 character or symbol of its own.
11266 This is a very fine thing but sometimes annoying, for example, when typing
11267 program code or plain LaTeX code.
11269 \begin_inset Flex Code
11272 \begin_layout Plain Layout
11279 Note that LyX will create protected blanks for the additional blanks when
11280 in another mode than LaTeX-mode.
11283 \begin_layout Description
11284 \begin_inset Flex Code
11287 \begin_layout Plain Layout
11293 These tags are used with XHTML output.
11295 \begin_inset CommandInset ref
11297 reference "sub:Paragraph-Style-XHTML"
11304 \begin_layout Description
11305 \begin_inset Flex Code
11308 \begin_layout Plain Layout
11314 [[FIXME]] (Used only with XML-type formats.)
11317 \begin_layout Description
11318 \begin_inset Flex Code
11321 \begin_layout Plain Layout
11328 \begin_inset Flex Code
11331 \begin_layout Plain Layout
11337 If 1, marks the style as to be included in the document preamble rather
11338 than in the document body.
11339 This is useful for document classes that want such information as the title
11340 and author to appear in the preamble.
11341 Note that this works only for styles for which the
11342 \begin_inset Flex Code
11345 \begin_layout Plain Layout
11352 \begin_inset Flex Code
11355 \begin_layout Plain Layout
11362 \begin_inset Flex Code
11365 \begin_layout Plain Layout
11374 \begin_layout Description
11375 \begin_inset Flex Code
11378 \begin_layout Plain Layout
11385 \begin_inset Flex Code
11388 \begin_layout Plain Layout
11394 If 1, marks the style as being part of a title block (see also the
11395 \begin_inset Flex Code
11398 \begin_layout Plain Layout
11405 \begin_inset Flex Code
11408 \begin_layout Plain Layout
11417 \begin_layout Description
11418 \begin_inset Flex Code
11421 \begin_layout Plain Layout
11428 \begin_inset Flex Code
11431 \begin_layout Plain Layout
11437 ] This provides extra space between paragraphs that have the same style.
11438 If you put other styles into an environment, each is separated with the
11440 \begin_inset Flex Code
11443 \begin_layout Plain Layout
11450 But the whole items of the environment are additionally separated with
11452 \begin_inset Flex Code
11455 \begin_layout Plain Layout
11462 Note that this is a
11467 \begin_layout Description
11468 \begin_inset Flex Code
11471 \begin_layout Plain Layout
11477 [[FIXME]] (Used only with XML-type formats.)
11480 \begin_layout Description
11481 \begin_inset Flex Code
11484 \begin_layout Plain Layout
11491 \begin_inset Flex Code
11494 \begin_layout Plain Layout
11503 \begin_inset Flex Code
11506 \begin_layout Plain Layout
11512 ] Usually LyX does not allow you to leave a paragraph empty, since it would
11513 lead to empty LaTeX output.
11514 There are some cases where this could be desirable however: in a letter
11515 template, the required fields can be provided as empty fields, so that
11516 people do not forget them; in some special classes, a style can be used
11517 as some kind of break, which does not contain actual text.
11520 \begin_layout Description
11521 \begin_inset Flex Code
11524 \begin_layout Plain Layout
11530 [float=0] The vertical space between the label and the text body.
11531 Only used for labels that are above the text body (
11532 \begin_inset Flex Code
11535 \begin_layout Plain Layout
11542 \begin_inset Flex Code
11545 \begin_layout Plain Layout
11546 Centered_Top_Environment
11554 \begin_layout Description
11555 \begin_inset Flex Code
11558 \begin_layout Plain Layout
11565 \begin_inset Flex Code
11568 \begin_layout Plain Layout
11575 \begin_inset Newline newline
11578 The name of the counter for automatic numbering.
11580 \begin_inset Newline newline
11588 \begin_inset Flex Code
11591 \begin_layout Plain Layout
11598 \begin_inset Flex Code
11601 \begin_layout Plain Layout
11608 In that case, the counter will be stepped each time the style appears.
11610 \begin_inset Newline newline
11618 \begin_inset Flex Code
11621 \begin_layout Plain Layout
11628 \begin_inset Flex Code
11631 \begin_layout Plain Layout
11637 , though this case is a bit complicated.
11638 Suppose you declare
11639 \begin_inset Quotes eld
11643 \begin_inset Flex Code
11646 \begin_layout Plain Layout
11647 LabelCounter myenum
11653 \begin_inset Quotes erd
11657 Then the actual counters used are
11658 \begin_inset Flex Code
11661 \begin_layout Plain Layout
11668 \begin_inset Flex Code
11671 \begin_layout Plain Layout
11678 \begin_inset Flex Code
11681 \begin_layout Plain Layout
11688 \begin_inset Flex Code
11691 \begin_layout Plain Layout
11697 , much as in LaTeX.
11698 These counters must all be declared separately.
11699 \begin_inset Newline newline
11703 \begin_inset CommandInset ref
11705 reference "sub:Counters"
11709 for details on counters.
11712 \begin_layout Description
11713 \begin_inset Flex Code
11716 \begin_layout Plain Layout
11722 The font used for the label.
11724 \begin_inset space ~
11728 \begin_inset CommandInset ref
11730 reference "sub:Font-description"
11737 \begin_layout Description
11738 \begin_inset Flex Code
11741 \begin_layout Plain Layout
11747 Text that indicates how far a label should be indented.
11750 \begin_layout Description
11751 \begin_inset Flex Code
11754 \begin_layout Plain Layout
11761 \begin_inset Flex Code
11764 \begin_layout Plain Layout
11770 ] The horizontal space between the label and the text body.
11771 Only used for labels that are not above the text body.
11774 \begin_layout Description
11775 \begin_inset Flex Code
11778 \begin_layout Plain Layout
11785 \begin_inset Flex Code
11788 \begin_layout Plain Layout
11794 ] The string used for a label with a
11795 \begin_inset Flex Code
11798 \begin_layout Plain Layout
11806 \begin_inset Flex Code
11809 \begin_layout Plain Layout
11815 is set, this string can be contain the special formatting commands described
11817 \begin_inset CommandInset ref
11819 reference "sub:Counters"
11827 \begin_layout Plain Layout
11828 For the sake of backwards compatibility, the string
11829 \begin_inset Flex Code
11832 \begin_layout Plain Layout
11842 will be replaced by the expanded
11843 \begin_inset Flex Code
11846 \begin_layout Plain Layout
11853 \begin_inset Flex Code
11856 \begin_layout Plain Layout
11865 This feature is now obsolete and should be replaced by the mechanisms of
11867 \begin_inset CommandInset ref
11869 reference "sub:Counters"
11881 \begin_layout Description
11882 \begin_inset Flex Code
11885 \begin_layout Plain Layout
11886 LabelStringAppendix
11892 \begin_inset Flex Code
11895 \begin_layout Plain Layout
11901 ] This is used inside the appendix instead of
11902 \begin_inset Flex Code
11905 \begin_layout Plain Layout
11913 \begin_inset Flex Code
11916 \begin_layout Plain Layout
11923 \begin_inset Flex Code
11926 \begin_layout Plain Layout
11927 LabelStringAppendix
11935 \begin_layout Description
11936 \begin_inset Flex Code
11939 \begin_layout Plain Layout
11945 [FIXME] (Used only with XML-type formats.)
11948 \begin_layout Description
11949 \begin_inset Flex Code
11952 \begin_layout Plain Layout
11959 \begin_inset Flex Code
11962 \begin_layout Plain Layout
11967 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
11968 Enumerate, Itemize, Bibliography
11977 \begin_layout Itemize
11978 \begin_inset Flex Code
11981 \begin_layout Plain Layout
11987 means the label is the very first word (up to the first real blank).
11988 Use protected spaces (like
11989 \begin_inset space ~
11992 that one) if you want more than one word as the label.
11996 \begin_layout Itemize
11997 \begin_inset Flex Code
12000 \begin_layout Plain Layout
12006 means the label is simply whatever
12007 \begin_inset Flex Code
12010 \begin_layout Plain Layout
12017 Note that this really is `static'.
12020 \begin_layout Itemize
12021 \begin_inset Flex Code
12024 \begin_layout Plain Layout
12031 \begin_inset Flex Code
12034 \begin_layout Plain Layout
12035 Centered_Top_Environment
12040 are special cases of
12041 \begin_inset Flex Code
12044 \begin_layout Plain Layout
12051 The label will be printed above the paragraph, but only at the top of an
12052 environment or the top of a chain of paragraphs with this style.
12053 This might be used with the
12054 \begin_inset Flex MenuItem
12057 \begin_layout Plain Layout
12063 style, for example.
12066 \begin_layout Itemize
12067 \begin_inset Flex Code
12070 \begin_layout Plain Layout
12076 is a special case for the caption-labels
12077 \begin_inset Quotes eld
12081 \begin_inset Quotes erd
12085 \begin_inset Quotes eld
12089 \begin_inset Quotes erd
12094 \begin_inset Flex Code
12097 \begin_layout Plain Layout
12103 means the (hardcoded) label string depends on the kind of float: It is
12104 hardcoded to be `FloatType N', where N is the value of the counter associated
12108 \begin_layout Itemize
12110 \begin_inset Flex Code
12113 \begin_layout Plain Layout
12119 label type defines automatically numbered labels.
12121 \begin_inset Flex Code
12124 \begin_layout Plain Layout
12130 will be expanded to resolve any counter references it contains: For example,
12132 \begin_inset Quotes eld
12136 \begin_inset Flex Code
12139 \begin_layout Plain Layout
12150 \begin_inset Quotes erd
12155 \begin_inset CommandInset ref
12157 reference "sub:Counters"
12161 for more information on counters.
12164 \begin_layout Itemize
12165 \begin_inset Flex Code
12168 \begin_layout Plain Layout
12174 produces the usual sort of enumeration labels.
12175 At present, it is hardcoded to use Arabic numerals, lowercase letters,
12176 small Roman numerals, and uppercase letters for the four possible depths.
12179 \begin_layout Itemize
12180 \begin_inset Flex Code
12183 \begin_layout Plain Layout
12189 produces various bullets at the different levels.
12190 It is also hardcoded.
12193 \begin_layout Itemize
12194 \begin_inset Flex Code
12197 \begin_layout Plain Layout
12203 is used internally by LyX and should be used only with
12204 \begin_inset Flex Code
12207 \begin_layout Plain Layout
12208 LatexType BibEnvironment
12217 \begin_layout Description
12218 \begin_inset Flex Code
12221 \begin_layout Plain Layout
12227 Note that this will completely override any prior
12228 \begin_inset Flex Code
12231 \begin_layout Plain Layout
12237 declaration for this style.
12239 \begin_inset Quotes eld
12243 \begin_inset Flex Code
12246 \begin_layout Plain Layout
12253 \begin_inset Quotes erd
12258 \begin_inset CommandInset ref
12260 reference "sub:I18n"
12264 for details on its use.
12267 \begin_layout Description
12268 \begin_inset Flex Code
12271 \begin_layout Plain Layout
12277 The name of the corresponding LaTeX stuff.
12278 Either the environment or command name.
12281 \begin_layout Description
12282 \begin_inset Flex Code
12285 \begin_layout Plain Layout
12291 An optional parameter for the corresponding
12292 \begin_inset Flex Code
12295 \begin_layout Plain Layout
12302 This parameter cannot be changed from within LyX.
12305 \begin_layout Description
12306 \begin_inset Flex Code
12309 \begin_layout Plain Layout
12316 \begin_inset Flex Code
12319 \begin_layout Plain Layout
12324 , Command, Environment, Item_Environment,
12330 \begin_inset Flex Code
12333 \begin_layout Plain Layout
12334 List_Environment, Bib_Environment
12339 ] How the style should be translated into LaTeX.
12343 \begin_layout Plain Layout
12344 \begin_inset Flex Code
12347 \begin_layout Plain Layout
12353 is perhaps a bit misleading, since these rules apply to SGML classes, too.
12354 Visit the SGML class files for specific examples.
12363 \begin_layout Itemize
12364 \begin_inset Flex Code
12367 \begin_layout Plain Layout
12373 means nothing special.
12377 \begin_layout Itemize
12378 \begin_inset Flex Code
12381 \begin_layout Plain Layout
12388 \begin_inset Flex Code
12391 \begin_layout Plain Layout
12398 {\SpecialChar \ldots{}
12407 \begin_layout Itemize
12408 \begin_inset Flex Code
12411 \begin_layout Plain Layout
12418 \begin_inset Flex Code
12421 \begin_layout Plain Layout
12428 }\SpecialChar \ldots{}
12444 \begin_layout Itemize
12445 \begin_inset Flex Code
12448 \begin_layout Plain Layout
12455 \begin_inset Flex Code
12458 \begin_layout Plain Layout
12465 \begin_inset Flex Code
12468 \begin_layout Plain Layout
12476 is generated for each paragraph of this environment.
12480 \begin_layout Itemize
12481 \begin_inset Flex Code
12484 \begin_layout Plain Layout
12491 \begin_inset Flex Code
12494 \begin_layout Plain Layout
12501 \begin_inset Flex Code
12504 \begin_layout Plain Layout
12510 is passed as an argument to the environment.
12512 \begin_inset Flex Code
12515 \begin_layout Plain Layout
12521 can be defined in the
12522 \begin_inset Flex MenuItem
12525 \begin_layout Plain Layout
12526 Edit\SpecialChar \menuseparator
12528 \begin_inset space ~
12540 \begin_layout Standard
12541 Putting the last few things together, the LaTeX output will be either:
12544 \begin_layout LyX-Code
12547 latexname[latexparam]{\SpecialChar \ldots{}
12551 \begin_layout Standard
12555 \begin_layout LyX-Code
12558 begin{latexname}[latexparam] \SpecialChar \ldots{}
12564 \begin_layout Standard
12565 depending upon the LaTeX type.
12569 \begin_layout Description
12571 \change_inserted -712698321 1353866861
12572 \begin_inset Flex Code
12575 \begin_layout Plain Layout
12577 \change_inserted -712698321 1353866852
12584 \begin_inset Flex Code
12587 \begin_layout Plain Layout
12589 \change_inserted -712698321 1353866852
12595 ] A string that is put at the beginning of the style content.
12598 \begin_layout Description
12599 \begin_inset Flex Code
12602 \begin_layout Plain Layout
12609 \begin_inset Flex Code
12612 \begin_layout Plain Layout
12618 ] If you put styles into environments, the leftmargins are not simply added,
12619 but added with a factor
12620 \begin_inset Formula $\frac{4}{depth+4}$
12624 Note that this parameter is also used when the margin is defined as
12625 \begin_inset Flex Code
12628 \begin_layout Plain Layout
12635 \begin_inset Flex Code
12638 \begin_layout Plain Layout
12645 Then it is added to the manual or dynamic margin.
12647 \begin_inset Newline newline
12650 The argument is passed as a string.
12652 \begin_inset Quotes eld
12656 \begin_inset Flex Code
12659 \begin_layout Plain Layout
12666 \begin_inset Quotes erd
12669 means that the paragraph is indented with the width of
12670 \begin_inset Quotes eld
12674 \begin_inset Flex Code
12677 \begin_layout Plain Layout
12684 \begin_inset Quotes erd
12687 in the normal font.
12688 You can get a negative width by prefixing the string with
12689 \begin_inset Quotes eld
12693 \begin_inset Flex Code
12696 \begin_layout Plain Layout
12703 \begin_inset Quotes erd
12707 This way was chosen so that the look is the same with each used screen
12712 \begin_layout Description
12713 \begin_inset Flex Code
12716 \begin_layout Plain Layout
12723 \begin_inset Flex Code
12726 \begin_layout Plain Layout
12731 , Manual, Dynamic, First_Dynamic, Right_Address_Box
12737 \begin_inset Newline newline
12740 The kind of margin that the style has on the left side.
12742 \begin_inset Flex Code
12745 \begin_layout Plain Layout
12751 just means a fixed margin.
12753 \begin_inset Flex Code
12756 \begin_layout Plain Layout
12762 means that the left margin depends on the string entered in the
12763 \begin_inset Flex MenuItem
12766 \begin_layout Plain Layout
12767 Edit\SpecialChar \menuseparator
12769 \begin_inset space ~
12778 This is used to typeset nice lists without tabulators.
12780 \begin_inset Flex Code
12783 \begin_layout Plain Layout
12789 means that the margin depends on the size of the label.
12790 This is used for automatic enumerated headlines.
12791 It is obvious that the headline
12792 \begin_inset Quotes eld
12795 5.4.3.2.1 Very long headline
12796 \begin_inset Quotes erd
12799 must have a wider left margin (as wide as
12800 \begin_inset Quotes eld
12804 \begin_inset Quotes erd
12807 plus the space) than
12808 \begin_inset Quotes eld
12811 3.2 Very long headline
12812 \begin_inset Quotes erd
12816 \begin_inset Quotes eld
12820 \begin_inset Quotes erd
12823 are not able to do this.
12825 \begin_inset Flex Code
12828 \begin_layout Plain Layout
12834 is similar, but only the very first row of the paragraph is dynamic, while
12835 the others are static; this is used, for example, for descriptions.
12837 \begin_inset Flex Code
12840 \begin_layout Plain Layout
12846 means the margin is chosen in a way that the longest row of this paragraph
12847 fits to the right margin.
12848 This is used to typeset an address on the right edge of the page.
12851 \begin_layout Description
12852 \begin_inset Flex Code
12855 \begin_layout Plain Layout
12862 \begin_inset Flex Code
12865 \begin_layout Plain Layout
12874 \begin_inset Flex Code
12877 \begin_layout Plain Layout
12883 ] Whether fragile commands in this style should be
12884 \begin_inset Flex Code
12887 \begin_layout Plain Layout
12900 whether this command should itself be protected.)
12903 \begin_layout Description
12904 \begin_inset Flex Code
12907 \begin_layout Plain Layout
12914 \begin_inset Flex Code
12917 \begin_layout Plain Layout
12924 \begin_inset Flex Code
12927 \begin_layout Plain Layout
12935 ] Whether newlines are translated into LaTeX newlines (
12936 \begin_inset Flex Code
12939 \begin_layout Plain Layout
12950 The translation can be switched off to allow more comfortable LaTeX editing
12954 \begin_layout Description
12955 \begin_inset Flex Code
12958 \begin_layout Plain Layout
12965 \begin_inset Flex Code
12968 \begin_layout Plain Layout
12975 \begin_inset Flex Code
12978 \begin_layout Plain Layout
12986 ] If set to true, and if
12987 \begin_inset Flex Code
12990 \begin_layout Plain Layout
12997 \begin_inset Flex Code
13000 \begin_layout Plain Layout
13006 ) paragraphs are being indented, then the indentation of such a paragraph
13007 following one of this type will be suppressed.
13008 (So this will not affect the display of non-default paragraphs.)
13011 \begin_layout Description
13012 \begin_inset Flex Code
13015 \begin_layout Plain Layout
13021 Name of a style that has replaced this style.
13022 This is used to rename a style, while keeping backward compatibility.
13025 \begin_layout Description
13027 \change_deleted -712698321 1353679722
13028 \begin_inset Flex Code
13031 \begin_layout Plain Layout
13038 \begin_inset Flex Code
13041 \begin_layout Plain Layout
13047 ] The number of optional arguments that can be used with this style.
13048 This is useful for things like section headings, and only makes sense with
13050 Note that, on output, the optional arguments will all precede any required
13051 arguments (see below).
13052 So one can have constructs like:
13056 \begin_layout LyX-Code
13058 \change_deleted -712698321 1353679722
13061 mycmd[opt1]{req1}{contents of paragraph}
13064 \begin_layout Standard
13066 \change_deleted -712698321 1353679722
13067 but one cannot have things like:
13070 \begin_layout LyX-Code
13072 \change_deleted -712698321 1353679722
13075 mycmd[opt1]{req1}[opt2]{contents of paragraph}
13078 \begin_layout Standard
13080 \change_deleted -712698321 1353679722
13081 at least, not without ERT (with which you can have anything).
13088 \begin_layout Description
13089 \begin_inset Flex Code
13092 \begin_layout Plain Layout
13099 \begin_inset Flex Code
13102 \begin_layout Plain Layout
13111 \begin_inset Flex Code
13114 \begin_layout Plain Layout
13120 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
13121 output, but only by a line break; together with
13122 \begin_inset Flex Code
13125 \begin_layout Plain Layout
13131 , this allows to emulate a plain text editor (like the ERT inset).
13134 \begin_layout Description
13135 \begin_inset Flex Code
13138 \begin_layout Plain Layout
13145 \begin_inset Flex Code
13148 \begin_layout Plain Layout
13154 ] The indent of the very first line of a paragraph.
13156 \begin_inset Flex Code
13159 \begin_layout Plain Layout
13165 will be fixed for a certain style.
13166 The exception is the default style, since the indentation for these paragraphs
13167 can be prohibited with
13168 \begin_inset Flex Code
13171 \begin_layout Plain Layout
13179 \begin_inset Flex Code
13182 \begin_layout Plain Layout
13188 style paragraphs inside environments use the
13189 \begin_inset Flex Code
13192 \begin_layout Plain Layout
13198 of the environment, not their native one.
13200 \begin_inset Flex Code
13203 \begin_layout Plain Layout
13209 paragraphs inside an enumeration are not indented.
13212 \begin_layout Description
13213 \begin_inset Flex Code
13216 \begin_layout Plain Layout
13223 \begin_inset Flex Code
13226 \begin_layout Plain Layout
13232 ] The vertical space between two paragraphs of this style.
13235 \begin_layout Description
13236 \begin_inset Flex Code
13239 \begin_layout Plain Layout
13246 \begin_inset Flex Code
13249 \begin_layout Plain Layout
13255 ] LyX allows the user to choose either
13256 \begin_inset Quotes eld
13260 \begin_inset Quotes erd
13264 \begin_inset Quotes eld
13268 \begin_inset Quotes erd
13271 to typeset a document.
13273 \begin_inset Quotes eld
13277 \begin_inset Quotes erd
13280 is chosen, this value is completely ignored.
13282 \begin_inset Quotes eld
13286 \begin_inset Quotes erd
13289 is chosen, the parindent of a LaTeXtype
13290 \begin_inset Quotes eld
13294 \begin_inset Quotes erd
13297 style is ignored and all paragraphs are separated by this parskip argument.
13298 The vertical space is calculated with
13299 \begin_inset Flex Code
13302 \begin_layout Plain Layout
13304 \begin_inset space ~
13313 \begin_inset Flex Code
13316 \begin_layout Plain Layout
13322 is the height of a row with the normal font.
13323 This way, the look stays the same with different screen fonts.
13326 \begin_layout Description
13327 \begin_inset Flex Code
13330 \begin_layout Plain Layout
13337 \begin_inset Flex Code
13340 \begin_layout Plain Layout
13349 \begin_inset Flex Code
13352 \begin_layout Plain Layout
13358 ] Whether the contents of this paragraph should be output in raw form, meaning
13359 without special translations that LaTeX would require.
13362 \begin_layout Description
13363 \begin_inset Flex Code
13366 \begin_layout Plain Layout
13372 Information to be included in the LaTeX preamble when this style is used.
13373 Used to define macros, load packages, etc., required by this particular
13376 \begin_inset Quotes eld
13380 \begin_inset Flex Code
13383 \begin_layout Plain Layout
13390 \begin_inset Quotes erd
13396 \begin_layout Description
13397 \begin_inset Flex Code
13400 \begin_layout Plain Layout
13407 \begin_inset Flex Code
13410 \begin_layout Plain Layout
13416 ] The prefix to use when creating labels referring to paragraphs of this
13418 This allows the use of formatted references.
13421 \begin_layout Description
13423 \change_deleted -712698321 1353681258
13424 \begin_inset Flex Code
13427 \begin_layout Plain Layout
13434 \begin_inset Flex Code
13437 \begin_layout Plain Layout
13443 ] The number of required arguments that the LaTeX command or environment
13444 corresponding to this style expects.
13445 In the case of a command, these are required arguments
13449 that associated with the content of the paragraph itself.
13450 These do not actually have to be provided: LyX will output empty arguments
13452 Note that optional arguments will be output before required arguments.
13453 See the discussion of the
13454 \begin_inset Flex Code
13457 \begin_layout Plain Layout
13463 tag above for more information.
13468 \begin_layout Description
13469 \begin_inset Flex Code
13472 \begin_layout Plain Layout
13479 \begin_inset Flex Code
13482 \begin_layout Plain Layout
13488 ] Whether the style requires the feature
13489 \begin_inset Flex Code
13492 \begin_layout Plain Layout
13499 See the description of
13500 \begin_inset Flex Code
13503 \begin_layout Plain Layout
13510 \begin_inset CommandInset ref
13511 LatexCommand pageref
13512 reference "des:FreeSpacing"
13516 ) for information on `features'.
13518 \change_inserted -712698321 1353693134
13522 \begin_layout Description
13524 \change_inserted -712698321 1353693371
13525 \begin_inset Flex Code
13528 \begin_layout Plain Layout
13530 \change_inserted -712698321 1353693146
13539 \begin_inset Flex Code
13542 \begin_layout Plain Layout
13544 \change_inserted -712698321 1353693235
13553 \begin_inset Flex Code
13556 \begin_layout Plain Layout
13558 \change_inserted -712698321 1353693235
13564 ] Resets the LaTeX arguments of this style (as defined via the
13565 \begin_inset Flex Code
13568 \begin_layout Plain Layout
13570 \change_inserted -712698321 1353693371
13579 This is useful if you have copied a style via
13580 \begin_inset Flex Code
13583 \begin_layout Plain Layout
13585 \change_inserted -712698321 1353693302
13593 , but you do not want to inherit its (required and optional) arguments.
13598 \begin_layout Description
13600 \change_inserted -712698321 1353866881
13601 \begin_inset Flex Code
13604 \begin_layout Plain Layout
13606 \change_inserted -712698321 1353866876
13613 \begin_inset Flex Code
13616 \begin_layout Plain Layout
13618 \change_inserted -712698321 1353866873
13624 ] A string that is put at the end of the layout content.
13627 \begin_layout Description
13628 \begin_inset Flex Code
13631 \begin_layout Plain Layout
13638 \begin_inset Flex Code
13641 \begin_layout Plain Layout
13648 \begin_inset Flex Code
13651 \begin_layout Plain Layout
13660 \begin_layout Description
13661 \begin_inset Flex Code
13664 \begin_layout Plain Layout
13671 \begin_inset Flex Code
13674 \begin_layout Plain Layout
13679 , onehalf, double, other
13688 ] This defines what the default spacing should be in the style.
13690 \begin_inset Flex Code
13693 \begin_layout Plain Layout
13700 \begin_inset Flex Code
13703 \begin_layout Plain Layout
13710 \begin_inset Flex Code
13713 \begin_layout Plain Layout
13719 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
13720 If you specify the argument
13721 \begin_inset Flex Code
13724 \begin_layout Plain Layout
13730 , then you should also provide a numerical argument which will be the actual
13732 Note that, contrary to other parameters,
13733 \begin_inset Flex Code
13736 \begin_layout Plain Layout
13742 implies the generation of specific LaTeX code, using the package
13745 \begin_inset Flex Code
13748 \begin_layout Plain Layout
13757 \begin_layout Description
13758 \begin_inset Flex Code
13761 \begin_layout Plain Layout
13768 \begin_inset Flex Code
13771 \begin_layout Plain Layout
13778 \begin_inset Flex Code
13781 \begin_layout Plain Layout
13789 ] Spellcheck paragraphs of this style.
13793 \begin_layout Description
13794 \begin_inset Flex Code
13797 \begin_layout Plain Layout
13803 The font used for the text body .
13805 \begin_inset CommandInset ref
13807 reference "sub:Font-description"
13814 \begin_layout Description
13815 \begin_inset Flex Code
13818 \begin_layout Plain Layout
13827 \begin_inset Flex Code
13830 \begin_layout Plain Layout
13840 The level of the style in the table of contents.
13841 This is used for automatic numbering of section headings.
13844 \begin_layout Description
13845 \begin_inset Flex Code
13848 \begin_layout Plain Layout
13855 \begin_inset Flex Code
13858 \begin_layout Plain Layout
13864 ] The vertical space with which the very first of a chain of paragraphs
13865 with this style is separated from the previous paragraph.
13866 If the previous paragraph has another style, the separations are not simply
13867 added, but the maximum is taken.
13870 \begin_layout Subsection
13871 \begin_inset CommandInset label
13877 Internationalization of Paragraph Styles
13880 \begin_layout Standard
13881 LyX has long supported internationalization of layout information, but,
13882 until version 2.0, this applied only to the user interface and not to, say,
13884 Thus, French authors were forced to resort to ugly hacks if they wanted
13889 1' instead of `Theorem 1'.
13890 Thanks to Georg Baum, that is no longer the case.
13893 \begin_layout Standard
13895 \begin_inset Flex Code
13898 \begin_layout Plain Layout
13904 defines text that is to appear in the typeset document, it may use
13905 \begin_inset Flex Code
13908 \begin_layout Plain Layout
13915 \begin_inset Flex Code
13918 \begin_layout Plain Layout
13924 to support non-English and even multi-language documents correctly.
13925 The following excerpt (from the
13926 \begin_inset Flex Code
13929 \begin_layout Plain Layout
13935 file) shows how this works:
13938 \begin_layout LyX-Code
13943 \begin_layout LyX-Code
13946 theoremstyle{remark}
13949 \begin_layout LyX-Code
13952 newtheorem{claim}[thm]{
13959 \begin_layout LyX-Code
13963 \begin_layout LyX-Code
13967 \begin_layout LyX-Code
13972 claimname}{_(Claim)}
13975 \begin_layout LyX-Code
13979 \begin_layout LyX-Code
13983 \begin_layout LyX-Code
13992 claimname}{_(Claim)}}
13995 \begin_layout LyX-Code
14000 \begin_layout Standard
14001 In principle, any legal LaTeX may appear in the
14002 \begin_inset Flex Code
14005 \begin_layout Plain Layout
14012 \begin_inset Flex Code
14015 \begin_layout Plain Layout
14021 tags, but in practice they will typically look as they do here.
14022 The key to correct translation of the typeset text is the definition of
14024 \begin_inset Flex Code
14027 \begin_layout Plain Layout
14036 \begin_inset Flex Code
14039 \begin_layout Plain Layout
14051 \begin_layout Standard
14053 \begin_inset Flex Code
14056 \begin_layout Plain Layout
14062 tag provides for internationalization based upon the overall language of
14064 The contents of the tag will be included in the preamble, just as with
14066 \begin_inset Flex Code
14069 \begin_layout Plain Layout
14076 What makes it special is the use of the
14077 \begin_inset Quotes eld
14081 \begin_inset Quotes erd
14085 \begin_inset Flex Code
14088 \begin_layout Plain Layout
14094 , which will be replaced, when LyX produces LaTeX output, with the translation
14095 of its argument into the document language.
14098 \begin_layout Standard
14100 \begin_inset Flex Code
14103 \begin_layout Plain Layout
14109 tag is more complex, since it is meant to provide support for multi-language
14110 documents and so offers an interface to the
14111 \begin_inset Flex Code
14114 \begin_layout Plain Layout
14121 Its contents will be added to the preamble once for each language that
14122 appears in the document.
14123 In this case, the argument to
14124 \begin_inset Flex Code
14127 \begin_layout Plain Layout
14133 will be replaced with its translation into the language in question; the
14135 \begin_inset Flex Code
14138 \begin_layout Plain Layout
14144 is replaced by the language name (as used by the babel package).
14147 \begin_layout Standard
14148 A German document that also included a French section would thus have the
14149 following in the preamble:
14152 \begin_layout LyX-Code
14161 claimname}{Affirmation}}
14169 claimname}{Behauptung}}
14173 claimname}{Behauptung}
14176 \begin_layout Standard
14178 \begin_inset Flex Code
14181 \begin_layout Plain Layout
14187 will then conspire to produce the correct text in the output.
14190 \begin_layout Standard
14191 One important point to note here is that the translations are provided by
14192 LyX itself, through the
14193 \change_inserted -195340706 1334775793
14195 \begin_inset Flex Code
14198 \begin_layout Plain Layout
14200 \change_inserted -195340706 1334775793
14207 \change_deleted -195340706 1334775793
14208 same mechanism it uses for internationalization of the user interface
14211 This means, in effect, that
14212 \begin_inset Flex Code
14215 \begin_layout Plain Layout
14222 \begin_inset Flex Code
14225 \begin_layout Plain Layout
14231 are really only of use in layout files that are provided with LyX, since
14232 text entered in user-created layout files will not be seen by LyX's internation
14234 \change_inserted -195340706 1334775793
14236 \begin_inset Flex Code
14239 \begin_layout Plain Layout
14241 \change_inserted -195340706 1334775793
14247 file is modified accordingly
14250 That said, however, any layout created with the intention that it will
14251 be included with LyX should use these tags where appropriate.
14253 \change_inserted -195340706 1334775793
14254 Please note that the paragraph style translations provided by LyX will
14255 never change with a minor update (e.g.
14256 from version 2.1.x to 2.1.y).
14257 It is however quite likely that a major update (e.g.
14258 from 2.0.x to 2.1.y) will introduce new translations or corrections.
14263 \begin_layout Subsection
14265 \begin_inset CommandInset label
14274 \begin_layout Standard
14275 Since version 1.3.0 of LyX, it is has been both possible and necessary to
14276 define the floats (
14277 \begin_inset Flex MenuItem
14280 \begin_layout Plain Layout
14287 \begin_inset Flex MenuItem
14290 \begin_layout Plain Layout
14296 , \SpecialChar \ldots{}
14297 ) in the text class itself.
14298 Standard floats are included in the file
14299 \begin_inset Flex Code
14302 \begin_layout Plain Layout
14308 , so you may have to do no more than add
14311 \begin_layout LyX-Code
14312 Input stdfloats.inc
14315 \begin_layout Standard
14316 to your layout file.
14317 If you want to implement a text class that proposes some other float types
14318 (like the AGU class bundled with LyX), the information below will hopefully
14322 \begin_layout Description
14323 \begin_inset Flex Code
14326 \begin_layout Plain Layout
14333 \begin_inset Flex Code
14336 \begin_layout Plain Layout
14343 \begin_inset Quotes erd
14347 \begin_inset Quotes erd
14350 ] The file name extension of an auxiliary file for the list of figures (or
14352 LaTeX writes the captions to this file.
14355 \begin_layout Description
14356 \begin_inset Flex Code
14359 \begin_layout Plain Layout
14366 \begin_inset Flex Code
14369 \begin_layout Plain Layout
14376 \begin_inset Quotes erd
14380 \begin_inset Quotes erd
14383 ] The string that will be used in the menus and also for the caption.
14384 This is translated to the current language if babel is used.
14387 \begin_layout Description
14388 \begin_inset Flex Code
14391 \begin_layout Plain Layout
14397 These are used for XHTML output.
14399 \begin_inset CommandInset ref
14401 reference "sec:Tags-for-XHTML"
14408 \begin_layout Description
14409 \begin_inset Flex Code
14412 \begin_layout Plain Layout
14421 \begin_inset Flex Code
14424 \begin_layout Plain Layout
14433 \begin_inset Flex Code
14436 \begin_layout Plain Layout
14442 ] Indicates whether the float is already defined in the document class or
14443 if we instead need to load
14444 \begin_inset Flex Code
14447 \begin_layout Plain Layout
14453 and use what it provides to define it on-the-fly.
14455 \begin_inset Flex Code
14458 \begin_layout Plain Layout
14465 \begin_inset Flex Code
14468 \begin_layout Plain Layout
14475 It should be set to
14476 \begin_inset Flex Code
14479 \begin_layout Plain Layout
14485 if the float is already defined by the LaTeX document class.
14488 \begin_layout Description
14489 \begin_inset Flex Code
14492 \begin_layout Plain Layout
14499 \begin_inset Flex Code
14502 \begin_layout Plain Layout
14509 \begin_inset Quotes erd
14513 \begin_inset Quotes erd
14516 ] The command used to generate a list of floats of this type; the leading
14519 ' should be omitted.
14525 \begin_inset Flex Code
14528 \begin_layout Plain Layout
14534 is false, since there is no standard way to generate this command.
14536 \begin_inset Flex Code
14539 \begin_layout Plain Layout
14545 is true, since in that case there is a standard way to define the command.
14548 \begin_layout Description
14549 \begin_inset Flex Code
14552 \begin_layout Plain Layout
14559 \begin_inset Flex Code
14562 \begin_layout Plain Layout
14569 \begin_inset Quotes erd
14573 \begin_inset Quotes erd
14576 ] A title for a list of floats of this kind (list of figures, tables, or
14578 It is used for the screen label within LyX; it is passed to LaTeX for use
14579 as the title there; and it is used as the title in XHTML output.
14580 It will be translated to the document language.
14583 \begin_layout Description
14584 \begin_inset Flex Code
14587 \begin_layout Plain Layout
14594 \begin_inset Flex Code
14597 \begin_layout Plain Layout
14604 \begin_inset Quotes erd
14608 \begin_inset Quotes erd
14611 ] This (optional) argument determines whether floats of this class will
14612 be numbered within some sectional unit of the document.
14613 For example, if within is equal to
14614 \begin_inset Flex Code
14617 \begin_layout Plain Layout
14623 , the floats will be numbered within chapters.
14627 \begin_layout Description
14628 \begin_inset Flex Code
14631 \begin_layout Plain Layout
14638 \begin_inset Flex Code
14641 \begin_layout Plain Layout
14648 \begin_inset Quotes erd
14652 \begin_inset Quotes erd
14655 ] The default placement for the given class of floats.
14656 The string should be as in standard LaTeX:
14657 \begin_inset Flex Code
14660 \begin_layout Plain Layout
14667 \begin_inset Flex Code
14670 \begin_layout Plain Layout
14677 \begin_inset Flex Code
14680 \begin_layout Plain Layout
14687 \begin_inset Flex Code
14690 \begin_layout Plain Layout
14696 for top, bottom, page, and here, respectively.
14700 \begin_layout Plain Layout
14701 Note that the order of these letters in the string is irrelevant, like in
14707 On top of that there is a new type,
14708 \begin_inset Flex Code
14711 \begin_layout Plain Layout
14717 , which does not really correspond to a float, since it means: put it
14718 \begin_inset Quotes eld
14722 \begin_inset Quotes erd
14726 Note however that the
14727 \begin_inset Flex Code
14730 \begin_layout Plain Layout
14736 specifier is special and, because of implementation details, cannot be
14737 used in non-built in float types.
14738 If you do not understand what this means, just use
14739 \begin_inset Quotes eld
14743 \begin_inset Flex Code
14746 \begin_layout Plain Layout
14753 \begin_inset Quotes erd
14759 \begin_layout Description
14760 \begin_inset Flex Code
14763 \begin_layout Plain Layout
14770 \begin_inset Flex Code
14773 \begin_layout Plain Layout
14779 ] The prefix to use when creating labels referring to floats of this type.
14780 This allows the use of formatted references.
14781 Note that you can remove any
14782 \begin_inset Flex Code
14785 \begin_layout Plain Layout
14791 set by a copied style by using the special value
14792 \begin_inset Quotes eld
14796 \begin_inset Quotes erd
14799 , which must be all caps.
14802 \begin_layout Description
14803 \begin_inset Flex Code
14806 \begin_layout Plain Layout
14813 \begin_inset Flex Code
14816 \begin_layout Plain Layout
14823 \begin_inset Quotes erd
14827 \begin_inset Quotes erd
14830 ] The style used when defining the float using
14831 \begin_inset Flex Code
14834 \begin_layout Plain Layout
14845 \begin_layout Description
14846 \begin_inset Flex Code
14849 \begin_layout Plain Layout
14856 \begin_inset Flex Code
14859 \begin_layout Plain Layout
14866 \begin_inset Quotes erd
14870 \begin_inset Quotes erd
14874 \begin_inset Quotes eld
14878 \begin_inset Quotes erd
14881 of the new class of floats, like program or algorithm.
14882 After the appropriate
14883 \begin_inset Flex Code
14886 \begin_layout Plain Layout
14895 \begin_inset Flex Code
14898 \begin_layout Plain Layout
14907 \begin_inset Flex Code
14910 \begin_layout Plain Layout
14921 \begin_layout Description
14922 \begin_inset Flex Code
14925 \begin_layout Plain Layout
14932 \begin_inset Flex Code
14935 \begin_layout Plain Layout
14942 \begin_inset Flex Code
14945 \begin_layout Plain Layout
14953 ] Tells us whether this float is defined using the facilities provided by
14955 \begin_inset Flex Code
14958 \begin_layout Plain Layout
14964 , either by the class file or a package, or on-the-fly by LyX itself.
14967 \begin_layout Standard
14968 Note that defining a float with type
14969 \begin_inset Flex Code
14972 \begin_layout Plain Layout
14980 automatically defines the corresponding counter with name
14981 \begin_inset Flex Code
14984 \begin_layout Plain Layout
14995 \begin_layout Subsection
14996 Flex insets and InsetLayout
14997 \begin_inset CommandInset label
14999 name "sub:Flex-insets-and"
15006 \begin_layout Standard
15007 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
15008 these are called Flex insets.
15012 \begin_layout Standard
15013 Flex insets come in three different kinds:
15016 \begin_layout Itemize
15018 \begin_inset Flex Code
15021 \begin_layout Plain Layout
15027 ): These define semantic markup corresponding to such LaTeX commands as
15029 \begin_inset Flex Code
15032 \begin_layout Plain Layout
15041 \begin_inset Flex Code
15044 \begin_layout Plain Layout
15055 \begin_layout Itemize
15057 \begin_inset Flex Code
15060 \begin_layout Plain Layout
15066 ): These can be used to define custom collapsible insets, similar to TeX
15067 code, footnote, and the like.
15068 An obvious example is an endnote inset, which is defined in the
15069 \begin_inset Flex Code
15072 \begin_layout Plain Layout
15081 \begin_layout Itemize
15083 \begin_inset Flex Code
15086 \begin_layout Plain Layout
15092 ): For use with DocBook classes.
15095 \begin_layout Standard
15096 Flex insets are defined using the
15097 \begin_inset Flex Code
15100 \begin_layout Plain Layout
15106 tag, which shall be explained in a moment.
15109 \begin_layout Standard
15111 \begin_inset Flex Code
15114 \begin_layout Plain Layout
15120 tag also serves another function: It can be used to customize the general
15121 layout of many different types of insets.
15123 \begin_inset Flex Code
15126 \begin_layout Plain Layout
15132 can be used to customize the layout parameters for footnotes, marginal
15133 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
15134 boxes, tables, algorithms, URLs, and optional arguments, as well as to
15135 define Flex insets.
15138 \begin_layout Standard
15140 \begin_inset Flex Code
15143 \begin_layout Plain Layout
15149 definition must begin with a line of the form:
15152 \begin_layout LyX-Code
15156 \begin_layout Standard
15158 \begin_inset Flex Code
15161 \begin_layout Plain Layout
15167 indicates the inset whose layout is being defined, and here there are
15168 \change_inserted 5863208 1334489266
15170 \change_deleted 5863208 1334489267
15176 \begin_layout Enumerate
15177 The layout for a pre-existing inset is being modified.
15178 In this case, can be
15179 \begin_inset Flex Code
15182 \begin_layout Plain Layout
15188 any one of the following:
15189 \begin_inset Flex Code
15192 \begin_layout Plain Layout
15199 \begin_inset Flex Code
15202 \begin_layout Plain Layout
15209 \begin_inset Flex Code
15212 \begin_layout Plain Layout
15219 \begin_inset Flex Code
15222 \begin_layout Plain Layout
15229 \begin_inset Flex Code
15232 \begin_layout Plain Layout
15239 \begin_inset Flex Code
15242 \begin_layout Plain Layout
15249 \begin_inset Flex Code
15252 \begin_layout Plain Layout
15259 \begin_inset Flex Code
15262 \begin_layout Plain Layout
15269 \begin_inset Flex Code
15272 \begin_layout Plain Layout
15279 \begin_inset Flex Code
15282 \begin_layout Plain Layout
15289 \begin_inset Flex Code
15292 \begin_layout Plain Layout
15299 \begin_inset Flex Code
15302 \begin_layout Plain Layout
15309 \begin_inset Flex Code
15312 \begin_layout Plain Layout
15319 \begin_inset Flex Code
15322 \begin_layout Plain Layout
15329 \begin_inset Flex Code
15332 \begin_layout Plain Layout
15339 \begin_inset Flex Code
15342 \begin_layout Plain Layout
15349 \begin_inset Flex Code
15352 \begin_layout Plain Layout
15359 \begin_inset Flex Code
15362 \begin_layout Plain Layout
15364 \change_deleted -712698321 1353866704
15368 \change_inserted -712698321 1353866707
15377 \begin_inset Flex Code
15380 \begin_layout Plain Layout
15387 \begin_inset Flex Code
15390 \begin_layout Plain Layout
15399 \begin_layout Enumerate
15400 The layout for a Flex inset is being defined.
15402 \begin_inset Flex Code
15405 \begin_layout Plain Layout
15411 must be of the form
15412 \begin_inset Quotes eld
15416 \begin_inset Flex Code
15419 \begin_layout Plain Layout
15426 \begin_inset Quotes erd
15430 \begin_inset Flex Code
15433 \begin_layout Plain Layout
15439 may be be any valid identifier not used by a pre-existing Flex inset.
15440 The identifier may include spaces, but in that case the whole thing must
15441 be wrapped in quotes.
15442 Note that the definition of a flex inset
15447 \begin_inset Flex Code
15450 \begin_layout Plain Layout
15456 entry, declaring which type of inset it defines.
15457 \change_inserted 5863208 1334489312
15461 \begin_layout Enumerate
15463 \change_inserted 5863208 1334492248
15464 The layout for user specific branch is being defined.
15466 \begin_inset Flex Code
15469 \begin_layout Plain Layout
15471 \change_inserted 5863208 1334489384
15477 must be of the form
15478 \begin_inset Quotes eld
15482 \begin_inset Flex Code
15485 \begin_layout Plain Layout
15487 \change_inserted 5863208 1334489392
15494 \begin_inset Quotes erd
15498 \begin_inset Flex Code
15501 \begin_layout Plain Layout
15503 \change_inserted 5863208 1334489384
15509 may be be any valid identifier of branch defined in user's document.
15510 The identifier may include spaces, but in that case the whole thing must
15511 be wrapped in quotes.
15512 The main purpose of this feature is to allow LaTeX wrapping around specific
15513 branches as user needs.
15518 \begin_layout Standard
15520 \begin_inset Flex Code
15523 \begin_layout Plain Layout
15529 definition can contain the following entries:
15532 \begin_layout Description
15534 \change_inserted -712698321 1353681390
15535 \begin_inset Flex Code
15538 \begin_layout Plain Layout
15540 \change_inserted -712698321 1353681344
15547 \begin_inset Flex Code
15550 \begin_layout Plain Layout
15552 \change_inserted -712698321 1353681344
15558 ] Defines argument number <int> of a command\SpecialChar \slash{}
15559 environment associated with
15560 the current layout.
15561 The definition must end with
15562 \begin_inset Flex Code
15565 \begin_layout Plain Layout
15567 \change_inserted -712698321 1353681344
15575 \begin_inset space ~
15579 \begin_inset CommandInset ref
15581 reference "sub:Paragraph-Styles"
15588 \begin_layout Description
15590 \change_inserted -195340706 1333913893
15591 \begin_inset Flex Code
15594 \begin_layout Plain Layout
15600 Preamble for changing languages.
15602 \begin_inset space ~
15606 \begin_inset CommandInset ref
15608 reference "sub:I18n"
15615 \begin_layout Description
15616 \begin_inset Flex Code
15619 \begin_layout Plain Layout
15625 The color for the inset's background.
15626 The valid colors are defined in
15627 \begin_inset Flex Code
15630 \begin_layout Plain Layout
15639 \begin_layout Description
15640 \begin_inset Flex Code
15643 \begin_layout Plain Layout
15650 \begin_inset Flex Code
15653 \begin_layout Plain Layout
15662 \begin_inset Flex Code
15665 \begin_layout Plain Layout
15671 ] Whether to use the content of the inset as the label, when the inset is
15676 \begin_layout Description
15677 \begin_inset Flex Code
15680 \begin_layout Plain Layout
15687 \begin_inset Flex Code
15690 \begin_layout Plain Layout
15696 Copies all the features of an existing style into the current one.
15700 \begin_layout Description
15701 \begin_inset Flex Code
15704 \begin_layout Plain Layout
15711 \begin_inset Flex Code
15714 \begin_layout Plain Layout
15723 \begin_inset Flex Code
15726 \begin_layout Plain Layout
15732 ] Indicates whether the user may employ the Paragraph Settings dialog to
15733 customize the paragraph.
15736 \begin_layout Description
15737 \begin_inset Flex Code
15740 \begin_layout Plain Layout
15747 \begin_inset Flex Code
15750 \begin_layout Plain Layout
15757 \begin_inset Flex Code
15760 \begin_layout Plain Layout
15767 \begin_inset Flex Code
15770 \begin_layout Plain Layout
15776 , describing the rendering style used for the inset's frame and buttons.
15777 Footnotes generally use
15778 \begin_inset Flex Code
15781 \begin_layout Plain Layout
15787 , ERT insets generally
15788 \begin_inset Flex Code
15791 \begin_layout Plain Layout
15797 , and character styles
15798 \begin_inset Flex Code
15801 \begin_layout Plain Layout
15810 \begin_layout Description
15811 \begin_inset Flex Code
15814 \begin_layout Plain Layout
15821 \begin_inset Flex Code
15824 \begin_layout Plain Layout
15831 \begin_inset Flex Code
15834 \begin_layout Plain Layout
15843 \begin_inset Flex Code
15846 \begin_layout Plain Layout
15853 \begin_inset Flex Code
15856 \begin_layout Plain Layout
15863 Indicates whether the environment will stand on its own in LaTeX output
15864 or will appear inline with the surrounding text.
15865 If set to false, it is supposed that the LaTeX environment ignores white
15866 space (including one newline character) after the
15867 \begin_inset Flex Code
15870 \begin_layout Plain Layout
15883 \begin_inset Flex Code
15886 \begin_layout Plain Layout
15902 \begin_layout Description
15903 \begin_inset Flex Code
15906 \begin_layout Plain Layout
15912 Required at the end of the InsetLayout declarations.
15915 \begin_layout Description
15916 \begin_inset Flex Code
15919 \begin_layout Plain Layout
15925 The font used for both the text body
15931 \begin_inset space ~
15935 \begin_inset CommandInset ref
15937 reference "sub:Font-description"
15942 Note that defining this font automatically defines the
15943 \begin_inset Flex Code
15946 \begin_layout Plain Layout
15952 to the same value, so define this first and define
15953 \begin_inset Flex Code
15956 \begin_layout Plain Layout
15962 later if you want them to be different.
15965 \begin_layout Description
15966 \begin_inset Flex Code
15969 \begin_layout Plain Layout
15976 \begin_inset Quotes eld
15980 \begin_inset Quotes erd
15983 language, leading to Left-to-Right (latin) output, e.
15984 \begin_inset space \thinspace{}
15988 \begin_inset space \space{}
15991 in TeX code or URL.
15995 \begin_layout Description
15996 \begin_inset Flex Code
15999 \begin_layout Plain Layout
16006 \begin_inset Flex Code
16009 \begin_layout Plain Layout
16018 \begin_inset Flex Code
16021 \begin_layout Plain Layout
16027 ] Indicates whether the
16028 \begin_inset Flex Code
16031 \begin_layout Plain Layout
16037 should be used or, instead, the user can change the paragraph style used
16042 \begin_layout Description
16043 \begin_inset Flex Code
16046 \begin_layout Plain Layout
16053 \begin_inset Flex Code
16056 \begin_layout Plain Layout
16065 \begin_inset Flex Code
16068 \begin_layout Plain Layout
16074 ] Usually LyX doesn't allow you to insert more than one space between words,
16075 since a space is considered as the separation between two words, not a
16076 character or symbol of its own.
16077 This is a very fine thing but sometimes annoying, for example, when typing
16078 program code or plain LaTeX code.
16080 \begin_inset Flex Code
16083 \begin_layout Plain Layout
16090 Note that LyX will create protected blanks for the additional blanks when
16091 in another mode than LaTeX-mode.
16095 \begin_layout Description
16096 \begin_inset Flex Code
16099 \begin_layout Plain Layout
16105 These tags control XHTML output.
16107 \begin_inset CommandInset ref
16109 reference "sec:Tags-for-XHTML"
16116 \begin_layout Description
16117 \begin_inset Flex Code
16120 \begin_layout Plain Layout
16127 \begin_inset Flex Code
16130 \begin_layout Plain Layout
16139 \begin_inset Flex Code
16142 \begin_layout Plain Layout
16148 ] Whether to include the contents of this inset in the strings generated
16149 for the `Outline' pane.
16150 One would not, for example, want the content of a footnote in a section
16151 header to be included in the TOC displayed in the outline, but one would
16152 normally want the content of a character style displayed.
16153 Default is false: not to include.
16156 \begin_layout Description
16157 \begin_inset Flex Code
16160 \begin_layout Plain Layout
16167 \begin_inset Flex Code
16170 \begin_layout Plain Layout
16179 \begin_inset Flex Code
16182 \begin_layout Plain Layout
16188 ] Usually LyX does not allow you to leave a paragraph empty, since it would
16189 lead to empty LaTeX output.
16190 There are some cases where this could be desirable however: in a letter
16191 template, the required fields can be provided as empty fields, so that
16192 people do not forget them; in some special classes, a style can be used
16193 as some kind of break, which does not contain actual text.
16197 \begin_layout Description
16198 \begin_inset Flex Code
16201 \begin_layout Plain Layout
16207 The font used for the label.
16209 \begin_inset space ~
16213 \begin_inset CommandInset ref
16215 reference "sub:Font-description"
16220 Note that this definition can never appear before
16221 \begin_inset Flex Code
16224 \begin_layout Plain Layout
16230 , lest it be ineffective.
16233 \begin_layout Description
16234 \begin_inset Flex Code
16237 \begin_layout Plain Layout
16243 What will be displayed on the button or elsewhere as the inset label.
16245 \begin_inset Flex Code
16248 \begin_layout Plain Layout
16255 \begin_inset Flex Code
16258 \begin_layout Plain Layout
16264 ) modify this label on the fly.
16267 \begin_layout Description
16269 \change_inserted -195340706 1333913893
16270 \begin_inset Flex Code
16273 \begin_layout Plain Layout
16279 Language dependent preamble.
16281 \begin_inset space ~
16285 \begin_inset CommandInset ref
16287 reference "sub:I18n"
16294 \begin_layout Description
16295 \begin_inset Flex Code
16298 \begin_layout Plain Layout
16304 The name of the corresponding LaTeX stuff.
16305 Either the environment or command name.
16308 \begin_layout Description
16309 \begin_inset Flex Code
16312 \begin_layout Plain Layout
16318 The optional parameter for the corresponding
16319 \begin_inset Flex Code
16322 \begin_layout Plain Layout
16328 stuff, including possible bracket pairs like
16329 \begin_inset Flex Code
16332 \begin_layout Plain Layout
16339 This parameter cannot be changed from within LyX.
16342 \begin_layout Description
16343 \begin_inset Flex Code
16346 \begin_layout Plain Layout
16353 \begin_inset Flex Code
16356 \begin_layout Plain Layout
16358 \change_deleted -712698321 1353867544
16365 Command, Environment,
16366 \change_inserted -712698321 1353867573
16368 \change_deleted -712698321 1353867557
16377 \begin_inset Flex Code
16380 \begin_layout Plain Layout
16382 \change_deleted -712698321 1353867564
16386 \change_deleted -712698321 1353867569
16394 ] How the style should be translated into LaTeX.
16398 \begin_layout Plain Layout
16399 \begin_inset Flex Code
16402 \begin_layout Plain Layout
16408 is perhaps a bit misleading, since these rules apply to SGML classes, too.
16409 Visit the SGML class files for specific examples.
16418 \begin_layout Itemize
16419 \begin_inset Flex Code
16422 \begin_layout Plain Layout
16424 \change_deleted -712698321 1353867582
16426 \change_inserted -712698321 1353867583
16434 means nothing special.
16438 \begin_layout Itemize
16439 \begin_inset Flex Code
16442 \begin_layout Plain Layout
16449 \begin_inset Flex Code
16452 \begin_layout Plain Layout
16459 {\SpecialChar \ldots{}
16468 \begin_layout Itemize
16469 \begin_inset Flex Code
16472 \begin_layout Plain Layout
16479 \begin_inset Flex Code
16482 \begin_layout Plain Layout
16489 }\SpecialChar \ldots{}
16505 \begin_layout Itemize
16507 \change_deleted -712698321 1353867600
16508 \begin_inset Flex Code
16511 \begin_layout Plain Layout
16518 \begin_inset Flex Code
16521 \begin_layout Plain Layout
16528 \begin_inset Flex Code
16531 \begin_layout Plain Layout
16539 is generated for each paragraph of this environment.
16543 \begin_layout Itemize
16545 \change_deleted -712698321 1353867600
16546 \begin_inset Flex Code
16549 \begin_layout Plain Layout
16556 \begin_inset Flex Code
16559 \begin_layout Plain Layout
16566 \begin_inset Flex Code
16569 \begin_layout Plain Layout
16575 is passed as an argument to the environment.
16577 \begin_inset Flex Code
16580 \begin_layout Plain Layout
16586 can be defined in the
16587 \begin_inset Flex MenuItem
16590 \begin_layout Plain Layout
16595 \SpecialChar \menuseparator
16601 \begin_inset space ~
16615 \begin_layout Standard
16616 Putting the last few things together, the LaTeX output will be either:
16619 \begin_layout LyX-Code
16622 latexname[latexparam]{\SpecialChar \ldots{}
16626 \begin_layout Standard
16630 \begin_layout LyX-Code
16633 begin{latexname}[latexparam] \SpecialChar \ldots{}
16639 \begin_layout Standard
16640 depending upon the LaTeX type.
16644 \begin_layout Description
16646 \change_inserted -712698321 1353866797
16647 \begin_inset Flex Code
16650 \begin_layout Plain Layout
16652 \change_inserted -712698321 1353866742
16661 \begin_inset Flex Code
16664 \begin_layout Plain Layout
16666 \change_inserted -712698321 1353866752
16672 ] A string that is put at the beginning of the layout content.
16677 \begin_layout Description
16678 \begin_inset Flex Code
16681 \begin_layout Plain Layout
16688 \begin_inset Flex Code
16691 \begin_layout Plain Layout
16698 \begin_inset Flex Code
16701 \begin_layout Plain Layout
16708 \begin_inset Flex Code
16711 \begin_layout Plain Layout
16718 \begin_inset Flex Code
16721 \begin_layout Plain Layout
16727 (indicating a dummy definition ending definitions of charstyles, etc).
16728 This entry is required in and is only meaningful for Flex insets.
16729 Among other things, it determines on which menu this inset will appear.
16731 \begin_inset Flex Code
16734 \begin_layout Plain Layout
16741 \begin_inset Flex Code
16744 \begin_layout Plain Layout
16751 \begin_inset Flex Code
16754 \begin_layout Plain Layout
16762 \begin_inset Flex Code
16765 \begin_layout Plain Layout
16771 can be set to true for charstyle insets, if you wish, by setting it
16776 \begin_inset Flex Code
16779 \begin_layout Plain Layout
16788 \begin_layout Description
16789 \begin_inset Flex Code
16792 \begin_layout Plain Layout
16799 \begin_inset Flex Code
16802 \begin_layout Plain Layout
16811 \begin_inset Flex Code
16814 \begin_layout Plain Layout
16820 ] Whether multiple paragraphs are permitted in this inset.
16822 \begin_inset Flex Code
16825 \begin_layout Plain Layout
16831 to the same value and
16832 \begin_inset Flex Code
16835 \begin_layout Plain Layout
16841 to the opposite value.
16842 These can be reset to other values, if they are used
16847 \begin_inset Flex Code
16850 \begin_layout Plain Layout
16860 \begin_layout Description
16861 \begin_inset Flex Code
16864 \begin_layout Plain Layout
16871 \begin_inset Flex Code
16874 \begin_layout Plain Layout
16883 \begin_inset Flex Code
16886 \begin_layout Plain Layout
16892 ] Whether fragile commands in this inset should be
16893 \begin_inset Flex Code
16896 \begin_layout Plain Layout
16909 whether the command should itself be protected.) Default is false.
16912 \begin_layout Description
16913 \begin_inset Flex Code
16916 \begin_layout Plain Layout
16923 \begin_inset Flex Code
16926 \begin_layout Plain Layout
16935 \begin_inset Flex Code
16938 \begin_layout Plain Layout
16944 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
16945 output, but only by a line break; together with
16946 \begin_inset Flex Code
16949 \begin_layout Plain Layout
16955 , this allows to emulate a plain text editor (like the ERT inset).
16959 \begin_layout Description
16960 \begin_inset Flex Code
16963 \begin_layout Plain Layout
16970 \begin_inset Flex Code
16973 \begin_layout Plain Layout
16982 \begin_inset Flex Code
16985 \begin_layout Plain Layout
16991 ] Whether the contents of this paragraph should be output in raw form, meaning
16992 without special translations that LaTeX would require.
16995 \begin_layout Description
16996 \begin_inset Flex Code
16999 \begin_layout Plain Layout
17005 Information to be included in the LaTeX preamble when this style is used.
17006 Used to define macros, load packages, etc., required by this particular
17009 \begin_inset Quotes eld
17013 \begin_inset Flex Code
17016 \begin_layout Plain Layout
17023 \begin_inset Quotes erd
17029 \begin_layout Description
17030 \begin_inset Flex Code
17033 \begin_layout Plain Layout
17040 \begin_inset Flex Code
17043 \begin_layout Plain Layout
17049 ] The prefix to use when creating labels referring to insets of this type.
17050 This allows the use of formatted references.
17053 \begin_layout Description
17054 \begin_inset Flex Code
17057 \begin_layout Plain Layout
17064 \begin_inset Flex Code
17067 \begin_layout Plain Layout
17073 ] Whether the style requires the feature
17074 \begin_inset Flex Code
17077 \begin_layout Plain Layout
17084 See the description of
17085 \begin_inset Flex Code
17088 \begin_layout Plain Layout
17095 \begin_inset CommandInset ref
17096 LatexCommand pageref
17097 reference "des:FreeSpacing"
17101 ) for information on `features'.
17105 \begin_layout Description
17106 \begin_inset Flex Code
17109 \begin_layout Plain Layout
17116 \begin_inset Flex Code
17119 \begin_layout Plain Layout
17126 \begin_inset Flex Code
17129 \begin_layout Plain Layout
17137 ] Whether this inset should use the font of its surrounding environment
17139 Default is true: uses its own.
17140 \change_inserted -712698321 1353866806
17144 \begin_layout Description
17146 \change_inserted -712698321 1353866814
17147 \begin_inset Flex Code
17150 \begin_layout Plain Layout
17152 \change_inserted -712698321 1353866810
17159 \begin_inset Flex Code
17162 \begin_layout Plain Layout
17164 \change_inserted -712698321 1353866806
17170 ] A string that is put at the end of the layout content.
17175 \begin_layout Description
17176 \begin_inset Flex Code
17179 \begin_layout Plain Layout
17186 \begin_inset Flex Code
17189 \begin_layout Plain Layout
17196 \begin_inset Flex Code
17199 \begin_layout Plain Layout
17207 ] Spellcheck the contents of this inset.
17211 \begin_layout Subsection
17213 \begin_inset CommandInset label
17215 name "sub:Counters"
17222 \begin_layout Standard
17223 Since version 1.3.0 of LyX, it is both possible and necessary to define the
17225 \begin_inset Flex MenuItem
17228 \begin_layout Plain Layout
17235 \begin_inset Flex MenuItem
17238 \begin_layout Plain Layout
17244 , \SpecialChar \ldots{}
17245 ) in the text class itself.
17246 The standard counters are defined in the file
17247 \begin_inset Flex Code
17250 \begin_layout Plain Layout
17256 , so you may have to do no more than add
17259 \begin_layout LyX-Code
17260 Input stdcounters.inc
17263 \begin_layout Standard
17264 to your layout file to get them to work.
17265 But if you want to define custom counters, then you can do so.
17266 The counter declaration must begin with:
17269 \begin_layout LyX-Code
17270 Counter CounterName
17273 \begin_layout Standard
17275 \begin_inset Flex Code
17278 \begin_layout Plain Layout
17284 ' is replaced by the name of the counter.
17285 And it must end with
17286 \begin_inset Quotes eld
17290 \begin_inset Flex Code
17293 \begin_layout Plain Layout
17300 \begin_inset Quotes erd
17304 The following parameters can also be used:
17307 \begin_layout Description
17308 \begin_inset Flex Code
17311 \begin_layout Plain Layout
17318 \begin_inset Flex Code
17321 \begin_layout Plain Layout
17328 \begin_inset Quotes erd
17332 \begin_inset Quotes erd
17335 ] When defined, this string defines how the counter is displayed.
17336 Setting this value sets
17337 \begin_inset Flex Code
17340 \begin_layout Plain Layout
17341 LabelStringAppendix
17347 The following special constructs can be used in the string:
17351 \begin_layout Itemize
17352 \begin_inset Flex Code
17355 \begin_layout Plain Layout
17363 will be replaced by the expansion of the
17364 \begin_inset Flex Code
17367 \begin_layout Plain Layout
17374 \begin_inset Flex Code
17377 \begin_layout Plain Layout
17378 LabelStringAppendix
17384 \begin_inset Flex Code
17387 \begin_layout Plain Layout
17397 \begin_layout Itemize
17398 counter values can be expressed using LaTeX-like macros
17399 \begin_inset Flex Code
17402 \begin_layout Plain Layout
17419 \begin_inset Flex Code
17422 \begin_layout Plain Layout
17434 \begin_layout Plain Layout
17444 Actually, the situation is a bit more complicated: any
17463 other than those described below will produce arabic numerals.
17464 It would not be surprising to see this change in the future.
17470 \begin_inset Flex Code
17473 \begin_layout Plain Layout
17479 : 1, 2, 3,\SpecialChar \ldots{}
17481 \begin_inset Flex Code
17484 \begin_layout Plain Layout
17490 for lower-case letters: a, b, c, \SpecialChar \ldots{}
17492 \begin_inset Flex Code
17495 \begin_layout Plain Layout
17501 for upper-case letters: A, B, C, \SpecialChar \ldots{}
17503 \begin_inset Flex Code
17506 \begin_layout Plain Layout
17512 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
17514 \begin_inset Flex Code
17517 \begin_layout Plain Layout
17523 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
17525 \begin_inset Flex Code
17528 \begin_layout Plain Layout
17534 for hebrew numerals.
17538 \begin_layout Standard
17539 If LabelString is not defined, a default value is constructed as follows:
17540 if the counter has a master counter
17541 \begin_inset Flex Code
17544 \begin_layout Plain Layout
17551 \begin_inset Flex Code
17554 \begin_layout Plain Layout
17561 \begin_inset Flex Code
17564 \begin_layout Plain Layout
17574 is used; otherwise the string
17575 \begin_inset Flex Code
17578 \begin_layout Plain Layout
17589 \begin_layout Description
17590 \begin_inset Flex Code
17593 \begin_layout Plain Layout
17594 LabelStringAppendix
17600 \begin_inset Flex Code
17603 \begin_layout Plain Layout
17610 \begin_inset Quotes erd
17614 \begin_inset Quotes erd
17618 \begin_inset Flex Code
17621 \begin_layout Plain Layout
17627 , but for use in the Appendix.
17630 \begin_layout Description
17631 \begin_inset Flex Code
17634 \begin_layout Plain Layout
17641 \begin_inset Flex Code
17644 \begin_layout Plain Layout
17651 \begin_inset Quotes erd
17655 \begin_inset Quotes erd
17658 ] A format for use with formatted references to this counter.
17659 For example, one might want to have references to section numbers appear
17661 \begin_inset Quotes eld
17665 \begin_inset Quotes erd
17669 The string should contain
17670 \begin_inset Quotes eld
17674 \begin_inset Quotes erd
17678 This will be replaced by the counter number itself.
17679 So, for sections, it would be: Section ##.
17682 \begin_layout Description
17683 \begin_inset Flex Code
17686 \begin_layout Plain Layout
17693 \begin_inset Flex Code
17696 \begin_layout Plain Layout
17703 \begin_inset Quotes erd
17707 \begin_inset Quotes erd
17710 ] If this is set to the name of another counter, the present counter will
17711 be reset every time the other one is increased.
17713 \begin_inset Flex Code
17716 \begin_layout Plain Layout
17723 \begin_inset Flex Code
17726 \begin_layout Plain Layout
17735 \begin_layout Subsection
17737 \begin_inset CommandInset label
17739 name "sub:Font-description"
17746 \begin_layout Standard
17747 A font description looks like this:
17750 \begin_layout LyX-Code
17760 \begin_layout LyX-Code
17764 \begin_layout LyX-Code
17768 \begin_layout Standard
17769 The following commands are available:
17772 \begin_layout Description
17773 \begin_inset Flex Code
17776 \begin_layout Plain Layout
17783 \begin_inset Flex Code
17786 \begin_layout Plain Layout
17795 \begin_inset Flex Code
17798 \begin_layout Plain Layout
17805 \begin_inset Flex Code
17808 \begin_layout Plain Layout
17815 \begin_inset Flex Code
17818 \begin_layout Plain Layout
17825 \begin_inset Flex Code
17828 \begin_layout Plain Layout
17835 \begin_inset Flex Code
17838 \begin_layout Plain Layout
17845 \begin_inset Flex Code
17848 \begin_layout Plain Layout
17855 \begin_inset Flex Code
17858 \begin_layout Plain Layout
17865 \begin_inset Flex Code
17868 \begin_layout Plain Layout
17877 \begin_layout Description
17878 \begin_inset Flex Code
17881 \begin_layout Plain Layout
17888 \begin_inset Flex Code
17891 \begin_layout Plain Layout
17900 \begin_inset Flex Code
17903 \begin_layout Plain Layout
17910 \begin_inset Flex Code
17913 \begin_layout Plain Layout
17922 \begin_layout Description
17923 \begin_inset Flex Code
17926 \begin_layout Plain Layout
17933 \begin_inset Flex Code
17936 \begin_layout Plain Layout
17942 ] Valid arguments are:
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
17993 \begin_inset Flex Code
17996 \begin_layout Plain Layout
18003 \begin_inset Flex Code
18006 \begin_layout Plain Layout
18013 \begin_inset Flex Code
18016 \begin_layout Plain Layout
18023 \begin_inset Flex Code
18026 \begin_layout Plain Layout
18033 \begin_inset Flex Code
18036 \begin_layout Plain Layout
18043 \begin_inset Flex Code
18046 \begin_layout Plain Layout
18053 \begin_inset Flex Code
18056 \begin_layout Plain Layout
18063 Each of these turns on or off the corresponding attribute.
18065 \begin_inset Flex Code
18068 \begin_layout Plain Layout
18074 turns on emphasis, and
18075 \begin_inset Flex Code
18078 \begin_layout Plain Layout
18086 \begin_inset Newline newline
18089 If the latter seems puzzling, remember that the font settings for the present
18090 context are generally inherited from the surrounding context.
18092 \begin_inset Flex Code
18095 \begin_layout Plain Layout
18101 would turn off the emphasis that was anyway in effect, say, in a theorem
18105 \begin_layout Description
18106 \begin_inset Flex Code
18109 \begin_layout Plain Layout
18116 \begin_inset Flex Code
18119 \begin_layout Plain Layout
18128 \begin_inset Flex Code
18131 \begin_layout Plain Layout
18140 \begin_layout Description
18141 \begin_inset Flex Code
18144 \begin_layout Plain Layout
18151 \begin_inset Flex Code
18154 \begin_layout Plain Layout
18163 \begin_inset Flex Code
18166 \begin_layout Plain Layout
18173 \begin_inset Flex Code
18176 \begin_layout Plain Layout
18183 \begin_inset Flex Code
18186 \begin_layout Plain Layout
18195 \begin_layout Description
18196 \begin_inset Flex Code
18199 \begin_layout Plain Layout
18206 \begin_inset Flex Code
18209 \begin_layout Plain Layout
18216 \begin_inset Flex Code
18219 \begin_layout Plain Layout
18226 \begin_inset Flex Code
18229 \begin_layout Plain Layout
18238 \begin_inset Flex Code
18241 \begin_layout Plain Layout
18248 \begin_inset Flex Code
18251 \begin_layout Plain Layout
18258 \begin_inset Flex Code
18261 \begin_layout Plain Layout
18268 \begin_inset Flex Code
18271 \begin_layout Plain Layout
18278 \begin_inset Flex Code
18281 \begin_layout Plain Layout
18290 \begin_layout Subsection
18291 \begin_inset CommandInset label
18293 name "sub:Citation-format-description"
18297 Citation format description
18300 \begin_layout Standard
18302 \begin_inset Flex Code
18305 \begin_layout Plain Layout
18311 blocks are used to describe how bibliographic information should be displayed,
18312 both within LyX itself (in the citation dialog and in tooltips, for example)
18313 and in XHTML output.
18314 Such a block might look like this:
18317 \begin_layout LyX-Code
18321 \begin_layout LyX-Code
18325 \begin_layout LyX-Code
18329 \begin_layout LyX-Code
18333 \begin_layout Standard
18334 The individual lines define how the bibliographic information associated
18335 with an article or book, respectively, is to be displayed, and such a definitio
18336 n can be given for any `entry type' that might be present in a BibTeX file.
18337 LyX defines a default format in the source code that will be used if no
18338 specific definition has been given.
18339 LyX predefines several formats in the file
18340 \begin_inset Flex Code
18343 \begin_layout Plain Layout
18349 , which is included in most of LyX's document classes.
18352 \begin_layout Standard
18353 The definitions use a simple language that allows BibTeX keys to be replaced
18355 Keys should be enclosed in
18356 \begin_inset Flex Code
18359 \begin_layout Plain Layout
18366 \begin_inset Flex Code
18369 \begin_layout Plain Layout
18376 So a simple definition might look like this:
18379 \begin_layout LyX-Code
18381 \begin_inset Quotes eld
18385 \begin_inset Quotes erd
18391 \begin_layout Standard
18392 This would print the author, followed by a comma, followed by the title,
18393 in quotes, followed by a period.
18396 \begin_layout Standard
18397 Of course, sometimes you may want to print a key only if it exists.
18398 This can be done by using a conditional construction, such as:
18399 \begin_inset Flex Code
18402 \begin_layout Plain Layout
18404 \begin_inset space ~
18414 \begin_inset Flex Code
18417 \begin_layout Plain Layout
18423 key exists, then print
18424 \begin_inset Quotes eld
18428 \begin_inset space ~
18432 \begin_inset Quotes erd
18435 followed by the volume key.
18436 It is also possible to have an else clause in the conditional, such as:
18438 \begin_inset Flex Code
18441 \begin_layout Plain Layout
18442 {%author%[[%author%]][[%editor%, ed.]]}
18449 \begin_inset Flex Code
18452 \begin_layout Plain Layout
18458 key is printed if it exists; otherwise, the editor key is printed, followed
18460 \begin_inset Quotes eld
18464 \begin_inset space ~
18468 \begin_inset Quotes erd
18471 Note that the key is again enclosed in
18472 \begin_inset Flex Code
18475 \begin_layout Plain Layout
18481 signs; the entire conditional is enclosed in braces; and the if and else
18482 clauses are enclosed in double brackets,
18483 \begin_inset Quotes eld
18487 \begin_inset Flex Code
18490 \begin_layout Plain Layout
18497 \begin_inset Quotes eld
18501 \begin_inset Quotes eld
18505 \begin_inset Flex Code
18508 \begin_layout Plain Layout
18515 \begin_inset Quotes erd
18519 There must be no space between any of these.
18522 \begin_layout Standard
18523 There is one other piece of syntax available in definitions, which looks
18525 \begin_inset Flex Code
18528 \begin_layout Plain Layout
18535 This defines a piece of formatting information that is to be used when
18537 \begin_inset Quotes eld
18541 \begin_inset Quotes erd
18545 Obviously, we do not want to output HTML tags when writing plain text,
18546 so they should be wrapped in
18547 \begin_inset Quotes eld
18551 \begin_inset Quotes erd
18555 \begin_inset Quotes eld
18559 \begin_inset Quotes erd
18565 \begin_layout Standard
18566 Two special sorts of definitions are also possible in a
18567 \begin_inset Flex Code
18570 \begin_layout Plain Layout
18577 An example of the first would be:
18580 \begin_layout LyX-Code
18582 \begin_inset Quotes eld
18586 \begin_inset Quotes erd
18592 \begin_layout Standard
18593 This is an abbreviation, or macro, and it can be used by treating it as
18595 \begin_inset Flex Code
18598 \begin_layout Plain Layout
18606 \begin_inset Flex Code
18609 \begin_layout Plain Layout
18615 exactly as it would treat its definition.
18616 So, let us issue the obvious
18624 \begin_layout LyX-Code
18628 \begin_layout Standard
18629 or anything like it.
18630 LyX shouldn't go into an infinite loop, but it may go into a long one before
18634 \begin_layout Standard
18635 The second sort of special definition might look like this:
18638 \begin_layout LyX-Code
18642 \begin_layout Standard
18643 This defines a translatable piece of text, which allows relevant parts of
18644 the bibliography to be translated.
18645 It can be included in a definition by treating it as a key:
18646 \begin_inset Flex Code
18649 \begin_layout Plain Layout
18656 Several of these are predefined in
18657 \begin_inset Flex Code
18660 \begin_layout Plain Layout
18667 Note that these are not macros, in the sense just defined.
18668 They will not be expanded.
18671 \begin_layout Standard
18672 So here then is an example that use all these features:
18675 \begin_layout LyX-Code
18676 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
18679 \begin_layout Standard
18680 This defines a macro that prints the author, followed by a comma, if the
18682 \begin_inset Flex Code
18685 \begin_layout Plain Layout
18691 key is defined, or else prints the name of the editor, followed by the
18693 \begin_inset Flex Code
18696 \begin_layout Plain Layout
18702 or its translation (it is by default
18703 \begin_inset Quotes eld
18707 \begin_inset Quotes erd
18711 \begin_inset Flex Code
18714 \begin_layout Plain Layout
18721 Note that this is in fact defined in
18722 \begin_inset Flex Code
18725 \begin_layout Plain Layout
18731 , so you can use it in your own definitions, or re-definitions, if you load
18735 \begin_layout Section
18736 \begin_inset CommandInset label
18738 name "sec:Tags-for-XHTML"
18742 Tags for XHTML output
18745 \begin_layout Standard
18746 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
18747 by layout information.
18748 In general, LyX provides sensible defaults and, as mentioned earlier, it
18749 will even construct default CSS style rules from the other layout tags.
18750 For example, LyX will attempt to use the information provided in the
18751 \begin_inset Flex Code
18754 \begin_layout Plain Layout
18760 declaration for the Chapter style to write CSS that will appropriately
18761 format chapter headings.
18764 \begin_layout Standard
18765 In many cases, then, you may not have to do anything at all to get acceptable
18766 XHTML output for your own environments, custom insets, and so forth.
18767 But in some cases you will, and so LyX provides a number of layout tags
18768 that can be used to customize the XHTML and CSS that are generated.
18771 \begin_layout Standard
18772 Note that there are two tags,
18773 \begin_inset Flex Code
18776 \begin_layout Plain Layout
18783 \begin_inset Flex Code
18786 \begin_layout Plain Layout
18792 that may appear outside style and inset declarations.
18794 \begin_inset CommandInset ref
18796 reference "sub:General-text-class"
18800 for details on these.
18803 \begin_layout Subsection
18804 \begin_inset CommandInset label
18806 name "sub:Paragraph-Style-XHTML"
18813 \begin_layout Standard
18814 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
18815 dealing with a normal paragraph, a command, or an environment, where this
18816 is itself determined by the contents of the corresponding
18817 \begin_inset Flex Code
18820 \begin_layout Plain Layout
18830 \begin_layout Standard
18831 For a command or normal paragraph, the output XHTML has the following form:
18834 \begin_layout LyX-Code
18836 \begin_inset Quotes erd
18840 \begin_inset Quotes erd
18846 \begin_layout LyX-Code
18848 \begin_inset Quotes erd
18852 \begin_inset Quotes erd
18858 \begin_layout LyX-Code
18859 Contents of the paragraph.
18862 \begin_layout LyX-Code
18866 \begin_layout Standard
18867 The label tags are of course omitted if the paragraph does not have a label.
18870 \begin_layout Standard
18871 For an environment that is not some sort of list, the XHTML takes this form:
18874 \begin_layout LyX-Code
18876 \begin_inset Quotes erd
18880 \begin_inset Quotes erd
18886 \begin_layout LyX-Code
18888 \begin_inset Quotes erd
18892 \begin_inset Quotes erd
18896 \begin_inset Quotes erd
18900 \begin_inset Quotes erd
18903 >Environment Label</labeltag>First paragraph.</itemtag>
18906 \begin_layout LyX-Code
18907 <itemtag>Second paragraph.</itemtag>
18910 \begin_layout LyX-Code
18914 \begin_layout Standard
18915 Note that the label is output only for the first paragraph, as it should
18916 be for a theorem, for example.
18920 \begin_layout Standard
18921 For a list, we have one of these forms:
18924 \begin_layout LyX-Code
18926 \begin_inset Quotes erd
18930 \begin_inset Quotes erd
18936 \begin_layout LyX-Code
18938 \begin_inset Quotes erd
18942 \begin_inset Quotes erd
18946 \begin_inset Quotes erd
18950 \begin_inset Quotes erd
18953 >List Label</labeltag>First item.</itemtag>
18956 \begin_layout LyX-Code
18958 \begin_inset Quotes erd
18962 \begin_inset Quotes erd
18966 \begin_inset Quotes erd
18970 \begin_inset Quotes erd
18973 >List Label</labeltag>Second item.</itemtag>
18976 \begin_layout LyX-Code
18980 \begin_layout LyX-Code
18984 \begin_layout LyX-Code
18986 \begin_inset Quotes erd
18990 \begin_inset Quotes erd
18996 \begin_layout LyX-Code
18998 \begin_inset Quotes erd
19002 \begin_inset Quotes erd
19005 >List Label</labeltag><itemtag attr=
19006 \begin_inset Quotes erd
19010 \begin_inset Quotes erd
19013 >First item.</itemtag>
19016 \begin_layout LyX-Code
19018 \begin_inset Quotes erd
19022 \begin_inset Quotes erd
19025 >List Label</labeltag><itemtag attr=
19026 \begin_inset Quotes erd
19030 \begin_inset Quotes erd
19033 >Second item.</itemtag>
19036 \begin_layout LyX-Code
19040 \begin_layout Standard
19041 Note the different orders of
19042 \begin_inset Flex Code
19045 \begin_layout Plain Layout
19052 \begin_inset Flex Code
19055 \begin_layout Plain Layout
19062 Which order we get depends upon the setting of
19063 \begin_inset Flex Code
19066 \begin_layout Plain Layout
19073 \begin_inset Flex Code
19076 \begin_layout Plain Layout
19082 is false (the default), you get the first of these, with the label within
19083 the item; if true, you get the second, with the label outside the item.
19086 \begin_layout Standard
19087 The specific tags and attributes output for each paragraph type can be controlle
19088 d by means of the layout tags we are about to describe.
19089 As mentioned earlier, however, LyX uses sensible defaults for many of these,
19090 so you often may not need to do very much to get good XHTML output.
19091 Think of the available tags as there so you can tweak things to your liking.
19094 \begin_layout Description
19095 \begin_inset Flex Code
19098 \begin_layout Plain Layout
19105 \begin_inset Flex Code
19108 \begin_layout Plain Layout
19114 ] Specifies attribute information to be output with the main tag.
19116 \begin_inset Quotes eld
19120 \begin_inset Flex Code
19123 \begin_layout Plain Layout
19130 \begin_inset Quotes erd
19134 By default, LyX will output
19135 \begin_inset Quotes eld
19139 \begin_inset Flex Code
19142 \begin_layout Plain Layout
19149 \begin_inset Quotes erd
19153 \begin_inset Flex Code
19156 \begin_layout Plain Layout
19162 is the LyX name of the layout, made lowercase, for example: chapter.
19167 contain any style information.
19169 \begin_inset Flex Code
19172 \begin_layout Plain Layout
19181 \begin_layout Description
19182 \begin_inset Flex Code
19185 \begin_layout Plain Layout
19192 \begin_inset Flex Code
19195 \begin_layout Plain Layout
19205 ] Whether to output the default CSS information LyX generates for this layout,
19206 even if additional information is explicitly provided via
19207 \begin_inset Flex Code
19210 \begin_layout Plain Layout
19218 \begin_inset Flex Code
19221 \begin_layout Plain Layout
19227 allows you to alter or augment the generated CSS, rather than to override
19230 \begin_inset Flex Code
19233 \begin_layout Plain Layout
19242 \begin_layout Description
19243 \begin_inset Flex Code
19246 \begin_layout Plain Layout
19253 \begin_inset Flex Code
19256 \begin_layout Plain Layout
19262 ] The tag to be used for individual paragraphs of environments, replacing
19264 \begin_inset Flex Code
19267 \begin_layout Plain Layout
19273 in the examples above.
19275 \begin_inset Flex Code
19278 \begin_layout Plain Layout
19287 \begin_layout Description
19288 \begin_inset Flex Code
19291 \begin_layout Plain Layout
19298 \begin_inset Flex Code
19301 \begin_layout Plain Layout
19307 ] Attributes for the item tag.
19309 \begin_inset Quotes eld
19313 \begin_inset Flex Code
19316 \begin_layout Plain Layout
19317 class=`layoutname_item'
19323 \begin_inset Quotes erd
19331 contain any style information.
19333 \begin_inset Flex Code
19336 \begin_layout Plain Layout
19345 \begin_layout Description
19346 \begin_inset Flex Code
19349 \begin_layout Plain Layout
19356 \begin_inset Flex Code
19359 \begin_layout Plain Layout
19365 ] The tag to be used for paragraph and item labels, replacing
19366 \begin_inset Flex Code
19369 \begin_layout Plain Layout
19375 in the examples above.
19377 \begin_inset Flex Code
19380 \begin_layout Plain Layout
19387 \begin_inset Flex Code
19390 \begin_layout Plain Layout
19397 \begin_inset Flex Code
19400 \begin_layout Plain Layout
19407 \begin_inset Flex Code
19410 \begin_layout Plain Layout
19411 Centered_Top_Environment
19416 , in which case it defaults to
19417 \begin_inset Flex Code
19420 \begin_layout Plain Layout
19429 \begin_layout Description
19430 \begin_inset Flex Code
19433 \begin_layout Plain Layout
19440 \begin_inset Flex Code
19443 \begin_layout Plain Layout
19449 ] Attributes for the label tag.
19451 \begin_inset Quotes eld
19455 \begin_inset Flex Code
19458 \begin_layout Plain Layout
19459 class=`layoutname_label'
19465 \begin_inset Quotes erd
19473 contain any style information.
19475 \begin_inset Flex Code
19478 \begin_layout Plain Layout
19487 \begin_layout Description
19488 \begin_inset Flex Code
19491 \begin_layout Plain Layout
19498 \begin_inset Flex Code
19501 \begin_layout Plain Layout
19511 ] Meaningful only for list-like environments, this tag controls whether
19512 the label tag is output before or inside the item tag.
19513 This is used, for example, in the description environment, where we want
19515 \begin_inset Flex Code
19518 \begin_layout Plain Layout
19519 <dt>\SpecialChar \ldots{}
19520 </dt><dd>\SpecialChar \ldots{}
19528 \begin_inset Flex Code
19531 \begin_layout Plain Layout
19537 : The label tag is output inside the item tag.
19540 \begin_layout Description
19541 \begin_inset Flex Code
19544 \begin_layout Plain Layout
19550 Information to be output in the
19551 \begin_inset Flex Code
19554 \begin_layout Plain Layout
19560 section when this style is used.
19561 This might, for example, be used to include a
19562 \begin_inset Flex Code
19565 \begin_layout Plain Layout
19572 \begin_inset Flex Code
19575 \begin_layout Plain Layout
19584 \begin_layout Description
19585 \begin_inset Flex Code
19588 \begin_layout Plain Layout
19594 CSS style information to be included when this style is used.
19595 Note that this will automatically be wrapped in a layout-generated
19596 \begin_inset Flex Code
19599 \begin_layout Plain Layout
19605 block, so only the CSS itself need be included.
19608 \begin_layout Description
19609 \begin_inset Flex Code
19612 \begin_layout Plain Layout
19619 \begin_inset Flex Code
19622 \begin_layout Plain Layout
19628 ] The tag to be used for the main label, replacing
19629 \begin_inset Flex Code
19632 \begin_layout Plain Layout
19638 in the examples above.
19640 \begin_inset Flex Code
19643 \begin_layout Plain Layout
19652 \begin_layout Description
19653 \begin_inset Flex Code
19656 \begin_layout Plain Layout
19663 \begin_inset Flex Code
19666 \begin_layout Plain Layout
19676 ] Marks this style as the one to be used to generate the
19677 \begin_inset Flex Code
19680 \begin_layout Plain Layout
19686 tag for the XHTML file.
19687 By default, it is false.
19689 \begin_inset Flex Code
19692 \begin_layout Plain Layout
19698 file sets it to true for the
19699 \begin_inset Flex Code
19702 \begin_layout Plain Layout
19712 \begin_layout Subsection
19716 \begin_layout Standard
19717 The XHTML output of insets can also be controlled by information in layout
19722 \begin_layout Plain Layout
19723 At present, this is true only for
19724 \begin_inset Quotes eld
19728 \begin_inset Quotes erd
19731 insets (insets you can type into) and is not true for
19732 \begin_inset Quotes eld
19736 \begin_inset Quotes erd
19739 insets (insets that are associated with dialog boxes).
19744 Here, too, LyX tries to provide sensible defaults, and it constructs default
19746 But everything can be customized.
19749 \begin_layout Standard
19750 The XHTML LyX outputs for an inset has the following form:
19753 \begin_layout LyX-Code
19755 \begin_inset Quotes erd
19759 \begin_inset Quotes erd
19765 \begin_layout LyX-Code
19766 <labeltag>Label</labeltag>
19769 \begin_layout LyX-Code
19771 \begin_inset Quotes erd
19775 \begin_inset Quotes erd
19778 >Contents of the inset.</innertag>
19781 \begin_layout LyX-Code
19785 \begin_layout Standard
19786 If the inset permits multiple paragraphs---that is, if
19787 \begin_inset Flex Code
19790 \begin_layout Plain Layout
19796 is true---then the contents of the inset will itself be output as paragraphs
19797 formatted according to the styles used for those paragraphs (standard,
19798 quote, and the like).
19799 The label tag is of course omitted if the paragraph does not have a label
19800 and, at present, is always
19801 \begin_inset Flex Code
19804 \begin_layout Plain Layout
19811 The inner tag is optional and, by default, does not appear.
19814 \begin_layout Standard
19815 The specific tags and attributes output for each inset can be controlled
19816 by means of the following layout tags.
19819 \begin_layout Description
19820 \begin_inset Flex Code
19823 \begin_layout Plain Layout
19830 \begin_inset Flex Code
19833 \begin_layout Plain Layout
19839 ] Specifies attribute information to be output with the main tag.
19841 \begin_inset Quotes eld
19845 \begin_inset Flex Code
19848 \begin_layout Plain Layout
19849 class=`myinset' onclick=`\SpecialChar \ldots{}
19856 \begin_inset Quotes erd
19860 By default, LyX will output
19861 \begin_inset Quotes eld
19865 \begin_inset Flex Code
19868 \begin_layout Plain Layout
19875 \begin_inset Quotes erd
19879 \begin_inset Flex Code
19882 \begin_layout Plain Layout
19888 is the LyX name of the inset, made lowercase and with non-alphanumeric
19889 characters converted to underscores, for example: footnote.
19892 \begin_layout Description
19893 \begin_inset Flex Code
19896 \begin_layout Plain Layout
19903 \begin_inset Flex Code
19906 \begin_layout Plain Layout
19916 ] Whether to output the default CSS information LyX generates for this layout,
19917 even if additional information is explicitly provided via
19918 \begin_inset Flex Code
19921 \begin_layout Plain Layout
19929 \begin_inset Flex Code
19932 \begin_layout Plain Layout
19938 allows you to alter or augment the generated CSS, rather than to override
19943 \begin_layout Description
19944 \begin_inset Flex Code
19947 \begin_layout Plain Layout
19954 \begin_inset Flex Code
19957 \begin_layout Plain Layout
19963 ] Attributes for the inner tag.
19965 \begin_inset Quotes eld
19969 \begin_inset Flex Code
19972 \begin_layout Plain Layout
19973 class=`insetname_inner'
19979 \begin_inset Quotes erd
19985 \begin_layout Description
19986 \begin_inset Flex Code
19989 \begin_layout Plain Layout
19996 \begin_inset Flex Code
19999 \begin_layout Plain Layout
20005 ] The inner tag, replacing
20006 \begin_inset Flex Code
20009 \begin_layout Plain Layout
20015 in the examples above.
20016 By default, there is none.
20019 \begin_layout Description
20020 \begin_inset Flex Code
20023 \begin_layout Plain Layout
20030 \begin_inset Flex Code
20033 \begin_layout Plain Layout
20041 ] Whether this inset represents a standalone block of text (such as a footnote)
20042 or instead represents material that is included in the surrounding text
20043 (such as a branch).
20047 \begin_layout Description
20048 \begin_inset Flex Code
20051 \begin_layout Plain Layout
20058 \begin_inset Flex Code
20061 \begin_layout Plain Layout
20067 ] A label for this inset, possibly including a reference to a counter.
20068 For example, for footnote, it might be:
20069 \begin_inset Flex Code
20072 \begin_layout Plain Layout
20081 This is optional, and there is no default.
20084 \begin_layout Description
20085 \begin_inset Flex Code
20088 \begin_layout Plain Layout
20094 Information to be output in the
20095 \begin_inset Flex Code
20098 \begin_layout Plain Layout
20104 section when this style is used.
20105 This might, for example, be used to include a
20106 \begin_inset Flex Code
20109 \begin_layout Plain Layout
20116 \begin_inset Flex Code
20119 \begin_layout Plain Layout
20128 \begin_layout Description
20129 \begin_inset Flex Code
20132 \begin_layout Plain Layout
20138 CSS style information to be included when this style is used.
20139 Note that this will automatically be wrapped in a layout-generated
20140 \begin_inset Flex Code
20143 \begin_layout Plain Layout
20149 block, so only the CSS itself need be included.
20152 \begin_layout Description
20153 \begin_inset Flex Code
20156 \begin_layout Plain Layout
20163 \begin_inset Flex Code
20166 \begin_layout Plain Layout
20172 ] The tag to be used for the main label, replacing
20173 \begin_inset Flex Code
20176 \begin_layout Plain Layout
20182 in the examples above.
20183 The default depends upon the setting of
20184 \begin_inset Flex Code
20187 \begin_layout Plain Layout
20194 \begin_inset Flex Code
20197 \begin_layout Plain Layout
20203 is true, the default is
20204 \begin_inset Flex Code
20207 \begin_layout Plain Layout
20213 ; if it is false, the default is
20214 \begin_inset Flex Code
20217 \begin_layout Plain Layout
20226 \begin_layout Subsection
20230 \begin_layout Standard
20231 The XHTML output for floats too can be controlled by layout information.
20232 The output has the following form:
20235 \begin_layout LyX-Code
20237 \begin_inset Quotes erd
20241 \begin_inset Quotes erd
20247 \begin_layout LyX-Code
20248 Contents of the float.
20251 \begin_layout LyX-Code
20255 \begin_layout Standard
20256 The caption, if there is one, is a separate inset and will be output as
20258 Its appearance can be controlled via the InsetLayout for caption insets.
20262 \begin_layout Description
20263 \begin_inset Flex Code
20266 \begin_layout Plain Layout
20273 \begin_inset Flex Code
20276 \begin_layout Plain Layout
20282 ] Specifies attribute information to be output with the main tag.
20284 \begin_inset Quotes eld
20288 \begin_inset Flex Code
20291 \begin_layout Plain Layout
20292 class=`myfloat' onclick=`\SpecialChar \ldots{}
20299 \begin_inset Quotes erd
20303 By default, LyX will output
20304 \begin_inset Quotes eld
20308 \begin_inset Flex Code
20311 \begin_layout Plain Layout
20312 class=`float float-floattype'
20318 \begin_inset Quotes erd
20322 \begin_inset Flex Code
20325 \begin_layout Plain Layout
20331 is LyX's name for this type of float, as determined by the float declaration
20333 \begin_inset CommandInset ref
20335 reference "sub:Floats"
20339 ), though made lowercase and with non-alphanumeric characters converted
20340 to underscores, for example: float-table.
20343 \begin_layout Description
20344 \begin_inset Flex Code
20347 \begin_layout Plain Layout
20353 CSS style information to be included when this float is used.
20354 Note that this will automatically be wrapped in a layout-generated
20355 \begin_inset Flex Code
20358 \begin_layout Plain Layout
20364 block, so only the CSS itself need be included.
20367 \begin_layout Description
20368 \begin_inset Flex Code
20371 \begin_layout Plain Layout
20378 \begin_inset Flex Code
20381 \begin_layout Plain Layout
20387 ] The tag to be used for this float, replacing
20388 \begin_inset Quotes eld
20392 \begin_inset Flex Code
20395 \begin_layout Plain Layout
20402 \begin_inset Quotes erd
20405 in the example above.
20407 \begin_inset Flex Code
20410 \begin_layout Plain Layout
20416 and will rarely need changing.
20419 \begin_layout Subsection
20420 Bibliography formatting
20423 \begin_layout Standard
20424 The bibliography can be formatted using
20425 \begin_inset Flex Code
20428 \begin_layout Plain Layout
20436 \begin_inset CommandInset ref
20438 reference "sub:Citation-format-description"
20445 \begin_layout Subsection
20449 \begin_layout Standard
20450 We have several times mentioned that LyX will generate default CSS style
20451 rules for both insets and paragraph styles, based upon the other layout
20452 information that is provided.
20453 In this section, we shall say a word about which layout information LyX
20457 \begin_layout Standard
20458 At present, LyX auto-generates CSS only for font information, making use
20460 \begin_inset Flex Code
20463 \begin_layout Plain Layout
20470 \begin_inset Flex Code
20473 \begin_layout Plain Layout
20480 \begin_inset Flex Code
20483 \begin_layout Plain Layout
20490 \begin_inset Flex Code
20493 \begin_layout Plain Layout
20500 \begin_inset Flex Code
20503 \begin_layout Plain Layout
20511 \begin_inset CommandInset ref
20513 reference "sub:Font-description"
20517 .) The translation is mostly straightforward and obvious.
20519 \begin_inset Quotes eld
20523 \begin_inset Flex Code
20526 \begin_layout Plain Layout
20533 \begin_inset Quotes erd
20537 \begin_inset Quotes eld
20541 \begin_inset Flex Code
20544 \begin_layout Plain Layout
20545 font-family: sans-serif;
20551 \begin_inset Quotes erd
20555 The correspondence of LyX sizes and CSS sizes is a little less obvious
20556 but nonetheless intuitive.
20558 \begin_inset Flex Code
20561 \begin_layout Plain Layout
20568 \begin_inset Flex URL
20571 \begin_layout Plain Layout
20581 \begin_layout Chapter
20582 Including External Material
20585 \begin_layout Standard
20586 \begin_inset Box Shadowbox
20596 height_special "totalheight"
20599 \begin_layout Plain Layout
20600 WARNING: This portion of the documentation has not been updated for some
20602 We certainly hope that it is still accurate, but there are no guarantees.
20610 \begin_layout Standard
20611 The use of material from sources external to LyX is covered in detail in
20617 This part of the manual covers what needs to happen behind the scenes for
20618 new sorts of material to be included.
20621 \begin_layout Section
20625 \begin_layout Standard
20626 The external material feature is based on the concept of a
20631 A template is a specification of how LyX should interface with a certain
20633 As bundled, LyX comes with predefined templates for Xfig figures, various
20634 raster format images, chess diagrams, and LilyPond music notation.
20635 You can check the actual list by using the menu
20636 \begin_inset Flex MenuItem
20639 \begin_layout Plain Layout
20640 Insert\SpecialChar \menuseparator
20641 File\SpecialChar \menuseparator
20648 Furthermore, it is possible to roll your own template to support a specific
20650 Later we'll describe in more detail what is involved, and hopefully you
20651 will submit all the templates you create so we can include them in a later
20655 \begin_layout Standard
20656 Another basic idea of the external material feature is to distinguish between
20657 the original file that serves as a base for final material and the produced
20658 file that is included in your exported or printed document.
20659 For example, consider the case of a figure produced with
20660 \begin_inset Flex Code
20663 \begin_layout Plain Layout
20670 The Xfig application itself works on an original file with the
20671 \begin_inset Flex Code
20674 \begin_layout Plain Layout
20681 Within Xfig, you create and change your figure, and when you are done,
20683 \begin_inset Flex Code
20686 \begin_layout Plain Layout
20693 When you want to include the figure in your document, you invoke
20694 \begin_inset Flex Code
20697 \begin_layout Plain Layout
20703 in order to create a PostScript file that can readily be included in your
20706 \begin_inset Flex Code
20709 \begin_layout Plain Layout
20715 file is the original file, and the PostScript file is the produced file.
20718 \begin_layout Standard
20719 This distinction is important in order to allow updating of the material
20720 while you are in the process of writing the document.
20721 Furthermore, it provides us with the flexibility that is needed to support
20722 multiple export formats.
20723 For instance, in the case of a plain text file, it is not exactly an award-winn
20724 ing idea to include the figure as raw PostScript.
20725 Instead, you would either prefer to just include a reference to the figure
20726 or try to invoke some graphics to ASCII converter to make the final result
20727 look similar to the real graphics.
20728 The external material management allows you to do this, because it is parametri
20729 zed on the different export formats that LyX supports.
20732 \begin_layout Standard
20733 Besides supporting the production of different products according to the
20734 exported format, it supports tight integration with editing and viewing
20736 In the case of an Xfig figure, you are able to invoke Xfig on the original
20737 file with a single click from within the external material dialog in LyX,
20738 and also preview the produced PostScript file with Ghostview with another
20740 No more fiddling around with the command line and/or file browsers to locate
20741 and manipulate the original or produced files.
20742 In this way, you are finally able to take full advantage of the many different
20743 applications that are relevant to use when you write your documents, and
20744 ultimately be more productive.
20747 \begin_layout Section
20748 The external template configuration file
20751 \begin_layout Standard
20752 It is relatively easy to add custom external template definitions to LyX.
20753 However, be aware that doing this in an careless manner most probably
20757 introduce an easily exploitable security hole.
20758 So before you do this, please read the discussion about security in section
20760 \begin_inset CommandInset ref
20762 reference "sec:Security-discussion"
20769 \begin_layout Standard
20770 Having said that, we encourage you to submit any interesting templates that
20775 \begin_layout Standard
20776 The external templates are defined in the
20777 \begin_inset Flex Code
20780 \begin_layout Plain Layout
20781 LyXDir/lib/external_templates
20787 You can place your own version in
20788 \begin_inset Flex Code
20791 \begin_layout Plain Layout
20792 UserDir/external_templates
20800 \begin_layout Standard
20801 A typical template looks like this:
20804 \begin_layout LyX-Code
20808 \begin_layout LyX-Code
20809 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
20812 \begin_layout LyX-Code
20816 \begin_layout LyX-Code
20820 \begin_layout LyX-Code
20824 \begin_layout LyX-Code
20828 \begin_layout LyX-Code
20832 \begin_layout LyX-Code
20833 AutomaticProduction true
20836 \begin_layout LyX-Code
20840 \begin_layout LyX-Code
20844 \begin_layout LyX-Code
20848 \begin_layout LyX-Code
20849 TransformCommand Rotate RotationLatexCommand
20852 \begin_layout LyX-Code
20853 TransformCommand Resize ResizeLatexCommand
20856 \begin_layout LyX-Code
20857 Product "$$RotateFront$$ResizeFront
20860 \begin_layout LyX-Code
20865 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
20868 \begin_layout LyX-Code
20869 $$ResizeBack$$RotateBack"
20872 \begin_layout LyX-Code
20876 \begin_layout LyX-Code
20877 UpdateResult "$$AbsPath$$Basename.pstex_t"
20880 \begin_layout LyX-Code
20881 Requirement "graphicx"
20884 \begin_layout LyX-Code
20885 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20888 \begin_layout LyX-Code
20889 ReferencedFile latex "$$AbsPath$$Basename.eps"
20892 \begin_layout LyX-Code
20893 ReferencedFile dvi "$$AbsPath$$Basename.eps"
20896 \begin_layout LyX-Code
20900 \begin_layout LyX-Code
20904 \begin_layout LyX-Code
20905 TransformCommand Rotate RotationLatexCommand
20908 \begin_layout LyX-Code
20909 TransformCommand Resize ResizeLatexCommand
20912 \begin_layout LyX-Code
20913 Product "$$RotateFront$$ResizeFront
20916 \begin_layout LyX-Code
20921 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
20924 \begin_layout LyX-Code
20925 $$ResizeBack$$RotateBack"
20928 \begin_layout LyX-Code
20929 UpdateFormat pdftex
20932 \begin_layout LyX-Code
20933 UpdateResult "$$AbsPath$$Basename.pdftex_t"
20936 \begin_layout LyX-Code
20937 Requirement "graphicx"
20940 \begin_layout LyX-Code
20941 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
20944 \begin_layout LyX-Code
20945 ReferencedFile latex "$$AbsPath$$Basename.pdf"
20948 \begin_layout LyX-Code
20952 \begin_layout LyX-Code
20956 \begin_layout LyX-Code
20957 Product "$$Contents(
20959 "$$AbsPath$$Basename.asc
20964 \begin_layout LyX-Code
20965 UpdateFormat asciixfig
20968 \begin_layout LyX-Code
20969 UpdateResult "$$AbsPath$$Basename.asc"
20972 \begin_layout LyX-Code
20976 \begin_layout LyX-Code
20980 \begin_layout LyX-Code
20981 Product "<graphic fileref=
20983 "$$AbsOrRelPathMaster$$Basename.eps
20988 \begin_layout LyX-Code
20992 \begin_layout LyX-Code
20996 \begin_layout LyX-Code
20997 UpdateResult "$$AbsPath$$Basename.eps"
21000 \begin_layout LyX-Code
21001 ReferencedFile docbook "$$AbsPath$$Basename.eps"
21004 \begin_layout LyX-Code
21005 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
21008 \begin_layout LyX-Code
21012 \begin_layout LyX-Code
21013 Product "[XFig: $$FName]"
21016 \begin_layout LyX-Code
21020 \begin_layout LyX-Code
21024 \begin_layout Standard
21025 As you can see, the template is enclosed in
21026 \begin_inset Flex Code
21029 \begin_layout Plain Layout
21035 \SpecialChar \ldots{}
21037 \begin_inset Flex Code
21040 \begin_layout Plain Layout
21047 It contains a header specifying some general settings and, for each supported
21048 primary document file format, a section
21049 \begin_inset Flex Code
21052 \begin_layout Plain Layout
21058 \SpecialChar \ldots{}
21060 \begin_inset Flex Code
21063 \begin_layout Plain Layout
21072 \begin_layout Subsection
21073 The template header
21076 \begin_layout Description
21077 \begin_inset Flex Code
21080 \begin_layout Plain Layout
21081 AutomaticProduction
21082 \begin_inset space ~
21090 Whether the file represented by the template must be generated by LyX.
21091 This command must occur exactly once.
21094 \begin_layout Description
21095 \begin_inset Flex Code
21098 \begin_layout Plain Layout
21100 \begin_inset space ~
21108 A glob pattern that is used in the file dialog to filter out the desired
21110 If there is more than one possible file extension (e.
21111 \begin_inset space \thinspace{}
21115 \begin_inset space \space{}
21119 \begin_inset Flex Code
21122 \begin_layout Plain Layout
21129 \begin_inset Flex Code
21132 \begin_layout Plain Layout
21138 ), use something like
21139 \begin_inset Flex Code
21142 \begin_layout Plain Layout
21149 This command must occur exactly once.
21152 \begin_layout Description
21153 \begin_inset Flex Code
21156 \begin_layout Plain Layout
21158 \begin_inset space ~
21166 The text that is displayed on the button.
21167 This command must occur exactly once.
21170 \begin_layout Description
21171 \begin_inset Flex Code
21174 \begin_layout Plain Layout
21176 \begin_inset space ~
21180 \begin_inset space ~
21188 The help text that is used in the External dialog.
21189 Provide enough information to explain to the user just what the template
21190 can provide him with.
21191 This command must occur exactly once.
21194 \begin_layout Description
21195 \begin_inset Flex Code
21198 \begin_layout Plain Layout
21200 \begin_inset space ~
21208 The file format of the original file.
21209 This must be the name of a format that is known to LyX (see section
21210 \begin_inset space ~
21214 \begin_inset CommandInset ref
21216 reference "sec:Formats"
21222 \begin_inset Quotes eld
21226 \begin_inset Flex Code
21229 \begin_layout Plain Layout
21236 \begin_inset Quotes erd
21239 if the template can handle original files of more than one format.
21240 LyX will attempt to interrogate the file itself in order to deduce its
21241 format in this case.
21242 This command must occur exactly once.
21245 \begin_layout Description
21246 \begin_inset Flex Code
21249 \begin_layout Plain Layout
21251 \begin_inset space ~
21259 A unique name for the template.
21260 It must not contain substitution macros (see below).
21263 \begin_layout Description
21264 \begin_inset Flex Code
21267 \begin_layout Plain Layout
21269 \begin_inset space ~
21272 Rotate|Resize|Clip|Extra
21277 This command specifies which transformations are supported by this template.
21278 It may occur zero or more times.
21279 This command enables the corresponding tabs in the external dialog.
21281 \begin_inset Flex Code
21284 \begin_layout Plain Layout
21290 command must have either a corresponding
21291 \begin_inset Flex Code
21294 \begin_layout Plain Layout
21301 \begin_inset Flex Code
21304 \begin_layout Plain Layout
21311 \begin_inset Flex Code
21314 \begin_layout Plain Layout
21321 Otherwise the transformation will not be supported by that format.
21324 \begin_layout Subsection
21328 \begin_layout Description
21329 \begin_inset Flex Code
21332 \begin_layout Plain Layout
21334 \begin_inset space ~
21337 LaTeX|PDFLaTeX|PlainText|DocBook
21342 The primary document file format that this format definition is for.
21343 Not every template has a sensible representation in all document file formats.
21344 Please define nevertheless a
21345 \begin_inset Flex Code
21348 \begin_layout Plain Layout
21354 section for all templates.
21355 Use a dummy text when no representation is available.
21356 Then you can at least see a reference to the external material in the exported
21360 \begin_layout Description
21361 \begin_inset Flex Code
21364 \begin_layout Plain Layout
21366 \begin_inset space ~
21370 \begin_inset space ~
21378 This command defines an additional macro
21379 \begin_inset Flex Code
21382 \begin_layout Plain Layout
21388 for substitution in
21389 \begin_inset Flex Code
21392 \begin_layout Plain Layout
21400 \begin_inset Flex Code
21403 \begin_layout Plain Layout
21409 itself may contain substitution macros.
21410 The advantage over using
21411 \begin_inset Flex Code
21414 \begin_layout Plain Layout
21421 \begin_inset Flex Code
21424 \begin_layout Plain Layout
21430 is that the substituted value of
21431 \begin_inset Flex Code
21434 \begin_layout Plain Layout
21440 is sanitized so that it is a valid optional argument in the document format.
21441 This command may occur zero or more times.
21444 \begin_layout Description
21445 \begin_inset Flex Code
21448 \begin_layout Plain Layout
21450 \begin_inset space ~
21458 The text that is inserted in the exported document.
21459 This is actually the most important command and can be quite complex.
21460 This command must occur exactly once.
21463 \begin_layout Description
21464 \begin_inset Flex Code
21467 \begin_layout Plain Layout
21469 \begin_inset space ~
21477 This command specifies a preamble snippet that will be included in the
21479 It has to be defined using
21480 \begin_inset Flex Code
21483 \begin_layout Plain Layout
21489 \SpecialChar \ldots{}
21491 \begin_inset Flex Code
21494 \begin_layout Plain Layout
21501 This command may occur zero or more times.
21504 \begin_layout Description
21505 \begin_inset Flex Code
21508 \begin_layout Plain Layout
21510 \begin_inset space ~
21514 \begin_inset space ~
21522 This command denotes files that are created by the conversion process and
21523 are needed for a particular export format.
21524 If the filename is relative, it is interpreted relative to the master document.
21525 This command may be given zero or more times.
21528 \begin_layout Description
21529 \begin_inset Flex Code
21532 \begin_layout Plain Layout
21534 \begin_inset space ~
21542 The name of a required LaTeX package.
21543 The package is included via
21544 \begin_inset Flex Code
21547 \begin_layout Plain Layout
21555 in the LaTeX preamble.
21556 This command may occur zero or more times.
21559 \begin_layout Description
21560 \begin_inset Flex Code
21563 \begin_layout Plain Layout
21565 \begin_inset space ~
21569 \begin_inset space ~
21572 RotationLatexCommand
21577 This command specifies that the built in LaTeX command should be used for
21579 This command may occur once or not at all.
21582 \begin_layout Description
21583 \begin_inset Flex Code
21586 \begin_layout Plain Layout
21588 \begin_inset space ~
21592 \begin_inset space ~
21600 This command specifies that the built in LaTeX command should be used for
21602 This command may occur once or not at all.
21605 \begin_layout Description
21606 \begin_inset Flex Code
21609 \begin_layout Plain Layout
21611 \begin_inset space ~
21615 \begin_inset space ~
21618 RotationLatexOption
21623 This command specifies that rotation is done via an optional argument.
21624 This command may occur once or not at all.
21627 \begin_layout Description
21628 \begin_inset Flex Code
21631 \begin_layout Plain Layout
21633 \begin_inset space ~
21637 \begin_inset space ~
21645 This command specifies that resizing is done via an optional argument.
21646 This command may occur once or not at all.
21649 \begin_layout Description
21650 \begin_inset Flex Code
21653 \begin_layout Plain Layout
21655 \begin_inset space ~
21659 \begin_inset space ~
21667 This command specifies that clipping is done via an optional argument.
21668 This command may occur once or not at all.
21671 \begin_layout Description
21672 \begin_inset Flex Code
21675 \begin_layout Plain Layout
21677 \begin_inset space ~
21681 \begin_inset space ~
21689 This command specifies that an extra optional argument is used.
21690 This command may occur once or not at all.
21693 \begin_layout Description
21694 \begin_inset Flex Code
21697 \begin_layout Plain Layout
21699 \begin_inset space ~
21707 The file format of the converted file.
21708 This must be the name of a format that is known to LyX (see the
21709 \begin_inset Flex MenuItem
21712 \begin_layout Plain Layout
21717 ools\SpecialChar \menuseparator
21722 references\SpecialChar \menuseparator
21723 File Handling\SpecialChar \menuseparator
21730 This command must occur exactly once.
21733 \begin_layout Description
21734 \begin_inset Flex Code
21737 \begin_layout Plain Layout
21739 \begin_inset space ~
21747 The file name of the converted file.
21748 The file name must be absolute.
21749 This command must occur exactly once.
21752 \begin_layout Subsection
21753 Preamble definitions
21756 \begin_layout Standard
21757 The external template configuration file may contain additional preamble
21758 definitions enclosed by
21759 \begin_inset Flex Code
21762 \begin_layout Plain Layout
21768 \SpecialChar \ldots{}
21770 \begin_inset Flex Code
21773 \begin_layout Plain Layout
21780 They can be used by the templates in the
21781 \begin_inset Flex Code
21784 \begin_layout Plain Layout
21793 \begin_layout Section
21794 The substitution mechanism
21797 \begin_layout Standard
21798 When the external material facility invokes an external program, it is done
21799 on the basis of a command defined in the template configuration file.
21800 These commands can contain various macros that are expanded before execution.
21801 Execution always take place in the directory of the containing document.
21804 \begin_layout Standard
21805 Also, whenever external material is to be displayed, the name will be produced
21806 by the substitution mechanism, and most other commands in the template
21807 definition support substitution as well.
21810 \begin_layout Standard
21811 The available macros are the following:
21814 \begin_layout Description
21815 \begin_inset Flex Code
21818 \begin_layout Plain Layout
21819 $$AbsOrRelPathMaster
21824 The file path, absolute or relative to the master LyX document.
21827 \begin_layout Description
21828 \begin_inset Flex Code
21831 \begin_layout Plain Layout
21832 $$AbsOrRelPathParent
21837 The file path, absolute or relative to the LyX document.
21840 \begin_layout Description
21841 \begin_inset Flex Code
21844 \begin_layout Plain Layout
21850 The absolute file path.
21853 \begin_layout Description
21854 \begin_inset Flex Code
21857 \begin_layout Plain Layout
21863 The filename without path and without the extension.
21866 \begin_layout Description
21867 \begin_inset Flex Code
21870 \begin_layout Plain Layout
21872 \begin_inset Quotes eld
21876 \begin_inset Quotes erd
21884 This macro will expand to the contents of the file with the name
21885 \begin_inset Flex Code
21888 \begin_layout Plain Layout
21897 \begin_layout Description
21898 \begin_inset Flex Code
21901 \begin_layout Plain Layout
21907 The file extension (including the dot).
21910 \begin_layout Description
21911 \begin_inset Flex Code
21914 \begin_layout Plain Layout
21920 The filename of the file specified in the external material dialog.
21921 This is either an absolute name, or it is relative to the LyX document.
21924 \begin_layout Description
21925 \begin_inset Flex Code
21928 \begin_layout Plain Layout
21935 \begin_inset Flex Code
21938 \begin_layout Plain Layout
21944 (absolute name or relative to the LyX document).
21947 \begin_layout Description
21948 \begin_inset Flex Code
21951 \begin_layout Plain Layout
21957 The file path, relative to the master LyX document.
21960 \begin_layout Description
21961 \begin_inset Flex Code
21964 \begin_layout Plain Layout
21970 The file path, relative to the LyX document.
21973 \begin_layout Description
21974 \begin_inset Flex Code
21977 \begin_layout Plain Layout
21983 This macro will expand to the absolute path of the system directory.
21984 This is typically used to point to the various helper scripts that are
21988 \begin_layout Description
21989 \begin_inset Flex Code
21992 \begin_layout Plain Layout
21998 A name and full path to a temporary file which will be automatically deleted
21999 whenever the containing document is closed, or the external material insertion
22003 \begin_layout Standard
22004 All path macros contain a trailing directory separator, so you can construct
22006 \begin_inset space \thinspace{}
22010 \begin_inset space \space{}
22013 the absolute filename with
22014 \begin_inset Flex Code
22017 \begin_layout Plain Layout
22018 $$AbsPath$$Basename$$Extension
22026 \begin_layout Standard
22027 The macros above are substituted in all commands unless otherwise noted.
22029 \begin_inset Flex Code
22032 \begin_layout Plain Layout
22038 supports additionally the following substitutions if they are enabled by
22040 \begin_inset Flex Code
22043 \begin_layout Plain Layout
22050 \begin_inset Flex Code
22053 \begin_layout Plain Layout
22062 \begin_layout Description
22063 \begin_inset Flex Code
22066 \begin_layout Plain Layout
22072 The front part of the resize command.
22075 \begin_layout Description
22076 \begin_inset Flex Code
22079 \begin_layout Plain Layout
22085 The back part of the resize command.
22088 \begin_layout Description
22089 \begin_inset Flex Code
22092 \begin_layout Plain Layout
22098 The front part of the rotation command.
22101 \begin_layout Description
22102 \begin_inset Flex Code
22105 \begin_layout Plain Layout
22111 The back part of the rotation command.
22114 \begin_layout Standard
22115 The value string of the
22116 \begin_inset Flex Code
22119 \begin_layout Plain Layout
22125 command supports additionally the following substitutions if they are enabled
22127 \begin_inset Flex Code
22130 \begin_layout Plain Layout
22137 \begin_inset Flex Code
22140 \begin_layout Plain Layout
22149 \begin_layout Description
22150 \begin_inset Flex Code
22153 \begin_layout Plain Layout
22162 \begin_layout Description
22163 \begin_inset Flex Code
22166 \begin_layout Plain Layout
22175 \begin_layout Description
22176 \begin_inset Flex Code
22179 \begin_layout Plain Layout
22188 \begin_layout Description
22189 \begin_inset Flex Code
22192 \begin_layout Plain Layout
22198 The rotation option.
22201 \begin_layout Standard
22202 You may ask why there are so many path macros.
22203 There are mainly two reasons:
22206 \begin_layout Enumerate
22207 Relative and absolute file names should remain relative or absolute, respectivel
22209 Users may have reasons to prefer either form.
22210 Relative names are useful for portable documents that should work on different
22211 machines, for example.
22212 Absolute names may be required by some programs.
22215 \begin_layout Enumerate
22216 LaTeX treats relative file names differently than LyX and other programs
22217 in nested included files.
22218 For LyX, a relative file name is always relative to the document that contains
22220 For LaTeX, it is always relative to the master document.
22221 These two definitions are identical if you have only one document, but
22222 differ if you have a master document that includes part documents.
22223 That means that relative filenames must be transformed when presented to
22225 Fortunately LyX does this automatically for you if you choose the right
22229 \begin_layout Standard
22230 So which path macro should be used in new template definitions? The rule
22234 \begin_layout Itemize
22236 \begin_inset Flex Code
22239 \begin_layout Plain Layout
22245 if an absolute path is required.
22248 \begin_layout Itemize
22250 \begin_inset Flex Code
22253 \begin_layout Plain Layout
22254 $$AbsOrRelPathMaster
22259 if the substituted string is some kind of LaTeX input.
22262 \begin_layout Itemize
22264 \begin_inset Flex Code
22267 \begin_layout Plain Layout
22268 $$AbsOrRelPathParent
22273 in order to preserve the user's choice.
22276 \begin_layout Standard
22277 There are special cases where this rule does not work and e.
22278 \begin_inset space \thinspace{}
22282 \begin_inset space \space{}
22285 relative names are needed, but normally it will work just fine.
22286 One example for such a case is the command
22287 \begin_inset Flex Code
22290 \begin_layout Plain Layout
22291 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
22296 in the XFig template above: We can't use the absolute name because the
22298 \begin_inset Flex Code
22301 \begin_layout Plain Layout
22307 files needs the relative name in order to rewrite the file content.
22310 \begin_layout Section
22311 Security discussion
22312 \begin_inset CommandInset label
22314 name "sec:Security-discussion"
22321 \begin_layout Standard
22322 The external material feature interfaces with a lot of external programs
22323 and does so automatically, so we have to consider the security implications
22325 In particular, since you have the option of including your own filenames
22326 and/or parameter strings and those are expanded into a command, it seems
22327 that it would be possible to create a malicious document which executes
22328 arbitrary commands when a user views or prints the document.
22329 This is something we definitely want to avoid.
22332 \begin_layout Standard
22333 However, since the external program commands are specified in the template
22334 configuration file only, there are no security issues if LyX is properly
22335 configured with safe templates only.
22336 This is so because the external programs are invoked with the
22337 \begin_inset Flex Code
22340 \begin_layout Plain Layout
22346 -system call rather than the
22347 \begin_inset Flex Code
22350 \begin_layout Plain Layout
22356 system-call, so it's not possible to execute arbitrary commands from the
22357 filename or parameter section via the shell.
22360 \begin_layout Standard
22361 This also implies that you are restricted in what command strings you can
22362 use in the external material templates.
22363 In particular, pipes and redirection are not readily available.
22364 This has to be so if LyX should remain safe.
22365 If you want to use some of the shell features, you should write a safe
22366 script to do this in a controlled manner, and then invoke the script from
22367 the command string.
22371 \begin_layout Standard
22372 It is possible to design a template that interacts directly with the shell,
22373 but since this would allow a malicious user to execute arbitrary commands
22374 by writing clever filenames and/or parameters, we generally recommend that
22375 you only use safe scripts that work with the
22376 \begin_inset Flex Code
22379 \begin_layout Plain Layout
22385 system call in a controlled manner.
22386 Of course, for use in a controlled environment, it can be tempting to just
22387 fall back to use ordinary shell scripts.
22388 If you do so, be aware that you
22392 provide an easily exploitable security hole in your system.
22393 Of course it stands to reason that such unsafe templates will never be
22394 included in the standard LyX distribution, although we do encourage people
22395 to submit new templates in the open source tradition.
22396 But LyX as shipped from the official distribution channels will never have
22400 \begin_layout Standard
22401 Including external material provides a lot of power, and you have to be
22402 careful not to introduce security hazards with this power.
22403 A subtle error in a single line in an innocent looking script can open
22404 the door to huge security problems.
22405 So if you do not fully understand the issues, we recommend that you consult
22406 a knowledgeable security professional or the LyX development team if you
22407 have any questions about whether a given template is safe or not.
22408 And do this before you use it in an uncontrolled environment.