1 #LyX 2.0.0svn 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 CharStyle: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}}
77 \font_typewriter default
78 \font_default_family default
79 \use_non_tex_fonts false
86 \default_output_format default
88 \bibtex_command default
89 \index_command default
93 \pdf_title "LyX Configuration Manual"
94 \pdf_author "LyX Team"
95 \pdf_subject "LyX-documentation Customization"
96 \pdf_keywords "LyX, documentation, customization"
98 \pdf_bookmarksnumbered true
99 \pdf_bookmarksopen true
100 \pdf_bookmarksopenlevel 1
101 \pdf_breaklinks false
105 \pdf_pdfusetitle false
106 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
116 \paperorientation portrait
130 \paragraph_separation indent
131 \paragraph_indentation default
132 \quotes_language english
135 \paperpagestyle headings
136 \tracking_changes true
137 \output_changes false
140 \author 1 "Jean-Marc Lasgouttes"
141 \author 223010757 "Richard Heck" rgheck@brown.edu
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
1409 \begin_layout Standard
1411 \begin_inset Flex MenuItem
1414 \begin_layout Plain Layout
1421 \begin_inset Flex MenuItem
1424 \begin_layout Plain Layout
1431 For example, you might want to use
1432 \begin_inset Flex MenuItem
1435 \begin_layout Plain Layout
1441 to view PostScript files.
1442 You can enter the command needed to start the program in the corresponding
1444 In defining this command, you can use the four variables listed in the
1446 The viewer is launched when you view an image in LyX or use the
1447 \begin_inset Flex MenuItem
1450 \begin_layout Plain Layout
1457 The editor is for example launched when you right-click on an image and
1459 \begin_inset Flex MenuItem
1462 \begin_layout Plain Layout
1468 in the appearing context menu.
1471 \begin_layout Standard
1473 \begin_inset Flex MenuItem
1476 \begin_layout Plain Layout
1482 option tells LyX that a format is suitable for document export.
1483 If this is set and if a suitable conversion route exists (see sec.
1484 \begin_inset space \thinspace{}
1488 \begin_inset CommandInset ref
1490 reference "sec:Converters"
1494 ), the format will appear in the
1495 \begin_inset Flex MenuItem
1498 \begin_layout Plain Layout
1499 File\SpecialChar \menuseparator
1506 The format will also appear in the
1507 \begin_inset Flex MenuItem
1510 \begin_layout Plain Layout
1516 menu if a viewer is specified for the format.
1517 Pure image formats, such as
1518 \begin_inset Flex Code
1521 \begin_layout Plain Layout
1527 , should not use this option.
1528 Formats that can both represent vector graphics and documents like
1529 \begin_inset Flex Code
1532 \begin_layout Plain Layout
1541 \begin_layout Standard
1543 \begin_inset Flex MenuItem
1546 \begin_layout Plain Layout
1547 Vector graphics format
1552 tells LyX that a format can contain vector graphics.
1553 This information is used to determine the target format of included graphics
1555 \begin_inset Flex MenuItem
1558 \begin_layout Plain Layout
1565 Included graphics may need to be converted to either
1566 \begin_inset Flex MenuItem
1569 \begin_layout Plain Layout
1576 \begin_inset Flex MenuItem
1579 \begin_layout Plain Layout
1586 \begin_inset Flex MenuItem
1589 \begin_layout Plain Layout
1596 \begin_inset Flex MenuItem
1599 \begin_layout Plain Layout
1605 cannot handle other image formats.
1606 If an included graphic is not already in
1607 \begin_inset Flex MenuItem
1610 \begin_layout Plain Layout
1617 \begin_inset Flex MenuItem
1620 \begin_layout Plain Layout
1627 \begin_inset Flex MenuItem
1630 \begin_layout Plain Layout
1636 format, it is converted to
1637 \begin_inset Flex MenuItem
1640 \begin_layout Plain Layout
1646 if the vector format option is set, and otherwise to
1647 \begin_inset Flex MenuItem
1650 \begin_layout Plain Layout
1659 \begin_layout Section
1663 \begin_layout Standard
1664 Since all conversions from one format to another take place in LyX's temporary
1665 directory, it is sometimes necessary to modify a file before copying it
1666 to the temporary directory in order that the conversion may be performed.
1670 \begin_layout Plain Layout
1671 For example, the file may refer to other files—images, for example—using
1672 relative file names, and these may become invalid when the file is copied
1673 to the temporary directory.
1678 This is done by a Copier: It copies a file to (or from) the temporary directory
1679 and may modify it in the process.
1682 \begin_layout Standard
1683 The definitions of the copiers may use four variables:
1686 \begin_layout Labeling
1687 \labelwidthstring 00.00.0000
1688 \begin_inset Flex Code
1691 \begin_layout Plain Layout
1697 The LyX system directory (e.
1698 \begin_inset space \thinspace{}
1702 \begin_inset space \space{}
1706 \begin_inset Flex MenuItem
1709 \begin_layout Plain Layout
1718 \begin_layout Labeling
1719 \labelwidthstring 00.00.0000
1720 \begin_inset Flex Code
1723 \begin_layout Plain Layout
1732 \begin_layout Labeling
1733 \labelwidthstring 00.00.0000
1734 \begin_inset Flex Code
1737 \begin_layout Plain Layout
1746 \begin_layout Labeling
1747 \labelwidthstring 00.00.0000
1748 \begin_inset Flex Code
1751 \begin_layout Plain Layout
1760 \begin_layout Standard
1761 The latter should be the filename as it would be used in a LaTeX's
1768 It is relevant only when exporting files suitable for such inclusion.
1771 \begin_layout Standard
1772 Copiers can be used to do almost anything with output files.
1773 For example, suppose you want generated pdf files to be copied to a special
1775 \begin_inset Flex Code
1778 \begin_layout Plain Layout
1785 Then you could write a shell script such as this one:
1788 \begin_layout Standard
1789 \begin_inset listings
1793 \begin_layout Plain Layout
1798 \begin_layout Plain Layout
1803 \begin_layout Plain Layout
1805 TOFILE=`basename $2`
1808 \begin_layout Plain Layout
1810 cp $FROMFILE /home/you/pdf/$TOFILE
1815 Save it in your local LyX directory—say,
1816 \begin_inset Flex Code
1819 \begin_layout Plain Layout
1820 /home/you/.lyx/scripts/pdfcopier.sh
1825 —and make it executable, if you need to do so on your platform.
1827 \begin_inset Flex MenuItem
1830 \begin_layout Plain Layout
1831 Tools\SpecialChar \menuseparator
1837 dialog, select under
1838 \begin_inset Flex MenuItem
1841 \begin_layout Plain Layout
1842 File Handling\SpecialChar \menuseparator
1849 \begin_inset Flex MenuItem
1852 \begin_layout Plain Layout
1858 format—or one of the other pdf formats—and enter
1859 \begin_inset Flex Code
1862 \begin_layout Plain Layout
1863 pdfcopier.sh $$i $$o
1869 \begin_inset Flex MenuItem
1872 \begin_layout Plain Layout
1882 \begin_layout Standard
1883 Copiers are used by LyX in various of its own conversions.
1884 For example, if appropriate programs are found, LyX will automatically
1885 install copiers for the
1886 \begin_inset Flex MenuItem
1889 \begin_layout Plain Layout
1896 \begin_inset Flex MenuItem
1899 \begin_layout Plain Layout
1901 \begin_inset space ~
1910 When these formats are exported, the copier sees that not just the main
1911 HTML file but various associated files (style files, images, etc.) are also
1913 All these files are written to a subdirectory of the directory in which
1914 the original LyX file was found.
1918 \begin_layout Plain Layout
1919 This copier can be customized.
1921 \begin_inset Quotes eld
1925 \begin_inset Quotes erd
1928 argument takes a comma-separated list of extensions to be copied; if it
1929 is omitted, all files will be copied.
1931 \begin_inset Quotes eld
1935 \begin_inset Quotes erd
1938 argument determines the extension added to the generated directory.
1940 \begin_inset Quotes eld
1944 \begin_inset Flex MenuItem
1947 \begin_layout Plain Layout
1954 \begin_inset Quotes erd
1957 , so HTML generated from
1958 \begin_inset Flex MenuItem
1961 \begin_layout Plain Layout
1962 /path/to/filename.lyx
1968 \begin_inset Flex MenuItem
1971 \begin_layout Plain Layout
1972 /path/to/filename.html.LyXconv
1986 \begin_layout Section
1988 \begin_inset CommandInset label
1990 name "sec:Converters"
1997 \begin_layout Standard
1998 You can define your own Converters to convert files between different formats.
2000 \begin_inset Flex MenuItem
2003 \begin_layout Plain Layout
2004 Tools\SpecialChar \menuseparator
2005 Preferences\SpecialChar \menuseparator
2006 File Handling\SpecialChar \menuseparator
2015 \begin_layout Standard
2016 To define a new converter, select the
2017 \begin_inset Flex MenuItem
2020 \begin_layout Plain Layout
2022 \begin_inset space ~
2031 \begin_inset Flex MenuItem
2034 \begin_layout Plain Layout
2036 \begin_inset space ~
2044 from the drop-down lists, enter the command needed for the conversion,
2046 \begin_inset Flex MenuItem
2049 \begin_layout Plain Layout
2056 Several variables can be used in the definition of converters:
2059 \begin_layout Labeling
2060 \labelwidthstring 00.00.0000
2061 \begin_inset Flex Code
2064 \begin_layout Plain Layout
2070 The LyX system directory
2073 \begin_layout Labeling
2074 \labelwidthstring 00.00.0000
2075 \begin_inset Flex Code
2078 \begin_layout Plain Layout
2087 \begin_layout Labeling
2088 \labelwidthstring 00.00.0000
2089 \begin_inset Flex Code
2092 \begin_layout Plain Layout
2101 \begin_layout Labeling
2102 \labelwidthstring 00.00.0000
2103 \begin_inset Flex Code
2106 \begin_layout Plain Layout
2112 The base filename of the input file (i.
2113 \begin_inset space \thinspace{}
2116 g., without the extension)
2119 \begin_layout Labeling
2120 \labelwidthstring 00.00.0000
2121 \begin_inset Flex Code
2124 \begin_layout Plain Layout
2130 The path to the input file
2133 \begin_layout Labeling
2134 \labelwidthstring 00.00.0000
2135 \begin_inset Flex Code
2138 \begin_layout Plain Layout
2144 The path to the original input file (this is different from $$p when a
2145 chain of converters is called)
2146 \change_deleted 1 1287732759
2148 \change_inserted 1 1287732721
2152 \begin_layout Labeling
2153 \labelwidthstring 00.00.0000
2155 \change_inserted 1 1287732753
2156 \begin_inset Flex Code
2159 \begin_layout Plain Layout
2161 \change_inserted 1 1287732729
2167 The iconv name for the encoding of the document.
2170 \begin_layout Standard
2172 \begin_inset Flex MenuItem
2175 \begin_layout Plain Layout
2177 \begin_inset space ~
2185 field you can enter the following flags, separated by commas:
2188 \begin_layout Labeling
2189 \labelwidthstring 00.00.0000
2190 \begin_inset Flex Code
2193 \begin_layout Plain Layout
2199 This converter runs some form of LaTeX.
2200 This will make LyX's LaTeX error logs available.
2203 \begin_layout Labeling
2204 \labelwidthstring 00.00.0000
2205 \begin_inset Flex Code
2208 \begin_layout Plain Layout
2215 \begin_inset Flex MenuItem
2218 \begin_layout Plain Layout
2224 file for the conversion.
2227 \begin_layout Labeling
2228 \labelwidthstring 00.00.0000
2229 \begin_inset Flex Code
2232 \begin_layout Plain Layout
2241 \begin_layout Standard
2242 The following three flags are not really flags at all because they take
2244 \begin_inset Flex MenuItem
2247 \begin_layout Plain Layout
2249 \begin_inset space ~
2253 \begin_inset space ~
2264 \begin_layout Labeling
2265 \labelwidthstring 00.00.0000
2266 \begin_inset Flex Code
2269 \begin_layout Plain Layout
2275 If set, the converter's standard error will be redirected to a file
2276 \begin_inset Flex Code
2279 \begin_layout Plain Layout
2285 , and the script given as argument will be run as:
2286 \begin_inset Flex Code
2289 \begin_layout Plain Layout
2290 script < infile.out > infile.log
2296 The argument may contain
2297 \begin_inset Flex Code
2300 \begin_layout Plain Layout
2309 \begin_layout Labeling
2310 \labelwidthstring 00.00.0000
2311 \begin_inset Flex Code
2314 \begin_layout Plain Layout
2320 The name of the directory in which the converter will dump the generated
2322 LyX will not create this directory, and it does not copy anything into
2323 it, though it will copy this directory to the destination.
2324 The argument may contain
2325 \begin_inset Flex Code
2328 \begin_layout Plain Layout
2334 , which will be replaced by the base name of the input and output files,
2335 respectively, when the directory is copied.
2336 \begin_inset Newline newline
2339 Note that resultdir and usetempdir make no sense together.
2340 The latter will be ignored if the former is given.
2343 \begin_layout Labeling
2344 \labelwidthstring 00.00.0000
2345 \begin_inset Flex Code
2348 \begin_layout Plain Layout
2354 Determines the output file name and may, contain
2355 \begin_inset Flex Code
2358 \begin_layout Plain Layout
2365 Sensible only with resultdir and optional even then; if not given, it defaults
2369 \begin_layout Standard
2370 None of these last three are presently used in any of the converters that
2371 are installed with LyX.
2375 \begin_layout Standard
2376 You do not have to define converters for all formats between which you want
2378 For example, you will note that there is no `LyX to PostScript' converter,
2379 but LyX will export PostScript.
2380 It does so by first creating a LaTeX file (no converter needs to be defined
2381 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2382 and finally converting the resulting DVI file to PostScript.
2383 LyX finds such `chains' of converters automatically, and it will always
2384 choose the shortest possible chain.
2385 You can, though, still define multiple conversion methods between file
2387 For example, the standard LyX configuration provides three ways to convert
2388 LaTeX to PDF: Directly, using
2389 \begin_inset Flex MenuItem
2392 \begin_layout Plain Layout
2398 ; via (DVI and) PostScript, using
2399 \begin_inset Flex MenuItem
2402 \begin_layout Plain Layout
2409 \begin_inset Flex MenuItem
2412 \begin_layout Plain Layout
2419 To define such alternate chains, you must define multiple target `file
2420 formats', as described in section
2421 \begin_inset CommandInset ref
2423 reference "sec:Formats"
2428 For example, in the standard configuration, the formats named
2429 \begin_inset Flex MenuItem
2432 \begin_layout Plain Layout
2439 \begin_inset Flex MenuItem
2442 \begin_layout Plain Layout
2449 \begin_inset Flex MenuItem
2452 \begin_layout Plain Layout
2458 are defined, all of which share the extension
2459 \begin_inset Flex MenuItem
2462 \begin_layout Plain Layout
2468 , and which correspond to the conversion methods just mentioned.
2471 \begin_layout Chapter
2472 Internationalizing LyX
2473 \begin_inset CommandInset label
2475 name "cha:Internationalizing-LyX"
2482 \begin_layout Standard
2483 LyX supports using a translated interface.
2484 Last time we checked, LyX provided text in thirty languages.
2485 The language of choice is called your
2490 (For further reading on locale settings, see also the documentation for
2491 locale that comes with your operating system.
2492 For Linux, the manual page for
2493 \begin_inset Flex Code
2496 \begin_layout Plain Layout
2502 could be a good place to start).
2505 \begin_layout Standard
2506 Notice that these translations will work, but do contain a few flaws.
2507 In particular, all dialogs have been designed with the English text in
2508 mind, which means that some of the translated text will be too large to
2509 fit within the space allocated.
2510 This is only a display problem and will not cause any harm.
2511 Also, you will find that some of the translations do not define shortcut
2512 keys for everything.
2513 Sometimes, there are simply not enough free letters to do it.
2514 Other times, the translator just hasn't got around to doing it yet.
2515 Our localization team, which you may wish to join,
2519 \begin_layout Plain Layout
2520 If you are a fluent speaker of a language other than English, joining these
2521 teams is a great way to give back to the LyX community!
2526 will of course try to fix these shortcomings in future versions of LyX.
2529 \begin_layout Section
2533 \begin_layout Subsection
2534 Translating the graphical user interface (text messages).
2537 \begin_layout Standard
2539 \begin_inset Flex Code
2542 \begin_layout Plain Layout
2548 library to handle the internationalization of the interface.
2549 To have LyX speak your favorite language in all menus and dialogs, you
2551 \begin_inset Flex Code
2554 \begin_layout Plain Layout
2560 -file for that language.
2561 When this is available, you'll have to generate a
2562 \begin_inset Flex Code
2565 \begin_layout Plain Layout
2571 -file from it and install the
2572 \begin_inset Flex Code
2575 \begin_layout Plain Layout
2582 The process of doing all of this is explained in the documentation for
2584 \begin_inset Flex Code
2587 \begin_layout Plain Layout
2594 It is possible to do this just for yourself, but if you're going to do
2595 it, you might as well share the results of your labors with the rest of
2597 Send a message to the LyX developers' list for more information about how
2601 \begin_layout Standard
2602 In short, this is what you should do (xx denotes the language code):
2605 \begin_layout Itemize
2606 Check out the LyX source code.
2608 \begin_inset CommandInset href
2610 name "information on the web"
2611 target "http://www.lyx.org/devel/cvs.php"
2618 \begin_layout Itemize
2620 \begin_inset Flex Code
2623 \begin_layout Plain Layout
2629 to the folder of the
2630 \begin_inset Flex Code
2633 \begin_layout Plain Layout
2641 \begin_inset Flex Code
2644 \begin_layout Plain Layout
2652 \begin_inset Flex Code
2655 \begin_layout Plain Layout
2661 doesn't exist anywhere, it can be remade with the console command
2662 \begin_inset Flex Code
2665 \begin_layout Plain Layout
2671 in that directory, or you can use an existing po-file for some other language
2675 \begin_layout Itemize
2677 \begin_inset Flex Code
2680 \begin_layout Plain Layout
2690 \begin_layout Plain Layout
2691 This is just a text file, so it can be edited in any text editor.
2692 But there are also specialized programs that support such editing, such
2697 (for all platforms) or
2706 contains a `mode' for editing
2707 \begin_inset Flex Code
2710 \begin_layout Plain Layout
2721 For some menu- and widget-labels, there are also shortcut keys that should
2723 Those keys are marked after a `|', and should be translated according to
2724 the words and phrases of the language.
2725 You should also fill also out the information at the beginning of the new
2727 \begin_inset Flex Code
2730 \begin_layout Plain Layout
2736 -file with your email-address, etc., so people know where to reach you with
2737 suggestions and entertaining flames.
2740 \begin_layout Standard
2741 If you are just doing this on your own, then:
2744 \begin_layout Itemize
2746 \begin_inset Flex Code
2749 \begin_layout Plain Layout
2756 This can be done with
2757 \begin_inset Flex Code
2760 \begin_layout Plain Layout
2761 msgfmt -o xx.mo < xx.po
2769 \begin_layout Itemize
2771 \begin_inset Flex Code
2774 \begin_layout Plain Layout
2780 -file to your locale-tree, at the correct directory for application messages
2785 xx, and under the name
2786 \begin_inset Flex Code
2789 \begin_layout Plain Layout
2796 \begin_inset space \thinspace{}
2800 \begin_inset space \space{}
2804 \begin_inset Flex Code
2807 \begin_layout Plain Layout
2808 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2818 \begin_layout Standard
2819 As said, however, it would be best if the new
2820 \begin_inset Flex Code
2823 \begin_layout Plain Layout
2829 -file could be added to the LyX distribution, so others can use it.
2830 Adding it involves making additional changes to LyX.
2831 So send an email to the developers' mailing list if you're interested in
2835 \begin_layout Subsubsection
2839 \begin_layout Standard
2840 Sometimes it turns out that one English message needs to be translated into
2841 different messages in the target language.
2842 One example is the message
2843 \begin_inset Flex Code
2846 \begin_layout Plain Layout
2852 which has the German translation
2860 , depending upon exactly what the English
2861 \begin_inset Quotes eld
2865 \begin_inset Quotes erd
2870 \begin_inset Flex Code
2873 \begin_layout Plain Layout
2879 does not handle such ambiguous translations.
2880 Therefore you have to add some context information to the message: Instead
2882 \begin_inset Flex Code
2885 \begin_layout Plain Layout
2892 \begin_inset Flex Code
2895 \begin_layout Plain Layout
2896 To[[as in 'From format x to format y']]
2902 \begin_inset Flex Code
2905 \begin_layout Plain Layout
2906 To[[as in 'From page x to page y']].
2911 Now the two occurrences of
2912 \begin_inset Flex Code
2915 \begin_layout Plain Layout
2922 \begin_inset Flex Code
2925 \begin_layout Plain Layout
2931 and can be translated correctly to
2942 \begin_layout Standard
2943 Of course the context information needs to be stripped off the original
2944 message when no translation is used.
2945 Therefore you have to put it in double square brackets at the end of the
2946 message (see the example above).
2947 The translation mechanism of LyX ensures that everything in double square
2948 brackets at the end of messages is removed before displaying the message.
2951 \begin_layout Subsection
2952 Translating the documentation.
2955 \begin_layout Standard
2956 The online documentation (in the
2957 \begin_inset Flex MenuItem
2960 \begin_layout Plain Layout
2966 -menu) can (and should!) be translated.
2967 If there are translated versions of the documentation available
2971 \begin_layout Plain Layout
2972 As of March 2008, at least some of the documents have been translated into
2973 fourteen languages, with the Tutorial available in a few more.
2978 and the locale is set accordingly, these will be used automagically by
2980 LyX looks for translated versions as
2981 \begin_inset Flex Code
2984 \begin_layout Plain Layout
2985 LyXDir/doc/xx/DocName.lyx
2991 \begin_inset Flex Code
2994 \begin_layout Plain Layout
3000 is the code for the language currently in use.
3001 If there are no translated documents, the default English versions will
3003 Note that the translated versions must have the same filenames (
3004 \begin_inset Flex Code
3007 \begin_layout Plain Layout
3013 above) as the original.
3014 If you feel up to translating the documentation (an excellent way to proof-read
3015 the original documentation by the way!), there are a few things you should
3019 \begin_layout Itemize
3020 Check out the documentation translation web page at
3021 \begin_inset CommandInset href
3023 name "http://www.lyx.org/Translation"
3024 target "http://www.lyx.org/Translation"
3029 That way, you can find out which (if any) documents have already been translate
3030 d into your language.
3031 You can also find out who (if anyone) is organizing the effort to translate
3032 the documentation into your language.
3033 If no one is organizing the effort, please let us know that you're interested.
3036 \begin_layout Standard
3037 Once you get to actually translating, here's a few hints for you that may
3041 \begin_layout Itemize
3042 Join the documentation team! There is information on how to do that in
3043 \begin_inset Flex Code
3046 \begin_layout Plain Layout
3053 \begin_inset Flex MenuItem
3056 \begin_layout Plain Layout
3057 Help\SpecialChar \menuseparator
3063 ), which by the way is the first document you should translate.
3066 \begin_layout Itemize
3067 Learn the typographic conventions for the language you are translating to.
3068 Typography is an ancient art and over the centuries, a great variety of
3069 conventions have developed throughout different parts of the world.
3070 Also study the professional terminology amongst typographers in your country.
3071 Inventing your own terminology will only confuse the users.
3074 (Warning! Typography is addictive!)
3077 \begin_layout Itemize
3078 Make a copy of the document.
3079 This will be your working copy.
3080 You can use this as your personal translated help-file by placing it in
3082 \begin_inset Flex Code
3085 \begin_layout Plain Layout
3094 \begin_layout Itemize
3095 Sometimes the original document (from the LyX-team) will be updated.
3096 Use the source viewer at
3097 \begin_inset CommandInset href
3099 name "http://www.lyx.org/trac/timeline"
3100 target "http://www.lyx.org/trac/timeline"
3104 to see what has been changed.
3105 That way you can easily see which parts of the translated document need
3109 \begin_layout Standard
3110 If you ever find an error in the original document, fix it and notify the
3111 rest of the documentation team of the changes! (You didn't forget to join
3112 the documentation team, did you?)
3115 \begin_layout Standard
3116 \begin_inset Branch OutDated
3119 \begin_layout Section
3120 International Keyboard Support
3123 \begin_layout Standard
3126 [Editor's Note: The following section is by
3134 It needs to be fixed to conform to the new Documentation Style sheet and
3135 to make use of the new v1.0 features.
3136 The whole thing also needs to be merged with the section following it.-jw
3137 It may also be badly out of date.-rh (2008)]
3140 \begin_layout Subsection
3141 Defining Own Keymaps: Keymap File Format
3144 \begin_layout Standard
3145 Let's look at a keyboard definition file a little closer.
3146 It is a plain text file defining
3149 \begin_layout Itemize
3150 key-to-key or key-to-string translations
3153 \begin_layout Itemize
3157 \begin_layout Itemize
3158 dead keys exceptions
3161 \begin_layout Standard
3162 To define key-to-key or key-to-string translation, use this command:
3165 \begin_layout Quotation
3166 \begin_inset Flex Code
3169 \begin_layout Plain Layout
3178 \begin_inset Flex Code
3181 \begin_layout Plain Layout
3190 \begin_layout Standard
3192 \begin_inset Flex Code
3195 \begin_layout Plain Layout
3201 is the key to be translated and
3202 \begin_inset Flex Code
3205 \begin_layout Plain Layout
3211 is the string to be inserted into the document.
3212 To define dead keys, use:
3215 \begin_layout Quotation
3216 \begin_inset Flex Code
3219 \begin_layout Plain Layout
3228 \begin_inset Flex Code
3231 \begin_layout Plain Layout
3240 \begin_layout Standard
3242 \begin_inset Flex Code
3245 \begin_layout Plain Layout
3251 is a keyboard key and
3252 \begin_inset Flex Code
3255 \begin_layout Plain Layout
3262 The following dead keys are supported (shortcut name is in parentheses):
3265 \begin_layout Quotation
3269 \begin_inset space \hfill{}
3275 \begin_layout Quotation
3277 \begin_inset space \hfill{}
3283 \begin_layout Quotation
3285 \begin_inset space \hfill{}
3291 \begin_layout Quotation
3293 \begin_inset space \hfill{}
3299 \begin_layout Quotation
3301 \begin_inset space \hfill{}
3307 \begin_layout Quotation
3309 \begin_inset space \hfill{}
3316 \begin_layout Plain Layout
3328 \begin_layout Quotation
3330 \begin_inset space \hfill{}
3336 \begin_layout Quotation
3338 \begin_inset space \hfill{}
3345 \begin_layout Plain Layout
3357 \begin_layout Quotation
3359 \begin_inset space \hfill{}
3365 \begin_layout Quotation
3367 \begin_inset space \hfill{}
3373 \begin_layout Quotation
3375 \begin_inset space \hfill{}
3382 \begin_layout Plain Layout
3394 \begin_layout Quotation
3396 \begin_inset space \hfill{}
3403 \begin_layout Plain Layout
3415 \begin_layout Quotation
3417 \begin_inset space \hfill{}
3423 \begin_layout Quotation
3424 hungarian umlaut (hug)
3425 \begin_inset space \hfill{}
3431 \begin_layout Quotation
3433 \begin_inset space \hfill{}
3439 \begin_layout Quotation
3441 \begin_inset space \hfill{}
3448 \begin_layout Plain Layout
3460 \begin_layout Standard
3461 Since in many international keyboards there are exceptions to what some
3462 dead keys should do, you can define them using
3465 \begin_layout Quotation
3466 \begin_inset Flex Code
3469 \begin_layout Plain Layout
3477 deadkey key outstring
3480 \begin_layout Standard
3481 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3485 \begin_layout Quotation
3486 \begin_inset Flex Code
3489 \begin_layout Plain Layout
3502 \begin_layout Standard
3503 to make it work correctly.
3504 Also, you have to define as exceptions dead keys over i and j, to remove
3505 the dot from them before inserting an accent mark.
3506 I will change this when the time comes, but so far I haven't had time.
3509 \begin_layout Standard
3510 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3513 \begin_inset Flex Code
3516 \begin_layout Plain Layout
3522 have different meaning.
3524 \begin_inset Flex Code
3527 \begin_layout Plain Layout
3533 marks comments, quotes start and end LaTeX-style commands.
3534 To enter quote, you'll need to use
3535 \begin_inset Flex Code
3538 \begin_layout Plain Layout
3547 \begin_inset Flex Code
3550 \begin_layout Plain Layout
3557 \begin_inset Flex Code
3560 \begin_layout Plain Layout
3571 \begin_layout Standard
3572 If you make a keyboard description file that works for your language, please
3573 mail it to me, so I can include it in the next keymap distribution.
3576 \begin_layout Standard
3577 More keywords will be supported in keymap configuration file in future,
3581 \begin_layout Itemize
3582 \begin_inset Flex Code
3585 \begin_layout Plain Layout
3596 \begin_inset space \hfill{}
3600 \begin_inset Flex Code
3603 \begin_layout Plain Layout
3612 \begin_layout Itemize
3613 \begin_inset Flex Code
3616 \begin_layout Plain Layout
3627 \begin_inset space \hfill{}
3631 \begin_inset Flex Code
3634 \begin_layout Plain Layout
3640 an external keymap translation program
3643 \begin_layout Standard
3644 Also, it should look into
3645 \begin_inset Flex Code
3648 \begin_layout Plain Layout
3654 file for defaults, too (for example, a
3655 \begin_inset Flex Code
3658 \begin_layout Plain Layout
3666 option to include default keyboard).
3674 \begin_layout Section
3675 International Keymap Stuff
3676 \begin_inset CommandInset label
3678 name "sec:International-Keymap-Stuff"
3685 \begin_layout Standard
3686 \begin_inset Note Note
3689 \begin_layout Plain Layout
3690 In doing the revisions on this document in March 2008, I did not look over
3691 this stuff, as I do not understand it.
3692 It would be good if someone else could do so.
3701 \begin_layout Standard
3702 The next two sections describe the
3703 \begin_inset Flex Code
3706 \begin_layout Plain Layout
3715 \begin_inset Flex Code
3718 \begin_layout Plain Layout
3726 file syntax in detail.
3727 These sections should help you design your own key map if the ones provided
3728 do not meet your needs.
3731 \begin_layout Subsection
3735 \begin_layout Standard
3739 \begin_inset Flex Code
3742 \begin_layout Plain Layout
3748 file maps keystrokes to characters or strings.
3749 As the name suggests, it sets a keyboard mapping.
3751 \begin_inset Flex Code
3754 \begin_layout Plain Layout
3765 \begin_inset Flex Code
3768 \begin_layout Plain Layout
3783 \begin_inset Flex Code
3786 \begin_layout Plain Layout
3799 \begin_inset Flex Code
3802 \begin_layout Plain Layout
3811 \begin_inset Flex Code
3814 \begin_layout Plain Layout
3822 are described in this section.
3825 \begin_layout Labeling
3826 \labelwidthstring 00.00.0000
3827 \begin_inset Flex Code
3830 \begin_layout Plain Layout
3838 Map a character to a string
3841 \begin_layout LyX-Code
3856 \begin_layout Standard
3889 the double-quote (")
3906 must be escaped with a preceding backslash (
3917 \begin_layout Standard
3919 \begin_inset Flex MenuItem
3922 \begin_layout Plain Layout
3930 statement to cause the symbol
3931 \begin_inset Flex MenuItem
3934 \begin_layout Plain Layout
3942 to be output for the keystroke
3943 \begin_inset Flex MenuItem
3946 \begin_layout Plain Layout
3957 \begin_layout LyX-Code
3963 \begin_layout Labeling
3964 \labelwidthstring 00.00.0000
3965 \begin_inset Flex Code
3968 \begin_layout Plain Layout
3976 Specify an accent character
3979 \begin_layout LyX-Code
3988 \begin_layout Standard
3989 This will make the cha
4027 This is the dead key
4031 \begin_layout Plain Layout
4038 refers to a key that does not produce a character by itself, but when followed
4039 with another key, produces the desired accent character.
4040 For example, a German characte
4042 r with an umlaut like
4052 can be produced in this manner.
4061 \begin_layout Standard
4074 and then another key not in
4091 followed by the other, not allowed key, as output.
4095 \begin_inset Flex MenuItem
4098 \begin_layout Plain Layout
4106 cancels a dead key, so if
4117 \begin_inset Flex MenuItem
4120 \begin_layout Plain Layout
4129 , the cursor will not go one position backwards but will instead cancel
4145 might have had on the next keystroke.
4149 \begin_layout Standard
4150 The following example specifies that the character ' is to be an acute accent,
4151 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4154 \begin_layout LyX-Code
4157 kmod ' acute aeiouAEIOU
4160 \begin_layout Labeling
4161 \labelwidthstring 00.00.0000
4162 \begin_inset Flex Code
4165 \begin_layout Plain Layout
4171 Specify an exception to the accent character
4174 \begin_layout LyX-Code
4183 \begin_layout Standard
4184 This defines an exce
4225 have been assigned a keystroke with a previous
4228 \begin_inset Flex Code
4231 \begin_layout Plain Layout
4255 must not belong in the
4302 If such a declaration does not exist in
4310 \begin_inset Flex Code
4313 \begin_layout Plain Layout
4347 \begin_inset Flex Code
4350 \begin_layout Plain Layout
4364 \begin_layout Standard
4365 The following command produces causes äi to be produced when you enter acute-i
4369 \begin_layout LyX-Code
4383 \begin_layout Labeling
4384 \labelwidthstring 00.00.0000
4385 \begin_inset Flex Code
4388 \begin_layout Plain Layout
4394 Combine two accent characters
4397 \begin_layout LyX-Code
4403 accent1 accent2 allowed
4406 \begin_layout Standard
4407 This one is getting pretty esoteric.
4408 It allows you to combine the effect
4464 \begin_inset Flex Code
4467 \begin_layout Plain Layout
4495 \begin_layout Standard
4496 Consider this example from the
4497 \begin_inset Flex Code
4500 \begin_layout Plain Layout
4511 \begin_layout LyX-Code
4514 kmod ; acute aeioyvhAEIOYVH
4518 kcomb acute umlaut iyIY
4521 \begin_layout Standard
4522 This allows you to press
4523 \begin_inset Flex MenuItem
4526 \begin_layout Plain Layout
4534 and get the effect of
4535 \begin_inset Flex Code
4538 \begin_layout Plain Layout
4557 in this case cancels the last dead key, so if you press
4558 \begin_inset Flex MenuItem
4561 \begin_layout Plain Layout
4570 \begin_inset Flex Code
4573 \begin_layout Plain Layout
4586 \begin_layout Subsection
4590 \begin_layout Standard
4592 \begin_inset Flex Code
4595 \begin_layout Plain Layout
4603 mapping is performed, a
4604 \begin_inset Flex Code
4607 \begin_layout Plain Layout
4617 file maps the strings that the symbols generate to characters in the current
4619 The LyX distribution currently includes at least the
4620 \begin_inset Flex Code
4623 \begin_layout Plain Layout
4632 \begin_inset Flex Code
4635 \begin_layout Plain Layout
4646 \begin_layout Standard
4648 \begin_inset Flex Code
4651 \begin_layout Plain Layout
4659 file is a sequence of declarations of the form
4662 \begin_layout LyX-Code
4675 \begin_layout Standard
4676 For example, in order to map
4677 \begin_inset Flex MenuItem
4680 \begin_layout Plain Layout
4690 to the corresponding character in the iso-8859-1 set (233), the following
4694 \begin_layout LyX-Code
4702 \begin_layout Standard
4704 \begin_inset Flex Code
4707 \begin_layout Plain Layout
4716 \begin_inset Flex Code
4719 \begin_layout Plain Layout
4737 the same character can apply to more than one string.
4739 \begin_inset Flex Code
4742 \begin_layout Plain Layout
4753 \begin_layout LyX-Code
4765 \begin_inset Newline newline
4781 \begin_layout Standard
4782 If LyX cannot find a mapping for the string produced by the keystroke or
4783 a deadkey sequence, it will check if it looks like an accented char and
4784 try to draw an accent over the character on screen.
4787 \begin_layout Subsection
4791 \begin_layout Standard
4792 There is a second way to add support for international characters through
4793 so-called dead-keys.
4794 A dead-key works in combination with a letter to produce an accented character.
4795 Here, we'll explain how to create a really simple dead-key to illustrate
4799 \begin_layout Standard
4800 Suppose you happen to need the circumflex character,
4801 \begin_inset Quotes eld
4805 \begin_inset Quotes erd
4810 \begin_inset Flex MenuItem
4813 \begin_layout Plain Layout
4820 \begin_inset space ~
4824 \begin_inset Flex MenuItem
4827 \begin_layout Plain Layout
4833 ] to the LyX command
4834 \begin_inset Flex Code
4837 \begin_layout Plain Layout
4844 \begin_inset Flex Code
4847 \begin_layout Plain Layout
4854 Now, whenever you type the
4855 \begin_inset Flex MenuItem
4858 \begin_layout Plain Layout
4864 -key followed by a letter, that letter will have a circumflex accent on
4866 For example, the sequence
4867 \begin_inset Quotes eld
4871 \begin_inset Flex MenuItem
4874 \begin_layout Plain Layout
4881 \begin_inset Quotes erd
4884 produces the letter:
4885 \begin_inset Quotes eld
4889 \begin_inset Quotes erd
4893 If you tried to type
4894 \begin_inset Quotes eld
4898 \begin_inset Flex MenuItem
4901 \begin_layout Plain Layout
4908 \begin_inset Quotes erd
4911 , however, LyX will complain with a beep, since a
4912 \begin_inset Quotes eld
4916 \begin_inset Flex MenuItem
4919 \begin_layout Plain Layout
4926 \begin_inset Quotes erd
4929 never takes a circumflex accent.
4931 \begin_inset Flex MenuItem
4934 \begin_layout Plain Layout
4940 after a dead-key produces the bare-accent.
4941 Please note this last point! If you bind a key to a dead-key, you'll need
4942 to rebind the character on that key to yet another key.
4944 \begin_inset Flex MenuItem
4947 \begin_layout Plain Layout
4953 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4956 \begin_layout Standard
4957 One common way to bind dead-keys is to use
4958 \begin_inset Flex MenuItem
4961 \begin_layout Plain Layout
4968 \begin_inset Flex MenuItem
4971 \begin_layout Plain Layout
4978 \begin_inset Flex MenuItem
4981 \begin_layout Plain Layout
4987 in combination with an accent, like
4988 \begin_inset Quotes eld
4992 \begin_inset Flex MenuItem
4995 \begin_layout Plain Layout
5002 \begin_inset Quotes erd
5006 \begin_inset Quotes eld
5010 \begin_inset Flex MenuItem
5013 \begin_layout Plain Layout
5020 \begin_inset Quotes erd
5024 \begin_inset Quotes eld
5028 \begin_inset Flex MenuItem
5031 \begin_layout Plain Layout
5038 \begin_inset Quotes erd
5042 Another way involves using
5043 \begin_inset Flex Code
5046 \begin_layout Plain Layout
5053 \begin_inset Flex Code
5056 \begin_layout Plain Layout
5062 to set up the special
5063 \begin_inset Flex Code
5066 \begin_layout Plain Layout
5074 \begin_inset Flex Code
5077 \begin_layout Plain Layout
5083 acts in some ways just like
5084 \begin_inset Flex MenuItem
5087 \begin_layout Plain Layout
5093 and permits you to bind keys to accented characters.
5094 You can also turn keys into dead-keys by binding them to something like
5096 \begin_inset Flex Code
5099 \begin_layout Plain Layout
5105 and then binding this symbolic key to the corresponding LyX command.
5109 \begin_layout Plain Layout
5114 : This is exactly what I do in my
5115 \begin_inset Flex Code
5118 \begin_layout Plain Layout
5125 \begin_inset Flex Code
5128 \begin_layout Plain Layout
5136 \begin_inset Flex MenuItem
5139 \begin_layout Plain Layout
5141 \begin_inset space ~
5150 \begin_inset Flex Code
5153 \begin_layout Plain Layout
5159 and a bunch of these
5160 \begin_inset Quotes eld
5164 \begin_inset Flex Code
5167 \begin_layout Plain Layout
5174 \begin_inset Quotes erd
5177 symbolic keys bound such things as
5178 \begin_inset Flex MenuItem
5181 \begin_layout Plain Layout
5183 \begin_inset space ~
5192 \begin_inset Flex MenuItem
5195 \begin_layout Plain Layout
5197 \begin_inset space ~
5206 This is how I produce my accented characters.
5211 You can make just about anything into the
5212 \begin_inset Flex Code
5215 \begin_layout Plain Layout
5222 \begin_inset Flex MenuItem
5225 \begin_layout Plain Layout
5231 keys, a spare function key, etc.
5232 As for the LyX commands that produce accents, check the entry for
5233 \begin_inset Flex Code
5236 \begin_layout Plain Layout
5247 You'll find the complete list there.
5250 \begin_layout Subsection
5251 Saving your Language Configuration
5254 \begin_layout Standard
5255 You can edit your preferences so that your desired language environment
5256 is automatically configured when LyX starts up, via the
5257 \begin_inset Flex MenuItem
5260 \begin_layout Plain Layout
5261 Edit\SpecialChar \menuseparator
5270 \begin_layout Chapter
5271 Installing New Document Classes, Layouts, and Templates
5272 \begin_inset CommandInset label
5274 name "cha:Installing-New-Document"
5279 \begin_inset Argument
5282 \begin_layout Plain Layout
5283 Installing New Document Classes
5291 \begin_layout Standard
5292 In this chapter, we describe the procedures for creating and installing
5293 new LyX layout and template files, as well as offer a refresher on correctly
5294 installing new LaTeX document classes.
5298 \begin_layout Standard
5299 First, let us a say a few words about how one ought to think about the relation
5300 between LyX and LaTeX.
5301 The thing to understand is that, in a certain sense, LyX doesn't know anything
5303 Indeed, from LyX's point of view, LaTeX is just one of several
5304 \begin_inset Quotes eld
5308 \begin_inset Quotes erd
5311 in which it is capable of producing output.
5312 Other such formats are DocBook, plaintext, and XHTML.
5313 LaTeX is, of course, a particularly important format, but very little of
5314 the information LyX has about LaTeX is actually contained in the program
5319 \begin_layout Plain Layout
5320 Some commands are sufficiently complex that they are
5321 \begin_inset Quotes eld
5325 \begin_inset Quotes erd
5329 But the developers generally regard this as a Bad Thing.
5334 Rather, that information, even for the standard classes like
5335 \begin_inset Flex Code
5338 \begin_layout Plain Layout
5344 , is contained in `layout files'.
5345 Similarly, LyX itself does not know much about DocBook or XHTML.
5346 What it knows is contained in layout files.
5349 \begin_layout Standard
5350 You can think of the layout file for a given document class as a translation
5351 manual between LyX constructs---paragraphs with their corresponding styles,
5352 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5354 Almost everything LyX knows about
5355 \begin_inset Flex Code
5358 \begin_layout Plain Layout
5364 , for example, is contained in the file
5365 \begin_inset Flex Code
5368 \begin_layout Plain Layout
5374 and in various other files it includes.
5375 For this reason, anyone intending to write layout files should plan to
5376 study the existing files.
5377 A good place to start is with
5378 \begin_inset Flex Code
5381 \begin_layout Plain Layout
5387 , which is included in
5388 \begin_inset Flex Code
5391 \begin_layout Plain Layout
5398 \begin_inset Flex Code
5401 \begin_layout Plain Layout
5407 , and many of the other layout files for document classes.
5408 This file is where sections and the like are defined:
5409 \begin_inset Flex Code
5412 \begin_layout Plain Layout
5418 tells LyX how paragraphs that are marked with the Section, Subsection,
5419 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5422 \begin_inset Flex Code
5425 \begin_layout Plain Layout
5431 file basically just includes several of these
5432 \begin_inset Flex Code
5435 \begin_layout Plain Layout
5444 \begin_layout Standard
5445 Defining the LyX--LaTeX correspondence is not the only thing layout files
5447 Their other job is to define how the LyX constructs themselves will appear
5449 The fact that layout files have these two jobs is often a source of confusion,
5450 because they are completely separate.
5451 Telling LyX how to translate a certain paragraph style into LaTeX does
5452 not tell LyX how to display it; conversely, telling LyX how to display
5453 a certain paragraph style does not tell LyX how to translate it into LaTeX
5454 (let alone tell LaTeX how to display it).
5455 So, in general, when you define a new LyX construct, you must always do
5456 two quite separate things: (i)
5457 \begin_inset space ~
5460 tell LyX how to translate it into LaTeX and (ii)
5461 \begin_inset space ~
5464 tell LyX how to display it.
5467 \begin_layout Standard
5468 Much the same is true, of course, as regards LyX's other backend formats,
5469 though XHTML is in some ways different, because in that case LyX
5473 able, to some extent, to use information about how it should display a
5474 paragraph on the screen to output information (in the form of CSS) about
5475 how the paragraph should be displayed in a browser.
5476 Even in this case, however, the distinction between what LyX does internally
5477 and how things are rendered externally remains in force, and the two can
5478 be controlled separately.
5480 \begin_inset CommandInset ref
5482 reference "sec:Tags-for-XHTML"
5489 \begin_layout Section
5490 Installing new LaTeX files
5493 \begin_layout Standard
5494 Some installations may not include a LaTeX package or class file that you
5495 would like to use within LyX.
5496 For example, you might need FoilTeX, a package for preparing slides for
5497 overhead projectors.
5498 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5499 a user interface for installing such packages.
5500 For example, with MiKTeX, you start the program
5501 \begin_inset Quotes eld
5505 \begin_inset space ~
5509 \begin_inset Quotes erd
5512 to get a list of available packages.
5513 To install one of them, right click on it or use the corresponding toolbar
5517 \begin_layout Standard
5518 If your LaTeX distribution does not provide such a `package manager', or
5519 if the package is not available from your distribution, then follow these
5520 steps to install it manually:
5523 \begin_layout Enumerate
5524 Get the package from
5525 \begin_inset CommandInset href
5528 target "http://www.ctan.org/"
5535 \begin_layout Enumerate
5536 If the package contains a file with the ending
5537 \begin_inset Quotes eld
5541 \begin_inset Flex Code
5544 \begin_layout Plain Layout
5551 \begin_inset Quotes erd
5554 (is the case for FoilTeX) then open a console, change to the folder of
5555 this file and execute the command
5556 \begin_inset Flex Code
5559 \begin_layout Plain Layout
5566 You have now unpacked the package and have all files to install it.
5567 Most LaTeX-packages are not packed and you can skip this step.
5570 \begin_layout Enumerate
5571 Now you need to decide if the package should be available for all users
5576 \begin_layout Enumerate
5577 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5578 for all users on your system, then install it in your `local' TeX tree,
5579 otherwise install it in your own `user' TeX tree.
5580 Where these trees should be created, if they do not already exist, depends
5582 To find this out, look in the file
5583 \begin_inset Flex Code
5586 \begin_layout Plain Layout
5596 \begin_layout Plain Layout
5597 This is usually in the directory
5598 \begin_inset Flex Code
5601 \begin_layout Plain Layout
5607 , though you can execute the command
5608 \begin_inset Flex Code
5611 \begin_layout Plain Layout
5622 The location of the `local' TeX tree is defined by the
5623 \begin_inset Flex Code
5626 \begin_layout Plain Layout
5632 variable; this is usually somewhere like
5633 \begin_inset Flex Code
5636 \begin_layout Plain Layout
5637 /usr/local/share/texmf
5643 The location of the `user' TeX tree is defined by
5644 \begin_inset Flex Code
5647 \begin_layout Plain Layout
5654 \begin_inset Flex Code
5657 \begin_layout Plain Layout
5664 (If these variables are not predefined, you have to define them.) You'll
5665 probably need root permissions to create or modify the `local' tree, but
5666 not for your `user' tree.
5667 \begin_inset Newline newline
5670 In general, it is recommended to install in the user tree because your user
5671 will not be modified or even overwritten when you upgrade your system.
5672 It will typically also be backed up together with everything else when
5673 you backup your home directory (which, of course, you do on a regular basis).
5676 \begin_layout Enumerate
5677 On Windows, if you want the new package to be available for all users on
5678 your system, change to the folder where LaTeX is installed and then change
5680 \begin_inset Flex Code
5683 \begin_layout Plain Layout
5694 (For MiKTeX, this would be by default the folder
5695 \begin_inset Flex Code
5698 \begin_layout Plain Layout
5716 \begin_layout Plain Layout
5717 Note that this will be the correct path only on English installations.
5718 On a German one, it would be
5719 \begin_inset Flex Code
5722 \begin_layout Plain Layout
5736 , and similarly for other languages.
5741 Create there a new folder
5742 \begin_inset Flex Code
5745 \begin_layout Plain Layout
5751 and copy all files of the package into it.
5753 \begin_inset Newline newline
5756 If the package should only available for you or you don't have admin permissions
5757 , do the same, but in the local LaTeX folder.
5759 \begin_inset space \thinspace{}
5763 \begin_inset space ~
5766 2.8 under Windows XP, this would be the folder:
5767 \begin_inset Newline newline
5773 \begin_inset Flex Code
5776 \begin_layout Plain Layout
5779 Documents and Settings
5791 \begin_inset Newline newline
5797 \begin_inset Phantom HPhantom
5800 \begin_layout Plain Layout
5811 \begin_inset Flex Code
5814 \begin_layout Plain Layout
5827 \begin_inset Newline newline
5830 On Vista, it would be:
5831 \begin_inset Newline newline
5835 \begin_inset Flex Code
5838 \begin_layout Plain Layout
5864 \begin_layout Enumerate
5865 Now one only need to tell LaTeX that there are new files.
5866 This depends on the used LaTeX-Distribution:
5870 \begin_layout Enumerate
5871 For TeXLive execute the command
5872 \begin_inset Flex Code
5875 \begin_layout Plain Layout
5882 If you installed the package for all users, then you will probably need
5883 to have root permissions for that.
5886 \begin_layout Enumerate
5887 For MiKTeX, if you have installed the package for all users, start the program
5889 \begin_inset Quotes eld
5893 \begin_inset space ~
5897 \begin_inset Quotes erd
5900 and press the button marked
5901 \begin_inset Quotes eld
5905 \begin_inset Quotes erd
5909 Otherwise start the program
5910 \begin_inset Quotes eld
5914 \begin_inset Quotes erd
5921 \begin_layout Enumerate
5922 Finally, you need to tell LyX that there are new packages available.
5923 So, in LyX, use the menu
5924 \begin_inset Flex MenuItem
5927 \begin_layout Plain Layout
5930 \SpecialChar \menuseparator
5936 and then restart LyX.
5939 \begin_layout Standard
5940 Now the package is installed.
5941 In our example, the document class
5942 \begin_inset Flex Code
5945 \begin_layout Plain Layout
5947 \begin_inset space ~
5954 \begin_layout Plain Layout
5966 will now be available under
5967 \begin_inset Flex MenuItem
5970 \begin_layout Plain Layout
5971 Document\SpecialChar \menuseparator
5972 Settings\SpecialChar \menuseparator
5982 \begin_layout Standard
5983 If you would like to use a LaTeX document class that is not even listed
5985 \begin_inset Flex MenuItem
5988 \begin_layout Plain Layout
5989 Document\SpecialChar \menuseparator
5990 Settings\SpecialChar \menuseparator
5996 , then you need to create a `layout' file for it.
5997 That is the topic of the next section.
6000 \begin_layout Section
6001 Types of layout files
6004 \begin_layout Standard
6005 This section describes the various sorts of LyX files that contain layout
6007 These files describe various paragraph and character styles, determining
6008 how LyX should display them and how they should be translated into LaTeX,
6009 DocBook, XHTML, or whatever output format is being used.
6013 \begin_layout Standard
6014 We shall try to provide a thorough description of the process of writing
6016 However, there are so many different types of documents supported even
6017 by just LaTeX that we can't hope to cover every different possibility or
6018 problem you might encounter.
6019 The LyX users' list is frequented by people with lots of experience with
6020 layout design who are willing to share what they've learned, so please
6021 feel free to ask questions there.
6024 \begin_layout Standard
6025 As you prepare to write a new layout, it is extremely helpful to look at
6026 the layouts distributed with LyX.
6027 If you write a LyX layout for a LaTeX document class that might also be
6028 used by others, or write a module that might be useful to others, then
6029 you should consider posting your layout to the
6030 \begin_inset CommandInset href
6032 name "layout section on the LyX wiki"
6033 target "http://wiki.lyx.org/Layouts/Layouts"
6037 or even to the LyX developers' list, so that it might be included in LyX
6042 \begin_layout Plain Layout
6043 Note that LyX is licensed under the General Public License, so any material
6044 that is contributed to LyX must be similarly licensed.
6052 \begin_layout Subsection
6054 \begin_inset CommandInset label
6056 name "sub:Layout-modules"
6063 \begin_layout Standard
6064 We have spoken to this point about `layout files'.
6065 But there are different sorts of files that contain layout information.
6066 Layout files, strictly so called, have the
6067 \begin_inset Flex Code
6070 \begin_layout Plain Layout
6076 extension and provide LyX with information about document classes.
6077 As of LyX 1.6, however, layout information can also be contained in layout
6083 \begin_inset Flex Code
6086 \begin_layout Plain Layout
6093 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6094 some modules—such as the
6095 \begin_inset Flex Code
6098 \begin_layout Plain Layout
6104 module—specifcally provide support for one package.
6105 In a sense, layout modules are similar to included
6109 \begin_layout Plain Layout
6110 These can have any extension, but by convention have the
6111 \begin_inset Flex Code
6114 \begin_layout Plain Layout
6126 \begin_inset Flex Code
6129 \begin_layout Plain Layout
6135 —in that modules are not specific to a given document class but may be used
6136 with many different classes.
6137 The difference is that using an included file with
6138 \begin_inset Flex Code
6141 \begin_layout Plain Layout
6147 requires editing that file.
6148 Modules, by contrast, are selected in the
6149 \begin_inset Flex MenuItem
6152 \begin_layout Plain Layout
6153 Document\SpecialChar \menuseparator
6162 \begin_layout Standard
6163 Building modules is the easiest way to get started with layout editing,
6164 since it can be as simple as adding a single new paragraph style or flex
6166 But modules may, in principle, contain anything a layout file can contain.
6169 \begin_layout Standard
6170 After creating a new module and copying it to the
6171 \begin_inset Flex Code
6174 \begin_layout Plain Layout
6180 folder, you will need to reconfigure and then restart LyX for the module
6181 to appear in the menu.
6182 However, changes you make to the module will be seen immediately, if you
6184 \begin_inset Flex MenuItem
6187 \begin_layout Plain Layout
6188 Document\SpecialChar \menuseparator
6194 , highlight something, and then hit
6195 \begin_inset Quotes eld
6199 \begin_inset Quotes erd
6205 It is strongly recommended that you save your work before doing this
6210 it is strongly recommended that you not attempt to edit modules while simultaneo
6211 usly working on actual documents
6214 Though of course the developers strive to keep LyX stable in such situations,
6215 syntax errors and the like in your module file could cause strange behavior.
6218 \begin_layout Subsection
6220 \begin_inset Flex MenuItem
6223 \begin_layout Plain Layout
6232 \begin_layout Standard
6233 There are two situations you are likely to encounter when wanting to support
6234 a new LaTeX document class, involving LaTeX2e class (
6235 \begin_inset Flex Code
6238 \begin_layout Plain Layout
6245 \begin_inset Flex Code
6248 \begin_layout Plain Layout
6255 Supporting a style file is usually fairly easy.
6256 Supporting a new class file is a bit harder.
6257 We'll discuss the former in this section and the latter in the next.
6258 Similar remarks apply, of course, if you want to support a new DocBook
6262 \begin_layout Standard
6263 The easier case is the one in which your new document class is provided
6264 as a style file that is to be used in conjunction with an already supported
6266 For the sake of the example, we'll assume that the style file is called
6268 \begin_inset Flex MenuItem
6271 \begin_layout Plain Layout
6277 and that it is meant to be used with
6278 \begin_inset Flex MenuItem
6281 \begin_layout Plain Layout
6287 , which is a standard class.
6291 \begin_layout Standard
6292 Start by copying the existing class's layout file into your local directory:
6296 \begin_layout Plain Layout
6297 Of course, which directory is your local directory will vary by platform,
6298 and LyX allows you to specify your local directory on startup, too, using
6300 \begin_inset Flex Code
6303 \begin_layout Plain Layout
6317 \begin_layout LyX-Code
6318 cp report.layout ~/.lyx/layouts/myclass.layout
6321 \begin_layout Standard
6323 \begin_inset Flex Code
6326 \begin_layout Plain Layout
6332 and change the line:
6335 \begin_layout LyX-Code
6338 DeclareLaTeXClass{report}
6341 \begin_layout Standard
6345 \begin_layout LyX-Code
6348 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6351 \begin_layout Standard
6355 \begin_layout LyX-Code
6357 \begin_inset Newline newline
6363 \begin_inset Newline newline
6369 \begin_layout Standard
6370 near the top of the file.
6373 \begin_layout Standard
6374 Start LyX and select
6375 \begin_inset Flex MenuItem
6378 \begin_layout Plain Layout
6379 Tools\SpecialChar \menuseparator
6386 Then restart LyX and try creating a new document.
6388 \begin_inset Flex MenuItem
6391 \begin_layout Plain Layout
6397 " as a document class option in the
6398 \begin_inset Flex MenuItem
6401 \begin_layout Plain Layout
6402 Document\SpecialChar \menuseparator
6409 It is likely that some of the sectioning commands and such in your new
6410 class will work differently from how they worked in the base class—
6411 \begin_inset Flex Code
6414 \begin_layout Plain Layout
6420 in this example—so you can fiddle around with the settings for the different
6421 sections if you wish.
6422 The layout information for sections is contained in
6423 \begin_inset Flex Code
6426 \begin_layout Plain Layout
6432 , but you do not need to copy and change this file.
6433 Instead, you can simply add your changes to your layout file, after the
6435 \begin_inset Flex Code
6438 \begin_layout Plain Layout
6444 , which itself includes
6445 \begin_inset Flex Code
6448 \begin_layout Plain Layout
6455 For example, you might add these lines:
6458 \begin_layout LyX-Code
6462 \begin_layout LyX-Code
6466 \begin_layout LyX-Code
6470 \begin_layout LyX-Code
6474 \begin_layout LyX-Code
6478 \begin_layout Standard
6479 to change the font for chapter headings to sans-serif.
6480 This will override (or, in this case, add to) the existing declaration
6481 for the Chapter style.
6485 \begin_layout Standard
6486 Your new package may also provide commands or environments not present in
6488 In this case, you will want to add these to the layout file.
6490 \begin_inset CommandInset ref
6492 reference "sec:TextClass"
6496 for information on how to do so.
6499 \begin_layout Standard
6501 \begin_inset Flex MenuItem
6504 \begin_layout Plain Layout
6510 can be used with several different document classes, and even if it cannot,
6511 you might find it easiest just to write a module that you can load with
6513 The simplest possible such module would be:
6516 \begin_layout LyX-Code
6519 DeclareLyXModule{My Package}
6522 \begin_layout LyX-Code
6526 \begin_layout LyX-Code
6527 #Support for mypkg.sty.
6530 \begin_layout LyX-Code
6532 \begin_inset Newline newline
6538 \begin_layout LyX-Code
6540 \begin_inset Newline newline
6546 \begin_layout LyX-Code
6548 \begin_inset Newline newline
6554 \begin_inset Newline newline
6560 \begin_layout Standard
6561 A more complex module might modify the behavior of some existing constructs
6562 or define some new ones.
6564 \begin_inset CommandInset ref
6566 reference "sec:TextClass"
6573 \begin_layout Subsection
6575 \begin_inset Flex MenuItem
6578 \begin_layout Plain Layout
6587 \begin_layout Standard
6588 There are two possibilities here.
6589 One is that the class file is itself based upon an existing document class.
6590 For example, many thesis classes are based upon
6591 \begin_inset Flex MenuItem
6594 \begin_layout Plain Layout
6601 To see whether yours is, look for a line like
6604 \begin_layout LyX-Code
6610 \begin_layout Standard
6612 If so, then you may proceed largely as in the previous section, though
6614 \begin_inset Flex Code
6617 \begin_layout Plain Layout
6623 line will be different.
6624 If your new class is
6625 \begin_inset Flex Code
6628 \begin_layout Plain Layout
6634 and it is based upon
6635 \begin_inset Flex Code
6638 \begin_layout Plain Layout
6644 , then the line should read:
6648 \begin_layout Plain Layout
6649 And it will be easiest if you save the file to
6650 \begin_inset Flex Code
6653 \begin_layout Plain Layout
6659 : LyX assumes that the document class has the same name as the layout file.
6668 \begin_layout LyX-Code
6671 DeclareLaTeXClass[thesis,book]{thesis}
6674 \begin_layout Standard
6675 If, on the other hand, the new class is not based upon an existing class,
6676 you will probably have to
6677 \begin_inset Quotes eld
6681 \begin_inset Quotes erd
6685 We strongly suggest copying an existing layout file which uses a similar
6686 LaTeX class and then modifying it, if you can do so.
6687 At least use an existing file as a starting point so you can find out what
6688 items you need to worry about.
6689 Again, the specifics are covered below.
6692 \begin_layout Subsection
6694 \begin_inset CommandInset label
6696 name "sub:Creating-Templates"
6703 \begin_layout Standard
6704 Once you have written a layout file for a new document class, you might
6705 want to consider writing a
6710 A template acts as a kind of tutorial for your layout, showing how it might
6711 be used, though containing dummy content.
6712 You can of course look at the various templates included with LyX for ideas.
6715 \begin_layout Standard
6716 Templates are created just like usual documents: using LyX.
6717 The only difference is that usual documents contain all possible settings,
6718 including the font scheme and the paper size.
6719 Usually a user doesn't want a template to overwrite his preferred settings
6720 for such parameters.
6721 For that reason, the designer of a template should remove the corresponding
6723 \begin_inset Flex Code
6726 \begin_layout Plain Layout
6735 \begin_inset Flex Code
6738 \begin_layout Plain Layout
6746 from the template LyX file.
6747 This can be done with any simple text-editor, for example
6748 \begin_inset Flex Code
6751 \begin_layout Plain Layout
6758 \begin_inset Flex Code
6761 \begin_layout Plain Layout
6771 \begin_layout Standard
6772 Put the edited template files you create in
6773 \begin_inset Flex Code
6776 \begin_layout Plain Layout
6782 , copy the ones you use from the global template directory in
6783 \begin_inset Flex Code
6786 \begin_layout Plain Layout
6792 to the same place, and redefine the template path in the
6793 \begin_inset Flex MenuItem
6796 \begin_layout Plain Layout
6797 Tools\SpecialChar \menuseparator
6798 Preferences\SpecialChar \menuseparator
6807 \begin_layout Standard
6808 Note, by the way, that there is a template which has a particular meaning:
6810 \begin_inset Flex Code
6813 \begin_layout Plain Layout
6820 This template is loaded every time you create a new document with
6821 \begin_inset Flex MenuItem
6824 \begin_layout Plain Layout
6825 File\SpecialChar \menuseparator
6831 in order to provide useful defaults.
6832 To create this template from inside LyX, all you have to do is to open
6833 a document with the correct settings, and use the
6834 \begin_inset Flex MenuItem
6837 \begin_layout Plain Layout
6838 Save as Document Defaults
6846 \begin_layout Subsection
6847 Upgrading old layout files
6850 \begin_layout Standard
6851 The format of layout files changes with each LyX release, so old layout
6852 files need to be converted to the new format.
6853 This process has been automated since LyX 1.4: If LyX reads a layout file
6854 in an older format, it automatically calls the script
6855 \begin_inset Flex Code
6858 \begin_layout Plain Layout
6864 to convert it to a temporary file in current format.
6865 The original file is left untouched.
6866 If you use the layout file often, then, you may want to convert it permanently,
6867 so that LyX does not have to do so itself every time.
6868 To do this, you can call the converter manually:
6871 \begin_layout LyX-Code
6872 mv myclass.layout myclass.old
6875 \begin_layout LyX-Code
6876 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6879 \begin_layout Standard
6881 \begin_inset Flex Code
6884 \begin_layout Plain Layout
6890 with the name of your LyX system directory, of course.
6893 \begin_layout Standard
6894 Note that manual conversion does not affect included files, so these will
6895 have to be converted separately.
6898 \begin_layout Section
6899 \begin_inset CommandInset label
6901 name "sec:TextClass"
6905 The layout file format
6908 \begin_layout Standard
6909 When it's finally time to get your hands dirty and create or edit your own
6910 layout file, the following sections describe what you're up against.
6911 Our advice is to go slowly, save and test often, listen to soothing music,
6912 and enjoy one or two of your favorite adult beverages; more if you are
6913 getting particularly stuck.
6914 It's really not that hard, except that the multitude of options can become
6915 overwhelming if you try to do too much in one sitting.
6916 Go have another adult beverage, just for good measure.
6919 \begin_layout Standard
6920 Note that all the tags used in layout files are case-insensitive.
6922 \begin_inset Flex Code
6925 \begin_layout Plain Layout
6932 \begin_inset Flex Code
6935 \begin_layout Plain Layout
6942 \begin_inset Flex Code
6945 \begin_layout Plain Layout
6951 are really the same tag.
6952 The possible values are printed in brackets after the feature's name.
6953 The default value if a feature isn't specified inside a text class-description
6955 \begin_inset Flex Code
6958 \begin_layout Plain Layout
6967 If the argument has a data type like
6968 \begin_inset Quotes eld
6972 \begin_inset Quotes erd
6976 \begin_inset Quotes eld
6980 \begin_inset Quotes erd
6983 , the default is shown like this:
6984 \begin_inset Flex Code
6987 \begin_layout Plain Layout
6998 \begin_layout Subsection
6999 The document class declaration
7002 \begin_layout Standard
7003 Lines in a layout file which begin with
7004 \begin_inset Flex Code
7007 \begin_layout Plain Layout
7014 There is one exception to this rule.
7016 \begin_inset Flex Code
7019 \begin_layout Plain Layout
7025 files should begin with a line like:
7028 \begin_layout LyX-Code
7031 #% Do not delete the line below; configure depends on this
7034 \begin_layout LyX-Code
7039 DeclareLaTeXClass{article}
7042 \begin_layout Standard
7043 The second line is used when you (re)configure LyX.
7044 The layout file is read by the LaTeX script
7045 \begin_inset Flex Code
7048 \begin_layout Plain Layout
7054 , in a special mode where
7055 \begin_inset Flex Code
7058 \begin_layout Plain Layout
7065 The first line is just a LaTeX comment, and the second one contains the
7066 declaration of the text class.
7067 If these lines appear in a file named
7068 \begin_inset Flex Code
7071 \begin_layout Plain Layout
7077 , then they define a text class of name
7078 \begin_inset Flex Code
7081 \begin_layout Plain Layout
7087 (the name of the layout file) which uses the LaTeX document class
7088 \begin_inset Flex Code
7091 \begin_layout Plain Layout
7097 (the default is to use the same name as the layout).
7099 \begin_inset Quotes eld
7103 \begin_inset Quotes erd
7106 that appears above is used as a description of the text class in the
7107 \begin_inset Flex MenuItem
7110 \begin_layout Plain Layout
7111 Document\SpecialChar \menuseparator
7120 \begin_layout Standard
7121 Let's assume that you wrote your own text class that uses the
7122 \begin_inset Flex Code
7125 \begin_layout Plain Layout
7131 document class, but where you changed the appearance of the section headings.
7132 If you put it in a file
7133 \begin_inset Flex Code
7136 \begin_layout Plain Layout
7142 , the header of this file should be:
7145 \begin_layout LyX-Code
7148 #% Do not delete the line below; configure depends on this
7151 \begin_layout LyX-Code
7156 DeclareLaTeXClass[article]{article (with my own headings)}
7159 \begin_layout Standard
7160 This declares a text class
7161 \begin_inset Flex Code
7164 \begin_layout Plain Layout
7170 , associated with the LaTeX document class
7171 \begin_inset Flex Code
7174 \begin_layout Plain Layout
7181 \begin_inset Quotes eld
7184 article (with my own headings)
7185 \begin_inset Quotes erd
7189 If your text class depends on several packages, you can declare it as:
7192 \begin_layout LyX-Code
7195 #% Do not delete the line below; configure depends on this
7198 \begin_layout LyX-Code
7203 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7206 \begin_layout Standard
7207 This indicates that your text class uses the
7208 \begin_inset Flex Code
7211 \begin_layout Plain Layout
7218 Finally, it is also possible to declare classes for DocBook code.
7219 Typical declarations will look like:
7222 \begin_layout LyX-Code
7225 #% Do not delete the line below; configure depends on this
7228 \begin_layout LyX-Code
7233 DeclareDocBookClass[article]{SGML (DocBook article)}
7236 \begin_layout Standard
7237 Note that these declarations can also be given an optional parameter declaring
7238 the name of the document class (but not a list).
7241 \begin_layout Standard
7242 So, to be as explicit as possible, the form of the layout declaration is:
7245 \begin_layout LyX-Code
7250 DeclareLaTeXClass[class,package.sty]{layout description}
7253 \begin_layout Standard
7254 The class need only be specified if the name of the LaTeX class file and
7255 the name of the layout file are different or if there are packages to load.
7256 If the name of the class file is not specified, then LyX will simply assume
7257 that it is the same as the name of the layout file.
7260 \begin_layout Standard
7261 When the text class has been modified to your taste, all you have to do
7262 is to copy it either to
7263 \begin_inset Flex Code
7266 \begin_layout Plain Layout
7273 \begin_inset Flex Code
7276 \begin_layout Plain Layout
7283 \begin_inset Flex MenuItem
7286 \begin_layout Plain Layout
7287 Tools\SpecialChar \menuseparator
7293 , exit LyX and restart.
7294 Then your new text class should be available along with the others.
7297 \begin_layout Standard
7298 Once the layout file is installed, you can edit it and see your changes
7299 without having to reconfigure or to restart LyX.
7304 \begin_layout Plain Layout
7305 In versions of LyX prior to 1.6, this was not true.
7306 As a result, editing layout files was very time consuming, since you had
7307 constantly to restart LyX to see changes.
7312 You can force a reload of the current layout by using the LyX function
7314 \begin_inset Flex MenuItem
7317 \begin_layout Plain Layout
7324 There is no default binding for this function—though, of course, you can
7325 bind it to a key yourself.
7326 But you will normally use this function simply by entering it in the mini-buffe
7331 \begin_layout Standard
7337 \begin_inset Flex MenuItem
7340 \begin_layout Plain Layout
7346 is very much an `advanced feature'.
7351 recommended that you save your work before using this function.
7356 recommended that you not attempt to edit layout information while simultaneousl
7357 y working on a document that you care about.
7358 Use a test document.
7359 Syntax errors and the like in your layout file could cause peculiar behavior.
7360 In particular, such errors could cause LyX to regard the current layout
7361 as invalid and to attempt to switch to some other layout.
7365 \begin_layout Plain Layout
7366 Really bad syntax errors may even caused LyX to exit.
7367 This is because certain sorts of errors may make LyX unable to read
7377 The LyX team strives to keep LyX stable in such situations, but safe is
7382 \begin_layout Plain Layout
7383 While we're giving advice: make regular backups.
7384 And be nice to your mother.
7392 \begin_layout Subsection
7393 The Module declaration
7396 \begin_layout Standard
7397 A module must begin with a line like the following:
7400 \begin_layout LyX-Code
7403 DeclareLyXModule[endnotes.sty]{Endnotes}
7406 \begin_layout Standard
7407 The mandatory argument, in curly brackets, is the name of the module, as
7409 \begin_inset Flex MenuItem
7412 \begin_layout Plain Layout
7413 Document\SpecialChar \menuseparator
7420 The argument in square brackets is optional: It declares any LaTeX packages
7421 on which the module depends.
7422 Please note that only packages about which LyX knows should be listed in
7423 the square brackets.
7427 \begin_layout Plain Layout
7428 The list of such packages is documented only in the source code.
7433 LyX will not check for arbitrary packages.
7434 It is also possible to use the form
7435 \begin_inset Flex MenuItem
7438 \begin_layout Plain Layout
7444 as an optional argument, which declares that the module can only be used
7445 when there exists a conversion chain between the formats `
7446 \begin_inset Flex Code
7449 \begin_layout Plain Layout
7456 \begin_inset Flex Code
7459 \begin_layout Plain Layout
7468 \begin_layout Standard
7469 The module declaration should then be followed by lines like the following:
7472 \begin_layout LyX-Code
7476 \begin_layout LyX-Code
7477 #Adds an endnote command, in addition to footnotes.
7481 \begin_layout LyX-Code
7482 #You will need to add
7484 theendnotes in TeX code where you
7487 \begin_layout LyX-Code
7488 #want the endnotes to appear.
7492 \begin_layout LyX-Code
7496 \begin_layout LyX-Code
7497 #Requires: somemodule | othermodule
7500 \begin_layout LyX-Code
7501 #Excludes: badmodule
7504 \begin_layout Standard
7505 The description is used in
7506 \begin_inset Flex MenuItem
7509 \begin_layout Plain Layout
7510 Document\SpecialChar \menuseparator
7516 to provide the user with information about what the module does.
7518 \begin_inset Flex Code
7521 \begin_layout Plain Layout
7527 line is used to identify other modules with which this one must be used;
7529 \begin_inset Flex Code
7532 \begin_layout Plain Layout
7538 line is used to identify modules with which this one may not be used.
7539 Both are optional, and, as shown, multiple modules should be separated
7540 with the pipe symbol: |.
7541 Note that the required modules are treated disjunctively:
7545 of the required modules must be used.
7550 excluded module may be used.
7551 Note that modules are identified here by their
7556 \begin_inset Flex Code
7559 \begin_layout Plain Layout
7567 \begin_inset Flex Code
7570 \begin_layout Plain Layout
7577 \begin_inset Flex Code
7580 \begin_layout Plain Layout
7589 \begin_layout Subsection
7593 \begin_layout Standard
7594 The first non-comment line of any layout file, included file, or module
7599 contain the file format number:
7602 \begin_layout Description
7603 \begin_inset Flex Code
7606 \begin_layout Plain Layout
7613 \begin_inset Flex Code
7616 \begin_layout Plain Layout
7622 ] The format of the layout file.
7625 \begin_layout Standard
7626 This tag was introduced with LyX 1.4.0.
7627 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7628 and are considered to be of format 1.
7629 The format for the present version of LyX is format 21.
7630 But each version of LyX is capable of reading earlier versions' layout
7631 files, just as they are capable of reading files produced by earlier versions
7633 There is, however, no provision for converting to earlier formats.
7634 So LyX 1.6.x will not read layout files in format 21 but only files in format
7638 \begin_layout Subsection
7639 \begin_inset CommandInset label
7641 name "sub:General-text-class"
7645 General text class parameters
7648 \begin_layout Standard
7649 These are general parameters that govern the behavior of an entire document
7655 mean that they must appear in
7656 \begin_inset Flex Code
7659 \begin_layout Plain Layout
7665 files rather than in modules.
7666 A module can contain any layout tag.)
7669 \begin_layout Description
7670 \begin_inset Flex Code
7673 \begin_layout Plain Layout
7679 Adds information that will be output in the
7680 \begin_inset Flex Code
7683 \begin_layout Plain Layout
7689 block when this document class is output to XHTML.
7690 Typically, this would be used to output CSS style information, but it can
7691 be used for anything that can appear in
7692 \begin_inset Flex Code
7695 \begin_layout Plain Layout
7703 \begin_inset Quotes eld
7707 \begin_inset Flex Code
7710 \begin_layout Plain Layout
7717 \begin_inset Quotes erd
7723 \begin_layout Description
7724 \begin_inset Flex Code
7727 \begin_layout Plain Layout
7733 Adds information to the document preamble.
7735 \begin_inset Quotes eld
7739 \begin_inset Flex Code
7742 \begin_layout Plain Layout
7749 \begin_inset Quotes erd
7755 \begin_layout Description
7756 \begin_inset Flex Code
7759 \begin_layout Plain Layout
7765 Defines formats for use in the display of bibliographic information.
7767 \begin_inset CommandInset ref
7769 reference "sub:Citation-format-description"
7775 \begin_inset Quotes eld
7779 \begin_inset Flex Code
7782 \begin_layout Plain Layout
7789 \begin_inset Quotes erd
7795 \begin_layout Description
7796 \begin_inset Flex Code
7799 \begin_layout Plain Layout
7805 Describes various global options supported by the document class.
7807 \begin_inset space ~
7811 \begin_inset CommandInset ref
7813 reference "sub:ClassOptions"
7819 \begin_inset Quotes eld
7823 \begin_inset Flex Code
7826 \begin_layout Plain Layout
7833 \begin_inset Quotes erd
7839 \begin_layout Description
7840 \begin_inset Flex Code
7843 \begin_layout Plain Layout
7850 \begin_inset Flex Code
7853 \begin_layout Plain Layout
7862 \begin_inset Flex Code
7865 \begin_layout Plain Layout
7871 ] Whether the class should
7875 to having one or two columns.
7876 Can be changed in the
7877 \begin_inset Flex MenuItem
7880 \begin_layout Plain Layout
7881 Document\SpecialChar \menuseparator
7890 \begin_layout Description
7891 \begin_inset Flex Code
7894 \begin_layout Plain Layout
7901 \begin_inset Flex Code
7904 \begin_layout Plain Layout
7910 ] This sequence defines the properties for a counter.
7911 If the counter does not yet exist, it is created; if it does exist, it
7914 \begin_inset Quotes eld
7918 \begin_inset Flex Code
7921 \begin_layout Plain Layout
7928 \begin_inset Quotes erd
7932 \begin_inset Newline newline
7936 \begin_inset space ~
7940 \begin_inset CommandInset ref
7942 reference "sub:Counters"
7946 for details on counters.
7949 \begin_layout Description
7950 \begin_inset Flex Code
7953 \begin_layout Plain Layout
7959 Sets the default font used to display the document.
7961 \begin_inset space ~
7965 \begin_inset CommandInset ref
7967 reference "sub:Font-description"
7971 for how to declare fonts.
7973 \begin_inset Quotes eld
7977 \begin_inset Flex Code
7980 \begin_layout Plain Layout
7987 \begin_inset Quotes erd
7993 \begin_layout Description
7994 \begin_inset Flex Code
7997 \begin_layout Plain Layout
8004 \begin_inset Flex Code
8007 \begin_layout Plain Layout
8013 Specifies a module to be included by default with this document class.
8014 The module should be specified by filename without the
8015 \begin_inset Flex Code
8018 \begin_layout Plain Layout
8025 The user can still remove the module, but it will be active at the outset.
8026 (This applies only when new files are created, or when this class is chosen
8027 for an existing document.)
8030 \begin_layout Description
8031 \begin_inset Flex Code
8034 \begin_layout Plain Layout
8041 \begin_inset Flex Code
8044 \begin_layout Plain Layout
8050 ] This is the style that will be assigned to new paragraphs, usually
8051 \begin_inset Flex MenuItem
8054 \begin_layout Plain Layout
8061 This will default to the first defined style if not given, but you are
8062 encouraged to use this directive.
8065 \begin_layout Description
8066 \begin_inset Flex Code
8069 \begin_layout Plain Layout
8076 \begin_inset Flex Code
8079 \begin_layout Plain Layout
8085 ] This tag indicates that the module in question—which should be specified
8086 by filename without the
8087 \begin_inset Flex Code
8090 \begin_layout Plain Layout
8096 extension—cannot be used with this document class.
8097 This might be used in a journal-specific layout file to prevent, say, the
8099 \begin_inset Flex Code
8102 \begin_layout Plain Layout
8108 module that numbers theorems by section.
8113 be used in a module.
8114 Modules have their own way of excluding other modules (see
8115 \begin_inset CommandInset ref
8117 reference "sub:Layout-modules"
8124 \begin_layout Description
8125 \begin_inset Flex Code
8128 \begin_layout Plain Layout
8134 Defines a new float.
8136 \begin_inset space ~
8140 \begin_inset CommandInset ref
8142 reference "sub:Floats"
8148 \begin_inset Quotes eld
8152 \begin_inset Flex Code
8155 \begin_layout Plain Layout
8162 \begin_inset Quotes erd
8168 \begin_layout Description
8169 \begin_inset Flex Code
8172 \begin_layout Plain Layout
8178 Sets the information that will be output in the
8179 \begin_inset Flex Code
8182 \begin_layout Plain Layout
8188 block when this document class is output to XHTML.
8189 Note that this will completely override any prior
8190 \begin_inset Flex Code
8193 \begin_layout Plain Layout
8200 \begin_inset Flex Code
8203 \begin_layout Plain Layout
8211 \begin_inset Flex Code
8214 \begin_layout Plain Layout
8220 if you just want to add material to the preamble.) Must end with
8221 \begin_inset Quotes eld
8225 \begin_inset Flex Code
8228 \begin_layout Plain Layout
8235 \begin_inset Quotes erd
8241 \begin_layout Description
8242 \begin_inset Flex Code
8245 \begin_layout Plain Layout
8252 \begin_inset Flex Code
8255 \begin_layout Plain Layout
8261 ] The layout to use for the table of contents, bibliography, and so forth,
8262 when the document is output to HTML.
8263 For articles, this should normally be Section; for books, Chapter.
8264 If it is not given, then LyX will attempt to figure out which layout to
8268 \begin_layout Description
8269 \begin_inset Flex Code
8272 \begin_layout Plain Layout
8279 \begin_inset Flex Code
8282 \begin_layout Plain Layout
8288 ] Modifies the properties of the given counter.
8289 If the counter does not exist, the section is ignored.
8291 \begin_inset Quotes eld
8295 \begin_inset Flex Code
8298 \begin_layout Plain Layout
8305 \begin_inset Quotes erd
8309 \begin_inset Newline newline
8313 \begin_inset space ~
8317 \begin_inset CommandInset ref
8319 reference "sub:Counters"
8323 for details on counters.
8326 \begin_layout Description
8327 \begin_inset Flex Code
8330 \begin_layout Plain Layout
8337 \begin_inset Flex Code
8340 \begin_layout Plain Layout
8346 ] Modifies the properties of the given paragraph style.
8347 If the style does not exist, the section is ignored.
8349 \begin_inset Quotes eld
8353 \begin_inset Flex Code
8356 \begin_layout Plain Layout
8363 \begin_inset Quotes erd
8369 \begin_layout Description
8370 \begin_inset Flex Code
8373 \begin_layout Plain Layout
8379 As its name implies, this command allows you to include another layout
8380 definition file within yours to avoid duplicating commands.
8381 Common examples are the standard layout files, for example,
8382 \begin_inset Flex Code
8385 \begin_layout Plain Layout
8391 , which contains most of the basic layouts.
8394 \begin_layout Description
8395 \begin_inset Flex Code
8398 \begin_layout Plain Layout
8404 This section (re-)defines the layout of an inset.
8405 It can be applied to an existing inset or to a new, user-defined inset,
8406 e.g., a new character style.
8408 \begin_inset Quotes eld
8412 \begin_inset Flex Code
8415 \begin_layout Plain Layout
8422 \begin_inset Quotes erd
8426 \begin_inset Newline newline
8430 \begin_inset space ~
8434 \begin_inset CommandInset ref
8436 reference "sub:Flex-insets-and"
8440 for more information.
8444 \begin_layout Description
8445 \begin_inset Flex Code
8448 \begin_layout Plain Layout
8455 \begin_inset Flex Code
8458 \begin_layout Plain Layout
8464 ] A string that indicates the width of the left margin on the screen, for
8466 \begin_inset Quotes eld
8470 \begin_inset Quotes erd
8474 (Note that this is not a `length', like
8475 \begin_inset Quotes eld
8479 \begin_inset Quotes erd
8485 \begin_layout Description
8486 \begin_inset Flex Code
8489 \begin_layout Plain Layout
8495 This command deletes an existing float.
8496 This is particularly useful when you want to suppress a float that has
8497 been defined in an input file.
8500 \begin_layout Description
8501 \begin_inset Flex Code
8504 \begin_layout Plain Layout
8510 This command deletes an existing style.
8511 This is particularly useful when you want to suppress a style that has
8512 be defined in an input file.
8515 \begin_layout Description
8516 \begin_inset Flex Code
8519 \begin_layout Plain Layout
8525 A string indicating the file format (as defined in the Preferences dialog)
8526 produced by this class.
8527 It is mainly useful when
8528 \begin_inset Flex Code
8531 \begin_layout Plain Layout
8537 is `literate' and one wants to define a new type of literate document.
8538 This string is reset to `docbook', `latex', or `literate' when the correspondin
8540 \begin_inset Flex Code
8543 \begin_layout Plain Layout
8549 parameter is encountered.
8552 \begin_layout Description
8553 \begin_inset Flex Code
8556 \begin_layout Plain Layout
8562 A string indicating what sort of output documents using this class will
8564 At present, the options are: `docbook', `latex', and `literate'.
8567 \begin_layout Description
8568 \begin_inset Flex Code
8571 \begin_layout Plain Layout
8578 \begin_inset Flex Code
8581 \begin_layout Plain Layout
8590 \begin_inset Flex Code
8593 \begin_layout Plain Layout
8600 \begin_inset Flex Code
8603 \begin_layout Plain Layout
8609 ] The default pagestyle.
8610 Can be changed in the
8611 \begin_inset Flex MenuItem
8614 \begin_layout Plain Layout
8615 Document\SpecialChar \menuseparator
8624 \begin_layout Description
8625 \begin_inset Flex Code
8628 \begin_layout Plain Layout
8634 Sets the preamble for the LaTeX document.
8635 Note that this will completely override any prior
8636 \begin_inset Flex Code
8639 \begin_layout Plain Layout
8646 \begin_inset Flex Code
8649 \begin_layout Plain Layout
8657 \begin_inset Flex Code
8660 \begin_layout Plain Layout
8666 if you just want to add material to the preamble.) Must end with
8667 \begin_inset Quotes eld
8671 \begin_inset Flex Code
8674 \begin_layout Plain Layout
8681 \begin_inset Quotes erd
8687 \begin_layout Description
8688 \begin_inset Flex Code
8691 \begin_layout Plain Layout
8698 \begin_inset Flex Code
8701 \begin_layout Plain Layout
8708 \begin_inset Flex Code
8711 \begin_layout Plain Layout
8720 \begin_inset Flex Code
8723 \begin_layout Plain Layout
8729 ] Whether the class already provides the feature
8730 \begin_inset Flex Code
8733 \begin_layout Plain Layout
8740 A feature is in general the name of a package (
8741 \begin_inset Flex Code
8744 \begin_layout Plain Layout
8751 \begin_inset Flex Code
8754 \begin_layout Plain Layout
8760 , \SpecialChar \ldots{}
8762 \begin_inset Flex Code
8765 \begin_layout Plain Layout
8772 \begin_inset Flex Code
8775 \begin_layout Plain Layout
8781 ,\SpecialChar \ldots{}
8782 ); the complete list of supported features is unfortunately not documented
8783 outside the LyX source code—but see
8784 \begin_inset Flex Code
8787 \begin_layout Plain Layout
8793 if you're interested.
8795 \begin_inset Flex MenuItem
8798 \begin_layout Plain Layout
8799 Help\SpecialChar \menuseparator
8805 also gives an overview of the supported packages.
8808 \begin_layout Description
8809 \begin_inset Flex Code
8812 \begin_layout Plain Layout
8819 \begin_inset Flex Code
8822 \begin_layout Plain Layout
8828 ] Indicates that this layout provides the functionality of the module mentioned,
8829 which should be specified by the filename without the
8830 \begin_inset Flex Code
8833 \begin_layout Plain Layout
8840 This will typically be used if the layout includes the module directly,
8841 rather than using the
8842 \begin_inset Flex Code
8845 \begin_layout Plain Layout
8851 tag to indicate that it ought to be used.
8852 It could also be used in a module that provided an alternate implementation
8853 of the same functionality.
8856 \begin_layout Description
8857 \begin_inset Flex Code
8860 \begin_layout Plain Layout
8867 \begin_inset Flex Code
8870 \begin_layout Plain Layout
8876 ] Whether the class requires the feature
8877 \begin_inset Flex Code
8880 \begin_layout Plain Layout
8887 Multiple features must be separated by commas.
8888 Note that you can only request supported features.
8890 \begin_inset Flex Code
8893 \begin_layout Plain Layout
8899 for a list of these.)
8902 \begin_layout Description
8903 \begin_inset Flex Code
8906 \begin_layout Plain Layout
8912 A string that indicates the width of the right margin on the screen, for
8914 \begin_inset Quotes eld
8918 \begin_inset Quotes erd
8924 \begin_layout Description
8925 \begin_inset Flex Code
8928 \begin_layout Plain Layout
8934 Sets which divisions get numbered.
8936 \begin_inset Flex Code
8939 \begin_layout Plain Layout
8948 \begin_layout Description
8949 \begin_inset Flex Code
8952 \begin_layout Plain Layout
8959 \begin_inset Flex Code
8962 \begin_layout Plain Layout
8971 \begin_inset Flex Code
8974 \begin_layout Plain Layout
8980 ] Whether the class-default should be printing on one or both sides of the
8982 Can be changed in the
8983 \begin_inset Flex MenuItem
8986 \begin_layout Plain Layout
8987 Document\SpecialChar \menuseparator
8996 \begin_layout Description
8997 \begin_inset Flex Code
9000 \begin_layout Plain Layout
9006 This sequence defines a paragraph style.
9007 If the style does not yet exist, it is created; if it does exist, its parameter
9010 \begin_inset Quotes eld
9014 \begin_inset Flex Code
9017 \begin_layout Plain Layout
9024 \begin_inset Quotes erd
9028 \begin_inset Newline newline
9032 \begin_inset space ~
9036 \begin_inset CommandInset ref
9038 reference "sub:Paragraph-Styles"
9042 for details on paragraph styles.
9045 \begin_layout Description
9046 \begin_inset Flex Code
9049 \begin_layout Plain Layout
9056 \begin_inset Flex Code
9059 \begin_layout Plain Layout
9065 ] The name of the command or environment to be used with
9066 \begin_inset Flex Code
9069 \begin_layout Plain Layout
9078 \begin_layout Description
9079 \begin_inset Flex Code
9082 \begin_layout Plain Layout
9089 \begin_inset Flex Code
9092 \begin_layout Plain Layout
9101 \begin_inset Flex Code
9104 \begin_layout Plain Layout
9110 ] Indicates what kind of markup is used to define the title of a document.
9112 \begin_inset Flex Code
9115 \begin_layout Plain Layout
9121 means that the macro with name
9122 \begin_inset Flex Code
9125 \begin_layout Plain Layout
9131 will be inserted after the last layout which has
9132 \begin_inset Quotes eld
9136 \begin_inset Flex Code
9139 \begin_layout Plain Layout
9146 \begin_inset Quotes erd
9151 \begin_inset Flex Code
9154 \begin_layout Plain Layout
9160 corresponds to the case where the block of paragraphs which have
9161 \begin_inset Quotes eld
9165 \begin_inset Flex Code
9168 \begin_layout Plain Layout
9175 \begin_inset Quotes erd
9178 should be enclosed into the
9179 \begin_inset Flex Code
9182 \begin_layout Plain Layout
9191 \begin_layout Description
9192 \begin_inset Flex Code
9195 \begin_layout Plain Layout
9201 Sets which divisions are included in the table of contents.
9203 \begin_inset Flex Code
9206 \begin_layout Plain Layout
9215 \begin_layout Subsection
9216 \begin_inset Flex Code
9219 \begin_layout Plain Layout
9226 \begin_inset CommandInset label
9228 name "sub:ClassOptions"
9235 \begin_layout Standard
9237 \begin_inset Flex Code
9240 \begin_layout Plain Layout
9246 section can contain the following entries:
9249 \begin_layout Description
9250 \begin_inset Flex Code
9253 \begin_layout Plain Layout
9260 \begin_inset Flex Code
9263 \begin_layout Plain Layout
9269 ] The list of available font sizes for the document's main font, separated
9271 \begin_inset Quotes eld
9275 \begin_inset Flex Code
9278 \begin_layout Plain Layout
9285 \begin_inset Quotes erd
9291 \begin_layout Description
9292 \begin_inset Flex Code
9295 \begin_layout Plain Layout
9301 Used to set the DTD line with XML-based output classes.
9303 \begin_inset space \thinspace{}
9307 \begin_inset Quotes eld
9310 -//OASIS//DTD DocBook V4.2//EN
9311 \begin_inset Quotes erd
9317 \begin_layout Description
9318 \begin_inset Flex Code
9321 \begin_layout Plain Layout
9328 \begin_inset Flex Code
9331 \begin_layout Plain Layout
9332 string="empty|plain|headings|fancy"
9337 ] The list of available page styles, separated by
9338 \begin_inset Quotes eld
9342 \begin_inset Flex Code
9345 \begin_layout Plain Layout
9352 \begin_inset Quotes erd
9358 \begin_layout Description
9359 \begin_inset Flex Code
9362 \begin_layout Plain Layout
9369 \begin_inset Flex Code
9372 \begin_layout Plain Layout
9378 ] Some document class options, separated by a comma, that will be added
9379 to the optional part of the
9380 \begin_inset Flex Code
9383 \begin_layout Plain Layout
9394 \begin_layout Standard
9396 \begin_inset Flex Code
9399 \begin_layout Plain Layout
9405 section must end with
9406 \begin_inset Quotes eld
9410 \begin_inset Flex Code
9413 \begin_layout Plain Layout
9420 \begin_inset Quotes erd
9426 \begin_layout Subsection
9428 \begin_inset CommandInset label
9430 name "sub:Paragraph-Styles"
9437 \begin_layout Standard
9438 A paragraph style description looks like this:
9442 \begin_layout Plain Layout
9443 Note that this will either define a new layout or modify an existing one.
9451 \begin_layout LyX-Code
9458 \begin_layout LyX-Code
9462 \begin_layout LyX-Code
9466 \begin_layout Standard
9467 where the following commands are allowed:
9470 \begin_layout Description
9471 \begin_inset Flex Code
9474 \begin_layout Plain Layout
9481 \begin_inset Flex Code
9484 \begin_layout Plain Layout
9489 , left, right, center
9494 ] Paragraph alignment.
9497 \begin_layout Description
9498 \begin_inset Flex Code
9501 \begin_layout Plain Layout
9508 \begin_inset Flex Code
9511 \begin_layout Plain Layout
9516 , left, right, center
9521 ] A comma separated list of permitted alignments.
9522 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9524 For example a right-aligned or centered enumeration isn't possible.)
9527 \begin_layout Description
9528 \begin_inset Flex Code
9531 \begin_layout Plain Layout
9537 Note that this will completely override any prior
9538 \begin_inset Flex Code
9541 \begin_layout Plain Layout
9547 declaration for this style.
9549 \begin_inset Quotes eld
9553 \begin_inset Flex Code
9556 \begin_layout Plain Layout
9563 \begin_inset Quotes erd
9568 \begin_inset CommandInset ref
9570 reference "sub:I18n"
9574 for details on its use.
9577 \begin_layout Description
9578 \begin_inset Flex Code
9581 \begin_layout Plain Layout
9588 \begin_inset Flex Code
9591 \begin_layout Plain Layout
9601 \begin_layout Plain Layout
9602 Note that a `float' here is a real number, such as: 1.5.
9607 The vertical space with which the last of a chain of paragraphs with this
9608 layout is separated from the following paragraph.
9609 If the next paragraph has another layout, the separations are not simply
9610 added, but the maximum is taken.
9613 \begin_layout Description
9614 \begin_inset Flex Code
9617 \begin_layout Plain Layout
9624 \begin_inset Flex Code
9627 \begin_layout Plain Layout
9633 The category for this style.
9634 This is used to group related styles in the Layout combobox on the toolbar.
9635 Any string can be used, but you may want to use existing categories with
9640 \begin_layout Description
9641 \begin_inset Flex Code
9644 \begin_layout Plain Layout
9650 Depth of XML command.
9651 Used only with XML-type formats.
9654 \begin_layout Description
9655 \begin_inset Flex Code
9658 \begin_layout Plain Layout
9665 \begin_inset CommandInset label
9667 name "des:CopyStyle"
9672 \begin_inset Flex Code
9675 \begin_layout Plain Layout
9681 Copies all the features of an existing style into the current one.
9685 \begin_layout Description
9686 \begin_inset Flex Code
9689 \begin_layout Plain Layout
9695 The name of a style whose preamble should be output
9700 This allows to ensure some ordering of the preamble snippets when macros
9701 definitions depend on one another.
9705 \begin_layout Plain Layout
9706 Note that, besides that functionality, there is no way to ensure any ordering
9708 The ordering that you see in a given version of LyX may change without
9709 warning in later versions.
9717 \begin_layout Description
9718 \begin_inset Flex Code
9721 \begin_layout Plain Layout
9728 \begin_inset Flex Code
9731 \begin_layout Plain Layout
9736 , Box, Filled_Box, Static
9741 ] The type of label that stands at the end of the paragraph (or sequence
9743 \begin_inset Flex Code
9746 \begin_layout Plain Layout
9753 \begin_inset Flex Code
9756 \begin_layout Plain Layout
9763 \begin_inset Flex Code
9766 \begin_layout Plain Layout
9773 \begin_inset Flex Code
9776 \begin_layout Plain Layout
9784 \begin_inset Flex Code
9787 \begin_layout Plain Layout
9794 \begin_inset Quotes eld
9798 \begin_inset Quotes erd
9802 \begin_inset Flex Code
9805 \begin_layout Plain Layout
9812 \begin_inset Flex Code
9815 \begin_layout Plain Layout
9816 \begin_inset space ~
9825 \begin_inset space ~
9828 black) square suitable for end of proof markers,
9829 \begin_inset Flex Code
9832 \begin_layout Plain Layout
9838 is an explicit text string.
9841 \begin_layout Description
9842 \begin_inset Flex Code
9845 \begin_layout Plain Layout
9852 \begin_inset Flex Code
9855 \begin_layout Plain Layout
9861 ] The string used for a label with a
9862 \begin_inset Flex Code
9865 \begin_layout Plain Layout
9872 \begin_inset Flex Code
9875 \begin_layout Plain Layout
9885 \begin_layout Description
9886 \begin_inset Flex Code
9889 \begin_layout Plain Layout
9896 \begin_inset Flex Code
9899 \begin_layout Plain Layout
9910 \begin_inset Flex Code
9913 \begin_layout Plain Layout
9922 \begin_layout Description
9923 \begin_inset Flex Code
9926 \begin_layout Plain Layout
9933 \begin_inset Flex Code
9936 \begin_layout Plain Layout
9946 ] With this parameter the
9947 \begin_inset Flex MenuItem
9950 \begin_layout Plain Layout
9957 \begin_inset Quotes eld
9960 Vertical space above
9961 \begin_inset Quotes erd
9965 \begin_inset Flex MenuItem
9968 \begin_layout Plain Layout
9969 Edit\SpecialChar \menuseparator
9971 \begin_inset space ~
9979 dialog can be set when initializing a paragraph with this style.
9983 \begin_layout Plain Layout
9986 Note from Jean-Marc:
9988 I'm not sure that this setting has much use, and it should probably be
9989 removed in later versions.
9997 \begin_layout Description
9998 \begin_inset Flex Code
10001 \begin_layout Plain Layout
10007 The font used for both the text body
10013 \begin_inset space ~
10017 \begin_inset CommandInset ref
10019 reference "sub:Font-description"
10024 Note that defining this font automatically defines the
10025 \begin_inset Flex Code
10028 \begin_layout Plain Layout
10035 So you should define this one first if you also want to define
10036 \begin_inset Flex Code
10039 \begin_layout Plain Layout
10048 \begin_layout Description
10049 \begin_inset Flex Code
10052 \begin_layout Plain Layout
10059 \begin_inset CommandInset label
10061 name "des:FreeSpacing"
10066 \begin_inset Flex Code
10069 \begin_layout Plain Layout
10078 \begin_inset Flex Code
10081 \begin_layout Plain Layout
10087 ] Usually LyX doesn't allow you to insert more than one space between words,
10088 since a space is considered as the separation between two words, not a
10089 character or symbol of its own.
10090 This is a very fine thing but sometimes annoying, for example, when typing
10091 program code or plain LaTeX code.
10093 \begin_inset Flex Code
10096 \begin_layout Plain Layout
10103 Note that LyX will create protected blanks for the additional blanks when
10104 in another mode than LaTeX-mode.
10107 \begin_layout Description
10108 \begin_inset Flex Code
10111 \begin_layout Plain Layout
10117 These tags are used with XHTML output.
10119 \begin_inset CommandInset ref
10121 reference "sub:Paragraph-Style-XHTML"
10128 \begin_layout Description
10129 \begin_inset Flex Code
10132 \begin_layout Plain Layout
10138 [[FIXME]] (Used only with XML-type formats.)
10141 \begin_layout Description
10142 \begin_inset Flex Code
10145 \begin_layout Plain Layout
10152 \begin_inset Flex Code
10155 \begin_layout Plain Layout
10161 If 1, marks the layout as to be included in the document preamble rather
10162 than in the document body.
10163 This is useful for document classes that want such information as the title
10164 and author to appear in the preamble.
10165 Note that this works only for layouts for which the
10166 \begin_inset Flex Code
10169 \begin_layout Plain Layout
10176 \begin_inset Flex Code
10179 \begin_layout Plain Layout
10186 \change_inserted 223010757 1290981996
10188 \begin_inset Flex Code
10191 \begin_layout Plain Layout
10193 \change_inserted 223010757 1290981998
10206 \begin_layout Description
10207 \begin_inset Flex Code
10210 \begin_layout Plain Layout
10217 \begin_inset Flex Code
10220 \begin_layout Plain Layout
10226 If 1, marks the layout as being part of a title block (see also the
10227 \begin_inset Flex Code
10230 \begin_layout Plain Layout
10237 \begin_inset Flex Code
10240 \begin_layout Plain Layout
10249 \begin_layout Description
10250 \begin_inset Flex Code
10253 \begin_layout Plain Layout
10260 \begin_inset Flex Code
10263 \begin_layout Plain Layout
10269 ] This provides extra space between paragraphs that have the same layout.
10270 If you put other layouts into an environment, each is separated with the
10272 \begin_inset Flex Code
10275 \begin_layout Plain Layout
10282 But the whole items of the environment are additionally separated with
10284 \begin_inset Flex Code
10287 \begin_layout Plain Layout
10294 Note that this is a
10299 \begin_layout Description
10300 \begin_inset Flex Code
10303 \begin_layout Plain Layout
10309 [[FIXME]] (Used only with XML-type formats.)
10312 \begin_layout Description
10313 \begin_inset Flex Code
10316 \begin_layout Plain Layout
10323 \begin_inset CommandInset label
10325 name "des:KeepEmpty"
10330 \begin_inset Flex Code
10333 \begin_layout Plain Layout
10342 \begin_inset Flex Code
10345 \begin_layout Plain Layout
10351 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10352 lead to empty LaTeX output.
10353 There are some cases where this could be desirable however: in a letter
10354 template, the required fields can be provided as empty fields, so that
10355 people do not forget them; in some special classes, a layout can be used
10356 as some kind of break, which does not contain actual text.
10359 \begin_layout Description
10360 \begin_inset Flex Code
10363 \begin_layout Plain Layout
10369 [float=0] The vertical space between the label and the text body.
10370 Only used for labels that are above the text body (
10371 \begin_inset Flex Code
10374 \begin_layout Plain Layout
10381 \begin_inset Flex Code
10384 \begin_layout Plain Layout
10385 Centered_Top_Environment
10393 \begin_layout Description
10394 \begin_inset Flex Code
10397 \begin_layout Plain Layout
10404 \begin_inset Flex Code
10407 \begin_layout Plain Layout
10414 \begin_inset Newline newline
10417 The name of the counter for automatic numbering.
10419 \begin_inset Newline newline
10427 \begin_inset Flex Code
10430 \begin_layout Plain Layout
10437 \begin_inset Flex Code
10440 \begin_layout Plain Layout
10447 In that case, the counter will be stepped each time the layout appears.
10449 \begin_inset Newline newline
10457 \begin_inset Flex Code
10460 \begin_layout Plain Layout
10467 \begin_inset Flex Code
10470 \begin_layout Plain Layout
10476 , though this case is a bit complicated.
10477 Suppose you declare
10478 \begin_inset Quotes eld
10482 \begin_inset Flex Code
10485 \begin_layout Plain Layout
10486 LabelCounter myenum
10492 \begin_inset Quotes erd
10496 Then the actual counters used are
10497 \begin_inset Flex Code
10500 \begin_layout Plain Layout
10507 \begin_inset Flex Code
10510 \begin_layout Plain Layout
10517 \begin_inset Flex Code
10520 \begin_layout Plain Layout
10527 \begin_inset Flex Code
10530 \begin_layout Plain Layout
10536 , much as in LaTeX.
10537 These counters must all be declared separately.
10538 \begin_inset Newline newline
10542 \begin_inset CommandInset ref
10544 reference "sub:Counters"
10548 for details on counters.
10551 \begin_layout Description
10552 \begin_inset Flex Code
10555 \begin_layout Plain Layout
10561 The font used for the label.
10563 \begin_inset space ~
10567 \begin_inset CommandInset ref
10569 reference "sub:Font-description"
10576 \begin_layout Description
10577 \begin_inset Flex Code
10580 \begin_layout Plain Layout
10586 Text that indicates how far a label should be indented.
10589 \begin_layout Description
10590 \begin_inset Flex Code
10593 \begin_layout Plain Layout
10600 \begin_inset Flex Code
10603 \begin_layout Plain Layout
10609 ] The horizontal space between the label and the text body.
10610 Only used for labels that are not above the text body.
10613 \begin_layout Description
10614 \begin_inset Flex Code
10617 \begin_layout Plain Layout
10624 \begin_inset Flex Code
10627 \begin_layout Plain Layout
10633 ] The string used for a label with a
10634 \begin_inset Flex Code
10637 \begin_layout Plain Layout
10645 \begin_inset Flex Code
10648 \begin_layout Plain Layout
10654 is set, this string can be contain the special formatting commands described
10656 \begin_inset CommandInset ref
10658 reference "sub:Counters"
10666 \begin_layout Plain Layout
10667 For the sake of backwards compatibility, the string
10668 \begin_inset Flex Code
10671 \begin_layout Plain Layout
10681 will be replaced by the expanded
10682 \begin_inset Flex Code
10685 \begin_layout Plain Layout
10692 \begin_inset Flex Code
10695 \begin_layout Plain Layout
10704 This feature is now obsolete and should be replaced by the mechanisms of
10706 \begin_inset CommandInset ref
10708 reference "sub:Counters"
10720 \begin_layout Description
10721 \begin_inset Flex Code
10724 \begin_layout Plain Layout
10725 LabelStringAppendix
10731 \begin_inset Flex Code
10734 \begin_layout Plain Layout
10740 ] This is used inside the appendix instead of
10741 \begin_inset Flex Code
10744 \begin_layout Plain Layout
10752 \begin_inset Flex Code
10755 \begin_layout Plain Layout
10762 \begin_inset Flex Code
10765 \begin_layout Plain Layout
10766 LabelStringAppendix
10774 \begin_layout Description
10775 \begin_inset Flex Code
10778 \begin_layout Plain Layout
10784 [FIXME] (Used only with XML-type formats.)
10787 \begin_layout Description
10788 \begin_inset Flex Code
10791 \begin_layout Plain Layout
10798 \begin_inset Flex Code
10801 \begin_layout Plain Layout
10806 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10807 Enumerate, Itemize, Bibliography
10816 \begin_layout Itemize
10817 \begin_inset Flex Code
10820 \begin_layout Plain Layout
10826 means the label is the very first word (up to the first real blank).
10827 Use protected spaces (like
10828 \begin_inset space ~
10831 that one) if you want more than one word as the label.
10835 \begin_layout Itemize
10836 \begin_inset Flex Code
10839 \begin_layout Plain Layout
10845 means the label is simply whatever
10846 \begin_inset Flex Code
10849 \begin_layout Plain Layout
10856 Note that this really is `static'.
10859 \begin_layout Itemize
10860 \begin_inset Flex Code
10863 \begin_layout Plain Layout
10870 \begin_inset Flex Code
10873 \begin_layout Plain Layout
10874 Centered_Top_Environment
10879 are special cases of
10880 \begin_inset Flex Code
10883 \begin_layout Plain Layout
10890 The label will be printed above the paragraph, but only at the top of an
10891 environment or the top of a chain of paragraphs with this layout.
10892 This might be used with the
10893 \begin_inset Flex MenuItem
10896 \begin_layout Plain Layout
10902 layout, for example.
10905 \begin_layout Itemize
10906 \begin_inset Flex Code
10909 \begin_layout Plain Layout
10915 is a special case for the caption-labels
10916 \begin_inset Quotes eld
10920 \begin_inset Quotes erd
10924 \begin_inset Quotes eld
10928 \begin_inset Quotes erd
10933 \begin_inset Flex Code
10936 \begin_layout Plain Layout
10942 means the (hardcoded) label string depends on the kind of float: It is
10943 hardcoded to be `FloatType N', where N is the value of the counter associated
10947 \begin_layout Itemize
10949 \begin_inset Flex Code
10952 \begin_layout Plain Layout
10958 label type defines automatically numbered labels.
10960 \begin_inset Flex Code
10963 \begin_layout Plain Layout
10969 will be expanded to resolve any counter references it contains: For example,
10971 \begin_inset Quotes eld
10975 \begin_inset Flex Code
10978 \begin_layout Plain Layout
10989 \begin_inset Quotes erd
10994 \begin_inset CommandInset ref
10996 reference "sub:Counters"
11000 for more information on counters.
11003 \begin_layout Itemize
11004 \begin_inset Flex Code
11007 \begin_layout Plain Layout
11013 produces the usual sort of enumeration labels.
11014 At present, it is hardcoded to use Arabic numerals, lowercase letters,
11015 small Roman numerals, and uppercase letters for the four possible depths.
11018 \begin_layout Itemize
11019 \begin_inset Flex Code
11022 \begin_layout Plain Layout
11028 produces various bullets at the different levels.
11029 It is also hardcoded.
11032 \begin_layout Itemize
11033 \begin_inset Flex Code
11036 \begin_layout Plain Layout
11042 is used internally by LyX and should be used only with
11043 \begin_inset Flex Code
11046 \begin_layout Plain Layout
11047 LatexType BibEnvironment
11056 \begin_layout Description
11057 \begin_inset Flex Code
11060 \begin_layout Plain Layout
11066 Note that this will completely override any prior
11067 \begin_inset Flex Code
11070 \begin_layout Plain Layout
11076 declaration for this style.
11078 \begin_inset Quotes eld
11082 \begin_inset Flex Code
11085 \begin_layout Plain Layout
11092 \begin_inset Quotes erd
11097 \begin_inset CommandInset ref
11099 reference "sub:I18n"
11103 for details on its use.
11106 \begin_layout Description
11107 \begin_inset Flex Code
11110 \begin_layout Plain Layout
11116 The name of the corresponding LaTeX stuff.
11117 Either the environment or command name.
11120 \begin_layout Description
11121 \begin_inset Flex Code
11124 \begin_layout Plain Layout
11130 An optional parameter for the corresponding
11131 \begin_inset Flex Code
11134 \begin_layout Plain Layout
11141 This parameter cannot be changed from within LyX.
11144 \begin_layout Description
11145 \begin_inset Flex Code
11148 \begin_layout Plain Layout
11155 \begin_inset CommandInset label
11157 name "des:LatexType"
11162 \begin_inset Flex Code
11165 \begin_layout Plain Layout
11170 , Command, Environment, Item_Environment,
11176 \begin_inset Flex Code
11179 \begin_layout Plain Layout
11180 List_Environment, Bib_Environment
11185 ] How the layout should be translated into LaTeX.
11189 \begin_layout Plain Layout
11190 \begin_inset Flex Code
11193 \begin_layout Plain Layout
11199 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11200 Visit the SGML class files for specific examples.
11209 \begin_layout Itemize
11210 \begin_inset Flex Code
11213 \begin_layout Plain Layout
11219 means nothing special.
11223 \begin_layout Itemize
11224 \begin_inset Flex Code
11227 \begin_layout Plain Layout
11234 \begin_inset Flex Code
11237 \begin_layout Plain Layout
11244 {\SpecialChar \ldots{}
11253 \begin_layout Itemize
11254 \begin_inset Flex Code
11257 \begin_layout Plain Layout
11264 \begin_inset Flex Code
11267 \begin_layout Plain Layout
11274 }\SpecialChar \ldots{}
11290 \begin_layout Itemize
11291 \begin_inset Flex Code
11294 \begin_layout Plain Layout
11301 \begin_inset Flex Code
11304 \begin_layout Plain Layout
11311 \begin_inset Flex Code
11314 \begin_layout Plain Layout
11322 is generated for each paragraph of this environment.
11326 \begin_layout Itemize
11327 \begin_inset Flex Code
11330 \begin_layout Plain Layout
11337 \begin_inset Flex Code
11340 \begin_layout Plain Layout
11347 \begin_inset Flex Code
11350 \begin_layout Plain Layout
11356 is passed as an argument to the environment.
11358 \begin_inset Flex Code
11361 \begin_layout Plain Layout
11367 can be defined in the
11368 \begin_inset Flex MenuItem
11371 \begin_layout Plain Layout
11376 ayout\SpecialChar \menuseparator
11390 \begin_layout Standard
11391 Putting the last few things together, the LaTeX output will be either:
11394 \begin_layout LyX-Code
11397 latexname[latexparam]{\SpecialChar \ldots{}
11401 \begin_layout Standard
11405 \begin_layout LyX-Code
11408 begin{latexname}[latexparam] \SpecialChar \ldots{}
11414 \begin_layout Standard
11415 depending upon the LaTeX type.
11419 \begin_layout Description
11420 \begin_inset Flex Code
11423 \begin_layout Plain Layout
11430 \begin_inset Flex Code
11433 \begin_layout Plain Layout
11439 ] If you put layouts into environments, the leftmargins are not simply added,
11440 but added with a factor
11441 \begin_inset Formula $\frac{4}{depth+4}$
11445 Note that this parameter is also used when the margin is defined as
11446 \begin_inset Flex Code
11449 \begin_layout Plain Layout
11456 \begin_inset Flex Code
11459 \begin_layout Plain Layout
11466 Then it is added to the manual or dynamic margin.
11468 \begin_inset Newline newline
11471 The argument is passed as a string.
11473 \begin_inset Quotes eld
11477 \begin_inset Flex Code
11480 \begin_layout Plain Layout
11487 \begin_inset Quotes erd
11490 means that the paragraph is indented with the width of
11491 \begin_inset Quotes eld
11495 \begin_inset Flex Code
11498 \begin_layout Plain Layout
11505 \begin_inset Quotes erd
11508 in the normal font.
11509 You can get a negative width by prefixing the string with
11510 \begin_inset Quotes eld
11514 \begin_inset Flex Code
11517 \begin_layout Plain Layout
11524 \begin_inset Quotes erd
11528 This way was chosen so that the look is the same with each used screen
11533 \begin_layout Description
11534 \begin_inset Flex Code
11537 \begin_layout Plain Layout
11544 \begin_inset Flex Code
11547 \begin_layout Plain Layout
11552 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11558 \begin_inset Newline newline
11561 The kind of margin that the layout has on the left side.
11563 \begin_inset Flex Code
11566 \begin_layout Plain Layout
11572 just means a fixed margin.
11574 \begin_inset Flex Code
11577 \begin_layout Plain Layout
11583 means that the left margin depends on the string entered in the
11584 \begin_inset Flex MenuItem
11587 \begin_layout Plain Layout
11588 Edit\SpecialChar \menuseparator
11590 \begin_inset space ~
11599 This is used to typeset nice lists without tabulators.
11601 \begin_inset Flex Code
11604 \begin_layout Plain Layout
11610 means that the margin depends on the size of the label.
11611 This is used for automatic enumerated headlines.
11612 It is obvious that the headline
11613 \begin_inset Quotes eld
11616 5.4.3.2.1 Very long headline
11617 \begin_inset Quotes erd
11620 must have a wider left margin (as wide as
11621 \begin_inset Quotes eld
11625 \begin_inset Quotes erd
11628 plus the space) than
11629 \begin_inset Quotes eld
11632 3.2 Very long headline
11633 \begin_inset Quotes erd
11637 \begin_inset Quotes eld
11641 \begin_inset Quotes erd
11644 are not able to do this.
11646 \begin_inset Flex Code
11649 \begin_layout Plain Layout
11655 is similar, but only the very first row of the paragraph is dynamic, while
11656 the others are static; this is used, for example, for descriptions.
11658 \begin_inset Flex Code
11661 \begin_layout Plain Layout
11667 means the margin is chosen in a way that the longest row of this paragraph
11668 fits to the right margin.
11669 This is used to typeset an address on the right edge of the page.
11672 \begin_layout Description
11673 \begin_inset Flex Code
11676 \begin_layout Plain Layout
11683 \begin_inset Flex Code
11686 \begin_layout Plain Layout
11695 \begin_inset Flex Code
11698 \begin_layout Plain Layout
11704 ] Whether fragile commands in this layout should be
11705 \begin_inset Flex Code
11708 \begin_layout Plain Layout
11721 whether this command should itself be protected.)
11724 \begin_layout Description
11725 \begin_inset Flex Code
11728 \begin_layout Plain Layout
11735 \begin_inset Flex Code
11738 \begin_layout Plain Layout
11745 \begin_inset Flex Code
11748 \begin_layout Plain Layout
11756 ] Whether newlines are translated into LaTeX newlines (
11757 \begin_inset Flex Code
11760 \begin_layout Plain Layout
11771 The translation can be switched off to allow more comfortable LaTeX editing
11775 \begin_layout Description
11776 \begin_inset Flex Code
11779 \begin_layout Plain Layout
11786 \begin_inset Flex Code
11789 \begin_layout Plain Layout
11796 \begin_inset Flex Code
11799 \begin_layout Plain Layout
11807 ] Whether the following Paragraph is allowed to indent its very first row.
11809 \begin_inset Flex Code
11812 \begin_layout Plain Layout
11818 means that it is not allowed to do so;
11819 \begin_inset Flex Code
11822 \begin_layout Plain Layout
11828 means it could do so if it wants to.
11831 \begin_layout Description
11832 \begin_inset Flex Code
11835 \begin_layout Plain Layout
11841 Name of a layout that has replaced this layout.
11842 This is used to rename a layout, while keeping backward compatibility.
11845 \begin_layout Description
11846 \begin_inset Flex Code
11849 \begin_layout Plain Layout
11856 \begin_inset Flex Code
11859 \begin_layout Plain Layout
11865 ] The number of optional arguments that can be used with this layout.
11866 This is useful for things like section headings, and only makes sense with
11868 Note that, on output, the optional arguments will all precede any required
11869 arguments (see below).
11870 So one can have constructs like:
11874 \begin_layout LyX-Code
11877 mycmd[opt1]{req1}{contents of paragraph}
11880 \begin_layout Standard
11881 but one cannot have things like:
11884 \begin_layout LyX-Code
11887 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11890 \begin_layout Standard
11891 at least, not without ERT (with which you can have anything).
11896 \begin_layout Description
11897 \begin_inset Flex Code
11900 \begin_layout Plain Layout
11907 \begin_inset CommandInset label
11909 name "des:ParbreakIsNewline"
11914 \begin_inset Flex Code
11917 \begin_layout Plain Layout
11926 \begin_inset Flex Code
11929 \begin_layout Plain Layout
11935 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
11936 output, but only by a line break; together with
11937 \begin_inset Flex Code
11940 \begin_layout Plain Layout
11946 , this allows to emulate a plain text editor (like the ERT inset).
11949 \begin_layout Description
11950 \begin_inset Flex Code
11953 \begin_layout Plain Layout
11960 \begin_inset Flex Code
11963 \begin_layout Plain Layout
11969 ] The indent of the very first line of a paragraph.
11971 \begin_inset Flex Code
11974 \begin_layout Plain Layout
11980 will be fixed for a certain layout.
11981 The exception is Standard layout, since the indentation of a Standard layout
11982 paragraph can be prohibited with
11983 \begin_inset Flex Code
11986 \begin_layout Plain Layout
11993 Also, Standard layout paragraphs inside environments use the
11994 \begin_inset Flex Code
11997 \begin_layout Plain Layout
12003 of the environment, not their native one.
12004 For example, Standard paragraphs inside an enumeration are not indented.
12007 \begin_layout Description
12008 \begin_inset Flex Code
12011 \begin_layout Plain Layout
12018 \begin_inset Flex Code
12021 \begin_layout Plain Layout
12027 ] The vertical space between two paragraphs of this layout.
12030 \begin_layout Description
12031 \begin_inset Flex Code
12034 \begin_layout Plain Layout
12041 \begin_inset Flex Code
12044 \begin_layout Plain Layout
12050 ] LyX allows the user to choose either
12051 \begin_inset Quotes eld
12055 \begin_inset Quotes erd
12059 \begin_inset Quotes eld
12063 \begin_inset Quotes erd
12066 to typeset a document.
12068 \begin_inset Quotes eld
12072 \begin_inset Quotes erd
12075 is chosen, this value is completely ignored.
12077 \begin_inset Quotes eld
12081 \begin_inset Quotes erd
12084 is chosen, the parindent of a LaTeXtype
12085 \begin_inset Quotes eld
12089 \begin_inset Quotes erd
12092 layout is ignored and all paragraphs are separated by this parskip argument.
12093 The vertical space is calculated with
12094 \begin_inset Flex Code
12097 \begin_layout Plain Layout
12099 \begin_inset space ~
12108 \begin_inset Flex Code
12111 \begin_layout Plain Layout
12117 is the height of a row with the normal font.
12118 This way, the look stays the same with different screen fonts.
12121 \begin_layout Description
12122 \begin_inset Flex Code
12125 \begin_layout Plain Layout
12132 \begin_inset CommandInset label
12134 name "des:PassThru"
12139 \begin_inset Flex Code
12142 \begin_layout Plain Layout
12151 \begin_inset Flex Code
12154 \begin_layout Plain Layout
12160 ] Whether the contents of this paragraph should be output in raw form, meaning
12161 without special translations that LaTeX would require.
12164 \begin_layout Description
12165 \begin_inset Flex Code
12168 \begin_layout Plain Layout
12175 \begin_inset CommandInset label
12177 name "des:Preamble"
12181 Information to be included in the LaTeX preamble when this style is used.
12182 Used to define macros, load packages, etc., required by this particular
12185 \begin_inset Quotes eld
12189 \begin_inset Flex Code
12192 \begin_layout Plain Layout
12199 \begin_inset Quotes erd
12205 \begin_layout Description
12206 \begin_inset Flex Code
12209 \begin_layout Plain Layout
12216 \begin_inset Flex Code
12219 \begin_layout Plain Layout
12225 ] The prefix to use when creating labels referring to paragraphs of this
12227 This allows the use of formatted references.
12230 \begin_layout Description
12231 \begin_inset Flex Code
12234 \begin_layout Plain Layout
12241 \begin_inset Flex Code
12244 \begin_layout Plain Layout
12250 ] The number of required arguments that the LaTeX command or environment
12251 corresponding to this layout expects.
12252 In the case of a command, these are required arguments
12256 that associated with the content of the paragraph itself.
12257 These do not actually have to be provided: LyX will output empty arguments
12259 Note that optional arguments will be output before required arguments.
12260 See the discussion of the
12261 \begin_inset Flex Code
12264 \begin_layout Plain Layout
12270 tag above for more information.
12273 \begin_layout Description
12274 \begin_inset Flex Code
12277 \begin_layout Plain Layout
12284 \begin_inset Flex Code
12287 \begin_layout Plain Layout
12294 \begin_inset CommandInset label
12296 name "des:Requires"
12300 Whether the layout requires the feature
12301 \begin_inset Flex Code
12304 \begin_layout Plain Layout
12311 See the description of
12312 \begin_inset Flex Code
12315 \begin_layout Plain Layout
12322 \begin_inset CommandInset ref
12323 LatexCommand pageref
12324 reference "des:FreeSpacing"
12328 ) for information on `features'.
12332 \begin_layout Description
12333 \begin_inset Flex Code
12336 \begin_layout Plain Layout
12343 \begin_inset Flex Code
12346 \begin_layout Plain Layout
12353 \begin_inset Flex Code
12356 \begin_layout Plain Layout
12365 \begin_layout Description
12366 \begin_inset Flex Code
12369 \begin_layout Plain Layout
12376 \begin_inset Flex Code
12379 \begin_layout Plain Layout
12384 , onehalf, double, other
12393 ] This defines what the default spacing should be in the layout.
12395 \begin_inset Flex Code
12398 \begin_layout Plain Layout
12405 \begin_inset Flex Code
12408 \begin_layout Plain Layout
12415 \begin_inset Flex Code
12418 \begin_layout Plain Layout
12424 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12425 If you specify the argument
12426 \begin_inset Flex Code
12429 \begin_layout Plain Layout
12435 , then you should also provide a numerical argument which will be the actual
12437 Note that, contrary to other parameters,
12438 \begin_inset Flex Code
12441 \begin_layout Plain Layout
12447 implies the generation of specific LaTeX code, using the package
12450 \begin_inset Flex Code
12453 \begin_layout Plain Layout
12462 \begin_layout Description
12463 \begin_inset Flex Code
12466 \begin_layout Plain Layout
12473 \begin_inset Flex Code
12476 \begin_layout Plain Layout
12483 \begin_inset Flex Code
12486 \begin_layout Plain Layout
12494 ] Spellcheck paragraphs of this style.
12498 \begin_layout Description
12499 \begin_inset Flex Code
12502 \begin_layout Plain Layout
12508 The font used for the text body .
12510 \begin_inset CommandInset ref
12512 reference "sub:Font-description"
12519 \begin_layout Description
12520 \begin_inset Flex Code
12523 \begin_layout Plain Layout
12532 \begin_inset Flex Code
12535 \begin_layout Plain Layout
12545 The level of the style in the table of contents.
12546 This is used for automatic numbering of section headings.
12549 \begin_layout Description
12550 \begin_inset Flex Code
12553 \begin_layout Plain Layout
12560 \begin_inset Flex Code
12563 \begin_layout Plain Layout
12569 ] The vertical space with which the very first of a chain of paragraphs
12570 with this layout is separated from the previous paragraph.
12571 If the previous paragraph has another layout, the separations are not simply
12572 added, but the maximum is taken.
12575 \begin_layout Subsection
12576 \begin_inset CommandInset label
12582 Internationalization of Paragraph Styles
12585 \begin_layout Standard
12586 LyX has long supported internationalization of layout information, but,
12587 until version 2.0, this applied only to the user interface and not to, say,
12589 Thus, French authors were forced to resort to ugly hacks if they wanted
12594 1' instead of `Theorem 1'.
12595 Thanks to Georg Baum, that is no longer the case.
12598 \begin_layout Standard
12600 \begin_inset Flex Code
12603 \begin_layout Plain Layout
12609 defines text that is to appear in the typeset document, it may use
12610 \begin_inset Flex Code
12613 \begin_layout Plain Layout
12620 \begin_inset Flex Code
12623 \begin_layout Plain Layout
12629 to support non-English and even multi-language documents correctly.
12630 The following excerpt (from the
12631 \begin_inset Flex Code
12634 \begin_layout Plain Layout
12640 file) shows how this works:
12643 \begin_layout LyX-Code
12648 \begin_layout LyX-Code
12651 theoremstyle{remark}
12654 \begin_layout LyX-Code
12657 newtheorem{claim}[thm]{
12664 \begin_layout LyX-Code
12668 \begin_layout LyX-Code
12672 \begin_layout LyX-Code
12677 claimname}{_(Claim)}
12680 \begin_layout LyX-Code
12684 \begin_layout LyX-Code
12688 \begin_layout LyX-Code
12697 claimname}{_(Claim)}}
12700 \begin_layout LyX-Code
12705 \begin_layout Standard
12706 In principle, any legal LaTeX may appear in the
12707 \begin_inset Flex Code
12710 \begin_layout Plain Layout
12717 \begin_inset Flex Code
12720 \begin_layout Plain Layout
12726 tags, but in practice they will typically look as they do here.
12727 The key to correct translation of the typeset text is the definition of
12729 \begin_inset Flex Code
12732 \begin_layout Plain Layout
12741 \begin_inset Flex Code
12744 \begin_layout Plain Layout
12756 \begin_layout Standard
12758 \begin_inset Flex Code
12761 \begin_layout Plain Layout
12767 tag provides for internationalization based upon the overall language of
12769 The contents of the tag will be included in the preamble, just as with
12771 \begin_inset Flex Code
12774 \begin_layout Plain Layout
12781 What makes it special is the use of the
12782 \begin_inset Quotes eld
12786 \begin_inset Quotes erd
12790 \begin_inset Flex Code
12793 \begin_layout Plain Layout
12799 , which will be replaced, when LyX produces LaTeX output, with the translation
12800 of its argument into the document language.
12803 \begin_layout Standard
12805 \begin_inset Flex Code
12808 \begin_layout Plain Layout
12814 tag is more complex, since it is meant to provide support for multi-language
12815 documents and so offers an interface to the
12816 \begin_inset Flex Code
12819 \begin_layout Plain Layout
12826 Its contents will be added to the preamble once for each language that
12827 appears in the document.
12828 In this case, the argument to
12829 \begin_inset Flex Code
12832 \begin_layout Plain Layout
12838 will be replaced with its translation into the language in question; the
12840 \begin_inset Flex Code
12843 \begin_layout Plain Layout
12849 is replaced by the language name (as used by the babel package).
12852 \begin_layout Standard
12853 A German document that also included a French section would thus have the
12854 following in the preamble:
12857 \begin_layout LyX-Code
12866 claimname}{Affirmation}}
12874 claimname}{Behauptung}}
12878 claimname}{Behauptung}
12881 \begin_layout Standard
12883 \begin_inset Flex Code
12886 \begin_layout Plain Layout
12892 will then conspire to produce the correct text in the output.
12895 \begin_layout Standard
12896 One important point to note here is that the translations are provided by
12897 LyX itself, through the same mechanism it uses for internationalization
12898 of the user interface.
12899 This means, in effect, that
12900 \begin_inset Flex Code
12903 \begin_layout Plain Layout
12910 \begin_inset Flex Code
12913 \begin_layout Plain Layout
12919 are really only of use in layout files that are provided with LyX, since
12920 text entered in user-created layout files will not be seen by LyX's internation
12921 alization routines.
12922 That said, however, any layout created with the intention that it will
12923 be included with LyX should use these tags where appropriate.
12926 \begin_layout Subsection
12928 \begin_inset CommandInset label
12937 \begin_layout Standard
12938 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12939 define the floats (
12940 \begin_inset Flex MenuItem
12943 \begin_layout Plain Layout
12950 \begin_inset Flex MenuItem
12953 \begin_layout Plain Layout
12959 , \SpecialChar \ldots{}
12960 ) in the text class itself.
12961 Standard floats are included in the file
12962 \begin_inset Flex Code
12965 \begin_layout Plain Layout
12971 , so you may have to do no more than add
12974 \begin_layout LyX-Code
12975 Input stdfloats.inc
12978 \begin_layout Standard
12979 to your layout file.
12980 If you want to implement a text class that proposes some other float types
12981 (like the AGU class bundled with LyX), the information below will hopefully
12985 \begin_layout Description
12986 \begin_inset Flex Code
12989 \begin_layout Plain Layout
12996 \begin_inset Flex Code
12999 \begin_layout Plain Layout
13006 \begin_inset Quotes erd
13010 \begin_inset Quotes erd
13013 ] The file name extension of an auxiliary file for the list of figures (or
13015 LaTeX writes the captions to this file.
13018 \begin_layout Description
13019 \begin_inset Flex Code
13022 \begin_layout Plain Layout
13029 \begin_inset Flex Code
13032 \begin_layout Plain Layout
13039 \begin_inset Quotes erd
13043 \begin_inset Quotes erd
13046 ] The string that will be used in the menus and also for the caption.
13047 This is translated to the current language if babel is used.
13050 \begin_layout Description
13051 \begin_inset Flex Code
13054 \begin_layout Plain Layout
13060 These are used for XHTML output.
13062 \begin_inset CommandInset ref
13064 reference "sec:Tags-for-XHTML"
13071 \begin_layout Description
13072 \begin_inset Flex Code
13075 \begin_layout Plain Layout
13082 \begin_inset Flex Code
13085 \begin_layout Plain Layout
13092 \begin_inset Quotes erd
13096 \begin_inset Quotes erd
13099 ] The command used to generate a list of floats of this type; the leading
13102 ' should be omitted.
13108 \begin_inset Flex Code
13111 \begin_layout Plain Layout
13117 is false, since there is no standard way to generate this command.
13119 \begin_inset Flex Code
13122 \begin_layout Plain Layout
13128 is true, since in that case there is a standard way.
13131 \begin_layout Description
13132 \begin_inset Flex Code
13135 \begin_layout Plain Layout
13142 \begin_inset Flex Code
13145 \begin_layout Plain Layout
13152 \begin_inset Quotes erd
13156 \begin_inset Quotes erd
13159 ] A title for a list of floats of this kind (list of figures, tables, or
13161 It is used for the screen label within LyX; it is passed to LaTeX for use
13162 as the title there; and it is used as the title in XHTML output.
13163 It will be translated to the document language.
13166 \begin_layout Description
13167 \begin_inset Flex Code
13170 \begin_layout Plain Layout
13177 \begin_inset Flex Code
13180 \begin_layout Plain Layout
13187 \begin_inset Flex Code
13190 \begin_layout Plain Layout
13198 ] Indicates whether the float is already defined in the document class or
13199 if we instead need to load
13200 \begin_inset Flex Code
13203 \begin_layout Plain Layout
13209 and use what it provides.
13211 \begin_inset Flex Code
13214 \begin_layout Plain Layout
13221 \begin_inset Flex Code
13224 \begin_layout Plain Layout
13231 It should be set to
13232 \begin_inset Flex Code
13235 \begin_layout Plain Layout
13241 if the float is already defined by the LaTeX document class.
13244 \begin_layout Description
13245 \begin_inset Flex Code
13248 \begin_layout Plain Layout
13255 \begin_inset Flex Code
13258 \begin_layout Plain Layout
13265 \begin_inset Quotes erd
13269 \begin_inset Quotes erd
13272 ] This (optional) argument determines whether floats of this class will
13273 be numbered within some sectional unit of the document.
13274 For example, if within is equal to
13275 \begin_inset Flex Code
13278 \begin_layout Plain Layout
13284 , the floats will be numbered within chapters.
13288 \begin_layout Description
13289 \begin_inset Flex Code
13292 \begin_layout Plain Layout
13299 \begin_inset Flex Code
13302 \begin_layout Plain Layout
13309 \begin_inset Quotes erd
13313 \begin_inset Quotes erd
13316 ] The default placement for the given class of floats.
13317 The string should be as in standard LaTeX:
13318 \begin_inset Flex Code
13321 \begin_layout Plain Layout
13328 \begin_inset Flex Code
13331 \begin_layout Plain Layout
13338 \begin_inset Flex Code
13341 \begin_layout Plain Layout
13348 \begin_inset Flex Code
13351 \begin_layout Plain Layout
13357 for top, bottom, page, and here, respectively.
13361 \begin_layout Plain Layout
13362 Note that the order of these letters in the string is irrelevant, like in
13368 On top of that there is a new type,
13369 \begin_inset Flex Code
13372 \begin_layout Plain Layout
13378 , which does not really correspond to a float, since it means: put it
13379 \begin_inset Quotes eld
13383 \begin_inset Quotes erd
13387 Note however that the
13388 \begin_inset Flex Code
13391 \begin_layout Plain Layout
13397 specifier is special and, because of implementation details, cannot be
13398 used in non-built in float types.
13399 If you do not understand what this means, just use
13400 \begin_inset Quotes eld
13404 \begin_inset Flex Code
13407 \begin_layout Plain Layout
13414 \begin_inset Quotes erd
13420 \begin_layout Description
13421 \begin_inset Flex Code
13424 \begin_layout Plain Layout
13431 \begin_inset Flex Code
13434 \begin_layout Plain Layout
13440 ] The prefix to use when creating labels referring to floats of this type.
13441 This allows the use of formatted references.
13442 Note that you can remove any
13443 \begin_inset Flex Code
13446 \begin_layout Plain Layout
13452 set by a copied style by using the special value
13453 \begin_inset Quotes eld
13457 \begin_inset Quotes erd
13460 , which must be all caps.
13463 \begin_layout Description
13464 \begin_inset Flex Code
13467 \begin_layout Plain Layout
13474 \begin_inset Flex Code
13477 \begin_layout Plain Layout
13484 \begin_inset Quotes erd
13488 \begin_inset Quotes erd
13491 ] The style used when defining the float using
13492 \begin_inset Flex Code
13495 \begin_layout Plain Layout
13506 \begin_layout Description
13507 \begin_inset Flex Code
13510 \begin_layout Plain Layout
13517 \begin_inset Flex Code
13520 \begin_layout Plain Layout
13527 \begin_inset Quotes erd
13531 \begin_inset Quotes erd
13535 \begin_inset Quotes eld
13539 \begin_inset Quotes erd
13542 of the new class of floats, like program or algorithm.
13543 After the appropriate
13544 \begin_inset Flex Code
13547 \begin_layout Plain Layout
13556 \begin_inset Flex Code
13559 \begin_layout Plain Layout
13568 \begin_inset Flex Code
13571 \begin_layout Plain Layout
13582 \begin_layout Standard
13583 Note that defining a float with type
13584 \begin_inset Flex Code
13587 \begin_layout Plain Layout
13595 automatically defines the corresponding counter with name
13596 \begin_inset Flex Code
13599 \begin_layout Plain Layout
13610 \begin_layout Subsection
13611 Flex insets and InsetLayout
13612 \begin_inset CommandInset label
13614 name "sub:Flex-insets-and"
13621 \begin_layout Standard
13622 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13623 these are called Flex insets.
13627 \begin_layout Standard
13628 Flex insets come in three different kinds:
13631 \begin_layout Itemize
13633 \begin_inset Flex Code
13636 \begin_layout Plain Layout
13642 ): These define semantic markup corresponding to such LaTeX commands as
13644 \begin_inset Flex Code
13647 \begin_layout Plain Layout
13656 \begin_inset Flex Code
13659 \begin_layout Plain Layout
13670 \begin_layout Itemize
13672 \begin_inset Flex Code
13675 \begin_layout Plain Layout
13681 ): These can be used to define custom collapsible insets, similar to TeX
13682 code, footnote, and the like.
13683 An obvious example is an endnote inset, which is defined in the
13684 \begin_inset Flex Code
13687 \begin_layout Plain Layout
13696 \begin_layout Itemize
13698 \begin_inset Flex Code
13701 \begin_layout Plain Layout
13707 ): For use with DocBook classes.
13710 \begin_layout Standard
13711 Flex insets are defined using the
13712 \begin_inset Flex Code
13715 \begin_layout Plain Layout
13721 tag, which shall be explained in a moment.
13724 \begin_layout Standard
13726 \begin_inset Flex Code
13729 \begin_layout Plain Layout
13735 tag also serves another function: It can be used to customize the general
13736 layout of many different types of insets.
13738 \begin_inset Flex Code
13741 \begin_layout Plain Layout
13747 can be used to customize the layout parameters for footnotes, marginal
13748 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13749 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13750 define Flex insets.
13753 \begin_layout Standard
13755 \begin_inset Flex Code
13758 \begin_layout Plain Layout
13764 definition must begin with a line of the form:
13767 \begin_layout LyX-Code
13771 \begin_layout Standard
13773 \begin_inset Flex Code
13776 \begin_layout Plain Layout
13782 indicates the inset whose layout is being defined, and here there are two
13786 \begin_layout Enumerate
13787 The layout for a pre-existing inset is being modified.
13788 In this case, can be
13789 \begin_inset Flex Code
13792 \begin_layout Plain Layout
13798 any one of the following:
13799 \begin_inset Flex Code
13802 \begin_layout Plain Layout
13809 \begin_inset Flex Code
13812 \begin_layout Plain Layout
13819 \begin_inset Flex Code
13822 \begin_layout Plain Layout
13829 \begin_inset Flex Code
13832 \begin_layout Plain Layout
13839 \begin_inset Flex Code
13842 \begin_layout Plain Layout
13849 \begin_inset Flex Code
13852 \begin_layout Plain Layout
13859 \begin_inset Flex Code
13862 \begin_layout Plain Layout
13869 \begin_inset Flex Code
13872 \begin_layout Plain Layout
13879 \begin_inset Flex Code
13882 \begin_layout Plain Layout
13889 \begin_inset Flex Code
13892 \begin_layout Plain Layout
13899 \begin_inset Flex Code
13902 \begin_layout Plain Layout
13909 \begin_inset Flex Code
13912 \begin_layout Plain Layout
13919 \begin_inset Flex Code
13922 \begin_layout Plain Layout
13929 \begin_inset Flex Code
13932 \begin_layout Plain Layout
13939 \begin_inset Flex Code
13942 \begin_layout Plain Layout
13949 \begin_inset Flex Code
13952 \begin_layout Plain Layout
13959 \begin_inset Flex Code
13962 \begin_layout Plain Layout
13969 \begin_inset Flex Code
13972 \begin_layout Plain Layout
13979 \begin_inset Flex Code
13982 \begin_layout Plain Layout
13989 \begin_inset Flex Code
13992 \begin_layout Plain Layout
14001 \begin_layout Enumerate
14002 The layout for a Flex inset is being defined.
14004 \begin_inset Flex Code
14007 \begin_layout Plain Layout
14013 may be be any valid identifier not used by a pre-existing inset.
14014 The identifier may include spaces, but in that case the whole thing must
14015 be wrapped in quotes.
14016 It may also include a namespace identifier, preceding a colon, such as
14018 \begin_inset Quotes eld
14022 \begin_inset Flex Code
14025 \begin_layout Plain Layout
14032 \begin_inset Quotes erd
14036 Note that the definition of a flex inset
14041 \begin_inset Flex Code
14044 \begin_layout Plain Layout
14050 entry, declaring which type of inset it defines.
14053 \begin_layout Standard
14055 \begin_inset Flex Code
14058 \begin_layout Plain Layout
14064 definition can contain the following entries:
14067 \begin_layout Description
14068 \begin_inset Flex Code
14071 \begin_layout Plain Layout
14077 The color for the inset's background.
14078 The valid colors are defined in
14079 \begin_inset Flex Code
14082 \begin_layout Plain Layout
14091 \begin_layout Description
14092 \begin_inset Flex Code
14095 \begin_layout Plain Layout
14102 \begin_inset Flex Code
14105 \begin_layout Plain Layout
14114 \begin_inset Flex Code
14117 \begin_layout Plain Layout
14123 ] Whether to use the content of the inset as the label, when the inset is
14128 \begin_layout Description
14129 \begin_inset Flex Code
14132 \begin_layout Plain Layout
14138 As with paragraph styles (see page
14139 \begin_inset CommandInset ref
14141 reference "des:CopyStyle"
14148 \begin_layout Description
14149 \begin_inset Flex Code
14152 \begin_layout Plain Layout
14159 \begin_inset Flex Code
14162 \begin_layout Plain Layout
14171 \begin_inset Flex Code
14174 \begin_layout Plain Layout
14180 ] Indicates whether the user may employ the Paragraph Settings dialog to
14181 customize the paragraph.
14184 \begin_layout Description
14185 \begin_inset Flex Code
14188 \begin_layout Plain Layout
14195 \begin_inset Flex Code
14198 \begin_layout Plain Layout
14205 \begin_inset Flex Code
14208 \begin_layout Plain Layout
14215 \begin_inset Flex Code
14218 \begin_layout Plain Layout
14224 , describing the rendering style used for the inset's frame and buttons.
14225 Footnotes generally use
14226 \begin_inset Flex Code
14229 \begin_layout Plain Layout
14235 , ERT insets generally
14236 \begin_inset Flex Code
14239 \begin_layout Plain Layout
14245 , and character styles
14246 \begin_inset Flex Code
14249 \begin_layout Plain Layout
14258 \begin_layout Description
14259 \begin_inset Flex Code
14262 \begin_layout Plain Layout
14268 Required at the end of the InsetLayout declarations.
14271 \begin_layout Description
14272 \begin_inset Flex Code
14275 \begin_layout Plain Layout
14281 The font used for both the text body
14287 \begin_inset space ~
14291 \begin_inset CommandInset ref
14293 reference "sub:Font-description"
14298 Note that defining this font automatically defines the
14299 \begin_inset Flex Code
14302 \begin_layout Plain Layout
14308 to the same value, so define this first and define
14309 \begin_inset Flex Code
14312 \begin_layout Plain Layout
14318 later if you want them to be different.
14321 \begin_layout Description
14322 \begin_inset Flex Code
14325 \begin_layout Plain Layout
14332 \begin_inset Quotes eld
14336 \begin_inset Quotes erd
14339 language, leading to Left-to-Right (latin) output, e.
14340 \begin_inset space \thinspace{}
14344 \begin_inset space \space{}
14347 in TeX code or URL.
14351 \begin_layout Description
14352 \begin_inset Flex Code
14355 \begin_layout Plain Layout
14362 \begin_inset Flex Code
14365 \begin_layout Plain Layout
14374 \begin_inset Flex Code
14377 \begin_layout Plain Layout
14383 ] Indicates whether the PlainLayout should be used or, instead, the user
14384 can change the paragraph style used in the inset.
14388 \begin_layout Description
14389 \begin_inset Flex Code
14392 \begin_layout Plain Layout
14398 As with paragraph styles (see page
14399 \begin_inset CommandInset ref
14400 LatexCommand pageref
14401 reference "des:FreeSpacing"
14409 \begin_layout Description
14410 \begin_inset Flex Code
14413 \begin_layout Plain Layout
14419 These tags control XHTML output.
14421 \begin_inset CommandInset ref
14422 LatexCommand formatted
14423 reference "sec:Tags-for-XHTML"
14430 \begin_layout Description
14431 \begin_inset Flex Code
14434 \begin_layout Plain Layout
14441 \begin_inset Flex Code
14444 \begin_layout Plain Layout
14453 \begin_inset Flex Code
14456 \begin_layout Plain Layout
14462 ] Whether to include the contents of this inset in the strings generated
14463 for the `Outline' pane.
14464 One would not, for example, want the content of a footnote in a section
14465 header to be included in the TOC displayed in the outline, but one would
14466 normally want the content of a character style displayed.
14467 Default is false: not to include.
14470 \begin_layout Description
14471 \begin_inset Flex Code
14474 \begin_layout Plain Layout
14480 As with paragraph styles (see page
14481 \begin_inset CommandInset ref
14482 LatexCommand pageref
14483 reference "des:KeepEmpty"
14491 \begin_layout Description
14492 \begin_inset Flex Code
14495 \begin_layout Plain Layout
14501 The font used for the label.
14503 \begin_inset space ~
14507 \begin_inset CommandInset ref
14509 reference "sub:Font-description"
14514 Note that this definition can never appear before
14515 \begin_inset Flex Code
14518 \begin_layout Plain Layout
14524 , lest it be ineffective.
14527 \begin_layout Description
14528 \begin_inset Flex Code
14531 \begin_layout Plain Layout
14537 What will be displayed on the button or elsewhere as the inset label.
14538 Some inset types (TeX code and Branch) modify this label on the fly.
14541 \begin_layout Description
14542 \begin_inset Flex Code
14545 \begin_layout Plain Layout
14551 The name of the corresponding LaTeX stuff.
14552 Either the environment or command name.
14555 \begin_layout Description
14556 \begin_inset Flex Code
14559 \begin_layout Plain Layout
14565 The optional parameter for the corresponding
14566 \begin_inset Flex Code
14569 \begin_layout Plain Layout
14575 stuff, including possible bracket pairs like
14576 \begin_inset Flex Code
14579 \begin_layout Plain Layout
14586 This parameter cannot be changed from within LyX.
14589 \begin_layout Description
14590 \begin_inset Flex Code
14593 \begin_layout Plain Layout
14599 As with paragraph styles (see page
14600 \begin_inset CommandInset ref
14601 LatexCommand pageref
14602 reference "des:LatexType"
14609 \begin_layout Description
14610 \begin_inset Flex Code
14613 \begin_layout Plain Layout
14620 \begin_inset Flex Code
14623 \begin_layout Plain Layout
14630 \begin_inset Flex Code
14633 \begin_layout Plain Layout
14640 \begin_inset Flex Code
14643 \begin_layout Plain Layout
14650 \begin_inset Flex Code
14653 \begin_layout Plain Layout
14659 (indicating a dummy definition ending definitions of charstyles, etc).
14660 This entry is required in and is only meaningful for Flex insets.
14661 Among other things, it determines on which menu this inset will appear.
14663 \begin_inset Flex Code
14666 \begin_layout Plain Layout
14673 \begin_inset Flex Code
14676 \begin_layout Plain Layout
14683 \begin_inset Flex Code
14686 \begin_layout Plain Layout
14694 \begin_inset Flex Code
14697 \begin_layout Plain Layout
14703 can be set to true for charstyle insets, if you wish, by setting it
14708 \begin_inset Flex Code
14711 \begin_layout Plain Layout
14720 \begin_layout Description
14721 \begin_inset Flex Code
14724 \begin_layout Plain Layout
14731 \begin_inset Flex Code
14734 \begin_layout Plain Layout
14743 \begin_inset Flex Code
14746 \begin_layout Plain Layout
14752 ] Whether multiple paragraphs are permitted in this inset.
14754 \begin_inset Flex Code
14757 \begin_layout Plain Layout
14763 to the same value and
14764 \begin_inset Flex Code
14767 \begin_layout Plain Layout
14773 to the opposite value.
14774 These can be reset to other values, if they are used
14779 \begin_inset Flex Code
14782 \begin_layout Plain Layout
14792 \begin_layout Description
14793 \begin_inset Flex Code
14796 \begin_layout Plain Layout
14803 \begin_inset Flex Code
14806 \begin_layout Plain Layout
14815 \begin_inset Flex Code
14818 \begin_layout Plain Layout
14824 ] Whether fragile commands in this layout should be
14825 \begin_inset Flex Code
14828 \begin_layout Plain Layout
14841 whether the command should itself be protected.) Default is false.
14844 \begin_layout Description
14845 \begin_inset Flex Code
14848 \begin_layout Plain Layout
14855 \begin_inset Flex Code
14858 \begin_layout Plain Layout
14867 \begin_inset Flex Code
14870 \begin_layout Plain Layout
14876 ] As with paragraph styles (see page
14877 \begin_inset CommandInset ref
14878 LatexCommand pageref
14879 reference "des:ParbreakIsNewline"
14887 \begin_layout Description
14888 \begin_inset Flex Code
14891 \begin_layout Plain Layout
14898 \begin_inset Flex Code
14901 \begin_layout Plain Layout
14910 \begin_inset Flex Code
14913 \begin_layout Plain Layout
14919 ] As with paragraph styles (see page
14920 \begin_inset CommandInset ref
14921 LatexCommand pageref
14922 reference "des:PassThru"
14930 \begin_layout Description
14931 \begin_inset Flex Code
14934 \begin_layout Plain Layout
14940 As with paragraph styles (see page
14941 \begin_inset CommandInset ref
14942 LatexCommand pageref
14943 reference "des:Preamble"
14950 \begin_layout Description
14951 \begin_inset Flex Code
14954 \begin_layout Plain Layout
14961 \begin_inset Flex Code
14964 \begin_layout Plain Layout
14970 ] The prefix to use when creating labels referring to insets of this type.
14971 This allows the use of formatted references.
14974 \begin_layout Description
14975 \begin_inset Flex Code
14978 \begin_layout Plain Layout
14985 \begin_inset Flex Code
14988 \begin_layout Plain Layout
14994 ] As with paragraph styles (see page
14995 \begin_inset CommandInset ref
14996 LatexCommand pageref
14997 reference "des:Requires"
15004 \begin_layout Description
15005 \begin_inset Flex Code
15008 \begin_layout Plain Layout
15015 \begin_inset Flex Code
15018 \begin_layout Plain Layout
15025 \begin_inset Flex Code
15028 \begin_layout Plain Layout
15036 ] Whether this inset should use the font of its surrounding environment
15038 Default is true: uses its own.
15041 \begin_layout Description
15042 \begin_inset Flex Code
15045 \begin_layout Plain Layout
15052 \begin_inset Flex Code
15055 \begin_layout Plain Layout
15062 \begin_inset Flex Code
15065 \begin_layout Plain Layout
15073 ] Spellcheck the contents of this inset.
15077 \begin_layout Subsection
15079 \begin_inset CommandInset label
15081 name "sub:Counters"
15088 \begin_layout Standard
15089 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15091 \begin_inset Flex MenuItem
15094 \begin_layout Plain Layout
15101 \begin_inset Flex MenuItem
15104 \begin_layout Plain Layout
15110 , \SpecialChar \ldots{}
15111 ) in the text class itself.
15112 The standard counters are defined in the file
15113 \begin_inset Flex Code
15116 \begin_layout Plain Layout
15122 , so you may have to do no more than add
15125 \begin_layout LyX-Code
15126 Input stdcounters.inc
15129 \begin_layout Standard
15130 to your layout file to get them to work.
15131 But if you want to define custom counters, then you can do so.
15132 The counter declaration must begin with:
15135 \begin_layout LyX-Code
15136 Counter CounterName
15139 \begin_layout Standard
15141 \begin_inset Flex Code
15144 \begin_layout Plain Layout
15150 ' is replaced by the name of the counter.
15151 And it must end with
15152 \begin_inset Quotes eld
15156 \begin_inset Flex Code
15159 \begin_layout Plain Layout
15166 \begin_inset Quotes erd
15170 The following parameters can also be used:
15173 \begin_layout Description
15174 \begin_inset Flex Code
15177 \begin_layout Plain Layout
15184 \begin_inset Flex Code
15187 \begin_layout Plain Layout
15194 \begin_inset Quotes erd
15198 \begin_inset Quotes erd
15201 ] When defined, this string defines how the counter is displayed.
15202 Setting this value sets
15203 \begin_inset Flex Code
15206 \begin_layout Plain Layout
15207 LabelStringAppendix
15213 The following special constructs can be used in the string:
15217 \begin_layout Itemize
15218 \begin_inset Flex Code
15221 \begin_layout Plain Layout
15229 will be replaced by the expansion of the
15230 \begin_inset Flex Code
15233 \begin_layout Plain Layout
15240 \begin_inset Flex Code
15243 \begin_layout Plain Layout
15244 LabelStringAppendix
15250 \begin_inset Flex Code
15253 \begin_layout Plain Layout
15263 \begin_layout Itemize
15264 counter values can be expressed using LaTeX-like macros
15265 \begin_inset Flex Code
15268 \begin_layout Plain Layout
15285 \begin_inset Flex Code
15288 \begin_layout Plain Layout
15300 \begin_layout Plain Layout
15310 Actually, the situation is a bit more complicated: any
15329 other than those described below will produce arabic numerals.
15330 It would not be surprising to see this change in the future.
15336 \begin_inset Flex Code
15339 \begin_layout Plain Layout
15345 : 1, 2, 3,\SpecialChar \ldots{}
15347 \begin_inset Flex Code
15350 \begin_layout Plain Layout
15356 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15358 \begin_inset Flex Code
15361 \begin_layout Plain Layout
15367 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15369 \begin_inset Flex Code
15372 \begin_layout Plain Layout
15378 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15380 \begin_inset Flex Code
15383 \begin_layout Plain Layout
15389 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15391 \begin_inset Flex Code
15394 \begin_layout Plain Layout
15400 for hebrew numerals.
15404 \begin_layout Standard
15405 If LabelString is not defined, a default value is constructed as follows:
15406 if the counter has a master counter
15407 \begin_inset Flex Code
15410 \begin_layout Plain Layout
15417 \begin_inset Flex Code
15420 \begin_layout Plain Layout
15427 \begin_inset Flex Code
15430 \begin_layout Plain Layout
15440 is used; otherwise the string
15441 \begin_inset Flex Code
15444 \begin_layout Plain Layout
15455 \begin_layout Description
15456 \begin_inset Flex Code
15459 \begin_layout Plain Layout
15460 LabelStringAppendix
15466 \begin_inset Flex Code
15469 \begin_layout Plain Layout
15476 \begin_inset Quotes erd
15480 \begin_inset Quotes erd
15484 \begin_inset Flex Code
15487 \begin_layout Plain Layout
15493 , but for use in the Appendix.
15496 \begin_layout Description
15497 \begin_inset Flex Code
15500 \begin_layout Plain Layout
15507 \begin_inset Flex Code
15510 \begin_layout Plain Layout
15517 \begin_inset Quotes erd
15521 \begin_inset Quotes erd
15524 ] A format for use with formatted references to this counter.
15525 For example, one might want to have references to section numbers appear
15527 \begin_inset Quotes eld
15531 \begin_inset Quotes erd
15535 The string should contain
15536 \begin_inset Quotes eld
15540 \begin_inset Quotes erd
15544 This will be replaced by the counter number itself.
15545 So, for sections, it would be: Section ##.
15548 \begin_layout Description
15549 \begin_inset Flex Code
15552 \begin_layout Plain Layout
15559 \begin_inset Flex Code
15562 \begin_layout Plain Layout
15569 \begin_inset Quotes erd
15573 \begin_inset Quotes erd
15576 ] If this is set to the name of another counter, the present counter will
15577 be reset every time the other one is increased.
15579 \begin_inset Flex Code
15582 \begin_layout Plain Layout
15589 \begin_inset Flex Code
15592 \begin_layout Plain Layout
15601 \begin_layout Subsection
15603 \begin_inset CommandInset label
15605 name "sub:Font-description"
15612 \begin_layout Standard
15613 A font description looks like this:
15616 \begin_layout LyX-Code
15626 \begin_layout LyX-Code
15630 \begin_layout LyX-Code
15634 \begin_layout Standard
15635 The following commands are available:
15638 \begin_layout Description
15639 \begin_inset Flex Code
15642 \begin_layout Plain Layout
15649 \begin_inset Flex Code
15652 \begin_layout Plain Layout
15661 \begin_inset Flex Code
15664 \begin_layout Plain Layout
15671 \begin_inset Flex Code
15674 \begin_layout Plain Layout
15681 \begin_inset Flex Code
15684 \begin_layout Plain Layout
15691 \begin_inset Flex Code
15694 \begin_layout Plain Layout
15701 \begin_inset Flex Code
15704 \begin_layout Plain Layout
15711 \begin_inset Flex Code
15714 \begin_layout Plain Layout
15721 \begin_inset Flex Code
15724 \begin_layout Plain Layout
15731 \begin_inset Flex Code
15734 \begin_layout Plain Layout
15743 \begin_layout Description
15744 \begin_inset Flex Code
15747 \begin_layout Plain Layout
15754 \begin_inset Flex Code
15757 \begin_layout Plain Layout
15766 \begin_inset Flex Code
15769 \begin_layout Plain Layout
15776 \begin_inset Flex Code
15779 \begin_layout Plain Layout
15788 \begin_layout Description
15789 \begin_inset Flex Code
15792 \begin_layout Plain Layout
15799 \begin_inset Flex Code
15802 \begin_layout Plain Layout
15808 ] Valid arguments are:
15809 \begin_inset Flex Code
15812 \begin_layout Plain Layout
15819 \begin_inset Flex Code
15822 \begin_layout Plain Layout
15829 \begin_inset Flex Code
15832 \begin_layout Plain Layout
15839 \begin_inset Flex Code
15842 \begin_layout Plain Layout
15849 \begin_inset Flex Code
15852 \begin_layout Plain Layout
15859 \begin_inset Flex Code
15862 \begin_layout Plain Layout
15869 Each of these turns on or off the corresponding attribute.
15871 \begin_inset Flex Code
15874 \begin_layout Plain Layout
15880 turns on emphasis, and
15881 \begin_inset Flex Code
15884 \begin_layout Plain Layout
15892 \begin_inset Newline newline
15895 If the latter seems puzzling, remember that the font settings for the present
15896 context are generally inherited from the surrounding context.
15898 \begin_inset Flex Code
15901 \begin_layout Plain Layout
15907 would turn off the emphasis that was anyway in effect, say, in a theorem
15911 \begin_layout Description
15912 \begin_inset Flex Code
15915 \begin_layout Plain Layout
15922 \begin_inset Flex Code
15925 \begin_layout Plain Layout
15934 \begin_inset Flex Code
15937 \begin_layout Plain Layout
15946 \begin_layout Description
15947 \begin_inset Flex Code
15950 \begin_layout Plain Layout
15957 \begin_inset Flex Code
15960 \begin_layout Plain Layout
15969 \begin_inset Flex Code
15972 \begin_layout Plain Layout
15979 \begin_inset Flex Code
15982 \begin_layout Plain Layout
15989 \begin_inset Flex Code
15992 \begin_layout Plain Layout
16001 \begin_layout Description
16002 \begin_inset Flex Code
16005 \begin_layout Plain Layout
16012 \begin_inset Flex Code
16015 \begin_layout Plain Layout
16022 \begin_inset Flex Code
16025 \begin_layout Plain Layout
16032 \begin_inset Flex Code
16035 \begin_layout Plain Layout
16044 \begin_inset Flex Code
16047 \begin_layout Plain Layout
16054 \begin_inset Flex Code
16057 \begin_layout Plain Layout
16064 \begin_inset Flex Code
16067 \begin_layout Plain Layout
16074 \begin_inset Flex Code
16077 \begin_layout Plain Layout
16084 \begin_inset Flex Code
16087 \begin_layout Plain Layout
16096 \begin_layout Subsection
16097 \begin_inset CommandInset label
16099 name "sub:Citation-format-description"
16103 Citation format description
16106 \begin_layout Standard
16108 \begin_inset Flex Code
16111 \begin_layout Plain Layout
16117 blocks are used to describe how bibliographic information should be displayed,
16118 both within LyX itself (in the citation dialog and in tooltips, for example)
16119 and in XHTML output.
16120 Such a block might look like this:
16123 \begin_layout LyX-Code
16127 \begin_layout LyX-Code
16131 \begin_layout LyX-Code
16135 \begin_layout LyX-Code
16139 \begin_layout Standard
16140 The individual lines define how the bibliographic information associated
16141 with an article or book, respectively, is to be displayed, and such a definitio
16142 n can be given for any `entry type' that might be present in a BibTeX file.
16143 LyX defines a default format in the source code that will be used if no
16144 specific definition has been given.
16145 LyX predefines several formats in the file
16146 \begin_inset Flex Code
16149 \begin_layout Plain Layout
16155 , which is included in most of LyX's document classes.
16158 \begin_layout Standard
16159 The definitions use a simple language that allows BibTeX keys to be replaced
16161 Keys should be enclosed in
16162 \begin_inset Flex Code
16165 \begin_layout Plain Layout
16172 \begin_inset Flex Code
16175 \begin_layout Plain Layout
16182 So a simple definition might look like this:
16185 \begin_layout LyX-Code
16187 \begin_inset Quotes eld
16191 \begin_inset Quotes erd
16197 \begin_layout Standard
16198 This would print the author, followed by a comma, followed by the title,
16199 in quotes, followed by a period.
16202 \begin_layout Standard
16203 Of course, sometimes you may want to print a key only if it exists.
16204 This can be done by using a conditional construction, such as:
16205 \begin_inset Flex Code
16208 \begin_layout Plain Layout
16210 \begin_inset space ~
16220 \begin_inset Flex Code
16223 \begin_layout Plain Layout
16229 key exists, then print
16230 \begin_inset Quotes eld
16234 \begin_inset space ~
16238 \begin_inset Quotes erd
16241 followed by the volume key.
16242 It is also possible to have an else clause in the conditional, such as:
16244 \begin_inset Flex Code
16247 \begin_layout Plain Layout
16248 {%author%[[%author%]][[%editor%, ed.]]}
16255 \begin_inset Flex Code
16258 \begin_layout Plain Layout
16264 key is printed if it exists; otherwise, the editor key is printed, followed
16266 \begin_inset Quotes eld
16270 \begin_inset space ~
16274 \begin_inset Quotes erd
16277 Note that the key is again enclosed in
16278 \begin_inset Flex Code
16281 \begin_layout Plain Layout
16287 signs; the entire conditional is enclosed in braces; and the if and else
16288 clauses are enclosed in double brackets,
16289 \begin_inset Quotes eld
16293 \begin_inset Flex Code
16296 \begin_layout Plain Layout
16303 \begin_inset Quotes eld
16307 \begin_inset Quotes eld
16311 \begin_inset Flex Code
16314 \begin_layout Plain Layout
16321 \begin_inset Quotes erd
16325 There must be no space between any of these.
16328 \begin_layout Standard
16329 There is one other piece of syntax available in definitions, which looks
16331 \begin_inset Flex Code
16334 \begin_layout Plain Layout
16341 This defines a piece of formatting information that is to be used when
16343 \begin_inset Quotes eld
16347 \begin_inset Quotes erd
16351 Obviously, we do not want to output HTML tags when writing plain text,
16352 so they should be wrapped in
16353 \begin_inset Quotes eld
16357 \begin_inset Quotes erd
16361 \begin_inset Quotes eld
16365 \begin_inset Quotes erd
16371 \begin_layout Standard
16372 Two special sorts of definitions are also possible in a
16373 \begin_inset Flex Code
16376 \begin_layout Plain Layout
16383 An example of the first would be:
16386 \begin_layout LyX-Code
16388 \begin_inset Quotes eld
16392 \begin_inset Quotes erd
16398 \begin_layout Standard
16399 This is an abbreviation, or macro, and it can be used by treating it as
16401 \begin_inset Flex Code
16404 \begin_layout Plain Layout
16412 \begin_inset Flex Code
16415 \begin_layout Plain Layout
16421 exactly as it would treat its definition.
16422 So, let us issue the obvious
16430 \begin_layout LyX-Code
16434 \begin_layout Standard
16435 or anything like it.
16436 LyX shouldn't go into an infinite loop, but it may go into a long one before
16440 \begin_layout Standard
16441 The second sort of special definition might look like this:
16444 \begin_layout LyX-Code
16448 \begin_layout Standard
16449 This defines a translatable piece of text, which allows relevant parts of
16450 the bibliography to be translated.
16451 It can be included in a definition by treating it as a key:
16452 \begin_inset Flex Code
16455 \begin_layout Plain Layout
16462 Several of these are predefined in
16463 \begin_inset Flex Code
16466 \begin_layout Plain Layout
16473 Note that these are not macros, in the sense just defined.
16474 They will not be expanded.
16477 \begin_layout Standard
16478 So here then is an example that use all these features:
16481 \begin_layout LyX-Code
16482 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16485 \begin_layout Standard
16486 The defines a macro that prints the author, followed by a comma, if the
16488 \begin_inset Flex Code
16491 \begin_layout Plain Layout
16497 key is defined, or else prints the name of the editor, followed by the
16499 \begin_inset Flex Code
16502 \begin_layout Plain Layout
16508 or its translation (it is by default
16509 \begin_inset Quotes eld
16513 \begin_inset Quotes erd
16517 \begin_inset Flex Code
16520 \begin_layout Plain Layout
16527 Note that this is in fact defined in
16528 \begin_inset Flex Code
16531 \begin_layout Plain Layout
16537 , so you can use it in your own definitions, or re-definitions, if you load
16541 \begin_layout Section
16542 \begin_inset CommandInset label
16544 name "sec:Tags-for-XHTML"
16548 Tags for XHTML output
16551 \begin_layout Standard
16552 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16553 by layout information.
16554 In general, LyX provides sensible defaults and, as mentioned earlier, it
16555 will even construct default CSS style rules from the other layout tags.
16556 For example, LyX will attempt to use the information provided in the
16557 \begin_inset Flex Code
16560 \begin_layout Plain Layout
16566 declaration for the Chapter style to write CSS that will appropriately
16567 format chapter headings.
16570 \begin_layout Standard
16571 In many cases, then, you may not have to do anything at all to get acceptable
16572 XHTML output for your own environments, custom insets, and so forth.
16573 But in some cases you will, and so LyX provides a number of layout tags
16574 that can be used to customize the XHTML and CSS that are generated.
16577 \begin_layout Standard
16578 Note that there are two tags,
16579 \begin_inset Flex Code
16582 \begin_layout Plain Layout
16589 \begin_inset Flex Code
16592 \begin_layout Plain Layout
16598 that may appear outside style and inset declarations.
16600 \begin_inset CommandInset ref
16602 reference "sub:General-text-class"
16606 for details on these.
16609 \begin_layout Subsection
16610 \begin_inset CommandInset label
16612 name "sub:Paragraph-Style-XHTML"
16619 \begin_layout Standard
16620 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16621 dealing with a normal paragraph, a command, or an environment, where this
16622 is itself determined by the contents of the corresponding
16623 \begin_inset Flex Code
16626 \begin_layout Plain Layout
16636 \begin_layout Standard
16637 For a command or normal paragraph, the output XHTML has the following form:
16640 \begin_layout LyX-Code
16642 \begin_inset Quotes erd
16646 \begin_inset Quotes erd
16652 \begin_layout LyX-Code
16654 \begin_inset Quotes erd
16658 \begin_inset Quotes erd
16664 \begin_layout LyX-Code
16665 Contents of the paragraph.
16668 \begin_layout LyX-Code
16672 \begin_layout Standard
16673 The label tags are of course omitted if the paragraph does not have a label.
16676 \begin_layout Standard
16677 For an environment that is not some sort of list, the XHTML takes this form:
16680 \begin_layout LyX-Code
16682 \begin_inset Quotes erd
16686 \begin_inset Quotes erd
16692 \begin_layout LyX-Code
16694 \begin_inset Quotes erd
16698 \begin_inset Quotes erd
16702 \begin_inset Quotes erd
16706 \begin_inset Quotes erd
16709 >Environment Label</labeltag>First paragraph.</itemtag>
16712 \begin_layout LyX-Code
16713 <itemtag>Second paragraph.</itemtag>
16716 \begin_layout LyX-Code
16720 \begin_layout Standard
16721 Note that the label is output only for the first paragraph, as it should
16722 be for a theorem, for example.
16726 \begin_layout Standard
16727 For a list, we have one of these forms:
16730 \begin_layout LyX-Code
16732 \begin_inset Quotes erd
16736 \begin_inset Quotes erd
16742 \begin_layout LyX-Code
16744 \begin_inset Quotes erd
16748 \begin_inset Quotes erd
16752 \begin_inset Quotes erd
16756 \begin_inset Quotes erd
16759 >List Label</labeltag>First item.</itemtag>
16762 \begin_layout LyX-Code
16764 \begin_inset Quotes erd
16768 \begin_inset Quotes erd
16772 \begin_inset Quotes erd
16776 \begin_inset Quotes erd
16779 >List Label</labeltag>Second item.</itemtag>
16782 \begin_layout LyX-Code
16786 \begin_layout LyX-Code
16790 \begin_layout LyX-Code
16792 \begin_inset Quotes erd
16796 \begin_inset Quotes erd
16802 \begin_layout LyX-Code
16804 \begin_inset Quotes erd
16808 \begin_inset Quotes erd
16811 >List Label</labeltag><itemtag attr=
16812 \begin_inset Quotes erd
16816 \begin_inset Quotes erd
16819 >First item.</itemtag>
16822 \begin_layout LyX-Code
16824 \begin_inset Quotes erd
16828 \begin_inset Quotes erd
16831 >List Label</labeltag><itemtag attr=
16832 \begin_inset Quotes erd
16836 \begin_inset Quotes erd
16839 >Second item.</itemtag>
16842 \begin_layout LyX-Code
16846 \begin_layout Standard
16847 Note the different orders of
16848 \begin_inset Flex Code
16851 \begin_layout Plain Layout
16858 \begin_inset Flex Code
16861 \begin_layout Plain Layout
16868 Which order we get depends upon the setting of
16869 \begin_inset Flex Code
16872 \begin_layout Plain Layout
16879 \begin_inset Flex Code
16882 \begin_layout Plain Layout
16888 is false (the default), you get the first of these, with the label within
16889 the item; if true, you get the second, with the label outside the item.
16892 \begin_layout Standard
16893 The specific tags and attributes output for each paragraph type can be controlle
16894 d by means of the layout tags we are about to describe.
16895 As mentioned earlier, however, LyX uses sensible defaults for many of these,
16896 so you often may not need to do very much to get good XHTML output.
16897 Think of the available tags as there so you can tweak things to your liking.
16900 \begin_layout Description
16901 \begin_inset Flex Code
16904 \begin_layout Plain Layout
16911 \begin_inset Flex Code
16914 \begin_layout Plain Layout
16920 ] Specifies attribute information to be output with the main tag.
16922 \begin_inset Quotes eld
16926 \begin_inset Flex Code
16929 \begin_layout Plain Layout
16936 \begin_inset Quotes erd
16940 By default, LyX will output
16941 \begin_inset Quotes eld
16945 \begin_inset Flex Code
16948 \begin_layout Plain Layout
16955 \begin_inset Quotes erd
16959 \begin_inset Flex Code
16962 \begin_layout Plain Layout
16968 is the LyX name of the layout, made lowercase, for example: chapter.
16973 contain any style information.
16975 \begin_inset Flex Code
16978 \begin_layout Plain Layout
16987 \begin_layout Description
16988 \begin_inset Flex Code
16991 \begin_layout Plain Layout
16998 \begin_inset Flex Code
17001 \begin_layout Plain Layout
17011 ] Whether to output the default CSS information LyX generates for this layout,
17012 even if additional information is explicitly provided via
17013 \begin_inset Flex Code
17016 \begin_layout Plain Layout
17024 \begin_inset Flex Code
17027 \begin_layout Plain Layout
17033 allows you to alter or augment the generated CSS, rather than to override
17036 \begin_inset Flex Code
17039 \begin_layout Plain Layout
17048 \begin_layout Description
17049 \begin_inset Flex Code
17052 \begin_layout Plain Layout
17059 \begin_inset Flex Code
17062 \begin_layout Plain Layout
17068 ] The tag to be used for individual paragraphs of environments, replacing
17070 \begin_inset Flex Code
17073 \begin_layout Plain Layout
17079 in the examples above.
17081 \begin_inset Flex Code
17084 \begin_layout Plain Layout
17093 \begin_layout Description
17094 \begin_inset Flex Code
17097 \begin_layout Plain Layout
17104 \begin_inset Flex Code
17107 \begin_layout Plain Layout
17113 ] Attributes for the item tag.
17115 \begin_inset Quotes eld
17119 \begin_inset Flex Code
17122 \begin_layout Plain Layout
17123 class=`layoutname_item'
17129 \begin_inset Quotes erd
17137 contain any style information.
17139 \begin_inset Flex Code
17142 \begin_layout Plain Layout
17151 \begin_layout Description
17152 \begin_inset Flex Code
17155 \begin_layout Plain Layout
17162 \begin_inset Flex Code
17165 \begin_layout Plain Layout
17171 ] The tag to be used for paragraph and item labels, replacing
17172 \begin_inset Flex Code
17175 \begin_layout Plain Layout
17181 in the examples above.
17183 \begin_inset Flex Code
17186 \begin_layout Plain Layout
17193 \begin_inset Flex Code
17196 \begin_layout Plain Layout
17203 \begin_inset Flex Code
17206 \begin_layout Plain Layout
17213 \begin_inset Flex Code
17216 \begin_layout Plain Layout
17217 Centered_Top_Environment
17222 , in which case it defaults to
17223 \begin_inset Flex Code
17226 \begin_layout Plain Layout
17235 \begin_layout Description
17236 \begin_inset Flex Code
17239 \begin_layout Plain Layout
17246 \begin_inset Flex Code
17249 \begin_layout Plain Layout
17255 ] Attributes for the label tag.
17257 \begin_inset Quotes eld
17261 \begin_inset Flex Code
17264 \begin_layout Plain Layout
17265 class=`layoutname_label'
17271 \begin_inset Quotes erd
17279 contain any style information.
17281 \begin_inset Flex Code
17284 \begin_layout Plain Layout
17293 \begin_layout Description
17294 \begin_inset Flex Code
17297 \begin_layout Plain Layout
17304 \begin_inset Flex Code
17307 \begin_layout Plain Layout
17317 ] Meaningful only for list-like environments, this tag controls whether
17318 the label tag is output before or inside the item tag.
17319 This is used, for example, in the description environment, where we want
17321 \begin_inset Flex Code
17324 \begin_layout Plain Layout
17325 <dt>\SpecialChar \ldots{}
17326 </dt><dd>\SpecialChar \ldots{}
17334 \begin_inset Flex Code
17337 \begin_layout Plain Layout
17343 : The label tag is output inside the item tag.
17346 \begin_layout Description
17347 \begin_inset Flex Code
17350 \begin_layout Plain Layout
17356 Information to be output in the
17357 \begin_inset Flex Code
17360 \begin_layout Plain Layout
17366 section when this style is used.
17367 This might, for example, be used to include a
17368 \begin_inset Flex Code
17371 \begin_layout Plain Layout
17378 \begin_inset Flex Code
17381 \begin_layout Plain Layout
17390 \begin_layout Description
17391 \begin_inset Flex Code
17394 \begin_layout Plain Layout
17400 CSS style information to be included when this style is used.
17401 Note that this will automatically be wrapped in a layout-generated
17402 \begin_inset Flex Code
17405 \begin_layout Plain Layout
17411 block, so only the CSS itself need be included.
17414 \begin_layout Description
17415 \begin_inset Flex Code
17418 \begin_layout Plain Layout
17425 \begin_inset Flex Code
17428 \begin_layout Plain Layout
17434 ] The tag to be used for the main label, replacing
17435 \begin_inset Flex Code
17438 \begin_layout Plain Layout
17444 in the examples above.
17446 \begin_inset Flex Code
17449 \begin_layout Plain Layout
17458 \begin_layout Description
17459 \begin_inset Flex Code
17462 \begin_layout Plain Layout
17469 \begin_inset Flex Code
17472 \begin_layout Plain Layout
17482 ] Marks this style as the one to be used to generate the
17483 \begin_inset Flex Code
17486 \begin_layout Plain Layout
17492 tag for the XHTML file.
17493 By default, it is false.
17495 \begin_inset Flex Code
17498 \begin_layout Plain Layout
17504 file sets it to true for the
17505 \begin_inset Flex Code
17508 \begin_layout Plain Layout
17518 \begin_layout Subsection
17522 \begin_layout Standard
17523 The XHTML output of insets can also be controlled by information in layout
17528 \begin_layout Plain Layout
17529 At present, this is true only for
17530 \begin_inset Quotes eld
17534 \begin_inset Quotes erd
17537 insets (insets you can type into) and is not true for
17538 \begin_inset Quotes eld
17542 \begin_inset Quotes erd
17545 insets (insets that are associated with dialog boxes).
17550 Here, too, LyX tries to provide sensible defaults, and it constructs default
17552 But everything can be customized.
17555 \begin_layout Standard
17556 The XHTML LyX outputs for an inset has the following form:
17559 \begin_layout LyX-Code
17561 \begin_inset Quotes erd
17565 \begin_inset Quotes erd
17571 \begin_layout LyX-Code
17572 <labeltag>Label</labeltag>
17575 \begin_layout LyX-Code
17577 \begin_inset Quotes erd
17581 \begin_inset Quotes erd
17584 >Contents of the inset.</innertag>
17587 \begin_layout LyX-Code
17591 \begin_layout Standard
17592 If the inset permits multiple paragraphs---that is, if
17593 \begin_inset Flex Code
17596 \begin_layout Plain Layout
17602 is true---then the contents of the inset will itself be output as paragraphs
17603 formatted according to the styles used for those paragraphs (standard,
17604 quote, and the like).
17605 The label tag is of course omitted if the paragraph does not have a label
17606 and, at present, is always
17607 \begin_inset Flex Code
17610 \begin_layout Plain Layout
17617 The inner tag is optional and, by default, does not appear.
17620 \begin_layout Standard
17621 The specific tags and attributes output for each inset can be controlled
17622 by means of the following layout tags.
17625 \begin_layout Description
17626 \begin_inset Flex Code
17629 \begin_layout Plain Layout
17636 \begin_inset Flex Code
17639 \begin_layout Plain Layout
17645 ] Specifies attribute information to be output with the main tag.
17647 \begin_inset Quotes eld
17651 \begin_inset Flex Code
17654 \begin_layout Plain Layout
17655 class=`myinset' onclick=`\SpecialChar \ldots{}
17662 \begin_inset Quotes erd
17666 By default, LyX will output
17667 \begin_inset Quotes eld
17671 \begin_inset Flex Code
17674 \begin_layout Plain Layout
17681 \begin_inset Quotes erd
17685 \begin_inset Flex Code
17688 \begin_layout Plain Layout
17694 is the LyX name of the inset, made lowercase and with non-alphanumeric
17695 characters converted to underscores, for example: footnote.
17698 \begin_layout Description
17699 \begin_inset Flex Code
17702 \begin_layout Plain Layout
17709 \begin_inset Flex Code
17712 \begin_layout Plain Layout
17722 ] Whether to output the default CSS information LyX generates for this layout,
17723 even if additional information is explicitly provided via
17724 \begin_inset Flex Code
17727 \begin_layout Plain Layout
17735 \begin_inset Flex Code
17738 \begin_layout Plain Layout
17744 allows you to alter or augment the generated CSS, rather than to override
17749 \begin_layout Description
17750 \begin_inset Flex Code
17753 \begin_layout Plain Layout
17760 \begin_inset Flex Code
17763 \begin_layout Plain Layout
17769 ] Attributes for the inner tag.
17771 \begin_inset Quotes eld
17775 \begin_inset Flex Code
17778 \begin_layout Plain Layout
17779 class=`insetname_inner'
17785 \begin_inset Quotes erd
17791 \begin_layout Description
17792 \begin_inset Flex Code
17795 \begin_layout Plain Layout
17802 \begin_inset Flex Code
17805 \begin_layout Plain Layout
17811 ] The inner tag, replacing
17812 \begin_inset Flex Code
17815 \begin_layout Plain Layout
17821 in the examples above.
17822 By default, there is none.
17825 \begin_layout Description
17826 \begin_inset Flex Code
17829 \begin_layout Plain Layout
17836 \begin_inset Flex Code
17839 \begin_layout Plain Layout
17847 ] Whether this inset represents a standalone block of text (such as a footnote)
17848 or instead represents material that is included in the surrounding text
17849 (such as a branch).
17853 \begin_layout Description
17854 \begin_inset Flex Code
17857 \begin_layout Plain Layout
17864 \begin_inset Flex Code
17867 \begin_layout Plain Layout
17873 ] A label for this inset, possibly including a reference to a counter.
17874 For example, for footnote, it might be:
17875 \begin_inset Flex Code
17878 \begin_layout Plain Layout
17887 This is optional, and there is no default.
17890 \begin_layout Description
17891 \begin_inset Flex Code
17894 \begin_layout Plain Layout
17900 Information to be output in the
17901 \begin_inset Flex Code
17904 \begin_layout Plain Layout
17910 section when this style is used.
17911 This might, for example, be used to include a
17912 \begin_inset Flex Code
17915 \begin_layout Plain Layout
17922 \begin_inset Flex Code
17925 \begin_layout Plain Layout
17934 \begin_layout Description
17935 \begin_inset Flex Code
17938 \begin_layout Plain Layout
17944 CSS style information to be included when this style is used.
17945 Note that this will automatically be wrapped in a layout-generated
17946 \begin_inset Flex Code
17949 \begin_layout Plain Layout
17955 block, so only the CSS itself need be included.
17958 \begin_layout Description
17959 \begin_inset Flex Code
17962 \begin_layout Plain Layout
17969 \begin_inset Flex Code
17972 \begin_layout Plain Layout
17978 ] The tag to be used for the main label, replacing
17979 \begin_inset Flex Code
17982 \begin_layout Plain Layout
17988 in the examples above.
17989 The default depends upon the setting of
17990 \begin_inset Flex Code
17993 \begin_layout Plain Layout
18000 \begin_inset Flex Code
18003 \begin_layout Plain Layout
18009 is true, the default is
18010 \begin_inset Flex Code
18013 \begin_layout Plain Layout
18019 ; if it is false, the default is
18020 \begin_inset Flex Code
18023 \begin_layout Plain Layout
18032 \begin_layout Subsection
18036 \begin_layout Standard
18037 The XHTML output for floats too can be controlled by layout information.
18038 The output has the following form:
18041 \begin_layout LyX-Code
18043 \begin_inset Quotes erd
18047 \begin_inset Quotes erd
18053 \begin_layout LyX-Code
18054 Contents of the float.
18057 \begin_layout LyX-Code
18061 \begin_layout Standard
18062 The caption, if there is one, is a separate inset and will be output as
18064 Its appearance can be controlled via the InsetLayout for caption insets.
18068 \begin_layout Description
18069 \begin_inset Flex Code
18072 \begin_layout Plain Layout
18079 \begin_inset Flex Code
18082 \begin_layout Plain Layout
18088 ] Specifies attribute information to be output with the main tag.
18090 \begin_inset Quotes eld
18094 \begin_inset Flex Code
18097 \begin_layout Plain Layout
18098 class=`myfloat' onclick=`\SpecialChar \ldots{}
18105 \begin_inset Quotes erd
18109 By default, LyX will output
18110 \begin_inset Quotes eld
18114 \begin_inset Flex Code
18117 \begin_layout Plain Layout
18118 class=`float float-floattype'
18124 \begin_inset Quotes erd
18128 \begin_inset Flex Code
18131 \begin_layout Plain Layout
18137 is LyX's name for this type of float, as determined by the float delcaration
18139 \begin_inset CommandInset ref
18141 reference "sub:Floats"
18145 ), though made lowercase and with non-alphanumeric characters converted
18146 to underscores, for example: float-table.
18149 \begin_layout Description
18150 \begin_inset Flex Code
18153 \begin_layout Plain Layout
18159 CSS style information to be included when this float is used.
18160 Note that this will automatically be wrapped in a layout-generated
18161 \begin_inset Flex Code
18164 \begin_layout Plain Layout
18170 block, so only the CSS itself need be included.
18173 \begin_layout Description
18174 \begin_inset Flex Code
18177 \begin_layout Plain Layout
18184 \begin_inset Flex Code
18187 \begin_layout Plain Layout
18193 ] The tag to be used for this float, replacing
18194 \begin_inset Quotes eld
18198 \begin_inset Flex Code
18201 \begin_layout Plain Layout
18208 \begin_inset Quotes erd
18211 in the example above.
18213 \begin_inset Flex Code
18216 \begin_layout Plain Layout
18222 and will rarely need changing.
18225 \begin_layout Subsection
18226 Bibliography formatting
18229 \begin_layout Standard
18230 The bibliography can be formatted using
18231 \begin_inset Flex Code
18234 \begin_layout Plain Layout
18242 \begin_inset CommandInset ref
18244 reference "sub:Citation-format-description"
18251 \begin_layout Subsection
18255 \begin_layout Standard
18256 We have several times mentioned that LyX will generate default CSS style
18257 rules for both insets and paragraph styles, based upon the other layout
18258 information that is provided.
18259 In this section, we shall say a word about which layout information LyX
18263 \begin_layout Standard
18264 At present, LyX auto-generates CSS only for font information, making use
18266 \begin_inset Flex Code
18269 \begin_layout Plain Layout
18276 \begin_inset Flex Code
18279 \begin_layout Plain Layout
18286 \begin_inset Flex Code
18289 \begin_layout Plain Layout
18296 \begin_inset Flex Code
18299 \begin_layout Plain Layout
18306 \begin_inset Flex Code
18309 \begin_layout Plain Layout
18317 \begin_inset CommandInset ref
18319 reference "sub:Font-description"
18323 .) The translation is mostly straightforward and obvious.
18325 \begin_inset Quotes eld
18329 \begin_inset Flex Code
18332 \begin_layout Plain Layout
18339 \begin_inset Quotes erd
18343 \begin_inset Quotes eld
18347 \begin_inset Flex Code
18350 \begin_layout Plain Layout
18351 font-family: sans-serif;
18357 \begin_inset Quotes erd
18361 The correspondence of LyX sizes and CSS sizes is a little less obvious
18362 but nonetheless intuitive.
18364 \begin_inset Flex Code
18367 \begin_layout Plain Layout
18374 \begin_inset Flex URL
18377 \begin_layout Plain Layout
18388 \begin_layout Chapter
18389 Including External Material
18392 \begin_layout Standard
18393 \begin_inset Box Shadowbox
18403 height_special "totalheight"
18406 \begin_layout Plain Layout
18407 WARNING: This portion of the documentation has not been updated for some
18409 We certainly hope that it is still accurate, but there are no guarantees.
18417 \begin_layout Standard
18418 The use of material from sources external to LyX is covered in detail in
18424 This part of the manual covers what needs to happen behind the scenes for
18425 new sorts of material to be included.
18428 \begin_layout Section
18432 \begin_layout Standard
18433 The external material feature is based on the concept of a
18438 A template is a specification of how LyX should interface with a certain
18440 As bundled, LyX comes with predefined templates for Xfig figures, various
18441 raster format images, chess diagrams, and LilyPond music notation.
18442 You can check the actual list by using the menu
18443 \begin_inset Flex MenuItem
18446 \begin_layout Plain Layout
18447 Insert\SpecialChar \menuseparator
18448 File\SpecialChar \menuseparator
18455 Furthermore, it is possible to roll your own template to support a specific
18457 Later we'll describe in more detail what is involved, and hopefully you
18458 will submit all the templates you create so we can include them in a later
18462 \begin_layout Standard
18463 Another basic idea of the external material feature is to distinguish between
18464 the original file that serves as a base for final material and the produced
18465 file that is included in your exported or printed document.
18466 For example, consider the case of a figure produced with
18467 \begin_inset Flex Code
18470 \begin_layout Plain Layout
18477 The Xfig application itself works on an original file with the
18478 \begin_inset Flex Code
18481 \begin_layout Plain Layout
18488 Within Xfig, you create and change your figure, and when you are done,
18490 \begin_inset Flex Code
18493 \begin_layout Plain Layout
18500 When you want to include the figure in your document, you invoke
18501 \begin_inset Flex Code
18504 \begin_layout Plain Layout
18510 in order to create a PostScript file that can readily be included in your
18513 \begin_inset Flex Code
18516 \begin_layout Plain Layout
18522 file is the original file, and the PostScript file is the produced file.
18525 \begin_layout Standard
18526 This distinction is important in order to allow updating of the material
18527 while you are in the process of writing the document.
18528 Furthermore, it provides us with the flexibility that is needed to support
18529 multiple export formats.
18530 For instance, in the case of a plain text file, it is not exactly an award-winn
18531 ing idea to include the figure as raw PostScript.
18532 Instead, you'd either prefer to just include a reference to the figure
18533 or try to invoke some graphics to ASCII converter to make the final result
18534 look similar to the real graphics.
18535 The external material management allows you to do this, because it is parametri
18536 zed on the different export formats that LyX supports.
18539 \begin_layout Standard
18540 Besides supporting the production of different products according to the
18541 exported format, it supports tight integration with editing and viewing
18543 In the case of an Xfig figure, you are able to invoke Xfig on the original
18544 file with a single click from within the external material dialog in LyX,
18545 and also preview the produced PostScript file with Ghostview with another
18547 No more fiddling around with the command line and/or file browsers to locate
18548 and manipulate the original or produced files.
18549 In this way, you are finally able to take full advantage of the many different
18550 applications that are relevant to use when you write your documents, and
18551 ultimately be more productive.
18554 \begin_layout Section
18555 The external template configuration file
18558 \begin_layout Standard
18559 It is relatively easy to add custom external template definitions to LyX.
18560 However, be aware that doing this in an careless manner most probably
18564 introduce an easily exploitable security hole.
18565 So before you do this, please read the discussion about security in section
18567 \begin_inset CommandInset ref
18569 reference "sec:Security-discussion"
18576 \begin_layout Standard
18577 Having said that, we encourage you to submit any interesting templates that
18582 \begin_layout Standard
18583 The external templates are defined in the
18584 \begin_inset Flex Code
18587 \begin_layout Plain Layout
18588 LyXDir/lib/external_templates
18594 You can place your own version in
18595 \begin_inset Flex Code
18598 \begin_layout Plain Layout
18599 UserDir/external_templates
18607 \begin_layout Standard
18608 A typical template looks like this:
18611 \begin_layout LyX-Code
18615 \begin_layout LyX-Code
18616 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18619 \begin_layout LyX-Code
18623 \begin_layout LyX-Code
18627 \begin_layout LyX-Code
18631 \begin_layout LyX-Code
18635 \begin_layout LyX-Code
18639 \begin_layout LyX-Code
18640 AutomaticProduction true
18643 \begin_layout LyX-Code
18647 \begin_layout LyX-Code
18651 \begin_layout LyX-Code
18655 \begin_layout LyX-Code
18656 TransformCommand Rotate RotationLatexCommand
18659 \begin_layout LyX-Code
18660 TransformCommand Resize ResizeLatexCommand
18663 \begin_layout LyX-Code
18664 Product "$$RotateFront$$ResizeFront
18667 \begin_layout LyX-Code
18672 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18675 \begin_layout LyX-Code
18676 $$ResizeBack$$RotateBack"
18679 \begin_layout LyX-Code
18683 \begin_layout LyX-Code
18684 UpdateResult "$$AbsPath$$Basename.pstex_t"
18687 \begin_layout LyX-Code
18688 Requirement "graphicx"
18691 \begin_layout LyX-Code
18692 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18695 \begin_layout LyX-Code
18696 ReferencedFile latex "$$AbsPath$$Basename.eps"
18699 \begin_layout LyX-Code
18700 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18703 \begin_layout LyX-Code
18707 \begin_layout LyX-Code
18711 \begin_layout LyX-Code
18712 TransformCommand Rotate RotationLatexCommand
18715 \begin_layout LyX-Code
18716 TransformCommand Resize ResizeLatexCommand
18719 \begin_layout LyX-Code
18720 Product "$$RotateFront$$ResizeFront
18723 \begin_layout LyX-Code
18728 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18731 \begin_layout LyX-Code
18732 $$ResizeBack$$RotateBack"
18735 \begin_layout LyX-Code
18736 UpdateFormat pdftex
18739 \begin_layout LyX-Code
18740 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18743 \begin_layout LyX-Code
18744 Requirement "graphicx"
18747 \begin_layout LyX-Code
18748 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18751 \begin_layout LyX-Code
18752 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18755 \begin_layout LyX-Code
18759 \begin_layout LyX-Code
18763 \begin_layout LyX-Code
18764 Product "$$Contents(
18766 "$$AbsPath$$Basename.asc
18771 \begin_layout LyX-Code
18772 UpdateFormat asciixfig
18775 \begin_layout LyX-Code
18776 UpdateResult "$$AbsPath$$Basename.asc"
18779 \begin_layout LyX-Code
18783 \begin_layout LyX-Code
18787 \begin_layout LyX-Code
18788 Product "<graphic fileref=
18790 "$$AbsOrRelPathMaster$$Basename.eps
18795 \begin_layout LyX-Code
18799 \begin_layout LyX-Code
18803 \begin_layout LyX-Code
18804 UpdateResult "$$AbsPath$$Basename.eps"
18807 \begin_layout LyX-Code
18808 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18811 \begin_layout LyX-Code
18812 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18815 \begin_layout LyX-Code
18819 \begin_layout LyX-Code
18820 Product "[XFig: $$FName]"
18823 \begin_layout LyX-Code
18827 \begin_layout LyX-Code
18831 \begin_layout Standard
18832 As you can see, the template is enclosed in
18833 \begin_inset Flex Code
18836 \begin_layout Plain Layout
18842 \SpecialChar \ldots{}
18844 \begin_inset Flex Code
18847 \begin_layout Plain Layout
18854 It contains a header specifying some general settings and, for each supported
18855 primary document file format, a section
18856 \begin_inset Flex Code
18859 \begin_layout Plain Layout
18865 \SpecialChar \ldots{}
18867 \begin_inset Flex Code
18870 \begin_layout Plain Layout
18879 \begin_layout Subsection
18880 The template header
18883 \begin_layout Description
18884 \begin_inset Flex Code
18887 \begin_layout Plain Layout
18888 AutomaticProduction
18889 \begin_inset space ~
18897 Whether the file represented by the template must be generated by LyX.
18898 This command must occur exactly once.
18901 \begin_layout Description
18902 \begin_inset Flex Code
18905 \begin_layout Plain Layout
18907 \begin_inset space ~
18915 A glob pattern that is used in the file dialog to filter out the desired
18917 If there is more than one possible file extension (e.
18918 \begin_inset space \thinspace{}
18922 \begin_inset space \space{}
18926 \begin_inset Flex Code
18929 \begin_layout Plain Layout
18936 \begin_inset Flex Code
18939 \begin_layout Plain Layout
18945 ), use something like
18946 \begin_inset Flex Code
18949 \begin_layout Plain Layout
18956 This command must occur exactly once.
18959 \begin_layout Description
18960 \begin_inset Flex Code
18963 \begin_layout Plain Layout
18965 \begin_inset space ~
18973 The text that is displayed on the button.
18974 This command must occur exactly once.
18977 \begin_layout Description
18978 \begin_inset Flex Code
18981 \begin_layout Plain Layout
18983 \begin_inset space ~
18987 \begin_inset space ~
18995 The help text that is used in the External dialog.
18996 Provide enough information to explain to the user just what the template
18997 can provide him with.
18998 This command must occur exactly once.
19001 \begin_layout Description
19002 \begin_inset Flex Code
19005 \begin_layout Plain Layout
19007 \begin_inset space ~
19015 The file format of the original file.
19016 This must be the name of a format that is known to LyX (see section
19017 \begin_inset CommandInset ref
19019 reference "sec:Formats"
19025 \begin_inset Quotes eld
19029 \begin_inset Flex Code
19032 \begin_layout Plain Layout
19039 \begin_inset Quotes erd
19042 if the template can handle original files of more than one format.
19043 LyX will attempt to interrogate the file itself in order to deduce its
19044 format in this case.
19045 This command must occur exactly once.
19048 \begin_layout Description
19049 \begin_inset Flex Code
19052 \begin_layout Plain Layout
19054 \begin_inset space ~
19062 A unique name for the template.
19063 It must not contain substitution macros (see below).
19066 \begin_layout Description
19067 \begin_inset Flex Code
19070 \begin_layout Plain Layout
19072 \begin_inset space ~
19075 Rotate|Resize|Clip|Extra
19080 This command specifies which transformations are supported by this template.
19081 It may occur zero or more times.
19082 This command enables the corresponding tabs in the external dialog.
19084 \begin_inset Flex Code
19087 \begin_layout Plain Layout
19093 command must have either a corresponding
19094 \begin_inset Flex Code
19097 \begin_layout Plain Layout
19104 \begin_inset Flex Code
19107 \begin_layout Plain Layout
19114 \begin_inset Flex Code
19117 \begin_layout Plain Layout
19124 Otherwise the transformation will not be supported by that format.
19127 \begin_layout Subsection
19131 \begin_layout Description
19132 \begin_inset Flex Code
19135 \begin_layout Plain Layout
19137 \begin_inset space ~
19140 LaTeX|PDFLaTeX|PlainText|DocBook
19145 The primary document file format that this format definition is for.
19146 Not every template has a sensible representation in all document file formats.
19147 Please define nevertheless a
19148 \begin_inset Flex Code
19151 \begin_layout Plain Layout
19157 section for all formats.
19158 Use a dummy text when no representation is available.
19159 Then you can at least see a reference to the external material in the exported
19163 \begin_layout Description
19164 \begin_inset Flex Code
19167 \begin_layout Plain Layout
19169 \begin_inset space ~
19173 \begin_inset space ~
19181 This command defines an additional macro
19182 \begin_inset Flex Code
19185 \begin_layout Plain Layout
19191 for substitution in
19192 \begin_inset Flex Code
19195 \begin_layout Plain Layout
19203 \begin_inset Flex Code
19206 \begin_layout Plain Layout
19212 itself may contain substitution macros.
19213 The advantage over using
19214 \begin_inset Flex Code
19217 \begin_layout Plain Layout
19224 \begin_inset Flex Code
19227 \begin_layout Plain Layout
19233 is that the substituted value of
19234 \begin_inset Flex Code
19237 \begin_layout Plain Layout
19243 is sanitized so that it is a valid optional argument in the document format.
19244 This command may occur zero or more times.
19247 \begin_layout Description
19248 \begin_inset Flex Code
19251 \begin_layout Plain Layout
19253 \begin_inset space ~
19261 The text that is inserted in the exported document.
19262 This is actually the most important command and can be quite complex.
19263 This command must occur exactly once.
19266 \begin_layout Description
19267 \begin_inset Flex Code
19270 \begin_layout Plain Layout
19272 \begin_inset space ~
19280 This command specifies a preamble snippet that will be included in the
19282 It has to be defined using
19283 \begin_inset Flex Code
19286 \begin_layout Plain Layout
19292 \SpecialChar \ldots{}
19294 \begin_inset Flex Code
19297 \begin_layout Plain Layout
19304 This command may occur zero or more times.
19307 \begin_layout Description
19308 \begin_inset Flex Code
19311 \begin_layout Plain Layout
19313 \begin_inset space ~
19317 \begin_inset space ~
19325 This command denotes files that are created by the conversion process and
19326 are needed for a particular export format.
19327 If the filename is relative, it is interpreted relative to the master document.
19328 This command may be given zero or more times.
19331 \begin_layout Description
19332 \begin_inset Flex Code
19335 \begin_layout Plain Layout
19337 \begin_inset space ~
19345 The name of a required LaTeX package.
19346 The package is included via
19347 \begin_inset Flex Code
19350 \begin_layout Plain Layout
19358 in the LaTeX preamble.
19359 This command may occur zero or more times.
19362 \begin_layout Description
19363 \begin_inset Flex Code
19366 \begin_layout Plain Layout
19368 \begin_inset space ~
19372 \begin_inset space ~
19375 RotationLatexCommand
19380 This command specifies that the built in LaTeX command should be used for
19382 This command may occur once or not at all.
19385 \begin_layout Description
19386 \begin_inset Flex Code
19389 \begin_layout Plain Layout
19391 \begin_inset space ~
19395 \begin_inset space ~
19403 This command specifies that the built in LaTeX command should be used for
19405 This command may occur once or not at all.
19408 \begin_layout Description
19409 \begin_inset Flex Code
19412 \begin_layout Plain Layout
19414 \begin_inset space ~
19418 \begin_inset space ~
19421 RotationLatexOption
19426 This command specifies that rotation is done via an optional argument.
19427 This command may occur once or not at all.
19430 \begin_layout Description
19431 \begin_inset Flex Code
19434 \begin_layout Plain Layout
19436 \begin_inset space ~
19440 \begin_inset space ~
19448 This command specifies that resizing is done via an optional argument.
19449 This command may occur once or not at all.
19452 \begin_layout Description
19453 \begin_inset Flex Code
19456 \begin_layout Plain Layout
19458 \begin_inset space ~
19462 \begin_inset space ~
19470 This command specifies that clipping is done via an optional argument.
19471 This command may occur once or not at all.
19474 \begin_layout Description
19475 \begin_inset Flex Code
19478 \begin_layout Plain Layout
19480 \begin_inset space ~
19484 \begin_inset space ~
19492 This command specifies that an extra optional argument is used.
19493 This command may occur once or not at all.
19496 \begin_layout Description
19497 \begin_inset Flex Code
19500 \begin_layout Plain Layout
19502 \begin_inset space ~
19510 The file format of the converted file.
19511 This must be the name of a format that is known to LyX (see the
19512 \begin_inset Flex MenuItem
19515 \begin_layout Plain Layout
19520 ools\SpecialChar \menuseparator
19525 references:Conversion
19531 This command must occur exactly once.
19534 \begin_layout Description
19535 \begin_inset Flex Code
19538 \begin_layout Plain Layout
19540 \begin_inset space ~
19548 The file name of the converted file.
19549 The file name must be absolute.
19550 This command must occur exactly once.
19553 \begin_layout Subsection
19554 Preamble definitions
19557 \begin_layout Standard
19558 The external template configuration file may contain additional preamble
19559 definitions enclosed by
19560 \begin_inset Flex Code
19563 \begin_layout Plain Layout
19569 \SpecialChar \ldots{}
19571 \begin_inset Flex Code
19574 \begin_layout Plain Layout
19581 They can be used by the templates in the
19582 \begin_inset Flex Code
19585 \begin_layout Plain Layout
19594 \begin_layout Section
19595 The substitution mechanism
19598 \begin_layout Standard
19599 When the external material facility invokes an external program, it is done
19600 on the basis of a command defined in the template configuration file.
19601 These commands can contain various macros that are expanded before execution.
19602 Execution always take place in the directory of the containing document.
19605 \begin_layout Standard
19606 Also, whenever external material is to be displayed, the name will be produced
19607 by the substitution mechanism, and most other commands in the template
19608 definition support substitution as well.
19611 \begin_layout Standard
19612 The available macros are the following:
19615 \begin_layout Description
19616 \begin_inset Flex Code
19619 \begin_layout Plain Layout
19620 $$AbsOrRelPathMaster
19625 The file path, absolute or relative to the master LyX document.
19628 \begin_layout Description
19629 \begin_inset Flex Code
19632 \begin_layout Plain Layout
19633 $$AbsOrRelPathParent
19638 The file path, absolute or relative to the LyX document.
19641 \begin_layout Description
19642 \begin_inset Flex Code
19645 \begin_layout Plain Layout
19651 The absolute file path.
19654 \begin_layout Description
19655 \begin_inset Flex Code
19658 \begin_layout Plain Layout
19664 The filename without path and without the extension.
19667 \begin_layout Description
19668 \begin_inset Flex Code
19671 \begin_layout Plain Layout
19673 \begin_inset Quotes eld
19677 \begin_inset Quotes erd
19685 This macro will expand to the contents of the file with the name
19686 \begin_inset Flex Code
19689 \begin_layout Plain Layout
19698 \begin_layout Description
19699 \begin_inset Flex Code
19702 \begin_layout Plain Layout
19708 The file extension (including the dot).
19711 \begin_layout Description
19712 \begin_inset Flex Code
19715 \begin_layout Plain Layout
19721 The filename of the file specified in the external material dialog.
19722 This is either an absolute name, or it is relative to the LyX document.
19725 \begin_layout Description
19726 \begin_inset Flex Code
19729 \begin_layout Plain Layout
19736 \begin_inset Flex Code
19739 \begin_layout Plain Layout
19745 (absolute name or relative to the LyX document).
19748 \begin_layout Description
19749 \begin_inset Flex Code
19752 \begin_layout Plain Layout
19758 The file path, relative to the master LyX document.
19761 \begin_layout Description
19762 \begin_inset Flex Code
19765 \begin_layout Plain Layout
19771 The file path, relative to the LyX document.
19774 \begin_layout Description
19775 \begin_inset Flex Code
19778 \begin_layout Plain Layout
19784 This macro will expand to the absolute path of the system directory.
19785 This is typically used to point to the various helper scripts that are
19789 \begin_layout Description
19790 \begin_inset Flex Code
19793 \begin_layout Plain Layout
19799 A name and full path to a temporary file which will be automatically deleted
19800 whenever the containing document is closed, or the external material insertion
19804 \begin_layout Standard
19805 All path macros contain a trailing directory separator, so you can construct
19807 \begin_inset space \thinspace{}
19811 \begin_inset space \space{}
19814 the absolute filename with
19815 \begin_inset Flex Code
19818 \begin_layout Plain Layout
19819 $$AbsPath$$Basename$$Extension
19827 \begin_layout Standard
19828 The macros above are substituted in all commands unless otherwise noted.
19830 \begin_inset Flex Code
19833 \begin_layout Plain Layout
19839 supports additionally the following substitutions if they are enabled by
19841 \begin_inset Flex Code
19844 \begin_layout Plain Layout
19851 \begin_inset Flex Code
19854 \begin_layout Plain Layout
19863 \begin_layout Description
19864 \begin_inset Flex Code
19867 \begin_layout Plain Layout
19873 The front part of the resize command.
19876 \begin_layout Description
19877 \begin_inset Flex Code
19880 \begin_layout Plain Layout
19886 The back part of the resize command.
19889 \begin_layout Description
19890 \begin_inset Flex Code
19893 \begin_layout Plain Layout
19899 The front part of the rotation command.
19902 \begin_layout Description
19903 \begin_inset Flex Code
19906 \begin_layout Plain Layout
19912 The back part of the rotation command.
19915 \begin_layout Standard
19916 The value string of the
19917 \begin_inset Flex Code
19920 \begin_layout Plain Layout
19926 command supports additionally the following substitutions if they are enabled
19928 \begin_inset Flex Code
19931 \begin_layout Plain Layout
19938 \begin_inset Flex Code
19941 \begin_layout Plain Layout
19950 \begin_layout Description
19951 \begin_inset Flex Code
19954 \begin_layout Plain Layout
19963 \begin_layout Description
19964 \begin_inset Flex Code
19967 \begin_layout Plain Layout
19976 \begin_layout Description
19977 \begin_inset Flex Code
19980 \begin_layout Plain Layout
19989 \begin_layout Description
19990 \begin_inset Flex Code
19993 \begin_layout Plain Layout
19999 The rotation option.
20002 \begin_layout Standard
20003 You may ask why there are so many path macros.
20004 There are mainly two reasons:
20007 \begin_layout Enumerate
20008 Relative and absolute file names should remain relative or absolute, respectivel
20010 Users may have reasons to prefer either form.
20011 Relative names are useful for portable documents that should work on different
20012 machines, for example.
20013 Absolute names may be required by some programs.
20016 \begin_layout Enumerate
20017 LaTeX treats relative file names differently than LyX and other programs
20018 in nested included files.
20019 For LyX, a relative file name is always relative to the document that contains
20021 For LaTeX, it is always relative to the master document.
20022 These two definitions are identical if you have only one document, but
20023 differ if you have a master document that includes part documents.
20024 That means that relative filenames must be transformed when presented to
20026 Fortunately LyX does this automatically for you if you choose the right
20030 \begin_layout Standard
20031 So which path macro should be used in new template definitions? The rule
20035 \begin_layout Itemize
20037 \begin_inset Flex Code
20040 \begin_layout Plain Layout
20046 if an absolute path is required.
20049 \begin_layout Itemize
20051 \begin_inset Flex Code
20054 \begin_layout Plain Layout
20055 $$AbsOrRelPathMaster
20060 if the substituted string is some kind of LaTeX input.
20063 \begin_layout Itemize
20065 \begin_inset Flex Code
20068 \begin_layout Plain Layout
20069 $$AbsOrRelPathParent
20074 in order to preserve the user's choice.
20077 \begin_layout Standard
20078 There are special cases where this rule does not work and e.
20079 \begin_inset space \thinspace{}
20083 \begin_inset space \space{}
20086 relative names are needed, but normally it will work just fine.
20087 One example for such a case is the command
20088 \begin_inset Flex Code
20091 \begin_layout Plain Layout
20092 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20097 in the XFig template above: We can't use the absolute name because the
20099 \begin_inset Flex Code
20102 \begin_layout Plain Layout
20108 files needs the relative name in order to rewrite the file content.
20111 \begin_layout Section
20112 Security discussion
20113 \begin_inset CommandInset label
20115 name "sec:Security-discussion"
20122 \begin_layout Standard
20123 The external material feature interfaces with a lot of external programs
20124 and does so automatically, so we have to consider the security implications
20126 In particular, since you have the option of including your own filenames
20127 and/or parameter strings and those are expanded into a command, it seems
20128 that it would be possible to create a malicious document which executes
20129 arbitrary commands when a user views or prints the document.
20130 This is something we definitely want to avoid.
20133 \begin_layout Standard
20134 However, since the external program commands are specified in the template
20135 configuration file only, there are no security issues if LyX is properly
20136 configured with safe templates only.
20137 This is so because the external programs are invoked with the
20138 \begin_inset Flex Code
20141 \begin_layout Plain Layout
20147 -system call rather than the
20148 \begin_inset Flex Code
20151 \begin_layout Plain Layout
20157 system-call, so it's not possible to execute arbitrary commands from the
20158 filename or parameter section via the shell.
20161 \begin_layout Standard
20162 This also implies that you are restricted in what command strings you can
20163 use in the external material templates.
20164 In particular, pipes and redirection are not readily available.
20165 This has to be so if LyX should remain safe.
20166 If you want to use some of the shell features, you should write a safe
20167 script to do this in a controlled manner, and then invoke the script from
20168 the command string.
20172 \begin_layout Standard
20173 It is possible to design a template that interacts directly with the shell,
20174 but since this would allow a malicious user to execute arbitrary commands
20175 by writing clever filenames and/or parameters, we generally recommend that
20176 you only use safe scripts that work with the
20177 \begin_inset Flex Code
20180 \begin_layout Plain Layout
20186 system call in a controlled manner.
20187 Of course, for use in a controlled environment, it can be tempting to just
20188 fall back to use ordinary shell scripts.
20189 If you do so, be aware that you
20193 provide an easily exploitable security hole in your system.
20194 Of course it stands to reason that such unsafe templates will never be
20195 included in the standard LyX distribution, although we do encourage people
20196 to submit new templates in the open source tradition.
20197 But LyX as shipped from the official distribution channels will never have
20201 \begin_layout Standard
20202 Including external material provides a lot of power, and you have to be
20203 careful not to introduce security hazards with this power.
20204 A subtle error in a single line in an innocent looking script can open
20205 the door to huge security problems.
20206 So if you do not fully understand the issues, we recommend that you consult
20207 a knowledgeable security professional or the LyX development team if you
20208 have any questions about whether a given template is safe or not.
20209 And do this before you use it in an uncontrolled environment.