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
12446 \begin_inset Flex Code
12449 \begin_layout Plain Layout
12456 \begin_inset Flex Code
12459 \begin_layout Plain Layout
12465 ] If you put styles into environments, the leftmargins are not simply added,
12466 but added with a factor
12467 \begin_inset Formula $\frac{4}{depth+4}$
12471 Note that this parameter is also used when the margin is defined as
12472 \begin_inset Flex Code
12475 \begin_layout Plain Layout
12482 \begin_inset Flex Code
12485 \begin_layout Plain Layout
12492 Then it is added to the manual or dynamic margin.
12494 \begin_inset Newline newline
12497 The argument is passed as a string.
12499 \begin_inset Quotes eld
12503 \begin_inset Flex Code
12506 \begin_layout Plain Layout
12513 \begin_inset Quotes erd
12516 means that the paragraph is indented with the width of
12517 \begin_inset Quotes eld
12521 \begin_inset Flex Code
12524 \begin_layout Plain Layout
12531 \begin_inset Quotes erd
12534 in the normal font.
12535 You can get a negative width by prefixing the string with
12536 \begin_inset Quotes eld
12540 \begin_inset Flex Code
12543 \begin_layout Plain Layout
12550 \begin_inset Quotes erd
12554 This way was chosen so that the look is the same with each used screen
12559 \begin_layout Description
12560 \begin_inset Flex Code
12563 \begin_layout Plain Layout
12570 \begin_inset Flex Code
12573 \begin_layout Plain Layout
12578 , Manual, Dynamic, First_Dynamic, Right_Address_Box
12584 \begin_inset Newline newline
12587 The kind of margin that the style has on the left side.
12589 \begin_inset Flex Code
12592 \begin_layout Plain Layout
12598 just means a fixed margin.
12600 \begin_inset Flex Code
12603 \begin_layout Plain Layout
12609 means that the left margin depends on the string entered in the
12610 \begin_inset Flex MenuItem
12613 \begin_layout Plain Layout
12614 Edit\SpecialChar \menuseparator
12616 \begin_inset space ~
12625 This is used to typeset nice lists without tabulators.
12627 \begin_inset Flex Code
12630 \begin_layout Plain Layout
12636 means that the margin depends on the size of the label.
12637 This is used for automatic enumerated headlines.
12638 It is obvious that the headline
12639 \begin_inset Quotes eld
12642 5.4.3.2.1 Very long headline
12643 \begin_inset Quotes erd
12646 must have a wider left margin (as wide as
12647 \begin_inset Quotes eld
12651 \begin_inset Quotes erd
12654 plus the space) than
12655 \begin_inset Quotes eld
12658 3.2 Very long headline
12659 \begin_inset Quotes erd
12663 \begin_inset Quotes eld
12667 \begin_inset Quotes erd
12670 are not able to do this.
12672 \begin_inset Flex Code
12675 \begin_layout Plain Layout
12681 is similar, but only the very first row of the paragraph is dynamic, while
12682 the others are static; this is used, for example, for descriptions.
12684 \begin_inset Flex Code
12687 \begin_layout Plain Layout
12693 means the margin is chosen in a way that the longest row of this paragraph
12694 fits to the right margin.
12695 This is used to typeset an address on the right edge of the page.
12698 \begin_layout Description
12699 \begin_inset Flex Code
12702 \begin_layout Plain Layout
12709 \begin_inset Flex Code
12712 \begin_layout Plain Layout
12721 \begin_inset Flex Code
12724 \begin_layout Plain Layout
12730 ] Whether fragile commands in this style should be
12731 \begin_inset Flex Code
12734 \begin_layout Plain Layout
12747 whether this command should itself be protected.)
12750 \begin_layout Description
12751 \begin_inset Flex Code
12754 \begin_layout Plain Layout
12761 \begin_inset Flex Code
12764 \begin_layout Plain Layout
12771 \begin_inset Flex Code
12774 \begin_layout Plain Layout
12782 ] Whether newlines are translated into LaTeX newlines (
12783 \begin_inset Flex Code
12786 \begin_layout Plain Layout
12797 The translation can be switched off to allow more comfortable LaTeX editing
12801 \begin_layout Description
12802 \begin_inset Flex Code
12805 \begin_layout Plain Layout
12812 \begin_inset Flex Code
12815 \begin_layout Plain Layout
12822 \begin_inset Flex Code
12825 \begin_layout Plain Layout
12833 ] If set to true, and if
12834 \begin_inset Flex Code
12837 \begin_layout Plain Layout
12844 \begin_inset Flex Code
12847 \begin_layout Plain Layout
12853 ) paragraphs are being indented, then the indentation of such a paragraph
12854 following one of this type will be suppressed.
12855 (So this will not affect the display of non-default paragraphs.)
12858 \begin_layout Description
12859 \begin_inset Flex Code
12862 \begin_layout Plain Layout
12868 Name of a style that has replaced this style.
12869 This is used to rename a style, while keeping backward compatibility.
12872 \begin_layout Description
12874 \change_deleted -712698321 1353679722
12875 \begin_inset Flex Code
12878 \begin_layout Plain Layout
12885 \begin_inset Flex Code
12888 \begin_layout Plain Layout
12894 ] The number of optional arguments that can be used with this style.
12895 This is useful for things like section headings, and only makes sense with
12897 Note that, on output, the optional arguments will all precede any required
12898 arguments (see below).
12899 So one can have constructs like:
12903 \begin_layout LyX-Code
12905 \change_deleted -712698321 1353679722
12908 mycmd[opt1]{req1}{contents of paragraph}
12911 \begin_layout Standard
12913 \change_deleted -712698321 1353679722
12914 but one cannot have things like:
12917 \begin_layout LyX-Code
12919 \change_deleted -712698321 1353679722
12922 mycmd[opt1]{req1}[opt2]{contents of paragraph}
12925 \begin_layout Standard
12927 \change_deleted -712698321 1353679722
12928 at least, not without ERT (with which you can have anything).
12935 \begin_layout Description
12936 \begin_inset Flex Code
12939 \begin_layout Plain Layout
12946 \begin_inset Flex Code
12949 \begin_layout Plain Layout
12958 \begin_inset Flex Code
12961 \begin_layout Plain Layout
12967 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
12968 output, but only by a line break; together with
12969 \begin_inset Flex Code
12972 \begin_layout Plain Layout
12978 , this allows to emulate a plain text editor (like the ERT inset).
12981 \begin_layout Description
12982 \begin_inset Flex Code
12985 \begin_layout Plain Layout
12992 \begin_inset Flex Code
12995 \begin_layout Plain Layout
13001 ] The indent of the very first line of a paragraph.
13003 \begin_inset Flex Code
13006 \begin_layout Plain Layout
13012 will be fixed for a certain style.
13013 The exception is the default style, since the indentation for these paragraphs
13014 can be prohibited with
13015 \begin_inset Flex Code
13018 \begin_layout Plain Layout
13026 \begin_inset Flex Code
13029 \begin_layout Plain Layout
13035 style paragraphs inside environments use the
13036 \begin_inset Flex Code
13039 \begin_layout Plain Layout
13045 of the environment, not their native one.
13047 \begin_inset Flex Code
13050 \begin_layout Plain Layout
13056 paragraphs inside an enumeration are not indented.
13059 \begin_layout Description
13060 \begin_inset Flex Code
13063 \begin_layout Plain Layout
13070 \begin_inset Flex Code
13073 \begin_layout Plain Layout
13079 ] The vertical space between two paragraphs of this style.
13082 \begin_layout Description
13083 \begin_inset Flex Code
13086 \begin_layout Plain Layout
13093 \begin_inset Flex Code
13096 \begin_layout Plain Layout
13102 ] LyX allows the user to choose either
13103 \begin_inset Quotes eld
13107 \begin_inset Quotes erd
13111 \begin_inset Quotes eld
13115 \begin_inset Quotes erd
13118 to typeset a document.
13120 \begin_inset Quotes eld
13124 \begin_inset Quotes erd
13127 is chosen, this value is completely ignored.
13129 \begin_inset Quotes eld
13133 \begin_inset Quotes erd
13136 is chosen, the parindent of a LaTeXtype
13137 \begin_inset Quotes eld
13141 \begin_inset Quotes erd
13144 style is ignored and all paragraphs are separated by this parskip argument.
13145 The vertical space is calculated with
13146 \begin_inset Flex Code
13149 \begin_layout Plain Layout
13151 \begin_inset space ~
13160 \begin_inset Flex Code
13163 \begin_layout Plain Layout
13169 is the height of a row with the normal font.
13170 This way, the look stays the same with different screen fonts.
13173 \begin_layout Description
13174 \begin_inset Flex Code
13177 \begin_layout Plain Layout
13184 \begin_inset Flex Code
13187 \begin_layout Plain Layout
13196 \begin_inset Flex Code
13199 \begin_layout Plain Layout
13205 ] Whether the contents of this paragraph should be output in raw form, meaning
13206 without special translations that LaTeX would require.
13209 \begin_layout Description
13210 \begin_inset Flex Code
13213 \begin_layout Plain Layout
13219 Information to be included in the LaTeX preamble when this style is used.
13220 Used to define macros, load packages, etc., required by this particular
13223 \begin_inset Quotes eld
13227 \begin_inset Flex Code
13230 \begin_layout Plain Layout
13237 \begin_inset Quotes erd
13243 \begin_layout Description
13244 \begin_inset Flex Code
13247 \begin_layout Plain Layout
13254 \begin_inset Flex Code
13257 \begin_layout Plain Layout
13263 ] The prefix to use when creating labels referring to paragraphs of this
13265 This allows the use of formatted references.
13268 \begin_layout Description
13270 \change_deleted -712698321 1353681258
13271 \begin_inset Flex Code
13274 \begin_layout Plain Layout
13281 \begin_inset Flex Code
13284 \begin_layout Plain Layout
13290 ] The number of required arguments that the LaTeX command or environment
13291 corresponding to this style expects.
13292 In the case of a command, these are required arguments
13296 that associated with the content of the paragraph itself.
13297 These do not actually have to be provided: LyX will output empty arguments
13299 Note that optional arguments will be output before required arguments.
13300 See the discussion of the
13301 \begin_inset Flex Code
13304 \begin_layout Plain Layout
13310 tag above for more information.
13315 \begin_layout Description
13316 \begin_inset Flex Code
13319 \begin_layout Plain Layout
13326 \begin_inset Flex Code
13329 \begin_layout Plain Layout
13335 ] Whether the style requires the feature
13336 \begin_inset Flex Code
13339 \begin_layout Plain Layout
13346 See the description of
13347 \begin_inset Flex Code
13350 \begin_layout Plain Layout
13357 \begin_inset CommandInset ref
13358 LatexCommand pageref
13359 reference "des:FreeSpacing"
13363 ) for information on `features'.
13365 \change_inserted -712698321 1353693134
13369 \begin_layout Description
13371 \change_inserted -712698321 1353693371
13372 \begin_inset Flex Code
13375 \begin_layout Plain Layout
13377 \change_inserted -712698321 1353693146
13386 \begin_inset Flex Code
13389 \begin_layout Plain Layout
13391 \change_inserted -712698321 1353693235
13400 \begin_inset Flex Code
13403 \begin_layout Plain Layout
13405 \change_inserted -712698321 1353693235
13411 ] Resets the LaTeX arguments of this style (as defined via the
13412 \begin_inset Flex Code
13415 \begin_layout Plain Layout
13417 \change_inserted -712698321 1353693371
13426 This is useful if you have copied a style via
13427 \begin_inset Flex Code
13430 \begin_layout Plain Layout
13432 \change_inserted -712698321 1353693302
13440 , but you do not want to inherit its (required and optional) arguments.
13445 \begin_layout Description
13446 \begin_inset Flex Code
13449 \begin_layout Plain Layout
13456 \begin_inset Flex Code
13459 \begin_layout Plain Layout
13466 \begin_inset Flex Code
13469 \begin_layout Plain Layout
13478 \begin_layout Description
13479 \begin_inset Flex Code
13482 \begin_layout Plain Layout
13489 \begin_inset Flex Code
13492 \begin_layout Plain Layout
13497 , onehalf, double, other
13506 ] This defines what the default spacing should be in the style.
13508 \begin_inset Flex Code
13511 \begin_layout Plain Layout
13518 \begin_inset Flex Code
13521 \begin_layout Plain Layout
13528 \begin_inset Flex Code
13531 \begin_layout Plain Layout
13537 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
13538 If you specify the argument
13539 \begin_inset Flex Code
13542 \begin_layout Plain Layout
13548 , then you should also provide a numerical argument which will be the actual
13550 Note that, contrary to other parameters,
13551 \begin_inset Flex Code
13554 \begin_layout Plain Layout
13560 implies the generation of specific LaTeX code, using the package
13563 \begin_inset Flex Code
13566 \begin_layout Plain Layout
13575 \begin_layout Description
13576 \begin_inset Flex Code
13579 \begin_layout Plain Layout
13586 \begin_inset Flex Code
13589 \begin_layout Plain Layout
13596 \begin_inset Flex Code
13599 \begin_layout Plain Layout
13607 ] Spellcheck paragraphs of this style.
13611 \begin_layout Description
13612 \begin_inset Flex Code
13615 \begin_layout Plain Layout
13621 The font used for the text body .
13623 \begin_inset CommandInset ref
13625 reference "sub:Font-description"
13632 \begin_layout Description
13633 \begin_inset Flex Code
13636 \begin_layout Plain Layout
13645 \begin_inset Flex Code
13648 \begin_layout Plain Layout
13658 The level of the style in the table of contents.
13659 This is used for automatic numbering of section headings.
13662 \begin_layout Description
13663 \begin_inset Flex Code
13666 \begin_layout Plain Layout
13673 \begin_inset Flex Code
13676 \begin_layout Plain Layout
13682 ] The vertical space with which the very first of a chain of paragraphs
13683 with this style is separated from the previous paragraph.
13684 If the previous paragraph has another style, the separations are not simply
13685 added, but the maximum is taken.
13688 \begin_layout Subsection
13689 \begin_inset CommandInset label
13695 Internationalization of Paragraph Styles
13698 \begin_layout Standard
13699 LyX has long supported internationalization of layout information, but,
13700 until version 2.0, this applied only to the user interface and not to, say,
13702 Thus, French authors were forced to resort to ugly hacks if they wanted
13707 1' instead of `Theorem 1'.
13708 Thanks to Georg Baum, that is no longer the case.
13711 \begin_layout Standard
13713 \begin_inset Flex Code
13716 \begin_layout Plain Layout
13722 defines text that is to appear in the typeset document, it may use
13723 \begin_inset Flex Code
13726 \begin_layout Plain Layout
13733 \begin_inset Flex Code
13736 \begin_layout Plain Layout
13742 to support non-English and even multi-language documents correctly.
13743 The following excerpt (from the
13744 \begin_inset Flex Code
13747 \begin_layout Plain Layout
13753 file) shows how this works:
13756 \begin_layout LyX-Code
13761 \begin_layout LyX-Code
13764 theoremstyle{remark}
13767 \begin_layout LyX-Code
13770 newtheorem{claim}[thm]{
13777 \begin_layout LyX-Code
13781 \begin_layout LyX-Code
13785 \begin_layout LyX-Code
13790 claimname}{_(Claim)}
13793 \begin_layout LyX-Code
13797 \begin_layout LyX-Code
13801 \begin_layout LyX-Code
13810 claimname}{_(Claim)}}
13813 \begin_layout LyX-Code
13818 \begin_layout Standard
13819 In principle, any legal LaTeX may appear in the
13820 \begin_inset Flex Code
13823 \begin_layout Plain Layout
13830 \begin_inset Flex Code
13833 \begin_layout Plain Layout
13839 tags, but in practice they will typically look as they do here.
13840 The key to correct translation of the typeset text is the definition of
13842 \begin_inset Flex Code
13845 \begin_layout Plain Layout
13854 \begin_inset Flex Code
13857 \begin_layout Plain Layout
13869 \begin_layout Standard
13871 \begin_inset Flex Code
13874 \begin_layout Plain Layout
13880 tag provides for internationalization based upon the overall language of
13882 The contents of the tag will be included in the preamble, just as with
13884 \begin_inset Flex Code
13887 \begin_layout Plain Layout
13894 What makes it special is the use of the
13895 \begin_inset Quotes eld
13899 \begin_inset Quotes erd
13903 \begin_inset Flex Code
13906 \begin_layout Plain Layout
13912 , which will be replaced, when LyX produces LaTeX output, with the translation
13913 of its argument into the document language.
13916 \begin_layout Standard
13918 \begin_inset Flex Code
13921 \begin_layout Plain Layout
13927 tag is more complex, since it is meant to provide support for multi-language
13928 documents and so offers an interface to the
13929 \begin_inset Flex Code
13932 \begin_layout Plain Layout
13939 Its contents will be added to the preamble once for each language that
13940 appears in the document.
13941 In this case, the argument to
13942 \begin_inset Flex Code
13945 \begin_layout Plain Layout
13951 will be replaced with its translation into the language in question; the
13953 \begin_inset Flex Code
13956 \begin_layout Plain Layout
13962 is replaced by the language name (as used by the babel package).
13965 \begin_layout Standard
13966 A German document that also included a French section would thus have the
13967 following in the preamble:
13970 \begin_layout LyX-Code
13979 claimname}{Affirmation}}
13987 claimname}{Behauptung}}
13991 claimname}{Behauptung}
13994 \begin_layout Standard
13996 \begin_inset Flex Code
13999 \begin_layout Plain Layout
14005 will then conspire to produce the correct text in the output.
14008 \begin_layout Standard
14009 One important point to note here is that the translations are provided by
14010 LyX itself, through the
14011 \change_inserted -195340706 1334775793
14013 \begin_inset Flex Code
14016 \begin_layout Plain Layout
14018 \change_inserted -195340706 1334775793
14025 \change_deleted -195340706 1334775793
14026 same mechanism it uses for internationalization of the user interface
14029 This means, in effect, that
14030 \begin_inset Flex Code
14033 \begin_layout Plain Layout
14040 \begin_inset Flex Code
14043 \begin_layout Plain Layout
14049 are really only of use in layout files that are provided with LyX, since
14050 text entered in user-created layout files will not be seen by LyX's internation
14052 \change_inserted -195340706 1334775793
14054 \begin_inset Flex Code
14057 \begin_layout Plain Layout
14059 \change_inserted -195340706 1334775793
14065 file is modified accordingly
14068 That said, however, any layout created with the intention that it will
14069 be included with LyX should use these tags where appropriate.
14071 \change_inserted -195340706 1334775793
14072 Please note that the paragraph style translations provided by LyX will
14073 never change with a minor update (e.g.
14074 from version 2.1.x to 2.1.y).
14075 It is however quite likely that a major update (e.g.
14076 from 2.0.x to 2.1.y) will introduce new translations or corrections.
14081 \begin_layout Subsection
14083 \begin_inset CommandInset label
14092 \begin_layout Standard
14093 Since version 1.3.0 of LyX, it is has been both possible and necessary to
14094 define the floats (
14095 \begin_inset Flex MenuItem
14098 \begin_layout Plain Layout
14105 \begin_inset Flex MenuItem
14108 \begin_layout Plain Layout
14114 , \SpecialChar \ldots{}
14115 ) in the text class itself.
14116 Standard floats are included in the file
14117 \begin_inset Flex Code
14120 \begin_layout Plain Layout
14126 , so you may have to do no more than add
14129 \begin_layout LyX-Code
14130 Input stdfloats.inc
14133 \begin_layout Standard
14134 to your layout file.
14135 If you want to implement a text class that proposes some other float types
14136 (like the AGU class bundled with LyX), the information below will hopefully
14140 \begin_layout Description
14141 \begin_inset Flex Code
14144 \begin_layout Plain Layout
14151 \begin_inset Flex Code
14154 \begin_layout Plain Layout
14161 \begin_inset Quotes erd
14165 \begin_inset Quotes erd
14168 ] The file name extension of an auxiliary file for the list of figures (or
14170 LaTeX writes the captions to this file.
14173 \begin_layout Description
14174 \begin_inset Flex Code
14177 \begin_layout Plain Layout
14184 \begin_inset Flex Code
14187 \begin_layout Plain Layout
14194 \begin_inset Quotes erd
14198 \begin_inset Quotes erd
14201 ] The string that will be used in the menus and also for the caption.
14202 This is translated to the current language if babel is used.
14205 \begin_layout Description
14206 \begin_inset Flex Code
14209 \begin_layout Plain Layout
14215 These are used for XHTML output.
14217 \begin_inset CommandInset ref
14219 reference "sec:Tags-for-XHTML"
14226 \begin_layout Description
14227 \begin_inset Flex Code
14230 \begin_layout Plain Layout
14239 \begin_inset Flex Code
14242 \begin_layout Plain Layout
14251 \begin_inset Flex Code
14254 \begin_layout Plain Layout
14260 ] Indicates whether the float is already defined in the document class or
14261 if we instead need to load
14262 \begin_inset Flex Code
14265 \begin_layout Plain Layout
14271 and use what it provides to define it on-the-fly.
14273 \begin_inset Flex Code
14276 \begin_layout Plain Layout
14283 \begin_inset Flex Code
14286 \begin_layout Plain Layout
14293 It should be set to
14294 \begin_inset Flex Code
14297 \begin_layout Plain Layout
14303 if the float is already defined by the LaTeX document class.
14306 \begin_layout Description
14307 \begin_inset Flex Code
14310 \begin_layout Plain Layout
14317 \begin_inset Flex Code
14320 \begin_layout Plain Layout
14327 \begin_inset Quotes erd
14331 \begin_inset Quotes erd
14334 ] The command used to generate a list of floats of this type; the leading
14337 ' should be omitted.
14343 \begin_inset Flex Code
14346 \begin_layout Plain Layout
14352 is false, since there is no standard way to generate this command.
14354 \begin_inset Flex Code
14357 \begin_layout Plain Layout
14363 is true, since in that case there is a standard way to define the command.
14366 \begin_layout Description
14367 \begin_inset Flex Code
14370 \begin_layout Plain Layout
14377 \begin_inset Flex Code
14380 \begin_layout Plain Layout
14387 \begin_inset Quotes erd
14391 \begin_inset Quotes erd
14394 ] A title for a list of floats of this kind (list of figures, tables, or
14396 It is used for the screen label within LyX; it is passed to LaTeX for use
14397 as the title there; and it is used as the title in XHTML output.
14398 It will be translated to the document language.
14401 \begin_layout Description
14402 \begin_inset Flex Code
14405 \begin_layout Plain Layout
14412 \begin_inset Flex Code
14415 \begin_layout Plain Layout
14422 \begin_inset Quotes erd
14426 \begin_inset Quotes erd
14429 ] This (optional) argument determines whether floats of this class will
14430 be numbered within some sectional unit of the document.
14431 For example, if within is equal to
14432 \begin_inset Flex Code
14435 \begin_layout Plain Layout
14441 , the floats will be numbered within chapters.
14445 \begin_layout Description
14446 \begin_inset Flex Code
14449 \begin_layout Plain Layout
14456 \begin_inset Flex Code
14459 \begin_layout Plain Layout
14466 \begin_inset Quotes erd
14470 \begin_inset Quotes erd
14473 ] The default placement for the given class of floats.
14474 The string should be as in standard LaTeX:
14475 \begin_inset Flex Code
14478 \begin_layout Plain Layout
14485 \begin_inset Flex Code
14488 \begin_layout Plain Layout
14495 \begin_inset Flex Code
14498 \begin_layout Plain Layout
14505 \begin_inset Flex Code
14508 \begin_layout Plain Layout
14514 for top, bottom, page, and here, respectively.
14518 \begin_layout Plain Layout
14519 Note that the order of these letters in the string is irrelevant, like in
14525 On top of that there is a new type,
14526 \begin_inset Flex Code
14529 \begin_layout Plain Layout
14535 , which does not really correspond to a float, since it means: put it
14536 \begin_inset Quotes eld
14540 \begin_inset Quotes erd
14544 Note however that the
14545 \begin_inset Flex Code
14548 \begin_layout Plain Layout
14554 specifier is special and, because of implementation details, cannot be
14555 used in non-built in float types.
14556 If you do not understand what this means, just use
14557 \begin_inset Quotes eld
14561 \begin_inset Flex Code
14564 \begin_layout Plain Layout
14571 \begin_inset Quotes erd
14577 \begin_layout Description
14578 \begin_inset Flex Code
14581 \begin_layout Plain Layout
14588 \begin_inset Flex Code
14591 \begin_layout Plain Layout
14597 ] The prefix to use when creating labels referring to floats of this type.
14598 This allows the use of formatted references.
14599 Note that you can remove any
14600 \begin_inset Flex Code
14603 \begin_layout Plain Layout
14609 set by a copied style by using the special value
14610 \begin_inset Quotes eld
14614 \begin_inset Quotes erd
14617 , which must be all caps.
14620 \begin_layout Description
14621 \begin_inset Flex Code
14624 \begin_layout Plain Layout
14631 \begin_inset Flex Code
14634 \begin_layout Plain Layout
14641 \begin_inset Quotes erd
14645 \begin_inset Quotes erd
14648 ] The style used when defining the float using
14649 \begin_inset Flex Code
14652 \begin_layout Plain Layout
14663 \begin_layout Description
14664 \begin_inset Flex Code
14667 \begin_layout Plain Layout
14674 \begin_inset Flex Code
14677 \begin_layout Plain Layout
14684 \begin_inset Quotes erd
14688 \begin_inset Quotes erd
14692 \begin_inset Quotes eld
14696 \begin_inset Quotes erd
14699 of the new class of floats, like program or algorithm.
14700 After the appropriate
14701 \begin_inset Flex Code
14704 \begin_layout Plain Layout
14713 \begin_inset Flex Code
14716 \begin_layout Plain Layout
14725 \begin_inset Flex Code
14728 \begin_layout Plain Layout
14739 \begin_layout Description
14740 \begin_inset Flex Code
14743 \begin_layout Plain Layout
14750 \begin_inset Flex Code
14753 \begin_layout Plain Layout
14760 \begin_inset Flex Code
14763 \begin_layout Plain Layout
14771 ] Tells us whether this float is defined using the facilities provided by
14773 \begin_inset Flex Code
14776 \begin_layout Plain Layout
14782 , either by the class file or a package, or on-the-fly by LyX itself.
14785 \begin_layout Standard
14786 Note that defining a float with type
14787 \begin_inset Flex Code
14790 \begin_layout Plain Layout
14798 automatically defines the corresponding counter with name
14799 \begin_inset Flex Code
14802 \begin_layout Plain Layout
14813 \begin_layout Subsection
14814 Flex insets and InsetLayout
14815 \begin_inset CommandInset label
14817 name "sub:Flex-insets-and"
14824 \begin_layout Standard
14825 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
14826 these are called Flex insets.
14830 \begin_layout Standard
14831 Flex insets come in three different kinds:
14834 \begin_layout Itemize
14836 \begin_inset Flex Code
14839 \begin_layout Plain Layout
14845 ): These define semantic markup corresponding to such LaTeX commands as
14847 \begin_inset Flex Code
14850 \begin_layout Plain Layout
14859 \begin_inset Flex Code
14862 \begin_layout Plain Layout
14873 \begin_layout Itemize
14875 \begin_inset Flex Code
14878 \begin_layout Plain Layout
14884 ): These can be used to define custom collapsible insets, similar to TeX
14885 code, footnote, and the like.
14886 An obvious example is an endnote inset, which is defined in the
14887 \begin_inset Flex Code
14890 \begin_layout Plain Layout
14899 \begin_layout Itemize
14901 \begin_inset Flex Code
14904 \begin_layout Plain Layout
14910 ): For use with DocBook classes.
14913 \begin_layout Standard
14914 Flex insets are defined using the
14915 \begin_inset Flex Code
14918 \begin_layout Plain Layout
14924 tag, which shall be explained in a moment.
14927 \begin_layout Standard
14929 \begin_inset Flex Code
14932 \begin_layout Plain Layout
14938 tag also serves another function: It can be used to customize the general
14939 layout of many different types of insets.
14941 \begin_inset Flex Code
14944 \begin_layout Plain Layout
14950 can be used to customize the layout parameters for footnotes, marginal
14951 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
14952 boxes, tables, algorithms, URLs, and optional arguments, as well as to
14953 define Flex insets.
14956 \begin_layout Standard
14958 \begin_inset Flex Code
14961 \begin_layout Plain Layout
14967 definition must begin with a line of the form:
14970 \begin_layout LyX-Code
14974 \begin_layout Standard
14976 \begin_inset Flex Code
14979 \begin_layout Plain Layout
14985 indicates the inset whose layout is being defined, and here there are
14986 \change_inserted 5863208 1334489266
14988 \change_deleted 5863208 1334489267
14994 \begin_layout Enumerate
14995 The layout for a pre-existing inset is being modified.
14996 In this case, can be
14997 \begin_inset Flex Code
15000 \begin_layout Plain Layout
15006 any one of the following:
15007 \begin_inset Flex Code
15010 \begin_layout Plain Layout
15017 \begin_inset Flex Code
15020 \begin_layout Plain Layout
15027 \begin_inset Flex Code
15030 \begin_layout Plain Layout
15037 \begin_inset Flex Code
15040 \begin_layout Plain Layout
15047 \begin_inset Flex Code
15050 \begin_layout Plain Layout
15057 \begin_inset Flex Code
15060 \begin_layout Plain Layout
15067 \begin_inset Flex Code
15070 \begin_layout Plain Layout
15077 \begin_inset Flex Code
15080 \begin_layout Plain Layout
15087 \begin_inset Flex Code
15090 \begin_layout Plain Layout
15097 \begin_inset Flex Code
15100 \begin_layout Plain Layout
15107 \begin_inset Flex Code
15110 \begin_layout Plain Layout
15117 \begin_inset Flex Code
15120 \begin_layout Plain Layout
15127 \begin_inset Flex Code
15130 \begin_layout Plain Layout
15137 \begin_inset Flex Code
15140 \begin_layout Plain Layout
15147 \begin_inset Flex Code
15150 \begin_layout Plain Layout
15157 \begin_inset Flex Code
15160 \begin_layout Plain Layout
15167 \begin_inset Flex Code
15170 \begin_layout Plain Layout
15177 \begin_inset Flex Code
15180 \begin_layout Plain Layout
15187 \begin_inset Flex Code
15190 \begin_layout Plain Layout
15197 \begin_inset Flex Code
15200 \begin_layout Plain Layout
15209 \begin_layout Enumerate
15210 The layout for a Flex inset is being defined.
15212 \begin_inset Flex Code
15215 \begin_layout Plain Layout
15221 must be of the form
15222 \begin_inset Quotes eld
15226 \begin_inset Flex Code
15229 \begin_layout Plain Layout
15236 \begin_inset Quotes erd
15240 \begin_inset Flex Code
15243 \begin_layout Plain Layout
15249 may be be any valid identifier not used by a pre-existing Flex inset.
15250 The identifier may include spaces, but in that case the whole thing must
15251 be wrapped in quotes.
15252 Note that the definition of a flex inset
15257 \begin_inset Flex Code
15260 \begin_layout Plain Layout
15266 entry, declaring which type of inset it defines.
15267 \change_inserted 5863208 1334489312
15271 \begin_layout Enumerate
15273 \change_inserted 5863208 1334492248
15274 The layout for user specific branch is being defined.
15276 \begin_inset Flex Code
15279 \begin_layout Plain Layout
15281 \change_inserted 5863208 1334489384
15287 must be of the form
15288 \begin_inset Quotes eld
15292 \begin_inset Flex Code
15295 \begin_layout Plain Layout
15297 \change_inserted 5863208 1334489392
15304 \begin_inset Quotes erd
15308 \begin_inset Flex Code
15311 \begin_layout Plain Layout
15313 \change_inserted 5863208 1334489384
15319 may be be any valid identifier of branch defined in user's document.
15320 The identifier may include spaces, but in that case the whole thing must
15321 be wrapped in quotes.
15322 The main purpose of this feature is to allow LaTeX wrapping around specific
15323 branches as user needs.
15328 \begin_layout Standard
15330 \begin_inset Flex Code
15333 \begin_layout Plain Layout
15339 definition can contain the following entries:
15342 \begin_layout Description
15344 \change_inserted -712698321 1353681390
15345 \begin_inset Flex Code
15348 \begin_layout Plain Layout
15350 \change_inserted -712698321 1353681344
15357 \begin_inset Flex Code
15360 \begin_layout Plain Layout
15362 \change_inserted -712698321 1353681344
15368 ] Defines argument number <int> of a command\SpecialChar \slash{}
15369 environment associated with
15370 the current layout.
15371 The definition must end with
15372 \begin_inset Flex Code
15375 \begin_layout Plain Layout
15377 \change_inserted -712698321 1353681344
15385 \begin_inset space ~
15389 \begin_inset CommandInset ref
15391 reference "sub:Paragraph-Styles"
15398 \begin_layout Description
15400 \change_inserted -195340706 1333913893
15401 \begin_inset Flex Code
15404 \begin_layout Plain Layout
15410 Preamble for changing languages.
15412 \begin_inset space ~
15416 \begin_inset CommandInset ref
15418 reference "sub:I18n"
15425 \begin_layout Description
15426 \begin_inset Flex Code
15429 \begin_layout Plain Layout
15435 The color for the inset's background.
15436 The valid colors are defined in
15437 \begin_inset Flex Code
15440 \begin_layout Plain Layout
15449 \begin_layout Description
15450 \begin_inset Flex Code
15453 \begin_layout Plain Layout
15460 \begin_inset Flex Code
15463 \begin_layout Plain Layout
15472 \begin_inset Flex Code
15475 \begin_layout Plain Layout
15481 ] Whether to use the content of the inset as the label, when the inset is
15486 \begin_layout Description
15487 \begin_inset Flex Code
15490 \begin_layout Plain Layout
15497 \begin_inset Flex Code
15500 \begin_layout Plain Layout
15506 Copies all the features of an existing style into the current one.
15510 \begin_layout Description
15511 \begin_inset Flex Code
15514 \begin_layout Plain Layout
15521 \begin_inset Flex Code
15524 \begin_layout Plain Layout
15533 \begin_inset Flex Code
15536 \begin_layout Plain Layout
15542 ] Indicates whether the user may employ the Paragraph Settings dialog to
15543 customize the paragraph.
15546 \begin_layout Description
15547 \begin_inset Flex Code
15550 \begin_layout Plain Layout
15557 \begin_inset Flex Code
15560 \begin_layout Plain Layout
15567 \begin_inset Flex Code
15570 \begin_layout Plain Layout
15577 \begin_inset Flex Code
15580 \begin_layout Plain Layout
15586 , describing the rendering style used for the inset's frame and buttons.
15587 Footnotes generally use
15588 \begin_inset Flex Code
15591 \begin_layout Plain Layout
15597 , ERT insets generally
15598 \begin_inset Flex Code
15601 \begin_layout Plain Layout
15607 , and character styles
15608 \begin_inset Flex Code
15611 \begin_layout Plain Layout
15620 \begin_layout Description
15621 \begin_inset Flex Code
15624 \begin_layout Plain Layout
15631 \begin_inset Flex Code
15634 \begin_layout Plain Layout
15641 \begin_inset Flex Code
15644 \begin_layout Plain Layout
15653 \begin_inset Flex Code
15656 \begin_layout Plain Layout
15663 \begin_inset Flex Code
15666 \begin_layout Plain Layout
15673 Indicates whether the environment will stand on its own in LaTeX output
15674 or will appear inline with the surrounding text.
15675 If set to false, it is supposed that the LaTeX environment ignores white
15676 space (including one newline character) after the
15677 \begin_inset Flex Code
15680 \begin_layout Plain Layout
15693 \begin_inset Flex Code
15696 \begin_layout Plain Layout
15712 \begin_layout Description
15713 \begin_inset Flex Code
15716 \begin_layout Plain Layout
15722 Required at the end of the InsetLayout declarations.
15725 \begin_layout Description
15726 \begin_inset Flex Code
15729 \begin_layout Plain Layout
15735 The font used for both the text body
15741 \begin_inset space ~
15745 \begin_inset CommandInset ref
15747 reference "sub:Font-description"
15752 Note that defining this font automatically defines the
15753 \begin_inset Flex Code
15756 \begin_layout Plain Layout
15762 to the same value, so define this first and define
15763 \begin_inset Flex Code
15766 \begin_layout Plain Layout
15772 later if you want them to be different.
15775 \begin_layout Description
15776 \begin_inset Flex Code
15779 \begin_layout Plain Layout
15786 \begin_inset Quotes eld
15790 \begin_inset Quotes erd
15793 language, leading to Left-to-Right (latin) output, e.
15794 \begin_inset space \thinspace{}
15798 \begin_inset space \space{}
15801 in TeX code or URL.
15805 \begin_layout Description
15806 \begin_inset Flex Code
15809 \begin_layout Plain Layout
15816 \begin_inset Flex Code
15819 \begin_layout Plain Layout
15828 \begin_inset Flex Code
15831 \begin_layout Plain Layout
15837 ] Indicates whether the
15838 \begin_inset Flex Code
15841 \begin_layout Plain Layout
15847 should be used or, instead, the user can change the paragraph style used
15852 \begin_layout Description
15853 \begin_inset Flex Code
15856 \begin_layout Plain Layout
15863 \begin_inset Flex Code
15866 \begin_layout Plain Layout
15875 \begin_inset Flex Code
15878 \begin_layout Plain Layout
15884 ] Usually LyX doesn't allow you to insert more than one space between words,
15885 since a space is considered as the separation between two words, not a
15886 character or symbol of its own.
15887 This is a very fine thing but sometimes annoying, for example, when typing
15888 program code or plain LaTeX code.
15890 \begin_inset Flex Code
15893 \begin_layout Plain Layout
15900 Note that LyX will create protected blanks for the additional blanks when
15901 in another mode than LaTeX-mode.
15905 \begin_layout Description
15906 \begin_inset Flex Code
15909 \begin_layout Plain Layout
15915 These tags control XHTML output.
15917 \begin_inset CommandInset ref
15919 reference "sec:Tags-for-XHTML"
15926 \begin_layout Description
15927 \begin_inset Flex Code
15930 \begin_layout Plain Layout
15937 \begin_inset Flex Code
15940 \begin_layout Plain Layout
15949 \begin_inset Flex Code
15952 \begin_layout Plain Layout
15958 ] Whether to include the contents of this inset in the strings generated
15959 for the `Outline' pane.
15960 One would not, for example, want the content of a footnote in a section
15961 header to be included in the TOC displayed in the outline, but one would
15962 normally want the content of a character style displayed.
15963 Default is false: not to include.
15966 \begin_layout Description
15967 \begin_inset Flex Code
15970 \begin_layout Plain Layout
15977 \begin_inset Flex Code
15980 \begin_layout Plain Layout
15989 \begin_inset Flex Code
15992 \begin_layout Plain Layout
15998 ] Usually LyX does not allow you to leave a paragraph empty, since it would
15999 lead to empty LaTeX output.
16000 There are some cases where this could be desirable however: in a letter
16001 template, the required fields can be provided as empty fields, so that
16002 people do not forget them; in some special classes, a style can be used
16003 as some kind of break, which does not contain actual text.
16007 \begin_layout Description
16008 \begin_inset Flex Code
16011 \begin_layout Plain Layout
16017 The font used for the label.
16019 \begin_inset space ~
16023 \begin_inset CommandInset ref
16025 reference "sub:Font-description"
16030 Note that this definition can never appear before
16031 \begin_inset Flex Code
16034 \begin_layout Plain Layout
16040 , lest it be ineffective.
16043 \begin_layout Description
16044 \begin_inset Flex Code
16047 \begin_layout Plain Layout
16053 What will be displayed on the button or elsewhere as the inset label.
16055 \begin_inset Flex Code
16058 \begin_layout Plain Layout
16065 \begin_inset Flex Code
16068 \begin_layout Plain Layout
16074 ) modify this label on the fly.
16077 \begin_layout Description
16079 \change_inserted -195340706 1333913893
16080 \begin_inset Flex Code
16083 \begin_layout Plain Layout
16089 Language dependent preamble.
16091 \begin_inset space ~
16095 \begin_inset CommandInset ref
16097 reference "sub:I18n"
16104 \begin_layout Description
16105 \begin_inset Flex Code
16108 \begin_layout Plain Layout
16114 The name of the corresponding LaTeX stuff.
16115 Either the environment or command name.
16118 \begin_layout Description
16119 \begin_inset Flex Code
16122 \begin_layout Plain Layout
16128 The optional parameter for the corresponding
16129 \begin_inset Flex Code
16132 \begin_layout Plain Layout
16138 stuff, including possible bracket pairs like
16139 \begin_inset Flex Code
16142 \begin_layout Plain Layout
16149 This parameter cannot be changed from within LyX.
16152 \begin_layout Description
16153 \begin_inset Flex Code
16156 \begin_layout Plain Layout
16163 \begin_inset Flex Code
16166 \begin_layout Plain Layout
16171 , Command, Environment, Item_Environment,
16177 \begin_inset Flex Code
16180 \begin_layout Plain Layout
16181 List_Environment, Bib_Environment
16186 ] How the style should be translated into LaTeX.
16190 \begin_layout Plain Layout
16191 \begin_inset Flex Code
16194 \begin_layout Plain Layout
16200 is perhaps a bit misleading, since these rules apply to SGML classes, too.
16201 Visit the SGML class files for specific examples.
16210 \begin_layout Itemize
16211 \begin_inset Flex Code
16214 \begin_layout Plain Layout
16220 means nothing special.
16224 \begin_layout Itemize
16225 \begin_inset Flex Code
16228 \begin_layout Plain Layout
16235 \begin_inset Flex Code
16238 \begin_layout Plain Layout
16245 {\SpecialChar \ldots{}
16254 \begin_layout Itemize
16255 \begin_inset Flex Code
16258 \begin_layout Plain Layout
16265 \begin_inset Flex Code
16268 \begin_layout Plain Layout
16275 }\SpecialChar \ldots{}
16291 \begin_layout Itemize
16292 \begin_inset Flex Code
16295 \begin_layout Plain Layout
16302 \begin_inset Flex Code
16305 \begin_layout Plain Layout
16312 \begin_inset Flex Code
16315 \begin_layout Plain Layout
16323 is generated for each paragraph of this environment.
16327 \begin_layout Itemize
16328 \begin_inset Flex Code
16331 \begin_layout Plain Layout
16338 \begin_inset Flex Code
16341 \begin_layout Plain Layout
16348 \begin_inset Flex Code
16351 \begin_layout Plain Layout
16357 is passed as an argument to the environment.
16359 \begin_inset Flex Code
16362 \begin_layout Plain Layout
16368 can be defined in the
16369 \begin_inset Flex MenuItem
16372 \begin_layout Plain Layout
16377 \SpecialChar \menuseparator
16383 \begin_inset space ~
16395 \begin_layout Standard
16396 Putting the last few things together, the LaTeX output will be either:
16399 \begin_layout LyX-Code
16402 latexname[latexparam]{\SpecialChar \ldots{}
16406 \begin_layout Standard
16410 \begin_layout LyX-Code
16413 begin{latexname}[latexparam] \SpecialChar \ldots{}
16419 \begin_layout Standard
16420 depending upon the LaTeX type.
16424 \begin_layout Description
16425 \begin_inset Flex Code
16428 \begin_layout Plain Layout
16435 \begin_inset Flex Code
16438 \begin_layout Plain Layout
16445 \begin_inset Flex Code
16448 \begin_layout Plain Layout
16455 \begin_inset Flex Code
16458 \begin_layout Plain Layout
16465 \begin_inset Flex Code
16468 \begin_layout Plain Layout
16474 (indicating a dummy definition ending definitions of charstyles, etc).
16475 This entry is required in and is only meaningful for Flex insets.
16476 Among other things, it determines on which menu this inset will appear.
16478 \begin_inset Flex Code
16481 \begin_layout Plain Layout
16488 \begin_inset Flex Code
16491 \begin_layout Plain Layout
16498 \begin_inset Flex Code
16501 \begin_layout Plain Layout
16509 \begin_inset Flex Code
16512 \begin_layout Plain Layout
16518 can be set to true for charstyle insets, if you wish, by setting it
16523 \begin_inset Flex Code
16526 \begin_layout Plain Layout
16535 \begin_layout Description
16536 \begin_inset Flex Code
16539 \begin_layout Plain Layout
16546 \begin_inset Flex Code
16549 \begin_layout Plain Layout
16558 \begin_inset Flex Code
16561 \begin_layout Plain Layout
16567 ] Whether multiple paragraphs are permitted in this inset.
16569 \begin_inset Flex Code
16572 \begin_layout Plain Layout
16578 to the same value and
16579 \begin_inset Flex Code
16582 \begin_layout Plain Layout
16588 to the opposite value.
16589 These can be reset to other values, if they are used
16594 \begin_inset Flex Code
16597 \begin_layout Plain Layout
16607 \begin_layout Description
16608 \begin_inset Flex Code
16611 \begin_layout Plain Layout
16618 \begin_inset Flex Code
16621 \begin_layout Plain Layout
16630 \begin_inset Flex Code
16633 \begin_layout Plain Layout
16639 ] Whether fragile commands in this inset should be
16640 \begin_inset Flex Code
16643 \begin_layout Plain Layout
16656 whether the command should itself be protected.) Default is false.
16659 \begin_layout Description
16660 \begin_inset Flex Code
16663 \begin_layout Plain Layout
16670 \begin_inset Flex Code
16673 \begin_layout Plain Layout
16682 \begin_inset Flex Code
16685 \begin_layout Plain Layout
16691 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
16692 output, but only by a line break; together with
16693 \begin_inset Flex Code
16696 \begin_layout Plain Layout
16702 , this allows to emulate a plain text editor (like the ERT inset).
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 the contents of this paragraph should be output in raw form, meaning
16739 without special translations that LaTeX would require.
16742 \begin_layout Description
16743 \begin_inset Flex Code
16746 \begin_layout Plain Layout
16752 Information to be included in the LaTeX preamble when this style is used.
16753 Used to define macros, load packages, etc., required by this particular
16756 \begin_inset Quotes eld
16760 \begin_inset Flex Code
16763 \begin_layout Plain Layout
16770 \begin_inset Quotes erd
16776 \begin_layout Description
16777 \begin_inset Flex Code
16780 \begin_layout Plain Layout
16787 \begin_inset Flex Code
16790 \begin_layout Plain Layout
16796 ] The prefix to use when creating labels referring to insets of this type.
16797 This allows the use of formatted references.
16800 \begin_layout Description
16801 \begin_inset Flex Code
16804 \begin_layout Plain Layout
16811 \begin_inset Flex Code
16814 \begin_layout Plain Layout
16820 ] Whether the style requires the feature
16821 \begin_inset Flex Code
16824 \begin_layout Plain Layout
16831 See the description of
16832 \begin_inset Flex Code
16835 \begin_layout Plain Layout
16842 \begin_inset CommandInset ref
16843 LatexCommand pageref
16844 reference "des:FreeSpacing"
16848 ) for information on `features'.
16852 \begin_layout Description
16853 \begin_inset Flex Code
16856 \begin_layout Plain Layout
16863 \begin_inset Flex Code
16866 \begin_layout Plain Layout
16873 \begin_inset Flex Code
16876 \begin_layout Plain Layout
16884 ] Whether this inset should use the font of its surrounding environment
16886 Default is true: uses its own.
16889 \begin_layout Description
16890 \begin_inset Flex Code
16893 \begin_layout Plain Layout
16900 \begin_inset Flex Code
16903 \begin_layout Plain Layout
16910 \begin_inset Flex Code
16913 \begin_layout Plain Layout
16921 ] Spellcheck the contents of this inset.
16925 \begin_layout Subsection
16927 \begin_inset CommandInset label
16929 name "sub:Counters"
16936 \begin_layout Standard
16937 Since version 1.3.0 of LyX, it is both possible and necessary to define the
16939 \begin_inset Flex MenuItem
16942 \begin_layout Plain Layout
16949 \begin_inset Flex MenuItem
16952 \begin_layout Plain Layout
16958 , \SpecialChar \ldots{}
16959 ) in the text class itself.
16960 The standard counters are defined in the file
16961 \begin_inset Flex Code
16964 \begin_layout Plain Layout
16970 , so you may have to do no more than add
16973 \begin_layout LyX-Code
16974 Input stdcounters.inc
16977 \begin_layout Standard
16978 to your layout file to get them to work.
16979 But if you want to define custom counters, then you can do so.
16980 The counter declaration must begin with:
16983 \begin_layout LyX-Code
16984 Counter CounterName
16987 \begin_layout Standard
16989 \begin_inset Flex Code
16992 \begin_layout Plain Layout
16998 ' is replaced by the name of the counter.
16999 And it must end with
17000 \begin_inset Quotes eld
17004 \begin_inset Flex Code
17007 \begin_layout Plain Layout
17014 \begin_inset Quotes erd
17018 The following parameters can also be used:
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 Quotes erd
17046 \begin_inset Quotes erd
17049 ] When defined, this string defines how the counter is displayed.
17050 Setting this value sets
17051 \begin_inset Flex Code
17054 \begin_layout Plain Layout
17055 LabelStringAppendix
17061 The following special constructs can be used in the string:
17065 \begin_layout Itemize
17066 \begin_inset Flex Code
17069 \begin_layout Plain Layout
17077 will be replaced by the expansion of the
17078 \begin_inset Flex Code
17081 \begin_layout Plain Layout
17088 \begin_inset Flex Code
17091 \begin_layout Plain Layout
17092 LabelStringAppendix
17098 \begin_inset Flex Code
17101 \begin_layout Plain Layout
17111 \begin_layout Itemize
17112 counter values can be expressed using LaTeX-like macros
17113 \begin_inset Flex Code
17116 \begin_layout Plain Layout
17133 \begin_inset Flex Code
17136 \begin_layout Plain Layout
17148 \begin_layout Plain Layout
17158 Actually, the situation is a bit more complicated: any
17177 other than those described below will produce arabic numerals.
17178 It would not be surprising to see this change in the future.
17184 \begin_inset Flex Code
17187 \begin_layout Plain Layout
17193 : 1, 2, 3,\SpecialChar \ldots{}
17195 \begin_inset Flex Code
17198 \begin_layout Plain Layout
17204 for lower-case letters: a, b, c, \SpecialChar \ldots{}
17206 \begin_inset Flex Code
17209 \begin_layout Plain Layout
17215 for upper-case letters: A, B, C, \SpecialChar \ldots{}
17217 \begin_inset Flex Code
17220 \begin_layout Plain Layout
17226 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
17228 \begin_inset Flex Code
17231 \begin_layout Plain Layout
17237 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
17239 \begin_inset Flex Code
17242 \begin_layout Plain Layout
17248 for hebrew numerals.
17252 \begin_layout Standard
17253 If LabelString is not defined, a default value is constructed as follows:
17254 if the counter has a master counter
17255 \begin_inset Flex Code
17258 \begin_layout Plain Layout
17265 \begin_inset Flex Code
17268 \begin_layout Plain Layout
17275 \begin_inset Flex Code
17278 \begin_layout Plain Layout
17288 is used; otherwise the string
17289 \begin_inset Flex Code
17292 \begin_layout Plain Layout
17303 \begin_layout Description
17304 \begin_inset Flex Code
17307 \begin_layout Plain Layout
17308 LabelStringAppendix
17314 \begin_inset Flex Code
17317 \begin_layout Plain Layout
17324 \begin_inset Quotes erd
17328 \begin_inset Quotes erd
17332 \begin_inset Flex Code
17335 \begin_layout Plain Layout
17341 , but for use in the Appendix.
17344 \begin_layout Description
17345 \begin_inset Flex Code
17348 \begin_layout Plain Layout
17355 \begin_inset Flex Code
17358 \begin_layout Plain Layout
17365 \begin_inset Quotes erd
17369 \begin_inset Quotes erd
17372 ] A format for use with formatted references to this counter.
17373 For example, one might want to have references to section numbers appear
17375 \begin_inset Quotes eld
17379 \begin_inset Quotes erd
17383 The string should contain
17384 \begin_inset Quotes eld
17388 \begin_inset Quotes erd
17392 This will be replaced by the counter number itself.
17393 So, for sections, it would be: Section ##.
17396 \begin_layout Description
17397 \begin_inset Flex Code
17400 \begin_layout Plain Layout
17407 \begin_inset Flex Code
17410 \begin_layout Plain Layout
17417 \begin_inset Quotes erd
17421 \begin_inset Quotes erd
17424 ] If this is set to the name of another counter, the present counter will
17425 be reset every time the other one is increased.
17427 \begin_inset Flex Code
17430 \begin_layout Plain Layout
17437 \begin_inset Flex Code
17440 \begin_layout Plain Layout
17449 \begin_layout Subsection
17451 \begin_inset CommandInset label
17453 name "sub:Font-description"
17460 \begin_layout Standard
17461 A font description looks like this:
17464 \begin_layout LyX-Code
17474 \begin_layout LyX-Code
17478 \begin_layout LyX-Code
17482 \begin_layout Standard
17483 The following commands are available:
17486 \begin_layout Description
17487 \begin_inset Flex Code
17490 \begin_layout Plain Layout
17497 \begin_inset Flex Code
17500 \begin_layout Plain Layout
17509 \begin_inset Flex Code
17512 \begin_layout Plain Layout
17519 \begin_inset Flex Code
17522 \begin_layout Plain Layout
17529 \begin_inset Flex Code
17532 \begin_layout Plain Layout
17539 \begin_inset Flex Code
17542 \begin_layout Plain Layout
17549 \begin_inset Flex Code
17552 \begin_layout Plain Layout
17559 \begin_inset Flex Code
17562 \begin_layout Plain Layout
17569 \begin_inset Flex Code
17572 \begin_layout Plain Layout
17579 \begin_inset Flex Code
17582 \begin_layout Plain Layout
17591 \begin_layout Description
17592 \begin_inset Flex Code
17595 \begin_layout Plain Layout
17602 \begin_inset Flex Code
17605 \begin_layout Plain Layout
17614 \begin_inset Flex Code
17617 \begin_layout Plain Layout
17624 \begin_inset Flex Code
17627 \begin_layout Plain Layout
17636 \begin_layout Description
17637 \begin_inset Flex Code
17640 \begin_layout Plain Layout
17647 \begin_inset Flex Code
17650 \begin_layout Plain Layout
17656 ] Valid arguments are:
17657 \begin_inset Flex Code
17660 \begin_layout Plain Layout
17667 \begin_inset Flex Code
17670 \begin_layout Plain Layout
17677 \begin_inset Flex Code
17680 \begin_layout Plain Layout
17687 \begin_inset Flex Code
17690 \begin_layout Plain Layout
17697 \begin_inset Flex Code
17700 \begin_layout Plain Layout
17707 \begin_inset Flex Code
17710 \begin_layout Plain Layout
17717 \begin_inset Flex Code
17720 \begin_layout Plain Layout
17727 \begin_inset Flex Code
17730 \begin_layout Plain Layout
17737 \begin_inset Flex Code
17740 \begin_layout Plain Layout
17747 \begin_inset Flex Code
17750 \begin_layout Plain Layout
17757 \begin_inset Flex Code
17760 \begin_layout Plain Layout
17767 \begin_inset Flex Code
17770 \begin_layout Plain Layout
17777 Each of these turns on or off the corresponding attribute.
17779 \begin_inset Flex Code
17782 \begin_layout Plain Layout
17788 turns on emphasis, and
17789 \begin_inset Flex Code
17792 \begin_layout Plain Layout
17800 \begin_inset Newline newline
17803 If the latter seems puzzling, remember that the font settings for the present
17804 context are generally inherited from the surrounding context.
17806 \begin_inset Flex Code
17809 \begin_layout Plain Layout
17815 would turn off the emphasis that was anyway in effect, say, in a theorem
17819 \begin_layout Description
17820 \begin_inset Flex Code
17823 \begin_layout Plain Layout
17830 \begin_inset Flex Code
17833 \begin_layout Plain Layout
17842 \begin_inset Flex Code
17845 \begin_layout Plain Layout
17854 \begin_layout Description
17855 \begin_inset Flex Code
17858 \begin_layout Plain Layout
17865 \begin_inset Flex Code
17868 \begin_layout Plain Layout
17877 \begin_inset Flex Code
17880 \begin_layout Plain Layout
17887 \begin_inset Flex Code
17890 \begin_layout Plain Layout
17897 \begin_inset Flex Code
17900 \begin_layout Plain Layout
17909 \begin_layout Description
17910 \begin_inset Flex Code
17913 \begin_layout Plain Layout
17920 \begin_inset Flex Code
17923 \begin_layout Plain Layout
17930 \begin_inset Flex Code
17933 \begin_layout Plain Layout
17940 \begin_inset Flex Code
17943 \begin_layout Plain Layout
17952 \begin_inset Flex Code
17955 \begin_layout Plain Layout
17962 \begin_inset Flex Code
17965 \begin_layout Plain Layout
17972 \begin_inset Flex Code
17975 \begin_layout Plain Layout
17982 \begin_inset Flex Code
17985 \begin_layout Plain Layout
17992 \begin_inset Flex Code
17995 \begin_layout Plain Layout
18004 \begin_layout Subsection
18005 \begin_inset CommandInset label
18007 name "sub:Citation-format-description"
18011 Citation format description
18014 \begin_layout Standard
18016 \begin_inset Flex Code
18019 \begin_layout Plain Layout
18025 blocks are used to describe how bibliographic information should be displayed,
18026 both within LyX itself (in the citation dialog and in tooltips, for example)
18027 and in XHTML output.
18028 Such a block might look like this:
18031 \begin_layout LyX-Code
18035 \begin_layout LyX-Code
18039 \begin_layout LyX-Code
18043 \begin_layout LyX-Code
18047 \begin_layout Standard
18048 The individual lines define how the bibliographic information associated
18049 with an article or book, respectively, is to be displayed, and such a definitio
18050 n can be given for any `entry type' that might be present in a BibTeX file.
18051 LyX defines a default format in the source code that will be used if no
18052 specific definition has been given.
18053 LyX predefines several formats in the file
18054 \begin_inset Flex Code
18057 \begin_layout Plain Layout
18063 , which is included in most of LyX's document classes.
18066 \begin_layout Standard
18067 The definitions use a simple language that allows BibTeX keys to be replaced
18069 Keys should be enclosed in
18070 \begin_inset Flex Code
18073 \begin_layout Plain Layout
18080 \begin_inset Flex Code
18083 \begin_layout Plain Layout
18090 So a simple definition might look like this:
18093 \begin_layout LyX-Code
18095 \begin_inset Quotes eld
18099 \begin_inset Quotes erd
18105 \begin_layout Standard
18106 This would print the author, followed by a comma, followed by the title,
18107 in quotes, followed by a period.
18110 \begin_layout Standard
18111 Of course, sometimes you may want to print a key only if it exists.
18112 This can be done by using a conditional construction, such as:
18113 \begin_inset Flex Code
18116 \begin_layout Plain Layout
18118 \begin_inset space ~
18128 \begin_inset Flex Code
18131 \begin_layout Plain Layout
18137 key exists, then print
18138 \begin_inset Quotes eld
18142 \begin_inset space ~
18146 \begin_inset Quotes erd
18149 followed by the volume key.
18150 It is also possible to have an else clause in the conditional, such as:
18152 \begin_inset Flex Code
18155 \begin_layout Plain Layout
18156 {%author%[[%author%]][[%editor%, ed.]]}
18163 \begin_inset Flex Code
18166 \begin_layout Plain Layout
18172 key is printed if it exists; otherwise, the editor key is printed, followed
18174 \begin_inset Quotes eld
18178 \begin_inset space ~
18182 \begin_inset Quotes erd
18185 Note that the key is again enclosed in
18186 \begin_inset Flex Code
18189 \begin_layout Plain Layout
18195 signs; the entire conditional is enclosed in braces; and the if and else
18196 clauses are enclosed in double brackets,
18197 \begin_inset Quotes eld
18201 \begin_inset Flex Code
18204 \begin_layout Plain Layout
18211 \begin_inset Quotes eld
18215 \begin_inset Quotes eld
18219 \begin_inset Flex Code
18222 \begin_layout Plain Layout
18229 \begin_inset Quotes erd
18233 There must be no space between any of these.
18236 \begin_layout Standard
18237 There is one other piece of syntax available in definitions, which looks
18239 \begin_inset Flex Code
18242 \begin_layout Plain Layout
18249 This defines a piece of formatting information that is to be used when
18251 \begin_inset Quotes eld
18255 \begin_inset Quotes erd
18259 Obviously, we do not want to output HTML tags when writing plain text,
18260 so they should be wrapped in
18261 \begin_inset Quotes eld
18265 \begin_inset Quotes erd
18269 \begin_inset Quotes eld
18273 \begin_inset Quotes erd
18279 \begin_layout Standard
18280 Two special sorts of definitions are also possible in a
18281 \begin_inset Flex Code
18284 \begin_layout Plain Layout
18291 An example of the first would be:
18294 \begin_layout LyX-Code
18296 \begin_inset Quotes eld
18300 \begin_inset Quotes erd
18306 \begin_layout Standard
18307 This is an abbreviation, or macro, and it can be used by treating it as
18309 \begin_inset Flex Code
18312 \begin_layout Plain Layout
18320 \begin_inset Flex Code
18323 \begin_layout Plain Layout
18329 exactly as it would treat its definition.
18330 So, let us issue the obvious
18338 \begin_layout LyX-Code
18342 \begin_layout Standard
18343 or anything like it.
18344 LyX shouldn't go into an infinite loop, but it may go into a long one before
18348 \begin_layout Standard
18349 The second sort of special definition might look like this:
18352 \begin_layout LyX-Code
18356 \begin_layout Standard
18357 This defines a translatable piece of text, which allows relevant parts of
18358 the bibliography to be translated.
18359 It can be included in a definition by treating it as a key:
18360 \begin_inset Flex Code
18363 \begin_layout Plain Layout
18370 Several of these are predefined in
18371 \begin_inset Flex Code
18374 \begin_layout Plain Layout
18381 Note that these are not macros, in the sense just defined.
18382 They will not be expanded.
18385 \begin_layout Standard
18386 So here then is an example that use all these features:
18389 \begin_layout LyX-Code
18390 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
18393 \begin_layout Standard
18394 This defines a macro that prints the author, followed by a comma, if the
18396 \begin_inset Flex Code
18399 \begin_layout Plain Layout
18405 key is defined, or else prints the name of the editor, followed by the
18407 \begin_inset Flex Code
18410 \begin_layout Plain Layout
18416 or its translation (it is by default
18417 \begin_inset Quotes eld
18421 \begin_inset Quotes erd
18425 \begin_inset Flex Code
18428 \begin_layout Plain Layout
18435 Note that this is in fact defined in
18436 \begin_inset Flex Code
18439 \begin_layout Plain Layout
18445 , so you can use it in your own definitions, or re-definitions, if you load
18449 \begin_layout Section
18450 \begin_inset CommandInset label
18452 name "sec:Tags-for-XHTML"
18456 Tags for XHTML output
18459 \begin_layout Standard
18460 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
18461 by layout information.
18462 In general, LyX provides sensible defaults and, as mentioned earlier, it
18463 will even construct default CSS style rules from the other layout tags.
18464 For example, LyX will attempt to use the information provided in the
18465 \begin_inset Flex Code
18468 \begin_layout Plain Layout
18474 declaration for the Chapter style to write CSS that will appropriately
18475 format chapter headings.
18478 \begin_layout Standard
18479 In many cases, then, you may not have to do anything at all to get acceptable
18480 XHTML output for your own environments, custom insets, and so forth.
18481 But in some cases you will, and so LyX provides a number of layout tags
18482 that can be used to customize the XHTML and CSS that are generated.
18485 \begin_layout Standard
18486 Note that there are two tags,
18487 \begin_inset Flex Code
18490 \begin_layout Plain Layout
18497 \begin_inset Flex Code
18500 \begin_layout Plain Layout
18506 that may appear outside style and inset declarations.
18508 \begin_inset CommandInset ref
18510 reference "sub:General-text-class"
18514 for details on these.
18517 \begin_layout Subsection
18518 \begin_inset CommandInset label
18520 name "sub:Paragraph-Style-XHTML"
18527 \begin_layout Standard
18528 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
18529 dealing with a normal paragraph, a command, or an environment, where this
18530 is itself determined by the contents of the corresponding
18531 \begin_inset Flex Code
18534 \begin_layout Plain Layout
18544 \begin_layout Standard
18545 For a command or normal paragraph, the output XHTML has the following form:
18548 \begin_layout LyX-Code
18550 \begin_inset Quotes erd
18554 \begin_inset Quotes erd
18560 \begin_layout LyX-Code
18562 \begin_inset Quotes erd
18566 \begin_inset Quotes erd
18572 \begin_layout LyX-Code
18573 Contents of the paragraph.
18576 \begin_layout LyX-Code
18580 \begin_layout Standard
18581 The label tags are of course omitted if the paragraph does not have a label.
18584 \begin_layout Standard
18585 For an environment that is not some sort of list, the XHTML takes this form:
18588 \begin_layout LyX-Code
18590 \begin_inset Quotes erd
18594 \begin_inset Quotes erd
18600 \begin_layout LyX-Code
18602 \begin_inset Quotes erd
18606 \begin_inset Quotes erd
18610 \begin_inset Quotes erd
18614 \begin_inset Quotes erd
18617 >Environment Label</labeltag>First paragraph.</itemtag>
18620 \begin_layout LyX-Code
18621 <itemtag>Second paragraph.</itemtag>
18624 \begin_layout LyX-Code
18628 \begin_layout Standard
18629 Note that the label is output only for the first paragraph, as it should
18630 be for a theorem, for example.
18634 \begin_layout Standard
18635 For a list, we have one of these forms:
18638 \begin_layout LyX-Code
18640 \begin_inset Quotes erd
18644 \begin_inset Quotes erd
18650 \begin_layout LyX-Code
18652 \begin_inset Quotes erd
18656 \begin_inset Quotes erd
18660 \begin_inset Quotes erd
18664 \begin_inset Quotes erd
18667 >List Label</labeltag>First item.</itemtag>
18670 \begin_layout LyX-Code
18672 \begin_inset Quotes erd
18676 \begin_inset Quotes erd
18680 \begin_inset Quotes erd
18684 \begin_inset Quotes erd
18687 >List Label</labeltag>Second item.</itemtag>
18690 \begin_layout LyX-Code
18694 \begin_layout LyX-Code
18698 \begin_layout LyX-Code
18700 \begin_inset Quotes erd
18704 \begin_inset Quotes erd
18710 \begin_layout LyX-Code
18712 \begin_inset Quotes erd
18716 \begin_inset Quotes erd
18719 >List Label</labeltag><itemtag attr=
18720 \begin_inset Quotes erd
18724 \begin_inset Quotes erd
18727 >First item.</itemtag>
18730 \begin_layout LyX-Code
18732 \begin_inset Quotes erd
18736 \begin_inset Quotes erd
18739 >List Label</labeltag><itemtag attr=
18740 \begin_inset Quotes erd
18744 \begin_inset Quotes erd
18747 >Second item.</itemtag>
18750 \begin_layout LyX-Code
18754 \begin_layout Standard
18755 Note the different orders of
18756 \begin_inset Flex Code
18759 \begin_layout Plain Layout
18766 \begin_inset Flex Code
18769 \begin_layout Plain Layout
18776 Which order we get depends upon the setting of
18777 \begin_inset Flex Code
18780 \begin_layout Plain Layout
18787 \begin_inset Flex Code
18790 \begin_layout Plain Layout
18796 is false (the default), you get the first of these, with the label within
18797 the item; if true, you get the second, with the label outside the item.
18800 \begin_layout Standard
18801 The specific tags and attributes output for each paragraph type can be controlle
18802 d by means of the layout tags we are about to describe.
18803 As mentioned earlier, however, LyX uses sensible defaults for many of these,
18804 so you often may not need to do very much to get good XHTML output.
18805 Think of the available tags as there so you can tweak things to your liking.
18808 \begin_layout Description
18809 \begin_inset Flex Code
18812 \begin_layout Plain Layout
18819 \begin_inset Flex Code
18822 \begin_layout Plain Layout
18828 ] Specifies attribute information to be output with the main tag.
18830 \begin_inset Quotes eld
18834 \begin_inset Flex Code
18837 \begin_layout Plain Layout
18844 \begin_inset Quotes erd
18848 By default, LyX will output
18849 \begin_inset Quotes eld
18853 \begin_inset Flex Code
18856 \begin_layout Plain Layout
18863 \begin_inset Quotes erd
18867 \begin_inset Flex Code
18870 \begin_layout Plain Layout
18876 is the LyX name of the layout, made lowercase, for example: chapter.
18881 contain any style information.
18883 \begin_inset Flex Code
18886 \begin_layout Plain Layout
18895 \begin_layout Description
18896 \begin_inset Flex Code
18899 \begin_layout Plain Layout
18906 \begin_inset Flex Code
18909 \begin_layout Plain Layout
18919 ] Whether to output the default CSS information LyX generates for this layout,
18920 even if additional information is explicitly provided via
18921 \begin_inset Flex Code
18924 \begin_layout Plain Layout
18932 \begin_inset Flex Code
18935 \begin_layout Plain Layout
18941 allows you to alter or augment the generated CSS, rather than to override
18944 \begin_inset Flex Code
18947 \begin_layout Plain Layout
18956 \begin_layout Description
18957 \begin_inset Flex Code
18960 \begin_layout Plain Layout
18967 \begin_inset Flex Code
18970 \begin_layout Plain Layout
18976 ] The tag to be used for individual paragraphs of environments, replacing
18978 \begin_inset Flex Code
18981 \begin_layout Plain Layout
18987 in the examples above.
18989 \begin_inset Flex Code
18992 \begin_layout Plain Layout
19001 \begin_layout Description
19002 \begin_inset Flex Code
19005 \begin_layout Plain Layout
19012 \begin_inset Flex Code
19015 \begin_layout Plain Layout
19021 ] Attributes for the item tag.
19023 \begin_inset Quotes eld
19027 \begin_inset Flex Code
19030 \begin_layout Plain Layout
19031 class=`layoutname_item'
19037 \begin_inset Quotes erd
19045 contain any style information.
19047 \begin_inset Flex Code
19050 \begin_layout Plain Layout
19059 \begin_layout Description
19060 \begin_inset Flex Code
19063 \begin_layout Plain Layout
19070 \begin_inset Flex Code
19073 \begin_layout Plain Layout
19079 ] The tag to be used for paragraph and item labels, replacing
19080 \begin_inset Flex Code
19083 \begin_layout Plain Layout
19089 in the examples above.
19091 \begin_inset Flex Code
19094 \begin_layout Plain Layout
19101 \begin_inset Flex Code
19104 \begin_layout Plain Layout
19111 \begin_inset Flex Code
19114 \begin_layout Plain Layout
19121 \begin_inset Flex Code
19124 \begin_layout Plain Layout
19125 Centered_Top_Environment
19130 , in which case it defaults to
19131 \begin_inset Flex Code
19134 \begin_layout Plain Layout
19143 \begin_layout Description
19144 \begin_inset Flex Code
19147 \begin_layout Plain Layout
19154 \begin_inset Flex Code
19157 \begin_layout Plain Layout
19163 ] Attributes for the label tag.
19165 \begin_inset Quotes eld
19169 \begin_inset Flex Code
19172 \begin_layout Plain Layout
19173 class=`layoutname_label'
19179 \begin_inset Quotes erd
19187 contain any style information.
19189 \begin_inset Flex Code
19192 \begin_layout Plain Layout
19201 \begin_layout Description
19202 \begin_inset Flex Code
19205 \begin_layout Plain Layout
19212 \begin_inset Flex Code
19215 \begin_layout Plain Layout
19225 ] Meaningful only for list-like environments, this tag controls whether
19226 the label tag is output before or inside the item tag.
19227 This is used, for example, in the description environment, where we want
19229 \begin_inset Flex Code
19232 \begin_layout Plain Layout
19233 <dt>\SpecialChar \ldots{}
19234 </dt><dd>\SpecialChar \ldots{}
19242 \begin_inset Flex Code
19245 \begin_layout Plain Layout
19251 : The label tag is output inside the item tag.
19254 \begin_layout Description
19255 \begin_inset Flex Code
19258 \begin_layout Plain Layout
19264 Information to be output in the
19265 \begin_inset Flex Code
19268 \begin_layout Plain Layout
19274 section when this style is used.
19275 This might, for example, be used to include a
19276 \begin_inset Flex Code
19279 \begin_layout Plain Layout
19286 \begin_inset Flex Code
19289 \begin_layout Plain Layout
19298 \begin_layout Description
19299 \begin_inset Flex Code
19302 \begin_layout Plain Layout
19308 CSS style information to be included when this style is used.
19309 Note that this will automatically be wrapped in a layout-generated
19310 \begin_inset Flex Code
19313 \begin_layout Plain Layout
19319 block, so only the CSS itself need be included.
19322 \begin_layout Description
19323 \begin_inset Flex Code
19326 \begin_layout Plain Layout
19333 \begin_inset Flex Code
19336 \begin_layout Plain Layout
19342 ] The tag to be used for the main label, replacing
19343 \begin_inset Flex Code
19346 \begin_layout Plain Layout
19352 in the examples above.
19354 \begin_inset Flex Code
19357 \begin_layout Plain Layout
19366 \begin_layout Description
19367 \begin_inset Flex Code
19370 \begin_layout Plain Layout
19377 \begin_inset Flex Code
19380 \begin_layout Plain Layout
19390 ] Marks this style as the one to be used to generate the
19391 \begin_inset Flex Code
19394 \begin_layout Plain Layout
19400 tag for the XHTML file.
19401 By default, it is false.
19403 \begin_inset Flex Code
19406 \begin_layout Plain Layout
19412 file sets it to true for the
19413 \begin_inset Flex Code
19416 \begin_layout Plain Layout
19426 \begin_layout Subsection
19430 \begin_layout Standard
19431 The XHTML output of insets can also be controlled by information in layout
19436 \begin_layout Plain Layout
19437 At present, this is true only for
19438 \begin_inset Quotes eld
19442 \begin_inset Quotes erd
19445 insets (insets you can type into) and is not true for
19446 \begin_inset Quotes eld
19450 \begin_inset Quotes erd
19453 insets (insets that are associated with dialog boxes).
19458 Here, too, LyX tries to provide sensible defaults, and it constructs default
19460 But everything can be customized.
19463 \begin_layout Standard
19464 The XHTML LyX outputs for an inset has the following form:
19467 \begin_layout LyX-Code
19469 \begin_inset Quotes erd
19473 \begin_inset Quotes erd
19479 \begin_layout LyX-Code
19480 <labeltag>Label</labeltag>
19483 \begin_layout LyX-Code
19485 \begin_inset Quotes erd
19489 \begin_inset Quotes erd
19492 >Contents of the inset.</innertag>
19495 \begin_layout LyX-Code
19499 \begin_layout Standard
19500 If the inset permits multiple paragraphs---that is, if
19501 \begin_inset Flex Code
19504 \begin_layout Plain Layout
19510 is true---then the contents of the inset will itself be output as paragraphs
19511 formatted according to the styles used for those paragraphs (standard,
19512 quote, and the like).
19513 The label tag is of course omitted if the paragraph does not have a label
19514 and, at present, is always
19515 \begin_inset Flex Code
19518 \begin_layout Plain Layout
19525 The inner tag is optional and, by default, does not appear.
19528 \begin_layout Standard
19529 The specific tags and attributes output for each inset can be controlled
19530 by means of the following layout tags.
19533 \begin_layout Description
19534 \begin_inset Flex Code
19537 \begin_layout Plain Layout
19544 \begin_inset Flex Code
19547 \begin_layout Plain Layout
19553 ] Specifies attribute information to be output with the main tag.
19555 \begin_inset Quotes eld
19559 \begin_inset Flex Code
19562 \begin_layout Plain Layout
19563 class=`myinset' onclick=`\SpecialChar \ldots{}
19570 \begin_inset Quotes erd
19574 By default, LyX will output
19575 \begin_inset Quotes eld
19579 \begin_inset Flex Code
19582 \begin_layout Plain Layout
19589 \begin_inset Quotes erd
19593 \begin_inset Flex Code
19596 \begin_layout Plain Layout
19602 is the LyX name of the inset, made lowercase and with non-alphanumeric
19603 characters converted to underscores, for example: footnote.
19606 \begin_layout Description
19607 \begin_inset Flex Code
19610 \begin_layout Plain Layout
19617 \begin_inset Flex Code
19620 \begin_layout Plain Layout
19630 ] Whether to output the default CSS information LyX generates for this layout,
19631 even if additional information is explicitly provided via
19632 \begin_inset Flex Code
19635 \begin_layout Plain Layout
19643 \begin_inset Flex Code
19646 \begin_layout Plain Layout
19652 allows you to alter or augment the generated CSS, rather than to override
19657 \begin_layout Description
19658 \begin_inset Flex Code
19661 \begin_layout Plain Layout
19668 \begin_inset Flex Code
19671 \begin_layout Plain Layout
19677 ] Attributes for the inner tag.
19679 \begin_inset Quotes eld
19683 \begin_inset Flex Code
19686 \begin_layout Plain Layout
19687 class=`insetname_inner'
19693 \begin_inset Quotes erd
19699 \begin_layout Description
19700 \begin_inset Flex Code
19703 \begin_layout Plain Layout
19710 \begin_inset Flex Code
19713 \begin_layout Plain Layout
19719 ] The inner tag, replacing
19720 \begin_inset Flex Code
19723 \begin_layout Plain Layout
19729 in the examples above.
19730 By default, there is none.
19733 \begin_layout Description
19734 \begin_inset Flex Code
19737 \begin_layout Plain Layout
19744 \begin_inset Flex Code
19747 \begin_layout Plain Layout
19755 ] Whether this inset represents a standalone block of text (such as a footnote)
19756 or instead represents material that is included in the surrounding text
19757 (such as a branch).
19761 \begin_layout Description
19762 \begin_inset Flex Code
19765 \begin_layout Plain Layout
19772 \begin_inset Flex Code
19775 \begin_layout Plain Layout
19781 ] A label for this inset, possibly including a reference to a counter.
19782 For example, for footnote, it might be:
19783 \begin_inset Flex Code
19786 \begin_layout Plain Layout
19795 This is optional, and there is no default.
19798 \begin_layout Description
19799 \begin_inset Flex Code
19802 \begin_layout Plain Layout
19808 Information to be output in the
19809 \begin_inset Flex Code
19812 \begin_layout Plain Layout
19818 section when this style is used.
19819 This might, for example, be used to include a
19820 \begin_inset Flex Code
19823 \begin_layout Plain Layout
19830 \begin_inset Flex Code
19833 \begin_layout Plain Layout
19842 \begin_layout Description
19843 \begin_inset Flex Code
19846 \begin_layout Plain Layout
19852 CSS style information to be included when this style is used.
19853 Note that this will automatically be wrapped in a layout-generated
19854 \begin_inset Flex Code
19857 \begin_layout Plain Layout
19863 block, so only the CSS itself need be included.
19866 \begin_layout Description
19867 \begin_inset Flex Code
19870 \begin_layout Plain Layout
19877 \begin_inset Flex Code
19880 \begin_layout Plain Layout
19886 ] The tag to be used for the main label, replacing
19887 \begin_inset Flex Code
19890 \begin_layout Plain Layout
19896 in the examples above.
19897 The default depends upon the setting of
19898 \begin_inset Flex Code
19901 \begin_layout Plain Layout
19908 \begin_inset Flex Code
19911 \begin_layout Plain Layout
19917 is true, the default is
19918 \begin_inset Flex Code
19921 \begin_layout Plain Layout
19927 ; if it is false, the default is
19928 \begin_inset Flex Code
19931 \begin_layout Plain Layout
19940 \begin_layout Subsection
19944 \begin_layout Standard
19945 The XHTML output for floats too can be controlled by layout information.
19946 The output has the following form:
19949 \begin_layout LyX-Code
19951 \begin_inset Quotes erd
19955 \begin_inset Quotes erd
19961 \begin_layout LyX-Code
19962 Contents of the float.
19965 \begin_layout LyX-Code
19969 \begin_layout Standard
19970 The caption, if there is one, is a separate inset and will be output as
19972 Its appearance can be controlled via the InsetLayout for caption insets.
19976 \begin_layout Description
19977 \begin_inset Flex Code
19980 \begin_layout Plain Layout
19987 \begin_inset Flex Code
19990 \begin_layout Plain Layout
19996 ] Specifies attribute information to be output with the main tag.
19998 \begin_inset Quotes eld
20002 \begin_inset Flex Code
20005 \begin_layout Plain Layout
20006 class=`myfloat' onclick=`\SpecialChar \ldots{}
20013 \begin_inset Quotes erd
20017 By default, LyX will output
20018 \begin_inset Quotes eld
20022 \begin_inset Flex Code
20025 \begin_layout Plain Layout
20026 class=`float float-floattype'
20032 \begin_inset Quotes erd
20036 \begin_inset Flex Code
20039 \begin_layout Plain Layout
20045 is LyX's name for this type of float, as determined by the float declaration
20047 \begin_inset CommandInset ref
20049 reference "sub:Floats"
20053 ), though made lowercase and with non-alphanumeric characters converted
20054 to underscores, for example: float-table.
20057 \begin_layout Description
20058 \begin_inset Flex Code
20061 \begin_layout Plain Layout
20067 CSS style information to be included when this float is used.
20068 Note that this will automatically be wrapped in a layout-generated
20069 \begin_inset Flex Code
20072 \begin_layout Plain Layout
20078 block, so only the CSS itself need be included.
20081 \begin_layout Description
20082 \begin_inset Flex Code
20085 \begin_layout Plain Layout
20092 \begin_inset Flex Code
20095 \begin_layout Plain Layout
20101 ] The tag to be used for this float, replacing
20102 \begin_inset Quotes eld
20106 \begin_inset Flex Code
20109 \begin_layout Plain Layout
20116 \begin_inset Quotes erd
20119 in the example above.
20121 \begin_inset Flex Code
20124 \begin_layout Plain Layout
20130 and will rarely need changing.
20133 \begin_layout Subsection
20134 Bibliography formatting
20137 \begin_layout Standard
20138 The bibliography can be formatted using
20139 \begin_inset Flex Code
20142 \begin_layout Plain Layout
20150 \begin_inset CommandInset ref
20152 reference "sub:Citation-format-description"
20159 \begin_layout Subsection
20163 \begin_layout Standard
20164 We have several times mentioned that LyX will generate default CSS style
20165 rules for both insets and paragraph styles, based upon the other layout
20166 information that is provided.
20167 In this section, we shall say a word about which layout information LyX
20171 \begin_layout Standard
20172 At present, LyX auto-generates CSS only for font information, making use
20174 \begin_inset Flex Code
20177 \begin_layout Plain Layout
20184 \begin_inset Flex Code
20187 \begin_layout Plain Layout
20194 \begin_inset Flex Code
20197 \begin_layout Plain Layout
20204 \begin_inset Flex Code
20207 \begin_layout Plain Layout
20214 \begin_inset Flex Code
20217 \begin_layout Plain Layout
20225 \begin_inset CommandInset ref
20227 reference "sub:Font-description"
20231 .) The translation is mostly straightforward and obvious.
20233 \begin_inset Quotes eld
20237 \begin_inset Flex Code
20240 \begin_layout Plain Layout
20247 \begin_inset Quotes erd
20251 \begin_inset Quotes eld
20255 \begin_inset Flex Code
20258 \begin_layout Plain Layout
20259 font-family: sans-serif;
20265 \begin_inset Quotes erd
20269 The correspondence of LyX sizes and CSS sizes is a little less obvious
20270 but nonetheless intuitive.
20272 \begin_inset Flex Code
20275 \begin_layout Plain Layout
20282 \begin_inset Flex URL
20285 \begin_layout Plain Layout
20295 \begin_layout Chapter
20296 Including External Material
20299 \begin_layout Standard
20300 \begin_inset Box Shadowbox
20310 height_special "totalheight"
20313 \begin_layout Plain Layout
20314 WARNING: This portion of the documentation has not been updated for some
20316 We certainly hope that it is still accurate, but there are no guarantees.
20324 \begin_layout Standard
20325 The use of material from sources external to LyX is covered in detail in
20331 This part of the manual covers what needs to happen behind the scenes for
20332 new sorts of material to be included.
20335 \begin_layout Section
20339 \begin_layout Standard
20340 The external material feature is based on the concept of a
20345 A template is a specification of how LyX should interface with a certain
20347 As bundled, LyX comes with predefined templates for Xfig figures, various
20348 raster format images, chess diagrams, and LilyPond music notation.
20349 You can check the actual list by using the menu
20350 \begin_inset Flex MenuItem
20353 \begin_layout Plain Layout
20354 Insert\SpecialChar \menuseparator
20355 File\SpecialChar \menuseparator
20362 Furthermore, it is possible to roll your own template to support a specific
20364 Later we'll describe in more detail what is involved, and hopefully you
20365 will submit all the templates you create so we can include them in a later
20369 \begin_layout Standard
20370 Another basic idea of the external material feature is to distinguish between
20371 the original file that serves as a base for final material and the produced
20372 file that is included in your exported or printed document.
20373 For example, consider the case of a figure produced with
20374 \begin_inset Flex Code
20377 \begin_layout Plain Layout
20384 The Xfig application itself works on an original file with the
20385 \begin_inset Flex Code
20388 \begin_layout Plain Layout
20395 Within Xfig, you create and change your figure, and when you are done,
20397 \begin_inset Flex Code
20400 \begin_layout Plain Layout
20407 When you want to include the figure in your document, you invoke
20408 \begin_inset Flex Code
20411 \begin_layout Plain Layout
20417 in order to create a PostScript file that can readily be included in your
20420 \begin_inset Flex Code
20423 \begin_layout Plain Layout
20429 file is the original file, and the PostScript file is the produced file.
20432 \begin_layout Standard
20433 This distinction is important in order to allow updating of the material
20434 while you are in the process of writing the document.
20435 Furthermore, it provides us with the flexibility that is needed to support
20436 multiple export formats.
20437 For instance, in the case of a plain text file, it is not exactly an award-winn
20438 ing idea to include the figure as raw PostScript.
20439 Instead, you would either prefer to just include a reference to the figure
20440 or try to invoke some graphics to ASCII converter to make the final result
20441 look similar to the real graphics.
20442 The external material management allows you to do this, because it is parametri
20443 zed on the different export formats that LyX supports.
20446 \begin_layout Standard
20447 Besides supporting the production of different products according to the
20448 exported format, it supports tight integration with editing and viewing
20450 In the case of an Xfig figure, you are able to invoke Xfig on the original
20451 file with a single click from within the external material dialog in LyX,
20452 and also preview the produced PostScript file with Ghostview with another
20454 No more fiddling around with the command line and/or file browsers to locate
20455 and manipulate the original or produced files.
20456 In this way, you are finally able to take full advantage of the many different
20457 applications that are relevant to use when you write your documents, and
20458 ultimately be more productive.
20461 \begin_layout Section
20462 The external template configuration file
20465 \begin_layout Standard
20466 It is relatively easy to add custom external template definitions to LyX.
20467 However, be aware that doing this in an careless manner most probably
20471 introduce an easily exploitable security hole.
20472 So before you do this, please read the discussion about security in section
20474 \begin_inset CommandInset ref
20476 reference "sec:Security-discussion"
20483 \begin_layout Standard
20484 Having said that, we encourage you to submit any interesting templates that
20489 \begin_layout Standard
20490 The external templates are defined in the
20491 \begin_inset Flex Code
20494 \begin_layout Plain Layout
20495 LyXDir/lib/external_templates
20501 You can place your own version in
20502 \begin_inset Flex Code
20505 \begin_layout Plain Layout
20506 UserDir/external_templates
20514 \begin_layout Standard
20515 A typical template looks like this:
20518 \begin_layout LyX-Code
20522 \begin_layout LyX-Code
20523 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
20526 \begin_layout LyX-Code
20530 \begin_layout LyX-Code
20534 \begin_layout LyX-Code
20538 \begin_layout LyX-Code
20542 \begin_layout LyX-Code
20546 \begin_layout LyX-Code
20547 AutomaticProduction true
20550 \begin_layout LyX-Code
20554 \begin_layout LyX-Code
20558 \begin_layout LyX-Code
20562 \begin_layout LyX-Code
20563 TransformCommand Rotate RotationLatexCommand
20566 \begin_layout LyX-Code
20567 TransformCommand Resize ResizeLatexCommand
20570 \begin_layout LyX-Code
20571 Product "$$RotateFront$$ResizeFront
20574 \begin_layout LyX-Code
20579 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
20582 \begin_layout LyX-Code
20583 $$ResizeBack$$RotateBack"
20586 \begin_layout LyX-Code
20590 \begin_layout LyX-Code
20591 UpdateResult "$$AbsPath$$Basename.pstex_t"
20594 \begin_layout LyX-Code
20595 Requirement "graphicx"
20598 \begin_layout LyX-Code
20599 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20602 \begin_layout LyX-Code
20603 ReferencedFile latex "$$AbsPath$$Basename.eps"
20606 \begin_layout LyX-Code
20607 ReferencedFile dvi "$$AbsPath$$Basename.eps"
20610 \begin_layout LyX-Code
20614 \begin_layout LyX-Code
20618 \begin_layout LyX-Code
20619 TransformCommand Rotate RotationLatexCommand
20622 \begin_layout LyX-Code
20623 TransformCommand Resize ResizeLatexCommand
20626 \begin_layout LyX-Code
20627 Product "$$RotateFront$$ResizeFront
20630 \begin_layout LyX-Code
20635 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
20638 \begin_layout LyX-Code
20639 $$ResizeBack$$RotateBack"
20642 \begin_layout LyX-Code
20643 UpdateFormat pdftex
20646 \begin_layout LyX-Code
20647 UpdateResult "$$AbsPath$$Basename.pdftex_t"
20650 \begin_layout LyX-Code
20651 Requirement "graphicx"
20654 \begin_layout LyX-Code
20655 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
20658 \begin_layout LyX-Code
20659 ReferencedFile latex "$$AbsPath$$Basename.pdf"
20662 \begin_layout LyX-Code
20666 \begin_layout LyX-Code
20670 \begin_layout LyX-Code
20671 Product "$$Contents(
20673 "$$AbsPath$$Basename.asc
20678 \begin_layout LyX-Code
20679 UpdateFormat asciixfig
20682 \begin_layout LyX-Code
20683 UpdateResult "$$AbsPath$$Basename.asc"
20686 \begin_layout LyX-Code
20690 \begin_layout LyX-Code
20694 \begin_layout LyX-Code
20695 Product "<graphic fileref=
20697 "$$AbsOrRelPathMaster$$Basename.eps
20702 \begin_layout LyX-Code
20706 \begin_layout LyX-Code
20710 \begin_layout LyX-Code
20711 UpdateResult "$$AbsPath$$Basename.eps"
20714 \begin_layout LyX-Code
20715 ReferencedFile docbook "$$AbsPath$$Basename.eps"
20718 \begin_layout LyX-Code
20719 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
20722 \begin_layout LyX-Code
20726 \begin_layout LyX-Code
20727 Product "[XFig: $$FName]"
20730 \begin_layout LyX-Code
20734 \begin_layout LyX-Code
20738 \begin_layout Standard
20739 As you can see, the template is enclosed in
20740 \begin_inset Flex Code
20743 \begin_layout Plain Layout
20749 \SpecialChar \ldots{}
20751 \begin_inset Flex Code
20754 \begin_layout Plain Layout
20761 It contains a header specifying some general settings and, for each supported
20762 primary document file format, a section
20763 \begin_inset Flex Code
20766 \begin_layout Plain Layout
20772 \SpecialChar \ldots{}
20774 \begin_inset Flex Code
20777 \begin_layout Plain Layout
20786 \begin_layout Subsection
20787 The template header
20790 \begin_layout Description
20791 \begin_inset Flex Code
20794 \begin_layout Plain Layout
20795 AutomaticProduction
20796 \begin_inset space ~
20804 Whether the file represented by the template must be generated by LyX.
20805 This command must occur exactly once.
20808 \begin_layout Description
20809 \begin_inset Flex Code
20812 \begin_layout Plain Layout
20814 \begin_inset space ~
20822 A glob pattern that is used in the file dialog to filter out the desired
20824 If there is more than one possible file extension (e.
20825 \begin_inset space \thinspace{}
20829 \begin_inset space \space{}
20833 \begin_inset Flex Code
20836 \begin_layout Plain Layout
20843 \begin_inset Flex Code
20846 \begin_layout Plain Layout
20852 ), use something like
20853 \begin_inset Flex Code
20856 \begin_layout Plain Layout
20863 This command must occur exactly once.
20866 \begin_layout Description
20867 \begin_inset Flex Code
20870 \begin_layout Plain Layout
20872 \begin_inset space ~
20880 The text that is displayed on the button.
20881 This command must occur exactly once.
20884 \begin_layout Description
20885 \begin_inset Flex Code
20888 \begin_layout Plain Layout
20890 \begin_inset space ~
20894 \begin_inset space ~
20902 The help text that is used in the External dialog.
20903 Provide enough information to explain to the user just what the template
20904 can provide him with.
20905 This command must occur exactly once.
20908 \begin_layout Description
20909 \begin_inset Flex Code
20912 \begin_layout Plain Layout
20914 \begin_inset space ~
20922 The file format of the original file.
20923 This must be the name of a format that is known to LyX (see section
20924 \begin_inset space ~
20928 \begin_inset CommandInset ref
20930 reference "sec:Formats"
20936 \begin_inset Quotes eld
20940 \begin_inset Flex Code
20943 \begin_layout Plain Layout
20950 \begin_inset Quotes erd
20953 if the template can handle original files of more than one format.
20954 LyX will attempt to interrogate the file itself in order to deduce its
20955 format in this case.
20956 This command must occur exactly once.
20959 \begin_layout Description
20960 \begin_inset Flex Code
20963 \begin_layout Plain Layout
20965 \begin_inset space ~
20973 A unique name for the template.
20974 It must not contain substitution macros (see below).
20977 \begin_layout Description
20978 \begin_inset Flex Code
20981 \begin_layout Plain Layout
20983 \begin_inset space ~
20986 Rotate|Resize|Clip|Extra
20991 This command specifies which transformations are supported by this template.
20992 It may occur zero or more times.
20993 This command enables the corresponding tabs in the external dialog.
20995 \begin_inset Flex Code
20998 \begin_layout Plain Layout
21004 command must have either a corresponding
21005 \begin_inset Flex Code
21008 \begin_layout Plain Layout
21015 \begin_inset Flex Code
21018 \begin_layout Plain Layout
21025 \begin_inset Flex Code
21028 \begin_layout Plain Layout
21035 Otherwise the transformation will not be supported by that format.
21038 \begin_layout Subsection
21042 \begin_layout Description
21043 \begin_inset Flex Code
21046 \begin_layout Plain Layout
21048 \begin_inset space ~
21051 LaTeX|PDFLaTeX|PlainText|DocBook
21056 The primary document file format that this format definition is for.
21057 Not every template has a sensible representation in all document file formats.
21058 Please define nevertheless a
21059 \begin_inset Flex Code
21062 \begin_layout Plain Layout
21068 section for all templates.
21069 Use a dummy text when no representation is available.
21070 Then you can at least see a reference to the external material in the exported
21074 \begin_layout Description
21075 \begin_inset Flex Code
21078 \begin_layout Plain Layout
21080 \begin_inset space ~
21084 \begin_inset space ~
21092 This command defines an additional macro
21093 \begin_inset Flex Code
21096 \begin_layout Plain Layout
21102 for substitution in
21103 \begin_inset Flex Code
21106 \begin_layout Plain Layout
21114 \begin_inset Flex Code
21117 \begin_layout Plain Layout
21123 itself may contain substitution macros.
21124 The advantage over using
21125 \begin_inset Flex Code
21128 \begin_layout Plain Layout
21135 \begin_inset Flex Code
21138 \begin_layout Plain Layout
21144 is that the substituted value of
21145 \begin_inset Flex Code
21148 \begin_layout Plain Layout
21154 is sanitized so that it is a valid optional argument in the document format.
21155 This command may occur zero or more times.
21158 \begin_layout Description
21159 \begin_inset Flex Code
21162 \begin_layout Plain Layout
21164 \begin_inset space ~
21172 The text that is inserted in the exported document.
21173 This is actually the most important command and can be quite complex.
21174 This command must occur exactly once.
21177 \begin_layout Description
21178 \begin_inset Flex Code
21181 \begin_layout Plain Layout
21183 \begin_inset space ~
21191 This command specifies a preamble snippet that will be included in the
21193 It has to be defined using
21194 \begin_inset Flex Code
21197 \begin_layout Plain Layout
21203 \SpecialChar \ldots{}
21205 \begin_inset Flex Code
21208 \begin_layout Plain Layout
21215 This command may occur zero or more times.
21218 \begin_layout Description
21219 \begin_inset Flex Code
21222 \begin_layout Plain Layout
21224 \begin_inset space ~
21228 \begin_inset space ~
21236 This command denotes files that are created by the conversion process and
21237 are needed for a particular export format.
21238 If the filename is relative, it is interpreted relative to the master document.
21239 This command may be given zero or more times.
21242 \begin_layout Description
21243 \begin_inset Flex Code
21246 \begin_layout Plain Layout
21248 \begin_inset space ~
21256 The name of a required LaTeX package.
21257 The package is included via
21258 \begin_inset Flex Code
21261 \begin_layout Plain Layout
21269 in the LaTeX preamble.
21270 This command may occur zero or more times.
21273 \begin_layout Description
21274 \begin_inset Flex Code
21277 \begin_layout Plain Layout
21279 \begin_inset space ~
21283 \begin_inset space ~
21286 RotationLatexCommand
21291 This command specifies that the built in LaTeX command should be used for
21293 This command may occur once or not at all.
21296 \begin_layout Description
21297 \begin_inset Flex Code
21300 \begin_layout Plain Layout
21302 \begin_inset space ~
21306 \begin_inset space ~
21314 This command specifies that the built in LaTeX command should be used for
21316 This command may occur once or not at all.
21319 \begin_layout Description
21320 \begin_inset Flex Code
21323 \begin_layout Plain Layout
21325 \begin_inset space ~
21329 \begin_inset space ~
21332 RotationLatexOption
21337 This command specifies that rotation is done via an optional argument.
21338 This command may occur once or not at all.
21341 \begin_layout Description
21342 \begin_inset Flex Code
21345 \begin_layout Plain Layout
21347 \begin_inset space ~
21351 \begin_inset space ~
21359 This command specifies that resizing is done via an optional argument.
21360 This command may occur once or not at all.
21363 \begin_layout Description
21364 \begin_inset Flex Code
21367 \begin_layout Plain Layout
21369 \begin_inset space ~
21373 \begin_inset space ~
21381 This command specifies that clipping is done via an optional argument.
21382 This command may occur once or not at all.
21385 \begin_layout Description
21386 \begin_inset Flex Code
21389 \begin_layout Plain Layout
21391 \begin_inset space ~
21395 \begin_inset space ~
21403 This command specifies that an extra optional argument is used.
21404 This command may occur once or not at all.
21407 \begin_layout Description
21408 \begin_inset Flex Code
21411 \begin_layout Plain Layout
21413 \begin_inset space ~
21421 The file format of the converted file.
21422 This must be the name of a format that is known to LyX (see the
21423 \begin_inset Flex MenuItem
21426 \begin_layout Plain Layout
21431 ools\SpecialChar \menuseparator
21436 references\SpecialChar \menuseparator
21437 File Handling\SpecialChar \menuseparator
21444 This command must occur exactly once.
21447 \begin_layout Description
21448 \begin_inset Flex Code
21451 \begin_layout Plain Layout
21453 \begin_inset space ~
21461 The file name of the converted file.
21462 The file name must be absolute.
21463 This command must occur exactly once.
21466 \begin_layout Subsection
21467 Preamble definitions
21470 \begin_layout Standard
21471 The external template configuration file may contain additional preamble
21472 definitions enclosed by
21473 \begin_inset Flex Code
21476 \begin_layout Plain Layout
21482 \SpecialChar \ldots{}
21484 \begin_inset Flex Code
21487 \begin_layout Plain Layout
21494 They can be used by the templates in the
21495 \begin_inset Flex Code
21498 \begin_layout Plain Layout
21507 \begin_layout Section
21508 The substitution mechanism
21511 \begin_layout Standard
21512 When the external material facility invokes an external program, it is done
21513 on the basis of a command defined in the template configuration file.
21514 These commands can contain various macros that are expanded before execution.
21515 Execution always take place in the directory of the containing document.
21518 \begin_layout Standard
21519 Also, whenever external material is to be displayed, the name will be produced
21520 by the substitution mechanism, and most other commands in the template
21521 definition support substitution as well.
21524 \begin_layout Standard
21525 The available macros are the following:
21528 \begin_layout Description
21529 \begin_inset Flex Code
21532 \begin_layout Plain Layout
21533 $$AbsOrRelPathMaster
21538 The file path, absolute or relative to the master LyX document.
21541 \begin_layout Description
21542 \begin_inset Flex Code
21545 \begin_layout Plain Layout
21546 $$AbsOrRelPathParent
21551 The file path, absolute or relative to the LyX document.
21554 \begin_layout Description
21555 \begin_inset Flex Code
21558 \begin_layout Plain Layout
21564 The absolute file path.
21567 \begin_layout Description
21568 \begin_inset Flex Code
21571 \begin_layout Plain Layout
21577 The filename without path and without the extension.
21580 \begin_layout Description
21581 \begin_inset Flex Code
21584 \begin_layout Plain Layout
21586 \begin_inset Quotes eld
21590 \begin_inset Quotes erd
21598 This macro will expand to the contents of the file with the name
21599 \begin_inset Flex Code
21602 \begin_layout Plain Layout
21611 \begin_layout Description
21612 \begin_inset Flex Code
21615 \begin_layout Plain Layout
21621 The file extension (including the dot).
21624 \begin_layout Description
21625 \begin_inset Flex Code
21628 \begin_layout Plain Layout
21634 The filename of the file specified in the external material dialog.
21635 This is either an absolute name, or it is relative to the LyX document.
21638 \begin_layout Description
21639 \begin_inset Flex Code
21642 \begin_layout Plain Layout
21649 \begin_inset Flex Code
21652 \begin_layout Plain Layout
21658 (absolute name or relative to the LyX document).
21661 \begin_layout Description
21662 \begin_inset Flex Code
21665 \begin_layout Plain Layout
21671 The file path, relative to the master LyX document.
21674 \begin_layout Description
21675 \begin_inset Flex Code
21678 \begin_layout Plain Layout
21684 The file path, relative to the LyX document.
21687 \begin_layout Description
21688 \begin_inset Flex Code
21691 \begin_layout Plain Layout
21697 This macro will expand to the absolute path of the system directory.
21698 This is typically used to point to the various helper scripts that are
21702 \begin_layout Description
21703 \begin_inset Flex Code
21706 \begin_layout Plain Layout
21712 A name and full path to a temporary file which will be automatically deleted
21713 whenever the containing document is closed, or the external material insertion
21717 \begin_layout Standard
21718 All path macros contain a trailing directory separator, so you can construct
21720 \begin_inset space \thinspace{}
21724 \begin_inset space \space{}
21727 the absolute filename with
21728 \begin_inset Flex Code
21731 \begin_layout Plain Layout
21732 $$AbsPath$$Basename$$Extension
21740 \begin_layout Standard
21741 The macros above are substituted in all commands unless otherwise noted.
21743 \begin_inset Flex Code
21746 \begin_layout Plain Layout
21752 supports additionally the following substitutions if they are enabled by
21754 \begin_inset Flex Code
21757 \begin_layout Plain Layout
21764 \begin_inset Flex Code
21767 \begin_layout Plain Layout
21776 \begin_layout Description
21777 \begin_inset Flex Code
21780 \begin_layout Plain Layout
21786 The front part of the resize command.
21789 \begin_layout Description
21790 \begin_inset Flex Code
21793 \begin_layout Plain Layout
21799 The back part of the resize command.
21802 \begin_layout Description
21803 \begin_inset Flex Code
21806 \begin_layout Plain Layout
21812 The front part of the rotation command.
21815 \begin_layout Description
21816 \begin_inset Flex Code
21819 \begin_layout Plain Layout
21825 The back part of the rotation command.
21828 \begin_layout Standard
21829 The value string of the
21830 \begin_inset Flex Code
21833 \begin_layout Plain Layout
21839 command supports additionally the following substitutions if they are enabled
21841 \begin_inset Flex Code
21844 \begin_layout Plain Layout
21851 \begin_inset Flex Code
21854 \begin_layout Plain Layout
21863 \begin_layout Description
21864 \begin_inset Flex Code
21867 \begin_layout Plain Layout
21876 \begin_layout Description
21877 \begin_inset Flex Code
21880 \begin_layout Plain Layout
21889 \begin_layout Description
21890 \begin_inset Flex Code
21893 \begin_layout Plain Layout
21902 \begin_layout Description
21903 \begin_inset Flex Code
21906 \begin_layout Plain Layout
21912 The rotation option.
21915 \begin_layout Standard
21916 You may ask why there are so many path macros.
21917 There are mainly two reasons:
21920 \begin_layout Enumerate
21921 Relative and absolute file names should remain relative or absolute, respectivel
21923 Users may have reasons to prefer either form.
21924 Relative names are useful for portable documents that should work on different
21925 machines, for example.
21926 Absolute names may be required by some programs.
21929 \begin_layout Enumerate
21930 LaTeX treats relative file names differently than LyX and other programs
21931 in nested included files.
21932 For LyX, a relative file name is always relative to the document that contains
21934 For LaTeX, it is always relative to the master document.
21935 These two definitions are identical if you have only one document, but
21936 differ if you have a master document that includes part documents.
21937 That means that relative filenames must be transformed when presented to
21939 Fortunately LyX does this automatically for you if you choose the right
21943 \begin_layout Standard
21944 So which path macro should be used in new template definitions? The rule
21948 \begin_layout Itemize
21950 \begin_inset Flex Code
21953 \begin_layout Plain Layout
21959 if an absolute path is required.
21962 \begin_layout Itemize
21964 \begin_inset Flex Code
21967 \begin_layout Plain Layout
21968 $$AbsOrRelPathMaster
21973 if the substituted string is some kind of LaTeX input.
21976 \begin_layout Itemize
21978 \begin_inset Flex Code
21981 \begin_layout Plain Layout
21982 $$AbsOrRelPathParent
21987 in order to preserve the user's choice.
21990 \begin_layout Standard
21991 There are special cases where this rule does not work and e.
21992 \begin_inset space \thinspace{}
21996 \begin_inset space \space{}
21999 relative names are needed, but normally it will work just fine.
22000 One example for such a case is the command
22001 \begin_inset Flex Code
22004 \begin_layout Plain Layout
22005 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
22010 in the XFig template above: We can't use the absolute name because the
22012 \begin_inset Flex Code
22015 \begin_layout Plain Layout
22021 files needs the relative name in order to rewrite the file content.
22024 \begin_layout Section
22025 Security discussion
22026 \begin_inset CommandInset label
22028 name "sec:Security-discussion"
22035 \begin_layout Standard
22036 The external material feature interfaces with a lot of external programs
22037 and does so automatically, so we have to consider the security implications
22039 In particular, since you have the option of including your own filenames
22040 and/or parameter strings and those are expanded into a command, it seems
22041 that it would be possible to create a malicious document which executes
22042 arbitrary commands when a user views or prints the document.
22043 This is something we definitely want to avoid.
22046 \begin_layout Standard
22047 However, since the external program commands are specified in the template
22048 configuration file only, there are no security issues if LyX is properly
22049 configured with safe templates only.
22050 This is so because the external programs are invoked with the
22051 \begin_inset Flex Code
22054 \begin_layout Plain Layout
22060 -system call rather than the
22061 \begin_inset Flex Code
22064 \begin_layout Plain Layout
22070 system-call, so it's not possible to execute arbitrary commands from the
22071 filename or parameter section via the shell.
22074 \begin_layout Standard
22075 This also implies that you are restricted in what command strings you can
22076 use in the external material templates.
22077 In particular, pipes and redirection are not readily available.
22078 This has to be so if LyX should remain safe.
22079 If you want to use some of the shell features, you should write a safe
22080 script to do this in a controlled manner, and then invoke the script from
22081 the command string.
22085 \begin_layout Standard
22086 It is possible to design a template that interacts directly with the shell,
22087 but since this would allow a malicious user to execute arbitrary commands
22088 by writing clever filenames and/or parameters, we generally recommend that
22089 you only use safe scripts that work with the
22090 \begin_inset Flex Code
22093 \begin_layout Plain Layout
22099 system call in a controlled manner.
22100 Of course, for use in a controlled environment, it can be tempting to just
22101 fall back to use ordinary shell scripts.
22102 If you do so, be aware that you
22106 provide an easily exploitable security hole in your system.
22107 Of course it stands to reason that such unsafe templates will never be
22108 included in the standard LyX distribution, although we do encourage people
22109 to submit new templates in the open source tradition.
22110 But LyX as shipped from the official distribution channels will never have
22114 \begin_layout Standard
22115 Including external material provides a lot of power, and you have to be
22116 careful not to introduce security hazards with this power.
22117 A subtle error in a single line in an innocent looking script can open
22118 the door to huge security problems.
22119 So if you do not fully understand the issues, we recommend that you consult
22120 a knowledgeable security professional or the LyX development team if you
22121 have any questions about whether a given template is safe or not.
22122 And do this before you use it in an uncontrolled environment.