1 #LyX 2.1 created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that this document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of this document may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 \options fleqn,bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading
35 \use_default_options false
39 \maintain_unincluded_children false
42 InsetLayout Flex:MenuItem
51 \newcommand*{\menuitem}[1]{{\sffamily #1}}
54 # In case we need to do with sans...
55 #InsetLayout CharStyle:Code
60 #\renewcommand{\code}[1]{{\sffamily #1}}
65 \language_package default
70 \font_typewriter default
72 \font_default_family default
73 \use_non_tex_fonts false
79 \default_output_format default
81 \bibtex_command default
82 \index_command default
86 \pdf_title "LyX Configuration Manual"
87 \pdf_author "LyX Team"
88 \pdf_subject "LyX-documentation Customization"
89 \pdf_keywords "LyX, documentation, customization"
91 \pdf_bookmarksnumbered true
92 \pdf_bookmarksopen true
93 \pdf_bookmarksopenlevel 1
98 \pdf_pdfusetitle false
99 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
102 \use_package amsmath 0
103 \use_package amssymb 0
105 \use_package mathdots 1
106 \use_package mathtools 0
107 \use_package mhchem 0
108 \use_package undertilde 0
110 \cite_engine_type numerical
114 \paperorientation portrait
129 \paragraph_separation indent
130 \paragraph_indentation default
131 \quotes_language english
134 \paperpagestyle headings
135 \tracking_changes true
136 \output_changes false
140 \author -712698321 "Jürgen Spitzmüller"
141 \author -195340706 "Georg Baum"
143 \author 155139281 "Jrgen Spitzmller"
144 \author 1082167584 "Kayvan Sylvan" kayvan@sylvan.com
145 \author 1414654397 "Richard Heck"
146 \author 2090807402 "usti"
152 Customizing LyX: Features for the Advanced User
160 \begin_layout Plain Layout
162 If you have comments or error corrections, please send them to the LyX Documenta
164 \begin_inset CommandInset href
166 target "lyx-docs@lists.lyx.org"
173 \begin_inset Quotes eld
177 \begin_inset Quotes erd
180 in the subject header, and please cc the current maintainer of this file,
181 Richard Heck <rgheck@comcast.net>.
187 \begin_inset Newline newline
191 \begin_inset Newline newline
197 \begin_layout Standard
198 \begin_inset CommandInset toc
199 LatexCommand tableofcontents
206 \begin_layout Standard
207 \begin_inset Note Note
210 \begin_layout Plain Layout
211 Please use change tracking when modifying this document.
212 This makes it easier for our translators to recognize things that have
213 been changed, and it helps the maintainer keep up-to-date with what's been
222 \begin_layout Chapter
226 \begin_layout Standard
227 This manual covers the customization features present in LyX.
228 In it, we discuss issues like keyboard shortcuts, screen previewing options,
229 printer options, sending commands to LyX via the LyX Server, internationalizati
230 on, installing new LaTeX classes and LyX layouts, etc.
231 We can't possibly hope to touch on everything you can change—our developers
232 add new features faster than we can document them—but we will explain the
233 most common customizations and hopefully point you in the right direction
234 for some of the more obscure ones.
237 \begin_layout Standard
238 \begin_inset Branch OutDated
241 \begin_layout Standard
242 Information from previous versions of this document that now seems to be
243 outdated is contained in the OutDated branch of this document.
244 By default, this information will not appear in the LaTeX output.
252 \begin_layout Chapter
253 LyX configuration files
256 \begin_layout Standard
257 This chapter aims to help you to find your way through the LyX configuration
259 Before continuing to read this chapter, you should find out where your
260 LyX library and user directories are by using
261 \begin_inset Flex MenuItem
264 \begin_layout Plain Layout
265 Help\SpecialChar \menuseparator
276 The library directory is the place where LyX places its system-wide configurati
277 on files; the user directory is where you can place your modified versions.
278 We will call the former
279 \begin_inset Flex Code
282 \begin_layout Plain Layout
289 \begin_inset Flex MenuItem
292 \begin_layout Plain Layout
298 in the remainder of this document.
302 \begin_layout Section
304 \begin_inset Flex Code
307 \begin_layout Plain Layout
316 \begin_layout Standard
317 \begin_inset Flex Code
320 \begin_layout Plain Layout
326 and its sub-directories contain a number of files and that can be used
327 to customize LyX's behavior.
328 You can change many of these files from within LyX itself through the
329 \begin_inset Flex MenuItem
332 \begin_layout Plain Layout
333 Tools\SpecialChar \menuseparator
340 Most customization that you will want to do in LyX is possible through
342 However, many other inner aspects of LyX can be customized by modifying
344 \begin_inset Flex Code
347 \begin_layout Plain Layout
354 These files fall in different categories, described in the following subsection
358 \begin_layout Subsection
359 Automatically generated files
362 \begin_layout Standard
363 The files, which are to be found in
364 \begin_inset Flex MenuItem
367 \begin_layout Plain Layout
373 , are generated when you configure LyX.
374 They contain various default values that are guessed by inspection.
375 In general, it is not a good idea to modify them, since they might be overwritt
379 \begin_layout Labeling
380 \labelwidthstring 00.00.0000
381 \begin_inset Flex Code
384 \begin_layout Plain Layout
390 contains defaults for various commands.
393 \begin_layout Labeling
394 \labelwidthstring 00.00.0000
395 \begin_inset Flex Code
398 \begin_layout Plain Layout
404 contains the list of packages that have been recognized by LyX.
405 It is currently unused by the LyX program itself, but the information extracted
406 , and more, is made available with
407 \begin_inset Flex MenuItem
410 \begin_layout Plain Layout
411 Help\SpecialChar \menuseparator
424 \begin_layout Labeling
425 \labelwidthstring 00.00.0000
426 \begin_inset Flex Code
429 \begin_layout Plain Layout
435 the list of text classes that have been found in your
436 \begin_inset Flex Code
439 \begin_layout Plain Layout
445 directories, along with the associated LaTeX document class and their descripti
449 \begin_layout Labeling
450 \labelwidthstring 00.00.0000
451 \begin_inset Flex Code
454 \begin_layout Plain Layout
460 the list of layout modules found in your
461 \begin_inset Flex Code
464 \begin_layout Plain Layout
473 \begin_layout Labeling
474 \labelwidthstring 00.00.0000
475 \begin_inset Flex Code
478 \begin_layout Plain Layout
484 lists of various sorts of LaTeX-related files found on your system
487 \begin_layout Labeling
488 \labelwidthstring 00.00.0000
489 \begin_inset Flex Code
492 \begin_layout Plain Layout
498 is automatically generated during configuration from the file
499 \begin_inset Flex Code
502 \begin_layout Plain Layout
509 It contains information on your LaTeX configuration.
512 \begin_layout Subsection
516 \begin_layout Standard
517 These directories are duplicated between
518 \begin_inset Flex Code
521 \begin_layout Plain Layout
528 \begin_inset Flex Code
531 \begin_layout Plain Layout
538 If a particular files exists in both places, the one in
539 \begin_inset Flex Code
542 \begin_layout Plain Layout
551 \begin_layout Labeling
552 \labelwidthstring 00.00.0000
553 \begin_inset Flex Code
556 \begin_layout Plain Layout
562 this directory contains files with the extension
563 \begin_inset Flex Code
566 \begin_layout Plain Layout
572 that define the keybindings used in LyX.
573 If there exists an internationalized version of the bind file named
574 \begin_inset Flex Code
577 \begin_layout Plain Layout
583 , that will be used first.
586 \begin_layout Labeling
587 \labelwidthstring 00.00.0000
588 \begin_inset Flex Code
591 \begin_layout Plain Layout
597 contains graphics files that can be included in documents.
601 \begin_layout Labeling
602 \labelwidthstring 00.00.0000
603 \begin_inset Flex Code
606 \begin_layout Plain Layout
612 contains LyX documentation files (including the one you are currently reading).
614 \begin_inset Flex Code
617 \begin_layout Plain Layout
623 deserves special attention, as noted above.
624 The internationalized help docs are in subdirectories
625 \begin_inset Flex Code
628 \begin_layout Plain Layout
635 \begin_inset Quotes eld
639 \begin_inset Quotes erd
642 is the ISO language code.
648 \begin_inset CommandInset ref
650 reference "cha:Internationalizing-LyX"
657 \begin_layout Labeling
658 \labelwidthstring 00.00.0000
659 \begin_inset Flex Code
662 \begin_layout Plain Layout
668 contains example files that explain how to use some features.
669 In the file browser, press the
670 \begin_inset Flex MenuItem
673 \begin_layout Plain Layout
682 \begin_layout Labeling
683 \labelwidthstring 00.00.0000
684 \begin_inset Flex Code
687 \begin_layout Plain Layout
693 contains image files that are used by the
694 \begin_inset Flex MenuItem
697 \begin_layout Plain Layout
704 In addition, it also contains the individual icons used in the toolbar
705 and the banners that can be shown when LyX is launched.
708 \begin_layout Labeling
709 \labelwidthstring 00.00.0000
710 \begin_inset Flex Code
713 \begin_layout Plain Layout
719 contains keyboard keymapping files.
725 \begin_inset CommandInset ref
727 reference "sec:International-Keymap-Stuff"
734 \begin_layout Labeling
735 \labelwidthstring 00.00.0000
736 \begin_inset Flex Code
739 \begin_layout Plain Layout
745 contains the text class and module files described in Chapter
750 \begin_inset CommandInset ref
752 reference "cha:Installing-New-Document"
759 \begin_layout Labeling
760 \labelwidthstring 00.00.0000
761 \begin_inset Flex Code
764 \begin_layout Plain Layout
771 \begin_inset Flex Code
774 \begin_layout Plain Layout
780 Python scripts used to convert between LyX versions.
781 These can be run from the command line if, say, you want to batch-convert
785 \begin_layout Labeling
786 \labelwidthstring 00.00.0000
787 \begin_inset Flex Code
790 \begin_layout Plain Layout
796 contains some files that demonstrate the capabilities of the
797 \begin_inset Flex MenuItem
800 \begin_layout Plain Layout
811 Also contains some scripts used by LyX itself.
814 \begin_layout Labeling
815 \labelwidthstring 00.00.0000
816 \begin_inset Flex Code
819 \begin_layout Plain Layout
825 contains the standard LyX template files described in Chapter
830 \begin_inset CommandInset ref
832 reference "sub:Creating-Templates"
839 \begin_layout Labeling
840 \labelwidthstring 00.00.0000
841 \begin_inset Flex Code
844 \begin_layout Plain Layout
850 contains files with the extension
851 \begin_inset Flex Code
854 \begin_layout Plain Layout
860 that define the user interface to LyX.
861 That is, the files define which items appear in which menus and the items
862 appearing on the toolbar.
865 \begin_layout Subsection
866 Files you don't want to modify
869 \begin_layout Standard
870 These files are used internally by LyX and you generally do not need to
871 modify them unless you are a developer.
874 \begin_layout Labeling
875 \labelwidthstring 00.00.0000
876 \begin_inset Flex Code
879 \begin_layout Plain Layout
885 this file contains the list of LyX developers.
886 The contents are displayed with the menu entry
887 \begin_inset Flex MenuItem
890 \begin_layout Plain Layout
891 Help\SpecialChar \menuseparator
904 \begin_layout Labeling
905 \labelwidthstring 00.00.0000
906 \begin_inset Flex Code
909 \begin_layout Plain Layout
915 this is a LaTeX script used during the configuration process.
919 \begin_layout Labeling
920 \labelwidthstring 00.00.0000
921 \begin_inset Flex Code
924 \begin_layout Plain Layout
930 this is the script that is used to re-configure LyX.
931 It creates configuration files in the directory it was run from.
934 \begin_layout Subsection
935 Other files needing a line or two...
938 \begin_layout Labeling
939 \labelwidthstring 00.00.0000
940 \begin_inset Flex Code
943 \begin_layout Plain Layout
949 this contains tables describing how different character encodings can be
953 \begin_layout Labeling
954 \labelwidthstring 00.00.0000
955 \begin_inset Flex Code
958 \begin_layout Plain Layout
964 this file contains the templates available to the new
965 \begin_inset Flex MenuItem
968 \begin_layout Plain Layout
981 \begin_layout Labeling
982 \labelwidthstring 00.00.0000
983 \begin_inset Flex Code
986 \begin_layout Plain Layout
992 this file contains a list of all the languages currently supported by LyX.
993 \change_inserted -195340706 1334775793
997 \begin_layout Labeling
998 \labelwidthstring 00.00.0000
1000 \change_inserted -195340706 1334775793
1001 \begin_inset Flex Code
1004 \begin_layout Plain Layout
1006 \change_inserted -195340706 1334775793
1012 this file contains translations for internationalized paragraph styles
1014 \begin_inset space \thinspace{}
1018 \begin_inset CommandInset ref
1020 reference "sub:I18n"
1029 \begin_layout Section
1030 Your local configuration directory
1033 \begin_layout Standard
1034 Even if you are using LyX as an unprivileged user, you might want to change
1035 LyX configuration for your own use.
1037 \begin_inset Flex Code
1040 \begin_layout Plain Layout
1046 directory contains all your personal configuration files.
1047 This is the directory described as
1048 \begin_inset Quotes eld
1052 \begin_inset Quotes erd
1056 \begin_inset Flex MenuItem
1059 \begin_layout Plain Layout
1060 Help\SpecialChar \menuseparator
1062 \begin_inset space ~
1071 This directory is used as a mirror of
1072 \begin_inset Flex Code
1075 \begin_layout Plain Layout
1081 , which means that every file in
1082 \begin_inset Flex Code
1085 \begin_layout Plain Layout
1091 is a replacement for the corresponding file in
1092 \begin_inset Flex Code
1095 \begin_layout Plain Layout
1102 Any configuration file described in the above sections can be placed either
1103 in the system-wide directory, in which case it will affect all users, or
1104 in your local directory for your own use.
1107 \begin_layout Standard
1108 To make things clearer, let's provide a few examples:
1111 \begin_layout Itemize
1112 The preferences set in the
1113 \begin_inset Flex MenuItem
1116 \begin_layout Plain Layout
1117 Tools\SpecialChar \menuseparator
1123 dialog are saved to a file
1124 \begin_inset Flex Code
1127 \begin_layout Plain Layout
1134 \begin_inset Flex Code
1137 \begin_layout Plain Layout
1146 \begin_layout Itemize
1147 When you reconfigure using
1148 \begin_inset Flex MenuItem
1151 \begin_layout Plain Layout
1152 Tools\SpecialChar \menuseparator
1159 \begin_inset Flex Code
1162 \begin_layout Plain Layout
1168 script, and the resulting files are written in your local configuration
1170 This means that any additional text class file that you might have added
1172 \begin_inset Flex Code
1175 \begin_layout Plain Layout
1181 will be added to the list of classes in the
1182 \begin_inset Flex MenuItem
1185 \begin_layout Plain Layout
1186 Document\SpecialChar \menuseparator
1195 \begin_layout Itemize
1196 If you get some updated documentation from LyX ftp site and cannot install
1197 it because you do not have sysadmin rights on your system, you can just
1199 \begin_inset Flex Code
1202 \begin_layout Plain Layout
1208 and the items in the
1209 \begin_inset Flex MenuItem
1212 \begin_layout Plain Layout
1218 menu will open them!
1221 \begin_layout Section
1222 Running LyX with multiple configurations
1225 \begin_layout Standard
1226 The configuration freedom of the local configuration directory may not suffice
1227 if you want to have more than one configuration at your disposal.
1228 For example, you may want to be use different key bindings or printer settings
1230 You can achieve this by having several such directories.
1231 You then specify which directory to use at run-time.
1234 \begin_layout Standard
1235 Invoking LyX with the command line switch
1236 \begin_inset Flex Code
1239 \begin_layout Plain Layout
1249 instructs the program to read the configuration from that directory, and
1250 not from the default directory.
1251 (You can determine the default directory by running LyX without the
1252 \begin_inset Flex Code
1255 \begin_layout Plain Layout
1261 switch.) If the specified directory does not exist, LyX offers to create
1262 it for you, just like it does for the default directory on the first time
1263 you run the program.
1264 You can modify the configuration options in this additional user directory
1265 exactly as you would for the default directory.
1266 These directories are completely independent (but read on).
1267 Note that setting the environment variable
1268 \begin_inset Flex Code
1271 \begin_layout Plain Layout
1277 to some value has exactly the same effect.
1280 \begin_layout Standard
1281 Having several configurations also requires more maintenance: if you want
1282 to add a new layout to
1283 \begin_inset Flex Code
1286 \begin_layout Plain Layout
1292 which you want available from all your configurations, you must add it
1293 to each directory separately.
1294 You can avoid this with the following trick: after LyX creates the additional
1295 directory, most of the subdirectories (see above) are empty.
1296 If you want the new configuration to mirror an existing one, replace the
1297 empty subdirectory with a symbolic link to the matching subdirectory in
1298 the existing configuration.
1300 \begin_inset Flex Code
1303 \begin_layout Plain Layout
1309 subdirectory, however, since it contains a file written by the configuration
1310 script (also accessible through
1311 \begin_inset Flex MenuItem
1314 \begin_layout Plain Layout
1315 Tools\SpecialChar \menuseparator
1321 ) which is configuration-specific.
1324 \begin_layout Chapter
1325 The Preferences dialog
1328 \begin_layout Standard
1329 All options of the preferences dialog are described in the Appendix
1331 The Preferences Dialog
1338 For some options you might find here more details.
1341 \begin_layout Section
1343 \begin_inset CommandInset label
1352 \begin_layout Standard
1353 The first step is to define your file formats if they are not already defined.
1355 \begin_inset Flex MenuItem
1358 \begin_layout Plain Layout
1359 Tools\SpecialChar \menuseparator
1367 \begin_inset Flex MenuItem
1370 \begin_layout Plain Layout
1371 File Handling\SpecialChar \menuseparator
1378 \begin_inset Flex MenuItem
1381 \begin_layout Plain Layout
1382 New\SpecialChar \ldots{}
1388 button to define your new format.
1390 \begin_inset Flex MenuItem
1393 \begin_layout Plain Layout
1399 field contains the name used to identify the format in the GUI.
1401 \begin_inset Flex MenuItem
1404 \begin_layout Plain Layout
1410 is used to identify the format internally.
1411 You will also need to enter a file extension.
1412 These are all required.
1414 \begin_inset Flex MenuItem
1417 \begin_layout Plain Layout
1423 field is used to provide a keyboard shortcut on the menus.
1424 (For example, pressing
1425 \begin_inset Flex MenuItem
1428 \begin_layout Plain Layout
1435 \begin_inset Flex MenuItem
1438 \begin_layout Plain Layout
1439 View\SpecialChar \menuseparator
1440 View (Other Formats)\SpecialChar \menuseparator
1449 \begin_layout Standard
1451 \begin_inset Flex MenuItem
1454 \begin_layout Plain Layout
1461 \begin_inset Flex MenuItem
1464 \begin_layout Plain Layout
1471 For example, you might want to use
1472 \begin_inset Flex MenuItem
1475 \begin_layout Plain Layout
1481 to view PostScript files.
1482 You can enter the command needed to start the program in the corresponding
1484 In defining this command, you can use the four variables listed in the
1486 The viewer is launched when you view an image in LyX or use the
1487 \begin_inset Flex MenuItem
1490 \begin_layout Plain Layout
1497 The editor is for example launched when you right-click on an image and
1499 \begin_inset Flex MenuItem
1502 \begin_layout Plain Layout
1508 in the appearing context menu.
1511 \begin_layout Standard
1513 \change_inserted -195340706 1329851811
1515 \begin_inset Flex MenuItem
1518 \begin_layout Plain Layout
1524 type of a format is optional, but if it is specified, it must be unique
1526 It is used to detect files of this format from the file contents.
1527 For some important file formats there is no MIME type officially registered
1529 \begin_inset CommandInset href
1532 target "http://www.iana.org/assignments/media-types/"
1537 Therefore LyX uses the extended list of MIME types as specified by
1538 \begin_inset CommandInset href
1540 name "freedesktop.org"
1541 target "http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec"
1548 \begin_layout Standard
1550 \begin_inset Flex MenuItem
1553 \begin_layout Plain Layout
1559 option tells LyX that a format is suitable for document export.
1560 If this is set and if a suitable conversion route exists (see sec.
1561 \begin_inset space \thinspace{}
1565 \begin_inset CommandInset ref
1567 reference "sec:Converters"
1571 ), the format will appear in the
1572 \begin_inset Flex MenuItem
1575 \begin_layout Plain Layout
1576 File\SpecialChar \menuseparator
1583 The format will also appear in the
1584 \begin_inset Flex MenuItem
1587 \begin_layout Plain Layout
1593 menu if a viewer is specified for the format.
1594 Pure image formats, such as
1595 \begin_inset Flex Code
1598 \begin_layout Plain Layout
1604 , should not use this option.
1605 Formats that can both represent vector graphics and documents like
1606 \begin_inset Flex Code
1609 \begin_layout Plain Layout
1618 \begin_layout Standard
1620 \begin_inset Flex MenuItem
1623 \begin_layout Plain Layout
1624 Vector graphics format
1629 tells LyX that a format can contain vector graphics.
1630 This information is used to determine the target format of included graphics
1632 \begin_inset Flex MenuItem
1635 \begin_layout Plain Layout
1642 Included graphics may need to be converted to either
1643 \begin_inset Flex MenuItem
1646 \begin_layout Plain Layout
1653 \begin_inset Flex MenuItem
1656 \begin_layout Plain Layout
1663 \begin_inset Flex MenuItem
1666 \begin_layout Plain Layout
1673 \begin_inset Flex MenuItem
1676 \begin_layout Plain Layout
1682 cannot handle other image formats.
1683 If an included graphic is not already in
1684 \begin_inset Flex MenuItem
1687 \begin_layout Plain Layout
1694 \begin_inset Flex MenuItem
1697 \begin_layout Plain Layout
1704 \begin_inset Flex MenuItem
1707 \begin_layout Plain Layout
1713 format, it is converted to
1714 \begin_inset Flex MenuItem
1717 \begin_layout Plain Layout
1723 if the vector format option is set, and otherwise to
1724 \begin_inset Flex MenuItem
1727 \begin_layout Plain Layout
1736 \begin_layout Section
1740 \begin_layout Standard
1741 Since all conversions from one format to another take place in LyX's temporary
1742 directory, it is sometimes necessary to modify a file before copying it
1743 to the temporary directory in order that the conversion may be performed.
1747 \begin_layout Plain Layout
1748 For example, the file may refer to other files—images, for example—using
1749 relative file names, and these may become invalid when the file is copied
1750 to the temporary directory.
1755 This is done by a Copier: It copies a file to (or from) the temporary directory
1756 and may modify it in the process.
1759 \begin_layout Standard
1760 The definitions of the copiers may use four variables:
1763 \begin_layout Labeling
1764 \labelwidthstring 00.00.0000
1765 \begin_inset Flex Code
1768 \begin_layout Plain Layout
1774 The LyX system directory (e.
1775 \begin_inset space \thinspace{}
1779 \begin_inset space \space{}
1783 \begin_inset Flex MenuItem
1786 \begin_layout Plain Layout
1795 \begin_layout Labeling
1796 \labelwidthstring 00.00.0000
1797 \begin_inset Flex Code
1800 \begin_layout Plain Layout
1809 \begin_layout Labeling
1810 \labelwidthstring 00.00.0000
1811 \begin_inset Flex Code
1814 \begin_layout Plain Layout
1821 \change_inserted 1082167584 1348453985
1825 \begin_layout Labeling
1826 \labelwidthstring 00.00.0000
1828 \change_inserted 1082167584 1348453986
1829 $$b The base name (without filename extension) in the LyX temporary directory
1832 \begin_layout Labeling
1833 \labelwidthstring 00.00.0000
1835 \change_inserted 1082167584 1348453986
1836 $$p The full directory path of the LyX temporary directory
1839 \begin_layout Labeling
1840 \labelwidthstring 00.00.0000
1842 \change_inserted 1082167584 1348453986
1843 $$r The full pathname to the original LyX file being processed
1846 \begin_layout Labeling
1847 \labelwidthstring 00.00.0000
1849 \change_inserted 1082167584 1348453986
1850 $$f The filename (without any directory path) of the LyX file.
1853 \begin_layout Labeling
1854 \labelwidthstring 00.00.0000
1855 \begin_inset Flex Code
1858 \begin_layout Plain Layout
1865 \change_inserted 1082167584 1348453720
1869 \begin_layout Standard
1870 The latter should be the filename as it would be used in a LaTeX's
1877 It is relevant only when exporting files suitable for such inclusion.
1880 \begin_layout Standard
1881 Copiers can be used to do almost anything with output files.
1882 For example, suppose you want generated pdf files to be copied to a special
1884 \begin_inset Flex Code
1887 \begin_layout Plain Layout
1894 Then you could write a shell script such as this one:
1897 \begin_layout Standard
1898 \begin_inset listings
1902 \begin_layout Plain Layout
1907 \begin_layout Plain Layout
1912 \begin_layout Plain Layout
1914 TOFILE=`basename $2`
1917 \begin_layout Plain Layout
1919 cp $FROMFILE /home/you/pdf/$TOFILE
1924 Save it in your local LyX directory—say,
1925 \begin_inset Flex Code
1928 \begin_layout Plain Layout
1929 /home/you/.lyx/scripts/pdfcopier.sh
1934 —and make it executable, if you need to do so on your platform.
1936 \begin_inset Flex MenuItem
1939 \begin_layout Plain Layout
1940 Tools\SpecialChar \menuseparator
1946 dialog, select under
1947 \begin_inset Flex MenuItem
1950 \begin_layout Plain Layout
1951 File Handling\SpecialChar \menuseparator
1958 \begin_inset Flex MenuItem
1961 \begin_layout Plain Layout
1967 format—or one of the other pdf formats—and enter
1968 \begin_inset Flex Code
1971 \begin_layout Plain Layout
1972 pdfcopier.sh $$i $$o
1978 \begin_inset Flex MenuItem
1981 \begin_layout Plain Layout
1991 \begin_layout Standard
1992 Copiers are used by LyX in various of its own conversions.
1993 For example, if appropriate programs are found, LyX will automatically
1994 install copiers for the
1995 \begin_inset Flex MenuItem
1998 \begin_layout Plain Layout
2005 \begin_inset Flex MenuItem
2008 \begin_layout Plain Layout
2010 \begin_inset space ~
2019 When these formats are exported, the copier sees that not just the main
2020 HTML file but various associated files (style files, images, etc.) are also
2022 All these files are written to a subdirectory of the directory in which
2023 the original LyX file was found.
2027 \begin_layout Plain Layout
2028 This copier can be customized.
2030 \begin_inset Quotes eld
2034 \begin_inset Quotes erd
2037 argument takes a comma-separated list of extensions to be copied; if it
2038 is omitted, all files will be copied.
2040 \begin_inset Quotes eld
2044 \begin_inset Quotes erd
2047 argument determines the extension added to the generated directory.
2049 \begin_inset Quotes eld
2053 \begin_inset Flex MenuItem
2056 \begin_layout Plain Layout
2063 \begin_inset Quotes erd
2066 , so HTML generated from
2067 \begin_inset Flex MenuItem
2070 \begin_layout Plain Layout
2071 /path/to/filename.lyx
2077 \begin_inset Flex MenuItem
2080 \begin_layout Plain Layout
2081 /path/to/filename.html.LyXconv
2095 \begin_layout Section
2097 \begin_inset CommandInset label
2099 name "sec:Converters"
2106 \begin_layout Standard
2107 You can define your own Converters to convert files between different formats.
2109 \begin_inset Flex MenuItem
2112 \begin_layout Plain Layout
2113 Tools\SpecialChar \menuseparator
2114 Preferences\SpecialChar \menuseparator
2115 File Handling\SpecialChar \menuseparator
2124 \begin_layout Standard
2125 To define a new converter, select the
2126 \begin_inset Flex MenuItem
2129 \begin_layout Plain Layout
2131 \begin_inset space ~
2140 \begin_inset Flex MenuItem
2143 \begin_layout Plain Layout
2145 \begin_inset space ~
2153 from the drop-down lists, enter the command needed for the conversion,
2155 \begin_inset Flex MenuItem
2158 \begin_layout Plain Layout
2165 Several variables can be used in the definition of converters:
2168 \begin_layout Labeling
2169 \labelwidthstring 00.00.0000
2170 \begin_inset Flex Code
2173 \begin_layout Plain Layout
2179 The LyX system directory
2182 \begin_layout Labeling
2183 \labelwidthstring 00.00.0000
2184 \begin_inset Flex Code
2187 \begin_layout Plain Layout
2196 \begin_layout Labeling
2197 \labelwidthstring 00.00.0000
2198 \begin_inset Flex Code
2201 \begin_layout Plain Layout
2210 \begin_layout Labeling
2211 \labelwidthstring 00.00.0000
2212 \begin_inset Flex Code
2215 \begin_layout Plain Layout
2221 The base filename of the input file (i.
2222 \begin_inset space \thinspace{}
2225 g., without the extension)
2228 \begin_layout Labeling
2229 \labelwidthstring 00.00.0000
2230 \begin_inset Flex Code
2233 \begin_layout Plain Layout
2239 The path to the input file
2242 \begin_layout Labeling
2243 \labelwidthstring 00.00.0000
2244 \begin_inset Flex Code
2247 \begin_layout Plain Layout
2253 The path to the original input file (this is different from $$p when a
2254 chain of converters is called)
2257 \begin_layout Labeling
2258 \labelwidthstring 00.00.0000
2259 \begin_inset Flex Code
2262 \begin_layout Plain Layout
2268 The iconv name for the encoding of the document.
2271 \begin_layout Standard
2273 \begin_inset Flex MenuItem
2276 \begin_layout Plain Layout
2278 \begin_inset space ~
2286 field you can enter the following flags, separated by commas:
2289 \begin_layout Labeling
2290 \labelwidthstring 00.00.0000
2291 \begin_inset Flex Code
2294 \begin_layout Plain Layout
2300 This converter runs some form of LaTeX.
2301 This will make LyX's LaTeX error logs available.
2304 \begin_layout Labeling
2305 \labelwidthstring 00.00.0000
2306 \begin_inset Flex Code
2309 \begin_layout Plain Layout
2316 \begin_inset Flex MenuItem
2319 \begin_layout Plain Layout
2325 file for the conversion.
2326 \change_inserted 1414654397 1337693117
2330 \begin_layout Labeling
2331 \labelwidthstring 00.00.0000
2333 \change_inserted 1414654397 1337693188
2334 \begin_inset Flex Code
2337 \begin_layout Plain Layout
2339 \change_inserted 1414654397 1337693129
2348 \begin_inset Quotes eld
2352 \begin_inset Quotes erd
2355 file from the backend, which in practice means a LaTeX file like the one
2356 we would export, without
2357 \begin_inset Flex Code
2360 \begin_layout Plain Layout
2362 \change_inserted 1414654397 1337693184
2375 \begin_layout Labeling
2376 \labelwidthstring 00.00.0000
2377 \begin_inset Flex Code
2380 \begin_layout Plain Layout
2389 \begin_layout Standard
2390 The following three flags are not really flags at all because they take
2392 \begin_inset Flex MenuItem
2395 \begin_layout Plain Layout
2397 \begin_inset space ~
2401 \begin_inset space ~
2412 \begin_layout Labeling
2413 \labelwidthstring 00.00.0000
2414 \begin_inset Flex Code
2417 \begin_layout Plain Layout
2423 If set, the converter's standard error will be redirected to a file
2424 \begin_inset Flex Code
2427 \begin_layout Plain Layout
2433 , and the script given as argument will be run as:
2434 \begin_inset Flex Code
2437 \begin_layout Plain Layout
2438 script < infile.out > infile.log
2444 The argument may contain
2445 \begin_inset Flex Code
2448 \begin_layout Plain Layout
2457 \begin_layout Labeling
2458 \labelwidthstring 00.00.0000
2459 \begin_inset Flex Code
2462 \begin_layout Plain Layout
2468 The name of the directory in which the converter will dump the generated
2470 LyX will not create this directory, and it does not copy anything into
2471 it, though it will copy this directory to the destination.
2472 The argument may contain
2473 \begin_inset Flex Code
2476 \begin_layout Plain Layout
2482 , which will be replaced by the base name of the input and output files,
2483 respectively, when the directory is copied.
2484 \begin_inset Newline newline
2487 Note that resultdir and usetempdir make no sense together.
2488 The latter will be ignored if the former is given.
2491 \begin_layout Labeling
2492 \labelwidthstring 00.00.0000
2493 \begin_inset Flex Code
2496 \begin_layout Plain Layout
2502 Determines the output file name and may, contain
2503 \begin_inset Flex Code
2506 \begin_layout Plain Layout
2513 Sensible only with resultdir and optional even then; if not given, it defaults
2517 \begin_layout Standard
2518 None of these last three are presently used in any of the converters that
2519 are installed with LyX.
2523 \begin_layout Standard
2524 You do not have to define converters for all formats between which you want
2526 For example, you will note that there is no `LyX to PostScript' converter,
2527 but LyX will export PostScript.
2528 It does so by first creating a LaTeX file (no converter needs to be defined
2529 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2530 and finally converting the resulting DVI file to PostScript.
2531 LyX finds such `chains' of converters automatically, and it will always
2532 choose the shortest possible chain.
2533 You can, though, still define multiple conversion methods between file
2535 For example, the standard LyX configuration provides three ways to convert
2536 LaTeX to PDF: Directly, using
2537 \begin_inset Flex MenuItem
2540 \begin_layout Plain Layout
2546 ; via (DVI and) PostScript, using
2547 \begin_inset Flex MenuItem
2550 \begin_layout Plain Layout
2557 \begin_inset Flex MenuItem
2560 \begin_layout Plain Layout
2567 To define such alternate chains, you must define multiple target `file
2568 formats', as described in section
2569 \begin_inset CommandInset ref
2571 reference "sec:Formats"
2576 For example, in the standard configuration, the formats named
2577 \begin_inset Flex MenuItem
2580 \begin_layout Plain Layout
2587 \begin_inset Flex MenuItem
2590 \begin_layout Plain Layout
2597 \begin_inset Flex MenuItem
2600 \begin_layout Plain Layout
2606 are defined, all of which share the extension
2607 \begin_inset Flex MenuItem
2610 \begin_layout Plain Layout
2616 , and which correspond to the conversion methods just mentioned.
2619 \begin_layout Chapter
2620 Internationalizing LyX
2621 \begin_inset CommandInset label
2623 name "cha:Internationalizing-LyX"
2630 \begin_layout Standard
2631 LyX supports using a translated interface.
2632 Last time we checked, LyX provided text in thirty languages.
2633 The language of choice is called your
2638 (For further reading on locale settings, see also the documentation for
2639 locale that comes with your operating system.
2640 For Linux, the manual page for
2641 \begin_inset Flex Code
2644 \begin_layout Plain Layout
2650 could be a good place to start).
2653 \begin_layout Standard
2654 Notice that these translations will work, but do contain a few flaws.
2655 In particular, all dialogs have been designed with the English text in
2656 mind, which means that some of the translated text will be too large to
2657 fit within the space allocated.
2658 This is only a display problem and will not cause any harm.
2659 Also, you will find that some of the translations do not define shortcut
2660 keys for everything.
2661 Sometimes, there are simply not enough free letters to do it.
2662 Other times, the translator just hasn't got around to doing it yet.
2663 Our localization team, which you may wish to join,
2667 \begin_layout Plain Layout
2668 If you are a fluent speaker of a language other than English, joining these
2669 teams is a great way to give back to the LyX community!
2674 will of course try to fix these shortcomings in future versions of LyX.
2677 \begin_layout Section
2681 \begin_layout Subsection
2682 Translating the graphical user interface (text messages).
2685 \begin_layout Standard
2687 \begin_inset Flex Code
2690 \begin_layout Plain Layout
2696 library to handle the internationalization of the interface.
2697 To have LyX speak your favorite language in all menus and dialogs, you
2699 \begin_inset Flex Code
2702 \begin_layout Plain Layout
2708 -file for that language.
2709 When this is available, you'll have to generate a
2710 \begin_inset Flex Code
2713 \begin_layout Plain Layout
2719 -file from it and install the
2720 \begin_inset Flex Code
2723 \begin_layout Plain Layout
2730 The process of doing all of this is explained in the documentation for
2732 \begin_inset Flex Code
2735 \begin_layout Plain Layout
2742 It is possible to do this just for yourself, but if you're going to do
2743 it, you might as well share the results of your labors with the rest of
2745 Send a message to the LyX developers' list for more information about how
2749 \begin_layout Standard
2750 In short, this is what you should do (xx denotes the language code):
2753 \begin_layout Itemize
2754 Check out the LyX source code.
2756 \begin_inset CommandInset href
2758 name "information on the web"
2759 target "http://www.lyx.org/HowToUseSVN"
2766 \begin_layout Itemize
2768 \begin_inset Flex Code
2771 \begin_layout Plain Layout
2777 to the folder of the
2778 \begin_inset Flex Code
2781 \begin_layout Plain Layout
2789 \begin_inset Flex Code
2792 \begin_layout Plain Layout
2800 \begin_inset Flex Code
2803 \begin_layout Plain Layout
2809 doesn't exist anywhere, it can be remade with the console command
2810 \begin_inset Flex Code
2813 \begin_layout Plain Layout
2819 in that directory, or you can use an existing po-file for some other language
2823 \begin_layout Itemize
2825 \begin_inset Flex Code
2828 \begin_layout Plain Layout
2838 \begin_layout Plain Layout
2839 This is just a text file, so it can be edited in any text editor.
2840 But there are also specialized programs that support such editing, such
2845 (for all platforms) or
2854 contains a `mode' for editing
2855 \begin_inset Flex Code
2858 \begin_layout Plain Layout
2869 For some menu- and widget-labels, there are also shortcut keys that should
2871 Those keys are marked after a `|', and should be translated according to
2872 the words and phrases of the language.
2873 You should also fill also out the information at the beginning of the new
2875 \begin_inset Flex Code
2878 \begin_layout Plain Layout
2884 -file with your email-address, etc., so people know where to reach you with
2885 suggestions and entertaining flames.
2888 \begin_layout Standard
2889 If you are just doing this on your own, then:
2892 \begin_layout Itemize
2894 \begin_inset Flex Code
2897 \begin_layout Plain Layout
2904 This can be done with
2905 \begin_inset Flex Code
2908 \begin_layout Plain Layout
2909 msgfmt -o xx.mo < xx.po
2917 \begin_layout Itemize
2919 \begin_inset Flex Code
2922 \begin_layout Plain Layout
2928 -file to your locale-tree, at the correct directory for application messages
2933 xx, and under the name
2934 \begin_inset Flex Code
2937 \begin_layout Plain Layout
2944 \begin_inset space \thinspace{}
2948 \begin_inset space \space{}
2952 \begin_inset Flex Code
2955 \begin_layout Plain Layout
2956 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2966 \begin_layout Standard
2967 As said, however, it would be best if the new
2968 \begin_inset Flex Code
2971 \begin_layout Plain Layout
2977 -file could be added to the LyX distribution, so others can use it.
2978 Adding it involves making additional changes to LyX.
2979 So send an email to the developers' mailing list if you're interested in
2983 \begin_layout Subsubsection
2987 \begin_layout Standard
2988 Sometimes it turns out that one English message needs to be translated into
2989 different messages in the target language.
2990 One example is the message
2991 \begin_inset Flex Code
2994 \begin_layout Plain Layout
3000 which has the German translation
3008 , depending upon exactly what the English
3009 \begin_inset Quotes eld
3013 \begin_inset Quotes erd
3018 \begin_inset Flex Code
3021 \begin_layout Plain Layout
3027 does not handle such ambiguous translations.
3028 Therefore you have to add some context information to the message: Instead
3030 \begin_inset Flex Code
3033 \begin_layout Plain Layout
3040 \begin_inset Flex Code
3043 \begin_layout Plain Layout
3044 To[[as in 'From format x to format y']]
3050 \begin_inset Flex Code
3053 \begin_layout Plain Layout
3054 To[[as in 'From page x to page y']].
3059 Now the two occurrences of
3060 \begin_inset Flex Code
3063 \begin_layout Plain Layout
3070 \begin_inset Flex Code
3073 \begin_layout Plain Layout
3079 and can be translated correctly to
3090 \begin_layout Standard
3091 Of course the context information needs to be stripped off the original
3092 message when no translation is used.
3093 Therefore you have to put it in double square brackets at the end of the
3094 message (see the example above).
3095 The translation mechanism of LyX ensures that everything in double square
3096 brackets at the end of messages is removed before displaying the message.
3099 \begin_layout Subsection
3100 Translating the documentation.
3103 \begin_layout Standard
3104 The online documentation (in the
3105 \begin_inset Flex MenuItem
3108 \begin_layout Plain Layout
3114 -menu) can (and should!) be translated.
3115 If there are translated versions of the documentation available
3119 \begin_layout Plain Layout
3120 As of March 2008, at least some of the documents have been translated into
3121 fourteen languages, with the Tutorial available in a few more.
3126 and the locale is set accordingly, these will be used automagically by
3128 LyX looks for translated versions as
3129 \begin_inset Flex Code
3132 \begin_layout Plain Layout
3133 LyXDir/doc/xx/DocName.lyx
3139 \begin_inset Flex Code
3142 \begin_layout Plain Layout
3148 is the code for the language currently in use.
3149 If there are no translated documents, the default English versions will
3151 Note that the translated versions must have the same filenames (
3152 \begin_inset Flex Code
3155 \begin_layout Plain Layout
3161 above) as the original.
3162 If you feel up to translating the documentation (an excellent way to proof-read
3163 the original documentation by the way!), there are a few things you should
3167 \begin_layout Itemize
3168 Check out the documentation translation web page at
3169 \begin_inset CommandInset href
3171 name "http://www.lyx.org/Translation"
3172 target "http://www.lyx.org/Translation"
3177 That way, you can find out which (if any) documents have already been translate
3178 d into your language.
3179 You can also find out who (if anyone) is organizing the effort to translate
3180 the documentation into your language.
3181 If no one is organizing the effort, please let us know that you're interested.
3184 \begin_layout Standard
3185 Once you get to actually translating, here's a few hints for you that may
3189 \begin_layout Itemize
3190 Join the documentation team! There is information on how to do that in
3191 \begin_inset Flex Code
3194 \begin_layout Plain Layout
3201 \begin_inset Flex MenuItem
3204 \begin_layout Plain Layout
3205 Help\SpecialChar \menuseparator
3211 ), which by the way is the first document you should translate.
3214 \begin_layout Itemize
3215 Learn the typographic conventions for the language you are translating to.
3216 Typography is an ancient art and over the centuries, a great variety of
3217 conventions have developed throughout different parts of the world.
3218 Also study the professional terminology amongst typographers in your country.
3219 Inventing your own terminology will only confuse the users.
3222 (Warning! Typography is addictive!)
3225 \begin_layout Itemize
3226 Make a copy of the document.
3227 This will be your working copy.
3228 You can use this as your personal translated help-file by placing it in
3230 \begin_inset Flex Code
3233 \begin_layout Plain Layout
3242 \begin_layout Itemize
3243 Sometimes the original document (from the LyX-team) will be updated.
3244 Use the source viewer at
3245 \begin_inset CommandInset href
3247 name "http://www.lyx.org/trac/timeline"
3248 target "http://www.lyx.org/trac/timeline"
3252 to see what has been changed.
3253 That way you can easily see which parts of the translated document need
3257 \begin_layout Standard
3258 If you ever find an error in the original document, fix it and notify the
3259 rest of the documentation team of the changes! (You didn't forget to join
3260 the documentation team, did you?)
3263 \begin_layout Standard
3264 \begin_inset Branch OutDated
3267 \begin_layout Section
3268 International Keyboard Support
3271 \begin_layout Standard
3274 [Editor's Note: The following section is by
3282 It needs to be fixed to conform to the new Documentation Style sheet and
3283 to make use of the new v1.0 features.
3284 The whole thing also needs to be merged with the section following it.-jw
3285 It may also be badly out of date.-rh (2008)]
3288 \begin_layout Subsection
3289 Defining Own Keymaps: Keymap File Format
3292 \begin_layout Standard
3293 Let's look at a keyboard definition file a little closer.
3294 It is a plain text file defining
3297 \begin_layout Itemize
3298 key-to-key or key-to-string translations
3301 \begin_layout Itemize
3305 \begin_layout Itemize
3306 dead keys exceptions
3309 \begin_layout Standard
3310 To define key-to-key or key-to-string translation, use this command:
3313 \begin_layout Quotation
3314 \begin_inset Flex Code
3317 \begin_layout Plain Layout
3326 \begin_inset Flex Code
3329 \begin_layout Plain Layout
3338 \begin_layout Standard
3340 \begin_inset Flex Code
3343 \begin_layout Plain Layout
3349 is the key to be translated and
3350 \begin_inset Flex Code
3353 \begin_layout Plain Layout
3359 is the string to be inserted into the document.
3360 To define dead keys, use:
3363 \begin_layout Quotation
3364 \begin_inset Flex Code
3367 \begin_layout Plain Layout
3376 \begin_inset Flex Code
3379 \begin_layout Plain Layout
3388 \begin_layout Standard
3390 \begin_inset Flex Code
3393 \begin_layout Plain Layout
3399 is a keyboard key and
3400 \begin_inset Flex Code
3403 \begin_layout Plain Layout
3410 The following dead keys are supported (shortcut name is in parentheses):
3413 \begin_layout Quotation
3417 \begin_inset space \hfill{}
3423 \begin_layout Quotation
3425 \begin_inset space \hfill{}
3431 \begin_layout Quotation
3433 \begin_inset space \hfill{}
3439 \begin_layout Quotation
3441 \begin_inset space \hfill{}
3447 \begin_layout Quotation
3449 \begin_inset space \hfill{}
3455 \begin_layout Quotation
3457 \begin_inset space \hfill{}
3464 \begin_layout Plain Layout
3476 \begin_layout Quotation
3478 \begin_inset space \hfill{}
3484 \begin_layout Quotation
3486 \begin_inset space \hfill{}
3493 \begin_layout Plain Layout
3505 \begin_layout Quotation
3507 \begin_inset space \hfill{}
3513 \begin_layout Quotation
3515 \begin_inset space \hfill{}
3521 \begin_layout Quotation
3523 \begin_inset space \hfill{}
3530 \begin_layout Plain Layout
3542 \begin_layout Quotation
3544 \begin_inset space \hfill{}
3551 \begin_layout Plain Layout
3563 \begin_layout Quotation
3565 \begin_inset space \hfill{}
3571 \begin_layout Quotation
3572 hungarian umlaut (hug)
3573 \begin_inset space \hfill{}
3579 \begin_layout Quotation
3581 \begin_inset space \hfill{}
3587 \begin_layout Quotation
3589 \begin_inset space \hfill{}
3596 \begin_layout Plain Layout
3608 \begin_layout Standard
3609 Since in many international keyboards there are exceptions to what some
3610 dead keys should do, you can define them using
3613 \begin_layout Quotation
3614 \begin_inset Flex Code
3617 \begin_layout Plain Layout
3625 deadkey key outstring
3628 \begin_layout Standard
3629 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3633 \begin_layout Quotation
3634 \begin_inset Flex Code
3637 \begin_layout Plain Layout
3650 \begin_layout Standard
3651 to make it work correctly.
3652 Also, you have to define as exceptions dead keys over i and j, to remove
3653 the dot from them before inserting an accent mark.
3654 I will change this when the time comes, but so far I haven't had time.
3657 \begin_layout Standard
3658 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3661 \begin_inset Flex Code
3664 \begin_layout Plain Layout
3670 have different meaning.
3672 \begin_inset Flex Code
3675 \begin_layout Plain Layout
3681 marks comments, quotes start and end LaTeX-style commands.
3682 To enter quote, you'll need to use
3683 \begin_inset Flex Code
3686 \begin_layout Plain Layout
3695 \begin_inset Flex Code
3698 \begin_layout Plain Layout
3705 \begin_inset Flex Code
3708 \begin_layout Plain Layout
3719 \begin_layout Standard
3720 If you make a keyboard description file that works for your language, please
3721 mail it to me, so I can include it in the next keymap distribution.
3724 \begin_layout Standard
3725 More keywords will be supported in keymap configuration file in future,
3729 \begin_layout Itemize
3730 \begin_inset Flex Code
3733 \begin_layout Plain Layout
3744 \begin_inset space \hfill{}
3748 \begin_inset Flex Code
3751 \begin_layout Plain Layout
3760 \begin_layout Itemize
3761 \begin_inset Flex Code
3764 \begin_layout Plain Layout
3775 \begin_inset space \hfill{}
3779 \begin_inset Flex Code
3782 \begin_layout Plain Layout
3788 an external keymap translation program
3791 \begin_layout Standard
3792 Also, it should look into
3793 \begin_inset Flex Code
3796 \begin_layout Plain Layout
3802 file for defaults, too (for example, a
3803 \begin_inset Flex Code
3806 \begin_layout Plain Layout
3814 option to include default keyboard).
3822 \begin_layout Section
3823 International Keymap Stuff
3824 \begin_inset CommandInset label
3826 name "sec:International-Keymap-Stuff"
3833 \begin_layout Standard
3834 \begin_inset Note Note
3837 \begin_layout Plain Layout
3838 In doing the revisions on this document in March 2008, I did not look over
3839 this stuff, as I do not understand it.
3840 It would be good if someone else could do so.
3849 \begin_layout Standard
3850 The next two sections describe the
3851 \begin_inset Flex Code
3854 \begin_layout Plain Layout
3863 \begin_inset Flex Code
3866 \begin_layout Plain Layout
3874 file syntax in detail.
3875 These sections should help you design your own key map if the ones provided
3876 do not meet your needs.
3879 \begin_layout Subsection
3883 \begin_layout Standard
3887 \begin_inset Flex Code
3890 \begin_layout Plain Layout
3896 file maps keystrokes to characters or strings.
3897 As the name suggests, it sets a keyboard mapping.
3899 \begin_inset Flex Code
3902 \begin_layout Plain Layout
3913 \begin_inset Flex Code
3916 \begin_layout Plain Layout
3931 \begin_inset Flex Code
3934 \begin_layout Plain Layout
3947 \begin_inset Flex Code
3950 \begin_layout Plain Layout
3959 \begin_inset Flex Code
3962 \begin_layout Plain Layout
3970 are described in this section.
3973 \begin_layout Labeling
3974 \labelwidthstring 00.00.0000
3975 \begin_inset Flex Code
3978 \begin_layout Plain Layout
3986 Map a character to a string
3989 \begin_layout LyX-Code
4004 \begin_layout Standard
4037 the double-quote (")
4054 must be escaped with a preceding backslash (
4065 \begin_layout Standard
4067 \begin_inset Flex MenuItem
4070 \begin_layout Plain Layout
4078 statement to cause the symbol
4079 \begin_inset Flex MenuItem
4082 \begin_layout Plain Layout
4090 to be output for the keystroke
4091 \begin_inset Flex MenuItem
4094 \begin_layout Plain Layout
4105 \begin_layout LyX-Code
4111 \begin_layout Labeling
4112 \labelwidthstring 00.00.0000
4113 \begin_inset Flex Code
4116 \begin_layout Plain Layout
4124 Specify an accent character
4127 \begin_layout LyX-Code
4136 \begin_layout Standard
4137 This will make the cha
4175 This is the dead key
4179 \begin_layout Plain Layout
4186 refers to a key that does not produce a character by itself, but when followed
4187 with another key, produces the desired accent character.
4188 For example, a German characte
4190 r with an umlaut like
4200 can be produced in this manner.
4209 \begin_layout Standard
4222 and then another key not in
4239 followed by the other, not allowed key, as output.
4243 \begin_inset Flex MenuItem
4246 \begin_layout Plain Layout
4254 cancels a dead key, so if
4265 \begin_inset Flex MenuItem
4268 \begin_layout Plain Layout
4277 , the cursor will not go one position backwards but will instead cancel
4293 might have had on the next keystroke.
4297 \begin_layout Standard
4298 The following example specifies that the character ' is to be an acute accent,
4299 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4302 \begin_layout LyX-Code
4305 kmod ' acute aeiouAEIOU
4308 \begin_layout Labeling
4309 \labelwidthstring 00.00.0000
4310 \begin_inset Flex Code
4313 \begin_layout Plain Layout
4319 Specify an exception to the accent character
4322 \begin_layout LyX-Code
4331 \begin_layout Standard
4332 This defines an exce
4373 have been assigned a keystroke with a previous
4376 \begin_inset Flex Code
4379 \begin_layout Plain Layout
4403 must not belong in the
4450 If such a declaration does not exist in
4458 \begin_inset Flex Code
4461 \begin_layout Plain Layout
4495 \begin_inset Flex Code
4498 \begin_layout Plain Layout
4512 \begin_layout Standard
4513 The following command produces causes äi to be produced when you enter acute-i
4517 \begin_layout LyX-Code
4531 \begin_layout Labeling
4532 \labelwidthstring 00.00.0000
4533 \begin_inset Flex Code
4536 \begin_layout Plain Layout
4542 Combine two accent characters
4545 \begin_layout LyX-Code
4551 accent1 accent2 allowed
4554 \begin_layout Standard
4555 This one is getting pretty esoteric.
4556 It allows you to combine the effect
4612 \begin_inset Flex Code
4615 \begin_layout Plain Layout
4643 \begin_layout Standard
4644 Consider this example from the
4645 \begin_inset Flex Code
4648 \begin_layout Plain Layout
4659 \begin_layout LyX-Code
4662 kmod ; acute aeioyvhAEIOYVH
4666 kcomb acute umlaut iyIY
4669 \begin_layout Standard
4670 This allows you to press
4671 \begin_inset Flex MenuItem
4674 \begin_layout Plain Layout
4682 and get the effect of
4683 \begin_inset Flex Code
4686 \begin_layout Plain Layout
4705 in this case cancels the last dead key, so if you press
4706 \begin_inset Flex MenuItem
4709 \begin_layout Plain Layout
4718 \begin_inset Flex Code
4721 \begin_layout Plain Layout
4734 \begin_layout Subsection
4738 \begin_layout Standard
4740 \begin_inset Flex Code
4743 \begin_layout Plain Layout
4751 mapping is performed, a
4752 \begin_inset Flex Code
4755 \begin_layout Plain Layout
4765 file maps the strings that the symbols generate to characters in the current
4767 The LyX distribution currently includes at least the
4768 \begin_inset Flex Code
4771 \begin_layout Plain Layout
4780 \begin_inset Flex Code
4783 \begin_layout Plain Layout
4794 \begin_layout Standard
4796 \begin_inset Flex Code
4799 \begin_layout Plain Layout
4807 file is a sequence of declarations of the form
4810 \begin_layout LyX-Code
4823 \begin_layout Standard
4824 For example, in order to map
4825 \begin_inset Flex MenuItem
4828 \begin_layout Plain Layout
4838 to the corresponding character in the iso-8859-1 set (233), the following
4842 \begin_layout LyX-Code
4850 \begin_layout Standard
4852 \begin_inset Flex Code
4855 \begin_layout Plain Layout
4864 \begin_inset Flex Code
4867 \begin_layout Plain Layout
4885 the same character can apply to more than one string.
4887 \begin_inset Flex Code
4890 \begin_layout Plain Layout
4901 \begin_layout LyX-Code
4913 \begin_inset Newline newline
4929 \begin_layout Standard
4930 If LyX cannot find a mapping for the string produced by the keystroke or
4931 a deadkey sequence, it will check if it looks like an accented char and
4932 try to draw an accent over the character on screen.
4935 \begin_layout Subsection
4939 \begin_layout Standard
4940 There is a second way to add support for international characters through
4941 so-called dead-keys.
4942 A dead-key works in combination with a letter to produce an accented character.
4943 Here, we'll explain how to create a really simple dead-key to illustrate
4947 \begin_layout Standard
4948 Suppose you happen to need the circumflex character,
4949 \begin_inset Quotes eld
4953 \begin_inset Quotes erd
4958 \begin_inset Flex MenuItem
4961 \begin_layout Plain Layout
4968 \begin_inset space ~
4972 \begin_inset Flex MenuItem
4975 \begin_layout Plain Layout
4981 ] to the LyX command
4982 \begin_inset Flex Code
4985 \begin_layout Plain Layout
4992 \begin_inset Flex Code
4995 \begin_layout Plain Layout
5002 Now, whenever you type the
5003 \begin_inset Flex MenuItem
5006 \begin_layout Plain Layout
5012 -key followed by a letter, that letter will have a circumflex accent on
5014 For example, the sequence
5015 \begin_inset Quotes eld
5019 \begin_inset Flex MenuItem
5022 \begin_layout Plain Layout
5029 \begin_inset Quotes erd
5032 produces the letter:
5033 \begin_inset Quotes eld
5037 \begin_inset Quotes erd
5041 If you tried to type
5042 \begin_inset Quotes eld
5046 \begin_inset Flex MenuItem
5049 \begin_layout Plain Layout
5056 \begin_inset Quotes erd
5059 , however, LyX will complain with a beep, since a
5060 \begin_inset Quotes eld
5064 \begin_inset Flex MenuItem
5067 \begin_layout Plain Layout
5074 \begin_inset Quotes erd
5077 never takes a circumflex accent.
5079 \begin_inset Flex MenuItem
5082 \begin_layout Plain Layout
5088 after a dead-key produces the bare-accent.
5089 Please note this last point! If you bind a key to a dead-key, you'll need
5090 to rebind the character on that key to yet another key.
5092 \begin_inset Flex MenuItem
5095 \begin_layout Plain Layout
5101 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5104 \begin_layout Standard
5105 One common way to bind dead-keys is to use
5106 \begin_inset Flex MenuItem
5109 \begin_layout Plain Layout
5116 \begin_inset Flex MenuItem
5119 \begin_layout Plain Layout
5126 \begin_inset Flex MenuItem
5129 \begin_layout Plain Layout
5135 in combination with an accent, like
5136 \begin_inset Quotes eld
5140 \begin_inset Flex MenuItem
5143 \begin_layout Plain Layout
5150 \begin_inset Quotes erd
5154 \begin_inset Quotes eld
5158 \begin_inset Flex MenuItem
5161 \begin_layout Plain Layout
5168 \begin_inset Quotes erd
5172 \begin_inset Quotes eld
5176 \begin_inset Flex MenuItem
5179 \begin_layout Plain Layout
5186 \begin_inset Quotes erd
5190 Another way involves using
5191 \begin_inset Flex Code
5194 \begin_layout Plain Layout
5201 \begin_inset Flex Code
5204 \begin_layout Plain Layout
5210 to set up the special
5211 \begin_inset Flex Code
5214 \begin_layout Plain Layout
5222 \begin_inset Flex Code
5225 \begin_layout Plain Layout
5231 acts in some ways just like
5232 \begin_inset Flex MenuItem
5235 \begin_layout Plain Layout
5241 and permits you to bind keys to accented characters.
5242 You can also turn keys into dead-keys by binding them to something like
5244 \begin_inset Flex Code
5247 \begin_layout Plain Layout
5253 and then binding this symbolic key to the corresponding LyX command.
5257 \begin_layout Plain Layout
5262 : This is exactly what I do in my
5263 \begin_inset Flex Code
5266 \begin_layout Plain Layout
5273 \begin_inset Flex Code
5276 \begin_layout Plain Layout
5284 \begin_inset Flex MenuItem
5287 \begin_layout Plain Layout
5289 \begin_inset space ~
5298 \begin_inset Flex Code
5301 \begin_layout Plain Layout
5307 and a bunch of these
5308 \begin_inset Quotes eld
5312 \begin_inset Flex Code
5315 \begin_layout Plain Layout
5322 \begin_inset Quotes erd
5325 symbolic keys bound such things as
5326 \begin_inset Flex MenuItem
5329 \begin_layout Plain Layout
5331 \begin_inset space ~
5340 \begin_inset Flex MenuItem
5343 \begin_layout Plain Layout
5345 \begin_inset space ~
5354 This is how I produce my accented characters.
5359 You can make just about anything into the
5360 \begin_inset Flex Code
5363 \begin_layout Plain Layout
5370 \begin_inset Flex MenuItem
5373 \begin_layout Plain Layout
5379 keys, a spare function key, etc.
5380 As for the LyX commands that produce accents, check the entry for
5381 \begin_inset Flex Code
5384 \begin_layout Plain Layout
5395 You'll find the complete list there.
5398 \begin_layout Subsection
5399 Saving your Language Configuration
5402 \begin_layout Standard
5403 You can edit your preferences so that your desired language environment
5404 is automatically configured when LyX starts up, via the
5405 \begin_inset Flex MenuItem
5408 \begin_layout Plain Layout
5409 Edit\SpecialChar \menuseparator
5418 \begin_layout Chapter
5419 Installing New Document Classes, Layouts, and Templates
5420 \begin_inset CommandInset label
5422 name "cha:Installing-New-Document"
5427 \begin_inset Argument 1
5430 \begin_layout Plain Layout
5431 Installing New Document Classes
5439 \begin_layout Standard
5440 In this chapter, we describe the procedures for creating and installing
5441 new LyX layout and template files, as well as offer a refresher on correctly
5442 installing new LaTeX document classes.
5446 \begin_layout Standard
5447 First, let us a say a few words about how one ought to think about the relation
5448 between LyX and LaTeX.
5449 The thing to understand is that, in a certain sense, LyX doesn't know anything
5451 Indeed, from LyX's point of view, LaTeX is just one of several
5452 \begin_inset Quotes eld
5456 \begin_inset Quotes erd
5459 in which it is capable of producing output.
5460 Other such formats are DocBook, plaintext, and XHTML.
5461 LaTeX is, of course, a particularly important format, but very little of
5462 the information LyX has about LaTeX is actually contained in the program
5467 \begin_layout Plain Layout
5468 Some commands are sufficiently complex that they are
5469 \begin_inset Quotes eld
5473 \begin_inset Quotes erd
5477 But the developers generally regard this as a Bad Thing.
5482 Rather, that information, even for the standard classes like
5483 \begin_inset Flex Code
5486 \begin_layout Plain Layout
5492 , is contained in `layout files'.
5493 Similarly, LyX itself does not know much about DocBook or XHTML.
5494 What it knows is contained in layout files.
5497 \begin_layout Standard
5498 You can think of the layout file for a given document class as a translation
5499 manual between LyX constructs---paragraphs with their corresponding styles,
5500 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5502 Almost everything LyX knows about
5503 \begin_inset Flex Code
5506 \begin_layout Plain Layout
5512 , for example, is contained in the file
5513 \begin_inset Flex Code
5516 \begin_layout Plain Layout
5522 and in various other files it includes.
5523 For this reason, anyone intending to write layout files should plan to
5524 study the existing files.
5525 A good place to start is with
5526 \begin_inset Flex Code
5529 \begin_layout Plain Layout
5535 , which is included in
5536 \begin_inset Flex Code
5539 \begin_layout Plain Layout
5546 \begin_inset Flex Code
5549 \begin_layout Plain Layout
5555 , and many of the other layout files for document classes.
5556 This file is where sections and the like are defined:
5557 \begin_inset Flex Code
5560 \begin_layout Plain Layout
5566 tells LyX how paragraphs that are marked with the Section, Subsection,
5567 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5570 \begin_inset Flex Code
5573 \begin_layout Plain Layout
5579 file basically just includes several of these
5580 \begin_inset Flex Code
5583 \begin_layout Plain Layout
5592 \begin_layout Standard
5593 Defining the LyX--LaTeX correspondence is not the only thing layout files
5595 Their other job is to define how the LyX constructs themselves will appear
5597 The fact that layout files have these two jobs is often a source of confusion,
5598 because they are completely separate.
5599 Telling LyX how to translate a certain paragraph style into LaTeX does
5600 not tell LyX how to display it; conversely, telling LyX how to display
5601 a certain paragraph style does not tell LyX how to translate it into LaTeX
5602 (let alone tell LaTeX how to display it).
5603 So, in general, when you define a new LyX construct, you must always do
5604 two quite separate things: (i)
5605 \begin_inset space ~
5608 tell LyX how to translate it into LaTeX and (ii)
5609 \begin_inset space ~
5612 tell LyX how to display it.
5615 \begin_layout Standard
5616 Much the same is true, of course, as regards LyX's other backend formats,
5617 though XHTML is in some ways different, because in that case LyX
5621 able, to some extent, to use information about how it should display a
5622 paragraph on the screen to output information (in the form of CSS) about
5623 how the paragraph should be displayed in a browser.
5624 Even in this case, however, the distinction between what LyX does internally
5625 and how things are rendered externally remains in force, and the two can
5626 be controlled separately.
5628 \begin_inset CommandInset ref
5630 reference "sec:Tags-for-XHTML"
5637 \begin_layout Section
5638 Installing new LaTeX files
5641 \begin_layout Standard
5642 Some installations may not include a LaTeX package or class file that you
5643 would like to use within LyX.
5644 For example, you might need FoilTeX, a package for preparing slides for
5645 overhead projectors.
5646 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5647 a user interface for installing such packages.
5648 For example, with MiKTeX, you start the program
5649 \begin_inset Quotes eld
5653 \begin_inset space ~
5657 \begin_inset Quotes erd
5660 to get a list of available packages.
5661 To install one of them, right click on it or use the corresponding toolbar
5665 \begin_layout Standard
5666 If your LaTeX distribution does not provide such a `package manager', or
5667 if the package is not available from your distribution, then follow these
5668 steps to install it manually:
5671 \begin_layout Enumerate
5672 Get the package from
5673 \begin_inset CommandInset href
5676 target "http://www.ctan.org/"
5683 \begin_layout Enumerate
5684 If the package contains a file with the ending
5685 \begin_inset Quotes eld
5689 \begin_inset Flex Code
5692 \begin_layout Plain Layout
5699 \begin_inset Quotes erd
5702 (is the case for FoilTeX) then open a console, change to the folder of
5703 this file and execute the command
5704 \begin_inset Flex Code
5707 \begin_layout Plain Layout
5714 You have now unpacked the package and have all files to install it.
5715 Most LaTeX-packages are not packed and you can skip this step.
5718 \begin_layout Enumerate
5719 Now you need to decide if the package should be available for all users
5724 \begin_layout Enumerate
5725 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5726 for all users on your system, then install it in your `local' TeX tree,
5727 otherwise install it in your own `user' TeX tree.
5728 Where these trees should be created, if they do not already exist, depends
5730 To find this out, look in the file
5731 \begin_inset Flex Code
5734 \begin_layout Plain Layout
5744 \begin_layout Plain Layout
5745 This is usually in the directory
5746 \begin_inset Flex Code
5749 \begin_layout Plain Layout
5755 , though you can execute the command
5756 \begin_inset Flex Code
5759 \begin_layout Plain Layout
5770 The location of the `local' TeX tree is defined by the
5771 \begin_inset Flex Code
5774 \begin_layout Plain Layout
5780 variable; this is usually somewhere like
5781 \begin_inset Flex Code
5784 \begin_layout Plain Layout
5785 /usr/local/share/texmf
5791 The location of the `user' TeX tree is defined by
5792 \begin_inset Flex Code
5795 \begin_layout Plain Layout
5802 \begin_inset Flex Code
5805 \begin_layout Plain Layout
5812 (If these variables are not predefined, you have to define them.) You'll
5813 probably need root permissions to create or modify the `local' tree, but
5814 not for your `user' tree.
5815 \begin_inset Newline newline
5818 In general, it is recommended to install in the user tree because your user
5819 will not be modified or even overwritten when you upgrade your system.
5820 It will typically also be backed up together with everything else when
5821 you backup your home directory (which, of course, you do on a regular basis).
5824 \begin_layout Enumerate
5825 On Windows, if you want the new package to be available for all users on
5826 your system, change to the folder where LaTeX is installed and then change
5828 \begin_inset Flex Code
5831 \begin_layout Plain Layout
5842 (For MiKTeX, this would be by default the folder
5843 \begin_inset Flex Code
5846 \begin_layout Plain Layout
5864 \begin_layout Plain Layout
5865 Note that this will be the correct path only on English installations.
5866 On a German one, it would be
5867 \begin_inset Flex Code
5870 \begin_layout Plain Layout
5884 , and similarly for other languages.
5889 Create there a new folder
5890 \begin_inset Flex Code
5893 \begin_layout Plain Layout
5899 and copy all files of the package into it.
5901 \begin_inset Newline newline
5904 If the package should only available for you or you don't have admin permissions
5905 , do the same, but in the local LaTeX folder.
5907 \begin_inset space \thinspace{}
5911 \begin_inset space ~
5914 2.8 under Windows XP, this would be the folder:
5915 \begin_inset Newline newline
5921 \begin_inset Flex Code
5924 \begin_layout Plain Layout
5927 Documents and Settings
5939 \begin_inset Newline newline
5945 \begin_inset Phantom HPhantom
5948 \begin_layout Plain Layout
5959 \begin_inset Flex Code
5962 \begin_layout Plain Layout
5975 \begin_inset Newline newline
5978 On Vista, it would be:
5979 \begin_inset Newline newline
5983 \begin_inset Flex Code
5986 \begin_layout Plain Layout
6012 \begin_layout Enumerate
6013 Now one only need to tell LaTeX that there are new files.
6014 This depends on the used LaTeX-Distribution:
6018 \begin_layout Enumerate
6019 For TeXLive execute the command
6020 \begin_inset Flex Code
6023 \begin_layout Plain Layout
6030 If you installed the package for all users, then you will probably need
6031 to have root permissions for that.
6034 \begin_layout Enumerate
6035 For MiKTeX, if you have installed the package for all users, start the program
6037 \begin_inset Quotes eld
6041 \begin_inset space ~
6045 \begin_inset Quotes erd
6048 and press the button marked
6049 \begin_inset Quotes eld
6053 \begin_inset Quotes erd
6057 Otherwise start the program
6058 \begin_inset Quotes eld
6062 \begin_inset Quotes erd
6069 \begin_layout Enumerate
6070 Finally, you need to tell LyX that there are new packages available.
6071 So, in LyX, use the menu
6072 \begin_inset Flex MenuItem
6075 \begin_layout Plain Layout
6078 \SpecialChar \menuseparator
6084 and then restart LyX.
6087 \begin_layout Standard
6088 Now the package is installed.
6089 In our example, the document class
6090 \begin_inset Flex Code
6093 \begin_layout Plain Layout
6095 \begin_inset space ~
6102 \begin_layout Plain Layout
6114 will now be available under
6115 \begin_inset Flex MenuItem
6118 \begin_layout Plain Layout
6119 Document\SpecialChar \menuseparator
6120 Settings\SpecialChar \menuseparator
6130 \begin_layout Standard
6131 If you would like to use a LaTeX document class that is not even listed
6133 \begin_inset Flex MenuItem
6136 \begin_layout Plain Layout
6137 Document\SpecialChar \menuseparator
6138 Settings\SpecialChar \menuseparator
6144 , then you need to create a `layout' file for it.
6145 That is the topic of the next section.
6148 \begin_layout Section
6149 Types of layout files
6152 \begin_layout Standard
6153 This section describes the various sorts of LyX files that contain layout
6155 These files describe various paragraph and character styles, determining
6156 how LyX should display them and how they should be translated into LaTeX,
6157 DocBook, XHTML, or whatever output format is being used.
6161 \begin_layout Standard
6162 We shall try to provide a thorough description of the process of writing
6164 However, there are so many different types of documents supported even
6165 by just LaTeX that we can't hope to cover every different possibility or
6166 problem you might encounter.
6167 The LyX users' list is frequented by people with lots of experience with
6168 layout design who are willing to share what they've learned, so please
6169 feel free to ask questions there.
6172 \begin_layout Standard
6173 As you prepare to write a new layout, it is extremely helpful to look at
6174 the layouts distributed with LyX.
6175 If you write a LyX layout for a LaTeX document class that might also be
6176 used by others, or write a module that might be useful to others, then
6177 you should consider posting your layout to the
6178 \begin_inset CommandInset href
6180 name "layout section on the LyX wiki"
6181 target "http://wiki.lyx.org/Layouts/Layouts"
6185 or even to the LyX developers' list, so that it might be included in LyX
6190 \begin_layout Plain Layout
6191 Note that LyX is licensed under the General Public License, so any material
6192 that is contributed to LyX must be similarly licensed.
6200 \begin_layout Subsection
6202 \begin_inset CommandInset label
6204 name "sub:Layout-modules"
6211 \begin_layout Standard
6212 We have spoken to this point about `layout files'.
6213 But there are different sorts of files that contain layout information.
6214 Layout files, strictly so called, have the
6215 \begin_inset Flex Code
6218 \begin_layout Plain Layout
6224 extension and provide LyX with information about document classes.
6225 As of LyX 1.6, however, layout information can also be contained in layout
6231 \begin_inset Flex Code
6234 \begin_layout Plain Layout
6241 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6242 some modules—such as the
6243 \begin_inset Flex Code
6246 \begin_layout Plain Layout
6252 module—specifically provide support for one package.
6253 In a sense, layout modules are similar to included
6257 \begin_layout Plain Layout
6258 These can have any extension, but by convention have the
6259 \begin_inset Flex Code
6262 \begin_layout Plain Layout
6274 \begin_inset Flex Code
6277 \begin_layout Plain Layout
6283 —in that modules are not specific to a given document class but may be used
6284 with many different classes.
6285 The difference is that using an included file with
6286 \begin_inset Flex Code
6289 \begin_layout Plain Layout
6295 requires editing that file.
6296 Modules, by contrast, are selected in the
6297 \begin_inset Flex MenuItem
6300 \begin_layout Plain Layout
6301 Document\SpecialChar \menuseparator
6310 \begin_layout Standard
6311 Building modules is the easiest way to get started with layout editing,
6312 since it can be as simple as adding a single new paragraph style or flex
6314 But modules may, in principle, contain anything a layout file can contain.
6317 \begin_layout Standard
6318 After creating a new module and copying it to the
6319 \begin_inset Flex Code
6322 \begin_layout Plain Layout
6328 folder, you will need to reconfigure and then restart LyX for the module
6329 to appear in the menu.
6330 However, changes you make to the module will be seen immediately, if you
6332 \begin_inset Flex MenuItem
6335 \begin_layout Plain Layout
6336 Document\SpecialChar \menuseparator
6342 , highlight something, and then hit
6343 \begin_inset Quotes eld
6347 \begin_inset Quotes erd
6353 It is strongly recommended that you save your work before doing this
6358 it is strongly recommended that you not attempt to edit modules while simultaneo
6359 usly working on actual documents
6362 Though of course the developers strive to keep LyX stable in such situations,
6363 syntax errors and the like in your module file could cause strange behavior.
6366 \begin_layout Subsubsection
6370 \begin_layout Standard
6371 Modules are to LyX as packages are to LaTeX.
6372 Sometimes, however, you find yourself wanting a specific inset or character
6373 style just for one document and writing a module that will also be available
6374 to other documents makes little sense.
6375 What you need is LyX's
6376 \begin_inset Quotes eld
6380 \begin_inset Quotes erd
6386 \begin_layout Standard
6387 You will find it under
6389 Document\SpecialChar \menuseparator
6390 Settings\SpecialChar \menuseparator
6394 The large text box allows you to enter anything that you might enter in
6395 a layout file or module.
6396 You can think of a document's local layout, in fact, as a module that belongs
6398 So, in particular, you must enter a
6399 \begin_inset Flex Code
6402 \begin_layout Plain Layout
6409 Any format is acceptable, but one would normally use the format current
6411 (In LyX 2.0, the current layout format is 35.) You should be aware that local
6412 layout is not supported by versions of LyX prior to 1.6, so you should not
6413 use it if you want to be able to export your document to LyX 1.5 or earlier
6414 (without, that is, losing the local layout information).
6415 If you wish to be able to export to 1.6---local layout is supported in 1.6,
6416 though there is no UI for it---then you should use format 11 and, of course,
6417 use only layout constructs that were available in LyX 1.6.
6420 \begin_layout Standard
6421 When you have entered something in the
6422 \begin_inset Flex Code
6425 \begin_layout Plain Layout
6431 pane, LyX will enable the
6432 \begin_inset Quotes eld
6436 \begin_inset Quotes erd
6439 button at the bottom.
6440 Clicking this button will cause LyX to determine whether what you have
6441 entered is valid layout information for the chosen format.
6442 LyX will report the result but, unfortunately, will not tell you what errors
6443 there might have been.
6444 These will be written to the terminal, however, if LyX is started from
6446 You will not be permitted to save your local layout until you have entered
6450 \begin_layout Standard
6451 The warnings at the end of the previous section apply here, too.
6452 Do not play with local layout while you are actually working, especially
6453 if you have not saved your document.
6454 That said, using local layout with a test document can be a very convenient
6455 way to try out layout ideas, or even to start developing a module.
6458 \begin_layout Subsection
6460 \begin_inset Flex MenuItem
6463 \begin_layout Plain Layout
6472 \begin_layout Standard
6473 There are two situations you are likely to encounter when wanting to support
6474 a new LaTeX document class, involving style (
6475 \begin_inset Flex Code
6478 \begin_layout Plain Layout
6484 ) files and LaTeX2e class (
6485 \begin_inset Flex Code
6488 \begin_layout Plain Layout
6495 Supporting a style file is usually fairly easy.
6496 Supporting a new class file is a bit harder.
6497 We'll discuss the former in this section and the latter in the next.
6498 Similar remarks apply, of course, if you want to support a new DocBook
6502 \begin_layout Standard
6503 The easier case is the one in which your new document class is provided
6504 as a style file that is to be used in conjunction with an already supported
6506 For the sake of the example, we'll assume that the style file is called
6508 \begin_inset Flex MenuItem
6511 \begin_layout Plain Layout
6517 and that it is meant to be used with
6518 \begin_inset Flex MenuItem
6521 \begin_layout Plain Layout
6527 , which is a standard class.
6531 \begin_layout Standard
6532 Start by copying the existing class's layout file into your local directory:
6536 \begin_layout Plain Layout
6537 Of course, which directory is your local directory will vary by platform,
6538 and LyX allows you to specify your local directory on startup, too, using
6540 \begin_inset Flex Code
6543 \begin_layout Plain Layout
6557 \begin_layout LyX-Code
6558 cp report.layout ~/.lyx/layouts/myclass.layout
6561 \begin_layout Standard
6563 \begin_inset Flex Code
6566 \begin_layout Plain Layout
6572 and change the line:
6575 \begin_layout LyX-Code
6578 DeclareLaTeXClass{report}
6581 \begin_layout Standard
6585 \begin_layout LyX-Code
6588 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6591 \begin_layout Standard
6595 \begin_layout LyX-Code
6597 \begin_inset Newline newline
6603 \begin_inset Newline newline
6609 \begin_layout Standard
6610 near the top of the file.
6613 \begin_layout Standard
6614 Start LyX and select
6615 \begin_inset Flex MenuItem
6618 \begin_layout Plain Layout
6619 Tools\SpecialChar \menuseparator
6626 Then restart LyX and try creating a new document.
6628 \begin_inset Flex MenuItem
6631 \begin_layout Plain Layout
6637 " as a document class option in the
6638 \begin_inset Flex MenuItem
6641 \begin_layout Plain Layout
6642 Document\SpecialChar \menuseparator
6649 It is likely that some of the sectioning commands and such in your new
6650 class will work differently from how they worked in the base class—
6651 \begin_inset Flex Code
6654 \begin_layout Plain Layout
6660 in this example—so you can fiddle around with the settings for the different
6661 sections if you wish.
6662 The layout information for sections is contained in
6663 \begin_inset Flex Code
6666 \begin_layout Plain Layout
6672 , but you do not need to copy and change this file.
6673 Instead, you can simply add your changes to your layout file, after the
6675 \begin_inset Flex Code
6678 \begin_layout Plain Layout
6684 , which itself includes
6685 \begin_inset Flex Code
6688 \begin_layout Plain Layout
6695 For example, you might add these lines:
6698 \begin_layout LyX-Code
6702 \begin_layout LyX-Code
6706 \begin_layout LyX-Code
6710 \begin_layout LyX-Code
6714 \begin_layout LyX-Code
6718 \begin_layout Standard
6719 to change the font for chapter headings to sans-serif.
6720 This will override (or, in this case, add to) the existing declaration
6721 for the Chapter style.
6725 \begin_layout Standard
6726 Your new package may also provide commands or environments not present in
6728 In this case, you will want to add these to the layout file.
6730 \begin_inset CommandInset ref
6732 reference "sec:TextClass"
6736 for information on how to do so.
6739 \begin_layout Standard
6741 \begin_inset Flex MenuItem
6744 \begin_layout Plain Layout
6750 can be used with several different document classes, and even if it cannot,
6751 you might find it easiest just to write a module that you can load with
6753 The simplest possible such module would be:
6756 \begin_layout LyX-Code
6759 DeclareLyXModule{My Package}
6762 \begin_layout LyX-Code
6766 \begin_layout LyX-Code
6767 #Support for mypkg.sty.
6770 \begin_layout LyX-Code
6772 \begin_inset Newline newline
6778 \begin_layout LyX-Code
6780 \begin_inset Newline newline
6786 \begin_layout LyX-Code
6788 \begin_inset Newline newline
6794 \begin_inset Newline newline
6800 \begin_layout Standard
6801 A more complex module might modify the behavior of some existing constructs
6802 or define some new ones.
6804 \begin_inset CommandInset ref
6806 reference "sec:TextClass"
6813 \begin_layout Subsection
6815 \begin_inset Flex MenuItem
6818 \begin_layout Plain Layout
6827 \begin_layout Standard
6828 There are two possibilities here.
6829 One is that the class file is itself based upon an existing document class.
6830 For example, many thesis classes are based upon
6831 \begin_inset Flex MenuItem
6834 \begin_layout Plain Layout
6841 To see whether yours is, look for a line like
6844 \begin_layout LyX-Code
6850 \begin_layout Standard
6852 If so, then you may proceed largely as in the previous section, though
6854 \begin_inset Flex Code
6857 \begin_layout Plain Layout
6863 line will be different.
6864 If your new class is
6865 \begin_inset Flex Code
6868 \begin_layout Plain Layout
6874 and it is based upon
6875 \begin_inset Flex Code
6878 \begin_layout Plain Layout
6884 , then the line should read:
6888 \begin_layout Plain Layout
6889 And it will be easiest if you save the file to
6890 \begin_inset Flex Code
6893 \begin_layout Plain Layout
6899 : LyX assumes that the document class has the same name as the layout file.
6908 \begin_layout LyX-Code
6911 DeclareLaTeXClass[thesis,book]{thesis}
6914 \begin_layout Standard
6915 If, on the other hand, the new class is not based upon an existing class,
6916 you will probably have to
6917 \begin_inset Quotes eld
6921 \begin_inset Quotes erd
6925 We strongly suggest copying an existing layout file which uses a similar
6926 LaTeX class and then modifying it, if you can do so.
6927 At least use an existing file as a starting point so you can find out what
6928 items you need to worry about.
6929 Again, the specifics are covered below.
6932 \begin_layout Subsection
6934 \begin_inset CommandInset label
6936 name "sub:Creating-Templates"
6943 \begin_layout Standard
6944 Once you have written a layout file for a new document class, you might
6945 want to consider writing a
6950 A template acts as a kind of tutorial for your layout, showing how it might
6951 be used, though containing dummy content.
6952 You can of course look at the various templates included with LyX for ideas.
6955 \begin_layout Standard
6956 Templates are created just like usual documents: using LyX.
6957 The only difference is that usual documents contain all possible settings,
6958 including the font scheme and the paper size.
6959 Usually a user doesn't want a template to overwrite his preferred settings
6960 for such parameters.
6961 For that reason, the designer of a template should remove the corresponding
6963 \begin_inset Flex Code
6966 \begin_layout Plain Layout
6975 \begin_inset Flex Code
6978 \begin_layout Plain Layout
6986 from the template LyX file.
6987 This can be done with any simple text-editor, for example
6988 \begin_inset Flex Code
6991 \begin_layout Plain Layout
6998 \begin_inset Flex Code
7001 \begin_layout Plain Layout
7011 \begin_layout Standard
7012 Put the edited template files you create in
7013 \begin_inset Flex Code
7016 \begin_layout Plain Layout
7022 , copy the ones you use from the global template directory in
7023 \begin_inset Flex Code
7026 \begin_layout Plain Layout
7032 to the same place, and redefine the template path in the
7033 \begin_inset Flex MenuItem
7036 \begin_layout Plain Layout
7037 Tools\SpecialChar \menuseparator
7038 Preferences\SpecialChar \menuseparator
7047 \begin_layout Standard
7048 Note, by the way, that there is a template which has a particular meaning:
7050 \begin_inset Flex Code
7053 \begin_layout Plain Layout
7060 This template is loaded every time you create a new document with
7061 \begin_inset Flex MenuItem
7064 \begin_layout Plain Layout
7065 File\SpecialChar \menuseparator
7071 in order to provide useful defaults.
7072 To create this template from inside LyX, all you have to do is to open
7073 a document with the correct settings, and use the
7074 \begin_inset Flex MenuItem
7077 \begin_layout Plain Layout
7078 Save as Document Defaults
7086 \begin_layout Subsection
7087 Upgrading old layout files
7090 \begin_layout Standard
7091 The format of layout files changes with each LyX release, so old layout
7092 files need to be converted to the new format.
7093 This process has been automated since LyX 1.4: If LyX reads a layout file
7094 in an older format, it automatically calls the script
7095 \begin_inset Flex Code
7098 \begin_layout Plain Layout
7104 to convert it to a temporary file in current format.
7105 The original file is left untouched.
7106 If you use the layout file often, then, you may want to convert it permanently,
7107 so that LyX does not have to do so itself every time.
7108 To do this, you can call the converter manually:
7111 \begin_layout LyX-Code
7112 mv myclass.layout myclass.old
7115 \begin_layout LyX-Code
7116 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
7119 \begin_layout Standard
7121 \begin_inset Flex Code
7124 \begin_layout Plain Layout
7130 with the name of your LyX system directory, of course.
7133 \begin_layout Standard
7134 Note that manual conversion does not affect included files, so these will
7135 have to be converted separately.
7138 \begin_layout Section
7139 \begin_inset CommandInset label
7141 name "sec:TextClass"
7145 The layout file format
7148 \begin_layout Standard
7149 When it's finally time to get your hands dirty and create or edit your own
7150 layout file, the following sections describe what you're up against.
7151 Our advice is to go slowly, save and test often, listen to soothing music,
7152 and enjoy one or two of your favorite adult beverages; more if you are
7153 getting particularly stuck.
7154 It's really not that hard, except that the multitude of options can become
7155 overwhelming if you try to do too much in one sitting.
7156 Go have another adult beverage, just for good measure.
7159 \begin_layout Standard
7160 Note that all the tags used in layout files are case-insensitive.
7162 \begin_inset Flex Code
7165 \begin_layout Plain Layout
7172 \begin_inset Flex Code
7175 \begin_layout Plain Layout
7182 \begin_inset Flex Code
7185 \begin_layout Plain Layout
7191 are really the same tag.
7192 The possible values are printed in brackets after the feature's name.
7193 The default value if a feature isn't specified inside a text class-description
7195 \begin_inset Flex Code
7198 \begin_layout Plain Layout
7207 If the argument has a data type like
7208 \begin_inset Quotes eld
7212 \begin_inset Quotes erd
7216 \begin_inset Quotes eld
7220 \begin_inset Quotes erd
7223 , the default is shown like this:
7224 \begin_inset Flex Code
7227 \begin_layout Plain Layout
7238 \begin_layout Subsection
7239 The document class declaration
7240 \change_inserted -712698321 1349766602
7246 \begin_layout Standard
7247 Lines in a layout file which begin with
7248 \begin_inset Flex Code
7251 \begin_layout Plain Layout
7258 There is one exception to this rule.
7260 \begin_inset Flex Code
7263 \begin_layout Plain Layout
7269 files should begin with
7270 \change_deleted -712698321 1349766533
7274 \change_inserted -712698321 1349766536
7280 \begin_layout LyX-Code
7283 #% Do not delete the line below; configure depends on this
7286 \begin_layout LyX-Code
7292 \change_deleted -712698321 1349766193
7294 \change_inserted -712698321 1349766201
7295 Article (Standard Class)
7298 \change_inserted -712698321 1349766538
7302 \begin_layout LyX-Code
7304 \change_inserted -712698321 1349766581
7309 DeclareCategory{Articles}
7314 \begin_layout Standard
7316 \change_inserted -712698321 1349766695
7320 \change_inserted -712698321 1349766626
7324 \change_deleted -712698321 1349766628
7326 \change_inserted -712698321 1349766628
7329 used when you (re)configure LyX.
7330 The layout file is read by the LaTeX script
7331 \begin_inset Flex Code
7334 \begin_layout Plain Layout
7340 , in a special mode where
7341 \begin_inset Flex Code
7344 \begin_layout Plain Layout
7351 The first line is just a LaTeX comment,
7352 \change_deleted -712698321 1349766656
7355 the second one contains the
7356 \change_inserted -712698321 1349766650
7359 declaration of the text class
7360 \change_inserted -712698321 1349766689
7361 , and the third line contains the optional classification of the class
7364 If these lines appear in a file named
7365 \begin_inset Flex Code
7368 \begin_layout Plain Layout
7374 , then they define a text class of name
7375 \begin_inset Flex Code
7378 \begin_layout Plain Layout
7384 (the name of the layout file) which uses the LaTeX document class
7385 \begin_inset Flex Code
7388 \begin_layout Plain Layout
7394 (the default is to use the same name as the layout).
7396 \begin_inset Quotes eld
7400 \change_deleted -712698321 1349766253
7402 \change_inserted -712698321 1349766260
7403 Article (Standard Class)
7406 \begin_inset Quotes erd
7409 that appears above is used as a description of the text class in the
7410 \begin_inset Flex MenuItem
7413 \begin_layout Plain Layout
7414 Document\SpecialChar \menuseparator
7422 \change_inserted -712698321 1349767097
7424 \begin_inset Quotes eld
7428 \begin_inset Quotes erd
7431 in the example) is also used in the
7432 \begin_inset Flex MenuItem
7435 \begin_layout Plain Layout
7437 \change_inserted -712698321 1349766801
7438 Document\SpecialChar \menuseparator
7444 dialog: the text classes are grouped by these categories (which are usually
7445 genres, so typical categories are
7446 \begin_inset Quotes eld
7450 \begin_inset Quotes erd
7454 \begin_inset Quotes eld
7458 \begin_inset Quotes erd
7462 \begin_inset Quotes eld
7466 \begin_inset Quotes erd
7470 \begin_inset Quotes eld
7474 \begin_inset Quotes erd
7478 \begin_inset Quotes eld
7482 \begin_inset Quotes erd
7486 \begin_inset Quotes eld
7490 \begin_inset Quotes erd
7494 If no category has been declared, the class will be put in the
7495 \begin_inset Quotes eld
7499 \begin_inset Quotes erd
7507 \begin_layout Standard
7508 Let's assume that you wrote your own text class that uses the
7509 \begin_inset Flex Code
7512 \begin_layout Plain Layout
7518 document class, but where you changed the appearance of the section headings.
7519 If you put it in a file
7520 \begin_inset Flex Code
7523 \begin_layout Plain Layout
7529 , the header of this file should be:
7532 \begin_layout LyX-Code
7535 #% Do not delete the line below; configure depends on this
7538 \begin_layout LyX-Code
7543 DeclareLaTeXClass[article]{
7544 \change_deleted -712698321 1349766303
7546 \change_inserted -712698321 1349766303
7550 \change_deleted -712698321 1349766338
7552 \change_inserted -712698321 1349766338
7556 \change_deleted -712698321 1349766340
7558 \change_inserted -712698321 1349766340
7562 \change_deleted -712698321 1349766343
7564 \change_inserted -712698321 1349766343
7568 \change_inserted -712698321 1349767223
7572 \begin_layout LyX-Code
7574 \change_inserted -712698321 1349767223
7579 DeclareCategory{Articles}
7584 \begin_layout Standard
7585 This declares a text class
7586 \begin_inset Flex Code
7589 \begin_layout Plain Layout
7595 , associated with the LaTeX document class
7596 \begin_inset Flex Code
7599 \begin_layout Plain Layout
7606 \begin_inset Quotes eld
7610 \change_deleted -712698321 1349766329
7612 \change_inserted -712698321 1349766329
7616 \change_deleted -712698321 1349766347
7618 \change_inserted -712698321 1349766347
7622 \change_deleted -712698321 1349766350
7624 \change_inserted -712698321 1349766350
7628 \change_deleted -712698321 1349766352
7630 \change_inserted -712698321 1349766352
7634 \begin_inset Quotes erd
7638 If your text class depends on several packages, you can declare it as:
7641 \begin_layout LyX-Code
7644 #% Do not delete the line below; configure depends on this
7647 \begin_layout LyX-Code
7652 DeclareLaTeXClass[article,foo.sty]{
7653 \change_deleted -712698321 1349766366
7655 \change_inserted -712698321 1349766366
7659 \change_deleted -712698321 1349766369
7661 \change_inserted -712698321 1349766369
7665 \change_deleted -712698321 1349766371
7667 \change_inserted -712698321 1349766371
7671 \change_deleted -712698321 1349766374
7673 \change_inserted -712698321 1349766374
7677 \change_inserted -712698321 1349767240
7681 \begin_layout LyX-Code
7683 \change_inserted -712698321 1349767240
7688 DeclareCategory{Articles}
7693 \begin_layout Standard
7694 This indicates that your text class uses the
7695 \begin_inset Flex Code
7698 \begin_layout Plain Layout
7705 Finally, it is also possible to declare classes for DocBook code.
7706 Typical declarations will look like:
7709 \begin_layout LyX-Code
7712 #% Do not delete the line below; configure depends on this
7715 \begin_layout LyX-Code
7720 DeclareDocBookClass[article]{SGML (DocBook
7721 \change_deleted -712698321 1349766387
7723 \change_inserted -712698321 1349766387
7727 \change_inserted -712698321 1349767247
7731 \begin_layout LyX-Code
7733 \change_inserted -712698321 1349767302
7738 DeclareCategory{Articles (DocBook)}
7743 \begin_layout Standard
7744 Note that these declarations can also be given an optional parameter declaring
7745 the name of the document class (but not a list).
7748 \begin_layout Standard
7749 So, to be as explicit as possible, the form of the layout declaration is:
7752 \begin_layout LyX-Code
7757 DeclareLaTeXClass[class,package.sty]{layout description}
7758 \change_inserted -712698321 1349767329
7762 \begin_layout LyX-Code
7764 \change_inserted -712698321 1349767339
7769 DeclareCategory{category}
7774 \begin_layout Standard
7775 The class need only be specified if the name of the LaTeX class file and
7776 the name of the layout file are different or if there are packages to load.
7777 If the name of the class file is not specified, then LyX will simply assume
7778 that it is the same as the name of the layout file.
7781 \begin_layout Standard
7782 When the text class has been modified to your taste, all you have to do
7783 is to copy it either to
7784 \begin_inset Flex Code
7787 \begin_layout Plain Layout
7794 \begin_inset Flex Code
7797 \begin_layout Plain Layout
7804 \begin_inset Flex MenuItem
7807 \begin_layout Plain Layout
7808 Tools\SpecialChar \menuseparator
7814 , exit LyX and restart.
7815 Then your new text class should be available along with the others.
7818 \begin_layout Standard
7819 Once the layout file is installed, you can edit it and see your changes
7820 without having to reconfigure or to restart LyX.
7825 \begin_layout Plain Layout
7826 In versions of LyX prior to 1.6, this was not true.
7827 As a result, editing layout files was very time consuming, since you had
7828 constantly to restart LyX to see changes.
7833 You can force a reload of the current layout by using the LyX function
7835 \begin_inset Flex MenuItem
7838 \begin_layout Plain Layout
7845 There is no default binding for this function—though, of course, you can
7846 bind it to a key yourself.
7847 But you will normally use this function simply by entering it in the mini-buffe
7852 \begin_layout Standard
7858 \begin_inset Flex MenuItem
7861 \begin_layout Plain Layout
7867 is very much an `advanced feature'.
7872 recommended that you save your work before using this function.
7877 recommended that you not attempt to edit layout information while simultaneousl
7878 y working on a document that you care about.
7879 Use a test document.
7880 Syntax errors and the like in your layout file could cause peculiar behavior.
7881 In particular, such errors could cause LyX to regard the current layout
7882 as invalid and to attempt to switch to some other layout.
7886 \begin_layout Plain Layout
7887 Really bad syntax errors may even caused LyX to exit.
7888 This is because certain sorts of errors may make LyX unable to read
7898 The LyX team strives to keep LyX stable in such situations, but safe is
7903 \begin_layout Plain Layout
7904 While we're giving advice: make regular backups.
7905 And be nice to your mother.
7913 \begin_layout Subsection
7914 The Module declaration
7917 \begin_layout Standard
7918 A module must begin with a line like the following:
7921 \begin_layout LyX-Code
7924 DeclareLyXModule[endnotes.sty]{Endnotes}
7927 \begin_layout Standard
7928 The mandatory argument, in curly brackets, is the name of the module, as
7930 \begin_inset Flex MenuItem
7933 \begin_layout Plain Layout
7934 Document\SpecialChar \menuseparator
7935 Settings\SpecialChar \menuseparator
7942 The argument in square brackets is optional: It declares any LaTeX packages
7943 on which the module depends.
7944 Please note that only packages about which LyX knows should be listed in
7945 the square brackets.
7949 \begin_layout Plain Layout
7950 The list of such packages is documented only in the source code.
7955 LyX will not check for arbitrary packages.
7956 It is also possible to use the form
7957 \begin_inset Flex MenuItem
7960 \begin_layout Plain Layout
7966 as an optional argument, which declares that the module can only be used
7967 when there exists a conversion chain between the formats `
7968 \begin_inset Flex Code
7971 \begin_layout Plain Layout
7978 \begin_inset Flex Code
7981 \begin_layout Plain Layout
7990 \begin_layout Standard
7991 The module declaration should then be followed by lines like the following
7995 \begin_layout Plain Layout
7996 Preferably in English if the module should be published with LyX.
7997 This description will appear in the list of messages to be translated and
7998 will be thus translated with the next interface update.
8006 \begin_layout LyX-Code
8010 \begin_layout LyX-Code
8011 #Adds an endnote command, in addition to footnotes.
8015 \begin_layout LyX-Code
8016 #You will need to add
8018 theendnotes in TeX code where you
8021 \begin_layout LyX-Code
8022 #want the endnotes to appear.
8026 \begin_layout LyX-Code
8030 \begin_layout LyX-Code
8031 #Requires: somemodule | othermodule
8034 \begin_layout LyX-Code
8035 #Excludes: badmodule
8038 \begin_layout Standard
8039 The description is used in
8040 \begin_inset Flex MenuItem
8043 \begin_layout Plain Layout
8044 Document\SpecialChar \menuseparator
8045 Settings\SpecialChar \menuseparator
8051 to provide the user with information about what the module does.
8053 \begin_inset Flex Code
8056 \begin_layout Plain Layout
8062 line is used to identify other modules with which this one must be used;
8064 \begin_inset Flex Code
8067 \begin_layout Plain Layout
8073 line is used to identify modules with which this one may not be used.
8074 Both are optional, and, as shown, multiple modules should be separated
8075 with the pipe symbol: |.
8076 Note that the required modules are treated disjunctively:
8080 of the required modules must be used.
8085 excluded module may be used.
8086 Note that modules are identified here by their
8091 \begin_inset Flex Code
8094 \begin_layout Plain Layout
8102 \begin_inset Flex Code
8105 \begin_layout Plain Layout
8112 \begin_inset Flex Code
8115 \begin_layout Plain Layout
8124 \begin_layout Subsection
8128 \begin_layout Standard
8129 The first non-comment line of any layout file, included file, or module
8134 contain the file format number:
8137 \begin_layout Description
8138 \begin_inset Flex Code
8141 \begin_layout Plain Layout
8148 \begin_inset Flex Code
8151 \begin_layout Plain Layout
8157 ] The format of the layout file.
8160 \begin_layout Standard
8161 This tag was introduced with LyX 1.4.0.
8162 Layout files from LyX 1.3.x and earlier don't have an explicit file format
8163 and are considered to be of format 1.
8164 The format for the present version of LyX is format 21.
8165 But each version of LyX is capable of reading earlier versions' layout
8166 files, just as they are capable of reading files produced by earlier versions
8168 There is, however, no provision for converting to earlier formats.
8169 So LyX 1.6.x will not read layout files in format 21 but only files in format
8173 \begin_layout Subsection
8174 \begin_inset CommandInset label
8176 name "sub:General-text-class"
8180 General text class parameters
8183 \begin_layout Standard
8184 These are general parameters that govern the behavior of an entire document
8190 mean that they must appear in
8191 \begin_inset Flex Code
8194 \begin_layout Plain Layout
8200 files rather than in modules.
8201 A module can contain any layout tag.)
8204 \begin_layout Description
8205 \begin_inset Flex Code
8208 \begin_layout Plain Layout
8214 Adds information that will be output in the
8215 \begin_inset Flex Code
8218 \begin_layout Plain Layout
8224 block when this document class is output to XHTML.
8225 Typically, this would be used to output CSS style information, but it can
8226 be used for anything that can appear in
8227 \begin_inset Flex Code
8230 \begin_layout Plain Layout
8238 \begin_inset Quotes eld
8242 \begin_inset Flex Code
8245 \begin_layout Plain Layout
8252 \begin_inset Quotes erd
8258 \begin_layout Description
8259 \begin_inset Flex Code
8262 \begin_layout Plain Layout
8268 Adds CSS styling information.
8269 This will either be output in a
8270 \begin_inset Quotes eld
8274 \begin_inset Flex Code
8277 \begin_layout Plain Layout
8284 \begin_inset Quotes erd
8287 block or, if the user has so chosen, to a separate CSS file.Must end with
8289 \begin_inset Quotes eld
8293 \begin_inset Flex Code
8296 \begin_layout Plain Layout
8303 \begin_inset Quotes erd
8309 \begin_layout Description
8310 \begin_inset Flex Code
8313 \begin_layout Plain Layout
8319 Adds information to the document preamble.
8321 \begin_inset Quotes eld
8325 \begin_inset Flex Code
8328 \begin_layout Plain Layout
8335 \begin_inset Quotes erd
8341 \begin_layout Description
8342 \begin_inset Flex Code
8345 \begin_layout Plain Layout
8351 Defines formats for use in the display of bibliographic information.
8353 \begin_inset CommandInset ref
8355 reference "sub:Citation-format-description"
8361 \begin_inset Quotes eld
8365 \begin_inset Flex Code
8368 \begin_layout Plain Layout
8375 \begin_inset Quotes erd
8381 \begin_layout Description
8382 \begin_inset Flex Code
8385 \begin_layout Plain Layout
8391 Describes various global options supported by the document class.
8393 \begin_inset space ~
8397 \begin_inset CommandInset ref
8399 reference "sub:ClassOptions"
8405 \begin_inset Quotes eld
8409 \begin_inset Flex Code
8412 \begin_layout Plain Layout
8419 \begin_inset Quotes erd
8425 \begin_layout Description
8426 \begin_inset Flex Code
8429 \begin_layout Plain Layout
8436 \begin_inset Flex Code
8439 \begin_layout Plain Layout
8448 \begin_inset Flex Code
8451 \begin_layout Plain Layout
8457 ] Whether the class should
8461 to having one or two columns.
8462 Can be changed in the
8463 \begin_inset Flex MenuItem
8466 \begin_layout Plain Layout
8467 Document\SpecialChar \menuseparator
8476 \begin_layout Description
8477 \begin_inset Flex Code
8480 \begin_layout Plain Layout
8487 \begin_inset Flex Code
8490 \begin_layout Plain Layout
8496 ] This sequence defines the properties for a counter.
8497 If the counter does not yet exist, it is created; if it does exist, it
8500 \begin_inset Quotes eld
8504 \begin_inset Flex Code
8507 \begin_layout Plain Layout
8514 \begin_inset Quotes erd
8518 \begin_inset Newline newline
8522 \begin_inset space ~
8526 \begin_inset CommandInset ref
8528 reference "sub:Counters"
8532 for details on counters.
8535 \begin_layout Description
8536 \begin_inset Flex Code
8539 \begin_layout Plain Layout
8545 Sets the default font used to display the document.
8547 \begin_inset space ~
8551 \begin_inset CommandInset ref
8553 reference "sub:Font-description"
8557 for how to declare fonts.
8559 \begin_inset Quotes eld
8563 \begin_inset Flex Code
8566 \begin_layout Plain Layout
8573 \begin_inset Quotes erd
8579 \begin_layout Description
8580 \begin_inset Flex Code
8583 \begin_layout Plain Layout
8590 \begin_inset Flex Code
8593 \begin_layout Plain Layout
8599 Specifies a module to be included by default with this document class.
8600 The module should be specified by filename without the
8601 \begin_inset Flex Code
8604 \begin_layout Plain Layout
8611 The user can still remove the module, but it will be active at the outset.
8612 (This applies only when new files are created, or when this class is chosen
8613 for an existing document.)
8616 \begin_layout Description
8617 \begin_inset Flex Code
8620 \begin_layout Plain Layout
8627 \begin_inset Flex Code
8630 \begin_layout Plain Layout
8636 ] This is the style that will be assigned to new paragraphs, usually
8637 \begin_inset Flex MenuItem
8640 \begin_layout Plain Layout
8647 This will default to the first defined style if not given, but you are
8648 encouraged to use this directive.
8651 \begin_layout Description
8652 \begin_inset Flex Code
8655 \begin_layout Plain Layout
8662 \begin_inset Flex Code
8665 \begin_layout Plain Layout
8671 ] This tag indicates that the module in question—which should be specified
8672 by filename without the
8673 \begin_inset Flex Code
8676 \begin_layout Plain Layout
8682 extension—cannot be used with this document class.
8683 This might be used in a journal-specific layout file to prevent, say, the
8685 \begin_inset Flex Code
8688 \begin_layout Plain Layout
8694 module that numbers theorems by section.
8699 be used in a module.
8700 Modules have their own way of excluding other modules (see
8701 \begin_inset CommandInset ref
8703 reference "sub:Layout-modules"
8710 \begin_layout Description
8711 \begin_inset Flex Code
8714 \begin_layout Plain Layout
8720 Defines a new float.
8722 \begin_inset space ~
8726 \begin_inset CommandInset ref
8728 reference "sub:Floats"
8734 \begin_inset Quotes eld
8738 \begin_inset Flex Code
8741 \begin_layout Plain Layout
8748 \begin_inset Quotes erd
8754 \begin_layout Description
8755 \begin_inset Flex Code
8758 \begin_layout Plain Layout
8764 Sets the information that will be output in the
8765 \begin_inset Flex Code
8768 \begin_layout Plain Layout
8774 block when this document class is output to XHTML.
8775 Note that this will completely override any prior
8776 \begin_inset Flex Code
8779 \begin_layout Plain Layout
8786 \begin_inset Flex Code
8789 \begin_layout Plain Layout
8797 \begin_inset Flex Code
8800 \begin_layout Plain Layout
8806 if you just want to add material to the preamble.) Must end with
8807 \begin_inset Quotes eld
8811 \begin_inset Flex Code
8814 \begin_layout Plain Layout
8821 \begin_inset Quotes erd
8827 \begin_layout Description
8828 \begin_inset Flex Code
8831 \begin_layout Plain Layout
8837 Sets CSS styling information.
8838 This will either be output in a
8839 \begin_inset Quotes eld
8843 \begin_inset Flex Code
8846 \begin_layout Plain Layout
8853 \begin_inset Quotes erd
8856 block or, if the user has so chosen, to a separate CSS file.
8857 Note that this will completely override any prior
8858 \begin_inset Flex Code
8861 \begin_layout Plain Layout
8868 \begin_inset Flex Code
8871 \begin_layout Plain Layout
8879 \begin_inset Flex Code
8882 \begin_layout Plain Layout
8888 if you just want to add material.) Must end with
8889 \begin_inset Quotes eld
8893 \begin_inset Flex Code
8896 \begin_layout Plain Layout
8903 \begin_inset Quotes erd
8909 \begin_layout Description
8910 \begin_inset Flex Code
8913 \begin_layout Plain Layout
8920 \begin_inset Flex Code
8923 \begin_layout Plain Layout
8929 ] The layout to use for the table of contents, bibliography, and so forth,
8930 when the document is output to HTML.
8931 For articles, this should normally be Section; for books, Chapter.
8932 If it is not given, then LyX will attempt to figure out which layout to
8936 \begin_layout Description
8937 \begin_inset Flex Code
8940 \begin_layout Plain Layout
8947 \begin_inset Flex Code
8950 \begin_layout Plain Layout
8956 ] Modifies the properties of the given counter.
8957 If the counter does not exist, the section is ignored.
8959 \begin_inset Quotes eld
8963 \begin_inset Flex Code
8966 \begin_layout Plain Layout
8973 \begin_inset Quotes erd
8977 \begin_inset Newline newline
8981 \begin_inset space ~
8985 \begin_inset CommandInset ref
8987 reference "sub:Counters"
8991 for details on counters.
8994 \begin_layout Description
8995 \begin_inset Flex Code
8998 \begin_layout Plain Layout
9005 \begin_inset Flex Code
9008 \begin_layout Plain Layout
9014 ] Modifies the properties of the given paragraph style.
9015 If the style does not exist, the section is ignored.
9017 \begin_inset Quotes eld
9021 \begin_inset Flex Code
9024 \begin_layout Plain Layout
9031 \begin_inset Quotes erd
9037 \begin_layout Description
9038 \begin_inset Flex Code
9041 \begin_layout Plain Layout
9047 As its name implies, this command allows you to include another layout
9048 definition file within yours to avoid duplicating commands.
9049 Common examples are the standard layout files, for example,
9050 \begin_inset Flex Code
9053 \begin_layout Plain Layout
9059 , which contains most of the basic layouts.
9062 \begin_layout Description
9063 \begin_inset Flex Code
9066 \begin_layout Plain Layout
9072 This section (re-)defines the layout of an inset.
9073 It can be applied to an existing inset or to a new, user-defined inset,
9074 e.g., a new character style.
9076 \begin_inset Quotes eld
9080 \begin_inset Flex Code
9083 \begin_layout Plain Layout
9090 \begin_inset Quotes erd
9094 \begin_inset Newline newline
9098 \begin_inset space ~
9102 \begin_inset CommandInset ref
9104 reference "sub:Flex-insets-and"
9108 for more information.
9112 \begin_layout Description
9113 \begin_inset Flex Code
9116 \begin_layout Plain Layout
9123 \begin_inset Flex Code
9126 \begin_layout Plain Layout
9132 ] A string that indicates the width of the left margin on the screen, for
9134 \begin_inset Quotes eld
9138 \begin_inset Quotes erd
9142 (Note that this is not a `length', like
9143 \begin_inset Quotes eld
9147 \begin_inset Quotes erd
9153 \begin_layout Description
9154 \begin_inset Flex Code
9157 \begin_layout Plain Layout
9164 \begin_inset Flex Code
9167 \begin_layout Plain Layout
9173 ] This command deletes an existing counter, usually one defined in an included
9177 \begin_layout Description
9178 \begin_inset Flex Code
9181 \begin_layout Plain Layout
9187 This command deletes an existing float.
9188 This is particularly useful when you want to suppress a float that has
9189 been defined in an input file.
9192 \begin_layout Description
9193 \begin_inset Flex Code
9196 \begin_layout Plain Layout
9202 This command deletes an existing style.
9203 This is particularly useful when you want to suppress a style that has
9204 be defined in an input file.
9207 \begin_layout Description
9208 \begin_inset Flex Code
9211 \begin_layout Plain Layout
9217 A string indicating the file format (as defined in the Preferences dialog)
9218 produced by this class.
9219 It is mainly useful when
9220 \begin_inset Flex Code
9223 \begin_layout Plain Layout
9229 is `literate' and one wants to define a new type of literate document.
9230 This string is reset to `docbook', `latex', or `literate' when the correspondin
9232 \begin_inset Flex Code
9235 \begin_layout Plain Layout
9241 parameter is encountered.
9244 \begin_layout Description
9245 \begin_inset Flex Code
9248 \begin_layout Plain Layout
9254 A string indicating what sort of output documents using this class will
9256 At present, the options are: `docbook', `latex', and `literate'.
9259 \begin_layout Description
9260 \begin_inset Flex Code
9263 \begin_layout Plain Layout
9270 \begin_inset Flex Code
9273 \begin_layout Plain Layout
9282 \begin_inset Flex Code
9285 \begin_layout Plain Layout
9292 \begin_inset Flex Code
9295 \begin_layout Plain Layout
9301 ] The default pagestyle.
9302 Can be changed in the
9303 \begin_inset Flex MenuItem
9306 \begin_layout Plain Layout
9307 Document\SpecialChar \menuseparator
9316 \begin_layout Description
9317 \begin_inset Flex Code
9320 \begin_layout Plain Layout
9326 Sets the preamble for the LaTeX document.
9327 Note that this will completely override any prior
9328 \begin_inset Flex Code
9331 \begin_layout Plain Layout
9338 \begin_inset Flex Code
9341 \begin_layout Plain Layout
9349 \begin_inset Flex Code
9352 \begin_layout Plain Layout
9358 if you just want to add material to the preamble.) Must end with
9359 \begin_inset Quotes eld
9363 \begin_inset Flex Code
9366 \begin_layout Plain Layout
9373 \begin_inset Quotes erd
9379 \begin_layout Description
9380 \begin_inset Flex Code
9383 \begin_layout Plain Layout
9390 \begin_inset Flex Code
9393 \begin_layout Plain Layout
9400 \begin_inset Flex Code
9403 \begin_layout Plain Layout
9412 \begin_inset Flex Code
9415 \begin_layout Plain Layout
9421 ] Whether the class already provides the feature
9422 \begin_inset Flex Code
9425 \begin_layout Plain Layout
9432 A feature is in general the name of a package (
9433 \begin_inset Flex Code
9436 \begin_layout Plain Layout
9443 \begin_inset Flex Code
9446 \begin_layout Plain Layout
9452 , \SpecialChar \ldots{}
9454 \begin_inset Flex Code
9457 \begin_layout Plain Layout
9464 \begin_inset Flex Code
9467 \begin_layout Plain Layout
9473 ,\SpecialChar \ldots{}
9474 ); the complete list of supported features is unfortunately not documented
9475 outside the LyX source code—but see
9476 \begin_inset Flex Code
9479 \begin_layout Plain Layout
9485 if you're interested.
9487 \begin_inset Flex MenuItem
9490 \begin_layout Plain Layout
9491 Help\SpecialChar \menuseparator
9497 also gives an overview of the supported packages.
9500 \begin_layout Description
9501 \begin_inset Flex Code
9504 \begin_layout Plain Layout
9511 \begin_inset Flex Code
9514 \begin_layout Plain Layout
9520 ] Indicates that this layout provides the functionality of the module mentioned,
9521 which should be specified by the filename without the
9522 \begin_inset Flex Code
9525 \begin_layout Plain Layout
9532 This will typically be used if the layout includes the module directly,
9533 rather than using the
9534 \begin_inset Flex Code
9537 \begin_layout Plain Layout
9543 tag to indicate that it ought to be used.
9544 It could also be used in a module that provided an alternate implementation
9545 of the same functionality.
9548 \begin_layout Description
9549 \begin_inset Flex Code
9552 \begin_layout Plain Layout
9559 \begin_inset Flex Code
9562 \begin_layout Plain Layout
9568 ] Whether the class requires the feature
9569 \begin_inset Flex Code
9572 \begin_layout Plain Layout
9579 Multiple features must be separated by commas.
9580 Note that you can only request supported features.
9582 \begin_inset Flex Code
9585 \begin_layout Plain Layout
9591 for a list of these.)
9594 \begin_layout Description
9595 \begin_inset Flex Code
9598 \begin_layout Plain Layout
9604 A string that indicates the width of the right margin on the screen, for
9606 \begin_inset Quotes eld
9610 \begin_inset Quotes erd
9616 \begin_layout Description
9617 \begin_inset Flex Code
9620 \begin_layout Plain Layout
9626 Sets which divisions get numbered.
9628 \begin_inset Flex Code
9631 \begin_layout Plain Layout
9640 \begin_layout Description
9641 \begin_inset Flex Code
9644 \begin_layout Plain Layout
9651 \begin_inset Flex Code
9654 \begin_layout Plain Layout
9663 \begin_inset Flex Code
9666 \begin_layout Plain Layout
9672 ] Whether the class-default should be printing on one or both sides of the
9674 Can be changed in the
9675 \begin_inset Flex MenuItem
9678 \begin_layout Plain Layout
9679 Document\SpecialChar \menuseparator
9688 \begin_layout Description
9689 \begin_inset Flex Code
9692 \begin_layout Plain Layout
9698 This sequence defines a paragraph style.
9699 If the style does not yet exist, it is created; if it does exist, its parameter
9702 \begin_inset Quotes eld
9706 \begin_inset Flex Code
9709 \begin_layout Plain Layout
9716 \begin_inset Quotes erd
9720 \begin_inset Newline newline
9724 \begin_inset space ~
9728 \begin_inset CommandInset ref
9730 reference "sub:Paragraph-Styles"
9734 for details on paragraph styles.
9737 \begin_layout Description
9738 \begin_inset Flex Code
9741 \begin_layout Plain Layout
9748 \begin_inset Flex Code
9751 \begin_layout Plain Layout
9757 ] The name of the command or environment to be used with
9758 \begin_inset Flex Code
9761 \begin_layout Plain Layout
9770 \begin_layout Description
9771 \begin_inset Flex Code
9774 \begin_layout Plain Layout
9781 \begin_inset Flex Code
9784 \begin_layout Plain Layout
9793 \begin_inset Flex Code
9796 \begin_layout Plain Layout
9802 ] Indicates what kind of markup is used to define the title of a document.
9804 \begin_inset Flex Code
9807 \begin_layout Plain Layout
9813 means that the macro with name
9814 \begin_inset Flex Code
9817 \begin_layout Plain Layout
9823 will be inserted after the last layout which has
9824 \begin_inset Quotes eld
9828 \begin_inset Flex Code
9831 \begin_layout Plain Layout
9838 \begin_inset Quotes erd
9843 \begin_inset Flex Code
9846 \begin_layout Plain Layout
9852 corresponds to the case where the block of paragraphs which have
9853 \begin_inset Quotes eld
9857 \begin_inset Flex Code
9860 \begin_layout Plain Layout
9867 \begin_inset Quotes erd
9870 should be enclosed into the
9871 \begin_inset Flex Code
9874 \begin_layout Plain Layout
9883 \begin_layout Description
9884 \begin_inset Flex Code
9887 \begin_layout Plain Layout
9893 Sets which divisions are included in the table of contents.
9895 \begin_inset Flex Code
9898 \begin_layout Plain Layout
9907 \begin_layout Subsection
9908 \begin_inset Flex Code
9911 \begin_layout Plain Layout
9918 \begin_inset CommandInset label
9920 name "sub:ClassOptions"
9927 \begin_layout Standard
9929 \begin_inset Flex Code
9932 \begin_layout Plain Layout
9938 section can contain the following entries:
9941 \begin_layout Description
9942 \begin_inset Flex Code
9945 \begin_layout Plain Layout
9952 \begin_inset Flex Code
9955 \begin_layout Plain Layout
9961 ] The list of available font sizes for the document's main font, separated
9963 \begin_inset Quotes eld
9967 \begin_inset Flex Code
9970 \begin_layout Plain Layout
9977 \begin_inset Quotes erd
9983 \begin_layout Description
9984 \begin_inset Flex Code
9987 \begin_layout Plain Layout
9993 Used to set the DTD line with XML-based output classes.
9995 \begin_inset space \thinspace{}
9999 \begin_inset Quotes eld
10002 -//OASIS//DTD DocBook V4.2//EN
10003 \begin_inset Quotes erd
10009 \begin_layout Description
10010 \begin_inset Flex Code
10013 \begin_layout Plain Layout
10020 \begin_inset Flex Code
10023 \begin_layout Plain Layout
10024 string="empty|plain|headings|fancy"
10029 ] The list of available page styles, separated by
10030 \begin_inset Quotes eld
10034 \begin_inset Flex Code
10037 \begin_layout Plain Layout
10044 \begin_inset Quotes erd
10050 \begin_layout Description
10051 \begin_inset Flex Code
10054 \begin_layout Plain Layout
10061 \begin_inset Flex Code
10064 \begin_layout Plain Layout
10070 ] Some document class options, separated by a comma, that will be added
10071 to the optional part of the
10072 \begin_inset Flex Code
10075 \begin_layout Plain Layout
10086 \begin_layout Standard
10088 \begin_inset Flex Code
10091 \begin_layout Plain Layout
10097 section must end with
10098 \begin_inset Quotes eld
10102 \begin_inset Flex Code
10105 \begin_layout Plain Layout
10112 \begin_inset Quotes erd
10118 \begin_layout Subsection
10120 \begin_inset CommandInset label
10122 name "sub:Paragraph-Styles"
10129 \begin_layout Standard
10130 A paragraph style description looks like this:
10134 \begin_layout Plain Layout
10135 Note that this will either define a new style or modify an existing one.
10143 \begin_layout LyX-Code
10150 \begin_layout LyX-Code
10154 \begin_layout LyX-Code
10158 \begin_layout Standard
10159 where the following commands are allowed:
10162 \begin_layout Description
10163 \begin_inset Flex Code
10166 \begin_layout Plain Layout
10173 \begin_inset Flex Code
10176 \begin_layout Plain Layout
10181 , left, right, center
10186 ] Paragraph alignment.
10189 \begin_layout Description
10190 \begin_inset Flex Code
10193 \begin_layout Plain Layout
10200 \begin_inset Flex Code
10203 \begin_layout Plain Layout
10208 , left, right, center
10213 ] A comma separated list of permitted alignments.
10214 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
10216 For example a right-aligned or centered enumeration isn't possible.)
10217 \change_inserted -712698321 1353679769
10221 \begin_layout Description
10223 \change_inserted -712698321 1353680268
10224 \begin_inset Flex Code
10227 \begin_layout Plain Layout
10229 \change_inserted -712698321 1353679781
10236 \begin_inset Flex Code
10239 \begin_layout Plain Layout
10241 \change_inserted -712698321 1353679772
10247 ] Defines argument number <int> of a command\SpecialChar \slash{}
10248 environment associated with
10250 This is useful for things like section headings, and only makes sense with
10252 Every (optional or required) argument of a command or environment -- except
10253 for the required argument that is associated with the content of the paragraph
10254 itself -- has a separate definition, where the number specifies the order
10256 The definition must end with
10257 \begin_inset Flex Code
10260 \begin_layout Plain Layout
10262 \change_inserted -712698321 1353680069
10269 So a command with two optional arguments has:
10273 \begin_layout Quote
10275 \change_inserted -712698321 1353680127
10281 \begin_layout Quote
10283 \change_inserted -712698321 1353680195
10289 \begin_layout Quote
10291 \change_inserted -712698321 1353680135
10297 \begin_layout Quote
10299 \change_inserted -712698321 1353680140
10305 \begin_layout Quote
10307 \change_inserted -712698321 1353680197
10313 \begin_layout Quote
10315 \change_inserted -712698321 1353680147
10321 \begin_layout Standard
10323 \change_inserted -712698321 1353680528
10325 \begin_inset Flex Code
10328 \begin_layout Plain Layout
10330 \change_inserted -712698321 1353680412
10336 definition, the following specifications are possible:
10339 \begin_layout Itemize
10341 \change_inserted -712698321 1353691469
10342 \begin_inset Flex Code
10345 \begin_layout Plain Layout
10347 \change_inserted -712698321 1353680543
10356 \begin_inset Flex Code
10359 \begin_layout Plain Layout
10361 \change_inserted -712698321 1353680567
10367 The string that will appear both in the menu (to insert this argument)
10368 and on the argument inset button.
10369 For the menu, you can define an accelerator by appending the respective
10370 character to the string, divided by
10371 \begin_inset Quotes eld
10375 \begin_inset Quotes erd
10379 \begin_inset space \thinspace{}
10384 \begin_inset Flex Code
10387 \begin_layout Plain Layout
10389 \change_inserted -712698321 1353691482
10390 \begin_inset Quotes eld
10394 \begin_inset Quotes erd
10407 \begin_layout Itemize
10409 \change_inserted -712698321 1353680665
10410 \begin_inset Flex Code
10413 \begin_layout Plain Layout
10415 \change_inserted -712698321 1353680616
10422 \begin_inset Flex Code
10425 \begin_layout Plain Layout
10427 \change_inserted -712698321 1353680623
10433 A longer explanatory text that appears in the tooltip when hovering over
10434 the argument inset.
10437 \begin_layout Itemize
10439 \change_inserted -712698321 1353680874
10440 \begin_inset Flex Code
10443 \begin_layout Plain Layout
10445 \change_inserted -712698321 1353680732
10452 \begin_inset Flex Code
10455 \begin_layout Plain Layout
10457 \change_inserted -712698321 1353680738
10463 Declare if this is a mandatory
10464 \change_inserted 2090807402 1353765594
10466 \change_inserted -712698321 1353680874
10468 \change_inserted 2090807402 1353765599
10470 \change_inserted -712698321 1353680874
10472 Mandatory arguments will be output empty if not given, while optional arguments
10473 will not be output at all.
10474 By default, mandatory arguments are delimited by
10475 \begin_inset Flex Code
10478 \begin_layout Plain Layout
10480 \change_inserted -712698321 1353680808
10488 , while optional arguments are delimited by
10489 \begin_inset Flex Code
10492 \begin_layout Plain Layout
10494 \change_inserted -712698321 1353680833
10503 \begin_layout Itemize
10505 \change_inserted -712698321 1353917199
10506 \begin_inset Flex Code
10509 \begin_layout Plain Layout
10511 \change_inserted -712698321 1353680879
10518 \begin_inset Flex Code
10521 \begin_layout Plain Layout
10523 \change_inserted -712698321 1353680874
10529 defines another argument (by its number) which this argument requires to
10530 be output if it is itself output.
10532 \begin_inset space \thinspace{}
10535 g., in LaTeX commands, optional arguments often require previous optional
10536 arguments to be output (at least empty), as in
10537 \begin_inset Flex Code
10540 \begin_layout Plain Layout
10542 \change_inserted -712698321 1353688183
10545 command[][arg]{text}
10553 This can be achieved by the statement
10554 \begin_inset Flex Code
10557 \begin_layout Plain Layout
10559 \change_inserted -712698321 1353681031
10568 \begin_inset Flex Code
10571 \begin_layout Plain Layout
10573 \change_inserted -712698321 1353681045
10584 \begin_layout Itemize
10586 \change_inserted -712698321 1353681145
10587 \begin_inset Flex Code
10590 \begin_layout Plain Layout
10592 \change_inserted -712698321 1353681072
10601 \begin_inset Flex Code
10604 \begin_layout Plain Layout
10606 \change_inserted -712698321 1353681067
10612 defines a custom left delimiter (instead of
10613 \begin_inset Flex Code
10616 \begin_layout Plain Layout
10618 \change_inserted -712698321 1353681127
10627 \begin_inset Flex Code
10630 \begin_layout Plain Layout
10632 \change_inserted -712698321 1353681133
10643 \begin_layout Itemize
10645 \change_inserted -712698321 1353917319
10646 \begin_inset Flex Code
10649 \begin_layout Plain Layout
10651 \change_inserted -712698321 1353681149
10658 \begin_inset Flex Code
10661 \begin_layout Plain Layout
10663 \change_inserted -712698321 1353681146
10669 defines a custom right delimiter (instead of
10670 \begin_inset Flex Code
10673 \begin_layout Plain Layout
10675 \change_inserted -712698321 1353681158
10682 \begin_inset Flex Code
10685 \begin_layout Plain Layout
10687 \change_inserted -712698321 1353681161
10696 \begin_layout Itemize
10698 \change_inserted -712698321 1353917320
10699 \begin_inset Flex Code
10702 \begin_layout Plain Layout
10704 \change_inserted -712698321 1353917320
10710 The font used for the argument content.
10712 \begin_inset space ~
10716 \begin_inset CommandInset ref
10718 reference "sub:Font-description"
10725 \begin_layout Itemize
10727 \change_inserted -712698321 1353917320
10728 \begin_inset Flex Code
10731 \begin_layout Plain Layout
10733 \change_inserted -712698321 1353917320
10739 The font used for the label.
10741 \begin_inset space ~
10745 \begin_inset CommandInset ref
10747 reference "sub:Font-description"
10754 \begin_layout Itemize
10756 \change_inserted -712698321 1353917320
10757 \begin_inset Flex Code
10760 \begin_layout Plain Layout
10762 \change_inserted -712698321 1353917320
10769 \begin_inset Flex Code
10772 \begin_layout Plain Layout
10774 \change_inserted -712698321 1353917320
10781 \begin_inset Flex Code
10784 \begin_layout Plain Layout
10786 \change_inserted -712698321 1353917320
10793 \begin_inset Flex Code
10796 \begin_layout Plain Layout
10798 \change_inserted -712698321 1353917320
10804 , describing the rendering style used for the inset's frame and buttons.
10806 \begin_inset Flex Code
10809 \begin_layout Plain Layout
10811 \change_inserted -712698321 1353917320
10823 \begin_layout Description
10824 \begin_inset Flex Code
10827 \begin_layout Plain Layout
10833 Note that this will completely override any prior
10834 \begin_inset Flex Code
10837 \begin_layout Plain Layout
10843 declaration for this style.
10845 \begin_inset Quotes eld
10849 \begin_inset Flex Code
10852 \begin_layout Plain Layout
10859 \begin_inset Quotes erd
10864 \begin_inset CommandInset ref
10866 reference "sub:I18n"
10870 for details on its use.
10873 \begin_layout Description
10874 \begin_inset Flex Code
10877 \begin_layout Plain Layout
10884 \begin_inset Flex Code
10887 \begin_layout Plain Layout
10897 \begin_layout Plain Layout
10898 Note that a `float' here is a real number, such as: 1.5.
10903 The vertical space with which the last of a chain of paragraphs with this
10904 style is separated from the following paragraph.
10905 If the next paragraph has another style, the separations are not simply
10906 added, but the maximum is taken.
10909 \begin_layout Description
10910 \begin_inset Flex Code
10913 \begin_layout Plain Layout
10920 \begin_inset Flex Code
10923 \begin_layout Plain Layout
10929 The category for this style.
10930 This is used to group related styles in the style combobox on the toolbar.
10931 Any string can be used, but you may want to use existing categories with
10936 \begin_layout Description
10937 \begin_inset Flex Code
10940 \begin_layout Plain Layout
10946 Depth of XML command.
10947 Used only with XML-type formats.
10950 \begin_layout Description
10951 \begin_inset Flex Code
10954 \begin_layout Plain Layout
10961 \begin_inset Flex Code
10964 \begin_layout Plain Layout
10970 Copies all the features of an existing style into the current one.
10974 \begin_layout Description
10975 \begin_inset Flex Code
10978 \begin_layout Plain Layout
10984 The name of a style whose preamble should be output
10989 This allows to ensure some ordering of the preamble snippets when macros
10990 definitions depend on one another.
10994 \begin_layout Plain Layout
10995 Note that, besides that functionality, there is no way to ensure any ordering
10997 The ordering that you see in a given version of LyX may change without
10998 warning in later versions.
11006 \begin_layout Description
11007 \begin_inset Flex Code
11010 \begin_layout Plain Layout
11017 \begin_inset Flex Code
11020 \begin_layout Plain Layout
11025 , Box, Filled_Box, Static
11030 ] The type of label that stands at the end of the paragraph (or sequence
11032 \begin_inset Flex Code
11035 \begin_layout Plain Layout
11042 \begin_inset Flex Code
11045 \begin_layout Plain Layout
11052 \begin_inset Flex Code
11055 \begin_layout Plain Layout
11062 \begin_inset Flex Code
11065 \begin_layout Plain Layout
11073 \begin_inset Flex Code
11076 \begin_layout Plain Layout
11083 \begin_inset Quotes eld
11087 \begin_inset Quotes erd
11091 \begin_inset Flex Code
11094 \begin_layout Plain Layout
11101 \begin_inset Flex Code
11104 \begin_layout Plain Layout
11105 \begin_inset space ~
11113 ) is a white (resp.
11114 \begin_inset space ~
11117 black) square suitable for end of proof markers,
11118 \begin_inset Flex Code
11121 \begin_layout Plain Layout
11127 is an explicit text string.
11130 \begin_layout Description
11131 \begin_inset Flex Code
11134 \begin_layout Plain Layout
11141 \begin_inset Flex Code
11144 \begin_layout Plain Layout
11150 ] The string used for a label with a
11151 \begin_inset Flex Code
11154 \begin_layout Plain Layout
11161 \begin_inset Flex Code
11164 \begin_layout Plain Layout
11174 \begin_layout Description
11175 \begin_inset Flex Code
11178 \begin_layout Plain Layout
11184 The font used for both the text body
11190 \begin_inset space ~
11194 \begin_inset CommandInset ref
11196 reference "sub:Font-description"
11201 Note that defining this font automatically defines the
11202 \begin_inset Flex Code
11205 \begin_layout Plain Layout
11212 So you should define this one first if you also want to define
11213 \begin_inset Flex Code
11216 \begin_layout Plain Layout
11225 \begin_layout Description
11226 \begin_inset Flex Code
11229 \begin_layout Plain Layout
11236 \begin_inset CommandInset label
11238 name "des:FreeSpacing"
11243 \begin_inset Flex Code
11246 \begin_layout Plain Layout
11255 \begin_inset Flex Code
11258 \begin_layout Plain Layout
11264 ] Usually LyX doesn't allow you to insert more than one space between words,
11265 since a space is considered as the separation between two words, not a
11266 character or symbol of its own.
11267 This is a very fine thing but sometimes annoying, for example, when typing
11268 program code or plain LaTeX code.
11270 \begin_inset Flex Code
11273 \begin_layout Plain Layout
11280 Note that LyX will create protected blanks for the additional blanks when
11281 in another mode than LaTeX-mode.
11284 \begin_layout Description
11285 \begin_inset Flex Code
11288 \begin_layout Plain Layout
11294 These tags are used with XHTML output.
11296 \begin_inset CommandInset ref
11298 reference "sub:Paragraph-Style-XHTML"
11305 \begin_layout Description
11306 \begin_inset Flex Code
11309 \begin_layout Plain Layout
11315 [[FIXME]] (Used only with XML-type formats.)
11318 \begin_layout Description
11319 \begin_inset Flex Code
11322 \begin_layout Plain Layout
11329 \begin_inset Flex Code
11332 \begin_layout Plain Layout
11338 If 1, marks the style as to be included in the document preamble rather
11339 than in the document body.
11340 This is useful for document classes that want such information as the title
11341 and author to appear in the preamble.
11342 Note that this works only for styles for which the
11343 \begin_inset Flex Code
11346 \begin_layout Plain Layout
11353 \begin_inset Flex Code
11356 \begin_layout Plain Layout
11363 \begin_inset Flex Code
11366 \begin_layout Plain Layout
11375 \begin_layout Description
11376 \begin_inset Flex Code
11379 \begin_layout Plain Layout
11386 \begin_inset Flex Code
11389 \begin_layout Plain Layout
11395 If 1, marks the style as being part of a title block (see also the
11396 \begin_inset Flex Code
11399 \begin_layout Plain Layout
11406 \begin_inset Flex Code
11409 \begin_layout Plain Layout
11418 \begin_layout Description
11419 \begin_inset Flex Code
11422 \begin_layout Plain Layout
11429 \begin_inset Flex Code
11432 \begin_layout Plain Layout
11438 ] This provides extra space between paragraphs that have the same style.
11439 If you put other styles into an environment, each is separated with the
11441 \begin_inset Flex Code
11444 \begin_layout Plain Layout
11451 But the whole items of the environment are additionally separated with
11453 \begin_inset Flex Code
11456 \begin_layout Plain Layout
11463 Note that this is a
11468 \begin_layout Description
11469 \begin_inset Flex Code
11472 \begin_layout Plain Layout
11478 [[FIXME]] (Used only with XML-type formats.)
11481 \begin_layout Description
11482 \begin_inset Flex Code
11485 \begin_layout Plain Layout
11492 \begin_inset Flex Code
11495 \begin_layout Plain Layout
11504 \begin_inset Flex Code
11507 \begin_layout Plain Layout
11513 ] Usually LyX does not allow you to leave a paragraph empty, since it would
11514 lead to empty LaTeX output.
11515 There are some cases where this could be desirable however: in a letter
11516 template, the required fields can be provided as empty fields, so that
11517 people do not forget them; in some special classes, a style can be used
11518 as some kind of break, which does not contain actual text.
11521 \begin_layout Description
11522 \begin_inset Flex Code
11525 \begin_layout Plain Layout
11531 [float=0] The vertical space between the label and the text body.
11532 Only used for labels that are above the text body (
11533 \begin_inset Flex Code
11536 \begin_layout Plain Layout
11543 \begin_inset Flex Code
11546 \begin_layout Plain Layout
11547 Centered_Top_Environment
11555 \begin_layout Description
11556 \begin_inset Flex Code
11559 \begin_layout Plain Layout
11566 \begin_inset Flex Code
11569 \begin_layout Plain Layout
11576 \begin_inset Newline newline
11579 The name of the counter for automatic numbering.
11581 \begin_inset Newline newline
11589 \begin_inset Flex Code
11592 \begin_layout Plain Layout
11599 \begin_inset Flex Code
11602 \begin_layout Plain Layout
11609 In that case, the counter will be stepped each time the style appears.
11611 \begin_inset Newline newline
11619 \begin_inset Flex Code
11622 \begin_layout Plain Layout
11629 \begin_inset Flex Code
11632 \begin_layout Plain Layout
11638 , though this case is a bit complicated.
11639 Suppose you declare
11640 \begin_inset Quotes eld
11644 \begin_inset Flex Code
11647 \begin_layout Plain Layout
11648 LabelCounter myenum
11654 \begin_inset Quotes erd
11658 Then the actual counters used are
11659 \begin_inset Flex Code
11662 \begin_layout Plain Layout
11669 \begin_inset Flex Code
11672 \begin_layout Plain Layout
11679 \begin_inset Flex Code
11682 \begin_layout Plain Layout
11689 \begin_inset Flex Code
11692 \begin_layout Plain Layout
11698 , much as in LaTeX.
11699 These counters must all be declared separately.
11700 \begin_inset Newline newline
11704 \begin_inset CommandInset ref
11706 reference "sub:Counters"
11710 for details on counters.
11713 \begin_layout Description
11714 \begin_inset Flex Code
11717 \begin_layout Plain Layout
11723 The font used for the label.
11725 \begin_inset space ~
11729 \begin_inset CommandInset ref
11731 reference "sub:Font-description"
11738 \begin_layout Description
11739 \begin_inset Flex Code
11742 \begin_layout Plain Layout
11748 Text that indicates how far a label should be indented.
11751 \begin_layout Description
11752 \begin_inset Flex Code
11755 \begin_layout Plain Layout
11762 \begin_inset Flex Code
11765 \begin_layout Plain Layout
11771 ] The horizontal space between the label and the text body.
11772 Only used for labels that are not above the text body.
11775 \begin_layout Description
11776 \begin_inset Flex Code
11779 \begin_layout Plain Layout
11786 \begin_inset Flex Code
11789 \begin_layout Plain Layout
11795 ] The string used for a label with a
11796 \begin_inset Flex Code
11799 \begin_layout Plain Layout
11807 \begin_inset Flex Code
11810 \begin_layout Plain Layout
11816 is set, this string can be contain the special formatting commands described
11818 \begin_inset CommandInset ref
11820 reference "sub:Counters"
11828 \begin_layout Plain Layout
11829 For the sake of backwards compatibility, the string
11830 \begin_inset Flex Code
11833 \begin_layout Plain Layout
11843 will be replaced by the expanded
11844 \begin_inset Flex Code
11847 \begin_layout Plain Layout
11854 \begin_inset Flex Code
11857 \begin_layout Plain Layout
11866 This feature is now obsolete and should be replaced by the mechanisms of
11868 \begin_inset CommandInset ref
11870 reference "sub:Counters"
11882 \begin_layout Description
11883 \begin_inset Flex Code
11886 \begin_layout Plain Layout
11887 LabelStringAppendix
11893 \begin_inset Flex Code
11896 \begin_layout Plain Layout
11902 ] This is used inside the appendix instead of
11903 \begin_inset Flex Code
11906 \begin_layout Plain Layout
11914 \begin_inset Flex Code
11917 \begin_layout Plain Layout
11924 \begin_inset Flex Code
11927 \begin_layout Plain Layout
11928 LabelStringAppendix
11936 \begin_layout Description
11937 \begin_inset Flex Code
11940 \begin_layout Plain Layout
11946 [FIXME] (Used only with XML-type formats.)
11949 \begin_layout Description
11950 \begin_inset Flex Code
11953 \begin_layout Plain Layout
11960 \begin_inset Flex Code
11963 \begin_layout Plain Layout
11968 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
11969 Enumerate, Itemize, Bibliography
11978 \begin_layout Itemize
11979 \begin_inset Flex Code
11982 \begin_layout Plain Layout
11988 means the label is the very first word (up to the first real blank).
11989 Use protected spaces (like
11990 \begin_inset space ~
11993 that one) if you want more than one word as the label.
11997 \begin_layout Itemize
11998 \begin_inset Flex Code
12001 \begin_layout Plain Layout
12007 means the label is simply whatever
12008 \begin_inset Flex Code
12011 \begin_layout Plain Layout
12018 Note that this really is `static'.
12021 \begin_layout Itemize
12022 \begin_inset Flex Code
12025 \begin_layout Plain Layout
12032 \begin_inset Flex Code
12035 \begin_layout Plain Layout
12036 Centered_Top_Environment
12041 are special cases of
12042 \begin_inset Flex Code
12045 \begin_layout Plain Layout
12052 The label will be printed above the paragraph, but only at the top of an
12053 environment or the top of a chain of paragraphs with this style.
12054 This might be used with the
12055 \begin_inset Flex MenuItem
12058 \begin_layout Plain Layout
12064 style, for example.
12067 \begin_layout Itemize
12068 \begin_inset Flex Code
12071 \begin_layout Plain Layout
12077 is a special case for the caption-labels
12078 \begin_inset Quotes eld
12082 \begin_inset Quotes erd
12086 \begin_inset Quotes eld
12090 \begin_inset Quotes erd
12095 \begin_inset Flex Code
12098 \begin_layout Plain Layout
12104 means the (hardcoded) label string depends on the kind of float: It is
12105 hardcoded to be `FloatType N', where N is the value of the counter associated
12109 \begin_layout Itemize
12111 \begin_inset Flex Code
12114 \begin_layout Plain Layout
12120 label type defines automatically numbered labels.
12122 \begin_inset Flex Code
12125 \begin_layout Plain Layout
12131 will be expanded to resolve any counter references it contains: For example,
12133 \begin_inset Quotes eld
12137 \begin_inset Flex Code
12140 \begin_layout Plain Layout
12151 \begin_inset Quotes erd
12156 \begin_inset CommandInset ref
12158 reference "sub:Counters"
12162 for more information on counters.
12165 \begin_layout Itemize
12166 \begin_inset Flex Code
12169 \begin_layout Plain Layout
12175 produces the usual sort of enumeration labels.
12176 At present, it is hardcoded to use Arabic numerals, lowercase letters,
12177 small Roman numerals, and uppercase letters for the four possible depths.
12180 \begin_layout Itemize
12181 \begin_inset Flex Code
12184 \begin_layout Plain Layout
12190 produces various bullets at the different levels.
12191 It is also hardcoded.
12194 \begin_layout Itemize
12195 \begin_inset Flex Code
12198 \begin_layout Plain Layout
12204 is used internally by LyX and should be used only with
12205 \begin_inset Flex Code
12208 \begin_layout Plain Layout
12209 LatexType BibEnvironment
12218 \begin_layout Description
12219 \begin_inset Flex Code
12222 \begin_layout Plain Layout
12228 Note that this will completely override any prior
12229 \begin_inset Flex Code
12232 \begin_layout Plain Layout
12238 declaration for this style.
12240 \begin_inset Quotes eld
12244 \begin_inset Flex Code
12247 \begin_layout Plain Layout
12254 \begin_inset Quotes erd
12259 \begin_inset CommandInset ref
12261 reference "sub:I18n"
12265 for details on its use.
12268 \begin_layout Description
12269 \begin_inset Flex Code
12272 \begin_layout Plain Layout
12278 The name of the corresponding LaTeX stuff.
12279 Either the environment or command name.
12282 \begin_layout Description
12283 \begin_inset Flex Code
12286 \begin_layout Plain Layout
12292 An optional parameter for the corresponding
12293 \begin_inset Flex Code
12296 \begin_layout Plain Layout
12303 This parameter cannot be changed from within LyX.
12306 \begin_layout Description
12307 \begin_inset Flex Code
12310 \begin_layout Plain Layout
12317 \begin_inset Flex Code
12320 \begin_layout Plain Layout
12325 , Command, Environment, Item_Environment,
12331 \begin_inset Flex Code
12334 \begin_layout Plain Layout
12335 List_Environment, Bib_Environment
12340 ] How the style should be translated into LaTeX.
12344 \begin_layout Plain Layout
12345 \begin_inset Flex Code
12348 \begin_layout Plain Layout
12354 is perhaps a bit misleading, since these rules apply to SGML classes, too.
12355 Visit the SGML class files for specific examples.
12364 \begin_layout Itemize
12365 \begin_inset Flex Code
12368 \begin_layout Plain Layout
12374 means nothing special.
12378 \begin_layout Itemize
12379 \begin_inset Flex Code
12382 \begin_layout Plain Layout
12389 \begin_inset Flex Code
12392 \begin_layout Plain Layout
12399 {\SpecialChar \ldots{}
12408 \begin_layout Itemize
12409 \begin_inset Flex Code
12412 \begin_layout Plain Layout
12419 \begin_inset Flex Code
12422 \begin_layout Plain Layout
12429 }\SpecialChar \ldots{}
12445 \begin_layout Itemize
12446 \begin_inset Flex Code
12449 \begin_layout Plain Layout
12456 \begin_inset Flex Code
12459 \begin_layout Plain Layout
12466 \begin_inset Flex Code
12469 \begin_layout Plain Layout
12477 is generated for each paragraph of this environment.
12481 \begin_layout Itemize
12482 \begin_inset Flex Code
12485 \begin_layout Plain Layout
12492 \begin_inset Flex Code
12495 \begin_layout Plain Layout
12502 \begin_inset Flex Code
12505 \begin_layout Plain Layout
12511 is passed as an argument to the environment.
12513 \begin_inset Flex Code
12516 \begin_layout Plain Layout
12522 can be defined in the
12523 \begin_inset Flex MenuItem
12526 \begin_layout Plain Layout
12527 Edit\SpecialChar \menuseparator
12529 \begin_inset space ~
12541 \begin_layout Standard
12542 Putting the last few things together, the LaTeX output will be either:
12545 \begin_layout LyX-Code
12548 latexname[latexparam]{\SpecialChar \ldots{}
12552 \begin_layout Standard
12556 \begin_layout LyX-Code
12559 begin{latexname}[latexparam] \SpecialChar \ldots{}
12565 \begin_layout Standard
12566 depending upon the LaTeX type.
12570 \begin_layout Description
12572 \change_inserted -712698321 1353866861
12573 \begin_inset Flex Code
12576 \begin_layout Plain Layout
12578 \change_inserted -712698321 1353866852
12585 \begin_inset Flex Code
12588 \begin_layout Plain Layout
12590 \change_inserted -712698321 1353866852
12596 ] A string that is put at the beginning of the style content.
12599 \begin_layout Description
12600 \begin_inset Flex Code
12603 \begin_layout Plain Layout
12610 \begin_inset Flex Code
12613 \begin_layout Plain Layout
12619 ] If you put styles into environments, the leftmargins are not simply added,
12620 but added with a factor
12621 \begin_inset Formula $\frac{4}{depth+4}$
12625 Note that this parameter is also used when the margin is defined as
12626 \begin_inset Flex Code
12629 \begin_layout Plain Layout
12636 \begin_inset Flex Code
12639 \begin_layout Plain Layout
12646 Then it is added to the manual or dynamic margin.
12648 \begin_inset Newline newline
12651 The argument is passed as a string.
12653 \begin_inset Quotes eld
12657 \begin_inset Flex Code
12660 \begin_layout Plain Layout
12667 \begin_inset Quotes erd
12670 means that the paragraph is indented with the width of
12671 \begin_inset Quotes eld
12675 \begin_inset Flex Code
12678 \begin_layout Plain Layout
12685 \begin_inset Quotes erd
12688 in the normal font.
12689 You can get a negative width by prefixing the string with
12690 \begin_inset Quotes eld
12694 \begin_inset Flex Code
12697 \begin_layout Plain Layout
12704 \begin_inset Quotes erd
12708 This way was chosen so that the look is the same with each used screen
12713 \begin_layout Description
12714 \begin_inset Flex Code
12717 \begin_layout Plain Layout
12724 \begin_inset Flex Code
12727 \begin_layout Plain Layout
12732 , Manual, Dynamic, First_Dynamic, Right_Address_Box
12738 \begin_inset Newline newline
12741 The kind of margin that the style has on the left side.
12743 \begin_inset Flex Code
12746 \begin_layout Plain Layout
12752 just means a fixed margin.
12754 \begin_inset Flex Code
12757 \begin_layout Plain Layout
12763 means that the left margin depends on the string entered in the
12764 \begin_inset Flex MenuItem
12767 \begin_layout Plain Layout
12768 Edit\SpecialChar \menuseparator
12770 \begin_inset space ~
12779 This is used to typeset nice lists without tabulators.
12781 \begin_inset Flex Code
12784 \begin_layout Plain Layout
12790 means that the margin depends on the size of the label.
12791 This is used for automatic enumerated headlines.
12792 It is obvious that the headline
12793 \begin_inset Quotes eld
12796 5.4.3.2.1 Very long headline
12797 \begin_inset Quotes erd
12800 must have a wider left margin (as wide as
12801 \begin_inset Quotes eld
12805 \begin_inset Quotes erd
12808 plus the space) than
12809 \begin_inset Quotes eld
12812 3.2 Very long headline
12813 \begin_inset Quotes erd
12817 \begin_inset Quotes eld
12821 \begin_inset Quotes erd
12824 are not able to do this.
12826 \begin_inset Flex Code
12829 \begin_layout Plain Layout
12835 is similar, but only the very first row of the paragraph is dynamic, while
12836 the others are static; this is used, for example, for descriptions.
12838 \begin_inset Flex Code
12841 \begin_layout Plain Layout
12847 means the margin is chosen in a way that the longest row of this paragraph
12848 fits to the right margin.
12849 This is used to typeset an address on the right edge of the page.
12852 \begin_layout Description
12853 \begin_inset Flex Code
12856 \begin_layout Plain Layout
12863 \begin_inset Flex Code
12866 \begin_layout Plain Layout
12875 \begin_inset Flex Code
12878 \begin_layout Plain Layout
12884 ] Whether fragile commands in this style should be
12885 \begin_inset Flex Code
12888 \begin_layout Plain Layout
12901 whether this command should itself be protected.)
12904 \begin_layout Description
12905 \begin_inset Flex Code
12908 \begin_layout Plain Layout
12915 \begin_inset Flex Code
12918 \begin_layout Plain Layout
12925 \begin_inset Flex Code
12928 \begin_layout Plain Layout
12936 ] Whether newlines are translated into LaTeX newlines (
12937 \begin_inset Flex Code
12940 \begin_layout Plain Layout
12951 The translation can be switched off to allow more comfortable LaTeX editing
12955 \begin_layout Description
12956 \begin_inset Flex Code
12959 \begin_layout Plain Layout
12966 \begin_inset Flex Code
12969 \begin_layout Plain Layout
12976 \begin_inset Flex Code
12979 \begin_layout Plain Layout
12987 ] If set to true, and if
12988 \begin_inset Flex Code
12991 \begin_layout Plain Layout
12998 \begin_inset Flex Code
13001 \begin_layout Plain Layout
13007 ) paragraphs are being indented, then the indentation of such a paragraph
13008 following one of this type will be suppressed.
13009 (So this will not affect the display of non-default paragraphs.)
13012 \begin_layout Description
13013 \begin_inset Flex Code
13016 \begin_layout Plain Layout
13022 Name of a style that has replaced this style.
13023 This is used to rename a style, while keeping backward compatibility.
13026 \begin_layout Description
13028 \change_deleted -712698321 1353679722
13029 \begin_inset Flex Code
13032 \begin_layout Plain Layout
13039 \begin_inset Flex Code
13042 \begin_layout Plain Layout
13048 ] The number of optional arguments that can be used with this style.
13049 This is useful for things like section headings, and only makes sense with
13051 Note that, on output, the optional arguments will all precede any required
13052 arguments (see below).
13053 So one can have constructs like:
13057 \begin_layout LyX-Code
13059 \change_deleted -712698321 1353679722
13062 mycmd[opt1]{req1}{contents of paragraph}
13065 \begin_layout Standard
13067 \change_deleted -712698321 1353679722
13068 but one cannot have things like:
13071 \begin_layout LyX-Code
13073 \change_deleted -712698321 1353679722
13076 mycmd[opt1]{req1}[opt2]{contents of paragraph}
13079 \begin_layout Standard
13081 \change_deleted -712698321 1353679722
13082 at least, not without ERT (with which you can have anything).
13089 \begin_layout Description
13090 \begin_inset Flex Code
13093 \begin_layout Plain Layout
13100 \begin_inset Flex Code
13103 \begin_layout Plain Layout
13112 \begin_inset Flex Code
13115 \begin_layout Plain Layout
13121 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
13122 output, but only by a line break; together with
13123 \begin_inset Flex Code
13126 \begin_layout Plain Layout
13132 , this allows to emulate a plain text editor (like the ERT inset).
13135 \begin_layout Description
13136 \begin_inset Flex Code
13139 \begin_layout Plain Layout
13146 \begin_inset Flex Code
13149 \begin_layout Plain Layout
13155 ] The indent of the very first line of a paragraph.
13157 \begin_inset Flex Code
13160 \begin_layout Plain Layout
13166 will be fixed for a certain style.
13167 The exception is the default style, since the indentation for these paragraphs
13168 can be prohibited with
13169 \begin_inset Flex Code
13172 \begin_layout Plain Layout
13180 \begin_inset Flex Code
13183 \begin_layout Plain Layout
13189 style paragraphs inside environments use the
13190 \begin_inset Flex Code
13193 \begin_layout Plain Layout
13199 of the environment, not their native one.
13201 \begin_inset Flex Code
13204 \begin_layout Plain Layout
13210 paragraphs inside an enumeration are not indented.
13213 \begin_layout Description
13214 \begin_inset Flex Code
13217 \begin_layout Plain Layout
13224 \begin_inset Flex Code
13227 \begin_layout Plain Layout
13233 ] The vertical space between two paragraphs of this style.
13236 \begin_layout Description
13237 \begin_inset Flex Code
13240 \begin_layout Plain Layout
13247 \begin_inset Flex Code
13250 \begin_layout Plain Layout
13256 ] LyX allows the user to choose either
13257 \begin_inset Quotes eld
13261 \begin_inset Quotes erd
13265 \begin_inset Quotes eld
13269 \begin_inset Quotes erd
13272 to typeset a document.
13274 \begin_inset Quotes eld
13278 \begin_inset Quotes erd
13281 is chosen, this value is completely ignored.
13283 \begin_inset Quotes eld
13287 \begin_inset Quotes erd
13290 is chosen, the parindent of a LaTeXtype
13291 \begin_inset Quotes eld
13295 \begin_inset Quotes erd
13298 style is ignored and all paragraphs are separated by this parskip argument.
13299 The vertical space is calculated with
13300 \begin_inset Flex Code
13303 \begin_layout Plain Layout
13305 \begin_inset space ~
13314 \begin_inset Flex Code
13317 \begin_layout Plain Layout
13323 is the height of a row with the normal font.
13324 This way, the look stays the same with different screen fonts.
13327 \begin_layout Description
13328 \begin_inset Flex Code
13331 \begin_layout Plain Layout
13338 \begin_inset Flex Code
13341 \begin_layout Plain Layout
13350 \begin_inset Flex Code
13353 \begin_layout Plain Layout
13359 ] Whether the contents of this paragraph should be output in raw form, meaning
13360 without special translations that LaTeX would require.
13363 \begin_layout Description
13364 \begin_inset Flex Code
13367 \begin_layout Plain Layout
13373 Information to be included in the LaTeX preamble when this style is used.
13374 Used to define macros, load packages, etc., required by this particular
13377 \begin_inset Quotes eld
13381 \begin_inset Flex Code
13384 \begin_layout Plain Layout
13391 \begin_inset Quotes erd
13397 \begin_layout Description
13398 \begin_inset Flex Code
13401 \begin_layout Plain Layout
13408 \begin_inset Flex Code
13411 \begin_layout Plain Layout
13417 ] The prefix to use when creating labels referring to paragraphs of this
13419 This allows the use of formatted references.
13422 \begin_layout Description
13424 \change_deleted -712698321 1353681258
13425 \begin_inset Flex Code
13428 \begin_layout Plain Layout
13435 \begin_inset Flex Code
13438 \begin_layout Plain Layout
13444 ] The number of required arguments that the LaTeX command or environment
13445 corresponding to this style expects.
13446 In the case of a command, these are required arguments
13450 that associated with the content of the paragraph itself.
13451 These do not actually have to be provided: LyX will output empty arguments
13453 Note that optional arguments will be output before required arguments.
13454 See the discussion of the
13455 \begin_inset Flex Code
13458 \begin_layout Plain Layout
13464 tag above for more information.
13469 \begin_layout Description
13470 \begin_inset Flex Code
13473 \begin_layout Plain Layout
13480 \begin_inset Flex Code
13483 \begin_layout Plain Layout
13489 ] Whether the style requires the feature
13490 \begin_inset Flex Code
13493 \begin_layout Plain Layout
13500 See the description of
13501 \begin_inset Flex Code
13504 \begin_layout Plain Layout
13511 \begin_inset CommandInset ref
13512 LatexCommand pageref
13513 reference "des:FreeSpacing"
13517 ) for information on `features'.
13519 \change_inserted -712698321 1353693134
13523 \begin_layout Description
13525 \change_inserted -712698321 1353693371
13526 \begin_inset Flex Code
13529 \begin_layout Plain Layout
13531 \change_inserted -712698321 1353693146
13540 \begin_inset Flex Code
13543 \begin_layout Plain Layout
13545 \change_inserted -712698321 1353693235
13554 \begin_inset Flex Code
13557 \begin_layout Plain Layout
13559 \change_inserted -712698321 1353693235
13565 ] Resets the LaTeX arguments of this style (as defined via the
13566 \begin_inset Flex Code
13569 \begin_layout Plain Layout
13571 \change_inserted -712698321 1353693371
13580 This is useful if you have copied a style via
13581 \begin_inset Flex Code
13584 \begin_layout Plain Layout
13586 \change_inserted -712698321 1353693302
13594 , but you do not want to inherit its (required and optional) arguments.
13599 \begin_layout Description
13601 \change_inserted -712698321 1353866881
13602 \begin_inset Flex Code
13605 \begin_layout Plain Layout
13607 \change_inserted -712698321 1353866876
13614 \begin_inset Flex Code
13617 \begin_layout Plain Layout
13619 \change_inserted -712698321 1353866873
13625 ] A string that is put at the end of the layout content.
13628 \begin_layout Description
13629 \begin_inset Flex Code
13632 \begin_layout Plain Layout
13639 \begin_inset Flex Code
13642 \begin_layout Plain Layout
13649 \begin_inset Flex Code
13652 \begin_layout Plain Layout
13661 \begin_layout Description
13662 \begin_inset Flex Code
13665 \begin_layout Plain Layout
13672 \begin_inset Flex Code
13675 \begin_layout Plain Layout
13680 , onehalf, double, other
13689 ] This defines what the default spacing should be in the style.
13691 \begin_inset Flex Code
13694 \begin_layout Plain Layout
13701 \begin_inset Flex Code
13704 \begin_layout Plain Layout
13711 \begin_inset Flex Code
13714 \begin_layout Plain Layout
13720 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
13721 If you specify the argument
13722 \begin_inset Flex Code
13725 \begin_layout Plain Layout
13731 , then you should also provide a numerical argument which will be the actual
13733 Note that, contrary to other parameters,
13734 \begin_inset Flex Code
13737 \begin_layout Plain Layout
13743 implies the generation of specific LaTeX code, using the package
13746 \begin_inset Flex Code
13749 \begin_layout Plain Layout
13758 \begin_layout Description
13759 \begin_inset Flex Code
13762 \begin_layout Plain Layout
13769 \begin_inset Flex Code
13772 \begin_layout Plain Layout
13779 \begin_inset Flex Code
13782 \begin_layout Plain Layout
13790 ] Spellcheck paragraphs of this style.
13794 \begin_layout Description
13795 \begin_inset Flex Code
13798 \begin_layout Plain Layout
13804 The font used for the text body .
13806 \begin_inset CommandInset ref
13808 reference "sub:Font-description"
13815 \begin_layout Description
13816 \begin_inset Flex Code
13819 \begin_layout Plain Layout
13828 \begin_inset Flex Code
13831 \begin_layout Plain Layout
13841 The level of the style in the table of contents.
13842 This is used for automatic numbering of section headings.
13845 \begin_layout Description
13846 \begin_inset Flex Code
13849 \begin_layout Plain Layout
13856 \begin_inset Flex Code
13859 \begin_layout Plain Layout
13865 ] The vertical space with which the very first of a chain of paragraphs
13866 with this style is separated from the previous paragraph.
13867 If the previous paragraph has another style, the separations are not simply
13868 added, but the maximum is taken.
13871 \begin_layout Subsection
13872 \begin_inset CommandInset label
13878 Internationalization of Paragraph Styles
13881 \begin_layout Standard
13882 LyX has long supported internationalization of layout information, but,
13883 until version 2.0, this applied only to the user interface and not to, say,
13885 Thus, French authors were forced to resort to ugly hacks if they wanted
13890 1' instead of `Theorem 1'.
13891 Thanks to Georg Baum, that is no longer the case.
13894 \begin_layout Standard
13896 \begin_inset Flex Code
13899 \begin_layout Plain Layout
13905 defines text that is to appear in the typeset document, it may use
13906 \begin_inset Flex Code
13909 \begin_layout Plain Layout
13916 \begin_inset Flex Code
13919 \begin_layout Plain Layout
13925 to support non-English and even multi-language documents correctly.
13926 The following excerpt (from the
13927 \begin_inset Flex Code
13930 \begin_layout Plain Layout
13936 file) shows how this works:
13939 \begin_layout LyX-Code
13944 \begin_layout LyX-Code
13947 theoremstyle{remark}
13950 \begin_layout LyX-Code
13953 newtheorem{claim}[thm]{
13960 \begin_layout LyX-Code
13964 \begin_layout LyX-Code
13968 \begin_layout LyX-Code
13973 claimname}{_(Claim)}
13976 \begin_layout LyX-Code
13980 \begin_layout LyX-Code
13984 \begin_layout LyX-Code
13993 claimname}{_(Claim)}}
13996 \begin_layout LyX-Code
14001 \begin_layout Standard
14002 In principle, any legal LaTeX may appear in the
14003 \begin_inset Flex Code
14006 \begin_layout Plain Layout
14013 \begin_inset Flex Code
14016 \begin_layout Plain Layout
14022 tags, but in practice they will typically look as they do here.
14023 The key to correct translation of the typeset text is the definition of
14025 \begin_inset Flex Code
14028 \begin_layout Plain Layout
14037 \begin_inset Flex Code
14040 \begin_layout Plain Layout
14052 \begin_layout Standard
14054 \begin_inset Flex Code
14057 \begin_layout Plain Layout
14063 tag provides for internationalization based upon the overall language of
14065 The contents of the tag will be included in the preamble, just as with
14067 \begin_inset Flex Code
14070 \begin_layout Plain Layout
14077 What makes it special is the use of the
14078 \begin_inset Quotes eld
14082 \begin_inset Quotes erd
14086 \begin_inset Flex Code
14089 \begin_layout Plain Layout
14095 , which will be replaced, when LyX produces LaTeX output, with the translation
14096 of its argument into the document language.
14099 \begin_layout Standard
14101 \begin_inset Flex Code
14104 \begin_layout Plain Layout
14110 tag is more complex, since it is meant to provide support for multi-language
14111 documents and so offers an interface to the
14112 \begin_inset Flex Code
14115 \begin_layout Plain Layout
14122 Its contents will be added to the preamble once for each language that
14123 appears in the document.
14124 In this case, the argument to
14125 \begin_inset Flex Code
14128 \begin_layout Plain Layout
14134 will be replaced with its translation into the language in question; the
14136 \begin_inset Flex Code
14139 \begin_layout Plain Layout
14145 is replaced by the language name (as used by the babel package).
14148 \begin_layout Standard
14149 A German document that also included a French section would thus have the
14150 following in the preamble:
14153 \begin_layout LyX-Code
14162 claimname}{Affirmation}}
14170 claimname}{Behauptung}}
14174 claimname}{Behauptung}
14177 \begin_layout Standard
14179 \begin_inset Flex Code
14182 \begin_layout Plain Layout
14188 will then conspire to produce the correct text in the output.
14191 \begin_layout Standard
14192 One important point to note here is that the translations are provided by
14193 LyX itself, through the
14194 \change_inserted -195340706 1334775793
14196 \begin_inset Flex Code
14199 \begin_layout Plain Layout
14201 \change_inserted -195340706 1334775793
14208 \change_deleted -195340706 1334775793
14209 same mechanism it uses for internationalization of the user interface
14212 This means, in effect, that
14213 \begin_inset Flex Code
14216 \begin_layout Plain Layout
14223 \begin_inset Flex Code
14226 \begin_layout Plain Layout
14232 are really only of use in layout files that are provided with LyX, since
14233 text entered in user-created layout files will not be seen by LyX's internation
14235 \change_inserted -195340706 1334775793
14237 \begin_inset Flex Code
14240 \begin_layout Plain Layout
14242 \change_inserted -195340706 1334775793
14248 file is modified accordingly
14251 That said, however, any layout created with the intention that it will
14252 be included with LyX should use these tags where appropriate.
14254 \change_inserted -195340706 1334775793
14255 Please note that the paragraph style translations provided by LyX will
14256 never change with a minor update (e.g.
14257 from version 2.1.x to 2.1.y).
14258 It is however quite likely that a major update (e.g.
14259 from 2.0.x to 2.1.y) will introduce new translations or corrections.
14264 \begin_layout Subsection
14266 \begin_inset CommandInset label
14275 \begin_layout Standard
14276 Since version 1.3.0 of LyX, it is has been both possible and necessary to
14277 define the floats (
14278 \begin_inset Flex MenuItem
14281 \begin_layout Plain Layout
14288 \begin_inset Flex MenuItem
14291 \begin_layout Plain Layout
14297 , \SpecialChar \ldots{}
14298 ) in the text class itself.
14299 Standard floats are included in the file
14300 \begin_inset Flex Code
14303 \begin_layout Plain Layout
14309 , so you may have to do no more than add
14312 \begin_layout LyX-Code
14313 Input stdfloats.inc
14316 \begin_layout Standard
14317 to your layout file.
14318 If you want to implement a text class that proposes some other float types
14319 (like the AGU class bundled with LyX), the information below will hopefully
14323 \begin_layout Description
14324 \begin_inset Flex Code
14327 \begin_layout Plain Layout
14334 \begin_inset Flex Code
14337 \begin_layout Plain Layout
14344 \begin_inset Quotes erd
14348 \begin_inset Quotes erd
14351 ] The file name extension of an auxiliary file for the list of figures (or
14353 LaTeX writes the captions to this file.
14356 \begin_layout Description
14357 \begin_inset Flex Code
14360 \begin_layout Plain Layout
14367 \begin_inset Flex Code
14370 \begin_layout Plain Layout
14377 \begin_inset Quotes erd
14381 \begin_inset Quotes erd
14384 ] The string that will be used in the menus and also for the caption.
14385 This is translated to the current language if babel is used.
14388 \begin_layout Description
14389 \begin_inset Flex Code
14392 \begin_layout Plain Layout
14398 These are used for XHTML output.
14400 \begin_inset CommandInset ref
14402 reference "sec:Tags-for-XHTML"
14409 \begin_layout Description
14410 \begin_inset Flex Code
14413 \begin_layout Plain Layout
14422 \begin_inset Flex Code
14425 \begin_layout Plain Layout
14434 \begin_inset Flex Code
14437 \begin_layout Plain Layout
14443 ] Indicates whether the float is already defined in the document class or
14444 if we instead need to load
14445 \begin_inset Flex Code
14448 \begin_layout Plain Layout
14454 and use what it provides to define it on-the-fly.
14456 \begin_inset Flex Code
14459 \begin_layout Plain Layout
14466 \begin_inset Flex Code
14469 \begin_layout Plain Layout
14476 It should be set to
14477 \begin_inset Flex Code
14480 \begin_layout Plain Layout
14486 if the float is already defined by the LaTeX document class.
14489 \begin_layout Description
14490 \begin_inset Flex Code
14493 \begin_layout Plain Layout
14500 \begin_inset Flex Code
14503 \begin_layout Plain Layout
14510 \begin_inset Quotes erd
14514 \begin_inset Quotes erd
14517 ] The command used to generate a list of floats of this type; the leading
14520 ' should be omitted.
14526 \begin_inset Flex Code
14529 \begin_layout Plain Layout
14535 is false, since there is no standard way to generate this command.
14537 \begin_inset Flex Code
14540 \begin_layout Plain Layout
14546 is true, since in that case there is a standard way to define the command.
14549 \begin_layout Description
14550 \begin_inset Flex Code
14553 \begin_layout Plain Layout
14560 \begin_inset Flex Code
14563 \begin_layout Plain Layout
14570 \begin_inset Quotes erd
14574 \begin_inset Quotes erd
14577 ] A title for a list of floats of this kind (list of figures, tables, or
14579 It is used for the screen label within LyX; it is passed to LaTeX for use
14580 as the title there; and it is used as the title in XHTML output.
14581 It will be translated to the document language.
14584 \begin_layout Description
14585 \begin_inset Flex Code
14588 \begin_layout Plain Layout
14595 \begin_inset Flex Code
14598 \begin_layout Plain Layout
14605 \begin_inset Quotes erd
14609 \begin_inset Quotes erd
14612 ] This (optional) argument determines whether floats of this class will
14613 be numbered within some sectional unit of the document.
14614 For example, if within is equal to
14615 \begin_inset Flex Code
14618 \begin_layout Plain Layout
14624 , the floats will be numbered within chapters.
14628 \begin_layout Description
14629 \begin_inset Flex Code
14632 \begin_layout Plain Layout
14639 \begin_inset Flex Code
14642 \begin_layout Plain Layout
14649 \begin_inset Quotes erd
14653 \begin_inset Quotes erd
14656 ] The default placement for the given class of floats.
14657 The string should be as in standard LaTeX:
14658 \begin_inset Flex Code
14661 \begin_layout Plain Layout
14668 \begin_inset Flex Code
14671 \begin_layout Plain Layout
14678 \begin_inset Flex Code
14681 \begin_layout Plain Layout
14688 \begin_inset Flex Code
14691 \begin_layout Plain Layout
14697 for top, bottom, page, and here, respectively.
14701 \begin_layout Plain Layout
14702 Note that the order of these letters in the string is irrelevant, like in
14708 On top of that there is a new type,
14709 \begin_inset Flex Code
14712 \begin_layout Plain Layout
14718 , which does not really correspond to a float, since it means: put it
14719 \begin_inset Quotes eld
14723 \begin_inset Quotes erd
14727 Note however that the
14728 \begin_inset Flex Code
14731 \begin_layout Plain Layout
14737 specifier is special and, because of implementation details, cannot be
14738 used in non-built in float types.
14739 If you do not understand what this means, just use
14740 \begin_inset Quotes eld
14744 \begin_inset Flex Code
14747 \begin_layout Plain Layout
14754 \begin_inset Quotes erd
14760 \begin_layout Description
14761 \begin_inset Flex Code
14764 \begin_layout Plain Layout
14771 \begin_inset Flex Code
14774 \begin_layout Plain Layout
14780 ] The prefix to use when creating labels referring to floats of this type.
14781 This allows the use of formatted references.
14782 Note that you can remove any
14783 \begin_inset Flex Code
14786 \begin_layout Plain Layout
14792 set by a copied style by using the special value
14793 \begin_inset Quotes eld
14797 \begin_inset Quotes erd
14800 , which must be all caps.
14803 \begin_layout Description
14804 \begin_inset Flex Code
14807 \begin_layout Plain Layout
14814 \begin_inset Flex Code
14817 \begin_layout Plain Layout
14824 \begin_inset Quotes erd
14828 \begin_inset Quotes erd
14831 ] The style used when defining the float using
14832 \begin_inset Flex Code
14835 \begin_layout Plain Layout
14846 \begin_layout Description
14847 \begin_inset Flex Code
14850 \begin_layout Plain Layout
14857 \begin_inset Flex Code
14860 \begin_layout Plain Layout
14867 \begin_inset Quotes erd
14871 \begin_inset Quotes erd
14875 \begin_inset Quotes eld
14879 \begin_inset Quotes erd
14882 of the new class of floats, like program or algorithm.
14883 After the appropriate
14884 \begin_inset Flex Code
14887 \begin_layout Plain Layout
14896 \begin_inset Flex Code
14899 \begin_layout Plain Layout
14908 \begin_inset Flex Code
14911 \begin_layout Plain Layout
14922 \begin_layout Description
14923 \begin_inset Flex Code
14926 \begin_layout Plain Layout
14933 \begin_inset Flex Code
14936 \begin_layout Plain Layout
14943 \begin_inset Flex Code
14946 \begin_layout Plain Layout
14954 ] Tells us whether this float is defined using the facilities provided by
14956 \begin_inset Flex Code
14959 \begin_layout Plain Layout
14965 , either by the class file or a package, or on-the-fly by LyX itself.
14968 \begin_layout Standard
14969 Note that defining a float with type
14970 \begin_inset Flex Code
14973 \begin_layout Plain Layout
14981 automatically defines the corresponding counter with name
14982 \begin_inset Flex Code
14985 \begin_layout Plain Layout
14996 \begin_layout Subsection
14997 Flex insets and InsetLayout
14998 \begin_inset CommandInset label
15000 name "sub:Flex-insets-and"
15007 \begin_layout Standard
15008 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
15009 these are called Flex insets.
15013 \begin_layout Standard
15014 Flex insets come in three different kinds:
15017 \begin_layout Itemize
15019 \begin_inset Flex Code
15022 \begin_layout Plain Layout
15028 ): These define semantic markup corresponding to such LaTeX commands as
15030 \begin_inset Flex Code
15033 \begin_layout Plain Layout
15042 \begin_inset Flex Code
15045 \begin_layout Plain Layout
15056 \begin_layout Itemize
15058 \begin_inset Flex Code
15061 \begin_layout Plain Layout
15067 ): These can be used to define custom collapsible insets, similar to TeX
15068 code, footnote, and the like.
15069 An obvious example is an endnote inset, which is defined in the
15070 \begin_inset Flex Code
15073 \begin_layout Plain Layout
15082 \begin_layout Itemize
15084 \begin_inset Flex Code
15087 \begin_layout Plain Layout
15093 ): For use with DocBook classes.
15096 \begin_layout Standard
15097 Flex insets are defined using the
15098 \begin_inset Flex Code
15101 \begin_layout Plain Layout
15107 tag, which shall be explained in a moment.
15110 \begin_layout Standard
15112 \begin_inset Flex Code
15115 \begin_layout Plain Layout
15121 tag also serves another function: It can be used to customize the general
15122 layout of many different types of insets.
15124 \begin_inset Flex Code
15127 \begin_layout Plain Layout
15133 can be used to customize the layout parameters for footnotes, marginal
15134 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
15135 boxes, tables, algorithms, URLs, and optional arguments, as well as to
15136 define Flex insets.
15139 \begin_layout Standard
15141 \begin_inset Flex Code
15144 \begin_layout Plain Layout
15150 definition must begin with a line of the form:
15153 \begin_layout LyX-Code
15157 \begin_layout Standard
15159 \begin_inset Flex Code
15162 \begin_layout Plain Layout
15168 indicates the inset whose layout is being defined, and here there are
15169 \change_inserted 5863208 1334489266
15171 \change_deleted 5863208 1334489267
15177 \begin_layout Enumerate
15178 The layout for a pre-existing inset is being modified.
15179 In this case, can be
15180 \begin_inset Flex Code
15183 \begin_layout Plain Layout
15189 any one of the following:
15190 \begin_inset Flex Code
15193 \begin_layout Plain Layout
15200 \begin_inset Flex Code
15203 \begin_layout Plain Layout
15210 \begin_inset Flex Code
15213 \begin_layout Plain Layout
15220 \begin_inset Flex Code
15223 \begin_layout Plain Layout
15230 \begin_inset Flex Code
15233 \begin_layout Plain Layout
15240 \begin_inset Flex Code
15243 \begin_layout Plain Layout
15250 \begin_inset Flex Code
15253 \begin_layout Plain Layout
15260 \begin_inset Flex Code
15263 \begin_layout Plain Layout
15270 \begin_inset Flex Code
15273 \begin_layout Plain Layout
15280 \begin_inset Flex Code
15283 \begin_layout Plain Layout
15290 \begin_inset Flex Code
15293 \begin_layout Plain Layout
15300 \begin_inset Flex Code
15303 \begin_layout Plain Layout
15310 \begin_inset Flex Code
15313 \begin_layout Plain Layout
15320 \begin_inset Flex Code
15323 \begin_layout Plain Layout
15330 \begin_inset Flex Code
15333 \begin_layout Plain Layout
15340 \begin_inset Flex Code
15343 \begin_layout Plain Layout
15350 \begin_inset Flex Code
15353 \begin_layout Plain Layout
15360 \begin_inset Flex Code
15363 \begin_layout Plain Layout
15365 \change_deleted -712698321 1353866704
15369 \change_inserted -712698321 1353866707
15378 \begin_inset Flex Code
15381 \begin_layout Plain Layout
15388 \begin_inset Flex Code
15391 \begin_layout Plain Layout
15400 \begin_layout Enumerate
15401 The layout for a Flex inset is being defined.
15403 \begin_inset Flex Code
15406 \begin_layout Plain Layout
15412 must be of the form
15413 \begin_inset Quotes eld
15417 \begin_inset Flex Code
15420 \begin_layout Plain Layout
15427 \begin_inset Quotes erd
15431 \begin_inset Flex Code
15434 \begin_layout Plain Layout
15440 may be be any valid identifier not used by a pre-existing Flex inset.
15441 The identifier may include spaces, but in that case the whole thing must
15442 be wrapped in quotes.
15443 Note that the definition of a flex inset
15448 \begin_inset Flex Code
15451 \begin_layout Plain Layout
15457 entry, declaring which type of inset it defines.
15458 \change_inserted 5863208 1334489312
15462 \begin_layout Enumerate
15464 \change_inserted 5863208 1334492248
15465 The layout for user specific branch is being defined.
15467 \begin_inset Flex Code
15470 \begin_layout Plain Layout
15472 \change_inserted 5863208 1334489384
15478 must be of the form
15479 \begin_inset Quotes eld
15483 \begin_inset Flex Code
15486 \begin_layout Plain Layout
15488 \change_inserted 5863208 1334489392
15495 \begin_inset Quotes erd
15499 \begin_inset Flex Code
15502 \begin_layout Plain Layout
15504 \change_inserted 5863208 1334489384
15510 may be be any valid identifier of branch defined in user's document.
15511 The identifier may include spaces, but in that case the whole thing must
15512 be wrapped in quotes.
15513 The main purpose of this feature is to allow LaTeX wrapping around specific
15514 branches as user needs.
15519 \begin_layout Standard
15521 \begin_inset Flex Code
15524 \begin_layout Plain Layout
15530 definition can contain the following entries:
15533 \begin_layout Description
15535 \change_inserted -712698321 1353681390
15536 \begin_inset Flex Code
15539 \begin_layout Plain Layout
15541 \change_inserted -712698321 1353681344
15548 \begin_inset Flex Code
15551 \begin_layout Plain Layout
15553 \change_inserted -712698321 1353681344
15559 ] Defines argument number <int> of a command\SpecialChar \slash{}
15560 environment associated with
15561 the current layout.
15562 The definition must end with
15563 \begin_inset Flex Code
15566 \begin_layout Plain Layout
15568 \change_inserted -712698321 1353681344
15576 \begin_inset space ~
15580 \begin_inset CommandInset ref
15582 reference "sub:Paragraph-Styles"
15589 \begin_layout Description
15591 \change_inserted -195340706 1333913893
15592 \begin_inset Flex Code
15595 \begin_layout Plain Layout
15601 Preamble for changing languages.
15603 \begin_inset space ~
15607 \begin_inset CommandInset ref
15609 reference "sub:I18n"
15616 \begin_layout Description
15617 \begin_inset Flex Code
15620 \begin_layout Plain Layout
15626 The color for the inset's background.
15627 The valid colors are defined in
15628 \begin_inset Flex Code
15631 \begin_layout Plain Layout
15640 \begin_layout Description
15641 \begin_inset Flex Code
15644 \begin_layout Plain Layout
15651 \begin_inset Flex Code
15654 \begin_layout Plain Layout
15663 \begin_inset Flex Code
15666 \begin_layout Plain Layout
15672 ] Whether to use the content of the inset as the label, when the inset is
15677 \begin_layout Description
15678 \begin_inset Flex Code
15681 \begin_layout Plain Layout
15688 \begin_inset Flex Code
15691 \begin_layout Plain Layout
15697 Copies all the features of an existing style into the current one.
15701 \begin_layout Description
15702 \begin_inset Flex Code
15705 \begin_layout Plain Layout
15712 \begin_inset Flex Code
15715 \begin_layout Plain Layout
15724 \begin_inset Flex Code
15727 \begin_layout Plain Layout
15733 ] Indicates whether the user may employ the Paragraph Settings dialog to
15734 customize the paragraph.
15737 \begin_layout Description
15738 \begin_inset Flex Code
15741 \begin_layout Plain Layout
15748 \begin_inset Flex Code
15751 \begin_layout Plain Layout
15758 \begin_inset Flex Code
15761 \begin_layout Plain Layout
15768 \begin_inset Flex Code
15771 \begin_layout Plain Layout
15777 , describing the rendering style used for the inset's frame and buttons.
15778 Footnotes generally use
15779 \begin_inset Flex Code
15782 \begin_layout Plain Layout
15788 , ERT insets generally
15789 \begin_inset Flex Code
15792 \begin_layout Plain Layout
15798 , and character styles
15799 \begin_inset Flex Code
15802 \begin_layout Plain Layout
15811 \begin_layout Description
15812 \begin_inset Flex Code
15815 \begin_layout Plain Layout
15822 \begin_inset Flex Code
15825 \begin_layout Plain Layout
15832 \begin_inset Flex Code
15835 \begin_layout Plain Layout
15844 \begin_inset Flex Code
15847 \begin_layout Plain Layout
15854 \begin_inset Flex Code
15857 \begin_layout Plain Layout
15864 Indicates whether the environment will stand on its own in LaTeX output
15865 or will appear inline with the surrounding text.
15866 If set to false, it is supposed that the LaTeX environment ignores white
15867 space (including one newline character) after the
15868 \begin_inset Flex Code
15871 \begin_layout Plain Layout
15884 \begin_inset Flex Code
15887 \begin_layout Plain Layout
15903 \begin_layout Description
15904 \begin_inset Flex Code
15907 \begin_layout Plain Layout
15913 Required at the end of the InsetLayout declarations.
15916 \begin_layout Description
15917 \begin_inset Flex Code
15920 \begin_layout Plain Layout
15926 The font used for both the text body
15932 \begin_inset space ~
15936 \begin_inset CommandInset ref
15938 reference "sub:Font-description"
15943 Note that defining this font automatically defines the
15944 \begin_inset Flex Code
15947 \begin_layout Plain Layout
15953 to the same value, so define this first and define
15954 \begin_inset Flex Code
15957 \begin_layout Plain Layout
15963 later if you want them to be different.
15964 \change_inserted 155139281 1354130923
15968 \begin_layout Description
15970 \change_inserted 155139281 1354130923
15971 \begin_inset Flex Code
15974 \begin_layout Plain Layout
15976 \change_inserted 155139281 1354130923
15977 ForceLocalFontSwitch
15983 \begin_inset Flex Code
15986 \begin_layout Plain Layout
15988 \change_inserted 155139281 1354130923
15997 \begin_inset Flex Code
16000 \begin_layout Plain Layout
16002 \change_inserted 155139281 1354130923
16008 ] When using babel, always use a local font switch (
16009 \begin_inset Flex Code
16012 \begin_layout Plain Layout
16014 \change_inserted 155139281 1354130923
16022 ), never a global one (such as
16023 \begin_inset Flex Code
16026 \begin_layout Plain Layout
16028 \change_inserted 155139281 1354130923
16041 \begin_layout Description
16042 \begin_inset Flex Code
16045 \begin_layout Plain Layout
16052 \begin_inset Quotes eld
16056 \begin_inset Quotes erd
16059 language, leading to Left-to-Right (latin) output, e.
16060 \begin_inset space \thinspace{}
16064 \begin_inset space \space{}
16067 in TeX code or URL.
16071 \begin_layout Description
16072 \begin_inset Flex Code
16075 \begin_layout Plain Layout
16082 \begin_inset Flex Code
16085 \begin_layout Plain Layout
16094 \begin_inset Flex Code
16097 \begin_layout Plain Layout
16103 ] Indicates whether the
16104 \begin_inset Flex Code
16107 \begin_layout Plain Layout
16113 should be used or, instead, the user can change the paragraph style used
16118 \begin_layout Description
16119 \begin_inset Flex Code
16122 \begin_layout Plain Layout
16129 \begin_inset Flex Code
16132 \begin_layout Plain Layout
16141 \begin_inset Flex Code
16144 \begin_layout Plain Layout
16150 ] Usually LyX doesn't allow you to insert more than one space between words,
16151 since a space is considered as the separation between two words, not a
16152 character or symbol of its own.
16153 This is a very fine thing but sometimes annoying, for example, when typing
16154 program code or plain LaTeX code.
16156 \begin_inset Flex Code
16159 \begin_layout Plain Layout
16166 Note that LyX will create protected blanks for the additional blanks when
16167 in another mode than LaTeX-mode.
16171 \begin_layout Description
16172 \begin_inset Flex Code
16175 \begin_layout Plain Layout
16181 These tags control XHTML output.
16183 \begin_inset CommandInset ref
16185 reference "sec:Tags-for-XHTML"
16192 \begin_layout Description
16193 \begin_inset Flex Code
16196 \begin_layout Plain Layout
16203 \begin_inset Flex Code
16206 \begin_layout Plain Layout
16215 \begin_inset Flex Code
16218 \begin_layout Plain Layout
16224 ] Whether to include the contents of this inset in the strings generated
16225 for the `Outline' pane.
16226 One would not, for example, want the content of a footnote in a section
16227 header to be included in the TOC displayed in the outline, but one would
16228 normally want the content of a character style displayed.
16229 Default is false: not to include.
16232 \begin_layout Description
16233 \begin_inset Flex Code
16236 \begin_layout Plain Layout
16243 \begin_inset Flex Code
16246 \begin_layout Plain Layout
16255 \begin_inset Flex Code
16258 \begin_layout Plain Layout
16264 ] Usually LyX does not allow you to leave a paragraph empty, since it would
16265 lead to empty LaTeX output.
16266 There are some cases where this could be desirable however: in a letter
16267 template, the required fields can be provided as empty fields, so that
16268 people do not forget them; in some special classes, a style can be used
16269 as some kind of break, which does not contain actual text.
16273 \begin_layout Description
16274 \begin_inset Flex Code
16277 \begin_layout Plain Layout
16283 The font used for the label.
16285 \begin_inset space ~
16289 \begin_inset CommandInset ref
16291 reference "sub:Font-description"
16296 Note that this definition can never appear before
16297 \begin_inset Flex Code
16300 \begin_layout Plain Layout
16306 , lest it be ineffective.
16309 \begin_layout Description
16310 \begin_inset Flex Code
16313 \begin_layout Plain Layout
16319 What will be displayed on the button or elsewhere as the inset label.
16321 \begin_inset Flex Code
16324 \begin_layout Plain Layout
16331 \begin_inset Flex Code
16334 \begin_layout Plain Layout
16340 ) modify this label on the fly.
16343 \begin_layout Description
16345 \change_inserted -195340706 1333913893
16346 \begin_inset Flex Code
16349 \begin_layout Plain Layout
16355 Language dependent preamble.
16357 \begin_inset space ~
16361 \begin_inset CommandInset ref
16363 reference "sub:I18n"
16370 \begin_layout Description
16371 \begin_inset Flex Code
16374 \begin_layout Plain Layout
16380 The name of the corresponding LaTeX stuff.
16381 Either the environment or command name.
16384 \begin_layout Description
16385 \begin_inset Flex Code
16388 \begin_layout Plain Layout
16394 The optional parameter for the corresponding
16395 \begin_inset Flex Code
16398 \begin_layout Plain Layout
16404 stuff, including possible bracket pairs like
16405 \begin_inset Flex Code
16408 \begin_layout Plain Layout
16415 This parameter cannot be changed from within LyX.
16418 \begin_layout Description
16419 \begin_inset Flex Code
16422 \begin_layout Plain Layout
16429 \begin_inset Flex Code
16432 \begin_layout Plain Layout
16434 \change_deleted -712698321 1353867544
16441 Command, Environment,
16442 \change_inserted -712698321 1353867573
16444 \change_deleted -712698321 1353867557
16453 \begin_inset Flex Code
16456 \begin_layout Plain Layout
16458 \change_deleted -712698321 1353867564
16462 \change_deleted -712698321 1353867569
16470 ] How the style should be translated into LaTeX.
16474 \begin_layout Plain Layout
16475 \begin_inset Flex Code
16478 \begin_layout Plain Layout
16484 is perhaps a bit misleading, since these rules apply to SGML classes, too.
16485 Visit the SGML class files for specific examples.
16494 \begin_layout Itemize
16495 \begin_inset Flex Code
16498 \begin_layout Plain Layout
16500 \change_deleted -712698321 1353867582
16502 \change_inserted -712698321 1353867583
16510 means nothing special.
16514 \begin_layout Itemize
16515 \begin_inset Flex Code
16518 \begin_layout Plain Layout
16525 \begin_inset Flex Code
16528 \begin_layout Plain Layout
16535 {\SpecialChar \ldots{}
16544 \begin_layout Itemize
16545 \begin_inset Flex Code
16548 \begin_layout Plain Layout
16555 \begin_inset Flex Code
16558 \begin_layout Plain Layout
16565 }\SpecialChar \ldots{}
16581 \begin_layout Itemize
16583 \change_deleted -712698321 1353867600
16584 \begin_inset Flex Code
16587 \begin_layout Plain Layout
16594 \begin_inset Flex Code
16597 \begin_layout Plain Layout
16604 \begin_inset Flex Code
16607 \begin_layout Plain Layout
16615 is generated for each paragraph of this environment.
16619 \begin_layout Itemize
16621 \change_deleted -712698321 1353867600
16622 \begin_inset Flex Code
16625 \begin_layout Plain Layout
16632 \begin_inset Flex Code
16635 \begin_layout Plain Layout
16642 \begin_inset Flex Code
16645 \begin_layout Plain Layout
16651 is passed as an argument to the environment.
16653 \begin_inset Flex Code
16656 \begin_layout Plain Layout
16662 can be defined in the
16663 \begin_inset Flex MenuItem
16666 \begin_layout Plain Layout
16671 \SpecialChar \menuseparator
16677 \begin_inset space ~
16691 \begin_layout Standard
16692 Putting the last few things together, the LaTeX output will be either:
16695 \begin_layout LyX-Code
16698 latexname[latexparam]{\SpecialChar \ldots{}
16702 \begin_layout Standard
16706 \begin_layout LyX-Code
16709 begin{latexname}[latexparam] \SpecialChar \ldots{}
16715 \begin_layout Standard
16716 depending upon the LaTeX type.
16720 \begin_layout Description
16722 \change_inserted -712698321 1353866797
16723 \begin_inset Flex Code
16726 \begin_layout Plain Layout
16728 \change_inserted -712698321 1353866742
16737 \begin_inset Flex Code
16740 \begin_layout Plain Layout
16742 \change_inserted -712698321 1353866752
16748 ] A string that is put at the beginning of the layout content.
16749 \change_inserted 155139281 1354130509
16753 \begin_layout Description
16754 \begin_inset Flex Code
16757 \begin_layout Plain Layout
16764 \begin_inset Flex Code
16767 \begin_layout Plain Layout
16774 \begin_inset Flex Code
16777 \begin_layout Plain Layout
16784 \begin_inset Flex Code
16787 \begin_layout Plain Layout
16794 \begin_inset Flex Code
16797 \begin_layout Plain Layout
16803 (indicating a dummy definition ending definitions of charstyles, etc).
16804 This entry is required in and is only meaningful for Flex insets.
16805 Among other things, it determines on which menu this inset will appear.
16807 \begin_inset Flex Code
16810 \begin_layout Plain Layout
16817 \begin_inset Flex Code
16820 \begin_layout Plain Layout
16827 \begin_inset Flex Code
16830 \begin_layout Plain Layout
16838 \begin_inset Flex Code
16841 \begin_layout Plain Layout
16847 can be set to true for charstyle insets, if you wish, by setting it
16852 \begin_inset Flex Code
16855 \begin_layout Plain Layout
16864 \begin_layout Description
16865 \begin_inset Flex Code
16868 \begin_layout Plain Layout
16875 \begin_inset Flex Code
16878 \begin_layout Plain Layout
16887 \begin_inset Flex Code
16890 \begin_layout Plain Layout
16896 ] Whether multiple paragraphs are permitted in this inset.
16898 \begin_inset Flex Code
16901 \begin_layout Plain Layout
16907 to the same value and
16908 \begin_inset Flex Code
16911 \begin_layout Plain Layout
16917 to the opposite value.
16918 These can be reset to other values, if they are used
16923 \begin_inset Flex Code
16926 \begin_layout Plain Layout
16936 \begin_layout Description
16937 \begin_inset Flex Code
16940 \begin_layout Plain Layout
16947 \begin_inset Flex Code
16950 \begin_layout Plain Layout
16959 \begin_inset Flex Code
16962 \begin_layout Plain Layout
16968 ] Whether fragile commands in this inset should be
16969 \begin_inset Flex Code
16972 \begin_layout Plain Layout
16985 whether the command should itself be protected.) Default is false.
16988 \begin_layout Description
16989 \begin_inset Flex Code
16992 \begin_layout Plain Layout
16999 \begin_inset Flex Code
17002 \begin_layout Plain Layout
17011 \begin_inset Flex Code
17014 \begin_layout Plain Layout
17020 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
17021 output, but only by a line break; together with
17022 \begin_inset Flex Code
17025 \begin_layout Plain Layout
17031 , this allows to emulate a plain text editor (like the ERT inset).
17035 \begin_layout Description
17036 \begin_inset Flex Code
17039 \begin_layout Plain Layout
17046 \begin_inset Flex Code
17049 \begin_layout Plain Layout
17058 \begin_inset Flex Code
17061 \begin_layout Plain Layout
17067 ] Whether the contents of this paragraph should be output in raw form, meaning
17068 without special translations that LaTeX would require.
17071 \begin_layout Description
17072 \begin_inset Flex Code
17075 \begin_layout Plain Layout
17081 Information to be included in the LaTeX preamble when this style is used.
17082 Used to define macros, load packages, etc., required by this particular
17085 \begin_inset Quotes eld
17089 \begin_inset Flex Code
17092 \begin_layout Plain Layout
17099 \begin_inset Quotes erd
17105 \begin_layout Description
17106 \begin_inset Flex Code
17109 \begin_layout Plain Layout
17116 \begin_inset Flex Code
17119 \begin_layout Plain Layout
17125 ] The prefix to use when creating labels referring to insets of this type.
17126 This allows the use of formatted references.
17129 \begin_layout Description
17130 \begin_inset Flex Code
17133 \begin_layout Plain Layout
17140 \begin_inset Flex Code
17143 \begin_layout Plain Layout
17149 ] Whether the style requires the feature
17150 \begin_inset Flex Code
17153 \begin_layout Plain Layout
17160 See the description of
17161 \begin_inset Flex Code
17164 \begin_layout Plain Layout
17171 \begin_inset CommandInset ref
17172 LatexCommand pageref
17173 reference "des:FreeSpacing"
17177 ) for information on `features'.
17181 \begin_layout Description
17182 \begin_inset Flex Code
17185 \begin_layout Plain Layout
17192 \begin_inset Flex Code
17195 \begin_layout Plain Layout
17202 \begin_inset Flex Code
17205 \begin_layout Plain Layout
17213 ] Whether this inset should use the font of its surrounding environment
17215 Default is true: uses its own.
17216 \change_inserted -712698321 1353866806
17220 \begin_layout Description
17222 \change_inserted -712698321 1353866814
17223 \begin_inset Flex Code
17226 \begin_layout Plain Layout
17228 \change_inserted -712698321 1353866810
17235 \begin_inset Flex Code
17238 \begin_layout Plain Layout
17240 \change_inserted -712698321 1353866806
17246 ] A string that is put at the end of the layout content.
17251 \begin_layout Description
17252 \begin_inset Flex Code
17255 \begin_layout Plain Layout
17262 \begin_inset Flex Code
17265 \begin_layout Plain Layout
17272 \begin_inset Flex Code
17275 \begin_layout Plain Layout
17283 ] Spellcheck the contents of this inset.
17287 \begin_layout Subsection
17289 \begin_inset CommandInset label
17291 name "sub:Counters"
17298 \begin_layout Standard
17299 Since version 1.3.0 of LyX, it is both possible and necessary to define the
17301 \begin_inset Flex MenuItem
17304 \begin_layout Plain Layout
17311 \begin_inset Flex MenuItem
17314 \begin_layout Plain Layout
17320 , \SpecialChar \ldots{}
17321 ) in the text class itself.
17322 The standard counters are defined in the file
17323 \begin_inset Flex Code
17326 \begin_layout Plain Layout
17332 , so you may have to do no more than add
17335 \begin_layout LyX-Code
17336 Input stdcounters.inc
17339 \begin_layout Standard
17340 to your layout file to get them to work.
17341 But if you want to define custom counters, then you can do so.
17342 The counter declaration must begin with:
17345 \begin_layout LyX-Code
17346 Counter CounterName
17349 \begin_layout Standard
17351 \begin_inset Flex Code
17354 \begin_layout Plain Layout
17360 ' is replaced by the name of the counter.
17361 And it must end with
17362 \begin_inset Quotes eld
17366 \begin_inset Flex Code
17369 \begin_layout Plain Layout
17376 \begin_inset Quotes erd
17380 The following parameters can also be used:
17383 \begin_layout Description
17384 \begin_inset Flex Code
17387 \begin_layout Plain Layout
17394 \begin_inset Flex Code
17397 \begin_layout Plain Layout
17404 \begin_inset Quotes erd
17408 \begin_inset Quotes erd
17411 ] When defined, this string defines how the counter is displayed.
17412 Setting this value sets
17413 \begin_inset Flex Code
17416 \begin_layout Plain Layout
17417 LabelStringAppendix
17423 The following special constructs can be used in the string:
17427 \begin_layout Itemize
17428 \begin_inset Flex Code
17431 \begin_layout Plain Layout
17439 will be replaced by the expansion of the
17440 \begin_inset Flex Code
17443 \begin_layout Plain Layout
17450 \begin_inset Flex Code
17453 \begin_layout Plain Layout
17454 LabelStringAppendix
17460 \begin_inset Flex Code
17463 \begin_layout Plain Layout
17473 \begin_layout Itemize
17474 counter values can be expressed using LaTeX-like macros
17475 \begin_inset Flex Code
17478 \begin_layout Plain Layout
17495 \begin_inset Flex Code
17498 \begin_layout Plain Layout
17510 \begin_layout Plain Layout
17520 Actually, the situation is a bit more complicated: any
17539 other than those described below will produce arabic numerals.
17540 It would not be surprising to see this change in the future.
17546 \begin_inset Flex Code
17549 \begin_layout Plain Layout
17555 : 1, 2, 3,\SpecialChar \ldots{}
17557 \begin_inset Flex Code
17560 \begin_layout Plain Layout
17566 for lower-case letters: a, b, c, \SpecialChar \ldots{}
17568 \begin_inset Flex Code
17571 \begin_layout Plain Layout
17577 for upper-case letters: A, B, C, \SpecialChar \ldots{}
17579 \begin_inset Flex Code
17582 \begin_layout Plain Layout
17588 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
17590 \begin_inset Flex Code
17593 \begin_layout Plain Layout
17599 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
17601 \begin_inset Flex Code
17604 \begin_layout Plain Layout
17610 for hebrew numerals.
17614 \begin_layout Standard
17615 If LabelString is not defined, a default value is constructed as follows:
17616 if the counter has a master counter
17617 \begin_inset Flex Code
17620 \begin_layout Plain Layout
17627 \begin_inset Flex Code
17630 \begin_layout Plain Layout
17637 \begin_inset Flex Code
17640 \begin_layout Plain Layout
17650 is used; otherwise the string
17651 \begin_inset Flex Code
17654 \begin_layout Plain Layout
17665 \begin_layout Description
17666 \begin_inset Flex Code
17669 \begin_layout Plain Layout
17670 LabelStringAppendix
17676 \begin_inset Flex Code
17679 \begin_layout Plain Layout
17686 \begin_inset Quotes erd
17690 \begin_inset Quotes erd
17694 \begin_inset Flex Code
17697 \begin_layout Plain Layout
17703 , but for use in the Appendix.
17706 \begin_layout Description
17707 \begin_inset Flex Code
17710 \begin_layout Plain Layout
17717 \begin_inset Flex Code
17720 \begin_layout Plain Layout
17727 \begin_inset Quotes erd
17731 \begin_inset Quotes erd
17734 ] A format for use with formatted references to this counter.
17735 For example, one might want to have references to section numbers appear
17737 \begin_inset Quotes eld
17741 \begin_inset Quotes erd
17745 The string should contain
17746 \begin_inset Quotes eld
17750 \begin_inset Quotes erd
17754 This will be replaced by the counter number itself.
17755 So, for sections, it would be: Section ##.
17758 \begin_layout Description
17759 \begin_inset Flex Code
17762 \begin_layout Plain Layout
17769 \begin_inset Flex Code
17772 \begin_layout Plain Layout
17779 \begin_inset Quotes erd
17783 \begin_inset Quotes erd
17786 ] If this is set to the name of another counter, the present counter will
17787 be reset every time the other one is increased.
17789 \begin_inset Flex Code
17792 \begin_layout Plain Layout
17799 \begin_inset Flex Code
17802 \begin_layout Plain Layout
17811 \begin_layout Subsection
17813 \begin_inset CommandInset label
17815 name "sub:Font-description"
17822 \begin_layout Standard
17823 A font description looks like this:
17826 \begin_layout LyX-Code
17836 \begin_layout LyX-Code
17840 \begin_layout LyX-Code
17844 \begin_layout Standard
17845 The following commands are available:
17848 \begin_layout Description
17849 \begin_inset Flex Code
17852 \begin_layout Plain Layout
17859 \begin_inset Flex Code
17862 \begin_layout Plain Layout
17871 \begin_inset Flex Code
17874 \begin_layout Plain Layout
17881 \begin_inset Flex Code
17884 \begin_layout Plain Layout
17891 \begin_inset Flex Code
17894 \begin_layout Plain Layout
17901 \begin_inset Flex Code
17904 \begin_layout Plain Layout
17911 \begin_inset Flex Code
17914 \begin_layout Plain Layout
17921 \begin_inset Flex Code
17924 \begin_layout Plain Layout
17931 \begin_inset Flex Code
17934 \begin_layout Plain Layout
17941 \begin_inset Flex Code
17944 \begin_layout Plain Layout
17953 \begin_layout Description
17954 \begin_inset Flex Code
17957 \begin_layout Plain Layout
17964 \begin_inset Flex Code
17967 \begin_layout Plain Layout
17976 \begin_inset Flex Code
17979 \begin_layout Plain Layout
17986 \begin_inset Flex Code
17989 \begin_layout Plain Layout
17998 \begin_layout Description
17999 \begin_inset Flex Code
18002 \begin_layout Plain Layout
18009 \begin_inset Flex Code
18012 \begin_layout Plain Layout
18018 ] Valid arguments are:
18019 \begin_inset Flex Code
18022 \begin_layout Plain Layout
18029 \begin_inset Flex Code
18032 \begin_layout Plain Layout
18039 \begin_inset Flex Code
18042 \begin_layout Plain Layout
18049 \begin_inset Flex Code
18052 \begin_layout Plain Layout
18059 \begin_inset Flex Code
18062 \begin_layout Plain Layout
18069 \begin_inset Flex Code
18072 \begin_layout Plain Layout
18079 \begin_inset Flex Code
18082 \begin_layout Plain Layout
18089 \begin_inset Flex Code
18092 \begin_layout Plain Layout
18099 \begin_inset Flex Code
18102 \begin_layout Plain Layout
18109 \begin_inset Flex Code
18112 \begin_layout Plain Layout
18119 \begin_inset Flex Code
18122 \begin_layout Plain Layout
18129 \begin_inset Flex Code
18132 \begin_layout Plain Layout
18139 Each of these turns on or off the corresponding attribute.
18141 \begin_inset Flex Code
18144 \begin_layout Plain Layout
18150 turns on emphasis, and
18151 \begin_inset Flex Code
18154 \begin_layout Plain Layout
18162 \begin_inset Newline newline
18165 If the latter seems puzzling, remember that the font settings for the present
18166 context are generally inherited from the surrounding context.
18168 \begin_inset Flex Code
18171 \begin_layout Plain Layout
18177 would turn off the emphasis that was anyway in effect, say, in a theorem
18181 \begin_layout Description
18182 \begin_inset Flex Code
18185 \begin_layout Plain Layout
18192 \begin_inset Flex Code
18195 \begin_layout Plain Layout
18204 \begin_inset Flex Code
18207 \begin_layout Plain Layout
18216 \begin_layout Description
18217 \begin_inset Flex Code
18220 \begin_layout Plain Layout
18227 \begin_inset Flex Code
18230 \begin_layout Plain Layout
18239 \begin_inset Flex Code
18242 \begin_layout Plain Layout
18249 \begin_inset Flex Code
18252 \begin_layout Plain Layout
18259 \begin_inset Flex Code
18262 \begin_layout Plain Layout
18271 \begin_layout Description
18272 \begin_inset Flex Code
18275 \begin_layout Plain Layout
18282 \begin_inset Flex Code
18285 \begin_layout Plain Layout
18292 \begin_inset Flex Code
18295 \begin_layout Plain Layout
18302 \begin_inset Flex Code
18305 \begin_layout Plain Layout
18314 \begin_inset Flex Code
18317 \begin_layout Plain Layout
18324 \begin_inset Flex Code
18327 \begin_layout Plain Layout
18334 \begin_inset Flex Code
18337 \begin_layout Plain Layout
18344 \begin_inset Flex Code
18347 \begin_layout Plain Layout
18354 \begin_inset Flex Code
18357 \begin_layout Plain Layout
18366 \begin_layout Subsection
18367 \begin_inset CommandInset label
18369 name "sub:Citation-format-description"
18373 Citation format description
18376 \begin_layout Standard
18378 \begin_inset Flex Code
18381 \begin_layout Plain Layout
18387 blocks are used to describe how bibliographic information should be displayed,
18388 both within LyX itself (in the citation dialog and in tooltips, for example)
18389 and in XHTML output.
18390 Such a block might look like this:
18393 \begin_layout LyX-Code
18397 \begin_layout LyX-Code
18401 \begin_layout LyX-Code
18405 \begin_layout LyX-Code
18409 \begin_layout Standard
18410 The individual lines define how the bibliographic information associated
18411 with an article or book, respectively, is to be displayed, and such a definitio
18412 n can be given for any `entry type' that might be present in a BibTeX file.
18413 LyX defines a default format in the source code that will be used if no
18414 specific definition has been given.
18415 LyX predefines several formats in the file
18416 \begin_inset Flex Code
18419 \begin_layout Plain Layout
18425 , which is included in most of LyX's document classes.
18428 \begin_layout Standard
18429 The definitions use a simple language that allows BibTeX keys to be replaced
18431 Keys should be enclosed in
18432 \begin_inset Flex Code
18435 \begin_layout Plain Layout
18442 \begin_inset Flex Code
18445 \begin_layout Plain Layout
18452 So a simple definition might look like this:
18455 \begin_layout LyX-Code
18457 \begin_inset Quotes eld
18461 \begin_inset Quotes erd
18467 \begin_layout Standard
18468 This would print the author, followed by a comma, followed by the title,
18469 in quotes, followed by a period.
18472 \begin_layout Standard
18473 Of course, sometimes you may want to print a key only if it exists.
18474 This can be done by using a conditional construction, such as:
18475 \begin_inset Flex Code
18478 \begin_layout Plain Layout
18480 \begin_inset space ~
18490 \begin_inset Flex Code
18493 \begin_layout Plain Layout
18499 key exists, then print
18500 \begin_inset Quotes eld
18504 \begin_inset space ~
18508 \begin_inset Quotes erd
18511 followed by the volume key.
18512 It is also possible to have an else clause in the conditional, such as:
18514 \begin_inset Flex Code
18517 \begin_layout Plain Layout
18518 {%author%[[%author%]][[%editor%, ed.]]}
18525 \begin_inset Flex Code
18528 \begin_layout Plain Layout
18534 key is printed if it exists; otherwise, the editor key is printed, followed
18536 \begin_inset Quotes eld
18540 \begin_inset space ~
18544 \begin_inset Quotes erd
18547 Note that the key is again enclosed in
18548 \begin_inset Flex Code
18551 \begin_layout Plain Layout
18557 signs; the entire conditional is enclosed in braces; and the if and else
18558 clauses are enclosed in double brackets,
18559 \begin_inset Quotes eld
18563 \begin_inset Flex Code
18566 \begin_layout Plain Layout
18573 \begin_inset Quotes eld
18577 \begin_inset Quotes eld
18581 \begin_inset Flex Code
18584 \begin_layout Plain Layout
18591 \begin_inset Quotes erd
18595 There must be no space between any of these.
18598 \begin_layout Standard
18599 There is one other piece of syntax available in definitions, which looks
18601 \begin_inset Flex Code
18604 \begin_layout Plain Layout
18611 This defines a piece of formatting information that is to be used when
18613 \begin_inset Quotes eld
18617 \begin_inset Quotes erd
18621 Obviously, we do not want to output HTML tags when writing plain text,
18622 so they should be wrapped in
18623 \begin_inset Quotes eld
18627 \begin_inset Quotes erd
18631 \begin_inset Quotes eld
18635 \begin_inset Quotes erd
18641 \begin_layout Standard
18642 Two special sorts of definitions are also possible in a
18643 \begin_inset Flex Code
18646 \begin_layout Plain Layout
18653 An example of the first would be:
18656 \begin_layout LyX-Code
18658 \begin_inset Quotes eld
18662 \begin_inset Quotes erd
18668 \begin_layout Standard
18669 This is an abbreviation, or macro, and it can be used by treating it as
18671 \begin_inset Flex Code
18674 \begin_layout Plain Layout
18682 \begin_inset Flex Code
18685 \begin_layout Plain Layout
18691 exactly as it would treat its definition.
18692 So, let us issue the obvious
18700 \begin_layout LyX-Code
18704 \begin_layout Standard
18705 or anything like it.
18706 LyX shouldn't go into an infinite loop, but it may go into a long one before
18710 \begin_layout Standard
18711 The second sort of special definition might look like this:
18714 \begin_layout LyX-Code
18718 \begin_layout Standard
18719 This defines a translatable piece of text, which allows relevant parts of
18720 the bibliography to be translated.
18721 It can be included in a definition by treating it as a key:
18722 \begin_inset Flex Code
18725 \begin_layout Plain Layout
18732 Several of these are predefined in
18733 \begin_inset Flex Code
18736 \begin_layout Plain Layout
18743 Note that these are not macros, in the sense just defined.
18744 They will not be expanded.
18747 \begin_layout Standard
18748 So here then is an example that use all these features:
18751 \begin_layout LyX-Code
18752 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
18755 \begin_layout Standard
18756 This defines a macro that prints the author, followed by a comma, if the
18758 \begin_inset Flex Code
18761 \begin_layout Plain Layout
18767 key is defined, or else prints the name of the editor, followed by the
18769 \begin_inset Flex Code
18772 \begin_layout Plain Layout
18778 or its translation (it is by default
18779 \begin_inset Quotes eld
18783 \begin_inset Quotes erd
18787 \begin_inset Flex Code
18790 \begin_layout Plain Layout
18797 Note that this is in fact defined in
18798 \begin_inset Flex Code
18801 \begin_layout Plain Layout
18807 , so you can use it in your own definitions, or re-definitions, if you load
18811 \begin_layout Section
18812 \begin_inset CommandInset label
18814 name "sec:Tags-for-XHTML"
18818 Tags for XHTML output
18821 \begin_layout Standard
18822 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
18823 by layout information.
18824 In general, LyX provides sensible defaults and, as mentioned earlier, it
18825 will even construct default CSS style rules from the other layout tags.
18826 For example, LyX will attempt to use the information provided in the
18827 \begin_inset Flex Code
18830 \begin_layout Plain Layout
18836 declaration for the Chapter style to write CSS that will appropriately
18837 format chapter headings.
18840 \begin_layout Standard
18841 In many cases, then, you may not have to do anything at all to get acceptable
18842 XHTML output for your own environments, custom insets, and so forth.
18843 But in some cases you will, and so LyX provides a number of layout tags
18844 that can be used to customize the XHTML and CSS that are generated.
18847 \begin_layout Standard
18848 Note that there are two tags,
18849 \begin_inset Flex Code
18852 \begin_layout Plain Layout
18859 \begin_inset Flex Code
18862 \begin_layout Plain Layout
18868 that may appear outside style and inset declarations.
18870 \begin_inset CommandInset ref
18872 reference "sub:General-text-class"
18876 for details on these.
18879 \begin_layout Subsection
18880 \begin_inset CommandInset label
18882 name "sub:Paragraph-Style-XHTML"
18889 \begin_layout Standard
18890 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
18891 dealing with a normal paragraph, a command, or an environment, where this
18892 is itself determined by the contents of the corresponding
18893 \begin_inset Flex Code
18896 \begin_layout Plain Layout
18906 \begin_layout Standard
18907 For a command or normal paragraph, the output XHTML has the following form:
18910 \begin_layout LyX-Code
18912 \begin_inset Quotes erd
18916 \begin_inset Quotes erd
18922 \begin_layout LyX-Code
18924 \begin_inset Quotes erd
18928 \begin_inset Quotes erd
18934 \begin_layout LyX-Code
18935 Contents of the paragraph.
18938 \begin_layout LyX-Code
18942 \begin_layout Standard
18943 The label tags are of course omitted if the paragraph does not have a label.
18946 \begin_layout Standard
18947 For an environment that is not some sort of list, the XHTML takes this form:
18950 \begin_layout LyX-Code
18952 \begin_inset Quotes erd
18956 \begin_inset Quotes erd
18962 \begin_layout LyX-Code
18964 \begin_inset Quotes erd
18968 \begin_inset Quotes erd
18972 \begin_inset Quotes erd
18976 \begin_inset Quotes erd
18979 >Environment Label</labeltag>First paragraph.</itemtag>
18982 \begin_layout LyX-Code
18983 <itemtag>Second paragraph.</itemtag>
18986 \begin_layout LyX-Code
18990 \begin_layout Standard
18991 Note that the label is output only for the first paragraph, as it should
18992 be for a theorem, for example.
18996 \begin_layout Standard
18997 For a list, we have one of these forms:
19000 \begin_layout LyX-Code
19002 \begin_inset Quotes erd
19006 \begin_inset Quotes erd
19012 \begin_layout LyX-Code
19014 \begin_inset Quotes erd
19018 \begin_inset Quotes erd
19022 \begin_inset Quotes erd
19026 \begin_inset Quotes erd
19029 >List Label</labeltag>First item.</itemtag>
19032 \begin_layout LyX-Code
19034 \begin_inset Quotes erd
19038 \begin_inset Quotes erd
19042 \begin_inset Quotes erd
19046 \begin_inset Quotes erd
19049 >List Label</labeltag>Second item.</itemtag>
19052 \begin_layout LyX-Code
19056 \begin_layout LyX-Code
19060 \begin_layout LyX-Code
19062 \begin_inset Quotes erd
19066 \begin_inset Quotes erd
19072 \begin_layout LyX-Code
19074 \begin_inset Quotes erd
19078 \begin_inset Quotes erd
19081 >List Label</labeltag><itemtag attr=
19082 \begin_inset Quotes erd
19086 \begin_inset Quotes erd
19089 >First item.</itemtag>
19092 \begin_layout LyX-Code
19094 \begin_inset Quotes erd
19098 \begin_inset Quotes erd
19101 >List Label</labeltag><itemtag attr=
19102 \begin_inset Quotes erd
19106 \begin_inset Quotes erd
19109 >Second item.</itemtag>
19112 \begin_layout LyX-Code
19116 \begin_layout Standard
19117 Note the different orders of
19118 \begin_inset Flex Code
19121 \begin_layout Plain Layout
19128 \begin_inset Flex Code
19131 \begin_layout Plain Layout
19138 Which order we get depends upon the setting of
19139 \begin_inset Flex Code
19142 \begin_layout Plain Layout
19149 \begin_inset Flex Code
19152 \begin_layout Plain Layout
19158 is false (the default), you get the first of these, with the label within
19159 the item; if true, you get the second, with the label outside the item.
19162 \begin_layout Standard
19163 The specific tags and attributes output for each paragraph type can be controlle
19164 d by means of the layout tags we are about to describe.
19165 As mentioned earlier, however, LyX uses sensible defaults for many of these,
19166 so you often may not need to do very much to get good XHTML output.
19167 Think of the available tags as there so you can tweak things to your liking.
19170 \begin_layout Description
19171 \begin_inset Flex Code
19174 \begin_layout Plain Layout
19181 \begin_inset Flex Code
19184 \begin_layout Plain Layout
19190 ] Specifies attribute information to be output with the main tag.
19192 \begin_inset Quotes eld
19196 \begin_inset Flex Code
19199 \begin_layout Plain Layout
19206 \begin_inset Quotes erd
19210 By default, LyX will output
19211 \begin_inset Quotes eld
19215 \begin_inset Flex Code
19218 \begin_layout Plain Layout
19225 \begin_inset Quotes erd
19229 \begin_inset Flex Code
19232 \begin_layout Plain Layout
19238 is the LyX name of the layout, made lowercase, for example: chapter.
19243 contain any style information.
19245 \begin_inset Flex Code
19248 \begin_layout Plain Layout
19257 \begin_layout Description
19258 \begin_inset Flex Code
19261 \begin_layout Plain Layout
19268 \begin_inset Flex Code
19271 \begin_layout Plain Layout
19281 ] Whether to output the default CSS information LyX generates for this layout,
19282 even if additional information is explicitly provided via
19283 \begin_inset Flex Code
19286 \begin_layout Plain Layout
19294 \begin_inset Flex Code
19297 \begin_layout Plain Layout
19303 allows you to alter or augment the generated CSS, rather than to override
19306 \begin_inset Flex Code
19309 \begin_layout Plain Layout
19318 \begin_layout Description
19319 \begin_inset Flex Code
19322 \begin_layout Plain Layout
19329 \begin_inset Flex Code
19332 \begin_layout Plain Layout
19338 ] The tag to be used for individual paragraphs of environments, replacing
19340 \begin_inset Flex Code
19343 \begin_layout Plain Layout
19349 in the examples above.
19351 \begin_inset Flex Code
19354 \begin_layout Plain Layout
19363 \begin_layout Description
19364 \begin_inset Flex Code
19367 \begin_layout Plain Layout
19374 \begin_inset Flex Code
19377 \begin_layout Plain Layout
19383 ] Attributes for the item tag.
19385 \begin_inset Quotes eld
19389 \begin_inset Flex Code
19392 \begin_layout Plain Layout
19393 class=`layoutname_item'
19399 \begin_inset Quotes erd
19407 contain any style information.
19409 \begin_inset Flex Code
19412 \begin_layout Plain Layout
19421 \begin_layout Description
19422 \begin_inset Flex Code
19425 \begin_layout Plain Layout
19432 \begin_inset Flex Code
19435 \begin_layout Plain Layout
19441 ] The tag to be used for paragraph and item labels, replacing
19442 \begin_inset Flex Code
19445 \begin_layout Plain Layout
19451 in the examples above.
19453 \begin_inset Flex Code
19456 \begin_layout Plain Layout
19463 \begin_inset Flex Code
19466 \begin_layout Plain Layout
19473 \begin_inset Flex Code
19476 \begin_layout Plain Layout
19483 \begin_inset Flex Code
19486 \begin_layout Plain Layout
19487 Centered_Top_Environment
19492 , in which case it defaults to
19493 \begin_inset Flex Code
19496 \begin_layout Plain Layout
19505 \begin_layout Description
19506 \begin_inset Flex Code
19509 \begin_layout Plain Layout
19516 \begin_inset Flex Code
19519 \begin_layout Plain Layout
19525 ] Attributes for the label tag.
19527 \begin_inset Quotes eld
19531 \begin_inset Flex Code
19534 \begin_layout Plain Layout
19535 class=`layoutname_label'
19541 \begin_inset Quotes erd
19549 contain any style information.
19551 \begin_inset Flex Code
19554 \begin_layout Plain Layout
19563 \begin_layout Description
19564 \begin_inset Flex Code
19567 \begin_layout Plain Layout
19574 \begin_inset Flex Code
19577 \begin_layout Plain Layout
19587 ] Meaningful only for list-like environments, this tag controls whether
19588 the label tag is output before or inside the item tag.
19589 This is used, for example, in the description environment, where we want
19591 \begin_inset Flex Code
19594 \begin_layout Plain Layout
19595 <dt>\SpecialChar \ldots{}
19596 </dt><dd>\SpecialChar \ldots{}
19604 \begin_inset Flex Code
19607 \begin_layout Plain Layout
19613 : The label tag is output inside the item tag.
19616 \begin_layout Description
19617 \begin_inset Flex Code
19620 \begin_layout Plain Layout
19626 Information to be output in the
19627 \begin_inset Flex Code
19630 \begin_layout Plain Layout
19636 section when this style is used.
19637 This might, for example, be used to include a
19638 \begin_inset Flex Code
19641 \begin_layout Plain Layout
19648 \begin_inset Flex Code
19651 \begin_layout Plain Layout
19660 \begin_layout Description
19661 \begin_inset Flex Code
19664 \begin_layout Plain Layout
19670 CSS style information to be included when this style is used.
19671 Note that this will automatically be wrapped in a layout-generated
19672 \begin_inset Flex Code
19675 \begin_layout Plain Layout
19681 block, so only the CSS itself need be included.
19684 \begin_layout Description
19685 \begin_inset Flex Code
19688 \begin_layout Plain Layout
19695 \begin_inset Flex Code
19698 \begin_layout Plain Layout
19704 ] The tag to be used for the main label, replacing
19705 \begin_inset Flex Code
19708 \begin_layout Plain Layout
19714 in the examples above.
19716 \begin_inset Flex Code
19719 \begin_layout Plain Layout
19728 \begin_layout Description
19729 \begin_inset Flex Code
19732 \begin_layout Plain Layout
19739 \begin_inset Flex Code
19742 \begin_layout Plain Layout
19752 ] Marks this style as the one to be used to generate the
19753 \begin_inset Flex Code
19756 \begin_layout Plain Layout
19762 tag for the XHTML file.
19763 By default, it is false.
19765 \begin_inset Flex Code
19768 \begin_layout Plain Layout
19774 file sets it to true for the
19775 \begin_inset Flex Code
19778 \begin_layout Plain Layout
19788 \begin_layout Subsection
19792 \begin_layout Standard
19793 The XHTML output of insets can also be controlled by information in layout
19798 \begin_layout Plain Layout
19799 At present, this is true only for
19800 \begin_inset Quotes eld
19804 \begin_inset Quotes erd
19807 insets (insets you can type into) and is not true for
19808 \begin_inset Quotes eld
19812 \begin_inset Quotes erd
19815 insets (insets that are associated with dialog boxes).
19820 Here, too, LyX tries to provide sensible defaults, and it constructs default
19822 But everything can be customized.
19825 \begin_layout Standard
19826 The XHTML LyX outputs for an inset has the following form:
19829 \begin_layout LyX-Code
19831 \begin_inset Quotes erd
19835 \begin_inset Quotes erd
19841 \begin_layout LyX-Code
19842 <labeltag>Label</labeltag>
19845 \begin_layout LyX-Code
19847 \begin_inset Quotes erd
19851 \begin_inset Quotes erd
19854 >Contents of the inset.</innertag>
19857 \begin_layout LyX-Code
19861 \begin_layout Standard
19862 If the inset permits multiple paragraphs---that is, if
19863 \begin_inset Flex Code
19866 \begin_layout Plain Layout
19872 is true---then the contents of the inset will itself be output as paragraphs
19873 formatted according to the styles used for those paragraphs (standard,
19874 quote, and the like).
19875 The label tag is of course omitted if the paragraph does not have a label
19876 and, at present, is always
19877 \begin_inset Flex Code
19880 \begin_layout Plain Layout
19887 The inner tag is optional and, by default, does not appear.
19890 \begin_layout Standard
19891 The specific tags and attributes output for each inset can be controlled
19892 by means of the following layout tags.
19895 \begin_layout Description
19896 \begin_inset Flex Code
19899 \begin_layout Plain Layout
19906 \begin_inset Flex Code
19909 \begin_layout Plain Layout
19915 ] Specifies attribute information to be output with the main tag.
19917 \begin_inset Quotes eld
19921 \begin_inset Flex Code
19924 \begin_layout Plain Layout
19925 class=`myinset' onclick=`\SpecialChar \ldots{}
19932 \begin_inset Quotes erd
19936 By default, LyX will output
19937 \begin_inset Quotes eld
19941 \begin_inset Flex Code
19944 \begin_layout Plain Layout
19951 \begin_inset Quotes erd
19955 \begin_inset Flex Code
19958 \begin_layout Plain Layout
19964 is the LyX name of the inset, made lowercase and with non-alphanumeric
19965 characters converted to underscores, for example: footnote.
19968 \begin_layout Description
19969 \begin_inset Flex Code
19972 \begin_layout Plain Layout
19979 \begin_inset Flex Code
19982 \begin_layout Plain Layout
19992 ] Whether to output the default CSS information LyX generates for this layout,
19993 even if additional information is explicitly provided via
19994 \begin_inset Flex Code
19997 \begin_layout Plain Layout
20005 \begin_inset Flex Code
20008 \begin_layout Plain Layout
20014 allows you to alter or augment the generated CSS, rather than to override
20019 \begin_layout Description
20020 \begin_inset Flex Code
20023 \begin_layout Plain Layout
20030 \begin_inset Flex Code
20033 \begin_layout Plain Layout
20039 ] Attributes for the inner tag.
20041 \begin_inset Quotes eld
20045 \begin_inset Flex Code
20048 \begin_layout Plain Layout
20049 class=`insetname_inner'
20055 \begin_inset Quotes erd
20061 \begin_layout Description
20062 \begin_inset Flex Code
20065 \begin_layout Plain Layout
20072 \begin_inset Flex Code
20075 \begin_layout Plain Layout
20081 ] The inner tag, replacing
20082 \begin_inset Flex Code
20085 \begin_layout Plain Layout
20091 in the examples above.
20092 By default, there is none.
20095 \begin_layout Description
20096 \begin_inset Flex Code
20099 \begin_layout Plain Layout
20106 \begin_inset Flex Code
20109 \begin_layout Plain Layout
20117 ] Whether this inset represents a standalone block of text (such as a footnote)
20118 or instead represents material that is included in the surrounding text
20119 (such as a branch).
20123 \begin_layout Description
20124 \begin_inset Flex Code
20127 \begin_layout Plain Layout
20134 \begin_inset Flex Code
20137 \begin_layout Plain Layout
20143 ] A label for this inset, possibly including a reference to a counter.
20144 For example, for footnote, it might be:
20145 \begin_inset Flex Code
20148 \begin_layout Plain Layout
20157 This is optional, and there is no default.
20160 \begin_layout Description
20161 \begin_inset Flex Code
20164 \begin_layout Plain Layout
20170 Information to be output in the
20171 \begin_inset Flex Code
20174 \begin_layout Plain Layout
20180 section when this style is used.
20181 This might, for example, be used to include a
20182 \begin_inset Flex Code
20185 \begin_layout Plain Layout
20192 \begin_inset Flex Code
20195 \begin_layout Plain Layout
20204 \begin_layout Description
20205 \begin_inset Flex Code
20208 \begin_layout Plain Layout
20214 CSS style information to be included when this style is used.
20215 Note that this will automatically be wrapped in a layout-generated
20216 \begin_inset Flex Code
20219 \begin_layout Plain Layout
20225 block, so only the CSS itself need be included.
20228 \begin_layout Description
20229 \begin_inset Flex Code
20232 \begin_layout Plain Layout
20239 \begin_inset Flex Code
20242 \begin_layout Plain Layout
20248 ] The tag to be used for the main label, replacing
20249 \begin_inset Flex Code
20252 \begin_layout Plain Layout
20258 in the examples above.
20259 The default depends upon the setting of
20260 \begin_inset Flex Code
20263 \begin_layout Plain Layout
20270 \begin_inset Flex Code
20273 \begin_layout Plain Layout
20279 is true, the default is
20280 \begin_inset Flex Code
20283 \begin_layout Plain Layout
20289 ; if it is false, the default is
20290 \begin_inset Flex Code
20293 \begin_layout Plain Layout
20302 \begin_layout Subsection
20306 \begin_layout Standard
20307 The XHTML output for floats too can be controlled by layout information.
20308 The output has the following form:
20311 \begin_layout LyX-Code
20313 \begin_inset Quotes erd
20317 \begin_inset Quotes erd
20323 \begin_layout LyX-Code
20324 Contents of the float.
20327 \begin_layout LyX-Code
20331 \begin_layout Standard
20332 The caption, if there is one, is a separate inset and will be output as
20334 Its appearance can be controlled via the InsetLayout for caption insets.
20338 \begin_layout Description
20339 \begin_inset Flex Code
20342 \begin_layout Plain Layout
20349 \begin_inset Flex Code
20352 \begin_layout Plain Layout
20358 ] Specifies attribute information to be output with the main tag.
20360 \begin_inset Quotes eld
20364 \begin_inset Flex Code
20367 \begin_layout Plain Layout
20368 class=`myfloat' onclick=`\SpecialChar \ldots{}
20375 \begin_inset Quotes erd
20379 By default, LyX will output
20380 \begin_inset Quotes eld
20384 \begin_inset Flex Code
20387 \begin_layout Plain Layout
20388 class=`float float-floattype'
20394 \begin_inset Quotes erd
20398 \begin_inset Flex Code
20401 \begin_layout Plain Layout
20407 is LyX's name for this type of float, as determined by the float declaration
20409 \begin_inset CommandInset ref
20411 reference "sub:Floats"
20415 ), though made lowercase and with non-alphanumeric characters converted
20416 to underscores, for example: float-table.
20419 \begin_layout Description
20420 \begin_inset Flex Code
20423 \begin_layout Plain Layout
20429 CSS style information to be included when this float is used.
20430 Note that this will automatically be wrapped in a layout-generated
20431 \begin_inset Flex Code
20434 \begin_layout Plain Layout
20440 block, so only the CSS itself need be included.
20443 \begin_layout Description
20444 \begin_inset Flex Code
20447 \begin_layout Plain Layout
20454 \begin_inset Flex Code
20457 \begin_layout Plain Layout
20463 ] The tag to be used for this float, replacing
20464 \begin_inset Quotes eld
20468 \begin_inset Flex Code
20471 \begin_layout Plain Layout
20478 \begin_inset Quotes erd
20481 in the example above.
20483 \begin_inset Flex Code
20486 \begin_layout Plain Layout
20492 and will rarely need changing.
20495 \begin_layout Subsection
20496 Bibliography formatting
20499 \begin_layout Standard
20500 The bibliography can be formatted using
20501 \begin_inset Flex Code
20504 \begin_layout Plain Layout
20512 \begin_inset CommandInset ref
20514 reference "sub:Citation-format-description"
20521 \begin_layout Subsection
20525 \begin_layout Standard
20526 We have several times mentioned that LyX will generate default CSS style
20527 rules for both insets and paragraph styles, based upon the other layout
20528 information that is provided.
20529 In this section, we shall say a word about which layout information LyX
20533 \begin_layout Standard
20534 At present, LyX auto-generates CSS only for font information, making use
20536 \begin_inset Flex Code
20539 \begin_layout Plain Layout
20546 \begin_inset Flex Code
20549 \begin_layout Plain Layout
20556 \begin_inset Flex Code
20559 \begin_layout Plain Layout
20566 \begin_inset Flex Code
20569 \begin_layout Plain Layout
20576 \begin_inset Flex Code
20579 \begin_layout Plain Layout
20587 \begin_inset CommandInset ref
20589 reference "sub:Font-description"
20593 .) The translation is mostly straightforward and obvious.
20595 \begin_inset Quotes eld
20599 \begin_inset Flex Code
20602 \begin_layout Plain Layout
20609 \begin_inset Quotes erd
20613 \begin_inset Quotes eld
20617 \begin_inset Flex Code
20620 \begin_layout Plain Layout
20621 font-family: sans-serif;
20627 \begin_inset Quotes erd
20631 The correspondence of LyX sizes and CSS sizes is a little less obvious
20632 but nonetheless intuitive.
20634 \begin_inset Flex Code
20637 \begin_layout Plain Layout
20644 \begin_inset Flex URL
20647 \begin_layout Plain Layout
20657 \begin_layout Chapter
20658 Including External Material
20661 \begin_layout Standard
20662 \begin_inset Box Shadowbox
20672 height_special "totalheight"
20675 \begin_layout Plain Layout
20676 WARNING: This portion of the documentation has not been updated for some
20678 We certainly hope that it is still accurate, but there are no guarantees.
20686 \begin_layout Standard
20687 The use of material from sources external to LyX is covered in detail in
20693 This part of the manual covers what needs to happen behind the scenes for
20694 new sorts of material to be included.
20697 \begin_layout Section
20701 \begin_layout Standard
20702 The external material feature is based on the concept of a
20707 A template is a specification of how LyX should interface with a certain
20709 As bundled, LyX comes with predefined templates for Xfig figures, various
20710 raster format images, chess diagrams, and LilyPond music notation.
20711 You can check the actual list by using the menu
20712 \begin_inset Flex MenuItem
20715 \begin_layout Plain Layout
20716 Insert\SpecialChar \menuseparator
20717 File\SpecialChar \menuseparator
20724 Furthermore, it is possible to roll your own template to support a specific
20726 Later we'll describe in more detail what is involved, and hopefully you
20727 will submit all the templates you create so we can include them in a later
20731 \begin_layout Standard
20732 Another basic idea of the external material feature is to distinguish between
20733 the original file that serves as a base for final material and the produced
20734 file that is included in your exported or printed document.
20735 For example, consider the case of a figure produced with
20736 \begin_inset Flex Code
20739 \begin_layout Plain Layout
20746 The Xfig application itself works on an original file with the
20747 \begin_inset Flex Code
20750 \begin_layout Plain Layout
20757 Within Xfig, you create and change your figure, and when you are done,
20759 \begin_inset Flex Code
20762 \begin_layout Plain Layout
20769 When you want to include the figure in your document, you invoke
20770 \begin_inset Flex Code
20773 \begin_layout Plain Layout
20779 in order to create a PostScript file that can readily be included in your
20782 \begin_inset Flex Code
20785 \begin_layout Plain Layout
20791 file is the original file, and the PostScript file is the produced file.
20794 \begin_layout Standard
20795 This distinction is important in order to allow updating of the material
20796 while you are in the process of writing the document.
20797 Furthermore, it provides us with the flexibility that is needed to support
20798 multiple export formats.
20799 For instance, in the case of a plain text file, it is not exactly an award-winn
20800 ing idea to include the figure as raw PostScript.
20801 Instead, you would either prefer to just include a reference to the figure
20802 or try to invoke some graphics to ASCII converter to make the final result
20803 look similar to the real graphics.
20804 The external material management allows you to do this, because it is parametri
20805 zed on the different export formats that LyX supports.
20808 \begin_layout Standard
20809 Besides supporting the production of different products according to the
20810 exported format, it supports tight integration with editing and viewing
20812 In the case of an Xfig figure, you are able to invoke Xfig on the original
20813 file with a single click from within the external material dialog in LyX,
20814 and also preview the produced PostScript file with Ghostview with another
20816 No more fiddling around with the command line and/or file browsers to locate
20817 and manipulate the original or produced files.
20818 In this way, you are finally able to take full advantage of the many different
20819 applications that are relevant to use when you write your documents, and
20820 ultimately be more productive.
20823 \begin_layout Section
20824 The external template configuration file
20827 \begin_layout Standard
20828 It is relatively easy to add custom external template definitions to LyX.
20829 However, be aware that doing this in an careless manner most probably
20833 introduce an easily exploitable security hole.
20834 So before you do this, please read the discussion about security in section
20836 \begin_inset CommandInset ref
20838 reference "sec:Security-discussion"
20845 \begin_layout Standard
20846 Having said that, we encourage you to submit any interesting templates that
20851 \begin_layout Standard
20852 The external templates are defined in the
20853 \begin_inset Flex Code
20856 \begin_layout Plain Layout
20857 LyXDir/lib/external_templates
20863 You can place your own version in
20864 \begin_inset Flex Code
20867 \begin_layout Plain Layout
20868 UserDir/external_templates
20876 \begin_layout Standard
20877 A typical template looks like this:
20880 \begin_layout LyX-Code
20884 \begin_layout LyX-Code
20885 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
20888 \begin_layout LyX-Code
20892 \begin_layout LyX-Code
20896 \begin_layout LyX-Code
20900 \begin_layout LyX-Code
20904 \begin_layout LyX-Code
20908 \begin_layout LyX-Code
20909 AutomaticProduction true
20912 \begin_layout LyX-Code
20916 \begin_layout LyX-Code
20920 \begin_layout LyX-Code
20924 \begin_layout LyX-Code
20925 TransformCommand Rotate RotationLatexCommand
20928 \begin_layout LyX-Code
20929 TransformCommand Resize ResizeLatexCommand
20932 \begin_layout LyX-Code
20933 Product "$$RotateFront$$ResizeFront
20936 \begin_layout LyX-Code
20941 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
20944 \begin_layout LyX-Code
20945 $$ResizeBack$$RotateBack"
20948 \begin_layout LyX-Code
20952 \begin_layout LyX-Code
20953 UpdateResult "$$AbsPath$$Basename.pstex_t"
20956 \begin_layout LyX-Code
20957 Requirement "graphicx"
20960 \begin_layout LyX-Code
20961 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20964 \begin_layout LyX-Code
20965 ReferencedFile latex "$$AbsPath$$Basename.eps"
20968 \begin_layout LyX-Code
20969 ReferencedFile dvi "$$AbsPath$$Basename.eps"
20972 \begin_layout LyX-Code
20976 \begin_layout LyX-Code
20980 \begin_layout LyX-Code
20981 TransformCommand Rotate RotationLatexCommand
20984 \begin_layout LyX-Code
20985 TransformCommand Resize ResizeLatexCommand
20988 \begin_layout LyX-Code
20989 Product "$$RotateFront$$ResizeFront
20992 \begin_layout LyX-Code
20997 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
21000 \begin_layout LyX-Code
21001 $$ResizeBack$$RotateBack"
21004 \begin_layout LyX-Code
21005 UpdateFormat pdftex
21008 \begin_layout LyX-Code
21009 UpdateResult "$$AbsPath$$Basename.pdftex_t"
21012 \begin_layout LyX-Code
21013 Requirement "graphicx"
21016 \begin_layout LyX-Code
21017 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
21020 \begin_layout LyX-Code
21021 ReferencedFile latex "$$AbsPath$$Basename.pdf"
21024 \begin_layout LyX-Code
21028 \begin_layout LyX-Code
21032 \begin_layout LyX-Code
21033 Product "$$Contents(
21035 "$$AbsPath$$Basename.asc
21040 \begin_layout LyX-Code
21041 UpdateFormat asciixfig
21044 \begin_layout LyX-Code
21045 UpdateResult "$$AbsPath$$Basename.asc"
21048 \begin_layout LyX-Code
21052 \begin_layout LyX-Code
21056 \begin_layout LyX-Code
21057 Product "<graphic fileref=
21059 "$$AbsOrRelPathMaster$$Basename.eps
21064 \begin_layout LyX-Code
21068 \begin_layout LyX-Code
21072 \begin_layout LyX-Code
21073 UpdateResult "$$AbsPath$$Basename.eps"
21076 \begin_layout LyX-Code
21077 ReferencedFile docbook "$$AbsPath$$Basename.eps"
21080 \begin_layout LyX-Code
21081 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
21084 \begin_layout LyX-Code
21088 \begin_layout LyX-Code
21089 Product "[XFig: $$FName]"
21092 \begin_layout LyX-Code
21096 \begin_layout LyX-Code
21100 \begin_layout Standard
21101 As you can see, the template is enclosed in
21102 \begin_inset Flex Code
21105 \begin_layout Plain Layout
21111 \SpecialChar \ldots{}
21113 \begin_inset Flex Code
21116 \begin_layout Plain Layout
21123 It contains a header specifying some general settings and, for each supported
21124 primary document file format, a section
21125 \begin_inset Flex Code
21128 \begin_layout Plain Layout
21134 \SpecialChar \ldots{}
21136 \begin_inset Flex Code
21139 \begin_layout Plain Layout
21148 \begin_layout Subsection
21149 The template header
21152 \begin_layout Description
21153 \begin_inset Flex Code
21156 \begin_layout Plain Layout
21157 AutomaticProduction
21158 \begin_inset space ~
21166 Whether the file represented by the template must be generated by LyX.
21167 This command must occur exactly once.
21170 \begin_layout Description
21171 \begin_inset Flex Code
21174 \begin_layout Plain Layout
21176 \begin_inset space ~
21184 A glob pattern that is used in the file dialog to filter out the desired
21186 If there is more than one possible file extension (e.
21187 \begin_inset space \thinspace{}
21191 \begin_inset space \space{}
21195 \begin_inset Flex Code
21198 \begin_layout Plain Layout
21205 \begin_inset Flex Code
21208 \begin_layout Plain Layout
21214 ), use something like
21215 \begin_inset Flex Code
21218 \begin_layout Plain Layout
21225 This command must occur exactly once.
21228 \begin_layout Description
21229 \begin_inset Flex Code
21232 \begin_layout Plain Layout
21234 \begin_inset space ~
21242 The text that is displayed on the button.
21243 This command must occur exactly once.
21246 \begin_layout Description
21247 \begin_inset Flex Code
21250 \begin_layout Plain Layout
21252 \begin_inset space ~
21256 \begin_inset space ~
21264 The help text that is used in the External dialog.
21265 Provide enough information to explain to the user just what the template
21266 can provide him with.
21267 This command must occur exactly once.
21270 \begin_layout Description
21271 \begin_inset Flex Code
21274 \begin_layout Plain Layout
21276 \begin_inset space ~
21284 The file format of the original file.
21285 This must be the name of a format that is known to LyX (see section
21286 \begin_inset space ~
21290 \begin_inset CommandInset ref
21292 reference "sec:Formats"
21298 \begin_inset Quotes eld
21302 \begin_inset Flex Code
21305 \begin_layout Plain Layout
21312 \begin_inset Quotes erd
21315 if the template can handle original files of more than one format.
21316 LyX will attempt to interrogate the file itself in order to deduce its
21317 format in this case.
21318 This command must occur exactly once.
21321 \begin_layout Description
21322 \begin_inset Flex Code
21325 \begin_layout Plain Layout
21327 \begin_inset space ~
21335 A unique name for the template.
21336 It must not contain substitution macros (see below).
21339 \begin_layout Description
21340 \begin_inset Flex Code
21343 \begin_layout Plain Layout
21345 \begin_inset space ~
21348 Rotate|Resize|Clip|Extra
21353 This command specifies which transformations are supported by this template.
21354 It may occur zero or more times.
21355 This command enables the corresponding tabs in the external dialog.
21357 \begin_inset Flex Code
21360 \begin_layout Plain Layout
21366 command must have either a corresponding
21367 \begin_inset Flex Code
21370 \begin_layout Plain Layout
21377 \begin_inset Flex Code
21380 \begin_layout Plain Layout
21387 \begin_inset Flex Code
21390 \begin_layout Plain Layout
21397 Otherwise the transformation will not be supported by that format.
21400 \begin_layout Subsection
21404 \begin_layout Description
21405 \begin_inset Flex Code
21408 \begin_layout Plain Layout
21410 \begin_inset space ~
21413 LaTeX|PDFLaTeX|PlainText|DocBook
21418 The primary document file format that this format definition is for.
21419 Not every template has a sensible representation in all document file formats.
21420 Please define nevertheless a
21421 \begin_inset Flex Code
21424 \begin_layout Plain Layout
21430 section for all templates.
21431 Use a dummy text when no representation is available.
21432 Then you can at least see a reference to the external material in the exported
21436 \begin_layout Description
21437 \begin_inset Flex Code
21440 \begin_layout Plain Layout
21442 \begin_inset space ~
21446 \begin_inset space ~
21454 This command defines an additional macro
21455 \begin_inset Flex Code
21458 \begin_layout Plain Layout
21464 for substitution in
21465 \begin_inset Flex Code
21468 \begin_layout Plain Layout
21476 \begin_inset Flex Code
21479 \begin_layout Plain Layout
21485 itself may contain substitution macros.
21486 The advantage over using
21487 \begin_inset Flex Code
21490 \begin_layout Plain Layout
21497 \begin_inset Flex Code
21500 \begin_layout Plain Layout
21506 is that the substituted value of
21507 \begin_inset Flex Code
21510 \begin_layout Plain Layout
21516 is sanitized so that it is a valid optional argument in the document format.
21517 This command may occur zero or more times.
21520 \begin_layout Description
21521 \begin_inset Flex Code
21524 \begin_layout Plain Layout
21526 \begin_inset space ~
21534 The text that is inserted in the exported document.
21535 This is actually the most important command and can be quite complex.
21536 This command must occur exactly once.
21539 \begin_layout Description
21540 \begin_inset Flex Code
21543 \begin_layout Plain Layout
21545 \begin_inset space ~
21553 This command specifies a preamble snippet that will be included in the
21555 It has to be defined using
21556 \begin_inset Flex Code
21559 \begin_layout Plain Layout
21565 \SpecialChar \ldots{}
21567 \begin_inset Flex Code
21570 \begin_layout Plain Layout
21577 This command may occur zero or more times.
21580 \begin_layout Description
21581 \begin_inset Flex Code
21584 \begin_layout Plain Layout
21586 \begin_inset space ~
21590 \begin_inset space ~
21598 This command denotes files that are created by the conversion process and
21599 are needed for a particular export format.
21600 If the filename is relative, it is interpreted relative to the master document.
21601 This command may be given zero or more times.
21604 \begin_layout Description
21605 \begin_inset Flex Code
21608 \begin_layout Plain Layout
21610 \begin_inset space ~
21618 The name of a required LaTeX package.
21619 The package is included via
21620 \begin_inset Flex Code
21623 \begin_layout Plain Layout
21631 in the LaTeX preamble.
21632 This command may occur zero or more times.
21635 \begin_layout Description
21636 \begin_inset Flex Code
21639 \begin_layout Plain Layout
21641 \begin_inset space ~
21645 \begin_inset space ~
21648 RotationLatexCommand
21653 This command specifies that the built in LaTeX command should be used for
21655 This command may occur once or not at all.
21658 \begin_layout Description
21659 \begin_inset Flex Code
21662 \begin_layout Plain Layout
21664 \begin_inset space ~
21668 \begin_inset space ~
21676 This command specifies that the built in LaTeX command should be used for
21678 This command may occur once or not at all.
21681 \begin_layout Description
21682 \begin_inset Flex Code
21685 \begin_layout Plain Layout
21687 \begin_inset space ~
21691 \begin_inset space ~
21694 RotationLatexOption
21699 This command specifies that rotation is done via an optional argument.
21700 This command may occur once or not at all.
21703 \begin_layout Description
21704 \begin_inset Flex Code
21707 \begin_layout Plain Layout
21709 \begin_inset space ~
21713 \begin_inset space ~
21721 This command specifies that resizing is done via an optional argument.
21722 This command may occur once or not at all.
21725 \begin_layout Description
21726 \begin_inset Flex Code
21729 \begin_layout Plain Layout
21731 \begin_inset space ~
21735 \begin_inset space ~
21743 This command specifies that clipping is done via an optional argument.
21744 This command may occur once or not at all.
21747 \begin_layout Description
21748 \begin_inset Flex Code
21751 \begin_layout Plain Layout
21753 \begin_inset space ~
21757 \begin_inset space ~
21765 This command specifies that an extra optional argument is used.
21766 This command may occur once or not at all.
21769 \begin_layout Description
21770 \begin_inset Flex Code
21773 \begin_layout Plain Layout
21775 \begin_inset space ~
21783 The file format of the converted file.
21784 This must be the name of a format that is known to LyX (see the
21785 \begin_inset Flex MenuItem
21788 \begin_layout Plain Layout
21793 ools\SpecialChar \menuseparator
21798 references\SpecialChar \menuseparator
21799 File Handling\SpecialChar \menuseparator
21806 This command must occur exactly once.
21809 \begin_layout Description
21810 \begin_inset Flex Code
21813 \begin_layout Plain Layout
21815 \begin_inset space ~
21823 The file name of the converted file.
21824 The file name must be absolute.
21825 This command must occur exactly once.
21828 \begin_layout Subsection
21829 Preamble definitions
21832 \begin_layout Standard
21833 The external template configuration file may contain additional preamble
21834 definitions enclosed by
21835 \begin_inset Flex Code
21838 \begin_layout Plain Layout
21844 \SpecialChar \ldots{}
21846 \begin_inset Flex Code
21849 \begin_layout Plain Layout
21856 They can be used by the templates in the
21857 \begin_inset Flex Code
21860 \begin_layout Plain Layout
21869 \begin_layout Section
21870 The substitution mechanism
21873 \begin_layout Standard
21874 When the external material facility invokes an external program, it is done
21875 on the basis of a command defined in the template configuration file.
21876 These commands can contain various macros that are expanded before execution.
21877 Execution always take place in the directory of the containing document.
21880 \begin_layout Standard
21881 Also, whenever external material is to be displayed, the name will be produced
21882 by the substitution mechanism, and most other commands in the template
21883 definition support substitution as well.
21886 \begin_layout Standard
21887 The available macros are the following:
21890 \begin_layout Description
21891 \begin_inset Flex Code
21894 \begin_layout Plain Layout
21895 $$AbsOrRelPathMaster
21900 The file path, absolute or relative to the master LyX document.
21903 \begin_layout Description
21904 \begin_inset Flex Code
21907 \begin_layout Plain Layout
21908 $$AbsOrRelPathParent
21913 The file path, absolute or relative to the LyX document.
21916 \begin_layout Description
21917 \begin_inset Flex Code
21920 \begin_layout Plain Layout
21926 The absolute file path.
21929 \begin_layout Description
21930 \begin_inset Flex Code
21933 \begin_layout Plain Layout
21939 The filename without path and without the extension.
21942 \begin_layout Description
21943 \begin_inset Flex Code
21946 \begin_layout Plain Layout
21948 \begin_inset Quotes eld
21952 \begin_inset Quotes erd
21960 This macro will expand to the contents of the file with the name
21961 \begin_inset Flex Code
21964 \begin_layout Plain Layout
21973 \begin_layout Description
21974 \begin_inset Flex Code
21977 \begin_layout Plain Layout
21983 The file extension (including the dot).
21986 \begin_layout Description
21987 \begin_inset Flex Code
21990 \begin_layout Plain Layout
21996 The filename of the file specified in the external material dialog.
21997 This is either an absolute name, or it is relative to the LyX document.
22000 \begin_layout Description
22001 \begin_inset Flex Code
22004 \begin_layout Plain Layout
22011 \begin_inset Flex Code
22014 \begin_layout Plain Layout
22020 (absolute name or relative to the LyX document).
22023 \begin_layout Description
22024 \begin_inset Flex Code
22027 \begin_layout Plain Layout
22033 The file path, relative to the master LyX document.
22036 \begin_layout Description
22037 \begin_inset Flex Code
22040 \begin_layout Plain Layout
22046 The file path, relative to the LyX document.
22049 \begin_layout Description
22050 \begin_inset Flex Code
22053 \begin_layout Plain Layout
22059 This macro will expand to the absolute path of the system directory.
22060 This is typically used to point to the various helper scripts that are
22064 \begin_layout Description
22065 \begin_inset Flex Code
22068 \begin_layout Plain Layout
22074 A name and full path to a temporary file which will be automatically deleted
22075 whenever the containing document is closed, or the external material insertion
22079 \begin_layout Standard
22080 All path macros contain a trailing directory separator, so you can construct
22082 \begin_inset space \thinspace{}
22086 \begin_inset space \space{}
22089 the absolute filename with
22090 \begin_inset Flex Code
22093 \begin_layout Plain Layout
22094 $$AbsPath$$Basename$$Extension
22102 \begin_layout Standard
22103 The macros above are substituted in all commands unless otherwise noted.
22105 \begin_inset Flex Code
22108 \begin_layout Plain Layout
22114 supports additionally the following substitutions if they are enabled by
22116 \begin_inset Flex Code
22119 \begin_layout Plain Layout
22126 \begin_inset Flex Code
22129 \begin_layout Plain Layout
22138 \begin_layout Description
22139 \begin_inset Flex Code
22142 \begin_layout Plain Layout
22148 The front part of the resize command.
22151 \begin_layout Description
22152 \begin_inset Flex Code
22155 \begin_layout Plain Layout
22161 The back part of the resize command.
22164 \begin_layout Description
22165 \begin_inset Flex Code
22168 \begin_layout Plain Layout
22174 The front part of the rotation command.
22177 \begin_layout Description
22178 \begin_inset Flex Code
22181 \begin_layout Plain Layout
22187 The back part of the rotation command.
22190 \begin_layout Standard
22191 The value string of the
22192 \begin_inset Flex Code
22195 \begin_layout Plain Layout
22201 command supports additionally the following substitutions if they are enabled
22203 \begin_inset Flex Code
22206 \begin_layout Plain Layout
22213 \begin_inset Flex Code
22216 \begin_layout Plain Layout
22225 \begin_layout Description
22226 \begin_inset Flex Code
22229 \begin_layout Plain Layout
22238 \begin_layout Description
22239 \begin_inset Flex Code
22242 \begin_layout Plain Layout
22251 \begin_layout Description
22252 \begin_inset Flex Code
22255 \begin_layout Plain Layout
22264 \begin_layout Description
22265 \begin_inset Flex Code
22268 \begin_layout Plain Layout
22274 The rotation option.
22277 \begin_layout Standard
22278 You may ask why there are so many path macros.
22279 There are mainly two reasons:
22282 \begin_layout Enumerate
22283 Relative and absolute file names should remain relative or absolute, respectivel
22285 Users may have reasons to prefer either form.
22286 Relative names are useful for portable documents that should work on different
22287 machines, for example.
22288 Absolute names may be required by some programs.
22291 \begin_layout Enumerate
22292 LaTeX treats relative file names differently than LyX and other programs
22293 in nested included files.
22294 For LyX, a relative file name is always relative to the document that contains
22296 For LaTeX, it is always relative to the master document.
22297 These two definitions are identical if you have only one document, but
22298 differ if you have a master document that includes part documents.
22299 That means that relative filenames must be transformed when presented to
22301 Fortunately LyX does this automatically for you if you choose the right
22305 \begin_layout Standard
22306 So which path macro should be used in new template definitions? The rule
22310 \begin_layout Itemize
22312 \begin_inset Flex Code
22315 \begin_layout Plain Layout
22321 if an absolute path is required.
22324 \begin_layout Itemize
22326 \begin_inset Flex Code
22329 \begin_layout Plain Layout
22330 $$AbsOrRelPathMaster
22335 if the substituted string is some kind of LaTeX input.
22338 \begin_layout Itemize
22340 \begin_inset Flex Code
22343 \begin_layout Plain Layout
22344 $$AbsOrRelPathParent
22349 in order to preserve the user's choice.
22352 \begin_layout Standard
22353 There are special cases where this rule does not work and e.
22354 \begin_inset space \thinspace{}
22358 \begin_inset space \space{}
22361 relative names are needed, but normally it will work just fine.
22362 One example for such a case is the command
22363 \begin_inset Flex Code
22366 \begin_layout Plain Layout
22367 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
22372 in the XFig template above: We can't use the absolute name because the
22374 \begin_inset Flex Code
22377 \begin_layout Plain Layout
22383 files needs the relative name in order to rewrite the file content.
22386 \begin_layout Section
22387 Security discussion
22388 \begin_inset CommandInset label
22390 name "sec:Security-discussion"
22397 \begin_layout Standard
22398 The external material feature interfaces with a lot of external programs
22399 and does so automatically, so we have to consider the security implications
22401 In particular, since you have the option of including your own filenames
22402 and/or parameter strings and those are expanded into a command, it seems
22403 that it would be possible to create a malicious document which executes
22404 arbitrary commands when a user views or prints the document.
22405 This is something we definitely want to avoid.
22408 \begin_layout Standard
22409 However, since the external program commands are specified in the template
22410 configuration file only, there are no security issues if LyX is properly
22411 configured with safe templates only.
22412 This is so because the external programs are invoked with the
22413 \begin_inset Flex Code
22416 \begin_layout Plain Layout
22422 -system call rather than the
22423 \begin_inset Flex Code
22426 \begin_layout Plain Layout
22432 system-call, so it's not possible to execute arbitrary commands from the
22433 filename or parameter section via the shell.
22436 \begin_layout Standard
22437 This also implies that you are restricted in what command strings you can
22438 use in the external material templates.
22439 In particular, pipes and redirection are not readily available.
22440 This has to be so if LyX should remain safe.
22441 If you want to use some of the shell features, you should write a safe
22442 script to do this in a controlled manner, and then invoke the script from
22443 the command string.
22447 \begin_layout Standard
22448 It is possible to design a template that interacts directly with the shell,
22449 but since this would allow a malicious user to execute arbitrary commands
22450 by writing clever filenames and/or parameters, we generally recommend that
22451 you only use safe scripts that work with the
22452 \begin_inset Flex Code
22455 \begin_layout Plain Layout
22461 system call in a controlled manner.
22462 Of course, for use in a controlled environment, it can be tempting to just
22463 fall back to use ordinary shell scripts.
22464 If you do so, be aware that you
22468 provide an easily exploitable security hole in your system.
22469 Of course it stands to reason that such unsafe templates will never be
22470 included in the standard LyX distribution, although we do encourage people
22471 to submit new templates in the open source tradition.
22472 But LyX as shipped from the official distribution channels will never have
22476 \begin_layout Standard
22477 Including external material provides a lot of power, and you have to be
22478 careful not to introduce security hazards with this power.
22479 A subtle error in a single line in an innocent looking script can open
22480 the door to huge security problems.
22481 So if you do not fully understand the issues, we recommend that you consult
22482 a knowledgeable security professional or the LyX development team if you
22483 have any questions about whether a given template is safe or not.
22484 And do this before you use it in an uncontrolled environment.