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 1355076779
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 (unless you also specify a separate
10369 \begin_inset Flex Code
10372 \begin_layout Plain Layout
10374 \change_inserted -712698321 1355076779
10381 For the menu, you can define an accelerator by appending the respective
10382 character to the string, divided by
10383 \begin_inset Quotes eld
10387 \begin_inset Quotes erd
10391 \begin_inset space \thinspace{}
10396 \begin_inset Flex Code
10399 \begin_layout Plain Layout
10401 \change_inserted -712698321 1353691482
10402 \begin_inset Quotes eld
10406 \begin_inset Quotes erd
10419 \begin_layout Itemize
10421 \change_inserted -712698321 1355076754
10422 \begin_inset Flex Code
10425 \begin_layout Plain Layout
10427 \change_inserted -712698321 1355076658
10434 \begin_inset Flex Code
10437 \begin_layout Plain Layout
10439 \change_inserted -712698321 1355076654
10445 A separate string for the menu.
10446 You can define an accelerator by appending the respective character to
10447 the string, divided by
10448 \begin_inset Quotes eld
10452 \begin_inset Quotes erd
10456 \begin_inset space \thinspace{}
10461 \begin_inset Flex Code
10464 \begin_layout Plain Layout
10466 \change_inserted -712698321 1355076654
10467 \begin_inset Quotes eld
10471 \begin_inset Quotes erd
10480 This specification is optional.
10481 If it is not given the
10482 \begin_inset Flex Code
10485 \begin_layout Plain Layout
10487 \change_inserted -712698321 1355076736
10495 will be used instead for the menu.
10498 \begin_layout Itemize
10500 \change_inserted -712698321 1353680665
10501 \begin_inset Flex Code
10504 \begin_layout Plain Layout
10506 \change_inserted -712698321 1353680616
10513 \begin_inset Flex Code
10516 \begin_layout Plain Layout
10518 \change_inserted -712698321 1353680623
10524 A longer explanatory text that appears in the tooltip when hovering over
10525 the argument inset.
10528 \begin_layout Itemize
10530 \change_inserted -712698321 1353680874
10531 \begin_inset Flex Code
10534 \begin_layout Plain Layout
10536 \change_inserted -712698321 1353680732
10543 \begin_inset Flex Code
10546 \begin_layout Plain Layout
10548 \change_inserted -712698321 1353680738
10554 Declare if this is a mandatory
10555 \change_inserted 2090807402 1353765594
10557 \change_inserted -712698321 1353680874
10559 \change_inserted 2090807402 1353765599
10561 \change_inserted -712698321 1353680874
10563 Mandatory arguments will be output empty if not given, while optional arguments
10564 will not be output at all.
10565 By default, mandatory arguments are delimited by
10566 \begin_inset Flex Code
10569 \begin_layout Plain Layout
10571 \change_inserted -712698321 1353680808
10579 , while optional arguments are delimited by
10580 \begin_inset Flex Code
10583 \begin_layout Plain Layout
10585 \change_inserted -712698321 1353680833
10594 \begin_layout Itemize
10596 \change_inserted -712698321 1353917199
10597 \begin_inset Flex Code
10600 \begin_layout Plain Layout
10602 \change_inserted -712698321 1353680879
10609 \begin_inset Flex Code
10612 \begin_layout Plain Layout
10614 \change_inserted -712698321 1353680874
10620 defines another argument (by its number) which this argument requires to
10621 be output if it is itself output.
10623 \begin_inset space \thinspace{}
10626 g., in LaTeX commands, optional arguments often require previous optional
10627 arguments to be output (at least empty), as in
10628 \begin_inset Flex Code
10631 \begin_layout Plain Layout
10633 \change_inserted -712698321 1353688183
10636 command[][arg]{text}
10644 This can be achieved by the statement
10645 \begin_inset Flex Code
10648 \begin_layout Plain Layout
10650 \change_inserted -712698321 1353681031
10659 \begin_inset Flex Code
10662 \begin_layout Plain Layout
10664 \change_inserted -712698321 1353681045
10675 \begin_layout Itemize
10677 \change_inserted -712698321 1354263104
10678 \begin_inset Flex Code
10681 \begin_layout Plain Layout
10683 \change_inserted -712698321 1353681072
10692 \begin_inset Flex Code
10695 \begin_layout Plain Layout
10697 \change_inserted -712698321 1353681067
10703 defines a custom left delimiter (instead of
10704 \begin_inset Flex Code
10707 \begin_layout Plain Layout
10709 \change_inserted -712698321 1353681127
10718 \begin_inset Flex Code
10721 \begin_layout Plain Layout
10723 \change_inserted -712698321 1353681133
10732 A line break in the output can be indicated by
10733 \begin_inset Flex Code
10736 \begin_layout Plain Layout
10738 \change_inserted -712698321 1354263104
10749 \begin_layout Itemize
10751 \change_inserted -712698321 1355144479
10752 \begin_inset Flex Code
10755 \begin_layout Plain Layout
10757 \change_inserted -712698321 1353681149
10764 \begin_inset Flex Code
10767 \begin_layout Plain Layout
10769 \change_inserted -712698321 1353681146
10775 defines a custom right delimiter (instead of
10776 \begin_inset Flex Code
10779 \begin_layout Plain Layout
10781 \change_inserted -712698321 1353681158
10788 \begin_inset Flex Code
10791 \begin_layout Plain Layout
10793 \change_inserted -712698321 1353681161
10800 A line break in the output can be indicated by
10801 \begin_inset Flex Code
10804 \begin_layout Plain Layout
10806 \change_inserted -712698321 1354263106
10815 \begin_layout Itemize
10817 \change_inserted -712698321 1355144578
10818 \begin_inset Flex Code
10821 \begin_layout Plain Layout
10823 \change_inserted -712698321 1355144487
10832 \begin_inset Flex Code
10835 \begin_layout Plain Layout
10837 \change_inserted -712698321 1355144500
10843 defines an argument that is inserted in any case (alone or in addition
10844 to user-specified arguments).
10845 Multiple arguments need to be separated by comma.
10850 \begin_layout Itemize
10852 \change_inserted -712698321 1353917320
10853 \begin_inset Flex Code
10856 \begin_layout Plain Layout
10858 \change_inserted -712698321 1353917320
10864 The font used for the argument content.
10866 \begin_inset space ~
10870 \begin_inset CommandInset ref
10872 reference "sub:Font-description"
10879 \begin_layout Itemize
10881 \change_inserted -712698321 1353917320
10882 \begin_inset Flex Code
10885 \begin_layout Plain Layout
10887 \change_inserted -712698321 1353917320
10893 The font used for the label.
10895 \begin_inset space ~
10899 \begin_inset CommandInset ref
10901 reference "sub:Font-description"
10908 \begin_layout Itemize
10910 \change_inserted -712698321 1353917320
10911 \begin_inset Flex Code
10914 \begin_layout Plain Layout
10916 \change_inserted -712698321 1353917320
10923 \begin_inset Flex Code
10926 \begin_layout Plain Layout
10928 \change_inserted -712698321 1353917320
10935 \begin_inset Flex Code
10938 \begin_layout Plain Layout
10940 \change_inserted -712698321 1353917320
10947 \begin_inset Flex Code
10950 \begin_layout Plain Layout
10952 \change_inserted -712698321 1353917320
10958 , describing the rendering style used for the inset's frame and buttons.
10960 \begin_inset Flex Code
10963 \begin_layout Plain Layout
10965 \change_inserted -712698321 1353917320
10972 \change_inserted 155139281 1354198988
10976 \begin_layout Standard
10978 \change_inserted 155139281 1354199102
10980 \begin_inset Flex Code
10983 \begin_layout Plain Layout
10985 \change_inserted 155139281 1354199013
10996 \begin_inset Flex Code
10999 \begin_layout Plain Layout
11001 \change_inserted 155139281 1354199102
11012 \begin_inset Flex Code
11015 \begin_layout Plain Layout
11017 \change_inserted 155139281 1354199044
11025 followed by the number (e.
11026 \begin_inset space \thinspace{}
11031 \begin_inset Flex Code
11034 \begin_layout Plain Layout
11036 \change_inserted 155139281 1354199064
11050 \begin_layout Description
11051 \begin_inset Flex Code
11054 \begin_layout Plain Layout
11060 Note that this will completely override any prior
11061 \begin_inset Flex Code
11064 \begin_layout Plain Layout
11070 declaration for this style.
11072 \begin_inset Quotes eld
11076 \begin_inset Flex Code
11079 \begin_layout Plain Layout
11086 \begin_inset Quotes erd
11091 \begin_inset CommandInset ref
11093 reference "sub:I18n"
11097 for details on its use.
11100 \begin_layout Description
11101 \begin_inset Flex Code
11104 \begin_layout Plain Layout
11111 \begin_inset Flex Code
11114 \begin_layout Plain Layout
11124 \begin_layout Plain Layout
11125 Note that a `float' here is a real number, such as: 1.5.
11130 The vertical space with which the last of a chain of paragraphs with this
11131 style is separated from the following paragraph.
11132 If the next paragraph has another style, the separations are not simply
11133 added, but the maximum is taken.
11136 \begin_layout Description
11137 \begin_inset Flex Code
11140 \begin_layout Plain Layout
11147 \begin_inset Flex Code
11150 \begin_layout Plain Layout
11156 The category for this style.
11157 This is used to group related styles in the style combobox on the toolbar.
11158 Any string can be used, but you may want to use existing categories with
11163 \begin_layout Description
11164 \begin_inset Flex Code
11167 \begin_layout Plain Layout
11173 Depth of XML command.
11174 Used only with XML-type formats.
11177 \begin_layout Description
11178 \begin_inset Flex Code
11181 \begin_layout Plain Layout
11188 \begin_inset Flex Code
11191 \begin_layout Plain Layout
11197 Copies all the features of an existing style into the current one.
11201 \begin_layout Description
11202 \begin_inset Flex Code
11205 \begin_layout Plain Layout
11211 The name of a style whose preamble should be output
11216 This allows to ensure some ordering of the preamble snippets when macros
11217 definitions depend on one another.
11221 \begin_layout Plain Layout
11222 Note that, besides that functionality, there is no way to ensure any ordering
11224 The ordering that you see in a given version of LyX may change without
11225 warning in later versions.
11233 \begin_layout Description
11234 \begin_inset Flex Code
11237 \begin_layout Plain Layout
11244 \begin_inset Flex Code
11247 \begin_layout Plain Layout
11252 , Box, Filled_Box, Static
11257 ] The type of label that stands at the end of the paragraph (or sequence
11259 \begin_inset Flex Code
11262 \begin_layout Plain Layout
11269 \begin_inset Flex Code
11272 \begin_layout Plain Layout
11279 \begin_inset Flex Code
11282 \begin_layout Plain Layout
11289 \begin_inset Flex Code
11292 \begin_layout Plain Layout
11300 \begin_inset Flex Code
11303 \begin_layout Plain Layout
11310 \begin_inset Quotes eld
11314 \begin_inset Quotes erd
11318 \begin_inset Flex Code
11321 \begin_layout Plain Layout
11328 \begin_inset Flex Code
11331 \begin_layout Plain Layout
11332 \begin_inset space ~
11340 ) is a white (resp.
11341 \begin_inset space ~
11344 black) square suitable for end of proof markers,
11345 \begin_inset Flex Code
11348 \begin_layout Plain Layout
11354 is an explicit text string.
11357 \begin_layout Description
11358 \begin_inset Flex Code
11361 \begin_layout Plain Layout
11368 \begin_inset Flex Code
11371 \begin_layout Plain Layout
11377 ] The string used for a label with a
11378 \begin_inset Flex Code
11381 \begin_layout Plain Layout
11388 \begin_inset Flex Code
11391 \begin_layout Plain Layout
11401 \begin_layout Description
11402 \begin_inset Flex Code
11405 \begin_layout Plain Layout
11411 The font used for both the text body
11417 \begin_inset space ~
11421 \begin_inset CommandInset ref
11423 reference "sub:Font-description"
11428 Note that defining this font automatically defines the
11429 \begin_inset Flex Code
11432 \begin_layout Plain Layout
11439 So you should define this one first if you also want to define
11440 \begin_inset Flex Code
11443 \begin_layout Plain Layout
11452 \begin_layout Description
11453 \begin_inset Flex Code
11456 \begin_layout Plain Layout
11463 \begin_inset CommandInset label
11465 name "des:FreeSpacing"
11470 \begin_inset Flex Code
11473 \begin_layout Plain Layout
11482 \begin_inset Flex Code
11485 \begin_layout Plain Layout
11491 ] Usually LyX doesn't allow you to insert more than one space between words,
11492 since a space is considered as the separation between two words, not a
11493 character or symbol of its own.
11494 This is a very fine thing but sometimes annoying, for example, when typing
11495 program code or plain LaTeX code.
11497 \begin_inset Flex Code
11500 \begin_layout Plain Layout
11507 Note that LyX will create protected blanks for the additional blanks when
11508 in another mode than LaTeX-mode.
11511 \begin_layout Description
11512 \begin_inset Flex Code
11515 \begin_layout Plain Layout
11521 These tags are used with XHTML output.
11523 \begin_inset CommandInset ref
11525 reference "sub:Paragraph-Style-XHTML"
11532 \begin_layout Description
11533 \begin_inset Flex Code
11536 \begin_layout Plain Layout
11542 [[FIXME]] (Used only with XML-type formats.)
11545 \begin_layout Description
11546 \begin_inset Flex Code
11549 \begin_layout Plain Layout
11556 \begin_inset Flex Code
11559 \begin_layout Plain Layout
11565 If 1, marks the style as to be included in the document preamble rather
11566 than in the document body.
11567 This is useful for document classes that want such information as the title
11568 and author to appear in the preamble.
11569 Note that this works only for styles for which the
11570 \begin_inset Flex Code
11573 \begin_layout Plain Layout
11580 \begin_inset Flex Code
11583 \begin_layout Plain Layout
11590 \begin_inset Flex Code
11593 \begin_layout Plain Layout
11602 \begin_layout Description
11603 \begin_inset Flex Code
11606 \begin_layout Plain Layout
11613 \begin_inset Flex Code
11616 \begin_layout Plain Layout
11622 If 1, marks the style as being part of a title block (see also the
11623 \begin_inset Flex Code
11626 \begin_layout Plain Layout
11633 \begin_inset Flex Code
11636 \begin_layout Plain Layout
11645 \begin_layout Description
11646 \begin_inset Flex Code
11649 \begin_layout Plain Layout
11656 \begin_inset Flex Code
11659 \begin_layout Plain Layout
11665 ] This provides extra space between paragraphs that have the same style.
11666 If you put other styles into an environment, each is separated with the
11668 \begin_inset Flex Code
11671 \begin_layout Plain Layout
11678 But the whole items of the environment are additionally separated with
11680 \begin_inset Flex Code
11683 \begin_layout Plain Layout
11690 Note that this is a
11695 \begin_layout Description
11696 \begin_inset Flex Code
11699 \begin_layout Plain Layout
11705 [[FIXME]] (Used only with XML-type formats.)
11708 \begin_layout Description
11709 \begin_inset Flex Code
11712 \begin_layout Plain Layout
11719 \begin_inset Flex Code
11722 \begin_layout Plain Layout
11731 \begin_inset Flex Code
11734 \begin_layout Plain Layout
11740 ] Usually LyX does not allow you to leave a paragraph empty, since it would
11741 lead to empty LaTeX output.
11742 There are some cases where this could be desirable however: in a letter
11743 template, the required fields can be provided as empty fields, so that
11744 people do not forget them; in some special classes, a style can be used
11745 as some kind of break, which does not contain actual text.
11748 \begin_layout Description
11749 \begin_inset Flex Code
11752 \begin_layout Plain Layout
11758 [float=0] The vertical space between the label and the text body.
11759 Only used for labels that are above the text body (
11760 \begin_inset Flex Code
11763 \begin_layout Plain Layout
11770 \begin_inset Flex Code
11773 \begin_layout Plain Layout
11774 Centered_Top_Environment
11782 \begin_layout Description
11783 \begin_inset Flex Code
11786 \begin_layout Plain Layout
11793 \begin_inset Flex Code
11796 \begin_layout Plain Layout
11803 \begin_inset Newline newline
11806 The name of the counter for automatic numbering.
11808 \begin_inset Newline newline
11816 \begin_inset Flex Code
11819 \begin_layout Plain Layout
11826 \begin_inset Flex Code
11829 \begin_layout Plain Layout
11836 In that case, the counter will be stepped each time the style appears.
11838 \begin_inset Newline newline
11846 \begin_inset Flex Code
11849 \begin_layout Plain Layout
11856 \begin_inset Flex Code
11859 \begin_layout Plain Layout
11865 , though this case is a bit complicated.
11866 Suppose you declare
11867 \begin_inset Quotes eld
11871 \begin_inset Flex Code
11874 \begin_layout Plain Layout
11875 LabelCounter myenum
11881 \begin_inset Quotes erd
11885 Then the actual counters used are
11886 \begin_inset Flex Code
11889 \begin_layout Plain Layout
11896 \begin_inset Flex Code
11899 \begin_layout Plain Layout
11906 \begin_inset Flex Code
11909 \begin_layout Plain Layout
11916 \begin_inset Flex Code
11919 \begin_layout Plain Layout
11925 , much as in LaTeX.
11926 These counters must all be declared separately.
11927 \begin_inset Newline newline
11931 \begin_inset CommandInset ref
11933 reference "sub:Counters"
11937 for details on counters.
11940 \begin_layout Description
11941 \begin_inset Flex Code
11944 \begin_layout Plain Layout
11950 The font used for the label.
11952 \begin_inset space ~
11956 \begin_inset CommandInset ref
11958 reference "sub:Font-description"
11965 \begin_layout Description
11966 \begin_inset Flex Code
11969 \begin_layout Plain Layout
11975 Text that indicates how far a label should be indented.
11978 \begin_layout Description
11979 \begin_inset Flex Code
11982 \begin_layout Plain Layout
11989 \begin_inset Flex Code
11992 \begin_layout Plain Layout
11998 ] The horizontal space between the label and the text body.
11999 Only used for labels that are not above the text body.
12002 \begin_layout Description
12003 \begin_inset Flex Code
12006 \begin_layout Plain Layout
12013 \begin_inset Flex Code
12016 \begin_layout Plain Layout
12022 ] The string used for a label with a
12023 \begin_inset Flex Code
12026 \begin_layout Plain Layout
12034 \begin_inset Flex Code
12037 \begin_layout Plain Layout
12043 is set, this string can be contain the special formatting commands described
12045 \begin_inset CommandInset ref
12047 reference "sub:Counters"
12055 \begin_layout Plain Layout
12056 For the sake of backwards compatibility, the string
12057 \begin_inset Flex Code
12060 \begin_layout Plain Layout
12070 will be replaced by the expanded
12071 \begin_inset Flex Code
12074 \begin_layout Plain Layout
12081 \begin_inset Flex Code
12084 \begin_layout Plain Layout
12093 This feature is now obsolete and should be replaced by the mechanisms of
12095 \begin_inset CommandInset ref
12097 reference "sub:Counters"
12109 \begin_layout Description
12110 \begin_inset Flex Code
12113 \begin_layout Plain Layout
12114 LabelStringAppendix
12120 \begin_inset Flex Code
12123 \begin_layout Plain Layout
12129 ] This is used inside the appendix instead of
12130 \begin_inset Flex Code
12133 \begin_layout Plain Layout
12141 \begin_inset Flex Code
12144 \begin_layout Plain Layout
12151 \begin_inset Flex Code
12154 \begin_layout Plain Layout
12155 LabelStringAppendix
12163 \begin_layout Description
12164 \begin_inset Flex Code
12167 \begin_layout Plain Layout
12173 [FIXME] (Used only with XML-type formats.)
12176 \begin_layout Description
12177 \begin_inset Flex Code
12180 \begin_layout Plain Layout
12187 \begin_inset Flex Code
12190 \begin_layout Plain Layout
12195 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
12196 Enumerate, Itemize, Bibliography
12205 \begin_layout Itemize
12206 \begin_inset Flex Code
12209 \begin_layout Plain Layout
12215 means the label is the very first word (up to the first real blank).
12216 Use protected spaces (like
12217 \begin_inset space ~
12220 that one) if you want more than one word as the label.
12224 \begin_layout Itemize
12225 \begin_inset Flex Code
12228 \begin_layout Plain Layout
12234 means the label is simply whatever
12235 \begin_inset Flex Code
12238 \begin_layout Plain Layout
12245 Note that this really is `static'.
12248 \begin_layout Itemize
12249 \begin_inset Flex Code
12252 \begin_layout Plain Layout
12259 \begin_inset Flex Code
12262 \begin_layout Plain Layout
12263 Centered_Top_Environment
12268 are special cases of
12269 \begin_inset Flex Code
12272 \begin_layout Plain Layout
12279 The label will be printed above the paragraph, but only at the top of an
12280 environment or the top of a chain of paragraphs with this style.
12281 This might be used with the
12282 \begin_inset Flex MenuItem
12285 \begin_layout Plain Layout
12291 style, for example.
12294 \begin_layout Itemize
12295 \begin_inset Flex Code
12298 \begin_layout Plain Layout
12304 is a special case for the caption-labels
12305 \begin_inset Quotes eld
12309 \begin_inset Quotes erd
12313 \begin_inset Quotes eld
12317 \begin_inset Quotes erd
12322 \begin_inset Flex Code
12325 \begin_layout Plain Layout
12331 means the (hardcoded) label string depends on the kind of float: It is
12332 hardcoded to be `FloatType N', where N is the value of the counter associated
12336 \begin_layout Itemize
12338 \begin_inset Flex Code
12341 \begin_layout Plain Layout
12347 label type defines automatically numbered labels.
12349 \begin_inset Flex Code
12352 \begin_layout Plain Layout
12358 will be expanded to resolve any counter references it contains: For example,
12360 \begin_inset Quotes eld
12364 \begin_inset Flex Code
12367 \begin_layout Plain Layout
12378 \begin_inset Quotes erd
12383 \begin_inset CommandInset ref
12385 reference "sub:Counters"
12389 for more information on counters.
12392 \begin_layout Itemize
12393 \begin_inset Flex Code
12396 \begin_layout Plain Layout
12402 produces the usual sort of enumeration labels.
12403 At present, it is hardcoded to use Arabic numerals, lowercase letters,
12404 small Roman numerals, and uppercase letters for the four possible depths.
12407 \begin_layout Itemize
12408 \begin_inset Flex Code
12411 \begin_layout Plain Layout
12417 produces various bullets at the different levels.
12418 It is also hardcoded.
12421 \begin_layout Itemize
12422 \begin_inset Flex Code
12425 \begin_layout Plain Layout
12431 is used internally by LyX and should be used only with
12432 \begin_inset Flex Code
12435 \begin_layout Plain Layout
12436 LatexType BibEnvironment
12445 \begin_layout Description
12446 \begin_inset Flex Code
12449 \begin_layout Plain Layout
12455 Note that this will completely override any prior
12456 \begin_inset Flex Code
12459 \begin_layout Plain Layout
12465 declaration for this style.
12467 \begin_inset Quotes eld
12471 \begin_inset Flex Code
12474 \begin_layout Plain Layout
12481 \begin_inset Quotes erd
12486 \begin_inset CommandInset ref
12488 reference "sub:I18n"
12492 for details on its use.
12495 \begin_layout Description
12496 \begin_inset Flex Code
12499 \begin_layout Plain Layout
12505 The name of the corresponding LaTeX stuff.
12506 Either the environment or command name.
12509 \begin_layout Description
12510 \begin_inset Flex Code
12513 \begin_layout Plain Layout
12519 An optional parameter for the corresponding
12520 \begin_inset Flex Code
12523 \begin_layout Plain Layout
12530 This parameter cannot be changed from within LyX
12531 \change_inserted -712698321 1355144804
12533 \begin_inset Flex Code
12536 \begin_layout Plain Layout
12538 \change_inserted -712698321 1355144804
12544 for customizable parameters)
12548 \change_inserted -712698321 1355144804
12549 This will be output as is after all LaTeX
12550 \begin_inset Flex Code
12553 \begin_layout Plain Layout
12555 \change_inserted -712698321 1355144658
12568 \begin_layout Description
12569 \begin_inset Flex Code
12572 \begin_layout Plain Layout
12579 \begin_inset Flex Code
12582 \begin_layout Plain Layout
12587 , Command, Environment, Item_Environment,
12593 \begin_inset Flex Code
12596 \begin_layout Plain Layout
12597 List_Environment, Bib_Environment
12602 ] How the style should be translated into LaTeX.
12606 \begin_layout Plain Layout
12607 \begin_inset Flex Code
12610 \begin_layout Plain Layout
12616 is perhaps a bit misleading, since these rules apply to SGML classes, too.
12617 Visit the SGML class files for specific examples.
12626 \begin_layout Itemize
12627 \begin_inset Flex Code
12630 \begin_layout Plain Layout
12636 means nothing special.
12640 \begin_layout Itemize
12641 \begin_inset Flex Code
12644 \begin_layout Plain Layout
12651 \begin_inset Flex Code
12654 \begin_layout Plain Layout
12661 {\SpecialChar \ldots{}
12670 \begin_layout Itemize
12671 \begin_inset Flex Code
12674 \begin_layout Plain Layout
12681 \begin_inset Flex Code
12684 \begin_layout Plain Layout
12691 }\SpecialChar \ldots{}
12707 \begin_layout Itemize
12708 \begin_inset Flex Code
12711 \begin_layout Plain Layout
12718 \begin_inset Flex Code
12721 \begin_layout Plain Layout
12728 \begin_inset Flex Code
12731 \begin_layout Plain Layout
12739 is generated for each paragraph of this environment.
12743 \begin_layout Itemize
12744 \begin_inset Flex Code
12747 \begin_layout Plain Layout
12754 \begin_inset Flex Code
12757 \begin_layout Plain Layout
12764 \begin_inset Flex Code
12767 \begin_layout Plain Layout
12773 is passed as an argument to the environment.
12775 \begin_inset Flex Code
12778 \begin_layout Plain Layout
12784 can be defined in the
12785 \begin_inset Flex MenuItem
12788 \begin_layout Plain Layout
12789 Edit\SpecialChar \menuseparator
12791 \begin_inset space ~
12803 \begin_layout Standard
12804 Putting the last few things together, the LaTeX output will be either:
12807 \begin_layout LyX-Code
12810 latexname[latexparam]{\SpecialChar \ldots{}
12814 \begin_layout Standard
12818 \begin_layout LyX-Code
12821 begin{latexname}[latexparam] \SpecialChar \ldots{}
12827 \begin_layout Standard
12828 depending upon the LaTeX type.
12832 \begin_layout Description
12834 \change_inserted -712698321 1354263086
12835 \begin_inset Flex Code
12838 \begin_layout Plain Layout
12840 \change_inserted -712698321 1353866852
12847 \begin_inset Flex Code
12850 \begin_layout Plain Layout
12852 \change_inserted -712698321 1353866852
12858 ] A string that is put at the beginning of the style content.
12859 A line break in the output can be indicated by
12860 \begin_inset Flex Code
12863 \begin_layout Plain Layout
12865 \change_inserted -712698321 1354263086
12876 \begin_layout Description
12877 \begin_inset Flex Code
12880 \begin_layout Plain Layout
12887 \begin_inset Flex Code
12890 \begin_layout Plain Layout
12896 ] If you put styles into environments, the leftmargins are not simply added,
12897 but added with a factor
12898 \begin_inset Formula $\frac{4}{depth+4}$
12902 Note that this parameter is also used when the margin is defined as
12903 \begin_inset Flex Code
12906 \begin_layout Plain Layout
12913 \begin_inset Flex Code
12916 \begin_layout Plain Layout
12923 Then it is added to the manual or dynamic margin.
12925 \begin_inset Newline newline
12928 The argument is passed as a string.
12930 \begin_inset Quotes eld
12934 \begin_inset Flex Code
12937 \begin_layout Plain Layout
12944 \begin_inset Quotes erd
12947 means that the paragraph is indented with the width of
12948 \begin_inset Quotes eld
12952 \begin_inset Flex Code
12955 \begin_layout Plain Layout
12962 \begin_inset Quotes erd
12965 in the normal font.
12966 You can get a negative width by prefixing the string with
12967 \begin_inset Quotes eld
12971 \begin_inset Flex Code
12974 \begin_layout Plain Layout
12981 \begin_inset Quotes erd
12985 This way was chosen so that the look is the same with each used screen
12990 \begin_layout Description
12991 \begin_inset Flex Code
12994 \begin_layout Plain Layout
13001 \begin_inset Flex Code
13004 \begin_layout Plain Layout
13009 , Manual, Dynamic, First_Dynamic, Right_Address_Box
13015 \begin_inset Newline newline
13018 The kind of margin that the style has on the left side.
13020 \begin_inset Flex Code
13023 \begin_layout Plain Layout
13029 just means a fixed margin.
13031 \begin_inset Flex Code
13034 \begin_layout Plain Layout
13040 means that the left margin depends on the string entered in the
13041 \begin_inset Flex MenuItem
13044 \begin_layout Plain Layout
13045 Edit\SpecialChar \menuseparator
13047 \begin_inset space ~
13056 This is used to typeset nice lists without tabulators.
13058 \begin_inset Flex Code
13061 \begin_layout Plain Layout
13067 means that the margin depends on the size of the label.
13068 This is used for automatic enumerated headlines.
13069 It is obvious that the headline
13070 \begin_inset Quotes eld
13073 5.4.3.2.1 Very long headline
13074 \begin_inset Quotes erd
13077 must have a wider left margin (as wide as
13078 \begin_inset Quotes eld
13082 \begin_inset Quotes erd
13085 plus the space) than
13086 \begin_inset Quotes eld
13089 3.2 Very long headline
13090 \begin_inset Quotes erd
13094 \begin_inset Quotes eld
13098 \begin_inset Quotes erd
13101 are not able to do this.
13103 \begin_inset Flex Code
13106 \begin_layout Plain Layout
13112 is similar, but only the very first row of the paragraph is dynamic, while
13113 the others are static; this is used, for example, for descriptions.
13115 \begin_inset Flex Code
13118 \begin_layout Plain Layout
13124 means the margin is chosen in a way that the longest row of this paragraph
13125 fits to the right margin.
13126 This is used to typeset an address on the right edge of the page.
13129 \begin_layout Description
13130 \begin_inset Flex Code
13133 \begin_layout Plain Layout
13140 \begin_inset Flex Code
13143 \begin_layout Plain Layout
13152 \begin_inset Flex Code
13155 \begin_layout Plain Layout
13161 ] Whether fragile commands in this style should be
13162 \begin_inset Flex Code
13165 \begin_layout Plain Layout
13178 whether this command should itself be protected.)
13181 \begin_layout Description
13182 \begin_inset Flex Code
13185 \begin_layout Plain Layout
13192 \begin_inset Flex Code
13195 \begin_layout Plain Layout
13202 \begin_inset Flex Code
13205 \begin_layout Plain Layout
13213 ] Whether newlines are translated into LaTeX newlines (
13214 \begin_inset Flex Code
13217 \begin_layout Plain Layout
13228 The translation can be switched off to allow more comfortable LaTeX editing
13232 \begin_layout Description
13233 \begin_inset Flex Code
13236 \begin_layout Plain Layout
13243 \begin_inset Flex Code
13246 \begin_layout Plain Layout
13253 \begin_inset Flex Code
13256 \begin_layout Plain Layout
13264 ] If set to true, and if
13265 \begin_inset Flex Code
13268 \begin_layout Plain Layout
13275 \begin_inset Flex Code
13278 \begin_layout Plain Layout
13284 ) paragraphs are being indented, then the indentation of such a paragraph
13285 following one of this type will be suppressed.
13286 (So this will not affect the display of non-default paragraphs.)
13289 \begin_layout Description
13290 \begin_inset Flex Code
13293 \begin_layout Plain Layout
13299 Name of a style that has replaced this style.
13300 This is used to rename a style, while keeping backward compatibility.
13303 \begin_layout Description
13305 \change_deleted -712698321 1353679722
13306 \begin_inset Flex Code
13309 \begin_layout Plain Layout
13316 \begin_inset Flex Code
13319 \begin_layout Plain Layout
13325 ] The number of optional arguments that can be used with this style.
13326 This is useful for things like section headings, and only makes sense with
13328 Note that, on output, the optional arguments will all precede any required
13329 arguments (see below).
13330 So one can have constructs like:
13334 \begin_layout LyX-Code
13336 \change_deleted -712698321 1353679722
13339 mycmd[opt1]{req1}{contents of paragraph}
13342 \begin_layout Standard
13344 \change_deleted -712698321 1353679722
13345 but one cannot have things like:
13348 \begin_layout LyX-Code
13350 \change_deleted -712698321 1353679722
13353 mycmd[opt1]{req1}[opt2]{contents of paragraph}
13356 \begin_layout Standard
13358 \change_deleted -712698321 1353679722
13359 at least, not without ERT (with which you can have anything).
13366 \begin_layout Description
13367 \begin_inset Flex Code
13370 \begin_layout Plain Layout
13377 \begin_inset Flex Code
13380 \begin_layout Plain Layout
13389 \begin_inset Flex Code
13392 \begin_layout Plain Layout
13398 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
13399 output, but only by a line break; together with
13400 \begin_inset Flex Code
13403 \begin_layout Plain Layout
13409 , this allows to emulate a plain text editor (like the ERT inset).
13412 \begin_layout Description
13413 \begin_inset Flex Code
13416 \begin_layout Plain Layout
13423 \begin_inset Flex Code
13426 \begin_layout Plain Layout
13432 ] The indent of the very first line of a paragraph.
13434 \begin_inset Flex Code
13437 \begin_layout Plain Layout
13443 will be fixed for a certain style.
13444 The exception is the default style, since the indentation for these paragraphs
13445 can be prohibited with
13446 \begin_inset Flex Code
13449 \begin_layout Plain Layout
13457 \begin_inset Flex Code
13460 \begin_layout Plain Layout
13466 style paragraphs inside environments use the
13467 \begin_inset Flex Code
13470 \begin_layout Plain Layout
13476 of the environment, not their native one.
13478 \begin_inset Flex Code
13481 \begin_layout Plain Layout
13487 paragraphs inside an enumeration are not indented.
13490 \begin_layout Description
13491 \begin_inset Flex Code
13494 \begin_layout Plain Layout
13501 \begin_inset Flex Code
13504 \begin_layout Plain Layout
13510 ] The vertical space between two paragraphs of this style.
13513 \begin_layout Description
13514 \begin_inset Flex Code
13517 \begin_layout Plain Layout
13524 \begin_inset Flex Code
13527 \begin_layout Plain Layout
13533 ] LyX allows the user to choose either
13534 \begin_inset Quotes eld
13538 \begin_inset Quotes erd
13542 \begin_inset Quotes eld
13546 \begin_inset Quotes erd
13549 to typeset a document.
13551 \begin_inset Quotes eld
13555 \begin_inset Quotes erd
13558 is chosen, this value is completely ignored.
13560 \begin_inset Quotes eld
13564 \begin_inset Quotes erd
13567 is chosen, the parindent of a LaTeXtype
13568 \begin_inset Quotes eld
13572 \begin_inset Quotes erd
13575 style is ignored and all paragraphs are separated by this parskip argument.
13576 The vertical space is calculated with
13577 \begin_inset Flex Code
13580 \begin_layout Plain Layout
13582 \begin_inset space ~
13591 \begin_inset Flex Code
13594 \begin_layout Plain Layout
13600 is the height of a row with the normal font.
13601 This way, the look stays the same with different screen fonts.
13604 \begin_layout Description
13605 \begin_inset Flex Code
13608 \begin_layout Plain Layout
13615 \begin_inset Flex Code
13618 \begin_layout Plain Layout
13627 \begin_inset Flex Code
13630 \begin_layout Plain Layout
13636 ] Whether the contents of this paragraph should be output in raw form, meaning
13637 without special translations that LaTeX would require.
13640 \begin_layout Description
13641 \begin_inset Flex Code
13644 \begin_layout Plain Layout
13650 Information to be included in the LaTeX preamble when this style is used.
13651 Used to define macros, load packages, etc., required by this particular
13654 \begin_inset Quotes eld
13658 \begin_inset Flex Code
13661 \begin_layout Plain Layout
13668 \begin_inset Quotes erd
13674 \begin_layout Description
13675 \begin_inset Flex Code
13678 \begin_layout Plain Layout
13685 \begin_inset Flex Code
13688 \begin_layout Plain Layout
13694 ] The prefix to use when creating labels referring to paragraphs of this
13696 This allows the use of formatted references.
13699 \begin_layout Description
13701 \change_deleted -712698321 1353681258
13702 \begin_inset Flex Code
13705 \begin_layout Plain Layout
13712 \begin_inset Flex Code
13715 \begin_layout Plain Layout
13721 ] The number of required arguments that the LaTeX command or environment
13722 corresponding to this style expects.
13723 In the case of a command, these are required arguments
13727 that associated with the content of the paragraph itself.
13728 These do not actually have to be provided: LyX will output empty arguments
13730 Note that optional arguments will be output before required arguments.
13731 See the discussion of the
13732 \begin_inset Flex Code
13735 \begin_layout Plain Layout
13741 tag above for more information.
13746 \begin_layout Description
13747 \begin_inset Flex Code
13750 \begin_layout Plain Layout
13757 \begin_inset Flex Code
13760 \begin_layout Plain Layout
13766 ] Whether the style requires the feature
13767 \begin_inset Flex Code
13770 \begin_layout Plain Layout
13777 See the description of
13778 \begin_inset Flex Code
13781 \begin_layout Plain Layout
13788 \begin_inset CommandInset ref
13789 LatexCommand pageref
13790 reference "des:FreeSpacing"
13794 ) for information on `features'.
13796 \change_inserted -712698321 1353693134
13800 \begin_layout Description
13802 \change_inserted -712698321 1353693371
13803 \begin_inset Flex Code
13806 \begin_layout Plain Layout
13808 \change_inserted -712698321 1353693146
13817 \begin_inset Flex Code
13820 \begin_layout Plain Layout
13822 \change_inserted -712698321 1353693235
13831 \begin_inset Flex Code
13834 \begin_layout Plain Layout
13836 \change_inserted -712698321 1353693235
13842 ] Resets the LaTeX arguments of this style (as defined via the
13843 \begin_inset Flex Code
13846 \begin_layout Plain Layout
13848 \change_inserted -712698321 1353693371
13857 This is useful if you have copied a style via
13858 \begin_inset Flex Code
13861 \begin_layout Plain Layout
13863 \change_inserted -712698321 1353693302
13871 , but you do not want to inherit its (required and optional) arguments.
13876 \begin_layout Description
13878 \change_inserted -712698321 1354263074
13879 \begin_inset Flex Code
13882 \begin_layout Plain Layout
13884 \change_inserted -712698321 1353866876
13891 \begin_inset Flex Code
13894 \begin_layout Plain Layout
13896 \change_inserted -712698321 1353866873
13902 ] A string that is put at the end of the layout content.
13903 A line break in the output can be indicated by
13904 \begin_inset Flex Code
13907 \begin_layout Plain Layout
13909 \change_inserted -712698321 1354263069
13920 \begin_layout Description
13921 \begin_inset Flex Code
13924 \begin_layout Plain Layout
13931 \begin_inset Flex Code
13934 \begin_layout Plain Layout
13941 \begin_inset Flex Code
13944 \begin_layout Plain Layout
13953 \begin_layout Description
13954 \begin_inset Flex Code
13957 \begin_layout Plain Layout
13964 \begin_inset Flex Code
13967 \begin_layout Plain Layout
13972 , onehalf, double, other
13981 ] This defines what the default spacing should be in the style.
13983 \begin_inset Flex Code
13986 \begin_layout Plain Layout
13993 \begin_inset Flex Code
13996 \begin_layout Plain Layout
14003 \begin_inset Flex Code
14006 \begin_layout Plain Layout
14012 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
14013 If you specify the argument
14014 \begin_inset Flex Code
14017 \begin_layout Plain Layout
14023 , then you should also provide a numerical argument which will be the actual
14025 Note that, contrary to other parameters,
14026 \begin_inset Flex Code
14029 \begin_layout Plain Layout
14035 implies the generation of specific LaTeX code, using the package
14038 \begin_inset Flex Code
14041 \begin_layout Plain Layout
14050 \begin_layout Description
14051 \begin_inset Flex Code
14054 \begin_layout Plain Layout
14061 \begin_inset Flex Code
14064 \begin_layout Plain Layout
14071 \begin_inset Flex Code
14074 \begin_layout Plain Layout
14082 ] Spellcheck paragraphs of this style.
14086 \begin_layout Description
14087 \begin_inset Flex Code
14090 \begin_layout Plain Layout
14096 The font used for the text body .
14098 \begin_inset CommandInset ref
14100 reference "sub:Font-description"
14107 \begin_layout Description
14108 \begin_inset Flex Code
14111 \begin_layout Plain Layout
14120 \begin_inset Flex Code
14123 \begin_layout Plain Layout
14133 The level of the style in the table of contents.
14134 This is used for automatic numbering of section headings.
14137 \begin_layout Description
14138 \begin_inset Flex Code
14141 \begin_layout Plain Layout
14148 \begin_inset Flex Code
14151 \begin_layout Plain Layout
14157 ] The vertical space with which the very first of a chain of paragraphs
14158 with this style is separated from the previous paragraph.
14159 If the previous paragraph has another style, the separations are not simply
14160 added, but the maximum is taken.
14163 \begin_layout Subsection
14164 \begin_inset CommandInset label
14170 Internationalization of Paragraph Styles
14173 \begin_layout Standard
14174 LyX has long supported internationalization of layout information, but,
14175 until version 2.0, this applied only to the user interface and not to, say,
14177 Thus, French authors were forced to resort to ugly hacks if they wanted
14182 1' instead of `Theorem 1'.
14183 Thanks to Georg Baum, that is no longer the case.
14186 \begin_layout Standard
14188 \begin_inset Flex Code
14191 \begin_layout Plain Layout
14197 defines text that is to appear in the typeset document, it may use
14198 \begin_inset Flex Code
14201 \begin_layout Plain Layout
14208 \begin_inset Flex Code
14211 \begin_layout Plain Layout
14217 to support non-English and even multi-language documents correctly.
14218 The following excerpt (from the
14219 \begin_inset Flex Code
14222 \begin_layout Plain Layout
14228 file) shows how this works:
14231 \begin_layout LyX-Code
14236 \begin_layout LyX-Code
14239 theoremstyle{remark}
14242 \begin_layout LyX-Code
14245 newtheorem{claim}[thm]{
14252 \begin_layout LyX-Code
14256 \begin_layout LyX-Code
14260 \begin_layout LyX-Code
14265 claimname}{_(Claim)}
14268 \begin_layout LyX-Code
14272 \begin_layout LyX-Code
14276 \begin_layout LyX-Code
14285 claimname}{_(Claim)}}
14288 \begin_layout LyX-Code
14293 \begin_layout Standard
14294 In principle, any legal LaTeX may appear in the
14295 \begin_inset Flex Code
14298 \begin_layout Plain Layout
14305 \begin_inset Flex Code
14308 \begin_layout Plain Layout
14314 tags, but in practice they will typically look as they do here.
14315 The key to correct translation of the typeset text is the definition of
14317 \begin_inset Flex Code
14320 \begin_layout Plain Layout
14329 \begin_inset Flex Code
14332 \begin_layout Plain Layout
14344 \begin_layout Standard
14346 \begin_inset Flex Code
14349 \begin_layout Plain Layout
14355 tag provides for internationalization based upon the overall language of
14357 The contents of the tag will be included in the preamble, just as with
14359 \begin_inset Flex Code
14362 \begin_layout Plain Layout
14369 What makes it special is the use of the
14370 \begin_inset Quotes eld
14374 \begin_inset Quotes erd
14378 \begin_inset Flex Code
14381 \begin_layout Plain Layout
14387 , which will be replaced, when LyX produces LaTeX output, with the translation
14388 of its argument into the document language.
14391 \begin_layout Standard
14393 \begin_inset Flex Code
14396 \begin_layout Plain Layout
14402 tag is more complex, since it is meant to provide support for multi-language
14403 documents and so offers an interface to the
14404 \begin_inset Flex Code
14407 \begin_layout Plain Layout
14414 Its contents will be added to the preamble once for each language that
14415 appears in the document.
14416 In this case, the argument to
14417 \begin_inset Flex Code
14420 \begin_layout Plain Layout
14426 will be replaced with its translation into the language in question; the
14428 \begin_inset Flex Code
14431 \begin_layout Plain Layout
14437 is replaced by the language name (as used by the babel package).
14440 \begin_layout Standard
14441 A German document that also included a French section would thus have the
14442 following in the preamble:
14445 \begin_layout LyX-Code
14454 claimname}{Affirmation}}
14462 claimname}{Behauptung}}
14466 claimname}{Behauptung}
14469 \begin_layout Standard
14471 \begin_inset Flex Code
14474 \begin_layout Plain Layout
14480 will then conspire to produce the correct text in the output.
14483 \begin_layout Standard
14484 One important point to note here is that the translations are provided by
14485 LyX itself, through the
14486 \change_inserted -195340706 1334775793
14488 \begin_inset Flex Code
14491 \begin_layout Plain Layout
14493 \change_inserted -195340706 1334775793
14500 \change_deleted -195340706 1334775793
14501 same mechanism it uses for internationalization of the user interface
14504 This means, in effect, that
14505 \begin_inset Flex Code
14508 \begin_layout Plain Layout
14515 \begin_inset Flex Code
14518 \begin_layout Plain Layout
14524 are really only of use in layout files that are provided with LyX, since
14525 text entered in user-created layout files will not be seen by LyX's internation
14527 \change_inserted -195340706 1334775793
14529 \begin_inset Flex Code
14532 \begin_layout Plain Layout
14534 \change_inserted -195340706 1334775793
14540 file is modified accordingly
14543 That said, however, any layout created with the intention that it will
14544 be included with LyX should use these tags where appropriate.
14546 \change_inserted -195340706 1334775793
14547 Please note that the paragraph style translations provided by LyX will
14548 never change with a minor update (e.g.
14549 from version 2.1.x to 2.1.y).
14550 It is however quite likely that a major update (e.g.
14551 from 2.0.x to 2.1.y) will introduce new translations or corrections.
14556 \begin_layout Subsection
14558 \begin_inset CommandInset label
14567 \begin_layout Standard
14568 Since version 1.3.0 of LyX, it is has been both possible and necessary to
14569 define the floats (
14570 \begin_inset Flex MenuItem
14573 \begin_layout Plain Layout
14580 \begin_inset Flex MenuItem
14583 \begin_layout Plain Layout
14589 , \SpecialChar \ldots{}
14590 ) in the text class itself.
14591 Standard floats are included in the file
14592 \begin_inset Flex Code
14595 \begin_layout Plain Layout
14601 , so you may have to do no more than add
14604 \begin_layout LyX-Code
14605 Input stdfloats.inc
14608 \begin_layout Standard
14609 to your layout file.
14610 If you want to implement a text class that proposes some other float types
14611 (like the AGU class bundled with LyX), the information below will hopefully
14615 \begin_layout Description
14616 \begin_inset Flex Code
14619 \begin_layout Plain Layout
14626 \begin_inset Flex Code
14629 \begin_layout Plain Layout
14636 \begin_inset Quotes erd
14640 \begin_inset Quotes erd
14643 ] The file name extension of an auxiliary file for the list of figures (or
14645 LaTeX writes the captions to this file.
14648 \begin_layout Description
14649 \begin_inset Flex Code
14652 \begin_layout Plain Layout
14659 \begin_inset Flex Code
14662 \begin_layout Plain Layout
14669 \begin_inset Quotes erd
14673 \begin_inset Quotes erd
14676 ] The string that will be used in the menus and also for the caption.
14677 This is translated to the current language if babel is used.
14680 \begin_layout Description
14681 \begin_inset Flex Code
14684 \begin_layout Plain Layout
14690 These are used for XHTML output.
14692 \begin_inset CommandInset ref
14694 reference "sec:Tags-for-XHTML"
14701 \begin_layout Description
14702 \begin_inset Flex Code
14705 \begin_layout Plain Layout
14714 \begin_inset Flex Code
14717 \begin_layout Plain Layout
14726 \begin_inset Flex Code
14729 \begin_layout Plain Layout
14735 ] Indicates whether the float is already defined in the document class or
14736 if we instead need to load
14737 \begin_inset Flex Code
14740 \begin_layout Plain Layout
14746 and use what it provides to define it on-the-fly.
14748 \begin_inset Flex Code
14751 \begin_layout Plain Layout
14758 \begin_inset Flex Code
14761 \begin_layout Plain Layout
14768 It should be set to
14769 \begin_inset Flex Code
14772 \begin_layout Plain Layout
14778 if the float is already defined by the LaTeX document class.
14781 \begin_layout Description
14782 \begin_inset Flex Code
14785 \begin_layout Plain Layout
14792 \begin_inset Flex Code
14795 \begin_layout Plain Layout
14802 \begin_inset Quotes erd
14806 \begin_inset Quotes erd
14809 ] The command used to generate a list of floats of this type; the leading
14812 ' should be omitted.
14818 \begin_inset Flex Code
14821 \begin_layout Plain Layout
14827 is false, since there is no standard way to generate this command.
14829 \begin_inset Flex Code
14832 \begin_layout Plain Layout
14838 is true, since in that case there is a standard way to define the command.
14841 \begin_layout Description
14842 \begin_inset Flex Code
14845 \begin_layout Plain Layout
14852 \begin_inset Flex Code
14855 \begin_layout Plain Layout
14862 \begin_inset Quotes erd
14866 \begin_inset Quotes erd
14869 ] A title for a list of floats of this kind (list of figures, tables, or
14871 It is used for the screen label within LyX; it is passed to LaTeX for use
14872 as the title there; and it is used as the title in XHTML output.
14873 It will be translated to the document language.
14876 \begin_layout Description
14877 \begin_inset Flex Code
14880 \begin_layout Plain Layout
14887 \begin_inset Flex Code
14890 \begin_layout Plain Layout
14897 \begin_inset Quotes erd
14901 \begin_inset Quotes erd
14904 ] This (optional) argument determines whether floats of this class will
14905 be numbered within some sectional unit of the document.
14906 For example, if within is equal to
14907 \begin_inset Flex Code
14910 \begin_layout Plain Layout
14916 , the floats will be numbered within chapters.
14920 \begin_layout Description
14921 \begin_inset Flex Code
14924 \begin_layout Plain Layout
14931 \begin_inset Flex Code
14934 \begin_layout Plain Layout
14941 \begin_inset Quotes erd
14945 \begin_inset Quotes erd
14948 ] The default placement for the given class of floats.
14949 The string should be as in standard LaTeX:
14950 \begin_inset Flex Code
14953 \begin_layout Plain Layout
14960 \begin_inset Flex Code
14963 \begin_layout Plain Layout
14970 \begin_inset Flex Code
14973 \begin_layout Plain Layout
14980 \begin_inset Flex Code
14983 \begin_layout Plain Layout
14989 for top, bottom, page, and here, respectively.
14993 \begin_layout Plain Layout
14994 Note that the order of these letters in the string is irrelevant, like in
15000 On top of that there is a new type,
15001 \begin_inset Flex Code
15004 \begin_layout Plain Layout
15010 , which does not really correspond to a float, since it means: put it
15011 \begin_inset Quotes eld
15015 \begin_inset Quotes erd
15019 Note however that the
15020 \begin_inset Flex Code
15023 \begin_layout Plain Layout
15029 specifier is special and, because of implementation details, cannot be
15030 used in non-built in float types.
15031 If you do not understand what this means, just use
15032 \begin_inset Quotes eld
15036 \begin_inset Flex Code
15039 \begin_layout Plain Layout
15046 \begin_inset Quotes erd
15052 \begin_layout Description
15053 \begin_inset Flex Code
15056 \begin_layout Plain Layout
15063 \begin_inset Flex Code
15066 \begin_layout Plain Layout
15072 ] The prefix to use when creating labels referring to floats of this type.
15073 This allows the use of formatted references.
15074 Note that you can remove any
15075 \begin_inset Flex Code
15078 \begin_layout Plain Layout
15084 set by a copied style by using the special value
15085 \begin_inset Quotes eld
15089 \begin_inset Quotes erd
15092 , which must be all caps.
15095 \begin_layout Description
15096 \begin_inset Flex Code
15099 \begin_layout Plain Layout
15106 \begin_inset Flex Code
15109 \begin_layout Plain Layout
15116 \begin_inset Quotes erd
15120 \begin_inset Quotes erd
15123 ] The style used when defining the float using
15124 \begin_inset Flex Code
15127 \begin_layout Plain Layout
15138 \begin_layout Description
15139 \begin_inset Flex Code
15142 \begin_layout Plain Layout
15149 \begin_inset Flex Code
15152 \begin_layout Plain Layout
15159 \begin_inset Quotes erd
15163 \begin_inset Quotes erd
15167 \begin_inset Quotes eld
15171 \begin_inset Quotes erd
15174 of the new class of floats, like program or algorithm.
15175 After the appropriate
15176 \begin_inset Flex Code
15179 \begin_layout Plain Layout
15188 \begin_inset Flex Code
15191 \begin_layout Plain Layout
15200 \begin_inset Flex Code
15203 \begin_layout Plain Layout
15214 \begin_layout Description
15215 \begin_inset Flex Code
15218 \begin_layout Plain Layout
15225 \begin_inset Flex Code
15228 \begin_layout Plain Layout
15235 \begin_inset Flex Code
15238 \begin_layout Plain Layout
15246 ] Tells us whether this float is defined using the facilities provided by
15248 \begin_inset Flex Code
15251 \begin_layout Plain Layout
15257 , either by the class file or a package, or on-the-fly by LyX itself.
15260 \begin_layout Standard
15261 Note that defining a float with type
15262 \begin_inset Flex Code
15265 \begin_layout Plain Layout
15273 automatically defines the corresponding counter with name
15274 \begin_inset Flex Code
15277 \begin_layout Plain Layout
15288 \begin_layout Subsection
15289 Flex insets and InsetLayout
15290 \begin_inset CommandInset label
15292 name "sub:Flex-insets-and"
15299 \begin_layout Standard
15300 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
15301 these are called Flex insets.
15305 \begin_layout Standard
15306 Flex insets come in three different kinds:
15309 \begin_layout Itemize
15311 \begin_inset Flex Code
15314 \begin_layout Plain Layout
15320 ): These define semantic markup corresponding to such LaTeX commands as
15322 \begin_inset Flex Code
15325 \begin_layout Plain Layout
15334 \begin_inset Flex Code
15337 \begin_layout Plain Layout
15348 \begin_layout Itemize
15350 \begin_inset Flex Code
15353 \begin_layout Plain Layout
15359 ): These can be used to define custom collapsible insets, similar to TeX
15360 code, footnote, and the like.
15361 An obvious example is an endnote inset, which is defined in the
15362 \begin_inset Flex Code
15365 \begin_layout Plain Layout
15374 \begin_layout Itemize
15376 \begin_inset Flex Code
15379 \begin_layout Plain Layout
15385 ): For use with DocBook classes.
15388 \begin_layout Standard
15389 Flex insets are defined using the
15390 \begin_inset Flex Code
15393 \begin_layout Plain Layout
15399 tag, which shall be explained in a moment.
15402 \begin_layout Standard
15404 \begin_inset Flex Code
15407 \begin_layout Plain Layout
15413 tag also serves another function: It can be used to customize the general
15414 layout of many different types of insets.
15416 \begin_inset Flex Code
15419 \begin_layout Plain Layout
15425 can be used to customize the layout parameters for footnotes, marginal
15426 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
15427 boxes, tables, algorithms, URLs, and optional arguments, as well as to
15428 define Flex insets.
15431 \begin_layout Standard
15433 \begin_inset Flex Code
15436 \begin_layout Plain Layout
15442 definition must begin with a line of the form:
15445 \begin_layout LyX-Code
15449 \begin_layout Standard
15451 \begin_inset Flex Code
15454 \begin_layout Plain Layout
15460 indicates the inset whose layout is being defined, and here there are
15461 \change_inserted 5863208 1334489266
15463 \change_deleted 5863208 1334489267
15469 \begin_layout Enumerate
15470 The layout for a pre-existing inset is being modified.
15471 In this case, can be
15472 \begin_inset Flex Code
15475 \begin_layout Plain Layout
15481 any one of the following:
15482 \begin_inset Flex Code
15485 \begin_layout Plain Layout
15492 \begin_inset Flex Code
15495 \begin_layout Plain Layout
15502 \begin_inset Flex Code
15505 \begin_layout Plain Layout
15512 \begin_inset Flex Code
15515 \begin_layout Plain Layout
15522 \begin_inset Flex Code
15525 \begin_layout Plain Layout
15532 \begin_inset Flex Code
15535 \begin_layout Plain Layout
15542 \begin_inset Flex Code
15545 \begin_layout Plain Layout
15552 \begin_inset Flex Code
15555 \begin_layout Plain Layout
15562 \begin_inset Flex Code
15565 \begin_layout Plain Layout
15572 \begin_inset Flex Code
15575 \begin_layout Plain Layout
15582 \begin_inset Flex Code
15585 \begin_layout Plain Layout
15592 \begin_inset Flex Code
15595 \begin_layout Plain Layout
15602 \begin_inset Flex Code
15605 \begin_layout Plain Layout
15612 \begin_inset Flex Code
15615 \begin_layout Plain Layout
15622 \begin_inset Flex Code
15625 \begin_layout Plain Layout
15632 \begin_inset Flex Code
15635 \begin_layout Plain Layout
15642 \begin_inset Flex Code
15645 \begin_layout Plain Layout
15652 \begin_inset Flex Code
15655 \begin_layout Plain Layout
15657 \change_deleted -712698321 1353866704
15661 \change_inserted -712698321 1353866707
15670 \begin_inset Flex Code
15673 \begin_layout Plain Layout
15680 \begin_inset Flex Code
15683 \begin_layout Plain Layout
15692 \begin_layout Enumerate
15693 The layout for a Flex inset is being defined.
15695 \begin_inset Flex Code
15698 \begin_layout Plain Layout
15704 must be of the form
15705 \begin_inset Quotes eld
15709 \begin_inset Flex Code
15712 \begin_layout Plain Layout
15719 \begin_inset Quotes erd
15723 \begin_inset Flex Code
15726 \begin_layout Plain Layout
15732 may be be any valid identifier not used by a pre-existing Flex inset.
15733 The identifier may include spaces, but in that case the whole thing must
15734 be wrapped in quotes.
15735 Note that the definition of a flex inset
15740 \begin_inset Flex Code
15743 \begin_layout Plain Layout
15749 entry, declaring which type of inset it defines.
15750 \change_inserted 5863208 1334489312
15754 \begin_layout Enumerate
15756 \change_inserted 5863208 1334492248
15757 The layout for user specific branch is being defined.
15759 \begin_inset Flex Code
15762 \begin_layout Plain Layout
15764 \change_inserted 5863208 1334489384
15770 must be of the form
15771 \begin_inset Quotes eld
15775 \begin_inset Flex Code
15778 \begin_layout Plain Layout
15780 \change_inserted 5863208 1334489392
15787 \begin_inset Quotes erd
15791 \begin_inset Flex Code
15794 \begin_layout Plain Layout
15796 \change_inserted 5863208 1334489384
15802 may be be any valid identifier of branch defined in user's document.
15803 The identifier may include spaces, but in that case the whole thing must
15804 be wrapped in quotes.
15805 The main purpose of this feature is to allow LaTeX wrapping around specific
15806 branches as user needs.
15811 \begin_layout Standard
15813 \begin_inset Flex Code
15816 \begin_layout Plain Layout
15822 definition can contain the following entries:
15825 \begin_layout Description
15827 \change_inserted -712698321 1353681390
15828 \begin_inset Flex Code
15831 \begin_layout Plain Layout
15833 \change_inserted -712698321 1353681344
15840 \begin_inset Flex Code
15843 \begin_layout Plain Layout
15845 \change_inserted -712698321 1353681344
15851 ] Defines argument number <int> of a command\SpecialChar \slash{}
15852 environment associated with
15853 the current layout.
15854 The definition must end with
15855 \begin_inset Flex Code
15858 \begin_layout Plain Layout
15860 \change_inserted -712698321 1353681344
15868 \begin_inset space ~
15872 \begin_inset CommandInset ref
15874 reference "sub:Paragraph-Styles"
15881 \begin_layout Description
15883 \change_inserted -195340706 1333913893
15884 \begin_inset Flex Code
15887 \begin_layout Plain Layout
15893 Preamble for changing languages.
15895 \begin_inset space ~
15899 \begin_inset CommandInset ref
15901 reference "sub:I18n"
15908 \begin_layout Description
15909 \begin_inset Flex Code
15912 \begin_layout Plain Layout
15918 The color for the inset's background.
15919 The valid colors are defined in
15920 \begin_inset Flex Code
15923 \begin_layout Plain Layout
15932 \begin_layout Description
15933 \begin_inset Flex Code
15936 \begin_layout Plain Layout
15943 \begin_inset Flex Code
15946 \begin_layout Plain Layout
15955 \begin_inset Flex Code
15958 \begin_layout Plain Layout
15964 ] Whether to use the content of the inset as the label, when the inset is
15969 \begin_layout Description
15970 \begin_inset Flex Code
15973 \begin_layout Plain Layout
15980 \begin_inset Flex Code
15983 \begin_layout Plain Layout
15989 Copies all the features of an existing style into the current one.
15993 \begin_layout Description
15994 \begin_inset Flex Code
15997 \begin_layout Plain Layout
16004 \begin_inset Flex Code
16007 \begin_layout Plain Layout
16016 \begin_inset Flex Code
16019 \begin_layout Plain Layout
16025 ] Indicates whether the user may employ the Paragraph Settings dialog to
16026 customize the paragraph.
16029 \begin_layout Description
16030 \begin_inset Flex Code
16033 \begin_layout Plain Layout
16040 \begin_inset Flex Code
16043 \begin_layout Plain Layout
16050 \begin_inset Flex Code
16053 \begin_layout Plain Layout
16060 \begin_inset Flex Code
16063 \begin_layout Plain Layout
16069 , describing the rendering style used for the inset's frame and buttons.
16070 Footnotes generally use
16071 \begin_inset Flex Code
16074 \begin_layout Plain Layout
16080 , ERT insets generally
16081 \begin_inset Flex Code
16084 \begin_layout Plain Layout
16090 , and character styles
16091 \begin_inset Flex Code
16094 \begin_layout Plain Layout
16103 \begin_layout Description
16104 \begin_inset Flex Code
16107 \begin_layout Plain Layout
16114 \begin_inset Flex Code
16117 \begin_layout Plain Layout
16124 \begin_inset Flex Code
16127 \begin_layout Plain Layout
16136 \begin_inset Flex Code
16139 \begin_layout Plain Layout
16146 \begin_inset Flex Code
16149 \begin_layout Plain Layout
16156 Indicates whether the environment will stand on its own in LaTeX output
16157 or will appear inline with the surrounding text.
16158 If set to false, it is supposed that the LaTeX environment ignores white
16159 space (including one newline character) after the
16160 \begin_inset Flex Code
16163 \begin_layout Plain Layout
16176 \begin_inset Flex Code
16179 \begin_layout Plain Layout
16195 \begin_layout Description
16196 \begin_inset Flex Code
16199 \begin_layout Plain Layout
16205 Required at the end of the InsetLayout declarations.
16208 \begin_layout Description
16209 \begin_inset Flex Code
16212 \begin_layout Plain Layout
16218 The font used for both the text body
16224 \begin_inset space ~
16228 \begin_inset CommandInset ref
16230 reference "sub:Font-description"
16235 Note that defining this font automatically defines the
16236 \begin_inset Flex Code
16239 \begin_layout Plain Layout
16245 to the same value, so define this first and define
16246 \begin_inset Flex Code
16249 \begin_layout Plain Layout
16255 later if you want them to be different.
16256 \change_inserted 155139281 1354130923
16260 \begin_layout Description
16262 \change_inserted 155139281 1354130923
16263 \begin_inset Flex Code
16266 \begin_layout Plain Layout
16268 \change_inserted 155139281 1354130923
16269 ForceLocalFontSwitch
16275 \begin_inset Flex Code
16278 \begin_layout Plain Layout
16280 \change_inserted 155139281 1354130923
16289 \begin_inset Flex Code
16292 \begin_layout Plain Layout
16294 \change_inserted 155139281 1354130923
16300 ] When using babel, always use a local font switch (
16301 \begin_inset Flex Code
16304 \begin_layout Plain Layout
16306 \change_inserted 155139281 1354130923
16314 ), never a global one (such as
16315 \begin_inset Flex Code
16318 \begin_layout Plain Layout
16320 \change_inserted 155139281 1354130923
16333 \begin_layout Description
16334 \begin_inset Flex Code
16337 \begin_layout Plain Layout
16344 \begin_inset Quotes eld
16348 \begin_inset Quotes erd
16351 language, leading to Left-to-Right (latin) output, e.
16352 \begin_inset space \thinspace{}
16356 \begin_inset space \space{}
16359 in TeX code or URL.
16363 \begin_layout Description
16364 \begin_inset Flex Code
16367 \begin_layout Plain Layout
16374 \begin_inset Flex Code
16377 \begin_layout Plain Layout
16386 \begin_inset Flex Code
16389 \begin_layout Plain Layout
16395 ] Indicates whether the
16396 \begin_inset Flex Code
16399 \begin_layout Plain Layout
16405 should be used or, instead, the user can change the paragraph style used
16410 \begin_layout Description
16411 \begin_inset Flex Code
16414 \begin_layout Plain Layout
16421 \begin_inset Flex Code
16424 \begin_layout Plain Layout
16433 \begin_inset Flex Code
16436 \begin_layout Plain Layout
16442 ] Usually LyX doesn't allow you to insert more than one space between words,
16443 since a space is considered as the separation between two words, not a
16444 character or symbol of its own.
16445 This is a very fine thing but sometimes annoying, for example, when typing
16446 program code or plain LaTeX code.
16448 \begin_inset Flex Code
16451 \begin_layout Plain Layout
16458 Note that LyX will create protected blanks for the additional blanks when
16459 in another mode than LaTeX-mode.
16463 \begin_layout Description
16464 \begin_inset Flex Code
16467 \begin_layout Plain Layout
16473 These tags control XHTML output.
16475 \begin_inset CommandInset ref
16477 reference "sec:Tags-for-XHTML"
16484 \begin_layout Description
16485 \begin_inset Flex Code
16488 \begin_layout Plain Layout
16495 \begin_inset Flex Code
16498 \begin_layout Plain Layout
16507 \begin_inset Flex Code
16510 \begin_layout Plain Layout
16516 ] Whether to include the contents of this inset in the strings generated
16517 for the `Outline' pane.
16518 One would not, for example, want the content of a footnote in a section
16519 header to be included in the TOC displayed in the outline, but one would
16520 normally want the content of a character style displayed.
16521 Default is false: not to include.
16524 \begin_layout Description
16525 \begin_inset Flex Code
16528 \begin_layout Plain Layout
16535 \begin_inset Flex Code
16538 \begin_layout Plain Layout
16547 \begin_inset Flex Code
16550 \begin_layout Plain Layout
16556 ] Usually LyX does not allow you to leave a paragraph empty, since it would
16557 lead to empty LaTeX output.
16558 There are some cases where this could be desirable however: in a letter
16559 template, the required fields can be provided as empty fields, so that
16560 people do not forget them; in some special classes, a style can be used
16561 as some kind of break, which does not contain actual text.
16565 \begin_layout Description
16566 \begin_inset Flex Code
16569 \begin_layout Plain Layout
16575 The font used for the label.
16577 \begin_inset space ~
16581 \begin_inset CommandInset ref
16583 reference "sub:Font-description"
16588 Note that this definition can never appear before
16589 \begin_inset Flex Code
16592 \begin_layout Plain Layout
16598 , lest it be ineffective.
16601 \begin_layout Description
16602 \begin_inset Flex Code
16605 \begin_layout Plain Layout
16611 What will be displayed on the button or elsewhere as the inset label.
16613 \begin_inset Flex Code
16616 \begin_layout Plain Layout
16623 \begin_inset Flex Code
16626 \begin_layout Plain Layout
16632 ) modify this label on the fly.
16635 \begin_layout Description
16637 \change_inserted -195340706 1333913893
16638 \begin_inset Flex Code
16641 \begin_layout Plain Layout
16647 Language dependent preamble.
16649 \begin_inset space ~
16653 \begin_inset CommandInset ref
16655 reference "sub:I18n"
16662 \begin_layout Description
16663 \begin_inset Flex Code
16666 \begin_layout Plain Layout
16672 The name of the corresponding LaTeX stuff.
16673 Either the environment or command name.
16676 \begin_layout Description
16677 \begin_inset Flex Code
16680 \begin_layout Plain Layout
16686 The optional parameter for the corresponding
16687 \begin_inset Flex Code
16690 \begin_layout Plain Layout
16696 stuff, including possible bracket pairs like
16697 \begin_inset Flex Code
16700 \begin_layout Plain Layout
16708 \change_inserted -712698321 1355144715
16709 This will be output as is after all LaTeX
16710 \begin_inset Flex Code
16713 \begin_layout Plain Layout
16715 \change_inserted -712698321 1355144713
16724 This parameter cannot be changed from within LyX
16725 \change_inserted -712698321 1355144775
16727 \begin_inset Flex Code
16730 \begin_layout Plain Layout
16732 \change_inserted -712698321 1355144747
16738 for customizable parameters)
16743 \begin_layout Description
16744 \begin_inset Flex Code
16747 \begin_layout Plain Layout
16754 \begin_inset Flex Code
16757 \begin_layout Plain Layout
16759 \change_deleted -712698321 1353867544
16766 Command, Environment,
16767 \change_inserted -712698321 1353867573
16769 \change_deleted -712698321 1353867557
16778 \begin_inset Flex Code
16781 \begin_layout Plain Layout
16783 \change_deleted -712698321 1353867564
16787 \change_deleted -712698321 1353867569
16795 ] How the style should be translated into LaTeX.
16799 \begin_layout Plain Layout
16800 \begin_inset Flex Code
16803 \begin_layout Plain Layout
16809 is perhaps a bit misleading, since these rules apply to SGML classes, too.
16810 Visit the SGML class files for specific examples.
16819 \begin_layout Itemize
16820 \begin_inset Flex Code
16823 \begin_layout Plain Layout
16825 \change_deleted -712698321 1353867582
16827 \change_inserted -712698321 1353867583
16835 means nothing special.
16839 \begin_layout Itemize
16840 \begin_inset Flex Code
16843 \begin_layout Plain Layout
16850 \begin_inset Flex Code
16853 \begin_layout Plain Layout
16860 {\SpecialChar \ldots{}
16869 \begin_layout Itemize
16870 \begin_inset Flex Code
16873 \begin_layout Plain Layout
16880 \begin_inset Flex Code
16883 \begin_layout Plain Layout
16890 }\SpecialChar \ldots{}
16906 \begin_layout Itemize
16908 \change_deleted -712698321 1353867600
16909 \begin_inset Flex Code
16912 \begin_layout Plain Layout
16919 \begin_inset Flex Code
16922 \begin_layout Plain Layout
16929 \begin_inset Flex Code
16932 \begin_layout Plain Layout
16940 is generated for each paragraph of this environment.
16944 \begin_layout Itemize
16946 \change_deleted -712698321 1353867600
16947 \begin_inset Flex Code
16950 \begin_layout Plain Layout
16957 \begin_inset Flex Code
16960 \begin_layout Plain Layout
16967 \begin_inset Flex Code
16970 \begin_layout Plain Layout
16976 is passed as an argument to the environment.
16978 \begin_inset Flex Code
16981 \begin_layout Plain Layout
16987 can be defined in the
16988 \begin_inset Flex MenuItem
16991 \begin_layout Plain Layout
16996 \SpecialChar \menuseparator
17002 \begin_inset space ~
17016 \begin_layout Standard
17017 Putting the last few things together, the LaTeX output will be either:
17020 \begin_layout LyX-Code
17023 latexname[latexparam]{\SpecialChar \ldots{}
17027 \begin_layout Standard
17031 \begin_layout LyX-Code
17034 begin{latexname}[latexparam] \SpecialChar \ldots{}
17040 \begin_layout Standard
17041 depending upon the LaTeX type.
17045 \begin_layout Description
17047 \change_inserted -712698321 1354263128
17048 \begin_inset Flex Code
17051 \begin_layout Plain Layout
17053 \change_inserted -712698321 1353866742
17062 \begin_inset Flex Code
17065 \begin_layout Plain Layout
17067 \change_inserted -712698321 1353866752
17073 ] A string that is put at the beginning of the layout content.
17074 A line break in the output can be indicated by
17075 \begin_inset Flex Code
17078 \begin_layout Plain Layout
17080 \change_inserted -712698321 1354263128
17091 \begin_layout Description
17092 \begin_inset Flex Code
17095 \begin_layout Plain Layout
17102 \begin_inset Flex Code
17105 \begin_layout Plain Layout
17112 \begin_inset Flex Code
17115 \begin_layout Plain Layout
17122 \begin_inset Flex Code
17125 \begin_layout Plain Layout
17132 \begin_inset Flex Code
17135 \begin_layout Plain Layout
17141 (indicating a dummy definition ending definitions of charstyles, etc).
17142 This entry is required in and is only meaningful for Flex insets.
17143 Among other things, it determines on which menu this inset will appear.
17145 \begin_inset Flex Code
17148 \begin_layout Plain Layout
17155 \begin_inset Flex Code
17158 \begin_layout Plain Layout
17165 \begin_inset Flex Code
17168 \begin_layout Plain Layout
17176 \begin_inset Flex Code
17179 \begin_layout Plain Layout
17185 can be set to true for charstyle insets, if you wish, by setting it
17190 \begin_inset Flex Code
17193 \begin_layout Plain Layout
17202 \begin_layout Description
17203 \begin_inset Flex Code
17206 \begin_layout Plain Layout
17213 \begin_inset Flex Code
17216 \begin_layout Plain Layout
17225 \begin_inset Flex Code
17228 \begin_layout Plain Layout
17234 ] Whether multiple paragraphs are permitted in this inset.
17236 \begin_inset Flex Code
17239 \begin_layout Plain Layout
17245 to the same value and
17246 \begin_inset Flex Code
17249 \begin_layout Plain Layout
17255 to the opposite value.
17256 These can be reset to other values, if they are used
17261 \begin_inset Flex Code
17264 \begin_layout Plain Layout
17274 \begin_layout Description
17275 \begin_inset Flex Code
17278 \begin_layout Plain Layout
17285 \begin_inset Flex Code
17288 \begin_layout Plain Layout
17297 \begin_inset Flex Code
17300 \begin_layout Plain Layout
17306 ] Whether fragile commands in this inset should be
17307 \begin_inset Flex Code
17310 \begin_layout Plain Layout
17323 whether the command should itself be protected.) Default is false.
17326 \begin_layout Description
17327 \begin_inset Flex Code
17330 \begin_layout Plain Layout
17337 \begin_inset Flex Code
17340 \begin_layout Plain Layout
17349 \begin_inset Flex Code
17352 \begin_layout Plain Layout
17358 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
17359 output, but only by a line break; together with
17360 \begin_inset Flex Code
17363 \begin_layout Plain Layout
17369 , this allows to emulate a plain text editor (like the ERT inset).
17373 \begin_layout Description
17374 \begin_inset Flex Code
17377 \begin_layout Plain Layout
17384 \begin_inset Flex Code
17387 \begin_layout Plain Layout
17396 \begin_inset Flex Code
17399 \begin_layout Plain Layout
17405 ] Whether the contents of this paragraph should be output in raw form, meaning
17406 without special translations that LaTeX would require.
17409 \begin_layout Description
17410 \begin_inset Flex Code
17413 \begin_layout Plain Layout
17419 Information to be included in the LaTeX preamble when this style is used.
17420 Used to define macros, load packages, etc., required by this particular
17423 \begin_inset Quotes eld
17427 \begin_inset Flex Code
17430 \begin_layout Plain Layout
17437 \begin_inset Quotes erd
17443 \begin_layout Description
17444 \begin_inset Flex Code
17447 \begin_layout Plain Layout
17454 \begin_inset Flex Code
17457 \begin_layout Plain Layout
17463 ] The prefix to use when creating labels referring to insets of this type.
17464 This allows the use of formatted references.
17467 \begin_layout Description
17468 \begin_inset Flex Code
17471 \begin_layout Plain Layout
17478 \begin_inset Flex Code
17481 \begin_layout Plain Layout
17487 ] Whether the style requires the feature
17488 \begin_inset Flex Code
17491 \begin_layout Plain Layout
17498 See the description of
17499 \begin_inset Flex Code
17502 \begin_layout Plain Layout
17509 \begin_inset CommandInset ref
17510 LatexCommand pageref
17511 reference "des:FreeSpacing"
17515 ) for information on `features'.
17516 \change_inserted -712698321 1354439699
17520 \begin_layout Description
17522 \change_inserted -712698321 1354439705
17523 \begin_inset Flex Code
17526 \begin_layout Plain Layout
17528 \change_inserted -712698321 1354439699
17535 \begin_inset Flex Code
17538 \begin_layout Plain Layout
17540 \change_inserted -712698321 1354439699
17549 \begin_inset Flex Code
17552 \begin_layout Plain Layout
17554 \change_inserted -712698321 1354439699
17560 ] Resets the LaTeX arguments of this layout (as defined via the
17561 \begin_inset Flex Code
17564 \begin_layout Plain Layout
17566 \change_inserted -712698321 1354439699
17573 This is useful if you have copied a style via
17574 \begin_inset Flex Code
17577 \begin_layout Plain Layout
17579 \change_inserted -712698321 1354439699
17585 , but you do not want to inherit its (required and optional) arguments.
17587 \change_deleted -712698321 1354439698
17593 \begin_layout Description
17594 \begin_inset Flex Code
17597 \begin_layout Plain Layout
17604 \begin_inset Flex Code
17607 \begin_layout Plain Layout
17614 \begin_inset Flex Code
17617 \begin_layout Plain Layout
17625 ] Whether this inset should use the font of its surrounding environment
17627 Default is true: uses its own.
17628 \change_inserted -712698321 1353866806
17632 \begin_layout Description
17634 \change_inserted -712698321 1354263134
17635 \begin_inset Flex Code
17638 \begin_layout Plain Layout
17640 \change_inserted -712698321 1353866810
17647 \begin_inset Flex Code
17650 \begin_layout Plain Layout
17652 \change_inserted -712698321 1353866806
17658 ] A string that is put at the end of the layout content.
17659 A line break in the output can be indicated by
17660 \begin_inset Flex Code
17663 \begin_layout Plain Layout
17665 \change_inserted -712698321 1354263134
17676 \begin_layout Description
17677 \begin_inset Flex Code
17680 \begin_layout Plain Layout
17687 \begin_inset Flex Code
17690 \begin_layout Plain Layout
17697 \begin_inset Flex Code
17700 \begin_layout Plain Layout
17708 ] Spellcheck the contents of this inset.
17712 \begin_layout Subsection
17714 \begin_inset CommandInset label
17716 name "sub:Counters"
17723 \begin_layout Standard
17724 Since version 1.3.0 of LyX, it is both possible and necessary to define the
17726 \begin_inset Flex MenuItem
17729 \begin_layout Plain Layout
17736 \begin_inset Flex MenuItem
17739 \begin_layout Plain Layout
17745 , \SpecialChar \ldots{}
17746 ) in the text class itself.
17747 The standard counters are defined in the file
17748 \begin_inset Flex Code
17751 \begin_layout Plain Layout
17757 , so you may have to do no more than add
17760 \begin_layout LyX-Code
17761 Input stdcounters.inc
17764 \begin_layout Standard
17765 to your layout file to get them to work.
17766 But if you want to define custom counters, then you can do so.
17767 The counter declaration must begin with:
17770 \begin_layout LyX-Code
17771 Counter CounterName
17774 \begin_layout Standard
17776 \begin_inset Flex Code
17779 \begin_layout Plain Layout
17785 ' is replaced by the name of the counter.
17786 And it must end with
17787 \begin_inset Quotes eld
17791 \begin_inset Flex Code
17794 \begin_layout Plain Layout
17801 \begin_inset Quotes erd
17805 The following parameters can also be used:
17808 \begin_layout Description
17809 \begin_inset Flex Code
17812 \begin_layout Plain Layout
17819 \begin_inset Flex Code
17822 \begin_layout Plain Layout
17829 \begin_inset Quotes erd
17833 \begin_inset Quotes erd
17836 ] When defined, this string defines how the counter is displayed.
17837 Setting this value sets
17838 \begin_inset Flex Code
17841 \begin_layout Plain Layout
17842 LabelStringAppendix
17848 The following special constructs can be used in the string:
17852 \begin_layout Itemize
17853 \begin_inset Flex Code
17856 \begin_layout Plain Layout
17864 will be replaced by the expansion of the
17865 \begin_inset Flex Code
17868 \begin_layout Plain Layout
17875 \begin_inset Flex Code
17878 \begin_layout Plain Layout
17879 LabelStringAppendix
17885 \begin_inset Flex Code
17888 \begin_layout Plain Layout
17898 \begin_layout Itemize
17899 counter values can be expressed using LaTeX-like macros
17900 \begin_inset Flex Code
17903 \begin_layout Plain Layout
17920 \begin_inset Flex Code
17923 \begin_layout Plain Layout
17935 \begin_layout Plain Layout
17945 Actually, the situation is a bit more complicated: any
17964 other than those described below will produce arabic numerals.
17965 It would not be surprising to see this change in the future.
17971 \begin_inset Flex Code
17974 \begin_layout Plain Layout
17980 : 1, 2, 3,\SpecialChar \ldots{}
17982 \begin_inset Flex Code
17985 \begin_layout Plain Layout
17991 for lower-case letters: a, b, c, \SpecialChar \ldots{}
17993 \begin_inset Flex Code
17996 \begin_layout Plain Layout
18002 for upper-case letters: A, B, C, \SpecialChar \ldots{}
18004 \begin_inset Flex Code
18007 \begin_layout Plain Layout
18013 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
18015 \begin_inset Flex Code
18018 \begin_layout Plain Layout
18024 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
18026 \begin_inset Flex Code
18029 \begin_layout Plain Layout
18035 for hebrew numerals.
18039 \begin_layout Standard
18040 If LabelString is not defined, a default value is constructed as follows:
18041 if the counter has a master counter
18042 \begin_inset Flex Code
18045 \begin_layout Plain Layout
18052 \begin_inset Flex Code
18055 \begin_layout Plain Layout
18062 \begin_inset Flex Code
18065 \begin_layout Plain Layout
18075 is used; otherwise the string
18076 \begin_inset Flex Code
18079 \begin_layout Plain Layout
18090 \begin_layout Description
18091 \begin_inset Flex Code
18094 \begin_layout Plain Layout
18095 LabelStringAppendix
18101 \begin_inset Flex Code
18104 \begin_layout Plain Layout
18111 \begin_inset Quotes erd
18115 \begin_inset Quotes erd
18119 \begin_inset Flex Code
18122 \begin_layout Plain Layout
18128 , but for use in the Appendix.
18131 \begin_layout Description
18132 \begin_inset Flex Code
18135 \begin_layout Plain Layout
18142 \begin_inset Flex Code
18145 \begin_layout Plain Layout
18152 \begin_inset Quotes erd
18156 \begin_inset Quotes erd
18159 ] A format for use with formatted references to this counter.
18160 For example, one might want to have references to section numbers appear
18162 \begin_inset Quotes eld
18166 \begin_inset Quotes erd
18170 The string should contain
18171 \begin_inset Quotes eld
18175 \begin_inset Quotes erd
18179 This will be replaced by the counter number itself.
18180 So, for sections, it would be: Section ##.
18183 \begin_layout Description
18184 \begin_inset Flex Code
18187 \begin_layout Plain Layout
18194 \begin_inset Flex Code
18197 \begin_layout Plain Layout
18204 \begin_inset Quotes erd
18208 \begin_inset Quotes erd
18211 ] If this is set to the name of another counter, the present counter will
18212 be reset every time the other one is increased.
18214 \begin_inset Flex Code
18217 \begin_layout Plain Layout
18224 \begin_inset Flex Code
18227 \begin_layout Plain Layout
18236 \begin_layout Subsection
18238 \begin_inset CommandInset label
18240 name "sub:Font-description"
18247 \begin_layout Standard
18248 A font description looks like this:
18251 \begin_layout LyX-Code
18261 \begin_layout LyX-Code
18265 \begin_layout LyX-Code
18269 \begin_layout Standard
18270 The following commands are available:
18273 \begin_layout Description
18274 \begin_inset Flex Code
18277 \begin_layout Plain Layout
18284 \begin_inset Flex Code
18287 \begin_layout Plain Layout
18296 \begin_inset Flex Code
18299 \begin_layout Plain Layout
18306 \begin_inset Flex Code
18309 \begin_layout Plain Layout
18316 \begin_inset Flex Code
18319 \begin_layout Plain Layout
18326 \begin_inset Flex Code
18329 \begin_layout Plain Layout
18336 \begin_inset Flex Code
18339 \begin_layout Plain Layout
18346 \begin_inset Flex Code
18349 \begin_layout Plain Layout
18356 \begin_inset Flex Code
18359 \begin_layout Plain Layout
18366 \begin_inset Flex Code
18369 \begin_layout Plain Layout
18378 \begin_layout Description
18379 \begin_inset Flex Code
18382 \begin_layout Plain Layout
18389 \begin_inset Flex Code
18392 \begin_layout Plain Layout
18401 \begin_inset Flex Code
18404 \begin_layout Plain Layout
18411 \begin_inset Flex Code
18414 \begin_layout Plain Layout
18423 \begin_layout Description
18424 \begin_inset Flex Code
18427 \begin_layout Plain Layout
18434 \begin_inset Flex Code
18437 \begin_layout Plain Layout
18443 ] Valid arguments are:
18444 \begin_inset Flex Code
18447 \begin_layout Plain Layout
18454 \begin_inset Flex Code
18457 \begin_layout Plain Layout
18464 \begin_inset Flex Code
18467 \begin_layout Plain Layout
18474 \begin_inset Flex Code
18477 \begin_layout Plain Layout
18484 \begin_inset Flex Code
18487 \begin_layout Plain Layout
18494 \begin_inset Flex Code
18497 \begin_layout Plain Layout
18504 \begin_inset Flex Code
18507 \begin_layout Plain Layout
18514 \begin_inset Flex Code
18517 \begin_layout Plain Layout
18524 \begin_inset Flex Code
18527 \begin_layout Plain Layout
18534 \begin_inset Flex Code
18537 \begin_layout Plain Layout
18544 \begin_inset Flex Code
18547 \begin_layout Plain Layout
18554 \begin_inset Flex Code
18557 \begin_layout Plain Layout
18564 Each of these turns on or off the corresponding attribute.
18566 \begin_inset Flex Code
18569 \begin_layout Plain Layout
18575 turns on emphasis, and
18576 \begin_inset Flex Code
18579 \begin_layout Plain Layout
18587 \begin_inset Newline newline
18590 If the latter seems puzzling, remember that the font settings for the present
18591 context are generally inherited from the surrounding context.
18593 \begin_inset Flex Code
18596 \begin_layout Plain Layout
18602 would turn off the emphasis that was anyway in effect, say, in a theorem
18606 \begin_layout Description
18607 \begin_inset Flex Code
18610 \begin_layout Plain Layout
18617 \begin_inset Flex Code
18620 \begin_layout Plain Layout
18629 \begin_inset Flex Code
18632 \begin_layout Plain Layout
18641 \begin_layout Description
18642 \begin_inset Flex Code
18645 \begin_layout Plain Layout
18652 \begin_inset Flex Code
18655 \begin_layout Plain Layout
18664 \begin_inset Flex Code
18667 \begin_layout Plain Layout
18674 \begin_inset Flex Code
18677 \begin_layout Plain Layout
18684 \begin_inset Flex Code
18687 \begin_layout Plain Layout
18696 \begin_layout Description
18697 \begin_inset Flex Code
18700 \begin_layout Plain Layout
18707 \begin_inset Flex Code
18710 \begin_layout Plain Layout
18717 \begin_inset Flex Code
18720 \begin_layout Plain Layout
18727 \begin_inset Flex Code
18730 \begin_layout Plain Layout
18739 \begin_inset Flex Code
18742 \begin_layout Plain Layout
18749 \begin_inset Flex Code
18752 \begin_layout Plain Layout
18759 \begin_inset Flex Code
18762 \begin_layout Plain Layout
18769 \begin_inset Flex Code
18772 \begin_layout Plain Layout
18779 \begin_inset Flex Code
18782 \begin_layout Plain Layout
18791 \begin_layout Subsection
18792 \begin_inset CommandInset label
18794 name "sub:Citation-format-description"
18798 Citation format description
18801 \begin_layout Standard
18803 \begin_inset Flex Code
18806 \begin_layout Plain Layout
18812 blocks are used to describe how bibliographic information should be displayed,
18813 both within LyX itself (in the citation dialog and in tooltips, for example)
18814 and in XHTML output.
18815 Such a block might look like this:
18818 \begin_layout LyX-Code
18822 \begin_layout LyX-Code
18826 \begin_layout LyX-Code
18830 \begin_layout LyX-Code
18834 \begin_layout Standard
18835 The individual lines define how the bibliographic information associated
18836 with an article or book, respectively, is to be displayed, and such a definitio
18837 n can be given for any `entry type' that might be present in a BibTeX file.
18838 LyX defines a default format in the source code that will be used if no
18839 specific definition has been given.
18840 LyX predefines several formats in the file
18841 \begin_inset Flex Code
18844 \begin_layout Plain Layout
18850 , which is included in most of LyX's document classes.
18853 \begin_layout Standard
18854 The definitions use a simple language that allows BibTeX keys to be replaced
18856 Keys should be enclosed in
18857 \begin_inset Flex Code
18860 \begin_layout Plain Layout
18867 \begin_inset Flex Code
18870 \begin_layout Plain Layout
18877 So a simple definition might look like this:
18880 \begin_layout LyX-Code
18882 \begin_inset Quotes eld
18886 \begin_inset Quotes erd
18892 \begin_layout Standard
18893 This would print the author, followed by a comma, followed by the title,
18894 in quotes, followed by a period.
18897 \begin_layout Standard
18898 Of course, sometimes you may want to print a key only if it exists.
18899 This can be done by using a conditional construction, such as:
18900 \begin_inset Flex Code
18903 \begin_layout Plain Layout
18905 \begin_inset space ~
18915 \begin_inset Flex Code
18918 \begin_layout Plain Layout
18924 key exists, then print
18925 \begin_inset Quotes eld
18929 \begin_inset space ~
18933 \begin_inset Quotes erd
18936 followed by the volume key.
18937 It is also possible to have an else clause in the conditional, such as:
18939 \begin_inset Flex Code
18942 \begin_layout Plain Layout
18943 {%author%[[%author%]][[%editor%, ed.]]}
18950 \begin_inset Flex Code
18953 \begin_layout Plain Layout
18959 key is printed if it exists; otherwise, the editor key is printed, followed
18961 \begin_inset Quotes eld
18965 \begin_inset space ~
18969 \begin_inset Quotes erd
18972 Note that the key is again enclosed in
18973 \begin_inset Flex Code
18976 \begin_layout Plain Layout
18982 signs; the entire conditional is enclosed in braces; and the if and else
18983 clauses are enclosed in double brackets,
18984 \begin_inset Quotes eld
18988 \begin_inset Flex Code
18991 \begin_layout Plain Layout
18998 \begin_inset Quotes eld
19002 \begin_inset Quotes eld
19006 \begin_inset Flex Code
19009 \begin_layout Plain Layout
19016 \begin_inset Quotes erd
19020 There must be no space between any of these.
19023 \begin_layout Standard
19024 There is one other piece of syntax available in definitions, which looks
19026 \begin_inset Flex Code
19029 \begin_layout Plain Layout
19036 This defines a piece of formatting information that is to be used when
19038 \begin_inset Quotes eld
19042 \begin_inset Quotes erd
19046 Obviously, we do not want to output HTML tags when writing plain text,
19047 so they should be wrapped in
19048 \begin_inset Quotes eld
19052 \begin_inset Quotes erd
19056 \begin_inset Quotes eld
19060 \begin_inset Quotes erd
19066 \begin_layout Standard
19067 Two special sorts of definitions are also possible in a
19068 \begin_inset Flex Code
19071 \begin_layout Plain Layout
19078 An example of the first would be:
19081 \begin_layout LyX-Code
19083 \begin_inset Quotes eld
19087 \begin_inset Quotes erd
19093 \begin_layout Standard
19094 This is an abbreviation, or macro, and it can be used by treating it as
19096 \begin_inset Flex Code
19099 \begin_layout Plain Layout
19107 \begin_inset Flex Code
19110 \begin_layout Plain Layout
19116 exactly as it would treat its definition.
19117 So, let us issue the obvious
19125 \begin_layout LyX-Code
19129 \begin_layout Standard
19130 or anything like it.
19131 LyX shouldn't go into an infinite loop, but it may go into a long one before
19135 \begin_layout Standard
19136 The second sort of special definition might look like this:
19139 \begin_layout LyX-Code
19143 \begin_layout Standard
19144 This defines a translatable piece of text, which allows relevant parts of
19145 the bibliography to be translated.
19146 It can be included in a definition by treating it as a key:
19147 \begin_inset Flex Code
19150 \begin_layout Plain Layout
19157 Several of these are predefined in
19158 \begin_inset Flex Code
19161 \begin_layout Plain Layout
19168 Note that these are not macros, in the sense just defined.
19169 They will not be expanded.
19172 \begin_layout Standard
19173 So here then is an example that use all these features:
19176 \begin_layout LyX-Code
19177 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
19180 \begin_layout Standard
19181 This defines a macro that prints the author, followed by a comma, if the
19183 \begin_inset Flex Code
19186 \begin_layout Plain Layout
19192 key is defined, or else prints the name of the editor, followed by the
19194 \begin_inset Flex Code
19197 \begin_layout Plain Layout
19203 or its translation (it is by default
19204 \begin_inset Quotes eld
19208 \begin_inset Quotes erd
19212 \begin_inset Flex Code
19215 \begin_layout Plain Layout
19222 Note that this is in fact defined in
19223 \begin_inset Flex Code
19226 \begin_layout Plain Layout
19232 , so you can use it in your own definitions, or re-definitions, if you load
19236 \begin_layout Section
19237 \begin_inset CommandInset label
19239 name "sec:Tags-for-XHTML"
19243 Tags for XHTML output
19246 \begin_layout Standard
19247 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
19248 by layout information.
19249 In general, LyX provides sensible defaults and, as mentioned earlier, it
19250 will even construct default CSS style rules from the other layout tags.
19251 For example, LyX will attempt to use the information provided in the
19252 \begin_inset Flex Code
19255 \begin_layout Plain Layout
19261 declaration for the Chapter style to write CSS that will appropriately
19262 format chapter headings.
19265 \begin_layout Standard
19266 In many cases, then, you may not have to do anything at all to get acceptable
19267 XHTML output for your own environments, custom insets, and so forth.
19268 But in some cases you will, and so LyX provides a number of layout tags
19269 that can be used to customize the XHTML and CSS that are generated.
19272 \begin_layout Standard
19273 Note that there are two tags,
19274 \begin_inset Flex Code
19277 \begin_layout Plain Layout
19284 \begin_inset Flex Code
19287 \begin_layout Plain Layout
19293 that may appear outside style and inset declarations.
19295 \begin_inset CommandInset ref
19297 reference "sub:General-text-class"
19301 for details on these.
19304 \begin_layout Subsection
19305 \begin_inset CommandInset label
19307 name "sub:Paragraph-Style-XHTML"
19314 \begin_layout Standard
19315 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
19316 dealing with a normal paragraph, a command, or an environment, where this
19317 is itself determined by the contents of the corresponding
19318 \begin_inset Flex Code
19321 \begin_layout Plain Layout
19331 \begin_layout Standard
19332 For a command or normal paragraph, the output XHTML has the following form:
19335 \begin_layout LyX-Code
19337 \begin_inset Quotes erd
19341 \begin_inset Quotes erd
19347 \begin_layout LyX-Code
19349 \begin_inset Quotes erd
19353 \begin_inset Quotes erd
19359 \begin_layout LyX-Code
19360 Contents of the paragraph.
19363 \begin_layout LyX-Code
19367 \begin_layout Standard
19368 The label tags are of course omitted if the paragraph does not have a label.
19371 \begin_layout Standard
19372 For an environment that is not some sort of list, the XHTML takes this form:
19375 \begin_layout LyX-Code
19377 \begin_inset Quotes erd
19381 \begin_inset Quotes erd
19387 \begin_layout LyX-Code
19389 \begin_inset Quotes erd
19393 \begin_inset Quotes erd
19397 \begin_inset Quotes erd
19401 \begin_inset Quotes erd
19404 >Environment Label</labeltag>First paragraph.</itemtag>
19407 \begin_layout LyX-Code
19408 <itemtag>Second paragraph.</itemtag>
19411 \begin_layout LyX-Code
19415 \begin_layout Standard
19416 Note that the label is output only for the first paragraph, as it should
19417 be for a theorem, for example.
19421 \begin_layout Standard
19422 For a list, we have one of these forms:
19425 \begin_layout LyX-Code
19427 \begin_inset Quotes erd
19431 \begin_inset Quotes erd
19437 \begin_layout LyX-Code
19439 \begin_inset Quotes erd
19443 \begin_inset Quotes erd
19447 \begin_inset Quotes erd
19451 \begin_inset Quotes erd
19454 >List Label</labeltag>First item.</itemtag>
19457 \begin_layout LyX-Code
19459 \begin_inset Quotes erd
19463 \begin_inset Quotes erd
19467 \begin_inset Quotes erd
19471 \begin_inset Quotes erd
19474 >List Label</labeltag>Second item.</itemtag>
19477 \begin_layout LyX-Code
19481 \begin_layout LyX-Code
19485 \begin_layout LyX-Code
19487 \begin_inset Quotes erd
19491 \begin_inset Quotes erd
19497 \begin_layout LyX-Code
19499 \begin_inset Quotes erd
19503 \begin_inset Quotes erd
19506 >List Label</labeltag><itemtag attr=
19507 \begin_inset Quotes erd
19511 \begin_inset Quotes erd
19514 >First item.</itemtag>
19517 \begin_layout LyX-Code
19519 \begin_inset Quotes erd
19523 \begin_inset Quotes erd
19526 >List Label</labeltag><itemtag attr=
19527 \begin_inset Quotes erd
19531 \begin_inset Quotes erd
19534 >Second item.</itemtag>
19537 \begin_layout LyX-Code
19541 \begin_layout Standard
19542 Note the different orders of
19543 \begin_inset Flex Code
19546 \begin_layout Plain Layout
19553 \begin_inset Flex Code
19556 \begin_layout Plain Layout
19563 Which order we get depends upon the setting of
19564 \begin_inset Flex Code
19567 \begin_layout Plain Layout
19574 \begin_inset Flex Code
19577 \begin_layout Plain Layout
19583 is false (the default), you get the first of these, with the label within
19584 the item; if true, you get the second, with the label outside the item.
19587 \begin_layout Standard
19588 The specific tags and attributes output for each paragraph type can be controlle
19589 d by means of the layout tags we are about to describe.
19590 As mentioned earlier, however, LyX uses sensible defaults for many of these,
19591 so you often may not need to do very much to get good XHTML output.
19592 Think of the available tags as there so you can tweak things to your liking.
19595 \begin_layout Description
19596 \begin_inset Flex Code
19599 \begin_layout Plain Layout
19606 \begin_inset Flex Code
19609 \begin_layout Plain Layout
19615 ] Specifies attribute information to be output with the main tag.
19617 \begin_inset Quotes eld
19621 \begin_inset Flex Code
19624 \begin_layout Plain Layout
19631 \begin_inset Quotes erd
19635 By default, LyX will output
19636 \begin_inset Quotes eld
19640 \begin_inset Flex Code
19643 \begin_layout Plain Layout
19650 \begin_inset Quotes erd
19654 \begin_inset Flex Code
19657 \begin_layout Plain Layout
19663 is the LyX name of the layout, made lowercase, for example: chapter.
19668 contain any style information.
19670 \begin_inset Flex Code
19673 \begin_layout Plain Layout
19682 \begin_layout Description
19683 \begin_inset Flex Code
19686 \begin_layout Plain Layout
19693 \begin_inset Flex Code
19696 \begin_layout Plain Layout
19706 ] Whether to output the default CSS information LyX generates for this layout,
19707 even if additional information is explicitly provided via
19708 \begin_inset Flex Code
19711 \begin_layout Plain Layout
19719 \begin_inset Flex Code
19722 \begin_layout Plain Layout
19728 allows you to alter or augment the generated CSS, rather than to override
19731 \begin_inset Flex Code
19734 \begin_layout Plain Layout
19743 \begin_layout Description
19744 \begin_inset Flex Code
19747 \begin_layout Plain Layout
19754 \begin_inset Flex Code
19757 \begin_layout Plain Layout
19763 ] The tag to be used for individual paragraphs of environments, replacing
19765 \begin_inset Flex Code
19768 \begin_layout Plain Layout
19774 in the examples above.
19776 \begin_inset Flex Code
19779 \begin_layout Plain Layout
19788 \begin_layout Description
19789 \begin_inset Flex Code
19792 \begin_layout Plain Layout
19799 \begin_inset Flex Code
19802 \begin_layout Plain Layout
19808 ] Attributes for the item tag.
19810 \begin_inset Quotes eld
19814 \begin_inset Flex Code
19817 \begin_layout Plain Layout
19818 class=`layoutname_item'
19824 \begin_inset Quotes erd
19832 contain any style information.
19834 \begin_inset Flex Code
19837 \begin_layout Plain Layout
19846 \begin_layout Description
19847 \begin_inset Flex Code
19850 \begin_layout Plain Layout
19857 \begin_inset Flex Code
19860 \begin_layout Plain Layout
19866 ] The tag to be used for paragraph and item labels, replacing
19867 \begin_inset Flex Code
19870 \begin_layout Plain Layout
19876 in the examples above.
19878 \begin_inset Flex Code
19881 \begin_layout Plain Layout
19888 \begin_inset Flex Code
19891 \begin_layout Plain Layout
19898 \begin_inset Flex Code
19901 \begin_layout Plain Layout
19908 \begin_inset Flex Code
19911 \begin_layout Plain Layout
19912 Centered_Top_Environment
19917 , in which case it defaults to
19918 \begin_inset Flex Code
19921 \begin_layout Plain Layout
19930 \begin_layout Description
19931 \begin_inset Flex Code
19934 \begin_layout Plain Layout
19941 \begin_inset Flex Code
19944 \begin_layout Plain Layout
19950 ] Attributes for the label tag.
19952 \begin_inset Quotes eld
19956 \begin_inset Flex Code
19959 \begin_layout Plain Layout
19960 class=`layoutname_label'
19966 \begin_inset Quotes erd
19974 contain any style information.
19976 \begin_inset Flex Code
19979 \begin_layout Plain Layout
19988 \begin_layout Description
19989 \begin_inset Flex Code
19992 \begin_layout Plain Layout
19999 \begin_inset Flex Code
20002 \begin_layout Plain Layout
20012 ] Meaningful only for list-like environments, this tag controls whether
20013 the label tag is output before or inside the item tag.
20014 This is used, for example, in the description environment, where we want
20016 \begin_inset Flex Code
20019 \begin_layout Plain Layout
20020 <dt>\SpecialChar \ldots{}
20021 </dt><dd>\SpecialChar \ldots{}
20029 \begin_inset Flex Code
20032 \begin_layout Plain Layout
20038 : The label tag is output inside the item tag.
20041 \begin_layout Description
20042 \begin_inset Flex Code
20045 \begin_layout Plain Layout
20051 Information to be output in the
20052 \begin_inset Flex Code
20055 \begin_layout Plain Layout
20061 section when this style is used.
20062 This might, for example, be used to include a
20063 \begin_inset Flex Code
20066 \begin_layout Plain Layout
20073 \begin_inset Flex Code
20076 \begin_layout Plain Layout
20085 \begin_layout Description
20086 \begin_inset Flex Code
20089 \begin_layout Plain Layout
20095 CSS style information to be included when this style is used.
20096 Note that this will automatically be wrapped in a layout-generated
20097 \begin_inset Flex Code
20100 \begin_layout Plain Layout
20106 block, so only the CSS itself need be included.
20109 \begin_layout Description
20110 \begin_inset Flex Code
20113 \begin_layout Plain Layout
20120 \begin_inset Flex Code
20123 \begin_layout Plain Layout
20129 ] The tag to be used for the main label, replacing
20130 \begin_inset Flex Code
20133 \begin_layout Plain Layout
20139 in the examples above.
20141 \begin_inset Flex Code
20144 \begin_layout Plain Layout
20153 \begin_layout Description
20154 \begin_inset Flex Code
20157 \begin_layout Plain Layout
20164 \begin_inset Flex Code
20167 \begin_layout Plain Layout
20177 ] Marks this style as the one to be used to generate the
20178 \begin_inset Flex Code
20181 \begin_layout Plain Layout
20187 tag for the XHTML file.
20188 By default, it is false.
20190 \begin_inset Flex Code
20193 \begin_layout Plain Layout
20199 file sets it to true for the
20200 \begin_inset Flex Code
20203 \begin_layout Plain Layout
20213 \begin_layout Subsection
20217 \begin_layout Standard
20218 The XHTML output of insets can also be controlled by information in layout
20223 \begin_layout Plain Layout
20224 At present, this is true only for
20225 \begin_inset Quotes eld
20229 \begin_inset Quotes erd
20232 insets (insets you can type into) and is not true for
20233 \begin_inset Quotes eld
20237 \begin_inset Quotes erd
20240 insets (insets that are associated with dialog boxes).
20245 Here, too, LyX tries to provide sensible defaults, and it constructs default
20247 But everything can be customized.
20250 \begin_layout Standard
20251 The XHTML LyX outputs for an inset has the following form:
20254 \begin_layout LyX-Code
20256 \begin_inset Quotes erd
20260 \begin_inset Quotes erd
20266 \begin_layout LyX-Code
20267 <labeltag>Label</labeltag>
20270 \begin_layout LyX-Code
20272 \begin_inset Quotes erd
20276 \begin_inset Quotes erd
20279 >Contents of the inset.</innertag>
20282 \begin_layout LyX-Code
20286 \begin_layout Standard
20287 If the inset permits multiple paragraphs---that is, if
20288 \begin_inset Flex Code
20291 \begin_layout Plain Layout
20297 is true---then the contents of the inset will itself be output as paragraphs
20298 formatted according to the styles used for those paragraphs (standard,
20299 quote, and the like).
20300 The label tag is of course omitted if the paragraph does not have a label
20301 and, at present, is always
20302 \begin_inset Flex Code
20305 \begin_layout Plain Layout
20312 The inner tag is optional and, by default, does not appear.
20315 \begin_layout Standard
20316 The specific tags and attributes output for each inset can be controlled
20317 by means of the following layout tags.
20320 \begin_layout Description
20321 \begin_inset Flex Code
20324 \begin_layout Plain Layout
20331 \begin_inset Flex Code
20334 \begin_layout Plain Layout
20340 ] Specifies attribute information to be output with the main tag.
20342 \begin_inset Quotes eld
20346 \begin_inset Flex Code
20349 \begin_layout Plain Layout
20350 class=`myinset' onclick=`\SpecialChar \ldots{}
20357 \begin_inset Quotes erd
20361 By default, LyX will output
20362 \begin_inset Quotes eld
20366 \begin_inset Flex Code
20369 \begin_layout Plain Layout
20376 \begin_inset Quotes erd
20380 \begin_inset Flex Code
20383 \begin_layout Plain Layout
20389 is the LyX name of the inset, made lowercase and with non-alphanumeric
20390 characters converted to underscores, for example: footnote.
20393 \begin_layout Description
20394 \begin_inset Flex Code
20397 \begin_layout Plain Layout
20404 \begin_inset Flex Code
20407 \begin_layout Plain Layout
20417 ] Whether to output the default CSS information LyX generates for this layout,
20418 even if additional information is explicitly provided via
20419 \begin_inset Flex Code
20422 \begin_layout Plain Layout
20430 \begin_inset Flex Code
20433 \begin_layout Plain Layout
20439 allows you to alter or augment the generated CSS, rather than to override
20444 \begin_layout Description
20445 \begin_inset Flex Code
20448 \begin_layout Plain Layout
20455 \begin_inset Flex Code
20458 \begin_layout Plain Layout
20464 ] Attributes for the inner tag.
20466 \begin_inset Quotes eld
20470 \begin_inset Flex Code
20473 \begin_layout Plain Layout
20474 class=`insetname_inner'
20480 \begin_inset Quotes erd
20486 \begin_layout Description
20487 \begin_inset Flex Code
20490 \begin_layout Plain Layout
20497 \begin_inset Flex Code
20500 \begin_layout Plain Layout
20506 ] The inner tag, replacing
20507 \begin_inset Flex Code
20510 \begin_layout Plain Layout
20516 in the examples above.
20517 By default, there is none.
20520 \begin_layout Description
20521 \begin_inset Flex Code
20524 \begin_layout Plain Layout
20531 \begin_inset Flex Code
20534 \begin_layout Plain Layout
20542 ] Whether this inset represents a standalone block of text (such as a footnote)
20543 or instead represents material that is included in the surrounding text
20544 (such as a branch).
20548 \begin_layout Description
20549 \begin_inset Flex Code
20552 \begin_layout Plain Layout
20559 \begin_inset Flex Code
20562 \begin_layout Plain Layout
20568 ] A label for this inset, possibly including a reference to a counter.
20569 For example, for footnote, it might be:
20570 \begin_inset Flex Code
20573 \begin_layout Plain Layout
20582 This is optional, and there is no default.
20585 \begin_layout Description
20586 \begin_inset Flex Code
20589 \begin_layout Plain Layout
20595 Information to be output in the
20596 \begin_inset Flex Code
20599 \begin_layout Plain Layout
20605 section when this style is used.
20606 This might, for example, be used to include a
20607 \begin_inset Flex Code
20610 \begin_layout Plain Layout
20617 \begin_inset Flex Code
20620 \begin_layout Plain Layout
20629 \begin_layout Description
20630 \begin_inset Flex Code
20633 \begin_layout Plain Layout
20639 CSS style information to be included when this style is used.
20640 Note that this will automatically be wrapped in a layout-generated
20641 \begin_inset Flex Code
20644 \begin_layout Plain Layout
20650 block, so only the CSS itself need be included.
20653 \begin_layout Description
20654 \begin_inset Flex Code
20657 \begin_layout Plain Layout
20664 \begin_inset Flex Code
20667 \begin_layout Plain Layout
20673 ] The tag to be used for the main label, replacing
20674 \begin_inset Flex Code
20677 \begin_layout Plain Layout
20683 in the examples above.
20684 The default depends upon the setting of
20685 \begin_inset Flex Code
20688 \begin_layout Plain Layout
20695 \begin_inset Flex Code
20698 \begin_layout Plain Layout
20704 is true, the default is
20705 \begin_inset Flex Code
20708 \begin_layout Plain Layout
20714 ; if it is false, the default is
20715 \begin_inset Flex Code
20718 \begin_layout Plain Layout
20727 \begin_layout Subsection
20731 \begin_layout Standard
20732 The XHTML output for floats too can be controlled by layout information.
20733 The output has the following form:
20736 \begin_layout LyX-Code
20738 \begin_inset Quotes erd
20742 \begin_inset Quotes erd
20748 \begin_layout LyX-Code
20749 Contents of the float.
20752 \begin_layout LyX-Code
20756 \begin_layout Standard
20757 The caption, if there is one, is a separate inset and will be output as
20759 Its appearance can be controlled via the InsetLayout for caption insets.
20763 \begin_layout Description
20764 \begin_inset Flex Code
20767 \begin_layout Plain Layout
20774 \begin_inset Flex Code
20777 \begin_layout Plain Layout
20783 ] Specifies attribute information to be output with the main tag.
20785 \begin_inset Quotes eld
20789 \begin_inset Flex Code
20792 \begin_layout Plain Layout
20793 class=`myfloat' onclick=`\SpecialChar \ldots{}
20800 \begin_inset Quotes erd
20804 By default, LyX will output
20805 \begin_inset Quotes eld
20809 \begin_inset Flex Code
20812 \begin_layout Plain Layout
20813 class=`float float-floattype'
20819 \begin_inset Quotes erd
20823 \begin_inset Flex Code
20826 \begin_layout Plain Layout
20832 is LyX's name for this type of float, as determined by the float declaration
20834 \begin_inset CommandInset ref
20836 reference "sub:Floats"
20840 ), though made lowercase and with non-alphanumeric characters converted
20841 to underscores, for example: float-table.
20844 \begin_layout Description
20845 \begin_inset Flex Code
20848 \begin_layout Plain Layout
20854 CSS style information to be included when this float is used.
20855 Note that this will automatically be wrapped in a layout-generated
20856 \begin_inset Flex Code
20859 \begin_layout Plain Layout
20865 block, so only the CSS itself need be included.
20868 \begin_layout Description
20869 \begin_inset Flex Code
20872 \begin_layout Plain Layout
20879 \begin_inset Flex Code
20882 \begin_layout Plain Layout
20888 ] The tag to be used for this float, replacing
20889 \begin_inset Quotes eld
20893 \begin_inset Flex Code
20896 \begin_layout Plain Layout
20903 \begin_inset Quotes erd
20906 in the example above.
20908 \begin_inset Flex Code
20911 \begin_layout Plain Layout
20917 and will rarely need changing.
20920 \begin_layout Subsection
20921 Bibliography formatting
20924 \begin_layout Standard
20925 The bibliography can be formatted using
20926 \begin_inset Flex Code
20929 \begin_layout Plain Layout
20937 \begin_inset CommandInset ref
20939 reference "sub:Citation-format-description"
20946 \begin_layout Subsection
20950 \begin_layout Standard
20951 We have several times mentioned that LyX will generate default CSS style
20952 rules for both insets and paragraph styles, based upon the other layout
20953 information that is provided.
20954 In this section, we shall say a word about which layout information LyX
20958 \begin_layout Standard
20959 At present, LyX auto-generates CSS only for font information, making use
20961 \begin_inset Flex Code
20964 \begin_layout Plain Layout
20971 \begin_inset Flex Code
20974 \begin_layout Plain Layout
20981 \begin_inset Flex Code
20984 \begin_layout Plain Layout
20991 \begin_inset Flex Code
20994 \begin_layout Plain Layout
21001 \begin_inset Flex Code
21004 \begin_layout Plain Layout
21012 \begin_inset CommandInset ref
21014 reference "sub:Font-description"
21018 .) The translation is mostly straightforward and obvious.
21020 \begin_inset Quotes eld
21024 \begin_inset Flex Code
21027 \begin_layout Plain Layout
21034 \begin_inset Quotes erd
21038 \begin_inset Quotes eld
21042 \begin_inset Flex Code
21045 \begin_layout Plain Layout
21046 font-family: sans-serif;
21052 \begin_inset Quotes erd
21056 The correspondence of LyX sizes and CSS sizes is a little less obvious
21057 but nonetheless intuitive.
21059 \begin_inset Flex Code
21062 \begin_layout Plain Layout
21069 \begin_inset Flex URL
21072 \begin_layout Plain Layout
21082 \begin_layout Chapter
21083 Including External Material
21086 \begin_layout Standard
21087 \begin_inset Box Shadowbox
21097 height_special "totalheight"
21100 \begin_layout Plain Layout
21101 WARNING: This portion of the documentation has not been updated for some
21103 We certainly hope that it is still accurate, but there are no guarantees.
21111 \begin_layout Standard
21112 The use of material from sources external to LyX is covered in detail in
21118 This part of the manual covers what needs to happen behind the scenes for
21119 new sorts of material to be included.
21122 \begin_layout Section
21126 \begin_layout Standard
21127 The external material feature is based on the concept of a
21132 A template is a specification of how LyX should interface with a certain
21134 As bundled, LyX comes with predefined templates for Xfig figures, various
21135 raster format images, chess diagrams, and LilyPond music notation.
21136 You can check the actual list by using the menu
21137 \begin_inset Flex MenuItem
21140 \begin_layout Plain Layout
21141 Insert\SpecialChar \menuseparator
21142 File\SpecialChar \menuseparator
21149 Furthermore, it is possible to roll your own template to support a specific
21151 Later we'll describe in more detail what is involved, and hopefully you
21152 will submit all the templates you create so we can include them in a later
21156 \begin_layout Standard
21157 Another basic idea of the external material feature is to distinguish between
21158 the original file that serves as a base for final material and the produced
21159 file that is included in your exported or printed document.
21160 For example, consider the case of a figure produced with
21161 \begin_inset Flex Code
21164 \begin_layout Plain Layout
21171 The Xfig application itself works on an original file with the
21172 \begin_inset Flex Code
21175 \begin_layout Plain Layout
21182 Within Xfig, you create and change your figure, and when you are done,
21184 \begin_inset Flex Code
21187 \begin_layout Plain Layout
21194 When you want to include the figure in your document, you invoke
21195 \begin_inset Flex Code
21198 \begin_layout Plain Layout
21204 in order to create a PostScript file that can readily be included in your
21207 \begin_inset Flex Code
21210 \begin_layout Plain Layout
21216 file is the original file, and the PostScript file is the produced file.
21219 \begin_layout Standard
21220 This distinction is important in order to allow updating of the material
21221 while you are in the process of writing the document.
21222 Furthermore, it provides us with the flexibility that is needed to support
21223 multiple export formats.
21224 For instance, in the case of a plain text file, it is not exactly an award-winn
21225 ing idea to include the figure as raw PostScript.
21226 Instead, you would either prefer to just include a reference to the figure
21227 or try to invoke some graphics to ASCII converter to make the final result
21228 look similar to the real graphics.
21229 The external material management allows you to do this, because it is parametri
21230 zed on the different export formats that LyX supports.
21233 \begin_layout Standard
21234 Besides supporting the production of different products according to the
21235 exported format, it supports tight integration with editing and viewing
21237 In the case of an Xfig figure, you are able to invoke Xfig on the original
21238 file with a single click from within the external material dialog in LyX,
21239 and also preview the produced PostScript file with Ghostview with another
21241 No more fiddling around with the command line and/or file browsers to locate
21242 and manipulate the original or produced files.
21243 In this way, you are finally able to take full advantage of the many different
21244 applications that are relevant to use when you write your documents, and
21245 ultimately be more productive.
21248 \begin_layout Section
21249 The external template configuration file
21252 \begin_layout Standard
21253 It is relatively easy to add custom external template definitions to LyX.
21254 However, be aware that doing this in an careless manner most probably
21258 introduce an easily exploitable security hole.
21259 So before you do this, please read the discussion about security in section
21261 \begin_inset CommandInset ref
21263 reference "sec:Security-discussion"
21270 \begin_layout Standard
21271 Having said that, we encourage you to submit any interesting templates that
21276 \begin_layout Standard
21277 The external templates are defined in the
21278 \begin_inset Flex Code
21281 \begin_layout Plain Layout
21282 LyXDir/lib/external_templates
21288 You can place your own version in
21289 \begin_inset Flex Code
21292 \begin_layout Plain Layout
21293 UserDir/external_templates
21301 \begin_layout Standard
21302 A typical template looks like this:
21305 \begin_layout LyX-Code
21309 \begin_layout LyX-Code
21310 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
21313 \begin_layout LyX-Code
21317 \begin_layout LyX-Code
21321 \begin_layout LyX-Code
21325 \begin_layout LyX-Code
21329 \begin_layout LyX-Code
21333 \begin_layout LyX-Code
21334 AutomaticProduction true
21337 \begin_layout LyX-Code
21341 \begin_layout LyX-Code
21345 \begin_layout LyX-Code
21349 \begin_layout LyX-Code
21350 TransformCommand Rotate RotationLatexCommand
21353 \begin_layout LyX-Code
21354 TransformCommand Resize ResizeLatexCommand
21357 \begin_layout LyX-Code
21358 Product "$$RotateFront$$ResizeFront
21361 \begin_layout LyX-Code
21366 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
21369 \begin_layout LyX-Code
21370 $$ResizeBack$$RotateBack"
21373 \begin_layout LyX-Code
21377 \begin_layout LyX-Code
21378 UpdateResult "$$AbsPath$$Basename.pstex_t"
21381 \begin_layout LyX-Code
21382 Requirement "graphicx"
21385 \begin_layout LyX-Code
21386 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
21389 \begin_layout LyX-Code
21390 ReferencedFile latex "$$AbsPath$$Basename.eps"
21393 \begin_layout LyX-Code
21394 ReferencedFile dvi "$$AbsPath$$Basename.eps"
21397 \begin_layout LyX-Code
21401 \begin_layout LyX-Code
21405 \begin_layout LyX-Code
21406 TransformCommand Rotate RotationLatexCommand
21409 \begin_layout LyX-Code
21410 TransformCommand Resize ResizeLatexCommand
21413 \begin_layout LyX-Code
21414 Product "$$RotateFront$$ResizeFront
21417 \begin_layout LyX-Code
21422 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
21425 \begin_layout LyX-Code
21426 $$ResizeBack$$RotateBack"
21429 \begin_layout LyX-Code
21430 UpdateFormat pdftex
21433 \begin_layout LyX-Code
21434 UpdateResult "$$AbsPath$$Basename.pdftex_t"
21437 \begin_layout LyX-Code
21438 Requirement "graphicx"
21441 \begin_layout LyX-Code
21442 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
21445 \begin_layout LyX-Code
21446 ReferencedFile latex "$$AbsPath$$Basename.pdf"
21449 \begin_layout LyX-Code
21453 \begin_layout LyX-Code
21457 \begin_layout LyX-Code
21458 Product "$$Contents(
21460 "$$AbsPath$$Basename.asc
21465 \begin_layout LyX-Code
21466 UpdateFormat asciixfig
21469 \begin_layout LyX-Code
21470 UpdateResult "$$AbsPath$$Basename.asc"
21473 \begin_layout LyX-Code
21477 \begin_layout LyX-Code
21481 \begin_layout LyX-Code
21482 Product "<graphic fileref=
21484 "$$AbsOrRelPathMaster$$Basename.eps
21489 \begin_layout LyX-Code
21493 \begin_layout LyX-Code
21497 \begin_layout LyX-Code
21498 UpdateResult "$$AbsPath$$Basename.eps"
21501 \begin_layout LyX-Code
21502 ReferencedFile docbook "$$AbsPath$$Basename.eps"
21505 \begin_layout LyX-Code
21506 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
21509 \begin_layout LyX-Code
21513 \begin_layout LyX-Code
21514 Product "[XFig: $$FName]"
21517 \begin_layout LyX-Code
21521 \begin_layout LyX-Code
21525 \begin_layout Standard
21526 As you can see, the template is enclosed in
21527 \begin_inset Flex Code
21530 \begin_layout Plain Layout
21536 \SpecialChar \ldots{}
21538 \begin_inset Flex Code
21541 \begin_layout Plain Layout
21548 It contains a header specifying some general settings and, for each supported
21549 primary document file format, a section
21550 \begin_inset Flex Code
21553 \begin_layout Plain Layout
21559 \SpecialChar \ldots{}
21561 \begin_inset Flex Code
21564 \begin_layout Plain Layout
21573 \begin_layout Subsection
21574 The template header
21577 \begin_layout Description
21578 \begin_inset Flex Code
21581 \begin_layout Plain Layout
21582 AutomaticProduction
21583 \begin_inset space ~
21591 Whether the file represented by the template must be generated by LyX.
21592 This command must occur exactly once.
21595 \begin_layout Description
21596 \begin_inset Flex Code
21599 \begin_layout Plain Layout
21601 \begin_inset space ~
21609 A glob pattern that is used in the file dialog to filter out the desired
21611 If there is more than one possible file extension (e.
21612 \begin_inset space \thinspace{}
21616 \begin_inset space \space{}
21620 \begin_inset Flex Code
21623 \begin_layout Plain Layout
21630 \begin_inset Flex Code
21633 \begin_layout Plain Layout
21639 ), use something like
21640 \begin_inset Flex Code
21643 \begin_layout Plain Layout
21650 This command must occur exactly once.
21653 \begin_layout Description
21654 \begin_inset Flex Code
21657 \begin_layout Plain Layout
21659 \begin_inset space ~
21667 The text that is displayed on the button.
21668 This command must occur exactly once.
21671 \begin_layout Description
21672 \begin_inset Flex Code
21675 \begin_layout Plain Layout
21677 \begin_inset space ~
21681 \begin_inset space ~
21689 The help text that is used in the External dialog.
21690 Provide enough information to explain to the user just what the template
21691 can provide him with.
21692 This command must occur exactly once.
21695 \begin_layout Description
21696 \begin_inset Flex Code
21699 \begin_layout Plain Layout
21701 \begin_inset space ~
21709 The file format of the original file.
21710 This must be the name of a format that is known to LyX (see section
21711 \begin_inset space ~
21715 \begin_inset CommandInset ref
21717 reference "sec:Formats"
21723 \begin_inset Quotes eld
21727 \begin_inset Flex Code
21730 \begin_layout Plain Layout
21737 \begin_inset Quotes erd
21740 if the template can handle original files of more than one format.
21741 LyX will attempt to interrogate the file itself in order to deduce its
21742 format in this case.
21743 This command must occur exactly once.
21746 \begin_layout Description
21747 \begin_inset Flex Code
21750 \begin_layout Plain Layout
21752 \begin_inset space ~
21760 A unique name for the template.
21761 It must not contain substitution macros (see below).
21764 \begin_layout Description
21765 \begin_inset Flex Code
21768 \begin_layout Plain Layout
21770 \begin_inset space ~
21773 Rotate|Resize|Clip|Extra
21778 This command specifies which transformations are supported by this template.
21779 It may occur zero or more times.
21780 This command enables the corresponding tabs in the external dialog.
21782 \begin_inset Flex Code
21785 \begin_layout Plain Layout
21791 command must have either a corresponding
21792 \begin_inset Flex Code
21795 \begin_layout Plain Layout
21802 \begin_inset Flex Code
21805 \begin_layout Plain Layout
21812 \begin_inset Flex Code
21815 \begin_layout Plain Layout
21822 Otherwise the transformation will not be supported by that format.
21825 \begin_layout Subsection
21829 \begin_layout Description
21830 \begin_inset Flex Code
21833 \begin_layout Plain Layout
21835 \begin_inset space ~
21838 LaTeX|PDFLaTeX|PlainText|DocBook
21843 The primary document file format that this format definition is for.
21844 Not every template has a sensible representation in all document file formats.
21845 Please define nevertheless a
21846 \begin_inset Flex Code
21849 \begin_layout Plain Layout
21855 section for all templates.
21856 Use a dummy text when no representation is available.
21857 Then you can at least see a reference to the external material in the exported
21861 \begin_layout Description
21862 \begin_inset Flex Code
21865 \begin_layout Plain Layout
21867 \begin_inset space ~
21871 \begin_inset space ~
21879 This command defines an additional macro
21880 \begin_inset Flex Code
21883 \begin_layout Plain Layout
21889 for substitution in
21890 \begin_inset Flex Code
21893 \begin_layout Plain Layout
21901 \begin_inset Flex Code
21904 \begin_layout Plain Layout
21910 itself may contain substitution macros.
21911 The advantage over using
21912 \begin_inset Flex Code
21915 \begin_layout Plain Layout
21922 \begin_inset Flex Code
21925 \begin_layout Plain Layout
21931 is that the substituted value of
21932 \begin_inset Flex Code
21935 \begin_layout Plain Layout
21941 is sanitized so that it is a valid optional argument in the document format.
21942 This command may occur zero or more times.
21945 \begin_layout Description
21946 \begin_inset Flex Code
21949 \begin_layout Plain Layout
21951 \begin_inset space ~
21959 The text that is inserted in the exported document.
21960 This is actually the most important command and can be quite complex.
21961 This command must occur exactly once.
21964 \begin_layout Description
21965 \begin_inset Flex Code
21968 \begin_layout Plain Layout
21970 \begin_inset space ~
21978 This command specifies a preamble snippet that will be included in the
21980 It has to be defined using
21981 \begin_inset Flex Code
21984 \begin_layout Plain Layout
21990 \SpecialChar \ldots{}
21992 \begin_inset Flex Code
21995 \begin_layout Plain Layout
22002 This command may occur zero or more times.
22005 \begin_layout Description
22006 \begin_inset Flex Code
22009 \begin_layout Plain Layout
22011 \begin_inset space ~
22015 \begin_inset space ~
22023 This command denotes files that are created by the conversion process and
22024 are needed for a particular export format.
22025 If the filename is relative, it is interpreted relative to the master document.
22026 This command may be given zero or more times.
22029 \begin_layout Description
22030 \begin_inset Flex Code
22033 \begin_layout Plain Layout
22035 \begin_inset space ~
22043 The name of a required LaTeX package.
22044 The package is included via
22045 \begin_inset Flex Code
22048 \begin_layout Plain Layout
22056 in the LaTeX preamble.
22057 This command may occur zero or more times.
22060 \begin_layout Description
22061 \begin_inset Flex Code
22064 \begin_layout Plain Layout
22066 \begin_inset space ~
22070 \begin_inset space ~
22073 RotationLatexCommand
22078 This command specifies that the built in LaTeX command should be used for
22080 This command may occur once or not at all.
22083 \begin_layout Description
22084 \begin_inset Flex Code
22087 \begin_layout Plain Layout
22089 \begin_inset space ~
22093 \begin_inset space ~
22101 This command specifies that the built in LaTeX command should be used for
22103 This command may occur once or not at all.
22106 \begin_layout Description
22107 \begin_inset Flex Code
22110 \begin_layout Plain Layout
22112 \begin_inset space ~
22116 \begin_inset space ~
22119 RotationLatexOption
22124 This command specifies that rotation is done via an optional argument.
22125 This command may occur once or not at all.
22128 \begin_layout Description
22129 \begin_inset Flex Code
22132 \begin_layout Plain Layout
22134 \begin_inset space ~
22138 \begin_inset space ~
22146 This command specifies that resizing is done via an optional argument.
22147 This command may occur once or not at all.
22150 \begin_layout Description
22151 \begin_inset Flex Code
22154 \begin_layout Plain Layout
22156 \begin_inset space ~
22160 \begin_inset space ~
22168 This command specifies that clipping is done via an optional argument.
22169 This command may occur once or not at all.
22172 \begin_layout Description
22173 \begin_inset Flex Code
22176 \begin_layout Plain Layout
22178 \begin_inset space ~
22182 \begin_inset space ~
22190 This command specifies that an extra optional argument is used.
22191 This command may occur once or not at all.
22194 \begin_layout Description
22195 \begin_inset Flex Code
22198 \begin_layout Plain Layout
22200 \begin_inset space ~
22208 The file format of the converted file.
22209 This must be the name of a format that is known to LyX (see the
22210 \begin_inset Flex MenuItem
22213 \begin_layout Plain Layout
22218 ools\SpecialChar \menuseparator
22223 references\SpecialChar \menuseparator
22224 File Handling\SpecialChar \menuseparator
22231 This command must occur exactly once.
22234 \begin_layout Description
22235 \begin_inset Flex Code
22238 \begin_layout Plain Layout
22240 \begin_inset space ~
22248 The file name of the converted file.
22249 The file name must be absolute.
22250 This command must occur exactly once.
22253 \begin_layout Subsection
22254 Preamble definitions
22257 \begin_layout Standard
22258 The external template configuration file may contain additional preamble
22259 definitions enclosed by
22260 \begin_inset Flex Code
22263 \begin_layout Plain Layout
22269 \SpecialChar \ldots{}
22271 \begin_inset Flex Code
22274 \begin_layout Plain Layout
22281 They can be used by the templates in the
22282 \begin_inset Flex Code
22285 \begin_layout Plain Layout
22294 \begin_layout Section
22295 The substitution mechanism
22298 \begin_layout Standard
22299 When the external material facility invokes an external program, it is done
22300 on the basis of a command defined in the template configuration file.
22301 These commands can contain various macros that are expanded before execution.
22302 Execution always take place in the directory of the containing document.
22305 \begin_layout Standard
22306 Also, whenever external material is to be displayed, the name will be produced
22307 by the substitution mechanism, and most other commands in the template
22308 definition support substitution as well.
22311 \begin_layout Standard
22312 The available macros are the following:
22315 \begin_layout Description
22316 \begin_inset Flex Code
22319 \begin_layout Plain Layout
22320 $$AbsOrRelPathMaster
22325 The file path, absolute or relative to the master LyX document.
22328 \begin_layout Description
22329 \begin_inset Flex Code
22332 \begin_layout Plain Layout
22333 $$AbsOrRelPathParent
22338 The file path, absolute or relative to the LyX document.
22341 \begin_layout Description
22342 \begin_inset Flex Code
22345 \begin_layout Plain Layout
22351 The absolute file path.
22354 \begin_layout Description
22355 \begin_inset Flex Code
22358 \begin_layout Plain Layout
22364 The filename without path and without the extension.
22367 \begin_layout Description
22368 \begin_inset Flex Code
22371 \begin_layout Plain Layout
22373 \begin_inset Quotes eld
22377 \begin_inset Quotes erd
22385 This macro will expand to the contents of the file with the name
22386 \begin_inset Flex Code
22389 \begin_layout Plain Layout
22398 \begin_layout Description
22399 \begin_inset Flex Code
22402 \begin_layout Plain Layout
22408 The file extension (including the dot).
22411 \begin_layout Description
22412 \begin_inset Flex Code
22415 \begin_layout Plain Layout
22421 The filename of the file specified in the external material dialog.
22422 This is either an absolute name, or it is relative to the LyX document.
22425 \begin_layout Description
22426 \begin_inset Flex Code
22429 \begin_layout Plain Layout
22436 \begin_inset Flex Code
22439 \begin_layout Plain Layout
22445 (absolute name or relative to the LyX document).
22448 \begin_layout Description
22449 \begin_inset Flex Code
22452 \begin_layout Plain Layout
22458 The file path, relative to the master LyX document.
22461 \begin_layout Description
22462 \begin_inset Flex Code
22465 \begin_layout Plain Layout
22471 The file path, relative to the LyX document.
22474 \begin_layout Description
22475 \begin_inset Flex Code
22478 \begin_layout Plain Layout
22484 This macro will expand to the absolute path of the system directory.
22485 This is typically used to point to the various helper scripts that are
22489 \begin_layout Description
22490 \begin_inset Flex Code
22493 \begin_layout Plain Layout
22499 A name and full path to a temporary file which will be automatically deleted
22500 whenever the containing document is closed, or the external material insertion
22504 \begin_layout Standard
22505 All path macros contain a trailing directory separator, so you can construct
22507 \begin_inset space \thinspace{}
22511 \begin_inset space \space{}
22514 the absolute filename with
22515 \begin_inset Flex Code
22518 \begin_layout Plain Layout
22519 $$AbsPath$$Basename$$Extension
22527 \begin_layout Standard
22528 The macros above are substituted in all commands unless otherwise noted.
22530 \begin_inset Flex Code
22533 \begin_layout Plain Layout
22539 supports additionally the following substitutions if they are enabled by
22541 \begin_inset Flex Code
22544 \begin_layout Plain Layout
22551 \begin_inset Flex Code
22554 \begin_layout Plain Layout
22563 \begin_layout Description
22564 \begin_inset Flex Code
22567 \begin_layout Plain Layout
22573 The front part of the resize command.
22576 \begin_layout Description
22577 \begin_inset Flex Code
22580 \begin_layout Plain Layout
22586 The back part of the resize command.
22589 \begin_layout Description
22590 \begin_inset Flex Code
22593 \begin_layout Plain Layout
22599 The front part of the rotation command.
22602 \begin_layout Description
22603 \begin_inset Flex Code
22606 \begin_layout Plain Layout
22612 The back part of the rotation command.
22615 \begin_layout Standard
22616 The value string of the
22617 \begin_inset Flex Code
22620 \begin_layout Plain Layout
22626 command supports additionally the following substitutions if they are enabled
22628 \begin_inset Flex Code
22631 \begin_layout Plain Layout
22638 \begin_inset Flex Code
22641 \begin_layout Plain Layout
22650 \begin_layout Description
22651 \begin_inset Flex Code
22654 \begin_layout Plain Layout
22663 \begin_layout Description
22664 \begin_inset Flex Code
22667 \begin_layout Plain Layout
22676 \begin_layout Description
22677 \begin_inset Flex Code
22680 \begin_layout Plain Layout
22689 \begin_layout Description
22690 \begin_inset Flex Code
22693 \begin_layout Plain Layout
22699 The rotation option.
22702 \begin_layout Standard
22703 You may ask why there are so many path macros.
22704 There are mainly two reasons:
22707 \begin_layout Enumerate
22708 Relative and absolute file names should remain relative or absolute, respectivel
22710 Users may have reasons to prefer either form.
22711 Relative names are useful for portable documents that should work on different
22712 machines, for example.
22713 Absolute names may be required by some programs.
22716 \begin_layout Enumerate
22717 LaTeX treats relative file names differently than LyX and other programs
22718 in nested included files.
22719 For LyX, a relative file name is always relative to the document that contains
22721 For LaTeX, it is always relative to the master document.
22722 These two definitions are identical if you have only one document, but
22723 differ if you have a master document that includes part documents.
22724 That means that relative filenames must be transformed when presented to
22726 Fortunately LyX does this automatically for you if you choose the right
22730 \begin_layout Standard
22731 So which path macro should be used in new template definitions? The rule
22735 \begin_layout Itemize
22737 \begin_inset Flex Code
22740 \begin_layout Plain Layout
22746 if an absolute path is required.
22749 \begin_layout Itemize
22751 \begin_inset Flex Code
22754 \begin_layout Plain Layout
22755 $$AbsOrRelPathMaster
22760 if the substituted string is some kind of LaTeX input.
22763 \begin_layout Itemize
22765 \begin_inset Flex Code
22768 \begin_layout Plain Layout
22769 $$AbsOrRelPathParent
22774 in order to preserve the user's choice.
22777 \begin_layout Standard
22778 There are special cases where this rule does not work and e.
22779 \begin_inset space \thinspace{}
22783 \begin_inset space \space{}
22786 relative names are needed, but normally it will work just fine.
22787 One example for such a case is the command
22788 \begin_inset Flex Code
22791 \begin_layout Plain Layout
22792 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
22797 in the XFig template above: We can't use the absolute name because the
22799 \begin_inset Flex Code
22802 \begin_layout Plain Layout
22808 files needs the relative name in order to rewrite the file content.
22811 \begin_layout Section
22812 Security discussion
22813 \begin_inset CommandInset label
22815 name "sec:Security-discussion"
22822 \begin_layout Standard
22823 The external material feature interfaces with a lot of external programs
22824 and does so automatically, so we have to consider the security implications
22826 In particular, since you have the option of including your own filenames
22827 and/or parameter strings and those are expanded into a command, it seems
22828 that it would be possible to create a malicious document which executes
22829 arbitrary commands when a user views or prints the document.
22830 This is something we definitely want to avoid.
22833 \begin_layout Standard
22834 However, since the external program commands are specified in the template
22835 configuration file only, there are no security issues if LyX is properly
22836 configured with safe templates only.
22837 This is so because the external programs are invoked with the
22838 \begin_inset Flex Code
22841 \begin_layout Plain Layout
22847 -system call rather than the
22848 \begin_inset Flex Code
22851 \begin_layout Plain Layout
22857 system-call, so it's not possible to execute arbitrary commands from the
22858 filename or parameter section via the shell.
22861 \begin_layout Standard
22862 This also implies that you are restricted in what command strings you can
22863 use in the external material templates.
22864 In particular, pipes and redirection are not readily available.
22865 This has to be so if LyX should remain safe.
22866 If you want to use some of the shell features, you should write a safe
22867 script to do this in a controlled manner, and then invoke the script from
22868 the command string.
22872 \begin_layout Standard
22873 It is possible to design a template that interacts directly with the shell,
22874 but since this would allow a malicious user to execute arbitrary commands
22875 by writing clever filenames and/or parameters, we generally recommend that
22876 you only use safe scripts that work with the
22877 \begin_inset Flex Code
22880 \begin_layout Plain Layout
22886 system call in a controlled manner.
22887 Of course, for use in a controlled environment, it can be tempting to just
22888 fall back to use ordinary shell scripts.
22889 If you do so, be aware that you
22893 provide an easily exploitable security hole in your system.
22894 Of course it stands to reason that such unsafe templates will never be
22895 included in the standard LyX distribution, although we do encourage people
22896 to submit new templates in the open source tradition.
22897 But LyX as shipped from the official distribution channels will never have
22901 \begin_layout Standard
22902 Including external material provides a lot of power, and you have to be
22903 careful not to introduce security hazards with this power.
22904 A subtle error in a single line in an innocent looking script can open
22905 the door to huge security problems.
22906 So if you do not fully understand the issues, we recommend that you consult
22907 a knowledgeable security professional or the LyX development team if you
22908 have any questions about whether a given template is safe or not.
22909 And do this before you use it in an uncontrolled environment.