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}}
68 \font_typewriter default
69 \font_default_family default
77 \default_output_format default
79 \bibtex_command default
80 \index_command default
84 \pdf_title "LyX Configuration Manual"
85 \pdf_author "LyX Team"
86 \pdf_subject "LyX-documentation Customization"
87 \pdf_keywords "LyX, documentation, customization"
89 \pdf_bookmarksnumbered true
90 \pdf_bookmarksopen true
91 \pdf_bookmarksopenlevel 1
96 \pdf_pdfusetitle false
97 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
107 \paperorientation portrait
120 \paragraph_separation indent
121 \paragraph_indentation default
122 \quotes_language english
125 \paperpagestyle headings
126 \tracking_changes false
127 \output_changes false
135 Customizing LyX: Features for the Advanced User
143 \begin_layout Plain Layout
145 If you have comments or error corrections, please send them to the LyX Documenta
147 \begin_inset CommandInset href
149 target "lyx-docs@lists.lyx.org"
156 \begin_inset Quotes eld
160 \begin_inset Quotes erd
163 in the subject header, and please cc the current maintainer of this file,
164 Richard Heck <rgheck@comcast.net>.
170 \begin_inset Newline newline
174 \begin_inset Newline newline
180 \begin_layout Standard
181 \begin_inset CommandInset toc
182 LatexCommand tableofcontents
189 \begin_layout Standard
190 \begin_inset Note Note
193 \begin_layout Plain Layout
194 Please use change tracking when modifying this document.
195 This makes it easier for our translators to recognize things that have
196 been changed, and it helps the maintainer keep up-to-date with what's been
205 \begin_layout Chapter
209 \begin_layout Standard
210 This manual covers the customization features present in LyX.
211 In it, we discuss issues like keyboard shortcuts, screen previewing options,
212 printer options, sending commands to LyX via the LyX Server, internationalizati
213 on, installing new LaTeX classes and LyX layouts, etc.
214 We can't possibly hope to touch on everything you can change—our developers
215 add new features faster than we can document them—but we will explain the
216 most common customizations and hopefully point you in the right direction
217 for some of the more obscure ones.
220 \begin_layout Standard
221 \begin_inset Branch OutDated
224 \begin_layout Standard
225 Information from previous versions of this document that now seems to be
226 outdated is contained in the OutDated branch of this document.
227 By default, this information will not appear in the LaTeX output.
235 \begin_layout Chapter
236 LyX configuration files
239 \begin_layout Standard
240 This chapter aims to help you to find your way through the LyX configuration
242 Before continuing to read this chapter, you should find out where your
243 LyX library and user directories are by using
244 \begin_inset Flex CharStyle:MenuItem
247 \begin_layout Plain Layout
248 Help\SpecialChar \menuseparator
259 The library directory is the place where LyX places its system-wide configurati
260 on files; the user directory is where you can place your modified versions.
261 We will call the former
262 \begin_inset Flex CharStyle:Code
265 \begin_layout Plain Layout
272 \begin_inset Flex CharStyle:MenuItem
275 \begin_layout Plain Layout
281 in the remainder of this document.
285 \begin_layout Section
287 \begin_inset Flex CharStyle:Code
290 \begin_layout Plain Layout
299 \begin_layout Standard
300 \begin_inset Flex CharStyle:Code
303 \begin_layout Plain Layout
309 and its sub-directories contain a number of files and that can be used
310 to customize LyX's behavior.
311 You can change many of these files from within LyX itself through the
312 \begin_inset Flex CharStyle:MenuItem
315 \begin_layout Plain Layout
316 Tools\SpecialChar \menuseparator
323 Most customization that you will want to do in LyX is possible through
325 However, many other inner aspects of LyX can be customized by modifying
327 \begin_inset Flex CharStyle:Code
330 \begin_layout Plain Layout
337 These files fall in different categories, described in the following subsection
341 \begin_layout Subsection
342 Automatically generated files
345 \begin_layout Standard
346 The files, which are to be found in
347 \begin_inset Flex CharStyle:MenuItem
350 \begin_layout Plain Layout
356 , are generated when you configure LyX.
357 They contain various default values that are guessed by inspection.
358 In general, it is not a good idea to modify them, since they might be overwritt
362 \begin_layout Labeling
363 \labelwidthstring 00.00.0000
364 \begin_inset Flex CharStyle:Code
367 \begin_layout Plain Layout
373 contains defaults for various commands.
376 \begin_layout Labeling
377 \labelwidthstring 00.00.0000
378 \begin_inset Flex CharStyle:Code
381 \begin_layout Plain Layout
387 contains the list of packages that have been recognized by LyX.
388 It is currently unused by the LyX program itself, but the information extracted
389 , and more, is made available with
390 \begin_inset Flex CharStyle:MenuItem
393 \begin_layout Plain Layout
394 Help\SpecialChar \menuseparator
407 \begin_layout Labeling
408 \labelwidthstring 00.00.0000
409 \begin_inset Flex CharStyle:Code
412 \begin_layout Plain Layout
418 the list of text classes that have been found in your
419 \begin_inset Flex CharStyle:Code
422 \begin_layout Plain Layout
428 directories, along with the associated LaTeX document class and their descripti
432 \begin_layout Labeling
433 \labelwidthstring 00.00.0000
434 \begin_inset Flex CharStyle:Code
437 \begin_layout Plain Layout
443 the list of layout modules found in your
444 \begin_inset Flex CharStyle:Code
447 \begin_layout Plain Layout
456 \begin_layout Labeling
457 \labelwidthstring 00.00.0000
458 \begin_inset Flex CharStyle:Code
461 \begin_layout Plain Layout
467 lists of various sorts of LaTeX-related files found on your system
470 \begin_layout Labeling
471 \labelwidthstring 00.00.0000
472 \begin_inset Flex CharStyle:Code
475 \begin_layout Plain Layout
481 is automatically generated during configuration from the file
482 \begin_inset Flex CharStyle:Code
485 \begin_layout Plain Layout
492 It contains information on your LaTeX configuration.
495 \begin_layout Subsection
499 \begin_layout Standard
500 These directories are duplicated between
501 \begin_inset Flex CharStyle:Code
504 \begin_layout Plain Layout
511 \begin_inset Flex CharStyle:Code
514 \begin_layout Plain Layout
521 If a particular files exists in both places, the one in
522 \begin_inset Flex CharStyle:Code
525 \begin_layout Plain Layout
534 \begin_layout Labeling
535 \labelwidthstring 00.00.0000
536 \begin_inset Flex CharStyle:Code
539 \begin_layout Plain Layout
545 this directory contains files with the extension
546 \begin_inset Flex CharStyle:Code
549 \begin_layout Plain Layout
555 that define the keybindings used in LyX.
556 If there exists an internationalized version of the bind file named
557 \begin_inset Flex CharStyle:Code
560 \begin_layout Plain Layout
566 , that will be used first.
569 \begin_layout Labeling
570 \labelwidthstring 00.00.0000
571 \begin_inset Flex CharStyle:Code
574 \begin_layout Plain Layout
580 contains graphics files that can be included in documents.
584 \begin_layout Labeling
585 \labelwidthstring 00.00.0000
586 \begin_inset Flex CharStyle:Code
589 \begin_layout Plain Layout
595 contains LyX documentation files (including the one you are currently reading).
597 \begin_inset Flex CharStyle:Code
600 \begin_layout Plain Layout
606 deserves special attention, as noted above.
607 The internationalized help docs are in subdirectories
608 \begin_inset Flex CharStyle:Code
611 \begin_layout Plain Layout
618 \begin_inset Quotes eld
622 \begin_inset Quotes erd
625 is the ISO language code.
631 \begin_inset CommandInset ref
633 reference "cha:Internationalizing-LyX"
640 \begin_layout Labeling
641 \labelwidthstring 00.00.0000
642 \begin_inset Flex CharStyle:Code
645 \begin_layout Plain Layout
651 contains example files that explain how to use some features.
652 In the file browser, press the
653 \begin_inset Flex CharStyle:MenuItem
656 \begin_layout Plain Layout
665 \begin_layout Labeling
666 \labelwidthstring 00.00.0000
667 \begin_inset Flex CharStyle:Code
670 \begin_layout Plain Layout
676 contains image files that are used by the
677 \begin_inset Flex CharStyle:MenuItem
680 \begin_layout Plain Layout
687 In addition, it also contains the individual icons used in the toolbar
688 and the banners that can be shown when LyX is launched.
691 \begin_layout Labeling
692 \labelwidthstring 00.00.0000
693 \begin_inset Flex CharStyle:Code
696 \begin_layout Plain Layout
702 contains keyboard keymapping files.
708 \begin_inset CommandInset ref
710 reference "sec:International-Keymap-Stuff"
717 \begin_layout Labeling
718 \labelwidthstring 00.00.0000
719 \begin_inset Flex CharStyle:Code
722 \begin_layout Plain Layout
728 contains the text class and module files described in Chapter
733 \begin_inset CommandInset ref
735 reference "cha:Installing-New-Document"
742 \begin_layout Labeling
743 \labelwidthstring 00.00.0000
744 \begin_inset Flex CharStyle:Code
747 \begin_layout Plain Layout
754 \begin_inset Flex CharStyle:Code
757 \begin_layout Plain Layout
763 Python scripts used to convert between LyX versions.
764 These can be run from the command line if, say, you want to batch-convert
768 \begin_layout Labeling
769 \labelwidthstring 00.00.0000
770 \begin_inset Flex CharStyle:Code
773 \begin_layout Plain Layout
779 contains some files that demonstrate the capabilities of the
780 \begin_inset Flex CharStyle:MenuItem
783 \begin_layout Plain Layout
794 Also contains some scripts used by LyX itself.
797 \begin_layout Labeling
798 \labelwidthstring 00.00.0000
799 \begin_inset Flex CharStyle:Code
802 \begin_layout Plain Layout
808 contains the standard LyX template files described in Chapter
813 \begin_inset CommandInset ref
815 reference "sub:Creating-Templates"
822 \begin_layout Labeling
823 \labelwidthstring 00.00.0000
824 \begin_inset Flex CharStyle:Code
827 \begin_layout Plain Layout
833 contains files with the extension
834 \begin_inset Flex CharStyle:Code
837 \begin_layout Plain Layout
843 that define the user interface to LyX.
844 That is, the files define which items appear in which menus and the items
845 appearing on the toolbar.
848 \begin_layout Subsection
849 Files you don't want to modify
852 \begin_layout Standard
853 These files are used internally by LyX and you generally do not need to
854 modify them unless you are a developer.
857 \begin_layout Labeling
858 \labelwidthstring 00.00.0000
859 \begin_inset Flex CharStyle:Code
862 \begin_layout Plain Layout
868 this file contains the list of LyX developers.
869 The contents are displayed with the menu entry
870 \begin_inset Flex CharStyle:MenuItem
873 \begin_layout Plain Layout
874 Help\SpecialChar \menuseparator
887 \begin_layout Labeling
888 \labelwidthstring 00.00.0000
889 \begin_inset Flex CharStyle:Code
892 \begin_layout Plain Layout
898 this is a LaTeX script used during the configuration process.
902 \begin_layout Labeling
903 \labelwidthstring 00.00.0000
904 \begin_inset Flex CharStyle:Code
907 \begin_layout Plain Layout
913 this is the script that is used to re-configure LyX.
914 It creates configuration files in the directory it was run from.
917 \begin_layout Subsection
918 Other files needing a line or two...
921 \begin_layout Labeling
922 \labelwidthstring 00.00.0000
923 \begin_inset Flex CharStyle:Code
926 \begin_layout Plain Layout
932 this contains tables describing how different character encodings can be
936 \begin_layout Labeling
937 \labelwidthstring 00.00.0000
938 \begin_inset Flex CharStyle:Code
941 \begin_layout Plain Layout
947 this file contains the templates available to the new
948 \begin_inset Flex CharStyle:MenuItem
951 \begin_layout Plain Layout
964 \begin_layout Labeling
965 \labelwidthstring 00.00.0000
966 \begin_inset Flex CharStyle:Code
969 \begin_layout Plain Layout
975 this file contains a list of all the languages currently supported by LyX.
978 \begin_layout Section
979 Your local configuration directory
982 \begin_layout Standard
983 Even if you are using LyX as an unprivileged user, you might want to change
984 LyX configuration for your own use.
986 \begin_inset Flex CharStyle:Code
989 \begin_layout Plain Layout
995 directory contains all your personal configuration files.
996 This is the directory described as
997 \begin_inset Quotes eld
1001 \begin_inset Quotes erd
1005 \begin_inset Flex CharStyle:MenuItem
1008 \begin_layout Plain Layout
1009 Help\SpecialChar \menuseparator
1011 \begin_inset space ~
1020 This directory is used as a mirror of
1021 \begin_inset Flex CharStyle:Code
1024 \begin_layout Plain Layout
1030 , which means that every file in
1031 \begin_inset Flex CharStyle:Code
1034 \begin_layout Plain Layout
1040 is a replacement for the corresponding file in
1041 \begin_inset Flex CharStyle:Code
1044 \begin_layout Plain Layout
1051 Any configuration file described in the above sections can be placed either
1052 in the system-wide directory, in which case it will affect all users, or
1053 in your local directory for your own use.
1056 \begin_layout Standard
1057 To make things clearer, let's provide a few examples:
1060 \begin_layout Itemize
1061 The preferences set in the
1062 \begin_inset Flex CharStyle:MenuItem
1065 \begin_layout Plain Layout
1066 Tools\SpecialChar \menuseparator
1072 dialog are saved to a file
1073 \begin_inset Flex CharStyle:Code
1076 \begin_layout Plain Layout
1083 \begin_inset Flex CharStyle:Code
1086 \begin_layout Plain Layout
1095 \begin_layout Itemize
1096 When you reconfigure using
1097 \begin_inset Flex CharStyle:MenuItem
1100 \begin_layout Plain Layout
1101 Tools\SpecialChar \menuseparator
1108 \begin_inset Flex CharStyle:Code
1111 \begin_layout Plain Layout
1117 script, and the resulting files are written in your local configuration
1119 This means that any additional text class file that you might have added
1121 \begin_inset Flex CharStyle:Code
1124 \begin_layout Plain Layout
1130 will be added to the list of classes in the
1131 \begin_inset Flex CharStyle:MenuItem
1134 \begin_layout Plain Layout
1135 Document\SpecialChar \menuseparator
1144 \begin_layout Itemize
1145 If you get some updated documentation from LyX ftp site and cannot install
1146 it because you do not have sysadmin rights on your system, you can just
1148 \begin_inset Flex CharStyle:Code
1151 \begin_layout Plain Layout
1157 and the items in the
1158 \begin_inset Flex CharStyle:MenuItem
1161 \begin_layout Plain Layout
1167 menu will open them!
1170 \begin_layout Section
1171 Running LyX with multiple configurations
1174 \begin_layout Standard
1175 The configuration freedom of the local configuration directory may not suffice
1176 if you want to have more than one configuration at your disposal.
1177 For example, you may want to be use different key bindings or printer settings
1179 You can achieve this by having several such directories.
1180 You then specify which directory to use at run-time.
1183 \begin_layout Standard
1184 Invoking LyX with the command line switch
1185 \begin_inset Flex CharStyle:Code
1188 \begin_layout Plain Layout
1198 instructs the program to read the configuration from that directory, and
1199 not from the default directory.
1200 (You can determine the default directory by running LyX without the
1201 \begin_inset Flex CharStyle:Code
1204 \begin_layout Plain Layout
1210 switch.) If the specified directory does not exist, LyX offers to create
1211 it for you, just like it does for the default directory on the first time
1212 you run the program.
1213 You can modify the configuration options in this additional user directory
1214 exactly as you would for the default directory.
1215 These directories are completely independent (but read on).
1216 Note that setting the environment variable
1217 \begin_inset Flex CharStyle:Code
1220 \begin_layout Plain Layout
1226 to some value has exactly the same effect.
1229 \begin_layout Standard
1230 Having several configurations also requires more maintenance: if you want
1231 to add a new layout to
1232 \begin_inset Flex CharStyle:Code
1235 \begin_layout Plain Layout
1241 which you want available from all your configurations, you must add it
1242 to each directory separately.
1243 You can avoid this with the following trick: after LyX creates the additional
1244 directory, most of the subdirectories (see above) are empty.
1245 If you want the new configuration to mirror an existing one, replace the
1246 empty subdirectory with a symbolic link to the matching subdirectory in
1247 the existing configuration.
1249 \begin_inset Flex CharStyle:Code
1252 \begin_layout Plain Layout
1258 subdirectory, however, since it contains a file written by the configuration
1259 script (also accessible through
1260 \begin_inset Flex CharStyle:MenuItem
1263 \begin_layout Plain Layout
1264 Tools\SpecialChar \menuseparator
1270 ) which is configuration-specific.
1273 \begin_layout Chapter
1274 The Preferences dialog
1277 \begin_layout Standard
1278 All options of the preferences dialog are described in the Appendix
1280 The Preferences Dialog
1287 For some options you might find here more details.
1290 \begin_layout Section
1292 \begin_inset CommandInset label
1301 \begin_layout Standard
1302 The first step is to define your file formats if they are not already defined.
1304 \begin_inset Flex CharStyle:MenuItem
1307 \begin_layout Plain Layout
1308 Tools\SpecialChar \menuseparator
1316 \begin_inset Flex CharStyle:MenuItem
1319 \begin_layout Plain Layout
1320 File Handling\SpecialChar \menuseparator
1327 \begin_inset Flex CharStyle:MenuItem
1330 \begin_layout Plain Layout
1331 New\SpecialChar \ldots{}
1337 button to define your new format.
1339 \begin_inset Flex CharStyle:MenuItem
1342 \begin_layout Plain Layout
1348 field contains the name used to identify the format in the GUI.
1350 \begin_inset Flex CharStyle:MenuItem
1353 \begin_layout Plain Layout
1359 is used to identify the format internally.
1360 You will also need to enter a file extension.
1361 These are all required.
1363 \begin_inset Flex CharStyle:MenuItem
1366 \begin_layout Plain Layout
1372 field is used to provide a keyboard shortcut on the menus.
1373 (For example, pressing
1374 \begin_inset Flex CharStyle:MenuItem
1377 \begin_layout Plain Layout
1384 \begin_inset Flex CharStyle:MenuItem
1387 \begin_layout Plain Layout
1388 View\SpecialChar \menuseparator
1397 \begin_layout Standard
1399 \begin_inset Flex CharStyle:MenuItem
1402 \begin_layout Plain Layout
1409 \begin_inset Flex CharStyle:MenuItem
1412 \begin_layout Plain Layout
1419 For example, you might want to use
1420 \begin_inset Flex CharStyle:MenuItem
1423 \begin_layout Plain Layout
1429 to view PostScript files.
1430 You can enter the command needed to start the program in the corresponding
1432 In defining this command, you can use the four variables listed in the
1434 The viewer is launched when you view an image in LyX or use the
1435 \begin_inset Flex CharStyle:MenuItem
1438 \begin_layout Plain Layout
1445 The editor is for example launched when you right-click on an image and
1447 \begin_inset Flex CharStyle:MenuItem
1450 \begin_layout Plain Layout
1456 in the appearing context menu.
1459 \begin_layout Standard
1461 \begin_inset Flex CharStyle:MenuItem
1464 \begin_layout Plain Layout
1470 option tells LyX that a format is suitable for document export.
1471 If this is set and if a suitable conversion route exists (see sec.
1472 \begin_inset space \thinspace{}
1476 \begin_inset CommandInset ref
1478 reference "sec:Converters"
1482 ), the format will appear in the
1483 \begin_inset Flex CharStyle:MenuItem
1486 \begin_layout Plain Layout
1487 File\SpecialChar \menuseparator
1494 The format will also appear in the
1495 \begin_inset Flex CharStyle:MenuItem
1498 \begin_layout Plain Layout
1504 menu if a viewer is specified for the format.
1505 Pure image formats, such as
1506 \begin_inset Flex CharStyle:Code
1509 \begin_layout Plain Layout
1515 , should not use this option.
1516 Formats that can both represent vector graphics and documents like
1517 \begin_inset Flex CharStyle:Code
1520 \begin_layout Plain Layout
1529 \begin_layout Standard
1531 \begin_inset Flex CharStyle:MenuItem
1534 \begin_layout Plain Layout
1535 Vector graphics format
1540 tells LyX that a format can contain vector graphics.
1541 This information is used to determine the target format of included graphics
1543 \begin_inset Flex CharStyle:MenuItem
1546 \begin_layout Plain Layout
1553 Included graphics may need to be converted to either
1554 \begin_inset Flex CharStyle:MenuItem
1557 \begin_layout Plain Layout
1564 \begin_inset Flex CharStyle:MenuItem
1567 \begin_layout Plain Layout
1574 \begin_inset Flex CharStyle:MenuItem
1577 \begin_layout Plain Layout
1584 \begin_inset Flex CharStyle:MenuItem
1587 \begin_layout Plain Layout
1593 cannot handle other image formats.
1594 If an included graphic is not already in
1595 \begin_inset Flex CharStyle:MenuItem
1598 \begin_layout Plain Layout
1605 \begin_inset Flex CharStyle:MenuItem
1608 \begin_layout Plain Layout
1615 \begin_inset Flex CharStyle:MenuItem
1618 \begin_layout Plain Layout
1624 format, it is converted to
1625 \begin_inset Flex CharStyle:MenuItem
1628 \begin_layout Plain Layout
1634 if the vector format option is set, and otherwise to
1635 \begin_inset Flex CharStyle:MenuItem
1638 \begin_layout Plain Layout
1647 \begin_layout Section
1651 \begin_layout Standard
1652 Since all conversions from one format to another take place in LyX's temporary
1653 directory, it is sometimes necessary to modify a file before copying it
1654 to the temporary directory in order that the conversion may be performed.
1658 \begin_layout Plain Layout
1659 For example, the file may refer to other files—images, for example—using
1660 relative file names, and these may become invalid when the file is copied
1661 to the temporary directory.
1666 This is done by a Copier: It copies a file to (or from) the temporary directory
1667 and may modify it in the process.
1670 \begin_layout Standard
1671 The definitions of the copiers may use four variables:
1674 \begin_layout Labeling
1675 \labelwidthstring 00.00.0000
1676 \begin_inset Flex CharStyle:Code
1679 \begin_layout Plain Layout
1685 The LyX system directory (e.
1686 \begin_inset space \thinspace{}
1690 \begin_inset space \space{}
1694 \begin_inset Flex CharStyle:MenuItem
1697 \begin_layout Plain Layout
1706 \begin_layout Labeling
1707 \labelwidthstring 00.00.0000
1708 \begin_inset Flex CharStyle:Code
1711 \begin_layout Plain Layout
1720 \begin_layout Labeling
1721 \labelwidthstring 00.00.0000
1722 \begin_inset Flex CharStyle:Code
1725 \begin_layout Plain Layout
1734 \begin_layout Labeling
1735 \labelwidthstring 00.00.0000
1736 \begin_inset Flex CharStyle:Code
1739 \begin_layout Plain Layout
1748 \begin_layout Standard
1749 The latter should be the filename as it would be used in a LaTeX's
1756 It is relevant only when exporting files suitable for such inclusion.
1759 \begin_layout Standard
1760 Copiers can be used to do almost anything with output files.
1761 For example, suppose you want generated pdf files to be copied to a special
1763 \begin_inset Flex CharStyle:Code
1766 \begin_layout Plain Layout
1773 Then you could write a shell script such as this one:
1776 \begin_layout Standard
1777 \begin_inset listings
1781 \begin_layout Plain Layout
1786 \begin_layout Plain Layout
1791 \begin_layout Plain Layout
1793 TOFILE=`basename $2`
1796 \begin_layout Plain Layout
1798 cp $FROMFILE /home/you/pdf/$TOFILE
1803 Save it in your local LyX directory—say,
1804 \begin_inset Flex CharStyle:Code
1807 \begin_layout Plain Layout
1808 /home/you/.lyx/scripts/pdfcopier.sh
1813 —and make it executable, if you need to do so on your platform.
1815 \begin_inset Flex CharStyle:MenuItem
1818 \begin_layout Plain Layout
1819 Tools\SpecialChar \menuseparator
1825 dialog, select under
1826 \begin_inset Flex CharStyle:MenuItem
1829 \begin_layout Plain Layout
1830 File Handling\SpecialChar \menuseparator
1837 \begin_inset Flex CharStyle:MenuItem
1840 \begin_layout Plain Layout
1846 format—or one of the other pdf formats—and enter
1847 \begin_inset Flex CharStyle:Code
1850 \begin_layout Plain Layout
1851 pdfcopier.sh $$i $$o
1857 \begin_inset Flex CharStyle:MenuItem
1860 \begin_layout Plain Layout
1870 \begin_layout Standard
1871 Copiers are used by LyX in various of its own conversions.
1872 For example, if appropriate programs are found, LyX will automatically
1873 install copiers for the
1874 \begin_inset Flex CharStyle:MenuItem
1877 \begin_layout Plain Layout
1884 \begin_inset Flex CharStyle:MenuItem
1887 \begin_layout Plain Layout
1889 \begin_inset space ~
1898 When these formats are exported, the copier sees that not just the main
1899 HTML file but various associated files (style files, images, etc.) are also
1901 All these files are written to a subdirectory of the directory in which
1902 the original LyX file was found.
1906 \begin_layout Plain Layout
1907 This copier can be customized.
1909 \begin_inset Quotes eld
1913 \begin_inset Quotes erd
1916 argument takes a comma-separated list of extensions to be copied; if it
1917 is omitted, all files will be copied.
1919 \begin_inset Quotes eld
1923 \begin_inset Quotes erd
1926 argument determines the extension added to the generated directory.
1928 \begin_inset Quotes eld
1932 \begin_inset Flex CharStyle:MenuItem
1935 \begin_layout Plain Layout
1942 \begin_inset Quotes erd
1945 , so HTML generated from
1946 \begin_inset Flex CharStyle:MenuItem
1949 \begin_layout Plain Layout
1950 /path/to/filename.lyx
1956 \begin_inset Flex CharStyle:MenuItem
1959 \begin_layout Plain Layout
1960 /path/to/filename.html.LyXconv
1974 \begin_layout Section
1976 \begin_inset CommandInset label
1978 name "sec:Converters"
1985 \begin_layout Standard
1986 You can define your own Converters to convert files between different formats.
1988 \begin_inset Flex CharStyle:MenuItem
1991 \begin_layout Plain Layout
1992 Tools\SpecialChar \menuseparator
1993 Preferences\SpecialChar \menuseparator
1994 File Handling\SpecialChar \menuseparator
2003 \begin_layout Standard
2004 To define a new converter, select the
2005 \begin_inset Flex CharStyle:MenuItem
2008 \begin_layout Plain Layout
2010 \begin_inset space ~
2019 \begin_inset Flex CharStyle:MenuItem
2022 \begin_layout Plain Layout
2024 \begin_inset space ~
2032 from the drop-down lists, enter the command needed for the conversion,
2034 \begin_inset Flex CharStyle:MenuItem
2037 \begin_layout Plain Layout
2044 Several variables can be used in the definition of converters:
2047 \begin_layout Labeling
2048 \labelwidthstring 00.00.0000
2049 \begin_inset Flex CharStyle:Code
2052 \begin_layout Plain Layout
2058 The LyX system directory
2061 \begin_layout Labeling
2062 \labelwidthstring 00.00.0000
2063 \begin_inset Flex CharStyle:Code
2066 \begin_layout Plain Layout
2075 \begin_layout Labeling
2076 \labelwidthstring 00.00.0000
2077 \begin_inset Flex CharStyle:Code
2080 \begin_layout Plain Layout
2089 \begin_layout Labeling
2090 \labelwidthstring 00.00.0000
2091 \begin_inset Flex CharStyle:Code
2094 \begin_layout Plain Layout
2100 The base filename of the input file (i.
2101 \begin_inset space \thinspace{}
2104 g., without the extension)
2107 \begin_layout Labeling
2108 \labelwidthstring 00.00.0000
2109 \begin_inset Flex CharStyle:Code
2112 \begin_layout Plain Layout
2118 The path to the input file
2121 \begin_layout Labeling
2122 \labelwidthstring 00.00.0000
2123 \begin_inset Flex CharStyle:Code
2126 \begin_layout Plain Layout
2132 The path to the original input file (this is different from $$p when a
2133 chain of converters is called).
2136 \begin_layout Standard
2138 \begin_inset Flex CharStyle:MenuItem
2141 \begin_layout Plain Layout
2143 \begin_inset space ~
2151 field you can enter the following flags, separated by commas:
2154 \begin_layout Labeling
2155 \labelwidthstring 00.00.0000
2156 \begin_inset Flex CharStyle:Code
2159 \begin_layout Plain Layout
2165 This converter runs some form of LaTeX.
2166 This will make LyX's LaTeX error logs available.
2169 \begin_layout Labeling
2170 \labelwidthstring 00.00.0000
2171 \begin_inset Flex CharStyle:Code
2174 \begin_layout Plain Layout
2181 \begin_inset Flex CharStyle:MenuItem
2184 \begin_layout Plain Layout
2190 file for the conversion.
2193 \begin_layout Labeling
2194 \labelwidthstring 00.00.0000
2195 \begin_inset Flex CharStyle:Code
2198 \begin_layout Plain Layout
2207 \begin_layout Standard
2208 The following three flags are not really flags at all because they take
2210 \begin_inset Flex CharStyle:MenuItem
2213 \begin_layout Plain Layout
2215 \begin_inset space ~
2219 \begin_inset space ~
2230 \begin_layout Labeling
2231 \labelwidthstring 00.00.0000
2232 \begin_inset Flex CharStyle:Code
2235 \begin_layout Plain Layout
2241 If set, the converter's standard error will be redirected to a file
2242 \begin_inset Flex CharStyle:Code
2245 \begin_layout Plain Layout
2251 , and the script given as argument will be run as:
2252 \begin_inset Flex CharStyle:Code
2255 \begin_layout Plain Layout
2256 script < infile.out > infile.log
2262 The argument may contain
2263 \begin_inset Flex CharStyle:Code
2266 \begin_layout Plain Layout
2275 \begin_layout Labeling
2276 \labelwidthstring 00.00.0000
2277 \begin_inset Flex CharStyle:Code
2280 \begin_layout Plain Layout
2286 The name of the directory in which the converter will dump the generated
2288 LyX will not create this directory, and it does not copy anything into
2289 it, though it will copy this directory to the destination.
2290 The argument may contain
2291 \begin_inset Flex CharStyle:Code
2294 \begin_layout Plain Layout
2300 , which will be replaced by the base name of the input and output files,
2301 respectively, when the directory is copied.
2302 \begin_inset Newline newline
2305 Note that resultdir and usetempdir make no sense together.
2306 The latter will be ignored if the former is given.
2309 \begin_layout Labeling
2310 \labelwidthstring 00.00.0000
2311 \begin_inset Flex CharStyle:Code
2314 \begin_layout Plain Layout
2320 Determines the output file name and may, contain
2321 \begin_inset Flex CharStyle:Code
2324 \begin_layout Plain Layout
2331 Sensible only with resultdir and optional even then; if not given, it defaults
2335 \begin_layout Standard
2336 None of these last three are presently used in any of the converters that
2337 are installed with LyX.
2341 \begin_layout Standard
2342 You do not have to define converters for all formats between which you want
2344 For example, you will note that there is no `LyX to PostScript' converter,
2345 but LyX will export PostScript.
2346 It does so by first creating a LaTeX file (no converter needs to be defined
2347 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2348 and finally converting the resulting DVI file to PostScript.
2349 LyX finds such `chains' of converters automatically, and it will always
2350 choose the shortest possible chain.
2351 You can, though, still define multiple conversion methods between file
2353 For example, the standard LyX configuration provides three ways to convert
2354 LaTeX to PDF: Directly, using
2355 \begin_inset Flex CharStyle:MenuItem
2358 \begin_layout Plain Layout
2364 ; via (DVI and) PostScript, using
2365 \begin_inset Flex CharStyle:MenuItem
2368 \begin_layout Plain Layout
2375 \begin_inset Flex CharStyle:MenuItem
2378 \begin_layout Plain Layout
2385 To define such alternate chains, you must define multiple target `file
2386 formats', as described in section
2387 \begin_inset CommandInset ref
2389 reference "sec:Formats"
2394 For example, in the standard configuration, the formats named
2395 \begin_inset Flex CharStyle:MenuItem
2398 \begin_layout Plain Layout
2405 \begin_inset Flex CharStyle:MenuItem
2408 \begin_layout Plain Layout
2415 \begin_inset Flex CharStyle:MenuItem
2418 \begin_layout Plain Layout
2424 are defined, all of which share the extension
2425 \begin_inset Flex CharStyle:MenuItem
2428 \begin_layout Plain Layout
2434 , and which correspond to the conversion methods just mentioned.
2437 \begin_layout Chapter
2438 Internationalizing LyX
2439 \begin_inset CommandInset label
2441 name "cha:Internationalizing-LyX"
2448 \begin_layout Standard
2449 LyX supports using a translated interface.
2450 Last time we checked, LyX provided text in thirty languages.
2451 The language of choice is called your
2456 (For further reading on locale settings, see also the documentation for
2457 locale that comes with your operating system.
2458 For Linux, the manual page for
2459 \begin_inset Flex CharStyle:Code
2462 \begin_layout Plain Layout
2468 could be a good place to start).
2471 \begin_layout Standard
2472 Notice that these translations will work, but do contain a few flaws.
2473 In particular, all dialogs have been designed with the English text in
2474 mind, which means that some of the translated text will be too large to
2475 fit within the space allocated.
2476 This is only a display problem and will not cause any harm.
2477 Also, you will find that some of the translations do not define shortcut
2478 keys for everything.
2479 Sometimes, there are simply not enough free letters to do it.
2480 Other times, the translator just hasn't got around to doing it yet.
2481 Our localization team, which you may wish to join,
2485 \begin_layout Plain Layout
2486 If you are a fluent speaker of a language other than English, joining these
2487 teams is a great way to give back to the LyX community!
2492 will of course try to fix these shortcomings in future versions of LyX.
2495 \begin_layout Section
2499 \begin_layout Subsection
2500 Translating the graphical user interface (text messages).
2503 \begin_layout Standard
2505 \begin_inset Flex CharStyle:Code
2508 \begin_layout Plain Layout
2514 library to handle the internationalization of the interface.
2515 To have LyX speak your favorite language in all menus and dialogs, you
2517 \begin_inset Flex CharStyle:Code
2520 \begin_layout Plain Layout
2526 -file for that language.
2527 When this is available, you'll have to generate a
2528 \begin_inset Flex CharStyle:Code
2531 \begin_layout Plain Layout
2537 -file from it and install the
2538 \begin_inset Flex CharStyle:Code
2541 \begin_layout Plain Layout
2548 The process of doing all of this is explained in the documentation for
2550 \begin_inset Flex CharStyle:Code
2553 \begin_layout Plain Layout
2560 It is possible to do this just for yourself, but if you're going to do
2561 it, you might as well share the results of your labors with the rest of
2563 Send a message to the LyX developers' list for more information about how
2567 \begin_layout Standard
2568 In short, this is what you should do (xx denotes the language code):
2571 \begin_layout Itemize
2572 Check out the LyX source code.
2574 \begin_inset CommandInset href
2576 name "information on the web"
2577 target "http://www.lyx.org/devel/cvs.php"
2584 \begin_layout Itemize
2586 \begin_inset Flex CharStyle:Code
2589 \begin_layout Plain Layout
2595 to the folder of the
2596 \begin_inset Flex CharStyle:Code
2599 \begin_layout Plain Layout
2607 \begin_inset Flex CharStyle:Code
2610 \begin_layout Plain Layout
2618 \begin_inset Flex CharStyle:Code
2621 \begin_layout Plain Layout
2627 doesn't exist anywhere, it can be remade with the console command
2628 \begin_inset Flex CharStyle:Code
2631 \begin_layout Plain Layout
2637 in that directory, or you can use an existing po-file for some other language
2641 \begin_layout Itemize
2643 \begin_inset Flex CharStyle:Code
2646 \begin_layout Plain Layout
2656 \begin_layout Plain Layout
2657 This is just a text file, so it can be edited in any text editor.
2658 But there are also specialized programs that support such editing, such
2663 (for all platforms) or
2672 contains a `mode' for editing
2673 \begin_inset Flex CharStyle:Code
2676 \begin_layout Plain Layout
2687 For some menu- and widget-labels, there are also shortcut keys that should
2689 Those keys are marked after a `|', and should be translated according to
2690 the words and phrases of the language.
2691 You should also fill also out the information at the beginning of the new
2693 \begin_inset Flex CharStyle:Code
2696 \begin_layout Plain Layout
2702 -file with your email-address, etc., so people know where to reach you with
2703 suggestions and entertaining flames.
2706 \begin_layout Standard
2707 If you are just doing this on your own, then:
2710 \begin_layout Itemize
2712 \begin_inset Flex CharStyle:Code
2715 \begin_layout Plain Layout
2722 This can be done with
2723 \begin_inset Flex CharStyle:Code
2726 \begin_layout Plain Layout
2727 msgfmt -o xx.mo < xx.po
2735 \begin_layout Itemize
2737 \begin_inset Flex CharStyle:Code
2740 \begin_layout Plain Layout
2746 -file to your locale-tree, at the correct directory for application messages
2751 xx, and under the name
2752 \begin_inset Flex CharStyle:Code
2755 \begin_layout Plain Layout
2762 \begin_inset space \thinspace{}
2766 \begin_inset space \space{}
2770 \begin_inset Flex CharStyle:Code
2773 \begin_layout Plain Layout
2774 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2784 \begin_layout Standard
2785 As said, however, it would be best if the new
2786 \begin_inset Flex CharStyle:Code
2789 \begin_layout Plain Layout
2795 -file could be added to the LyX distribution, so others can use it.
2796 Adding it involves making additional changes to LyX.
2797 So send an email to the developers' mailing list if you're interested in
2801 \begin_layout Subsubsection
2805 \begin_layout Standard
2806 Sometimes it turns out that one English message needs to be translated into
2807 different messages in the target language.
2808 One example is the message
2809 \begin_inset Flex CharStyle:Code
2812 \begin_layout Plain Layout
2818 which has the German translation
2826 , depending upon exactly what the English
2827 \begin_inset Quotes eld
2831 \begin_inset Quotes erd
2836 \begin_inset Flex CharStyle:Code
2839 \begin_layout Plain Layout
2845 does not handle such ambiguous translations.
2846 Therefore you have to add some context information to the message: Instead
2848 \begin_inset Flex CharStyle:Code
2851 \begin_layout Plain Layout
2858 \begin_inset Flex CharStyle:Code
2861 \begin_layout Plain Layout
2862 To[[as in 'From format x to format y']]
2868 \begin_inset Flex CharStyle:Code
2871 \begin_layout Plain Layout
2872 To[[as in 'From page x to page y']].
2877 Now the two occurrences of
2878 \begin_inset Flex CharStyle:Code
2881 \begin_layout Plain Layout
2888 \begin_inset Flex CharStyle:Code
2891 \begin_layout Plain Layout
2897 and can be translated correctly to
2908 \begin_layout Standard
2909 Of course the context information needs to be stripped off the original
2910 message when no translation is used.
2911 Therefore you have to put it in double square brackets at the end of the
2912 message (see the example above).
2913 The translation mechanism of LyX ensures that everything in double square
2914 brackets at the end of messages is removed before displaying the message.
2917 \begin_layout Subsection
2918 Translating the documentation.
2921 \begin_layout Standard
2922 The online documentation (in the
2923 \begin_inset Flex CharStyle:MenuItem
2926 \begin_layout Plain Layout
2932 -menu) can (and should!) be translated.
2933 If there are translated versions of the documentation available
2937 \begin_layout Plain Layout
2938 As of March 2008, at least some of the documents have been translated into
2939 fourteen languages, with the Tutorial available in a few more.
2944 and the locale is set accordingly, these will be used automagically by
2946 LyX looks for translated versions as
2947 \begin_inset Flex CharStyle:Code
2950 \begin_layout Plain Layout
2951 LyXDir/doc/xx/DocName.lyx
2957 \begin_inset Flex CharStyle:Code
2960 \begin_layout Plain Layout
2966 is the code for the language currently in use.
2967 If there are no translated documents, the default English versions will
2969 Note that the translated versions must have the same filenames (
2970 \begin_inset Flex CharStyle:Code
2973 \begin_layout Plain Layout
2979 above) as the original.
2980 If you feel up to translating the documentation (an excellent way to proof-read
2981 the original documentation by the way!), there are a few things you should
2985 \begin_layout Itemize
2986 Check out the documentation translation web page at
2987 \begin_inset CommandInset href
2989 name "http://www.lyx.org/Translation"
2990 target "http://www.lyx.org/Translation"
2995 That way, you can find out which (if any) documents have already been translate
2996 d into your language.
2997 You can also find out who (if anyone) is organizing the effort to translate
2998 the documentation into your language.
2999 If no one is organizing the effort, please let us know that you're interested.
3002 \begin_layout Standard
3003 Once you get to actually translating, here's a few hints for you that may
3007 \begin_layout Itemize
3008 Join the documentation team! There is information on how to do that in
3009 \begin_inset Flex CharStyle:Code
3012 \begin_layout Plain Layout
3019 \begin_inset Flex CharStyle:MenuItem
3022 \begin_layout Plain Layout
3023 Help\SpecialChar \menuseparator
3029 ), which by the way is the first document you should translate.
3032 \begin_layout Itemize
3033 Learn the typographic conventions for the language you are translating to.
3034 Typography is an ancient art and over the centuries, a great variety of
3035 conventions have developed throughout different parts of the world.
3036 Also study the professional terminology amongst typographers in your country.
3037 Inventing your own terminology will only confuse the users.
3040 (Warning! Typography is addictive!)
3043 \begin_layout Itemize
3044 Make a copy of the document.
3045 This will be your working copy.
3046 You can use this as your personal translated help-file by placing it in
3048 \begin_inset Flex CharStyle:Code
3051 \begin_layout Plain Layout
3060 \begin_layout Itemize
3061 Sometimes the original document (from the LyX-team) will be updated.
3062 Use the source viewer at
3063 \begin_inset CommandInset href
3065 name "http://www.lyx.org/trac/timeline"
3066 target "http://www.lyx.org/trac/timeline"
3070 to see what has been changed.
3071 That way you can easily see which parts of the translated document need
3075 \begin_layout Standard
3076 If you ever find an error in the original document, fix it and notify the
3077 rest of the documentation team of the changes! (You didn't forget to join
3078 the documentation team, did you?)
3081 \begin_layout Standard
3082 \begin_inset Branch OutDated
3085 \begin_layout Section
3086 International Keyboard Support
3089 \begin_layout Standard
3092 [Editor's Note: The following section is by
3100 It needs to be fixed to conform to the new Documentation Style sheet and
3101 to make use of the new v1.0 features.
3102 The whole thing also needs to be merged with the section following it.-jw
3103 It may also be badly out of date.-rh (2008)]
3106 \begin_layout Subsection
3107 Defining Own Keymaps: Keymap File Format
3110 \begin_layout Standard
3111 Let's look at a keyboard definition file a little closer.
3112 It is a plain text file defining
3115 \begin_layout Itemize
3116 key-to-key or key-to-string translations
3119 \begin_layout Itemize
3123 \begin_layout Itemize
3124 dead keys exceptions
3127 \begin_layout Standard
3128 To define key-to-key or key-to-string translation, use this command:
3131 \begin_layout Quotation
3132 \begin_inset Flex CharStyle:Code
3135 \begin_layout Plain Layout
3144 \begin_inset Flex CharStyle:Code
3147 \begin_layout Plain Layout
3156 \begin_layout Standard
3158 \begin_inset Flex CharStyle:Code
3161 \begin_layout Plain Layout
3167 is the key to be translated and
3168 \begin_inset Flex CharStyle:Code
3171 \begin_layout Plain Layout
3177 is the string to be inserted into the document.
3178 To define dead keys, use:
3181 \begin_layout Quotation
3182 \begin_inset Flex CharStyle:Code
3185 \begin_layout Plain Layout
3194 \begin_inset Flex CharStyle:Code
3197 \begin_layout Plain Layout
3206 \begin_layout Standard
3208 \begin_inset Flex CharStyle:Code
3211 \begin_layout Plain Layout
3217 is a keyboard key and
3218 \begin_inset Flex CharStyle:Code
3221 \begin_layout Plain Layout
3228 The following dead keys are supported (shortcut name is in parentheses):
3231 \begin_layout Quotation
3235 \begin_inset space \hfill{}
3241 \begin_layout Quotation
3243 \begin_inset space \hfill{}
3249 \begin_layout Quotation
3251 \begin_inset space \hfill{}
3257 \begin_layout Quotation
3259 \begin_inset space \hfill{}
3265 \begin_layout Quotation
3267 \begin_inset space \hfill{}
3273 \begin_layout Quotation
3275 \begin_inset space \hfill{}
3282 \begin_layout Plain Layout
3294 \begin_layout Quotation
3296 \begin_inset space \hfill{}
3302 \begin_layout Quotation
3304 \begin_inset space \hfill{}
3311 \begin_layout Plain Layout
3323 \begin_layout Quotation
3325 \begin_inset space \hfill{}
3331 \begin_layout Quotation
3333 \begin_inset space \hfill{}
3339 \begin_layout Quotation
3341 \begin_inset space \hfill{}
3348 \begin_layout Plain Layout
3360 \begin_layout Quotation
3362 \begin_inset space \hfill{}
3369 \begin_layout Plain Layout
3381 \begin_layout Quotation
3383 \begin_inset space \hfill{}
3389 \begin_layout Quotation
3390 hungarian umlaut (hug)
3391 \begin_inset space \hfill{}
3397 \begin_layout Quotation
3399 \begin_inset space \hfill{}
3405 \begin_layout Quotation
3407 \begin_inset space \hfill{}
3414 \begin_layout Plain Layout
3426 \begin_layout Standard
3427 Since in many international keyboards there are exceptions to what some
3428 dead keys should do, you can define them using
3431 \begin_layout Quotation
3432 \begin_inset Flex CharStyle:Code
3435 \begin_layout Plain Layout
3443 deadkey key outstring
3446 \begin_layout Standard
3447 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3451 \begin_layout Quotation
3452 \begin_inset Flex CharStyle:Code
3455 \begin_layout Plain Layout
3468 \begin_layout Standard
3469 to make it work correctly.
3470 Also, you have to define as exceptions dead keys over i and j, to remove
3471 the dot from them before inserting an accent mark.
3472 I will change this when the time comes, but so far I haven't had time.
3475 \begin_layout Standard
3476 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3479 \begin_inset Flex CharStyle:Code
3482 \begin_layout Plain Layout
3488 have different meaning.
3490 \begin_inset Flex CharStyle:Code
3493 \begin_layout Plain Layout
3499 marks comments, quotes start and end LaTeX-style commands.
3500 To enter quote, you'll need to use
3501 \begin_inset Flex CharStyle:Code
3504 \begin_layout Plain Layout
3513 \begin_inset Flex CharStyle:Code
3516 \begin_layout Plain Layout
3523 \begin_inset Flex CharStyle:Code
3526 \begin_layout Plain Layout
3537 \begin_layout Standard
3538 If you make a keyboard description file that works for your language, please
3539 mail it to me, so I can include it in the next keymap distribution.
3542 \begin_layout Standard
3543 More keywords will be supported in keymap configuration file in future,
3547 \begin_layout Itemize
3548 \begin_inset Flex CharStyle:Code
3551 \begin_layout Plain Layout
3562 \begin_inset space \hfill{}
3566 \begin_inset Flex CharStyle:Code
3569 \begin_layout Plain Layout
3578 \begin_layout Itemize
3579 \begin_inset Flex CharStyle:Code
3582 \begin_layout Plain Layout
3593 \begin_inset space \hfill{}
3597 \begin_inset Flex CharStyle:Code
3600 \begin_layout Plain Layout
3606 an external keymap translation program
3609 \begin_layout Standard
3610 Also, it should look into
3611 \begin_inset Flex CharStyle:Code
3614 \begin_layout Plain Layout
3620 file for defaults, too (for example, a
3621 \begin_inset Flex CharStyle:Code
3624 \begin_layout Plain Layout
3632 option to include default keyboard).
3640 \begin_layout Section
3641 International Keymap Stuff
3642 \begin_inset CommandInset label
3644 name "sec:International-Keymap-Stuff"
3651 \begin_layout Standard
3652 \begin_inset Note Note
3655 \begin_layout Plain Layout
3656 In doing the revisions on this document in March 2008, I did not look over
3657 this stuff, as I do not understand it.
3658 It would be good if someone else could do so.
3667 \begin_layout Standard
3668 The next two sections describe the
3669 \begin_inset Flex CharStyle:Code
3672 \begin_layout Plain Layout
3681 \begin_inset Flex CharStyle:Code
3684 \begin_layout Plain Layout
3692 file syntax in detail.
3693 These sections should help you design your own key map if the ones provided
3694 do not meet your needs.
3697 \begin_layout Subsection
3701 \begin_layout Standard
3705 \begin_inset Flex CharStyle:Code
3708 \begin_layout Plain Layout
3714 file maps keystrokes to characters or strings.
3715 As the name suggests, it sets a keyboard mapping.
3717 \begin_inset Flex CharStyle:Code
3720 \begin_layout Plain Layout
3731 \begin_inset Flex CharStyle:Code
3734 \begin_layout Plain Layout
3749 \begin_inset Flex CharStyle:Code
3752 \begin_layout Plain Layout
3765 \begin_inset Flex CharStyle:Code
3768 \begin_layout Plain Layout
3777 \begin_inset Flex CharStyle:Code
3780 \begin_layout Plain Layout
3788 are described in this section.
3791 \begin_layout Labeling
3792 \labelwidthstring 00.00.0000
3793 \begin_inset Flex CharStyle:Code
3796 \begin_layout Plain Layout
3804 Map a character to a string
3807 \begin_layout LyX-Code
3822 \begin_layout Standard
3855 the double-quote (")
3872 must be escaped with a preceding backslash (
3883 \begin_layout Standard
3885 \begin_inset Flex CharStyle:MenuItem
3888 \begin_layout Plain Layout
3896 statement to cause the symbol
3897 \begin_inset Flex CharStyle:MenuItem
3900 \begin_layout Plain Layout
3908 to be output for the keystroke
3909 \begin_inset Flex CharStyle:MenuItem
3912 \begin_layout Plain Layout
3923 \begin_layout LyX-Code
3929 \begin_layout Labeling
3930 \labelwidthstring 00.00.0000
3931 \begin_inset Flex CharStyle:Code
3934 \begin_layout Plain Layout
3942 Specify an accent character
3945 \begin_layout LyX-Code
3954 \begin_layout Standard
3955 This will make the cha
3993 This is the dead key
3997 \begin_layout Plain Layout
4004 refers to a key that does not produce a character by itself, but when followed
4005 with another key, produces the desired accent character.
4006 For example, a German characte
4008 r with an umlaut like
4018 can be produced in this manner.
4027 \begin_layout Standard
4040 and then another key not in
4057 followed by the other, not allowed key, as output.
4061 \begin_inset Flex CharStyle:MenuItem
4064 \begin_layout Plain Layout
4072 cancels a dead key, so if
4083 \begin_inset Flex CharStyle:MenuItem
4086 \begin_layout Plain Layout
4095 , the cursor will not go one position backwards but will instead cancel
4111 might have had on the next keystroke.
4115 \begin_layout Standard
4116 The following example specifies that the character ' is to be an acute accent,
4117 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4120 \begin_layout LyX-Code
4123 kmod ' acute aeiouAEIOU
4126 \begin_layout Labeling
4127 \labelwidthstring 00.00.0000
4128 \begin_inset Flex CharStyle:Code
4131 \begin_layout Plain Layout
4137 Specify an exception to the accent character
4140 \begin_layout LyX-Code
4149 \begin_layout Standard
4150 This defines an exce
4191 have been assigned a keystroke with a previous
4194 \begin_inset Flex CharStyle:Code
4197 \begin_layout Plain Layout
4221 must not belong in the
4268 If such a declaration does not exist in
4276 \begin_inset Flex CharStyle:Code
4279 \begin_layout Plain Layout
4313 \begin_inset Flex CharStyle:Code
4316 \begin_layout Plain Layout
4330 \begin_layout Standard
4331 The following command produces causes äi to be produced when you enter acute-i
4335 \begin_layout LyX-Code
4349 \begin_layout Labeling
4350 \labelwidthstring 00.00.0000
4351 \begin_inset Flex CharStyle:Code
4354 \begin_layout Plain Layout
4360 Combine two accent characters
4363 \begin_layout LyX-Code
4369 accent1 accent2 allowed
4372 \begin_layout Standard
4373 This one is getting pretty esoteric.
4374 It allows you to combine the effect
4430 \begin_inset Flex CharStyle:Code
4433 \begin_layout Plain Layout
4461 \begin_layout Standard
4462 Consider this example from the
4463 \begin_inset Flex CharStyle:Code
4466 \begin_layout Plain Layout
4477 \begin_layout LyX-Code
4480 kmod ; acute aeioyvhAEIOYVH
4484 kcomb acute umlaut iyIY
4487 \begin_layout Standard
4488 This allows you to press
4489 \begin_inset Flex CharStyle:MenuItem
4492 \begin_layout Plain Layout
4500 and get the effect of
4501 \begin_inset Flex CharStyle:Code
4504 \begin_layout Plain Layout
4523 in this case cancels the last dead key, so if you press
4524 \begin_inset Flex CharStyle:MenuItem
4527 \begin_layout Plain Layout
4536 \begin_inset Flex CharStyle:Code
4539 \begin_layout Plain Layout
4552 \begin_layout Subsection
4556 \begin_layout Standard
4558 \begin_inset Flex CharStyle:Code
4561 \begin_layout Plain Layout
4569 mapping is performed, a
4570 \begin_inset Flex CharStyle:Code
4573 \begin_layout Plain Layout
4583 file maps the strings that the symbols generate to characters in the current
4585 The LyX distribution currently includes at least the
4586 \begin_inset Flex CharStyle:Code
4589 \begin_layout Plain Layout
4598 \begin_inset Flex CharStyle:Code
4601 \begin_layout Plain Layout
4612 \begin_layout Standard
4614 \begin_inset Flex CharStyle:Code
4617 \begin_layout Plain Layout
4625 file is a sequence of declarations of the form
4628 \begin_layout LyX-Code
4641 \begin_layout Standard
4642 For example, in order to map
4643 \begin_inset Flex CharStyle:MenuItem
4646 \begin_layout Plain Layout
4656 to the corresponding character in the iso-8859-1 set (233), the following
4660 \begin_layout LyX-Code
4668 \begin_layout Standard
4670 \begin_inset Flex CharStyle:Code
4673 \begin_layout Plain Layout
4682 \begin_inset Flex CharStyle:Code
4685 \begin_layout Plain Layout
4703 the same character can apply to more than one string.
4705 \begin_inset Flex CharStyle:Code
4708 \begin_layout Plain Layout
4719 \begin_layout LyX-Code
4731 \begin_inset Newline newline
4747 \begin_layout Standard
4748 If LyX cannot find a mapping for the string produced by the keystroke or
4749 a deadkey sequence, it will check if it looks like an accented char and
4750 try to draw an accent over the character on screen.
4753 \begin_layout Subsection
4757 \begin_layout Standard
4758 There is a second way to add support for international characters through
4759 so-called dead-keys.
4760 A dead-key works in combination with a letter to produce an accented character.
4761 Here, we'll explain how to create a really simple dead-key to illustrate
4765 \begin_layout Standard
4766 Suppose you happen to need the circumflex character,
4767 \begin_inset Quotes eld
4771 \begin_inset Quotes erd
4776 \begin_inset Flex CharStyle:MenuItem
4779 \begin_layout Plain Layout
4786 \begin_inset space ~
4790 \begin_inset Flex CharStyle:MenuItem
4793 \begin_layout Plain Layout
4799 ] to the LyX command
4800 \begin_inset Flex CharStyle:Code
4803 \begin_layout Plain Layout
4810 \begin_inset Flex CharStyle:Code
4813 \begin_layout Plain Layout
4820 Now, whenever you type the
4821 \begin_inset Flex CharStyle:MenuItem
4824 \begin_layout Plain Layout
4830 -key followed by a letter, that letter will have a circumflex accent on
4832 For example, the sequence
4833 \begin_inset Quotes eld
4837 \begin_inset Flex CharStyle:MenuItem
4840 \begin_layout Plain Layout
4847 \begin_inset Quotes erd
4850 produces the letter:
4851 \begin_inset Quotes eld
4855 \begin_inset Quotes erd
4859 If you tried to type
4860 \begin_inset Quotes eld
4864 \begin_inset Flex CharStyle:MenuItem
4867 \begin_layout Plain Layout
4874 \begin_inset Quotes erd
4877 , however, LyX will complain with a beep, since a
4878 \begin_inset Quotes eld
4882 \begin_inset Flex CharStyle:MenuItem
4885 \begin_layout Plain Layout
4892 \begin_inset Quotes erd
4895 never takes a circumflex accent.
4897 \begin_inset Flex CharStyle:MenuItem
4900 \begin_layout Plain Layout
4906 after a dead-key produces the bare-accent.
4907 Please note this last point! If you bind a key to a dead-key, you'll need
4908 to rebind the character on that key to yet another key.
4910 \begin_inset Flex CharStyle:MenuItem
4913 \begin_layout Plain Layout
4919 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4922 \begin_layout Standard
4923 One common way to bind dead-keys is to use
4924 \begin_inset Flex CharStyle:MenuItem
4927 \begin_layout Plain Layout
4934 \begin_inset Flex CharStyle:MenuItem
4937 \begin_layout Plain Layout
4944 \begin_inset Flex CharStyle:MenuItem
4947 \begin_layout Plain Layout
4953 in combination with an accent, like
4954 \begin_inset Quotes eld
4958 \begin_inset Flex CharStyle:MenuItem
4961 \begin_layout Plain Layout
4968 \begin_inset Quotes erd
4972 \begin_inset Quotes eld
4976 \begin_inset Flex CharStyle:MenuItem
4979 \begin_layout Plain Layout
4986 \begin_inset Quotes erd
4990 \begin_inset Quotes eld
4994 \begin_inset Flex CharStyle:MenuItem
4997 \begin_layout Plain Layout
5004 \begin_inset Quotes erd
5008 Another way involves using
5009 \begin_inset Flex CharStyle:Code
5012 \begin_layout Plain Layout
5019 \begin_inset Flex CharStyle:Code
5022 \begin_layout Plain Layout
5028 to set up the special
5029 \begin_inset Flex CharStyle:Code
5032 \begin_layout Plain Layout
5040 \begin_inset Flex CharStyle:Code
5043 \begin_layout Plain Layout
5049 acts in some ways just like
5050 \begin_inset Flex CharStyle:MenuItem
5053 \begin_layout Plain Layout
5059 and permits you to bind keys to accented characters.
5060 You can also turn keys into dead-keys by binding them to something like
5062 \begin_inset Flex CharStyle:Code
5065 \begin_layout Plain Layout
5071 and then binding this symbolic key to the corresponding LyX command.
5075 \begin_layout Plain Layout
5080 : This is exactly what I do in my
5081 \begin_inset Flex CharStyle:Code
5084 \begin_layout Plain Layout
5091 \begin_inset Flex CharStyle:Code
5094 \begin_layout Plain Layout
5102 \begin_inset Flex CharStyle:MenuItem
5105 \begin_layout Plain Layout
5107 \begin_inset space ~
5116 \begin_inset Flex CharStyle:Code
5119 \begin_layout Plain Layout
5125 and a bunch of these
5126 \begin_inset Quotes eld
5130 \begin_inset Flex CharStyle:Code
5133 \begin_layout Plain Layout
5140 \begin_inset Quotes erd
5143 symbolic keys bound such things as
5144 \begin_inset Flex CharStyle:MenuItem
5147 \begin_layout Plain Layout
5149 \begin_inset space ~
5158 \begin_inset Flex CharStyle:MenuItem
5161 \begin_layout Plain Layout
5163 \begin_inset space ~
5172 This is how I produce my accented characters.
5177 You can make just about anything into the
5178 \begin_inset Flex CharStyle:Code
5181 \begin_layout Plain Layout
5188 \begin_inset Flex CharStyle:MenuItem
5191 \begin_layout Plain Layout
5197 keys, a spare function key, etc.
5198 As for the LyX commands that produce accents, check the entry for
5199 \begin_inset Flex CharStyle:Code
5202 \begin_layout Plain Layout
5213 You'll find the complete list there.
5216 \begin_layout Subsection
5217 Saving your Language Configuration
5220 \begin_layout Standard
5221 You can edit your preferences so that your desired language environment
5222 is automatically configured when LyX starts up, via the
5223 \begin_inset Flex CharStyle:MenuItem
5226 \begin_layout Plain Layout
5227 Edit\SpecialChar \menuseparator
5236 \begin_layout Chapter
5237 Installing New Document Classes, Layouts, and Templates
5238 \begin_inset CommandInset label
5240 name "cha:Installing-New-Document"
5245 \begin_inset Argument
5248 \begin_layout Plain Layout
5249 Installing New Document Classes
5257 \begin_layout Standard
5258 In this chapter, we describe the procedures for creating and installing
5259 new LyX layout and template files, as well as offer a refresher on correctly
5260 installing new LaTeX document classes.
5264 \begin_layout Standard
5265 First, let us a say a few words about how one ought to think about the relation
5266 between LyX and LaTeX.
5267 The thing to understand is that, in a certain sense, LyX doesn't know anything
5269 Indeed, from LyX's point of view, LaTeX is just one of several
5270 \begin_inset Quotes eld
5274 \begin_inset Quotes erd
5277 in which it is capable of producing output.
5278 Other such formats are DocBook, plaintext, and XHTML.
5279 LaTeX is, of course, a particularly important format, but very little of
5280 the information LyX has about LaTeX is actually contained in the program
5285 \begin_layout Plain Layout
5286 Some commands are sufficiently complex that they are
5287 \begin_inset Quotes eld
5291 \begin_inset Quotes erd
5295 But the developers generally regard this as a Bad Thing.
5300 Rather, that information, even for the standard classes like
5301 \begin_inset Flex CharStyle:Code
5304 \begin_layout Plain Layout
5310 , is contained in `layout files'.
5311 Similarly, LyX itself does not know much about DocBook or XHTML.
5312 What it knows is contained in layout files.
5315 \begin_layout Standard
5316 You can think of the layout file for a given document class as a translation
5317 manual between LyX constructs---paragraphs with their corresponding styles,
5318 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5320 Almost everything LyX knows about
5321 \begin_inset Flex CharStyle:Code
5324 \begin_layout Plain Layout
5330 , for example, is contained in the file
5331 \begin_inset Flex CharStyle:Code
5334 \begin_layout Plain Layout
5340 and in various other files it includes.
5341 For this reason, anyone intending to write layout files should plan to
5342 study the existing files.
5343 A good place to start is with
5344 \begin_inset Flex CharStyle:Code
5347 \begin_layout Plain Layout
5353 , which is included in
5354 \begin_inset Flex CharStyle:Code
5357 \begin_layout Plain Layout
5364 \begin_inset Flex CharStyle:Code
5367 \begin_layout Plain Layout
5373 , and many of the other layout files for document classes.
5374 This file is where sections and the like are defined:
5375 \begin_inset Flex CharStyle:Code
5378 \begin_layout Plain Layout
5384 tells LyX how paragraphs that are marked with the Section, Subsection,
5385 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5388 \begin_inset Flex CharStyle:Code
5391 \begin_layout Plain Layout
5397 file basically just includes several of these
5398 \begin_inset Flex CharStyle:Code
5401 \begin_layout Plain Layout
5410 \begin_layout Standard
5411 Defining the LyX--LaTeX correspondence is not the only thing layout files
5413 Their other job is to define how the LyX constructs themselves will appear
5415 The fact that layout files have these two jobs is often a source of confusion,
5416 because they are completely separate.
5417 Telling LyX how to translate a certain paragraph style into LaTeX does
5418 not tell LyX how to display it; conversely, telling LyX how to display
5419 a certain paragraph style does not tell LyX how to translate it into LaTeX
5420 (let alone tell LaTeX how to display it).
5421 So, in general, when you define a new LyX construct, you must always do
5422 two quite separate things: (i)
5423 \begin_inset space ~
5426 tell LyX how to translate it into LaTeX and (ii)
5427 \begin_inset space ~
5430 tell LyX how to display it.
5433 \begin_layout Standard
5434 Much the same is true, of course, as regards LyX's other backend formats,
5435 though XHTML is in some ways different, because in that case LyX
5439 able, to some extent, to use information about how it should display a
5440 paragraph on the screen to output information (in the form of CSS) about
5441 how the paragraph should be displayed in a browser.
5442 Even in this case, however, the distinction between what LyX does internally
5443 and how things are rendered externally remains in force, and the two can
5444 be controlled separately.
5446 \begin_inset CommandInset ref
5448 reference "sec:Tags-for-XHTML"
5455 \begin_layout Section
5456 Installing new LaTeX files
5459 \begin_layout Standard
5460 Some installations may not include a LaTeX package or class file that you
5461 would like to use within LyX.
5462 For example, you might need FoilTeX, a package for preparing slides for
5463 overhead projectors.
5464 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5465 a user interface for installing such packages.
5466 For example, with MiKTeX, you start the program
5467 \begin_inset Quotes eld
5471 \begin_inset space ~
5475 \begin_inset Quotes erd
5478 to get a list of available packages.
5479 To install one of them, right click on it or use the corresponding toolbar
5483 \begin_layout Standard
5484 If your LaTeX distribution does not provide such a `package manager', or
5485 if the package is not available from your distribution, then follow these
5486 steps to install it manually:
5489 \begin_layout Enumerate
5490 Get the package from
5491 \begin_inset CommandInset href
5494 target "http://www.ctan.org/"
5501 \begin_layout Enumerate
5502 If the package contains a file with the ending
5503 \begin_inset Quotes eld
5507 \begin_inset Flex CharStyle:Code
5510 \begin_layout Plain Layout
5517 \begin_inset Quotes erd
5520 (is the case for FoilTeX) then open a console, change to the folder of
5521 this file and execute the command
5522 \begin_inset Flex CharStyle:Code
5525 \begin_layout Plain Layout
5532 You have now unpacked the package and have all files to install it.
5533 Most LaTeX-packages are not packed and you can skip this step.
5536 \begin_layout Enumerate
5537 Now you need to decide if the package should be available for all users
5542 \begin_layout Enumerate
5543 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5544 for all users on your system, then install it in your `local' TeX tree,
5545 otherwise install it in your own `user' TeX tree.
5546 Where these trees should be created, if they do not already exist, depends
5548 To find this out, look in the file
5549 \begin_inset Flex CharStyle:Code
5552 \begin_layout Plain Layout
5562 \begin_layout Plain Layout
5563 This is usually in the directory
5567 , though you can execute the command
5568 \begin_inset Flex CharStyle:Code
5571 \begin_layout Plain Layout
5582 The location of the `local' TeX tree is defined by the
5583 \begin_inset Flex CharStyle:Code
5586 \begin_layout Plain Layout
5592 variable; this is usually somewhere like
5594 /usr/local/share/texmf/
5597 The location of the `user' TeX tree is defined by
5598 \begin_inset Flex CharStyle:Code
5601 \begin_layout Plain Layout
5612 (If these variables are not predefined, you have to define them.) You'll
5613 probably need root permissions to create or modify the `local' tree, but
5614 your `user' tree shouldn't have such limitations.
5615 \begin_inset Newline newline
5618 In general, it is recommended to install in the user tree because your user
5619 will not be modified or even overwritten when you upgrade your system.
5620 It will typically also be backed up together with everything else when
5621 you backup your home directory (which, of course, you do on a regular basis).
5624 \begin_layout Enumerate
5625 On Windows, if you want the new package to be available for all users on
5626 your system, change to the folder where LaTeX is installed and then change
5636 (For MiKTeX, this would be by default the folder
5648 .) Create there a new folder
5649 \begin_inset Flex CharStyle:Code
5652 \begin_layout Plain Layout
5658 and copy all files of the package into it.
5659 If the package should only available for you or you don't have admin permission
5660 s, do the same, but in the local LaTeX folder.
5662 \begin_inset space \thinspace{}
5666 \begin_inset space ~
5670 \begin_inset space ~
5673 2.8 this would be on WinXP the folder
5674 \begin_inset Newline newline
5681 Documents and Settings
5688 \begin_inset Newline newline
5692 \begin_inset Phantom HPhantom
5695 \begin_layout Plain Layout
5714 \begin_inset Newline newline
5717 , on WinVista it would be the folder
5718 \begin_inset Newline newline
5745 \begin_layout Enumerate
5746 Now one only need to tell LaTeX that there are new files.
5747 This depends on the used LaTeX-Distribution:
5751 \begin_layout Enumerate
5752 For TeXLive execute the command
5753 \begin_inset Flex CharStyle:Code
5756 \begin_layout Plain Layout
5763 If you installed the package for all users, then you will probably need
5764 to have root permissions for that.
5767 \begin_layout Enumerate
5768 For MiKTeX, if you have installed the package for all users, start the program
5770 \begin_inset Quotes eld
5774 \begin_inset space ~
5778 \begin_inset Quotes erd
5781 and press the button marked
5782 \begin_inset Quotes eld
5786 \begin_inset Quotes erd
5790 Otherwise start the program
5791 \begin_inset Quotes eld
5795 \begin_inset Quotes erd
5802 \begin_layout Enumerate
5803 Finally, you need to tell LyX that there are new packages available.
5804 So, in LyX, use the menu
5805 \begin_inset Flex CharStyle:MenuItem
5808 \begin_layout Plain Layout
5811 \SpecialChar \menuseparator
5817 and then restart LyX.
5820 \begin_layout Standard
5821 Now the package is installed.
5822 In our example, the document class
5823 \begin_inset Flex CharStyle:Code
5826 \begin_layout Plain Layout
5828 \begin_inset space ~
5835 \begin_layout Plain Layout
5847 will now be available under
5848 \begin_inset Flex CharStyle:MenuItem
5851 \begin_layout Plain Layout
5852 Document\SpecialChar \menuseparator
5853 Settings\SpecialChar \menuseparator
5863 \begin_layout Standard
5864 If you would like to use a LaTeX document class that is not even listed
5866 \begin_inset Flex CharStyle:MenuItem
5869 \begin_layout Plain Layout
5870 Document\SpecialChar \menuseparator
5871 Settings\SpecialChar \menuseparator
5877 , then you need to create a `layout' file for it.
5878 That is the topic of the next section.
5881 \begin_layout Section
5882 Types of layout files
5885 \begin_layout Standard
5886 This section describes the various sorts of LyX files that contain layout
5888 These files describe various paragraph and character styles, determining
5889 how LyX should display them and how they should be translated into LaTeX,
5890 DocBook, XHTML, or whatever output format is being used.
5894 \begin_layout Standard
5895 We shall try to provide a thorough description of the process of writing
5897 However, there are so many different types of documents supported even
5898 by just LaTeX that we can't hope to cover every different possibility or
5899 problem you might encounter.
5900 The LyX users' list is frequented by people with lots of experience with
5901 layout design who are willing to share what they've learned, so please
5902 feel free to ask questions there.
5905 \begin_layout Standard
5906 As you prepare to write a new layout, it is extremely helpful to look at
5907 the layouts distributed with LyX.
5908 If you write a LyX layout for a LaTeX document class that might also be
5909 used by others, or write a module that might be useful to others, then
5910 you should consider posting your layout to the
5911 \begin_inset CommandInset href
5913 name "layout section on the LyX wiki"
5914 target "http://wiki.lyx.org/Layouts/Layouts"
5918 or even to the LyX developers' list, so that it might be included in LyX
5923 \begin_layout Plain Layout
5924 Note that LyX is licensed under the General Public License, so any material
5925 that is contributed to LyX must be similarly licensed.
5933 \begin_layout Subsection
5935 \begin_inset CommandInset label
5937 name "sub:Layout-modules"
5944 \begin_layout Standard
5945 We have spoken to this point about `layout files'.
5946 But there are different sorts of files that contain layout information.
5947 Layout files, strictly so called, have the
5948 \begin_inset Flex CharStyle:Code
5951 \begin_layout Plain Layout
5957 extension and provide LyX with information about document classes.
5958 As of LyX 1.6, however, layout information can also be contained in layout
5964 \begin_inset Flex CharStyle:Code
5967 \begin_layout Plain Layout
5974 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5975 some modules—such as the
5976 \begin_inset Flex CharStyle:Code
5979 \begin_layout Plain Layout
5985 module—specifcally provide support for one package.
5986 In a sense, layout modules are similar to included
5990 \begin_layout Plain Layout
5991 These can have any extension, but by convention have the
5992 \begin_inset Flex CharStyle:Code
5995 \begin_layout Plain Layout
6007 \begin_inset Flex CharStyle:Code
6010 \begin_layout Plain Layout
6016 —in that modules are not specific to a given document class but may be used
6017 with many different classes.
6018 The difference is that using an included file with
6019 \begin_inset Flex CharStyle:Code
6022 \begin_layout Plain Layout
6028 requires editing that file.
6029 Modules, by contrast, are selected in the
6030 \begin_inset Flex CharStyle:MenuItem
6033 \begin_layout Plain Layout
6034 Document\SpecialChar \menuseparator
6043 \begin_layout Standard
6044 Building modules is the easiest way to get started with layout editing,
6045 since it can be as simple as adding a single new paragraph style or flex
6047 But modules may, in principle, contain anything a layout file can contain.
6050 \begin_layout Standard
6051 After creating a new module and copying it to the
6052 \begin_inset Flex CharStyle:Code
6055 \begin_layout Plain Layout
6061 folder, you will need to reconfigure and then restart LyX for the module
6062 to appear in the menu.
6063 However, changes you make to the module will be seen immediately, if you
6065 \begin_inset Flex CharStyle:MenuItem
6068 \begin_layout Plain Layout
6069 Document\SpecialChar \menuseparator
6075 , highlight something, and then hit
6076 \begin_inset Quotes eld
6080 \begin_inset Quotes erd
6086 It is strongly recommended that you save your work before doing this
6091 it is strongly recommended that you not attempt to edit modules while simultaneo
6092 usly working on actual documents
6095 Though of course the developers strive to keep LyX stable in such situations,
6096 syntax errors and the like in your module file could cause strange behavior.
6099 \begin_layout Subsection
6101 \begin_inset Flex CharStyle:MenuItem
6104 \begin_layout Plain Layout
6113 \begin_layout Standard
6114 There are two situations you are likely to encounter when wanting to support
6115 a new LaTeX document class, involving LaTeX2e class (
6116 \begin_inset Flex CharStyle:Code
6119 \begin_layout Plain Layout
6126 \begin_inset Flex CharStyle:Code
6129 \begin_layout Plain Layout
6136 Supporting a style file is usually fairly easy.
6137 Supporting a new class file is a bit harder.
6138 We'll discuss the former in this section and the latter in the next.
6139 Similar remarks apply, of course, if you want to support a new DocBook
6143 \begin_layout Standard
6144 The easier case is the one in which your new document class is provided
6145 as a style file that is to be used in conjunction with an already supported
6147 For the sake of the example, we'll assume that the style file is called
6149 \begin_inset Flex CharStyle:MenuItem
6152 \begin_layout Plain Layout
6158 and that it is meant to be used with
6159 \begin_inset Flex CharStyle:MenuItem
6162 \begin_layout Plain Layout
6168 , which is a standard class.
6172 \begin_layout Standard
6173 Start by copying the existing class's layout file into your local directory:
6177 \begin_layout Plain Layout
6178 Of course, which directory is your local directory will vary by platform,
6179 and LyX allows you to specify your local directory on startup, too, using
6181 \begin_inset Flex CharStyle:Code
6184 \begin_layout Plain Layout
6198 \begin_layout LyX-Code
6199 cp report.layout ~/.lyx/layouts/myclass.layout
6202 \begin_layout Standard
6204 \begin_inset Flex CharStyle:Code
6207 \begin_layout Plain Layout
6213 and change the line:
6216 \begin_layout LyX-Code
6219 DeclareLaTeXClass{report}
6222 \begin_layout Standard
6226 \begin_layout LyX-Code
6229 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6232 \begin_layout Standard
6236 \begin_layout LyX-Code
6238 \begin_inset Newline newline
6244 \begin_inset Newline newline
6250 \begin_layout Standard
6251 near the top of the file.
6254 \begin_layout Standard
6255 Start LyX and select
6256 \begin_inset Flex CharStyle:MenuItem
6259 \begin_layout Plain Layout
6260 Tools\SpecialChar \menuseparator
6267 Then restart LyX and try creating a new document.
6269 \begin_inset Flex CharStyle:MenuItem
6272 \begin_layout Plain Layout
6278 " as a document class option in the
6279 \begin_inset Flex CharStyle:MenuItem
6282 \begin_layout Plain Layout
6283 Document\SpecialChar \menuseparator
6290 It is likely that some of the sectioning commands and such in your new
6291 class will work differently from how they worked in the base class—
6292 \begin_inset Flex CharStyle:Code
6295 \begin_layout Plain Layout
6301 in this example—so you can fiddle around with the settings for the different
6302 sections if you wish.
6303 The layout information for sections is contained in
6304 \begin_inset Flex CharStyle:Code
6307 \begin_layout Plain Layout
6313 , but you do not need to copy and change this file.
6314 Instead, you can simply add your changes to your layout file, after the
6316 \begin_inset Flex CharStyle:Code
6319 \begin_layout Plain Layout
6325 , which itself includes
6326 \begin_inset Flex CharStyle:Code
6329 \begin_layout Plain Layout
6336 For example, you might add these lines:
6339 \begin_layout LyX-Code
6343 \begin_layout LyX-Code
6347 \begin_layout LyX-Code
6351 \begin_layout LyX-Code
6355 \begin_layout LyX-Code
6359 \begin_layout Standard
6360 to change the font for chapter headings to sans-serif.
6361 This will override (or, in this case, add to) the existing declaration
6362 for the Chapter style.
6366 \begin_layout Standard
6367 Your new package may also provide commands or environments not present in
6369 In this case, you will want to add these to the layout file.
6371 \begin_inset CommandInset ref
6373 reference "sec:TextClass"
6377 for information on how to do so.
6380 \begin_layout Standard
6382 \begin_inset Flex CharStyle:MenuItem
6385 \begin_layout Plain Layout
6391 can be used with several different document classes, and even if it cannot,
6392 you might find it easiest just to write a module that you can load with
6394 The simplest possible such module would be:
6397 \begin_layout LyX-Code
6400 DeclareLyXModule{My Package}
6403 \begin_layout LyX-Code
6407 \begin_layout LyX-Code
6408 #Support for mypkg.sty.
6411 \begin_layout LyX-Code
6413 \begin_inset Newline newline
6419 \begin_layout LyX-Code
6421 \begin_inset Newline newline
6427 \begin_layout LyX-Code
6429 \begin_inset Newline newline
6435 \begin_inset Newline newline
6441 \begin_layout Standard
6442 A more complex module might modify the behavior of some existing constructs
6443 or define some new ones.
6445 \begin_inset CommandInset ref
6447 reference "sec:TextClass"
6454 \begin_layout Subsection
6456 \begin_inset Flex CharStyle:MenuItem
6459 \begin_layout Plain Layout
6468 \begin_layout Standard
6469 There are two possibilities here.
6470 One is that the class file is itself based upon an existing document class.
6471 For example, many thesis classes are based upon
6472 \begin_inset Flex CharStyle:MenuItem
6475 \begin_layout Plain Layout
6482 To see whether yours is, look for a line like
6485 \begin_layout LyX-Code
6491 \begin_layout Standard
6493 If so, then you may proceed largely as in the previous section, though
6495 \begin_inset Flex CharStyle:Code
6498 \begin_layout Plain Layout
6504 line will be different.
6505 If your new class is
6506 \begin_inset Flex CharStyle:Code
6509 \begin_layout Plain Layout
6515 and it is based upon
6516 \begin_inset Flex CharStyle:Code
6519 \begin_layout Plain Layout
6525 , then the line should read:
6529 \begin_layout Plain Layout
6530 And it will be easiest if you save the file to
6531 \begin_inset Flex CharStyle:Code
6534 \begin_layout Plain Layout
6540 : LyX assumes that the document class has the same name as the layout file.
6549 \begin_layout LyX-Code
6552 DeclareLaTeXClass[thesis,book]{thesis}
6555 \begin_layout Standard
6556 If, on the other hand, the new class is not based upon an existing class,
6557 you will probably have to
6558 \begin_inset Quotes eld
6562 \begin_inset Quotes erd
6566 We strongly suggest copying an existing layout file which uses a similar
6567 LaTeX class and then modifying it, if you can do so.
6568 At least use an existing file as a starting point so you can find out what
6569 items you need to worry about.
6570 Again, the specifics are covered below.
6573 \begin_layout Subsection
6575 \begin_inset CommandInset label
6577 name "sub:Creating-Templates"
6584 \begin_layout Standard
6585 Once you have written a layout file for a new document class, you might
6586 want to consider writing a
6591 A template acts as a kind of tutorial for your layout, showing how it might
6592 be used, though containing dummy content.
6593 You can of course look at the various templates included with LyX for ideas.
6596 \begin_layout Standard
6597 Templates are created just like usual documents: using LyX.
6598 The only difference is that usual documents contain all possible settings,
6599 including the font scheme and the paper size.
6600 Usually a user doesn't want a template to overwrite his preferred settings
6601 for such parameters.
6602 For that reason, the designer of a template should remove the corresponding
6604 \begin_inset Flex CharStyle:Code
6607 \begin_layout Plain Layout
6616 \begin_inset Flex CharStyle:Code
6619 \begin_layout Plain Layout
6627 from the template LyX file.
6628 This can be done with any simple text-editor, for example
6629 \begin_inset Flex CharStyle:Code
6632 \begin_layout Plain Layout
6639 \begin_inset Flex CharStyle:Code
6642 \begin_layout Plain Layout
6652 \begin_layout Standard
6653 Put the edited template files you create in
6654 \begin_inset Flex CharStyle:Code
6657 \begin_layout Plain Layout
6663 , copy the ones you use from the global template directory in
6664 \begin_inset Flex CharStyle:Code
6667 \begin_layout Plain Layout
6673 to the same place, and redefine the template path in the
6674 \begin_inset Flex CharStyle:MenuItem
6677 \begin_layout Plain Layout
6678 Tools\SpecialChar \menuseparator
6679 Preferences\SpecialChar \menuseparator
6688 \begin_layout Standard
6689 Note, by the way, that there is a template which has a particular meaning:
6691 \begin_inset Flex CharStyle:Code
6694 \begin_layout Plain Layout
6701 This template is loaded every time you create a new document with
6702 \begin_inset Flex CharStyle:MenuItem
6705 \begin_layout Plain Layout
6706 File\SpecialChar \menuseparator
6712 in order to provide useful defaults.
6713 To create this template from inside LyX, all you have to do is to open
6714 a document with the correct settings, and use the
6715 \begin_inset Flex CharStyle:MenuItem
6718 \begin_layout Plain Layout
6719 Save as Document Defaults
6727 \begin_layout Subsection
6728 Upgrading old layout files
6731 \begin_layout Standard
6732 The format of layout files changes with each LyX release, so old layout
6733 files need to be converted to the new format.
6734 This process has been automated since LyX 1.4: If LyX reads a layout file
6735 in an older format, it automatically calls the script
6736 \begin_inset Flex CharStyle:Code
6739 \begin_layout Plain Layout
6745 to convert it to a temporary file in current format.
6746 The original file is left untouched.
6747 If you use the layout file often, then, you may want to convert it permanently,
6748 so that LyX does not have to do so itself every time.
6749 To do this, you can call the converter manually:
6752 \begin_layout LyX-Code
6753 mv myclass.layout myclass.old
6756 \begin_layout LyX-Code
6757 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6760 \begin_layout Standard
6762 \begin_inset Flex CharStyle:Code
6765 \begin_layout Plain Layout
6771 with the name of your LyX system directory, of course.
6774 \begin_layout Standard
6775 Note that manual conversion does not affect included files, so these will
6776 have to be converted separately.
6779 \begin_layout Section
6780 \begin_inset CommandInset label
6782 name "sec:TextClass"
6786 The layout file format
6789 \begin_layout Standard
6790 When it's finally time to get your hands dirty and create or edit your own
6791 layout file, the following sections describe what you're up against.
6792 Our advice is to go slowly, save and test often, listen to soothing music,
6793 and enjoy one or two of your favorite adult beverages; more if you are
6794 getting particularly stuck.
6795 It's really not that hard, except that the multitude of options can become
6796 overwhelming if you try to do too much in one sitting.
6797 Go have another adult beverage, just for good measure.
6800 \begin_layout Standard
6801 Note that all the tags used in layout files are case-insensitive.
6803 \begin_inset Flex CharStyle:Code
6806 \begin_layout Plain Layout
6813 \begin_inset Flex CharStyle:Code
6816 \begin_layout Plain Layout
6823 \begin_inset Flex CharStyle:Code
6826 \begin_layout Plain Layout
6832 are really the same tag.
6833 The possible values are printed in brackets after the feature's name.
6834 The default value if a feature isn't specified inside a text class-description
6836 \begin_inset Flex CharStyle:Code
6839 \begin_layout Plain Layout
6848 If the argument has a data type like
6849 \begin_inset Quotes eld
6853 \begin_inset Quotes erd
6857 \begin_inset Quotes eld
6861 \begin_inset Quotes erd
6864 , the default is shown like this:
6865 \begin_inset Flex CharStyle:Code
6868 \begin_layout Plain Layout
6879 \begin_layout Subsection
6880 The document class declaration
6883 \begin_layout Standard
6884 Lines in a layout file which begin with
6885 \begin_inset Flex CharStyle:Code
6888 \begin_layout Plain Layout
6895 There is one exception to this rule.
6897 \begin_inset Flex CharStyle:Code
6900 \begin_layout Plain Layout
6906 files should begin with a line like:
6909 \begin_layout LyX-Code
6912 #% Do not delete the line below; configure depends on this
6915 \begin_layout LyX-Code
6920 DeclareLaTeXClass{article}
6923 \begin_layout Standard
6924 The second line is used when you (re)configure LyX.
6925 The layout file is read by the LaTeX script
6926 \begin_inset Flex CharStyle:Code
6929 \begin_layout Plain Layout
6935 , in a special mode where
6936 \begin_inset Flex CharStyle:Code
6939 \begin_layout Plain Layout
6946 The first line is just a LaTeX comment, and the second one contains the
6947 declaration of the text class.
6948 If these lines appear in a file named
6949 \begin_inset Flex CharStyle:Code
6952 \begin_layout Plain Layout
6958 , then they define a text class of name
6959 \begin_inset Flex CharStyle:Code
6962 \begin_layout Plain Layout
6968 (the name of the layout file) which uses the LaTeX document class
6969 \begin_inset Flex CharStyle:Code
6972 \begin_layout Plain Layout
6978 (the default is to use the same name as the layout).
6980 \begin_inset Quotes eld
6984 \begin_inset Quotes erd
6987 that appears above is used as a description of the text class in the
6988 \begin_inset Flex CharStyle:MenuItem
6991 \begin_layout Plain Layout
6992 Document\SpecialChar \menuseparator
7001 \begin_layout Standard
7002 Let's assume that you wrote your own text class that uses the
7003 \begin_inset Flex CharStyle:Code
7006 \begin_layout Plain Layout
7012 document class, but where you changed the appearance of the section headings.
7013 If you put it in a file
7014 \begin_inset Flex CharStyle:Code
7017 \begin_layout Plain Layout
7023 , the header of this file should be:
7026 \begin_layout LyX-Code
7029 #% Do not delete the line below; configure depends on this
7032 \begin_layout LyX-Code
7037 DeclareLaTeXClass[article]{article (with my own headings)}
7040 \begin_layout Standard
7041 This declares a text class
7042 \begin_inset Flex CharStyle:Code
7045 \begin_layout Plain Layout
7051 , associated with the LaTeX document class
7052 \begin_inset Flex CharStyle:Code
7055 \begin_layout Plain Layout
7062 \begin_inset Quotes eld
7065 article (with my own headings)
7066 \begin_inset Quotes erd
7070 If your text class depends on several packages, you can declare it as:
7073 \begin_layout LyX-Code
7076 #% Do not delete the line below; configure depends on this
7079 \begin_layout LyX-Code
7084 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7087 \begin_layout Standard
7088 This indicates that your text class uses the
7089 \begin_inset Flex CharStyle:Code
7092 \begin_layout Plain Layout
7099 Finally, it is also possible to declare classes for DocBook code.
7100 Typical declarations will look like:
7103 \begin_layout LyX-Code
7106 #% Do not delete the line below; configure depends on this
7109 \begin_layout LyX-Code
7114 DeclareDocBookClass[article]{SGML (DocBook article)}
7117 \begin_layout Standard
7118 Note that these declarations can also be given an optional parameter declaring
7119 the name of the document class (but not a list).
7122 \begin_layout Standard
7123 So, to be as explicit as possible, the form of the layout declaration is:
7126 \begin_layout LyX-Code
7131 DeclareLaTeXClass[class,package.sty]{layout description}
7134 \begin_layout Standard
7135 The class need only be specified if the name of the LaTeX class file and
7136 the name of the layout file are different or if there are packages to load.
7137 If the name of the class file is not specified, then LyX will simply assume
7138 that it is the same as the name of the layout file.
7141 \begin_layout Standard
7142 When the text class has been modified to your taste, all you have to do
7143 is to copy it either to
7144 \begin_inset Flex CharStyle:Code
7147 \begin_layout Plain Layout
7154 \begin_inset Flex CharStyle:Code
7157 \begin_layout Plain Layout
7164 \begin_inset Flex CharStyle:MenuItem
7167 \begin_layout Plain Layout
7168 Tools\SpecialChar \menuseparator
7174 , exit LyX and restart.
7175 Then your new text class should be available along with the others.
7178 \begin_layout Standard
7179 Once the layout file is installed, you can edit it and see your changes
7180 without having to reconfigure or to restart LyX.
7185 \begin_layout Plain Layout
7186 In versions of LyX prior to 1.6, this was not true.
7187 As a result, editing layout files was very time consuming, since you had
7188 constantly to restart LyX to see changes.
7193 You can force a reload of the current layout by using the LyX function
7195 \begin_inset Flex CharStyle:MenuItem
7198 \begin_layout Plain Layout
7205 There is no default binding for this function—though, of course, you can
7206 bind it to a key yourself.
7207 But you will normally use this function simply by entering it in the mini-buffe
7212 \begin_layout Standard
7218 \begin_inset Flex CharStyle:MenuItem
7221 \begin_layout Plain Layout
7227 is very much an `advanced feature'.
7232 recommended that you save your work before using this function.
7237 recommended that you not attempt to edit layout information while simultaneousl
7238 y working on a document that you care about.
7239 Use a test document.
7240 Syntax errors and the like in your layout file could cause peculiar behavior.
7241 In particular, such errors could cause LyX to regard the current layout
7242 as invalid and to attempt to switch to some other layout.
7246 \begin_layout Plain Layout
7247 Really bad syntax errors may even caused LyX to exit.
7248 This is because certain sorts of errors may make LyX unable to read
7258 The LyX team strives to keep LyX stable in such situations, but safe is
7263 \begin_layout Plain Layout
7264 While we're giving advice: make regular backups.
7265 And be nice to your mother.
7273 \begin_layout Subsection
7274 The Module declaration
7277 \begin_layout Standard
7278 A module must begin with a line like the following:
7281 \begin_layout LyX-Code
7284 DeclareLyXModule[endnotes.sty]{Endnotes}
7287 \begin_layout Standard
7288 The mandatory argument, in curly brackets, is the name of the module, as
7290 \begin_inset Flex CharStyle:MenuItem
7293 \begin_layout Plain Layout
7294 Document\SpecialChar \menuseparator
7301 The argument in square brackets is optional: It declares any LaTeX packages
7302 on which the module depends.
7303 Please note that only packages about which LyX knows should be listed in
7304 the square brackets.
7308 \begin_layout Plain Layout
7309 The list of such packages is documented only in the source code.
7314 LyX will not check for arbitrary packages.
7315 It is also possible to use the form
7316 \begin_inset Flex CharStyle:MenuItem
7319 \begin_layout Plain Layout
7325 as an optional argument, which declares that the module can only be used
7326 when there exists a conversion chain between the formats `
7327 \begin_inset Flex CharStyle:Code
7330 \begin_layout Plain Layout
7337 \begin_inset Flex CharStyle:Code
7340 \begin_layout Plain Layout
7349 \begin_layout Standard
7350 The module declaration should then be followed by lines like the following:
7353 \begin_layout LyX-Code
7357 \begin_layout LyX-Code
7358 #Adds an endnote command, in addition to footnotes.
7362 \begin_layout LyX-Code
7363 #You will need to add
7365 theendnotes in TeX code where you
7368 \begin_layout LyX-Code
7369 #want the endnotes to appear.
7373 \begin_layout LyX-Code
7377 \begin_layout LyX-Code
7378 #Requires: somemodule | othermodule
7381 \begin_layout LyX-Code
7382 #Excludes: badmodule
7385 \begin_layout Standard
7386 The description is used in
7387 \begin_inset Flex CharStyle:MenuItem
7390 \begin_layout Plain Layout
7391 Document\SpecialChar \menuseparator
7397 to provide the user with information about what the module does.
7399 \begin_inset Flex CharStyle:Code
7402 \begin_layout Plain Layout
7408 line is used to identify other modules with which this one must be used;
7410 \begin_inset Flex CharStyle:Code
7413 \begin_layout Plain Layout
7419 line is used to identify modules with which this one may not be used.
7420 Both are optional, and, as shown, multiple modules should be separated
7421 with the pipe symbol: |.
7422 Note that the required modules are treated disjunctively:
7426 of the required modules must be used.
7431 excluded module may be used.
7432 Note that modules are identified here by their
7437 \begin_inset Flex CharStyle:Code
7440 \begin_layout Plain Layout
7448 \begin_inset Flex CharStyle:Code
7451 \begin_layout Plain Layout
7458 \begin_inset Flex CharStyle:Code
7461 \begin_layout Plain Layout
7470 \begin_layout Subsection
7474 \begin_layout Standard
7475 The first non-comment line of any layout file, included file, or module
7480 contain the file format number:
7483 \begin_layout Description
7484 \begin_inset Flex CharStyle:Code
7487 \begin_layout Plain Layout
7494 \begin_inset Flex CharStyle:Code
7497 \begin_layout Plain Layout
7503 ] The format of the layout file.
7506 \begin_layout Standard
7507 This tag was introduced with LyX 1.4.0.
7508 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7509 and are considered to be of format 1.
7510 The format for the present version of LyX is format 21.
7511 But each version of LyX is capable of reading earlier versions' layout
7512 files, just as they are capable of reading files produced by earlier versions
7514 There is, however, no provision for converting to earlier formats.
7515 So LyX 1.6.x will not read layout files in format 21 but only files in format
7519 \begin_layout Subsection
7520 \begin_inset CommandInset label
7522 name "sub:General-text-class"
7526 General text class parameters
7529 \begin_layout Standard
7530 These are general parameters that govern the behavior of an entire document
7536 mean that they must appear in
7537 \begin_inset Flex CharStyle:Code
7540 \begin_layout Plain Layout
7546 files rather than in modules.
7547 A module can contain any layout tag.)
7550 \begin_layout Description
7551 \begin_inset Flex CharStyle:Code
7554 \begin_layout Plain Layout
7560 Adds information that will be output in the
7561 \begin_inset Flex CharStyle:Code
7564 \begin_layout Plain Layout
7570 block when this document class is output to XHTML.
7571 Typically, this would be used to output CSS style information, but it can
7572 be used for anything that can appear in
7573 \begin_inset Flex CharStyle:Code
7576 \begin_layout Plain Layout
7584 \begin_inset Quotes eld
7588 \begin_inset Flex CharStyle:Code
7591 \begin_layout Plain Layout
7598 \begin_inset Quotes erd
7604 \begin_layout Description
7605 \begin_inset Flex CharStyle:Code
7608 \begin_layout Plain Layout
7614 Adds information to the document preamble.
7616 \begin_inset Quotes eld
7620 \begin_inset Flex CharStyle:Code
7623 \begin_layout Plain Layout
7630 \begin_inset Quotes erd
7636 \begin_layout Description
7637 \begin_inset Flex CharStyle:Code
7640 \begin_layout Plain Layout
7646 Defines formats for use in the display of bibliographic information.
7648 \begin_inset CommandInset ref
7650 reference "sub:Citation-format-description"
7656 \begin_inset Quotes eld
7660 \begin_inset Flex CharStyle:Code
7663 \begin_layout Plain Layout
7670 \begin_inset Quotes erd
7676 \begin_layout Description
7677 \begin_inset Flex CharStyle:Code
7680 \begin_layout Plain Layout
7686 Describes various global options supported by the document class.
7688 \begin_inset space ~
7692 \begin_inset CommandInset ref
7694 reference "sub:ClassOptions"
7700 \begin_inset Quotes eld
7704 \begin_inset Flex CharStyle:Code
7707 \begin_layout Plain Layout
7714 \begin_inset Quotes erd
7720 \begin_layout Description
7721 \begin_inset Flex CharStyle:Code
7724 \begin_layout Plain Layout
7731 \begin_inset Flex CharStyle:Code
7734 \begin_layout Plain Layout
7743 \begin_inset Flex CharStyle:Code
7746 \begin_layout Plain Layout
7752 ] Whether the class should
7756 to having one or two columns.
7757 Can be changed in the
7758 \begin_inset Flex CharStyle:MenuItem
7761 \begin_layout Plain Layout
7762 Document\SpecialChar \menuseparator
7771 \begin_layout Description
7772 \begin_inset Flex CharStyle:Code
7775 \begin_layout Plain Layout
7782 \begin_inset Flex CharStyle:Code
7785 \begin_layout Plain Layout
7791 ] This sequence defines the properties for a counter.
7792 If the counter does not yet exist, it is created; if it does exist, it
7795 \begin_inset Quotes eld
7799 \begin_inset Flex CharStyle:Code
7802 \begin_layout Plain Layout
7809 \begin_inset Quotes erd
7813 \begin_inset Newline newline
7817 \begin_inset space ~
7821 \begin_inset CommandInset ref
7823 reference "sub:Counters"
7827 for details on counters.
7830 \begin_layout Description
7831 \begin_inset Flex CharStyle:Code
7834 \begin_layout Plain Layout
7840 Sets the default font used to display the document.
7842 \begin_inset space ~
7846 \begin_inset CommandInset ref
7848 reference "sub:Font-description"
7852 for how to declare fonts.
7854 \begin_inset Quotes eld
7858 \begin_inset Flex CharStyle:Code
7861 \begin_layout Plain Layout
7868 \begin_inset Quotes erd
7874 \begin_layout Description
7875 \begin_inset Flex CharStyle:Code
7878 \begin_layout Plain Layout
7885 \begin_inset Flex CharStyle:Code
7888 \begin_layout Plain Layout
7894 Specifies a module to be included by default with this document class.
7895 The module should be specified by filename without the
7896 \begin_inset Flex CharStyle:Code
7899 \begin_layout Plain Layout
7906 The user can still remove the module, but it will be active at the outset.
7907 (This applies only when new files are created, or when this class is chosen
7908 for an existing document.)
7911 \begin_layout Description
7912 \begin_inset Flex CharStyle:Code
7915 \begin_layout Plain Layout
7922 \begin_inset Flex CharStyle:Code
7925 \begin_layout Plain Layout
7931 ] This is the style that will be assigned to new paragraphs, usually
7932 \begin_inset Flex CharStyle:MenuItem
7935 \begin_layout Plain Layout
7942 This will default to the first defined style if not given, but you are
7943 encouraged to use this directive.
7946 \begin_layout Description
7947 \begin_inset Flex CharStyle:Code
7950 \begin_layout Plain Layout
7957 \begin_inset Flex CharStyle:Code
7960 \begin_layout Plain Layout
7966 ] This tag indicates that the module in question—which should be specified
7967 by filename without the
7968 \begin_inset Flex CharStyle:Code
7971 \begin_layout Plain Layout
7977 extension—cannot be used with this document class.
7978 This might be used in a journal-specific layout file to prevent, say, the
7980 \begin_inset Flex CharStyle:Code
7983 \begin_layout Plain Layout
7989 module that numbers theorems by section.
7994 be used in a module.
7995 Modules have their own way of excluding other modules (see
7996 \begin_inset CommandInset ref
7998 reference "sub:Layout-modules"
8005 \begin_layout Description
8006 \begin_inset Flex CharStyle:Code
8009 \begin_layout Plain Layout
8015 Defines a new float.
8017 \begin_inset space ~
8021 \begin_inset CommandInset ref
8023 reference "sub:Floats"
8029 \begin_inset Quotes eld
8033 \begin_inset Flex CharStyle:Code
8036 \begin_layout Plain Layout
8043 \begin_inset Quotes erd
8049 \begin_layout Description
8050 \begin_inset Flex CharStyle:Code
8053 \begin_layout Plain Layout
8059 Sets the information that will be output in the
8060 \begin_inset Flex CharStyle:Code
8063 \begin_layout Plain Layout
8069 block when this document class is output to XHTML.
8070 Note that this will completely override any prior
8071 \begin_inset Flex CharStyle:Code
8074 \begin_layout Plain Layout
8081 \begin_inset Flex CharStyle:Code
8084 \begin_layout Plain Layout
8092 \begin_inset Flex CharStyle:Code
8095 \begin_layout Plain Layout
8101 if you just want to add material to the preamble.) Must end with
8102 \begin_inset Quotes eld
8106 \begin_inset Flex CharStyle:Code
8109 \begin_layout Plain Layout
8116 \begin_inset Quotes erd
8122 \begin_layout Description
8123 \begin_inset Flex CharStyle:Code
8126 \begin_layout Plain Layout
8133 \begin_inset Flex CharStyle:Code
8136 \begin_layout Plain Layout
8142 ] The layout to use for the table of contents, bibliography, and so forth,
8143 when the document is output to HTML.
8144 For articles, this should normally be Section; for books, Chapter.
8145 If it is not given, then LyX will attempt to figure out which layout to
8149 \begin_layout Description
8150 \begin_inset Flex CharStyle:Code
8153 \begin_layout Plain Layout
8160 \begin_inset Flex CharStyle:Code
8163 \begin_layout Plain Layout
8169 ] Modifies the properties of the given counter.
8170 If the counter does not exist, the section is ignored.
8172 \begin_inset Quotes eld
8176 \begin_inset Flex CharStyle:Code
8179 \begin_layout Plain Layout
8186 \begin_inset Quotes erd
8190 \begin_inset Newline newline
8194 \begin_inset space ~
8198 \begin_inset CommandInset ref
8200 reference "sub:Counters"
8204 for details on counters.
8207 \begin_layout Description
8208 \begin_inset Flex CharStyle:Code
8211 \begin_layout Plain Layout
8218 \begin_inset Flex CharStyle:Code
8221 \begin_layout Plain Layout
8227 ] Modifies the properties of the given paragraph style.
8228 If the style does not exist, the section is ignored.
8230 \begin_inset Quotes eld
8234 \begin_inset Flex CharStyle:Code
8237 \begin_layout Plain Layout
8244 \begin_inset Quotes erd
8250 \begin_layout Description
8251 \begin_inset Flex CharStyle:Code
8254 \begin_layout Plain Layout
8260 As its name implies, this command allows you to include another layout
8261 definition file within yours to avoid duplicating commands.
8262 Common examples are the standard layout files, for example,
8263 \begin_inset Flex CharStyle:Code
8266 \begin_layout Plain Layout
8272 , which contains most of the basic layouts.
8275 \begin_layout Description
8276 \begin_inset Flex CharStyle:Code
8279 \begin_layout Plain Layout
8285 This section (re-)defines the layout of an inset.
8286 It can be applied to an existing inset or to a new, user-defined inset,
8287 e.g., a new character style.
8289 \begin_inset Quotes eld
8293 \begin_inset Flex CharStyle:Code
8296 \begin_layout Plain Layout
8303 \begin_inset Quotes erd
8307 \begin_inset Newline newline
8311 \begin_inset space ~
8315 \begin_inset CommandInset ref
8317 reference "sub:Flex-insets-and"
8321 for more information.
8325 \begin_layout Description
8326 \begin_inset Flex CharStyle:Code
8329 \begin_layout Plain Layout
8336 \begin_inset Flex CharStyle:Code
8339 \begin_layout Plain Layout
8345 ] A string that indicates the width of the left margin on the screen, for
8347 \begin_inset Quotes eld
8351 \begin_inset Quotes erd
8355 (Note that this is not a `length', like
8356 \begin_inset Quotes eld
8360 \begin_inset Quotes erd
8366 \begin_layout Description
8367 \begin_inset Flex CharStyle:Code
8370 \begin_layout Plain Layout
8376 This command deletes an existing float.
8377 This is particularly useful when you want to suppress a float that has
8378 been defined in an input file.
8381 \begin_layout Description
8382 \begin_inset Flex CharStyle:Code
8385 \begin_layout Plain Layout
8391 This command deletes an existing style.
8392 This is particularly useful when you want to suppress a style that has
8393 be defined in an input file.
8396 \begin_layout Description
8397 \begin_inset Flex CharStyle:Code
8400 \begin_layout Plain Layout
8406 A string indicating the file format (as defined in the Preferences dialog)
8407 produced by this class.
8408 It is mainly useful when
8409 \begin_inset Flex CharStyle:Code
8412 \begin_layout Plain Layout
8418 is `literate' and one wants to define a new type of literate document.
8419 This string is reset to `docbook', `latex', or `literate' when the correspondin
8421 \begin_inset Flex CharStyle:Code
8424 \begin_layout Plain Layout
8430 parameter is encountered.
8433 \begin_layout Description
8434 \begin_inset Flex CharStyle:Code
8437 \begin_layout Plain Layout
8443 A string indicating what sort of output documents using this class will
8445 At present, the options are: `docbook', `latex', and `literate'.
8448 \begin_layout Description
8449 \begin_inset Flex CharStyle:Code
8452 \begin_layout Plain Layout
8459 \begin_inset Flex CharStyle:Code
8462 \begin_layout Plain Layout
8471 \begin_inset Flex CharStyle:Code
8474 \begin_layout Plain Layout
8481 \begin_inset Flex CharStyle:Code
8484 \begin_layout Plain Layout
8490 ] The default pagestyle.
8491 Can be changed in the
8492 \begin_inset Flex CharStyle:MenuItem
8495 \begin_layout Plain Layout
8496 Document\SpecialChar \menuseparator
8505 \begin_layout Description
8506 \begin_inset Flex CharStyle:Code
8509 \begin_layout Plain Layout
8515 Sets the preamble for the LaTeX document.
8516 Note that this will completely override any prior
8517 \begin_inset Flex CharStyle:Code
8520 \begin_layout Plain Layout
8527 \begin_inset Flex CharStyle:Code
8530 \begin_layout Plain Layout
8538 \begin_inset Flex CharStyle:Code
8541 \begin_layout Plain Layout
8547 if you just want to add material to the preamble.) Must end with
8548 \begin_inset Quotes eld
8552 \begin_inset Flex CharStyle:Code
8555 \begin_layout Plain Layout
8562 \begin_inset Quotes erd
8568 \begin_layout Description
8569 \begin_inset Flex CharStyle:Code
8572 \begin_layout Plain Layout
8579 \begin_inset Flex CharStyle:Code
8582 \begin_layout Plain Layout
8589 \begin_inset Flex CharStyle:Code
8592 \begin_layout Plain Layout
8601 \begin_inset Flex CharStyle:Code
8604 \begin_layout Plain Layout
8610 ] Whether the class already provides the feature
8611 \begin_inset Flex CharStyle:Code
8614 \begin_layout Plain Layout
8621 A feature is in general the name of a package (
8622 \begin_inset Flex CharStyle:Code
8625 \begin_layout Plain Layout
8632 \begin_inset Flex CharStyle:Code
8635 \begin_layout Plain Layout
8641 , \SpecialChar \ldots{}
8643 \begin_inset Flex CharStyle:Code
8646 \begin_layout Plain Layout
8653 \begin_inset Flex CharStyle:Code
8656 \begin_layout Plain Layout
8662 ,\SpecialChar \ldots{}
8663 ); the complete list of supported features is unfortunately not documented
8664 outside the LyX source code—but see
8665 \begin_inset Flex CharStyle:Code
8668 \begin_layout Plain Layout
8674 if you're interested.
8676 \begin_inset Flex CharStyle:MenuItem
8679 \begin_layout Plain Layout
8680 Help\SpecialChar \menuseparator
8686 also gives an overview of the supported packages.
8689 \begin_layout Description
8690 \begin_inset Flex CharStyle:Code
8693 \begin_layout Plain Layout
8700 \begin_inset Flex CharStyle:Code
8703 \begin_layout Plain Layout
8709 ] Indicates that this layout provides the functionality of the module mentioned,
8710 which should be specified by the filename without the
8711 \begin_inset Flex CharStyle:Code
8714 \begin_layout Plain Layout
8721 This will typically be used if the layout includes the module directly,
8722 rather than using the
8723 \begin_inset Flex CharStyle:Code
8726 \begin_layout Plain Layout
8732 tag to indicate that it ought to be used.
8733 It could also be used in a module that provided an alternate implementation
8734 of the same functionality.
8737 \begin_layout Description
8738 \begin_inset Flex CharStyle:Code
8741 \begin_layout Plain Layout
8748 \begin_inset Flex CharStyle:Code
8751 \begin_layout Plain Layout
8757 ] Whether the class requires the feature
8758 \begin_inset Flex CharStyle:Code
8761 \begin_layout Plain Layout
8768 Multiple features must be separated by commas.
8769 Note that you can only request supported features.
8771 \begin_inset Flex CharStyle:Code
8774 \begin_layout Plain Layout
8780 for a list of these.)
8783 \begin_layout Description
8784 \begin_inset Flex CharStyle:Code
8787 \begin_layout Plain Layout
8793 A string that indicates the width of the right margin on the screen, for
8795 \begin_inset Quotes eld
8799 \begin_inset Quotes erd
8805 \begin_layout Description
8806 \begin_inset Flex CharStyle:Code
8809 \begin_layout Plain Layout
8815 Sets which divisions get numbered.
8817 \begin_inset Flex CharStyle:Code
8820 \begin_layout Plain Layout
8829 \begin_layout Description
8830 \begin_inset Flex CharStyle:Code
8833 \begin_layout Plain Layout
8840 \begin_inset Flex CharStyle:Code
8843 \begin_layout Plain Layout
8852 \begin_inset Flex CharStyle:Code
8855 \begin_layout Plain Layout
8861 ] Whether the class-default should be printing on one or both sides of the
8863 Can be changed in the
8864 \begin_inset Flex CharStyle:MenuItem
8867 \begin_layout Plain Layout
8868 Document\SpecialChar \menuseparator
8877 \begin_layout Description
8878 \begin_inset Flex CharStyle:Code
8881 \begin_layout Plain Layout
8887 This sequence defines a paragraph style.
8888 If the style does not yet exist, it is created; if it does exist, its parameter
8891 \begin_inset Quotes eld
8895 \begin_inset Flex CharStyle:Code
8898 \begin_layout Plain Layout
8905 \begin_inset Quotes erd
8909 \begin_inset Newline newline
8913 \begin_inset space ~
8917 \begin_inset CommandInset ref
8919 reference "sub:Paragraph-Styles"
8923 for details on paragraph styles.
8926 \begin_layout Description
8927 \begin_inset Flex CharStyle:Code
8930 \begin_layout Plain Layout
8937 \begin_inset Flex CharStyle:Code
8940 \begin_layout Plain Layout
8946 ] The name of the command or environment to be used with
8947 \begin_inset Flex CharStyle:Code
8950 \begin_layout Plain Layout
8959 \begin_layout Description
8960 \begin_inset Flex CharStyle:Code
8963 \begin_layout Plain Layout
8970 \begin_inset Flex CharStyle:Code
8973 \begin_layout Plain Layout
8982 \begin_inset Flex CharStyle:Code
8985 \begin_layout Plain Layout
8991 ] Indicates what kind of markup is used to define the title of a document.
8993 \begin_inset Flex CharStyle:Code
8996 \begin_layout Plain Layout
9002 means that the macro with name
9003 \begin_inset Flex CharStyle:Code
9006 \begin_layout Plain Layout
9012 will be inserted after the last layout which has
9013 \begin_inset Quotes eld
9017 \begin_inset Flex CharStyle:Code
9020 \begin_layout Plain Layout
9027 \begin_inset Quotes erd
9032 \begin_inset Flex CharStyle:Code
9035 \begin_layout Plain Layout
9041 corresponds to the case where the block of paragraphs which have
9042 \begin_inset Quotes eld
9046 \begin_inset Flex CharStyle:Code
9049 \begin_layout Plain Layout
9056 \begin_inset Quotes erd
9059 should be enclosed into the
9060 \begin_inset Flex CharStyle:Code
9063 \begin_layout Plain Layout
9072 \begin_layout Description
9073 \begin_inset Flex CharStyle:Code
9076 \begin_layout Plain Layout
9082 Sets which divisions are included in the table of contents.
9084 \begin_inset Flex CharStyle:Code
9087 \begin_layout Plain Layout
9096 \begin_layout Subsection
9097 \begin_inset Flex CharStyle:Code
9100 \begin_layout Plain Layout
9107 \begin_inset CommandInset label
9109 name "sub:ClassOptions"
9116 \begin_layout Standard
9118 \begin_inset Flex CharStyle:Code
9121 \begin_layout Plain Layout
9127 section can contain the following entries:
9130 \begin_layout Description
9131 \begin_inset Flex CharStyle:Code
9134 \begin_layout Plain Layout
9141 \begin_inset Flex CharStyle:Code
9144 \begin_layout Plain Layout
9150 ] The list of available font sizes for the document's main font, separated
9152 \begin_inset Quotes eld
9156 \begin_inset Flex CharStyle:Code
9159 \begin_layout Plain Layout
9166 \begin_inset Quotes erd
9172 \begin_layout Description
9173 \begin_inset Flex CharStyle:Code
9176 \begin_layout Plain Layout
9182 Used to set the DTD line with XML-based output classes.
9184 \begin_inset space \thinspace{}
9188 \begin_inset Quotes eld
9191 -//OASIS//DTD DocBook V4.2//EN
9192 \begin_inset Quotes erd
9198 \begin_layout Description
9199 \begin_inset Flex CharStyle:Code
9202 \begin_layout Plain Layout
9209 \begin_inset Flex CharStyle:Code
9212 \begin_layout Plain Layout
9213 string="empty|plain|headings|fancy"
9218 ] The list of available page styles, separated by
9219 \begin_inset Quotes eld
9223 \begin_inset Flex CharStyle:Code
9226 \begin_layout Plain Layout
9233 \begin_inset Quotes erd
9239 \begin_layout Description
9240 \begin_inset Flex CharStyle:Code
9243 \begin_layout Plain Layout
9250 \begin_inset Flex CharStyle:Code
9253 \begin_layout Plain Layout
9259 ] Some document class options, separated by a comma, that will be added
9260 to the optional part of the
9261 \begin_inset Flex CharStyle:Code
9264 \begin_layout Plain Layout
9275 \begin_layout Standard
9277 \begin_inset Flex CharStyle:Code
9280 \begin_layout Plain Layout
9286 section must end with
9287 \begin_inset Quotes eld
9291 \begin_inset Flex CharStyle:Code
9294 \begin_layout Plain Layout
9301 \begin_inset Quotes erd
9307 \begin_layout Subsection
9309 \begin_inset CommandInset label
9311 name "sub:Paragraph-Styles"
9318 \begin_layout Standard
9319 A paragraph style description looks like this:
9323 \begin_layout Plain Layout
9324 Note that this will either define a new layout or modify an existing one.
9332 \begin_layout LyX-Code
9339 \begin_layout LyX-Code
9343 \begin_layout LyX-Code
9347 \begin_layout Standard
9348 where the following commands are allowed:
9351 \begin_layout Description
9352 \begin_inset Flex CharStyle:Code
9355 \begin_layout Plain Layout
9362 \begin_inset Flex CharStyle:Code
9365 \begin_layout Plain Layout
9370 , left, right, center
9375 ] Paragraph alignment.
9378 \begin_layout Description
9379 \begin_inset Flex CharStyle:Code
9382 \begin_layout Plain Layout
9389 \begin_inset Flex CharStyle:Code
9392 \begin_layout Plain Layout
9397 , left, right, center
9402 ] A comma separated list of permitted alignments.
9403 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9405 For example a right-aligned or centered enumeration isn't possible.)
9408 \begin_layout Description
9409 \begin_inset Flex CharStyle:Code
9412 \begin_layout Plain Layout
9418 Note that this will completely override any prior
9419 \begin_inset Flex CharStyle:Code
9422 \begin_layout Plain Layout
9428 declaration for this style.
9430 \begin_inset Quotes eld
9434 \begin_inset Flex CharStyle:Code
9437 \begin_layout Plain Layout
9444 \begin_inset Quotes erd
9449 \begin_inset CommandInset ref
9451 reference "sub:I18n"
9455 for details on its use.
9458 \begin_layout Description
9459 \begin_inset Flex CharStyle:Code
9462 \begin_layout Plain Layout
9469 \begin_inset Flex CharStyle:Code
9472 \begin_layout Plain Layout
9482 \begin_layout Plain Layout
9483 Note that a `float' here is a real number, such as: 1.5.
9488 The vertical space with which the last of a chain of paragraphs with this
9489 layout is separated from the following paragraph.
9490 If the next paragraph has another layout, the separations are not simply
9491 added, but the maximum is taken.
9494 \begin_layout Description
9495 \begin_inset Flex CharStyle:Code
9498 \begin_layout Plain Layout
9505 \begin_inset Flex CharStyle:Code
9508 \begin_layout Plain Layout
9514 The category for this style.
9515 This is used to group related styles in the Layout combobox on the toolbar.
9516 Any string can be used, but you may want to use existing categories with
9521 \begin_layout Description
9522 \begin_inset Flex CharStyle:Code
9525 \begin_layout Plain Layout
9531 Depth of XML command.
9532 Used only with XML-type formats.
9535 \begin_layout Description
9536 \begin_inset Flex CharStyle:Code
9539 \begin_layout Plain Layout
9546 \begin_inset CommandInset label
9548 name "des:CopyStyle"
9553 \begin_inset Flex CharStyle:Code
9556 \begin_layout Plain Layout
9562 Copies all the features of an existing style into the current one.
9566 \begin_layout Description
9567 \begin_inset Flex CharStyle:Code
9570 \begin_layout Plain Layout
9576 The name of a style whose preamble should be output
9581 This allows to ensure some ordering of the preamble snippets when macros
9582 definitions depend on one another.
9586 \begin_layout Plain Layout
9587 Note that, besides that functionality, there is no way to ensure any ordering
9589 The ordering that you see in a given version of LyX may change without
9590 warning in later versions.
9598 \begin_layout Description
9599 \begin_inset Flex CharStyle:Code
9602 \begin_layout Plain Layout
9609 \begin_inset Flex CharStyle:Code
9612 \begin_layout Plain Layout
9617 , Box, Filled_Box, Static
9622 ] The type of label that stands at the end of the paragraph (or sequence
9624 \begin_inset Flex CharStyle:Code
9627 \begin_layout Plain Layout
9634 \begin_inset Flex CharStyle:Code
9637 \begin_layout Plain Layout
9644 \begin_inset Flex CharStyle:Code
9647 \begin_layout Plain Layout
9654 \begin_inset Flex CharStyle:Code
9657 \begin_layout Plain Layout
9665 \begin_inset Flex CharStyle:Code
9668 \begin_layout Plain Layout
9675 \begin_inset Quotes eld
9679 \begin_inset Quotes erd
9683 \begin_inset Flex CharStyle:Code
9686 \begin_layout Plain Layout
9693 \begin_inset Flex CharStyle:Code
9696 \begin_layout Plain Layout
9697 \begin_inset space ~
9706 \begin_inset space ~
9709 black) square suitable for end of proof markers,
9710 \begin_inset Flex CharStyle:Code
9713 \begin_layout Plain Layout
9719 is an explicit text string.
9722 \begin_layout Description
9723 \begin_inset Flex CharStyle:Code
9726 \begin_layout Plain Layout
9733 \begin_inset Flex CharStyle:Code
9736 \begin_layout Plain Layout
9742 ] The string used for a label with a
9743 \begin_inset Flex CharStyle:Code
9746 \begin_layout Plain Layout
9753 \begin_inset Flex CharStyle:Code
9756 \begin_layout Plain Layout
9766 \begin_layout Description
9767 \begin_inset Flex CharStyle:Code
9770 \begin_layout Plain Layout
9777 \begin_inset Flex CharStyle:Code
9780 \begin_layout Plain Layout
9791 \begin_inset Flex CharStyle:Code
9794 \begin_layout Plain Layout
9803 \begin_layout Description
9804 \begin_inset Flex CharStyle:Code
9807 \begin_layout Plain Layout
9814 \begin_inset Flex CharStyle:Code
9817 \begin_layout Plain Layout
9827 ] With this parameter the
9828 \begin_inset Flex CharStyle:MenuItem
9831 \begin_layout Plain Layout
9838 \begin_inset Quotes eld
9841 Vertical space above
9842 \begin_inset Quotes erd
9846 \begin_inset Flex CharStyle:MenuItem
9849 \begin_layout Plain Layout
9850 Edit\SpecialChar \menuseparator
9852 \begin_inset space ~
9860 dialog can be set when initializing a paragraph with this style.
9864 \begin_layout Plain Layout
9867 Note from Jean-Marc:
9869 I'm not sure that this setting has much use, and it should probably be
9870 removed in later versions.
9878 \begin_layout Description
9879 \begin_inset Flex CharStyle:Code
9882 \begin_layout Plain Layout
9888 The font used for both the text body
9894 \begin_inset space ~
9898 \begin_inset CommandInset ref
9900 reference "sub:Font-description"
9905 Note that defining this font automatically defines the
9906 \begin_inset Flex CharStyle:Code
9909 \begin_layout Plain Layout
9916 So you should define this one first if you also want to define
9917 \begin_inset Flex CharStyle:Code
9920 \begin_layout Plain Layout
9929 \begin_layout Description
9930 \begin_inset Flex CharStyle:Code
9933 \begin_layout Plain Layout
9940 \begin_inset CommandInset label
9942 name "des:FreeSpacing"
9947 \begin_inset Flex CharStyle:Code
9950 \begin_layout Plain Layout
9959 \begin_inset Flex CharStyle:Code
9962 \begin_layout Plain Layout
9968 ] Usually LyX doesn't allow you to insert more than one space between words,
9969 since a space is considered as the separation between two words, not a
9970 character or symbol of its own.
9971 This is a very fine thing but sometimes annoying, for example, when typing
9972 program code or plain LaTeX code.
9974 \begin_inset Flex CharStyle:Code
9977 \begin_layout Plain Layout
9984 Note that LyX will create protected blanks for the additional blanks when
9985 in another mode than LaTeX-mode.
9988 \begin_layout Description
9989 \begin_inset Flex CharStyle:Code
9992 \begin_layout Plain Layout
9998 These tags are used with XHTML output.
10000 \begin_inset CommandInset ref
10002 reference "sub:Paragraph-Style-XHTML"
10009 \begin_layout Description
10010 \begin_inset Flex CharStyle:Code
10013 \begin_layout Plain Layout
10019 [[FIXME]] (Used only with XML-type formats.)
10022 \begin_layout Description
10023 \begin_inset Flex CharStyle:Code
10026 \begin_layout Plain Layout
10033 \begin_inset Flex CharStyle:Code
10036 \begin_layout Plain Layout
10042 If 1, marks the layout as to be included in the document preamble rather
10043 than in the document body.
10044 This is useful for document classes that want such information as the title
10045 and author to appear in the preamble.
10046 Note that this works only for layouts for which the
10047 \begin_inset Flex CharStyle:Code
10050 \begin_layout Plain Layout
10057 \begin_inset Flex CharStyle:Code
10060 \begin_layout Plain Layout
10069 \begin_layout Description
10070 \begin_inset Flex CharStyle:Code
10073 \begin_layout Plain Layout
10080 \begin_inset Flex CharStyle:Code
10083 \begin_layout Plain Layout
10089 If 1, marks the layout as being part of a title block (see also the
10090 \begin_inset Flex CharStyle:Code
10093 \begin_layout Plain Layout
10100 \begin_inset Flex CharStyle:Code
10103 \begin_layout Plain Layout
10112 \begin_layout Description
10113 \begin_inset Flex CharStyle:Code
10116 \begin_layout Plain Layout
10123 \begin_inset Flex CharStyle:Code
10126 \begin_layout Plain Layout
10132 ] This provides extra space between paragraphs that have the same layout.
10133 If you put other layouts into an environment, each is separated with the
10135 \begin_inset Flex CharStyle:Code
10138 \begin_layout Plain Layout
10145 But the whole items of the environment are additionally separated with
10147 \begin_inset Flex CharStyle:Code
10150 \begin_layout Plain Layout
10157 Note that this is a
10162 \begin_layout Description
10163 \begin_inset Flex CharStyle:Code
10166 \begin_layout Plain Layout
10172 [[FIXME]] (Used only with XML-type formats.)
10175 \begin_layout Description
10176 \begin_inset Flex CharStyle:Code
10179 \begin_layout Plain Layout
10186 \begin_inset CommandInset label
10188 name "des:KeepEmpty"
10193 \begin_inset Flex CharStyle:Code
10196 \begin_layout Plain Layout
10205 \begin_inset Flex CharStyle:Code
10208 \begin_layout Plain Layout
10214 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10215 lead to empty LaTeX output.
10216 There are some cases where this could be desirable however: in a letter
10217 template, the required fields can be provided as empty fields, so that
10218 people do not forget them; in some special classes, a layout can be used
10219 as some kind of break, which does not contain actual text.
10222 \begin_layout Description
10223 \begin_inset Flex CharStyle:Code
10226 \begin_layout Plain Layout
10232 [float=0] The vertical space between the label and the text body.
10233 Only used for labels that are above the text body (
10234 \begin_inset Flex CharStyle:Code
10237 \begin_layout Plain Layout
10244 \begin_inset Flex CharStyle:Code
10247 \begin_layout Plain Layout
10248 Centered_Top_Environment
10256 \begin_layout Description
10257 \begin_inset Flex CharStyle:Code
10260 \begin_layout Plain Layout
10267 \begin_inset Flex CharStyle:Code
10270 \begin_layout Plain Layout
10277 \begin_inset Newline newline
10280 The name of the counter for automatic numbering.
10282 \begin_inset Newline newline
10290 \begin_inset Flex CharStyle:Code
10293 \begin_layout Plain Layout
10300 \begin_inset Flex CharStyle:Code
10303 \begin_layout Plain Layout
10310 In that case, the counter will be stepped each time the layout appears.
10312 \begin_inset Newline newline
10320 \begin_inset Flex CharStyle:Code
10323 \begin_layout Plain Layout
10330 \begin_inset Flex CharStyle:Code
10333 \begin_layout Plain Layout
10339 , though this case is a bit complicated.
10340 Suppose you declare
10341 \begin_inset Quotes eld
10345 \begin_inset Flex CharStyle:Code
10348 \begin_layout Plain Layout
10349 LabelCounter myenum
10355 \begin_inset Quotes erd
10359 Then the actual counters used are
10360 \begin_inset Flex CharStyle:Code
10363 \begin_layout Plain Layout
10370 \begin_inset Flex CharStyle:Code
10373 \begin_layout Plain Layout
10380 \begin_inset Flex CharStyle:Code
10383 \begin_layout Plain Layout
10390 \begin_inset Flex CharStyle:Code
10393 \begin_layout Plain Layout
10399 , much as in LaTeX.
10400 These counters must all be declared separately.
10401 \begin_inset Newline newline
10405 \begin_inset CommandInset ref
10407 reference "sub:Counters"
10411 for details on counters.
10414 \begin_layout Description
10415 \begin_inset Flex CharStyle:Code
10418 \begin_layout Plain Layout
10424 The font used for the label.
10426 \begin_inset space ~
10430 \begin_inset CommandInset ref
10432 reference "sub:Font-description"
10439 \begin_layout Description
10440 \begin_inset Flex CharStyle:Code
10443 \begin_layout Plain Layout
10449 Text that indicates how far a label should be indented.
10452 \begin_layout Description
10453 \begin_inset Flex CharStyle:Code
10456 \begin_layout Plain Layout
10463 \begin_inset Flex CharStyle:Code
10466 \begin_layout Plain Layout
10472 ] The horizontal space between the label and the text body.
10473 Only used for labels that are not above the text body.
10476 \begin_layout Description
10477 \begin_inset Flex CharStyle:Code
10480 \begin_layout Plain Layout
10487 \begin_inset Flex CharStyle:Code
10490 \begin_layout Plain Layout
10496 ] The string used for a label with a
10497 \begin_inset Flex CharStyle:Code
10500 \begin_layout Plain Layout
10508 \begin_inset Flex CharStyle:Code
10511 \begin_layout Plain Layout
10517 is set, this string can be contain the special formatting commands described
10519 \begin_inset CommandInset ref
10521 reference "sub:Counters"
10529 \begin_layout Plain Layout
10530 For the sake of backwards compatibility, the string
10531 \begin_inset Flex CharStyle:Code
10534 \begin_layout Plain Layout
10544 will be replaced by the expanded
10545 \begin_inset Flex CharStyle:Code
10548 \begin_layout Plain Layout
10555 \begin_inset Flex CharStyle:Code
10558 \begin_layout Plain Layout
10567 This feature is now obsolete and should be replaced by the mechanisms of
10569 \begin_inset CommandInset ref
10571 reference "sub:Counters"
10583 \begin_layout Description
10584 \begin_inset Flex CharStyle:Code
10587 \begin_layout Plain Layout
10588 LabelStringAppendix
10594 \begin_inset Flex CharStyle:Code
10597 \begin_layout Plain Layout
10603 ] This is used inside the appendix instead of
10604 \begin_inset Flex CharStyle:Code
10607 \begin_layout Plain Layout
10615 \begin_inset Flex CharStyle:Code
10618 \begin_layout Plain Layout
10625 \begin_inset Flex CharStyle:Code
10628 \begin_layout Plain Layout
10629 LabelStringAppendix
10637 \begin_layout Description
10638 \begin_inset Flex CharStyle:Code
10641 \begin_layout Plain Layout
10647 [FIXME] (Used only with XML-type formats.)
10650 \begin_layout Description
10651 \begin_inset Flex CharStyle:Code
10654 \begin_layout Plain Layout
10661 \begin_inset Flex CharStyle:Code
10664 \begin_layout Plain Layout
10669 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10670 Enumerate, Itemize, Bibliography
10679 \begin_layout Itemize
10680 \begin_inset Flex CharStyle:Code
10683 \begin_layout Plain Layout
10689 means the label is the very first word (up to the first real blank).
10690 Use protected spaces (like
10691 \begin_inset space ~
10694 that one) if you want more than one word as the label.
10698 \begin_layout Itemize
10699 \begin_inset Flex CharStyle:Code
10702 \begin_layout Plain Layout
10708 means the label is simply whatever
10709 \begin_inset Flex CharStyle:Code
10712 \begin_layout Plain Layout
10719 Note that this really is `static'.
10722 \begin_layout Itemize
10723 \begin_inset Flex CharStyle:Code
10726 \begin_layout Plain Layout
10733 \begin_inset Flex CharStyle:Code
10736 \begin_layout Plain Layout
10737 Centered_Top_Environment
10742 are special cases of
10743 \begin_inset Flex CharStyle:Code
10746 \begin_layout Plain Layout
10753 The label will be printed above the paragraph, but only at the top of an
10754 environment or the top of a chain of paragraphs with this layout.
10755 This might be used with the
10756 \begin_inset Flex CharStyle:MenuItem
10759 \begin_layout Plain Layout
10765 layout, for example.
10768 \begin_layout Itemize
10769 \begin_inset Flex CharStyle:Code
10772 \begin_layout Plain Layout
10778 is a special case for the caption-labels
10779 \begin_inset Quotes eld
10783 \begin_inset Quotes erd
10787 \begin_inset Quotes eld
10791 \begin_inset Quotes erd
10796 \begin_inset Flex CharStyle:Code
10799 \begin_layout Plain Layout
10805 means the (hardcoded) label string depends on the kind of float: It is
10806 hardcoded to be `FloatType N', where N is the value of the counter associated
10810 \begin_layout Itemize
10812 \begin_inset Flex CharStyle:Code
10815 \begin_layout Plain Layout
10821 label type defines automatically numbered labels.
10823 \begin_inset Flex CharStyle:Code
10826 \begin_layout Plain Layout
10832 will be expanded to resolve any counter references it contains: For example,
10834 \begin_inset Quotes eld
10838 \begin_inset Flex CharStyle:Code
10841 \begin_layout Plain Layout
10852 \begin_inset Quotes erd
10857 \begin_inset CommandInset ref
10859 reference "sub:Counters"
10863 for more information on counters.
10866 \begin_layout Itemize
10867 \begin_inset Flex CharStyle:Code
10870 \begin_layout Plain Layout
10876 produces the usual sort of enumeration labels.
10877 At present, it is hardcoded to use Arabic numerals, lowercase letters,
10878 small Roman numerals, and uppercase letters for the four possible depths.
10881 \begin_layout Itemize
10882 \begin_inset Flex CharStyle:Code
10885 \begin_layout Plain Layout
10891 produces various bullets at the different levels.
10892 It is also hardcoded.
10895 \begin_layout Itemize
10896 \begin_inset Flex CharStyle:Code
10899 \begin_layout Plain Layout
10905 is used internally by LyX and should be used only with
10906 \begin_inset Flex CharStyle:Code
10909 \begin_layout Plain Layout
10910 LatexType BibEnvironment
10919 \begin_layout Description
10920 \begin_inset Flex CharStyle:Code
10923 \begin_layout Plain Layout
10929 Note that this will completely override any prior
10930 \begin_inset Flex CharStyle:Code
10933 \begin_layout Plain Layout
10939 declaration for this style.
10941 \begin_inset Quotes eld
10945 \begin_inset Flex CharStyle:Code
10948 \begin_layout Plain Layout
10955 \begin_inset Quotes erd
10960 \begin_inset CommandInset ref
10962 reference "sub:I18n"
10966 for details on its use.
10969 \begin_layout Description
10970 \begin_inset Flex CharStyle:Code
10973 \begin_layout Plain Layout
10979 The name of the corresponding LaTeX stuff.
10980 Either the environment or command name.
10983 \begin_layout Description
10984 \begin_inset Flex CharStyle:Code
10987 \begin_layout Plain Layout
10993 An optional parameter for the corresponding
10994 \begin_inset Flex CharStyle:Code
10997 \begin_layout Plain Layout
11004 This parameter cannot be changed from within LyX.
11007 \begin_layout Description
11008 \begin_inset Flex CharStyle:Code
11011 \begin_layout Plain Layout
11018 \begin_inset CommandInset label
11020 name "des:LatexType"
11025 \begin_inset Flex CharStyle:Code
11028 \begin_layout Plain Layout
11033 , Command, Environment, Item_Environment,
11039 \begin_inset Flex CharStyle:Code
11042 \begin_layout Plain Layout
11043 List_Environment, Bib_Environment
11048 ] How the layout should be translated into LaTeX.
11052 \begin_layout Plain Layout
11053 \begin_inset Flex CharStyle:Code
11056 \begin_layout Plain Layout
11062 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11063 Visit the SGML class files for specific examples.
11072 \begin_layout Itemize
11073 \begin_inset Flex CharStyle:Code
11076 \begin_layout Plain Layout
11082 means nothing special.
11086 \begin_layout Itemize
11087 \begin_inset Flex CharStyle:Code
11090 \begin_layout Plain Layout
11097 \begin_inset Flex CharStyle:Code
11100 \begin_layout Plain Layout
11107 {\SpecialChar \ldots{}
11116 \begin_layout Itemize
11117 \begin_inset Flex CharStyle:Code
11120 \begin_layout Plain Layout
11127 \begin_inset Flex CharStyle:Code
11130 \begin_layout Plain Layout
11137 }\SpecialChar \ldots{}
11153 \begin_layout Itemize
11154 \begin_inset Flex CharStyle:Code
11157 \begin_layout Plain Layout
11164 \begin_inset Flex CharStyle:Code
11167 \begin_layout Plain Layout
11174 \begin_inset Flex CharStyle:Code
11177 \begin_layout Plain Layout
11185 is generated for each paragraph of this environment.
11189 \begin_layout Itemize
11190 \begin_inset Flex CharStyle:Code
11193 \begin_layout Plain Layout
11200 \begin_inset Flex CharStyle:Code
11203 \begin_layout Plain Layout
11210 \begin_inset Flex CharStyle:Code
11213 \begin_layout Plain Layout
11219 is passed as an argument to the environment.
11221 \begin_inset Flex CharStyle:Code
11224 \begin_layout Plain Layout
11230 can be defined in the
11231 \begin_inset Flex CharStyle:MenuItem
11234 \begin_layout Plain Layout
11239 ayout\SpecialChar \menuseparator
11253 \begin_layout Standard
11254 Putting the last few things together, the LaTeX output will be either:
11257 \begin_layout LyX-Code
11260 latexname[latexparam]{\SpecialChar \ldots{}
11264 \begin_layout Standard
11268 \begin_layout LyX-Code
11271 begin{latexname}[latexparam] \SpecialChar \ldots{}
11277 \begin_layout Standard
11278 depending upon the LaTeX type.
11282 \begin_layout Description
11283 \begin_inset Flex CharStyle:Code
11286 \begin_layout Plain Layout
11293 \begin_inset Flex CharStyle:Code
11296 \begin_layout Plain Layout
11302 ] If you put layouts into environments, the leftmargins are not simply added,
11303 but added with a factor
11304 \begin_inset Formula $\frac{4}{depth+4}$
11308 Note that this parameter is also used when the margin is defined as
11309 \begin_inset Flex CharStyle:Code
11312 \begin_layout Plain Layout
11319 \begin_inset Flex CharStyle:Code
11322 \begin_layout Plain Layout
11329 Then it is added to the manual or dynamic margin.
11331 \begin_inset Newline newline
11334 The argument is passed as a string.
11336 \begin_inset Quotes eld
11340 \begin_inset Flex CharStyle:Code
11343 \begin_layout Plain Layout
11350 \begin_inset Quotes erd
11353 means that the paragraph is indented with the width of
11354 \begin_inset Quotes eld
11358 \begin_inset Flex CharStyle:Code
11361 \begin_layout Plain Layout
11368 \begin_inset Quotes erd
11371 in the normal font.
11372 You can get a negative width by prefixing the string with
11373 \begin_inset Quotes eld
11377 \begin_inset Flex CharStyle:Code
11380 \begin_layout Plain Layout
11387 \begin_inset Quotes erd
11391 This way was chosen so that the look is the same with each used screen
11396 \begin_layout Description
11397 \begin_inset Flex CharStyle:Code
11400 \begin_layout Plain Layout
11407 \begin_inset Flex CharStyle:Code
11410 \begin_layout Plain Layout
11415 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11421 \begin_inset Newline newline
11424 The kind of margin that the layout has on the left side.
11426 \begin_inset Flex CharStyle:Code
11429 \begin_layout Plain Layout
11435 just means a fixed margin.
11437 \begin_inset Flex CharStyle:Code
11440 \begin_layout Plain Layout
11446 means that the left margin depends on the string entered in the
11447 \begin_inset Flex CharStyle:MenuItem
11450 \begin_layout Plain Layout
11451 Edit\SpecialChar \menuseparator
11453 \begin_inset space ~
11462 This is used to typeset nice lists without tabulators.
11464 \begin_inset Flex CharStyle:Code
11467 \begin_layout Plain Layout
11473 means that the margin depends on the size of the label.
11474 This is used for automatic enumerated headlines.
11475 It is obvious that the headline
11476 \begin_inset Quotes eld
11479 5.4.3.2.1 Very long headline
11480 \begin_inset Quotes erd
11483 must have a wider left margin (as wide as
11484 \begin_inset Quotes eld
11488 \begin_inset Quotes erd
11491 plus the space) than
11492 \begin_inset Quotes eld
11495 3.2 Very long headline
11496 \begin_inset Quotes erd
11500 \begin_inset Quotes eld
11504 \begin_inset Quotes erd
11507 are not able to do this.
11509 \begin_inset Flex CharStyle:Code
11512 \begin_layout Plain Layout
11518 is similar, but only the very first row of the paragraph is dynamic, while
11519 the others are static; this is used, for example, for descriptions.
11521 \begin_inset Flex CharStyle:Code
11524 \begin_layout Plain Layout
11530 means the margin is chosen in a way that the longest row of this paragraph
11531 fits to the right margin.
11532 This is used to typeset an address on the right edge of the page.
11535 \begin_layout Description
11536 \begin_inset Flex CharStyle:Code
11539 \begin_layout Plain Layout
11546 \begin_inset Flex CharStyle:Code
11549 \begin_layout Plain Layout
11558 \begin_inset Flex CharStyle:Code
11561 \begin_layout Plain Layout
11567 ] Whether fragile commands in this layout should be
11568 \begin_inset Flex CharStyle:Code
11571 \begin_layout Plain Layout
11584 whether this command should itself be protected.)
11587 \begin_layout Description
11588 \begin_inset Flex CharStyle:Code
11591 \begin_layout Plain Layout
11598 \begin_inset Flex CharStyle:Code
11601 \begin_layout Plain Layout
11608 \begin_inset Flex CharStyle:Code
11611 \begin_layout Plain Layout
11619 ] Whether newlines are translated into LaTeX newlines (
11620 \begin_inset Flex CharStyle:Code
11623 \begin_layout Plain Layout
11634 The translation can be switched off to allow more comfortable LaTeX editing
11638 \begin_layout Description
11639 \begin_inset Flex CharStyle:Code
11642 \begin_layout Plain Layout
11649 \begin_inset Flex CharStyle:Code
11652 \begin_layout Plain Layout
11659 \begin_inset Flex CharStyle:Code
11662 \begin_layout Plain Layout
11670 ] Whether the following Paragraph is allowed to indent its very first row.
11672 \begin_inset Flex CharStyle:Code
11675 \begin_layout Plain Layout
11681 means that it is not allowed to do so;
11682 \begin_inset Flex CharStyle:Code
11685 \begin_layout Plain Layout
11691 means it could do so if it wants to.
11694 \begin_layout Description
11695 \begin_inset Flex CharStyle:Code
11698 \begin_layout Plain Layout
11704 Name of a layout that has replaced this layout.
11705 This is used to rename a layout, while keeping backward compatibility.
11708 \begin_layout Description
11709 \begin_inset Flex CharStyle:Code
11712 \begin_layout Plain Layout
11719 \begin_inset Flex CharStyle:Code
11722 \begin_layout Plain Layout
11728 ] The number of optional arguments that can be used with this layout.
11729 This is useful for things like section headings, and only makes sense with
11731 Note that, on output, the optional arguments will all precede any required
11732 arguments (see below).
11733 So one can have constructs like:
11737 \begin_layout LyX-Code
11740 mycmd[opt1]{req1}{contents of paragraph}
11743 \begin_layout Standard
11744 but one cannot have things like:
11747 \begin_layout LyX-Code
11750 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11753 \begin_layout Standard
11754 at least, not without ERT (with which you can have anything).
11759 \begin_layout Description
11760 \begin_inset Flex CharStyle:Code
11763 \begin_layout Plain Layout
11770 \begin_inset CommandInset label
11772 name "des:ParbreakIsNewline"
11777 \begin_inset Flex CharStyle:Code
11780 \begin_layout Plain Layout
11789 \begin_inset Flex CharStyle:Code
11792 \begin_layout Plain Layout
11798 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
11799 output, but only by a line break; together with
11800 \begin_inset Flex CharStyle:Code
11803 \begin_layout Plain Layout
11809 , this allows to emulate a plain text editor (like the ERT inset).
11812 \begin_layout Description
11813 \begin_inset Flex CharStyle:Code
11816 \begin_layout Plain Layout
11823 \begin_inset Flex CharStyle:Code
11826 \begin_layout Plain Layout
11832 ] The indent of the very first line of a paragraph.
11834 \begin_inset Flex CharStyle:Code
11837 \begin_layout Plain Layout
11843 will be fixed for a certain layout.
11844 The exception is Standard layout, since the indentation of a Standard layout
11845 paragraph can be prohibited with
11846 \begin_inset Flex CharStyle:Code
11849 \begin_layout Plain Layout
11856 Also, Standard layout paragraphs inside environments use the
11857 \begin_inset Flex CharStyle:Code
11860 \begin_layout Plain Layout
11866 of the environment, not their native one.
11867 For example, Standard paragraphs inside an enumeration are not indented.
11870 \begin_layout Description
11871 \begin_inset Flex CharStyle:Code
11874 \begin_layout Plain Layout
11881 \begin_inset Flex CharStyle:Code
11884 \begin_layout Plain Layout
11890 ] The vertical space between two paragraphs of this layout.
11893 \begin_layout Description
11894 \begin_inset Flex CharStyle:Code
11897 \begin_layout Plain Layout
11904 \begin_inset Flex CharStyle:Code
11907 \begin_layout Plain Layout
11913 ] LyX allows the user to choose either
11914 \begin_inset Quotes eld
11918 \begin_inset Quotes erd
11922 \begin_inset Quotes eld
11926 \begin_inset Quotes erd
11929 to typeset a document.
11931 \begin_inset Quotes eld
11935 \begin_inset Quotes erd
11938 is chosen, this value is completely ignored.
11940 \begin_inset Quotes eld
11944 \begin_inset Quotes erd
11947 is chosen, the parindent of a LaTeXtype
11948 \begin_inset Quotes eld
11952 \begin_inset Quotes erd
11955 layout is ignored and all paragraphs are separated by this parskip argument.
11956 The vertical space is calculated with
11957 \begin_inset Flex CharStyle:Code
11960 \begin_layout Plain Layout
11962 \begin_inset space ~
11971 \begin_inset Flex CharStyle:Code
11974 \begin_layout Plain Layout
11980 is the height of a row with the normal font.
11981 This way, the look stays the same with different screen fonts.
11984 \begin_layout Description
11985 \begin_inset Flex CharStyle:Code
11988 \begin_layout Plain Layout
11995 \begin_inset CommandInset label
11997 name "des:PassThru"
12002 \begin_inset Flex CharStyle:Code
12005 \begin_layout Plain Layout
12014 \begin_inset Flex CharStyle:Code
12017 \begin_layout Plain Layout
12023 ] Whether the contents of this paragraph should be output in raw form, meaning
12024 without special translations that LaTeX would require.
12027 \begin_layout Description
12028 \begin_inset Flex CharStyle:Code
12031 \begin_layout Plain Layout
12038 \begin_inset CommandInset label
12040 name "des:Preamble"
12044 Information to be included in the LaTeX preamble when this style is used.
12045 Used to define macros, load packages, etc., required by this particular
12048 \begin_inset Quotes eld
12052 \begin_inset Flex CharStyle:Code
12055 \begin_layout Plain Layout
12062 \begin_inset Quotes erd
12068 \begin_layout Description
12069 \begin_inset Flex CharStyle:Code
12072 \begin_layout Plain Layout
12079 \begin_inset Flex CharStyle:Code
12082 \begin_layout Plain Layout
12088 ] The prefix to use when creating labels referring to paragraphs of this
12090 This allows the use of formatted references.
12093 \begin_layout Description
12094 \begin_inset Flex CharStyle:Code
12097 \begin_layout Plain Layout
12104 \begin_inset Flex CharStyle:Code
12107 \begin_layout Plain Layout
12113 ] The number of required arguments that the LaTeX command or environment
12114 corresponding to this layout expects.
12115 In the case of a command, these are required arguments
12119 that associated with the content of the paragraph itself.
12120 These do not actually have to be provided: LyX will output empty arguments
12122 Note that optional arguments will be output before required arguments.
12123 See the discussion of the
12124 \begin_inset Flex CharStyle:Code
12127 \begin_layout Plain Layout
12133 tag above for more information.
12136 \begin_layout Description
12137 \begin_inset Flex CharStyle:Code
12140 \begin_layout Plain Layout
12147 \begin_inset Flex CharStyle:Code
12150 \begin_layout Plain Layout
12157 \begin_inset CommandInset label
12159 name "des:Requires"
12163 Whether the layout requires the feature
12164 \begin_inset Flex CharStyle:Code
12167 \begin_layout Plain Layout
12174 See the description of
12175 \begin_inset Flex CharStyle:Code
12178 \begin_layout Plain Layout
12185 \begin_inset CommandInset ref
12186 LatexCommand pageref
12187 reference "des:FreeSpacing"
12191 ) for information on `features'.
12195 \begin_layout Description
12196 \begin_inset Flex CharStyle:Code
12199 \begin_layout Plain Layout
12206 \begin_inset Flex CharStyle:Code
12209 \begin_layout Plain Layout
12216 \begin_inset Flex CharStyle:Code
12219 \begin_layout Plain Layout
12228 \begin_layout Description
12229 \begin_inset Flex CharStyle:Code
12232 \begin_layout Plain Layout
12239 \begin_inset Flex CharStyle:Code
12242 \begin_layout Plain Layout
12247 , onehalf, double, other
12256 ] This defines what the default spacing should be in the layout.
12258 \begin_inset Flex CharStyle:Code
12261 \begin_layout Plain Layout
12268 \begin_inset Flex CharStyle:Code
12271 \begin_layout Plain Layout
12278 \begin_inset Flex CharStyle:Code
12281 \begin_layout Plain Layout
12287 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12288 If you specify the argument
12289 \begin_inset Flex CharStyle:Code
12292 \begin_layout Plain Layout
12298 , then you should also provide a numerical argument which will be the actual
12300 Note that, contrary to other parameters,
12301 \begin_inset Flex CharStyle:Code
12304 \begin_layout Plain Layout
12310 implies the generation of specific LaTeX code, using the package
12313 \begin_inset Flex CharStyle:Code
12316 \begin_layout Plain Layout
12325 \begin_layout Description
12326 \begin_inset Flex CharStyle:Code
12329 \begin_layout Plain Layout
12336 \begin_inset Flex CharStyle:Code
12339 \begin_layout Plain Layout
12346 \begin_inset Flex CharStyle:Code
12349 \begin_layout Plain Layout
12357 ] Spellcheck paragraphs of this style.
12361 \begin_layout Description
12362 \begin_inset Flex CharStyle:Code
12365 \begin_layout Plain Layout
12371 The font used for the text body .
12373 \begin_inset CommandInset ref
12375 reference "sub:Font-description"
12382 \begin_layout Description
12383 \begin_inset Flex CharStyle:Code
12386 \begin_layout Plain Layout
12395 \begin_inset Flex CharStyle:Code
12398 \begin_layout Plain Layout
12408 The level of the style in the table of contents.
12409 This is used for automatic numbering of section headings.
12412 \begin_layout Description
12413 \begin_inset Flex CharStyle:Code
12416 \begin_layout Plain Layout
12423 \begin_inset Flex CharStyle:Code
12426 \begin_layout Plain Layout
12432 ] The vertical space with which the very first of a chain of paragraphs
12433 with this layout is separated from the previous paragraph.
12434 If the previous paragraph has another layout, the separations are not simply
12435 added, but the maximum is taken.
12438 \begin_layout Subsection
12439 \begin_inset CommandInset label
12445 Internationalization of Paragraph Styles
12448 \begin_layout Standard
12449 LyX has long supported internationalization of layout information, but,
12450 until version 2.0, this applied only to the user interface and not to, say,
12452 Thus, French authors were forced to resort to ugly hacks if they wanted
12457 1' instead of `Theorem 1'.
12458 Thanks to Georg Baum, that is no longer the case.
12461 \begin_layout Standard
12463 \begin_inset Flex CharStyle:Code
12466 \begin_layout Plain Layout
12472 defines text that is to appear in the typeset document, it may use
12473 \begin_inset Flex CharStyle:Code
12476 \begin_layout Plain Layout
12483 \begin_inset Flex CharStyle:Code
12486 \begin_layout Plain Layout
12492 to support non-English and even multi-language documents correctly.
12493 The following excerpt (from the
12494 \begin_inset Flex CharStyle:Code
12497 \begin_layout Plain Layout
12503 file) shows how this works:
12506 \begin_layout LyX-Code
12511 \begin_layout LyX-Code
12514 theoremstyle{remark}
12517 \begin_layout LyX-Code
12520 newtheorem{claim}[thm]{
12527 \begin_layout LyX-Code
12531 \begin_layout LyX-Code
12535 \begin_layout LyX-Code
12540 claimname}{_(Claim)}
12543 \begin_layout LyX-Code
12547 \begin_layout LyX-Code
12551 \begin_layout LyX-Code
12560 claimname}{_(Claim)}}
12563 \begin_layout LyX-Code
12568 \begin_layout Standard
12569 In principle, any legal LaTeX may appear in the
12570 \begin_inset Flex CharStyle:Code
12573 \begin_layout Plain Layout
12580 \begin_inset Flex CharStyle:Code
12583 \begin_layout Plain Layout
12589 tags, but in practice they will typically look as they do here.
12590 The key to correct translation of the typeset text is the definition of
12592 \begin_inset Flex CharStyle:Code
12595 \begin_layout Plain Layout
12604 \begin_inset Flex CharStyle:Code
12607 \begin_layout Plain Layout
12619 \begin_layout Standard
12621 \begin_inset Flex CharStyle:Code
12624 \begin_layout Plain Layout
12630 tag provides for internationalization based upon the overall language of
12632 The contents of the tag will be included in the preamble, just as with
12634 \begin_inset Flex CharStyle:Code
12637 \begin_layout Plain Layout
12644 What makes it special is the use of the
12645 \begin_inset Quotes eld
12649 \begin_inset Quotes erd
12653 \begin_inset Flex CharStyle:Code
12656 \begin_layout Plain Layout
12662 , which will be replaced, when LyX produces LaTeX output, with the translation
12663 of its argument into the document language.
12666 \begin_layout Standard
12668 \begin_inset Flex CharStyle:Code
12671 \begin_layout Plain Layout
12677 tag is more complex, since it is meant to provide support for multi-language
12678 documents and so offers an interface to the
12679 \begin_inset Flex CharStyle:Code
12682 \begin_layout Plain Layout
12689 Its contents will be added to the preamble once for each language that
12690 appears in the document.
12691 In this case, the argument to
12692 \begin_inset Flex CharStyle:Code
12695 \begin_layout Plain Layout
12701 will be replaced with its translation into the language in question; the
12703 \begin_inset Flex CharStyle:Code
12706 \begin_layout Plain Layout
12712 is replaced by the language name (as used by the babel package).
12715 \begin_layout Standard
12716 A German document that also included a French section would thus have the
12717 following in the preamble:
12720 \begin_layout LyX-Code
12729 claimname}{Affirmation}}
12737 claimname}{Behauptung}}
12741 claimname}{Behauptung}
12744 \begin_layout Standard
12746 \begin_inset Flex CharStyle:Code
12749 \begin_layout Plain Layout
12755 will then conspire to produce the correct text in the output.
12758 \begin_layout Standard
12759 One important point to note here is that the translations are provided by
12760 LyX itself, through the same mechanism it uses for internationalization
12761 of the user interface.
12762 This means, in effect, that
12763 \begin_inset Flex CharStyle:Code
12766 \begin_layout Plain Layout
12773 \begin_inset Flex CharStyle:Code
12776 \begin_layout Plain Layout
12782 are really only of use in layout files that are provided with LyX, since
12783 text entered in user-created layout files will not be seen by LyX's internation
12784 alization routines.
12785 That said, however, any layout created with the intention that it will
12786 be included with LyX should use these tags where appropriate.
12789 \begin_layout Subsection
12791 \begin_inset CommandInset label
12800 \begin_layout Standard
12801 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12802 define the floats (
12803 \begin_inset Flex CharStyle:MenuItem
12806 \begin_layout Plain Layout
12813 \begin_inset Flex CharStyle:MenuItem
12816 \begin_layout Plain Layout
12822 , \SpecialChar \ldots{}
12823 ) in the text class itself.
12824 Standard floats are included in the file
12825 \begin_inset Flex CharStyle:Code
12828 \begin_layout Plain Layout
12834 , so you may have to do no more than add
12837 \begin_layout LyX-Code
12838 Input stdfloats.inc
12841 \begin_layout Standard
12842 to your layout file.
12843 If you want to implement a text class that proposes some other float types
12844 (like the AGU class bundled with LyX), the information below will hopefully
12848 \begin_layout Description
12849 \begin_inset Flex CharStyle:Code
12852 \begin_layout Plain Layout
12859 \begin_inset Flex CharStyle:Code
12862 \begin_layout Plain Layout
12869 \begin_inset Quotes erd
12873 \begin_inset Quotes erd
12876 ] The file name extension of an auxiliary file for the list of figures (or
12878 LaTeX writes the captions to this file.
12881 \begin_layout Description
12882 \begin_inset Flex CharStyle:Code
12885 \begin_layout Plain Layout
12892 \begin_inset Flex CharStyle:Code
12895 \begin_layout Plain Layout
12902 \begin_inset Quotes erd
12906 \begin_inset Quotes erd
12909 ] The string that will be used in the menus and also for the caption.
12910 This is translated to the current language if babel is used.
12913 \begin_layout Description
12914 \begin_inset Flex CharStyle:Code
12917 \begin_layout Plain Layout
12923 These are used for XHTML output.
12925 \begin_inset CommandInset ref
12927 reference "sec:Tags-for-XHTML"
12934 \begin_layout Description
12935 \begin_inset Flex CharStyle:Code
12938 \begin_layout Plain Layout
12945 \begin_inset Flex CharStyle:Code
12948 \begin_layout Plain Layout
12955 \begin_inset Quotes erd
12959 \begin_inset Quotes erd
12962 ] The command used to generate a list of floats of this type; the leading
12965 ' should be omitted.
12971 \begin_inset Flex CharStyle:Code
12974 \begin_layout Plain Layout
12980 is false, since there is no standard way to generate this command.
12982 \begin_inset Flex CharStyle:Code
12985 \begin_layout Plain Layout
12991 is true, since in that case there is a standard way.
12994 \begin_layout Description
12995 \begin_inset Flex CharStyle:Code
12998 \begin_layout Plain Layout
13005 \begin_inset Flex CharStyle:Code
13008 \begin_layout Plain Layout
13015 \begin_inset Quotes erd
13019 \begin_inset Quotes erd
13022 ] A title for a list of floats of this kind (list of figures, tables, or
13024 It is used for the screen label within LyX; it is passed to LaTeX for use
13025 as the title there; and it is used as the title in XHTML output.
13026 It will be translated to the document language.
13029 \begin_layout Description
13030 \begin_inset Flex CharStyle:Code
13033 \begin_layout Plain Layout
13040 \begin_inset Flex CharStyle:Code
13043 \begin_layout Plain Layout
13050 \begin_inset Flex CharStyle:Code
13053 \begin_layout Plain Layout
13061 ] Indicates whether the float is already defined in the document class or
13062 if we instead need to load
13063 \begin_inset Flex CharStyle:Code
13066 \begin_layout Plain Layout
13072 and use what it provides.
13074 \begin_inset Flex CharStyle:Code
13077 \begin_layout Plain Layout
13084 \begin_inset Flex CharStyle:Code
13087 \begin_layout Plain Layout
13094 It should be set to
13095 \begin_inset Flex CharStyle:Code
13098 \begin_layout Plain Layout
13104 if the float is already defined by the LaTeX document class.
13107 \begin_layout Description
13108 \begin_inset Flex CharStyle:Code
13111 \begin_layout Plain Layout
13118 \begin_inset Flex CharStyle:Code
13121 \begin_layout Plain Layout
13128 \begin_inset Quotes erd
13132 \begin_inset Quotes erd
13135 ] This (optional) argument determines whether floats of this class will
13136 be numbered within some sectional unit of the document.
13137 For example, if within is equal to
13138 \begin_inset Flex CharStyle:Code
13141 \begin_layout Plain Layout
13147 , the floats will be numbered within chapters.
13151 \begin_layout Description
13152 \begin_inset Flex CharStyle:Code
13155 \begin_layout Plain Layout
13162 \begin_inset Flex CharStyle:Code
13165 \begin_layout Plain Layout
13172 \begin_inset Quotes erd
13176 \begin_inset Quotes erd
13179 ] The default placement for the given class of floats.
13180 The string should be as in standard LaTeX:
13181 \begin_inset Flex CharStyle:Code
13184 \begin_layout Plain Layout
13191 \begin_inset Flex CharStyle:Code
13194 \begin_layout Plain Layout
13201 \begin_inset Flex CharStyle:Code
13204 \begin_layout Plain Layout
13211 \begin_inset Flex CharStyle:Code
13214 \begin_layout Plain Layout
13220 for top, bottom, page, and here, respectively.
13224 \begin_layout Plain Layout
13225 Note that the order of these letters in the string is irrelevant, like in
13231 On top of that there is a new type,
13232 \begin_inset Flex CharStyle:Code
13235 \begin_layout Plain Layout
13241 , which does not really correspond to a float, since it means: put it
13242 \begin_inset Quotes eld
13246 \begin_inset Quotes erd
13250 Note however that the
13251 \begin_inset Flex CharStyle:Code
13254 \begin_layout Plain Layout
13260 specifier is special and, because of implementation details, cannot be
13261 used in non-built in float types.
13262 If you do not understand what this means, just use
13263 \begin_inset Quotes eld
13267 \begin_inset Flex CharStyle:Code
13270 \begin_layout Plain Layout
13277 \begin_inset Quotes erd
13283 \begin_layout Description
13284 \begin_inset Flex CharStyle:Code
13287 \begin_layout Plain Layout
13294 \begin_inset Flex CharStyle:Code
13297 \begin_layout Plain Layout
13303 ] The prefix to use when creating labels referring to floats of this type.
13304 This allows the use of formatted references.
13305 Note that you can remove any
13306 \begin_inset Flex CharStyle:Code
13309 \begin_layout Plain Layout
13315 set by a copied style by using the special value
13316 \begin_inset Quotes eld
13320 \begin_inset Quotes erd
13323 , which must be all caps.
13326 \begin_layout Description
13327 \begin_inset Flex CharStyle:Code
13330 \begin_layout Plain Layout
13337 \begin_inset Flex CharStyle:Code
13340 \begin_layout Plain Layout
13347 \begin_inset Quotes erd
13351 \begin_inset Quotes erd
13354 ] The style used when defining the float using
13355 \begin_inset Flex CharStyle:Code
13358 \begin_layout Plain Layout
13369 \begin_layout Description
13370 \begin_inset Flex CharStyle:Code
13373 \begin_layout Plain Layout
13380 \begin_inset Flex CharStyle:Code
13383 \begin_layout Plain Layout
13390 \begin_inset Quotes erd
13394 \begin_inset Quotes erd
13398 \begin_inset Quotes eld
13402 \begin_inset Quotes erd
13405 of the new class of floats, like program or algorithm.
13406 After the appropriate
13407 \begin_inset Flex CharStyle:Code
13410 \begin_layout Plain Layout
13419 \begin_inset Flex CharStyle:Code
13422 \begin_layout Plain Layout
13431 \begin_inset Flex CharStyle:Code
13434 \begin_layout Plain Layout
13445 \begin_layout Standard
13446 Note that defining a float with type
13447 \begin_inset Flex CharStyle:Code
13450 \begin_layout Plain Layout
13458 automatically defines the corresponding counter with name
13459 \begin_inset Flex CharStyle:Code
13462 \begin_layout Plain Layout
13473 \begin_layout Subsection
13474 Flex insets and InsetLayout
13475 \begin_inset CommandInset label
13477 name "sub:Flex-insets-and"
13484 \begin_layout Standard
13485 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13486 these are called Flex insets.
13490 \begin_layout Standard
13491 Flex insets come in three different kinds:
13494 \begin_layout Itemize
13496 \begin_inset Flex CharStyle:Code
13499 \begin_layout Plain Layout
13505 ): These define semantic markup corresponding to such LaTeX commands as
13507 \begin_inset Flex CharStyle:Code
13510 \begin_layout Plain Layout
13519 \begin_inset Flex CharStyle:Code
13522 \begin_layout Plain Layout
13533 \begin_layout Itemize
13535 \begin_inset Flex CharStyle:Code
13538 \begin_layout Plain Layout
13544 ): These can be used to define custom collapsible insets, similar to TeX
13545 code, footnote, and the like.
13546 An obvious example is an endnote inset, which is defined in the
13547 \begin_inset Flex CharStyle:Code
13550 \begin_layout Plain Layout
13559 \begin_layout Itemize
13561 \begin_inset Flex CharStyle:Code
13564 \begin_layout Plain Layout
13570 ): For use with DocBook classes.
13573 \begin_layout Standard
13574 Flex insets are defined using the
13575 \begin_inset Flex CharStyle:Code
13578 \begin_layout Plain Layout
13584 tag, which shall be explained in a moment.
13587 \begin_layout Standard
13589 \begin_inset Flex CharStyle:Code
13592 \begin_layout Plain Layout
13598 tag also serves another function: It can be used to customize the general
13599 layout of many different types of insets.
13601 \begin_inset Flex CharStyle:Code
13604 \begin_layout Plain Layout
13610 can be used to customize the layout parameters for footnotes, marginal
13611 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13612 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13613 define Flex insets.
13616 \begin_layout Standard
13618 \begin_inset Flex CharStyle:Code
13621 \begin_layout Plain Layout
13627 definition must begin with a line of the form:
13630 \begin_layout LyX-Code
13634 \begin_layout Standard
13636 \begin_inset Flex CharStyle:Code
13639 \begin_layout Plain Layout
13645 indicates the inset whose layout is being defined, and here there are two
13649 \begin_layout Enumerate
13650 The layout for a pre-existing inset is being modified.
13651 In this case, can be
13652 \begin_inset Flex CharStyle:Code
13655 \begin_layout Plain Layout
13661 any one of the following:
13662 \begin_inset Flex CharStyle:Code
13665 \begin_layout Plain Layout
13672 \begin_inset Flex CharStyle:Code
13675 \begin_layout Plain Layout
13682 \begin_inset Flex CharStyle:Code
13685 \begin_layout Plain Layout
13692 \begin_inset Flex CharStyle:Code
13695 \begin_layout Plain Layout
13702 \begin_inset Flex CharStyle:Code
13705 \begin_layout Plain Layout
13712 \begin_inset Flex CharStyle:Code
13715 \begin_layout Plain Layout
13722 \begin_inset Flex CharStyle:Code
13725 \begin_layout Plain Layout
13732 \begin_inset Flex CharStyle:Code
13735 \begin_layout Plain Layout
13742 \begin_inset Flex CharStyle:Code
13745 \begin_layout Plain Layout
13752 \begin_inset Flex CharStyle:Code
13755 \begin_layout Plain Layout
13762 \begin_inset Flex CharStyle:Code
13765 \begin_layout Plain Layout
13772 \begin_inset Flex CharStyle:Code
13775 \begin_layout Plain Layout
13782 \begin_inset Flex CharStyle:Code
13785 \begin_layout Plain Layout
13792 \begin_inset Flex CharStyle:Code
13795 \begin_layout Plain Layout
13802 \begin_inset Flex CharStyle:Code
13805 \begin_layout Plain Layout
13812 \begin_inset Flex CharStyle:Code
13815 \begin_layout Plain Layout
13822 \begin_inset Flex CharStyle:Code
13825 \begin_layout Plain Layout
13832 \begin_inset Flex CharStyle:Code
13835 \begin_layout Plain Layout
13842 \begin_inset Flex CharStyle:Code
13845 \begin_layout Plain Layout
13852 \begin_inset Flex CharStyle:Code
13855 \begin_layout Plain Layout
13864 \begin_layout Enumerate
13865 The layout for a Flex inset is being defined.
13867 \begin_inset Flex CharStyle:Code
13870 \begin_layout Plain Layout
13876 can be any valid identifier not used by a pre-existing inset.
13877 Note that the definition of a flex inset
13882 \begin_inset Flex CharStyle:Code
13885 \begin_layout Plain Layout
13891 entry, declaring which type of inset this is.
13894 \begin_layout Standard
13896 \begin_inset Flex CharStyle:Code
13899 \begin_layout Plain Layout
13905 definition can contain the following entries:
13908 \begin_layout Description
13909 \begin_inset Flex CharStyle:Code
13912 \begin_layout Plain Layout
13918 The color for the inset's background.
13919 The valid colors are defined in
13920 \begin_inset Flex CharStyle:Code
13923 \begin_layout Plain Layout
13932 \begin_layout Description
13933 \begin_inset Flex CharStyle:Code
13936 \begin_layout Plain Layout
13943 \begin_inset Flex CharStyle:Code
13946 \begin_layout Plain Layout
13955 \begin_inset Flex CharStyle:Code
13958 \begin_layout Plain Layout
13964 ] Whether to use the content of the inset as the label, when the inset is
13969 \begin_layout Description
13970 \begin_inset Flex CharStyle:Code
13973 \begin_layout Plain Layout
13979 As with paragraph styles (see page
13980 \begin_inset CommandInset ref
13982 reference "des:CopyStyle"
13989 \begin_layout Description
13990 \begin_inset Flex CharStyle:Code
13993 \begin_layout Plain Layout
14000 \begin_inset Flex CharStyle:Code
14003 \begin_layout Plain Layout
14012 \begin_inset Flex CharStyle:Code
14015 \begin_layout Plain Layout
14021 ] Indicates whether the user may employ the Paragraph Settings dialog to
14022 customize the paragraph.
14025 \begin_layout Description
14026 \begin_inset Flex CharStyle:Code
14029 \begin_layout Plain Layout
14036 \begin_inset Flex CharStyle:Code
14039 \begin_layout Plain Layout
14046 \begin_inset Flex CharStyle:Code
14049 \begin_layout Plain Layout
14056 \begin_inset Flex CharStyle:Code
14059 \begin_layout Plain Layout
14065 , describing the rendering style used for the inset's frame and buttons.
14066 Footnotes generally use
14067 \begin_inset Flex CharStyle:Code
14070 \begin_layout Plain Layout
14076 , ERT insets generally
14077 \begin_inset Flex CharStyle:Code
14080 \begin_layout Plain Layout
14086 , and character styles
14087 \begin_inset Flex CharStyle:Code
14090 \begin_layout Plain Layout
14099 \begin_layout Description
14100 \begin_inset Flex CharStyle:Code
14103 \begin_layout Plain Layout
14109 Required at the end of the InsetLayout declarations.
14112 \begin_layout Description
14113 \begin_inset Flex CharStyle:Code
14116 \begin_layout Plain Layout
14122 The font used for both the text body
14128 \begin_inset space ~
14132 \begin_inset CommandInset ref
14134 reference "sub:Font-description"
14139 Note that defining this font automatically defines the
14140 \begin_inset Flex CharStyle:Code
14143 \begin_layout Plain Layout
14149 to the same value, so define this first and define
14150 \begin_inset Flex CharStyle:Code
14153 \begin_layout Plain Layout
14159 later if you want them to be different.
14162 \begin_layout Description
14163 \begin_inset Flex CharStyle:Code
14166 \begin_layout Plain Layout
14173 \begin_inset Quotes eld
14177 \begin_inset Quotes erd
14180 language, leading to Left-to-Right (latin) output, e.
14181 \begin_inset space \thinspace{}
14185 \begin_inset space \space{}
14188 in TeX code or URL.
14192 \begin_layout Description
14193 \begin_inset Flex CharStyle:Code
14196 \begin_layout Plain Layout
14203 \begin_inset Flex CharStyle:Code
14206 \begin_layout Plain Layout
14215 \begin_inset Flex CharStyle:Code
14218 \begin_layout Plain Layout
14224 ] Indicates whether the PlainLayout should be used or, instead, the user
14225 can change the paragraph style used in the inset.
14229 \begin_layout Description
14230 \begin_inset Flex CharStyle:Code
14233 \begin_layout Plain Layout
14239 As with paragraph styles (see page
14240 \begin_inset CommandInset ref
14241 LatexCommand pageref
14242 reference "des:FreeSpacing"
14250 \begin_layout Description
14251 \begin_inset Flex CharStyle:Code
14254 \begin_layout Plain Layout
14260 These tags control XHTML output.
14264 \begin_layout Description
14265 \begin_inset Flex CharStyle:Code
14268 \begin_layout Plain Layout
14275 \begin_inset Flex CharStyle:Code
14278 \begin_layout Plain Layout
14287 \begin_inset Flex CharStyle:Code
14290 \begin_layout Plain Layout
14296 ] Whether to include the contents of this inset in the strings generated
14297 for the `Outline' pane.
14298 One would not, for example, want the content of a footnote in a section
14299 header to be included in the TOC displayed in the outline, but one would
14300 normally want the content of a character style displayed.
14301 Default is false: not to include.
14304 \begin_layout Description
14305 \begin_inset Flex CharStyle:Code
14308 \begin_layout Plain Layout
14314 As with paragraph styles (see page
14315 \begin_inset CommandInset ref
14316 LatexCommand pageref
14317 reference "des:KeepEmpty"
14325 \begin_layout Description
14326 \begin_inset Flex CharStyle:Code
14329 \begin_layout Plain Layout
14335 The font used for the label.
14337 \begin_inset space ~
14341 \begin_inset CommandInset ref
14343 reference "sub:Font-description"
14348 Note that this definition can never appear before
14349 \begin_inset Flex CharStyle:Code
14352 \begin_layout Plain Layout
14358 , lest it be ineffective.
14361 \begin_layout Description
14362 \begin_inset Flex CharStyle:Code
14365 \begin_layout Plain Layout
14371 What will be displayed on the button or elsewhere as the inset label.
14372 Some inset types (TeX code and Branch) modify this label on the fly.
14375 \begin_layout Description
14376 \begin_inset Flex CharStyle:Code
14379 \begin_layout Plain Layout
14385 The name of the corresponding LaTeX stuff.
14386 Either the environment or command name.
14389 \begin_layout Description
14390 \begin_inset Flex CharStyle:Code
14393 \begin_layout Plain Layout
14399 The optional parameter for the corresponding
14400 \begin_inset Flex CharStyle:Code
14403 \begin_layout Plain Layout
14409 stuff, including possible bracket pairs like
14410 \begin_inset Flex CharStyle:Code
14413 \begin_layout Plain Layout
14420 This parameter cannot be changed from within LyX.
14423 \begin_layout Description
14424 \begin_inset Flex CharStyle:Code
14427 \begin_layout Plain Layout
14433 As with paragraph styles (see page
14434 \begin_inset CommandInset ref
14435 LatexCommand pageref
14436 reference "des:LatexType"
14443 \begin_layout Description
14444 \begin_inset Flex CharStyle:Code
14447 \begin_layout Plain Layout
14454 \begin_inset Flex CharStyle:Code
14457 \begin_layout Plain Layout
14464 \begin_inset Flex CharStyle:Code
14467 \begin_layout Plain Layout
14474 \begin_inset Flex CharStyle:Code
14477 \begin_layout Plain Layout
14484 \begin_inset Flex CharStyle:Code
14487 \begin_layout Plain Layout
14493 (indicating a dummy definition ending definitions of charstyles, etc).
14494 This entry is required in and is only meaningful for Flex insets.
14495 Among other things, it determines on which menu this inset will appear.
14497 \begin_inset Flex CharStyle:Code
14500 \begin_layout Plain Layout
14507 \begin_inset Flex CharStyle:Code
14510 \begin_layout Plain Layout
14517 \begin_inset Flex CharStyle:Code
14520 \begin_layout Plain Layout
14528 \begin_inset Flex CharStyle:Code
14531 \begin_layout Plain Layout
14537 can be set to true for charstyle insets, if you wish, by setting it
14542 \begin_inset Flex CharStyle:Code
14545 \begin_layout Plain Layout
14554 \begin_layout Description
14555 \begin_inset Flex CharStyle:Code
14558 \begin_layout Plain Layout
14565 \begin_inset Flex CharStyle:Code
14568 \begin_layout Plain Layout
14577 \begin_inset Flex CharStyle:Code
14580 \begin_layout Plain Layout
14586 ] Whether multiple paragraphs are permitted in this inset.
14588 \begin_inset Flex CharStyle:Code
14591 \begin_layout Plain Layout
14597 to the same value and
14598 \begin_inset Flex CharStyle:Code
14601 \begin_layout Plain Layout
14607 to the opposite value.
14608 These can be reset to other values, if they are used
14613 \begin_inset Flex CharStyle:Code
14616 \begin_layout Plain Layout
14626 \begin_layout Description
14627 \begin_inset Flex CharStyle:Code
14630 \begin_layout Plain Layout
14637 \begin_inset Flex CharStyle:Code
14640 \begin_layout Plain Layout
14649 \begin_inset Flex CharStyle:Code
14652 \begin_layout Plain Layout
14658 ] Whether fragile commands in this layout should be
14659 \begin_inset Flex CharStyle:Code
14662 \begin_layout Plain Layout
14675 whether the command should itself be protected.) Default is false.
14678 \begin_layout Description
14679 \begin_inset Flex CharStyle:Code
14682 \begin_layout Plain Layout
14689 \begin_inset Flex CharStyle:Code
14692 \begin_layout Plain Layout
14701 \begin_inset Flex CharStyle:Code
14704 \begin_layout Plain Layout
14710 ] As with paragraph styles (see page
14711 \begin_inset CommandInset ref
14712 LatexCommand pageref
14713 reference "des:ParbreakIsNewline"
14721 \begin_layout Description
14722 \begin_inset Flex CharStyle:Code
14725 \begin_layout Plain Layout
14732 \begin_inset Flex CharStyle:Code
14735 \begin_layout Plain Layout
14744 \begin_inset Flex CharStyle:Code
14747 \begin_layout Plain Layout
14753 ] As with paragraph styles (see page
14754 \begin_inset CommandInset ref
14755 LatexCommand pageref
14756 reference "des:PassThru"
14764 \begin_layout Description
14765 \begin_inset Flex CharStyle:Code
14768 \begin_layout Plain Layout
14774 As with paragraph styles (see page
14775 \begin_inset CommandInset ref
14776 LatexCommand pageref
14777 reference "des:Preamble"
14784 \begin_layout Description
14785 \begin_inset Flex CharStyle:Code
14788 \begin_layout Plain Layout
14795 \begin_inset Flex CharStyle:Code
14798 \begin_layout Plain Layout
14804 ] The prefix to use when creating labels referring to insets of this type.
14805 This allows the use of formatted references.
14808 \begin_layout Description
14809 \begin_inset Flex CharStyle:Code
14812 \begin_layout Plain Layout
14819 \begin_inset Flex CharStyle:Code
14822 \begin_layout Plain Layout
14828 ] As with paragraph styles (see page
14829 \begin_inset CommandInset ref
14830 LatexCommand pageref
14831 reference "des:Requires"
14838 \begin_layout Description
14839 \begin_inset Flex CharStyle:Code
14842 \begin_layout Plain Layout
14849 \begin_inset Flex CharStyle:Code
14852 \begin_layout Plain Layout
14859 \begin_inset Flex CharStyle:Code
14862 \begin_layout Plain Layout
14870 ] Spellcheck the contents of this inset.
14874 \begin_layout Subsection
14876 \begin_inset CommandInset label
14878 name "sub:Counters"
14885 \begin_layout Standard
14886 Since version 1.3.0 of LyX, it is both possible and necessary to define the
14888 \begin_inset Flex CharStyle:MenuItem
14891 \begin_layout Plain Layout
14898 \begin_inset Flex CharStyle:MenuItem
14901 \begin_layout Plain Layout
14907 , \SpecialChar \ldots{}
14908 ) in the text class itself.
14909 The standard counters are defined in the file
14910 \begin_inset Flex CharStyle:Code
14913 \begin_layout Plain Layout
14919 , so you may have to do no more than add
14922 \begin_layout LyX-Code
14923 Input stdcounters.inc
14926 \begin_layout Standard
14927 to your layout file to get them to work.
14928 But if you want to define custom counters, then you can do so.
14929 The counter declaration must begin with:
14932 \begin_layout LyX-Code
14933 Counter CounterName
14936 \begin_layout Standard
14938 \begin_inset Flex CharStyle:Code
14941 \begin_layout Plain Layout
14947 ' is replaced by the name of the counter.
14948 And it must end with
14949 \begin_inset Quotes eld
14953 \begin_inset Flex CharStyle:Code
14956 \begin_layout Plain Layout
14963 \begin_inset Quotes erd
14967 The following parameters can also be used:
14970 \begin_layout Description
14971 \begin_inset Flex CharStyle:Code
14974 \begin_layout Plain Layout
14981 \begin_inset Flex CharStyle:Code
14984 \begin_layout Plain Layout
14991 \begin_inset Quotes erd
14995 \begin_inset Quotes erd
14998 ] When defined, this string defines how the counter is displayed.
14999 Setting this value sets
15000 \begin_inset Flex CharStyle:Code
15003 \begin_layout Plain Layout
15004 LabelStringAppendix
15010 The following special constructs can be used in the string:
15014 \begin_layout Itemize
15015 \begin_inset Flex CharStyle:Code
15018 \begin_layout Plain Layout
15026 will be replaced by the expansion of the
15027 \begin_inset Flex CharStyle:Code
15030 \begin_layout Plain Layout
15037 \begin_inset Flex CharStyle:Code
15040 \begin_layout Plain Layout
15041 LabelStringAppendix
15047 \begin_inset Flex CharStyle:Code
15050 \begin_layout Plain Layout
15060 \begin_layout Itemize
15061 counter values can be expressed using LaTeX-like macros
15062 \begin_inset Flex CharStyle:Code
15065 \begin_layout Plain Layout
15082 \begin_inset Flex CharStyle:Code
15085 \begin_layout Plain Layout
15097 \begin_layout Plain Layout
15107 Actually, the situation is a bit more complicated: any
15126 other than those described below will produce arabic numerals.
15127 It would not be surprising to see this change in the future.
15133 \begin_inset Flex CharStyle:Code
15136 \begin_layout Plain Layout
15142 : 1, 2, 3,\SpecialChar \ldots{}
15144 \begin_inset Flex CharStyle:Code
15147 \begin_layout Plain Layout
15153 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15155 \begin_inset Flex CharStyle:Code
15158 \begin_layout Plain Layout
15164 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15166 \begin_inset Flex CharStyle:Code
15169 \begin_layout Plain Layout
15175 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15177 \begin_inset Flex CharStyle:Code
15180 \begin_layout Plain Layout
15186 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15188 \begin_inset Flex CharStyle:Code
15191 \begin_layout Plain Layout
15197 for hebrew numerals.
15201 \begin_layout Standard
15202 If LabelString is not defined, a default value is constructed as follows:
15203 if the counter has a master counter
15204 \begin_inset Flex CharStyle:Code
15207 \begin_layout Plain Layout
15214 \begin_inset Flex CharStyle:Code
15217 \begin_layout Plain Layout
15224 \begin_inset Flex CharStyle:Code
15227 \begin_layout Plain Layout
15237 is used; otherwise the string
15238 \begin_inset Flex CharStyle:Code
15241 \begin_layout Plain Layout
15252 \begin_layout Description
15253 \begin_inset Flex CharStyle:Code
15256 \begin_layout Plain Layout
15257 LabelStringAppendix
15263 \begin_inset Flex CharStyle:Code
15266 \begin_layout Plain Layout
15273 \begin_inset Quotes erd
15277 \begin_inset Quotes erd
15281 \begin_inset Flex CharStyle:Code
15284 \begin_layout Plain Layout
15290 , but for use in the Appendix.
15293 \begin_layout Description
15294 \begin_inset Flex CharStyle:Code
15297 \begin_layout Plain Layout
15304 \begin_inset Flex CharStyle:Code
15307 \begin_layout Plain Layout
15314 \begin_inset Quotes erd
15318 \begin_inset Quotes erd
15321 ] A format for use with formatted references to this counter.
15322 For example, one might want to have references to section numbers appear
15324 \begin_inset Quotes eld
15328 \begin_inset Quotes erd
15332 The string should contain
15333 \begin_inset Quotes eld
15337 \begin_inset Quotes erd
15341 This will be replaced by the counter number itself.
15342 So, for sections, it would be: Section ##.
15345 \begin_layout Description
15346 \begin_inset Flex CharStyle:Code
15349 \begin_layout Plain Layout
15356 \begin_inset Flex CharStyle:Code
15359 \begin_layout Plain Layout
15366 \begin_inset Quotes erd
15370 \begin_inset Quotes erd
15373 ] If this is set to the name of another counter, the present counter will
15374 be reset every time the other one is increased.
15376 \begin_inset Flex CharStyle:Code
15379 \begin_layout Plain Layout
15386 \begin_inset Flex CharStyle:Code
15389 \begin_layout Plain Layout
15398 \begin_layout Subsection
15400 \begin_inset CommandInset label
15402 name "sub:Font-description"
15409 \begin_layout Standard
15410 A font description looks like this:
15413 \begin_layout LyX-Code
15423 \begin_layout LyX-Code
15427 \begin_layout LyX-Code
15431 \begin_layout Standard
15432 The following commands are available:
15435 \begin_layout Description
15436 \begin_inset Flex CharStyle:Code
15439 \begin_layout Plain Layout
15446 \begin_inset Flex CharStyle:Code
15449 \begin_layout Plain Layout
15458 \begin_inset Flex CharStyle:Code
15461 \begin_layout Plain Layout
15468 \begin_inset Flex CharStyle:Code
15471 \begin_layout Plain Layout
15478 \begin_inset Flex CharStyle:Code
15481 \begin_layout Plain Layout
15488 \begin_inset Flex CharStyle:Code
15491 \begin_layout Plain Layout
15498 \begin_inset Flex CharStyle:Code
15501 \begin_layout Plain Layout
15508 \begin_inset Flex CharStyle:Code
15511 \begin_layout Plain Layout
15518 \begin_inset Flex CharStyle:Code
15521 \begin_layout Plain Layout
15528 \begin_inset Flex CharStyle:Code
15531 \begin_layout Plain Layout
15540 \begin_layout Description
15541 \begin_inset Flex CharStyle:Code
15544 \begin_layout Plain Layout
15551 \begin_inset Flex CharStyle:Code
15554 \begin_layout Plain Layout
15563 \begin_inset Flex CharStyle:Code
15566 \begin_layout Plain Layout
15573 \begin_inset Flex CharStyle:Code
15576 \begin_layout Plain Layout
15585 \begin_layout Description
15586 \begin_inset Flex CharStyle:Code
15589 \begin_layout Plain Layout
15596 \begin_inset Flex CharStyle:Code
15599 \begin_layout Plain Layout
15605 ] Valid arguments are:
15606 \begin_inset Flex CharStyle:Code
15609 \begin_layout Plain Layout
15616 \begin_inset Flex CharStyle:Code
15619 \begin_layout Plain Layout
15626 \begin_inset Flex CharStyle:Code
15629 \begin_layout Plain Layout
15636 \begin_inset Flex CharStyle:Code
15639 \begin_layout Plain Layout
15646 \begin_inset Flex CharStyle:Code
15649 \begin_layout Plain Layout
15656 \begin_inset Flex CharStyle:Code
15659 \begin_layout Plain Layout
15666 Each of these turns on or off the corresponding attribute.
15668 \begin_inset Flex CharStyle:Code
15671 \begin_layout Plain Layout
15677 turns on emphasis, and
15678 \begin_inset Flex CharStyle:Code
15681 \begin_layout Plain Layout
15689 \begin_inset Newline newline
15692 If the latter seems puzzling, remember that the font settings for the present
15693 context are generally inherited from the surrounding context.
15695 \begin_inset Flex CharStyle:Code
15698 \begin_layout Plain Layout
15704 would turn off the emphasis that was anyway in effect, say, in a theorem
15708 \begin_layout Description
15709 \begin_inset Flex CharStyle:Code
15712 \begin_layout Plain Layout
15719 \begin_inset Flex CharStyle:Code
15722 \begin_layout Plain Layout
15731 \begin_inset Flex CharStyle:Code
15734 \begin_layout Plain Layout
15743 \begin_layout Description
15744 \begin_inset Flex CharStyle:Code
15747 \begin_layout Plain Layout
15754 \begin_inset Flex CharStyle:Code
15757 \begin_layout Plain Layout
15766 \begin_inset Flex CharStyle:Code
15769 \begin_layout Plain Layout
15776 \begin_inset Flex CharStyle:Code
15779 \begin_layout Plain Layout
15786 \begin_inset Flex CharStyle:Code
15789 \begin_layout Plain Layout
15798 \begin_layout Description
15799 \begin_inset Flex CharStyle:Code
15802 \begin_layout Plain Layout
15809 \begin_inset Flex CharStyle:Code
15812 \begin_layout Plain Layout
15819 \begin_inset Flex CharStyle:Code
15822 \begin_layout Plain Layout
15829 \begin_inset Flex CharStyle:Code
15832 \begin_layout Plain Layout
15841 \begin_inset Flex CharStyle:Code
15844 \begin_layout Plain Layout
15851 \begin_inset Flex CharStyle:Code
15854 \begin_layout Plain Layout
15861 \begin_inset Flex CharStyle:Code
15864 \begin_layout Plain Layout
15871 \begin_inset Flex CharStyle:Code
15874 \begin_layout Plain Layout
15881 \begin_inset Flex CharStyle:Code
15884 \begin_layout Plain Layout
15893 \begin_layout Subsection
15894 \begin_inset CommandInset label
15896 name "sub:Citation-format-description"
15900 Citation format description
15903 \begin_layout Standard
15905 \begin_inset Flex CharStyle:Code
15908 \begin_layout Plain Layout
15914 blocks are used to describe how bibliographic information should be displayed,
15915 both within LyX itself (in the citation dialog and in tooltips, for example)
15916 and in XHTML output.
15917 Such a block might look like this:
15920 \begin_layout LyX-Code
15924 \begin_layout LyX-Code
15928 \begin_layout LyX-Code
15932 \begin_layout LyX-Code
15936 \begin_layout Standard
15937 The individual lines define how the bibliographic information associated
15938 with an article or book, respectively, is to be displayed, and such a definitio
15939 n can be given for any `entry type' that might be present in a BibTeX file.
15940 LyX defines a default format in the source code that will be used if no
15941 specific definition has been given.
15942 LyX predefines several formats in the file
15943 \begin_inset Flex CharStyle:Code
15946 \begin_layout Plain Layout
15952 , which is included in most of LyX's document classes.
15955 \begin_layout Standard
15956 The definitions use a simple language that allows BibTeX keys to be replaced
15958 Keys should be enclosed in
15959 \begin_inset Flex CharStyle:Code
15962 \begin_layout Plain Layout
15969 \begin_inset Flex CharStyle:Code
15972 \begin_layout Plain Layout
15979 So a simple definition might look like this:
15982 \begin_layout LyX-Code
15984 \begin_inset Quotes eld
15988 \begin_inset Quotes erd
15994 \begin_layout Standard
15995 This would print the author, followed by a comma, followed by the title,
15996 in quotes, followed by a period.
15999 \begin_layout Standard
16000 Of course, sometimes you may want to print a key only if it exists.
16001 This can be done by using a conditional construction, such as:
16002 \begin_inset Flex CharStyle:Code
16005 \begin_layout Plain Layout
16007 \begin_inset space ~
16017 \begin_inset Flex CharStyle:Code
16020 \begin_layout Plain Layout
16026 key exists, then print
16027 \begin_inset Quotes eld
16031 \begin_inset space ~
16035 \begin_inset Quotes erd
16038 followed by the volume key.
16039 It is also possible to have an else clause in the conditional, such as:
16041 \begin_inset Flex CharStyle:Code
16044 \begin_layout Plain Layout
16045 {%author%[[%author%]][[%editor%, ed.]]}
16052 \begin_inset Flex CharStyle:Code
16055 \begin_layout Plain Layout
16061 key is printed if it exists; otherwise, the editor key is printed, followed
16063 \begin_inset Quotes eld
16067 \begin_inset space ~
16071 \begin_inset Quotes erd
16074 Note that the key is again enclosed in
16075 \begin_inset Flex CharStyle:Code
16078 \begin_layout Plain Layout
16084 signs; the entire conditional is enclosed in braces; and the if and else
16085 clauses are enclosed in double brackets,
16086 \begin_inset Quotes eld
16090 \begin_inset Flex CharStyle:Code
16093 \begin_layout Plain Layout
16100 \begin_inset Quotes eld
16104 \begin_inset Quotes eld
16108 \begin_inset Flex CharStyle:Code
16111 \begin_layout Plain Layout
16118 \begin_inset Quotes erd
16122 There must be no space between any of these.
16125 \begin_layout Standard
16126 There is one other piece of syntax available in definitions, which looks
16128 \begin_inset Flex CharStyle:Code
16131 \begin_layout Plain Layout
16138 This defines a piece of formatting information that is to be used when
16140 \begin_inset Quotes eld
16144 \begin_inset Quotes erd
16148 Obviously, we do not want to output HTML tags when writing plain text,
16149 so they should be wrapped in
16150 \begin_inset Quotes eld
16154 \begin_inset Quotes erd
16158 \begin_inset Quotes eld
16162 \begin_inset Quotes erd
16168 \begin_layout Standard
16169 Two special sorts of definitions are also possible in a
16170 \begin_inset Flex CharStyle:Code
16173 \begin_layout Plain Layout
16180 An example of the first would be:
16183 \begin_layout LyX-Code
16185 \begin_inset Quotes eld
16189 \begin_inset Quotes erd
16195 \begin_layout Standard
16196 This is an abbreviation, or macro, and it can be used by treating it as
16198 \begin_inset Flex CharStyle:Code
16201 \begin_layout Plain Layout
16209 \begin_inset Flex CharStyle:Code
16212 \begin_layout Plain Layout
16218 exactly as it would treat its definition.
16219 So, let us issue the obvious
16227 \begin_layout LyX-Code
16231 \begin_layout Standard
16232 or anything like it.
16233 LyX shouldn't go into an infinite loop, but it may go into a long one before
16237 \begin_layout Standard
16238 The second sort of special definition might look like this:
16241 \begin_layout LyX-Code
16245 \begin_layout Standard
16246 This defines a translatable piece of text, which allows relevant parts of
16247 the bibliography to be translated.
16248 It can be included in a definition by treating it as a key:
16249 \begin_inset Flex CharStyle:Code
16252 \begin_layout Plain Layout
16259 Several of these are predefined in
16260 \begin_inset Flex CharStyle:Code
16263 \begin_layout Plain Layout
16270 Note that these are not macros, in the sense just defined.
16271 They will not be expanded.
16274 \begin_layout Standard
16275 So here then is an example that use all these features:
16278 \begin_layout LyX-Code
16279 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16282 \begin_layout Standard
16283 The defines a macro that prints the author, followed by a comma, if the
16285 \begin_inset Flex CharStyle:Code
16288 \begin_layout Plain Layout
16294 key is defined, or else prints the name of the editor, followed by the
16296 \begin_inset Flex CharStyle:Code
16299 \begin_layout Plain Layout
16305 or its translation (it is by default
16306 \begin_inset Quotes eld
16310 \begin_inset Quotes erd
16314 \begin_inset Flex CharStyle:Code
16317 \begin_layout Plain Layout
16324 Note that this is in fact defined in
16325 \begin_inset Flex CharStyle:Code
16328 \begin_layout Plain Layout
16334 , so you can use it in your own definitions, or re-definitions, if you load
16338 \begin_layout Section
16339 \begin_inset CommandInset label
16341 name "sec:Tags-for-XHTML"
16345 Tags for XHTML output
16348 \begin_layout Standard
16349 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16350 by layout information.
16351 In general, LyX provides sensible defaults and, as mentioned earlier, it
16352 will even construct default CSS style rules from the other layout tags.
16353 For example, LyX will attempt to use the information provided in the
16354 \begin_inset Flex CharStyle:Code
16357 \begin_layout Plain Layout
16363 declaration for the Chapter style to write CSS that will appropriately
16364 format chapter headings.
16367 \begin_layout Standard
16368 In many cases, then, you may not have to do anything at all to get acceptable
16369 XHTML output for your own environments, custom insets, and so forth.
16370 But in some cases you will, and so LyX provides a number of layout tags
16371 that can be used to customize the XHTML and CSS that are generated.
16374 \begin_layout Standard
16375 Note that there are two tags,
16376 \begin_inset Flex CharStyle:Code
16379 \begin_layout Plain Layout
16386 \begin_inset Flex CharStyle:Code
16389 \begin_layout Plain Layout
16395 that may appear outside style and inset declarations.
16397 \begin_inset CommandInset ref
16399 reference "sub:General-text-class"
16403 for details on these.
16406 \begin_layout Subsection
16407 \begin_inset CommandInset label
16409 name "sub:Paragraph-Style-XHTML"
16416 \begin_layout Standard
16417 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16418 dealing with a normal paragraph, a command, or an environment, where this
16419 is itself determined by the contents of the corresponding
16420 \begin_inset Flex CharStyle:Code
16423 \begin_layout Plain Layout
16433 \begin_layout Standard
16434 For a command or normal paragraph, the output XHTML has the following form:
16437 \begin_layout LyX-Code
16439 \begin_inset Quotes erd
16443 \begin_inset Quotes erd
16449 \begin_layout LyX-Code
16451 \begin_inset Quotes erd
16455 \begin_inset Quotes erd
16461 \begin_layout LyX-Code
16462 Contents of the paragraph.
16465 \begin_layout LyX-Code
16469 \begin_layout Standard
16470 The label tags are of course omitted if the paragraph does not have a label.
16473 \begin_layout Standard
16474 For an environment that is not some sort of list, the XHTML takes this form:
16477 \begin_layout LyX-Code
16479 \begin_inset Quotes erd
16483 \begin_inset Quotes erd
16489 \begin_layout LyX-Code
16491 \begin_inset Quotes erd
16495 \begin_inset Quotes erd
16499 \begin_inset Quotes erd
16503 \begin_inset Quotes erd
16506 >Environment Label</labeltag>First paragraph.</itemtag>
16509 \begin_layout LyX-Code
16510 <itemtag>Second paragraph.</itemtag>
16513 \begin_layout LyX-Code
16517 \begin_layout Standard
16518 Note that the label is output only for the first paragraph, as it should
16519 be for a theorem, for example.
16523 \begin_layout Standard
16524 For a list, we have one of these forms:
16527 \begin_layout LyX-Code
16529 \begin_inset Quotes erd
16533 \begin_inset Quotes erd
16539 \begin_layout LyX-Code
16541 \begin_inset Quotes erd
16545 \begin_inset Quotes erd
16549 \begin_inset Quotes erd
16553 \begin_inset Quotes erd
16556 >List Label</labeltag>First item.</itemtag>
16559 \begin_layout LyX-Code
16561 \begin_inset Quotes erd
16565 \begin_inset Quotes erd
16569 \begin_inset Quotes erd
16573 \begin_inset Quotes erd
16576 >List Label</labeltag>Second item.</itemtag>
16579 \begin_layout LyX-Code
16583 \begin_layout LyX-Code
16587 \begin_layout LyX-Code
16589 \begin_inset Quotes erd
16593 \begin_inset Quotes erd
16599 \begin_layout LyX-Code
16601 \begin_inset Quotes erd
16605 \begin_inset Quotes erd
16608 >List Label</labeltag><itemtag attr=
16609 \begin_inset Quotes erd
16613 \begin_inset Quotes erd
16616 >First item.</itemtag>
16619 \begin_layout LyX-Code
16621 \begin_inset Quotes erd
16625 \begin_inset Quotes erd
16628 >List Label</labeltag><itemtag attr=
16629 \begin_inset Quotes erd
16633 \begin_inset Quotes erd
16636 >Second item.</itemtag>
16639 \begin_layout LyX-Code
16643 \begin_layout Standard
16644 Note the different orders of
16645 \begin_inset Flex CharStyle:Code
16648 \begin_layout Plain Layout
16655 \begin_inset Flex CharStyle:Code
16658 \begin_layout Plain Layout
16665 Which order we get depends upon the setting of
16666 \begin_inset Flex CharStyle:Code
16669 \begin_layout Plain Layout
16676 \begin_inset Flex CharStyle:Code
16679 \begin_layout Plain Layout
16685 is false (the default), you get the first of these, with the label within
16686 the item; if true, you get the second, with the label outside the item.
16689 \begin_layout Standard
16690 The specific tags and attributes output for each paragraph type can be controlle
16691 d by means of the layout tags we are about to describe.
16692 As mentioned earlier, however, LyX uses sensible defaults for many of these,
16693 so you often may not need to do very much to get good XHTML output.
16694 Think of the available tags as there so you can tweak things to your liking.
16697 \begin_layout Description
16698 \begin_inset Flex CharStyle:Code
16701 \begin_layout Plain Layout
16708 \begin_inset Flex CharStyle:Code
16711 \begin_layout Plain Layout
16717 ] Specifies attribute information to be output with the main tag.
16719 \begin_inset Quotes eld
16723 \begin_inset Flex CharStyle:Code
16726 \begin_layout Plain Layout
16733 \begin_inset Quotes erd
16737 By default, LyX will output
16738 \begin_inset Quotes eld
16742 \begin_inset Flex CharStyle:Code
16745 \begin_layout Plain Layout
16752 \begin_inset Quotes erd
16756 \begin_inset Flex CharStyle:Code
16759 \begin_layout Plain Layout
16765 is the LyX name of the layout, made lowercase, for example: chapter.
16770 contain any style information.
16772 \begin_inset Flex CharStyle:Code
16775 \begin_layout Plain Layout
16784 \begin_layout Description
16785 \begin_inset Flex CharStyle:Code
16788 \begin_layout Plain Layout
16795 \begin_inset Flex CharStyle:Code
16798 \begin_layout Plain Layout
16808 ] Whether to output the default CSS information LyX generates for this layout,
16809 even if additional information is explicitly provided via
16810 \begin_inset Flex CharStyle:Code
16813 \begin_layout Plain Layout
16821 \begin_inset Flex CharStyle:Code
16824 \begin_layout Plain Layout
16830 allows you to alter or augment the generated CSS, rather than to override
16833 \begin_inset Flex CharStyle:Code
16836 \begin_layout Plain Layout
16845 \begin_layout Description
16846 \begin_inset Flex CharStyle:Code
16849 \begin_layout Plain Layout
16856 \begin_inset Flex CharStyle:Code
16859 \begin_layout Plain Layout
16865 ] The tag to be used for individual paragraphs of environments, replacing
16867 \begin_inset Flex CharStyle:Code
16870 \begin_layout Plain Layout
16876 in the examples above.
16878 \begin_inset Flex CharStyle:Code
16881 \begin_layout Plain Layout
16890 \begin_layout Description
16891 \begin_inset Flex CharStyle:Code
16894 \begin_layout Plain Layout
16901 \begin_inset Flex CharStyle:Code
16904 \begin_layout Plain Layout
16910 ] Attributes for the item tag.
16912 \begin_inset Quotes eld
16916 \begin_inset Flex CharStyle:Code
16919 \begin_layout Plain Layout
16920 class=`layoutname_item'
16926 \begin_inset Quotes erd
16934 contain any style information.
16936 \begin_inset Flex CharStyle:Code
16939 \begin_layout Plain Layout
16948 \begin_layout Description
16949 \begin_inset Flex CharStyle:Code
16952 \begin_layout Plain Layout
16959 \begin_inset Flex CharStyle:Code
16962 \begin_layout Plain Layout
16968 ] The tag to be used for paragraph and item labels, replacing
16969 \begin_inset Flex CharStyle:Code
16972 \begin_layout Plain Layout
16978 in the examples above.
16980 \begin_inset Flex CharStyle:Code
16983 \begin_layout Plain Layout
16990 \begin_inset Flex CharStyle:Code
16993 \begin_layout Plain Layout
17000 \begin_inset Flex CharStyle:Code
17003 \begin_layout Plain Layout
17010 \begin_inset Flex CharStyle:Code
17013 \begin_layout Plain Layout
17014 Centered_Top_Environment
17019 , in which case it defaults to
17020 \begin_inset Flex CharStyle:Code
17023 \begin_layout Plain Layout
17032 \begin_layout Description
17033 \begin_inset Flex CharStyle:Code
17036 \begin_layout Plain Layout
17043 \begin_inset Flex CharStyle:Code
17046 \begin_layout Plain Layout
17052 ] Attributes for the label tag.
17054 \begin_inset Quotes eld
17058 \begin_inset Flex CharStyle:Code
17061 \begin_layout Plain Layout
17062 class=`layoutname_label'
17068 \begin_inset Quotes erd
17076 contain any style information.
17078 \begin_inset Flex CharStyle:Code
17081 \begin_layout Plain Layout
17090 \begin_layout Description
17091 \begin_inset Flex CharStyle:Code
17094 \begin_layout Plain Layout
17101 \begin_inset Flex CharStyle:Code
17104 \begin_layout Plain Layout
17114 ] Meaningful only for list-like environments, this tag controls whether
17115 the label tag is output before or inside the item tag.
17116 This is used, for example, in the description environment, where we want
17118 \begin_inset Flex CharStyle:Code
17121 \begin_layout Plain Layout
17122 <dt>\SpecialChar \ldots{}
17123 </dt><dd>\SpecialChar \ldots{}
17131 \begin_inset Flex CharStyle:Code
17134 \begin_layout Plain Layout
17140 : The label tag is output inside the item tag.
17143 \begin_layout Description
17144 \begin_inset Flex CharStyle:Code
17147 \begin_layout Plain Layout
17153 Information to be output in the
17154 \begin_inset Flex CharStyle:Code
17157 \begin_layout Plain Layout
17163 section when this style is used.
17164 This might, for example, be used to include a
17165 \begin_inset Flex CharStyle:Code
17168 \begin_layout Plain Layout
17175 \begin_inset Flex CharStyle:Code
17178 \begin_layout Plain Layout
17187 \begin_layout Description
17188 \begin_inset Flex CharStyle:Code
17191 \begin_layout Plain Layout
17197 CSS style information to be included when this style is used.
17198 Note that this will automatically be wrapped in a layout-generated
17199 \begin_inset Flex CharStyle:Code
17202 \begin_layout Plain Layout
17208 block, so only the CSS itself need be included.
17211 \begin_layout Description
17212 \begin_inset Flex CharStyle:Code
17215 \begin_layout Plain Layout
17222 \begin_inset Flex CharStyle:Code
17225 \begin_layout Plain Layout
17231 ] The tag to be used for the main label, replacing
17232 \begin_inset Flex CharStyle:Code
17235 \begin_layout Plain Layout
17241 in the examples above.
17243 \begin_inset Flex CharStyle:Code
17246 \begin_layout Plain Layout
17255 \begin_layout Description
17256 \begin_inset Flex CharStyle:Code
17259 \begin_layout Plain Layout
17266 \begin_inset Flex CharStyle:Code
17269 \begin_layout Plain Layout
17279 ] Marks this style as the one to be used to generate the
17280 \begin_inset Flex CharStyle:Code
17283 \begin_layout Plain Layout
17289 tag for the XHTML file.
17290 By default, it is false.
17292 \begin_inset Flex CharStyle:Code
17295 \begin_layout Plain Layout
17301 file sets it to true for the
17302 \begin_inset Flex CharStyle:Code
17305 \begin_layout Plain Layout
17315 \begin_layout Subsection
17319 \begin_layout Standard
17320 The XHTML output of insets can also be controlled by information in layout
17325 \begin_layout Plain Layout
17326 At present, this is true only for
17327 \begin_inset Quotes eld
17331 \begin_inset Quotes erd
17334 insets (insets you can type into) and is not true for
17335 \begin_inset Quotes eld
17339 \begin_inset Quotes erd
17342 insets (insets that are associated with dialog boxes).
17347 Here, too, LyX tries to provide sensible defaults, and it constructs default
17349 But everything can be customized.
17352 \begin_layout Standard
17353 The XHTML LyX outputs for an inset has the following form:
17356 \begin_layout LyX-Code
17358 \begin_inset Quotes erd
17362 \begin_inset Quotes erd
17368 \begin_layout LyX-Code
17369 <labeltag>Label</labeltag>
17372 \begin_layout LyX-Code
17374 \begin_inset Quotes erd
17378 \begin_inset Quotes erd
17381 >Contents of the inset.</innertag>
17384 \begin_layout LyX-Code
17388 \begin_layout Standard
17389 If the inset permits multiple paragraphs---that is, if
17390 \begin_inset Flex CharStyle:Code
17393 \begin_layout Plain Layout
17399 is true---then the contents of the inset will itself be output as paragraphs
17400 formatted according to the styles used for those paragraphs (standard,
17401 quote, and the like).
17402 The label tag is of course omitted if the paragraph does not have a label
17403 and, at present, is always
17404 \begin_inset Flex CharStyle:Code
17407 \begin_layout Plain Layout
17414 The inner tag is optional and, by default, does not appear.
17417 \begin_layout Standard
17418 The specific tags and attributes output for each inset can be controlled
17419 by means of the following layout tags.
17422 \begin_layout Description
17423 \begin_inset Flex CharStyle:Code
17426 \begin_layout Plain Layout
17433 \begin_inset Flex CharStyle:Code
17436 \begin_layout Plain Layout
17442 ] Specifies attribute information to be output with the main tag.
17444 \begin_inset Quotes eld
17448 \begin_inset Flex CharStyle:Code
17451 \begin_layout Plain Layout
17452 class=`myinset' onclick=`\SpecialChar \ldots{}
17459 \begin_inset Quotes erd
17463 By default, LyX will output
17464 \begin_inset Quotes eld
17468 \begin_inset Flex CharStyle:Code
17471 \begin_layout Plain Layout
17478 \begin_inset Quotes erd
17482 \begin_inset Flex CharStyle:Code
17485 \begin_layout Plain Layout
17491 is the LyX name of the inset, made lowercase and with non-alphanumeric
17492 characters converted to underscores, for example: footnote.
17495 \begin_layout Description
17496 \begin_inset Flex CharStyle:Code
17499 \begin_layout Plain Layout
17506 \begin_inset Flex CharStyle:Code
17509 \begin_layout Plain Layout
17519 ] Whether to output the default CSS information LyX generates for this layout,
17520 even if additional information is explicitly provided via
17521 \begin_inset Flex CharStyle:Code
17524 \begin_layout Plain Layout
17532 \begin_inset Flex CharStyle:Code
17535 \begin_layout Plain Layout
17541 allows you to alter or augment the generated CSS, rather than to override
17546 \begin_layout Description
17547 \begin_inset Flex CharStyle:Code
17550 \begin_layout Plain Layout
17557 \begin_inset Flex CharStyle:Code
17560 \begin_layout Plain Layout
17566 ] Attributes for the inner tag.
17568 \begin_inset Quotes eld
17572 \begin_inset Flex CharStyle:Code
17575 \begin_layout Plain Layout
17576 class=`insetname_inner'
17582 \begin_inset Quotes erd
17588 \begin_layout Description
17589 \begin_inset Flex CharStyle:Code
17592 \begin_layout Plain Layout
17599 \begin_inset Flex CharStyle:Code
17602 \begin_layout Plain Layout
17608 ] The inner tag, replacing
17609 \begin_inset Flex CharStyle:Code
17612 \begin_layout Plain Layout
17618 in the examples above.
17619 By default, there is none.
17622 \begin_layout Description
17623 \begin_inset Flex CharStyle:Code
17626 \begin_layout Plain Layout
17633 \begin_inset Flex CharStyle:Code
17636 \begin_layout Plain Layout
17644 ] Whether this inset represents a standalone block of text (such as a footnote)
17645 or instead represents material that is included in the surrounding text
17646 (such as a branch).
17650 \begin_layout Description
17651 \begin_inset Flex CharStyle:Code
17654 \begin_layout Plain Layout
17661 \begin_inset Flex CharStyle:Code
17664 \begin_layout Plain Layout
17670 ] A label for this inset, possibly including a reference to a counter.
17671 For example, for footnote, it might be:
17672 \begin_inset Flex CharStyle:Code
17675 \begin_layout Plain Layout
17684 This is optional, and there is no default.
17687 \begin_layout Description
17688 \begin_inset Flex CharStyle:Code
17691 \begin_layout Plain Layout
17697 Information to be output in the
17698 \begin_inset Flex CharStyle:Code
17701 \begin_layout Plain Layout
17707 section when this style is used.
17708 This might, for example, be used to include a
17709 \begin_inset Flex CharStyle:Code
17712 \begin_layout Plain Layout
17719 \begin_inset Flex CharStyle:Code
17722 \begin_layout Plain Layout
17731 \begin_layout Description
17732 \begin_inset Flex CharStyle:Code
17735 \begin_layout Plain Layout
17741 CSS style information to be included when this style is used.
17742 Note that this will automatically be wrapped in a layout-generated
17743 \begin_inset Flex CharStyle:Code
17746 \begin_layout Plain Layout
17752 block, so only the CSS itself need be included.
17755 \begin_layout Description
17756 \begin_inset Flex CharStyle:Code
17759 \begin_layout Plain Layout
17766 \begin_inset Flex CharStyle:Code
17769 \begin_layout Plain Layout
17775 ] The tag to be used for the main label, replacing
17776 \begin_inset Flex CharStyle:Code
17779 \begin_layout Plain Layout
17785 in the examples above.
17786 The default depends upon the setting of
17787 \begin_inset Flex CharStyle:Code
17790 \begin_layout Plain Layout
17797 \begin_inset Flex CharStyle:Code
17800 \begin_layout Plain Layout
17806 is true, the default is
17807 \begin_inset Flex CharStyle:Code
17810 \begin_layout Plain Layout
17816 ; if it is false, the default is
17817 \begin_inset Flex CharStyle:Code
17820 \begin_layout Plain Layout
17829 \begin_layout Subsection
17833 \begin_layout Standard
17834 The XHTML output for floats too can be controlled by layout information.
17835 The output has the following form:
17838 \begin_layout LyX-Code
17840 \begin_inset Quotes erd
17844 \begin_inset Quotes erd
17850 \begin_layout LyX-Code
17851 Contents of the float.
17854 \begin_layout LyX-Code
17858 \begin_layout Standard
17859 The caption, if there is one, is a separate inset and will be output as
17861 Its appearance can be controlled via the InsetLayout for caption insets.
17865 \begin_layout Description
17866 \begin_inset Flex CharStyle:Code
17869 \begin_layout Plain Layout
17876 \begin_inset Flex CharStyle:Code
17879 \begin_layout Plain Layout
17885 ] Specifies attribute information to be output with the main tag.
17887 \begin_inset Quotes eld
17891 \begin_inset Flex CharStyle:Code
17894 \begin_layout Plain Layout
17895 class=`myfloat' onclick=`\SpecialChar \ldots{}
17902 \begin_inset Quotes erd
17906 By default, LyX will output
17907 \begin_inset Quotes eld
17911 \begin_inset Flex CharStyle:Code
17914 \begin_layout Plain Layout
17915 class=`float float-floattype'
17921 \begin_inset Quotes erd
17925 \begin_inset Flex CharStyle:Code
17928 \begin_layout Plain Layout
17934 is LyX's name for this type of float, as determined by the float delcaration
17936 \begin_inset CommandInset ref
17938 reference "sub:Floats"
17942 ), though made lowercase and with non-alphanumeric characters converted
17943 to underscores, for example: float-table.
17946 \begin_layout Description
17947 \begin_inset Flex CharStyle:Code
17950 \begin_layout Plain Layout
17956 CSS style information to be included when this float is used.
17957 Note that this will automatically be wrapped in a layout-generated
17958 \begin_inset Flex CharStyle:Code
17961 \begin_layout Plain Layout
17967 block, so only the CSS itself need be included.
17970 \begin_layout Description
17971 \begin_inset Flex CharStyle:Code
17974 \begin_layout Plain Layout
17981 \begin_inset Flex CharStyle:Code
17984 \begin_layout Plain Layout
17990 ] The tag to be used for this float, replacing
17991 \begin_inset Quotes eld
17995 \begin_inset Flex CharStyle:Code
17998 \begin_layout Plain Layout
18005 \begin_inset Quotes erd
18008 in the example above.
18010 \begin_inset Flex CharStyle:Code
18013 \begin_layout Plain Layout
18019 and will rarely need changing.
18022 \begin_layout Subsection
18023 Bibliography formatting
18026 \begin_layout Standard
18027 The bibliography can be formatted using
18028 \begin_inset Flex CharStyle:Code
18031 \begin_layout Plain Layout
18039 \begin_inset CommandInset ref
18041 reference "sub:Citation-format-description"
18048 \begin_layout Subsection
18052 \begin_layout Standard
18053 We have several times mentioned that LyX will generate default CSS style
18054 rules for both insets and paragraph styles, based upon the other layout
18055 information that is provided.
18056 In this section, we shall say a word about which layout information LyX
18060 \begin_layout Standard
18061 At present, LyX auto-generates CSS only for font information, making use
18063 \begin_inset Flex CharStyle:Code
18066 \begin_layout Plain Layout
18073 \begin_inset Flex CharStyle:Code
18076 \begin_layout Plain Layout
18083 \begin_inset Flex CharStyle:Code
18086 \begin_layout Plain Layout
18093 \begin_inset Flex CharStyle:Code
18096 \begin_layout Plain Layout
18103 \begin_inset Flex CharStyle:Code
18106 \begin_layout Plain Layout
18114 \begin_inset CommandInset ref
18116 reference "sub:Font-description"
18120 .) The translation is mostly straightforward and obvious.
18122 \begin_inset Quotes eld
18126 \begin_inset Flex CharStyle:Code
18129 \begin_layout Plain Layout
18136 \begin_inset Quotes erd
18140 \begin_inset Quotes eld
18144 \begin_inset Flex CharStyle:Code
18147 \begin_layout Plain Layout
18148 font-family: sans-serif;
18154 \begin_inset Quotes erd
18158 The correspondence of LyX sizes and CSS sizes is a little less obvious
18159 but nonetheless intuitive.
18161 \begin_inset Flex CharStyle:Code
18164 \begin_layout Plain Layout
18171 \begin_inset Flex URL
18174 \begin_layout Plain Layout
18185 \begin_layout Chapter
18186 Including External Material
18189 \begin_layout Standard
18190 \begin_inset Box Shadowbox
18200 height_special "totalheight"
18203 \begin_layout Plain Layout
18204 WARNING: This portion of the documentation has not been updated for some
18206 We certainly hope that it is still accurate, but there are no guarantees.
18214 \begin_layout Standard
18215 The use of material from sources external to LyX is covered in detail in
18221 This part of the manual covers what needs to happen behind the scenes for
18222 new sorts of material to be included.
18225 \begin_layout Section
18229 \begin_layout Standard
18230 The external material feature is based on the concept of a
18235 A template is a specification of how LyX should interface with a certain
18237 As bundled, LyX comes with predefined templates for Xfig figures, various
18238 raster format images, chess diagrams, and LilyPond music notation.
18239 You can check the actual list by using the menu
18240 \begin_inset Flex CharStyle:MenuItem
18243 \begin_layout Plain Layout
18244 Insert\SpecialChar \menuseparator
18245 File\SpecialChar \menuseparator
18252 Furthermore, it is possible to roll your own template to support a specific
18254 Later we'll describe in more detail what is involved, and hopefully you
18255 will submit all the templates you create so we can include them in a later
18259 \begin_layout Standard
18260 Another basic idea of the external material feature is to distinguish between
18261 the original file that serves as a base for final material and the produced
18262 file that is included in your exported or printed document.
18263 For example, consider the case of a figure produced with
18264 \begin_inset Flex CharStyle:Code
18267 \begin_layout Plain Layout
18274 The Xfig application itself works on an original file with the
18275 \begin_inset Flex CharStyle:Code
18278 \begin_layout Plain Layout
18285 Within Xfig, you create and change your figure, and when you are done,
18287 \begin_inset Flex CharStyle:Code
18290 \begin_layout Plain Layout
18297 When you want to include the figure in your document, you invoke
18298 \begin_inset Flex CharStyle:Code
18301 \begin_layout Plain Layout
18307 in order to create a PostScript file that can readily be included in your
18310 \begin_inset Flex CharStyle:Code
18313 \begin_layout Plain Layout
18319 file is the original file, and the PostScript file is the produced file.
18322 \begin_layout Standard
18323 This distinction is important in order to allow updating of the material
18324 while you are in the process of writing the document.
18325 Furthermore, it provides us with the flexibility that is needed to support
18326 multiple export formats.
18327 For instance, in the case of a plain text file, it is not exactly an award-winn
18328 ing idea to include the figure as raw PostScript.
18329 Instead, you'd either prefer to just include a reference to the figure
18330 or try to invoke some graphics to ASCII converter to make the final result
18331 look similar to the real graphics.
18332 The external material management allows you to do this, because it is parametri
18333 zed on the different export formats that LyX supports.
18336 \begin_layout Standard
18337 Besides supporting the production of different products according to the
18338 exported format, it supports tight integration with editing and viewing
18340 In the case of an Xfig figure, you are able to invoke Xfig on the original
18341 file with a single click from within the external material dialog in LyX,
18342 and also preview the produced PostScript file with Ghostview with another
18344 No more fiddling around with the command line and/or file browsers to locate
18345 and manipulate the original or produced files.
18346 In this way, you are finally able to take full advantage of the many different
18347 applications that are relevant to use when you write your documents, and
18348 ultimately be more productive.
18351 \begin_layout Section
18352 The external template configuration file
18355 \begin_layout Standard
18356 It is relatively easy to add custom external template definitions to LyX.
18357 However, be aware that doing this in an careless manner most probably
18361 introduce an easily exploitable security hole.
18362 So before you do this, please read the discussion about security in section
18364 \begin_inset CommandInset ref
18366 reference "sec:Security-discussion"
18373 \begin_layout Standard
18374 Having said that, we encourage you to submit any interesting templates that
18379 \begin_layout Standard
18380 The external templates are defined in the
18381 \begin_inset Flex CharStyle:Code
18384 \begin_layout Plain Layout
18385 LyXDir/lib/external_templates
18391 You can place your own version in
18392 \begin_inset Flex CharStyle:Code
18395 \begin_layout Plain Layout
18396 UserDir/external_templates
18404 \begin_layout Standard
18405 A typical template looks like this:
18408 \begin_layout LyX-Code
18412 \begin_layout LyX-Code
18413 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18416 \begin_layout LyX-Code
18420 \begin_layout LyX-Code
18424 \begin_layout LyX-Code
18428 \begin_layout LyX-Code
18432 \begin_layout LyX-Code
18436 \begin_layout LyX-Code
18437 AutomaticProduction true
18440 \begin_layout LyX-Code
18444 \begin_layout LyX-Code
18448 \begin_layout LyX-Code
18452 \begin_layout LyX-Code
18453 TransformCommand Rotate RotationLatexCommand
18456 \begin_layout LyX-Code
18457 TransformCommand Resize ResizeLatexCommand
18460 \begin_layout LyX-Code
18461 Product "$$RotateFront$$ResizeFront
18464 \begin_layout LyX-Code
18469 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18472 \begin_layout LyX-Code
18473 $$ResizeBack$$RotateBack"
18476 \begin_layout LyX-Code
18480 \begin_layout LyX-Code
18481 UpdateResult "$$AbsPath$$Basename.pstex_t"
18484 \begin_layout LyX-Code
18485 Requirement "graphicx"
18488 \begin_layout LyX-Code
18489 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18492 \begin_layout LyX-Code
18493 ReferencedFile latex "$$AbsPath$$Basename.eps"
18496 \begin_layout LyX-Code
18497 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18500 \begin_layout LyX-Code
18504 \begin_layout LyX-Code
18508 \begin_layout LyX-Code
18509 TransformCommand Rotate RotationLatexCommand
18512 \begin_layout LyX-Code
18513 TransformCommand Resize ResizeLatexCommand
18516 \begin_layout LyX-Code
18517 Product "$$RotateFront$$ResizeFront
18520 \begin_layout LyX-Code
18525 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18528 \begin_layout LyX-Code
18529 $$ResizeBack$$RotateBack"
18532 \begin_layout LyX-Code
18533 UpdateFormat pdftex
18536 \begin_layout LyX-Code
18537 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18540 \begin_layout LyX-Code
18541 Requirement "graphicx"
18544 \begin_layout LyX-Code
18545 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18548 \begin_layout LyX-Code
18549 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18552 \begin_layout LyX-Code
18556 \begin_layout LyX-Code
18560 \begin_layout LyX-Code
18561 Product "$$Contents(
18563 "$$AbsPath$$Basename.asc
18568 \begin_layout LyX-Code
18569 UpdateFormat asciixfig
18572 \begin_layout LyX-Code
18573 UpdateResult "$$AbsPath$$Basename.asc"
18576 \begin_layout LyX-Code
18580 \begin_layout LyX-Code
18584 \begin_layout LyX-Code
18585 Product "<graphic fileref=
18587 "$$AbsOrRelPathMaster$$Basename.eps
18592 \begin_layout LyX-Code
18596 \begin_layout LyX-Code
18600 \begin_layout LyX-Code
18601 UpdateResult "$$AbsPath$$Basename.eps"
18604 \begin_layout LyX-Code
18605 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18608 \begin_layout LyX-Code
18609 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18612 \begin_layout LyX-Code
18616 \begin_layout LyX-Code
18617 Product "[XFig: $$FName]"
18620 \begin_layout LyX-Code
18624 \begin_layout LyX-Code
18628 \begin_layout Standard
18629 As you can see, the template is enclosed in
18630 \begin_inset Flex CharStyle:Code
18633 \begin_layout Plain Layout
18639 \SpecialChar \ldots{}
18641 \begin_inset Flex CharStyle:Code
18644 \begin_layout Plain Layout
18651 It contains a header specifying some general settings and, for each supported
18652 primary document file format, a section
18653 \begin_inset Flex CharStyle:Code
18656 \begin_layout Plain Layout
18662 \SpecialChar \ldots{}
18664 \begin_inset Flex CharStyle:Code
18667 \begin_layout Plain Layout
18676 \begin_layout Subsection
18677 The template header
18680 \begin_layout Description
18681 \begin_inset Flex CharStyle:Code
18684 \begin_layout Plain Layout
18685 AutomaticProduction
18686 \begin_inset space ~
18694 Whether the file represented by the template must be generated by LyX.
18695 This command must occur exactly once.
18698 \begin_layout Description
18699 \begin_inset Flex CharStyle:Code
18702 \begin_layout Plain Layout
18704 \begin_inset space ~
18712 A glob pattern that is used in the file dialog to filter out the desired
18714 If there is more than one possible file extension (e.
18715 \begin_inset space \thinspace{}
18719 \begin_inset space \space{}
18723 \begin_inset Flex CharStyle:Code
18726 \begin_layout Plain Layout
18733 \begin_inset Flex CharStyle:Code
18736 \begin_layout Plain Layout
18742 ), use something like
18743 \begin_inset Flex CharStyle:Code
18746 \begin_layout Plain Layout
18753 This command must occur exactly once.
18756 \begin_layout Description
18757 \begin_inset Flex CharStyle:Code
18760 \begin_layout Plain Layout
18762 \begin_inset space ~
18770 The text that is displayed on the button.
18771 This command must occur exactly once.
18774 \begin_layout Description
18775 \begin_inset Flex CharStyle:Code
18778 \begin_layout Plain Layout
18780 \begin_inset space ~
18784 \begin_inset space ~
18792 The help text that is used in the External dialog.
18793 Provide enough information to explain to the user just what the template
18794 can provide him with.
18795 This command must occur exactly once.
18798 \begin_layout Description
18799 \begin_inset Flex CharStyle:Code
18802 \begin_layout Plain Layout
18804 \begin_inset space ~
18812 The file format of the original file.
18813 This must be the name of a format that is known to LyX (see section
18814 \begin_inset CommandInset ref
18816 reference "sec:Formats"
18822 \begin_inset Quotes eld
18826 \begin_inset Flex CharStyle:Code
18829 \begin_layout Plain Layout
18836 \begin_inset Quotes erd
18839 if the template can handle original files of more than one format.
18840 LyX will attempt to interrogate the file itself in order to deduce its
18841 format in this case.
18842 This command must occur exactly once.
18845 \begin_layout Description
18846 \begin_inset Flex CharStyle:Code
18849 \begin_layout Plain Layout
18851 \begin_inset space ~
18859 A unique name for the template.
18860 It must not contain substitution macros (see below).
18863 \begin_layout Description
18864 \begin_inset Flex CharStyle:Code
18867 \begin_layout Plain Layout
18869 \begin_inset space ~
18872 Rotate|Resize|Clip|Extra
18877 This command specifies which transformations are supported by this template.
18878 It may occur zero or more times.
18879 This command enables the corresponding tabs in the external dialog.
18881 \begin_inset Flex CharStyle:Code
18884 \begin_layout Plain Layout
18890 command must have either a corresponding
18891 \begin_inset Flex CharStyle:Code
18894 \begin_layout Plain Layout
18901 \begin_inset Flex CharStyle:Code
18904 \begin_layout Plain Layout
18911 \begin_inset Flex CharStyle:Code
18914 \begin_layout Plain Layout
18921 Otherwise the transformation will not be supported by that format.
18924 \begin_layout Subsection
18928 \begin_layout Description
18929 \begin_inset Flex CharStyle:Code
18932 \begin_layout Plain Layout
18934 \begin_inset space ~
18937 LaTeX|PDFLaTeX|PlainText|DocBook
18942 The primary document file format that this format definition is for.
18943 Not every template has a sensible representation in all document file formats.
18944 Please define nevertheless a
18945 \begin_inset Flex CharStyle:Code
18948 \begin_layout Plain Layout
18954 section for all formats.
18955 Use a dummy text when no representation is available.
18956 Then you can at least see a reference to the external material in the exported
18960 \begin_layout Description
18961 \begin_inset Flex CharStyle:Code
18964 \begin_layout Plain Layout
18966 \begin_inset space ~
18970 \begin_inset space ~
18978 This command defines an additional macro
18979 \begin_inset Flex CharStyle:Code
18982 \begin_layout Plain Layout
18988 for substitution in
18989 \begin_inset Flex CharStyle:Code
18992 \begin_layout Plain Layout
19000 \begin_inset Flex CharStyle:Code
19003 \begin_layout Plain Layout
19009 itself may contain substitution macros.
19010 The advantage over using
19011 \begin_inset Flex CharStyle:Code
19014 \begin_layout Plain Layout
19021 \begin_inset Flex CharStyle:Code
19024 \begin_layout Plain Layout
19030 is that the substituted value of
19031 \begin_inset Flex CharStyle:Code
19034 \begin_layout Plain Layout
19040 is sanitized so that it is a valid optional argument in the document format.
19041 This command may occur zero or more times.
19044 \begin_layout Description
19045 \begin_inset Flex CharStyle:Code
19048 \begin_layout Plain Layout
19050 \begin_inset space ~
19058 The text that is inserted in the exported document.
19059 This is actually the most important command and can be quite complex.
19060 This command must occur exactly once.
19063 \begin_layout Description
19064 \begin_inset Flex CharStyle:Code
19067 \begin_layout Plain Layout
19069 \begin_inset space ~
19077 This command specifies a preamble snippet that will be included in the
19079 It has to be defined using
19080 \begin_inset Flex CharStyle:Code
19083 \begin_layout Plain Layout
19089 \SpecialChar \ldots{}
19091 \begin_inset Flex CharStyle:Code
19094 \begin_layout Plain Layout
19101 This command may occur zero or more times.
19104 \begin_layout Description
19105 \begin_inset Flex CharStyle:Code
19108 \begin_layout Plain Layout
19110 \begin_inset space ~
19114 \begin_inset space ~
19122 This command denotes files that are created by the conversion process and
19123 are needed for a particular export format.
19124 If the filename is relative, it is interpreted relative to the master document.
19125 This command may be given zero or more times.
19128 \begin_layout Description
19129 \begin_inset Flex CharStyle:Code
19132 \begin_layout Plain Layout
19134 \begin_inset space ~
19142 The name of a required LaTeX package.
19143 The package is included via
19144 \begin_inset Flex CharStyle:Code
19147 \begin_layout Plain Layout
19155 in the LaTeX preamble.
19156 This command may occur zero or more times.
19159 \begin_layout Description
19160 \begin_inset Flex CharStyle:Code
19163 \begin_layout Plain Layout
19165 \begin_inset space ~
19169 \begin_inset space ~
19172 RotationLatexCommand
19177 This command specifies that the built in LaTeX command should be used for
19179 This command may occur once or not at all.
19182 \begin_layout Description
19183 \begin_inset Flex CharStyle:Code
19186 \begin_layout Plain Layout
19188 \begin_inset space ~
19192 \begin_inset space ~
19200 This command specifies that the built in LaTeX command should be used for
19202 This command may occur once or not at all.
19205 \begin_layout Description
19206 \begin_inset Flex CharStyle:Code
19209 \begin_layout Plain Layout
19211 \begin_inset space ~
19215 \begin_inset space ~
19218 RotationLatexOption
19223 This command specifies that rotation is done via an optional argument.
19224 This command may occur once or not at all.
19227 \begin_layout Description
19228 \begin_inset Flex CharStyle:Code
19231 \begin_layout Plain Layout
19233 \begin_inset space ~
19237 \begin_inset space ~
19245 This command specifies that resizing is done via an optional argument.
19246 This command may occur once or not at all.
19249 \begin_layout Description
19250 \begin_inset Flex CharStyle:Code
19253 \begin_layout Plain Layout
19255 \begin_inset space ~
19259 \begin_inset space ~
19267 This command specifies that clipping is done via an optional argument.
19268 This command may occur once or not at all.
19271 \begin_layout Description
19272 \begin_inset Flex CharStyle:Code
19275 \begin_layout Plain Layout
19277 \begin_inset space ~
19281 \begin_inset space ~
19289 This command specifies that an extra optional argument is used.
19290 This command may occur once or not at all.
19293 \begin_layout Description
19294 \begin_inset Flex CharStyle:Code
19297 \begin_layout Plain Layout
19299 \begin_inset space ~
19307 The file format of the converted file.
19308 This must be the name of a format that is known to LyX (see the
19309 \begin_inset Flex CharStyle:MenuItem
19312 \begin_layout Plain Layout
19317 ools\SpecialChar \menuseparator
19322 references:Conversion
19328 This command must occur exactly once.
19331 \begin_layout Description
19332 \begin_inset Flex CharStyle:Code
19335 \begin_layout Plain Layout
19337 \begin_inset space ~
19345 The file name of the converted file.
19346 The file name must be absolute.
19347 This command must occur exactly once.
19350 \begin_layout Subsection
19351 Preamble definitions
19354 \begin_layout Standard
19355 The external template configuration file may contain additional preamble
19356 definitions enclosed by
19357 \begin_inset Flex CharStyle:Code
19360 \begin_layout Plain Layout
19366 \SpecialChar \ldots{}
19368 \begin_inset Flex CharStyle:Code
19371 \begin_layout Plain Layout
19378 They can be used by the templates in the
19379 \begin_inset Flex CharStyle:Code
19382 \begin_layout Plain Layout
19391 \begin_layout Section
19392 The substitution mechanism
19395 \begin_layout Standard
19396 When the external material facility invokes an external program, it is done
19397 on the basis of a command defined in the template configuration file.
19398 These commands can contain various macros that are expanded before execution.
19399 Execution always take place in the directory of the containing document.
19402 \begin_layout Standard
19403 Also, whenever external material is to be displayed, the name will be produced
19404 by the substitution mechanism, and most other commands in the template
19405 definition support substitution as well.
19408 \begin_layout Standard
19409 The available macros are the following:
19412 \begin_layout Description
19413 \begin_inset Flex CharStyle:Code
19416 \begin_layout Plain Layout
19417 $$AbsOrRelPathMaster
19422 The file path, absolute or relative to the master LyX document.
19425 \begin_layout Description
19426 \begin_inset Flex CharStyle:Code
19429 \begin_layout Plain Layout
19430 $$AbsOrRelPathParent
19435 The file path, absolute or relative to the LyX document.
19438 \begin_layout Description
19439 \begin_inset Flex CharStyle:Code
19442 \begin_layout Plain Layout
19448 The absolute file path.
19451 \begin_layout Description
19452 \begin_inset Flex CharStyle:Code
19455 \begin_layout Plain Layout
19461 The filename without path and without the extension.
19464 \begin_layout Description
19465 \begin_inset Flex CharStyle:Code
19468 \begin_layout Plain Layout
19470 \begin_inset Quotes eld
19474 \begin_inset Quotes erd
19482 This macro will expand to the contents of the file with the name
19483 \begin_inset Flex CharStyle:Code
19486 \begin_layout Plain Layout
19495 \begin_layout Description
19496 \begin_inset Flex CharStyle:Code
19499 \begin_layout Plain Layout
19505 The file extension (including the dot).
19508 \begin_layout Description
19509 \begin_inset Flex CharStyle:Code
19512 \begin_layout Plain Layout
19518 The filename of the file specified in the external material dialog.
19519 This is either an absolute name, or it is relative to the LyX document.
19522 \begin_layout Description
19523 \begin_inset Flex CharStyle:Code
19526 \begin_layout Plain Layout
19533 \begin_inset Flex CharStyle:Code
19536 \begin_layout Plain Layout
19542 (absolute name or relative to the LyX document).
19545 \begin_layout Description
19546 \begin_inset Flex CharStyle:Code
19549 \begin_layout Plain Layout
19555 The file path, relative to the master LyX document.
19558 \begin_layout Description
19559 \begin_inset Flex CharStyle:Code
19562 \begin_layout Plain Layout
19568 The file path, relative to the LyX document.
19571 \begin_layout Description
19572 \begin_inset Flex CharStyle:Code
19575 \begin_layout Plain Layout
19581 This macro will expand to the absolute path of the system directory.
19582 This is typically used to point to the various helper scripts that are
19586 \begin_layout Description
19587 \begin_inset Flex CharStyle:Code
19590 \begin_layout Plain Layout
19596 A name and full path to a temporary file which will be automatically deleted
19597 whenever the containing document is closed, or the external material insertion
19601 \begin_layout Standard
19602 All path macros contain a trailing directory separator, so you can construct
19604 \begin_inset space \thinspace{}
19608 \begin_inset space \space{}
19611 the absolute filename with
19612 \begin_inset Flex CharStyle:Code
19615 \begin_layout Plain Layout
19616 $$AbsPath$$Basename$$Extension
19624 \begin_layout Standard
19625 The macros above are substituted in all commands unless otherwise noted.
19627 \begin_inset Flex CharStyle:Code
19630 \begin_layout Plain Layout
19636 supports additionally the following substitutions if they are enabled by
19638 \begin_inset Flex CharStyle:Code
19641 \begin_layout Plain Layout
19648 \begin_inset Flex CharStyle:Code
19651 \begin_layout Plain Layout
19660 \begin_layout Description
19661 \begin_inset Flex CharStyle:Code
19664 \begin_layout Plain Layout
19670 The front part of the resize command.
19673 \begin_layout Description
19674 \begin_inset Flex CharStyle:Code
19677 \begin_layout Plain Layout
19683 The back part of the resize command.
19686 \begin_layout Description
19687 \begin_inset Flex CharStyle:Code
19690 \begin_layout Plain Layout
19696 The front part of the rotation command.
19699 \begin_layout Description
19700 \begin_inset Flex CharStyle:Code
19703 \begin_layout Plain Layout
19709 The back part of the rotation command.
19712 \begin_layout Standard
19713 The value string of the
19714 \begin_inset Flex CharStyle:Code
19717 \begin_layout Plain Layout
19723 command supports additionally the following substitutions if they are enabled
19725 \begin_inset Flex CharStyle:Code
19728 \begin_layout Plain Layout
19735 \begin_inset Flex CharStyle:Code
19738 \begin_layout Plain Layout
19747 \begin_layout Description
19748 \begin_inset Flex CharStyle:Code
19751 \begin_layout Plain Layout
19760 \begin_layout Description
19761 \begin_inset Flex CharStyle:Code
19764 \begin_layout Plain Layout
19773 \begin_layout Description
19774 \begin_inset Flex CharStyle:Code
19777 \begin_layout Plain Layout
19786 \begin_layout Description
19787 \begin_inset Flex CharStyle:Code
19790 \begin_layout Plain Layout
19796 The rotation option.
19799 \begin_layout Standard
19800 You may ask why there are so many path macros.
19801 There are mainly two reasons:
19804 \begin_layout Enumerate
19805 Relative and absolute file names should remain relative or absolute, respectivel
19807 Users may have reasons to prefer either form.
19808 Relative names are useful for portable documents that should work on different
19809 machines, for example.
19810 Absolute names may be required by some programs.
19813 \begin_layout Enumerate
19814 LaTeX treats relative file names differently than LyX and other programs
19815 in nested included files.
19816 For LyX, a relative file name is always relative to the document that contains
19818 For LaTeX, it is always relative to the master document.
19819 These two definitions are identical if you have only one document, but
19820 differ if you have a master document that includes part documents.
19821 That means that relative filenames must be transformed when presented to
19823 Fortunately LyX does this automatically for you if you choose the right
19827 \begin_layout Standard
19828 So which path macro should be used in new template definitions? The rule
19832 \begin_layout Itemize
19834 \begin_inset Flex CharStyle:Code
19837 \begin_layout Plain Layout
19843 if an absolute path is required.
19846 \begin_layout Itemize
19848 \begin_inset Flex CharStyle:Code
19851 \begin_layout Plain Layout
19852 $$AbsOrRelPathMaster
19857 if the substituted string is some kind of LaTeX input.
19860 \begin_layout Itemize
19862 \begin_inset Flex CharStyle:Code
19865 \begin_layout Plain Layout
19866 $$AbsOrRelPathParent
19871 in order to preserve the user's choice.
19874 \begin_layout Standard
19875 There are special cases where this rule does not work and e.
19876 \begin_inset space \thinspace{}
19880 \begin_inset space \space{}
19883 relative names are needed, but normally it will work just fine.
19884 One example for such a case is the command
19885 \begin_inset Flex CharStyle:Code
19888 \begin_layout Plain Layout
19889 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
19894 in the XFig template above: We can't use the absolute name because the
19896 \begin_inset Flex CharStyle:Code
19899 \begin_layout Plain Layout
19905 files needs the relative name in order to rewrite the file content.
19908 \begin_layout Section
19909 Security discussion
19910 \begin_inset CommandInset label
19912 name "sec:Security-discussion"
19919 \begin_layout Standard
19920 The external material feature interfaces with a lot of external programs
19921 and does so automatically, so we have to consider the security implications
19923 In particular, since you have the option of including your own filenames
19924 and/or parameter strings and those are expanded into a command, it seems
19925 that it would be possible to create a malicious document which executes
19926 arbitrary commands when a user views or prints the document.
19927 This is something we definitely want to avoid.
19930 \begin_layout Standard
19931 However, since the external program commands are specified in the template
19932 configuration file only, there are no security issues if LyX is properly
19933 configured with safe templates only.
19934 This is so because the external programs are invoked with the
19935 \begin_inset Flex CharStyle:Code
19938 \begin_layout Plain Layout
19944 -system call rather than the
19945 \begin_inset Flex CharStyle:Code
19948 \begin_layout Plain Layout
19954 system-call, so it's not possible to execute arbitrary commands from the
19955 filename or parameter section via the shell.
19958 \begin_layout Standard
19959 This also implies that you are restricted in what command strings you can
19960 use in the external material templates.
19961 In particular, pipes and redirection are not readily available.
19962 This has to be so if LyX should remain safe.
19963 If you want to use some of the shell features, you should write a safe
19964 script to do this in a controlled manner, and then invoke the script from
19965 the command string.
19969 \begin_layout Standard
19970 It is possible to design a template that interacts directly with the shell,
19971 but since this would allow a malicious user to execute arbitrary commands
19972 by writing clever filenames and/or parameters, we generally recommend that
19973 you only use safe scripts that work with the
19974 \begin_inset Flex CharStyle:Code
19977 \begin_layout Plain Layout
19983 system call in a controlled manner.
19984 Of course, for use in a controlled environment, it can be tempting to just
19985 fall back to use ordinary shell scripts.
19986 If you do so, be aware that you
19990 provide an easily exploitable security hole in your system.
19991 Of course it stands to reason that such unsafe templates will never be
19992 included in the standard LyX distribution, although we do encourage people
19993 to submit new templates in the open source tradition.
19994 But LyX as shipped from the official distribution channels will never have
19998 \begin_layout Standard
19999 Including external material provides a lot of power, and you have to be
20000 careful not to introduce security hazards with this power.
20001 A subtle error in a single line in an innocent looking script can open
20002 the door to huge security problems.
20003 So if you do not fully understand the issues, we recommend that you consult
20004 a knowledgeable security professional or the LyX development team if you
20005 have any questions about whether a given template is safe or not.
20006 And do this before you use it in an uncontrolled environment.