1 #LyX 2.0 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 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
39 % used for multi-column text
42 \options fleqn,bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading
43 \use_default_options false
47 \maintain_unincluded_children false
50 InsetLayout Flex:MenuItem
59 \newcommand*{\menuitem}[1]{{\sffamily #1}}
62 # In case we need to do with sans...
63 #InsetLayout CharStyle:Code
68 #\renewcommand{\code}[1]{{\sffamily #1}}
73 \language_package default
78 \font_typewriter default
79 \font_default_family default
80 \use_non_tex_fonts false
86 \default_output_format default
88 \bibtex_command default
89 \index_command default
93 \pdf_title "LyX Configuration Manual"
94 \pdf_author "LyX Team"
95 \pdf_subject "LyX-documentation Customization"
96 \pdf_keywords "LyX, documentation, customization"
98 \pdf_bookmarksnumbered true
99 \pdf_bookmarksopen true
100 \pdf_bookmarksopenlevel 1
101 \pdf_breaklinks false
105 \pdf_pdfusetitle false
106 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
116 \paperorientation portrait
130 \paragraph_separation indent
131 \paragraph_indentation default
132 \quotes_language english
135 \paperpagestyle headings
136 \tracking_changes true
137 \output_changes false
141 \author 1414654397 "Richard Heck"
147 Customizing LyX: Features for the Advanced User
155 \begin_layout Plain Layout
157 If you have comments or error corrections, please send them to the LyX Documenta
159 \begin_inset CommandInset href
161 target "lyx-docs@lists.lyx.org"
168 \begin_inset Quotes eld
172 \begin_inset Quotes erd
175 in the subject header, and please cc the current maintainer of this file,
176 Richard Heck <rgheck@comcast.net>.
182 \begin_inset Newline newline
186 \begin_inset Newline newline
192 \begin_layout Standard
193 \begin_inset CommandInset toc
194 LatexCommand tableofcontents
201 \begin_layout Standard
202 \begin_inset Note Note
205 \begin_layout Plain Layout
206 Please use change tracking when modifying this document.
207 This makes it easier for our translators to recognize things that have
208 been changed, and it helps the maintainer keep up-to-date with what's been
217 \begin_layout Chapter
221 \begin_layout Standard
222 This manual covers the customization features present in LyX.
223 In it, we discuss issues like keyboard shortcuts, screen previewing options,
224 printer options, sending commands to LyX via the LyX Server, internationalizati
225 on, installing new LaTeX classes and LyX layouts, etc.
226 We can't possibly hope to touch on everything you can change—our developers
227 add new features faster than we can document them—but we will explain the
228 most common customizations and hopefully point you in the right direction
229 for some of the more obscure ones.
232 \begin_layout Standard
233 \begin_inset Branch OutDated
236 \begin_layout Standard
237 Information from previous versions of this document that now seems to be
238 outdated is contained in the OutDated branch of this document.
239 By default, this information will not appear in the LaTeX output.
247 \begin_layout Chapter
248 LyX configuration files
251 \begin_layout Standard
252 This chapter aims to help you to find your way through the LyX configuration
254 Before continuing to read this chapter, you should find out where your
255 LyX library and user directories are by using
256 \begin_inset Flex MenuItem
259 \begin_layout Plain Layout
260 Help\SpecialChar \menuseparator
271 The library directory is the place where LyX places its system-wide configurati
272 on files; the user directory is where you can place your modified versions.
273 We will call the former
274 \begin_inset Flex Code
277 \begin_layout Plain Layout
284 \begin_inset Flex MenuItem
287 \begin_layout Plain Layout
293 in the remainder of this document.
297 \begin_layout Section
299 \begin_inset Flex Code
302 \begin_layout Plain Layout
311 \begin_layout Standard
312 \begin_inset Flex Code
315 \begin_layout Plain Layout
321 and its sub-directories contain a number of files and that can be used
322 to customize LyX's behavior.
323 You can change many of these files from within LyX itself through the
324 \begin_inset Flex MenuItem
327 \begin_layout Plain Layout
328 Tools\SpecialChar \menuseparator
335 Most customization that you will want to do in LyX is possible through
337 However, many other inner aspects of LyX can be customized by modifying
339 \begin_inset Flex Code
342 \begin_layout Plain Layout
349 These files fall in different categories, described in the following subsection
353 \begin_layout Subsection
354 Automatically generated files
357 \begin_layout Standard
358 The files, which are to be found in
359 \begin_inset Flex MenuItem
362 \begin_layout Plain Layout
368 , are generated when you configure LyX.
369 They contain various default values that are guessed by inspection.
370 In general, it is not a good idea to modify them, since they might be overwritt
374 \begin_layout Labeling
375 \labelwidthstring 00.00.0000
376 \begin_inset Flex Code
379 \begin_layout Plain Layout
385 contains defaults for various commands.
388 \begin_layout Labeling
389 \labelwidthstring 00.00.0000
390 \begin_inset Flex Code
393 \begin_layout Plain Layout
399 contains the list of packages that have been recognized by LyX.
400 It is currently unused by the LyX program itself, but the information extracted
401 , and more, is made available with
402 \begin_inset Flex MenuItem
405 \begin_layout Plain Layout
406 Help\SpecialChar \menuseparator
419 \begin_layout Labeling
420 \labelwidthstring 00.00.0000
421 \begin_inset Flex Code
424 \begin_layout Plain Layout
430 the list of text classes that have been found in your
431 \begin_inset Flex Code
434 \begin_layout Plain Layout
440 directories, along with the associated LaTeX document class and their descripti
444 \begin_layout Labeling
445 \labelwidthstring 00.00.0000
446 \begin_inset Flex Code
449 \begin_layout Plain Layout
455 the list of layout modules found in your
456 \begin_inset Flex Code
459 \begin_layout Plain Layout
468 \begin_layout Labeling
469 \labelwidthstring 00.00.0000
470 \begin_inset Flex Code
473 \begin_layout Plain Layout
479 lists of various sorts of LaTeX-related files found on your system
482 \begin_layout Labeling
483 \labelwidthstring 00.00.0000
484 \begin_inset Flex Code
487 \begin_layout Plain Layout
493 is automatically generated during configuration from the file
494 \begin_inset Flex Code
497 \begin_layout Plain Layout
504 It contains information on your LaTeX configuration.
507 \begin_layout Subsection
511 \begin_layout Standard
512 These directories are duplicated between
513 \begin_inset Flex Code
516 \begin_layout Plain Layout
523 \begin_inset Flex Code
526 \begin_layout Plain Layout
533 If a particular files exists in both places, the one in
534 \begin_inset Flex Code
537 \begin_layout Plain Layout
546 \begin_layout Labeling
547 \labelwidthstring 00.00.0000
548 \begin_inset Flex Code
551 \begin_layout Plain Layout
557 this directory contains files with the extension
558 \begin_inset Flex Code
561 \begin_layout Plain Layout
567 that define the keybindings used in LyX.
568 If there exists an internationalized version of the bind file named
569 \begin_inset Flex Code
572 \begin_layout Plain Layout
578 , that will be used first.
581 \begin_layout Labeling
582 \labelwidthstring 00.00.0000
583 \begin_inset Flex Code
586 \begin_layout Plain Layout
592 contains graphics files that can be included in documents.
596 \begin_layout Labeling
597 \labelwidthstring 00.00.0000
598 \begin_inset Flex Code
601 \begin_layout Plain Layout
607 contains LyX documentation files (including the one you are currently reading).
609 \begin_inset Flex Code
612 \begin_layout Plain Layout
618 deserves special attention, as noted above.
619 The internationalized help docs are in subdirectories
620 \begin_inset Flex Code
623 \begin_layout Plain Layout
630 \begin_inset Quotes eld
634 \begin_inset Quotes erd
637 is the ISO language code.
643 \begin_inset CommandInset ref
645 reference "cha:Internationalizing-LyX"
652 \begin_layout Labeling
653 \labelwidthstring 00.00.0000
654 \begin_inset Flex Code
657 \begin_layout Plain Layout
663 contains example files that explain how to use some features.
664 In the file browser, press the
665 \begin_inset Flex MenuItem
668 \begin_layout Plain Layout
677 \begin_layout Labeling
678 \labelwidthstring 00.00.0000
679 \begin_inset Flex Code
682 \begin_layout Plain Layout
688 contains image files that are used by the
689 \begin_inset Flex MenuItem
692 \begin_layout Plain Layout
699 In addition, it also contains the individual icons used in the toolbar
700 and the banners that can be shown when LyX is launched.
703 \begin_layout Labeling
704 \labelwidthstring 00.00.0000
705 \begin_inset Flex Code
708 \begin_layout Plain Layout
714 contains keyboard keymapping files.
720 \begin_inset CommandInset ref
722 reference "sec:International-Keymap-Stuff"
729 \begin_layout Labeling
730 \labelwidthstring 00.00.0000
731 \begin_inset Flex Code
734 \begin_layout Plain Layout
740 contains the text class and module files described in Chapter
745 \begin_inset CommandInset ref
747 reference "cha:Installing-New-Document"
754 \begin_layout Labeling
755 \labelwidthstring 00.00.0000
756 \begin_inset Flex Code
759 \begin_layout Plain Layout
766 \begin_inset Flex Code
769 \begin_layout Plain Layout
775 Python scripts used to convert between LyX versions.
776 These can be run from the command line if, say, you want to batch-convert
780 \begin_layout Labeling
781 \labelwidthstring 00.00.0000
782 \begin_inset Flex Code
785 \begin_layout Plain Layout
791 contains some files that demonstrate the capabilities of the
792 \begin_inset Flex MenuItem
795 \begin_layout Plain Layout
806 Also contains some scripts used by LyX itself.
809 \begin_layout Labeling
810 \labelwidthstring 00.00.0000
811 \begin_inset Flex Code
814 \begin_layout Plain Layout
820 contains the standard LyX template files described in Chapter
825 \begin_inset CommandInset ref
827 reference "sub:Creating-Templates"
834 \begin_layout Labeling
835 \labelwidthstring 00.00.0000
836 \begin_inset Flex Code
839 \begin_layout Plain Layout
845 contains files with the extension
846 \begin_inset Flex Code
849 \begin_layout Plain Layout
855 that define the user interface to LyX.
856 That is, the files define which items appear in which menus and the items
857 appearing on the toolbar.
860 \begin_layout Subsection
861 Files you don't want to modify
864 \begin_layout Standard
865 These files are used internally by LyX and you generally do not need to
866 modify them unless you are a developer.
869 \begin_layout Labeling
870 \labelwidthstring 00.00.0000
871 \begin_inset Flex Code
874 \begin_layout Plain Layout
880 this file contains the list of LyX developers.
881 The contents are displayed with the menu entry
882 \begin_inset Flex MenuItem
885 \begin_layout Plain Layout
886 Help\SpecialChar \menuseparator
899 \begin_layout Labeling
900 \labelwidthstring 00.00.0000
901 \begin_inset Flex Code
904 \begin_layout Plain Layout
910 this is a LaTeX script used during the configuration process.
914 \begin_layout Labeling
915 \labelwidthstring 00.00.0000
916 \begin_inset Flex Code
919 \begin_layout Plain Layout
925 this is the script that is used to re-configure LyX.
926 It creates configuration files in the directory it was run from.
929 \begin_layout Subsection
930 Other files needing a line or two...
933 \begin_layout Labeling
934 \labelwidthstring 00.00.0000
935 \begin_inset Flex Code
938 \begin_layout Plain Layout
944 this contains tables describing how different character encodings can be
948 \begin_layout Labeling
949 \labelwidthstring 00.00.0000
950 \begin_inset Flex Code
953 \begin_layout Plain Layout
959 this file contains the templates available to the new
960 \begin_inset Flex MenuItem
963 \begin_layout Plain Layout
976 \begin_layout Labeling
977 \labelwidthstring 00.00.0000
978 \begin_inset Flex Code
981 \begin_layout Plain Layout
987 this file contains a list of all the languages currently supported by LyX.
990 \begin_layout Section
991 Your local configuration directory
994 \begin_layout Standard
995 Even if you are using LyX as an unprivileged user, you might want to change
996 LyX configuration for your own use.
998 \begin_inset Flex Code
1001 \begin_layout Plain Layout
1007 directory contains all your personal configuration files.
1008 This is the directory described as
1009 \begin_inset Quotes eld
1013 \begin_inset Quotes erd
1017 \begin_inset Flex MenuItem
1020 \begin_layout Plain Layout
1021 Help\SpecialChar \menuseparator
1023 \begin_inset space ~
1032 This directory is used as a mirror of
1033 \begin_inset Flex Code
1036 \begin_layout Plain Layout
1042 , which means that every file in
1043 \begin_inset Flex Code
1046 \begin_layout Plain Layout
1052 is a replacement for the corresponding file in
1053 \begin_inset Flex Code
1056 \begin_layout Plain Layout
1063 Any configuration file described in the above sections can be placed either
1064 in the system-wide directory, in which case it will affect all users, or
1065 in your local directory for your own use.
1068 \begin_layout Standard
1069 To make things clearer, let's provide a few examples:
1072 \begin_layout Itemize
1073 The preferences set in the
1074 \begin_inset Flex MenuItem
1077 \begin_layout Plain Layout
1078 Tools\SpecialChar \menuseparator
1084 dialog are saved to a file
1085 \begin_inset Flex Code
1088 \begin_layout Plain Layout
1095 \begin_inset Flex Code
1098 \begin_layout Plain Layout
1107 \begin_layout Itemize
1108 When you reconfigure using
1109 \begin_inset Flex MenuItem
1112 \begin_layout Plain Layout
1113 Tools\SpecialChar \menuseparator
1120 \begin_inset Flex Code
1123 \begin_layout Plain Layout
1129 script, and the resulting files are written in your local configuration
1131 This means that any additional text class file that you might have added
1133 \begin_inset Flex Code
1136 \begin_layout Plain Layout
1142 will be added to the list of classes in the
1143 \begin_inset Flex MenuItem
1146 \begin_layout Plain Layout
1147 Document\SpecialChar \menuseparator
1156 \begin_layout Itemize
1157 If you get some updated documentation from LyX ftp site and cannot install
1158 it because you do not have sysadmin rights on your system, you can just
1160 \begin_inset Flex Code
1163 \begin_layout Plain Layout
1169 and the items in the
1170 \begin_inset Flex MenuItem
1173 \begin_layout Plain Layout
1179 menu will open them!
1182 \begin_layout Section
1183 Running LyX with multiple configurations
1186 \begin_layout Standard
1187 The configuration freedom of the local configuration directory may not suffice
1188 if you want to have more than one configuration at your disposal.
1189 For example, you may want to be use different key bindings or printer settings
1191 You can achieve this by having several such directories.
1192 You then specify which directory to use at run-time.
1195 \begin_layout Standard
1196 Invoking LyX with the command line switch
1197 \begin_inset Flex Code
1200 \begin_layout Plain Layout
1210 instructs the program to read the configuration from that directory, and
1211 not from the default directory.
1212 (You can determine the default directory by running LyX without the
1213 \begin_inset Flex Code
1216 \begin_layout Plain Layout
1222 switch.) If the specified directory does not exist, LyX offers to create
1223 it for you, just like it does for the default directory on the first time
1224 you run the program.
1225 You can modify the configuration options in this additional user directory
1226 exactly as you would for the default directory.
1227 These directories are completely independent (but read on).
1228 Note that setting the environment variable
1229 \begin_inset Flex Code
1232 \begin_layout Plain Layout
1238 to some value has exactly the same effect.
1241 \begin_layout Standard
1242 Having several configurations also requires more maintenance: if you want
1243 to add a new layout to
1244 \begin_inset Flex Code
1247 \begin_layout Plain Layout
1253 which you want available from all your configurations, you must add it
1254 to each directory separately.
1255 You can avoid this with the following trick: after LyX creates the additional
1256 directory, most of the subdirectories (see above) are empty.
1257 If you want the new configuration to mirror an existing one, replace the
1258 empty subdirectory with a symbolic link to the matching subdirectory in
1259 the existing configuration.
1261 \begin_inset Flex Code
1264 \begin_layout Plain Layout
1270 subdirectory, however, since it contains a file written by the configuration
1271 script (also accessible through
1272 \begin_inset Flex MenuItem
1275 \begin_layout Plain Layout
1276 Tools\SpecialChar \menuseparator
1282 ) which is configuration-specific.
1285 \begin_layout Chapter
1286 The Preferences dialog
1289 \begin_layout Standard
1290 All options of the preferences dialog are described in the Appendix
1292 The Preferences Dialog
1299 For some options you might find here more details.
1302 \begin_layout Section
1304 \begin_inset CommandInset label
1313 \begin_layout Standard
1314 The first step is to define your file formats if they are not already defined.
1316 \begin_inset Flex MenuItem
1319 \begin_layout Plain Layout
1320 Tools\SpecialChar \menuseparator
1328 \begin_inset Flex MenuItem
1331 \begin_layout Plain Layout
1332 File Handling\SpecialChar \menuseparator
1339 \begin_inset Flex MenuItem
1342 \begin_layout Plain Layout
1343 New\SpecialChar \ldots{}
1349 button to define your new format.
1351 \begin_inset Flex MenuItem
1354 \begin_layout Plain Layout
1360 field contains the name used to identify the format in the GUI.
1362 \begin_inset Flex MenuItem
1365 \begin_layout Plain Layout
1371 is used to identify the format internally.
1372 You will also need to enter a file extension.
1373 These are all required.
1375 \begin_inset Flex MenuItem
1378 \begin_layout Plain Layout
1384 field is used to provide a keyboard shortcut on the menus.
1385 (For example, pressing
1386 \begin_inset Flex MenuItem
1389 \begin_layout Plain Layout
1396 \begin_inset Flex MenuItem
1399 \begin_layout Plain Layout
1400 View\SpecialChar \menuseparator
1401 View (Other Formats)\SpecialChar \menuseparator
1410 \begin_layout Standard
1412 \begin_inset Flex MenuItem
1415 \begin_layout Plain Layout
1422 \begin_inset Flex MenuItem
1425 \begin_layout Plain Layout
1432 For example, you might want to use
1433 \begin_inset Flex MenuItem
1436 \begin_layout Plain Layout
1442 to view PostScript files.
1443 You can enter the command needed to start the program in the corresponding
1445 In defining this command, you can use the four variables listed in the
1447 The viewer is launched when you view an image in LyX or use the
1448 \begin_inset Flex MenuItem
1451 \begin_layout Plain Layout
1458 The editor is for example launched when you right-click on an image and
1460 \begin_inset Flex MenuItem
1463 \begin_layout Plain Layout
1469 in the appearing context menu.
1472 \begin_layout Standard
1474 \begin_inset Flex MenuItem
1477 \begin_layout Plain Layout
1483 option tells LyX that a format is suitable for document export.
1484 If this is set and if a suitable conversion route exists (see sec.
1485 \begin_inset space \thinspace{}
1489 \begin_inset CommandInset ref
1491 reference "sec:Converters"
1495 ), the format will appear in the
1496 \begin_inset Flex MenuItem
1499 \begin_layout Plain Layout
1500 File\SpecialChar \menuseparator
1507 The format will also appear in the
1508 \begin_inset Flex MenuItem
1511 \begin_layout Plain Layout
1517 menu if a viewer is specified for the format.
1518 Pure image formats, such as
1519 \begin_inset Flex Code
1522 \begin_layout Plain Layout
1528 , should not use this option.
1529 Formats that can both represent vector graphics and documents like
1530 \begin_inset Flex Code
1533 \begin_layout Plain Layout
1542 \begin_layout Standard
1544 \begin_inset Flex MenuItem
1547 \begin_layout Plain Layout
1548 Vector graphics format
1553 tells LyX that a format can contain vector graphics.
1554 This information is used to determine the target format of included graphics
1556 \begin_inset Flex MenuItem
1559 \begin_layout Plain Layout
1566 Included graphics may need to be converted to either
1567 \begin_inset Flex MenuItem
1570 \begin_layout Plain Layout
1577 \begin_inset Flex MenuItem
1580 \begin_layout Plain Layout
1587 \begin_inset Flex MenuItem
1590 \begin_layout Plain Layout
1597 \begin_inset Flex MenuItem
1600 \begin_layout Plain Layout
1606 cannot handle other image formats.
1607 If an included graphic is not already in
1608 \begin_inset Flex MenuItem
1611 \begin_layout Plain Layout
1618 \begin_inset Flex MenuItem
1621 \begin_layout Plain Layout
1628 \begin_inset Flex MenuItem
1631 \begin_layout Plain Layout
1637 format, it is converted to
1638 \begin_inset Flex MenuItem
1641 \begin_layout Plain Layout
1647 if the vector format option is set, and otherwise to
1648 \begin_inset Flex MenuItem
1651 \begin_layout Plain Layout
1660 \begin_layout Section
1664 \begin_layout Standard
1665 Since all conversions from one format to another take place in LyX's temporary
1666 directory, it is sometimes necessary to modify a file before copying it
1667 to the temporary directory in order that the conversion may be performed.
1671 \begin_layout Plain Layout
1672 For example, the file may refer to other files—images, for example—using
1673 relative file names, and these may become invalid when the file is copied
1674 to the temporary directory.
1679 This is done by a Copier: It copies a file to (or from) the temporary directory
1680 and may modify it in the process.
1683 \begin_layout Standard
1684 The definitions of the copiers may use four variables:
1687 \begin_layout Labeling
1688 \labelwidthstring 00.00.0000
1689 \begin_inset Flex Code
1692 \begin_layout Plain Layout
1698 The LyX system directory (e.
1699 \begin_inset space \thinspace{}
1703 \begin_inset space \space{}
1707 \begin_inset Flex MenuItem
1710 \begin_layout Plain Layout
1719 \begin_layout Labeling
1720 \labelwidthstring 00.00.0000
1721 \begin_inset Flex Code
1724 \begin_layout Plain Layout
1733 \begin_layout Labeling
1734 \labelwidthstring 00.00.0000
1735 \begin_inset Flex Code
1738 \begin_layout Plain Layout
1747 \begin_layout Labeling
1748 \labelwidthstring 00.00.0000
1749 \begin_inset Flex Code
1752 \begin_layout Plain Layout
1761 \begin_layout Standard
1762 The latter should be the filename as it would be used in a LaTeX's
1769 It is relevant only when exporting files suitable for such inclusion.
1772 \begin_layout Standard
1773 Copiers can be used to do almost anything with output files.
1774 For example, suppose you want generated pdf files to be copied to a special
1776 \begin_inset Flex Code
1779 \begin_layout Plain Layout
1786 Then you could write a shell script such as this one:
1789 \begin_layout Standard
1790 \begin_inset listings
1794 \begin_layout Plain Layout
1799 \begin_layout Plain Layout
1804 \begin_layout Plain Layout
1806 TOFILE=`basename $2`
1809 \begin_layout Plain Layout
1811 cp $FROMFILE /home/you/pdf/$TOFILE
1816 Save it in your local LyX directory—say,
1817 \begin_inset Flex Code
1820 \begin_layout Plain Layout
1821 /home/you/.lyx/scripts/pdfcopier.sh
1826 —and make it executable, if you need to do so on your platform.
1828 \begin_inset Flex MenuItem
1831 \begin_layout Plain Layout
1832 Tools\SpecialChar \menuseparator
1838 dialog, select under
1839 \begin_inset Flex MenuItem
1842 \begin_layout Plain Layout
1843 File Handling\SpecialChar \menuseparator
1850 \begin_inset Flex MenuItem
1853 \begin_layout Plain Layout
1859 format—or one of the other pdf formats—and enter
1860 \begin_inset Flex Code
1863 \begin_layout Plain Layout
1864 pdfcopier.sh $$i $$o
1870 \begin_inset Flex MenuItem
1873 \begin_layout Plain Layout
1883 \begin_layout Standard
1884 Copiers are used by LyX in various of its own conversions.
1885 For example, if appropriate programs are found, LyX will automatically
1886 install copiers for the
1887 \begin_inset Flex MenuItem
1890 \begin_layout Plain Layout
1897 \begin_inset Flex MenuItem
1900 \begin_layout Plain Layout
1902 \begin_inset space ~
1911 When these formats are exported, the copier sees that not just the main
1912 HTML file but various associated files (style files, images, etc.) are also
1914 All these files are written to a subdirectory of the directory in which
1915 the original LyX file was found.
1919 \begin_layout Plain Layout
1920 This copier can be customized.
1922 \begin_inset Quotes eld
1926 \begin_inset Quotes erd
1929 argument takes a comma-separated list of extensions to be copied; if it
1930 is omitted, all files will be copied.
1932 \begin_inset Quotes eld
1936 \begin_inset Quotes erd
1939 argument determines the extension added to the generated directory.
1941 \begin_inset Quotes eld
1945 \begin_inset Flex MenuItem
1948 \begin_layout Plain Layout
1955 \begin_inset Quotes erd
1958 , so HTML generated from
1959 \begin_inset Flex MenuItem
1962 \begin_layout Plain Layout
1963 /path/to/filename.lyx
1969 \begin_inset Flex MenuItem
1972 \begin_layout Plain Layout
1973 /path/to/filename.html.LyXconv
1987 \begin_layout Section
1989 \begin_inset CommandInset label
1991 name "sec:Converters"
1998 \begin_layout Standard
1999 You can define your own Converters to convert files between different formats.
2001 \begin_inset Flex MenuItem
2004 \begin_layout Plain Layout
2005 Tools\SpecialChar \menuseparator
2006 Preferences\SpecialChar \menuseparator
2007 File Handling\SpecialChar \menuseparator
2016 \begin_layout Standard
2017 To define a new converter, select the
2018 \begin_inset Flex MenuItem
2021 \begin_layout Plain Layout
2023 \begin_inset space ~
2032 \begin_inset Flex MenuItem
2035 \begin_layout Plain Layout
2037 \begin_inset space ~
2045 from the drop-down lists, enter the command needed for the conversion,
2047 \begin_inset Flex MenuItem
2050 \begin_layout Plain Layout
2057 Several variables can be used in the definition of converters:
2060 \begin_layout Labeling
2061 \labelwidthstring 00.00.0000
2062 \begin_inset Flex Code
2065 \begin_layout Plain Layout
2071 The LyX system directory
2074 \begin_layout Labeling
2075 \labelwidthstring 00.00.0000
2076 \begin_inset Flex Code
2079 \begin_layout Plain Layout
2088 \begin_layout Labeling
2089 \labelwidthstring 00.00.0000
2090 \begin_inset Flex Code
2093 \begin_layout Plain Layout
2102 \begin_layout Labeling
2103 \labelwidthstring 00.00.0000
2104 \begin_inset Flex Code
2107 \begin_layout Plain Layout
2113 The base filename of the input file (i.
2114 \begin_inset space \thinspace{}
2117 g., without the extension)
2120 \begin_layout Labeling
2121 \labelwidthstring 00.00.0000
2122 \begin_inset Flex Code
2125 \begin_layout Plain Layout
2131 The path to the input file
2134 \begin_layout Labeling
2135 \labelwidthstring 00.00.0000
2136 \begin_inset Flex Code
2139 \begin_layout Plain Layout
2145 The path to the original input file (this is different from $$p when a
2146 chain of converters is called)
2149 \begin_layout Labeling
2150 \labelwidthstring 00.00.0000
2151 \begin_inset Flex Code
2154 \begin_layout Plain Layout
2160 The iconv name for the encoding of the document.
2163 \begin_layout Standard
2165 \begin_inset Flex MenuItem
2168 \begin_layout Plain Layout
2170 \begin_inset space ~
2178 field you can enter the following flags, separated by commas:
2181 \begin_layout Labeling
2182 \labelwidthstring 00.00.0000
2183 \begin_inset Flex Code
2186 \begin_layout Plain Layout
2192 This converter runs some form of LaTeX.
2193 This will make LyX's LaTeX error logs available.
2196 \begin_layout Labeling
2197 \labelwidthstring 00.00.0000
2198 \begin_inset Flex Code
2201 \begin_layout Plain Layout
2208 \begin_inset Flex MenuItem
2211 \begin_layout Plain Layout
2217 file for the conversion.
2220 \begin_layout Labeling
2221 \labelwidthstring 00.00.0000
2222 \begin_inset Flex Code
2225 \begin_layout Plain Layout
2234 \begin_layout Standard
2235 The following three flags are not really flags at all because they take
2237 \begin_inset Flex MenuItem
2240 \begin_layout Plain Layout
2242 \begin_inset space ~
2246 \begin_inset space ~
2257 \begin_layout Labeling
2258 \labelwidthstring 00.00.0000
2259 \begin_inset Flex Code
2262 \begin_layout Plain Layout
2268 If set, the converter's standard error will be redirected to a file
2269 \begin_inset Flex Code
2272 \begin_layout Plain Layout
2278 , and the script given as argument will be run as:
2279 \begin_inset Flex Code
2282 \begin_layout Plain Layout
2283 script < infile.out > infile.log
2289 The argument may contain
2290 \begin_inset Flex Code
2293 \begin_layout Plain Layout
2302 \begin_layout Labeling
2303 \labelwidthstring 00.00.0000
2304 \begin_inset Flex Code
2307 \begin_layout Plain Layout
2313 The name of the directory in which the converter will dump the generated
2315 LyX will not create this directory, and it does not copy anything into
2316 it, though it will copy this directory to the destination.
2317 The argument may contain
2318 \begin_inset Flex Code
2321 \begin_layout Plain Layout
2327 , which will be replaced by the base name of the input and output files,
2328 respectively, when the directory is copied.
2329 \begin_inset Newline newline
2332 Note that resultdir and usetempdir make no sense together.
2333 The latter will be ignored if the former is given.
2336 \begin_layout Labeling
2337 \labelwidthstring 00.00.0000
2338 \begin_inset Flex Code
2341 \begin_layout Plain Layout
2347 Determines the output file name and may, contain
2348 \begin_inset Flex Code
2351 \begin_layout Plain Layout
2358 Sensible only with resultdir and optional even then; if not given, it defaults
2362 \begin_layout Standard
2363 None of these last three are presently used in any of the converters that
2364 are installed with LyX.
2368 \begin_layout Standard
2369 You do not have to define converters for all formats between which you want
2371 For example, you will note that there is no `LyX to PostScript' converter,
2372 but LyX will export PostScript.
2373 It does so by first creating a LaTeX file (no converter needs to be defined
2374 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2375 and finally converting the resulting DVI file to PostScript.
2376 LyX finds such `chains' of converters automatically, and it will always
2377 choose the shortest possible chain.
2378 You can, though, still define multiple conversion methods between file
2380 For example, the standard LyX configuration provides three ways to convert
2381 LaTeX to PDF: Directly, using
2382 \begin_inset Flex MenuItem
2385 \begin_layout Plain Layout
2391 ; via (DVI and) PostScript, using
2392 \begin_inset Flex MenuItem
2395 \begin_layout Plain Layout
2402 \begin_inset Flex MenuItem
2405 \begin_layout Plain Layout
2412 To define such alternate chains, you must define multiple target `file
2413 formats', as described in section
2414 \begin_inset CommandInset ref
2416 reference "sec:Formats"
2421 For example, in the standard configuration, the formats named
2422 \begin_inset Flex MenuItem
2425 \begin_layout Plain Layout
2432 \begin_inset Flex MenuItem
2435 \begin_layout Plain Layout
2442 \begin_inset Flex MenuItem
2445 \begin_layout Plain Layout
2451 are defined, all of which share the extension
2452 \begin_inset Flex MenuItem
2455 \begin_layout Plain Layout
2461 , and which correspond to the conversion methods just mentioned.
2464 \begin_layout Chapter
2465 Internationalizing LyX
2466 \begin_inset CommandInset label
2468 name "cha:Internationalizing-LyX"
2475 \begin_layout Standard
2476 LyX supports using a translated interface.
2477 Last time we checked, LyX provided text in thirty languages.
2478 The language of choice is called your
2483 (For further reading on locale settings, see also the documentation for
2484 locale that comes with your operating system.
2485 For Linux, the manual page for
2486 \begin_inset Flex Code
2489 \begin_layout Plain Layout
2495 could be a good place to start).
2498 \begin_layout Standard
2499 Notice that these translations will work, but do contain a few flaws.
2500 In particular, all dialogs have been designed with the English text in
2501 mind, which means that some of the translated text will be too large to
2502 fit within the space allocated.
2503 This is only a display problem and will not cause any harm.
2504 Also, you will find that some of the translations do not define shortcut
2505 keys for everything.
2506 Sometimes, there are simply not enough free letters to do it.
2507 Other times, the translator just hasn't got around to doing it yet.
2508 Our localization team, which you may wish to join,
2512 \begin_layout Plain Layout
2513 If you are a fluent speaker of a language other than English, joining these
2514 teams is a great way to give back to the LyX community!
2519 will of course try to fix these shortcomings in future versions of LyX.
2522 \begin_layout Section
2526 \begin_layout Subsection
2527 Translating the graphical user interface (text messages).
2530 \begin_layout Standard
2532 \begin_inset Flex Code
2535 \begin_layout Plain Layout
2541 library to handle the internationalization of the interface.
2542 To have LyX speak your favorite language in all menus and dialogs, you
2544 \begin_inset Flex Code
2547 \begin_layout Plain Layout
2553 -file for that language.
2554 When this is available, you'll have to generate a
2555 \begin_inset Flex Code
2558 \begin_layout Plain Layout
2564 -file from it and install the
2565 \begin_inset Flex Code
2568 \begin_layout Plain Layout
2575 The process of doing all of this is explained in the documentation for
2577 \begin_inset Flex Code
2580 \begin_layout Plain Layout
2587 It is possible to do this just for yourself, but if you're going to do
2588 it, you might as well share the results of your labors with the rest of
2590 Send a message to the LyX developers' list for more information about how
2594 \begin_layout Standard
2595 In short, this is what you should do (xx denotes the language code):
2598 \begin_layout Itemize
2599 Check out the LyX source code.
2601 \begin_inset CommandInset href
2603 name "information on the web"
2604 target "http://www.lyx.org/HowToUseSVN"
2611 \begin_layout Itemize
2613 \begin_inset Flex Code
2616 \begin_layout Plain Layout
2622 to the folder of the
2623 \begin_inset Flex Code
2626 \begin_layout Plain Layout
2634 \begin_inset Flex Code
2637 \begin_layout Plain Layout
2645 \begin_inset Flex Code
2648 \begin_layout Plain Layout
2654 doesn't exist anywhere, it can be remade with the console command
2655 \begin_inset Flex Code
2658 \begin_layout Plain Layout
2664 in that directory, or you can use an existing po-file for some other language
2668 \begin_layout Itemize
2670 \begin_inset Flex Code
2673 \begin_layout Plain Layout
2683 \begin_layout Plain Layout
2684 This is just a text file, so it can be edited in any text editor.
2685 But there are also specialized programs that support such editing, such
2690 (for all platforms) or
2699 contains a `mode' for editing
2700 \begin_inset Flex Code
2703 \begin_layout Plain Layout
2714 For some menu- and widget-labels, there are also shortcut keys that should
2716 Those keys are marked after a `|', and should be translated according to
2717 the words and phrases of the language.
2718 You should also fill also out the information at the beginning of the new
2720 \begin_inset Flex Code
2723 \begin_layout Plain Layout
2729 -file with your email-address, etc., so people know where to reach you with
2730 suggestions and entertaining flames.
2733 \begin_layout Standard
2734 If you are just doing this on your own, then:
2737 \begin_layout Itemize
2739 \begin_inset Flex Code
2742 \begin_layout Plain Layout
2749 This can be done with
2750 \begin_inset Flex Code
2753 \begin_layout Plain Layout
2754 msgfmt -o xx.mo < xx.po
2762 \begin_layout Itemize
2764 \begin_inset Flex Code
2767 \begin_layout Plain Layout
2773 -file to your locale-tree, at the correct directory for application messages
2778 xx, and under the name
2779 \begin_inset Flex Code
2782 \begin_layout Plain Layout
2789 \begin_inset space \thinspace{}
2793 \begin_inset space \space{}
2797 \begin_inset Flex Code
2800 \begin_layout Plain Layout
2801 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2811 \begin_layout Standard
2812 As said, however, it would be best if the new
2813 \begin_inset Flex Code
2816 \begin_layout Plain Layout
2822 -file could be added to the LyX distribution, so others can use it.
2823 Adding it involves making additional changes to LyX.
2824 So send an email to the developers' mailing list if you're interested in
2828 \begin_layout Subsubsection
2832 \begin_layout Standard
2833 Sometimes it turns out that one English message needs to be translated into
2834 different messages in the target language.
2835 One example is the message
2836 \begin_inset Flex Code
2839 \begin_layout Plain Layout
2845 which has the German translation
2853 , depending upon exactly what the English
2854 \begin_inset Quotes eld
2858 \begin_inset Quotes erd
2863 \begin_inset Flex Code
2866 \begin_layout Plain Layout
2872 does not handle such ambiguous translations.
2873 Therefore you have to add some context information to the message: Instead
2875 \begin_inset Flex Code
2878 \begin_layout Plain Layout
2885 \begin_inset Flex Code
2888 \begin_layout Plain Layout
2889 To[[as in 'From format x to format y']]
2895 \begin_inset Flex Code
2898 \begin_layout Plain Layout
2899 To[[as in 'From page x to page y']].
2904 Now the two occurrences of
2905 \begin_inset Flex Code
2908 \begin_layout Plain Layout
2915 \begin_inset Flex Code
2918 \begin_layout Plain Layout
2924 and can be translated correctly to
2935 \begin_layout Standard
2936 Of course the context information needs to be stripped off the original
2937 message when no translation is used.
2938 Therefore you have to put it in double square brackets at the end of the
2939 message (see the example above).
2940 The translation mechanism of LyX ensures that everything in double square
2941 brackets at the end of messages is removed before displaying the message.
2944 \begin_layout Subsection
2945 Translating the documentation.
2948 \begin_layout Standard
2949 The online documentation (in the
2950 \begin_inset Flex MenuItem
2953 \begin_layout Plain Layout
2959 -menu) can (and should!) be translated.
2960 If there are translated versions of the documentation available
2964 \begin_layout Plain Layout
2965 As of March 2008, at least some of the documents have been translated into
2966 fourteen languages, with the Tutorial available in a few more.
2971 and the locale is set accordingly, these will be used automagically by
2973 LyX looks for translated versions as
2974 \begin_inset Flex Code
2977 \begin_layout Plain Layout
2978 LyXDir/doc/xx/DocName.lyx
2984 \begin_inset Flex Code
2987 \begin_layout Plain Layout
2993 is the code for the language currently in use.
2994 If there are no translated documents, the default English versions will
2996 Note that the translated versions must have the same filenames (
2997 \begin_inset Flex Code
3000 \begin_layout Plain Layout
3006 above) as the original.
3007 If you feel up to translating the documentation (an excellent way to proof-read
3008 the original documentation by the way!), there are a few things you should
3012 \begin_layout Itemize
3013 Check out the documentation translation web page at
3014 \begin_inset CommandInset href
3016 name "http://www.lyx.org/Translation"
3017 target "http://www.lyx.org/Translation"
3022 That way, you can find out which (if any) documents have already been translate
3023 d into your language.
3024 You can also find out who (if anyone) is organizing the effort to translate
3025 the documentation into your language.
3026 If no one is organizing the effort, please let us know that you're interested.
3029 \begin_layout Standard
3030 Once you get to actually translating, here's a few hints for you that may
3034 \begin_layout Itemize
3035 Join the documentation team! There is information on how to do that in
3036 \begin_inset Flex Code
3039 \begin_layout Plain Layout
3046 \begin_inset Flex MenuItem
3049 \begin_layout Plain Layout
3050 Help\SpecialChar \menuseparator
3056 ), which by the way is the first document you should translate.
3059 \begin_layout Itemize
3060 Learn the typographic conventions for the language you are translating to.
3061 Typography is an ancient art and over the centuries, a great variety of
3062 conventions have developed throughout different parts of the world.
3063 Also study the professional terminology amongst typographers in your country.
3064 Inventing your own terminology will only confuse the users.
3067 (Warning! Typography is addictive!)
3070 \begin_layout Itemize
3071 Make a copy of the document.
3072 This will be your working copy.
3073 You can use this as your personal translated help-file by placing it in
3075 \begin_inset Flex Code
3078 \begin_layout Plain Layout
3087 \begin_layout Itemize
3088 Sometimes the original document (from the LyX-team) will be updated.
3089 Use the source viewer at
3090 \begin_inset CommandInset href
3092 name "http://www.lyx.org/trac/timeline"
3093 target "http://www.lyx.org/trac/timeline"
3097 to see what has been changed.
3098 That way you can easily see which parts of the translated document need
3102 \begin_layout Standard
3103 If you ever find an error in the original document, fix it and notify the
3104 rest of the documentation team of the changes! (You didn't forget to join
3105 the documentation team, did you?)
3108 \begin_layout Standard
3109 \begin_inset Branch OutDated
3112 \begin_layout Section
3113 International Keyboard Support
3116 \begin_layout Standard
3119 [Editor's Note: The following section is by
3127 It needs to be fixed to conform to the new Documentation Style sheet and
3128 to make use of the new v1.0 features.
3129 The whole thing also needs to be merged with the section following it.-jw
3130 It may also be badly out of date.-rh (2008)]
3133 \begin_layout Subsection
3134 Defining Own Keymaps: Keymap File Format
3137 \begin_layout Standard
3138 Let's look at a keyboard definition file a little closer.
3139 It is a plain text file defining
3142 \begin_layout Itemize
3143 key-to-key or key-to-string translations
3146 \begin_layout Itemize
3150 \begin_layout Itemize
3151 dead keys exceptions
3154 \begin_layout Standard
3155 To define key-to-key or key-to-string translation, use this command:
3158 \begin_layout Quotation
3159 \begin_inset Flex Code
3162 \begin_layout Plain Layout
3171 \begin_inset Flex Code
3174 \begin_layout Plain Layout
3183 \begin_layout Standard
3185 \begin_inset Flex Code
3188 \begin_layout Plain Layout
3194 is the key to be translated and
3195 \begin_inset Flex Code
3198 \begin_layout Plain Layout
3204 is the string to be inserted into the document.
3205 To define dead keys, use:
3208 \begin_layout Quotation
3209 \begin_inset Flex Code
3212 \begin_layout Plain Layout
3221 \begin_inset Flex Code
3224 \begin_layout Plain Layout
3233 \begin_layout Standard
3235 \begin_inset Flex Code
3238 \begin_layout Plain Layout
3244 is a keyboard key and
3245 \begin_inset Flex Code
3248 \begin_layout Plain Layout
3255 The following dead keys are supported (shortcut name is in parentheses):
3258 \begin_layout Quotation
3262 \begin_inset space \hfill{}
3268 \begin_layout Quotation
3270 \begin_inset space \hfill{}
3276 \begin_layout Quotation
3278 \begin_inset space \hfill{}
3284 \begin_layout Quotation
3286 \begin_inset space \hfill{}
3292 \begin_layout Quotation
3294 \begin_inset space \hfill{}
3300 \begin_layout Quotation
3302 \begin_inset space \hfill{}
3309 \begin_layout Plain Layout
3321 \begin_layout Quotation
3323 \begin_inset space \hfill{}
3329 \begin_layout Quotation
3331 \begin_inset space \hfill{}
3338 \begin_layout Plain Layout
3350 \begin_layout Quotation
3352 \begin_inset space \hfill{}
3358 \begin_layout Quotation
3360 \begin_inset space \hfill{}
3366 \begin_layout Quotation
3368 \begin_inset space \hfill{}
3375 \begin_layout Plain Layout
3387 \begin_layout Quotation
3389 \begin_inset space \hfill{}
3396 \begin_layout Plain Layout
3408 \begin_layout Quotation
3410 \begin_inset space \hfill{}
3416 \begin_layout Quotation
3417 hungarian umlaut (hug)
3418 \begin_inset space \hfill{}
3424 \begin_layout Quotation
3426 \begin_inset space \hfill{}
3432 \begin_layout Quotation
3434 \begin_inset space \hfill{}
3441 \begin_layout Plain Layout
3453 \begin_layout Standard
3454 Since in many international keyboards there are exceptions to what some
3455 dead keys should do, you can define them using
3458 \begin_layout Quotation
3459 \begin_inset Flex Code
3462 \begin_layout Plain Layout
3470 deadkey key outstring
3473 \begin_layout Standard
3474 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3478 \begin_layout Quotation
3479 \begin_inset Flex Code
3482 \begin_layout Plain Layout
3495 \begin_layout Standard
3496 to make it work correctly.
3497 Also, you have to define as exceptions dead keys over i and j, to remove
3498 the dot from them before inserting an accent mark.
3499 I will change this when the time comes, but so far I haven't had time.
3502 \begin_layout Standard
3503 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3506 \begin_inset Flex Code
3509 \begin_layout Plain Layout
3515 have different meaning.
3517 \begin_inset Flex Code
3520 \begin_layout Plain Layout
3526 marks comments, quotes start and end LaTeX-style commands.
3527 To enter quote, you'll need to use
3528 \begin_inset Flex Code
3531 \begin_layout Plain Layout
3540 \begin_inset Flex Code
3543 \begin_layout Plain Layout
3550 \begin_inset Flex Code
3553 \begin_layout Plain Layout
3564 \begin_layout Standard
3565 If you make a keyboard description file that works for your language, please
3566 mail it to me, so I can include it in the next keymap distribution.
3569 \begin_layout Standard
3570 More keywords will be supported in keymap configuration file in future,
3574 \begin_layout Itemize
3575 \begin_inset Flex Code
3578 \begin_layout Plain Layout
3589 \begin_inset space \hfill{}
3593 \begin_inset Flex Code
3596 \begin_layout Plain Layout
3605 \begin_layout Itemize
3606 \begin_inset Flex Code
3609 \begin_layout Plain Layout
3620 \begin_inset space \hfill{}
3624 \begin_inset Flex Code
3627 \begin_layout Plain Layout
3633 an external keymap translation program
3636 \begin_layout Standard
3637 Also, it should look into
3638 \begin_inset Flex Code
3641 \begin_layout Plain Layout
3647 file for defaults, too (for example, a
3648 \begin_inset Flex Code
3651 \begin_layout Plain Layout
3659 option to include default keyboard).
3667 \begin_layout Section
3668 International Keymap Stuff
3669 \begin_inset CommandInset label
3671 name "sec:International-Keymap-Stuff"
3678 \begin_layout Standard
3679 \begin_inset Note Note
3682 \begin_layout Plain Layout
3683 In doing the revisions on this document in March 2008, I did not look over
3684 this stuff, as I do not understand it.
3685 It would be good if someone else could do so.
3694 \begin_layout Standard
3695 The next two sections describe the
3696 \begin_inset Flex Code
3699 \begin_layout Plain Layout
3708 \begin_inset Flex Code
3711 \begin_layout Plain Layout
3719 file syntax in detail.
3720 These sections should help you design your own key map if the ones provided
3721 do not meet your needs.
3724 \begin_layout Subsection
3728 \begin_layout Standard
3732 \begin_inset Flex Code
3735 \begin_layout Plain Layout
3741 file maps keystrokes to characters or strings.
3742 As the name suggests, it sets a keyboard mapping.
3744 \begin_inset Flex Code
3747 \begin_layout Plain Layout
3758 \begin_inset Flex Code
3761 \begin_layout Plain Layout
3776 \begin_inset Flex Code
3779 \begin_layout Plain Layout
3792 \begin_inset Flex Code
3795 \begin_layout Plain Layout
3804 \begin_inset Flex Code
3807 \begin_layout Plain Layout
3815 are described in this section.
3818 \begin_layout Labeling
3819 \labelwidthstring 00.00.0000
3820 \begin_inset Flex Code
3823 \begin_layout Plain Layout
3831 Map a character to a string
3834 \begin_layout LyX-Code
3849 \begin_layout Standard
3882 the double-quote (")
3899 must be escaped with a preceding backslash (
3910 \begin_layout Standard
3912 \begin_inset Flex MenuItem
3915 \begin_layout Plain Layout
3923 statement to cause the symbol
3924 \begin_inset Flex MenuItem
3927 \begin_layout Plain Layout
3935 to be output for the keystroke
3936 \begin_inset Flex MenuItem
3939 \begin_layout Plain Layout
3950 \begin_layout LyX-Code
3956 \begin_layout Labeling
3957 \labelwidthstring 00.00.0000
3958 \begin_inset Flex Code
3961 \begin_layout Plain Layout
3969 Specify an accent character
3972 \begin_layout LyX-Code
3981 \begin_layout Standard
3982 This will make the cha
4020 This is the dead key
4024 \begin_layout Plain Layout
4031 refers to a key that does not produce a character by itself, but when followed
4032 with another key, produces the desired accent character.
4033 For example, a German characte
4035 r with an umlaut like
4045 can be produced in this manner.
4054 \begin_layout Standard
4067 and then another key not in
4084 followed by the other, not allowed key, as output.
4088 \begin_inset Flex MenuItem
4091 \begin_layout Plain Layout
4099 cancels a dead key, so if
4110 \begin_inset Flex MenuItem
4113 \begin_layout Plain Layout
4122 , the cursor will not go one position backwards but will instead cancel
4138 might have had on the next keystroke.
4142 \begin_layout Standard
4143 The following example specifies that the character ' is to be an acute accent,
4144 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4147 \begin_layout LyX-Code
4150 kmod ' acute aeiouAEIOU
4153 \begin_layout Labeling
4154 \labelwidthstring 00.00.0000
4155 \begin_inset Flex Code
4158 \begin_layout Plain Layout
4164 Specify an exception to the accent character
4167 \begin_layout LyX-Code
4176 \begin_layout Standard
4177 This defines an exce
4218 have been assigned a keystroke with a previous
4221 \begin_inset Flex Code
4224 \begin_layout Plain Layout
4248 must not belong in the
4295 If such a declaration does not exist in
4303 \begin_inset Flex Code
4306 \begin_layout Plain Layout
4340 \begin_inset Flex Code
4343 \begin_layout Plain Layout
4357 \begin_layout Standard
4358 The following command produces causes äi to be produced when you enter acute-i
4362 \begin_layout LyX-Code
4376 \begin_layout Labeling
4377 \labelwidthstring 00.00.0000
4378 \begin_inset Flex Code
4381 \begin_layout Plain Layout
4387 Combine two accent characters
4390 \begin_layout LyX-Code
4396 accent1 accent2 allowed
4399 \begin_layout Standard
4400 This one is getting pretty esoteric.
4401 It allows you to combine the effect
4457 \begin_inset Flex Code
4460 \begin_layout Plain Layout
4488 \begin_layout Standard
4489 Consider this example from the
4490 \begin_inset Flex Code
4493 \begin_layout Plain Layout
4504 \begin_layout LyX-Code
4507 kmod ; acute aeioyvhAEIOYVH
4511 kcomb acute umlaut iyIY
4514 \begin_layout Standard
4515 This allows you to press
4516 \begin_inset Flex MenuItem
4519 \begin_layout Plain Layout
4527 and get the effect of
4528 \begin_inset Flex Code
4531 \begin_layout Plain Layout
4550 in this case cancels the last dead key, so if you press
4551 \begin_inset Flex MenuItem
4554 \begin_layout Plain Layout
4563 \begin_inset Flex Code
4566 \begin_layout Plain Layout
4579 \begin_layout Subsection
4583 \begin_layout Standard
4585 \begin_inset Flex Code
4588 \begin_layout Plain Layout
4596 mapping is performed, a
4597 \begin_inset Flex Code
4600 \begin_layout Plain Layout
4610 file maps the strings that the symbols generate to characters in the current
4612 The LyX distribution currently includes at least the
4613 \begin_inset Flex Code
4616 \begin_layout Plain Layout
4625 \begin_inset Flex Code
4628 \begin_layout Plain Layout
4639 \begin_layout Standard
4641 \begin_inset Flex Code
4644 \begin_layout Plain Layout
4652 file is a sequence of declarations of the form
4655 \begin_layout LyX-Code
4668 \begin_layout Standard
4669 For example, in order to map
4670 \begin_inset Flex MenuItem
4673 \begin_layout Plain Layout
4683 to the corresponding character in the iso-8859-1 set (233), the following
4687 \begin_layout LyX-Code
4695 \begin_layout Standard
4697 \begin_inset Flex Code
4700 \begin_layout Plain Layout
4709 \begin_inset Flex Code
4712 \begin_layout Plain Layout
4730 the same character can apply to more than one string.
4732 \begin_inset Flex Code
4735 \begin_layout Plain Layout
4746 \begin_layout LyX-Code
4758 \begin_inset Newline newline
4774 \begin_layout Standard
4775 If LyX cannot find a mapping for the string produced by the keystroke or
4776 a deadkey sequence, it will check if it looks like an accented char and
4777 try to draw an accent over the character on screen.
4780 \begin_layout Subsection
4784 \begin_layout Standard
4785 There is a second way to add support for international characters through
4786 so-called dead-keys.
4787 A dead-key works in combination with a letter to produce an accented character.
4788 Here, we'll explain how to create a really simple dead-key to illustrate
4792 \begin_layout Standard
4793 Suppose you happen to need the circumflex character,
4794 \begin_inset Quotes eld
4798 \begin_inset Quotes erd
4803 \begin_inset Flex MenuItem
4806 \begin_layout Plain Layout
4813 \begin_inset space ~
4817 \begin_inset Flex MenuItem
4820 \begin_layout Plain Layout
4826 ] to the LyX command
4827 \begin_inset Flex Code
4830 \begin_layout Plain Layout
4837 \begin_inset Flex Code
4840 \begin_layout Plain Layout
4847 Now, whenever you type the
4848 \begin_inset Flex MenuItem
4851 \begin_layout Plain Layout
4857 -key followed by a letter, that letter will have a circumflex accent on
4859 For example, the sequence
4860 \begin_inset Quotes eld
4864 \begin_inset Flex MenuItem
4867 \begin_layout Plain Layout
4874 \begin_inset Quotes erd
4877 produces the letter:
4878 \begin_inset Quotes eld
4882 \begin_inset Quotes erd
4886 If you tried to type
4887 \begin_inset Quotes eld
4891 \begin_inset Flex MenuItem
4894 \begin_layout Plain Layout
4901 \begin_inset Quotes erd
4904 , however, LyX will complain with a beep, since a
4905 \begin_inset Quotes eld
4909 \begin_inset Flex MenuItem
4912 \begin_layout Plain Layout
4919 \begin_inset Quotes erd
4922 never takes a circumflex accent.
4924 \begin_inset Flex MenuItem
4927 \begin_layout Plain Layout
4933 after a dead-key produces the bare-accent.
4934 Please note this last point! If you bind a key to a dead-key, you'll need
4935 to rebind the character on that key to yet another key.
4937 \begin_inset Flex MenuItem
4940 \begin_layout Plain Layout
4946 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4949 \begin_layout Standard
4950 One common way to bind dead-keys is to use
4951 \begin_inset Flex MenuItem
4954 \begin_layout Plain Layout
4961 \begin_inset Flex MenuItem
4964 \begin_layout Plain Layout
4971 \begin_inset Flex MenuItem
4974 \begin_layout Plain Layout
4980 in combination with an accent, like
4981 \begin_inset Quotes eld
4985 \begin_inset Flex MenuItem
4988 \begin_layout Plain Layout
4995 \begin_inset Quotes erd
4999 \begin_inset Quotes eld
5003 \begin_inset Flex MenuItem
5006 \begin_layout Plain Layout
5013 \begin_inset Quotes erd
5017 \begin_inset Quotes eld
5021 \begin_inset Flex MenuItem
5024 \begin_layout Plain Layout
5031 \begin_inset Quotes erd
5035 Another way involves using
5036 \begin_inset Flex Code
5039 \begin_layout Plain Layout
5046 \begin_inset Flex Code
5049 \begin_layout Plain Layout
5055 to set up the special
5056 \begin_inset Flex Code
5059 \begin_layout Plain Layout
5067 \begin_inset Flex Code
5070 \begin_layout Plain Layout
5076 acts in some ways just like
5077 \begin_inset Flex MenuItem
5080 \begin_layout Plain Layout
5086 and permits you to bind keys to accented characters.
5087 You can also turn keys into dead-keys by binding them to something like
5089 \begin_inset Flex Code
5092 \begin_layout Plain Layout
5098 and then binding this symbolic key to the corresponding LyX command.
5102 \begin_layout Plain Layout
5107 : This is exactly what I do in my
5108 \begin_inset Flex Code
5111 \begin_layout Plain Layout
5118 \begin_inset Flex Code
5121 \begin_layout Plain Layout
5129 \begin_inset Flex MenuItem
5132 \begin_layout Plain Layout
5134 \begin_inset space ~
5143 \begin_inset Flex Code
5146 \begin_layout Plain Layout
5152 and a bunch of these
5153 \begin_inset Quotes eld
5157 \begin_inset Flex Code
5160 \begin_layout Plain Layout
5167 \begin_inset Quotes erd
5170 symbolic keys bound such things as
5171 \begin_inset Flex MenuItem
5174 \begin_layout Plain Layout
5176 \begin_inset space ~
5185 \begin_inset Flex MenuItem
5188 \begin_layout Plain Layout
5190 \begin_inset space ~
5199 This is how I produce my accented characters.
5204 You can make just about anything into the
5205 \begin_inset Flex Code
5208 \begin_layout Plain Layout
5215 \begin_inset Flex MenuItem
5218 \begin_layout Plain Layout
5224 keys, a spare function key, etc.
5225 As for the LyX commands that produce accents, check the entry for
5226 \begin_inset Flex Code
5229 \begin_layout Plain Layout
5240 You'll find the complete list there.
5243 \begin_layout Subsection
5244 Saving your Language Configuration
5247 \begin_layout Standard
5248 You can edit your preferences so that your desired language environment
5249 is automatically configured when LyX starts up, via the
5250 \begin_inset Flex MenuItem
5253 \begin_layout Plain Layout
5254 Edit\SpecialChar \menuseparator
5263 \begin_layout Chapter
5264 Installing New Document Classes, Layouts, and Templates
5265 \begin_inset CommandInset label
5267 name "cha:Installing-New-Document"
5272 \begin_inset Argument
5275 \begin_layout Plain Layout
5276 Installing New Document Classes
5284 \begin_layout Standard
5285 In this chapter, we describe the procedures for creating and installing
5286 new LyX layout and template files, as well as offer a refresher on correctly
5287 installing new LaTeX document classes.
5291 \begin_layout Standard
5292 First, let us a say a few words about how one ought to think about the relation
5293 between LyX and LaTeX.
5294 The thing to understand is that, in a certain sense, LyX doesn't know anything
5296 Indeed, from LyX's point of view, LaTeX is just one of several
5297 \begin_inset Quotes eld
5301 \begin_inset Quotes erd
5304 in which it is capable of producing output.
5305 Other such formats are DocBook, plaintext, and XHTML.
5306 LaTeX is, of course, a particularly important format, but very little of
5307 the information LyX has about LaTeX is actually contained in the program
5312 \begin_layout Plain Layout
5313 Some commands are sufficiently complex that they are
5314 \begin_inset Quotes eld
5318 \begin_inset Quotes erd
5322 But the developers generally regard this as a Bad Thing.
5327 Rather, that information, even for the standard classes like
5328 \begin_inset Flex Code
5331 \begin_layout Plain Layout
5337 , is contained in `layout files'.
5338 Similarly, LyX itself does not know much about DocBook or XHTML.
5339 What it knows is contained in layout files.
5342 \begin_layout Standard
5343 You can think of the layout file for a given document class as a translation
5344 manual between LyX constructs---paragraphs with their corresponding styles,
5345 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5347 Almost everything LyX knows about
5348 \begin_inset Flex Code
5351 \begin_layout Plain Layout
5357 , for example, is contained in the file
5358 \begin_inset Flex Code
5361 \begin_layout Plain Layout
5367 and in various other files it includes.
5368 For this reason, anyone intending to write layout files should plan to
5369 study the existing files.
5370 A good place to start is with
5371 \begin_inset Flex Code
5374 \begin_layout Plain Layout
5380 , which is included in
5381 \begin_inset Flex Code
5384 \begin_layout Plain Layout
5391 \begin_inset Flex Code
5394 \begin_layout Plain Layout
5400 , and many of the other layout files for document classes.
5401 This file is where sections and the like are defined:
5402 \begin_inset Flex Code
5405 \begin_layout Plain Layout
5411 tells LyX how paragraphs that are marked with the Section, Subsection,
5412 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5415 \begin_inset Flex Code
5418 \begin_layout Plain Layout
5424 file basically just includes several of these
5425 \begin_inset Flex Code
5428 \begin_layout Plain Layout
5437 \begin_layout Standard
5438 Defining the LyX--LaTeX correspondence is not the only thing layout files
5440 Their other job is to define how the LyX constructs themselves will appear
5442 The fact that layout files have these two jobs is often a source of confusion,
5443 because they are completely separate.
5444 Telling LyX how to translate a certain paragraph style into LaTeX does
5445 not tell LyX how to display it; conversely, telling LyX how to display
5446 a certain paragraph style does not tell LyX how to translate it into LaTeX
5447 (let alone tell LaTeX how to display it).
5448 So, in general, when you define a new LyX construct, you must always do
5449 two quite separate things: (i)
5450 \begin_inset space ~
5453 tell LyX how to translate it into LaTeX and (ii)
5454 \begin_inset space ~
5457 tell LyX how to display it.
5460 \begin_layout Standard
5461 Much the same is true, of course, as regards LyX's other backend formats,
5462 though XHTML is in some ways different, because in that case LyX
5466 able, to some extent, to use information about how it should display a
5467 paragraph on the screen to output information (in the form of CSS) about
5468 how the paragraph should be displayed in a browser.
5469 Even in this case, however, the distinction between what LyX does internally
5470 and how things are rendered externally remains in force, and the two can
5471 be controlled separately.
5473 \begin_inset CommandInset ref
5475 reference "sec:Tags-for-XHTML"
5482 \begin_layout Section
5483 Installing new LaTeX files
5486 \begin_layout Standard
5487 Some installations may not include a LaTeX package or class file that you
5488 would like to use within LyX.
5489 For example, you might need FoilTeX, a package for preparing slides for
5490 overhead projectors.
5491 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5492 a user interface for installing such packages.
5493 For example, with MiKTeX, you start the program
5494 \begin_inset Quotes eld
5498 \begin_inset space ~
5502 \begin_inset Quotes erd
5505 to get a list of available packages.
5506 To install one of them, right click on it or use the corresponding toolbar
5510 \begin_layout Standard
5511 If your LaTeX distribution does not provide such a `package manager', or
5512 if the package is not available from your distribution, then follow these
5513 steps to install it manually:
5516 \begin_layout Enumerate
5517 Get the package from
5518 \begin_inset CommandInset href
5521 target "http://www.ctan.org/"
5528 \begin_layout Enumerate
5529 If the package contains a file with the ending
5530 \begin_inset Quotes eld
5534 \begin_inset Flex Code
5537 \begin_layout Plain Layout
5544 \begin_inset Quotes erd
5547 (is the case for FoilTeX) then open a console, change to the folder of
5548 this file and execute the command
5549 \begin_inset Flex Code
5552 \begin_layout Plain Layout
5559 You have now unpacked the package and have all files to install it.
5560 Most LaTeX-packages are not packed and you can skip this step.
5563 \begin_layout Enumerate
5564 Now you need to decide if the package should be available for all users
5569 \begin_layout Enumerate
5570 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5571 for all users on your system, then install it in your `local' TeX tree,
5572 otherwise install it in your own `user' TeX tree.
5573 Where these trees should be created, if they do not already exist, depends
5575 To find this out, look in the file
5576 \begin_inset Flex Code
5579 \begin_layout Plain Layout
5589 \begin_layout Plain Layout
5590 This is usually in the directory
5591 \begin_inset Flex Code
5594 \begin_layout Plain Layout
5600 , though you can execute the command
5601 \begin_inset Flex Code
5604 \begin_layout Plain Layout
5615 The location of the `local' TeX tree is defined by the
5616 \begin_inset Flex Code
5619 \begin_layout Plain Layout
5625 variable; this is usually somewhere like
5626 \begin_inset Flex Code
5629 \begin_layout Plain Layout
5630 /usr/local/share/texmf
5636 The location of the `user' TeX tree is defined by
5637 \begin_inset Flex Code
5640 \begin_layout Plain Layout
5647 \begin_inset Flex Code
5650 \begin_layout Plain Layout
5657 (If these variables are not predefined, you have to define them.) You'll
5658 probably need root permissions to create or modify the `local' tree, but
5659 not for your `user' tree.
5660 \begin_inset Newline newline
5663 In general, it is recommended to install in the user tree because your user
5664 will not be modified or even overwritten when you upgrade your system.
5665 It will typically also be backed up together with everything else when
5666 you backup your home directory (which, of course, you do on a regular basis).
5669 \begin_layout Enumerate
5670 On Windows, if you want the new package to be available for all users on
5671 your system, change to the folder where LaTeX is installed and then change
5673 \begin_inset Flex Code
5676 \begin_layout Plain Layout
5687 (For MiKTeX, this would be by default the folder
5688 \begin_inset Flex Code
5691 \begin_layout Plain Layout
5709 \begin_layout Plain Layout
5710 Note that this will be the correct path only on English installations.
5711 On a German one, it would be
5712 \begin_inset Flex Code
5715 \begin_layout Plain Layout
5729 , and similarly for other languages.
5734 Create there a new folder
5735 \begin_inset Flex Code
5738 \begin_layout Plain Layout
5744 and copy all files of the package into it.
5746 \begin_inset Newline newline
5749 If the package should only available for you or you don't have admin permissions
5750 , do the same, but in the local LaTeX folder.
5752 \begin_inset space \thinspace{}
5756 \begin_inset space ~
5759 2.8 under Windows XP, this would be the folder:
5760 \begin_inset Newline newline
5766 \begin_inset Flex Code
5769 \begin_layout Plain Layout
5772 Documents and Settings
5784 \begin_inset Newline newline
5790 \begin_inset Phantom HPhantom
5793 \begin_layout Plain Layout
5804 \begin_inset Flex Code
5807 \begin_layout Plain Layout
5820 \begin_inset Newline newline
5823 On Vista, it would be:
5824 \begin_inset Newline newline
5828 \begin_inset Flex Code
5831 \begin_layout Plain Layout
5857 \begin_layout Enumerate
5858 Now one only need to tell LaTeX that there are new files.
5859 This depends on the used LaTeX-Distribution:
5863 \begin_layout Enumerate
5864 For TeXLive execute the command
5865 \begin_inset Flex Code
5868 \begin_layout Plain Layout
5875 If you installed the package for all users, then you will probably need
5876 to have root permissions for that.
5879 \begin_layout Enumerate
5880 For MiKTeX, if you have installed the package for all users, start the program
5882 \begin_inset Quotes eld
5886 \begin_inset space ~
5890 \begin_inset Quotes erd
5893 and press the button marked
5894 \begin_inset Quotes eld
5898 \begin_inset Quotes erd
5902 Otherwise start the program
5903 \begin_inset Quotes eld
5907 \begin_inset Quotes erd
5914 \begin_layout Enumerate
5915 Finally, you need to tell LyX that there are new packages available.
5916 So, in LyX, use the menu
5917 \begin_inset Flex MenuItem
5920 \begin_layout Plain Layout
5923 \SpecialChar \menuseparator
5929 and then restart LyX.
5932 \begin_layout Standard
5933 Now the package is installed.
5934 In our example, the document class
5935 \begin_inset Flex Code
5938 \begin_layout Plain Layout
5940 \begin_inset space ~
5947 \begin_layout Plain Layout
5959 will now be available under
5960 \begin_inset Flex MenuItem
5963 \begin_layout Plain Layout
5964 Document\SpecialChar \menuseparator
5965 Settings\SpecialChar \menuseparator
5975 \begin_layout Standard
5976 If you would like to use a LaTeX document class that is not even listed
5978 \begin_inset Flex MenuItem
5981 \begin_layout Plain Layout
5982 Document\SpecialChar \menuseparator
5983 Settings\SpecialChar \menuseparator
5989 , then you need to create a `layout' file for it.
5990 That is the topic of the next section.
5993 \begin_layout Section
5994 Types of layout files
5997 \begin_layout Standard
5998 This section describes the various sorts of LyX files that contain layout
6000 These files describe various paragraph and character styles, determining
6001 how LyX should display them and how they should be translated into LaTeX,
6002 DocBook, XHTML, or whatever output format is being used.
6006 \begin_layout Standard
6007 We shall try to provide a thorough description of the process of writing
6009 However, there are so many different types of documents supported even
6010 by just LaTeX that we can't hope to cover every different possibility or
6011 problem you might encounter.
6012 The LyX users' list is frequented by people with lots of experience with
6013 layout design who are willing to share what they've learned, so please
6014 feel free to ask questions there.
6017 \begin_layout Standard
6018 As you prepare to write a new layout, it is extremely helpful to look at
6019 the layouts distributed with LyX.
6020 If you write a LyX layout for a LaTeX document class that might also be
6021 used by others, or write a module that might be useful to others, then
6022 you should consider posting your layout to the
6023 \begin_inset CommandInset href
6025 name "layout section on the LyX wiki"
6026 target "http://wiki.lyx.org/Layouts/Layouts"
6030 or even to the LyX developers' list, so that it might be included in LyX
6035 \begin_layout Plain Layout
6036 Note that LyX is licensed under the General Public License, so any material
6037 that is contributed to LyX must be similarly licensed.
6045 \begin_layout Subsection
6047 \begin_inset CommandInset label
6049 name "sub:Layout-modules"
6056 \begin_layout Standard
6057 We have spoken to this point about `layout files'.
6058 But there are different sorts of files that contain layout information.
6059 Layout files, strictly so called, have the
6060 \begin_inset Flex Code
6063 \begin_layout Plain Layout
6069 extension and provide LyX with information about document classes.
6070 As of LyX 1.6, however, layout information can also be contained in layout
6076 \begin_inset Flex Code
6079 \begin_layout Plain Layout
6086 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6087 some modules—such as the
6088 \begin_inset Flex Code
6091 \begin_layout Plain Layout
6097 module—specifically provide support for one package.
6098 In a sense, layout modules are similar to included
6102 \begin_layout Plain Layout
6103 These can have any extension, but by convention have the
6104 \begin_inset Flex Code
6107 \begin_layout Plain Layout
6119 \begin_inset Flex Code
6122 \begin_layout Plain Layout
6128 —in that modules are not specific to a given document class but may be used
6129 with many different classes.
6130 The difference is that using an included file with
6131 \begin_inset Flex Code
6134 \begin_layout Plain Layout
6140 requires editing that file.
6141 Modules, by contrast, are selected in the
6142 \begin_inset Flex MenuItem
6145 \begin_layout Plain Layout
6146 Document\SpecialChar \menuseparator
6155 \begin_layout Standard
6156 Building modules is the easiest way to get started with layout editing,
6157 since it can be as simple as adding a single new paragraph style or flex
6159 But modules may, in principle, contain anything a layout file can contain.
6162 \begin_layout Standard
6163 After creating a new module and copying it to the
6164 \begin_inset Flex Code
6167 \begin_layout Plain Layout
6173 folder, you will need to reconfigure and then restart LyX for the module
6174 to appear in the menu.
6175 However, changes you make to the module will be seen immediately, if you
6177 \begin_inset Flex MenuItem
6180 \begin_layout Plain Layout
6181 Document\SpecialChar \menuseparator
6187 , highlight something, and then hit
6188 \begin_inset Quotes eld
6192 \begin_inset Quotes erd
6198 It is strongly recommended that you save your work before doing this
6203 it is strongly recommended that you not attempt to edit modules while simultaneo
6204 usly working on actual documents
6207 Though of course the developers strive to keep LyX stable in such situations,
6208 syntax errors and the like in your module file could cause strange behavior.
6209 \change_inserted 1414654397 1302962370
6213 \begin_layout Subsubsection
6215 \change_inserted 1414654397 1302962375
6219 \begin_layout Standard
6221 \change_inserted 1414654397 1302962524
6222 Modules are to LyX as packages are to LaTeX.
6223 Sometimes, however, you find yourself wanting a specific inset or character
6224 style just for one document and writing a module that will also be available
6225 to other documents makes little sense.
6226 What you need is LyX's
6227 \begin_inset Quotes eld
6231 \begin_inset Quotes erd
6237 \begin_layout Standard
6239 \change_inserted 1414654397 1302963263
6240 You will find it under
6242 Document\SpecialChar \menuseparator
6243 Settings\SpecialChar \menuseparator
6247 The large text box allows you to enter anything that you might enter in
6248 a layout file or module.
6249 You can think of a document's local layout, in fact, as a module that belongs
6251 So, in particular, you must enter a
6252 \begin_inset Flex Code
6255 \begin_layout Plain Layout
6257 \change_inserted 1414654397 1302962556
6266 Any format is acceptable, but one would normally use the format current
6268 (In LyX 2.0, the current layout format is 35.) You should be aware that local
6269 layout is not supported by versions of LyX prior to 1.6, so you should not
6270 use it if you want to be able to export your document to LyX 1.5 or earlier
6271 (without, that is, losing the local layout information).
6272 If you wish to be able to export to 1.6---local layout is supported in 1.6,
6273 though there is no UI for it---then you should use format 11 and, of course,
6274 use only layout constructs that were available in LyX 1.6.
6277 \begin_layout Standard
6279 \change_inserted 1414654397 1302963275
6280 When you have entered something in the
6281 \begin_inset Flex Code
6284 \begin_layout Plain Layout
6286 \change_inserted 1414654397 1302963275
6294 pane, LyX will enable the
6295 \begin_inset Quotes eld
6299 \begin_inset Quotes erd
6302 button at the bottom.
6303 Clicking this button will cause LyX to determine whether what you have
6304 entered is valid layout information for the chosen format.
6305 LyX will report the result but, unfortunately, will not tell you what errors
6306 there might have been.
6307 These will be written to the terminal, however, if LyX is started from
6309 You will not be permitted to save your local layout until you have entered
6313 \begin_layout Standard
6315 \change_inserted 1414654397 1302963364
6316 The warnings at the end of the previous section apply here, too.
6317 Do not play with local layout while you are actually working, especially
6318 if you have not saved your document.
6319 That said, using local layout with a test document can be a very convenient
6320 way to try out layout ideas, or even to start developing a module.
6325 \begin_layout Subsection
6327 \begin_inset Flex MenuItem
6330 \begin_layout Plain Layout
6339 \begin_layout Standard
6340 There are two situations you are likely to encounter when wanting to support
6341 a new LaTeX document class, involving style (
6342 \begin_inset Flex Code
6345 \begin_layout Plain Layout
6351 ) files and LaTeX2e class (
6352 \begin_inset Flex Code
6355 \begin_layout Plain Layout
6362 Supporting a style file is usually fairly easy.
6363 Supporting a new class file is a bit harder.
6364 We'll discuss the former in this section and the latter in the next.
6365 Similar remarks apply, of course, if you want to support a new DocBook
6369 \begin_layout Standard
6370 The easier case is the one in which your new document class is provided
6371 as a style file that is to be used in conjunction with an already supported
6373 For the sake of the example, we'll assume that the style file is called
6375 \begin_inset Flex MenuItem
6378 \begin_layout Plain Layout
6384 and that it is meant to be used with
6385 \begin_inset Flex MenuItem
6388 \begin_layout Plain Layout
6394 , which is a standard class.
6398 \begin_layout Standard
6399 Start by copying the existing class's layout file into your local directory:
6403 \begin_layout Plain Layout
6404 Of course, which directory is your local directory will vary by platform,
6405 and LyX allows you to specify your local directory on startup, too, using
6407 \begin_inset Flex Code
6410 \begin_layout Plain Layout
6424 \begin_layout LyX-Code
6425 cp report.layout ~/.lyx/layouts/myclass.layout
6428 \begin_layout Standard
6430 \begin_inset Flex Code
6433 \begin_layout Plain Layout
6439 and change the line:
6442 \begin_layout LyX-Code
6445 DeclareLaTeXClass{report}
6448 \begin_layout Standard
6452 \begin_layout LyX-Code
6455 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6458 \begin_layout Standard
6462 \begin_layout LyX-Code
6464 \begin_inset Newline newline
6470 \begin_inset Newline newline
6476 \begin_layout Standard
6477 near the top of the file.
6480 \begin_layout Standard
6481 Start LyX and select
6482 \begin_inset Flex MenuItem
6485 \begin_layout Plain Layout
6486 Tools\SpecialChar \menuseparator
6493 Then restart LyX and try creating a new document.
6495 \begin_inset Flex MenuItem
6498 \begin_layout Plain Layout
6504 " as a document class option in the
6505 \begin_inset Flex MenuItem
6508 \begin_layout Plain Layout
6509 Document\SpecialChar \menuseparator
6516 It is likely that some of the sectioning commands and such in your new
6517 class will work differently from how they worked in the base class—
6518 \begin_inset Flex Code
6521 \begin_layout Plain Layout
6527 in this example—so you can fiddle around with the settings for the different
6528 sections if you wish.
6529 The layout information for sections is contained in
6530 \begin_inset Flex Code
6533 \begin_layout Plain Layout
6539 , but you do not need to copy and change this file.
6540 Instead, you can simply add your changes to your layout file, after the
6542 \begin_inset Flex Code
6545 \begin_layout Plain Layout
6551 , which itself includes
6552 \begin_inset Flex Code
6555 \begin_layout Plain Layout
6562 For example, you might add these lines:
6565 \begin_layout LyX-Code
6569 \begin_layout LyX-Code
6573 \begin_layout LyX-Code
6577 \begin_layout LyX-Code
6581 \begin_layout LyX-Code
6585 \begin_layout Standard
6586 to change the font for chapter headings to sans-serif.
6587 This will override (or, in this case, add to) the existing declaration
6588 for the Chapter style.
6592 \begin_layout Standard
6593 Your new package may also provide commands or environments not present in
6595 In this case, you will want to add these to the layout file.
6597 \begin_inset CommandInset ref
6599 reference "sec:TextClass"
6603 for information on how to do so.
6606 \begin_layout Standard
6608 \begin_inset Flex MenuItem
6611 \begin_layout Plain Layout
6617 can be used with several different document classes, and even if it cannot,
6618 you might find it easiest just to write a module that you can load with
6620 The simplest possible such module would be:
6623 \begin_layout LyX-Code
6626 DeclareLyXModule{My Package}
6629 \begin_layout LyX-Code
6633 \begin_layout LyX-Code
6634 #Support for mypkg.sty.
6637 \begin_layout LyX-Code
6639 \begin_inset Newline newline
6645 \begin_layout LyX-Code
6647 \begin_inset Newline newline
6653 \begin_layout LyX-Code
6655 \begin_inset Newline newline
6661 \begin_inset Newline newline
6667 \begin_layout Standard
6668 A more complex module might modify the behavior of some existing constructs
6669 or define some new ones.
6671 \begin_inset CommandInset ref
6673 reference "sec:TextClass"
6680 \begin_layout Subsection
6682 \begin_inset Flex MenuItem
6685 \begin_layout Plain Layout
6694 \begin_layout Standard
6695 There are two possibilities here.
6696 One is that the class file is itself based upon an existing document class.
6697 For example, many thesis classes are based upon
6698 \begin_inset Flex MenuItem
6701 \begin_layout Plain Layout
6708 To see whether yours is, look for a line like
6711 \begin_layout LyX-Code
6717 \begin_layout Standard
6719 If so, then you may proceed largely as in the previous section, though
6721 \begin_inset Flex Code
6724 \begin_layout Plain Layout
6730 line will be different.
6731 If your new class is
6732 \begin_inset Flex Code
6735 \begin_layout Plain Layout
6741 and it is based upon
6742 \begin_inset Flex Code
6745 \begin_layout Plain Layout
6751 , then the line should read:
6755 \begin_layout Plain Layout
6756 And it will be easiest if you save the file to
6757 \begin_inset Flex Code
6760 \begin_layout Plain Layout
6766 : LyX assumes that the document class has the same name as the layout file.
6775 \begin_layout LyX-Code
6778 DeclareLaTeXClass[thesis,book]{thesis}
6781 \begin_layout Standard
6782 If, on the other hand, the new class is not based upon an existing class,
6783 you will probably have to
6784 \begin_inset Quotes eld
6788 \begin_inset Quotes erd
6792 We strongly suggest copying an existing layout file which uses a similar
6793 LaTeX class and then modifying it, if you can do so.
6794 At least use an existing file as a starting point so you can find out what
6795 items you need to worry about.
6796 Again, the specifics are covered below.
6799 \begin_layout Subsection
6801 \begin_inset CommandInset label
6803 name "sub:Creating-Templates"
6810 \begin_layout Standard
6811 Once you have written a layout file for a new document class, you might
6812 want to consider writing a
6817 A template acts as a kind of tutorial for your layout, showing how it might
6818 be used, though containing dummy content.
6819 You can of course look at the various templates included with LyX for ideas.
6822 \begin_layout Standard
6823 Templates are created just like usual documents: using LyX.
6824 The only difference is that usual documents contain all possible settings,
6825 including the font scheme and the paper size.
6826 Usually a user doesn't want a template to overwrite his preferred settings
6827 for such parameters.
6828 For that reason, the designer of a template should remove the corresponding
6830 \begin_inset Flex Code
6833 \begin_layout Plain Layout
6842 \begin_inset Flex Code
6845 \begin_layout Plain Layout
6853 from the template LyX file.
6854 This can be done with any simple text-editor, for example
6855 \begin_inset Flex Code
6858 \begin_layout Plain Layout
6865 \begin_inset Flex Code
6868 \begin_layout Plain Layout
6878 \begin_layout Standard
6879 Put the edited template files you create in
6880 \begin_inset Flex Code
6883 \begin_layout Plain Layout
6889 , copy the ones you use from the global template directory in
6890 \begin_inset Flex Code
6893 \begin_layout Plain Layout
6899 to the same place, and redefine the template path in the
6900 \begin_inset Flex MenuItem
6903 \begin_layout Plain Layout
6904 Tools\SpecialChar \menuseparator
6905 Preferences\SpecialChar \menuseparator
6914 \begin_layout Standard
6915 Note, by the way, that there is a template which has a particular meaning:
6917 \begin_inset Flex Code
6920 \begin_layout Plain Layout
6927 This template is loaded every time you create a new document with
6928 \begin_inset Flex MenuItem
6931 \begin_layout Plain Layout
6932 File\SpecialChar \menuseparator
6938 in order to provide useful defaults.
6939 To create this template from inside LyX, all you have to do is to open
6940 a document with the correct settings, and use the
6941 \begin_inset Flex MenuItem
6944 \begin_layout Plain Layout
6945 Save as Document Defaults
6953 \begin_layout Subsection
6954 Upgrading old layout files
6957 \begin_layout Standard
6958 The format of layout files changes with each LyX release, so old layout
6959 files need to be converted to the new format.
6960 This process has been automated since LyX 1.4: If LyX reads a layout file
6961 in an older format, it automatically calls the script
6962 \begin_inset Flex Code
6965 \begin_layout Plain Layout
6971 to convert it to a temporary file in current format.
6972 The original file is left untouched.
6973 If you use the layout file often, then, you may want to convert it permanently,
6974 so that LyX does not have to do so itself every time.
6975 To do this, you can call the converter manually:
6978 \begin_layout LyX-Code
6979 mv myclass.layout myclass.old
6982 \begin_layout LyX-Code
6983 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6986 \begin_layout Standard
6988 \begin_inset Flex Code
6991 \begin_layout Plain Layout
6997 with the name of your LyX system directory, of course.
7000 \begin_layout Standard
7001 Note that manual conversion does not affect included files, so these will
7002 have to be converted separately.
7005 \begin_layout Section
7006 \begin_inset CommandInset label
7008 name "sec:TextClass"
7012 The layout file format
7015 \begin_layout Standard
7016 When it's finally time to get your hands dirty and create or edit your own
7017 layout file, the following sections describe what you're up against.
7018 Our advice is to go slowly, save and test often, listen to soothing music,
7019 and enjoy one or two of your favorite adult beverages; more if you are
7020 getting particularly stuck.
7021 It's really not that hard, except that the multitude of options can become
7022 overwhelming if you try to do too much in one sitting.
7023 Go have another adult beverage, just for good measure.
7026 \begin_layout Standard
7027 Note that all the tags used in layout files are case-insensitive.
7029 \begin_inset Flex Code
7032 \begin_layout Plain Layout
7039 \begin_inset Flex Code
7042 \begin_layout Plain Layout
7049 \begin_inset Flex Code
7052 \begin_layout Plain Layout
7058 are really the same tag.
7059 The possible values are printed in brackets after the feature's name.
7060 The default value if a feature isn't specified inside a text class-description
7062 \begin_inset Flex Code
7065 \begin_layout Plain Layout
7074 If the argument has a data type like
7075 \begin_inset Quotes eld
7079 \begin_inset Quotes erd
7083 \begin_inset Quotes eld
7087 \begin_inset Quotes erd
7090 , the default is shown like this:
7091 \begin_inset Flex Code
7094 \begin_layout Plain Layout
7105 \begin_layout Subsection
7106 The document class declaration
7109 \begin_layout Standard
7110 Lines in a layout file which begin with
7111 \begin_inset Flex Code
7114 \begin_layout Plain Layout
7121 There is one exception to this rule.
7123 \begin_inset Flex Code
7126 \begin_layout Plain Layout
7132 files should begin with a line like:
7135 \begin_layout LyX-Code
7138 #% Do not delete the line below; configure depends on this
7141 \begin_layout LyX-Code
7146 DeclareLaTeXClass{article}
7149 \begin_layout Standard
7150 The second line is used when you (re)configure LyX.
7151 The layout file is read by the LaTeX script
7152 \begin_inset Flex Code
7155 \begin_layout Plain Layout
7161 , in a special mode where
7162 \begin_inset Flex Code
7165 \begin_layout Plain Layout
7172 The first line is just a LaTeX comment, and the second one contains the
7173 declaration of the text class.
7174 If these lines appear in a file named
7175 \begin_inset Flex Code
7178 \begin_layout Plain Layout
7184 , then they define a text class of name
7185 \begin_inset Flex Code
7188 \begin_layout Plain Layout
7194 (the name of the layout file) which uses the LaTeX document class
7195 \begin_inset Flex Code
7198 \begin_layout Plain Layout
7204 (the default is to use the same name as the layout).
7206 \begin_inset Quotes eld
7210 \begin_inset Quotes erd
7213 that appears above is used as a description of the text class in the
7214 \begin_inset Flex MenuItem
7217 \begin_layout Plain Layout
7218 Document\SpecialChar \menuseparator
7227 \begin_layout Standard
7228 Let's assume that you wrote your own text class that uses the
7229 \begin_inset Flex Code
7232 \begin_layout Plain Layout
7238 document class, but where you changed the appearance of the section headings.
7239 If you put it in a file
7240 \begin_inset Flex Code
7243 \begin_layout Plain Layout
7249 , the header of this file should be:
7252 \begin_layout LyX-Code
7255 #% Do not delete the line below; configure depends on this
7258 \begin_layout LyX-Code
7263 DeclareLaTeXClass[article]{article (with my own headings)}
7266 \begin_layout Standard
7267 This declares a text class
7268 \begin_inset Flex Code
7271 \begin_layout Plain Layout
7277 , associated with the LaTeX document class
7278 \begin_inset Flex Code
7281 \begin_layout Plain Layout
7288 \begin_inset Quotes eld
7291 article (with my own headings)
7292 \begin_inset Quotes erd
7296 If your text class depends on several packages, you can declare it as:
7299 \begin_layout LyX-Code
7302 #% Do not delete the line below; configure depends on this
7305 \begin_layout LyX-Code
7310 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7313 \begin_layout Standard
7314 This indicates that your text class uses the
7315 \begin_inset Flex Code
7318 \begin_layout Plain Layout
7325 Finally, it is also possible to declare classes for DocBook code.
7326 Typical declarations will look like:
7329 \begin_layout LyX-Code
7332 #% Do not delete the line below; configure depends on this
7335 \begin_layout LyX-Code
7340 DeclareDocBookClass[article]{SGML (DocBook article)}
7343 \begin_layout Standard
7344 Note that these declarations can also be given an optional parameter declaring
7345 the name of the document class (but not a list).
7348 \begin_layout Standard
7349 So, to be as explicit as possible, the form of the layout declaration is:
7352 \begin_layout LyX-Code
7357 DeclareLaTeXClass[class,package.sty]{layout description}
7360 \begin_layout Standard
7361 The class need only be specified if the name of the LaTeX class file and
7362 the name of the layout file are different or if there are packages to load.
7363 If the name of the class file is not specified, then LyX will simply assume
7364 that it is the same as the name of the layout file.
7367 \begin_layout Standard
7368 When the text class has been modified to your taste, all you have to do
7369 is to copy it either to
7370 \begin_inset Flex Code
7373 \begin_layout Plain Layout
7380 \begin_inset Flex Code
7383 \begin_layout Plain Layout
7390 \begin_inset Flex MenuItem
7393 \begin_layout Plain Layout
7394 Tools\SpecialChar \menuseparator
7400 , exit LyX and restart.
7401 Then your new text class should be available along with the others.
7404 \begin_layout Standard
7405 Once the layout file is installed, you can edit it and see your changes
7406 without having to reconfigure or to restart LyX.
7411 \begin_layout Plain Layout
7412 In versions of LyX prior to 1.6, this was not true.
7413 As a result, editing layout files was very time consuming, since you had
7414 constantly to restart LyX to see changes.
7419 You can force a reload of the current layout by using the LyX function
7421 \begin_inset Flex MenuItem
7424 \begin_layout Plain Layout
7431 There is no default binding for this function—though, of course, you can
7432 bind it to a key yourself.
7433 But you will normally use this function simply by entering it in the mini-buffe
7438 \begin_layout Standard
7444 \begin_inset Flex MenuItem
7447 \begin_layout Plain Layout
7453 is very much an `advanced feature'.
7458 recommended that you save your work before using this function.
7463 recommended that you not attempt to edit layout information while simultaneousl
7464 y working on a document that you care about.
7465 Use a test document.
7466 Syntax errors and the like in your layout file could cause peculiar behavior.
7467 In particular, such errors could cause LyX to regard the current layout
7468 as invalid and to attempt to switch to some other layout.
7472 \begin_layout Plain Layout
7473 Really bad syntax errors may even caused LyX to exit.
7474 This is because certain sorts of errors may make LyX unable to read
7484 The LyX team strives to keep LyX stable in such situations, but safe is
7489 \begin_layout Plain Layout
7490 While we're giving advice: make regular backups.
7491 And be nice to your mother.
7499 \begin_layout Subsection
7500 The Module declaration
7503 \begin_layout Standard
7504 A module must begin with a line like the following:
7507 \begin_layout LyX-Code
7510 DeclareLyXModule[endnotes.sty]{Endnotes}
7513 \begin_layout Standard
7514 The mandatory argument, in curly brackets, is the name of the module, as
7516 \begin_inset Flex MenuItem
7519 \begin_layout Plain Layout
7520 Document\SpecialChar \menuseparator
7521 Settings\SpecialChar \menuseparator
7528 The argument in square brackets is optional: It declares any LaTeX packages
7529 on which the module depends.
7530 Please note that only packages about which LyX knows should be listed in
7531 the square brackets.
7535 \begin_layout Plain Layout
7536 The list of such packages is documented only in the source code.
7541 LyX will not check for arbitrary packages.
7542 It is also possible to use the form
7543 \begin_inset Flex MenuItem
7546 \begin_layout Plain Layout
7552 as an optional argument, which declares that the module can only be used
7553 when there exists a conversion chain between the formats `
7554 \begin_inset Flex Code
7557 \begin_layout Plain Layout
7564 \begin_inset Flex Code
7567 \begin_layout Plain Layout
7576 \begin_layout Standard
7577 The module declaration should then be followed by lines like the following
7581 \begin_layout Plain Layout
7582 Preferably in English if the module should be published with LyX.
7583 This description will appear in the list of messages to be translated and
7584 will be thus translated with the next interface update.
7592 \begin_layout LyX-Code
7596 \begin_layout LyX-Code
7597 #Adds an endnote command, in addition to footnotes.
7601 \begin_layout LyX-Code
7602 #You will need to add
7604 theendnotes in TeX code where you
7607 \begin_layout LyX-Code
7608 #want the endnotes to appear.
7612 \begin_layout LyX-Code
7616 \begin_layout LyX-Code
7617 #Requires: somemodule | othermodule
7620 \begin_layout LyX-Code
7621 #Excludes: badmodule
7624 \begin_layout Standard
7625 The description is used in
7626 \begin_inset Flex MenuItem
7629 \begin_layout Plain Layout
7630 Document\SpecialChar \menuseparator
7631 Settings\SpecialChar \menuseparator
7637 to provide the user with information about what the module does.
7639 \begin_inset Flex Code
7642 \begin_layout Plain Layout
7648 line is used to identify other modules with which this one must be used;
7650 \begin_inset Flex Code
7653 \begin_layout Plain Layout
7659 line is used to identify modules with which this one may not be used.
7660 Both are optional, and, as shown, multiple modules should be separated
7661 with the pipe symbol: |.
7662 Note that the required modules are treated disjunctively:
7666 of the required modules must be used.
7671 excluded module may be used.
7672 Note that modules are identified here by their
7677 \begin_inset Flex Code
7680 \begin_layout Plain Layout
7688 \begin_inset Flex Code
7691 \begin_layout Plain Layout
7698 \begin_inset Flex Code
7701 \begin_layout Plain Layout
7710 \begin_layout Subsection
7714 \begin_layout Standard
7715 The first non-comment line of any layout file, included file, or module
7720 contain the file format number:
7723 \begin_layout Description
7724 \begin_inset Flex Code
7727 \begin_layout Plain Layout
7734 \begin_inset Flex Code
7737 \begin_layout Plain Layout
7743 ] The format of the layout file.
7746 \begin_layout Standard
7747 This tag was introduced with LyX 1.4.0.
7748 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7749 and are considered to be of format 1.
7750 The format for the present version of LyX is format 21.
7751 But each version of LyX is capable of reading earlier versions' layout
7752 files, just as they are capable of reading files produced by earlier versions
7754 There is, however, no provision for converting to earlier formats.
7755 So LyX 1.6.x will not read layout files in format 21 but only files in format
7759 \begin_layout Subsection
7760 \begin_inset CommandInset label
7762 name "sub:General-text-class"
7766 General text class parameters
7769 \begin_layout Standard
7770 These are general parameters that govern the behavior of an entire document
7776 mean that they must appear in
7777 \begin_inset Flex Code
7780 \begin_layout Plain Layout
7786 files rather than in modules.
7787 A module can contain any layout tag.)
7790 \begin_layout Description
7791 \begin_inset Flex Code
7794 \begin_layout Plain Layout
7800 Adds information that will be output in the
7801 \begin_inset Flex Code
7804 \begin_layout Plain Layout
7810 block when this document class is output to XHTML.
7811 Typically, this would be used to output CSS style information, but it can
7812 be used for anything that can appear in
7813 \begin_inset Flex Code
7816 \begin_layout Plain Layout
7824 \begin_inset Quotes eld
7828 \begin_inset Flex Code
7831 \begin_layout Plain Layout
7838 \begin_inset Quotes erd
7844 \begin_layout Description
7845 \begin_inset Flex Code
7848 \begin_layout Plain Layout
7854 Adds information to the document preamble.
7856 \begin_inset Quotes eld
7860 \begin_inset Flex Code
7863 \begin_layout Plain Layout
7870 \begin_inset Quotes erd
7876 \begin_layout Description
7877 \begin_inset Flex Code
7880 \begin_layout Plain Layout
7886 Defines formats for use in the display of bibliographic information.
7888 \begin_inset CommandInset ref
7890 reference "sub:Citation-format-description"
7896 \begin_inset Quotes eld
7900 \begin_inset Flex Code
7903 \begin_layout Plain Layout
7910 \begin_inset Quotes erd
7916 \begin_layout Description
7917 \begin_inset Flex Code
7920 \begin_layout Plain Layout
7926 Describes various global options supported by the document class.
7928 \begin_inset space ~
7932 \begin_inset CommandInset ref
7934 reference "sub:ClassOptions"
7940 \begin_inset Quotes eld
7944 \begin_inset Flex Code
7947 \begin_layout Plain Layout
7954 \begin_inset Quotes erd
7960 \begin_layout Description
7961 \begin_inset Flex Code
7964 \begin_layout Plain Layout
7971 \begin_inset Flex Code
7974 \begin_layout Plain Layout
7983 \begin_inset Flex Code
7986 \begin_layout Plain Layout
7992 ] Whether the class should
7996 to having one or two columns.
7997 Can be changed in the
7998 \begin_inset Flex MenuItem
8001 \begin_layout Plain Layout
8002 Document\SpecialChar \menuseparator
8011 \begin_layout Description
8012 \begin_inset Flex Code
8015 \begin_layout Plain Layout
8022 \begin_inset Flex Code
8025 \begin_layout Plain Layout
8031 ] This sequence defines the properties for a counter.
8032 If the counter does not yet exist, it is created; if it does exist, it
8035 \begin_inset Quotes eld
8039 \begin_inset Flex Code
8042 \begin_layout Plain Layout
8049 \begin_inset Quotes erd
8053 \begin_inset Newline newline
8057 \begin_inset space ~
8061 \begin_inset CommandInset ref
8063 reference "sub:Counters"
8067 for details on counters.
8070 \begin_layout Description
8071 \begin_inset Flex Code
8074 \begin_layout Plain Layout
8080 Sets the default font used to display the document.
8082 \begin_inset space ~
8086 \begin_inset CommandInset ref
8088 reference "sub:Font-description"
8092 for how to declare fonts.
8094 \begin_inset Quotes eld
8098 \begin_inset Flex Code
8101 \begin_layout Plain Layout
8108 \begin_inset Quotes erd
8114 \begin_layout Description
8115 \begin_inset Flex Code
8118 \begin_layout Plain Layout
8125 \begin_inset Flex Code
8128 \begin_layout Plain Layout
8134 Specifies a module to be included by default with this document class.
8135 The module should be specified by filename without the
8136 \begin_inset Flex Code
8139 \begin_layout Plain Layout
8146 The user can still remove the module, but it will be active at the outset.
8147 (This applies only when new files are created, or when this class is chosen
8148 for an existing document.)
8151 \begin_layout Description
8152 \begin_inset Flex Code
8155 \begin_layout Plain Layout
8162 \begin_inset Flex Code
8165 \begin_layout Plain Layout
8171 ] This is the style that will be assigned to new paragraphs, usually
8172 \begin_inset Flex MenuItem
8175 \begin_layout Plain Layout
8182 This will default to the first defined style if not given, but you are
8183 encouraged to use this directive.
8186 \begin_layout Description
8187 \begin_inset Flex Code
8190 \begin_layout Plain Layout
8197 \begin_inset Flex Code
8200 \begin_layout Plain Layout
8206 ] This tag indicates that the module in question—which should be specified
8207 by filename without the
8208 \begin_inset Flex Code
8211 \begin_layout Plain Layout
8217 extension—cannot be used with this document class.
8218 This might be used in a journal-specific layout file to prevent, say, the
8220 \begin_inset Flex Code
8223 \begin_layout Plain Layout
8229 module that numbers theorems by section.
8234 be used in a module.
8235 Modules have their own way of excluding other modules (see
8236 \begin_inset CommandInset ref
8238 reference "sub:Layout-modules"
8245 \begin_layout Description
8246 \begin_inset Flex Code
8249 \begin_layout Plain Layout
8255 Defines a new float.
8257 \begin_inset space ~
8261 \begin_inset CommandInset ref
8263 reference "sub:Floats"
8269 \begin_inset Quotes eld
8273 \begin_inset Flex Code
8276 \begin_layout Plain Layout
8283 \begin_inset Quotes erd
8289 \begin_layout Description
8290 \begin_inset Flex Code
8293 \begin_layout Plain Layout
8299 Sets the information that will be output in the
8300 \begin_inset Flex Code
8303 \begin_layout Plain Layout
8309 block when this document class is output to XHTML.
8310 Note that this will completely override any prior
8311 \begin_inset Flex Code
8314 \begin_layout Plain Layout
8321 \begin_inset Flex Code
8324 \begin_layout Plain Layout
8332 \begin_inset Flex Code
8335 \begin_layout Plain Layout
8341 if you just want to add material to the preamble.) Must end with
8342 \begin_inset Quotes eld
8346 \begin_inset Flex Code
8349 \begin_layout Plain Layout
8356 \begin_inset Quotes erd
8362 \begin_layout Description
8363 \begin_inset Flex Code
8366 \begin_layout Plain Layout
8373 \begin_inset Flex Code
8376 \begin_layout Plain Layout
8382 ] The layout to use for the table of contents, bibliography, and so forth,
8383 when the document is output to HTML.
8384 For articles, this should normally be Section; for books, Chapter.
8385 If it is not given, then LyX will attempt to figure out which layout to
8389 \begin_layout Description
8390 \begin_inset Flex Code
8393 \begin_layout Plain Layout
8400 \begin_inset Flex Code
8403 \begin_layout Plain Layout
8409 ] Modifies the properties of the given counter.
8410 If the counter does not exist, the section is ignored.
8412 \begin_inset Quotes eld
8416 \begin_inset Flex Code
8419 \begin_layout Plain Layout
8426 \begin_inset Quotes erd
8430 \begin_inset Newline newline
8434 \begin_inset space ~
8438 \begin_inset CommandInset ref
8440 reference "sub:Counters"
8444 for details on counters.
8447 \begin_layout Description
8448 \begin_inset Flex Code
8451 \begin_layout Plain Layout
8458 \begin_inset Flex Code
8461 \begin_layout Plain Layout
8467 ] Modifies the properties of the given paragraph style.
8468 If the style does not exist, the section is ignored.
8470 \begin_inset Quotes eld
8474 \begin_inset Flex Code
8477 \begin_layout Plain Layout
8484 \begin_inset Quotes erd
8490 \begin_layout Description
8491 \begin_inset Flex Code
8494 \begin_layout Plain Layout
8500 As its name implies, this command allows you to include another layout
8501 definition file within yours to avoid duplicating commands.
8502 Common examples are the standard layout files, for example,
8503 \begin_inset Flex Code
8506 \begin_layout Plain Layout
8512 , which contains most of the basic layouts.
8515 \begin_layout Description
8516 \begin_inset Flex Code
8519 \begin_layout Plain Layout
8525 This section (re-)defines the layout of an inset.
8526 It can be applied to an existing inset or to a new, user-defined inset,
8527 e.g., a new character style.
8529 \begin_inset Quotes eld
8533 \begin_inset Flex Code
8536 \begin_layout Plain Layout
8543 \begin_inset Quotes erd
8547 \begin_inset Newline newline
8551 \begin_inset space ~
8555 \begin_inset CommandInset ref
8557 reference "sub:Flex-insets-and"
8561 for more information.
8565 \begin_layout Description
8566 \begin_inset Flex Code
8569 \begin_layout Plain Layout
8576 \begin_inset Flex Code
8579 \begin_layout Plain Layout
8585 ] A string that indicates the width of the left margin on the screen, for
8587 \begin_inset Quotes eld
8591 \begin_inset Quotes erd
8595 (Note that this is not a `length', like
8596 \begin_inset Quotes eld
8600 \begin_inset Quotes erd
8606 \begin_layout Description
8607 \begin_inset Flex Code
8610 \begin_layout Plain Layout
8617 \begin_inset Flex Code
8620 \begin_layout Plain Layout
8626 ] This command deletes an existing counter, usually one defined in an included
8630 \begin_layout Description
8631 \begin_inset Flex Code
8634 \begin_layout Plain Layout
8640 This command deletes an existing float.
8641 This is particularly useful when you want to suppress a float that has
8642 been defined in an input file.
8645 \begin_layout Description
8646 \begin_inset Flex Code
8649 \begin_layout Plain Layout
8655 This command deletes an existing style.
8656 This is particularly useful when you want to suppress a style that has
8657 be defined in an input file.
8660 \begin_layout Description
8661 \begin_inset Flex Code
8664 \begin_layout Plain Layout
8670 A string indicating the file format (as defined in the Preferences dialog)
8671 produced by this class.
8672 It is mainly useful when
8673 \begin_inset Flex Code
8676 \begin_layout Plain Layout
8682 is `literate' and one wants to define a new type of literate document.
8683 This string is reset to `docbook', `latex', or `literate' when the correspondin
8685 \begin_inset Flex Code
8688 \begin_layout Plain Layout
8694 parameter is encountered.
8697 \begin_layout Description
8698 \begin_inset Flex Code
8701 \begin_layout Plain Layout
8707 A string indicating what sort of output documents using this class will
8709 At present, the options are: `docbook', `latex', and `literate'.
8712 \begin_layout Description
8713 \begin_inset Flex Code
8716 \begin_layout Plain Layout
8723 \begin_inset Flex Code
8726 \begin_layout Plain Layout
8735 \begin_inset Flex Code
8738 \begin_layout Plain Layout
8745 \begin_inset Flex Code
8748 \begin_layout Plain Layout
8754 ] The default pagestyle.
8755 Can be changed in the
8756 \begin_inset Flex MenuItem
8759 \begin_layout Plain Layout
8760 Document\SpecialChar \menuseparator
8769 \begin_layout Description
8770 \begin_inset Flex Code
8773 \begin_layout Plain Layout
8779 Sets the preamble for the LaTeX document.
8780 Note that this will completely override any prior
8781 \begin_inset Flex Code
8784 \begin_layout Plain Layout
8791 \begin_inset Flex Code
8794 \begin_layout Plain Layout
8802 \begin_inset Flex Code
8805 \begin_layout Plain Layout
8811 if you just want to add material to the preamble.) Must end with
8812 \begin_inset Quotes eld
8816 \begin_inset Flex Code
8819 \begin_layout Plain Layout
8826 \begin_inset Quotes erd
8832 \begin_layout Description
8833 \begin_inset Flex Code
8836 \begin_layout Plain Layout
8843 \begin_inset Flex Code
8846 \begin_layout Plain Layout
8853 \begin_inset Flex Code
8856 \begin_layout Plain Layout
8865 \begin_inset Flex Code
8868 \begin_layout Plain Layout
8874 ] Whether the class already provides the feature
8875 \begin_inset Flex Code
8878 \begin_layout Plain Layout
8885 A feature is in general the name of a package (
8886 \begin_inset Flex Code
8889 \begin_layout Plain Layout
8896 \begin_inset Flex Code
8899 \begin_layout Plain Layout
8905 , \SpecialChar \ldots{}
8907 \begin_inset Flex Code
8910 \begin_layout Plain Layout
8917 \begin_inset Flex Code
8920 \begin_layout Plain Layout
8926 ,\SpecialChar \ldots{}
8927 ); the complete list of supported features is unfortunately not documented
8928 outside the LyX source code—but see
8929 \begin_inset Flex Code
8932 \begin_layout Plain Layout
8938 if you're interested.
8940 \begin_inset Flex MenuItem
8943 \begin_layout Plain Layout
8944 Help\SpecialChar \menuseparator
8950 also gives an overview of the supported packages.
8953 \begin_layout Description
8954 \begin_inset Flex Code
8957 \begin_layout Plain Layout
8964 \begin_inset Flex Code
8967 \begin_layout Plain Layout
8973 ] Indicates that this layout provides the functionality of the module mentioned,
8974 which should be specified by the filename without the
8975 \begin_inset Flex Code
8978 \begin_layout Plain Layout
8985 This will typically be used if the layout includes the module directly,
8986 rather than using the
8987 \begin_inset Flex Code
8990 \begin_layout Plain Layout
8996 tag to indicate that it ought to be used.
8997 It could also be used in a module that provided an alternate implementation
8998 of the same functionality.
9001 \begin_layout Description
9002 \begin_inset Flex Code
9005 \begin_layout Plain Layout
9012 \begin_inset Flex Code
9015 \begin_layout Plain Layout
9021 ] Whether the class requires the feature
9022 \begin_inset Flex Code
9025 \begin_layout Plain Layout
9032 Multiple features must be separated by commas.
9033 Note that you can only request supported features.
9035 \begin_inset Flex Code
9038 \begin_layout Plain Layout
9044 for a list of these.)
9047 \begin_layout Description
9048 \begin_inset Flex Code
9051 \begin_layout Plain Layout
9057 A string that indicates the width of the right margin on the screen, for
9059 \begin_inset Quotes eld
9063 \begin_inset Quotes erd
9069 \begin_layout Description
9070 \begin_inset Flex Code
9073 \begin_layout Plain Layout
9079 Sets which divisions get numbered.
9081 \begin_inset Flex Code
9084 \begin_layout Plain Layout
9093 \begin_layout Description
9094 \begin_inset Flex Code
9097 \begin_layout Plain Layout
9104 \begin_inset Flex Code
9107 \begin_layout Plain Layout
9116 \begin_inset Flex Code
9119 \begin_layout Plain Layout
9125 ] Whether the class-default should be printing on one or both sides of the
9127 Can be changed in the
9128 \begin_inset Flex MenuItem
9131 \begin_layout Plain Layout
9132 Document\SpecialChar \menuseparator
9141 \begin_layout Description
9142 \begin_inset Flex Code
9145 \begin_layout Plain Layout
9151 This sequence defines a paragraph style.
9152 If the style does not yet exist, it is created; if it does exist, its parameter
9155 \begin_inset Quotes eld
9159 \begin_inset Flex Code
9162 \begin_layout Plain Layout
9169 \begin_inset Quotes erd
9173 \begin_inset Newline newline
9177 \begin_inset space ~
9181 \begin_inset CommandInset ref
9183 reference "sub:Paragraph-Styles"
9187 for details on paragraph styles.
9190 \begin_layout Description
9191 \begin_inset Flex Code
9194 \begin_layout Plain Layout
9201 \begin_inset Flex Code
9204 \begin_layout Plain Layout
9210 ] The name of the command or environment to be used with
9211 \begin_inset Flex Code
9214 \begin_layout Plain Layout
9223 \begin_layout Description
9224 \begin_inset Flex Code
9227 \begin_layout Plain Layout
9234 \begin_inset Flex Code
9237 \begin_layout Plain Layout
9246 \begin_inset Flex Code
9249 \begin_layout Plain Layout
9255 ] Indicates what kind of markup is used to define the title of a document.
9257 \begin_inset Flex Code
9260 \begin_layout Plain Layout
9266 means that the macro with name
9267 \begin_inset Flex Code
9270 \begin_layout Plain Layout
9276 will be inserted after the last layout which has
9277 \begin_inset Quotes eld
9281 \begin_inset Flex Code
9284 \begin_layout Plain Layout
9291 \begin_inset Quotes erd
9296 \begin_inset Flex Code
9299 \begin_layout Plain Layout
9305 corresponds to the case where the block of paragraphs which have
9306 \begin_inset Quotes eld
9310 \begin_inset Flex Code
9313 \begin_layout Plain Layout
9320 \begin_inset Quotes erd
9323 should be enclosed into the
9324 \begin_inset Flex Code
9327 \begin_layout Plain Layout
9336 \begin_layout Description
9337 \begin_inset Flex Code
9340 \begin_layout Plain Layout
9346 Sets which divisions are included in the table of contents.
9348 \begin_inset Flex Code
9351 \begin_layout Plain Layout
9360 \begin_layout Subsection
9361 \begin_inset Flex Code
9364 \begin_layout Plain Layout
9371 \begin_inset CommandInset label
9373 name "sub:ClassOptions"
9380 \begin_layout Standard
9382 \begin_inset Flex Code
9385 \begin_layout Plain Layout
9391 section can contain the following entries:
9394 \begin_layout Description
9395 \begin_inset Flex Code
9398 \begin_layout Plain Layout
9405 \begin_inset Flex Code
9408 \begin_layout Plain Layout
9414 ] The list of available font sizes for the document's main font, separated
9416 \begin_inset Quotes eld
9420 \begin_inset Flex Code
9423 \begin_layout Plain Layout
9430 \begin_inset Quotes erd
9436 \begin_layout Description
9437 \begin_inset Flex Code
9440 \begin_layout Plain Layout
9446 Used to set the DTD line with XML-based output classes.
9448 \begin_inset space \thinspace{}
9452 \begin_inset Quotes eld
9455 -//OASIS//DTD DocBook V4.2//EN
9456 \begin_inset Quotes erd
9462 \begin_layout Description
9463 \begin_inset Flex Code
9466 \begin_layout Plain Layout
9473 \begin_inset Flex Code
9476 \begin_layout Plain Layout
9477 string="empty|plain|headings|fancy"
9482 ] The list of available page styles, separated by
9483 \begin_inset Quotes eld
9487 \begin_inset Flex Code
9490 \begin_layout Plain Layout
9497 \begin_inset Quotes erd
9503 \begin_layout Description
9504 \begin_inset Flex Code
9507 \begin_layout Plain Layout
9514 \begin_inset Flex Code
9517 \begin_layout Plain Layout
9523 ] Some document class options, separated by a comma, that will be added
9524 to the optional part of the
9525 \begin_inset Flex Code
9528 \begin_layout Plain Layout
9539 \begin_layout Standard
9541 \begin_inset Flex Code
9544 \begin_layout Plain Layout
9550 section must end with
9551 \begin_inset Quotes eld
9555 \begin_inset Flex Code
9558 \begin_layout Plain Layout
9565 \begin_inset Quotes erd
9571 \begin_layout Subsection
9573 \begin_inset CommandInset label
9575 name "sub:Paragraph-Styles"
9582 \begin_layout Standard
9583 A paragraph style description looks like this:
9587 \begin_layout Plain Layout
9588 Note that this will either define a new style or modify an existing one.
9596 \begin_layout LyX-Code
9603 \begin_layout LyX-Code
9607 \begin_layout LyX-Code
9611 \begin_layout Standard
9612 where the following commands are allowed:
9615 \begin_layout Description
9616 \begin_inset Flex Code
9619 \begin_layout Plain Layout
9626 \begin_inset Flex Code
9629 \begin_layout Plain Layout
9634 , left, right, center
9639 ] Paragraph alignment.
9642 \begin_layout Description
9643 \begin_inset Flex Code
9646 \begin_layout Plain Layout
9653 \begin_inset Flex Code
9656 \begin_layout Plain Layout
9661 , left, right, center
9666 ] A comma separated list of permitted alignments.
9667 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9669 For example a right-aligned or centered enumeration isn't possible.)
9672 \begin_layout Description
9673 \begin_inset Flex Code
9676 \begin_layout Plain Layout
9682 Note that this will completely override any prior
9683 \begin_inset Flex Code
9686 \begin_layout Plain Layout
9692 declaration for this style.
9694 \begin_inset Quotes eld
9698 \begin_inset Flex Code
9701 \begin_layout Plain Layout
9708 \begin_inset Quotes erd
9713 \begin_inset CommandInset ref
9715 reference "sub:I18n"
9719 for details on its use.
9722 \begin_layout Description
9723 \begin_inset Flex Code
9726 \begin_layout Plain Layout
9733 \begin_inset Flex Code
9736 \begin_layout Plain Layout
9746 \begin_layout Plain Layout
9747 Note that a `float' here is a real number, such as: 1.5.
9752 The vertical space with which the last of a chain of paragraphs with this
9753 style is separated from the following paragraph.
9754 If the next paragraph has another style, the separations are not simply
9755 added, but the maximum is taken.
9758 \begin_layout Description
9759 \begin_inset Flex Code
9762 \begin_layout Plain Layout
9769 \begin_inset Flex Code
9772 \begin_layout Plain Layout
9778 The category for this style.
9779 This is used to group related styles in the style combobox on the toolbar.
9780 Any string can be used, but you may want to use existing categories with
9785 \begin_layout Description
9786 \begin_inset Flex Code
9789 \begin_layout Plain Layout
9795 Depth of XML command.
9796 Used only with XML-type formats.
9799 \begin_layout Description
9800 \begin_inset Flex Code
9803 \begin_layout Plain Layout
9810 \begin_inset CommandInset label
9812 name "des:CopyStyle"
9817 \begin_inset Flex Code
9820 \begin_layout Plain Layout
9826 Copies all the features of an existing style into the current one.
9830 \begin_layout Description
9831 \begin_inset Flex Code
9834 \begin_layout Plain Layout
9840 The name of a style whose preamble should be output
9845 This allows to ensure some ordering of the preamble snippets when macros
9846 definitions depend on one another.
9850 \begin_layout Plain Layout
9851 Note that, besides that functionality, there is no way to ensure any ordering
9853 The ordering that you see in a given version of LyX may change without
9854 warning in later versions.
9862 \begin_layout Description
9863 \begin_inset Flex Code
9866 \begin_layout Plain Layout
9873 \begin_inset Flex Code
9876 \begin_layout Plain Layout
9881 , Box, Filled_Box, Static
9886 ] The type of label that stands at the end of the paragraph (or sequence
9888 \begin_inset Flex Code
9891 \begin_layout Plain Layout
9898 \begin_inset Flex Code
9901 \begin_layout Plain Layout
9908 \begin_inset Flex Code
9911 \begin_layout Plain Layout
9918 \begin_inset Flex Code
9921 \begin_layout Plain Layout
9929 \begin_inset Flex Code
9932 \begin_layout Plain Layout
9939 \begin_inset Quotes eld
9943 \begin_inset Quotes erd
9947 \begin_inset Flex Code
9950 \begin_layout Plain Layout
9957 \begin_inset Flex Code
9960 \begin_layout Plain Layout
9961 \begin_inset space ~
9970 \begin_inset space ~
9973 black) square suitable for end of proof markers,
9974 \begin_inset Flex Code
9977 \begin_layout Plain Layout
9983 is an explicit text string.
9986 \begin_layout Description
9987 \begin_inset Flex Code
9990 \begin_layout Plain Layout
9997 \begin_inset Flex Code
10000 \begin_layout Plain Layout
10006 ] The string used for a label with a
10007 \begin_inset Flex Code
10010 \begin_layout Plain Layout
10017 \begin_inset Flex Code
10020 \begin_layout Plain Layout
10030 \begin_layout Description
10031 \begin_inset Flex Code
10034 \begin_layout Plain Layout
10040 The font used for both the text body
10046 \begin_inset space ~
10050 \begin_inset CommandInset ref
10052 reference "sub:Font-description"
10057 Note that defining this font automatically defines the
10058 \begin_inset Flex Code
10061 \begin_layout Plain Layout
10068 So you should define this one first if you also want to define
10069 \begin_inset Flex Code
10072 \begin_layout Plain Layout
10081 \begin_layout Description
10082 \begin_inset Flex Code
10085 \begin_layout Plain Layout
10092 \begin_inset CommandInset label
10094 name "des:FreeSpacing"
10099 \begin_inset Flex Code
10102 \begin_layout Plain Layout
10111 \begin_inset Flex Code
10114 \begin_layout Plain Layout
10120 ] Usually LyX doesn't allow you to insert more than one space between words,
10121 since a space is considered as the separation between two words, not a
10122 character or symbol of its own.
10123 This is a very fine thing but sometimes annoying, for example, when typing
10124 program code or plain LaTeX code.
10126 \begin_inset Flex Code
10129 \begin_layout Plain Layout
10136 Note that LyX will create protected blanks for the additional blanks when
10137 in another mode than LaTeX-mode.
10140 \begin_layout Description
10141 \begin_inset Flex Code
10144 \begin_layout Plain Layout
10150 These tags are used with XHTML output.
10152 \begin_inset CommandInset ref
10154 reference "sub:Paragraph-Style-XHTML"
10161 \begin_layout Description
10162 \begin_inset Flex Code
10165 \begin_layout Plain Layout
10171 [[FIXME]] (Used only with XML-type formats.)
10174 \begin_layout Description
10175 \begin_inset Flex Code
10178 \begin_layout Plain Layout
10185 \begin_inset Flex Code
10188 \begin_layout Plain Layout
10194 If 1, marks the style as to be included in the document preamble rather
10195 than in the document body.
10196 This is useful for document classes that want such information as the title
10197 and author to appear in the preamble.
10198 Note that this works only for styles for which the
10199 \begin_inset Flex Code
10202 \begin_layout Plain Layout
10209 \begin_inset Flex Code
10212 \begin_layout Plain Layout
10219 \begin_inset Flex Code
10222 \begin_layout Plain Layout
10231 \begin_layout Description
10232 \begin_inset Flex Code
10235 \begin_layout Plain Layout
10242 \begin_inset Flex Code
10245 \begin_layout Plain Layout
10251 If 1, marks the style as being part of a title block (see also the
10252 \begin_inset Flex Code
10255 \begin_layout Plain Layout
10262 \begin_inset Flex Code
10265 \begin_layout Plain Layout
10274 \begin_layout Description
10275 \begin_inset Flex Code
10278 \begin_layout Plain Layout
10285 \begin_inset Flex Code
10288 \begin_layout Plain Layout
10294 ] This provides extra space between paragraphs that have the same style.
10295 If you put other styles into an environment, each is separated with the
10297 \begin_inset Flex Code
10300 \begin_layout Plain Layout
10307 But the whole items of the environment are additionally separated with
10309 \begin_inset Flex Code
10312 \begin_layout Plain Layout
10319 Note that this is a
10324 \begin_layout Description
10325 \begin_inset Flex Code
10328 \begin_layout Plain Layout
10334 [[FIXME]] (Used only with XML-type formats.)
10337 \begin_layout Description
10338 \begin_inset Flex Code
10341 \begin_layout Plain Layout
10348 \begin_inset CommandInset label
10350 name "des:KeepEmpty"
10355 \begin_inset Flex Code
10358 \begin_layout Plain Layout
10367 \begin_inset Flex Code
10370 \begin_layout Plain Layout
10376 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10377 lead to empty LaTeX output.
10378 There are some cases where this could be desirable however: in a letter
10379 template, the required fields can be provided as empty fields, so that
10380 people do not forget them; in some special classes, a style can be used
10381 as some kind of break, which does not contain actual text.
10384 \begin_layout Description
10385 \begin_inset Flex Code
10388 \begin_layout Plain Layout
10394 [float=0] The vertical space between the label and the text body.
10395 Only used for labels that are above the text body (
10396 \begin_inset Flex Code
10399 \begin_layout Plain Layout
10406 \begin_inset Flex Code
10409 \begin_layout Plain Layout
10410 Centered_Top_Environment
10418 \begin_layout Description
10419 \begin_inset Flex Code
10422 \begin_layout Plain Layout
10429 \begin_inset Flex Code
10432 \begin_layout Plain Layout
10439 \begin_inset Newline newline
10442 The name of the counter for automatic numbering.
10444 \begin_inset Newline newline
10452 \begin_inset Flex Code
10455 \begin_layout Plain Layout
10462 \begin_inset Flex Code
10465 \begin_layout Plain Layout
10472 In that case, the counter will be stepped each time the style appears.
10474 \begin_inset Newline newline
10482 \begin_inset Flex Code
10485 \begin_layout Plain Layout
10492 \begin_inset Flex Code
10495 \begin_layout Plain Layout
10501 , though this case is a bit complicated.
10502 Suppose you declare
10503 \begin_inset Quotes eld
10507 \begin_inset Flex Code
10510 \begin_layout Plain Layout
10511 LabelCounter myenum
10517 \begin_inset Quotes erd
10521 Then the actual counters used are
10522 \begin_inset Flex Code
10525 \begin_layout Plain Layout
10532 \begin_inset Flex Code
10535 \begin_layout Plain Layout
10542 \begin_inset Flex Code
10545 \begin_layout Plain Layout
10552 \begin_inset Flex Code
10555 \begin_layout Plain Layout
10561 , much as in LaTeX.
10562 These counters must all be declared separately.
10563 \begin_inset Newline newline
10567 \begin_inset CommandInset ref
10569 reference "sub:Counters"
10573 for details on counters.
10576 \begin_layout Description
10577 \begin_inset Flex Code
10580 \begin_layout Plain Layout
10586 The font used for the label.
10588 \begin_inset space ~
10592 \begin_inset CommandInset ref
10594 reference "sub:Font-description"
10601 \begin_layout Description
10602 \begin_inset Flex Code
10605 \begin_layout Plain Layout
10611 Text that indicates how far a label should be indented.
10614 \begin_layout Description
10615 \begin_inset Flex Code
10618 \begin_layout Plain Layout
10625 \begin_inset Flex Code
10628 \begin_layout Plain Layout
10634 ] The horizontal space between the label and the text body.
10635 Only used for labels that are not above the text body.
10638 \begin_layout Description
10639 \begin_inset Flex Code
10642 \begin_layout Plain Layout
10649 \begin_inset Flex Code
10652 \begin_layout Plain Layout
10658 ] The string used for a label with a
10659 \begin_inset Flex Code
10662 \begin_layout Plain Layout
10670 \begin_inset Flex Code
10673 \begin_layout Plain Layout
10679 is set, this string can be contain the special formatting commands described
10681 \begin_inset CommandInset ref
10683 reference "sub:Counters"
10691 \begin_layout Plain Layout
10692 For the sake of backwards compatibility, the string
10693 \begin_inset Flex Code
10696 \begin_layout Plain Layout
10706 will be replaced by the expanded
10707 \begin_inset Flex Code
10710 \begin_layout Plain Layout
10717 \begin_inset Flex Code
10720 \begin_layout Plain Layout
10729 This feature is now obsolete and should be replaced by the mechanisms of
10731 \begin_inset CommandInset ref
10733 reference "sub:Counters"
10745 \begin_layout Description
10746 \begin_inset Flex Code
10749 \begin_layout Plain Layout
10750 LabelStringAppendix
10756 \begin_inset Flex Code
10759 \begin_layout Plain Layout
10765 ] This is used inside the appendix instead of
10766 \begin_inset Flex Code
10769 \begin_layout Plain Layout
10777 \begin_inset Flex Code
10780 \begin_layout Plain Layout
10787 \begin_inset Flex Code
10790 \begin_layout Plain Layout
10791 LabelStringAppendix
10799 \begin_layout Description
10800 \begin_inset Flex Code
10803 \begin_layout Plain Layout
10809 [FIXME] (Used only with XML-type formats.)
10812 \begin_layout Description
10813 \begin_inset Flex Code
10816 \begin_layout Plain Layout
10823 \begin_inset Flex Code
10826 \begin_layout Plain Layout
10831 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10832 Enumerate, Itemize, Bibliography
10841 \begin_layout Itemize
10842 \begin_inset Flex Code
10845 \begin_layout Plain Layout
10851 means the label is the very first word (up to the first real blank).
10852 Use protected spaces (like
10853 \begin_inset space ~
10856 that one) if you want more than one word as the label.
10860 \begin_layout Itemize
10861 \begin_inset Flex Code
10864 \begin_layout Plain Layout
10870 means the label is simply whatever
10871 \begin_inset Flex Code
10874 \begin_layout Plain Layout
10881 Note that this really is `static'.
10884 \begin_layout Itemize
10885 \begin_inset Flex Code
10888 \begin_layout Plain Layout
10895 \begin_inset Flex Code
10898 \begin_layout Plain Layout
10899 Centered_Top_Environment
10904 are special cases of
10905 \begin_inset Flex Code
10908 \begin_layout Plain Layout
10915 The label will be printed above the paragraph, but only at the top of an
10916 environment or the top of a chain of paragraphs with this style.
10917 This might be used with the
10918 \begin_inset Flex MenuItem
10921 \begin_layout Plain Layout
10927 style, for example.
10930 \begin_layout Itemize
10931 \begin_inset Flex Code
10934 \begin_layout Plain Layout
10940 is a special case for the caption-labels
10941 \begin_inset Quotes eld
10945 \begin_inset Quotes erd
10949 \begin_inset Quotes eld
10953 \begin_inset Quotes erd
10958 \begin_inset Flex Code
10961 \begin_layout Plain Layout
10967 means the (hardcoded) label string depends on the kind of float: It is
10968 hardcoded to be `FloatType N', where N is the value of the counter associated
10972 \begin_layout Itemize
10974 \begin_inset Flex Code
10977 \begin_layout Plain Layout
10983 label type defines automatically numbered labels.
10985 \begin_inset Flex Code
10988 \begin_layout Plain Layout
10994 will be expanded to resolve any counter references it contains: For example,
10996 \begin_inset Quotes eld
11000 \begin_inset Flex Code
11003 \begin_layout Plain Layout
11014 \begin_inset Quotes erd
11019 \begin_inset CommandInset ref
11021 reference "sub:Counters"
11025 for more information on counters.
11028 \begin_layout Itemize
11029 \begin_inset Flex Code
11032 \begin_layout Plain Layout
11038 produces the usual sort of enumeration labels.
11039 At present, it is hardcoded to use Arabic numerals, lowercase letters,
11040 small Roman numerals, and uppercase letters for the four possible depths.
11043 \begin_layout Itemize
11044 \begin_inset Flex Code
11047 \begin_layout Plain Layout
11053 produces various bullets at the different levels.
11054 It is also hardcoded.
11057 \begin_layout Itemize
11058 \begin_inset Flex Code
11061 \begin_layout Plain Layout
11067 is used internally by LyX and should be used only with
11068 \begin_inset Flex Code
11071 \begin_layout Plain Layout
11072 LatexType BibEnvironment
11081 \begin_layout Description
11082 \begin_inset Flex Code
11085 \begin_layout Plain Layout
11091 Note that this will completely override any prior
11092 \begin_inset Flex Code
11095 \begin_layout Plain Layout
11101 declaration for this style.
11103 \begin_inset Quotes eld
11107 \begin_inset Flex Code
11110 \begin_layout Plain Layout
11117 \begin_inset Quotes erd
11122 \begin_inset CommandInset ref
11124 reference "sub:I18n"
11128 for details on its use.
11131 \begin_layout Description
11132 \begin_inset Flex Code
11135 \begin_layout Plain Layout
11141 The name of the corresponding LaTeX stuff.
11142 Either the environment or command name.
11145 \begin_layout Description
11146 \begin_inset Flex Code
11149 \begin_layout Plain Layout
11155 An optional parameter for the corresponding
11156 \begin_inset Flex Code
11159 \begin_layout Plain Layout
11166 This parameter cannot be changed from within LyX.
11169 \begin_layout Description
11170 \begin_inset Flex Code
11173 \begin_layout Plain Layout
11180 \begin_inset CommandInset label
11182 name "des:LatexType"
11187 \begin_inset Flex Code
11190 \begin_layout Plain Layout
11195 , Command, Environment, Item_Environment,
11201 \begin_inset Flex Code
11204 \begin_layout Plain Layout
11205 List_Environment, Bib_Environment
11210 ] How the style should be translated into LaTeX.
11214 \begin_layout Plain Layout
11215 \begin_inset Flex Code
11218 \begin_layout Plain Layout
11224 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11225 Visit the SGML class files for specific examples.
11234 \begin_layout Itemize
11235 \begin_inset Flex Code
11238 \begin_layout Plain Layout
11244 means nothing special.
11248 \begin_layout Itemize
11249 \begin_inset Flex Code
11252 \begin_layout Plain Layout
11259 \begin_inset Flex Code
11262 \begin_layout Plain Layout
11269 {\SpecialChar \ldots{}
11278 \begin_layout Itemize
11279 \begin_inset Flex Code
11282 \begin_layout Plain Layout
11289 \begin_inset Flex Code
11292 \begin_layout Plain Layout
11299 }\SpecialChar \ldots{}
11315 \begin_layout Itemize
11316 \begin_inset Flex Code
11319 \begin_layout Plain Layout
11326 \begin_inset Flex Code
11329 \begin_layout Plain Layout
11336 \begin_inset Flex Code
11339 \begin_layout Plain Layout
11347 is generated for each paragraph of this environment.
11351 \begin_layout Itemize
11352 \begin_inset Flex Code
11355 \begin_layout Plain Layout
11362 \begin_inset Flex Code
11365 \begin_layout Plain Layout
11372 \begin_inset Flex Code
11375 \begin_layout Plain Layout
11381 is passed as an argument to the environment.
11383 \begin_inset Flex Code
11386 \begin_layout Plain Layout
11392 can be defined in the
11393 \begin_inset Flex MenuItem
11396 \begin_layout Plain Layout
11401 \SpecialChar \menuseparator
11407 \begin_inset space ~
11419 \begin_layout Standard
11420 Putting the last few things together, the LaTeX output will be either:
11423 \begin_layout LyX-Code
11426 latexname[latexparam]{\SpecialChar \ldots{}
11430 \begin_layout Standard
11434 \begin_layout LyX-Code
11437 begin{latexname}[latexparam] \SpecialChar \ldots{}
11443 \begin_layout Standard
11444 depending upon the LaTeX type.
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 you put styles into environments, the leftmargins are not simply added,
11469 but added with a factor
11470 \begin_inset Formula $\frac{4}{depth+4}$
11474 Note that this parameter is also used when the margin is defined as
11475 \begin_inset Flex Code
11478 \begin_layout Plain Layout
11485 \begin_inset Flex Code
11488 \begin_layout Plain Layout
11495 Then it is added to the manual or dynamic margin.
11497 \begin_inset Newline newline
11500 The argument is passed as a string.
11502 \begin_inset Quotes eld
11506 \begin_inset Flex Code
11509 \begin_layout Plain Layout
11516 \begin_inset Quotes erd
11519 means that the paragraph is indented with the width of
11520 \begin_inset Quotes eld
11524 \begin_inset Flex Code
11527 \begin_layout Plain Layout
11534 \begin_inset Quotes erd
11537 in the normal font.
11538 You can get a negative width by prefixing the string with
11539 \begin_inset Quotes eld
11543 \begin_inset Flex Code
11546 \begin_layout Plain Layout
11553 \begin_inset Quotes erd
11557 This way was chosen so that the look is the same with each used screen
11562 \begin_layout Description
11563 \begin_inset Flex Code
11566 \begin_layout Plain Layout
11573 \begin_inset Flex Code
11576 \begin_layout Plain Layout
11581 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11587 \begin_inset Newline newline
11590 The kind of margin that the style has on the left side.
11592 \begin_inset Flex Code
11595 \begin_layout Plain Layout
11601 just means a fixed margin.
11603 \begin_inset Flex Code
11606 \begin_layout Plain Layout
11612 means that the left margin depends on the string entered in the
11613 \begin_inset Flex MenuItem
11616 \begin_layout Plain Layout
11617 Edit\SpecialChar \menuseparator
11619 \begin_inset space ~
11628 This is used to typeset nice lists without tabulators.
11630 \begin_inset Flex Code
11633 \begin_layout Plain Layout
11639 means that the margin depends on the size of the label.
11640 This is used for automatic enumerated headlines.
11641 It is obvious that the headline
11642 \begin_inset Quotes eld
11645 5.4.3.2.1 Very long headline
11646 \begin_inset Quotes erd
11649 must have a wider left margin (as wide as
11650 \begin_inset Quotes eld
11654 \begin_inset Quotes erd
11657 plus the space) than
11658 \begin_inset Quotes eld
11661 3.2 Very long headline
11662 \begin_inset Quotes erd
11666 \begin_inset Quotes eld
11670 \begin_inset Quotes erd
11673 are not able to do this.
11675 \begin_inset Flex Code
11678 \begin_layout Plain Layout
11684 is similar, but only the very first row of the paragraph is dynamic, while
11685 the others are static; this is used, for example, for descriptions.
11687 \begin_inset Flex Code
11690 \begin_layout Plain Layout
11696 means the margin is chosen in a way that the longest row of this paragraph
11697 fits to the right margin.
11698 This is used to typeset an address on the right edge of the page.
11701 \begin_layout Description
11702 \begin_inset Flex Code
11705 \begin_layout Plain Layout
11712 \begin_inset Flex Code
11715 \begin_layout Plain Layout
11724 \begin_inset Flex Code
11727 \begin_layout Plain Layout
11733 ] Whether fragile commands in this style should be
11734 \begin_inset Flex Code
11737 \begin_layout Plain Layout
11750 whether this command should itself be protected.)
11753 \begin_layout Description
11754 \begin_inset Flex Code
11757 \begin_layout Plain Layout
11764 \begin_inset Flex Code
11767 \begin_layout Plain Layout
11774 \begin_inset Flex Code
11777 \begin_layout Plain Layout
11785 ] Whether newlines are translated into LaTeX newlines (
11786 \begin_inset Flex Code
11789 \begin_layout Plain Layout
11800 The translation can be switched off to allow more comfortable LaTeX editing
11804 \begin_layout Description
11805 \begin_inset Flex Code
11808 \begin_layout Plain Layout
11815 \begin_inset Flex Code
11818 \begin_layout Plain Layout
11825 \begin_inset Flex Code
11828 \begin_layout Plain Layout
11837 \change_deleted 1414654397 1302985166
11838 Whether the following Paragraph is allowed to indent its very first row.
11840 \begin_inset Flex Code
11843 \begin_layout Plain Layout
11849 means that it is not allowed to do so;
11850 \begin_inset Flex Code
11853 \begin_layout Plain Layout
11859 means it could do so if it wants to.
11860 \change_inserted 1414654397 1302985275
11861 If set to true, and if
11862 \begin_inset Flex Code
11865 \begin_layout Plain Layout
11867 \change_inserted 1414654397 1302985206
11876 \begin_inset Flex Code
11879 \begin_layout Plain Layout
11881 \change_inserted 1414654397 1302985230
11889 ) paragraphs are being indented, then the indentation of such a paragraph
11890 following one of this type will be suppressed.
11891 (So this will not affect the display of non-default paragraphs.)
11896 \begin_layout Description
11897 \begin_inset Flex Code
11900 \begin_layout Plain Layout
11906 Name of a style that has replaced this style.
11907 This is used to rename a style, while keeping backward compatibility.
11910 \begin_layout Description
11911 \begin_inset Flex Code
11914 \begin_layout Plain Layout
11921 \begin_inset Flex Code
11924 \begin_layout Plain Layout
11930 ] The number of optional arguments that can be used with this style.
11931 This is useful for things like section headings, and only makes sense with
11933 Note that, on output, the optional arguments will all precede any required
11934 arguments (see below).
11935 So one can have constructs like:
11939 \begin_layout LyX-Code
11942 mycmd[opt1]{req1}{contents of paragraph}
11945 \begin_layout Standard
11946 but one cannot have things like:
11949 \begin_layout LyX-Code
11952 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11955 \begin_layout Standard
11956 at least, not without ERT (with which you can have anything).
11961 \begin_layout Description
11962 \begin_inset Flex Code
11965 \begin_layout Plain Layout
11972 \begin_inset CommandInset label
11974 name "des:ParbreakIsNewline"
11979 \begin_inset Flex Code
11982 \begin_layout Plain Layout
11991 \begin_inset Flex Code
11994 \begin_layout Plain Layout
12000 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
12001 output, but only by a line break; together with
12002 \begin_inset Flex Code
12005 \begin_layout Plain Layout
12011 , this allows to emulate a plain text editor (like the ERT inset).
12014 \begin_layout Description
12015 \begin_inset Flex Code
12018 \begin_layout Plain Layout
12025 \begin_inset Flex Code
12028 \begin_layout Plain Layout
12034 ] The indent of the very first line of a paragraph.
12036 \begin_inset Flex Code
12039 \begin_layout Plain Layout
12045 will be fixed for a certain style.
12046 The exception is the default style, since the indentation for these paragraphs
12047 can be prohibited with
12048 \begin_inset Flex Code
12051 \begin_layout Plain Layout
12059 \begin_inset Flex Code
12062 \begin_layout Plain Layout
12068 style paragraphs inside environments use the
12069 \begin_inset Flex Code
12072 \begin_layout Plain Layout
12078 of the environment, not their native one.
12080 \begin_inset Flex Code
12083 \begin_layout Plain Layout
12089 paragraphs inside an enumeration are not indented.
12092 \begin_layout Description
12093 \begin_inset Flex Code
12096 \begin_layout Plain Layout
12103 \begin_inset Flex Code
12106 \begin_layout Plain Layout
12112 ] The vertical space between two paragraphs of this style.
12115 \begin_layout Description
12116 \begin_inset Flex Code
12119 \begin_layout Plain Layout
12126 \begin_inset Flex Code
12129 \begin_layout Plain Layout
12135 ] LyX allows the user to choose either
12136 \begin_inset Quotes eld
12140 \begin_inset Quotes erd
12144 \begin_inset Quotes eld
12148 \begin_inset Quotes erd
12151 to typeset a document.
12153 \begin_inset Quotes eld
12157 \begin_inset Quotes erd
12160 is chosen, this value is completely ignored.
12162 \begin_inset Quotes eld
12166 \begin_inset Quotes erd
12169 is chosen, the parindent of a LaTeXtype
12170 \begin_inset Quotes eld
12174 \begin_inset Quotes erd
12177 style is ignored and all paragraphs are separated by this parskip argument.
12178 The vertical space is calculated with
12179 \begin_inset Flex Code
12182 \begin_layout Plain Layout
12184 \begin_inset space ~
12193 \begin_inset Flex Code
12196 \begin_layout Plain Layout
12202 is the height of a row with the normal font.
12203 This way, the look stays the same with different screen fonts.
12206 \begin_layout Description
12207 \begin_inset Flex Code
12210 \begin_layout Plain Layout
12217 \begin_inset CommandInset label
12219 name "des:PassThru"
12224 \begin_inset Flex Code
12227 \begin_layout Plain Layout
12236 \begin_inset Flex Code
12239 \begin_layout Plain Layout
12245 ] Whether the contents of this paragraph should be output in raw form, meaning
12246 without special translations that LaTeX would require.
12249 \begin_layout Description
12250 \begin_inset Flex Code
12253 \begin_layout Plain Layout
12260 \begin_inset CommandInset label
12262 name "des:Preamble"
12266 Information to be included in the LaTeX preamble when this style is used.
12267 Used to define macros, load packages, etc., required by this particular
12270 \begin_inset Quotes eld
12274 \begin_inset Flex Code
12277 \begin_layout Plain Layout
12284 \begin_inset Quotes erd
12290 \begin_layout Description
12291 \begin_inset Flex Code
12294 \begin_layout Plain Layout
12301 \begin_inset Flex Code
12304 \begin_layout Plain Layout
12310 ] The prefix to use when creating labels referring to paragraphs of this
12312 This allows the use of formatted references.
12315 \begin_layout Description
12316 \begin_inset Flex Code
12319 \begin_layout Plain Layout
12326 \begin_inset Flex Code
12329 \begin_layout Plain Layout
12335 ] The number of required arguments that the LaTeX command or environment
12336 corresponding to this style expects.
12337 In the case of a command, these are required arguments
12341 that associated with the content of the paragraph itself.
12342 These do not actually have to be provided: LyX will output empty arguments
12344 Note that optional arguments will be output before required arguments.
12345 See the discussion of the
12346 \begin_inset Flex Code
12349 \begin_layout Plain Layout
12355 tag above for more information.
12358 \begin_layout Description
12359 \begin_inset Flex Code
12362 \begin_layout Plain Layout
12369 \begin_inset Flex Code
12372 \begin_layout Plain Layout
12379 \begin_inset CommandInset label
12381 name "des:Requires"
12385 Whether the style requires the feature
12386 \begin_inset Flex Code
12389 \begin_layout Plain Layout
12396 See the description of
12397 \begin_inset Flex Code
12400 \begin_layout Plain Layout
12407 \begin_inset CommandInset ref
12408 LatexCommand pageref
12409 reference "des:FreeSpacing"
12413 ) for information on `features'.
12417 \begin_layout Description
12418 \begin_inset Flex Code
12421 \begin_layout Plain Layout
12428 \begin_inset Flex Code
12431 \begin_layout Plain Layout
12438 \begin_inset Flex Code
12441 \begin_layout Plain Layout
12450 \begin_layout Description
12451 \begin_inset Flex Code
12454 \begin_layout Plain Layout
12461 \begin_inset Flex Code
12464 \begin_layout Plain Layout
12469 , onehalf, double, other
12478 ] This defines what the default spacing should be in the style.
12480 \begin_inset Flex Code
12483 \begin_layout Plain Layout
12490 \begin_inset Flex Code
12493 \begin_layout Plain Layout
12500 \begin_inset Flex Code
12503 \begin_layout Plain Layout
12509 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12510 If you specify the argument
12511 \begin_inset Flex Code
12514 \begin_layout Plain Layout
12520 , then you should also provide a numerical argument which will be the actual
12522 Note that, contrary to other parameters,
12523 \begin_inset Flex Code
12526 \begin_layout Plain Layout
12532 implies the generation of specific LaTeX code, using the package
12535 \begin_inset Flex Code
12538 \begin_layout Plain Layout
12547 \begin_layout Description
12548 \begin_inset Flex Code
12551 \begin_layout Plain Layout
12558 \begin_inset Flex Code
12561 \begin_layout Plain Layout
12568 \begin_inset Flex Code
12571 \begin_layout Plain Layout
12579 ] Spellcheck paragraphs of this style.
12583 \begin_layout Description
12584 \begin_inset Flex Code
12587 \begin_layout Plain Layout
12593 The font used for the text body .
12595 \begin_inset CommandInset ref
12597 reference "sub:Font-description"
12604 \begin_layout Description
12605 \begin_inset Flex Code
12608 \begin_layout Plain Layout
12617 \begin_inset Flex Code
12620 \begin_layout Plain Layout
12630 The level of the style in the table of contents.
12631 This is used for automatic numbering of section headings.
12634 \begin_layout Description
12635 \begin_inset Flex Code
12638 \begin_layout Plain Layout
12645 \begin_inset Flex Code
12648 \begin_layout Plain Layout
12654 ] The vertical space with which the very first of a chain of paragraphs
12655 with this style is separated from the previous paragraph.
12656 If the previous paragraph has another style, the separations are not simply
12657 added, but the maximum is taken.
12660 \begin_layout Subsection
12661 \begin_inset CommandInset label
12667 Internationalization of Paragraph Styles
12670 \begin_layout Standard
12671 LyX has long supported internationalization of layout information, but,
12672 until version 2.0, this applied only to the user interface and not to, say,
12674 Thus, French authors were forced to resort to ugly hacks if they wanted
12679 1' instead of `Theorem 1'.
12680 Thanks to Georg Baum, that is no longer the case.
12683 \begin_layout Standard
12685 \begin_inset Flex Code
12688 \begin_layout Plain Layout
12694 defines text that is to appear in the typeset document, it may use
12695 \begin_inset Flex Code
12698 \begin_layout Plain Layout
12705 \begin_inset Flex Code
12708 \begin_layout Plain Layout
12714 to support non-English and even multi-language documents correctly.
12715 The following excerpt (from the
12716 \begin_inset Flex Code
12719 \begin_layout Plain Layout
12725 file) shows how this works:
12728 \begin_layout LyX-Code
12733 \begin_layout LyX-Code
12736 theoremstyle{remark}
12739 \begin_layout LyX-Code
12742 newtheorem{claim}[thm]{
12749 \begin_layout LyX-Code
12753 \begin_layout LyX-Code
12757 \begin_layout LyX-Code
12762 claimname}{_(Claim)}
12765 \begin_layout LyX-Code
12769 \begin_layout LyX-Code
12773 \begin_layout LyX-Code
12782 claimname}{_(Claim)}}
12785 \begin_layout LyX-Code
12790 \begin_layout Standard
12791 In principle, any legal LaTeX may appear in the
12792 \begin_inset Flex Code
12795 \begin_layout Plain Layout
12802 \begin_inset Flex Code
12805 \begin_layout Plain Layout
12811 tags, but in practice they will typically look as they do here.
12812 The key to correct translation of the typeset text is the definition of
12814 \begin_inset Flex Code
12817 \begin_layout Plain Layout
12826 \begin_inset Flex Code
12829 \begin_layout Plain Layout
12841 \begin_layout Standard
12843 \begin_inset Flex Code
12846 \begin_layout Plain Layout
12852 tag provides for internationalization based upon the overall language of
12854 The contents of the tag will be included in the preamble, just as with
12856 \begin_inset Flex Code
12859 \begin_layout Plain Layout
12866 What makes it special is the use of the
12867 \begin_inset Quotes eld
12871 \begin_inset Quotes erd
12875 \begin_inset Flex Code
12878 \begin_layout Plain Layout
12884 , which will be replaced, when LyX produces LaTeX output, with the translation
12885 of its argument into the document language.
12888 \begin_layout Standard
12890 \begin_inset Flex Code
12893 \begin_layout Plain Layout
12899 tag is more complex, since it is meant to provide support for multi-language
12900 documents and so offers an interface to the
12901 \begin_inset Flex Code
12904 \begin_layout Plain Layout
12911 Its contents will be added to the preamble once for each language that
12912 appears in the document.
12913 In this case, the argument to
12914 \begin_inset Flex Code
12917 \begin_layout Plain Layout
12923 will be replaced with its translation into the language in question; the
12925 \begin_inset Flex Code
12928 \begin_layout Plain Layout
12934 is replaced by the language name (as used by the babel package).
12937 \begin_layout Standard
12938 A German document that also included a French section would thus have the
12939 following in the preamble:
12942 \begin_layout LyX-Code
12951 claimname}{Affirmation}}
12959 claimname}{Behauptung}}
12963 claimname}{Behauptung}
12966 \begin_layout Standard
12968 \begin_inset Flex Code
12971 \begin_layout Plain Layout
12977 will then conspire to produce the correct text in the output.
12980 \begin_layout Standard
12981 One important point to note here is that the translations are provided by
12982 LyX itself, through the same mechanism it uses for internationalization
12983 of the user interface.
12984 This means, in effect, that
12985 \begin_inset Flex Code
12988 \begin_layout Plain Layout
12995 \begin_inset Flex Code
12998 \begin_layout Plain Layout
13004 are really only of use in layout files that are provided with LyX, since
13005 text entered in user-created layout files will not be seen by LyX's internation
13006 alization routines.
13007 That said, however, any layout created with the intention that it will
13008 be included with LyX should use these tags where appropriate.
13011 \begin_layout Subsection
13013 \begin_inset CommandInset label
13022 \begin_layout Standard
13023 Since version 1.3.0 of LyX, it is has been both possible and necessary to
13024 define the floats (
13025 \begin_inset Flex MenuItem
13028 \begin_layout Plain Layout
13035 \begin_inset Flex MenuItem
13038 \begin_layout Plain Layout
13044 , \SpecialChar \ldots{}
13045 ) in the text class itself.
13046 Standard floats are included in the file
13047 \begin_inset Flex Code
13050 \begin_layout Plain Layout
13056 , so you may have to do no more than add
13059 \begin_layout LyX-Code
13060 Input stdfloats.inc
13063 \begin_layout Standard
13064 to your layout file.
13065 If you want to implement a text class that proposes some other float types
13066 (like the AGU class bundled with LyX), the information below will hopefully
13070 \begin_layout Description
13071 \begin_inset Flex Code
13074 \begin_layout Plain Layout
13081 \begin_inset Flex Code
13084 \begin_layout Plain Layout
13091 \begin_inset Quotes erd
13095 \begin_inset Quotes erd
13098 ] The file name extension of an auxiliary file for the list of figures (or
13100 LaTeX writes the captions to this file.
13103 \begin_layout Description
13104 \begin_inset Flex Code
13107 \begin_layout Plain Layout
13114 \begin_inset Flex Code
13117 \begin_layout Plain Layout
13124 \begin_inset Quotes erd
13128 \begin_inset Quotes erd
13131 ] The string that will be used in the menus and also for the caption.
13132 This is translated to the current language if babel is used.
13135 \begin_layout Description
13136 \begin_inset Flex Code
13139 \begin_layout Plain Layout
13145 These are used for XHTML output.
13147 \begin_inset CommandInset ref
13149 reference "sec:Tags-for-XHTML"
13156 \begin_layout Description
13157 \begin_inset Flex Code
13160 \begin_layout Plain Layout
13169 \begin_inset Flex Code
13172 \begin_layout Plain Layout
13181 \begin_inset Flex Code
13184 \begin_layout Plain Layout
13190 ] Indicates whether the float is already defined in the document class or
13191 if we instead need to load
13192 \begin_inset Flex Code
13195 \begin_layout Plain Layout
13201 and use what it provides to define it on-the-fly.
13203 \begin_inset Flex Code
13206 \begin_layout Plain Layout
13213 \begin_inset Flex Code
13216 \begin_layout Plain Layout
13223 It should be set to
13224 \begin_inset Flex Code
13227 \begin_layout Plain Layout
13233 if the float is already defined by the LaTeX document class.
13236 \begin_layout Description
13237 \begin_inset Flex Code
13240 \begin_layout Plain Layout
13247 \begin_inset Flex Code
13250 \begin_layout Plain Layout
13257 \begin_inset Quotes erd
13261 \begin_inset Quotes erd
13264 ] The command used to generate a list of floats of this type; the leading
13267 ' should be omitted.
13273 \begin_inset Flex Code
13276 \begin_layout Plain Layout
13282 is false, since there is no standard way to generate this command.
13284 \begin_inset Flex Code
13287 \begin_layout Plain Layout
13293 is true, since in that case there is a standard way to define the command.
13296 \begin_layout Description
13297 \begin_inset Flex Code
13300 \begin_layout Plain Layout
13307 \begin_inset Flex Code
13310 \begin_layout Plain Layout
13317 \begin_inset Quotes erd
13321 \begin_inset Quotes erd
13324 ] A title for a list of floats of this kind (list of figures, tables, or
13326 It is used for the screen label within LyX; it is passed to LaTeX for use
13327 as the title there; and it is used as the title in XHTML output.
13328 It will be translated to the document language.
13331 \begin_layout Description
13332 \begin_inset Flex Code
13335 \begin_layout Plain Layout
13342 \begin_inset Flex Code
13345 \begin_layout Plain Layout
13352 \begin_inset Quotes erd
13356 \begin_inset Quotes erd
13359 ] This (optional) argument determines whether floats of this class will
13360 be numbered within some sectional unit of the document.
13361 For example, if within is equal to
13362 \begin_inset Flex Code
13365 \begin_layout Plain Layout
13371 , the floats will be numbered within chapters.
13375 \begin_layout Description
13376 \begin_inset Flex Code
13379 \begin_layout Plain Layout
13386 \begin_inset Flex Code
13389 \begin_layout Plain Layout
13396 \begin_inset Quotes erd
13400 \begin_inset Quotes erd
13403 ] The default placement for the given class of floats.
13404 The string should be as in standard LaTeX:
13405 \begin_inset Flex Code
13408 \begin_layout Plain Layout
13415 \begin_inset Flex Code
13418 \begin_layout Plain Layout
13425 \begin_inset Flex Code
13428 \begin_layout Plain Layout
13435 \begin_inset Flex Code
13438 \begin_layout Plain Layout
13444 for top, bottom, page, and here, respectively.
13448 \begin_layout Plain Layout
13449 Note that the order of these letters in the string is irrelevant, like in
13455 On top of that there is a new type,
13456 \begin_inset Flex Code
13459 \begin_layout Plain Layout
13465 , which does not really correspond to a float, since it means: put it
13466 \begin_inset Quotes eld
13470 \begin_inset Quotes erd
13474 Note however that the
13475 \begin_inset Flex Code
13478 \begin_layout Plain Layout
13484 specifier is special and, because of implementation details, cannot be
13485 used in non-built in float types.
13486 If you do not understand what this means, just use
13487 \begin_inset Quotes eld
13491 \begin_inset Flex Code
13494 \begin_layout Plain Layout
13501 \begin_inset Quotes erd
13507 \begin_layout Description
13508 \begin_inset Flex Code
13511 \begin_layout Plain Layout
13518 \begin_inset Flex Code
13521 \begin_layout Plain Layout
13527 ] The prefix to use when creating labels referring to floats of this type.
13528 This allows the use of formatted references.
13529 Note that you can remove any
13530 \begin_inset Flex Code
13533 \begin_layout Plain Layout
13539 set by a copied style by using the special value
13540 \begin_inset Quotes eld
13544 \begin_inset Quotes erd
13547 , which must be all caps.
13550 \begin_layout Description
13551 \begin_inset Flex Code
13554 \begin_layout Plain Layout
13561 \begin_inset Flex Code
13564 \begin_layout Plain Layout
13571 \begin_inset Quotes erd
13575 \begin_inset Quotes erd
13578 ] The style used when defining the float using
13579 \begin_inset Flex Code
13582 \begin_layout Plain Layout
13593 \begin_layout Description
13594 \begin_inset Flex Code
13597 \begin_layout Plain Layout
13604 \begin_inset Flex Code
13607 \begin_layout Plain Layout
13614 \begin_inset Quotes erd
13618 \begin_inset Quotes erd
13622 \begin_inset Quotes eld
13626 \begin_inset Quotes erd
13629 of the new class of floats, like program or algorithm.
13630 After the appropriate
13631 \begin_inset Flex Code
13634 \begin_layout Plain Layout
13643 \begin_inset Flex Code
13646 \begin_layout Plain Layout
13655 \begin_inset Flex Code
13658 \begin_layout Plain Layout
13669 \begin_layout Description
13670 \begin_inset Flex Code
13673 \begin_layout Plain Layout
13680 \begin_inset Flex Code
13683 \begin_layout Plain Layout
13690 \begin_inset Flex Code
13693 \begin_layout Plain Layout
13701 ] Tells us whether this float is defined using the facilities provided by
13703 \begin_inset Flex Code
13706 \begin_layout Plain Layout
13712 , either by the class file or a package, or on-the-fly by LyX itself.
13715 \begin_layout Standard
13716 Note that defining a float with type
13717 \begin_inset Flex Code
13720 \begin_layout Plain Layout
13728 automatically defines the corresponding counter with name
13729 \begin_inset Flex Code
13732 \begin_layout Plain Layout
13743 \begin_layout Subsection
13744 Flex insets and InsetLayout
13745 \begin_inset CommandInset label
13747 name "sub:Flex-insets-and"
13754 \begin_layout Standard
13755 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13756 these are called Flex insets.
13760 \begin_layout Standard
13761 Flex insets come in three different kinds:
13764 \begin_layout Itemize
13766 \begin_inset Flex Code
13769 \begin_layout Plain Layout
13775 ): These define semantic markup corresponding to such LaTeX commands as
13777 \begin_inset Flex Code
13780 \begin_layout Plain Layout
13789 \begin_inset Flex Code
13792 \begin_layout Plain Layout
13803 \begin_layout Itemize
13805 \begin_inset Flex Code
13808 \begin_layout Plain Layout
13814 ): These can be used to define custom collapsible insets, similar to TeX
13815 code, footnote, and the like.
13816 An obvious example is an endnote inset, which is defined in the
13817 \begin_inset Flex Code
13820 \begin_layout Plain Layout
13829 \begin_layout Itemize
13831 \begin_inset Flex Code
13834 \begin_layout Plain Layout
13840 ): For use with DocBook classes.
13843 \begin_layout Standard
13844 Flex insets are defined using the
13845 \begin_inset Flex Code
13848 \begin_layout Plain Layout
13854 tag, which shall be explained in a moment.
13857 \begin_layout Standard
13859 \begin_inset Flex Code
13862 \begin_layout Plain Layout
13868 tag also serves another function: It can be used to customize the general
13869 layout of many different types of insets.
13871 \begin_inset Flex Code
13874 \begin_layout Plain Layout
13880 can be used to customize the layout parameters for footnotes, marginal
13881 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13882 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13883 define Flex insets.
13886 \begin_layout Standard
13888 \begin_inset Flex Code
13891 \begin_layout Plain Layout
13897 definition must begin with a line of the form:
13900 \begin_layout LyX-Code
13904 \begin_layout Standard
13906 \begin_inset Flex Code
13909 \begin_layout Plain Layout
13915 indicates the inset whose layout is being defined, and here there are two
13919 \begin_layout Enumerate
13920 The layout for a pre-existing inset is being modified.
13921 In this case, can be
13922 \begin_inset Flex Code
13925 \begin_layout Plain Layout
13931 any one of the following:
13932 \begin_inset Flex Code
13935 \begin_layout Plain Layout
13942 \begin_inset Flex Code
13945 \begin_layout Plain Layout
13952 \begin_inset Flex Code
13955 \begin_layout Plain Layout
13962 \begin_inset Flex Code
13965 \begin_layout Plain Layout
13972 \begin_inset Flex Code
13975 \begin_layout Plain Layout
13982 \begin_inset Flex Code
13985 \begin_layout Plain Layout
13992 \begin_inset Flex Code
13995 \begin_layout Plain Layout
14002 \begin_inset Flex Code
14005 \begin_layout Plain Layout
14012 \begin_inset Flex Code
14015 \begin_layout Plain Layout
14022 \begin_inset Flex Code
14025 \begin_layout Plain Layout
14032 \begin_inset Flex Code
14035 \begin_layout Plain Layout
14042 \begin_inset Flex Code
14045 \begin_layout Plain Layout
14052 \begin_inset Flex Code
14055 \begin_layout Plain Layout
14062 \begin_inset Flex Code
14065 \begin_layout Plain Layout
14072 \begin_inset Flex Code
14075 \begin_layout Plain Layout
14082 \begin_inset Flex Code
14085 \begin_layout Plain Layout
14092 \begin_inset Flex Code
14095 \begin_layout Plain Layout
14102 \begin_inset Flex Code
14105 \begin_layout Plain Layout
14112 \begin_inset Flex Code
14115 \begin_layout Plain Layout
14122 \begin_inset Flex Code
14125 \begin_layout Plain Layout
14134 \begin_layout Enumerate
14135 The layout for a Flex inset is being defined.
14137 \begin_inset Flex Code
14140 \begin_layout Plain Layout
14146 must be of the form
14147 \begin_inset Quotes eld
14151 \begin_inset Flex Code
14154 \begin_layout Plain Layout
14161 \begin_inset Quotes erd
14165 \begin_inset Flex Code
14168 \begin_layout Plain Layout
14174 may be be any valid identifier not used by a pre-existing Flex inset.
14175 The identifier may include spaces, but in that case the whole thing must
14176 be wrapped in quotes.
14177 Note that the definition of a flex inset
14182 \begin_inset Flex Code
14185 \begin_layout Plain Layout
14191 entry, declaring which type of inset it defines.
14194 \begin_layout Standard
14196 \begin_inset Flex Code
14199 \begin_layout Plain Layout
14205 definition can contain the following entries:
14208 \begin_layout Description
14209 \begin_inset Flex Code
14212 \begin_layout Plain Layout
14218 The color for the inset's background.
14219 The valid colors are defined in
14220 \begin_inset Flex Code
14223 \begin_layout Plain Layout
14232 \begin_layout Description
14233 \begin_inset Flex Code
14236 \begin_layout Plain Layout
14243 \begin_inset Flex Code
14246 \begin_layout Plain Layout
14255 \begin_inset Flex Code
14258 \begin_layout Plain Layout
14264 ] Whether to use the content of the inset as the label, when the inset is
14269 \begin_layout Description
14270 \begin_inset Flex Code
14273 \begin_layout Plain Layout
14279 As with paragraph styles (see page
14280 \begin_inset CommandInset ref
14282 reference "des:CopyStyle"
14289 \begin_layout Description
14290 \begin_inset Flex Code
14293 \begin_layout Plain Layout
14300 \begin_inset Flex Code
14303 \begin_layout Plain Layout
14312 \begin_inset Flex Code
14315 \begin_layout Plain Layout
14321 ] Indicates whether the user may employ the Paragraph Settings dialog to
14322 customize the paragraph.
14325 \begin_layout Description
14326 \begin_inset Flex Code
14329 \begin_layout Plain Layout
14336 \begin_inset Flex Code
14339 \begin_layout Plain Layout
14346 \begin_inset Flex Code
14349 \begin_layout Plain Layout
14356 \begin_inset Flex Code
14359 \begin_layout Plain Layout
14365 , describing the rendering style used for the inset's frame and buttons.
14366 Footnotes generally use
14367 \begin_inset Flex Code
14370 \begin_layout Plain Layout
14376 , ERT insets generally
14377 \begin_inset Flex Code
14380 \begin_layout Plain Layout
14386 , and character styles
14387 \begin_inset Flex Code
14390 \begin_layout Plain Layout
14399 \begin_layout Description
14400 \begin_inset Flex Code
14403 \begin_layout Plain Layout
14410 \begin_inset Flex Code
14413 \begin_layout Plain Layout
14420 \begin_inset Flex Code
14423 \begin_layout Plain Layout
14432 \begin_inset Flex Code
14435 \begin_layout Plain Layout
14442 \begin_inset Flex Code
14445 \begin_layout Plain Layout
14452 Indicates whether the environment will stand on its own in LaTeX output
14453 or will appear inline with the surrounding text.
14454 If set to false, it is supposed that the LaTeX environment ignores white
14455 space (including one newline character) after the
14456 \begin_inset Flex Code
14459 \begin_layout Plain Layout
14472 \begin_inset Flex Code
14475 \begin_layout Plain Layout
14491 \begin_layout Description
14492 \begin_inset Flex Code
14495 \begin_layout Plain Layout
14501 Required at the end of the InsetLayout declarations.
14504 \begin_layout Description
14505 \begin_inset Flex Code
14508 \begin_layout Plain Layout
14514 The font used for both the text body
14520 \begin_inset space ~
14524 \begin_inset CommandInset ref
14526 reference "sub:Font-description"
14531 Note that defining this font automatically defines the
14532 \begin_inset Flex Code
14535 \begin_layout Plain Layout
14541 to the same value, so define this first and define
14542 \begin_inset Flex Code
14545 \begin_layout Plain Layout
14551 later if you want them to be different.
14554 \begin_layout Description
14555 \begin_inset Flex Code
14558 \begin_layout Plain Layout
14565 \begin_inset Quotes eld
14569 \begin_inset Quotes erd
14572 language, leading to Left-to-Right (latin) output, e.
14573 \begin_inset space \thinspace{}
14577 \begin_inset space \space{}
14580 in TeX code or URL.
14584 \begin_layout Description
14585 \begin_inset Flex Code
14588 \begin_layout Plain Layout
14595 \begin_inset Flex Code
14598 \begin_layout Plain Layout
14607 \begin_inset Flex Code
14610 \begin_layout Plain Layout
14616 ] Indicates whether the
14617 \begin_inset Flex Code
14620 \begin_layout Plain Layout
14626 should be used or, instead, the user can change the paragraph style used
14631 \begin_layout Description
14632 \begin_inset Flex Code
14635 \begin_layout Plain Layout
14641 As with paragraph styles (see page
14642 \begin_inset CommandInset ref
14643 LatexCommand pageref
14644 reference "des:FreeSpacing"
14652 \begin_layout Description
14653 \begin_inset Flex Code
14656 \begin_layout Plain Layout
14662 These tags control XHTML output.
14664 \begin_inset CommandInset ref
14666 reference "sec:Tags-for-XHTML"
14673 \begin_layout Description
14674 \begin_inset Flex Code
14677 \begin_layout Plain Layout
14684 \begin_inset Flex Code
14687 \begin_layout Plain Layout
14696 \begin_inset Flex Code
14699 \begin_layout Plain Layout
14705 ] Whether to include the contents of this inset in the strings generated
14706 for the `Outline' pane.
14707 One would not, for example, want the content of a footnote in a section
14708 header to be included in the TOC displayed in the outline, but one would
14709 normally want the content of a character style displayed.
14710 Default is false: not to include.
14713 \begin_layout Description
14714 \begin_inset Flex Code
14717 \begin_layout Plain Layout
14723 As with paragraph styles (see page
14724 \begin_inset CommandInset ref
14725 LatexCommand pageref
14726 reference "des:KeepEmpty"
14734 \begin_layout Description
14735 \begin_inset Flex Code
14738 \begin_layout Plain Layout
14744 The font used for the label.
14746 \begin_inset space ~
14750 \begin_inset CommandInset ref
14752 reference "sub:Font-description"
14757 Note that this definition can never appear before
14758 \begin_inset Flex Code
14761 \begin_layout Plain Layout
14767 , lest it be ineffective.
14770 \begin_layout Description
14771 \begin_inset Flex Code
14774 \begin_layout Plain Layout
14780 What will be displayed on the button or elsewhere as the inset label.
14782 \begin_inset Flex Code
14785 \begin_layout Plain Layout
14792 \begin_inset Flex Code
14795 \begin_layout Plain Layout
14801 ) modify this label on the fly.
14804 \begin_layout Description
14805 \begin_inset Flex Code
14808 \begin_layout Plain Layout
14814 The name of the corresponding LaTeX stuff.
14815 Either the environment or command name.
14818 \begin_layout Description
14819 \begin_inset Flex Code
14822 \begin_layout Plain Layout
14828 The optional parameter for the corresponding
14829 \begin_inset Flex Code
14832 \begin_layout Plain Layout
14838 stuff, including possible bracket pairs like
14839 \begin_inset Flex Code
14842 \begin_layout Plain Layout
14849 This parameter cannot be changed from within LyX.
14852 \begin_layout Description
14853 \begin_inset Flex Code
14856 \begin_layout Plain Layout
14862 As with paragraph styles (see page
14863 \begin_inset CommandInset ref
14864 LatexCommand pageref
14865 reference "des:LatexType"
14872 \begin_layout Description
14873 \begin_inset Flex Code
14876 \begin_layout Plain Layout
14883 \begin_inset Flex Code
14886 \begin_layout Plain Layout
14893 \begin_inset Flex Code
14896 \begin_layout Plain Layout
14903 \begin_inset Flex Code
14906 \begin_layout Plain Layout
14913 \begin_inset Flex Code
14916 \begin_layout Plain Layout
14922 (indicating a dummy definition ending definitions of charstyles, etc).
14923 This entry is required in and is only meaningful for Flex insets.
14924 Among other things, it determines on which menu this inset will appear.
14926 \begin_inset Flex Code
14929 \begin_layout Plain Layout
14936 \begin_inset Flex Code
14939 \begin_layout Plain Layout
14946 \begin_inset Flex Code
14949 \begin_layout Plain Layout
14957 \begin_inset Flex Code
14960 \begin_layout Plain Layout
14966 can be set to true for charstyle insets, if you wish, by setting it
14971 \begin_inset Flex Code
14974 \begin_layout Plain Layout
14983 \begin_layout Description
14984 \begin_inset Flex Code
14987 \begin_layout Plain Layout
14994 \begin_inset Flex Code
14997 \begin_layout Plain Layout
15006 \begin_inset Flex Code
15009 \begin_layout Plain Layout
15015 ] Whether multiple paragraphs are permitted in this inset.
15017 \begin_inset Flex Code
15020 \begin_layout Plain Layout
15026 to the same value and
15027 \begin_inset Flex Code
15030 \begin_layout Plain Layout
15036 to the opposite value.
15037 These can be reset to other values, if they are used
15042 \begin_inset Flex Code
15045 \begin_layout Plain Layout
15055 \begin_layout Description
15056 \begin_inset Flex Code
15059 \begin_layout Plain Layout
15066 \begin_inset Flex Code
15069 \begin_layout Plain Layout
15078 \begin_inset Flex Code
15081 \begin_layout Plain Layout
15087 ] Whether fragile commands in this inset should be
15088 \begin_inset Flex Code
15091 \begin_layout Plain Layout
15104 whether the command should itself be protected.) Default is false.
15107 \begin_layout Description
15108 \begin_inset Flex Code
15111 \begin_layout Plain Layout
15118 \begin_inset Flex Code
15121 \begin_layout Plain Layout
15130 \begin_inset Flex Code
15133 \begin_layout Plain Layout
15139 ] As with paragraph styles (see page
15140 \begin_inset CommandInset ref
15141 LatexCommand pageref
15142 reference "des:ParbreakIsNewline"
15150 \begin_layout Description
15151 \begin_inset Flex Code
15154 \begin_layout Plain Layout
15161 \begin_inset Flex Code
15164 \begin_layout Plain Layout
15173 \begin_inset Flex Code
15176 \begin_layout Plain Layout
15182 ] As with paragraph styles (see page
15183 \begin_inset CommandInset ref
15184 LatexCommand pageref
15185 reference "des:PassThru"
15193 \begin_layout Description
15194 \begin_inset Flex Code
15197 \begin_layout Plain Layout
15203 As with paragraph styles (see page
15204 \begin_inset CommandInset ref
15205 LatexCommand pageref
15206 reference "des:Preamble"
15213 \begin_layout Description
15214 \begin_inset Flex Code
15217 \begin_layout Plain Layout
15224 \begin_inset Flex Code
15227 \begin_layout Plain Layout
15233 ] The prefix to use when creating labels referring to insets of this type.
15234 This allows the use of formatted references.
15237 \begin_layout Description
15238 \begin_inset Flex Code
15241 \begin_layout Plain Layout
15248 \begin_inset Flex Code
15251 \begin_layout Plain Layout
15257 ] As with paragraph styles (see page
15258 \begin_inset CommandInset ref
15259 LatexCommand pageref
15260 reference "des:Requires"
15267 \begin_layout Description
15268 \begin_inset Flex Code
15271 \begin_layout Plain Layout
15278 \begin_inset Flex Code
15281 \begin_layout Plain Layout
15288 \begin_inset Flex Code
15291 \begin_layout Plain Layout
15299 ] Whether this inset should use the font of its surrounding environment
15301 Default is true: uses its own.
15304 \begin_layout Description
15305 \begin_inset Flex Code
15308 \begin_layout Plain Layout
15315 \begin_inset Flex Code
15318 \begin_layout Plain Layout
15325 \begin_inset Flex Code
15328 \begin_layout Plain Layout
15336 ] Spellcheck the contents of this inset.
15340 \begin_layout Subsection
15342 \begin_inset CommandInset label
15344 name "sub:Counters"
15351 \begin_layout Standard
15352 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15354 \begin_inset Flex MenuItem
15357 \begin_layout Plain Layout
15364 \begin_inset Flex MenuItem
15367 \begin_layout Plain Layout
15373 , \SpecialChar \ldots{}
15374 ) in the text class itself.
15375 The standard counters are defined in the file
15376 \begin_inset Flex Code
15379 \begin_layout Plain Layout
15385 , so you may have to do no more than add
15388 \begin_layout LyX-Code
15389 Input stdcounters.inc
15392 \begin_layout Standard
15393 to your layout file to get them to work.
15394 But if you want to define custom counters, then you can do so.
15395 The counter declaration must begin with:
15398 \begin_layout LyX-Code
15399 Counter CounterName
15402 \begin_layout Standard
15404 \begin_inset Flex Code
15407 \begin_layout Plain Layout
15413 ' is replaced by the name of the counter.
15414 And it must end with
15415 \begin_inset Quotes eld
15419 \begin_inset Flex Code
15422 \begin_layout Plain Layout
15429 \begin_inset Quotes erd
15433 The following parameters can also be used:
15436 \begin_layout Description
15437 \begin_inset Flex Code
15440 \begin_layout Plain Layout
15447 \begin_inset Flex Code
15450 \begin_layout Plain Layout
15457 \begin_inset Quotes erd
15461 \begin_inset Quotes erd
15464 ] When defined, this string defines how the counter is displayed.
15465 Setting this value sets
15466 \begin_inset Flex Code
15469 \begin_layout Plain Layout
15470 LabelStringAppendix
15476 The following special constructs can be used in the string:
15480 \begin_layout Itemize
15481 \begin_inset Flex Code
15484 \begin_layout Plain Layout
15492 will be replaced by the expansion of the
15493 \begin_inset Flex Code
15496 \begin_layout Plain Layout
15503 \begin_inset Flex Code
15506 \begin_layout Plain Layout
15507 LabelStringAppendix
15513 \begin_inset Flex Code
15516 \begin_layout Plain Layout
15526 \begin_layout Itemize
15527 counter values can be expressed using LaTeX-like macros
15528 \begin_inset Flex Code
15531 \begin_layout Plain Layout
15548 \begin_inset Flex Code
15551 \begin_layout Plain Layout
15563 \begin_layout Plain Layout
15573 Actually, the situation is a bit more complicated: any
15592 other than those described below will produce arabic numerals.
15593 It would not be surprising to see this change in the future.
15599 \begin_inset Flex Code
15602 \begin_layout Plain Layout
15608 : 1, 2, 3,\SpecialChar \ldots{}
15610 \begin_inset Flex Code
15613 \begin_layout Plain Layout
15619 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15621 \begin_inset Flex Code
15624 \begin_layout Plain Layout
15630 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15632 \begin_inset Flex Code
15635 \begin_layout Plain Layout
15641 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15643 \begin_inset Flex Code
15646 \begin_layout Plain Layout
15652 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15654 \begin_inset Flex Code
15657 \begin_layout Plain Layout
15663 for hebrew numerals.
15667 \begin_layout Standard
15668 If LabelString is not defined, a default value is constructed as follows:
15669 if the counter has a master counter
15670 \begin_inset Flex Code
15673 \begin_layout Plain Layout
15680 \begin_inset Flex Code
15683 \begin_layout Plain Layout
15690 \begin_inset Flex Code
15693 \begin_layout Plain Layout
15703 is used; otherwise the string
15704 \begin_inset Flex Code
15707 \begin_layout Plain Layout
15718 \begin_layout Description
15719 \begin_inset Flex Code
15722 \begin_layout Plain Layout
15723 LabelStringAppendix
15729 \begin_inset Flex Code
15732 \begin_layout Plain Layout
15739 \begin_inset Quotes erd
15743 \begin_inset Quotes erd
15747 \begin_inset Flex Code
15750 \begin_layout Plain Layout
15756 , but for use in the Appendix.
15759 \begin_layout Description
15760 \begin_inset Flex Code
15763 \begin_layout Plain Layout
15770 \begin_inset Flex Code
15773 \begin_layout Plain Layout
15780 \begin_inset Quotes erd
15784 \begin_inset Quotes erd
15787 ] A format for use with formatted references to this counter.
15788 For example, one might want to have references to section numbers appear
15790 \begin_inset Quotes eld
15794 \begin_inset Quotes erd
15798 The string should contain
15799 \begin_inset Quotes eld
15803 \begin_inset Quotes erd
15807 This will be replaced by the counter number itself.
15808 So, for sections, it would be: Section ##.
15811 \begin_layout Description
15812 \begin_inset Flex Code
15815 \begin_layout Plain Layout
15822 \begin_inset Flex Code
15825 \begin_layout Plain Layout
15832 \begin_inset Quotes erd
15836 \begin_inset Quotes erd
15839 ] If this is set to the name of another counter, the present counter will
15840 be reset every time the other one is increased.
15842 \begin_inset Flex Code
15845 \begin_layout Plain Layout
15852 \begin_inset Flex Code
15855 \begin_layout Plain Layout
15864 \begin_layout Subsection
15866 \begin_inset CommandInset label
15868 name "sub:Font-description"
15875 \begin_layout Standard
15876 A font description looks like this:
15879 \begin_layout LyX-Code
15889 \begin_layout LyX-Code
15893 \begin_layout LyX-Code
15897 \begin_layout Standard
15898 The following commands are available:
15901 \begin_layout Description
15902 \begin_inset Flex Code
15905 \begin_layout Plain Layout
15912 \begin_inset Flex Code
15915 \begin_layout Plain Layout
15924 \begin_inset Flex Code
15927 \begin_layout Plain Layout
15934 \begin_inset Flex Code
15937 \begin_layout Plain Layout
15944 \begin_inset Flex Code
15947 \begin_layout Plain Layout
15954 \begin_inset Flex Code
15957 \begin_layout Plain Layout
15964 \begin_inset Flex Code
15967 \begin_layout Plain Layout
15974 \begin_inset Flex Code
15977 \begin_layout Plain Layout
15984 \begin_inset Flex Code
15987 \begin_layout Plain Layout
15994 \begin_inset Flex Code
15997 \begin_layout Plain Layout
16006 \begin_layout Description
16007 \begin_inset Flex Code
16010 \begin_layout Plain Layout
16017 \begin_inset Flex Code
16020 \begin_layout Plain Layout
16029 \begin_inset Flex Code
16032 \begin_layout Plain Layout
16039 \begin_inset Flex Code
16042 \begin_layout Plain Layout
16051 \begin_layout Description
16052 \begin_inset Flex Code
16055 \begin_layout Plain Layout
16062 \begin_inset Flex Code
16065 \begin_layout Plain Layout
16071 ] Valid arguments are:
16072 \begin_inset Flex Code
16075 \begin_layout Plain Layout
16082 \begin_inset Flex Code
16085 \begin_layout Plain Layout
16092 \begin_inset Flex Code
16095 \begin_layout Plain Layout
16102 \begin_inset Flex Code
16105 \begin_layout Plain Layout
16112 \begin_inset Flex Code
16115 \begin_layout Plain Layout
16122 \begin_inset Flex Code
16125 \begin_layout Plain Layout
16132 Each of these turns on or off the corresponding attribute.
16134 \begin_inset Flex Code
16137 \begin_layout Plain Layout
16143 turns on emphasis, and
16144 \begin_inset Flex Code
16147 \begin_layout Plain Layout
16155 \begin_inset Newline newline
16158 If the latter seems puzzling, remember that the font settings for the present
16159 context are generally inherited from the surrounding context.
16161 \begin_inset Flex Code
16164 \begin_layout Plain Layout
16170 would turn off the emphasis that was anyway in effect, say, in a theorem
16174 \begin_layout Description
16175 \begin_inset Flex Code
16178 \begin_layout Plain Layout
16185 \begin_inset Flex Code
16188 \begin_layout Plain Layout
16197 \begin_inset Flex Code
16200 \begin_layout Plain Layout
16209 \begin_layout Description
16210 \begin_inset Flex Code
16213 \begin_layout Plain Layout
16220 \begin_inset Flex Code
16223 \begin_layout Plain Layout
16232 \begin_inset Flex Code
16235 \begin_layout Plain Layout
16242 \begin_inset Flex Code
16245 \begin_layout Plain Layout
16252 \begin_inset Flex Code
16255 \begin_layout Plain Layout
16264 \begin_layout Description
16265 \begin_inset Flex Code
16268 \begin_layout Plain Layout
16275 \begin_inset Flex Code
16278 \begin_layout Plain Layout
16285 \begin_inset Flex Code
16288 \begin_layout Plain Layout
16295 \begin_inset Flex Code
16298 \begin_layout Plain Layout
16307 \begin_inset Flex Code
16310 \begin_layout Plain Layout
16317 \begin_inset Flex Code
16320 \begin_layout Plain Layout
16327 \begin_inset Flex Code
16330 \begin_layout Plain Layout
16337 \begin_inset Flex Code
16340 \begin_layout Plain Layout
16347 \begin_inset Flex Code
16350 \begin_layout Plain Layout
16359 \begin_layout Subsection
16360 \begin_inset CommandInset label
16362 name "sub:Citation-format-description"
16366 Citation format description
16369 \begin_layout Standard
16371 \begin_inset Flex Code
16374 \begin_layout Plain Layout
16380 blocks are used to describe how bibliographic information should be displayed,
16381 both within LyX itself (in the citation dialog and in tooltips, for example)
16382 and in XHTML output.
16383 Such a block might look like this:
16386 \begin_layout LyX-Code
16390 \begin_layout LyX-Code
16394 \begin_layout LyX-Code
16398 \begin_layout LyX-Code
16402 \begin_layout Standard
16403 The individual lines define how the bibliographic information associated
16404 with an article or book, respectively, is to be displayed, and such a definitio
16405 n can be given for any `entry type' that might be present in a BibTeX file.
16406 LyX defines a default format in the source code that will be used if no
16407 specific definition has been given.
16408 LyX predefines several formats in the file
16409 \begin_inset Flex Code
16412 \begin_layout Plain Layout
16418 , which is included in most of LyX's document classes.
16421 \begin_layout Standard
16422 The definitions use a simple language that allows BibTeX keys to be replaced
16424 Keys should be enclosed in
16425 \begin_inset Flex Code
16428 \begin_layout Plain Layout
16435 \begin_inset Flex Code
16438 \begin_layout Plain Layout
16445 So a simple definition might look like this:
16448 \begin_layout LyX-Code
16450 \begin_inset Quotes eld
16454 \begin_inset Quotes erd
16460 \begin_layout Standard
16461 This would print the author, followed by a comma, followed by the title,
16462 in quotes, followed by a period.
16465 \begin_layout Standard
16466 Of course, sometimes you may want to print a key only if it exists.
16467 This can be done by using a conditional construction, such as:
16468 \begin_inset Flex Code
16471 \begin_layout Plain Layout
16473 \begin_inset space ~
16483 \begin_inset Flex Code
16486 \begin_layout Plain Layout
16492 key exists, then print
16493 \begin_inset Quotes eld
16497 \begin_inset space ~
16501 \begin_inset Quotes erd
16504 followed by the volume key.
16505 It is also possible to have an else clause in the conditional, such as:
16507 \begin_inset Flex Code
16510 \begin_layout Plain Layout
16511 {%author%[[%author%]][[%editor%, ed.]]}
16518 \begin_inset Flex Code
16521 \begin_layout Plain Layout
16527 key is printed if it exists; otherwise, the editor key is printed, followed
16529 \begin_inset Quotes eld
16533 \begin_inset space ~
16537 \begin_inset Quotes erd
16540 Note that the key is again enclosed in
16541 \begin_inset Flex Code
16544 \begin_layout Plain Layout
16550 signs; the entire conditional is enclosed in braces; and the if and else
16551 clauses are enclosed in double brackets,
16552 \begin_inset Quotes eld
16556 \begin_inset Flex Code
16559 \begin_layout Plain Layout
16566 \begin_inset Quotes eld
16570 \begin_inset Quotes eld
16574 \begin_inset Flex Code
16577 \begin_layout Plain Layout
16584 \begin_inset Quotes erd
16588 There must be no space between any of these.
16591 \begin_layout Standard
16592 There is one other piece of syntax available in definitions, which looks
16594 \begin_inset Flex Code
16597 \begin_layout Plain Layout
16604 This defines a piece of formatting information that is to be used when
16606 \begin_inset Quotes eld
16610 \begin_inset Quotes erd
16614 Obviously, we do not want to output HTML tags when writing plain text,
16615 so they should be wrapped in
16616 \begin_inset Quotes eld
16620 \begin_inset Quotes erd
16624 \begin_inset Quotes eld
16628 \begin_inset Quotes erd
16634 \begin_layout Standard
16635 Two special sorts of definitions are also possible in a
16636 \begin_inset Flex Code
16639 \begin_layout Plain Layout
16646 An example of the first would be:
16649 \begin_layout LyX-Code
16651 \begin_inset Quotes eld
16655 \begin_inset Quotes erd
16661 \begin_layout Standard
16662 This is an abbreviation, or macro, and it can be used by treating it as
16664 \begin_inset Flex Code
16667 \begin_layout Plain Layout
16675 \begin_inset Flex Code
16678 \begin_layout Plain Layout
16684 exactly as it would treat its definition.
16685 So, let us issue the obvious
16693 \begin_layout LyX-Code
16697 \begin_layout Standard
16698 or anything like it.
16699 LyX shouldn't go into an infinite loop, but it may go into a long one before
16703 \begin_layout Standard
16704 The second sort of special definition might look like this:
16707 \begin_layout LyX-Code
16711 \begin_layout Standard
16712 This defines a translatable piece of text, which allows relevant parts of
16713 the bibliography to be translated.
16714 It can be included in a definition by treating it as a key:
16715 \begin_inset Flex Code
16718 \begin_layout Plain Layout
16725 Several of these are predefined in
16726 \begin_inset Flex Code
16729 \begin_layout Plain Layout
16736 Note that these are not macros, in the sense just defined.
16737 They will not be expanded.
16740 \begin_layout Standard
16741 So here then is an example that use all these features:
16744 \begin_layout LyX-Code
16745 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16748 \begin_layout Standard
16749 This defines a macro that prints the author, followed by a comma, if the
16751 \begin_inset Flex Code
16754 \begin_layout Plain Layout
16760 key is defined, or else prints the name of the editor, followed by the
16762 \begin_inset Flex Code
16765 \begin_layout Plain Layout
16771 or its translation (it is by default
16772 \begin_inset Quotes eld
16776 \begin_inset Quotes erd
16780 \begin_inset Flex Code
16783 \begin_layout Plain Layout
16790 Note that this is in fact defined in
16791 \begin_inset Flex Code
16794 \begin_layout Plain Layout
16800 , so you can use it in your own definitions, or re-definitions, if you load
16804 \begin_layout Section
16805 \begin_inset CommandInset label
16807 name "sec:Tags-for-XHTML"
16811 Tags for XHTML output
16814 \begin_layout Standard
16815 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16816 by layout information.
16817 In general, LyX provides sensible defaults and, as mentioned earlier, it
16818 will even construct default CSS style rules from the other layout tags.
16819 For example, LyX will attempt to use the information provided in the
16820 \begin_inset Flex Code
16823 \begin_layout Plain Layout
16829 declaration for the Chapter style to write CSS that will appropriately
16830 format chapter headings.
16833 \begin_layout Standard
16834 In many cases, then, you may not have to do anything at all to get acceptable
16835 XHTML output for your own environments, custom insets, and so forth.
16836 But in some cases you will, and so LyX provides a number of layout tags
16837 that can be used to customize the XHTML and CSS that are generated.
16840 \begin_layout Standard
16841 Note that there are two tags,
16842 \begin_inset Flex Code
16845 \begin_layout Plain Layout
16852 \begin_inset Flex Code
16855 \begin_layout Plain Layout
16861 that may appear outside style and inset declarations.
16863 \begin_inset CommandInset ref
16865 reference "sub:General-text-class"
16869 for details on these.
16872 \begin_layout Subsection
16873 \begin_inset CommandInset label
16875 name "sub:Paragraph-Style-XHTML"
16882 \begin_layout Standard
16883 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16884 dealing with a normal paragraph, a command, or an environment, where this
16885 is itself determined by the contents of the corresponding
16886 \begin_inset Flex Code
16889 \begin_layout Plain Layout
16899 \begin_layout Standard
16900 For a command or normal paragraph, the output XHTML has the following form:
16903 \begin_layout LyX-Code
16905 \begin_inset Quotes erd
16909 \begin_inset Quotes erd
16915 \begin_layout LyX-Code
16917 \begin_inset Quotes erd
16921 \begin_inset Quotes erd
16927 \begin_layout LyX-Code
16928 Contents of the paragraph.
16931 \begin_layout LyX-Code
16935 \begin_layout Standard
16936 The label tags are of course omitted if the paragraph does not have a label.
16939 \begin_layout Standard
16940 For an environment that is not some sort of list, the XHTML takes this form:
16943 \begin_layout LyX-Code
16945 \begin_inset Quotes erd
16949 \begin_inset Quotes erd
16955 \begin_layout LyX-Code
16957 \begin_inset Quotes erd
16961 \begin_inset Quotes erd
16965 \begin_inset Quotes erd
16969 \begin_inset Quotes erd
16972 >Environment Label</labeltag>First paragraph.</itemtag>
16975 \begin_layout LyX-Code
16976 <itemtag>Second paragraph.</itemtag>
16979 \begin_layout LyX-Code
16983 \begin_layout Standard
16984 Note that the label is output only for the first paragraph, as it should
16985 be for a theorem, for example.
16989 \begin_layout Standard
16990 For a list, we have one of these forms:
16993 \begin_layout LyX-Code
16995 \begin_inset Quotes erd
16999 \begin_inset Quotes erd
17005 \begin_layout LyX-Code
17007 \begin_inset Quotes erd
17011 \begin_inset Quotes erd
17015 \begin_inset Quotes erd
17019 \begin_inset Quotes erd
17022 >List Label</labeltag>First item.</itemtag>
17025 \begin_layout LyX-Code
17027 \begin_inset Quotes erd
17031 \begin_inset Quotes erd
17035 \begin_inset Quotes erd
17039 \begin_inset Quotes erd
17042 >List Label</labeltag>Second item.</itemtag>
17045 \begin_layout LyX-Code
17049 \begin_layout LyX-Code
17053 \begin_layout LyX-Code
17055 \begin_inset Quotes erd
17059 \begin_inset Quotes erd
17065 \begin_layout LyX-Code
17067 \begin_inset Quotes erd
17071 \begin_inset Quotes erd
17074 >List Label</labeltag><itemtag attr=
17075 \begin_inset Quotes erd
17079 \begin_inset Quotes erd
17082 >First item.</itemtag>
17085 \begin_layout LyX-Code
17087 \begin_inset Quotes erd
17091 \begin_inset Quotes erd
17094 >List Label</labeltag><itemtag attr=
17095 \begin_inset Quotes erd
17099 \begin_inset Quotes erd
17102 >Second item.</itemtag>
17105 \begin_layout LyX-Code
17109 \begin_layout Standard
17110 Note the different orders of
17111 \begin_inset Flex Code
17114 \begin_layout Plain Layout
17121 \begin_inset Flex Code
17124 \begin_layout Plain Layout
17131 Which order we get depends upon the setting of
17132 \begin_inset Flex Code
17135 \begin_layout Plain Layout
17142 \begin_inset Flex Code
17145 \begin_layout Plain Layout
17151 is false (the default), you get the first of these, with the label within
17152 the item; if true, you get the second, with the label outside the item.
17155 \begin_layout Standard
17156 The specific tags and attributes output for each paragraph type can be controlle
17157 d by means of the layout tags we are about to describe.
17158 As mentioned earlier, however, LyX uses sensible defaults for many of these,
17159 so you often may not need to do very much to get good XHTML output.
17160 Think of the available tags as there so you can tweak things to your liking.
17163 \begin_layout Description
17164 \begin_inset Flex Code
17167 \begin_layout Plain Layout
17174 \begin_inset Flex Code
17177 \begin_layout Plain Layout
17183 ] Specifies attribute information to be output with the main tag.
17185 \begin_inset Quotes eld
17189 \begin_inset Flex Code
17192 \begin_layout Plain Layout
17199 \begin_inset Quotes erd
17203 By default, LyX will output
17204 \begin_inset Quotes eld
17208 \begin_inset Flex Code
17211 \begin_layout Plain Layout
17218 \begin_inset Quotes erd
17222 \begin_inset Flex Code
17225 \begin_layout Plain Layout
17231 is the LyX name of the layout, made lowercase, for example: chapter.
17236 contain any style information.
17238 \begin_inset Flex Code
17241 \begin_layout Plain Layout
17250 \begin_layout Description
17251 \begin_inset Flex Code
17254 \begin_layout Plain Layout
17261 \begin_inset Flex Code
17264 \begin_layout Plain Layout
17274 ] Whether to output the default CSS information LyX generates for this layout,
17275 even if additional information is explicitly provided via
17276 \begin_inset Flex Code
17279 \begin_layout Plain Layout
17287 \begin_inset Flex Code
17290 \begin_layout Plain Layout
17296 allows you to alter or augment the generated CSS, rather than to override
17299 \begin_inset Flex Code
17302 \begin_layout Plain Layout
17311 \begin_layout Description
17312 \begin_inset Flex Code
17315 \begin_layout Plain Layout
17322 \begin_inset Flex Code
17325 \begin_layout Plain Layout
17331 ] The tag to be used for individual paragraphs of environments, replacing
17333 \begin_inset Flex Code
17336 \begin_layout Plain Layout
17342 in the examples above.
17344 \begin_inset Flex Code
17347 \begin_layout Plain Layout
17356 \begin_layout Description
17357 \begin_inset Flex Code
17360 \begin_layout Plain Layout
17367 \begin_inset Flex Code
17370 \begin_layout Plain Layout
17376 ] Attributes for the item tag.
17378 \begin_inset Quotes eld
17382 \begin_inset Flex Code
17385 \begin_layout Plain Layout
17386 class=`layoutname_item'
17392 \begin_inset Quotes erd
17400 contain any style information.
17402 \begin_inset Flex Code
17405 \begin_layout Plain Layout
17414 \begin_layout Description
17415 \begin_inset Flex Code
17418 \begin_layout Plain Layout
17425 \begin_inset Flex Code
17428 \begin_layout Plain Layout
17434 ] The tag to be used for paragraph and item labels, replacing
17435 \begin_inset Flex Code
17438 \begin_layout Plain Layout
17444 in the examples above.
17446 \begin_inset Flex Code
17449 \begin_layout Plain Layout
17456 \begin_inset Flex Code
17459 \begin_layout Plain Layout
17466 \begin_inset Flex Code
17469 \begin_layout Plain Layout
17476 \begin_inset Flex Code
17479 \begin_layout Plain Layout
17480 Centered_Top_Environment
17485 , in which case it defaults to
17486 \begin_inset Flex Code
17489 \begin_layout Plain Layout
17498 \begin_layout Description
17499 \begin_inset Flex Code
17502 \begin_layout Plain Layout
17509 \begin_inset Flex Code
17512 \begin_layout Plain Layout
17518 ] Attributes for the label tag.
17520 \begin_inset Quotes eld
17524 \begin_inset Flex Code
17527 \begin_layout Plain Layout
17528 class=`layoutname_label'
17534 \begin_inset Quotes erd
17542 contain any style information.
17544 \begin_inset Flex Code
17547 \begin_layout Plain Layout
17556 \begin_layout Description
17557 \begin_inset Flex Code
17560 \begin_layout Plain Layout
17567 \begin_inset Flex Code
17570 \begin_layout Plain Layout
17580 ] Meaningful only for list-like environments, this tag controls whether
17581 the label tag is output before or inside the item tag.
17582 This is used, for example, in the description environment, where we want
17584 \begin_inset Flex Code
17587 \begin_layout Plain Layout
17588 <dt>\SpecialChar \ldots{}
17589 </dt><dd>\SpecialChar \ldots{}
17597 \begin_inset Flex Code
17600 \begin_layout Plain Layout
17606 : The label tag is output inside the item tag.
17609 \begin_layout Description
17610 \begin_inset Flex Code
17613 \begin_layout Plain Layout
17619 Information to be output in the
17620 \begin_inset Flex Code
17623 \begin_layout Plain Layout
17629 section when this style is used.
17630 This might, for example, be used to include a
17631 \begin_inset Flex Code
17634 \begin_layout Plain Layout
17641 \begin_inset Flex Code
17644 \begin_layout Plain Layout
17653 \begin_layout Description
17654 \begin_inset Flex Code
17657 \begin_layout Plain Layout
17663 CSS style information to be included when this style is used.
17664 Note that this will automatically be wrapped in a layout-generated
17665 \begin_inset Flex Code
17668 \begin_layout Plain Layout
17674 block, so only the CSS itself need be included.
17677 \begin_layout Description
17678 \begin_inset Flex Code
17681 \begin_layout Plain Layout
17688 \begin_inset Flex Code
17691 \begin_layout Plain Layout
17697 ] The tag to be used for the main label, replacing
17698 \begin_inset Flex Code
17701 \begin_layout Plain Layout
17707 in the examples above.
17709 \begin_inset Flex Code
17712 \begin_layout Plain Layout
17721 \begin_layout Description
17722 \begin_inset Flex Code
17725 \begin_layout Plain Layout
17732 \begin_inset Flex Code
17735 \begin_layout Plain Layout
17745 ] Marks this style as the one to be used to generate the
17746 \begin_inset Flex Code
17749 \begin_layout Plain Layout
17755 tag for the XHTML file.
17756 By default, it is false.
17758 \begin_inset Flex Code
17761 \begin_layout Plain Layout
17767 file sets it to true for the
17768 \begin_inset Flex Code
17771 \begin_layout Plain Layout
17781 \begin_layout Subsection
17785 \begin_layout Standard
17786 The XHTML output of insets can also be controlled by information in layout
17791 \begin_layout Plain Layout
17792 At present, this is true only for
17793 \begin_inset Quotes eld
17797 \begin_inset Quotes erd
17800 insets (insets you can type into) and is not true for
17801 \begin_inset Quotes eld
17805 \begin_inset Quotes erd
17808 insets (insets that are associated with dialog boxes).
17813 Here, too, LyX tries to provide sensible defaults, and it constructs default
17815 But everything can be customized.
17818 \begin_layout Standard
17819 The XHTML LyX outputs for an inset has the following form:
17822 \begin_layout LyX-Code
17824 \begin_inset Quotes erd
17828 \begin_inset Quotes erd
17834 \begin_layout LyX-Code
17835 <labeltag>Label</labeltag>
17838 \begin_layout LyX-Code
17840 \begin_inset Quotes erd
17844 \begin_inset Quotes erd
17847 >Contents of the inset.</innertag>
17850 \begin_layout LyX-Code
17854 \begin_layout Standard
17855 If the inset permits multiple paragraphs---that is, if
17856 \begin_inset Flex Code
17859 \begin_layout Plain Layout
17865 is true---then the contents of the inset will itself be output as paragraphs
17866 formatted according to the styles used for those paragraphs (standard,
17867 quote, and the like).
17868 The label tag is of course omitted if the paragraph does not have a label
17869 and, at present, is always
17870 \begin_inset Flex Code
17873 \begin_layout Plain Layout
17880 The inner tag is optional and, by default, does not appear.
17883 \begin_layout Standard
17884 The specific tags and attributes output for each inset can be controlled
17885 by means of the following layout tags.
17888 \begin_layout Description
17889 \begin_inset Flex Code
17892 \begin_layout Plain Layout
17899 \begin_inset Flex Code
17902 \begin_layout Plain Layout
17908 ] Specifies attribute information to be output with the main tag.
17910 \begin_inset Quotes eld
17914 \begin_inset Flex Code
17917 \begin_layout Plain Layout
17918 class=`myinset' onclick=`\SpecialChar \ldots{}
17925 \begin_inset Quotes erd
17929 By default, LyX will output
17930 \begin_inset Quotes eld
17934 \begin_inset Flex Code
17937 \begin_layout Plain Layout
17944 \begin_inset Quotes erd
17948 \begin_inset Flex Code
17951 \begin_layout Plain Layout
17957 is the LyX name of the inset, made lowercase and with non-alphanumeric
17958 characters converted to underscores, for example: footnote.
17961 \begin_layout Description
17962 \begin_inset Flex Code
17965 \begin_layout Plain Layout
17972 \begin_inset Flex Code
17975 \begin_layout Plain Layout
17985 ] Whether to output the default CSS information LyX generates for this layout,
17986 even if additional information is explicitly provided via
17987 \begin_inset Flex Code
17990 \begin_layout Plain Layout
17998 \begin_inset Flex Code
18001 \begin_layout Plain Layout
18007 allows you to alter or augment the generated CSS, rather than to override
18012 \begin_layout Description
18013 \begin_inset Flex Code
18016 \begin_layout Plain Layout
18023 \begin_inset Flex Code
18026 \begin_layout Plain Layout
18032 ] Attributes for the inner tag.
18034 \begin_inset Quotes eld
18038 \begin_inset Flex Code
18041 \begin_layout Plain Layout
18042 class=`insetname_inner'
18048 \begin_inset Quotes erd
18054 \begin_layout Description
18055 \begin_inset Flex Code
18058 \begin_layout Plain Layout
18065 \begin_inset Flex Code
18068 \begin_layout Plain Layout
18074 ] The inner tag, replacing
18075 \begin_inset Flex Code
18078 \begin_layout Plain Layout
18084 in the examples above.
18085 By default, there is none.
18088 \begin_layout Description
18089 \begin_inset Flex Code
18092 \begin_layout Plain Layout
18099 \begin_inset Flex Code
18102 \begin_layout Plain Layout
18110 ] Whether this inset represents a standalone block of text (such as a footnote)
18111 or instead represents material that is included in the surrounding text
18112 (such as a branch).
18116 \begin_layout Description
18117 \begin_inset Flex Code
18120 \begin_layout Plain Layout
18127 \begin_inset Flex Code
18130 \begin_layout Plain Layout
18136 ] A label for this inset, possibly including a reference to a counter.
18137 For example, for footnote, it might be:
18138 \begin_inset Flex Code
18141 \begin_layout Plain Layout
18150 This is optional, and there is no default.
18153 \begin_layout Description
18154 \begin_inset Flex Code
18157 \begin_layout Plain Layout
18163 Information to be output in the
18164 \begin_inset Flex Code
18167 \begin_layout Plain Layout
18173 section when this style is used.
18174 This might, for example, be used to include a
18175 \begin_inset Flex Code
18178 \begin_layout Plain Layout
18185 \begin_inset Flex Code
18188 \begin_layout Plain Layout
18197 \begin_layout Description
18198 \begin_inset Flex Code
18201 \begin_layout Plain Layout
18207 CSS style information to be included when this style is used.
18208 Note that this will automatically be wrapped in a layout-generated
18209 \begin_inset Flex Code
18212 \begin_layout Plain Layout
18218 block, so only the CSS itself need be included.
18221 \begin_layout Description
18222 \begin_inset Flex Code
18225 \begin_layout Plain Layout
18232 \begin_inset Flex Code
18235 \begin_layout Plain Layout
18241 ] The tag to be used for the main label, replacing
18242 \begin_inset Flex Code
18245 \begin_layout Plain Layout
18251 in the examples above.
18252 The default depends upon the setting of
18253 \begin_inset Flex Code
18256 \begin_layout Plain Layout
18263 \begin_inset Flex Code
18266 \begin_layout Plain Layout
18272 is true, the default is
18273 \begin_inset Flex Code
18276 \begin_layout Plain Layout
18282 ; if it is false, the default is
18283 \begin_inset Flex Code
18286 \begin_layout Plain Layout
18295 \begin_layout Subsection
18299 \begin_layout Standard
18300 The XHTML output for floats too can be controlled by layout information.
18301 The output has the following form:
18304 \begin_layout LyX-Code
18306 \begin_inset Quotes erd
18310 \begin_inset Quotes erd
18316 \begin_layout LyX-Code
18317 Contents of the float.
18320 \begin_layout LyX-Code
18324 \begin_layout Standard
18325 The caption, if there is one, is a separate inset and will be output as
18327 Its appearance can be controlled via the InsetLayout for caption insets.
18331 \begin_layout Description
18332 \begin_inset Flex Code
18335 \begin_layout Plain Layout
18342 \begin_inset Flex Code
18345 \begin_layout Plain Layout
18351 ] Specifies attribute information to be output with the main tag.
18353 \begin_inset Quotes eld
18357 \begin_inset Flex Code
18360 \begin_layout Plain Layout
18361 class=`myfloat' onclick=`\SpecialChar \ldots{}
18368 \begin_inset Quotes erd
18372 By default, LyX will output
18373 \begin_inset Quotes eld
18377 \begin_inset Flex Code
18380 \begin_layout Plain Layout
18381 class=`float float-floattype'
18387 \begin_inset Quotes erd
18391 \begin_inset Flex Code
18394 \begin_layout Plain Layout
18400 is LyX's name for this type of float, as determined by the float declaration
18402 \begin_inset CommandInset ref
18404 reference "sub:Floats"
18408 ), though made lowercase and with non-alphanumeric characters converted
18409 to underscores, for example: float-table.
18412 \begin_layout Description
18413 \begin_inset Flex Code
18416 \begin_layout Plain Layout
18422 CSS style information to be included when this float is used.
18423 Note that this will automatically be wrapped in a layout-generated
18424 \begin_inset Flex Code
18427 \begin_layout Plain Layout
18433 block, so only the CSS itself need be included.
18436 \begin_layout Description
18437 \begin_inset Flex Code
18440 \begin_layout Plain Layout
18447 \begin_inset Flex Code
18450 \begin_layout Plain Layout
18456 ] The tag to be used for this float, replacing
18457 \begin_inset Quotes eld
18461 \begin_inset Flex Code
18464 \begin_layout Plain Layout
18471 \begin_inset Quotes erd
18474 in the example above.
18476 \begin_inset Flex Code
18479 \begin_layout Plain Layout
18485 and will rarely need changing.
18488 \begin_layout Subsection
18489 Bibliography formatting
18492 \begin_layout Standard
18493 The bibliography can be formatted using
18494 \begin_inset Flex Code
18497 \begin_layout Plain Layout
18505 \begin_inset CommandInset ref
18507 reference "sub:Citation-format-description"
18514 \begin_layout Subsection
18518 \begin_layout Standard
18519 We have several times mentioned that LyX will generate default CSS style
18520 rules for both insets and paragraph styles, based upon the other layout
18521 information that is provided.
18522 In this section, we shall say a word about which layout information LyX
18526 \begin_layout Standard
18527 At present, LyX auto-generates CSS only for font information, making use
18529 \begin_inset Flex Code
18532 \begin_layout Plain Layout
18539 \begin_inset Flex Code
18542 \begin_layout Plain Layout
18549 \begin_inset Flex Code
18552 \begin_layout Plain Layout
18559 \begin_inset Flex Code
18562 \begin_layout Plain Layout
18569 \begin_inset Flex Code
18572 \begin_layout Plain Layout
18580 \begin_inset CommandInset ref
18582 reference "sub:Font-description"
18586 .) The translation is mostly straightforward and obvious.
18588 \begin_inset Quotes eld
18592 \begin_inset Flex Code
18595 \begin_layout Plain Layout
18602 \begin_inset Quotes erd
18606 \begin_inset Quotes eld
18610 \begin_inset Flex Code
18613 \begin_layout Plain Layout
18614 font-family: sans-serif;
18620 \begin_inset Quotes erd
18624 The correspondence of LyX sizes and CSS sizes is a little less obvious
18625 but nonetheless intuitive.
18627 \begin_inset Flex Code
18630 \begin_layout Plain Layout
18637 \begin_inset Flex URL
18640 \begin_layout Plain Layout
18651 \begin_layout Chapter
18652 Including External Material
18655 \begin_layout Standard
18656 \begin_inset Box Shadowbox
18666 height_special "totalheight"
18669 \begin_layout Plain Layout
18670 WARNING: This portion of the documentation has not been updated for some
18672 We certainly hope that it is still accurate, but there are no guarantees.
18680 \begin_layout Standard
18681 The use of material from sources external to LyX is covered in detail in
18687 This part of the manual covers what needs to happen behind the scenes for
18688 new sorts of material to be included.
18691 \begin_layout Section
18695 \begin_layout Standard
18696 The external material feature is based on the concept of a
18701 A template is a specification of how LyX should interface with a certain
18703 As bundled, LyX comes with predefined templates for Xfig figures, various
18704 raster format images, chess diagrams, and LilyPond music notation.
18705 You can check the actual list by using the menu
18706 \begin_inset Flex MenuItem
18709 \begin_layout Plain Layout
18710 Insert\SpecialChar \menuseparator
18711 File\SpecialChar \menuseparator
18718 Furthermore, it is possible to roll your own template to support a specific
18720 Later we'll describe in more detail what is involved, and hopefully you
18721 will submit all the templates you create so we can include them in a later
18725 \begin_layout Standard
18726 Another basic idea of the external material feature is to distinguish between
18727 the original file that serves as a base for final material and the produced
18728 file that is included in your exported or printed document.
18729 For example, consider the case of a figure produced with
18730 \begin_inset Flex Code
18733 \begin_layout Plain Layout
18740 The Xfig application itself works on an original file with the
18741 \begin_inset Flex Code
18744 \begin_layout Plain Layout
18751 Within Xfig, you create and change your figure, and when you are done,
18753 \begin_inset Flex Code
18756 \begin_layout Plain Layout
18763 When you want to include the figure in your document, you invoke
18764 \begin_inset Flex Code
18767 \begin_layout Plain Layout
18773 in order to create a PostScript file that can readily be included in your
18776 \begin_inset Flex Code
18779 \begin_layout Plain Layout
18785 file is the original file, and the PostScript file is the produced file.
18788 \begin_layout Standard
18789 This distinction is important in order to allow updating of the material
18790 while you are in the process of writing the document.
18791 Furthermore, it provides us with the flexibility that is needed to support
18792 multiple export formats.
18793 For instance, in the case of a plain text file, it is not exactly an award-winn
18794 ing idea to include the figure as raw PostScript.
18795 Instead, you'd either prefer to just include a reference to the figure
18796 or try to invoke some graphics to ASCII converter to make the final result
18797 look similar to the real graphics.
18798 The external material management allows you to do this, because it is parametri
18799 zed on the different export formats that LyX supports.
18802 \begin_layout Standard
18803 Besides supporting the production of different products according to the
18804 exported format, it supports tight integration with editing and viewing
18806 In the case of an Xfig figure, you are able to invoke Xfig on the original
18807 file with a single click from within the external material dialog in LyX,
18808 and also preview the produced PostScript file with Ghostview with another
18810 No more fiddling around with the command line and/or file browsers to locate
18811 and manipulate the original or produced files.
18812 In this way, you are finally able to take full advantage of the many different
18813 applications that are relevant to use when you write your documents, and
18814 ultimately be more productive.
18817 \begin_layout Section
18818 The external template configuration file
18821 \begin_layout Standard
18822 It is relatively easy to add custom external template definitions to LyX.
18823 However, be aware that doing this in an careless manner most probably
18827 introduce an easily exploitable security hole.
18828 So before you do this, please read the discussion about security in section
18830 \begin_inset CommandInset ref
18832 reference "sec:Security-discussion"
18839 \begin_layout Standard
18840 Having said that, we encourage you to submit any interesting templates that
18845 \begin_layout Standard
18846 The external templates are defined in the
18847 \begin_inset Flex Code
18850 \begin_layout Plain Layout
18851 LyXDir/lib/external_templates
18857 You can place your own version in
18858 \begin_inset Flex Code
18861 \begin_layout Plain Layout
18862 UserDir/external_templates
18870 \begin_layout Standard
18871 A typical template looks like this:
18874 \begin_layout LyX-Code
18878 \begin_layout LyX-Code
18879 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18882 \begin_layout LyX-Code
18886 \begin_layout LyX-Code
18890 \begin_layout LyX-Code
18894 \begin_layout LyX-Code
18898 \begin_layout LyX-Code
18902 \begin_layout LyX-Code
18903 AutomaticProduction true
18906 \begin_layout LyX-Code
18910 \begin_layout LyX-Code
18914 \begin_layout LyX-Code
18918 \begin_layout LyX-Code
18919 TransformCommand Rotate RotationLatexCommand
18922 \begin_layout LyX-Code
18923 TransformCommand Resize ResizeLatexCommand
18926 \begin_layout LyX-Code
18927 Product "$$RotateFront$$ResizeFront
18930 \begin_layout LyX-Code
18935 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18938 \begin_layout LyX-Code
18939 $$ResizeBack$$RotateBack"
18942 \begin_layout LyX-Code
18946 \begin_layout LyX-Code
18947 UpdateResult "$$AbsPath$$Basename.pstex_t"
18950 \begin_layout LyX-Code
18951 Requirement "graphicx"
18954 \begin_layout LyX-Code
18955 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18958 \begin_layout LyX-Code
18959 ReferencedFile latex "$$AbsPath$$Basename.eps"
18962 \begin_layout LyX-Code
18963 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18966 \begin_layout LyX-Code
18970 \begin_layout LyX-Code
18974 \begin_layout LyX-Code
18975 TransformCommand Rotate RotationLatexCommand
18978 \begin_layout LyX-Code
18979 TransformCommand Resize ResizeLatexCommand
18982 \begin_layout LyX-Code
18983 Product "$$RotateFront$$ResizeFront
18986 \begin_layout LyX-Code
18991 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18994 \begin_layout LyX-Code
18995 $$ResizeBack$$RotateBack"
18998 \begin_layout LyX-Code
18999 UpdateFormat pdftex
19002 \begin_layout LyX-Code
19003 UpdateResult "$$AbsPath$$Basename.pdftex_t"
19006 \begin_layout LyX-Code
19007 Requirement "graphicx"
19010 \begin_layout LyX-Code
19011 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
19014 \begin_layout LyX-Code
19015 ReferencedFile latex "$$AbsPath$$Basename.pdf"
19018 \begin_layout LyX-Code
19022 \begin_layout LyX-Code
19026 \begin_layout LyX-Code
19027 Product "$$Contents(
19029 "$$AbsPath$$Basename.asc
19034 \begin_layout LyX-Code
19035 UpdateFormat asciixfig
19038 \begin_layout LyX-Code
19039 UpdateResult "$$AbsPath$$Basename.asc"
19042 \begin_layout LyX-Code
19046 \begin_layout LyX-Code
19050 \begin_layout LyX-Code
19051 Product "<graphic fileref=
19053 "$$AbsOrRelPathMaster$$Basename.eps
19058 \begin_layout LyX-Code
19062 \begin_layout LyX-Code
19066 \begin_layout LyX-Code
19067 UpdateResult "$$AbsPath$$Basename.eps"
19070 \begin_layout LyX-Code
19071 ReferencedFile docbook "$$AbsPath$$Basename.eps"
19074 \begin_layout LyX-Code
19075 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
19078 \begin_layout LyX-Code
19082 \begin_layout LyX-Code
19083 Product "[XFig: $$FName]"
19086 \begin_layout LyX-Code
19090 \begin_layout LyX-Code
19094 \begin_layout Standard
19095 As you can see, the template is enclosed in
19096 \begin_inset Flex Code
19099 \begin_layout Plain Layout
19105 \SpecialChar \ldots{}
19107 \begin_inset Flex Code
19110 \begin_layout Plain Layout
19117 It contains a header specifying some general settings and, for each supported
19118 primary document file format, a section
19119 \begin_inset Flex Code
19122 \begin_layout Plain Layout
19128 \SpecialChar \ldots{}
19130 \begin_inset Flex Code
19133 \begin_layout Plain Layout
19142 \begin_layout Subsection
19143 The template header
19146 \begin_layout Description
19147 \begin_inset Flex Code
19150 \begin_layout Plain Layout
19151 AutomaticProduction
19152 \begin_inset space ~
19160 Whether the file represented by the template must be generated by LyX.
19161 This command must occur exactly once.
19164 \begin_layout Description
19165 \begin_inset Flex Code
19168 \begin_layout Plain Layout
19170 \begin_inset space ~
19178 A glob pattern that is used in the file dialog to filter out the desired
19180 If there is more than one possible file extension (e.
19181 \begin_inset space \thinspace{}
19185 \begin_inset space \space{}
19189 \begin_inset Flex Code
19192 \begin_layout Plain Layout
19199 \begin_inset Flex Code
19202 \begin_layout Plain Layout
19208 ), use something like
19209 \begin_inset Flex Code
19212 \begin_layout Plain Layout
19219 This command must occur exactly once.
19222 \begin_layout Description
19223 \begin_inset Flex Code
19226 \begin_layout Plain Layout
19228 \begin_inset space ~
19236 The text that is displayed on the button.
19237 This command must occur exactly once.
19240 \begin_layout Description
19241 \begin_inset Flex Code
19244 \begin_layout Plain Layout
19246 \begin_inset space ~
19250 \begin_inset space ~
19258 The help text that is used in the External dialog.
19259 Provide enough information to explain to the user just what the template
19260 can provide him with.
19261 This command must occur exactly once.
19264 \begin_layout Description
19265 \begin_inset Flex Code
19268 \begin_layout Plain Layout
19270 \begin_inset space ~
19278 The file format of the original file.
19279 This must be the name of a format that is known to LyX (see section
19280 \begin_inset space ~
19284 \begin_inset CommandInset ref
19286 reference "sec:Formats"
19292 \begin_inset Quotes eld
19296 \begin_inset Flex Code
19299 \begin_layout Plain Layout
19306 \begin_inset Quotes erd
19309 if the template can handle original files of more than one format.
19310 LyX will attempt to interrogate the file itself in order to deduce its
19311 format in this case.
19312 This command must occur exactly once.
19315 \begin_layout Description
19316 \begin_inset Flex Code
19319 \begin_layout Plain Layout
19321 \begin_inset space ~
19329 A unique name for the template.
19330 It must not contain substitution macros (see below).
19333 \begin_layout Description
19334 \begin_inset Flex Code
19337 \begin_layout Plain Layout
19339 \begin_inset space ~
19342 Rotate|Resize|Clip|Extra
19347 This command specifies which transformations are supported by this template.
19348 It may occur zero or more times.
19349 This command enables the corresponding tabs in the external dialog.
19351 \begin_inset Flex Code
19354 \begin_layout Plain Layout
19360 command must have either a corresponding
19361 \begin_inset Flex Code
19364 \begin_layout Plain Layout
19371 \begin_inset Flex Code
19374 \begin_layout Plain Layout
19381 \begin_inset Flex Code
19384 \begin_layout Plain Layout
19391 Otherwise the transformation will not be supported by that format.
19394 \begin_layout Subsection
19398 \begin_layout Description
19399 \begin_inset Flex Code
19402 \begin_layout Plain Layout
19404 \begin_inset space ~
19407 LaTeX|PDFLaTeX|PlainText|DocBook
19412 The primary document file format that this format definition is for.
19413 Not every template has a sensible representation in all document file formats.
19414 Please define nevertheless a
19415 \begin_inset Flex Code
19418 \begin_layout Plain Layout
19424 section for all templates.
19425 Use a dummy text when no representation is available.
19426 Then you can at least see a reference to the external material in the exported
19430 \begin_layout Description
19431 \begin_inset Flex Code
19434 \begin_layout Plain Layout
19436 \begin_inset space ~
19440 \begin_inset space ~
19448 This command defines an additional macro
19449 \begin_inset Flex Code
19452 \begin_layout Plain Layout
19458 for substitution in
19459 \begin_inset Flex Code
19462 \begin_layout Plain Layout
19470 \begin_inset Flex Code
19473 \begin_layout Plain Layout
19479 itself may contain substitution macros.
19480 The advantage over using
19481 \begin_inset Flex Code
19484 \begin_layout Plain Layout
19491 \begin_inset Flex Code
19494 \begin_layout Plain Layout
19500 is that the substituted value of
19501 \begin_inset Flex Code
19504 \begin_layout Plain Layout
19510 is sanitized so that it is a valid optional argument in the document format.
19511 This command may occur zero or more times.
19514 \begin_layout Description
19515 \begin_inset Flex Code
19518 \begin_layout Plain Layout
19520 \begin_inset space ~
19528 The text that is inserted in the exported document.
19529 This is actually the most important command and can be quite complex.
19530 This command must occur exactly once.
19533 \begin_layout Description
19534 \begin_inset Flex Code
19537 \begin_layout Plain Layout
19539 \begin_inset space ~
19547 This command specifies a preamble snippet that will be included in the
19549 It has to be defined using
19550 \begin_inset Flex Code
19553 \begin_layout Plain Layout
19559 \SpecialChar \ldots{}
19561 \begin_inset Flex Code
19564 \begin_layout Plain Layout
19571 This command may occur zero or more times.
19574 \begin_layout Description
19575 \begin_inset Flex Code
19578 \begin_layout Plain Layout
19580 \begin_inset space ~
19584 \begin_inset space ~
19592 This command denotes files that are created by the conversion process and
19593 are needed for a particular export format.
19594 If the filename is relative, it is interpreted relative to the master document.
19595 This command may be given zero or more times.
19598 \begin_layout Description
19599 \begin_inset Flex Code
19602 \begin_layout Plain Layout
19604 \begin_inset space ~
19612 The name of a required LaTeX package.
19613 The package is included via
19614 \begin_inset Flex Code
19617 \begin_layout Plain Layout
19625 in the LaTeX preamble.
19626 This command may occur zero or more times.
19629 \begin_layout Description
19630 \begin_inset Flex Code
19633 \begin_layout Plain Layout
19635 \begin_inset space ~
19639 \begin_inset space ~
19642 RotationLatexCommand
19647 This command specifies that the built in LaTeX command should be used for
19649 This command may occur once or not at all.
19652 \begin_layout Description
19653 \begin_inset Flex Code
19656 \begin_layout Plain Layout
19658 \begin_inset space ~
19662 \begin_inset space ~
19670 This command specifies that the built in LaTeX command should be used for
19672 This command may occur once or not at all.
19675 \begin_layout Description
19676 \begin_inset Flex Code
19679 \begin_layout Plain Layout
19681 \begin_inset space ~
19685 \begin_inset space ~
19688 RotationLatexOption
19693 This command specifies that rotation is done via an optional argument.
19694 This command may occur once or not at all.
19697 \begin_layout Description
19698 \begin_inset Flex Code
19701 \begin_layout Plain Layout
19703 \begin_inset space ~
19707 \begin_inset space ~
19715 This command specifies that resizing is done via an optional argument.
19716 This command may occur once or not at all.
19719 \begin_layout Description
19720 \begin_inset Flex Code
19723 \begin_layout Plain Layout
19725 \begin_inset space ~
19729 \begin_inset space ~
19737 This command specifies that clipping is done via an optional argument.
19738 This command may occur once or not at all.
19741 \begin_layout Description
19742 \begin_inset Flex Code
19745 \begin_layout Plain Layout
19747 \begin_inset space ~
19751 \begin_inset space ~
19759 This command specifies that an extra optional argument is used.
19760 This command may occur once or not at all.
19763 \begin_layout Description
19764 \begin_inset Flex Code
19767 \begin_layout Plain Layout
19769 \begin_inset space ~
19777 The file format of the converted file.
19778 This must be the name of a format that is known to LyX (see the
19779 \begin_inset Flex MenuItem
19782 \begin_layout Plain Layout
19787 ools\SpecialChar \menuseparator
19792 references\SpecialChar \menuseparator
19793 File Handling\SpecialChar \menuseparator
19800 This command must occur exactly once.
19803 \begin_layout Description
19804 \begin_inset Flex Code
19807 \begin_layout Plain Layout
19809 \begin_inset space ~
19817 The file name of the converted file.
19818 The file name must be absolute.
19819 This command must occur exactly once.
19822 \begin_layout Subsection
19823 Preamble definitions
19826 \begin_layout Standard
19827 The external template configuration file may contain additional preamble
19828 definitions enclosed by
19829 \begin_inset Flex Code
19832 \begin_layout Plain Layout
19838 \SpecialChar \ldots{}
19840 \begin_inset Flex Code
19843 \begin_layout Plain Layout
19850 They can be used by the templates in the
19851 \begin_inset Flex Code
19854 \begin_layout Plain Layout
19863 \begin_layout Section
19864 The substitution mechanism
19867 \begin_layout Standard
19868 When the external material facility invokes an external program, it is done
19869 on the basis of a command defined in the template configuration file.
19870 These commands can contain various macros that are expanded before execution.
19871 Execution always take place in the directory of the containing document.
19874 \begin_layout Standard
19875 Also, whenever external material is to be displayed, the name will be produced
19876 by the substitution mechanism, and most other commands in the template
19877 definition support substitution as well.
19880 \begin_layout Standard
19881 The available macros are the following:
19884 \begin_layout Description
19885 \begin_inset Flex Code
19888 \begin_layout Plain Layout
19889 $$AbsOrRelPathMaster
19894 The file path, absolute or relative to the master LyX document.
19897 \begin_layout Description
19898 \begin_inset Flex Code
19901 \begin_layout Plain Layout
19902 $$AbsOrRelPathParent
19907 The file path, absolute or relative to the LyX document.
19910 \begin_layout Description
19911 \begin_inset Flex Code
19914 \begin_layout Plain Layout
19920 The absolute file path.
19923 \begin_layout Description
19924 \begin_inset Flex Code
19927 \begin_layout Plain Layout
19933 The filename without path and without the extension.
19936 \begin_layout Description
19937 \begin_inset Flex Code
19940 \begin_layout Plain Layout
19942 \begin_inset Quotes eld
19946 \begin_inset Quotes erd
19954 This macro will expand to the contents of the file with the name
19955 \begin_inset Flex Code
19958 \begin_layout Plain Layout
19967 \begin_layout Description
19968 \begin_inset Flex Code
19971 \begin_layout Plain Layout
19977 The file extension (including the dot).
19980 \begin_layout Description
19981 \begin_inset Flex Code
19984 \begin_layout Plain Layout
19990 The filename of the file specified in the external material dialog.
19991 This is either an absolute name, or it is relative to the LyX document.
19994 \begin_layout Description
19995 \begin_inset Flex Code
19998 \begin_layout Plain Layout
20005 \begin_inset Flex Code
20008 \begin_layout Plain Layout
20014 (absolute name or relative to the LyX document).
20017 \begin_layout Description
20018 \begin_inset Flex Code
20021 \begin_layout Plain Layout
20027 The file path, relative to the master LyX document.
20030 \begin_layout Description
20031 \begin_inset Flex Code
20034 \begin_layout Plain Layout
20040 The file path, relative to the LyX document.
20043 \begin_layout Description
20044 \begin_inset Flex Code
20047 \begin_layout Plain Layout
20053 This macro will expand to the absolute path of the system directory.
20054 This is typically used to point to the various helper scripts that are
20058 \begin_layout Description
20059 \begin_inset Flex Code
20062 \begin_layout Plain Layout
20068 A name and full path to a temporary file which will be automatically deleted
20069 whenever the containing document is closed, or the external material insertion
20073 \begin_layout Standard
20074 All path macros contain a trailing directory separator, so you can construct
20076 \begin_inset space \thinspace{}
20080 \begin_inset space \space{}
20083 the absolute filename with
20084 \begin_inset Flex Code
20087 \begin_layout Plain Layout
20088 $$AbsPath$$Basename$$Extension
20096 \begin_layout Standard
20097 The macros above are substituted in all commands unless otherwise noted.
20099 \begin_inset Flex Code
20102 \begin_layout Plain Layout
20108 supports additionally the following substitutions if they are enabled by
20110 \begin_inset Flex Code
20113 \begin_layout Plain Layout
20120 \begin_inset Flex Code
20123 \begin_layout Plain Layout
20132 \begin_layout Description
20133 \begin_inset Flex Code
20136 \begin_layout Plain Layout
20142 The front part of the resize command.
20145 \begin_layout Description
20146 \begin_inset Flex Code
20149 \begin_layout Plain Layout
20155 The back part of the resize command.
20158 \begin_layout Description
20159 \begin_inset Flex Code
20162 \begin_layout Plain Layout
20168 The front part of the rotation command.
20171 \begin_layout Description
20172 \begin_inset Flex Code
20175 \begin_layout Plain Layout
20181 The back part of the rotation command.
20184 \begin_layout Standard
20185 The value string of the
20186 \begin_inset Flex Code
20189 \begin_layout Plain Layout
20195 command supports additionally the following substitutions if they are enabled
20197 \begin_inset Flex Code
20200 \begin_layout Plain Layout
20207 \begin_inset Flex Code
20210 \begin_layout Plain Layout
20219 \begin_layout Description
20220 \begin_inset Flex Code
20223 \begin_layout Plain Layout
20232 \begin_layout Description
20233 \begin_inset Flex Code
20236 \begin_layout Plain Layout
20245 \begin_layout Description
20246 \begin_inset Flex Code
20249 \begin_layout Plain Layout
20258 \begin_layout Description
20259 \begin_inset Flex Code
20262 \begin_layout Plain Layout
20268 The rotation option.
20271 \begin_layout Standard
20272 You may ask why there are so many path macros.
20273 There are mainly two reasons:
20276 \begin_layout Enumerate
20277 Relative and absolute file names should remain relative or absolute, respectivel
20279 Users may have reasons to prefer either form.
20280 Relative names are useful for portable documents that should work on different
20281 machines, for example.
20282 Absolute names may be required by some programs.
20285 \begin_layout Enumerate
20286 LaTeX treats relative file names differently than LyX and other programs
20287 in nested included files.
20288 For LyX, a relative file name is always relative to the document that contains
20290 For LaTeX, it is always relative to the master document.
20291 These two definitions are identical if you have only one document, but
20292 differ if you have a master document that includes part documents.
20293 That means that relative filenames must be transformed when presented to
20295 Fortunately LyX does this automatically for you if you choose the right
20299 \begin_layout Standard
20300 So which path macro should be used in new template definitions? The rule
20304 \begin_layout Itemize
20306 \begin_inset Flex Code
20309 \begin_layout Plain Layout
20315 if an absolute path is required.
20318 \begin_layout Itemize
20320 \begin_inset Flex Code
20323 \begin_layout Plain Layout
20324 $$AbsOrRelPathMaster
20329 if the substituted string is some kind of LaTeX input.
20332 \begin_layout Itemize
20334 \begin_inset Flex Code
20337 \begin_layout Plain Layout
20338 $$AbsOrRelPathParent
20343 in order to preserve the user's choice.
20346 \begin_layout Standard
20347 There are special cases where this rule does not work and e.
20348 \begin_inset space \thinspace{}
20352 \begin_inset space \space{}
20355 relative names are needed, but normally it will work just fine.
20356 One example for such a case is the command
20357 \begin_inset Flex Code
20360 \begin_layout Plain Layout
20361 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20366 in the XFig template above: We can't use the absolute name because the
20368 \begin_inset Flex Code
20371 \begin_layout Plain Layout
20377 files needs the relative name in order to rewrite the file content.
20380 \begin_layout Section
20381 Security discussion
20382 \begin_inset CommandInset label
20384 name "sec:Security-discussion"
20391 \begin_layout Standard
20392 The external material feature interfaces with a lot of external programs
20393 and does so automatically, so we have to consider the security implications
20395 In particular, since you have the option of including your own filenames
20396 and/or parameter strings and those are expanded into a command, it seems
20397 that it would be possible to create a malicious document which executes
20398 arbitrary commands when a user views or prints the document.
20399 This is something we definitely want to avoid.
20402 \begin_layout Standard
20403 However, since the external program commands are specified in the template
20404 configuration file only, there are no security issues if LyX is properly
20405 configured with safe templates only.
20406 This is so because the external programs are invoked with the
20407 \begin_inset Flex Code
20410 \begin_layout Plain Layout
20416 -system call rather than the
20417 \begin_inset Flex Code
20420 \begin_layout Plain Layout
20426 system-call, so it's not possible to execute arbitrary commands from the
20427 filename or parameter section via the shell.
20430 \begin_layout Standard
20431 This also implies that you are restricted in what command strings you can
20432 use in the external material templates.
20433 In particular, pipes and redirection are not readily available.
20434 This has to be so if LyX should remain safe.
20435 If you want to use some of the shell features, you should write a safe
20436 script to do this in a controlled manner, and then invoke the script from
20437 the command string.
20441 \begin_layout Standard
20442 It is possible to design a template that interacts directly with the shell,
20443 but since this would allow a malicious user to execute arbitrary commands
20444 by writing clever filenames and/or parameters, we generally recommend that
20445 you only use safe scripts that work with the
20446 \begin_inset Flex Code
20449 \begin_layout Plain Layout
20455 system call in a controlled manner.
20456 Of course, for use in a controlled environment, it can be tempting to just
20457 fall back to use ordinary shell scripts.
20458 If you do so, be aware that you
20462 provide an easily exploitable security hole in your system.
20463 Of course it stands to reason that such unsafe templates will never be
20464 included in the standard LyX distribution, although we do encourage people
20465 to submit new templates in the open source tradition.
20466 But LyX as shipped from the official distribution channels will never have
20470 \begin_layout Standard
20471 Including external material provides a lot of power, and you have to be
20472 careful not to introduce security hazards with this power.
20473 A subtle error in a single line in an innocent looking script can open
20474 the door to huge security problems.
20475 So if you do not fully understand the issues, we recommend that you consult
20476 a knowledgeable security professional or the LyX development team if you
20477 have any questions about whether a given template is safe or not.
20478 And do this before you use it in an uncontrolled environment.