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
10818 \change_inserted 155139281 1354198988
10822 \begin_layout Standard
10824 \change_inserted 155139281 1354199102
10826 \begin_inset Flex Code
10829 \begin_layout Plain Layout
10831 \change_inserted 155139281 1354199013
10842 \begin_inset Flex Code
10845 \begin_layout Plain Layout
10847 \change_inserted 155139281 1354199102
10858 \begin_inset Flex Code
10861 \begin_layout Plain Layout
10863 \change_inserted 155139281 1354199044
10871 followed by the number (e.
10872 \begin_inset space \thinspace{}
10877 \begin_inset Flex Code
10880 \begin_layout Plain Layout
10882 \change_inserted 155139281 1354199064
10896 \begin_layout Description
10897 \begin_inset Flex Code
10900 \begin_layout Plain Layout
10906 Note that this will completely override any prior
10907 \begin_inset Flex Code
10910 \begin_layout Plain Layout
10916 declaration for this style.
10918 \begin_inset Quotes eld
10922 \begin_inset Flex Code
10925 \begin_layout Plain Layout
10932 \begin_inset Quotes erd
10937 \begin_inset CommandInset ref
10939 reference "sub:I18n"
10943 for details on its use.
10946 \begin_layout Description
10947 \begin_inset Flex Code
10950 \begin_layout Plain Layout
10957 \begin_inset Flex Code
10960 \begin_layout Plain Layout
10970 \begin_layout Plain Layout
10971 Note that a `float' here is a real number, such as: 1.5.
10976 The vertical space with which the last of a chain of paragraphs with this
10977 style is separated from the following paragraph.
10978 If the next paragraph has another style, the separations are not simply
10979 added, but the maximum is taken.
10982 \begin_layout Description
10983 \begin_inset Flex Code
10986 \begin_layout Plain Layout
10993 \begin_inset Flex Code
10996 \begin_layout Plain Layout
11002 The category for this style.
11003 This is used to group related styles in the style combobox on the toolbar.
11004 Any string can be used, but you may want to use existing categories with
11009 \begin_layout Description
11010 \begin_inset Flex Code
11013 \begin_layout Plain Layout
11019 Depth of XML command.
11020 Used only with XML-type formats.
11023 \begin_layout Description
11024 \begin_inset Flex Code
11027 \begin_layout Plain Layout
11034 \begin_inset Flex Code
11037 \begin_layout Plain Layout
11043 Copies all the features of an existing style into the current one.
11047 \begin_layout Description
11048 \begin_inset Flex Code
11051 \begin_layout Plain Layout
11057 The name of a style whose preamble should be output
11062 This allows to ensure some ordering of the preamble snippets when macros
11063 definitions depend on one another.
11067 \begin_layout Plain Layout
11068 Note that, besides that functionality, there is no way to ensure any ordering
11070 The ordering that you see in a given version of LyX may change without
11071 warning in later versions.
11079 \begin_layout Description
11080 \begin_inset Flex Code
11083 \begin_layout Plain Layout
11090 \begin_inset Flex Code
11093 \begin_layout Plain Layout
11098 , Box, Filled_Box, Static
11103 ] The type of label that stands at the end of the paragraph (or sequence
11105 \begin_inset Flex Code
11108 \begin_layout Plain Layout
11115 \begin_inset Flex Code
11118 \begin_layout Plain Layout
11125 \begin_inset Flex Code
11128 \begin_layout Plain Layout
11135 \begin_inset Flex Code
11138 \begin_layout Plain Layout
11146 \begin_inset Flex Code
11149 \begin_layout Plain Layout
11156 \begin_inset Quotes eld
11160 \begin_inset Quotes erd
11164 \begin_inset Flex Code
11167 \begin_layout Plain Layout
11174 \begin_inset Flex Code
11177 \begin_layout Plain Layout
11178 \begin_inset space ~
11186 ) is a white (resp.
11187 \begin_inset space ~
11190 black) square suitable for end of proof markers,
11191 \begin_inset Flex Code
11194 \begin_layout Plain Layout
11200 is an explicit text string.
11203 \begin_layout Description
11204 \begin_inset Flex Code
11207 \begin_layout Plain Layout
11214 \begin_inset Flex Code
11217 \begin_layout Plain Layout
11223 ] The string used for a label with a
11224 \begin_inset Flex Code
11227 \begin_layout Plain Layout
11234 \begin_inset Flex Code
11237 \begin_layout Plain Layout
11247 \begin_layout Description
11248 \begin_inset Flex Code
11251 \begin_layout Plain Layout
11257 The font used for both the text body
11263 \begin_inset space ~
11267 \begin_inset CommandInset ref
11269 reference "sub:Font-description"
11274 Note that defining this font automatically defines the
11275 \begin_inset Flex Code
11278 \begin_layout Plain Layout
11285 So you should define this one first if you also want to define
11286 \begin_inset Flex Code
11289 \begin_layout Plain Layout
11298 \begin_layout Description
11299 \begin_inset Flex Code
11302 \begin_layout Plain Layout
11309 \begin_inset CommandInset label
11311 name "des:FreeSpacing"
11316 \begin_inset Flex Code
11319 \begin_layout Plain Layout
11328 \begin_inset Flex Code
11331 \begin_layout Plain Layout
11337 ] Usually LyX doesn't allow you to insert more than one space between words,
11338 since a space is considered as the separation between two words, not a
11339 character or symbol of its own.
11340 This is a very fine thing but sometimes annoying, for example, when typing
11341 program code or plain LaTeX code.
11343 \begin_inset Flex Code
11346 \begin_layout Plain Layout
11353 Note that LyX will create protected blanks for the additional blanks when
11354 in another mode than LaTeX-mode.
11357 \begin_layout Description
11358 \begin_inset Flex Code
11361 \begin_layout Plain Layout
11367 These tags are used with XHTML output.
11369 \begin_inset CommandInset ref
11371 reference "sub:Paragraph-Style-XHTML"
11378 \begin_layout Description
11379 \begin_inset Flex Code
11382 \begin_layout Plain Layout
11388 [[FIXME]] (Used only with XML-type formats.)
11391 \begin_layout Description
11392 \begin_inset Flex Code
11395 \begin_layout Plain Layout
11402 \begin_inset Flex Code
11405 \begin_layout Plain Layout
11411 If 1, marks the style as to be included in the document preamble rather
11412 than in the document body.
11413 This is useful for document classes that want such information as the title
11414 and author to appear in the preamble.
11415 Note that this works only for styles for which the
11416 \begin_inset Flex Code
11419 \begin_layout Plain Layout
11426 \begin_inset Flex Code
11429 \begin_layout Plain Layout
11436 \begin_inset Flex Code
11439 \begin_layout Plain Layout
11448 \begin_layout Description
11449 \begin_inset Flex Code
11452 \begin_layout Plain Layout
11459 \begin_inset Flex Code
11462 \begin_layout Plain Layout
11468 If 1, marks the style as being part of a title block (see also the
11469 \begin_inset Flex Code
11472 \begin_layout Plain Layout
11479 \begin_inset Flex Code
11482 \begin_layout Plain Layout
11491 \begin_layout Description
11492 \begin_inset Flex Code
11495 \begin_layout Plain Layout
11502 \begin_inset Flex Code
11505 \begin_layout Plain Layout
11511 ] This provides extra space between paragraphs that have the same style.
11512 If you put other styles into an environment, each is separated with the
11514 \begin_inset Flex Code
11517 \begin_layout Plain Layout
11524 But the whole items of the environment are additionally separated with
11526 \begin_inset Flex Code
11529 \begin_layout Plain Layout
11536 Note that this is a
11541 \begin_layout Description
11542 \begin_inset Flex Code
11545 \begin_layout Plain Layout
11551 [[FIXME]] (Used only with XML-type formats.)
11554 \begin_layout Description
11555 \begin_inset Flex Code
11558 \begin_layout Plain Layout
11565 \begin_inset Flex Code
11568 \begin_layout Plain Layout
11577 \begin_inset Flex Code
11580 \begin_layout Plain Layout
11586 ] Usually LyX does not allow you to leave a paragraph empty, since it would
11587 lead to empty LaTeX output.
11588 There are some cases where this could be desirable however: in a letter
11589 template, the required fields can be provided as empty fields, so that
11590 people do not forget them; in some special classes, a style can be used
11591 as some kind of break, which does not contain actual text.
11594 \begin_layout Description
11595 \begin_inset Flex Code
11598 \begin_layout Plain Layout
11604 [float=0] The vertical space between the label and the text body.
11605 Only used for labels that are above the text body (
11606 \begin_inset Flex Code
11609 \begin_layout Plain Layout
11616 \begin_inset Flex Code
11619 \begin_layout Plain Layout
11620 Centered_Top_Environment
11628 \begin_layout Description
11629 \begin_inset Flex Code
11632 \begin_layout Plain Layout
11639 \begin_inset Flex Code
11642 \begin_layout Plain Layout
11649 \begin_inset Newline newline
11652 The name of the counter for automatic numbering.
11654 \begin_inset Newline newline
11662 \begin_inset Flex Code
11665 \begin_layout Plain Layout
11672 \begin_inset Flex Code
11675 \begin_layout Plain Layout
11682 In that case, the counter will be stepped each time the style appears.
11684 \begin_inset Newline newline
11692 \begin_inset Flex Code
11695 \begin_layout Plain Layout
11702 \begin_inset Flex Code
11705 \begin_layout Plain Layout
11711 , though this case is a bit complicated.
11712 Suppose you declare
11713 \begin_inset Quotes eld
11717 \begin_inset Flex Code
11720 \begin_layout Plain Layout
11721 LabelCounter myenum
11727 \begin_inset Quotes erd
11731 Then the actual counters used are
11732 \begin_inset Flex Code
11735 \begin_layout Plain Layout
11742 \begin_inset Flex Code
11745 \begin_layout Plain Layout
11752 \begin_inset Flex Code
11755 \begin_layout Plain Layout
11762 \begin_inset Flex Code
11765 \begin_layout Plain Layout
11771 , much as in LaTeX.
11772 These counters must all be declared separately.
11773 \begin_inset Newline newline
11777 \begin_inset CommandInset ref
11779 reference "sub:Counters"
11783 for details on counters.
11786 \begin_layout Description
11787 \begin_inset Flex Code
11790 \begin_layout Plain Layout
11796 The font used for the label.
11798 \begin_inset space ~
11802 \begin_inset CommandInset ref
11804 reference "sub:Font-description"
11811 \begin_layout Description
11812 \begin_inset Flex Code
11815 \begin_layout Plain Layout
11821 Text that indicates how far a label should be indented.
11824 \begin_layout Description
11825 \begin_inset Flex Code
11828 \begin_layout Plain Layout
11835 \begin_inset Flex Code
11838 \begin_layout Plain Layout
11844 ] The horizontal space between the label and the text body.
11845 Only used for labels that are not above the text body.
11848 \begin_layout Description
11849 \begin_inset Flex Code
11852 \begin_layout Plain Layout
11859 \begin_inset Flex Code
11862 \begin_layout Plain Layout
11868 ] The string used for a label with a
11869 \begin_inset Flex Code
11872 \begin_layout Plain Layout
11880 \begin_inset Flex Code
11883 \begin_layout Plain Layout
11889 is set, this string can be contain the special formatting commands described
11891 \begin_inset CommandInset ref
11893 reference "sub:Counters"
11901 \begin_layout Plain Layout
11902 For the sake of backwards compatibility, the string
11903 \begin_inset Flex Code
11906 \begin_layout Plain Layout
11916 will be replaced by the expanded
11917 \begin_inset Flex Code
11920 \begin_layout Plain Layout
11927 \begin_inset Flex Code
11930 \begin_layout Plain Layout
11939 This feature is now obsolete and should be replaced by the mechanisms of
11941 \begin_inset CommandInset ref
11943 reference "sub:Counters"
11955 \begin_layout Description
11956 \begin_inset Flex Code
11959 \begin_layout Plain Layout
11960 LabelStringAppendix
11966 \begin_inset Flex Code
11969 \begin_layout Plain Layout
11975 ] This is used inside the appendix instead of
11976 \begin_inset Flex Code
11979 \begin_layout Plain Layout
11987 \begin_inset Flex Code
11990 \begin_layout Plain Layout
11997 \begin_inset Flex Code
12000 \begin_layout Plain Layout
12001 LabelStringAppendix
12009 \begin_layout Description
12010 \begin_inset Flex Code
12013 \begin_layout Plain Layout
12019 [FIXME] (Used only with XML-type formats.)
12022 \begin_layout Description
12023 \begin_inset Flex Code
12026 \begin_layout Plain Layout
12033 \begin_inset Flex Code
12036 \begin_layout Plain Layout
12041 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
12042 Enumerate, Itemize, Bibliography
12051 \begin_layout Itemize
12052 \begin_inset Flex Code
12055 \begin_layout Plain Layout
12061 means the label is the very first word (up to the first real blank).
12062 Use protected spaces (like
12063 \begin_inset space ~
12066 that one) if you want more than one word as the label.
12070 \begin_layout Itemize
12071 \begin_inset Flex Code
12074 \begin_layout Plain Layout
12080 means the label is simply whatever
12081 \begin_inset Flex Code
12084 \begin_layout Plain Layout
12091 Note that this really is `static'.
12094 \begin_layout Itemize
12095 \begin_inset Flex Code
12098 \begin_layout Plain Layout
12105 \begin_inset Flex Code
12108 \begin_layout Plain Layout
12109 Centered_Top_Environment
12114 are special cases of
12115 \begin_inset Flex Code
12118 \begin_layout Plain Layout
12125 The label will be printed above the paragraph, but only at the top of an
12126 environment or the top of a chain of paragraphs with this style.
12127 This might be used with the
12128 \begin_inset Flex MenuItem
12131 \begin_layout Plain Layout
12137 style, for example.
12140 \begin_layout Itemize
12141 \begin_inset Flex Code
12144 \begin_layout Plain Layout
12150 is a special case for the caption-labels
12151 \begin_inset Quotes eld
12155 \begin_inset Quotes erd
12159 \begin_inset Quotes eld
12163 \begin_inset Quotes erd
12168 \begin_inset Flex Code
12171 \begin_layout Plain Layout
12177 means the (hardcoded) label string depends on the kind of float: It is
12178 hardcoded to be `FloatType N', where N is the value of the counter associated
12182 \begin_layout Itemize
12184 \begin_inset Flex Code
12187 \begin_layout Plain Layout
12193 label type defines automatically numbered labels.
12195 \begin_inset Flex Code
12198 \begin_layout Plain Layout
12204 will be expanded to resolve any counter references it contains: For example,
12206 \begin_inset Quotes eld
12210 \begin_inset Flex Code
12213 \begin_layout Plain Layout
12224 \begin_inset Quotes erd
12229 \begin_inset CommandInset ref
12231 reference "sub:Counters"
12235 for more information on counters.
12238 \begin_layout Itemize
12239 \begin_inset Flex Code
12242 \begin_layout Plain Layout
12248 produces the usual sort of enumeration labels.
12249 At present, it is hardcoded to use Arabic numerals, lowercase letters,
12250 small Roman numerals, and uppercase letters for the four possible depths.
12253 \begin_layout Itemize
12254 \begin_inset Flex Code
12257 \begin_layout Plain Layout
12263 produces various bullets at the different levels.
12264 It is also hardcoded.
12267 \begin_layout Itemize
12268 \begin_inset Flex Code
12271 \begin_layout Plain Layout
12277 is used internally by LyX and should be used only with
12278 \begin_inset Flex Code
12281 \begin_layout Plain Layout
12282 LatexType BibEnvironment
12291 \begin_layout Description
12292 \begin_inset Flex Code
12295 \begin_layout Plain Layout
12301 Note that this will completely override any prior
12302 \begin_inset Flex Code
12305 \begin_layout Plain Layout
12311 declaration for this style.
12313 \begin_inset Quotes eld
12317 \begin_inset Flex Code
12320 \begin_layout Plain Layout
12327 \begin_inset Quotes erd
12332 \begin_inset CommandInset ref
12334 reference "sub:I18n"
12338 for details on its use.
12341 \begin_layout Description
12342 \begin_inset Flex Code
12345 \begin_layout Plain Layout
12351 The name of the corresponding LaTeX stuff.
12352 Either the environment or command name.
12355 \begin_layout Description
12356 \begin_inset Flex Code
12359 \begin_layout Plain Layout
12365 An optional parameter for the corresponding
12366 \begin_inset Flex Code
12369 \begin_layout Plain Layout
12376 This parameter cannot be changed from within LyX.
12379 \begin_layout Description
12380 \begin_inset Flex Code
12383 \begin_layout Plain Layout
12390 \begin_inset Flex Code
12393 \begin_layout Plain Layout
12398 , Command, Environment, Item_Environment,
12404 \begin_inset Flex Code
12407 \begin_layout Plain Layout
12408 List_Environment, Bib_Environment
12413 ] How the style should be translated into LaTeX.
12417 \begin_layout Plain Layout
12418 \begin_inset Flex Code
12421 \begin_layout Plain Layout
12427 is perhaps a bit misleading, since these rules apply to SGML classes, too.
12428 Visit the SGML class files for specific examples.
12437 \begin_layout Itemize
12438 \begin_inset Flex Code
12441 \begin_layout Plain Layout
12447 means nothing special.
12451 \begin_layout Itemize
12452 \begin_inset Flex Code
12455 \begin_layout Plain Layout
12462 \begin_inset Flex Code
12465 \begin_layout Plain Layout
12472 {\SpecialChar \ldots{}
12481 \begin_layout Itemize
12482 \begin_inset Flex Code
12485 \begin_layout Plain Layout
12492 \begin_inset Flex Code
12495 \begin_layout Plain Layout
12502 }\SpecialChar \ldots{}
12518 \begin_layout Itemize
12519 \begin_inset Flex Code
12522 \begin_layout Plain Layout
12529 \begin_inset Flex Code
12532 \begin_layout Plain Layout
12539 \begin_inset Flex Code
12542 \begin_layout Plain Layout
12550 is generated for each paragraph of this environment.
12554 \begin_layout Itemize
12555 \begin_inset Flex Code
12558 \begin_layout Plain Layout
12565 \begin_inset Flex Code
12568 \begin_layout Plain Layout
12575 \begin_inset Flex Code
12578 \begin_layout Plain Layout
12584 is passed as an argument to the environment.
12586 \begin_inset Flex Code
12589 \begin_layout Plain Layout
12595 can be defined in the
12596 \begin_inset Flex MenuItem
12599 \begin_layout Plain Layout
12600 Edit\SpecialChar \menuseparator
12602 \begin_inset space ~
12614 \begin_layout Standard
12615 Putting the last few things together, the LaTeX output will be either:
12618 \begin_layout LyX-Code
12621 latexname[latexparam]{\SpecialChar \ldots{}
12625 \begin_layout Standard
12629 \begin_layout LyX-Code
12632 begin{latexname}[latexparam] \SpecialChar \ldots{}
12638 \begin_layout Standard
12639 depending upon the LaTeX type.
12643 \begin_layout Description
12645 \change_inserted -712698321 1353866861
12646 \begin_inset Flex Code
12649 \begin_layout Plain Layout
12651 \change_inserted -712698321 1353866852
12658 \begin_inset Flex Code
12661 \begin_layout Plain Layout
12663 \change_inserted -712698321 1353866852
12669 ] A string that is put at the beginning of the style content.
12672 \begin_layout Description
12673 \begin_inset Flex Code
12676 \begin_layout Plain Layout
12683 \begin_inset Flex Code
12686 \begin_layout Plain Layout
12692 ] If you put styles into environments, the leftmargins are not simply added,
12693 but added with a factor
12694 \begin_inset Formula $\frac{4}{depth+4}$
12698 Note that this parameter is also used when the margin is defined as
12699 \begin_inset Flex Code
12702 \begin_layout Plain Layout
12709 \begin_inset Flex Code
12712 \begin_layout Plain Layout
12719 Then it is added to the manual or dynamic margin.
12721 \begin_inset Newline newline
12724 The argument is passed as a string.
12726 \begin_inset Quotes eld
12730 \begin_inset Flex Code
12733 \begin_layout Plain Layout
12740 \begin_inset Quotes erd
12743 means that the paragraph is indented with the width of
12744 \begin_inset Quotes eld
12748 \begin_inset Flex Code
12751 \begin_layout Plain Layout
12758 \begin_inset Quotes erd
12761 in the normal font.
12762 You can get a negative width by prefixing the string with
12763 \begin_inset Quotes eld
12767 \begin_inset Flex Code
12770 \begin_layout Plain Layout
12777 \begin_inset Quotes erd
12781 This way was chosen so that the look is the same with each used screen
12786 \begin_layout Description
12787 \begin_inset Flex Code
12790 \begin_layout Plain Layout
12797 \begin_inset Flex Code
12800 \begin_layout Plain Layout
12805 , Manual, Dynamic, First_Dynamic, Right_Address_Box
12811 \begin_inset Newline newline
12814 The kind of margin that the style has on the left side.
12816 \begin_inset Flex Code
12819 \begin_layout Plain Layout
12825 just means a fixed margin.
12827 \begin_inset Flex Code
12830 \begin_layout Plain Layout
12836 means that the left margin depends on the string entered in the
12837 \begin_inset Flex MenuItem
12840 \begin_layout Plain Layout
12841 Edit\SpecialChar \menuseparator
12843 \begin_inset space ~
12852 This is used to typeset nice lists without tabulators.
12854 \begin_inset Flex Code
12857 \begin_layout Plain Layout
12863 means that the margin depends on the size of the label.
12864 This is used for automatic enumerated headlines.
12865 It is obvious that the headline
12866 \begin_inset Quotes eld
12869 5.4.3.2.1 Very long headline
12870 \begin_inset Quotes erd
12873 must have a wider left margin (as wide as
12874 \begin_inset Quotes eld
12878 \begin_inset Quotes erd
12881 plus the space) than
12882 \begin_inset Quotes eld
12885 3.2 Very long headline
12886 \begin_inset Quotes erd
12890 \begin_inset Quotes eld
12894 \begin_inset Quotes erd
12897 are not able to do this.
12899 \begin_inset Flex Code
12902 \begin_layout Plain Layout
12908 is similar, but only the very first row of the paragraph is dynamic, while
12909 the others are static; this is used, for example, for descriptions.
12911 \begin_inset Flex Code
12914 \begin_layout Plain Layout
12920 means the margin is chosen in a way that the longest row of this paragraph
12921 fits to the right margin.
12922 This is used to typeset an address on the right edge of the page.
12925 \begin_layout Description
12926 \begin_inset Flex Code
12929 \begin_layout Plain Layout
12936 \begin_inset Flex Code
12939 \begin_layout Plain Layout
12948 \begin_inset Flex Code
12951 \begin_layout Plain Layout
12957 ] Whether fragile commands in this style should be
12958 \begin_inset Flex Code
12961 \begin_layout Plain Layout
12974 whether this command should itself be protected.)
12977 \begin_layout Description
12978 \begin_inset Flex Code
12981 \begin_layout Plain Layout
12988 \begin_inset Flex Code
12991 \begin_layout Plain Layout
12998 \begin_inset Flex Code
13001 \begin_layout Plain Layout
13009 ] Whether newlines are translated into LaTeX newlines (
13010 \begin_inset Flex Code
13013 \begin_layout Plain Layout
13024 The translation can be switched off to allow more comfortable LaTeX editing
13028 \begin_layout Description
13029 \begin_inset Flex Code
13032 \begin_layout Plain Layout
13039 \begin_inset Flex Code
13042 \begin_layout Plain Layout
13049 \begin_inset Flex Code
13052 \begin_layout Plain Layout
13060 ] If set to true, and if
13061 \begin_inset Flex Code
13064 \begin_layout Plain Layout
13071 \begin_inset Flex Code
13074 \begin_layout Plain Layout
13080 ) paragraphs are being indented, then the indentation of such a paragraph
13081 following one of this type will be suppressed.
13082 (So this will not affect the display of non-default paragraphs.)
13085 \begin_layout Description
13086 \begin_inset Flex Code
13089 \begin_layout Plain Layout
13095 Name of a style that has replaced this style.
13096 This is used to rename a style, while keeping backward compatibility.
13099 \begin_layout Description
13101 \change_deleted -712698321 1353679722
13102 \begin_inset Flex Code
13105 \begin_layout Plain Layout
13112 \begin_inset Flex Code
13115 \begin_layout Plain Layout
13121 ] The number of optional arguments that can be used with this style.
13122 This is useful for things like section headings, and only makes sense with
13124 Note that, on output, the optional arguments will all precede any required
13125 arguments (see below).
13126 So one can have constructs like:
13130 \begin_layout LyX-Code
13132 \change_deleted -712698321 1353679722
13135 mycmd[opt1]{req1}{contents of paragraph}
13138 \begin_layout Standard
13140 \change_deleted -712698321 1353679722
13141 but one cannot have things like:
13144 \begin_layout LyX-Code
13146 \change_deleted -712698321 1353679722
13149 mycmd[opt1]{req1}[opt2]{contents of paragraph}
13152 \begin_layout Standard
13154 \change_deleted -712698321 1353679722
13155 at least, not without ERT (with which you can have anything).
13162 \begin_layout Description
13163 \begin_inset Flex Code
13166 \begin_layout Plain Layout
13173 \begin_inset Flex Code
13176 \begin_layout Plain Layout
13185 \begin_inset Flex Code
13188 \begin_layout Plain Layout
13194 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
13195 output, but only by a line break; together with
13196 \begin_inset Flex Code
13199 \begin_layout Plain Layout
13205 , this allows to emulate a plain text editor (like the ERT inset).
13208 \begin_layout Description
13209 \begin_inset Flex Code
13212 \begin_layout Plain Layout
13219 \begin_inset Flex Code
13222 \begin_layout Plain Layout
13228 ] The indent of the very first line of a paragraph.
13230 \begin_inset Flex Code
13233 \begin_layout Plain Layout
13239 will be fixed for a certain style.
13240 The exception is the default style, since the indentation for these paragraphs
13241 can be prohibited with
13242 \begin_inset Flex Code
13245 \begin_layout Plain Layout
13253 \begin_inset Flex Code
13256 \begin_layout Plain Layout
13262 style paragraphs inside environments use the
13263 \begin_inset Flex Code
13266 \begin_layout Plain Layout
13272 of the environment, not their native one.
13274 \begin_inset Flex Code
13277 \begin_layout Plain Layout
13283 paragraphs inside an enumeration are not indented.
13286 \begin_layout Description
13287 \begin_inset Flex Code
13290 \begin_layout Plain Layout
13297 \begin_inset Flex Code
13300 \begin_layout Plain Layout
13306 ] The vertical space between two paragraphs of this style.
13309 \begin_layout Description
13310 \begin_inset Flex Code
13313 \begin_layout Plain Layout
13320 \begin_inset Flex Code
13323 \begin_layout Plain Layout
13329 ] LyX allows the user to choose either
13330 \begin_inset Quotes eld
13334 \begin_inset Quotes erd
13338 \begin_inset Quotes eld
13342 \begin_inset Quotes erd
13345 to typeset a document.
13347 \begin_inset Quotes eld
13351 \begin_inset Quotes erd
13354 is chosen, this value is completely ignored.
13356 \begin_inset Quotes eld
13360 \begin_inset Quotes erd
13363 is chosen, the parindent of a LaTeXtype
13364 \begin_inset Quotes eld
13368 \begin_inset Quotes erd
13371 style is ignored and all paragraphs are separated by this parskip argument.
13372 The vertical space is calculated with
13373 \begin_inset Flex Code
13376 \begin_layout Plain Layout
13378 \begin_inset space ~
13387 \begin_inset Flex Code
13390 \begin_layout Plain Layout
13396 is the height of a row with the normal font.
13397 This way, the look stays the same with different screen fonts.
13400 \begin_layout Description
13401 \begin_inset Flex Code
13404 \begin_layout Plain Layout
13411 \begin_inset Flex Code
13414 \begin_layout Plain Layout
13423 \begin_inset Flex Code
13426 \begin_layout Plain Layout
13432 ] Whether the contents of this paragraph should be output in raw form, meaning
13433 without special translations that LaTeX would require.
13436 \begin_layout Description
13437 \begin_inset Flex Code
13440 \begin_layout Plain Layout
13446 Information to be included in the LaTeX preamble when this style is used.
13447 Used to define macros, load packages, etc., required by this particular
13450 \begin_inset Quotes eld
13454 \begin_inset Flex Code
13457 \begin_layout Plain Layout
13464 \begin_inset Quotes erd
13470 \begin_layout Description
13471 \begin_inset Flex Code
13474 \begin_layout Plain Layout
13481 \begin_inset Flex Code
13484 \begin_layout Plain Layout
13490 ] The prefix to use when creating labels referring to paragraphs of this
13492 This allows the use of formatted references.
13495 \begin_layout Description
13497 \change_deleted -712698321 1353681258
13498 \begin_inset Flex Code
13501 \begin_layout Plain Layout
13508 \begin_inset Flex Code
13511 \begin_layout Plain Layout
13517 ] The number of required arguments that the LaTeX command or environment
13518 corresponding to this style expects.
13519 In the case of a command, these are required arguments
13523 that associated with the content of the paragraph itself.
13524 These do not actually have to be provided: LyX will output empty arguments
13526 Note that optional arguments will be output before required arguments.
13527 See the discussion of the
13528 \begin_inset Flex Code
13531 \begin_layout Plain Layout
13537 tag above for more information.
13542 \begin_layout Description
13543 \begin_inset Flex Code
13546 \begin_layout Plain Layout
13553 \begin_inset Flex Code
13556 \begin_layout Plain Layout
13562 ] Whether the style requires the feature
13563 \begin_inset Flex Code
13566 \begin_layout Plain Layout
13573 See the description of
13574 \begin_inset Flex Code
13577 \begin_layout Plain Layout
13584 \begin_inset CommandInset ref
13585 LatexCommand pageref
13586 reference "des:FreeSpacing"
13590 ) for information on `features'.
13592 \change_inserted -712698321 1353693134
13596 \begin_layout Description
13598 \change_inserted -712698321 1353693371
13599 \begin_inset Flex Code
13602 \begin_layout Plain Layout
13604 \change_inserted -712698321 1353693146
13613 \begin_inset Flex Code
13616 \begin_layout Plain Layout
13618 \change_inserted -712698321 1353693235
13627 \begin_inset Flex Code
13630 \begin_layout Plain Layout
13632 \change_inserted -712698321 1353693235
13638 ] Resets the LaTeX arguments of this style (as defined via the
13639 \begin_inset Flex Code
13642 \begin_layout Plain Layout
13644 \change_inserted -712698321 1353693371
13653 This is useful if you have copied a style via
13654 \begin_inset Flex Code
13657 \begin_layout Plain Layout
13659 \change_inserted -712698321 1353693302
13667 , but you do not want to inherit its (required and optional) arguments.
13672 \begin_layout Description
13674 \change_inserted -712698321 1353866881
13675 \begin_inset Flex Code
13678 \begin_layout Plain Layout
13680 \change_inserted -712698321 1353866876
13687 \begin_inset Flex Code
13690 \begin_layout Plain Layout
13692 \change_inserted -712698321 1353866873
13698 ] A string that is put at the end of the layout content.
13701 \begin_layout Description
13702 \begin_inset Flex Code
13705 \begin_layout Plain Layout
13712 \begin_inset Flex Code
13715 \begin_layout Plain Layout
13722 \begin_inset Flex Code
13725 \begin_layout Plain Layout
13734 \begin_layout Description
13735 \begin_inset Flex Code
13738 \begin_layout Plain Layout
13745 \begin_inset Flex Code
13748 \begin_layout Plain Layout
13753 , onehalf, double, other
13762 ] This defines what the default spacing should be in the style.
13764 \begin_inset Flex Code
13767 \begin_layout Plain Layout
13774 \begin_inset Flex Code
13777 \begin_layout Plain Layout
13784 \begin_inset Flex Code
13787 \begin_layout Plain Layout
13793 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
13794 If you specify the argument
13795 \begin_inset Flex Code
13798 \begin_layout Plain Layout
13804 , then you should also provide a numerical argument which will be the actual
13806 Note that, contrary to other parameters,
13807 \begin_inset Flex Code
13810 \begin_layout Plain Layout
13816 implies the generation of specific LaTeX code, using the package
13819 \begin_inset Flex Code
13822 \begin_layout Plain Layout
13831 \begin_layout Description
13832 \begin_inset Flex Code
13835 \begin_layout Plain Layout
13842 \begin_inset Flex Code
13845 \begin_layout Plain Layout
13852 \begin_inset Flex Code
13855 \begin_layout Plain Layout
13863 ] Spellcheck paragraphs of this style.
13867 \begin_layout Description
13868 \begin_inset Flex Code
13871 \begin_layout Plain Layout
13877 The font used for the text body .
13879 \begin_inset CommandInset ref
13881 reference "sub:Font-description"
13888 \begin_layout Description
13889 \begin_inset Flex Code
13892 \begin_layout Plain Layout
13901 \begin_inset Flex Code
13904 \begin_layout Plain Layout
13914 The level of the style in the table of contents.
13915 This is used for automatic numbering of section headings.
13918 \begin_layout Description
13919 \begin_inset Flex Code
13922 \begin_layout Plain Layout
13929 \begin_inset Flex Code
13932 \begin_layout Plain Layout
13938 ] The vertical space with which the very first of a chain of paragraphs
13939 with this style is separated from the previous paragraph.
13940 If the previous paragraph has another style, the separations are not simply
13941 added, but the maximum is taken.
13944 \begin_layout Subsection
13945 \begin_inset CommandInset label
13951 Internationalization of Paragraph Styles
13954 \begin_layout Standard
13955 LyX has long supported internationalization of layout information, but,
13956 until version 2.0, this applied only to the user interface and not to, say,
13958 Thus, French authors were forced to resort to ugly hacks if they wanted
13963 1' instead of `Theorem 1'.
13964 Thanks to Georg Baum, that is no longer the case.
13967 \begin_layout Standard
13969 \begin_inset Flex Code
13972 \begin_layout Plain Layout
13978 defines text that is to appear in the typeset document, it may use
13979 \begin_inset Flex Code
13982 \begin_layout Plain Layout
13989 \begin_inset Flex Code
13992 \begin_layout Plain Layout
13998 to support non-English and even multi-language documents correctly.
13999 The following excerpt (from the
14000 \begin_inset Flex Code
14003 \begin_layout Plain Layout
14009 file) shows how this works:
14012 \begin_layout LyX-Code
14017 \begin_layout LyX-Code
14020 theoremstyle{remark}
14023 \begin_layout LyX-Code
14026 newtheorem{claim}[thm]{
14033 \begin_layout LyX-Code
14037 \begin_layout LyX-Code
14041 \begin_layout LyX-Code
14046 claimname}{_(Claim)}
14049 \begin_layout LyX-Code
14053 \begin_layout LyX-Code
14057 \begin_layout LyX-Code
14066 claimname}{_(Claim)}}
14069 \begin_layout LyX-Code
14074 \begin_layout Standard
14075 In principle, any legal LaTeX may appear in the
14076 \begin_inset Flex Code
14079 \begin_layout Plain Layout
14086 \begin_inset Flex Code
14089 \begin_layout Plain Layout
14095 tags, but in practice they will typically look as they do here.
14096 The key to correct translation of the typeset text is the definition of
14098 \begin_inset Flex Code
14101 \begin_layout Plain Layout
14110 \begin_inset Flex Code
14113 \begin_layout Plain Layout
14125 \begin_layout Standard
14127 \begin_inset Flex Code
14130 \begin_layout Plain Layout
14136 tag provides for internationalization based upon the overall language of
14138 The contents of the tag will be included in the preamble, just as with
14140 \begin_inset Flex Code
14143 \begin_layout Plain Layout
14150 What makes it special is the use of the
14151 \begin_inset Quotes eld
14155 \begin_inset Quotes erd
14159 \begin_inset Flex Code
14162 \begin_layout Plain Layout
14168 , which will be replaced, when LyX produces LaTeX output, with the translation
14169 of its argument into the document language.
14172 \begin_layout Standard
14174 \begin_inset Flex Code
14177 \begin_layout Plain Layout
14183 tag is more complex, since it is meant to provide support for multi-language
14184 documents and so offers an interface to the
14185 \begin_inset Flex Code
14188 \begin_layout Plain Layout
14195 Its contents will be added to the preamble once for each language that
14196 appears in the document.
14197 In this case, the argument to
14198 \begin_inset Flex Code
14201 \begin_layout Plain Layout
14207 will be replaced with its translation into the language in question; the
14209 \begin_inset Flex Code
14212 \begin_layout Plain Layout
14218 is replaced by the language name (as used by the babel package).
14221 \begin_layout Standard
14222 A German document that also included a French section would thus have the
14223 following in the preamble:
14226 \begin_layout LyX-Code
14235 claimname}{Affirmation}}
14243 claimname}{Behauptung}}
14247 claimname}{Behauptung}
14250 \begin_layout Standard
14252 \begin_inset Flex Code
14255 \begin_layout Plain Layout
14261 will then conspire to produce the correct text in the output.
14264 \begin_layout Standard
14265 One important point to note here is that the translations are provided by
14266 LyX itself, through the
14267 \change_inserted -195340706 1334775793
14269 \begin_inset Flex Code
14272 \begin_layout Plain Layout
14274 \change_inserted -195340706 1334775793
14281 \change_deleted -195340706 1334775793
14282 same mechanism it uses for internationalization of the user interface
14285 This means, in effect, that
14286 \begin_inset Flex Code
14289 \begin_layout Plain Layout
14296 \begin_inset Flex Code
14299 \begin_layout Plain Layout
14305 are really only of use in layout files that are provided with LyX, since
14306 text entered in user-created layout files will not be seen by LyX's internation
14308 \change_inserted -195340706 1334775793
14310 \begin_inset Flex Code
14313 \begin_layout Plain Layout
14315 \change_inserted -195340706 1334775793
14321 file is modified accordingly
14324 That said, however, any layout created with the intention that it will
14325 be included with LyX should use these tags where appropriate.
14327 \change_inserted -195340706 1334775793
14328 Please note that the paragraph style translations provided by LyX will
14329 never change with a minor update (e.g.
14330 from version 2.1.x to 2.1.y).
14331 It is however quite likely that a major update (e.g.
14332 from 2.0.x to 2.1.y) will introduce new translations or corrections.
14337 \begin_layout Subsection
14339 \begin_inset CommandInset label
14348 \begin_layout Standard
14349 Since version 1.3.0 of LyX, it is has been both possible and necessary to
14350 define the floats (
14351 \begin_inset Flex MenuItem
14354 \begin_layout Plain Layout
14361 \begin_inset Flex MenuItem
14364 \begin_layout Plain Layout
14370 , \SpecialChar \ldots{}
14371 ) in the text class itself.
14372 Standard floats are included in the file
14373 \begin_inset Flex Code
14376 \begin_layout Plain Layout
14382 , so you may have to do no more than add
14385 \begin_layout LyX-Code
14386 Input stdfloats.inc
14389 \begin_layout Standard
14390 to your layout file.
14391 If you want to implement a text class that proposes some other float types
14392 (like the AGU class bundled with LyX), the information below will hopefully
14396 \begin_layout Description
14397 \begin_inset Flex Code
14400 \begin_layout Plain Layout
14407 \begin_inset Flex Code
14410 \begin_layout Plain Layout
14417 \begin_inset Quotes erd
14421 \begin_inset Quotes erd
14424 ] The file name extension of an auxiliary file for the list of figures (or
14426 LaTeX writes the captions to this file.
14429 \begin_layout Description
14430 \begin_inset Flex Code
14433 \begin_layout Plain Layout
14440 \begin_inset Flex Code
14443 \begin_layout Plain Layout
14450 \begin_inset Quotes erd
14454 \begin_inset Quotes erd
14457 ] The string that will be used in the menus and also for the caption.
14458 This is translated to the current language if babel is used.
14461 \begin_layout Description
14462 \begin_inset Flex Code
14465 \begin_layout Plain Layout
14471 These are used for XHTML output.
14473 \begin_inset CommandInset ref
14475 reference "sec:Tags-for-XHTML"
14482 \begin_layout Description
14483 \begin_inset Flex Code
14486 \begin_layout Plain Layout
14495 \begin_inset Flex Code
14498 \begin_layout Plain Layout
14507 \begin_inset Flex Code
14510 \begin_layout Plain Layout
14516 ] Indicates whether the float is already defined in the document class or
14517 if we instead need to load
14518 \begin_inset Flex Code
14521 \begin_layout Plain Layout
14527 and use what it provides to define it on-the-fly.
14529 \begin_inset Flex Code
14532 \begin_layout Plain Layout
14539 \begin_inset Flex Code
14542 \begin_layout Plain Layout
14549 It should be set to
14550 \begin_inset Flex Code
14553 \begin_layout Plain Layout
14559 if the float is already defined by the LaTeX document class.
14562 \begin_layout Description
14563 \begin_inset Flex Code
14566 \begin_layout Plain Layout
14573 \begin_inset Flex Code
14576 \begin_layout Plain Layout
14583 \begin_inset Quotes erd
14587 \begin_inset Quotes erd
14590 ] The command used to generate a list of floats of this type; the leading
14593 ' should be omitted.
14599 \begin_inset Flex Code
14602 \begin_layout Plain Layout
14608 is false, since there is no standard way to generate this command.
14610 \begin_inset Flex Code
14613 \begin_layout Plain Layout
14619 is true, since in that case there is a standard way to define the command.
14622 \begin_layout Description
14623 \begin_inset Flex Code
14626 \begin_layout Plain Layout
14633 \begin_inset Flex Code
14636 \begin_layout Plain Layout
14643 \begin_inset Quotes erd
14647 \begin_inset Quotes erd
14650 ] A title for a list of floats of this kind (list of figures, tables, or
14652 It is used for the screen label within LyX; it is passed to LaTeX for use
14653 as the title there; and it is used as the title in XHTML output.
14654 It will be translated to the document language.
14657 \begin_layout Description
14658 \begin_inset Flex Code
14661 \begin_layout Plain Layout
14668 \begin_inset Flex Code
14671 \begin_layout Plain Layout
14678 \begin_inset Quotes erd
14682 \begin_inset Quotes erd
14685 ] This (optional) argument determines whether floats of this class will
14686 be numbered within some sectional unit of the document.
14687 For example, if within is equal to
14688 \begin_inset Flex Code
14691 \begin_layout Plain Layout
14697 , the floats will be numbered within chapters.
14701 \begin_layout Description
14702 \begin_inset Flex Code
14705 \begin_layout Plain Layout
14712 \begin_inset Flex Code
14715 \begin_layout Plain Layout
14722 \begin_inset Quotes erd
14726 \begin_inset Quotes erd
14729 ] The default placement for the given class of floats.
14730 The string should be as in standard LaTeX:
14731 \begin_inset Flex Code
14734 \begin_layout Plain Layout
14741 \begin_inset Flex Code
14744 \begin_layout Plain Layout
14751 \begin_inset Flex Code
14754 \begin_layout Plain Layout
14761 \begin_inset Flex Code
14764 \begin_layout Plain Layout
14770 for top, bottom, page, and here, respectively.
14774 \begin_layout Plain Layout
14775 Note that the order of these letters in the string is irrelevant, like in
14781 On top of that there is a new type,
14782 \begin_inset Flex Code
14785 \begin_layout Plain Layout
14791 , which does not really correspond to a float, since it means: put it
14792 \begin_inset Quotes eld
14796 \begin_inset Quotes erd
14800 Note however that the
14801 \begin_inset Flex Code
14804 \begin_layout Plain Layout
14810 specifier is special and, because of implementation details, cannot be
14811 used in non-built in float types.
14812 If you do not understand what this means, just use
14813 \begin_inset Quotes eld
14817 \begin_inset Flex Code
14820 \begin_layout Plain Layout
14827 \begin_inset Quotes erd
14833 \begin_layout Description
14834 \begin_inset Flex Code
14837 \begin_layout Plain Layout
14844 \begin_inset Flex Code
14847 \begin_layout Plain Layout
14853 ] The prefix to use when creating labels referring to floats of this type.
14854 This allows the use of formatted references.
14855 Note that you can remove any
14856 \begin_inset Flex Code
14859 \begin_layout Plain Layout
14865 set by a copied style by using the special value
14866 \begin_inset Quotes eld
14870 \begin_inset Quotes erd
14873 , which must be all caps.
14876 \begin_layout Description
14877 \begin_inset Flex Code
14880 \begin_layout Plain Layout
14887 \begin_inset Flex Code
14890 \begin_layout Plain Layout
14897 \begin_inset Quotes erd
14901 \begin_inset Quotes erd
14904 ] The style used when defining the float using
14905 \begin_inset Flex Code
14908 \begin_layout Plain Layout
14919 \begin_layout Description
14920 \begin_inset Flex Code
14923 \begin_layout Plain Layout
14930 \begin_inset Flex Code
14933 \begin_layout Plain Layout
14940 \begin_inset Quotes erd
14944 \begin_inset Quotes erd
14948 \begin_inset Quotes eld
14952 \begin_inset Quotes erd
14955 of the new class of floats, like program or algorithm.
14956 After the appropriate
14957 \begin_inset Flex Code
14960 \begin_layout Plain Layout
14969 \begin_inset Flex Code
14972 \begin_layout Plain Layout
14981 \begin_inset Flex Code
14984 \begin_layout Plain Layout
14995 \begin_layout Description
14996 \begin_inset Flex Code
14999 \begin_layout Plain Layout
15006 \begin_inset Flex Code
15009 \begin_layout Plain Layout
15016 \begin_inset Flex Code
15019 \begin_layout Plain Layout
15027 ] Tells us whether this float is defined using the facilities provided by
15029 \begin_inset Flex Code
15032 \begin_layout Plain Layout
15038 , either by the class file or a package, or on-the-fly by LyX itself.
15041 \begin_layout Standard
15042 Note that defining a float with type
15043 \begin_inset Flex Code
15046 \begin_layout Plain Layout
15054 automatically defines the corresponding counter with name
15055 \begin_inset Flex Code
15058 \begin_layout Plain Layout
15069 \begin_layout Subsection
15070 Flex insets and InsetLayout
15071 \begin_inset CommandInset label
15073 name "sub:Flex-insets-and"
15080 \begin_layout Standard
15081 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
15082 these are called Flex insets.
15086 \begin_layout Standard
15087 Flex insets come in three different kinds:
15090 \begin_layout Itemize
15092 \begin_inset Flex Code
15095 \begin_layout Plain Layout
15101 ): These define semantic markup corresponding to such LaTeX commands as
15103 \begin_inset Flex Code
15106 \begin_layout Plain Layout
15115 \begin_inset Flex Code
15118 \begin_layout Plain Layout
15129 \begin_layout Itemize
15131 \begin_inset Flex Code
15134 \begin_layout Plain Layout
15140 ): These can be used to define custom collapsible insets, similar to TeX
15141 code, footnote, and the like.
15142 An obvious example is an endnote inset, which is defined in the
15143 \begin_inset Flex Code
15146 \begin_layout Plain Layout
15155 \begin_layout Itemize
15157 \begin_inset Flex Code
15160 \begin_layout Plain Layout
15166 ): For use with DocBook classes.
15169 \begin_layout Standard
15170 Flex insets are defined using the
15171 \begin_inset Flex Code
15174 \begin_layout Plain Layout
15180 tag, which shall be explained in a moment.
15183 \begin_layout Standard
15185 \begin_inset Flex Code
15188 \begin_layout Plain Layout
15194 tag also serves another function: It can be used to customize the general
15195 layout of many different types of insets.
15197 \begin_inset Flex Code
15200 \begin_layout Plain Layout
15206 can be used to customize the layout parameters for footnotes, marginal
15207 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
15208 boxes, tables, algorithms, URLs, and optional arguments, as well as to
15209 define Flex insets.
15212 \begin_layout Standard
15214 \begin_inset Flex Code
15217 \begin_layout Plain Layout
15223 definition must begin with a line of the form:
15226 \begin_layout LyX-Code
15230 \begin_layout Standard
15232 \begin_inset Flex Code
15235 \begin_layout Plain Layout
15241 indicates the inset whose layout is being defined, and here there are
15242 \change_inserted 5863208 1334489266
15244 \change_deleted 5863208 1334489267
15250 \begin_layout Enumerate
15251 The layout for a pre-existing inset is being modified.
15252 In this case, can be
15253 \begin_inset Flex Code
15256 \begin_layout Plain Layout
15262 any one of the following:
15263 \begin_inset Flex Code
15266 \begin_layout Plain Layout
15273 \begin_inset Flex Code
15276 \begin_layout Plain Layout
15283 \begin_inset Flex Code
15286 \begin_layout Plain Layout
15293 \begin_inset Flex Code
15296 \begin_layout Plain Layout
15303 \begin_inset Flex Code
15306 \begin_layout Plain Layout
15313 \begin_inset Flex Code
15316 \begin_layout Plain Layout
15323 \begin_inset Flex Code
15326 \begin_layout Plain Layout
15333 \begin_inset Flex Code
15336 \begin_layout Plain Layout
15343 \begin_inset Flex Code
15346 \begin_layout Plain Layout
15353 \begin_inset Flex Code
15356 \begin_layout Plain Layout
15363 \begin_inset Flex Code
15366 \begin_layout Plain Layout
15373 \begin_inset Flex Code
15376 \begin_layout Plain Layout
15383 \begin_inset Flex Code
15386 \begin_layout Plain Layout
15393 \begin_inset Flex Code
15396 \begin_layout Plain Layout
15403 \begin_inset Flex Code
15406 \begin_layout Plain Layout
15413 \begin_inset Flex Code
15416 \begin_layout Plain Layout
15423 \begin_inset Flex Code
15426 \begin_layout Plain Layout
15433 \begin_inset Flex Code
15436 \begin_layout Plain Layout
15438 \change_deleted -712698321 1353866704
15442 \change_inserted -712698321 1353866707
15451 \begin_inset Flex Code
15454 \begin_layout Plain Layout
15461 \begin_inset Flex Code
15464 \begin_layout Plain Layout
15473 \begin_layout Enumerate
15474 The layout for a Flex inset is being defined.
15476 \begin_inset Flex Code
15479 \begin_layout Plain Layout
15485 must be of the form
15486 \begin_inset Quotes eld
15490 \begin_inset Flex Code
15493 \begin_layout Plain Layout
15500 \begin_inset Quotes erd
15504 \begin_inset Flex Code
15507 \begin_layout Plain Layout
15513 may be be any valid identifier not used by a pre-existing Flex inset.
15514 The identifier may include spaces, but in that case the whole thing must
15515 be wrapped in quotes.
15516 Note that the definition of a flex inset
15521 \begin_inset Flex Code
15524 \begin_layout Plain Layout
15530 entry, declaring which type of inset it defines.
15531 \change_inserted 5863208 1334489312
15535 \begin_layout Enumerate
15537 \change_inserted 5863208 1334492248
15538 The layout for user specific branch is being defined.
15540 \begin_inset Flex Code
15543 \begin_layout Plain Layout
15545 \change_inserted 5863208 1334489384
15551 must be of the form
15552 \begin_inset Quotes eld
15556 \begin_inset Flex Code
15559 \begin_layout Plain Layout
15561 \change_inserted 5863208 1334489392
15568 \begin_inset Quotes erd
15572 \begin_inset Flex Code
15575 \begin_layout Plain Layout
15577 \change_inserted 5863208 1334489384
15583 may be be any valid identifier of branch defined in user's document.
15584 The identifier may include spaces, but in that case the whole thing must
15585 be wrapped in quotes.
15586 The main purpose of this feature is to allow LaTeX wrapping around specific
15587 branches as user needs.
15592 \begin_layout Standard
15594 \begin_inset Flex Code
15597 \begin_layout Plain Layout
15603 definition can contain the following entries:
15606 \begin_layout Description
15608 \change_inserted -712698321 1353681390
15609 \begin_inset Flex Code
15612 \begin_layout Plain Layout
15614 \change_inserted -712698321 1353681344
15621 \begin_inset Flex Code
15624 \begin_layout Plain Layout
15626 \change_inserted -712698321 1353681344
15632 ] Defines argument number <int> of a command\SpecialChar \slash{}
15633 environment associated with
15634 the current layout.
15635 The definition must end with
15636 \begin_inset Flex Code
15639 \begin_layout Plain Layout
15641 \change_inserted -712698321 1353681344
15649 \begin_inset space ~
15653 \begin_inset CommandInset ref
15655 reference "sub:Paragraph-Styles"
15662 \begin_layout Description
15664 \change_inserted -195340706 1333913893
15665 \begin_inset Flex Code
15668 \begin_layout Plain Layout
15674 Preamble for changing languages.
15676 \begin_inset space ~
15680 \begin_inset CommandInset ref
15682 reference "sub:I18n"
15689 \begin_layout Description
15690 \begin_inset Flex Code
15693 \begin_layout Plain Layout
15699 The color for the inset's background.
15700 The valid colors are defined in
15701 \begin_inset Flex Code
15704 \begin_layout Plain Layout
15713 \begin_layout Description
15714 \begin_inset Flex Code
15717 \begin_layout Plain Layout
15724 \begin_inset Flex Code
15727 \begin_layout Plain Layout
15736 \begin_inset Flex Code
15739 \begin_layout Plain Layout
15745 ] Whether to use the content of the inset as the label, when the inset is
15750 \begin_layout Description
15751 \begin_inset Flex Code
15754 \begin_layout Plain Layout
15761 \begin_inset Flex Code
15764 \begin_layout Plain Layout
15770 Copies all the features of an existing style into the current one.
15774 \begin_layout Description
15775 \begin_inset Flex Code
15778 \begin_layout Plain Layout
15785 \begin_inset Flex Code
15788 \begin_layout Plain Layout
15797 \begin_inset Flex Code
15800 \begin_layout Plain Layout
15806 ] Indicates whether the user may employ the Paragraph Settings dialog to
15807 customize the paragraph.
15810 \begin_layout Description
15811 \begin_inset Flex Code
15814 \begin_layout Plain Layout
15821 \begin_inset Flex Code
15824 \begin_layout Plain Layout
15831 \begin_inset Flex Code
15834 \begin_layout Plain Layout
15841 \begin_inset Flex Code
15844 \begin_layout Plain Layout
15850 , describing the rendering style used for the inset's frame and buttons.
15851 Footnotes generally use
15852 \begin_inset Flex Code
15855 \begin_layout Plain Layout
15861 , ERT insets generally
15862 \begin_inset Flex Code
15865 \begin_layout Plain Layout
15871 , and character styles
15872 \begin_inset Flex Code
15875 \begin_layout Plain Layout
15884 \begin_layout Description
15885 \begin_inset Flex Code
15888 \begin_layout Plain Layout
15895 \begin_inset Flex Code
15898 \begin_layout Plain Layout
15905 \begin_inset Flex Code
15908 \begin_layout Plain Layout
15917 \begin_inset Flex Code
15920 \begin_layout Plain Layout
15927 \begin_inset Flex Code
15930 \begin_layout Plain Layout
15937 Indicates whether the environment will stand on its own in LaTeX output
15938 or will appear inline with the surrounding text.
15939 If set to false, it is supposed that the LaTeX environment ignores white
15940 space (including one newline character) after the
15941 \begin_inset Flex Code
15944 \begin_layout Plain Layout
15957 \begin_inset Flex Code
15960 \begin_layout Plain Layout
15976 \begin_layout Description
15977 \begin_inset Flex Code
15980 \begin_layout Plain Layout
15986 Required at the end of the InsetLayout declarations.
15989 \begin_layout Description
15990 \begin_inset Flex Code
15993 \begin_layout Plain Layout
15999 The font used for both the text body
16005 \begin_inset space ~
16009 \begin_inset CommandInset ref
16011 reference "sub:Font-description"
16016 Note that defining this font automatically defines the
16017 \begin_inset Flex Code
16020 \begin_layout Plain Layout
16026 to the same value, so define this first and define
16027 \begin_inset Flex Code
16030 \begin_layout Plain Layout
16036 later if you want them to be different.
16037 \change_inserted 155139281 1354130923
16041 \begin_layout Description
16043 \change_inserted 155139281 1354130923
16044 \begin_inset Flex Code
16047 \begin_layout Plain Layout
16049 \change_inserted 155139281 1354130923
16050 ForceLocalFontSwitch
16056 \begin_inset Flex Code
16059 \begin_layout Plain Layout
16061 \change_inserted 155139281 1354130923
16070 \begin_inset Flex Code
16073 \begin_layout Plain Layout
16075 \change_inserted 155139281 1354130923
16081 ] When using babel, always use a local font switch (
16082 \begin_inset Flex Code
16085 \begin_layout Plain Layout
16087 \change_inserted 155139281 1354130923
16095 ), never a global one (such as
16096 \begin_inset Flex Code
16099 \begin_layout Plain Layout
16101 \change_inserted 155139281 1354130923
16114 \begin_layout Description
16115 \begin_inset Flex Code
16118 \begin_layout Plain Layout
16125 \begin_inset Quotes eld
16129 \begin_inset Quotes erd
16132 language, leading to Left-to-Right (latin) output, e.
16133 \begin_inset space \thinspace{}
16137 \begin_inset space \space{}
16140 in TeX code or URL.
16144 \begin_layout Description
16145 \begin_inset Flex Code
16148 \begin_layout Plain Layout
16155 \begin_inset Flex Code
16158 \begin_layout Plain Layout
16167 \begin_inset Flex Code
16170 \begin_layout Plain Layout
16176 ] Indicates whether the
16177 \begin_inset Flex Code
16180 \begin_layout Plain Layout
16186 should be used or, instead, the user can change the paragraph style used
16191 \begin_layout Description
16192 \begin_inset Flex Code
16195 \begin_layout Plain Layout
16202 \begin_inset Flex Code
16205 \begin_layout Plain Layout
16214 \begin_inset Flex Code
16217 \begin_layout Plain Layout
16223 ] Usually LyX doesn't allow you to insert more than one space between words,
16224 since a space is considered as the separation between two words, not a
16225 character or symbol of its own.
16226 This is a very fine thing but sometimes annoying, for example, when typing
16227 program code or plain LaTeX code.
16229 \begin_inset Flex Code
16232 \begin_layout Plain Layout
16239 Note that LyX will create protected blanks for the additional blanks when
16240 in another mode than LaTeX-mode.
16244 \begin_layout Description
16245 \begin_inset Flex Code
16248 \begin_layout Plain Layout
16254 These tags control XHTML output.
16256 \begin_inset CommandInset ref
16258 reference "sec:Tags-for-XHTML"
16265 \begin_layout Description
16266 \begin_inset Flex Code
16269 \begin_layout Plain Layout
16276 \begin_inset Flex Code
16279 \begin_layout Plain Layout
16288 \begin_inset Flex Code
16291 \begin_layout Plain Layout
16297 ] Whether to include the contents of this inset in the strings generated
16298 for the `Outline' pane.
16299 One would not, for example, want the content of a footnote in a section
16300 header to be included in the TOC displayed in the outline, but one would
16301 normally want the content of a character style displayed.
16302 Default is false: not to include.
16305 \begin_layout Description
16306 \begin_inset Flex Code
16309 \begin_layout Plain Layout
16316 \begin_inset Flex Code
16319 \begin_layout Plain Layout
16328 \begin_inset Flex Code
16331 \begin_layout Plain Layout
16337 ] Usually LyX does not allow you to leave a paragraph empty, since it would
16338 lead to empty LaTeX output.
16339 There are some cases where this could be desirable however: in a letter
16340 template, the required fields can be provided as empty fields, so that
16341 people do not forget them; in some special classes, a style can be used
16342 as some kind of break, which does not contain actual text.
16346 \begin_layout Description
16347 \begin_inset Flex Code
16350 \begin_layout Plain Layout
16356 The font used for the label.
16358 \begin_inset space ~
16362 \begin_inset CommandInset ref
16364 reference "sub:Font-description"
16369 Note that this definition can never appear before
16370 \begin_inset Flex Code
16373 \begin_layout Plain Layout
16379 , lest it be ineffective.
16382 \begin_layout Description
16383 \begin_inset Flex Code
16386 \begin_layout Plain Layout
16392 What will be displayed on the button or elsewhere as the inset label.
16394 \begin_inset Flex Code
16397 \begin_layout Plain Layout
16404 \begin_inset Flex Code
16407 \begin_layout Plain Layout
16413 ) modify this label on the fly.
16416 \begin_layout Description
16418 \change_inserted -195340706 1333913893
16419 \begin_inset Flex Code
16422 \begin_layout Plain Layout
16428 Language dependent preamble.
16430 \begin_inset space ~
16434 \begin_inset CommandInset ref
16436 reference "sub:I18n"
16443 \begin_layout Description
16444 \begin_inset Flex Code
16447 \begin_layout Plain Layout
16453 The name of the corresponding LaTeX stuff.
16454 Either the environment or command name.
16457 \begin_layout Description
16458 \begin_inset Flex Code
16461 \begin_layout Plain Layout
16467 The optional parameter for the corresponding
16468 \begin_inset Flex Code
16471 \begin_layout Plain Layout
16477 stuff, including possible bracket pairs like
16478 \begin_inset Flex Code
16481 \begin_layout Plain Layout
16488 This parameter cannot be changed from within LyX.
16491 \begin_layout Description
16492 \begin_inset Flex Code
16495 \begin_layout Plain Layout
16502 \begin_inset Flex Code
16505 \begin_layout Plain Layout
16507 \change_deleted -712698321 1353867544
16514 Command, Environment,
16515 \change_inserted -712698321 1353867573
16517 \change_deleted -712698321 1353867557
16526 \begin_inset Flex Code
16529 \begin_layout Plain Layout
16531 \change_deleted -712698321 1353867564
16535 \change_deleted -712698321 1353867569
16543 ] How the style should be translated into LaTeX.
16547 \begin_layout Plain Layout
16548 \begin_inset Flex Code
16551 \begin_layout Plain Layout
16557 is perhaps a bit misleading, since these rules apply to SGML classes, too.
16558 Visit the SGML class files for specific examples.
16567 \begin_layout Itemize
16568 \begin_inset Flex Code
16571 \begin_layout Plain Layout
16573 \change_deleted -712698321 1353867582
16575 \change_inserted -712698321 1353867583
16583 means nothing special.
16587 \begin_layout Itemize
16588 \begin_inset Flex Code
16591 \begin_layout Plain Layout
16598 \begin_inset Flex Code
16601 \begin_layout Plain Layout
16608 {\SpecialChar \ldots{}
16617 \begin_layout Itemize
16618 \begin_inset Flex Code
16621 \begin_layout Plain Layout
16628 \begin_inset Flex Code
16631 \begin_layout Plain Layout
16638 }\SpecialChar \ldots{}
16654 \begin_layout Itemize
16656 \change_deleted -712698321 1353867600
16657 \begin_inset Flex Code
16660 \begin_layout Plain Layout
16667 \begin_inset Flex Code
16670 \begin_layout Plain Layout
16677 \begin_inset Flex Code
16680 \begin_layout Plain Layout
16688 is generated for each paragraph of this environment.
16692 \begin_layout Itemize
16694 \change_deleted -712698321 1353867600
16695 \begin_inset Flex Code
16698 \begin_layout Plain Layout
16705 \begin_inset Flex Code
16708 \begin_layout Plain Layout
16715 \begin_inset Flex Code
16718 \begin_layout Plain Layout
16724 is passed as an argument to the environment.
16726 \begin_inset Flex Code
16729 \begin_layout Plain Layout
16735 can be defined in the
16736 \begin_inset Flex MenuItem
16739 \begin_layout Plain Layout
16744 \SpecialChar \menuseparator
16750 \begin_inset space ~
16764 \begin_layout Standard
16765 Putting the last few things together, the LaTeX output will be either:
16768 \begin_layout LyX-Code
16771 latexname[latexparam]{\SpecialChar \ldots{}
16775 \begin_layout Standard
16779 \begin_layout LyX-Code
16782 begin{latexname}[latexparam] \SpecialChar \ldots{}
16788 \begin_layout Standard
16789 depending upon the LaTeX type.
16793 \begin_layout Description
16795 \change_inserted -712698321 1353866797
16796 \begin_inset Flex Code
16799 \begin_layout Plain Layout
16801 \change_inserted -712698321 1353866742
16810 \begin_inset Flex Code
16813 \begin_layout Plain Layout
16815 \change_inserted -712698321 1353866752
16821 ] A string that is put at the beginning of the layout content.
16822 \change_inserted 155139281 1354130509
16826 \begin_layout Description
16827 \begin_inset Flex Code
16830 \begin_layout Plain Layout
16837 \begin_inset Flex Code
16840 \begin_layout Plain Layout
16847 \begin_inset Flex Code
16850 \begin_layout Plain Layout
16857 \begin_inset Flex Code
16860 \begin_layout Plain Layout
16867 \begin_inset Flex Code
16870 \begin_layout Plain Layout
16876 (indicating a dummy definition ending definitions of charstyles, etc).
16877 This entry is required in and is only meaningful for Flex insets.
16878 Among other things, it determines on which menu this inset will appear.
16880 \begin_inset Flex Code
16883 \begin_layout Plain Layout
16890 \begin_inset Flex Code
16893 \begin_layout Plain Layout
16900 \begin_inset Flex Code
16903 \begin_layout Plain Layout
16911 \begin_inset Flex Code
16914 \begin_layout Plain Layout
16920 can be set to true for charstyle insets, if you wish, by setting it
16925 \begin_inset Flex Code
16928 \begin_layout Plain Layout
16937 \begin_layout Description
16938 \begin_inset Flex Code
16941 \begin_layout Plain Layout
16948 \begin_inset Flex Code
16951 \begin_layout Plain Layout
16960 \begin_inset Flex Code
16963 \begin_layout Plain Layout
16969 ] Whether multiple paragraphs are permitted in this inset.
16971 \begin_inset Flex Code
16974 \begin_layout Plain Layout
16980 to the same value and
16981 \begin_inset Flex Code
16984 \begin_layout Plain Layout
16990 to the opposite value.
16991 These can be reset to other values, if they are used
16996 \begin_inset Flex Code
16999 \begin_layout Plain Layout
17009 \begin_layout Description
17010 \begin_inset Flex Code
17013 \begin_layout Plain Layout
17020 \begin_inset Flex Code
17023 \begin_layout Plain Layout
17032 \begin_inset Flex Code
17035 \begin_layout Plain Layout
17041 ] Whether fragile commands in this inset should be
17042 \begin_inset Flex Code
17045 \begin_layout Plain Layout
17058 whether the command should itself be protected.) Default is false.
17061 \begin_layout Description
17062 \begin_inset Flex Code
17065 \begin_layout Plain Layout
17072 \begin_inset Flex Code
17075 \begin_layout Plain Layout
17084 \begin_inset Flex Code
17087 \begin_layout Plain Layout
17093 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
17094 output, but only by a line break; together with
17095 \begin_inset Flex Code
17098 \begin_layout Plain Layout
17104 , this allows to emulate a plain text editor (like the ERT inset).
17108 \begin_layout Description
17109 \begin_inset Flex Code
17112 \begin_layout Plain Layout
17119 \begin_inset Flex Code
17122 \begin_layout Plain Layout
17131 \begin_inset Flex Code
17134 \begin_layout Plain Layout
17140 ] Whether the contents of this paragraph should be output in raw form, meaning
17141 without special translations that LaTeX would require.
17144 \begin_layout Description
17145 \begin_inset Flex Code
17148 \begin_layout Plain Layout
17154 Information to be included in the LaTeX preamble when this style is used.
17155 Used to define macros, load packages, etc., required by this particular
17158 \begin_inset Quotes eld
17162 \begin_inset Flex Code
17165 \begin_layout Plain Layout
17172 \begin_inset Quotes erd
17178 \begin_layout Description
17179 \begin_inset Flex Code
17182 \begin_layout Plain Layout
17189 \begin_inset Flex Code
17192 \begin_layout Plain Layout
17198 ] The prefix to use when creating labels referring to insets of this type.
17199 This allows the use of formatted references.
17202 \begin_layout Description
17203 \begin_inset Flex Code
17206 \begin_layout Plain Layout
17213 \begin_inset Flex Code
17216 \begin_layout Plain Layout
17222 ] Whether the style requires the feature
17223 \begin_inset Flex Code
17226 \begin_layout Plain Layout
17233 See the description of
17234 \begin_inset Flex Code
17237 \begin_layout Plain Layout
17244 \begin_inset CommandInset ref
17245 LatexCommand pageref
17246 reference "des:FreeSpacing"
17250 ) for information on `features'.
17254 \begin_layout Description
17255 \begin_inset Flex Code
17258 \begin_layout Plain Layout
17265 \begin_inset Flex Code
17268 \begin_layout Plain Layout
17275 \begin_inset Flex Code
17278 \begin_layout Plain Layout
17286 ] Whether this inset should use the font of its surrounding environment
17288 Default is true: uses its own.
17289 \change_inserted -712698321 1353866806
17293 \begin_layout Description
17295 \change_inserted -712698321 1353866814
17296 \begin_inset Flex Code
17299 \begin_layout Plain Layout
17301 \change_inserted -712698321 1353866810
17308 \begin_inset Flex Code
17311 \begin_layout Plain Layout
17313 \change_inserted -712698321 1353866806
17319 ] A string that is put at the end of the layout content.
17324 \begin_layout Description
17325 \begin_inset Flex Code
17328 \begin_layout Plain Layout
17335 \begin_inset Flex Code
17338 \begin_layout Plain Layout
17345 \begin_inset Flex Code
17348 \begin_layout Plain Layout
17356 ] Spellcheck the contents of this inset.
17360 \begin_layout Subsection
17362 \begin_inset CommandInset label
17364 name "sub:Counters"
17371 \begin_layout Standard
17372 Since version 1.3.0 of LyX, it is both possible and necessary to define the
17374 \begin_inset Flex MenuItem
17377 \begin_layout Plain Layout
17384 \begin_inset Flex MenuItem
17387 \begin_layout Plain Layout
17393 , \SpecialChar \ldots{}
17394 ) in the text class itself.
17395 The standard counters are defined in the file
17396 \begin_inset Flex Code
17399 \begin_layout Plain Layout
17405 , so you may have to do no more than add
17408 \begin_layout LyX-Code
17409 Input stdcounters.inc
17412 \begin_layout Standard
17413 to your layout file to get them to work.
17414 But if you want to define custom counters, then you can do so.
17415 The counter declaration must begin with:
17418 \begin_layout LyX-Code
17419 Counter CounterName
17422 \begin_layout Standard
17424 \begin_inset Flex Code
17427 \begin_layout Plain Layout
17433 ' is replaced by the name of the counter.
17434 And it must end with
17435 \begin_inset Quotes eld
17439 \begin_inset Flex Code
17442 \begin_layout Plain Layout
17449 \begin_inset Quotes erd
17453 The following parameters can also be used:
17456 \begin_layout Description
17457 \begin_inset Flex Code
17460 \begin_layout Plain Layout
17467 \begin_inset Flex Code
17470 \begin_layout Plain Layout
17477 \begin_inset Quotes erd
17481 \begin_inset Quotes erd
17484 ] When defined, this string defines how the counter is displayed.
17485 Setting this value sets
17486 \begin_inset Flex Code
17489 \begin_layout Plain Layout
17490 LabelStringAppendix
17496 The following special constructs can be used in the string:
17500 \begin_layout Itemize
17501 \begin_inset Flex Code
17504 \begin_layout Plain Layout
17512 will be replaced by the expansion of the
17513 \begin_inset Flex Code
17516 \begin_layout Plain Layout
17523 \begin_inset Flex Code
17526 \begin_layout Plain Layout
17527 LabelStringAppendix
17533 \begin_inset Flex Code
17536 \begin_layout Plain Layout
17546 \begin_layout Itemize
17547 counter values can be expressed using LaTeX-like macros
17548 \begin_inset Flex Code
17551 \begin_layout Plain Layout
17568 \begin_inset Flex Code
17571 \begin_layout Plain Layout
17583 \begin_layout Plain Layout
17593 Actually, the situation is a bit more complicated: any
17612 other than those described below will produce arabic numerals.
17613 It would not be surprising to see this change in the future.
17619 \begin_inset Flex Code
17622 \begin_layout Plain Layout
17628 : 1, 2, 3,\SpecialChar \ldots{}
17630 \begin_inset Flex Code
17633 \begin_layout Plain Layout
17639 for lower-case letters: a, b, c, \SpecialChar \ldots{}
17641 \begin_inset Flex Code
17644 \begin_layout Plain Layout
17650 for upper-case letters: A, B, C, \SpecialChar \ldots{}
17652 \begin_inset Flex Code
17655 \begin_layout Plain Layout
17661 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
17663 \begin_inset Flex Code
17666 \begin_layout Plain Layout
17672 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
17674 \begin_inset Flex Code
17677 \begin_layout Plain Layout
17683 for hebrew numerals.
17687 \begin_layout Standard
17688 If LabelString is not defined, a default value is constructed as follows:
17689 if the counter has a master counter
17690 \begin_inset Flex Code
17693 \begin_layout Plain Layout
17700 \begin_inset Flex Code
17703 \begin_layout Plain Layout
17710 \begin_inset Flex Code
17713 \begin_layout Plain Layout
17723 is used; otherwise the string
17724 \begin_inset Flex Code
17727 \begin_layout Plain Layout
17738 \begin_layout Description
17739 \begin_inset Flex Code
17742 \begin_layout Plain Layout
17743 LabelStringAppendix
17749 \begin_inset Flex Code
17752 \begin_layout Plain Layout
17759 \begin_inset Quotes erd
17763 \begin_inset Quotes erd
17767 \begin_inset Flex Code
17770 \begin_layout Plain Layout
17776 , but for use in the Appendix.
17779 \begin_layout Description
17780 \begin_inset Flex Code
17783 \begin_layout Plain Layout
17790 \begin_inset Flex Code
17793 \begin_layout Plain Layout
17800 \begin_inset Quotes erd
17804 \begin_inset Quotes erd
17807 ] A format for use with formatted references to this counter.
17808 For example, one might want to have references to section numbers appear
17810 \begin_inset Quotes eld
17814 \begin_inset Quotes erd
17818 The string should contain
17819 \begin_inset Quotes eld
17823 \begin_inset Quotes erd
17827 This will be replaced by the counter number itself.
17828 So, for sections, it would be: Section ##.
17831 \begin_layout Description
17832 \begin_inset Flex Code
17835 \begin_layout Plain Layout
17842 \begin_inset Flex Code
17845 \begin_layout Plain Layout
17852 \begin_inset Quotes erd
17856 \begin_inset Quotes erd
17859 ] If this is set to the name of another counter, the present counter will
17860 be reset every time the other one is increased.
17862 \begin_inset Flex Code
17865 \begin_layout Plain Layout
17872 \begin_inset Flex Code
17875 \begin_layout Plain Layout
17884 \begin_layout Subsection
17886 \begin_inset CommandInset label
17888 name "sub:Font-description"
17895 \begin_layout Standard
17896 A font description looks like this:
17899 \begin_layout LyX-Code
17909 \begin_layout LyX-Code
17913 \begin_layout LyX-Code
17917 \begin_layout Standard
17918 The following commands are available:
17921 \begin_layout Description
17922 \begin_inset Flex Code
17925 \begin_layout Plain Layout
17932 \begin_inset Flex Code
17935 \begin_layout Plain Layout
17944 \begin_inset Flex Code
17947 \begin_layout Plain Layout
17954 \begin_inset Flex Code
17957 \begin_layout Plain Layout
17964 \begin_inset Flex Code
17967 \begin_layout Plain Layout
17974 \begin_inset Flex Code
17977 \begin_layout Plain Layout
17984 \begin_inset Flex Code
17987 \begin_layout Plain Layout
17994 \begin_inset Flex Code
17997 \begin_layout Plain Layout
18004 \begin_inset Flex Code
18007 \begin_layout Plain Layout
18014 \begin_inset Flex Code
18017 \begin_layout Plain Layout
18026 \begin_layout Description
18027 \begin_inset Flex Code
18030 \begin_layout Plain Layout
18037 \begin_inset Flex Code
18040 \begin_layout Plain Layout
18049 \begin_inset Flex Code
18052 \begin_layout Plain Layout
18059 \begin_inset Flex Code
18062 \begin_layout Plain Layout
18071 \begin_layout Description
18072 \begin_inset Flex Code
18075 \begin_layout Plain Layout
18082 \begin_inset Flex Code
18085 \begin_layout Plain Layout
18091 ] Valid arguments are:
18092 \begin_inset Flex Code
18095 \begin_layout Plain Layout
18102 \begin_inset Flex Code
18105 \begin_layout Plain Layout
18112 \begin_inset Flex Code
18115 \begin_layout Plain Layout
18122 \begin_inset Flex Code
18125 \begin_layout Plain Layout
18132 \begin_inset Flex Code
18135 \begin_layout Plain Layout
18142 \begin_inset Flex Code
18145 \begin_layout Plain Layout
18152 \begin_inset Flex Code
18155 \begin_layout Plain Layout
18162 \begin_inset Flex Code
18165 \begin_layout Plain Layout
18172 \begin_inset Flex Code
18175 \begin_layout Plain Layout
18182 \begin_inset Flex Code
18185 \begin_layout Plain Layout
18192 \begin_inset Flex Code
18195 \begin_layout Plain Layout
18202 \begin_inset Flex Code
18205 \begin_layout Plain Layout
18212 Each of these turns on or off the corresponding attribute.
18214 \begin_inset Flex Code
18217 \begin_layout Plain Layout
18223 turns on emphasis, and
18224 \begin_inset Flex Code
18227 \begin_layout Plain Layout
18235 \begin_inset Newline newline
18238 If the latter seems puzzling, remember that the font settings for the present
18239 context are generally inherited from the surrounding context.
18241 \begin_inset Flex Code
18244 \begin_layout Plain Layout
18250 would turn off the emphasis that was anyway in effect, say, in a theorem
18254 \begin_layout Description
18255 \begin_inset Flex Code
18258 \begin_layout Plain Layout
18265 \begin_inset Flex Code
18268 \begin_layout Plain Layout
18277 \begin_inset Flex Code
18280 \begin_layout Plain Layout
18289 \begin_layout Description
18290 \begin_inset Flex Code
18293 \begin_layout Plain Layout
18300 \begin_inset Flex Code
18303 \begin_layout Plain Layout
18312 \begin_inset Flex Code
18315 \begin_layout Plain Layout
18322 \begin_inset Flex Code
18325 \begin_layout Plain Layout
18332 \begin_inset Flex Code
18335 \begin_layout Plain Layout
18344 \begin_layout Description
18345 \begin_inset Flex Code
18348 \begin_layout Plain Layout
18355 \begin_inset Flex Code
18358 \begin_layout Plain Layout
18365 \begin_inset Flex Code
18368 \begin_layout Plain Layout
18375 \begin_inset Flex Code
18378 \begin_layout Plain Layout
18387 \begin_inset Flex Code
18390 \begin_layout Plain Layout
18397 \begin_inset Flex Code
18400 \begin_layout Plain Layout
18407 \begin_inset Flex Code
18410 \begin_layout Plain Layout
18417 \begin_inset Flex Code
18420 \begin_layout Plain Layout
18427 \begin_inset Flex Code
18430 \begin_layout Plain Layout
18439 \begin_layout Subsection
18440 \begin_inset CommandInset label
18442 name "sub:Citation-format-description"
18446 Citation format description
18449 \begin_layout Standard
18451 \begin_inset Flex Code
18454 \begin_layout Plain Layout
18460 blocks are used to describe how bibliographic information should be displayed,
18461 both within LyX itself (in the citation dialog and in tooltips, for example)
18462 and in XHTML output.
18463 Such a block might look like this:
18466 \begin_layout LyX-Code
18470 \begin_layout LyX-Code
18474 \begin_layout LyX-Code
18478 \begin_layout LyX-Code
18482 \begin_layout Standard
18483 The individual lines define how the bibliographic information associated
18484 with an article or book, respectively, is to be displayed, and such a definitio
18485 n can be given for any `entry type' that might be present in a BibTeX file.
18486 LyX defines a default format in the source code that will be used if no
18487 specific definition has been given.
18488 LyX predefines several formats in the file
18489 \begin_inset Flex Code
18492 \begin_layout Plain Layout
18498 , which is included in most of LyX's document classes.
18501 \begin_layout Standard
18502 The definitions use a simple language that allows BibTeX keys to be replaced
18504 Keys should be enclosed in
18505 \begin_inset Flex Code
18508 \begin_layout Plain Layout
18515 \begin_inset Flex Code
18518 \begin_layout Plain Layout
18525 So a simple definition might look like this:
18528 \begin_layout LyX-Code
18530 \begin_inset Quotes eld
18534 \begin_inset Quotes erd
18540 \begin_layout Standard
18541 This would print the author, followed by a comma, followed by the title,
18542 in quotes, followed by a period.
18545 \begin_layout Standard
18546 Of course, sometimes you may want to print a key only if it exists.
18547 This can be done by using a conditional construction, such as:
18548 \begin_inset Flex Code
18551 \begin_layout Plain Layout
18553 \begin_inset space ~
18563 \begin_inset Flex Code
18566 \begin_layout Plain Layout
18572 key exists, then print
18573 \begin_inset Quotes eld
18577 \begin_inset space ~
18581 \begin_inset Quotes erd
18584 followed by the volume key.
18585 It is also possible to have an else clause in the conditional, such as:
18587 \begin_inset Flex Code
18590 \begin_layout Plain Layout
18591 {%author%[[%author%]][[%editor%, ed.]]}
18598 \begin_inset Flex Code
18601 \begin_layout Plain Layout
18607 key is printed if it exists; otherwise, the editor key is printed, followed
18609 \begin_inset Quotes eld
18613 \begin_inset space ~
18617 \begin_inset Quotes erd
18620 Note that the key is again enclosed in
18621 \begin_inset Flex Code
18624 \begin_layout Plain Layout
18630 signs; the entire conditional is enclosed in braces; and the if and else
18631 clauses are enclosed in double brackets,
18632 \begin_inset Quotes eld
18636 \begin_inset Flex Code
18639 \begin_layout Plain Layout
18646 \begin_inset Quotes eld
18650 \begin_inset Quotes eld
18654 \begin_inset Flex Code
18657 \begin_layout Plain Layout
18664 \begin_inset Quotes erd
18668 There must be no space between any of these.
18671 \begin_layout Standard
18672 There is one other piece of syntax available in definitions, which looks
18674 \begin_inset Flex Code
18677 \begin_layout Plain Layout
18684 This defines a piece of formatting information that is to be used when
18686 \begin_inset Quotes eld
18690 \begin_inset Quotes erd
18694 Obviously, we do not want to output HTML tags when writing plain text,
18695 so they should be wrapped in
18696 \begin_inset Quotes eld
18700 \begin_inset Quotes erd
18704 \begin_inset Quotes eld
18708 \begin_inset Quotes erd
18714 \begin_layout Standard
18715 Two special sorts of definitions are also possible in a
18716 \begin_inset Flex Code
18719 \begin_layout Plain Layout
18726 An example of the first would be:
18729 \begin_layout LyX-Code
18731 \begin_inset Quotes eld
18735 \begin_inset Quotes erd
18741 \begin_layout Standard
18742 This is an abbreviation, or macro, and it can be used by treating it as
18744 \begin_inset Flex Code
18747 \begin_layout Plain Layout
18755 \begin_inset Flex Code
18758 \begin_layout Plain Layout
18764 exactly as it would treat its definition.
18765 So, let us issue the obvious
18773 \begin_layout LyX-Code
18777 \begin_layout Standard
18778 or anything like it.
18779 LyX shouldn't go into an infinite loop, but it may go into a long one before
18783 \begin_layout Standard
18784 The second sort of special definition might look like this:
18787 \begin_layout LyX-Code
18791 \begin_layout Standard
18792 This defines a translatable piece of text, which allows relevant parts of
18793 the bibliography to be translated.
18794 It can be included in a definition by treating it as a key:
18795 \begin_inset Flex Code
18798 \begin_layout Plain Layout
18805 Several of these are predefined in
18806 \begin_inset Flex Code
18809 \begin_layout Plain Layout
18816 Note that these are not macros, in the sense just defined.
18817 They will not be expanded.
18820 \begin_layout Standard
18821 So here then is an example that use all these features:
18824 \begin_layout LyX-Code
18825 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
18828 \begin_layout Standard
18829 This defines a macro that prints the author, followed by a comma, if the
18831 \begin_inset Flex Code
18834 \begin_layout Plain Layout
18840 key is defined, or else prints the name of the editor, followed by the
18842 \begin_inset Flex Code
18845 \begin_layout Plain Layout
18851 or its translation (it is by default
18852 \begin_inset Quotes eld
18856 \begin_inset Quotes erd
18860 \begin_inset Flex Code
18863 \begin_layout Plain Layout
18870 Note that this is in fact defined in
18871 \begin_inset Flex Code
18874 \begin_layout Plain Layout
18880 , so you can use it in your own definitions, or re-definitions, if you load
18884 \begin_layout Section
18885 \begin_inset CommandInset label
18887 name "sec:Tags-for-XHTML"
18891 Tags for XHTML output
18894 \begin_layout Standard
18895 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
18896 by layout information.
18897 In general, LyX provides sensible defaults and, as mentioned earlier, it
18898 will even construct default CSS style rules from the other layout tags.
18899 For example, LyX will attempt to use the information provided in the
18900 \begin_inset Flex Code
18903 \begin_layout Plain Layout
18909 declaration for the Chapter style to write CSS that will appropriately
18910 format chapter headings.
18913 \begin_layout Standard
18914 In many cases, then, you may not have to do anything at all to get acceptable
18915 XHTML output for your own environments, custom insets, and so forth.
18916 But in some cases you will, and so LyX provides a number of layout tags
18917 that can be used to customize the XHTML and CSS that are generated.
18920 \begin_layout Standard
18921 Note that there are two tags,
18922 \begin_inset Flex Code
18925 \begin_layout Plain Layout
18932 \begin_inset Flex Code
18935 \begin_layout Plain Layout
18941 that may appear outside style and inset declarations.
18943 \begin_inset CommandInset ref
18945 reference "sub:General-text-class"
18949 for details on these.
18952 \begin_layout Subsection
18953 \begin_inset CommandInset label
18955 name "sub:Paragraph-Style-XHTML"
18962 \begin_layout Standard
18963 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
18964 dealing with a normal paragraph, a command, or an environment, where this
18965 is itself determined by the contents of the corresponding
18966 \begin_inset Flex Code
18969 \begin_layout Plain Layout
18979 \begin_layout Standard
18980 For a command or normal paragraph, the output XHTML has the following form:
18983 \begin_layout LyX-Code
18985 \begin_inset Quotes erd
18989 \begin_inset Quotes erd
18995 \begin_layout LyX-Code
18997 \begin_inset Quotes erd
19001 \begin_inset Quotes erd
19007 \begin_layout LyX-Code
19008 Contents of the paragraph.
19011 \begin_layout LyX-Code
19015 \begin_layout Standard
19016 The label tags are of course omitted if the paragraph does not have a label.
19019 \begin_layout Standard
19020 For an environment that is not some sort of list, the XHTML takes this form:
19023 \begin_layout LyX-Code
19025 \begin_inset Quotes erd
19029 \begin_inset Quotes erd
19035 \begin_layout LyX-Code
19037 \begin_inset Quotes erd
19041 \begin_inset Quotes erd
19045 \begin_inset Quotes erd
19049 \begin_inset Quotes erd
19052 >Environment Label</labeltag>First paragraph.</itemtag>
19055 \begin_layout LyX-Code
19056 <itemtag>Second paragraph.</itemtag>
19059 \begin_layout LyX-Code
19063 \begin_layout Standard
19064 Note that the label is output only for the first paragraph, as it should
19065 be for a theorem, for example.
19069 \begin_layout Standard
19070 For a list, we have one of these forms:
19073 \begin_layout LyX-Code
19075 \begin_inset Quotes erd
19079 \begin_inset Quotes erd
19085 \begin_layout LyX-Code
19087 \begin_inset Quotes erd
19091 \begin_inset Quotes erd
19095 \begin_inset Quotes erd
19099 \begin_inset Quotes erd
19102 >List Label</labeltag>First item.</itemtag>
19105 \begin_layout LyX-Code
19107 \begin_inset Quotes erd
19111 \begin_inset Quotes erd
19115 \begin_inset Quotes erd
19119 \begin_inset Quotes erd
19122 >List Label</labeltag>Second item.</itemtag>
19125 \begin_layout LyX-Code
19129 \begin_layout LyX-Code
19133 \begin_layout LyX-Code
19135 \begin_inset Quotes erd
19139 \begin_inset Quotes erd
19145 \begin_layout LyX-Code
19147 \begin_inset Quotes erd
19151 \begin_inset Quotes erd
19154 >List Label</labeltag><itemtag attr=
19155 \begin_inset Quotes erd
19159 \begin_inset Quotes erd
19162 >First item.</itemtag>
19165 \begin_layout LyX-Code
19167 \begin_inset Quotes erd
19171 \begin_inset Quotes erd
19174 >List Label</labeltag><itemtag attr=
19175 \begin_inset Quotes erd
19179 \begin_inset Quotes erd
19182 >Second item.</itemtag>
19185 \begin_layout LyX-Code
19189 \begin_layout Standard
19190 Note the different orders of
19191 \begin_inset Flex Code
19194 \begin_layout Plain Layout
19201 \begin_inset Flex Code
19204 \begin_layout Plain Layout
19211 Which order we get depends upon the setting of
19212 \begin_inset Flex Code
19215 \begin_layout Plain Layout
19222 \begin_inset Flex Code
19225 \begin_layout Plain Layout
19231 is false (the default), you get the first of these, with the label within
19232 the item; if true, you get the second, with the label outside the item.
19235 \begin_layout Standard
19236 The specific tags and attributes output for each paragraph type can be controlle
19237 d by means of the layout tags we are about to describe.
19238 As mentioned earlier, however, LyX uses sensible defaults for many of these,
19239 so you often may not need to do very much to get good XHTML output.
19240 Think of the available tags as there so you can tweak things to your liking.
19243 \begin_layout Description
19244 \begin_inset Flex Code
19247 \begin_layout Plain Layout
19254 \begin_inset Flex Code
19257 \begin_layout Plain Layout
19263 ] Specifies attribute information to be output with the main tag.
19265 \begin_inset Quotes eld
19269 \begin_inset Flex Code
19272 \begin_layout Plain Layout
19279 \begin_inset Quotes erd
19283 By default, LyX will output
19284 \begin_inset Quotes eld
19288 \begin_inset Flex Code
19291 \begin_layout Plain Layout
19298 \begin_inset Quotes erd
19302 \begin_inset Flex Code
19305 \begin_layout Plain Layout
19311 is the LyX name of the layout, made lowercase, for example: chapter.
19316 contain any style information.
19318 \begin_inset Flex Code
19321 \begin_layout Plain Layout
19330 \begin_layout Description
19331 \begin_inset Flex Code
19334 \begin_layout Plain Layout
19341 \begin_inset Flex Code
19344 \begin_layout Plain Layout
19354 ] Whether to output the default CSS information LyX generates for this layout,
19355 even if additional information is explicitly provided via
19356 \begin_inset Flex Code
19359 \begin_layout Plain Layout
19367 \begin_inset Flex Code
19370 \begin_layout Plain Layout
19376 allows you to alter or augment the generated CSS, rather than to override
19379 \begin_inset Flex Code
19382 \begin_layout Plain Layout
19391 \begin_layout Description
19392 \begin_inset Flex Code
19395 \begin_layout Plain Layout
19402 \begin_inset Flex Code
19405 \begin_layout Plain Layout
19411 ] The tag to be used for individual paragraphs of environments, replacing
19413 \begin_inset Flex Code
19416 \begin_layout Plain Layout
19422 in the examples above.
19424 \begin_inset Flex Code
19427 \begin_layout Plain Layout
19436 \begin_layout Description
19437 \begin_inset Flex Code
19440 \begin_layout Plain Layout
19447 \begin_inset Flex Code
19450 \begin_layout Plain Layout
19456 ] Attributes for the item tag.
19458 \begin_inset Quotes eld
19462 \begin_inset Flex Code
19465 \begin_layout Plain Layout
19466 class=`layoutname_item'
19472 \begin_inset Quotes erd
19480 contain any style information.
19482 \begin_inset Flex Code
19485 \begin_layout Plain Layout
19494 \begin_layout Description
19495 \begin_inset Flex Code
19498 \begin_layout Plain Layout
19505 \begin_inset Flex Code
19508 \begin_layout Plain Layout
19514 ] The tag to be used for paragraph and item labels, replacing
19515 \begin_inset Flex Code
19518 \begin_layout Plain Layout
19524 in the examples above.
19526 \begin_inset Flex Code
19529 \begin_layout Plain Layout
19536 \begin_inset Flex Code
19539 \begin_layout Plain Layout
19546 \begin_inset Flex Code
19549 \begin_layout Plain Layout
19556 \begin_inset Flex Code
19559 \begin_layout Plain Layout
19560 Centered_Top_Environment
19565 , in which case it defaults to
19566 \begin_inset Flex Code
19569 \begin_layout Plain Layout
19578 \begin_layout Description
19579 \begin_inset Flex Code
19582 \begin_layout Plain Layout
19589 \begin_inset Flex Code
19592 \begin_layout Plain Layout
19598 ] Attributes for the label tag.
19600 \begin_inset Quotes eld
19604 \begin_inset Flex Code
19607 \begin_layout Plain Layout
19608 class=`layoutname_label'
19614 \begin_inset Quotes erd
19622 contain any style information.
19624 \begin_inset Flex Code
19627 \begin_layout Plain Layout
19636 \begin_layout Description
19637 \begin_inset Flex Code
19640 \begin_layout Plain Layout
19647 \begin_inset Flex Code
19650 \begin_layout Plain Layout
19660 ] Meaningful only for list-like environments, this tag controls whether
19661 the label tag is output before or inside the item tag.
19662 This is used, for example, in the description environment, where we want
19664 \begin_inset Flex Code
19667 \begin_layout Plain Layout
19668 <dt>\SpecialChar \ldots{}
19669 </dt><dd>\SpecialChar \ldots{}
19677 \begin_inset Flex Code
19680 \begin_layout Plain Layout
19686 : The label tag is output inside the item tag.
19689 \begin_layout Description
19690 \begin_inset Flex Code
19693 \begin_layout Plain Layout
19699 Information to be output in the
19700 \begin_inset Flex Code
19703 \begin_layout Plain Layout
19709 section when this style is used.
19710 This might, for example, be used to include a
19711 \begin_inset Flex Code
19714 \begin_layout Plain Layout
19721 \begin_inset Flex Code
19724 \begin_layout Plain Layout
19733 \begin_layout Description
19734 \begin_inset Flex Code
19737 \begin_layout Plain Layout
19743 CSS style information to be included when this style is used.
19744 Note that this will automatically be wrapped in a layout-generated
19745 \begin_inset Flex Code
19748 \begin_layout Plain Layout
19754 block, so only the CSS itself need be included.
19757 \begin_layout Description
19758 \begin_inset Flex Code
19761 \begin_layout Plain Layout
19768 \begin_inset Flex Code
19771 \begin_layout Plain Layout
19777 ] The tag to be used for the main label, replacing
19778 \begin_inset Flex Code
19781 \begin_layout Plain Layout
19787 in the examples above.
19789 \begin_inset Flex Code
19792 \begin_layout Plain Layout
19801 \begin_layout Description
19802 \begin_inset Flex Code
19805 \begin_layout Plain Layout
19812 \begin_inset Flex Code
19815 \begin_layout Plain Layout
19825 ] Marks this style as the one to be used to generate the
19826 \begin_inset Flex Code
19829 \begin_layout Plain Layout
19835 tag for the XHTML file.
19836 By default, it is false.
19838 \begin_inset Flex Code
19841 \begin_layout Plain Layout
19847 file sets it to true for the
19848 \begin_inset Flex Code
19851 \begin_layout Plain Layout
19861 \begin_layout Subsection
19865 \begin_layout Standard
19866 The XHTML output of insets can also be controlled by information in layout
19871 \begin_layout Plain Layout
19872 At present, this is true only for
19873 \begin_inset Quotes eld
19877 \begin_inset Quotes erd
19880 insets (insets you can type into) and is not true for
19881 \begin_inset Quotes eld
19885 \begin_inset Quotes erd
19888 insets (insets that are associated with dialog boxes).
19893 Here, too, LyX tries to provide sensible defaults, and it constructs default
19895 But everything can be customized.
19898 \begin_layout Standard
19899 The XHTML LyX outputs for an inset has the following form:
19902 \begin_layout LyX-Code
19904 \begin_inset Quotes erd
19908 \begin_inset Quotes erd
19914 \begin_layout LyX-Code
19915 <labeltag>Label</labeltag>
19918 \begin_layout LyX-Code
19920 \begin_inset Quotes erd
19924 \begin_inset Quotes erd
19927 >Contents of the inset.</innertag>
19930 \begin_layout LyX-Code
19934 \begin_layout Standard
19935 If the inset permits multiple paragraphs---that is, if
19936 \begin_inset Flex Code
19939 \begin_layout Plain Layout
19945 is true---then the contents of the inset will itself be output as paragraphs
19946 formatted according to the styles used for those paragraphs (standard,
19947 quote, and the like).
19948 The label tag is of course omitted if the paragraph does not have a label
19949 and, at present, is always
19950 \begin_inset Flex Code
19953 \begin_layout Plain Layout
19960 The inner tag is optional and, by default, does not appear.
19963 \begin_layout Standard
19964 The specific tags and attributes output for each inset can be controlled
19965 by means of the following layout tags.
19968 \begin_layout Description
19969 \begin_inset Flex Code
19972 \begin_layout Plain Layout
19979 \begin_inset Flex Code
19982 \begin_layout Plain Layout
19988 ] Specifies attribute information to be output with the main tag.
19990 \begin_inset Quotes eld
19994 \begin_inset Flex Code
19997 \begin_layout Plain Layout
19998 class=`myinset' onclick=`\SpecialChar \ldots{}
20005 \begin_inset Quotes erd
20009 By default, LyX will output
20010 \begin_inset Quotes eld
20014 \begin_inset Flex Code
20017 \begin_layout Plain Layout
20024 \begin_inset Quotes erd
20028 \begin_inset Flex Code
20031 \begin_layout Plain Layout
20037 is the LyX name of the inset, made lowercase and with non-alphanumeric
20038 characters converted to underscores, for example: footnote.
20041 \begin_layout Description
20042 \begin_inset Flex Code
20045 \begin_layout Plain Layout
20052 \begin_inset Flex Code
20055 \begin_layout Plain Layout
20065 ] Whether to output the default CSS information LyX generates for this layout,
20066 even if additional information is explicitly provided via
20067 \begin_inset Flex Code
20070 \begin_layout Plain Layout
20078 \begin_inset Flex Code
20081 \begin_layout Plain Layout
20087 allows you to alter or augment the generated CSS, rather than to override
20092 \begin_layout Description
20093 \begin_inset Flex Code
20096 \begin_layout Plain Layout
20103 \begin_inset Flex Code
20106 \begin_layout Plain Layout
20112 ] Attributes for the inner tag.
20114 \begin_inset Quotes eld
20118 \begin_inset Flex Code
20121 \begin_layout Plain Layout
20122 class=`insetname_inner'
20128 \begin_inset Quotes erd
20134 \begin_layout Description
20135 \begin_inset Flex Code
20138 \begin_layout Plain Layout
20145 \begin_inset Flex Code
20148 \begin_layout Plain Layout
20154 ] The inner tag, replacing
20155 \begin_inset Flex Code
20158 \begin_layout Plain Layout
20164 in the examples above.
20165 By default, there is none.
20168 \begin_layout Description
20169 \begin_inset Flex Code
20172 \begin_layout Plain Layout
20179 \begin_inset Flex Code
20182 \begin_layout Plain Layout
20190 ] Whether this inset represents a standalone block of text (such as a footnote)
20191 or instead represents material that is included in the surrounding text
20192 (such as a branch).
20196 \begin_layout Description
20197 \begin_inset Flex Code
20200 \begin_layout Plain Layout
20207 \begin_inset Flex Code
20210 \begin_layout Plain Layout
20216 ] A label for this inset, possibly including a reference to a counter.
20217 For example, for footnote, it might be:
20218 \begin_inset Flex Code
20221 \begin_layout Plain Layout
20230 This is optional, and there is no default.
20233 \begin_layout Description
20234 \begin_inset Flex Code
20237 \begin_layout Plain Layout
20243 Information to be output in the
20244 \begin_inset Flex Code
20247 \begin_layout Plain Layout
20253 section when this style is used.
20254 This might, for example, be used to include a
20255 \begin_inset Flex Code
20258 \begin_layout Plain Layout
20265 \begin_inset Flex Code
20268 \begin_layout Plain Layout
20277 \begin_layout Description
20278 \begin_inset Flex Code
20281 \begin_layout Plain Layout
20287 CSS style information to be included when this style is used.
20288 Note that this will automatically be wrapped in a layout-generated
20289 \begin_inset Flex Code
20292 \begin_layout Plain Layout
20298 block, so only the CSS itself need be included.
20301 \begin_layout Description
20302 \begin_inset Flex Code
20305 \begin_layout Plain Layout
20312 \begin_inset Flex Code
20315 \begin_layout Plain Layout
20321 ] The tag to be used for the main label, replacing
20322 \begin_inset Flex Code
20325 \begin_layout Plain Layout
20331 in the examples above.
20332 The default depends upon the setting of
20333 \begin_inset Flex Code
20336 \begin_layout Plain Layout
20343 \begin_inset Flex Code
20346 \begin_layout Plain Layout
20352 is true, the default is
20353 \begin_inset Flex Code
20356 \begin_layout Plain Layout
20362 ; if it is false, the default is
20363 \begin_inset Flex Code
20366 \begin_layout Plain Layout
20375 \begin_layout Subsection
20379 \begin_layout Standard
20380 The XHTML output for floats too can be controlled by layout information.
20381 The output has the following form:
20384 \begin_layout LyX-Code
20386 \begin_inset Quotes erd
20390 \begin_inset Quotes erd
20396 \begin_layout LyX-Code
20397 Contents of the float.
20400 \begin_layout LyX-Code
20404 \begin_layout Standard
20405 The caption, if there is one, is a separate inset and will be output as
20407 Its appearance can be controlled via the InsetLayout for caption insets.
20411 \begin_layout Description
20412 \begin_inset Flex Code
20415 \begin_layout Plain Layout
20422 \begin_inset Flex Code
20425 \begin_layout Plain Layout
20431 ] Specifies attribute information to be output with the main tag.
20433 \begin_inset Quotes eld
20437 \begin_inset Flex Code
20440 \begin_layout Plain Layout
20441 class=`myfloat' onclick=`\SpecialChar \ldots{}
20448 \begin_inset Quotes erd
20452 By default, LyX will output
20453 \begin_inset Quotes eld
20457 \begin_inset Flex Code
20460 \begin_layout Plain Layout
20461 class=`float float-floattype'
20467 \begin_inset Quotes erd
20471 \begin_inset Flex Code
20474 \begin_layout Plain Layout
20480 is LyX's name for this type of float, as determined by the float declaration
20482 \begin_inset CommandInset ref
20484 reference "sub:Floats"
20488 ), though made lowercase and with non-alphanumeric characters converted
20489 to underscores, for example: float-table.
20492 \begin_layout Description
20493 \begin_inset Flex Code
20496 \begin_layout Plain Layout
20502 CSS style information to be included when this float is used.
20503 Note that this will automatically be wrapped in a layout-generated
20504 \begin_inset Flex Code
20507 \begin_layout Plain Layout
20513 block, so only the CSS itself need be included.
20516 \begin_layout Description
20517 \begin_inset Flex Code
20520 \begin_layout Plain Layout
20527 \begin_inset Flex Code
20530 \begin_layout Plain Layout
20536 ] The tag to be used for this float, replacing
20537 \begin_inset Quotes eld
20541 \begin_inset Flex Code
20544 \begin_layout Plain Layout
20551 \begin_inset Quotes erd
20554 in the example above.
20556 \begin_inset Flex Code
20559 \begin_layout Plain Layout
20565 and will rarely need changing.
20568 \begin_layout Subsection
20569 Bibliography formatting
20572 \begin_layout Standard
20573 The bibliography can be formatted using
20574 \begin_inset Flex Code
20577 \begin_layout Plain Layout
20585 \begin_inset CommandInset ref
20587 reference "sub:Citation-format-description"
20594 \begin_layout Subsection
20598 \begin_layout Standard
20599 We have several times mentioned that LyX will generate default CSS style
20600 rules for both insets and paragraph styles, based upon the other layout
20601 information that is provided.
20602 In this section, we shall say a word about which layout information LyX
20606 \begin_layout Standard
20607 At present, LyX auto-generates CSS only for font information, making use
20609 \begin_inset Flex Code
20612 \begin_layout Plain Layout
20619 \begin_inset Flex Code
20622 \begin_layout Plain Layout
20629 \begin_inset Flex Code
20632 \begin_layout Plain Layout
20639 \begin_inset Flex Code
20642 \begin_layout Plain Layout
20649 \begin_inset Flex Code
20652 \begin_layout Plain Layout
20660 \begin_inset CommandInset ref
20662 reference "sub:Font-description"
20666 .) The translation is mostly straightforward and obvious.
20668 \begin_inset Quotes eld
20672 \begin_inset Flex Code
20675 \begin_layout Plain Layout
20682 \begin_inset Quotes erd
20686 \begin_inset Quotes eld
20690 \begin_inset Flex Code
20693 \begin_layout Plain Layout
20694 font-family: sans-serif;
20700 \begin_inset Quotes erd
20704 The correspondence of LyX sizes and CSS sizes is a little less obvious
20705 but nonetheless intuitive.
20707 \begin_inset Flex Code
20710 \begin_layout Plain Layout
20717 \begin_inset Flex URL
20720 \begin_layout Plain Layout
20730 \begin_layout Chapter
20731 Including External Material
20734 \begin_layout Standard
20735 \begin_inset Box Shadowbox
20745 height_special "totalheight"
20748 \begin_layout Plain Layout
20749 WARNING: This portion of the documentation has not been updated for some
20751 We certainly hope that it is still accurate, but there are no guarantees.
20759 \begin_layout Standard
20760 The use of material from sources external to LyX is covered in detail in
20766 This part of the manual covers what needs to happen behind the scenes for
20767 new sorts of material to be included.
20770 \begin_layout Section
20774 \begin_layout Standard
20775 The external material feature is based on the concept of a
20780 A template is a specification of how LyX should interface with a certain
20782 As bundled, LyX comes with predefined templates for Xfig figures, various
20783 raster format images, chess diagrams, and LilyPond music notation.
20784 You can check the actual list by using the menu
20785 \begin_inset Flex MenuItem
20788 \begin_layout Plain Layout
20789 Insert\SpecialChar \menuseparator
20790 File\SpecialChar \menuseparator
20797 Furthermore, it is possible to roll your own template to support a specific
20799 Later we'll describe in more detail what is involved, and hopefully you
20800 will submit all the templates you create so we can include them in a later
20804 \begin_layout Standard
20805 Another basic idea of the external material feature is to distinguish between
20806 the original file that serves as a base for final material and the produced
20807 file that is included in your exported or printed document.
20808 For example, consider the case of a figure produced with
20809 \begin_inset Flex Code
20812 \begin_layout Plain Layout
20819 The Xfig application itself works on an original file with the
20820 \begin_inset Flex Code
20823 \begin_layout Plain Layout
20830 Within Xfig, you create and change your figure, and when you are done,
20832 \begin_inset Flex Code
20835 \begin_layout Plain Layout
20842 When you want to include the figure in your document, you invoke
20843 \begin_inset Flex Code
20846 \begin_layout Plain Layout
20852 in order to create a PostScript file that can readily be included in your
20855 \begin_inset Flex Code
20858 \begin_layout Plain Layout
20864 file is the original file, and the PostScript file is the produced file.
20867 \begin_layout Standard
20868 This distinction is important in order to allow updating of the material
20869 while you are in the process of writing the document.
20870 Furthermore, it provides us with the flexibility that is needed to support
20871 multiple export formats.
20872 For instance, in the case of a plain text file, it is not exactly an award-winn
20873 ing idea to include the figure as raw PostScript.
20874 Instead, you would either prefer to just include a reference to the figure
20875 or try to invoke some graphics to ASCII converter to make the final result
20876 look similar to the real graphics.
20877 The external material management allows you to do this, because it is parametri
20878 zed on the different export formats that LyX supports.
20881 \begin_layout Standard
20882 Besides supporting the production of different products according to the
20883 exported format, it supports tight integration with editing and viewing
20885 In the case of an Xfig figure, you are able to invoke Xfig on the original
20886 file with a single click from within the external material dialog in LyX,
20887 and also preview the produced PostScript file with Ghostview with another
20889 No more fiddling around with the command line and/or file browsers to locate
20890 and manipulate the original or produced files.
20891 In this way, you are finally able to take full advantage of the many different
20892 applications that are relevant to use when you write your documents, and
20893 ultimately be more productive.
20896 \begin_layout Section
20897 The external template configuration file
20900 \begin_layout Standard
20901 It is relatively easy to add custom external template definitions to LyX.
20902 However, be aware that doing this in an careless manner most probably
20906 introduce an easily exploitable security hole.
20907 So before you do this, please read the discussion about security in section
20909 \begin_inset CommandInset ref
20911 reference "sec:Security-discussion"
20918 \begin_layout Standard
20919 Having said that, we encourage you to submit any interesting templates that
20924 \begin_layout Standard
20925 The external templates are defined in the
20926 \begin_inset Flex Code
20929 \begin_layout Plain Layout
20930 LyXDir/lib/external_templates
20936 You can place your own version in
20937 \begin_inset Flex Code
20940 \begin_layout Plain Layout
20941 UserDir/external_templates
20949 \begin_layout Standard
20950 A typical template looks like this:
20953 \begin_layout LyX-Code
20957 \begin_layout LyX-Code
20958 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
20961 \begin_layout LyX-Code
20965 \begin_layout LyX-Code
20969 \begin_layout LyX-Code
20973 \begin_layout LyX-Code
20977 \begin_layout LyX-Code
20981 \begin_layout LyX-Code
20982 AutomaticProduction true
20985 \begin_layout LyX-Code
20989 \begin_layout LyX-Code
20993 \begin_layout LyX-Code
20997 \begin_layout LyX-Code
20998 TransformCommand Rotate RotationLatexCommand
21001 \begin_layout LyX-Code
21002 TransformCommand Resize ResizeLatexCommand
21005 \begin_layout LyX-Code
21006 Product "$$RotateFront$$ResizeFront
21009 \begin_layout LyX-Code
21014 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
21017 \begin_layout LyX-Code
21018 $$ResizeBack$$RotateBack"
21021 \begin_layout LyX-Code
21025 \begin_layout LyX-Code
21026 UpdateResult "$$AbsPath$$Basename.pstex_t"
21029 \begin_layout LyX-Code
21030 Requirement "graphicx"
21033 \begin_layout LyX-Code
21034 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
21037 \begin_layout LyX-Code
21038 ReferencedFile latex "$$AbsPath$$Basename.eps"
21041 \begin_layout LyX-Code
21042 ReferencedFile dvi "$$AbsPath$$Basename.eps"
21045 \begin_layout LyX-Code
21049 \begin_layout LyX-Code
21053 \begin_layout LyX-Code
21054 TransformCommand Rotate RotationLatexCommand
21057 \begin_layout LyX-Code
21058 TransformCommand Resize ResizeLatexCommand
21061 \begin_layout LyX-Code
21062 Product "$$RotateFront$$ResizeFront
21065 \begin_layout LyX-Code
21070 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
21073 \begin_layout LyX-Code
21074 $$ResizeBack$$RotateBack"
21077 \begin_layout LyX-Code
21078 UpdateFormat pdftex
21081 \begin_layout LyX-Code
21082 UpdateResult "$$AbsPath$$Basename.pdftex_t"
21085 \begin_layout LyX-Code
21086 Requirement "graphicx"
21089 \begin_layout LyX-Code
21090 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
21093 \begin_layout LyX-Code
21094 ReferencedFile latex "$$AbsPath$$Basename.pdf"
21097 \begin_layout LyX-Code
21101 \begin_layout LyX-Code
21105 \begin_layout LyX-Code
21106 Product "$$Contents(
21108 "$$AbsPath$$Basename.asc
21113 \begin_layout LyX-Code
21114 UpdateFormat asciixfig
21117 \begin_layout LyX-Code
21118 UpdateResult "$$AbsPath$$Basename.asc"
21121 \begin_layout LyX-Code
21125 \begin_layout LyX-Code
21129 \begin_layout LyX-Code
21130 Product "<graphic fileref=
21132 "$$AbsOrRelPathMaster$$Basename.eps
21137 \begin_layout LyX-Code
21141 \begin_layout LyX-Code
21145 \begin_layout LyX-Code
21146 UpdateResult "$$AbsPath$$Basename.eps"
21149 \begin_layout LyX-Code
21150 ReferencedFile docbook "$$AbsPath$$Basename.eps"
21153 \begin_layout LyX-Code
21154 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
21157 \begin_layout LyX-Code
21161 \begin_layout LyX-Code
21162 Product "[XFig: $$FName]"
21165 \begin_layout LyX-Code
21169 \begin_layout LyX-Code
21173 \begin_layout Standard
21174 As you can see, the template is enclosed in
21175 \begin_inset Flex Code
21178 \begin_layout Plain Layout
21184 \SpecialChar \ldots{}
21186 \begin_inset Flex Code
21189 \begin_layout Plain Layout
21196 It contains a header specifying some general settings and, for each supported
21197 primary document file format, a section
21198 \begin_inset Flex Code
21201 \begin_layout Plain Layout
21207 \SpecialChar \ldots{}
21209 \begin_inset Flex Code
21212 \begin_layout Plain Layout
21221 \begin_layout Subsection
21222 The template header
21225 \begin_layout Description
21226 \begin_inset Flex Code
21229 \begin_layout Plain Layout
21230 AutomaticProduction
21231 \begin_inset space ~
21239 Whether the file represented by the template must be generated by LyX.
21240 This command must occur exactly once.
21243 \begin_layout Description
21244 \begin_inset Flex Code
21247 \begin_layout Plain Layout
21249 \begin_inset space ~
21257 A glob pattern that is used in the file dialog to filter out the desired
21259 If there is more than one possible file extension (e.
21260 \begin_inset space \thinspace{}
21264 \begin_inset space \space{}
21268 \begin_inset Flex Code
21271 \begin_layout Plain Layout
21278 \begin_inset Flex Code
21281 \begin_layout Plain Layout
21287 ), use something like
21288 \begin_inset Flex Code
21291 \begin_layout Plain Layout
21298 This command must occur exactly once.
21301 \begin_layout Description
21302 \begin_inset Flex Code
21305 \begin_layout Plain Layout
21307 \begin_inset space ~
21315 The text that is displayed on the button.
21316 This command must occur exactly once.
21319 \begin_layout Description
21320 \begin_inset Flex Code
21323 \begin_layout Plain Layout
21325 \begin_inset space ~
21329 \begin_inset space ~
21337 The help text that is used in the External dialog.
21338 Provide enough information to explain to the user just what the template
21339 can provide him with.
21340 This command must occur exactly once.
21343 \begin_layout Description
21344 \begin_inset Flex Code
21347 \begin_layout Plain Layout
21349 \begin_inset space ~
21357 The file format of the original file.
21358 This must be the name of a format that is known to LyX (see section
21359 \begin_inset space ~
21363 \begin_inset CommandInset ref
21365 reference "sec:Formats"
21371 \begin_inset Quotes eld
21375 \begin_inset Flex Code
21378 \begin_layout Plain Layout
21385 \begin_inset Quotes erd
21388 if the template can handle original files of more than one format.
21389 LyX will attempt to interrogate the file itself in order to deduce its
21390 format in this case.
21391 This command must occur exactly once.
21394 \begin_layout Description
21395 \begin_inset Flex Code
21398 \begin_layout Plain Layout
21400 \begin_inset space ~
21408 A unique name for the template.
21409 It must not contain substitution macros (see below).
21412 \begin_layout Description
21413 \begin_inset Flex Code
21416 \begin_layout Plain Layout
21418 \begin_inset space ~
21421 Rotate|Resize|Clip|Extra
21426 This command specifies which transformations are supported by this template.
21427 It may occur zero or more times.
21428 This command enables the corresponding tabs in the external dialog.
21430 \begin_inset Flex Code
21433 \begin_layout Plain Layout
21439 command must have either a corresponding
21440 \begin_inset Flex Code
21443 \begin_layout Plain Layout
21450 \begin_inset Flex Code
21453 \begin_layout Plain Layout
21460 \begin_inset Flex Code
21463 \begin_layout Plain Layout
21470 Otherwise the transformation will not be supported by that format.
21473 \begin_layout Subsection
21477 \begin_layout Description
21478 \begin_inset Flex Code
21481 \begin_layout Plain Layout
21483 \begin_inset space ~
21486 LaTeX|PDFLaTeX|PlainText|DocBook
21491 The primary document file format that this format definition is for.
21492 Not every template has a sensible representation in all document file formats.
21493 Please define nevertheless a
21494 \begin_inset Flex Code
21497 \begin_layout Plain Layout
21503 section for all templates.
21504 Use a dummy text when no representation is available.
21505 Then you can at least see a reference to the external material in the exported
21509 \begin_layout Description
21510 \begin_inset Flex Code
21513 \begin_layout Plain Layout
21515 \begin_inset space ~
21519 \begin_inset space ~
21527 This command defines an additional macro
21528 \begin_inset Flex Code
21531 \begin_layout Plain Layout
21537 for substitution in
21538 \begin_inset Flex Code
21541 \begin_layout Plain Layout
21549 \begin_inset Flex Code
21552 \begin_layout Plain Layout
21558 itself may contain substitution macros.
21559 The advantage over using
21560 \begin_inset Flex Code
21563 \begin_layout Plain Layout
21570 \begin_inset Flex Code
21573 \begin_layout Plain Layout
21579 is that the substituted value of
21580 \begin_inset Flex Code
21583 \begin_layout Plain Layout
21589 is sanitized so that it is a valid optional argument in the document format.
21590 This command may occur zero or more times.
21593 \begin_layout Description
21594 \begin_inset Flex Code
21597 \begin_layout Plain Layout
21599 \begin_inset space ~
21607 The text that is inserted in the exported document.
21608 This is actually the most important command and can be quite complex.
21609 This command must occur exactly once.
21612 \begin_layout Description
21613 \begin_inset Flex Code
21616 \begin_layout Plain Layout
21618 \begin_inset space ~
21626 This command specifies a preamble snippet that will be included in the
21628 It has to be defined using
21629 \begin_inset Flex Code
21632 \begin_layout Plain Layout
21638 \SpecialChar \ldots{}
21640 \begin_inset Flex Code
21643 \begin_layout Plain Layout
21650 This command may occur zero or more times.
21653 \begin_layout Description
21654 \begin_inset Flex Code
21657 \begin_layout Plain Layout
21659 \begin_inset space ~
21663 \begin_inset space ~
21671 This command denotes files that are created by the conversion process and
21672 are needed for a particular export format.
21673 If the filename is relative, it is interpreted relative to the master document.
21674 This command may be given zero or more times.
21677 \begin_layout Description
21678 \begin_inset Flex Code
21681 \begin_layout Plain Layout
21683 \begin_inset space ~
21691 The name of a required LaTeX package.
21692 The package is included via
21693 \begin_inset Flex Code
21696 \begin_layout Plain Layout
21704 in the LaTeX preamble.
21705 This command may occur zero or more times.
21708 \begin_layout Description
21709 \begin_inset Flex Code
21712 \begin_layout Plain Layout
21714 \begin_inset space ~
21718 \begin_inset space ~
21721 RotationLatexCommand
21726 This command specifies that the built in LaTeX command should be used for
21728 This command may occur once or not at all.
21731 \begin_layout Description
21732 \begin_inset Flex Code
21735 \begin_layout Plain Layout
21737 \begin_inset space ~
21741 \begin_inset space ~
21749 This command specifies that the built in LaTeX command should be used for
21751 This command may occur once or not at all.
21754 \begin_layout Description
21755 \begin_inset Flex Code
21758 \begin_layout Plain Layout
21760 \begin_inset space ~
21764 \begin_inset space ~
21767 RotationLatexOption
21772 This command specifies that rotation is done via an optional argument.
21773 This command may occur once or not at all.
21776 \begin_layout Description
21777 \begin_inset Flex Code
21780 \begin_layout Plain Layout
21782 \begin_inset space ~
21786 \begin_inset space ~
21794 This command specifies that resizing is done via an optional argument.
21795 This command may occur once or not at all.
21798 \begin_layout Description
21799 \begin_inset Flex Code
21802 \begin_layout Plain Layout
21804 \begin_inset space ~
21808 \begin_inset space ~
21816 This command specifies that clipping is done via an optional argument.
21817 This command may occur once or not at all.
21820 \begin_layout Description
21821 \begin_inset Flex Code
21824 \begin_layout Plain Layout
21826 \begin_inset space ~
21830 \begin_inset space ~
21838 This command specifies that an extra optional argument is used.
21839 This command may occur once or not at all.
21842 \begin_layout Description
21843 \begin_inset Flex Code
21846 \begin_layout Plain Layout
21848 \begin_inset space ~
21856 The file format of the converted file.
21857 This must be the name of a format that is known to LyX (see the
21858 \begin_inset Flex MenuItem
21861 \begin_layout Plain Layout
21866 ools\SpecialChar \menuseparator
21871 references\SpecialChar \menuseparator
21872 File Handling\SpecialChar \menuseparator
21879 This command must occur exactly once.
21882 \begin_layout Description
21883 \begin_inset Flex Code
21886 \begin_layout Plain Layout
21888 \begin_inset space ~
21896 The file name of the converted file.
21897 The file name must be absolute.
21898 This command must occur exactly once.
21901 \begin_layout Subsection
21902 Preamble definitions
21905 \begin_layout Standard
21906 The external template configuration file may contain additional preamble
21907 definitions enclosed by
21908 \begin_inset Flex Code
21911 \begin_layout Plain Layout
21917 \SpecialChar \ldots{}
21919 \begin_inset Flex Code
21922 \begin_layout Plain Layout
21929 They can be used by the templates in the
21930 \begin_inset Flex Code
21933 \begin_layout Plain Layout
21942 \begin_layout Section
21943 The substitution mechanism
21946 \begin_layout Standard
21947 When the external material facility invokes an external program, it is done
21948 on the basis of a command defined in the template configuration file.
21949 These commands can contain various macros that are expanded before execution.
21950 Execution always take place in the directory of the containing document.
21953 \begin_layout Standard
21954 Also, whenever external material is to be displayed, the name will be produced
21955 by the substitution mechanism, and most other commands in the template
21956 definition support substitution as well.
21959 \begin_layout Standard
21960 The available macros are the following:
21963 \begin_layout Description
21964 \begin_inset Flex Code
21967 \begin_layout Plain Layout
21968 $$AbsOrRelPathMaster
21973 The file path, absolute or relative to the master LyX document.
21976 \begin_layout Description
21977 \begin_inset Flex Code
21980 \begin_layout Plain Layout
21981 $$AbsOrRelPathParent
21986 The file path, absolute or relative to the LyX document.
21989 \begin_layout Description
21990 \begin_inset Flex Code
21993 \begin_layout Plain Layout
21999 The absolute file path.
22002 \begin_layout Description
22003 \begin_inset Flex Code
22006 \begin_layout Plain Layout
22012 The filename without path and without the extension.
22015 \begin_layout Description
22016 \begin_inset Flex Code
22019 \begin_layout Plain Layout
22021 \begin_inset Quotes eld
22025 \begin_inset Quotes erd
22033 This macro will expand to the contents of the file with the name
22034 \begin_inset Flex Code
22037 \begin_layout Plain Layout
22046 \begin_layout Description
22047 \begin_inset Flex Code
22050 \begin_layout Plain Layout
22056 The file extension (including the dot).
22059 \begin_layout Description
22060 \begin_inset Flex Code
22063 \begin_layout Plain Layout
22069 The filename of the file specified in the external material dialog.
22070 This is either an absolute name, or it is relative to the LyX document.
22073 \begin_layout Description
22074 \begin_inset Flex Code
22077 \begin_layout Plain Layout
22084 \begin_inset Flex Code
22087 \begin_layout Plain Layout
22093 (absolute name or relative to the LyX document).
22096 \begin_layout Description
22097 \begin_inset Flex Code
22100 \begin_layout Plain Layout
22106 The file path, relative to the master LyX document.
22109 \begin_layout Description
22110 \begin_inset Flex Code
22113 \begin_layout Plain Layout
22119 The file path, relative to the LyX document.
22122 \begin_layout Description
22123 \begin_inset Flex Code
22126 \begin_layout Plain Layout
22132 This macro will expand to the absolute path of the system directory.
22133 This is typically used to point to the various helper scripts that are
22137 \begin_layout Description
22138 \begin_inset Flex Code
22141 \begin_layout Plain Layout
22147 A name and full path to a temporary file which will be automatically deleted
22148 whenever the containing document is closed, or the external material insertion
22152 \begin_layout Standard
22153 All path macros contain a trailing directory separator, so you can construct
22155 \begin_inset space \thinspace{}
22159 \begin_inset space \space{}
22162 the absolute filename with
22163 \begin_inset Flex Code
22166 \begin_layout Plain Layout
22167 $$AbsPath$$Basename$$Extension
22175 \begin_layout Standard
22176 The macros above are substituted in all commands unless otherwise noted.
22178 \begin_inset Flex Code
22181 \begin_layout Plain Layout
22187 supports additionally the following substitutions if they are enabled by
22189 \begin_inset Flex Code
22192 \begin_layout Plain Layout
22199 \begin_inset Flex Code
22202 \begin_layout Plain Layout
22211 \begin_layout Description
22212 \begin_inset Flex Code
22215 \begin_layout Plain Layout
22221 The front part of the resize command.
22224 \begin_layout Description
22225 \begin_inset Flex Code
22228 \begin_layout Plain Layout
22234 The back part of the resize command.
22237 \begin_layout Description
22238 \begin_inset Flex Code
22241 \begin_layout Plain Layout
22247 The front part of the rotation command.
22250 \begin_layout Description
22251 \begin_inset Flex Code
22254 \begin_layout Plain Layout
22260 The back part of the rotation command.
22263 \begin_layout Standard
22264 The value string of the
22265 \begin_inset Flex Code
22268 \begin_layout Plain Layout
22274 command supports additionally the following substitutions if they are enabled
22276 \begin_inset Flex Code
22279 \begin_layout Plain Layout
22286 \begin_inset Flex Code
22289 \begin_layout Plain Layout
22298 \begin_layout Description
22299 \begin_inset Flex Code
22302 \begin_layout Plain Layout
22311 \begin_layout Description
22312 \begin_inset Flex Code
22315 \begin_layout Plain Layout
22324 \begin_layout Description
22325 \begin_inset Flex Code
22328 \begin_layout Plain Layout
22337 \begin_layout Description
22338 \begin_inset Flex Code
22341 \begin_layout Plain Layout
22347 The rotation option.
22350 \begin_layout Standard
22351 You may ask why there are so many path macros.
22352 There are mainly two reasons:
22355 \begin_layout Enumerate
22356 Relative and absolute file names should remain relative or absolute, respectivel
22358 Users may have reasons to prefer either form.
22359 Relative names are useful for portable documents that should work on different
22360 machines, for example.
22361 Absolute names may be required by some programs.
22364 \begin_layout Enumerate
22365 LaTeX treats relative file names differently than LyX and other programs
22366 in nested included files.
22367 For LyX, a relative file name is always relative to the document that contains
22369 For LaTeX, it is always relative to the master document.
22370 These two definitions are identical if you have only one document, but
22371 differ if you have a master document that includes part documents.
22372 That means that relative filenames must be transformed when presented to
22374 Fortunately LyX does this automatically for you if you choose the right
22378 \begin_layout Standard
22379 So which path macro should be used in new template definitions? The rule
22383 \begin_layout Itemize
22385 \begin_inset Flex Code
22388 \begin_layout Plain Layout
22394 if an absolute path is required.
22397 \begin_layout Itemize
22399 \begin_inset Flex Code
22402 \begin_layout Plain Layout
22403 $$AbsOrRelPathMaster
22408 if the substituted string is some kind of LaTeX input.
22411 \begin_layout Itemize
22413 \begin_inset Flex Code
22416 \begin_layout Plain Layout
22417 $$AbsOrRelPathParent
22422 in order to preserve the user's choice.
22425 \begin_layout Standard
22426 There are special cases where this rule does not work and e.
22427 \begin_inset space \thinspace{}
22431 \begin_inset space \space{}
22434 relative names are needed, but normally it will work just fine.
22435 One example for such a case is the command
22436 \begin_inset Flex Code
22439 \begin_layout Plain Layout
22440 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
22445 in the XFig template above: We can't use the absolute name because the
22447 \begin_inset Flex Code
22450 \begin_layout Plain Layout
22456 files needs the relative name in order to rewrite the file content.
22459 \begin_layout Section
22460 Security discussion
22461 \begin_inset CommandInset label
22463 name "sec:Security-discussion"
22470 \begin_layout Standard
22471 The external material feature interfaces with a lot of external programs
22472 and does so automatically, so we have to consider the security implications
22474 In particular, since you have the option of including your own filenames
22475 and/or parameter strings and those are expanded into a command, it seems
22476 that it would be possible to create a malicious document which executes
22477 arbitrary commands when a user views or prints the document.
22478 This is something we definitely want to avoid.
22481 \begin_layout Standard
22482 However, since the external program commands are specified in the template
22483 configuration file only, there are no security issues if LyX is properly
22484 configured with safe templates only.
22485 This is so because the external programs are invoked with the
22486 \begin_inset Flex Code
22489 \begin_layout Plain Layout
22495 -system call rather than the
22496 \begin_inset Flex Code
22499 \begin_layout Plain Layout
22505 system-call, so it's not possible to execute arbitrary commands from the
22506 filename or parameter section via the shell.
22509 \begin_layout Standard
22510 This also implies that you are restricted in what command strings you can
22511 use in the external material templates.
22512 In particular, pipes and redirection are not readily available.
22513 This has to be so if LyX should remain safe.
22514 If you want to use some of the shell features, you should write a safe
22515 script to do this in a controlled manner, and then invoke the script from
22516 the command string.
22520 \begin_layout Standard
22521 It is possible to design a template that interacts directly with the shell,
22522 but since this would allow a malicious user to execute arbitrary commands
22523 by writing clever filenames and/or parameters, we generally recommend that
22524 you only use safe scripts that work with the
22525 \begin_inset Flex Code
22528 \begin_layout Plain Layout
22534 system call in a controlled manner.
22535 Of course, for use in a controlled environment, it can be tempting to just
22536 fall back to use ordinary shell scripts.
22537 If you do so, be aware that you
22541 provide an easily exploitable security hole in your system.
22542 Of course it stands to reason that such unsafe templates will never be
22543 included in the standard LyX distribution, although we do encourage people
22544 to submit new templates in the open source tradition.
22545 But LyX as shipped from the official distribution channels will never have
22549 \begin_layout Standard
22550 Including external material provides a lot of power, and you have to be
22551 careful not to introduce security hazards with this power.
22552 A subtle error in a single line in an innocent looking script can open
22553 the door to huge security problems.
22554 So if you do not fully understand the issues, we recommend that you consult
22555 a knowledgeable security professional or the LyX development team if you
22556 have any questions about whether a given template is safe or not.
22557 And do this before you use it in an uncontrolled environment.