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 155139281 "Jrgen Spitzmller"
144 \author 1082167584 "Kayvan Sylvan" kayvan@sylvan.com
145 \author 1414654397 "Richard Heck"
146 \author 2090807402 "usti"
152 Customizing LyX: Features for the Advanced User
160 \begin_layout Plain Layout
162 If you have comments or error corrections, please send them to the LyX Documenta
164 \begin_inset CommandInset href
166 target "lyx-docs@lists.lyx.org"
173 \begin_inset Quotes eld
177 \begin_inset Quotes erd
180 in the subject header, and please cc the current maintainer of this file,
181 Richard Heck <rgheck@comcast.net>.
187 \begin_inset Newline newline
191 \begin_inset Newline newline
197 \begin_layout Standard
198 \begin_inset CommandInset toc
199 LatexCommand tableofcontents
206 \begin_layout Standard
207 \begin_inset Note Note
210 \begin_layout Plain Layout
211 Please use change tracking when modifying this document.
212 This makes it easier for our translators to recognize things that have
213 been changed, and it helps the maintainer keep up-to-date with what's been
222 \begin_layout Chapter
226 \begin_layout Standard
227 This manual covers the customization features present in LyX.
228 In it, we discuss issues like keyboard shortcuts, screen previewing options,
229 printer options, sending commands to LyX via the LyX Server, internationalizati
230 on, installing new LaTeX classes and LyX layouts, etc.
231 We can't possibly hope to touch on everything you can change—our developers
232 add new features faster than we can document them—but we will explain the
233 most common customizations and hopefully point you in the right direction
234 for some of the more obscure ones.
237 \begin_layout Standard
238 \begin_inset Branch OutDated
241 \begin_layout Standard
242 Information from previous versions of this document that now seems to be
243 outdated is contained in the OutDated branch of this document.
244 By default, this information will not appear in the LaTeX output.
252 \begin_layout Chapter
253 LyX configuration files
256 \begin_layout Standard
257 This chapter aims to help you to find your way through the LyX configuration
259 Before continuing to read this chapter, you should find out where your
260 LyX library and user directories are by using
261 \begin_inset Flex MenuItem
264 \begin_layout Plain Layout
265 Help\SpecialChar \menuseparator
276 The library directory is the place where LyX places its system-wide configurati
277 on files; the user directory is where you can place your modified versions.
278 We will call the former
279 \begin_inset Flex Code
282 \begin_layout Plain Layout
289 \begin_inset Flex MenuItem
292 \begin_layout Plain Layout
298 in the remainder of this document.
302 \begin_layout Section
304 \begin_inset Flex Code
307 \begin_layout Plain Layout
316 \begin_layout Standard
317 \begin_inset Flex Code
320 \begin_layout Plain Layout
326 and its sub-directories contain a number of files and that can be used
327 to customize LyX's behavior.
328 You can change many of these files from within LyX itself through the
329 \begin_inset Flex MenuItem
332 \begin_layout Plain Layout
333 Tools\SpecialChar \menuseparator
340 Most customization that you will want to do in LyX is possible through
342 However, many other inner aspects of LyX can be customized by modifying
344 \begin_inset Flex Code
347 \begin_layout Plain Layout
354 These files fall in different categories, described in the following subsection
358 \begin_layout Subsection
359 Automatically generated files
362 \begin_layout Standard
363 The files, which are to be found in
364 \begin_inset Flex MenuItem
367 \begin_layout Plain Layout
373 , are generated when you configure LyX.
374 They contain various default values that are guessed by inspection.
375 In general, it is not a good idea to modify them, since they might be overwritt
379 \begin_layout Labeling
380 \labelwidthstring 00.00.0000
381 \begin_inset Flex Code
384 \begin_layout Plain Layout
390 contains defaults for various commands.
393 \begin_layout Labeling
394 \labelwidthstring 00.00.0000
395 \begin_inset Flex Code
398 \begin_layout Plain Layout
404 contains the list of packages that have been recognized by LyX.
405 It is currently unused by the LyX program itself, but the information extracted
406 , and more, is made available with
407 \begin_inset Flex MenuItem
410 \begin_layout Plain Layout
411 Help\SpecialChar \menuseparator
424 \begin_layout Labeling
425 \labelwidthstring 00.00.0000
426 \begin_inset Flex Code
429 \begin_layout Plain Layout
435 the list of text classes that have been found in your
436 \begin_inset Flex Code
439 \begin_layout Plain Layout
445 directories, along with the associated LaTeX document class and their descripti
449 \begin_layout Labeling
450 \labelwidthstring 00.00.0000
451 \begin_inset Flex Code
454 \begin_layout Plain Layout
460 the list of layout modules found in your
461 \begin_inset Flex Code
464 \begin_layout Plain Layout
473 \begin_layout Labeling
474 \labelwidthstring 00.00.0000
475 \begin_inset Flex Code
478 \begin_layout Plain Layout
484 lists of various sorts of LaTeX-related files found on your system
487 \begin_layout Labeling
488 \labelwidthstring 00.00.0000
489 \begin_inset Flex Code
492 \begin_layout Plain Layout
498 is automatically generated during configuration from the file
499 \begin_inset Flex Code
502 \begin_layout Plain Layout
509 It contains information on your LaTeX configuration.
512 \begin_layout Subsection
516 \begin_layout Standard
517 These directories are duplicated between
518 \begin_inset Flex Code
521 \begin_layout Plain Layout
528 \begin_inset Flex Code
531 \begin_layout Plain Layout
538 If a particular files exists in both places, the one in
539 \begin_inset Flex Code
542 \begin_layout Plain Layout
551 \begin_layout Labeling
552 \labelwidthstring 00.00.0000
553 \begin_inset Flex Code
556 \begin_layout Plain Layout
562 this directory contains files with the extension
563 \begin_inset Flex Code
566 \begin_layout Plain Layout
572 that define the keybindings used in LyX.
573 If there exists an internationalized version of the bind file named
574 \begin_inset Flex Code
577 \begin_layout Plain Layout
583 , that will be used first.
586 \begin_layout Labeling
587 \labelwidthstring 00.00.0000
588 \begin_inset Flex Code
591 \begin_layout Plain Layout
597 contains graphics files that can be included in documents.
601 \begin_layout Labeling
602 \labelwidthstring 00.00.0000
603 \begin_inset Flex Code
606 \begin_layout Plain Layout
612 contains LyX documentation files (including the one you are currently reading).
614 \begin_inset Flex Code
617 \begin_layout Plain Layout
623 deserves special attention, as noted above.
624 The internationalized help docs are in subdirectories
625 \begin_inset Flex Code
628 \begin_layout Plain Layout
635 \begin_inset Quotes eld
639 \begin_inset Quotes erd
642 is the ISO language code.
648 \begin_inset CommandInset ref
650 reference "cha:Internationalizing-LyX"
657 \begin_layout Labeling
658 \labelwidthstring 00.00.0000
659 \begin_inset Flex Code
662 \begin_layout Plain Layout
668 contains example files that explain how to use some features.
669 In the file browser, press the
670 \begin_inset Flex MenuItem
673 \begin_layout Plain Layout
682 \begin_layout Labeling
683 \labelwidthstring 00.00.0000
684 \begin_inset Flex Code
687 \begin_layout Plain Layout
693 contains image files that are used by the
694 \begin_inset Flex MenuItem
697 \begin_layout Plain Layout
704 In addition, it also contains the individual icons used in the toolbar
705 and the banners that can be shown when LyX is launched.
708 \begin_layout Labeling
709 \labelwidthstring 00.00.0000
710 \begin_inset Flex Code
713 \begin_layout Plain Layout
719 contains keyboard keymapping files.
725 \begin_inset CommandInset ref
727 reference "sec:International-Keymap-Stuff"
734 \begin_layout Labeling
735 \labelwidthstring 00.00.0000
736 \begin_inset Flex Code
739 \begin_layout Plain Layout
745 contains the text class and module files described in Chapter
750 \begin_inset CommandInset ref
752 reference "cha:Installing-New-Document"
759 \begin_layout Labeling
760 \labelwidthstring 00.00.0000
761 \begin_inset Flex Code
764 \begin_layout Plain Layout
771 \begin_inset Flex Code
774 \begin_layout Plain Layout
780 Python scripts used to convert between LyX versions.
781 These can be run from the command line if, say, you want to batch-convert
785 \begin_layout Labeling
786 \labelwidthstring 00.00.0000
787 \begin_inset Flex Code
790 \begin_layout Plain Layout
796 contains some files that demonstrate the capabilities of the
797 \begin_inset Flex MenuItem
800 \begin_layout Plain Layout
811 Also contains some scripts used by LyX itself.
814 \begin_layout Labeling
815 \labelwidthstring 00.00.0000
816 \begin_inset Flex Code
819 \begin_layout Plain Layout
825 contains the standard LyX template files described in Chapter
830 \begin_inset CommandInset ref
832 reference "sub:Creating-Templates"
839 \begin_layout Labeling
840 \labelwidthstring 00.00.0000
841 \begin_inset Flex Code
844 \begin_layout Plain Layout
850 contains files with the extension
851 \begin_inset Flex Code
854 \begin_layout Plain Layout
860 that define the user interface to LyX.
861 That is, the files define which items appear in which menus and the items
862 appearing on the toolbar.
865 \begin_layout Subsection
866 Files you don't want to modify
869 \begin_layout Standard
870 These files are used internally by LyX and you generally do not need to
871 modify them unless you are a developer.
874 \begin_layout Labeling
875 \labelwidthstring 00.00.0000
876 \begin_inset Flex Code
879 \begin_layout Plain Layout
885 this file contains the list of LyX developers.
886 The contents are displayed with the menu entry
887 \begin_inset Flex MenuItem
890 \begin_layout Plain Layout
891 Help\SpecialChar \menuseparator
904 \begin_layout Labeling
905 \labelwidthstring 00.00.0000
906 \begin_inset Flex Code
909 \begin_layout Plain Layout
915 this is a LaTeX script used during the configuration process.
919 \begin_layout Labeling
920 \labelwidthstring 00.00.0000
921 \begin_inset Flex Code
924 \begin_layout Plain Layout
930 this is the script that is used to re-configure LyX.
931 It creates configuration files in the directory it was run from.
934 \begin_layout Subsection
935 Other files needing a line or two...
938 \begin_layout Labeling
939 \labelwidthstring 00.00.0000
940 \begin_inset Flex Code
943 \begin_layout Plain Layout
949 this contains tables describing how different character encodings can be
953 \begin_layout Labeling
954 \labelwidthstring 00.00.0000
955 \begin_inset Flex Code
958 \begin_layout Plain Layout
964 this file contains the templates available to the new
965 \begin_inset Flex MenuItem
968 \begin_layout Plain Layout
981 \begin_layout Labeling
982 \labelwidthstring 00.00.0000
983 \begin_inset Flex Code
986 \begin_layout Plain Layout
992 this file contains a list of all the languages currently supported by LyX.
993 \change_inserted -195340706 1334775793
997 \begin_layout Labeling
998 \labelwidthstring 00.00.0000
1000 \change_inserted -195340706 1334775793
1001 \begin_inset Flex Code
1004 \begin_layout Plain Layout
1006 \change_inserted -195340706 1334775793
1012 this file contains translations for internationalized paragraph styles
1014 \begin_inset space \thinspace{}
1018 \begin_inset CommandInset ref
1020 reference "sub:I18n"
1029 \begin_layout Section
1030 Your local configuration directory
1033 \begin_layout Standard
1034 Even if you are using LyX as an unprivileged user, you might want to change
1035 LyX configuration for your own use.
1037 \begin_inset Flex Code
1040 \begin_layout Plain Layout
1046 directory contains all your personal configuration files.
1047 This is the directory described as
1048 \begin_inset Quotes eld
1052 \begin_inset Quotes erd
1056 \begin_inset Flex MenuItem
1059 \begin_layout Plain Layout
1060 Help\SpecialChar \menuseparator
1062 \begin_inset space ~
1071 This directory is used as a mirror of
1072 \begin_inset Flex Code
1075 \begin_layout Plain Layout
1081 , which means that every file in
1082 \begin_inset Flex Code
1085 \begin_layout Plain Layout
1091 is a replacement for the corresponding file in
1092 \begin_inset Flex Code
1095 \begin_layout Plain Layout
1102 Any configuration file described in the above sections can be placed either
1103 in the system-wide directory, in which case it will affect all users, or
1104 in your local directory for your own use.
1107 \begin_layout Standard
1108 To make things clearer, let's provide a few examples:
1111 \begin_layout Itemize
1112 The preferences set in the
1113 \begin_inset Flex MenuItem
1116 \begin_layout Plain Layout
1117 Tools\SpecialChar \menuseparator
1123 dialog are saved to a file
1124 \begin_inset Flex Code
1127 \begin_layout Plain Layout
1134 \begin_inset Flex Code
1137 \begin_layout Plain Layout
1146 \begin_layout Itemize
1147 When you reconfigure using
1148 \begin_inset Flex MenuItem
1151 \begin_layout Plain Layout
1152 Tools\SpecialChar \menuseparator
1159 \begin_inset Flex Code
1162 \begin_layout Plain Layout
1168 script, and the resulting files are written in your local configuration
1170 This means that any additional text class file that you might have added
1172 \begin_inset Flex Code
1175 \begin_layout Plain Layout
1181 will be added to the list of classes in the
1182 \begin_inset Flex MenuItem
1185 \begin_layout Plain Layout
1186 Document\SpecialChar \menuseparator
1195 \begin_layout Itemize
1196 If you get some updated documentation from LyX ftp site and cannot install
1197 it because you do not have sysadmin rights on your system, you can just
1199 \begin_inset Flex Code
1202 \begin_layout Plain Layout
1208 and the items in the
1209 \begin_inset Flex MenuItem
1212 \begin_layout Plain Layout
1218 menu will open them!
1221 \begin_layout Section
1222 Running LyX with multiple configurations
1225 \begin_layout Standard
1226 The configuration freedom of the local configuration directory may not suffice
1227 if you want to have more than one configuration at your disposal.
1228 For example, you may want to be use different key bindings or printer settings
1230 You can achieve this by having several such directories.
1231 You then specify which directory to use at run-time.
1234 \begin_layout Standard
1235 Invoking LyX with the command line switch
1236 \begin_inset Flex Code
1239 \begin_layout Plain Layout
1249 instructs the program to read the configuration from that directory, and
1250 not from the default directory.
1251 (You can determine the default directory by running LyX without the
1252 \begin_inset Flex Code
1255 \begin_layout Plain Layout
1261 switch.) If the specified directory does not exist, LyX offers to create
1262 it for you, just like it does for the default directory on the first time
1263 you run the program.
1264 You can modify the configuration options in this additional user directory
1265 exactly as you would for the default directory.
1266 These directories are completely independent (but read on).
1267 Note that setting the environment variable
1268 \begin_inset Flex Code
1271 \begin_layout Plain Layout
1277 to some value has exactly the same effect.
1280 \begin_layout Standard
1281 Having several configurations also requires more maintenance: if you want
1282 to add a new layout to
1283 \begin_inset Flex Code
1286 \begin_layout Plain Layout
1292 which you want available from all your configurations, you must add it
1293 to each directory separately.
1294 You can avoid this with the following trick: after LyX creates the additional
1295 directory, most of the subdirectories (see above) are empty.
1296 If you want the new configuration to mirror an existing one, replace the
1297 empty subdirectory with a symbolic link to the matching subdirectory in
1298 the existing configuration.
1300 \begin_inset Flex Code
1303 \begin_layout Plain Layout
1309 subdirectory, however, since it contains a file written by the configuration
1310 script (also accessible through
1311 \begin_inset Flex MenuItem
1314 \begin_layout Plain Layout
1315 Tools\SpecialChar \menuseparator
1321 ) which is configuration-specific.
1324 \begin_layout Chapter
1325 The Preferences dialog
1328 \begin_layout Standard
1329 All options of the preferences dialog are described in the Appendix
1331 The Preferences Dialog
1338 For some options you might find here more details.
1341 \begin_layout Section
1343 \begin_inset CommandInset label
1352 \begin_layout Standard
1353 The first step is to define your file formats if they are not already defined.
1355 \begin_inset Flex MenuItem
1358 \begin_layout Plain Layout
1359 Tools\SpecialChar \menuseparator
1367 \begin_inset Flex MenuItem
1370 \begin_layout Plain Layout
1371 File Handling\SpecialChar \menuseparator
1378 \begin_inset Flex MenuItem
1381 \begin_layout Plain Layout
1382 New\SpecialChar \ldots{}
1388 button to define your new format.
1390 \begin_inset Flex MenuItem
1393 \begin_layout Plain Layout
1399 field contains the name used to identify the format in the GUI.
1401 \begin_inset Flex MenuItem
1404 \begin_layout Plain Layout
1410 is used to identify the format internally.
1411 You will also need to enter a file extension.
1412 These are all required.
1414 \begin_inset Flex MenuItem
1417 \begin_layout Plain Layout
1423 field is used to provide a keyboard shortcut on the menus.
1424 (For example, pressing
1425 \begin_inset Flex MenuItem
1428 \begin_layout Plain Layout
1435 \begin_inset Flex MenuItem
1438 \begin_layout Plain Layout
1439 View\SpecialChar \menuseparator
1440 View (Other Formats)\SpecialChar \menuseparator
1449 \begin_layout Standard
1451 \begin_inset Flex MenuItem
1454 \begin_layout Plain Layout
1461 \begin_inset Flex MenuItem
1464 \begin_layout Plain Layout
1471 For example, you might want to use
1472 \begin_inset Flex MenuItem
1475 \begin_layout Plain Layout
1481 to view PostScript files.
1482 You can enter the command needed to start the program in the corresponding
1484 In defining this command, you can use the four variables listed in the
1486 The viewer is launched when you view an image in LyX or use the
1487 \begin_inset Flex MenuItem
1490 \begin_layout Plain Layout
1497 The editor is for example launched when you right-click on an image and
1499 \begin_inset Flex MenuItem
1502 \begin_layout Plain Layout
1508 in the appearing context menu.
1511 \begin_layout Standard
1513 \change_inserted -195340706 1329851811
1515 \begin_inset Flex MenuItem
1518 \begin_layout Plain Layout
1524 type of a format is optional, but if it is specified, it must be unique
1526 It is used to detect files of this format from the file contents.
1527 For some important file formats there is no MIME type officially registered
1529 \begin_inset CommandInset href
1532 target "http://www.iana.org/assignments/media-types/"
1537 Therefore LyX uses the extended list of MIME types as specified by
1538 \begin_inset CommandInset href
1540 name "freedesktop.org"
1541 target "http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec"
1548 \begin_layout Standard
1550 \begin_inset Flex MenuItem
1553 \begin_layout Plain Layout
1559 option tells LyX that a format is suitable for document export.
1560 If this is set and if a suitable conversion route exists (see sec.
1561 \begin_inset space \thinspace{}
1565 \begin_inset CommandInset ref
1567 reference "sec:Converters"
1571 ), the format will appear in the
1572 \begin_inset Flex MenuItem
1575 \begin_layout Plain Layout
1576 File\SpecialChar \menuseparator
1583 The format will also appear in the
1584 \begin_inset Flex MenuItem
1587 \begin_layout Plain Layout
1593 menu if a viewer is specified for the format.
1594 Pure image formats, such as
1595 \begin_inset Flex Code
1598 \begin_layout Plain Layout
1604 , should not use this option.
1605 Formats that can both represent vector graphics and documents like
1606 \begin_inset Flex Code
1609 \begin_layout Plain Layout
1618 \begin_layout Standard
1620 \begin_inset Flex MenuItem
1623 \begin_layout Plain Layout
1624 Vector graphics format
1629 tells LyX that a format can contain vector graphics.
1630 This information is used to determine the target format of included graphics
1632 \begin_inset Flex MenuItem
1635 \begin_layout Plain Layout
1642 Included graphics may need to be converted to either
1643 \begin_inset Flex MenuItem
1646 \begin_layout Plain Layout
1653 \begin_inset Flex MenuItem
1656 \begin_layout Plain Layout
1663 \begin_inset Flex MenuItem
1666 \begin_layout Plain Layout
1673 \begin_inset Flex MenuItem
1676 \begin_layout Plain Layout
1682 cannot handle other image formats.
1683 If an included graphic is not already in
1684 \begin_inset Flex MenuItem
1687 \begin_layout Plain Layout
1694 \begin_inset Flex MenuItem
1697 \begin_layout Plain Layout
1704 \begin_inset Flex MenuItem
1707 \begin_layout Plain Layout
1713 format, it is converted to
1714 \begin_inset Flex MenuItem
1717 \begin_layout Plain Layout
1723 if the vector format option is set, and otherwise to
1724 \begin_inset Flex MenuItem
1727 \begin_layout Plain Layout
1736 \begin_layout Section
1740 \begin_layout Standard
1741 Since all conversions from one format to another take place in LyX's temporary
1742 directory, it is sometimes necessary to modify a file before copying it
1743 to the temporary directory in order that the conversion may be performed.
1747 \begin_layout Plain Layout
1748 For example, the file may refer to other files—images, for example—using
1749 relative file names, and these may become invalid when the file is copied
1750 to the temporary directory.
1755 This is done by a Copier: It copies a file to (or from) the temporary directory
1756 and may modify it in the process.
1759 \begin_layout Standard
1760 The definitions of the copiers may use four variables:
1763 \begin_layout Labeling
1764 \labelwidthstring 00.00.0000
1765 \begin_inset Flex Code
1768 \begin_layout Plain Layout
1774 The LyX system directory (e.
1775 \begin_inset space \thinspace{}
1779 \begin_inset space \space{}
1783 \begin_inset Flex MenuItem
1786 \begin_layout Plain Layout
1795 \begin_layout Labeling
1796 \labelwidthstring 00.00.0000
1797 \begin_inset Flex Code
1800 \begin_layout Plain Layout
1809 \begin_layout Labeling
1810 \labelwidthstring 00.00.0000
1811 \begin_inset Flex Code
1814 \begin_layout Plain Layout
1821 \change_inserted 1082167584 1348453985
1825 \begin_layout Labeling
1826 \labelwidthstring 00.00.0000
1828 \change_inserted 1082167584 1348453986
1829 $$b The base name (without filename extension) in the LyX temporary directory
1832 \begin_layout Labeling
1833 \labelwidthstring 00.00.0000
1835 \change_inserted 1082167584 1348453986
1836 $$p The full directory path of the LyX temporary directory
1839 \begin_layout Labeling
1840 \labelwidthstring 00.00.0000
1842 \change_inserted 1082167584 1348453986
1843 $$r The full pathname to the original LyX file being processed
1846 \begin_layout Labeling
1847 \labelwidthstring 00.00.0000
1849 \change_inserted 1082167584 1348453986
1850 $$f The filename (without any directory path) of the LyX file.
1853 \begin_layout Labeling
1854 \labelwidthstring 00.00.0000
1855 \begin_inset Flex Code
1858 \begin_layout Plain Layout
1865 \change_inserted 1082167584 1348453720
1869 \begin_layout Standard
1870 The latter should be the filename as it would be used in a LaTeX's
1877 It is relevant only when exporting files suitable for such inclusion.
1880 \begin_layout Standard
1881 Copiers can be used to do almost anything with output files.
1882 For example, suppose you want generated pdf files to be copied to a special
1884 \begin_inset Flex Code
1887 \begin_layout Plain Layout
1894 Then you could write a shell script such as this one:
1897 \begin_layout Standard
1898 \begin_inset listings
1902 \begin_layout Plain Layout
1907 \begin_layout Plain Layout
1912 \begin_layout Plain Layout
1914 TOFILE=`basename $2`
1917 \begin_layout Plain Layout
1919 cp $FROMFILE /home/you/pdf/$TOFILE
1924 Save it in your local LyX directory—say,
1925 \begin_inset Flex Code
1928 \begin_layout Plain Layout
1929 /home/you/.lyx/scripts/pdfcopier.sh
1934 —and make it executable, if you need to do so on your platform.
1936 \begin_inset Flex MenuItem
1939 \begin_layout Plain Layout
1940 Tools\SpecialChar \menuseparator
1946 dialog, select under
1947 \begin_inset Flex MenuItem
1950 \begin_layout Plain Layout
1951 File Handling\SpecialChar \menuseparator
1958 \begin_inset Flex MenuItem
1961 \begin_layout Plain Layout
1967 format—or one of the other pdf formats—and enter
1968 \begin_inset Flex Code
1971 \begin_layout Plain Layout
1972 pdfcopier.sh $$i $$o
1978 \begin_inset Flex MenuItem
1981 \begin_layout Plain Layout
1991 \begin_layout Standard
1992 Copiers are used by LyX in various of its own conversions.
1993 For example, if appropriate programs are found, LyX will automatically
1994 install copiers for the
1995 \begin_inset Flex MenuItem
1998 \begin_layout Plain Layout
2005 \begin_inset Flex MenuItem
2008 \begin_layout Plain Layout
2010 \begin_inset space ~
2019 When these formats are exported, the copier sees that not just the main
2020 HTML file but various associated files (style files, images, etc.) are also
2022 All these files are written to a subdirectory of the directory in which
2023 the original LyX file was found.
2027 \begin_layout Plain Layout
2028 This copier can be customized.
2030 \begin_inset Quotes eld
2034 \begin_inset Quotes erd
2037 argument takes a comma-separated list of extensions to be copied; if it
2038 is omitted, all files will be copied.
2040 \begin_inset Quotes eld
2044 \begin_inset Quotes erd
2047 argument determines the extension added to the generated directory.
2049 \begin_inset Quotes eld
2053 \begin_inset Flex MenuItem
2056 \begin_layout Plain Layout
2063 \begin_inset Quotes erd
2066 , so HTML generated from
2067 \begin_inset Flex MenuItem
2070 \begin_layout Plain Layout
2071 /path/to/filename.lyx
2077 \begin_inset Flex MenuItem
2080 \begin_layout Plain Layout
2081 /path/to/filename.html.LyXconv
2095 \begin_layout Section
2097 \begin_inset CommandInset label
2099 name "sec:Converters"
2106 \begin_layout Standard
2107 You can define your own Converters to convert files between different formats.
2109 \begin_inset Flex MenuItem
2112 \begin_layout Plain Layout
2113 Tools\SpecialChar \menuseparator
2114 Preferences\SpecialChar \menuseparator
2115 File Handling\SpecialChar \menuseparator
2124 \begin_layout Standard
2125 To define a new converter, select the
2126 \begin_inset Flex MenuItem
2129 \begin_layout Plain Layout
2131 \begin_inset space ~
2140 \begin_inset Flex MenuItem
2143 \begin_layout Plain Layout
2145 \begin_inset space ~
2153 from the drop-down lists, enter the command needed for the conversion,
2155 \begin_inset Flex MenuItem
2158 \begin_layout Plain Layout
2165 Several variables can be used in the definition of converters:
2168 \begin_layout Labeling
2169 \labelwidthstring 00.00.0000
2170 \begin_inset Flex Code
2173 \begin_layout Plain Layout
2179 The LyX system directory
2182 \begin_layout Labeling
2183 \labelwidthstring 00.00.0000
2184 \begin_inset Flex Code
2187 \begin_layout Plain Layout
2196 \begin_layout Labeling
2197 \labelwidthstring 00.00.0000
2198 \begin_inset Flex Code
2201 \begin_layout Plain Layout
2210 \begin_layout Labeling
2211 \labelwidthstring 00.00.0000
2212 \begin_inset Flex Code
2215 \begin_layout Plain Layout
2221 The base filename of the input file (i.
2222 \begin_inset space \thinspace{}
2225 g., without the extension)
2228 \begin_layout Labeling
2229 \labelwidthstring 00.00.0000
2230 \begin_inset Flex Code
2233 \begin_layout Plain Layout
2239 The path to the input file
2242 \begin_layout Labeling
2243 \labelwidthstring 00.00.0000
2244 \begin_inset Flex Code
2247 \begin_layout Plain Layout
2253 The path to the original input file (this is different from $$p when a
2254 chain of converters is called)
2257 \begin_layout Labeling
2258 \labelwidthstring 00.00.0000
2259 \begin_inset Flex Code
2262 \begin_layout Plain Layout
2268 The iconv name for the encoding of the document.
2271 \begin_layout Standard
2273 \begin_inset Flex MenuItem
2276 \begin_layout Plain Layout
2278 \begin_inset space ~
2286 field you can enter the following flags, separated by commas:
2289 \begin_layout Labeling
2290 \labelwidthstring 00.00.0000
2291 \begin_inset Flex Code
2294 \begin_layout Plain Layout
2300 This converter runs some form of LaTeX.
2301 This will make LyX's LaTeX error logs available.
2304 \begin_layout Labeling
2305 \labelwidthstring 00.00.0000
2306 \begin_inset Flex Code
2309 \begin_layout Plain Layout
2316 \begin_inset Flex MenuItem
2319 \begin_layout Plain Layout
2325 file for the conversion.
2326 \change_inserted 1414654397 1337693117
2330 \begin_layout Labeling
2331 \labelwidthstring 00.00.0000
2333 \change_inserted 1414654397 1337693188
2334 \begin_inset Flex Code
2337 \begin_layout Plain Layout
2339 \change_inserted 1414654397 1337693129
2348 \begin_inset Quotes eld
2352 \begin_inset Quotes erd
2355 file from the backend, which in practice means a LaTeX file like the one
2356 we would export, without
2357 \begin_inset Flex Code
2360 \begin_layout Plain Layout
2362 \change_inserted 1414654397 1337693184
2375 \begin_layout Labeling
2376 \labelwidthstring 00.00.0000
2377 \begin_inset Flex Code
2380 \begin_layout Plain Layout
2389 \begin_layout Standard
2390 The following three flags are not really flags at all because they take
2392 \begin_inset Flex MenuItem
2395 \begin_layout Plain Layout
2397 \begin_inset space ~
2401 \begin_inset space ~
2412 \begin_layout Labeling
2413 \labelwidthstring 00.00.0000
2414 \begin_inset Flex Code
2417 \begin_layout Plain Layout
2423 If set, the converter's standard error will be redirected to a file
2424 \begin_inset Flex Code
2427 \begin_layout Plain Layout
2433 , and the script given as argument will be run as:
2434 \begin_inset Flex Code
2437 \begin_layout Plain Layout
2438 script < infile.out > infile.log
2444 The argument may contain
2445 \begin_inset Flex Code
2448 \begin_layout Plain Layout
2457 \begin_layout Labeling
2458 \labelwidthstring 00.00.0000
2459 \begin_inset Flex Code
2462 \begin_layout Plain Layout
2468 The name of the directory in which the converter will dump the generated
2470 LyX will not create this directory, and it does not copy anything into
2471 it, though it will copy this directory to the destination.
2472 The argument may contain
2473 \begin_inset Flex Code
2476 \begin_layout Plain Layout
2482 , which will be replaced by the base name of the input and output files,
2483 respectively, when the directory is copied.
2484 \begin_inset Newline newline
2487 Note that resultdir and usetempdir make no sense together.
2488 The latter will be ignored if the former is given.
2491 \begin_layout Labeling
2492 \labelwidthstring 00.00.0000
2493 \begin_inset Flex Code
2496 \begin_layout Plain Layout
2502 Determines the output file name and may, contain
2503 \begin_inset Flex Code
2506 \begin_layout Plain Layout
2513 Sensible only with resultdir and optional even then; if not given, it defaults
2517 \begin_layout Standard
2518 None of these last three are presently used in any of the converters that
2519 are installed with LyX.
2523 \begin_layout Standard
2524 You do not have to define converters for all formats between which you want
2526 For example, you will note that there is no `LyX to PostScript' converter,
2527 but LyX will export PostScript.
2528 It does so by first creating a LaTeX file (no converter needs to be defined
2529 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2530 and finally converting the resulting DVI file to PostScript.
2531 LyX finds such `chains' of converters automatically, and it will always
2532 choose the shortest possible chain.
2533 You can, though, still define multiple conversion methods between file
2535 For example, the standard LyX configuration provides three ways to convert
2536 LaTeX to PDF: Directly, using
2537 \begin_inset Flex MenuItem
2540 \begin_layout Plain Layout
2546 ; via (DVI and) PostScript, using
2547 \begin_inset Flex MenuItem
2550 \begin_layout Plain Layout
2557 \begin_inset Flex MenuItem
2560 \begin_layout Plain Layout
2567 To define such alternate chains, you must define multiple target `file
2568 formats', as described in section
2569 \begin_inset CommandInset ref
2571 reference "sec:Formats"
2576 For example, in the standard configuration, the formats named
2577 \begin_inset Flex MenuItem
2580 \begin_layout Plain Layout
2587 \begin_inset Flex MenuItem
2590 \begin_layout Plain Layout
2597 \begin_inset Flex MenuItem
2600 \begin_layout Plain Layout
2606 are defined, all of which share the extension
2607 \begin_inset Flex MenuItem
2610 \begin_layout Plain Layout
2616 , and which correspond to the conversion methods just mentioned.
2619 \begin_layout Chapter
2620 Internationalizing LyX
2621 \begin_inset CommandInset label
2623 name "cha:Internationalizing-LyX"
2630 \begin_layout Standard
2631 LyX supports using a translated interface.
2632 Last time we checked, LyX provided text in thirty languages.
2633 The language of choice is called your
2638 (For further reading on locale settings, see also the documentation for
2639 locale that comes with your operating system.
2640 For Linux, the manual page for
2641 \begin_inset Flex Code
2644 \begin_layout Plain Layout
2650 could be a good place to start).
2653 \begin_layout Standard
2654 Notice that these translations will work, but do contain a few flaws.
2655 In particular, all dialogs have been designed with the English text in
2656 mind, which means that some of the translated text will be too large to
2657 fit within the space allocated.
2658 This is only a display problem and will not cause any harm.
2659 Also, you will find that some of the translations do not define shortcut
2660 keys for everything.
2661 Sometimes, there are simply not enough free letters to do it.
2662 Other times, the translator just hasn't got around to doing it yet.
2663 Our localization team, which you may wish to join,
2667 \begin_layout Plain Layout
2668 If you are a fluent speaker of a language other than English, joining these
2669 teams is a great way to give back to the LyX community!
2674 will of course try to fix these shortcomings in future versions of LyX.
2677 \begin_layout Section
2681 \begin_layout Subsection
2682 Translating the graphical user interface (text messages).
2685 \begin_layout Standard
2687 \begin_inset Flex Code
2690 \begin_layout Plain Layout
2696 library to handle the internationalization of the interface.
2697 To have LyX speak your favorite language in all menus and dialogs, you
2699 \begin_inset Flex Code
2702 \begin_layout Plain Layout
2708 -file for that language.
2709 When this is available, you'll have to generate a
2710 \begin_inset Flex Code
2713 \begin_layout Plain Layout
2719 -file from it and install the
2720 \begin_inset Flex Code
2723 \begin_layout Plain Layout
2730 The process of doing all of this is explained in the documentation for
2732 \begin_inset Flex Code
2735 \begin_layout Plain Layout
2742 It is possible to do this just for yourself, but if you're going to do
2743 it, you might as well share the results of your labors with the rest of
2745 Send a message to the LyX developers' list for more information about how
2749 \begin_layout Standard
2750 In short, this is what you should do (xx denotes the language code):
2753 \begin_layout Itemize
2754 Check out the LyX source code.
2756 \begin_inset CommandInset href
2758 name "information on the web"
2759 target "http://www.lyx.org/HowToUseSVN"
2766 \begin_layout Itemize
2768 \begin_inset Flex Code
2771 \begin_layout Plain Layout
2777 to the folder of the
2778 \begin_inset Flex Code
2781 \begin_layout Plain Layout
2789 \begin_inset Flex Code
2792 \begin_layout Plain Layout
2800 \begin_inset Flex Code
2803 \begin_layout Plain Layout
2809 doesn't exist anywhere, it can be remade with the console command
2810 \begin_inset Flex Code
2813 \begin_layout Plain Layout
2819 in that directory, or you can use an existing po-file for some other language
2823 \begin_layout Itemize
2825 \begin_inset Flex Code
2828 \begin_layout Plain Layout
2838 \begin_layout Plain Layout
2839 This is just a text file, so it can be edited in any text editor.
2840 But there are also specialized programs that support such editing, such
2845 (for all platforms) or
2854 contains a `mode' for editing
2855 \begin_inset Flex Code
2858 \begin_layout Plain Layout
2869 For some menu- and widget-labels, there are also shortcut keys that should
2871 Those keys are marked after a `|', and should be translated according to
2872 the words and phrases of the language.
2873 You should also fill also out the information at the beginning of the new
2875 \begin_inset Flex Code
2878 \begin_layout Plain Layout
2884 -file with your email-address, etc., so people know where to reach you with
2885 suggestions and entertaining flames.
2888 \begin_layout Standard
2889 If you are just doing this on your own, then:
2892 \begin_layout Itemize
2894 \begin_inset Flex Code
2897 \begin_layout Plain Layout
2904 This can be done with
2905 \begin_inset Flex Code
2908 \begin_layout Plain Layout
2909 msgfmt -o xx.mo < xx.po
2917 \begin_layout Itemize
2919 \begin_inset Flex Code
2922 \begin_layout Plain Layout
2928 -file to your locale-tree, at the correct directory for application messages
2933 xx, and under the name
2934 \begin_inset Flex Code
2937 \begin_layout Plain Layout
2944 \begin_inset space \thinspace{}
2948 \begin_inset space \space{}
2952 \begin_inset Flex Code
2955 \begin_layout Plain Layout
2956 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2966 \begin_layout Standard
2967 As said, however, it would be best if the new
2968 \begin_inset Flex Code
2971 \begin_layout Plain Layout
2977 -file could be added to the LyX distribution, so others can use it.
2978 Adding it involves making additional changes to LyX.
2979 So send an email to the developers' mailing list if you're interested in
2983 \begin_layout Subsubsection
2987 \begin_layout Standard
2988 Sometimes it turns out that one English message needs to be translated into
2989 different messages in the target language.
2990 One example is the message
2991 \begin_inset Flex Code
2994 \begin_layout Plain Layout
3000 which has the German translation
3008 , depending upon exactly what the English
3009 \begin_inset Quotes eld
3013 \begin_inset Quotes erd
3018 \begin_inset Flex Code
3021 \begin_layout Plain Layout
3027 does not handle such ambiguous translations.
3028 Therefore you have to add some context information to the message: Instead
3030 \begin_inset Flex Code
3033 \begin_layout Plain Layout
3040 \begin_inset Flex Code
3043 \begin_layout Plain Layout
3044 To[[as in 'From format x to format y']]
3050 \begin_inset Flex Code
3053 \begin_layout Plain Layout
3054 To[[as in 'From page x to page y']].
3059 Now the two occurrences of
3060 \begin_inset Flex Code
3063 \begin_layout Plain Layout
3070 \begin_inset Flex Code
3073 \begin_layout Plain Layout
3079 and can be translated correctly to
3090 \begin_layout Standard
3091 Of course the context information needs to be stripped off the original
3092 message when no translation is used.
3093 Therefore you have to put it in double square brackets at the end of the
3094 message (see the example above).
3095 The translation mechanism of LyX ensures that everything in double square
3096 brackets at the end of messages is removed before displaying the message.
3099 \begin_layout Subsection
3100 Translating the documentation.
3103 \begin_layout Standard
3104 The online documentation (in the
3105 \begin_inset Flex MenuItem
3108 \begin_layout Plain Layout
3114 -menu) can (and should!) be translated.
3115 If there are translated versions of the documentation available
3119 \begin_layout Plain Layout
3120 As of March 2008, at least some of the documents have been translated into
3121 fourteen languages, with the Tutorial available in a few more.
3126 and the locale is set accordingly, these will be used automagically by
3128 LyX looks for translated versions as
3129 \begin_inset Flex Code
3132 \begin_layout Plain Layout
3133 LyXDir/doc/xx/DocName.lyx
3139 \begin_inset Flex Code
3142 \begin_layout Plain Layout
3148 is the code for the language currently in use.
3149 If there are no translated documents, the default English versions will
3151 Note that the translated versions must have the same filenames (
3152 \begin_inset Flex Code
3155 \begin_layout Plain Layout
3161 above) as the original.
3162 If you feel up to translating the documentation (an excellent way to proof-read
3163 the original documentation by the way!), there are a few things you should
3167 \begin_layout Itemize
3168 Check out the documentation translation web page at
3169 \begin_inset CommandInset href
3171 name "http://www.lyx.org/Translation"
3172 target "http://www.lyx.org/Translation"
3177 That way, you can find out which (if any) documents have already been translate
3178 d into your language.
3179 You can also find out who (if anyone) is organizing the effort to translate
3180 the documentation into your language.
3181 If no one is organizing the effort, please let us know that you're interested.
3184 \begin_layout Standard
3185 Once you get to actually translating, here's a few hints for you that may
3189 \begin_layout Itemize
3190 Join the documentation team! There is information on how to do that in
3191 \begin_inset Flex Code
3194 \begin_layout Plain Layout
3201 \begin_inset Flex MenuItem
3204 \begin_layout Plain Layout
3205 Help\SpecialChar \menuseparator
3211 ), which by the way is the first document you should translate.
3214 \begin_layout Itemize
3215 Learn the typographic conventions for the language you are translating to.
3216 Typography is an ancient art and over the centuries, a great variety of
3217 conventions have developed throughout different parts of the world.
3218 Also study the professional terminology amongst typographers in your country.
3219 Inventing your own terminology will only confuse the users.
3222 (Warning! Typography is addictive!)
3225 \begin_layout Itemize
3226 Make a copy of the document.
3227 This will be your working copy.
3228 You can use this as your personal translated help-file by placing it in
3230 \begin_inset Flex Code
3233 \begin_layout Plain Layout
3242 \begin_layout Itemize
3243 Sometimes the original document (from the LyX-team) will be updated.
3244 Use the source viewer at
3245 \begin_inset CommandInset href
3247 name "http://www.lyx.org/trac/timeline"
3248 target "http://www.lyx.org/trac/timeline"
3252 to see what has been changed.
3253 That way you can easily see which parts of the translated document need
3257 \begin_layout Standard
3258 If you ever find an error in the original document, fix it and notify the
3259 rest of the documentation team of the changes! (You didn't forget to join
3260 the documentation team, did you?)
3263 \begin_layout Standard
3264 \begin_inset Branch OutDated
3267 \begin_layout Section
3268 International Keyboard Support
3271 \begin_layout Standard
3274 [Editor's Note: The following section is by
3282 It needs to be fixed to conform to the new Documentation Style sheet and
3283 to make use of the new v1.0 features.
3284 The whole thing also needs to be merged with the section following it.-jw
3285 It may also be badly out of date.-rh (2008)]
3288 \begin_layout Subsection
3289 Defining Own Keymaps: Keymap File Format
3292 \begin_layout Standard
3293 Let's look at a keyboard definition file a little closer.
3294 It is a plain text file defining
3297 \begin_layout Itemize
3298 key-to-key or key-to-string translations
3301 \begin_layout Itemize
3305 \begin_layout Itemize
3306 dead keys exceptions
3309 \begin_layout Standard
3310 To define key-to-key or key-to-string translation, use this command:
3313 \begin_layout Quotation
3314 \begin_inset Flex Code
3317 \begin_layout Plain Layout
3326 \begin_inset Flex Code
3329 \begin_layout Plain Layout
3338 \begin_layout Standard
3340 \begin_inset Flex Code
3343 \begin_layout Plain Layout
3349 is the key to be translated and
3350 \begin_inset Flex Code
3353 \begin_layout Plain Layout
3359 is the string to be inserted into the document.
3360 To define dead keys, use:
3363 \begin_layout Quotation
3364 \begin_inset Flex Code
3367 \begin_layout Plain Layout
3376 \begin_inset Flex Code
3379 \begin_layout Plain Layout
3388 \begin_layout Standard
3390 \begin_inset Flex Code
3393 \begin_layout Plain Layout
3399 is a keyboard key and
3400 \begin_inset Flex Code
3403 \begin_layout Plain Layout
3410 The following dead keys are supported (shortcut name is in parentheses):
3413 \begin_layout Quotation
3417 \begin_inset space \hfill{}
3423 \begin_layout Quotation
3425 \begin_inset space \hfill{}
3431 \begin_layout Quotation
3433 \begin_inset space \hfill{}
3439 \begin_layout Quotation
3441 \begin_inset space \hfill{}
3447 \begin_layout Quotation
3449 \begin_inset space \hfill{}
3455 \begin_layout Quotation
3457 \begin_inset space \hfill{}
3464 \begin_layout Plain Layout
3476 \begin_layout Quotation
3478 \begin_inset space \hfill{}
3484 \begin_layout Quotation
3486 \begin_inset space \hfill{}
3493 \begin_layout Plain Layout
3505 \begin_layout Quotation
3507 \begin_inset space \hfill{}
3513 \begin_layout Quotation
3515 \begin_inset space \hfill{}
3521 \begin_layout Quotation
3523 \begin_inset space \hfill{}
3530 \begin_layout Plain Layout
3542 \begin_layout Quotation
3544 \begin_inset space \hfill{}
3551 \begin_layout Plain Layout
3563 \begin_layout Quotation
3565 \begin_inset space \hfill{}
3571 \begin_layout Quotation
3572 hungarian umlaut (hug)
3573 \begin_inset space \hfill{}
3579 \begin_layout Quotation
3581 \begin_inset space \hfill{}
3587 \begin_layout Quotation
3589 \begin_inset space \hfill{}
3596 \begin_layout Plain Layout
3608 \begin_layout Standard
3609 Since in many international keyboards there are exceptions to what some
3610 dead keys should do, you can define them using
3613 \begin_layout Quotation
3614 \begin_inset Flex Code
3617 \begin_layout Plain Layout
3625 deadkey key outstring
3628 \begin_layout Standard
3629 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3633 \begin_layout Quotation
3634 \begin_inset Flex Code
3637 \begin_layout Plain Layout
3650 \begin_layout Standard
3651 to make it work correctly.
3652 Also, you have to define as exceptions dead keys over i and j, to remove
3653 the dot from them before inserting an accent mark.
3654 I will change this when the time comes, but so far I haven't had time.
3657 \begin_layout Standard
3658 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3661 \begin_inset Flex Code
3664 \begin_layout Plain Layout
3670 have different meaning.
3672 \begin_inset Flex Code
3675 \begin_layout Plain Layout
3681 marks comments, quotes start and end LaTeX-style commands.
3682 To enter quote, you'll need to use
3683 \begin_inset Flex Code
3686 \begin_layout Plain Layout
3695 \begin_inset Flex Code
3698 \begin_layout Plain Layout
3705 \begin_inset Flex Code
3708 \begin_layout Plain Layout
3719 \begin_layout Standard
3720 If you make a keyboard description file that works for your language, please
3721 mail it to me, so I can include it in the next keymap distribution.
3724 \begin_layout Standard
3725 More keywords will be supported in keymap configuration file in future,
3729 \begin_layout Itemize
3730 \begin_inset Flex Code
3733 \begin_layout Plain Layout
3744 \begin_inset space \hfill{}
3748 \begin_inset Flex Code
3751 \begin_layout Plain Layout
3760 \begin_layout Itemize
3761 \begin_inset Flex Code
3764 \begin_layout Plain Layout
3775 \begin_inset space \hfill{}
3779 \begin_inset Flex Code
3782 \begin_layout Plain Layout
3788 an external keymap translation program
3791 \begin_layout Standard
3792 Also, it should look into
3793 \begin_inset Flex Code
3796 \begin_layout Plain Layout
3802 file for defaults, too (for example, a
3803 \begin_inset Flex Code
3806 \begin_layout Plain Layout
3814 option to include default keyboard).
3822 \begin_layout Section
3823 International Keymap Stuff
3824 \begin_inset CommandInset label
3826 name "sec:International-Keymap-Stuff"
3833 \begin_layout Standard
3834 \begin_inset Note Note
3837 \begin_layout Plain Layout
3838 In doing the revisions on this document in March 2008, I did not look over
3839 this stuff, as I do not understand it.
3840 It would be good if someone else could do so.
3849 \begin_layout Standard
3850 The next two sections describe the
3851 \begin_inset Flex Code
3854 \begin_layout Plain Layout
3863 \begin_inset Flex Code
3866 \begin_layout Plain Layout
3874 file syntax in detail.
3875 These sections should help you design your own key map if the ones provided
3876 do not meet your needs.
3879 \begin_layout Subsection
3883 \begin_layout Standard
3887 \begin_inset Flex Code
3890 \begin_layout Plain Layout
3896 file maps keystrokes to characters or strings.
3897 As the name suggests, it sets a keyboard mapping.
3899 \begin_inset Flex Code
3902 \begin_layout Plain Layout
3913 \begin_inset Flex Code
3916 \begin_layout Plain Layout
3931 \begin_inset Flex Code
3934 \begin_layout Plain Layout
3947 \begin_inset Flex Code
3950 \begin_layout Plain Layout
3959 \begin_inset Flex Code
3962 \begin_layout Plain Layout
3970 are described in this section.
3973 \begin_layout Labeling
3974 \labelwidthstring 00.00.0000
3975 \begin_inset Flex Code
3978 \begin_layout Plain Layout
3986 Map a character to a string
3989 \begin_layout LyX-Code
4004 \begin_layout Standard
4037 the double-quote (")
4054 must be escaped with a preceding backslash (
4065 \begin_layout Standard
4067 \begin_inset Flex MenuItem
4070 \begin_layout Plain Layout
4078 statement to cause the symbol
4079 \begin_inset Flex MenuItem
4082 \begin_layout Plain Layout
4090 to be output for the keystroke
4091 \begin_inset Flex MenuItem
4094 \begin_layout Plain Layout
4105 \begin_layout LyX-Code
4111 \begin_layout Labeling
4112 \labelwidthstring 00.00.0000
4113 \begin_inset Flex Code
4116 \begin_layout Plain Layout
4124 Specify an accent character
4127 \begin_layout LyX-Code
4136 \begin_layout Standard
4137 This will make the cha
4175 This is the dead key
4179 \begin_layout Plain Layout
4186 refers to a key that does not produce a character by itself, but when followed
4187 with another key, produces the desired accent character.
4188 For example, a German characte
4190 r with an umlaut like
4200 can be produced in this manner.
4209 \begin_layout Standard
4222 and then another key not in
4239 followed by the other, not allowed key, as output.
4243 \begin_inset Flex MenuItem
4246 \begin_layout Plain Layout
4254 cancels a dead key, so if
4265 \begin_inset Flex MenuItem
4268 \begin_layout Plain Layout
4277 , the cursor will not go one position backwards but will instead cancel
4293 might have had on the next keystroke.
4297 \begin_layout Standard
4298 The following example specifies that the character ' is to be an acute accent,
4299 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4302 \begin_layout LyX-Code
4305 kmod ' acute aeiouAEIOU
4308 \begin_layout Labeling
4309 \labelwidthstring 00.00.0000
4310 \begin_inset Flex Code
4313 \begin_layout Plain Layout
4319 Specify an exception to the accent character
4322 \begin_layout LyX-Code
4331 \begin_layout Standard
4332 This defines an exce
4373 have been assigned a keystroke with a previous
4376 \begin_inset Flex Code
4379 \begin_layout Plain Layout
4403 must not belong in the
4450 If such a declaration does not exist in
4458 \begin_inset Flex Code
4461 \begin_layout Plain Layout
4495 \begin_inset Flex Code
4498 \begin_layout Plain Layout
4512 \begin_layout Standard
4513 The following command produces causes äi to be produced when you enter acute-i
4517 \begin_layout LyX-Code
4531 \begin_layout Labeling
4532 \labelwidthstring 00.00.0000
4533 \begin_inset Flex Code
4536 \begin_layout Plain Layout
4542 Combine two accent characters
4545 \begin_layout LyX-Code
4551 accent1 accent2 allowed
4554 \begin_layout Standard
4555 This one is getting pretty esoteric.
4556 It allows you to combine the effect
4612 \begin_inset Flex Code
4615 \begin_layout Plain Layout
4643 \begin_layout Standard
4644 Consider this example from the
4645 \begin_inset Flex Code
4648 \begin_layout Plain Layout
4659 \begin_layout LyX-Code
4662 kmod ; acute aeioyvhAEIOYVH
4666 kcomb acute umlaut iyIY
4669 \begin_layout Standard
4670 This allows you to press
4671 \begin_inset Flex MenuItem
4674 \begin_layout Plain Layout
4682 and get the effect of
4683 \begin_inset Flex Code
4686 \begin_layout Plain Layout
4705 in this case cancels the last dead key, so if you press
4706 \begin_inset Flex MenuItem
4709 \begin_layout Plain Layout
4718 \begin_inset Flex Code
4721 \begin_layout Plain Layout
4734 \begin_layout Subsection
4738 \begin_layout Standard
4740 \begin_inset Flex Code
4743 \begin_layout Plain Layout
4751 mapping is performed, a
4752 \begin_inset Flex Code
4755 \begin_layout Plain Layout
4765 file maps the strings that the symbols generate to characters in the current
4767 The LyX distribution currently includes at least the
4768 \begin_inset Flex Code
4771 \begin_layout Plain Layout
4780 \begin_inset Flex Code
4783 \begin_layout Plain Layout
4794 \begin_layout Standard
4796 \begin_inset Flex Code
4799 \begin_layout Plain Layout
4807 file is a sequence of declarations of the form
4810 \begin_layout LyX-Code
4823 \begin_layout Standard
4824 For example, in order to map
4825 \begin_inset Flex MenuItem
4828 \begin_layout Plain Layout
4838 to the corresponding character in the iso-8859-1 set (233), the following
4842 \begin_layout LyX-Code
4850 \begin_layout Standard
4852 \begin_inset Flex Code
4855 \begin_layout Plain Layout
4864 \begin_inset Flex Code
4867 \begin_layout Plain Layout
4885 the same character can apply to more than one string.
4887 \begin_inset Flex Code
4890 \begin_layout Plain Layout
4901 \begin_layout LyX-Code
4913 \begin_inset Newline newline
4929 \begin_layout Standard
4930 If LyX cannot find a mapping for the string produced by the keystroke or
4931 a deadkey sequence, it will check if it looks like an accented char and
4932 try to draw an accent over the character on screen.
4935 \begin_layout Subsection
4939 \begin_layout Standard
4940 There is a second way to add support for international characters through
4941 so-called dead-keys.
4942 A dead-key works in combination with a letter to produce an accented character.
4943 Here, we'll explain how to create a really simple dead-key to illustrate
4947 \begin_layout Standard
4948 Suppose you happen to need the circumflex character,
4949 \begin_inset Quotes eld
4953 \begin_inset Quotes erd
4958 \begin_inset Flex MenuItem
4961 \begin_layout Plain Layout
4968 \begin_inset space ~
4972 \begin_inset Flex MenuItem
4975 \begin_layout Plain Layout
4981 ] to the LyX command
4982 \begin_inset Flex Code
4985 \begin_layout Plain Layout
4992 \begin_inset Flex Code
4995 \begin_layout Plain Layout
5002 Now, whenever you type the
5003 \begin_inset Flex MenuItem
5006 \begin_layout Plain Layout
5012 -key followed by a letter, that letter will have a circumflex accent on
5014 For example, the sequence
5015 \begin_inset Quotes eld
5019 \begin_inset Flex MenuItem
5022 \begin_layout Plain Layout
5029 \begin_inset Quotes erd
5032 produces the letter:
5033 \begin_inset Quotes eld
5037 \begin_inset Quotes erd
5041 If you tried to type
5042 \begin_inset Quotes eld
5046 \begin_inset Flex MenuItem
5049 \begin_layout Plain Layout
5056 \begin_inset Quotes erd
5059 , however, LyX will complain with a beep, since a
5060 \begin_inset Quotes eld
5064 \begin_inset Flex MenuItem
5067 \begin_layout Plain Layout
5074 \begin_inset Quotes erd
5077 never takes a circumflex accent.
5079 \begin_inset Flex MenuItem
5082 \begin_layout Plain Layout
5088 after a dead-key produces the bare-accent.
5089 Please note this last point! If you bind a key to a dead-key, you'll need
5090 to rebind the character on that key to yet another key.
5092 \begin_inset Flex MenuItem
5095 \begin_layout Plain Layout
5101 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5104 \begin_layout Standard
5105 One common way to bind dead-keys is to use
5106 \begin_inset Flex MenuItem
5109 \begin_layout Plain Layout
5116 \begin_inset Flex MenuItem
5119 \begin_layout Plain Layout
5126 \begin_inset Flex MenuItem
5129 \begin_layout Plain Layout
5135 in combination with an accent, like
5136 \begin_inset Quotes eld
5140 \begin_inset Flex MenuItem
5143 \begin_layout Plain Layout
5150 \begin_inset Quotes erd
5154 \begin_inset Quotes eld
5158 \begin_inset Flex MenuItem
5161 \begin_layout Plain Layout
5168 \begin_inset Quotes erd
5172 \begin_inset Quotes eld
5176 \begin_inset Flex MenuItem
5179 \begin_layout Plain Layout
5186 \begin_inset Quotes erd
5190 Another way involves using
5191 \begin_inset Flex Code
5194 \begin_layout Plain Layout
5201 \begin_inset Flex Code
5204 \begin_layout Plain Layout
5210 to set up the special
5211 \begin_inset Flex Code
5214 \begin_layout Plain Layout
5222 \begin_inset Flex Code
5225 \begin_layout Plain Layout
5231 acts in some ways just like
5232 \begin_inset Flex MenuItem
5235 \begin_layout Plain Layout
5241 and permits you to bind keys to accented characters.
5242 You can also turn keys into dead-keys by binding them to something like
5244 \begin_inset Flex Code
5247 \begin_layout Plain Layout
5253 and then binding this symbolic key to the corresponding LyX command.
5257 \begin_layout Plain Layout
5262 : This is exactly what I do in my
5263 \begin_inset Flex Code
5266 \begin_layout Plain Layout
5273 \begin_inset Flex Code
5276 \begin_layout Plain Layout
5284 \begin_inset Flex MenuItem
5287 \begin_layout Plain Layout
5289 \begin_inset space ~
5298 \begin_inset Flex Code
5301 \begin_layout Plain Layout
5307 and a bunch of these
5308 \begin_inset Quotes eld
5312 \begin_inset Flex Code
5315 \begin_layout Plain Layout
5322 \begin_inset Quotes erd
5325 symbolic keys bound such things as
5326 \begin_inset Flex MenuItem
5329 \begin_layout Plain Layout
5331 \begin_inset space ~
5340 \begin_inset Flex MenuItem
5343 \begin_layout Plain Layout
5345 \begin_inset space ~
5354 This is how I produce my accented characters.
5359 You can make just about anything into the
5360 \begin_inset Flex Code
5363 \begin_layout Plain Layout
5370 \begin_inset Flex MenuItem
5373 \begin_layout Plain Layout
5379 keys, a spare function key, etc.
5380 As for the LyX commands that produce accents, check the entry for
5381 \begin_inset Flex Code
5384 \begin_layout Plain Layout
5395 You'll find the complete list there.
5398 \begin_layout Subsection
5399 Saving your Language Configuration
5402 \begin_layout Standard
5403 You can edit your preferences so that your desired language environment
5404 is automatically configured when LyX starts up, via the
5405 \begin_inset Flex MenuItem
5408 \begin_layout Plain Layout
5409 Edit\SpecialChar \menuseparator
5418 \begin_layout Chapter
5419 Installing New Document Classes, Layouts, and Templates
5420 \begin_inset CommandInset label
5422 name "cha:Installing-New-Document"
5427 \begin_inset Argument 1
5430 \begin_layout Plain Layout
5431 Installing New Document Classes
5439 \begin_layout Standard
5440 In this chapter, we describe the procedures for creating and installing
5441 new LyX layout and template files, as well as offer a refresher on correctly
5442 installing new LaTeX document classes.
5446 \begin_layout Standard
5447 First, let us a say a few words about how one ought to think about the relation
5448 between LyX and LaTeX.
5449 The thing to understand is that, in a certain sense, LyX doesn't know anything
5451 Indeed, from LyX's point of view, LaTeX is just one of several
5452 \begin_inset Quotes eld
5456 \begin_inset Quotes erd
5459 in which it is capable of producing output.
5460 Other such formats are DocBook, plaintext, and XHTML.
5461 LaTeX is, of course, a particularly important format, but very little of
5462 the information LyX has about LaTeX is actually contained in the program
5467 \begin_layout Plain Layout
5468 Some commands are sufficiently complex that they are
5469 \begin_inset Quotes eld
5473 \begin_inset Quotes erd
5477 But the developers generally regard this as a Bad Thing.
5482 Rather, that information, even for the standard classes like
5483 \begin_inset Flex Code
5486 \begin_layout Plain Layout
5492 , is contained in `layout files'.
5493 Similarly, LyX itself does not know much about DocBook or XHTML.
5494 What it knows is contained in layout files.
5497 \begin_layout Standard
5498 You can think of the layout file for a given document class as a translation
5499 manual between LyX constructs---paragraphs with their corresponding styles,
5500 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5502 Almost everything LyX knows about
5503 \begin_inset Flex Code
5506 \begin_layout Plain Layout
5512 , for example, is contained in the file
5513 \begin_inset Flex Code
5516 \begin_layout Plain Layout
5522 and in various other files it includes.
5523 For this reason, anyone intending to write layout files should plan to
5524 study the existing files.
5525 A good place to start is with
5526 \begin_inset Flex Code
5529 \begin_layout Plain Layout
5535 , which is included in
5536 \begin_inset Flex Code
5539 \begin_layout Plain Layout
5546 \begin_inset Flex Code
5549 \begin_layout Plain Layout
5555 , and many of the other layout files for document classes.
5556 This file is where sections and the like are defined:
5557 \begin_inset Flex Code
5560 \begin_layout Plain Layout
5566 tells LyX how paragraphs that are marked with the Section, Subsection,
5567 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5570 \begin_inset Flex Code
5573 \begin_layout Plain Layout
5579 file basically just includes several of these
5580 \begin_inset Flex Code
5583 \begin_layout Plain Layout
5592 \begin_layout Standard
5593 Defining the LyX--LaTeX correspondence is not the only thing layout files
5595 Their other job is to define how the LyX constructs themselves will appear
5597 The fact that layout files have these two jobs is often a source of confusion,
5598 because they are completely separate.
5599 Telling LyX how to translate a certain paragraph style into LaTeX does
5600 not tell LyX how to display it; conversely, telling LyX how to display
5601 a certain paragraph style does not tell LyX how to translate it into LaTeX
5602 (let alone tell LaTeX how to display it).
5603 So, in general, when you define a new LyX construct, you must always do
5604 two quite separate things: (i)
5605 \begin_inset space ~
5608 tell LyX how to translate it into LaTeX and (ii)
5609 \begin_inset space ~
5612 tell LyX how to display it.
5615 \begin_layout Standard
5616 Much the same is true, of course, as regards LyX's other backend formats,
5617 though XHTML is in some ways different, because in that case LyX
5621 able, to some extent, to use information about how it should display a
5622 paragraph on the screen to output information (in the form of CSS) about
5623 how the paragraph should be displayed in a browser.
5624 Even in this case, however, the distinction between what LyX does internally
5625 and how things are rendered externally remains in force, and the two can
5626 be controlled separately.
5628 \begin_inset CommandInset ref
5630 reference "sec:Tags-for-XHTML"
5637 \begin_layout Section
5638 Installing new LaTeX files
5641 \begin_layout Standard
5642 Some installations may not include a LaTeX package or class file that you
5643 would like to use within LyX.
5644 For example, you might need FoilTeX, a package for preparing slides for
5645 overhead projectors.
5646 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5647 a user interface for installing such packages.
5648 For example, with MiKTeX, you start the program
5649 \begin_inset Quotes eld
5653 \begin_inset space ~
5657 \begin_inset Quotes erd
5660 to get a list of available packages.
5661 To install one of them, right click on it or use the corresponding toolbar
5665 \begin_layout Standard
5666 If your LaTeX distribution does not provide such a `package manager', or
5667 if the package is not available from your distribution, then follow these
5668 steps to install it manually:
5671 \begin_layout Enumerate
5672 Get the package from
5673 \begin_inset CommandInset href
5676 target "http://www.ctan.org/"
5683 \begin_layout Enumerate
5684 If the package contains a file with the ending
5685 \begin_inset Quotes eld
5689 \begin_inset Flex Code
5692 \begin_layout Plain Layout
5699 \begin_inset Quotes erd
5702 (is the case for FoilTeX) then open a console, change to the folder of
5703 this file and execute the command
5704 \begin_inset Flex Code
5707 \begin_layout Plain Layout
5714 You have now unpacked the package and have all files to install it.
5715 Most LaTeX-packages are not packed and you can skip this step.
5718 \begin_layout Enumerate
5719 Now you need to decide if the package should be available for all users
5724 \begin_layout Enumerate
5725 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5726 for all users on your system, then install it in your `local' TeX tree,
5727 otherwise install it in your own `user' TeX tree.
5728 Where these trees should be created, if they do not already exist, depends
5730 To find this out, look in the file
5731 \begin_inset Flex Code
5734 \begin_layout Plain Layout
5744 \begin_layout Plain Layout
5745 This is usually in the directory
5746 \begin_inset Flex Code
5749 \begin_layout Plain Layout
5755 , though you can execute the command
5756 \begin_inset Flex Code
5759 \begin_layout Plain Layout
5770 The location of the `local' TeX tree is defined by the
5771 \begin_inset Flex Code
5774 \begin_layout Plain Layout
5780 variable; this is usually somewhere like
5781 \begin_inset Flex Code
5784 \begin_layout Plain Layout
5785 /usr/local/share/texmf
5791 The location of the `user' TeX tree is defined by
5792 \begin_inset Flex Code
5795 \begin_layout Plain Layout
5802 \begin_inset Flex Code
5805 \begin_layout Plain Layout
5812 (If these variables are not predefined, you have to define them.) You'll
5813 probably need root permissions to create or modify the `local' tree, but
5814 not for your `user' tree.
5815 \begin_inset Newline newline
5818 In general, it is recommended to install in the user tree because your user
5819 will not be modified or even overwritten when you upgrade your system.
5820 It will typically also be backed up together with everything else when
5821 you backup your home directory (which, of course, you do on a regular basis).
5824 \begin_layout Enumerate
5825 On Windows, if you want the new package to be available for all users on
5826 your system, change to the folder where LaTeX is installed and then change
5828 \begin_inset Flex Code
5831 \begin_layout Plain Layout
5842 (For MiKTeX, this would be by default the folder
5843 \begin_inset Flex Code
5846 \begin_layout Plain Layout
5864 \begin_layout Plain Layout
5865 Note that this will be the correct path only on English installations.
5866 On a German one, it would be
5867 \begin_inset Flex Code
5870 \begin_layout Plain Layout
5884 , and similarly for other languages.
5889 Create there a new folder
5890 \begin_inset Flex Code
5893 \begin_layout Plain Layout
5899 and copy all files of the package into it.
5901 \begin_inset Newline newline
5904 If the package should only available for you or you don't have admin permissions
5905 , do the same, but in the local LaTeX folder.
5907 \begin_inset space \thinspace{}
5911 \begin_inset space ~
5914 2.8 under Windows XP, this would be the folder:
5915 \begin_inset Newline newline
5921 \begin_inset Flex Code
5924 \begin_layout Plain Layout
5927 Documents and Settings
5939 \begin_inset Newline newline
5945 \begin_inset Phantom HPhantom
5948 \begin_layout Plain Layout
5959 \begin_inset Flex Code
5962 \begin_layout Plain Layout
5975 \begin_inset Newline newline
5978 On Vista, it would be:
5979 \begin_inset Newline newline
5983 \begin_inset Flex Code
5986 \begin_layout Plain Layout
6012 \begin_layout Enumerate
6013 Now one only need to tell LaTeX that there are new files.
6014 This depends on the used LaTeX-Distribution:
6018 \begin_layout Enumerate
6019 For TeXLive execute the command
6020 \begin_inset Flex Code
6023 \begin_layout Plain Layout
6030 If you installed the package for all users, then you will probably need
6031 to have root permissions for that.
6034 \begin_layout Enumerate
6035 For MiKTeX, if you have installed the package for all users, start the program
6037 \begin_inset Quotes eld
6041 \begin_inset space ~
6045 \begin_inset Quotes erd
6048 and press the button marked
6049 \begin_inset Quotes eld
6053 \begin_inset Quotes erd
6057 Otherwise start the program
6058 \begin_inset Quotes eld
6062 \begin_inset Quotes erd
6069 \begin_layout Enumerate
6070 Finally, you need to tell LyX that there are new packages available.
6071 So, in LyX, use the menu
6072 \begin_inset Flex MenuItem
6075 \begin_layout Plain Layout
6078 \SpecialChar \menuseparator
6084 and then restart LyX.
6087 \begin_layout Standard
6088 Now the package is installed.
6089 In our example, the document class
6090 \begin_inset Flex Code
6093 \begin_layout Plain Layout
6095 \begin_inset space ~
6102 \begin_layout Plain Layout
6114 will now be available under
6115 \begin_inset Flex MenuItem
6118 \begin_layout Plain Layout
6119 Document\SpecialChar \menuseparator
6120 Settings\SpecialChar \menuseparator
6130 \begin_layout Standard
6131 If you would like to use a LaTeX document class that is not even listed
6133 \begin_inset Flex MenuItem
6136 \begin_layout Plain Layout
6137 Document\SpecialChar \menuseparator
6138 Settings\SpecialChar \menuseparator
6144 , then you need to create a `layout' file for it.
6145 That is the topic of the next section.
6148 \begin_layout Section
6149 Types of layout files
6152 \begin_layout Standard
6153 This section describes the various sorts of LyX files that contain layout
6155 These files describe various paragraph and character styles, determining
6156 how LyX should display them and how they should be translated into LaTeX,
6157 DocBook, XHTML, or whatever output format is being used.
6161 \begin_layout Standard
6162 We shall try to provide a thorough description of the process of writing
6164 However, there are so many different types of documents supported even
6165 by just LaTeX that we can't hope to cover every different possibility or
6166 problem you might encounter.
6167 The LyX users' list is frequented by people with lots of experience with
6168 layout design who are willing to share what they've learned, so please
6169 feel free to ask questions there.
6172 \begin_layout Standard
6173 As you prepare to write a new layout, it is extremely helpful to look at
6174 the layouts distributed with LyX.
6175 If you write a LyX layout for a LaTeX document class that might also be
6176 used by others, or write a module that might be useful to others, then
6177 you should consider posting your layout to the
6178 \begin_inset CommandInset href
6180 name "layout section on the LyX wiki"
6181 target "http://wiki.lyx.org/Layouts/Layouts"
6185 or even to the LyX developers' list, so that it might be included in LyX
6190 \begin_layout Plain Layout
6191 Note that LyX is licensed under the General Public License, so any material
6192 that is contributed to LyX must be similarly licensed.
6200 \begin_layout Subsection
6202 \begin_inset CommandInset label
6204 name "sub:Layout-modules"
6211 \begin_layout Standard
6212 We have spoken to this point about `layout files'.
6213 But there are different sorts of files that contain layout information.
6214 Layout files, strictly so called, have the
6215 \begin_inset Flex Code
6218 \begin_layout Plain Layout
6224 extension and provide LyX with information about document classes.
6225 As of LyX 1.6, however, layout information can also be contained in layout
6231 \begin_inset Flex Code
6234 \begin_layout Plain Layout
6241 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6242 some modules—such as the
6243 \begin_inset Flex Code
6246 \begin_layout Plain Layout
6252 module—specifically provide support for one package.
6253 In a sense, layout modules are similar to included
6257 \begin_layout Plain Layout
6258 These can have any extension, but by convention have the
6259 \begin_inset Flex Code
6262 \begin_layout Plain Layout
6274 \begin_inset Flex Code
6277 \begin_layout Plain Layout
6283 —in that modules are not specific to a given document class but may be used
6284 with many different classes.
6285 The difference is that using an included file with
6286 \begin_inset Flex Code
6289 \begin_layout Plain Layout
6295 requires editing that file.
6296 Modules, by contrast, are selected in the
6297 \begin_inset Flex MenuItem
6300 \begin_layout Plain Layout
6301 Document\SpecialChar \menuseparator
6310 \begin_layout Standard
6311 Building modules is the easiest way to get started with layout editing,
6312 since it can be as simple as adding a single new paragraph style or flex
6314 But modules may, in principle, contain anything a layout file can contain.
6317 \begin_layout Standard
6318 After creating a new module and copying it to the
6319 \begin_inset Flex Code
6322 \begin_layout Plain Layout
6328 folder, you will need to reconfigure and then restart LyX for the module
6329 to appear in the menu.
6330 However, changes you make to the module will be seen immediately, if you
6332 \begin_inset Flex MenuItem
6335 \begin_layout Plain Layout
6336 Document\SpecialChar \menuseparator
6342 , highlight something, and then hit
6343 \begin_inset Quotes eld
6347 \begin_inset Quotes erd
6353 It is strongly recommended that you save your work before doing this
6358 it is strongly recommended that you not attempt to edit modules while simultaneo
6359 usly working on actual documents
6362 Though of course the developers strive to keep LyX stable in such situations,
6363 syntax errors and the like in your module file could cause strange behavior.
6366 \begin_layout Subsubsection
6370 \begin_layout Standard
6371 Modules are to LyX as packages are to LaTeX.
6372 Sometimes, however, you find yourself wanting a specific inset or character
6373 style just for one document and writing a module that will also be available
6374 to other documents makes little sense.
6375 What you need is LyX's
6376 \begin_inset Quotes eld
6380 \begin_inset Quotes erd
6386 \begin_layout Standard
6387 You will find it under
6389 Document\SpecialChar \menuseparator
6390 Settings\SpecialChar \menuseparator
6394 The large text box allows you to enter anything that you might enter in
6395 a layout file or module.
6396 You can think of a document's local layout, in fact, as a module that belongs
6398 So, in particular, you must enter a
6399 \begin_inset Flex Code
6402 \begin_layout Plain Layout
6409 Any format is acceptable, but one would normally use the format current
6411 (In LyX 2.0, the current layout format is 35.) You should be aware that local
6412 layout is not supported by versions of LyX prior to 1.6, so you should not
6413 use it if you want to be able to export your document to LyX 1.5 or earlier
6414 (without, that is, losing the local layout information).
6415 If you wish to be able to export to 1.6---local layout is supported in 1.6,
6416 though there is no UI for it---then you should use format 11 and, of course,
6417 use only layout constructs that were available in LyX 1.6.
6420 \begin_layout Standard
6421 When you have entered something in the
6422 \begin_inset Flex Code
6425 \begin_layout Plain Layout
6431 pane, LyX will enable the
6432 \begin_inset Quotes eld
6436 \begin_inset Quotes erd
6439 button at the bottom.
6440 Clicking this button will cause LyX to determine whether what you have
6441 entered is valid layout information for the chosen format.
6442 LyX will report the result but, unfortunately, will not tell you what errors
6443 there might have been.
6444 These will be written to the terminal, however, if LyX is started from
6446 You will not be permitted to save your local layout until you have entered
6450 \begin_layout Standard
6451 The warnings at the end of the previous section apply here, too.
6452 Do not play with local layout while you are actually working, especially
6453 if you have not saved your document.
6454 That said, using local layout with a test document can be a very convenient
6455 way to try out layout ideas, or even to start developing a module.
6458 \begin_layout Subsection
6460 \begin_inset Flex MenuItem
6463 \begin_layout Plain Layout
6472 \begin_layout Standard
6473 There are two situations you are likely to encounter when wanting to support
6474 a new LaTeX document class, involving style (
6475 \begin_inset Flex Code
6478 \begin_layout Plain Layout
6484 ) files and LaTeX2e class (
6485 \begin_inset Flex Code
6488 \begin_layout Plain Layout
6495 Supporting a style file is usually fairly easy.
6496 Supporting a new class file is a bit harder.
6497 We'll discuss the former in this section and the latter in the next.
6498 Similar remarks apply, of course, if you want to support a new DocBook
6502 \begin_layout Standard
6503 The easier case is the one in which your new document class is provided
6504 as a style file that is to be used in conjunction with an already supported
6506 For the sake of the example, we'll assume that the style file is called
6508 \begin_inset Flex MenuItem
6511 \begin_layout Plain Layout
6517 and that it is meant to be used with
6518 \begin_inset Flex MenuItem
6521 \begin_layout Plain Layout
6527 , which is a standard class.
6531 \begin_layout Standard
6532 Start by copying the existing class's layout file into your local directory:
6536 \begin_layout Plain Layout
6537 Of course, which directory is your local directory will vary by platform,
6538 and LyX allows you to specify your local directory on startup, too, using
6540 \begin_inset Flex Code
6543 \begin_layout Plain Layout
6557 \begin_layout LyX-Code
6558 cp report.layout ~/.lyx/layouts/myclass.layout
6561 \begin_layout Standard
6563 \begin_inset Flex Code
6566 \begin_layout Plain Layout
6572 and change the line:
6575 \begin_layout LyX-Code
6578 DeclareLaTeXClass{report}
6581 \begin_layout Standard
6585 \begin_layout LyX-Code
6588 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6591 \begin_layout Standard
6595 \begin_layout LyX-Code
6597 \begin_inset Newline newline
6603 \begin_inset Newline newline
6609 \begin_layout Standard
6610 near the top of the file.
6613 \begin_layout Standard
6614 Start LyX and select
6615 \begin_inset Flex MenuItem
6618 \begin_layout Plain Layout
6619 Tools\SpecialChar \menuseparator
6626 Then restart LyX and try creating a new document.
6628 \begin_inset Flex MenuItem
6631 \begin_layout Plain Layout
6637 " as a document class option in the
6638 \begin_inset Flex MenuItem
6641 \begin_layout Plain Layout
6642 Document\SpecialChar \menuseparator
6649 It is likely that some of the sectioning commands and such in your new
6650 class will work differently from how they worked in the base class—
6651 \begin_inset Flex Code
6654 \begin_layout Plain Layout
6660 in this example—so you can fiddle around with the settings for the different
6661 sections if you wish.
6662 The layout information for sections is contained in
6663 \begin_inset Flex Code
6666 \begin_layout Plain Layout
6672 , but you do not need to copy and change this file.
6673 Instead, you can simply add your changes to your layout file, after the
6675 \begin_inset Flex Code
6678 \begin_layout Plain Layout
6684 , which itself includes
6685 \begin_inset Flex Code
6688 \begin_layout Plain Layout
6695 For example, you might add these lines:
6698 \begin_layout LyX-Code
6702 \begin_layout LyX-Code
6706 \begin_layout LyX-Code
6710 \begin_layout LyX-Code
6714 \begin_layout LyX-Code
6718 \begin_layout Standard
6719 to change the font for chapter headings to sans-serif.
6720 This will override (or, in this case, add to) the existing declaration
6721 for the Chapter style.
6725 \begin_layout Standard
6726 Your new package may also provide commands or environments not present in
6728 In this case, you will want to add these to the layout file.
6730 \begin_inset CommandInset ref
6732 reference "sec:TextClass"
6736 for information on how to do so.
6739 \begin_layout Standard
6741 \begin_inset Flex MenuItem
6744 \begin_layout Plain Layout
6750 can be used with several different document classes, and even if it cannot,
6751 you might find it easiest just to write a module that you can load with
6753 The simplest possible such module would be:
6756 \begin_layout LyX-Code
6759 DeclareLyXModule{My Package}
6762 \begin_layout LyX-Code
6766 \begin_layout LyX-Code
6767 #Support for mypkg.sty.
6770 \begin_layout LyX-Code
6772 \begin_inset Newline newline
6778 \begin_layout LyX-Code
6780 \begin_inset Newline newline
6786 \begin_layout LyX-Code
6788 \begin_inset Newline newline
6794 \begin_inset Newline newline
6800 \begin_layout Standard
6801 A more complex module might modify the behavior of some existing constructs
6802 or define some new ones.
6804 \begin_inset CommandInset ref
6806 reference "sec:TextClass"
6813 \begin_layout Subsection
6815 \begin_inset Flex MenuItem
6818 \begin_layout Plain Layout
6827 \begin_layout Standard
6828 There are two possibilities here.
6829 One is that the class file is itself based upon an existing document class.
6830 For example, many thesis classes are based upon
6831 \begin_inset Flex MenuItem
6834 \begin_layout Plain Layout
6841 To see whether yours is, look for a line like
6844 \begin_layout LyX-Code
6850 \begin_layout Standard
6852 If so, then you may proceed largely as in the previous section, though
6854 \begin_inset Flex Code
6857 \begin_layout Plain Layout
6863 line will be different.
6864 If your new class is
6865 \begin_inset Flex Code
6868 \begin_layout Plain Layout
6874 and it is based upon
6875 \begin_inset Flex Code
6878 \begin_layout Plain Layout
6884 , then the line should read:
6888 \begin_layout Plain Layout
6889 And it will be easiest if you save the file to
6890 \begin_inset Flex Code
6893 \begin_layout Plain Layout
6899 : LyX assumes that the document class has the same name as the layout file.
6908 \begin_layout LyX-Code
6911 DeclareLaTeXClass[thesis,book]{thesis}
6914 \begin_layout Standard
6915 If, on the other hand, the new class is not based upon an existing class,
6916 you will probably have to
6917 \begin_inset Quotes eld
6921 \begin_inset Quotes erd
6925 We strongly suggest copying an existing layout file which uses a similar
6926 LaTeX class and then modifying it, if you can do so.
6927 At least use an existing file as a starting point so you can find out what
6928 items you need to worry about.
6929 Again, the specifics are covered below.
6932 \begin_layout Subsection
6934 \begin_inset CommandInset label
6936 name "sub:Creating-Templates"
6943 \begin_layout Standard
6944 Once you have written a layout file for a new document class, you might
6945 want to consider writing a
6950 A template acts as a kind of tutorial for your layout, showing how it might
6951 be used, though containing dummy content.
6952 You can of course look at the various templates included with LyX for ideas.
6955 \begin_layout Standard
6956 Templates are created just like usual documents: using LyX.
6957 The only difference is that usual documents contain all possible settings,
6958 including the font scheme and the paper size.
6959 Usually a user doesn't want a template to overwrite his preferred settings
6960 for such parameters.
6961 For that reason, the designer of a template should remove the corresponding
6963 \begin_inset Flex Code
6966 \begin_layout Plain Layout
6975 \begin_inset Flex Code
6978 \begin_layout Plain Layout
6986 from the template LyX file.
6987 This can be done with any simple text-editor, for example
6988 \begin_inset Flex Code
6991 \begin_layout Plain Layout
6998 \begin_inset Flex Code
7001 \begin_layout Plain Layout
7011 \begin_layout Standard
7012 Put the edited template files you create in
7013 \begin_inset Flex Code
7016 \begin_layout Plain Layout
7022 , copy the ones you use from the global template directory in
7023 \begin_inset Flex Code
7026 \begin_layout Plain Layout
7032 to the same place, and redefine the template path in the
7033 \begin_inset Flex MenuItem
7036 \begin_layout Plain Layout
7037 Tools\SpecialChar \menuseparator
7038 Preferences\SpecialChar \menuseparator
7047 \begin_layout Standard
7048 Note, by the way, that there is a template which has a particular meaning:
7050 \begin_inset Flex Code
7053 \begin_layout Plain Layout
7060 This template is loaded every time you create a new document with
7061 \begin_inset Flex MenuItem
7064 \begin_layout Plain Layout
7065 File\SpecialChar \menuseparator
7071 in order to provide useful defaults.
7072 To create this template from inside LyX, all you have to do is to open
7073 a document with the correct settings, and use the
7074 \begin_inset Flex MenuItem
7077 \begin_layout Plain Layout
7078 Save as Document Defaults
7086 \begin_layout Subsection
7087 Upgrading old layout files
7090 \begin_layout Standard
7091 The format of layout files changes with each LyX release, so old layout
7092 files need to be converted to the new format.
7093 This process has been automated since LyX 1.4: If LyX reads a layout file
7094 in an older format, it automatically calls the script
7095 \begin_inset Flex Code
7098 \begin_layout Plain Layout
7104 to convert it to a temporary file in current format.
7105 The original file is left untouched.
7106 If you use the layout file often, then, you may want to convert it permanently,
7107 so that LyX does not have to do so itself every time.
7108 To do this, you can call the converter manually:
7111 \begin_layout LyX-Code
7112 mv myclass.layout myclass.old
7115 \begin_layout LyX-Code
7116 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
7119 \begin_layout Standard
7121 \begin_inset Flex Code
7124 \begin_layout Plain Layout
7130 with the name of your LyX system directory, of course.
7133 \begin_layout Standard
7134 Note that manual conversion does not affect included files, so these will
7135 have to be converted separately.
7138 \begin_layout Section
7139 \begin_inset CommandInset label
7141 name "sec:TextClass"
7145 The layout file format
7148 \begin_layout Standard
7149 When it's finally time to get your hands dirty and create or edit your own
7150 layout file, the following sections describe what you're up against.
7151 Our advice is to go slowly, save and test often, listen to soothing music,
7152 and enjoy one or two of your favorite adult beverages; more if you are
7153 getting particularly stuck.
7154 It's really not that hard, except that the multitude of options can become
7155 overwhelming if you try to do too much in one sitting.
7156 Go have another adult beverage, just for good measure.
7159 \begin_layout Standard
7160 Note that all the tags used in layout files are case-insensitive.
7162 \begin_inset Flex Code
7165 \begin_layout Plain Layout
7172 \begin_inset Flex Code
7175 \begin_layout Plain Layout
7182 \begin_inset Flex Code
7185 \begin_layout Plain Layout
7191 are really the same tag.
7192 The possible values are printed in brackets after the feature's name.
7193 The default value if a feature isn't specified inside a text class-description
7195 \begin_inset Flex Code
7198 \begin_layout Plain Layout
7207 If the argument has a data type like
7208 \begin_inset Quotes eld
7212 \begin_inset Quotes erd
7216 \begin_inset Quotes eld
7220 \begin_inset Quotes erd
7223 , the default is shown like this:
7224 \begin_inset Flex Code
7227 \begin_layout Plain Layout
7238 \begin_layout Subsection
7239 The document class declaration
7240 \change_inserted -712698321 1349766602
7246 \begin_layout Standard
7247 Lines in a layout file which begin with
7248 \begin_inset Flex Code
7251 \begin_layout Plain Layout
7258 There is one exception to this rule.
7260 \begin_inset Flex Code
7263 \begin_layout Plain Layout
7269 files should begin with
7270 \change_deleted -712698321 1349766533
7274 \change_inserted -712698321 1349766536
7280 \begin_layout LyX-Code
7283 #% Do not delete the line below; configure depends on this
7286 \begin_layout LyX-Code
7292 \change_deleted -712698321 1349766193
7294 \change_inserted -712698321 1349766201
7295 Article (Standard Class)
7298 \change_inserted -712698321 1349766538
7302 \begin_layout LyX-Code
7304 \change_inserted -712698321 1349766581
7309 DeclareCategory{Articles}
7314 \begin_layout Standard
7316 \change_inserted -712698321 1349766695
7320 \change_inserted -712698321 1349766626
7324 \change_deleted -712698321 1349766628
7326 \change_inserted -712698321 1349766628
7329 used when you (re)configure LyX.
7330 The layout file is read by the LaTeX script
7331 \begin_inset Flex Code
7334 \begin_layout Plain Layout
7340 , in a special mode where
7341 \begin_inset Flex Code
7344 \begin_layout Plain Layout
7351 The first line is just a LaTeX comment,
7352 \change_deleted -712698321 1349766656
7355 the second one contains the
7356 \change_inserted -712698321 1349766650
7359 declaration of the text class
7360 \change_inserted -712698321 1349766689
7361 , and the third line contains the optional classification of the class
7364 If these lines appear in a file named
7365 \begin_inset Flex Code
7368 \begin_layout Plain Layout
7374 , then they define a text class of name
7375 \begin_inset Flex Code
7378 \begin_layout Plain Layout
7384 (the name of the layout file) which uses the LaTeX document class
7385 \begin_inset Flex Code
7388 \begin_layout Plain Layout
7394 (the default is to use the same name as the layout).
7396 \begin_inset Quotes eld
7400 \change_deleted -712698321 1349766253
7402 \change_inserted -712698321 1349766260
7403 Article (Standard Class)
7406 \begin_inset Quotes erd
7409 that appears above is used as a description of the text class in the
7410 \begin_inset Flex MenuItem
7413 \begin_layout Plain Layout
7414 Document\SpecialChar \menuseparator
7422 \change_inserted -712698321 1349767097
7424 \begin_inset Quotes eld
7428 \begin_inset Quotes erd
7431 in the example) is also used in the
7432 \begin_inset Flex MenuItem
7435 \begin_layout Plain Layout
7437 \change_inserted -712698321 1349766801
7438 Document\SpecialChar \menuseparator
7444 dialog: the text classes are grouped by these categories (which are usually
7445 genres, so typical categories are
7446 \begin_inset Quotes eld
7450 \begin_inset Quotes erd
7454 \begin_inset Quotes eld
7458 \begin_inset Quotes erd
7462 \begin_inset Quotes eld
7466 \begin_inset Quotes erd
7470 \begin_inset Quotes eld
7474 \begin_inset Quotes erd
7478 \begin_inset Quotes eld
7482 \begin_inset Quotes erd
7486 \begin_inset Quotes eld
7490 \begin_inset Quotes erd
7494 If no category has been declared, the class will be put in the
7495 \begin_inset Quotes eld
7499 \begin_inset Quotes erd
7507 \begin_layout Standard
7508 Let's assume that you wrote your own text class that uses the
7509 \begin_inset Flex Code
7512 \begin_layout Plain Layout
7518 document class, but where you changed the appearance of the section headings.
7519 If you put it in a file
7520 \begin_inset Flex Code
7523 \begin_layout Plain Layout
7529 , the header of this file should be:
7532 \begin_layout LyX-Code
7535 #% Do not delete the line below; configure depends on this
7538 \begin_layout LyX-Code
7543 DeclareLaTeXClass[article]{
7544 \change_deleted -712698321 1349766303
7546 \change_inserted -712698321 1349766303
7550 \change_deleted -712698321 1349766338
7552 \change_inserted -712698321 1349766338
7556 \change_deleted -712698321 1349766340
7558 \change_inserted -712698321 1349766340
7562 \change_deleted -712698321 1349766343
7564 \change_inserted -712698321 1349766343
7568 \change_inserted -712698321 1349767223
7572 \begin_layout LyX-Code
7574 \change_inserted -712698321 1349767223
7579 DeclareCategory{Articles}
7584 \begin_layout Standard
7585 This declares a text class
7586 \begin_inset Flex Code
7589 \begin_layout Plain Layout
7595 , associated with the LaTeX document class
7596 \begin_inset Flex Code
7599 \begin_layout Plain Layout
7606 \begin_inset Quotes eld
7610 \change_deleted -712698321 1349766329
7612 \change_inserted -712698321 1349766329
7616 \change_deleted -712698321 1349766347
7618 \change_inserted -712698321 1349766347
7622 \change_deleted -712698321 1349766350
7624 \change_inserted -712698321 1349766350
7628 \change_deleted -712698321 1349766352
7630 \change_inserted -712698321 1349766352
7634 \begin_inset Quotes erd
7638 If your text class depends on several packages, you can declare it as:
7641 \begin_layout LyX-Code
7644 #% Do not delete the line below; configure depends on this
7647 \begin_layout LyX-Code
7652 DeclareLaTeXClass[article,foo.sty]{
7653 \change_deleted -712698321 1349766366
7655 \change_inserted -712698321 1349766366
7659 \change_deleted -712698321 1349766369
7661 \change_inserted -712698321 1349766369
7665 \change_deleted -712698321 1349766371
7667 \change_inserted -712698321 1349766371
7671 \change_deleted -712698321 1349766374
7673 \change_inserted -712698321 1349766374
7677 \change_inserted -712698321 1349767240
7681 \begin_layout LyX-Code
7683 \change_inserted -712698321 1349767240
7688 DeclareCategory{Articles}
7693 \begin_layout Standard
7694 This indicates that your text class uses the
7695 \begin_inset Flex Code
7698 \begin_layout Plain Layout
7705 Finally, it is also possible to declare classes for DocBook code.
7706 Typical declarations will look like:
7709 \begin_layout LyX-Code
7712 #% Do not delete the line below; configure depends on this
7715 \begin_layout LyX-Code
7720 DeclareDocBookClass[article]{SGML (DocBook
7721 \change_deleted -712698321 1349766387
7723 \change_inserted -712698321 1349766387
7727 \change_inserted -712698321 1349767247
7731 \begin_layout LyX-Code
7733 \change_inserted -712698321 1349767302
7738 DeclareCategory{Articles (DocBook)}
7743 \begin_layout Standard
7744 Note that these declarations can also be given an optional parameter declaring
7745 the name of the document class (but not a list).
7748 \begin_layout Standard
7749 So, to be as explicit as possible, the form of the layout declaration is:
7752 \begin_layout LyX-Code
7757 DeclareLaTeXClass[class,package.sty]{layout description}
7758 \change_inserted -712698321 1349767329
7762 \begin_layout LyX-Code
7764 \change_inserted -712698321 1349767339
7769 DeclareCategory{category}
7774 \begin_layout Standard
7775 The class need only be specified if the name of the LaTeX class file and
7776 the name of the layout file are different or if there are packages to load.
7777 If the name of the class file is not specified, then LyX will simply assume
7778 that it is the same as the name of the layout file.
7781 \begin_layout Standard
7782 When the text class has been modified to your taste, all you have to do
7783 is to copy it either to
7784 \begin_inset Flex Code
7787 \begin_layout Plain Layout
7794 \begin_inset Flex Code
7797 \begin_layout Plain Layout
7804 \begin_inset Flex MenuItem
7807 \begin_layout Plain Layout
7808 Tools\SpecialChar \menuseparator
7814 , exit LyX and restart.
7815 Then your new text class should be available along with the others.
7818 \begin_layout Standard
7819 Once the layout file is installed, you can edit it and see your changes
7820 without having to reconfigure or to restart LyX.
7825 \begin_layout Plain Layout
7826 In versions of LyX prior to 1.6, this was not true.
7827 As a result, editing layout files was very time consuming, since you had
7828 constantly to restart LyX to see changes.
7833 You can force a reload of the current layout by using the LyX function
7835 \begin_inset Flex MenuItem
7838 \begin_layout Plain Layout
7845 There is no default binding for this function—though, of course, you can
7846 bind it to a key yourself.
7847 But you will normally use this function simply by entering it in the mini-buffe
7852 \begin_layout Standard
7858 \begin_inset Flex MenuItem
7861 \begin_layout Plain Layout
7867 is very much an `advanced feature'.
7872 recommended that you save your work before using this function.
7877 recommended that you not attempt to edit layout information while simultaneousl
7878 y working on a document that you care about.
7879 Use a test document.
7880 Syntax errors and the like in your layout file could cause peculiar behavior.
7881 In particular, such errors could cause LyX to regard the current layout
7882 as invalid and to attempt to switch to some other layout.
7886 \begin_layout Plain Layout
7887 Really bad syntax errors may even caused LyX to exit.
7888 This is because certain sorts of errors may make LyX unable to read
7898 The LyX team strives to keep LyX stable in such situations, but safe is
7903 \begin_layout Plain Layout
7904 While we're giving advice: make regular backups.
7905 And be nice to your mother.
7913 \begin_layout Subsection
7914 The Module declaration
7917 \begin_layout Standard
7918 A module must begin with a line like the following:
7921 \begin_layout LyX-Code
7924 DeclareLyXModule[endnotes.sty]{Endnotes}
7927 \begin_layout Standard
7928 The mandatory argument, in curly brackets, is the name of the module, as
7930 \begin_inset Flex MenuItem
7933 \begin_layout Plain Layout
7934 Document\SpecialChar \menuseparator
7935 Settings\SpecialChar \menuseparator
7942 The argument in square brackets is optional: It declares any LaTeX packages
7943 on which the module depends.
7944 Please note that only packages about which LyX knows should be listed in
7945 the square brackets.
7949 \begin_layout Plain Layout
7950 The list of such packages is documented only in the source code.
7955 LyX will not check for arbitrary packages.
7956 It is also possible to use the form
7957 \begin_inset Flex MenuItem
7960 \begin_layout Plain Layout
7966 as an optional argument, which declares that the module can only be used
7967 when there exists a conversion chain between the formats `
7968 \begin_inset Flex Code
7971 \begin_layout Plain Layout
7978 \begin_inset Flex Code
7981 \begin_layout Plain Layout
7990 \begin_layout Standard
7991 The module declaration should then be followed by lines like the following
7995 \begin_layout Plain Layout
7996 Preferably in English if the module should be published with LyX.
7997 This description will appear in the list of messages to be translated and
7998 will be thus translated with the next interface update.
8006 \begin_layout LyX-Code
8010 \begin_layout LyX-Code
8011 #Adds an endnote command, in addition to footnotes.
8015 \begin_layout LyX-Code
8016 #You will need to add
8018 theendnotes in TeX code where you
8021 \begin_layout LyX-Code
8022 #want the endnotes to appear.
8026 \begin_layout LyX-Code
8030 \begin_layout LyX-Code
8031 #Requires: somemodule | othermodule
8034 \begin_layout LyX-Code
8035 #Excludes: badmodule
8038 \begin_layout Standard
8039 The description is used in
8040 \begin_inset Flex MenuItem
8043 \begin_layout Plain Layout
8044 Document\SpecialChar \menuseparator
8045 Settings\SpecialChar \menuseparator
8051 to provide the user with information about what the module does.
8053 \begin_inset Flex Code
8056 \begin_layout Plain Layout
8062 line is used to identify other modules with which this one must be used;
8064 \begin_inset Flex Code
8067 \begin_layout Plain Layout
8073 line is used to identify modules with which this one may not be used.
8074 Both are optional, and, as shown, multiple modules should be separated
8075 with the pipe symbol: |.
8076 Note that the required modules are treated disjunctively:
8080 of the required modules must be used.
8085 excluded module may be used.
8086 Note that modules are identified here by their
8091 \begin_inset Flex Code
8094 \begin_layout Plain Layout
8102 \begin_inset Flex Code
8105 \begin_layout Plain Layout
8112 \begin_inset Flex Code
8115 \begin_layout Plain Layout
8124 \begin_layout Subsection
8128 \begin_layout Standard
8129 The first non-comment line of any layout file, included file, or module
8134 contain the file format number:
8137 \begin_layout Description
8138 \begin_inset Flex Code
8141 \begin_layout Plain Layout
8148 \begin_inset Flex Code
8151 \begin_layout Plain Layout
8157 ] The format of the layout file.
8160 \begin_layout Standard
8161 This tag was introduced with LyX 1.4.0.
8162 Layout files from LyX 1.3.x and earlier don't have an explicit file format
8163 and are considered to be of format 1.
8164 The format for the present version of LyX is format 21.
8165 But each version of LyX is capable of reading earlier versions' layout
8166 files, just as they are capable of reading files produced by earlier versions
8168 There is, however, no provision for converting to earlier formats.
8169 So LyX 1.6.x will not read layout files in format 21 but only files in format
8173 \begin_layout Subsection
8174 \begin_inset CommandInset label
8176 name "sub:General-text-class"
8180 General text class parameters
8183 \begin_layout Standard
8184 These are general parameters that govern the behavior of an entire document
8190 mean that they must appear in
8191 \begin_inset Flex Code
8194 \begin_layout Plain Layout
8200 files rather than in modules.
8201 A module can contain any layout tag.)
8204 \begin_layout Description
8205 \begin_inset Flex Code
8208 \begin_layout Plain Layout
8214 Adds information that will be output in the
8215 \begin_inset Flex Code
8218 \begin_layout Plain Layout
8224 block when this document class is output to XHTML.
8225 Typically, this would be used to output CSS style information, but it can
8226 be used for anything that can appear in
8227 \begin_inset Flex Code
8230 \begin_layout Plain Layout
8238 \begin_inset Quotes eld
8242 \begin_inset Flex Code
8245 \begin_layout Plain Layout
8252 \begin_inset Quotes erd
8258 \begin_layout Description
8259 \begin_inset Flex Code
8262 \begin_layout Plain Layout
8268 Adds CSS styling information.
8269 This will either be output in a
8270 \begin_inset Quotes eld
8274 \begin_inset Flex Code
8277 \begin_layout Plain Layout
8284 \begin_inset Quotes erd
8287 block or, if the user has so chosen, to a separate CSS file.Must end with
8289 \begin_inset Quotes eld
8293 \begin_inset Flex Code
8296 \begin_layout Plain Layout
8303 \begin_inset Quotes erd
8309 \begin_layout Description
8310 \begin_inset Flex Code
8313 \begin_layout Plain Layout
8319 Adds information to the document preamble.
8321 \begin_inset Quotes eld
8325 \begin_inset Flex Code
8328 \begin_layout Plain Layout
8335 \begin_inset Quotes erd
8341 \begin_layout Description
8342 \begin_inset Flex Code
8345 \begin_layout Plain Layout
8351 Defines formats for use in the display of bibliographic information.
8353 \begin_inset CommandInset ref
8355 reference "sub:Citation-format-description"
8361 \begin_inset Quotes eld
8365 \begin_inset Flex Code
8368 \begin_layout Plain Layout
8375 \begin_inset Quotes erd
8381 \begin_layout Description
8382 \begin_inset Flex Code
8385 \begin_layout Plain Layout
8391 Describes various global options supported by the document class.
8393 \begin_inset space ~
8397 \begin_inset CommandInset ref
8399 reference "sub:ClassOptions"
8405 \begin_inset Quotes eld
8409 \begin_inset Flex Code
8412 \begin_layout Plain Layout
8419 \begin_inset Quotes erd
8425 \begin_layout Description
8426 \begin_inset Flex Code
8429 \begin_layout Plain Layout
8436 \begin_inset Flex Code
8439 \begin_layout Plain Layout
8448 \begin_inset Flex Code
8451 \begin_layout Plain Layout
8457 ] Whether the class should
8461 to having one or two columns.
8462 Can be changed in the
8463 \begin_inset Flex MenuItem
8466 \begin_layout Plain Layout
8467 Document\SpecialChar \menuseparator
8476 \begin_layout Description
8477 \begin_inset Flex Code
8480 \begin_layout Plain Layout
8487 \begin_inset Flex Code
8490 \begin_layout Plain Layout
8496 ] This sequence defines the properties for a counter.
8497 If the counter does not yet exist, it is created; if it does exist, it
8500 \begin_inset Quotes eld
8504 \begin_inset Flex Code
8507 \begin_layout Plain Layout
8514 \begin_inset Quotes erd
8518 \begin_inset Newline newline
8522 \begin_inset space ~
8526 \begin_inset CommandInset ref
8528 reference "sub:Counters"
8532 for details on counters.
8535 \begin_layout Description
8536 \begin_inset Flex Code
8539 \begin_layout Plain Layout
8545 Sets the default font used to display the document.
8547 \begin_inset space ~
8551 \begin_inset CommandInset ref
8553 reference "sub:Font-description"
8557 for how to declare fonts.
8559 \begin_inset Quotes eld
8563 \begin_inset Flex Code
8566 \begin_layout Plain Layout
8573 \begin_inset Quotes erd
8579 \begin_layout Description
8580 \begin_inset Flex Code
8583 \begin_layout Plain Layout
8590 \begin_inset Flex Code
8593 \begin_layout Plain Layout
8599 Specifies a module to be included by default with this document class.
8600 The module should be specified by filename without the
8601 \begin_inset Flex Code
8604 \begin_layout Plain Layout
8611 The user can still remove the module, but it will be active at the outset.
8612 (This applies only when new files are created, or when this class is chosen
8613 for an existing document.)
8616 \begin_layout Description
8617 \begin_inset Flex Code
8620 \begin_layout Plain Layout
8627 \begin_inset Flex Code
8630 \begin_layout Plain Layout
8636 ] This is the style that will be assigned to new paragraphs, usually
8637 \begin_inset Flex MenuItem
8640 \begin_layout Plain Layout
8647 This will default to the first defined style if not given, but you are
8648 encouraged to use this directive.
8651 \begin_layout Description
8652 \begin_inset Flex Code
8655 \begin_layout Plain Layout
8662 \begin_inset Flex Code
8665 \begin_layout Plain Layout
8671 ] This tag indicates that the module in question—which should be specified
8672 by filename without the
8673 \begin_inset Flex Code
8676 \begin_layout Plain Layout
8682 extension—cannot be used with this document class.
8683 This might be used in a journal-specific layout file to prevent, say, the
8685 \begin_inset Flex Code
8688 \begin_layout Plain Layout
8694 module that numbers theorems by section.
8699 be used in a module.
8700 Modules have their own way of excluding other modules (see
8701 \begin_inset CommandInset ref
8703 reference "sub:Layout-modules"
8710 \begin_layout Description
8711 \begin_inset Flex Code
8714 \begin_layout Plain Layout
8720 Defines a new float.
8722 \begin_inset space ~
8726 \begin_inset CommandInset ref
8728 reference "sub:Floats"
8734 \begin_inset Quotes eld
8738 \begin_inset Flex Code
8741 \begin_layout Plain Layout
8748 \begin_inset Quotes erd
8754 \begin_layout Description
8755 \begin_inset Flex Code
8758 \begin_layout Plain Layout
8764 Sets the information that will be output in the
8765 \begin_inset Flex Code
8768 \begin_layout Plain Layout
8774 block when this document class is output to XHTML.
8775 Note that this will completely override any prior
8776 \begin_inset Flex Code
8779 \begin_layout Plain Layout
8786 \begin_inset Flex Code
8789 \begin_layout Plain Layout
8797 \begin_inset Flex Code
8800 \begin_layout Plain Layout
8806 if you just want to add material to the preamble.) Must end with
8807 \begin_inset Quotes eld
8811 \begin_inset Flex Code
8814 \begin_layout Plain Layout
8821 \begin_inset Quotes erd
8827 \begin_layout Description
8828 \begin_inset Flex Code
8831 \begin_layout Plain Layout
8837 Sets CSS styling information.
8838 This will either be output in a
8839 \begin_inset Quotes eld
8843 \begin_inset Flex Code
8846 \begin_layout Plain Layout
8853 \begin_inset Quotes erd
8856 block or, if the user has so chosen, to a separate CSS file.
8857 Note that this will completely override any prior
8858 \begin_inset Flex Code
8861 \begin_layout Plain Layout
8868 \begin_inset Flex Code
8871 \begin_layout Plain Layout
8879 \begin_inset Flex Code
8882 \begin_layout Plain Layout
8888 if you just want to add material.) Must end with
8889 \begin_inset Quotes eld
8893 \begin_inset Flex Code
8896 \begin_layout Plain Layout
8903 \begin_inset Quotes erd
8909 \begin_layout Description
8910 \begin_inset Flex Code
8913 \begin_layout Plain Layout
8920 \begin_inset Flex Code
8923 \begin_layout Plain Layout
8929 ] The layout to use for the table of contents, bibliography, and so forth,
8930 when the document is output to HTML.
8931 For articles, this should normally be Section; for books, Chapter.
8932 If it is not given, then LyX will attempt to figure out which layout to
8936 \begin_layout Description
8937 \begin_inset Flex Code
8940 \begin_layout Plain Layout
8947 \begin_inset Flex Code
8950 \begin_layout Plain Layout
8956 ] Modifies the properties of the given counter.
8957 If the counter does not exist, the section is ignored.
8959 \begin_inset Quotes eld
8963 \begin_inset Flex Code
8966 \begin_layout Plain Layout
8973 \begin_inset Quotes erd
8977 \begin_inset Newline newline
8981 \begin_inset space ~
8985 \begin_inset CommandInset ref
8987 reference "sub:Counters"
8991 for details on counters.
8994 \begin_layout Description
8995 \begin_inset Flex Code
8998 \begin_layout Plain Layout
9005 \begin_inset Flex Code
9008 \begin_layout Plain Layout
9014 ] Modifies the properties of the given paragraph style.
9015 If the style does not exist, the section is ignored.
9017 \begin_inset Quotes eld
9021 \begin_inset Flex Code
9024 \begin_layout Plain Layout
9031 \begin_inset Quotes erd
9037 \begin_layout Description
9038 \begin_inset Flex Code
9041 \begin_layout Plain Layout
9047 As its name implies, this command allows you to include another layout
9048 definition file within yours to avoid duplicating commands.
9049 Common examples are the standard layout files, for example,
9050 \begin_inset Flex Code
9053 \begin_layout Plain Layout
9059 , which contains most of the basic layouts.
9062 \begin_layout Description
9063 \begin_inset Flex Code
9066 \begin_layout Plain Layout
9072 This section (re-)defines the layout of an inset.
9073 It can be applied to an existing inset or to a new, user-defined inset,
9074 e.g., a new character style.
9076 \begin_inset Quotes eld
9080 \begin_inset Flex Code
9083 \begin_layout Plain Layout
9090 \begin_inset Quotes erd
9094 \begin_inset Newline newline
9098 \begin_inset space ~
9102 \begin_inset CommandInset ref
9104 reference "sub:Flex-insets-and"
9108 for more information.
9112 \begin_layout Description
9113 \begin_inset Flex Code
9116 \begin_layout Plain Layout
9123 \begin_inset Flex Code
9126 \begin_layout Plain Layout
9132 ] A string that indicates the width of the left margin on the screen, for
9134 \begin_inset Quotes eld
9138 \begin_inset Quotes erd
9142 (Note that this is not a `length', like
9143 \begin_inset Quotes eld
9147 \begin_inset Quotes erd
9153 \begin_layout Description
9154 \begin_inset Flex Code
9157 \begin_layout Plain Layout
9164 \begin_inset Flex Code
9167 \begin_layout Plain Layout
9173 ] This command deletes an existing counter, usually one defined in an included
9177 \begin_layout Description
9178 \begin_inset Flex Code
9181 \begin_layout Plain Layout
9187 This command deletes an existing float.
9188 This is particularly useful when you want to suppress a float that has
9189 been defined in an input file.
9192 \begin_layout Description
9193 \begin_inset Flex Code
9196 \begin_layout Plain Layout
9202 This command deletes an existing style.
9203 This is particularly useful when you want to suppress a style that has
9204 be defined in an input file.
9207 \begin_layout Description
9208 \begin_inset Flex Code
9211 \begin_layout Plain Layout
9217 A string indicating the file format (as defined in the Preferences dialog)
9218 produced by this class.
9219 It is mainly useful when
9220 \begin_inset Flex Code
9223 \begin_layout Plain Layout
9229 is `literate' and one wants to define a new type of literate document.
9230 This string is reset to `docbook', `latex', or `literate' when the correspondin
9232 \begin_inset Flex Code
9235 \begin_layout Plain Layout
9241 parameter is encountered.
9244 \begin_layout Description
9245 \begin_inset Flex Code
9248 \begin_layout Plain Layout
9254 A string indicating what sort of output documents using this class will
9256 At present, the options are: `docbook', `latex', and `literate'.
9259 \begin_layout Description
9260 \begin_inset Flex Code
9263 \begin_layout Plain Layout
9270 \begin_inset Flex Code
9273 \begin_layout Plain Layout
9282 \begin_inset Flex Code
9285 \begin_layout Plain Layout
9292 \begin_inset Flex Code
9295 \begin_layout Plain Layout
9301 ] The default pagestyle.
9302 Can be changed in the
9303 \begin_inset Flex MenuItem
9306 \begin_layout Plain Layout
9307 Document\SpecialChar \menuseparator
9316 \begin_layout Description
9317 \begin_inset Flex Code
9320 \begin_layout Plain Layout
9326 Sets the preamble for the LaTeX document.
9327 Note that this will completely override any prior
9328 \begin_inset Flex Code
9331 \begin_layout Plain Layout
9338 \begin_inset Flex Code
9341 \begin_layout Plain Layout
9349 \begin_inset Flex Code
9352 \begin_layout Plain Layout
9358 if you just want to add material to the preamble.) Must end with
9359 \begin_inset Quotes eld
9363 \begin_inset Flex Code
9366 \begin_layout Plain Layout
9373 \begin_inset Quotes erd
9379 \begin_layout Description
9380 \begin_inset Flex Code
9383 \begin_layout Plain Layout
9390 \begin_inset Flex Code
9393 \begin_layout Plain Layout
9400 \begin_inset Flex Code
9403 \begin_layout Plain Layout
9412 \begin_inset Flex Code
9415 \begin_layout Plain Layout
9421 ] Whether the class already provides the feature
9422 \begin_inset Flex Code
9425 \begin_layout Plain Layout
9432 A feature is in general the name of a package (
9433 \begin_inset Flex Code
9436 \begin_layout Plain Layout
9443 \begin_inset Flex Code
9446 \begin_layout Plain Layout
9452 , \SpecialChar \ldots{}
9454 \begin_inset Flex Code
9457 \begin_layout Plain Layout
9464 \begin_inset Flex Code
9467 \begin_layout Plain Layout
9473 ,\SpecialChar \ldots{}
9474 ); the complete list of supported features is unfortunately not documented
9475 outside the LyX source code—but see
9476 \begin_inset Flex Code
9479 \begin_layout Plain Layout
9485 if you're interested.
9487 \begin_inset Flex MenuItem
9490 \begin_layout Plain Layout
9491 Help\SpecialChar \menuseparator
9497 also gives an overview of the supported packages.
9500 \begin_layout Description
9501 \begin_inset Flex Code
9504 \begin_layout Plain Layout
9511 \begin_inset Flex Code
9514 \begin_layout Plain Layout
9520 ] Indicates that this layout provides the functionality of the module mentioned,
9521 which should be specified by the filename without the
9522 \begin_inset Flex Code
9525 \begin_layout Plain Layout
9532 This will typically be used if the layout includes the module directly,
9533 rather than using the
9534 \begin_inset Flex Code
9537 \begin_layout Plain Layout
9543 tag to indicate that it ought to be used.
9544 It could also be used in a module that provided an alternate implementation
9545 of the same functionality.
9548 \begin_layout Description
9549 \begin_inset Flex Code
9552 \begin_layout Plain Layout
9559 \begin_inset Flex Code
9562 \begin_layout Plain Layout
9568 ] Whether the class requires the feature
9569 \begin_inset Flex Code
9572 \begin_layout Plain Layout
9579 Multiple features must be separated by commas.
9580 Note that you can only request supported features.
9582 \begin_inset Flex Code
9585 \begin_layout Plain Layout
9591 for a list of these.)
9594 \begin_layout Description
9595 \begin_inset Flex Code
9598 \begin_layout Plain Layout
9604 A string that indicates the width of the right margin on the screen, for
9606 \begin_inset Quotes eld
9610 \begin_inset Quotes erd
9616 \begin_layout Description
9617 \begin_inset Flex Code
9620 \begin_layout Plain Layout
9626 Sets which divisions get numbered.
9628 \begin_inset Flex Code
9631 \begin_layout Plain Layout
9640 \begin_layout Description
9641 \begin_inset Flex Code
9644 \begin_layout Plain Layout
9651 \begin_inset Flex Code
9654 \begin_layout Plain Layout
9663 \begin_inset Flex Code
9666 \begin_layout Plain Layout
9672 ] Whether the class-default should be printing on one or both sides of the
9674 Can be changed in the
9675 \begin_inset Flex MenuItem
9678 \begin_layout Plain Layout
9679 Document\SpecialChar \menuseparator
9688 \begin_layout Description
9689 \begin_inset Flex Code
9692 \begin_layout Plain Layout
9698 This sequence defines a paragraph style.
9699 If the style does not yet exist, it is created; if it does exist, its parameter
9702 \begin_inset Quotes eld
9706 \begin_inset Flex Code
9709 \begin_layout Plain Layout
9716 \begin_inset Quotes erd
9720 \begin_inset Newline newline
9724 \begin_inset space ~
9728 \begin_inset CommandInset ref
9730 reference "sub:Paragraph-Styles"
9734 for details on paragraph styles.
9737 \begin_layout Description
9738 \begin_inset Flex Code
9741 \begin_layout Plain Layout
9748 \begin_inset Flex Code
9751 \begin_layout Plain Layout
9757 ] The name of the command or environment to be used with
9758 \begin_inset Flex Code
9761 \begin_layout Plain Layout
9770 \begin_layout Description
9771 \begin_inset Flex Code
9774 \begin_layout Plain Layout
9781 \begin_inset Flex Code
9784 \begin_layout Plain Layout
9793 \begin_inset Flex Code
9796 \begin_layout Plain Layout
9802 ] Indicates what kind of markup is used to define the title of a document.
9804 \begin_inset Flex Code
9807 \begin_layout Plain Layout
9813 means that the macro with name
9814 \begin_inset Flex Code
9817 \begin_layout Plain Layout
9823 will be inserted after the last layout which has
9824 \begin_inset Quotes eld
9828 \begin_inset Flex Code
9831 \begin_layout Plain Layout
9838 \begin_inset Quotes erd
9843 \begin_inset Flex Code
9846 \begin_layout Plain Layout
9852 corresponds to the case where the block of paragraphs which have
9853 \begin_inset Quotes eld
9857 \begin_inset Flex Code
9860 \begin_layout Plain Layout
9867 \begin_inset Quotes erd
9870 should be enclosed into the
9871 \begin_inset Flex Code
9874 \begin_layout Plain Layout
9883 \begin_layout Description
9884 \begin_inset Flex Code
9887 \begin_layout Plain Layout
9893 Sets which divisions are included in the table of contents.
9895 \begin_inset Flex Code
9898 \begin_layout Plain Layout
9907 \begin_layout Subsection
9908 \begin_inset Flex Code
9911 \begin_layout Plain Layout
9918 \begin_inset CommandInset label
9920 name "sub:ClassOptions"
9927 \begin_layout Standard
9929 \begin_inset Flex Code
9932 \begin_layout Plain Layout
9938 section can contain the following entries:
9941 \begin_layout Description
9942 \begin_inset Flex Code
9945 \begin_layout Plain Layout
9952 \begin_inset Flex Code
9955 \begin_layout Plain Layout
9961 ] The list of available font sizes for the document's main font, separated
9963 \begin_inset Quotes eld
9967 \begin_inset Flex Code
9970 \begin_layout Plain Layout
9977 \begin_inset Quotes erd
9983 \begin_layout Description
9984 \begin_inset Flex Code
9987 \begin_layout Plain Layout
9993 Used to set the DTD line with XML-based output classes.
9995 \begin_inset space \thinspace{}
9999 \begin_inset Quotes eld
10002 -//OASIS//DTD DocBook V4.2//EN
10003 \begin_inset Quotes erd
10009 \begin_layout Description
10010 \begin_inset Flex Code
10013 \begin_layout Plain Layout
10020 \begin_inset Flex Code
10023 \begin_layout Plain Layout
10024 string="empty|plain|headings|fancy"
10029 ] The list of available page styles, separated by
10030 \begin_inset Quotes eld
10034 \begin_inset Flex Code
10037 \begin_layout Plain Layout
10044 \begin_inset Quotes erd
10050 \begin_layout Description
10051 \begin_inset Flex Code
10054 \begin_layout Plain Layout
10061 \begin_inset Flex Code
10064 \begin_layout Plain Layout
10070 ] Some document class options, separated by a comma, that will be added
10071 to the optional part of the
10072 \begin_inset Flex Code
10075 \begin_layout Plain Layout
10086 \begin_layout Standard
10088 \begin_inset Flex Code
10091 \begin_layout Plain Layout
10097 section must end with
10098 \begin_inset Quotes eld
10102 \begin_inset Flex Code
10105 \begin_layout Plain Layout
10112 \begin_inset Quotes erd
10118 \begin_layout Subsection
10120 \begin_inset CommandInset label
10122 name "sub:Paragraph-Styles"
10129 \begin_layout Standard
10130 A paragraph style description looks like this:
10134 \begin_layout Plain Layout
10135 Note that this will either define a new style or modify an existing one.
10143 \begin_layout LyX-Code
10150 \begin_layout LyX-Code
10154 \begin_layout LyX-Code
10158 \begin_layout Standard
10159 where the following commands are allowed:
10162 \begin_layout Description
10163 \begin_inset Flex Code
10166 \begin_layout Plain Layout
10173 \begin_inset Flex Code
10176 \begin_layout Plain Layout
10181 , left, right, center
10186 ] Paragraph alignment.
10189 \begin_layout Description
10190 \begin_inset Flex Code
10193 \begin_layout Plain Layout
10200 \begin_inset Flex Code
10203 \begin_layout Plain Layout
10208 , left, right, center
10213 ] A comma separated list of permitted alignments.
10214 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
10216 For example a right-aligned or centered enumeration isn't possible.)
10217 \change_inserted -712698321 1353679769
10221 \begin_layout Description
10223 \change_inserted -712698321 1353680268
10224 \begin_inset Flex Code
10227 \begin_layout Plain Layout
10229 \change_inserted -712698321 1353679781
10236 \begin_inset Flex Code
10239 \begin_layout Plain Layout
10241 \change_inserted -712698321 1353679772
10247 ] Defines argument number <int> of a command\SpecialChar \slash{}
10248 environment associated with
10250 This is useful for things like section headings, and only makes sense with
10252 Every (optional or required) argument of a command or environment -- except
10253 for the required argument that is associated with the content of the paragraph
10254 itself -- has a separate definition, where the number specifies the order
10256 The definition must end with
10257 \begin_inset Flex Code
10260 \begin_layout Plain Layout
10262 \change_inserted -712698321 1353680069
10269 So a command with two optional arguments has:
10273 \begin_layout Quote
10275 \change_inserted -712698321 1353680127
10281 \begin_layout Quote
10283 \change_inserted -712698321 1353680195
10289 \begin_layout Quote
10291 \change_inserted -712698321 1353680135
10297 \begin_layout Quote
10299 \change_inserted -712698321 1353680140
10305 \begin_layout Quote
10307 \change_inserted -712698321 1353680197
10313 \begin_layout Quote
10315 \change_inserted -712698321 1353680147
10321 \begin_layout Standard
10323 \change_inserted -712698321 1353680528
10325 \begin_inset Flex Code
10328 \begin_layout Plain Layout
10330 \change_inserted -712698321 1353680412
10336 definition, the following specifications are possible:
10339 \begin_layout Itemize
10341 \change_inserted -712698321 1353691469
10342 \begin_inset Flex Code
10345 \begin_layout Plain Layout
10347 \change_inserted -712698321 1353680543
10356 \begin_inset Flex Code
10359 \begin_layout Plain Layout
10361 \change_inserted -712698321 1353680567
10367 The string that will appear both in the menu (to insert this argument)
10368 and on the argument inset button.
10369 For the menu, you can define an accelerator by appending the respective
10370 character to the string, divided by
10371 \begin_inset Quotes eld
10375 \begin_inset Quotes erd
10379 \begin_inset space \thinspace{}
10384 \begin_inset Flex Code
10387 \begin_layout Plain Layout
10389 \change_inserted -712698321 1353691482
10390 \begin_inset Quotes eld
10394 \begin_inset Quotes erd
10407 \begin_layout Itemize
10409 \change_inserted -712698321 1353680665
10410 \begin_inset Flex Code
10413 \begin_layout Plain Layout
10415 \change_inserted -712698321 1353680616
10422 \begin_inset Flex Code
10425 \begin_layout Plain Layout
10427 \change_inserted -712698321 1353680623
10433 A longer explanatory text that appears in the tooltip when hovering over
10434 the argument inset.
10437 \begin_layout Itemize
10439 \change_inserted -712698321 1353680874
10440 \begin_inset Flex Code
10443 \begin_layout Plain Layout
10445 \change_inserted -712698321 1353680732
10452 \begin_inset Flex Code
10455 \begin_layout Plain Layout
10457 \change_inserted -712698321 1353680738
10463 Declare if this is a mandatory
10464 \change_inserted 2090807402 1353765594
10466 \change_inserted -712698321 1353680874
10468 \change_inserted 2090807402 1353765599
10470 \change_inserted -712698321 1353680874
10472 Mandatory arguments will be output empty if not given, while optional arguments
10473 will not be output at all.
10474 By default, mandatory arguments are delimited by
10475 \begin_inset Flex Code
10478 \begin_layout Plain Layout
10480 \change_inserted -712698321 1353680808
10488 , while optional arguments are delimited by
10489 \begin_inset Flex Code
10492 \begin_layout Plain Layout
10494 \change_inserted -712698321 1353680833
10503 \begin_layout Itemize
10505 \change_inserted -712698321 1353917199
10506 \begin_inset Flex Code
10509 \begin_layout Plain Layout
10511 \change_inserted -712698321 1353680879
10518 \begin_inset Flex Code
10521 \begin_layout Plain Layout
10523 \change_inserted -712698321 1353680874
10529 defines another argument (by its number) which this argument requires to
10530 be output if it is itself output.
10532 \begin_inset space \thinspace{}
10535 g., in LaTeX commands, optional arguments often require previous optional
10536 arguments to be output (at least empty), as in
10537 \begin_inset Flex Code
10540 \begin_layout Plain Layout
10542 \change_inserted -712698321 1353688183
10545 command[][arg]{text}
10553 This can be achieved by the statement
10554 \begin_inset Flex Code
10557 \begin_layout Plain Layout
10559 \change_inserted -712698321 1353681031
10568 \begin_inset Flex Code
10571 \begin_layout Plain Layout
10573 \change_inserted -712698321 1353681045
10584 \begin_layout Itemize
10586 \change_inserted -712698321 1354263104
10587 \begin_inset Flex Code
10590 \begin_layout Plain Layout
10592 \change_inserted -712698321 1353681072
10601 \begin_inset Flex Code
10604 \begin_layout Plain Layout
10606 \change_inserted -712698321 1353681067
10612 defines a custom left delimiter (instead of
10613 \begin_inset Flex Code
10616 \begin_layout Plain Layout
10618 \change_inserted -712698321 1353681127
10627 \begin_inset Flex Code
10630 \begin_layout Plain Layout
10632 \change_inserted -712698321 1353681133
10641 A line break in the output can be indicated by
10642 \begin_inset Flex Code
10645 \begin_layout Plain Layout
10647 \change_inserted -712698321 1354263104
10658 \begin_layout Itemize
10660 \change_inserted -712698321 1354263106
10661 \begin_inset Flex Code
10664 \begin_layout Plain Layout
10666 \change_inserted -712698321 1353681149
10673 \begin_inset Flex Code
10676 \begin_layout Plain Layout
10678 \change_inserted -712698321 1353681146
10684 defines a custom right delimiter (instead of
10685 \begin_inset Flex Code
10688 \begin_layout Plain Layout
10690 \change_inserted -712698321 1353681158
10697 \begin_inset Flex Code
10700 \begin_layout Plain Layout
10702 \change_inserted -712698321 1353681161
10709 A line break in the output can be indicated by
10710 \begin_inset Flex Code
10713 \begin_layout Plain Layout
10715 \change_inserted -712698321 1354263106
10726 \begin_layout Itemize
10728 \change_inserted -712698321 1353917320
10729 \begin_inset Flex Code
10732 \begin_layout Plain Layout
10734 \change_inserted -712698321 1353917320
10740 The font used for the argument content.
10742 \begin_inset space ~
10746 \begin_inset CommandInset ref
10748 reference "sub:Font-description"
10755 \begin_layout Itemize
10757 \change_inserted -712698321 1353917320
10758 \begin_inset Flex Code
10761 \begin_layout Plain Layout
10763 \change_inserted -712698321 1353917320
10769 The font used for the label.
10771 \begin_inset space ~
10775 \begin_inset CommandInset ref
10777 reference "sub:Font-description"
10784 \begin_layout Itemize
10786 \change_inserted -712698321 1353917320
10787 \begin_inset Flex Code
10790 \begin_layout Plain Layout
10792 \change_inserted -712698321 1353917320
10799 \begin_inset Flex Code
10802 \begin_layout Plain Layout
10804 \change_inserted -712698321 1353917320
10811 \begin_inset Flex Code
10814 \begin_layout Plain Layout
10816 \change_inserted -712698321 1353917320
10823 \begin_inset Flex Code
10826 \begin_layout Plain Layout
10828 \change_inserted -712698321 1353917320
10834 , describing the rendering style used for the inset's frame and buttons.
10836 \begin_inset Flex Code
10839 \begin_layout Plain Layout
10841 \change_inserted -712698321 1353917320
10848 \change_inserted 155139281 1354198988
10852 \begin_layout Standard
10854 \change_inserted 155139281 1354199102
10856 \begin_inset Flex Code
10859 \begin_layout Plain Layout
10861 \change_inserted 155139281 1354199013
10872 \begin_inset Flex Code
10875 \begin_layout Plain Layout
10877 \change_inserted 155139281 1354199102
10888 \begin_inset Flex Code
10891 \begin_layout Plain Layout
10893 \change_inserted 155139281 1354199044
10901 followed by the number (e.
10902 \begin_inset space \thinspace{}
10907 \begin_inset Flex Code
10910 \begin_layout Plain Layout
10912 \change_inserted 155139281 1354199064
10926 \begin_layout Description
10927 \begin_inset Flex Code
10930 \begin_layout Plain Layout
10936 Note that this will completely override any prior
10937 \begin_inset Flex Code
10940 \begin_layout Plain Layout
10946 declaration for this style.
10948 \begin_inset Quotes eld
10952 \begin_inset Flex Code
10955 \begin_layout Plain Layout
10962 \begin_inset Quotes erd
10967 \begin_inset CommandInset ref
10969 reference "sub:I18n"
10973 for details on its use.
10976 \begin_layout Description
10977 \begin_inset Flex Code
10980 \begin_layout Plain Layout
10987 \begin_inset Flex Code
10990 \begin_layout Plain Layout
11000 \begin_layout Plain Layout
11001 Note that a `float' here is a real number, such as: 1.5.
11006 The vertical space with which the last of a chain of paragraphs with this
11007 style is separated from the following paragraph.
11008 If the next paragraph has another style, the separations are not simply
11009 added, but the maximum is taken.
11012 \begin_layout Description
11013 \begin_inset Flex Code
11016 \begin_layout Plain Layout
11023 \begin_inset Flex Code
11026 \begin_layout Plain Layout
11032 The category for this style.
11033 This is used to group related styles in the style combobox on the toolbar.
11034 Any string can be used, but you may want to use existing categories with
11039 \begin_layout Description
11040 \begin_inset Flex Code
11043 \begin_layout Plain Layout
11049 Depth of XML command.
11050 Used only with XML-type formats.
11053 \begin_layout Description
11054 \begin_inset Flex Code
11057 \begin_layout Plain Layout
11064 \begin_inset Flex Code
11067 \begin_layout Plain Layout
11073 Copies all the features of an existing style into the current one.
11077 \begin_layout Description
11078 \begin_inset Flex Code
11081 \begin_layout Plain Layout
11087 The name of a style whose preamble should be output
11092 This allows to ensure some ordering of the preamble snippets when macros
11093 definitions depend on one another.
11097 \begin_layout Plain Layout
11098 Note that, besides that functionality, there is no way to ensure any ordering
11100 The ordering that you see in a given version of LyX may change without
11101 warning in later versions.
11109 \begin_layout Description
11110 \begin_inset Flex Code
11113 \begin_layout Plain Layout
11120 \begin_inset Flex Code
11123 \begin_layout Plain Layout
11128 , Box, Filled_Box, Static
11133 ] The type of label that stands at the end of the paragraph (or sequence
11135 \begin_inset Flex Code
11138 \begin_layout Plain Layout
11145 \begin_inset Flex Code
11148 \begin_layout Plain Layout
11155 \begin_inset Flex Code
11158 \begin_layout Plain Layout
11165 \begin_inset Flex Code
11168 \begin_layout Plain Layout
11176 \begin_inset Flex Code
11179 \begin_layout Plain Layout
11186 \begin_inset Quotes eld
11190 \begin_inset Quotes erd
11194 \begin_inset Flex Code
11197 \begin_layout Plain Layout
11204 \begin_inset Flex Code
11207 \begin_layout Plain Layout
11208 \begin_inset space ~
11216 ) is a white (resp.
11217 \begin_inset space ~
11220 black) square suitable for end of proof markers,
11221 \begin_inset Flex Code
11224 \begin_layout Plain Layout
11230 is an explicit text string.
11233 \begin_layout Description
11234 \begin_inset Flex Code
11237 \begin_layout Plain Layout
11244 \begin_inset Flex Code
11247 \begin_layout Plain Layout
11253 ] The string used for a label with a
11254 \begin_inset Flex Code
11257 \begin_layout Plain Layout
11264 \begin_inset Flex Code
11267 \begin_layout Plain Layout
11277 \begin_layout Description
11278 \begin_inset Flex Code
11281 \begin_layout Plain Layout
11287 The font used for both the text body
11293 \begin_inset space ~
11297 \begin_inset CommandInset ref
11299 reference "sub:Font-description"
11304 Note that defining this font automatically defines the
11305 \begin_inset Flex Code
11308 \begin_layout Plain Layout
11315 So you should define this one first if you also want to define
11316 \begin_inset Flex Code
11319 \begin_layout Plain Layout
11328 \begin_layout Description
11329 \begin_inset Flex Code
11332 \begin_layout Plain Layout
11339 \begin_inset CommandInset label
11341 name "des:FreeSpacing"
11346 \begin_inset Flex Code
11349 \begin_layout Plain Layout
11358 \begin_inset Flex Code
11361 \begin_layout Plain Layout
11367 ] Usually LyX doesn't allow you to insert more than one space between words,
11368 since a space is considered as the separation between two words, not a
11369 character or symbol of its own.
11370 This is a very fine thing but sometimes annoying, for example, when typing
11371 program code or plain LaTeX code.
11373 \begin_inset Flex Code
11376 \begin_layout Plain Layout
11383 Note that LyX will create protected blanks for the additional blanks when
11384 in another mode than LaTeX-mode.
11387 \begin_layout Description
11388 \begin_inset Flex Code
11391 \begin_layout Plain Layout
11397 These tags are used with XHTML output.
11399 \begin_inset CommandInset ref
11401 reference "sub:Paragraph-Style-XHTML"
11408 \begin_layout Description
11409 \begin_inset Flex Code
11412 \begin_layout Plain Layout
11418 [[FIXME]] (Used only with XML-type formats.)
11421 \begin_layout Description
11422 \begin_inset Flex Code
11425 \begin_layout Plain Layout
11432 \begin_inset Flex Code
11435 \begin_layout Plain Layout
11441 If 1, marks the style as to be included in the document preamble rather
11442 than in the document body.
11443 This is useful for document classes that want such information as the title
11444 and author to appear in the preamble.
11445 Note that this works only for styles for which the
11446 \begin_inset Flex Code
11449 \begin_layout Plain Layout
11456 \begin_inset Flex Code
11459 \begin_layout Plain Layout
11466 \begin_inset Flex Code
11469 \begin_layout Plain Layout
11478 \begin_layout Description
11479 \begin_inset Flex Code
11482 \begin_layout Plain Layout
11489 \begin_inset Flex Code
11492 \begin_layout Plain Layout
11498 If 1, marks the style as being part of a title block (see also the
11499 \begin_inset Flex Code
11502 \begin_layout Plain Layout
11509 \begin_inset Flex Code
11512 \begin_layout Plain Layout
11521 \begin_layout Description
11522 \begin_inset Flex Code
11525 \begin_layout Plain Layout
11532 \begin_inset Flex Code
11535 \begin_layout Plain Layout
11541 ] This provides extra space between paragraphs that have the same style.
11542 If you put other styles into an environment, each is separated with the
11544 \begin_inset Flex Code
11547 \begin_layout Plain Layout
11554 But the whole items of the environment are additionally separated with
11556 \begin_inset Flex Code
11559 \begin_layout Plain Layout
11566 Note that this is a
11571 \begin_layout Description
11572 \begin_inset Flex Code
11575 \begin_layout Plain Layout
11581 [[FIXME]] (Used only with XML-type formats.)
11584 \begin_layout Description
11585 \begin_inset Flex Code
11588 \begin_layout Plain Layout
11595 \begin_inset Flex Code
11598 \begin_layout Plain Layout
11607 \begin_inset Flex Code
11610 \begin_layout Plain Layout
11616 ] Usually LyX does not allow you to leave a paragraph empty, since it would
11617 lead to empty LaTeX output.
11618 There are some cases where this could be desirable however: in a letter
11619 template, the required fields can be provided as empty fields, so that
11620 people do not forget them; in some special classes, a style can be used
11621 as some kind of break, which does not contain actual text.
11624 \begin_layout Description
11625 \begin_inset Flex Code
11628 \begin_layout Plain Layout
11634 [float=0] The vertical space between the label and the text body.
11635 Only used for labels that are above the text body (
11636 \begin_inset Flex Code
11639 \begin_layout Plain Layout
11646 \begin_inset Flex Code
11649 \begin_layout Plain Layout
11650 Centered_Top_Environment
11658 \begin_layout Description
11659 \begin_inset Flex Code
11662 \begin_layout Plain Layout
11669 \begin_inset Flex Code
11672 \begin_layout Plain Layout
11679 \begin_inset Newline newline
11682 The name of the counter for automatic numbering.
11684 \begin_inset Newline newline
11692 \begin_inset Flex Code
11695 \begin_layout Plain Layout
11702 \begin_inset Flex Code
11705 \begin_layout Plain Layout
11712 In that case, the counter will be stepped each time the style appears.
11714 \begin_inset Newline newline
11722 \begin_inset Flex Code
11725 \begin_layout Plain Layout
11732 \begin_inset Flex Code
11735 \begin_layout Plain Layout
11741 , though this case is a bit complicated.
11742 Suppose you declare
11743 \begin_inset Quotes eld
11747 \begin_inset Flex Code
11750 \begin_layout Plain Layout
11751 LabelCounter myenum
11757 \begin_inset Quotes erd
11761 Then the actual counters used are
11762 \begin_inset Flex Code
11765 \begin_layout Plain Layout
11772 \begin_inset Flex Code
11775 \begin_layout Plain Layout
11782 \begin_inset Flex Code
11785 \begin_layout Plain Layout
11792 \begin_inset Flex Code
11795 \begin_layout Plain Layout
11801 , much as in LaTeX.
11802 These counters must all be declared separately.
11803 \begin_inset Newline newline
11807 \begin_inset CommandInset ref
11809 reference "sub:Counters"
11813 for details on counters.
11816 \begin_layout Description
11817 \begin_inset Flex Code
11820 \begin_layout Plain Layout
11826 The font used for the label.
11828 \begin_inset space ~
11832 \begin_inset CommandInset ref
11834 reference "sub:Font-description"
11841 \begin_layout Description
11842 \begin_inset Flex Code
11845 \begin_layout Plain Layout
11851 Text that indicates how far a label should be indented.
11854 \begin_layout Description
11855 \begin_inset Flex Code
11858 \begin_layout Plain Layout
11865 \begin_inset Flex Code
11868 \begin_layout Plain Layout
11874 ] The horizontal space between the label and the text body.
11875 Only used for labels that are not above the text body.
11878 \begin_layout Description
11879 \begin_inset Flex Code
11882 \begin_layout Plain Layout
11889 \begin_inset Flex Code
11892 \begin_layout Plain Layout
11898 ] The string used for a label with a
11899 \begin_inset Flex Code
11902 \begin_layout Plain Layout
11910 \begin_inset Flex Code
11913 \begin_layout Plain Layout
11919 is set, this string can be contain the special formatting commands described
11921 \begin_inset CommandInset ref
11923 reference "sub:Counters"
11931 \begin_layout Plain Layout
11932 For the sake of backwards compatibility, the string
11933 \begin_inset Flex Code
11936 \begin_layout Plain Layout
11946 will be replaced by the expanded
11947 \begin_inset Flex Code
11950 \begin_layout Plain Layout
11957 \begin_inset Flex Code
11960 \begin_layout Plain Layout
11969 This feature is now obsolete and should be replaced by the mechanisms of
11971 \begin_inset CommandInset ref
11973 reference "sub:Counters"
11985 \begin_layout Description
11986 \begin_inset Flex Code
11989 \begin_layout Plain Layout
11990 LabelStringAppendix
11996 \begin_inset Flex Code
11999 \begin_layout Plain Layout
12005 ] This is used inside the appendix instead of
12006 \begin_inset Flex Code
12009 \begin_layout Plain Layout
12017 \begin_inset Flex Code
12020 \begin_layout Plain Layout
12027 \begin_inset Flex Code
12030 \begin_layout Plain Layout
12031 LabelStringAppendix
12039 \begin_layout Description
12040 \begin_inset Flex Code
12043 \begin_layout Plain Layout
12049 [FIXME] (Used only with XML-type formats.)
12052 \begin_layout Description
12053 \begin_inset Flex Code
12056 \begin_layout Plain Layout
12063 \begin_inset Flex Code
12066 \begin_layout Plain Layout
12071 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
12072 Enumerate, Itemize, Bibliography
12081 \begin_layout Itemize
12082 \begin_inset Flex Code
12085 \begin_layout Plain Layout
12091 means the label is the very first word (up to the first real blank).
12092 Use protected spaces (like
12093 \begin_inset space ~
12096 that one) if you want more than one word as the label.
12100 \begin_layout Itemize
12101 \begin_inset Flex Code
12104 \begin_layout Plain Layout
12110 means the label is simply whatever
12111 \begin_inset Flex Code
12114 \begin_layout Plain Layout
12121 Note that this really is `static'.
12124 \begin_layout Itemize
12125 \begin_inset Flex Code
12128 \begin_layout Plain Layout
12135 \begin_inset Flex Code
12138 \begin_layout Plain Layout
12139 Centered_Top_Environment
12144 are special cases of
12145 \begin_inset Flex Code
12148 \begin_layout Plain Layout
12155 The label will be printed above the paragraph, but only at the top of an
12156 environment or the top of a chain of paragraphs with this style.
12157 This might be used with the
12158 \begin_inset Flex MenuItem
12161 \begin_layout Plain Layout
12167 style, for example.
12170 \begin_layout Itemize
12171 \begin_inset Flex Code
12174 \begin_layout Plain Layout
12180 is a special case for the caption-labels
12181 \begin_inset Quotes eld
12185 \begin_inset Quotes erd
12189 \begin_inset Quotes eld
12193 \begin_inset Quotes erd
12198 \begin_inset Flex Code
12201 \begin_layout Plain Layout
12207 means the (hardcoded) label string depends on the kind of float: It is
12208 hardcoded to be `FloatType N', where N is the value of the counter associated
12212 \begin_layout Itemize
12214 \begin_inset Flex Code
12217 \begin_layout Plain Layout
12223 label type defines automatically numbered labels.
12225 \begin_inset Flex Code
12228 \begin_layout Plain Layout
12234 will be expanded to resolve any counter references it contains: For example,
12236 \begin_inset Quotes eld
12240 \begin_inset Flex Code
12243 \begin_layout Plain Layout
12254 \begin_inset Quotes erd
12259 \begin_inset CommandInset ref
12261 reference "sub:Counters"
12265 for more information on counters.
12268 \begin_layout Itemize
12269 \begin_inset Flex Code
12272 \begin_layout Plain Layout
12278 produces the usual sort of enumeration labels.
12279 At present, it is hardcoded to use Arabic numerals, lowercase letters,
12280 small Roman numerals, and uppercase letters for the four possible depths.
12283 \begin_layout Itemize
12284 \begin_inset Flex Code
12287 \begin_layout Plain Layout
12293 produces various bullets at the different levels.
12294 It is also hardcoded.
12297 \begin_layout Itemize
12298 \begin_inset Flex Code
12301 \begin_layout Plain Layout
12307 is used internally by LyX and should be used only with
12308 \begin_inset Flex Code
12311 \begin_layout Plain Layout
12312 LatexType BibEnvironment
12321 \begin_layout Description
12322 \begin_inset Flex Code
12325 \begin_layout Plain Layout
12331 Note that this will completely override any prior
12332 \begin_inset Flex Code
12335 \begin_layout Plain Layout
12341 declaration for this style.
12343 \begin_inset Quotes eld
12347 \begin_inset Flex Code
12350 \begin_layout Plain Layout
12357 \begin_inset Quotes erd
12362 \begin_inset CommandInset ref
12364 reference "sub:I18n"
12368 for details on its use.
12371 \begin_layout Description
12372 \begin_inset Flex Code
12375 \begin_layout Plain Layout
12381 The name of the corresponding LaTeX stuff.
12382 Either the environment or command name.
12385 \begin_layout Description
12386 \begin_inset Flex Code
12389 \begin_layout Plain Layout
12395 An optional parameter for the corresponding
12396 \begin_inset Flex Code
12399 \begin_layout Plain Layout
12406 This parameter cannot be changed from within LyX.
12409 \begin_layout Description
12410 \begin_inset Flex Code
12413 \begin_layout Plain Layout
12420 \begin_inset Flex Code
12423 \begin_layout Plain Layout
12428 , Command, Environment, Item_Environment,
12434 \begin_inset Flex Code
12437 \begin_layout Plain Layout
12438 List_Environment, Bib_Environment
12443 ] How the style should be translated into LaTeX.
12447 \begin_layout Plain Layout
12448 \begin_inset Flex Code
12451 \begin_layout Plain Layout
12457 is perhaps a bit misleading, since these rules apply to SGML classes, too.
12458 Visit the SGML class files for specific examples.
12467 \begin_layout Itemize
12468 \begin_inset Flex Code
12471 \begin_layout Plain Layout
12477 means nothing special.
12481 \begin_layout Itemize
12482 \begin_inset Flex Code
12485 \begin_layout Plain Layout
12492 \begin_inset Flex Code
12495 \begin_layout Plain Layout
12502 {\SpecialChar \ldots{}
12511 \begin_layout Itemize
12512 \begin_inset Flex Code
12515 \begin_layout Plain Layout
12522 \begin_inset Flex Code
12525 \begin_layout Plain Layout
12532 }\SpecialChar \ldots{}
12548 \begin_layout Itemize
12549 \begin_inset Flex Code
12552 \begin_layout Plain Layout
12559 \begin_inset Flex Code
12562 \begin_layout Plain Layout
12569 \begin_inset Flex Code
12572 \begin_layout Plain Layout
12580 is generated for each paragraph of this environment.
12584 \begin_layout Itemize
12585 \begin_inset Flex Code
12588 \begin_layout Plain Layout
12595 \begin_inset Flex Code
12598 \begin_layout Plain Layout
12605 \begin_inset Flex Code
12608 \begin_layout Plain Layout
12614 is passed as an argument to the environment.
12616 \begin_inset Flex Code
12619 \begin_layout Plain Layout
12625 can be defined in the
12626 \begin_inset Flex MenuItem
12629 \begin_layout Plain Layout
12630 Edit\SpecialChar \menuseparator
12632 \begin_inset space ~
12644 \begin_layout Standard
12645 Putting the last few things together, the LaTeX output will be either:
12648 \begin_layout LyX-Code
12651 latexname[latexparam]{\SpecialChar \ldots{}
12655 \begin_layout Standard
12659 \begin_layout LyX-Code
12662 begin{latexname}[latexparam] \SpecialChar \ldots{}
12668 \begin_layout Standard
12669 depending upon the LaTeX type.
12673 \begin_layout Description
12675 \change_inserted -712698321 1354263086
12676 \begin_inset Flex Code
12679 \begin_layout Plain Layout
12681 \change_inserted -712698321 1353866852
12688 \begin_inset Flex Code
12691 \begin_layout Plain Layout
12693 \change_inserted -712698321 1353866852
12699 ] A string that is put at the beginning of the style content.
12700 A line break in the output can be indicated by
12701 \begin_inset Flex Code
12704 \begin_layout Plain Layout
12706 \change_inserted -712698321 1354263086
12717 \begin_layout Description
12718 \begin_inset Flex Code
12721 \begin_layout Plain Layout
12728 \begin_inset Flex Code
12731 \begin_layout Plain Layout
12737 ] If you put styles into environments, the leftmargins are not simply added,
12738 but added with a factor
12739 \begin_inset Formula $\frac{4}{depth+4}$
12743 Note that this parameter is also used when the margin is defined as
12744 \begin_inset Flex Code
12747 \begin_layout Plain Layout
12754 \begin_inset Flex Code
12757 \begin_layout Plain Layout
12764 Then it is added to the manual or dynamic margin.
12766 \begin_inset Newline newline
12769 The argument is passed as a string.
12771 \begin_inset Quotes eld
12775 \begin_inset Flex Code
12778 \begin_layout Plain Layout
12785 \begin_inset Quotes erd
12788 means that the paragraph is indented with the width of
12789 \begin_inset Quotes eld
12793 \begin_inset Flex Code
12796 \begin_layout Plain Layout
12803 \begin_inset Quotes erd
12806 in the normal font.
12807 You can get a negative width by prefixing the string with
12808 \begin_inset Quotes eld
12812 \begin_inset Flex Code
12815 \begin_layout Plain Layout
12822 \begin_inset Quotes erd
12826 This way was chosen so that the look is the same with each used screen
12831 \begin_layout Description
12832 \begin_inset Flex Code
12835 \begin_layout Plain Layout
12842 \begin_inset Flex Code
12845 \begin_layout Plain Layout
12850 , Manual, Dynamic, First_Dynamic, Right_Address_Box
12856 \begin_inset Newline newline
12859 The kind of margin that the style has on the left side.
12861 \begin_inset Flex Code
12864 \begin_layout Plain Layout
12870 just means a fixed margin.
12872 \begin_inset Flex Code
12875 \begin_layout Plain Layout
12881 means that the left margin depends on the string entered in the
12882 \begin_inset Flex MenuItem
12885 \begin_layout Plain Layout
12886 Edit\SpecialChar \menuseparator
12888 \begin_inset space ~
12897 This is used to typeset nice lists without tabulators.
12899 \begin_inset Flex Code
12902 \begin_layout Plain Layout
12908 means that the margin depends on the size of the label.
12909 This is used for automatic enumerated headlines.
12910 It is obvious that the headline
12911 \begin_inset Quotes eld
12914 5.4.3.2.1 Very long headline
12915 \begin_inset Quotes erd
12918 must have a wider left margin (as wide as
12919 \begin_inset Quotes eld
12923 \begin_inset Quotes erd
12926 plus the space) than
12927 \begin_inset Quotes eld
12930 3.2 Very long headline
12931 \begin_inset Quotes erd
12935 \begin_inset Quotes eld
12939 \begin_inset Quotes erd
12942 are not able to do this.
12944 \begin_inset Flex Code
12947 \begin_layout Plain Layout
12953 is similar, but only the very first row of the paragraph is dynamic, while
12954 the others are static; this is used, for example, for descriptions.
12956 \begin_inset Flex Code
12959 \begin_layout Plain Layout
12965 means the margin is chosen in a way that the longest row of this paragraph
12966 fits to the right margin.
12967 This is used to typeset an address on the right edge of the page.
12970 \begin_layout Description
12971 \begin_inset Flex Code
12974 \begin_layout Plain Layout
12981 \begin_inset Flex Code
12984 \begin_layout Plain Layout
12993 \begin_inset Flex Code
12996 \begin_layout Plain Layout
13002 ] Whether fragile commands in this style should be
13003 \begin_inset Flex Code
13006 \begin_layout Plain Layout
13019 whether this command should itself be protected.)
13022 \begin_layout Description
13023 \begin_inset Flex Code
13026 \begin_layout Plain Layout
13033 \begin_inset Flex Code
13036 \begin_layout Plain Layout
13043 \begin_inset Flex Code
13046 \begin_layout Plain Layout
13054 ] Whether newlines are translated into LaTeX newlines (
13055 \begin_inset Flex Code
13058 \begin_layout Plain Layout
13069 The translation can be switched off to allow more comfortable LaTeX editing
13073 \begin_layout Description
13074 \begin_inset Flex Code
13077 \begin_layout Plain Layout
13084 \begin_inset Flex Code
13087 \begin_layout Plain Layout
13094 \begin_inset Flex Code
13097 \begin_layout Plain Layout
13105 ] If set to true, and if
13106 \begin_inset Flex Code
13109 \begin_layout Plain Layout
13116 \begin_inset Flex Code
13119 \begin_layout Plain Layout
13125 ) paragraphs are being indented, then the indentation of such a paragraph
13126 following one of this type will be suppressed.
13127 (So this will not affect the display of non-default paragraphs.)
13130 \begin_layout Description
13131 \begin_inset Flex Code
13134 \begin_layout Plain Layout
13140 Name of a style that has replaced this style.
13141 This is used to rename a style, while keeping backward compatibility.
13144 \begin_layout Description
13146 \change_deleted -712698321 1353679722
13147 \begin_inset Flex Code
13150 \begin_layout Plain Layout
13157 \begin_inset Flex Code
13160 \begin_layout Plain Layout
13166 ] The number of optional arguments that can be used with this style.
13167 This is useful for things like section headings, and only makes sense with
13169 Note that, on output, the optional arguments will all precede any required
13170 arguments (see below).
13171 So one can have constructs like:
13175 \begin_layout LyX-Code
13177 \change_deleted -712698321 1353679722
13180 mycmd[opt1]{req1}{contents of paragraph}
13183 \begin_layout Standard
13185 \change_deleted -712698321 1353679722
13186 but one cannot have things like:
13189 \begin_layout LyX-Code
13191 \change_deleted -712698321 1353679722
13194 mycmd[opt1]{req1}[opt2]{contents of paragraph}
13197 \begin_layout Standard
13199 \change_deleted -712698321 1353679722
13200 at least, not without ERT (with which you can have anything).
13207 \begin_layout Description
13208 \begin_inset Flex Code
13211 \begin_layout Plain Layout
13218 \begin_inset Flex Code
13221 \begin_layout Plain Layout
13230 \begin_inset Flex Code
13233 \begin_layout Plain Layout
13239 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
13240 output, but only by a line break; together with
13241 \begin_inset Flex Code
13244 \begin_layout Plain Layout
13250 , this allows to emulate a plain text editor (like the ERT inset).
13253 \begin_layout Description
13254 \begin_inset Flex Code
13257 \begin_layout Plain Layout
13264 \begin_inset Flex Code
13267 \begin_layout Plain Layout
13273 ] The indent of the very first line of a paragraph.
13275 \begin_inset Flex Code
13278 \begin_layout Plain Layout
13284 will be fixed for a certain style.
13285 The exception is the default style, since the indentation for these paragraphs
13286 can be prohibited with
13287 \begin_inset Flex Code
13290 \begin_layout Plain Layout
13298 \begin_inset Flex Code
13301 \begin_layout Plain Layout
13307 style paragraphs inside environments use the
13308 \begin_inset Flex Code
13311 \begin_layout Plain Layout
13317 of the environment, not their native one.
13319 \begin_inset Flex Code
13322 \begin_layout Plain Layout
13328 paragraphs inside an enumeration are not indented.
13331 \begin_layout Description
13332 \begin_inset Flex Code
13335 \begin_layout Plain Layout
13342 \begin_inset Flex Code
13345 \begin_layout Plain Layout
13351 ] The vertical space between two paragraphs of this style.
13354 \begin_layout Description
13355 \begin_inset Flex Code
13358 \begin_layout Plain Layout
13365 \begin_inset Flex Code
13368 \begin_layout Plain Layout
13374 ] LyX allows the user to choose either
13375 \begin_inset Quotes eld
13379 \begin_inset Quotes erd
13383 \begin_inset Quotes eld
13387 \begin_inset Quotes erd
13390 to typeset a document.
13392 \begin_inset Quotes eld
13396 \begin_inset Quotes erd
13399 is chosen, this value is completely ignored.
13401 \begin_inset Quotes eld
13405 \begin_inset Quotes erd
13408 is chosen, the parindent of a LaTeXtype
13409 \begin_inset Quotes eld
13413 \begin_inset Quotes erd
13416 style is ignored and all paragraphs are separated by this parskip argument.
13417 The vertical space is calculated with
13418 \begin_inset Flex Code
13421 \begin_layout Plain Layout
13423 \begin_inset space ~
13432 \begin_inset Flex Code
13435 \begin_layout Plain Layout
13441 is the height of a row with the normal font.
13442 This way, the look stays the same with different screen fonts.
13445 \begin_layout Description
13446 \begin_inset Flex Code
13449 \begin_layout Plain Layout
13456 \begin_inset Flex Code
13459 \begin_layout Plain Layout
13468 \begin_inset Flex Code
13471 \begin_layout Plain Layout
13477 ] Whether the contents of this paragraph should be output in raw form, meaning
13478 without special translations that LaTeX would require.
13481 \begin_layout Description
13482 \begin_inset Flex Code
13485 \begin_layout Plain Layout
13491 Information to be included in the LaTeX preamble when this style is used.
13492 Used to define macros, load packages, etc., required by this particular
13495 \begin_inset Quotes eld
13499 \begin_inset Flex Code
13502 \begin_layout Plain Layout
13509 \begin_inset Quotes erd
13515 \begin_layout Description
13516 \begin_inset Flex Code
13519 \begin_layout Plain Layout
13526 \begin_inset Flex Code
13529 \begin_layout Plain Layout
13535 ] The prefix to use when creating labels referring to paragraphs of this
13537 This allows the use of formatted references.
13540 \begin_layout Description
13542 \change_deleted -712698321 1353681258
13543 \begin_inset Flex Code
13546 \begin_layout Plain Layout
13553 \begin_inset Flex Code
13556 \begin_layout Plain Layout
13562 ] The number of required arguments that the LaTeX command or environment
13563 corresponding to this style expects.
13564 In the case of a command, these are required arguments
13568 that associated with the content of the paragraph itself.
13569 These do not actually have to be provided: LyX will output empty arguments
13571 Note that optional arguments will be output before required arguments.
13572 See the discussion of the
13573 \begin_inset Flex Code
13576 \begin_layout Plain Layout
13582 tag above for more information.
13587 \begin_layout Description
13588 \begin_inset Flex Code
13591 \begin_layout Plain Layout
13598 \begin_inset Flex Code
13601 \begin_layout Plain Layout
13607 ] Whether the style requires the feature
13608 \begin_inset Flex Code
13611 \begin_layout Plain Layout
13618 See the description of
13619 \begin_inset Flex Code
13622 \begin_layout Plain Layout
13629 \begin_inset CommandInset ref
13630 LatexCommand pageref
13631 reference "des:FreeSpacing"
13635 ) for information on `features'.
13637 \change_inserted -712698321 1353693134
13641 \begin_layout Description
13643 \change_inserted -712698321 1353693371
13644 \begin_inset Flex Code
13647 \begin_layout Plain Layout
13649 \change_inserted -712698321 1353693146
13658 \begin_inset Flex Code
13661 \begin_layout Plain Layout
13663 \change_inserted -712698321 1353693235
13672 \begin_inset Flex Code
13675 \begin_layout Plain Layout
13677 \change_inserted -712698321 1353693235
13683 ] Resets the LaTeX arguments of this style (as defined via the
13684 \begin_inset Flex Code
13687 \begin_layout Plain Layout
13689 \change_inserted -712698321 1353693371
13698 This is useful if you have copied a style via
13699 \begin_inset Flex Code
13702 \begin_layout Plain Layout
13704 \change_inserted -712698321 1353693302
13712 , but you do not want to inherit its (required and optional) arguments.
13717 \begin_layout Description
13719 \change_inserted -712698321 1354263074
13720 \begin_inset Flex Code
13723 \begin_layout Plain Layout
13725 \change_inserted -712698321 1353866876
13732 \begin_inset Flex Code
13735 \begin_layout Plain Layout
13737 \change_inserted -712698321 1353866873
13743 ] A string that is put at the end of the layout content.
13744 A line break in the output can be indicated by
13745 \begin_inset Flex Code
13748 \begin_layout Plain Layout
13750 \change_inserted -712698321 1354263069
13761 \begin_layout Description
13762 \begin_inset Flex Code
13765 \begin_layout Plain Layout
13772 \begin_inset Flex Code
13775 \begin_layout Plain Layout
13782 \begin_inset Flex Code
13785 \begin_layout Plain Layout
13794 \begin_layout Description
13795 \begin_inset Flex Code
13798 \begin_layout Plain Layout
13805 \begin_inset Flex Code
13808 \begin_layout Plain Layout
13813 , onehalf, double, other
13822 ] This defines what the default spacing should be in the style.
13824 \begin_inset Flex Code
13827 \begin_layout Plain Layout
13834 \begin_inset Flex Code
13837 \begin_layout Plain Layout
13844 \begin_inset Flex Code
13847 \begin_layout Plain Layout
13853 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
13854 If you specify the argument
13855 \begin_inset Flex Code
13858 \begin_layout Plain Layout
13864 , then you should also provide a numerical argument which will be the actual
13866 Note that, contrary to other parameters,
13867 \begin_inset Flex Code
13870 \begin_layout Plain Layout
13876 implies the generation of specific LaTeX code, using the package
13879 \begin_inset Flex Code
13882 \begin_layout Plain Layout
13891 \begin_layout Description
13892 \begin_inset Flex Code
13895 \begin_layout Plain Layout
13902 \begin_inset Flex Code
13905 \begin_layout Plain Layout
13912 \begin_inset Flex Code
13915 \begin_layout Plain Layout
13923 ] Spellcheck paragraphs of this style.
13927 \begin_layout Description
13928 \begin_inset Flex Code
13931 \begin_layout Plain Layout
13937 The font used for the text body .
13939 \begin_inset CommandInset ref
13941 reference "sub:Font-description"
13948 \begin_layout Description
13949 \begin_inset Flex Code
13952 \begin_layout Plain Layout
13961 \begin_inset Flex Code
13964 \begin_layout Plain Layout
13974 The level of the style in the table of contents.
13975 This is used for automatic numbering of section headings.
13978 \begin_layout Description
13979 \begin_inset Flex Code
13982 \begin_layout Plain Layout
13989 \begin_inset Flex Code
13992 \begin_layout Plain Layout
13998 ] The vertical space with which the very first of a chain of paragraphs
13999 with this style is separated from the previous paragraph.
14000 If the previous paragraph has another style, the separations are not simply
14001 added, but the maximum is taken.
14004 \begin_layout Subsection
14005 \begin_inset CommandInset label
14011 Internationalization of Paragraph Styles
14014 \begin_layout Standard
14015 LyX has long supported internationalization of layout information, but,
14016 until version 2.0, this applied only to the user interface and not to, say,
14018 Thus, French authors were forced to resort to ugly hacks if they wanted
14023 1' instead of `Theorem 1'.
14024 Thanks to Georg Baum, that is no longer the case.
14027 \begin_layout Standard
14029 \begin_inset Flex Code
14032 \begin_layout Plain Layout
14038 defines text that is to appear in the typeset document, it may use
14039 \begin_inset Flex Code
14042 \begin_layout Plain Layout
14049 \begin_inset Flex Code
14052 \begin_layout Plain Layout
14058 to support non-English and even multi-language documents correctly.
14059 The following excerpt (from the
14060 \begin_inset Flex Code
14063 \begin_layout Plain Layout
14069 file) shows how this works:
14072 \begin_layout LyX-Code
14077 \begin_layout LyX-Code
14080 theoremstyle{remark}
14083 \begin_layout LyX-Code
14086 newtheorem{claim}[thm]{
14093 \begin_layout LyX-Code
14097 \begin_layout LyX-Code
14101 \begin_layout LyX-Code
14106 claimname}{_(Claim)}
14109 \begin_layout LyX-Code
14113 \begin_layout LyX-Code
14117 \begin_layout LyX-Code
14126 claimname}{_(Claim)}}
14129 \begin_layout LyX-Code
14134 \begin_layout Standard
14135 In principle, any legal LaTeX may appear in the
14136 \begin_inset Flex Code
14139 \begin_layout Plain Layout
14146 \begin_inset Flex Code
14149 \begin_layout Plain Layout
14155 tags, but in practice they will typically look as they do here.
14156 The key to correct translation of the typeset text is the definition of
14158 \begin_inset Flex Code
14161 \begin_layout Plain Layout
14170 \begin_inset Flex Code
14173 \begin_layout Plain Layout
14185 \begin_layout Standard
14187 \begin_inset Flex Code
14190 \begin_layout Plain Layout
14196 tag provides for internationalization based upon the overall language of
14198 The contents of the tag will be included in the preamble, just as with
14200 \begin_inset Flex Code
14203 \begin_layout Plain Layout
14210 What makes it special is the use of the
14211 \begin_inset Quotes eld
14215 \begin_inset Quotes erd
14219 \begin_inset Flex Code
14222 \begin_layout Plain Layout
14228 , which will be replaced, when LyX produces LaTeX output, with the translation
14229 of its argument into the document language.
14232 \begin_layout Standard
14234 \begin_inset Flex Code
14237 \begin_layout Plain Layout
14243 tag is more complex, since it is meant to provide support for multi-language
14244 documents and so offers an interface to the
14245 \begin_inset Flex Code
14248 \begin_layout Plain Layout
14255 Its contents will be added to the preamble once for each language that
14256 appears in the document.
14257 In this case, the argument to
14258 \begin_inset Flex Code
14261 \begin_layout Plain Layout
14267 will be replaced with its translation into the language in question; the
14269 \begin_inset Flex Code
14272 \begin_layout Plain Layout
14278 is replaced by the language name (as used by the babel package).
14281 \begin_layout Standard
14282 A German document that also included a French section would thus have the
14283 following in the preamble:
14286 \begin_layout LyX-Code
14295 claimname}{Affirmation}}
14303 claimname}{Behauptung}}
14307 claimname}{Behauptung}
14310 \begin_layout Standard
14312 \begin_inset Flex Code
14315 \begin_layout Plain Layout
14321 will then conspire to produce the correct text in the output.
14324 \begin_layout Standard
14325 One important point to note here is that the translations are provided by
14326 LyX itself, through the
14327 \change_inserted -195340706 1334775793
14329 \begin_inset Flex Code
14332 \begin_layout Plain Layout
14334 \change_inserted -195340706 1334775793
14341 \change_deleted -195340706 1334775793
14342 same mechanism it uses for internationalization of the user interface
14345 This means, in effect, that
14346 \begin_inset Flex Code
14349 \begin_layout Plain Layout
14356 \begin_inset Flex Code
14359 \begin_layout Plain Layout
14365 are really only of use in layout files that are provided with LyX, since
14366 text entered in user-created layout files will not be seen by LyX's internation
14368 \change_inserted -195340706 1334775793
14370 \begin_inset Flex Code
14373 \begin_layout Plain Layout
14375 \change_inserted -195340706 1334775793
14381 file is modified accordingly
14384 That said, however, any layout created with the intention that it will
14385 be included with LyX should use these tags where appropriate.
14387 \change_inserted -195340706 1334775793
14388 Please note that the paragraph style translations provided by LyX will
14389 never change with a minor update (e.g.
14390 from version 2.1.x to 2.1.y).
14391 It is however quite likely that a major update (e.g.
14392 from 2.0.x to 2.1.y) will introduce new translations or corrections.
14397 \begin_layout Subsection
14399 \begin_inset CommandInset label
14408 \begin_layout Standard
14409 Since version 1.3.0 of LyX, it is has been both possible and necessary to
14410 define the floats (
14411 \begin_inset Flex MenuItem
14414 \begin_layout Plain Layout
14421 \begin_inset Flex MenuItem
14424 \begin_layout Plain Layout
14430 , \SpecialChar \ldots{}
14431 ) in the text class itself.
14432 Standard floats are included in the file
14433 \begin_inset Flex Code
14436 \begin_layout Plain Layout
14442 , so you may have to do no more than add
14445 \begin_layout LyX-Code
14446 Input stdfloats.inc
14449 \begin_layout Standard
14450 to your layout file.
14451 If you want to implement a text class that proposes some other float types
14452 (like the AGU class bundled with LyX), the information below will hopefully
14456 \begin_layout Description
14457 \begin_inset Flex Code
14460 \begin_layout Plain Layout
14467 \begin_inset Flex Code
14470 \begin_layout Plain Layout
14477 \begin_inset Quotes erd
14481 \begin_inset Quotes erd
14484 ] The file name extension of an auxiliary file for the list of figures (or
14486 LaTeX writes the captions to this file.
14489 \begin_layout Description
14490 \begin_inset Flex Code
14493 \begin_layout Plain Layout
14500 \begin_inset Flex Code
14503 \begin_layout Plain Layout
14510 \begin_inset Quotes erd
14514 \begin_inset Quotes erd
14517 ] The string that will be used in the menus and also for the caption.
14518 This is translated to the current language if babel is used.
14521 \begin_layout Description
14522 \begin_inset Flex Code
14525 \begin_layout Plain Layout
14531 These are used for XHTML output.
14533 \begin_inset CommandInset ref
14535 reference "sec:Tags-for-XHTML"
14542 \begin_layout Description
14543 \begin_inset Flex Code
14546 \begin_layout Plain Layout
14555 \begin_inset Flex Code
14558 \begin_layout Plain Layout
14567 \begin_inset Flex Code
14570 \begin_layout Plain Layout
14576 ] Indicates whether the float is already defined in the document class or
14577 if we instead need to load
14578 \begin_inset Flex Code
14581 \begin_layout Plain Layout
14587 and use what it provides to define it on-the-fly.
14589 \begin_inset Flex Code
14592 \begin_layout Plain Layout
14599 \begin_inset Flex Code
14602 \begin_layout Plain Layout
14609 It should be set to
14610 \begin_inset Flex Code
14613 \begin_layout Plain Layout
14619 if the float is already defined by the LaTeX document class.
14622 \begin_layout Description
14623 \begin_inset Flex Code
14626 \begin_layout Plain Layout
14633 \begin_inset Flex Code
14636 \begin_layout Plain Layout
14643 \begin_inset Quotes erd
14647 \begin_inset Quotes erd
14650 ] The command used to generate a list of floats of this type; the leading
14653 ' should be omitted.
14659 \begin_inset Flex Code
14662 \begin_layout Plain Layout
14668 is false, since there is no standard way to generate this command.
14670 \begin_inset Flex Code
14673 \begin_layout Plain Layout
14679 is true, since in that case there is a standard way to define the command.
14682 \begin_layout Description
14683 \begin_inset Flex Code
14686 \begin_layout Plain Layout
14693 \begin_inset Flex Code
14696 \begin_layout Plain Layout
14703 \begin_inset Quotes erd
14707 \begin_inset Quotes erd
14710 ] A title for a list of floats of this kind (list of figures, tables, or
14712 It is used for the screen label within LyX; it is passed to LaTeX for use
14713 as the title there; and it is used as the title in XHTML output.
14714 It will be translated to the document language.
14717 \begin_layout Description
14718 \begin_inset Flex Code
14721 \begin_layout Plain Layout
14728 \begin_inset Flex Code
14731 \begin_layout Plain Layout
14738 \begin_inset Quotes erd
14742 \begin_inset Quotes erd
14745 ] This (optional) argument determines whether floats of this class will
14746 be numbered within some sectional unit of the document.
14747 For example, if within is equal to
14748 \begin_inset Flex Code
14751 \begin_layout Plain Layout
14757 , the floats will be numbered within chapters.
14761 \begin_layout Description
14762 \begin_inset Flex Code
14765 \begin_layout Plain Layout
14772 \begin_inset Flex Code
14775 \begin_layout Plain Layout
14782 \begin_inset Quotes erd
14786 \begin_inset Quotes erd
14789 ] The default placement for the given class of floats.
14790 The string should be as in standard LaTeX:
14791 \begin_inset Flex Code
14794 \begin_layout Plain Layout
14801 \begin_inset Flex Code
14804 \begin_layout Plain Layout
14811 \begin_inset Flex Code
14814 \begin_layout Plain Layout
14821 \begin_inset Flex Code
14824 \begin_layout Plain Layout
14830 for top, bottom, page, and here, respectively.
14834 \begin_layout Plain Layout
14835 Note that the order of these letters in the string is irrelevant, like in
14841 On top of that there is a new type,
14842 \begin_inset Flex Code
14845 \begin_layout Plain Layout
14851 , which does not really correspond to a float, since it means: put it
14852 \begin_inset Quotes eld
14856 \begin_inset Quotes erd
14860 Note however that the
14861 \begin_inset Flex Code
14864 \begin_layout Plain Layout
14870 specifier is special and, because of implementation details, cannot be
14871 used in non-built in float types.
14872 If you do not understand what this means, just use
14873 \begin_inset Quotes eld
14877 \begin_inset Flex Code
14880 \begin_layout Plain Layout
14887 \begin_inset Quotes erd
14893 \begin_layout Description
14894 \begin_inset Flex Code
14897 \begin_layout Plain Layout
14904 \begin_inset Flex Code
14907 \begin_layout Plain Layout
14913 ] The prefix to use when creating labels referring to floats of this type.
14914 This allows the use of formatted references.
14915 Note that you can remove any
14916 \begin_inset Flex Code
14919 \begin_layout Plain Layout
14925 set by a copied style by using the special value
14926 \begin_inset Quotes eld
14930 \begin_inset Quotes erd
14933 , which must be all caps.
14936 \begin_layout Description
14937 \begin_inset Flex Code
14940 \begin_layout Plain Layout
14947 \begin_inset Flex Code
14950 \begin_layout Plain Layout
14957 \begin_inset Quotes erd
14961 \begin_inset Quotes erd
14964 ] The style used when defining the float using
14965 \begin_inset Flex Code
14968 \begin_layout Plain Layout
14979 \begin_layout Description
14980 \begin_inset Flex Code
14983 \begin_layout Plain Layout
14990 \begin_inset Flex Code
14993 \begin_layout Plain Layout
15000 \begin_inset Quotes erd
15004 \begin_inset Quotes erd
15008 \begin_inset Quotes eld
15012 \begin_inset Quotes erd
15015 of the new class of floats, like program or algorithm.
15016 After the appropriate
15017 \begin_inset Flex Code
15020 \begin_layout Plain Layout
15029 \begin_inset Flex Code
15032 \begin_layout Plain Layout
15041 \begin_inset Flex Code
15044 \begin_layout Plain Layout
15055 \begin_layout Description
15056 \begin_inset Flex Code
15059 \begin_layout Plain Layout
15066 \begin_inset Flex Code
15069 \begin_layout Plain Layout
15076 \begin_inset Flex Code
15079 \begin_layout Plain Layout
15087 ] Tells us whether this float is defined using the facilities provided by
15089 \begin_inset Flex Code
15092 \begin_layout Plain Layout
15098 , either by the class file or a package, or on-the-fly by LyX itself.
15101 \begin_layout Standard
15102 Note that defining a float with type
15103 \begin_inset Flex Code
15106 \begin_layout Plain Layout
15114 automatically defines the corresponding counter with name
15115 \begin_inset Flex Code
15118 \begin_layout Plain Layout
15129 \begin_layout Subsection
15130 Flex insets and InsetLayout
15131 \begin_inset CommandInset label
15133 name "sub:Flex-insets-and"
15140 \begin_layout Standard
15141 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
15142 these are called Flex insets.
15146 \begin_layout Standard
15147 Flex insets come in three different kinds:
15150 \begin_layout Itemize
15152 \begin_inset Flex Code
15155 \begin_layout Plain Layout
15161 ): These define semantic markup corresponding to such LaTeX commands as
15163 \begin_inset Flex Code
15166 \begin_layout Plain Layout
15175 \begin_inset Flex Code
15178 \begin_layout Plain Layout
15189 \begin_layout Itemize
15191 \begin_inset Flex Code
15194 \begin_layout Plain Layout
15200 ): These can be used to define custom collapsible insets, similar to TeX
15201 code, footnote, and the like.
15202 An obvious example is an endnote inset, which is defined in the
15203 \begin_inset Flex Code
15206 \begin_layout Plain Layout
15215 \begin_layout Itemize
15217 \begin_inset Flex Code
15220 \begin_layout Plain Layout
15226 ): For use with DocBook classes.
15229 \begin_layout Standard
15230 Flex insets are defined using the
15231 \begin_inset Flex Code
15234 \begin_layout Plain Layout
15240 tag, which shall be explained in a moment.
15243 \begin_layout Standard
15245 \begin_inset Flex Code
15248 \begin_layout Plain Layout
15254 tag also serves another function: It can be used to customize the general
15255 layout of many different types of insets.
15257 \begin_inset Flex Code
15260 \begin_layout Plain Layout
15266 can be used to customize the layout parameters for footnotes, marginal
15267 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
15268 boxes, tables, algorithms, URLs, and optional arguments, as well as to
15269 define Flex insets.
15272 \begin_layout Standard
15274 \begin_inset Flex Code
15277 \begin_layout Plain Layout
15283 definition must begin with a line of the form:
15286 \begin_layout LyX-Code
15290 \begin_layout Standard
15292 \begin_inset Flex Code
15295 \begin_layout Plain Layout
15301 indicates the inset whose layout is being defined, and here there are
15302 \change_inserted 5863208 1334489266
15304 \change_deleted 5863208 1334489267
15310 \begin_layout Enumerate
15311 The layout for a pre-existing inset is being modified.
15312 In this case, can be
15313 \begin_inset Flex Code
15316 \begin_layout Plain Layout
15322 any one of the following:
15323 \begin_inset Flex Code
15326 \begin_layout Plain Layout
15333 \begin_inset Flex Code
15336 \begin_layout Plain Layout
15343 \begin_inset Flex Code
15346 \begin_layout Plain Layout
15353 \begin_inset Flex Code
15356 \begin_layout Plain Layout
15363 \begin_inset Flex Code
15366 \begin_layout Plain Layout
15373 \begin_inset Flex Code
15376 \begin_layout Plain Layout
15383 \begin_inset Flex Code
15386 \begin_layout Plain Layout
15393 \begin_inset Flex Code
15396 \begin_layout Plain Layout
15403 \begin_inset Flex Code
15406 \begin_layout Plain Layout
15413 \begin_inset Flex Code
15416 \begin_layout Plain Layout
15423 \begin_inset Flex Code
15426 \begin_layout Plain Layout
15433 \begin_inset Flex Code
15436 \begin_layout Plain Layout
15443 \begin_inset Flex Code
15446 \begin_layout Plain Layout
15453 \begin_inset Flex Code
15456 \begin_layout Plain Layout
15463 \begin_inset Flex Code
15466 \begin_layout Plain Layout
15473 \begin_inset Flex Code
15476 \begin_layout Plain Layout
15483 \begin_inset Flex Code
15486 \begin_layout Plain Layout
15493 \begin_inset Flex Code
15496 \begin_layout Plain Layout
15498 \change_deleted -712698321 1353866704
15502 \change_inserted -712698321 1353866707
15511 \begin_inset Flex Code
15514 \begin_layout Plain Layout
15521 \begin_inset Flex Code
15524 \begin_layout Plain Layout
15533 \begin_layout Enumerate
15534 The layout for a Flex inset is being defined.
15536 \begin_inset Flex Code
15539 \begin_layout Plain Layout
15545 must be of the form
15546 \begin_inset Quotes eld
15550 \begin_inset Flex Code
15553 \begin_layout Plain Layout
15560 \begin_inset Quotes erd
15564 \begin_inset Flex Code
15567 \begin_layout Plain Layout
15573 may be be any valid identifier not used by a pre-existing Flex inset.
15574 The identifier may include spaces, but in that case the whole thing must
15575 be wrapped in quotes.
15576 Note that the definition of a flex inset
15581 \begin_inset Flex Code
15584 \begin_layout Plain Layout
15590 entry, declaring which type of inset it defines.
15591 \change_inserted 5863208 1334489312
15595 \begin_layout Enumerate
15597 \change_inserted 5863208 1334492248
15598 The layout for user specific branch is being defined.
15600 \begin_inset Flex Code
15603 \begin_layout Plain Layout
15605 \change_inserted 5863208 1334489384
15611 must be of the form
15612 \begin_inset Quotes eld
15616 \begin_inset Flex Code
15619 \begin_layout Plain Layout
15621 \change_inserted 5863208 1334489392
15628 \begin_inset Quotes erd
15632 \begin_inset Flex Code
15635 \begin_layout Plain Layout
15637 \change_inserted 5863208 1334489384
15643 may be be any valid identifier of branch defined in user's document.
15644 The identifier may include spaces, but in that case the whole thing must
15645 be wrapped in quotes.
15646 The main purpose of this feature is to allow LaTeX wrapping around specific
15647 branches as user needs.
15652 \begin_layout Standard
15654 \begin_inset Flex Code
15657 \begin_layout Plain Layout
15663 definition can contain the following entries:
15666 \begin_layout Description
15668 \change_inserted -712698321 1353681390
15669 \begin_inset Flex Code
15672 \begin_layout Plain Layout
15674 \change_inserted -712698321 1353681344
15681 \begin_inset Flex Code
15684 \begin_layout Plain Layout
15686 \change_inserted -712698321 1353681344
15692 ] Defines argument number <int> of a command\SpecialChar \slash{}
15693 environment associated with
15694 the current layout.
15695 The definition must end with
15696 \begin_inset Flex Code
15699 \begin_layout Plain Layout
15701 \change_inserted -712698321 1353681344
15709 \begin_inset space ~
15713 \begin_inset CommandInset ref
15715 reference "sub:Paragraph-Styles"
15722 \begin_layout Description
15724 \change_inserted -195340706 1333913893
15725 \begin_inset Flex Code
15728 \begin_layout Plain Layout
15734 Preamble for changing languages.
15736 \begin_inset space ~
15740 \begin_inset CommandInset ref
15742 reference "sub:I18n"
15749 \begin_layout Description
15750 \begin_inset Flex Code
15753 \begin_layout Plain Layout
15759 The color for the inset's background.
15760 The valid colors are defined in
15761 \begin_inset Flex Code
15764 \begin_layout Plain Layout
15773 \begin_layout Description
15774 \begin_inset Flex Code
15777 \begin_layout Plain Layout
15784 \begin_inset Flex Code
15787 \begin_layout Plain Layout
15796 \begin_inset Flex Code
15799 \begin_layout Plain Layout
15805 ] Whether to use the content of the inset as the label, when the inset is
15810 \begin_layout Description
15811 \begin_inset Flex Code
15814 \begin_layout Plain Layout
15821 \begin_inset Flex Code
15824 \begin_layout Plain Layout
15830 Copies all the features of an existing style into the current one.
15834 \begin_layout Description
15835 \begin_inset Flex Code
15838 \begin_layout Plain Layout
15845 \begin_inset Flex Code
15848 \begin_layout Plain Layout
15857 \begin_inset Flex Code
15860 \begin_layout Plain Layout
15866 ] Indicates whether the user may employ the Paragraph Settings dialog to
15867 customize the paragraph.
15870 \begin_layout Description
15871 \begin_inset Flex Code
15874 \begin_layout Plain Layout
15881 \begin_inset Flex Code
15884 \begin_layout Plain Layout
15891 \begin_inset Flex Code
15894 \begin_layout Plain Layout
15901 \begin_inset Flex Code
15904 \begin_layout Plain Layout
15910 , describing the rendering style used for the inset's frame and buttons.
15911 Footnotes generally use
15912 \begin_inset Flex Code
15915 \begin_layout Plain Layout
15921 , ERT insets generally
15922 \begin_inset Flex Code
15925 \begin_layout Plain Layout
15931 , and character styles
15932 \begin_inset Flex Code
15935 \begin_layout Plain Layout
15944 \begin_layout Description
15945 \begin_inset Flex Code
15948 \begin_layout Plain Layout
15955 \begin_inset Flex Code
15958 \begin_layout Plain Layout
15965 \begin_inset Flex Code
15968 \begin_layout Plain Layout
15977 \begin_inset Flex Code
15980 \begin_layout Plain Layout
15987 \begin_inset Flex Code
15990 \begin_layout Plain Layout
15997 Indicates whether the environment will stand on its own in LaTeX output
15998 or will appear inline with the surrounding text.
15999 If set to false, it is supposed that the LaTeX environment ignores white
16000 space (including one newline character) after the
16001 \begin_inset Flex Code
16004 \begin_layout Plain Layout
16017 \begin_inset Flex Code
16020 \begin_layout Plain Layout
16036 \begin_layout Description
16037 \begin_inset Flex Code
16040 \begin_layout Plain Layout
16046 Required at the end of the InsetLayout declarations.
16049 \begin_layout Description
16050 \begin_inset Flex Code
16053 \begin_layout Plain Layout
16059 The font used for both the text body
16065 \begin_inset space ~
16069 \begin_inset CommandInset ref
16071 reference "sub:Font-description"
16076 Note that defining this font automatically defines the
16077 \begin_inset Flex Code
16080 \begin_layout Plain Layout
16086 to the same value, so define this first and define
16087 \begin_inset Flex Code
16090 \begin_layout Plain Layout
16096 later if you want them to be different.
16097 \change_inserted 155139281 1354130923
16101 \begin_layout Description
16103 \change_inserted 155139281 1354130923
16104 \begin_inset Flex Code
16107 \begin_layout Plain Layout
16109 \change_inserted 155139281 1354130923
16110 ForceLocalFontSwitch
16116 \begin_inset Flex Code
16119 \begin_layout Plain Layout
16121 \change_inserted 155139281 1354130923
16130 \begin_inset Flex Code
16133 \begin_layout Plain Layout
16135 \change_inserted 155139281 1354130923
16141 ] When using babel, always use a local font switch (
16142 \begin_inset Flex Code
16145 \begin_layout Plain Layout
16147 \change_inserted 155139281 1354130923
16155 ), never a global one (such as
16156 \begin_inset Flex Code
16159 \begin_layout Plain Layout
16161 \change_inserted 155139281 1354130923
16174 \begin_layout Description
16175 \begin_inset Flex Code
16178 \begin_layout Plain Layout
16185 \begin_inset Quotes eld
16189 \begin_inset Quotes erd
16192 language, leading to Left-to-Right (latin) output, e.
16193 \begin_inset space \thinspace{}
16197 \begin_inset space \space{}
16200 in TeX code or URL.
16204 \begin_layout Description
16205 \begin_inset Flex Code
16208 \begin_layout Plain Layout
16215 \begin_inset Flex Code
16218 \begin_layout Plain Layout
16227 \begin_inset Flex Code
16230 \begin_layout Plain Layout
16236 ] Indicates whether the
16237 \begin_inset Flex Code
16240 \begin_layout Plain Layout
16246 should be used or, instead, the user can change the paragraph style used
16251 \begin_layout Description
16252 \begin_inset Flex Code
16255 \begin_layout Plain Layout
16262 \begin_inset Flex Code
16265 \begin_layout Plain Layout
16274 \begin_inset Flex Code
16277 \begin_layout Plain Layout
16283 ] Usually LyX doesn't allow you to insert more than one space between words,
16284 since a space is considered as the separation between two words, not a
16285 character or symbol of its own.
16286 This is a very fine thing but sometimes annoying, for example, when typing
16287 program code or plain LaTeX code.
16289 \begin_inset Flex Code
16292 \begin_layout Plain Layout
16299 Note that LyX will create protected blanks for the additional blanks when
16300 in another mode than LaTeX-mode.
16304 \begin_layout Description
16305 \begin_inset Flex Code
16308 \begin_layout Plain Layout
16314 These tags control XHTML output.
16316 \begin_inset CommandInset ref
16318 reference "sec:Tags-for-XHTML"
16325 \begin_layout Description
16326 \begin_inset Flex Code
16329 \begin_layout Plain Layout
16336 \begin_inset Flex Code
16339 \begin_layout Plain Layout
16348 \begin_inset Flex Code
16351 \begin_layout Plain Layout
16357 ] Whether to include the contents of this inset in the strings generated
16358 for the `Outline' pane.
16359 One would not, for example, want the content of a footnote in a section
16360 header to be included in the TOC displayed in the outline, but one would
16361 normally want the content of a character style displayed.
16362 Default is false: not to include.
16365 \begin_layout Description
16366 \begin_inset Flex Code
16369 \begin_layout Plain Layout
16376 \begin_inset Flex Code
16379 \begin_layout Plain Layout
16388 \begin_inset Flex Code
16391 \begin_layout Plain Layout
16397 ] Usually LyX does not allow you to leave a paragraph empty, since it would
16398 lead to empty LaTeX output.
16399 There are some cases where this could be desirable however: in a letter
16400 template, the required fields can be provided as empty fields, so that
16401 people do not forget them; in some special classes, a style can be used
16402 as some kind of break, which does not contain actual text.
16406 \begin_layout Description
16407 \begin_inset Flex Code
16410 \begin_layout Plain Layout
16416 The font used for the label.
16418 \begin_inset space ~
16422 \begin_inset CommandInset ref
16424 reference "sub:Font-description"
16429 Note that this definition can never appear before
16430 \begin_inset Flex Code
16433 \begin_layout Plain Layout
16439 , lest it be ineffective.
16442 \begin_layout Description
16443 \begin_inset Flex Code
16446 \begin_layout Plain Layout
16452 What will be displayed on the button or elsewhere as the inset label.
16454 \begin_inset Flex Code
16457 \begin_layout Plain Layout
16464 \begin_inset Flex Code
16467 \begin_layout Plain Layout
16473 ) modify this label on the fly.
16476 \begin_layout Description
16478 \change_inserted -195340706 1333913893
16479 \begin_inset Flex Code
16482 \begin_layout Plain Layout
16488 Language dependent preamble.
16490 \begin_inset space ~
16494 \begin_inset CommandInset ref
16496 reference "sub:I18n"
16503 \begin_layout Description
16504 \begin_inset Flex Code
16507 \begin_layout Plain Layout
16513 The name of the corresponding LaTeX stuff.
16514 Either the environment or command name.
16517 \begin_layout Description
16518 \begin_inset Flex Code
16521 \begin_layout Plain Layout
16527 The optional parameter for the corresponding
16528 \begin_inset Flex Code
16531 \begin_layout Plain Layout
16537 stuff, including possible bracket pairs like
16538 \begin_inset Flex Code
16541 \begin_layout Plain Layout
16548 This parameter cannot be changed from within LyX.
16551 \begin_layout Description
16552 \begin_inset Flex Code
16555 \begin_layout Plain Layout
16562 \begin_inset Flex Code
16565 \begin_layout Plain Layout
16567 \change_deleted -712698321 1353867544
16574 Command, Environment,
16575 \change_inserted -712698321 1353867573
16577 \change_deleted -712698321 1353867557
16586 \begin_inset Flex Code
16589 \begin_layout Plain Layout
16591 \change_deleted -712698321 1353867564
16595 \change_deleted -712698321 1353867569
16603 ] How the style should be translated into LaTeX.
16607 \begin_layout Plain Layout
16608 \begin_inset Flex Code
16611 \begin_layout Plain Layout
16617 is perhaps a bit misleading, since these rules apply to SGML classes, too.
16618 Visit the SGML class files for specific examples.
16627 \begin_layout Itemize
16628 \begin_inset Flex Code
16631 \begin_layout Plain Layout
16633 \change_deleted -712698321 1353867582
16635 \change_inserted -712698321 1353867583
16643 means nothing special.
16647 \begin_layout Itemize
16648 \begin_inset Flex Code
16651 \begin_layout Plain Layout
16658 \begin_inset Flex Code
16661 \begin_layout Plain Layout
16668 {\SpecialChar \ldots{}
16677 \begin_layout Itemize
16678 \begin_inset Flex Code
16681 \begin_layout Plain Layout
16688 \begin_inset Flex Code
16691 \begin_layout Plain Layout
16698 }\SpecialChar \ldots{}
16714 \begin_layout Itemize
16716 \change_deleted -712698321 1353867600
16717 \begin_inset Flex Code
16720 \begin_layout Plain Layout
16727 \begin_inset Flex Code
16730 \begin_layout Plain Layout
16737 \begin_inset Flex Code
16740 \begin_layout Plain Layout
16748 is generated for each paragraph of this environment.
16752 \begin_layout Itemize
16754 \change_deleted -712698321 1353867600
16755 \begin_inset Flex Code
16758 \begin_layout Plain Layout
16765 \begin_inset Flex Code
16768 \begin_layout Plain Layout
16775 \begin_inset Flex Code
16778 \begin_layout Plain Layout
16784 is passed as an argument to the environment.
16786 \begin_inset Flex Code
16789 \begin_layout Plain Layout
16795 can be defined in the
16796 \begin_inset Flex MenuItem
16799 \begin_layout Plain Layout
16804 \SpecialChar \menuseparator
16810 \begin_inset space ~
16824 \begin_layout Standard
16825 Putting the last few things together, the LaTeX output will be either:
16828 \begin_layout LyX-Code
16831 latexname[latexparam]{\SpecialChar \ldots{}
16835 \begin_layout Standard
16839 \begin_layout LyX-Code
16842 begin{latexname}[latexparam] \SpecialChar \ldots{}
16848 \begin_layout Standard
16849 depending upon the LaTeX type.
16853 \begin_layout Description
16855 \change_inserted -712698321 1354263128
16856 \begin_inset Flex Code
16859 \begin_layout Plain Layout
16861 \change_inserted -712698321 1353866742
16870 \begin_inset Flex Code
16873 \begin_layout Plain Layout
16875 \change_inserted -712698321 1353866752
16881 ] A string that is put at the beginning of the layout content.
16882 A line break in the output can be indicated by
16883 \begin_inset Flex Code
16886 \begin_layout Plain Layout
16888 \change_inserted -712698321 1354263128
16899 \begin_layout Description
16900 \begin_inset Flex Code
16903 \begin_layout Plain Layout
16910 \begin_inset Flex Code
16913 \begin_layout Plain Layout
16920 \begin_inset Flex Code
16923 \begin_layout Plain Layout
16930 \begin_inset Flex Code
16933 \begin_layout Plain Layout
16940 \begin_inset Flex Code
16943 \begin_layout Plain Layout
16949 (indicating a dummy definition ending definitions of charstyles, etc).
16950 This entry is required in and is only meaningful for Flex insets.
16951 Among other things, it determines on which menu this inset will appear.
16953 \begin_inset Flex Code
16956 \begin_layout Plain Layout
16963 \begin_inset Flex Code
16966 \begin_layout Plain Layout
16973 \begin_inset Flex Code
16976 \begin_layout Plain Layout
16984 \begin_inset Flex Code
16987 \begin_layout Plain Layout
16993 can be set to true for charstyle insets, if you wish, by setting it
16998 \begin_inset Flex Code
17001 \begin_layout Plain Layout
17010 \begin_layout Description
17011 \begin_inset Flex Code
17014 \begin_layout Plain Layout
17021 \begin_inset Flex Code
17024 \begin_layout Plain Layout
17033 \begin_inset Flex Code
17036 \begin_layout Plain Layout
17042 ] Whether multiple paragraphs are permitted in this inset.
17044 \begin_inset Flex Code
17047 \begin_layout Plain Layout
17053 to the same value and
17054 \begin_inset Flex Code
17057 \begin_layout Plain Layout
17063 to the opposite value.
17064 These can be reset to other values, if they are used
17069 \begin_inset Flex Code
17072 \begin_layout Plain Layout
17082 \begin_layout Description
17083 \begin_inset Flex Code
17086 \begin_layout Plain Layout
17093 \begin_inset Flex Code
17096 \begin_layout Plain Layout
17105 \begin_inset Flex Code
17108 \begin_layout Plain Layout
17114 ] Whether fragile commands in this inset should be
17115 \begin_inset Flex Code
17118 \begin_layout Plain Layout
17131 whether the command should itself be protected.) Default is false.
17134 \begin_layout Description
17135 \begin_inset Flex Code
17138 \begin_layout Plain Layout
17145 \begin_inset Flex Code
17148 \begin_layout Plain Layout
17157 \begin_inset Flex Code
17160 \begin_layout Plain Layout
17166 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
17167 output, but only by a line break; together with
17168 \begin_inset Flex Code
17171 \begin_layout Plain Layout
17177 , this allows to emulate a plain text editor (like the ERT inset).
17181 \begin_layout Description
17182 \begin_inset Flex Code
17185 \begin_layout Plain Layout
17192 \begin_inset Flex Code
17195 \begin_layout Plain Layout
17204 \begin_inset Flex Code
17207 \begin_layout Plain Layout
17213 ] Whether the contents of this paragraph should be output in raw form, meaning
17214 without special translations that LaTeX would require.
17217 \begin_layout Description
17218 \begin_inset Flex Code
17221 \begin_layout Plain Layout
17227 Information to be included in the LaTeX preamble when this style is used.
17228 Used to define macros, load packages, etc., required by this particular
17231 \begin_inset Quotes eld
17235 \begin_inset Flex Code
17238 \begin_layout Plain Layout
17245 \begin_inset Quotes erd
17251 \begin_layout Description
17252 \begin_inset Flex Code
17255 \begin_layout Plain Layout
17262 \begin_inset Flex Code
17265 \begin_layout Plain Layout
17271 ] The prefix to use when creating labels referring to insets of this type.
17272 This allows the use of formatted references.
17275 \begin_layout Description
17276 \begin_inset Flex Code
17279 \begin_layout Plain Layout
17286 \begin_inset Flex Code
17289 \begin_layout Plain Layout
17295 ] Whether the style requires the feature
17296 \begin_inset Flex Code
17299 \begin_layout Plain Layout
17306 See the description of
17307 \begin_inset Flex Code
17310 \begin_layout Plain Layout
17317 \begin_inset CommandInset ref
17318 LatexCommand pageref
17319 reference "des:FreeSpacing"
17323 ) for information on `features'.
17327 \begin_layout Description
17328 \begin_inset Flex Code
17331 \begin_layout Plain Layout
17338 \begin_inset Flex Code
17341 \begin_layout Plain Layout
17348 \begin_inset Flex Code
17351 \begin_layout Plain Layout
17359 ] Whether this inset should use the font of its surrounding environment
17361 Default is true: uses its own.
17362 \change_inserted -712698321 1353866806
17366 \begin_layout Description
17368 \change_inserted -712698321 1354263134
17369 \begin_inset Flex Code
17372 \begin_layout Plain Layout
17374 \change_inserted -712698321 1353866810
17381 \begin_inset Flex Code
17384 \begin_layout Plain Layout
17386 \change_inserted -712698321 1353866806
17392 ] A string that is put at the end of the layout content.
17393 A line break in the output can be indicated by
17394 \begin_inset Flex Code
17397 \begin_layout Plain Layout
17399 \change_inserted -712698321 1354263134
17410 \begin_layout Description
17411 \begin_inset Flex Code
17414 \begin_layout Plain Layout
17421 \begin_inset Flex Code
17424 \begin_layout Plain Layout
17431 \begin_inset Flex Code
17434 \begin_layout Plain Layout
17442 ] Spellcheck the contents of this inset.
17446 \begin_layout Subsection
17448 \begin_inset CommandInset label
17450 name "sub:Counters"
17457 \begin_layout Standard
17458 Since version 1.3.0 of LyX, it is both possible and necessary to define the
17460 \begin_inset Flex MenuItem
17463 \begin_layout Plain Layout
17470 \begin_inset Flex MenuItem
17473 \begin_layout Plain Layout
17479 , \SpecialChar \ldots{}
17480 ) in the text class itself.
17481 The standard counters are defined in the file
17482 \begin_inset Flex Code
17485 \begin_layout Plain Layout
17491 , so you may have to do no more than add
17494 \begin_layout LyX-Code
17495 Input stdcounters.inc
17498 \begin_layout Standard
17499 to your layout file to get them to work.
17500 But if you want to define custom counters, then you can do so.
17501 The counter declaration must begin with:
17504 \begin_layout LyX-Code
17505 Counter CounterName
17508 \begin_layout Standard
17510 \begin_inset Flex Code
17513 \begin_layout Plain Layout
17519 ' is replaced by the name of the counter.
17520 And it must end with
17521 \begin_inset Quotes eld
17525 \begin_inset Flex Code
17528 \begin_layout Plain Layout
17535 \begin_inset Quotes erd
17539 The following parameters can also be used:
17542 \begin_layout Description
17543 \begin_inset Flex Code
17546 \begin_layout Plain Layout
17553 \begin_inset Flex Code
17556 \begin_layout Plain Layout
17563 \begin_inset Quotes erd
17567 \begin_inset Quotes erd
17570 ] When defined, this string defines how the counter is displayed.
17571 Setting this value sets
17572 \begin_inset Flex Code
17575 \begin_layout Plain Layout
17576 LabelStringAppendix
17582 The following special constructs can be used in the string:
17586 \begin_layout Itemize
17587 \begin_inset Flex Code
17590 \begin_layout Plain Layout
17598 will be replaced by the expansion of the
17599 \begin_inset Flex Code
17602 \begin_layout Plain Layout
17609 \begin_inset Flex Code
17612 \begin_layout Plain Layout
17613 LabelStringAppendix
17619 \begin_inset Flex Code
17622 \begin_layout Plain Layout
17632 \begin_layout Itemize
17633 counter values can be expressed using LaTeX-like macros
17634 \begin_inset Flex Code
17637 \begin_layout Plain Layout
17654 \begin_inset Flex Code
17657 \begin_layout Plain Layout
17669 \begin_layout Plain Layout
17679 Actually, the situation is a bit more complicated: any
17698 other than those described below will produce arabic numerals.
17699 It would not be surprising to see this change in the future.
17705 \begin_inset Flex Code
17708 \begin_layout Plain Layout
17714 : 1, 2, 3,\SpecialChar \ldots{}
17716 \begin_inset Flex Code
17719 \begin_layout Plain Layout
17725 for lower-case letters: a, b, c, \SpecialChar \ldots{}
17727 \begin_inset Flex Code
17730 \begin_layout Plain Layout
17736 for upper-case letters: A, B, C, \SpecialChar \ldots{}
17738 \begin_inset Flex Code
17741 \begin_layout Plain Layout
17747 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
17749 \begin_inset Flex Code
17752 \begin_layout Plain Layout
17758 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
17760 \begin_inset Flex Code
17763 \begin_layout Plain Layout
17769 for hebrew numerals.
17773 \begin_layout Standard
17774 If LabelString is not defined, a default value is constructed as follows:
17775 if the counter has a master counter
17776 \begin_inset Flex Code
17779 \begin_layout Plain Layout
17786 \begin_inset Flex Code
17789 \begin_layout Plain Layout
17796 \begin_inset Flex Code
17799 \begin_layout Plain Layout
17809 is used; otherwise the string
17810 \begin_inset Flex Code
17813 \begin_layout Plain Layout
17824 \begin_layout Description
17825 \begin_inset Flex Code
17828 \begin_layout Plain Layout
17829 LabelStringAppendix
17835 \begin_inset Flex Code
17838 \begin_layout Plain Layout
17845 \begin_inset Quotes erd
17849 \begin_inset Quotes erd
17853 \begin_inset Flex Code
17856 \begin_layout Plain Layout
17862 , but for use in the Appendix.
17865 \begin_layout Description
17866 \begin_inset Flex Code
17869 \begin_layout Plain Layout
17876 \begin_inset Flex Code
17879 \begin_layout Plain Layout
17886 \begin_inset Quotes erd
17890 \begin_inset Quotes erd
17893 ] A format for use with formatted references to this counter.
17894 For example, one might want to have references to section numbers appear
17896 \begin_inset Quotes eld
17900 \begin_inset Quotes erd
17904 The string should contain
17905 \begin_inset Quotes eld
17909 \begin_inset Quotes erd
17913 This will be replaced by the counter number itself.
17914 So, for sections, it would be: Section ##.
17917 \begin_layout Description
17918 \begin_inset Flex Code
17921 \begin_layout Plain Layout
17928 \begin_inset Flex Code
17931 \begin_layout Plain Layout
17938 \begin_inset Quotes erd
17942 \begin_inset Quotes erd
17945 ] If this is set to the name of another counter, the present counter will
17946 be reset every time the other one is increased.
17948 \begin_inset Flex Code
17951 \begin_layout Plain Layout
17958 \begin_inset Flex Code
17961 \begin_layout Plain Layout
17970 \begin_layout Subsection
17972 \begin_inset CommandInset label
17974 name "sub:Font-description"
17981 \begin_layout Standard
17982 A font description looks like this:
17985 \begin_layout LyX-Code
17995 \begin_layout LyX-Code
17999 \begin_layout LyX-Code
18003 \begin_layout Standard
18004 The following commands are available:
18007 \begin_layout Description
18008 \begin_inset Flex Code
18011 \begin_layout Plain Layout
18018 \begin_inset Flex Code
18021 \begin_layout Plain Layout
18030 \begin_inset Flex Code
18033 \begin_layout Plain Layout
18040 \begin_inset Flex Code
18043 \begin_layout Plain Layout
18050 \begin_inset Flex Code
18053 \begin_layout Plain Layout
18060 \begin_inset Flex Code
18063 \begin_layout Plain Layout
18070 \begin_inset Flex Code
18073 \begin_layout Plain Layout
18080 \begin_inset Flex Code
18083 \begin_layout Plain Layout
18090 \begin_inset Flex Code
18093 \begin_layout Plain Layout
18100 \begin_inset Flex Code
18103 \begin_layout Plain Layout
18112 \begin_layout Description
18113 \begin_inset Flex Code
18116 \begin_layout Plain Layout
18123 \begin_inset Flex Code
18126 \begin_layout Plain Layout
18135 \begin_inset Flex Code
18138 \begin_layout Plain Layout
18145 \begin_inset Flex Code
18148 \begin_layout Plain Layout
18157 \begin_layout Description
18158 \begin_inset Flex Code
18161 \begin_layout Plain Layout
18168 \begin_inset Flex Code
18171 \begin_layout Plain Layout
18177 ] Valid arguments are:
18178 \begin_inset Flex Code
18181 \begin_layout Plain Layout
18188 \begin_inset Flex Code
18191 \begin_layout Plain Layout
18198 \begin_inset Flex Code
18201 \begin_layout Plain Layout
18208 \begin_inset Flex Code
18211 \begin_layout Plain Layout
18218 \begin_inset Flex Code
18221 \begin_layout Plain Layout
18228 \begin_inset Flex Code
18231 \begin_layout Plain Layout
18238 \begin_inset Flex Code
18241 \begin_layout Plain Layout
18248 \begin_inset Flex Code
18251 \begin_layout Plain Layout
18258 \begin_inset Flex Code
18261 \begin_layout Plain Layout
18268 \begin_inset Flex Code
18271 \begin_layout Plain Layout
18278 \begin_inset Flex Code
18281 \begin_layout Plain Layout
18288 \begin_inset Flex Code
18291 \begin_layout Plain Layout
18298 Each of these turns on or off the corresponding attribute.
18300 \begin_inset Flex Code
18303 \begin_layout Plain Layout
18309 turns on emphasis, and
18310 \begin_inset Flex Code
18313 \begin_layout Plain Layout
18321 \begin_inset Newline newline
18324 If the latter seems puzzling, remember that the font settings for the present
18325 context are generally inherited from the surrounding context.
18327 \begin_inset Flex Code
18330 \begin_layout Plain Layout
18336 would turn off the emphasis that was anyway in effect, say, in a theorem
18340 \begin_layout Description
18341 \begin_inset Flex Code
18344 \begin_layout Plain Layout
18351 \begin_inset Flex Code
18354 \begin_layout Plain Layout
18363 \begin_inset Flex Code
18366 \begin_layout Plain Layout
18375 \begin_layout Description
18376 \begin_inset Flex Code
18379 \begin_layout Plain Layout
18386 \begin_inset Flex Code
18389 \begin_layout Plain Layout
18398 \begin_inset Flex Code
18401 \begin_layout Plain Layout
18408 \begin_inset Flex Code
18411 \begin_layout Plain Layout
18418 \begin_inset Flex Code
18421 \begin_layout Plain Layout
18430 \begin_layout Description
18431 \begin_inset Flex Code
18434 \begin_layout Plain Layout
18441 \begin_inset Flex Code
18444 \begin_layout Plain Layout
18451 \begin_inset Flex Code
18454 \begin_layout Plain Layout
18461 \begin_inset Flex Code
18464 \begin_layout Plain Layout
18473 \begin_inset Flex Code
18476 \begin_layout Plain Layout
18483 \begin_inset Flex Code
18486 \begin_layout Plain Layout
18493 \begin_inset Flex Code
18496 \begin_layout Plain Layout
18503 \begin_inset Flex Code
18506 \begin_layout Plain Layout
18513 \begin_inset Flex Code
18516 \begin_layout Plain Layout
18525 \begin_layout Subsection
18526 \begin_inset CommandInset label
18528 name "sub:Citation-format-description"
18532 Citation format description
18535 \begin_layout Standard
18537 \begin_inset Flex Code
18540 \begin_layout Plain Layout
18546 blocks are used to describe how bibliographic information should be displayed,
18547 both within LyX itself (in the citation dialog and in tooltips, for example)
18548 and in XHTML output.
18549 Such a block might look like this:
18552 \begin_layout LyX-Code
18556 \begin_layout LyX-Code
18560 \begin_layout LyX-Code
18564 \begin_layout LyX-Code
18568 \begin_layout Standard
18569 The individual lines define how the bibliographic information associated
18570 with an article or book, respectively, is to be displayed, and such a definitio
18571 n can be given for any `entry type' that might be present in a BibTeX file.
18572 LyX defines a default format in the source code that will be used if no
18573 specific definition has been given.
18574 LyX predefines several formats in the file
18575 \begin_inset Flex Code
18578 \begin_layout Plain Layout
18584 , which is included in most of LyX's document classes.
18587 \begin_layout Standard
18588 The definitions use a simple language that allows BibTeX keys to be replaced
18590 Keys should be enclosed in
18591 \begin_inset Flex Code
18594 \begin_layout Plain Layout
18601 \begin_inset Flex Code
18604 \begin_layout Plain Layout
18611 So a simple definition might look like this:
18614 \begin_layout LyX-Code
18616 \begin_inset Quotes eld
18620 \begin_inset Quotes erd
18626 \begin_layout Standard
18627 This would print the author, followed by a comma, followed by the title,
18628 in quotes, followed by a period.
18631 \begin_layout Standard
18632 Of course, sometimes you may want to print a key only if it exists.
18633 This can be done by using a conditional construction, such as:
18634 \begin_inset Flex Code
18637 \begin_layout Plain Layout
18639 \begin_inset space ~
18649 \begin_inset Flex Code
18652 \begin_layout Plain Layout
18658 key exists, then print
18659 \begin_inset Quotes eld
18663 \begin_inset space ~
18667 \begin_inset Quotes erd
18670 followed by the volume key.
18671 It is also possible to have an else clause in the conditional, such as:
18673 \begin_inset Flex Code
18676 \begin_layout Plain Layout
18677 {%author%[[%author%]][[%editor%, ed.]]}
18684 \begin_inset Flex Code
18687 \begin_layout Plain Layout
18693 key is printed if it exists; otherwise, the editor key is printed, followed
18695 \begin_inset Quotes eld
18699 \begin_inset space ~
18703 \begin_inset Quotes erd
18706 Note that the key is again enclosed in
18707 \begin_inset Flex Code
18710 \begin_layout Plain Layout
18716 signs; the entire conditional is enclosed in braces; and the if and else
18717 clauses are enclosed in double brackets,
18718 \begin_inset Quotes eld
18722 \begin_inset Flex Code
18725 \begin_layout Plain Layout
18732 \begin_inset Quotes eld
18736 \begin_inset Quotes eld
18740 \begin_inset Flex Code
18743 \begin_layout Plain Layout
18750 \begin_inset Quotes erd
18754 There must be no space between any of these.
18757 \begin_layout Standard
18758 There is one other piece of syntax available in definitions, which looks
18760 \begin_inset Flex Code
18763 \begin_layout Plain Layout
18770 This defines a piece of formatting information that is to be used when
18772 \begin_inset Quotes eld
18776 \begin_inset Quotes erd
18780 Obviously, we do not want to output HTML tags when writing plain text,
18781 so they should be wrapped in
18782 \begin_inset Quotes eld
18786 \begin_inset Quotes erd
18790 \begin_inset Quotes eld
18794 \begin_inset Quotes erd
18800 \begin_layout Standard
18801 Two special sorts of definitions are also possible in a
18802 \begin_inset Flex Code
18805 \begin_layout Plain Layout
18812 An example of the first would be:
18815 \begin_layout LyX-Code
18817 \begin_inset Quotes eld
18821 \begin_inset Quotes erd
18827 \begin_layout Standard
18828 This is an abbreviation, or macro, and it can be used by treating it as
18830 \begin_inset Flex Code
18833 \begin_layout Plain Layout
18841 \begin_inset Flex Code
18844 \begin_layout Plain Layout
18850 exactly as it would treat its definition.
18851 So, let us issue the obvious
18859 \begin_layout LyX-Code
18863 \begin_layout Standard
18864 or anything like it.
18865 LyX shouldn't go into an infinite loop, but it may go into a long one before
18869 \begin_layout Standard
18870 The second sort of special definition might look like this:
18873 \begin_layout LyX-Code
18877 \begin_layout Standard
18878 This defines a translatable piece of text, which allows relevant parts of
18879 the bibliography to be translated.
18880 It can be included in a definition by treating it as a key:
18881 \begin_inset Flex Code
18884 \begin_layout Plain Layout
18891 Several of these are predefined in
18892 \begin_inset Flex Code
18895 \begin_layout Plain Layout
18902 Note that these are not macros, in the sense just defined.
18903 They will not be expanded.
18906 \begin_layout Standard
18907 So here then is an example that use all these features:
18910 \begin_layout LyX-Code
18911 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
18914 \begin_layout Standard
18915 This defines a macro that prints the author, followed by a comma, if the
18917 \begin_inset Flex Code
18920 \begin_layout Plain Layout
18926 key is defined, or else prints the name of the editor, followed by the
18928 \begin_inset Flex Code
18931 \begin_layout Plain Layout
18937 or its translation (it is by default
18938 \begin_inset Quotes eld
18942 \begin_inset Quotes erd
18946 \begin_inset Flex Code
18949 \begin_layout Plain Layout
18956 Note that this is in fact defined in
18957 \begin_inset Flex Code
18960 \begin_layout Plain Layout
18966 , so you can use it in your own definitions, or re-definitions, if you load
18970 \begin_layout Section
18971 \begin_inset CommandInset label
18973 name "sec:Tags-for-XHTML"
18977 Tags for XHTML output
18980 \begin_layout Standard
18981 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
18982 by layout information.
18983 In general, LyX provides sensible defaults and, as mentioned earlier, it
18984 will even construct default CSS style rules from the other layout tags.
18985 For example, LyX will attempt to use the information provided in the
18986 \begin_inset Flex Code
18989 \begin_layout Plain Layout
18995 declaration for the Chapter style to write CSS that will appropriately
18996 format chapter headings.
18999 \begin_layout Standard
19000 In many cases, then, you may not have to do anything at all to get acceptable
19001 XHTML output for your own environments, custom insets, and so forth.
19002 But in some cases you will, and so LyX provides a number of layout tags
19003 that can be used to customize the XHTML and CSS that are generated.
19006 \begin_layout Standard
19007 Note that there are two tags,
19008 \begin_inset Flex Code
19011 \begin_layout Plain Layout
19018 \begin_inset Flex Code
19021 \begin_layout Plain Layout
19027 that may appear outside style and inset declarations.
19029 \begin_inset CommandInset ref
19031 reference "sub:General-text-class"
19035 for details on these.
19038 \begin_layout Subsection
19039 \begin_inset CommandInset label
19041 name "sub:Paragraph-Style-XHTML"
19048 \begin_layout Standard
19049 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
19050 dealing with a normal paragraph, a command, or an environment, where this
19051 is itself determined by the contents of the corresponding
19052 \begin_inset Flex Code
19055 \begin_layout Plain Layout
19065 \begin_layout Standard
19066 For a command or normal paragraph, the output XHTML has the following form:
19069 \begin_layout LyX-Code
19071 \begin_inset Quotes erd
19075 \begin_inset Quotes erd
19081 \begin_layout LyX-Code
19083 \begin_inset Quotes erd
19087 \begin_inset Quotes erd
19093 \begin_layout LyX-Code
19094 Contents of the paragraph.
19097 \begin_layout LyX-Code
19101 \begin_layout Standard
19102 The label tags are of course omitted if the paragraph does not have a label.
19105 \begin_layout Standard
19106 For an environment that is not some sort of list, the XHTML takes this form:
19109 \begin_layout LyX-Code
19111 \begin_inset Quotes erd
19115 \begin_inset Quotes erd
19121 \begin_layout LyX-Code
19123 \begin_inset Quotes erd
19127 \begin_inset Quotes erd
19131 \begin_inset Quotes erd
19135 \begin_inset Quotes erd
19138 >Environment Label</labeltag>First paragraph.</itemtag>
19141 \begin_layout LyX-Code
19142 <itemtag>Second paragraph.</itemtag>
19145 \begin_layout LyX-Code
19149 \begin_layout Standard
19150 Note that the label is output only for the first paragraph, as it should
19151 be for a theorem, for example.
19155 \begin_layout Standard
19156 For a list, we have one of these forms:
19159 \begin_layout LyX-Code
19161 \begin_inset Quotes erd
19165 \begin_inset Quotes erd
19171 \begin_layout LyX-Code
19173 \begin_inset Quotes erd
19177 \begin_inset Quotes erd
19181 \begin_inset Quotes erd
19185 \begin_inset Quotes erd
19188 >List Label</labeltag>First item.</itemtag>
19191 \begin_layout LyX-Code
19193 \begin_inset Quotes erd
19197 \begin_inset Quotes erd
19201 \begin_inset Quotes erd
19205 \begin_inset Quotes erd
19208 >List Label</labeltag>Second item.</itemtag>
19211 \begin_layout LyX-Code
19215 \begin_layout LyX-Code
19219 \begin_layout LyX-Code
19221 \begin_inset Quotes erd
19225 \begin_inset Quotes erd
19231 \begin_layout LyX-Code
19233 \begin_inset Quotes erd
19237 \begin_inset Quotes erd
19240 >List Label</labeltag><itemtag attr=
19241 \begin_inset Quotes erd
19245 \begin_inset Quotes erd
19248 >First item.</itemtag>
19251 \begin_layout LyX-Code
19253 \begin_inset Quotes erd
19257 \begin_inset Quotes erd
19260 >List Label</labeltag><itemtag attr=
19261 \begin_inset Quotes erd
19265 \begin_inset Quotes erd
19268 >Second item.</itemtag>
19271 \begin_layout LyX-Code
19275 \begin_layout Standard
19276 Note the different orders of
19277 \begin_inset Flex Code
19280 \begin_layout Plain Layout
19287 \begin_inset Flex Code
19290 \begin_layout Plain Layout
19297 Which order we get depends upon the setting of
19298 \begin_inset Flex Code
19301 \begin_layout Plain Layout
19308 \begin_inset Flex Code
19311 \begin_layout Plain Layout
19317 is false (the default), you get the first of these, with the label within
19318 the item; if true, you get the second, with the label outside the item.
19321 \begin_layout Standard
19322 The specific tags and attributes output for each paragraph type can be controlle
19323 d by means of the layout tags we are about to describe.
19324 As mentioned earlier, however, LyX uses sensible defaults for many of these,
19325 so you often may not need to do very much to get good XHTML output.
19326 Think of the available tags as there so you can tweak things to your liking.
19329 \begin_layout Description
19330 \begin_inset Flex Code
19333 \begin_layout Plain Layout
19340 \begin_inset Flex Code
19343 \begin_layout Plain Layout
19349 ] Specifies attribute information to be output with the main tag.
19351 \begin_inset Quotes eld
19355 \begin_inset Flex Code
19358 \begin_layout Plain Layout
19365 \begin_inset Quotes erd
19369 By default, LyX will output
19370 \begin_inset Quotes eld
19374 \begin_inset Flex Code
19377 \begin_layout Plain Layout
19384 \begin_inset Quotes erd
19388 \begin_inset Flex Code
19391 \begin_layout Plain Layout
19397 is the LyX name of the layout, made lowercase, for example: chapter.
19402 contain any style information.
19404 \begin_inset Flex Code
19407 \begin_layout Plain Layout
19416 \begin_layout Description
19417 \begin_inset Flex Code
19420 \begin_layout Plain Layout
19427 \begin_inset Flex Code
19430 \begin_layout Plain Layout
19440 ] Whether to output the default CSS information LyX generates for this layout,
19441 even if additional information is explicitly provided via
19442 \begin_inset Flex Code
19445 \begin_layout Plain Layout
19453 \begin_inset Flex Code
19456 \begin_layout Plain Layout
19462 allows you to alter or augment the generated CSS, rather than to override
19465 \begin_inset Flex Code
19468 \begin_layout Plain Layout
19477 \begin_layout Description
19478 \begin_inset Flex Code
19481 \begin_layout Plain Layout
19488 \begin_inset Flex Code
19491 \begin_layout Plain Layout
19497 ] The tag to be used for individual paragraphs of environments, replacing
19499 \begin_inset Flex Code
19502 \begin_layout Plain Layout
19508 in the examples above.
19510 \begin_inset Flex Code
19513 \begin_layout Plain Layout
19522 \begin_layout Description
19523 \begin_inset Flex Code
19526 \begin_layout Plain Layout
19533 \begin_inset Flex Code
19536 \begin_layout Plain Layout
19542 ] Attributes for the item tag.
19544 \begin_inset Quotes eld
19548 \begin_inset Flex Code
19551 \begin_layout Plain Layout
19552 class=`layoutname_item'
19558 \begin_inset Quotes erd
19566 contain any style information.
19568 \begin_inset Flex Code
19571 \begin_layout Plain Layout
19580 \begin_layout Description
19581 \begin_inset Flex Code
19584 \begin_layout Plain Layout
19591 \begin_inset Flex Code
19594 \begin_layout Plain Layout
19600 ] The tag to be used for paragraph and item labels, replacing
19601 \begin_inset Flex Code
19604 \begin_layout Plain Layout
19610 in the examples above.
19612 \begin_inset Flex Code
19615 \begin_layout Plain Layout
19622 \begin_inset Flex Code
19625 \begin_layout Plain Layout
19632 \begin_inset Flex Code
19635 \begin_layout Plain Layout
19642 \begin_inset Flex Code
19645 \begin_layout Plain Layout
19646 Centered_Top_Environment
19651 , in which case it defaults to
19652 \begin_inset Flex Code
19655 \begin_layout Plain Layout
19664 \begin_layout Description
19665 \begin_inset Flex Code
19668 \begin_layout Plain Layout
19675 \begin_inset Flex Code
19678 \begin_layout Plain Layout
19684 ] Attributes for the label tag.
19686 \begin_inset Quotes eld
19690 \begin_inset Flex Code
19693 \begin_layout Plain Layout
19694 class=`layoutname_label'
19700 \begin_inset Quotes erd
19708 contain any style information.
19710 \begin_inset Flex Code
19713 \begin_layout Plain Layout
19722 \begin_layout Description
19723 \begin_inset Flex Code
19726 \begin_layout Plain Layout
19733 \begin_inset Flex Code
19736 \begin_layout Plain Layout
19746 ] Meaningful only for list-like environments, this tag controls whether
19747 the label tag is output before or inside the item tag.
19748 This is used, for example, in the description environment, where we want
19750 \begin_inset Flex Code
19753 \begin_layout Plain Layout
19754 <dt>\SpecialChar \ldots{}
19755 </dt><dd>\SpecialChar \ldots{}
19763 \begin_inset Flex Code
19766 \begin_layout Plain Layout
19772 : The label tag is output inside the item tag.
19775 \begin_layout Description
19776 \begin_inset Flex Code
19779 \begin_layout Plain Layout
19785 Information to be output in the
19786 \begin_inset Flex Code
19789 \begin_layout Plain Layout
19795 section when this style is used.
19796 This might, for example, be used to include a
19797 \begin_inset Flex Code
19800 \begin_layout Plain Layout
19807 \begin_inset Flex Code
19810 \begin_layout Plain Layout
19819 \begin_layout Description
19820 \begin_inset Flex Code
19823 \begin_layout Plain Layout
19829 CSS style information to be included when this style is used.
19830 Note that this will automatically be wrapped in a layout-generated
19831 \begin_inset Flex Code
19834 \begin_layout Plain Layout
19840 block, so only the CSS itself need be included.
19843 \begin_layout Description
19844 \begin_inset Flex Code
19847 \begin_layout Plain Layout
19854 \begin_inset Flex Code
19857 \begin_layout Plain Layout
19863 ] The tag to be used for the main label, replacing
19864 \begin_inset Flex Code
19867 \begin_layout Plain Layout
19873 in the examples above.
19875 \begin_inset Flex Code
19878 \begin_layout Plain Layout
19887 \begin_layout Description
19888 \begin_inset Flex Code
19891 \begin_layout Plain Layout
19898 \begin_inset Flex Code
19901 \begin_layout Plain Layout
19911 ] Marks this style as the one to be used to generate the
19912 \begin_inset Flex Code
19915 \begin_layout Plain Layout
19921 tag for the XHTML file.
19922 By default, it is false.
19924 \begin_inset Flex Code
19927 \begin_layout Plain Layout
19933 file sets it to true for the
19934 \begin_inset Flex Code
19937 \begin_layout Plain Layout
19947 \begin_layout Subsection
19951 \begin_layout Standard
19952 The XHTML output of insets can also be controlled by information in layout
19957 \begin_layout Plain Layout
19958 At present, this is true only for
19959 \begin_inset Quotes eld
19963 \begin_inset Quotes erd
19966 insets (insets you can type into) and is not true for
19967 \begin_inset Quotes eld
19971 \begin_inset Quotes erd
19974 insets (insets that are associated with dialog boxes).
19979 Here, too, LyX tries to provide sensible defaults, and it constructs default
19981 But everything can be customized.
19984 \begin_layout Standard
19985 The XHTML LyX outputs for an inset has the following form:
19988 \begin_layout LyX-Code
19990 \begin_inset Quotes erd
19994 \begin_inset Quotes erd
20000 \begin_layout LyX-Code
20001 <labeltag>Label</labeltag>
20004 \begin_layout LyX-Code
20006 \begin_inset Quotes erd
20010 \begin_inset Quotes erd
20013 >Contents of the inset.</innertag>
20016 \begin_layout LyX-Code
20020 \begin_layout Standard
20021 If the inset permits multiple paragraphs---that is, if
20022 \begin_inset Flex Code
20025 \begin_layout Plain Layout
20031 is true---then the contents of the inset will itself be output as paragraphs
20032 formatted according to the styles used for those paragraphs (standard,
20033 quote, and the like).
20034 The label tag is of course omitted if the paragraph does not have a label
20035 and, at present, is always
20036 \begin_inset Flex Code
20039 \begin_layout Plain Layout
20046 The inner tag is optional and, by default, does not appear.
20049 \begin_layout Standard
20050 The specific tags and attributes output for each inset can be controlled
20051 by means of the following layout tags.
20054 \begin_layout Description
20055 \begin_inset Flex Code
20058 \begin_layout Plain Layout
20065 \begin_inset Flex Code
20068 \begin_layout Plain Layout
20074 ] Specifies attribute information to be output with the main tag.
20076 \begin_inset Quotes eld
20080 \begin_inset Flex Code
20083 \begin_layout Plain Layout
20084 class=`myinset' onclick=`\SpecialChar \ldots{}
20091 \begin_inset Quotes erd
20095 By default, LyX will output
20096 \begin_inset Quotes eld
20100 \begin_inset Flex Code
20103 \begin_layout Plain Layout
20110 \begin_inset Quotes erd
20114 \begin_inset Flex Code
20117 \begin_layout Plain Layout
20123 is the LyX name of the inset, made lowercase and with non-alphanumeric
20124 characters converted to underscores, for example: footnote.
20127 \begin_layout Description
20128 \begin_inset Flex Code
20131 \begin_layout Plain Layout
20138 \begin_inset Flex Code
20141 \begin_layout Plain Layout
20151 ] Whether to output the default CSS information LyX generates for this layout,
20152 even if additional information is explicitly provided via
20153 \begin_inset Flex Code
20156 \begin_layout Plain Layout
20164 \begin_inset Flex Code
20167 \begin_layout Plain Layout
20173 allows you to alter or augment the generated CSS, rather than to override
20178 \begin_layout Description
20179 \begin_inset Flex Code
20182 \begin_layout Plain Layout
20189 \begin_inset Flex Code
20192 \begin_layout Plain Layout
20198 ] Attributes for the inner tag.
20200 \begin_inset Quotes eld
20204 \begin_inset Flex Code
20207 \begin_layout Plain Layout
20208 class=`insetname_inner'
20214 \begin_inset Quotes erd
20220 \begin_layout Description
20221 \begin_inset Flex Code
20224 \begin_layout Plain Layout
20231 \begin_inset Flex Code
20234 \begin_layout Plain Layout
20240 ] The inner tag, replacing
20241 \begin_inset Flex Code
20244 \begin_layout Plain Layout
20250 in the examples above.
20251 By default, there is none.
20254 \begin_layout Description
20255 \begin_inset Flex Code
20258 \begin_layout Plain Layout
20265 \begin_inset Flex Code
20268 \begin_layout Plain Layout
20276 ] Whether this inset represents a standalone block of text (such as a footnote)
20277 or instead represents material that is included in the surrounding text
20278 (such as a branch).
20282 \begin_layout Description
20283 \begin_inset Flex Code
20286 \begin_layout Plain Layout
20293 \begin_inset Flex Code
20296 \begin_layout Plain Layout
20302 ] A label for this inset, possibly including a reference to a counter.
20303 For example, for footnote, it might be:
20304 \begin_inset Flex Code
20307 \begin_layout Plain Layout
20316 This is optional, and there is no default.
20319 \begin_layout Description
20320 \begin_inset Flex Code
20323 \begin_layout Plain Layout
20329 Information to be output in the
20330 \begin_inset Flex Code
20333 \begin_layout Plain Layout
20339 section when this style is used.
20340 This might, for example, be used to include a
20341 \begin_inset Flex Code
20344 \begin_layout Plain Layout
20351 \begin_inset Flex Code
20354 \begin_layout Plain Layout
20363 \begin_layout Description
20364 \begin_inset Flex Code
20367 \begin_layout Plain Layout
20373 CSS style information to be included when this style is used.
20374 Note that this will automatically be wrapped in a layout-generated
20375 \begin_inset Flex Code
20378 \begin_layout Plain Layout
20384 block, so only the CSS itself need be included.
20387 \begin_layout Description
20388 \begin_inset Flex Code
20391 \begin_layout Plain Layout
20398 \begin_inset Flex Code
20401 \begin_layout Plain Layout
20407 ] The tag to be used for the main label, replacing
20408 \begin_inset Flex Code
20411 \begin_layout Plain Layout
20417 in the examples above.
20418 The default depends upon the setting of
20419 \begin_inset Flex Code
20422 \begin_layout Plain Layout
20429 \begin_inset Flex Code
20432 \begin_layout Plain Layout
20438 is true, the default is
20439 \begin_inset Flex Code
20442 \begin_layout Plain Layout
20448 ; if it is false, the default is
20449 \begin_inset Flex Code
20452 \begin_layout Plain Layout
20461 \begin_layout Subsection
20465 \begin_layout Standard
20466 The XHTML output for floats too can be controlled by layout information.
20467 The output has the following form:
20470 \begin_layout LyX-Code
20472 \begin_inset Quotes erd
20476 \begin_inset Quotes erd
20482 \begin_layout LyX-Code
20483 Contents of the float.
20486 \begin_layout LyX-Code
20490 \begin_layout Standard
20491 The caption, if there is one, is a separate inset and will be output as
20493 Its appearance can be controlled via the InsetLayout for caption insets.
20497 \begin_layout Description
20498 \begin_inset Flex Code
20501 \begin_layout Plain Layout
20508 \begin_inset Flex Code
20511 \begin_layout Plain Layout
20517 ] Specifies attribute information to be output with the main tag.
20519 \begin_inset Quotes eld
20523 \begin_inset Flex Code
20526 \begin_layout Plain Layout
20527 class=`myfloat' onclick=`\SpecialChar \ldots{}
20534 \begin_inset Quotes erd
20538 By default, LyX will output
20539 \begin_inset Quotes eld
20543 \begin_inset Flex Code
20546 \begin_layout Plain Layout
20547 class=`float float-floattype'
20553 \begin_inset Quotes erd
20557 \begin_inset Flex Code
20560 \begin_layout Plain Layout
20566 is LyX's name for this type of float, as determined by the float declaration
20568 \begin_inset CommandInset ref
20570 reference "sub:Floats"
20574 ), though made lowercase and with non-alphanumeric characters converted
20575 to underscores, for example: float-table.
20578 \begin_layout Description
20579 \begin_inset Flex Code
20582 \begin_layout Plain Layout
20588 CSS style information to be included when this float is used.
20589 Note that this will automatically be wrapped in a layout-generated
20590 \begin_inset Flex Code
20593 \begin_layout Plain Layout
20599 block, so only the CSS itself need be included.
20602 \begin_layout Description
20603 \begin_inset Flex Code
20606 \begin_layout Plain Layout
20613 \begin_inset Flex Code
20616 \begin_layout Plain Layout
20622 ] The tag to be used for this float, replacing
20623 \begin_inset Quotes eld
20627 \begin_inset Flex Code
20630 \begin_layout Plain Layout
20637 \begin_inset Quotes erd
20640 in the example above.
20642 \begin_inset Flex Code
20645 \begin_layout Plain Layout
20651 and will rarely need changing.
20654 \begin_layout Subsection
20655 Bibliography formatting
20658 \begin_layout Standard
20659 The bibliography can be formatted using
20660 \begin_inset Flex Code
20663 \begin_layout Plain Layout
20671 \begin_inset CommandInset ref
20673 reference "sub:Citation-format-description"
20680 \begin_layout Subsection
20684 \begin_layout Standard
20685 We have several times mentioned that LyX will generate default CSS style
20686 rules for both insets and paragraph styles, based upon the other layout
20687 information that is provided.
20688 In this section, we shall say a word about which layout information LyX
20692 \begin_layout Standard
20693 At present, LyX auto-generates CSS only for font information, making use
20695 \begin_inset Flex Code
20698 \begin_layout Plain Layout
20705 \begin_inset Flex Code
20708 \begin_layout Plain Layout
20715 \begin_inset Flex Code
20718 \begin_layout Plain Layout
20725 \begin_inset Flex Code
20728 \begin_layout Plain Layout
20735 \begin_inset Flex Code
20738 \begin_layout Plain Layout
20746 \begin_inset CommandInset ref
20748 reference "sub:Font-description"
20752 .) The translation is mostly straightforward and obvious.
20754 \begin_inset Quotes eld
20758 \begin_inset Flex Code
20761 \begin_layout Plain Layout
20768 \begin_inset Quotes erd
20772 \begin_inset Quotes eld
20776 \begin_inset Flex Code
20779 \begin_layout Plain Layout
20780 font-family: sans-serif;
20786 \begin_inset Quotes erd
20790 The correspondence of LyX sizes and CSS sizes is a little less obvious
20791 but nonetheless intuitive.
20793 \begin_inset Flex Code
20796 \begin_layout Plain Layout
20803 \begin_inset Flex URL
20806 \begin_layout Plain Layout
20816 \begin_layout Chapter
20817 Including External Material
20820 \begin_layout Standard
20821 \begin_inset Box Shadowbox
20831 height_special "totalheight"
20834 \begin_layout Plain Layout
20835 WARNING: This portion of the documentation has not been updated for some
20837 We certainly hope that it is still accurate, but there are no guarantees.
20845 \begin_layout Standard
20846 The use of material from sources external to LyX is covered in detail in
20852 This part of the manual covers what needs to happen behind the scenes for
20853 new sorts of material to be included.
20856 \begin_layout Section
20860 \begin_layout Standard
20861 The external material feature is based on the concept of a
20866 A template is a specification of how LyX should interface with a certain
20868 As bundled, LyX comes with predefined templates for Xfig figures, various
20869 raster format images, chess diagrams, and LilyPond music notation.
20870 You can check the actual list by using the menu
20871 \begin_inset Flex MenuItem
20874 \begin_layout Plain Layout
20875 Insert\SpecialChar \menuseparator
20876 File\SpecialChar \menuseparator
20883 Furthermore, it is possible to roll your own template to support a specific
20885 Later we'll describe in more detail what is involved, and hopefully you
20886 will submit all the templates you create so we can include them in a later
20890 \begin_layout Standard
20891 Another basic idea of the external material feature is to distinguish between
20892 the original file that serves as a base for final material and the produced
20893 file that is included in your exported or printed document.
20894 For example, consider the case of a figure produced with
20895 \begin_inset Flex Code
20898 \begin_layout Plain Layout
20905 The Xfig application itself works on an original file with the
20906 \begin_inset Flex Code
20909 \begin_layout Plain Layout
20916 Within Xfig, you create and change your figure, and when you are done,
20918 \begin_inset Flex Code
20921 \begin_layout Plain Layout
20928 When you want to include the figure in your document, you invoke
20929 \begin_inset Flex Code
20932 \begin_layout Plain Layout
20938 in order to create a PostScript file that can readily be included in your
20941 \begin_inset Flex Code
20944 \begin_layout Plain Layout
20950 file is the original file, and the PostScript file is the produced file.
20953 \begin_layout Standard
20954 This distinction is important in order to allow updating of the material
20955 while you are in the process of writing the document.
20956 Furthermore, it provides us with the flexibility that is needed to support
20957 multiple export formats.
20958 For instance, in the case of a plain text file, it is not exactly an award-winn
20959 ing idea to include the figure as raw PostScript.
20960 Instead, you would either prefer to just include a reference to the figure
20961 or try to invoke some graphics to ASCII converter to make the final result
20962 look similar to the real graphics.
20963 The external material management allows you to do this, because it is parametri
20964 zed on the different export formats that LyX supports.
20967 \begin_layout Standard
20968 Besides supporting the production of different products according to the
20969 exported format, it supports tight integration with editing and viewing
20971 In the case of an Xfig figure, you are able to invoke Xfig on the original
20972 file with a single click from within the external material dialog in LyX,
20973 and also preview the produced PostScript file with Ghostview with another
20975 No more fiddling around with the command line and/or file browsers to locate
20976 and manipulate the original or produced files.
20977 In this way, you are finally able to take full advantage of the many different
20978 applications that are relevant to use when you write your documents, and
20979 ultimately be more productive.
20982 \begin_layout Section
20983 The external template configuration file
20986 \begin_layout Standard
20987 It is relatively easy to add custom external template definitions to LyX.
20988 However, be aware that doing this in an careless manner most probably
20992 introduce an easily exploitable security hole.
20993 So before you do this, please read the discussion about security in section
20995 \begin_inset CommandInset ref
20997 reference "sec:Security-discussion"
21004 \begin_layout Standard
21005 Having said that, we encourage you to submit any interesting templates that
21010 \begin_layout Standard
21011 The external templates are defined in the
21012 \begin_inset Flex Code
21015 \begin_layout Plain Layout
21016 LyXDir/lib/external_templates
21022 You can place your own version in
21023 \begin_inset Flex Code
21026 \begin_layout Plain Layout
21027 UserDir/external_templates
21035 \begin_layout Standard
21036 A typical template looks like this:
21039 \begin_layout LyX-Code
21043 \begin_layout LyX-Code
21044 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
21047 \begin_layout LyX-Code
21051 \begin_layout LyX-Code
21055 \begin_layout LyX-Code
21059 \begin_layout LyX-Code
21063 \begin_layout LyX-Code
21067 \begin_layout LyX-Code
21068 AutomaticProduction true
21071 \begin_layout LyX-Code
21075 \begin_layout LyX-Code
21079 \begin_layout LyX-Code
21083 \begin_layout LyX-Code
21084 TransformCommand Rotate RotationLatexCommand
21087 \begin_layout LyX-Code
21088 TransformCommand Resize ResizeLatexCommand
21091 \begin_layout LyX-Code
21092 Product "$$RotateFront$$ResizeFront
21095 \begin_layout LyX-Code
21100 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
21103 \begin_layout LyX-Code
21104 $$ResizeBack$$RotateBack"
21107 \begin_layout LyX-Code
21111 \begin_layout LyX-Code
21112 UpdateResult "$$AbsPath$$Basename.pstex_t"
21115 \begin_layout LyX-Code
21116 Requirement "graphicx"
21119 \begin_layout LyX-Code
21120 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
21123 \begin_layout LyX-Code
21124 ReferencedFile latex "$$AbsPath$$Basename.eps"
21127 \begin_layout LyX-Code
21128 ReferencedFile dvi "$$AbsPath$$Basename.eps"
21131 \begin_layout LyX-Code
21135 \begin_layout LyX-Code
21139 \begin_layout LyX-Code
21140 TransformCommand Rotate RotationLatexCommand
21143 \begin_layout LyX-Code
21144 TransformCommand Resize ResizeLatexCommand
21147 \begin_layout LyX-Code
21148 Product "$$RotateFront$$ResizeFront
21151 \begin_layout LyX-Code
21156 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
21159 \begin_layout LyX-Code
21160 $$ResizeBack$$RotateBack"
21163 \begin_layout LyX-Code
21164 UpdateFormat pdftex
21167 \begin_layout LyX-Code
21168 UpdateResult "$$AbsPath$$Basename.pdftex_t"
21171 \begin_layout LyX-Code
21172 Requirement "graphicx"
21175 \begin_layout LyX-Code
21176 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
21179 \begin_layout LyX-Code
21180 ReferencedFile latex "$$AbsPath$$Basename.pdf"
21183 \begin_layout LyX-Code
21187 \begin_layout LyX-Code
21191 \begin_layout LyX-Code
21192 Product "$$Contents(
21194 "$$AbsPath$$Basename.asc
21199 \begin_layout LyX-Code
21200 UpdateFormat asciixfig
21203 \begin_layout LyX-Code
21204 UpdateResult "$$AbsPath$$Basename.asc"
21207 \begin_layout LyX-Code
21211 \begin_layout LyX-Code
21215 \begin_layout LyX-Code
21216 Product "<graphic fileref=
21218 "$$AbsOrRelPathMaster$$Basename.eps
21223 \begin_layout LyX-Code
21227 \begin_layout LyX-Code
21231 \begin_layout LyX-Code
21232 UpdateResult "$$AbsPath$$Basename.eps"
21235 \begin_layout LyX-Code
21236 ReferencedFile docbook "$$AbsPath$$Basename.eps"
21239 \begin_layout LyX-Code
21240 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
21243 \begin_layout LyX-Code
21247 \begin_layout LyX-Code
21248 Product "[XFig: $$FName]"
21251 \begin_layout LyX-Code
21255 \begin_layout LyX-Code
21259 \begin_layout Standard
21260 As you can see, the template is enclosed in
21261 \begin_inset Flex Code
21264 \begin_layout Plain Layout
21270 \SpecialChar \ldots{}
21272 \begin_inset Flex Code
21275 \begin_layout Plain Layout
21282 It contains a header specifying some general settings and, for each supported
21283 primary document file format, a section
21284 \begin_inset Flex Code
21287 \begin_layout Plain Layout
21293 \SpecialChar \ldots{}
21295 \begin_inset Flex Code
21298 \begin_layout Plain Layout
21307 \begin_layout Subsection
21308 The template header
21311 \begin_layout Description
21312 \begin_inset Flex Code
21315 \begin_layout Plain Layout
21316 AutomaticProduction
21317 \begin_inset space ~
21325 Whether the file represented by the template must be generated by LyX.
21326 This command must occur exactly once.
21329 \begin_layout Description
21330 \begin_inset Flex Code
21333 \begin_layout Plain Layout
21335 \begin_inset space ~
21343 A glob pattern that is used in the file dialog to filter out the desired
21345 If there is more than one possible file extension (e.
21346 \begin_inset space \thinspace{}
21350 \begin_inset space \space{}
21354 \begin_inset Flex Code
21357 \begin_layout Plain Layout
21364 \begin_inset Flex Code
21367 \begin_layout Plain Layout
21373 ), use something like
21374 \begin_inset Flex Code
21377 \begin_layout Plain Layout
21384 This command must occur exactly once.
21387 \begin_layout Description
21388 \begin_inset Flex Code
21391 \begin_layout Plain Layout
21393 \begin_inset space ~
21401 The text that is displayed on the button.
21402 This command must occur exactly once.
21405 \begin_layout Description
21406 \begin_inset Flex Code
21409 \begin_layout Plain Layout
21411 \begin_inset space ~
21415 \begin_inset space ~
21423 The help text that is used in the External dialog.
21424 Provide enough information to explain to the user just what the template
21425 can provide him with.
21426 This command must occur exactly once.
21429 \begin_layout Description
21430 \begin_inset Flex Code
21433 \begin_layout Plain Layout
21435 \begin_inset space ~
21443 The file format of the original file.
21444 This must be the name of a format that is known to LyX (see section
21445 \begin_inset space ~
21449 \begin_inset CommandInset ref
21451 reference "sec:Formats"
21457 \begin_inset Quotes eld
21461 \begin_inset Flex Code
21464 \begin_layout Plain Layout
21471 \begin_inset Quotes erd
21474 if the template can handle original files of more than one format.
21475 LyX will attempt to interrogate the file itself in order to deduce its
21476 format in this case.
21477 This command must occur exactly once.
21480 \begin_layout Description
21481 \begin_inset Flex Code
21484 \begin_layout Plain Layout
21486 \begin_inset space ~
21494 A unique name for the template.
21495 It must not contain substitution macros (see below).
21498 \begin_layout Description
21499 \begin_inset Flex Code
21502 \begin_layout Plain Layout
21504 \begin_inset space ~
21507 Rotate|Resize|Clip|Extra
21512 This command specifies which transformations are supported by this template.
21513 It may occur zero or more times.
21514 This command enables the corresponding tabs in the external dialog.
21516 \begin_inset Flex Code
21519 \begin_layout Plain Layout
21525 command must have either a corresponding
21526 \begin_inset Flex Code
21529 \begin_layout Plain Layout
21536 \begin_inset Flex Code
21539 \begin_layout Plain Layout
21546 \begin_inset Flex Code
21549 \begin_layout Plain Layout
21556 Otherwise the transformation will not be supported by that format.
21559 \begin_layout Subsection
21563 \begin_layout Description
21564 \begin_inset Flex Code
21567 \begin_layout Plain Layout
21569 \begin_inset space ~
21572 LaTeX|PDFLaTeX|PlainText|DocBook
21577 The primary document file format that this format definition is for.
21578 Not every template has a sensible representation in all document file formats.
21579 Please define nevertheless a
21580 \begin_inset Flex Code
21583 \begin_layout Plain Layout
21589 section for all templates.
21590 Use a dummy text when no representation is available.
21591 Then you can at least see a reference to the external material in the exported
21595 \begin_layout Description
21596 \begin_inset Flex Code
21599 \begin_layout Plain Layout
21601 \begin_inset space ~
21605 \begin_inset space ~
21613 This command defines an additional macro
21614 \begin_inset Flex Code
21617 \begin_layout Plain Layout
21623 for substitution in
21624 \begin_inset Flex Code
21627 \begin_layout Plain Layout
21635 \begin_inset Flex Code
21638 \begin_layout Plain Layout
21644 itself may contain substitution macros.
21645 The advantage over using
21646 \begin_inset Flex Code
21649 \begin_layout Plain Layout
21656 \begin_inset Flex Code
21659 \begin_layout Plain Layout
21665 is that the substituted value of
21666 \begin_inset Flex Code
21669 \begin_layout Plain Layout
21675 is sanitized so that it is a valid optional argument in the document format.
21676 This command may occur zero or more times.
21679 \begin_layout Description
21680 \begin_inset Flex Code
21683 \begin_layout Plain Layout
21685 \begin_inset space ~
21693 The text that is inserted in the exported document.
21694 This is actually the most important command and can be quite complex.
21695 This command must occur exactly once.
21698 \begin_layout Description
21699 \begin_inset Flex Code
21702 \begin_layout Plain Layout
21704 \begin_inset space ~
21712 This command specifies a preamble snippet that will be included in the
21714 It has to be defined using
21715 \begin_inset Flex Code
21718 \begin_layout Plain Layout
21724 \SpecialChar \ldots{}
21726 \begin_inset Flex Code
21729 \begin_layout Plain Layout
21736 This command may occur zero or more times.
21739 \begin_layout Description
21740 \begin_inset Flex Code
21743 \begin_layout Plain Layout
21745 \begin_inset space ~
21749 \begin_inset space ~
21757 This command denotes files that are created by the conversion process and
21758 are needed for a particular export format.
21759 If the filename is relative, it is interpreted relative to the master document.
21760 This command may be given zero or more times.
21763 \begin_layout Description
21764 \begin_inset Flex Code
21767 \begin_layout Plain Layout
21769 \begin_inset space ~
21777 The name of a required LaTeX package.
21778 The package is included via
21779 \begin_inset Flex Code
21782 \begin_layout Plain Layout
21790 in the LaTeX preamble.
21791 This command may occur zero or more times.
21794 \begin_layout Description
21795 \begin_inset Flex Code
21798 \begin_layout Plain Layout
21800 \begin_inset space ~
21804 \begin_inset space ~
21807 RotationLatexCommand
21812 This command specifies that the built in LaTeX command should be used for
21814 This command may occur once or not at all.
21817 \begin_layout Description
21818 \begin_inset Flex Code
21821 \begin_layout Plain Layout
21823 \begin_inset space ~
21827 \begin_inset space ~
21835 This command specifies that the built in LaTeX command should be used for
21837 This command may occur once or not at all.
21840 \begin_layout Description
21841 \begin_inset Flex Code
21844 \begin_layout Plain Layout
21846 \begin_inset space ~
21850 \begin_inset space ~
21853 RotationLatexOption
21858 This command specifies that rotation is done via an optional argument.
21859 This command may occur once or not at all.
21862 \begin_layout Description
21863 \begin_inset Flex Code
21866 \begin_layout Plain Layout
21868 \begin_inset space ~
21872 \begin_inset space ~
21880 This command specifies that resizing is done via an optional argument.
21881 This command may occur once or not at all.
21884 \begin_layout Description
21885 \begin_inset Flex Code
21888 \begin_layout Plain Layout
21890 \begin_inset space ~
21894 \begin_inset space ~
21902 This command specifies that clipping is done via an optional argument.
21903 This command may occur once or not at all.
21906 \begin_layout Description
21907 \begin_inset Flex Code
21910 \begin_layout Plain Layout
21912 \begin_inset space ~
21916 \begin_inset space ~
21924 This command specifies that an extra optional argument is used.
21925 This command may occur once or not at all.
21928 \begin_layout Description
21929 \begin_inset Flex Code
21932 \begin_layout Plain Layout
21934 \begin_inset space ~
21942 The file format of the converted file.
21943 This must be the name of a format that is known to LyX (see the
21944 \begin_inset Flex MenuItem
21947 \begin_layout Plain Layout
21952 ools\SpecialChar \menuseparator
21957 references\SpecialChar \menuseparator
21958 File Handling\SpecialChar \menuseparator
21965 This command must occur exactly once.
21968 \begin_layout Description
21969 \begin_inset Flex Code
21972 \begin_layout Plain Layout
21974 \begin_inset space ~
21982 The file name of the converted file.
21983 The file name must be absolute.
21984 This command must occur exactly once.
21987 \begin_layout Subsection
21988 Preamble definitions
21991 \begin_layout Standard
21992 The external template configuration file may contain additional preamble
21993 definitions enclosed by
21994 \begin_inset Flex Code
21997 \begin_layout Plain Layout
22003 \SpecialChar \ldots{}
22005 \begin_inset Flex Code
22008 \begin_layout Plain Layout
22015 They can be used by the templates in the
22016 \begin_inset Flex Code
22019 \begin_layout Plain Layout
22028 \begin_layout Section
22029 The substitution mechanism
22032 \begin_layout Standard
22033 When the external material facility invokes an external program, it is done
22034 on the basis of a command defined in the template configuration file.
22035 These commands can contain various macros that are expanded before execution.
22036 Execution always take place in the directory of the containing document.
22039 \begin_layout Standard
22040 Also, whenever external material is to be displayed, the name will be produced
22041 by the substitution mechanism, and most other commands in the template
22042 definition support substitution as well.
22045 \begin_layout Standard
22046 The available macros are the following:
22049 \begin_layout Description
22050 \begin_inset Flex Code
22053 \begin_layout Plain Layout
22054 $$AbsOrRelPathMaster
22059 The file path, absolute or relative to the master LyX document.
22062 \begin_layout Description
22063 \begin_inset Flex Code
22066 \begin_layout Plain Layout
22067 $$AbsOrRelPathParent
22072 The file path, absolute or relative to the LyX document.
22075 \begin_layout Description
22076 \begin_inset Flex Code
22079 \begin_layout Plain Layout
22085 The absolute file path.
22088 \begin_layout Description
22089 \begin_inset Flex Code
22092 \begin_layout Plain Layout
22098 The filename without path and without the extension.
22101 \begin_layout Description
22102 \begin_inset Flex Code
22105 \begin_layout Plain Layout
22107 \begin_inset Quotes eld
22111 \begin_inset Quotes erd
22119 This macro will expand to the contents of the file with the name
22120 \begin_inset Flex Code
22123 \begin_layout Plain Layout
22132 \begin_layout Description
22133 \begin_inset Flex Code
22136 \begin_layout Plain Layout
22142 The file extension (including the dot).
22145 \begin_layout Description
22146 \begin_inset Flex Code
22149 \begin_layout Plain Layout
22155 The filename of the file specified in the external material dialog.
22156 This is either an absolute name, or it is relative to the LyX document.
22159 \begin_layout Description
22160 \begin_inset Flex Code
22163 \begin_layout Plain Layout
22170 \begin_inset Flex Code
22173 \begin_layout Plain Layout
22179 (absolute name or relative to the LyX document).
22182 \begin_layout Description
22183 \begin_inset Flex Code
22186 \begin_layout Plain Layout
22192 The file path, relative to the master LyX document.
22195 \begin_layout Description
22196 \begin_inset Flex Code
22199 \begin_layout Plain Layout
22205 The file path, relative to the LyX document.
22208 \begin_layout Description
22209 \begin_inset Flex Code
22212 \begin_layout Plain Layout
22218 This macro will expand to the absolute path of the system directory.
22219 This is typically used to point to the various helper scripts that are
22223 \begin_layout Description
22224 \begin_inset Flex Code
22227 \begin_layout Plain Layout
22233 A name and full path to a temporary file which will be automatically deleted
22234 whenever the containing document is closed, or the external material insertion
22238 \begin_layout Standard
22239 All path macros contain a trailing directory separator, so you can construct
22241 \begin_inset space \thinspace{}
22245 \begin_inset space \space{}
22248 the absolute filename with
22249 \begin_inset Flex Code
22252 \begin_layout Plain Layout
22253 $$AbsPath$$Basename$$Extension
22261 \begin_layout Standard
22262 The macros above are substituted in all commands unless otherwise noted.
22264 \begin_inset Flex Code
22267 \begin_layout Plain Layout
22273 supports additionally the following substitutions if they are enabled by
22275 \begin_inset Flex Code
22278 \begin_layout Plain Layout
22285 \begin_inset Flex Code
22288 \begin_layout Plain Layout
22297 \begin_layout Description
22298 \begin_inset Flex Code
22301 \begin_layout Plain Layout
22307 The front part of the resize command.
22310 \begin_layout Description
22311 \begin_inset Flex Code
22314 \begin_layout Plain Layout
22320 The back part of the resize command.
22323 \begin_layout Description
22324 \begin_inset Flex Code
22327 \begin_layout Plain Layout
22333 The front part of the rotation command.
22336 \begin_layout Description
22337 \begin_inset Flex Code
22340 \begin_layout Plain Layout
22346 The back part of the rotation command.
22349 \begin_layout Standard
22350 The value string of the
22351 \begin_inset Flex Code
22354 \begin_layout Plain Layout
22360 command supports additionally the following substitutions if they are enabled
22362 \begin_inset Flex Code
22365 \begin_layout Plain Layout
22372 \begin_inset Flex Code
22375 \begin_layout Plain Layout
22384 \begin_layout Description
22385 \begin_inset Flex Code
22388 \begin_layout Plain Layout
22397 \begin_layout Description
22398 \begin_inset Flex Code
22401 \begin_layout Plain Layout
22410 \begin_layout Description
22411 \begin_inset Flex Code
22414 \begin_layout Plain Layout
22423 \begin_layout Description
22424 \begin_inset Flex Code
22427 \begin_layout Plain Layout
22433 The rotation option.
22436 \begin_layout Standard
22437 You may ask why there are so many path macros.
22438 There are mainly two reasons:
22441 \begin_layout Enumerate
22442 Relative and absolute file names should remain relative or absolute, respectivel
22444 Users may have reasons to prefer either form.
22445 Relative names are useful for portable documents that should work on different
22446 machines, for example.
22447 Absolute names may be required by some programs.
22450 \begin_layout Enumerate
22451 LaTeX treats relative file names differently than LyX and other programs
22452 in nested included files.
22453 For LyX, a relative file name is always relative to the document that contains
22455 For LaTeX, it is always relative to the master document.
22456 These two definitions are identical if you have only one document, but
22457 differ if you have a master document that includes part documents.
22458 That means that relative filenames must be transformed when presented to
22460 Fortunately LyX does this automatically for you if you choose the right
22464 \begin_layout Standard
22465 So which path macro should be used in new template definitions? The rule
22469 \begin_layout Itemize
22471 \begin_inset Flex Code
22474 \begin_layout Plain Layout
22480 if an absolute path is required.
22483 \begin_layout Itemize
22485 \begin_inset Flex Code
22488 \begin_layout Plain Layout
22489 $$AbsOrRelPathMaster
22494 if the substituted string is some kind of LaTeX input.
22497 \begin_layout Itemize
22499 \begin_inset Flex Code
22502 \begin_layout Plain Layout
22503 $$AbsOrRelPathParent
22508 in order to preserve the user's choice.
22511 \begin_layout Standard
22512 There are special cases where this rule does not work and e.
22513 \begin_inset space \thinspace{}
22517 \begin_inset space \space{}
22520 relative names are needed, but normally it will work just fine.
22521 One example for such a case is the command
22522 \begin_inset Flex Code
22525 \begin_layout Plain Layout
22526 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
22531 in the XFig template above: We can't use the absolute name because the
22533 \begin_inset Flex Code
22536 \begin_layout Plain Layout
22542 files needs the relative name in order to rewrite the file content.
22545 \begin_layout Section
22546 Security discussion
22547 \begin_inset CommandInset label
22549 name "sec:Security-discussion"
22556 \begin_layout Standard
22557 The external material feature interfaces with a lot of external programs
22558 and does so automatically, so we have to consider the security implications
22560 In particular, since you have the option of including your own filenames
22561 and/or parameter strings and those are expanded into a command, it seems
22562 that it would be possible to create a malicious document which executes
22563 arbitrary commands when a user views or prints the document.
22564 This is something we definitely want to avoid.
22567 \begin_layout Standard
22568 However, since the external program commands are specified in the template
22569 configuration file only, there are no security issues if LyX is properly
22570 configured with safe templates only.
22571 This is so because the external programs are invoked with the
22572 \begin_inset Flex Code
22575 \begin_layout Plain Layout
22581 -system call rather than the
22582 \begin_inset Flex Code
22585 \begin_layout Plain Layout
22591 system-call, so it's not possible to execute arbitrary commands from the
22592 filename or parameter section via the shell.
22595 \begin_layout Standard
22596 This also implies that you are restricted in what command strings you can
22597 use in the external material templates.
22598 In particular, pipes and redirection are not readily available.
22599 This has to be so if LyX should remain safe.
22600 If you want to use some of the shell features, you should write a safe
22601 script to do this in a controlled manner, and then invoke the script from
22602 the command string.
22606 \begin_layout Standard
22607 It is possible to design a template that interacts directly with the shell,
22608 but since this would allow a malicious user to execute arbitrary commands
22609 by writing clever filenames and/or parameters, we generally recommend that
22610 you only use safe scripts that work with the
22611 \begin_inset Flex Code
22614 \begin_layout Plain Layout
22620 system call in a controlled manner.
22621 Of course, for use in a controlled environment, it can be tempting to just
22622 fall back to use ordinary shell scripts.
22623 If you do so, be aware that you
22627 provide an easily exploitable security hole in your system.
22628 Of course it stands to reason that such unsafe templates will never be
22629 included in the standard LyX distribution, although we do encourage people
22630 to submit new templates in the open source tradition.
22631 But LyX as shipped from the official distribution channels will never have
22635 \begin_layout Standard
22636 Including external material provides a lot of power, and you have to be
22637 careful not to introduce security hazards with this power.
22638 A subtle error in a single line in an innocent looking script can open
22639 the door to huge security problems.
22640 So if you do not fully understand the issues, we recommend that you consult
22641 a knowledgeable security professional or the LyX development team if you
22642 have any questions about whether a given template is safe or not.
22643 And do this before you use it in an uncontrolled environment.