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 1353681232
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 1353681155
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
10698 \begin_layout Description
10699 \begin_inset Flex Code
10702 \begin_layout Plain Layout
10708 Note that this will completely override any prior
10709 \begin_inset Flex Code
10712 \begin_layout Plain Layout
10718 declaration for this style.
10720 \begin_inset Quotes eld
10724 \begin_inset Flex Code
10727 \begin_layout Plain Layout
10734 \begin_inset Quotes erd
10739 \begin_inset CommandInset ref
10741 reference "sub:I18n"
10745 for details on its use.
10748 \begin_layout Description
10749 \begin_inset Flex Code
10752 \begin_layout Plain Layout
10759 \begin_inset Flex Code
10762 \begin_layout Plain Layout
10772 \begin_layout Plain Layout
10773 Note that a `float' here is a real number, such as: 1.5.
10778 The vertical space with which the last of a chain of paragraphs with this
10779 style is separated from the following paragraph.
10780 If the next paragraph has another style, the separations are not simply
10781 added, but the maximum is taken.
10784 \begin_layout Description
10785 \begin_inset Flex Code
10788 \begin_layout Plain Layout
10795 \begin_inset Flex Code
10798 \begin_layout Plain Layout
10804 The category for this style.
10805 This is used to group related styles in the style combobox on the toolbar.
10806 Any string can be used, but you may want to use existing categories with
10811 \begin_layout Description
10812 \begin_inset Flex Code
10815 \begin_layout Plain Layout
10821 Depth of XML command.
10822 Used only with XML-type formats.
10825 \begin_layout Description
10826 \begin_inset Flex Code
10829 \begin_layout Plain Layout
10836 \begin_inset Flex Code
10839 \begin_layout Plain Layout
10845 Copies all the features of an existing style into the current one.
10849 \begin_layout Description
10850 \begin_inset Flex Code
10853 \begin_layout Plain Layout
10859 The name of a style whose preamble should be output
10864 This allows to ensure some ordering of the preamble snippets when macros
10865 definitions depend on one another.
10869 \begin_layout Plain Layout
10870 Note that, besides that functionality, there is no way to ensure any ordering
10872 The ordering that you see in a given version of LyX may change without
10873 warning in later versions.
10881 \begin_layout Description
10882 \begin_inset Flex Code
10885 \begin_layout Plain Layout
10892 \begin_inset Flex Code
10895 \begin_layout Plain Layout
10900 , Box, Filled_Box, Static
10905 ] The type of label that stands at the end of the paragraph (or sequence
10907 \begin_inset Flex Code
10910 \begin_layout Plain Layout
10917 \begin_inset Flex Code
10920 \begin_layout Plain Layout
10927 \begin_inset Flex Code
10930 \begin_layout Plain Layout
10937 \begin_inset Flex Code
10940 \begin_layout Plain Layout
10948 \begin_inset Flex Code
10951 \begin_layout Plain Layout
10958 \begin_inset Quotes eld
10962 \begin_inset Quotes erd
10966 \begin_inset Flex Code
10969 \begin_layout Plain Layout
10976 \begin_inset Flex Code
10979 \begin_layout Plain Layout
10980 \begin_inset space ~
10988 ) is a white (resp.
10989 \begin_inset space ~
10992 black) square suitable for end of proof markers,
10993 \begin_inset Flex Code
10996 \begin_layout Plain Layout
11002 is an explicit text string.
11005 \begin_layout Description
11006 \begin_inset Flex Code
11009 \begin_layout Plain Layout
11016 \begin_inset Flex Code
11019 \begin_layout Plain Layout
11025 ] The string used for a label with a
11026 \begin_inset Flex Code
11029 \begin_layout Plain Layout
11036 \begin_inset Flex Code
11039 \begin_layout Plain Layout
11049 \begin_layout Description
11050 \begin_inset Flex Code
11053 \begin_layout Plain Layout
11059 The font used for both the text body
11065 \begin_inset space ~
11069 \begin_inset CommandInset ref
11071 reference "sub:Font-description"
11076 Note that defining this font automatically defines the
11077 \begin_inset Flex Code
11080 \begin_layout Plain Layout
11087 So you should define this one first if you also want to define
11088 \begin_inset Flex Code
11091 \begin_layout Plain Layout
11100 \begin_layout Description
11101 \begin_inset Flex Code
11104 \begin_layout Plain Layout
11111 \begin_inset CommandInset label
11113 name "des:FreeSpacing"
11118 \begin_inset Flex Code
11121 \begin_layout Plain Layout
11130 \begin_inset Flex Code
11133 \begin_layout Plain Layout
11139 ] Usually LyX doesn't allow you to insert more than one space between words,
11140 since a space is considered as the separation between two words, not a
11141 character or symbol of its own.
11142 This is a very fine thing but sometimes annoying, for example, when typing
11143 program code or plain LaTeX code.
11145 \begin_inset Flex Code
11148 \begin_layout Plain Layout
11155 Note that LyX will create protected blanks for the additional blanks when
11156 in another mode than LaTeX-mode.
11159 \begin_layout Description
11160 \begin_inset Flex Code
11163 \begin_layout Plain Layout
11169 These tags are used with XHTML output.
11171 \begin_inset CommandInset ref
11173 reference "sub:Paragraph-Style-XHTML"
11180 \begin_layout Description
11181 \begin_inset Flex Code
11184 \begin_layout Plain Layout
11190 [[FIXME]] (Used only with XML-type formats.)
11193 \begin_layout Description
11194 \begin_inset Flex Code
11197 \begin_layout Plain Layout
11204 \begin_inset Flex Code
11207 \begin_layout Plain Layout
11213 If 1, marks the style as to be included in the document preamble rather
11214 than in the document body.
11215 This is useful for document classes that want such information as the title
11216 and author to appear in the preamble.
11217 Note that this works only for styles for which the
11218 \begin_inset Flex Code
11221 \begin_layout Plain Layout
11228 \begin_inset Flex Code
11231 \begin_layout Plain Layout
11238 \begin_inset Flex Code
11241 \begin_layout Plain Layout
11250 \begin_layout Description
11251 \begin_inset Flex Code
11254 \begin_layout Plain Layout
11261 \begin_inset Flex Code
11264 \begin_layout Plain Layout
11270 If 1, marks the style as being part of a title block (see also the
11271 \begin_inset Flex Code
11274 \begin_layout Plain Layout
11281 \begin_inset Flex Code
11284 \begin_layout Plain Layout
11293 \begin_layout Description
11294 \begin_inset Flex Code
11297 \begin_layout Plain Layout
11304 \begin_inset Flex Code
11307 \begin_layout Plain Layout
11313 ] This provides extra space between paragraphs that have the same style.
11314 If you put other styles into an environment, each is separated with the
11316 \begin_inset Flex Code
11319 \begin_layout Plain Layout
11326 But the whole items of the environment are additionally separated with
11328 \begin_inset Flex Code
11331 \begin_layout Plain Layout
11338 Note that this is a
11343 \begin_layout Description
11344 \begin_inset Flex Code
11347 \begin_layout Plain Layout
11353 [[FIXME]] (Used only with XML-type formats.)
11356 \begin_layout Description
11357 \begin_inset Flex Code
11360 \begin_layout Plain Layout
11367 \begin_inset Flex Code
11370 \begin_layout Plain Layout
11379 \begin_inset Flex Code
11382 \begin_layout Plain Layout
11388 ] Usually LyX does not allow you to leave a paragraph empty, since it would
11389 lead to empty LaTeX output.
11390 There are some cases where this could be desirable however: in a letter
11391 template, the required fields can be provided as empty fields, so that
11392 people do not forget them; in some special classes, a style can be used
11393 as some kind of break, which does not contain actual text.
11396 \begin_layout Description
11397 \begin_inset Flex Code
11400 \begin_layout Plain Layout
11406 [float=0] The vertical space between the label and the text body.
11407 Only used for labels that are above the text body (
11408 \begin_inset Flex Code
11411 \begin_layout Plain Layout
11418 \begin_inset Flex Code
11421 \begin_layout Plain Layout
11422 Centered_Top_Environment
11430 \begin_layout Description
11431 \begin_inset Flex Code
11434 \begin_layout Plain Layout
11441 \begin_inset Flex Code
11444 \begin_layout Plain Layout
11451 \begin_inset Newline newline
11454 The name of the counter for automatic numbering.
11456 \begin_inset Newline newline
11464 \begin_inset Flex Code
11467 \begin_layout Plain Layout
11474 \begin_inset Flex Code
11477 \begin_layout Plain Layout
11484 In that case, the counter will be stepped each time the style appears.
11486 \begin_inset Newline newline
11494 \begin_inset Flex Code
11497 \begin_layout Plain Layout
11504 \begin_inset Flex Code
11507 \begin_layout Plain Layout
11513 , though this case is a bit complicated.
11514 Suppose you declare
11515 \begin_inset Quotes eld
11519 \begin_inset Flex Code
11522 \begin_layout Plain Layout
11523 LabelCounter myenum
11529 \begin_inset Quotes erd
11533 Then the actual counters used are
11534 \begin_inset Flex Code
11537 \begin_layout Plain Layout
11544 \begin_inset Flex Code
11547 \begin_layout Plain Layout
11554 \begin_inset Flex Code
11557 \begin_layout Plain Layout
11564 \begin_inset Flex Code
11567 \begin_layout Plain Layout
11573 , much as in LaTeX.
11574 These counters must all be declared separately.
11575 \begin_inset Newline newline
11579 \begin_inset CommandInset ref
11581 reference "sub:Counters"
11585 for details on counters.
11588 \begin_layout Description
11589 \begin_inset Flex Code
11592 \begin_layout Plain Layout
11598 The font used for the label.
11600 \begin_inset space ~
11604 \begin_inset CommandInset ref
11606 reference "sub:Font-description"
11613 \begin_layout Description
11614 \begin_inset Flex Code
11617 \begin_layout Plain Layout
11623 Text that indicates how far a label should be indented.
11626 \begin_layout Description
11627 \begin_inset Flex Code
11630 \begin_layout Plain Layout
11637 \begin_inset Flex Code
11640 \begin_layout Plain Layout
11646 ] The horizontal space between the label and the text body.
11647 Only used for labels that are not above the text body.
11650 \begin_layout Description
11651 \begin_inset Flex Code
11654 \begin_layout Plain Layout
11661 \begin_inset Flex Code
11664 \begin_layout Plain Layout
11670 ] The string used for a label with a
11671 \begin_inset Flex Code
11674 \begin_layout Plain Layout
11682 \begin_inset Flex Code
11685 \begin_layout Plain Layout
11691 is set, this string can be contain the special formatting commands described
11693 \begin_inset CommandInset ref
11695 reference "sub:Counters"
11703 \begin_layout Plain Layout
11704 For the sake of backwards compatibility, the string
11705 \begin_inset Flex Code
11708 \begin_layout Plain Layout
11718 will be replaced by the expanded
11719 \begin_inset Flex Code
11722 \begin_layout Plain Layout
11729 \begin_inset Flex Code
11732 \begin_layout Plain Layout
11741 This feature is now obsolete and should be replaced by the mechanisms of
11743 \begin_inset CommandInset ref
11745 reference "sub:Counters"
11757 \begin_layout Description
11758 \begin_inset Flex Code
11761 \begin_layout Plain Layout
11762 LabelStringAppendix
11768 \begin_inset Flex Code
11771 \begin_layout Plain Layout
11777 ] This is used inside the appendix instead of
11778 \begin_inset Flex Code
11781 \begin_layout Plain Layout
11789 \begin_inset Flex Code
11792 \begin_layout Plain Layout
11799 \begin_inset Flex Code
11802 \begin_layout Plain Layout
11803 LabelStringAppendix
11811 \begin_layout Description
11812 \begin_inset Flex Code
11815 \begin_layout Plain Layout
11821 [FIXME] (Used only with XML-type formats.)
11824 \begin_layout Description
11825 \begin_inset Flex Code
11828 \begin_layout Plain Layout
11835 \begin_inset Flex Code
11838 \begin_layout Plain Layout
11843 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
11844 Enumerate, Itemize, Bibliography
11853 \begin_layout Itemize
11854 \begin_inset Flex Code
11857 \begin_layout Plain Layout
11863 means the label is the very first word (up to the first real blank).
11864 Use protected spaces (like
11865 \begin_inset space ~
11868 that one) if you want more than one word as the label.
11872 \begin_layout Itemize
11873 \begin_inset Flex Code
11876 \begin_layout Plain Layout
11882 means the label is simply whatever
11883 \begin_inset Flex Code
11886 \begin_layout Plain Layout
11893 Note that this really is `static'.
11896 \begin_layout Itemize
11897 \begin_inset Flex Code
11900 \begin_layout Plain Layout
11907 \begin_inset Flex Code
11910 \begin_layout Plain Layout
11911 Centered_Top_Environment
11916 are special cases of
11917 \begin_inset Flex Code
11920 \begin_layout Plain Layout
11927 The label will be printed above the paragraph, but only at the top of an
11928 environment or the top of a chain of paragraphs with this style.
11929 This might be used with the
11930 \begin_inset Flex MenuItem
11933 \begin_layout Plain Layout
11939 style, for example.
11942 \begin_layout Itemize
11943 \begin_inset Flex Code
11946 \begin_layout Plain Layout
11952 is a special case for the caption-labels
11953 \begin_inset Quotes eld
11957 \begin_inset Quotes erd
11961 \begin_inset Quotes eld
11965 \begin_inset Quotes erd
11970 \begin_inset Flex Code
11973 \begin_layout Plain Layout
11979 means the (hardcoded) label string depends on the kind of float: It is
11980 hardcoded to be `FloatType N', where N is the value of the counter associated
11984 \begin_layout Itemize
11986 \begin_inset Flex Code
11989 \begin_layout Plain Layout
11995 label type defines automatically numbered labels.
11997 \begin_inset Flex Code
12000 \begin_layout Plain Layout
12006 will be expanded to resolve any counter references it contains: For example,
12008 \begin_inset Quotes eld
12012 \begin_inset Flex Code
12015 \begin_layout Plain Layout
12026 \begin_inset Quotes erd
12031 \begin_inset CommandInset ref
12033 reference "sub:Counters"
12037 for more information on counters.
12040 \begin_layout Itemize
12041 \begin_inset Flex Code
12044 \begin_layout Plain Layout
12050 produces the usual sort of enumeration labels.
12051 At present, it is hardcoded to use Arabic numerals, lowercase letters,
12052 small Roman numerals, and uppercase letters for the four possible depths.
12055 \begin_layout Itemize
12056 \begin_inset Flex Code
12059 \begin_layout Plain Layout
12065 produces various bullets at the different levels.
12066 It is also hardcoded.
12069 \begin_layout Itemize
12070 \begin_inset Flex Code
12073 \begin_layout Plain Layout
12079 is used internally by LyX and should be used only with
12080 \begin_inset Flex Code
12083 \begin_layout Plain Layout
12084 LatexType BibEnvironment
12093 \begin_layout Description
12094 \begin_inset Flex Code
12097 \begin_layout Plain Layout
12103 Note that this will completely override any prior
12104 \begin_inset Flex Code
12107 \begin_layout Plain Layout
12113 declaration for this style.
12115 \begin_inset Quotes eld
12119 \begin_inset Flex Code
12122 \begin_layout Plain Layout
12129 \begin_inset Quotes erd
12134 \begin_inset CommandInset ref
12136 reference "sub:I18n"
12140 for details on its use.
12143 \begin_layout Description
12144 \begin_inset Flex Code
12147 \begin_layout Plain Layout
12153 The name of the corresponding LaTeX stuff.
12154 Either the environment or command name.
12157 \begin_layout Description
12158 \begin_inset Flex Code
12161 \begin_layout Plain Layout
12167 An optional parameter for the corresponding
12168 \begin_inset Flex Code
12171 \begin_layout Plain Layout
12178 This parameter cannot be changed from within LyX.
12181 \begin_layout Description
12182 \begin_inset Flex Code
12185 \begin_layout Plain Layout
12192 \begin_inset Flex Code
12195 \begin_layout Plain Layout
12200 , Command, Environment, Item_Environment,
12206 \begin_inset Flex Code
12209 \begin_layout Plain Layout
12210 List_Environment, Bib_Environment
12215 ] How the style should be translated into LaTeX.
12219 \begin_layout Plain Layout
12220 \begin_inset Flex Code
12223 \begin_layout Plain Layout
12229 is perhaps a bit misleading, since these rules apply to SGML classes, too.
12230 Visit the SGML class files for specific examples.
12239 \begin_layout Itemize
12240 \begin_inset Flex Code
12243 \begin_layout Plain Layout
12249 means nothing special.
12253 \begin_layout Itemize
12254 \begin_inset Flex Code
12257 \begin_layout Plain Layout
12264 \begin_inset Flex Code
12267 \begin_layout Plain Layout
12274 {\SpecialChar \ldots{}
12283 \begin_layout Itemize
12284 \begin_inset Flex Code
12287 \begin_layout Plain Layout
12294 \begin_inset Flex Code
12297 \begin_layout Plain Layout
12304 }\SpecialChar \ldots{}
12320 \begin_layout Itemize
12321 \begin_inset Flex Code
12324 \begin_layout Plain Layout
12331 \begin_inset Flex Code
12334 \begin_layout Plain Layout
12341 \begin_inset Flex Code
12344 \begin_layout Plain Layout
12352 is generated for each paragraph of this environment.
12356 \begin_layout Itemize
12357 \begin_inset Flex Code
12360 \begin_layout Plain Layout
12367 \begin_inset Flex Code
12370 \begin_layout Plain Layout
12377 \begin_inset Flex Code
12380 \begin_layout Plain Layout
12386 is passed as an argument to the environment.
12388 \begin_inset Flex Code
12391 \begin_layout Plain Layout
12397 can be defined in the
12398 \begin_inset Flex MenuItem
12401 \begin_layout Plain Layout
12402 Edit\SpecialChar \menuseparator
12404 \begin_inset space ~
12416 \begin_layout Standard
12417 Putting the last few things together, the LaTeX output will be either:
12420 \begin_layout LyX-Code
12423 latexname[latexparam]{\SpecialChar \ldots{}
12427 \begin_layout Standard
12431 \begin_layout LyX-Code
12434 begin{latexname}[latexparam] \SpecialChar \ldots{}
12440 \begin_layout Standard
12441 depending upon the LaTeX type.
12445 \begin_layout Description
12447 \change_inserted -712698321 1353866861
12448 \begin_inset Flex Code
12451 \begin_layout Plain Layout
12453 \change_inserted -712698321 1353866852
12460 \begin_inset Flex Code
12463 \begin_layout Plain Layout
12465 \change_inserted -712698321 1353866852
12471 ] A string that is put at the beginning of the style content.
12474 \begin_layout Description
12475 \begin_inset Flex Code
12478 \begin_layout Plain Layout
12485 \begin_inset Flex Code
12488 \begin_layout Plain Layout
12494 ] If you put styles into environments, the leftmargins are not simply added,
12495 but added with a factor
12496 \begin_inset Formula $\frac{4}{depth+4}$
12500 Note that this parameter is also used when the margin is defined as
12501 \begin_inset Flex Code
12504 \begin_layout Plain Layout
12511 \begin_inset Flex Code
12514 \begin_layout Plain Layout
12521 Then it is added to the manual or dynamic margin.
12523 \begin_inset Newline newline
12526 The argument is passed as a string.
12528 \begin_inset Quotes eld
12532 \begin_inset Flex Code
12535 \begin_layout Plain Layout
12542 \begin_inset Quotes erd
12545 means that the paragraph is indented with the width of
12546 \begin_inset Quotes eld
12550 \begin_inset Flex Code
12553 \begin_layout Plain Layout
12560 \begin_inset Quotes erd
12563 in the normal font.
12564 You can get a negative width by prefixing the string with
12565 \begin_inset Quotes eld
12569 \begin_inset Flex Code
12572 \begin_layout Plain Layout
12579 \begin_inset Quotes erd
12583 This way was chosen so that the look is the same with each used screen
12588 \begin_layout Description
12589 \begin_inset Flex Code
12592 \begin_layout Plain Layout
12599 \begin_inset Flex Code
12602 \begin_layout Plain Layout
12607 , Manual, Dynamic, First_Dynamic, Right_Address_Box
12613 \begin_inset Newline newline
12616 The kind of margin that the style has on the left side.
12618 \begin_inset Flex Code
12621 \begin_layout Plain Layout
12627 just means a fixed margin.
12629 \begin_inset Flex Code
12632 \begin_layout Plain Layout
12638 means that the left margin depends on the string entered in the
12639 \begin_inset Flex MenuItem
12642 \begin_layout Plain Layout
12643 Edit\SpecialChar \menuseparator
12645 \begin_inset space ~
12654 This is used to typeset nice lists without tabulators.
12656 \begin_inset Flex Code
12659 \begin_layout Plain Layout
12665 means that the margin depends on the size of the label.
12666 This is used for automatic enumerated headlines.
12667 It is obvious that the headline
12668 \begin_inset Quotes eld
12671 5.4.3.2.1 Very long headline
12672 \begin_inset Quotes erd
12675 must have a wider left margin (as wide as
12676 \begin_inset Quotes eld
12680 \begin_inset Quotes erd
12683 plus the space) than
12684 \begin_inset Quotes eld
12687 3.2 Very long headline
12688 \begin_inset Quotes erd
12692 \begin_inset Quotes eld
12696 \begin_inset Quotes erd
12699 are not able to do this.
12701 \begin_inset Flex Code
12704 \begin_layout Plain Layout
12710 is similar, but only the very first row of the paragraph is dynamic, while
12711 the others are static; this is used, for example, for descriptions.
12713 \begin_inset Flex Code
12716 \begin_layout Plain Layout
12722 means the margin is chosen in a way that the longest row of this paragraph
12723 fits to the right margin.
12724 This is used to typeset an address on the right edge of the page.
12727 \begin_layout Description
12728 \begin_inset Flex Code
12731 \begin_layout Plain Layout
12738 \begin_inset Flex Code
12741 \begin_layout Plain Layout
12750 \begin_inset Flex Code
12753 \begin_layout Plain Layout
12759 ] Whether fragile commands in this style should be
12760 \begin_inset Flex Code
12763 \begin_layout Plain Layout
12776 whether this command should itself be protected.)
12779 \begin_layout Description
12780 \begin_inset Flex Code
12783 \begin_layout Plain Layout
12790 \begin_inset Flex Code
12793 \begin_layout Plain Layout
12800 \begin_inset Flex Code
12803 \begin_layout Plain Layout
12811 ] Whether newlines are translated into LaTeX newlines (
12812 \begin_inset Flex Code
12815 \begin_layout Plain Layout
12826 The translation can be switched off to allow more comfortable LaTeX editing
12830 \begin_layout Description
12831 \begin_inset Flex Code
12834 \begin_layout Plain Layout
12841 \begin_inset Flex Code
12844 \begin_layout Plain Layout
12851 \begin_inset Flex Code
12854 \begin_layout Plain Layout
12862 ] If set to true, and if
12863 \begin_inset Flex Code
12866 \begin_layout Plain Layout
12873 \begin_inset Flex Code
12876 \begin_layout Plain Layout
12882 ) paragraphs are being indented, then the indentation of such a paragraph
12883 following one of this type will be suppressed.
12884 (So this will not affect the display of non-default paragraphs.)
12887 \begin_layout Description
12888 \begin_inset Flex Code
12891 \begin_layout Plain Layout
12897 Name of a style that has replaced this style.
12898 This is used to rename a style, while keeping backward compatibility.
12901 \begin_layout Description
12903 \change_deleted -712698321 1353679722
12904 \begin_inset Flex Code
12907 \begin_layout Plain Layout
12914 \begin_inset Flex Code
12917 \begin_layout Plain Layout
12923 ] The number of optional arguments that can be used with this style.
12924 This is useful for things like section headings, and only makes sense with
12926 Note that, on output, the optional arguments will all precede any required
12927 arguments (see below).
12928 So one can have constructs like:
12932 \begin_layout LyX-Code
12934 \change_deleted -712698321 1353679722
12937 mycmd[opt1]{req1}{contents of paragraph}
12940 \begin_layout Standard
12942 \change_deleted -712698321 1353679722
12943 but one cannot have things like:
12946 \begin_layout LyX-Code
12948 \change_deleted -712698321 1353679722
12951 mycmd[opt1]{req1}[opt2]{contents of paragraph}
12954 \begin_layout Standard
12956 \change_deleted -712698321 1353679722
12957 at least, not without ERT (with which you can have anything).
12964 \begin_layout Description
12965 \begin_inset Flex Code
12968 \begin_layout Plain Layout
12975 \begin_inset Flex Code
12978 \begin_layout Plain Layout
12987 \begin_inset Flex Code
12990 \begin_layout Plain Layout
12996 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
12997 output, but only by a line break; together with
12998 \begin_inset Flex Code
13001 \begin_layout Plain Layout
13007 , this allows to emulate a plain text editor (like the ERT inset).
13010 \begin_layout Description
13011 \begin_inset Flex Code
13014 \begin_layout Plain Layout
13021 \begin_inset Flex Code
13024 \begin_layout Plain Layout
13030 ] The indent of the very first line of a paragraph.
13032 \begin_inset Flex Code
13035 \begin_layout Plain Layout
13041 will be fixed for a certain style.
13042 The exception is the default style, since the indentation for these paragraphs
13043 can be prohibited with
13044 \begin_inset Flex Code
13047 \begin_layout Plain Layout
13055 \begin_inset Flex Code
13058 \begin_layout Plain Layout
13064 style paragraphs inside environments use the
13065 \begin_inset Flex Code
13068 \begin_layout Plain Layout
13074 of the environment, not their native one.
13076 \begin_inset Flex Code
13079 \begin_layout Plain Layout
13085 paragraphs inside an enumeration are not indented.
13088 \begin_layout Description
13089 \begin_inset Flex Code
13092 \begin_layout Plain Layout
13099 \begin_inset Flex Code
13102 \begin_layout Plain Layout
13108 ] The vertical space between two paragraphs of this style.
13111 \begin_layout Description
13112 \begin_inset Flex Code
13115 \begin_layout Plain Layout
13122 \begin_inset Flex Code
13125 \begin_layout Plain Layout
13131 ] LyX allows the user to choose either
13132 \begin_inset Quotes eld
13136 \begin_inset Quotes erd
13140 \begin_inset Quotes eld
13144 \begin_inset Quotes erd
13147 to typeset a document.
13149 \begin_inset Quotes eld
13153 \begin_inset Quotes erd
13156 is chosen, this value is completely ignored.
13158 \begin_inset Quotes eld
13162 \begin_inset Quotes erd
13165 is chosen, the parindent of a LaTeXtype
13166 \begin_inset Quotes eld
13170 \begin_inset Quotes erd
13173 style is ignored and all paragraphs are separated by this parskip argument.
13174 The vertical space is calculated with
13175 \begin_inset Flex Code
13178 \begin_layout Plain Layout
13180 \begin_inset space ~
13189 \begin_inset Flex Code
13192 \begin_layout Plain Layout
13198 is the height of a row with the normal font.
13199 This way, the look stays the same with different screen fonts.
13202 \begin_layout Description
13203 \begin_inset Flex Code
13206 \begin_layout Plain Layout
13213 \begin_inset Flex Code
13216 \begin_layout Plain Layout
13225 \begin_inset Flex Code
13228 \begin_layout Plain Layout
13234 ] Whether the contents of this paragraph should be output in raw form, meaning
13235 without special translations that LaTeX would require.
13238 \begin_layout Description
13239 \begin_inset Flex Code
13242 \begin_layout Plain Layout
13248 Information to be included in the LaTeX preamble when this style is used.
13249 Used to define macros, load packages, etc., required by this particular
13252 \begin_inset Quotes eld
13256 \begin_inset Flex Code
13259 \begin_layout Plain Layout
13266 \begin_inset Quotes erd
13272 \begin_layout Description
13273 \begin_inset Flex Code
13276 \begin_layout Plain Layout
13283 \begin_inset Flex Code
13286 \begin_layout Plain Layout
13292 ] The prefix to use when creating labels referring to paragraphs of this
13294 This allows the use of formatted references.
13297 \begin_layout Description
13299 \change_deleted -712698321 1353681258
13300 \begin_inset Flex Code
13303 \begin_layout Plain Layout
13310 \begin_inset Flex Code
13313 \begin_layout Plain Layout
13319 ] The number of required arguments that the LaTeX command or environment
13320 corresponding to this style expects.
13321 In the case of a command, these are required arguments
13325 that associated with the content of the paragraph itself.
13326 These do not actually have to be provided: LyX will output empty arguments
13328 Note that optional arguments will be output before required arguments.
13329 See the discussion of the
13330 \begin_inset Flex Code
13333 \begin_layout Plain Layout
13339 tag above for more information.
13344 \begin_layout Description
13345 \begin_inset Flex Code
13348 \begin_layout Plain Layout
13355 \begin_inset Flex Code
13358 \begin_layout Plain Layout
13364 ] Whether the style requires the feature
13365 \begin_inset Flex Code
13368 \begin_layout Plain Layout
13375 See the description of
13376 \begin_inset Flex Code
13379 \begin_layout Plain Layout
13386 \begin_inset CommandInset ref
13387 LatexCommand pageref
13388 reference "des:FreeSpacing"
13392 ) for information on `features'.
13394 \change_inserted -712698321 1353693134
13398 \begin_layout Description
13400 \change_inserted -712698321 1353693371
13401 \begin_inset Flex Code
13404 \begin_layout Plain Layout
13406 \change_inserted -712698321 1353693146
13415 \begin_inset Flex Code
13418 \begin_layout Plain Layout
13420 \change_inserted -712698321 1353693235
13429 \begin_inset Flex Code
13432 \begin_layout Plain Layout
13434 \change_inserted -712698321 1353693235
13440 ] Resets the LaTeX arguments of this style (as defined via the
13441 \begin_inset Flex Code
13444 \begin_layout Plain Layout
13446 \change_inserted -712698321 1353693371
13455 This is useful if you have copied a style via
13456 \begin_inset Flex Code
13459 \begin_layout Plain Layout
13461 \change_inserted -712698321 1353693302
13469 , but you do not want to inherit its (required and optional) arguments.
13474 \begin_layout Description
13476 \change_inserted -712698321 1353866881
13477 \begin_inset Flex Code
13480 \begin_layout Plain Layout
13482 \change_inserted -712698321 1353866876
13489 \begin_inset Flex Code
13492 \begin_layout Plain Layout
13494 \change_inserted -712698321 1353866873
13500 ] A string that is put at the end of the layout content.
13503 \begin_layout Description
13504 \begin_inset Flex Code
13507 \begin_layout Plain Layout
13514 \begin_inset Flex Code
13517 \begin_layout Plain Layout
13524 \begin_inset Flex Code
13527 \begin_layout Plain Layout
13536 \begin_layout Description
13537 \begin_inset Flex Code
13540 \begin_layout Plain Layout
13547 \begin_inset Flex Code
13550 \begin_layout Plain Layout
13555 , onehalf, double, other
13564 ] This defines what the default spacing should be in the style.
13566 \begin_inset Flex Code
13569 \begin_layout Plain Layout
13576 \begin_inset Flex Code
13579 \begin_layout Plain Layout
13586 \begin_inset Flex Code
13589 \begin_layout Plain Layout
13595 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
13596 If you specify the argument
13597 \begin_inset Flex Code
13600 \begin_layout Plain Layout
13606 , then you should also provide a numerical argument which will be the actual
13608 Note that, contrary to other parameters,
13609 \begin_inset Flex Code
13612 \begin_layout Plain Layout
13618 implies the generation of specific LaTeX code, using the package
13621 \begin_inset Flex Code
13624 \begin_layout Plain Layout
13633 \begin_layout Description
13634 \begin_inset Flex Code
13637 \begin_layout Plain Layout
13644 \begin_inset Flex Code
13647 \begin_layout Plain Layout
13654 \begin_inset Flex Code
13657 \begin_layout Plain Layout
13665 ] Spellcheck paragraphs of this style.
13669 \begin_layout Description
13670 \begin_inset Flex Code
13673 \begin_layout Plain Layout
13679 The font used for the text body .
13681 \begin_inset CommandInset ref
13683 reference "sub:Font-description"
13690 \begin_layout Description
13691 \begin_inset Flex Code
13694 \begin_layout Plain Layout
13703 \begin_inset Flex Code
13706 \begin_layout Plain Layout
13716 The level of the style in the table of contents.
13717 This is used for automatic numbering of section headings.
13720 \begin_layout Description
13721 \begin_inset Flex Code
13724 \begin_layout Plain Layout
13731 \begin_inset Flex Code
13734 \begin_layout Plain Layout
13740 ] The vertical space with which the very first of a chain of paragraphs
13741 with this style is separated from the previous paragraph.
13742 If the previous paragraph has another style, the separations are not simply
13743 added, but the maximum is taken.
13746 \begin_layout Subsection
13747 \begin_inset CommandInset label
13753 Internationalization of Paragraph Styles
13756 \begin_layout Standard
13757 LyX has long supported internationalization of layout information, but,
13758 until version 2.0, this applied only to the user interface and not to, say,
13760 Thus, French authors were forced to resort to ugly hacks if they wanted
13765 1' instead of `Theorem 1'.
13766 Thanks to Georg Baum, that is no longer the case.
13769 \begin_layout Standard
13771 \begin_inset Flex Code
13774 \begin_layout Plain Layout
13780 defines text that is to appear in the typeset document, it may use
13781 \begin_inset Flex Code
13784 \begin_layout Plain Layout
13791 \begin_inset Flex Code
13794 \begin_layout Plain Layout
13800 to support non-English and even multi-language documents correctly.
13801 The following excerpt (from the
13802 \begin_inset Flex Code
13805 \begin_layout Plain Layout
13811 file) shows how this works:
13814 \begin_layout LyX-Code
13819 \begin_layout LyX-Code
13822 theoremstyle{remark}
13825 \begin_layout LyX-Code
13828 newtheorem{claim}[thm]{
13835 \begin_layout LyX-Code
13839 \begin_layout LyX-Code
13843 \begin_layout LyX-Code
13848 claimname}{_(Claim)}
13851 \begin_layout LyX-Code
13855 \begin_layout LyX-Code
13859 \begin_layout LyX-Code
13868 claimname}{_(Claim)}}
13871 \begin_layout LyX-Code
13876 \begin_layout Standard
13877 In principle, any legal LaTeX may appear in the
13878 \begin_inset Flex Code
13881 \begin_layout Plain Layout
13888 \begin_inset Flex Code
13891 \begin_layout Plain Layout
13897 tags, but in practice they will typically look as they do here.
13898 The key to correct translation of the typeset text is the definition of
13900 \begin_inset Flex Code
13903 \begin_layout Plain Layout
13912 \begin_inset Flex Code
13915 \begin_layout Plain Layout
13927 \begin_layout Standard
13929 \begin_inset Flex Code
13932 \begin_layout Plain Layout
13938 tag provides for internationalization based upon the overall language of
13940 The contents of the tag will be included in the preamble, just as with
13942 \begin_inset Flex Code
13945 \begin_layout Plain Layout
13952 What makes it special is the use of the
13953 \begin_inset Quotes eld
13957 \begin_inset Quotes erd
13961 \begin_inset Flex Code
13964 \begin_layout Plain Layout
13970 , which will be replaced, when LyX produces LaTeX output, with the translation
13971 of its argument into the document language.
13974 \begin_layout Standard
13976 \begin_inset Flex Code
13979 \begin_layout Plain Layout
13985 tag is more complex, since it is meant to provide support for multi-language
13986 documents and so offers an interface to the
13987 \begin_inset Flex Code
13990 \begin_layout Plain Layout
13997 Its contents will be added to the preamble once for each language that
13998 appears in the document.
13999 In this case, the argument to
14000 \begin_inset Flex Code
14003 \begin_layout Plain Layout
14009 will be replaced with its translation into the language in question; the
14011 \begin_inset Flex Code
14014 \begin_layout Plain Layout
14020 is replaced by the language name (as used by the babel package).
14023 \begin_layout Standard
14024 A German document that also included a French section would thus have the
14025 following in the preamble:
14028 \begin_layout LyX-Code
14037 claimname}{Affirmation}}
14045 claimname}{Behauptung}}
14049 claimname}{Behauptung}
14052 \begin_layout Standard
14054 \begin_inset Flex Code
14057 \begin_layout Plain Layout
14063 will then conspire to produce the correct text in the output.
14066 \begin_layout Standard
14067 One important point to note here is that the translations are provided by
14068 LyX itself, through the
14069 \change_inserted -195340706 1334775793
14071 \begin_inset Flex Code
14074 \begin_layout Plain Layout
14076 \change_inserted -195340706 1334775793
14083 \change_deleted -195340706 1334775793
14084 same mechanism it uses for internationalization of the user interface
14087 This means, in effect, that
14088 \begin_inset Flex Code
14091 \begin_layout Plain Layout
14098 \begin_inset Flex Code
14101 \begin_layout Plain Layout
14107 are really only of use in layout files that are provided with LyX, since
14108 text entered in user-created layout files will not be seen by LyX's internation
14110 \change_inserted -195340706 1334775793
14112 \begin_inset Flex Code
14115 \begin_layout Plain Layout
14117 \change_inserted -195340706 1334775793
14123 file is modified accordingly
14126 That said, however, any layout created with the intention that it will
14127 be included with LyX should use these tags where appropriate.
14129 \change_inserted -195340706 1334775793
14130 Please note that the paragraph style translations provided by LyX will
14131 never change with a minor update (e.g.
14132 from version 2.1.x to 2.1.y).
14133 It is however quite likely that a major update (e.g.
14134 from 2.0.x to 2.1.y) will introduce new translations or corrections.
14139 \begin_layout Subsection
14141 \begin_inset CommandInset label
14150 \begin_layout Standard
14151 Since version 1.3.0 of LyX, it is has been both possible and necessary to
14152 define the floats (
14153 \begin_inset Flex MenuItem
14156 \begin_layout Plain Layout
14163 \begin_inset Flex MenuItem
14166 \begin_layout Plain Layout
14172 , \SpecialChar \ldots{}
14173 ) in the text class itself.
14174 Standard floats are included in the file
14175 \begin_inset Flex Code
14178 \begin_layout Plain Layout
14184 , so you may have to do no more than add
14187 \begin_layout LyX-Code
14188 Input stdfloats.inc
14191 \begin_layout Standard
14192 to your layout file.
14193 If you want to implement a text class that proposes some other float types
14194 (like the AGU class bundled with LyX), the information below will hopefully
14198 \begin_layout Description
14199 \begin_inset Flex Code
14202 \begin_layout Plain Layout
14209 \begin_inset Flex Code
14212 \begin_layout Plain Layout
14219 \begin_inset Quotes erd
14223 \begin_inset Quotes erd
14226 ] The file name extension of an auxiliary file for the list of figures (or
14228 LaTeX writes the captions to this file.
14231 \begin_layout Description
14232 \begin_inset Flex Code
14235 \begin_layout Plain Layout
14242 \begin_inset Flex Code
14245 \begin_layout Plain Layout
14252 \begin_inset Quotes erd
14256 \begin_inset Quotes erd
14259 ] The string that will be used in the menus and also for the caption.
14260 This is translated to the current language if babel is used.
14263 \begin_layout Description
14264 \begin_inset Flex Code
14267 \begin_layout Plain Layout
14273 These are used for XHTML output.
14275 \begin_inset CommandInset ref
14277 reference "sec:Tags-for-XHTML"
14284 \begin_layout Description
14285 \begin_inset Flex Code
14288 \begin_layout Plain Layout
14297 \begin_inset Flex Code
14300 \begin_layout Plain Layout
14309 \begin_inset Flex Code
14312 \begin_layout Plain Layout
14318 ] Indicates whether the float is already defined in the document class or
14319 if we instead need to load
14320 \begin_inset Flex Code
14323 \begin_layout Plain Layout
14329 and use what it provides to define it on-the-fly.
14331 \begin_inset Flex Code
14334 \begin_layout Plain Layout
14341 \begin_inset Flex Code
14344 \begin_layout Plain Layout
14351 It should be set to
14352 \begin_inset Flex Code
14355 \begin_layout Plain Layout
14361 if the float is already defined by the LaTeX document class.
14364 \begin_layout Description
14365 \begin_inset Flex Code
14368 \begin_layout Plain Layout
14375 \begin_inset Flex Code
14378 \begin_layout Plain Layout
14385 \begin_inset Quotes erd
14389 \begin_inset Quotes erd
14392 ] The command used to generate a list of floats of this type; the leading
14395 ' should be omitted.
14401 \begin_inset Flex Code
14404 \begin_layout Plain Layout
14410 is false, since there is no standard way to generate this command.
14412 \begin_inset Flex Code
14415 \begin_layout Plain Layout
14421 is true, since in that case there is a standard way to define the command.
14424 \begin_layout Description
14425 \begin_inset Flex Code
14428 \begin_layout Plain Layout
14435 \begin_inset Flex Code
14438 \begin_layout Plain Layout
14445 \begin_inset Quotes erd
14449 \begin_inset Quotes erd
14452 ] A title for a list of floats of this kind (list of figures, tables, or
14454 It is used for the screen label within LyX; it is passed to LaTeX for use
14455 as the title there; and it is used as the title in XHTML output.
14456 It will be translated to the document language.
14459 \begin_layout Description
14460 \begin_inset Flex Code
14463 \begin_layout Plain Layout
14470 \begin_inset Flex Code
14473 \begin_layout Plain Layout
14480 \begin_inset Quotes erd
14484 \begin_inset Quotes erd
14487 ] This (optional) argument determines whether floats of this class will
14488 be numbered within some sectional unit of the document.
14489 For example, if within is equal to
14490 \begin_inset Flex Code
14493 \begin_layout Plain Layout
14499 , the floats will be numbered within chapters.
14503 \begin_layout Description
14504 \begin_inset Flex Code
14507 \begin_layout Plain Layout
14514 \begin_inset Flex Code
14517 \begin_layout Plain Layout
14524 \begin_inset Quotes erd
14528 \begin_inset Quotes erd
14531 ] The default placement for the given class of floats.
14532 The string should be as in standard LaTeX:
14533 \begin_inset Flex Code
14536 \begin_layout Plain Layout
14543 \begin_inset Flex Code
14546 \begin_layout Plain Layout
14553 \begin_inset Flex Code
14556 \begin_layout Plain Layout
14563 \begin_inset Flex Code
14566 \begin_layout Plain Layout
14572 for top, bottom, page, and here, respectively.
14576 \begin_layout Plain Layout
14577 Note that the order of these letters in the string is irrelevant, like in
14583 On top of that there is a new type,
14584 \begin_inset Flex Code
14587 \begin_layout Plain Layout
14593 , which does not really correspond to a float, since it means: put it
14594 \begin_inset Quotes eld
14598 \begin_inset Quotes erd
14602 Note however that the
14603 \begin_inset Flex Code
14606 \begin_layout Plain Layout
14612 specifier is special and, because of implementation details, cannot be
14613 used in non-built in float types.
14614 If you do not understand what this means, just use
14615 \begin_inset Quotes eld
14619 \begin_inset Flex Code
14622 \begin_layout Plain Layout
14629 \begin_inset Quotes erd
14635 \begin_layout Description
14636 \begin_inset Flex Code
14639 \begin_layout Plain Layout
14646 \begin_inset Flex Code
14649 \begin_layout Plain Layout
14655 ] The prefix to use when creating labels referring to floats of this type.
14656 This allows the use of formatted references.
14657 Note that you can remove any
14658 \begin_inset Flex Code
14661 \begin_layout Plain Layout
14667 set by a copied style by using the special value
14668 \begin_inset Quotes eld
14672 \begin_inset Quotes erd
14675 , which must be all caps.
14678 \begin_layout Description
14679 \begin_inset Flex Code
14682 \begin_layout Plain Layout
14689 \begin_inset Flex Code
14692 \begin_layout Plain Layout
14699 \begin_inset Quotes erd
14703 \begin_inset Quotes erd
14706 ] The style used when defining the float using
14707 \begin_inset Flex Code
14710 \begin_layout Plain Layout
14721 \begin_layout Description
14722 \begin_inset Flex Code
14725 \begin_layout Plain Layout
14732 \begin_inset Flex Code
14735 \begin_layout Plain Layout
14742 \begin_inset Quotes erd
14746 \begin_inset Quotes erd
14750 \begin_inset Quotes eld
14754 \begin_inset Quotes erd
14757 of the new class of floats, like program or algorithm.
14758 After the appropriate
14759 \begin_inset Flex Code
14762 \begin_layout Plain Layout
14771 \begin_inset Flex Code
14774 \begin_layout Plain Layout
14783 \begin_inset Flex Code
14786 \begin_layout Plain Layout
14797 \begin_layout Description
14798 \begin_inset Flex Code
14801 \begin_layout Plain Layout
14808 \begin_inset Flex Code
14811 \begin_layout Plain Layout
14818 \begin_inset Flex Code
14821 \begin_layout Plain Layout
14829 ] Tells us whether this float is defined using the facilities provided by
14831 \begin_inset Flex Code
14834 \begin_layout Plain Layout
14840 , either by the class file or a package, or on-the-fly by LyX itself.
14843 \begin_layout Standard
14844 Note that defining a float with type
14845 \begin_inset Flex Code
14848 \begin_layout Plain Layout
14856 automatically defines the corresponding counter with name
14857 \begin_inset Flex Code
14860 \begin_layout Plain Layout
14871 \begin_layout Subsection
14872 Flex insets and InsetLayout
14873 \begin_inset CommandInset label
14875 name "sub:Flex-insets-and"
14882 \begin_layout Standard
14883 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
14884 these are called Flex insets.
14888 \begin_layout Standard
14889 Flex insets come in three different kinds:
14892 \begin_layout Itemize
14894 \begin_inset Flex Code
14897 \begin_layout Plain Layout
14903 ): These define semantic markup corresponding to such LaTeX commands as
14905 \begin_inset Flex Code
14908 \begin_layout Plain Layout
14917 \begin_inset Flex Code
14920 \begin_layout Plain Layout
14931 \begin_layout Itemize
14933 \begin_inset Flex Code
14936 \begin_layout Plain Layout
14942 ): These can be used to define custom collapsible insets, similar to TeX
14943 code, footnote, and the like.
14944 An obvious example is an endnote inset, which is defined in the
14945 \begin_inset Flex Code
14948 \begin_layout Plain Layout
14957 \begin_layout Itemize
14959 \begin_inset Flex Code
14962 \begin_layout Plain Layout
14968 ): For use with DocBook classes.
14971 \begin_layout Standard
14972 Flex insets are defined using the
14973 \begin_inset Flex Code
14976 \begin_layout Plain Layout
14982 tag, which shall be explained in a moment.
14985 \begin_layout Standard
14987 \begin_inset Flex Code
14990 \begin_layout Plain Layout
14996 tag also serves another function: It can be used to customize the general
14997 layout of many different types of insets.
14999 \begin_inset Flex Code
15002 \begin_layout Plain Layout
15008 can be used to customize the layout parameters for footnotes, marginal
15009 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
15010 boxes, tables, algorithms, URLs, and optional arguments, as well as to
15011 define Flex insets.
15014 \begin_layout Standard
15016 \begin_inset Flex Code
15019 \begin_layout Plain Layout
15025 definition must begin with a line of the form:
15028 \begin_layout LyX-Code
15032 \begin_layout Standard
15034 \begin_inset Flex Code
15037 \begin_layout Plain Layout
15043 indicates the inset whose layout is being defined, and here there are
15044 \change_inserted 5863208 1334489266
15046 \change_deleted 5863208 1334489267
15052 \begin_layout Enumerate
15053 The layout for a pre-existing inset is being modified.
15054 In this case, can be
15055 \begin_inset Flex Code
15058 \begin_layout Plain Layout
15064 any one of the following:
15065 \begin_inset Flex Code
15068 \begin_layout Plain Layout
15075 \begin_inset Flex Code
15078 \begin_layout Plain Layout
15085 \begin_inset Flex Code
15088 \begin_layout Plain Layout
15095 \begin_inset Flex Code
15098 \begin_layout Plain Layout
15105 \begin_inset Flex Code
15108 \begin_layout Plain Layout
15115 \begin_inset Flex Code
15118 \begin_layout Plain Layout
15125 \begin_inset Flex Code
15128 \begin_layout Plain Layout
15135 \begin_inset Flex Code
15138 \begin_layout Plain Layout
15145 \begin_inset Flex Code
15148 \begin_layout Plain Layout
15155 \begin_inset Flex Code
15158 \begin_layout Plain Layout
15165 \begin_inset Flex Code
15168 \begin_layout Plain Layout
15175 \begin_inset Flex Code
15178 \begin_layout Plain Layout
15185 \begin_inset Flex Code
15188 \begin_layout Plain Layout
15195 \begin_inset Flex Code
15198 \begin_layout Plain Layout
15205 \begin_inset Flex Code
15208 \begin_layout Plain Layout
15215 \begin_inset Flex Code
15218 \begin_layout Plain Layout
15225 \begin_inset Flex Code
15228 \begin_layout Plain Layout
15235 \begin_inset Flex Code
15238 \begin_layout Plain Layout
15240 \change_deleted -712698321 1353866704
15244 \change_inserted -712698321 1353866707
15253 \begin_inset Flex Code
15256 \begin_layout Plain Layout
15263 \begin_inset Flex Code
15266 \begin_layout Plain Layout
15275 \begin_layout Enumerate
15276 The layout for a Flex inset is being defined.
15278 \begin_inset Flex Code
15281 \begin_layout Plain Layout
15287 must be of the form
15288 \begin_inset Quotes eld
15292 \begin_inset Flex Code
15295 \begin_layout Plain Layout
15302 \begin_inset Quotes erd
15306 \begin_inset Flex Code
15309 \begin_layout Plain Layout
15315 may be be any valid identifier not used by a pre-existing Flex inset.
15316 The identifier may include spaces, but in that case the whole thing must
15317 be wrapped in quotes.
15318 Note that the definition of a flex inset
15323 \begin_inset Flex Code
15326 \begin_layout Plain Layout
15332 entry, declaring which type of inset it defines.
15333 \change_inserted 5863208 1334489312
15337 \begin_layout Enumerate
15339 \change_inserted 5863208 1334492248
15340 The layout for user specific branch is being defined.
15342 \begin_inset Flex Code
15345 \begin_layout Plain Layout
15347 \change_inserted 5863208 1334489384
15353 must be of the form
15354 \begin_inset Quotes eld
15358 \begin_inset Flex Code
15361 \begin_layout Plain Layout
15363 \change_inserted 5863208 1334489392
15370 \begin_inset Quotes erd
15374 \begin_inset Flex Code
15377 \begin_layout Plain Layout
15379 \change_inserted 5863208 1334489384
15385 may be be any valid identifier of branch defined in user's document.
15386 The identifier may include spaces, but in that case the whole thing must
15387 be wrapped in quotes.
15388 The main purpose of this feature is to allow LaTeX wrapping around specific
15389 branches as user needs.
15394 \begin_layout Standard
15396 \begin_inset Flex Code
15399 \begin_layout Plain Layout
15405 definition can contain the following entries:
15408 \begin_layout Description
15410 \change_inserted -712698321 1353681390
15411 \begin_inset Flex Code
15414 \begin_layout Plain Layout
15416 \change_inserted -712698321 1353681344
15423 \begin_inset Flex Code
15426 \begin_layout Plain Layout
15428 \change_inserted -712698321 1353681344
15434 ] Defines argument number <int> of a command\SpecialChar \slash{}
15435 environment associated with
15436 the current layout.
15437 The definition must end with
15438 \begin_inset Flex Code
15441 \begin_layout Plain Layout
15443 \change_inserted -712698321 1353681344
15451 \begin_inset space ~
15455 \begin_inset CommandInset ref
15457 reference "sub:Paragraph-Styles"
15464 \begin_layout Description
15466 \change_inserted -195340706 1333913893
15467 \begin_inset Flex Code
15470 \begin_layout Plain Layout
15476 Preamble for changing languages.
15478 \begin_inset space ~
15482 \begin_inset CommandInset ref
15484 reference "sub:I18n"
15491 \begin_layout Description
15492 \begin_inset Flex Code
15495 \begin_layout Plain Layout
15501 The color for the inset's background.
15502 The valid colors are defined in
15503 \begin_inset Flex Code
15506 \begin_layout Plain Layout
15515 \begin_layout Description
15516 \begin_inset Flex Code
15519 \begin_layout Plain Layout
15526 \begin_inset Flex Code
15529 \begin_layout Plain Layout
15538 \begin_inset Flex Code
15541 \begin_layout Plain Layout
15547 ] Whether to use the content of the inset as the label, when the inset is
15552 \begin_layout Description
15553 \begin_inset Flex Code
15556 \begin_layout Plain Layout
15563 \begin_inset Flex Code
15566 \begin_layout Plain Layout
15572 Copies all the features of an existing style into the current one.
15576 \begin_layout Description
15577 \begin_inset Flex Code
15580 \begin_layout Plain Layout
15587 \begin_inset Flex Code
15590 \begin_layout Plain Layout
15599 \begin_inset Flex Code
15602 \begin_layout Plain Layout
15608 ] Indicates whether the user may employ the Paragraph Settings dialog to
15609 customize the paragraph.
15612 \begin_layout Description
15613 \begin_inset Flex Code
15616 \begin_layout Plain Layout
15623 \begin_inset Flex Code
15626 \begin_layout Plain Layout
15633 \begin_inset Flex Code
15636 \begin_layout Plain Layout
15643 \begin_inset Flex Code
15646 \begin_layout Plain Layout
15652 , describing the rendering style used for the inset's frame and buttons.
15653 Footnotes generally use
15654 \begin_inset Flex Code
15657 \begin_layout Plain Layout
15663 , ERT insets generally
15664 \begin_inset Flex Code
15667 \begin_layout Plain Layout
15673 , and character styles
15674 \begin_inset Flex Code
15677 \begin_layout Plain Layout
15686 \begin_layout Description
15687 \begin_inset Flex Code
15690 \begin_layout Plain Layout
15697 \begin_inset Flex Code
15700 \begin_layout Plain Layout
15707 \begin_inset Flex Code
15710 \begin_layout Plain Layout
15719 \begin_inset Flex Code
15722 \begin_layout Plain Layout
15729 \begin_inset Flex Code
15732 \begin_layout Plain Layout
15739 Indicates whether the environment will stand on its own in LaTeX output
15740 or will appear inline with the surrounding text.
15741 If set to false, it is supposed that the LaTeX environment ignores white
15742 space (including one newline character) after the
15743 \begin_inset Flex Code
15746 \begin_layout Plain Layout
15759 \begin_inset Flex Code
15762 \begin_layout Plain Layout
15778 \begin_layout Description
15779 \begin_inset Flex Code
15782 \begin_layout Plain Layout
15788 Required at the end of the InsetLayout declarations.
15791 \begin_layout Description
15792 \begin_inset Flex Code
15795 \begin_layout Plain Layout
15801 The font used for both the text body
15807 \begin_inset space ~
15811 \begin_inset CommandInset ref
15813 reference "sub:Font-description"
15818 Note that defining this font automatically defines the
15819 \begin_inset Flex Code
15822 \begin_layout Plain Layout
15828 to the same value, so define this first and define
15829 \begin_inset Flex Code
15832 \begin_layout Plain Layout
15838 later if you want them to be different.
15841 \begin_layout Description
15842 \begin_inset Flex Code
15845 \begin_layout Plain Layout
15852 \begin_inset Quotes eld
15856 \begin_inset Quotes erd
15859 language, leading to Left-to-Right (latin) output, e.
15860 \begin_inset space \thinspace{}
15864 \begin_inset space \space{}
15867 in TeX code or URL.
15871 \begin_layout Description
15872 \begin_inset Flex Code
15875 \begin_layout Plain Layout
15882 \begin_inset Flex Code
15885 \begin_layout Plain Layout
15894 \begin_inset Flex Code
15897 \begin_layout Plain Layout
15903 ] Indicates whether the
15904 \begin_inset Flex Code
15907 \begin_layout Plain Layout
15913 should be used or, instead, the user can change the paragraph style used
15918 \begin_layout Description
15919 \begin_inset Flex Code
15922 \begin_layout Plain Layout
15929 \begin_inset Flex Code
15932 \begin_layout Plain Layout
15941 \begin_inset Flex Code
15944 \begin_layout Plain Layout
15950 ] Usually LyX doesn't allow you to insert more than one space between words,
15951 since a space is considered as the separation between two words, not a
15952 character or symbol of its own.
15953 This is a very fine thing but sometimes annoying, for example, when typing
15954 program code or plain LaTeX code.
15956 \begin_inset Flex Code
15959 \begin_layout Plain Layout
15966 Note that LyX will create protected blanks for the additional blanks when
15967 in another mode than LaTeX-mode.
15971 \begin_layout Description
15972 \begin_inset Flex Code
15975 \begin_layout Plain Layout
15981 These tags control XHTML output.
15983 \begin_inset CommandInset ref
15985 reference "sec:Tags-for-XHTML"
15992 \begin_layout Description
15993 \begin_inset Flex Code
15996 \begin_layout Plain Layout
16003 \begin_inset Flex Code
16006 \begin_layout Plain Layout
16015 \begin_inset Flex Code
16018 \begin_layout Plain Layout
16024 ] Whether to include the contents of this inset in the strings generated
16025 for the `Outline' pane.
16026 One would not, for example, want the content of a footnote in a section
16027 header to be included in the TOC displayed in the outline, but one would
16028 normally want the content of a character style displayed.
16029 Default is false: not to include.
16032 \begin_layout Description
16033 \begin_inset Flex Code
16036 \begin_layout Plain Layout
16043 \begin_inset Flex Code
16046 \begin_layout Plain Layout
16055 \begin_inset Flex Code
16058 \begin_layout Plain Layout
16064 ] Usually LyX does not allow you to leave a paragraph empty, since it would
16065 lead to empty LaTeX output.
16066 There are some cases where this could be desirable however: in a letter
16067 template, the required fields can be provided as empty fields, so that
16068 people do not forget them; in some special classes, a style can be used
16069 as some kind of break, which does not contain actual text.
16073 \begin_layout Description
16074 \begin_inset Flex Code
16077 \begin_layout Plain Layout
16083 The font used for the label.
16085 \begin_inset space ~
16089 \begin_inset CommandInset ref
16091 reference "sub:Font-description"
16096 Note that this definition can never appear before
16097 \begin_inset Flex Code
16100 \begin_layout Plain Layout
16106 , lest it be ineffective.
16109 \begin_layout Description
16110 \begin_inset Flex Code
16113 \begin_layout Plain Layout
16119 What will be displayed on the button or elsewhere as the inset label.
16121 \begin_inset Flex Code
16124 \begin_layout Plain Layout
16131 \begin_inset Flex Code
16134 \begin_layout Plain Layout
16140 ) modify this label on the fly.
16143 \begin_layout Description
16145 \change_inserted -195340706 1333913893
16146 \begin_inset Flex Code
16149 \begin_layout Plain Layout
16155 Language dependent preamble.
16157 \begin_inset space ~
16161 \begin_inset CommandInset ref
16163 reference "sub:I18n"
16170 \begin_layout Description
16171 \begin_inset Flex Code
16174 \begin_layout Plain Layout
16180 The name of the corresponding LaTeX stuff.
16181 Either the environment or command name.
16184 \begin_layout Description
16185 \begin_inset Flex Code
16188 \begin_layout Plain Layout
16194 The optional parameter for the corresponding
16195 \begin_inset Flex Code
16198 \begin_layout Plain Layout
16204 stuff, including possible bracket pairs like
16205 \begin_inset Flex Code
16208 \begin_layout Plain Layout
16215 This parameter cannot be changed from within LyX.
16218 \begin_layout Description
16219 \begin_inset Flex Code
16222 \begin_layout Plain Layout
16229 \begin_inset Flex Code
16232 \begin_layout Plain Layout
16237 , Command, Environment, Item_Environment,
16243 \begin_inset Flex Code
16246 \begin_layout Plain Layout
16247 List_Environment, Bib_Environment
16252 ] How the style should be translated into LaTeX.
16256 \begin_layout Plain Layout
16257 \begin_inset Flex Code
16260 \begin_layout Plain Layout
16266 is perhaps a bit misleading, since these rules apply to SGML classes, too.
16267 Visit the SGML class files for specific examples.
16276 \begin_layout Itemize
16277 \begin_inset Flex Code
16280 \begin_layout Plain Layout
16286 means nothing special.
16290 \begin_layout Itemize
16291 \begin_inset Flex Code
16294 \begin_layout Plain Layout
16301 \begin_inset Flex Code
16304 \begin_layout Plain Layout
16311 {\SpecialChar \ldots{}
16320 \begin_layout Itemize
16321 \begin_inset Flex Code
16324 \begin_layout Plain Layout
16331 \begin_inset Flex Code
16334 \begin_layout Plain Layout
16341 }\SpecialChar \ldots{}
16357 \begin_layout Itemize
16358 \begin_inset Flex Code
16361 \begin_layout Plain Layout
16368 \begin_inset Flex Code
16371 \begin_layout Plain Layout
16378 \begin_inset Flex Code
16381 \begin_layout Plain Layout
16389 is generated for each paragraph of this environment.
16393 \begin_layout Itemize
16394 \begin_inset Flex Code
16397 \begin_layout Plain Layout
16404 \begin_inset Flex Code
16407 \begin_layout Plain Layout
16414 \begin_inset Flex Code
16417 \begin_layout Plain Layout
16423 is passed as an argument to the environment.
16425 \begin_inset Flex Code
16428 \begin_layout Plain Layout
16434 can be defined in the
16435 \begin_inset Flex MenuItem
16438 \begin_layout Plain Layout
16443 \SpecialChar \menuseparator
16449 \begin_inset space ~
16461 \begin_layout Standard
16462 Putting the last few things together, the LaTeX output will be either:
16465 \begin_layout LyX-Code
16468 latexname[latexparam]{\SpecialChar \ldots{}
16472 \begin_layout Standard
16476 \begin_layout LyX-Code
16479 begin{latexname}[latexparam] \SpecialChar \ldots{}
16485 \begin_layout Standard
16486 depending upon the LaTeX type.
16490 \begin_layout Description
16492 \change_inserted -712698321 1353866797
16493 \begin_inset Flex Code
16496 \begin_layout Plain Layout
16498 \change_inserted -712698321 1353866742
16507 \begin_inset Flex Code
16510 \begin_layout Plain Layout
16512 \change_inserted -712698321 1353866752
16518 ] A string that is put at the beginning of the layout content.
16523 \begin_layout Description
16524 \begin_inset Flex Code
16527 \begin_layout Plain Layout
16534 \begin_inset Flex Code
16537 \begin_layout Plain Layout
16544 \begin_inset Flex Code
16547 \begin_layout Plain Layout
16554 \begin_inset Flex Code
16557 \begin_layout Plain Layout
16564 \begin_inset Flex Code
16567 \begin_layout Plain Layout
16573 (indicating a dummy definition ending definitions of charstyles, etc).
16574 This entry is required in and is only meaningful for Flex insets.
16575 Among other things, it determines on which menu this inset will appear.
16577 \begin_inset Flex Code
16580 \begin_layout Plain Layout
16587 \begin_inset Flex Code
16590 \begin_layout Plain Layout
16597 \begin_inset Flex Code
16600 \begin_layout Plain Layout
16608 \begin_inset Flex Code
16611 \begin_layout Plain Layout
16617 can be set to true for charstyle insets, if you wish, by setting it
16622 \begin_inset Flex Code
16625 \begin_layout Plain Layout
16634 \begin_layout Description
16635 \begin_inset Flex Code
16638 \begin_layout Plain Layout
16645 \begin_inset Flex Code
16648 \begin_layout Plain Layout
16657 \begin_inset Flex Code
16660 \begin_layout Plain Layout
16666 ] Whether multiple paragraphs are permitted in this inset.
16668 \begin_inset Flex Code
16671 \begin_layout Plain Layout
16677 to the same value and
16678 \begin_inset Flex Code
16681 \begin_layout Plain Layout
16687 to the opposite value.
16688 These can be reset to other values, if they are used
16693 \begin_inset Flex Code
16696 \begin_layout Plain Layout
16706 \begin_layout Description
16707 \begin_inset Flex Code
16710 \begin_layout Plain Layout
16717 \begin_inset Flex Code
16720 \begin_layout Plain Layout
16729 \begin_inset Flex Code
16732 \begin_layout Plain Layout
16738 ] Whether fragile commands in this inset should be
16739 \begin_inset Flex Code
16742 \begin_layout Plain Layout
16755 whether the command should itself be protected.) Default is false.
16758 \begin_layout Description
16759 \begin_inset Flex Code
16762 \begin_layout Plain Layout
16769 \begin_inset Flex Code
16772 \begin_layout Plain Layout
16781 \begin_inset Flex Code
16784 \begin_layout Plain Layout
16790 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
16791 output, but only by a line break; together with
16792 \begin_inset Flex Code
16795 \begin_layout Plain Layout
16801 , this allows to emulate a plain text editor (like the ERT inset).
16805 \begin_layout Description
16806 \begin_inset Flex Code
16809 \begin_layout Plain Layout
16816 \begin_inset Flex Code
16819 \begin_layout Plain Layout
16828 \begin_inset Flex Code
16831 \begin_layout Plain Layout
16837 ] Whether the contents of this paragraph should be output in raw form, meaning
16838 without special translations that LaTeX would require.
16841 \begin_layout Description
16842 \begin_inset Flex Code
16845 \begin_layout Plain Layout
16851 Information to be included in the LaTeX preamble when this style is used.
16852 Used to define macros, load packages, etc., required by this particular
16855 \begin_inset Quotes eld
16859 \begin_inset Flex Code
16862 \begin_layout Plain Layout
16869 \begin_inset Quotes erd
16875 \begin_layout Description
16876 \begin_inset Flex Code
16879 \begin_layout Plain Layout
16886 \begin_inset Flex Code
16889 \begin_layout Plain Layout
16895 ] The prefix to use when creating labels referring to insets of this type.
16896 This allows the use of formatted references.
16899 \begin_layout Description
16900 \begin_inset Flex Code
16903 \begin_layout Plain Layout
16910 \begin_inset Flex Code
16913 \begin_layout Plain Layout
16919 ] Whether the style requires the feature
16920 \begin_inset Flex Code
16923 \begin_layout Plain Layout
16930 See the description of
16931 \begin_inset Flex Code
16934 \begin_layout Plain Layout
16941 \begin_inset CommandInset ref
16942 LatexCommand pageref
16943 reference "des:FreeSpacing"
16947 ) for information on `features'.
16951 \begin_layout Description
16952 \begin_inset Flex Code
16955 \begin_layout Plain Layout
16962 \begin_inset Flex Code
16965 \begin_layout Plain Layout
16972 \begin_inset Flex Code
16975 \begin_layout Plain Layout
16983 ] Whether this inset should use the font of its surrounding environment
16985 Default is true: uses its own.
16986 \change_inserted -712698321 1353866806
16990 \begin_layout Description
16992 \change_inserted -712698321 1353866814
16993 \begin_inset Flex Code
16996 \begin_layout Plain Layout
16998 \change_inserted -712698321 1353866810
17005 \begin_inset Flex Code
17008 \begin_layout Plain Layout
17010 \change_inserted -712698321 1353866806
17016 ] A string that is put at the end of the layout content.
17021 \begin_layout Description
17022 \begin_inset Flex Code
17025 \begin_layout Plain Layout
17032 \begin_inset Flex Code
17035 \begin_layout Plain Layout
17042 \begin_inset Flex Code
17045 \begin_layout Plain Layout
17053 ] Spellcheck the contents of this inset.
17057 \begin_layout Subsection
17059 \begin_inset CommandInset label
17061 name "sub:Counters"
17068 \begin_layout Standard
17069 Since version 1.3.0 of LyX, it is both possible and necessary to define the
17071 \begin_inset Flex MenuItem
17074 \begin_layout Plain Layout
17081 \begin_inset Flex MenuItem
17084 \begin_layout Plain Layout
17090 , \SpecialChar \ldots{}
17091 ) in the text class itself.
17092 The standard counters are defined in the file
17093 \begin_inset Flex Code
17096 \begin_layout Plain Layout
17102 , so you may have to do no more than add
17105 \begin_layout LyX-Code
17106 Input stdcounters.inc
17109 \begin_layout Standard
17110 to your layout file to get them to work.
17111 But if you want to define custom counters, then you can do so.
17112 The counter declaration must begin with:
17115 \begin_layout LyX-Code
17116 Counter CounterName
17119 \begin_layout Standard
17121 \begin_inset Flex Code
17124 \begin_layout Plain Layout
17130 ' is replaced by the name of the counter.
17131 And it must end with
17132 \begin_inset Quotes eld
17136 \begin_inset Flex Code
17139 \begin_layout Plain Layout
17146 \begin_inset Quotes erd
17150 The following parameters can also be used:
17153 \begin_layout Description
17154 \begin_inset Flex Code
17157 \begin_layout Plain Layout
17164 \begin_inset Flex Code
17167 \begin_layout Plain Layout
17174 \begin_inset Quotes erd
17178 \begin_inset Quotes erd
17181 ] When defined, this string defines how the counter is displayed.
17182 Setting this value sets
17183 \begin_inset Flex Code
17186 \begin_layout Plain Layout
17187 LabelStringAppendix
17193 The following special constructs can be used in the string:
17197 \begin_layout Itemize
17198 \begin_inset Flex Code
17201 \begin_layout Plain Layout
17209 will be replaced by the expansion of the
17210 \begin_inset Flex Code
17213 \begin_layout Plain Layout
17220 \begin_inset Flex Code
17223 \begin_layout Plain Layout
17224 LabelStringAppendix
17230 \begin_inset Flex Code
17233 \begin_layout Plain Layout
17243 \begin_layout Itemize
17244 counter values can be expressed using LaTeX-like macros
17245 \begin_inset Flex Code
17248 \begin_layout Plain Layout
17265 \begin_inset Flex Code
17268 \begin_layout Plain Layout
17280 \begin_layout Plain Layout
17290 Actually, the situation is a bit more complicated: any
17309 other than those described below will produce arabic numerals.
17310 It would not be surprising to see this change in the future.
17316 \begin_inset Flex Code
17319 \begin_layout Plain Layout
17325 : 1, 2, 3,\SpecialChar \ldots{}
17327 \begin_inset Flex Code
17330 \begin_layout Plain Layout
17336 for lower-case letters: a, b, c, \SpecialChar \ldots{}
17338 \begin_inset Flex Code
17341 \begin_layout Plain Layout
17347 for upper-case letters: A, B, C, \SpecialChar \ldots{}
17349 \begin_inset Flex Code
17352 \begin_layout Plain Layout
17358 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
17360 \begin_inset Flex Code
17363 \begin_layout Plain Layout
17369 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
17371 \begin_inset Flex Code
17374 \begin_layout Plain Layout
17380 for hebrew numerals.
17384 \begin_layout Standard
17385 If LabelString is not defined, a default value is constructed as follows:
17386 if the counter has a master counter
17387 \begin_inset Flex Code
17390 \begin_layout Plain Layout
17397 \begin_inset Flex Code
17400 \begin_layout Plain Layout
17407 \begin_inset Flex Code
17410 \begin_layout Plain Layout
17420 is used; otherwise the string
17421 \begin_inset Flex Code
17424 \begin_layout Plain Layout
17435 \begin_layout Description
17436 \begin_inset Flex Code
17439 \begin_layout Plain Layout
17440 LabelStringAppendix
17446 \begin_inset Flex Code
17449 \begin_layout Plain Layout
17456 \begin_inset Quotes erd
17460 \begin_inset Quotes erd
17464 \begin_inset Flex Code
17467 \begin_layout Plain Layout
17473 , but for use in the Appendix.
17476 \begin_layout Description
17477 \begin_inset Flex Code
17480 \begin_layout Plain Layout
17487 \begin_inset Flex Code
17490 \begin_layout Plain Layout
17497 \begin_inset Quotes erd
17501 \begin_inset Quotes erd
17504 ] A format for use with formatted references to this counter.
17505 For example, one might want to have references to section numbers appear
17507 \begin_inset Quotes eld
17511 \begin_inset Quotes erd
17515 The string should contain
17516 \begin_inset Quotes eld
17520 \begin_inset Quotes erd
17524 This will be replaced by the counter number itself.
17525 So, for sections, it would be: Section ##.
17528 \begin_layout Description
17529 \begin_inset Flex Code
17532 \begin_layout Plain Layout
17539 \begin_inset Flex Code
17542 \begin_layout Plain Layout
17549 \begin_inset Quotes erd
17553 \begin_inset Quotes erd
17556 ] If this is set to the name of another counter, the present counter will
17557 be reset every time the other one is increased.
17559 \begin_inset Flex Code
17562 \begin_layout Plain Layout
17569 \begin_inset Flex Code
17572 \begin_layout Plain Layout
17581 \begin_layout Subsection
17583 \begin_inset CommandInset label
17585 name "sub:Font-description"
17592 \begin_layout Standard
17593 A font description looks like this:
17596 \begin_layout LyX-Code
17606 \begin_layout LyX-Code
17610 \begin_layout LyX-Code
17614 \begin_layout Standard
17615 The following commands are available:
17618 \begin_layout Description
17619 \begin_inset Flex Code
17622 \begin_layout Plain Layout
17629 \begin_inset Flex Code
17632 \begin_layout Plain Layout
17641 \begin_inset Flex Code
17644 \begin_layout Plain Layout
17651 \begin_inset Flex Code
17654 \begin_layout Plain Layout
17661 \begin_inset Flex Code
17664 \begin_layout Plain Layout
17671 \begin_inset Flex Code
17674 \begin_layout Plain Layout
17681 \begin_inset Flex Code
17684 \begin_layout Plain Layout
17691 \begin_inset Flex Code
17694 \begin_layout Plain Layout
17701 \begin_inset Flex Code
17704 \begin_layout Plain Layout
17711 \begin_inset Flex Code
17714 \begin_layout Plain Layout
17723 \begin_layout Description
17724 \begin_inset Flex Code
17727 \begin_layout Plain Layout
17734 \begin_inset Flex Code
17737 \begin_layout Plain Layout
17746 \begin_inset Flex Code
17749 \begin_layout Plain Layout
17756 \begin_inset Flex Code
17759 \begin_layout Plain Layout
17768 \begin_layout Description
17769 \begin_inset Flex Code
17772 \begin_layout Plain Layout
17779 \begin_inset Flex Code
17782 \begin_layout Plain Layout
17788 ] Valid arguments are:
17789 \begin_inset Flex Code
17792 \begin_layout Plain Layout
17799 \begin_inset Flex Code
17802 \begin_layout Plain Layout
17809 \begin_inset Flex Code
17812 \begin_layout Plain Layout
17819 \begin_inset Flex Code
17822 \begin_layout Plain Layout
17829 \begin_inset Flex Code
17832 \begin_layout Plain Layout
17839 \begin_inset Flex Code
17842 \begin_layout Plain Layout
17849 \begin_inset Flex Code
17852 \begin_layout Plain Layout
17859 \begin_inset Flex Code
17862 \begin_layout Plain Layout
17869 \begin_inset Flex Code
17872 \begin_layout Plain Layout
17879 \begin_inset Flex Code
17882 \begin_layout Plain Layout
17889 \begin_inset Flex Code
17892 \begin_layout Plain Layout
17899 \begin_inset Flex Code
17902 \begin_layout Plain Layout
17909 Each of these turns on or off the corresponding attribute.
17911 \begin_inset Flex Code
17914 \begin_layout Plain Layout
17920 turns on emphasis, and
17921 \begin_inset Flex Code
17924 \begin_layout Plain Layout
17932 \begin_inset Newline newline
17935 If the latter seems puzzling, remember that the font settings for the present
17936 context are generally inherited from the surrounding context.
17938 \begin_inset Flex Code
17941 \begin_layout Plain Layout
17947 would turn off the emphasis that was anyway in effect, say, in a theorem
17951 \begin_layout Description
17952 \begin_inset Flex Code
17955 \begin_layout Plain Layout
17962 \begin_inset Flex Code
17965 \begin_layout Plain Layout
17974 \begin_inset Flex Code
17977 \begin_layout Plain Layout
17986 \begin_layout Description
17987 \begin_inset Flex Code
17990 \begin_layout Plain Layout
17997 \begin_inset Flex Code
18000 \begin_layout Plain Layout
18009 \begin_inset Flex Code
18012 \begin_layout Plain Layout
18019 \begin_inset Flex Code
18022 \begin_layout Plain Layout
18029 \begin_inset Flex Code
18032 \begin_layout Plain Layout
18041 \begin_layout Description
18042 \begin_inset Flex Code
18045 \begin_layout Plain Layout
18052 \begin_inset Flex Code
18055 \begin_layout Plain Layout
18062 \begin_inset Flex Code
18065 \begin_layout Plain Layout
18072 \begin_inset Flex Code
18075 \begin_layout Plain Layout
18084 \begin_inset Flex Code
18087 \begin_layout Plain Layout
18094 \begin_inset Flex Code
18097 \begin_layout Plain Layout
18104 \begin_inset Flex Code
18107 \begin_layout Plain Layout
18114 \begin_inset Flex Code
18117 \begin_layout Plain Layout
18124 \begin_inset Flex Code
18127 \begin_layout Plain Layout
18136 \begin_layout Subsection
18137 \begin_inset CommandInset label
18139 name "sub:Citation-format-description"
18143 Citation format description
18146 \begin_layout Standard
18148 \begin_inset Flex Code
18151 \begin_layout Plain Layout
18157 blocks are used to describe how bibliographic information should be displayed,
18158 both within LyX itself (in the citation dialog and in tooltips, for example)
18159 and in XHTML output.
18160 Such a block might look like this:
18163 \begin_layout LyX-Code
18167 \begin_layout LyX-Code
18171 \begin_layout LyX-Code
18175 \begin_layout LyX-Code
18179 \begin_layout Standard
18180 The individual lines define how the bibliographic information associated
18181 with an article or book, respectively, is to be displayed, and such a definitio
18182 n can be given for any `entry type' that might be present in a BibTeX file.
18183 LyX defines a default format in the source code that will be used if no
18184 specific definition has been given.
18185 LyX predefines several formats in the file
18186 \begin_inset Flex Code
18189 \begin_layout Plain Layout
18195 , which is included in most of LyX's document classes.
18198 \begin_layout Standard
18199 The definitions use a simple language that allows BibTeX keys to be replaced
18201 Keys should be enclosed in
18202 \begin_inset Flex Code
18205 \begin_layout Plain Layout
18212 \begin_inset Flex Code
18215 \begin_layout Plain Layout
18222 So a simple definition might look like this:
18225 \begin_layout LyX-Code
18227 \begin_inset Quotes eld
18231 \begin_inset Quotes erd
18237 \begin_layout Standard
18238 This would print the author, followed by a comma, followed by the title,
18239 in quotes, followed by a period.
18242 \begin_layout Standard
18243 Of course, sometimes you may want to print a key only if it exists.
18244 This can be done by using a conditional construction, such as:
18245 \begin_inset Flex Code
18248 \begin_layout Plain Layout
18250 \begin_inset space ~
18260 \begin_inset Flex Code
18263 \begin_layout Plain Layout
18269 key exists, then print
18270 \begin_inset Quotes eld
18274 \begin_inset space ~
18278 \begin_inset Quotes erd
18281 followed by the volume key.
18282 It is also possible to have an else clause in the conditional, such as:
18284 \begin_inset Flex Code
18287 \begin_layout Plain Layout
18288 {%author%[[%author%]][[%editor%, ed.]]}
18295 \begin_inset Flex Code
18298 \begin_layout Plain Layout
18304 key is printed if it exists; otherwise, the editor key is printed, followed
18306 \begin_inset Quotes eld
18310 \begin_inset space ~
18314 \begin_inset Quotes erd
18317 Note that the key is again enclosed in
18318 \begin_inset Flex Code
18321 \begin_layout Plain Layout
18327 signs; the entire conditional is enclosed in braces; and the if and else
18328 clauses are enclosed in double brackets,
18329 \begin_inset Quotes eld
18333 \begin_inset Flex Code
18336 \begin_layout Plain Layout
18343 \begin_inset Quotes eld
18347 \begin_inset Quotes eld
18351 \begin_inset Flex Code
18354 \begin_layout Plain Layout
18361 \begin_inset Quotes erd
18365 There must be no space between any of these.
18368 \begin_layout Standard
18369 There is one other piece of syntax available in definitions, which looks
18371 \begin_inset Flex Code
18374 \begin_layout Plain Layout
18381 This defines a piece of formatting information that is to be used when
18383 \begin_inset Quotes eld
18387 \begin_inset Quotes erd
18391 Obviously, we do not want to output HTML tags when writing plain text,
18392 so they should be wrapped in
18393 \begin_inset Quotes eld
18397 \begin_inset Quotes erd
18401 \begin_inset Quotes eld
18405 \begin_inset Quotes erd
18411 \begin_layout Standard
18412 Two special sorts of definitions are also possible in a
18413 \begin_inset Flex Code
18416 \begin_layout Plain Layout
18423 An example of the first would be:
18426 \begin_layout LyX-Code
18428 \begin_inset Quotes eld
18432 \begin_inset Quotes erd
18438 \begin_layout Standard
18439 This is an abbreviation, or macro, and it can be used by treating it as
18441 \begin_inset Flex Code
18444 \begin_layout Plain Layout
18452 \begin_inset Flex Code
18455 \begin_layout Plain Layout
18461 exactly as it would treat its definition.
18462 So, let us issue the obvious
18470 \begin_layout LyX-Code
18474 \begin_layout Standard
18475 or anything like it.
18476 LyX shouldn't go into an infinite loop, but it may go into a long one before
18480 \begin_layout Standard
18481 The second sort of special definition might look like this:
18484 \begin_layout LyX-Code
18488 \begin_layout Standard
18489 This defines a translatable piece of text, which allows relevant parts of
18490 the bibliography to be translated.
18491 It can be included in a definition by treating it as a key:
18492 \begin_inset Flex Code
18495 \begin_layout Plain Layout
18502 Several of these are predefined in
18503 \begin_inset Flex Code
18506 \begin_layout Plain Layout
18513 Note that these are not macros, in the sense just defined.
18514 They will not be expanded.
18517 \begin_layout Standard
18518 So here then is an example that use all these features:
18521 \begin_layout LyX-Code
18522 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
18525 \begin_layout Standard
18526 This defines a macro that prints the author, followed by a comma, if the
18528 \begin_inset Flex Code
18531 \begin_layout Plain Layout
18537 key is defined, or else prints the name of the editor, followed by the
18539 \begin_inset Flex Code
18542 \begin_layout Plain Layout
18548 or its translation (it is by default
18549 \begin_inset Quotes eld
18553 \begin_inset Quotes erd
18557 \begin_inset Flex Code
18560 \begin_layout Plain Layout
18567 Note that this is in fact defined in
18568 \begin_inset Flex Code
18571 \begin_layout Plain Layout
18577 , so you can use it in your own definitions, or re-definitions, if you load
18581 \begin_layout Section
18582 \begin_inset CommandInset label
18584 name "sec:Tags-for-XHTML"
18588 Tags for XHTML output
18591 \begin_layout Standard
18592 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
18593 by layout information.
18594 In general, LyX provides sensible defaults and, as mentioned earlier, it
18595 will even construct default CSS style rules from the other layout tags.
18596 For example, LyX will attempt to use the information provided in the
18597 \begin_inset Flex Code
18600 \begin_layout Plain Layout
18606 declaration for the Chapter style to write CSS that will appropriately
18607 format chapter headings.
18610 \begin_layout Standard
18611 In many cases, then, you may not have to do anything at all to get acceptable
18612 XHTML output for your own environments, custom insets, and so forth.
18613 But in some cases you will, and so LyX provides a number of layout tags
18614 that can be used to customize the XHTML and CSS that are generated.
18617 \begin_layout Standard
18618 Note that there are two tags,
18619 \begin_inset Flex Code
18622 \begin_layout Plain Layout
18629 \begin_inset Flex Code
18632 \begin_layout Plain Layout
18638 that may appear outside style and inset declarations.
18640 \begin_inset CommandInset ref
18642 reference "sub:General-text-class"
18646 for details on these.
18649 \begin_layout Subsection
18650 \begin_inset CommandInset label
18652 name "sub:Paragraph-Style-XHTML"
18659 \begin_layout Standard
18660 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
18661 dealing with a normal paragraph, a command, or an environment, where this
18662 is itself determined by the contents of the corresponding
18663 \begin_inset Flex Code
18666 \begin_layout Plain Layout
18676 \begin_layout Standard
18677 For a command or normal paragraph, the output XHTML has the following form:
18680 \begin_layout LyX-Code
18682 \begin_inset Quotes erd
18686 \begin_inset Quotes erd
18692 \begin_layout LyX-Code
18694 \begin_inset Quotes erd
18698 \begin_inset Quotes erd
18704 \begin_layout LyX-Code
18705 Contents of the paragraph.
18708 \begin_layout LyX-Code
18712 \begin_layout Standard
18713 The label tags are of course omitted if the paragraph does not have a label.
18716 \begin_layout Standard
18717 For an environment that is not some sort of list, the XHTML takes this form:
18720 \begin_layout LyX-Code
18722 \begin_inset Quotes erd
18726 \begin_inset Quotes erd
18732 \begin_layout LyX-Code
18734 \begin_inset Quotes erd
18738 \begin_inset Quotes erd
18742 \begin_inset Quotes erd
18746 \begin_inset Quotes erd
18749 >Environment Label</labeltag>First paragraph.</itemtag>
18752 \begin_layout LyX-Code
18753 <itemtag>Second paragraph.</itemtag>
18756 \begin_layout LyX-Code
18760 \begin_layout Standard
18761 Note that the label is output only for the first paragraph, as it should
18762 be for a theorem, for example.
18766 \begin_layout Standard
18767 For a list, we have one of these forms:
18770 \begin_layout LyX-Code
18772 \begin_inset Quotes erd
18776 \begin_inset Quotes erd
18782 \begin_layout LyX-Code
18784 \begin_inset Quotes erd
18788 \begin_inset Quotes erd
18792 \begin_inset Quotes erd
18796 \begin_inset Quotes erd
18799 >List Label</labeltag>First item.</itemtag>
18802 \begin_layout LyX-Code
18804 \begin_inset Quotes erd
18808 \begin_inset Quotes erd
18812 \begin_inset Quotes erd
18816 \begin_inset Quotes erd
18819 >List Label</labeltag>Second item.</itemtag>
18822 \begin_layout LyX-Code
18826 \begin_layout LyX-Code
18830 \begin_layout LyX-Code
18832 \begin_inset Quotes erd
18836 \begin_inset Quotes erd
18842 \begin_layout LyX-Code
18844 \begin_inset Quotes erd
18848 \begin_inset Quotes erd
18851 >List Label</labeltag><itemtag attr=
18852 \begin_inset Quotes erd
18856 \begin_inset Quotes erd
18859 >First item.</itemtag>
18862 \begin_layout LyX-Code
18864 \begin_inset Quotes erd
18868 \begin_inset Quotes erd
18871 >List Label</labeltag><itemtag attr=
18872 \begin_inset Quotes erd
18876 \begin_inset Quotes erd
18879 >Second item.</itemtag>
18882 \begin_layout LyX-Code
18886 \begin_layout Standard
18887 Note the different orders of
18888 \begin_inset Flex Code
18891 \begin_layout Plain Layout
18898 \begin_inset Flex Code
18901 \begin_layout Plain Layout
18908 Which order we get depends upon the setting of
18909 \begin_inset Flex Code
18912 \begin_layout Plain Layout
18919 \begin_inset Flex Code
18922 \begin_layout Plain Layout
18928 is false (the default), you get the first of these, with the label within
18929 the item; if true, you get the second, with the label outside the item.
18932 \begin_layout Standard
18933 The specific tags and attributes output for each paragraph type can be controlle
18934 d by means of the layout tags we are about to describe.
18935 As mentioned earlier, however, LyX uses sensible defaults for many of these,
18936 so you often may not need to do very much to get good XHTML output.
18937 Think of the available tags as there so you can tweak things to your liking.
18940 \begin_layout Description
18941 \begin_inset Flex Code
18944 \begin_layout Plain Layout
18951 \begin_inset Flex Code
18954 \begin_layout Plain Layout
18960 ] Specifies attribute information to be output with the main tag.
18962 \begin_inset Quotes eld
18966 \begin_inset Flex Code
18969 \begin_layout Plain Layout
18976 \begin_inset Quotes erd
18980 By default, LyX will output
18981 \begin_inset Quotes eld
18985 \begin_inset Flex Code
18988 \begin_layout Plain Layout
18995 \begin_inset Quotes erd
18999 \begin_inset Flex Code
19002 \begin_layout Plain Layout
19008 is the LyX name of the layout, made lowercase, for example: chapter.
19013 contain any style information.
19015 \begin_inset Flex Code
19018 \begin_layout Plain Layout
19027 \begin_layout Description
19028 \begin_inset Flex Code
19031 \begin_layout Plain Layout
19038 \begin_inset Flex Code
19041 \begin_layout Plain Layout
19051 ] Whether to output the default CSS information LyX generates for this layout,
19052 even if additional information is explicitly provided via
19053 \begin_inset Flex Code
19056 \begin_layout Plain Layout
19064 \begin_inset Flex Code
19067 \begin_layout Plain Layout
19073 allows you to alter or augment the generated CSS, rather than to override
19076 \begin_inset Flex Code
19079 \begin_layout Plain Layout
19088 \begin_layout Description
19089 \begin_inset Flex Code
19092 \begin_layout Plain Layout
19099 \begin_inset Flex Code
19102 \begin_layout Plain Layout
19108 ] The tag to be used for individual paragraphs of environments, replacing
19110 \begin_inset Flex Code
19113 \begin_layout Plain Layout
19119 in the examples above.
19121 \begin_inset Flex Code
19124 \begin_layout Plain Layout
19133 \begin_layout Description
19134 \begin_inset Flex Code
19137 \begin_layout Plain Layout
19144 \begin_inset Flex Code
19147 \begin_layout Plain Layout
19153 ] Attributes for the item tag.
19155 \begin_inset Quotes eld
19159 \begin_inset Flex Code
19162 \begin_layout Plain Layout
19163 class=`layoutname_item'
19169 \begin_inset Quotes erd
19177 contain any style information.
19179 \begin_inset Flex Code
19182 \begin_layout Plain Layout
19191 \begin_layout Description
19192 \begin_inset Flex Code
19195 \begin_layout Plain Layout
19202 \begin_inset Flex Code
19205 \begin_layout Plain Layout
19211 ] The tag to be used for paragraph and item labels, replacing
19212 \begin_inset Flex Code
19215 \begin_layout Plain Layout
19221 in the examples above.
19223 \begin_inset Flex Code
19226 \begin_layout Plain Layout
19233 \begin_inset Flex Code
19236 \begin_layout Plain Layout
19243 \begin_inset Flex Code
19246 \begin_layout Plain Layout
19253 \begin_inset Flex Code
19256 \begin_layout Plain Layout
19257 Centered_Top_Environment
19262 , in which case it defaults to
19263 \begin_inset Flex Code
19266 \begin_layout Plain Layout
19275 \begin_layout Description
19276 \begin_inset Flex Code
19279 \begin_layout Plain Layout
19286 \begin_inset Flex Code
19289 \begin_layout Plain Layout
19295 ] Attributes for the label tag.
19297 \begin_inset Quotes eld
19301 \begin_inset Flex Code
19304 \begin_layout Plain Layout
19305 class=`layoutname_label'
19311 \begin_inset Quotes erd
19319 contain any style information.
19321 \begin_inset Flex Code
19324 \begin_layout Plain Layout
19333 \begin_layout Description
19334 \begin_inset Flex Code
19337 \begin_layout Plain Layout
19344 \begin_inset Flex Code
19347 \begin_layout Plain Layout
19357 ] Meaningful only for list-like environments, this tag controls whether
19358 the label tag is output before or inside the item tag.
19359 This is used, for example, in the description environment, where we want
19361 \begin_inset Flex Code
19364 \begin_layout Plain Layout
19365 <dt>\SpecialChar \ldots{}
19366 </dt><dd>\SpecialChar \ldots{}
19374 \begin_inset Flex Code
19377 \begin_layout Plain Layout
19383 : The label tag is output inside the item tag.
19386 \begin_layout Description
19387 \begin_inset Flex Code
19390 \begin_layout Plain Layout
19396 Information to be output in the
19397 \begin_inset Flex Code
19400 \begin_layout Plain Layout
19406 section when this style is used.
19407 This might, for example, be used to include a
19408 \begin_inset Flex Code
19411 \begin_layout Plain Layout
19418 \begin_inset Flex Code
19421 \begin_layout Plain Layout
19430 \begin_layout Description
19431 \begin_inset Flex Code
19434 \begin_layout Plain Layout
19440 CSS style information to be included when this style is used.
19441 Note that this will automatically be wrapped in a layout-generated
19442 \begin_inset Flex Code
19445 \begin_layout Plain Layout
19451 block, so only the CSS itself need be included.
19454 \begin_layout Description
19455 \begin_inset Flex Code
19458 \begin_layout Plain Layout
19465 \begin_inset Flex Code
19468 \begin_layout Plain Layout
19474 ] The tag to be used for the main label, replacing
19475 \begin_inset Flex Code
19478 \begin_layout Plain Layout
19484 in the examples above.
19486 \begin_inset Flex Code
19489 \begin_layout Plain Layout
19498 \begin_layout Description
19499 \begin_inset Flex Code
19502 \begin_layout Plain Layout
19509 \begin_inset Flex Code
19512 \begin_layout Plain Layout
19522 ] Marks this style as the one to be used to generate the
19523 \begin_inset Flex Code
19526 \begin_layout Plain Layout
19532 tag for the XHTML file.
19533 By default, it is false.
19535 \begin_inset Flex Code
19538 \begin_layout Plain Layout
19544 file sets it to true for the
19545 \begin_inset Flex Code
19548 \begin_layout Plain Layout
19558 \begin_layout Subsection
19562 \begin_layout Standard
19563 The XHTML output of insets can also be controlled by information in layout
19568 \begin_layout Plain Layout
19569 At present, this is true only for
19570 \begin_inset Quotes eld
19574 \begin_inset Quotes erd
19577 insets (insets you can type into) and is not true for
19578 \begin_inset Quotes eld
19582 \begin_inset Quotes erd
19585 insets (insets that are associated with dialog boxes).
19590 Here, too, LyX tries to provide sensible defaults, and it constructs default
19592 But everything can be customized.
19595 \begin_layout Standard
19596 The XHTML LyX outputs for an inset has the following form:
19599 \begin_layout LyX-Code
19601 \begin_inset Quotes erd
19605 \begin_inset Quotes erd
19611 \begin_layout LyX-Code
19612 <labeltag>Label</labeltag>
19615 \begin_layout LyX-Code
19617 \begin_inset Quotes erd
19621 \begin_inset Quotes erd
19624 >Contents of the inset.</innertag>
19627 \begin_layout LyX-Code
19631 \begin_layout Standard
19632 If the inset permits multiple paragraphs---that is, if
19633 \begin_inset Flex Code
19636 \begin_layout Plain Layout
19642 is true---then the contents of the inset will itself be output as paragraphs
19643 formatted according to the styles used for those paragraphs (standard,
19644 quote, and the like).
19645 The label tag is of course omitted if the paragraph does not have a label
19646 and, at present, is always
19647 \begin_inset Flex Code
19650 \begin_layout Plain Layout
19657 The inner tag is optional and, by default, does not appear.
19660 \begin_layout Standard
19661 The specific tags and attributes output for each inset can be controlled
19662 by means of the following layout tags.
19665 \begin_layout Description
19666 \begin_inset Flex Code
19669 \begin_layout Plain Layout
19676 \begin_inset Flex Code
19679 \begin_layout Plain Layout
19685 ] Specifies attribute information to be output with the main tag.
19687 \begin_inset Quotes eld
19691 \begin_inset Flex Code
19694 \begin_layout Plain Layout
19695 class=`myinset' onclick=`\SpecialChar \ldots{}
19702 \begin_inset Quotes erd
19706 By default, LyX will output
19707 \begin_inset Quotes eld
19711 \begin_inset Flex Code
19714 \begin_layout Plain Layout
19721 \begin_inset Quotes erd
19725 \begin_inset Flex Code
19728 \begin_layout Plain Layout
19734 is the LyX name of the inset, made lowercase and with non-alphanumeric
19735 characters converted to underscores, for example: footnote.
19738 \begin_layout Description
19739 \begin_inset Flex Code
19742 \begin_layout Plain Layout
19749 \begin_inset Flex Code
19752 \begin_layout Plain Layout
19762 ] Whether to output the default CSS information LyX generates for this layout,
19763 even if additional information is explicitly provided via
19764 \begin_inset Flex Code
19767 \begin_layout Plain Layout
19775 \begin_inset Flex Code
19778 \begin_layout Plain Layout
19784 allows you to alter or augment the generated CSS, rather than to override
19789 \begin_layout Description
19790 \begin_inset Flex Code
19793 \begin_layout Plain Layout
19800 \begin_inset Flex Code
19803 \begin_layout Plain Layout
19809 ] Attributes for the inner tag.
19811 \begin_inset Quotes eld
19815 \begin_inset Flex Code
19818 \begin_layout Plain Layout
19819 class=`insetname_inner'
19825 \begin_inset Quotes erd
19831 \begin_layout Description
19832 \begin_inset Flex Code
19835 \begin_layout Plain Layout
19842 \begin_inset Flex Code
19845 \begin_layout Plain Layout
19851 ] The inner tag, replacing
19852 \begin_inset Flex Code
19855 \begin_layout Plain Layout
19861 in the examples above.
19862 By default, there is none.
19865 \begin_layout Description
19866 \begin_inset Flex Code
19869 \begin_layout Plain Layout
19876 \begin_inset Flex Code
19879 \begin_layout Plain Layout
19887 ] Whether this inset represents a standalone block of text (such as a footnote)
19888 or instead represents material that is included in the surrounding text
19889 (such as a branch).
19893 \begin_layout Description
19894 \begin_inset Flex Code
19897 \begin_layout Plain Layout
19904 \begin_inset Flex Code
19907 \begin_layout Plain Layout
19913 ] A label for this inset, possibly including a reference to a counter.
19914 For example, for footnote, it might be:
19915 \begin_inset Flex Code
19918 \begin_layout Plain Layout
19927 This is optional, and there is no default.
19930 \begin_layout Description
19931 \begin_inset Flex Code
19934 \begin_layout Plain Layout
19940 Information to be output in the
19941 \begin_inset Flex Code
19944 \begin_layout Plain Layout
19950 section when this style is used.
19951 This might, for example, be used to include a
19952 \begin_inset Flex Code
19955 \begin_layout Plain Layout
19962 \begin_inset Flex Code
19965 \begin_layout Plain Layout
19974 \begin_layout Description
19975 \begin_inset Flex Code
19978 \begin_layout Plain Layout
19984 CSS style information to be included when this style is used.
19985 Note that this will automatically be wrapped in a layout-generated
19986 \begin_inset Flex Code
19989 \begin_layout Plain Layout
19995 block, so only the CSS itself need be included.
19998 \begin_layout Description
19999 \begin_inset Flex Code
20002 \begin_layout Plain Layout
20009 \begin_inset Flex Code
20012 \begin_layout Plain Layout
20018 ] The tag to be used for the main label, replacing
20019 \begin_inset Flex Code
20022 \begin_layout Plain Layout
20028 in the examples above.
20029 The default depends upon the setting of
20030 \begin_inset Flex Code
20033 \begin_layout Plain Layout
20040 \begin_inset Flex Code
20043 \begin_layout Plain Layout
20049 is true, the default is
20050 \begin_inset Flex Code
20053 \begin_layout Plain Layout
20059 ; if it is false, the default is
20060 \begin_inset Flex Code
20063 \begin_layout Plain Layout
20072 \begin_layout Subsection
20076 \begin_layout Standard
20077 The XHTML output for floats too can be controlled by layout information.
20078 The output has the following form:
20081 \begin_layout LyX-Code
20083 \begin_inset Quotes erd
20087 \begin_inset Quotes erd
20093 \begin_layout LyX-Code
20094 Contents of the float.
20097 \begin_layout LyX-Code
20101 \begin_layout Standard
20102 The caption, if there is one, is a separate inset and will be output as
20104 Its appearance can be controlled via the InsetLayout for caption insets.
20108 \begin_layout Description
20109 \begin_inset Flex Code
20112 \begin_layout Plain Layout
20119 \begin_inset Flex Code
20122 \begin_layout Plain Layout
20128 ] Specifies attribute information to be output with the main tag.
20130 \begin_inset Quotes eld
20134 \begin_inset Flex Code
20137 \begin_layout Plain Layout
20138 class=`myfloat' onclick=`\SpecialChar \ldots{}
20145 \begin_inset Quotes erd
20149 By default, LyX will output
20150 \begin_inset Quotes eld
20154 \begin_inset Flex Code
20157 \begin_layout Plain Layout
20158 class=`float float-floattype'
20164 \begin_inset Quotes erd
20168 \begin_inset Flex Code
20171 \begin_layout Plain Layout
20177 is LyX's name for this type of float, as determined by the float declaration
20179 \begin_inset CommandInset ref
20181 reference "sub:Floats"
20185 ), though made lowercase and with non-alphanumeric characters converted
20186 to underscores, for example: float-table.
20189 \begin_layout Description
20190 \begin_inset Flex Code
20193 \begin_layout Plain Layout
20199 CSS style information to be included when this float is used.
20200 Note that this will automatically be wrapped in a layout-generated
20201 \begin_inset Flex Code
20204 \begin_layout Plain Layout
20210 block, so only the CSS itself need be included.
20213 \begin_layout Description
20214 \begin_inset Flex Code
20217 \begin_layout Plain Layout
20224 \begin_inset Flex Code
20227 \begin_layout Plain Layout
20233 ] The tag to be used for this float, replacing
20234 \begin_inset Quotes eld
20238 \begin_inset Flex Code
20241 \begin_layout Plain Layout
20248 \begin_inset Quotes erd
20251 in the example above.
20253 \begin_inset Flex Code
20256 \begin_layout Plain Layout
20262 and will rarely need changing.
20265 \begin_layout Subsection
20266 Bibliography formatting
20269 \begin_layout Standard
20270 The bibliography can be formatted using
20271 \begin_inset Flex Code
20274 \begin_layout Plain Layout
20282 \begin_inset CommandInset ref
20284 reference "sub:Citation-format-description"
20291 \begin_layout Subsection
20295 \begin_layout Standard
20296 We have several times mentioned that LyX will generate default CSS style
20297 rules for both insets and paragraph styles, based upon the other layout
20298 information that is provided.
20299 In this section, we shall say a word about which layout information LyX
20303 \begin_layout Standard
20304 At present, LyX auto-generates CSS only for font information, making use
20306 \begin_inset Flex Code
20309 \begin_layout Plain Layout
20316 \begin_inset Flex Code
20319 \begin_layout Plain Layout
20326 \begin_inset Flex Code
20329 \begin_layout Plain Layout
20336 \begin_inset Flex Code
20339 \begin_layout Plain Layout
20346 \begin_inset Flex Code
20349 \begin_layout Plain Layout
20357 \begin_inset CommandInset ref
20359 reference "sub:Font-description"
20363 .) The translation is mostly straightforward and obvious.
20365 \begin_inset Quotes eld
20369 \begin_inset Flex Code
20372 \begin_layout Plain Layout
20379 \begin_inset Quotes erd
20383 \begin_inset Quotes eld
20387 \begin_inset Flex Code
20390 \begin_layout Plain Layout
20391 font-family: sans-serif;
20397 \begin_inset Quotes erd
20401 The correspondence of LyX sizes and CSS sizes is a little less obvious
20402 but nonetheless intuitive.
20404 \begin_inset Flex Code
20407 \begin_layout Plain Layout
20414 \begin_inset Flex URL
20417 \begin_layout Plain Layout
20427 \begin_layout Chapter
20428 Including External Material
20431 \begin_layout Standard
20432 \begin_inset Box Shadowbox
20442 height_special "totalheight"
20445 \begin_layout Plain Layout
20446 WARNING: This portion of the documentation has not been updated for some
20448 We certainly hope that it is still accurate, but there are no guarantees.
20456 \begin_layout Standard
20457 The use of material from sources external to LyX is covered in detail in
20463 This part of the manual covers what needs to happen behind the scenes for
20464 new sorts of material to be included.
20467 \begin_layout Section
20471 \begin_layout Standard
20472 The external material feature is based on the concept of a
20477 A template is a specification of how LyX should interface with a certain
20479 As bundled, LyX comes with predefined templates for Xfig figures, various
20480 raster format images, chess diagrams, and LilyPond music notation.
20481 You can check the actual list by using the menu
20482 \begin_inset Flex MenuItem
20485 \begin_layout Plain Layout
20486 Insert\SpecialChar \menuseparator
20487 File\SpecialChar \menuseparator
20494 Furthermore, it is possible to roll your own template to support a specific
20496 Later we'll describe in more detail what is involved, and hopefully you
20497 will submit all the templates you create so we can include them in a later
20501 \begin_layout Standard
20502 Another basic idea of the external material feature is to distinguish between
20503 the original file that serves as a base for final material and the produced
20504 file that is included in your exported or printed document.
20505 For example, consider the case of a figure produced with
20506 \begin_inset Flex Code
20509 \begin_layout Plain Layout
20516 The Xfig application itself works on an original file with the
20517 \begin_inset Flex Code
20520 \begin_layout Plain Layout
20527 Within Xfig, you create and change your figure, and when you are done,
20529 \begin_inset Flex Code
20532 \begin_layout Plain Layout
20539 When you want to include the figure in your document, you invoke
20540 \begin_inset Flex Code
20543 \begin_layout Plain Layout
20549 in order to create a PostScript file that can readily be included in your
20552 \begin_inset Flex Code
20555 \begin_layout Plain Layout
20561 file is the original file, and the PostScript file is the produced file.
20564 \begin_layout Standard
20565 This distinction is important in order to allow updating of the material
20566 while you are in the process of writing the document.
20567 Furthermore, it provides us with the flexibility that is needed to support
20568 multiple export formats.
20569 For instance, in the case of a plain text file, it is not exactly an award-winn
20570 ing idea to include the figure as raw PostScript.
20571 Instead, you would either prefer to just include a reference to the figure
20572 or try to invoke some graphics to ASCII converter to make the final result
20573 look similar to the real graphics.
20574 The external material management allows you to do this, because it is parametri
20575 zed on the different export formats that LyX supports.
20578 \begin_layout Standard
20579 Besides supporting the production of different products according to the
20580 exported format, it supports tight integration with editing and viewing
20582 In the case of an Xfig figure, you are able to invoke Xfig on the original
20583 file with a single click from within the external material dialog in LyX,
20584 and also preview the produced PostScript file with Ghostview with another
20586 No more fiddling around with the command line and/or file browsers to locate
20587 and manipulate the original or produced files.
20588 In this way, you are finally able to take full advantage of the many different
20589 applications that are relevant to use when you write your documents, and
20590 ultimately be more productive.
20593 \begin_layout Section
20594 The external template configuration file
20597 \begin_layout Standard
20598 It is relatively easy to add custom external template definitions to LyX.
20599 However, be aware that doing this in an careless manner most probably
20603 introduce an easily exploitable security hole.
20604 So before you do this, please read the discussion about security in section
20606 \begin_inset CommandInset ref
20608 reference "sec:Security-discussion"
20615 \begin_layout Standard
20616 Having said that, we encourage you to submit any interesting templates that
20621 \begin_layout Standard
20622 The external templates are defined in the
20623 \begin_inset Flex Code
20626 \begin_layout Plain Layout
20627 LyXDir/lib/external_templates
20633 You can place your own version in
20634 \begin_inset Flex Code
20637 \begin_layout Plain Layout
20638 UserDir/external_templates
20646 \begin_layout Standard
20647 A typical template looks like this:
20650 \begin_layout LyX-Code
20654 \begin_layout LyX-Code
20655 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
20658 \begin_layout LyX-Code
20662 \begin_layout LyX-Code
20666 \begin_layout LyX-Code
20670 \begin_layout LyX-Code
20674 \begin_layout LyX-Code
20678 \begin_layout LyX-Code
20679 AutomaticProduction true
20682 \begin_layout LyX-Code
20686 \begin_layout LyX-Code
20690 \begin_layout LyX-Code
20694 \begin_layout LyX-Code
20695 TransformCommand Rotate RotationLatexCommand
20698 \begin_layout LyX-Code
20699 TransformCommand Resize ResizeLatexCommand
20702 \begin_layout LyX-Code
20703 Product "$$RotateFront$$ResizeFront
20706 \begin_layout LyX-Code
20711 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
20714 \begin_layout LyX-Code
20715 $$ResizeBack$$RotateBack"
20718 \begin_layout LyX-Code
20722 \begin_layout LyX-Code
20723 UpdateResult "$$AbsPath$$Basename.pstex_t"
20726 \begin_layout LyX-Code
20727 Requirement "graphicx"
20730 \begin_layout LyX-Code
20731 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20734 \begin_layout LyX-Code
20735 ReferencedFile latex "$$AbsPath$$Basename.eps"
20738 \begin_layout LyX-Code
20739 ReferencedFile dvi "$$AbsPath$$Basename.eps"
20742 \begin_layout LyX-Code
20746 \begin_layout LyX-Code
20750 \begin_layout LyX-Code
20751 TransformCommand Rotate RotationLatexCommand
20754 \begin_layout LyX-Code
20755 TransformCommand Resize ResizeLatexCommand
20758 \begin_layout LyX-Code
20759 Product "$$RotateFront$$ResizeFront
20762 \begin_layout LyX-Code
20767 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
20770 \begin_layout LyX-Code
20771 $$ResizeBack$$RotateBack"
20774 \begin_layout LyX-Code
20775 UpdateFormat pdftex
20778 \begin_layout LyX-Code
20779 UpdateResult "$$AbsPath$$Basename.pdftex_t"
20782 \begin_layout LyX-Code
20783 Requirement "graphicx"
20786 \begin_layout LyX-Code
20787 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
20790 \begin_layout LyX-Code
20791 ReferencedFile latex "$$AbsPath$$Basename.pdf"
20794 \begin_layout LyX-Code
20798 \begin_layout LyX-Code
20802 \begin_layout LyX-Code
20803 Product "$$Contents(
20805 "$$AbsPath$$Basename.asc
20810 \begin_layout LyX-Code
20811 UpdateFormat asciixfig
20814 \begin_layout LyX-Code
20815 UpdateResult "$$AbsPath$$Basename.asc"
20818 \begin_layout LyX-Code
20822 \begin_layout LyX-Code
20826 \begin_layout LyX-Code
20827 Product "<graphic fileref=
20829 "$$AbsOrRelPathMaster$$Basename.eps
20834 \begin_layout LyX-Code
20838 \begin_layout LyX-Code
20842 \begin_layout LyX-Code
20843 UpdateResult "$$AbsPath$$Basename.eps"
20846 \begin_layout LyX-Code
20847 ReferencedFile docbook "$$AbsPath$$Basename.eps"
20850 \begin_layout LyX-Code
20851 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
20854 \begin_layout LyX-Code
20858 \begin_layout LyX-Code
20859 Product "[XFig: $$FName]"
20862 \begin_layout LyX-Code
20866 \begin_layout LyX-Code
20870 \begin_layout Standard
20871 As you can see, the template is enclosed in
20872 \begin_inset Flex Code
20875 \begin_layout Plain Layout
20881 \SpecialChar \ldots{}
20883 \begin_inset Flex Code
20886 \begin_layout Plain Layout
20893 It contains a header specifying some general settings and, for each supported
20894 primary document file format, a section
20895 \begin_inset Flex Code
20898 \begin_layout Plain Layout
20904 \SpecialChar \ldots{}
20906 \begin_inset Flex Code
20909 \begin_layout Plain Layout
20918 \begin_layout Subsection
20919 The template header
20922 \begin_layout Description
20923 \begin_inset Flex Code
20926 \begin_layout Plain Layout
20927 AutomaticProduction
20928 \begin_inset space ~
20936 Whether the file represented by the template must be generated by LyX.
20937 This command must occur exactly once.
20940 \begin_layout Description
20941 \begin_inset Flex Code
20944 \begin_layout Plain Layout
20946 \begin_inset space ~
20954 A glob pattern that is used in the file dialog to filter out the desired
20956 If there is more than one possible file extension (e.
20957 \begin_inset space \thinspace{}
20961 \begin_inset space \space{}
20965 \begin_inset Flex Code
20968 \begin_layout Plain Layout
20975 \begin_inset Flex Code
20978 \begin_layout Plain Layout
20984 ), use something like
20985 \begin_inset Flex Code
20988 \begin_layout Plain Layout
20995 This command must occur exactly once.
20998 \begin_layout Description
20999 \begin_inset Flex Code
21002 \begin_layout Plain Layout
21004 \begin_inset space ~
21012 The text that is displayed on the button.
21013 This command must occur exactly once.
21016 \begin_layout Description
21017 \begin_inset Flex Code
21020 \begin_layout Plain Layout
21022 \begin_inset space ~
21026 \begin_inset space ~
21034 The help text that is used in the External dialog.
21035 Provide enough information to explain to the user just what the template
21036 can provide him with.
21037 This command must occur exactly once.
21040 \begin_layout Description
21041 \begin_inset Flex Code
21044 \begin_layout Plain Layout
21046 \begin_inset space ~
21054 The file format of the original file.
21055 This must be the name of a format that is known to LyX (see section
21056 \begin_inset space ~
21060 \begin_inset CommandInset ref
21062 reference "sec:Formats"
21068 \begin_inset Quotes eld
21072 \begin_inset Flex Code
21075 \begin_layout Plain Layout
21082 \begin_inset Quotes erd
21085 if the template can handle original files of more than one format.
21086 LyX will attempt to interrogate the file itself in order to deduce its
21087 format in this case.
21088 This command must occur exactly once.
21091 \begin_layout Description
21092 \begin_inset Flex Code
21095 \begin_layout Plain Layout
21097 \begin_inset space ~
21105 A unique name for the template.
21106 It must not contain substitution macros (see below).
21109 \begin_layout Description
21110 \begin_inset Flex Code
21113 \begin_layout Plain Layout
21115 \begin_inset space ~
21118 Rotate|Resize|Clip|Extra
21123 This command specifies which transformations are supported by this template.
21124 It may occur zero or more times.
21125 This command enables the corresponding tabs in the external dialog.
21127 \begin_inset Flex Code
21130 \begin_layout Plain Layout
21136 command must have either a corresponding
21137 \begin_inset Flex Code
21140 \begin_layout Plain Layout
21147 \begin_inset Flex Code
21150 \begin_layout Plain Layout
21157 \begin_inset Flex Code
21160 \begin_layout Plain Layout
21167 Otherwise the transformation will not be supported by that format.
21170 \begin_layout Subsection
21174 \begin_layout Description
21175 \begin_inset Flex Code
21178 \begin_layout Plain Layout
21180 \begin_inset space ~
21183 LaTeX|PDFLaTeX|PlainText|DocBook
21188 The primary document file format that this format definition is for.
21189 Not every template has a sensible representation in all document file formats.
21190 Please define nevertheless a
21191 \begin_inset Flex Code
21194 \begin_layout Plain Layout
21200 section for all templates.
21201 Use a dummy text when no representation is available.
21202 Then you can at least see a reference to the external material in the exported
21206 \begin_layout Description
21207 \begin_inset Flex Code
21210 \begin_layout Plain Layout
21212 \begin_inset space ~
21216 \begin_inset space ~
21224 This command defines an additional macro
21225 \begin_inset Flex Code
21228 \begin_layout Plain Layout
21234 for substitution in
21235 \begin_inset Flex Code
21238 \begin_layout Plain Layout
21246 \begin_inset Flex Code
21249 \begin_layout Plain Layout
21255 itself may contain substitution macros.
21256 The advantage over using
21257 \begin_inset Flex Code
21260 \begin_layout Plain Layout
21267 \begin_inset Flex Code
21270 \begin_layout Plain Layout
21276 is that the substituted value of
21277 \begin_inset Flex Code
21280 \begin_layout Plain Layout
21286 is sanitized so that it is a valid optional argument in the document format.
21287 This command may occur zero or more times.
21290 \begin_layout Description
21291 \begin_inset Flex Code
21294 \begin_layout Plain Layout
21296 \begin_inset space ~
21304 The text that is inserted in the exported document.
21305 This is actually the most important command and can be quite complex.
21306 This command must occur exactly once.
21309 \begin_layout Description
21310 \begin_inset Flex Code
21313 \begin_layout Plain Layout
21315 \begin_inset space ~
21323 This command specifies a preamble snippet that will be included in the
21325 It has to be defined using
21326 \begin_inset Flex Code
21329 \begin_layout Plain Layout
21335 \SpecialChar \ldots{}
21337 \begin_inset Flex Code
21340 \begin_layout Plain Layout
21347 This command may occur zero or more times.
21350 \begin_layout Description
21351 \begin_inset Flex Code
21354 \begin_layout Plain Layout
21356 \begin_inset space ~
21360 \begin_inset space ~
21368 This command denotes files that are created by the conversion process and
21369 are needed for a particular export format.
21370 If the filename is relative, it is interpreted relative to the master document.
21371 This command may be given zero or more times.
21374 \begin_layout Description
21375 \begin_inset Flex Code
21378 \begin_layout Plain Layout
21380 \begin_inset space ~
21388 The name of a required LaTeX package.
21389 The package is included via
21390 \begin_inset Flex Code
21393 \begin_layout Plain Layout
21401 in the LaTeX preamble.
21402 This command may occur zero or more times.
21405 \begin_layout Description
21406 \begin_inset Flex Code
21409 \begin_layout Plain Layout
21411 \begin_inset space ~
21415 \begin_inset space ~
21418 RotationLatexCommand
21423 This command specifies that the built in LaTeX command should be used for
21425 This command may occur once or not at all.
21428 \begin_layout Description
21429 \begin_inset Flex Code
21432 \begin_layout Plain Layout
21434 \begin_inset space ~
21438 \begin_inset space ~
21446 This command specifies that the built in LaTeX command should be used for
21448 This command may occur once or not at all.
21451 \begin_layout Description
21452 \begin_inset Flex Code
21455 \begin_layout Plain Layout
21457 \begin_inset space ~
21461 \begin_inset space ~
21464 RotationLatexOption
21469 This command specifies that rotation is done via an optional argument.
21470 This command may occur once or not at all.
21473 \begin_layout Description
21474 \begin_inset Flex Code
21477 \begin_layout Plain Layout
21479 \begin_inset space ~
21483 \begin_inset space ~
21491 This command specifies that resizing is done via an optional argument.
21492 This command may occur once or not at all.
21495 \begin_layout Description
21496 \begin_inset Flex Code
21499 \begin_layout Plain Layout
21501 \begin_inset space ~
21505 \begin_inset space ~
21513 This command specifies that clipping is done via an optional argument.
21514 This command may occur once or not at all.
21517 \begin_layout Description
21518 \begin_inset Flex Code
21521 \begin_layout Plain Layout
21523 \begin_inset space ~
21527 \begin_inset space ~
21535 This command specifies that an extra optional argument is used.
21536 This command may occur once or not at all.
21539 \begin_layout Description
21540 \begin_inset Flex Code
21543 \begin_layout Plain Layout
21545 \begin_inset space ~
21553 The file format of the converted file.
21554 This must be the name of a format that is known to LyX (see the
21555 \begin_inset Flex MenuItem
21558 \begin_layout Plain Layout
21563 ools\SpecialChar \menuseparator
21568 references\SpecialChar \menuseparator
21569 File Handling\SpecialChar \menuseparator
21576 This command must occur exactly once.
21579 \begin_layout Description
21580 \begin_inset Flex Code
21583 \begin_layout Plain Layout
21585 \begin_inset space ~
21593 The file name of the converted file.
21594 The file name must be absolute.
21595 This command must occur exactly once.
21598 \begin_layout Subsection
21599 Preamble definitions
21602 \begin_layout Standard
21603 The external template configuration file may contain additional preamble
21604 definitions enclosed by
21605 \begin_inset Flex Code
21608 \begin_layout Plain Layout
21614 \SpecialChar \ldots{}
21616 \begin_inset Flex Code
21619 \begin_layout Plain Layout
21626 They can be used by the templates in the
21627 \begin_inset Flex Code
21630 \begin_layout Plain Layout
21639 \begin_layout Section
21640 The substitution mechanism
21643 \begin_layout Standard
21644 When the external material facility invokes an external program, it is done
21645 on the basis of a command defined in the template configuration file.
21646 These commands can contain various macros that are expanded before execution.
21647 Execution always take place in the directory of the containing document.
21650 \begin_layout Standard
21651 Also, whenever external material is to be displayed, the name will be produced
21652 by the substitution mechanism, and most other commands in the template
21653 definition support substitution as well.
21656 \begin_layout Standard
21657 The available macros are the following:
21660 \begin_layout Description
21661 \begin_inset Flex Code
21664 \begin_layout Plain Layout
21665 $$AbsOrRelPathMaster
21670 The file path, absolute or relative to the master LyX document.
21673 \begin_layout Description
21674 \begin_inset Flex Code
21677 \begin_layout Plain Layout
21678 $$AbsOrRelPathParent
21683 The file path, absolute or relative to the LyX document.
21686 \begin_layout Description
21687 \begin_inset Flex Code
21690 \begin_layout Plain Layout
21696 The absolute file path.
21699 \begin_layout Description
21700 \begin_inset Flex Code
21703 \begin_layout Plain Layout
21709 The filename without path and without the extension.
21712 \begin_layout Description
21713 \begin_inset Flex Code
21716 \begin_layout Plain Layout
21718 \begin_inset Quotes eld
21722 \begin_inset Quotes erd
21730 This macro will expand to the contents of the file with the name
21731 \begin_inset Flex Code
21734 \begin_layout Plain Layout
21743 \begin_layout Description
21744 \begin_inset Flex Code
21747 \begin_layout Plain Layout
21753 The file extension (including the dot).
21756 \begin_layout Description
21757 \begin_inset Flex Code
21760 \begin_layout Plain Layout
21766 The filename of the file specified in the external material dialog.
21767 This is either an absolute name, or it is relative to the LyX document.
21770 \begin_layout Description
21771 \begin_inset Flex Code
21774 \begin_layout Plain Layout
21781 \begin_inset Flex Code
21784 \begin_layout Plain Layout
21790 (absolute name or relative to the LyX document).
21793 \begin_layout Description
21794 \begin_inset Flex Code
21797 \begin_layout Plain Layout
21803 The file path, relative to the master LyX document.
21806 \begin_layout Description
21807 \begin_inset Flex Code
21810 \begin_layout Plain Layout
21816 The file path, relative to the LyX document.
21819 \begin_layout Description
21820 \begin_inset Flex Code
21823 \begin_layout Plain Layout
21829 This macro will expand to the absolute path of the system directory.
21830 This is typically used to point to the various helper scripts that are
21834 \begin_layout Description
21835 \begin_inset Flex Code
21838 \begin_layout Plain Layout
21844 A name and full path to a temporary file which will be automatically deleted
21845 whenever the containing document is closed, or the external material insertion
21849 \begin_layout Standard
21850 All path macros contain a trailing directory separator, so you can construct
21852 \begin_inset space \thinspace{}
21856 \begin_inset space \space{}
21859 the absolute filename with
21860 \begin_inset Flex Code
21863 \begin_layout Plain Layout
21864 $$AbsPath$$Basename$$Extension
21872 \begin_layout Standard
21873 The macros above are substituted in all commands unless otherwise noted.
21875 \begin_inset Flex Code
21878 \begin_layout Plain Layout
21884 supports additionally the following substitutions if they are enabled by
21886 \begin_inset Flex Code
21889 \begin_layout Plain Layout
21896 \begin_inset Flex Code
21899 \begin_layout Plain Layout
21908 \begin_layout Description
21909 \begin_inset Flex Code
21912 \begin_layout Plain Layout
21918 The front part of the resize command.
21921 \begin_layout Description
21922 \begin_inset Flex Code
21925 \begin_layout Plain Layout
21931 The back part of the resize command.
21934 \begin_layout Description
21935 \begin_inset Flex Code
21938 \begin_layout Plain Layout
21944 The front part of the rotation command.
21947 \begin_layout Description
21948 \begin_inset Flex Code
21951 \begin_layout Plain Layout
21957 The back part of the rotation command.
21960 \begin_layout Standard
21961 The value string of the
21962 \begin_inset Flex Code
21965 \begin_layout Plain Layout
21971 command supports additionally the following substitutions if they are enabled
21973 \begin_inset Flex Code
21976 \begin_layout Plain Layout
21983 \begin_inset Flex Code
21986 \begin_layout Plain Layout
21995 \begin_layout Description
21996 \begin_inset Flex Code
21999 \begin_layout Plain Layout
22008 \begin_layout Description
22009 \begin_inset Flex Code
22012 \begin_layout Plain Layout
22021 \begin_layout Description
22022 \begin_inset Flex Code
22025 \begin_layout Plain Layout
22034 \begin_layout Description
22035 \begin_inset Flex Code
22038 \begin_layout Plain Layout
22044 The rotation option.
22047 \begin_layout Standard
22048 You may ask why there are so many path macros.
22049 There are mainly two reasons:
22052 \begin_layout Enumerate
22053 Relative and absolute file names should remain relative or absolute, respectivel
22055 Users may have reasons to prefer either form.
22056 Relative names are useful for portable documents that should work on different
22057 machines, for example.
22058 Absolute names may be required by some programs.
22061 \begin_layout Enumerate
22062 LaTeX treats relative file names differently than LyX and other programs
22063 in nested included files.
22064 For LyX, a relative file name is always relative to the document that contains
22066 For LaTeX, it is always relative to the master document.
22067 These two definitions are identical if you have only one document, but
22068 differ if you have a master document that includes part documents.
22069 That means that relative filenames must be transformed when presented to
22071 Fortunately LyX does this automatically for you if you choose the right
22075 \begin_layout Standard
22076 So which path macro should be used in new template definitions? The rule
22080 \begin_layout Itemize
22082 \begin_inset Flex Code
22085 \begin_layout Plain Layout
22091 if an absolute path is required.
22094 \begin_layout Itemize
22096 \begin_inset Flex Code
22099 \begin_layout Plain Layout
22100 $$AbsOrRelPathMaster
22105 if the substituted string is some kind of LaTeX input.
22108 \begin_layout Itemize
22110 \begin_inset Flex Code
22113 \begin_layout Plain Layout
22114 $$AbsOrRelPathParent
22119 in order to preserve the user's choice.
22122 \begin_layout Standard
22123 There are special cases where this rule does not work and e.
22124 \begin_inset space \thinspace{}
22128 \begin_inset space \space{}
22131 relative names are needed, but normally it will work just fine.
22132 One example for such a case is the command
22133 \begin_inset Flex Code
22136 \begin_layout Plain Layout
22137 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
22142 in the XFig template above: We can't use the absolute name because the
22144 \begin_inset Flex Code
22147 \begin_layout Plain Layout
22153 files needs the relative name in order to rewrite the file content.
22156 \begin_layout Section
22157 Security discussion
22158 \begin_inset CommandInset label
22160 name "sec:Security-discussion"
22167 \begin_layout Standard
22168 The external material feature interfaces with a lot of external programs
22169 and does so automatically, so we have to consider the security implications
22171 In particular, since you have the option of including your own filenames
22172 and/or parameter strings and those are expanded into a command, it seems
22173 that it would be possible to create a malicious document which executes
22174 arbitrary commands when a user views or prints the document.
22175 This is something we definitely want to avoid.
22178 \begin_layout Standard
22179 However, since the external program commands are specified in the template
22180 configuration file only, there are no security issues if LyX is properly
22181 configured with safe templates only.
22182 This is so because the external programs are invoked with the
22183 \begin_inset Flex Code
22186 \begin_layout Plain Layout
22192 -system call rather than the
22193 \begin_inset Flex Code
22196 \begin_layout Plain Layout
22202 system-call, so it's not possible to execute arbitrary commands from the
22203 filename or parameter section via the shell.
22206 \begin_layout Standard
22207 This also implies that you are restricted in what command strings you can
22208 use in the external material templates.
22209 In particular, pipes and redirection are not readily available.
22210 This has to be so if LyX should remain safe.
22211 If you want to use some of the shell features, you should write a safe
22212 script to do this in a controlled manner, and then invoke the script from
22213 the command string.
22217 \begin_layout Standard
22218 It is possible to design a template that interacts directly with the shell,
22219 but since this would allow a malicious user to execute arbitrary commands
22220 by writing clever filenames and/or parameters, we generally recommend that
22221 you only use safe scripts that work with the
22222 \begin_inset Flex Code
22225 \begin_layout Plain Layout
22231 system call in a controlled manner.
22232 Of course, for use in a controlled environment, it can be tempting to just
22233 fall back to use ordinary shell scripts.
22234 If you do so, be aware that you
22238 provide an easily exploitable security hole in your system.
22239 Of course it stands to reason that such unsafe templates will never be
22240 included in the standard LyX distribution, although we do encourage people
22241 to submit new templates in the open source tradition.
22242 But LyX as shipped from the official distribution channels will never have
22246 \begin_layout Standard
22247 Including external material provides a lot of power, and you have to be
22248 careful not to introduce security hazards with this power.
22249 A subtle error in a single line in an innocent looking script can open
22250 the door to huge security problems.
22251 So if you do not fully understand the issues, we recommend that you consult
22252 a knowledgeable security professional or the LyX development team if you
22253 have any questions about whether a given template is safe or not.
22254 And do this before you use it in an uncontrolled environment.