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
87 \default_output_format default
89 \bibtex_command default
90 \index_command default
94 \pdf_title "LyX Configuration Manual"
95 \pdf_author "LyX Team"
96 \pdf_subject "LyX-documentation Customization"
97 \pdf_keywords "LyX, documentation, customization"
99 \pdf_bookmarksnumbered true
100 \pdf_bookmarksopen true
101 \pdf_bookmarksopenlevel 1
102 \pdf_breaklinks false
106 \pdf_pdfusetitle false
107 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
117 \paperorientation portrait
131 \paragraph_separation indent
132 \paragraph_indentation default
133 \quotes_language english
136 \paperpagestyle headings
137 \tracking_changes false
138 \output_changes false
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.
6211 \begin_layout Subsubsection
6215 \begin_layout Standard
6216 Modules are to LyX as packages are to LaTeX.
6217 Sometimes, however, you find yourself wanting a specific inset or character
6218 style just for one document and writing a module that will also be available
6219 to other documents makes little sense.
6220 What you need is LyX's
6221 \begin_inset Quotes eld
6225 \begin_inset Quotes erd
6231 \begin_layout Standard
6232 You will find it under
6234 Document\SpecialChar \menuseparator
6235 Settings\SpecialChar \menuseparator
6239 The large text box allows you to enter anything that you might enter in
6240 a layout file or module.
6241 You can think of a document's local layout, in fact, as a module that belongs
6243 So, in particular, you must enter a
6244 \begin_inset Flex Code
6247 \begin_layout Plain Layout
6254 Any format is acceptable, but one would normally use the format current
6256 (In LyX 2.0, the current layout format is 35.) You should be aware that local
6257 layout is not supported by versions of LyX prior to 1.6, so you should not
6258 use it if you want to be able to export your document to LyX 1.5 or earlier
6259 (without, that is, losing the local layout information).
6260 If you wish to be able to export to 1.6---local layout is supported in 1.6,
6261 though there is no UI for it---then you should use format 11 and, of course,
6262 use only layout constructs that were available in LyX 1.6.
6265 \begin_layout Standard
6266 When you have entered something in the
6267 \begin_inset Flex Code
6270 \begin_layout Plain Layout
6276 pane, LyX will enable the
6277 \begin_inset Quotes eld
6281 \begin_inset Quotes erd
6284 button at the bottom.
6285 Clicking this button will cause LyX to determine whether what you have
6286 entered is valid layout information for the chosen format.
6287 LyX will report the result but, unfortunately, will not tell you what errors
6288 there might have been.
6289 These will be written to the terminal, however, if LyX is started from
6291 You will not be permitted to save your local layout until you have entered
6295 \begin_layout Standard
6296 The warnings at the end of the previous section apply here, too.
6297 Do not play with local layout while you are actually working, especially
6298 if you have not saved your document.
6299 That said, using local layout with a test document can be a very convenient
6300 way to try out layout ideas, or even to start developing a module.
6303 \begin_layout Subsection
6305 \begin_inset Flex MenuItem
6308 \begin_layout Plain Layout
6317 \begin_layout Standard
6318 There are two situations you are likely to encounter when wanting to support
6319 a new LaTeX document class, involving style (
6320 \begin_inset Flex Code
6323 \begin_layout Plain Layout
6329 ) files and LaTeX2e class (
6330 \begin_inset Flex Code
6333 \begin_layout Plain Layout
6340 Supporting a style file is usually fairly easy.
6341 Supporting a new class file is a bit harder.
6342 We'll discuss the former in this section and the latter in the next.
6343 Similar remarks apply, of course, if you want to support a new DocBook
6347 \begin_layout Standard
6348 The easier case is the one in which your new document class is provided
6349 as a style file that is to be used in conjunction with an already supported
6351 For the sake of the example, we'll assume that the style file is called
6353 \begin_inset Flex MenuItem
6356 \begin_layout Plain Layout
6362 and that it is meant to be used with
6363 \begin_inset Flex MenuItem
6366 \begin_layout Plain Layout
6372 , which is a standard class.
6376 \begin_layout Standard
6377 Start by copying the existing class's layout file into your local directory:
6381 \begin_layout Plain Layout
6382 Of course, which directory is your local directory will vary by platform,
6383 and LyX allows you to specify your local directory on startup, too, using
6385 \begin_inset Flex Code
6388 \begin_layout Plain Layout
6402 \begin_layout LyX-Code
6403 cp report.layout ~/.lyx/layouts/myclass.layout
6406 \begin_layout Standard
6408 \begin_inset Flex Code
6411 \begin_layout Plain Layout
6417 and change the line:
6420 \begin_layout LyX-Code
6423 DeclareLaTeXClass{report}
6426 \begin_layout Standard
6430 \begin_layout LyX-Code
6433 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6436 \begin_layout Standard
6440 \begin_layout LyX-Code
6442 \begin_inset Newline newline
6448 \begin_inset Newline newline
6454 \begin_layout Standard
6455 near the top of the file.
6458 \begin_layout Standard
6459 Start LyX and select
6460 \begin_inset Flex MenuItem
6463 \begin_layout Plain Layout
6464 Tools\SpecialChar \menuseparator
6471 Then restart LyX and try creating a new document.
6473 \begin_inset Flex MenuItem
6476 \begin_layout Plain Layout
6482 " as a document class option in the
6483 \begin_inset Flex MenuItem
6486 \begin_layout Plain Layout
6487 Document\SpecialChar \menuseparator
6494 It is likely that some of the sectioning commands and such in your new
6495 class will work differently from how they worked in the base class—
6496 \begin_inset Flex Code
6499 \begin_layout Plain Layout
6505 in this example—so you can fiddle around with the settings for the different
6506 sections if you wish.
6507 The layout information for sections is contained in
6508 \begin_inset Flex Code
6511 \begin_layout Plain Layout
6517 , but you do not need to copy and change this file.
6518 Instead, you can simply add your changes to your layout file, after the
6520 \begin_inset Flex Code
6523 \begin_layout Plain Layout
6529 , which itself includes
6530 \begin_inset Flex Code
6533 \begin_layout Plain Layout
6540 For example, you might add these lines:
6543 \begin_layout LyX-Code
6547 \begin_layout LyX-Code
6551 \begin_layout LyX-Code
6555 \begin_layout LyX-Code
6559 \begin_layout LyX-Code
6563 \begin_layout Standard
6564 to change the font for chapter headings to sans-serif.
6565 This will override (or, in this case, add to) the existing declaration
6566 for the Chapter style.
6570 \begin_layout Standard
6571 Your new package may also provide commands or environments not present in
6573 In this case, you will want to add these to the layout file.
6575 \begin_inset CommandInset ref
6577 reference "sec:TextClass"
6581 for information on how to do so.
6584 \begin_layout Standard
6586 \begin_inset Flex MenuItem
6589 \begin_layout Plain Layout
6595 can be used with several different document classes, and even if it cannot,
6596 you might find it easiest just to write a module that you can load with
6598 The simplest possible such module would be:
6601 \begin_layout LyX-Code
6604 DeclareLyXModule{My Package}
6607 \begin_layout LyX-Code
6611 \begin_layout LyX-Code
6612 #Support for mypkg.sty.
6615 \begin_layout LyX-Code
6617 \begin_inset Newline newline
6623 \begin_layout LyX-Code
6625 \begin_inset Newline newline
6631 \begin_layout LyX-Code
6633 \begin_inset Newline newline
6639 \begin_inset Newline newline
6645 \begin_layout Standard
6646 A more complex module might modify the behavior of some existing constructs
6647 or define some new ones.
6649 \begin_inset CommandInset ref
6651 reference "sec:TextClass"
6658 \begin_layout Subsection
6660 \begin_inset Flex MenuItem
6663 \begin_layout Plain Layout
6672 \begin_layout Standard
6673 There are two possibilities here.
6674 One is that the class file is itself based upon an existing document class.
6675 For example, many thesis classes are based upon
6676 \begin_inset Flex MenuItem
6679 \begin_layout Plain Layout
6686 To see whether yours is, look for a line like
6689 \begin_layout LyX-Code
6695 \begin_layout Standard
6697 If so, then you may proceed largely as in the previous section, though
6699 \begin_inset Flex Code
6702 \begin_layout Plain Layout
6708 line will be different.
6709 If your new class is
6710 \begin_inset Flex Code
6713 \begin_layout Plain Layout
6719 and it is based upon
6720 \begin_inset Flex Code
6723 \begin_layout Plain Layout
6729 , then the line should read:
6733 \begin_layout Plain Layout
6734 And it will be easiest if you save the file to
6735 \begin_inset Flex Code
6738 \begin_layout Plain Layout
6744 : LyX assumes that the document class has the same name as the layout file.
6753 \begin_layout LyX-Code
6756 DeclareLaTeXClass[thesis,book]{thesis}
6759 \begin_layout Standard
6760 If, on the other hand, the new class is not based upon an existing class,
6761 you will probably have to
6762 \begin_inset Quotes eld
6766 \begin_inset Quotes erd
6770 We strongly suggest copying an existing layout file which uses a similar
6771 LaTeX class and then modifying it, if you can do so.
6772 At least use an existing file as a starting point so you can find out what
6773 items you need to worry about.
6774 Again, the specifics are covered below.
6777 \begin_layout Subsection
6779 \begin_inset CommandInset label
6781 name "sub:Creating-Templates"
6788 \begin_layout Standard
6789 Once you have written a layout file for a new document class, you might
6790 want to consider writing a
6795 A template acts as a kind of tutorial for your layout, showing how it might
6796 be used, though containing dummy content.
6797 You can of course look at the various templates included with LyX for ideas.
6800 \begin_layout Standard
6801 Templates are created just like usual documents: using LyX.
6802 The only difference is that usual documents contain all possible settings,
6803 including the font scheme and the paper size.
6804 Usually a user doesn't want a template to overwrite his preferred settings
6805 for such parameters.
6806 For that reason, the designer of a template should remove the corresponding
6808 \begin_inset Flex Code
6811 \begin_layout Plain Layout
6820 \begin_inset Flex Code
6823 \begin_layout Plain Layout
6831 from the template LyX file.
6832 This can be done with any simple text-editor, for example
6833 \begin_inset Flex Code
6836 \begin_layout Plain Layout
6843 \begin_inset Flex Code
6846 \begin_layout Plain Layout
6856 \begin_layout Standard
6857 Put the edited template files you create in
6858 \begin_inset Flex Code
6861 \begin_layout Plain Layout
6867 , copy the ones you use from the global template directory in
6868 \begin_inset Flex Code
6871 \begin_layout Plain Layout
6877 to the same place, and redefine the template path in the
6878 \begin_inset Flex MenuItem
6881 \begin_layout Plain Layout
6882 Tools\SpecialChar \menuseparator
6883 Preferences\SpecialChar \menuseparator
6892 \begin_layout Standard
6893 Note, by the way, that there is a template which has a particular meaning:
6895 \begin_inset Flex Code
6898 \begin_layout Plain Layout
6905 This template is loaded every time you create a new document with
6906 \begin_inset Flex MenuItem
6909 \begin_layout Plain Layout
6910 File\SpecialChar \menuseparator
6916 in order to provide useful defaults.
6917 To create this template from inside LyX, all you have to do is to open
6918 a document with the correct settings, and use the
6919 \begin_inset Flex MenuItem
6922 \begin_layout Plain Layout
6923 Save as Document Defaults
6931 \begin_layout Subsection
6932 Upgrading old layout files
6935 \begin_layout Standard
6936 The format of layout files changes with each LyX release, so old layout
6937 files need to be converted to the new format.
6938 This process has been automated since LyX 1.4: If LyX reads a layout file
6939 in an older format, it automatically calls the script
6940 \begin_inset Flex Code
6943 \begin_layout Plain Layout
6949 to convert it to a temporary file in current format.
6950 The original file is left untouched.
6951 If you use the layout file often, then, you may want to convert it permanently,
6952 so that LyX does not have to do so itself every time.
6953 To do this, you can call the converter manually:
6956 \begin_layout LyX-Code
6957 mv myclass.layout myclass.old
6960 \begin_layout LyX-Code
6961 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6964 \begin_layout Standard
6966 \begin_inset Flex Code
6969 \begin_layout Plain Layout
6975 with the name of your LyX system directory, of course.
6978 \begin_layout Standard
6979 Note that manual conversion does not affect included files, so these will
6980 have to be converted separately.
6983 \begin_layout Section
6984 \begin_inset CommandInset label
6986 name "sec:TextClass"
6990 The layout file format
6993 \begin_layout Standard
6994 When it's finally time to get your hands dirty and create or edit your own
6995 layout file, the following sections describe what you're up against.
6996 Our advice is to go slowly, save and test often, listen to soothing music,
6997 and enjoy one or two of your favorite adult beverages; more if you are
6998 getting particularly stuck.
6999 It's really not that hard, except that the multitude of options can become
7000 overwhelming if you try to do too much in one sitting.
7001 Go have another adult beverage, just for good measure.
7004 \begin_layout Standard
7005 Note that all the tags used in layout files are case-insensitive.
7007 \begin_inset Flex Code
7010 \begin_layout Plain Layout
7017 \begin_inset Flex Code
7020 \begin_layout Plain Layout
7027 \begin_inset Flex Code
7030 \begin_layout Plain Layout
7036 are really the same tag.
7037 The possible values are printed in brackets after the feature's name.
7038 The default value if a feature isn't specified inside a text class-description
7040 \begin_inset Flex Code
7043 \begin_layout Plain Layout
7052 If the argument has a data type like
7053 \begin_inset Quotes eld
7057 \begin_inset Quotes erd
7061 \begin_inset Quotes eld
7065 \begin_inset Quotes erd
7068 , the default is shown like this:
7069 \begin_inset Flex Code
7072 \begin_layout Plain Layout
7083 \begin_layout Subsection
7084 The document class declaration
7087 \begin_layout Standard
7088 Lines in a layout file which begin with
7089 \begin_inset Flex Code
7092 \begin_layout Plain Layout
7099 There is one exception to this rule.
7101 \begin_inset Flex Code
7104 \begin_layout Plain Layout
7110 files should begin with a line like:
7113 \begin_layout LyX-Code
7116 #% Do not delete the line below; configure depends on this
7119 \begin_layout LyX-Code
7124 DeclareLaTeXClass{article}
7127 \begin_layout Standard
7128 The second line is used when you (re)configure LyX.
7129 The layout file is read by the LaTeX script
7130 \begin_inset Flex Code
7133 \begin_layout Plain Layout
7139 , in a special mode where
7140 \begin_inset Flex Code
7143 \begin_layout Plain Layout
7150 The first line is just a LaTeX comment, and the second one contains the
7151 declaration of the text class.
7152 If these lines appear in a file named
7153 \begin_inset Flex Code
7156 \begin_layout Plain Layout
7162 , then they define a text class of name
7163 \begin_inset Flex Code
7166 \begin_layout Plain Layout
7172 (the name of the layout file) which uses the LaTeX document class
7173 \begin_inset Flex Code
7176 \begin_layout Plain Layout
7182 (the default is to use the same name as the layout).
7184 \begin_inset Quotes eld
7188 \begin_inset Quotes erd
7191 that appears above is used as a description of the text class in the
7192 \begin_inset Flex MenuItem
7195 \begin_layout Plain Layout
7196 Document\SpecialChar \menuseparator
7205 \begin_layout Standard
7206 Let's assume that you wrote your own text class that uses the
7207 \begin_inset Flex Code
7210 \begin_layout Plain Layout
7216 document class, but where you changed the appearance of the section headings.
7217 If you put it in a file
7218 \begin_inset Flex Code
7221 \begin_layout Plain Layout
7227 , the header of this file should be:
7230 \begin_layout LyX-Code
7233 #% Do not delete the line below; configure depends on this
7236 \begin_layout LyX-Code
7241 DeclareLaTeXClass[article]{article (with my own headings)}
7244 \begin_layout Standard
7245 This declares a text class
7246 \begin_inset Flex Code
7249 \begin_layout Plain Layout
7255 , associated with the LaTeX document class
7256 \begin_inset Flex Code
7259 \begin_layout Plain Layout
7266 \begin_inset Quotes eld
7269 article (with my own headings)
7270 \begin_inset Quotes erd
7274 If your text class depends on several packages, you can declare it as:
7277 \begin_layout LyX-Code
7280 #% Do not delete the line below; configure depends on this
7283 \begin_layout LyX-Code
7288 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7291 \begin_layout Standard
7292 This indicates that your text class uses the
7293 \begin_inset Flex Code
7296 \begin_layout Plain Layout
7303 Finally, it is also possible to declare classes for DocBook code.
7304 Typical declarations will look like:
7307 \begin_layout LyX-Code
7310 #% Do not delete the line below; configure depends on this
7313 \begin_layout LyX-Code
7318 DeclareDocBookClass[article]{SGML (DocBook article)}
7321 \begin_layout Standard
7322 Note that these declarations can also be given an optional parameter declaring
7323 the name of the document class (but not a list).
7326 \begin_layout Standard
7327 So, to be as explicit as possible, the form of the layout declaration is:
7330 \begin_layout LyX-Code
7335 DeclareLaTeXClass[class,package.sty]{layout description}
7338 \begin_layout Standard
7339 The class need only be specified if the name of the LaTeX class file and
7340 the name of the layout file are different or if there are packages to load.
7341 If the name of the class file is not specified, then LyX will simply assume
7342 that it is the same as the name of the layout file.
7345 \begin_layout Standard
7346 When the text class has been modified to your taste, all you have to do
7347 is to copy it either to
7348 \begin_inset Flex Code
7351 \begin_layout Plain Layout
7358 \begin_inset Flex Code
7361 \begin_layout Plain Layout
7368 \begin_inset Flex MenuItem
7371 \begin_layout Plain Layout
7372 Tools\SpecialChar \menuseparator
7378 , exit LyX and restart.
7379 Then your new text class should be available along with the others.
7382 \begin_layout Standard
7383 Once the layout file is installed, you can edit it and see your changes
7384 without having to reconfigure or to restart LyX.
7389 \begin_layout Plain Layout
7390 In versions of LyX prior to 1.6, this was not true.
7391 As a result, editing layout files was very time consuming, since you had
7392 constantly to restart LyX to see changes.
7397 You can force a reload of the current layout by using the LyX function
7399 \begin_inset Flex MenuItem
7402 \begin_layout Plain Layout
7409 There is no default binding for this function—though, of course, you can
7410 bind it to a key yourself.
7411 But you will normally use this function simply by entering it in the mini-buffe
7416 \begin_layout Standard
7422 \begin_inset Flex MenuItem
7425 \begin_layout Plain Layout
7431 is very much an `advanced feature'.
7436 recommended that you save your work before using this function.
7441 recommended that you not attempt to edit layout information while simultaneousl
7442 y working on a document that you care about.
7443 Use a test document.
7444 Syntax errors and the like in your layout file could cause peculiar behavior.
7445 In particular, such errors could cause LyX to regard the current layout
7446 as invalid and to attempt to switch to some other layout.
7450 \begin_layout Plain Layout
7451 Really bad syntax errors may even caused LyX to exit.
7452 This is because certain sorts of errors may make LyX unable to read
7462 The LyX team strives to keep LyX stable in such situations, but safe is
7467 \begin_layout Plain Layout
7468 While we're giving advice: make regular backups.
7469 And be nice to your mother.
7477 \begin_layout Subsection
7478 The Module declaration
7481 \begin_layout Standard
7482 A module must begin with a line like the following:
7485 \begin_layout LyX-Code
7488 DeclareLyXModule[endnotes.sty]{Endnotes}
7491 \begin_layout Standard
7492 The mandatory argument, in curly brackets, is the name of the module, as
7494 \begin_inset Flex MenuItem
7497 \begin_layout Plain Layout
7498 Document\SpecialChar \menuseparator
7499 Settings\SpecialChar \menuseparator
7506 The argument in square brackets is optional: It declares any LaTeX packages
7507 on which the module depends.
7508 Please note that only packages about which LyX knows should be listed in
7509 the square brackets.
7513 \begin_layout Plain Layout
7514 The list of such packages is documented only in the source code.
7519 LyX will not check for arbitrary packages.
7520 It is also possible to use the form
7521 \begin_inset Flex MenuItem
7524 \begin_layout Plain Layout
7530 as an optional argument, which declares that the module can only be used
7531 when there exists a conversion chain between the formats `
7532 \begin_inset Flex Code
7535 \begin_layout Plain Layout
7542 \begin_inset Flex Code
7545 \begin_layout Plain Layout
7554 \begin_layout Standard
7555 The module declaration should then be followed by lines like the following
7559 \begin_layout Plain Layout
7560 Preferably in English if the module should be published with LyX.
7561 This description will appear in the list of messages to be translated and
7562 will be thus translated with the next interface update.
7570 \begin_layout LyX-Code
7574 \begin_layout LyX-Code
7575 #Adds an endnote command, in addition to footnotes.
7579 \begin_layout LyX-Code
7580 #You will need to add
7582 theendnotes in TeX code where you
7585 \begin_layout LyX-Code
7586 #want the endnotes to appear.
7590 \begin_layout LyX-Code
7594 \begin_layout LyX-Code
7595 #Requires: somemodule | othermodule
7598 \begin_layout LyX-Code
7599 #Excludes: badmodule
7602 \begin_layout Standard
7603 The description is used in
7604 \begin_inset Flex MenuItem
7607 \begin_layout Plain Layout
7608 Document\SpecialChar \menuseparator
7609 Settings\SpecialChar \menuseparator
7615 to provide the user with information about what the module does.
7617 \begin_inset Flex Code
7620 \begin_layout Plain Layout
7626 line is used to identify other modules with which this one must be used;
7628 \begin_inset Flex Code
7631 \begin_layout Plain Layout
7637 line is used to identify modules with which this one may not be used.
7638 Both are optional, and, as shown, multiple modules should be separated
7639 with the pipe symbol: |.
7640 Note that the required modules are treated disjunctively:
7644 of the required modules must be used.
7649 excluded module may be used.
7650 Note that modules are identified here by their
7655 \begin_inset Flex Code
7658 \begin_layout Plain Layout
7666 \begin_inset Flex Code
7669 \begin_layout Plain Layout
7676 \begin_inset Flex Code
7679 \begin_layout Plain Layout
7688 \begin_layout Subsection
7692 \begin_layout Standard
7693 The first non-comment line of any layout file, included file, or module
7698 contain the file format number:
7701 \begin_layout Description
7702 \begin_inset Flex Code
7705 \begin_layout Plain Layout
7712 \begin_inset Flex Code
7715 \begin_layout Plain Layout
7721 ] The format of the layout file.
7724 \begin_layout Standard
7725 This tag was introduced with LyX 1.4.0.
7726 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7727 and are considered to be of format 1.
7728 The format for the present version of LyX is format 21.
7729 But each version of LyX is capable of reading earlier versions' layout
7730 files, just as they are capable of reading files produced by earlier versions
7732 There is, however, no provision for converting to earlier formats.
7733 So LyX 1.6.x will not read layout files in format 21 but only files in format
7737 \begin_layout Subsection
7738 \begin_inset CommandInset label
7740 name "sub:General-text-class"
7744 General text class parameters
7747 \begin_layout Standard
7748 These are general parameters that govern the behavior of an entire document
7754 mean that they must appear in
7755 \begin_inset Flex Code
7758 \begin_layout Plain Layout
7764 files rather than in modules.
7765 A module can contain any layout tag.)
7768 \begin_layout Description
7769 \begin_inset Flex Code
7772 \begin_layout Plain Layout
7778 Adds information that will be output in the
7779 \begin_inset Flex Code
7782 \begin_layout Plain Layout
7788 block when this document class is output to XHTML.
7789 Typically, this would be used to output CSS style information, but it can
7790 be used for anything that can appear in
7791 \begin_inset Flex Code
7794 \begin_layout Plain Layout
7802 \begin_inset Quotes eld
7806 \begin_inset Flex Code
7809 \begin_layout Plain Layout
7816 \begin_inset Quotes erd
7822 \begin_layout Description
7823 \begin_inset Flex Code
7826 \begin_layout Plain Layout
7832 Adds information to the document preamble.
7834 \begin_inset Quotes eld
7838 \begin_inset Flex Code
7841 \begin_layout Plain Layout
7848 \begin_inset Quotes erd
7854 \begin_layout Description
7855 \begin_inset Flex Code
7858 \begin_layout Plain Layout
7864 Defines formats for use in the display of bibliographic information.
7866 \begin_inset CommandInset ref
7868 reference "sub:Citation-format-description"
7874 \begin_inset Quotes eld
7878 \begin_inset Flex Code
7881 \begin_layout Plain Layout
7888 \begin_inset Quotes erd
7894 \begin_layout Description
7895 \begin_inset Flex Code
7898 \begin_layout Plain Layout
7904 Describes various global options supported by the document class.
7906 \begin_inset space ~
7910 \begin_inset CommandInset ref
7912 reference "sub:ClassOptions"
7918 \begin_inset Quotes eld
7922 \begin_inset Flex Code
7925 \begin_layout Plain Layout
7932 \begin_inset Quotes erd
7938 \begin_layout Description
7939 \begin_inset Flex Code
7942 \begin_layout Plain Layout
7949 \begin_inset Flex Code
7952 \begin_layout Plain Layout
7961 \begin_inset Flex Code
7964 \begin_layout Plain Layout
7970 ] Whether the class should
7974 to having one or two columns.
7975 Can be changed in the
7976 \begin_inset Flex MenuItem
7979 \begin_layout Plain Layout
7980 Document\SpecialChar \menuseparator
7989 \begin_layout Description
7990 \begin_inset Flex Code
7993 \begin_layout Plain Layout
8000 \begin_inset Flex Code
8003 \begin_layout Plain Layout
8009 ] This sequence defines the properties for a counter.
8010 If the counter does not yet exist, it is created; if it does exist, it
8013 \begin_inset Quotes eld
8017 \begin_inset Flex Code
8020 \begin_layout Plain Layout
8027 \begin_inset Quotes erd
8031 \begin_inset Newline newline
8035 \begin_inset space ~
8039 \begin_inset CommandInset ref
8041 reference "sub:Counters"
8045 for details on counters.
8048 \begin_layout Description
8049 \begin_inset Flex Code
8052 \begin_layout Plain Layout
8058 Sets the default font used to display the document.
8060 \begin_inset space ~
8064 \begin_inset CommandInset ref
8066 reference "sub:Font-description"
8070 for how to declare fonts.
8072 \begin_inset Quotes eld
8076 \begin_inset Flex Code
8079 \begin_layout Plain Layout
8086 \begin_inset Quotes erd
8092 \begin_layout Description
8093 \begin_inset Flex Code
8096 \begin_layout Plain Layout
8103 \begin_inset Flex Code
8106 \begin_layout Plain Layout
8112 Specifies a module to be included by default with this document class.
8113 The module should be specified by filename without the
8114 \begin_inset Flex Code
8117 \begin_layout Plain Layout
8124 The user can still remove the module, but it will be active at the outset.
8125 (This applies only when new files are created, or when this class is chosen
8126 for an existing document.)
8129 \begin_layout Description
8130 \begin_inset Flex Code
8133 \begin_layout Plain Layout
8140 \begin_inset Flex Code
8143 \begin_layout Plain Layout
8149 ] This is the style that will be assigned to new paragraphs, usually
8150 \begin_inset Flex MenuItem
8153 \begin_layout Plain Layout
8160 This will default to the first defined style if not given, but you are
8161 encouraged to use this directive.
8164 \begin_layout Description
8165 \begin_inset Flex Code
8168 \begin_layout Plain Layout
8175 \begin_inset Flex Code
8178 \begin_layout Plain Layout
8184 ] This tag indicates that the module in question—which should be specified
8185 by filename without the
8186 \begin_inset Flex Code
8189 \begin_layout Plain Layout
8195 extension—cannot be used with this document class.
8196 This might be used in a journal-specific layout file to prevent, say, the
8198 \begin_inset Flex Code
8201 \begin_layout Plain Layout
8207 module that numbers theorems by section.
8212 be used in a module.
8213 Modules have their own way of excluding other modules (see
8214 \begin_inset CommandInset ref
8216 reference "sub:Layout-modules"
8223 \begin_layout Description
8224 \begin_inset Flex Code
8227 \begin_layout Plain Layout
8233 Defines a new float.
8235 \begin_inset space ~
8239 \begin_inset CommandInset ref
8241 reference "sub:Floats"
8247 \begin_inset Quotes eld
8251 \begin_inset Flex Code
8254 \begin_layout Plain Layout
8261 \begin_inset Quotes erd
8267 \begin_layout Description
8268 \begin_inset Flex Code
8271 \begin_layout Plain Layout
8277 Sets the information that will be output in the
8278 \begin_inset Flex Code
8281 \begin_layout Plain Layout
8287 block when this document class is output to XHTML.
8288 Note that this will completely override any prior
8289 \begin_inset Flex Code
8292 \begin_layout Plain Layout
8299 \begin_inset Flex Code
8302 \begin_layout Plain Layout
8310 \begin_inset Flex Code
8313 \begin_layout Plain Layout
8319 if you just want to add material to the preamble.) Must end with
8320 \begin_inset Quotes eld
8324 \begin_inset Flex Code
8327 \begin_layout Plain Layout
8334 \begin_inset Quotes erd
8340 \begin_layout Description
8341 \begin_inset Flex Code
8344 \begin_layout Plain Layout
8351 \begin_inset Flex Code
8354 \begin_layout Plain Layout
8360 ] The layout to use for the table of contents, bibliography, and so forth,
8361 when the document is output to HTML.
8362 For articles, this should normally be Section; for books, Chapter.
8363 If it is not given, then LyX will attempt to figure out which layout to
8367 \begin_layout Description
8368 \begin_inset Flex Code
8371 \begin_layout Plain Layout
8378 \begin_inset Flex Code
8381 \begin_layout Plain Layout
8387 ] Modifies the properties of the given counter.
8388 If the counter does not exist, the section is ignored.
8390 \begin_inset Quotes eld
8394 \begin_inset Flex Code
8397 \begin_layout Plain Layout
8404 \begin_inset Quotes erd
8408 \begin_inset Newline newline
8412 \begin_inset space ~
8416 \begin_inset CommandInset ref
8418 reference "sub:Counters"
8422 for details on counters.
8425 \begin_layout Description
8426 \begin_inset Flex Code
8429 \begin_layout Plain Layout
8436 \begin_inset Flex Code
8439 \begin_layout Plain Layout
8445 ] Modifies the properties of the given paragraph style.
8446 If the style does not exist, the section is ignored.
8448 \begin_inset Quotes eld
8452 \begin_inset Flex Code
8455 \begin_layout Plain Layout
8462 \begin_inset Quotes erd
8468 \begin_layout Description
8469 \begin_inset Flex Code
8472 \begin_layout Plain Layout
8478 As its name implies, this command allows you to include another layout
8479 definition file within yours to avoid duplicating commands.
8480 Common examples are the standard layout files, for example,
8481 \begin_inset Flex Code
8484 \begin_layout Plain Layout
8490 , which contains most of the basic layouts.
8493 \begin_layout Description
8494 \begin_inset Flex Code
8497 \begin_layout Plain Layout
8503 This section (re-)defines the layout of an inset.
8504 It can be applied to an existing inset or to a new, user-defined inset,
8505 e.g., a new character style.
8507 \begin_inset Quotes eld
8511 \begin_inset Flex Code
8514 \begin_layout Plain Layout
8521 \begin_inset Quotes erd
8525 \begin_inset Newline newline
8529 \begin_inset space ~
8533 \begin_inset CommandInset ref
8535 reference "sub:Flex-insets-and"
8539 for more information.
8543 \begin_layout Description
8544 \begin_inset Flex Code
8547 \begin_layout Plain Layout
8554 \begin_inset Flex Code
8557 \begin_layout Plain Layout
8563 ] A string that indicates the width of the left margin on the screen, for
8565 \begin_inset Quotes eld
8569 \begin_inset Quotes erd
8573 (Note that this is not a `length', like
8574 \begin_inset Quotes eld
8578 \begin_inset Quotes erd
8584 \begin_layout Description
8585 \begin_inset Flex Code
8588 \begin_layout Plain Layout
8595 \begin_inset Flex Code
8598 \begin_layout Plain Layout
8604 ] This command deletes an existing counter, usually one defined in an included
8608 \begin_layout Description
8609 \begin_inset Flex Code
8612 \begin_layout Plain Layout
8618 This command deletes an existing float.
8619 This is particularly useful when you want to suppress a float that has
8620 been defined in an input file.
8623 \begin_layout Description
8624 \begin_inset Flex Code
8627 \begin_layout Plain Layout
8633 This command deletes an existing style.
8634 This is particularly useful when you want to suppress a style that has
8635 be defined in an input file.
8638 \begin_layout Description
8639 \begin_inset Flex Code
8642 \begin_layout Plain Layout
8648 A string indicating the file format (as defined in the Preferences dialog)
8649 produced by this class.
8650 It is mainly useful when
8651 \begin_inset Flex Code
8654 \begin_layout Plain Layout
8660 is `literate' and one wants to define a new type of literate document.
8661 This string is reset to `docbook', `latex', or `literate' when the correspondin
8663 \begin_inset Flex Code
8666 \begin_layout Plain Layout
8672 parameter is encountered.
8675 \begin_layout Description
8676 \begin_inset Flex Code
8679 \begin_layout Plain Layout
8685 A string indicating what sort of output documents using this class will
8687 At present, the options are: `docbook', `latex', and `literate'.
8690 \begin_layout Description
8691 \begin_inset Flex Code
8694 \begin_layout Plain Layout
8701 \begin_inset Flex Code
8704 \begin_layout Plain Layout
8713 \begin_inset Flex Code
8716 \begin_layout Plain Layout
8723 \begin_inset Flex Code
8726 \begin_layout Plain Layout
8732 ] The default pagestyle.
8733 Can be changed in the
8734 \begin_inset Flex MenuItem
8737 \begin_layout Plain Layout
8738 Document\SpecialChar \menuseparator
8747 \begin_layout Description
8748 \begin_inset Flex Code
8751 \begin_layout Plain Layout
8757 Sets the preamble for the LaTeX document.
8758 Note that this will completely override any prior
8759 \begin_inset Flex Code
8762 \begin_layout Plain Layout
8769 \begin_inset Flex Code
8772 \begin_layout Plain Layout
8780 \begin_inset Flex Code
8783 \begin_layout Plain Layout
8789 if you just want to add material to the preamble.) Must end with
8790 \begin_inset Quotes eld
8794 \begin_inset Flex Code
8797 \begin_layout Plain Layout
8804 \begin_inset Quotes erd
8810 \begin_layout Description
8811 \begin_inset Flex Code
8814 \begin_layout Plain Layout
8821 \begin_inset Flex Code
8824 \begin_layout Plain Layout
8831 \begin_inset Flex Code
8834 \begin_layout Plain Layout
8843 \begin_inset Flex Code
8846 \begin_layout Plain Layout
8852 ] Whether the class already provides the feature
8853 \begin_inset Flex Code
8856 \begin_layout Plain Layout
8863 A feature is in general the name of a package (
8864 \begin_inset Flex Code
8867 \begin_layout Plain Layout
8874 \begin_inset Flex Code
8877 \begin_layout Plain Layout
8883 , \SpecialChar \ldots{}
8885 \begin_inset Flex Code
8888 \begin_layout Plain Layout
8895 \begin_inset Flex Code
8898 \begin_layout Plain Layout
8904 ,\SpecialChar \ldots{}
8905 ); the complete list of supported features is unfortunately not documented
8906 outside the LyX source code—but see
8907 \begin_inset Flex Code
8910 \begin_layout Plain Layout
8916 if you're interested.
8918 \begin_inset Flex MenuItem
8921 \begin_layout Plain Layout
8922 Help\SpecialChar \menuseparator
8928 also gives an overview of the supported packages.
8931 \begin_layout Description
8932 \begin_inset Flex Code
8935 \begin_layout Plain Layout
8942 \begin_inset Flex Code
8945 \begin_layout Plain Layout
8951 ] Indicates that this layout provides the functionality of the module mentioned,
8952 which should be specified by the filename without the
8953 \begin_inset Flex Code
8956 \begin_layout Plain Layout
8963 This will typically be used if the layout includes the module directly,
8964 rather than using the
8965 \begin_inset Flex Code
8968 \begin_layout Plain Layout
8974 tag to indicate that it ought to be used.
8975 It could also be used in a module that provided an alternate implementation
8976 of the same functionality.
8979 \begin_layout Description
8980 \begin_inset Flex Code
8983 \begin_layout Plain Layout
8990 \begin_inset Flex Code
8993 \begin_layout Plain Layout
8999 ] Whether the class requires the feature
9000 \begin_inset Flex Code
9003 \begin_layout Plain Layout
9010 Multiple features must be separated by commas.
9011 Note that you can only request supported features.
9013 \begin_inset Flex Code
9016 \begin_layout Plain Layout
9022 for a list of these.)
9025 \begin_layout Description
9026 \begin_inset Flex Code
9029 \begin_layout Plain Layout
9035 A string that indicates the width of the right margin on the screen, for
9037 \begin_inset Quotes eld
9041 \begin_inset Quotes erd
9047 \begin_layout Description
9048 \begin_inset Flex Code
9051 \begin_layout Plain Layout
9057 Sets which divisions get numbered.
9059 \begin_inset Flex Code
9062 \begin_layout Plain Layout
9071 \begin_layout Description
9072 \begin_inset Flex Code
9075 \begin_layout Plain Layout
9082 \begin_inset Flex Code
9085 \begin_layout Plain Layout
9094 \begin_inset Flex Code
9097 \begin_layout Plain Layout
9103 ] Whether the class-default should be printing on one or both sides of the
9105 Can be changed in the
9106 \begin_inset Flex MenuItem
9109 \begin_layout Plain Layout
9110 Document\SpecialChar \menuseparator
9119 \begin_layout Description
9120 \begin_inset Flex Code
9123 \begin_layout Plain Layout
9129 This sequence defines a paragraph style.
9130 If the style does not yet exist, it is created; if it does exist, its parameter
9133 \begin_inset Quotes eld
9137 \begin_inset Flex Code
9140 \begin_layout Plain Layout
9147 \begin_inset Quotes erd
9151 \begin_inset Newline newline
9155 \begin_inset space ~
9159 \begin_inset CommandInset ref
9161 reference "sub:Paragraph-Styles"
9165 for details on paragraph styles.
9168 \begin_layout Description
9169 \begin_inset Flex Code
9172 \begin_layout Plain Layout
9179 \begin_inset Flex Code
9182 \begin_layout Plain Layout
9188 ] The name of the command or environment to be used with
9189 \begin_inset Flex Code
9192 \begin_layout Plain Layout
9201 \begin_layout Description
9202 \begin_inset Flex Code
9205 \begin_layout Plain Layout
9212 \begin_inset Flex Code
9215 \begin_layout Plain Layout
9224 \begin_inset Flex Code
9227 \begin_layout Plain Layout
9233 ] Indicates what kind of markup is used to define the title of a document.
9235 \begin_inset Flex Code
9238 \begin_layout Plain Layout
9244 means that the macro with name
9245 \begin_inset Flex Code
9248 \begin_layout Plain Layout
9254 will be inserted after the last layout which has
9255 \begin_inset Quotes eld
9259 \begin_inset Flex Code
9262 \begin_layout Plain Layout
9269 \begin_inset Quotes erd
9274 \begin_inset Flex Code
9277 \begin_layout Plain Layout
9283 corresponds to the case where the block of paragraphs which have
9284 \begin_inset Quotes eld
9288 \begin_inset Flex Code
9291 \begin_layout Plain Layout
9298 \begin_inset Quotes erd
9301 should be enclosed into the
9302 \begin_inset Flex Code
9305 \begin_layout Plain Layout
9314 \begin_layout Description
9315 \begin_inset Flex Code
9318 \begin_layout Plain Layout
9324 Sets which divisions are included in the table of contents.
9326 \begin_inset Flex Code
9329 \begin_layout Plain Layout
9338 \begin_layout Subsection
9339 \begin_inset Flex Code
9342 \begin_layout Plain Layout
9349 \begin_inset CommandInset label
9351 name "sub:ClassOptions"
9358 \begin_layout Standard
9360 \begin_inset Flex Code
9363 \begin_layout Plain Layout
9369 section can contain the following entries:
9372 \begin_layout Description
9373 \begin_inset Flex Code
9376 \begin_layout Plain Layout
9383 \begin_inset Flex Code
9386 \begin_layout Plain Layout
9392 ] The list of available font sizes for the document's main font, separated
9394 \begin_inset Quotes eld
9398 \begin_inset Flex Code
9401 \begin_layout Plain Layout
9408 \begin_inset Quotes erd
9414 \begin_layout Description
9415 \begin_inset Flex Code
9418 \begin_layout Plain Layout
9424 Used to set the DTD line with XML-based output classes.
9426 \begin_inset space \thinspace{}
9430 \begin_inset Quotes eld
9433 -//OASIS//DTD DocBook V4.2//EN
9434 \begin_inset Quotes erd
9440 \begin_layout Description
9441 \begin_inset Flex Code
9444 \begin_layout Plain Layout
9451 \begin_inset Flex Code
9454 \begin_layout Plain Layout
9455 string="empty|plain|headings|fancy"
9460 ] The list of available page styles, separated by
9461 \begin_inset Quotes eld
9465 \begin_inset Flex Code
9468 \begin_layout Plain Layout
9475 \begin_inset Quotes erd
9481 \begin_layout Description
9482 \begin_inset Flex Code
9485 \begin_layout Plain Layout
9492 \begin_inset Flex Code
9495 \begin_layout Plain Layout
9501 ] Some document class options, separated by a comma, that will be added
9502 to the optional part of the
9503 \begin_inset Flex Code
9506 \begin_layout Plain Layout
9517 \begin_layout Standard
9519 \begin_inset Flex Code
9522 \begin_layout Plain Layout
9528 section must end with
9529 \begin_inset Quotes eld
9533 \begin_inset Flex Code
9536 \begin_layout Plain Layout
9543 \begin_inset Quotes erd
9549 \begin_layout Subsection
9551 \begin_inset CommandInset label
9553 name "sub:Paragraph-Styles"
9560 \begin_layout Standard
9561 A paragraph style description looks like this:
9565 \begin_layout Plain Layout
9566 Note that this will either define a new style or modify an existing one.
9574 \begin_layout LyX-Code
9581 \begin_layout LyX-Code
9585 \begin_layout LyX-Code
9589 \begin_layout Standard
9590 where the following commands are allowed:
9593 \begin_layout Description
9594 \begin_inset Flex Code
9597 \begin_layout Plain Layout
9604 \begin_inset Flex Code
9607 \begin_layout Plain Layout
9612 , left, right, center
9617 ] Paragraph alignment.
9620 \begin_layout Description
9621 \begin_inset Flex Code
9624 \begin_layout Plain Layout
9631 \begin_inset Flex Code
9634 \begin_layout Plain Layout
9639 , left, right, center
9644 ] A comma separated list of permitted alignments.
9645 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9647 For example a right-aligned or centered enumeration isn't possible.)
9650 \begin_layout Description
9651 \begin_inset Flex Code
9654 \begin_layout Plain Layout
9660 Note that this will completely override any prior
9661 \begin_inset Flex Code
9664 \begin_layout Plain Layout
9670 declaration for this style.
9672 \begin_inset Quotes eld
9676 \begin_inset Flex Code
9679 \begin_layout Plain Layout
9686 \begin_inset Quotes erd
9691 \begin_inset CommandInset ref
9693 reference "sub:I18n"
9697 for details on its use.
9700 \begin_layout Description
9701 \begin_inset Flex Code
9704 \begin_layout Plain Layout
9711 \begin_inset Flex Code
9714 \begin_layout Plain Layout
9724 \begin_layout Plain Layout
9725 Note that a `float' here is a real number, such as: 1.5.
9730 The vertical space with which the last of a chain of paragraphs with this
9731 style is separated from the following paragraph.
9732 If the next paragraph has another style, the separations are not simply
9733 added, but the maximum is taken.
9736 \begin_layout Description
9737 \begin_inset Flex Code
9740 \begin_layout Plain Layout
9747 \begin_inset Flex Code
9750 \begin_layout Plain Layout
9756 The category for this style.
9757 This is used to group related styles in the style combobox on the toolbar.
9758 Any string can be used, but you may want to use existing categories with
9763 \begin_layout Description
9764 \begin_inset Flex Code
9767 \begin_layout Plain Layout
9773 Depth of XML command.
9774 Used only with XML-type formats.
9777 \begin_layout Description
9778 \begin_inset Flex Code
9781 \begin_layout Plain Layout
9788 \begin_inset CommandInset label
9790 name "des:CopyStyle"
9795 \begin_inset Flex Code
9798 \begin_layout Plain Layout
9804 Copies all the features of an existing style into the current one.
9808 \begin_layout Description
9809 \begin_inset Flex Code
9812 \begin_layout Plain Layout
9818 The name of a style whose preamble should be output
9823 This allows to ensure some ordering of the preamble snippets when macros
9824 definitions depend on one another.
9828 \begin_layout Plain Layout
9829 Note that, besides that functionality, there is no way to ensure any ordering
9831 The ordering that you see in a given version of LyX may change without
9832 warning in later versions.
9840 \begin_layout Description
9841 \begin_inset Flex Code
9844 \begin_layout Plain Layout
9851 \begin_inset Flex Code
9854 \begin_layout Plain Layout
9859 , Box, Filled_Box, Static
9864 ] The type of label that stands at the end of the paragraph (or sequence
9866 \begin_inset Flex Code
9869 \begin_layout Plain Layout
9876 \begin_inset Flex Code
9879 \begin_layout Plain Layout
9886 \begin_inset Flex Code
9889 \begin_layout Plain Layout
9896 \begin_inset Flex Code
9899 \begin_layout Plain Layout
9907 \begin_inset Flex Code
9910 \begin_layout Plain Layout
9917 \begin_inset Quotes eld
9921 \begin_inset Quotes erd
9925 \begin_inset Flex Code
9928 \begin_layout Plain Layout
9935 \begin_inset Flex Code
9938 \begin_layout Plain Layout
9939 \begin_inset space ~
9948 \begin_inset space ~
9951 black) square suitable for end of proof markers,
9952 \begin_inset Flex Code
9955 \begin_layout Plain Layout
9961 is an explicit text string.
9964 \begin_layout Description
9965 \begin_inset Flex Code
9968 \begin_layout Plain Layout
9975 \begin_inset Flex Code
9978 \begin_layout Plain Layout
9984 ] The string used for a label with a
9985 \begin_inset Flex Code
9988 \begin_layout Plain Layout
9995 \begin_inset Flex Code
9998 \begin_layout Plain Layout
10008 \begin_layout Description
10009 \begin_inset Flex Code
10012 \begin_layout Plain Layout
10018 The font used for both the text body
10024 \begin_inset space ~
10028 \begin_inset CommandInset ref
10030 reference "sub:Font-description"
10035 Note that defining this font automatically defines the
10036 \begin_inset Flex Code
10039 \begin_layout Plain Layout
10046 So you should define this one first if you also want to define
10047 \begin_inset Flex Code
10050 \begin_layout Plain Layout
10059 \begin_layout Description
10060 \begin_inset Flex Code
10063 \begin_layout Plain Layout
10070 \begin_inset CommandInset label
10072 name "des:FreeSpacing"
10077 \begin_inset Flex Code
10080 \begin_layout Plain Layout
10089 \begin_inset Flex Code
10092 \begin_layout Plain Layout
10098 ] Usually LyX doesn't allow you to insert more than one space between words,
10099 since a space is considered as the separation between two words, not a
10100 character or symbol of its own.
10101 This is a very fine thing but sometimes annoying, for example, when typing
10102 program code or plain LaTeX code.
10104 \begin_inset Flex Code
10107 \begin_layout Plain Layout
10114 Note that LyX will create protected blanks for the additional blanks when
10115 in another mode than LaTeX-mode.
10118 \begin_layout Description
10119 \begin_inset Flex Code
10122 \begin_layout Plain Layout
10128 These tags are used with XHTML output.
10130 \begin_inset CommandInset ref
10132 reference "sub:Paragraph-Style-XHTML"
10139 \begin_layout Description
10140 \begin_inset Flex Code
10143 \begin_layout Plain Layout
10149 [[FIXME]] (Used only with XML-type formats.)
10152 \begin_layout Description
10153 \begin_inset Flex Code
10156 \begin_layout Plain Layout
10163 \begin_inset Flex Code
10166 \begin_layout Plain Layout
10172 If 1, marks the style as to be included in the document preamble rather
10173 than in the document body.
10174 This is useful for document classes that want such information as the title
10175 and author to appear in the preamble.
10176 Note that this works only for styles for which the
10177 \begin_inset Flex Code
10180 \begin_layout Plain Layout
10187 \begin_inset Flex Code
10190 \begin_layout Plain Layout
10197 \begin_inset Flex Code
10200 \begin_layout Plain Layout
10209 \begin_layout Description
10210 \begin_inset Flex Code
10213 \begin_layout Plain Layout
10220 \begin_inset Flex Code
10223 \begin_layout Plain Layout
10229 If 1, marks the style as being part of a title block (see also the
10230 \begin_inset Flex Code
10233 \begin_layout Plain Layout
10240 \begin_inset Flex Code
10243 \begin_layout Plain Layout
10252 \begin_layout Description
10253 \begin_inset Flex Code
10256 \begin_layout Plain Layout
10263 \begin_inset Flex Code
10266 \begin_layout Plain Layout
10272 ] This provides extra space between paragraphs that have the same style.
10273 If you put other styles into an environment, each is separated with the
10275 \begin_inset Flex Code
10278 \begin_layout Plain Layout
10285 But the whole items of the environment are additionally separated with
10287 \begin_inset Flex Code
10290 \begin_layout Plain Layout
10297 Note that this is a
10302 \begin_layout Description
10303 \begin_inset Flex Code
10306 \begin_layout Plain Layout
10312 [[FIXME]] (Used only with XML-type formats.)
10315 \begin_layout Description
10316 \begin_inset Flex Code
10319 \begin_layout Plain Layout
10326 \begin_inset CommandInset label
10328 name "des:KeepEmpty"
10333 \begin_inset Flex Code
10336 \begin_layout Plain Layout
10345 \begin_inset Flex Code
10348 \begin_layout Plain Layout
10354 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10355 lead to empty LaTeX output.
10356 There are some cases where this could be desirable however: in a letter
10357 template, the required fields can be provided as empty fields, so that
10358 people do not forget them; in some special classes, a style can be used
10359 as some kind of break, which does not contain actual text.
10362 \begin_layout Description
10363 \begin_inset Flex Code
10366 \begin_layout Plain Layout
10372 [float=0] The vertical space between the label and the text body.
10373 Only used for labels that are above the text body (
10374 \begin_inset Flex Code
10377 \begin_layout Plain Layout
10384 \begin_inset Flex Code
10387 \begin_layout Plain Layout
10388 Centered_Top_Environment
10396 \begin_layout Description
10397 \begin_inset Flex Code
10400 \begin_layout Plain Layout
10407 \begin_inset Flex Code
10410 \begin_layout Plain Layout
10417 \begin_inset Newline newline
10420 The name of the counter for automatic numbering.
10422 \begin_inset Newline newline
10430 \begin_inset Flex Code
10433 \begin_layout Plain Layout
10440 \begin_inset Flex Code
10443 \begin_layout Plain Layout
10450 In that case, the counter will be stepped each time the style appears.
10452 \begin_inset Newline newline
10460 \begin_inset Flex Code
10463 \begin_layout Plain Layout
10470 \begin_inset Flex Code
10473 \begin_layout Plain Layout
10479 , though this case is a bit complicated.
10480 Suppose you declare
10481 \begin_inset Quotes eld
10485 \begin_inset Flex Code
10488 \begin_layout Plain Layout
10489 LabelCounter myenum
10495 \begin_inset Quotes erd
10499 Then the actual counters used are
10500 \begin_inset Flex Code
10503 \begin_layout Plain Layout
10510 \begin_inset Flex Code
10513 \begin_layout Plain Layout
10520 \begin_inset Flex Code
10523 \begin_layout Plain Layout
10530 \begin_inset Flex Code
10533 \begin_layout Plain Layout
10539 , much as in LaTeX.
10540 These counters must all be declared separately.
10541 \begin_inset Newline newline
10545 \begin_inset CommandInset ref
10547 reference "sub:Counters"
10551 for details on counters.
10554 \begin_layout Description
10555 \begin_inset Flex Code
10558 \begin_layout Plain Layout
10564 The font used for the label.
10566 \begin_inset space ~
10570 \begin_inset CommandInset ref
10572 reference "sub:Font-description"
10579 \begin_layout Description
10580 \begin_inset Flex Code
10583 \begin_layout Plain Layout
10589 Text that indicates how far a label should be indented.
10592 \begin_layout Description
10593 \begin_inset Flex Code
10596 \begin_layout Plain Layout
10603 \begin_inset Flex Code
10606 \begin_layout Plain Layout
10612 ] The horizontal space between the label and the text body.
10613 Only used for labels that are not above the text body.
10616 \begin_layout Description
10617 \begin_inset Flex Code
10620 \begin_layout Plain Layout
10627 \begin_inset Flex Code
10630 \begin_layout Plain Layout
10636 ] The string used for a label with a
10637 \begin_inset Flex Code
10640 \begin_layout Plain Layout
10648 \begin_inset Flex Code
10651 \begin_layout Plain Layout
10657 is set, this string can be contain the special formatting commands described
10659 \begin_inset CommandInset ref
10661 reference "sub:Counters"
10669 \begin_layout Plain Layout
10670 For the sake of backwards compatibility, the string
10671 \begin_inset Flex Code
10674 \begin_layout Plain Layout
10684 will be replaced by the expanded
10685 \begin_inset Flex Code
10688 \begin_layout Plain Layout
10695 \begin_inset Flex Code
10698 \begin_layout Plain Layout
10707 This feature is now obsolete and should be replaced by the mechanisms of
10709 \begin_inset CommandInset ref
10711 reference "sub:Counters"
10723 \begin_layout Description
10724 \begin_inset Flex Code
10727 \begin_layout Plain Layout
10728 LabelStringAppendix
10734 \begin_inset Flex Code
10737 \begin_layout Plain Layout
10743 ] This is used inside the appendix instead of
10744 \begin_inset Flex Code
10747 \begin_layout Plain Layout
10755 \begin_inset Flex Code
10758 \begin_layout Plain Layout
10765 \begin_inset Flex Code
10768 \begin_layout Plain Layout
10769 LabelStringAppendix
10777 \begin_layout Description
10778 \begin_inset Flex Code
10781 \begin_layout Plain Layout
10787 [FIXME] (Used only with XML-type formats.)
10790 \begin_layout Description
10791 \begin_inset Flex Code
10794 \begin_layout Plain Layout
10801 \begin_inset Flex Code
10804 \begin_layout Plain Layout
10809 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10810 Enumerate, Itemize, Bibliography
10819 \begin_layout Itemize
10820 \begin_inset Flex Code
10823 \begin_layout Plain Layout
10829 means the label is the very first word (up to the first real blank).
10830 Use protected spaces (like
10831 \begin_inset space ~
10834 that one) if you want more than one word as the label.
10838 \begin_layout Itemize
10839 \begin_inset Flex Code
10842 \begin_layout Plain Layout
10848 means the label is simply whatever
10849 \begin_inset Flex Code
10852 \begin_layout Plain Layout
10859 Note that this really is `static'.
10862 \begin_layout Itemize
10863 \begin_inset Flex Code
10866 \begin_layout Plain Layout
10873 \begin_inset Flex Code
10876 \begin_layout Plain Layout
10877 Centered_Top_Environment
10882 are special cases of
10883 \begin_inset Flex Code
10886 \begin_layout Plain Layout
10893 The label will be printed above the paragraph, but only at the top of an
10894 environment or the top of a chain of paragraphs with this style.
10895 This might be used with the
10896 \begin_inset Flex MenuItem
10899 \begin_layout Plain Layout
10905 style, for example.
10908 \begin_layout Itemize
10909 \begin_inset Flex Code
10912 \begin_layout Plain Layout
10918 is a special case for the caption-labels
10919 \begin_inset Quotes eld
10923 \begin_inset Quotes erd
10927 \begin_inset Quotes eld
10931 \begin_inset Quotes erd
10936 \begin_inset Flex Code
10939 \begin_layout Plain Layout
10945 means the (hardcoded) label string depends on the kind of float: It is
10946 hardcoded to be `FloatType N', where N is the value of the counter associated
10950 \begin_layout Itemize
10952 \begin_inset Flex Code
10955 \begin_layout Plain Layout
10961 label type defines automatically numbered labels.
10963 \begin_inset Flex Code
10966 \begin_layout Plain Layout
10972 will be expanded to resolve any counter references it contains: For example,
10974 \begin_inset Quotes eld
10978 \begin_inset Flex Code
10981 \begin_layout Plain Layout
10992 \begin_inset Quotes erd
10997 \begin_inset CommandInset ref
10999 reference "sub:Counters"
11003 for more information on counters.
11006 \begin_layout Itemize
11007 \begin_inset Flex Code
11010 \begin_layout Plain Layout
11016 produces the usual sort of enumeration labels.
11017 At present, it is hardcoded to use Arabic numerals, lowercase letters,
11018 small Roman numerals, and uppercase letters for the four possible depths.
11021 \begin_layout Itemize
11022 \begin_inset Flex Code
11025 \begin_layout Plain Layout
11031 produces various bullets at the different levels.
11032 It is also hardcoded.
11035 \begin_layout Itemize
11036 \begin_inset Flex Code
11039 \begin_layout Plain Layout
11045 is used internally by LyX and should be used only with
11046 \begin_inset Flex Code
11049 \begin_layout Plain Layout
11050 LatexType BibEnvironment
11059 \begin_layout Description
11060 \begin_inset Flex Code
11063 \begin_layout Plain Layout
11069 Note that this will completely override any prior
11070 \begin_inset Flex Code
11073 \begin_layout Plain Layout
11079 declaration for this style.
11081 \begin_inset Quotes eld
11085 \begin_inset Flex Code
11088 \begin_layout Plain Layout
11095 \begin_inset Quotes erd
11100 \begin_inset CommandInset ref
11102 reference "sub:I18n"
11106 for details on its use.
11109 \begin_layout Description
11110 \begin_inset Flex Code
11113 \begin_layout Plain Layout
11119 The name of the corresponding LaTeX stuff.
11120 Either the environment or command name.
11123 \begin_layout Description
11124 \begin_inset Flex Code
11127 \begin_layout Plain Layout
11133 An optional parameter for the corresponding
11134 \begin_inset Flex Code
11137 \begin_layout Plain Layout
11144 This parameter cannot be changed from within LyX.
11147 \begin_layout Description
11148 \begin_inset Flex Code
11151 \begin_layout Plain Layout
11158 \begin_inset CommandInset label
11160 name "des:LatexType"
11165 \begin_inset Flex Code
11168 \begin_layout Plain Layout
11173 , Command, Environment, Item_Environment,
11179 \begin_inset Flex Code
11182 \begin_layout Plain Layout
11183 List_Environment, Bib_Environment
11188 ] How the style should be translated into LaTeX.
11192 \begin_layout Plain Layout
11193 \begin_inset Flex Code
11196 \begin_layout Plain Layout
11202 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11203 Visit the SGML class files for specific examples.
11212 \begin_layout Itemize
11213 \begin_inset Flex Code
11216 \begin_layout Plain Layout
11222 means nothing special.
11226 \begin_layout Itemize
11227 \begin_inset Flex Code
11230 \begin_layout Plain Layout
11237 \begin_inset Flex Code
11240 \begin_layout Plain Layout
11247 {\SpecialChar \ldots{}
11256 \begin_layout Itemize
11257 \begin_inset Flex Code
11260 \begin_layout Plain Layout
11267 \begin_inset Flex Code
11270 \begin_layout Plain Layout
11277 }\SpecialChar \ldots{}
11293 \begin_layout Itemize
11294 \begin_inset Flex Code
11297 \begin_layout Plain Layout
11304 \begin_inset Flex Code
11307 \begin_layout Plain Layout
11314 \begin_inset Flex Code
11317 \begin_layout Plain Layout
11325 is generated for each paragraph of this environment.
11329 \begin_layout Itemize
11330 \begin_inset Flex Code
11333 \begin_layout Plain Layout
11340 \begin_inset Flex Code
11343 \begin_layout Plain Layout
11350 \begin_inset Flex Code
11353 \begin_layout Plain Layout
11359 is passed as an argument to the environment.
11361 \begin_inset Flex Code
11364 \begin_layout Plain Layout
11370 can be defined in the
11371 \begin_inset Flex MenuItem
11374 \begin_layout Plain Layout
11379 \SpecialChar \menuseparator
11385 \begin_inset space ~
11397 \begin_layout Standard
11398 Putting the last few things together, the LaTeX output will be either:
11401 \begin_layout LyX-Code
11404 latexname[latexparam]{\SpecialChar \ldots{}
11408 \begin_layout Standard
11412 \begin_layout LyX-Code
11415 begin{latexname}[latexparam] \SpecialChar \ldots{}
11421 \begin_layout Standard
11422 depending upon the LaTeX type.
11426 \begin_layout Description
11427 \begin_inset Flex Code
11430 \begin_layout Plain Layout
11437 \begin_inset Flex Code
11440 \begin_layout Plain Layout
11446 ] If you put styles into environments, the leftmargins are not simply added,
11447 but added with a factor
11448 \begin_inset Formula $\frac{4}{depth+4}$
11452 Note that this parameter is also used when the margin is defined as
11453 \begin_inset Flex Code
11456 \begin_layout Plain Layout
11463 \begin_inset Flex Code
11466 \begin_layout Plain Layout
11473 Then it is added to the manual or dynamic margin.
11475 \begin_inset Newline newline
11478 The argument is passed as a string.
11480 \begin_inset Quotes eld
11484 \begin_inset Flex Code
11487 \begin_layout Plain Layout
11494 \begin_inset Quotes erd
11497 means that the paragraph is indented with the width of
11498 \begin_inset Quotes eld
11502 \begin_inset Flex Code
11505 \begin_layout Plain Layout
11512 \begin_inset Quotes erd
11515 in the normal font.
11516 You can get a negative width by prefixing the string with
11517 \begin_inset Quotes eld
11521 \begin_inset Flex Code
11524 \begin_layout Plain Layout
11531 \begin_inset Quotes erd
11535 This way was chosen so that the look is the same with each used screen
11540 \begin_layout Description
11541 \begin_inset Flex Code
11544 \begin_layout Plain Layout
11551 \begin_inset Flex Code
11554 \begin_layout Plain Layout
11559 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11565 \begin_inset Newline newline
11568 The kind of margin that the style has on the left side.
11570 \begin_inset Flex Code
11573 \begin_layout Plain Layout
11579 just means a fixed margin.
11581 \begin_inset Flex Code
11584 \begin_layout Plain Layout
11590 means that the left margin depends on the string entered in the
11591 \begin_inset Flex MenuItem
11594 \begin_layout Plain Layout
11595 Edit\SpecialChar \menuseparator
11597 \begin_inset space ~
11606 This is used to typeset nice lists without tabulators.
11608 \begin_inset Flex Code
11611 \begin_layout Plain Layout
11617 means that the margin depends on the size of the label.
11618 This is used for automatic enumerated headlines.
11619 It is obvious that the headline
11620 \begin_inset Quotes eld
11623 5.4.3.2.1 Very long headline
11624 \begin_inset Quotes erd
11627 must have a wider left margin (as wide as
11628 \begin_inset Quotes eld
11632 \begin_inset Quotes erd
11635 plus the space) than
11636 \begin_inset Quotes eld
11639 3.2 Very long headline
11640 \begin_inset Quotes erd
11644 \begin_inset Quotes eld
11648 \begin_inset Quotes erd
11651 are not able to do this.
11653 \begin_inset Flex Code
11656 \begin_layout Plain Layout
11662 is similar, but only the very first row of the paragraph is dynamic, while
11663 the others are static; this is used, for example, for descriptions.
11665 \begin_inset Flex Code
11668 \begin_layout Plain Layout
11674 means the margin is chosen in a way that the longest row of this paragraph
11675 fits to the right margin.
11676 This is used to typeset an address on the right edge of the page.
11679 \begin_layout Description
11680 \begin_inset Flex Code
11683 \begin_layout Plain Layout
11690 \begin_inset Flex Code
11693 \begin_layout Plain Layout
11702 \begin_inset Flex Code
11705 \begin_layout Plain Layout
11711 ] Whether fragile commands in this style should be
11712 \begin_inset Flex Code
11715 \begin_layout Plain Layout
11728 whether this command should itself be protected.)
11731 \begin_layout Description
11732 \begin_inset Flex Code
11735 \begin_layout Plain Layout
11742 \begin_inset Flex Code
11745 \begin_layout Plain Layout
11752 \begin_inset Flex Code
11755 \begin_layout Plain Layout
11763 ] Whether newlines are translated into LaTeX newlines (
11764 \begin_inset Flex Code
11767 \begin_layout Plain Layout
11778 The translation can be switched off to allow more comfortable LaTeX editing
11782 \begin_layout Description
11783 \begin_inset Flex Code
11786 \begin_layout Plain Layout
11793 \begin_inset Flex Code
11796 \begin_layout Plain Layout
11803 \begin_inset Flex Code
11806 \begin_layout Plain Layout
11814 ] If set to true, and if
11815 \begin_inset Flex Code
11818 \begin_layout Plain Layout
11825 \begin_inset Flex Code
11828 \begin_layout Plain Layout
11834 ) paragraphs are being indented, then the indentation of such a paragraph
11835 following one of this type will be suppressed.
11836 (So this will not affect the display of non-default paragraphs.)
11839 \begin_layout Description
11840 \begin_inset Flex Code
11843 \begin_layout Plain Layout
11849 Name of a style that has replaced this style.
11850 This is used to rename a style, while keeping backward compatibility.
11853 \begin_layout Description
11854 \begin_inset Flex Code
11857 \begin_layout Plain Layout
11864 \begin_inset Flex Code
11867 \begin_layout Plain Layout
11873 ] The number of optional arguments that can be used with this style.
11874 This is useful for things like section headings, and only makes sense with
11876 Note that, on output, the optional arguments will all precede any required
11877 arguments (see below).
11878 So one can have constructs like:
11882 \begin_layout LyX-Code
11885 mycmd[opt1]{req1}{contents of paragraph}
11888 \begin_layout Standard
11889 but one cannot have things like:
11892 \begin_layout LyX-Code
11895 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11898 \begin_layout Standard
11899 at least, not without ERT (with which you can have anything).
11904 \begin_layout Description
11905 \begin_inset Flex Code
11908 \begin_layout Plain Layout
11915 \begin_inset CommandInset label
11917 name "des:ParbreakIsNewline"
11922 \begin_inset Flex Code
11925 \begin_layout Plain Layout
11934 \begin_inset Flex Code
11937 \begin_layout Plain Layout
11943 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
11944 output, but only by a line break; together with
11945 \begin_inset Flex Code
11948 \begin_layout Plain Layout
11954 , this allows to emulate a plain text editor (like the ERT inset).
11957 \begin_layout Description
11958 \begin_inset Flex Code
11961 \begin_layout Plain Layout
11968 \begin_inset Flex Code
11971 \begin_layout Plain Layout
11977 ] The indent of the very first line of a paragraph.
11979 \begin_inset Flex Code
11982 \begin_layout Plain Layout
11988 will be fixed for a certain style.
11989 The exception is the default style, since the indentation for these paragraphs
11990 can be prohibited with
11991 \begin_inset Flex Code
11994 \begin_layout Plain Layout
12002 \begin_inset Flex Code
12005 \begin_layout Plain Layout
12011 style paragraphs inside environments use the
12012 \begin_inset Flex Code
12015 \begin_layout Plain Layout
12021 of the environment, not their native one.
12023 \begin_inset Flex Code
12026 \begin_layout Plain Layout
12032 paragraphs inside an enumeration are not indented.
12035 \begin_layout Description
12036 \begin_inset Flex Code
12039 \begin_layout Plain Layout
12046 \begin_inset Flex Code
12049 \begin_layout Plain Layout
12055 ] The vertical space between two paragraphs of this style.
12058 \begin_layout Description
12059 \begin_inset Flex Code
12062 \begin_layout Plain Layout
12069 \begin_inset Flex Code
12072 \begin_layout Plain Layout
12078 ] LyX allows the user to choose either
12079 \begin_inset Quotes eld
12083 \begin_inset Quotes erd
12087 \begin_inset Quotes eld
12091 \begin_inset Quotes erd
12094 to typeset a document.
12096 \begin_inset Quotes eld
12100 \begin_inset Quotes erd
12103 is chosen, this value is completely ignored.
12105 \begin_inset Quotes eld
12109 \begin_inset Quotes erd
12112 is chosen, the parindent of a LaTeXtype
12113 \begin_inset Quotes eld
12117 \begin_inset Quotes erd
12120 style is ignored and all paragraphs are separated by this parskip argument.
12121 The vertical space is calculated with
12122 \begin_inset Flex Code
12125 \begin_layout Plain Layout
12127 \begin_inset space ~
12136 \begin_inset Flex Code
12139 \begin_layout Plain Layout
12145 is the height of a row with the normal font.
12146 This way, the look stays the same with different screen fonts.
12149 \begin_layout Description
12150 \begin_inset Flex Code
12153 \begin_layout Plain Layout
12160 \begin_inset CommandInset label
12162 name "des:PassThru"
12167 \begin_inset Flex Code
12170 \begin_layout Plain Layout
12179 \begin_inset Flex Code
12182 \begin_layout Plain Layout
12188 ] Whether the contents of this paragraph should be output in raw form, meaning
12189 without special translations that LaTeX would require.
12192 \begin_layout Description
12193 \begin_inset Flex Code
12196 \begin_layout Plain Layout
12203 \begin_inset CommandInset label
12205 name "des:Preamble"
12209 Information to be included in the LaTeX preamble when this style is used.
12210 Used to define macros, load packages, etc., required by this particular
12213 \begin_inset Quotes eld
12217 \begin_inset Flex Code
12220 \begin_layout Plain Layout
12227 \begin_inset Quotes erd
12233 \begin_layout Description
12234 \begin_inset Flex Code
12237 \begin_layout Plain Layout
12244 \begin_inset Flex Code
12247 \begin_layout Plain Layout
12253 ] The prefix to use when creating labels referring to paragraphs of this
12255 This allows the use of formatted references.
12258 \begin_layout Description
12259 \begin_inset Flex Code
12262 \begin_layout Plain Layout
12269 \begin_inset Flex Code
12272 \begin_layout Plain Layout
12278 ] The number of required arguments that the LaTeX command or environment
12279 corresponding to this style expects.
12280 In the case of a command, these are required arguments
12284 that associated with the content of the paragraph itself.
12285 These do not actually have to be provided: LyX will output empty arguments
12287 Note that optional arguments will be output before required arguments.
12288 See the discussion of the
12289 \begin_inset Flex Code
12292 \begin_layout Plain Layout
12298 tag above for more information.
12301 \begin_layout Description
12302 \begin_inset Flex Code
12305 \begin_layout Plain Layout
12312 \begin_inset Flex Code
12315 \begin_layout Plain Layout
12322 \begin_inset CommandInset label
12324 name "des:Requires"
12328 Whether the style requires the feature
12329 \begin_inset Flex Code
12332 \begin_layout Plain Layout
12339 See the description of
12340 \begin_inset Flex Code
12343 \begin_layout Plain Layout
12350 \begin_inset CommandInset ref
12351 LatexCommand pageref
12352 reference "des:FreeSpacing"
12356 ) for information on `features'.
12360 \begin_layout Description
12361 \begin_inset Flex Code
12364 \begin_layout Plain Layout
12371 \begin_inset Flex Code
12374 \begin_layout Plain Layout
12381 \begin_inset Flex Code
12384 \begin_layout Plain Layout
12393 \begin_layout Description
12394 \begin_inset Flex Code
12397 \begin_layout Plain Layout
12404 \begin_inset Flex Code
12407 \begin_layout Plain Layout
12412 , onehalf, double, other
12421 ] This defines what the default spacing should be in the style.
12423 \begin_inset Flex Code
12426 \begin_layout Plain Layout
12433 \begin_inset Flex Code
12436 \begin_layout Plain Layout
12443 \begin_inset Flex Code
12446 \begin_layout Plain Layout
12452 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12453 If you specify the argument
12454 \begin_inset Flex Code
12457 \begin_layout Plain Layout
12463 , then you should also provide a numerical argument which will be the actual
12465 Note that, contrary to other parameters,
12466 \begin_inset Flex Code
12469 \begin_layout Plain Layout
12475 implies the generation of specific LaTeX code, using the package
12478 \begin_inset Flex Code
12481 \begin_layout Plain Layout
12490 \begin_layout Description
12491 \begin_inset Flex Code
12494 \begin_layout Plain Layout
12501 \begin_inset Flex Code
12504 \begin_layout Plain Layout
12511 \begin_inset Flex Code
12514 \begin_layout Plain Layout
12522 ] Spellcheck paragraphs of this style.
12526 \begin_layout Description
12527 \begin_inset Flex Code
12530 \begin_layout Plain Layout
12536 The font used for the text body .
12538 \begin_inset CommandInset ref
12540 reference "sub:Font-description"
12547 \begin_layout Description
12548 \begin_inset Flex Code
12551 \begin_layout Plain Layout
12560 \begin_inset Flex Code
12563 \begin_layout Plain Layout
12573 The level of the style in the table of contents.
12574 This is used for automatic numbering of section headings.
12577 \begin_layout Description
12578 \begin_inset Flex Code
12581 \begin_layout Plain Layout
12588 \begin_inset Flex Code
12591 \begin_layout Plain Layout
12597 ] The vertical space with which the very first of a chain of paragraphs
12598 with this style is separated from the previous paragraph.
12599 If the previous paragraph has another style, the separations are not simply
12600 added, but the maximum is taken.
12603 \begin_layout Subsection
12604 \begin_inset CommandInset label
12610 Internationalization of Paragraph Styles
12613 \begin_layout Standard
12614 LyX has long supported internationalization of layout information, but,
12615 until version 2.0, this applied only to the user interface and not to, say,
12617 Thus, French authors were forced to resort to ugly hacks if they wanted
12622 1' instead of `Theorem 1'.
12623 Thanks to Georg Baum, that is no longer the case.
12626 \begin_layout Standard
12628 \begin_inset Flex Code
12631 \begin_layout Plain Layout
12637 defines text that is to appear in the typeset document, it may use
12638 \begin_inset Flex Code
12641 \begin_layout Plain Layout
12648 \begin_inset Flex Code
12651 \begin_layout Plain Layout
12657 to support non-English and even multi-language documents correctly.
12658 The following excerpt (from the
12659 \begin_inset Flex Code
12662 \begin_layout Plain Layout
12668 file) shows how this works:
12671 \begin_layout LyX-Code
12676 \begin_layout LyX-Code
12679 theoremstyle{remark}
12682 \begin_layout LyX-Code
12685 newtheorem{claim}[thm]{
12692 \begin_layout LyX-Code
12696 \begin_layout LyX-Code
12700 \begin_layout LyX-Code
12705 claimname}{_(Claim)}
12708 \begin_layout LyX-Code
12712 \begin_layout LyX-Code
12716 \begin_layout LyX-Code
12725 claimname}{_(Claim)}}
12728 \begin_layout LyX-Code
12733 \begin_layout Standard
12734 In principle, any legal LaTeX may appear in the
12735 \begin_inset Flex Code
12738 \begin_layout Plain Layout
12745 \begin_inset Flex Code
12748 \begin_layout Plain Layout
12754 tags, but in practice they will typically look as they do here.
12755 The key to correct translation of the typeset text is the definition of
12757 \begin_inset Flex Code
12760 \begin_layout Plain Layout
12769 \begin_inset Flex Code
12772 \begin_layout Plain Layout
12784 \begin_layout Standard
12786 \begin_inset Flex Code
12789 \begin_layout Plain Layout
12795 tag provides for internationalization based upon the overall language of
12797 The contents of the tag will be included in the preamble, just as with
12799 \begin_inset Flex Code
12802 \begin_layout Plain Layout
12809 What makes it special is the use of the
12810 \begin_inset Quotes eld
12814 \begin_inset Quotes erd
12818 \begin_inset Flex Code
12821 \begin_layout Plain Layout
12827 , which will be replaced, when LyX produces LaTeX output, with the translation
12828 of its argument into the document language.
12831 \begin_layout Standard
12833 \begin_inset Flex Code
12836 \begin_layout Plain Layout
12842 tag is more complex, since it is meant to provide support for multi-language
12843 documents and so offers an interface to the
12844 \begin_inset Flex Code
12847 \begin_layout Plain Layout
12854 Its contents will be added to the preamble once for each language that
12855 appears in the document.
12856 In this case, the argument to
12857 \begin_inset Flex Code
12860 \begin_layout Plain Layout
12866 will be replaced with its translation into the language in question; the
12868 \begin_inset Flex Code
12871 \begin_layout Plain Layout
12877 is replaced by the language name (as used by the babel package).
12880 \begin_layout Standard
12881 A German document that also included a French section would thus have the
12882 following in the preamble:
12885 \begin_layout LyX-Code
12894 claimname}{Affirmation}}
12902 claimname}{Behauptung}}
12906 claimname}{Behauptung}
12909 \begin_layout Standard
12911 \begin_inset Flex Code
12914 \begin_layout Plain Layout
12920 will then conspire to produce the correct text in the output.
12923 \begin_layout Standard
12924 One important point to note here is that the translations are provided by
12925 LyX itself, through the same mechanism it uses for internationalization
12926 of the user interface.
12927 This means, in effect, that
12928 \begin_inset Flex Code
12931 \begin_layout Plain Layout
12938 \begin_inset Flex Code
12941 \begin_layout Plain Layout
12947 are really only of use in layout files that are provided with LyX, since
12948 text entered in user-created layout files will not be seen by LyX's internation
12949 alization routines.
12950 That said, however, any layout created with the intention that it will
12951 be included with LyX should use these tags where appropriate.
12954 \begin_layout Subsection
12956 \begin_inset CommandInset label
12965 \begin_layout Standard
12966 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12967 define the floats (
12968 \begin_inset Flex MenuItem
12971 \begin_layout Plain Layout
12978 \begin_inset Flex MenuItem
12981 \begin_layout Plain Layout
12987 , \SpecialChar \ldots{}
12988 ) in the text class itself.
12989 Standard floats are included in the file
12990 \begin_inset Flex Code
12993 \begin_layout Plain Layout
12999 , so you may have to do no more than add
13002 \begin_layout LyX-Code
13003 Input stdfloats.inc
13006 \begin_layout Standard
13007 to your layout file.
13008 If you want to implement a text class that proposes some other float types
13009 (like the AGU class bundled with LyX), the information below will hopefully
13013 \begin_layout Description
13014 \begin_inset Flex Code
13017 \begin_layout Plain Layout
13024 \begin_inset Flex Code
13027 \begin_layout Plain Layout
13034 \begin_inset Quotes erd
13038 \begin_inset Quotes erd
13041 ] The file name extension of an auxiliary file for the list of figures (or
13043 LaTeX writes the captions to this file.
13046 \begin_layout Description
13047 \begin_inset Flex Code
13050 \begin_layout Plain Layout
13057 \begin_inset Flex Code
13060 \begin_layout Plain Layout
13067 \begin_inset Quotes erd
13071 \begin_inset Quotes erd
13074 ] The string that will be used in the menus and also for the caption.
13075 This is translated to the current language if babel is used.
13078 \begin_layout Description
13079 \begin_inset Flex Code
13082 \begin_layout Plain Layout
13088 These are used for XHTML output.
13090 \begin_inset CommandInset ref
13092 reference "sec:Tags-for-XHTML"
13099 \begin_layout Description
13100 \begin_inset Flex Code
13103 \begin_layout Plain Layout
13112 \begin_inset Flex Code
13115 \begin_layout Plain Layout
13124 \begin_inset Flex Code
13127 \begin_layout Plain Layout
13133 ] Indicates whether the float is already defined in the document class or
13134 if we instead need to load
13135 \begin_inset Flex Code
13138 \begin_layout Plain Layout
13144 and use what it provides to define it on-the-fly.
13146 \begin_inset Flex Code
13149 \begin_layout Plain Layout
13156 \begin_inset Flex Code
13159 \begin_layout Plain Layout
13166 It should be set to
13167 \begin_inset Flex Code
13170 \begin_layout Plain Layout
13176 if the float is already defined by the LaTeX document class.
13179 \begin_layout Description
13180 \begin_inset Flex Code
13183 \begin_layout Plain Layout
13190 \begin_inset Flex Code
13193 \begin_layout Plain Layout
13200 \begin_inset Quotes erd
13204 \begin_inset Quotes erd
13207 ] The command used to generate a list of floats of this type; the leading
13210 ' should be omitted.
13216 \begin_inset Flex Code
13219 \begin_layout Plain Layout
13225 is false, since there is no standard way to generate this command.
13227 \begin_inset Flex Code
13230 \begin_layout Plain Layout
13236 is true, since in that case there is a standard way to define the command.
13239 \begin_layout Description
13240 \begin_inset Flex Code
13243 \begin_layout Plain Layout
13250 \begin_inset Flex Code
13253 \begin_layout Plain Layout
13260 \begin_inset Quotes erd
13264 \begin_inset Quotes erd
13267 ] A title for a list of floats of this kind (list of figures, tables, or
13269 It is used for the screen label within LyX; it is passed to LaTeX for use
13270 as the title there; and it is used as the title in XHTML output.
13271 It will be translated to the document language.
13274 \begin_layout Description
13275 \begin_inset Flex Code
13278 \begin_layout Plain Layout
13285 \begin_inset Flex Code
13288 \begin_layout Plain Layout
13295 \begin_inset Quotes erd
13299 \begin_inset Quotes erd
13302 ] This (optional) argument determines whether floats of this class will
13303 be numbered within some sectional unit of the document.
13304 For example, if within is equal to
13305 \begin_inset Flex Code
13308 \begin_layout Plain Layout
13314 , the floats will be numbered within chapters.
13318 \begin_layout Description
13319 \begin_inset Flex Code
13322 \begin_layout Plain Layout
13329 \begin_inset Flex Code
13332 \begin_layout Plain Layout
13339 \begin_inset Quotes erd
13343 \begin_inset Quotes erd
13346 ] The default placement for the given class of floats.
13347 The string should be as in standard LaTeX:
13348 \begin_inset Flex Code
13351 \begin_layout Plain Layout
13358 \begin_inset Flex Code
13361 \begin_layout Plain Layout
13368 \begin_inset Flex Code
13371 \begin_layout Plain Layout
13378 \begin_inset Flex Code
13381 \begin_layout Plain Layout
13387 for top, bottom, page, and here, respectively.
13391 \begin_layout Plain Layout
13392 Note that the order of these letters in the string is irrelevant, like in
13398 On top of that there is a new type,
13399 \begin_inset Flex Code
13402 \begin_layout Plain Layout
13408 , which does not really correspond to a float, since it means: put it
13409 \begin_inset Quotes eld
13413 \begin_inset Quotes erd
13417 Note however that the
13418 \begin_inset Flex Code
13421 \begin_layout Plain Layout
13427 specifier is special and, because of implementation details, cannot be
13428 used in non-built in float types.
13429 If you do not understand what this means, just use
13430 \begin_inset Quotes eld
13434 \begin_inset Flex Code
13437 \begin_layout Plain Layout
13444 \begin_inset Quotes erd
13450 \begin_layout Description
13451 \begin_inset Flex Code
13454 \begin_layout Plain Layout
13461 \begin_inset Flex Code
13464 \begin_layout Plain Layout
13470 ] The prefix to use when creating labels referring to floats of this type.
13471 This allows the use of formatted references.
13472 Note that you can remove any
13473 \begin_inset Flex Code
13476 \begin_layout Plain Layout
13482 set by a copied style by using the special value
13483 \begin_inset Quotes eld
13487 \begin_inset Quotes erd
13490 , which must be all caps.
13493 \begin_layout Description
13494 \begin_inset Flex Code
13497 \begin_layout Plain Layout
13504 \begin_inset Flex Code
13507 \begin_layout Plain Layout
13514 \begin_inset Quotes erd
13518 \begin_inset Quotes erd
13521 ] The style used when defining the float using
13522 \begin_inset Flex Code
13525 \begin_layout Plain Layout
13536 \begin_layout Description
13537 \begin_inset Flex Code
13540 \begin_layout Plain Layout
13547 \begin_inset Flex Code
13550 \begin_layout Plain Layout
13557 \begin_inset Quotes erd
13561 \begin_inset Quotes erd
13565 \begin_inset Quotes eld
13569 \begin_inset Quotes erd
13572 of the new class of floats, like program or algorithm.
13573 After the appropriate
13574 \begin_inset Flex Code
13577 \begin_layout Plain Layout
13586 \begin_inset Flex Code
13589 \begin_layout Plain Layout
13598 \begin_inset Flex Code
13601 \begin_layout Plain Layout
13612 \begin_layout Description
13613 \begin_inset Flex Code
13616 \begin_layout Plain Layout
13623 \begin_inset Flex Code
13626 \begin_layout Plain Layout
13633 \begin_inset Flex Code
13636 \begin_layout Plain Layout
13644 ] Tells us whether this float is defined using the facilities provided by
13646 \begin_inset Flex Code
13649 \begin_layout Plain Layout
13655 , either by the class file or a package, or on-the-fly by LyX itself.
13658 \begin_layout Standard
13659 Note that defining a float with type
13660 \begin_inset Flex Code
13663 \begin_layout Plain Layout
13671 automatically defines the corresponding counter with name
13672 \begin_inset Flex Code
13675 \begin_layout Plain Layout
13686 \begin_layout Subsection
13687 Flex insets and InsetLayout
13688 \begin_inset CommandInset label
13690 name "sub:Flex-insets-and"
13697 \begin_layout Standard
13698 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13699 these are called Flex insets.
13703 \begin_layout Standard
13704 Flex insets come in three different kinds:
13707 \begin_layout Itemize
13709 \begin_inset Flex Code
13712 \begin_layout Plain Layout
13718 ): These define semantic markup corresponding to such LaTeX commands as
13720 \begin_inset Flex Code
13723 \begin_layout Plain Layout
13732 \begin_inset Flex Code
13735 \begin_layout Plain Layout
13746 \begin_layout Itemize
13748 \begin_inset Flex Code
13751 \begin_layout Plain Layout
13757 ): These can be used to define custom collapsible insets, similar to TeX
13758 code, footnote, and the like.
13759 An obvious example is an endnote inset, which is defined in the
13760 \begin_inset Flex Code
13763 \begin_layout Plain Layout
13772 \begin_layout Itemize
13774 \begin_inset Flex Code
13777 \begin_layout Plain Layout
13783 ): For use with DocBook classes.
13786 \begin_layout Standard
13787 Flex insets are defined using the
13788 \begin_inset Flex Code
13791 \begin_layout Plain Layout
13797 tag, which shall be explained in a moment.
13800 \begin_layout Standard
13802 \begin_inset Flex Code
13805 \begin_layout Plain Layout
13811 tag also serves another function: It can be used to customize the general
13812 layout of many different types of insets.
13814 \begin_inset Flex Code
13817 \begin_layout Plain Layout
13823 can be used to customize the layout parameters for footnotes, marginal
13824 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13825 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13826 define Flex insets.
13829 \begin_layout Standard
13831 \begin_inset Flex Code
13834 \begin_layout Plain Layout
13840 definition must begin with a line of the form:
13843 \begin_layout LyX-Code
13847 \begin_layout Standard
13849 \begin_inset Flex Code
13852 \begin_layout Plain Layout
13858 indicates the inset whose layout is being defined, and here there are two
13862 \begin_layout Enumerate
13863 The layout for a pre-existing inset is being modified.
13864 In this case, can be
13865 \begin_inset Flex Code
13868 \begin_layout Plain Layout
13874 any one of the following:
13875 \begin_inset Flex Code
13878 \begin_layout Plain Layout
13885 \begin_inset Flex Code
13888 \begin_layout Plain Layout
13895 \begin_inset Flex Code
13898 \begin_layout Plain Layout
13905 \begin_inset Flex Code
13908 \begin_layout Plain Layout
13915 \begin_inset Flex Code
13918 \begin_layout Plain Layout
13925 \begin_inset Flex Code
13928 \begin_layout Plain Layout
13935 \begin_inset Flex Code
13938 \begin_layout Plain Layout
13945 \begin_inset Flex Code
13948 \begin_layout Plain Layout
13955 \begin_inset Flex Code
13958 \begin_layout Plain Layout
13965 \begin_inset Flex Code
13968 \begin_layout Plain Layout
13975 \begin_inset Flex Code
13978 \begin_layout Plain Layout
13985 \begin_inset Flex Code
13988 \begin_layout Plain Layout
13995 \begin_inset Flex Code
13998 \begin_layout Plain Layout
14005 \begin_inset Flex Code
14008 \begin_layout Plain Layout
14015 \begin_inset Flex Code
14018 \begin_layout Plain Layout
14025 \begin_inset Flex Code
14028 \begin_layout Plain Layout
14035 \begin_inset Flex Code
14038 \begin_layout Plain Layout
14045 \begin_inset Flex Code
14048 \begin_layout Plain Layout
14055 \begin_inset Flex Code
14058 \begin_layout Plain Layout
14065 \begin_inset Flex Code
14068 \begin_layout Plain Layout
14077 \begin_layout Enumerate
14078 The layout for a Flex inset is being defined.
14080 \begin_inset Flex Code
14083 \begin_layout Plain Layout
14089 must be of the form
14090 \begin_inset Quotes eld
14094 \begin_inset Flex Code
14097 \begin_layout Plain Layout
14104 \begin_inset Quotes erd
14108 \begin_inset Flex Code
14111 \begin_layout Plain Layout
14117 may be be any valid identifier not used by a pre-existing Flex inset.
14118 The identifier may include spaces, but in that case the whole thing must
14119 be wrapped in quotes.
14120 Note that the definition of a flex inset
14125 \begin_inset Flex Code
14128 \begin_layout Plain Layout
14134 entry, declaring which type of inset it defines.
14137 \begin_layout Standard
14139 \begin_inset Flex Code
14142 \begin_layout Plain Layout
14148 definition can contain the following entries:
14151 \begin_layout Description
14152 \begin_inset Flex Code
14155 \begin_layout Plain Layout
14161 The color for the inset's background.
14162 The valid colors are defined in
14163 \begin_inset Flex Code
14166 \begin_layout Plain Layout
14175 \begin_layout Description
14176 \begin_inset Flex Code
14179 \begin_layout Plain Layout
14186 \begin_inset Flex Code
14189 \begin_layout Plain Layout
14198 \begin_inset Flex Code
14201 \begin_layout Plain Layout
14207 ] Whether to use the content of the inset as the label, when the inset is
14212 \begin_layout Description
14213 \begin_inset Flex Code
14216 \begin_layout Plain Layout
14222 As with paragraph styles (see page
14223 \begin_inset CommandInset ref
14225 reference "des:CopyStyle"
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 ] Indicates whether the user may employ the Paragraph Settings dialog to
14265 customize the paragraph.
14268 \begin_layout Description
14269 \begin_inset Flex Code
14272 \begin_layout Plain Layout
14279 \begin_inset Flex Code
14282 \begin_layout Plain Layout
14289 \begin_inset Flex Code
14292 \begin_layout Plain Layout
14299 \begin_inset Flex Code
14302 \begin_layout Plain Layout
14308 , describing the rendering style used for the inset's frame and buttons.
14309 Footnotes generally use
14310 \begin_inset Flex Code
14313 \begin_layout Plain Layout
14319 , ERT insets generally
14320 \begin_inset Flex Code
14323 \begin_layout Plain Layout
14329 , and character styles
14330 \begin_inset Flex Code
14333 \begin_layout Plain Layout
14342 \begin_layout Description
14343 \begin_inset Flex Code
14346 \begin_layout Plain Layout
14353 \begin_inset Flex Code
14356 \begin_layout Plain Layout
14363 \begin_inset Flex Code
14366 \begin_layout Plain Layout
14375 \begin_inset Flex Code
14378 \begin_layout Plain Layout
14385 \begin_inset Flex Code
14388 \begin_layout Plain Layout
14395 Indicates whether the environment will stand on its own in LaTeX output
14396 or will appear inline with the surrounding text.
14397 If set to false, it is supposed that the LaTeX environment ignores white
14398 space (including one newline character) after the
14399 \begin_inset Flex Code
14402 \begin_layout Plain Layout
14415 \begin_inset Flex Code
14418 \begin_layout Plain Layout
14434 \begin_layout Description
14435 \begin_inset Flex Code
14438 \begin_layout Plain Layout
14444 Required at the end of the InsetLayout declarations.
14447 \begin_layout Description
14448 \begin_inset Flex Code
14451 \begin_layout Plain Layout
14457 The font used for both the text body
14463 \begin_inset space ~
14467 \begin_inset CommandInset ref
14469 reference "sub:Font-description"
14474 Note that defining this font automatically defines the
14475 \begin_inset Flex Code
14478 \begin_layout Plain Layout
14484 to the same value, so define this first and define
14485 \begin_inset Flex Code
14488 \begin_layout Plain Layout
14494 later if you want them to be different.
14497 \begin_layout Description
14498 \begin_inset Flex Code
14501 \begin_layout Plain Layout
14508 \begin_inset Quotes eld
14512 \begin_inset Quotes erd
14515 language, leading to Left-to-Right (latin) output, e.
14516 \begin_inset space \thinspace{}
14520 \begin_inset space \space{}
14523 in TeX code or URL.
14527 \begin_layout Description
14528 \begin_inset Flex Code
14531 \begin_layout Plain Layout
14538 \begin_inset Flex Code
14541 \begin_layout Plain Layout
14550 \begin_inset Flex Code
14553 \begin_layout Plain Layout
14559 ] Indicates whether the
14560 \begin_inset Flex Code
14563 \begin_layout Plain Layout
14569 should be used or, instead, the user can change the paragraph style used
14574 \begin_layout Description
14575 \begin_inset Flex Code
14578 \begin_layout Plain Layout
14584 As with paragraph styles (see page
14585 \begin_inset CommandInset ref
14586 LatexCommand pageref
14587 reference "des:FreeSpacing"
14595 \begin_layout Description
14596 \begin_inset Flex Code
14599 \begin_layout Plain Layout
14605 These tags control XHTML output.
14607 \begin_inset CommandInset ref
14609 reference "sec:Tags-for-XHTML"
14616 \begin_layout Description
14617 \begin_inset Flex Code
14620 \begin_layout Plain Layout
14627 \begin_inset Flex Code
14630 \begin_layout Plain Layout
14639 \begin_inset Flex Code
14642 \begin_layout Plain Layout
14648 ] Whether to include the contents of this inset in the strings generated
14649 for the `Outline' pane.
14650 One would not, for example, want the content of a footnote in a section
14651 header to be included in the TOC displayed in the outline, but one would
14652 normally want the content of a character style displayed.
14653 Default is false: not to include.
14656 \begin_layout Description
14657 \begin_inset Flex Code
14660 \begin_layout Plain Layout
14666 As with paragraph styles (see page
14667 \begin_inset CommandInset ref
14668 LatexCommand pageref
14669 reference "des:KeepEmpty"
14677 \begin_layout Description
14678 \begin_inset Flex Code
14681 \begin_layout Plain Layout
14687 The font used for the label.
14689 \begin_inset space ~
14693 \begin_inset CommandInset ref
14695 reference "sub:Font-description"
14700 Note that this definition can never appear before
14701 \begin_inset Flex Code
14704 \begin_layout Plain Layout
14710 , lest it be ineffective.
14713 \begin_layout Description
14714 \begin_inset Flex Code
14717 \begin_layout Plain Layout
14723 What will be displayed on the button or elsewhere as the inset label.
14725 \begin_inset Flex Code
14728 \begin_layout Plain Layout
14735 \begin_inset Flex Code
14738 \begin_layout Plain Layout
14744 ) modify this label on the fly.
14747 \begin_layout Description
14748 \begin_inset Flex Code
14751 \begin_layout Plain Layout
14757 The name of the corresponding LaTeX stuff.
14758 Either the environment or command name.
14761 \begin_layout Description
14762 \begin_inset Flex Code
14765 \begin_layout Plain Layout
14771 The optional parameter for the corresponding
14772 \begin_inset Flex Code
14775 \begin_layout Plain Layout
14781 stuff, including possible bracket pairs like
14782 \begin_inset Flex Code
14785 \begin_layout Plain Layout
14792 This parameter cannot be changed from within LyX.
14795 \begin_layout Description
14796 \begin_inset Flex Code
14799 \begin_layout Plain Layout
14805 As with paragraph styles (see page
14806 \begin_inset CommandInset ref
14807 LatexCommand pageref
14808 reference "des:LatexType"
14815 \begin_layout Description
14816 \begin_inset Flex Code
14819 \begin_layout Plain Layout
14826 \begin_inset Flex Code
14829 \begin_layout Plain Layout
14836 \begin_inset Flex Code
14839 \begin_layout Plain Layout
14846 \begin_inset Flex Code
14849 \begin_layout Plain Layout
14856 \begin_inset Flex Code
14859 \begin_layout Plain Layout
14865 (indicating a dummy definition ending definitions of charstyles, etc).
14866 This entry is required in and is only meaningful for Flex insets.
14867 Among other things, it determines on which menu this inset will appear.
14869 \begin_inset Flex Code
14872 \begin_layout Plain Layout
14879 \begin_inset Flex Code
14882 \begin_layout Plain Layout
14889 \begin_inset Flex Code
14892 \begin_layout Plain Layout
14900 \begin_inset Flex Code
14903 \begin_layout Plain Layout
14909 can be set to true for charstyle insets, if you wish, by setting it
14914 \begin_inset Flex Code
14917 \begin_layout Plain Layout
14926 \begin_layout Description
14927 \begin_inset Flex Code
14930 \begin_layout Plain Layout
14937 \begin_inset Flex Code
14940 \begin_layout Plain Layout
14949 \begin_inset Flex Code
14952 \begin_layout Plain Layout
14958 ] Whether multiple paragraphs are permitted in this inset.
14960 \begin_inset Flex Code
14963 \begin_layout Plain Layout
14969 to the same value and
14970 \begin_inset Flex Code
14973 \begin_layout Plain Layout
14979 to the opposite value.
14980 These can be reset to other values, if they are used
14985 \begin_inset Flex Code
14988 \begin_layout Plain Layout
14998 \begin_layout Description
14999 \begin_inset Flex Code
15002 \begin_layout Plain Layout
15009 \begin_inset Flex Code
15012 \begin_layout Plain Layout
15021 \begin_inset Flex Code
15024 \begin_layout Plain Layout
15030 ] Whether fragile commands in this inset should be
15031 \begin_inset Flex Code
15034 \begin_layout Plain Layout
15047 whether the command should itself be protected.) Default is false.
15050 \begin_layout Description
15051 \begin_inset Flex Code
15054 \begin_layout Plain Layout
15061 \begin_inset Flex Code
15064 \begin_layout Plain Layout
15073 \begin_inset Flex Code
15076 \begin_layout Plain Layout
15082 ] As with paragraph styles (see page
15083 \begin_inset CommandInset ref
15084 LatexCommand pageref
15085 reference "des:ParbreakIsNewline"
15093 \begin_layout Description
15094 \begin_inset Flex Code
15097 \begin_layout Plain Layout
15104 \begin_inset Flex Code
15107 \begin_layout Plain Layout
15116 \begin_inset Flex Code
15119 \begin_layout Plain Layout
15125 ] As with paragraph styles (see page
15126 \begin_inset CommandInset ref
15127 LatexCommand pageref
15128 reference "des:PassThru"
15136 \begin_layout Description
15137 \begin_inset Flex Code
15140 \begin_layout Plain Layout
15146 As with paragraph styles (see page
15147 \begin_inset CommandInset ref
15148 LatexCommand pageref
15149 reference "des:Preamble"
15156 \begin_layout Description
15157 \begin_inset Flex Code
15160 \begin_layout Plain Layout
15167 \begin_inset Flex Code
15170 \begin_layout Plain Layout
15176 ] The prefix to use when creating labels referring to insets of this type.
15177 This allows the use of formatted references.
15180 \begin_layout Description
15181 \begin_inset Flex Code
15184 \begin_layout Plain Layout
15191 \begin_inset Flex Code
15194 \begin_layout Plain Layout
15200 ] As with paragraph styles (see page
15201 \begin_inset CommandInset ref
15202 LatexCommand pageref
15203 reference "des:Requires"
15210 \begin_layout Description
15211 \begin_inset Flex Code
15214 \begin_layout Plain Layout
15221 \begin_inset Flex Code
15224 \begin_layout Plain Layout
15231 \begin_inset Flex Code
15234 \begin_layout Plain Layout
15242 ] Whether this inset should use the font of its surrounding environment
15244 Default is true: uses its own.
15247 \begin_layout Description
15248 \begin_inset Flex Code
15251 \begin_layout Plain Layout
15258 \begin_inset Flex Code
15261 \begin_layout Plain Layout
15268 \begin_inset Flex Code
15271 \begin_layout Plain Layout
15279 ] Spellcheck the contents of this inset.
15283 \begin_layout Subsection
15285 \begin_inset CommandInset label
15287 name "sub:Counters"
15294 \begin_layout Standard
15295 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15297 \begin_inset Flex MenuItem
15300 \begin_layout Plain Layout
15307 \begin_inset Flex MenuItem
15310 \begin_layout Plain Layout
15316 , \SpecialChar \ldots{}
15317 ) in the text class itself.
15318 The standard counters are defined in the file
15319 \begin_inset Flex Code
15322 \begin_layout Plain Layout
15328 , so you may have to do no more than add
15331 \begin_layout LyX-Code
15332 Input stdcounters.inc
15335 \begin_layout Standard
15336 to your layout file to get them to work.
15337 But if you want to define custom counters, then you can do so.
15338 The counter declaration must begin with:
15341 \begin_layout LyX-Code
15342 Counter CounterName
15345 \begin_layout Standard
15347 \begin_inset Flex Code
15350 \begin_layout Plain Layout
15356 ' is replaced by the name of the counter.
15357 And it must end with
15358 \begin_inset Quotes eld
15362 \begin_inset Flex Code
15365 \begin_layout Plain Layout
15372 \begin_inset Quotes erd
15376 The following parameters can also be used:
15379 \begin_layout Description
15380 \begin_inset Flex Code
15383 \begin_layout Plain Layout
15390 \begin_inset Flex Code
15393 \begin_layout Plain Layout
15400 \begin_inset Quotes erd
15404 \begin_inset Quotes erd
15407 ] When defined, this string defines how the counter is displayed.
15408 Setting this value sets
15409 \begin_inset Flex Code
15412 \begin_layout Plain Layout
15413 LabelStringAppendix
15419 The following special constructs can be used in the string:
15423 \begin_layout Itemize
15424 \begin_inset Flex Code
15427 \begin_layout Plain Layout
15435 will be replaced by the expansion of the
15436 \begin_inset Flex Code
15439 \begin_layout Plain Layout
15446 \begin_inset Flex Code
15449 \begin_layout Plain Layout
15450 LabelStringAppendix
15456 \begin_inset Flex Code
15459 \begin_layout Plain Layout
15469 \begin_layout Itemize
15470 counter values can be expressed using LaTeX-like macros
15471 \begin_inset Flex Code
15474 \begin_layout Plain Layout
15491 \begin_inset Flex Code
15494 \begin_layout Plain Layout
15506 \begin_layout Plain Layout
15516 Actually, the situation is a bit more complicated: any
15535 other than those described below will produce arabic numerals.
15536 It would not be surprising to see this change in the future.
15542 \begin_inset Flex Code
15545 \begin_layout Plain Layout
15551 : 1, 2, 3,\SpecialChar \ldots{}
15553 \begin_inset Flex Code
15556 \begin_layout Plain Layout
15562 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15564 \begin_inset Flex Code
15567 \begin_layout Plain Layout
15573 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15575 \begin_inset Flex Code
15578 \begin_layout Plain Layout
15584 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15586 \begin_inset Flex Code
15589 \begin_layout Plain Layout
15595 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15597 \begin_inset Flex Code
15600 \begin_layout Plain Layout
15606 for hebrew numerals.
15610 \begin_layout Standard
15611 If LabelString is not defined, a default value is constructed as follows:
15612 if the counter has a master counter
15613 \begin_inset Flex Code
15616 \begin_layout Plain Layout
15623 \begin_inset Flex Code
15626 \begin_layout Plain Layout
15633 \begin_inset Flex Code
15636 \begin_layout Plain Layout
15646 is used; otherwise the string
15647 \begin_inset Flex Code
15650 \begin_layout Plain Layout
15661 \begin_layout Description
15662 \begin_inset Flex Code
15665 \begin_layout Plain Layout
15666 LabelStringAppendix
15672 \begin_inset Flex Code
15675 \begin_layout Plain Layout
15682 \begin_inset Quotes erd
15686 \begin_inset Quotes erd
15690 \begin_inset Flex Code
15693 \begin_layout Plain Layout
15699 , but for use in the Appendix.
15702 \begin_layout Description
15703 \begin_inset Flex Code
15706 \begin_layout Plain Layout
15713 \begin_inset Flex Code
15716 \begin_layout Plain Layout
15723 \begin_inset Quotes erd
15727 \begin_inset Quotes erd
15730 ] A format for use with formatted references to this counter.
15731 For example, one might want to have references to section numbers appear
15733 \begin_inset Quotes eld
15737 \begin_inset Quotes erd
15741 The string should contain
15742 \begin_inset Quotes eld
15746 \begin_inset Quotes erd
15750 This will be replaced by the counter number itself.
15751 So, for sections, it would be: Section ##.
15754 \begin_layout Description
15755 \begin_inset Flex Code
15758 \begin_layout Plain Layout
15765 \begin_inset Flex Code
15768 \begin_layout Plain Layout
15775 \begin_inset Quotes erd
15779 \begin_inset Quotes erd
15782 ] If this is set to the name of another counter, the present counter will
15783 be reset every time the other one is increased.
15785 \begin_inset Flex Code
15788 \begin_layout Plain Layout
15795 \begin_inset Flex Code
15798 \begin_layout Plain Layout
15807 \begin_layout Subsection
15809 \begin_inset CommandInset label
15811 name "sub:Font-description"
15818 \begin_layout Standard
15819 A font description looks like this:
15822 \begin_layout LyX-Code
15832 \begin_layout LyX-Code
15836 \begin_layout LyX-Code
15840 \begin_layout Standard
15841 The following commands are available:
15844 \begin_layout Description
15845 \begin_inset Flex Code
15848 \begin_layout Plain Layout
15855 \begin_inset Flex Code
15858 \begin_layout Plain Layout
15867 \begin_inset Flex Code
15870 \begin_layout Plain Layout
15877 \begin_inset Flex Code
15880 \begin_layout Plain Layout
15887 \begin_inset Flex Code
15890 \begin_layout Plain Layout
15897 \begin_inset Flex Code
15900 \begin_layout Plain Layout
15907 \begin_inset Flex Code
15910 \begin_layout Plain Layout
15917 \begin_inset Flex Code
15920 \begin_layout Plain Layout
15927 \begin_inset Flex Code
15930 \begin_layout Plain Layout
15937 \begin_inset Flex Code
15940 \begin_layout Plain Layout
15949 \begin_layout Description
15950 \begin_inset Flex Code
15953 \begin_layout Plain Layout
15960 \begin_inset Flex Code
15963 \begin_layout Plain Layout
15972 \begin_inset Flex Code
15975 \begin_layout Plain Layout
15982 \begin_inset Flex Code
15985 \begin_layout Plain Layout
15994 \begin_layout Description
15995 \begin_inset Flex Code
15998 \begin_layout Plain Layout
16005 \begin_inset Flex Code
16008 \begin_layout Plain Layout
16014 ] Valid arguments are:
16015 \begin_inset Flex Code
16018 \begin_layout Plain Layout
16025 \begin_inset Flex Code
16028 \begin_layout Plain Layout
16035 \begin_inset Flex Code
16038 \begin_layout Plain Layout
16045 \begin_inset Flex Code
16048 \begin_layout Plain Layout
16055 \begin_inset Flex Code
16058 \begin_layout Plain Layout
16065 \begin_inset Flex Code
16068 \begin_layout Plain Layout
16075 Each of these turns on or off the corresponding attribute.
16077 \begin_inset Flex Code
16080 \begin_layout Plain Layout
16086 turns on emphasis, and
16087 \begin_inset Flex Code
16090 \begin_layout Plain Layout
16098 \begin_inset Newline newline
16101 If the latter seems puzzling, remember that the font settings for the present
16102 context are generally inherited from the surrounding context.
16104 \begin_inset Flex Code
16107 \begin_layout Plain Layout
16113 would turn off the emphasis that was anyway in effect, say, in a theorem
16117 \begin_layout Description
16118 \begin_inset Flex Code
16121 \begin_layout Plain Layout
16128 \begin_inset Flex Code
16131 \begin_layout Plain Layout
16140 \begin_inset Flex Code
16143 \begin_layout Plain Layout
16152 \begin_layout Description
16153 \begin_inset Flex Code
16156 \begin_layout Plain Layout
16163 \begin_inset Flex Code
16166 \begin_layout Plain Layout
16175 \begin_inset Flex Code
16178 \begin_layout Plain Layout
16185 \begin_inset Flex Code
16188 \begin_layout Plain Layout
16195 \begin_inset Flex Code
16198 \begin_layout Plain Layout
16207 \begin_layout Description
16208 \begin_inset Flex Code
16211 \begin_layout Plain Layout
16218 \begin_inset Flex Code
16221 \begin_layout Plain Layout
16228 \begin_inset Flex Code
16231 \begin_layout Plain Layout
16238 \begin_inset Flex Code
16241 \begin_layout Plain Layout
16250 \begin_inset Flex Code
16253 \begin_layout Plain Layout
16260 \begin_inset Flex Code
16263 \begin_layout Plain Layout
16270 \begin_inset Flex Code
16273 \begin_layout Plain Layout
16280 \begin_inset Flex Code
16283 \begin_layout Plain Layout
16290 \begin_inset Flex Code
16293 \begin_layout Plain Layout
16302 \begin_layout Subsection
16303 \begin_inset CommandInset label
16305 name "sub:Citation-format-description"
16309 Citation format description
16312 \begin_layout Standard
16314 \begin_inset Flex Code
16317 \begin_layout Plain Layout
16323 blocks are used to describe how bibliographic information should be displayed,
16324 both within LyX itself (in the citation dialog and in tooltips, for example)
16325 and in XHTML output.
16326 Such a block might look like this:
16329 \begin_layout LyX-Code
16333 \begin_layout LyX-Code
16337 \begin_layout LyX-Code
16341 \begin_layout LyX-Code
16345 \begin_layout Standard
16346 The individual lines define how the bibliographic information associated
16347 with an article or book, respectively, is to be displayed, and such a definitio
16348 n can be given for any `entry type' that might be present in a BibTeX file.
16349 LyX defines a default format in the source code that will be used if no
16350 specific definition has been given.
16351 LyX predefines several formats in the file
16352 \begin_inset Flex Code
16355 \begin_layout Plain Layout
16361 , which is included in most of LyX's document classes.
16364 \begin_layout Standard
16365 The definitions use a simple language that allows BibTeX keys to be replaced
16367 Keys should be enclosed in
16368 \begin_inset Flex Code
16371 \begin_layout Plain Layout
16378 \begin_inset Flex Code
16381 \begin_layout Plain Layout
16388 So a simple definition might look like this:
16391 \begin_layout LyX-Code
16393 \begin_inset Quotes eld
16397 \begin_inset Quotes erd
16403 \begin_layout Standard
16404 This would print the author, followed by a comma, followed by the title,
16405 in quotes, followed by a period.
16408 \begin_layout Standard
16409 Of course, sometimes you may want to print a key only if it exists.
16410 This can be done by using a conditional construction, such as:
16411 \begin_inset Flex Code
16414 \begin_layout Plain Layout
16416 \begin_inset space ~
16426 \begin_inset Flex Code
16429 \begin_layout Plain Layout
16435 key exists, then print
16436 \begin_inset Quotes eld
16440 \begin_inset space ~
16444 \begin_inset Quotes erd
16447 followed by the volume key.
16448 It is also possible to have an else clause in the conditional, such as:
16450 \begin_inset Flex Code
16453 \begin_layout Plain Layout
16454 {%author%[[%author%]][[%editor%, ed.]]}
16461 \begin_inset Flex Code
16464 \begin_layout Plain Layout
16470 key is printed if it exists; otherwise, the editor key is printed, followed
16472 \begin_inset Quotes eld
16476 \begin_inset space ~
16480 \begin_inset Quotes erd
16483 Note that the key is again enclosed in
16484 \begin_inset Flex Code
16487 \begin_layout Plain Layout
16493 signs; the entire conditional is enclosed in braces; and the if and else
16494 clauses are enclosed in double brackets,
16495 \begin_inset Quotes eld
16499 \begin_inset Flex Code
16502 \begin_layout Plain Layout
16509 \begin_inset Quotes eld
16513 \begin_inset Quotes eld
16517 \begin_inset Flex Code
16520 \begin_layout Plain Layout
16527 \begin_inset Quotes erd
16531 There must be no space between any of these.
16534 \begin_layout Standard
16535 There is one other piece of syntax available in definitions, which looks
16537 \begin_inset Flex Code
16540 \begin_layout Plain Layout
16547 This defines a piece of formatting information that is to be used when
16549 \begin_inset Quotes eld
16553 \begin_inset Quotes erd
16557 Obviously, we do not want to output HTML tags when writing plain text,
16558 so they should be wrapped in
16559 \begin_inset Quotes eld
16563 \begin_inset Quotes erd
16567 \begin_inset Quotes eld
16571 \begin_inset Quotes erd
16577 \begin_layout Standard
16578 Two special sorts of definitions are also possible in a
16579 \begin_inset Flex Code
16582 \begin_layout Plain Layout
16589 An example of the first would be:
16592 \begin_layout LyX-Code
16594 \begin_inset Quotes eld
16598 \begin_inset Quotes erd
16604 \begin_layout Standard
16605 This is an abbreviation, or macro, and it can be used by treating it as
16607 \begin_inset Flex Code
16610 \begin_layout Plain Layout
16618 \begin_inset Flex Code
16621 \begin_layout Plain Layout
16627 exactly as it would treat its definition.
16628 So, let us issue the obvious
16636 \begin_layout LyX-Code
16640 \begin_layout Standard
16641 or anything like it.
16642 LyX shouldn't go into an infinite loop, but it may go into a long one before
16646 \begin_layout Standard
16647 The second sort of special definition might look like this:
16650 \begin_layout LyX-Code
16654 \begin_layout Standard
16655 This defines a translatable piece of text, which allows relevant parts of
16656 the bibliography to be translated.
16657 It can be included in a definition by treating it as a key:
16658 \begin_inset Flex Code
16661 \begin_layout Plain Layout
16668 Several of these are predefined in
16669 \begin_inset Flex Code
16672 \begin_layout Plain Layout
16679 Note that these are not macros, in the sense just defined.
16680 They will not be expanded.
16683 \begin_layout Standard
16684 So here then is an example that use all these features:
16687 \begin_layout LyX-Code
16688 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16691 \begin_layout Standard
16692 This defines a macro that prints the author, followed by a comma, if the
16694 \begin_inset Flex Code
16697 \begin_layout Plain Layout
16703 key is defined, or else prints the name of the editor, followed by the
16705 \begin_inset Flex Code
16708 \begin_layout Plain Layout
16714 or its translation (it is by default
16715 \begin_inset Quotes eld
16719 \begin_inset Quotes erd
16723 \begin_inset Flex Code
16726 \begin_layout Plain Layout
16733 Note that this is in fact defined in
16734 \begin_inset Flex Code
16737 \begin_layout Plain Layout
16743 , so you can use it in your own definitions, or re-definitions, if you load
16747 \begin_layout Section
16748 \begin_inset CommandInset label
16750 name "sec:Tags-for-XHTML"
16754 Tags for XHTML output
16757 \begin_layout Standard
16758 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16759 by layout information.
16760 In general, LyX provides sensible defaults and, as mentioned earlier, it
16761 will even construct default CSS style rules from the other layout tags.
16762 For example, LyX will attempt to use the information provided in the
16763 \begin_inset Flex Code
16766 \begin_layout Plain Layout
16772 declaration for the Chapter style to write CSS that will appropriately
16773 format chapter headings.
16776 \begin_layout Standard
16777 In many cases, then, you may not have to do anything at all to get acceptable
16778 XHTML output for your own environments, custom insets, and so forth.
16779 But in some cases you will, and so LyX provides a number of layout tags
16780 that can be used to customize the XHTML and CSS that are generated.
16783 \begin_layout Standard
16784 Note that there are two tags,
16785 \begin_inset Flex Code
16788 \begin_layout Plain Layout
16795 \begin_inset Flex Code
16798 \begin_layout Plain Layout
16804 that may appear outside style and inset declarations.
16806 \begin_inset CommandInset ref
16808 reference "sub:General-text-class"
16812 for details on these.
16815 \begin_layout Subsection
16816 \begin_inset CommandInset label
16818 name "sub:Paragraph-Style-XHTML"
16825 \begin_layout Standard
16826 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16827 dealing with a normal paragraph, a command, or an environment, where this
16828 is itself determined by the contents of the corresponding
16829 \begin_inset Flex Code
16832 \begin_layout Plain Layout
16842 \begin_layout Standard
16843 For a command or normal paragraph, the output XHTML has the following form:
16846 \begin_layout LyX-Code
16848 \begin_inset Quotes erd
16852 \begin_inset Quotes erd
16858 \begin_layout LyX-Code
16860 \begin_inset Quotes erd
16864 \begin_inset Quotes erd
16870 \begin_layout LyX-Code
16871 Contents of the paragraph.
16874 \begin_layout LyX-Code
16878 \begin_layout Standard
16879 The label tags are of course omitted if the paragraph does not have a label.
16882 \begin_layout Standard
16883 For an environment that is not some sort of list, the XHTML takes this form:
16886 \begin_layout LyX-Code
16888 \begin_inset Quotes erd
16892 \begin_inset Quotes erd
16898 \begin_layout LyX-Code
16900 \begin_inset Quotes erd
16904 \begin_inset Quotes erd
16908 \begin_inset Quotes erd
16912 \begin_inset Quotes erd
16915 >Environment Label</labeltag>First paragraph.</itemtag>
16918 \begin_layout LyX-Code
16919 <itemtag>Second paragraph.</itemtag>
16922 \begin_layout LyX-Code
16926 \begin_layout Standard
16927 Note that the label is output only for the first paragraph, as it should
16928 be for a theorem, for example.
16932 \begin_layout Standard
16933 For a list, we have one of these forms:
16936 \begin_layout LyX-Code
16938 \begin_inset Quotes erd
16942 \begin_inset Quotes erd
16948 \begin_layout LyX-Code
16950 \begin_inset Quotes erd
16954 \begin_inset Quotes erd
16958 \begin_inset Quotes erd
16962 \begin_inset Quotes erd
16965 >List Label</labeltag>First item.</itemtag>
16968 \begin_layout LyX-Code
16970 \begin_inset Quotes erd
16974 \begin_inset Quotes erd
16978 \begin_inset Quotes erd
16982 \begin_inset Quotes erd
16985 >List Label</labeltag>Second item.</itemtag>
16988 \begin_layout LyX-Code
16992 \begin_layout LyX-Code
16996 \begin_layout LyX-Code
16998 \begin_inset Quotes erd
17002 \begin_inset Quotes erd
17008 \begin_layout LyX-Code
17010 \begin_inset Quotes erd
17014 \begin_inset Quotes erd
17017 >List Label</labeltag><itemtag attr=
17018 \begin_inset Quotes erd
17022 \begin_inset Quotes erd
17025 >First item.</itemtag>
17028 \begin_layout LyX-Code
17030 \begin_inset Quotes erd
17034 \begin_inset Quotes erd
17037 >List Label</labeltag><itemtag attr=
17038 \begin_inset Quotes erd
17042 \begin_inset Quotes erd
17045 >Second item.</itemtag>
17048 \begin_layout LyX-Code
17052 \begin_layout Standard
17053 Note the different orders of
17054 \begin_inset Flex Code
17057 \begin_layout Plain Layout
17064 \begin_inset Flex Code
17067 \begin_layout Plain Layout
17074 Which order we get depends upon the setting of
17075 \begin_inset Flex Code
17078 \begin_layout Plain Layout
17085 \begin_inset Flex Code
17088 \begin_layout Plain Layout
17094 is false (the default), you get the first of these, with the label within
17095 the item; if true, you get the second, with the label outside the item.
17098 \begin_layout Standard
17099 The specific tags and attributes output for each paragraph type can be controlle
17100 d by means of the layout tags we are about to describe.
17101 As mentioned earlier, however, LyX uses sensible defaults for many of these,
17102 so you often may not need to do very much to get good XHTML output.
17103 Think of the available tags as there so you can tweak things to your liking.
17106 \begin_layout Description
17107 \begin_inset Flex Code
17110 \begin_layout Plain Layout
17117 \begin_inset Flex Code
17120 \begin_layout Plain Layout
17126 ] Specifies attribute information to be output with the main tag.
17128 \begin_inset Quotes eld
17132 \begin_inset Flex Code
17135 \begin_layout Plain Layout
17142 \begin_inset Quotes erd
17146 By default, LyX will output
17147 \begin_inset Quotes eld
17151 \begin_inset Flex Code
17154 \begin_layout Plain Layout
17161 \begin_inset Quotes erd
17165 \begin_inset Flex Code
17168 \begin_layout Plain Layout
17174 is the LyX name of the layout, made lowercase, for example: chapter.
17179 contain any style information.
17181 \begin_inset Flex Code
17184 \begin_layout Plain Layout
17193 \begin_layout Description
17194 \begin_inset Flex Code
17197 \begin_layout Plain Layout
17204 \begin_inset Flex Code
17207 \begin_layout Plain Layout
17217 ] Whether to output the default CSS information LyX generates for this layout,
17218 even if additional information is explicitly provided via
17219 \begin_inset Flex Code
17222 \begin_layout Plain Layout
17230 \begin_inset Flex Code
17233 \begin_layout Plain Layout
17239 allows you to alter or augment the generated CSS, rather than to override
17242 \begin_inset Flex Code
17245 \begin_layout Plain Layout
17254 \begin_layout Description
17255 \begin_inset Flex Code
17258 \begin_layout Plain Layout
17265 \begin_inset Flex Code
17268 \begin_layout Plain Layout
17274 ] The tag to be used for individual paragraphs of environments, replacing
17276 \begin_inset Flex Code
17279 \begin_layout Plain Layout
17285 in the examples above.
17287 \begin_inset Flex Code
17290 \begin_layout Plain Layout
17299 \begin_layout Description
17300 \begin_inset Flex Code
17303 \begin_layout Plain Layout
17310 \begin_inset Flex Code
17313 \begin_layout Plain Layout
17319 ] Attributes for the item tag.
17321 \begin_inset Quotes eld
17325 \begin_inset Flex Code
17328 \begin_layout Plain Layout
17329 class=`layoutname_item'
17335 \begin_inset Quotes erd
17343 contain any style information.
17345 \begin_inset Flex Code
17348 \begin_layout Plain Layout
17357 \begin_layout Description
17358 \begin_inset Flex Code
17361 \begin_layout Plain Layout
17368 \begin_inset Flex Code
17371 \begin_layout Plain Layout
17377 ] The tag to be used for paragraph and item labels, replacing
17378 \begin_inset Flex Code
17381 \begin_layout Plain Layout
17387 in the examples above.
17389 \begin_inset Flex Code
17392 \begin_layout Plain Layout
17399 \begin_inset Flex Code
17402 \begin_layout Plain Layout
17409 \begin_inset Flex Code
17412 \begin_layout Plain Layout
17419 \begin_inset Flex Code
17422 \begin_layout Plain Layout
17423 Centered_Top_Environment
17428 , in which case it defaults to
17429 \begin_inset Flex Code
17432 \begin_layout Plain Layout
17441 \begin_layout Description
17442 \begin_inset Flex Code
17445 \begin_layout Plain Layout
17452 \begin_inset Flex Code
17455 \begin_layout Plain Layout
17461 ] Attributes for the label tag.
17463 \begin_inset Quotes eld
17467 \begin_inset Flex Code
17470 \begin_layout Plain Layout
17471 class=`layoutname_label'
17477 \begin_inset Quotes erd
17485 contain any style information.
17487 \begin_inset Flex Code
17490 \begin_layout Plain Layout
17499 \begin_layout Description
17500 \begin_inset Flex Code
17503 \begin_layout Plain Layout
17510 \begin_inset Flex Code
17513 \begin_layout Plain Layout
17523 ] Meaningful only for list-like environments, this tag controls whether
17524 the label tag is output before or inside the item tag.
17525 This is used, for example, in the description environment, where we want
17527 \begin_inset Flex Code
17530 \begin_layout Plain Layout
17531 <dt>\SpecialChar \ldots{}
17532 </dt><dd>\SpecialChar \ldots{}
17540 \begin_inset Flex Code
17543 \begin_layout Plain Layout
17549 : The label tag is output inside the item tag.
17552 \begin_layout Description
17553 \begin_inset Flex Code
17556 \begin_layout Plain Layout
17562 Information to be output in the
17563 \begin_inset Flex Code
17566 \begin_layout Plain Layout
17572 section when this style is used.
17573 This might, for example, be used to include a
17574 \begin_inset Flex Code
17577 \begin_layout Plain Layout
17584 \begin_inset Flex Code
17587 \begin_layout Plain Layout
17596 \begin_layout Description
17597 \begin_inset Flex Code
17600 \begin_layout Plain Layout
17606 CSS style information to be included when this style is used.
17607 Note that this will automatically be wrapped in a layout-generated
17608 \begin_inset Flex Code
17611 \begin_layout Plain Layout
17617 block, so only the CSS itself need be included.
17620 \begin_layout Description
17621 \begin_inset Flex Code
17624 \begin_layout Plain Layout
17631 \begin_inset Flex Code
17634 \begin_layout Plain Layout
17640 ] The tag to be used for the main label, replacing
17641 \begin_inset Flex Code
17644 \begin_layout Plain Layout
17650 in the examples above.
17652 \begin_inset Flex Code
17655 \begin_layout Plain Layout
17664 \begin_layout Description
17665 \begin_inset Flex Code
17668 \begin_layout Plain Layout
17675 \begin_inset Flex Code
17678 \begin_layout Plain Layout
17688 ] Marks this style as the one to be used to generate the
17689 \begin_inset Flex Code
17692 \begin_layout Plain Layout
17698 tag for the XHTML file.
17699 By default, it is false.
17701 \begin_inset Flex Code
17704 \begin_layout Plain Layout
17710 file sets it to true for the
17711 \begin_inset Flex Code
17714 \begin_layout Plain Layout
17724 \begin_layout Subsection
17728 \begin_layout Standard
17729 The XHTML output of insets can also be controlled by information in layout
17734 \begin_layout Plain Layout
17735 At present, this is true only for
17736 \begin_inset Quotes eld
17740 \begin_inset Quotes erd
17743 insets (insets you can type into) and is not true for
17744 \begin_inset Quotes eld
17748 \begin_inset Quotes erd
17751 insets (insets that are associated with dialog boxes).
17756 Here, too, LyX tries to provide sensible defaults, and it constructs default
17758 But everything can be customized.
17761 \begin_layout Standard
17762 The XHTML LyX outputs for an inset has the following form:
17765 \begin_layout LyX-Code
17767 \begin_inset Quotes erd
17771 \begin_inset Quotes erd
17777 \begin_layout LyX-Code
17778 <labeltag>Label</labeltag>
17781 \begin_layout LyX-Code
17783 \begin_inset Quotes erd
17787 \begin_inset Quotes erd
17790 >Contents of the inset.</innertag>
17793 \begin_layout LyX-Code
17797 \begin_layout Standard
17798 If the inset permits multiple paragraphs---that is, if
17799 \begin_inset Flex Code
17802 \begin_layout Plain Layout
17808 is true---then the contents of the inset will itself be output as paragraphs
17809 formatted according to the styles used for those paragraphs (standard,
17810 quote, and the like).
17811 The label tag is of course omitted if the paragraph does not have a label
17812 and, at present, is always
17813 \begin_inset Flex Code
17816 \begin_layout Plain Layout
17823 The inner tag is optional and, by default, does not appear.
17826 \begin_layout Standard
17827 The specific tags and attributes output for each inset can be controlled
17828 by means of the following layout tags.
17831 \begin_layout Description
17832 \begin_inset Flex Code
17835 \begin_layout Plain Layout
17842 \begin_inset Flex Code
17845 \begin_layout Plain Layout
17851 ] Specifies attribute information to be output with the main tag.
17853 \begin_inset Quotes eld
17857 \begin_inset Flex Code
17860 \begin_layout Plain Layout
17861 class=`myinset' onclick=`\SpecialChar \ldots{}
17868 \begin_inset Quotes erd
17872 By default, LyX will output
17873 \begin_inset Quotes eld
17877 \begin_inset Flex Code
17880 \begin_layout Plain Layout
17887 \begin_inset Quotes erd
17891 \begin_inset Flex Code
17894 \begin_layout Plain Layout
17900 is the LyX name of the inset, made lowercase and with non-alphanumeric
17901 characters converted to underscores, for example: footnote.
17904 \begin_layout Description
17905 \begin_inset Flex Code
17908 \begin_layout Plain Layout
17915 \begin_inset Flex Code
17918 \begin_layout Plain Layout
17928 ] Whether to output the default CSS information LyX generates for this layout,
17929 even if additional information is explicitly provided via
17930 \begin_inset Flex Code
17933 \begin_layout Plain Layout
17941 \begin_inset Flex Code
17944 \begin_layout Plain Layout
17950 allows you to alter or augment the generated CSS, rather than to override
17955 \begin_layout Description
17956 \begin_inset Flex Code
17959 \begin_layout Plain Layout
17966 \begin_inset Flex Code
17969 \begin_layout Plain Layout
17975 ] Attributes for the inner tag.
17977 \begin_inset Quotes eld
17981 \begin_inset Flex Code
17984 \begin_layout Plain Layout
17985 class=`insetname_inner'
17991 \begin_inset Quotes erd
17997 \begin_layout Description
17998 \begin_inset Flex Code
18001 \begin_layout Plain Layout
18008 \begin_inset Flex Code
18011 \begin_layout Plain Layout
18017 ] The inner tag, replacing
18018 \begin_inset Flex Code
18021 \begin_layout Plain Layout
18027 in the examples above.
18028 By default, there is none.
18031 \begin_layout Description
18032 \begin_inset Flex Code
18035 \begin_layout Plain Layout
18042 \begin_inset Flex Code
18045 \begin_layout Plain Layout
18053 ] Whether this inset represents a standalone block of text (such as a footnote)
18054 or instead represents material that is included in the surrounding text
18055 (such as a branch).
18059 \begin_layout Description
18060 \begin_inset Flex Code
18063 \begin_layout Plain Layout
18070 \begin_inset Flex Code
18073 \begin_layout Plain Layout
18079 ] A label for this inset, possibly including a reference to a counter.
18080 For example, for footnote, it might be:
18081 \begin_inset Flex Code
18084 \begin_layout Plain Layout
18093 This is optional, and there is no default.
18096 \begin_layout Description
18097 \begin_inset Flex Code
18100 \begin_layout Plain Layout
18106 Information to be output in the
18107 \begin_inset Flex Code
18110 \begin_layout Plain Layout
18116 section when this style is used.
18117 This might, for example, be used to include a
18118 \begin_inset Flex Code
18121 \begin_layout Plain Layout
18128 \begin_inset Flex Code
18131 \begin_layout Plain Layout
18140 \begin_layout Description
18141 \begin_inset Flex Code
18144 \begin_layout Plain Layout
18150 CSS style information to be included when this style is used.
18151 Note that this will automatically be wrapped in a layout-generated
18152 \begin_inset Flex Code
18155 \begin_layout Plain Layout
18161 block, so only the CSS itself need be included.
18164 \begin_layout Description
18165 \begin_inset Flex Code
18168 \begin_layout Plain Layout
18175 \begin_inset Flex Code
18178 \begin_layout Plain Layout
18184 ] The tag to be used for the main label, replacing
18185 \begin_inset Flex Code
18188 \begin_layout Plain Layout
18194 in the examples above.
18195 The default depends upon the setting of
18196 \begin_inset Flex Code
18199 \begin_layout Plain Layout
18206 \begin_inset Flex Code
18209 \begin_layout Plain Layout
18215 is true, the default is
18216 \begin_inset Flex Code
18219 \begin_layout Plain Layout
18225 ; if it is false, the default is
18226 \begin_inset Flex Code
18229 \begin_layout Plain Layout
18238 \begin_layout Subsection
18242 \begin_layout Standard
18243 The XHTML output for floats too can be controlled by layout information.
18244 The output has the following form:
18247 \begin_layout LyX-Code
18249 \begin_inset Quotes erd
18253 \begin_inset Quotes erd
18259 \begin_layout LyX-Code
18260 Contents of the float.
18263 \begin_layout LyX-Code
18267 \begin_layout Standard
18268 The caption, if there is one, is a separate inset and will be output as
18270 Its appearance can be controlled via the InsetLayout for caption insets.
18274 \begin_layout Description
18275 \begin_inset Flex Code
18278 \begin_layout Plain Layout
18285 \begin_inset Flex Code
18288 \begin_layout Plain Layout
18294 ] Specifies attribute information to be output with the main tag.
18296 \begin_inset Quotes eld
18300 \begin_inset Flex Code
18303 \begin_layout Plain Layout
18304 class=`myfloat' onclick=`\SpecialChar \ldots{}
18311 \begin_inset Quotes erd
18315 By default, LyX will output
18316 \begin_inset Quotes eld
18320 \begin_inset Flex Code
18323 \begin_layout Plain Layout
18324 class=`float float-floattype'
18330 \begin_inset Quotes erd
18334 \begin_inset Flex Code
18337 \begin_layout Plain Layout
18343 is LyX's name for this type of float, as determined by the float declaration
18345 \begin_inset CommandInset ref
18347 reference "sub:Floats"
18351 ), though made lowercase and with non-alphanumeric characters converted
18352 to underscores, for example: float-table.
18355 \begin_layout Description
18356 \begin_inset Flex Code
18359 \begin_layout Plain Layout
18365 CSS style information to be included when this float is used.
18366 Note that this will automatically be wrapped in a layout-generated
18367 \begin_inset Flex Code
18370 \begin_layout Plain Layout
18376 block, so only the CSS itself need be included.
18379 \begin_layout Description
18380 \begin_inset Flex Code
18383 \begin_layout Plain Layout
18390 \begin_inset Flex Code
18393 \begin_layout Plain Layout
18399 ] The tag to be used for this float, replacing
18400 \begin_inset Quotes eld
18404 \begin_inset Flex Code
18407 \begin_layout Plain Layout
18414 \begin_inset Quotes erd
18417 in the example above.
18419 \begin_inset Flex Code
18422 \begin_layout Plain Layout
18428 and will rarely need changing.
18431 \begin_layout Subsection
18432 Bibliography formatting
18435 \begin_layout Standard
18436 The bibliography can be formatted using
18437 \begin_inset Flex Code
18440 \begin_layout Plain Layout
18448 \begin_inset CommandInset ref
18450 reference "sub:Citation-format-description"
18457 \begin_layout Subsection
18461 \begin_layout Standard
18462 We have several times mentioned that LyX will generate default CSS style
18463 rules for both insets and paragraph styles, based upon the other layout
18464 information that is provided.
18465 In this section, we shall say a word about which layout information LyX
18469 \begin_layout Standard
18470 At present, LyX auto-generates CSS only for font information, making use
18472 \begin_inset Flex Code
18475 \begin_layout Plain Layout
18482 \begin_inset Flex Code
18485 \begin_layout Plain Layout
18492 \begin_inset Flex Code
18495 \begin_layout Plain Layout
18502 \begin_inset Flex Code
18505 \begin_layout Plain Layout
18512 \begin_inset Flex Code
18515 \begin_layout Plain Layout
18523 \begin_inset CommandInset ref
18525 reference "sub:Font-description"
18529 .) The translation is mostly straightforward and obvious.
18531 \begin_inset Quotes eld
18535 \begin_inset Flex Code
18538 \begin_layout Plain Layout
18545 \begin_inset Quotes erd
18549 \begin_inset Quotes eld
18553 \begin_inset Flex Code
18556 \begin_layout Plain Layout
18557 font-family: sans-serif;
18563 \begin_inset Quotes erd
18567 The correspondence of LyX sizes and CSS sizes is a little less obvious
18568 but nonetheless intuitive.
18570 \begin_inset Flex Code
18573 \begin_layout Plain Layout
18580 \begin_inset Flex URL
18583 \begin_layout Plain Layout
18594 \begin_layout Chapter
18595 Including External Material
18598 \begin_layout Standard
18599 \begin_inset Box Shadowbox
18609 height_special "totalheight"
18612 \begin_layout Plain Layout
18613 WARNING: This portion of the documentation has not been updated for some
18615 We certainly hope that it is still accurate, but there are no guarantees.
18623 \begin_layout Standard
18624 The use of material from sources external to LyX is covered in detail in
18630 This part of the manual covers what needs to happen behind the scenes for
18631 new sorts of material to be included.
18634 \begin_layout Section
18638 \begin_layout Standard
18639 The external material feature is based on the concept of a
18644 A template is a specification of how LyX should interface with a certain
18646 As bundled, LyX comes with predefined templates for Xfig figures, various
18647 raster format images, chess diagrams, and LilyPond music notation.
18648 You can check the actual list by using the menu
18649 \begin_inset Flex MenuItem
18652 \begin_layout Plain Layout
18653 Insert\SpecialChar \menuseparator
18654 File\SpecialChar \menuseparator
18661 Furthermore, it is possible to roll your own template to support a specific
18663 Later we'll describe in more detail what is involved, and hopefully you
18664 will submit all the templates you create so we can include them in a later
18668 \begin_layout Standard
18669 Another basic idea of the external material feature is to distinguish between
18670 the original file that serves as a base for final material and the produced
18671 file that is included in your exported or printed document.
18672 For example, consider the case of a figure produced with
18673 \begin_inset Flex Code
18676 \begin_layout Plain Layout
18683 The Xfig application itself works on an original file with the
18684 \begin_inset Flex Code
18687 \begin_layout Plain Layout
18694 Within Xfig, you create and change your figure, and when you are done,
18696 \begin_inset Flex Code
18699 \begin_layout Plain Layout
18706 When you want to include the figure in your document, you invoke
18707 \begin_inset Flex Code
18710 \begin_layout Plain Layout
18716 in order to create a PostScript file that can readily be included in your
18719 \begin_inset Flex Code
18722 \begin_layout Plain Layout
18728 file is the original file, and the PostScript file is the produced file.
18731 \begin_layout Standard
18732 This distinction is important in order to allow updating of the material
18733 while you are in the process of writing the document.
18734 Furthermore, it provides us with the flexibility that is needed to support
18735 multiple export formats.
18736 For instance, in the case of a plain text file, it is not exactly an award-winn
18737 ing idea to include the figure as raw PostScript.
18738 Instead, you'd either prefer to just include a reference to the figure
18739 or try to invoke some graphics to ASCII converter to make the final result
18740 look similar to the real graphics.
18741 The external material management allows you to do this, because it is parametri
18742 zed on the different export formats that LyX supports.
18745 \begin_layout Standard
18746 Besides supporting the production of different products according to the
18747 exported format, it supports tight integration with editing and viewing
18749 In the case of an Xfig figure, you are able to invoke Xfig on the original
18750 file with a single click from within the external material dialog in LyX,
18751 and also preview the produced PostScript file with Ghostview with another
18753 No more fiddling around with the command line and/or file browsers to locate
18754 and manipulate the original or produced files.
18755 In this way, you are finally able to take full advantage of the many different
18756 applications that are relevant to use when you write your documents, and
18757 ultimately be more productive.
18760 \begin_layout Section
18761 The external template configuration file
18764 \begin_layout Standard
18765 It is relatively easy to add custom external template definitions to LyX.
18766 However, be aware that doing this in an careless manner most probably
18770 introduce an easily exploitable security hole.
18771 So before you do this, please read the discussion about security in section
18773 \begin_inset CommandInset ref
18775 reference "sec:Security-discussion"
18782 \begin_layout Standard
18783 Having said that, we encourage you to submit any interesting templates that
18788 \begin_layout Standard
18789 The external templates are defined in the
18790 \begin_inset Flex Code
18793 \begin_layout Plain Layout
18794 LyXDir/lib/external_templates
18800 You can place your own version in
18801 \begin_inset Flex Code
18804 \begin_layout Plain Layout
18805 UserDir/external_templates
18813 \begin_layout Standard
18814 A typical template looks like this:
18817 \begin_layout LyX-Code
18821 \begin_layout LyX-Code
18822 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18825 \begin_layout LyX-Code
18829 \begin_layout LyX-Code
18833 \begin_layout LyX-Code
18837 \begin_layout LyX-Code
18841 \begin_layout LyX-Code
18845 \begin_layout LyX-Code
18846 AutomaticProduction true
18849 \begin_layout LyX-Code
18853 \begin_layout LyX-Code
18857 \begin_layout LyX-Code
18861 \begin_layout LyX-Code
18862 TransformCommand Rotate RotationLatexCommand
18865 \begin_layout LyX-Code
18866 TransformCommand Resize ResizeLatexCommand
18869 \begin_layout LyX-Code
18870 Product "$$RotateFront$$ResizeFront
18873 \begin_layout LyX-Code
18878 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18881 \begin_layout LyX-Code
18882 $$ResizeBack$$RotateBack"
18885 \begin_layout LyX-Code
18889 \begin_layout LyX-Code
18890 UpdateResult "$$AbsPath$$Basename.pstex_t"
18893 \begin_layout LyX-Code
18894 Requirement "graphicx"
18897 \begin_layout LyX-Code
18898 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18901 \begin_layout LyX-Code
18902 ReferencedFile latex "$$AbsPath$$Basename.eps"
18905 \begin_layout LyX-Code
18906 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18909 \begin_layout LyX-Code
18913 \begin_layout LyX-Code
18917 \begin_layout LyX-Code
18918 TransformCommand Rotate RotationLatexCommand
18921 \begin_layout LyX-Code
18922 TransformCommand Resize ResizeLatexCommand
18925 \begin_layout LyX-Code
18926 Product "$$RotateFront$$ResizeFront
18929 \begin_layout LyX-Code
18934 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18937 \begin_layout LyX-Code
18938 $$ResizeBack$$RotateBack"
18941 \begin_layout LyX-Code
18942 UpdateFormat pdftex
18945 \begin_layout LyX-Code
18946 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18949 \begin_layout LyX-Code
18950 Requirement "graphicx"
18953 \begin_layout LyX-Code
18954 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18957 \begin_layout LyX-Code
18958 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18961 \begin_layout LyX-Code
18965 \begin_layout LyX-Code
18969 \begin_layout LyX-Code
18970 Product "$$Contents(
18972 "$$AbsPath$$Basename.asc
18977 \begin_layout LyX-Code
18978 UpdateFormat asciixfig
18981 \begin_layout LyX-Code
18982 UpdateResult "$$AbsPath$$Basename.asc"
18985 \begin_layout LyX-Code
18989 \begin_layout LyX-Code
18993 \begin_layout LyX-Code
18994 Product "<graphic fileref=
18996 "$$AbsOrRelPathMaster$$Basename.eps
19001 \begin_layout LyX-Code
19005 \begin_layout LyX-Code
19009 \begin_layout LyX-Code
19010 UpdateResult "$$AbsPath$$Basename.eps"
19013 \begin_layout LyX-Code
19014 ReferencedFile docbook "$$AbsPath$$Basename.eps"
19017 \begin_layout LyX-Code
19018 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
19021 \begin_layout LyX-Code
19025 \begin_layout LyX-Code
19026 Product "[XFig: $$FName]"
19029 \begin_layout LyX-Code
19033 \begin_layout LyX-Code
19037 \begin_layout Standard
19038 As you can see, the template is enclosed in
19039 \begin_inset Flex Code
19042 \begin_layout Plain Layout
19048 \SpecialChar \ldots{}
19050 \begin_inset Flex Code
19053 \begin_layout Plain Layout
19060 It contains a header specifying some general settings and, for each supported
19061 primary document file format, a section
19062 \begin_inset Flex Code
19065 \begin_layout Plain Layout
19071 \SpecialChar \ldots{}
19073 \begin_inset Flex Code
19076 \begin_layout Plain Layout
19085 \begin_layout Subsection
19086 The template header
19089 \begin_layout Description
19090 \begin_inset Flex Code
19093 \begin_layout Plain Layout
19094 AutomaticProduction
19095 \begin_inset space ~
19103 Whether the file represented by the template must be generated by LyX.
19104 This command must occur exactly once.
19107 \begin_layout Description
19108 \begin_inset Flex Code
19111 \begin_layout Plain Layout
19113 \begin_inset space ~
19121 A glob pattern that is used in the file dialog to filter out the desired
19123 If there is more than one possible file extension (e.
19124 \begin_inset space \thinspace{}
19128 \begin_inset space \space{}
19132 \begin_inset Flex Code
19135 \begin_layout Plain Layout
19142 \begin_inset Flex Code
19145 \begin_layout Plain Layout
19151 ), use something like
19152 \begin_inset Flex Code
19155 \begin_layout Plain Layout
19162 This command must occur exactly once.
19165 \begin_layout Description
19166 \begin_inset Flex Code
19169 \begin_layout Plain Layout
19171 \begin_inset space ~
19179 The text that is displayed on the button.
19180 This command must occur exactly once.
19183 \begin_layout Description
19184 \begin_inset Flex Code
19187 \begin_layout Plain Layout
19189 \begin_inset space ~
19193 \begin_inset space ~
19201 The help text that is used in the External dialog.
19202 Provide enough information to explain to the user just what the template
19203 can provide him with.
19204 This command must occur exactly once.
19207 \begin_layout Description
19208 \begin_inset Flex Code
19211 \begin_layout Plain Layout
19213 \begin_inset space ~
19221 The file format of the original file.
19222 This must be the name of a format that is known to LyX (see section
19223 \begin_inset space ~
19227 \begin_inset CommandInset ref
19229 reference "sec:Formats"
19235 \begin_inset Quotes eld
19239 \begin_inset Flex Code
19242 \begin_layout Plain Layout
19249 \begin_inset Quotes erd
19252 if the template can handle original files of more than one format.
19253 LyX will attempt to interrogate the file itself in order to deduce its
19254 format in this case.
19255 This command must occur exactly once.
19258 \begin_layout Description
19259 \begin_inset Flex Code
19262 \begin_layout Plain Layout
19264 \begin_inset space ~
19272 A unique name for the template.
19273 It must not contain substitution macros (see below).
19276 \begin_layout Description
19277 \begin_inset Flex Code
19280 \begin_layout Plain Layout
19282 \begin_inset space ~
19285 Rotate|Resize|Clip|Extra
19290 This command specifies which transformations are supported by this template.
19291 It may occur zero or more times.
19292 This command enables the corresponding tabs in the external dialog.
19294 \begin_inset Flex Code
19297 \begin_layout Plain Layout
19303 command must have either a corresponding
19304 \begin_inset Flex Code
19307 \begin_layout Plain Layout
19314 \begin_inset Flex Code
19317 \begin_layout Plain Layout
19324 \begin_inset Flex Code
19327 \begin_layout Plain Layout
19334 Otherwise the transformation will not be supported by that format.
19337 \begin_layout Subsection
19341 \begin_layout Description
19342 \begin_inset Flex Code
19345 \begin_layout Plain Layout
19347 \begin_inset space ~
19350 LaTeX|PDFLaTeX|PlainText|DocBook
19355 The primary document file format that this format definition is for.
19356 Not every template has a sensible representation in all document file formats.
19357 Please define nevertheless a
19358 \begin_inset Flex Code
19361 \begin_layout Plain Layout
19367 section for all templates.
19368 Use a dummy text when no representation is available.
19369 Then you can at least see a reference to the external material in the exported
19373 \begin_layout Description
19374 \begin_inset Flex Code
19377 \begin_layout Plain Layout
19379 \begin_inset space ~
19383 \begin_inset space ~
19391 This command defines an additional macro
19392 \begin_inset Flex Code
19395 \begin_layout Plain Layout
19401 for substitution in
19402 \begin_inset Flex Code
19405 \begin_layout Plain Layout
19413 \begin_inset Flex Code
19416 \begin_layout Plain Layout
19422 itself may contain substitution macros.
19423 The advantage over using
19424 \begin_inset Flex Code
19427 \begin_layout Plain Layout
19434 \begin_inset Flex Code
19437 \begin_layout Plain Layout
19443 is that the substituted value of
19444 \begin_inset Flex Code
19447 \begin_layout Plain Layout
19453 is sanitized so that it is a valid optional argument in the document format.
19454 This command may occur zero or more times.
19457 \begin_layout Description
19458 \begin_inset Flex Code
19461 \begin_layout Plain Layout
19463 \begin_inset space ~
19471 The text that is inserted in the exported document.
19472 This is actually the most important command and can be quite complex.
19473 This command must occur exactly once.
19476 \begin_layout Description
19477 \begin_inset Flex Code
19480 \begin_layout Plain Layout
19482 \begin_inset space ~
19490 This command specifies a preamble snippet that will be included in the
19492 It has to be defined using
19493 \begin_inset Flex Code
19496 \begin_layout Plain Layout
19502 \SpecialChar \ldots{}
19504 \begin_inset Flex Code
19507 \begin_layout Plain Layout
19514 This command may occur zero or more times.
19517 \begin_layout Description
19518 \begin_inset Flex Code
19521 \begin_layout Plain Layout
19523 \begin_inset space ~
19527 \begin_inset space ~
19535 This command denotes files that are created by the conversion process and
19536 are needed for a particular export format.
19537 If the filename is relative, it is interpreted relative to the master document.
19538 This command may be given zero or more times.
19541 \begin_layout Description
19542 \begin_inset Flex Code
19545 \begin_layout Plain Layout
19547 \begin_inset space ~
19555 The name of a required LaTeX package.
19556 The package is included via
19557 \begin_inset Flex Code
19560 \begin_layout Plain Layout
19568 in the LaTeX preamble.
19569 This command may occur zero or more times.
19572 \begin_layout Description
19573 \begin_inset Flex Code
19576 \begin_layout Plain Layout
19578 \begin_inset space ~
19582 \begin_inset space ~
19585 RotationLatexCommand
19590 This command specifies that the built in LaTeX command should be used for
19592 This command may occur once or not at all.
19595 \begin_layout Description
19596 \begin_inset Flex Code
19599 \begin_layout Plain Layout
19601 \begin_inset space ~
19605 \begin_inset space ~
19613 This command specifies that the built in LaTeX command should be used for
19615 This command may occur once or not at all.
19618 \begin_layout Description
19619 \begin_inset Flex Code
19622 \begin_layout Plain Layout
19624 \begin_inset space ~
19628 \begin_inset space ~
19631 RotationLatexOption
19636 This command specifies that rotation is done via an optional argument.
19637 This command may occur once or not at all.
19640 \begin_layout Description
19641 \begin_inset Flex Code
19644 \begin_layout Plain Layout
19646 \begin_inset space ~
19650 \begin_inset space ~
19658 This command specifies that resizing is done via an optional argument.
19659 This command may occur once or not at all.
19662 \begin_layout Description
19663 \begin_inset Flex Code
19666 \begin_layout Plain Layout
19668 \begin_inset space ~
19672 \begin_inset space ~
19680 This command specifies that clipping is done via an optional argument.
19681 This command may occur once or not at all.
19684 \begin_layout Description
19685 \begin_inset Flex Code
19688 \begin_layout Plain Layout
19690 \begin_inset space ~
19694 \begin_inset space ~
19702 This command specifies that an extra optional argument is used.
19703 This command may occur once or not at all.
19706 \begin_layout Description
19707 \begin_inset Flex Code
19710 \begin_layout Plain Layout
19712 \begin_inset space ~
19720 The file format of the converted file.
19721 This must be the name of a format that is known to LyX (see the
19722 \begin_inset Flex MenuItem
19725 \begin_layout Plain Layout
19730 ools\SpecialChar \menuseparator
19735 references\SpecialChar \menuseparator
19736 File Handling\SpecialChar \menuseparator
19743 This command must occur exactly once.
19746 \begin_layout Description
19747 \begin_inset Flex Code
19750 \begin_layout Plain Layout
19752 \begin_inset space ~
19760 The file name of the converted file.
19761 The file name must be absolute.
19762 This command must occur exactly once.
19765 \begin_layout Subsection
19766 Preamble definitions
19769 \begin_layout Standard
19770 The external template configuration file may contain additional preamble
19771 definitions enclosed by
19772 \begin_inset Flex Code
19775 \begin_layout Plain Layout
19781 \SpecialChar \ldots{}
19783 \begin_inset Flex Code
19786 \begin_layout Plain Layout
19793 They can be used by the templates in the
19794 \begin_inset Flex Code
19797 \begin_layout Plain Layout
19806 \begin_layout Section
19807 The substitution mechanism
19810 \begin_layout Standard
19811 When the external material facility invokes an external program, it is done
19812 on the basis of a command defined in the template configuration file.
19813 These commands can contain various macros that are expanded before execution.
19814 Execution always take place in the directory of the containing document.
19817 \begin_layout Standard
19818 Also, whenever external material is to be displayed, the name will be produced
19819 by the substitution mechanism, and most other commands in the template
19820 definition support substitution as well.
19823 \begin_layout Standard
19824 The available macros are the following:
19827 \begin_layout Description
19828 \begin_inset Flex Code
19831 \begin_layout Plain Layout
19832 $$AbsOrRelPathMaster
19837 The file path, absolute or relative to the master LyX document.
19840 \begin_layout Description
19841 \begin_inset Flex Code
19844 \begin_layout Plain Layout
19845 $$AbsOrRelPathParent
19850 The file path, absolute or relative to the LyX document.
19853 \begin_layout Description
19854 \begin_inset Flex Code
19857 \begin_layout Plain Layout
19863 The absolute file path.
19866 \begin_layout Description
19867 \begin_inset Flex Code
19870 \begin_layout Plain Layout
19876 The filename without path and without the extension.
19879 \begin_layout Description
19880 \begin_inset Flex Code
19883 \begin_layout Plain Layout
19885 \begin_inset Quotes eld
19889 \begin_inset Quotes erd
19897 This macro will expand to the contents of the file with the name
19898 \begin_inset Flex Code
19901 \begin_layout Plain Layout
19910 \begin_layout Description
19911 \begin_inset Flex Code
19914 \begin_layout Plain Layout
19920 The file extension (including the dot).
19923 \begin_layout Description
19924 \begin_inset Flex Code
19927 \begin_layout Plain Layout
19933 The filename of the file specified in the external material dialog.
19934 This is either an absolute name, or it is relative to the LyX document.
19937 \begin_layout Description
19938 \begin_inset Flex Code
19941 \begin_layout Plain Layout
19948 \begin_inset Flex Code
19951 \begin_layout Plain Layout
19957 (absolute name or relative to the LyX document).
19960 \begin_layout Description
19961 \begin_inset Flex Code
19964 \begin_layout Plain Layout
19970 The file path, relative to the master LyX document.
19973 \begin_layout Description
19974 \begin_inset Flex Code
19977 \begin_layout Plain Layout
19983 The file path, relative to the LyX document.
19986 \begin_layout Description
19987 \begin_inset Flex Code
19990 \begin_layout Plain Layout
19996 This macro will expand to the absolute path of the system directory.
19997 This is typically used to point to the various helper scripts that are
20001 \begin_layout Description
20002 \begin_inset Flex Code
20005 \begin_layout Plain Layout
20011 A name and full path to a temporary file which will be automatically deleted
20012 whenever the containing document is closed, or the external material insertion
20016 \begin_layout Standard
20017 All path macros contain a trailing directory separator, so you can construct
20019 \begin_inset space \thinspace{}
20023 \begin_inset space \space{}
20026 the absolute filename with
20027 \begin_inset Flex Code
20030 \begin_layout Plain Layout
20031 $$AbsPath$$Basename$$Extension
20039 \begin_layout Standard
20040 The macros above are substituted in all commands unless otherwise noted.
20042 \begin_inset Flex Code
20045 \begin_layout Plain Layout
20051 supports additionally the following substitutions if they are enabled by
20053 \begin_inset Flex Code
20056 \begin_layout Plain Layout
20063 \begin_inset Flex Code
20066 \begin_layout Plain Layout
20075 \begin_layout Description
20076 \begin_inset Flex Code
20079 \begin_layout Plain Layout
20085 The front part of the resize command.
20088 \begin_layout Description
20089 \begin_inset Flex Code
20092 \begin_layout Plain Layout
20098 The back part of the resize command.
20101 \begin_layout Description
20102 \begin_inset Flex Code
20105 \begin_layout Plain Layout
20111 The front part of the rotation command.
20114 \begin_layout Description
20115 \begin_inset Flex Code
20118 \begin_layout Plain Layout
20124 The back part of the rotation command.
20127 \begin_layout Standard
20128 The value string of the
20129 \begin_inset Flex Code
20132 \begin_layout Plain Layout
20138 command supports additionally the following substitutions if they are enabled
20140 \begin_inset Flex Code
20143 \begin_layout Plain Layout
20150 \begin_inset Flex Code
20153 \begin_layout Plain Layout
20162 \begin_layout Description
20163 \begin_inset Flex Code
20166 \begin_layout Plain Layout
20175 \begin_layout Description
20176 \begin_inset Flex Code
20179 \begin_layout Plain Layout
20188 \begin_layout Description
20189 \begin_inset Flex Code
20192 \begin_layout Plain Layout
20201 \begin_layout Description
20202 \begin_inset Flex Code
20205 \begin_layout Plain Layout
20211 The rotation option.
20214 \begin_layout Standard
20215 You may ask why there are so many path macros.
20216 There are mainly two reasons:
20219 \begin_layout Enumerate
20220 Relative and absolute file names should remain relative or absolute, respectivel
20222 Users may have reasons to prefer either form.
20223 Relative names are useful for portable documents that should work on different
20224 machines, for example.
20225 Absolute names may be required by some programs.
20228 \begin_layout Enumerate
20229 LaTeX treats relative file names differently than LyX and other programs
20230 in nested included files.
20231 For LyX, a relative file name is always relative to the document that contains
20233 For LaTeX, it is always relative to the master document.
20234 These two definitions are identical if you have only one document, but
20235 differ if you have a master document that includes part documents.
20236 That means that relative filenames must be transformed when presented to
20238 Fortunately LyX does this automatically for you if you choose the right
20242 \begin_layout Standard
20243 So which path macro should be used in new template definitions? The rule
20247 \begin_layout Itemize
20249 \begin_inset Flex Code
20252 \begin_layout Plain Layout
20258 if an absolute path is required.
20261 \begin_layout Itemize
20263 \begin_inset Flex Code
20266 \begin_layout Plain Layout
20267 $$AbsOrRelPathMaster
20272 if the substituted string is some kind of LaTeX input.
20275 \begin_layout Itemize
20277 \begin_inset Flex Code
20280 \begin_layout Plain Layout
20281 $$AbsOrRelPathParent
20286 in order to preserve the user's choice.
20289 \begin_layout Standard
20290 There are special cases where this rule does not work and e.
20291 \begin_inset space \thinspace{}
20295 \begin_inset space \space{}
20298 relative names are needed, but normally it will work just fine.
20299 One example for such a case is the command
20300 \begin_inset Flex Code
20303 \begin_layout Plain Layout
20304 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20309 in the XFig template above: We can't use the absolute name because the
20311 \begin_inset Flex Code
20314 \begin_layout Plain Layout
20320 files needs the relative name in order to rewrite the file content.
20323 \begin_layout Section
20324 Security discussion
20325 \begin_inset CommandInset label
20327 name "sec:Security-discussion"
20334 \begin_layout Standard
20335 The external material feature interfaces with a lot of external programs
20336 and does so automatically, so we have to consider the security implications
20338 In particular, since you have the option of including your own filenames
20339 and/or parameter strings and those are expanded into a command, it seems
20340 that it would be possible to create a malicious document which executes
20341 arbitrary commands when a user views or prints the document.
20342 This is something we definitely want to avoid.
20345 \begin_layout Standard
20346 However, since the external program commands are specified in the template
20347 configuration file only, there are no security issues if LyX is properly
20348 configured with safe templates only.
20349 This is so because the external programs are invoked with the
20350 \begin_inset Flex Code
20353 \begin_layout Plain Layout
20359 -system call rather than the
20360 \begin_inset Flex Code
20363 \begin_layout Plain Layout
20369 system-call, so it's not possible to execute arbitrary commands from the
20370 filename or parameter section via the shell.
20373 \begin_layout Standard
20374 This also implies that you are restricted in what command strings you can
20375 use in the external material templates.
20376 In particular, pipes and redirection are not readily available.
20377 This has to be so if LyX should remain safe.
20378 If you want to use some of the shell features, you should write a safe
20379 script to do this in a controlled manner, and then invoke the script from
20380 the command string.
20384 \begin_layout Standard
20385 It is possible to design a template that interacts directly with the shell,
20386 but since this would allow a malicious user to execute arbitrary commands
20387 by writing clever filenames and/or parameters, we generally recommend that
20388 you only use safe scripts that work with the
20389 \begin_inset Flex Code
20392 \begin_layout Plain Layout
20398 system call in a controlled manner.
20399 Of course, for use in a controlled environment, it can be tempting to just
20400 fall back to use ordinary shell scripts.
20401 If you do so, be aware that you
20405 provide an easily exploitable security hole in your system.
20406 Of course it stands to reason that such unsafe templates will never be
20407 included in the standard LyX distribution, although we do encourage people
20408 to submit new templates in the open source tradition.
20409 But LyX as shipped from the official distribution channels will never have
20413 \begin_layout Standard
20414 Including external material provides a lot of power, and you have to be
20415 careful not to introduce security hazards with this power.
20416 A subtle error in a single line in an innocent looking script can open
20417 the door to huge security problems.
20418 So if you do not fully understand the issues, we recommend that you consult
20419 a knowledgeable security professional or the LyX development team if you
20420 have any questions about whether a given template is safe or not.
20421 And do this before you use it in an uncontrolled environment.